|  |  |  | @ -10,15 +10,15 @@ | 
			
		
	
		
			
				
					|  |  |  |  |       <!--</div>--> | 
			
		
	
		
			
				
					|  |  |  |  |       <el-descriptions title="产品信息" :column="2" border style="margin-top: 5px"> | 
			
		
	
		
			
				
					|  |  |  |  |         <el-descriptions-item label="UDI码" v-if="destroyType == 2"> | 
			
		
	
		
			
				
					|  |  |  |  |           {{prescribeData.code}} | 
			
		
	
		
			
				
					|  |  |  |  |           {{ prescribeData.code }} | 
			
		
	
		
			
				
					|  |  |  |  |         </el-descriptions-item> | 
			
		
	
		
			
				
					|  |  |  |  |         <el-descriptions-item label="产品名称" >{{ prescribeData.cpmctymc }}</el-descriptions-item> | 
			
		
	
		
			
				
					|  |  |  |  |         <el-descriptions-item label="产品名称">{{ prescribeData.cpmctymc }}</el-descriptions-item> | 
			
		
	
		
			
				
					|  |  |  |  |         <el-descriptions-item label="产品标识">{{ prescribeData.nameCode }}</el-descriptions-item> | 
			
		
	
		
			
				
					|  |  |  |  |         <el-descriptions-item label="产品规格">{{ prescribeData.ggxh }}</el-descriptions-item> | 
			
		
	
		
			
				
					|  |  |  |  |         <el-descriptions-item label="批次号">{{ prescribeData.batchNo }}</el-descriptions-item> | 
			
		
	
		
			
				
					|  |  |  |  |         <el-descriptions-item label="计量单位">{{ prescribeData.measname }}</el-descriptions-item> | 
			
		
	
		
			
				
					|  |  |  |  |         <el-descriptions-item label="剩余数量" custom-style class="custom-label"> | 
			
		
	
		
			
				
					|  |  |  |  |           <el-tag size="small">{{prescribeData.reCount}}</el-tag> | 
			
		
	
		
			
				
					|  |  |  |  |           <el-tag size="small">{{ prescribeData.reCount }}</el-tag> | 
			
		
	
		
			
				
					|  |  |  |  |           <!--<el-tag type="danger">{{ prescribeData.reCount}}</el-tag>--> | 
			
		
	
		
			
				
					|  |  |  |  |         </el-descriptions-item> | 
			
		
	
		
			
				
					|  |  |  |  |         <el-descriptions-item label="生产日期">{{ produceDate }}</el-descriptions-item> | 
			
		
	
	
		
			
				
					|  |  |  | @ -29,11 +29,13 @@ | 
			
		
	
		
			
				
					|  |  |  |  |       </el-descriptions> | 
			
		
	
		
			
				
					|  |  |  |  |       <!--<el-button type="primary" icon="el-icon-plus" sty>提交</el-button>--> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |       <el-form :inline="true" :model="formData" class="demo-form-inline" style="margin-top: 30px" :rules="rules" ref="formRef"> | 
			
		
	
		
			
				
					|  |  |  |  |       <el-form :inline="true" :model="formData" class="demo-form-inline" style="margin-top: 30px" :rules="rules" | 
			
		
	
		
			
				
					|  |  |  |  |                ref="formRef"> | 
			
		
	
		
			
				
					|  |  |  |  |         <el-row :gutter="24"> | 
			
		
	
		
			
				
					|  |  |  |  |           <el-col :span="10"> | 
			
		
	
		
			
				
					|  |  |  |  |             <el-form-item label="损耗出库数量" prop="count"> | 
			
		
	
		
			
				
					|  |  |  |  |             <el-input v-model.number="formData.count" placeholder="请填写损耗出库数量" type="number" :min="1" @input="checkCount"></el-input> | 
			
		
	
		
			
				
					|  |  |  |  |               <el-input v-model.number="formData.count" placeholder="请填写损耗出库数量" type="number" :min="1" | 
			
		
	
		
			
				
					|  |  |  |  |                         @input="checkCount"></el-input> | 
			
		
	
		
			
				
					|  |  |  |  |               <!--<span v-if="countExceeded" class="exceeded-message">损耗出库数量不能超过10个</span>--> | 
			
		
	
		
			
				
					|  |  |  |  |             </el-form-item> | 
			
		
	
		
			
				
					|  |  |  |  |           </el-col> | 
			
		
	
	
		
			
				
					|  |  |  | @ -58,7 +60,7 @@ | 
			
		
	
		
			
				
					|  |  |  |  | </template> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | <script> | 
			
		
	
		
			
				
					|  |  |  |  | import { destroyOut, destroyOutByCode } from '@/api/collect/IoDestroy' | 
			
		
	
		
			
				
					|  |  |  |  | import {destroyOut, destroyOutByCode, destroySplitOut} from '@/api/collect/IoDestroy' | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | export default { | 
			
		
	
		
			
				
					|  |  |  |  |   name: 'destroyOutDialog', | 
			
		
	
	
		
			
				
					|  |  |  | @ -78,22 +80,22 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |  |   }, | 
			
		
	
		
			
				
					|  |  |  |  |   data() { | 
			
		
	
		
			
				
					|  |  |  |  |     return { | 
			
		
	
		
			
				
					|  |  |  |  |       formData:{}, | 
			
		
	
		
			
				
					|  |  |  |  |       formData: {}, | 
			
		
	
		
			
				
					|  |  |  |  |       produceDate: null, | 
			
		
	
		
			
				
					|  |  |  |  |       expireDate: null, | 
			
		
	
		
			
				
					|  |  |  |  |       saveLoading: false, | 
			
		
	
		
			
				
					|  |  |  |  |       rules: { | 
			
		
	
		
			
				
					|  |  |  |  |         count: [ | 
			
		
	
		
			
				
					|  |  |  |  |           { validator: this.validateCount,message: '损耗出库数量不能超出剩余数量',trigger: 'blur' } | 
			
		
	
		
			
				
					|  |  |  |  |           {validator: this.validateCount, message: '损耗出库数量不能超出剩余数量', trigger: 'blur'} | 
			
		
	
		
			
				
					|  |  |  |  |         ] | 
			
		
	
		
			
				
					|  |  |  |  |       }, | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  |   }, | 
			
		
	
		
			
				
					|  |  |  |  |   methods: { | 
			
		
	
		
			
				
					|  |  |  |  |     conversionDate(dateString){ | 
			
		
	
		
			
				
					|  |  |  |  |     conversionDate(dateString) { | 
			
		
	
		
			
				
					|  |  |  |  |       const parts = dateString.split(''); | 
			
		
	
		
			
				
					|  |  |  |  |       const year =  '20' + parts.slice(0, 2).join('') ; | 
			
		
	
		
			
				
					|  |  |  |  |       const year = '20' + parts.slice(0, 2).join(''); | 
			
		
	
		
			
				
					|  |  |  |  |       const month = parts[2] + parts[3]; | 
			
		
	
		
			
				
					|  |  |  |  |       const day = parts[4] + parts[5]; | 
			
		
	
		
			
				
					|  |  |  |  |       return `${year}-${month}-${day}`; | 
			
		
	
	
		
			
				
					|  |  |  | @ -109,13 +111,13 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |  |       // 这里可以调用表单验证方法 | 
			
		
	
		
			
				
					|  |  |  |  |       this.$refs.formRef.validateField('count'); | 
			
		
	
		
			
				
					|  |  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |  |     closeAddDialog(){ | 
			
		
	
		
			
				
					|  |  |  |  |     closeAddDialog() { | 
			
		
	
		
			
				
					|  |  |  |  |       this.closeDialog() | 
			
		
	
		
			
				
					|  |  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     //损耗出库 | 
			
		
	
		
			
				
					|  |  |  |  |     destroyOutOrder(){ | 
			
		
	
		
			
				
					|  |  |  |  |       if ( this.formData.count == null){ | 
			
		
	
		
			
				
					|  |  |  |  |     destroyOutOrder() { | 
			
		
	
		
			
				
					|  |  |  |  |       if (this.formData.count == null) { | 
			
		
	
		
			
				
					|  |  |  |  |         return this.$message.error("请输入损耗数量") | 
			
		
	
		
			
				
					|  |  |  |  |       } | 
			
		
	
		
			
				
					|  |  |  |  |       let query = { | 
			
		
	
	
		
			
				
					|  |  |  | @ -123,32 +125,34 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |  |         remark: this.formData.remark, | 
			
		
	
		
			
				
					|  |  |  |  |         updateUser: this.$store.getters.adminId, | 
			
		
	
		
			
				
					|  |  |  |  |         createUser: this.$store.getters.adminId, | 
			
		
	
		
			
				
					|  |  |  |  |         splitFifoInv : this.prescribeData, | 
			
		
	
		
			
				
					|  |  |  |  |         code:this.prescribeData.code, | 
			
		
	
		
			
				
					|  |  |  |  |         splitFifoInv: this.prescribeData, | 
			
		
	
		
			
				
					|  |  |  |  |         code: this.prescribeData.code, | 
			
		
	
		
			
				
					|  |  |  |  |       } | 
			
		
	
		
			
				
					|  |  |  |  |       if (this.destroyType == 1){ | 
			
		
	
		
			
				
					|  |  |  |  |       if (this.destroyType == 1) { | 
			
		
	
		
			
				
					|  |  |  |  |         destroyOut(query).then(res => { | 
			
		
	
		
			
				
					|  |  |  |  |           if (res.code == 20000){ | 
			
		
	
		
			
				
					|  |  |  |  |           if (res.code == 20000) { | 
			
		
	
		
			
				
					|  |  |  |  |             this.closeDialog() | 
			
		
	
		
			
				
					|  |  |  |  |             return this.$message.success("损耗出库成功") | 
			
		
	
		
			
				
					|  |  |  |  |           }else { | 
			
		
	
		
			
				
					|  |  |  |  |           } else { | 
			
		
	
		
			
				
					|  |  |  |  |             return this.$message.error(res.message) | 
			
		
	
		
			
				
					|  |  |  |  |           } | 
			
		
	
		
			
				
					|  |  |  |  |         }) | 
			
		
	
		
			
				
					|  |  |  |  |       }else { | 
			
		
	
		
			
				
					|  |  |  |  |         destroyOutByCode(query).then(res => { | 
			
		
	
		
			
				
					|  |  |  |  |           if (res.code == 20000){ | 
			
		
	
		
			
				
					|  |  |  |  |       } else if (this.destroyType == 1) { | 
			
		
	
		
			
				
					|  |  |  |  |         destroySplitOut(query).then(res => { | 
			
		
	
		
			
				
					|  |  |  |  |           if (res.code == 20000) { | 
			
		
	
		
			
				
					|  |  |  |  |             this.closeDialog() | 
			
		
	
		
			
				
					|  |  |  |  |             return this.$message.success("损耗出库成功") | 
			
		
	
		
			
				
					|  |  |  |  |           }else { | 
			
		
	
		
			
				
					|  |  |  |  |           } else { | 
			
		
	
		
			
				
					|  |  |  |  |             return this.$message.error("损耗出库失败") | 
			
		
	
		
			
				
					|  |  |  |  |           } | 
			
		
	
		
			
				
					|  |  |  |  |         }) | 
			
		
	
		
			
				
					|  |  |  |  |       } else if (this.destroyType == 3) { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |       } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |  |     destroyOutByCodeOrder(){ | 
			
		
	
		
			
				
					|  |  |  |  |       if ( this.formData.count == null){ | 
			
		
	
		
			
				
					|  |  |  |  |     destroyOutByCodeOrder() { | 
			
		
	
		
			
				
					|  |  |  |  |       if (this.formData.count == null) { | 
			
		
	
		
			
				
					|  |  |  |  |         return this.$message.error("请输入损耗数量") | 
			
		
	
		
			
				
					|  |  |  |  |       } | 
			
		
	
		
			
				
					|  |  |  |  |       let query = { | 
			
		
	
	
		
			
				
					|  |  |  | @ -156,21 +160,21 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |  |         remark: this.formData.remark, | 
			
		
	
		
			
				
					|  |  |  |  |         updateUser: this.$store.getters.adminId, | 
			
		
	
		
			
				
					|  |  |  |  |         createUser: this.$store.getters.adminId, | 
			
		
	
		
			
				
					|  |  |  |  |         splitFifoInv : this.prescribeData, | 
			
		
	
		
			
				
					|  |  |  |  |         code:this.formData.code, | 
			
		
	
		
			
				
					|  |  |  |  |         splitFifoInv: this.prescribeData, | 
			
		
	
		
			
				
					|  |  |  |  |         code: this.formData.code, | 
			
		
	
		
			
				
					|  |  |  |  |       } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |   }, | 
			
		
	
		
			
				
					|  |  |  |  |   created() { | 
			
		
	
		
			
				
					|  |  |  |  |     if (this.prescribeData.produceDate != null){ | 
			
		
	
		
			
				
					|  |  |  |  |     if (this.prescribeData.produceDate != null) { | 
			
		
	
		
			
				
					|  |  |  |  |       this.produceDate = this.conversionDate(this.prescribeData.produceDate) | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  |     if (this.prescribeData.expireDate != null){ | 
			
		
	
		
			
				
					|  |  |  |  |     if (this.prescribeData.expireDate != null) { | 
			
		
	
		
			
				
					|  |  |  |  |       this.expireDate = this.conversionDate(this.prescribeData.expireDate) | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  |     if (this.destroyType == 2){ | 
			
		
	
		
			
				
					|  |  |  |  |     if (this.destroyType == 2) { | 
			
		
	
		
			
				
					|  |  |  |  |       this.prescribeData.reCount = this.prescribeData.totalCount | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  |   } | 
			
		
	
	
		
			
				
					|  |  |  | 
 |