若干bug修改

pull/7/head
liujun 2024-01-22 16:38:42 +08:00
parent e6d21ace08
commit cdbeacee28
3 changed files with 210 additions and 39 deletions

View File

@ -0,0 +1,189 @@
<template>
<div>
<el-dialog v-loading = "loading" :visible.sync="visible" :append-to-body="appendToBody" :before-close="beforeClose" title="审批" width="1200px" destroy-on-close>
<el-form ref="form" :model="form" :rules="rules" label-width="200px" label-position="right" type="flex">
<el-row :gutter="12">
<el-col :span="12">
<el-form-item prop="APPOINT_DEPARTMENT_ID" label="指定监管部门:">
<Treeselect
:options="departmentTree"
:normalizer="normalizer"
v-model="form.APPOINT_DEPARTMENT_ID"
placeholder="请选择部门"
no-options-text="暂无数据"
no-children-text="暂无数据"
style="width: 100%;"
@select="getPeopleList($event)"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="APPOINT_USER_ID" label="指定监管部门审批人:">
<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"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="handleClose"> </el-button>
<el-button type="primary" @click="sendMessage('1')"> </el-button>
</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,
form: {
STATUS: null,
APPOINT_CORP_ID: '',
APPOINT_CORP_NAME: '',
APPOINT_DEPARTMENT_ID: null,
APPOINT_DEPARTMENT_NAME: '',
APPOINT_USER_ID: null,
APPOINT_USER_NAME: '',
OPINION: '',
user: '',
tm: new Date().getTime(),
list: [],
isShow: true,
info: {}
},
rules: {
STATUS: [
{ required: true, message: '请选择是否通过', trigger: 'change' }
],
APPOINT_DEPARTMENT_ID: [
{ required: true, message: '请选择指定监管部门', trigger: 'change' }
],
APPOINT_USER_ID: [
{ required: true, message: '请选择指定监管部门审批人', trigger: 'change' }
],
OPINION: [
{ required: true, message: '请填写打回原因', trigger: 'change' }
]
},
heirloom: {},
normalizer(node) {
return {
id: node.id,
label: node.name,
children: node.nodes
}
},
departmentTree: [],
peopleList: []
}
},
methods: {
async init(e) {
console.log(e)
this.loading = true
this.visible = true
this.heirloom = JSON.stringify(e)
this.form.list = JSON.stringify(e)
this.getDepartmentTree()
this.loading = false
},
sendMessage(e) {
this.$refs.form.validate((valid) => {
if (!valid) {
this.$message.error('请填写完整信息')
} else {
requestFN('/xgf/user/approve', this.form)
.then((data) => {
this.$message.success('推送成功')
this.visible = false
this.$emit('refresh', '')
})
.catch((e) => {
console.log(e)
})
}
})
},
getDepartmentTree() {
return new Promise(resolve => {
requestFN(
'/corpDepartment/listTreeManageAndCorpHasOrder',
{}
).then((data) => {
const treeData = this.listTransTree(JSON.parse(data.zTreeNodes), 'id', 'pId', 'nodes')
this.departmentTree = this.removeEmptyChildren(treeData)
resolve(true)
}).catch((e) => {
console.log(e)
})
})
},
getPeopleList(e) {
this.form.APPOINT_DEPARTMENT_NAME = e.name
requestFN(
'/user/listAllCorp',
{
DEPARTMENT_ID: e.id
}
).then((data) => {
this.peopleList = data.userList
}).catch((e) => {
console.log(e)
})
},
chooseUser(e) {
const entity = JSON.parse(e)
this.form.APPOINT_USER_ID = entity.USER_ID
this.form.APPOINT_USER_NAME = entity.NAME
},
handleClose() {
this.form = {
STATUS: '',
APPOINT_DEPARTMENT_ID: null,
APPOINT_DEPARTMENT_NAME: '',
APPOINT_USER_ID: '',
APPOINT_USER_NAME: '',
user: '',
list: [],
tm: new Date().getTime()
}
this.visible = false
},
beforeClose() {
this.visible = false
this.form = {
STATUS: '',
APPOINT_DEPARTMENT_ID: null,
APPOINT_DEPARTMENT_NAME: '',
APPOINT_USER_ID: '',
APPOINT_USER_NAME: '',
user: '',
list: [],
tm: new Date().getTime()
}
}
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -39,10 +39,11 @@
<el-table-column prop="USERNAME" label="用户名" align="center"/>
<el-table-column prop="NAME" label="姓名" align="center"/>
<el-table-column prop="BELONG_TO_CORP_NAME" label="外派公司名称" align="center"/>
<el-table-column label="操作" align="center" width="250">
<el-table-column label="操作" align="center" width="350">
<template slot-scope="{row}">
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleShow(row)"></el-button>
<el-button v-if="row.power_flag === '1'" type="primary" icon="el-icon-s-claim" size="mini" @click="approve([row])"></el-button>
<el-button v-if="row.power_flag === '1'" type="primary" icon="el-icon-s-claim" size="mini" @click="entrust([row])"></el-button>
<el-button v-if="false" type="success" icon="el-icon-edit" size="mini" @click="getUserInfo(row)"></el-button>
</template>
</el-table-column>
@ -56,6 +57,7 @@
<user ref="userInfo" append-to-body/>
<user-info ref="userInfos" append-to-body/>
<send-util ref="sendUtil" append-to-body @refresh="getList"/>
<entrust ref="entrust" append-to-body @refresh="getList"/>
</div>
</template>
@ -68,9 +70,10 @@ import apply from './apply'
import user from './user.vue'
import SendUtil from './sendUtil.vue'
import UserInfo from '../../flow_audit/userInfo.vue'
import Entrust from './entrust.vue'
export default {
components: { UserInfo, SendUtil, Pagination, apply, vueQr, user },
components: { Entrust, UserInfo, SendUtil, Pagination, apply, vueQr, user },
directives: { waves },
data() {
return {
@ -165,6 +168,9 @@ export default {
approve(row) {
this.$refs.sendUtil.init(row)
},
entrust(row) {
this.$refs.entrust.init(row)
},
getUserInfo(row) {
this.$refs.userInfo.init(row)
},

View File

@ -12,7 +12,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item v-if="form.STATUS === '1' && isShow" prop="APPOINT_DEPARTMENT_ID" label="指定监管部门:">
<el-form-item v-if="form.STATUS === '1' " prop="APPOINT_DEPARTMENT_ID" label="指定监管部门:">
<Treeselect
:options="departmentTree"
:normalizer="normalizer"
@ -32,7 +32,7 @@
<el-input v-model="form.OPINION" :rows="2" type="textarea" placeholder="填写审批意见"/>
</el-form-item>
</el-col>
<el-col v-if="form.STATUS === '1' && isShow" :span="12">
<el-col v-if="form.STATUS === '1' " :span="12">
<el-form-item v-if="form.STATUS === '1'" prop="APPOINT_USER_ID" label="指定监管部门审批人:">
<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"/>
@ -117,18 +117,7 @@ export default {
this.visible = true
this.heirloom = JSON.stringify(e)
this.form.list = JSON.stringify(e)
this.info = e[0]
if (this.info.FLOWS_TYPE === '0') {
if (this.info.FLOWS_STEP === 0) {
this.isShow = true
await this.getDepartmentTree()
} else {
this.isShow = false
}
} else {
this.isShow = true
await this.getCorpDepartmentTree()
}
this.getDepartmentTree()
this.loading = false
},
sendMessage(e) {
@ -174,29 +163,16 @@ export default {
},
getPeopleList(e) {
this.form.APPOINT_DEPARTMENT_NAME = e.name
if (this.info.FLOWS_TYPE === '0') {
requestFN(
'/user/listAll',
{
DEPARTMENT_ID: e.id
}
).then((data) => {
this.peopleList = data.userList
}).catch((e) => {
console.log(e)
})
} else {
requestFN(
'/user/listAllManageAndCorp',
{
DEPARTMENT_ID: e.id
}
).then((data) => {
this.peopleList = data.userList
}).catch((e) => {
console.log(e)
})
}
requestFN(
'/user/listAll',
{
DEPARTMENT_ID: e.id
}
).then((data) => {
this.peopleList = data.userList
}).catch((e) => {
console.log(e)
})
},
chooseUser(e) {
const entity = JSON.parse(e)