Explorar o código

Merge branch 'feature/Feature-basic_data' of https://gogs.zfire.top/zfire-front/supply-front into feature/Feature-basic_data

chen %!s(int64=3) %!d(string=hai) anos
pai
achega
725f448559

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

@@ -341,3 +341,14 @@ export function handlePriceRevoke(params){
     params
   })
 }
+
+
+
+
+export function handleEdit(params){
+  return request({
+    url:'/product-upd-price/edit',
+    method: 'POST',
+    data:params
+  })
+}

+ 169 - 46
src/views/basic_data/material/components/modify_list-apply.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div>
-      <el-page-header @back="goBack" content="存货调价单"> </el-page-header>
+      <el-page-header @back="goBack" :content="!cid?'存货调价单':'编辑'"> </el-page-header>
     </div>
     <br /><br />
     <div>
@@ -113,7 +113,8 @@
             >
               <template slot-scope="scope">
                 <el-form-item>
-                  <el-select
+                      <template v-if="!cid">
+                           <el-select
                     placeholder="请选择销售类型"
                     @change="
                       handleSale($event, scope.$index, scope.row.saleTypes)
@@ -126,9 +127,15 @@
                       :value="item.id"
                     ></el-option>
                   </el-select>
-                  <!-- <el-select
+                      </template>
+
+                    <template   v-else>
+                      <el-select
+
+                    @change="
+                      handleSale($event, scope.$index, scope.row.id)
+                    "
                     placeholder="请选择销售类型"
-                    filterable
                     v-model="scope.row.saleTypeId"
                   >
                     <el-option
@@ -136,7 +143,9 @@
                       :label="item.saleName"
                       :value="item.id"
                     ></el-option>
-                  </el-select> -->
+                  </el-select>
+
+                    </template>
                 </el-form-item>
               </template>
             </el-table-column>
@@ -236,7 +245,7 @@
                 <el-form-item>
                   <el-select
                     multiple
-                    :disabled="fang"
+                    :disabled="scope.row.fang"
                     v-model="scope.row.walletRebateId"
                     placeholder="请选择返利类型"
                     @change="handelRebateList($event, scope.$index, scope.row)"
@@ -331,8 +340,10 @@
               show-overflow-tooltip
               ><template slot-scope="scope">
                 <el-form-item>
-                  <el-select
+                 <template v-if="!cid">
+                    <el-select
                     multiple
+                    clearable
                     v-model="scope.row.walletsId"
                     @change="handelWallets($event, scope.$index, scope.row)"
                     placeholder="请选择现金钱包"
@@ -344,7 +355,24 @@
                       :label="item.name"
                     >
                     </el-option>
-                  </el-select>
+                  </el-select></template>
+                  <template v-else>
+                    <el-select
+                    multiple
+                    clearable
+                    v-model="scope.row.walletsId"
+                    @change="handelWallets($event, scope.$index, scope.row)"
+                    placeholder="请选择现金钱包"
+                  >
+                    <el-option
+                      v-for="item in scope.row.walleList"
+                      :key="item.walletId"
+                      :value="item.walletId"
+                      :label="item.walletName"
+                    >
+                    </el-option>
+                  </el-select></template>
+
                 </el-form-item>
               </template>
             </el-table-column>
@@ -665,10 +693,17 @@
       </div>
     </div>
     <div class="btn-group clearfix">
-      <el-button size="small" @click="handleReseat">重置</el-button>
+      <template v-if="!cid">
+         <el-button size="small" @click="handleReseat">重置</el-button>
       <el-button size="small" type="primary" @click="hanleSbumit"
         >提交</el-button
       >
+      </template>
+      <template v-else>
+  <el-button size="small" type="primary" @click="hanleSave"
+        >保存</el-button
+      >
+      </template>
       <el-button
         style="float: right"
         type="primary"
