From 3a588fdd73b4afaabea5915b5c0979300e1e62fb Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Mon, 11 Dec 2023 19:41:16 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E4=BC=81=E6=A0=87=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E7=AB=8B=E9=A1=B9=E3=80=81=E5=8F=98=E6=9B=B4=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/MergeBaseInfo.vue | 63 ++++++++++++++++--- 1 file changed, 54 insertions(+), 9 deletions(-) diff --git a/src/views/workCenter/enterpriseStandardInitChange/modules/MergeBaseInfo.vue b/src/views/workCenter/enterpriseStandardInitChange/modules/MergeBaseInfo.vue index 8fe61ce1..cdda2ac1 100644 --- a/src/views/workCenter/enterpriseStandardInitChange/modules/MergeBaseInfo.vue +++ b/src/views/workCenter/enterpriseStandardInitChange/modules/MergeBaseInfo.vue @@ -248,6 +248,7 @@ v-model="formInline.decadeCode" date-format="YYYY" :disabled="disabled" + @change="decadeCodeChange" :placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.yearNumber')" /> @@ -371,13 +372,14 @@ - + @@ -458,10 +460,12 @@ import UploadFile from '@/components/UploadFile' import { getTreeList } from '@/api/enterpriseStandardLibraryApi' import { ApplicationCategory } from '@/enums/commonEnums' import { getFormDictTreeList } from '@/api/api' +import TreeSelection from '@/components/selection/TreeSelection' +import { getEnStandardNo } from '@/api/workCenter' export default { name: 'MergeBaseInfo', - components: { EnterprisePlanSelection, UserSelection, UploadFile }, + components: { EnterprisePlanSelection, UserSelection, UploadFile, TreeSelection }, props: { disabled: { type: Boolean, @@ -482,6 +486,18 @@ export default { // 企标名称,企标名称修改流程名称需要自动更改 'formInline.newEnStandardName' (value) { this.returnProcessName() + }, + // 企业标准代号 + 'formInline.enStandardCode' (value) { + this.getEnStandardNo() + }, + // 企业名称代号 + 'formInline.enNameCode' (value) { + this.getEnStandardNo() + }, + // 标准类别代号 + 'formInline.standardCategoryCode' (value) { + this.getEnStandardNo() } }, data () { @@ -645,7 +661,7 @@ export default { methods: { // 返回流程名称 returnProcessName () { - const processName = (this.formInline.newEnStandardNo || '') + '-' + (this.formInline.newEnStandardName || '') + '-' + '立项' + const processName = (this.formInline.newEnStandardNo || '') + '-' + (this.formInline.newEnStandardName || '') + '-' + '变更' console.log(processName) this.$emit('processNameChange', processName) }, @@ -665,6 +681,35 @@ export default { } }) }, + // 零部件名称选择完成的回调 + treeSelectNameChange (value, fieldName) { + this.formInline[fieldName + '_dictText'] = value + }, + // watch监视年代号会滞后 + decadeCodeChange (value) { + this.getEnStandardNo() + }, + // 根据三个代号和一个年代号获取企标编号 + getEnStandardNo () { + 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.$refs.ruleForm.clearValidate('newEnStandardNo') + this.$forceUpdate() + // 返回流程名称 + this.returnProcessName() + } + }) + }, // 改变内容区域收起和展开 handleChangeRetractable (module) { this.$set(this.retractableFlag, module, !this.retractableFlag[module])