update 权限申请流程完善

This commit is contained in:
danshihao
2023-12-13 16:49:42 +08:00
parent 23bf12b99b
commit 9cdce928db
2 changed files with 72 additions and 69 deletions
@@ -57,22 +57,14 @@
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
<!-- 标准表格 -->
<base-info-table v-if="isInitiate" ref="baseInfoTable" style="margin-bottom: 40px;"></base-info-table>
<base-info-table v-if="isInitiate" ref="baseInfoTable" :info="info" style="margin-bottom: 40px;"></base-info-table>
<!-- 表单 -->
<a-form :form="baseInfoForm">
<a-row>
<a-col :span="8" v-if="isInitiate">
<!-- 授权到期日期 -->
<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"
:placeholder="$t('pleaseSelect') + $t('workCenter.permissionApplicationProcess.authExpirationDate')"
v-decorator="['expirationDate', validatorRules.authExpirationDate]" />
</a-form-item>
</a-col>
<template v-if="!isInitiate">
<a-col :span="8">
<a-col :span="12">
<!-- 申请人 -->
<a-form-item :labelCol="labelColBaseInfo" :wrapperCol="wrapperColBaseInfo" :label="$t('workCenter.permissionApplicationProcess.applicant')">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('workCenter.permissionApplicationProcess.applicant')">
<a-input :placeholder="$t('pleaseEnter') + $t('workCenter.permissionApplicationProcess.applicant')"
@change="event => event.target.value = event.target.value.trim()"
:maxLength="50"
@@ -80,20 +72,24 @@
v-decorator="['userDictText', validatorRules.applicant]" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-col :span="24"></a-col>
<a-col :span="12">
<!-- 申请权限 -->
<a-form-item :labelCol="labelColBaseInfo" :wrapperCol="wrapperColBaseInfo" :label="$t('workCenter.permissionApplicationProcess.applyForPermission')">
<a-input :placeholder="$t('pleaseEnter') + $t('workCenter.permissionApplicationProcess.applyForPermission')"
@change="event => event.target.value = event.target.value.trim()"
:maxLength="50"
:disabled="disabled"
v-decorator="['standardNumbers', validatorRules.applyForPermission]" />
</a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('workCenter.permissionApplicationProcess.applyForPermission')"></a-form-item>
</a-col>
<base-info-table v-if="!isInitiate" :disabled="!isInitiate" ref="applyPermissionTable" style="margin-bottom: 40px;"></base-info-table>
</template>
<a-col :span="8">
<a-col :span="12">
<!-- 授权到期日期 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('workCenter.permissionApplicationProcess.authExpirationDate')">
<j-date date-format="YYYY-MM-DD" style="width: 100%" showType="day" :disabled="disabled"
:placeholder="$t('pleaseSelect') + $t('workCenter.permissionApplicationProcess.authExpirationDate')"
v-decorator="['expirationDate', validatorRules.authExpirationDate]" />
</a-form-item>
</a-col>
<a-col :span="24">
<!-- 申请说明 -->
<a-form-item :labelCol="labelColBaseInfo" :wrapperCol="wrapperColBaseInfo" :label="$t('workCenter.permissionApplicationProcess.applicationDescription')">
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('workCenter.permissionApplicationProcess.applicationDescription')">
<a-textarea :placeholder="$t('pleaseSelect') + $t('workCenter.permissionApplicationProcess.applicationDescription')"
:maxLength="500"
:rows="4"
@@ -161,6 +157,7 @@ import {
savePermissionApply, startPermissionApply,
transferPermissionApply
} from '@api/workCenter'
import { cloneDeep } from 'lodash'
export default {
name: 'PermissionApplicationProcess',
@@ -186,14 +183,6 @@ export default {
xs: { span: 24 },
sm: { span: 22 }
},
labelColBaseInfo: {
xs: { span: 24 },
sm: { span: 8 }
},
wrapperColBaseInfo: {
xs: { span: 24 },
sm: { span: 16 }
},
// 流程key
processKey: ProcessKey.PERMISSION_APPLY.value,
// 当前流程信息
@@ -308,11 +297,12 @@ export default {
getPermissionApplyDataById({ projectId: this.projectId }).then(res => {
if (res.success) {
const data = res.result || {}
if (this.isInitiate) {
// 节点一保存时回显表格
this.$refs.baseInfoTable.setData(data.lawsEnterpriseStandardList || [])
}
const list = data.lawsEnterpriseStandardList || []
// 发起节点的表格和审批节点的表格,哪个存在回显哪个的数据
this.$refs.baseInfoTable && this.$refs.baseInfoTable.setData(list)
this.$refs.applyPermissionTable && this.$refs.applyPermissionTable.setData(list)
// 保存并回显表单信息
this.info = cloneDeep(data)
this.formInfo = data
this.baseInfoForm.setFieldsValue({
expirationDate: data.expirationDate,
@@ -373,6 +363,10 @@ export default {
if (this.isInitiate && this.$refs.baseInfoTable.dataSource.length === 0) {
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
throw new Error('base')
} else if (!this.isInitiate && this.$refs.applyPermissionTable.dataSource.length === 0) {
// 其他节点判断表单中的表格是否有数据
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
throw new Error('base')
}
const params = {}
// 收集所有表单信息
@@ -493,6 +487,7 @@ export default {
this.$message.warn(res.message)
}
}).catch((err) => {
console.log(err)
this.switchChange(err.message)
}).finally(() => {
this.loading = false
@@ -1,6 +1,6 @@
<template>
<div>
<div class="table-operator">
<div class="table-operator" v-if="!disabled">
<!-- 新增 -->
<a-button icon="plus" type="primary" @click="handleAdd">{{ $t('newlyAdded') }}</a-button>
</div>
@@ -13,7 +13,7 @@
rowKey="id"
:row-selection="null"
:pagination="false"
:scroll="{x: '100%'}"
:scroll="{x: '100%',y: '50vh'}"
@change="tableOnChange">
<!-- 企标号企标名称 -->
@@ -44,45 +44,53 @@ import { StandardSource } from '@/enums/commonEnums'
export default {
name: 'BaseInfoTable',
components: { StandardSelection, JTable },
props: {
disabled: {
type: Boolean,
default: false
}
},
data () {
const column = [
{
title: this.$t('serialNumber'),
dataIndex: '',
key: 'rowIndex',
align: 'center',
width: 80,
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{ // 企标编号
title: this.$t('workCenter.esInspectionPlan.inspectionBasisStandardNumber'),
align: 'center',
width: 180,
dataIndex: 'standardNumber',
scopedSlots: { customRender: 'standard' }
},
{ // 企标名称
title: this.$t('workCenter.esInspectionPlan.inspectionBasisStandardName'),
align: 'center',
width: 180,
dataIndex: 'standardName',
scopedSlots: { customRender: 'standard' }
},
{
// 操作
title: this.$t('operation'),
dataIndex: 'action',
align: 'center',
width: 100,
scopedSlots: { customRender: 'action' }
}
]
return {
StandardSource,
model: {},
dataSource: [],
columns: [
{
title: this.$t('serialNumber'),
dataIndex: '',
key: 'rowIndex',
align: 'center',
width: 80,
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{ // 企标编号
title: this.$t('workCenter.esInspectionPlan.inspectionBasisStandardNumber'),
align: 'center',
width: 180,
dataIndex: 'standardNumber',
scopedSlots: { customRender: 'standard' }
},
{ // 企标名称
title: this.$t('workCenter.esInspectionPlan.inspectionBasisStandardName'),
align: 'center',
width: 180,
dataIndex: 'standardName',
scopedSlots: { customRender: 'standard' }
},
{
// 操作
title: this.$t('operation'),
dataIndex: 'action',
align: 'center',
width: 100,
scopedSlots: { customRender: 'action' }
}
]
// 根据是否禁用显示操作列
columns: column.slice(0, this.disabled ? 3 : 4)
}
},
computed: {