Browse Source

新增

V1.0
马魁 3 years ago
parent
commit
df6c1b9f00
  1. 1285
      src/views/components/resiForm.vue
  2. 238
      src/views/modules/base/resi.vue

1285
src/views/components/resiForm.vue

File diff suppressed because it is too large

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

@ -17,13 +17,7 @@
</el-collapse-item>
</el-collapse> -->
<!-- <template v-else> -->
<resi-search v-if="searchList.length > 0"
ref="resiSearch"
:form-list="searchList[0].queryItemList"
:column-name="defaultCategotyKey"
:show-grid="true"
:is-arrow="true"
@search="handleSearch" />
<!-- </template> -->
<!-- <el-row v-if="openSearch"
class="resi-search">
@ -127,19 +121,31 @@
:prop="item.columnName"
:label="item.label"
align="left"
:fixed="item.columnName == 'NAME' ? 'left' : false"
:show-overflow-tooltip="true"
:width="item.width || computedWidth(item.label, item.itemType)">
<!-- :width="item.itemType === 'radio' ? computedWidth(item.label) : 180" -->
<template slot-scope="scope">
<a v-if="item.columnName == 'NAME' && btnAuths.ic_resi_view"
class="name-a"
@click="handleLook(scope.row)">
>
{{ handleFilterSpan(scope.row, item) }}
</a>
<div v-else-if="item.columnName == 'gender'">
{{scope.row.gender == 1 ? '男' : '女' }}
</div>
<div v-else-if="item.columnName == 'birthday'">
{{scope.row.birthday.substr(0,10) }}
</div>
<div v-else-if="item.columnName == 'idNum'">
{{`${scope.row.idNum.substr(0,11)}`+'******'+`${scope.row.idNum.substr(16,2)}` }}
</div>
<div v-else-if="item.columnName == 'mobile'">
{{`${scope.row.mobile.substr(0,3)}`+'******'+`${scope.row.mobile.substr(7,4)}` }}
</div>
<span v-else>{{ handleFilterSpan(scope.row, item) }}</span>
</template>
</el-table-column>
<el-table-column fixed="right"
label="操作"
@ -166,21 +172,21 @@
<el-popconfirm v-if="btnAuths.ic_resi_del"
title="删除之后无法回复,确认删除?"
@onConfirm="handleDel(scope.row)">
<!-- <el-button slot="reference"
type="text"
size="small"
class="btn-color-del">删除</el-button> -->
</el-popconfirm>
</template>
<el-button @click="handleChangeTransfer(scope.row)"
<el-button
type="text"
class="div-table-button--blue"
size="small" @click="handleLook(scope.row)">查看</el-button>
<el-button
type="text"
class="div-table-button--blue"
size="small">迁出登记</el-button>
<el-button @click="handleDeath(scope.row)"
size="small">编辑</el-button>
<el-button
class="div-table-button--blue"
type="text"
size="small">死亡登记</el-button>
size="small"> 登记</el-button>
</template>
</el-table-column>
</el-table>
@ -450,7 +456,9 @@ export default {
editTableName: {},
formName: "",
formList: [],
tableHeader: [],
tableHeader: [
{columnName:'name',label:'姓名'}, {columnName:'birthday',label:'生日'},{columnName:'gender',label:'性别'},{columnName:'gridName',label:'所属网格'},{columnName:'homeName',label:'所属房屋'},{columnName:'idNum',label:'证件号'},{columnName:'mobile',label:'联系电话'}
],
tabsList: [],
selection: [],
@ -489,8 +497,6 @@ export default {
let query = this.$route.query;
this.defaultCategotyKey = query.columnName;
console.log("defaultCategotyKey----", this.defaultCategotyKey);
await this.getSearchList();
this.$refs.resiSearch.handleSearch();
}
},
computed: {
@ -509,20 +515,14 @@ export default {
this.defaultCategotyKey = query.columnName;
}
await this.getSearchList();
// await this.getFormList()
await this.getTableHeader();
// console.log('this.$refs.resiSearch', this)
this.$refs.resiSearch.handleSearch();
// this.handleSearch()
// this.getTableData()
// console.log('this.$refs.resiSearch', this)
this.getTableData()
this.pageLoading = true;
this.searchH = this.$refs.resiSearch.$el.offsetHeight;
console.log("storeoooo----0000", this.$store);
console.log("resiSearch", this.$refs.resiSearch.$el.offsetHeight);
},
async mounted () {
// this.$nextTick(() => {
@ -706,31 +706,12 @@ export default {
return _val || row[item.columnName];
},
handleSearchFrom () {
let arr = [];
this.searchList.forEach((item) => {
const arr1 =
this.$refs[`resiSearch${item.itemGroupId}`][0].handleSearch();
arr = arr.concat(arr1);
// console.log('search-----refs', this.$refs[`resiSearch${item.itemGroupId}`])
});
console.log("search-----refs", this.$refs);
console.log("search-----arr", arr);
this.currentPage = 1;
this.conditions = arr;
this.getTableData();
},
handleSearch (val) {
console.log("searchhh--", val);
this.currentPage = 1;
this.conditions = val;
this.getTableData();
},
resetSearchForm (formName) {
// for(const n in this.form) {
// this.form[n] = ''
// }
// this.handleSearch()
this.searchList.forEach((item) => {
this.$refs[`resiSearch${item.itemGroupId}`][0].resetForm();
// console.log('search-----refs', this.$refs[`resiSearch${item.itemGroupId}`])
@ -1057,12 +1038,35 @@ export default {
const arr = await this.formetForm();
if (arr) this.submitEdit(arr);
},
async handleSUbmit () {
this.$refs.baseForm.submit_from()
for (const key of this.$refs.baseForm) {
if(typeof key == "Object"){
console.log(key);
}
}
// console.log(this,$refs.baseForm);
// const arr = await this.formetForm();
// if (arr) this.submitAdd(arr);
this.dialogVisible = false;
// this.$refs.baseForm.tabsList.forEach(item=>{
// if(item.id){
// console.log(item.id);
// }
// })
// console.log(this.$refs.baseForm.tabsList);
// if(this.$refs.baseForm.form.hobbyInfoDto.hobbyCode.length != 0 || this.$refs.baseForm.form.volunteerDto.volunteerCategory.length != 0 ||this.$refs.baseForm.form.specialDto.specialCategoryCode.length != 0){
// this.$refs.baseForm.form.hobbyInfoDto.hobbyCode = this.$refs.baseForm.form.hobbyInfoDto.hobbyCode.join(',')
// this.$refs.baseForm.form.volunteerDto.volunteerCategory = this.$refs.baseForm.form.volunteerDto.volunteerCategory.join(',')
// this.$refs.baseForm.form.specialDto.specialCategoryCode = this.$refs.baseForm.form.specialDto.specialCategoryCode.join(',')
// }else {
// this.$refs.baseForm.form.hobbyInfoDto.hobbyCode = ''
// this.$refs.baseForm.form.volunteerDto.volunteerCategory=''
// this.$refs.baseForm.form.specialDto.specialCategoryCode = ''
// }
// this.submitAdd(this.$refs.baseForm.form);
console.log(this.$refs.baseForm.form);
// this.dialogVisible = false;
},
handleDel (row) {
let params = {
@ -1107,24 +1111,21 @@ export default {
async submitAdd (arr) {
this.btnLoading = true;
await this.$http
.post("/epmetuser/icresiuser/add", arr)
.post("/actual/base/residentBaseInfo/save", arr)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
this.$message.success("提交成功");
// this.$refs[formName].resetFields();
this.$refs.baseForm.resetForm();
this.tabsList.forEach((item) => {
this.$refs["group" + item.groupId][0].resetForm();
});
this.getTableData();
this.dialogVisible = false;
}
})
.catch(() => {
return this.$message.error("网络错误");
});
// console.log(this.$refs.baseForm.form);
this.btnLoading = false;
},
async submitEdit (arr) {
@ -1150,71 +1151,21 @@ export default {
});
this.btnLoading = false;
},
async getTableHeader () {
await this.$http
.post("/oper/customize/icform/tableheaders", {
formCode: "resi_base_info",
})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
this.tableHeader = res.data;
}
})
.catch(() => {
return this.$message.error("网络错误");
});
},
async getTableData () {
this.tableLoading = true;
// console.log(this.conditions);
// if(this.conditions.columnName){
// columnValue
// }
// var index = this.conditions.findIndex(item=>item.columnName === 'BIRTHDAY' )
// this.conditions.filter(item=>{
// if(item.columnName === "BIRTHDAY") {
// console.log(this.$refs.resiSearch.endPickerTime);
// item.columnValue = [this.$refs.resiSearch.endPickerTime,this.$refs.resiSearch.startPickerTime]
// }
// })
// console.log(this.conditions);
let timer = this.$refs.resiSearch.handelWatchStartDate()
console.log(timer, '派发');
let params = {
formCode: "resi_base_info",
pageNo: this.currentPage,
pageSize: this.pageSize,
conditions: this.conditions,
try {
let params = {
pageNo: this.currentPage,
pageSize: this.pageSize,
};
await this.$http
.post("/epmetuser/icresiuser/listresi", params)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
this.tableData = res.data.list.map((item) => {
return {
...item,
isChecked: this.filterEdit(item.ORG_ID),
};
});
let _selAllFlagDisabled = true;
this.tableData.forEach((item) => {
if (item.isChecked) _selAllFlagDisabled = false;
});
this.selAllFlagDisabled = _selAllFlagDisabled;
this.total = res.data.total;
}
})
.catch(() => {
console.log(this.conditions);
return this.$message.error("网络错误");
});
// this.tableLoading = true;
const { data } = await this.$http.post("/actual/base/residentBaseInfo/page", params)
this.tableData =data.data.list
console.log(this.tableData);
console.log(data,'data');
} catch (error) {
console.log(error);
}
this.tableLoading = false;
},
getrowInfo (id) {
@ -1312,48 +1263,7 @@ export default {
});
return options;
},
async getSearchList () {
// /oper/customize/icform/conditionlist
await this.$http
.post("/oper/customize/icform/conditionlist-bygroup", {
formCode: "resi_base_info",
dynamic: true,
})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
console.log("获取查询详情成功--sss", res);
res.data.forEach((item) => {
item.queryItemList.forEach((n) => {
if (n.optionSourceType === "remote") {
this.getOptionsList(n.optionSourceValue).then((res) => {
n.options = this.getTreeData(res);
});
// console.log('')
} else if (n.itemType == "radio" && n.options.length == 0) {
n.options = [
{
label: "是",
value: "1",
},
{
label: "否",
value: "0",
},
];
}
});
});
this.searchList = res.data;
console.log(this.searchList);
}
})
.catch(() => {
return this.$message.error("网络错误");
});
},
getTreeData (data) {
if (!Array.isArray(data)) return [];
let arr = data.map((item) => {

Loading…
Cancel
Save