应收应付费用审批

szh-new
lijingjia 3 months ago
parent 5f7acdfc38
commit ad393cd568

@ -12,7 +12,7 @@
:class="{ noBorder: item.field == 'cbm' || item.field == 'dischargePort' || item.field == 'invoiceNo' || item.field == 'note' }" :class="{ noBorder: item.field == 'cbm' || item.field == 'dischargePort' || item.field == 'invoiceNo' || item.field == 'note' }"
:label="item.label" :label="item.label"
> >
<div> <div class="content" :title="item.value">
{{ item.value || '-' }} {{ item.value || '-' }}
</div> </div>
</a-form-item> </a-form-item>
@ -26,7 +26,7 @@
// //
const list = ref([ const list = ref([
{ label: '委托编号', field: 'customerNo', span: 4, value: '' }, { label: '委托编号', field: 'customerNo', span: 4, value: '' },
{ label: '主单号', field: 'mblno', span: 4, value: '' }, { label: '主单号', field: 'mblno', span: 4, value: '' },
{ label: '箱型箱量', field: 'cntrTotal', span: 4, value: '' }, { label: '箱型箱量', field: 'cntrTotal', span: 4, value: '' },
{ label: '件数', field: 'pkgs', span: 4, value: '' }, { label: '件数', field: 'pkgs', span: 4, value: '' },
{ label: '毛重', field: 'kgs', span: 4, value: '' }, { label: '毛重', field: 'kgs', span: 4, value: '' },
@ -75,6 +75,11 @@
color: #7A8798; color: #7A8798;
} }
} }
.content {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.ant-form-item-control-input { .ant-form-item-control-input {
min-height: 24px; min-height: 24px;
} }

@ -1,5 +1,5 @@
// 列表页面表单和表格的整体样式管理 // 列表页面表单和表格的整体样式管理
.ds-table, .ds-table-detail, .ds-mini-table { .ds-table, .ds-table-detail, .ds-mini-table, .ds-mini-table-detail {
.ant-form { .ant-form {
padding: 10px 19px 1px!important; padding: 10px 19px 1px!important;
.ant-btn { .ant-btn {
@ -90,6 +90,24 @@
} }
} }
} }
.ds-mini-table-detail {
.ant-table-container {
padding: 0;
.ant-table-thead {
th {
padding: 4.5px 7px!important;
}
}
.ant-table-tbody {
.ant-table-row {
height: 26px !important;
.ant-table-cell {
padding: 0 8px;
}
}
}
}
}
.ant-table-thead { .ant-table-thead {
th { th {
background-color: rgba(240, 244, 250, 1) !important; background-color: rgba(240, 244, 250, 1) !important;
@ -98,7 +116,6 @@
letter-spacing: 1px; letter-spacing: 1px;
line-height: 15.84px; line-height: 15.84px;
color: rgba(51, 56, 61, 1) !important; color: rgba(51, 56, 61, 1) !important;
text-align: left !important;
vertical-align: bottom; vertical-align: bottom;
border: none !important; border: none !important;
border-bottom: 1px solid rgba(232, 232, 232, 1) !important; border-bottom: 1px solid rgba(232, 232, 232, 1) !important;

@ -643,4 +643,5 @@ export const columns: BasicColumn[] = [
align: 'left', align: 'left',
width: 100 width: 100
} }
] ]

@ -74,8 +74,8 @@
</a-button> </a-button>
</a-dropdown> </a-dropdown>
<Divider type="vertical" /> <Divider type="vertical" />
<FeeActionBar <!-- <FeeActionBar
></FeeActionBar> ></FeeActionBar> -->
</div> </div>
<div style="padding-left: 20px;"> <div style="padding-left: 20px;">
<a-form> <a-form>
@ -84,38 +84,27 @@
<a-form-item <a-form-item
:label="item.label" :label="item.label"
> >
<div> <div class="content">
{{ item.value || '-' }} {{ item.value || '-' }}
</div> </div>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
</div> <div class="flex fee-tables">
<div> <!-- 三个表格 -->
<!-- 应收费用表格 --> <ul class="columns-name">
<!-- <FeeTable <li class="fee-name">费用名称</li>
class="fee-tb" <li v-for="(item, index) in tableData" class="fee-data" :key="'f-n-' + index">
:style="{ 'height': feeHeight / 2 + 'px' }" {{ item.feeName }}
ref="receiveTable" </li>
:heigth="feeHeight" <li>合计</li>
:id="busId" </ul>
:profit="profit" <!-- 应收表格 -->
tbType="receive" <BasicTable class="ds-mini-table-detail receive-table" @register="registerTable1"></BasicTable>
@checkProfit="checkProfit" <!-- 应付表格 -->
></FeeTable> --> <BasicTable class="ds-mini-table-detail pay-table" @register="registerTable2"></BasicTable>
</div>
<!-- 应付费用表格 -->
<!-- <FeeTable
class="fee-tb"
:style="{ 'height': feeHeight / 2 + 'px' }"
ref="payTable"
:feeHeight="feeHeight"
:id="busId"
:profit="profit"
tbType="pay"
@checkProfit="checkProfit"
></FeeTable> -->
</div> </div>
<!-- <Statistic v-show="busId.length" :id="busId"></Statistic> --> <!-- <Statistic v-show="busId.length" :id="busId"></Statistic> -->
</div> </div>
@ -128,11 +117,11 @@
import { GetList, GetFees } from './api' import { GetList, GetFees } from './api'
import { Divider } from 'ant-design-vue' import { Divider } from 'ant-design-vue'
import FeeActionBar from './components/feeActionBar.vue' import FeeActionBar from './components/feeActionBar.vue'
import { useModal } from '/@/components/Modal' // import { useModal } from '/@/components/Modal'
import { columns, searchFormSchema } from './columns' import { columns, searchFormSchema } from './columns'
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
import FeeTable from './components/feeTable.vue' // import FeeTable from './components/feeTable.vue'
import Statistic from './components/Statistic.vue' // import Statistic from './components/Statistic.vue'
import MainActionBar from './components/mainActionBar.vue' import MainActionBar from './components/mainActionBar.vue'
import { formatTableData } from '/@/hooks/web/common' import { formatTableData } from '/@/hooks/web/common'
const { createMessage } = useMessage() const { createMessage } = useMessage()
@ -143,6 +132,7 @@
const data = ref([]) const data = ref([])
const check = ref(true) const check = ref(true)
const innerHeight = window.innerHeight const innerHeight = window.innerHeight
const fheight = (innerHeight / 2) - 97
const [registerTable, { reload, getDataSource }] = useTable({ const [registerTable, { reload, getDataSource }] = useTable({
maxHeight: (innerHeight - 60) / 2, maxHeight: (innerHeight - 60) / 2,
api: async (p) => { api: async (p) => {
@ -180,6 +170,8 @@
immediate: false, immediate: false,
resizeHeightOffset: (innerHeight - 60) / 2 resizeHeightOffset: (innerHeight - 60) / 2
}) })
//
const tableData = ref([])
const selectHandle = (v) => { const selectHandle = (v) => {
let ids = [] let ids = []
if (v.rows && v.rows.length) { if (v.rows && v.rows.length) {
@ -192,6 +184,7 @@
if (ids && ids.length) { if (ids && ids.length) {
GetFees(ids[0]).then(res => { GetFees(ids[0]).then(res => {
const val = res.data const val = res.data
//
if (val.etd) val.etd = val.etd.split(' ')[0] if (val.etd) val.etd = val.etd.split(' ')[0]
if (val.eta) val.etd = val.eta.split(' ')[0] if (val.eta) val.etd = val.eta.split(' ')[0]
val.etd = val.etd || '' + (val.etd ? '/' : '') + val.eta || '' val.etd = val.etd || '' + (val.etd ? '/' : '') + val.eta || ''
@ -207,9 +200,175 @@
} }
} }
}) })
//
tableData.value = val.itemGroups
//
if (val.itemGroups) {
RData.value = []
PData.value = []
val.itemGroups.forEach(item => {
if (item.items.length == 0) {
item.items = [{ feeType: 1 }, { feeType: 2 }]
}
if (item.items.length == 1) {
if (item.items[0].feeType == 1) {
item.items[1] = { feeType: 2 }
} else {
item.items[1] = { feeType: 1 }
}
}
item.items.forEach(row => {
if (row.currency == 'RMB') {
row['RMB'] = row.amount
} else if (row.currency == 'USD') {
row['USD'] = row.amount
} else {
row['other'] = row.amount
}
//
if (row.feeType === 1) {
RData.value.push(row)
}
//
if (row.feeType === 2) {
PData.value.push(row)
}
})
})
}
}) })
} else {
list.value.forEach(item => {
item.value = ''
})
tableData.value = []
PData.value = []
RData.value = []
} }
} }
const feeColumns = (v) => {
return [
{
title: v == 1 ? '应收' : '应付',
align: 'center',
width: 200,
children: [
{
dataIndex: 'RMB',
title: 'RMB',
align: 'left',
minWidth: 80
},
{
dataIndex: 'USD',
title: 'USD',
align: 'left',
minWidth: 80
},
{
dataIndex: 'other',
title: '其他币别',
align: 'left',
minWidth: 80
},
{
dataIndex: 'customerFullName',
title: '客户名称',
align: 'left',
minWidth: 80
},
{
dataIndex: 'feeStatusText',
title: '状态',
align: 'left',
width: 80
},
{
dataIndex: 'unitPrice',
title: '单价',
align: 'left',
width: 100
},
{
dataIndex: 'quantity',
title: '数量',
align: 'left',
width: 50
},
{
dataIndex: 'exchangeRate',
title: '汇率',
align: 'left',
width: 50
}
]
}
]
}
//
const RData = ref([])
//
const PData = ref([])
const [registerTable1] = useTable({
dataSource: RData,
columns: feeColumns(1),
isTreeTable: false,
pagination: false,
showIndexColumn: false,
bordered: true,
rowSelection: { type: 'checkbox' },
canResize: false,
summaryFunc(param) {
alert(1)
const { columns, data } = param
const sums = {}
//
columns.forEach(column => {
if (['RMB', 'USD', 'other'].includes(column.dataIndex)) {
// 0
sums[column.dataIndex] = 0
//
data.forEach(row => {
if (!isNaN(row[column.dataIndex])) {
sums[column.dataIndex] += Number(row[column.dataIndex])
}
})
}
})
//
return sums
}
})
const [registerTable2] = useTable({
dataSource: PData,
columns: feeColumns(2),
isTreeTable: false,
pagination: false,
showIndexColumn: false,
bordered: true,
rowSelection: { type: 'checkbox' },
canResize: false,
summaryFunc(param) {
console.log(param)
const { columns, data } = param
const sums = {}
//
columns.forEach(column => {
if (['RMB', 'USD', 'other'].includes(column.dataIndex)) {
// 0
sums[column.dataIndex] = 0
//
data.forEach(row => {
if (!isNaN(row[column.dataIndex])) {
sums[column.dataIndex] += Number(row[column.dataIndex])
}
})
}
})
//
return sums
}
})
const receiveTable = ref(null) const receiveTable = ref(null)
const payTable = ref(null) const payTable = ref(null)
const mainApprove = () => { const mainApprove = () => {
@ -280,7 +439,7 @@
// // // //
// document.ondragstart = null // document.ondragstart = null
// } // }
// const fheight = ref(268)
onMounted(() => { onMounted(() => {
// //
reload() reload()
@ -295,6 +454,52 @@
.vben-basic-table-header__toolbar { .vben-basic-table-header__toolbar {
justify-content: space-between; justify-content: space-between;
} }
.content {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.columns-name {
width: 110px;
}
.fee-tables {
height: calc(50vh - 136px);
overflow-y: auto;
}
.receive-table, .pay-table {
flex: 1;
th::before {
height: 0!important;
}
}
.receive-table {
th {
background: #F2FAFA!important;
}
}
.pay-table {
th {
background: #FCF5F5!important;
}
}
ul {
font-size: 12px;
.fee-name, .fee-data {
background: #FFFDF5;
padding-left: 10px;
}
.fee-name {
height: 51px;
display: flex;
align-items: end;
padding-bottom: 5px;
}
.fee-data {
height: 26px;
border-top: 1px solid #e5e7eb;
line-height: 26px;
}
}
.ant-form-item-label { .ant-form-item-label {
label { label {
font-size: 12px; font-size: 12px;

Loading…
Cancel
Save