审批负责人

This commit is contained in:
yanran200730
2022-03-25 18:26:57 +08:00
parent c5c1645054
commit 8650c0dd09
3 changed files with 328 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
<template>
<div class="doc-circulation ailist-wrapper">
<keep-alive :include="['List']">
<component ref="component" :is="component" @change="onChange" :params="params" :instance="instance" :dict="dict"></component>
</keep-alive>
</div>
</template>
<script>
import List from './components/List'
import Add from './components/Add'
export default {
name: 'AppApprover',
label: '审批负责人',
props: {
instance: Function,
dict: Object
},
data () {
return {
component: 'List',
params: {},
include: []
}
},
components: {
List,
Add
},
mounted () {
},
methods: {
onChange (data) {
if (data.type === 'Add') {
this.component = 'Add'
this.params = data.params
}
if (data.type === 'List') {
this.component = 'List'
this.params = data.params
this.$nextTick(() => {
if (data.isRefresh) {
this.$refs.component.getList()
}
})
}
}
}
}
</script>
<style lang="scss">
.doc-circulation {
height: 100%;
background: #F3F6F9;
overflow: auto;
}
</style>

View File

@@ -0,0 +1,125 @@
<template>
<ai-detail>
<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 ref="form" class="ai-form" :model="form" label-width="110px" label-position="right">
<el-form-item label="角色说明" style="width: 100%;" prop="">
<p style="color: red">网格员上报疑似风险/建议解除风险对象信息后需管理员确认纳入监测对象或解除风险</p>
</el-form-item>
<el-form-item label="姓名" prop="name" :rules="[{ required: true, message: '请选择人员', trigger: 'blur' }]">
<el-input disabled :value="form.name" size="small" placeholder="请选择人员">
<template slot="append">
<ai-wechat-selecter refs="addTags" :instance="instance" v-model="users" @change="onChooseUser">
<el-button size="small">选择人员</el-button>
</ai-wechat-selecter>
</template>
</el-input>
</el-form-item>
<el-form-item style="width: 100%!important;" label="所在地区" prop="areaId" :rules="[{ required: true, message: '请选择所在地区', trigger: 'change' }]">
<ai-area-select
v-model="form.areaId"
always-show
:instance="instance"
clearable
@fullname="v=>form.areaName = v"
:disabledLevel="disabledLevel"/>
</el-form-item>
</el-form>
</template>
</ai-card>
</template>
<template #footer>
<el-button @click="cancel">取消</el-button>
<el-button type="primary" @click="confirm">提交</el-button>
</template>
</ai-detail>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'Add',
props: {
instance: Function,
dict: Object,
params: Object
},
data () {
return {
info: {},
users: [],
form: {
name: '',
areaName: '',
areaId: ''
},
id: '',
disabledLevel: 3
}
},
computed: {
...mapState(['user'])
},
created () {
this.form.areaName = this.user.info.areaName
this.form.areaId = this.user.info.areaId
this.disabledLevel = this.user.info.areaList.length
if (this.params && this.params.id) {
this.id = this.params.id
this.getInfo(this.params.id)
}
},
methods: {
getInfo (id) {
this.instance.post(`/app/apppreventionreturntopovertyriskperson/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.form = {
...res.data
}
}
})
},
onChooseUser (v) {
},
confirm () {
this.$refs.form.validate((valid) => {
if (valid) {
this.instance.post(`/app/apppreventionreturntopovertyriskperson/addOrUpdate`, {
...this.form
}).then(res => {
if (res.code == 0) {
this.$message.success('提交成功')
setTimeout(() => {
this.cancel(true)
}, 600)
}
})
}
})
},
cancel (isRefresh) {
this.$emit('change', {
type: 'List',
isRefresh: !!isRefresh
})
}
}
}
</script>
<style scoped lang="scss">
</style>

View File

@@ -0,0 +1,137 @@
<template>
<ai-list class="notice">
<template slot="title">
<ai-title title="审批负责人" isShowBottomBorder></ai-title>
</template>
<template slot="content">
<ai-search-bar>
<template #left>
<el-button icon="iconfont iconAdd" type="primary" size="small" @click="toAdd('')">添加 </el-button>
</template>
<template #right>
<el-input
v-model="search.name"
size="small"
placeholder="审批负责人"
clearable
v-throttle="() => {search.current = 1, getList()}"
@clear="search.current = 1, search.name = '', getList()"
suffix-icon="iconfont iconSearch">
</el-input>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
style="margin-top: 12px;"
:current.sync="search.current"
:size.sync="search.size"
@selection-change="(v) => (ids = v.map((e) => e.id))"
@getList="getList">
<el-table-column slot="options" width="90px" fixed="right" label="操作" align="center">
<div class="table-options" slot-scope="{ row }">
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
</div>
</el-table-column>
</ai-table>
</template>
</ai-list>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'List',
props: {
instance: Function,
dict: Object
},
data() {
return {
search: {
current: 1,
size: 10,
title: ''
},
ids: [],
total: 10,
tableData: []
}
},
computed: {
...mapState(['user']),
colConfigs () {
return [
{ prop: 'title', label: '审批负责人', align: 'left' },
{ prop: 'createUserName', label: '所属地区', align: 'center' },
{ prop: 'createTime', label: '操作时间', align: 'center' },
{ prop: 'createTime', label: '操作人', align: 'center' },
{ slot: 'options', label: '操作' }
]
}
},
created () {
this.dict.load('epidemicRecentTestResult').then(() => {
this.getList()
})
},
methods: {
getList() {
this.instance.post(`/app/appmininotice/list`, null, {
params: {
...this.search
}
}).then(res => {
if (res.code == 0) {
this.tableData = res.data.records
this.total = res.data.total
}
})
},
removeAll () {
var id = this.ids.join(',')
this.remove(id)
},
remove(id) {
this.$confirm('确定删除该数据?').then(() => {
this.instance.post(`/app/appmininotice/delete?ids=${id}`).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getList()
}
})
})
},
toDetail (id) {
this.$emit('change', {
type: 'Detail',
params: {
id: id || ''
}
})
},
toAdd(id) {
this.$emit('change', {
type: 'Add',
params: {
id: id || ''
}
})
}
}
}
</script>
<style lang="scss" scoped>
</style>