jiangyy 3 years ago
parent
commit
d4376261fe
  1. 315
      src/views/components/resiChangeRecord.vue
  2. 705
      src/views/components/resiChangeTransfer.vue
  3. 10
      src/views/components/resiForm.vue
  4. 267
      src/views/components/resiSearch.vue
  5. 906
      src/views/modules/base/resi.vue
  6. 229
      src/views/modules/plugins/change/resideathAdd.vue

315
src/views/components/resiChangeRecord.vue

@ -1,96 +1,114 @@
<template> <template>
<div class="g-main"> <div class="g-main">
<el-table
<el-table :data="tableData" :data="tableData"
border border
:height="tableHeight" :height="tableHeight"
v-loading="tableLoading" v-loading="tableLoading"
style="width: 100%"> style="width: 100%"
>
<el-table-column label="序号" <el-table-column
header-align="center" label="序号"
align="center" header-align="center"
type="index" align="center"
width="50"></el-table-column> type="index"
<el-table-column prop="typeName" width="50"
header-align="center" ></el-table-column>
align="center" <el-table-column
label="变更类型" prop="typeName"
width="80"> header-align="center"
align="center"
label="变更类型"
width="80"
>
</el-table-column> </el-table-column>
<el-table-column prop="reason" <el-table-column
header-align="center" prop="reason"
align="center" header-align="center"
label="原因" align="center"
show-overflow-tooltip label="原因"
min-width="120"> show-overflow-tooltip
min-width="120"
>
</el-table-column> </el-table-column>
<el-table-column prop="changeTime" <el-table-column
header-align="center" prop="changeTime"
align="center" header-align="center"
label="变更时间" align="center"
width="160"> label="变更时间"
width="160"
>
</el-table-column> </el-table-column>
<el-table-column prop="beforeChangeName" <el-table-column
header-align="center" prop="beforeChangeName"
align="center" header-align="center"
label="变更前" align="center"
show-overflow-tooltip label="变更前"
width="230"> show-overflow-tooltip
width="230"
>
</el-table-column> </el-table-column>
<el-table-column prop="afterChangeName" <el-table-column
header-align="center" prop="afterChangeName"
align="center" header-align="center"
label="变更后" align="center"
show-overflow-tooltip label="变更后"
min-width="230"> show-overflow-tooltip
min-width="230"
>
</el-table-column> </el-table-column>
<el-table-column prop="operatorName" <el-table-column
header-align="center" prop="operatorName"
align="center" header-align="center"
label="操作人" align="center"
width="80"> label="操作人"
width="80"
>
</el-table-column> </el-table-column>
<el-table-column prop="createdTime" <el-table-column
header-align="center" prop="createdTime"
align="center" header-align="center"
label="调整时间" align="center"
width="160"> label="调整时间"
width="160"
>
</el-table-column> </el-table-column>
<el-table-column prop="remark" <el-table-column
header-align="center" prop="remark"
align="center" header-align="center"
label="备注" align="center"
show-overflow-tooltip label="备注"
min-width="120"> show-overflow-tooltip
min-width="120"
>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div> <div>
<el-pagination @size-change="handleSizeChange" <el-pagination
@current-change="handleCurrentChange" @size-change="handleSizeChange"
:current-page.sync="pageNo" @current-change="handleCurrentChange"
:page-sizes="[10, 20, 50]" :current-page.sync="pageNo"
:page-size="pageSize" :page-sizes="[10, 20, 50]"
layout="sizes, prev, pager, next, total" :page-size="pageSize"
:total="total"> layout="sizes, prev, pager, next, total"
:total="total"
>
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import util from '@js/util.js'; import util from "@js/util.js";
import { requestPost } from "@/js/dai/request"; import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex' import { mapGetters } from "vuex";
import { Loading } from 'element-ui' // Loading import { Loading } from "element-ui"; // Loading
let loading // let loading; //
export default { export default {
data () { data() {
return { return {
loading: false, loading: false,
total: 0, total: 0,
@ -99,62 +117,53 @@ export default {
tableLoading: false, tableLoading: false,
tableData: [], tableData: [],
icUserId: '', icUserId: "",
};
}
}, },
async mounted() {},
async mounted () {
},
methods: { methods: {
async initForm (row) { async initForm(row) {
this.icUserId = row.icResiUserId this.icUserId = row.resiId;
// //
await this.loadTable() await this.loadTable();
}, },
handleSearch () { handleSearch() {
this.loadTable() this.loadTable();
}, },
async loadTable() {
this.tableLoading = true;
async loadTable () { const url = "/epmetuser/icuserchangerecord/list";
this.tableLoading = true
const url = "/epmetuser/icuserchangerecord/list"
let params = { let params = {
icUserId: this.icUserId, icUserId: this.icUserId,
pageSize: this.pageSize, pageSize: this.pageSize,
pageNo: this.pageNo, pageNo: this.pageNo,
};
} const { data, code, msg } = await requestPost(url, params);
const { data, code, msg } = await requestPost(url, params)
if (code === 0) { if (code === 0) {
this.total = data.total;
this.total = data.total this.tableData = data.list;
this.tableData = data.list
} else { } else {
this.$message.error(msg) this.$message.error(msg);
} }
this.tableLoading = false this.tableLoading = false;
}, },
// //
initDate () { initDate() {
let yesterday = new Date((new Date).getTime() - 24 * 60 * 60 * 1000) let yesterday = new Date(new Date().getTime() - 24 * 60 * 60 * 1000);
let year = yesterday.getFullYear() let year = yesterday.getFullYear();
let month = yesterday.getMonth() + 1 // let month = yesterday.getMonth() + 1; //
let day = yesterday.getDate() // let day = yesterday.getDate(); //
let days = new Date(year, month, 0); let days = new Date(year, month, 0);
days = days.getDate(); // days = days.getDate(); //
@ -171,96 +180,102 @@ export default {
day2 = days2; day2 = days2;
} }
if (month2 < 10) { if (month2 < 10) {
month2 = '0' + month2; month2 = "0" + month2;
} }
if (month < 10) { if (month < 10) {
month = '0' + month; month = "0" + month;
} }
if (day < 10) { if (day < 10) {
day = '0' + day; day = "0" + day;
} }
if (day2 < 10) { if (day2 < 10) {
day2 = '0' + day2; day2 = "0" + day2;
} }
let t2 = year2 + '-' + month2 + '-' + day2; let t2 = year2 + "-" + month2 + "-" + day2;
let t1 = year + '-' + month + '-' + day; let t1 = year + "-" + month + "-" + day;
// let t3 = formate(t2, style); // let t3 = formate(t2, style);
this.formData.startTime = t2 + ' 00:00:00' this.formData.startTime = t2 + " 00:00:00";
this.formData.endTime = t1 + ' 23:59:59' this.formData.endTime = t1 + " 23:59:59";
this.timeRange = [t2, t1] this.timeRange = [t2, t1];
}, },
handleTimeChange(time) {
handleTimeChange (time) {
if (time) { if (time) {
const startTimeArray = util.dateFormatter(time[0], 'date').split('-') const startTimeArray = util.dateFormatter(time[0], "date").split("-");
const endTimeArray = util.dateFormatter(time[1], 'date').split('-') const endTimeArray = util.dateFormatter(time[1], "date").split("-");
this.formData.startTime = startTimeArray[0] + '-' + startTimeArray[1] + '-' + startTimeArray[2] + ' 00:00:00' this.formData.startTime =
this.formData.endTime = endTimeArray[0] + '-' + endTimeArray[1] + '-' + endTimeArray[2] + ' 23:59:59' startTimeArray[0] +
"-" +
startTimeArray[1] +
"-" +
startTimeArray[2] +
" 00:00:00";
this.formData.endTime =
endTimeArray[0] +
"-" +
endTimeArray[1] +
"-" +
endTimeArray[2] +
" 23:59:59";
// this.startTimeShow = startTimeArray[0] + '' + startTimeArray[1] + '' + startTimeArray[2] + '' // this.startTimeShow = startTimeArray[0] + '' + startTimeArray[1] + '' + startTimeArray[2] + ''
// this.endTimeShow = endTimeArray[0] + '' + endTimeArray[1] + '' + endTimeArray[2] + '' // this.endTimeShow = endTimeArray[0] + '' + endTimeArray[1] + '' + endTimeArray[2] + ''
} else { } else {
this.formData.startTime = '' this.formData.startTime = "";
this.formData.endTime = '' this.formData.endTime = "";
// this.startTimeShow = '' // this.startTimeShow = ''
// this.endTimeShow = '' // this.endTimeShow = ''
} }
this.loadTable() this.loadTable();
}, },
handleSizeChange (val) { handleSizeChange(val) {
this.pageSize = val this.pageSize = val;
this.pageNo = 1 this.pageNo = 1;
this.loadTable() this.loadTable();
}, },
handleCurrentChange (val) { handleCurrentChange(val) {
this.pageNo = val this.pageNo = val;
this.loadTable() this.loadTable();
}, },
// //
startLoading () { startLoading() {
loading = Loading.service({ loading = Loading.service({
lock: true, // lock: true, //
text: '正在加载……', // text: "正在加载……", //
background: 'rgba(0,0,0,.7)' // background: "rgba(0,0,0,.7)", //
}) });
}, },
// //
endLoading () { endLoading() {
// clearTimeout(timer); // clearTimeout(timer);
if (loading) { if (loading) {
loading.close() loading.close();
} }
} },
}, },
computed: { computed: {
tableHeight () { tableHeight() {
return this.clientHeight - 460;
return (this.clientHeight - 460)
}, },
rowHeight () { rowHeight() {
return (this.clientHeight - 200) + 'px' return this.clientHeight - 200 + "px";
}, },
...mapGetters(['clientHeight']) ...mapGetters(["clientHeight"]),
},
watch: {
}, },
watch: {},
props: { props: {
serviceType: { serviceType: {
type: String, type: String,
default: '' default: "",
} },
} },
} };
</script> </script>
<style lang="scss" scoped > <style lang="scss" scoped>
@import "@/assets/scss/modules/management/list-main.scss"; @import "@/assets/scss/modules/management/list-main.scss";
</style> </style>

