Parcourir la source

Merge branch 'feature/Feature-copy' into develop

howie il y a 2 ans
Parent
commit
c3fea72518

+ 8 - 0
src/api/supply/implement.js

@@ -27,3 +27,11 @@ export function getTotalList(params) {
   })
 }
 
+// 商用信息单-执行明细
+export function getExecList(params) {
+  return request({
+    url: '/engin-info-order/exec/list',
+    method: 'get',
+    params
+  })
+}

+ 198 - 195
src/mixin/print.js

@@ -1,107 +1,107 @@
 import {
   disAutoConnect,
   hiprint,
-  defaultElementTypeProvider,
-} from "vue-plugin-hiprint";
-disAutoConnect();
-import panel from "@/utils/panel";
-import { addPrint, getDtailPrintDis } from "@/api/supply/pickup";
-import { getDeliverDetail } from "@/api/supply/deliver";
-import { addPrints } from "@/api/supply/pickup";
-import { getCompanyList } from "@/api/user";
+  defaultElementTypeProvider
+} from 'vue-plugin-hiprint'
+disAutoConnect()
+import panel from '@/utils/panel'
+import { addPrint, getDtailPrintDis } from '@/api/supply/pickup'
+import { getDeliverDetail } from '@/api/supply/deliver'
+import { addPrints } from '@/api/supply/pickup'
+import { getCompanyList } from '@/api/user'
 
 export default {
   data() {
     return {
-      company: "", // 公司名称
+      company: '', // 公司名称
       clonelData: [], // 克隆数据
       outputData: [], // 打印数据
       curPaper: {
-        type: "A5",
+        type: 'A5',
         width: 500,
-        height: 147.6,
+        height: 147.6
       },
       paperTypes: {
         A3: {
           width: 420,
-          height: 296.6,
+          height: 296.6
         },
         A4: {
           width: 210,
-          height: 296.6,
+          height: 296.6
         },
         A5: {
           width: 210,
-          height: 147.6,
+          height: 147.6
         },
         B3: {
           width: 500,
-          height: 352.6,
+          height: 352.6
         },
         B4: {
           width: 250,
-          height: 352.6,
+          height: 352.6
         },
         B5: {
           width: 250,
-          height: 175.6,
-        },
+          height: 175.6
+        }
       },
       scaleValue: 1,
       scaleMax: 5,
       scaleMin: 0.5,
       loading: false,
-      hiprintTemplate: "",
-      addIds: [],
-    };
+      hiprintTemplate: '',
+      addIds: []
+    }
   },
   computed: {
     curPaperType() {
-      let type = "other";
-      let types = this.paperTypes;
+      let type = 'other'
+      const types = this.paperTypes
       for (const key in types) {
-        let item = types[key];
-        let { width, height } = this.curPaper;
+        const item = types[key]
+        const { width, height } = this.curPaper
         if (item.width === width && item.height === height) {
-          type = key;
+          type = key
         }
       }
-      return type;
-    },
+      return type
+    }
   },
   created() {
-    this.getCompanyLists();
+    this.getCompanyLists()
   },
   methods: {
     // 初始化打印模板
     initPrint() {
       hiprint.init({
-        providers: [new defaultElementTypeProvider()],
-      });
+        providers: [new defaultElementTypeProvider()]
+      })
       // 替换配置
       hiprint.setConfig({
         movingDistance: 2.5,
         text: {
           supportOptions: [
             {
-              name: "styler",
-              hidden: true,
+              name: 'styler',
+              hidden: true
             },
             {
-              name: "formatter",
-              hidden: true,
-            },
-          ],
-        },
-      });
+              name: 'formatter',
+              hidden: true
+            }
+          ]
+        }
+      })
       // eslint-disable-next-line no-undef
-      hiprint.PrintElementTypeManager.buildByHtml($(".ep-draggable-item"));
+      hiprint.PrintElementTypeManager.buildByHtml($('.ep-draggable-item'))
       this.hiprintTemplate = new hiprint.PrintTemplate({
         template: panel,
-        settingContainer: "#PrintElementOptionSetting",
-        paginationContainer: ".hiprint-printPagination",
-      });
-      this.hiprintTemplate.design("#hiprint-printTemplate");
+        settingContainer: '#PrintElementOptionSetting',
+        paginationContainer: '.hiprint-printPagination'
+      })
+      this.hiprintTemplate.design('#hiprint-printTemplate')
       // 获取当前放大比例, 当zoom时传true 才会有
       // this.scaleValue = hiprintTemplate.editingPanel.scale || 1;
     },
@@ -109,136 +109,139 @@ export default {
      * 获取需要打印数据详情
      * @param {Array} ids
      */
-    async getDateil(ids, funcType = "getDeliverDetail",check=null) {
-      this.$startLoading();
-      let loadingLen;
+    async getDateil(ids, funcType = 'getDeliverDetail', check = null) {
+      this.$startLoading()
+      let loadingLen
       // 兼容多个打印数据
-      ids = ids instanceof Array ? ids : [ids];
-      console.log(ids);
+      ids = ids instanceof Array ? ids : [ids]
+      console.log(ids)
       // 清空之前打印的数据
-      this.outputData = [];
+      this.outputData = []
       // 筛选id
-      let formatting = [];
+      let formatting = []
 
       // 仓库认证请求接口参数
-      let params = [];
+      const params = []
 
       // 获取数据id
       for (let i = ids.length; i > 0; i--) {
-        formatting.push(ids[i - 1].id || ids[i - 1]);
-        if (funcType === "getDtailPrintDis") {
+        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);
+            invoiceId: ids[i - 1].invoiceId
+          })
+          this.addIds.push(ids[i - 1].id)
         }
       }
 
-      if (funcType === "getDtailPrintDis") {
-        const requestParams = params;
+      if (funcType === 'getDtailPrintDis') {
+        const requestParams = params
         try {
-          const { data } = await getDtailPrintDis(requestParams);
-          loadingLen = data.length;
+          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,funcType,check);
-            loadingLen--;
+            const newData = data[i - 1]
+            await this.setPrintData(newData, funcType, check)
+            loadingLen--
           }
         } catch (error) {
-          this.$endLoading();
-          console.error("获取打印数据失败");
+          this.$endLoading()
+          console.error('获取打印数据失败')
         }
       } else {
         // id 去重
-        formatting = [...new Set(formatting)];
-        loadingLen = formatting.length;
+        formatting = [...new Set(formatting)]
+        loadingLen = formatting.length
         for (let i = formatting.length; i > 0; i--) {
           const requestParams = {
-            id: formatting[i - 1],
-          };
+            id: formatting[i - 1]
+          }
           try {
-            const { data } = await getDeliverDetail(requestParams);
-            this.setPrintData(data);
+            const { data } = await getDeliverDetail(requestParams)
+            this.setPrintData(data)
           } catch (error) {
-            this.$endLoading();
-            this.$errorMsg(error);
-            console.error("获取打印数据失败");
+            this.$endLoading()
+            this.$errorMsg(error)
+            console.error('获取打印数据失败')
           }
-          loadingLen--;
+          loadingLen--
         }
       }
       if (loadingLen == 0) {
-        return Promise.resolve();
+        return Promise.resolve()
       }
     },
     // 获取公司名称
     async getCompanyLists() {
       try {
-        const { data } = await getCompanyList();
-        this.company = data ? data[0].companyName : "";
+        const { data } = await getCompanyList()
+        this.company = data ? data[0].companyName : ''
       } catch (error) {
-        console.error("获取公司名称失败");
+        console.error('获取公司名称失败')
       }
     },
     // 获取当前时间
     nowDate() {
-      var date = new Date();
-      var seperator1 = "-";
-      var year = date.getFullYear();
-      var month = date.getMonth() + 1;
-      var strDate = date.getDate();
+      var date = new Date()
+      var seperator1 = '-'
+      var year = date.getFullYear()
+      var month = date.getMonth() + 1
+      var strDate = date.getDate()
       if (month >= 1 && month <= 9) {
-        month = "0" + month;
+        month = '0' + month
       }
       if (strDate >= 0 && strDate <= 9) {
-        strDate = "0" + strDate;
+        strDate = '0' + strDate
       }
-      var currentdate = year + seperator1 + month + seperator1 + strDate;
-      return currentdate;
+      var currentdate = year + seperator1 + month + seperator1 + strDate
+      return currentdate
     },
     // 格式化时间
     dateToDayFilter(date) {
       if (!date) {
-        return "";
+        return ''
       }
-      return date.slice(0, 10);
+      return date.slice(0, 10)
     },
     // 添加次数
-    async addPrint(funcType = "getDeliverDetail") {
-      let ids = [];
+    async addPrint(funcType = 'getDeliverDetail') {
+      let ids = []
       for (let i = this.clonelData.length; i > 0; i--) {
-        const tempData = this.clonelData[i - 1].invoicePickBeans;
+        const tempData = this.clonelData[i - 1].invoicePickBeans
         if (tempData.length) {
           for (let e = tempData.length; e > 0; e--) {
-            const newTempData = tempData[e - 1];
-            ids.push(newTempData.id);
+            const newTempData = tempData[e - 1]
+            ids.push(newTempData.id)
           }
         } else {
           return (
             this.clonelData[i - 1].invoiceOrderId || this.clonelData[i - 1].id
-          );
+          )
         }
       }
+      let requestParams = {}
       try {
-        let requestParams = {};
-        if (funcType === "getDtailPrintDis") {
-          ids = [...new Set(this.addIds)];
+        if (funcType === 'getDtailPrintDis') {
+          ids = [...new Set(this.addIds)]
           requestParams = {
-            ids: ids.join(","),
-          };
-          funcType = addPrint;
+            ids: ids.join(',')
+          }
+          funcType = addPrint
         } else {
           requestParams = {
-            ids: ids.join(","),
-          };
-          funcType = addPrints;
+            ids: ids.join(',')
+          }
+          funcType = addPrints
         }
-        await funcType(requestParams);
-        //清空当前克隆数据,避免重复添加次数
-        this.clonelData = [];
+
+        await funcType(requestParams)
+        // 清空当前克隆数据,避免重复添加次数
+        this.clonelData = []
       } catch (error) {
-        console.error("添加打印次数失败");
+        // console.error('添加打印次数失败')
+        this.clonelData = []
+        this.$errorMsg('添加打印次数失败' + JSON.stringify(requestParams))
       }
     },
     /**
@@ -252,19 +255,19 @@ export default {
           this.curPaper = {
             type: type,
             width: value.width,
-            height: value.height,
-          };
-          this.hiprintTemplate.setPaper(value.width, value.height);
+            height: value.height
+          }
+          this.hiprintTemplate.setPaper(value.width, value.height)
         } else {
           this.curPaper = {
-            type: "other",
+            type: 'other',
             width: value.width,
-            height: value.height,
-          };
-          this.hiprintTemplate.setPaper(value.width, value.height);
+            height: value.height
+          }
+          this.hiprintTemplate.setPaper(value.width, value.height)
         }
       } catch (error) {
-        this.$message.error(`操作失败: ${error}`);
+        this.$message.error(`操作失败: ${error}`)
       }
     },
     /**
@@ -273,59 +276,59 @@ export default {
      * @param {object} data
      * this.outputData 打印数据
      */
