Преглед изворни кода

批发商做到了结算步骤

shish пре 4 година
родитељ
комит
d4e3cf05a7

+ 12 - 7
ghsPad/src/admin/home/components/middleButton.vue

@@ -5,7 +5,7 @@
     <view @click="resetCustomer">选客户</view>
     <view @click="clearItemFn">清空花材</view>
     <view @click="breakage">报损</view>
-    <view @click="settle">结算 </view>
+    <view @click="goToSettle">结算 </view>
 
     <!-- 清空花材 -->
     <uni-popup ref="clearItemRef" type="dialog">
@@ -31,11 +31,16 @@
 import settlePop from './settle-pop.vue'
 import selectPayWay from '@/components/select-pay-way.vue'
 import { createCreateOrder, wastageCreateOrder } from '@/api/home/index'
+import productMins from "@/mixins/product";
 export default {
     name:'middleButton',
-    mixins:{},
+	mixins: [productMins],
     components:{ settlePop,selectPayWay },
 	props: {
+		customId: {
+			type: Number,
+			default: 0
+		}
     },
     data(){
         return {
@@ -59,7 +64,7 @@ export default {
 				let arr = this.itemList.map(i=>({ productId:i.id, unitType: i.unitType, num: i.currentNum, property: i.property, unitPrice: i.currentUnitPrice }))
 				const {settleId,payId,payUserId,isPrint,proceeds,freight} = this.$refs.settlePop
 				await createCreateOrder({
-					customId: this.selectItemUser.id,
+					customId: this.customId,
 					product: JSON.stringify(arr),
 					modifyPrice: proceeds,
 					sendType: 1,
@@ -91,7 +96,7 @@ export default {
 		},
 		breakage(){
 			this.$util.hitRemind()
-			if(this.$util.isEmpty(this.itemList)) {
+			if(this.$util.isEmpty(this.selectList)) {
 				this.$msg('请选择报损花材')
 				return false
 			}
@@ -112,13 +117,13 @@ export default {
 				}
 			})
 		},
-		settle(){
+		goToSettle(){
 			this.$util.hitRemind()
-			if(this.$util.isEmpty(this.itemList)) {
+			if(this.$util.isEmpty(this.selectList)) {
 				this.$msg('请选择结算花材')
 				return false
 			}
-			if(this.$util.isEmpty(this.selectItemUser)) {
+			if(this.$util.isEmpty(this.customId)) {
 				this.$msg('请选择客户')
 				return false
 			}

+ 1 - 1
ghsPad/src/admin/home/workbench.vue

@@ -19,7 +19,7 @@
 			</view>
 			<!-- 按钮操作 -->
 			<view class="open-box">
-				<middleButton @resetCustomer="resetCustomer"></middleButton>
+				<middleButton @resetCustomer="resetCustomer" :customId.sync="customId"></middleButton>
 			</view>
 			<!-- 分类和花材图片 -->
 			<view class="all-item-area">