提交 bb9ce402 编写于 作者: shuang.zhou's avatar shuang.zhou

商品分类修复

上级 47e82fc0
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
color: #f56c6c; color: #f56c6c;
margin-right: 4px; margin-right: 4px;
} }
.project-req { .goods-category,.project-req {
.el-form-item__label::before { .el-form-item__label::before {
content: "*"; content: "*";
color: #f56c6c; color: #f56c6c;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<div class="basic-item-icon"> <div class="basic-item-icon">
<div class="part-tit">基本信息</div> <div class="part-tit">基本信息</div>
<el-form-item label="商品分类" prop="goodsCategoryIdList"> <el-form-item label="商品分类" class="goods-category">
<el-cascader <el-cascader
size="small" size="small"
ref="cascader" ref="cascader"
...@@ -30,9 +30,10 @@ ...@@ -30,9 +30,10 @@
:props="cascaderProps" :props="cascaderProps"
clearable clearable
filterable filterable
v-model="formData3.goodsCategoryIdList" v-model="goodsCategoryIdList"
@change="searchCategoryChange" @change="searchCategoryChange"
/> />
<div v-if="isgoodsCategory" :style="{color: '#f56c6c',fontSize: '12px'}">请选择商品分类</div>
</el-form-item> </el-form-item>
<el-form-item label="项目-合同名称" prop="cooperationProjectId" class="project-req"> <el-form-item label="项目-合同名称" prop="cooperationProjectId" class="project-req">
<el-select <el-select
...@@ -56,7 +57,9 @@ ...@@ -56,7 +57,9 @@
placeholder="请选择" placeholder="请选择"
size="small" size="small"
clearable clearable
:disabled="isEdit && isContract"> :disabled="isEdit && isContract"
@change="contractChange"
>
<el-option <el-option
v-for="(item,index) in contractList" v-for="(item,index) in contractList"
:key="item.contractName+'-'+index" :key="item.contractName+'-'+index"
...@@ -64,6 +67,7 @@ ...@@ -64,6 +67,7 @@
:value="item.contractId" :value="item.contractId"
></el-option> ></el-option>
</el-select> </el-select>
<div v-if="isProjectId" :style="{color: '#f56c6c',fontSize: '12px'}">请关联项目名称</div>
</el-form-item> </el-form-item>
<el-form-item label="选择基础药品" prop="choiceGoods" class="choice-goods"> <el-form-item label="选择基础药品" prop="choiceGoods" class="choice-goods">
<el-col :span="16"> <el-col :span="16">
...@@ -662,7 +666,9 @@ ...@@ -662,7 +666,9 @@
pageSize: 10, pageSize: 10,
totalRows: 0, totalRows: 0,
isAddServe: false, // 新增药品时 添加的是否为服务类 || 虚拟商品 isAddServe: false, // 新增药品时 添加的是否为服务类 || 虚拟商品
goodsCategoryList: [] goodsCategoryList: [],
isgoodsCategory: false, // 是否选择商品分类
isProjectId: false
} }
}, },
computed: { computed: {
...@@ -718,7 +724,6 @@ ...@@ -718,7 +724,6 @@
const subArr = item.filter(i=> { const subArr = item.filter(i=> {
return i !== -1; return i !== -1;
}) })
console.log()
newoodsList.push(subArr) newoodsList.push(subArr)
}) })
return newoodsList; return newoodsList;
...@@ -794,11 +799,22 @@ ...@@ -794,11 +799,22 @@
}).catch(() => { }).catch(() => {
}); });
}, },
contractChange(val) {
if (val) {
this.isProjectId = false;
} else {
this.isProjectId = true;
}
},
// 商品分类级联多选 // 商品分类级联多选
searchCategoryChange(value) { searchCategoryChange(value) {
console.log(value, '商品分类级联多选') console.log(value, '商品分类级联多选')
this.formData3.goodsCategoryIdList = value; if (value.length > 0) {
this.isgoodsCategory = false;
} else {
this.isgoodsCategory = true;
}
this.goodsCategoryIdList = value;
this.$refs.cascader.toggleDropDownVisible(); this.$refs.cascader.toggleDropDownVisible();
}, },
// 确认选择药品 // 确认选择药品
...@@ -835,7 +851,6 @@ ...@@ -835,7 +851,6 @@
this.isCheckServe = val.categoryName == 5? true : false; this.isCheckServe = val.categoryName == 5? true : false;
let current = [this.currentRow]; let current = [this.currentRow];
this.choiceMedData = current; this.choiceMedData = current;
console.log(val.categoryName, 'categoryNamecategoryName')
} }
}, },
// 新增药品 // 新增药品
...@@ -932,7 +947,6 @@ ...@@ -932,7 +947,6 @@
getContractList(projectId || 0).then(res => { getContractList(projectId || 0).then(res => {
if(res.code == '000000') { if(res.code == '000000') {
this.contractList = res.data; this.contractList = res.data;
console.log(this.contractList, 'this.contractList');
} }
}) })
}, },
...@@ -1007,8 +1021,7 @@ ...@@ -1007,8 +1021,7 @@
this.formData3 = { goodsName, goodsDescription, goodsHeaderImages, goodsVideoList, goodsType, expressLimitFlag,contractId, cooperationProjectId }; this.formData3 = { goodsName, goodsDescription, goodsHeaderImages, goodsVideoList, goodsType, expressLimitFlag,contractId, cooperationProjectId };
this.formData3.medicationId = medicationInfo.tradeMedicalLibId; this.formData3.medicationId = medicationInfo.tradeMedicalLibId;
this.formData3.medicationDetailId = medicationInfo.id; this.formData3.medicationDetailId = medicationInfo.id;
this.formData3.goodsCategoryIdList = this.getArr(goodsCategoryIdArr); this.goodsCategoryIdList = this.getArr(goodsCategoryIdArr);
console.log(this.formData3.goodsCategoryIdList, 'this.formData3.goodsCategoryIdListthis.formData3.goodsCategoryIdList')
this.hasRepoFlag = hasRepoFlag; this.hasRepoFlag = hasRepoFlag;
this.buyLimitDtoList = this.formData.buyLimitDtoList; this.buyLimitDtoList = this.formData.buyLimitDtoList;
this.formData.optPrice = this.formData.costPrice/100; this.formData.optPrice = this.formData.costPrice/100;
...@@ -1156,30 +1169,38 @@ ...@@ -1156,30 +1169,38 @@
this.formData.goodsVideoList = this.videoList; this.formData.goodsVideoList = this.videoList;
this.formData.goodsDetailImages = this.fileIntrList; // 商品详情图 this.formData.goodsDetailImages = this.fileIntrList; // 商品详情图
this.formData.buyLimitDtoList = this.buyLimitDtoList; this.formData.buyLimitDtoList = this.buyLimitDtoList;
this.formData.goodsCategoryIdList = this.goodsCategoryIdList;
this.isgoodsImages = this.formData.goodsImages.length == 0 ? false :true; this.isgoodsImages = this.formData.goodsImages.length == 0 ? false :true;
this.isSpecification_url = this.formData.goodsDetailImages.length == 0 ? false :true; this.isSpecification_url = this.formData.goodsDetailImages.length == 0 ? false :true;
// 判断是否只选择了项目-合同名称的其中一项 // 判断是否只选择了项目-合同名称的其中一项
const {cooperationProjectId, contractId} = this.formData3; const {cooperationProjectId,contractId,goodsCategoryIdList} = this.formData;
if (!cooperationProjectId) { if (!goodsCategoryIdList.length) {
this.isgoodsCategory = true;
return this.$message({ return this.$message({
message: '请关联项目名称', message: '请选择商品分类',
type: 'error' type: 'error'
}); });
} }
if ((cooperationProjectId && !contractId) || (!cooperationProjectId && contractId)) { if (!cooperationProjectId || !contractId) {
this.isProjectId = true;
return this.$message({ return this.$message({
message: '请选择项目-合同名称', message: '请关联项目名称',
type: 'warning' type: 'error'
});
}
// 是否选择新增药品
if (this.choiceMedData.length == 0) {
this.isShowGoodsMsg = true;
this.$message({
message: '请选择基础药品',
type: 'error'
}); });
return;
} }
let isTrue = false; let isTrue = false;
console.log(formNameList.length, 'formNameListformNameList')
let item = ""; let item = "";
for(let i = 0; i < formNameList.length; i++){ for(let i = 0; i < formNameList.length; i++){
console.log(formNameList[i],'formNameList[i]')
item = formNameList[i]; item = formNameList[i];
console.log(item, 'itieuieutieutiu')
this.$refs[item].validate((valid,object) => { this.$refs[item].validate((valid,object) => {
isTrue = valid; isTrue = valid;
if (!valid) return false; if (!valid) return false;
...@@ -1188,17 +1209,9 @@ ...@@ -1188,17 +1209,9 @@
return; return;
} }
} }
// 是否上传商品头图 || 是否上传商品详情图片 || 库存是否为0 || 单次购买上线是否符合要求 // 是否上传商品头图 || 是否上传商品详情图片 || 库存是否为0 || 单次购买上线是否符合要求
if(!this.isgoodsImages || !this.isSpecification_url ||!this.isgoodStock || !this.checkCount()) return; if(!this.isgoodsImages || !this.isSpecification_url ||!this.isgoodStock || !this.checkCount()) return;
// 是否选择新增药品
if (this.choiceMedData.length == 0) {
this.isShowGoodsMsg = true;
this.$message({
message: '请选择基础药品',
type: 'warning'
});
return;
}
if(!isTrue){ if(!isTrue){
return false; return false;
...@@ -1546,7 +1559,6 @@ ...@@ -1546,7 +1559,6 @@
}, },
// 视频 // 视频
deleteVideo(videoList) { deleteVideo(videoList) {
console.log(videoList,'item,fileGoodsListitem,fileGoodsListv')
this.videoList = []; this.videoList = [];
this.videoModel.videoFullPath=''; this.videoModel.videoFullPath='';
}, },
...@@ -1562,7 +1574,6 @@ ...@@ -1562,7 +1574,6 @@
} }
}, },
handleRemoveVideo(file, videoList) { handleRemoveVideo(file, videoList) {
//console.log(this.videoList);
for (let i = 0; i < this.videoList.length; i++) { for (let i = 0; i < this.videoList.length; i++) {
if (this.videoList[i].name == file.name) { if (this.videoList[i].name == file.name) {
this.videoList.splice(i, 1); this.videoList.splice(i, 1);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册