[update] 修改企标制修订流程

This commit is contained in:
lideqin
2023-11-15 11:54:14 +08:00
parent 549a2335f5
commit 5b4c806a40
23 changed files with 637 additions and 486 deletions
@@ -57,36 +57,36 @@
<!-- 节点1主起草人起草分发 -->
<main-drafter-sent-base-info v-if="currentNode === 1" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></main-drafter-sent-base-info>
<!-- 节点2其他起草人上传企标 -->
<other-drafter-upload-standard-base-info v-if="currentNode === 2" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></other-drafter-upload-standard-base-info>
<other-drafter-upload-standard-base-info v-if="currentNode === 2" :disabled="disabled" ref="baseInfoRef"></other-drafter-upload-standard-base-info>
<!-- 节点3主起草人汇总上传会议纪要 -->
<main-drafter-collect-upload-minute-base-info v-if="currentNode === 3" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></main-drafter-collect-upload-minute-base-info>
<main-drafter-collect-upload-minute-base-info v-if="currentNode === 3" :disabled="disabled" ref="baseInfoRef"></main-drafter-collect-upload-minute-base-info>
<!-- 节点4标准化审核 -->
<standardization-audit-base-info v-if="currentNode === 4" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef" @standardizationAuditIsMeeting="standardizationAuditIsMeeting"></standardization-audit-base-info>
<standardization-audit-base-info v-if="currentNode === 4" :disabled="disabled" ref="baseInfoRef" @standardizationAuditIsMeeting="standardizationAuditIsMeeting"></standardization-audit-base-info>
<!-- 节点5评分人打分 -->
<scorer-mark-base-info v-if="currentNode === 5" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></scorer-mark-base-info>
<scorer-mark-base-info v-if="currentNode === 5" :disabled="disabled" ref="baseInfoRef"></scorer-mark-base-info>
<!-- 节点6标准化确认是否开启征求意见 -->
<confirm-whether-comment-base-info v-if="currentNode === 6" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></confirm-whether-comment-base-info>
<confirm-whether-comment-base-info v-if="currentNode === 6" :disabled="disabled" ref="baseInfoRef"></confirm-whether-comment-base-info>
<!-- 节点7部所联络人下发 -->
<depart-liaison-issue-base-info v-if="currentNode === 7" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></depart-liaison-issue-base-info>
<depart-liaison-issue-base-info v-if="currentNode === 7" :disabled="disabled" ref="baseInfoRef"></depart-liaison-issue-base-info>
<!-- 节点8征求意见对象填写意见 -->
<comment-object-enter-base-info v-if="currentNode === 8" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></comment-object-enter-base-info>
<comment-object-enter-base-info v-if="currentNode === 8" :disabled="disabled" ref="baseInfoRef"></comment-object-enter-base-info>
<!-- 节点9部所联络人汇总数据 -->
<depart-liaison-collect-base-info v-if="currentNode === 9" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></depart-liaison-collect-base-info>
<depart-liaison-collect-base-info v-if="currentNode === 9" :disabled="disabled" ref="baseInfoRef"></depart-liaison-collect-base-info>
<!-- 节点10部所联络人主管级领导审批 -->
<depart-liaison-leader-approve-base-info v-if="currentNode === 10" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></depart-liaison-leader-approve-base-info>
<depart-liaison-leader-approve-base-info v-if="currentNode === 10" :disabled="disabled" ref="baseInfoRef"></depart-liaison-leader-approve-base-info>
<!-- 节点11主起草人汇总 -->
<main-drafter-collect-base-info v-if="currentNode === 11" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></main-drafter-collect-base-info>
<main-drafter-collect-base-info v-if="currentNode === 11" :disabled="disabled" ref="baseInfoRef"></main-drafter-collect-base-info>
<!-- 节点12主起草人上传会议纪要 -->
<main-drafter-upload-minute-base-info v-if="currentNode === 12" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></main-drafter-upload-minute-base-info>
<main-drafter-upload-minute-base-info v-if="currentNode === 12" :disabled="disabled" ref="baseInfoRef"></main-drafter-upload-minute-base-info>
<!-- 节点13其他起草人校对 -->
<!-- 节点14主管级领导审批 -->
<!-- 节点15标准化审批 -->
<!-- 节点16相关部门领导会签 -->
<!-- 节点17总工程师审批 -->
<!-- 只有标准文本 -->
<other-drafter-proofread-base-info v-if="[13, 14, 15, 16, 17].includes(currentNode)" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></other-drafter-proofread-base-info>
<other-drafter-proofread-base-info v-if="[13, 14, 15, 16, 17].includes(currentNode)" :disabled="disabled" ref="baseInfoRef"></other-drafter-proofread-base-info>
<!-- 节点18主起草人发布 -->
<main-drafter-publish-base-info v-if="currentNode === 18" :flowInitType="flowInitType" :disabled="disabled" ref="baseInfoRef"></main-drafter-publish-base-info>
<main-drafter-publish-base-info v-if="currentNode === 18" :disabled="disabled" ref="baseInfoRef"></main-drafter-publish-base-info>
<!-- 流程审批信息 -->
<div class="process-part-title">{{ $t('processApprovalInformation') }}</div>
@@ -171,121 +171,15 @@ import MainDrafterCollectUploadMinuteBaseInfo from './modules/MainDrafterCollect
import MainDrafterUploadMinuteBaseInfo from './modules/MainDrafterUploadMinuteBaseInfo'
import OtherDrafterProofreadBaseInfo from './modules/OtherDrafterProofreadBaseInfo'
import MainDrafterPublishBaseInfo from './modules/MainDrafterPublishBaseInfo'
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: true,
chooseType: 'radio',
fieldName: ''
},
{
id: 5,
nodeName: '评分人打分',
nodeRoleName: '评分人',
canChoose: false
},
{
id: 6,
nodeName: '标准化确认是否开启征求意见',
nodeRoleName: '标准化',
canChoose: false
},
{
id: 7,
nodeName: '部所联络人下发',
nodeRoleName: '部所联络人',
canChoose: false
},
{
id: 8,
nodeName: '征求意见对象填写意见',
nodeRoleName: '征求意见对象',
canChoose: true,
chooseType: 'checkbox',
fieldName: ''
},
{
id: 9,
nodeName: '部所联络人汇总数据',
nodeRoleName: '部所联络人',
canChoose: false
},
{
id: 10,
nodeName: '部所联络人主管级领导审批',
nodeRoleName: '部所联络人主管级领导',
canChoose: false
},
{
id: 11,
nodeName: '主起草人汇总',
nodeRoleName: '主起草人',
canChoose: false
},
{
id: 12,
nodeName: '主起草人上传会议纪要',
nodeRoleName: '主起草人',
canChoose: false
},
{
id: 13,
nodeName: '其他起草人校对',
nodeRoleName: '其他起草人',
canChoose: false
},
{
id: 14,
nodeName: '主管级领导审批',
nodeRoleName: '主管级领导',
canChoose: false
},
{
id: 15,
nodeName: '标准化审批',
nodeRoleName: '标准化审批人',
canChoose: false
},
{
id: 16,
nodeName: '相关部门领导会签',
nodeRoleName: '相关部门领导',
canChoose: false
},
{
id: 17,
nodeName: '总工程师审批',
nodeRoleName: '总工程师',
canChoose: false
},
{
id: 18,
nodeName: '主起草人发布',
nodeRoleName: '主起草人',
canChoose: false
}
]
import { ProcessKey } from '../../../enums/commonEnums'
import {
enStandardEditAgree,
enStandardEditApproval,
enStandardEditGetDataById,
enStandardEditReject,
enStandardEditSave,
enStandardEditTurnTo
} from '@/api/workCenter'
export default {
name: 'EnterpriseStandardRevisionFlow',
@@ -311,16 +205,70 @@ export default {
},
computed: {
pageTitle () {
return this.$t('flowCenter') + this.$route.meta.title
return this.$t('flowCenter') + this.$route.meta.title + '' + this.currentNodeName + ''
}
},
mounted () {
if (this.currentNode === 1) {
this.personnelInfoData = personData
// 初始化节点
const taskName = this.$route.query.taskName
if (taskName) {
if (taskName === '主起草人起草分发') {
this.currentNode = 1
} else if (taskName === '其他起草人上传企标') {
this.currentNode = 2
} else if (taskName === '主起草人汇总上传会议纪要') {
this.currentNode = 3
} else if (taskName === '标准化审核') {
this.currentNode = 4
} else if (taskName === '评分人评分') {
this.currentNode = 5
} else if (taskName === '标准化确认是否开启征求意见') {
this.currentNode = 6
} else if (taskName === '部所联络人下发') {
this.currentNode = 7
} else if (taskName === '征求意见对象填写意见') {
this.currentNode = 8
} else if (taskName === '部所联络人汇总数据') {
this.currentNode = 9
} else if (taskName === '部门联络人主管级领导审批') {
this.currentNode = 10
} else if (taskName === '主起草人汇总') {
this.currentNode = 11
} else if (taskName === '主起草人上传会议纪要') {
this.currentNode = 12
} else if (taskName === '其他起草人校对') {
this.currentNode = 13
} else if (taskName === '主管级领导审批') {
this.currentNode = 14
} else if (taskName === '标准化审批') {
this.currentNode = 15
} else if (taskName === '相关部门领导会签') {
this.currentNode = 16
} else if (taskName === '总工程师审批') {
this.currentNode = 17
} else if (taskName === '主起草人发布') {
this.currentNode = 18
} else {
// 预留加签节点
this.currentNode = 999
}
}
// 获取人员信息结构
this.getPersonInfoStructure(ProcessKey.ES_EDIT.value, () => {
if (this.$route.query.processInstanceId) {
if (this.currentNode === 1) {
this.initPersonInfoData(true)
} else {
this.initPersonInfoData(false)
}
}
})
if (this.$route.query.taskId) {
this.currentNodeName = this.$route.query.taskName
// 有流程id说明是从流程中心来的,需要初始化数据
this.getProcessData(this.$route.query.taskId)
} else {
this.personnelInfoData = personData.map(item => {
return { ...item, canChoose: false, fieldName: undefined }
})
this.currentNodeName = '主起草人起草分发'
}
// 如果是查看进入的,不可编辑,不可操作
if (this.$route.query.onlyLook) {
@@ -373,7 +321,9 @@ export default {
validateTrigger: 'blur'
}
},
currentNode: 18,
model: {},
currentNode: 1,
currentNodeName: '', // 当前节点名称
approvalInfoForm: this.$form.createForm(this), // 审批信息表单
personnelInfoData: [], // 人员信息数据
url: {
@@ -385,10 +335,27 @@ export default {
}
},
methods: {
// 根据流程id获取数据并回显
getProcessData (taskId) {
enStandardEditGetDataById(taskId).then(res => {
if (res.success) {
this.model = res.result
this.$nextTick(() => {
// 初始化流程信息
this.processInfoForm.setFieldsValue(pick(this.model[0], 'prcName', 'dueTime', 'prcMes'))
// 初始化流程审批信息,todo:需要判断是不是草稿进来的,草稿进来的才回显审批信息
// this.approvalInfoForm.setFieldsValue(pick(this.model[0], 'commitText', 'commitFile'))
})
// 初始化业务基本信息中组件内容
} else {
this.$message.warning(res.message)
}
})
},
switchChange (value) {
this.switchValue = value
},
// 标准化审核节点是否可进行评审会修改
// 标准化审核节点是否可进行评审会修改,需要修改备注的是否必填和同意、驳回按钮是否可用
standardizationAuditIsMeeting (value) {
// 选是的话,驳回按钮置灰,不可点击;选否,备注变成必填,内容自动带入“驳回”,下方同意按钮置灰,不可点击
if (value === 1) {
@@ -416,17 +383,29 @@ export default {
// 流程审批信息
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
}
}
const personnelObj = this.$refs.personnelInfo.getDataObj()
// 需要传给后端的
const paramObj = {}
paramObj.common = { ...processInfoForm, ...approvalInfoForm }
paramObj.flowUser = personnelObj
// 业务基本信息
if (this.$refs.basicInfoFormRef) {
if (this.$refs.baseInfoRef) {
// 业务基本信息
const baseInfo = this.$refs.baseInfoRef.getData()
const param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj, ...baseInfo.formInline }
const flag = Object.values(param).some(v => !!v || v === 0)
if (!flag || (baseInfo.dataSource && baseInfo.dataSource.length <= 0)) {
// 提示至少填写一项
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
return
}
if (baseInfo.dataSource) {
paramObj.dataList = baseInfo.dataSource.map(item => {
return { ...item, ...baseInfo.formInline }
})
} else {
paramObj.dataList = [baseInfo.formInline]
}
} else {
// 需要外层信息至少填了一项
const param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj }
@@ -437,34 +416,52 @@ export default {
return
}
}
this.loading = true
// 保存到草稿
// enterprisePlanApprovalSave(arr).then(res => {
// if (res.success) {
// this.$message.success(res.message)
// } else {
// this.$message.warning(res.message)
// }
// })
enStandardEditSave(paramObj).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
// 节点一时候的提交,发起变更
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'))
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
return
}
this.processInfoForm.validateFields((err, values) => {
this.approvalInfoForm.validateFields((approvalErr, approvalValues) => {
this.approvalInfoForm.validateFields(async (approvalErr, approvalValues) => {
const data = await this.$refs.baseInfoRef.getDataValidate()
if (!err && !approvalErr && data) {
const param = {} // 需要传给后端的数据
param.common = { ...values, ...approvalValues }
param.flowUser = personnelObj
if (data.dataSource && data.dataSource.length > 0) {
param.dataList = data.dataSource.map(item => {
return { ...item, ...data.formInline }
})
} else {
param.dataList = [data.formInline]
}
enStandardEditApproval(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
}
})
})
},
@@ -482,29 +479,97 @@ export default {
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
// })
enStandardEditTurnTo(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
}
})
},
// 提交
handleSubmit () {
if (this.loading) return
this.approvalInfoForm.validateFields(async (approvalErr, approvalValues) => {
const data = await this.$refs.baseInfoRef.getDataValidate()
if (!approvalErr && data) {
const param = {} // 需要传给后端的数据
param.common = approvalValues
if (data.dataSource && data.dataSource.length > 0) {
param.dataList = data.dataSource.map(item => {
return { ...item, ...data.formInline }
})
} else {
param.dataList = [data.formInline]
}
enStandardEditAgree(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
}
})
},
// 同意
handleAgree () {
if (this.loading) return
this.approvalInfoForm.validateFields((err, values) => {
if (!err) {
this.loading = true
const param = {}
param.common = Object.assign({}, values)
param.common.taskId = this.$route.query.taskId
enStandardEditAgree(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
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.$nextTick(() => {
this.approvalInfoForm.validateFields((err, values) => {
if (!err) {
this.loading = true
const param = {}
param.common = Object.assign({}, values)
param.common.taskId = this.$route.query.taskId
enStandardEditReject(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
this.validatorRules.commitText.rules[0].required = false
})
}
})
})
}
}
}
@@ -1,183 +1,196 @@
<template>
<a-form-model v-if="isFormInline" :model="formInline" class="form-add" :rules="rules" ref="ruleForm">
<div class="collapsible-panel-form">
<div class="form-flex-box collapsible-panel-form-content collapsible-content-no-head">
<!-- 制修订类型 -->
<div class="box-title-text form-flex-item">
<div class="title-text">
<span class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.typeOfRevision')">
{{ $t('workCenter.enterpriseInitChangePlan.typeOfRevision') }}
</span>
</div>
<a-form-model-item class="item-model" prop="typeOfRevision">
<a-select v-model="formInline.typeOfRevision"
:disabled="disabled"
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.typeOfRevision')">
<a-select-option :value="ApplicationCategory.INITIATION.value">{{ $t('workCenter.enterpriseInitChangePlan.standardProjectEstablishment') }}</a-select-option>
<a-select-option :value="ApplicationCategory.CHANGE.value">{{ $t('workCenter.enterpriseInitChangePlan.change') }}</a-select-option>
</a-select>
</a-form-model-item>
</div>
<!-- 是新建流程,新增企标编号字段从企标计划选择 -->
<!-- 企标编号选择企标计划 -->
<div v-if="flowInitType === 'newProcess'" class="box-title-text form-flex-item">
<div class="title-text">
<span class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum')">
{{ $t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum') }}
</span>
</div>
<a-form-model-item class="item-model" prop="applicationCategory">
<enterprise-plan-selection type="radio"
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum')"
v-model="formInline.standardPlanId"
:standard-number="formInline.standard_number"
:disabled="disabled"
@standardNumberChange="standardNumberChange"
@listChange="listChange"/>
</a-form-model-item>
</div>
<!--
标签管理中企标库的基础信息部分字段
1去掉三个代号一个年代号
2加零部件名称和代替标准号
3企标编号如果是自动发起的就带入从新建流程点入的话就从企标计划选择
4从企标计划选择企标编号的话把其他字段也回显
-->
<template v-for="(item, index) of dataList">
<div :key="index" class="box-title-text form-flex-item">
<a-spin :spinning="loading">
<a-form-model v-if="isFormInline" :model="formInline" class="form-add" :rules="rules" ref="ruleForm">
<div class="collapsible-panel-form">
<div class="form-flex-box collapsible-panel-form-content collapsible-content-no-head">
<!-- 制修订类型 -->
<div class="box-title-text form-flex-item">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">
{{ item.dbFieldTxt }}
</span>
<span class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.typeOfRevision')">
{{ $t('workCenter.enterpriseInitChangePlan.typeOfRevision') }}
</span>
</div>
<a-form-model-item class="item-model" prop="applicationCategory">
<!-- 1, 日期单选 -->
<a-date-picker v-if="item.fieldShowType === FieldType.DATE_SINGLE.value"
class="box-input"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
:getCalendarContainer="(trigger) => trigger.parentNode"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
v-model="formInline[item.dbFieldName]"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
style="width: 100%" />
<!-- 2, 单选用户 -->
<user-selection v-else-if="item.fieldShowType === FieldType.USER_SINGLE.value"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
v-model="formInline[item.dbFieldName]"
:filedName="item.dbFieldName"
@nameChange="userSelectNameChange"
:nameStr="formInline[item.dbFieldName + '_dictText']"
type="radio"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)" />
<!-- 3, 单选组织机构 -->
<j-select-depart v-else-if="item.fieldShowType === FieldType.ORGAN_SINGLE.value"
v-model="formInline[item.dbFieldName]"
:backDepart="true" />
<!-- 4, 日期多选 -->
<j-multiple-date-picker v-else-if="item.fieldShowType === FieldType.DATE_MORE.value"
class="box-input"
v-model="formInline[item.dbFieldName]"
:fieldName="item.dbFieldName"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)" />
<!-- 5, 多行文本 -->
<a-textarea v-else-if="item.fieldShowType === FieldType.TEXTAREA.value"
:placeholder="$t('pleaseEnter')+item.dbFieldTxt"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
:maxLength="500"
v-model="formInline[item.dbFieldName]" :rows="4" />
<!-- 6, 标准多选 -->
<standard-selection v-else-if="item.fieldShowType === FieldType.STANDARD_MORE.value"
:source="StandardSource.ENTERPRISE.value"
:disabledSourceSearch="true"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
v-model="formInline[item.dbFieldName]" />
<!-- 7, 多选组织机构 -->
<j-select-depart v-else-if="item.fieldShowType === FieldType.ORGAN_MORE.value"
v-model="formInline[item.dbFieldName]"
:multi="true"
:backDepart="true"
:treeOpera="true" />
<!-- 8, 上传文件 -->
<a-button v-else-if="item.fieldShowType === FieldType.FILE_UP.value" type="primary" class="button-text"
@click="clickButtonToUpload(item)">
{{
(formInline[item.dbFieldName] === 'null' || formInline[item.dbFieldName] === ''
|| formInline[item.dbFieldName] === null || formInline[item.dbFieldName] === undefined)
? $t('uploadFile.clickUpload')
: $t('uploadFile.viewUploadedFiles')
}}
</a-button>
<!-- 9, 文本框 -->
<a-input v-else-if="item.fieldShowType === FieldType.TEXT_BOX.value"
class="box-input"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
v-model.trim="formInline[item.dbFieldName]"
:maxLength="50"
@change="event => event.target.value = event.target.value.trim()"
:placeholder="$t('pleaseEnter')+item.dbFieldTxt" />
<!-- 10, 下拉单选数据字典 -->
<j-dict-select-tag v-else-if="item.fieldShowType === FieldType.OPTION_SINGLE.value"
class="box-input"
v-model="formInline[item.dbFieldName]"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
:type="'select'"
:triggerChange="false"
:dictCode="item.dictField" />
<!-- 11, 下拉多选数据字典 -->
<j-multi-select-tag v-else-if="item.fieldShowType === FieldType.OPTION_MORE.value"
class="box-input"
v-model="formInline[item.dbFieldName]"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
:type="'select'"
:triggerChange="false"
:dictCode="item.dictField" />
<!-- 12, 树选择 -->
<a-tree-select
v-else-if="item.fieldShowType === FieldType.TREE.value"
v-model="formInline[item.dbFieldName]"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
style="width: 100%"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
:tree-data="optionsData[item.dbFieldName]"
tree-checkable
treeCheckStrictly
:label-in-value="false"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt" />
<!-- 14, 年份选择 -->
<j-date v-else-if="item.fieldShowType === FieldType.YEAR_PICKER.value"
show-type="year"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
v-model="formInline[item.dbFieldName]"
:default-value="defaultValue[item.dbFieldName]"
date-format="YYYY"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt" />
<!-- 15, 树选择单选 -->
<a-tree-select v-else-if="item.fieldShowType === FieldType.TREE_SINGLE.value"
v-model="formInline[item.dbFieldName]"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
style="width: 100%"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
:tree-data="optionsData[item.dbFieldName]"
:label-in-value="false"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt" />
<a-form-model-item class="item-model" prop="typeOfRevision">
<j-dict-select-tag
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.typeOfRevision')"
dict-code="esp_revision_type"
disabled
v-model="formInline.typeOfRevision">
</j-dict-select-tag>
</a-form-model-item>
</div>
</template>
<!-- 是新建流程,新增企标编号字段从企标计划选择 -->
<!-- 企标编号选择企标计划 -->
<div v-if="flowInitType === 'newProcess'" class="box-title-text form-flex-item">
<div class="title-text">
<span class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum')">
{{ $t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum') }}
</span>
</div>
<a-form-model-item class="item-model" prop="applicationCategory">
<enterprise-plan-selection type="radio"
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum')"
v-model="formInline.standardPlanId"
:standard-number="formInline.standard_number"
@listChange="listChange"
:disabled="disabled"/>
</a-form-model-item>
</div>
<!--
标签管理中企标库的基础信息部分字段
1去掉三个代号一个年代号
2加零部件名称和代替标准号
3企标编号如果是自动发起的就带入从新建流程点入的话就从企标计划选择
4从企标计划选择企标编号的话把其他字段也回显
-->
<template v-for="(item, index) of dataList">
<div :key="index" class="box-title-text form-flex-item">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">
{{ item.dbFieldTxt }}
</span>
</div>
<a-form-model-item class="item-model" prop="applicationCategory">
<!-- 1, 日期单选 -->
<a-date-picker v-if="item.fieldShowType === FieldType.DATE_SINGLE.value"
class="box-input"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
:getCalendarContainer="(trigger) => trigger.parentNode"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
v-model="formInline[item.dbFieldName]"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
style="width: 100%" />
<!-- 2, 单选用户 -->
<user-selection v-else-if="item.fieldShowType === FieldType.USER_SINGLE.value"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
v-model="formInline[item.dbFieldName]"
:filedName="item.dbFieldName"
@nameChange="userSelectNameChange"
:nameStr="formInline[item.dbFieldName + '_dictText']"
type="radio"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)" />
<!-- 3, 单选组织机构 -->
<j-select-depart v-else-if="item.fieldShowType === FieldType.ORGAN_SINGLE.value"
v-model="formInline[item.dbFieldName]"
:backDepart="true" />
<!-- 4, 日期多选 -->
<j-multiple-date-picker v-else-if="item.fieldShowType === FieldType.DATE_MORE.value"
class="box-input"
v-model="formInline[item.dbFieldName]"
:fieldName="item.dbFieldName"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)" />
<!-- 5, 多行文本 -->
<a-textarea v-else-if="item.fieldShowType === FieldType.TEXTAREA.value"
:placeholder="$t('pleaseEnter')+item.dbFieldTxt"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
:maxLength="500"
v-model="formInline[item.dbFieldName]" :rows="4" />
<!-- 6, 标准多选 -->
<standard-selection v-else-if="item.fieldShowType === FieldType.STANDARD_MORE.value"
:source="StandardSource.ENTERPRISE.value"
:disabledSourceSearch="true"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
v-model="formInline[item.dbFieldName]" />
<!-- 7, 多选组织机构 -->
<j-select-depart v-else-if="item.fieldShowType === FieldType.ORGAN_MORE.value"
v-model="formInline[item.dbFieldName]"
:multi="true"
:backDepart="true"
:treeOpera="true" />
<!-- 8, 上传文件 -->
<a-button v-else-if="item.fieldShowType === FieldType.FILE_UP.value" type="primary" class="button-text"
@click="clickButtonToUpload(item)">
{{
(formInline[item.dbFieldName] === 'null' || formInline[item.dbFieldName] === ''
|| formInline[item.dbFieldName] === null || formInline[item.dbFieldName] === undefined)
? $t('uploadFile.clickUpload')
: $t('uploadFile.viewUploadedFiles')
}}
</a-button>
<!-- 9, 文本框 -->
<a-input v-else-if="item.fieldShowType === FieldType.TEXT_BOX.value"
class="box-input"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
v-model.trim="formInline[item.dbFieldName]"
:maxLength="50"
@change="event => event.target.value = event.target.value.trim()"
:placeholder="$t('pleaseEnter')+item.dbFieldTxt" />
<!-- 10, 下拉单选数据字典 -->
<j-dict-select-tag v-else-if="item.fieldShowType === FieldType.OPTION_SINGLE.value"
class="box-input"
v-model="formInline[item.dbFieldName]"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
:type="'select'"
:triggerChange="false"
:dictCode="item.dictField" />
<!-- 11, 下拉多选数据字典 -->
<j-multi-select-tag v-else-if="item.fieldShowType === FieldType.OPTION_MORE.value"
class="box-input"
v-model="formInline[item.dbFieldName]"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
:type="'select'"
:triggerChange="false"
:dictCode="item.dictField" />
<!-- 12, 树选择 -->
<a-tree-select
v-else-if="item.fieldShowType === FieldType.TREE.value"
v-model="formInline[item.dbFieldName]"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
style="width: 100%"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
:tree-data="optionsData[item.dbFieldName]"
tree-checkable
treeCheckStrictly
:label-in-value="false"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt" />
<!-- 14, 年份选择 -->
<j-date v-else-if="item.fieldShowType === FieldType.YEAR_PICKER.value"
show-type="year"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
v-model="formInline[item.dbFieldName]"
:default-value="defaultValue[item.dbFieldName]"
date-format="YYYY"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt" />
<!-- 15, 树选择单选 -->
<a-tree-select v-else-if="item.fieldShowType === FieldType.TREE_SINGLE.value"
v-model="formInline[item.dbFieldName]"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
style="width: 100%"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
:tree-data="optionsData[item.dbFieldName]"
:label-in-value="false"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt" />
<!--16树形弹框选择-->
<tree-selection v-else-if="item.fieldShowType === FieldType.TREE_MODAL_SELECT.value"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
v-model="formInline[item.dbFieldName]"
@nameChange="treeSelectNameChange"
:filedName="item.dbFieldName"
type="checkbox"
:nameStr="formInline[item.dbFieldName + '_dictText']"
:dict-id="item.dictId"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)" />
</a-form-model-item>
</div>
</template>
</div>
</div>
</div>
<upload-file ref="uploadFile" @change="uploadFileChange" :return-url="false"></upload-file>
</a-form-model>
<upload-file ref="uploadFile" @change="uploadFileChange" :return-url="false"></upload-file>
</a-form-model>
</a-spin>
</template>
<script>
import { getEnterpriseStandardAddForm } from '@/api/enterpriseStandardLibraryApi'
import { StandardSource, FieldType, ApplicationCategory } from '@/enums/commonEnums'
import {
getEnterpriseStandardAddForm
} from '@/api/enterpriseStandardLibraryApi'
import { StandardSource, FieldType, ApplicationCategory, IsTrial } from '@/enums/commonEnums'
import { getAction } from '@/api/manage'
import { getFormDictTreeList } from '@/api/api'
import UserSelection from '@/components/selection/UserSelection'
@@ -185,10 +198,18 @@ import JMultipleDatePicker from '@/components/JMultipleDatePicker'
import StandardSelection from '@/components/selection/StandardSelection'
import UploadFile from '@/components/UploadFile'
import EnterprisePlanSelection from '@/components/selection/EnterprisePlanSelection'
import TreeSelection from '@/components/selection/TreeSelection'
export default {
name: 'BaseInfoForm',
components: { UserSelection, JMultipleDatePicker, StandardSelection, UploadFile, EnterprisePlanSelection },
components: {
UserSelection,
JMultipleDatePicker,
StandardSelection,
UploadFile,
EnterprisePlanSelection,
TreeSelection
},
props: {
// 流程发起类型,是自动发起(auto)的还是从新建流程发起的(newProcess)
flowInitType: {
@@ -197,11 +218,32 @@ export default {
default: ''
}
},
watch: {
// 企标是否试行改变,试行周期必填校验也跟着变
'formInline.try_flag' (val) {
if (val && this.flag === StandardSource.ENTERPRISE.value) {
if (val === IsTrial.YES.value) {
// 试行周期给默认值24
this.formInline.trial_period = '24'
this.formInline = JSON.parse(JSON.stringify(this.formInline))
// 试行,试行周期必填
this.rules.trial_period[0].required = true
} else {
// 试行周期置空
this.formInline.trial_period = undefined
// 不试行,试行周期非必填
this.rules.trial_period[0].required = false
}
}
}
},
data () {
return {
StandardSource,
FieldType,
ApplicationCategory,
loading: false,
dataList: [],
isFormInline: false, // 是否展示表单
disabledFieldList: ['standard_number'], // 不可修改字段
formInline: {},
@@ -214,6 +256,18 @@ export default {
this.getForm()
},
methods: {
// 外层获取数据要过校验,返回false表示没有通过校验
async getDataValidate () {
let data = {}
await this.$refs.ruleForm.validate(valid => {
if (valid) {
data.formInline = this.formInline
} else {
data = false
}
})
return data
},
// 获取表单列表
getForm (callBack) {
this.confirmLoading = true
@@ -227,23 +281,10 @@ export default {
// 1、去掉三个代号一个年代号
dataList = dataList.filter(item => !['standard_code', 'name_code', 'category_code', 'year_number', 'standard_state'].includes(item.dbFieldName))
// 2、加零部件名称和代替标准号
dataList.push({
dbFieldEnName: 'Part name',
dbFieldName: 'part_name',
dbFieldNameOld: 'part_name',
dbFieldTxt: '零部件名称',
dictId: '1696821512600637441',
fieldMustInput: '1',
fieldShowType: '15'
})
dataList.push({
dbFieldEnName: 'Substitute Standard Number',
dbFieldName: 'substitute_standard_number',
dbFieldNameOld: 'substitute_standard_number',
dbFieldTxt: '代替标准号',
fieldMustInput: '0',
fieldShowType: '6'
})
const partName = res.result.适用范围.find(item => item.dbFieldName === 'part_name')
const substituteStandardNumber = res.result.关联信息.find(item => item.dbFieldName === 'substitute_standard_number')
dataList.push(partName)
dataList.push(substituteStandardNumber)
// 3、企标编号如果是自动发起的就带入(文本框),从新建流程点入的话就从企标计划选择(选择企标计划组件)
if (this.flowInitType === 'newProcess') {
// 是新建流程,删除企标编号字段,在html中设置显示企标计划选择
@@ -273,13 +314,6 @@ export default {
message: res.dbFieldTxt + this.$t('cannotEmpty'),
trigger: 'blur'
})
} else if (res.fieldShowType === FieldType.DATE_SINGLE.value) {
// 解决第一次校验不消失的问题
rule.push({
required: true,
message: res.dbFieldTxt + this.$t('cannotEmpty'),
trigger: ['change', 'blur']
})
} else {
rule.push({
required: true,
@@ -287,6 +321,20 @@ export default {
trigger: 'change'
})
}
} else {
if ([FieldType.TEXT_BOX.value, FieldType.TEXTAREA.value].includes(res.fieldShowType)) {
rule.push({
required: false,
message: res.dbFieldTxt + this.$t('cannotEmpty'),
trigger: 'blur'
})
} else {
rule.push({
required: false,
message: res.dbFieldTxt + this.$t('cannotEmpty'),
trigger: 'change'
})
}
}
if (rule.length > 0) {
rules[res.dbFieldName] = rule
@@ -321,29 +369,22 @@ export default {
})
},
// 4、从企标计划选择企标编号的话,把其他字段也回显
standardNumberChange (value) {
this.formInline.standard_number = value
},
// 企标计划选择列表的回调
listChange (value) {
// 企标名称
// 标准英文名称
// 标准等级分类
// 企标体系
// 零部件名称
// 授权部门
// 代替标准号
// 发布日期
// 实施日期
// 是否试行
// 试行周期
// 编制说明
console.log(value)
// 回显企标编号
this.formInline.standard_number = value[0].newEnStandardNo
// 回显制修订类型
this.formInline.typeOfRevision = value[0].applicationCategory
},
// 点击点击上传按钮
clickButtonToUpload (item) {
this.$refs.uploadFile.open(this.formInline[item.dbFieldName])
this.uploadName = item.dbFieldName
},
// 树弹框选择改变
treeSelectNameChange (value, fieldName) {
this.formInline[fieldName + '_dictText'] = value
},
// 文件上传改变后的回调
uploadFileChange (data) {
const attIdList = []
@@ -355,7 +396,7 @@ export default {
/** 赋值给当前对应的表单文件 */
this.formInline[this.uploadName] = attIdList.join(',')
this.formInline = { ...this.formInline }
},
}
}
}
</script>
@@ -111,7 +111,6 @@ export default {
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 给表格赋值,在线编辑不知道要怎么赋值?
// this.dataSource =
// 给表单赋值
@@ -105,7 +105,6 @@ export default {
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 给表单赋值,在线编辑不知道要怎么赋值?
// this.formInline =
// 给表单赋值
@@ -117,18 +116,20 @@ export default {
getData () {
// 把数据抛出,在线编辑不知道要不要抛
const data = {}
data.isCommentsFormInline = this.formInline
data.formInline = this.formInline
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate () {
this.$refs.ruleForm.validate(valid => {
async getDataValidate () {
let data = {}
await this.$refs.ruleForm.validate(valid => {
if (valid) {
const data = {}
data.isCommentsFormInline = this.formInline
return data
data.formInline = this.formInline
} else {
data = false
}
})
return data
},
// 选择用户得到用户名
userSelectNameChange (value, fieldName) {
@@ -149,7 +149,6 @@ export default {
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 给表格赋值,在线编辑不知道要怎么赋值?
// this.dataSource =
// 给表单赋值
@@ -165,15 +164,22 @@ export default {
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate () {
if (this.dataSource && this.dataSource.length > 0) {
const data = {}
data.dataSource = this.dataSource
return data
} else {
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
return false
}
async getDataValidate () {
let data = {} // 需要返回的数据
await this.$refs.ruleForm.validate(valid => {
if (valid) {
if (this.dataSource && this.dataSource.length > 0) {
data.dataSource = this.dataSource
data.formInline = this.formInline
} else {
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
data = false
}
} else {
data = false
}
})
return data
},
// 征求意见的编辑
handleEdit (record, index) {
@@ -19,7 +19,7 @@
</div>
</a-form-model-item>
</div>
<!-- 征求意见截止日期 -->
<!-- 征求意见截止日期,限制要比计划的时间早 -->
<div class="box-title-text form-flex-item">
<div class="title-text title-text-long">
<span class="required">*</span>
@@ -100,7 +100,6 @@ export default {
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 给表单赋值,在线编辑不知道要怎么赋值?
// this.formInline =
// 给表单赋值
@@ -112,18 +111,20 @@ export default {
getData () {
// 把数据抛出,在线编辑不知道要不要抛
const data = {}
data.issueFormInline = this.formInline
data.formInline = this.formInline
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate () {
this.$refs.ruleForm.validate(valid => {
async getDataValidate () {
let data = {}
await this.$refs.ruleForm.validate(valid => {
if (valid) {
const data = {}
data.issueFormInline = this.formInline
return data
data.formInline = this.formInline
} else {
data = false
}
})
return data
},
// 选择用户得到用户名
userSelectNameChange (value, fieldName) {
@@ -118,7 +118,6 @@ export default {
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 给表格赋值,在线编辑不知道要怎么赋值?
// this.dataSource =
// 给表单赋值
@@ -170,12 +170,14 @@ export default {
break
}
}
let data = {} // 需要返回的数据
if (hasErr) {
this.$message.warning(this.$t('workCenter.enStandardRevision.pleaseEnterAllMarkItem'))
return false
data = false
} else {
return this.dataSource
data.dataSource = this.dataSource
}
return data
},
// 新增征求意见
handleAdd () {
@@ -301,7 +301,6 @@ export default {
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 给表格赋值,在线编辑不知道要怎么赋值?
// this.drafterDataSource =
// this.dataSource =
@@ -316,25 +315,27 @@ export default {
// 把数据抛出,在线编辑不知道要不要抛
const data = {}
data.dataSource = this.dataSource
data.uploadMinuteFormInline = this.formInline
data.formInline = this.formInline
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate () {
this.$refs.ruleForm.validate(valid => {
async getDataValidate () {
let data = {}
await this.$refs.ruleForm.validate(valid => {
if (valid) {
if (this.dataSource && this.dataSource.length > 0) {
// 有数据可以抛出
const data = {}
data.dataSource = this.dataSource
data.uploadMinuteFormInline = this.formInline
return data
data.formInline = this.formInline
} else {
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
return false
data = false
}
} else {
data = false
}
})
return data
},
// 查看企标文本
handleLookUploadStandard (record) {
@@ -99,7 +99,6 @@ export default {
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 给表单赋值,在线编辑不知道要怎么赋值?
// this.formInline =
// 给表单赋值
@@ -111,18 +110,20 @@ export default {
getData () {
// 把数据抛出,在线编辑不知道要不要抛
const data = {}
data.publishFormInline = this.formInline
data.formInline = this.formInline
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate () {
this.$refs.ruleForm.validate(valid => {
async getDataValidate () {
let data = {}
await this.$refs.ruleForm.validate(valid => {
if (valid) {
const data = {}
data.publishFormInline = this.formInline
return data
data.formInline = this.formInline
} else {
data = false
}
})
return data
}
}
}
@@ -107,14 +107,12 @@ export default {
],
dataSource: [],
loading: false,
data: {}, // 初始化获取的数据
modalType: undefined // 当前是新增还是编辑编辑的话是edit+编辑行的下标
}
},
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 给表格赋值,在线编辑不知道要怎么赋值?
// this.dataSource =
// 给表单赋值
@@ -132,11 +130,12 @@ export default {
},
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate () {
if (this.dataSource && this.dataSource.length > 0) {
const formData = this.$refs.baseInfoForm.getDataValidate()
if (formData && this.dataSource && this.dataSource.length > 0) {
// 有数据可以抛出
const data = {}
data.dataSource = this.dataSource
data.formInline = this.$refs.baseInfoForm.formInline
data.formInline = formData.formInline
return data
} else {
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
@@ -274,14 +274,16 @@ export default {
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate () {
this.$refs.ruleForm.validate(valid => {
async getDataValidate () {
let data = {}
await this.$refs.ruleForm.validate(valid => {
if (valid) {
const data = {}
data.uploadMinuteFormInline = this.formInline
return data
data.formInline = this.formInline
} else {
data = false
}
})
return data
},
// 点击文件上传
clickButtonToUpload (fieldName) {
@@ -27,7 +27,6 @@ export default {
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 在线编辑不知道要怎么赋值?
// 给表单赋值
// this.$nextTick(() => {
@@ -96,7 +96,6 @@ export default {
}
],
loading: false,
data: {}, // 初始化获取的数据
userInfo: {}, // 当前登录人信息
currentDate: '',
uploadIndex: undefined // 正在上传企标的下标
@@ -109,7 +108,6 @@ export default {
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 给表格赋值,在线编辑不知道要怎么赋值?
// this.dataSource =
// 给表单赋值
@@ -124,6 +122,7 @@ export default {
},
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate () {
let data = {}// 需要返回的值
if (this.dataSource && this.dataSource.length > 0) {
// 看能上传企标的行是否都上传了
let hasErr = false
@@ -136,11 +135,14 @@ export default {
// 根据hasErr看有没有通过校验
if (hasErr) {
this.$message.warning(this.$t('workCenter.enStandardRevision.pleaseUploadStandard'))
return false
data = false
} else {
return this.dataSource
data.dataSource = this.dataSource
}
} else {
data = false
}
return data
},
// 上传企标
handleUploadStandard (record, index) {
@@ -280,7 +280,6 @@ export default {
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 给表格赋值,在线编辑不知道要怎么赋值?
// this.dataSource =
// 给表单赋值
@@ -304,12 +303,14 @@ export default {
break
}
}
let data = {} // 需要返回的数据
if (hasErr) {
this.$message.warning(this.$t('workCenter.enStandardRevision.pleaseEnterAllMarkItem'))
return false
data = false
} else {
return this.dataSource
data.dataSource = this.dataSource
}
return data
},
}
}
@@ -177,7 +177,6 @@ export default {
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 给表格赋值,在线编辑不知道要怎么赋值?
// this.formInline =
// 给表单赋值
@@ -189,18 +188,20 @@ export default {
getData () {
// 把数据抛出,在线编辑不知道要不要抛
const data = {}
data.standardAuditFormInline = this.formInline
data.formInline = this.formInline
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate () {
let data = {} // 要返回的数据
this.$refs.ruleForm.validate(valid => {
if (valid) {
const data = {}
data.standardAuditFormInline = this.formInline
return data
data.formInline = this.formInline
} else {
data = false
}
})
return data
},
// 是否可进行评审会
isCanAuditMeetingChange () {