update 稽查流程完善

This commit is contained in:
danshihao
2024-01-07 11:56:12 +08:00
parent d526a1c4e3
commit 25451fd6c0
5 changed files with 65 additions and 39 deletions
@@ -330,7 +330,22 @@ export default {
} }
const params = {} const params = {}
// 收集表格数据 // 收集表格数据
params.processEsInspectList = this.$refs.inspectionProcessTable.dataSource params.processEsInspectList = this.$refs.inspectionProcessTable.dataSource.map(item => {
// 如果没有子表格数据,就默认空数组,否则后端报错
// 稽查内容
if (!item.enterpriseStandardInspectContentList) {
item.enterpriseStandardInspectContentList = []
}
// 稽查报告
if (!item.enterpriseStandardInspectReportList) {
item.enterpriseStandardInspectReportList = []
}
// 整改计划
if (!item.enterpriseStandardInspectRectifyPlanList) {
item.enterpriseStandardInspectRectifyPlanList = []
}
return item
})
// 获取删除业务信息的ids列表 // 获取删除业务信息的ids列表
params.processAllDelIds = this.$refs.inspectionProcessTable.getDelIds() params.processAllDelIds = this.$refs.inspectionProcessTable.getDelIds()
// 收集所有表单信息 // 收集所有表单信息
@@ -48,7 +48,7 @@
</j-table> </j-table>
</a-spin> </a-spin>
<!-- 新增、编辑整改计划 --> <!-- 新增、编辑整改计划 -->
<inspection-process-rectification-plan-modal ref="modalForm" @ok="modalFormOk"/> <inspection-process-rectification-plan-modal ref="modalForm" @ok="modalFormOk" :temp-data-source="dataSource"/>
</j-modal> </j-modal>
</template> </template>
@@ -149,7 +149,7 @@ export default {
dataSource: [], dataSource: [],
// 需要删除的数据id(前端添加后没有保存表的数据没有id) // 需要删除的数据id(前端添加后没有保存表的数据没有id)
delIds: [], delIds: [],
columns: columns.slice(0, this.disabled ? 6 : 7) columns: columns.slice(0, this.disabled ? 8 : 9)
} }
}, },
methods: { methods: {
@@ -19,6 +19,7 @@
<a-select v-model="form.inspectContentId" <a-select v-model="form.inspectContentId"
:placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionProcess.sectionClause')" :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionProcess.sectionClause')"
show-search show-search
allowClear
@change="changeSectionClause" @change="changeSectionClause"
:filter-option="filterOption"> :filter-option="filterOption">
<a-select-option v-for="item in sectionClauseList" :value="item.id" :key="item.id">{{ item.clause }}</a-select-option> <a-select-option v-for="item in sectionClauseList" :value="item.id" :key="item.id">{{ item.clause }}</a-select-option>
@@ -145,14 +146,17 @@
import UploadFile from '@comp/UploadFile' import UploadFile from '@comp/UploadFile'
import UserSelection from '@comp/selection/UserSelection' import UserSelection from '@comp/selection/UserSelection'
import {
getInspectionContentTable,
queryByInspectContentId
} from '@api/workCenter'
import moment from 'moment' import moment from 'moment'
export default { export default {
name: 'InspectionProcessRectificationPlanModal', name: 'InspectionProcessRectificationPlanModal',
components: { UserSelection, UploadFile }, components: { UserSelection, UploadFile },
props: {
// 临时的数据,如果不提交就不保存
tempDataSource: {
type: Array,
default: () => []
}
},
data () { data () {
return { return {
title: this.$t('workCenter.esInspectionProcess.inspectionPlanEs'), title: this.$t('workCenter.esInspectionProcess.inspectionPlanEs'),
@@ -224,10 +228,10 @@ export default {
this.index = index this.index = index
// 获取章节条款下拉 // 获取章节条款下拉
this.initSectionClauseList() this.initSectionClauseList()
const { inspectContentId, requirement, executionStatus, attachment, evaluateScore } = record.enterpriseStandardInspectReport || {} const { standardRequire, executionStatus, attachment, evaluateScore } = record.enterpriseStandardInspectReport || {}
this.form = Object.assign({}, record, { this.form = Object.assign({}, record, {
inspectContentId, // inspectContentId,
standardRequire: requirement, standardRequire,
executionStatus, executionStatus,
attachment, attachment,
evaluateScore evaluateScore
@@ -317,38 +321,38 @@ export default {
}, },
// 初始化章节条款下拉 // 初始化章节条款下拉
initSectionClauseList () { initSectionClauseList () {
getInspectionContentTable({ // 过滤已经被选择的下拉
processEsInspectId: this.data.id const contentlist = this.data.enterpriseStandardInspectContentList || []
}).then(res => { const planList = this.tempDataSource || []
if (res.success) { this.sectionClauseList = contentlist.filter(content => {
this.sectionClauseList = res.result || [] // 当前没有被选择过,或者编辑时选择的就是当前数据就显示在下拉
} return !planList.find(report => report.inspectContentId === content.id) || this.model.inspectContentId === content.id
}) })
}, },
// 章节条款改变 // 章节条款改变
changeSectionClause (val) { changeSectionClause (val) {
console.log(val)
if (val) { if (val) {
// const obj = this.sectionClauseList.find(item => item.id === val) console.log(this)
queryByInspectContentId({ const contentList = this.data.enterpriseStandardInspectContentList || []
inspectContentId: val const reportList = this.data.enterpriseStandardInspectReportList || []
}).then(res => { const content = contentList.find(item => item.id === val) || {}
if (res.success) { const report = reportList.find(item => item.inspectContentId === val) || {}
const { id, standardRequire, executionStatus, attachment, evaluateScore } = res.result || {} // this.form.inspectReportId = report.inspectReportId
this.form.inspectReportId = id this.form.standardRequire = content.requirement
this.form.standardRequire = standardRequire this.form.executionStatus = report.executionStatus
this.form.executionStatus = executionStatus this.form.attachment = report.attachment
this.form.attachment = attachment this.form.evaluateScore = report.evaluateScore
this.form.evaluateScore = evaluateScore this.form.enterpriseStandardInspectReport = report
this.$forceUpdate()
}
})
} else { } else {
this.form.inspectReportId = undefined // this.form.inspectReportId = undefined
this.form.standardRequire = undefined this.form.standardRequire = undefined
this.form.executionStatus = undefined this.form.executionStatus = undefined
this.form.attachment = undefined this.form.attachment = undefined
this.form.evaluateScore = undefined this.form.evaluateScore = undefined
this.form.enterpriseStandardInspectReport = undefined
} }
this.$forceUpdate()
} }
} }
} }
@@ -45,7 +45,7 @@
</j-table> </j-table>
</a-spin> </a-spin>
<!-- 新增、编辑稽查报告 --> <!-- 新增、编辑稽查报告 -->
<inspection-process-report-modal ref="modalForm" @ok="modalFormOk"/> <inspection-process-report-modal ref="modalForm" @ok="modalFormOk" :temp-data-source="dataSource"/>
<!-- 上传回显 --> <!-- 上传回显 -->
<upload-file ref="uploadFile" disabled></upload-file> <upload-file ref="uploadFile" disabled></upload-file>
</j-modal> </j-modal>
@@ -19,6 +19,7 @@
<a-select v-model="form.inspectContentId" <a-select v-model="form.inspectContentId"
:placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionProcess.sectionClause')" :placeholder="$t('pleaseSelect') + $t('workCenter.esInspectionProcess.sectionClause')"
show-search show-search
allowClear
@change="changeSectionClause" @change="changeSectionClause"
:filter-option="filterOption"> :filter-option="filterOption">
<a-select-option v-for="item in sectionClauseList" :value="item.id" :key="item.id">{{ item.clause }}</a-select-option> <a-select-option v-for="item in sectionClauseList" :value="item.id" :key="item.id">{{ item.clause }}</a-select-option>
@@ -78,11 +79,17 @@
<script> <script>
import UploadFile from '@comp/UploadFile' import UploadFile from '@comp/UploadFile'
import { getInspectionContentTable } from '@api/workCenter'
import moment from 'moment' import moment from 'moment'
export default { export default {
name: 'InspectionProcessReportModal', name: 'InspectionProcessReportModal',
components: { UploadFile }, components: { UploadFile },
props: {
// 临时的数据,如果不提交就不保存
tempDataSource: {
type: Array,
default: () => []
}
},
data () { data () {
return { return {
title: this.$t('workCenter.esInspectionProcess.inspectionPlanEs'), title: this.$t('workCenter.esInspectionProcess.inspectionPlanEs'),
@@ -194,12 +201,12 @@ export default {
}, },
// 初始化章节条款下拉 // 初始化章节条款下拉
initSectionClauseList () { initSectionClauseList () {
getInspectionContentTable({ // 过滤已经被选择的下拉
processEsInspectId: this.data.id const contentlist = this.data.enterpriseStandardInspectContentList || []
}).then(res => { const reportList = this.tempDataSource || []
if (res.success) { this.sectionClauseList = contentlist.filter(content => {
this.sectionClauseList = res.result || [] // 当前没有被选择过,或者编辑时选择的就是当前数据就显示在下拉
} return !reportList.find(report => report.inspectContentId === content.id) || this.model.inspectContentId === content.id
}) })
}, },
// 章节条款改变 // 章节条款改变