Browse Source

信息无误确认功能

feature
mk 2 years ago
parent
commit
987889c8ea
  1. 77
      src/views/modules/base/resi.vue

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

@ -99,8 +99,16 @@
<el-button style="margin-left: 10px" v-if="btnAuths.ic_resi_batch_del" size="small" class="diy-button--add"
type="parimary" @click="deleteBatch">批量删除</el-button>
<el-button style="margin-left: 10px" v-if="btnAuths.ic_resi_batch_del" size="small" class="diy-button--add"
type="parimary" @click="confirmBatch">信息无误批量确认</el-button>
<!-- <el-button style="margin-left: 10px" v-if="btnAuths.ic_resi_batch_del" size="small" class="diy-button--add"
type="parimary" @click="confirmBatch"></el-button> -->
<el-dropdown size="small" split-button type="primary" style="margin: 0 10px; height: 30px"
@command="(command) => confirmBatch(command)">
信息无误确认
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="1">全部确认</el-dropdown-item>
<el-dropdown-item command="2">批量确认</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!-- <el-button type="primary" size="small">下载人口模板</el-button> -->
</div>
</div>
@ -735,19 +743,40 @@ export default {
this.$message.warning("请先选择要删除的居民");
}
},
confirmBatch() {
this.$confirm("是否确认信息", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
confirmBatch(command) {
if(command === '1'){
this.$confirm("是否全部确认信息", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.confirresiBatch();
this.handleSearchFrom();
})
.catch((err) => {
if (err == "cancel") {
}
});
}else{
if (this.selection.length === 0)
return this.$message.error("请选择之后进行操作");
this.$confirm("是否批量确认信息", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.confirresiBatch(this.selection.map(item=>item.resiId));
this.handleSearchFrom();
})
.catch((err) => {
if (err == "cancel") {
}
});
}
},
handleSizeChange(val) {
console.log(`每页 ${val}`);
@ -1077,31 +1106,19 @@ export default {
this.$http
.post(`/actual/base/residentCategoryUpdateInfo/unchangeSingleUpdate/${userIds}` )
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
this.$message.success("信息确定成功");
this.handleSearchFrom();
}
})
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
this.$message.success("信息确定成功");
this.handleSearchFrom();
}
})
},
async confirresiBatch() {
let _obj = JSON.parse(JSON.stringify(this.$refs.myResiSearch.form));
_obj.attentionCrowds = _obj.attentionCrowds.flat();
const url = `/actual/base/residentCategoryUpdateInfo/unchangeMultiUpdate`;
let params = {
pageNo: 1,
pageSize: 100,
..._obj,
};
console.log(params);
async confirresiBatch(ids) {
const url = `/actual/base/residentCategoryUpdateInfo/unchangePartUpdate`;
let params = {ids};
const { data, code, msg } = await requestPost(url, params);
console.log(data, "data");
if (code !== 0) {
return this.$message.error(msg);
} else {

Loading…
Cancel
Save