Authored by zhangwenxue

feature(franchise): two new pages

<template>
<layout-body>
<layout-filter>
<filter-item :label="filters.balanceId.label">
<Input v-model.trim="filters.balanceId.model"
:placeholder="filters.balanceId.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.trim="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 :label="filters.createTime.label">
<Date-picker
v-model="filters.createTime.model"
placement="bottom-end"
type="daterange" format="yyyy-MM-dd" placeholder="选择日期">
</Date-picker>
</filter-item>
<filter-item>
<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.balanceId.label">
<i-input v-model.trim="filters.balanceId.model" :placeholder="filters.balanceId.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.trim="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 :label="filters.createTime.label">
<Date-picker
v-model="filters.createTime.model"
placement="bottom-end"
type="daterange"
format="yyyy-MM-dd"
placeholder="选择日期"
>
</Date-picker>
</filter-item>
<filter-item>
<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>
... ... @@ -43,116 +50,110 @@ import list from './store/list';
import filter from './store/filter';
import FinanceService from 'services/finance/finance-service';
import _ from 'lodash';
import qs from 'querystringify';
export default {
data() {
return _.assign(list.call(this), filter);
},
created() {
this.FinanceService = new FinanceService();
this.search();
},
computed: {
startTime() {
let createTime = this.filters.createTime.model;
data() {
return _.assign(list.call(this), filter);
},
computed: {
startTime() {
const createTime = this.filters.createTime.model;
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[0] ? createTime[0].getTime() / 1000 : 0;
}
},
endTime() {
let createTime = this.filters.createTime.model;
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[0] ? createTime[0].getTime() / 1000 : 0;
}
},
endTime() {
const createTime = this.filters.createTime.model;
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[1] ? createTime[1].getTime() / 1000 : 0;
}
}
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[1] ? createTime[1].getTime() / 1000 : 0;
}
},
methods: {
filterValues() {
let params = {
type: 1,
balanceId: +this.filters.balanceId.model,
brandId: +this.filters.brandId.model,
status: this.filters.status.model,
beginTime: this.startTime,
endTime: this.endTime,
pageSize: this.pageData.pageSize,
pageNo: this.pageData.pageNo
};
},
created() {
this.financeService = new FinanceService();
this.search();
},
methods: {
filterValues() {
const params = {
type: 1,
balanceId: +this.filters.balanceId.model,
brandId: +this.filters.brandId.model,
status: this.filters.status.model,
beginTime: this.startTime,
endTime: this.endTime,
pageSize: this.pageData.pageSize,
pageNo: this.pageData.pageNo,
manageMode: 1,
};
return _.pickBy(params, val => val);
},
search() {
this.FinanceService.balanceList(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);
});
},
reset() {
this.filters.balanceId.model = null;
this.filters.brandId.model = null;
this.filters.status.model = null;
this.filters.createTime.model = null;
this.pageData.pageNo = 1;
this.pageData.total = 0;
return _.pickBy(params, val => val);
},
search() {
this.financeService.balanceList(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);
});
},
reset() {
this.filters.balanceId.model = null;
this.filters.brandId.model = null;
this.filters.status.model = null;
this.filters.createTime.model = null;
this.pageData.pageNo = 1;
this.pageData.total = 0;
this.search();
},
pageChange(val) {
this.pageData.pageNo = val;
this.search();
},
onClickInfo(params) {
this.$router.push({
name: 'finance.clearing.detail',
params: {},
query: {
balanceId: params.row.balanceId,
brandId: params.row.brandId,
status: {
未结算: 1,
已结算: 2
}[params.row.statusDesc]
}
});
this.search();
},
pageChange(val) {
this.pageData.pageNo = val;
this.search();
},
onClickInfo(params) {
this.$router.push({
name: 'finance.clearing.detail',
params: {},
query: {
balanceId: params.row.balanceId,
brandId: params.row.brandId,
status: {
未结算: 1,
已结算: 2,
}[params.row.statusDesc],
},
onClickStock(params) {
let opt = _.pickBy({
brandId: params.row.brandId,
begin: params.row.startTime,
end: params.row.endTime,
supplierName: params.row.supplierName
}, val => val);
this.$router.push({
name: 'finance.clearing.stock',
params: {},
query: opt
});
});
},
onClickStock(params) {
const opt = _.pickBy(
{
brandId: params.row.brandId,
begin: params.row.startTime,
end: params.row.endTime,
supplierName: params.row.supplierName,
},
exportData() {
let params = {};
let temp = [];
_.assign(params, this.filterValues());
val => val
);
_.each(params, (val, key) => {
temp.push(`${key}=${val}`);
});
const href = `/Api/erp/exportBalanceList?${temp.join('&')}`;
this.$router.push({
name: 'finance.clearing.stock',
params: {},
query: opt,
});
},
exportData() {
const querystring = qs.stringify(this.filterValues(), true);
const href = `${FinanceService.exportBalanceList}${querystring}`;
window.open(href, '_blank');
}
}
window.open(href, '_blank');
},
},
};
</script>
<style lang="scss">
</style>
... ...
<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>
... ...
export default [{
export default [
{
path: '/clearing.html',
name: 'clearing',
component: () => import(/* webpackChunkName: "finance.clearing" */'./clearing'),
component: () => import(/* webpackChunkName: "finance.clearing" */ './clearing'),
meta: {
pageName: '对账单'
}
}, {
pageName: '自营店-对账单',
},
},
{
path: '/detail.html',
name: 'detail',
component: () => import(/* webpackChunkName: "finance.clearing" */'./detail'),
component: () => import(/* webpackChunkName: "finance.clearing" */ './detail'),
meta: {
pageName: '对账单明细'
}
}, {
pageName: '自营店-对账单明细',
},
},
{
path: '/stock.html',
name: 'stock',
component: () => import(/* webpackChunkName: "trade.printDetail" */'./stock'),
component: () => import(/* webpackChunkName: "trade.printDetail" */ './stock'),
meta: {
pageName: '对账单库存'
}
}];
pageName: '自营店-对账单库存',
},
},
];
... ...
<template>
<layout-body>
<layout-filter>
<filter-item :label="filters.brandId.label">
<select-brand v-model="filters.brandId.model"></select-brand>
</filter-item>
<filter-item :label="filters.createTime.label">
<Date-picker v-model="filters.createTime.model"
type="daterange" format="yyyy-MM-dd" placeholder="选择日期">
</Date-picker>
</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>
<Button type="success" @click="print" 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.brandId.label">
<select-brand v-model="filters.brandId.model"></select-brand>
</filter-item>
<filter-item :label="filters.createTime.label">
<Date-picker v-model="filters.createTime.model" type="daterange" format="yyyy-MM-dd" placeholder="选择日期">
</Date-picker>
</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>
<Button type="success" class="table-btn" @click="print">打印</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 stock from './store/stock';
import FinanceService from 'services/finance/finance-service';
import _ from 'lodash';
import qs from 'querystringify';
export default {
data() {
return stock.call(this);
},
created() {
this.FinanceService = new FinanceService();
this.search();
},
computed: {
startTime() {
let createTime = this.filters.createTime.model;
data() {
return stock.call(this);
},
computed: {
startTime() {
const createTime = this.filters.createTime.model;
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[0] ? createTime[0].getTime() / 1000 : 0;
}
},
endTime() {
let createTime = this.filters.createTime.model;
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[0] ? createTime[0].getTime() / 1000 : 0;
}
},
endTime() {
const createTime = this.filters.createTime.model;
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[1] ? parseInt(createTime[1].getTime() / 1000, 10) : 0;
}
}
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[1] ? parseInt(createTime[1].getTime() / 1000, 10) : 0;
}
},
methods: {
search() {
let params = {
brandId: +this.filters.brandId.model,
beginTime: this.startTime || this.curDay,
endTime: this.endTime || this.curDay,
pageSize: this.pageData.pageSize,
pageNo: this.pageData.pageNo
};
},
created() {
this.financeService = new FinanceService();
this.search();
},
methods: {
search() {
let params = {
brandId: +this.filters.brandId.model,
beginTime: this.startTime || this.curDay,
endTime: this.endTime || this.curDay,
pageSize: this.pageData.pageSize,
pageNo: this.pageData.pageNo,
manageMode: 1,
};
params = _.pickBy(params, val => val);
params = _.pickBy(params, val => val);
this.FinanceService.inventoryLedgerList(params).then(ret => {
this.tableData = _.get(ret, 'data.records', []);
this.pageData.total = _.get(ret, 'data.totalCount', 0);
this.pageData.pageNo = _.get(ret, 'data.pageNo', 1);
});
},
reset() {
this.filters.brandId.model = null;
this.filters.createTime.model = null;
this.pageData.pageNo = 1;
this.pageData.total = 0;
this.search();
},
pageChange(val) {
this.pageData.pageNo = val;
this.search();
this.financeService.inventoryLedgerList(params).then(ret => {
this.tableData = _.get(ret, 'data.records', []);
this.pageData.total = _.get(ret, 'data.totalCount', 0);
this.pageData.pageNo = _.get(ret, 'data.pageNo', 1);
});
},
reset() {
this.filters.brandId.model = null;
this.filters.createTime.model = null;
this.pageData.pageNo = 1;
this.pageData.total = 0;
this.search();
},
pageChange(val) {
this.pageData.pageNo = val;
this.search();
},
print() {
const querystring = qs.stringify(
{
brandId: this.filters.brandId.model,
begin: this.startTime,
end: this.endTime,
page: this.pageData.pageNo,
supplierName: this.$route.query.supplierName,
manageMode: 1,
},
print() {
const href = `/finance/print/clearing/stock.html?brandId=${this.filters.brandId.model}&begin=${this.startTime}&end=${this.endTime}&page=${this.pageData.pageNo}&supplierName=${this.$route.query.supplierName}`;
true
);
window.open(href, '_blank');
const href = `/finance/print/clearing/stock.html${querystring}`;
window.open(href, '_blank');
},
exportData() {
const querystring = qs.stringify(
{
beginTime: this.startTime,
endTime: this.endTime,
manageMode: 1,
},
exportData() {
const beginTime = this.startTime;
const endTime = this.endTime;
true
);
const href = '/Api/erp/exportInventoryLedgerList?' +
`beginTime=${beginTime}&endTime=${endTime}`;
const href = `${FinanceService.exportInventory}${querystring}`;
window.open(href, '_blank');
},
returnPage() {
this.$router.push({
name: 'finance.clearing'
});
}
}
window.open(href, '_blank');
},
returnPage() {
this.$router.push({
name: 'finance.clearing',
});
},
},
};
</script>
... ...
... ... @@ -4,136 +4,136 @@
* @date: 2017/07/11
*/
export default function() {
return {
tableCols: [
{
title: '对账单号',
key: 'balanceId',
align: 'center'
},
{
title: 'SKU',
key: 'productSku',
align: 'center'
},
{
title: '产品名称',
key: 'productName',
align: 'center',
},
{
title: '商家商品编码',
key: 'factoryCode',
align: 'center',
},
{
title: '品牌',
key: 'brandName',
align: 'center'
},
{
title: '订单号',
key: 'orderCode',
align: 'center'
},
{
title: '业务类型',
key: 'typeDesc',
align: 'center'
},
{
title: '吊牌价',
key: 'retailPrice',
align: 'center'
},
{
title: '成交价',
key: 'lastPrice',
align: 'center'
},
{
title: '折扣',
key: 'purchaseDiscount',
align: 'center'
},
{
title: '结算类型',
key: 'sellTypeDesc',
align: 'center'
},
{
title: '数量',
key: 'salesNums',
align: 'center'
},
{
title: '结算价',
key: 'clearingPrice',
align: 'center'
},
{
title: '审核',
key: 'checkDesc',
align: 'center'
},
{
title: '状态',
key: 'statusDesc',
align: 'center'
}
return {
tableCols: [
{
title: '对账单号',
key: 'balanceId',
align: 'center',
},
{
title: 'SKU',
key: 'productSku',
align: 'center',
},
{
title: '产品名称',
key: 'productName',
align: 'center',
},
{
title: '商家商品编码',
key: 'factoryCode',
align: 'center',
},
{
title: '品牌',
key: 'brandName',
align: 'center',
},
{
title: '订单号',
key: 'orderCode',
align: 'center',
},
{
title: '业务类型',
key: 'typeDesc',
align: 'center',
},
{
title: '吊牌价',
key: 'retailPrice',
align: 'center',
},
{
title: '成交价',
key: 'lastPrice',
align: 'center',
},
{
title: '折扣',
key: 'purchaseDiscount',
align: 'center',
},
{
title: '结算类型',
key: 'sellTypeDesc',
align: 'center',
},
{
title: '数量',
key: 'salesNums',
align: 'center',
},
{
title: '结算价',
key: 'clearingPrice',
align: 'center',
},
{
title: '审核',
key: 'checkDesc',
align: 'center',
},
{
title: '状态',
key: 'statusDesc',
align: 'center',
},
],
tableData: [],
pageData: {
total: 0,
pageNo: 1,
pageSize: 20,
},
filters: {
orderCode: {
label: '订单号',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18,
},
sku: {
label: 'SKU',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18,
},
balanceId: {
label: '对账单号',
labelSpan: 6,
model: this.$route.query.balanceId,
holder: '',
fieldSpan: 18,
},
brandId: {
label: '品牌',
labelSpan: 6,
model: this.$route.query.brandId,
holder: '',
fieldSpan: 18,
},
status: {
label: '状态',
labelSpan: 6,
model: this.$route.query.status,
holder: '',
fieldSpan: 18,
options: [
{
value: 1,
label: '未结算',
},
{
value: 2,
label: '已结算',
},
],
tableData: [],
pageData: {
total: 0,
pageNo: 1,
pageSize: 20
},
filters: {
orderCode: {
label: '订单号',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
},
sku: {
label: 'SKU',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
},
balanceId: {
label: '对账单号',
labelSpan: 6,
model: this.$route.query.balanceId,
holder: '',
fieldSpan: 18
},
brandId: {
label: '品牌',
labelSpan: 6,
model: this.$route.query.brandId,
holder: '',
fieldSpan: 18
},
status: {
label: '状态',
labelSpan: 6,
model: this.$route.query.status,
holder: '',
fieldSpan: 18,
options: [
{
value: 1,
label: '未结算'
},
{
value: 2,
label: '已结算'
}
]
}
}
};
},
},
};
}
... ...
let date = new Date();
let agoMonthFirstDay = new Date(date.getFullYear(), date.getMonth() - 1, 1);
let agoMonthLastDay = new Date(date.getFullYear(), date.getMonth(), 1);
const date = new Date();
const agoMonthFirstDay = new Date(date.getFullYear(), date.getMonth() - 1, 1);
const agoMonthLastDay = new Date(date.getFullYear(), date.getMonth(), 1);
export default {
filters: {
balanceId: {
label: '对账单号',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
filters: {
balanceId: {
label: '对账单号',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18,
},
brandId: {
label: '品牌',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18,
},
createTime: {
label: '创建时间',
labelSpan: 6,
model: [agoMonthFirstDay, agoMonthLastDay],
holder: '',
fieldSpan: 18,
},
status: {
label: '状态',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18,
options: [
{
value: 1,
label: '未结算',
},
brandId: {
label: '品牌',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
{
value: 2,
label: '已结算',
},
createTime: {
label: '创建时间',
labelSpan: 6,
model: [agoMonthFirstDay, agoMonthLastDay],
holder: '',
fieldSpan: 18
},
status: {
label: '状态',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18,
options: [
{
value: 1,
label: '未结算'
},
{
value: 2,
label: '已结算'
}
]
}
}
],
},
},
};
... ...
... ... @@ -7,84 +7,88 @@
import moment from 'moment';
export default function() {
return {
tableCols: [
{
title: '对账单号',
key: 'balanceId',
align: 'center'
},
{
title: '生成日期',
key: 'createTimeString',
align: 'center',
render: function(h, params) {
if (params.row.createTime) {
let time = moment.unix(params.row.createTime);
return {
tableCols: [
{
title: '对账单号',
key: 'balanceId',
align: 'center',
},
{
title: '生成日期',
key: 'createTimeString',
align: 'center',
render(h, params) {
if (params.row.createTime) {
const time = moment.unix(params.row.createTime);
return (
<div>
<div> {time.format('YYYY/MM/DD')} </div>
<div> {time.format('HH:mm:ss')} </div>
</div>
);
} else {
return '';
}
}
},
{
title: '结算周期',
key: 'clearingCycle',
align: 'center',
},
{
title: '品牌',
key: 'brandName',
align: 'center',
},
{
title: '供应商',
key: 'supplierName',
align: 'center'
},
{
title: '应收金额',
key: 'clearingAmount',
align: 'center'
},
{
title: '状态',
key: 'statusDesc',
align: 'center'
},
{
title: '操作',
key: 'action',
width: 250,
align: 'center',
render: (h, params) => {
let info = (
<i-button type="primary" size="small" onClick={() => this.onClickInfo(params)}>查看明细</i-button>
);
return (
<div>
<div> {time.format('YYYY/MM/DD')} </div>
<div> {time.format('HH:mm:ss')} </div>
</div>
);
} else {
return '';
}
},
},
{
title: '结算周期',
key: 'clearingCycle',
align: 'center',
},
{
title: '品牌',
key: 'brandName',
align: 'center',
},
{
title: '供应商',
key: 'supplierName',
align: 'center',
},
{
title: '应收金额',
key: 'clearingAmount',
align: 'center',
},
{
title: '状态',
key: 'statusDesc',
align: 'center',
},
{
title: '操作',
key: 'action',
width: 250,
align: 'center',
render: (h, params) => {
const info = (
<i-button type="primary" size="small" onClick={() => this.onClickInfo(params)}>
查看明细
</i-button>
);
let stock = (
<i-button type="primary" size="small" onClick={() => this.onClickStock(params)}>库存</i-button>
);
const stock = (
<i-button type="primary" size="small" onClick={() => this.onClickStock(params)}>
库存
</i-button>
);
return (
<div class="action-btn-row">
{info} {stock}
</div>
);
}
}
],
tableData: [],
pageData: {
total: 0,
pageNo: 1,
pageSize: 20
}
};
return (
<div class="action-btn-row">
{info} {stock}
</div>
);
},
},
],
tableData: [],
pageData: {
total: 0,
pageNo: 1,
pageSize: 20,
},
};
}
... ...
... ... @@ -6,98 +6,102 @@
import moment from 'moment';
export default function() {
return {
tableCols: [
{
title: '商品编号',
key: 'productSku',
align: 'center'
},
{
title: '产品名称',
key: 'productName',
align: 'center'
},
{
title: '厂家编号',
key: 'factoryCode',
align: 'center',
},
{
title: '请购类型',
key: 'sellTypeName',
align: 'center',
},
{
title: '初期数量',
key: 'supplier90Sell',
align: 'center'
},
{
title: '进货数量',
key: 'supplier11Sell',
align: 'center'
},
{
title: '销售数量',
key: 'supplier30Sell',
align: 'center'
},
{
title: '销退数量',
key: 'supplier33Sell',
align: 'center'
},
{
title: '退供应商数量',
key: 'supplier10Sell',
align: 'center'
},
{
title: '其他出库数量',
key: 'supplier60Sell',
align: 'center'
},
{
title: '地面店出库数量',
key: 'supplier70Sell',
align: 'center'
},
{
title: '地面店入库数量',
key: 'supplier71Sell',
align: 'center'
},
{
title: '期末库存数量',
key: 'supplier100Sell',
align: 'center'
}
return {
tableCols: [
{
title: '商品编号',
key: 'productSku',
align: 'center',
},
{
title: '产品名称',
key: 'productName',
align: 'center',
},
{
title: '厂家编号',
key: 'factoryCode',
align: 'center',
},
{
title: '请购类型',
key: 'sellTypeName',
align: 'center',
},
{
title: '初期数量',
key: 'supplier90Sell',
align: 'center',
},
{
title: '进货数量',
key: 'supplier11Sell',
align: 'center',
},
{
title: '销售数量',
key: 'supplier30Sell',
align: 'center',
},
{
title: '销退数量',
key: 'supplier33Sell',
align: 'center',
},
{
title: '退供应商数量',
key: 'supplier10Sell',
align: 'center',
},
{
title: '其他出库数量',
key: 'supplier60Sell',
align: 'center',
},
{
title: '地面店出库数量',
key: 'supplier70Sell',
align: 'center',
},
{
title: '地面店入库数量',
key: 'supplier71Sell',
align: 'center',
},
{
title: '期末库存数量',
key: 'supplier100Sell',
align: 'center',
},
],
tableData: [],
pageData: {
total: 0,
pageNo: 1,
pageSize: 20,
},
filters: {
brandId: {
label: '品牌',
labelSpan: 6,
model: this.$route.query.brandId,
holder: '',
fieldSpan: 18,
},
createTime: {
label: '创建时间',
labelSpan: 6,
model: [
new Date(+this.$route.query.begin * 1000),
new Date(
moment(this.$route.query.begin * 1000)
.endOf('month')
.format('YYYY-MM-DD') + ' 00:00:00'
),
],
tableData: [],
pageData: {
total: 0,
pageNo: 1,
pageSize: 20
},
filters: {
brandId: {
label: '品牌',
labelSpan: 6,
model: this.$route.query.brandId,
holder: '',
fieldSpan: 18
},
createTime: {
label: '创建时间',
labelSpan: 6,
model: [
new Date(+this.$route.query.begin * 1000),
new Date(moment(this.$route.query.begin * 1000).endOf('month').format('YYYY-MM-DD') + ' 00:00:00')
],
holder: '',
fieldSpan: 18
}
}
};
holder: '',
fieldSpan: 18,
},
},
};
}
... ...
<template>
<layout-body>
<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 list from './store/list';
import FranchiseService from 'services/finance/franchise-service';
import _ from 'lodash';
export default {
data() {
return list.call(this);
},
created() {
this.franchiseService = new FranchiseService();
this.search();
},
methods: {
filterValues() {
const params = {
type: 1,
beginTime: this.startTime,
endTime: this.endTime,
pageSize: this.pageData.pageSize,
pageNo: this.pageData.pageNo,
manageMode: 2,
};
return _.pickBy(params, val => val);
},
search() {
this.franchiseService.balanceList(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);
});
},
reset() {
this.pageData.pageNo = 1;
this.pageData.total = 0;
this.search();
},
pageChange(val) {
this.pageData.pageNo = val;
this.search();
},
onClickInfo(params) {
this.$router.push({
name: 'finance.franchise-clearing.detail',
params: {},
query: {
balanceId: params.row.balanceId,
brandId: params.row.brandId,
status: {
未结算: 1,
已结算: 2,
}[params.row.statusDesc],
productSku: params.row.productSku,
orderCode: params.row.orderCode,
type: params.row.type,
agreementIsAbnormal: params.row.agreementIsAbnormal,
},
});
},
},
};
</script>
... ...
<template>
<layout-body>
<layout-filter>
<filter-item :label="filters.createTime.label">
<Date-picker v-model="filters.createTime.model" type="daterange" format="yyyy-MM-dd" placeholder="选择日期">
</Date-picker>
</filter-item>
<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.productSku.label">
<i-input v-model.trim="filters.productSku.model" :placeholder="filters.productSku.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.type.label">
<Select v-model="filters.type.model" clearable>
<Option v-for="option in filters.type.options" :key="option.value" :value="option.value">{{
option.label
}}</Option>
</Select>
</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 :label="filters.agreementIsAbnormal.label">
<Select v-model="filters.agreementIsAbnormal.model" clearable>
<Option v-for="option in filters.agreementIsAbnormal.options" :key="option.value" :value="option.value">{{
option.label
}}</Option>
</Select>
</filter-item>
<filter-item>
<Button @click="returnPage">返回对账单列表</Button>
<Button type="primary" :loading="loading" @click="search">筛选</Button>
<Button @click="reset">清空条件</Button>
<Button type="warning" class="table-btn" @click="exportData">导出</Button>
</filter-item>
</layout-filter>
<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 FranchiseService from 'services/finance/franchise-service';
import qs from 'querystringify';
export default {
data() {
return detail.call(this);
},
computed: {
startTime() {
const createTime = this.filters.createTime.model;
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[0] ? createTime[0].getTime() / 1000 : 0;
}
},
endTime() {
const createTime = this.filters.createTime.model;
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[1] ? createTime[1].getTime() / 1000 : 0;
}
},
},
created() {
this.franchiseService = new FranchiseService();
this.search();
},
methods: {
filterValues() {
const params = {
salesTimeBegin: this.startTime,
salesTimeEnd: this.endTime,
orderCode: +this.filters.orderCode.model,
balanceId: +this.filters.balanceId.model,
productSku: +this.filters.productSku.model,
brandId: +this.filters.brandId.model,
type: +this.filters.type.model,
agreementIsAbnormal: +this.filters.agreementIsAbnormal.model,
status: this.filters.status.model,
pageSize: this.pageData.pageSize,
pageNo: this.pageData.pageNo,
manageMode: 2,
};
return _.pickBy(params, val => val);
},
search() {
// const sumParams = _.pickBy(
// {
// 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: 2,
// },
// val => val
// );
if (this.loading) {
return;
}
this.loading = true;
const params = this.filterValues();
return Promise.all([
this.franchiseService.balanceDetail(params),
this.franchiseService.balanceSumNums(params),
this.franchiseService.balanceSumAmount(params),
])
.then(([list, sumNums, sumAmount]) => {
this.tableData = _.get(list, 'data.records', []);
this.pageData.total = _.get(list, 'data.totalCount', 0);
this.pageData.pageNo = _.get(list, 'data.pageNo', 1);
this.tableData.push({
sellTypeDesc: '总计',
salesNums: +sumNums.data,
clearingPrice: +sumAmount.data,
});
this.loading = false;
})
.catch(() => {
this.loading = false;
});
},
reset() {
this.filters.createTime.model = null;
this.filters.orderCode.model = null;
this.filters.productSku.model = null;
this.filters.balanceId.model = null;
this.filters.brandId.model = null;
this.filters.type.model = null;
this.filters.status.model = null;
this.filters.agreementIsAbnormal.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 = `${FranchiseService.exportBalanceDetail}${querystring}`;
window.open(href, '_blank');
},
returnPage() {
this.$router.push({
name: 'finance.franchise-clearing.clearing',
});
},
},
};
</script>
<style lang="scss">
.table-btn {
margin-left: 15px;
}
</style>
... ...
export default [
{
path: '/clearing.html',
name: 'clearing',
component: () => import(/* webpackChunkName: "finance.clearing" */ './clearing'),
meta: {
pageName: '专营店-对账单',
},
},
{
path: '/detail.html',
name: 'detail',
component: () => import(/* webpackChunkName: "finance.clearing" */ './detail'),
meta: {
pageName: '专营店-对账单明细',
},
},
];
... ...
export default function() {
return {
loading: false,
tableCols: [
{
title: '对账单号',
key: 'balanceId',
align: 'center',
},
{
title: 'SKU',
key: 'productSku',
align: 'center',
},
{
title: '产品名称',
key: 'productName',
align: 'center',
},
{
title: '厂商编号',
key: 'factoryCode',
align: 'center',
},
{
title: '品牌',
key: 'brandName',
align: 'center',
},
{
title: '订单号',
key: 'orderCode',
align: 'center',
},
{
title: '订单渠道',
key: 'orderTypeDesc',
align: 'center',
},
{
title: '业务类型',
key: 'typeDesc',
align: 'center',
},
// {
// title: '吊牌价',
// key: 'retailPrice',
// align: 'center',
// },
{
title: '平台服务费比例',
key: 'yohoDeservePercent',
align: 'center',
},
{
title: '结算类型',
key: 'sellTypeDesc',
align: 'center',
},
{
title: '数量',
key: 'salesNums',
align: 'center',
},
{
title: '供应商应得单价',
key: 'clearingPrice',
align: 'center',
render(h, params) {
return (params.row.clearingPrice * params.row.salesNums).toFixed(2);
},
},
{
title: '审核状态',
key: 'checkDesc',
align: 'center',
},
{
title: '结算单状态',
key: 'statusDesc',
align: 'center',
},
{
title: '合同类型',
key: 'agreementIsAbnormalDesc',
align: 'center',
},
],
tableData: [],
pageData: {
total: 0,
pageNo: 1,
pageSize: 20,
},
filters: {
createTime: {
label: '创建时间',
labelSpan: 6,
model: null,
holder: '',
fieldSpan: 18,
},
orderCode: {
label: '订单号',
labelSpan: 6,
model: this.$route.query.orderCode,
holder: '订单号',
fieldSpan: 18,
},
productSku: {
label: 'SKU',
labelSpan: 6,
model: this.$route.query.productSku,
holder: 'SKU',
fieldSpan: 18,
},
balanceId: {
label: '对账单号',
labelSpan: 6,
model: this.$route.query.balanceId,
holder: '对账单号',
fieldSpan: 18,
},
brandId: {
label: '品牌',
labelSpan: 6,
model: this.$route.query.brandId,
holder: '品牌',
fieldSpan: 18,
},
type: {
label: '业务类型',
labelSpan: 6,
model: this.$route.query.type,
holder: '业务类型',
fieldSpan: 18,
options: [
{
value: 30,
label: '订单出库',
},
{
value: 31,
label: '换货入库',
},
{
value: 32,
label: '换货出库',
},
{
value: 33,
label: '退货入库',
},
{
value: 60,
label: '促销出库',
},
{
value: 75,
label: '盘亏出库',
},
{
value: 76,
label: '分销销售',
},
{
value: 77,
label: '分销退货',
},
{
value: 80,
label: '残次出库',
},
{
value: 90,
label: 'VIP折扣',
},
{
value: 91,
label: '优惠券结算',
},
{
value: 92,
label: '分销促销',
},
{
value: 96,
label: '特退补差价',
},
{
value: 97,
label: '红包结算',
},
],
},
status: {
label: '结算状态',
labelSpan: 6,
model: this.$route.query.status,
holder: '结算状态',
fieldSpan: 18,
options: [
{
value: 1,
label: '未结算',
},
{
value: 2,
label: '已结算',
},
],
},
agreementIsAbnormal: {
label: '合同类型',
labelSpan: 6,
model: this.$route.query.agreementIsAbnormal,
holder: '合同类型',
fieldSpan: 18,
options: [
{
value: 1,
label: '正常',
},
{
value: 2,
label: '异常',
},
],
},
},
};
}
... ...
import moment from 'moment';
export default function() {
return {
tableCols: [
{
title: 'ID',
key: 'id',
align: 'center',
},
{
title: '专营店代销对账单',
key: 'balanceName',
align: 'center',
},
{
title: '开始时间',
key: 'startTime',
align: 'center',
render(h, params) {
if (params.row.startTime) {
const time = moment(params.row.startTime * 1000);
return <div> {time.format('YYYY/MM/DD')} </div>;
} else {
return '';
}
},
},
{
title: '结束时间',
key: 'endTime',
align: 'center',
render(h, params) {
if (params.row.endTime) {
const time = moment(params.row.endTime * 1000);
return <div> {time.format('YYYY/MM/DD')} </div>;
} else {
return '';
}
},
},
{
title: '备注',
key: 'remark',
align: 'center',
},
{
title: '状态',
key: 'statusDesc',
align: 'center',
},
{
title: '操作人',
key: 'operator',
align: 'center',
},
{
title: '操作时间',
key: 'createTime',
align: 'center',
render(h, params) {
if (params.row.createTime) {
const time = moment(params.row.createTime * 1000);
return <div> {time.format('YYYY/MM/DD')} </div>;
} else {
return '';
}
},
},
{
title: '开票人',
key: 'clearingOperator',
align: 'center',
},
{
title: '操作',
key: 'action',
width: 100,
align: 'center',
render: (h, params) => {
return (
<div class="action-btn-row">
<i-button type="primary" size="small" onClick={() => this.onClickInfo(params)}>
查看明细
</i-button>
</div>
);
},
},
],
tableData: [],
pageData: {
total: 0,
pageNo: 1,
pageSize: 20,
},
};
}
... ...
<template>
<layout-body>
<layout-filter>
<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>
<Button @click="returnPage">返回结算单列表</Button>
<Button type="primary" :loading="loading" @click="search">筛选</Button>
<Button @click="reset">清空条件</Button>
<Button type="warning" class="table-btn" @click="exportData">导出</Button>
</filter-item>
</layout-filter>
<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 detail from './store/detail';
import FranchiseService from 'services/finance/franchise-service';
import _ from 'lodash';
import qs from 'querystringify';
export default {
data() {
return detail.call(this);
},
created() {
this.franchiseService = new FranchiseService();
this.search();
},
methods: {
filterValues() {
const params = {
balanceId: +this.filters.balanceId.model,
brandId: +this.filters.brandId.model,
productSku: +this.filters.sku.model,
pageSize: this.pageData.pageSize,
pageNo: this.pageData.pageNo,
manageMode: 2,
};
return _.pickBy(params, val => val);
},
search() {
// const sumParams = _.pickBy(
// {
// balanceId: +this.filters.balanceId.model,
// brandId: +this.filters.brandId.model,
// productSku: +this.filters.sku.model,
// manageMode: 2,
// },
// val => val
// );
if (this.loading) {
return;
}
this.loading = true;
// using pagination
const params = this.filterValues();
return Promise.all([
this.franchiseService.settlementDetail(params),
this.franchiseService.settlementSumNums(params),
this.franchiseService.settlementSumAmount(params),
])
.then(([list, sumNums, sumAmount]) => {
this.tableData = _.get(list, 'data.records', []);
this.pageData.total = _.get(list, 'data.totalCount', 0);
this.pageData.pageNo = _.get(list, 'data.pageNo', 1);
this.tableData.push({
agencyTypeDesc: '总计',
salesNums: +sumNums.data,
paymentAmount: +sumAmount.data,
});
this.loading = false;
})
.catch(() => {
this.loading = false;
});
},
reset() {
this.filters.balanceId.model = null;
this.filters.brandId.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 = `${FranchiseService.exportSettlementDetail}${querystring}`;
window.open(href, '_blank');
},
returnPage() {
this.$router.push({
name: 'finance.franchise-payment.payment',
});
},
},
};
</script>
<style scoped lang="scss">
.table-btn {
margin-left: 15px;
}
</style>
... ...
export default [
{
path: '/payment.html',
name: 'payment',
component: () => import(/* webpackChunkName: "finance.payment" */ './payment'),
meta: {
pageName: '专营店-结算单',
},
},
{
path: '/detail.html',
name: 'detail',
component: () => import(/* webpackChunkName: "finance.payment" */ './detail'),
meta: {
pageName: '专营店-结算单详情',
},
},
];
... ...
<template>
<layout-body>
<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 list from './store/list';
import FranchiseService from 'services/finance/franchise-service';
import _ from 'lodash';
export default {
data() {
return list.call(this);
},
created() {
this.franchiseService = new FranchiseService();
this.search();
},
methods: {
filterValues() {
const params = {
type: 2,
pageSize: this.pageData.pageSize,
pageNo: this.pageData.pageNo,
manageMode: 2,
};
return _.pickBy(params, val => val);
},
search() {
this.franchiseService.settlementList(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);
});
},
pageChange(val) {
this.pageData.pageNo = val;
this.search();
},
onClickInfo(params) {
this.$router.push({
name: 'finance.franchise-payment.detail',
params: {},
query: {
balanceId: params.row.balanceId,
brandId: params.row.brandId,
supplierName: params.row.supplierName,
createTime: params.row.createTimeString,
},
});
},
},
};
</script>
... ...
export default function() {
return {
loading: false,
tableCols: [
{
title: '结算单号',
key: 'balanceId',
align: 'center',
},
{
title: 'SKU',
key: 'productSku',
align: 'center',
},
{
title: '产品名称',
key: 'productName',
align: 'center',
},
{
title: '厂家编号',
key: 'factoryCode',
align: 'center',
},
{
title: '尺码',
key: 'sizeName',
align: 'center',
},
{
title: '品牌',
key: 'brandName',
align: 'center',
},
{
title: '供应商',
key: 'supplierName',
align: 'center',
},
{
title: '业务类型',
key: 'agencyTypeDesc',
align: 'center',
},
{
title: '数量',
key: 'salesNums',
align: 'center',
},
{
title: '销售供应商应得',
key: 'paymentAmount',
align: 'center',
render(h, params) {
return (params.row.salesNums * params.row.paymentAmount).toFixed(2);
},
},
{
title: '付款状态',
key: 'payerStatusDesc',
align: 'center',
},
{
title: '结算人',
key: 'applicantOperator',
align: 'center',
},
{
title: '付款人',
key: 'payerOperator',
align: 'center',
},
{
title: '对账起止日期',
key: 'clearingInterval',
align: 'center',
},
],
tableData: [],
pageData: {
total: 0,
pageNo: 1,
pageSize: 20,
},
filters: {
balanceId: {
label: '结算单号',
labelSpan: 6,
model: this.$route.query.balanceId,
holder: '',
fieldSpan: 18,
},
sku: {
label: 'SKU',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18,
},
brandId: {
label: '品牌',
labelSpan: 6,
model: this.$route.query.brandId,
holder: '',
fieldSpan: 18,
},
},
};
}
... ...
import moment from 'moment';
export default function() {
return {
tableCols: [
{
title: 'ID',
key: 'id',
align: 'center',
},
{
title: '代销对账单',
key: 'balanceName',
align: 'center',
},
{
title: '开始时间',
key: 'startTime',
align: 'center',
render(h, params) {
if (params.row.startTime) {
const time = moment(params.row.startTime * 1000);
return <div> {time.format('YYYY/MM/DD')} </div>;
} else {
return '';
}
},
},
{
title: '结束时间',
key: 'endTime',
align: 'center',
render(h, params) {
if (params.row.endTime) {
const time = moment(params.row.endTime * 1000);
return <div> {time.format('YYYY/MM/DD')} </div>;
} else {
return '';
}
},
},
{
title: '备注',
key: 'remark',
align: 'center',
},
{
title: '状态',
key: 'statusDesc',
align: 'center',
},
{
title: '操作人',
key: 'operator',
align: 'center',
},
{
title: '操作时间',
key: 'createTime',
align: 'center',
render(h, params) {
if (params.row.createTime) {
const time = moment(params.row.createTime * 1000);
return <div> {time.format('YYYY/MM/DD')} </div>;
} else {
return '';
}
},
},
{
title: '操作',
key: 'action',
width: 250,
align: 'center',
render: (h, params) => {
return (
<div class="action-btn-row">
<i-button type="primary" size="small" onClick={() => this.onClickInfo(params)}>
查看明细
</i-button>
</div>
);
},
},
],
tableData: [],
pageData: {
total: 0,
pageNo: 1,
pageSize: 20,
},
};
}
... ...
import clearing from './clearing';
import payment from './payment';
import franchiseClearing from './franchise-clearing';
import franchisePayment from './franchise-payment';
import print from './print';
import stock from './stock';
import invoice from './invoice';
export default {
clearing,
payment,
'franchise-clearing': franchiseClearing,
'franchise-payment': franchisePayment,
print,
stock,
invoice,
... ...
<template>
<layout-body>
<layout-filter>
<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>
<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>
<Button type="success" @click="print" 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.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>
<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>
<Button type="success" class="table-btn" @click="print">打印</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 detail from './store/detail';
import FinanceService from 'services/finance/finance-service';
import _ from 'lodash';
import qs from 'querystringify';
export default {
data() {
return detail.call(this);
},
created() {
this.FinanceService = new FinanceService();
this.search();
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,
productSku: +this.filters.sku.model,
pageSize: this.pageData.pageSize,
pageNo: this.pageData.pageNo,
manageMode: 1,
};
return _.pickBy(params, val => val);
},
methods: {
filterValues() {
let params = {
balanceId: +this.filters.balanceId.model,
brandId: +this.filters.brandId.model,
productSku: +this.filters.sku.model,
pageSize: this.pageData.pageSize,
pageNo: this.pageData.pageNo
};
search() {
const sumParams = {
balanceId: +this.filters.balanceId.model,
brandId: +this.filters.brandId.model,
productSku: +this.filters.sku.model,
manageMode: 1,
};
return _.pickBy(params, val => val);
},
search() {
let sumParams = {
balanceId: +this.filters.balanceId.model,
brandId: +this.filters.brandId.model,
productSku: +this.filters.sku.model
};
this.financeService.settlementList(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.settlementList(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.settlementListSum(_.pickBy(sumParams, val => val)).then(result => {
this.tableData.push({
agencyTypeDesc: '总计',
salesNums: result.data.sumNums,
salesAmount: result.data.sumAmount,
});
});
});
},
reset() {
this.filters.balanceId.model = null;
this.filters.brandId.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.exportSettlementDetail}${querystring}`;
this.FinanceService.settlementListSum(_.pickBy(sumParams, val => val)).then(result => {
this.tableData.push({
agencyTypeDesc: '总计',
salesNums: result.data.sumNums,
salesAmount: result.data.sumAmount
});
});
});
},
reset() {
this.filters.balanceId.model = null;
this.filters.brandId.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();
window.open(href, '_blank');
},
print() {
const querystring = qs.stringify(
{
balanceId: this.filters.balanceId.model,
brandId: this.filters.brandId.model,
sku: this.filters.sku.model,
page: this.pageData.pageNo,
supplierName: this.$route.query.supplierName,
createTime: this.$route.query.createTime,
totalCount: this.pageData.total,
manageMode: 1,
},
exportData() {
let params = {};
let temp = [];
_.assign(params, this.filterValues());
_.each(params, (val, key) => {
temp.push(`${key}=${val}`);
});
const href = `/Api/erp/exportSettlementDetail?${temp.join('&')}`;
true
);
window.open(href, '_blank');
},
print() {
const href = `/finance/print/payment/detail.html?balanceId=${this.filters.balanceId.model}&brandId=${this.filters.brandId.model}&sku=${this.filters.sku.model}&page=${this.pageData.pageNo}&supplierName=${this.$route.query.supplierName}&createTime=${this.$route.query.createTime}&totalCount=${this.pageData.total}`;
const href = `/finance/print/payment/detail.html${querystring}`;
window.open(href, '_blank');
},
returnPage() {
this.$router.push({
name: 'finance.payment'
});
}
}
window.open(href, '_blank');
},
returnPage() {
this.$router.push({
name: 'finance.payment',
});
},
},
};
</script>
... ...
export default [{
export default [
{
path: '/payment.html',
name: 'payment',
component: () => import(/* webpackChunkName: "finance.payment" */'./payment'),
component: () => import(/* webpackChunkName: "finance.payment" */ './payment'),
meta: {
pageName: '结算单'
}
}, {
pageName: '自营店-结算单',
},
},
{
path: '/detail.html',
name: 'detail',
component: () => import(/* webpackChunkName: "finance.payment" */'./detail'),
component: () => import(/* webpackChunkName: "finance.payment" */ './detail'),
meta: {
pageName: '结算单详情'
}
}, {
pageName: '自营店-结算单详情',
},
},
{
path: '/stock.html',
name: 'stock',
component: () => import(/* webpackChunkName: "trade.printDetail" */'./stock'),
component: () => import(/* webpackChunkName: "trade.printDetail" */ './stock'),
meta: {
pageName: '库存'
}
}];
pageName: '自营店-库存',
},
},
];
... ...
<template>
<layout-body>
<layout-filter>
<filter-item :label="filters.balanceId.label">
<Input v-model.trim="filters.balanceId.model"
:placeholder="filters.balanceId.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.createTime.label">
<Date-picker v-model="filters.createTime.model"
type="daterange" format="yyyy-MM-dd" placeholder="选择日期">
</Date-picker>
</filter-item>
<filter-item>
<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.balanceId.label">
<i-input v-model.trim="filters.balanceId.model" :placeholder="filters.balanceId.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.createTime.label">
<Date-picker v-model="filters.createTime.model" type="daterange" format="yyyy-MM-dd" placeholder="选择日期">
</Date-picker>
</filter-item>
<filter-item>
<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>
... ... @@ -35,112 +37,105 @@ import list from './store/list';
import filter from './store/filter';
import FinanceService from 'services/finance/finance-service';
import _ from 'lodash';
import qs from 'querystringify';
export default {
data() {
return _.assign(list.call(this), filter);
},
created() {
this.FinanceService = new FinanceService();
this.search();
},
computed: {
startTime() {
let createTime = this.filters.createTime.model;
data() {
return _.assign(list.call(this), filter);
},
computed: {
startTime() {
const createTime = this.filters.createTime.model;
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[0] ? createTime[0].getTime() / 1000 : 0;
}
},
endTime() {
let createTime = this.filters.createTime.model;
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[0] ? createTime[0].getTime() / 1000 : 0;
}
},
endTime() {
const createTime = this.filters.createTime.model;
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[1] ? createTime[1].getTime() / 1000 : 0;
}
}
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[1] ? createTime[1].getTime() / 1000 : 0;
}
},
methods: {
filterValues() {
let params = {
type: 2,
balanceId: +this.filters.balanceId.model,
brandId: +this.filters.brandId.model,
beginTime: this.startTime,
endTime: this.endTime,
pageSize: this.pageData.pageSize,
pageNo: this.pageData.pageNo
};
},
created() {
this.franchiseService = new FinanceService();
this.search();
},
methods: {
filterValues() {
const params = {
type: 2,
balanceId: +this.filters.balanceId.model,
brandId: +this.filters.brandId.model,
beginTime: this.startTime,
endTime: this.endTime,
pageSize: this.pageData.pageSize,
pageNo: this.pageData.pageNo,
manageMode: 1,
};
return _.pickBy(params, val => val);
},
search() {
this.FinanceService.balanceList(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);
});
},
reset() {
this.filters.balanceId.model = null;
this.filters.brandId.model = null;
this.filters.createTime.model = null;
this.pageData.pageNo = 1;
this.pageData.total = 0;
this.search();
},
pageChange(val) {
this.pageData.pageNo = val;
this.search();
},
onClickInfo(params) {
this.$router.push({
name: 'finance.payment.detail',
params: {},
query: {
balanceId: params.row.balanceId,
brandId: params.row.brandId,
supplierName: params.row.supplierName,
createTime: params.row.createTimeString
}
});
return _.pickBy(params, val => val);
},
search() {
this.franchiseService.balanceList(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);
});
},
reset() {
this.filters.balanceId.model = null;
this.filters.brandId.model = null;
this.filters.createTime.model = null;
this.pageData.pageNo = 1;
this.pageData.total = 0;
this.search();
},
pageChange(val) {
this.pageData.pageNo = val;
this.search();
},
onClickInfo(params) {
this.$router.push({
name: 'finance.payment.detail',
params: {},
query: {
balanceId: params.row.balanceId,
brandId: params.row.brandId,
supplierName: params.row.supplierName,
createTime: params.row.createTimeString,
},
onClickStock(params) {
let opt = _.pickBy({
brandId: params.row.brandId,
begin: params.row.startTime,
end: params.row.endTime,
supplierName: params.row.supplierName
}, val => val);
this.$router.push({
name: 'finance.payment.stock',
params: {},
query: opt
});
});
},
onClickStock(params) {
const opt = _.pickBy(
{
brandId: params.row.brandId,
begin: params.row.startTime,
end: params.row.endTime,
supplierName: params.row.supplierName,
},
exportData() {
let params = {};
let temp = [];
_.assign(params, this.filterValues());
val => val
);
_.each(params, (val, key) => {
temp.push(`${key}=${val}`);
});
const href = `/Api/erp/exportBalanceList?${temp.join('&')}`;
this.$router.push({
name: 'finance.payment.stock',
params: {},
query: opt,
});
},
exportData() {
const querystring = qs.stringify(this.filterValues(), true);
const href = `${FinanceService.exportBalanceList}?${querystring}`;
window.open(href, '_blank');
}
}
window.open(href, '_blank');
},
},
};
</script>
<style lang="scss">
</style>
... ...
<template>
<layout-body>
<layout-filter>
<filter-item :label="filters.brandId.label">
<select-brand v-model="filters.brandId.model"></select-brand>
</filter-item>
<filter-item :label="filters.createTime.label">
<Date-picker v-model="filters.createTime.model"
type="daterange" format="yyyy-MM-dd" placeholder="选择日期">
</Date-picker>
</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>
<Button type="success" @click="print" 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.brandId.label">
<select-brand v-model="filters.brandId.model"></select-brand>
</filter-item>
<filter-item :label="filters.createTime.label">
<Date-picker v-model="filters.createTime.model" type="daterange" format="yyyy-MM-dd" placeholder="选择日期">
</Date-picker>
</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>
<Button type="success" class="table-btn" @click="print">打印</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 stock from './store/stock';
import FinanceService from 'services/finance/finance-service';
import _ from 'lodash';
import qs from 'querystringify';
export default {
data() {
return stock.call(this);
},
created() {
this.FinanceService = new FinanceService();
this.search();
},
computed: {
startTime() {
let createTime = this.filters.createTime.model;
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[0] ? createTime[0].getTime() / 1000 : 0;
}
},
endTime() {
let createTime = this.filters.createTime.model;
data() {
return stock.call(this);
},
computed: {
startTime() {
const createTime = this.filters.createTime.model;
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[1] ? createTime[1].getTime() / 1000 : 0;
}
}
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[0] ? createTime[0].getTime() / 1000 : 0;
}
},
methods: {
search() {
endTime() {
const createTime = this.filters.createTime.model;
let params = {
brandId: +this.filters.brandId.model,
beginTime: this.startTime,
endTime: this.endTime,
pageSize: this.pageData.pageSize,
pageNo: this.pageData.pageNo
};
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[1] ? createTime[1].getTime() / 1000 : 0;
}
},
},
created() {
this.financeService = new FinanceService();
this.search();
},
methods: {
search() {
let params = {
brandId: +this.filters.brandId.model,
beginTime: this.startTime,
endTime: this.endTime,
pageSize: this.pageData.pageSize,
pageNo: this.pageData.pageNo,
manageMode: 1,
};
params = _.pickBy(params, val => val);
params = _.pickBy(params, val => val);
this.FinanceService.inventoryLedgerList(params).then(ret => {
this.tableData = _.get(ret, 'data.records', []);
this.pageData.total = _.get(ret, 'data.totalCount', 0);
this.pageData.pageNo = _.get(ret, 'data.pageNo', 1);
});
},
reset() {
this.filters.brandId.model = null;
this.filters.createTime.model = null;
this.pageData.pageNo = 1;
this.pageData.total = 0;
this.search();
},
pageChange(val) {
this.pageData.pageNo = val;
this.search();
this.financeService.inventoryLedgerList(params).then(ret => {
this.tableData = _.get(ret, 'data.records', []);
this.pageData.total = _.get(ret, 'data.totalCount', 0);
this.pageData.pageNo = _.get(ret, 'data.pageNo', 1);
});
},
reset() {
this.filters.brandId.model = null;
this.filters.createTime.model = null;
this.pageData.pageNo = 1;
this.pageData.total = 0;
this.search();
},
pageChange(val) {
this.pageData.pageNo = val;
this.search();
},
print() {
const querystring = qs.stringify(
{
brandId: this.filters.brandId.model,
begin: this.startTime,
end: this.endTime,
page: this.pageData.pageNo,
supplierName: this.$route.query.supplierName,
manageMode: 1,
},
print() {
const href = `/finance/print/payment/stock.html?brandId=${this.filters.brandId.model}&begin=${this.startTime}&end=${this.endTime}&page=${this.pageData.pageNo}&supplierName=${this.$route.query.supplierName}`;
true
);
window.open(href, '_blank');
const href = `/finance/print/payment/stock.html${querystring}`;
window.open(href, '_blank');
},
exportData() {
const querystring = qs.stringify(
{
beginTime: this.startTime,
endTime: this.endTime,
manageMode: 1,
},
exportData() {
const beginTime = this.startTime;
const endTime = this.endTime;
true
);
const href = '/Api/erp/exportInventoryLedgerList?' +
`beginTime=${beginTime}&endTime=${endTime}`;
const href = `${FinanceService.exportInventory}${querystring}`;
window.open(href, '_blank');
},
returnPage() {
this.$router.push({
name: 'finance.payment'
});
}
}
window.open(href, '_blank');
},
returnPage() {
this.$router.push({
name: 'finance.payment',
});
},
},
};
</script>
\ No newline at end of file
</script>
... ...
let date = new Date();
let agoMonthFirstDay = new Date(date.getFullYear(), date.getMonth() - 1, 1);
let agoMonthLastDay = new Date(date.getFullYear(), date.getMonth(), 1);
const date = new Date();
const agoMonthFirstDay = new Date(date.getFullYear(), date.getMonth() - 1, 1);
const agoMonthLastDay = new Date(date.getFullYear(), date.getMonth(), 1);
export default {
filters: {
balanceId: {
label: '结算单号',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
},
brandId: {
label: '品牌',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
},
createTime: {
label: '创建时间',
labelSpan: 6,
model: [agoMonthFirstDay, agoMonthLastDay],
holder: '',
fieldSpan: 18
}
}
filters: {
balanceId: {
label: '结算单号',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18,
},
brandId: {
label: '品牌',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18,
},
createTime: {
label: '创建时间',
labelSpan: 6,
model: [agoMonthFirstDay, agoMonthLastDay],
holder: '',
fieldSpan: 18,
},
},
};
... ...
... ... @@ -7,75 +7,79 @@
import moment from 'moment';
export default function() {
return {
tableCols: [
{
title: '对账单号',
key: 'balanceId',
align: 'center'
},
{
title: '生成日期',
key: 'createTimeString',
align: 'center',
render: function(h, params) {
let time = moment.unix(params.row.createTime);
return {
tableCols: [
{
title: '对账单号',
key: 'balanceId',
align: 'center',
},
{
title: '生成日期',
key: 'createTimeString',
align: 'center',
render(h, params) {
const time = moment.unix(params.row.createTime);
return (
<div>
<div> {time.format('YYYY/MM/DD')} </div>
<div> {time.format('HH:mm:ss')} </div>
</div>
);
}
},
{
title: '结算周期',
key: 'clearingCycle',
align: 'center',
},
{
title: '品牌',
key: 'brandName',
align: 'center',
},
{
title: '供应商',
key: 'supplierName',
align: 'center'
},
{
title: '应收金额',
key: 'clearingAmount',
align: 'center'
},
{
title: '操作',
key: 'action',
width: 250,
align: 'center',
render: (h, params) => {
let info = (
<i-button type="primary" size="small" onClick={() => this.onClickInfo(params)}>查看明细</i-button>
);
return (
<div>
<div> {time.format('YYYY/MM/DD')} </div>
<div> {time.format('HH:mm:ss')} </div>
</div>
);
},
},
{
title: '结算周期',
key: 'clearingCycle',
align: 'center',
},
{
title: '品牌',
key: 'brandName',
align: 'center',
},
{
title: '供应商',
key: 'supplierName',
align: 'center',
},
{
title: '应收金额',
key: 'clearingAmount',
align: 'center',
},
{
title: '操作',
key: 'action',
width: 250,
align: 'center',
render: (h, params) => {
const info = (
<i-button type="primary" size="small" onClick={() => this.onClickInfo(params)}>
查看明细
</i-button>
);
let stock = (
<i-button type="primary" size="small" onClick={() => this.onClickStock(params)}>库存</i-button>
);
const stock = (
<i-button type="primary" size="small" onClick={() => this.onClickStock(params)}>
库存
</i-button>
);
return (
<div class="action-btn-row">
{info} {stock}
</div>
);
}
}
],
tableData: [],
pageData: {
total: 0,
pageNo: 1,
pageSize: 20
}
};
return (
<div class="action-btn-row">
{info} {stock}
</div>
);
},
},
],
tableData: [],
pageData: {
total: 0,
pageNo: 1,
pageSize: 20,
},
};
}
... ...
import Service from '../service';
let apiUrl = {
balanceList: '/erp/balanceList',
balanceDetail: '/erp/balanceDetail',
settlementList: '/erp/settlementList',
inventoryLedgerList: '/erp/inventoryLedgerList',
exportBalanceList: '/erp/exportBalanceList',
balanceDetailSum: '/erp/balanceDetailSum',
settlementListSum: '/erp/settlementListSum'
const apiUrl = {
balanceList: '/erp/balanceList',
balanceDetail: '/erp/balanceDetail',
settlementList: '/erp/settlementList',
inventoryLedgerList: '/erp/inventoryLedgerList',
exportBalanceList: '/erp/exportBalanceList',
balanceDetailSum: '/erp/balanceDetailSum',
settlementListSum: '/erp/settlementListSum',
};
class FinanceService extends Service {
getSupplier() {
return this.get('/platform');
}
productList(params) {
return this.get('/platform', {
params
});
}
balanceList(params) {
return this.post(apiUrl.balanceList, params);
}
balanceDetail(params) {
return this.post(apiUrl.balanceDetail, params);
}
settlementList(params) {
return this.post(apiUrl.settlementList, params);
}
inventoryLedgerList(params) {
return this.post(apiUrl.inventoryLedgerList, params);
}
balanceDetailSum(params) {
return this.post(apiUrl.balanceDetailSum, params);
}
settlementListSum(params) {
return this.post(apiUrl.settlementListSum, params);
}
/**
* 结算单,结算列表
* 通过type区分 1: 对账单, 2: 结算单
* @param params
* @returns {Promise<unknown>}
*/
balanceList(params) {
return this.post(apiUrl.balanceList, params);
}
/**
* 对账单明细
* @param params
* @returns {Promise<unknown>}
*/
balanceDetail(params) {
return this.post(apiUrl.balanceDetail, params);
}
/**
* 结算单明细
* @param params
* @returns {Promise<unknown>}
*/
settlementList(params) {
return this.post(apiUrl.settlementList, params);
}
/**
* 对账单,结算单库存
* @param params
* @returns {Promise<unknown>}
*/
inventoryLedgerList(params) {
return this.post(apiUrl.inventoryLedgerList, params);
}
/**
* 对账单明细统计
* @param params
* @returns {Promise<unknown>}
*/
balanceDetailSum(params) {
return this.post(apiUrl.balanceDetailSum, params);
}
/**
* 结算单明细统计
* @param params
* @returns {Promise<unknown>}
*/
settlementListSum(params) {
return this.post(apiUrl.settlementListSum, params);
}
}
FinanceService.exportBalanceList = '/Api/erp/exportBalanceList'; // 导出对账单列表, 结算单列表
FinanceService.exportBalanceDetail = '/Api/erp/exportBalanceDetail'; // 导出对账单详情
FinanceService.exportSettlementDetail = '/Api/erp/exportSettlementDetail'; // 导出结算单详情
FinanceService.exportInventory = '/Api/erp/exportInventoryLedgerList'; // 导出结算单库存
export default FinanceService;
... ...
import Service from '../service';
const apiUrl = {
balanceList: '/erp/franchiseBalanceList',
balanceDetail: '/erp/franchiseBalanceDetail',
balanceSumNums: '/erp/franchiseBalanceSumNums',
balanceSumAmount: '/erp/franchiseBalanceSumAmount',
exportBalanceDetail: '/Api/erp/franchiseBalanceExportDetail',
settlementList: '/erp/franchiseSettlementList',
settlementDetail: '/erp/franchiseSettlementDetail',
settlementSumNums: '/erp/franchiseSettlementSumNums',
settlementSumAmount: '/erp/franchiseSettlementSumAmount',
exportSettlementDetail: '/Api/erp/franchiseSettlementExportDetail',
};
class FranchiseService extends Service {
// 对账
/**
* 对账单列表
* @param params
* @returns {Promise<unknown>}
*/
balanceList(params) {
return this.post(apiUrl.balanceList, params);
}
/**
* 对账单详情
* @param params
* @returns {Promise<unknown>}
*/
balanceDetail(params) {
return this.post(apiUrl.balanceDetail, params);
}
/**
* 对账单统计-数量
* @param params
* @returns {Promise<unknown>}
*/
balanceSumNums(params) {
return this.post(apiUrl.balanceSumNums, params);
}
/**
* 对账单统计-金额
* @param params
* @returns {Promise<unknown>}
*/
balanceSumAmount(params) {
return this.post(apiUrl.balanceSumAmount, params);
}
// 结算
/**
* 结算单列表
* @param params
* @returns {Promise<unknown>}
*/
settlementList(params) {
return this.post(apiUrl.settlementList, params);
}
/**
* 结算单详情
* @param params
* @returns {Promise<unknown>}
*/
settlementDetail(params) {
return this.post(apiUrl.settlementDetail, params);
}
/**
* 结算单统计-数量
* @param params
* @returns {Promise<unknown>}
*/
settlementSumNums(params) {
return this.post(apiUrl.settlementSumNums, params);
}
/**
* 结算单统计-金额
* @param params
* @returns {Promise<unknown>}
*/
settlementSumAmount(params) {
return this.post(apiUrl.settlementSumAmount, params);
}
}
FranchiseService.exportBalanceDetail = apiUrl.exportBalanceDetail; // 导出对账单详情
FranchiseService.exportSettlementDetail = apiUrl.exportSettlementDetail; // 导出结算单详情
export default FranchiseService;
... ...
... ... @@ -72,6 +72,21 @@ const domainApis = {
updateInvoice: '/erp-gateway-web/franchiseInvoice/updateInvoice', // 发票信息更改接口
exportInvoiceList: '/erp-gateway-web/export/exportFranchiseInvoiceList', // 导出发票列表
// 专营店
// 对账单
franchiseBalanceList: '/erp-gateway-web/finance/balance/queryByPage', // 列表
franchiseBalanceDetail: '/erp-gateway-web/finance/balanceDetail/queryByPage', // 详情
franchiseBalanceSumNums: '/erp-gateway-web/finance/balanceDetail/querySumNums', // 详情计算统计
franchiseBalanceSumAmount: '/erp-gateway-web/finance/balanceDetail/querySumAmount', // 详情价格统计
franchiseBalanceExportDetail: '/erp-gateway-web/export/exportFranchiseBalanceDetail', // 导出详情
// 结算单
franchiseSettlementList: '/erp-gateway-web/finance/balance/queryByPage', // 列表
franchiseSettlementDetail: '/erp-gateway-web/finance/agency/queryByPage', // 详情
franchiseSettlementSumNums: '/erp-gateway-web/finance/agency/querySumNums', // 详情计数统计
franchiseSettlementSumAmount: '/erp-gateway-web/finance/agency/querySumAmount', // 详情价格统计
franchiseSettlementExportDetail: '/erp-gateway-web/export/exportFranchiseSettlementDetail', // 导出详情
queryByPidForFavorite: '/erp-gateway-web/account/profile/queryByPidForFavorite',
exportFavoriteClearingList: '/erp-gateway-web/export/favoriteClearingList',
exportFavoriteClearingDetail: '/erp-gateway-web/export/favoriteClearingDetail',
... ...
... ... @@ -55,7 +55,11 @@ module.exports = (req, res, next) => {
shopsId: currentShop.shopsId,
shopId: currentShop.shopsId,
shop: currentShop.shopsId,
supplierId: currentShop.shopsBrands.length ? (req.user.supplier_id ? req.user.supplier_id : _.first(currentShop.shopsBrands).supplierId) : 0,
supplierId: currentShop.shopsBrands.length
? req.user.supplier_id
? req.user.supplier_id
: _.first(currentShop.shopsBrands).supplierId
: 0,
platform_id: config.platform,
userId: req.user.uid,
};
... ... @@ -78,6 +82,11 @@ module.exports = (req, res, next) => {
delete baseParams.platform_id;
}
// filter default params
if (apiMap.startsWith('erp.franchise')) {
// 删除专营店的供应商
delete baseParams.supplierId;
}
if (req.method.toLowerCase() === 'get') {
reqOptions.qs = Object.assign(reqParams, baseParams);
} else if (files.length) {
... ...