|
@@ -59,6 +59,7 @@
|
|
|
:columns="columns"
|
|
|
:data="tableData"
|
|
|
:count="0"
|
|
|
+ row-key="fid"
|
|
|
/>
|
|
|
</div>
|
|
|
<cy-info-title style="margin-top: 20px;">网价附件</cy-info-title>
|
|
@@ -88,6 +89,7 @@
|
|
|
:columns="columnsInfo"
|
|
|
:data="tableDataInfo"
|
|
|
:count="0"
|
|
|
+ row-key="fid"
|
|
|
/>
|
|
|
</div>
|
|
|
<cy-info-title style="margin-top: 20px;">联系信息</cy-info-title>
|
|
@@ -136,7 +138,7 @@
|
|
|
<script>
|
|
|
import { getProjectInfo, getFinishProCon, getApplicantInfo, chooseToAcceptTheGoods, generateReceivable, applySubmit, getDetailsInfo } from '@/api/myFinancing'
|
|
|
import { validMail } from '@/utils/validate'
|
|
|
-import { deduplicateArray } from '@/utils'
|
|
|
+import { deduplicateArray, getUuid } from '@/utils'
|
|
|
export default {
|
|
|
name: 'ApplyFinancing',
|
|
|
props: {
|
|
@@ -209,9 +211,25 @@ export default {
|
|
|
},
|
|
|
tableData: [],
|
|
|
columns: [
|
|
|
+ {
|
|
|
+ type: 'expand',
|
|
|
+ render: (h, row, index) => {
|
|
|
+ const columnsDeep = this.columns.toSpliced(0, 2)
|
|
|
+ columnsDeep.unshift({
|
|
|
+ label: '序号',
|
|
|
+ prop: 'tOrder'
|
|
|
+ })
|
|
|
+ return <cy-comm-table
|
|
|
+ columns={ columnsDeep }
|
|
|
+ data={row.children}
|
|
|
+ count={0}
|
|
|
+ rowKey='tid'
|
|
|
+ />
|
|
|
+ }
|
|
|
+ },
|
|
|
{
|
|
|
label: '序号',
|
|
|
- index: true
|
|
|
+ prop: 'fOrder'
|
|
|
},
|
|
|
{
|
|
|
label: '验收单货物编号',
|
|
@@ -298,9 +316,25 @@ export default {
|
|
|
},
|
|
|
tableDataInfo: [],
|
|
|
columnsInfo: [
|
|
|
+ {
|
|
|
+ type: 'expand',
|
|
|
+ render: (h, row, index) => {
|
|
|
+ const columnsDeep = this.columnsInfo.toSpliced(0, 2)
|
|
|
+ columnsDeep.unshift({
|
|
|
+ label: '序号',
|
|
|
+ prop: 'tOrder'
|
|
|
+ })
|
|
|
+ return <cy-comm-table
|
|
|
+ columns={ columnsDeep }
|
|
|
+ data={row.children}
|
|
|
+ count={0}
|
|
|
+ rowKey='tid'
|
|
|
+ />
|
|
|
+ }
|
|
|
+ },
|
|
|
{
|
|
|
label: '序号',
|
|
|
- index: true
|
|
|
+ prop: 'fOrder'
|
|
|
},
|
|
|
{
|
|
|
label: '验收单货物编号',
|
|
@@ -425,7 +459,7 @@ export default {
|
|
|
methods: {
|
|
|
initData(data) {
|
|
|
const { financingBasicInfo, financingGoodsInfoList, financingAccountsReceivableInfoList, financingApplicantInfo, fileStorageDOList } = data
|
|
|
- this.tableData = financingGoodsInfoList
|
|
|
+ this.tableData = this.handlerGoodsFormat(financingGoodsInfoList)
|
|
|
const { applicantContact,
|
|
|
applicantContactNumber,
|
|
|
applicantContactEmail,
|
|
@@ -442,9 +476,9 @@ export default {
|
|
|
applicantDesignatedBank
|
|
|
}
|
|
|
this.fileStorageList = fileStorageDOList
|
|
|
- this.tableDataInfo = financingAccountsReceivableInfoList
|
|
|
+ this.tableDataInfo = this.handlerGoodsFormat(financingAccountsReceivableInfoList)
|
|
|
this.getGoodsCalc(financingGoodsInfoList)
|
|
|
- this.getReceivableCalc()
|
|
|
+ this.getReceivableCalc(financingAccountsReceivableInfoList)
|
|
|
},
|
|
|
getDetails() {
|
|
|
const { id } = this.$route.params
|
|
@@ -500,10 +534,15 @@ export default {
|
|
|
chooseToAcceptTheGoods(params).then(({ data }) => {
|
|
|
this.goodsTableData = data.rows
|
|
|
var selectRow = []
|
|
|
+ const tableList = []
|
|
|
this.tableData.forEach(item => {
|
|
|
- selectRow = this.goodsTableData.filter(row => row.acceptanceNumber === item.acceptanceNumber)
|
|
|
- this.$refs.goodsTable.toggleRowSelection(selectRow)
|
|
|
+ tableList.push(...item.children)
|
|
|
})
|
|
|
+ tableList.forEach(item => {
|
|
|
+ selectRow.push(this.goodsTableData.find(row => row.acceptanceNumber === item.acceptanceGoodsNumber))
|
|
|
+ })
|
|
|
+
|
|
|
+ this.$refs.goodsTable.toggleRowSelection(selectRow)
|
|
|
this.goodsLoading = false
|
|
|
})
|
|
|
},
|
|
@@ -523,7 +562,7 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
this.getMultipleList(multipleList)
|
|
|
- this.getReceivable()
|
|
|
+
|
|
|
this.$refs.dialog.show = false
|
|
|
},
|
|
|
// 底层货物
|
|
@@ -540,7 +579,8 @@ export default {
|
|
|
listData.push(...list)
|
|
|
})
|
|
|
this.getGoodsCalc(listData)
|
|
|
- this.tableData = listData
|
|
|
+ this.getReceivable(listData)
|
|
|
+ this.tableData = this.handlerGoodsFormat(listData)
|
|
|
},
|
|
|
// 底层货物计算
|
|
|
getGoodsCalc(list) {
|
|
@@ -559,20 +599,20 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 生成底层
|
|
|
- getReceivable() {
|
|
|
- generateReceivable(this.tableData).then(({ data }) => {
|
|
|
- this.tableDataInfo = data
|
|
|
- this.getReceivableCalc()
|
|
|
+ getReceivable(list) {
|
|
|
+ generateReceivable(list).then(({ data }) => {
|
|
|
+ this.tableDataInfo = this.handlerGoodsFormat(data)
|
|
|
+ this.getReceivableCalc(data)
|
|
|
})
|
|
|
},
|
|
|
// 底层信息计算
|
|
|
- getReceivableCalc() {
|
|
|
+ getReceivableCalc(list) {
|
|
|
this.bottomInfoCalc = {
|
|
|
numTotal: 0,
|
|
|
accountsTotal: 0,
|
|
|
netAccounts: 0
|
|
|
}
|
|
|
- this.tableDataInfo.forEach(item => {
|
|
|
+ list.forEach(item => {
|
|
|
const { numTotal, accountsTotal, netAccounts } = this.bottomInfoCalc
|
|
|
this.bottomInfoCalc = {
|
|
|
numTotal: (Number(numTotal) + Number(item.goodsQuantity)).toFixed(4),
|
|
@@ -622,6 +662,20 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ },
|
|
|
+ handlerGoodsFormat(arr) {
|
|
|
+ let fOrder = 0
|
|
|
+ let tOrder = 0
|
|
|
+ return Object.values(arr.reduce((acc, cur) => {
|
|
|
+ if (!acc[cur.acceptanceGoodsNumber]) {
|
|
|
+ fOrder += 1
|
|
|
+ tOrder = 0
|
|
|
+ acc[cur.acceptanceGoodsNumber] = { ...cur, fid: getUuid(), tid: getUuid(), fOrder, children: [] }
|
|
|
+ }
|
|
|
+ tOrder += 1
|
|
|
+ acc[cur.acceptanceGoodsNumber].children.push({ ...cur, fid: getUuid(), tid: getUuid(), tOrder })
|
|
|
+ return acc
|
|
|
+ }, {}))
|
|
|
}
|
|
|
}
|
|
|
}
|