Forráskód Böngészése

入库审核、店内调出 详情 打印预览

chenrui 4 éve
szülő
commit
06379dfd79

+ 8 - 0
src/api/receiving.js

@@ -53,3 +53,11 @@ export const receivingDetailList = (params) => {
     method: 'post'
   })
 }
+// 入库审核 详情  打印
+export const receivingDetailPrint = params => {
+  return axios.request({
+    url: `receiving/print/${params.sn}/${params.type}`,
+    method: 'get',
+    responseType: 'blob'
+  })
+}

+ 8 - 0
src/api/storeCallOut.js

@@ -99,3 +99,11 @@ export const storeCallOutDetailDel = (params) => {
     method: 'post'
   })
 }
+// 散件采购(入库) 详情  打印
+export const storeCallOutDetailPrint = params => {
+  return axios.request({
+    url: `storeCallOut/print/${params.sn}/${params.type}/${params.costFlag}`,
+    method: 'get',
+    responseType: 'blob'
+  })
+}

+ 32 - 4
src/views/allocationManagement/storeTransferOut/detail.vue

@@ -14,8 +14,13 @@
       </template>
       <!-- 操作区,位于 title 行的行尾 -->
       <template slot="extra">
-        <a-button key="2" id="storeTransferOutDetail-preview-btn">打印预览</a-button>
-        <a-button key="1" type="primary" id="storeTransferOutDetail-print-btn">快速打印</a-button>
+        <a-checkbox key="4" v-model="printCostChecked">打印成本</a-checkbox>
+        <a-radio-group key="3" v-model="printerType">
+          <a-radio value="INK">针式</a-radio>
+          <a-radio value="NEEDLE">喷墨</a-radio>
+        </a-radio-group>
+        <a-button key="2" id="storeTransferOutDetail-preview-btn" @click="handlePrint('preview')">打印预览</a-button>
+        <a-button key="1" type="primary" id="storeTransferOutDetail-print-btn" @click="handlePrint('print')">快捷打印</a-button>
       </template>
     </a-page-header>
     <a-card size="small" :bordered="false" class="storeTransferOutDetail-cont">
@@ -49,13 +54,15 @@
         bordered>
       </s-table>
     </a-card>
+    <!-- 打印 -->
+    <div id="print"></div>
   </div>
 </template>
 
 <script>
 import { STable, VSelect } from '@/components'
 import { getOperationalPrecision } from '@/libs/tools.js'
-import { storeCallOutDetailList, storeCallOutDetailCount, storeCallOutDetailSn } from '@/api/storeCallOut'
+import { storeCallOutDetailList, storeCallOutDetailCount, storeCallOutDetailSn, storeCallOutDetailPrint } from '@/api/storeCallOut'
 export default {
   components: { STable, VSelect },
   data () {
@@ -85,7 +92,9 @@ export default {
         })
       },
       basicInfoData: null, //  基本信息
