ソースを参照

添加打印纸张类型

mxx 3 年 前
コミット
4fb5872c77

+ 9 - 3
public/static/weightCheck.html

@@ -22,7 +22,7 @@
         width: 1000px;
         padding: 30px 20px 20px 20px;
         font-size: 18px;
-        height: 65vh;
+        height: 90vh;
         /* position: absolute; */
         /*        top: 0;
         bottom: 0;
@@ -30,6 +30,10 @@
         right: 0; */
       }
 
+      .a5-content {
+        height: 130vh;
+      }
+
       table {
         width: 100%;
         text-align: center;
@@ -127,7 +131,7 @@
     <div id="app">
       <div v-if="selectPrint">
         <div v-for="(item,index) in tableData1" :key="index">
-          <div class="content">
+          <div class="content" :class="pageType=='A5'?'a5-content':''">
             <div class="title">{{item.compName}}</div>
             <div class="title">入库检斤单</div>
             <div class="number">{{item.number}}</div>
@@ -387,7 +391,8 @@
         selectPrint: false,
         name: "",
         bigContent: false,
-        smallContent: false
+        smallContent: false,
+        pageType: ''
       },
       computed: {},
       methods: {
@@ -419,6 +424,7 @@
       mounted() {
         let _data = decodeURIComponent(this.getQueryVariable("tableData"))
         let _type = decodeURIComponent(this.getQueryVariable("type"))
+        this.pageType = decodeURIComponent(this.getQueryVariable("radioType"))
         if (_type == 2) {
           this.bigContent = true
           this.smallContent = false

+ 124 - 21
src/views/houseSelfCollect/weighingManagement.vue

@@ -25,7 +25,7 @@
     </BaseHeaderLayout>
     <el-table :data="weighingList" style="width: 100%; margin-top: 20px" ref="weighingList" border height="600"
       @row-click="handleRowClick" @selection-change="handleSelectionChange">
-      <el-table-column :selectable="selectInit" type="selection" width="55"></el-table-column>
+      <el-table-column type="selection" width="55"></el-table-column>
       <el-table-column type="index" label="序号" width="50">
         <template scope="scope">
           <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
@@ -80,6 +80,28 @@
         :total="deptBudgetTotal">
       </el-pagination>
     </div>
+    <div class="mask" v-show="isShowPrintType"></div>
+    <div class="print-type" v-show="isShowPrintType">
+      <div class="print-type-content">
+        <div class="print-type-title">请选择打印纸张类型</div>
+        <div class="print-type-checkbox">
+          <el-radio-group v-model="radio">
+            <el-radio label="A4" class="label-width" @change="selectType">A4</el-radio>
+            <el-radio label="A5" class="label-width" @change="selectType">A5</el-radio>
+          </el-radio-group>
+          <!-- <el-checkbox-group v-model="ruleForm.type">
+            <el-checkbox label="打印身份证(正反面)" name="type" class="label-width" @change="selectType"></el-checkbox>
+            <el-checkbox label="打印银行卡(正反面)" name="type" class="label-width" @change="selectType"></el-checkbox>
+            <el-checkbox label="打印结算凭证" name="type" class="label-width" @change="selectType($event)"></el-checkbox>
+            <el-checkbox label="打印发票" name="type" class="label-width" @change="selectType($event)"></el-checkbox>
+          </el-checkbox-group> -->
+        </div>
+      </div>
+      <div class="bottom-btn">
+        <el-button @click="typePrintClick">确定</el-button>
+        <el-button @click="typePrintCannelClick">取消</el-button>
+      </div>
+    </div>
     <el-dialog width="70%" class="table-content" center :visible.sync="isShowPrint" title="粮食检斤单">
       <weightCheckPrint :tableData="dialogData"></weightCheckPrint>
       <div style="text-align:center">
@@ -132,6 +154,8 @@
         isShowPrintType: false,
         modification: [],
         jjSelectPrintList: [],
+        radio: 'A4',
+        isShowPrintType: false,
       }
     },
     activated() {
@@ -139,6 +163,24 @@
 
     },
     methods: {
+      selectType(val) {
+        console.log(val)
+        // for (let i = 0; i < this.ruleForm.type.length; i++) {
+        //   switch (this.ruleForm.type[i]) {
+        //     case '打印身份证(正反面)':
+        //       this.isShowPrintType1 = !this.isShowPrintType1
+        //       break
+        //     case '打印银行卡(正反面)':
+        //       this.isShowPrintType2 = !this.isShowPrintType2
+        //       break
+        //     case '打印结算凭证':
+        //       this.isShowPrintType3 = !this.isShowPrintType3
+        //     case '打印发票':
+        //       this.isShowPrintType4 = !this.isShowPrintType4
+        //       break
+        //   }
+        // }
+      },
       handleRowClick(row) {},
       handleSelectionChange(val) {
         this.modification = val
@@ -146,34 +188,38 @@
       printSmall() {
         window.open('../../../../static/weightCheck.html?type=1&tableData=' + JSON.stringify(this.dialogData))
       },
-      printBig(type) {
+      printBig(type, radioType) {
         if (type == 1) {
           sessionStorage.setItem('selectPrint_jjSelectPrintList', JSON.stringify(this.jjSelectPrintList))
-          window.open('../../../../static/weightCheck.html?type=2')
+          window.open('../../../../static/weightCheck.html?type=2&radioType=' + radioType)
         } else {
 
           window.open('../../../../static/weightCheck.html?type=2&tableData=' + JSON.stringify(this.dialogData))
         }
       },
-      print(row, type) {
+      typePrintClick() {
+        let index1 = 0;
+        for (let i = 0; i < this.modification.length; i++) {
+          getPrint({
+              id: this.modification[i].id
+            })
+            .toPromise()
+            .then((response) => {
+              index1++;
+              this.jjSelectPrintList.push(response)
+              if (index1 == this.modification.length) {
+                this.printBig(1, this.radio)
+              }
+            })
+            .catch((response) => {})
+        }
+      },
+      typePrintCannelClick() {
+        this.isShowPrintType = false
+      },
+      print(row, type, pageType) {
         if (type == 1) {
-          let index1 = 0;
-          for (let i = 0; i < this.modification.length; i++) {
-            getPrint({
-                id: this.modification[i].id
-              })
-              .toPromise()
-              .then((response) => {
-                index1++;
-                  this.jjSelectPrintList.push(response)
-                if (index1 == this.modification.length) {
-                  this.printBig(1)
-                }
-              })
-              .catch((response) => {
-                // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
-              })
-          }
+        this.isShowPrintType = true
         } else {
           getPrint({
               id: row.id
@@ -444,4 +490,61 @@
     margin-top: 50px;
     text-align: center;
   }
+
+  .mask {
+    background: black;
+    width: 100vw;
+    height: 100vh;
+    position: fixed;
+    top: 0;
+    z-index: 99;
+    opacity: 0.3;
+  }
+
+  .print-type-title {
+    text-align: center;
+    font-size: 18px;
+    margin: 20px;
+  }
+
+  .bottom-btn {
+    display: flex;
+    margin-top: 20px;
+    justify-content: space-around;
+  }
+
+  .print-type-checkbox {
+    // padding-left: 20px;
+  }
+
+  .print-type {
+    position: absolute;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    margin: auto;
+    width: 220px;
+    height: 160px;
+    background: white;
+    border-radius: 10px;
+    z-index: 999;
+  }
+/deep/.el-radio-group{
+  width: 100%;
+  display: flex;
+}
+/deep/.el-radio__label{
+  font-size: 20px;
+}
+/deep/.el-radio__inner{
+  // background: red;
+  height: 20px;
+  width: 20px;
+}
+  .label-width {
+    width: 100%;
+    text-align: center;
+    font-size: 20px;
+  }
 </style>