[update] 修改bug

This commit is contained in:
lideqin
2023-11-06 16:28:18 +08:00
parent 8a7ec54327
commit 7e043299bf
3 changed files with 85 additions and 17 deletions
+39 -6
View File
@@ -10,7 +10,7 @@
:class="{'form-flex-item-line': item.fieldShowType === FieldType.STANDARD_MORE.value}"
v-if="!hiddenFieldList.includes(item.dbFieldName)">
<div class="title-text">
<span class="required" v-if="item.fieldMustInput === '1'">*</span>
<span class="required" v-if="item.fieldMustInput === '1' || rules[item.dbFieldName][0].required">*</span>
<span class="title-text-text" :title="item.dbFieldTxt">{{ item.dbFieldTxt }}</span>
</div>
<a-form-model-item class="item-model" :prop="item.dbFieldName">
@@ -85,7 +85,7 @@
<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)"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName) || innerDisabledField.includes(item.dbFieldName)"
:placeholder="$t('pleaseSelect')+item.dbFieldTxt"
:type="'select'"
:triggerChange="false"
@@ -155,7 +155,7 @@ import JMultiSelectTag from '../dict/JMultiSelectTag'
import UploadFile from '../UploadFile'
// 选择标准选择器
import StandardSelection from '../selection/StandardSelection'
import { FieldType, StandardGradeClassify, StandardProperty } from '../../enums/commonEnums'
import { FieldType, StandardGradeClassify, StandardProperty, IsTrial, EnterpriseStandardStatus } from '../../enums/commonEnums'
import JMultipleDatePicker from '../JMultipleDatePicker'
import UserSelection from '../selection/UserSelection'
import { getAction } from '../../api/manage.js'
@@ -312,12 +312,14 @@ export default {
} else if (val === StandardGradeClassify.ONE_LEVEL.value) {
// 选的是1级
this.formInline.auth_dept = this.standardGradeClassification.find(item => item.level + '' === '1').deptIds
this.formInline = JSON.parse(JSON.stringify(this.formInline))
if (this.innerDisabledField.includes('auth_dept')) {
this.innerDisabledField = this.innerDisabledField.filter(item => item !== 'auth_dept')
}
} else if (val === StandardGradeClassify.TWO_LEVEL.value) {
// 选的是2级
this.formInline.auth_dept = this.standardGradeClassification.find(item => item.level + '' === '2').deptIds
this.formInline = JSON.parse(JSON.stringify(this.formInline))
if (this.innerDisabledField.includes('auth_dept')) {
this.innerDisabledField = this.innerDisabledField.filter(item => item !== 'auth_dept')
}
@@ -329,6 +331,29 @@ export default {
}
}
}
},
// 企标是否试行改变,标准状态需要跟着变,试行周期必填校验也跟着变
'formInline.try_flag' (val) {
if (val && this.flag === '3') {
if (val === IsTrial.YES.value) {
// 试行,标准状态改为试运行,
this.formInline.standard_state = EnterpriseStandardStatus.TRIAL_OPERATION.value
this.formInline = JSON.parse(JSON.stringify(this.formInline))
// 试行,标准状态不可修改
if (!this.innerDisabledField.includes('standard_state')) {
this.innerDisabledField.push('standard_state')
}
// 试行,试行周期必填
this.rules.trial_period[0].required = true
} else {
// 不试行,标准状态可修改
if (this.innerDisabledField.includes('standard_state')) {
this.innerDisabledField = this.innerDisabledField.filter(item => item !== 'standard_state')
}
// 不试行,试行周期非必填
this.rules.trial_period[0].required = false
}
}
}
},
methods: {
@@ -420,16 +445,23 @@ export default {
message: res.dbFieldTxt + this.$t('cannotEmpty'),
trigger: 'blur'
})
} else if (res.fieldShowType === FieldType.DATE_SINGLE.value) {
// 解决第一次校验不消失的问题
} else {
rule.push({
required: true,
message: res.dbFieldTxt + this.$t('cannotEmpty'),
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: true,
required: false,
message: res.dbFieldTxt + this.$t('cannotEmpty'),
trigger: 'change'
})
@@ -439,6 +471,7 @@ export default {
rules[res.dbFieldName] = rule
}
})
console.log(rules)
this.rules = rules
this.isFormInline = true
this.confirmLoading = false
+20
View File
@@ -127,6 +127,26 @@ export const StandardGradeClassify = {
THREE_LEVEL: { text: '3级', value: '4' }
}
// 是否试行
export const IsTrial = {
YES: { text: '是', value: '1' },
NO: { text: '否', value: '0' }
}
// 企标状态
export const EnterpriseStandardStatus = {
DRAFT: { text: '起草', value: '1' },
SEEK_FOR_OPTIONS: { text: '征求意见', value: '2' },
EXAMINE: { text: '审查', value: '3' },
APPROVAL: { text: '报批', value: '4' },
PRE_RELEASE: { text: '预发布', value: '5' },
RELEASE: { text: '发布', value: '6' },
TRIAL_OPERATION: { text: '试运行', value: '7' },
CURRENTLY_EFFECTIVE: { text: '现行有效', value: '8' },
ABOLISH: { text: '废止', value: '9' },
ARCHIVE: { text: '封存', value: '10' }
}
// 流程key,获取人员信息前需要获取流程定义id,传这里的名字到WorkCenterMixin的getFlowDefinition方法中
export const ProcessKey = {
// 企标立项/变更计划
@@ -108,17 +108,32 @@
<a-dropdown v-if="operationList.length >= operateMaxNum" placement="bottomCenter">
<a-icon type="more" class="operate-icon-btn operate-icon-more" />
<a-menu slot="overlay">
<a-menu-item v-for="(operation, index) in operationList.slice(operateMaxNum)" :key="index">
<a @click="operationClick(operation,record)">
<!-- 编辑图标 -->
<i class="iconfont icon-bianji operate-btn-icon" v-if="operation.text === $t('edit')" />
<!-- 分享图标 -->
<i class="iconfont icon-fangxingfenxiang operate-btn-icon" v-if="operation.text === $t('share')" />
<!-- 删除图标 -->
<i class="iconfont icon-shanchu_ operate-btn-icon" v-if="operation.text === $t('delete')" />
{{ operation.text }}
</a>
</a-menu-item>
<!-- 有删除权限 -->
<template v-if="record.del_flag">
<a-menu-item v-for="(operation, index) in operationList.slice(operateMaxNum)" :key="index">
<a @click="operationClick(operation,record)">
<!-- 编辑图标 -->
<i class="iconfont icon-bianji operate-btn-icon" v-if="operation.text === $t('edit')" />
<!-- 分享图标 -->
<i class="iconfont icon-fangxingfenxiang operate-btn-icon" v-if="operation.text === $t('share')" />
<!-- 删除图标 -->
<i class="iconfont icon-shanchu_ operate-btn-icon" v-if="operation.text === $t('delete')" />
{{ operation.text }}
</a>
</a-menu-item>
</template>
<!-- 没有删除权限 -->
<template v-else>
<a-menu-item v-for="(operation, index) in operationList.slice(operateMaxNum).filter(item => item.text !== $t('delete'))" :key="index">
<a @click="operationClick(operation,record)">
<!-- 编辑图标 -->
<i class="iconfont icon-bianji operate-btn-icon" v-if="operation.text === $t('edit')" />
<!-- 分享图标 -->
<i class="iconfont icon-fangxingfenxiang operate-btn-icon" v-if="operation.text === $t('share')" />
{{ operation.text }}
</a>
</a-menu-item>
</template>
</a-menu>
</a-dropdown>
</template>