-      productTotal: null //  合计
+      productTotal: null, //  合计
+      printerType: 'INK', //  打印机类型
+      printCostChecked: true //  打印成本
     }
   },
   computed: {
@@ -98,6 +107,25 @@ export default {
     handleBack () {
       this.$router.push({ path: '/allocationManagement/storeTransferOut/list' })
     },
+    // 打印预览/快捷打印
+    handlePrint (type) {
+      storeCallOutDetailPrint({ sn: this.$route.params.sn, type: this.printerType, costFlag: this.printCostChecked ? '1' : '0' }).then(res => {
+        this.print(res, type)
+      })
+    },
+    print (data, type) {
+      if (!data) {
+        return
+      }
+      const url = window.URL.createObjectURL(new Blob([data], { type: 'application/pdf' }))
+      document.getElementById('print').innerHTML = '<iframe id="printf" name="printf" src="' + url + '" hidden></iframe>'
+      if (type == 'preview') { //  预览
+        window.open(url)
+      } else if (type == 'print') { //  打印
+        window.frames['printf'].focus()
+        window.frames['printf'].print()
+      }
+    },
     // 基本信息
     getDetail () {
       storeCallOutDetailSn({ sn: this.$route.params.sn }).then(res => {

+ 1 - 1
src/views/bulkManagement/bulkWarehousingOrder/detail.vue

@@ -88,7 +88,7 @@
         </a-collapse-panel>
       </a-collapse>
     </a-card> -->
-    <!-- 打印入库单 -->
+    <!-- 打印 -->
     <div id="print"></div>
   </div>
 </template>

+ 30 - 4
src/views/financialManagement/warehousingAudit/detail.vue

@@ -8,8 +8,12 @@
       </template>
       <!-- 操作区,位于 title 行的行尾 -->
       <template slot="extra">
-        <a-button key="2" id="warehousingAuditDetail-preview-btn">打印预览</a-button>
-        <a-button key="1" type="primary" id="warehousingAuditDetail-print-btn">快速打印</a-button>
+        <a-radio-group key="3" v-model="printerType">
+          <a-radio value="INK">针式</a-radio>
+          <a-radio value="NEEDLE">喷墨</a-radio>
+        </a-radio-group>
+        <a-button key="2" id="warehousingAuditDetail-preview-btn" @click="handlePrint('preview')">打印预览</a-button>
+        <a-button key="1" type="primary" id="warehousingAuditDetail-print-btn" @click="handlePrint('print')">快捷打印</a-button>
       </template>
     </a-page-header>
     <!-- 基础信息 -->
@@ -50,12 +54,14 @@
         </a-collapse-panel>
       </a-collapse>
     </a-card>
+    <!-- 打印 -->
+    <div id="print"></div>
   </div>
 </template>
 
 <script>
 import { STable, VSelect } from '@/components'
-import { receivingDetailList, receivingDetailSn } from '@/api/receiving'
+import { receivingDetailList, receivingDetailSn, receivingDetailPrint } from '@/api/receiving'
 export default {
   components: { STable, VSelect },
   data () {
@@ -87,7 +93,8 @@ export default {
           return data
         })
       },
-      basicInfoData: null //  基本信息
+      basicInfoData: null, //  基本信息
+      printerType: 'INK' //  打印机类型
     }
   },
   methods: {
@@ -95,6 +102,25 @@ export default {
     handleBack () {
       this.$router.push({ path: '/financialManagement/warehousingAudit/list' })
     },
+    // 打印预览/快捷打印
+    handlePrint (type) {
+      receivingDetailPrint({ sn: this.$route.params.sn, type: this.printerType }).then(res => {
+        this.print(res, type)
+      })
+    },
+    print (data, type) {
+      if (!data) {
+        return
+      }
+      const url = window.URL.createObjectURL(new Blob([data], { type: 'application/pdf' }))
+      document.getElementById('print').innerHTML = '<iframe id="printf" name="printf" src="' + url + '" hidden></iframe>'
+      if (type == 'preview') { //  预览
+        window.open(url)
+      } else if (type == 'print') { //  打印
+        window.frames['printf'].focus()
+        window.frames['printf'].print()
+      }
+    },
     getDetail () {
       receivingDetailSn({ sn: this.$route.params.sn }).then(res => {
         if (res.status == 200) {

+ 4 - 4
src/views/salesManagement/salesQuery/queryPart.vue

@@ -215,7 +215,7 @@ export default {
         productName: '', //  产品名称
         productOrigCode: '', //  原厂编码
         vinNo: '',
-        productCodeList: '', //  车架号
+        productCodeList: undefined, //  车架号
         brandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
@@ -303,11 +303,11 @@ export default {
           if (res.status == 200) {
             this.queryParam.productCodeList = res.data
           } else {
-            this.queryParam.productCodeList = ''
+            this.queryParam.productCodeList = undefined
           }
         })
       } else {
-        this.queryParam.productCodeList = ''
+        this.queryParam.productCodeList = undefined
       }
     },
     // 设置列
@@ -353,7 +353,7 @@ export default {
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
       this.queryParam.warehouseSn = undefined
-      this.queryParam.productCodeList = ''
+      this.queryParam.productCodeList = undefined
       this.queryParam.vinNo = ''
       this.productType = []
       this.$refs.table.refresh(true)