-    setPrintData(data,funcType,check) {
-      let salesOrderId, invoiceId; //出库单号,发货单号 默认数据中的第一个
-      salesOrderId = data.invoicePickBeans[0].salesOrderId;
-      invoiceId = data.invoicePickBeans[0].invoiceId;
-      let refUseUnit, refEnginRecordNo;
-      refUseUnit = data.refUseUnit || data.invoicePickBeans[0].refUseUnit || "";
+    setPrintData(data, funcType, check) {
+      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 remark;
-      remark = funcType==='getDtailPrintDis'?data.invoicePickBeans[0].remark || "" : data.remark||"";
-      console.log(data.invoicePickBeans[0],'oo');
-      let tuiHuoRen = data.createBy;
+        ''
+      let remark
+      remark = funcType === 'getDtailPrintDis' ? data.invoicePickBeans[0].remark || '' : data.remark || ''
+      console.log(data.invoicePickBeans[0], 'oo')
+      const tuiHuoRen = data.createBy
       // 数量合计
-      let total = 0;
+      let total = 0
       // 初始化打印次数
-      let printNum = 0;
-      //避免数据发生改变
-      this.clonelData.push(JSON.parse(JSON.stringify(data)));
+      let printNum = 0
+      // 避免数据发生改变
+      this.clonelData.push(JSON.parse(JSON.stringify(data)))
       // 需要计算长度和数据裁切
-      let invoicePickBeans = data.invoicePickBeans;
+      const invoicePickBeans = data.invoicePickBeans
       // 获取length向上取整
-      let len = Math.ceil(invoicePickBeans.length / 5);
+      const len = Math.ceil(invoicePickBeans.length / 5)
       for (let index = 0; index < len; index++) {
-        const table = [];
+        const table = []
         //  length <= 0 则不执行打印
         if (invoicePickBeans.length) {
           // 取第一个条数据printNum
-          printNum = invoicePickBeans[0].printNum;
-          const newInvoicePickBeans = invoicePickBeans.splice(0, 5);
+          printNum = invoicePickBeans[0].printNum
+          const newInvoicePickBeans = invoicePickBeans.splice(0, 5)
           for (let e = newInvoicePickBeans.length; e > 0; e--) {
-            const tempData = newInvoicePickBeans[e - 1];
-            total += Math.abs(+tempData.refundableQty);
+            const tempData = newInvoicePickBeans[e - 1]
+            total += Math.abs(+tempData.refundableQty)
 
-            //添加表格数据
+            // 添加表格数据
             table.push({
               id: tempData.id,
               createTime: tempData.id
                 ? this.dateToDayFilter(data.createTime)
-                : "",
+                : '',
               enginOrderType:
-                tempData.orderType == "HOME" ||
-                tempData.orderType == "TRADE" ||
-                tempData.orderType === "REQUISITION_TRADE" ||
-                tempData.orderType === "REQUISITION_HOME"
+                tempData.orderType == 'HOME' ||
+                tempData.orderType == 'TRADE' ||
+                tempData.orderType === 'REQUISITION_TRADE' ||
+                tempData.orderType === 'REQUISITION_HOME'
                   ? tempData.enginOrderNo
                   : tempData.mainOrderId,
               materialName: tempData.materialName,
               specification: tempData.specification,
               refundableQty: tempData.refundableQty,
-              pjxh1Text: tempData.pjxh1Text,
-            });
+              pjxh1Text: tempData.pjxh1Text
+            })
           }
         }
         // 添加print输出数据
@@ -338,7 +341,7 @@ export default {
           refEnginRecordNo: refEnginRecordNo,
           type: data.type,
           tiTui: data.type === 2 ? `退货人` : `提货人`,
-          takerPhone: data.takerPhone || "",
+          takerPhone: data.takerPhone || '',
           headerRemark: remark,
           total_num: data.total_num,
           total: total,
@@ -348,19 +351,19 @@ export default {
               : `${this.company}销售发货单`,
           pickOrderWater: data.pickOrderWater,
           customerNumber: data.customerNumber,
-          takerDa: "",
+          takerDa: '',
           nowDate: this.nowDate(),
           takerName:
             data.type === 2
-              ? `退货人:${check ==0 ?data.pickLogistics||'':tuiHuoRen || ""}`
-              : `提货人:${check ==0 ?data.pickLogistics||'':data.takerName || ""}`,
-          customerName: data.customerName || "",
+              ? `退货人:${check == 0 ? data.pickLogistics || '' : tuiHuoRen || ''}`
+              : `提货人:${check == 0 ? data.pickLogistics || '' : data.takerName || ''}`,
+          customerName: data.customerName || '',
           correspondName: data.correspondName,
-          correspondNames: "",
-          pickCar: data.pickCar || "",
-          createBy: JSON.parse(localStorage.getItem("supply_user")).nickName,
-          table,
-        });
+          correspondNames: '',
+          pickCar: data.pickCar || '',
+          createBy: JSON.parse(localStorage.getItem('supply_user')).nickName,
+          table
+        })
       }
     },
     /**
@@ -440,75 +443,75 @@ export default {
                 </div>
             </div>
          </div>
-        `;
+        `
     },
     /**
      * 备份方法
      * 获取需要打印数据详情
      * @param {Array} ids
      */
-    async getDateils(ids, funcType = "getDeliverDetail") {
-      this.$startLoading();
-      let loadingLen;
+    async getDateils(ids, funcType = 'getDeliverDetail') {
+      this.$startLoading()
+      let loadingLen
       // 兼容多个打印数据
-      ids = ids instanceof Array ? ids : [ids];
-      console.log(ids);
+      ids = ids instanceof Array ? ids : [ids]
+      console.log(ids)
       // 清空之前打印的数据
-      this.outputData = [];
+      this.outputData = []
       // 筛选id
-      let formatting = [];
+      let formatting = []
 
       // 仓库认证请求接口参数
-      let params = [];
+      const params = []
 
       // 获取数据id
       for (let i = ids.length; i > 0; i--) {
-        formatting.push(ids[i - 1].id || ids[i - 1]);
-        if (funcType === "getDtailPrintDis") {
+        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);
+            invoiceId: ids[i - 1].invoiceId
+          })
+          this.addIds.push(ids[i - 1].id)
         }
       }
 
-      if (funcType === "getDtailPrintDis") {
-        const requestParams = params;
+      if (funcType === 'getDtailPrintDis') {
+        const requestParams = params
         try {
-          const { data } = await getDtailPrintDis(requestParams);
-          loadingLen = data.length;
+          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--;
+            const newData = data[i - 1]
+            await this.setPrintData(newData)
+            loadingLen--
           }
         } catch (error) {
-          this.$endLoading();
-          console.error("获取打印数据失败");
+          this.$endLoading()
+          console.error('获取打印数据失败')
         }
       } else {
         // id 去重
-        formatting = [...new Set(formatting)];
-        loadingLen = formatting.length;
+        formatting = [...new Set(formatting)]
+        loadingLen = formatting.length
         for (let i = formatting.length; i > 0; i--) {
           const requestParams = {
-            id: formatting[i - 1],
-          };
+            id: formatting[i - 1]
+          }
           try {
-            const { data } = await getDeliverDetail(requestParams);
-            this.setPrintData(data);
+            const { data } = await getDeliverDetail(requestParams)
+            this.setPrintData(data)
           } catch (error) {
-            this.$endLoading();
-            this.$errorMsg(error);
-            console.error("获取打印数据失败");
+            this.$endLoading()
+            this.$errorMsg(error)
+            console.error('获取打印数据失败')
           }
-          loadingLen--;
+          loadingLen--
         }
       }
       if (loadingLen == 0) {
-        return Promise.resolve();
+        return Promise.resolve()
       }
-    },
-  },
-};
+    }
+  }
+}

+ 25 - 8
src/views/supply/apply/engin_list.vue

@@ -158,12 +158,13 @@
             element-loading-text="Loading"
             border
             fit
+
             :row-style="rowClass"
             show-summary
             :summary-method="$getSummaries"
             @selection-change="handleSelectionChange"
           >
-            <el-table-column align="center" type="selection" width="55" fixed="left" />
+            <el-table-column align="center" type="selection" width="55" fixed="left" :selectable="selectable" />
             <el-table-column align="left" label="订单类型" prop="type" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{ scope.row.type | orderTypeFilter }}
@@ -281,7 +282,7 @@
             <el-table-column align="center" label="操作" width="180" fixed="right">
               <template slot-scope="scope">
                 <el-popconfirm
-                  v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'"
+                  v-if=" !scope.row.automaticStatus && $checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'"
                   style="margin-right: 10px;"
                   title="确定申请吗?"
                   @onConfirm="handleSubmit(scope.row.id, 'WAIT')"
@@ -289,7 +290,7 @@
                   <el-button slot="reference" type="text">申请</el-button>
                 </el-popconfirm>
                 <el-popconfirm
-                  v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'WAIT'"
+                  v-if="!scope.row.automaticStatus &&$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'WAIT'"
                   style="margin-right: 10px;"
                   title="确定撤回吗?"
                   @onConfirm="handleSubmit(scope.row.id, 'SAVE')"
@@ -297,7 +298,7 @@
                   <el-button slot="reference" type="text">撤回</el-button>
                 </el-popconfirm>
                 <el-popconfirm
-                  v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'"
+                  v-if="!scope.row.automaticStatus &&$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'"
                   style="margin-right: 10px;"
                   title="确定弃审吗?"
                   @onConfirm="handleAbandon(scope.row.id)"
@@ -305,21 +306,21 @@
                   <el-button slot="reference" type="text">弃审</el-button>
                 </el-popconfirm>
                 <el-button
-                  v-if="$checkBtnRole('edit', $route.meta.roles) && (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'FAIL') && scope.row.type === 1"
+                  v-if="!scope.row.automaticStatus &&$checkBtnRole('edit', $route.meta.roles) && (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'FAIL') && scope.row.type === 1"
                   type="text"
                   @click="toForm(scope.row)"
                 >
                   编辑
                 </el-button>
                 <el-button
-                  v-if="$checkBtnRole('edit', $route.meta.roles) && (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'FAIL') && scope.row.type === 2"
+                  v-if="!scope.row.automaticStatus &&$checkBtnRole('edit', $route.meta.roles) && (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'FAIL') && scope.row.type === 2"
                   type="text"
                   @click="toReturnForm(scope.row)"
                 >
                   编辑
                 </el-button>
                 <el-button
-                  v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'"
+                  v-if="!scope.row.automaticStatus &&$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'"
                   type="text"
                   @click="toExamine(scope.row)"
                 >
@@ -332,7 +333,7 @@
                   详情
                 </el-button>
                 <el-popconfirm
-                  v-if="scope.row.examineStatus !== 'OK'"
+                  v-if="!scope.row.automaticStatus &&scope.row.examineStatus !== 'OK'"
                   style="margin-left: 10px;"
                   title="确定删除吗?"
                   @onConfirm="handleDelete(scope.row.id)"
@@ -696,6 +697,22 @@ export default {
       }).then(res => {
         this.categoryList = res.data.records
       })
+    },
+    /**
+     * 根据条件禁用行复选框
+     * 函数返回值为false则禁用选择(反之亦然)
+     * @param {Object} row - 行数据
+     * @param {String} index - 索引值
+     * @return Boolean
+     */
+    selectable: function(row, index) {
+      if (row.automaticStatus) {
+        return false
+      }
+      return true
+      // 函数必须有返回值且是布尔值
+      // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
+      // 如果没有返回值则默认返回false(全部无法选中)
     }
   }
 }

+ 38 - 37
src/views/supply/deliver/components/design/preview.vue

@@ -3,13 +3,13 @@
     class="sub-main"
     :visible.sync="visible"
     :show-close="false"
-    :maskClosable="false"
+    :mask-closable="false"
     :close-on-click-modal="false"
-    @cancel="hideModal"
     :width="350 + 'mm'"
+    @cancel="hideModal"
   >
     <div v-loading="spinning" style="min-height: 100px">
-      <div id="preview_content" ref="printDom"></div>
+      <div id="preview_content" ref="printDom" />
     </div>
     <template slot="title">
       <div>
@@ -19,8 +19,7 @@
           type="primary"
           icon="printer"
           @click.stop="print"
-          >打印</el-button
-        >
+        >打印</el-button>
         <!-- <el-button type="primary" icon="printer" @click.stop="toPdf">pdf</el-button> -->
       </div>
     </template>
@@ -32,10 +31,10 @@
 
 <script>
 // import { downloadPDF } from '@/utils/pdf'
