From 16ad3d3ac0e7d477ce6d001cc7adc17ecc5d8879 Mon Sep 17 00:00:00 2001
From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com>
Date: 星期三, 20 十二月 2023 14:28:07 +0800
Subject: [PATCH] qxtj

---
 src/views/system/dept/index.vue |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue
index 7a80b72..196b9ff 100644
--- a/src/views/system/dept/index.vue
+++ b/src/views/system/dept/index.vue
@@ -227,7 +227,7 @@
         label-width="110px"
         :inline="true"
       >
-        <el-form-item label="涓婄骇绉戝" prop="parentName">
+        <el-form-item label="涓婄骇绉戝" prop="parentId">
           <el-select
             v-model="form.parentId"
             placeholder="璇烽�夋嫨涓婄骇绉戝"
@@ -255,9 +255,9 @@
         <el-form-item label="鏄剧ず椤哄簭" prop="orderNum">
           <el-input v-model="form.orderNum" placeholder="璇疯緭鍏ユ樉绀洪『搴�" />
         </el-form-item>
-        <el-form-item label="鎵�灞炲尰闄�" prop="hospName">
+        <el-form-item label="鎵�灞炲尰闄�" prop="hospId">
           <el-select
-            v-model="form.hospName"
+            v-model="form.hospId"
             placeholder="璇烽�夋嫨鎵�灞炲尰闄�"
             clearable
             filterable
@@ -478,7 +478,7 @@
         departmentCode: [
           { required: true, validator: checkPhoneNum, trigger: "blur" },
         ],
-        hospName: [
+        hospId: [
           { required: true, validator: checkPhoneNum, trigger: "blur" },
         ],
         // email: [
@@ -656,8 +656,14 @@
     },
     /** 淇敼鎸夐挳鎿嶄綔 */
     handleUpdate(row) {
-      this.reset();
+      // console.log(11111)
+      // this.reset();
       this.form = row;
+      console.log(this.form )
+      // this.form.parentId = this.form.parentId.toString()
+      if(this.form.parentId == 0){
+        this.deptOption.push({ "id": 0, "label": "涓荤被鐩�", });
+      }
       this.open = true;
       this.title = "绉戝淇℃伅缁存姢  ";
       // getDept(row.deptId).then((response) => {
@@ -682,11 +688,16 @@
       this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.deptId != undefined) {
-            updateDept(this.form).then((response) => {
+            if(this.form.hospId && this.form.hospCode){
+              updateDept(this.form).then((response) => {
               this.$modal.msgSuccess("淇敼鎴愬姛");
               this.open = false;
               this.getList();
             });
+            }else{
+              this.$modal.msgError("璇峰~鍐欏甫鏄熷彿");
+            }
+           
           } else {
             this.hospList.forEach((element) => {
               if (this.form.hospName == element.hospAreaName) {

--
Gitblit v1.8.0