浏览代码

feat: 回款计划、业绩归属数据更新逻辑调整

cuiyalong 2 月之前
父节点
当前提交
c194cc0229

+ 1 - 0
src/views/create-order/components/order-detail-submodule/PaymentPlan.vue

@@ -41,6 +41,7 @@ export default {
   watch: {
     orderDetail: {
       deep: true,
+      immediate: true,
       handler() {
         this.$nextTick(() => {
           this.getPaymentPlanList()

+ 13 - 5
src/views/create-order/components/paymentPlanModule.vue

@@ -47,7 +47,7 @@
             <template slot-scope="scope">
               <number-input
                 :value="paybackTableData[scope.$index].money"
-                @input="onPaybackSplitMoneyChange(scope, $event)"
+                @input="onPaybackSplitMoneyChange({ $index: scope.$index, money: scope.row.money }, $event)"
                 type="number"
                 placeholder="请输入"
                 :min="0"
@@ -168,7 +168,10 @@ export default {
     },
     buySubject() {
       this.reset()
-    }
+    },
+    exceptedPayBackMoney() {
+      this.clearTableKey('money')
+    },
   },
   methods: {
     reset() {
@@ -235,8 +238,8 @@ export default {
 
       return lastMoney
     },
-    onPaybackSplitMoneyChange(scope, e) {
-      const index = scope.$index
+    onPaybackSplitMoneyChange({ $index, money }, e) {
+      const index = $index
       this.onChangeTableLineData('money', index, e)
       if (!this.pageTotalMoney.hasContract) {
         this.onChangeTableLineData('money', index, '')
@@ -245,7 +248,7 @@ export default {
           type: 'warning'
         })
       }
-      if (scope.row.money === 0 || scope.row.money === '0') {
+      if (money === 0 || money === '0') {
         this.onChangeTableLineData('money', index, '')
         return this.$message({
           message: '不可为0',
@@ -309,6 +312,11 @@ export default {
     clearPaybackTableData() {
       this.setPageFormData('paybackTableData', [])
     },
+    clearTableKey(key) {
+      this.paybackTableData.forEach((p, index) => {
+        this.onChangeTableLineData(key, index, '')
+      })
+    },
     initPaybackTableData() {
       const arr = new Array(this.pageForm.paybackTimes - 0).fill(undefined).map(() => new PayBackTableRow())
       // this.paybackTableData = arr

+ 9 - 5
src/views/create-order/components/performanceBelongs.vue

@@ -15,6 +15,7 @@
           :data="salePersonTableList"
           :summary-method="getSummaries"
           :show-summary="showSummary"
+          ref="salePersonTable"
           stripe
           border>
           <el-table-column
@@ -41,7 +42,7 @@
             <template slot-scope="scope">
               <number-input
                 :value="salePersonTableList[scope.$index].money"
-                @input="onSalePersonSplitMoneyChange(scope, $event)"
+                @input="onSalePersonSplitMoneyChange({ $index: scope.$index, money: scope.row.money }, $event)"
                 :disabled="getSaleMoneyDisabled(scope)"
                 type="number"
                 :decimal="2"
@@ -228,7 +229,10 @@ export default {
       handler() {
         this.setDefaultUserFn()
       }
-    }
+    },
+    salesMoneyTotalNum() {
+      this.clearTableMoneyInput()
+    },
   },
   methods: {
     updateSyncData(type, e) {
@@ -406,8 +410,8 @@ export default {
       }
       return false
     },
-    onSalePersonSplitMoneyChange(scope, e) {
-      const index = scope.$index
+    onSalePersonSplitMoneyChange({ $index, money }, e) {
+      const index = $index
       this.onChangeTableLineData('money', index, e)
       if (!this.hasContract) {
         this.onChangeTableLineData('money', index, '')
@@ -416,7 +420,7 @@ export default {
           type: 'warning'
         })
       }
-      if (scope.row.money === 0 || scope.row.money === '0') {
+      if (money === 0 || money === '0') {
         this.onChangeTableLineData('money', index, '')
         return this.$message({
           message: '不可为0',

+ 4 - 1
src/views/create-order/components/product-info-submodule/ServiceList.vue

@@ -14,7 +14,7 @@
           </div>
           <div class="service-list-item-content">
             <template v-if="Array.isArray(service.children) && service.children.length > 0">
-              <div class="service-list-group" v-for="sc in service.children" v-show="!sc.hide" :key="sc.value">
+              <div class="service-list-group" v-for="sc in service.children" v-show="!sc.hide" :key="sc.value" :class="{ 'text-disabled': service.disabled }">
                 <template v-if="sc.value === 1">
                   {{ sc.label }}
                 </template>
@@ -792,4 +792,7 @@ export default {
 .already-buy-text {
   line-height: 32px;
 }
+.text-disabled {
+  color: #C0C4CC;
+}
 </style>

+ 2 - 2
src/views/create-order/components/schema-form/schema-form.vue

@@ -378,7 +378,7 @@ export default {
         this.$alert('该客户暂无相同产品类型订单,不支持续费', '提示', {
           confirmButtonText: '我知道了',
           callback: action => {
-            if (action === 'confirm') {
+            if (action === 'confirm' || action === 'cancel') {
               this.removeProductItem({ index: this.index })
             }
           }
@@ -388,7 +388,7 @@ export default {
           this.$alert('已存在未生效订单', '提示', {
             confirmButtonText: '确定',
             callback: action => {
-              if (action === 'confirm') {
+              if (action === 'confirm' || action === 'cancel') {
                 this.removeProductItem({ index: this.index })
               }
             }