审批管理
This commit is contained in:
62
project/hlj/app/AppFormAudit/AppFormAudit.vue
Normal file
62
project/hlj/app/AppFormAudit/AppFormAudit.vue
Normal file
@@ -0,0 +1,62 @@
|
||||
<template>
|
||||
<div class="doc-circulation">
|
||||
<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'
|
||||
|
||||
export default {
|
||||
name: 'AppFormAudit',
|
||||
label: '审批管理',
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
component: 'List',
|
||||
params: {},
|
||||
include: []
|
||||
}
|
||||
},
|
||||
|
||||
components: {
|
||||
List
|
||||
},
|
||||
|
||||
mounted () {
|
||||
if (this.$route.query.isAdd === '1') {
|
||||
this.component = 'Add'
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
onChange (data) {
|
||||
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>
|
||||
261
project/hlj/app/AppFormAudit/components/List.vue
Normal file
261
project/hlj/app/AppFormAudit/components/List.vue
Normal file
@@ -0,0 +1,261 @@
|
||||
<template>
|
||||
<ai-list class="list">
|
||||
<ai-title slot="title" title="审批管理" isShowBottomBorder :instance="instance"></ai-title>
|
||||
<template slot="content">
|
||||
<div class="content">
|
||||
<ai-search-bar bottomBorder>
|
||||
<template #left>
|
||||
<el-button type="primary" size="small" @click="(isShow = true)">新建审批分组</el-button>
|
||||
</template>
|
||||
<template #right>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="total"
|
||||
v-loading="loading"
|
||||
style="margin-top: 16px;"
|
||||
:current.sync="search.current"
|
||||
:size.sync="search.size"
|
||||
@getList="getList">
|
||||
<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>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
</div>
|
||||
<ai-dialog
|
||||
:visible.sync="isShow"
|
||||
width="790px"
|
||||
title="添加审批分组"
|
||||
@close="onClose"
|
||||
@onConfirm="onConfirm">
|
||||
<el-form ref="form" class="ai-form" :model="form" label-width="110px" label-position="right">
|
||||
<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'}]">
|
||||
<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>
|
||||
<div class="select-left" v-if="form.examineUserIds.length">
|
||||
<span v-for="(item, index) in form.examineUserIds" :key="index">{{ item.name }}</span>
|
||||
</div>
|
||||
<i v-if="!form.examineUserIds.length">请选择</i>
|
||||
<div class="select-right">{{ form.examineUserIds.length ? '重新选择' : '选择' }}</div>
|
||||
</div>
|
||||
</ai-user-selecter>
|
||||
</el-form-item>
|
||||
<el-form-item label="审批人员" style="width: 100%" prop="fillingUserNames" :rules="[{required: true, message: '请选择审批人员', trigger: 'change'}]">
|
||||
<ai-user-selecter :instance="instance" v-model="form.fillingUserIds" @change="e => onUserChange(e, 'fillingUserNames')">
|
||||
<div class="AppAnnounceDetail-select">
|
||||
<el-input class="AppAnnounceDetail-select__input" size="small" placeholder="请选择..." v-model="form.fillingUserNames"></el-input>
|
||||
<div class="select-left" v-if="form.fillingUserIds.length">
|
||||
<span v-for="(item, index) in form.fillingUserIds" :key="index">{{ item.name }}</span>
|
||||
</div>
|
||||
<i v-if="!form.fillingUserIds.length">请选择</i>
|
||||
<div class="select-right">{{ form.fillingUserIds.length ? '重新选择' : '选择' }}</div>
|
||||
</div>
|
||||
</ai-user-selecter>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ai-dialog>
|
||||
</template>
|
||||
</ai-list>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'List',
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
search: {
|
||||
current: 1,
|
||||
size: 10
|
||||
},
|
||||
form: {
|
||||
name: '',
|
||||
examineUserIds: [],
|
||||
fillingUserIds: [],
|
||||
examineUserNames: '',
|
||||
fillingUserNames: ''
|
||||
},
|
||||
colConfigs: [
|
||||
{ prop: 'title', label: '模板名称' },
|
||||
{ prop: 'updateTime', align: 'center', label: '更新时间' }
|
||||
],
|
||||
isShow: false,
|
||||
tableData: [],
|
||||
total: 0,
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
|
||||
created () {
|
||||
this.loading = true
|
||||
|
||||
this.dict.load(['EP_riskLevel']).then(() => {
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList () {
|
||||
this.instance.post(`/app/appassessmentscorev2examinegroup/list`, null, {
|
||||
params: {
|
||||
...this.search
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.tableData = res.data.records
|
||||
this.total = res.data.total
|
||||
this.loading = false
|
||||
} else {
|
||||
this.loading = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
|
||||
onUserChange(e, type) {
|
||||
if (e.length) {
|
||||
this.form[type] = '1'
|
||||
} else {
|
||||
this.form[type] = ''
|
||||
}
|
||||
},
|
||||
|
||||
onClose () {
|
||||
this.form.name = ''
|
||||
this.form.fillingUserIds = []
|
||||
this.form.examineUserIds = []
|
||||
this.form.examineUserNames = ''
|
||||
this.form.fillingUserNames = ''
|
||||
},
|
||||
|
||||
onConfirm () {
|
||||
this.$refs.form.validate((valid) => {
|
||||
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)
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('提交成功!')
|
||||
this.isShow = false
|
||||
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
toAdd (id) {
|
||||
this.$emit('change', {
|
||||
type: 'Add',
|
||||
params: {
|
||||
id: id || ''
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
.AppAnnounceDetail-select {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: 32px;
|
||||
line-height: 1;
|
||||
background: #F5F5F5;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #D0D4DC;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
||||
|
||||
&:hover {
|
||||
border-color: #26f;
|
||||
}
|
||||
|
||||
& > i {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
line-height: 32px;
|
||||
padding: 0 12px;
|
||||
color: #888888;
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
border-right: 1px solid #D0D4DC;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.AppAnnounceDetail-select__input {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: -1;
|
||||
opacity: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.select-right {
|
||||
height: 100%;
|
||||
padding: 0 12px;
|
||||
color: #222222;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
transition: all ease 0.3s;
|
||||
|
||||
&:hover {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
.select-left {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
flex: 1;
|
||||
padding: 5px 0 0px 12px;
|
||||
border-right: 1px solid #D0D4DC;
|
||||
border-radius: 4px 0 0 4px;
|
||||
background: #fff;
|
||||
|
||||
em {
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
margin: 0 4px 5px 0;
|
||||
color: #222222;
|
||||
font-size: 12px;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
span {
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
margin: 0 4px 5px 0;
|
||||
padding: 0 8px;
|
||||
font-size: 12px;
|
||||
color: #222222;
|
||||
background: #F3F4F7;
|
||||
border-radius: 2px;
|
||||
border: 1px solid #D0D4DC;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -57,18 +57,18 @@
|
||||
</ai-select>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务名称" style="width: 100%" prop="templateName" :rules="[{required: true, message: '请输入表单名称', trigger: 'blur'}]">
|
||||
<el-input v-model="form.templateName" size="small" placeholder="请输入表单名称"></el-input>
|
||||
<el-form-item label="任务名称" style="width: 100%" prop="title" :rules="[{required: true, message: '请输入表单名称', trigger: 'blur'}]">
|
||||
<el-input v-model="form.title" size="small" placeholder="请输入表单名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="谁参与评分" style="width: 100%" prop="evaluatorsNames" :rules="[{required: true, message: '请选择参评人员', trigger: 'change'}]">
|
||||
<ai-user-selecter :instance="instance" v-model="form.evaluatorsList" @change="e => onUserChange(e, 'evaluatorsNames')">
|
||||
<ai-user-selecter :instance="instance" v-model="form.evaluators" @change="e => onUserChange(e, 'evaluatorsNames')">
|
||||
<div class="AppAnnounceDetail-select">
|
||||
<el-input class="AppAnnounceDetail-select__input" size="small" placeholder="请选择..." v-model="form.evaluatorsNames"></el-input>
|
||||
<div class="select-left" v-if="form.evaluatorsList.length">
|
||||
<span v-for="(item, index) in form.evaluatorsList" :key="index">{{ item.name }}</span>
|
||||
<div class="select-left" v-if="form.evaluators.length">
|
||||
<span v-for="(item, index) in form.evaluators" :key="index">{{ item.name }}</span>
|
||||
</div>
|
||||
<i v-if="!form.evaluatorsList.length">请选择</i>
|
||||
<div class="select-right">{{ form.evaluatorsList.length ? '重新选择' : '选择' }}</div>
|
||||
<i v-if="!form.evaluators.length">请选择</i>
|
||||
<div class="select-right">{{ form.evaluators.length ? '重新选择' : '选择' }}</div>
|
||||
</div>
|
||||
</ai-user-selecter>
|
||||
</el-form-item>
|
||||
@@ -108,10 +108,11 @@
|
||||
form: {
|
||||
date: '',
|
||||
templateId: '',
|
||||
templateName: '',
|
||||
evaluatorsList: [],
|
||||
title: '',
|
||||
evaluators: [],
|
||||
scorerList: [],
|
||||
evaluatorsNames: '',
|
||||
uploadWedrive: '0',
|
||||
scorerNames: ''
|
||||
},
|
||||
colConfigs: [
|
||||
@@ -162,6 +163,11 @@
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
this.instance.post(`/app/appassessmentscorev2task/queryWedriveDirectory`).then(res => {
|
||||
if (res.code == 0) {
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
onUserChange(e, type) {
|
||||
@@ -177,9 +183,27 @@
|
||||
this.form.templateId = ''
|
||||
this.form.templateName = ''
|
||||
this.form.evaluatorsList = []
|
||||
this.form.scorerList = []
|
||||
this.form.evaluatorsNames = ''
|
||||
this.form.scorerNames = ''
|
||||
},
|
||||
|
||||
onConfirm () {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.instance.post(`/app/appassessmentscorev2task/addOrUpdate`, {
|
||||
...this.form,
|
||||
beginTime: this.form.date[0],
|
||||
endTime: this.form.date[1],
|
||||
date: ''
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('提交成功!')
|
||||
this.isShow = false
|
||||
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getList () {
|
||||
@@ -213,20 +237,6 @@
|
||||
})
|
||||
},
|
||||
|
||||
onConfirm () {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.instance.post(`/app/appassessmentscortask/addOrUpdate?title=${this.form.title}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('提交成功!')
|
||||
this.getList()
|
||||
this.isShow = false
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
remove(id) {
|
||||
this.$confirm('确定删除该数据?').then(() => {
|
||||
this.instance.post(`/app/appassessmentscortask/delete?id=${id}`).then(res => {
|
||||
|
||||
Reference in New Issue
Block a user