update 稽查计划&稽查流程 调整前端存储

This commit is contained in:
danshihao
2024-01-04 17:29:16 +08:00
parent 384c0d4a72
commit 9f27d3fff0
16 changed files with 354 additions and 266 deletions
@@ -190,6 +190,10 @@ export default {
// 是否发起节点
isInitiate () {
return this.currentNode === EsInspectionProcess.initiate.value
},
// 是否上传稽查报告整改计划的节点3
isInputInspectionReport () {
return this.currentNode === EsInspectionProcess.inputInspectionReport.value
}
},
created () {
@@ -245,6 +249,8 @@ export default {
const data = res.result || {}
const processAll = data.processAll || {}
const processApprovalRecord = data.processApprovalRecord || {}
// 回显表格
this.$refs.inspectionProcessTable.setData(data.processEsInspectVOList || [])
this.info = data
// 页面回显
this.processInfoForm && this.processInfoForm.setFieldsValue({
@@ -296,16 +302,37 @@ export default {
async getPageParams (isValidate = true) {
// 去除备注必填
this.validatorRules.remarks.rules[0].required = false
if (this.$refs.inspectionProcessTable.dataSource.length === 0) {
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
throw new Error('base')
}
// fix 79372 稽查内容条数不能为空或0
if (this.$refs.inspectionProcessTable.dataSource.some(item => (!item.standardInspectContentCount || item.standardInspectContentCount === '0'))) {
this.$message.warning(this.$t('workCenter.esInspectionProcess.pleaseFillInspectionContent'))
throw new Error('base')
// 如果需要校验校验表格数据
if (isValidate) {
const list = this.$refs.inspectionProcessTable.dataSource
if (list.length === 0) {
this.$message.warning(this.$t('addAtLeastOneRowOfData'))
throw new Error('base')
}
/**
* 调整为前端存储
*/
// 节点1:稽查内容条数不能为0
if (this.isInitiate && list.some(item => !(item.enterpriseStandardInspectContentList && item.enterpriseStandardInspectContentList.length))) {
this.$message.warning(this.$t('pleaseCompleteTableInfo'))
throw new Error('base')
}
// 节点3:稽查报告条数不能为0
if (this.isInputInspectionReport && list.some(item => !(item.enterpriseStandardInspectReportList && item.enterpriseStandardInspectReportList.length))) {
this.$message.warning(this.$t('pleaseCompleteTableInfo'))
throw new Error('base')
}
// 节点3:整改计划条数不能为0
if (this.isInputInspectionReport && list.some(item => !(item.enterpriseStandardInspectRectifyPlanList && item.enterpriseStandardInspectRectifyPlanList.length))) {
this.$message.warning(this.$t('pleaseCompleteTableInfo'))
throw new Error('base')
}
}
const params = {}
// 收集表格数据
params.processEsInspectList = this.$refs.inspectionProcessTable.dataSource
// 获取删除业务信息的ids列表
params.processAllDelIds = this.$refs.inspectionProcessTable.getDelIds()
// 收集所有表单信息
let formDataList = []
if (isValidate) {