|
|
@@ -108,6 +108,14 @@
|
|
|
>
|
|
|
<selectSettle @settleReturn="settleReturn" ref="selectSettle" :totalShop="totalShop"></selectSettle>
|
|
|
</uniPopup>
|
|
|
+ <uniPopup
|
|
|
+ :show.sync="isShowCollectMoney"
|
|
|
+ type="top"
|
|
|
+ maxHeight="90vh"
|
|
|
+ >
|
|
|
+ <collectMoney @cancel="isShowCollectMoney=false" @collectMoneyBack="collectMoneyBack"></collectMoney>
|
|
|
+ <!-- <selectSettle @settleReturn="settleReturn" ref="selectSettle" :totalShop="totalShop"></selectSettle> -->
|
|
|
+ </uniPopup>
|
|
|
<NotLogin></NotLogin>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -121,16 +129,26 @@ import keyboardSetFlower from '@/components/app-boardSet-flower.vue'
|
|
|
import selectSettle from './components/select-settle.vue'
|
|
|
import selectUser from './components/select-user.vue'
|
|
|
import shopTypeSelect from './components/shopTypeSelect.vue'
|
|
|
+import collectMoney from '@/components/collect-money.vue'
|
|
|
import { createCreateOrder, wastageCreateOrder } from '@/api/home/index'
|
|
|
export default {
|
|
|
name: "workbench",
|
|
|
- components: { NotLogin,uniPopup,selectUser,shopTypeSelect,keyboardSetFlower,selectSettle },
|
|
|
+ components: {
|
|
|
+ NotLogin,
|
|
|
+ uniPopup,
|
|
|
+ selectUser,
|
|
|
+ shopTypeSelect,
|
|
|
+ keyboardSetFlower,
|
|
|
+ selectSettle,
|
|
|
+ collectMoney
|
|
|
+ },
|
|
|
mixins: [productMins,autoUpdateMixins],
|
|
|
data() {
|
|
|
return {
|
|
|
isShowFllowNum: false,
|
|
|
isShowUser: false,
|
|
|
isShowSettle: false,
|
|
|
+ isShowCollectMoney: false,
|
|
|
shopList:[],
|
|
|
currenSelectShop:{},
|
|
|
selectItem: {},
|
|
|
@@ -155,30 +173,32 @@ export default {
|
|
|
},
|
|
|
onShow() {
|
|
|
},
|
|
|
+ mounted(){
|
|
|
+ },
|
|
|
watch:{
|
|
|
- shopList(){
|
|
|
- if(this.$util.isEmpty(this.shopList)) {
|
|
|
- this.totalShop = {
|
|
|
- bigUnit: 0,
|
|
|
- smallUnit:0,
|
|
|
- totalPrice: 0
|
|
|
- }
|
|
|
- }
|
|
|
- this.totalShop = this.shopList.reduce((total,val)=>{
|
|
|
- // 0 大单位 1小单位
|
|
|
- if(val.unitType === 0) {
|
|
|
- total.bigUnit = total.bigUnit + (val.currentNum *1)
|
|
|
- }else {
|
|
|
- total.smallUnit = total.smallUnit +(1*val.currentNum)
|
|
|
- }
|
|
|
- total.totalPrice = total.totalPrice + (1*val.currentNum) * (val.currentUnitPrice*1)
|
|
|
- return total
|
|
|
- },{
|
|
|
+ shopList(){
|
|
|
+ if(this.$util.isEmpty(this.shopList)) {
|
|
|
+ this.totalShop = {
|
|
|
bigUnit: 0,
|
|
|
smallUnit:0,
|
|
|
totalPrice: 0
|
|
|
- })
|
|
|
- }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.totalShop = this.shopList.reduce((total,val)=>{
|
|
|
+ // 0 大单位 1小单位
|
|
|
+ if(val.unitType === 0) {
|
|
|
+ total.bigUnit = total.bigUnit + (val.currentNum *1)
|
|
|
+ }else {
|
|
|
+ total.smallUnit = total.smallUnit +(1*val.currentNum)
|
|
|
+ }
|
|
|
+ total.totalPrice = total.totalPrice + (1*val.currentNum) * (val.currentUnitPrice*1)
|
|
|
+ return total
|
|
|
+ },{
|
|
|
+ bigUnit: 0,
|
|
|
+ smallUnit:0,
|
|
|
+ totalPrice: 0
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
// 结算创建订单
|
|
|
@@ -205,6 +225,7 @@ export default {
|
|
|
remark:''
|
|
|
})
|
|
|
this.isShowSettle = false
|
|
|
+ this.isShowCollectMoney = true
|
|
|
this.$msg('订单创建成功')
|
|
|
}catch(err) {
|
|
|
console.log(err)
|
|
|
@@ -267,9 +288,8 @@ export default {
|
|
|
if(this.$util.isEmpty(this.selectCurrentActiveItem)) {
|
|
|
this.$msg('请选择要删除的商品')
|
|
|
}
|
|
|
- let index = this.shopList.findIndex(i=>this.selectCurrentActiveItem.id === i.id)
|
|
|
- this.shopList = this.shopList.filter(i=>this.selectCurrentActiveItem.id !== i.id)
|
|
|
- // this.selectCurrentActiveItem
|
|
|
+ let index = this.shopList.findIndex(i=>this.selectCurrentActiveItem.id === i.id)
|
|
|
+ this.shopList = this.shopList.filter(i=>this.selectCurrentActiveItem.id !== i.id)
|
|
|
},
|
|
|
selectItemChange(item){
|
|
|
this.selectItem = {
|
|
|
@@ -277,13 +297,16 @@ export default {
|
|
|
currentUnit:item.bigUnit,
|
|
|
currentUnitPrice:item.property==1?item.bigPrice:item.price,
|
|
|
currentNum: 0,
|
|
|
- unitType: 0
|
|
|
+ unitType: 0
|
|
|
}
|
|
|
this.isShowFllowNum = true
|
|
|
},
|
|
|
enterReturn(item){
|
|
|
this.isShowFllowNum = false
|
|
|
this.shopList.push(item)
|
|
|
+ },
|
|
|
+ collectMoneyBack(price){
|
|
|
+ console.log(price)
|
|
|
}
|
|
|
}
|
|
|
};
|