提交 b3b94605 编写于 作者: tao.wu's avatar tao.wu

有效期

上级 9d32f836
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
<el-input <el-input
type="textarea" type="textarea"
rows="4" rows="4"
size="small" size="small"
v-model="formData.goodsDescription" v-model="formData.goodsDescription"
placeholder="请输入商品介绍" placeholder="请输入商品介绍"
...@@ -111,7 +110,7 @@ ...@@ -111,7 +110,7 @@
<el-col :span="18"> <el-col :span="18">
<el-input <el-input
size="small" size="small"
v-model="formData1.barCode" v-model="formData.barCode"
placeholder="请输入条形码" placeholder="请输入条形码"
></el-input> ></el-input>
<span class="fast-opt" @click="fastInput(1)">快速录入</span> <span class="fast-opt" @click="fastInput(1)">快速录入</span>
...@@ -406,21 +405,21 @@ ...@@ -406,21 +405,21 @@
<el-col :span="18"> <el-col :span="18">
<el-input <el-input
size="small" size="small"
v-model="formData2.barCode" v-model="formData.barCode"
placeholder="请输入条形码" placeholder="请输入条形码"
></el-input> ></el-input>
<!-- <span class="fast-opt" @click="fastInput(2)">快速录入</span> <!-- <span class="fast-opt" @click="fastInput(2)">快速录入</span>
<span class="word-num">(点击可快速录入下面的药品信息)</span> --> <span class="word-num">(点击可快速录入下面的药品信息)</span> -->
</el-col> </el-col>
</el-form-item> </el-form-item>
<!-- <el-form-item label="检测登记表" prop="checkPackageId"> <el-form-item label="检测登记表" prop="checkPackageId">
<el-select <el-select
v-model="formData.checkPackageId" v-model="formData.checkPackageId"
placeholder="请选择" placeholder="请选择"
size="small" size="small"
> >
</el-select> </el-select>
</el-form-item> --> </el-form-item>
<el-form-item label="检测名称" prop="checkName"> <el-form-item label="检测名称" prop="checkName">
<el-col :span="13"> <el-col :span="13">
<el-input <el-input
...@@ -543,6 +542,7 @@ ...@@ -543,6 +542,7 @@
></el-input> ></el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="商品使用日期" prop="endTime" class="required-label"> <el-form-item label="商品使用日期" prop="endTime" class="required-label">
<el-date-picker <el-date-picker
v-model="formData2.endTime" v-model="formData2.endTime"
...@@ -553,6 +553,26 @@ ...@@ -553,6 +553,26 @@
format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="有效期" prop="expiredTime">
<el-col :span="13">
<el-input
size="small"
v-model="formData1.expiredTime"
placeholder="请输入有效期"
style="width:70%;"
></el-input>
<!-- <el-date-picker
v-model="formData.expiredTime"
size="small"
format="yyyy-MM-dd HH:mm:ss"
type="date"
placeholder="选择日期">
</el-date-picker> -->
<span class="word-num"></span>
</el-col>
</el-form-item>
<el-form-item label="检测说明" class="required-label"> <el-form-item label="检测说明" class="required-label">
<el-upload <el-upload
:file-list="goodsCheckList" :file-list="goodsCheckList"
...@@ -855,13 +875,9 @@ ...@@ -855,13 +875,9 @@
this.goodsId = id ; this.goodsId = id ;
// this.isMedic = this.formData.goodsType == 5 ? true : false // this.isMedic = this.formData.goodsType == 5 ? true : false
// this.isCheckServe = this.formData.goodsType == 337 ? true : false // this.isCheckServe = this.formData.goodsType == 337 ? true : false
if(goodsType == 5){
this.isMedic = true;
}else if(goodsType == 337){
this.isCheckServe = true;
}
if(goodsType == 337){ if(goodsType == 337){
this.isCheckServe = true;
const res = await getGoodDetails(id); const res = await getGoodDetails(id);
console.log(`========================>`, res); console.log(`========================>`, res);
...@@ -881,14 +897,11 @@ ...@@ -881,14 +897,11 @@
const { goodsInfo, medicalService } = res.data; const { goodsInfo, medicalService } = res.data;
this.formData1 = goodsInfo; this.formData1 = goodsInfo;
this.formData2 = medicalService; this.formData2 = medicalService;
// this.formData = Object.assign(goodsInfo, medicalService); // this.formData = { ...this.formData, ...goodsInfo, ...medicalService };
this.formData = { ...this.formData, ...goodsInfo, ...medicalService }; this.formData = Object.assign(this.formData,{...goodsInfo, ...medicalService});
this.formData2.suitableArr = this.formData.suitable.split(','); this.formData2.suitableArr = this.formData.suitable.split(',');
this.formData.optPrice = this.formData.costPrice/100; this.formData.optPrice = this.formData.costPrice/100;
this.formData.stock = this.formData.goodsStock; this.formData.stock = this.formData.goodsStock;
// this.formData.checkType;
// this.formData.otc1 = this.formData.otc ? '1' : '0'
this.fileGoodsList = this.getImges(goodsInfo.goodsHeaderImages,1); this.fileGoodsList = this.getImges(goodsInfo.goodsHeaderImages,1);
this.goodsCheckList = this.getImges(medicalService.goodsCheckImages, goodsType); this.goodsCheckList = this.getImges(medicalService.goodsCheckImages, goodsType);
...@@ -899,6 +912,7 @@ ...@@ -899,6 +912,7 @@
}else{ }else{
this.isMedic = true;
const res = await getGoodsList({ const res = await getGoodsList({
goodsIdList:[id], goodsIdList:[id],
goodsName :'', goodsName :'',
...@@ -919,12 +933,13 @@ ...@@ -919,12 +933,13 @@
}); });
} }
const {goodsList} = res.data; const {goodsList} = res.data;
this.formData = Object.assign(this.formData,{...goodsList[0]}) this.formData1 = goodsList[0];
this.formData = Object.assign(this.formData,{...this.formData1});
// this.formData = { ...this.formData, ...this.formData1 };
this.formData.optPrice = this.formData.costPrice/100; this.formData.optPrice = this.formData.costPrice/100;
this.fileGoodsList = this.getImges(goodsList[0].goodsImgList,1); this.fileGoodsList = this.getImges(goodsList[0].goodsImgList,1);
this.fileIntrList = this.getImges(goodsList[0].medicImgList,2); this.fileIntrList = this.getImges(goodsList[0].medicImgList,2);
this.formData.stock = this.formData.goodsStock; this.formData.stock = this.formData.goodsStock;
// console.log(this.formData.otc)
this.formData.otc1 = this.formData.otc ? '1' : '0' this.formData.otc1 = this.formData.otc ? '1' : '0'
if(this.isMedic){ if(this.isMedic){
this.getLever(5,2,1) this.getLever(5,2,1)
...@@ -947,11 +962,8 @@ ...@@ -947,11 +962,8 @@
}; };
} }
console.log(this.formData); console.log(this.formData);
}, },
getImges(d,type){ getImges(d,type){
let a = []; let a = [];
if(d.length > 0){ if(d.length > 0){
...@@ -969,11 +981,10 @@ ...@@ -969,11 +981,10 @@
} }
return a; return a;
}, },
//快速录入 //快速录入
fastInput(type){ fastInput(type){
///medications/query/{approvalnumber} ///medications/query/{approvalnumber}
if(this.formData1.barCode == ''){ if(this.formData.barCode == ''){
this.$refs.formData.validateField("barCode") this.$refs.formData.validateField("barCode")
return; return;
} }
...@@ -1043,42 +1054,19 @@ ...@@ -1043,42 +1054,19 @@
}); });
}, },
getGoodsTypes(goodsType,type){ getGoodsTypes(goodsType,type){
// this.formData = {};
// this.formData = this.comFormData;
// this.rules = this.comRuleData;
// this.rules = {};
if(goodsType == 5){ if(goodsType == 5){
this.isMedic = true; this.isMedic = true;
this.isCheckServe = false; this.isCheckServe = false;
this.getLever(goodsType,type); this.getLever(goodsType,type);
// this.formData = { ...originForm, ...originForm1 };
// this.rules = { ...originForm, ...originRules1 };
// // this.formData1 = originForm1;
// // this.formData2 = originForm2;
// this.rules = originRules;
// this.rules1 = originRules1;
// this.rules2 = originRules2;
// Object.assign(this.formData, {...originForm1});
// Object.assign(this.rules, {...originRules1});
} else if(goodsType == 337){ } else if(goodsType == 337){
this.isMedic = false; this.isMedic = false;
this.isCheckServe = true; this.isCheckServe = true;
// Object.assign(this.formData, {...originForm2});
// Object.assign(this.rules, {...originRules2});
}else{ }else{
this.isMedic = false; this.isMedic = false;
this.isCheckServe = false; this.isCheckServe = false;
// Object.assign(this.formData, {...originForm});
// Object.assign(this.rules, originRules);
}; };
// this.$forceUpdate();
console.log(this.formData); console.log(this.formData);
}, },
defaultArr(){ defaultArr(){
let a = [ let a = [
{ {
...@@ -1181,9 +1169,12 @@ ...@@ -1181,9 +1169,12 @@
}, },
complete() { complete() {
let formName = "formData"; let formName = "formData";
console.log(this.formData);
this.formData = {...this.formData, ...this.formData1, ...this.formData2 }; console.log(this.formData1);
console.log(this.formData2);
// debugger
// this.formData = {...this.formData, ...this.formData1, ...this.formData2 };
Object.assign(this.formData, {...this.formData1, ...this.formData2});
for(let i=0;i<this.fileGoodsList.length;i++){ for(let i=0;i<this.fileGoodsList.length;i++){
this.fileGoodsList[i].imageSort = i+1 this.fileGoodsList[i].imageSort = i+1
...@@ -1278,7 +1269,7 @@ ...@@ -1278,7 +1269,7 @@
closeLoading(vm); closeLoading(vm);
console.log('上传成功后路径', path); console.log('上传成功后路径', path);
let len = vm.fileGoodsList.length; let len = vm.fileGoodsList.length;
vm.fileGoodsList.push({ url: path.fullPath, goodsImgUrl: path.fullPath, imgSort: len+1, goodsId: vm.formData.goodsId }); vm.fileGoodsList.push({ url: path.fullPath, goodsImgUrl: path.fullPath,imageUrl:path.fullPath, imgSort: len+1,imageSort: len+1, goodsId: vm.formData.goodsId });
// vm.fileGoodsList.push({url:path.fullPath,goodsImgUrl: path.fullPath,imageUrl:path.fullPath,imageName:'',imageSort: len+1,imageType: 2,id: null,}) // vm.fileGoodsList.push({url:path.fullPath,goodsImgUrl: path.fullPath,imageUrl:path.fullPath,imageName:'',imageSort: len+1,imageType: 2,id: null,})
vm.$message.success("上传成功"); vm.$message.success("上传成功");
}); });
......
const form1 = { const form1 = {
// barCode: '',
categoryIdLevel2: '', categoryIdLevel2: '',
categoryIdLevel3: '', categoryIdLevel3: '',
categoryIdLevel4: '', categoryIdLevel4: '',
...@@ -18,8 +19,8 @@ const form1 = { ...@@ -18,8 +19,8 @@ const form1 = {
} }
const form2 = { const form2 = {
// checkPackageId: '', // 检测登记表,暂无,先隐藏!!!!!!!!!!! checkPackageId: '', // 检测登记表,暂无,先隐藏!!!!!!!!!!!
barCode: '', // barCode: '',
checkName: '', checkName: '',
hospitalName: '', hospitalName: '',
hospitalType: '', hospitalType: '',
......
...@@ -23,10 +23,10 @@ const checkProjectStr = (rule, value, callback) => { ...@@ -23,10 +23,10 @@ const checkProjectStr = (rule, value, callback) => {
}; };
const rules1 = { const rules1 = {
barCode: [ // barCode: [
{ required: true, message: "请输入条形码", trigger: "submit" }, // { required: true, message: "请输入条形码", trigger: "submit" },
{ validator: checkBarcode, trigger: "submit" } // { validator: checkBarcode, trigger: "submit" }
], // ],
medicCommonName:[ medicCommonName:[
{ required: true, message: "请输入商品通用名称", trigger: "blur" } { required: true, message: "请输入商品通用名称", trigger: "blur" }
], ],
...@@ -66,10 +66,10 @@ const rules1 = { ...@@ -66,10 +66,10 @@ const rules1 = {
} }
const rules2 = { const rules2 = {
barCode: [ // barCode: [
{ required: true, message: "请输入条形码", trigger: "submit" }, // { required: true, message: "请输入条形码", trigger: "submit" },
{ validator: checkBarcode, trigger: "submit" } // { validator: checkBarcode, trigger: "submit" }
], // ],
checkName: [{ required: true, message: "请输入检测名称", trigger: "blur" }], checkName: [{ required: true, message: "请输入检测名称", trigger: "blur" }],
hospitalName: [{ required: true, message: "请输入医疗机构名称", trigger: "blur" }], hospitalName: [{ required: true, message: "请输入医疗机构名称", trigger: "blur" }],
hospitalType: [{ required: true, message: "请选择医疗机构类型", trigger: "blur" }], hospitalType: [{ required: true, message: "请选择医疗机构类型", trigger: "blur" }],
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册