From 7546165f6a616777fdfd390327ac3aacc67d9d8f Mon Sep 17 00:00:00 2001 From: qx <1084500556@qq.com> Date: 星期四, 08 五月 2025 17:54:54 +0800 Subject: [PATCH] Merge branch 'master' of http://101.42.27.146:5001/r/ltkj_peisweb --- src/views/system/comp/index.vue | 29 +++++++++++++++++------------ 1 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/views/system/comp/index.vue b/src/views/system/comp/index.vue index 56b7442..a2790d2 100644 --- a/src/views/system/comp/index.vue +++ b/src/views/system/comp/index.vue @@ -1236,8 +1236,8 @@ > <el-form-item label="鍗曚綅绫诲瀷" prop="isZybUnit"> <el-radio-group v-model="form.isZybUnit"> - <el-radio :label="false">鏅�氬崟浣�</el-radio> - <el-radio :label="true">鑱屼笟鐥呭崟浣�</el-radio> + <el-radio :label="0">鏅�氬崟浣�</el-radio> + <el-radio :label="1">鑱屼笟鐥呭崟浣�</el-radio> </el-radio-group> </el-form-item> <el-form-item @@ -1476,7 +1476,7 @@ id: "", // 琛ㄥ崟鍙傛暟 form: { - isZybUnit: false, + isZybUnit: 0, }, lastXianPrice: 0, forms: { @@ -1555,6 +1555,7 @@ return this.sfzs === "Y"; }, }, + created() { this.getList(); }, @@ -1718,6 +1719,7 @@ validTime: null, wbm: null, deleted: null, + isZybUnit: 0 }; this.resetForm("form"); }, @@ -1777,6 +1779,7 @@ /** 鏂板鎸夐挳鎿嶄綔 */ handleAdd() { this.reset(); + this.form.isZybUnit = 0; this.open = true; this.title = "娣诲姞浣撴鍗曚綅淇℃伅缁存姢"; }, @@ -1785,7 +1788,10 @@ this.reset(); const drugManufacturerId = row.drugManufacturerId || this.ids; getComp(drugManufacturerId).then((response) => { - this.form = response.data; + // 涓嶈鐩存帴璧嬪�兼暣涓� response.data锛岃�屾槸閫愪釜灞炴�ц祴鍊� + Object.assign(this.form, response.data); + this.form.isZybUnit = response.data.isZybUnit === true ? 1 : 0; + console.log('淇敼鏃剁殑 isZybUnit 鍊�:', this.form.isZybUnit); this.open = true; this.title = "淇敼浣撴鍗曚綅淇℃伅缁存姢"; }); @@ -1823,7 +1829,6 @@ new Big(0) ).toNumber(); }); - // ---------------------------------------------------------- }) .catch(() => { this.youhui = oldValue; @@ -2423,19 +2428,19 @@ submitForm() { this.$refs["form"].validate((valid) => { if (valid) { + const submitData = { + ...this.form, + isZybUnit: Boolean(this.form.isZybUnit) // 杞崲涓哄竷灏斿�� + }; if (this.form.drugManufacturerId != null) { - updateComp(this.form).then((response) => { + updateComp(submitData).then((response) => { this.$modal.msgSuccess("淇敼鎴愬姛"); this.open = false; this.getList(); }); } else { - if ( - this.form.cnName && - this.form.contactPerson && - this.form.contactPhone - ) { - addComp(this.form).then((response) => { + if (this.form.cnName && this.form.contactPerson && this.form.contactPhone) { + addComp(submitData).then((response) => { this.$modal.msgSuccess("鏂板鎴愬姛"); this.open = false; this.getList(); -- Gitblit v1.8.0