Kaynağa Gözat

【修改】bug

howie 2 yıl önce
ebeveyn
işleme
c932146aa8

+ 265 - 169
src/mixin/print.js

@@ -1,80 +1,82 @@
-import { disAutoConnect, hiprint, defaultElementTypeProvider } from 'vue-plugin-hiprint'
+import {
+  disAutoConnect,
+  hiprint,
+  defaultElementTypeProvider,
+} from "vue-plugin-hiprint";
 disAutoConnect();
-import panel from '@/utils/panel'
+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': {
+        A3: {
           width: 420,
-          height: 296.6
+          height: 296.6,
         },
-        'A4': {
+        A4: {
           width: 210,
-          height: 296.6
+          height: 296.6,
         },
-        'A5': {
+        A5: {
           width: 210,
-          height: 147.6
+          height: 147.6,
         },
-        'B3': {
+        B3: {
           width: 500,
-          height: 352.6
+          height: 352.6,
         },
-        'B4': {
+        B4: {
           width: 250,
-          height: 352.6
+          height: 352.6,
         },
-        'B5': {
+        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";
+      let types = this.paperTypes;
       for (const key in types) {
-        let item = types[key]
-        let { width, height } = this.curPaper
+        let item = types[key];
+        let { 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({
@@ -82,24 +84,24 @@ export default {
         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'
+        settingContainer: "#PrintElementOptionSetting",
+        paginationContainer: ".hiprint-printPagination",
       });
-      this.hiprintTemplate.design('#hiprint-printTemplate');
+      this.hiprintTemplate.design("#hiprint-printTemplate");
       // 获取当前放大比例, 当zoom时传true 才会有
       // this.scaleValue = hiprintTemplate.editingPanel.scale || 1;
     },
@@ -107,11 +109,11 @@ export default {
      * 获取需要打印数据详情
      * @param {Array} ids
      */
-    async getDateil(ids, funcType = 'getDeliverDetail') {
-      this.$startLoading()
-      let loadingLen
+    async getDateil(ids, funcType = "getDeliverDetail") {
+      this.$startLoading();
+      let loadingLen;
       // 兼容多个打印数据
-      ids = ids instanceof Array ? ids : [ids]
+      ids = ids instanceof Array ? ids : [ids];
       console.log(ids);
       // 清空之前打印的数据
       this.outputData = [];
@@ -119,140 +121,68 @@ export default {
       let formatting = [];
 
       // 仓库认证请求接口参数
-      let params = []
+      let params = [];
 
       // 获取数据id
       for (let i = ids.length; i > 0; i--) {
         formatting.push(ids[i - 1].id || ids[i - 1]);
-        if (funcType === 'getDtailPrintDis') {
-          params.push(
-            {
-              id: ids[i - 1].id,
-              invoiceId: ids[i - 1].invoiceId
-            })
-          this.addIds.push(ids[i - 1].id)
+        if (funcType === "getDtailPrintDis") {
+          params.push({
+            id: ids[i - 1].id,
+            invoiceId: ids[i - 1].invoiceId,
+          });
+          this.addIds.push(ids[i - 1].id);
         }
       }
 
-      if (funcType === 'getDtailPrintDis') {
-
-        const requestParams = params
+      if (funcType === "getDtailPrintDis") {
+        const requestParams = params;
         try {
           const { data } = await getDtailPrintDis(requestParams);
-          loadingLen = data.length
+          loadingLen = data.length;
           for (let i = data.length; i > 0; i--) {
             setTimeout(async () => {
               const newData = data[i - 1];
-              await this.mySetData(newData)
+              await this.setPrintData(newData);
             }, 0);
-            loadingLen--
+            loadingLen--;
           }
         } catch (error) {
-          this.$endLoading()
-          console.error('获取打印数据失败')
+          this.$endLoading();
+          console.error("获取打印数据失败");
         }
-
       } else {
         // id 去重
         formatting = [...new Set(formatting)];
-        loadingLen = formatting.length
+        loadingLen = formatting.length;
         for (let i = formatting.length; i > 0; i--) {
           // 延迟请求
           setTimeout(async () => {
-            const requestParams = { id: formatting[i - 1] }
+            const requestParams = {
+              id: formatting[i - 1],
+            };
             try {
               const { data } = await getDeliverDetail(requestParams);
-              this.mySetData(data)
+              this.setPrintData(data);
             } catch (error) {
-              this.$endLoading()
-              console.error('获取打印数据失败')
-
+              this.$endLoading();
+              console.error("获取打印数据失败");
             }
           }, 0);
-          loadingLen--
+          loadingLen--;
         }
       }
-      if (loadingLen ==0) {
-          return Promise.resolve()
-      }
-
-    },
-
-    mySetData(data) {
-      // 初始化打印次数
-      let printNum = 0
-      //避免数据发生改变
-      this.clonelData.push(JSON.parse(JSON.stringify(data)))
-      // 需要计算长度和数据裁切
-      let invoicePickBeans = data.invoicePickBeans;
-
-      // 获取length向上取整
-      let len = Math.ceil(invoicePickBeans.length / 5);
-      for (let index = 0; index < len; index++) {
-        const table = [];
-        //  length <= 0 则不执行打印
-        if (invoicePickBeans.length) {
-          // 取第一个条数据printNum
-          printNum = invoicePickBeans[0].printNum
-          const newInvoicePickBeans = invoicePickBeans.splice(0, 5);
-          for (let e = newInvoicePickBeans.length; e > 0; e--) {
-            const tempData = newInvoicePickBeans[e - 1];
-
-            //添加表格数据
-            table.push({
-              salesId: tempData.salesOrderId,
-              invoiceId: tempData.invoiceId,
-              id: tempData.id,
-              createTime: tempData.id
-                ? this.dateToDayFilter(data.createTime)
-                : '',
-              enginOrderType:
-                tempData.orderType == "HOME" || tempData.orderType == "TRADE"
-                  ? tempData.enginOrderNo
-                  : tempData.mainOrderId,
-              materialName: tempData.materialName,
-              specification: tempData.specification,
-              refundableQty: tempData.refundableQty,
-              pjxh1Text: tempData.pjxh1Text,
-            });
-          }
-        }
-        // 添加print输出数据
-        this.outputData.push({
-          pageNumber: `${len}-${index + 1}`,
-          printNum,
-          type: data.type,
-          tiTui: data.type === 2 ? `退货人` : `提货人`,
-          takerPhone: data.takerPhone || '',
-          headerRemark: data.remark,
-          total_num: data.total_num,
-          company:
-            data.type === 2 ? `${this.company}销售退货单` : `${this.company}销售发货单`,
-          pickOrderWater: data.pickOrderWater,
-          customerNumber: data.customerNumber,
-          takerDa: '',
-          nowDate: this.nowDate(),
-          takerName:
-            data.type === 2
-              ? `退货人:${data.takerName || ''}`
-              : `提货人:${data.takerName || ''}`,
-          customerName: data.customerName || '',
-          correspondName: data.correspondName,
-          correspondNames: '',
-          pickCar: data.pickCar || '',
-          createBy: JSON.parse(localStorage.getItem("supply_user")).nickName,
-          table,
-        });
+      if (loadingLen == 0) {
+        return Promise.resolve();
       }
     },
     // 获取公司名称
     async getCompanyLists() {
       try {
         const { data } = await getCompanyList();
-        this.company = data ? data[0].companyName : '';
+        this.company = data ? data[0].companyName : "";
       } catch (error) {
-        console.error('获取公司名称失败')
-
+        console.error("获取公司名称失败");
       }
     },
     // 获取当前时间
@@ -275,58 +205,224 @@ export default {
     // 格式化时间
     dateToDayFilter(date) {
       if (!date) {
-        return '';
+        return "";
       }
       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;
         if (tempData.length) {
           for (let e = tempData.length; e > 0; e--) {
             const newTempData = tempData[e - 1];
-            ids.push(newTempData.id)
+            ids.push(newTempData.id);
           }
         } else {
-          return this.clonelData[i - 1].invoiceOrderId || this.clonelData[i - 1].id
+          return (
+            this.clonelData[i - 1].invoiceOrderId || this.clonelData[i - 1].id
+          );
         }
       }
       try {
-
-        let requestParams = {}
-        if (funcType === 'getDtailPrintDis') {
-          ids = [...new Set(this.addIds)]
-          requestParams = { ids: ids.join(',') }
-          funcType = addPrint
+        let requestParams = {};
+        if (funcType === "getDtailPrintDis") {
+          ids = [...new Set(this.addIds)];
+          requestParams = {
+            ids: ids.join(","),
+          };
+          funcType = addPrint;
         } else {
-          requestParams = { ids: ids.join(',') }
-          funcType = addPrints
+          requestParams = {
+            ids: ids.join(","),
+          };
+          funcType = addPrints;
         }
-        await funcType(requestParams)
+        await funcType(requestParams);
       } catch (error) {
-        console.error('添加打印次数失败');
+        console.error("添加打印次数失败");
       }
     },
     /**
-      * 设置纸张大小
-      * @param type [A3, A4, A5, B3, B4, B5, other]
-      * @param value {width,height} mm
-      */
+     * 设置纸张大小
+     * @param type [A3, A4, A5, B3, B4, B5, other]
+     * @param value {width,height} mm
+     */
     setPaper(type, value) {
       try {
         if (Object.keys(this.paperTypes).includes(type)) {
-          this.curPaper = { type: type, width: value.width, height: value.height }
-          this.hiprintTemplate.setPaper(value.width, value.height)
+          this.curPaper = {
+            type: type,
+            width: value.width,
+            height: value.height,
+          };
+          this.hiprintTemplate.setPaper(value.width, value.height);
         } else {
-          this.curPaper = { type: 'other', width: value.width, height: value.height }
-          this.hiprintTemplate.setPaper(value.width, value.height)
-
+          this.curPaper = {
+            type: "other",
+            width: value.width,
+            height: value.height,
+          };
+          this.hiprintTemplate.setPaper(value.width, value.height);
         }
       } catch (error) {
-        this.$message.error(`操作失败: ${error}`)
+        this.$message.error(`操作失败: ${error}`);
       }
     },
+    /**
+     * 方法1
+     * 自定义模板数据
+     * @param {object} data
+     * this.outputData 打印数据
+     */
+    setPrintData(data) {
+      // 初始化打印次数
+      let printNum = 0;
+      //避免数据发生改变
+      this.clonelData.push(JSON.parse(JSON.stringify(data)));
+      // 需要计算长度和数据裁切
+      let invoicePickBeans = data.invoicePickBeans;
+
+      // 获取length向上取整
+      let len = Math.ceil(invoicePickBeans.length / 5);
+      for (let index = 0; index < len; index++) {
+        const table = [];
+        //  length <= 0 则不执行打印
+        if (invoicePickBeans.length) {
+          // 取第一个条数据printNum
+          printNum = invoicePickBeans[0].printNum;
+          const newInvoicePickBeans = invoicePickBeans.splice(0, 5);
+          for (let e = newInvoicePickBeans.length; e > 0; e--) {
+            const tempData = newInvoicePickBeans[e - 1];
+
+            //添加表格数据
+            table.push({
+              salesId: tempData.salesOrderId,
+              invoiceId: tempData.invoiceId,
+              id: tempData.id,
+              createTime: tempData.id
+                ? this.dateToDayFilter(data.createTime)
+                : "",
+              enginOrderType:
+                tempData.orderType == "HOME" || tempData.orderType == "TRADE"
+                  ? tempData.enginOrderNo
+                  : tempData.mainOrderId,
+              materialName: tempData.materialName,
+              specification: tempData.specification,
+              refundableQty: tempData.refundableQty,
+              pjxh1Text: tempData.pjxh1Text,
+            });
+          }
+        }
+        // 添加print输出数据
+        this.outputData.push({
+          pageNumber: `${len}-${index + 1}`,
+          printNum:printNum + 1,
+          type: data.type,
+          tiTui: data.type === 2 ? `退货人` : `提货人`,
+          takerPhone: data.takerPhone || "",
+          headerRemark: data.remark,
+          total_num: data.total_num,
+          company:
+            data.type === 2
+              ? `${this.company}销售退货单`
+              : `${this.company}销售发货单`,
+          pickOrderWater: data.pickOrderWater,
+          customerNumber: data.customerNumber,
+          takerDa: "",
+          nowDate: this.nowDate(),
+          takerName:
+            data.type === 2
+              ? `退货人:${data.takerName || ""}`
+              : `提货人:${data.takerName || ""}`,
+          customerName: data.customerName || "",
+          correspondName: data.correspondName,
+          correspondNames: "",
+          pickCar: data.pickCar || "",
+          createBy: JSON.parse(localStorage.getItem("supply_user")).nickName,
+          table,
+        });
+      }
+    },
+    /**
+     * 方法2
+     * 自定义打印模板
+     * @param {object} data
+     * @returns HtmlDom
+     */
+    setPrintDom(data) {
+      return `
+         <div style="font-family:'黑体';">
+            <h1 style="text-align:center">${this.company}其他收款单</h1>
+            <div>
+                <div>
+                  <span style="wdith:50%"></span>
+                  <span style="wdith:50%"></span>
+                </div>
+                <div>
+                  <span style="wdith:50%"></span>
+                  <span style="wdith:50%"></span>
+                </div>
+            </div>
+            <div >
+              <table border=".5" cellspacing="0" width="856" height="250"
+               style="border-color: rgb(0,0,0);
+                border-collapse: collapse;
+                border-style: none;
+                border: 1px solid rgb(0,0,0);
+                font-weight: normal;
+                direction: ltr;
+                padding-bottom: 0pt;
+                padding-left: 4pt;
+                padding-right: 4pt;
+                padding-top: 0pt;
+                text-decoration: none;
+                vertical-align: middle;
+                box-sizing: border-box;
+                word-wrap: break-word;
+                word-break: break-all;">
+                  <tr>
+                    <td>单据编号</td>
+                    <td>${data.billNo}</td>
+                    <td>业务日期</td>
+                    <td>${data.theTime}</td>
+                    <td>打印日期</td>
+                    <td>${data.createTime}</td>
+                  </tr>
+                  <tr>
+                    <td>付款单位</td>
+                    <td colspan="3">${data.customerName}</td>
+                    <td>项目费用名称</td>
+                    <td>${data.customerType}</td>
+                  </tr>
+                  <tr>
+                    <td>钱包</td>
+                    <td>${data.walletName}</td>
+                    <td>实收金额</td>
+                    <td style="text-align:right">${numToFixed(data.amount)}</td>
+                    <td colspan="2">${data.amount}</td>
+                  </tr>
+                  <tr>
+                    <td>备注</td>
+                    <td colspan="5">${data.remark}</td>
+                  </tr>
+              </table>
+            </div>
+            <div style="margin:100px 0 0 0">
+                <div>
+                  <div>
+                    <span style="wdith:50%"></span>
+                    <span style="wdith:50%"></span>
+                  </div>
+                  <div>
+                    <span style="wdith:50%"></span>
+                    <span style="wdith:50%"></span>
+                  </div>
+                </div>
+            </div>
+         </div>
+        `;
+    },
   },
 };

+ 38 - 2
src/views/deposit_commerce/deposit_list.vue

@@ -443,6 +443,42 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              align="right"
+              label="金额"
+              prop="totalAmount"
+              min-width="160"
+              show-overflow-tooltip
+            >
+              <template slot-scope="scope">
+                {{ scope.row.totalAmount | numToFixed}}
+            </template>
+            </el-table-column>
+            <el-table-column
+              align="right"
+              label="发货数量"
+              prop="hasSendQty"
+              min-width="160"
+              show-overflow-tooltip
+            />
+            <el-table-column
+              align="right"
+              label="押金金额"
+              prop="depositAmount"
+              min-width="160"
+              show-overflow-tooltip
+            >
+             <template slot-scope="scope">
+                {{ scope.row.depositAmount | numToFixed}}
+            </template>
+            </el-table-column>
+            <el-table-column
+              align="right"
+              label="上交资料"
+              prop="itemDataQty"
+              min-width="160"
+              show-overflow-tooltip
+            />
+            <el-table-column
               align="center"
               label="操作"
               min-width="160"
@@ -624,8 +660,8 @@ export default {
         this.dataList = res.data.records
         res.data.records.forEach((item) => {
           // item.number = (item.qty*100 - item.directTransferQty*100 - item.retiredQty*100) / 100;
-          item.sums1 = ['qty']
-          item.sums2 = ['itemDepositAmount', 'diffAmount', 'price']
+          item.sums1 = ['qty','hasSendQty','itemDataQty']
+          item.sums2 = ['itemDepositAmount', 'diffAmount', 'price','totalAmount','depositAmount']
         })
         this.listLoading = false
         this.listTotal = res.data.total

+ 38 - 3
src/views/deposit_commerce/refund_list.vue

@@ -329,7 +329,42 @@
                 <span>{{scope.row.confirmName}}</span>
               </template>
             </el-table-column>
-
+            <el-table-column
+              align="right"
+              label="金额"
+              prop="totalAmount"
+              min-width="160"
+              show-overflow-tooltip
+            >
+              <template slot-scope="scope">
+                {{ scope.row.totalAmount | numToFixed}}
+            </template>
+            </el-table-column>
+            <el-table-column
+              align="right"
+              label="发货数量"
+              prop="hasSendQty"
+              min-width="160"
+              show-overflow-tooltip
+            />
+            <el-table-column
+              align="right"
+              label="押金金额"
+              prop="depositAmount"
+              min-width="160"
+              show-overflow-tooltip
+            >
+             <template slot-scope="scope">
+                {{ scope.row.depositAmount | numToFixed}}
+            </template>
+            </el-table-column>
+            <el-table-column
+              align="right"
+              label="上交资料"
+              prop="itemDataQty"
+              min-width="160"
+              show-overflow-tooltip
+            />
             <el-table-column fixed="right" align="center" label="操作" min-width="160" show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-button type="text" class="textColor" v-if="
@@ -640,8 +675,8 @@ export default {
     async getDataList(data) {
       const res = await getDepositManageList(data);
       res.data.records.forEach((item) => {
-        item.sums1 = [];
-        item.sums2 = ["itemDepositAmount"];
+        item.sums1 = ['hasSendQty','itemDataQty'];
+        item.sums2 = ['itemDepositAmount', 'diffAmount', 'price','totalAmount','depositAmount']
       });
       this.dataList = res.data.records;
       this.listTotal = res.data.total;

+ 38 - 2
src/views/deposit_home/deposit_list.vue

@@ -470,6 +470,42 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              align="right"
+              label="金额"
+              prop="totalAmount"
+              min-width="160"
+              show-overflow-tooltip
+            >
+              <template slot-scope="scope">
+                {{ scope.row.totalAmount | numToFixed}}
+            </template>
+            </el-table-column>
+            <el-table-column
+              align="right"
+              label="发货数量"
+              prop="hasSendQty"
+              min-width="160"
+              show-overflow-tooltip
+            />
+            <el-table-column
+              align="right"
+              label="押金金额"
+              prop="depositAmount"
+              min-width="160"
+              show-overflow-tooltip
+            >
+             <template slot-scope="scope">
+                {{ scope.row.depositAmount | numToFixed}}
+            </template>
+            </el-table-column>
+            <el-table-column
+              align="right"
+              label="上交资料"
+              prop="itemDataQty"
+              min-width="160"
+              show-overflow-tooltip
+            />
+            <el-table-column
               align="center"
               label="操作"
               min-width="160"
@@ -653,8 +689,8 @@ export default {
         this.dataList = res.data.records
         res.data.records.forEach((item) => {
           // item.number = (item.qty*100 - item.directTransferQty*100 - item.retiredQty*100) / 100;
-          item.sums1 = ['qty']
-          item.sums2 = ['itemDepositAmount', 'diffAmount', 'price']
+          item.sums1 = ['qty','hasSendQty','itemDataQty']
+          item.sums2 = ['itemDepositAmount', 'diffAmount', 'price','totalAmount','depositAmount']
         })
         this.listLoading = false
         this.listTotal = res.data.total

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

@@ -328,7 +328,42 @@
                 <span>{{scope.row.confirmName}}</span>
               </template>
             </el-table-column>
-
+            <el-table-column
+              align="right"
+              label="金额"
+              prop="totalAmount"
+              min-width="160"
+              show-overflow-tooltip
+            >
+              <template slot-scope="scope">
+                {{ scope.row.totalAmount | numToFixed}}
+            </template>
+            </el-table-column>
+            <el-table-column
+              align="right"
+              label="发货数量"
+              prop="hasSendQty"
+              min-width="160"
+              show-overflow-tooltip
+            />
+            <el-table-column
+              align="right"
+              label="押金金额"
+              prop="depositAmount"
+              min-width="160"
+              show-overflow-tooltip
+            >
+             <template slot-scope="scope">
+                {{ scope.row.depositAmount | numToFixed}}
+            </template>
+            </el-table-column>
+            <el-table-column
+              align="right"
+              label="上交资料"
+              prop="itemDataQty"
+              min-width="160"
+              show-overflow-tooltip
+            />
             <el-table-column fixed="right" align="center" label="操作" min-width="160" show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-button type="text" class="textColor" v-if="
@@ -639,8 +674,8 @@ export default {
     async getDataList(data) {
       const res = await getDepositManageList(data);
       res.data.records.forEach((item) => {
-        item.sums1 = [];
-        item.sums2 = ["itemDepositAmount"];
+        item.sums1 = ['hasSendQty','itemDataQty'];
+        item.sums2 = ['itemDepositAmount', 'diffAmount', 'price','totalAmount','depositAmount']
       });
       this.dataList = res.data.records;
       this.listTotal = res.data.total;

+ 1 - 1
src/views/finance/receipt_list.vue

@@ -384,7 +384,7 @@
             @size-change="handleSizeChange"
             @current-change="handleCurrentChange"
             :current-page="currentPage"
-            :page-sizes="[10, 20, 30, 50,100,200]"
+            :page-sizes="[10, 20, 30, 50,500]"
             :page-size="10"
             layout="total, sizes, prev, pager, next, jumper"
             :total="listTotal"

+ 30 - 3
src/views/supply/retail/components/retail_form.vue

@@ -75,7 +75,7 @@
     </div>
 
     <div class="table" style="margin-top: 20px">
-      <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400" 
+      <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400"
         show-summary
         :summary-method="$getSummaries">
         <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
@@ -215,7 +215,7 @@
       </div>
     </div>
 
-    <el-dialog title="添加产品" :visible.sync="isShowDialog" width="80%">
+    <el-dialog v-drag title="添加产品"  :visible.sync="isShowDialog" width="80%" :modal="false"   >
       <el-form ref="screenForm" :model="screenForm" size="small" label-position="left">
         <el-row :gutter="20">
           <el-col :xs="12" :sm="6" :lg="6">
@@ -341,6 +341,32 @@ export default {
       else if (val > STOCK_ORDER_ALL_NUM) return '充足';
     },
   },
+  directives:{
+    drag:{
+      bing: function (el) {
+        console.log(el);
+          let oDiv = el
+          oDiv.onmousedown = e =>{
+            console.log('onmousedown');
+            let disX = e.clientX - oDiv.offsetLeft
+            let disY = e.clientY - oDiv.offSetTop
+
+          document.onmousemove = e =>{
+            let left = e.clientX - disX
+            let top = e.clientY - disY
+            oDiv.style.left = left + 'px'
+            oDiv.style.top = top + 'px'
+          }
+
+          document.onmouseup = e =>{
+            document.onmousemove = null
+            document.onmouseup = null
+          }
+
+        }
+      }
+    }
+  },
   data() {
     return {
       mainForm: {
@@ -797,7 +823,7 @@ export default {
           let saleManItem = this.mainForm.salesMan ? this.salesmanList.find(o => o.adminUserId == this.mainForm.salesMan) : '';
           let params = {
             // theTime: this.mainForm.date + ' 00:00:00',
-            // mainId: this.mainForm.type,  
+            // mainId: this.mainForm.type,
             // mainName,
             k3ServiceId: this.mainForm.salesMan,
             k3ServiceName: saleManItem.nickName || '',
@@ -828,6 +854,7 @@ export default {
 </script>
 
 <style scoped lang="scss">
+
   .detail-container {
     width: 100%;
     height: 100%;