|
|
<template>
|
|
|
<layout-body>
|
|
|
<layout-filter>
|
|
|
<filter-item :label="filters.orderCode.label">
|
|
|
<Input v-model.trim="filters.orderCode.model"
|
|
|
:placeholder="filters.orderCode.holder"></Input>
|
|
|
</filter-item>
|
|
|
<filter-item :label="filters.balanceId.label">
|
|
|
<Input v-model.trim="filters.balanceId.model"
|
|
|
:placeholder="filters.balanceId.holder"></Input>
|
|
|
</filter-item>
|
|
|
<filter-item :label="filters.sku.label">
|
|
|
<Input v-model.trim="filters.sku.model"
|
|
|
:placeholder="filters.sku.holder"></Input>
|
|
|
</filter-item>
|
|
|
<filter-item :label="filters.brandId.label">
|
|
|
<select-brand v-model="filters.brandId.model"></select-brand>
|
|
|
</filter-item>
|
|
|
<filter-item :label="filters.status.label">
|
|
|
<Select v-model="filters.status.model" clearable>
|
|
|
<Option v-for="option in filters.status.options"
|
|
|
:value="option.value"
|
|
|
:key="option.value">{{option.label}}</Option>
|
|
|
</Select>
|
|
|
</filter-item>
|
|
|
<filter-item>
|
|
|
<Button @click="returnPage">返回对账单列表</Button>
|
|
|
<Button type="primary" @click="search">筛选</Button>
|
|
|
<Button @click="reset">清空条件</Button>
|
|
|
</filter-item>
|
|
|
</layout-filter>
|
|
|
<layout-action>
|
|
|
<Button type="warning" @click="exportData" class="table-btn">导出</Button>
|
|
|
</layout-action>
|
|
|
<layout-list>
|
|
|
<Table border :columns="tableCols" :data="tableData"></Table>
|
|
|
<Page :total="pageData.total" :current="pageData.pageNo"
|
|
|
@on-change="pageChange" :page-size="20" show-total></Page>
|
|
|
</layout-list>
|
|
|
</layout-body>
|
|
|
<layout-body>
|
|
|
<layout-filter>
|
|
|
<filter-item :label="filters.orderCode.label">
|
|
|
<i-input v-model.trim="filters.orderCode.model" :placeholder="filters.orderCode.holder"></i-input>
|
|
|
</filter-item>
|
|
|
<filter-item :label="filters.balanceId.label">
|
|
|
<i-input v-model.trim="filters.balanceId.model" :placeholder="filters.balanceId.holder"></i-input>
|
|
|
</filter-item>
|
|
|
<filter-item :label="filters.sku.label">
|
|
|
<i-input v-model.trim="filters.sku.model" :placeholder="filters.sku.holder"></i-input>
|
|
|
</filter-item>
|
|
|
<filter-item :label="filters.brandId.label">
|
|
|
<select-brand v-model="filters.brandId.model"></select-brand>
|
|
|
</filter-item>
|
|
|
<filter-item :label="filters.status.label">
|
|
|
<Select v-model="filters.status.model" clearable>
|
|
|
<Option v-for="option in filters.status.options" :key="option.value" :value="option.value">{{
|
|
|
option.label
|
|
|
}}</Option>
|
|
|
</Select>
|
|
|
</filter-item>
|
|
|
<filter-item>
|
|
|
<Button @click="returnPage">返回对账单列表</Button>
|
|
|
<Button type="primary" @click="search">筛选</Button>
|
|
|
<Button @click="reset">清空条件</Button>
|
|
|
</filter-item>
|
|
|
</layout-filter>
|
|
|
<layout-action>
|
|
|
<Button type="warning" class="table-btn" @click="exportData">导出</Button>
|
|
|
</layout-action>
|
|
|
<layout-list>
|
|
|
<Table border :columns="tableCols" :data="tableData"></Table>
|
|
|
<Page
|
|
|
:total="pageData.total"
|
|
|
:current="pageData.pageNo"
|
|
|
:page-size="20"
|
|
|
show-total
|
|
|
@on-change="pageChange"
|
|
|
></Page>
|
|
|
</layout-list>
|
|
|
</layout-body>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import _ from 'lodash';
|
|
|
import detail from './store/detail';
|
|
|
import FinanceService from 'services/finance/finance-service';
|
|
|
import qs from 'querystringify';
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
return detail.call(this);
|
|
|
},
|
|
|
created() {
|
|
|
this.FinanceService = new FinanceService();
|
|
|
this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
filterValues() {
|
|
|
let params = {
|
|
|
balanceId: +this.filters.balanceId.model,
|
|
|
brandId: +this.filters.brandId.model,
|
|
|
orderCode: +this.filters.orderCode.model,
|
|
|
status: this.filters.status.model,
|
|
|
productSku: +this.filters.sku.model,
|
|
|
pageSize: this.pageData.pageSize,
|
|
|
pageNo: this.pageData.pageNo
|
|
|
};
|
|
|
|
|
|
return _.pickBy(params, val => val);
|
|
|
},
|
|
|
search() {
|
|
|
let sumParams = {
|
|
|
balanceId: +this.filters.balanceId.model,
|
|
|
brandId: +this.filters.brandId.model,
|
|
|
orderCode: +this.filters.orderCode.model,
|
|
|
status: +this.filters.status.model,
|
|
|
productSku: +this.filters.sku.model
|
|
|
};
|
|
|
data() {
|
|
|
return detail.call(this);
|
|
|
},
|
|
|
created() {
|
|
|
this.financeService = new FinanceService();
|
|
|
this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
filterValues() {
|
|
|
const params = {
|
|
|
balanceId: +this.filters.balanceId.model,
|
|
|
brandId: +this.filters.brandId.model,
|
|
|
orderCode: +this.filters.orderCode.model,
|
|
|
status: this.filters.status.model,
|
|
|
productSku: +this.filters.sku.model,
|
|
|
pageSize: this.pageData.pageSize,
|
|
|
pageNo: this.pageData.pageNo,
|
|
|
manageMode: 1,
|
|
|
};
|
|
|
|
|
|
this.FinanceService.balanceDetail(this.filterValues()).then(ret => {
|
|
|
this.tableData = _.get(ret, 'data.records', []);
|
|
|
this.pageData.total = _.get(ret, 'data.totalCount', 0);
|
|
|
this.pageData.pageNo = _.get(ret, 'data.pageNo', 1);
|
|
|
|
|
|
this.FinanceService.balanceDetailSum(_.pickBy(sumParams, val => val)).then(result => {
|
|
|
this.tableData.push({
|
|
|
sellTypeDesc: '总计',
|
|
|
salesNums: result.data.sumNums,
|
|
|
clearingPrice: result.data.sumAmount
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
reset() {
|
|
|
this.filters.balanceId.model = null;
|
|
|
this.filters.brandId.model = null;
|
|
|
this.filters.status.model = null;
|
|
|
this.filters.orderCode.model = null;
|
|
|
this.filters.sku.model = null;
|
|
|
this.pageData.pageNo = 1;
|
|
|
this.pageData.total = 0;
|
|
|
this.search();
|
|
|
},
|
|
|
pageChange(val) {
|
|
|
this.pageData.pageNo = val;
|
|
|
this.search();
|
|
|
},
|
|
|
exportData() {
|
|
|
let params = {};
|
|
|
let temp = [];
|
|
|
|
|
|
_.assign(params, this.filterValues());
|
|
|
return _.pickBy(params, val => val);
|
|
|
},
|
|
|
search() {
|
|
|
const sumParams = {
|
|
|
balanceId: +this.filters.balanceId.model,
|
|
|
brandId: +this.filters.brandId.model,
|
|
|
orderCode: +this.filters.orderCode.model,
|
|
|
status: +this.filters.status.model,
|
|
|
productSku: +this.filters.sku.model,
|
|
|
manageMode: 1,
|
|
|
};
|
|
|
|
|
|
_.each(params, (val, key) => {
|
|
|
temp.push(`${key}=${val}`);
|
|
|
});
|
|
|
this.financeService.balanceDetail(this.filterValues()).then(ret => {
|
|
|
this.tableData = _.get(ret, 'data.records', []);
|
|
|
this.pageData.total = _.get(ret, 'data.totalCount', 0);
|
|
|
this.pageData.pageNo = _.get(ret, 'data.pageNo', 1);
|
|
|
|
|
|
const href = `/Api/erp/exportBalanceDetail?${temp.join('&')}`;
|
|
|
this.financeService.balanceDetailSum(_.pickBy(sumParams, val => val)).then(result => {
|
|
|
this.tableData.push({
|
|
|
sellTypeDesc: '总计',
|
|
|
salesNums: result.data.sumNums,
|
|
|
clearingPrice: result.data.sumAmount,
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
reset() {
|
|
|
this.filters.balanceId.model = null;
|
|
|
this.filters.brandId.model = null;
|
|
|
this.filters.status.model = null;
|
|
|
this.filters.orderCode.model = null;
|
|
|
this.filters.sku.model = null;
|
|
|
this.pageData.pageNo = 1;
|
|
|
this.pageData.total = 0;
|
|
|
this.search();
|
|
|
},
|
|
|
pageChange(val) {
|
|
|
this.pageData.pageNo = val;
|
|
|
this.search();
|
|
|
},
|
|
|
exportData() {
|
|
|
const querystring = qs.stringify(this.filterValues(), true);
|
|
|
const href = `${FinanceService.exportBalanceDetail}${querystring}`;
|
|
|
|
|
|
window.open(href, '_blank');
|
|
|
},
|
|
|
returnPage() {
|
|
|
this.$router.push({
|
|
|
name: 'finance.clearing'
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
window.open(href, '_blank');
|
|
|
},
|
|
|
returnPage() {
|
|
|
this.$router.push({
|
|
|
name: 'finance.clearing',
|
|
|
});
|
|
|
},
|
|
|
},
|
|
|
};
|
|
|
</script> |
|
|
|
|
|
<style lang="scss">
|
|
|
</style> |
...
|
...
|
|