From 8bf8713da9f9ebf844af7ceefd462c2966070128 Mon Sep 17 00:00:00 2001 From: jinlin <jinlin> Date: 星期一, 15 七月 2024 08:34:37 +0800 Subject: [PATCH] 修改 --- web/src/views/modules/basicInfo/XhProductModel-AddOrUpdate.vue | 22 +++++++++------------- 1 files changed, 9 insertions(+), 13 deletions(-) diff --git a/web/src/views/modules/basicInfo/XhProductModel-AddOrUpdate.vue b/web/src/views/modules/basicInfo/XhProductModel-AddOrUpdate.vue index 361ed3c..f48641b 100644 --- a/web/src/views/modules/basicInfo/XhProductModel-AddOrUpdate.vue +++ b/web/src/views/modules/basicInfo/XhProductModel-AddOrUpdate.vue @@ -1,7 +1,7 @@ <template> <zt-dialog ref="dialog" @confirm="formSubmit"> <el-form :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" label-width="120px"> - <zt-form-item label="涓婄骇绯荤粺" prop="pid" v-if="isTree"> + <zt-form-item label="涓婄骇绯荤粺" prop="pid" v-if="isShow"> <zt-combo-tree v-model="dataForm.pid" :datas="productList"/> </zt-form-item> <zt-form-item label="鍚嶇О" prop="name" rules="required"> @@ -33,7 +33,6 @@ return { disabled: false, url: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getSvgImage?token=${Cookies.get('token')}&id=`, - isTree: false, isShow: true, fileId: '', productList: [], @@ -54,9 +53,13 @@ }, methods: { init(id, params) { - if (params.type === 'tree') { - this.isTree = true + if (params.type === 'xh') { this.isShow = false + this.dataForm.pid = null + this.dataForm.productType = 5 + } else if (params.type === 'zt') { + this.dataForm.pid = params.pid + this.dataForm.productType = 4 this.getProductList() } else { this.dataForm.pid = params.pid @@ -65,7 +68,6 @@ if (this.dataForm.productType === 10 && id == null) { this.getDefaultImg(this.dataForm.productType) } - this.disabled = !!id; }, // 鑾峰彇绯荤粺鍒楄〃 async getProductList() { @@ -101,18 +103,12 @@ // 琛ㄥ崟鎻愪氦 async formSubmit() { let flag = true - if (this.isTree) { - if (this.dataForm.productType !== '5' || this.dataForm.productType !== '4') { - this.$alert("涓嶆敮鎸佹柊澧炴鑺傜偣") - flag = false - } - } else { - if (this.dataForm.productType === '5' || this.dataForm.productType === '4') { + if (this.isShow) { + if (this.dataForm.productType === '5') { this.$alert("涓嶆敮鎸佹柊澧炴鑺傜偣") flag = false } } - if (!flag) { return } -- Gitblit v1.9.1