| 
					
				 | 
			
			
				@@ -8,8 +8,20 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <!-- 操作区,位于 title 行的行尾 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <template v-if="$hasPermissions('B_transferOut_print')" slot="extra"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <a-button key="2" id="allocateBillEdit-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          <a-button key="1" type="primary" id="allocateBillEdit-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <a-button 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            key="2" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            type="primary" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            class="button-error" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            id="allocateBillEdit-db-print-btn" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :disabled="localDataSource.length==0" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @click="handlePrint('dbPrint')">调拨打印</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <a-button 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            key="1" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            type="primary" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            class="button-info" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            id="allocateBillEdit-dbfl-print-btn" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            :disabled="localDataSource.length==0" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @click="handlePrint('dbflPrint')">调拨分类打印</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </a-page-header> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <a-card size="small" :bordered="false" v-if="basicInfoData" class="allocateBillEdit-cont"> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -185,7 +197,9 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         style="padding: 0 60px;">提交</a-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <!-- 导入产品 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    <importGuideModal :openModal="openGuideModal" :params="{allocateSn: $route.params.sn}" @close="openGuideModal=false" @ok="hanldeOk" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <importGuideModal :openModal="openGuideModal" :params="{allocateSn: $route.params.sn}" @close="openGuideModal=false" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <!-- 打印导出 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <print-modal :openModal="openModal" :itemData="basicInfoData" :nowType="nowType" @ok="handleOk" @close="openModal=false" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <!-- 打印 --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <div id="print"></div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   </div> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -194,13 +208,14 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <script> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { STable, VSelect } from '@/components' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import ImportGuideModal from './importGuideModal.vue' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import printModal from './printModal.vue' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { queryStockProductPage } from '@/api/stock' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { productPriceInfo } from '@/api/product' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import AllocateType from '@/views/common/allocateType.js' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { allocateBillSave, allocateBillDetailList, allocateBillDetailCount, allocateBillDetail, allocateBillDetailSave, allocateBillSubmit, allocateBillDetailDel, allocateBillDetailDelAll, allocateBillDetailPrint, allocateBillBatchInsert } from '@/api/allocateBill' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  components: { STable, VSelect, ImportGuideModal, AllocateType }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  components: { STable, VSelect, ImportGuideModal, AllocateType, printModal }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   data () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     return { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       spinning: false, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -256,7 +271,9 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       productTotal: null, //  合计 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       basicInfoData: null, // 基本信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      openGuideModal: false //  导入产品引导 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      openGuideModal: false, //  导入产品引导 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      openModal: false, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      nowType: null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   computed: { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -493,9 +510,15 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // 打印预览/快捷打印 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     handlePrint (type) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.nowType = type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.openModal = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    handleOk (objs) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       const _this = this 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      const params = JSON.parse(JSON.stringify(objs)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      delete params.type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       _this.spinning = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      allocateBillDetailPrint({ sn: this.$route.params.sn, isPreview: type == 'preview' ? 1 : 0 }).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      allocateBillDetailPrint(params).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         _this.spinning = false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (res.type == 'application/json') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           var reader = new FileReader() 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -508,7 +531,7 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           reader.readAsText(res) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          this.print(res, type) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.print(res, objs.isPreview) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -518,9 +541,9 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       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') { //  预览 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (type == '1') { //  预览 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         window.open(url) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      } else if (type == 'print') { //  打印 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      } else if (type == '0') { //  打印 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         window.frames['printf'].focus() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         window.frames['printf'].print() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 |