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/marry/index.vue |   91 ++++++++++++++++++++++++---------------------
 1 files changed, 49 insertions(+), 42 deletions(-)

diff --git a/ruoyi-ui/src/views/marry/index.vue b/ruoyi-ui/src/views/marry/index.vue
index 3ba3e90..4f41c1e 100644
--- a/ruoyi-ui/src/views/marry/index.vue
+++ b/ruoyi-ui/src/views/marry/index.vue
@@ -8,16 +8,7 @@
     </el-backtop>
     <h2 style="font-size:30px;padding-top:0px">濠氬Щ鐘跺喌鐧昏琛�</h2>
     <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['system:role:add']"
-        >鏂板</el-button>
-      </el-col>
+
       <el-col :span="1.5">
         <el-button
           type="warning"
@@ -68,11 +59,11 @@
 
                   </template>
                   <template v-else>
-                    <el-select v-model="marryList.marryStatus" placeholder="璇烽�夋嫨濠氬Щ鐘舵��" clearable :style="{width: '100%'}">
-                      <el-option label="鏈" value="0"></el-option>
-                      <el-option label="鍒濆" value="1"></el-option>
-                      <el-option label="绂诲" value="2"></el-option>
-                      <el-option label="鍐嶅" value="3"></el-option>
+                    <el-select v-model="mrs" placeholder="璇烽�夋嫨濠氬Щ鐘舵��" clearable :style="{width: '100%'}">
+                      <el-option label="鏈" value='0'></el-option>
+                      <el-option label="鍒濆" value='1'></el-option>
+                      <el-option label="绂诲" value='2'></el-option>
+                      <el-option label="鍐嶅" value='3'></el-option>
 
                     </el-select>
                   </template>
@@ -99,12 +90,12 @@
 
                 <el-form-item label="鎬у埆" prop="sex" label-width="40px">
                  <template v-if="!isEditing">
-                 <el-input v-model="marryList.sex === 1 ? sinds='鐢�':sinds='濂�'" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
+                 <el-input v-model="marryList.sex === '鐢�' ? sinds='鐢�':sinds='濂�'" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
                  </template>
                  <template v-else>
                  <el-select v-model="sinds" placeholder="璇烽�夋嫨鎬у埆" clearable :style="{width: '100%'}" :disabled="dsb">
-                   <el-option label="鐢�" value='1'></el-option>
-                   <el-option label="濂�" value='0'></el-option>
+                   <el-option label="鐢�" value='鐢�'></el-option>
+                   <el-option label="濂�" value='濂�'></el-option>
                  </el-select>
                  </template>
                 </el-form-item>
@@ -147,11 +138,7 @@
             >缂栬緫</el-button>
             <el-button v-if="isShow_2" type="primary" @click="submitForm" :disabled="dsb">瀹屾垚</el-button>
             <br>
-            <el-button
-              type="primary"
-              @click="handleExport"
-              v-hasPermi="['family:note:export']"
-            >瀵煎嚭</el-button>
+
           </el-row>
 
         </el-container>
@@ -193,7 +180,7 @@
 
                   </template>
                   <template v-else>
-                    <el-select v-model="marryList.spouseMarryStatus" placeholder="璇烽�夋嫨濠氬Щ鐘舵��" clearable :style="{width: '100%'}">
+                    <el-select v-model="smrs" placeholder="璇烽�夋嫨濠氬Щ鐘舵��" clearable :style="{width: '100%'}">
                       <el-option label="鏈" value="0"></el-option>
                       <el-option label="鍒濆" value="1"></el-option>
                       <el-option label="绂诲" value="2"></el-option>
@@ -223,12 +210,12 @@
                 <el-form-item label="鎬у埆" prop="spouseSex" label-width="40px">
 
                   <template v-if="!isEditing">
