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

有效期

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