From 99587f7a5b5daf2f8eef939cd65df37bb0cb035e Mon Sep 17 00:00:00 2001
From: feige <feige@qq.com>
Date: 星期二, 08 八月 2023 18:33:47 +0800
Subject: [PATCH] 婚姻编辑已经可以了

---
 ruoyi-ui/src/views/doctor/index.vue |  114 +++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 78 insertions(+), 36 deletions(-)

diff --git a/ruoyi-ui/src/views/doctor/index.vue b/ruoyi-ui/src/views/doctor/index.vue
index 8c1842f..f413210 100644
--- a/ruoyi-ui/src/views/doctor/index.vue
+++ b/ruoyi-ui/src/views/doctor/index.vue
@@ -52,6 +52,14 @@
       </el-form-item>
 
       <el-form-item label="绫诲埆" prop="type">
+<!--        <el-input-->
+<!--          v-model="queryParams.type"-->
+<!--          placeholder="璇疯緭鍏ョ棁鐘�"-->
+<!--          clearable-->
+<!--          style="width: 240px"-->
+<!--          @keyup.enter.native="handleQuery">-->
+<!--          <i slot="prefix" class="el-input__icon el-icon-search"></i>-->
+<!--        </el-input>-->
         <el-select
           v-model="queryParams.type"
           placeholder="鎵�鏈夌被鍒�"
@@ -195,8 +203,8 @@
       <el-table-column type="selection" :reserve-selection="true" width="25"  align="center" />
       <el-table-column fixed label="搴忓彿" sortable type="index" align="center" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="60"/>
       <el-table-column label="绫诲瀷" prop="type" sortable width="80" align="center">
-        <template slot-scope="scope">{{ getSrc(scope.row.type) }}</template>
-<!--        <template slot-scope="scope">{{scope.row.type? scope.row.type: '鈥斺�斺�斺��'}}</template>-->
+<!--        <template slot-scope="scope">{{ getSrc(scope.row.type) }}</template>-->
+        <template slot-scope="scope">{{scope.row.type? scope.row.type: '鈥斺�斺�斺��'}}</template>
       </el-table-column>
       <el-table-column label="鐥囩姸" prop="symptom" sortable :show-overflow-tooltip="true" width="120" align="center" >
         <template slot-scope="scope">{{scope.row.symptom? scope.row.symptom: '鈥斺�斺�斺��'}}</template>
@@ -223,22 +231,24 @@
           </el-table-column>
         <el-table-column label="鐢靛瓙鏂囦欢" prop="url" width="160" align="center">
              <template slot-scope="scope" >
-               <img
-                 class="el-upload-list__item-thumbnail"
-                 src="../../assets/images/deviceLis.png"
-                 alt=""
-                 style="width: 35px; height: 35px;"
-                 fit="cover"
-                  v-if="scope.row.url !== ','"
-               >
-        <img
-                 class="el-upload-list__item-thumbnail"
-                 src="../../assets/images/deviceA.png"
-                 alt=""
-                 style="width: 35px; height: 35px;"
-                 fit="cover"
-                  v-if="scope.row.url ===',' "
-               >
+               <div  @click="handleCheck(scope.row)">
+                 <img
+                   class="el-upload-list__item-thumbnail"
+                   src="../../assets/images/deviceLis.png"
+                   alt=""
+                   style="width: 35px; height: 35px;"
+                   fit="cover"
+                   v-if="!(scope.row.url === '' || scope.row.url === ',' || scope.row.url === null)"
+                 >
+                 <img
+                   v-else
+                   class="el-upload-list__item-thumbnail"
+                   src="../../assets/images/deviceA.png"
+                   alt=""
+                   style="width: 35px; height: 35px;"
+                   fit="cover"
+
+                 ></div>
              </template>
           </el-table-column>
 
@@ -288,6 +298,7 @@
             <el-option v-for="(item, index) in typeOptions" :key="index" :label="item.label" :value="item.value"
             ></el-option>
           </el-select>
