[add] 市场清单发布流程

This commit is contained in:
lideqin
2024-06-24 17:52:58 +08:00
parent 1b23b4bcc3
commit 53e2ea1e93
11 changed files with 1001 additions and 9 deletions
+3
View File
@@ -136,6 +136,8 @@ const editStandardMasterPlan = (params) => postAction('/laws/StandardMasterPlan/
// 市场法规清单-根据id查询-用于编辑
const getMarketRegulationListById = (params) => getAction('', params)
// 市场法规清单-根据id查询-无权限
const getMarketRegulationListByIdNoPerm = (params) => getAction('', params)
// 市场法规清单-根据ids获取多个清单的清单列表-用于复制
const getMarketRegulationListByIds = (params) => getAction('', params)
// 市场法规清单-新增
@@ -224,6 +226,7 @@ export {
// 市场法规清单
getMarketRegulationListById,
getMarketRegulationListByIdNoPerm,
getMarketRegulationListByIds,
marketRegulationListAdd,
marketRegulationListEdit,
+24
View File
@@ -32,6 +32,22 @@ const newRegulationImportGetDataById = (taskId, params) => getAction(`/process/e
// 草稿的办理回显数据
const newRegulationImportGetDataDraft = (params) => getAction('/process/es/archive/draftHandle', params)
// 市场清单发布流程
// 保存
const marketListReleaseSave = (params) => postAction('/process/es/archive/save', params)
// 发起
const marketListReleaseApproval = (params) => postAction('/process/es/archive/start', params)
// 转办
const marketListReleaseTurnTo = (params) => postAction('/process/es/archive/transfer', params)
// 同意
const marketListReleaseAgree = (params) => postAction('/process/es/archive/agree', params)
// 驳回
const marketListReleaseReject = (params) => postAction('/process/es/archive/reject', params)
// 根据id查询流程数据--办理
const marketListReleaseGetDataById = (taskId, params) => getAction(`/process/es/archive/handle/${taskId}`, params)
// 草稿的办理回显数据
const marketListReleaseGetDataDraft = (params) => getAction('/process/es/archive/draftHandle', params)
// 流程中心
// 已发-强制撤回
const compulsoryWithdrawal = (params) => postAction('/workCenter/forcedWithdrawal', params)
@@ -66,6 +82,14 @@ export {
newRegulationImportGetDataById,
newRegulationImportGetDataDraft,
marketListReleaseSave,
marketListReleaseApproval,
marketListReleaseTurnTo,
marketListReleaseAgree,
marketListReleaseReject,
marketListReleaseGetDataById,
marketListReleaseGetDataDraft,
compulsoryWithdrawal,
processTransfer,
+4
View File
@@ -547,6 +547,10 @@ module.exports = {
textState: 'Text state',
evaluationState: 'Evaluation state'
},
// 市场法规清单选择器
marketRegulationsListSelect: {
marketRegulationsListSelection: '选择清单'
},
// 企标计划选择器
enterprisePlanSelect: {
title: '企标计划选择'
+18
View File
@@ -21,6 +21,24 @@ module.exports = {
ccPerson: '抄送人员',
briefDescription: '法规要求简要描述'
},
// 市场清单发布流程
marketListReleaseProcess: {
englishName: '英文名称',
newProductionVehicleImplementationDate: '新生产车实施日期',
newCertifiedVehicleImplementationDate: '新认证车实施日期',
applicableCountryRegion: '适用国家/地区',
applicableVehicleType: '适用车型',
authenticationObject: '认证对象',
certifiedDeliverables: '认证交付物',
type: '类型',
dynamicType: '动力类型',
mainControlDepartment: '主控部门',
masterControlDepartmentProfessionalModule: '主控部门专业模块',
relatedDepartment: '关联部门',
associateDepartmentSpecializedModules: '关联部门专业模块',
requirementType: '要求类型',
},
// 流程配置
processConfig: {
processType: '流程类型',
+18
View File
@@ -21,6 +21,24 @@ module.exports = {
ccPerson: '抄送人员',
briefDescription: '法规要求简要描述'
},
// 市场清单发布流程
marketListReleaseProcess: {
englishName: '英文名称',
newProductionVehicleImplementationDate: '新生产车实施日期',
newCertifiedVehicleImplementationDate: '新认证车实施日期',
applicableCountryRegion: '适用国家/地区',
applicableVehicleType: '适用车型',
authenticationObject: '认证对象',
certifiedDeliverables: '认证交付物',
type: '类型',
dynamicType: '动力类型',
mainControlDepartment: '主控部门',
masterControlDepartmentProfessionalModule: '主控部门专业模块',
relatedDepartment: '关联部门',
associateDepartmentSpecializedModules: '关联部门专业模块',
requirementType: '要求类型',
},
// 流程配置
processConfig: {
processType: '流程类型',
+5 -1
View File
@@ -198,6 +198,10 @@ module.exports = {
clauseName: '条款名称',
clauseContent: '条款内容',
maximumSelectFive: '最多选择五条记录!',
listNumber: '清单编号',
listName: '清单名称',
countryRegion: '国家/地区',
ccPerson: '抄送人员',
// 标准字段
standardField: {
standardEnglishName: '标准英文名称',
@@ -613,7 +617,7 @@ module.exports = {
},
// 市场法规清单选择器
marketRegulationsListSelect: {
marketRegulationsListSelection: '市场法规清单选择'
marketRegulationsListSelection: '选择清单'
},
// 条款选择器
clauseSelect: {
+11 -1
View File
@@ -122,7 +122,9 @@ export const EnterpriseStandardStatus = {
// 流程key,获取人员信息前需要获取流程定义id,传这里的名字到WorkCenterMixin的getFlowDefinition方法中
export const ProcessKey = {
// 新法规导入流程
NEW_REGULATIONS_IMPORT: { text: '', value: '' }
NEW_REGULATIONS_IMPORT: { text: '', value: '' },
// 市场清单发布流程
MARKET_LIST_RELEASE: { text: '', value: '' }
}
// 流程类型
@@ -161,6 +163,14 @@ export const NewRegulationsImportNodes = new EsEnums({
responsibleLeaderApprovalTwo: { text: '公司标准法规责任领导批准', value: '' }
})
// 市场清单发布流程节点
export const MarketListReleaseNodes = new EsEnums({
initiated: { text: '法规工程师发起', value: '' },
countersign: { text: '会签', value: '' },
seniorManagerAudit: { text: '高级经理审核', value: '' },
directorSApproval: { text: '总监批准', value: '' }
})
// 条款使用范围
export const ClauseUsableRange = new EsEnums({
DOMESTIC: { text: '外来标准', value: '1' },
+1 -1
View File
@@ -53,7 +53,7 @@ export default {
},
{ // 工作组相关流程
uid: 3,
text: this.$t('workCenter.newProcess.workgroupProcess'),
text: this.$t(''),
list: [
]
@@ -0,0 +1,519 @@
<template>
<internal-detail-page :title="pageTitle" :content-padding="0" :loading="loading">
<!-- 标题右侧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-show="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')" :colon="formItemColon">
<a-input :placeholder="$t('pleaseEnter') + $t('processName')"
disabled
:maxLength="50"
v-decorator="['prcName', validatorRules.prcName]" />
</a-form-item>
</a-col>
<a-col :span="12">
<!-- 截止日期 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('expirationDate')" :colon="formItemColon">
<a-date-picker :placeholder="$t('pleaseSelect') + $t('expirationDate')"
style="width: 100%"
:disabled="disabled"
value-format="YYYY-MM-DD"
v-decorator="['dueTime']" />
</a-form-item>
</a-col>
<a-col :span="24">
<!-- 流程说明 -->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('processExplain')" :colon="formItemColon">
<a-textarea :placeholder="$t('pleaseEnter') + $t('processExplain')"
:maxLength="500"
:rows="4"
:disabled="disabled"
v-decorator="['prcMes']" />
</a-form-item>
</a-col>
<template v-if="currentNode !== 1">
<!-- 清单编号 -->
<a-col :span="24">
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('listNumber')" :colon="formItemColon">
<a-input :placeholder="$t('pleaseEnter') + $t('listNumber')"
disabled
:maxLength="50"
v-decorator="['manifestNo', validatorRules.manifestNo]" />
</a-form-item>
</a-col>
<!-- 清单名称 -->
<a-col :span="24">
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('listName')" :colon="formItemColon">
<a-input :placeholder="$t('pleaseEnter') + $t('listName')"
disabled
:maxLength="50"
v-decorator="['manifestName', validatorRules.manifestName]" />
</a-form-item>
</a-col>
<!-- 国家/地区 -->
<a-col :span="24">
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('countryRegion')" :colon="formItemColon">
<a-input :placeholder="$t('pleaseEnter') + $t('countryRegion')"
disabled
:maxLength="50"
v-decorator="['country', validatorRules.country]" />
</a-form-item>
</a-col>
</template>
</a-row>
</a-form>
<!-- 业务基本信息 -->
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
<!-- 节点1法规工程师发起 -->
<base-info-form v-if="currentNode === 1" ref="baseInfoRef" :current-node="currentNode" @processNameChange="processNameChange"></base-info-form>
<!-- 节点2会签 -->
<!-- 节点3高级经理审核 -->
<!-- 节点4总监批准 -->
<base-info-form v-else ref="baseInfoRef" :current-node="currentNode" disabled></base-info-form>
<!-- 流程审批信息 -->
<div class="process-part-title">{{ $t('processApprovalInformation') }}</div>
<a-form :form="approvalInfoForm">
<!--备注-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('remarks')" :colon="formItemColon">
<a-textarea :placeholder="$t('pleaseEnter') + $t('remarks')"
:maxLength="500"
:rows="4"
v-decorator="['commitText', validatorRules.commitText]" />
</a-form-item>
<!--附件-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('attach')" :colon="formItemColon">
<j-upload v-decorator="['commitFile']" return-id multiple />
</a-form-item>
</a-form>
</div>
<!-- 人员信息 -->
<div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0">
<process-detail-list :processKey="ProcessKey.MARKET_LIST_RELEASE.value">
<personnel-info slot="personnelInfo" ref="personnelInfo" :data="personnelInfoData" :currentNode="currentNodeId" :notPermissField="['relatedUserList']"></personnel-info>
</process-detail-list>
</div>
<!-- 操作按钮 -->
<div class="detail-page-bottom-operate-box">
<!-- 发起节点 -->
<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>
<!-- 转办 -->
<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 ProcessDetailList from '@/components/ProcessDetailList'
import PersonnelInfo from '@/components/PersonnelInfo'
import UserSelectModal from '@/components/selection/UserSelectModal'
import BaseInfoForm from './modules/BaseInfoForm'
import { MarketListReleaseNodes, ProcessKey } from '../../../enums/commonEnums'
import {
marketListReleaseAgree,
marketListReleaseApproval,
marketListReleaseGetDataById,
marketListReleaseGetDataDraft,
marketListReleaseReject,
marketListReleaseSave,
marketListReleaseTurnTo
} from '@/api/workCenter'
import pick from 'lodash.pick'
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
export default {
name: 'MarketListReleaseProcess',
components: {
BaseInfoForm,
InternalDetailPage,
ProcessDetailList,
PersonnelInfo,
UserSelectModal
},
mixins: [WorkCenterMixin],
computed: {
pageTitle () {
return this.$t('flowCenter') + this.$route.meta.title + '' + this.currentNodeName + ''
}
},
mounted () {
// 初始化节点
const nodeId = this.$route.query.nodeId
if (nodeId) {
this.currentNodeId = nodeId
if (nodeId === MarketListReleaseNodes.initiated.value) {
// 法规工程师发起
this.currentNode = 1
} else if (nodeId === MarketListReleaseNodes.countersign.value) {
// 会签
this.currentNode = 2
} else if (nodeId === MarketListReleaseNodes.seniorManagerAudit.value) {
// 高级经理审核
this.currentNode = 3
} else if (nodeId === MarketListReleaseNodes.directorSApproval.value) {
// 总监批准
this.currentNode = 4
} else {
// 预留加签节点
this.currentNode = 999
}
}
// 获取人员信息结构
this.getPersonInfoStructure(ProcessKey.MARKET_LIST_RELEASE.value, () => {
if (this.$route.query.processInstanceId) {
if (this.currentNode === 1) {
this.disabled = false
this.initPersonInfoData(true)
} else {
this.disabled = true
// 如果不是第一个节点,人员信息全部不可选
this.initPersonInfoData(false)
}
}
})
if (this.$route.query.taskId && !this.$route.query.draftId) {
// 有流程id说明是从流程中心来的,需要初始化数据
this.getProcessData('todo', { taskId: this.$route.query.taskId })
}
if (this.$route.query.draftId) {
// 有草稿id,说明是从流程中心-草稿来的,需要初始化数据
this.getProcessData('draft', { draftId: this.$route.query.draftId, projectId: this.$route.query.projectId })
}
if (this.$route.query.taskName) {
// 说明是已发起流程
this.currentNodeName = this.$route.query.taskName
} else {
this.currentNodeName = '法规工程师发起'
}
},
data () {
return {
ProcessKey,
loading: false,
switchValue: 'base', // 头部tab选中值
disabled: false,
currentNode: 1, // 当前节点
currentNodeName: '',
currentNodeId: MarketListReleaseNodes.initiated.value, // 当前节点id
model: {},
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 }
},
validatorRules: {
// 流程名称
prcName: {
rules: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('processName') }
],
validateTrigger: 'blur'
},
commitText: {
rules: [
{ required: false, message: this.$t('pleaseEnter') + this.$t('remarks') }
],
validateTrigger: 'blur'
}
},
formInline: {},
approvalInfoForm: this.$form.createForm(this), // 审批信息表单
personnelInfoData: []
}
},
methods: {
// 根据流程id获取数据并回显
getProcessData (type, param) {
this.loading = true
let func
let params = {}
if (type === 'todo') {
func = marketListReleaseGetDataById
params = param.taskId
} else {
func = marketListReleaseGetDataDraft
params = param
}
func(params).then(res => {
if (res.success) {
this.model = res.result
this.$nextTick(() => {
if (type === 'todo') {
// 初始化流程信息
this.processInfoForm.setFieldsValue(pick(this.model.common, 'prcName', 'dueTime', 'prcMes'))
}
// 有草稿json按草稿进来的回显
if (this.model.infoJsonStr) {
// 初始化流程信息
const prcObj = Object.assign({}, this.model)
prcObj.dueTime = this.model.processDueDate
prcObj.prcMes = this.model.processDescription
this.processInfoForm.setFieldsValue(pick(prcObj, 'prcName', 'dueTime', 'prcMes'))
// 初始化流程审批信息
prcObj.commitText = this.model.handleText
prcObj.commitFile = this.model.handleFile
this.approvalInfoForm.setFieldsValue(pick(prcObj, 'commitText', 'commitFile'))
this.model.data = JSON.parse(this.model.infoJsonStr).data
// 如果是节点1的保存回显人员信息
if (this.currentNode === 1) {
this.draftInitPersonInfo(JSON.parse(this.model.infoJsonStr).personnelObj)
}
}
if (this.$refs.baseInfoRef) {
this.$refs.baseInfoRef.initData(this.model.data)
}
})
// 初始化业务基本信息中组件内容
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
// 头部tab改变
switchChange (value) {
this.switchValue = value
},
// 业务基本信息组件中获取到流程名称改变后的值
processNameChange (value) {
const param = { prcName: value }
this.$nextTick(() => {
this.processInfoForm.setFieldsValue(pick(param, 'prcName'))
})
},
// 保存
handleSave () {
if (this.loading) {
return
}
// 有任意一项填了即可
// 流程信息表单
const processInfoForm = this.processInfoForm.getFieldsValue()
// 流程审批信息
const approvalInfoForm = this.approvalInfoForm.getFieldsValue()
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObj()
// 业务基本信息
const baseInfo = this.$refs.baseInfoRef.getData()
const param = { ...processInfoForm, ...baseInfo.formInline, ...approvalInfoForm, ...personnelObj }
const flag = Object.values(param).some(v => !!v || v === 0)
if (!flag) {
// 提示至少填写一项
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
return
}
// 需要传给后端的数据
const paramObj = {}
// 流程信息
paramObj.basicProcessInfoDTO = Object.assign({}, processInfoForm)
paramObj.basicProcessInfoDTO.processName = paramObj.basicProcessInfoDTO.prcName
paramObj.basicProcessInfoDTO.processDueDate = paramObj.basicProcessInfoDTO.dueTime
paramObj.basicProcessInfoDTO.processDescription = paramObj.basicProcessInfoDTO.prcMes
paramObj.basicProcessInfoDTO.processInstanceId = this.$route.query.processInstanceId
// 流程审批信息
paramObj.basicTaskInfoDTO = Object.assign({}, approvalInfoForm)
paramObj.basicTaskInfoDTO.handleText = paramObj.basicTaskInfoDTO.commitText
paramObj.basicTaskInfoDTO.handleFile = paramObj.basicTaskInfoDTO.commitFile
paramObj.basicTaskInfoDTO.taskId = this.$route.query.taskId
// 草稿id
if (this.model.infoJsonStr) {
paramObj.draftId = this.model.id
}
// 业务基本信息和人员信息
paramObj.infoJsonStr = JSON.stringify({
data: baseInfo.formInline,
personnelObj: personnelObj
})
this.loading = true
// 保存到草稿
marketListReleaseSave(paramObj).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
this.loading = false
}
})
},
// 节点一时候的提交
handleStart () {
if (this.loading) return
// 流程信息的校验
this.processInfoForm.validateFields((err, values) => {
// 流程审批信息的校验
this.approvalInfoForm.validateFields(async (approvalErr, approvalValues) => {
const data = await this.$refs.baseInfoRef.getDataValidate()
if (!err && !approvalErr && data) {
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
this.switchValue = 'user'
return
}
this.loading = true
const paramObj = {} // 需要传给后端的数据
paramObj.common = { ...values, ...approvalValues }
// 草稿id
if (this.model.infoJsonStr) {
paramObj.common.draftId = this.model.id
}
paramObj.flowUser = personnelObj
paramObj.data = data.formInline
let func
if (this.$route.query.taskId) {
// 有taskId说明是驳回的提交
func = marketListReleaseAgree
paramObj.common.taskId = this.$route.query.taskId
} else {
func = marketListReleaseApproval
}
func(paramObj).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
this.loading = false
}
})
} else {
this.switchValue = 'base'
}
})
})
},
// 转办
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
marketListReleaseTurnTo(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
this.loading = false
}
})
}
})
},
// 同意
handleAgree () {
if (this.loading) return
this.validatorRules.commitText.rules[0].required = false
if (!this.approvalInfoForm.getFieldValue('commitText')) {
this.approvalInfoForm.setFieldsValue({ commitText: '同意' })
}
this.approvalInfoForm.validateFields((err, values) => {
if (!err) {
this.loading = true
const param = {}
param.common = Object.assign({}, values)
param.common.taskId = this.$route.query.taskId
marketListReleaseAgree(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
this.loading = false
}
})
}
})
},
// 驳回
handleReject () {
if (this.loading) return
this.validatorRules.commitText.rules[0].required = true
if (!this.approvalInfoForm.getFieldValue('commitText')) {
this.$message.warning(this.$t('pleaseEnterRemarks'))
this.switchValue = 'base'
}
this.$nextTick(() => {
this.approvalInfoForm.validateFields({ force: true }, (err, values) => {
if (!err) {
this.loading = true
const param = {}
param.common = Object.assign({}, values)
param.common.taskId = this.$route.query.taskId
marketListReleaseReject(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
this.loading = false
}
}).finally(() => {
this.validatorRules.commitText.rules[0].required = false
})
}
})
})
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
</style>
@@ -0,0 +1,395 @@
<template>
<div>
<a-form-model v-if="currentNode === 1" :model="formInline" class="form-add" :rules="rules" ref="ruleForm">
<div class="form-flex-box">
<!-- 清单编号 -->
<div class="box-title-text form-flex-item form-flex-item-half">
<div class="title-text title-text-long">
<span class="required">*</span>
<span class="title-text-text" :title="$t('listNumber')">
{{ $t('listNumber') }}
</span>
</div>
<a-form-model-item class="item-model" prop="listNumber">
<market-regulations-list-selection type="radio"
selectOnly
:placeholder="$t('pleaseSelect') + $t('listNumber')"
v-model="formInline.listNumber" />
</a-form-model-item>
</div>
<!-- 清单名称 -->
<div class="box-title-text form-flex-item form-flex-item-half">
<div class="title-text title-text-long">
<span class="title-text-text" :title="$t('listName')">
{{ $t('listName') }}
</span>
</div>
<a-form-model-item class="item-model" prop="listName">
<a-input class="box-input"
disabled
v-model="formInline.listName"
:maxLength="50"
:placeholder="isGetDataAfter ? '' : $t('pleaseEnter')+$t('listName')" />
</a-form-model-item>
</div>
<!-- 国家/地区 -->
<div class="box-title-text form-flex-item form-flex-item-half">
<div class="title-text title-text-long">
<span class="title-text-text" :title="$t('countryRegion')">
{{ $t('countryRegion') }}
</span>
</div>
<a-form-model-item class="item-model" prop="countryRegion">
<j-dict-select-tag
:placeholder="isGetDataAfter ? '' : $t('pleaseSelect') + $t('countryRegion')"
v-model="formInline.countryRegion"
disabled
dict-code="market_state"></j-dict-select-tag>
</a-form-model-item>
</div>
</div>
</a-form-model>
<div>
<j-table
:can-drag="true"
:scroll="{x: '100%'}"
ref="table"
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
@change="handleTableChange">
<!-- 标准编号标准名称 -->
<template v-slot:toDetail="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<a class="link-a" @click="toDetail(record)">{{ text }}</a>
</a-tooltip>
</template>
</j-table>
</div>
<a-form-model v-if="currentNode === 1" :model="userFormInline" class="form-user" :rules="userRules" ref="userRuleForm">
<div class="form-flex-box">
<!-- 抄送人员 -->
<div class="box-title-text form-flex-item form-flex-item-half">
<div class="title-text title-text-long">
<span class="required">*</span>
<span class="title-text-text" :title="$t('ccPerson')">
{{ $t('ccPerson') }}
</span>
</div>
<a-form-model-item class="item-model" prop="ccPerson">
<user-selection v-model="formInline.ccPerson"
:placeholder="$t('pleaseSelect')+$t('ccPerson')"
:disabled="disabled"
filedName="ccPerson"
@nameChange="userSelectNameChange"
:nameStr="formInline.ccPerson_dictText"
type="radio"/>
</a-form-model-item>
</div>
</div>
</a-form-model>
</div>
</template>
<script>
import MarketRegulationsListSelection from '@/components/selection/MarketRegulationsListSelection'
import UserSelection from '@/components/selection/UserSelection'
import JTable from '@/components/jero/JTable'
import {
getMarketRegulationListByIdNoPerm
} from '@/api/standardRegulationLibraryApi'
import { StandardSource } from '../../../../enums/commonEnums'
export default {
name: 'BaseInfoForm',
components: { MarketRegulationsListSelection, UserSelection, JTable },
props: {
disabled: {
type: Boolean,
required: false,
default: false
},
currentNode: {
type: Number,
required: false,
default: 1
}
},
data () {
return {
loading: false,
formInline: {},
userFormInline: {},
rules: {
// 清单编号
listNumber: [
{
required: true,
message: this.$t('listNumber') + this.$t('cannotEmpty'),
trigger: 'change'
}
]
},
userRules: {
// 抄送人员
ccPerson: [
{
required: true,
message: this.$t('ccPerson') + this.$t('cannotEmpty'),
trigger: 'change'
}
]
},
columns: [
{
title: this.$t('serialNumber'),
dataIndex: '',
key: 'rowIndex',
align: 'center',
width: 80,
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{ // 标准编号
title: this.$t('standardNumber'),
align: 'center',
width: 180,
dataIndex: 'standardNumber',
scopedSlots: { customRender: 'toDetail' }
},
{ // 标准名称
title: this.$t('standardName'),
align: 'center',
width: 180,
dataIndex: 'standardName',
scopedSlots: { customRender: 'toDetail' }
},
{ // 英文名称
title: this.$t('workCenter.marketListReleaseProcess.englishName'),
align: 'center',
width: 180,
dataIndex: 'englishName',
scopedSlots: { customRender: 'text' }
},
{ // 新生产车实施日期
title: this.$t('workCenter.marketListReleaseProcess.newProductionVehicleImplementationDate'),
align: 'center',
width: 180,
dataIndex: 'newProductionVehicleImplementationDate',
scopedSlots: { customRender: 'text' }
},
{ // 新认证车实施日期
title: this.$t('workCenter.marketListReleaseProcess.newCertifiedVehicleImplementationDate'),
align: 'center',
width: 180,
dataIndex: 'newCertifiedVehicleImplementationDate',
scopedSlots: { customRender: 'text' }
},
{ // 适用国家/地区
title: this.$t('workCenter.marketListReleaseProcess.applicableCountryRegion'),
align: 'center',
width: 180,
dataIndex: 'applicableCountryRegion',
scopedSlots: { customRender: 'text' }
},
{ // 适用车型
title: this.$t('workCenter.marketListReleaseProcess.applicableVehicleType'),
align: 'center',
width: 180,
dataIndex: 'applicableVehicleType',
scopedSlots: { customRender: 'text' }
},
{ // 认证对象
title: this.$t('workCenter.marketListReleaseProcess.authenticationObject'),
align: 'center',
width: 180,
dataIndex: 'authenticationObject',
scopedSlots: { customRender: 'text' }
},
{ // 认证交付物
title: this.$t('workCenter.marketListReleaseProcess.certifiedDeliverables'),
align: 'center',
width: 180,
dataIndex: 'certifiedDeliverables',
scopedSlots: { customRender: 'text' }
},
{ // 类型
title: this.$t('workCenter.marketListReleaseProcess.type'),
align: 'center',
width: 180,
dataIndex: 'type',
scopedSlots: { customRender: 'text' }
},
{ // 动力类型
title: this.$t('workCenter.marketListReleaseProcess.dynamicType'),
align: 'center',
width: 180,
dataIndex: 'dynamicType',
scopedSlots: { customRender: 'text' }
},
{ // 主控部门
title: this.$t('workCenter.marketListReleaseProcess.mainControlDepartment'),
align: 'center',
width: 180,
dataIndex: 'mainControlDepartment',
scopedSlots: { customRender: 'text' }
},
{ // 主控部门专业模块
title: this.$t('workCenter.marketListReleaseProcess.masterControlDepartmentProfessionalModule'),
align: 'center',
width: 180,
dataIndex: 'masterControlDepartmentProfessionalModule',
scopedSlots: { customRender: 'text' }
},
{ // 关联部门
title: this.$t('workCenter.marketListReleaseProcess.relatedDepartment'),
align: 'center',
width: 180,
dataIndex: 'relatedDepartment',
scopedSlots: { customRender: 'text' }
},
{ // 关联部门专业模块
title: this.$t('workCenter.marketListReleaseProcess.associateDepartmentSpecializedModules'),
align: 'center',
width: 180,
dataIndex: 'associateDepartmentSpecializedModules',
scopedSlots: { customRender: 'text' }
},
{ // 要求类型
title: this.$t('workCenter.marketListReleaseProcess.requirementType'),
align: 'center',
width: 180,
dataIndex: 'requirementType',
scopedSlots: { customRender: 'text' }
},
{ // 备注
title: this.$t('remarks'),
align: 'center',
width: 180,
dataIndex: 'remarks',
scopedSlots: { customRender: 'text' }
}
],
dataSource: [],
ipagination: {
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '30', '50', '100', '150', '200'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' ' + this.$t('total') + total + this.$t('strip')
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
isGetDataAfter: false // 是否获取完数据了,获取完数据有的字段不显示placeholder
}
},
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
// 给表单赋值
this.formInline = Object.assign({}, data)
this.userFormInline.ccPerson = data.ccPerson
this.userFormInline.ccPerson_dictText = data.ccPerson_dictText
this.isGetDataAfter = true
},
// 外层要获取数据
getData () {
// 把数据抛出,在线编辑不知道要不要抛
const data = {}
data.formInline = this.formInline
data.formInline.ccPerson = this.userFormInline.ccPerson
data.formInline.ccPerson_dictText = this.userFormInline.ccPerson_dictText
data.dataList = JSON.parse(JSON.stringify(this.dataSource))
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
async getDataValidate () {
let data = {}
await this.$refs.ruleForm.validate(valid => {
this.$refs.userRuleForm.validate(userValid => {
if (valid && userValid) {
data.formInline = this.formInline
data.formInline.ccPerson = this.userFormInline.ccPerson
data.formInline.ccPerson_dictText = this.userFormInline.ccPerson_dictText
data.dataList = JSON.parse(JSON.stringify(this.dataSource))
} else {
data = false
}
})
})
return data
},
// 选择用户得到用户名
userSelectNameChange (value, fieldName) {
this.userFormInline[fieldName + '_dictText'] = value
},
// 选完清单编号了,需要回显内容,返回流程名称
listChange (value) {
console.log(value)
if (!value || value.length <= 0) {
this.formInline = {}
} else {
this.loading = true
// 清单名称
this.formInline.listName = value[0].listName
// 国家/地区
this.formInline.countryRegion = value[0].countryRegion
// 版本
this.formInline.listVersion = value[0].listVersion
// 根据返回的id查询清单列表
getMarketRegulationListByIdNoPerm({ id: value[0].id }).then(async res => {
if (res.success) {
const result = res.result
this.dataSource = result.data
this.formInline = Object.assign({}, this.formInline)
this.isGetDataAfter = true
}
}).finally(() => {
this.loading = false
})
}
this.$emit('processNameChange', (this.formInline.listName || '') + '-' + (this.formInline.listVersion || '') + '-' + '发布')
},
handleTableChange (pagination, filters, sorter) {
this.ipagination = pagination
},
toDetail (record) {
let path = ''
// 需要先判断是哪种标准
if (record.source === StandardSource.FOREIGN.value) {
path = '/standardRegulationLibrary/foreignStandardDetailPage'
} else if (record.source === StandardSource.ENTERPRISE.value) {
path = '/enterpriseStandardLibrary/enterpriseStandardDetail'
}
this.$openPageNewSheet({
path: path,
query: {
id: record.standardId
}
})
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
/deep/ .ant-form-item-children > * {
width: 100%;
}
.form-user {
margin-top: 20px;
}
</style>
@@ -77,7 +77,7 @@
</div>
<!-- 人员信息 -->
<div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0">
<process-detail-list :processKey="ProcessKey.ES_ARCHIVE.value">
<process-detail-list :processKey="ProcessKey.NEW_REGULATIONS_IMPORT.value">
<personnel-info slot="personnelInfo" ref="personnelInfo" :data="personnelInfoData" :currentNode="currentNodeId" :notPermissField="['relatedUserList']"></personnel-info>
</process-detail-list>
</div>
@@ -188,7 +188,7 @@ export default {
// 说明是已发起流程
this.currentNodeName = this.$route.query.taskName
} else {
this.currentNodeName = '发起人发起'
this.currentNodeName = '法规工程师发起'
}
},
data () {
@@ -235,10 +235,7 @@ export default {
},
formInline: {},
approvalInfoForm: this.$form.createForm(this), // 审批信息表单
personnelInfoData: [],
url: {
list: '' // 人员信息的右侧表格获取接口
}
personnelInfoData: []
}
},
methods: {