[update] 画年度制修订计划(标准化发起)

This commit is contained in:
lideqin
2023-10-18 18:19:44 +08:00
parent 447fe783f9
commit 7bba0b1bb6
26 changed files with 2615 additions and 693 deletions
@@ -0,0 +1,382 @@
<template>
<internal-detail-page :title="pageTitle" :content-padding="0">
<!-- 标题右侧tab -->
<template v-slot:titleRightCustom>
<div class="table-operator-tab">
<!-- 基础信息 -->
<a class="switch-item" :class="switchValue === 'base' ? 'table-operator-tab-active' : ''"
@click="switchChange('base')">{{ $t('basicInformation') }}
</a>
<!-- 人员信息 -->
<a class="switch-item" :class="switchValue === 'user' ? 'table-operator-tab-active' : ''"
@click="switchChange('user')">{{ $t('personalInformation') }}
</a>
</div>
</template>
<!-- 基础信息 -->
<div v-if="switchValue === 'base'" class="detail-page-scroll-content">
<!-- 流程信息 -->
<div class="process-part-title">{{ $t('processInformation') }}</div>
<a-form :form="processInfoForm">
<a-row>
<a-col :span="12">
<!-- 流程名称 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('processName')">
<a-input :placeholder="$t('pleaseEnter') + $t('processName')"
@change="event => event.target.value = event.target.value.trim()"
:disabled="disabled"
:maxLength="50"
v-decorator="['processName', validatorRules.processName]" />
</a-form-item>
</a-col>
<a-col :span="12">
<!-- 截止日期 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('expirationDate')">
<a-date-picker :placeholder="$t('pleaseSelect') + $t('expirationDate')"
style="width: 100%"
:disabled="disabled"
value-format="YYYY-MM-DD"
v-decorator="['expirationDate']" />
</a-form-item>
</a-col>
<a-col :span="24">
<!-- 流程说明 -->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('processExplain')">
<a-textarea :placeholder="$t('pleaseEnter') + $t('processExplain')"
:maxLength="500"
:rows="4"
:disabled="disabled"
v-decorator="['processExplain']" />
</a-form-item>
</a-col>
</a-row>
</a-form>
<!-- 业务基本信息 -->
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
<!-- 节点1标准工程师发起的基本信息表单 -->
<engineer-init-base-info v-if="currentNode === 1" ref="baseInfoRef"></engineer-init-base-info>
<!-- 节点2部所联络人选取审批人 -->
<contact-select-approver-base-info v-else-if="currentNode === 2" ref="baseInfoRef"></contact-select-approver-base-info>
<!-- 节点3主起草单位主管级领导审批下发 -->
<leader-approve-sent-base-info v-else-if="currentNode === 3" ref="baseInfoRef"></leader-approve-sent-base-info>
<!-- 节点4主起草人填写信息 -->
<!-- 节点5部所联络人汇总 -->
<!-- 节点6主起草单位主管级领导批准 -->
<!-- 节点7标准化归档 -->
<table-base-info v-else ref="baseInfoRef" :current-node="currentNode"></table-base-info>
<!-- 流程审批信息 -->
<div class="process-part-title">{{ $t('processApprovalInformation') }}</div>
<a-form :form="approvalInfoForm">
<!--备注-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('remarks')">
<a-textarea :placeholder="$t('pleaseEnter') + $t('remarks')"
:maxLength="500"
:rows="4"
v-decorator="['remarks', validatorRules.remarks]" />
</a-form-item>
<!--附件-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('businessSupport.questionAnswer.attach')">
<j-upload v-decorator="['file']" return-id />
</a-form-item>
</a-form>
</div>
<!-- 人员信息 -->
<div v-if="switchValue === 'user'" class="detail-page-scroll-content p-0">
<process-detail-list :url="url">
<personnel-info slot="personnelInfo" :data="personnelInfoData" :currentNode="currentNode"></personnel-info>
</process-detail-list>
</div>
<!-- 操作按钮 -->
<div class="detail-page-bottom-operate-box" v-if="!onlyLook">
<!-- 发起节点 -->
<template v-if="currentNode === 1">
<!-- 保存 -->
<a-button type="primary" ghost :loading="loading" @click="handleSave"><i class="iconfont icon-save"></i> {{ $t('preservation') }}</a-button>
<!-- 提交 -->
<a-button type="primary" :loading="loading" @click="handleStart" icon="upload">{{ $t('submit') }}</a-button>
</template>
<!-- 各部所联络人填写/下发任务 -->
<template v-else-if="currentNode === 5">
<!-- 转办 -->
<a-button type="primary" ghost :loading="loading" @click="handleTurnTo" icon="arrow-up">{{ $t('turnTo') }}</a-button>
<!-- 保存 -->
<a-button type="primary" ghost :loading="loading" @click="handleSave"><i class="iconfont icon-save"></i> {{ $t('preservation') }}</a-button>
<!-- 提交 -->
<a-button type="primary" :loading="loading" @click="handleSubmit" icon="upload">{{ $t('submit') }}</a-button>
</template>
<template v-else-if="currentNode === 4 || currentNode === 7">
<!-- 提交 -->
<a-button type="primary" :loading="loading" @click="handleSubmit" icon="upload">{{ $t('submit') }}</a-button>
</template>
<template v-else>
<!-- 转办 -->
<a-button type="primary" ghost :loading="loading" @click="handleTurnTo" icon="arrow-up">{{ $t('turnTo') }}</a-button>
<!-- 保存 -->
<a-button type="primary" ghost :loading="loading" @click="handleSave"><i class="iconfont icon-save"></i> {{ $t('preservation') }}</a-button>
<!-- 同意 -->
<a-button type="primary" :loading="loading" @click="handleAgree" icon="check-circle">{{ $t('agree') }}</a-button>
<!-- 驳回 -->
<a-button type="primary" :loading="loading" @click="handleReject" icon="close-circle">{{ $t('reject') }}</a-button>
</template>
</div>
<!-- 选人弹框 -->
<user-select-modal ref="userSelectModal" type="radio" @change="userSelectModalChange"></user-select-modal>
</internal-detail-page>
</template>
<script>
import InternalDetailPage from '@/components/InternalDetailPage'
import UserSelectModal from '@/components/selection/UserSelectModal'
import ProcessDetailList from '@/components/ProcessDetailList'
import PersonnelInfo from '@/components/PersonnelInfo'
import EngineerInitBaseInfo from './modules/EngineerInitBaseInfo'
import ContactSelectApproverBaseInfo from './modules/ContactSelectApproverBaseInfo'
import LeaderApproveSentBaseInfo from './modules/LeaderApproveSentBaseInfo'
import TableBaseInfo from './modules/TableBaseInfo'
const personData = [
{
id: 1,
nodeName: '标准化工程师发起',
nodeRoleName: '发起人',
canChoose: false
},
{
id: 2,
nodeName: '部所联络人选取审批人',
nodeRoleName: '部所联络人',
canChoose: false
},
{
id: 3,
nodeName: '主起草单位主管级领导审批下发',
nodeRoleName: '主起草单位主管级领导',
canChoose: false
},
{
id: 4,
nodeName: '主起草人填写信息',
nodeRoleName: '主起草人',
canChoose: false
},
{
id: 5,
nodeName: '部所联络人汇总',
nodeRoleName: '部所联络人',
canChoose: false
},
{
id: 6,
nodeName: '主起草单位主管级领导批准',
nodeRoleName: '主起草单位主管级领导',
canChoose: false
},
{
id: 7,
nodeName: '标准化归档',
nodeRoleName: '标准化工程师',
canChoose: false
}
]
export default {
name: 'RevisionPlanStandardizationInitFlow',
components: {
TableBaseInfo,
LeaderApproveSentBaseInfo,
ContactSelectApproverBaseInfo,
EngineerInitBaseInfo,
InternalDetailPage,
UserSelectModal,
ProcessDetailList,
PersonnelInfo
},
computed: {
pageTitle () {
return this.$t('flowCenter') + this.$route.meta.title
}
},
mounted () {
if (this.currentNode === 1) {
this.personnelInfoData = personData
} else {
this.personnelInfoData = personData.map(item => {
return { ...item, canChoose: false }
})
}
// 如果是查看进入的,不可编辑,不可操作
if (this.$route.query.onlyLook) {
this.onlyLook = this.$route.query.onlyLook
this.disabled = this.$route.query.onlyLook
}
},
data () {
return {
loading: false,
switchValue: 'base',
processInfoForm: this.$form.createForm(this),
labelCol: {
xs: { span: 24 },
sm: { span: 4 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 20 }
},
longLabelCol: {
xs: { span: 24 },
sm: { span: 2 }
},
longWrapperCol: {
xs: { span: 24 },
sm: { span: 22 }
},
disabled: false,
onlyLook: false,
validatorRules: {
// 流程名称
processName: {
rules: [
{
required: true,
message: this.$t('pleaseEnter') + this.$t('processName')
}
],
validateTrigger: 'blur'
},
// 备注
remarks: {
rules: [
{
required: false,
message: this.$t('pleaseEnter') + this.$t('remarks')
}
],
validateTrigger: 'blur'
}
},
currentNode: 7,
approvalInfoForm: this.$form.createForm(this), // 审批信息表单
personnelInfoData: [], // 人员信息数据
url: {
list: '' // 人员信息右侧表的分页查询接口
}
}
},
methods: {
switchChange (value) {
this.switchValue = value
},
// 保存
handleSave () {
// 有任意一项填了即可
// 流程信息表单
const processInfoForm = this.processInfoForm.getFieldsValue()
// 业务基本信息
let ruleForm = {}
// 流程审批信息
const approvalInfoForm = this.approvalInfoForm.getFieldsValue()
// 人员信息的数据, 处理成对象
const personnelInfo = this.$refs.personnelInfo.stepsData
const personnelObj = {}
for (const item of personnelInfo) {
if (item.fieldName) {
personnelObj[item.fieldName] = item.user
}
}
// 需要传给后端的
// 业务基本信息
if (this.$refs.basicInfoFormRef) {
} else {
// 需要外层信息至少填了一项
const param = { ...processInfoForm, ...ruleForm, ...approvalInfoForm, ...personnelObj }
const flag = Object.values(param).some(v => !!v || v === 0)
if (!flag) {
// 提示至少填写一项
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
return
}
}
// 保存到草稿
// enterprisePlanApprovalSave(arr).then(res => {
// if (res.success) {
// this.$message.success(res.message)
// } else {
// this.$message.warning(res.message)
// }
// })
},
// 节点一时候的提交,发起变更
handleStart () {
if (this.loading) return
// 人员信息的数据, 处理成对象
const personnelInfo = this.$refs.personnelInfo.stepsData
const personnelObj = {}
for (const item of personnelInfo) {
if (item.fieldName) {
personnelObj[item.fieldName] = item.user
}
}
// 校验是否填了所有能填的人员信息
if (!Object.values(personnelObj).every(v => !!v)) {
this.$message.warning(this.$t('pleaseEnterPersonnelInfo'))
return
}
this.processInfoForm.validateFields((err, values) => {
this.approvalInfoForm.validateFields((approvalErr, approvalValues) => {
})
})
},
// 转办
handleTurnTo () {
if (this.loading) return
// 点击显示选人组件
this.$refs.userSelectModal.open()
},
// 转办选完人的回调
userSelectModalChange (userIds) {
this.approvalInfoForm.validateFields((err, values) => {
if (!err) {
this.loading = true
const param = Object.assign({}, values)
param.userId = userIds
param.taskId = this.$route.query.taskId
// enterprisePlanApprovalTurnTo(param).then(res => {
// if (res.success) {
// this.$message.success(res.message)
// } else {
// this.$message.warning(res.message)
// }
// }).finally(() => {
// this.loading = false
// })
}
})
},
// 提交
handleSubmit () {
},
// 同意
handleAgree () {
},
// 驳回
handleReject () {
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
</style>