Authored by shuiling.wang@yoho.cn

结算

... ... @@ -37,6 +37,7 @@
<script>
import list from './store/list';
import FinanceService from 'services/finance/finance-service';
import _ from 'lodash';
export default {
data() {
... ... @@ -70,6 +71,7 @@ export default {
// 在这里实现异步查询的方法,建议在service中做
let params = {
type: 1,
supplierId: 156,
balanceId: +this.filters.balanceId.model,
brandId: this.filters.brandId.model,
status: this.filters.status.model,
... ... @@ -77,10 +79,12 @@ export default {
endTime: this.endTime,
pageSize: this.pageData.pageSize,
pageNo: this.pageData.pageNo
}
};
params = _.pickBy(params, val => val);
this.FinanceService.balanceList(params).then(ret => {
console.log(ret)
this.tableData = _.get(ret, 'data.records', []);
});
},
reset() {
... ... @@ -95,7 +99,17 @@ export default {
this.pageData.current = val;
this.search();
},
onClickInfo() {},
onClickInfo(params) {
this.$router.push({
name: 'finance.clearing.detail',
params: {},
query: {
balanceId: params.row.balanceId,
status: {未结算: 0, 已结算: 1}[params.row.statusDesc],
brandName: params.row.brandName
}
});
},
onClickStock() {}
}
};
... ...
<template>
<div>局部组件</div>
</template>
<script>
export default {
name: 'Demo',
};
</script>
import Demo from './demo';
export {
Demo
};
... ... @@ -25,7 +25,7 @@
</filter-item>
<filter-item>
<Button type="primary" @click="search">筛选</Button>
<Button type="primary" @click="exportData">导出</Button>
<Button type="warning" @click="exportData">导出</Button>
<Button @click="reset">清空条件</Button>
</filter-item>
</layout-filter>
... ... @@ -48,9 +48,13 @@ export default {
},
created() {
this.FinanceService = new FinanceService();
this.search();
},
computed: {
mounted() {
// console.log(this.$route.params.status)
this.filters.status.model = +this.$route.query.status;
},
computed: {
},
methods: {
search() {
... ...
... ... @@ -6,6 +6,7 @@
import moment from 'moment';
export default function() {
return {
tableCols: [
... ...
... ... @@ -60,11 +60,8 @@ export default function() {
width: 250,
align: 'center',
render: (h, params) => {
let status = params.row.auditStatus;
let total = params.row.totalNum;
let info = (
<i-button type="success" size="small" onClick={() => this.onClickInfo(params)}>查看明细</i-button>
<i-button type="primary" size="small" onClick={() => this.onClickInfo(params)}>查看明细</i-button>
);
let stock = (
... ... @@ -96,7 +93,7 @@ export default function() {
brandId: {
label: '品牌',
labelSpan: 6,
model: '',
model: 33,
holder: '',
fieldSpan: 18
},
... ...
<template>
<div>局部组件</div>
</template>
<script>
export default {
name: 'Demo',
};
</script>
import Demo from './demo';
export {
Demo
};
<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">
<Option v-for="option in filters.status.options"
:value="option.value"
:key="option.value">{{option.label}}</Option>
</Select>
</filter-item>
<filter-item>
<Button type="primary" @click="search">筛选</Button>
<Button type="warning" @click="exportData">导出</Button>
<Button type="success">打印</Button>
<Button @click="reset">清空条件</Button>
</filter-item>
</layout-filter>
<layout-list>
<Demo></Demo>
<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>
</template>
<script>
import detail from './store/detail';
import FinanceService from 'services/finance/finance-service';
export default {
data() {
return detail.call(this);
},
created() {
this.FinanceService = new FinanceService();
this.search();
},
computed: {
},
methods: {
search() {
// 在这里实现异步查询的方法,建议在service中做
let params = {
balanceId: +this.filters.balanceId.model,
brandId: this.filters.brandId.model,
orderCode: this.filters.orderCode.model,
status: this.filters.status.model,
sku: this.filters.sku.model,
pageSize: this.pageData.pageSize,
pageNo: this.pageData.pageNo
}
this.FinanceService.balanceDetail(params).then(ret => {
console.log(ret)
});
},
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;
},
pageChange(val) {
this.pageData.current = val;
this.search();
},
exportData() {
console.log('导出');
},
onClickInfo() {},
onClickStock() {}
}
};
</script>
<style lang="scss">
.ivu-date-picker .ivu-select-dropdown {
left: -284px !important;
}
</style>
... ...
<template>
<layout-body>
<layout-filter ref="filter" :model="query">
<filter-item label="SKN编码">
<Input v-model.trim="query.sknCode" :maxlength="9"></Input>
<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="商家编码">
<Input v-model.trim="query.prodCode"></Input>
<filter-item :label="filters.brandId.label">
<select-brand v-model="filters.brandId.model"></select-brand>
</filter-item>
<filter-item label="商品名称">
<Input v-model.trim="query.prodName"></Input>
</filter-item>
<filter-item label="商品条码">
<Input v-model.trim="query.prodBarCode"></Input>
<filter-item :label="filters.createTime.label">
<Date-picker v-model="filters.createTime.model"
type="datetimerange" format="yyyy-MM-dd" placeholder="选择日期和时间">
</Date-picker>
</filter-item>
<filter-item>
<Button type="primary" @click="search">筛选</Button>
... ... @@ -21,79 +21,91 @@
<layout-list>
<Demo></Demo>
<Table border :columns="tableCols" :data="tableData"></Table>
<Page :total="pageData.total" :current="pageData.current"
<Page :total="pageData.total" :current="pageData.pageNo"
@on-change="pageChange" :page-size="20" show-total></Page>
</layout-list>
</layout-body>
</template>
<script>
import {Demo} from './components';
import list from './store/list';
import FinanceService from 'services/finance/finance-service';
export default {
data() {
return {
query: {
sknCode: '',
prodCode: '',
prodName: '',
prodBarCode: '',
category: [],
brand: 0,
saleStatus: 0,
stockStatus: 0
},
pageData: {
total: 0,
current: 1,
},
tableData: [{
col1: '1',
col2: '2'
}, {
col1: '3',
col2: '4'
}, {
col1: '5',
col2: '6'
}],
tableCols: [{
title: '列1',
key: 'col1'
}, {
title: '列2',
key: 'col2'
}, {
title: '操作',
render: (h, params) => {
return (
<action-group>
<i-button type="primary" size="small" onClick={() => this.edit(params.row)}>编辑</i-button>
<i-button type="error" size="small" onClick={() => this.del(params.row)}>删除</i-button>
</action-group>
);
}
}]
};
return list.call(this);
},
created() {
this.FinanceService = new FinanceService();
},
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;
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[1] ? createTime[1].getTime() / 1000 : 0;
}
}
},
methods: {
search() {
// 在这里实现异步查询的方法,建议在service中做
let params = Object.assin(this.query, this.pageData);
let params = {
type: 2,
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
};
console.log(params);
this.FinanceService.settlementList(params).then(ret => {
console.log(ret)
});
},
reset() {
this.$refs.filter.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;
},
pageChange() {
pageChange(val) {
this.pageData.current = val;
this.search();
},
edit() {},
del() {}
},
components: {Demo}
onClickInfo(params) {
this.$router.push({
name: 'finance.payment.detail',
params: {},
query: {
balanceId: params.row.balanceId,
status: params.row.statusDesc,
brandName: params.row.brandName
}
});
},
onClickStock() {}
}
};
</script>
<style lang="scss">
.ivu-date-picker .ivu-select-dropdown {
left: -284px !important;
}
</style>
... ...
/**
* on detail page store
* @author: wsl <shuiling.wang@yoho.cn>
* @date: 2017/07/11
*/
import moment from 'moment';
export default function() {
return {
tableCols: [
{
title: '对账单号',
key: 'balanceId',
align: 'center'
},
{
title: 'SKU',
key: 'productSku',
align: 'center'
},
{
title: '产品名称',
key: 'productName',
align: 'center',
},
{
title: '厂家编号',
key: 'storageFactoryCode',
align: 'center',
},
{
title: '品牌',
key: 'brandName',
align: 'center'
},
{
title: '订单号',
key: 'orderCode',
align: 'center'
},
{
title: '业务类型',
key: 'clearingTypeDesc',
align: 'center'
},
{
title: '吊牌价',
key: 'retailPrice',
align: 'center'
},
{
title: '成交价',
key: 'lastPrice',
align: 'center'
},
{
title: '折扣',
key: 'purchaseDiscount',
align: 'center'
},
{
title: '结算类型',
key: 'sellTypeDesc',
align: 'center'
},
{
title: '数量',
key: 'nums',
align: 'center'
},
{
title: '结算价',
key: 'clearingPrice',
align: 'center'
},
{
title: '审核',
key: 'auditStatusDesc',
align: 'center'
},
{
title: '状态',
key: 'statusDesc',
align: 'center'
}
],
tableData: [],
pageData: {
total: 0,
pageNo: 1,
pageSize: 20
},
filters: {
orderCode: {
label: '订单号',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
},
balanceId: {
label: '对账单号',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
},
sku: {
label: 'SKU',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
},
brandId: {
label: '品牌',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
},
status: {
label: '状态',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18,
options: [
{
value: 0,
label: '未结算'
},
{
value: 1,
label: '已结算'
}
]
}
}
};
}
... ...
/**
* on payment page store
* @author: wsl <shuiling.wang@yoho.cn>
* @date: 2017/07/12
*/
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 (
<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>
);
let 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
},
filters: {
balanceId: {
label: '对账单号',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
},
brandId: {
label: '品牌',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
},
createTime: {
label: '创建时间',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
}
}
};
}
... ...
... ... @@ -2,7 +2,8 @@ import Service from '../service';
let apiUrl = {
balanceList: '/erp/balanceList',
balanceDetail: '/erp/balanceDetail'
balanceDetail: '/erp/balanceDetail',
settlementList: '/erp/settlementList'
};
class FinanceService extends Service {
... ... @@ -15,14 +16,13 @@ class FinanceService extends Service {
});
}
balanceList(params) {
return this.get(apiUrl.balanceList, {
params
});
return this.post(apiUrl.balanceList, params);
}
balanceDetail(params) {
return this.get(apiUrl.balanceDetail, {
params
});
return this.post(apiUrl.balanceDetail, params);
}
settlementList(params) {
return this.post(apiUrl.settlementList, params);
}
}
export default FinanceService;
... ...
... ... @@ -41,7 +41,9 @@ let domainApis = {
invoiceGoodsDelete: '/erp-shop-web/invoice/goods/delete',
supplementProductList: '/erp-shop-web/supplementProduct/list',
invoiceGoodsImport: '/erp-shop-web/invoice/goods/import',
balanceList: '/erp-shop-web/financeBill/balanceList'
balanceList: '/erp-shop-web/financeBill/balanceList',
balanceDetail: '/erp-shop-web/financeBill/balanceDetail',
settlementList: '/erp-shop-web/financeBill/settlementList'
},
platform: {
queryShopsByAdminPid: '/SellerShopController/queryShopsByAdminPid',
... ... @@ -81,8 +83,7 @@ let domainApis = {
getRemoteImageUrlBySku: '/product/getRemoteImageUrlBySku',
importSeller: '/batch/importSeller',
downloadFile: '/exceltemplate/download/CreateProductForShops',
getSellType: '/SellerProductController/getSellType',
balanceDetail: '/erp-shop-web/financeBill/balanceDetail'
getSellType: '/SellerProductController/getSellType'
},
shop: {
login: '/loginInter',
... ...