添加
This commit is contained in:
parent
104c9158f7
commit
ff0f1d66fa
|
|
@ -38,3 +38,11 @@ export function downloadDispatchFeeStatistics(params) {
|
|||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
export function list(params) {
|
||||
return request({
|
||||
url: 'api/dispatchFeeStatistics',
|
||||
method: 'get',
|
||||
params,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,12 +28,14 @@
|
|||
<!--表单组件-->
|
||||
<eForm ref="form" :is-add="isAdd" />
|
||||
<!--表格渲染-->
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||
<el-table v-loading="loading" :data="list"
|
||||
:span-method="objectSpanMethod"
|
||||
size="small" style="width: 100%;">
|
||||
<el-table-column prop="unitAreaCode" label="单元区域编码" />
|
||||
<el-table-column prop="unitAreaName" label="单元区域名称" />
|
||||
<el-table-column prop="areaResponsiblePerson" label="区域负责人(结算对" />
|
||||
<el-table-column prop="dispatchStaff" label="派件业务员" />
|
||||
<el-table-column prop="receiverDispatcherCode" label="收派员编码" />
|
||||
<el-table-column prop="areaResponsiblePerson" label="区域负责人" />
|
||||
<af-table-column prop="dispatchStaff" label="派件业务员" />
|
||||
<af-table-column prop="receiverDispatcherCode" label="收派员编码" />
|
||||
<el-table-column prop="dispatchQuantity" label="派件数量" />
|
||||
<el-table-column prop="unitPrice" label="单价" />
|
||||
<el-table-column prop="payableDispatchFee" label="应发派费(加)" />
|
||||
|
|
@ -44,7 +46,7 @@
|
|||
<el-table-column prop="penaltyAmount" label="罚款金额" />
|
||||
<el-table-column prop="actualAmountPaid" label="实发金额" />
|
||||
<el-table-column prop="totalAmount" label="合计金额" />
|
||||
<el-table-column prop="remarks" label="备注" />
|
||||
<af-table-column prop="remarks" label="备注" />
|
||||
<el-table-column v-if="checkPermission(['admin', 'dispatchFeeStatistics:edit', 'dispatchFeeStatistics:del'])"
|
||||
label="操作" width="150px" align="center">
|
||||
<template slot-scope="scope">
|
||||
|
|
@ -64,21 +66,24 @@
|
|||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<el-pagination :total="total" :current-page="page + 1" style="margin-top: 8px;"
|
||||
layout="total, prev, pager, next, sizes" @size-change="sizeChange" @current-change="pageChange" />
|
||||
<!-- <el-pagination :total="total" :current-page="page + 1" style="margin-top: 8px;"
|
||||
layout="total, prev, pager, next, sizes" @size-change="sizeChange" @current-change="pageChange" /> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/initData'
|
||||
import { del, downloadDispatchFeeStatistics, feeStatistics } from '@/api/dispatchFeeStatistics'
|
||||
import { del, downloadDispatchFeeStatistics, feeStatistics, list } from '@/api/dispatchFeeStatistics'
|
||||
import eForm from './form'
|
||||
import { parseTime, downloadFile, parseDate } from '@/utils/index'
|
||||
export default {
|
||||
components: { eForm },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
spanData: {},
|
||||
list: [],
|
||||
delLoading: false,
|
||||
feeStatisticsLoading: false,
|
||||
queryTypeOptions: [
|
||||
|
|
@ -89,14 +94,61 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
this.getAll()
|
||||
})
|
||||
},
|
||||
watch: {
|
||||
'list': {
|
||||
handler(newVal) {
|
||||
if (newVal && newVal.length) {
|
||||
this.spanData = this.getSpanData(newVal);
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getSpanData(data) {
|
||||
const spanData = {};
|
||||
data.forEach((row, index) => {
|
||||
const key = row['unitAreaCode'];
|
||||
if (!spanData[key]) {
|
||||
spanData[key] = { start: index, count: 0 };
|
||||
}
|
||||
spanData[key].count++;
|
||||
});
|
||||
return spanData;
|
||||
},
|
||||
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||
// 只对“分区”列进行合并
|
||||
if (column.label === '单元区域编码' || column.label === '单元区域名称' || column.label === '区域负责人') {
|
||||
const key = row['unitAreaCode'];
|
||||
const spanInfo = this.spanData[key];
|
||||
if (spanInfo && spanInfo.start === rowIndex) {
|
||||
return {
|
||||
rowspan: spanInfo.count,
|
||||
colspan: 1
|
||||
};
|
||||
}
|
||||
else if (spanInfo && spanInfo.start < rowIndex) {
|
||||
return {
|
||||
rowspan: 0,
|
||||
colspan: 0
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// 其他列不合并
|
||||
return {
|
||||
rowspan: 1,
|
||||
colspan: 1
|
||||
};
|
||||
},
|
||||
checkPermission,
|
||||
beforeInit() {
|
||||
this.url = 'api/dispatchFeeStatistics'
|
||||
const sort = 'id,desc'
|
||||
const sort = 'unitAreaCode,asc'
|
||||
this.params = { page: this.page, size: this.size, sort: sort }
|
||||
const query = this.query
|
||||
const type = query.type
|
||||
|
|
@ -104,6 +156,16 @@ export default {
|
|||
if (type && value) { this.params[type] = value }
|
||||
return true
|
||||
},
|
||||
getAll() {
|
||||
this.beforeInit();
|
||||
this.loading = true
|
||||
list(this.params).then(result => {
|
||||
this.list = result || [];
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
subDelete(id) {
|
||||
this.delLoading = true
|
||||
del(id).then(res => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user