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