浏览代码

Merge branch 'master' into feature/Feature-displace

莫绍宝 2 年之前
父节点
当前提交
e60ed8404b

+ 50 - 81
src/layout/components/Navbar.vue

@@ -1,10 +1,6 @@
 <template>
   <div class="navbar">
-    <hamburger
-      :is-active="sidebar.opened"
-      class="hamburger-container"
-      @toggleClick="toggleSideBar"
-    />
+    <hamburger :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
 
     <breadcrumb class="breadcrumb-container" v-if="showBreadcrumb" />
 
@@ -26,18 +22,9 @@
         <span style="font-size: 16px; margin-left: 6px;">家用工程机登录</span>
       </div>
 
-      <el-badge
-        :value="noticeCount"
-        :max="10"
-        :hidden="!noticeVisible"
-        class="right-menu-item hover-effect"
-      >
+      <el-badge :value="noticeCount" :max="10" :hidden="!noticeVisible" class="right-menu-item hover-effect">
         <el-tooltip effect="dark" content="系统消息" placement="bottom">
-          <i
-            class="el-icon-message-solid"
-            @click="goNotice"
-            style="font-size: 24px; line-height: 50px"
-          ></i>
+          <i class="el-icon-message-solid" @click="goNotice" style="font-size: 24px; line-height: 50px"></i>
         </el-tooltip>
         <!-- <el-button icon="el-icon-message-solid" type="text" class="notice-icon" @click="goNotice"></el-button> -->
       </el-badge>
@@ -61,31 +48,13 @@
       </el-dropdown>
     </div>
 
-    <el-dialog
-      title="绑定工程机系统"
-      :visible.sync="dialogFormVisible"
-      :modal="false"
-      width="30%"
-    >
+    <el-dialog title="绑定工程机系统" :visible.sync="dialogFormVisible" :modal="false" width="30%">
       <el-form ref="engineForm" :model="engineForm" :rules="engineFormRules">
         <el-form-item label="账号" :label-width="formLabelWidth" prop="account">
-          <el-input
-            v-model="engineForm.account"
-            placeholder="请输入账号"
-            autocomplete="off"
-          ></el-input>
+          <el-input v-model="engineForm.account" placeholder="请输入账号" autocomplete="off"></el-input>
         </el-form-item>
-        <el-form-item
-          label="密码"
-          :label-width="formLabelWidth"
-          prop="password"
-        >
-          <el-input
-            v-model="engineForm.password"
-            placeholder="请输入密码"
-            autocomplete="off"
-            show-password
-          ></el-input>
+        <el-form-item label="密码" :label-width="formLabelWidth" prop="password">
+          <el-input v-model="engineForm.password" placeholder="请输入密码" autocomplete="off" show-password></el-input>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -144,14 +113,14 @@
 </template>
 
 <script>
