网格员申办
This commit is contained in:
102
packages/2.0.5/AppGridMember/AppGridMember.vue
vendored
102
packages/2.0.5/AppGridMember/AppGridMember.vue
vendored
@@ -1,30 +1,38 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="AppGridMember">
|
<ai-list class="AppGridMember" v-if="!isShowDetail">
|
||||||
<keep-alive :include="['List']">
|
<template slot="title">
|
||||||
<component
|
<ai-title title="网格员管理" :isShowBottomBorder="false"></ai-title>
|
||||||
ref="component"
|
</template>
|
||||||
:is="component"
|
<template slot="tabs">
|
||||||
@change="onChange"
|
<el-tabs v-model="currIndex">
|
||||||
:params="params"
|
<el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label">
|
||||||
:instance="instance"
|
<component :ref="String(i)" v-if="currIndex == i" :is="tab.comp" @change="onChange" lazy :instance="instance" :dict="dict" :permissions="permissions"/>
|
||||||
:dict="dict"
|
</el-tab-pane>
|
||||||
></component>
|
</el-tabs>
|
||||||
</keep-alive>
|
</template>
|
||||||
</div>
|
</ai-list>
|
||||||
|
<Add v-else-if="component === 'Add'" :params="params" :instance="instance" :dict="dict" :permissions="permissions" @change="onChange"></Add>
|
||||||
|
<Family v-else-if="component === 'Family'" :params="params" :instance="instance" :dict="dict" :permissions="permissions" @change="onChange"></Family>
|
||||||
|
<ApplyDetail v-else-if="component === 'ApplyDetail'" :params="params" :instance="instance" :dict="dict" :permissions="permissions" @change="onChange"></ApplyDetail>
|
||||||
|
<ApplyAdd v-else-if="component === 'ApplyAdd'" :params="params" :instance="instance" :dict="dict" :permissions="permissions" @change="onChange"></ApplyAdd>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import List from "./components/list";
|
import List from './components/list'
|
||||||
import Add from "./components/add";
|
import ApplyList from './components/ApplyList'
|
||||||
import Family from "./components/Family";
|
import Add from './components/add'
|
||||||
|
import ApplyDetail from './components/ApplyDetail'
|
||||||
|
import ApplyAdd from './components/ApplyAdd'
|
||||||
|
import Family from './components/Family'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AppGridMember",
|
name: "AppGridMember",
|
||||||
label: "网格管理员",
|
label: "网格管理员",
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
instance: Function,
|
instance: Function,
|
||||||
dict: Object,
|
dict: Object,
|
||||||
|
permissions: Function
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
@@ -32,13 +40,31 @@ export default {
|
|||||||
component: "List",
|
component: "List",
|
||||||
params: {},
|
params: {},
|
||||||
include: [],
|
include: [],
|
||||||
|
currIndex: '0',
|
||||||
|
isShowDetail: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
tabs () {
|
||||||
|
const tabList = [
|
||||||
|
{label: '网格员信息', name: 'List', comp: List, permission: ''},
|
||||||
|
{label: '申报信息', name: 'ApplyList', comp: ApplyList, permission: ''}
|
||||||
|
].filter(item => {
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
|
||||||
|
return tabList
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
Add,
|
Add,
|
||||||
List,
|
List,
|
||||||
Family
|
Family,
|
||||||
|
ApplyList,
|
||||||
|
ApplyDetail,
|
||||||
|
ApplyAdd
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {},
|
mounted() {},
|
||||||
@@ -46,34 +72,46 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
onChange(data) {
|
onChange(data) {
|
||||||
if (data.type === "Add") {
|
if (data.type === "Add") {
|
||||||
this.component = "Add";
|
this.component = "Add"
|
||||||
this.params = data.params;
|
this.isShowDetail = true
|
||||||
|
this.params = data.params
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.type === "Family") {
|
if (data.type === "Family") {
|
||||||
this.component = "Family"
|
this.component = "Family"
|
||||||
|
this.isShowDetail = true
|
||||||
|
this.params = data.params
|
||||||
|
}
|
||||||
|
if (data.type === "ApplyDetail") {
|
||||||
|
this.component = "ApplyDetail"
|
||||||
|
this.isShowDetail = true
|
||||||
|
this.params = data.params
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.type === "ApplyAdd") {
|
||||||
|
this.component = "ApplyAdd"
|
||||||
|
this.isShowDetail = true
|
||||||
this.params = data.params
|
this.params = data.params
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.type === "list") {
|
if (data.type === "list") {
|
||||||
this.component = "List";
|
this.component = "List"
|
||||||
this.params = data.params;
|
this.isShowDetail = false
|
||||||
|
this.params = data.params
|
||||||
|
}
|
||||||
|
|
||||||
this.$nextTick(() => {
|
if (data.type === "ApplyList") {
|
||||||
if (data.isRefresh) {
|
this.component = "ApplyList"
|
||||||
this.$refs.component.getList();
|
this.isShowDetail = false
|
||||||
|
this.params = data.params
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.AppGridMember {
|
.AppGridMember {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: #f3f6f9;
|
}
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
107
packages/2.0.5/AppGridMember/components/ApplyAdd.vue
vendored
Normal file
107
packages/2.0.5/AppGridMember/components/ApplyAdd.vue
vendored
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
<template>
|
||||||
|
<ai-detail class="content-add">
|
||||||
|
<template slot="title">
|
||||||
|
<ai-title :title="params.id ? '编辑' : '添加'" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
|
||||||
|
</ai-title>
|
||||||
|
</template>
|
||||||
|
<template slot="content">
|
||||||
|
<ai-card title="基本信息">
|
||||||
|
<template #content>
|
||||||
|
<el-form class="ai-form" :model="form" label-width="120px" ref="form">
|
||||||
|
<el-form-item label="姓名" style="width: 100%;" prop="name" :rules="[{required: true, message: '请输入姓名', trigger: 'blur'}]">
|
||||||
|
<el-input size="small" v-model="form.name" placeholder="请输入..." :maxlength="20"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联系电话" style="width: 100%;" prop="phone" :rules="[{required: true, message: '请输入联系电话', trigger: 'blur'}]">
|
||||||
|
<el-input size="small" v-model="form.phone" placeholder="请输入..." :maxlength="11"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="网格名称" style="width: 100%;" prop="girdName" :rules="[{required: true, message: '请输入网格名称', trigger: 'blur'}]">
|
||||||
|
<el-input size="small" v-model="form.girdName" placeholder="请输入..." :maxlength="50"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
</ai-card>
|
||||||
|
</template>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="cancel">取消</el-button>
|
||||||
|
<el-button type="primary" :loading="isLoading" @click="confirm">提交</el-button>
|
||||||
|
</template>
|
||||||
|
</ai-detail>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'ApplyAdd',
|
||||||
|
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
params: Object
|
||||||
|
},
|
||||||
|
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
form: {
|
||||||
|
name: '',
|
||||||
|
phone: '',
|
||||||
|
gridName: ''
|
||||||
|
},
|
||||||
|
isLoading: false,
|
||||||
|
id: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
created () {
|
||||||
|
if (this.params && this.params.id) {
|
||||||
|
this.id = this.params.id
|
||||||
|
this.getInfo(this.params.id)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
getInfo (id) {
|
||||||
|
this.instance.post(`/app/appcontentinfo/queryDetailById?id=${id}`).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.form = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
onChange () {
|
||||||
|
this.form.files = []
|
||||||
|
},
|
||||||
|
|
||||||
|
confirm () {
|
||||||
|
this.$refs.form.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.isLoading = true
|
||||||
|
this.instance.post(`/app/appgirdmemberapply/addOrUpdate`, {
|
||||||
|
...this.form,
|
||||||
|
id: this.params.id || ''
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message.success('提交成功')
|
||||||
|
setTimeout(() => {
|
||||||
|
this.cancel(true)
|
||||||
|
}, 600)
|
||||||
|
} else {
|
||||||
|
this.isLoading = false
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.isLoading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
cancel (isRefresh) {
|
||||||
|
this.$emit('change', {
|
||||||
|
type: 'list',
|
||||||
|
isRefresh: !!isRefresh
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
</style>
|
||||||
65
packages/2.0.5/AppGridMember/components/ApplyDetail.vue
vendored
Normal file
65
packages/2.0.5/AppGridMember/components/ApplyDetail.vue
vendored
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<template>
|
||||||
|
<ai-detail>
|
||||||
|
<template slot="title">
|
||||||
|
<ai-title title="详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
|
||||||
|
</ai-title>
|
||||||
|
</template>
|
||||||
|
<template slot="content">
|
||||||
|
<ai-card title="基本信息">
|
||||||
|
<template #content>
|
||||||
|
<ai-wrapper>
|
||||||
|
<ai-info-item label="姓名" isLine :value="info.name"></ai-info-item>
|
||||||
|
<ai-info-item label="联系电话" isLine :value="info.phone"></ai-info-item>
|
||||||
|
<ai-info-item label="网格名称" isLine :value="info.girdName"></ai-info-item>
|
||||||
|
</ai-wrapper>
|
||||||
|
</template>
|
||||||
|
</ai-card>
|
||||||
|
</template>
|
||||||
|
</ai-detail>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'ApplyDetail',
|
||||||
|
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
params: Object
|
||||||
|
},
|
||||||
|
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
info: {},
|
||||||
|
id: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
created () {
|
||||||
|
if (this.params && this.params.id) {
|
||||||
|
this.id = this.params.id
|
||||||
|
this.getInfo(this.params.id)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
getInfo (id) {
|
||||||
|
this.instance.post(`/app/appgirdmemberapply/queryDetailById?id=${id}`).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.info = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
cancel (isRefresh) {
|
||||||
|
this.$emit('change', {
|
||||||
|
type: 'ApplyList',
|
||||||
|
isRefresh: !!isRefresh
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
</style>
|
||||||
179
packages/2.0.5/AppGridMember/components/ApplyList.vue
vendored
Normal file
179
packages/2.0.5/AppGridMember/components/ApplyList.vue
vendored
Normal file
@@ -0,0 +1,179 @@
|
|||||||
|
<template>
|
||||||
|
<ai-list class="list" isTabs>
|
||||||
|
<template slot="content">
|
||||||
|
<ai-search-bar bottomBorder>
|
||||||
|
<template slot="left">
|
||||||
|
<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>
|
||||||
|
<ai-import :instance="instance" :dict="dict" type="appgirdmemberapply" name="网格员申报" @success="getList()">
|
||||||
|
<el-button icon="iconfont iconImport">导入</el-button>
|
||||||
|
</ai-import>
|
||||||
|
</template>
|
||||||
|
<template slot="right">
|
||||||
|
<el-input
|
||||||
|
v-model="searchObj.name"
|
||||||
|
size="small"
|
||||||
|
placeholder="网格员/责任网格"
|
||||||
|
@keyup.enter.native="(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()">
|
||||||
|
<el-table-column label="操作" slot="options" align="center" fixed="right" width="120">
|
||||||
|
<template slot-scope="{ row }">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
|
||||||
|
<el-button type="text" @click="deleteById(row.id)">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</template>
|
||||||
|
</ai-list>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'ApplyList',
|
||||||
|
label: '网格员管理',
|
||||||
|
props: {
|
||||||
|
instance: Function,
|
||||||
|
dict: Object,
|
||||||
|
permissions: Function,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
searchObj: {
|
||||||
|
name: "",
|
||||||
|
selectionDate: "",
|
||||||
|
},
|
||||||
|
page: {
|
||||||
|
current: 1,
|
||||||
|
size: 10,
|
||||||
|
total: 0,
|
||||||
|
},
|
||||||
|
goAdd: false,
|
||||||
|
tableData: [],
|
||||||
|
fileList: [],
|
||||||
|
ids: [],
|
||||||
|
detail: {},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.dict.load("sex", "girdMemberType", "politicsStatus", "education");
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
colConfigs() {
|
||||||
|
let _ = this;
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
type: "selection",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "name",
|
||||||
|
label: "网格员姓名",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "girdName",
|
||||||
|
align: "left",
|
||||||
|
label: "责任网格",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "phone",
|
||||||
|
align: "center",
|
||||||
|
label: "联系电话",
|
||||||
|
}
|
||||||
|
];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
this.instance
|
||||||
|
.post("/app/appgirdmemberapply/list", null, {
|
||||||
|
params: {
|
||||||
|
...this.searchObj,
|
||||||
|
...this.page,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.tableData = res.data.records;
|
||||||
|
this.page.total = res.data.total;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deleteById(ids) {
|
||||||
|
ids &&
|
||||||
|
this.$confirm("是否要删除该网格员?", {
|
||||||
|
type: "error",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.instance
|
||||||
|
.post("/app/appgirdmemberapply/delete", null, {
|
||||||
|
params: { ids },
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
if (res?.code == 0) {
|
||||||
|
this.$message.success("删除成功!");
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
add (id) {
|
||||||
|
this.$emit('change', {
|
||||||
|
type: 'ApplyAdd',
|
||||||
|
params: {
|
||||||
|
id: id || ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
toDetail (id) {
|
||||||
|
this.$emit('change', {
|
||||||
|
type: 'ApplyDetail',
|
||||||
|
params: {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
handleSelectionChange(val) {
|
||||||
|
this.ids = [];
|
||||||
|
val.map((e) => {
|
||||||
|
this.ids.push(e.id);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
resetSearch() {
|
||||||
|
Object.keys(this.searchObj).map((e) => {
|
||||||
|
this.searchObj[e] = "";
|
||||||
|
});
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
</style>
|
||||||
@@ -1,8 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<ai-list class="list">
|
<ai-list class="list" isTabs>
|
||||||
<template slot="title">
|
|
||||||
<ai-title title="网格员管理" :isShowBottomBorder="true"></ai-title>
|
|
||||||
</template>
|
|
||||||
<template slot="content">
|
<template slot="content">
|
||||||
<ai-search-bar bottomBorder>
|
<ai-search-bar bottomBorder>
|
||||||
<template slot="left">
|
<template slot="left">
|
||||||
@@ -56,7 +53,7 @@
|
|||||||
<template slot-scope="{ row }">
|
<template slot-scope="{ row }">
|
||||||
<div class="table-options">
|
<div class="table-options">
|
||||||
<el-button type="text" @click="toFamily(row.id)">责任家庭</el-button>
|
<el-button type="text" @click="toFamily(row.id)">责任家庭</el-button>
|
||||||
<el-button type="text" @click="add(row.id)">查看</el-button>
|
<el-button type="text" @click="add(row.id)">详情</el-button>
|
||||||
<el-button type="text" @click="deleteById(row.id)">删除</el-button>
|
<el-button type="text" @click="deleteById(row.id)">删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -68,7 +65,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "list",
|
name: "List",
|
||||||
label: "网格员管理",
|
label: "网格员管理",
|
||||||
props: {
|
props: {
|
||||||
instance: Function,
|
instance: Function,
|
||||||
|
|||||||
Reference in New Issue
Block a user