705
src/views/components/resiChangeTransfer.vue

@ -1,142 +1,153 @@
<template> <template>
<div> <div>
<div class="dialog-h-content scroll-h"> <div class="dialog-h-content scroll-h">
<el-form ref="ref_form" <el-form
:inline="false" ref="ref_form"
:model="dataForm" :inline="false"
:rules="dataRule" :model="dataForm"
label-width="150px" :rules="dataRule"
class="g-edit-form"> label-width="150px"
class="g-edit-form"
<el-form-item label="当前组织" >
style="display: block"> <el-form-item label="当前组织" style="display: block">
<span>{{ gridName }}</span> <span>{{ gridName }}</span>
</el-form-item> </el-form-item>
<el-form-item label="姓名" <el-form-item label="姓名" style="display: block">
style="display: block">
<span>{{ dataForm.name }}</span> <span>{{ dataForm.name }}</span>
</el-form-item> </el-form-item>
<el-form-item label="迁出时间" <el-form-item label="迁出时间" prop="outOfTime">
prop="outOfTime"> <el-date-picker
<el-date-picker v-model="dataForm.outOfTime" v-model="dataForm.outOfTime"
type="date" type="date"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd" format="yyyy-MM-dd"
placeholder="选择日期" placeholder="选择日期"
class="u-edit-width-normal" class="u-edit-width-normal"
:clearable="false"> :clearable="false"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="迁出类型" <el-form-item label="迁出类型" prop="type" style="display: block">
prop="type"
style="display: block">
<el-radio-group v-model="dataForm.type"> <el-radio-group v-model="dataForm.type">
<el-radio :label="'in'">{{
<el-radio :label="'in'">{{'迁往'+rootAgency.organizationName+'内其他区域'}}</el-radio> "迁往" + rootAgency.organizationName + "内其他区域"
}}</el-radio>
<el-radio :label="'out'">其他</el-radio> <el-radio :label="'out'">其他</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<template v-if="dataForm.type==='in'"> <template v-if="dataForm.type === 'in'">
<el-form-item label="迁出至" <el-form-item label="迁出至" prop="agencyId">
prop='agencyId'> <el-cascader
<el-cascader ref="myCascader" ref="myCascader"
v-model="agencyIdArray" v-model="agencyIdArray"
class="u-edit-width-normal" class="u-edit-width-normal"
:key="iscascaderShow" :key="iscascaderShow"
:options="casOptions" :options="casOptions"
:props="optionProps" :props="optionProps"
@change="handleChangeAgency" @change="handleChangeAgency"
clearable></el-cascader> clearable
></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="所属家庭" <el-form-item label="所属家庭" prop="villageId">
prop="villageId">
<div> <div>
<el-select
<el-select v-model.trim="dataForm.villageId" v-model.trim="dataForm.villageId"
placeholder="请选择小区" placeholder="请选择小区"
clearable clearable
class="u-edit-width-normal" class="u-edit-width-normal"
@change="handleChangeCommunity($event)"> @change="handleChangeCommunity($event)"
<el-option v-for="item in communityList" >
:key="item.value" <el-option
:label="item.label" v-for="item in communityList"
:value="item.value"> :key="item.value"
:label="item.label"
:value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
<div style="margin-top:5px"> <div style="margin-top: 5px">
<el-select
<el-select v-model.trim="dataForm.buildId" v-model.trim="dataForm.buildId"
placeholder="楼号" placeholder="楼号"
clearable clearable
class="u-edit-width-build" class="u-edit-width-build"
@change="handleChangeBuilding($event)"> @change="handleChangeBuilding($event)"
<el-option v-for="item in buildingList" >
:key="item.value" <el-option
:label="item.label" v-for="item in buildingList"
:value="item.value"> :key="item.value"
:label="item.label"
:value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
<el-select v-model.trim="dataForm.unitId" <el-select
placeholder="单元" v-model.trim="dataForm.unitId"
clearable placeholder="单元"
style="margin-left: 10px;" clearable
class="u-edit-width-build" style="margin-left: 10px"
@change="handleChangeUnit($event)"> class="u-edit-width-build"
<el-option v-for="item in unitList" @change="handleChangeUnit($event)"
:key="item.value" >
:label="item.label" <el-option
:value="item.value"> v-for="item in unitList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
<el-select v-model.trim="dataForm.homeId" <el-select
placeholder="房号" v-model.trim="dataForm.homeId"
clearable placeholder="房号"
style="margin-left: 10px;" clearable
class="u-edit-width-build" style="margin-left: 10px"
@change="handleChangeHome($event)"> class="u-edit-width-build"
<el-option v-for="item in roomList" @change="handleChangeHome($event)"
:key="item.value" >
:label="item.label" <el-option
:value="item.value"> v-for="item in roomList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
</el-form-item> </el-form-item>
</template> </template>
<div v-if="dataForm.type==='out'"> <div v-if="dataForm.type === 'out'">
<el-form-item label="外迁详细地址" <el-form-item label="外迁详细地址" prop="address">
prop="address"> <el-input
<el-input type="textarea" type="textarea"
:autosize="{ minRows: 2, maxRows: 7}" :autosize="{ minRows: 2, maxRows: 7 }"
:rows="5" :rows="5"
resize="none" resize="none"
class="u-edit-width-normal" class="u-edit-width-normal"
placeholder='请输入外迁详细地址' placeholder="请输入外迁详细地址"
v-model="dataForm.address"> v-model="dataForm.address"
>
</el-input> </el-input>
</el-form-item> </el-form-item>
</div> </div>
<el-form-item label="迁出原因" <el-form-item label="迁出原因" prop="reason">
prop="reason"> <el-input
<el-input type="textarea" type="textarea"
:autosize="{ minRows: 4, maxRows: 7}" :autosize="{ minRows: 4, maxRows: 7 }"
:rows="5" :rows="5"
resize="none" resize="none"
class="u-edit-width-normal" class="u-edit-width-normal"
placeholder='请输入迁出原因' placeholder="请输入迁出原因"
v-model="dataForm.reason"> v-model="dataForm.reason"
>
</el-input> </el-input>
</el-form-item> </el-form-item>
<!-- <el-form-item label="" <!-- <el-form-item label=""
@ -144,31 +155,30 @@
<el-checkbox v-model="dataForm.welfareFlag">享受福利</el-checkbox> <el-checkbox v-model="dataForm.welfareFlag">享受福利</el-checkbox>
</el-form-item> --> </el-form-item> -->
</el-form> </el-form>
</div> </div>
<div class="m-edit-btn"> <div class="m-edit-btn">
<el-button size="small" <el-button size="small" @click="handleCancle"> </el-button>
@click="handleCancle"> </el-button> <el-button
<el-button type="primary" type="primary"
size="small" size="small"
class="diy-button--blue" class="diy-button--blue"
:disabled="btnDisable" :disabled="btnDisable"
@click="handleComfirm"> </el-button> @click="handleComfirm"
> </el-button
>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import util from '@js/util.js'; import util from "@js/util.js";
import { Loading } from 'element-ui' // Loading import { Loading } from "element-ui"; // Loading
import { requestPost, requestGet } from '@/js/dai/request' import { requestPost, requestGet } from "@/js/dai/request";
let loading // let loading; //
export default { export default {
data () { data() {
return { return {
btnDisable: false, btnDisable: false,
communityList: [], communityList: [],
buildingList: [], buildingList: [],
@ -176,37 +186,37 @@ export default {
roomList: [], roomList: [],
dataForm: { dataForm: {
icUserId: '', // ID icUserId: "", // ID
type: 'in',//out,in type: "in", //out,in
agencyId: '',//Id agencyId: "", //Id
gridId: '',//Id gridId: "", //Id
gridName: '', gridName: "",
villageId: '',//ID villageId: "", //ID
villageName: '', villageName: "",
buildId: '',//Id buildId: "", //Id
buildName: '', buildName: "",
unitId: '',//Id unitId: "", //Id
unitName: '', unitName: "",
homeId: '', //Id homeId: "", //Id
homeName: '', homeName: "",
transferTime: '', // transferTime: "", //
reason: '', // reason: "", //
customerId: '', customerId: "",
oldHome: '', oldHome: "",
oldDept: '', oldDept: "",
oldAddress: '', oldAddress: "",
ownerName: '', ownerName: "",
name: '', name: "",
gender: '', gender: "",
age: '', age: "",
address: '', address: "",
outOfTime: '', outOfTime: "",
welfareFlag: false welfareFlag: false,
}, },
customerId: '',//id customerId: "", //id
userId: '',//id userId: "", //id
gridName: '', gridName: "",
rootAgency: {}, rootAgency: {},
casOptions: [], casOptions: [],
@ -216,320 +226,303 @@ export default {
optionProps: { optionProps: {
multiple: false, multiple: false,
value: 'agencyId', value: "agencyId",
label: 'agencyName', label: "agencyName",
children: 'subAgencyList', children: "subAgencyList",
// checkStrictly: true // checkStrictly: true
}, },
selGrid: {}, selGrid: {},
};
}
},
components: {
},
mounted () {
}, },
components: {},
mounted() {},
computed: { computed: {
dataRule () { dataRule() {
return { return {
type: [ type: [
{ required: true, message: '操作类型不能为空', trigger: 'blur' }, { required: true, message: "操作类型不能为空", trigger: "blur" },
], ],
agencyId: [ agencyId: [
{ required: true, message: '所选组织不能为空', trigger: 'blur' } { required: true, message: "所选组织不能为空", trigger: "blur" },
], ],
villageId: [ villageId: [
{ required: true, message: '所属家庭不能为空', trigger: 'blur' } { required: true, message: "所属家庭不能为空", trigger: "blur" },
], ],
address: [ address: [
{ required: true, message: '外迁详细地址不能为空', trigger: 'blur' } { required: true, message: "外迁详细地址不能为空", trigger: "blur" },
], ],
outOfTime: [ outOfTime: [
{ required: true, message: '迁出时间不能为空', trigger: 'blur' } { required: true, message: "迁出时间不能为空", trigger: "blur" },
] ],
};
}
}, },
}, },
methods: { methods: {
async initForm (row) { async initForm(row) {
this.customerId = localStorage.getItem("customerId"); this.customerId = localStorage.getItem("customerId");
this.$refs.ref_form.resetFields(); this.$refs.ref_form.resetFields();
// this.icUserId = row.icResiUserId // this.icUserId = row.icResiUserId
this.gridName = row.GRID_ID this.gridName = row.gridName;
this.dataForm.icUserId = row.icResiUserId this.dataForm.icUserId = row.resiId;
// //
if (row.DOOR_NAME !== null && row.DOOR_NAME !== '' && row.DOOR_NAME !== undefined) { if (
this.dataForm.oldHome = row.DOOR_NAME row.homeName !== null &&
row.homeName !== "" &&
row.homeName !== undefined
) {
this.dataForm.oldHome = row.homeName;
} else { } else {
this.dataForm.oldHome = '' this.dataForm.oldHome = "";
} }
this.dataForm.customerId = this.customerId this.dataForm.customerId = this.customerId;
this.dataForm.idCard = row.ID_CARD this.dataForm.idCard = row.idNum;
this.dataForm.mobile = row.MOBILE this.dataForm.mobile = row.mobile;
await this.loadHouseInfo(row.HOME_ID_VALUE) await this.loadHouseInfo(row.homeId);
this.dataForm.name = row.NAME this.dataForm.name = row.name;
this.dataForm.gender = row.GENDER this.dataForm.gender = row.gender;
this.dataForm.age = '' this.dataForm.age = "";
await this.loadRootAgency()
await this.getAgencylist()
await this.loadRootAgency();
await this.getAgencylist();
}, },
async loadHouseInfo (homeIdValue) {
const url = "/gov/org/ichouse/" + homeIdValue async loadHouseInfo(homeIdValue) {
const { data, code, msg } = await requestGet(url) const url = "/gov/org/ichouse/" + homeIdValue;
const { data, code, msg } = await requestGet(url);
if (code === 0) { if (code === 0) {
this.dataForm.oldDept = '' this.dataForm.oldDept = "";
this.dataForm.oldAddress = data.houseName this.dataForm.oldAddress = data.houseName;
this.dataForm.ownerName = data.ownerName this.dataForm.ownerName = data.ownerName;
} else { } else {
this.$message.error(msg) this.$message.error(msg);
} }
}, },
//id //id
async loadRootAgency () { async loadRootAgency() {
await this.$http
await this.$http.post('/gov/org/agency/customerrootagency/' + this.customerId).then(({ data: res }) => { .post("/gov/org/agency/customerrootagency/" + this.customerId)
if (res.code !== 0) { .then(({ data: res }) => {
return this.$message.error(res.msg) if (res.code !== 0) {
} return this.$message.error(res.msg);
}
if (res.data) {
this.rootAgency = res.data
}
}).catch(() => { })
if (res.data) {
this.rootAgency = res.data;
}
})
.catch(() => {});
}, },
async getAgencylist () { async getAgencylist() {
const url = "/gov/org/customeragency/rootagencygridtree";
const url = '/gov/org/customeragency/rootagencygridtree'
const params = { const params = {
agencyId: this.rootAgency.id agencyId: this.rootAgency.id,
} };
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params);
if (code === 0) { if (code === 0) {
++this.iscascaderShow ++this.iscascaderShow;
this.casOptions = [] this.casOptions = [];
this.agencyIdArray.length = [] this.agencyIdArray.length = [];
if (data) { if (data) {
let treeData = [data] let treeData = [data];
this.resolveAgencyTree(treeData) this.resolveAgencyTree(treeData);
this.casOptions.push(data) this.casOptions.push(data);
} }
} else { } else {
this.$message.error(msg) this.$message.error(msg);
} }
}, },
resolveAgencyTree (treeData) { resolveAgencyTree(treeData) {
treeData.forEach(element => { treeData.forEach((element) => {
if (!element.subAgencyList || element.subAgencyList.length === 0) {//level=gridtrue if (!element.subAgencyList || element.subAgencyList.length === 0) {
//level=gridtrue
if (element.level === 'grid') { if (element.level === "grid") {
element.disabled = false element.disabled = false;
} else { } else {
element.disabled = true element.disabled = true;
} }
} else { } else {
this.resolveAgencyTree(element.subAgencyList) this.resolveAgencyTree(element.subAgencyList);
} }
}); });
}, },
handleChangeAgency () { handleChangeAgency() {
console.log(this.$refs["myCascader"].getCheckedNodes()[0].data) console.log(this.$refs["myCascader"].getCheckedNodes()[0].data);
this.selGrid = this.$refs["myCascader"].getCheckedNodes()[0].data this.selGrid = this.$refs["myCascader"].getCheckedNodes()[0].data;
this.dataForm.agencyId = this.selGrid.pid this.dataForm.agencyId = this.selGrid.pid;
this.dataForm.gridId = this.selGrid.agencyId this.dataForm.gridId = this.selGrid.agencyId;
this.dataForm.gridName = this.selGrid.agencyName this.dataForm.gridName = this.selGrid.agencyName;
this.loadCommunityList() this.loadCommunityList();
this.dataForm.villageId = ''//ID this.dataForm.villageId = ""; //ID
this.dataForm.villageName = '' this.dataForm.villageName = "";
this.dataForm.buildId = ''//Id this.dataForm.buildId = ""; //Id
this.dataForm.buildName = '' this.dataForm.buildName = "";
this.dataForm.unitId = ''//Id this.dataForm.unitId = ""; //Id
this.dataForm.unitName = '' this.dataForm.unitName = "";
this.dataForm.homeId = '' //Id this.dataForm.homeId = ""; //Id
this.dataForm.homeName = '' this.dataForm.homeName = "";
}, },
async loadCommunityList () { async loadCommunityList() {
const url = '/gov/org/icneighborhood/neighborhoodoption' const url = "/gov/org/icneighborhood/neighborhoodoption";
let params = { let params = {
gridId: this.dataForm.gridId, gridId: this.dataForm.gridId,
agencyId: this.dataForm.agencyId agencyId: this.dataForm.agencyId,
} };
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params);
if (code === 0) { if (code === 0) {
this.communityList = [] this.communityList = [];
this.communityList = [...data] this.communityList = [...data];
} else { } else {
this.$message.error(msg) this.$message.error(msg);
} }
}, },
async handleChangeCommunity (id) { async handleChangeCommunity(id) {
// //
this.communityList.find((item) => { this.communityList.find((item) => {
if (item.value === id) { if (item.value === id) {
this.dataForm.villageName = item.label this.dataForm.villageName = item.label;
} }
}) });
const url = '/gov/org/icbuilding/buildingoption' const url = "/gov/org/icbuilding/buildingoption";
let params = { let params = {
neighborHoodId: this.dataForm.villageId neighborHoodId: this.dataForm.villageId,
} };
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params);
if (code === 0) { if (code === 0) {
this.buildingList = [] this.buildingList = [];
this.buildingList = [...data] this.buildingList = [...data];
this.dataForm.buildId = ''//Id this.dataForm.buildId = ""; //Id
this.dataForm.unitId = ''//Id this.dataForm.unitId = ""; //Id
this.dataForm.homeId = '' //Id this.dataForm.homeId = ""; //Id
} else { } else {
this.$message.error(msg) this.$message.error(msg);
} }
}, },
async handleChangeBuilding (id) { async handleChangeBuilding(id) {
// //
this.buildingList.find((item) => { this.buildingList.find((item) => {
if (item.value === id) { if (item.value === id) {
this.dataForm.buildName = item.label this.dataForm.buildName = item.label;
} }
}) });
const url = '/gov/org/icbuildingunit/unitoption' const url = "/gov/org/icbuildingunit/unitoption";
let params = { let params = {
buildingId: this.dataForm.buildId buildingId: this.dataForm.buildId,
} };
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params);
if (code === 0) { if (code === 0) {
this.unitList = [] this.unitList = [];
this.unitList = [...data] this.unitList = [...data];
this.dataForm.unitId = ''//Id this.dataForm.unitId = ""; //Id
this.dataForm.homeId = '' //Id this.dataForm.homeId = ""; //Id
} else { } else {
this.$message.error(msg) this.$message.error(msg);
} }
}, },
async handleChangeUnit (id) { async handleChangeUnit(id) {
// //
this.unitList.find((item) => { this.unitList.find((item) => {
if (item.value === id) { if (item.value === id) {
this.dataForm.unitName = item.label this.dataForm.unitName = item.label;
} }
}) });
const url = '/gov/org/ichouse/houseoption' const url = "/gov/org/ichouse/houseoption";
let params = { let params = {
unitId: this.dataForm.unitId unitId: this.dataForm.unitId,
} };
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params);
if (code === 0) { if (code === 0) {
this.roomList = [] this.roomList = [];
this.roomList = [...data] this.roomList = [...data];
this.dataForm.homeId = '' //Id this.dataForm.homeId = ""; //Id
} else { } else {
this.$message.error(msg) this.$message.error(msg);
} }
}, },
async handleChangeHome (id) { async handleChangeHome(id) {
// //
this.roomList.find((item) => { this.roomList.find((item) => {
if (item.value === id) { if (item.value === id) {
this.dataForm.homeName = item.label this.dataForm.homeName = item.label;
} }
}) });
}, },
async handleComfirm () { async handleComfirm() {
this.btnDisable = true this.btnDisable = true;
setTimeout(() => { setTimeout(() => {
this.btnDisable = false this.btnDisable = false;
}, 2000) }, 2000);
this.$refs['ref_form'].validate((valid, messageObj) => { this.$refs["ref_form"].validate((valid, messageObj) => {
if (!valid) { if (!valid) {
// app.util.validateRule(messageObj) // app.util.validateRule(messageObj)
console.log('error submit!') console.log("error submit!");
} else { } else {
if (this.dataForm.type === 'in') { if (this.dataForm.type === "in") {
if (!this.dataForm.buildId) { if (!this.dataForm.buildId) {
this.$message.warning('楼栋') this.$message.warning("楼栋");
return false return false;
} }
if (!this.dataForm.unitId) { if (!this.dataForm.unitId) {
this.$message.warning('请选择单元') this.$message.warning("请选择单元");
return false return false;
} }
if (!this.dataForm.homeId) { if (!this.dataForm.homeId) {
this.$message.warning('请选择房间') this.$message.warning("请选择房间");
return false return false;
} }
} }
this.saveForm() this.saveForm();
} }
});
})
}, },
async saveForm () { async saveForm() {
// saveOutOfInfo // saveOutOfInfo
const url = '/epmetuser/changeRelocation/moveOutHome' const url = "/epmetuser/changeRelocation/moveOutHome";
let noData = new Date() let noData = new Date();
noData = util.dateFormatter(noData, 'time') noData = util.dateFormatter(noData, "time");
this.dataForm.transferTime = noData this.dataForm.transferTime = noData;
const { data, code, msg } = await requestPost(url, this.dataForm) const { data, code, msg } = await requestPost(url, this.dataForm);
if (code === 0) { if (code === 0) {
this.$message.success('操作成功') this.$message.success("操作成功");
this.handleCancle() this.handleCancle();
} else { } else {
this.$message.error(msg) this.$message.error(msg);
} }
}, },
// async saveForm () { // async saveForm () {
@ -550,54 +543,52 @@ export default {
// } // }
// }, // },
handleCancle () { handleCancle() {
this.resetData() this.resetData();
this.$emit('dialogCancle') this.$emit("dialogCancle");
}, },
resetData () { resetData() {
this.dataForm = { this.dataForm = {
icUserId: '', // ID icUserId: "", // ID
type: 'in',//out,in type: "in", //out,in
agencyId: '',//Id agencyId: "", //Id
gridId: '',//Id gridId: "", //Id
villageId: '',//ID villageId: "", //ID
buildId: '',//Id buildId: "", //Id
unitId: '',//Id unitId: "", //Id
homeId: '', //Id homeId: "", //Id
transferTime: '', // transferTime: "", //
reason: '', // reason: "", //
outOfTime: '', outOfTime: "",
welfareFlag: false welfareFlag: false,
} };
this.customerId = ''//id this.customerId = ""; //id
this.userId = ''//id this.userId = ""; //id
this.gridName = '' this.gridName = "";
this.rootAgency = {} this.rootAgency = {};
this.selGrid = {} this.selGrid = {};
}, },
// //
startLoading () { startLoading() {
loading = Loading.service({ loading = Loading.service({
lock: true, // lock: true, //
text: '正在加载……', // text: "正在加载……", //
background: 'rgba(0,0,0,.7)' // background: "rgba(0,0,0,.7)", //
}) });
}, },
// //
endLoading () { endLoading() {
// clearTimeout(timer); // clearTimeout(timer);
if (loading) { if (loading) {
loading.close() loading.close();
} }
} },
}, },
props: {} props: {},
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@/assets/scss/modules/management/edit-main.scss"; @import "@/assets/scss/modules/management/edit-main.scss";

