qa-prevention-gwj-vue/src/views/xgf/flow/components/sendUtil.vue

172 lines
4.7 KiB
Vue
Raw Normal View History

2023-12-18 20:24:01 +08:00
<template>
<div>
2024-01-17 18:43:02 +08:00
<el-dialog v-loading = "loading" :visible.sync="visible" :append-to-body="appendToBody" :before-close="beforeClose" title="审批" width="1200px" destroy-on-close>
<el-form label-width="200px" label-position="right" type="flex">
<el-row :gutter="12">
<el-col :span="12">
<el-form-item prop="TERRITORIALITY" label="是否通过: ">
2024-01-18 13:56:14 +08:00
<el-select v-model="form.STATUS" style="width: 300px" placeholder="请选择">
2024-01-17 18:43:02 +08:00
<el-option label="是" value="1"/>
<el-option label="否" value="0"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="TERRITORIALITY" label="指定监管部门:">
<Treeselect
:options="departmentTree"
:normalizer="normalizer"
2024-01-18 13:56:14 +08:00
v-model="form.APPOINT_DEPARTMENT_ID"
2024-01-17 18:43:02 +08:00
placeholder="请选择部门"
no-options-text="暂无数据"
no-children-text="暂无数据"
style="width: 100%;"
2024-01-18 13:56:14 +08:00
@select="getPeopleList($event)"
2024-01-17 18:43:02 +08:00
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item prop="TERRITORIALITY" label="指定监管部门审批人:">
2024-01-18 13:56:14 +08:00
<el-select v-model="form.user" style="width: 300px" placeholder="请选择" @change="chooseUser">
<el-option v-for="item in peopleList" :key="item.USER_ID" :value="JSON.stringify(item)" :label="item.NAME"/>
2024-01-17 18:43:02 +08:00
</el-select>
</el-form-item>
</el-col>
</el-row>
2023-12-18 20:24:01 +08:00
</el-form>
2024-01-17 18:43:02 +08:00
2023-12-18 20:24:01 +08:00
<div slot="footer" class="dialog-footer">
2024-01-17 18:43:02 +08:00
<el-button @click="handleClose"> </el-button>
2023-12-19 15:01:43 +08:00
<el-button type="primary" @click="sendMessage()"> </el-button>
2023-12-18 20:24:01 +08:00
</div>
</el-dialog>
</div>
</template>
<script>
import vueQr from 'vue-qr'
import Treeselect from '@riophae/vue-treeselect'
import { requestFN } from '@/utils/request'
export default {
components: { Treeselect, vueQr },
props: {
appendToBody: {
type: Boolean,
default: false
}
},
data() {
return {
visible: false,
loading: false,
2024-01-17 18:43:02 +08:00
form: {
2024-01-18 13:56:14 +08:00
STATUS: null,
2024-01-19 20:44:32 +08:00
APPOINT_CORP_ID: '',
APPOINT_CORP_NAME: '',
2024-01-18 13:56:14 +08:00
APPOINT_DEPARTMENT_ID: null,
APPOINT_DEPARTMENT_NAME: '',
APPOINT_USER_ID: null,
APPOINT_USER_NAME: '',
user: '',
tm: new Date().getTime(),
list: []
2024-01-17 18:43:02 +08:00
},
heirloom: {},
normalizer(node) {
return {
id: node.id,
label: node.name,
children: node.nodes
}
},
departmentTree: [],
peopleList: []
2023-12-18 20:24:01 +08:00
}
},
methods: {
2024-01-17 18:43:02 +08:00
async init(e) {
2024-01-19 20:44:32 +08:00
console.log(JSON.parse(sessionStorage.getItem('user')))
2024-01-17 18:43:02 +08:00
this.loading = true
2023-12-18 20:24:01 +08:00
this.visible = true
this.heirloom = JSON.stringify(e)
2024-01-19 18:35:26 +08:00
this.form.list = JSON.stringify(e)
2024-01-17 18:43:02 +08:00
await this.getDepartmentTree()
this.loading = false
2023-12-18 20:24:01 +08:00
},
2024-01-18 13:56:14 +08:00
sendMessage() {
requestFN('/xgf/user/approve', this.form)
.then((data) => {
this.$message.success('推送成功')
this.visible = false
this.$emit('refresh', '')
})
2024-01-17 18:43:02 +08:00
},
getDepartmentTree() {
return new Promise(resolve => {
requestFN(
'/department/listTree',
{}
).then((data) => {
this.departmentTree = this.removeEmptyChildren(JSON.parse(data.zTreeNodes))
resolve(true)
}).catch((e) => {
})
})
},
2024-01-18 13:56:14 +08:00
getPeopleList(e) {
this.form.APPOINT_DEPARTMENT_NAME = e.name
2024-01-17 18:43:02 +08:00
requestFN(
'/user/listAll',
{
2024-01-18 13:56:14 +08:00
DEPARTMENT_ID: e.id
2024-01-17 18:43:02 +08:00
}
).then((data) => {
this.peopleList = data.userList
}).catch((e) => {
console.log(e)
})
},
2024-01-18 13:56:14 +08:00
chooseUser(e) {
const entity = JSON.parse(e)
this.form.APPOINT_USER_ID = entity.USER_ID
this.form.APPOINT_USER_NAME = entity.NAME
},
2024-01-17 18:43:02 +08:00
handleClose() {
this.form = {
2024-01-18 13:56:14 +08:00
STATUS: '',
APPOINT_DEPARTMENT_ID: '',
APPOINT_DEPARTMENT_NAME: '',
APPOINT_USER_ID: '',
APPOINT_USER_NAME: '',
user: '',
list: [],
tm: new Date().getTime()
2024-01-17 18:43:02 +08:00
}
this.visible = false
2024-01-18 13:56:14 +08:00
},
beforeClose() {
this.visible = false
this.form = {
STATUS: '',
APPOINT_DEPARTMENT_ID: '',
APPOINT_DEPARTMENT_NAME: '',
APPOINT_USER_ID: '',
APPOINT_USER_NAME: '',
user: '',
list: [],
tm: new Date().getTime()
}
2023-12-18 20:24:01 +08:00
}
}
}
</script>
<style lang="scss" scoped>
</style>