[update] 修改各部门主动上报流程的保存

This commit is contained in:
lideqin
2024-02-04 15:43:16 +08:00
parent c19ff34162
commit 655113cee1
3 changed files with 31 additions and 17 deletions
@@ -421,12 +421,12 @@ export default {
// 业务基本信息有表单,可能有表格也可能没有
const param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj, ...ruleForm.formInline }
const flag = Object.values(param).some(v => !!v || v === 0)
if (!flag || (ruleForm.dataSource && ruleForm.dataSource.length <= 0)) {
if (!flag && (ruleForm.dataSource && ruleForm.dataSource.length <= 0)) {
// 提示至少填写一项
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
return
}
if (ruleForm.dataSource) {
if (ruleForm.dataSource && ruleForm.dataSource.length > 0) {
paramObj.infoJsonStr = JSON.stringify({
dataList: ruleForm.dataSource.map(item => {
return { ...item, ...ruleForm.formInline }
@@ -445,22 +445,30 @@ export default {
// 业务基本信息有表单也有表格
const param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj, ...ruleForm.formInline }
const flag = Object.values(param).some(v => !!v || v === 0)
if (!flag || ruleForm.dataSource.length <= 0) {
if (!flag && ruleForm.dataSource.length <= 0) {
// 提示至少填写一项
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
return
}
paramObj.infoJsonStr = JSON.stringify({
dataList: ruleForm.dataSource.map(item => {
return { ...item, ...ruleForm.formInline }
}),
personnelObj: personnelObj,
processDescription: this.processInfoForm.getFieldValue('processDescription')
})
if (ruleForm.dataSource && ruleForm.dataSource.length > 0) {
paramObj.infoJsonStr = JSON.stringify({
dataList: ruleForm.dataSource.map(item => {
return { ...item, ...ruleForm.formInline }
}),
personnelObj: personnelObj,
processDescription: this.processInfoForm.getFieldValue('processDescription')
})
} else {
paramObj.infoJsonStr = JSON.stringify({
dataList: [ruleForm.formInline],
personnelObj: personnelObj,
processDescription: this.processInfoForm.getFieldValue('processDescription')
})
}
} else if (this.currentNode === 5) {
const param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj }
const flag = Object.values(param).some(v => !!v || v === 0)
if (!flag || ruleForm.dataSource.length <= 0) {
if (!flag && ruleForm.dataSource.length <= 0) {
// 提示至少填写一项
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
return
@@ -139,9 +139,12 @@ export default {
this.formInline.contactUserLeaderLeader_dictText = data.flowUser ? data.flowUser.contactUserLeaderLeader_dictText : data.dataList[0].contactUserLeaderLeader_dictText
this.formInline = Object.assign({}, this.formInline)
// 给表格赋值
this.$nextTick(() => {
this.$refs.tableRef.initData(data)
})
if (data.dataList.length > 0 && data.dataList[0].applicationType) {
// 第一行数据有申请类型字段说明才有表格数据,否则有可能是保存没有填表格信息的情况
this.$nextTick(() => {
this.$refs.tableRef.initData(data)
})
}
} else {
// 下发联络人,没有表格
this.formInline.distributeFlag = data.dataList[0].distributeFlag
@@ -78,9 +78,12 @@ export default {
this.formInline.collectUserLeader_dictText = data.dataList[0].collectUserLeader_dictText
this.formInline = Object.assign({}, this.formInline)
// 给表格赋值
this.$nextTick(() => {
this.$refs.tableRef.initData(data)
})
if (data.dataList.length > 0 && data.dataList[0].applicationType) {
// 第一行数据有申请类型字段说明才有表格数据,否则有可能是保存没有填表格信息的情况
this.$nextTick(() => {
this.$refs.tableRef.initData(data)
})
}
}
},
initTableData (data) {