lilei 2 năm trước cách đây
mục cha
commit
aa22cce961

+ 5 - 2
src/views/salesManagement/receiptPrint/list.vue

@@ -154,7 +154,7 @@
           :showFooter="false"
           :openModal="showTipModal"
           @cancel="showTipModal=false">
-          <printModel ref="printModel" @cancel="showTipModal=false"></printModel>
+          <printModel ref="printModel" @cancel="showTipModal=false" @printOk="printOk"></printModel>
         </commonModal>
 
         <!-- 打印记录 -->
@@ -286,6 +286,9 @@ export default {
         this.$refs.printModel.getData(row)
       })
     },
+    printOk () {
+      this.$refs.table.refresh()
+    },
     // 打印记录
     viewPrint (row) {
       this.showRecordModal = true
@@ -323,7 +326,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 270
+      this.tableHeight = window.innerHeight - tableSearchH - 228
     }
   },
   watch: {

+ 12 - 6
src/views/salesManagement/receiptPrint/printModel.vue

@@ -99,6 +99,8 @@ export default {
       // html, type, callback, printLogParams
       jGPrint(html, 'print', function (res) {
         _this.spinning = false
+        _this.handleCommonCancel()
+        _this.$emit('printOk')
       }, {
         billType: 'SETTLE_RECEIPT',
         billSn: this.detail.accountReceiptSn,
@@ -106,12 +108,16 @@ export default {
         printType: '收款打印'
       })
     },
-    getData (data) {
-      this.spinning = true
-      settleReceiptFindBySn({ sn: data.accountReceiptSn }).then(res => {
-        this.detail = res.data || null
-        this.spinning = false
-      })
+    getData (data, flag) {
+      if (!flag) {
+        this.spinning = true
+        settleReceiptFindBySn({ sn: data.accountReceiptSn }).then(res => {
+          this.detail = res.data || null
+          this.spinning = false
+        })
+      } else {
+        this.detail = data
+      }
     },
     handleCommonCancel () {
       this.$emit('cancel')

+ 23 - 1
src/views/salesManagement/salesCollection/voucherModal.vue

@@ -68,17 +68,31 @@
       </div>
       <div class="btn-box">
         <a-button @click="handleCommonCancel" v-if="isCancel">{{ cancelText }}</a-button>
+        <a-button :loading="spinning" type="primary" @click="handlePrint()">收款打印</a-button>
       </div>
+
+      <!-- 收款打印 -->
+      <commonModal
+        modalTit="收款打印"
+        bodyPadding="10px"
+        width="1024px"
+        :showFooter="false"
+        :openModal="showTipModal"
+        @cancel="showTipModal=false">
+        <printModel ref="printModel" @cancel="showTipModal=false"></printModel>
+      </commonModal>
     </a-spin>
   </a-modal>
 </template>
 
 <script>
 import { STable, VSelect } from '@/components'
+import commonModal from '@/views/common/commonModal.vue'
+import printModel from '../receiptPrint/printModel.vue'
 import { settleReceiptFindBySn } from '@/api/settleReceipt.js'
 export default {
   name: 'VoucherModal',
-  components: { STable, VSelect },
+  components: { STable, VSelect, commonModal, printModel },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -100,6 +114,7 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
+      showTipModal: false,
       disabled: false,
       spinning: false,
       detail: null,
@@ -126,6 +141,13 @@ export default {
         this.spinning = false
       })
     },
+    // 收款打印
+    handlePrint () {
+      this.showTipModal = true
+      this.$nextTick(() => {
+        this.$refs.printModel.getData(this.detail, true)
+      })
+    },
     // 删除
     handleDel (row) {