获取流程详情 API
parent
0ab3d24fc7
commit
37dbe77fe6
|
@ -324,10 +324,14 @@ public class ProcessController {
|
|||
@ResponseBody
|
||||
@GetMapping("/{id}")
|
||||
public ProjectProcessDetail get(@PathVariable int id) {
|
||||
ProjectProcess process = processService.getById(id);
|
||||
if (process == null) {
|
||||
throw new RuntimeException("流程不存在");
|
||||
}
|
||||
|
||||
ProjectProcessDetail detail = new ProjectProcessDetail();
|
||||
detail.setProcessId(id);
|
||||
|
||||
ProjectProcess process = processService.getById(id);
|
||||
detail.setProcess(process);
|
||||
|
||||
Project project = projectRepository.findById(process.getProjectId());
|
||||
|
|
|
@ -558,12 +558,6 @@
|
|||
})
|
||||
console.log(emptyRows)
|
||||
if (isNotEmpty(emptyRows)) {
|
||||
this.procurementDetails.filter(detail => {
|
||||
const properties = procurementDetailProperties.filter(property => isBlank(detail[property]))
|
||||
console.log(properties)
|
||||
return isNotEmpty(properties)
|
||||
})
|
||||
|
||||
const row = emptyRows[0]
|
||||
this.$message.error("合同清单明细 费用项目为:'" + row.feeType + "' 采购类别为:'" + row.category + "' 的数据未填写")
|
||||
return false
|
||||
|
@ -637,7 +631,7 @@
|
|||
}
|
||||
// @formatter:on
|
||||
|
||||
const applyDeptId = process.applyDeptId?.split(',')
|
||||
const applyDeptId = process?.applyDeptId?.split(',')
|
||||
this.initForm({ ...form, ...process, ...contract, applyDeptId })
|
||||
this.projectSelected = true
|
||||
this.processType = process.processType
|
||||
|
@ -654,32 +648,34 @@
|
|||
const convertCommon = detail => {
|
||||
return {
|
||||
rowKey: rowKey++, feeType: computeFeeType(detail.type),
|
||||
totalTaxInclude_: detail.totalTaxInclude, totalTaxInclude: undefined, // 存在相同字段转换一下
|
||||
totalTaxInclude_: detail.totalTaxInclude, // 存在相同字段转换一下
|
||||
}
|
||||
}
|
||||
|
||||
const computeProcurementDetails = procurementDetails => {
|
||||
const ret = []
|
||||
for (let detail of procurementDetails || []) {
|
||||
const newDetail = {
|
||||
|
||||
//父级数据
|
||||
const parent = {
|
||||
...detail, ...convertCommon(detail),
|
||||
}
|
||||
// mapChildren
|
||||
let { purchaseDetails } = newDetail
|
||||
let { purchaseDetails } = parent
|
||||
if (isNotEmpty(purchaseDetails)) {
|
||||
purchaseDetails = purchaseDetails.map(purchase => ({
|
||||
...purchase, ...detail, parent: newDetail
|
||||
...purchase, ...convertCommon(detail), parent, newRow: true
|
||||
}))
|
||||
|
||||
// 合并第一行到父级
|
||||
const first = purchaseDetails.shift();
|
||||
Object.assign(newDetail, first)
|
||||
delete newDetail['parent']
|
||||
delete newDetail['purchaseDetails']
|
||||
Object.assign(parent, first)
|
||||
delete parent['parent']
|
||||
delete parent['purchaseDetails']
|
||||
|
||||
newDetail['children'] = purchaseDetails
|
||||
parent['children'] = purchaseDetails
|
||||
}
|
||||
ret.push(newDetail)
|
||||
ret.push(parent)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue