无等级网格版合并
This commit is contained in:
@@ -1,54 +1,43 @@
|
||||
<template>
|
||||
<ai-list class="list" isTabs>
|
||||
<template slot="content">
|
||||
<ai-search-bar bottomBorder>
|
||||
<template slot="left">
|
||||
<el-date-picker
|
||||
v-model="searchObj.selectionDate"
|
||||
type="date"
|
||||
@change="(page.current = 1), getList()"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
placeholder="选用时间">
|
||||
</el-date-picker>
|
||||
</template>
|
||||
<template slot="right">
|
||||
<el-input
|
||||
v-model="searchObj.name"
|
||||
size="small"
|
||||
placeholder="网格员/责任网格"
|
||||
v-throttle="() => {page.current = 1, getList()}"
|
||||
clearable
|
||||
@clear="(searchObj.name = '', page.current = 1), getList()"
|
||||
suffix-icon="iconfont iconSearch" />
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-search-bar style="padding: 16px 0 0">
|
||||
<template slot="left">
|
||||
<el-button
|
||||
icon="iconfont iconAdd"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="add('')"
|
||||
>添加</el-button
|
||||
icon="iconfont iconAdd"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="add('')"
|
||||
>添加
|
||||
</el-button
|
||||
>
|
||||
<el-button
|
||||
icon="iconfont iconDelete"
|
||||
@click="deleteById(ids.join(','))"
|
||||
:disabled="!Boolean(ids.length)"
|
||||
>删除</el-button
|
||||
icon="iconfont iconDelete"
|
||||
@click="deleteById(ids.join(','))"
|
||||
:disabled="!Boolean(ids.length)"
|
||||
>删除
|
||||
</el-button
|
||||
>
|
||||
</template>
|
||||
<template slot="right">
|
||||
<el-input
|
||||
v-model="searchObj.name"
|
||||
size="small"
|
||||
placeholder="网格员/责任网格"
|
||||
v-throttle="() => {page.current = 1, getList()}"
|
||||
clearable
|
||||
@clear="(searchObj.name = '', page.current = 1), getList()"
|
||||
suffix-icon="iconfont iconSearch"/>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="page.total"
|
||||
ref="aitableex"
|
||||
:current.sync="page.current"
|
||||
:size.sync="page.size"
|
||||
@selection-change="(v) => (ids = v.map((e) => e.id))"
|
||||
@getList="getList()">
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="page.total"
|
||||
:current.sync="page.current"
|
||||
:size.sync="page.size"
|
||||
@selection-change="(v) => (ids = v.map((e) => e.id))"
|
||||
@getList="getList()">
|
||||
<el-table-column label="操作" slot="options" align="center" fixed="right" width="220">
|
||||
<template slot-scope="{ row }">
|
||||
<div class="table-options">
|
||||
@@ -97,67 +86,42 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
colConfigs() {
|
||||
let _ = this;
|
||||
return [
|
||||
{
|
||||
type: "selection",
|
||||
},
|
||||
{
|
||||
prop: "name",
|
||||
label: "网格员姓名",
|
||||
},
|
||||
{
|
||||
prop: "girdInfoListStr",
|
||||
align: "center",
|
||||
label: "责任网格",
|
||||
},
|
||||
{
|
||||
prop: "phone",
|
||||
align: "center",
|
||||
label: "联系电话",
|
||||
},
|
||||
{
|
||||
prop: "selectionDate",
|
||||
align: "center",
|
||||
label: "选用时间",
|
||||
},
|
||||
{type: "selection"},
|
||||
{prop: "name", label: "网格员姓名"},
|
||||
{prop: "girdInfoListStr", align: "center", label: "责任网格"},
|
||||
{prop: "phone", align: "center", label: "联系电话"},
|
||||
{prop: "createTime", align: "center", label: "创建时间"},
|
||||
];
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.instance
|
||||
.post("/app/appgirdmemberinfo/list", null, {
|
||||
params: {
|
||||
...this.searchObj,
|
||||
...this.page,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.tableData = res.data.records;
|
||||
this.page.total = res.data.total;
|
||||
}
|
||||
});
|
||||
this.instance.post("/app/appgirdmemberinfo/list", null, {
|
||||
params: {...this.searchObj, ...this.page}
|
||||
}).then((res) => {
|
||||
if (res?.data) {
|
||||
this.tableData = res.data.records;
|
||||
this.page.total = res.data.total;
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteById(ids) {
|
||||
ids &&
|
||||
this.$confirm("是否要删除该网格员?", {
|
||||
type: "error",
|
||||
ids && this.$confirm("是否要删除该网格员?", {
|
||||
type: "error",
|
||||
}).then(() => {
|
||||
this.instance
|
||||
.post("/app/appgirdmemberinfo/delete", null, {
|
||||
params: {ids},
|
||||
})
|
||||
.then(() => {
|
||||
this.instance
|
||||
.post("/app/appgirdmemberinfo/delete", null, {
|
||||
params: { ids },
|
||||
})
|
||||
.then((res) => {
|
||||
if (res?.code == 0) {
|
||||
this.$message.success("删除成功!");
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
.then((res) => {
|
||||
if (res?.code == 0) {
|
||||
this.$message.success("删除成功!");
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(() => 0);
|
||||
},
|
||||
add(id) {
|
||||
this.$emit('change', {
|
||||
@@ -167,8 +131,7 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
toMonitorUser (id) {
|
||||
toMonitorUser(id) {
|
||||
this.$emit('change', {
|
||||
type: 'MonitorUser',
|
||||
params: {
|
||||
@@ -176,8 +139,7 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
toFamily (id) {
|
||||
toFamily(id) {
|
||||
this.$emit('change', {
|
||||
type: 'Family',
|
||||
params: {
|
||||
@@ -185,7 +147,6 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
handleSelectionChange(val) {
|
||||
this.ids = [];
|
||||
val.map((e) => {
|
||||
@@ -197,7 +158,7 @@ export default {
|
||||
this.searchObj[e] = "";
|
||||
});
|
||||
this.getList();
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user