[update 查看详情] 权限申请流程
This commit is contained in:
+126
-26
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<internal-detail-page :title="pageTitle" :content-padding="0" :loading="loading">
|
||||
<!-- 标题右侧tab -->
|
||||
<template v-slot:titleRightCustom>
|
||||
<template v-slot:titleRightCustom v-if="!disabledAll">
|
||||
<div class="table-operator-tab">
|
||||
<!-- 基础信息 -->
|
||||
<a class="switch-item" :class="switchValue === 'base' ? 'table-operator-tab-active' : ''"
|
||||
@@ -25,7 +25,7 @@
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('processName')">
|
||||
<a-input :placeholder="$t('pleaseEnter') + $t('processName')"
|
||||
:maxLength="50"
|
||||
:disabled="disabled || processDisabled"
|
||||
:disabled="disabled || processDisabled || disabledAll"
|
||||
v-decorator="['prcName', validatorRules.processName]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -34,7 +34,7 @@
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('expirationDate')">
|
||||
<a-date-picker :placeholder="$t('pleaseSelect') + $t('expirationDate')"
|
||||
style="width: 100%"
|
||||
:disabled="disabled || processDisabled"
|
||||
:disabled="disabled || processDisabled || disabledAll"
|
||||
value-format="YYYY-MM-DD hh:mm:ss"
|
||||
v-decorator="['dueTime']" />
|
||||
</a-form-item>
|
||||
@@ -45,7 +45,7 @@
|
||||
<a-textarea :placeholder="$t('pleaseEnter') + $t('processExplain')"
|
||||
:maxLength="500"
|
||||
:rows="4"
|
||||
:disabled="disabled || processDisabled"
|
||||
:disabled="disabled || processDisabled || disabledAll"
|
||||
v-decorator="['prcMes']" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -56,7 +56,7 @@
|
||||
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
|
||||
|
||||
<!-- 标准表格 -->
|
||||
<base-info-table v-if="isInitiate" ref="baseInfoTable" :info="info" style="margin-bottom: 40px;"></base-info-table>
|
||||
<base-info-table v-if="isInitiate" ref="baseInfoTable" :info="info" style="margin-bottom: 40px;" :disabled-all="disabledAll"></base-info-table>
|
||||
<!-- 表单 -->
|
||||
<a-form :form="baseInfoForm">
|
||||
<a-row>
|
||||
@@ -66,7 +66,7 @@
|
||||
<a-form-item :labelCol="labelColBaseInfo" :wrapperCol="wrapperColBaseInfo" :label="$t('workCenter.permissionApplicationProcess.applicant')">
|
||||
<a-input :placeholder="$t('pleaseEnter') + $t('workCenter.permissionApplicationProcess.applicant')"
|
||||
:maxLength="50"
|
||||
:disabled="disabled"
|
||||
:disabled="disabled || disabledAll"
|
||||
v-decorator="['userDictText', validatorRules.applicant]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -74,7 +74,7 @@
|
||||
<a-col :span="24">
|
||||
<!-- 申请权限 -->
|
||||
<a-form-item :labelCol="longLabelColBaseInfo" :wrapperCol="longWrapperColBaseInfo" :label="$t('workCenter.permissionApplicationProcess.applyForPermission')">
|
||||
<base-info-table v-if="!isInitiate" :disabled="!isInitiate" ref="applyPermissionTable"></base-info-table>
|
||||
<base-info-table v-if="!isInitiate" :disabled="!isInitiate" :disabled-all="disabledAll" ref="applyPermissionTable"></base-info-table>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<a-col :span="12">
|
||||
<!-- 授权到期日期 -->
|
||||
<a-form-item :labelCol="labelColBaseInfo" :wrapperCol="wrapperColBaseInfo" :label="$t('workCenter.permissionApplicationProcess.authExpirationDate')">
|
||||
<j-date date-format="YYYY-MM-DD" style="width: 100%" showType="day" :disabled="disabled" :disabled-date="expirationDisabledDate"
|
||||
<j-date date-format="YYYY-MM-DD" style="width: 100%" showType="day" :disabled="disabled || disabledAll" :disabled-date="expirationDisabledDate"
|
||||
:placeholder="$t('pleaseSelect') + $t('workCenter.permissionApplicationProcess.authExpirationDate')"
|
||||
v-decorator="['expirationDate', validatorRules.authExpirationDate]" />
|
||||
</a-form-item>
|
||||
@@ -94,7 +94,7 @@
|
||||
<a-textarea :placeholder="$t('pleaseSelect') + $t('workCenter.permissionApplicationProcess.applicationDescription')"
|
||||
:maxLength="500"
|
||||
:rows="4"
|
||||
:disabled="disabled"
|
||||
:disabled="disabled || disabledAll"
|
||||
v-decorator="['applyDetail', validatorRules.applicationDescription]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -107,12 +107,13 @@
|
||||
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('remarks')">
|
||||
<a-textarea :placeholder="$t('pleaseEnter') + $t('remarks')"
|
||||
:maxLength="500"
|
||||
:disabled="disabledAll"
|
||||
:rows="4"
|
||||
v-decorator="['commitText', validatorRules.remarks]" />
|
||||
</a-form-item>
|
||||
<!--附件-->
|
||||
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('businessSupport.questionAnswer.attach')">
|
||||
<j-upload v-decorator="['commitFile']" return-id multiple />
|
||||
<j-upload v-decorator="['commitFile']" return-id multiple :disabled="disabledAll" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</div>
|
||||
@@ -126,7 +127,7 @@
|
||||
</process-detail-list>
|
||||
</div>
|
||||
|
||||
<div class="detail-page-bottom-operate-box">
|
||||
<div class="detail-page-bottom-operate-box" v-if="!disabledAll">
|
||||
<!--转办-->
|
||||
<a-button v-if="btn.includes('transfer')" type="primary" :loading="loading" @click="handleTurnTo" ghost icon="arrow-up">{{ $t('turnTo') }}</a-button>
|
||||
<!--保存-->
|
||||
@@ -152,12 +153,12 @@ import PersonnelInfo from '@comp/PersonnelInfo'
|
||||
import BaseInfoTable from '@views/workCenter/permissionApplicationProcess/modules/BaseInfoTable'
|
||||
import UserSelectModal from '@comp/selection/UserSelectModal'
|
||||
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
|
||||
import { ApprovalOpinions, PermissionApply, ProcessKey } from '@/enums/commonEnums'
|
||||
import { ApprovalOpinions, PermissionApply, ProcessKey, ProcessType } from '@/enums/commonEnums'
|
||||
import {
|
||||
approvalPermissionApply, checkPermissionApply, getPermissionApplyDataById,
|
||||
approvalPermissionApply, checkPermissionApply, getLookData, getPermissionApplyDataById,
|
||||
getPermissionApplyDetail,
|
||||
getPermissionApplyProjectId, rejectPermissionApply,
|
||||
savePermissionApply, startPermissionApply,
|
||||
savePermissionApply, saveSnapShot, startPermissionApply,
|
||||
transferPermissionApply
|
||||
} from '@api/workCenter'
|
||||
import { cloneDeep } from 'lodash'
|
||||
@@ -172,6 +173,7 @@ export default {
|
||||
return {
|
||||
loading: false,
|
||||
switchValue: 'base',
|
||||
disabledAll: false, // 禁用全部
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 4 }
|
||||
@@ -271,7 +273,8 @@ export default {
|
||||
// standardApproval
|
||||
},
|
||||
created () {
|
||||
const { projectId, nodeId, taskName } = this.$route.query
|
||||
const { projectId, nodeId, taskName, isLook } = this.$route.query
|
||||
this.disabledAll = isLook === '1'
|
||||
// 发起、草稿进来没有nodeId,就默认发起节点
|
||||
this.currentNode = nodeId || PermissionApply.initiate.value
|
||||
this.currentNodeName = taskName || PermissionApply.initiate.text
|
||||
@@ -282,6 +285,11 @@ export default {
|
||||
// 同意按钮
|
||||
this.btn = ['agree']
|
||||
}
|
||||
// 快照回显
|
||||
if (this.$route.query.snapshotId) {
|
||||
this.loadSnapshotPage()
|
||||
return
|
||||
}
|
||||
// 查询人员信息
|
||||
this.getPersonInfoStructure(this.processKey, () => {
|
||||
this.initPersonInfoData(this.isInitiate)
|
||||
@@ -457,6 +465,12 @@ export default {
|
||||
}
|
||||
}
|
||||
const params = {}
|
||||
if (this.$refs.baseInfoTable) {
|
||||
params.lawsEnterpriseStandardList = this.$refs.baseInfoTable.dataSource || []
|
||||
}
|
||||
if (this.$refs.applyPermissionTable) {
|
||||
params.lawsEnterpriseStandardList = this.$refs.applyPermissionTable.dataSource || []
|
||||
}
|
||||
// 收集所有表单信息
|
||||
let formDataList = []
|
||||
if (isValidate) {
|
||||
@@ -476,6 +490,8 @@ export default {
|
||||
// 保存清空校验
|
||||
this.approvalInfoForm.validateFields(['commitText'], { force: true }, () => {})
|
||||
}
|
||||
// 保存一下所有表单收集的数据用于快照回显
|
||||
params.formDataList = formDataList
|
||||
// 收集人员信息
|
||||
const personInfo = this.getPersonInfo(isValidate && !flag)
|
||||
if (!personInfo) {
|
||||
@@ -518,7 +534,9 @@ export default {
|
||||
// 业务数据,用于强制撤回后回显
|
||||
draftData: Object.assign({}, params.processEsPermissionApply, {
|
||||
lawsEnterpriseStandardList: this.$refs.baseInfoTable.dataSource
|
||||
})
|
||||
}),
|
||||
// 将流程数据保存json,后续进行快照回显
|
||||
prcData: params
|
||||
})
|
||||
}
|
||||
|
||||
@@ -528,6 +546,72 @@ export default {
|
||||
}
|
||||
return params
|
||||
},
|
||||
/**
|
||||
* 保存快照信息
|
||||
*/
|
||||
saveSnapShotInfo (prcParams) {
|
||||
// 没有taskId就不保存
|
||||
if (!this.$route.query.taskId) {
|
||||
return Promise.resolve({ success: true })
|
||||
}
|
||||
const { processAll = {}, processApprovalRecord = {} } = prcParams
|
||||
const params = Object.assign({}, {
|
||||
taskId: this.$route.query.taskId,
|
||||
pcrType: ProcessType.PERMISSION_APPLY.value,
|
||||
// 流程信息
|
||||
prcName: processAll.prcName,
|
||||
processDueDate: processAll.dueTime,
|
||||
processDescription: processAll.prcMes,
|
||||
// 流程审批信息
|
||||
handleText: processApprovalRecord.commitText,
|
||||
handleFile: processApprovalRecord.commitFile,
|
||||
// 流程json字符串存储全部信息
|
||||
infoJsonStr: JSON.stringify({
|
||||
// 人员信息
|
||||
personInfo: this.$refs.personnelInfo.getDataObj(),
|
||||
// 流程信息
|
||||
prcData: prcParams
|
||||
})
|
||||
})
|
||||
return saveSnapShot(params)
|
||||
},
|
||||
// 回显快照页面
|
||||
loadSnapshotPage () {
|
||||
const { snapshotId } = this.$route.query
|
||||
if (!snapshotId) {
|
||||
return
|
||||
}
|
||||
this.loading = true
|
||||
getLookData({ snapshotId }).then(res => {
|
||||
const result = res.result || {}
|
||||
const jsonData = JSON.parse(result.infoJsonStr || '{}')
|
||||
const prcData = jsonData.prcData || {}
|
||||
this.info = prcData
|
||||
this.processInfoForm && this.processInfoForm.setFieldsValue({
|
||||
prcName: prcData.processAll.prcName,
|
||||
dueTime: prcData.processAll.dueTime,
|
||||
prcMes: prcData.processAll.prcMes
|
||||
})
|
||||
this.approvalInfoForm && this.approvalInfoForm.setFieldsValue({
|
||||
commitText: prcData.processApprovalRecord.commitText,
|
||||
commitFile: prcData.processApprovalRecord.commitFile
|
||||
})
|
||||
this.formInfo = prcData.processEsPermissionApply || {}
|
||||
this.$nextTick(() => {
|
||||
// 发起节点的表格和审批节点的表格,哪个存在回显哪个的数据
|
||||
this.$refs.baseInfoTable && this.$refs.baseInfoTable.setData(prcData.lawsEnterpriseStandardList)
|
||||
this.$refs.applyPermissionTable && this.$refs.applyPermissionTable.setData(prcData.lawsEnterpriseStandardList)
|
||||
this.baseInfoForm.setFieldsValue({
|
||||
expirationDate: this.formInfo.expirationDate,
|
||||
userDictText: this.formInfo.userDictText,
|
||||
standardNumbers: this.formInfo.standardNumbers,
|
||||
applyDetail: this.formInfo.applyDetail
|
||||
})
|
||||
})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 转办弹框
|
||||
*/
|
||||
@@ -626,19 +710,27 @@ export default {
|
||||
handleAgree (isSubmitBtn) {
|
||||
if (this.loading) return
|
||||
this.loading = true
|
||||
this.getPageParams().then(res => {
|
||||
this.getPageParams().then(params => {
|
||||
// 同意和提交一直传true
|
||||
res.map.pass = true
|
||||
params.map.pass = true
|
||||
// 不是提交按钮
|
||||
if (isSubmitBtn !== true) {
|
||||
// 没有填写注释,就默认同意
|
||||
if (!res.processApprovalRecord.commitText) {
|
||||
res.processApprovalRecord.commitText = '同意'
|
||||
if (!params.processApprovalRecord.commitText) {
|
||||
params.processApprovalRecord.commitText = '同意'
|
||||
}
|
||||
// 审批意见
|
||||
res.processApprovalRecord.commitFlag = ApprovalOpinions.AGREE.value
|
||||
params.processApprovalRecord.commitFlag = ApprovalOpinions.AGREE.value
|
||||
}
|
||||
return approvalPermissionApply(res)
|
||||
// 保存快照,成功了就调接口,失败了就提示
|
||||
console.log(params)
|
||||
return this.saveSnapShotInfo(params).then(res => {
|
||||
if (res.success) {
|
||||
return approvalPermissionApply(params)
|
||||
} else {
|
||||
return res
|
||||
}
|
||||
})
|
||||
}).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
@@ -647,6 +739,7 @@ export default {
|
||||
this.$message.warn(res.message)
|
||||
}
|
||||
}).catch((err) => {
|
||||
console.log(err)
|
||||
if (err && err.message && tabList.includes(err.message)) {
|
||||
this.switchChange(err.message)
|
||||
}
|
||||
@@ -677,11 +770,18 @@ export default {
|
||||
return
|
||||
}
|
||||
this.loading = true
|
||||
this.getPageParams().then(res => {
|
||||
res.map.pass = false
|
||||
this.getPageParams().then(params => {
|
||||
params.map.pass = false
|
||||
// 审批意见
|
||||
res.processApprovalRecord.commitFlag = ApprovalOpinions.REJECT.value
|
||||
return rejectPermissionApply(res)
|
||||
params.processApprovalRecord.commitFlag = ApprovalOpinions.REJECT.value
|
||||
// 保存快照,成功了就调接口,失败了就提示
|
||||
return this.saveSnapShotInfo(params).then(res => {
|
||||
if (res.success) {
|
||||
return rejectPermissionApply(params)
|
||||
} else {
|
||||
return res
|
||||
}
|
||||
})
|
||||
}).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="table-operator" v-if="!disabled">
|
||||
<div class="table-operator" v-if="!disabled && !disabledAll">
|
||||
<!-- 新增 -->
|
||||
<a-button icon="plus" type="primary" @click="handleAdd">{{ $t('newlyAdded') }}</a-button>
|
||||
</div>
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<!-- 操作 -->
|
||||
<template slot="action" slot-scope="{text, record, index}">
|
||||
<a @click="handleDelete(index)" >{{ $t('delete') }}</a>
|
||||
<a @click="handleDelete(index)" :disabled="disabledAll">{{ $t('delete') }}</a>
|
||||
</template>
|
||||
|
||||
</j-table>
|
||||
@@ -46,6 +46,10 @@ export default {
|
||||
name: 'BaseInfoTable',
|
||||
components: { StandardSelection, JTable },
|
||||
props: {
|
||||
disabledAll: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
|
||||
Reference in New Issue
Block a user