浏览代码

【修改】bug

howie 2 年之前
父节点
当前提交
b0ec6f9dc3

+ 81 - 74
src/mixin/print.js

@@ -162,7 +162,7 @@ export default {
             this.setPrintData(data);
           } catch (error) {
             this.$endLoading();
-            this.$errorMsg(error)
+            this.$errorMsg(error);
             console.error("获取打印数据失败");
           }
           loadingLen--;
@@ -236,7 +236,7 @@ export default {
         }
         await funcType(requestParams);
         //清空当前克隆数据,避免重复添加次数
-        this.clonelData = []
+        this.clonelData = [];
       } catch (error) {
         console.error("添加打印次数失败");
       }
@@ -277,12 +277,17 @@ export default {
       let salesOrderId, invoiceId; //出库单号,发货单号 默认数据中的第一个
       salesOrderId = data.invoicePickBeans[0].salesOrderId;
       invoiceId = data.invoicePickBeans[0].invoiceId;
-      let refUseUnit,refEnginRecordNo
-      refUseUnit=data.refUseUnit|| data.invoicePickBeans[0].refUseUnit || ''
-      refEnginRecordNo=data.refEnginRecordNo|| data.invoicePickBeans[0].refEnginRecordNo || ''
-      let tuiHuoRen = data.createBy
+      let refUseUnit, refEnginRecordNo;
+      refUseUnit = data.refUseUnit || data.invoicePickBeans[0].refUseUnit || "";
+      refEnginRecordNo =
+        data.refEnginRecordNo ||
+        data.invoicePickBeans[0].refEnginRecordNo ||
+        "";
+      let remark;
+      remark = data.invoicePickBeans[0].remark;
+      let tuiHuoRen = data.createBy;
       // 数量合计
-      let total = 0
+      let total = 0;
       // 初始化打印次数
       let printNum = 0;
       //避免数据发生改变
@@ -300,7 +305,7 @@ export default {
           const newInvoicePickBeans = invoicePickBeans.splice(0, 5);
           for (let e = newInvoicePickBeans.length; e > 0; e--) {
             const tempData = newInvoicePickBeans[e - 1];
-            total += Math.abs(+tempData.refundableQty)
+            total += Math.abs(+tempData.refundableQty);
 
             //添加表格数据
             table.push({
@@ -309,7 +314,9 @@ export default {
                 ? this.dateToDayFilter(data.createTime)
                 : "",
               enginOrderType:
-                tempData.orderType == "HOME" || tempData.orderType == "TRADE" || tempData.orderType === "REQUISITION_TRADE" ||
+                tempData.orderType == "HOME" ||
+                tempData.orderType == "TRADE" ||
+                tempData.orderType === "REQUISITION_TRADE" ||
                 tempData.orderType === "REQUISITION_HOME"
                   ? tempData.enginOrderNo
                   : tempData.mainOrderId,
@@ -326,14 +333,14 @@ export default {
           printNum: printNum + 1,
           salesId: salesOrderId,
           invoiceId: invoiceId,
-          refUseUnit:refUseUnit,
-          refEnginRecordNo:refEnginRecordNo,
+          refUseUnit: refUseUnit,
+          refEnginRecordNo: refEnginRecordNo,
           type: data.type,
           tiTui: data.type === 2 ? `退货人` : `提货人`,
           takerPhone: data.takerPhone || "",
-          headerRemark: data.remark,
+          headerRemark: remark,
           total_num: data.total_num,
-          total:total,
+          total: total,
           company:
             data.type === 2
               ? `${this.company}销售退货单`
@@ -344,7 +351,7 @@ export default {
           nowDate: this.nowDate(),
           takerName:
             data.type === 2
-              ? `退货人:${tuiHuoRen|| ""}`
+              ? `退货人:${tuiHuoRen || ""}`
               : `提货人:${data.takerName || ""}`,
           customerName: data.customerName || "",
           correspondName: data.correspondName,
@@ -434,73 +441,73 @@ export default {
          </div>
         `;
     },
-        /**
-         * 备份方法
+    /**
+     * 备份方法
      * 获取需要打印数据详情
      * @param {Array} ids
      */
-         async getDateils(ids, funcType = "getDeliverDetail") {
-          this.$startLoading();
-          let loadingLen;
-          // 兼容多个打印数据
-          ids = ids instanceof Array ? ids : [ids];
-          console.log(ids);
-          // 清空之前打印的数据
-          this.outputData = [];
-          // 筛选id
-          let formatting = [];
+    async getDateils(ids, funcType = "getDeliverDetail") {
+      this.$startLoading();
+      let loadingLen;
+      // 兼容多个打印数据
+      ids = ids instanceof Array ? ids : [ids];
+      console.log(ids);
+      // 清空之前打印的数据
+      this.outputData = [];
+      // 筛选id
+      let formatting = [];
 
-          // 仓库认证请求接口参数
-          let params = [];
+      // 仓库认证请求接口参数
+      let params = [];
 
-          // 获取数据id
-          for (let i = ids.length; i > 0; i--) {
-            formatting.push(ids[i - 1].id || ids[i - 1]);
-            if (funcType === "getDtailPrintDis") {
-              params.push({
-                id: ids[i - 1].id,
-                invoiceId: ids[i - 1].invoiceId,
-              });
-              this.addIds.push(ids[i - 1].id);
-            }
-          }
+      // 获取数据id
+      for (let i = ids.length; i > 0; i--) {
+        formatting.push(ids[i - 1].id || ids[i - 1]);
+        if (funcType === "getDtailPrintDis") {
+          params.push({
+            id: ids[i - 1].id,
+            invoiceId: ids[i - 1].invoiceId,
+          });
+          this.addIds.push(ids[i - 1].id);
+        }
+      }
 
-          if (funcType === "getDtailPrintDis") {
-            const requestParams = params;
-            try {
-              const { data } = await getDtailPrintDis(requestParams);
-              loadingLen = data.length;
-              for (let i = data.length; i > 0; i--) {
-                const newData = data[i - 1];
-                await this.setPrintData(newData);
-                loadingLen--;
-              }
-            } catch (error) {
-              this.$endLoading();
-              console.error("获取打印数据失败");
-            }
-          } else {
-            // id 去重
-            formatting = [...new Set(formatting)];
-            loadingLen = formatting.length;
-            for (let i = formatting.length; i > 0; i--) {
-              const requestParams = {
-                id: formatting[i - 1],
-              };
-              try {
-                const { data } = await getDeliverDetail(requestParams);
-                this.setPrintData(data);
-              } catch (error) {
-                this.$endLoading();
-                this.$errorMsg(error)
-                console.error("获取打印数据失败");
-              }
-              loadingLen--;
-            }
+      if (funcType === "getDtailPrintDis") {
+        const requestParams = params;
+        try {
+          const { data } = await getDtailPrintDis(requestParams);
+          loadingLen = data.length;
+          for (let i = data.length; i > 0; i--) {
+            const newData = data[i - 1];
+            await this.setPrintData(newData);
+            loadingLen--;
           }
-          if (loadingLen == 0) {
-            return Promise.resolve();
+        } catch (error) {
+          this.$endLoading();
+          console.error("获取打印数据失败");
+        }
+      } else {
+        // id 去重
+        formatting = [...new Set(formatting)];
+        loadingLen = formatting.length;
+        for (let i = formatting.length; i > 0; i--) {
+          const requestParams = {
+            id: formatting[i - 1],
+          };
+          try {
+            const { data } = await getDeliverDetail(requestParams);
+            this.setPrintData(data);
+          } catch (error) {
+            this.$endLoading();
+            this.$errorMsg(error);
+            console.error("获取打印数据失败");
           }
-        },
+          loadingLen--;
+        }
+      }
+      if (loadingLen == 0) {
+        return Promise.resolve();
+      }
+    },
   },
 };

+ 17 - 8
src/views/supply/engin/components/home_detail.vue

@@ -165,6 +165,10 @@
               <div class="label">审批说明</div>
               <div class="value">{{detailData.examineNote}}</div>
             </el-col>
+            <el-col :span="24" class="item">
+          <div class="label" v-if="!isDealer">引用记录</div>
+          <div class="value">{{detailData.items[0].useRefCount}}</div>
+        </el-col>
           </el-row>
         </div>
 
@@ -189,22 +193,22 @@
             <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
             <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip></el-table-column>
-            <el-table-column align="left" label="实装物料编号" prop="realMaterialNumber" min-width="150" show-overflow-tooltip></el-table-column>
-            <el-table-column align="left" label="实装厂产品编码" prop="realMaterialOldNumber" min-width="200" show-overflow-tooltip></el-table-column>
             <el-table-column align="left" label="实装规格型号" prop="realSpecification" min-width="300" show-overflow-tooltip></el-table-column>
-            <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{ scope.row.price | numToFixed }}
               </template>
             </el-table-column>
-            <el-table-column align="right" label="工程登录数量" prop="enginNum" min-width="120" show-overflow-tooltip></el-table-column>
-            <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="right" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{ scope.row.totalAmount | numToFixed }}
               </template>
             </el-table-column>
+
+            <el-table-column align="right" label="工程登录数量" prop="enginNum" min-width="120" show-overflow-tooltip></el-table-column>
+            <el-table-column align="left" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip></el-table-column>
+
             <el-table-column align="right" label="返利类型" prop="customerWalletName2" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="right" label="实付返利金额" prop="payRebateAmount" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
@@ -216,7 +220,6 @@
                 {{ scope.row.discAmount | numToFixed }}
               </template>
             </el-table-column>
-            <el-table-column align="left" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="right" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{ scope.row.payAmount | numToFixed }}
@@ -228,9 +231,15 @@
               </template>
             </el-table-column>
             <el-table-column align="right" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="right" label="原订单数量" prop="oldQty" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="right" label="已发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
+
+            <!-- <el-table-column align="right" label="原订单数量" prop="oldQty" min-width="100" 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-column align="left" label="实装物料编号" prop="realMaterialNumber" min-width="150" show-overflow-tooltip></el-table-column>
+            <el-table-column align="left" label="实装厂产品编码" prop="realMaterialOldNumber" min-width="200" show-overflow-tooltip></el-table-column>
             <el-table-column align="left" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+
           </el-table>
         </div>
 
@@ -502,7 +511,7 @@ export default {
         if(res.data.items) {
           res.data.items.forEach(item => {
             item.number = (item.qty*100 - item.retiredQty*100) / 100;
-            item.sums1 = ['number', 'directTransferQty', 'qty', 'enginNum', 'oldQty'];
+            item.sums1 = ['number', 'directTransferQty', 'qty', 'enginNum', 'oldQty','hasSendQty'];
             item.sums2 = ['totalAmount', 'payAmount', 'price', 'payRebateAmount', 'discAmount'];
           })
         }

+ 9 - 3
src/views/supply/engin/components/home_examine.vue

@@ -195,6 +195,11 @@
           <div class="label">关闭日期</div>
           <div class="value">{{detailData.closeTime}}</div>
         </el-col>
+        <el-col :span="24" class="item" v-if="!isDealer">
+          <div class="label">引用记录</div>
+          <div class="value">{{goodsList[0].useRefCount}}</div>
+        </el-col>
+
       </el-row>
     </div>
 
@@ -214,14 +219,13 @@
         show-summary
         :summary-method="$getSummaries">
         <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-        <el-table-column align="left" label="引用记录" prop="useRefCount" min-width="160" show-overflow-tooltip></el-table-column>
+        <!-- <el-table-column align="left" label="引用记录" prop="useRefCount" min-width="160" show-overflow-tooltip></el-table-column> -->
         <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip></el-table-column>
         <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip></el-table-column>
         <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
         <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip></el-table-column>
-        <el-table-column align="left" label="实装物料编号" prop="realMaterialNumber" min-width="150" show-overflow-tooltip></el-table-column>
-            <el-table-column align="left" label="实装厂产品编码" prop="realMaterialOldNumber" min-width="200" show-overflow-tooltip></el-table-column>
+
             <el-table-column align="left" label="实装规格型号" prop="realSpecification" min-width="300" show-overflow-tooltip></el-table-column>
         <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
@@ -300,6 +304,8 @@
         <el-table-column align="right" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="right" label="已发货数量" prop="hasSendQty" min-width="100" 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-column align="left" label="实装物料编号" prop="realMaterialNumber" min-width="150" show-overflow-tooltip></el-table-column>
+            <el-table-column align="left" label="实装厂产品编码" prop="realMaterialOldNumber" min-width="200" show-overflow-tooltip></el-table-column>
         <el-table-column align="left" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
       </el-table>

+ 20 - 6
src/views/supply/engin/components/home_form.vue

@@ -204,7 +204,8 @@
     </div>
 
     <div class="table" style="margin-top: 20px">
-      <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
+      <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400"   show-summary
+            :summary-method="$getSummaries">
         <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
         <!-- <el-table-column align="center" label="引用记录" prop="useRefCount" min-width="160" show-overflow-tooltip></el-table-column> -->
         <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="120" show-overflow-tooltip></el-table-column>
@@ -245,7 +246,7 @@
             <el-input v-model="scope.row.qty" size="small" type="number" @mousewheel.native.prevent></el-input>
           </template>
         </el-table-column>
-        <el-table-column align="center" label="订单金额" min-width="100" show-overflow-tooltip>
+        <el-table-column align="center" label="订单金额" prop="dida" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{scope.row.price * scope.row.qty}}
           </template>
@@ -262,12 +263,12 @@
             </el-select>
           </template>
         </el-table-column>
-        <el-table-column align="center" label="返利金额" min-width="100" show-overflow-tooltip>
+        <el-table-column align="center" label="返利金额" min-width="100" show-overflow-tooltip prop="compute_flAmount">
           <template slot-scope="scope">
             {{(scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) / 100}}
           </template>
         </el-table-column>
-        <el-table-column align="center" label="格力折扣" min-width="100" show-overflow-tooltip>
+        <el-table-column align="center" label="格力折扣" prop="ko" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{scope.row.qty * scope.row.discAmount}}
           </template>
@@ -284,7 +285,7 @@
             </el-select>
           </template>
         </el-table-column>
-        <el-table-column align="center" label="实付金额" prop="qty" min-width="100" show-overflow-tooltip>
+        <el-table-column align="center" label="实付金额" min-width="100" show-overflow-tooltip prop="compute_sfAmount">
           <template slot-scope="scope">
             {{((scope.row.price * scope.row.qty) * 100 - ((scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) / 100) * 100 - ((scope.row.qty * (scope.row.discAmount * 100)) / 100) * 100) / 100}}
           </template>
@@ -722,6 +723,16 @@ export default {
   watch: {
     goodsList: {
       handler(newValue, oldValue) {
+
+        if(newValue && newValue.length) {
+          newValue.forEach((item, index) => {
+            this.goodsList[index].compute_sfAmount = (((item.price * item.qty) * 100 - ((item.price * item.qty * (item.rebateRate * 100)) / 100) * 100 - ((item.qty * (item.discAmount * 100)) / 100) * 100) / 100);
+            this.goodsList[index].compute_flAmount = (item.price * item.qty * (item.rebateRate * 100)) / 100
+            this.goodsList[index].ko = item.qty * item.discAmount
+            this.goodsList[index].dida = item.price * item.qty
+          })
+        }
+
         if(this.goodsList && this.goodsList.length) {
           if(this.isFirst) {
             this.isFirst = false;
@@ -1007,7 +1018,10 @@ export default {
         this.mainForm.examineStatus = data.examineStatus;
         this.mainForm.refBuyUnitName = data.refBuyUnitName;
         this.mainForm.refPromiseProvide = data.refPromiseProvide;
-
+        data.items.forEach(item => {
+            item.sums1 = ['directTransferQty', 'qty', 'enginNum', 'refundableQty', 'tdQty', 'hasSendQty','retiredQty','ko'];
+            item.sums2 = ['totalAmount', 'payAmount', 'price', 'discAmount', 'payRebateAmount', 'compute_sfAmount', 'compute_flAmount','dida'];
+          })
         data.items.forEach(item => {
           item.status1 = '';
           item.status2 = '';

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

@@ -1227,7 +1227,7 @@ export default {
         pageSize: -1,
         status:1,
         customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
-     specification: this.screenForm.specifications,
+        specification: this.screenForm.specification,
       })
        this.policyList = data.records
         if (data.records.length) {