-                  <el-input v-model="marryList.spouseSex === 1 ? inds='鐢�':inds='濂�'" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
+                  <el-input v-model="marryList.spouseSex === '鐢�' ? inds='鐢�':inds='濂�'" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"></el-input>
                   </template>
                   <template v-else>
                   <el-select v-model="inds" placeholder="璇烽�夋嫨鎬у埆" clearable :style="{width: '100%'}" :disabled="dsb">
-                    <el-option label="鐢�" value='1'></el-option>
-                    <el-option label="濂�" value='0'></el-option>
+                    <el-option label="鐢�" value='鐢�'></el-option>
+                    <el-option label="濂�" value='濂�'></el-option>
                   </el-select>
                   </template>
 
@@ -739,10 +726,10 @@
       noneBtnImg:false,
       limitCountImg:1,//涓婁紶鍥剧墖鐨勬渶澶ф暟閲�
       //涓汉淇℃伅鏁版嵁
-      marryList:[],
+      marryList:{},
       fit:['fill'],
 
-      oldSpouseList:[],
+      oldSpouseList:{},
       //涓嬫媺瀹炵幇
       activeNames:['1'],
       // 寮瑰嚭灞傛爣棰�
@@ -751,6 +738,8 @@
       open: false,
       // open:true,
       // 鏄惁鏄剧ず寮瑰嚭灞傦紙鏁版嵁鏉冮檺锛�
+      mrs:undefined,
+      smrs:undefined,
       openDataScope: false,
       menuExpand: false,
       menuNodeAll: false,
@@ -949,13 +938,13 @@
         console.log(response.data)
           if(response.data.length == 0){
             this.loading = false;
-            this.marryList=[];
-            this.total = 0;
-            this.oldSpouseList = [];
+            this.marryList={};
+
+            this.oldSpouseList = {};
           }
           else{
             this.marryList = response.data;
-            this.total = response.data.total;
+
             this.oldSpouseList = this.marryList.oldSpouseList;
             this.loading = false;
 
@@ -1055,7 +1044,22 @@
       this.isShow=false
       this.isShow_2=true
       this.isEditing=true
-
+   if(this.marryList.marryStatus == 0)
+          this.mrs = '鏈'
+      else if(this.marryList.marryStatus == 1)
+          this.mrs = '鍒濆'
+          else if(this.marryList.marryStatus == 2)
+              this.mrs = '绂诲'
+      else
+          this.mrs = '鍐嶅'// this.isEdit=false
+       if(this.marryList.spouseMarryStatus == 0)
+              this.smrs = '鏈'
+          else if(this.marryList.spouseMarryStatus == 1)
+              this.smrs = '鍒濆'
+              else if(this.marryList.spouseMarryStatus == 2)
+                  this.smrs = '绂诲'
+          else
+              this.smrs = '鍐嶅'// this.isEdit=false
       // this.isEdit=false
     },
 
@@ -1137,14 +1141,12 @@
     //淇敼鍚庣殑淇濆瓨
 
     submitForm() {
-      let ul = this.fileList.map(function (elem){
-        return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
-      }).join(",")
-      let uls = this.fileListOther.map(function (elem){
-        return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
-      }).join(",")
-      this.marryList.url = ul+","+uls
-
+     if(parseInt(this.mrs))
+      this.marryList.marryStatus = parseInt(this.mrs)
+      if(parseInt(this.smrs))
+       this.marryList.spouseMarryStatus = parseInt(this.smrs)
+     this.marryList.sex = this.sinds
+     this.marryList.spouseSex = this.inds
       this.$refs['elForm'].validate(valid => {
         if (valid) {
           if (this.marryList.id !== undefined) {
@@ -1152,6 +1154,11 @@
               this.$modal.msgSuccess("淇敼鎴愬姛");
               // this.open = false;
               this.btn=false
+              this.isEditing = false
+              this.dsb = true
+              this.isShow_2=false
+              this.isShow = true
+
             });
           } else {
             this.$modal.msgSuccess("淇敼澶辫触");

--
Gitblit v1.9.1