[update 标准解读流程] 发起

This commit is contained in:
danshihao
2024-07-16 17:45:28 +08:00
parent bde3b95fea
commit a4ba486d83
3 changed files with 31 additions and 16 deletions
@@ -467,7 +467,7 @@ export default {
}) })
// 所有删除的id // 所有删除的id
params.processAllDelIds = compData.processAllDelIds params.processAllDelIds = compData.processAllDelIds.filter(id => id)
// 保存草稿信息 // 保存草稿信息
params.infoJsonStr = JSON.stringify({ params.infoJsonStr = JSON.stringify({
// 人员信息(要重新获取,流程里的信息不能直接用,后端需要多选人员处理成数组了) // 人员信息(要重新获取,流程里的信息不能直接用,后端需要多选人员处理成数组了)
@@ -529,7 +529,14 @@ export default {
methods: { methods: {
// 设置组件内数据 // 设置组件内数据
setData (data = []) { setData (data = []) {
this.dataSource = data this.dataSource = data.map(item => {
// 没有id就添加uuid,和标记,最后返回的时候去掉
if (!item.id) {
item.id = randomUUID()
item[uuidFlag] = true
}
return item
})
}, },
// 获取组件内数据 // 获取组件内数据
getData () { getData () {
@@ -765,9 +772,9 @@ export default {
if (that.ipagination.current > 1 && ((that.ipagination.current - 1) * that.ipagination.pageSize) + 1 === that.ipagination.total) { if (that.ipagination.current > 1 && ((that.ipagination.current - 1) * that.ipagination.pageSize) + 1 === that.ipagination.total) {
that.ipagination.current -= 1 that.ipagination.current -= 1
} }
this.ipagination.total = this.dataSource.length
} }
}) })
this.ipagination.total = this.dataSource.length
}, },
/** /**
* 批量删除 * 批量删除
@@ -806,6 +813,10 @@ export default {
if (currentIndex < this.ipagination.current) { if (currentIndex < this.ipagination.current) {
this.ipagination.current = currentIndex this.ipagination.current = currentIndex
} }
// 当前页数小于1
if (this.ipagination.current < 1) {
this.ipagination.current = 1
}
}, },
/** /**
* 显示条款内容、条文解读弹框 * 显示条款内容、条文解读弹框
@@ -45,7 +45,7 @@
</div> </div>
<template v-if="showClauseTable"> <template v-if="showClauseTable">
<!-- 条款的表格 --> <!-- 条款的表格 -->
<interpretation-clause-table ref="interpretationClauseTable" row-key="uuid" :disabled="disabled" :current-node-id="currentNodeId"/> <interpretation-clause-table ref="interpretationClauseTable" :disabled="disabled" :current-node-id="currentNodeId"/>
</template> </template>
</a-spin> </a-spin>
<!-- 添加标准弹框-只选择已拆分的数据 --> <!-- 添加标准弹框-只选择已拆分的数据 -->
@@ -61,7 +61,6 @@
<script> <script>
import StandardSelectionModal from '@comp/selection/StandardSelectionModal' import StandardSelectionModal from '@comp/selection/StandardSelectionModal'
import { interpretGetClauseList, interpretGetFileByStandardId } from '@api/workCenter' import { interpretGetClauseList, interpretGetFileByStandardId } from '@api/workCenter'
import { randomUUID } from '@/utils/util'
import { DecompositionSource, StandardSource } from '@/enums/commonEnums' import { DecompositionSource, StandardSource } from '@/enums/commonEnums'
import InterpretationClauseTable import InterpretationClauseTable
from '@views/workCenter/standardInterpretationProcess/modules/InterpretationClauseTable' from '@views/workCenter/standardInterpretationProcess/modules/InterpretationClauseTable'
@@ -138,7 +137,9 @@ export default {
dataSource: [], dataSource: [],
decompositionSourceList: [], // 标准分解单下拉 decompositionSourceList: [], // 标准分解单下拉
// 是否显示条款的表格部分 // 是否显示条款的表格部分
showClauseTable: false showClauseTable: false,
// 删除的数据id
delIds: []
} }
}, },
methods: { methods: {
@@ -186,8 +187,13 @@ export default {
if (this.showClauseTable) { if (this.showClauseTable) {
obj.clauseData = this.$refs.interpretationClauseTable.getData() obj.clauseData = this.$refs.interpretationClauseTable.getData()
} }
// 父组件的ids和子组件的合并返回
const delIds = this.delIds
if (this.$refs.interpretationClauseTable) {
delIds.push(...this.$refs.interpretationClauseTable.processAllDelIds)
}
// 获取所有删除的id // 获取所有删除的id
obj.processAllDelIds = this.$refs.interpretationClauseTable && this.$refs.interpretationClauseTable.processAllDelIds obj.processAllDelIds = delIds
return obj return obj
}, },
// 更新组件内的数据 // 更新组件内的数据
@@ -220,13 +226,16 @@ export default {
return return
} }
// 如果有条款的表格,就清空然后隐藏 // 如果有条款的表格,就清空然后隐藏
this.$refs.interpretationClauseTable && this.$refs.interpretationClauseTable.setData([]) if (this.$refs.interpretationClauseTable) {
// 清空上次的数据,需要记录删除的id
this.delIds.push(...this.$refs.interpretationClauseTable.getData().map(item => item.id))
this.$refs.interpretationClauseTable.setData([])
}
this.showClauseTable = true this.showClauseTable = true
// 如果是不带入,不需要请求,直接将标准数据带入 // 如果是不带入,不需要请求,直接将标准数据带入
if (this.dataSource[0].decompositionSource === DecompositionSource.NO_INPUT.value) { if (this.dataSource[0].decompositionSource === DecompositionSource.NO_INPUT.value) {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.interpretationClauseTable.setData([{ this.$refs.interpretationClauseTable.setData([{
uuid: randomUUID(),
clauseId: this.dataSource[0].standardId, clauseId: this.dataSource[0].standardId,
itemTitle: this.dataSource[0].standardName, itemTitle: this.dataSource[0].standardName,
itemNum: this.dataSource[0].standardNumber itemNum: this.dataSource[0].standardNumber
@@ -236,16 +245,11 @@ export default {
} }
this.loading = true this.loading = true
interpretGetClauseList({ interpretGetClauseList({
standardId: this.dataSource[0].id, standardId: this.dataSource[0].standardId,
fileType: this.dataSource[0].decompositionSource fileType: this.dataSource[0].decompositionSource
}).then(res => { }).then(res => {
if (res.success) { if (res.success) {
const clauseDataSource = (res.result || []).map(item => { this.$refs.interpretationClauseTable.setData(res.result || [])
item.uuid = randomUUID()
return item
})
// 处理好数据把表格数据传给子组件
this.$refs.interpretationClauseTable.setData(clauseDataSource)
} }
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false