Explorar o código

Merge tag 'Hotfix-13' into develop

Finish Hotfix-13
chen %!s(int64=3) %!d(string=hai) anos
pai
achega
c7985d8c29
Modificáronse 1 ficheiros con 34 adicións e 4 borrados
  1. 34 4
      src/views/finance/rebate_form.vue

+ 34 - 4
src/views/finance/rebate_form.vue

@@ -379,16 +379,45 @@ export default {
       const formData = new FormData();
       formData.append("file", file);
 
-      let result = await handleImport("/rebate/order/import", formData);
+      let result = await handleImport("/rebate/order/import/data", formData);
 
       console.log(result);
       this.importFileList = [];
       if (result.code == 200) {
         this.$message.success("导入成功");
+        let Arr = result.data.items;
+
+        for (let v = 0; v < Arr.length; v++) {
+          let arr = await getWalletCustomerList({
+            customerId: Arr[v].customerId,
+            type: "REBATE",
+          });
+
+          console.log(arr, 1212);
+          this.dataList.push({
+            customerId: Arr[v].customerId,
+            customerNumber: Arr[v].customerNumber,
+            customerName: Arr[v].customerName,
+            customerWalletId: Arr[v].customerWalletId,
+            amount: Arr[v].amount,
+            withholdAmount: Arr[v].withholdAmount,
+            policyFileNo: Arr[v].policyFileNo,
+            policyDocNo: Arr[v].policyDocNo,
+            policyYear: Arr[v].policyYear,
+            policyMonth: Arr[v].policyMonth,
+            policyOrg: Arr[v].policyOrg,
+            customerArea: Arr[v].customerArea,
+            customerAttr: Arr[v].customerAttr,
+            rewardActualCustomers: Arr[v].rewardActualCustomers,
+            remark1: Arr[v].remark1,
+            remark2: Arr[v].remark2,
+            walletName: Arr[v].walletName,
+            walletList: arr.data,
+          });
+        }
       } else {
         this.$message.error(result.message);
-        this.$message.error(1231);
-
+        // this.$message.error(1231);
       }
     },
     //下载模板
@@ -435,7 +464,7 @@ export default {
         console.log(arr);
         v.walletName = arr[0].name;
       });
-      console.log(this.dataList);
+      console.log({ ...this.searchForm, items: this.dataList });
       await getRebateOrderAdd({ ...this.searchForm, items: this.dataList });
       this.$message.success("保存成功");
       this.$router.push("/finance/rebate/rebate_list");
@@ -461,6 +490,7 @@ export default {
       const res = await getCustomerList({ pageSize: -1, pageNum: 1 });
       this.customerData = res.data.records;
     },
+
     //添加行
     addRowFn() {
       this.dataList.push({