| | |
| | | </el-row> |
| | | <el-row :span="16"> |
| | | <el-form-item label="出生日期" prop="birthday" label-width="75px"> |
| | | |
| | | |
| | | <el-date-picker v-model="marryList.birthday" |
| | | type="date" |
| | | placeholder="请选择日期" |
| | |
| | | <el-container > |
| | | <el-col > |
| | | <el-form ref="elForm" :model="marryList" :rules="rules" size="medium" label-position="left" |
| | | v-loading="loading" :data="marryList" @selection-change="handleSelectionChange" > |
| | | :data="marryList" @selection-change="handleSelectionChange" > |
| | | <el-row :span="16"> |
| | | <el-form-item label="姓名" prop="spouseName" label-width="40px"> |
| | | <el-input v-model="marryList.spouseName" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"> |
| | |
| | | </div> |
| | | <div style="padding-left:100px;padding-top:15px;width: 30%;"> |
| | | <el-container> |
| | | <el-col v-loading="loading" :data="marryList" @selection-change="handleSelectionChange"> |
| | | <el-col :data="marryList" @selection-change="handleSelectionChange"> |
| | | <el-form ref="elForm" :model="marryList" :rules="rules" size="medium" label-position="left"> |
| | | <el-row :span="16"> |
| | | <el-form-item label="性别" prop="spouseSex" label-width="40px"> |
| | |
| | | <el-container > |
| | | |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-row :gutter="10" class="mb8" v-if="userId != 2"> |
| | | <el-col > |
| | | <el-button |
| | | plain |
| | |
| | | <template v-slot:title> |
| | | <h2 style="font-size:16px ">前任情况</h2> |
| | | <div class="title-wrapper"> |
| | | <div> |
| | | <!-- <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> |
| | | </div> |
| | | <span v-html="'\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'"></span></el-button> |
| | | </div> --> |
| | | |
| | | |
| | | </div> |
| | | </template> |
| | | <el-table v-loading="loading" :data="oldSpouseList" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName" style="background: #FFEFF2; border-radius: 14px 14px 14px 14px;"> |
| | | <el-table :data="oldSpouseList" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName" style="background: #FFEFF2; border-radius: 14px 14px 14px 14px;"> |
| | | <el-table-column label="姓名" prop="name" sortable width="160" align="center" > |
| | | <template slot-scope="scope"> |
| | | <template v-if="!scope.row.isEdit">{{ scope.row.name }}</template> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <!-- 操作 --> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="userId != 2"> |
| | | <template slot-scope="scope" v-if="scope.row.roleId !== 1"> |
| | | <el-button size="mini" type="text" icon="el-icon-edit" v-if="!editStatus[scope.row.id]" |
| | | @click="editRow(scope.row)" v-hasPermi="['system:role:edit']">修改</el-button> |
| | |
| | | <el-container > |
| | | <el-col > |
| | | <el-form ref="elForm" :model="marryList" :rules="rules" size="medium" label-position="left" |
| | | v-loading="loading" :data="marryList" @selection-change="handleSelectionChange" > |
| | | :data="marryList" @selection-change="handleSelectionChange" > |
| | | <el-row :span="16"> |
| | | <el-form-item label="生育情况" prop="bearStatus" label-width="80px"> |
| | | <template v-if="!isEditing"> |
| | |
| | | </div> |
| | | <div style="padding-left:200px; padding-top: 58px; "> |
| | | <el-container> |
| | | <el-col v-loading="loading" :data="marryList" @selection-change="handleSelectionChange"> |
| | | <el-col :data="marryList" @selection-change="handleSelectionChange"> |
| | | <el-form ref="elForm" :model="marryList" :rules="rules" size="medium" label-position="left" > |
| | | |
| | | <el-row :span="16" > |
| | |
| | | import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu"; |
| | | import {listMarry,updateMarry,delMarryOld,addMarryOld,updateMarryOld} from "@/api/marry/index"; |
| | | import { blobValidate } from '../../utils/ruoyi' |
| | | import {getInfo} from "@/api/login"; |
| | | |
| | | export default { |
| | | name: "show", |
| | | name: "ZMarry", |
| | | dicts: ['sys_normal_disable'], |
| | | data() { |
| | | return { |
| | | |
| | | qianren:undefined, |
| | | userId: undefined, |
| | | showOldSpouse:false,//显示前任信息 |
| | | // 遮罩层 |
| | | disabled: false, |
| | |
| | | limitCountImg:1,//上传图片的最大数量 |
| | | //个人信息数据 |
| | | marryList:{ |
| | | id:undefined, |
| | | name:undefined, |
| | | sex:undefined, |
| | | birthday:undefined, |
| | |
| | | activeNames:['1'], |
| | | // 弹出层标题 |
| | | title: "", |
| | | iddd:undefined, |
| | | // 是否显示弹出层 |
| | | open: false, |
| | | // open:true, |
| | | // 是否显示弹出层(数据权限) |
| | | bear:undefined, |
| | | handsj:undefined, |
| | | onebear:undefined, |
| | | mrs:undefined, |
| | | smrs:undefined, |
| | | openDataScope: false, |
| | |
| | | // 数据范围选项 |
| | | // 数据范围选项 |
| | | fot:['.bmp','.jpg','.jpeg','.png','.tif','.gif','.pcx','.tga','.exif','.fpx', |
| | | '.svg','.psd','.cdr','.pcd','.dxf','.ufo','.eps','.ai','.aw','.WMF','.webp','.apng'], |
| | | '.svg','.psd','.cdr','.pcd','.dxf','.ufo','.eps','.ai','.aw','.WMF','.webp','.apng','.M4A'], |
| | | |
| | | fileList:[ |
| | | ], |
| | |
| | | }, |
| | | // 表单校验 |
| | | rules: { |
| | | id: [{ |
| | | required: true, |
| | | idNo: [{ |
| | | // required: true, |
| | | message: '请输入身份证号码', |
| | | trigger: 'blur' |
| | | }], |
| | | name: [{ |
| | | required: true, |
| | | // required: true, |
| | | message: '请输入姓名', |
| | | trigger: 'blur' |
| | | }], |
| | |
| | | trigger: 'change' |
| | | }], |
| | | marryStatus: [{ |
| | | required: true, |
| | | // required: true, |
| | | message: '请选择婚姻状况', |
| | | trigger: 'change' |
| | | }], |
| | |
| | | value: '3', |
| | | label: '再婚', |
| | | },], |
| | | |
| | | qianrenOptions:[ |
| | | { |
| | | value: '0', |
| | | label: '未婚', |
| | | }, |
| | | { |
| | | value: '1', |
| | | label: '初婚', |
| | | }, |
| | | { |
| | | value: '2', |
| | | label: '离婚', |
| | | }, |
| | | { |
| | | value: '3', |
| | | label: '再婚', |
| | | } |
| | | ], |
| | | |
| | | |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList() |
| | | this.getInfo() |
| | | }, |
| | | methods: { |
| | | |
| | | getInfo(){ |
| | | console.log('-----------------') |
| | | getInfo().then(response=>{ |
| | | console.log(response.user.roles[0].roleId,'roleID') |
| | | this.userId = response.user.roles[0].roleId |
| | | }) |
| | | }, |
| | | handleMarryStatusChange() { |
| | | // 判断当前选中的婚姻状态是否为再婚 |
| | | if (this.mrs === '3') { |
| | |
| | | cancelData() { |
| | | this.open = false; |
| | | this.reset(); |
| | | |
| | | }, |
| | | //下拉 |
| | | handleChange(val) { |
| | |
| | | |
| | | |
| | | getList() { |
| | | this.loading = false; |
| | | this.loading = true; |
| | | //个人信息 |
| | | listMarry(this.queryParams).then(response => { |
| | | listMarry().then(response => { |
| | | |
| | | if(response.data.length === 0){ |
| | | this.loading = false; |
| | |
| | | this.oldSpouseList = this.marryList.oldSpouseList; |
| | | console.log(111) |
| | | console.log("信息") |
| | | console.log(this.marryList.marryStatus); |
| | | console.log(this.marryList,'1111111111111111111'); |
| | | this.iddd = this.marryList.id |
| | | console.log(this.iddd,'2222222222222') |
| | | //alert(this.marryList.bearStatus) |
| | | if(this.marryList.marryStatus===3){ |
| | | this.showOldSpouse = true; |
| | |
| | | deptCheckStrictly: true, |
| | | remark: undefined |
| | | }; |
| | | this.resetForm("form"); |
| | | this.resetForm("elForm"); |
| | | }, |
| | | |
| | | |
| | |
| | | }, |
| | | |
| | | 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 |
| | |
| | | this.marryList.marryStatus = parseInt(this.mrs) |
| | | if(this.smrs!=undefined) |
| | | this.marryList.spouseMarryStatus = parseInt(this.smrs) |
| | | // console.log(this.bear) |
| | | // alert(this.bear) |
| | | // if( parseInt(this.bear)) |
| | | |
| | | if(this.bear!=undefined) |
| | | this.marryList.bearStatus = parseInt(this.bear) |
| | | |
| | |
| | | this.marryList.handbookStatus =parseInt(this.handsj) |
| | | this.marryList.sex = this.sinds |
| | | this.marryList.spouseSex = this.inds |
| | | console.log(this.marryList,'marryListmarryListmarryListmarryList') |
| | | // this.marryList.id = this.iddd |
| | | this.$refs['elForm'].validate(valid => { |
| | | // alert(valid) |
| | | if (valid) { |
| | | if (this.marryList.id !== undefined) { |
| | | updateMarry(this.marryList).then(response => { |
| | |
| | | this.dsb = true |
| | | this.isShow_2=false |
| | | this.isShow = true |
| | | this.getList() |
| | | |
| | | }).catch(error => { |
| | | console.error(error); |
| | |
| | | } |
| | | } |
| | | }) |
| | | this.getList() |
| | | // 刷新页面 |
| | | // 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 => { |
| | |
| | | this.$set(row, 'isEdit', false); |
| | | this.$set(this.editStatus, row.id, false); |
| | | }, |
| | | |
| | | handleSelectionChange() |
| | | {}, |
| | | //隔行变色 |
| | | tableRowClassName({ row, rowIndex }) { |
| | | if (rowIndex % 2 == 0) { |
| | |
| | | }, |
| | | /** 删除前任 */ |
| | | 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(() => {}); |
| | | |
| | | }, |
| | | |
| | | /** 导出按钮操作 */ |