|  |  |  | @ -1,6 +1,6 @@ | 
			
		
	
		
			
				
					|  |  |  |  | <template> | 
			
		
	
		
			
				
					|  |  |  |  |     <div> | 
			
		
	
		
			
				
					|  |  |  |  |         <el-form :model="codeDetail" :rules="formRules" ref="dataForm"> | 
			
		
	
		
			
				
					|  |  |  |  |         <el-form :model="editData" :rules="formRules" ref="dataForm"> | 
			
		
	
		
			
				
					|  |  |  |  |             <el-row :gutter="20"> | 
			
		
	
		
			
				
					|  |  |  |  |                 <el-col :span="3"> | 
			
		
	
		
			
				
					|  |  |  |  |                     <div class="ao-text"> | 
			
		
	
	
		
			
				
					|  |  |  | @ -10,7 +10,7 @@ | 
			
		
	
		
			
				
					|  |  |  |  |                 <el-col :span="16"> | 
			
		
	
		
			
				
					|  |  |  |  |                     <el-form-item prop="code"> | 
			
		
	
		
			
				
					|  |  |  |  |                         <el-input | 
			
		
	
		
			
				
					|  |  |  |  |                             v-model="codeDetail.code" | 
			
		
	
		
			
				
					|  |  |  |  |                             v-model="editData.code" | 
			
		
	
		
			
				
					|  |  |  |  |                             clearable | 
			
		
	
		
			
				
					|  |  |  |  |                             disabled | 
			
		
	
		
			
				
					|  |  |  |  |                         ></el-input> | 
			
		
	
	
		
			
				
					|  |  |  | @ -25,7 +25,7 @@ | 
			
		
	
		
			
				
					|  |  |  |  |                 </el-col> | 
			
		
	
		
			
				
					|  |  |  |  |                 <el-col :span="7"> | 
			
		
	
		
			
				
					|  |  |  |  |                     <el-form-item prop="productDate"> | 
			
		
	
		
			
				
					|  |  |  |  |                         <el-input v-model="codeDetail.produceDate" auto-complete="off" | 
			
		
	
		
			
				
					|  |  |  |  |                         <el-input v-model="editData.produceDate" auto-complete="off" | 
			
		
	
		
			
				
					|  |  |  |  |                                   oninput="if(value.length>6)value=value.slice(0,6)" | 
			
		
	
		
			
				
					|  |  |  |  |                                   type="number" | 
			
		
	
		
			
				
					|  |  |  |  |                                   :disabled="false"></el-input> | 
			
		
	
	
		
			
				
					|  |  |  | @ -38,7 +38,7 @@ | 
			
		
	
		
			
				
					|  |  |  |  |                 </el-col> | 
			
		
	
		
			
				
					|  |  |  |  |                 <el-col :span="7"> | 
			
		
	
		
			
				
					|  |  |  |  |                     <el-form-item prop="expireDate"> | 
			
		
	
		
			
				
					|  |  |  |  |                         <el-input v-model="codeDetail.expireDate" auto-complete="off" | 
			
		
	
		
			
				
					|  |  |  |  |                         <el-input v-model="editData.expireDate" auto-complete="off" | 
			
		
	
		
			
				
					|  |  |  |  |                                   oninput="if(value.length>6)value=value.slice(0,6)" | 
			
		
	
		
			
				
					|  |  |  |  |                                   type="number" | 
			
		
	
		
			
				
					|  |  |  |  |                                   :disabled="false"></el-input> | 
			
		
	
	
		
			
				
					|  |  |  | @ -54,7 +54,7 @@ | 
			
		
	
		
			
				
					|  |  |  |  |                 </el-col> | 
			
		
	
		
			
				
					|  |  |  |  |                 <el-col :span="7"> | 
			
		
	
		
			
				
					|  |  |  |  |                     <el-form-item prop="batchNo"> | 
			
		
	
		
			
				
					|  |  |  |  |                         <el-input v-model="codeDetail.batchNo" auto-complete="off" :disabled="false"></el-input> | 
			
		
	
		
			
				
					|  |  |  |  |                         <el-input v-model="editData.batchNo" auto-complete="off" :disabled="false"></el-input> | 
			
		
	
		
			
				
					|  |  |  |  |                     </el-form-item> | 
			
		
	
		
			
				
					|  |  |  |  |                 </el-col> | 
			
		
	
		
			
				
					|  |  |  |  |                 <el-col :span="3"> | 
			
		
	
	
		
			
				
					|  |  |  | @ -63,8 +63,23 @@ | 
			
		
	
		
			
				
					|  |  |  |  |                     </div> | 
			
		
	
		
			
				
					|  |  |  |  |                 </el-col> | 
			
		
	
		
			
				
					|  |  |  |  |                 <el-col :span="7"> | 
			
		
	
		
			
				
					|  |  |  |  |                     <el-form-item prop="price"> | 
			
		
	
		
			
				
					|  |  |  |  |                         <el-input v-model="codeDetail.serialNo" auto-complete="off" :disabled="xlhEnable"></el-input> | 
			
		
	
		
			
				
					|  |  |  |  |                     <el-form-item prop="serialNo"> | 
			
		
	
		
			
				
					|  |  |  |  |                         <el-input v-model="editData.serialNo" auto-complete="off" :disabled="xlhEnable"></el-input> | 
			
		
	
		
			
				
					|  |  |  |  |                     </el-form-item> | 
			
		
	
		
			
				
					|  |  |  |  |                 </el-col> | 
			
		
	
		
			
				
					|  |  |  |  |             </el-row> | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |             <el-row :gutter="20"> | 
			
		
	
		
			
				
					|  |  |  |  |                 <el-col :span="3"> | 
			
		
	
		
			
				
					|  |  |  |  |                     <div class="ao-text"> | 
			
		
	
		
			
				
					|  |  |  |  |                         <span>数量:</span> | 
			
		
	
		
			
				
					|  |  |  |  |                     </div> | 
			
		
	
		
			
				
					|  |  |  |  |                 </el-col> | 
			
		
	
		
			
				
					|  |  |  |  |                 <el-col :span="7"> | 
			
		
	
		
			
				
					|  |  |  |  |                     <el-form-item prop="count"> | 
			
		
	
		
			
				
					|  |  |  |  |                         <el-input v-model="editData.count" auto-complete="off" | 
			
		
	
		
			
				
					|  |  |  |  |                                   type="number" | 
			
		
	
		
			
				
					|  |  |  |  |                                   :disabled="editData.serialNo!=null && editData.serialNo!='' "></el-input> | 
			
		
	
		
			
				
					|  |  |  |  |                     </el-form-item> | 
			
		
	
		
			
				
					|  |  |  |  |                 </el-col> | 
			
		
	
		
			
				
					|  |  |  |  |             </el-row> | 
			
		
	
	
		
			
				
					|  |  |  | @ -108,11 +123,12 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |  |             type: Object, | 
			
		
	
		
			
				
					|  |  |  |  |             required: true, | 
			
		
	
		
			
				
					|  |  |  |  |         }, | 
			
		
	
		
			
				
					|  |  |  |  |         editData: null | 
			
		
	
		
			
				
					|  |  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |  |     data() { | 
			
		
	
		
			
				
					|  |  |  |  |         return { | 
			
		
	
		
			
				
					|  |  |  |  |             xlhEnable: true, | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |             xlhEnable: false, | 
			
		
	
		
			
				
					|  |  |  |  |         }; | 
			
		
	
		
			
				
					|  |  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     methods: { | 
			
		
	
	
		
			
				
					|  |  |  | @ -120,11 +136,12 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |  |             if (this.editTye == 1) { | 
			
		
	
		
			
				
					|  |  |  |  |                 this.repeatAddCode(); | 
			
		
	
		
			
				
					|  |  |  |  |             } else { | 
			
		
	
		
			
				
					|  |  |  |  |                 saveCode(this.codeDetail) | 
			
		
	
		
			
				
					|  |  |  |  |                 saveCode(this.editData) | 
			
		
	
		
			
				
					|  |  |  |  |                     .then((response) => { | 
			
		
	
		
			
				
					|  |  |  |  |                         console.log(response) | 
			
		
	
		
			
				
					|  |  |  |  |                         if (response.code === 20000) { | 
			
		
	
		
			
				
					|  |  |  |  |                             this.$message.success("提交成功"); | 
			
		
	
		
			
				
					|  |  |  |  |                             this.codeDetail = this.editData; | 
			
		
	
		
			
				
					|  |  |  |  |                             this.closeCodeDialog(); | 
			
		
	
		
			
				
					|  |  |  |  |                         } else { | 
			
		
	
		
			
				
					|  |  |  |  |                             this.$message.error(response.message); | 
			
		
	
	
		
			
				
					|  |  |  | @ -133,14 +150,12 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |  |                     }); | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         , | 
			
		
	
		
			
				
					|  |  |  |  |         }, | 
			
		
	
		
			
				
					|  |  |  |  |         cancelDialog() { | 
			
		
	
		
			
				
					|  |  |  |  |             this.closeCodeDialog(); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         , | 
			
		
	
		
			
				
					|  |  |  |  |         }, | 
			
		
	
		
			
				
					|  |  |  |  |         findByCode() { | 
			
		
	
		
			
				
					|  |  |  |  |             let query = {udiCode: this.codeDetail.code}; | 
			
		
	
		
			
				
					|  |  |  |  |             let query = {udiCode: this.editData.code}; | 
			
		
	
		
			
				
					|  |  |  |  |             findByCode(query) | 
			
		
	
		
			
				
					|  |  |  |  |                 .then((response) => { | 
			
		
	
		
			
				
					|  |  |  |  |                     if (response.code === 20000) { | 
			
		
	
	
		
			
				
					|  |  |  | @ -152,8 +167,11 @@ export default { | 
			
		
	
		
			
				
					|  |  |  |  |                     this.loading = false; | 
			
		
	
		
			
				
					|  |  |  |  |                 }); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     }, | 
			
		
	
		
			
				
					|  |  |  |  |     created() { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         this.editData = JSON.parse(JSON.stringify(this.codeDetail)); | 
			
		
	
		
			
				
					|  |  |  |  |         this.findByCode(); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
	
		
			
				
					|  |  |  | 
 |