[update] 调年度制修订计划两个流程

This commit is contained in:
lideqin
2023-10-24 17:59:40 +08:00
parent 4e1d090c78
commit 9ab2eb4c24
17 changed files with 711 additions and 159 deletions
@@ -25,8 +25,9 @@
<a-form-model-item class="item-model" prop="applicationType">
<a-select v-model="formInline.applicationType"
:disabled="disabled"
defaultValue="ApplicationCategory.INITIATION.value"
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.applicationType')">
<a-select-option :value="1">{{ $t('workCenter.enterpriseInitChangePlan.standardProjectEstablishment') }}</a-select-option>
<a-select-option :value="ApplicationCategory.INITIATION.value">{{ $t('workCenter.enterpriseInitChangePlan.standardProjectEstablishment') }}</a-select-option>
</a-select>
</a-form-model-item>
</div>
@@ -43,13 +44,13 @@
@change="projectTypeChange"
:disabled="disabled"
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.itemCategory')">
<a-select-option :value="1">{{ $t('workCenter.enterpriseInitChangePlan.formulate') }}</a-select-option>
<a-select-option :value="2">{{ $t('workCenter.enterpriseInitChangePlan.revise') }}</a-select-option>
<a-select-option :value="ProjectType.ENACT.value">{{ $t('workCenter.enterpriseInitChangePlan.formulate') }}</a-select-option>
<a-select-option :value="ProjectType.MODIFY.value">{{ $t('workCenter.enterpriseInitChangePlan.revise') }}</a-select-option>
</a-select>
</a-form-model-item>
</div>
<!-- 标准立项-制定 -->
<template v-if="formInline.projectType && formInline.projectType === 1">
<template v-if="formInline.projectType && formInline.projectType === ProjectType.ENACT.value">
<!-- 企标编号 -->
<div class="box-title-text form-flex-item-half">
<div class="title-text">
@@ -92,6 +93,7 @@
</div>
<a-form-model-item class="item-model" prop="enStandardCode">
<j-dict-select-tag class="box-input"
ref="enStandardCodeRef"
v-model="formInline.enStandardCode"
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.enterpriseStandardCode')"
:type="'select'"
@@ -150,12 +152,13 @@
:default-value="yearNumberDefaultValue"
date-format="YYYY"
:disabled="disabled"
@change="decadeCodeChange"
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.yearNumber')" />
</a-form-model-item>
</div>
</template>
<!-- 标准立项-修订 -->
<template v-else-if="formInline.projectType && formInline.projectType === 2">
<template v-else-if="formInline.projectType && formInline.projectType === ProjectType.MODIFY.value">
<!-- 企标编号 原企标编号 -->
<div class="box-title-text form-flex-item-half">
<div class="title-text">
@@ -172,7 +175,7 @@
@nameChange="nameChange"/>
</a-form-model-item>
</div>
<!-- 新企标编号 根据选的企标编号的那三个代号生成新的编号 -->
<!-- 新企标编号 审批结束后才回显 -->
<!--<div class="box-title-text form-flex-item-half">-->
<!-- <div class="title-text">-->
<!-- <span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.newEnterpriseStandardNum')">-->
@@ -396,6 +399,7 @@
<a-form-model-item class="item-model" prop="authDept">
<j-select-depart v-model="formInline.authDept"
:disabled="disabled"
@back="authDeptBack"
:backDepart="true" />
</a-form-model-item>
</div>
@@ -428,6 +432,7 @@
<a-form-model-item class="item-model" prop="mainDraftingUnit">
<j-select-depart v-model="formInline.mainDraftingUnit"
:disabled="disabled"
@back="mainDraftingUnitBack"
:backDepart="true" />
</a-form-model-item>
</div>
@@ -467,6 +472,21 @@
type="radio" />
</a-form-model-item>
</div>
<!-- 配合单位 -->
<div class="box-title-text form-flex-item-half">
<div class="title-text">
<span class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.suitUnit')">
{{ $t('workCenter.enterpriseInitChangePlan.suitUnit') }}
</span>
</div>
<a-form-model-item class="item-model" prop="cooperationUnit">
<j-select-depart v-model="formInline.cooperationUnit"
:disabled="disabled"
@back="cooperationUnitBack"
:backDepart="true" />
</a-form-model-item>
</div>
</div>
</a-form-model>
</a-spin>
@@ -482,7 +502,7 @@
</template>
<script>
import { StandardSource, ProjectType } from '@/enums/commonEnums'
import { StandardSource, ProjectType, ApplicationCategory } from '@/enums/commonEnums'
import { getFormDictTreeList } from '@/api/api'
import UserSelection from '@/components/selection/UserSelection'
import StandardSelection from '@/components/selection/StandardSelection'
@@ -490,6 +510,7 @@ import UploadFile from '@/components/UploadFile'
import { getTreeList } from '@/api/enterpriseStandardLibraryApi'
import Vue from 'vue'
import { USER_INFO } from '@/store/mutation-types'
import { getEnStandardNo } from '@/api/workCenter'
export default {
name: 'BaseInfoTableModal',
@@ -518,6 +539,7 @@ export default {
return {
StandardSource,
ProjectType,
ApplicationCategory,
partNameOptions: [], // 零部件名称下拉框数据
standardSystemOptions: [], // 企标体系下拉框数据
visible: false,
@@ -705,6 +727,20 @@ export default {
return new Date().getFullYear() + ''
}
},
watch: {
// 企业标准代号
'formInline.enStandardCode' (value) {
this.getEnStandardNo()
},
// 企业名称代号
'formInline.enNameCode' (value) {
this.getEnStandardNo()
},
// 标准类别代号
'formInline.standardCategoryCode' (value) {
this.getEnStandardNo()
}
},
mounted () {
this.initPartNameOptions()
this.initStandardSystemOptions()
@@ -780,6 +816,9 @@ export default {
this.planSubmissionDateDisabled = true
}
}
if (!this.formInline.applicationType) {
this.formInline.applicationType = this.ApplicationCategory.INITIATION.value
}
},
look (record) {
this.visible = true
@@ -787,6 +826,40 @@ export default {
this.formInline = Object.assign({}, record)
this.disabled = true
},
// watch监视年代号会滞后
decadeCodeChange (value) {
this.getEnStandardNo()
},
// 根据三个代号和一个年代号获取企标编号
getEnStandardNo () {
// 如果是制定根据填的三个代号和一个年代号获取
if (this.formInline.projectType === ProjectType.ENACT.value) {
if (!this.formInline.enStandardCode || !this.formInline.enNameCode ||
!this.formInline.standardCategoryCode || !this.formInline.decadeCode) {
return
}
const param = {}
param.enStandardCode = this.formInline.enStandardCode
param.enNameCode = this.formInline.enNameCode
param.standardCategoryCode = this.formInline.standardCategoryCode
param.decadeCode = this.formInline.decadeCode
getEnStandardNo(param).then(res => {
if (res.success) {
this.$set(this.formInline, 'newEnStandardNo', res.message)
this.$forceUpdate()
}
})
} else {
// 是修订,通过选中的企标编号和年代号拼接新企标编号
if (this.formInline.originEnStandardNo && this.formInline.decadeCode) {
const standardNo = this.formInline.originEnStandardNo.split('-')[0] + '-' + this.formInline.decadeCode
this.$set(this.formInline, 'newEnStandardNo', standardNo)
this.$forceUpdate()
// 返回流程名称
this.returnProcessName()
}
}
},
// 获取零部件名称下拉框数据
initPartNameOptions () {
getFormDictTreeList({ dictId: '1696821512600637441' }).then(res => {
@@ -814,6 +887,18 @@ export default {
this.formInline.decadeCode = new Date().getFullYear() + ''
}
},
// 授权部门返回参数
authDeptBack (value) {
this.formInline.authDept_dictText = value.map(item => item.text).join(',')
},
// 主起草单位返回参数
mainDraftingUnitBack (value) {
this.formInline.mainDraftingUnit_dictText = value.map(item => item.text).join(',')
},
// 配合单位返回参数
cooperationUnitBack (value) {
this.formInline.cooperationUnit_dictText = value.map(item => item.text).join(',')
},
// 选择用户得到用户名
userSelectNameChange (value, fieldName) {
this.formInline[fieldName + '_dictText'] = value
@@ -852,6 +937,23 @@ export default {
if (valid) {
this.confirmLoading = true
const formInline = JSON.parse(JSON.stringify(this.formInline))
if (formInline.projectType) {
// 翻译项目类别
formInline.projectType_dictText = formInline.projectType === ProjectType.ENACT.value ? ProjectType.ENACT.text : ProjectType.MODIFY.text
// 设置变更状态
if (formInline.projectType === ProjectType.ENACT.value) {
// 是制定,变更状态是新增
formInline.changeStatus_dictText = '新增'
} else {
// 是修订,变更状态是变更
formInline.changeStatus_dictText = '变更'
}
}
// 翻译企业标准代号
if (formInline.enStandardCode) {
formInline.enStandardCode_dictText = this.$refs.enStandardCodeRef.dictOptions.find(item => item.value === formInline.enStandardCode).text
}
// 主起草单位的回显需要在登录信息中有当前登录人部门的翻译 ??
this.$emit('ok', formInline)
this.close()
this.confirmLoading = false