|
|
@@ -656,6 +656,84 @@
|
|
|
<el-form-item label="处方名" v-if="form.productType===2" prop="prescribeName">
|
|
|
<el-input v-model="form.prescribeName" placeholder="请输入处方名" />
|
|
|
</el-form-item>
|
|
|
+ <el-form-item v-if="form.isShow === '1'" label="审核说明" prop="reviewAudit">
|
|
|
+ <el-select style="width: 240px" v-model="form.reviewAudit" placeholder="请选择审核说明" clearable @change="handleReviewAudit" size="small">
|
|
|
+ <el-option v-for="item in reviewAuditOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="非首营链接" prop="businessLink" v-if="form.reviewAudit === '1'">
|
|
|
+ <el-input v-model="form.businessLink" placeholder="请输入非首营链接"/>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item v-if="form.isShow === '1'" label="生产企业营业执照" prop="business">
|
|
|
+ <Material v-model="businessArr" type="image" :num="1" :width="150" :height="150"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="form.isShow === '1' && businessArr.length > 0" prop="businessExpire">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="form.businessExpire"
|
|
|
+ type="daterange"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item v-if="form.isShow === '1'" label="生产企业的生产许可证/备案凭证" prop="license">
|
|
|
+ <Material v-model="licenseArr" type="image" :num="1" :width="150" :height="150"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="form.isShow === '1' && licenseArr.length > 0" prop="licenseExpire">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="form.licenseExpire"
|
|
|
+ type="daterange"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item v-if="form.isShow === '1'" label="商品注册证/备案凭证" prop="certificate">
|
|
|
+ <Material v-model="certificateArr" type="image" :num="1" :width="150" :height="150"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="form.isShow === '1' && certificateArr.length > 0" prop="certificateExpire">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="form.certificateExpire"
|
|
|
+ type="daterange"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item v-if="form.isShow === '1' && displayDemo" label="Ⅰ类Ⅱ类备案凭证" prop="voucher">
|
|
|
+ <Material v-model="voucherArr" type="image" :num="1" :width="150" :height="150"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="form.isShow === '1' && voucherArr.length > 0 && displayDemo" prop="voucherExpire">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="form.voucherExpire"
|
|
|
+ type="daterange"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item v-if="form.isShow === '1'" label="GMP认证" prop="gmpAuth">
|
|
|
+ <Material v-model="gmpAuthArr" type="image" :num="1" :width="150" :height="150"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="form.isShow === '1' && gmpAuthArr.length > 0" prop="gmpAuthExpire">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="form.gmpAuthExpire"
|
|
|
+ type="daterange"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
<el-divider content-position="left">审核</el-divider>
|
|
|
<el-form ref="form1" :model="form1" :rules="rules1" label-width="80px">
|
|
|
@@ -666,9 +744,6 @@
|
|
|
<ImageUpload v-model="form1.attachImage" type="image" :limit=5 :width="150"
|
|
|
:height="150"/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="首营资质证明" prop="qualificationCertificate">
|
|
|
- <Material v-model="qualificationArr" type="image" :num="1" :width="150" :height="150" />
|
|
|
- </el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="handleUpdate1(1)">审核通过</el-button>
|
|
|
@@ -749,10 +824,59 @@ export default {
|
|
|
},
|
|
|
qualificationArr:function (val) {
|
|
|
this.form.qualificationCertificate = val.join(',');
|
|
|
+ },businessArr(val) {
|
|
|
+ this.form.business = val.join(',');
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.$refs.form1) {
|
|
|
+ this.$refs.form1.validateField('businessExpire');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ licenseArr(val) {
|
|
|
+ this.form.license = val.join(',');
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.$refs.form1) {
|
|
|
+ this.$refs.form1.validateField('licenseExpire');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ certificateArr(val) {
|
|
|
+ this.form.certificate = val.join(',');
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.$refs.form1) {
|
|
|
+ this.$refs.form1.validateField('certificateExpire');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ voucherArr(val) {
|
|
|
+ this.form.voucher = val.join(',');
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.$refs.form1) {
|
|
|
+ this.$refs.form1.validateField('voucherExpire');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ 'form.cateId': {
|
|
|
+ handler(newVal) {
|
|
|
+ const cateName = this.cateIdToNameMap[newVal];
|
|
|
+ this.displayDemo = cateName !== undefined && cateName.includes('器械');
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ businessArr: [],
|
|
|
+ licenseArr: [],
|
|
|
+ certificateArr: [],
|
|
|
+ voucherArr: [],
|
|
|
+ gmpAuthArr: [],
|
|
|
+ displayDemo: false,
|
|
|
+ cateIdToNameMap: {},
|
|
|
+ reviewAuditOptions: [
|
|
|
+ {dictValue: "0", dictLabel: "首营"},
|
|
|
+ {dictValue: "1", dictLabel: "非首营"}
|
|
|
+ ],
|
|
|
companyId: null,
|
|
|
storeId: null,
|
|
|
uploadUrl:process.env.VUE_APP_BASE_API+"/common/uploadOSS",
|
|
|
@@ -1177,6 +1301,8 @@ export default {
|
|
|
this.categoryOptions = [];
|
|
|
const data = this.handleTree(response.data, "cateId", "pid");
|
|
|
this.categoryOptions=data;
|
|
|
+
|
|
|
+ this.buildCateMap(data);
|
|
|
});
|
|
|
},
|
|
|
/** 查询商品列表 */
|
|
|
@@ -1298,21 +1424,17 @@ export default {
|
|
|
this.single = selection.length!==1
|
|
|
this.multiple = !selection.length
|
|
|
},
|
|
|
- /** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
- if(this.ids.length > 1){
|
|
|
- //判断是否为药品
|
|
|
- this.title = "批量审核商品";
|
|
|
+ if (this.ids.length > 1) {
|
|
|
+ this.title = "批量修改商品";
|
|
|
this.open1 = true;
|
|
|
return;
|
|
|
}
|
|
|
- var that=this;
|
|
|
+ var that = this;
|
|
|
this.reset();
|
|
|
const productId = row.productId || this.ids
|
|
|
getStoreProduct(productId).then(response => {
|
|
|
this.form = response.data;
|
|
|
- //设置cateId => cateName
|
|
|
- this.form.cateName = this.selectDictLabel(this.categoryOptions, response.data.cateId);
|
|
|
this.form.isShow = response.data.isShow.toString();
|
|
|
this.form.isHot = response.data.isHot.toString();
|
|
|
this.form.isGood = response.data.isGood.toString();
|
|
|
@@ -1320,36 +1442,80 @@ export default {
|
|
|
this.form.isNew = response.data.isNew.toString();
|
|
|
this.form.productType = response.data.productType.toString();
|
|
|
this.form.isDisplay = response.data.isDisplay.toString();
|
|
|
- if(this.form.tuiCateId!=null){
|
|
|
+ if (this.form.business) {
|
|
|
+ this.businessArr = this.form.business.split(',');
|
|
|
+ }
|
|
|
+ if (this.form.license) {
|
|
|
+ this.licenseArr = this.form.license.split(',');
|
|
|
+ }
|
|
|
+ if (this.form.certificate) {
|
|
|
+ this.certificateArr = this.form.certificate.split(',');
|
|
|
+ }
|
|
|
+ if (this.form.voucher) {
|
|
|
+ this.voucherArr = this.form.voucher.split(',');
|
|
|
+ }
|
|
|
+ if (this.form.gmpAuth) {
|
|
|
+ this.gmpAuthArr = this.form.gmpAuth.split(',');
|
|
|
+ }
|
|
|
+ if (this.form.tuiCateId != null) {
|
|
|
this.form.tuiCateId = response.data.tuiCateId.toString();
|
|
|
}
|
|
|
-
|
|
|
- this.form.isDrug = response.data.isDrug ? response.data.isDrug.toString() : "0";
|
|
|
+ if (this.form.reviewAudit != null) {
|
|
|
+ this.form.reviewAudit = response.data.reviewAudit.toString();
|
|
|
+ }
|
|
|
+ // this.form.isDrug = response.data.isDrug ? response.data.isDrug.toString() : "1";
|
|
|
+ this.form.isDrug = response.data.isDrug === 0 ? "0" : (response.data.isDrug ? response.data.isDrug.toString() : "1");
|
|
|
if (this.form.drugImage != null) {
|
|
|
this.drugImageArr = this.form.drugImage.split(",");
|
|
|
}
|
|
|
- if(this.form.qualificationCertificate !=null){
|
|
|
+ if (this.form.qualificationCertificate != null) {
|
|
|
this.qualificationArr = this.form.qualificationCertificate.split(",");
|
|
|
}
|
|
|
+ const expireFieldMap = [
|
|
|
+ { expireKey: 'businessExpire', startKey: 'businessStart', endKey: 'businessEnd' },
|
|
|
+ { expireKey: 'licenseExpire', startKey: 'licenseStart', endKey: 'licenseEnd' },
|
|
|
+ { expireKey: 'certificateExpire', startKey: 'certificateStart', endKey: 'certificateEnd' },
|
|
|
+ { expireKey: 'voucherExpire', startKey: 'voucherStart', endKey: 'voucherEnd' },
|
|
|
+ { expireKey: 'gmpAuthExpire', startKey: 'gmpAuthStart', endKey: 'gmpAuthEnd' },
|
|
|
+ { expireKey: 'qualificationExpire', startKey: 'qualificationCertificateStart', endKey: 'qualificationCertificateEnd' }
|
|
|
+ ];
|
|
|
+
|
|
|
+ expireFieldMap.forEach(item => {
|
|
|
+ const startVal = response.data[item.startKey];
|
|
|
+ const endVal = response.data[item.endKey];
|
|
|
+ if (startVal && endVal) {
|
|
|
+ this.$set(this.form, item.expireKey, [startVal, endVal]);
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
//组装attrs数据
|
|
|
- if(response.attrs!=null){
|
|
|
- this.attrs=[];
|
|
|
+ if (response.attrs != null) {
|
|
|
+ this.attrs = [];
|
|
|
response.attrs.forEach(function (item, index) {
|
|
|
- var data={value:item.attrName,detail:item.attrValues.split(',')}
|
|
|
- that.attrs.push(data);
|
|
|
+ var data = {value: item.attrName, detail: item.attrValues.split(',')}
|
|
|
+ that.attrs.push(data);
|
|
|
});
|
|
|
}
|
|
|
- // 组装companyIds
|
|
|
+ const dateFields = [
|
|
|
+ 'qualificationExpire'
|
|
|
+ ];
|
|
|
+ dateFields.forEach(field => {
|
|
|
+ const startField = field.replace('Expire', 'CertificateStart'); // qualificationCertificateStart
|
|
|
+ const endField = field.replace('Expire', 'CertificateEnd'); // qualificationCertificateEnd
|
|
|
+ if (this.form[startField] && this.form[endField]) {
|
|
|
+ this.$set(this.form, field, [this.form[startField], this.form[endField]]);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // // 组装companyIds
|
|
|
// if (response.data.companyIds != null && response.data.companyIds != undefined && response.data.companyIds.length > 0) {
|
|
|
// this.form.companyIds = response.data.companyIds.split(',').map(Number);
|
|
|
// }
|
|
|
setTimeout(() => {
|
|
|
that.generate();
|
|
|
}, 200);
|
|
|
- if(this.form.specType === 0){
|
|
|
+ if (this.form.specType === 0) {
|
|
|
that.manyFormValidate = [];
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
that.createBnt = true;
|
|
|
that.oneFormValidate = [
|
|
|
{
|
|
|
@@ -1363,27 +1529,32 @@ export default {
|
|
|
weight: 0,
|
|
|
volume: 0,
|
|
|
integral: 0,
|
|
|
- brokerage:0,
|
|
|
- brokerageTwo:0
|
|
|
+ brokerage: 0,
|
|
|
+ brokerageTwo: 0
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
setTimeout(() => {
|
|
|
- if(this.form.description==null){
|
|
|
+ if (this.form.description == null) {
|
|
|
this.$refs.myeditor.setText("");
|
|
|
- }
|
|
|
- else{
|
|
|
+ } else {
|
|
|
this.$refs.myeditor.setText(this.form.description);
|
|
|
}
|
|
|
+
|
|
|
+ if (this.form.instructionManual == null) {
|
|
|
+ this.$refs.instructionManualRef.setText("");
|
|
|
+ } else {
|
|
|
+ this.$refs.instructionManualRef.setText(this.form.instructionManual);
|
|
|
+ }
|
|
|
}, 200);
|
|
|
- if(this.form.image!=null){
|
|
|
- this.imageArr=this.form.image.split(",");
|
|
|
+ if (this.form.image != null) {
|
|
|
+ this.imageArr = this.form.image.split(",");
|
|
|
}
|
|
|
- if(this.form.sliderImage!=null){
|
|
|
- this.photoArr=this.form.sliderImage.split(",");
|
|
|
+ if (this.form.sliderImage != null) {
|
|
|
+ this.photoArr = this.form.sliderImage.split(",");
|
|
|
}
|
|
|
this.open = true;
|
|
|
- this.title = "审核商品";
|
|
|
+ this.title = "修改商品";
|
|
|
});
|
|
|
},
|
|
|
handleUpdate1(oper) {
|
|
|
@@ -1456,6 +1627,14 @@ export default {
|
|
|
this.form1.reason = null;
|
|
|
this.form1.attachImage = null;
|
|
|
});
|
|
|
+ },
|
|
|
+ buildCateMap(nodes) {
|
|
|
+ nodes.forEach(node => {
|
|
|
+ this.cateIdToNameMap[node.cateId] = node.cateName;
|
|
|
+ if (node.children && node.children.length) {
|
|
|
+ this.buildCateMap(node.children);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|