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

修改bug

上级 84ba7c43
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
v-model="formData1.barCode" v-model="formData1.barCode"
placeholder="请输入条形码" placeholder="请输入条形码"
></el-input> ></el-input>
<span class="fast-opt" @click="fastInput">快速录入</span> <span class="fast-opt" @click="fastInput(1)">快速录入</span>
<span class="word-num">(点击可快速录入下面的药品信息)</span> <span class="word-num">(点击可快速录入下面的药品信息)</span>
</el-col> </el-col>
</el-form-item> </el-form-item>
...@@ -409,8 +409,8 @@ ...@@ -409,8 +409,8 @@
v-model="formData2.barCode" v-model="formData2.barCode"
placeholder="请输入条形码" placeholder="请输入条形码"
></el-input> ></el-input>
<span class="fast-opt" @click="fastInput">快速录入</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">
...@@ -786,6 +786,7 @@ ...@@ -786,6 +786,7 @@
rules: {}, rules: {},
rules1: {}, rules1: {},
rules2: {}, rules2: {},
goodsId: 0, // 新增时传0,更新时必需>0
// 不同类型服务的表单通用字段 // 不同类型服务的表单通用字段
// 不同类型服务的表单通用字段 // 不同类型服务的表单通用字段
// 不同类型服务的表单通用字段 // 不同类型服务的表单通用字段
...@@ -844,25 +845,14 @@ ...@@ -844,25 +845,14 @@
this.allDeparts = res.data this.allDeparts = res.data
}) })
if(id != 'add'){ if(id != 'add'){
// let goods = Object.assign(this.goodsInfo,{})
// this.formData = {...goods}
// console.log(goods)
this.formData.goodsId = id;
this.getDetailByEdit(id, goodsType); this.getDetailByEdit(id, goodsType);
} }
}, },
methods: { methods: {
//eidt状态 //eidt状态
getDetailByEdit(id, goodsType){ async getDetailByEdit(id, goodsType){
let parm = { this.goodsId = id ;
goodsIdList:[id],
goodsName :'',
goodsType :'',
pageNo:1,
pageSize: 10,
}
// 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){ if(goodsType == 5){
...@@ -872,7 +862,8 @@ ...@@ -872,7 +862,8 @@
} }
if(goodsType == 337){ if(goodsType == 337){
getGoodDetails(id).then((res)=>{ const res = await getGoodDetails(id);
console.log(`========================>`, res); console.log(`========================>`, res);
if(res.code != '000000'){ if(res.code != '000000'){
return this.$message({ return this.$message({
...@@ -891,10 +882,11 @@ ...@@ -891,10 +882,11 @@
this.formData1 = goodsInfo; this.formData1 = goodsInfo;
this.formData2 = medicalService; this.formData2 = medicalService;
// this.formData = Object.assign(goodsInfo, medicalService); // this.formData = Object.assign(goodsInfo, medicalService);
this.formData = { ...goodsInfo, ...medicalService }; this.formData = { ...this.formData, ...goodsInfo, ...medicalService };
this.formData.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.checkType;
// this.formData.otc1 = this.formData.otc ? '1' : '0' // this.formData.otc1 = this.formData.otc ? '1' : '0'
this.fileGoodsList = this.getImges(goodsInfo.goodsHeaderImages,1); this.fileGoodsList = this.getImges(goodsInfo.goodsHeaderImages,1);
...@@ -906,10 +898,14 @@ ...@@ -906,10 +898,14 @@
}; };
});
}else{ }else{
getGoodsList(parm).then((res)=>{ const res = await getGoodsList({
goodsIdList:[id],
goodsName :'',
goodsType :'',
pageNo:1,
pageSize: 10,
});
if(res.code != '000000'){ if(res.code != '000000'){
return this.$message({ return this.$message({
message: res.message, message: res.message,
...@@ -950,8 +946,6 @@ ...@@ -950,8 +946,6 @@
...originRules ...originRules
}; };
});
} }
console.log(this.formData); console.log(this.formData);
...@@ -977,9 +971,9 @@ ...@@ -977,9 +971,9 @@
}, },
//快速录入 //快速录入
fastInput(){ fastInput(type){
///medications/query/{approvalnumber} ///medications/query/{approvalnumber}
if(this.formData.barCode == ''){ if(this.formData1.barCode == ''){
this.$refs.formData.validateField("barCode") this.$refs.formData.validateField("barCode")
return; return;
} }
...@@ -1094,7 +1088,6 @@ ...@@ -1094,7 +1088,6 @@
] ]
return a return a
}, },
//获取分类 //获取分类
getLever(id,type,parm){ getLever(id,type,parm){
...@@ -1199,21 +1192,17 @@ ...@@ -1199,21 +1192,17 @@
this.fileIntrList[j].imageSort = j+1 this.fileIntrList[j].imageSort = j+1
} }
// this.formData.goodsHeaderImages = this.fileGoodsList;
// this.formData.specificationImages = this.fileIntrList;
// this.isgoodsImages = this.formData.goodsHeaderImages.length == 0 ? false :true;
// this.isSpecification_url = this.formData.specificationImages.length == 0 ? false : true
this.formData.categoryId = this.formData.goodsType this.formData.categoryId = this.formData.goodsType
this.formData.otc = this.formData.otc1 == 1 ? true : false this.formData.otc = this.formData.otc1 == 1 ? true : false
this.isgoodStock = this.formData.stock > 0 ? true : false this.isgoodStock = this.formData.stock > 0 ? true : false
console.log(this.isgoodStock); this.formData.goodsId = this.goodsId;
// console.log(this.isgoodStock);
this.formData.goodsImages = this.fileGoodsList; this.formData.goodsImages = this.fileGoodsList;
this.formData.goodsHeaderImages = this.fileGoodsList; this.formData.goodsHeaderImages = this.fileGoodsList;
this.formData.specificationImages = this.fileIntrList; this.formData.specificationImages = this.fileIntrList;
this.isgoodsImages = this.formData.goodsImages.length == 0 ? false :true; this.isgoodsImages = this.formData.goodsImages.length == 0 ? false :true;
// 如果是【药品】类型的商品 // 如果是【药品】类型的商品
if(this.isMedic){ if(this.isMedic){
if(!this.isgoodsImages){ if(!this.isgoodsImages){
return; return;
} }
...@@ -1232,6 +1221,8 @@ ...@@ -1232,6 +1221,8 @@
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
//alert('submit!'); //alert('submit!');
this.formData.costPrice = this.formData.optPrice*100
this.formData.hasChanged = true;
this.updateGoodsInfo(); this.updateGoodsInfo();
} else { } else {
console.log('error submit!!'); console.log('error submit!!');
...@@ -1241,10 +1232,7 @@ ...@@ -1241,10 +1232,7 @@
}, },
//更新商品 //更新商品
updateGoodsInfo(){ updateGoodsInfo(){
this.formData.costPrice = this.formData.optPrice*100
this.formData.hasChanged = true;
console.log('提交值',this.formData); console.log('提交值',this.formData);
const submieFn = this.isCheckServe ? updateGoodsV2 : updateGoods; const submieFn = this.isCheckServe ? updateGoodsV2 : updateGoods;
submieFn(this.formData).then((res)=>{ submieFn(this.formData).then((res)=>{
if (res.code !== '000000') { if (res.code !== '000000') {
......
...@@ -24,12 +24,12 @@ const form2 = { ...@@ -24,12 +24,12 @@ const form2 = {
hospitalName: '', hospitalName: '',
hospitalType: '', hospitalType: '',
hospitalId: 0, hospitalId: 0,
goodsId: 0, // 新增时传0,更新时必需>0
medicalServiceId: 0, // 新增时传0,更新时必需>0 medicalServiceId: 0, // 新增时传0,更新时必需>0
goodsCheckImages: [], goodsCheckImages: [],
checkItem: '', checkItem: '',
checkStandard: '', checkStandard: '',
useCount: 0, useCount: 1,
checkType: '', checkType: '',
suitable: '', suitable: '',
suitableStr: '', suitableStr: '',
...@@ -43,9 +43,8 @@ const form = { ...@@ -43,9 +43,8 @@ const form = {
// categoryId:'', // categoryId:'',
// otc:false, // otc:false,
// discountPrice:'', // discountPrice:'',
// stock:0,
// goodsStock:0,
// specificationImages:[], // specificationImages:[],
// goodsId: 0, // 新增时传0,更新时必需>0
id: 0, id: 0,
goodsName:'', goodsName:'',
goodsDescription:'', goodsDescription:'',
...@@ -58,7 +57,8 @@ const form = { ...@@ -58,7 +57,8 @@ const form = {
storeId: '', storeId: '',
optPrice:'', optPrice:'',
goodsStock:0, goodsStock:0,
stock: 0 stock: 0,
externalGoodsCode: ''
}; };
......
...@@ -23,6 +23,10 @@ const checkProjectStr = (rule, value, callback) => { ...@@ -23,6 +23,10 @@ const checkProjectStr = (rule, value, callback) => {
}; };
const rules1 = { const rules1 = {
barCode: [
{ required: true, message: "请输入条形码", trigger: "submit" },
{ validator: checkBarcode, trigger: "submit" }
],
medicCommonName:[ medicCommonName:[
{ required: true, message: "请输入商品通用名称", trigger: "blur" } { required: true, message: "请输入商品通用名称", trigger: "blur" }
], ],
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册