From 33b53ec9f9804067fa30fe0b8d5e16a0ae2368e1 Mon Sep 17 00:00:00 2001 From: lkk <364857242@qq.com> Date: 星期一, 20 一月 2025 17:24:28 +0800 Subject: [PATCH] 111 --- src/views/hosp/advicerules/index.vue | 63 ++++++++++++++++--------------- 1 files changed, 33 insertions(+), 30 deletions(-) diff --git a/src/views/hosp/advicerules/index.vue b/src/views/hosp/advicerules/index.vue index 5ffd937..57f406d 100644 --- a/src/views/hosp/advicerules/index.vue +++ b/src/views/hosp/advicerules/index.vue @@ -236,12 +236,13 @@ v-model="form.ks" placeholder="璇烽�夋嫨绉戝" style="width: 200" + @change="idFn" > <el-option v-for="item in departmentOptions" - :key="item.value" + :key="item.id" :label="item.label" - :value="item.value" + :value="item.label" /> </el-select> </el-form-item> @@ -596,16 +597,19 @@ this.total = response.total; this.loading = false; }); - deptTreeSelect().then((response) => { - this.departmentOptions = response.data[0].children; - console.log(response, 999); + }, + + idFn(value) { + console.log("Selected Value:", value); + this.departmentOptions.forEach((item) => { + console.log(this.departmentOptions, 333); + console.log(item, 555); + + if (item.value == value) { + this.form.ks = item.label; + } }); }, - /* getDeptTree() { - deptTreeSelect().then((response) => { - this.deptOption = response.data; - }); - }, */ // 鍙栨秷鎸夐挳 cancel() { this.open = false; @@ -653,7 +657,7 @@ handleSelectionChange1(selection) { this.ChangeList = selection; - this.ids = selection.map((item) => item.aid); + this.ids = selection.map((item) => item.id); this.single = selection.length !== 1; this.multiple = !selection.length; if (selection.length > 1) { @@ -690,12 +694,9 @@ /* 寮规纭畾鎸夐挳 */ submit() { - console.log(this.ChangeList, 123); this.ChangeList.forEach((item) => { - console.log(item.title, 6363); this.form.jymc = item.title; - console.log(this.form.adviceBt, 2525); this.form.jynr = item.advice; // this.sfxmId = parseInt(item.id); @@ -715,6 +716,10 @@ this.reset(); this.open = true; this.title = "娣诲姞浣撴椤圭洰寤鸿瑙勫垯鏂拌〃"; + deptTreeSelect().then((response) => { + this.departmentOptions = response.data[0].children; + console.log(response, 999); + }); }, /** 淇敼鎸夐挳鎿嶄綔 */ handleUpdate(row) { @@ -725,41 +730,39 @@ this.open = true; this.title = "淇敼浣撴椤圭洰寤鸿瑙勫垯鏂拌〃"; }); + deptTreeSelect().then((response) => { + this.departmentOptions = response.data[0].children; + console.log(response, 999); + }); }, + submitForm() { this.$refs["form"].validate((valid) => { if (valid) { - this.columns.forEach((column) => { - if (column.htmlType === "checkbox") { - // 灏嗛�変腑鐨� checkbox 鍊肩敤閫楀彿鍒嗛殧 - this.form[column.javaField] = - this.form[column.javaField].join(","); - } - }); - if (this.table.sub) { - this.form.subclassNameList = this.subclassNameList; // 鍋囪 subclassNameList 鏄瓙琛ㄦ牸鐨勬暟鎹� - } - if (this.form[pkColumn.javaField] != null) { + if (this.form.id != null) { updateAdvicerules(this.form).then((response) => { + console.log(response, 1111333); + this.$modal.msgSuccess("淇敼鎴愬姛"); this.open = false; - this.getList(); // 鍒锋柊鍒楄〃 + this.getList(); }); } else { - // 濡傛灉涓婚敭瀛楁涓虹┖锛岃繘琛屾柊澧炴搷浣� addAdvicerules(this.form).then((response) => { this.$modal.msgSuccess("鏂板鎴愬姛"); this.open = false; - this.getList(); // 鍒锋柊鍒楄〃 + this.getList(); }); } } }); }, handleDelete(row) { - const pkValue = row[pkColumn.javaField] || this.ids; // 鑾峰彇涓婚敭鍊硷紝濡傛灉row涓病鏈変富閿�硷紝鍒欎娇鐢╰his.ids + console.log(row,6677); + + const pkValue = row.id; // 鑾峰彇涓婚敭鍊硷紝濡傛灉row涓病鏈変富閿�硷紝鍒欎娇鐢╰his.ids this.$modal - .confirm(`鏄惁纭鍒犻櫎${functionName}缂栧彿涓�"${pkValue}"鐨勬暟鎹」锛焋) + .confirm(`鏄惁纭鍒犻櫎${row.ks}缂栧彿涓�"${pkValue}"鐨勬暟鎹」锛焋) .then(() => { return delAdvicerules(pkValue); // 璋冪敤鍒犻櫎鎺ュ彛锛屼紶鍏ヤ富閿�� }) -- Gitblit v1.8.0