Ver Fonte

【修改】bug

howie há 3 anos atrás
pai
commit
4ebcd6a534

+ 14 - 4
src/views/sales_policy/components/AddPolicy.vue

@@ -864,7 +864,8 @@ export default {
         });
     },
     // 提交审核
-    handleAddPolicy(policyCustomers) {
+    handleAddPolicy(policyCustomers,region) {
+          console.log(region,'jkjkj')
       if (!this.searchForm.title) {
         this.$errorMsg("请输入说明");
         return;
@@ -878,8 +879,8 @@ export default {
         return;
       }
 
-      if (policyCustomers.length) {
-        var arr = [];
+        const fomrtData = ()=>{
+            var arr = [];
         policyCustomers.forEach((el) => {
           arr.push({
             customerId: el.id,
@@ -921,9 +922,18 @@ export default {
           this.$parent.getList();
           this.$parent.isShow = 1;
         });
-      } else {
+        }
+
+    if (region == 0) {
+      if (policyCustomers.length) {
+        fomrtData()
+         } else {
         this.$errorMsg("选择经销商 ");
+       }
+      }else{
+        fomrtData()
       }
+
     },
     // 删除
     hanleDelete(id, index) {

+ 12 - 6
src/views/sales_policy/components/TabelTransfer.vue

@@ -2,8 +2,8 @@
   <div class="mymain-container">
     <slot name="header">
       <el-row class="radio">
-        <el-radio-group v-model="region">
-          <el-radio label="0">指定</el-radio>
+        <el-radio-group v-model="region" @change="onChange">
+          <el-radio label="0">指定经销商</el-radio>
           <el-radio label="1">广州经销商</el-radio>
           <el-radio label="2">佛山经销商</el-radio>
         </el-radio-group>
@@ -140,7 +140,7 @@
     </el-row>
     <div style="margin: 20px 0">
       <el-upload
-        class="import-btn"
+        class="import-btn cus-btn"
         :action="baseURL + 'student/import'"
         :http-request="handleImports"
         :file-list="importFileList"
@@ -368,12 +368,15 @@ export default {
     getList() {
       this.getCrList();
     },
+    onChange(){
+      this.getCrList()
+    },
     getCrList() {
       const customerParams = {
         pageNum: this.currentPages,
         pageSize: this.pageSizes,
         keyword: this.keyword,
-        region: "",
+        region: this.region,
       };
       // 获取经销商列表
       getCrList(customerParams).then((res) => {
@@ -669,7 +672,7 @@ export default {
     },
     // 提交数据
     async handleSave() {
-      this.$emit("handlEditPolicy", this.custoList);
+      this.$emit("handlEditPolicy", this.custoList,this.region);
     },
     handleReset() {
       this.dataR = this.rightData = [];
@@ -687,7 +690,10 @@ export default {
   margin: 0 0 20px 0;
 }
 .import-btn {
-
+  margin: 0 20px;
+}
+.cus-btn{
+   margin: 0;
 }
 .value {
   ::v-deep .el-input__prefix {

+ 12 - 4
src/views/sales_policy/components/editPolicy.vue

@@ -861,7 +861,7 @@ export default {
         })
     },
     // 提交审核
-    handlEditPolicy(policyCustomers) {
+    handlEditPolicy(policyCustomers,region) {
       if (!this.searchForm.title) {
         this.$errorMsg('请输入说明')
         return
@@ -874,9 +874,8 @@ export default {
         this.$errorMsg('请选择生效日期')
         return
       }
-
-      if (policyCustomers.length) {
-        var arr = []
+      const formtData = ()=>{
+       var arr = []
         policyCustomers.forEach((el) => {
           arr.push({
             customerId: el.customerId || el.customerId,
@@ -908,9 +907,18 @@ export default {
           this.$parent.getList()
           this.$parent.isShow = 1
         })
+      }
+
+      if(region ==0){
+    if (policyCustomers.length) {
+ formtData()
       } else {
         this.$errorMsg('选择经销商 ')
       }
+      }else{
+ formtData()
+      }
+
     },
     // 删除
     hanleDelete(id, index) {

+ 3 - 3
src/views/supply/policy/components/retail_form.vue

@@ -593,8 +593,8 @@
                     <el-col />
                     <el-col />
                     <el-col>{{ totalArr[index].totalQty }}</el-col>
-                    <el-col>{{ totalArr[index].totalPrice }}</el-col>
-                    <el-col>{{ totalArr[index].totalAmount }}</el-col>
+                    <el-col>{{ totalArr[index].totalPrice  | numToFixed}}</el-col>
+                    <el-col>{{ totalArr[index].totalAmount  | numToFixed}}</el-col>
                   </el-row>
                 </div>
               </template>
@@ -703,7 +703,7 @@
                   <el-col />
                   <el-col />
                   <el-col />
-                  <el-col>{{ totalQty | numToFixed }}</el-col>
+                  <el-col>{{ totalQty  }}</el-col>
                   <el-col>{{ totalPrice | numToFixed}}</el-col>
                   <el-col>{{ totalAmount | numToFixed}}</el-col>
                 </el-row>