qa-prevention-gwj-vue/src/views/xgf/flow_audit/users.vue

317 lines
9.7 KiB
Vue

<template>
<div class="app-container">
<el-dialog
v-if="visible"
:visible.sync="visible"
:before-close="handleClose"
:append-to-body="true"
title="申请详情"
width="60%">
<div class="level-title mt-20" style="display: flex;justify-content: space-between;">
<h1>申请信息</h1>
</div>
<table class="table-ui" style="margin-bottom: 20px;">
<tr>
<th>申请人</th>
<td>{{ pd.CREATOR }}</td>
<th>申请时间</th>
<td>{{ pd.CREATTIME }}</td>
<th style="width: 17%">备注</th>
<td style="width: 15%">{{ pd.DESCR }}</td>
</tr>
<tr>
<th>安全监督部门</th>
<td>{{ pd.SUPERVISION_DEPARTMENT_NAME }}</td>
<th>审核人员</th>
<td>{{ pd.SUPERVISION_USER_NAME }}</td>
<th>审核时间</th>
<td>{{ pd.SUPERVISION_TIME }}</td>
</tr>
<tr>
<th>主管部门</th>
<td>{{ pd.MANAGER_DEPARTMENT_NAME }}</td>
<th>审核人员</th>
<td>{{ pd.MANAGER_USER_NAME }}</td>
<th>审核时间</th>
<td>{{ pd.MANAGER_TIME }}</td>
</tr>
<tr v-if="pd.TERRITORIALITY_DEPARTMENT_NAME && pd.TERRITORIALITY_DEPARTMENT_NAME !== ''">
<th>集团单位</th>
<td>{{ pd.TERRITORIALITY_DEPARTMENT_NAME }}</td>
<th>审核人员</th>
<td>{{ pd.TERRITORIALITY_USER_NAME }}</td>
<th>审核时间</th>
<td>{{ pd.TERRITORIALITY_TIME }}</td>
</tr>
<tr v-if="pd.CORP_AUDIT_DESCR">
<th>分公司意见</th>
<td colspan="5">{{ pd.CORP_AUDIT_DESCR }}</td>
</tr>
</table>
<div class="level-title">
<h1>申请人员列表</h1>
</div>
<el-table
ref="multipleTable"
:data="userList"
:header-cell-style="{'font-weight': 'bold','color': '#000'}"
tooltip-effect="dark"
border
fit
highlight-current-row>
<el-table-column type="selection" width="55" align="center"/>
<el-table-column type="index" label="序号" width="50" align="center"/>
<el-table-column prop="USERNAME" label="用户名"/>
<el-table-column prop="NAME" label="姓名"/>
<el-table-column prop="BELONG_TO_CORP_NAME" label="部门"/>
<el-table-column prop="STUDY_STATUS" label="评审状态">
<template slot-scope="{row}">
<span>{{ getType(row) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="240">
<template slot-scope="{row}">
<el-button type="primary" icon="el-icon-edit" size="mini" @click="handleShow(row)">查看</el-button>
<el-button v-if="row.STATUS === 2" type="success" icon="el-icon-edit" size="mini" @click="getUserInfo(row)">电子合格证</el-button>
<el-button v-if="row[pd.step] === 9" type="success" icon="el-icon-edit" size="mini" @click="examineShow(row)">审核</el-button>
</template>
</el-table-column>
</el-table>
<div class="page-btn-group">
<div/>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getUserList"/>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="closeWindow">关 闭</el-button>
<el-button v-if="vectory" type="primary" @click="comfirm">确定提交审批</el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogVisible" title="审核">
<el-form ref="StreetListingForm" :model="form" label-width="110px" style="width: 500px;">
<el-form-item label="审核是否通过" prop="IS_LISTING">
<el-radio-group v-model="form.IS_STATE">
<el-radio :label="1">是</el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="form.IS_STATE===0" required label="审批意见">
<el-input v-model="form.OPINION" placeholder="这里输入审批意见..."/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">关 闭</el-button>
<el-button @click="approve"> </el-button>
</span>
</el-dialog>
<user ref="userInfo" append-to-body/>
<user-info ref="userInfos" append-to-body/>
</div>
</template>
<script>
import Pagination from '@/components/Pagination' // 通过 el-pagination二次打包
import { requestFN } from '@/utils/request'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import user from './user.vue'
import UserInfo from '../flowApply/components/userInfo.vue'
export default {
components: {
UserInfo,
Pagination, user
},
data() {
return {
USER_ID: JSON.parse(sessionStorage.getItem('user')).USER_ID,
config: config,
userDetailForm: {},
imgUrl: '',
gongshangbaoxianFile: [],
photosOfLevel: [],
visible: false,
pd: {},
userList: [],
contractFile: [],
insuranceFile: [],
listQuery: {
page: 1,
limit: 20
},
TRAININ_GBATCH_ID: '',
total: 0,
viewState: '0',
dialogVisible: false,
form: {
TRAINING_BATCH_ID: this.TRAINING_BATCH_ID,
TRAIN_USERS_ID: '', // 培训批次 详情id
USER_COUNT: '', // 批次的人数
type: 2,
IS_STATE: 1,
OPINION: '',
USER_ID: ''
},
heirloom: {},
specialUsersList: {},
message: '',
operator: '',
vectory: false
}
},
methods: {
init(id, viewState, vectory) {
this.vectory = vectory
console.log(this.vectory)
this.form.TRAINING_BATCH_ID = this.TRAINING_BATCH_ID
this.form.TRAIN_USERS_ID = ''
this.form.USER_COUNT = ''
this.form.type = '2'
this.form.IS_STATE = 1
this.form.OPINION = ''
this.viewState = viewState
if (id) {
this.TRAINING_BATCH_ID = id
this.getDataById(id)
this.getUserList(id)
}
this.visible = true
this.userList = []
},
getDataById(id) {
requestFN(
'/flowTrain/getDetailsById',
{
TRAINING_BATCH_ID: id
}
).then((data) => {
this.pd = data.pd
}).catch((e) => {
})
},
getUserInfo(row) {
this.$refs.userInfo.init(row)
},
// 查看
handleShow(row) {
this.$refs.userInfos.init(row)
},
examineShow(row) {
this.form.TRAIN_USERS_ID = row.TRAIN_USERS_ID
this.dialogVisible = true
},
// 提交审批意见
approve() {
this.form.TRAINING_BATCH_ID = this.TRAININ_GBATCH_ID
if (!(this.form.IS_STATE === 1 || this.form.IS_STATE === 0)) {
this.$message.error('请先择')
return
}
if (this.form.IS_STATE === 0) {
if (!this.form.OPINION) {
this.$message.error('这里输入审批意见')
return
}
}
requestFN(
'/flowTrain/approveUser', { ...this.form }
).then((data) => {
if (data.result === 'success') {
this.$message.success('审批成功')
this.init(this.TRAINING_BATCH_ID, this.viewState, this.vectory)
} else if (data.result === 'exception') {
this.$message({
message: data.msg,
type: 'success'
})
}
this.getUserList(this.TRAINING_BATCH_ID)
this.getDataById(this.TRAINING_BATCH_ID)
this.dialogVisible = false
}).catch((e) => {
})
},
getUserInfoById(id) {
return new Promise((resolve, reject) => {
requestFN(
'/flowTrain/getUserDetailById',
{
USER_ID: id,
CER_TYPE: '7498057c4c1f4a11b9a960e66ea04a7a'
}
).then((data) => {
this.userDetailForm = Object.assign(this.userDetailForm, data.userDetail)
this.listLoading = false
this.userPhotoFile = data.userPhotoFile
if (this.userPhotoFile.length > 0) {
this.imgUrl = config.fileUrl + this.userPhotoFile[0].FILEPATH
}
this.photosOfLevel = data.photosOfLevel
this.userCardIDPhotoFile = data.userCardIDPhotoFile
this.socialPhotoFile = data.socialPhotoFile
this.specialUsersList = data.specialUsers
resolve()
}).catch((e) => {
reject()
})
})
},
// 人员
getUserList(id) {
requestFN(
'/flowTrain/batchUserList?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
{
TRAINING_BATCH_ID: id
}
).then((data) => {
this.userList = data.varList
this.total = data.page.totalResult
}).catch((e) => {
})
},
handleClose() {
this.visible = false
this.$emit('getResult', '')
},
closeWindow() {
this.handleClose()
},
getType(row) {
console.log(row)
if (row.RESULT_STATUS === '1') {
return '审批中'
}
if (row.RESULT_STATUS === '2') {
return '审批通过'
}
if (row.RESULT_STATUS === '3') {
return '审批不通过'
}
},
comfirm() {
this.$confirm('确定提交审批吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestFN(
'/flowTrain/endApproval',
{
TRAINING_BATCH_ID: this.TRAINING_BATCH_ID
}
).then((data) => {
this.visible = false
this.handleClose()
}).catch((e) => {
console.log(e)
})
}).catch(() => {
})
}
}
}
</script>