Parcourir la source

销售政策新增增加判断、返利互转申请获取返利类型

zhouhao il y a 2 ans
Parent
commit
7387e8c695

+ 7 - 3
src/views/finance/change_apply.vue

@@ -260,9 +260,12 @@ export default {
     // },
     changeCustomerNumber(e,index){
       if (!index) {
-      this.searchForm.customerName = this.customerData.find(k=>{
+      const customerData  = this.customerData.find(k=>{
        return  k.number === e
-      }).name
+      })
+      this.searchForm.customerName  = customerData.name
+      this.$set(this.dataList[index],'customerId',customerData.id)
+
       }else{
         const id = this.customerData.find(k=>{
        return  k.number === e
@@ -286,7 +289,8 @@ export default {
 
     // //返利类型数据
     async changeCustomerFn(v, index) {
-      if (v.customerId == '') {
+      console.log(v);
+      if (v.customerId == '' ) {
         return
       }
 

+ 6 - 8
src/views/sales_policy/components/AddPolicy.vue

@@ -855,9 +855,10 @@ export default {
         return
       }
 
-      const fomrtData = () => {
+      const fomrtData = (type) => {
         var arr = []
-        policyCustomers.forEach(el => {
+        if (type != 'assign') {
+          policyCustomers.forEach(el => {
           arr.push({
             customerId: el.id,
             customerName: el.name,
@@ -869,11 +870,8 @@ export default {
             remark: ''
           })
         })
-        // this.dictList.forEach((k) => {
-        //   if (k.dictCode == this.searchForm.mainId) {
-        //     this.searchForm.mainName = k.dictValue;
-        //   }
-        // });
+        } 
+
         let imgUrl = []
         this.fileList.forEach(k=>{
               imgUrl.push(k.url)
@@ -912,7 +910,7 @@ export default {
           this.$errorMsg('选择经销商 ')
         }
       } else {
-        fomrtData()
+        fomrtData('assign')
       }
     },
     // 删除