소스 검색

Finish Hotfix-zh-234

Howie 3 년 전
부모
커밋
a73a70e2ec

+ 18 - 110
src/views/finance/receipt_list.vue

@@ -76,8 +76,8 @@
       <!-- 按钮 -->
       <div class="btn-group clearfix">
         <div class="fl">
-          <el-button type="primary" size="mini" @click="toPrint" :disabled="tableSelection.length < 1">打印发货单
-          </el-button>
+          <!-- <el-button type="primary" size="mini" @click="toPrint" :disabled="tableSelection.length < 1">打印发货单
+          </el-button> -->
         </div>
         <div class="fr">
 
@@ -199,17 +199,16 @@
     
     <ReceiptPrint :listItem="queryItem" v-else-if="showDetail == 2" @backListFormDetail="backList" />
     <ReceiptListDetail :detailId="detailId" v-else />
-    <print-preview ref="preView" />
+    <!-- <print-preview ref="preView" /> -->
 
   </div>
 </template>
 
 <script>
-import { disAutoConnect, hiprint, defaultElementTypeProvider } from 'vue-plugin-hiprint'
-disAutoConnect();
-import panel from './components/design/panel'
-import { getDetail, detailArr } from './components/design/print-data'
-import printPreview from './components/design/preview.vue'
+  
+// import panel from './components/design/panel'
+// import { getDetail, detailArr } from './components/design/print-data'
+// import printPreview from './components/design/preview.vue'
 import { getCustomerList } from "@/api/finance/wallet";
 import {
   getK3ReceiptList,
@@ -223,7 +222,7 @@ export default {
   components: {
     ReceiptPrint,
     ReceiptListDetail,
-    printPreview
+
   },
   data() {
     return {
@@ -246,41 +245,6 @@ export default {
       detailId: null,
       queryItem: {},
       tableSelection: [],
-      curPaper: {
-        type: 'A5',
-        width: 500,
-        height: 147.6
-      },
-      paperTypes: {
-        'A3': {
-          width: 420,
-          height: 296.6
-        },
-        'A4': {
-          width: 210,
-          height: 296.6
-        },
-        'A5': {
-          width: 210,
-          height: 147.6
-        },
-        'B3': {
-          width: 500,
-          height: 352.6
-        },
-        'B4': {
-          width: 250,
-          height: 352.6
-        },
-        'B5': {
-          width: 250,
-          height: 175.6
-        }
-      },
-      scaleValue: 1,
-      scaleMax: 5,
-      scaleMin: 0.5,
-      hiprintTemplate: '',
     };
   },
   computed: {
@@ -288,18 +252,6 @@ export default {
       return {
         ...this.searchForm,
       };
-    },
-    curPaperType() {
-      let type = 'other'
-      let types = this.paperTypes
-      for (const key in types) {
-        let item = types[key]
-        let { width, height } = this.curPaper
-        if (item.width === width && item.height === height) {
-          type = key
-        }
-      }
-      return type
     }
   },
   created() {
@@ -307,7 +259,10 @@ export default {
     this.getCustomerDataList();
   },
   mounted() {
-    this.initPrint()
+    console.log(this.hiPrintPlugin,'888');
+    this.hiPrintPlugin.init()
+    var hiprintTemplate = new this.hiPrintPlugin.PrintTemplate();
+      var panel = hiprintTemplate.addPrintPanel({ width: 100, height: 130, paperFooter: 340, paperHeader: 10 });
   },
   methods: {
     //获取经销商列表
@@ -318,40 +273,8 @@ export default {
       });
       this.customerList = res.data.records;
     },
-    initPrint() {
-      hiprint.init({
-        providers: [new defaultElementTypeProvider()]
-      });
-      // 还原配置
-      hiprint.setConfig()
-      // 替换配置
-      hiprint.setConfig({
-        movingDistance: 2.5,
-        text: {
-          supportOptions: [
-            {
-              name: 'styler',
-              hidden: true
-            },
-            {
-              name: 'formatter',
-              hidden: true
-            },
-          ]
-        }
-      })
-      // eslint-disable-next-line no-undef
-      hiprint.PrintElementTypeManager.buildByHtml($('.ep-draggable-item'));
-      this.hiprintTemplate = new hiprint.PrintTemplate({
-        template: panel,
-        settingContainer: '#PrintElementOptionSetting',
-        paginationContainer: '.hiprint-printPagination'
-      });
-      this.hiprintTemplate.design('#hiprint-printTemplate');
-      // 获取当前放大比例, 当zoom时传true 才会有
-      // this.scaleValue = hiprintTemplate.editingPanel.scale || 1;
-    }
-    ,
+  
+
     //合计
     getSummaries(param) {
       const { columns, data } = param;
@@ -446,27 +369,11 @@ export default {
       this.queryItem = {};
       this.isShowPrint = false;
     },
-    /**
-      * 设置纸张大小
-      * @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)
-        } else {
-          this.curPaper = { type: 'other', width: value.width, height: value.height }
-          this.hiprintTemplate.setPaper(value.width, value.height)
 
-        }
-      } catch (error) {
-        this.$message.error(`操作失败: ${error}`)
-      }
-    },
     // 点击打印
     toPrint(row, type) {
+    
+      panel.addPrintText({ options: { width: 140, height: 15, top: 20, left: 20, title: 'hiprint插件手动添加text', textAlign: 'center' } });
       // this.tableSelection = this.$refs.table.selection;
       if (!type) {
         getDetail(this.tableSelection)
@@ -474,7 +381,8 @@ export default {
         this.queryItem = row;
         getDetail(row.id)
       }
-      this.$refs.preView.show(this.hiprintTemplate, detailArr)
+      hiprintTemplate.print({});
+      // this.$refs.preView.show(this.hiprintTemplate, detailArr)
 
     },
   },

+ 7 - 0
src/views/supply/engin/commerce_list.vue

@@ -149,6 +149,12 @@
                 {{scope.row.enginOrderType | typeFilter}}
               </template>
             </el-table-column>
+            <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <CopyButton :copyText="scope.row.customerName" />
+                <span>{{ scope.row.customerName }}</span>
+              </template>
+            </el-table-column>
             <el-table-column align="left" label="使用单位" prop="refUseUnit" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="left" label="项目名称" prop="refProjectName" min-width="160" show-overflow-tooltip></el-table-column>
 <!--            <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="120" show-overflow-tooltip></el-table-column>-->
@@ -170,6 +176,7 @@
                 <span>{{scope.row.materialName}}</span>
               </template>
             </el-table-column>
+            
             <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
               <template slot-scope="scope">
                 <CopyButton :copyText="scope.row.specification" />

+ 1 - 1
src/views/supply/engin/components/engin_form.vue

@@ -535,7 +535,7 @@ export default {
       getDealerList({
         pageNum: 1,
         pageSize: -1,
-        bindUser: false
+        // bindUser: false
       }).then(res => {
         this.dealerList = res.data.records;
       })

+ 4 - 0
src/views/supply/engin/components/home_form.vue

@@ -1135,6 +1135,10 @@ export default {
               this.$errorMsg('请选择现金钱包');
               return;
             }
+            if(!this.goodsList[i].qty) {
+              this.$errorMsg('金额不能为0');
+              return;
+            }
           }
 
           let goodsList = JSON.parse(JSON.stringify(this.goodsList));

+ 9 - 1
src/views/supply/engin/home_list.vue

@@ -248,7 +248,15 @@
                 <span>{{ scope.row.customerName }}</span>
               </template>
             </el-table-column>
-
+            <el-table-column align="right" label="发货数量" prop="retiredQty" min-width="110" sortable show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{scope.row.retiredQty }}
+              </template>
+            </el-table-column><el-table-column align="right" label="退货数量" prop="refundableQty" min-width="110" sortable show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{scope.row.refundableQty }}
+              </template>
+            </el-table-column>
             <el-table-column align="left" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{scope.row.isDirectTransfer ? '是':'否'}}