[update] 修改标准化发起流程主起草人填写信息节点,表格的编辑校验标准化填过的字段不可修改,如果修改了提示

This commit is contained in:
lideqin
2023-12-19 16:11:45 +08:00
parent 7e3456579c
commit 642dbbfac4
2 changed files with 41 additions and 16 deletions
@@ -379,7 +379,6 @@
<!-- 零部件名称 -->
<div class="box-title-text form-flex-item-half">
<div class="title-text">
<span v-if="rules.componentName[0].required" class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.partName')">
{{ $t('workCenter.enterpriseInitChangePlan.partName') }}
</span>
@@ -538,6 +537,16 @@ export default {
type: String,
required: false,
default: ''
},
/**
* 初始化的数据,只有主起草人填写信息设置了值,主起草人填写信息节点需要判断之前的数据没有
*/
initDataSource: {
type: Array,
required: false,
default: () => {
return []
}
}
},
data () {
@@ -683,14 +692,6 @@ export default {
trigger: 'change'
}
],
// 零部件名称
componentName: [
{
required: false,
message: this.$t('workCenter.enterpriseInitChangePlan.partName') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
// 授权部门
authDept: [
{
@@ -952,30 +953,48 @@ export default {
if (this.confirmLoading) return
this.$refs.ruleForm.validate(valid => {
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
// 设置变更状态
formInline.changeStatus = 1
formInline.changeStatus = '1'
formInline.changeStatus_dictText = '新增'
}
// 翻译企业标准代号
if (formInline.enStandardCode) {
formInline.enStandardCode_dictText = this.$refs.enStandardCodeRef.dictOptions.find(item => item.value === formInline.enStandardCode).text
}
// 主起草单位如果没有翻译字段,说明就是当前登录人没有重新选
const currentUser = Vue.ls.get(USER_INFO)
if (!formInline.mainDraftingUnit_dictText) {
formInline.mainDraftingUnit_dictText = currentUser.departIds_dicText
}
// 处理标准体系
if (formInline.enStandardSystem && formInline.enStandardSystem.length > 0) {
formInline.enStandardSystem = formInline.enStandardSystem.map(item => item.value).join(',')
} else {
formInline.enStandardSystem = ''
}
// 主起草单位如果没有翻译字段,说明就是当前登录人没有重新选
const currentUser = Vue.ls.get(USER_INFO)
if (!formInline.mainDraftingUnit_dictText) {
formInline.mainDraftingUnit_dictText = currentUser.departIds_dicText
// 如果是主起草人填写信息节点,需要判断之前有的字段没有改过
if (this.currentNode === 6) {
let hasErr = false
// 从表格最初的数据中找出这条数据
const dItem = this.initDataSource.find(item => item.id === this.model.id)
for (const item in dItem) {
if (dItem[item] && dItem[item] !== formInline[item]) {
// 说明之前有的数据,改过
console.log('改了', item, '。原来的:', dItem[item], '现在的:', formInline[item])
this.$message.warning(this.$t('workCenter.revisionPlanActivelyReport.standizationEnterDataNotUpdate'))
hasErr = true
break
}
}
if (hasErr) {
return
}
}
this.confirmLoading = true
this.$emit('ok', formInline)
this.close()
this.confirmLoading = false