Explorar o código

修复制单金额问题

wjj hai 1 día
pai
achega
071426a0a3
Modificáronse 1 ficheiros con 18 adicións e 0 borrados
  1. 18 0
      src/views/qw/companyCustomer/index.vue

+ 18 - 0
src/views/qw/companyCustomer/index.vue

@@ -871,6 +871,7 @@
             placeholder="请选择支付方式"
             clearable
             size="small"
+            @change="handlePayTypeChange"
           >
             <el-option
               v-for="item in payTypeOptions"
@@ -1378,6 +1379,7 @@ export default {
         payType: "",
         reduceAmount: 0,
         receiveMoneyId: null,
+        prepaidAmount: null,
       },
       receiptList: [],
       createOrderRules: {
@@ -1474,6 +1476,21 @@ export default {
   },
   methods: {
 
+     handlePayTypeChange(val) {
+      // 切换支付方式时,清空之前选择的收款记录和对应的抵扣金额
+      this.createOrderForm.receiveMoneyId = null;
+      this.createOrderForm.reduceAmount = null;
+      
+      // 如果切换到非"预付/线下"等特定支付方式,通常也建议清空预付金额输入框
+      // 假设 val == 5 是预付/线下支付(根据模板 v-if="createOrderForm.payType == 5" 推断)
+      if (val != 5) {
+        this.createOrderForm.prepaidAmount = null;
+      } else {
+        // 如果是预付模式,确保抵扣金额为0或null,避免冲突
+        this.createOrderForm.reduceAmount = null;
+      }
+    },
+
     handleSync(){
       syncKdzlMember().then(res => {
         this.msgSuccess("正在同步中...");
@@ -1799,6 +1816,7 @@ export default {
         payType: "",
         reduceAmount: 0,
         receiveMoneyId: null,
+        prepaidAmount: null,
       };
       this.products = [];
       this.giftProducts = [];