-import { addPrint } from "./print-data";
-import { detailArr } from "./print-data";
+import { addPrint } from './print-data'
+import { detailArr } from './print-data'
 export default {
-  name: "printPreview",
+  name: 'PrintPreview',
   props: {},
   data() {
     return {
@@ -48,8 +47,8 @@ export default {
       hiprintTemplate: {},
       // 数据
       printData: {},
-      loading:true
-    };
+      loading: true
+    }
   },
   computed: {},
   watch: {},
@@ -60,50 +59,53 @@ export default {
     //   downloadPDF(this.$refs.printDom);
     // },
     hideModal() {
-      this.visible = false;
-      this.waitShowPrinter = false;
-      this.$parent.initPrint();
+      this.visible = false
+      this.waitShowPrinter = false
+      this.$parent.initPrint()
       // console.log(this.$parent);
     },
-    show(hiprintTemplate, printData, width = "210") {
-      this.visible = true;
-      this.width = width;
-      this.hiprintTemplate = hiprintTemplate;
-      this.printData = printData;
+    show(hiprintTemplate, printData, width = '210') {
+      this.visible = true
+      this.width = width
+      this.hiprintTemplate = hiprintTemplate
+      this.printData = printData
 
       setTimeout(() => {
         // eslint-disable-next-line no-undef
-        $("#preview_content").html(hiprintTemplate.getHtml(printData));
-        this.spinning = false;
-      }, 500);
+        $('#preview_content').html(hiprintTemplate.getHtml(printData))
+        this.spinning = false
+      }, 500)
     },
     print() {
       this.hiprintTemplate.print(
         this.printData,
         {},
         {
-          callback: () => {
-            this.$parent.addPrint('addPrints');
-            this.hiprintTemplate = {};
-            this.$parent.tableSelection = [];
+          callback: async() => {
+            try {
+              await this.$parent.addPrint('addPrints')
+            } catch (e) {
+              console.log('调用打印次数接口失败')
+            }
+            this.hiprintTemplate = {}
+            this.$parent.tableSelection = []
+            await this.$parent.getList()
             setTimeout(() => {
-              this.$parent.getList();
-              console.error("更新发货汇总列表");
-            }, 1000);
-
-          },
+              console.error('更新发货汇总列表')
+            }, 1000)
+          }
         }
-      );
+      )
       setTimeout(() => {
-        this.hideModal();
-      }, 2000);
-    },
+        this.hideModal()
+      }, 2000)
+    }
     // toPdf() {
     //   downloadPDF(this.$refs.printDom);
     //   this.hiprintTemplate.toPdf({}, '打印预览');
     // },
-  },
-};
+  }
+}
 </script>
 
 <style scoped>
@@ -124,7 +126,6 @@ export default {
  -webkit-box-orient: vertical;
 }
 
-
 ::v-deep .hiprint-printPaper {
   margin: 0 auto;
 }

+ 3 - 4
src/views/supply/deliver/components/sum_print.vue

