[add] 新法规导入流程

This commit is contained in:
lideqin
2024-06-21 14:52:31 +08:00
parent c9d5b54166
commit 54291d8f79
7 changed files with 869 additions and 1466 deletions
@@ -0,0 +1,494 @@
<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>
</a-row>
</a-form>
<!-- 业务基本信息 -->
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
<!-- 节点1法规工程师发起 -->
<base-info-form v-if="currentNode === 1" ref="baseInfoRef" @processNameChange="processNameChange"></base-info-form>
<!-- 节点2高级经理校对 -->
<!-- 节点3总监审核 -->
<!-- 节点4公司标准法规责任领导批准 -->
<!-- 节点5公司标准法规责任领导批准 -->
<base-info-form v-else ref="baseInfoRef" 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.ES_ARCHIVE.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 BaseInfoForm from './modules/BaseInfoForm'
import InternalDetailPage from '@/components/InternalDetailPage'
import ProcessDetailList from '@/components/ProcessDetailList'
import PersonnelInfo from '@/components/PersonnelInfo'
import UserSelectModal from '@/components/selection/UserSelectModal'
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
import pick from 'lodash.pick'
import { NewRegulationsImportNodes, ProcessKey } from '../../../enums/commonEnums'
import {
newRegulationImportAgree, newRegulationImportApproval,
newRegulationImportGetDataById,
newRegulationImportGetDataDraft, newRegulationImportReject,
newRegulationImportSave, newRegulationImportTurnTo
} from '../../../api/workCenter'
export default {
name: 'NewRegulationIntroductionProcess',
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 === NewRegulationsImportNodes.initiated.value) {
// 法规工程师发起
this.currentNode = 1
} else if (nodeId === NewRegulationsImportNodes.seniorManagerProofread.value) {
// 高级经理校对
this.currentNode = 2
} else if (nodeId === NewRegulationsImportNodes.directorAudit.value) {
// 总监审核
this.currentNode = 3
} else if (nodeId === NewRegulationsImportNodes.responsibleLeaderApprovalOne.value) {
// 公司标准法规责任领导批准
this.currentNode = 4
} else if (nodeId === NewRegulationsImportNodes.responsibleLeaderApprovalTwo.value) {
// 公司标准法规责任领导批准
this.currentNode = 5
} else {
// 预留加签节点
this.currentNode = 999
}
}
// 获取人员信息结构
this.getPersonInfoStructure(ProcessKey.NEW_REGULATIONS_IMPORT.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: NewRegulationsImportNodes.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: [],
url: {
list: '' // 人员信息的右侧表格获取接口
}
}
},
methods: {
// 根据流程id获取数据并回显
getProcessData (type, param) {
this.loading = true
let func
let params = {}
if (type === 'todo') {
func = newRegulationImportGetDataById
params = param.taskId
} else {
func = newRegulationImportGetDataDraft
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
// 保存到草稿
newRegulationImportSave(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 = newRegulationImportAgree
paramObj.common.taskId = this.$route.query.taskId
} else {
func = newRegulationImportApproval
}
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
newRegulationImportTurnTo(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
newRegulationImportAgree(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
newRegulationImportReject(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,291 @@
<template>
<a-spin :spinning="loading">
<a-form-model :model="formInline" :rules="rules" ref="ruleForm">
<div class="form-flex-box">
<!-- 标准编号 -->
<div class="box-title-text form-flex-item">
<div class="title-text">
<span class="required">*</span>
<span class="title-text-text" :title="$t('standardNumber')">
{{ $t('standardNumber') }}
</span>
</div>
<a-form-model-item class="item-model" prop="standardNumber">
<standard-selection :source="StandardSource.FOREIGN.value"
:placeholder="$t('pleaseSelect') + $t('standardNumber')"
:disabled="disabled"
:disabledSourceSearch="true"
type="radio"
:selectOnly="true"
v-model="formInline.standardNumber"
@listChange="listChange" />
</a-form-model-item>
</div>
<!-- 标准名称 -->
<div class="box-title-text form-flex-item">
<div class="title-text">
<span class="title-text-text" :title="$t('standardName')">
{{ $t('standardName') }}
</span>
</div>
<a-form-model-item class="item-model" prop="standardName">
<a-input class="box-input"
v-model="formInline.standardName"
:maxLength="200"
disabled
:placeholder="isGetDataAfter ? '' : $t('pleaseEnter')+$t('standardName')" />
</a-form-model-item>
</div>
<!-- 代替标准编号 -->
<div class="box-title-text form-flex-item">
<div class="title-text">
<span class="title-text-text" :title="$t('workCenter.newRegulationImportProcess.substituteStandardNumber')">
{{ $t('workCenter.newRegulationImportProcess.substituteStandardNumber') }}
</span>
</div>
<a-form-model-item class="item-model" prop="substituteStandardNumber">
<a-input class="box-input"
disabled
v-model="formInline.substituteStandardNumber"
:maxLength="50"
:placeholder="isGetDataAfter ? '' : $t('pleaseEnter')+$t('workCenter.newRegulationImportProcess.substituteStandardNumber')" />
</a-form-model-item>
</div>
<!-- 标准类型 -->
<div class="box-title-text form-flex-item">
<div class="title-text">
<span class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.newRegulationImportProcess.standardType')">
{{ $t('workCenter.newRegulationImportProcess.standardType') }}
</span>
</div>
<a-form-model-item class="item-model" prop="standardCategory">
<j-dict-select-tag class="box-input"
v-model="formInline.standardCategory"
:placeholder="$t('pleaseSelect')+$t('workCenter.newRegulationImportProcess.standardType')"
:type="'select'"
:triggerChange="false"
dictCode="esp_standard_type" />
</a-form-model-item>
</div>
<!-- 所处阶段 -->
<div class="box-title-text form-flex-item">
<div class="title-text">
<span class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.newRegulationImportProcess.stageWeAreIn')">
{{ $t('workCenter.newRegulationImportProcess.stageWeAreIn') }}
</span>
</div>
<a-form-model-item class="item-model" prop="stageWeAreIn">
<j-dict-select-tag class="box-input"
v-model="formInline.stageWeAreIn"
:placeholder="$t('pleaseSelect')+$t('workCenter.newRegulationImportProcess.stageWeAreIn')"
:type="'select'"
:triggerChange="false"
dictCode="esp_standard_type" />
</a-form-model-item>
</div>
<!-- 实施日期 -->
<div class="box-title-text form-flex-item">
<div class="title-text">
<span class="title-text-text" :title="$t('workCenter.newRegulationImportProcess.materialDate')">
{{ $t('workCenter.newRegulationImportProcess.materialDate') }}
</span>
</div>
<a-form-model-item class="item-model" prop="implementationDate">
<a-date-picker
v-model="formInline.implementationDate"
:placeholder="isGetDataAfter ? '' : $t('pleaseSelectDate')"
:showTime="false"
disabled
value-format="YYYY-MM-DD">
</a-date-picker>
</a-form-model-item>
</div>
<!-- 适用市场 -->
<div class="box-title-text form-flex-item">
<div class="title-text">
<span class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.newRegulationImportProcess.applicableMarket')">
{{ $t('workCenter.newRegulationImportProcess.applicableMarket') }}
</span>
</div>
<a-form-model-item class="item-model" prop="applicableMarket">
<j-dict-select-tag class="box-input"
v-model="formInline.applicableMarket"
:placeholder="$t('pleaseSelect')+$t('workCenter.newRegulationImportProcess.applicableMarket')"
:type="'select'"
:triggerChange="false"
dictCode="esp_standard_type" />
</a-form-model-item>
</div>
<!-- 抄送人员 -->
<div class="box-title-text form-flex-item">
<div class="title-text">
<span class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.newRegulationImportProcess.ccPerson')">
{{ $t('workCenter.newRegulationImportProcess.ccPerson') }}
</span>
</div>
<a-form-model-item class="item-model" prop="ccPerson">
<user-selection :placeholder="$t('pleaseSelect')+$t('workCenter.newRegulationImportProcess.ccPerson')"
v-model="formInline.ccPerson"
:disabled="disabled"
filedName="ccPerson"
@nameChange="userSelectNameChange"
:nameStr="formInline.ccPerson_dictText"
type="checkbox" />
</a-form-model-item>
</div>
<!-- 法规要求简要描述 -->
<div class="box-title-text form-flex-item">
<div class="title-text">
<span class="title-text-text" :title="$t('workCenter.newRegulationImportProcess.briefDescription')">
{{ $t('workCenter.newRegulationImportProcess.briefDescription') }}
</span>
</div>
<a-form-model-item class="item-model" prop="archiveReason">
<a-textarea :placeholder="$t('pleaseEnter')+$t('workCenter.newRegulationImportProcess.briefDescription')"
:disabled="disabled"
:maxLength="500"
v-model="formInline.briefDescription" :rows="4" />
</a-form-model-item>
</div>
</div>
</a-form-model>
</a-spin>
</template>
<script>
import StandardSelection from '@/components/selection/StandardSelection'
import UserSelection from '@/components/selection/UserSelection'
import { StandardSource } from '@/enums/commonEnums'
import { getForeignStandardDetail } from '../../../../api/standardRegulationLibraryApi'
export default {
name: 'BaseInfoForm',
components: { StandardSelection, UserSelection },
props: {
disabled: {
type: Boolean,
required: false,
default: false
}
},
data () {
return {
StandardSource,
loading: false,
formInline: {},
rules: {
// 标准编号
standardNumber: [
{
required: true,
message: this.$t('standardNumber') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
// 标准类型
standardCategory: [
{
required: true,
message: this.$t('workCenter.newRegulationImportProcess.standardType') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
// 所处阶段
stageWeAreIn: [
{
required: true,
message: this.$t('workCenter.newRegulationImportProcess.stageWeAreIn') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
// 适用市场
applicableMarket: [
{
required: true,
message: this.$t('workCenter.newRegulationImportProcess.applicableMarket') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
// 抄送人员
ccPerson: [
{
required: true,
message: this.$t('workCenter.newRegulationImportProcess.ccPerson') + this.$t('cannotEmpty'),
trigger: 'change'
}
]
},
isGetDataAfter: false // 是否获取完数据了,获取完数据有的字段不显示placeholder
}
},
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
// 给表单赋值
this.formInline = Object.assign({}, data)
this.isGetDataAfter = true
},
// 外层要获取数据
getData () {
// 把数据抛出,在线编辑不知道要不要抛
const data = {}
data.formInline = this.formInline
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
async getDataValidate () {
let data = {}
await this.$refs.ruleForm.validate(valid => {
if (valid) {
data.formInline = this.formInline
} else {
data = false
}
})
return data
},
// 选择用户得到用户名
userSelectNameChange (value, fieldName) {
this.formInline[fieldName + '_dictText'] = value
},
// 选完标准编号了,需要回显内容,返回流程名称
listChange (value) {
console.log(value)
if (!value || value.length <= 0) {
this.formInline = {}
} else {
this.loading = true
// 企标名称
this.formInline.standardName = value[0].standardName
// 根据返回的id查询企标数据
getForeignStandardDetail({ id: value[0].id, type: '2' }).then(async res => {
if (res.success) {
const result = res.result
// 代替企标编号
this.formInline.substituteStandardNumber = result.substitute_standard_number
// 实施日期
this.formInline.implementationDate = result.implementation_date
this.formInline = Object.assign({}, this.formInline)
this.isGetDataAfter = true
}
}).finally(() => {
this.loading = false
})
}
this.$emit('processNameChange', (this.formInline.standardNumber || '') + '-' + (this.formInline.standardName || '') + '-' + '导入通知')
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
/deep/ .ant-form-item-children > * {
width: 100%;
}
</style>