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" <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> 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" <!-- <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> 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> --> <!-- <el-button type="primary" size="small">下载人口模板</el-button> -->
</div> </div>
</div> </div>
@ -735,19 +743,40 @@ export default {
this.$message.warning("请先选择要删除的居民"); this.$message.warning("请先选择要删除的居民");
} }
}, },
confirmBatch() { confirmBatch(command) {
this.$confirm("是否确认信息", "提示", { if(command === '1'){
confirmButtonText: "确定", this.$confirm("是否全部确认信息", "提示", {
cancelButtonText: "取消", confirmButtonText: "确定",
type: "warning", cancelButtonText: "取消",
}) type: "warning",
})
.then(() => { .then(() => {
this.confirresiBatch(); 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) => { .catch((err) => {
if (err == "cancel") { if (err == "cancel") {
} }
}); });
}
}, },
handleSizeChange(val) { handleSizeChange(val) {
console.log(`每页 ${val}`); console.log(`每页 ${val}`);
@ -1077,31 +1106,19 @@ export default {
this.$http this.$http
.post(`/actual/base/residentCategoryUpdateInfo/unchangeSingleUpdate/${userIds}` ) .post(`/actual/base/residentCategoryUpdateInfo/unchangeSingleUpdate/${userIds}` )
.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 {
this.$message.success("信息确定成功"); this.$message.success("信息确定成功");
this.handleSearchFrom(); this.handleSearchFrom();
} }
}) })
}, },
async confirresiBatch() { async confirresiBatch(ids) {
let _obj = JSON.parse(JSON.stringify(this.$refs.myResiSearch.form)); const url = `/actual/base/residentCategoryUpdateInfo/unchangePartUpdate`;
_obj.attentionCrowds = _obj.attentionCrowds.flat(); let params = {ids};
const url = `/actual/base/residentCategoryUpdateInfo/unchangeMultiUpdate`;
let params = {
pageNo: 1,
pageSize: 100,
..._obj,
};
console.log(params);
const { data, code, msg } = await requestPost(url, params); const { data, code, msg } = await requestPost(url, params);
console.log(data, "data");
if (code !== 0) { if (code !== 0) {
return this.$message.error(msg); return this.$message.error(msg);
} else { } else {

Loading…
Cancel
Save