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

修改bug

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