[add] 修改企标复审流程,增加企标废止流程,企标封存流程,已封存企标启用流程

This commit is contained in:
lideqin
2023-10-27 15:17:26 +08:00
parent a6f1bf9b75
commit cf44116037
15 changed files with 2366 additions and 8 deletions
+63
View File
@@ -81,6 +81,48 @@ const enStandardRecheckAgree = (params) => postAction('', params)
// 驳回
const enStandardRecheckReject = (params) => postAction('', params)
// 企标废止流程
// 根据id查询流程数据--办理
const enStandardAnnulGetDataById = (params) => getAction('', params)
// 保存
const enStandardAnnulSave = (params) => postAction('', params)
// 发起
const enStandardAnnulApproval = (params) => postAction('', params)
// 转办
const enStandardAnnulTurnTo = (params) => postAction('', params)
// 同意
const enStandardAnnulAgree = (params) => postAction('', params)
// 驳回
const enStandardAnnulReject = (params) => postAction('', params)
// 企标封存流程
// 根据id查询流程数据--办理
const enStandardSealSaveGetDataById = (params) => getAction('', params)
// 保存
const enStandardSealSaveSave = (params) => postAction('', params)
// 发起
const enStandardSealSaveApproval = (params) => postAction('', params)
// 转办
const enStandardSealSaveTurnTo = (params) => postAction('', params)
// 同意
const enStandardSealSaveAgree = (params) => postAction('', params)
// 驳回
const enStandardSealSaveReject = (params) => postAction('', params)
// 已封存企标启用流程
// 根据id查询流程数据--办理
const enStandardStartUseGetDataById = (params) => getAction('', params)
// 保存
const enStandardStartUseSave = (params) => postAction('', params)
// 发起
const enStandardStartUseApproval = (params) => postAction('', params)
// 转办
const enStandardStartUseTurnTo = (params) => postAction('', params)
// 同意
const enStandardStartUseAgree = (params) => postAction('', params)
// 驳回
const enStandardStartUseReject = (params) => postAction('', params)
// 流程中心
// 待办-转办
const toDoTurnTo = (params) => postAction('', params)
@@ -128,6 +170,27 @@ export {
enStandardRecheckAgree,
enStandardRecheckReject,
enStandardAnnulGetDataById,
enStandardAnnulSave,
enStandardAnnulApproval,
enStandardAnnulTurnTo,
enStandardAnnulAgree,
enStandardAnnulReject,
enStandardSealSaveGetDataById,
enStandardSealSaveSave,
enStandardSealSaveApproval,
enStandardSealSaveTurnTo,
enStandardSealSaveAgree,
enStandardSealSaveReject,
enStandardStartUseGetDataById,
enStandardStartUseSave,
enStandardStartUseApproval,
enStandardStartUseTurnTo,
enStandardStartUseAgree,
enStandardStartUseReject,
toDoTurnTo,
compulsoryWithdrawal
}
+14
View File
@@ -174,6 +174,20 @@ module.exports = {
annul: '废止',
sealSave: '封存'
},
// 企标废止流程
enStandardAnnul: {
substituteStandardNumber: '代替企标编号',
replacedByEnStandardNumber: '被代替企标编号',
annulReason: '废止理由'
},
// 企标封存流程
enStandardSealSave: {
sealSaveReason: '封存理由'
},
// 已封存企标启用流程
enStandardStartUse: {
startUseReason: '启用理由'
},
// 流程配置
processConfig: {
processType: '流程类型',
+14
View File
@@ -174,6 +174,20 @@ module.exports = {
annul: '废止',
sealSave: '封存'
},
// 企标废止流程
enStandardAnnul: {
substituteStandardNumber: '代替企标编号',
replacedByEnStandardNumber: '被代替企标编号',
annulReason: '废止理由'
},
// 企标封存流程
enStandardSealSave: {
sealSaveReason: '封存理由'
},
// 已封存企标启用流程
enStandardStartUse: {
startUseReason: '启用理由'
},
// 流程配置
processConfig: {
processType: '流程类型',
+3 -3
View File
@@ -75,15 +75,15 @@ export default {
},
{ // 企标废止流程
title: this.$t('workCenter.newProcess.processOfEnterpriseBidAnnulment'),
path: ''
path: '/workCenter/enterpriseStandardAnnul/enterpriseStandardAnnulFlow'
},
{ // 企标封存流程
title: this.$t('workCenter.newProcess.processOfSealingEnterpriseStandard'),
path: ''
path: '/workCenter/enterpriseStandardSealSave/enterpriseStandardSealSaveFlow'
},
{ // 已封存企标启用流程
title: this.$t('workCenter.newProcess.theSealedEnterpriseBidHasBeenActivatedProcess'),
path: ''
path: '/workCenter/enterpriseStandardStartUse/enterpriseStandardStartUseFlow'
},
{ // 企标稽查计划
title: this.$t('workCenter.newProcess.enterpriseStandardAuditPlan'),
@@ -0,0 +1,439 @@
<template>
<internal-detail-page :title="pageTitle" :content-padding="0">
<!-- 标题右侧tab -->
<template v-slot:titleRightCustom>
<div class="table-operator-tab">
<a class="switch-item" :class="switchValue === 'base' ? 'table-operator-tab-active' : ''"
@click="switchChange('base')">{{ $t('basicInformation') }}
</a>
<a class="switch-item" :class="switchValue === 'user' ? 'table-operator-tab-active' : ''"
@click="switchChange('user')">{{ $t('personalInformation') }}
</a>
</div>
</template>
<!-- 基础信息 -->
<div v-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')">
<a-input :placeholder="$t('pleaseEnter') + $t('processName')"
@change="event => event.target.value = event.target.value.trim()"
disabled
:maxLength="50"
v-decorator="['processName', validatorRules.processName]" />
</a-form-item>
</a-col>
<a-col :span="12">
<!-- 截止日期 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('expirationDate')">
<a-date-picker :placeholder="$t('pleaseSelect') + $t('expirationDate')"
style="width: 100%"
:disabled="disabled"
value-format="YYYY-MM-DD"
v-decorator="['deadlineDate']" />
</a-form-item>
</a-col>
<a-col :span="24">
<!-- 流程说明 -->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('processExplain')">
<a-textarea :placeholder="$t('pleaseEnter') + $t('processExplain')"
:maxLength="500"
:rows="4"
:disabled="disabled"
v-decorator="['processDescription']" />
</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标准化审批 -->
<base-info-form v-else ref="baseInfoRef" disabled></base-info-form>
<!-- 流程审批信息 -->
<div class="process-part-title" v-if="!onlyLook">{{ $t('processApprovalInformation') }}</div>
<a-form :form="approvalInfoForm" v-if="!onlyLook">
<!--备注-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('remarks')">
<a-textarea :placeholder="$t('pleaseEnter') + $t('remarks')"
:maxLength="500"
:rows="4"
v-decorator="['remarks', validatorRules.remarks]" />
</a-form-item>
<!--附件-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('businessSupport.questionAnswer.attach')">
<j-upload v-decorator="['attachment']" return-id />
</a-form-item>
</a-form>
</div>
<!-- 人员信息 -->
<div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0">
<process-detail-list :url="url">
<personnel-info slot="personnelInfo" ref="personnelInfo" :data="personnelInfoData" :currentNode="currentNode + ''"></personnel-info>
</process-detail-list>
</div>
<!-- 操作按钮 -->
<div class="detail-page-bottom-operate-box" v-if="!onlyLook">
<!-- 发起节点 -->
<template v-if="currentNode === 1">
<!-- 保存 -->
<a-button type="primary" ghost :loading="loading" @click="handleSave"><i class="iconfont icon-save"></i> {{ $t('preservation') }}</a-button>
<!-- 提交 -->
<a-button type="primary" :loading="loading" @click="handleStart" icon="upload">{{ $t('submit') }}</a-button>
</template>
<template v-else>
<!-- 转办 -->
<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 { USER_INFO } from '@/store/mutation-types'
import Vue from 'vue'
import pick from 'lodash.pick'
import {
enStandardAnnulGetDataById,
enStandardAnnulSave,
enStandardAnnulApproval,
enStandardAnnulTurnTo,
enStandardAnnulAgree,
enStandardAnnulReject
} from '@/api/workCenter'
import BaseInfoForm from './modules/BaseInfoForm'
// 人员信息
const personalInfo = [ // 人员信息的数据
{
id: 1,
nodeName: '发起人发起',
nodeRoleName: '发起人',
canChoose: false,
userList: Vue.ls.get(USER_INFO).realname + '(' + Vue.ls.get(USER_INFO).username + ')'
},
{
id: 2,
nodeName: '相关人员会签',
nodeRoleName: '相关人员',
canChoose: true,
chooseType: 'checkbox',
fieldName: ''
},
{
id: 3,
nodeName: '起草人和会签人主管级领导审批',
nodeRoleName: '起草人和会签人主管级领导',
canChoose: true,
chooseType: 'radio',
fieldName: ''
},
{
id: 4,
nodeName: '标准化审批',
nodeRoleName: '标准化',
canChoose: true,
chooseType: 'radio',
fieldName: ''
}
]
export default {
name: 'EnterpriseStandardAnnulFlow',
components: {
BaseInfoForm,
InternalDetailPage,
ProcessDetailList,
PersonnelInfo,
UserSelectModal
},
computed: {
pageTitle () {
return this.$t('flowCenter') + this.$route.meta.title
}
},
mounted () {
if (this.$route.query.processId) {
this.currentNode = 2 // todo: 先设置一个假数据,后端还不能返回当前节点
// 有流程id说明是从流程中心来的,需要初始化数据
this.getProcessData(this.$route.query.taskId)
}
if (this.currentNode === 1) {
this.personnelInfoData = personalInfo
this.disabled = false
} else {
this.personnelInfoData = personalInfo.map(item => {
return { ...item, canChoose: false, fieldName: undefined }
})
this.disabled = true
}
// 如果是查看进入的,不可编辑,不可操作
if (this.$route.query.onlyLook) {
this.onlyLook = this.$route.query.onlyLook
this.disabled = this.$route.query.onlyLook
}
},
data () {
return {
loading: false,
switchValue: 'base', // 头部tab选中值
disabled: false,
onlyLook: false, // 是否仅查看
currentNode: 1, // 当前节点
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: {
// 流程名称
processName: {
rules: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('processName') }
],
validateTrigger: 'blur'
},
remarks: {
rules: [
{ required: false, message: this.$t('pleaseEnter') + this.$t('remarks') }
],
validateTrigger: 'blur'
}
},
formInline: {},
approvalInfoForm: this.$form.createForm(this), // 审批信息表单
personnelInfoData: [],
url: {
list: '' // 人员信息的右侧表格获取接口
}
}
},
methods: {
// 根据流程id获取数据并回显
getProcessData (taskId) {
enStandardAnnulGetDataById({ taskId: taskId }).then(res => {
if (res.success) {
this.model = res.result
this.$nextTick(() => {
// 初始化流程信息
this.processInfoForm.setFieldsValue(pick(this.model[0], 'processName', 'deadlineDate', 'processDescription'))
// 初始化流程审批信息,todo:需要判断是不是草稿进来的,草稿进来的才回显审批信息
// this.approvalInfoForm.setFieldsValue(pick(this.model[0], 'remarks', 'attachment'))
})
// 初始化人员信息 todo: 发起人还没处理
this.personnelInfoData = personalInfo.map(item => {
if (item.fieldName) {
return { ...item, userList: this.model[0][item.fieldName + '_dictText'], canChoose: false }
} else {
return item
}
})
// 初始化业务基本信息中组件内容
} else {
this.$message.warning(res.message)
}
})
},
// 头部tab改变
switchChange (value) {
this.switchValue = value
},
// 业务基本信息组件中获取到流程名称改变后的值
processNameChange (value) {
const param = { processName: value }
this.$nextTick(() => {
this.processInfoForm.setFieldsValue(pick(param, 'processName'))
})
},
// 保存
handleSave () {
// 有任意一项填了即可
// 流程信息表单
const processInfoForm = this.processInfoForm.getFieldsValue()
// 流程审批信息
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 arr = []
// 业务基本信息
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
}
arr.push(param)
this.loading = true
// 保存到草稿
enStandardAnnulSave(arr).then(res => {
if (res.success) {
this.$message.success(res.message)
} 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'))
return
}
// 流程信息的校验
this.processInfoForm.validateFields((err, values) => {
// 流程审批信息的校验
this.approvalInfoForm.validateFields((approvalErr, approvalValues) => {
this.$refs.baseInfoRef.getDataValidate(data => {
if (!err && !approvalErr && data) {
const arr = [] // 需要传给后端的数据
enStandardAnnulApproval(arr).then(res => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
}
})
})
})
},
// 转办
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
enStandardAnnulTurnTo(param).then(res => {
if (res.success) {
this.$message.success(res.message)
} 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 = Object.assign({}, values)
param.taskId = this.$route.query.taskId
enStandardAnnulAgree(param).then(res => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
}
})
},
// 驳回
handleReject () {
if (this.loading) return
this.validatorRules.remarks.rules[0].required = true
if (!this.approvalInfoForm.getFieldValue('remarks')) {
this.$message.warning(this.$t('pleaseEnterRemarks'))
}
this.$nextTick(() => {
this.approvalInfoForm.validateFields((err, values) => {
if (!err) {
this.loading = true
const param = Object.assign({}, values)
param.taskId = this.$route.query.id
enStandardAnnulReject(param).then(res => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
this.validatorRules.remarks.rules[0].required = false
})
}
})
})
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
</style>
@@ -0,0 +1,241 @@
<template>
<a-form-model :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.enterpriseStandardNum')">
{{ $t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum') }}
</span>
</div>
<a-form-model-item class="item-model" prop="enStandardNo">
<standard-selection :source="StandardSource.ENTERPRISE.value"
:disabled="disabled"
:disabledSourceSearch="true"
type="radio"
v-model="formInline.enStandardNo"
@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('workCenter.enterpriseInitChangePlan.enterpriseStandardName')">
{{ $t('workCenter.enterpriseInitChangePlan.enterpriseStandardName') }}
</span>
</div>
<a-form-model-item class="item-model" prop="enStandardName">
<a-input class="box-input"
v-model="formInline.enStandardName"
:maxLength="50"
disabled
@change="event => event.target.value = event.target.value.trim()"
:placeholder="$t('pleaseEnter')+$t('workCenter.enterpriseInitChangePlan.enterpriseStandardName')" />
</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.enterpriseInitChangePlan.standardEnglishName')">
{{ $t('workCenter.enterpriseInitChangePlan.standardEnglishName') }}
</span>
</div>
<a-form-model-item class="item-model" prop="enStandardEnglishName">
<a-input class="box-input"
disabled
v-model="formInline.enStandardEnglishName"
:maxLength="50"
@change="event => event.target.value = event.target.value.trim()"
:placeholder="$t('pleaseEnter')+$t('workCenter.enterpriseInitChangePlan.standardEnglishName')" />
</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.enterpriseInitChangePlan.standardType')">
{{ $t('workCenter.enterpriseInitChangePlan.standardType') }}
</span>
</div>
<a-form-model-item class="item-model" prop="standardType">
<j-dict-select-tag class="box-input"
disabled
v-model="formInline.standardType"
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.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="title-text-text" :title="$t('workCenter.enStandardAnnul.substituteStandardNumber')">
{{ $t('workCenter.enStandardAnnul.substituteStandardNumber') }}
</span>
</div>
<a-form-model-item class="item-model" prop="substituteStandardNumber">
<a-input class="box-input"
disabled
v-model="formInline.substituteStandardNumber"
:maxLength="50"
@change="event => event.target.value = event.target.value.trim()"
:placeholder="$t('pleaseEnter')+$t('workCenter.enStandardAnnul.substituteStandardNumber')" />
</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.enStandardAnnul.replacedByEnStandardNumber')">
{{ $t('workCenter.enStandardAnnul.replacedByEnStandardNumber') }}
</span>
</div>
<a-form-model-item class="item-model" prop="replacedByEnStandardNumber">
<a-input class="box-input"
disabled
v-model="formInline.replacedByEnStandardNumber"
:maxLength="50"
@change="event => event.target.value = event.target.value.trim()"
:placeholder="$t('pleaseEnter')+$t('workCenter.enStandardAnnul.replacedByEnStandardNumber')" />
</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.enStandardChange.releaseDate')">
{{ $t('workCenter.enStandardChange.releaseDate') }}
</span>
</div>
<a-form-model-item class="item-model" prop="releaseDate">
<a-date-picker
v-model="formInline.releaseDate"
: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="title-text-text" :title="$t('workCenter.enStandardChange.materialDate')">
{{ $t('workCenter.enStandardChange.materialDate') }}
</span>
</div>
<a-form-model-item class="item-model" prop="materialDate">
<a-date-picker
v-model="formInline.materialDate"
: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.enStandardAnnul.annulReason')">
{{ $t('workCenter.enStandardAnnul.annulReason') }}
</span>
</div>
<a-form-model-item class="item-model" prop="annulReason">
<a-textarea :placeholder="$t('pleaseEnter')+$t('workCenter.enStandardAnnul.annulReason')"
:disabled="disabled"
:maxLength="500"
v-model="formInline.annulReason" :rows="4" />
</a-form-model-item>
</div>
</div>
</div>
</a-form-model>
</template>
<script>
import { StandardSource } from '@/enums/commonEnums'
import StandardSelection from '@/components/selection/StandardSelection'
export default {
name: 'BaseInfoForm',
components: { StandardSelection },
props: {
disabled: {
type: Boolean,
required: false,
default: false
}
},
data () {
return {
StandardSource,
formInline: {},
rules: {
// 企标编号
enStandardNo: [
{
required: true,
message: this.$t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
// 废止理由
annulReason: [
{
required: true,
message: this.$t('workCenter.enStandardAnnul.annulReason') + this.$t('cannotEmpty'),
trigger: 'blur'
}
]
}
}
},
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 给表单赋值
// this.formInline =
},
// 外层要获取数据
getData () {
// 把数据抛出,在线编辑不知道要不要抛
const data = {}
data.formInline = this.formInline
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate (callback) {
this.$refs.ruleForm.validate(valid => {
if (valid) {
const data = {}
data.formInline = this.formInline
callback(data)
}
})
},
// 选完企标编号了,需要回显内容,返回流程名称
listChange (value) {
console.log(value)
// 企标名称
this.formInline.enStandardName = value[0].standardName
// 英文名称
// 企标类别
// 代替企标编号
// 被代替企标编号
// 实施日期
// 复审日期
this.$emit('processNameChange', (this.formInline.enStandardNo || '') + '-' + (this.formInline.enStandardName || '') + '-' + '废止')
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
.collapsible-content-no-head {
border-top: 1px solid #E5E6EB;
border-radius: 8px 8px 8px 8px;
}
</style>
@@ -54,13 +54,14 @@
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
<!-- 节点1发起人发起 -->
<!-- 是联络人发起 -->
<contact-init-base-info v-if="currentNode === 1 && initRole === 'contact'" ref="baseInfoRef"></contact-init-base-info>
<contact-init-base-info v-if="currentNode === 1 && initRole === 'contact'" ref="baseInfoRef" @processNameChange="processNameChange"></contact-init-base-info>
<!-- 是标准化发起 -->
<standardization-init-base-info v-if="currentNode === 1 && initRole === 'standardization'" ref="baseInfoRef"></standardization-init-base-info>
<standardization-init-base-info v-else-if="currentNode === 1 && initRole === 'standardization'" ref="baseInfoRef" @processNameChange="processNameChange"></standardization-init-base-info>
<!-- 节点2起草人填写意见 -->
<drafter-enter-option-base-info v-if="currentNode === 2" ref="baseInfoRef"></drafter-enter-option-base-info>
<drafter-enter-option-base-info v-else-if="currentNode === 2" ref="baseInfoRef"></drafter-enter-option-base-info>
<!-- 节点3起草人部长审批 -->
<!-- 节点4标准化审批 -->
<recheck-approve-base-info v-else-if="currentNode === 3 || currentNode === 4" ref="baseInfoRef"></recheck-approve-base-info>
<!-- 流程审批信息 -->
<div class="process-part-title" v-if="!onlyLook">{{ $t('processApprovalInformation') }}</div>
@@ -138,6 +139,7 @@ import {
import ContactInitBaseInfo from './modules/ContactInitBaseInfo'
import StandardizationInitBaseInfo from './modules/StandardizationInitBaseInfo'
import DrafterEnterOptionBaseInfo from './modules/DrafterEnterOptionBaseInfo'
import RecheckApproveBaseInfo from './modules/RecheckApproveBaseInfo'
// 人员信息
const personalInfo = [ // 人员信息的数据
@@ -177,6 +179,7 @@ const personalInfo = [ // 人员信息的数据
export default {
name: 'EnterpriseStandardRecheckFlow',
components: {
RecheckApproveBaseInfo,
DrafterEnterOptionBaseInfo,
StandardizationInitBaseInfo,
ContactInitBaseInfo,
@@ -219,7 +222,7 @@ export default {
switchValue: 'base', // 头部tab选中值
disabled: false,
onlyLook: false, // 是否仅查看
currentNode: 2, // 当前节点
currentNode: 1, // 当前节点
initRole: 'standardization', // 发起角色,发起的时候角色不一样表单不一样,contact联络人发起,standardization标准化发起
model: [],
processInfoForm: this.$form.createForm(this),
@@ -149,6 +149,29 @@ export default {
}
},
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 给表单赋值
// this.formInline =
},
// 外层要获取数据
getData () {
// 把数据抛出,在线编辑不知道要不要抛
const data = {}
data.formInline = this.formInline
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate (callback) {
this.$refs.ruleForm.validate(valid => {
if (valid) {
const data = {}
data.formInline = this.formInline
callback(data)
}
})
},
// 选完企标编号了,需要回显内容,返回流程名称
listChange (value) {
console.log(value)
@@ -175,6 +175,31 @@ export default {
]
}
}
},
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 给表单赋值
// this.formInline =
},
// 外层要获取数据
getData () {
// 把数据抛出,在线编辑不知道要不要抛
const data = {}
data.formInline = this.formInline
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate (callback) {
this.$refs.ruleForm.validate(valid => {
if (valid) {
const data = {}
data.formInline = this.formInline
callback(data)
}
})
},
}
}
</script>
@@ -0,0 +1,159 @@
<template>
<a-form-model :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="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum')">
{{ $t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum') }}
</span>
</div>
<a-form-model-item class="item-model" prop="enStandardNo">
<standard-selection :source="StandardSource.ENTERPRISE.value"
disabled
:disabledSourceSearch="true"
type="radio"
v-model="formInline.enStandardNo" />
</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.enterpriseInitChangePlan.enterpriseStandardName')">
{{ $t('workCenter.enterpriseInitChangePlan.enterpriseStandardName') }}
</span>
</div>
<a-form-model-item class="item-model" prop="enStandardName">
<a-input class="box-input"
v-model="formInline.enStandardName"
:maxLength="50"
disabled
@change="event => event.target.value = event.target.value.trim()"
:placeholder="$t('pleaseEnter')+$t('workCenter.enterpriseInitChangePlan.enterpriseStandardName')" />
</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.enterpriseInitChangePlan.principalDrafter')">
{{ $t('workCenter.enterpriseInitChangePlan.principalDrafter') }}
</span>
</div>
<a-form-model-item class="item-model" prop="mainDraftingUser">
<user-selection :placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.principalDrafter')"
v-model="formInline.mainDraftingUser"
disabled
filedName="mainDraftingUser"
:nameStr="formInline.mainDraftingUser_dictText"
type="radio" />
</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.enterpriseInitChangePlan.mainDraftUnit')">
{{ $t('workCenter.enterpriseInitChangePlan.mainDraftUnit') }}
</span>
</div>
<a-form-model-item class="item-model" prop="mainDraftingUnit">
<j-select-depart v-model="formInline.mainDraftingUnit"
disabled
:backDepart="true" />
</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.enStandardChange.releaseDate')">
{{ $t('workCenter.enStandardChange.releaseDate') }}
</span>
</div>
<a-form-model-item class="item-model" prop="releaseDate">
<a-date-picker
v-model="formInline.releaseDate"
: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="title-text-text" :title="$t('workCenter.enStandardChange.materialDate')">
{{ $t('workCenter.enStandardChange.materialDate') }}
</span>
</div>
<a-form-model-item class="item-model" prop="materialDate">
<a-date-picker
v-model="formInline.materialDate"
: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="title-text-text" :title="$t('workCenter.enStandardRecheck.recheckDate')">
{{ $t('workCenter.enStandardRecheck.recheckDate') }}
</span>
</div>
<a-form-model-item class="item-model" prop="recheckDate">
<a-date-picker
v-model="formInline.recheckDate"
:showTime="false"
disabled
value-format="YYYY-MM-DD">
</a-date-picker>
</a-form-model-item>
</div>
<!-- 复审 -->
<div class="box-title-text form-flex-item form-flex-item-long">
<div class="title-text">
<span class="title-text-text" :title="$t('workCenter.enStandardRecheck.recheck')">
{{ $t('workCenter.enStandardRecheck.recheck') }}
</span>
</div>
<a-form-model-item class="item-model" prop="recheck">
<template>{{ formInline.recheck_dictText }}</template>
</a-form-model-item>
</div>
</div>
</div>
</a-form-model>
</template>
<script>
import { Recheck, StandardSource } from '@/enums/commonEnums'
import StandardSelection from '@/components/selection/StandardSelection'
import UserSelection from '@/components/selection/UserSelection'
export default {
name: 'RecheckApproveBaseInfo',
components: { StandardSelection, UserSelection },
data () {
return {
Recheck,
StandardSource,
formInline: {},
rules: {},
data: {}
}
},
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 给表单赋值
// this.formInline =
}
}
}
</script>
<style scoped>
</style>
@@ -93,10 +93,34 @@ export default {
trigger: 'change'
}
]
}
},
data: {}
}
},
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 给表单赋值
// this.formInline =
},
// 外层要获取数据
getData () {
// 把数据抛出,在线编辑不知道要不要抛
const data = {}
data.formInline = this.formInline
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate (callback) {
this.$refs.ruleForm.validate(valid => {
if (valid) {
const data = {}
data.formInline = this.formInline
callback(data)
}
})
},
// 选完企标编号了,需要回显内容,返回流程名称
listChange (value) {
console.log(value)
@@ -0,0 +1,438 @@
<template>
<internal-detail-page :title="pageTitle" :content-padding="0">
<!-- 标题右侧tab -->
<template v-slot:titleRightCustom>
<div class="table-operator-tab">
<a class="switch-item" :class="switchValue === 'base' ? 'table-operator-tab-active' : ''"
@click="switchChange('base')">{{ $t('basicInformation') }}
</a>
<a class="switch-item" :class="switchValue === 'user' ? 'table-operator-tab-active' : ''"
@click="switchChange('user')">{{ $t('personalInformation') }}
</a>
</div>
</template>
<!-- 基础信息 -->
<div v-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')">
<a-input :placeholder="$t('pleaseEnter') + $t('processName')"
@change="event => event.target.value = event.target.value.trim()"
disabled
:maxLength="50"
v-decorator="['processName', validatorRules.processName]" />
</a-form-item>
</a-col>
<a-col :span="12">
<!-- 截止日期 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('expirationDate')">
<a-date-picker :placeholder="$t('pleaseSelect') + $t('expirationDate')"
style="width: 100%"
:disabled="disabled"
value-format="YYYY-MM-DD"
v-decorator="['deadlineDate']" />
</a-form-item>
</a-col>
<a-col :span="24">
<!-- 流程说明 -->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('processExplain')">
<a-textarea :placeholder="$t('pleaseEnter') + $t('processExplain')"
:maxLength="500"
:rows="4"
:disabled="disabled"
v-decorator="['processDescription']" />
</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标准化审批 -->
<base-info-form v-else ref="baseInfoRef" disabled></base-info-form>
<!-- 流程审批信息 -->
<div class="process-part-title" v-if="!onlyLook">{{ $t('processApprovalInformation') }}</div>
<a-form :form="approvalInfoForm" v-if="!onlyLook">
<!--备注-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('remarks')">
<a-textarea :placeholder="$t('pleaseEnter') + $t('remarks')"
:maxLength="500"
:rows="4"
v-decorator="['remarks', validatorRules.remarks]" />
</a-form-item>
<!--附件-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('businessSupport.questionAnswer.attach')">
<j-upload v-decorator="['attachment']" return-id />
</a-form-item>
</a-form>
</div>
<!-- 人员信息 -->
<div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0">
<process-detail-list :url="url">
<personnel-info slot="personnelInfo" ref="personnelInfo" :data="personnelInfoData" :currentNode="currentNode + ''"></personnel-info>
</process-detail-list>
</div>
<!-- 操作按钮 -->
<div class="detail-page-bottom-operate-box" v-if="!onlyLook">
<!-- 发起节点 -->
<template v-if="currentNode === 1">
<!-- 保存 -->
<a-button type="primary" ghost :loading="loading" @click="handleSave"><i class="iconfont icon-save"></i> {{ $t('preservation') }}</a-button>
<!-- 提交 -->
<a-button type="primary" :loading="loading" @click="handleStart" icon="upload">{{ $t('submit') }}</a-button>
</template>
<template v-else>
<!-- 转办 -->
<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 { USER_INFO } from '@/store/mutation-types'
import Vue from 'vue'
import pick from 'lodash.pick'
import {
enStandardSealSaveGetDataById,
enStandardSealSaveSave,
enStandardSealSaveApproval,
enStandardSealSaveTurnTo,
enStandardSealSaveAgree,
enStandardSealSaveReject,
} from '@/api/workCenter'
import BaseInfoForm from './modules/BaseInfoForm'
// 人员信息
const personalInfo = [ // 人员信息的数据
{
id: 1,
nodeName: '发起人发起',
nodeRoleName: '发起人',
canChoose: false,
userList: Vue.ls.get(USER_INFO).realname + '(' + Vue.ls.get(USER_INFO).username + ')'
},
{
id: 2,
nodeName: '相关人员会签',
nodeRoleName: '相关人员',
canChoose: true,
chooseType: 'checkbox',
fieldName: ''
},
{
id: 3,
nodeName: '起草人和会签人主管级领导审批',
nodeRoleName: '起草人和会签人主管级领导',
canChoose: true,
chooseType: 'radio',
fieldName: ''
},
{
id: 4,
nodeName: '标准化审批',
nodeRoleName: '标准化',
canChoose: true,
chooseType: 'radio',
fieldName: ''
}
]
export default {
name: 'EnterpriseStandardSealSaveFlow',
components: {
BaseInfoForm,
InternalDetailPage,
ProcessDetailList,
PersonnelInfo,
UserSelectModal
},
computed: {
pageTitle () {
return this.$t('flowCenter') + this.$route.meta.title
}
},
mounted () {
if (this.$route.query.processId) {
this.currentNode = 2 // todo: 先设置一个假数据,后端还不能返回当前节点
// 有流程id说明是从流程中心来的,需要初始化数据
this.getProcessData(this.$route.query.taskId)
}
if (this.currentNode === 1) {
this.personnelInfoData = personalInfo
this.disabled = false
} else {
this.personnelInfoData = personalInfo.map(item => {
return { ...item, canChoose: false, fieldName: undefined }
})
this.disabled = true
}
// 如果是查看进入的,不可编辑,不可操作
if (this.$route.query.onlyLook) {
this.onlyLook = this.$route.query.onlyLook
this.disabled = this.$route.query.onlyLook
}
},
data () {
return {
loading: false,
switchValue: 'base', // 头部tab选中值
disabled: false,
onlyLook: false, // 是否仅查看
currentNode: 1, // 当前节点
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: {
// 流程名称
processName: {
rules: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('processName') }
],
validateTrigger: 'blur'
},
remarks: {
rules: [
{ required: false, message: this.$t('pleaseEnter') + this.$t('remarks') }
],
validateTrigger: 'blur'
}
},
formInline: {},
approvalInfoForm: this.$form.createForm(this), // 审批信息表单
personnelInfoData: [],
url: {
list: '' // 人员信息的右侧表格获取接口
}
}
},
methods: {
// 根据流程id获取数据并回显
getProcessData (taskId) {
enStandardSealSaveGetDataById({ taskId: taskId }).then(res => {
if (res.success) {
this.model = res.result
this.$nextTick(() => {
// 初始化流程信息
this.processInfoForm.setFieldsValue(pick(this.model[0], 'processName', 'deadlineDate', 'processDescription'))
// 初始化流程审批信息,todo:需要判断是不是草稿进来的,草稿进来的才回显审批信息
// this.approvalInfoForm.setFieldsValue(pick(this.model[0], 'remarks', 'attachment'))
})
// 初始化人员信息 todo: 发起人还没处理
this.personnelInfoData = personalInfo.map(item => {
if (item.fieldName) {
return { ...item, userList: this.model[0][item.fieldName + '_dictText'], canChoose: false }
} else {
return item
}
})
// 初始化业务基本信息中组件内容
} else {
this.$message.warning(res.message)
}
})
},
// 头部tab改变
switchChange (value) {
this.switchValue = value
},
// 业务基本信息组件中获取到流程名称改变后的值
processNameChange (value) {
const param = { processName: value }
this.$nextTick(() => {
this.processInfoForm.setFieldsValue(pick(param, 'processName'))
})
},
// 保存
handleSave () {
// 有任意一项填了即可
// 流程信息表单
const processInfoForm = this.processInfoForm.getFieldsValue()
// 流程审批信息
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 arr = []
// 业务基本信息
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
}
arr.push(param)
this.loading = true
// 保存到草稿
enStandardSealSaveSave(arr).then(res => {
if (res.success) {
this.$message.success(res.message)
} 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'))
return
}
// 流程信息的校验
this.processInfoForm.validateFields((err, values) => {
// 流程审批信息的校验
this.approvalInfoForm.validateFields((approvalErr, approvalValues) => {
this.$refs.baseInfoRef.getDataValidate(data => {
if (!err && !approvalErr && data) {
const arr = [] // 需要传给后端的数据
enStandardSealSaveApproval(arr).then(res => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
}
})
})
})
},
// 转办
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
enStandardSealSaveTurnTo(param).then(res => {
if (res.success) {
this.$message.success(res.message)
} 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 = Object.assign({}, values)
param.taskId = this.$route.query.taskId
enStandardSealSaveAgree(param).then(res => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
}
})
},
// 驳回
handleReject () {
if (this.loading) return
this.validatorRules.remarks.rules[0].required = true
if (!this.approvalInfoForm.getFieldValue('remarks')) {
this.$message.warning(this.$t('pleaseEnterRemarks'))
}
this.$nextTick(() => {
this.approvalInfoForm.validateFields((err, values) => {
if (!err) {
this.loading = true
const param = Object.assign({}, values)
param.taskId = this.$route.query.id
enStandardSealSaveReject(param).then(res => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
this.validatorRules.remarks.rules[0].required = false
})
}
})
})
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
</style>
@@ -0,0 +1,236 @@
<template>
<a-form-model :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.enterpriseStandardNum')">
{{ $t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum') }}
</span>
</div>
<a-form-model-item class="item-model" prop="enStandardNo">
<standard-selection :source="StandardSource.ENTERPRISE.value"
:disabled="disabled"
:disabledSourceSearch="true"
type="radio"
v-model="formInline.enStandardNo"
@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('workCenter.enterpriseInitChangePlan.enterpriseStandardName')">
{{ $t('workCenter.enterpriseInitChangePlan.enterpriseStandardName') }}
</span>
</div>
<a-form-model-item class="item-model" prop="enStandardName">
<a-input class="box-input"
v-model="formInline.enStandardName"
:maxLength="50"
disabled
@change="event => event.target.value = event.target.value.trim()"
:placeholder="$t('pleaseEnter')+$t('workCenter.enterpriseInitChangePlan.enterpriseStandardName')" />
</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.enterpriseInitChangePlan.standardEnglishName')">
{{ $t('workCenter.enterpriseInitChangePlan.standardEnglishName') }}
</span>
</div>
<a-form-model-item class="item-model" prop="enStandardEnglishName">
<a-input class="box-input"
disabled
v-model="formInline.enStandardEnglishName"
:maxLength="50"
@change="event => event.target.value = event.target.value.trim()"
:placeholder="$t('pleaseEnter')+$t('workCenter.enterpriseInitChangePlan.standardEnglishName')" />
</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.enterpriseInitChangePlan.standardType')">
{{ $t('workCenter.enterpriseInitChangePlan.standardType') }}
</span>
</div>
<a-form-model-item class="item-model" prop="standardType">
<j-dict-select-tag class="box-input"
disabled
v-model="formInline.standardType"
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.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="title-text-text" :title="$t('workCenter.enStandardAnnul.substituteStandardNumber')">
{{ $t('workCenter.enStandardAnnul.substituteStandardNumber') }}
</span>
</div>
<a-form-model-item class="item-model" prop="substituteStandardNumber">
<a-input class="box-input"
disabled
v-model="formInline.substituteStandardNumber"
:maxLength="50"
@change="event => event.target.value = event.target.value.trim()"
:placeholder="$t('pleaseEnter')+$t('workCenter.enStandardAnnul.substituteStandardNumber')" />
</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.enStandardAnnul.replacedByEnStandardNumber')">
{{ $t('workCenter.enStandardAnnul.replacedByEnStandardNumber') }}
</span>
</div>
<a-form-model-item class="item-model" prop="replacedByEnStandardNumber">
<a-input class="box-input"
disabled
v-model="formInline.replacedByEnStandardNumber"
:maxLength="50"
@change="event => event.target.value = event.target.value.trim()"
:placeholder="$t('pleaseEnter')+$t('workCenter.enStandardAnnul.replacedByEnStandardNumber')" />
</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.enStandardChange.releaseDate')">
{{ $t('workCenter.enStandardChange.releaseDate') }}
</span>
</div>
<a-form-model-item class="item-model" prop="releaseDate">
<a-date-picker
v-model="formInline.releaseDate"
: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="title-text-text" :title="$t('workCenter.enStandardChange.materialDate')">
{{ $t('workCenter.enStandardChange.materialDate') }}
</span>
</div>
<a-form-model-item class="item-model" prop="materialDate">
<a-date-picker
v-model="formInline.materialDate"
: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.enStandardSealSave.sealSaveReason')">
{{ $t('workCenter.enStandardSealSave.sealSaveReason') }}
</span>
</div>
<a-form-model-item class="item-model" prop="sealSaveReason">
<a-textarea :placeholder="$t('pleaseEnter')+$t('workCenter.enStandardSealSave.sealSaveReason')"
:disabled="disabled"
:maxLength="500"
v-model="formInline.sealSaveReason" :rows="4" />
</a-form-model-item>
</div>
</div>
</div>
</a-form-model>
</template>
<script>
import { StandardSource } from '@/enums/commonEnums'
import StandardSelection from '@/components/selection/StandardSelection'
export default {
name: 'BaseInfoForm',
components: { StandardSelection },
props: {
disabled: {
type: Boolean,
required: false,
default: false
}
},
data () {
return {
StandardSource,
formInline: {},
rules: {
// 企标编号
enStandardNo: [
{
required: true,
message: this.$t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
// 封存理由
sealSaveReason: [
{
required: true,
message: this.$t('workCenter.enStandardSealSave.sealSaveReason') + this.$t('cannotEmpty'),
trigger: 'blur'
}
]
}
}
},
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 给表单赋值
// this.formInline =
},
// 外层要获取数据
getData () {
// 把数据抛出,在线编辑不知道要不要抛
const data = {}
data.formInline = this.formInline
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate (callback) {
this.$refs.ruleForm.validate(valid => {
if (valid) {
const data = {}
data.formInline = this.formInline
callback(data)
}
})
},
// 选完企标编号了,需要回显内容,返回流程名称
listChange (value) {
console.log(value)
// 企标名称
this.formInline.enStandardName = value[0].standardName
// 英文名称
// 企标类别
// 代替企标编号
// 被代替企标编号
// 实施日期
// 复审日期
this.$emit('processNameChange', (this.formInline.enStandardNo || '') + '-' + (this.formInline.enStandardName || '') + '-' + '封存')
}
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,438 @@
<template>
<internal-detail-page :title="pageTitle" :content-padding="0">
<!-- 标题右侧tab -->
<template v-slot:titleRightCustom>
<div class="table-operator-tab">
<a class="switch-item" :class="switchValue === 'base' ? 'table-operator-tab-active' : ''"
@click="switchChange('base')">{{ $t('basicInformation') }}
</a>
<a class="switch-item" :class="switchValue === 'user' ? 'table-operator-tab-active' : ''"
@click="switchChange('user')">{{ $t('personalInformation') }}
</a>
</div>
</template>
<!-- 基础信息 -->
<div v-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')">
<a-input :placeholder="$t('pleaseEnter') + $t('processName')"
@change="event => event.target.value = event.target.value.trim()"
disabled
:maxLength="50"
v-decorator="['processName', validatorRules.processName]" />
</a-form-item>
</a-col>
<a-col :span="12">
<!-- 截止日期 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('expirationDate')">
<a-date-picker :placeholder="$t('pleaseSelect') + $t('expirationDate')"
style="width: 100%"
:disabled="disabled"
value-format="YYYY-MM-DD"
v-decorator="['deadlineDate']" />
</a-form-item>
</a-col>
<a-col :span="24">
<!-- 流程说明 -->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('processExplain')">
<a-textarea :placeholder="$t('pleaseEnter') + $t('processExplain')"
:maxLength="500"
:rows="4"
:disabled="disabled"
v-decorator="['processDescription']" />
</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标准化审批 -->
<base-info-form v-else ref="baseInfoRef" disabled></base-info-form>
<!-- 流程审批信息 -->
<div class="process-part-title" v-if="!onlyLook">{{ $t('processApprovalInformation') }}</div>
<a-form :form="approvalInfoForm" v-if="!onlyLook">
<!--备注-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('remarks')">
<a-textarea :placeholder="$t('pleaseEnter') + $t('remarks')"
:maxLength="500"
:rows="4"
v-decorator="['remarks', validatorRules.remarks]" />
</a-form-item>
<!--附件-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('businessSupport.questionAnswer.attach')">
<j-upload v-decorator="['attachment']" return-id />
</a-form-item>
</a-form>
</div>
<!-- 人员信息 -->
<div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0">
<process-detail-list :url="url">
<personnel-info slot="personnelInfo" ref="personnelInfo" :data="personnelInfoData" :currentNode="currentNode + ''"></personnel-info>
</process-detail-list>
</div>
<!-- 操作按钮 -->
<div class="detail-page-bottom-operate-box" v-if="!onlyLook">
<!-- 发起节点 -->
<template v-if="currentNode === 1">
<!-- 保存 -->
<a-button type="primary" ghost :loading="loading" @click="handleSave"><i class="iconfont icon-save"></i> {{ $t('preservation') }}</a-button>
<!-- 提交 -->
<a-button type="primary" :loading="loading" @click="handleStart" icon="upload">{{ $t('submit') }}</a-button>
</template>
<template v-else>
<!-- 转办 -->
<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 { USER_INFO } from '@/store/mutation-types'
import Vue from 'vue'
import pick from 'lodash.pick'
import {
enStandardStartUseGetDataById,
enStandardStartUseSave,
enStandardStartUseApproval,
enStandardStartUseTurnTo,
enStandardStartUseAgree,
enStandardStartUseReject,
} from '@/api/workCenter'
import BaseInfoForm from './modules/BaseInfoForm'
// 人员信息
const personalInfo = [ // 人员信息的数据
{
id: 1,
nodeName: '发起人发起',
nodeRoleName: '发起人',
canChoose: false,
userList: Vue.ls.get(USER_INFO).realname + '(' + Vue.ls.get(USER_INFO).username + ')'
},
{
id: 2,
nodeName: '相关人员会签',
nodeRoleName: '相关人员',
canChoose: true,
chooseType: 'checkbox',
fieldName: ''
},
{
id: 3,
nodeName: '起草人和会签人主管级领导审批',
nodeRoleName: '起草人和会签人主管级领导',
canChoose: true,
chooseType: 'radio',
fieldName: ''
},
{
id: 4,
nodeName: '标准化审批',
nodeRoleName: '标准化',
canChoose: true,
chooseType: 'radio',
fieldName: ''
}
]
export default {
name: 'EnterpriseStandardStartUseFlow',
components: {
BaseInfoForm,
InternalDetailPage,
ProcessDetailList,
PersonnelInfo,
UserSelectModal
},
computed: {
pageTitle () {
return this.$t('flowCenter') + this.$route.meta.title
}
},
mounted () {
if (this.$route.query.processId) {
this.currentNode = 2 // todo: 先设置一个假数据,后端还不能返回当前节点
// 有流程id说明是从流程中心来的,需要初始化数据
this.getProcessData(this.$route.query.taskId)
}
if (this.currentNode === 1) {
this.personnelInfoData = personalInfo
this.disabled = false
} else {
this.personnelInfoData = personalInfo.map(item => {
return { ...item, canChoose: false, fieldName: undefined }
})
this.disabled = true
}
// 如果是查看进入的,不可编辑,不可操作
if (this.$route.query.onlyLook) {
this.onlyLook = this.$route.query.onlyLook
this.disabled = this.$route.query.onlyLook
}
},
data () {
return {
loading: false,
switchValue: 'base', // 头部tab选中值
disabled: false,
onlyLook: false, // 是否仅查看
currentNode: 1, // 当前节点
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: {
// 流程名称
processName: {
rules: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('processName') }
],
validateTrigger: 'blur'
},
remarks: {
rules: [
{ required: false, message: this.$t('pleaseEnter') + this.$t('remarks') }
],
validateTrigger: 'blur'
}
},
formInline: {},
approvalInfoForm: this.$form.createForm(this), // 审批信息表单
personnelInfoData: [],
url: {
list: '' // 人员信息的右侧表格获取接口
}
}
},
methods: {
// 根据流程id获取数据并回显
getProcessData (taskId) {
enStandardStartUseGetDataById({ taskId: taskId }).then(res => {
if (res.success) {
this.model = res.result
this.$nextTick(() => {
// 初始化流程信息
this.processInfoForm.setFieldsValue(pick(this.model[0], 'processName', 'deadlineDate', 'processDescription'))
// 初始化流程审批信息,todo:需要判断是不是草稿进来的,草稿进来的才回显审批信息
// this.approvalInfoForm.setFieldsValue(pick(this.model[0], 'remarks', 'attachment'))
})
// 初始化人员信息 todo: 发起人还没处理
this.personnelInfoData = personalInfo.map(item => {
if (item.fieldName) {
return { ...item, userList: this.model[0][item.fieldName + '_dictText'], canChoose: false }
} else {
return item
}
})
// 初始化业务基本信息中组件内容
} else {
this.$message.warning(res.message)
}
})
},
// 头部tab改变
switchChange (value) {
this.switchValue = value
},
// 业务基本信息组件中获取到流程名称改变后的值
processNameChange (value) {
const param = { processName: value }
this.$nextTick(() => {
this.processInfoForm.setFieldsValue(pick(param, 'processName'))
})
},
// 保存
handleSave () {
// 有任意一项填了即可
// 流程信息表单
const processInfoForm = this.processInfoForm.getFieldsValue()
// 流程审批信息
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 arr = []
// 业务基本信息
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
}
arr.push(param)
this.loading = true
// 保存到草稿
enStandardStartUseSave(arr).then(res => {
if (res.success) {
this.$message.success(res.message)
} 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'))
return
}
// 流程信息的校验
this.processInfoForm.validateFields((err, values) => {
// 流程审批信息的校验
this.approvalInfoForm.validateFields((approvalErr, approvalValues) => {
this.$refs.baseInfoRef.getDataValidate(data => {
if (!err && !approvalErr && data) {
const arr = [] // 需要传给后端的数据
enStandardStartUseApproval(arr).then(res => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
}
})
})
})
},
// 转办
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
enStandardStartUseTurnTo(param).then(res => {
if (res.success) {
this.$message.success(res.message)
} 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 = Object.assign({}, values)
param.taskId = this.$route.query.taskId
enStandardStartUseAgree(param).then(res => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
}
})
},
// 驳回
handleReject () {
if (this.loading) return
this.validatorRules.remarks.rules[0].required = true
if (!this.approvalInfoForm.getFieldValue('remarks')) {
this.$message.warning(this.$t('pleaseEnterRemarks'))
}
this.$nextTick(() => {
this.approvalInfoForm.validateFields((err, values) => {
if (!err) {
this.loading = true
const param = Object.assign({}, values)
param.taskId = this.$route.query.id
enStandardStartUseReject(param).then(res => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
this.validatorRules.remarks.rules[0].required = false
})
}
})
})
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
</style>
@@ -0,0 +1,241 @@
<template>
<a-form-model :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.enterpriseStandardNum')">
{{ $t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum') }}
</span>
</div>
<a-form-model-item class="item-model" prop="enStandardNo">
<standard-selection :source="StandardSource.ENTERPRISE.value"
:disabled="disabled"
:disabledSourceSearch="true"
type="radio"
v-model="formInline.enStandardNo"
@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('workCenter.enterpriseInitChangePlan.enterpriseStandardName')">
{{ $t('workCenter.enterpriseInitChangePlan.enterpriseStandardName') }}
</span>
</div>
<a-form-model-item class="item-model" prop="enStandardName">
<a-input class="box-input"
v-model="formInline.enStandardName"
:maxLength="50"
disabled
@change="event => event.target.value = event.target.value.trim()"
:placeholder="$t('pleaseEnter')+$t('workCenter.enterpriseInitChangePlan.enterpriseStandardName')" />
</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.enterpriseInitChangePlan.standardEnglishName')">
{{ $t('workCenter.enterpriseInitChangePlan.standardEnglishName') }}
</span>
</div>
<a-form-model-item class="item-model" prop="enStandardEnglishName">
<a-input class="box-input"
disabled
v-model="formInline.enStandardEnglishName"
:maxLength="50"
@change="event => event.target.value = event.target.value.trim()"
:placeholder="$t('pleaseEnter')+$t('workCenter.enterpriseInitChangePlan.standardEnglishName')" />
</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.enterpriseInitChangePlan.standardType')">
{{ $t('workCenter.enterpriseInitChangePlan.standardType') }}
</span>
</div>
<a-form-model-item class="item-model" prop="standardType">
<j-dict-select-tag class="box-input"
disabled
v-model="formInline.standardType"
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.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="title-text-text" :title="$t('workCenter.enStandardAnnul.substituteStandardNumber')">
{{ $t('workCenter.enStandardAnnul.substituteStandardNumber') }}
</span>
</div>
<a-form-model-item class="item-model" prop="substituteStandardNumber">
<a-input class="box-input"
disabled
v-model="formInline.substituteStandardNumber"
:maxLength="50"
@change="event => event.target.value = event.target.value.trim()"
:placeholder="$t('pleaseEnter')+$t('workCenter.enStandardAnnul.substituteStandardNumber')" />
</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.enStandardAnnul.replacedByEnStandardNumber')">
{{ $t('workCenter.enStandardAnnul.replacedByEnStandardNumber') }}
</span>
</div>
<a-form-model-item class="item-model" prop="replacedByEnStandardNumber">
<a-input class="box-input"
disabled
v-model="formInline.replacedByEnStandardNumber"
:maxLength="50"
@change="event => event.target.value = event.target.value.trim()"
:placeholder="$t('pleaseEnter')+$t('workCenter.enStandardAnnul.replacedByEnStandardNumber')" />
</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.enStandardChange.releaseDate')">
{{ $t('workCenter.enStandardChange.releaseDate') }}
</span>
</div>
<a-form-model-item class="item-model" prop="releaseDate">
<a-date-picker
v-model="formInline.releaseDate"
: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="title-text-text" :title="$t('workCenter.enStandardChange.materialDate')">
{{ $t('workCenter.enStandardChange.materialDate') }}
</span>
</div>
<a-form-model-item class="item-model" prop="materialDate">
<a-date-picker
v-model="formInline.materialDate"
: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.enStandardStartUse.startUseReason')">
{{ $t('workCenter.enStandardStartUse.startUseReason') }}
</span>
</div>
<a-form-model-item class="item-model" prop="startUseReason">
<a-textarea :placeholder="$t('pleaseEnter')+$t('workCenter.enStandardStartUse.startUseReason')"
:disabled="disabled"
:maxLength="500"
v-model="formInline.startUseReason" :rows="4" />
</a-form-model-item>
</div>
</div>
</div>
</a-form-model>
</template>
<script>
import { StandardSource } from '@/enums/commonEnums'
import StandardSelection from '@/components/selection/StandardSelection'
export default {
name: 'BaseInfoForm',
components: { StandardSelection },
props: {
disabled: {
type: Boolean,
required: false,
default: false
}
},
data () {
return {
StandardSource,
formInline: {},
rules: {
// 企标编号
enStandardNo: [
{
required: true,
message: this.$t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
// 启用理由
startUseReason: [
{
required: true,
message: this.$t('workCenter.enStandardStartUse.startUseReason') + this.$t('cannotEmpty'),
trigger: 'blur'
}
]
}
}
},
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.data = data
// 给表单赋值
// this.formInline =
},
// 外层要获取数据
getData () {
// 把数据抛出,在线编辑不知道要不要抛
const data = {}
data.formInline = this.formInline
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
getDataValidate (callback) {
this.$refs.ruleForm.validate(valid => {
if (valid) {
const data = {}
data.formInline = this.formInline
callback(data)
}
})
},
// 选完企标编号了,需要回显内容,返回流程名称
listChange (value) {
console.log(value)
// 企标名称
this.formInline.enStandardName = value[0].standardName
// 英文名称
// 企标类别
// 代替企标编号
// 被代替企标编号
// 实施日期
// 复审日期
this.$emit('processNameChange', (this.formInline.enStandardNo || '') + '-' + (this.formInline.enStandardName || '') + '-' + '启用')
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
.collapsible-content-no-head {
border-top: 1px solid #E5E6EB;
border-radius: 8px 8px 8px 8px;
}
</style>