+          <el-input v-model="newOption" v-if="showInput" placeholder="鑻ユ湭鍦ㄤ笂杩伴�夐」涓壘鍒板搴旂被鍒紝璇峰湪姝よ緭鍏ユ柊鐨勭被鍒�" @change="addNewOption"></el-input>
         </el-form-item>
 
         <el-form-item label="鐥囩姸" prop="symptom">
@@ -363,7 +374,7 @@
           class="upload-demo"
           multiple
 
-          :on-remove="handleRemove"
+          :on-remove="handleRemoveFile"
           :http-request="requestUpload"
           :show-file-list="true"
         >
@@ -437,11 +448,8 @@
       dateRange: [],
       // 鏁版嵁鑼冨洿閫夐」
       fot:[".jpg",".jif"],
-      fileList:[
-      ],
-      fileListOther:[
-
-      ],
+      fileList:[],
+      fileListOther:[],
       dsb:true,
       btn:false,
       fit:['fill'],
@@ -487,7 +495,7 @@
       rules: {
 
         type: [{
-          required: true,
+          // required: true,
           message: '璇疯緭鍏ョ被鍨�',
           trigger: 'blur'
         }],
@@ -538,6 +546,8 @@
         value:'鍐呯',
         label:'鍐呯'
       }],
+      newOption: undefined,
+      showInput: true
     };
   },
   created() {
@@ -562,6 +572,14 @@
         return "statistics-warning-row";
       }
     },
+    //绫诲埆
+    addNewOption() {
+      const newOption = this.newOption.trim();
+      if (newOption && !this.typeOptions.includes(newOption)) {
+        this.typeOptions.push(newOption);
+        this.$set(this.formDat, 'type', newOption); // 鏇存柊formDat.type鐨勫�间负鏂扮殑閫夐」
+      }
+    },
     /** 鏌ヨ璁板綍鍒楄〃 */
     getList() {
       this.loading = true;
@@ -578,16 +596,16 @@
       );
     },
     /** 鏌ヨ绫诲埆淇℃伅 */
-    getCateInfor()
-    {
-      let _this = this
-      getCategory().then(response=>{
-
-        response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{
-          _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]})
-        })
-      })
-    },
+    // getCateInfor()
+    // {
+    //   let _this = this
+    //   getCategory().then(response=>{
+    //
+    //     response.data.itemValues.replace("{","").replace("}","").split(",").map(elem=>{
+    //       _this.typeOptions.push({"label":elem.split(":")[0], "value":elem.split(":")[0]})
+    //     })
+    //   })
+    // },
 //绫诲埆閫夋嫨
     getSrc(type) {
       if (type === '绁炵粡绉�'){
@@ -601,7 +619,18 @@
       }
     },
     handleRemove(file) {
-      alert(323)
+      for(let i = 0; i < this.fileList.length; i++)
+      {
+        if(this.fileList[i].url==file.url)
+          this.$delete(this.fileList,i);
+      }
+    },
+    handleRemoveFile(file) {
+      for(let i = 0; i < this.fileListOther.length; i++)
+      {
+        if(this.fileListOther[i].url==file.url)
+          this.$delete(this.fileListOther,i);
+      }
     },
     // 鍙栨秷鎸夐挳
     cancel() {
@@ -716,6 +745,10 @@
           });
         }
       });
+      // 娓呯┖formDat瀵硅薄鐨勬暟鎹�
+      Object.keys(this.formDat).forEach(key => {
+        this.formDat[key] = '';
+      });
     },
     requestUpload(params)
     {
@@ -785,6 +818,15 @@
     }).catch(() => { Message({ message: "瀵煎叆澶辫触", type: 'error' })});
 
     }
+  },
+  watch: {
+    type(value) {
+      if (value === '') {
+        this.showInput = true;
+      } else {
+        this.showInput = false;
+      }
+    }
   }
 };
 </script>

--
Gitblit v1.9.1