Browse Source

居民列表页

V1.0
dai 3 years ago
parent
commit
1ac1c8056f
  1. 705
      src/views/components/resiChangeTransfer.vue
  2. 835
      src/views/modules/base/resi.vue
  3. 229
      src/views/modules/plugins/change/resideathAdd.vue

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";

835
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