BUG 29169

This commit is contained in:
aixianling
2022-04-20 09:25:57 +08:00
parent 8cc46723f0
commit b095835e62

View File

@@ -4,59 +4,58 @@
<template #content> <template #content>
<ai-search-bar> <ai-search-bar>
<template #left> <template #left>
<el-select v-model="search.department" placeholder="请选择所属部门" @change="page.current=1,getList()" <ai-select placeholder="请选择" v-model="search.department" action="/appfinancialorganization/nameList"
size="small" clearable> :instance="instance" :prop="{label:'organizationName',value:'organizationName'}"
<el-option @change="page.current=1,getList()"/>
v-for="(item,i) in dict.getDict('hbDepartment')" :key="i"
:label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
<el-select v-model="search.classificationId" placeholder="请选择所属分类" @change="page.current=1,getList()" <el-select v-model="search.classificationId" placeholder="请选择所属分类" @change="page.current=1,getList()"
size="small" clearable> size="small" clearable>
<el-option <el-option
v-for="(item,i) in classList" :key="i" v-for="(item,i) in classList" :key="i"
:label="item.name" :label="item.name"
:value="item.id"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</template> </template>
<template #right> <template #right>
<el-input <el-input
v-model="search.processName" v-model="search.processName"
size="small" size="small"
placeholder="事项名称/创建人" placeholder="事项名称/创建人"
@clear="search={},page.current=1,getList()" @clear="search={},page.current=1,getList()"
@keyup.enter.native="page.current=1,getList()" @keyup.enter.native="page.current=1,getList()"
clearable clearable
suffix-icon="iconfont iconSearch"/> suffix-icon="iconfont iconSearch"/>
</template> </template>
</ai-search-bar> </ai-search-bar>
<ai-search-bar> <ai-search-bar>
<template #left> <template #left>
<el-button type="primary" icon="iconfont iconAdd" @click="goPage(tab.value==0 ? 'addConfig':'guidance')">添加{{tab.value==0?'事项':'办事指南'}}</el-button> <el-button type="primary" icon="iconfont iconAdd" @click="goPage(tab.value==0 ? 'addConfig':'guidance')">
添加{{ tab.value == 0 ? '事项' : '办事指南' }}
</el-button>
</template> </template>
</ai-search-bar> </ai-search-bar>
<ai-table <ai-table
:tableData="tableData" :tableData="tableData"
:col-configs="colConfigs" :col-configs="colConfigs"
:header-cell-style="{fontWeight:'bold',color:'#333'}" :header-cell-style="{fontWeight:'bold',color:'#333'}"
:total="page.total" :total="page.total"
:current.sync="page.current" :current.sync="page.current"
:size.sync="page.size" :size.sync="page.size"
@getList="getList"> @getList="getList">
<el-table-column label="是否启用" slot="processDefStatus" align="center" width="150"> <el-table-column label="是否启用" slot="processDefStatus" align="center" width="150">
<template v-slot="{row}"> <template v-slot="{row}">
<el-switch <el-switch
v-model="row.processDefStatus" v-model="row.processDefStatus"
@change="onChange(row)" active-color="#5088FF" inactive-color="#D0D4DC" active-value="1" inactive-value="0"> @change="onChange(row)" active-color="#5088FF" inactive-color="#D0D4DC" active-value="1"
inactive-value="0">
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" slot="options" align="center" width="150"> <el-table-column label="操作" slot="options" align="center" width="150">
<template v-slot="{row}"> <template v-slot="{row}">
<div class="table-options"> <div class="table-options">
<el-button type="text" title="编辑" @click="goPage(tab.value==0 ? 'addConfig':'guidance',row)">编辑</el-button> <el-button type="text" title="编辑" @click="goPage(tab.value==0 ? 'addConfig':'guidance',row)">编辑
</el-button>
<el-button type="text" title="删除" @click="delInfo(row)">删除</el-button> <el-button type="text" title="删除" @click="delInfo(row)">删除</el-button>
</div> </div>
</template> </template>
@@ -68,145 +67,144 @@
</template> </template>
<script> <script>
import day from 'dayjs' import day from 'dayjs'
export default { export default {
name: "configList", name: "configList",
props: { props: {
instance: Function, instance: Function,
dict: Object, dict: Object,
permissions: Function, permissions: Function,
tab: Object, tab: Object,
}, },
data() { data() {
return { return {
search: { search: {
department: "", department: "",
classificationId: "", classificationId: "",
processName: "", processName: "",
},
page: {current: 1, size: 10},
total: 0,
row: {},
tableData: [],
classList: [],
}
},
computed: {
colConfigs() {
return [
{
prop: 'processName',
align: 'left',
label: '事项名称',
}, },
page: {current: 1, size: 10}, {
total: 0, prop: 'department',
row: {}, align: 'left',
tableData: [], label: '所属部门',
classList: [], render: (h, {row}) => [< span> {this.dict.getLabel('hbDepartment', row.department)} < /span>]
} },
}, {
computed: { prop: 'classificationName',
colConfigs() { align: 'center',
return [ label: '所属分类',
{ },
prop: 'processName', {
align: 'left', prop: 'timeLimit',
label: '事项名称', align: 'center',
}, label: '办结时限(日)',
{ },
prop: 'department', {
align: 'left', prop: 'createUserName',
label: '所属部门', align: 'center',
render: (h, {row}) => [ < span > {this.dict.getLabel('hbDepartment', row.department)} < /span>] label: '创建人',
}, },
{ {
prop: 'classificationName', prop: 'createTime',
align: 'center', align: 'center',
label: '所属分类', label: '最后修改时间',
}, render: (h, {row}) => [< span> {day(row.createTime
{ ).format("YYYY-MM-DD HH:mm")
prop: 'timeLimit', }<
align: 'center',
label: '办结时限(日)',
},
{
prop: 'createUserName',
align: 'center',
label: '创建人',
},
{
prop: 'createTime',
align: 'center',
label: '最后修改时间',
render: (h, {row}) => [ < span > {day(row.createTime
).
format("YYYY-MM-DD HH:mm")
}<
/span>] /span>]
}, },
{slot: 'processDefStatus', align:'center', label:'是否启用',}, {slot: 'processDefStatus', align: 'center', label: '是否启用',},
{ slot: 'options',align:'center',label:'操作',}, {slot: 'options', align: 'center', label: '操作',},
].filter(e=>this.tab.value==0 ? true : (e.prop!="timeLimit")) ].filter(e => this.tab.value == 0 ? true : (e.prop != "timeLimit"))
},
}, },
methods: { },
goPage(comp, row = {}) { methods: {
this.$emit("goPage", {comp, row}) goPage(comp, row = {}) {
}, this.$emit("goPage", {comp, row})
/** },
* 获取分类 /**
*/ * 获取分类
getClassification() { */
this.instance.post(`/app/zwspapprovalclassification/list`, null, { getClassification() {
params:{ this.instance.post(`/app/zwspapprovalclassification/list`, null, {
current: 1, params: {
status: 1, current: 1,
size: 9999 status: 1,
} size: 9999
}).then(res => { }
if (res && res.data) { }).then(res => {
this.classList = res.data.records if (res && res.data) {
} this.classList = res.data.records
}) }
}, })
/** },
* 删除 /**
* */ * 删除
delInfo({id}) { * */
this.$confirm("是否删除").then(() => { delInfo({id}) {
this.instance.post(`/app/approval-process-def/delete?id=${id}`).then(res => { this.$confirm("是否删除").then(() => {
if (res.code == 0) { this.instance.post(`/app/approval-process-def/delete?id=${id}`).then(res => {
this.$message.success("删除成功")
this.getList()
}
})
})
},
/**
* 启用,停用
*/
onChange({id, processDefStatus}) {
this.instance.post(`/app/approval-process-def/enable-disable`, null, {
params: {id}
}).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.$message.success(processDefStatus == 0 ? "不启用" : "已启用") this.$message.success("删除成功")
this.getList() this.getList()
} }
}) })
}, })
},
/**
* 启用,停用
*/
onChange({id, processDefStatus}) {
this.instance.post(`/app/approval-process-def/enable-disable`, null, {
params: {id}
}).then(res => {
if (res.code == 0) {
this.$message.success(processDefStatus == 0 ? "不启用" : "已启用")
this.getList()
}
})
},
getList() { getList() {
this.instance.post(`/app/approval-process-def/list`, null, { this.instance.post(`/app/approval-process-def/list`, null, {
params: { params: {
...this.page, ...this.page,
...this.search, ...this.search,
processType: this.tab.value processType: this.tab.value
}, },
}).then(res => { }).then(res => {
if (res?.data) { if (res?.data) {
this.tableData = res.data.records this.tableData = res.data.records
this.page.total = res.data.total; this.page.total = res.data.total;
} }
}) })
},
}, },
mounted() { },
this.getList() mounted() {
this.getClassification() this.getList()
}, this.getClassification()
} },
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.config-list { .config-list {
height: 100%; height: 100%;
} }
</style> </style>