Browse Source

居民列表页

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

Loading…
Cancel
Save