Browse Source

Merge tag 'Hotfix-98' into develop

Finish Hotfix-98
chen 3 years ago
parent
commit
b0d6946fd7

+ 46 - 31
src/views/finance/change_apply.vue

@@ -74,6 +74,13 @@
               <el-input size="mini" type="number" v-model="scope.row.money"></el-input>
             </template>
           </el-table-column>
+          <el-table-column align="left" label="折让金额" prop="" min-width="160" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <div v-if="scope.$index == 0"></div>
+              <el-input v-if="scope.$index == 1" size="mini" type="number" v-model="scope.row.allowanceAmount"></el-input>
+
+            </template>
+          </el-table-column>
           <el-table-column align="left" label="备注" prop="" min-width="160" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-input size="mini" v-model="scope.row.bz"></el-input>
@@ -121,6 +128,7 @@ export default {
           name: "",
           money: "",
           bz: "",
+          allowanceAmount: "",
         },
       ],
       searchForm: {
@@ -208,7 +216,6 @@ export default {
         let aa = res.data.filter(
           (v) => v.customerWalletId != this.dataList[0].name
         );
-        console.log(aa);
         this.$set(this.dataList[index], "typeList", aa);
       } else {
         this.$set(this.dataList[index], "typeList", res.data);
@@ -233,11 +240,11 @@ export default {
 
     //保存
     async preservationFn() {
-      let receiverWalletRebateId;
-      let initiatorWalletRebateId;
-      let initiatorRemark;
-      let receiverRemark;
-      let amount;
+      // let receiverWalletRebateId;
+      // let initiatorWalletRebateId;
+      // let initiatorRemark;
+      // let receiverRemark;
+      // let amount;
 
       await this.$refs.searchForm.validate();
 
@@ -246,6 +253,10 @@ export default {
           this.$message.error("请输入返利金额");
           return v;
         }
+        if (v.allowanceAmount < 0 || v.money < 0) {
+          this.$message.error("金额必须为正数");
+          return v;
+        }
         if (v.customerId == "") {
           this.$message.error("请选择经销商");
           return v;
@@ -260,41 +271,45 @@ export default {
         return;
       }
       if (
-        Number(this.dataList[0].money) + Number(this.dataList[1].money) !=
-        0
+        Number(this.dataList[0].money) !=
+        Number(this.dataList[1].money) +
+          Number(this.dataList[1].allowanceAmount)
       ) {
-        this.$message.error("返利金额不等,请重新输入");
+        this.$message.error("转入转出金额不等,请重新输入");
         return;
       }
 
-      if (this.dataList[0].money > 0) {
-        receiverWalletRebateId = this.dataList[0].name;
-        initiatorWalletRebateId = this.dataList[1].name;
-        initiatorRemark = this.dataList[1].bz;
-        receiverRemark = this.dataList[0].bz;
-        amount = this.dataList[0].money;
-      } else {
-        receiverWalletRebateId = this.dataList[1].name;
-        initiatorWalletRebateId = this.dataList[0].name;
-        initiatorRemark = this.dataList[0].bz;
-        receiverRemark = this.dataList[1].bz;
-        amount = this.dataList[1].money;
-      }
-      await getTransferAdd({
-        theTime: this.searchForm.theTime,
-        receiverWalletRebateId,
-        initiatorWalletRebateId,
-        receiverRemark,
-        initiatorRemark,
-        amount: amount * 1,
-      });
+      // if (this.dataList[0].money > 0) {
+      //   receiverWalletRebateId = this.dataList[0].name;
+      //   initiatorWalletRebateId = this.dataList[1].name;
+      //   initiatorRemark = this.dataList[1].bz;
+      //   receiverRemark = this.dataList[0].bz;
+      //   amount = this.dataList[0].money;
+      // } else {
+      //   receiverWalletRebateId = this.dataList[1].name;
+      //   initiatorWalletRebateId = this.dataList[0].name;
+      //   initiatorRemark = this.dataList[0].bz;
+      //   receiverRemark = this.dataList[1].bz;
+      //   amount = this.dataList[1].money;
+      // }
+
+      let params = {
+        amount: this.dataList[1].money,
+        initiatorAmount: this.dataList[0].money,
+        initiatorWalletRebateId: this.dataList[0].name,
+        receiverWalletRebateId: this.dataList[1].name,
+        allowanceAmount: this.dataList[1].allowanceAmount,
+        initiatorRemark: this.dataList[0].bz,
+        receiverRemark: this.dataList[1].bz,
+      };
+
+      await getTransferAdd(params);
 
       this.$router.push("/finance/rebate/change_list");
       this.$message.success("申请成功");
     },
     async getUserInfoFn() {
       const res = await getUserInfo({ adminUserId: this.userid });
-      console.log(res, 1);
       this.searchForm.customerNumber = res.data.customerNumber;
       this.dataList[0].customerId = res.data.customerId;
       this.searchForm.customerName = res.data.customerName;

+ 6 - 1
src/views/finance/change_list.vue

@@ -102,6 +102,11 @@
                 {{ scope.row.amount | numToFixed }}
               </template>
             </el-table-column>
+            <el-table-column align="right" label="折让金额" prop="allowanceAmount" min-width="160" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{ scope.row.allowanceAmount | numToFixed }}
+              </template>
+            </el-table-column>
             <el-table-column align="left" label="接收方经销商编号" prop="receiverCustomerNumber" min-width="160" show-overflow-tooltip>
               <template slot-scope="scope">
                 <CopyButton :copyText="scope.row.receiverCustomerNumber" />
@@ -253,7 +258,7 @@ export default {
       // console.log(res);
       res.data.records.forEach((item) => {
         item.sums1 = [];
-        item.sums2 = ["amount"];
+        item.sums2 = ["amount", "allowanceAmount"];
       });
       this.dataList = res.data.records;
       this.listTotal = res.data.total;

+ 3 - 1
src/views/finance/components/change_list-detail.vue

@@ -83,6 +83,7 @@
           <el-table-column label="序号" align="left" width="100" type="index" show-overflow-tooltip></el-table-column>
           <el-table-column align="left" label="返利类型" prop="customerWalletName" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="left" label="返利金额" prop="amount" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="left" label="折让金额" prop="allowanceAmount" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
         </el-table>
       </div>
@@ -110,12 +111,13 @@ export default {
       {
         customerWalletName: this.detailList.initiatorCustomerWalletName,
         remark: this.detailList.initiatorRemark,
-        amount: -this.detailList.amount,
+        amount: -this.detailList.initiatorAmount,
       },
       {
         customerWalletName: this.detailList.receiverCustomerWalletName,
         remark: this.detailList.receiverRemark,
         amount: this.detailList.amount,
+        allowanceAmount: this.detailList.allowanceAmount,
       },
     ];
   },

+ 3 - 1
src/views/finance/components/change_list-examine.vue

@@ -67,6 +67,7 @@
           <el-table-column label="序号" align="left" width="100" type="index" show-overflow-tooltip></el-table-column>
           <el-table-column align="left" label="返利类型" prop="customerWalletName" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="left" label="返利金额" prop="amount" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="left" label="折让金额" prop="allowanceAmount" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
         </el-table>
       </div>
@@ -128,12 +129,13 @@ export default {
       {
         customerWalletName: this.detailList.initiatorCustomerWalletName,
         remark: this.detailList.initiatorRemark,
-        amount: -this.detailList.amount,
+        amount: -this.detailList.initiatorAmount,
       },
       {
         customerWalletName: this.detailList.receiverCustomerWalletName,
         remark: this.detailList.receiverRemark,
         amount: this.detailList.amount,
+        allowanceAmount: this.detailList.allowanceAmount,
       },
     ];
   },