@@ -60,7 +60,8 @@ export default {
       printObj: {
         id: 'printMe',
         closeCallback: () => {
-          this.addPrint()
+          console.log('添加打印次数')
+          // this.addPrint()
         }
       },
       detailData: {},
@@ -91,7 +92,6 @@ export default {
     getDetail(id) {
       getDeliverDetail({ id: id }).then(res => {
         this.detailArr.push(res.data)
-
       })
     },
 
@@ -106,13 +106,12 @@ export default {
       const ids = this.detailArr.map(item => {
         if (item.invoicePickBeans && item.invoicePickBeans.length) {
           for (let index = 0; index < item.invoicePickBeans.length; index++) {
-            const element = item.invoicePickBeans[index];
+            const element = item.invoicePickBeans[index]
             return item.invoiceOrderId || element.invoiceOrderId || element.id
           }
         } else {
           return item.invoiceOrderId || item.id
         }
-
       })
 
       // console.log(document.execCommand('print'),'4545');

+ 199 - 190
src/views/supply/engin/components/commerce_detail.vue

@@ -3,7 +3,7 @@
 
     <div v-show="!isShowCheckOrder">
 
-      <el-page-header @back="goBack" content="详情"></el-page-header>
+      <el-page-header content="详情" @back="goBack" />
 
       <div id="printData">
         <div class="main-title">
@@ -14,139 +14,149 @@
           <el-row>
             <el-col :span="8" class="item">
               <div class="label">工程订单号</div>
-              <div class="value">{{detailData.enginOrderNo}}</div>
+              <div class="value">{{ detailData.enginOrderNo }}</div>
             </el-col>
             <el-col :span="8" class="item">
               <div class="label">订单日期</div>
-              <div class="value">{{detailData.orderDate}}</div>
+              <div class="value">{{ detailData.orderDate }}</div>
             </el-col>
             <el-col :span="8" class="item">
               <div class="label">单据状态</div>
-              <div class="value">{{detailData.examineStatus | statusFilter}}</div>
+              <div class="value">{{ detailData.examineStatus | statusFilter }}</div>
             </el-col>
             <el-col :span="8" class="item">
               <div class="label">经销商编码</div>
-              <div class="value">{{detailData.customerNumber}}</div>
+              <div class="value">{{ detailData.customerNumber }}</div>
             </el-col>
             <el-col :span="8" class="item">
               <div class="label">经销商名称</div>
-              <div class="value">{{detailData.customerName}}</div>
+              <div class="value">{{ detailData.customerName }}</div>
             </el-col>
             <el-col :span="8" class="item">
               <div class="label">机型类别</div>
-              <div class="value">{{detailData.refMachineType}}</div>
+              <div class="value">{{ detailData.refMachineType }}</div>
             </el-col>
             <el-col :span="8" class="item">
               <div class="label">工程登录编号</div>
-              <div class="value">{{detailData.refEnginRecordNo}}</div>
+              <div class="value">{{ detailData.refEnginRecordNo }}</div>
             </el-col>
             <el-col :span="8" class="item">
               <div class="label">项目名称</div>
-              <div class="value">{{detailData.refProjectName}}</div>
+              <div class="value">{{ detailData.refProjectName }}</div>
             </el-col>
             <el-col :span="8" class="item">
               <div class="label">行业类别</div>
-              <div class="value">{{detailData.refTradeCategory}}</div>
+              <div class="value">{{ detailData.refTradeCategory }}</div>
             </el-col>
-             <el-col :span="8" class="item">
+            <el-col :span="8" class="item">
               <div class="label">工程编号</div>
-              <div class="value">{{detailData.refProjectNo}}</div>
+              <div class="value">{{ detailData.refProjectNo }}</div>
             </el-col>
             <el-col :span="8" class="item">
               <div class="label">跨区厂编号</div>
-              <div class="value">{{detailData.refFactoryNo}}</div>
+              <div class="value">{{ detailData.refFactoryNo }}</div>
             </el-col>
             <el-col :span="8" class="item">
               <div class="label">使用单位</div>
-              <div class="value">{{detailData.refUseUnit}}</div>
+              <div class="value">{{ detailData.refUseUnit }}</div>
             </el-col>
-<!--            <el-col :span="8" class="item">-->
-<!--              <div class="label">销售类型</div>-->
-<!--              <div class="value">{{detailData.saleTypeName}}</div>-->
-<!--            </el-col>-->
+            <!--            <el-col :span="8" class="item">-->
+            <!--              <div class="label">销售类型</div>-->
+            <!--              <div class="value">{{detailData.saleTypeName}}</div>-->
+            <!--            </el-col>-->
             <el-col :span="8" class="item">
               <div class="label">联系人</div>
-              <div class="value">{{detailData.refLinkman}}</div>
+              <div class="value">{{ detailData.refLinkman }}</div>
             </el-col>
             <el-col :span="8" class="item">
               <div class="label">固定电话</div>
-              <div class="value">{{detailData.refTel}}</div>
+              <div class="value">{{ detailData.refTel }}</div>
             </el-col>
             <el-col :span="8" class="item">
               <div class="label">移动电话</div>
-              <div class="value">{{detailData.refPhone}}</div>
+              <div class="value">{{ detailData.refPhone }}</div>
             </el-col>
             <el-col v-if="!isDealer" :span="8" class="item">
               <div class="label">权限分类</div>
-              <div class="value">{{detailData.refPowerCategory}}</div>
+              <div class="value">{{ detailData.refPowerCategory }}</div>
             </el-col>
             <el-col :span="8" class="item">
               <div class="label">工程登录类型</div>
-              <div class="value">{{detailData.refPromiseStatus}}</div>
+              <div class="value">{{ detailData.refPromiseStatus }}</div>
             </el-col>
             <el-col :span="24" class="item">
               <div class="label">安装地址</div>
-              <div class="value">{{detailData.refInstallAddress}}</div>
+              <div class="value">{{ detailData.refInstallAddress }}</div>
             </el-col>
             <el-col :span="8" class="item">
               <div class="label">不扣押金</div>
-              <div class="value">{{detailData.takeDeposit ? '是':'否'}}</div>
+              <div class="value">{{ detailData.takeDeposit ? '是':'否' }}</div>
             </el-col>
             <el-col :span="8" class="item">
               <div class="label">文件编号</div>
-              <div class="value">{{detailData.fileNo}}</div>
+              <div class="value">{{ detailData.fileNo }}</div>
             </el-col>
             <el-col :span="8" class="item">
               <div class="label">业务员</div>
-              <div class="value">{{detailData.serviceName}}</div>
+              <div class="value">{{ detailData.serviceName }}</div>
             </el-col>
             <el-col :span="24" class="item">
               <div class="label">格力回复</div>
-              <div class="value">{{detailData.geLiNote}}</div>
+              <div class="value">{{ detailData.geLiNote }}</div>
             </el-col>
             <el-col v-if="!isDealer" :span="24" class="item">
               <div class="label">格力内部备注</div>
-              <div class="value">{{detailData.geLiInerNote}}</div>
+              <div class="value">{{ detailData.geLiInerNote }}</div>
             </el-col>
             <el-col :span="24" class="item">
               <div class="label">备注</div>
-              <div class="value">{{detailData.remark}}</div>
+              <div class="value">{{ detailData.remark }}</div>
             </el-col>
             <el-col :span="6" class="item">
               <div class="label">制单人</div>
-              <div class="value">{{detailData.createName}}</div>
+              <div class="value">{{ detailData.createName }}</div>
             </el-col>
             <el-col :span="6" class="item">
               <div class="label">制单日期</div>
-              <div class="value">{{detailData.createTime}}</div>
+              <div class="value">{{ detailData.createTime }}</div>
             </el-col>
             <el-col :span="6" class="item">
               <div class="label">审核人</div>
-              <div class="value">{{detailData.confirmName}}</div>
+              <div class="value">{{ detailData.confirmName }}</div>
             </el-col>
             <el-col :span="6" class="item">
               <div class="label">审核日期</div>
-              <div class="value">{{detailData.confirmTime}}</div>
+              <div class="value">{{ detailData.confirmTime }}</div>
             </el-col>
             <el-col :span="6" class="item">
               <div class="label">最后更新人</div>
-              <div class="value">{{detailData.updateName}}</div>
+              <div class="value">{{ detailData.updateName }}</div>
             </el-col>
             <el-col :span="6" class="item">
               <div class="label">最后更新日期</div>
-              <div class="value">{{detailData.updateTime}}</div>
+              <div class="value">{{ detailData.updateTime }}</div>
             </el-col>
             <el-col :span="6" class="item">
               <div class="label">关闭人</div>
-              <div class="value">{{detailData.closeName}}</div>
+              <div class="value">{{ detailData.closeName }}</div>
             </el-col>
             <el-col :span="6" class="item">
               <div class="label">关闭日期</div>
-              <div class="value">{{detailData.closeTime}}</div>
+              <div class="value">{{ detailData.closeTime }}</div>
             </el-col>
+
             <el-col :span="24" class="item">
               <div class="label">审批说明</div>
-              <div class="value">{{detailData.examineNote}}</div>
+              <div class="value">{{ detailData.examineNote }}</div>
+            </el-col>
+            <el-col :span="24" class="item">
+              <div class="label">计划单</div>
+              <div class="value">
+                <el-checkbox v-model="detailData.isPlanOrder" disabled true-label="true" false-label="false">
+                  {{ detailData.isPlanOrder=='true'?'是':'否' }}
+                </el-checkbox>
+
+              </div>
             </el-col>
           </el-row>
         </div>
@@ -165,27 +175,28 @@
             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="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="unit" min-width="100" show-overflow-tooltip></el-table-column>
+            :summary-method="$getSummaries"
+          >
+            <el-table-column align="center" label="序号" type="index" width="50" />
+            <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip />
+            <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip />
+            <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip />
+            <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip />
+            <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
             <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="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="enginNum" min-width="100" show-overflow-tooltip />
+            <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip />
             <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="left" label="返利类型" prop="customerWalletName2" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="left" label="返利类型" prop="customerWalletName2" min-width="100" show-overflow-tooltip />
             <el-table-column align="right" label="实付返利金额" prop="payRebateAmount" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{ scope.row.payRebateAmount | numToFixed }}
@@ -196,7 +207,7 @@
                 {{ 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="left" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip />
             <el-table-column align="right" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{ scope.row.payAmount | numToFixed }}
@@ -207,11 +218,11 @@
                 {{ scope.row.isDirectTransfer ? '是' : '否' }}
               </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="left" label="备注" prop="remark" min-width="160" 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="serviceName" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="right" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip />
+            <el-table-column align="right" label="原订单数量" prop="oldQty" min-width="100" show-overflow-tooltip />
+            <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="税率" prop="tax" min-width="100" show-overflow-tooltip />
+            <el-table-column align="left" label="业务员" prop="serviceName" min-width="100" show-overflow-tooltip />
           </el-table>
         </div>
 
@@ -220,10 +231,10 @@
       <div class="page-footer">
         <div class="footer">
           <el-button type="success" @click="toCheckOrder">联查单据</el-button>
-          <el-button type="danger" @click="closeData" v-if="detailData.examineStatus === 'SAVE' || detailData.examineStatus === 'WAIT'">关闭订单</el-button>
+          <el-button v-if="detailData.examineStatus === 'SAVE' || detailData.examineStatus === 'WAIT'" type="danger" @click="closeData">关闭订单</el-button>
           <!-- <el-button type="primary" @click="openDirectDialog" v-if="!isDealer">提前开票</el-button> -->
-          <el-button type="primary" @click="overData" v-if="!isDealer">直调完结</el-button>
-          <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.directTransferStatus" v-if="!isDealer">直调发货</el-button>
+          <el-button v-if="!isDealer" type="primary" @click="overData">直调完结</el-button>
+          <el-button v-if="!isDealer" type="primary" :disabled="detailData.directTransferStatus" @click="openDeliverDialog">直调发货</el-button>
           <el-button @click="goBack">返回列表</el-button>
         </div>
       </div>
@@ -239,20 +250,20 @@
                 type="date"
                 value-format="yyyy-MM-dd"
                 style="width: 100%;"
-                placeholder="选择日期">
-              </el-date-picker>
+                placeholder="选择日期"
+              />
             </el-form-item>
           </el-col>
           <el-col :xs="8" :sm="8" :lg="8">
             <el-form-item label="选择仓位" prop="position">
               <el-select v-model="deliverForm.position" placeholder="请选择仓位" style="width: 100%" filterable>
-                <el-option v-for="item in positionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+                <el-option v-for="item in positionList" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :xs="8" :sm="8" :lg="8">
             <el-form-item label="发货申请备注" prop="remark">
-              <el-input v-model="deliverForm.remark" placeholder="请输入发货申请备注"  clearable ></el-input>
+              <el-input v-model="deliverForm.remark" placeholder="请输入发货申请备注" clearable />
             </el-form-item>
           </el-col>
         </el-row>
@@ -260,17 +271,17 @@
 
       <div class="table" style="margin-top: 20px">
         <el-table :data="deliverGoodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
-          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-          <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="物料编码" prop="materialNumber" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" 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="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="序号" type="index" width="50" />
+          <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip />
+          <el-table-column align="center" label="物料编码" prop="materialNumber" min-width="160" show-overflow-tooltip />
+          <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip />
+          <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip />
+          <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
+          <el-table-column align="right" label="订单数量" prop="qty" min-width="100" show-overflow-tooltip />
+          <el-table-column align="right" label="发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip />
           <el-table-column align="right" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip>
             <template slot-scope="scope">
-              <el-input v-model="scope.row.realDirectTransferQty" size="small" type="number" @mousewheel.native.prevent></el-input>
+              <el-input v-model="scope.row.realDirectTransferQty" size="small" type="number" @mousewheel.native.prevent />
             </template>
           </el-table-column>
           <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
@@ -288,7 +299,7 @@
               {{ scope.row.payRebateAmount | numToFixed }}
             </template>
           </el-table-column>
-          <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
         </el-table>
       </div>
       <span slot="footer" class="dialog-footer">
@@ -297,35 +308,34 @@
       </span>
     </el-dialog>
 
-
     <el-dialog title="直接调拨单(提前开票)" :visible.sync="isShowDirectDialog" width="80%">
       <el-form ref="directForm" :model="directForm" :rules="directFormRules" label-width="80px" size="small" label-position="left">
         <el-row :gutter="20">
           <el-col :xs="12" :sm="6" :lg="6">
             <el-form-item label="调出仓库" prop="warehouse1">
               <el-select v-model="directForm.warehouse1" placeholder="请选择调出仓库" style="width: 100%" filterable @change="changeWarehouse1">
-                <el-option v-for="item in warehouseList1" :key="item.id" :label="item.name" :value="item.id"></el-option>
+                <el-option v-for="item in warehouseList1" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :xs="12" :sm="6" :lg="6">
             <el-form-item label="调出仓位" prop="position1">
               <el-select v-model="directForm.position1" placeholder="请调出仓位" style="width: 100%" filterable @change="changePosition1">
-                <el-option v-for="item in positionList1" :key="item.id" :label="item.name" :value="item.id"></el-option>
+                <el-option v-for="item in positionList1" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :xs="12" :sm="6" :lg="6">
             <el-form-item label="调入仓库" prop="warehouse2">
               <el-select v-model="directForm.warehouse2" placeholder="请选择调入仓库" style="width: 100%" filterable @change="changeWarehouse2">
-                <el-option v-for="item in warehouseList2" :key="item.id" :label="item.name" :value="item.id"></el-option>
+                <el-option v-for="item in warehouseList2" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
           </el-col>
           <el-col :xs="12" :sm="6" :lg="6">
             <el-form-item label="调入仓位" prop="position2">
               <el-select v-model="directForm.position2" placeholder="请调入仓位" style="width: 100%" filterable @change="changePosition2">
-                <el-option v-for="item in positionList2" :key="item.id" :label="item.name" :value="item.id"></el-option>
+                <el-option v-for="item in positionList2" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -334,27 +344,27 @@
 
       <div class="table" style="margin-top: 20px">
         <el-table :data="directGoodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
-          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-          <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品编码" prop="materialNumber" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="调出仓库" prop="warehouse1" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="调出仓位" prop="position1" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="调入仓库" prop="warehouse2" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="调入仓位" prop="position2" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="调出库存状态" prop="status1" min-width="110" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="调入库存状态" prop="status2" min-width="110" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="序号" type="index" width="50" />
+          <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip />
+          <el-table-column align="center" label="产品编码" prop="materialNumber" min-width="160" show-overflow-tooltip />
+          <el-table-column align="center" label="物料代码" prop="materialOldNumber" min-width="160" show-overflow-tooltip />
+          <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip />
+          <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip />
+          <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
+          <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip />
+          <el-table-column align="center" label="调出仓库" prop="warehouse1" min-width="100" show-overflow-tooltip />
+          <el-table-column align="center" label="调出仓位" prop="position1" min-width="100" show-overflow-tooltip />
+          <el-table-column align="center" label="调入仓库" prop="warehouse2" min-width="100" show-overflow-tooltip />
+          <el-table-column align="center" label="调入仓位" prop="position2" min-width="100" show-overflow-tooltip />
+          <el-table-column align="center" label="调出库存状态" prop="status1" min-width="110" show-overflow-tooltip />
+          <el-table-column align="center" label="调入库存状态" prop="status2" min-width="110" show-overflow-tooltip />
           <el-table-column align="center" label="调出货主" min-width="100" show-overflow-tooltip>
             <template slot-scope="">弘格</template>
           </el-table-column>
           <el-table-column align="center" label="调入货主" min-width="100" show-overflow-tooltip>
             <template slot-="scope">弘格</template>
           </el-table-column>
-          <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
         </el-table>
       </div>
       <span slot="footer" class="dialog-footer">
@@ -363,35 +373,35 @@
       </span>
     </el-dialog>
 
-    <CheckOrder :checkOrderId="checkOrderId" v-if="isShowCheckOrder" @backDetail="backDetail" />
+    <CheckOrder v-if="isShowCheckOrder" :check-order-id="checkOrderId" @backDetail="backDetail" />
 
   </div>
 </template>
 
 <script>
-import { getOrderDetail, closeCom, overOrder, getWarehouseList, deliverOrder, directOrder, getPositionList } from "@/api/supply/engin";
-import CheckOrder from "@/components/Common/check-order";
+import { getOrderDetail, closeCom, overOrder, getWarehouseList, deliverOrder, directOrder, getPositionList } from '@/api/supply/engin'
+import CheckOrder from '@/components/Common/check-order'
 
 export default {
   name: 'CommerceDetail',
   componentName: 'CommerceDetail',
   components: {
-    CheckOrder,
+    CheckOrder
   },
-  props: ['listItem'],
   filters: {
     statusFilter(val) {
       const statusList = [
         { label: '已保存', value: 'SAVE' },
         { label: '待审核', value: 'WAIT' },
         { label: '审核通过', value: 'OK' },
-         // { label: '审核驳回', value: 'FAIL' },,
-        { label: '已关闭', value: 'CLOSE' },
-      ];
-      let obj = statusList.find(o => o.value == val);
+        // { label: '审核驳回', value: 'FAIL' },,
+        { label: '已关闭', value: 'CLOSE' }
+      ]
+      const obj = statusList.find(o => o.value == val)
       return obj ? obj.label : ''
     }
   },
+  props: ['listItem'],
   data() {
     return {
       detailData: {},
@@ -400,7 +410,7 @@ export default {
       deliverForm: {
         date: '',
         position: '',
-        remark:''
+        remark: ''
       },
       deliverFormRules: {
         date: [
@@ -408,7 +418,7 @@ export default {
         ],
         position: [
           { required: true, message: '请选择仓位', trigger: 'change' }
-        ],
+        ]
       },
       positionList: [],
       deliverGoodsList: [],
@@ -418,7 +428,7 @@ export default {
         warehouse1: '',
         position1: '',
         warehouse2: '',
-        position2: '',
+        position2: ''
       },
       directFormRules: {
         warehouse1: [
@@ -432,7 +442,7 @@ export default {
         ],
         position2: [
           { required: true, message: '请选择调入仓位', trigger: 'change' }
-        ],
+        ]
       },
       warehouseList1: [],
       warehouseList2: [],
@@ -441,7 +451,7 @@ export default {
       directGoodsList: [],
 
       checkOrderId: {},
-      isShowCheckOrder: false,
+      isShowCheckOrder: false
     }
   },
 
@@ -450,28 +460,28 @@ export default {
       return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
     },
     isDealer() {
-      return JSON.parse(localStorage.getItem("supply_user")).isCustomer
-    },
+      return JSON.parse(localStorage.getItem('supply_user')).isCustomer
+    }
   },
 
   created() {
-    this.getDetail();
+    this.getDetail()
   },
 
   methods: {
     // 返回列表
     goBack() {
-      this.$emit('backListFormDetail');
+      this.$emit('backListFormDetail')
     },
 
     // 获取仓库列表
     getWarehouseList() {
       getWarehouseList({
         pageNum: 1,
-        pageSize: -1,
+        pageSize: -1
       }).then(res => {
-        this.warehouseList1 = res.data.records;
-        this.warehouseList2 = res.data.records;
+        this.warehouseList1 = res.data.records
+        this.warehouseList2 = res.data.records
       })
     },
 
@@ -482,21 +492,21 @@ export default {
         pageSize: -1,
         type: 2
       }).then(res => {
-        this.positionList = res.data.records;
+        this.positionList = res.data.records
       })
     },
 
     // 获取详情
     getDetail() {
-      getOrderDetail({id: this.listItem.parentId}).then(res => {
-        if(res.data.items) {
+      getOrderDetail({ id: this.listItem.parentId }).then(res => {
+        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.sums2 = ['totalAmount', 'payAmount', 'price', 'payRebateAmount', 'discAmount'];
+            item.number = (item.qty * 100 - item.retiredQty * 100) / 100
+            item.sums1 = ['number', 'directTransferQty', 'qty', 'enginNum', 'oldQty']
+            item.sums2 = ['totalAmount', 'payAmount', 'price', 'payRebateAmount', 'discAmount']
           })
         }
-        this.detailData = res.data;
+        this.detailData = res.data
       })
     },
 
@@ -507,12 +517,12 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        closeCom({id: this.listItem.parentId, refEnginRecordNo: this.detailData.refEnginRecordNo || '',
-}).then(res => {
-          this.$successMsg();
-          this.getDetail();
+        closeCom({ id: this.listItem.parentId, refEnginRecordNo: this.detailData.refEnginRecordNo || ''
+        }).then(res => {
+          this.$successMsg()
+          this.getDetail()
         })
-      }).catch(() => {});
+      }).catch(() => {})
     },
 
     // 直调完结
