|
|
@@ -293,14 +293,16 @@
|
|
|
<el-select style="width: 240px" v-model="form.productType" placeholder="请选择商品类型" clearable
|
|
|
size="small" :disabled="isViewMode">
|
|
|
<el-option
|
|
|
- v-for="item in productTypeOptions"
|
|
|
- :key="item.dictValue"
|
|
|
- :label="item.dictLabel"
|
|
|
- :value="item.dictValue"
|
|
|
- />
|
|
|
+ v-for="item in productTypeOptions" :key="item.dictValue"
|
|
|
+ :label="item.dictLabel" :value="item.dictValue" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+
|
|
|
+ <!-- 存储条件 -->
|
|
|
+ <el-form-item label="存储条件" prop="storageConditions" v-if="!isMedicalDeviceCategory">
|
|
|
+ <el-input v-model="form.storageConditions" placeholder="请输入存储条件" style="width: calc(100% - 120px);"/>
|
|
|
+ </el-form-item>
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
|
@@ -1111,27 +1113,20 @@ export default {
|
|
|
// 判断是否包含"器械"
|
|
|
if(cateName !== undefined && cateName.includes('器械')){
|
|
|
this.displayDemo = true;
|
|
|
- // 当分类包含"器械"时,默认设置为药品
|
|
|
- if (cateName.includes('器械')) {
|
|
|
- this.form.isDrug = "1";
|
|
|
+ this.form.isDrug = "1";
|
|
|
+ if(cateName.includes('II类器械') || cateName.includes('III类器械')) {
|
|
|
+ // 只有当商品分类为II类器械时才显示显示器免按钮
|
|
|
+ this.showMedicalDeviceCode = true;
|
|
|
+ this.showExemptDeviceButton = cateName.includes('II类器械');
|
|
|
+ } else {
|
|
|
+ this.showMedicalDeviceCode = false;
|
|
|
+ this.showExemptDeviceButton = false;
|
|
|
}
|
|
|
} else {
|
|
|
this.displayDemo = false;
|
|
|
}
|
|
|
-
|
|
|
- // 判断是否为II类器械或III类器械,如果是则显示器械编码输入框
|
|
|
- if (cateName !== undefined && (cateName.includes('II类器械') || cateName.includes('III类器械'))) {
|
|
|
- this.showMedicalDeviceCode = true;
|
|
|
- // 只有当商品分类为II类器械时才显示显示器免按钮
|
|
|
- this.showExemptDeviceButton = cateName.includes('II类器械');
|
|
|
- } else {
|
|
|
- this.showMedicalDeviceCode = false;
|
|
|
- this.showExemptDeviceButton = false;
|
|
|
- }
|
|
|
-
|
|
|
// 判断是否包含"处方药"
|
|
|
const isPrescriptionDrug = cateName !== undefined && cateName.includes('处方药');
|
|
|
-
|
|
|
// 如果是处方药,则移除相关字段的必填校验
|
|
|
if (isPrescriptionDrug) {
|
|
|
// 移除必填校验规则
|
|
|
@@ -1144,16 +1139,13 @@ export default {
|
|
|
});
|
|
|
} else {
|
|
|
// 如果不是处方药,恢复默认的必填校验规则
|
|
|
- // 恢复 ingredient 字段的必填规则
|
|
|
- if (!this.rules.ingredient) {
|
|
|
- this.rules.ingredient = [];
|
|
|
- }
|
|
|
+ if (!this.rules.ingredient) { this.rules.ingredient = [];}
|
|
|
if (!this.rules.ingredient.some(rule => rule.required)) {
|
|
|
this.rules.ingredient.unshift({ required: true, message: "成分不能为空", trigger: "blur" });
|
|
|
}
|
|
|
-
|
|
|
// 恢复其他字段的必填规则
|
|
|
const requiredRules = {
|
|
|
+ storageConditions :[{ required: true, message: "存储条件不能为空", trigger: "blur" }],
|
|
|
indications: [{ required: true, message: "功能主治不能为空", trigger: "blur" }],
|
|
|
dosage: [{ required: true, message: "用法用量不能为空", trigger: "blur" }],
|
|
|
adverseReactions: [{ required: true, message: "不良反应不能为空", trigger: "blur" }],
|
|
|
@@ -1171,12 +1163,12 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
this.ingredientError = '';
|
|
|
// 清除验证状态
|
|
|
this.$nextTick(() => {
|
|
|
if (this.$refs.form) {
|
|
|
this.$refs.form.clearValidate([
|
|
|
+ 'storageConditions',
|
|
|
'indications',
|
|
|
'ingredient',
|
|
|
'dosage',
|
|
|
@@ -1186,7 +1178,6 @@ export default {
|
|
|
]);
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
// 只有当两个值都存在时才进行检查(排除初始化情况)
|
|
|
if (newVal && this.form.storeId && this.isFormInitialized) {
|
|
|
this.debounceCheckStoreLicense();
|
|
|
@@ -1365,7 +1356,6 @@ export default {
|
|
|
title: "",
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
-
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
@@ -1512,24 +1502,6 @@ export default {
|
|
|
manufacturerAddress: [
|
|
|
{required: true, message: "生产企业地址不能为空", trigger: "blur"}
|
|
|
],
|
|
|
- // reviewAudit: [
|
|
|
- // {required: true, message: "审核资质不能为空!", trigger: "blur"}
|
|
|
- // ],
|
|
|
- // businessLink: [
|
|
|
- // { required: true, message: "非首营链接不能为空!", trigger: "change" }
|
|
|
- // ],
|
|
|
- // business: [
|
|
|
- // { required: true, message: "生产企业营业执照不能为空!", trigger: ["blur", "change"] },
|
|
|
- // { whitespace: true, message: "生产企业营业执照不能为空白!", trigger: ["blur", "change"] }
|
|
|
- // ],
|
|
|
- // license: [
|
|
|
- // { required: true, message: "生产企业的生产许可证/备案凭证不能为空!", trigger: ["blur", "change"] },
|
|
|
- // { whitespace: true, message: "生产企业的生产许可证/备案凭证不能为空白!", trigger: ["blur", "change"]}
|
|
|
- // ],
|
|
|
- // certificate: [
|
|
|
- // { required: true, message: "商品注册证/备案凭证不能为空!", trigger: ["blur", "change"] },
|
|
|
- // { whitespace: true, message: "商品注册证/备案凭证不能为空白!", trigger: ["blur", "change"]}
|
|
|
- // ],
|
|
|
businessExpire: [
|
|
|
{ required: true, message: "生产企业营业执照有效期不能为空!", trigger: "change" }
|
|
|
],
|
|
|
@@ -1545,9 +1517,6 @@ export default {
|
|
|
voucherExpire: [
|
|
|
{ required: true, message: "Ⅰ类Ⅱ类备案凭证有效期不能为空!", trigger: "change" }
|
|
|
],
|
|
|
- // gmpAuth: [
|
|
|
- // { required: true, message: "GMP认证不能为空!", trigger: "blur" }
|
|
|
- // ],
|
|
|
indications: [
|
|
|
{ required: true, message: "功能主治不能为空", trigger: "blur" }
|
|
|
],
|
|
|
@@ -1803,30 +1772,6 @@ export default {
|
|
|
handleFullScreen() {
|
|
|
this.isFullscreen = !this.isFullscreen;
|
|
|
},
|
|
|
- handleSuccess(response, file) {
|
|
|
- // 上传成功后的回调函数
|
|
|
- this.myloading.close();
|
|
|
- //this.form.video = response.url;
|
|
|
- this.$refs.upload.clearFiles();
|
|
|
- },
|
|
|
- beforeUpload(file) {
|
|
|
- // 上传前的钩子函数,可以在这里对文件进行处理
|
|
|
- // 返回 false 则取消上传
|
|
|
-
|
|
|
- // 例如限制文件大小
|
|
|
- const isLt2M = file.size / 1024 / 1024 < 200;
|
|
|
- if (!isLt2M) {
|
|
|
- this.$message.error('上传视频文件大小不能超过 200MB!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- this.myloading = this.$loading({
|
|
|
- lock: true,
|
|
|
- text: '上传中',
|
|
|
- spinner: 'el-icon-loading',
|
|
|
- background: 'rgba(0, 0, 0, 0.7)'
|
|
|
- });
|
|
|
-
|
|
|
- },
|
|
|
// 提交上传文件
|
|
|
submitFileForm() {
|
|
|
this.$refs.upload.submit();
|
|
|
@@ -1843,10 +1788,6 @@ export default {
|
|
|
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
|
|
|
this.getList();
|
|
|
},
|
|
|
- handleImport() {
|
|
|
- this.upload.title = "商品导入";
|
|
|
- this.upload.open = true;
|
|
|
- },
|
|
|
importTemplate() {
|
|
|
importTemplate().then(response => {
|
|
|
this.download(response.msg);
|
|
|
@@ -2324,6 +2265,9 @@ export default {
|
|
|
this.$message.error(manualErrors.join('\n'));
|
|
|
return;
|
|
|
}
|
|
|
+ if(!this.form.productType){
|
|
|
+ return this.$message.warning('商品类型不能为空!');
|
|
|
+ }
|
|
|
// 3. 检查店铺许可证权限
|
|
|
if (this.storeLicenseCheckFailed) {
|
|
|
this.$message.error('当前店铺无权限经营该类商品,请重新选择分类或店铺');
|
|
|
@@ -2363,7 +2307,6 @@ export default {
|
|
|
executeSubmit() {
|
|
|
let checkBoolean = false;
|
|
|
let itemErrMsg = "";
|
|
|
-
|
|
|
if (this.form.specType === 0) {
|
|
|
this.form.items = [];
|
|
|
this.form.values = this.oneFormValidate;
|
|
|
@@ -2371,7 +2314,6 @@ export default {
|
|
|
this.form.items = this.attrs;
|
|
|
this.form.values = this.manyFormValidate;
|
|
|
}
|
|
|
-
|
|
|
// 验证规格数据
|
|
|
const validateItem = (item) => {
|
|
|
if (item.barCode == null || item.barCode === '') {
|
|
|
@@ -2388,7 +2330,6 @@ export default {
|
|
|
}
|
|
|
return null;
|
|
|
};
|
|
|
-
|
|
|
// 遍历检查每个规格项
|
|
|
for (let i = 0; i < this.form.values.length; i++) {
|
|
|
const item = this.form.values[i];
|
|
|
@@ -2399,23 +2340,19 @@ export default {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
if (checkBoolean) {
|
|
|
this.$message.warning(itemErrMsg);
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
if (this.form.specType === 1 && this.manyFormValidate.length === 0) {
|
|
|
this.$message.warning('请点击生成包装规格!');
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
// 处理其他业务逻辑...
|
|
|
// 设置永久有效标识
|
|
|
this.form.isBusinessPermanent = this.businessValue ? 1 : 0;
|
|
|
this.form.isLicensePermanent = this.licenseValue ? 1 : 0;
|
|
|
this.form.isCertificatePermanent = this.certificateValue ? 1 : 0;
|
|
|
-
|
|
|
// 调用API提交数据
|
|
|
oneClickStorage(this.form).then(response => {
|
|
|
if (response.code === 200) {
|
|
|
@@ -2425,27 +2362,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
- /**
|
|
|
- * 复制商品
|
|
|
- * **/
|
|
|
- productCopy(row) {
|
|
|
- this.$confirm('确认是否复制当前《' + row.productName + '》商品!', '复制商品', {
|
|
|
- confirmButtonText: '确 认',
|
|
|
- cancelButtonText: '取 消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- copyProduct(row).then(response => {
|
|
|
- if (response.code === 200) {
|
|
|
- this.$message.success("操作成功!")
|
|
|
- this.getList();
|
|
|
- }
|
|
|
- })
|
|
|
- }).catch(() => {
|
|
|
-
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
// 清空所有证书过期错误提示
|
|
|
clearExpireErrors() {
|
|
|
this.businessExpireError = '';
|
|
|
@@ -2489,7 +2405,6 @@ export default {
|
|
|
this.$set(this.rules, 'indications', [
|
|
|
{ required: true, message: "功能主治不能为空", trigger: "blur" }
|
|
|
]);
|
|
|
-
|
|
|
this.$set(this.rules, 'ingredient', [
|
|
|
{ required: true, message: "成分不能为空", trigger: "blur" },
|
|
|
{
|
|
|
@@ -2503,19 +2418,15 @@ export default {
|
|
|
trigger: "blur"
|
|
|
}
|
|
|
]);
|
|
|
-
|
|
|
this.$set(this.rules, 'dosage', [
|
|
|
{ required: true, message: "用法用量不能为空", trigger: "blur" }
|
|
|
]);
|
|
|
-
|
|
|
this.$set(this.rules, 'adverseReactions', [
|
|
|
{ required: true, message: "不良反应不能为空", trigger: "blur" }
|
|
|
]);
|
|
|
-
|
|
|
this.$set(this.rules, 'contraindications', [
|
|
|
{ required: true, message: "禁忌不能为空", trigger: "blur" }
|
|
|
]);
|
|
|
-
|
|
|
this.$set(this.rules, 'precautions', [
|
|
|
{ required: true, message: "注意事项不能为空", trigger: "blur" }
|
|
|
]);
|