浏览代码

Merge tag 'Hotfix-zh-14' into develop

Finish Hotfix-zh-14

# Conflicts:
#	src/views/supply/policy/components/retail_form.vue
howie 3 年之前
父节点
当前提交
ca63d07bea

+ 1 - 0
src/utils/common.js

@@ -58,6 +58,7 @@ export const getSummaries = (param) => {
       sums[index] = '合计';
       return;
     }
+    // console.log(columns);
     try {
       const values = data.map(item => Number(item[column.property]));
       if (data[0] && data[0].sums1.includes(column.property)) {

+ 2 - 2
src/views/engin_deposit/deposit_list.vue

@@ -17,9 +17,9 @@
         >
           <el-row :gutter="20">
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="工程订单编号" prop="enginOrderNo">
+              <el-form-item label="工程订单编号" prop="refEnginRecordNo">
                 <el-input
-                  v-model="screenForm.enginOrderNo"
+                  v-model="screenForm.refEnginRecordNo"
                   placeholder="请输入"
                 ></el-input>
               </el-form-item>

+ 32 - 6
src/views/sales_policy/components/AddPolicy.vue

@@ -328,9 +328,9 @@
               >
             </div>
             <el-pagination
-              @size-change="handleSizeChange"
-              @current-change="handleCurrentChange"
-              :current-page="currentPage"
+              @size-change="handleSizeChange2"
+              @current-change="handleCurrentChange2"
+              :current-page="dcurrentPage"
               :page-sizes="[10, 20, 30, 50]"
               :page-size="10"
               layout="total, sizes, prev, pager, next, jumper"
@@ -515,7 +515,9 @@ export default {
       dictList: [],
       k3List: [],
       NoRebateWalletList: [],
-      sleectBox:{currentPage:1}
+      sleectBox:{currentPage:1},
+      dpageSize:10,
+      dcurrentPage:1
     };
   },
   computed: {
@@ -680,12 +682,36 @@ export default {
         this.handletwoList();
       }
     },
+      // 更改每页数量
+    handleSizeChange1(val) {
+      this.pageSize = val;
+      this.currentPage = 1;
+      this.handletwoList();
+    },
+    // 更改当前页
+    handleCurrentChange1(val) {
+      this.currentPage = val;
+      this.handletwoList();
+    },
+
+   // 更改每页数量
+    handleSizeChange2(val) {
+      this.dpageSize = val;
+      this.dcurrentPage = 1;
+     this.handletwoList()
+    },
+    // 更改当前页
+    handleCurrentChange2(val) {
+
+      this.dcurrentPage = val;
+      this.handletwoList()
+    },
     // 获取货品信息
     handletwoList() {
       // this.searchForm.type
       const paramss = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
+        pageNum: this.dcurrentPage,
+        pageSize: this.dpageSize,
         policyId: this.comCode,
         saleTypeCode: "",
       };

+ 14 - 12
src/views/sales_policy/components/Examine.vue

@@ -183,7 +183,6 @@
             <el-table-column
               prop="saleTypeCode"
               label="销售类型编码"
-
               align="center"
             >
             </el-table-column>
@@ -587,9 +586,9 @@ export default {
   data() {
     return {
       baseURL: "",
-      dcurrentPage:1,
-      dpageSize:10,
-      dlistTotal:0,
+      dcurrentPage: 1,
+      dpageSize: 10,
+      dlistTotal: 0,
       currentPages: 1, // 当前页码
       pageSizes: 10, // 每页数量
       clistTotal: 0,
@@ -660,7 +659,7 @@ export default {
               hover: "",
               url: this.detail.imgSrc,
             },
-           ]
+          ];
         }
         this.handletwoList();
         // 获取条件政策
@@ -707,16 +706,19 @@ export default {
       this.currentPages = val;
       this.getCond();
     },
-      // 更改每页数量
+    // 更改每页数量
     handleSizeChange2(val) {
-      this.dpageSize = val;
+
+    this.dpageSize = val;
       this.dcurrentPage = 1;
-     this.handletwoList()
+      this.handletwoList();
     },
     // 更改当前页
     handleCurrentChange2(val) {
+
+
       this.dcurrentPage = val;
-      this.handletwoList()
+      this.handletwoList();
     },
     getCommonApi(row) {
       (this.isEdit = 2), (this.cid = row.id), (this.cpolicyId = row.policyId);
@@ -755,15 +757,15 @@ export default {
     handletwoList() {
       // this.searchForm.type
       const paramss = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
+        pageNum: this.dcurrentPage,
+        pageSize: this.dpageSize,
         policyId: this.detail.code,
         saleTypeCode: "",
       };
       getMaterialList(paramss)
         .then((result) => {
           this.dataList = result.data.records;
-          this.listTotal = result.data.total;
+          this.dlistTotal = result.data.total;
           this.listLoading = false;
         })
         .catch((err) => {

+ 125 - 74
src/views/supply/policy/components/retail_form.vue

@@ -17,7 +17,7 @@
       label-position="right"
     >
       <el-row :gutter="20">
-        <el-col :xs="24" :sm="12" :lg="8" v-if="!listItem">
+        <el-col :xs="24" :sm="12" :lg="8" >
           <el-form-item label="销售政策编号" prop="policyCode">
             <div style="display: flex">
               <el-input
@@ -34,7 +34,7 @@
             </div>
           </el-form-item>
         </el-col>
-        <el-col :xs="24" :sm="12" :lg="8" v-else>
+        <!-- <el-col :xs="24" :sm="12" :lg="8" v-else>
           <el-form-item label="销售政策编号" prop="policyCode">
             <el-input
               disabled
@@ -42,7 +42,8 @@
               placeholder="销售政策编号"
             ></el-input>
           </el-form-item>
-        </el-col>
+
+        </el-col> -->
         <el-col :xs="24" :sm="12" :lg="8" style="height: 51px">
           <el-form-item label="单据日期" prop="date">
             <el-date-picker
@@ -85,7 +86,7 @@
 
     <div class="main-title">
       <div class="title">货品信息</div>
-      <div v-if="!listItem">
+      <div >
         <el-select
           v-model="warehouseValue"
           placeholder="请选择发货仓库"
@@ -221,9 +222,8 @@
         >
           <template slot-scope="scope">
             {{
-              ((scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) /
-              100)||0
-
+              (scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) /
+                100 || 0
             }}
           </template>
         </el-table-column>
@@ -386,28 +386,11 @@
         </el-table-column>
       </el-table>
     </div>
-    <el-dialog :visible.sync="dialogVisible" width="50%">
-      <el-form label-width="80px" :inline="false" size="small">
-        <el-form-item label="单据日期" prop="date">
-          <el-date-picker
-            v-model="mainForm.date"
-            type="datetime"
-            value-format="yyyy-MM-dd HH:mm:ss"
-            style="width: 100%"
-            placeholder="选择日期"
-          >
-          </el-date-picker>
-        </el-form-item>
-      </el-form>
-
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" size="small" @click="hendleEdit"
-          >确 定</el-button
-        >
-      </span>
-    </el-dialog>
-    <div class="page-footer">
+
+    <div class="page-footer" style="
+    position: fixed;
+    bottom: 0;
+  ">
       <div class="footer" :class="classObj">
         <el-button type="primary" @click="clickSubmitForm">保 存</el-button>
         <el-popconfirm
@@ -434,7 +417,7 @@
           label-width="120px"
           size="small"
         >
-         <el-row v-if="factor.length" style="margin:0 0 20px 0">
+          <el-row v-if="factor.length" style="margin: 0 0 20px 0">
             引用销售政策说明:{{ factor.length ? factor[0].name : "" }}
           </el-row>
           <el-row :gutter="20">
@@ -448,7 +431,7 @@
                   :disabled="disabled"
                   style="width: 100%"
                 >
-                <el-option label="默认" :value="''"></el-option>
+                  <el-option label="默认" :value="''"></el-option>
 
                   <el-option
                     v-for="(item, index) in policyList"
@@ -484,7 +467,7 @@
                   placeholder="选择销售类型"
                   style="width: 100%"
                 >
-                <el-option  label="默认" :value="''"></el-option>
+                  <el-option label="默认" :value="''"></el-option>
 
                   <el-option
                     v-for="item in ztypeList"
@@ -602,8 +585,8 @@
             @select-all="handleSelectionChange"
             @selection-change="handleSelectionChange"
             stripe
-            show-summary
-            :summary-method="$getSummaries"
+                show-summary
+              :summary-method="$getSummaries"
           >
             <el-table-column
               align="center"
@@ -812,7 +795,7 @@ export default {
 
   computed: {
     sidebar() {
-      console.log(11145454);
+      // console.log(11145454);
       return this.$store.state.app.sidebar;
     },
     classObj() {
@@ -859,6 +842,11 @@ export default {
     //     },
     //   };
     // },
+      wZong(){
+        return (val,oval)=>{
+            console.log(744);
+        }
+      }
   },
 
   created() {
@@ -903,6 +891,9 @@ export default {
     },
     // 选择销售政策获取政策条件列表
     async handlePolicy(e) {
+
+
+
       this.multipleSelections = [];
       this.dataList = [];
       this.popDataArr = [];
@@ -921,6 +912,9 @@ export default {
 
         if (this.policyId) {
           this.screenForm.policyId = this.policyId;
+          if (this.listItem) {
+            this.policyConditionId = data[0].id;
+          }
         } else {
           this.screenForm.policyId = data[0].policyId;
           this.policyConditionId = data[0].id;
@@ -986,6 +980,8 @@ export default {
         policyConditionId,
         popType,
       });
+
+
       if (!fang) {
         this.poptotal["total" + popType] = data.total;
         this.popcun["cun" + popType] = 1;
@@ -1001,11 +997,12 @@ export default {
       }
       const datas = data.records;
       // this.total = data.total;
+      // console.log(this.goodsList,'4555');
       if (this.goodsList.length) {
         for (let p = 0; p < this.goodsList.length; p++) {
           for (let q = 0; q < datas.length; q++) {
             if (this.goodsList[p].id == datas[q].id) {
-              datas[q].disabled = true;
+              this.$set(datas[q],'disabled',true)
             }
           }
         }
@@ -1013,8 +1010,12 @@ export default {
       for (let i = 0; i < data.records.length; i++) {
         data.records[i].qty = 1;
 
-        this.$set(data.records[i],'zong',data.records[i].qty * data.records[i].price)
-        data.records[i].sums1 = ['price', 'qty', 'zong'];
+        this.$set(
+          data.records[i],
+          "zong",
+          data.records[i].qty * data.records[i].price
+        );
+        data.records[i].sums1 = ["price", "qty", "zong"];
         // this.$set(data.records[i],'userList',this.userList)
       }
       if (fang) {
@@ -1024,6 +1025,54 @@ export default {
       }
       // consloe(this.popDataArr);
     },
+     // 获取政策列表
+    getMaterialTypeList(val) {
+      getMaterialTypeList({
+        pageNum: 1,
+        pageSize: 10,
+        policyId: this.screenForm.policyId,
+        saleTypeCode: this.screenForm.saleTypeCode,
+        [val]: true,
+      }).then((res) => {
+
+           this.dataList = res.data.records;
+            if (this.listItem) {
+
+          for (let i = 0; i < this.dataList.length; i++) {
+           for (let j = 0; j < this.goodsList.length; j++) {
+              console.log(8888);
+              if (this.dataList[i].id==this.goodsList[j].id) {
+                    this.$set(this.dataList[i],'disabled',true)
+                }
+
+           }
+
+          }
+        }
+
+        for (let i = 0; i < res.data.records.length; i++) {
+          res.data.records[i].qty = 1;
+           this.$set(
+          res.data.records[i],
+          "zong",
+          res.data.records[i].qty * res.data.records[i].price
+          );
+          res.data.records[i].sums1 = ["price", "qty", "zong"];
+          res.data.records[i].userList = this.userList;
+          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;
+        this.popDataArr = [];
+        this.popArr = [];
+        // // consloe(this.dataList, "kkkk");
+      });
+    },
     // 下一步获取某个政策条件比例数据
     handleCondition() {
       if (this.multipleSelection.length) {
@@ -1112,10 +1161,14 @@ export default {
           this.$set(item, "userList", this.userList);
         });
 
-          if (this.goodsList.length &&  this.goodsList[0].wallets.length ) {
-              this.mainForm.k3ServiceName = this.goodsList[0].wallets[0].serviceId || '';
-             this.mainForm.k3ServiceId = this.goodsList[0].wallets[0].serviceId || '';
-          }
+
+        if (this.goodsList.length && this.goodsList[0].wallets.length) {
+          this.mainForm.k3ServiceName =
+            this.goodsList[0].wallets[0].serviceId || "";
+          this.mainForm.k3ServiceId =
+            this.goodsList[0].wallets[0].serviceId || "";
+        }
+
         this.cusIndex = 0;
         this.total = 0;
         this.popDataArr = [];
@@ -1138,10 +1191,14 @@ export default {
         } else {
           this.goodsList = arrData;
         }
-         if (this.goodsList.length &&  this.goodsList[0].wallets.length ) {
-              this.mainForm.k3ServiceName = this.goodsList[0].wallets[0].serviceId || '';
-             this.mainForm.k3ServiceId = this.goodsList[0].wallets[0].serviceId || '';
-          }
+
+
+        if (this.goodsList.length && this.goodsList[0].wallets.length) {
+          this.mainForm.k3ServiceName =
+            this.goodsList[0].wallets[0].serviceId || "";
+          this.mainForm.k3ServiceId =
+            this.goodsList[0].wallets[0].serviceId || "";
+        }
 
         this.goodsList.forEach((item) => {
           this.$set(item, "status1", "");
@@ -1157,6 +1214,7 @@ export default {
         this.$refs.singleTable.forEach((k) => {
           k.clearSelection();
         });
+
         // this.$refs.singleTable.clearSelection();
       } else {
         this.$errorMsg("请选择");
@@ -1170,6 +1228,7 @@ export default {
         this.mainForm.type = data.mainId;
         this.mainForm.remark = data.remark;
         this.mainForm.policyId = data.policyId;
+        this.policyId = data.policyId;
         this.mainForm.k3ServiceName = data.k3ServiceId;
         this.mainForm.k3ServiceId = data.k3ServiceId;
         data.retailOrderItemList.forEach((item) => {
@@ -1194,7 +1253,14 @@ export default {
         pageSize: -1,
         status: true,
       }).then((res) => {
-        this.screenForm.policyId = res.data.records[0].code;
+        if (this.policyId) {
+          this.screenForm.policyId = this.policyId
+          this.disabled = true
+
+        }else{
+           this.screenForm.policyId = res.data.records[0].code;
+        }
+
         this.policyList = res.data.records;
         if (this.policyList.length) {
           this.handlePolicy(this.screenForm.policyId);
@@ -1232,39 +1298,24 @@ export default {
         policyId: this.screenForm.policyId,
         saleTypeCode: this.screenForm.saleTypeCode,
       }).then((res) => {
+        console.log(res.data.records,'7777');
         for (let i = 0; i < res.data.records.length; i++) {
           res.data.records[i].qty = 1;
-          data.records[i].userList = this.userList;
-        }
+          this.$set(
+          res.data.records[i],
+          "zong",
+          res.data.records[i].qty * res.data.records[i].price
+          );
+          res.data.records[i].sums2 = ["price", "qty", "zong"];
+          res.data.records[i].userList = this.userList;
 
-        this.dataList = res.data.records;
-        this.total = res.data.total;
-      });
-    },
-    // 获取政策列表
-    getMaterialTypeList(val) {
-      getMaterialTypeList({
-        pageNum: 1,
-        pageSize: 10,
-        policyId: this.screenForm.policyId,
-        saleTypeCode: this.screenForm.saleTypeCode,
-        [val]: true,
-      }).then((res) => {
-        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;
-        this.popDataArr = [];
-        this.popArr = [];
-        // // consloe(this.dataList, "kkkk");
       });
     },
+
     // 打开引用
     handleShow() {
       this.isShowDialog = true;
@@ -1516,8 +1567,8 @@ export default {
           //   ].dictValue;
           let params = {
             theTime: this.mainForm.date,
-            k3ServiceId:this.mainForm.k3ServiceId,
-            k3ServiceName:this.mainForm.k3ServiceName,
+            k3ServiceId: this.mainForm.k3ServiceId,
+            k3ServiceName: this.mainForm.k3ServiceName,
             remark: this.mainForm.remark,
             type: 2, // 1:普通零售单,2:政策零售单
             retailOrderItemList: this.goodsList,