@@ -829,12 +864,14 @@ import {
   getUserList,
   getMaterialDetail,
   getWalletList,
+  handleEdit
 } from "@/api/basic_data/material";
 
 import MaterialListDetail from "./material_list-detail.vue";
 import Mixin from "@/mixin/index";
 export default {
   mixins: [Mixin],
+  props:['cid'],
   data() {
     return {
       listLoading: false,
@@ -876,6 +913,8 @@ export default {
       selectData: [],
       walleList: [],
       fang: true,
+      wall1:[],
+      wall2:[]
     };
   },
   mounted() {
@@ -888,6 +927,7 @@ export default {
     };
     getTypeList(params).then((res) => {
       this.typeList = res.data.records;
+      console.log(this.typeList,'84545');
     });
     getUserList({
       pageNum: 1,
@@ -917,58 +957,75 @@ export default {
   },
   methods: {
     handleSale(e, index, saleTypes) {
-
       let saleArr = [];
       let rebateList =[]
      rebateList = this.rebateList.filter((k) => {
 
         return e === k.saleTypeId;
       });
-        saleArr = saleTypes.filter((i) => {
+        saleArr = this.typeList.filter((i) => {
                return e == i.id;
           });
-
+          console.log(rebateList);
       // this.items[index].mainName = saleArr[0].mainName;
       this.items[index].saleTypeId = saleArr[0].id;
+       this.items[index].fang= false
       this.items[index].saleTypeName = saleArr[0].saleName;
       this.$set(this.items[index], "rebateList", rebateList);
-      this.fang = false;
+      // this.fang = false;
     },
     // xua
     handelWallets(e, index, row) {
-      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,
-                {
+        let id = row.cid
+
+              if (!this.wall1.includes(e[e.length-1])) {
+               this.items[index].wallets.push(  {
                   type: "COMMONLY",
                   id: "",
-                  updPriceBillId: row.cid,
-                  updPriceBillItemId: row.cid,
-                  walletId: e[i],
-                },
-              ]);
+                  updPriceBillId: id,
+                  updPriceBillItemId: id,
+                  walletId: e[e.length-1],
+                })
             }
-          }
-        } else {
-          console.log(987);
-          this.$set(this.items[index], "wallets", [
-            {
-              type: "COMMONLY",
-              id: "",
-              updPriceBillId: row.id,
-              updPriceBillItemId: row.id,
-              walletId: e[0],
-            },
-          ]);
-        }
-      }
 
-      console.log(this.items[index], 456);
+        // if ( this.items[index].wallets.length) {
+        //   for (let j = 0; j < this.items[index].wallets.length; j++) {
+        //     if (row.walleList[i].id !== this.items[index].wallets[j].walletId) {
+
+        //       // this.$set(this.items[index], 'wallets',[
+        //       //   ...this.items[index].wallets,
+        //       //    {
+        //       //     type: "COMMONLY",
+        //       //     id: "",
+        //       //     updPriceBillId: id,
+        //       //     updPriceBillItemId: id,
+        //       //     walletId: e[i],
+        //       //   },
+        //       // ]
+
+        //       // );
+        //     }
+        //   }
+        // } else {
+
+        // }
+      // }
+
     },
     handelRebateList(e, index, row) {
+
+        // let id = row.cid
+
+        //       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],
+        //         })
+        //     }
+
       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++) {
@@ -1008,6 +1065,7 @@ export default {
       this.serviceId = adminCompany.roleId;
     },
     goBack() {
+      this.$parent.cid=''
       this.$parent.show = 1;
       // 更新父组件数据
       this.$parent.getList();
@@ -1087,6 +1145,7 @@ export default {
               },
             ],
             cid: this.selectData[i].id,
+            fang:true
           });
         }
 
@@ -1122,8 +1181,60 @@ export default {
       }
     },
     getList() {
-      this.listLoading = true;
-      let params = {
+
+      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++) {
+            res.data.items[i].isPublishArr= [
+              {
+                value: "是",
+                bool: true,
+              },
+              {
+                value: "否",
+                bool: false,
+              },
+            ]
+           res.data.items[i].isPromoteArr=[
+              {
+                value: "是",
+                bool: true,
+              },
+              {
+                value: "否",
+                bool: false,
+              },
+            ]
+            let walletIds=[]
+             res.data.items[i].walletsId = ''
+             for (let p = 0; p < res.data.items[i].wallets2.length; p++) {
+               walletIds.push(res.data.items[i].wallets2[p].walletIds)
+             }
+             this.$set(res.data.items[i],'walletsId',walletIds)
+
+             rebateList = this.rebateList.filter((k) => {
+              return res.data.items[i].saleTypeId === k.saleTypeId;
+            });
+            this.items =res.data.items
+            this.base = res.data
+            res.data.items[i].wallets =[]
+            res.data.items[i].walleList = res.data.items[i].wallets2
+            res.data.items[i].rebateWallets=[]
+            res.data.items[i].rebateList=rebateList
+            res.data.items[i].fang = false;
+
+          }
+
+
+          this.listLoading = false;
+
+      });
+      }else{
+          this.listLoading = true;
+        let params = {
         pageNum: this.currentPage,
         pageSize: 10 || this.pageSize,
         keyword: this.screenForm.keyword,
@@ -1134,6 +1245,8 @@ export default {
         this.listTotal = res.data.total;
         this.listLoading = false;
       });
+      }
+
     },
     /**
      * 根据条件禁用行复选框
@@ -1154,11 +1267,13 @@ export default {
       // 如果没有返回值则默认返回false(全部无法选中)
     },
     hanleSbumit() {
+
       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;
@@ -1174,14 +1289,22 @@ export default {
         serviceName: this.nickName,
       };
       getProductRriceAdd(params).then((res) => {
-        this.$successMsg("成功");
-        getProductRriceDetail({ id: res.data }).then((res) => {
-          this.base.billId = res.data.billId;
+          this.$successMsg("成功");
           this.$parent.show = 1;
           this.$parent.getList();
-        });
       });
     },
+    hanleSave(){
+      handleEdit({
+        ...this.base
+      }).then(res=>{
+        this.$successMsg("成功");
+        this.$parent.cid=''
+         this.$parent.show = 1;
+          this.$parent.getList();
+      })
+
+    },
     handleReseat() {
       this.base = {
         adminCompanyId: "",

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

@@ -3,7 +3,7 @@
     <div>
       <el-page-header @back="goBack" content="详情"> </el-page-header>
     </div>
-    <div>
+    <div style="margin-top:20px;">
       <el-form
         ref="screenForm"
         :model="detail"
@@ -278,7 +278,7 @@ export default {
       saleName: "",
       status: "",
     };
-    console.log(this.detail);
+    console.log(this.detail,545454);
     getTypeList(params).then((res) => {
       this.typeList = res.data.records;
     });

+ 25 - 13
src/views/basic_data/material/modify_list.vue

@@ -344,7 +344,6 @@
                     <el-button type="text" slot="reference">提审</el-button>
                   </el-popconfirm>
                 </template>
-
                 <template v-if="scope.row.examineStatus == 'WAIT'">
                   <el-button
                     type="text"
@@ -354,6 +353,13 @@
                   >
                 </template>
                 <el-button
+                 v-if="scope.row.examineStatus == 'SAVE'"
+                  type="text"
+                  class="textColor"
+                  @click="editFn(scope.row.updPriceBillId,scope.row)"
+                  >编辑</el-button
+                >
+                <el-button
                   type="text"
                   class="textColor"
                   @click="detailFn(scope.row.updPriceBillId)"
@@ -378,8 +384,8 @@
         </div>
       </div>
     </div>
-    <ModifyListApply v-else-if="show === 2" />
-    <ModifyListApproval v-else-if="show === 3" :detail="detail" />
+    <ModifyListApply v-else-if="show === 2 || show==5" :cid='cid'/>
+    <ModifyListApproval v-else-if="show === 3 " :detail="detail" />
     <ModifyListDetail v-else :detail="detail" />
   </div>
 </template>
@@ -454,6 +460,7 @@ export default {
         startDate: "",
         wallets: [],
       },
+      cid:'',
       typeList: [],
     };
   },
@@ -511,6 +518,7 @@ export default {
     detailFn(id) {
       getProductRriceDetail({ id }).then((res) => {
         this.detail = res.data;
+
         this.show = 4;
       });
     },
@@ -531,16 +539,20 @@ export default {
       });
     },
     editFn(id, row) {
-      this.diaLogForm = {
-        id,
-        composeNumber: row.composeNumber,
-        items: row.items === undefined ? [] : row.items,
-        materialId: row.materialId,
-        orgNumber: row.orgNumber,
-        productModel: row.productModel,
-        productVolume: row.productVolume,
-      };
-      this.showDialogForm = true;
+          this.cid = id
+         this.show = 5;
+
+
+      // this.diaLogForm = {
+      //   id,
+      //   composeNumber: row.composeNumber,
+      //   items: row.items === undefined ? [] : row.items,
+      //   materialId: row.materialId,
+      //   orgNumber: row.orgNumber,
+      //   productModel: row.productModel,
+      //   productVolume: row.productVolume,
+      // };
+      // this.showDialogForm = true;
     },
     hanleInfo() {
       if (this.type === 1) {

+ 5 - 5
src/views/basic_data/material/price_list.vue

@@ -66,7 +66,7 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :xs="24" :sm="12" :lg="6">
+          <!-- <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="产品品类" prop="categoryId">
               <el-select
                 placeholder="请选择产品品类"
@@ -79,7 +79,7 @@
                 ></el-option>
               </el-select>
             </el-form-item>
-          </el-col>
+          </el-col> -->
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="规格型号" prop="specification">
               <el-input
@@ -119,13 +119,13 @@
           stripe
         >
           <el-table-column type="selection" align="center"></el-table-column>
-          <el-table-column
+          <!-- <el-table-column
             align="center"
             label="产品品类"
             prop="mainName"
             min-width="160"
             show-overflow-tooltip
-          ></el-table-column>
+          ></el-table-column> -->
           <el-table-column
             align="center"
             label="存货编码"
@@ -286,7 +286,7 @@
                 >作废</el-button
               >
               <el-button
-               v-if="$checkBtnRole('del', $route.meta.roles)"
+                v-if="$checkBtnRole('del', $route.meta.roles)"
                 type="text"
                 size="small"
                 @click="handleDelete(scope.row.id)"

+ 6 - 3
src/views/basic_data/material/relation_list.vue

@@ -316,6 +316,7 @@
             <el-form-item label="产品名称">
               <el-select
                 placeholder="选择名称"
+                filterable
                 @change="hanleName"
                 v-model="diaLogForm.materialId"
               >
@@ -346,6 +347,7 @@
                   <el-select
                     v-model="diaLogForm.type"
                     @change="hanleType"
+                    filterable
                     placeholder="请选择类型"
                   >
                     <el-option
@@ -377,6 +379,7 @@
                 <el-select
                   v-model="item.number"
                   placeholder="请选择编码"
+                  filterable
                   @change="hanleCode($event, index)"
                 >
                   <el-option
@@ -583,7 +586,7 @@ export default {
     getMaterMacList() {
       const params = {
         pageNum: 1,
-        pageSize: 10,
+        pageSize: -1,
         keyword: "",
       };
 
@@ -606,7 +609,7 @@ export default {
     },
     getMachineLlist(e) {
       let params2 = {
-        pageNum: this.machinePei.currentPage,
+        pageNum:1,
         pageSize: -1,
         model: this.machinePei.model,
         name: this.machinePei.name,
@@ -798,7 +801,7 @@ export default {
     hanleMachine() {
       let params = {
         pageNum: 1,
-        pageSize: 10,
+        pageSize: -1,
         keyword: "",
       };
       getMaterialList(params).then((res) => {

+ 3 - 2
src/views/basic_data/warehouse/warehouse_cost.vue

@@ -215,6 +215,7 @@
           <el-select
             v-model="dialogForm.customerNumber"
             placeholder="请选择活动区域"
+            filterable
             class="inputStyle"
             v-el-select-loadmore="loadmore"
           >
@@ -397,8 +398,8 @@ export default {
     },
     getCustomerList() {
       let params = {
-        pageNum: this.sleectBox.currentPage,
-        pageSize: this.sleectBox.pageSize,
+        pageNum:1,
+        pageSize: -1,
         keyword: "",
       };
       getCustomerList(params).then((res) => {

+ 1 - 1
src/views/sales_policy/codealer_list.vue

@@ -78,7 +78,7 @@
         <el-table-column
           prop="title"
           label="销售政策说明"
-          width="400"
+          width="200"
           align="center"
         >
         </el-table-column>

+ 0 - 1
src/views/sales_policy/components/AddPolicy.vue

@@ -574,7 +574,6 @@ export default {
         addPoliy(params).then((res) => {
           console.log(res);
           this.$successMsg("新增成功");
-
           this.$parent.getList();
           this.$parent.isShow = 1;
         });

+ 2 - 2
src/views/sales_policy/components/Distributor.vue

@@ -81,7 +81,7 @@
             <el-input
               disabled
               v-model="details.remark"
-              placeholder="新风机变频挂机。按提货数量1:3开单"
+              placeholder="如:新风机变频挂机。按提货数量1:3开单"
             ></el-input>
           </el-form-item>
         </el-row>
@@ -112,7 +112,7 @@
         highlight-current-row
         stripe
       >
-        <el-table-column type="selection" width="55"> </el-table-column>
+        <el-table-column type="selection" width="55" align="center"> </el-table-column>
         <el-table-column
           prop="customerNumber"
           label="经销商编码"

+ 1 - 1
src/views/sales_policy/components/Transfer.vue

@@ -115,7 +115,7 @@
       </el-row>
     </div>
     <slot name="footer">
-      <el-row>
+      <el-row style="margin:50px  0 0 0;">
         <el-button type="primary" size="small" @click="handleSubmit"
           >提交审核</el-button
         >

+ 2 - 2
src/views/sales_policy/policy_list.vue

@@ -468,12 +468,12 @@ export default {
       this.importLoading = false;
       this.importFileList = [];
       if (result.code == 200) {
-        this.$alert(result.message, "导入成功", {
+        this.$alert('导入成功', "导入成功", {
           confirmButtonText: "确定",
         });
         this.getList();
       } else {
-        this.$alert(result.message, "导入失败", {
+        this.$alert('导入失败', "导入失败", {
           confirmButtonText: "确定",
         });
       }

+ 1 - 0
src/views/sales_rebate/rebate_list.vue

@@ -193,6 +193,7 @@
             <el-select
               v-model="dialogForm.saleTypeId"
               :disabled="type == 3"
+              filterable
               @change="handleChange"
               placeholder="请选择销售类型编码"
             >

+ 0 - 1
src/views/sales_rebate/salestype_list.vue

@@ -399,7 +399,6 @@ export default {
         };
         updateType(upParams).then((res) => {
           this.$successMsg("修改成功");
-
           this.hanleReset();
         });
       } else {

+ 1 - 0
src/views/stock/stock_list.vue

@@ -80,6 +80,7 @@
           <el-table-column align="center" label="单位" prop="baseUnitId" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="总库存数量" prop="stockQty" min-width="120" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="可用库数" prop="stockAdequate" min-width="120" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="可开单数" prop="openNumber" min-width="120" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="经销商预留库存" prop="reservedNum" min-width="140" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="经销商暂扣库存" prop="temporaryNum" min-width="140" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="开单未提数量" prop="num" min-width="140" show-overflow-tooltip></el-table-column>

+ 14 - 26
src/views/supply/apply/components/apply_form.vue

@@ -96,7 +96,7 @@
     </div>
     
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <el-button type="primary" @click="clickSubmitForm('SAVE')">保 存</el-button>
         <el-button type="primary" @click="clickSubmitForm('WAIT')">提交审核</el-button>
         <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
@@ -115,13 +115,13 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :xs="12" :sm="6" :lg="6">
+          <!-- <el-col :xs="12" :sm="6" :lg="6">
             <el-form-item prop="type" label="产品大类">
               <el-select v-model="screenForm.type" placeholder="选择产品大类" style="width: 100%" :disabled="goodsList.length > 0 || tableSelection.length > 0">
                 <el-option v-for="item in typeList" :key="item.dictCode" :label="item.dictValue" :value="item.dictCode"></el-option>
               </el-select>
             </el-form-item>
-          </el-col>
+          </el-col> -->
           <el-col :xs="12" :sm="6" :lg="6">
             <el-form-item prop="orderNum" label="订单号">
               <el-input v-model="screenForm.orderNum" placeholder="请输入订单号"></el-input>
@@ -220,13 +220,13 @@ export default {
       warehouseList: [],
       isShowDialog: false,
       screenForm: {
-        warehouse: '',
-        type: '',
+        warehouse: [],
+        // type: '',
         orderNum: '',
       },
       currentPage: 1,
       listTotal: 0,
-      typeList: [],
+      // typeList: [],
       stockList: [],
       
       tableGoodsList: [],
@@ -234,18 +234,6 @@ export default {
     }
   },
 
-  computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
-  },
-
   created() {
     this.getDictList();
     this.getWarehouseList();
@@ -284,7 +272,7 @@ export default {
         //   item.orderId = item.id;
         // })
         this.goodsList = data.orders;
-        this.screenForm.type = data.mainId;
+        // this.screenForm.type = data.mainId;
       })
     },
 
@@ -299,9 +287,9 @@ export default {
     },
 
     getDictList() {
-      getDictList({sysDictEnum: 'PRODUCT_TYPE'}).then(res => {
-        this.typeList = res.data;
-      })
+      // getDictList({sysDictEnum: 'PRODUCT_TYPE'}).then(res => {
+      //   this.typeList = res.data;
+      // })
       getDictList({sysDictEnum: 'STOCK_ORDER'}).then(res => {
         this.stockList = res.data;
       })
@@ -335,7 +323,7 @@ export default {
         pageNum: this.currentPage,
         pageSize: 10,
         correspondId: this.screenForm.warehouse,
-        mainId: this.screenForm.type,
+        // mainId: this.screenForm.type,
         id: this.screenForm.orderNum,
       }).then(res => {
         let oldGoodsList = this.goodsList;
@@ -371,15 +359,15 @@ export default {
         return this.$errorMsg('请选择仓库');
       }
       this.isShowDialog = true;
-      if(this.screenForm.warehouse && this.screenForm.type) {
+      if(this.screenForm.warehouse) {
         this.getGoodsList();
       }
     },
 
     // 提交筛选表单
     submitScreenForm() {
-      if(!this.screenForm.warehouse || !this.screenForm.type) {
-        return this.$errorMsg('请选择仓库和产品大类');
+      if(!this.screenForm.warehouse) {
+        return this.$errorMsg('请选择仓库');
       }
       this.currentPage = 1;
       this.getGoodsList();

+ 7 - 1
src/views/supply/engin/components/engin_form.vue

@@ -415,6 +415,12 @@ export default {
             }
           }
 
+          let goodsList = JSON.parse(JSON.stringify(this.goodsList));
+
+          goodsList.forEach(item => {
+            delete item.productList;
+          })
+
           let params = {
             // orderDate: this.mainForm.orderDate + ' 00:00:00',
             // mainId: this.mainForm.mainId,
@@ -430,7 +436,7 @@ export default {
             tel: this.mainForm.tel,
             remark: this.mainForm.remark,
             contractExpireDate: this.mainForm.contractDate,
-            items: this.goodsList
+            items: goodsList
           }
           if(type === 1) {
             if(this.listItem) {

+ 4 - 3
src/views/supply/engin/components/home_form.vue

@@ -289,7 +289,7 @@
           max-height="270">
           <el-table-column align="center" label="" width="100">
             <template slot-scope="scope">
-              <el-button type="primary" size="small" @click="chooseItem(scope.row.recordNo)">选择</el-button>
+              <el-button type="primary" size="small" @click="chooseItem(scope.row.recordNo, scope.row.userid)">选择</el-button>
             </template>
           </el-table-column>
           <el-table-column align="center" prop="checkTime" label="工程登录日期" show-overflow-tooltip></el-table-column>
@@ -564,10 +564,11 @@ export default {
     },
 
     // 选择工程登录
-    chooseItem(id) {
+    chooseItem(id, uid) {
       getHomeLoginDetail({
         recordNo: id,
         saleTypeId: this.mainForm.saleType,
+        userId: uid
       }).then(res => {
         this.isShowDialog = false;
         let data = res.data;
@@ -625,7 +626,7 @@ export default {
     // 选择销售类型
     changeSaleType() {
       if(this.mainForm.loginNum) {
-        this.chooseItem(this.mainForm.loginNum);
+        this.chooseItem(this.mainForm.loginNum, this.mainForm.loginUserId);
       }
     },
 

+ 3 - 9
src/views/supply/policy/components/retail_detail.vue

@@ -213,20 +213,14 @@
           min-width="100"
           show-overflow-tooltip
         ></el-table-column>
-          <el-table-column
-          align="center"
-          label="实付金额"
-          prop="payAmount"
-          min-width="100"
-          show-overflow-tooltip
-        ></el-table-column>
-          <el-table-column
+
+          <!-- <el-table-column
           align="center"
           label="已退数量"
           prop="retiredQty"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        ></el-table-column> -->
         <el-table-column
           align="center"
           label="原订单数量"

+ 2 - 2
src/views/supply/policy/components/retail_examine.vue

@@ -185,13 +185,13 @@
           min-width="100"
           show-overflow-tooltip
         ></el-table-column>
-          <el-table-column
+          <!-- <el-table-column
           align="center"
           label="已退数量"
           prop="retiredQty"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        ></el-table-column> -->
         <el-table-column
           align="center"
           label="是否直调"

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

@@ -685,11 +685,12 @@
             </template>
           </el-table>
           <!-- 分页 -->
-          <div style="margin: 10px 0"   v-if="index + 1 == cusIndex">
+          <div style="margin:10px 0"   v-if="index + 1 == cusIndex">
             <el-pagination
               layout="total"
-              :total="popDataArr[cusIndex - 1]?popDataArr[cusIndex - 1].length:0"
+              total="10"
             >
+            <!-- :total=" popDataArr[cusIndex - 1]? popDataArr[cusIndex - 1].length:0" -->
             </el-pagination>
           </div>
         </template>

+ 48 - 23
src/views/supply/policy/components/retail_form2.vue

@@ -12,7 +12,6 @@
     <el-form
       ref="mainForm"
       :model="mainForm"
-
       label-width="120px"
       size="small"
       label-position="right"
@@ -196,10 +195,10 @@
             <el-select
               v-model="scope.row.customerWalletId2"
               placeholder="选择返利钱包"
+              clearable
               size="small"
               @change="changeWallet(scope.$index)"
             >
-
               <el-option
                 v-for="item in scope.row.rebateWallets"
                 :key="item.customerWalletId"
@@ -233,13 +232,13 @@
             {{ scope.row.qty * scope.row.discAmount }}
           </template>
         </el-table-column>
-        <el-table-column
+        <!-- <el-table-column
           align="center"
           label="已退数量"
           prop="retiredQty"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        ></el-table-column> -->
         <el-table-column
           align="center"
           label="现金钱包"
@@ -251,9 +250,9 @@
             <el-select
               v-model="scope.row.customerWalletId"
               placeholder="选择现金钱包"
+              clearable
               size="small"
             >
-
               <el-option
                 v-for="item in scope.row.wallets"
                 :key="item.customerWalletId"
@@ -455,7 +454,6 @@
                   placeholder="选择销售类型"
                   style="width: 100%"
                 >
-
                   <el-option
                     v-for="item in ztypeList"
                     :key="item.id"
@@ -573,14 +571,14 @@
             border
             fit
             highlight-current-row
-              @select-all="handleSelectionChange"
+            @select-all="handleSelectionChange"
             @selection-change="handleSelectionChange"
             stripe
           >
-              <el-table-column
+            <el-table-column
               align="center"
               type="selection"
-              :selectable="selectable"
+              :selectable="selectable2"
               width="55"
             >
             </el-table-column>
@@ -632,14 +630,8 @@
             >
             </el-pagination>
           </div>
-            <span slot="footer" class="dialog-footer">
-
-            <el-button
-              type="primary"
-              @click="hanlePopData"
-
-              >完成</el-button
-            >
+          <span slot="footer" class="dialog-footer">
+            <el-button type="primary" @click="hanlePopData">完成</el-button>
           </span>
         </template>
       </template>
@@ -663,7 +655,7 @@ import {
   getConditionList,
   getConditionDetail,
   getpolicyTypeList,
-  getMaterialTypeList ,
+  getMaterialTypeList,
   getPolicyConditionList,
 } from "@/api/supply/policy";
 import { getDictList } from "@/api/common";
@@ -774,6 +766,7 @@ export default {
       multipleData: [],
       disabled: false,
       cid: "",
+      newDataList:[]
     };
   },
 
@@ -854,7 +847,7 @@ export default {
       });
     },
     hendleEdit(val, index) {
-      this.dialogVisible = false
+      this.dialogVisible = false;
       // let params = {
       //   id: this.cid,
       //   theTime: this.mainForm.date,
@@ -888,7 +881,8 @@ export default {
         this.getConditionList(this.policyConditionId, this.cusIndex + 1);
       } else {
         // sProvision = true
-        this.getMaterialTypeList('sProvision');
+        this.getMaterialTypeList("sProvision");
+
       }
     },
     // 获取某一个比例下的数据 ,查询popType 当前 this.cusIndex+1
@@ -952,6 +946,22 @@ export default {
       // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
       // 如果没有返回值则默认返回false(全部无法选中)
     },
+   /**
+     * 根据条件禁用行复选框
+     * 函数返回值为false则禁用选择(反之亦然)
+     * @param {Object} row - 行数据
+     * @param {String} index - 索引值
+     * @return Boolean
+     */
+    selectable2: function (row, index) {
+      // row.disabled == undefined 才能被选中
+      if (row.disabled == undefined) {
+        return true;
+      }
+      // 函数必须有返回值且是布尔值
+      // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
+      // 如果没有返回值则默认返回false(全部无法选中)
+    },
 
     // 上一步
     handleShang() {
@@ -984,6 +994,12 @@ export default {
         this.cusIndex = 0;
         this.total = 0;
         this.popDataArr = [];
+        if ( this.dataList.length) {
+              this.newDataList = this.multipleSelection
+              this.dataList = []
+              this.disabled = true
+        }
+
         this.multipleData = [];
         this.policyId = this.screenForm.policyId;
         this.isShowDialog = false;
@@ -1064,10 +1080,19 @@ export default {
         pageSize: 10,
         policyId: this.screenForm.policyId,
         saleTypeCode: this.screenForm.saleTypeCode,
-        [val]:true
+        [val]: true,
       }).then((res) => {
-          for (let i = 0; i < res.data.records.length; i++) {
+        for (let i = 0; i < res.data.records.length; i++) {
           res.data.records[i].qty = 1;
+
+
+            for (let j = 0; j < this.newDataList.length; j++) {
+
+                if (this.newDataList[j].id == res.data.records[i].id) {
+                     res.data.records[i].disabled = false;
+                }
+
+            }
         }
         this.dataList = res.data.records;
         this.total = res.data.total;
@@ -1318,7 +1343,7 @@ export default {
           let params = {
             theTime: this.mainForm.date,
             mainId: this.mainForm.type,
-            mainName:'',
+            mainName: "",
             remark: this.mainForm.remark,
             type: 2, // 1:普通零售单,2:政策零售单
             retailOrderItemList: this.goodsList,

+ 4 - 2
src/views/supply/retail/components/retail_form.vue

@@ -620,7 +620,9 @@ export default {
             }
           }
 
-          this.goodsList.forEach(item => {
+          let goodsList = JSON.parse(JSON.stringify(this.goodsList));
+
+          goodsList.forEach(item => {
             delete item.rebateWallets;
             delete item.wallets;
           })
@@ -632,7 +634,7 @@ export default {
             // mainName,
             remark: this.mainForm.remark,
             type: 1, // 1:普通零售单,2:政策零售单
-            retailOrderItemList: this.goodsList
+            retailOrderItemList: goodsList
           }
           if(this.listItem) {
             params.id = this.listItem.id;