@@ -522,65 +532,64 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        overOrder({id: this.listItem.parentId, refEnginRecordNo: this.detailData.refEnginRecordNo || '',}).then(res => {
-          this.$successMsg();
-          this.getDetail();
+        overOrder({ id: this.listItem.parentId, refEnginRecordNo: this.detailData.refEnginRecordNo || '' }).then(res => {
+          this.$successMsg()
+          this.getDetail()
         })
-      }).catch(() => {});
+      }).catch(() => {})
     },
 
     // 更改仓库
     changeWarehouse() {
-      this.deliverForm.position = '';
-      let obj = this.warehouseList.find(o => o.id == this.deliverForm.warehouse);
-      this.positionList = obj.kingDeeStocks;
+      this.deliverForm.position = ''
+      const obj = this.warehouseList.find(o => o.id == this.deliverForm.warehouse)
+      this.positionList = obj.kingDeeStocks
     },
 
     // 打开 直调发货
     openDeliverDialog() {
-      this.isShowDeliverDialog = true;
-      this.deliverGoodsList = this.detailData.items;
+      this.isShowDeliverDialog = true
+      this.deliverGoodsList = this.detailData.items
       this.deliverGoodsList.forEach(item => {
-        item.warehouse1 = '';
-        item.warehouse2 = '';
-        item.position1 = '';
-        item.position2 = '';
-        item.status1 = '';
-        item.status2 = '';
-        this.$set(item,'realDirectTransferQty',item.refundableQty)
-
+        item.warehouse1 = ''
+        item.warehouse2 = ''
+        item.position1 = ''
+        item.position2 = ''
+        item.status1 = ''
+        item.status2 = ''
+        this.$set(item, 'realDirectTransferQty', item.refundableQty)
       })
-      this.getPositionList();
+      this.getPositionList()
     },
 
     // 关闭 直调发货
     closeDeliverDialog() {
-      this.isShowDeliverDialog = false;
+      this.isShowDeliverDialog = false
     },
 
     // 提交 直调发货
     submitDeliverForm() {
       this.$refs.deliverForm.validate((valid) => {
         if (valid) {
-          for(let i=0; i<this.deliverGoodsList.length; i++) {
-            if(!this.deliverGoodsList[i].directTransferQty && this.deliverGoodsList[i].directTransferQty !== 0) {
-              this.$errorMsg('请输入直调数量');
-              return;
+          for (let i = 0; i < this.deliverGoodsList.length; i++) {
+            if (!this.deliverGoodsList[i].directTransferQty && this.deliverGoodsList[i].directTransferQty !== 0) {
+              this.$errorMsg('请输入直调数量')
+              return
             }
           }
-          let params = {
+          const params = {
             enginOrderId: this.detailData.enginOrderId,
             enginOrderType: 'TRADE', // TRADE=商用 HOME=家用
             deliverDate: this.deliverForm.date + ' 00:00:00',
             correspondId: this.deliverForm.position,
-            remark:this.deliverForm.remark,
+            remark: this.deliverForm.remark,
             items: this.deliverGoodsList,
-            refEnginRecordNo: this.detailData.refEnginRecordNo || '',
+            refEnginRecordNo: this.detailData.refEnginRecordNo || ''
           }
           deliverOrder(params).then(res => {
-            this.$successMsg();
-            this.isShowDeliverDialog = false;
-            this.getDetail();
+            this.$successMsg()
+            this.isShowDeliverDialog = false
+            this.getDetail()
           })
         }
       })
@@ -588,63 +597,63 @@ export default {
 
     // 更改调出仓库
     changeWarehouse1() {
-      this.directForm.position1 = '';
-      let obj = this.warehouseList1.find(o => o.id == this.directForm.warehouse1);
-      this.positionList1 = obj.kingDeeStocks;
+      this.directForm.position1 = ''
+      const obj = this.warehouseList1.find(o => o.id == this.directForm.warehouse1)
+      this.positionList1 = obj.kingDeeStocks
       this.directGoodsList.forEach(item => {
-        item.warehouse1 = obj.name;
-      });
+        item.warehouse1 = obj.name
+      })
     },
 
     // 更改调入仓库
     changeWarehouse2() {
-      this.directForm.position2 = '';
-      let obj = this.warehouseList2.find(o => o.id == this.directForm.warehouse2);
-      this.positionList2 = obj.kingDeeStocks;
+      this.directForm.position2 = ''
+      const obj = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
+      this.positionList2 = obj.kingDeeStocks
       this.directGoodsList.forEach(item => {
-        item.warehouse2 = obj.name;
-      });
+        item.warehouse2 = obj.name
+      })
     },
 
     // 更改调出仓位
     changePosition1() {
-      let obj = this.positionList1.find(o => o.id == this.directForm.position1);
+      const obj = this.positionList1.find(o => o.id == this.directForm.position1)
       this.directGoodsList.forEach(item => {
-        item.position1 = obj.name;
-        item.status1 = obj.defStockStatusName;
-      });
+        item.position1 = obj.name
+        item.status1 = obj.defStockStatusName
+      })
     },
 
     // 更改调入仓位
     changePosition2() {
-      let obj = this.positionList2.find(o => o.id == this.directForm.position2);
+      const obj = this.positionList2.find(o => o.id == this.directForm.position2)
       this.directGoodsList.forEach(item => {
-        item.position2 = obj.name;
-        item.status2 = obj.defStockStatusName;
-      });
+        item.position2 = obj.name
+        item.status2 = obj.defStockStatusName
+      })
     },
 
     // 打开 提前开票
     openDirectDialog() {
-      this.isShowDirectDialog = true;
-      this.directGoodsList = this.detailData.items;
-      this.getWarehouseList();
+      this.isShowDirectDialog = true
+      this.directGoodsList = this.detailData.items
+      this.getWarehouseList()
     },
 
     // 关闭 提前开票
     closeDirectDialog() {
-      this.isShowDirectDialog = false;
+      this.isShowDirectDialog = false
     },
 
     // 提交 提前开票
     submitDirectForm() {
       this.$refs.directForm.validate((valid) => {
         if (valid) {
-          let warehouseItem1 = this.warehouseList1.find(o => o.id == this.directForm.warehouse1);
-          let positionItem1 = this.positionList1.find(o => o.id == this.directForm.position1);
-          let warehouseItem2 = this.warehouseList2.find(o => o.id == this.directForm.warehouse2);
-          let positionItem2 = this.positionList2.find(o => o.id == this.directForm.position2);
-          let params = {
+          const warehouseItem1 = this.warehouseList1.find(o => o.id == this.directForm.warehouse1)
+          const positionItem1 = this.positionList1.find(o => o.id == this.directForm.position1)
+          const warehouseItem2 = this.warehouseList2.find(o => o.id == this.directForm.warehouse2)
+          const positionItem2 = this.positionList2.find(o => o.id == this.directForm.position2)
+          const params = {
             orderNo: this.detailData.enginOrderId,
             orderType: 'TRADE', // TRADE=商用 HOME=家用 RETAIL=零售单 RETAIL_POLICY 销售政策单
             correspondId: this.directForm.warehouse1,
@@ -655,13 +664,13 @@ export default {
             inCorrespondName: warehouseItem2.name,
             inStockId: this.directForm.position2,
             inStockName: positionItem2.name,
-            refEnginRecordNo: this.detailData.refEnginRecordNo || '',
+            refEnginRecordNo: this.detailData.refEnginRecordNo || ''
 
           }
           directOrder(params).then(res => {
-            this.$successMsg();
-            this.isShowDirectDialog = false;
-            this.getDetail();
+            this.$successMsg()
+            this.isShowDirectDialog = false
+            this.getDetail()
           })
         }
       })
@@ -669,13 +678,13 @@ export default {
 
     // 联查单据
     toCheckOrder() {
-      this.checkOrderId = this.detailData.enginOrderId;
-      this.isShowCheckOrder = true;
+      this.checkOrderId = this.detailData.enginOrderId
+      this.isShowCheckOrder = true
     },
 
     backDetail() {
-      this.isShowCheckOrder = false;
-    },
+      this.isShowCheckOrder = false
+    }
 
   }
 }

+ 100 - 90
src/views/supply/engin/components/commerce_examine.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="detail-container">
-    <el-page-header @back="goBack" content="审批"></el-page-header>
+    <el-page-header content="审批" @back="goBack" />
 
     <div class="main-title">
       <div class="title">工程订单</div>
@@ -10,128 +10,137 @@
       <el-row>
         <el-col :span="8" class="item">
           <div class="label">工程订单号</div>
-          <div class="value">{{detailData.enginOrderNo}}</div>
+          <div class="value">{{ detailData.enginOrderNo }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">订单日期</div>
-          <div class="value">{{detailData.orderDate}}</div>
+          <div class="value">{{ detailData.orderDate }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">单据状态</div>
-          <div class="value">{{detailData.examineStatus | statusFilter}}</div>
+          <div class="value">{{ detailData.examineStatus | statusFilter }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">经销商编码</div>
-          <div class="value">{{detailData.customerNumber}}</div>
+          <div class="value">{{ detailData.customerNumber }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">经销商名称</div>
-          <div class="value">{{detailData.customerName}}</div>
+          <div class="value">{{ detailData.customerName }}</div>
         </el-col>
         <el-col :span="8" class="item">
-              <div class="label">机型类别</div>
-              <div class="value">{{detailData.refMachineType}}</div>
-            </el-col>
+          <div class="label">机型类别</div>
+          <div class="value">{{ detailData.refMachineType }}</div>
+        </el-col>
         <el-col :span="8" class="item">
           <div class="label">工程登录编号</div>
-          <div class="value">{{detailData.refEnginRecordNo}}</div>
+          <div class="value">{{ detailData.refEnginRecordNo }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">项目名称</div>
-          <div class="value">{{detailData.refProjectName}}</div>
+          <div class="value">{{ detailData.refProjectName }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">行业类别</div>
-          <div class="value">{{detailData.refTradeCategory}}</div>
+          <div class="value">{{ detailData.refTradeCategory }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">跨区厂编号</div>
-          <div class="value">{{detailData.refFactoryNo}}</div>
+          <div class="value">{{ detailData.refFactoryNo }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">使用单位</div>
-          <div class="value">{{detailData.refUseUnit}}</div>
+          <div class="value">{{ detailData.refUseUnit }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">工程登录类型</div>
-          <div class="value">{{detailData.refPromiseStatus}}</div>
+          <div class="value">{{ detailData.refPromiseStatus }}</div>
         </el-col>
-<!--        <el-col :span="8" class="item">-->
-<!--          <div class="label">销售类型</div>-->
-<!--          <div class="value">{{detailData.saleTypeName}}</div>-->
-<!--        </el-col>-->
+        <!--        <el-col :span="8" class="item">-->
+        <!--          <div class="label">销售类型</div>-->
+        <!--          <div class="value">{{detailData.saleTypeName}}</div>-->
+        <!--        </el-col>-->
         <el-col :span="8" class="item">
           <div class="label">联系人</div>
-          <div class="value">{{detailData.refLinkman}}</div>
+          <div class="value">{{ detailData.refLinkman }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">固定电话</div>
-          <div class="value">{{detailData.refTel}}</div>
+          <div class="value">{{ detailData.refTel }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">移动电话</div>
-          <div class="value">{{detailData.refPhone}}</div>
+          <div class="value">{{ detailData.refPhone }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">权限分类</div>
-          <div class="value">{{detailData.refPowerCategory}}</div>
+          <div class="value">{{ detailData.refPowerCategory }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">工程登录类型</div>
-          <div class="value">{{detailData.refPromiseStatus}}</div>
+          <div class="value">{{ detailData.refPromiseStatus }}</div>
         </el-col>
         <el-col :span="24" class="item">
           <div class="label">安装地址</div>
-          <div class="value">{{detailData.refInstallAddress}}</div>
+          <div class="value">{{ detailData.refInstallAddress }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">不扣押金</div>
           <div class="value">
-            {{detailData.takeDeposit ? '是':'否'}}
+            {{ detailData.takeDeposit ? '是':'否' }}
             <!-- <el-checkbox v-model="detailData.takeDeposit">{{detailData.takeDeposit ? '是':'否'}}</el-checkbox> -->
           </div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">文件编号</div>
-          <div class="value">{{detailData.fileNo}}</div>
+          <div class="value">{{ detailData.fileNo }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">业务员</div>
-          <div class="value">{{detailData.serviceName}}</div>
+          <div class="value">{{ detailData.serviceName }}</div>
         </el-col>
         <el-col :span="24" class="item">
           <div class="label">格力回复</div>
           <div class="value">
-            <el-input v-model="detailData.geLiNote" placeholder="请输入格力回复"></el-input>
+            <el-input v-model="detailData.geLiNote" placeholder="请输入格力回复" />
           </div>
         </el-col>
         <el-col :span="24" class="item">
           <div class="label">格力内部备注</div>
           <div class="value">
-            <el-input v-model="detailData.geLiInerNote" placeholder="请输入格力内部备注"></el-input>
+            <el-input v-model="detailData.geLiInerNote" placeholder="请输入格力内部备注" />
           </div>
         </el-col>
         <el-col :span="24" class="item">
           <div class="label">备注</div>
           <div class="value">
-            <el-input v-model="detailData.remark" placeholder="请输入备注"></el-input>
+            <el-input v-model="detailData.remark" placeholder="请输入备注" />
           </div>
         </el-col>
         <el-col :span="6" class="item">
           <div class="label">制单人</div>
-          <div class="value">{{detailData.createName}}</div>
+          <div class="value">{{ detailData.createName }}</div>
         </el-col>
         <el-col :span="6" class="item">
           <div class="label">制单日期</div>
-          <div class="value">{{detailData.createTime}}</div>
+          <div class="value">{{ detailData.createTime }}</div>
         </el-col>
         <el-col :span="6" class="item">
           <div class="label">关闭人</div>
-          <div class="value">{{detailData.closeName}}</div>
+          <div class="value">{{ detailData.closeName }}</div>
         </el-col>
         <el-col :span="6" class="item">
           <div class="label">关闭日期</div>
-          <div class="value">{{detailData.closeTime}}</div>
+          <div class="value">{{ detailData.closeTime }}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">计划单</div>
+          <div class="value">
+            <el-checkbox v-model="detailData.isPlanOrder" disabled true-label="true" false-label="false">
+              {{ detailData.isPlanOrder=='true'?'是':'否' }}
+            </el-checkbox>
+
+          </div>
         </el-col>
       </el-row>
     </div>
@@ -150,29 +159,30 @@
         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="left" label="引用记录" prop="useRefCount" min-width="100" 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="unit" min-width="100" show-overflow-tooltip></el-table-column>
+        :summary-method="$getSummaries"
+      >
+        <el-table-column align="center" label="序号" type="index" width="50" />
+        <el-table-column align="left" label="引用记录" prop="useRefCount" min-width="100" show-overflow-tooltip />
+        <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip />
+        <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip />
+        <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip />
+        <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip />
+        <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip />
+        <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
         <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ scope.row.price | numToFixed }}
             <!-- <el-input v-model="scope.row.price" size="small" type="number" @mousewheel.native.prevent></el-input> -->
           </template>
         </el-table-column>
-        <el-table-column align="right" label="工程登录数量" prop="enginNum" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="right" label="数量" prop="number" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="right" label="工程登录数量" prop="enginNum" min-width="100" show-overflow-tooltip />
+        <el-table-column align="right" label="数量" prop="number" min-width="100" show-overflow-tooltip />
         <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="left" label="返利类型" prop="customerWalletName2" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="left" label="返利类型" prop="customerWalletName2" min-width="100" show-overflow-tooltip />
         <el-table-column align="right" label="使用返利金额" prop="payRebateAmount" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ scope.row.payRebateAmount | numToFixed }}
@@ -183,7 +193,7 @@
             {{ 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="left" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip />
         <el-table-column align="right" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ scope.row.payAmount | numToFixed }}
@@ -194,10 +204,10 @@
             {{ scope.row.isDirectTransfer ? '是' : '否' }}
           </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="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="tax" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="right" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip />
+        <el-table-column align="right" label="已发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip />
+        <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
+        <el-table-column align="left" label="税率" prop="tax" min-width="100" show-overflow-tooltip />
       </el-table>
     </div>
 
@@ -208,15 +218,15 @@
       <el-row :gutter="0">
         <el-col :span="12" class="item">
           <div class="label">审批人</div>
-          <div class="value">{{userName}}</div>
+          <div class="value">{{ userName }}</div>
         </el-col>
         <el-col :span="12" class="item">
           <div class="label">审批日期</div>
-          <div class="value">{{getDate()}}</div>
+          <div class="value">{{ getDate() }}</div>
         </el-col>
         <el-col :span="24" class="item">
           <div class="label">审批说明</div>
-          <div class="value"><el-input v-model="examineForm.remark" placeholder="请输入审批说明"></el-input></div>
+          <div class="value"><el-input v-model="examineForm.remark" placeholder="请输入审批说明" /></div>
         </el-col>
       </el-row>
     </div>
@@ -225,7 +235,7 @@
       <div class="footer">
         <el-button type="primary" @click="clickSubmitForm(1)">审批通过</el-button>
         <el-button type="warning" @click="clickSubmitForm(0)">审批驳回</el-button>
-        <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
+        <el-popconfirm title="确定关闭吗?" style="margin-left: 10px;" @onConfirm="goBack">
           <el-button slot="reference">返回列表</el-button>
         </el-popconfirm>
       </div>
@@ -235,75 +245,75 @@
 </template>
 
 <script>
-import { getOrderDetail, examineCom } from "@/api/supply/engin";
+import { getOrderDetail, examineCom } from '@/api/supply/engin'
 
 export default {
   name: 'CommerceExamine',
   componentName: 'CommerceExamine',
-  props: ['listItem'],
   filters: {
     statusFilter(val) {
       const statusList = [
         { label: '已保存', value: 'SAVE' },
         { label: '待审核', value: 'WAIT' },
         { label: '审核通过', value: 'OK' },
-         // { label: '审核驳回', value: 'FAIL' },,
-        { label: '已关闭', value: 'CLOSE' },
-      ];
-      let obj = statusList.find(o => o.value == val);
+        // { label: '审核驳回', value: 'FAIL' },,
+        { label: '已关闭', value: 'CLOSE' }
+      ]
+      const obj = statusList.find(o => o.value == val)
       return obj ? obj.label : ''
     }
   },
+  props: ['listItem'],
   data() {
     return {
-      userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
+      userName: JSON.parse(localStorage.getItem('supply_user')).nickName,
       detailData: {},
 
       formLoading: false,
       examineForm: {
-        remark: '',
+        remark: ''
       }
     }
   },
 
   created() {
-    this.getDetail();
+    this.getDetail()
   },
 
   methods: {
     getDate() {
-      var date = new Date();
-      var seperator1 = "-";
-      var year = date.getFullYear();
-      var month = date.getMonth() + 1;
-      var strDate = date.getDate();
+      var date = new Date()
+      var seperator1 = '-'
+      var year = date.getFullYear()
+      var month = date.getMonth() + 1
+      var strDate = date.getDate()
       if (month >= 1 && month <= 9) {
-          month = "0" + month;
+        month = '0' + month
       }
       if (strDate >= 0 && strDate <= 9) {
-          strDate = "0" + strDate;
+        strDate = '0' + strDate
       }
-      var currentdate = year + seperator1 + month + seperator1 + strDate;
-      return currentdate;
+      var currentdate = year + seperator1 + month + seperator1 + strDate
+      return currentdate
     },
 
     // 返回列表
     goBack() {
-      this.$emit('backListFormDetail');
+      this.$emit('backListFormDetail')
     },
 
     // 获取详情
     getDetail() {
-      getOrderDetail({id: this.listItem.parentId}).then(res => {
-        if(res.data.items) {
+      getOrderDetail({ id: this.listItem.parentId }).then(res => {
+        if (res.data.items) {
           res.data.items.forEach(item => {
-            item.number = (item.qty*100 - item.retiredQty*100) / 100;
-            item.sums1 = ['number', 'directTransferQty', 'qty', 'enginNum', 'refundableQty', 'tdQty'];
-            item.sums2 = ['totalAmount', 'payAmount', 'price', 'payRebateAmount', 'discAmount'];
+            item.number = (item.qty * 100 - item.retiredQty * 100) / 100
+            item.sums1 = ['number', 'directTransferQty', 'qty', 'enginNum', 'refundableQty', 'tdQty']
+            item.sums2 = ['totalAmount', 'payAmount', 'price', 'payRebateAmount', 'discAmount']
           })
         }
-        this.detailData = res.data;
-        this.examineForm.remark = res.data.examineNote;
+        this.detailData = res.data
+        this.examineForm.remark = res.data.examineNote
       })
     },
 
@@ -314,16 +324,16 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        let params = this.detailData;
-        params.examineNote = this.examineForm.remark;
-        params.examineResult = val;
+        const params = this.detailData
+        params.examineNote = this.examineForm.remark
+        params.examineResult = val
         examineCom(params).then(res => {
-          this.$successMsg();
-          this.goBack();
-          this.$parent.getList();
+          this.$successMsg()
+          this.goBack()
+          this.$parent.getList()
         })
-      }).catch(() => {});
-    },
+      }).catch(() => {})
+    }
 
   }
 }

Fichier diff supprimé car celui-ci est trop grand
+ 318 - 308
src/views/supply/engin/components/commerce_form.vue


+ 100 - 91
src/views/supply/engin/components/commerce_return.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="detail-container">
-    <el-page-header @back="goBack" content="退订"></el-page-header>
+    <el-page-header content="退订" @back="goBack" />
 
     <div class="main-title">
       <div class="title">工程订单</div>
@@ -10,111 +10,120 @@
       <el-row>
         <el-col :span="8" class="item">
           <div class="label">工程订单号</div>
-          <div class="value">{{detailData.enginOrderNo}}</div>
+          <div class="value">{{ detailData.enginOrderNo }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">订单日期</div>
-          <div class="value">{{detailData.orderDate}}</div>
+          <div class="value">{{ detailData.orderDate }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">单据状态</div>
-          <div class="value">{{detailData.examineStatus | statusFilter}}</div>
+          <div class="value">{{ detailData.examineStatus | statusFilter }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">经销商编码</div>
-          <div class="value">{{detailData.customerNumber}}</div>
+          <div class="value">{{ detailData.customerNumber }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">经销商名称</div>
-          <div class="value">{{detailData.customerName}}</div>
+          <div class="value">{{ detailData.customerName }}</div>
         </el-col>
         <el-col :span="8" class="item">
-              <div class="label">机型类别</div>
-              <div class="value">{{detailData.refMachineType}}</div>
-            </el-col>
+          <div class="label">机型类别</div>
+          <div class="value">{{ detailData.refMachineType }}</div>
+        </el-col>
         <el-col :span="8" class="item">
           <div class="label">工程登录编号</div>
-          <div class="value">{{detailData.refEnginRecordNo}}</div>
+          <div class="value">{{ detailData.refEnginRecordNo }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">项目类别</div>
-          <div class="value">{{detailData.refProjectName}}</div>
+          <div class="value">{{ detailData.refProjectName }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">行业类别</div>
-          <div class="value">{{detailData.refTradeCategory}}</div>
+          <div class="value">{{ detailData.refTradeCategory }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">跨区厂编号</div>
-          <div class="value">{{detailData.refFactoryNo}}</div>
+          <div class="value">{{ detailData.refFactoryNo }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">使用单位</div>
-          <div class="value">{{detailData.refUseUnit}}</div>
+          <div class="value">{{ detailData.refUseUnit }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">销售类型</div>
-          <div class="value">{{detailData.saleTypeName}}</div>
+          <div class="value">{{ detailData.saleTypeName }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">联系人</div>
-          <div class="value">{{detailData.refLinkman}}</div>
+          <div class="value">{{ detailData.refLinkman }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">固定电话</div>
-          <div class="value">{{detailData.refTel}}</div>
+          <div class="value">{{ detailData.refTel }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">移动电话</div>
-          <div class="value">{{detailData.refPhone}}</div>
+          <div class="value">{{ detailData.refPhone }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">权限分类</div>
-          <div class="value">{{detailData.refPowerCategory}}</div>
+          <div class="value">{{ detailData.refPowerCategory }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">工程登录类型</div>
-          <div class="value">{{detailData.refPromiseStatus}}</div>
+          <div class="value">{{ detailData.refPromiseStatus }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">不扣押金</div>
-          <div class="value">{{detailData.takeDeposit ? '是':'否'}}</div>
+          <div class="value">{{ detailData.takeDeposit ? '是':'否' }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">文件编号</div>
-          <div class="value">{{detailData.fileNo}}</div>
+          <div class="value">{{ detailData.fileNo }}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">业务员</div>
-          <div class="value">{{detailData.serviceName}}</div>
+          <div class="value">{{ detailData.serviceName }}</div>
         </el-col>
         <el-col :span="24" class="item">
           <div class="label">格力回复</div>
-          <div class="value">{{detailData.note1}}</div>
+          <div class="value">{{ detailData.note1 }}</div>
         </el-col>
         <el-col :span="24" class="item">
           <div class="label">格力内部备注</div>
-          <div class="value">{{detailData.note2}}</div>
+          <div class="value">{{ detailData.note2 }}</div>
         </el-col>
         <el-col :span="24" class="item">
           <div class="label">备注</div>
-          <div class="value">{{detailData.remark}}</div>
+          <div class="value">{{ detailData.remark }}</div>
         </el-col>
         <el-col :span="6" class="item">
           <div class="label">制单人</div>
-          <div class="value">{{detailData.createName}}</div>
+          <div class="value">{{ detailData.createName }}</div>
         </el-col>
         <el-col :span="6" class="item">
           <div class="label">制单日期</div>
-          <div class="value">{{detailData.createTime}}</div>
+          <div class="value">{{ detailData.createTime }}</div>
         </el-col>
         <el-col :span="6" class="item">
           <div class="label">关闭人</div>
-          <div class="value">{{detailData.closeName}}</div>
+          <div class="value">{{ detailData.closeName }}</div>
         </el-col>
         <el-col :span="6" class="item">
           <div class="label">关闭日期</div>
-          <div class="value">{{detailData.closeTime}}</div>
+          <div class="value">{{ detailData.closeTime }}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">计划单</div>
+          <div class="value">
+            <el-checkbox v-model="detailData.isPlanOrder" disabled true-label="true" false-label="false">
+              {{ detailData.isPlanOrder=='true'?'是':'否' }}
+            </el-checkbox>
+
+          </div>
         </el-col>
       </el-row>
     </div>
@@ -133,28 +142,29 @@
         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="left" label="引用记录" prop="useRefCount" min-width="100" 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="unit" min-width="100" show-overflow-tooltip></el-table-column>
+        :summary-method="$getSummaries"
+      >
+        <el-table-column align="center" label="序号" type="index" width="50" />
+        <el-table-column align="left" label="引用记录" prop="useRefCount" min-width="100" show-overflow-tooltip />
+        <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip />
+        <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip />
+        <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="120" show-overflow-tooltip />
+        <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip />
+        <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip />
+        <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip />
         <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="enginNum" min-width="120" show-overflow-tooltip />
+        <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip />
         <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="left" label="返利类型" prop="customerWalletName2" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="left" label="返利类型" prop="customerWalletName2" min-width="100" show-overflow-tooltip />
         <el-table-column align="right" label="使用返利金额" prop="payRebateAmount" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ scope.row.payRebateAmount | numToFixed }}
@@ -165,7 +175,7 @@
             {{ 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="left" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip />
         <el-table-column align="right" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ scope.row.payAmount | numToFixed }}
@@ -176,15 +186,15 @@
             {{ scope.row.isDirectTransfer ? '是' : '否' }}
           </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="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="right" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip />
+        <el-table-column align="right" label="可退数量" prop="refundableQty" min-width="100" show-overflow-tooltip />
         <el-table-column align="right" label="退订数量" prop="tdQty" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
-            <el-input v-model="scope.row.tdQty" size="mini" @blur="hasTdQty" type="number" @mousewheel.native.prevent></el-input>
+            <el-input v-model="scope.row.tdQty" size="mini" type="number" @blur="hasTdQty" @mousewheel.native.prevent />
           </template>
         </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="tax" 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 align="left" label="税率" prop="tax" min-width="100" show-overflow-tooltip />
       </el-table>
     </div>
 
@@ -195,15 +205,15 @@
       <el-row :gutter="0">
         <el-col :span="12" class="item">
           <div class="label">退订人</div>
-          <div class="value">{{userName}}</div>
+          <div class="value">{{ userName }}</div>
         </el-col>
         <el-col :span="12" class="item">
           <div class="label">退订日期</div>
-          <div class="value">{{getDate()}}</div>
+          <div class="value">{{ getDate() }}</div>
         </el-col>
         <el-col :span="24" class="item">
           <div class="label">退订说明</div>
-          <div class="value"><el-input v-model="returnForm.remark" placeholder="请输入退订说明"></el-input></div>
+          <div class="value"><el-input v-model="returnForm.remark" placeholder="请输入退订说明" /></div>
         </el-col>
       </el-row>
     </div>
@@ -211,7 +221,7 @@
     <div class="page-footer">
       <div class="footer">
         <el-button type="primary" @click="clickSubmitForm()">确定退订</el-button>
-        <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
+        <el-popconfirm title="确定关闭吗?" style="margin-left: 10px;" @onConfirm="goBack">
           <el-button slot="reference">返回列表</el-button>
         </el-popconfirm>
       </div>
@@ -221,80 +231,79 @@
 </template>
 
 <script>
-import { getOrderDetail, returnCom } from "@/api/supply/engin";
+import { getOrderDetail, returnCom } from '@/api/supply/engin'
 
 export default {
   name: 'CommerceReturn',
   componentName: 'CommerceReturn',
-  props: ['listItem'],
   filters: {
     statusFilter(val) {
       const statusList = [
         { label: '已保存', value: 'SAVE' },
         { label: '待审核', value: 'WAIT' },
         { label: '审核通过', value: 'OK' },
-         // { label: '审核驳回', value: 'FAIL' },,
-        { label: '已关闭', value: 'CLOSE' },
-      ];
-      let obj = statusList.find(o => o.value == val);
+        // { label: '审核驳回', value: 'FAIL' },,
+        { label: '已关闭', value: 'CLOSE' }
+      ]
+      const obj = statusList.find(o => o.value == val)
       return obj ? obj.label : ''
     }
   },
+  props: ['listItem'],
   data() {
     return {
-      userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
+      userName: JSON.parse(localStorage.getItem('supply_user')).nickName,
       detailData: {},
 
       formLoading: false,
       returnForm: {
-        remark: '',
+        remark: ''
       }
     }
   },
 
   created() {
-    this.getDetail();
+    this.getDetail()
   },
 
   methods: {
     getDate() {
-      var date = new Date();
-      var seperator1 = "-";
-      var year = date.getFullYear();
-      var month = date.getMonth() + 1;
-      var strDate = date.getDate();
+      var date = new Date()
+      var seperator1 = '-'
+      var year = date.getFullYear()
+      var month = date.getMonth() + 1
+      var strDate = date.getDate()
       if (month >= 1 && month <= 9) {
-          month = "0" + month;
+        month = '0' + month
       }
       if (strDate >= 0 && strDate <= 9) {
-          strDate = "0" + strDate;
+        strDate = '0' + strDate
       }
-      var currentdate = year + seperator1 + month + seperator1 + strDate;
-      return currentdate;
+      var currentdate = year + seperator1 + month + seperator1 + strDate
+      return currentdate
     },
 
     // 返回列表
     goBack() {
-      this.$emit('backListFormDetail');
+      this.$emit('backListFormDetail')
     },
-    hasTdQty(row){
-      if (row.tdQty<0) {
-          row.tdQty = 0
-          this.$errorMsg('不能填负数')
-        }
-
+    hasTdQty(row) {
+      if (row.tdQty < 0) {
+        row.tdQty = 0
+        this.$errorMsg('不能填负数')
+      }
     },
     // 获取详情
     getDetail() {
-      getOrderDetail({id: this.listItem.parentId}).then(res => {
-        if(res.data.items) {
+      getOrderDetail({ id: this.listItem.parentId }).then(res => {
+        if (res.data.items) {
           res.data.items.forEach(item => {
-            item.number = (item.qty*100 - item.retiredQty*100) / 100;
-            item.sums1 = ['number', 'directTransferQty', 'qty', 'enginNum', 'refundableQty', 'tdQty'];
-            item.sums2 = ['totalAmount', 'payAmount', 'price', 'payRebateAmount', 'discAmount'];
+            item.number = (item.qty * 100 - item.retiredQty * 100) / 100
+            item.sums1 = ['number', 'directTransferQty', 'qty', 'enginNum', 'refundableQty', 'tdQty']
+            item.sums2 = ['totalAmount', 'payAmount', 'price', 'payRebateAmount', 'discAmount']
           })
         }
-        this.detailData = res.data;
+        this.detailData = res.data
       })
     },
 
@@ -305,19 +314,19 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        let params = {
+        const params = {
           enginOrderId: this.detailData.enginOrderId,
           items: this.detailData.items,
           refundNote: this.returnForm.remark,
-          refEnginRecordNo:this.detailData.refEnginRecordNo,
-        };
+          refEnginRecordNo: this.detailData.refEnginRecordNo
+        }
         returnCom(params).then(res => {
-          this.$successMsg();
-          this.goBack();
-          this.$parent.getList();
+          this.$successMsg()
+          this.goBack()
+          this.$parent.getList()
         })
-      }).catch(() => {});
-    },
+      }).catch(() => {})
+    }
 
   }
 }

+ 331 - 4
src/views/supply/implement/commercial_implement_list.vue

@@ -1,14 +1,341 @@
 <template>
-  <!--  商用信息单执行明细-->
-  <div />
+  <div class="app-container">
+    <div v-show="!isShowDisplaceDetail">
+      <!-- 筛选条件 -->
+      <div class="screen-container">
+        <el-form ref="screenForm" :model="screenForm" label-width="100px" size="mini" label-position="left">
+          <el-row :gutter="20">
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="信息单日期" prop="orderTime">
+                <el-date-picker
+                  v-model="screenForm.orderTime"
+                  type="datetimerange"
+                  range-separator="至"
+                  style="width: 100%"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="经销商" prop="customerId">
+                <el-select v-model="screenForm.customerId" filterable class="selectStyle" placeholder="请选择">
+                  <el-option v-for="item in dealerList" :key="item.id" :label="item.name" :value="item.id" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="项目名称" prop="refProjectName">
+                <el-input v-model="screenForm.refProjectName" placeholder="请输入项目名称" />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="机型型号" prop="specification">
+                <el-input v-model="screenForm.specification" placeholder="请输入机型型号" />
+              </el-form-item>
+            </el-col>
+            <!--            <el-col :xs="24" :sm="12" :lg="6">-->
+            <!--              <el-form-item label="信息单号" prop="policyRemark">-->
+            <!--                <el-input v-model="screenForm.policyRemark" placeholder="请输入销售政策说明" />-->
+            <!--              </el-form-item>-->
+            <!--            </el-col>-->
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="业务员" prop="serviceId">
+                <el-select
+                  v-model="screenForm.serviceId"
+                  placeholder="选择业务员"
+                  clearable
+                  filterable
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="item in salesmanList"
+                    :key="item.adminUserId"
+                    :label="item.nickName"
+                    :value="item.adminUserId"
+                  />
+                </el-select>              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="是否关闭" prop="isClose">
+                <el-select v-model="screenForm.isClose" clearable placeholder="请选择是否">
+                  <el-option label="是" :value="true" />
+                  <el-option label="否" :value="false" />
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="审核人" prop="confirmName">
+                <el-input v-model="screenForm.confirmName" placeholder="请输入审核人" />
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="24" class="tr">
+              <el-form-item label="">
+                <el-button @click="resetScreenForm">清空</el-button>
+                <el-button type="primary" @click="submitScreenForm">搜索</el-button>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+
+      <div class="mymain-container">
+        <div class="btn-group clearfix">
+          <div class="fr">
+            <ExportButton :ex-url="'engin-info-order/exec/export'" :ex-params="exParams" />
+          </div>
+        </div>
+        <div class="table">
+          <el-table
+            v-loading="listLoading"
+            :data="dataList"
+            element-loading-text="Loading"
+            border
+            fit
+            highlight-current-row
+            stripe
+            show-summary
+            :summary-method="$getSummaries"
+          >
+
+            <el-table-column align="left" label="信息单日期" prop="orderDate" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="工程编号" prop="refEnginRecordNo" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="经销熵编码" prop="customerNumber" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="项目名称" prop="refProjectName" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="数量" prop="qty" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="单价" prop="price" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="金额" prop="totalAmount" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="未订数量" prop="wdQty" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="未订金额" prop="wdAmount" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="直调数量" prop="directTransferQty" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="退订数量" prop="retiredQty" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="退货数量" prop="refundProductQty" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="表头业务员" prop="serviceName" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="审核人" prop="confirmName" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="是否关闭" prop="isClose" min-width="160" show-overflow-tooltip>
+              <template v-slot="scope">
+                {{ scope.row.isClose?'是':'否' }}
+              </template>
+            </el-table-column>
+            <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="格力内部备注" prop="geLiInerNote" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="权限分类" prop="refPowerCategory" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="合同有效期" prop="contractExpireDate" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="安装地址" prop="installAddress" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="联系电话" prop="phone" min-width="160" show-overflow-tooltip />
+            <el-table-column align="left" label="工程登录类型" prop="enginSignType" min-width="160" show-overflow-tooltip />
+          </el-table>
+        </div>
+      </div>
+      <div class="pagination clearfix">
+        <div class="fr">
+          <el-pagination
+            :current-page="currentPage"
+            :page-sizes="[10, 20, 30, 50]"
+            :page-size="10"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="listTotal"
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+          />
+        </div>
+      </div>
+    </div>
+    <DisplaceDetail
+      v-if="isShowDisplaceDetail"
+      :list-item="queryItem"
+      @backListFormDetail="backList"
+    />
+
+  </div>
 </template>
 
 <script>
+import { getExecList } from '@/api/supply/implement'
+import { getCategoryList, getSalesmanList } from '@/api/common'
+import DisplaceDetail from '@/views/supply/implement/components/displace_detail'
+import { getDealerList } from '@/api/supply/apply'
+
+let that
 export default {
-  name: 'CommercialImplementList'
+  components: {
+    DisplaceDetail
+  },
+  filters: {
+    statusFilter(val) {
+      if (that.statusList.length) {
+        const obj = that.statusList.find(o => o.value === val)
+        return obj ? obj.label : ''
+      }
+      return ''
+    }
+  },
+  data() {
+    return {
+      currentPage: 1, // 当前页码
+      pageSize: 10, // 每页数量
+      listTotal: 0, // 列表总数
+      dataList: null, // 列表数据
+      listLoading: false, // 列表加载loading
+      screenForm: { // 筛选表单数据
+        confirmName: '',
+        customerId: '',
+        orderTime: '',
+        isClose: '',
+        refEnginRecordNo: '',
+        refProjectName: '',
+        serviceId: '',
+        specification: ''
+      },
+      categoryList: [],
+      statusList: [
+        { label: '政策零售订单', value: '2' },
+        { label: '零售订单', value: '1' },
+        { label: '家用工程订单', value: 'HOME' },
+        { label: '商用工程订单', value: 'TRADE' }
+      ],
+      salesmanList: [],
+      dealerList: [],
+      queryItem: {},
+      isShowDisplaceDetail: false
+    }
+  },
+
+  computed: {
+    exParams() {
+      return {
+        confirmName: this.screenForm.confirmName,
+        customerId: this.screenForm.customerId,
+        startOrderDate: this.screenForm.orderTime ? this.screenForm.orderTime[0] : '',
+        endOrderDate: this.screenForm.orderTime ? this.screenForm.orderTime[1] : '',
+        isClose: this.screenForm.isClose,
+        refEnginRecordNo: this.screenForm.refEnginRecordNo,
+        refProjectName: this.screenForm.refProjectName,
+        serviceId: this.screenForm.serviceId,
+        specification: this.screenForm.specification
+      }
+    }
+  },
+
+  beforeCreate() {
+    that = this
+  },
+
+  created() {
+    this.getList()
+    this.getCategoryList()
+    this.getSalesmanList()
+    this.getDealerList()
+  },
+
+  methods: {
+    // 查询列表
+    getList() {
+      this.listLoading = true
+
+      const params = {
+        pageNum: this.currentPage,
+        pageSize: this.pageSize,
+        confirmName: this.screenForm.confirmName,
+        customerId: this.screenForm.customerId,
+        startOrderDate: this.screenForm.orderTime ? this.screenForm.orderTime[0] : '',
+        endOrderDate: this.screenForm.orderTime ? this.screenForm.orderTime[1] : '',
+        isClose: this.screenForm.isClose,
+        refEnginRecordNo: this.screenForm.refEnginRecordNo,
+        refProjectName: this.screenForm.refProjectName,
+        serviceId: this.screenForm.serviceId,
+        specification: this.screenForm.specification
+      }
+      getExecList(params).then((res) => {
+        res.data.records.forEach(item => {
+          item.sums1 = ['refundableQty', 'qty', 'retiredQty', 'hasSendQty', 'directTransferQty', 'refundProductQty']
+          item.sums2 = ['payAmount', 'payRebateAmount', 'hasSendAmount', 'retiredAmount', 'refundProductAmount']
+        })
+        this.dataList = res.data.records
+        this.listTotal = res.data.total
+        this.listLoading = false
+      })
+    },
+    // 获取业务员列表
+    getSalesmanList() {
+      getSalesmanList({
+        pageNum: 1,
+        pageSize: -1,
+        isCustomer: 0,
+        status: true
+      }).then((res) => {
+        this.salesmanList = res.data.records
+      })
+    },
+    // 获取经销商列表
+    getDealerList() {
+      getDealerList({
+        pageNum: 1,
+        pageSize: -1
+
+      }).then(res => {
+        this.dealerList = res.data.records
+      })
+    },
+    // 获取存货类别列表
+    getCategoryList() {
+      getCategoryList({
+        pageNum: 1,
+        pageSize: -1,
+        keyword: ''
+      }).then(res => {
+        this.categoryList = res.data.records
+      })
+    },
+
+    // 提交筛选表单
+    submitScreenForm() {
+      this.currentPage = 1
+      this.getList()
+    },
+
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.screenForm.resetFields()
+      this.currentPage = 1
+      this.getList()
+    },
+
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val
+      this.currentPage = 1
+      this.getList()
+    },
+
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val
+      this.getList()
+    },
+
+    // 置换详情
+    openDisplaceDetail(item) {
+      this.queryItem = item
+      this.isShowDisplaceDetail = true
+    },
+
+    backList() {
+      this.queryItem = {}
+      this.isShowDisplaceDetail = false
+    }
+
+  }
 }
 </script>
 
-<style scoped>
+<style lang="scss" scoped>
 
 </style>

+ 36 - 33
src/views/supply/pickup/components/design/preview.vue

@@ -2,13 +2,13 @@
   <el-dialog
     :visible.sync="visible"
     :show-close="false"
-    :maskClosable="false"
+    :mask-closable="false"
     :close-on-click-modal="false"
-    @cancel="hideModal"
     :width="350 + 'mm'"
+    @cancel="hideModal"
   >
     <div :spinning="spinning" style="min-height: 100px">
-      <div id="preview_content" ref="printDom"></div>
+      <div id="preview_content" ref="printDom" />
     </div>
     <template slot="title">
       <div>
@@ -18,8 +18,7 @@
           type="primary"
           icon="printer"
           @click.stop="print"
-          >打印</el-button
-        >
+        >打印</el-button>
         <!-- <el-button type="primary" icon="printer" @click.stop="toPdf">pdf</el-button> -->
       </div>
     </template>
@@ -31,7 +30,7 @@
 
 <script>
 export default {
-  name: "printPreview",
+  name: 'PrintPreview',
   props: {},
   data() {
     return {
@@ -43,8 +42,8 @@ export default {
       // 模板
       hiprintTemplate: {},
       // 数据
-      printData: {},
-    };
+      printData: {}
+    }
   },
   computed: {},
   watch: {},
@@ -55,44 +54,48 @@ export default {
     //   downloadPDF(this.$refs.printDom);
     // },
     hideModal() {
-      this.visible = false;
-      this.waitShowPrinter = false;
-      this.$parent.initPrint();
+      this.visible = false
+      this.waitShowPrinter = false
+      this.$parent.initPrint()
       // console.log(this.$parent);
     },
-    show(hiprintTemplate, printData, width = "210") {
-      this.visible = true;
-      this.width = width;
-      this.hiprintTemplate = hiprintTemplate;
-      this.printData = printData;
+    show(hiprintTemplate, printData, width = '210') {
+      this.visible = true
+      this.width = width
+      this.hiprintTemplate = hiprintTemplate
+      this.printData = printData
       setTimeout(() => {
         // eslint-disable-next-line no-undef
-        $("#preview_content").html(hiprintTemplate.getHtml(printData));
-        this.spinning = false;
-      }, 500);
+        $('#preview_content').html(hiprintTemplate.getHtml(printData))
+        this.spinning = false
+      }, 500)
     },
     print() {
       this.hiprintTemplate.print(
         this.printData,
         {},
         {
-          callback: () => {
-            this.$parent.addPrint("getDtailPrintDis");
-            this.hiprintTemplate = {};
-            this.$parent.tableSelection = [];
+          callback: async() => {
+            try {
+              await this.$parent.addPrint('getDtailPrintDis')
+            } catch (e) {
+              console.log('调用打印次数接口失败')
+            }
+            this.hiprintTemplate = {}
+            this.$parent.tableSelection = []
+            await this.$parent.getList()
             setTimeout(() => {
-              this.$parent.getList();
-              console.error("更新发货汇总列表");
-            }, 1000);
-          },
+              console.error('更新发货汇总列表')
+            }, 1000)
+          }
         }
-      );
+      )
       setTimeout(() => {
-        this.hideModal();
-      }, 2000);
-    },
-  },
-};
+        this.hideModal()
+      }, 2000)
+    }
+  }
+}
 </script>
 
 <style scoped>

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff