<template>
|
<div class="app-container" id="printable-content">
|
<!-- 回到顶部-->
|
<el-backtop :bottom="150" :right="30">
|
<el-button type="primary" circle
|
class="el-icon-top"
|
></el-button>
|
</el-backtop>
|
<h2 style="font-size:30px;padding-top:0px">婚姻状况登记表</h2>
|
|
<el-divider />
|
|
<!-- 基本信息-->
|
<!-- <h2 style="font-size:21px">基本情况</h2>
|
<el-container>
|
<div style="padding-left:0px;width: 28%;" >
|
<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" >
|
<el-row :span="16">
|
<el-form-item label="姓名" prop="name" label-width="50px">
|
<el-input v-model="marryList.name " placeholder="" clearable :style="{width: '100%'}" :disabled="dsb">
|
</el-input>
|
</el-form-item>
|
</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="请选择日期"
|
:editable="false"
|
:clearable="false"
|
:style="{width: '100%'}"
|
:disabled="dsb" value-format="yyyy-MM-dd"></el-date-picker>
|
</el-form-item>
|
</el-row>
|
<el-row :span="16">
|
<el-form-item label="身份证号码" prop="id" label-width="95px">
|
<el-input v-model="marryList.id" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb">
|
</el-input>
|
</el-form-item>
|
</el-row>
|
<el-row :span="16">
|
<el-form-item label="婚姻状况" prop="marryStatus" label-width="80px" >
|
<template v-if="!isEditing">
|
<el-input v-if="marryList.marryStatus===0" placeholder="未婚" style="" :disabled="dsb"></el-input>
|
<el-input v-if="marryList.marryStatus===1" placeholder="初婚" :disabled="dsb"></el-input>
|
<el-input v-if="marryList.marryStatus===2" placeholder="离婚" :disabled="dsb"></el-input>
|
<el-input v-if="marryList.marryStatus===3" placeholder="再婚" :disabled="dsb"></el-input>
|
|
</template>
|
<template v-else>
|
<el-select v-model="mrs" placeholder="请选择婚姻状态" clearable :style="{width: '100%'}" @change="handleMarryStatusChange">
|
<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>
|
|
</el-form-item>
|
</el-row>
|
<el-row :span="16">
|
<el-form-item label="户籍地址" prop="address" label-width="70px">
|
<el-input v-model="marryList.address" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb">
|
</el-input>
|
</el-form-item>
|
</el-row>
|
|
|
</el-form>
|
</el-col>
|
</el-container>
|
</div>
|
<div style="width: 35%;padding-left: 100px;">
|
<el-container>
|
<el-col v-loading="loading" :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="sex" label-width="40px">
|
<template v-if="!isEditing">
|
<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='男'></el-option>
|
<el-option label="女" value='女'></el-option>
|
</el-select>
|
</template>
|
</el-form-item>
|
</el-row>
|
<el-row :span="16">
|
<el-form-item label="民族" prop="nation" label-width="40px">
|
<el-input v-model="marryList.nation " placeholder="" clearable :style="{width: '100%'}" :disabled="dsb">
|
</el-input>
|
</el-form-item>
|
</el-row>
|
<el-row :span="16">
|
<el-form-item label="联系电话" prop="phone" label-width="70px">
|
<el-input v-model="marryList.phone" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb">
|
</el-input>
|
</el-form-item>
|
</el-row>
|
<el-row :span="16">
|
<el-form-item label="结婚时间" prop="marryTime" label-width="70px">
|
<el-date-picker v-model="marryList.marryTime" type="date" placeholder="请选择日期" :editable="false" :clearable="false" :style="{width: '100%'}" :disabled="dsb" value-format="yyyy-MM-dd">
|
</el-date-picker>
|
</el-form-item>
|
</el-row>
|
</el-form>
|
</el-col>
|
</el-container>
|
</div>
|
|
|
|
|
</el-container> -->
|
<h2 style="font-size:16px " >配偶情况</h2>
|
<el-container>
|
<div style="padding-top:15px;width: 28%;" >
|
<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" >
|
<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">
|
</el-input>
|
</el-form-item>
|
</el-row>
|
<el-row :span="16">
|
<el-form-item label="出生日期" prop="spouseBirthday" label-width="70px">
|
<el-date-picker v-model="marryList.spouseBirthday" type="date" placeholder="请选择日期" :editable="false" :clearable="false" :style="{width: '100%'}" :disabled="dsb" value-format="yyyy-MM-dd">
|
</el-date-picker>
|
</el-form-item>
|
</el-row>
|
<el-row :span="16">
|
<el-form-item label="身份证号码" prop="spouseIdNo" label-width="85px">
|
<el-input v-model="marryList.spouseIdNo" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb">
|
</el-input>
|
</el-form-item>
|
</el-row>
|
<el-row :span="16">
|
<el-form-item label="婚姻状况" prop="spouseMarryStatus" label-width="70px" >
|
<template v-if="!isEditing">
|
<el-input v-if="marryList.spouseMarryStatus===0" placeholder="未婚" :disabled="dsb"></el-input>
|
<el-input v-if="marryList.spouseMarryStatus===1" placeholder="初婚" :disabled="dsb"></el-input>
|
<el-input v-if="marryList.spouseMarryStatus===2" placeholder="离婚" :disabled="dsb"></el-input>
|
<el-input v-if="marryList.spouseMarryStatus===3" placeholder="再婚" :disabled="dsb"></el-input>
|
|
</template>
|
<template v-else>
|
<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>
|
<el-option label="再婚" value="3"></el-option>
|
|
</el-select>
|
</template>
|
</el-form-item>
|
</el-row>
|
<el-row :span="16">
|
<el-form-item label="户籍地址" prop="spouseAddress" label-width="70px">
|
<el-input v-model="marryList.spouseAddress" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb">
|
</el-input>
|
</el-form-item>
|
</el-row>
|
|
|
</el-form>
|
</el-col>
|
</el-container>
|
</div>
|
<div style="padding-left:100px;padding-top:15px;width: 30%;">
|
<el-container>
|
<el-col v-loading="loading" :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">
|
|
<template v-if="!isEditing">
|
<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='男'></el-option>
|
<el-option label="女" value='女'></el-option>
|
</el-select>
|
</template>
|
|
</el-form-item>
|
</el-row>
|
<el-row :span="16">
|
<el-form-item label="民族" prop="spouseNation" label-width="40px">
|
<el-input v-model="marryList.spouseNation " placeholder="" clearable :style="{width: '100%'}" :disabled="dsb">
|
</el-input>
|
</el-form-item>
|
</el-row>
|
<el-row :span="16">
|
<el-form-item label="联系电话" prop="spousePhone" label-width="70px">
|
<el-input v-model="marryList.spousePhone" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb">
|
</el-input>
|
</el-form-item>
|
</el-row>
|
<el-row :span="16">
|
<el-form-item label="结婚时间" prop="spouseMarryTime" label-width="70px">
|
<el-date-picker v-model="marryList.spouseMarryTime" type="date" placeholder="请选择日期" :editable="false" :clearable="false" :style="{width: '100%'}" :disabled="dsb" value-format="yyyy-MM-dd">
|
</el-date-picker>
|
</el-form-item>
|
</el-row>
|
</el-form>
|
</el-col>
|
</el-container>
|
</div>
|
|
<div style="padding-left:400px;padding-top:30px" >
|
<el-container >
|
|
|
<el-row :gutter="10" class="mb8" v-if="userId != 2">
|
<el-col >
|
<el-button
|
plain
|
@click="handleEdit()"
|
style="width: 80px;height: 32px;background: #E0EEFE;"
|
v-if="isShow"
|
v-hasPermi="['system:role:edit']"
|
>编辑</el-button>
|
<el-button v-if="isShow_2" style="width: 80px;height: 32px;background: #E0EEFE;" @click="submitForm" :disabled="dsb">完成</el-button>
|
<br>
|
|
</el-col>
|
|
<el-col style="padding-top: 10px;">
|
<el-button
|
plain
|
style="width: 80px;height: 32px;background: #D2F3E0;"
|
@click="handleExport"
|
v-hasPermi="['family:note:export']"
|
>导出</el-button></el-col>
|
|
<el-col style="padding-top: 10px;">
|
<el-button
|
plain
|
style="width: 80px;height: 32px;background: #FFDDE3;"
|
v-print="'#printable-content'"
|
v-hasPermi="['family:note:export']"
|
>打印</el-button></el-col>
|
|
|
</el-row>
|
|
</el-container>
|
</div>
|
|
<div style="padding-left:30px;padding-top:30px" >
|
<el-container >
|
|
|
|
</el-container>
|
</div>
|
<!-- </el-dialog> self:user:export-->
|
</el-container>
|
|
<div v-if="showOldSpouse">
|
<el-collapse v-model="activeNames" @change="handleChange">
|
|
<el-collapse-item name="1" >
|
<template v-slot:title>
|
<h2 style="font-size:16px ">前任情况</h2>
|
<div class="title-wrapper">
|
<!-- <div>
|
<el-button class="button" size="mini" type="text" @click="handleAdd">
|
<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-column label="姓名" prop="name" sortable width="160" align="center" >
|
<template slot-scope="scope">
|
<template v-if="!scope.row.isEdit">{{ scope.row.name }}</template>
|
<template v-else><el-input v-model="scope.row.name"></el-input></template>
|
</template>
|
</el-table-column>
|
<el-table-column label="性别" prop="sex" sortable width="80" align="center" >
|
<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='女'></el-option>
|
<el-option label="男" value='男'></el-option>
|
</el-select></template>
|
</template>
|
</el-table-column>
|
<el-table-column label="民族" prop="nation" sortable width="100" align="center" >
|
<template slot-scope="scope">
|
<template v-if="!scope.row.isEdit">{{ scope.row.nation }}</template>
|
<template v-else><el-input v-model="scope.row.nation"></el-input></template>
|
</template>
|
</el-table-column>
|
<el-table-column label="出生日期" prop="birthday" sortable width="150" align="center" >
|
<template slot-scope="scope">
|
<template v-if="!scope.row.isEdit">{{ scope.row.birthday }}</template>
|
<template v-else><el-date-picker v-model="scope.row.birthday" type="date" placeholder="请选择日期" :editable="false" :clearable="false" :style="{width: '100%'}" value-format="yyyy-MM-dd">
|
</el-date-picker></template>
|
</template>
|
</el-table-column>
|
<el-table-column label="户籍地址" prop="address" sortable width="180" align="center" >
|
<template slot-scope="scope">
|
<template v-if="!scope.row.isEdit">{{ scope.row.address }}</template>
|
<template v-else><el-input v-model="scope.row.address"></el-input></template>
|
</template>
|
</el-table-column>
|
<el-table-column label="身份证号" prop="idNo" sortable width="180" align="center" >
|
<template slot-scope="scope">
|
<template v-if="!scope.row.isEdit">{{ scope.row.idNo }}</template>
|
<template v-else><el-input v-model="scope.row.idNo"></el-input></template>
|
</template>
|
</el-table-column>
|
<el-table-column label="工作地址" prop="address" sortable width="180" align="center" >
|
<template slot-scope="scope">
|
<template v-if="!scope.row.isEdit">{{ scope.row.address }}</template>
|
<template v-else><el-input v-model="scope.row.address"></el-input></template>
|
</template>
|
</el-table-column>
|
|
|
<el-table-column label="婚姻状态" prop="marryStatus" sortable width="100" align="center" >
|
<template slot-scope="scope">
|
<template v-if="!scope.row.isEdit" >
|
<span v-if="scope.row.marryStatus== 0">未婚</span>
|
<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="请选择" @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>
|
|
|
<el-table-column label="结婚时间" prop="marryTime" sortable width="150" align="center" >
|
<template slot-scope="scope">
|
<template v-if="!scope.row.isEdit">{{ scope.row.marryTime }}</template>
|
<template v-else><el-date-picker v-model="scope.row.marryTime" type="date" placeholder="请选择日期" :editable="false" :clearable="false" :style="{width: '100%'}" value-format="yyyy-MM-dd">
|
</el-date-picker></template>
|
</template>
|
</el-table-column>
|
<!-- 操作 -->
|
<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-button size="mini" type="text"
|
v-if="editStatus[scope.row.id]" @click="saveRowmarryList(scope.row)">保存</el-button>
|
<el-button size="mini" type="text" icon="el-icon-delete"
|
@click="handleDelete(scope.row)" v-hasPermi="['system:role:remove']">删除</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
</el-collapse-item>
|
|
</el-collapse>
|
</div>
|
|
<h2 style="font-size:16px " >生育情况</h2>
|
|
|
<el-container>
|
<div style="padding-left:0px" >
|
<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" >
|
<el-row :span="16">
|
<el-form-item label="生育情况" prop="bearStatus" label-width="80px">
|
<template v-if="!isEditing">
|
<el-input v-if="marryList.bearStatus===0" placeholder="未生育" style="" :disabled="dsb"></el-input>
|
<el-input v-if="marryList.bearStatus===1" placeholder="在孕" :disabled="dsb"></el-input>
|
<el-input v-if="marryList.bearStatus===2" placeholder="已生育" :disabled="dsb"></el-input>
|
</template>
|
<template v-else>
|
<el-select v-model="bear" 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-select>
|
</template>
|
|
</el-form-item>
|
</el-row>
|
<el-row :span="16">
|
<el-form-item label="领取《计划生育服务手册》" prop="handbookStatus" label-width="180px">
|
<template v-if="!isEditing">
|
<el-input v-if="marryList.handbookStatus===0" placeholder="否" style="" :disabled="dsb"></el-input>
|
<el-input v-if="marryList.handbookStatus===1" placeholder="是" :disabled="dsb"></el-input>
|
|
</template>
|
<template v-else>
|
<el-select v-model="handsj" placeholder="请选择是/否" clearable :style="{width: '100%'}">
|
<el-option label="否" value='0'></el-option>
|
<el-option label="是" value='1'></el-option>
|
</el-select>
|
</template>
|
|
</el-form-item>
|
</el-row>
|
<el-row :span="16">
|
<el-form-item label="领取《独生子女证》" prop="oneBorn" label-width="150px">
|
<template v-if="!isEditing">
|
<el-input v-if="marryList.oneBorn===0" placeholder="否" style="" :disabled="dsb"></el-input>
|
<el-input v-if="marryList.oneBorn===1" placeholder="是" :disabled="dsb"></el-input>
|
|
</template>
|
<template v-else>
|
<el-select v-model="onebear" placeholder="请选择是/否" clearable :style="{width: '100%'}">
|
<el-option label="否" value='0'></el-option>
|
<el-option label="是" value='1'></el-option>
|
</el-select>
|
</template>
|
</el-form-item>
|
</el-row>
|
|
|
</el-form>
|
</el-col>
|
</el-container>
|
</div>
|
<div style="padding-left:200px; padding-top: 58px; ">
|
<el-container>
|
<el-col v-loading="loading" :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="handbookTime" label-width="70px">
|
<el-date-picker v-model="marryList.handbookTime" type="date" placeholder="请选择日期" :editable="false" :clearable="false" :style="{width: '100%'}" :disabled="dsb" value-format="yyyy-MM-dd">
|
</el-date-picker>
|
</el-form-item>
|
</el-row>
|
<el-row :span="16">
|
<el-form-item label="领证时间" prop="oneBornTime" label-width="70px">
|
<el-date-picker v-model="marryList.oneBornTime" type="date" placeholder="请选择日期" :editable="false" :clearable="false" :style="{width: '100%'}" :disabled="dsb" value-format="yyyy-MM-dd">
|
</el-date-picker>
|
</el-form-item>
|
</el-row>
|
|
</el-form>
|
</el-col>
|
</el-container>
|
</div>
|
|
|
|
<div style="padding-left:400px;padding-top:30px" >
|
</div>
|
<!-- </el-dialog> self:user:export-->
|
</el-container>
|
|
<h2 style="font-size:16px " >需声明的情况</h2>
|
<el-container>
|
<el-input v-model="marryList.notion " placeholder="" clearable :style="{width: '80%'}" :disabled="dsb"> </el-input>
|
</el-container>
|
<h2 style="font-size:16px " >备注</h2>
|
<el-container>
|
<el-input v-model="marryList.remark " placeholder="" clearable :style="{width: '80%'}" :disabled="dsb"> </el-input>
|
</el-container>
|
|
<!-- 新增 -->
|
|
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
<el-form ref="elForm" :model="formDat" :rules="rules" size="medium" label-width="100px">
|
<el-form-item label="姓名" prop="name">
|
<el-input v-model="formDat.name" placeholder="请输入姓名" clearable :style="{width: '100%'}" ></el-input>
|
</el-form-item>
|
|
<el-form-item label="性别" prop="sex">
|
<el-select v-model="formDat.sex" placeholder="请选择性别" clearable :style="{width: '100%'}" >
|
<el-option v-for="(item, index) in typeOptions" :key="index" :label="item.label" :value="item.value"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="出生日期" prop="birthday">
|
<el-date-picker v-model="formDat.birthday" type="date" placeholder="请选择日期" :editable="false" :clearable="false" :style="{width: '100%'}" value-format="yyyy-MM-dd">
|
</el-date-picker>
|
</el-form-item>
|
<el-form-item label="民族" prop="nation">
|
<el-input v-model="formDat.nation" placeholder="请输入民族" clearable :style="{width: '100%'}" >
|
</el-input>
|
</el-form-item>
|
<el-form-item label="身份证号" prop="idNo">
|
<el-input v-model="formDat.idNo" placeholder="请输入身份证号" clearable :style="{width: '100%'}" >
|
</el-input>
|
</el-form-item>
|
<el-form-item label="手机号码" prop="phone">
|
<el-input v-model="formDat.phone" placeholder="请输入手机号码" clearable :style="{width: '100%'}" >
|
</el-input>
|
</el-form-item>
|
<el-form-item label="地址" prop="address">
|
<el-input v-model="formDat.address" placeholder="请输入地址" clearable :style="{width: '100%'}" ></el-input>
|
</el-form-item>
|
<el-form-item label="婚姻状态" prop="marryStatus">
|
<el-select v-model="formDat.marryStatus" placeholder="请选择婚姻状态" clearable :style="{width: '100%'}" >
|
<el-option v-for="(item, index) in typeOptions1" :key="index" :label="item.label" :value="item.value"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="结婚时间" prop="marryTime">
|
<el-date-picker v-model="formDat.marryTime" type="date" placeholder="请选择日期" :editable="false" :clearable="false" :style="{width: '100%'}" value-format="yyyy-MM-dd">
|
</el-date-picker>
|
</el-form-item>
|
|
|
|
|
</el-form>
|
<h4 class="form-header"> </h4>
|
|
<div slot="footer" class="dialog-footer">
|
<el-button type="primary" @click="submitDataScope">确 定</el-button>
|
<el-button @click="cancelData">取 消</el-button>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role";
|
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: "ZMarry",
|
dicts: ['sys_normal_disable'],
|
data() {
|
return {
|
qianren:undefined,
|
userId: undefined,
|
showOldSpouse:false,//显示前任信息
|
// 遮罩层
|
disabled: false,
|
isEditing:false,
|
inds: undefined,
|
sinds: undefined,
|
loading: false,
|
formData:[],
|
// 选中数组
|
ids: [],
|
// 非单个禁用
|
single: true,
|
// 非多个禁用
|
multiple: true,
|
// 显示搜索条件
|
showSearch: true,
|
// 总条数
|
total: 0,
|
//头像上传
|
showBtnDealImg:true,
|
noneBtnImg:false,
|
limitCountImg:1,//上传图片的最大数量
|
//个人信息数据
|
marryList:{
|
id:undefined,
|
name:undefined,
|
sex:undefined,
|
birthday:undefined,
|
nation:undefined,
|
idNo:undefined,
|
phone:undefined,
|
marryStatus:undefined,
|
marryTime:undefined,
|
address:undefined,
|
bearStatus:undefined,
|
handbookStatus:undefined,
|
handbookTime:undefined,
|
oneBorn:undefined,
|
oneBornTime:undefined,
|
notion:undefined,
|
remark:undefined,
|
spouseName:undefined,
|
spouseSex:undefined,
|
spouseBirthday:undefined,
|
spouseIdNo:undefined,
|
spouseAddress:undefined,
|
spouseMarryStatus:undefined,
|
spouseNation:undefined,
|
spouseMarryTime:undefined,
|
spousePhone:undefined,
|
},
|
fit:['fill'],
|
|
//下拉实现
|
activeNames:['1'],
|
// 弹出层标题
|
title: "",
|
iddd:undefined,
|
// 是否显示弹出层
|
open: false,
|
// open:true,
|
// 是否显示弹出层(数据权限)
|
bear:undefined,
|
handsj:undefined,
|
onebear:undefined,
|
mrs:undefined,
|
smrs:undefined,
|
openDataScope: false,
|
menuExpand: false,
|
menuNodeAll: false,
|
deptExpand: true,
|
deptNodeAll: false,
|
// 日期范围
|
dateRange: [],
|
// 数据范围选项
|
// 数据范围选项
|
fot:['.bmp','.jpg','.jpeg','.png','.tif','.gif','.pcx','.tga','.exif','.fpx',
|
'.svg','.psd','.cdr','.pcd','.dxf','.ufo','.eps','.ai','.aw','.WMF','.webp','.apng','.M4A'],
|
|
fileList:[
|
],
|
fileListOther:[
|
|
],
|
editStatus: {},
|
dsb:true,
|
btn:false,
|
isShow:true,
|
isShow_2:false,
|
oldSpouseList:{
|
name:undefined,
|
sex:undefined,
|
birthday:undefined,
|
nation:undefined,
|
idNo:undefined,
|
phone:undefined,
|
marryStatus:undefined,
|
marryTime:undefined,
|
address:undefined,
|
},
|
formDat: {
|
//前任信息
|
name:undefined,
|
sex:undefined,
|
birthday:undefined,
|
nation:undefined,
|
idNo:undefined,
|
phone:undefined,
|
marryStatus:undefined,
|
marryTime:undefined,
|
address:undefined,
|
},
|
// 菜单列表
|
menuOptions: [],
|
// 部门列表
|
deptOptions: [],
|
// 查询参数
|
queryParams: {
|
|
},
|
// 表单参数
|
form: {},
|
defaultProps: {
|
children: "children",
|
label: "label"
|
},
|
// 表单校验
|
rules: {
|
idNo: [{
|
// required: true,
|
message: '请输入身份证号码',
|
trigger: 'blur'
|
}],
|
name: [{
|
// required: true,
|
message: '请输入姓名',
|
trigger: 'blur'
|
}],
|
birthday: [{
|
// required: true,
|
message: '请选择日期',
|
trigger: 'change'
|
}],
|
marryStatus: [{
|
// required: true,
|
message: '请选择婚姻状况',
|
trigger: 'change'
|
}],
|
marryTime: [{
|
// required: true,
|
message: '请选择结婚时间',
|
trigger: 'change'
|
}],
|
|
},
|
typeOptions: [ {
|
value: '女',
|
label: '女',
|
},
|
{
|
value: '男',
|
label: '男',
|
}],
|
typeOptions1: [ {
|
value: '0',
|
label: '未婚',
|
},
|
{
|
value: '1',
|
label: '初婚',
|
},
|
{
|
value: '2',
|
label: '离婚',
|
},
|
{
|
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') {
|
this.showOldSpouse = true;
|
} else {
|
this.showOldSpouse = false;
|
}
|
|
},
|
|
//性别
|
getSrc1(sex) {
|
if (sex === '女') {
|
return '女'
|
}else {
|
return '男'
|
}
|
},
|
|
// 取消按钮
|
cancelData() {
|
this.open = false;
|
this.reset();
|
|
},
|
//下拉
|
handleChange(val) {
|
console.log(val);
|
},
|
|
|
|
|
|
/** 查询角色列表 */
|
|
|
getList() {
|
this.loading = true;
|
//个人信息
|
listMarry().then(response => {
|
|
if(response.data.length === 0){
|
this.loading = false;
|
this.marryList={};
|
this.oldSpouseList = {};
|
console.log(this.marryList)
|
}
|
else{
|
this.marryList = response.data;
|
this.oldSpouseList = this.marryList.oldSpouseList;
|
console.log(111)
|
console.log("信息")
|
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;
|
} else{
|
this.showOldSpouse = false;
|
}
|
this.loading = false;
|
|
}
|
|
}
|
);
|
|
|
},
|
|
//图片的上传及上传按钮隐藏
|
|
|
// 取消按钮
|
cancel() {
|
this.open = false;
|
this.reset();
|
},
|
// 取消按钮(数据权限)
|
cancelDataScope() {
|
this.openDataScope = false;
|
this.reset();
|
},
|
// 表单重置
|
reset() {
|
if (this.$refs.menu != undefined) {
|
this.$refs.menu.setCheckedKeys([]);
|
}
|
this.menuExpand = false,
|
this.menuNodeAll = false,
|
this.deptExpand = true,
|
this.deptNodeAll = false,
|
this.form = {
|
roleId: undefined,
|
roleName: undefined,
|
roleKey: undefined,
|
roleSort: 0,
|
status: "0",
|
menuIds: [],
|
deptIds: [],
|
menuCheckStrictly: true,
|
deptCheckStrictly: true,
|
remark: undefined
|
};
|
this.resetForm("elForm");
|
},
|
|
|
/** 新增按钮操作 */
|
handleAdd() {
|
this.reset();
|
this.open = true;
|
this.title = "新增婚姻信息";
|
},
|
/** 修改按钮操作 */
|
handleUpdate() {
|
|
let jd = true
|
|
// this.$router.push({
|
// path:"/self/marry/edit/" + id,
|
// query:{
|
// detail:jd
|
// }
|
// });
|
},
|
// 编辑按钮
|
handleEdit()
|
{
|
this.dsb = false
|
this.btn = true
|
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 = '再婚'
|
if(this.marryList.bearStatus == 0)
|
this.bear = '未生育'
|
else if(this.marryList.bearStatus == 1)
|
this.bear = '在孕'
|
else if(this.marryList.bearStatus == 2)
|
this.bear = '已生育'
|
|
if(this.marryList.oneBorn == 0)
|
this.onebear = '否'
|
else if(this.marryList.oneBorn == 1)
|
this.onebear = '是'
|
|
if(this.marryList.handbookStatus == 0)
|
this.handsj = '否'
|
else if (this.marryList.handbookStatus == 1)
|
this.handsj = '是'
|
|
},
|
|
handleRemoveFile(file) {
|
alert(操作成功)
|
},
|
handleRemove(file) {
|
alert("操作成功")
|
},
|
handlePictureCardPreview(file) {
|
this.dialogImageUrl = file.url;
|
this.dialogVisible = true;
|
},
|
//点击下载函数
|
handleDownload(url) {
|
var formData = {'path':"/"+url.replace(process.env.VUE_APP_BASE_TRUE_API,"")};
|
|
let lens = formData.path.split(".")
|
let suffix = lens[lens.length-1]
|
download(formData).then(async (response) => {
|
const isLogin = await blobValidate(response);
|
let nt = new Date().getTime()
|
let filename = 'selfevent_'+nt+'.'+suffix
|
const blob = new Blob([response])
|
saveAs(blob, filename)
|
})
|
},
|
|
|
/** 提交按钮(数据权限) */
|
submitDataScope: function() {
|
let _this = this
|
this.$refs["elForm"].validate(valid => {
|
if (valid) {
|
console.log(this.formDat)
|
addMarryOld(this.formDat).then(response => {
|
// marryList.oldSpouseList.push(this.formDat);
|
this.$modal.msgSuccess("新增成功");
|
_this.formDat = {}
|
this.open = false;
|
this.getList();
|
});
|
}
|
});
|
},
|
|
editRow(row) {
|
|
if(row.marryStatus == '0')
|
this.qianren = '未婚'
|
else if(row.marryStatus == '1')
|
this.qianren = '初婚'
|
else if(row.marryStatus == '2')
|
this.qianren = '离婚'
|
else
|
this.qianren = '再婚'// this.isEdit=false
|
this.$set(row, 'isEdit', true);
|
this.$set(this.editStatus, row.id, true);
|
},
|
//修改后的保存
|
|
submitForm() {
|
if(this.mrs!=undefined)
|
this.marryList.marryStatus = parseInt(this.mrs)
|
if(this.smrs!=undefined)
|
this.marryList.spouseMarryStatus = parseInt(this.smrs)
|
|
if(this.bear!=undefined)
|
this.marryList.bearStatus = parseInt(this.bear)
|
|
this.marryList.oneBorn = parseInt(this.onebear)
|
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.$modal.msgSuccess("修改成功");
|
// this.open = false;
|
this.btn=false
|
this.isEditing = false
|
this.dsb = true
|
this.isShow_2=false
|
this.isShow = true
|
this.getList()
|
|
}).catch(error => {
|
console.error(error);
|
this.$modal.msgError("修改失败");
|
});
|
} else {
|
this.$modal.msgSuccess("修改失败");
|
|
}
|
}
|
})
|
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,'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,'updatedDataupdatedDataupdatedData')
|
console.log(response,'responseresponseresponseresponse')
|
this.getList();
|
// console.log(this.oldSpouseList)
|
}).catch(error => {
|
this.$modal.msgError("修改失败");
|
console.log(error);
|
});
|
} else {
|
this.$modal.msgError("修改失败");
|
}
|
}
|
});
|
this.$set(row, 'isEdit', false);
|
this.$set(this.editStatus, row.id, false);
|
},
|
handleSelectionChange()
|
{},
|
//隔行变色
|
tableRowClassName({ row, rowIndex }) {
|
if (rowIndex % 2 == 0) {
|
return "statistics-warning-row1";
|
} else {
|
return "statistics-warning-row";
|
}
|
},
|
/** 删除前任 */
|
handleDelete(row) {
|
// console.log(this.oldSpouseList,'123123123123')
|
const id = row.id || this.oldSpouseList.id
|
|
console.log(id)
|
|
this.$modal.confirm('是否确认删除所选数据项?').then(function() {
|
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,'oldSpouseListoldSpouseListoldSpouseList2')
|
this.$modal.msgSuccess("删除成功");
|
this.getList();
|
console.log(this.marryList.oldSpouseList,'oldSpouseListoldSpouseListoldSpouseList1')
|
// window.location.reload();
|
}).catch(() => {});
|
},
|
|
/** 导出按钮操作 */
|
handleExport() {
|
this.download('/self/user/export', {
|
...this.queryParams
|
}, `self_${new Date().getTime()}.xlsx`)
|
}
|
}
|
};
|
</script>
|
<style>
|
.el-table__row.statistics-warning-row {
|
background: #E0EEFE;
|
|
}
|
.el-table__row.statistics-warning-row1 {
|
background: #FFEFF2;
|
|
}
|
.button {
|
background:center no-repeat url('../../assets/icons/add1.png') ;
|
margin-left: 69.5vw;
|
|
}</style>
|