-import { getRebateOrderMsg } from '@/api/dashboard'
-import { mapGetters } from 'vuex'
-import Breadcrumb from '@/components/Breadcrumb'
-import Hamburger from '@/components/Hamburger'
-import Screenfull from '@/components/Screenfull'
-import NavMenu from '@/components/NavMenu'
-import { getNoticeListCount } from '@/api/notice'
-import { bindEngineAccount, checkEngineAccount } from '@/api/setting'
+import { getRebateOrderMsg } from "@/api/dashboard";
+import { mapGetters } from "vuex";
+import Breadcrumb from "@/components/Breadcrumb";
+import Hamburger from "@/components/Hamburger";
+import Screenfull from "@/components/Screenfull";
+import NavMenu from "@/components/NavMenu";
+import { getNoticeListCount } from "@/api/notice";
+import { bindEngineAccount, checkEngineAccount } from "@/api/setting";
 
 export default {
   data() {
@@ -176,19 +145,19 @@ export default {
       formLabelWidth: "100px",
       dialogFormVisible: false,
       //websocket错误连接次数
-      wsConnectErrorTime:1,
+      wsConnectErrorTime: 1,
       websock: null,
-      lockReconnect:false,
+      lockReconnect: false,
     };
   },
   mounted() {
     const that = this;
     // 开定时器轮询未读消息接口(写在全局vuex里比较好)
     // that.initNotice();
-    that.tcMessage();
-    this.intivalId = setInterval(function () {
-      that.tcMessage();
-    }, 5000);
+    // that.tcMessage();
+    // this.intivalId = setInterval(function () {
+    //   that.tcMessage();
+    // }, 5000);
     // this.timer = setInterval(function () {
     //   that.initNotice();
     // }, 3000);
@@ -228,9 +197,8 @@ export default {
     async logout() {
       await this.$store.dispatch("user/logout");
       // this.$router.push(`/login?redirect=${this.$route.fullPath}`)
-      this.$store.commit('tagsView/SET_RESET_VIES')
+      this.$store.commit("tagsView/SET_RESET_VIES");
       this.$router.push(`/login`);
-
     },
     initNotice() {
       getNoticeListCount().then((res) => {
@@ -241,25 +209,25 @@ export default {
         }
       });
     },
-    async tcMessage() {
-      // 长链接
-      // let data = {
-      //   type: 'RebateOrderMsg',
-      //   params: {
-      //   }
-      // }
-      // this.websocketSend(JSON.stringify(data))
-      let res = await getRebateOrderMsg();
-      if (res.data.hasMessage) {
-        this.$notify.info({
-          title: "消息",
-          message: res.data.messages,
-          position: "bottom-right",
-          duration: 4000,
-          showClose: false,
-        });
-      }
-    },
+    // async tcMessage() {
+    //   // 长链接
+    //   // let data = {
+    //   //   type: 'RebateOrderMsg',
+    //   //   params: {
+    //   //   }
+    //   // }
+    //   // this.websocketSend(JSON.stringify(data))
+    //   let res = await getRebateOrderMsg();
+    //   if (res.data.hasMessage) {
+    //     this.$notify.info({
+    //       title: "消息",
+    //       message: res.data.messages,
+    //       position: "bottom-right",
+    //       duration: 4000,
+    //       showClose: false,
+    //     });
+    //   }
+    // },
     goNotice() {
       this.$router.push("/notice/index");
     },
@@ -392,21 +360,21 @@ export default {
       //this.heartCheck.reset().start();
     },
     websocketOnerror: function (e) {
-      console.debug("WebSocket连接发生错误,第%s次",this.wsConnectErrorTime);
+      console.debug("WebSocket连接发生错误,第%s次", this.wsConnectErrorTime);
 
       this.wsConnectErrorTime = this.wsConnectErrorTime + 1;
-      if(this.wsConnectErrorTime>5){
+      if (this.wsConnectErrorTime > 5) {
         console.debug("WebSocket连接错误超过5次,就不再重新连了!");
-        this.lockReconnect = true
+        this.lockReconnect = true;
         return;
       }
 
       this.reconnect();
     },
     websocketOnmessage: function (e) {
-      console.debug("-----接收消息-------",e.data);
+      console.debug("-----接收消息-------", e.data);
       let data = eval("(" + e.data + ")"); //解析对象
-      if (data.type === 'RebateOrderMsg') {
+      if (data.type === "RebateOrderMsg") {
         if (data.res.hasMessage) {
           this.$notify.info({
             title: "消息",
@@ -420,12 +388,13 @@ export default {
     },
     websocketOnclose: function (e) {
       console.debug("connection closed (" + e + ")");
-      if(e){
+      if (e) {
         console.debug("connection closed (" + e.code + ")");
       }
       this.reconnect();
     },
-    websocketSend(text) { // 数据发送
+    websocketSend(text) {
+      // 数据发送
       try {
         this.websock.send(text);
       } catch (err) {
@@ -434,7 +403,7 @@ export default {
     },
     reconnect() {
       var that = this;
-      if(that.lockReconnect) return;
+      if (that.lockReconnect) return;
       that.lockReconnect = true;
       //没连接上会一直重连,设置延迟避免请求过多
       setTimeout(function () {

+ 92 - 16
src/mixin/print.js

@@ -142,7 +142,7 @@ export default {
           loadingLen = data.length;
           for (let i = data.length; i > 0; i--) {
             const newData = data[i - 1];
-            await this.setPrintData(newData);
+            await this.setPrintData(newData,funcType);
             loadingLen--;
           }
         } catch (error) {
@@ -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("添加打印次数失败");
       }
@@ -273,16 +273,22 @@ export default {
      * @param {object} data
      * this.outputData 打印数据
      */
-    setPrintData(data) {
+    setPrintData(data,funcType) {
       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 = funcType==='getDtailPrintDis'?data.invoicePickBeans[0].remark || "" : data.remark||"";
+      console.log(data.invoicePickBeans[0],'oo');
+      let tuiHuoRen = data.createBy;
       // 数量合计
-      let total = 0
+      let total = 0;
       // 初始化打印次数
       let printNum = 0;
       //避免数据发生改变
@@ -300,7 +306,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 +315,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 +334,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 +352,7 @@ export default {
           nowDate: this.nowDate(),
           takerName:
             data.type === 2
-              ? `退货人:${tuiHuoRen|| ""}`
+              ? `退货人:${tuiHuoRen || ""}`
               : `提货人:${data.takerName || ""}`,
           customerName: data.customerName || "",
           correspondName: data.correspondName,
@@ -434,5 +442,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 = [];
+
+      // 仓库认证请求接口参数
+      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);
+        }
+      }
+
+      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 (loadingLen == 0) {
+        return Promise.resolve();
+      }
+    },
   },
 };

+ 3 - 0
src/views/deposit_home/components/refund_list-detail.vue

@@ -473,6 +473,9 @@
                 <span>{{ scope.row.specification }}</span>
               </template>
             </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="单价"

+ 3 - 0
src/views/deposit_home/deposit_list.vue

@@ -396,6 +396,9 @@
                 <span>{{ scope.row.specification }}</span>
               </template>
             </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="是否退押"

+ 3 - 0
src/views/deposit_home/refund_list.vue

@@ -572,6 +572,9 @@
                 <span>{{ scope.row.specification }}</span>
               </template>
             </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="是否退押"

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

@@ -672,7 +672,7 @@ export default {
       }
     },
     getCommonApi() {
-      this.getK3List();
+      // this.getK3List();
       // 非返利钱包
       getNoRebateWalletList({ walletName: "" }).then((res) => {
         this.NoRebateWalletList = res.data;

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

@@ -672,7 +672,7 @@ export default {
       }
     },
     getCommonApi() {
-      this.getK3List()
+      // this.getK3List()
       // 非返利钱包
       getNoRebateWalletList({ walletName: '' }).then((res) => {
         this.NoRebateWalletList = res.data

+ 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) {