|
|
|
@ -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">
|
|
|
|
@ -64,7 +64,7 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="7">
|
|
|
|
|
<el-form-item prop="price">
|
|
|
|
|
<el-input v-model="codeDetail.serialNo" auto-complete="off"></el-input>
|
|
|
|
|
<el-input v-model="editData.serialNo" auto-complete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
@ -108,17 +108,19 @@ export default {
|
|
|
|
|
type: Object,
|
|
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
editData: null
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
saveCode() {
|
|
|
|
|
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);
|
|
|
|
@ -132,7 +134,7 @@ export default {
|
|
|
|
|
this.closeCodeDialog();
|
|
|
|
|
},
|
|
|
|
|
findByCode() {
|
|
|
|
|
let query = {udiCode: this.codeDetail.code};
|
|
|
|
|
let query = {udiCode: this.editData.code};
|
|
|
|
|
findByCode(query)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.code === 20000) {
|
|
|
|
@ -145,7 +147,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
|
|
|
|
|
this.editData = JSON.parse(JSON.stringify(this.codeDetail));
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|