From 61cfd79f90f7463ba1f9149d8d988bb081f6a3a1 Mon Sep 17 00:00:00 2001
From: feige <791364011@qq.com>
Date: 星期四, 29 八月 2024 12:30:19 +0800
Subject: [PATCH] Merge branch 'master' of http://47.93.189.255:8099/r/zhangshi_app_web
---
ruoyi-ui/src/views/marry/index.vue | 92 +++++++++++++++++++++++++++++++++++-----------
1 files changed, 70 insertions(+), 22 deletions(-)
diff --git a/ruoyi-ui/src/views/marry/index.vue b/ruoyi-ui/src/views/marry/index.vue
index 19720b4..5957b93 100644
--- a/ruoyi-ui/src/views/marry/index.vue
+++ b/ruoyi-ui/src/views/marry/index.vue
@@ -278,7 +278,7 @@
<div class="title-wrapper">
<div>
<el-button class="button" size="mini" type="text" @click="handleAdd">
- <sapn v-html="'\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'"></sapn></el-button>
+ <span v-html="'\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'"></span></el-button>
</div>
@@ -295,8 +295,8 @@
<template slot-scope="scope">
<template v-if="!scope.row.isEdit">{{ scope.row.sex }}</template>
<template v-else><el-select v-model="scope.row.sex" placeholder="璇烽�夋嫨">
- <el-option label="濂�" value="0"></el-option>
- <el-option label="鐢�" value="1"></el-option>
+ <el-option label="濂�" value='濂�'></el-option>
+ <el-option label="鐢�" value='鐢�'></el-option>
</el-select></template>
</template>
</el-table-column>
@@ -340,11 +340,9 @@
<span v-if="scope.row.marryStatus== 1">鍒濆</span>
<span v-if="scope.row.marryStatus== 2">绂诲</span>
<span v-if="scope.row.marryStatus== 3">鍐嶅</span></template>
- <template v-else> <el-select v-model="qianren" placeholder="璇烽�夋嫨">
- <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>
+ <template v-else> <el-select v-model="qianren" placeholder="璇烽�夋嫨" @change="getMarryStatus">
+ <el-option v-for="item in qianrenOptions"
+ :key="item.value" :label="item.label" :value="item.value"/>
</el-select></template>
</template>
</el-table-column>
@@ -546,6 +544,7 @@
dicts: ['sys_normal_disable'],
data() {
return {
+ qianren:undefined,
userId: undefined,
showOldSpouse:false,//鏄剧ず鍓嶄换淇℃伅
// 閬僵灞�
@@ -726,6 +725,27 @@
value: '3',
label: '鍐嶅',
},],
+
+ qianrenOptions:[
+ {
+ value: '0',
+ label: '鏈',
+ },
+ {
+ value: '1',
+ label: '鍒濆',
+ },
+ {
+ value: '2',
+ label: '绂诲',
+ },
+ {
+ value: '3',
+ label: '鍐嶅',
+ }
+ ],
+
+
};
},
created() {
@@ -956,11 +976,12 @@
},
editRow(row) {
- if(this.oldSpouseList.marryStatus == 0)
+
+ if(row.marryStatus == '0')
this.qianren = '鏈'
- else if(this.oldSpouseList.marryStatus == 1)
+ else if(row.marryStatus == '1')
this.qianren = '鍒濆'
- else if(this.oldSpouseList.marryStatus == 2)
+ else if(row.marryStatus == '2')
this.qianren = '绂诲'
else
this.qianren = '鍐嶅'// this.isEdit=false
@@ -1012,21 +1033,47 @@
// 鍒锋柊椤甸潰
// window.location.reload();
},
+ getMarryStatus(value){
+ // alert(value)
+ if(value == '0')
+ this.qianren = '鏈'
+ else if(value == '1')
+ this.qianren = '鍒濆'
+ else if(value == '2')
+ this.qianren = '绂诲'
+ else
+ this.qianren = '鍐嶅'// this.isEdit=false
+ },
//鍓嶄换淇敼
saveRowmarryList(row) {
this.$refs['elForm'].validate(valid => {
- console.log(this.oldSpouseList)
+ console.log(this.oldSpouseList,'oldSpouseListoldSpouseListoldSpouseListoldSpouseList')
if (valid) {
+
+ if(this.qianren == '鏈')
+ row.marryStatus = 0
+ else if(this.qianren == '鍒濆')
+ row.marryStatus = 1
+ else if(this.qianren == '绂诲')
+ row.marryStatus = 2
+ else
+ row.marryStatus = 3
this.marryList.oldSpouseList = this.oldSpouseList
const foundIndex = this.oldSpouseList.findIndex(item => item.id === row.id);
if (foundIndex !== -1) {
+
+ this.marryList.oldSpouseList[foundIndex].marryStatus = Number(this.marryList.oldSpouseList[foundIndex].marryStatus)
+ // alert(this.marryList.oldSpouseList[foundIndex].marryStatus)
+
const updatedData = Object.assign({}, this.marryList.oldSpouseList[foundIndex], row);
updateMarryOld(updatedData).then(response => {
+
this.oldSpouseList = this.marryList.oldSpouseList
this.$modal.msgSuccess("淇敼鎴愬姛");
- console.log(updatedData)
+ console.log(updatedData,'updatedDataupdatedDataupdatedData')
+ console.log(response,'responseresponseresponseresponse')
this.getList();
// console.log(this.oldSpouseList)
}).catch(error => {
@@ -1052,24 +1099,25 @@
},
/** 鍒犻櫎鍓嶄换 */
handleDelete(row) {
- console.log(this.oldSpouseList)
+ // console.log(this.oldSpouseList,'123123123123')
const id = row.id || this.oldSpouseList.id
+
console.log(id)
this.$modal.confirm('鏄惁纭鍒犻櫎鎵�閫夋暟鎹」锛�').then(function() {
- return delMarryOld({id});
- }).then(() => {
- this.oldSpouseList = this.oldSpouseList.filter(item => item.id !== id);
- this.marryList.oldSpouseList=this.oldSpouseList
- console.log(this.marryList.oldSpouseList)
+ return delMarryOld(id);
+ }).then((res) => {
+ console.log(res)
+ // this.oldSpouseList = this.oldSpouseList.filter(item => item.id !== id);
+ // this.marryList.oldSpouseList=this.oldSpouseList
+ // console.log(this.marryList.oldSpouseList,'oldSpouseListoldSpouseListoldSpouseList1')
- console.log(this.oldSpouseList)
+ // console.log(this.oldSpouseList,'oldSpouseListoldSpouseListoldSpouseList2')
this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
this.getList();
-
+ console.log(this.marryList.oldSpouseList,'oldSpouseListoldSpouseListoldSpouseList1')
// window.location.reload();
}).catch(() => {});
-
},
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
--
Gitblit v1.9.1