10
src/views/components/resiForm.vue

@ -974,6 +974,7 @@ export default {
homeId: '', //id homeId: '', //id
name:'', // name:'', //
nation:'', // nation:'', //
remark:'', //
localResidenceFlag:'', // localResidenceFlag:'', //
birthday:'', // birthday:'', //
idNum:'', // idNum:'', //
@ -1151,9 +1152,16 @@ export default {
methods: { methods: {
submit_from(){ submit_from(){
var flag = false
this.$refs.formId.validate(v=>{ this.$refs.formId.validate(v=>{
this.validateFlag = v this.validateFlag = v
flag = v
}) })
if(flag){
return this.form
}
return this.form
}, },
getAllNation(){ getAllNation(){
@ -1500,7 +1508,7 @@ export default {
const _id = this.form.idNum.substr(0, 6) const _id = this.form.idNum.substr(0, 6)
const { sex, birth, age } = computedCard(this.form.idNum) const { sex, birth, age } = computedCard(this.form.idNum)
this.form.birthday = birth this.form.birthday = birth
this.form.gender = sex == 1 ? '1' : '0' this.form.gender = sex == 1 ? '1' : '2'
this.form.oldPeopleFlag = age >= 60 ? 1 : 0 this.form.oldPeopleFlag = age >= 60 ? 1 : 0
// this.form.IS_BDHJ = huji == _id ? '1' : '' // this.form.IS_BDHJ = huji == _id ? '1' : ''
this.validateIdcard(this.form.idNum) this.validateIdcard(this.form.idNum)

267
src/views/components/resiSearch.vue

@ -2,63 +2,84 @@
<div class="resi-container"> <div class="resi-container">
<!-- <el-card class="resi-card"> --> <!-- <el-card class="resi-card"> -->
<div class="g-main"> <div class="g-main">
<el-form :inline="true" class="header_form_box" :model="form" :label-width="'100px'">
<el-form :inline="true" class="header_form_box" v-for="(item, index) in sliceList(itemList, 4)"
:class="boxHeight ? 'm-form-box-height-auto' : 'm-form-box-height'" :key="index"> <el-form-item label="居民姓名" >
<el-form-item v-for="n in item" :key="n.id"> <el-input v-model="form.name" placeholder="请输入" size="small" class="u-item-width-normal" clearable ></el-input>
<div class="resi-cell"> </el-form-item>
<div style="width:100px;text-align: right;padding-right:14px ;">{{ n.label }}:</div> <el-form-item label="联系电话" >
<div class="resi-cell-value" :class="n.itemType === 'radio' && 'resi-cell-value-radio'"> <el-input v-model="form.mobile" size="small" placeholder="请输入" class="u-item-width-normal" clearable ></el-input>
<el-input v-if="n.itemType === 'input' || n.itemType === 'textarea'" v-model.trim="form[n.columnName]" </el-form-item>
class="u-item-width-normal" size="small" clearable placeholder="请输入内容"> <el-form-item label="证件号" >
</el-input> <el-input v-model="form.idNum" size="small" placeholder="请输入" class="u-item-width-normal" clearable ></el-input>
<template v-else-if="n.itemType == 'inputRange'"> </el-form-item>
<!-- <el-input <el-form-item label="居民性别" >
v-model.trim="form[n.columnName]" <el-select v-model="form.gender" class="u-item-width-normal" clearable size="small">
class="resi-cell-input" <el-option label='男' value='1'> </el-option>
<el-option label='女' value='2'> </el-option>
</el-select>
</el-form-item>
<el-form-item label="出生日期" >
<el-date-picker
v-model="form.birthdayStart"
type="date"
size="small" size="small"
clearable class="u-item-width-daterange"
placeholder="请输入内容" placeholder="开始日期">
/> --> </el-date-picker>
<inputRange style="height:37px;" v-model="form[n.columnName]" :type="n.validType" @change="handleAgeChange" /> <span class="u-data-tag"></span>
</template> <el-date-picker
<template v-else-if="n.itemType === 'datepicker'"> v-model="form.birthdayEnd"
<el-date-picker v-if="n.queryType === 'daterange'" v-model.trim="timer.startPickerTime" type="date"
:picker-options="startPickerOptions" type="date" align="right" unlink-panels placeholder="开始时间" size="small"
class="u-item-width-daterange" style="margin-right:34px;" size="small" format="yyyy-MM-dd" value-format="yyyy-MM-dd"> class="u-item-width-daterange u-data-tag"
</el-date-picker> placeholder="结束日期">
<el-date-picker v-if="n.queryType === 'daterange'" v-model.trim="timer.endPickerTime" </el-date-picker>
:picker-options="endPickerOptions" class="u-item-width-daterange data-tag" size="small" type="date" </el-form-item>
value-format="yyyy-MM-dd" value="yyyy-MM-dd" placeholder="结束时间"> <el-form-item label="居民年龄" >
</el-date-picker> <el-input v-model="form.ageStart" class="u-item-width-normal" placeholder="请输入" clearable size="small">
<el-date-picker v-else v-model.trim="form[n.columnName]" class="resi-cell-input" type="inputRange" </el-input>
size="small" clearable format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择日期"> </el-form-item>
</el-date-picker> <el-form-item label="文化程度" >
</template> <el-select v-model="form.cultureLevel" class="u-item-width-normal" clearable size="small">
<el-select v-else-if="n.itemType === 'select' || n.itemType === 'radio'" v-model.trim="form[n.columnName]" <template v-for="item in Education" >
placeholder="请选择" size="small" clearable class="u-item-width-normal" <el-option :label='item.label' :value='item.value'> </el-option>
:collapse-tags="n.multiSelect == 1 ? true : false" :multiple="n.multiSelect == 1 ? true : false"> </template>
<el-option v-for="item in n.options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select> </el-select>
<el-cascader v-else-if="n.itemType === 'cascader'" v-model.trim="form[n.columnName]" :options="n.options" </el-form-item>
:props="{ checkStrictly: true }" clearable size="small" class="resi-cell-select"> <el-form-item label="本地户籍" >
</el-cascader> <el-select v-model="form.localResidenceFlag" class="u-item-width-normal" clearable size="small">
<template v-else-if="n.itemType === 'checkbox'"> <el-option label='是' value='1'> </el-option>
<el-checkbox-group v-model="form[n.columnName]"> <el-option label='否' value='0'> </el-option>
<el-checkbox v-for="ns in n.options" :key="ns.value" :label="ns.value">{{ ns.label }}</el-checkbox> </el-select>
</el-checkbox-group> </el-form-item>
</template> <el-form-item label="居民类别">
</div> <el-select v-model="form.categoryKey" collapse-tags multiple class="u-item-width-normal" clearable size="small">
</div> <template v-for="item in resiClass" >
</el-form-item> <el-option :label='item.label' :value='item.value'> </el-option>
</template>
<el-form-item prop="agencyIdArray"> </el-select>
</el-form-item>
<el-form-item label="人户状况" >
<el-select v-model="form.householdSituation" class="u-item-width-normal" clearable size="small">
<template v-for="item in household" >
<el-option :label='item.label' :value='item.value'> </el-option>
</template>
</el-select>
</el-form-item>
<el-form-item label="民族" >
<el-select v-model="form.nation" class="u-item-width-normal" clearable size="small">
<template v-for="item in nation" >
<el-option :label='item.label' :value='item.value'> </el-option>
</template>
</el-select>
</el-form-item>
<el-form-item prop="agencyIdArray">
<span style="width:100px;text-align: right;padding-right:14px;display: inline-block; " >所属组织:</span> <span style="width:100px;text-align: right;padding-right:14px;display: inline-block; " >所属组织:</span>
<el-cascader class="u-item-width-normal" ref="myCascader" v-model="agencyIdArray" :options="orgOptions" <el-cascader class="u-item-width-normal" size="small" ref="myCascader" v-model="agencyIdArray" :options="orgOptions"
:props="orgOptionProps" :show-all-levels="false" @change="handleChangeAgency"></el-cascader> :props="orgOptionProps" :show-all-levels="false" @change="handleChangeAgency"></el-cascader>
</el-form-item> </el-form-item>
<el-form-item prop="VILLAGE_ID" > <el-form-item prop="VILLAGE_ID" >
<div class="resi-cell"> <div class="resi-cell">
<div class="resi-cell-value"> <div class="resi-cell-value">
@ -88,7 +109,9 @@
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="备注" >
<el-input v-model="form.remark" placeholder="请输入" size="small" class="u-item-width-normal" clearable ></el-input>
</el-form-item>
</el-form> </el-form>
</div> </div>
@ -104,7 +127,7 @@
<smart-search-rule ref="ref_rule" :formType="formType"></smart-search-rule> <smart-search-rule ref="ref_rule" :formType="formType"></smart-search-rule>
</el-col> </el-col>
</el-row> </el-row>
<el-row v-if="isArrow" class="resi-search"> <!-- <el-row v-if="isArrow" class="resi-search">
<el-col :span="24"> <el-col :span="24">
<el-button type="primary" size="small" plain class="diy-button--blue" <el-button type="primary" size="small" plain class="diy-button--blue"
@ -116,7 +139,7 @@
@click="boxHeight = !boxHeight">{{ boxHeight ? '收起' : '展开' }}<i @click="boxHeight = !boxHeight">{{ boxHeight ? '收起' : '展开' }}<i
:class="boxHeight ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"></i></el-button> :class="boxHeight ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"></i></el-button>
</el-col> </el-col>
</el-row> </el-row> -->
</div> </div>
</template> </template>
@ -185,7 +208,26 @@ export default {
} }
}) })
let constForm = { let constForm = {
...form, name:'',
mobile:'',
idNum:'',
birthdayStart:'',
birthdayEnd:'',
ageStart:'',
ageEnd:'',
gender:'',
cultureLevel:'',
localResidenceFlag:'',
householdSituation:'',
nation:'',
agencyId:'',
buildId:'',
homeId:'',
unitId:'',
gridId:'',
villageId:'',
categoryKey:[],
remark:'',
GRID_ID: '', GRID_ID: '',
VILLAGE_ID: '', VILLAGE_ID: '',
BUILD_ID: '', BUILD_ID: '',
@ -228,20 +270,16 @@ export default {
agencyIdArray: [], agencyIdArray: [],
value: '', value: '',
// 1 // 1
Education:[],
nation:[],
household:[],
resiClass:[],
itemList, itemList,
fixedList: [], fixedList: [],
fixedForm: {
AGENCY_ID: '',
GRID_ID: '',
VILLAGE_ID: '',
BUILD_ID: '',
UNIT_ID: '',
HOME_ID: ''
},
constForm, constForm,
form: { form: {
...form, ...form,
AGENCY_ID: '', agencyId : '',
GRID_ID: '', GRID_ID: '',
VILLAGE_ID: '', VILLAGE_ID: '',
BUILD_ID: '', BUILD_ID: '',
@ -282,7 +320,7 @@ export default {
}, },
queryType: { queryType: {
'AGENCY_ID': 'like' 'agencyId ': 'like'
}, },
showSmartSearchForm: false, showSmartSearchForm: false,
@ -447,7 +485,11 @@ export default {
// console.log('formcccc---', this.form) // console.log('formcccc---', this.form)
this.getOrgTreeList() this.getOrgTreeList()
this.getGridList() this.getGridList()
this.getEducation()
this.getValiheList() this.getValiheList()
this.getDictList()
this.getHousehold()
this.getResident()
if (this.columnName) this.handleChangeForm(this.columnName) if (this.columnName) this.handleChangeForm(this.columnName)
}, },
methods: { methods: {
@ -577,14 +619,14 @@ export default {
if (obj) { if (obj) {
if (obj.level === 'grid') { if (obj.level === 'grid') {
this.form.GRID_ID = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''; this.form.GRID_ID = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '';
this.form.AGENCY_ID = '' this.form.agencyId = ''
} else { } else {
this.form.AGENCY_ID = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : ''; this.form.agencyId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '';
this.form.GRID_ID = '' this.form.GRID_ID = ''
} }
} else { } else {
this.form.AGENCY_ID = '' this.form.agencyId = ''
this.form.GRID_ID = '' this.form.GRID_ID = ''
} }
@ -661,7 +703,6 @@ export default {
}) })
}, },
getOrgTreeList() { getOrgTreeList() {
const { user } = this.$store.state
this.$http this.$http
.post('/gov/org/customeragency/agencygridtree', {}) .post('/gov/org/customeragency/agencygridtree', {})
.then(({ data: res }) => { .then(({ data: res }) => {
@ -677,28 +718,28 @@ export default {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
}, },
getGridList() { getGridList () {
const { user } = this.$store.state const { user } = this.$store.state
this.$http this.$http
.post('/gov/org/customergrid/gridoption', { agencyId: user.agencyId, purpose: 'query' }) .post('/gov/org/customergrid/gridoption', { agencyId: user.agencyId, purpose: 'addorupdate' })
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} else { } else {
console.log('获取查询详情成功', res.data) console.log('获取查询详情成功', res.data)
this.optionsG = res.data this.optionsG = res.data
} }
}) })
.catch(() => { .catch(() => {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
}, },
getValiheList() { getValiheList() {
const { user } = this.$store.state const { user } = this.$store.state
this.$http this.$http
.post('/gov/org/icneighborhood/neighborhoodoption', { .post('/gov/org/icneighborhood/neighborhoodoption', {
gridId: this.form.GRID_ID, gridId: this.form.GRID_ID,
agencyId: this.form.AGENCY_ID, agencyId: this.form.agencyId ,
// agencyId: user.agencyId // agencyId: user.agencyId
}) })
.then(({ data: res }) => { .then(({ data: res }) => {
@ -762,6 +803,58 @@ export default {
return this.$message.error('网络错误') return this.$message.error('网络错误')
}) })
}, },
getTreeData (data) {
if (!Array.isArray(data)) return [];
let arr = data.map((item) => {
let _item = {};
if (item.children) {
if (item.children.length === 0)
_item = { ...item, children: undefined };
else _item = { ...item, children: this.getTreeData(item.children) };
} else {
_item = { ...item };
}
return _item;
});
return arr;
},
async getEducation(){
try {
let { data } = await this.$http.post('sys/dict/data/education',{formCode: "resi_base_info"})
data.data = this.getTreeData(data.data)
this.Education = data.data
console.log(this.Education);
} catch (error) {
console.log(error,'获取民族字典');
}
},
async getDictList(){
try {
const { data } = await this.$http.post('sys/dict/data/nation',{formCode: "resi_base_info"})
this.nation = data.data
} catch (error) {
console.log(error,'获取民族字典');
}
},
async getHousehold(){
try {
const { data } = await this.$http.post('sys/dict/data/dictlist', {'dictType':'household_situation'})
this.household = data.data
} catch (error) {
console.log(error,'获取人户状况字典');
}
},
async getResident(){
try {
const { data } = await this.$http.post('sys/dict/data/dictlist', {'dictType':'resident_category'})
this.resiClass = data.data
} catch (error) {
console.log(error,'获取配偶情况字典');
}
},
computedBirth(age) { computedBirth(age) {
let now = new Date(); let now = new Date();
let nowYear = now.getFullYear(); let nowYear = now.getFullYear();

906
src/views/modules/base/resi.vue

File diff suppressed because it is too large

229
src/views/modules/plugins/change/resideathAdd.vue

@ -1,47 +1,50 @@
<template> <template>
<div> <div>
<div class="dialog-h-content scroll-h m-edit"> <div class="dialog-h-content scroll-h m-edit">
<el-form ref="ref_form" <el-form
:inline="true" ref="ref_form"
:model="dataForm" :inline="true"
label-width="90px" :model="dataForm"
:rules="dataRule" label-width="150px"
class="m-form"> :rules="dataRule"
class="g-edit-form"
>
<template> <template>
<el-form-item class="f-top24" <el-form-item class="f-top24" label="当前组织" style="display: block">
label="当前组织" {{ dataForm.gridName }}
style="display: block">
{{resideathAddObj.GRID_ID}}
</el-form-item> </el-form-item>
</template> </template>
<template> <template>
<el-form-item label="姓名" <el-form-item label="姓名" style="display: block">
style="display: block"> {{ dataForm.name }}
{{resideathAddObj.name}}
</el-form-item> </el-form-item>
</template> </template>
<el-form-item label="死亡日期" <el-form-item label="死亡日期" style="display: block" prop="deathDate">
style="display: block" <el-date-picker
prop="deathDate"> v-model="dataForm.deathDate"
<el-date-picker v-model="dataForm.deathDate" class="u-edit-width-normal"
class="u-item-width-daterange" type="date"
type="date" value-format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"
format="yyyy-MM-dd" placeholder="选择日期"
placeholder="选择日期" :clearable="false"
:clearable="false"> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<div class="item-textarea"> <div class="item-textarea">
<el-form-item label="死亡原因" <el-form-item
style="display: block" label="死亡原因"
prop="blacklistReason"> style="display: block"
<el-input type="textarea" prop="blacklistReason"
resize="none" >
class="u-item-width-daterange" <el-input
placeholder='请输入死亡原因' type="textarea"
v-model="dataForm.blacklistReason"> resize="none"
class="u-edit-width-normal"
placeholder="请输入死亡原因"
v-model="dataForm.blacklistReason"
>
</el-input> </el-input>
</el-form-item> </el-form-item>
</div> </div>
@ -51,162 +54,126 @@
<el-checkbox v-model="dataForm.welfareFlag">享受</el-checkbox> <el-checkbox v-model="dataForm.welfareFlag">享受</el-checkbox>
</el-form-item> --> </el-form-item> -->
</el-form> </el-form>
</div> </div>
<div class="m-edit-btn"> <div class="m-edit-btn">
<el-button size="small" <el-button size="small" class="" @click="handleCancle"> </el-button>
class="" <el-button
@click="handleCancle"> </el-button> size="small"
<el-button size="small" class="diy-button--blue"
class="diy-button--blue" :loading="btnDisable"
:loading="btnDisable" @click="handleComfirm"
@click="handleComfirm"> </el-button> > </el-button
>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import util from '@js/util.js'; import util from "@js/util.js";
import { Loading } from 'element-ui' // Loading import { Loading } from "element-ui"; // Loading
import { requestPost, requestGet } from '@/js/dai/request' import { requestPost, requestGet } from "@/js/dai/request";
let loading // let loading; //
export default { export default {
data () { data() {
return { return {
btnDisable: false, btnDisable: false,
dataForm: { dataForm: {
blacklistReason: '', name: "",
deathDate: '', gridName: "",
blacklistReason: "",
deathDate: "",
}, },
};
}
},
components: {
},
mounted () {
}, },
components: {},
mounted() {},
computed: { computed: {
dataRule () { dataRule() {
return { return {
blacklistReason: [ blacklistReason: [
{ required: true, message: '死亡原因不能为空', trigger: 'blur' }, { required: true, message: "死亡原因不能为空", trigger: "blur" },
], ],
deathDate: [ deathDate: [
{ required: true, message: '死亡日期不能为空', trigger: 'blur' } { required: true, message: "死亡日期不能为空", trigger: "blur" },
], ],
};
}
}, },
}, },
methods: { methods: {
async initForm (row) { async initForm(row) {
this.customerId = localStorage.getItem("customerId"); this.customerId = localStorage.getItem("customerId");
this.$refs.ref_form.resetFields(); this.$refs.ref_form.resetFields();
this.dataForm.idCard = row.ID_CARD this.dataForm.idCard = row.idNum;
this.dataForm.name = row.NAME this.dataForm.name = row.name;
this.dataForm.mobile = row.MOBILE this.dataForm.gridName = row.gridName;
this.dataForm.gender = row.GENDER == '女' ? '0' : row.GENDER == '男' ? '1' : '' this.dataForm.mobile = row.mobile;
this.dataForm.type = '1' this.dataForm.gender = row.gender;
this.dataForm.userId = row.icResiUserId this.dataForm.type = "1";
this.dataForm.userId = row.resiId;
}, },
async handleComfirm () { async handleComfirm() {
this.btnDisable = true this.btnDisable = true;
setTimeout(() => { setTimeout(() => {
this.btnDisable = false this.btnDisable = false;
}, 2000) }, 2000);
this.$refs['ref_form'].validate((valid, messageObj) => { this.$refs["ref_form"].validate((valid, messageObj) => {
if (!valid) { if (!valid) {
// app.util.validateRule(messageObj) // app.util.validateRule(messageObj)
console.log('error submit!') console.log("error submit!");
} else { } else {
this.saveForm();
this.saveForm()
} }
});
})
}, },
async saveForm () { async saveForm() {
const url = "/epmetuser/rentDeath/save";
const url = '/epmetuser/rentDeath/save' const { data, code, msg } = await requestPost(url, this.dataForm);
const { data, code, msg } = await requestPost(url, this.dataForm)
if (code === 0) { if (code === 0) {
this.$message.success('操作成功') this.$message.success("操作成功");
this.handleCancle() this.handleCancle();
} else { } else {
this.$message.error(msg) this.$message.error(msg);
} }
}, },
handleCancle() {
handleCancle () { this.resetData();
this.resetData() this.$emit("dialogCancle");
this.$emit('dialogCancle')
}, },
resetData () { resetData() {
this.dataForm = { this.dataForm = {
icUserId: '', // ID name: "",
type: 'in',//out,in gridName: "",
agencyId: '',//Id blacklistReason: "",
gridId: '',//Id deathDate: "",
villageId: '',//ID };
buildId: '',//Id
unitId: '',//Id
homeId: '', //Id
transferTime: '', //
reason: '', //
outOfTime: '',
welfareFlag: false
}
}, },
// //
startLoading () { startLoading() {
loading = Loading.service({ loading = Loading.service({
lock: true, // lock: true, //
text: '正在加载……', // text: "正在加载……", //
background: 'rgba(0,0,0,.7)' // background: "rgba(0,0,0,.7)", //
}) });
}, },
// //
endLoading () { endLoading() {
// clearTimeout(timer); // clearTimeout(timer);
if (loading) { if (loading) {
loading.close() loading.close();
} }
} },
}, },
props: { };
resideathAddObj: {
type: Object,
default: () => { return {} }
}
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@/assets/scss/modules/management/edit-main.scss"; @import "@/assets/scss/modules/management/edit-main.scss";

Loading…
Cancel
Save