Sfoglia il codice sorgente

Merge branch 'feature/Feature-sales' into develop

莫绍宝 3 anni fa
parent
commit
26176fc652

+ 8 - 0
src/api/basic_data/material.js

@@ -15,6 +15,14 @@ export function getCategoryList(params) {
   })
 }
 
+export function editCategory(params) {
+  return request({
+    url: '/k3/material/edit',
+    method: 'post',
+    data:params
+  })
+}
+
 
 export function getMaterialList(params) {
   return request({

+ 17 - 3
src/views/basic_data/material/components/material_list-detail.vue

@@ -607,14 +607,14 @@
                 </el-select>
               </el-form-item>
               <el-form-item label="是否允许置换" size="small">
-                <el-select v-model="zhihuan">
+                <el-select v-model="isDisplace">
                   <el-option label="是" :value="true"> </el-option>
                   <el-option label="否" :value="false"> </el-option>
                 </el-select>
               </el-form-item>
             </el-col>
           </el-row>
-          <!-- <el-button >保存</el-button> -->
+          <el-button  @click="handleSave">保存</el-button>
         </div>
       </el-card>
     </el-form>
@@ -622,6 +622,10 @@
 </template>
 
 <script>
+import {
+ editCategory
+} from "@/api/basic_data/material";
+
 export default {
   props: {
     detail: {
@@ -633,17 +637,27 @@ export default {
     return {
       value1: "是",
       dinghuo: true,
-      zhihuan: true,
+      isDisplace:''
     };
   },
   created() {
     console.log(this.detail);
+    this.isDisplace = this.detail.isDisplace
   },
   methods: {
     goBack() {
       console.log(this.$parent);
       this.$parent.isShow = true;
     },
+    handleSave(){
+      editCategory({
+        id:this.detail.id,
+        isDisplace:this.isDisplace
+      }).then(res=>{
+        this.$successMsg('编辑成功')
+          this.$parent.isShow = true;
+      })
+    }
   },
 };
 </script>

+ 107 - 98
src/views/basic_data/material/components/modify_list-apply.vue

@@ -246,6 +246,7 @@
                     v-model="scope.row.walletRebateId"
                     placeholder="请选择返利类型"
                     @change="handelRebateList($event, scope.$index, scope.row)"
+                       @remove-tag="handleRemove2($event, scope.$index, scope.row)"
                   >
                     <el-option
                       v-for="(item, index) in scope.row.rebateList"
@@ -343,6 +344,7 @@
                       clearable
                       v-model="scope.row.walletsId"
                       @change="handelWallets($event, scope.$index, scope.row)"
+                      @remove-tag="handleRemove($event, scope.$index, scope.row)"
                       placeholder="请选择现金钱包"
                     >
                       <el-option
@@ -359,6 +361,7 @@
                       clearable
                       v-model="scope.row.walletsId"
                       @change="handelWallets($event, scope.$index, scope.row)"
+                      @remove-tag="handleRemove($event, scope.$index, scope.row)"
                       placeholder="请选择现金钱包"
                     >
                       <el-option
@@ -964,59 +967,75 @@ export default {
       this.$set(this.items[index], "rebateList", rebateList);
       // this.fang = false;
     },
+     resArr(arr1, arr2) {
+      return arr1.filter((v) => arr2.every((val) => val.id != v.id));
+    },
     // xua
     handelWallets(e, index, row) {
-      let id = row.cid;
-
+      let id = row.cid || row.id;
+      if (e &&  e.length) {
+    for (let i = 0; i < e.length; i++) {
       if (!this.wall1.includes(e[e.length - 1])) {
-        this.items[index].wallets.push({
-          type: "COMMONLY",
-          id: "",
-          updPriceBillId: id,
-          updPriceBillItemId: id,
-          walletId: e[e.length - 1],
-        });
+        this.$set(row, 'wallets',[
+          ...row.wallets,
+          {
+            type: "COMMONLY",
+            id: "",
+            updPriceBillId: id,
+            updPriceBillItemId: id,
+            walletId: e[e.length - 1],
+          },
+        ]);
+        this.wall1.push(e[e.length - 1])
+      }
+    }
       }
     },
-    handelRebateList(e, index, row) {
-      let id = row.cid;
-      if (!this.wall2.includes(e[e.length - 1])) {
-        this.items[index].rebateWallets.push({
-          type: "REBATE",
-          id: "",
-          updPriceBillId: id,
-          updPriceBillItemId: id,
-          walletId: e[e.length - 1],
-        });
+    handleRemove(e, index, row) {
+      console.log(e);
+         const copxyWall = JSON.parse(JSON.stringify(row.wallets))
+        for (let i = 0; i < row.wallets.length; i++) {
+        if (this.wall1.includes(e) && row.wallets[i].walletId==e) {
+          console.log(454);
+
+                this.wall1.splice(i,1)
+                  copxyWall.splice(i,1)
+              }
+        }
+        this.$set(row,'wallets',copxyWall)
+
+    },
+  handleRemove2(e, index, row) {
+         const copxyWall = JSON.parse(JSON.stringify(row.rebateWallets))
+        for (let i = 0; i < row.rebateWallets.length; i++) {
+        if (this.wall2.includes(e) && row.rebateWallets[i].walletId==e) {
+                copxyWall.splice(i,1)
+                this.wall2.splice(i,1)
+              }
+        }
+        this.$set(row,'rebateWallets',copxyWall)
+
+    }
+,
+  handelRebateList(e, index, row) {
+      let id = row.cid || row.id;
+     if (e &&  e.length) {
+    for (let i = 0; i < e.length; i++) {
+     if (!this.wall2.includes(e[e.length - 1])) {
+        this.$set(row, "rebateWallets", [
+          ...row.rebateWallets,
+          {
+            type: "REBATE",
+            id: "",
+            updPriceBillId: id,
+            updPriceBillItemId: id,
+            walletId: e[e.length - 1],
+          },
+        ]);
+         this.wall2.push(e[e.length - 1])
       }
-      // for (let i = 0; i < e.length; i++) {
-      //   if (this.items[index].wallets.length) {
-      //     for (let j = 0; j < this.items[index].wallets.length; j++) {
-      //       if (e[i] !== this.items[index].wallets[j].walletId) {
-      //         this.$set(this.items[index], "wallets", [
-      //           ...this.items[index].wallets,
-      //           {
-      //             type: "REBATE",
-      //             id: "",
-      //             updPriceBillId: row.cid,
-      //             updPriceBillItemId: row.cid,
-      //             walletId: e[i],
-      //           },
-      //         ]);
-      //       }
-      //     }
-      //   } else {
-      //     this.$set(this.items[index], "rebateWallets", [
-      //       {
-      //         type: "REBATE",
-      //         id: "",
-      //         updPriceBillId: row.id,
-      //         updPriceBillItemId: row.id,
-      //         walletId: e[0],
-      //       },
-      //     ]);
-      //   }
-      // }
+    }
+  }
     },
     handleUser(e) {
       const adminCompany = this.userList.filter((k) => {
@@ -1161,13 +1180,13 @@ export default {
       }
       this.walleList = wall.data;
 
-      let linshi = [];
       if (this.$parent.show == 5) {
-        let rebateList = [];
         getProductRriceDetail({ id: this.cid }).then((res) => {
-          //  this.editData = res.data;
-
           for (let i = 0; i < res.data.items.length; i++) {
+            let linshi = [];
+            let rebateList = [];
+            let walletIds = [];
+            let walletRebateIds = [];
             res.data.items[i].isPublishArr = [
               {
                 value: "是",
@@ -1189,62 +1208,48 @@ export default {
               },
             ];
 
-            let walletIds = [];
-            let walletRebateIds = [];
-            res.data.items[i].wallets = [];
             res.data.items[i].walletsId = [];
             res.data.items[i].walletRebateId = [];
+              res.data.items[i].rebateWallets = [];
+            res.data.items[i].wallets = [];
             for (let p = 0; p < res.data.items[i].wallets2.length; p++) {
               if (res.data.items[i].wallets2[p].type == "COMMONLY") {
                 walletIds.push(res.data.items[i].wallets2[p].walletId);
-                this.$set(res.data.items[i], "walletsId", walletIds);
-                res.data.items[i].wallets.push({
-                  type: "REBATE",
-                  id: "",
-                  updPriceBillId: res.data.items[i].updPriceBillId,
-                  updPriceBillItemId: res.data.items[i].updPriceBillId,
-                  walletId: res.data.items[i].wallets2[p].walletId,
-                });
-              } else {
-                res.data.items[i].wallets.push({
-                  type: "COMMONLY",
-                  id: "",
-                  updPriceBillId: res.data.items[i].updPriceBillId,
-                  updPriceBillItemId: res.data.items[i].updPriceBillId,
-                  walletId: res.data.items[i].wallets2[p].walletId,
-                });
+                this.$set(res.data.items[i],'wallets',[
+                  ...res.data.items[i].wallets,
+                  res.data.items[i].wallets2[p]
+                ])
+              } else if (res.data.items[i].wallets2[p].type == "REBATE") {
                 walletRebateIds.push(res.data.items[i].wallets2[p].walletId);
-                this.$set(res.data.items[i], "walletRebateId", walletRebateIds);
+                this.$set(res.data.items[i],'rebateWallets',[
+                  ...res.data.items[i].rebateWallets,
+                  res.data.items[i].wallets2[p]
+                ])
               }
             }
-
+            this.$set(res.data.items[i], "walletsId", walletIds);
+            this.$set(res.data.items[i], "walletRebateId", walletRebateIds);
+            console.log(res.data.items[i].walletRebateId);
             this.rebateList.forEach((k) => {
               k.saleTypes.forEach((j) => {
-                console.log(
-                  j.saleTypeId == res.data.items[i].saleTypeId,
-                  "545454"
-                );
                 if (
                   !linshi.includes(j.saleTypeId) &&
                   j.saleTypeId == res.data.items[i].saleTypeId
                 ) {
+                  console.log(res.data.items[i].saleTypeId, "saleTypeId");
                   rebateList.push(k);
                 }
               });
             });
-            console.log(rebateList, "444878787");
-            res.data.items[i].rebateWallets = [];
 
-            res.data.items[i].wallets = [];
             res.data.items[i].walleList = this.walleList;
             res.data.items[i].rebateList = rebateList;
-
-            this.items = res.data.items;
-            this.base = res.data;
-
             res.data.items[i].fang = false;
           }
 
+
+          this.items = res.data.items;
+          this.base = res.data;
           this.listLoading = false;
         });
       } else {
@@ -1281,21 +1286,18 @@ export default {
       // 如果没有返回值则默认返回false(全部无法选中)
     },
     hanleSbumit() {
-      for (let i = 0; i < this.items.length; i++) {
-        if (!this.cid) {
-          this.items[i].wallets = [
-            ...this.items[i].rebateWallets,
-            ...this.items[i].wallets,
-          ];
-        } else {
-        }
+      console.log(this.items, 45454);
+      // for (let i = 0; i < this.items.length; i++) {
+      //   this.items[i].wallets = [
+      //     ...this.items[i].rebateWallets,
+      //     ...this.items[i].wallets,
+      //   ];
 
-        console.log(this.items, 45454);
-        if (!this.items[i].mainId) {
-          this.$errorMsg("请选择销售类型");
-          return;
-        }
-      }
+      //   if (!this.items[i].mainId) {
+      //     this.$errorMsg("请选择销售类型");
+      //     return;
+      //   }
+      // }
       const params = {
         ...this.base,
         items: this.items,
@@ -1312,8 +1314,15 @@ export default {
       });
     },
     hanleSave() {
+      console.log(this.items);
       handleEdit({
-        ...this.base,
+         ...this.base,
+        items: this.items,
+        saleTypeId: this.saleTypeId,
+        adminWebsitId: this.adminWebsitId,
+        serviceId: this.serviceId,
+        adminCompanyName: this.adminCompanyName,
+        serviceName: this.nickName,
       }).then((res) => {
         this.$successMsg("成功");
         this.$parent.cid = "";

+ 1 - 1
src/views/basic_data/material/components/modify_list-detail.vue

@@ -278,7 +278,7 @@ export default {
       saleName: "",
       status: "",
     };
-    console.log(this.detail,545454);
+    console.log(this.detail);
     getTypeList(params).then((res) => {
       this.typeList = res.data.records;
     });

+ 7 - 2
src/views/engin_deposit/components/deposit_list-detail.vue

@@ -241,10 +241,15 @@
             <div class="value">{{ details.checkDate }}</div>
           </el-col>
           <el-col :xs="12" :sm="12" :lg="12" class="item">
-            <div class="label">是否退押</div>
+            <div class="label" >是否退押</div>
             <div class="value">
-              {{ details.isRefundDeposit == true ? "是" : "否" }}
+
+              <template v-if="!(details.examineStatus =='WAIT' || details.examineStatus == 'SAVE' )">
+                {{ details.isRefundDeposit == true ? "是" : "否" }}
+                </template>
+
             </div>
+
           </el-col>
           <el-col :xs="12" :sm="12" :lg="12" class="item">
             <div class="label">审批结果</div>

+ 17 - 9
src/views/supply/policy/components/retail_form2.vue

@@ -877,8 +877,9 @@ export default {
     },
     //引用销售政策搜索
     handlePolicyTypeList() {
-      if (this.screenForm.factorId) {
+      if (this.screenForm.factorId && this.screenForm.factorId) {
         this.getConditionList(this.policyConditionId, this.cusIndex + 1);
+        this.dataList = []
       } else {
         // sProvision = true
         this.getMaterialTypeList("sProvision");
@@ -895,7 +896,7 @@ export default {
       }).then((res) => {
         const datas = res.data.records;
         this.total = res.data.total;
-        console.log(this.goodsList.length, 223424);
+
         if (this.goodsList.length) {
           for (let p = 0; p < this.goodsList.length; p++) {
             for (let q = 0; q < datas.length; q++) {
@@ -920,15 +921,27 @@ export default {
     },
     // 下一步获取某个政策条件比例数据
     handleCondition() {
+
       if (this.multipleSelection.length) {
         this.cusIndex += 1;
         this.disabled = true;
         this.multipleData.push(this.multipleSelection);
-        console.log(this.multipleData, "push", this.cusIndex);
         this.getConditionList(this.policyConditionId, this.cusIndex + 1);
       } else {
         this.$errorMsg("请选择");
       }
+       console.log(this.cusIndex,'下');
+    },
+       // 上一步
+    handleShang() {
+
+      this.cusIndex == 0 ? (this.disabled = false) : "";
+      this.multipleData.splice(this.cusIndex, 1);
+
+          this.popDataArr.splice(this.cusIndex, 1);
+
+      this.cusIndex -= 1;
+       console.log(this.cusIndex,'上');
     },
     /**
      * 根据条件禁用行复选框
@@ -963,12 +976,7 @@ export default {
       // 如果没有返回值则默认返回false(全部无法选中)
     },
 
-    // 上一步
-    handleShang() {
-      this.cusIndex -= 1;
-      this.cusIndex == 0 ? (this.disabled = false) : "";
-      this.multipleData.splice(this.cusIndex, 1);
-    },
+
     // 条件数据多选
     handleSelectionChange(val) {
       this.multipleSelection = val;

+ 1 - 0
src/views/supply/policy/policy_list.vue

@@ -169,6 +169,7 @@
                 <div>
                   <span>{{ scope.row.theTime | dateToDayFilter }}</span>
                   <el-button
+                  v-if="$checkBtnRole('date', $route.meta.roles)"
                     type="text"
                     icon="el-icon-edit"
                     style="padding: 0; margin-left: 6px"