审批管理
This commit is contained in:
@@ -22,7 +22,8 @@
|
||||
<el-table-column slot="options" width="120px" fixed="right" label="操作" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<div class="table-options">
|
||||
<el-button type="text" @click="toDetail(row.id)">查看</el-button>
|
||||
<el-button type="text" @click="edit(row)">编辑</el-button>
|
||||
<el-button type="text" @click="remove(row.id)">删除</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -38,7 +39,7 @@
|
||||
<el-form-item label="分组名称" style="width: 100%" prop="name" :rules="[{required: true, message: '请输入分组名称', trigger: 'blur'}]">
|
||||
<el-input v-model="form.name" size="small" placeholder="请输入分组名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="评分人员" style="width: 100%" prop="examineUserNames" :rules="[{required: true, message: '请选择评分人员', trigger: 'change'}]">
|
||||
<el-form-item label="填报人员" style="width: 100%" prop="examineUserNames" :rules="[{required: true, message: '请选择填报人员', trigger: 'change'}]">
|
||||
<ai-user-selecter :instance="instance" v-model="form.examineUserIds" @change="e => onUserChange(e, 'examineUserNames')">
|
||||
<div class="AppAnnounceDetail-select">
|
||||
<el-input class="AppAnnounceDetail-select__input" size="small" placeholder="请选择..." v-model="form.examineUserNames"></el-input>
|
||||
@@ -90,9 +91,11 @@
|
||||
examineUserNames: '',
|
||||
fillingUserNames: ''
|
||||
},
|
||||
id: '',
|
||||
colConfigs: [
|
||||
{ prop: 'title', label: '模板名称' },
|
||||
{ prop: 'updateTime', align: 'center', label: '更新时间' }
|
||||
{ prop: 'name', label: '审批分组' },
|
||||
{ prop: 'examineUserNames', align: 'center', label: '填报人员' },
|
||||
{ prop: 'fillingUserNames', align: 'center', label: '审批人员' }
|
||||
],
|
||||
isShow: false,
|
||||
tableData: [],
|
||||
@@ -128,6 +131,38 @@
|
||||
})
|
||||
},
|
||||
|
||||
edit (e) {
|
||||
this.id = e.id
|
||||
this.form.name = e.name
|
||||
this.form.examineUserIds = e.examineUserIds.split(',').map((v, index) => {
|
||||
return {
|
||||
id: v,
|
||||
name: e.examineUserNames.split(',')[index]
|
||||
}
|
||||
})
|
||||
this.form.fillingUserIds = e.fillingUserIds.split(',').map((v, index) => {
|
||||
return {
|
||||
id: v,
|
||||
name: e.fillingUserNames.split(',')[index]
|
||||
}
|
||||
})
|
||||
|
||||
this.form.examineUserNames = 1
|
||||
this.form.fillingUserNames = 1
|
||||
this.isShow = true
|
||||
},
|
||||
|
||||
remove (id) {
|
||||
this.$confirm('确定删除该数据?').then(() => {
|
||||
this.instance.post(`/app/appassessmentscorev2examinegroup/delete?ids=${id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('删除成功!')
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
onUserChange(e, type) {
|
||||
if (e.length) {
|
||||
this.form[type] = '1'
|
||||
@@ -137,6 +172,7 @@
|
||||
},
|
||||
|
||||
onClose () {
|
||||
this.id = ''
|
||||
this.form.name = ''
|
||||
this.form.fillingUserIds = []
|
||||
this.form.examineUserIds = []
|
||||
@@ -149,8 +185,11 @@
|
||||
if (valid) {
|
||||
this.instance.post(`/app/appassessmentscorev2examinegroup/addOrUpdate`, {
|
||||
...this.form,
|
||||
fillingUserIds: this.form.fillingUserIds.map(v => v.id),
|
||||
examineUserIds: this.form.examineUserIds.map(v => v.id)
|
||||
id: this.id || '',
|
||||
fillingUserIds: this.form.fillingUserIds.map(v => v.id).join(','),
|
||||
examineUserIds: this.form.examineUserIds.map(v => v.id).join(','),
|
||||
fillingUserNames: this.form.fillingUserIds.map(v => v.name).join(','),
|
||||
examineUserNames: this.form.examineUserIds.map(v => v.name).join(',')
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('提交成功!')
|
||||
@@ -161,15 +200,6 @@
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
toAdd (id) {
|
||||
this.$emit('change', {
|
||||
type: 'Add',
|
||||
params: {
|
||||
id: id || ''
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user