|  |  | @ -66,7 +66,6 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  |                     </el-form-item> |  |  |  |                     </el-form-item> | 
			
		
	
		
		
			
				
					
					|  |  |  |                 </el-col> |  |  |  |                 </el-col> | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 <el-col :span="3"> |  |  |  |                 <el-col :span="3"> | 
			
		
	
		
		
			
				
					
					|  |  |  |                     <div class="ao-text"> |  |  |  |                     <div class="ao-text"> | 
			
		
	
		
		
			
				
					
					|  |  |  |                         <span>当前分库:</span> |  |  |  |                         <span>当前分库:</span> | 
			
		
	
	
		
		
			
				
					|  |  | @ -91,7 +90,6 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  |                 </el-col> |  |  |  |                 </el-col> | 
			
		
	
		
		
			
				
					
					|  |  |  |             </el-row> |  |  |  |             </el-row> | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             <el-row :gutter="20"> |  |  |  |             <el-row :gutter="20"> | 
			
		
	
		
		
			
				
					
					|  |  |  |                 <el-col :span="3"> |  |  |  |                 <el-col :span="3"> | 
			
		
	
		
		
			
				
					
					|  |  |  |                     <div class="ao-text"> |  |  |  |                     <div class="ao-text"> | 
			
		
	
	
		
		
			
				
					|  |  | @ -103,6 +101,7 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  |                     > |  |  |  |                     > | 
			
		
	
		
		
			
				
					
					|  |  |  |                         <el-select v-model="formData.invSpaceCode" placeholder="当前货位信息" |  |  |  |                         <el-select v-model="formData.invSpaceCode" placeholder="当前货位信息" | 
			
		
	
		
		
			
				
					
					|  |  |  |                                    :disabled="codeArray.length>0" |  |  |  |                                    :disabled="codeArray.length>0" | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                    @change="invSpaceChange" | 
			
		
	
		
		
			
				
					
					|  |  |  |                                    clearable> |  |  |  |                                    clearable> | 
			
		
	
		
		
			
				
					
					|  |  |  |                             <el-option |  |  |  |                             <el-option | 
			
		
	
		
		
			
				
					
					|  |  |  |                                 v-for="item in spaceList" |  |  |  |                                 v-for="item in spaceList" | 
			
		
	
	
		
		
			
				
					|  |  | @ -293,7 +292,12 @@ import {isBlank} from "@/utils/strUtil"; | 
			
		
	
		
		
			
				
					
					|  |  |  | import {filterAllByUser} from "@/api/basic/invWarehouse"; |  |  |  | import {filterAllByUser} from "@/api/basic/invWarehouse"; | 
			
		
	
		
		
			
				
					
					|  |  |  | import {getSpaceCodeList} from "@/api/inventory/invSpace"; |  |  |  | import {getSpaceCodeList} from "@/api/inventory/invSpace"; | 
			
		
	
		
		
			
				
					
					|  |  |  | import {filterProducts} from "@/api/inventory/InvProducts"; |  |  |  | import {filterProducts} from "@/api/inventory/InvProducts"; | 
			
		
	
		
		
			
				
					
					|  |  |  | import {saveCountOrder, getCountOrderDetailList, deleteCountOrderDetail} from "@/api/inventory/invCountOrder"; |  |  |  | import { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     saveCountOrder, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     getCountOrderDetailList, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     deleteCountOrderDetail, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     addCountOrderDetail | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | } from "@/api/inventory/invCountOrder"; | 
			
		
	
		
		
			
				
					
					|  |  |  | import {getCountCodesList, deleteCode} from "@/api/inventory/invCountCodes"; |  |  |  | import {getCountCodesList, deleteCode} from "@/api/inventory/invCountCodes"; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -351,11 +355,17 @@ export default { | 
			
		
	
		
		
			
				
					
					|  |  |  |             }, |  |  |  |             }, | 
			
		
	
		
		
			
				
					
					|  |  |  |             productList: [], |  |  |  |             productList: [], | 
			
		
	
		
		
			
				
					
					|  |  |  |             scanText: "扫码录入:", |  |  |  |             scanText: "扫码录入:", | 
			
		
	
		
		
			
				
					
					|  |  |  |             codesList: [] |  |  |  |             codesList: [], | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             detailQuery: { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 orderId: null, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 page: 1, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 limit: 10 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             }, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             detailTotal: 0 | 
			
		
	
		
		
			
				
					
					|  |  |  |         }; |  |  |  |         }; | 
			
		
	
		
		
			
				
					
					|  |  |  |     }, |  |  |  |     }, | 
			
		
	
		
		
			
				
					
					|  |  |  |     methods: { |  |  |  |     methods: { | 
			
		
	
		
		
			
				
					
					|  |  |  |         saveOrder() { |  |  |  |         saveOrder(type) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             this.$refs['dataForm'].validate((valid) => { |  |  |  |             this.$refs['dataForm'].validate((valid) => { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 if (valid) { |  |  |  |                 if (valid) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                     if (this.codeArray.length === 0) { |  |  |  |                     if (this.codeArray.length === 0) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -363,25 +373,37 @@ export default { | 
			
		
	
		
		
			
				
					
					|  |  |  |                         return; |  |  |  |                         return; | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |                     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                     let invProductList = []; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     this.codeArray.forEach(product => { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                         invProductList.push(product); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     }); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     let orderData = { |  |  |  |                     let orderData = { | 
			
		
	
		
		
			
				
					
					|  |  |  |                         invCountOrder: { |  |  |  |                         invCountOrder: { | 
			
		
	
		
		
			
				
					
					|  |  |  |                             createTime: this.formData.billDate, |  |  |  |                             createTime: this.formData.billDate, | 
			
		
	
		
		
			
				
					
					|  |  |  |                             invStorageCode: this.formData.locStorageCode, |  |  |  |                             invStorageCode: this.formData.locStorageCode, | 
			
		
	
		
		
			
				
					
					|  |  |  |                             invWarehouseCode: this.formData.invWarehouseCode, |  |  |  |                             invWarehouseCode: this.formData.invWarehouseCode, | 
			
		
	
		
		
			
				
					
					|  |  |  |                             invSpaceCode: this.formData.invSpaceCode |  |  |  |                             invSpaceCode: this.formData.invSpaceCode | 
			
		
	
		
		
			
				
					
					|  |  |  |                         }, |  |  |  |                         } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         invProductList: invProductList |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                     }; |  |  |  |                     }; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |                     saveCountOrder(orderData).then((res) => { |  |  |  |                     saveCountOrder(orderData).then((res) => { | 
			
		
	
		
		
			
				
					
					|  |  |  |                         if (res.code === 20000) { |  |  |  |                         if (res.code === 20000) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             this.formData.orderId = res.data; | 
			
		
	
		
		
			
				
					
					|  |  |  |                             this.$message.success("保存成功"); |  |  |  |                             this.$message.success("保存成功"); | 
			
		
	
		
		
			
				
					
					|  |  |  |                             this.closeDialog(); |  |  |  |                             if (type != null) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 //保存当前单据详情 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 let product = this.codeArray[0]; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 let detailData = { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                     orderIdFk: this.formData.orderId, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                     product: product.id, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                     batchNo: product.batchNo, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                     produceDate: product.produceDate, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                     expireDate: product.expireDate | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 }; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 addCountOrderDetail(detailData).then((result) => { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                     if (result.code === 20000) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                         this.getCountOrderDetail(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 }); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                                 this.closeDialog(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                             } | 
			
		
	
		
		
			
				
					
					|  |  |  |                         } else { |  |  |  |                         } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |                             this.$message.error(res.data.message); |  |  |  |                             this.$message.error(res.data.message); | 
			
		
	
		
		
			
				
					
					|  |  |  |                         } |  |  |  |                         } | 
			
		
	
	
		
		
			
				
					|  |  | @ -414,6 +436,9 @@ export default { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 this.spaceList = res.data || []; |  |  |  |                 this.spaceList = res.data || []; | 
			
		
	
		
		
			
				
					
					|  |  |  |             }); |  |  |  |             }); | 
			
		
	
		
		
			
				
					
					|  |  |  |         }, |  |  |  |         }, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         invSpaceChange() { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             this.$forceUpdate(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         }, | 
			
		
	
		
		
			
				
					
					|  |  |  |         selectProductFunction() { |  |  |  |         selectProductFunction() { | 
			
		
	
		
		
			
				
					
					|  |  |  |             if (isBlank(this.formData.locStorageCode) || isBlank(this.formData.invWarehouseCode)) { |  |  |  |             if (isBlank(this.formData.locStorageCode) || isBlank(this.formData.invWarehouseCode)) { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 this.$message.warning("请先选择当前仓库货位信息"); |  |  |  |                 this.$message.warning("请先选择当前仓库货位信息"); | 
			
		
	
	
		
		
			
				
					|  |  | @ -458,20 +483,10 @@ export default { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 this.$message.warning("请选择产品"); |  |  |  |                 this.$message.warning("请选择产品"); | 
			
		
	
		
		
			
				
					
					|  |  |  |                 return; |  |  |  |                 return; | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |             selection.forEach(product => { |  |  |  |             if (this.codeArray === 0) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 let data = { |  |  |  |                 //添加第一个产品,先保存单据,再添加单据详情 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     productName: product.cpmctymc, |  |  |  |                 this.saveOrder(1); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     relIdFk: product.relIdFk, |  |  |  |             } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     spce: product.ggxh, |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     batchNo: product.batchNo, |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     productDate: product.productionDate, |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     expireDate: product.expireDate, |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     zczbhhzbapzbh: null, |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     ylqxzcrbarmc: null, |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     invCount: product.inCount - product.outCount |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 }; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 this.codeArray.push(data); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             }); |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             this.selectInvProductVisible = false; |  |  |  |             this.selectInvProductVisible = false; | 
			
		
	
		
		
			
				
					
					|  |  |  |         }, |  |  |  |         }, | 
			
		
	
		
		
			
				
					
					|  |  |  |         deleteOrderDetail(index, row) { |  |  |  |         deleteOrderDetail(index, row) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -489,7 +504,7 @@ export default { | 
			
		
	
		
		
			
				
					
					|  |  |  |                         } |  |  |  |                         } | 
			
		
	
		
		
			
				
					
					|  |  |  |                         getCountOrderDetailList(detailParam).then((result) => { |  |  |  |                         getCountOrderDetailList(detailParam).then((result) => { | 
			
		
	
		
		
			
				
					
					|  |  |  |                             this.codeArray = result.data.list || []; |  |  |  |                             this.codeArray = result.data.list || []; | 
			
		
	
		
		
			
				
					
					|  |  |  |                         }) |  |  |  |                         }); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                     } else { |  |  |  |                     } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |                         this.$message.error(res.data); |  |  |  |                         this.$message.error(res.data); | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |                     } | 
			
		
	
	
		
		
			
				
					|  |  | @ -502,9 +517,21 @@ export default { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 productId: row.productId |  |  |  |                 productId: row.productId | 
			
		
	
		
		
			
				
					
					|  |  |  |             }; |  |  |  |             }; | 
			
		
	
		
		
			
				
					
					|  |  |  |             getCountCodesList(params).then((res) => { |  |  |  |             getCountCodesList(params).then((res) => { | 
			
		
	
		
		
			
				
					
					|  |  |  |                 this.codesList = res.data.list; |  |  |  |                 this.codesList = res.data.list || []; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             }); |  |  |  |             }); | 
			
		
	
		
		
			
				
					
					|  |  |  |         }, |  |  |  |         }, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         getInputFocus(event) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             event.currentTarget.select(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         }, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         getCountOrderDetail() { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             this.detailQuery.orderId = this.formData.orderId; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             getCountOrderDetailList(this.detailQuery).then((res) => { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 if (res.code === 20000) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     this.codeArray = res.data.list || []; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                     this.detailTotal = res.data.total || 0; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             }) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |     }, |  |  |  |     }, | 
			
		
	
		
		
			
				
					
					|  |  |  |     created() { |  |  |  |     created() { | 
			
		
	
		
		
			
				
					
					|  |  |  |         this.getStorage(); |  |  |  |         this.getStorage(); | 
			
		
	
	
		
		
			
				
					|  |  | 
 |