[update] 修改标准化发起流程主起草人填写信息节点,表格的编辑校验标准化填过的字段不可修改,如果修改了提示
This commit is contained in:
+34
-15
@@ -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
|
||||
|
||||
+7
-1
@@ -40,7 +40,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 新增,编辑的弹框 -->
|
||||
<base-info-table-modal ref="baseInfoTableModal" source="tableBaseInfo" :currentNode="currentNode" @ok="modelFormOk"></base-info-table-modal>
|
||||
<base-info-table-modal ref="baseInfoTableModal" source="tableBaseInfo" :currentNode="currentNode" :initDataSource="initDataSource" @ok="modelFormOk"></base-info-table-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -200,6 +200,7 @@ export default {
|
||||
}
|
||||
],
|
||||
dataSource: [],
|
||||
initDataSource: [], // 最初的数据,用于在主起草人填写信息节点提交时,判断没有改过标准化填的内容
|
||||
editIndex: undefined // 编辑的下标
|
||||
}
|
||||
},
|
||||
@@ -212,8 +213,13 @@ export default {
|
||||
methods: {
|
||||
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
|
||||
initData (data) {
|
||||
console.log('------执行initData了--------')
|
||||
// 给表格赋值
|
||||
this.dataSource = data
|
||||
if (this.currentNode === 6) {
|
||||
// 是主起草人填写信息节点
|
||||
this.initDataSource = JSON.parse(JSON.stringify(data))
|
||||
}
|
||||
},
|
||||
// 外层要获取数据
|
||||
getData () {
|
||||
|
||||
Reference in New Issue
Block a user