Authored by 李奇

Merge remote-tracking branch 'origin/master' into feature/docker

root = true
[*]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
... ...
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
\ No newline at end of file
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
registry=http://npm.yohops.com
... ...
... ... @@ -5,6 +5,7 @@ import SelectRoom from './select-room';
import SelectExpress from './select-express';
import SelectStockStatus from './select-stock-status';
import SelectSellType from './select-sell-type';
import SelectSearchBrand from './select-search-brand';
export default {
SelectBrand,
... ... @@ -13,5 +14,6 @@ export default {
SelectRoom,
SelectExpress,
SelectStockStatus,
SelectSellType
SelectSellType,
SelectSearchBrand
};
... ...
<template>
<Select
v-model="brandId"
@on-change="selectChange"
filterable
remote
:remote-method="queryBrands"
:loading="loading"
clearable>
<Option v-for="option in optionList" :value="option.id" :key="option.id">{{option.text}}</Option>
</Select>
</template>
<script>
import _ from 'lodash';
import BrandService from 'services/product/brand-service';
export default {
name: 'select-search-brand',
props: {
value: {
type: [Number, String],
default: 0
}
},
created() {
this.brandService = new BrandService();
},
data() {
return {
brandId: this.value,
loading: false,
optionList: []
};
},
watch: {
value(val) {
this.brandId = val || '';
}
},
methods: {
queryBrands(query) {
if (query) {
this.loading = true;
this.brandService.getBrandNames({
nameOrId: query
}).then((res) => {
this.loading = false;
this.optionList = res.data;
}, () => {
this.loading = false;
});
} else {
this.optionList = [];
}
},
selectChange(brandId) {
this.$emit('input', brandId);
this.$emit('change', _.find(this.optionList, {brandId}));
}
}
};
</script>
<style lang="scss" scoped>
.field-label {
line-height: 32px;
}
</style>
... ...
... ... @@ -6,6 +6,8 @@ import repository from './repository';
import statistics from './statistics';
import finance from './finance';
import user from './user';
import kol from './kol';
export default {
product,
home,
... ... @@ -14,5 +16,6 @@ export default {
statistics,
finance,
trade,
user
user,
kol
};
... ...
<template>
<layout-body>
<layout-filter ref="filter" :model="query">
<filter-item label="品牌">
<select-search-brand v-model="query.brandId"></select-search-brand>
</filter-item>
<filter-item label="品类">
<select-category v-model="query.sort"></select-category>
</filter-item>
<filter-item label="价格区间">
<Price v-model="query.price"></Price>
</filter-item>
<filter-item label="库存状态">
<Select v-model="query.stockStatus" clearable>
<Option value="0">库存正常</Option>
<Option value="1">即将售罄</Option>
</Select>
</filter-item>
<filter-item>
<Button type="primary" @click="search">筛选</Button>
<Button @click="reset">清空条件</Button>
</filter-item>
</layout-filter>
<layout-action v-show="!nullData">
<Button type="error" @click="addSellPool">添加到推广池</Button>
<a class="brand-list" target="_blank" href="//www.yohobuy.com/boys-brands/">品牌一览</a>
<span class="add-num">已添加到推广池:<router-link class="to-spread" target="_blank"
:to="{ name: 'kol.sell.list'}">{{spreadPrdCnt}}</router-link></span>
</layout-action>
<layout-list>
<Table border :columns="tableCols" :data="tableData" @on-selection-change="changeProductStr" v-show="!nullData"></Table>
<Page :total="pageData.total" :current="pageData.current"
@on-change="pageChange" :page-size="10" show-total v-show="!nullData"></Page>
<div class="null-data" v-show="nullData">
<p class="red">请选择查询条件,查找你想要推广的商品。.......</p>
<p class="red">*注:品牌或品类筛选必须选择其中一个。</p>
<p><Icon type="android-arrow-forward"></Icon><a target="_blank" href="//www.yohobuy.com/boys-brands/">品牌一览</a></p>
</div>
</layout-list>
</layout-body>
</template>
<script>
import CandidateListService from 'services/kol/candidate-list-service';
import {Price} from './components';
import _ from 'lodash';
export default {
data() {
return {
query: {
poolId: null,
brandId: null,
sort: [],
price: [],
stockStatus: null
},
pageData: {
total: 0,
current: 1,
},
nullData: true,
tableData: [],
tableCols: [{
type: 'selection',
width: 60,
align: 'center'
}, {
title: 'skn',
key: 'productSkn',
width: 100,
align: 'center'
}, {
title: '商品图片',
align: 'center',
key: 'imageUrl',
render: (h, params) => {
return h('img', {
attrs: {
src: params.row.imageUrl,
style: 'max-width: 100%; display: block; margin: 0 auto;'
}
});
}
}, {
title: '商品名称',
key: 'productName',
align: 'center'
}, {
title: '商品品牌',
key: 'brandName',
align: 'center'
}, {
title: '商品类目',
key: 'sortName',
align: 'center'
}, {
title: '库存状态',
key: 'stockStatus',
align: 'center',
width: 110,
renderHeader: (h, params) => {
return h('div', [
h('strong', params.column.title),
h('Tooltip', {
attrs: {
placement: 'bottom-start',
content: '这里指整个商品下所有颜色尺码的库存状态。具体颜色、尺码的库存明细请参考商品详情页面。'
}
}, [
h('Icon', {
props: {
type: 'android-alert'
},
attrs: {style: 'font-size: 16px;vertical-align: text-top; margin-left: 5px;'}
})
])
]);
}
}, {
title: '当前价格(元)',
key: 'currentPrice',
width: 110,
align: 'center'
}, {
title: '结算比例',
key: 'commissionRate',
align: 'center'
}, {
title: '预估佣金',
key: 'brokerage',
align: 'center'
}],
productSknStr: '',
spreadPrdCnt: null
};
},
created() {
this.candidateListService = new CandidateListService();
},
methods: {
filterValues() {
let params = {
page: this.pageData.current,
size: 10,
brandId: +this.query.brandId,
maxSortId: _.get(this.query, 'sort[0].value') || '',
middleSortId: _.get(this.query, 'sort[1].value') || '',
smallSortId: _.get(this.query, 'sort[2].value') || '',
priceRangeLow: _.get(this.query, 'price[0]') || '',
priceRangeHigh: _.get(this.query, 'price[1]') || '',
stockStatus: this.query.stockStatus
};
return _.pickBy(params, val => val);
},
search() {
const len = this.query.sort.filter(v => v.value).length;
if (!this.query.brandId && !len &&
this.query.price.length ===
0 &&
!this.query.stockStatus) {
this.$Message.warning('请选择筛选条件!');
return;
}
if (!this.query.brandId && !len) {
this.$Message.warning('请先选择品牌或品类!');
return;
}
this.candidateListService.queryWarehouseProductList(this.filterValues()).then(ret => {
if (ret && ret.code === 200) {
this.tableData = _.get(ret, 'data.list', []);
this.pageData.total = _.get(ret, 'data.total', 0);
this.pageData.current = _.get(ret, 'data.page', 1);
this.spreadPrdCnt = _.get(ret, 'data.spreadPrdCnt', '');
this.nullData = false;
} else {
this.$Message.error(ret.message);
}
});
},
addSellPool() {
this.candidateListService.batchAddProduct({
productSknStr: this.productSknStr
}).then(ret => {
if (ret && ret.code === 200) {
this.$Message.success('添加成功!');
this.search();
} else {
this.$Message.error(`添加失败:${ret.message}`);
}
});
},
changeProductStr(selection) {
this.productSknStr = '';
_.each(selection, (item) => {
if (!this.productSknStr) {
this.productSknStr += item.productSkn;
} else {
this.productSknStr += `,${item.productSkn}`;
}
});
},
reset() {
this.$refs.filter.reset();
this.nullData = true;
this.pageData.total = 0;
this.pageData.current = 1;
this.tableData = [];
},
pageChange(val) {
this.pageData.current = val;
this.search();
}
},
components: {
Price,
},
watch: {
}
};
</script>
<style lang="scss">
.ivu-table-column-center .ivu-tooltip-inner {
white-space: normal !important;
}
.add-num {
float: right;
margin-top: 15px;
}
.to-spread {
text-decoration: underline;
}
.null-data {
width: 260px;
margin: 180px auto 0;
line-height: 30px;
.ivu-icon-android-arrow-forward {
margin-right: 10px;
}
.red {
color: #ed3f16;
}
}
.brand-list {
margin-left: 10px;
text-decoration: underline;
}
</style>
... ...
import Price from './price';
export {
Price,
};
... ...
<template>
<div>
<Input :value="start" class="price-input" @input="startChange"></Input>
~
<Input :value="end" class="price-input" @input="endChange"></Input>
</div>
</template>
<script>
export default {
name: 'price',
props: {
value: {
type: Array,
default() {
return [];
}
}
},
data() {
let self = this;
return {
start: self.value[0] || null,
end: self.value[1] || null
};
},
methods: {
startChange(data) {
this.$emit('input', [data, this.end]);
},
endChange(data) {
this.$emit('input', [this.start, data]);
}
},
watch: {
value(newVal) {
this.start = newVal[0];
this.end = newVal[1];
}
}
};
</script>
<style scoped>
.price-input {
width: 45%;
}
</style>
... ...
export default {
path: '/list.html',
name: 'list',
component: () => import(/* webpackChunkName: "kol.candidate-list" */'./candidate-list'),
meta: {
pageName: '我的商品库'
}
};
... ...
import sell from './sell-list';
import candidate from './candidate-list';
import profile from './profile';
import reconciliation from './reconciliation-list';
import settlementList from './settlement-list';
import settlementDetail from './settlement-detail';
export default {
sell,
candidate,
profile,
reconciliation,
settlement: [settlementList, settlementDetail]
};
... ...
export default {
path: '/index.html',
name: 'index',
component: () => import(/* webpackChunkName: "kol.candidate-list" */'./profile'),
meta: {
pageName: '帐户信息'
}
};
... ...
<template>
<layout-body>
<layout-list>
<h2>帐号信息</h2>
<Form :label-width="80">
<FormItem label="PID:">
<span>{{profile.pid}}</span>
</FormItem>
<FormItem label="真实姓名:">
<span>{{profile.truename}}</span>
</FormItem>
<FormItem label="帐号:">
<span>{{profile.account}}</span>
</FormItem>
<FormItem label="有效期:">
<span>{{formatDate(profile.create_time)}} ~ {{formatDate(profile.expires)}}</span>
</FormItem>
</Form>
<h2 class="mb30">银行账号信息(<span class="red"> * 此账户用于佣金结算,请及时填写,添加后不可修改!</span>)</h2>
<Form :label-width="80">
<FormItem label="开户行:">
<span>{{profile.bankName}}</span>
</FormItem>
<FormItem label="银行帐号:">
<span>{{profile.bankAccount}}</span>
</FormItem>
</Form>
</layout-list>
</layout-body>
</template>
<script>
import CandidateListService from 'services/kol/candidate-list-service';
import moment from 'moment';
export default {
name: 'profile',
data() {
return {
profile: {}
};
},
created() {
this.candidateListService = new CandidateListService();
},
mounted() {
this.getData();
},
methods: {
getData() {
this.candidateListService.queryByPidForFavorite().then(ret => {
if (ret && ret.code === 200) {
this.profile = ret.data;
} else {
console.log(ret.message);
}
});
},
formatDate(date) {
if (date) {
return moment.unix(date).format('YYYY.MM.DD');
}
}
},
components: {
},
watch: {
}
};
</script>
<style lang="scss">
.ivu-form .ivu-form-item-label {
text-align: left;
margin-left: 90px;
}
h2 {
font-size: 14px;
}
h2 .red {
color: red;
font-size: 12px;
}
.mb30 {
margin-bottom: 30px;
}
</style>
... ...
<template>
<Modal
v-model="modal"
title="是否确认对账?"
@on-ok="onOk(data)"
@on-cancel="onCancel(data)">
<Alert type="warning" show-icon>温馨提示:结算金额以结算单为准</Alert>
<Form :label-width="80">
<FormItem label="支付金额:" style="margin-bottom: 0">
<span>{{data.lastPaymentAmount}}</span>
</FormItem>
<FormItem label="结算比例:" style="margin-bottom: 0">
<span>{{data.clearingPercent * 100}}%</span>
</FormItem>
<FormItem label="结算金额:" style="margin-bottom: 0">
<span>{{data.clearingAmount}}</span>
</FormItem>
</Form>
</Modal>
</template>
<script>
export default {
name: 'reconciliation-confirm',
props: {
onOk: {
type: Function,
default() {
return {};
}
},
onCancel: {
type: Function,
default() {
return {};
}
}
},
data() {
return {
modal: this.value,
data: {}
};
},
methods: {
show(row) {
this.data = row;
this.modal = true;
},
hide() {
this.modal = false;
}
}
};
</script>
... ...
import Confirm from './confirm.vue';
export {
Confirm
};
... ...
export default {
path: '/list.html',
name: 'list',
component: () => import(/* webpackChunkName: "kol.reconciliation" */'./list'),
meta: {
pageName: '对帐单管理'
}
};
... ...
<template>
<layout-body>
<Alert type="warning" show-icon class="warning-box" closable>每个月16号生成本月之前的结算单,请大家务必在1号之前对账完毕。否则未对账的账单将移至下个月合并结算。</Alert>
<layout-filter ref="filter" :model="query">
<filter-item label="对帐单号">
<Input v-model.trim="query.id" :maxlength="9"></Input>
</filter-item>
<filter-item label="SKU编码">
<Input v-model.trim="query.productSku" :maxlength="9"></Input>
</filter-item>
<filter-item label="商品名称">
<Input v-model.trim="query.productName"></Input>
</filter-item>
<filter-item label="品牌">
<select-search-brand v-model="query.brandId"></select-search-brand>
</filter-item>
<filter-item label="订单号">
<Input v-model.trim="query.orderCode"></Input>
</filter-item>
<filter-item label="业务类型">
<Select v-model="query.outInType" clearable>
<Option value="30">销售出库</Option>
<Option value="33">退货入库</Option>
</Select>
</filter-item>
<filter-item label="对帐单状态">
<Select v-model="query.status" clearable>
<Option value="10">未对帐</Option>
<Option value="20">待结算</Option>
<Option value="30">已结算</Option>
</Select>
</filter-item>
<filter-item>
<Button type="primary" @click="search">筛选</Button>
<Button @click="reset">清空条件</Button>
<Button @click="exportData" type="warning">导出</Button>
</filter-item>
</layout-filter>
<layout-list>
<Table border :columns="tableCols" :data="tableData"></Table>
<Page :total="pageData.total" :current="pageData.current"
@on-change="pageChange" :page-size="10" show-total></Page>
</layout-list>
<Confirm ref="confirm" :onOk="onOk"></Confirm>
</layout-body>
</template>
<script>
import CandidateListService from 'services/kol/candidate-list-service';
import {Confirm} from './components';
import _ from 'lodash';
import moment from 'moment';
export default {
data() {
return {
query: {
id: '',
productSku: '',
productName: '',
brandId: null,
orderCode: null,
outInType: null,
status: null
},
pageData: {
total: 0,
current: 1,
},
tableData: [],
tableCols: [{
title: '订单号',
key: 'orderCode',
align: 'center',
width: 80
}, {
title: '帐单生成时间',
key: 'createTime',
width: 110,
align: 'center',
render: (h, params) => {
if (params.row.createTime) {
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: 'id',
align: 'center',
width: 90
}, {
title: '对帐时间',
key: 'confirmTime',
align: 'center',
width: 90,
render: (h, params) => {
if (params.row.confirmTime === 'default') {
return '';
}
if (params.row.confirmTime) {
let time = moment.unix(params.row.confirmTime);
return (
<div>
<div> {time.format('YYYY/MM/DD')} </div>
<div> {time.format('HH:mm:ss')} </div>
</div>
);
} else {
return '暂无';
}
}
}, {
title: 'SKU',
key: 'productSku',
align: 'center',
width: 85
}, {
title: '商品名称',
key: 'productName',
align: 'center',
width: 90
}, {
title: '品牌',
key: 'brandName',
align: 'center',
width: 100
}, {
title: '吊牌价',
key: 'retailPrice',
align: 'center',
width: 85
}, {
title: '支付金额',
key: 'lastPaymentAmount',
align: 'center',
width: 85
}, {
title: '结算比例',
key: 'clearingPercent',
align: 'center',
width: 85,
render: (h, params) => {
if (params.row.clearingPercent) {
return (
`${params.row.clearingPercent * 100}%`
);
}
}
}, {
title: '业务类型',
key: 'outInTypeName',
align: 'center',
width: 85
}, {
title: '数量',
key: 'num',
align: 'center',
width: 70
}, {
title: '佣金',
key: 'clearingAmount',
align: 'center',
width: 90
}, {
title: '状态',
key: 'statusName',
align: 'center',
width: 110,
render: (h, params) => {
if (params.row.status === 30) {
return (
<div>
<div>{params.row.statusName}</div>
<div>(结算单号:{params.row.favoriteClearingId})</div>
</div>
);
} else {
return params.row.statusName;
}
}
}, {
title: '操作',
render: (h, params) => {
if (params.row.status === 10) {
return (
<action-group>
<i-button type="primary" size="small" onClick={() => this.check(params.row)}>对帐</i-button>
</action-group>
);
}
},
width: 100,
align: 'center'
}]
};
},
created() {
this.candidateListService = new CandidateListService();
},
mounted() {
this.search();
},
methods: {
filterValues() {
let params = {
pageNo: this.pageData.current,
pageSize: 10,
needTotal: 1,
id: +this.query.id,
productSku: +this.query.productSku,
productName: this.query.productName,
brandId: +this.query.brandId,
orderCode: +this.query.orderCode,
outInType: +this.query.outInType,
status: +this.query.status
};
params = _.pickBy(params, val => val);
return params;
},
search() {
if (_.isObject(this.query) &&
typeof this.query.id !== 'undefined' &&
!_.isFinite(+this.query.id)) {
this.$Message.error('对帐单号只能是数字', 3);
return;
}
if (_.isObject(this.query) &&
typeof this.query.productSku !== 'undefined' &&
!_.isFinite(+this.query.productSku)) {
this.$Message.error('SKU编码只能是数字', 3);
return;
}
if (_.isObject(this.query) &&
typeof this.query.orderCode !== 'undefined' &&
!_.isFinite(+this.query.orderCode)) {
this.$Message.error('订单号只能是数字', 3);
return;
}
this.candidateListService.favoriteBalanceList(this.filterValues()).then(ret => {
if (ret && ret.code === 200) {
this.tableData = _.get(ret, 'data.records', []);
if (this.tableData.length > 0) {
this.tableData.push({
confirmTime: 'default',
outInTypeName: '总计',
num: ret.data.totalNum,
clearingAmount: ret.data.totalClearingAmount
});
}
this.pageData.total = _.get(ret, 'data.totalCount', 0);
} else {
this.$Message.error(ret.message);
}
});
},
reset() {
this.$refs.filter.reset();
this.search();
},
pageChange(val) {
this.pageData.current = val;
this.search();
},
check(row) {
this.$refs.confirm.show(row);
},
onOk(data) {
this.candidateListService.favoriteBalanceCheck({
id: data.id,
favoritePid: data.favoritePid
}).then(ret => {
if (ret && ret.code === 200) {
this.$Message.success('对账成功!');
this.$refs.confirm.hide();
this.search();
} else {
this.$Message.error(ret.message);
}
});
},
onCancel() {
this.$refs.confirm.hide();
},
exportData() {
let params = {};
let temp = [];
_.assign(params, this.filterValues());
_.each(params, (val, key) => {
temp.push(`${key}=${val}`);
});
const href = `/Api/erp/exportFavoriteBalanceDetail?${temp.join('&')}`;
window.open(href, '_blank');
}
},
components: {Confirm}
};
</script>
<style lang="scss">
.warning-box {
width: 950px;
display: inline-block;
margin-bottom: 15px;
}
</style>
... ...
<template>
<div>局部组件</div>
</template>
<script>
export default {
name: 'Demo',
};
</script>
... ...
import Demo from './demo';
export {
Demo
};
... ...
export default {
path: '/list.html',
name: 'list',
component: () => import(/* webpackChunkName: "kol.sell-list" */'./sell-list'),
meta: {
pageName: '我的推广商品'
}
};
... ...
<template>
<layout-body>
<layout-filter ref="filter" :model="query">
<filter-item label="SKN编码">
<Input v-model.trim="query.productSkn" :maxlength="9"></Input>
</filter-item>
<filter-item label="商品名称">
<Input v-model.trim="query.productName"></Input>
</filter-item>
<filter-item label="品牌">
<select-search-brand v-model="query.brandId"></select-search-brand>
</filter-item>
<filter-item label="库存状态">
<Select v-model="query.stockStatus" clearable>
<Option value="0">库存正常</Option>
<Option value="1">即将售罄</Option>
<Option value="2">已售罄</Option>
</Select>
</filter-item>
<filter-item label="品类" class="filter-category">
<select-category v-model="query.sort"></select-category>
</filter-item>
<filter-item label="商品状态">
<Select v-model="query.prodStatus" clearable>
<Option value="0">异常</Option>
<Option value="1">正常</Option>
</Select>
</filter-item>
<filter-item>
<Button type="primary" @click="search">筛选</Button>
<Button @click="reset">清空条件</Button>
</filter-item>
</layout-filter>
<layout-action>
<Button type="error" @click="delProducts">删除</Button>
</layout-action>
<layout-list>
<Table border :columns="tableCols" :data="tableData" @on-selection-change="changeProductStr"></Table>
<Page :total="pageData.total" :current="pageData.current"
@on-change="pageChange" :page-size="10" show-total></Page>
</layout-list>
</layout-body>
</template>
<script>
import CandidateListService from 'services/kol/candidate-list-service';
import _ from 'lodash';
export default {
data() {
return {
query: {
productSkn: '',
productName: '',
brandId: null,
sort: [],
stockStatus: null,
prodStatus: null
},
pageData: {
total: 0,
current: 1,
},
tableData: [],
tableCols: [{
type: 'selection',
width: 60,
align: 'center'
}, {
title: 'skn',
key: 'productSkn',
align: 'center'
}, {
title: '商品图片',
key: 'imageUrl',
align: 'center',
render: (h, params) => {
return h('img', {
attrs: {
src: params.row.imageUrl,
style: 'max-width: 100%; display: block; margin: 0 auto;'
}
});
}
}, {
title: '商品信息',
align: 'center',
key: 'productInfo',
render: (h, params) => {
return h('div', [
h('p', {
domProps: {
innerHTML:
`名称:<a target = '_black' style='color: #00b0ff; text-decoration: underline;'
href="//www.yohobuy.com/product/${params.row.productSkn}.html">
${params.row.productName}</a>`
}
}),
h('p', `品牌:${params.row.brandName}`),
h('p', `品类:${params.row.sortName}`)
]);
}
}, {
title: '库存状态',
key: 'stockStatusName',
align: 'center',
renderHeader: (h, params) => {
return h('div', [
h('strong', params.column.title),
h('Tooltip', {
attrs: {
placement: 'bottom-start',
content: '这里指整个商品下所有颜色尺码的库存状态。具体颜色、尺码的库存明细请参考商品详情页面。'
}
}, [
h('Icon', {
props: {
type: 'android-alert'
},
attrs: {style: 'font-size: 16px;vertical-align: text-top; margin-left: 5px;'}
})
])
]);
}
}, {
title: '当前价格(元)',
key: 'currentPrice',
align: 'center'
}, {
title: '结算比例',
key: 'commissionRate',
align: 'center',
render: (h, params) => {
return `${params.row.commissionRate.substring(0, params.row.commissionRate.length - 2)}%`;
}
}, {
title: '预估佣金(元)',
key: 'brokerage',
align: 'center'
}, {
title: '商品状态',
width: 150,
key: 'productStatusName',
align: 'center',
render: (h, params) => {
if (params.row.productStatusName.indexOf('异常') > -1) {
return h('span', {
attrs: {
style: 'color: red'
}
}, params.row.productStatusName);
} else {
return params.row.productStatusName;
}
}
}, {
title: '操作',
align: 'center',
render: (h, params) => {
return (
<action-group>
<i-button type="error" size="small" onClick={() => this.delProducts(params.row.productSkn)}>删除</i-button>
</action-group>
);
}
}]
};
},
created() {
this.candidateListService = new CandidateListService();
this.search();
},
methods: {
filterValues() {
let params = {
page: this.pageData.current,
size: 10,
productSkn: +this.query.productSkn,
productName: this.query.productName,
brandId: +this.query.brandId,
maxSortId: _.get(this.query, 'sort[0].value', ''),
middleSortId: _.get(this.query, 'sort[1].value', ''),
smallSortId: _.get(this.query, 'sort[2].value', ''),
stockStatus: this.query.stockStatus,
productStatus: this.query.prodStatus
};
return _.pickBy(params, val => val);
},
search() {
if (_.isObject(this.query) &&
typeof this.query.productSkn !== 'undefined' &&
!_.isFinite(+this.query.productSkn)) {
this.$Message.error('SKN编码只能是数字', 3);
return;
}
this.candidateListService.queryPoolProductList(this.filterValues()).then(ret => {
if (ret && ret.code === 200) {
this.tableData = _.get(ret, 'data.list', []);
this.pageData.total = _.get(ret, 'data.total', 0);
this.pageData.current = _.get(ret, 'data.page', 1);
} else {
this.$Message.error(ret.message);
}
});
},
reset() {
this.$refs.filter.reset();
this.search();
},
pageChange(val) {
this.pageData.current = val;
this.search();
},
delProducts(skn) {
const _this = this;
if (typeof skn !== 'number' && !_this.productSknStr) {
return this.$Message.error('请先选择要删除的商品');
}
this.$Modal.confirm({
title: '删除推广商品',
content: '是否确认删除?商品被删除后,前台小程序中不再展示。',
onOk() {
_this.candidateListService.batchDelProduct({
productSknStr: typeof skn === 'number' ? skn : _this.productSknStr
}).then(ret => {
if (ret && ret.code === 200) {
_this.$Message.success('删除成功!');
_this.search();
} else {
_this.$Message.error(`删除失败:${ret.message}`);
}
});
}
});
},
changeProductStr(selection) {
this.productSknStr = '';
_.each(selection, (item) => {
if (!this.productSknStr) {
this.productSknStr += item.productSkn;
} else {
this.productSknStr += `,${item.productSkn}`;
}
});
}
}
};
</script>
<style lang="scss">
.ivu-table-column-center .ivu-tooltip-inner {
white-space: normal !important;
}
</style>
... ...
<template>
<div>局部组件</div>
</template>
<script>
export default {
name: 'Demo',
};
</script>
... ...
import Demo from './demo';
export {
Demo
};
... ...
export default {
path: '/detail/:id.html',
name: 'detail',
component: () => import(/* webpackChunkName: "kol.settlement-detail" */'./settlement-detail'),
meta: {
pageName: '结算单详情'
}
};
... ...
<template>
<layout-body>
<layout-filter ref="filter" :model="query">
<filter-item label="结算单号">
<Input v-model.trim="query.id" :maxlength="9"></Input>
</filter-item>
<filter-item label="SKU编码">
<Input v-model.trim="query.productSku" :maxlength="9"></Input>
</filter-item>
<filter-item label="商品名称">
<Input v-model.trim="query.productName"></Input>
</filter-item>
<filter-item label="品牌">
<select-brand v-model="query.brandId"></select-brand>
</filter-item>
<filter-item label="订单号">
<Input v-model.trim="query.orderCode"></Input>
</filter-item>
<filter-item>
<Button type="primary" @click="search">筛选</Button>
<Button @click="reset">清空条件</Button>
<Button @click="exportData" type="warning">导出</Button>
</filter-item>
</layout-filter>
<layout-list>
<Table border :columns="tableCols" :data="tableData"></Table>
<Page :total="pageData.total" :current="pageData.current"
@on-change="pageChange" :page-size="10" show-total></Page>
</layout-list>
</layout-body>
</template>
<script>
import CandidateListService from 'services/kol/candidate-list-service';
import _ from 'lodash';
export default {
data() {
return {
query: {
id: '',
productSku: '',
productName: '',
brandId: '',
orderCode: ''
},
pageData: {
total: 0,
current: 1,
},
tableData: [],
tableCols: [{
title: '结算单号',
key: 'favoriteClearingId',
align: 'center'
}, {
title: '对账单号',
key: 'favoriteBalanceId',
align: 'center'
}, {
title: 'SKU',
key: 'productSku',
align: 'center'
}, {
title: '商品名称',
key: 'productName',
align: 'center'
}, {
title: '品牌',
key: 'brandName',
align: 'center'
}, {
title: '订单号',
key: 'orderCode',
align: 'center'
}, {
title: '业务类型',
key: 'outInTypeName',
align: 'center'
}, {
title: '吊牌价',
key: 'retailPrice',
align: 'center'
}, {
title: '支付金额',
key: 'lastOrderAmount',
align: 'center'
}, {
title: '结算比例',
key: 'clearingPercent',
align: 'center',
render: (h, params) => {
return parseInt(params.row.clearingPercent * 100, 10) + '%';
}
}, {
title: '数量',
key: 'num',
align: 'center'
}, {
title: '佣金',
align: 'center',
key: 'commission'
}]
};
},
created() {
this.candidateListService = new CandidateListService();
},
mounted() {
this.search();
},
methods: {
filterValues() {
let params = {
pageNo: this.pageData.current,
pageSize: 10,
favoriteClearingId: +this.query.id || +this.$router.history.current.params.id,
productSku: +this.query.productSku,
productName: this.query.productName,
brandId: +this.query.brandId,
orderCode: +this.query.orderCode
};
params = _.pickBy(params, val => val);
return params;
},
search() {
if (_.isObject(this.query) &&
typeof this.query.id !== 'undefined' &&
!_.isFinite(+this.query.id)) {
this.$Message.error('结算单号只能是数字', 3);
return;
}
if (_.isObject(this.query) &&
typeof this.query.productSku !== 'undefined' &&
!_.isFinite(+this.query.productSku)) {
this.$Message.error('SKU编码只能是数字', 3);
return;
}
if (_.isObject(this.query) &&
typeof this.query.orderCode !== 'undefined' &&
!_.isFinite(+this.query.orderCode)) {
this.$Message.error('订单号只能是数字', 3);
return;
}
this.candidateListService.clearingDetail(this.filterValues()).then(ret => {
if (ret && ret.code === 200) {
this.tableData = _.get(ret, 'data.records', []);
this.pageData.total = _.get(ret, 'data.totalCount', 0);
this.pageData.current = _.get(ret, 'data.pageNo', 1);
} else {
this.$Message.error(ret.message);
}
});
},
reset() {
this.$refs.filter.reset();
this.search();
},
pageChange(val) {
this.pageData.current = val;
this.search();
},
exportData() {
let params = {};
let temp = [];
_.assign(params, this.filterValues());
_.each(params, (val, key) => {
temp.push(`${key}=${val}`);
});
const href = `/Api/erp/exportFavoriteClearingDetail?${temp.join('&')}`;
window.open(href, '_blank');
}
},
components: {}
};
</script>
<style lang="scss">
</style>
... ...
<template>
<div>局部组件</div>
</template>
<script>
export default {
name: 'Demo',
};
</script>
... ...
import Demo from './demo';
export {
Demo
};
... ...
export default {
path: '/list.html',
name: 'list',
component: () => import(/* webpackChunkName: "kol.Settlement-list" */'./settlement-list'),
meta: {
pageName: '结算单管理'
}
};
... ...
<template>
<layout-body>
<layout-filter ref="filter" :model="query">
<filter-item label="结算单ID">
<Input v-model.trim="query.id"></Input>
</filter-item>
<filter-item label="SKU编码">
<Input v-model.trim="query.productSku" :maxlength="9"></Input>
</filter-item>
<filter-item label="支付时间">
<Date-picker v-model="query.createTime"
type="daterange" format="yyyy-MM-dd" placeholder="选择日期" clearable>
</Date-picker>
</filter-item>
<filter-item label="结算单状态">
<Select v-model="query.status" clearable>
<Option value="10">未到票</Option>
<Option value="20">待支付</Option>
<Option value="30">已支付</Option>
</Select>
</filter-item>
<filter-item>
<Button type="primary" @click="search">筛选</Button>
<Button @click="reset">清空条件</Button>
<Button @click="exportData" type="warning">导出</Button>
<Tooltip class="help-tooltip" :content="helpTip" placement="top-start">
<span class="tip">帮助说明</span>
</Tooltip>
</filter-item>
</layout-filter>
<layout-list>
<Table border :columns="tableCols" :data="tableData"></Table>
<Page :total="pageData.total" :current="pageData.current"
@on-change="pageChange" :page-size="10" show-total></Page>
</layout-list>
</layout-body>
</template>
<script>
import CandidateListService from 'services/kol/candidate-list-service';
import moment from 'moment';
import _ from 'lodash';
export default {
data() {
return {
query: {
id: '',
productSku: '',
status: null,
createTime: []
},
pageData: {
total: 0,
current: 1,
},
tableData: [],
tableCols: [{
title: '结算单ID',
key: 'id',
align: 'center'
}, {
title: '开始时间',
key: 'startTime',
width: 110,
render: (h, params) => {
let time = moment.unix(params.row.createTime);
return (
<div>{time.format('YYYY/MM/DD')}</div>
);
},
align: 'center'
}, {
title: '结束时间',
key: 'endTime',
width: 110,
render: (h, params) => {
let time = moment.unix(params.row.endTime);
return (
<div>{time.format('YYYY/MM/DD')}</div>
);
},
align: 'center'
}, {
title: '应付金额',
key: 'amount',
align: 'center'
}, {
title: '到票金额',
key: 'invoiceAmount',
align: 'center'
}, {
title: '实付金额',
key: 'paymentAmount',
align: 'center'
}, {
title: '状态',
key: 'statusName',
align: 'center'
}, {
title: '支付时间',
key: 'paymentTime',
width: 110,
render: (h, params) => {
if (!params.row.paymentTime) {
return '暂无';
} else {
let time = moment.unix(params.row.paymentTime);
return (
<div>{time.format('YYYY/MM/DD')}</div>
);
}
},
align: 'center'
}, {
title: '备注',
key: 'remark',
align: 'center'
}, {
title: '操作',
align: 'center',
width: 100,
render: (h, params) => {
return (
<action-group>
<i-button type="primary" size="small" onClick={() => this.edit(params.row)}>查看详情</i-button>
</action-group>
);
}
}],
helpTip: '结算单每月16号系统自动生成,用于与财务结算本月之前的所有已对账账单,未对账以及发生退货的账单不会出现在结算单中。系统生成结算单后,请尽快按照应付金额提供相应发票,进行结算。'
};
},
computed: {
startTime() {
let createTime = this.query.createTime;
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[0] ? createTime[0].getTime() / 1000 : 0;
}
},
endTime() {
let createTime = this.query.createTime;
if (_.isEmpty(createTime)) {
return 0;
} else {
return createTime[1] ? createTime[1].getTime() / 1000 : 0;
}
}
},
created() {
this.candidateListService = new CandidateListService();
},
mounted() {
this.search();
},
methods: {
filterValues() {
let params = {
pageNo: this.pageData.current,
pageSize: 10,
id: +this.query.id,
productSku: +this.query.productSku,
status: +this.query.status,
startTime: this.startTime,
endTime: this.endTime
};
params = _.pickBy(params, val => val);
return params;
},
search() {
if (_.isObject(this.query) &&
typeof this.query.id !== 'undefined' &&
!_.isFinite(+this.query.id)) {
this.$Message.error('结算单ID只能是数字', 3);
return;
}
if (_.isObject(this.query) &&
typeof this.query.productSku !== 'undefined' &&
!_.isFinite(+this.query.productSku)) {
this.$Message.error('SKU编码只能是数字', 3);
return;
}
this.candidateListService.clearingList(this.filterValues()).then(ret => {
if (ret && ret.code === 200) {
this.tableData = _.get(ret, 'data.records', []);
this.pageData.total = _.get(ret, 'data.totalCount', 0);
this.pageData.current = _.get(ret, 'data.pageNo', 1);
} else {
this.$Message.error(ret.message);
}
});
},
reset() {
this.$refs.filter.reset();
this.search();
},
pageChange(val) {
this.pageData.current = val;
this.search();
},
edit(row) {
this.$router.push({
name: 'kol.settlement.detail',
params: {
id: row.id
}
});
},
exportData() {
let params = {};
let temp = [];
_.assign(params, this.filterValues());
_.each(params, (val, key) => {
temp.push(`${key}=${val}`);
});
const href = `/Api/erp/exportFavoriteClearingList?${temp.join('&')}`;
window.open(href, '_blank');
}
},
components: {}
};
</script>
<style lang="scss">
.ivu-date-picker .ivu-select-dropdown {
right: 0;
left: auto !important;
}
.help-tooltip {
.ivu-tooltip-inner {
max-width: 600px;
white-space: normal;
}
.tip {
margin-left: 10px;
color: #00b0ff;
cursor: pointer;
text-decoration: underline;
&:before {
display: inline-block;
content: "?";
font-size: 12px;
height: 12px;
width: 12px;
color: #fff;
line-height: 12px;
margin-right: 4px;
background-color: #00b0ff;
border-radius: 6px;
text-align: center;
}
}
}
</style>
... ...
import Service from '../service';
let apiUrl = {
batchAddProduct: '/platform/batchAddProduct',
queryWarehouseProductList: '/platform/queryWarehouseProductList',
batchDelProduct: '/platform/batchDelProduct',
queryPoolProductList: '/platform/queryPoolProductList',
favoriteBalanceList: '/erp/favoriteBalanceList',
favoriteBalanceCheck: '/erp/favoriteBalanceCheck',
clearingList: '/erp/clearingList',
clearingDetail: '/erp/clearingDetail',
queryByPidForFavorite: '/erp/queryByPidForFavorite',
exportFavoriteClearingList: '/erp/exportFavoriteClearingList',
exportFavoriteClearingDetail: '/erp/exportFavoriteClearingDetail',
exportFavoriteBalanceDetail: '/erp/exportFavoriteBalanceDetail'
};
class CandidateListService extends Service {
batchAddProduct(params) {
return this.post(apiUrl.batchAddProduct, params);
}
queryWarehouseProductList(params) {
return this.post(apiUrl.queryWarehouseProductList, params);
}
batchDelProduct(params) {
return this.post(apiUrl.batchDelProduct, params);
}
queryPoolProductList(params) {
return this.post(apiUrl.queryPoolProductList, params);
}
favoriteBalanceList(params) {
return this.post(apiUrl.favoriteBalanceList, params);
}
favoriteBalanceCheck(params) {
return this.post(apiUrl.favoriteBalanceCheck, params);
}
clearingList(params) {
return this.post(apiUrl.clearingList, params);
}
clearingDetail(params) {
return this.post(apiUrl.clearingDetail, params);
}
queryByPidForFavorite() {
return this.post(apiUrl.queryByPidForFavorite);
}
exportFavoriteClearingList() {
return this.post(apiUrl.exportFavoriteClearingList);
}
exportFavoriteClearingDetail() {
return this.post(apiUrl.exportFavoriteClearingDetail);
}
exportFavoriteBalanceDetail() {
return this.post(apiUrl.exportFavoriteBalanceDetail);
}
}
export default CandidateListService;
... ...
import candidateListService from './candidate-list-service';
export {
candidateListService
};
... ...
... ... @@ -6,6 +6,9 @@ class BrandService extends Service {
cache: true
});
}
getBrandNames(params) {
return this.post('/platform/getBrandNames', params);
}
}
export default BrandService;
... ...
... ... @@ -78,7 +78,7 @@ export default {
methods: {
search() {
// 在这里实现异步查询的方法,建议在service中做
let params = Object.assin(this.query, this.pageData);
let params = Object.assign(this.query, this.pageData);
console.log(params);
},
... ...
This diff could not be displayed because it is too large.
{
"name": "yoho-shop-manage",
"version": "1.0.31",
"version": "1.0.35",
"description": "",
"main": "app.js",
"scripts": {
... ... @@ -14,7 +14,8 @@
"lint-css": "lint-css",
"precommit": "lint-commit",
"lint-all": "lint-all",
"code": "node ./build/code/code.js"
"code": "node ./build/code/code.js",
"fix:fe": "eslint --fix ./app"
},
"config": {
"lintJs": [
... ...
... ... @@ -59,7 +59,15 @@ let domainApis = {
defectGoodsList: '/erp-gateway-web/wms/defectGoods/list',
defectGoodsImg: '/erp-gateway-web/wms/defectGoods/detail',
storageList: '/erp-gateway-web/storageDetail/stock',
exportStorageDetailList: '/erp-gateway-web/export/exportStorageDetailList'
exportStorageDetailList: '/erp-gateway-web/export/exportStorageDetailList',
favoriteBalanceList: '/erp-gateway-web/finance/favoriteBalanceDetail/pageList',
favoriteBalanceCheck: '/erp-gateway-web/finance/favoriteBalanceDetail/check',
clearingList: '/erp-gateway-web/favorite/clearing/list',
clearingDetail: '/erp-gateway-web/favorite/clearingDetail/list',
queryByPidForFavorite: '/erp-gateway-web/account/profile/queryByPidForFavorite',
exportFavoriteClearingList: '/erp-gateway-web/export/favoriteClearingList',
exportFavoriteClearingDetail: '/erp-gateway-web/export/favoriteClearingDetail',
exportFavoriteBalanceDetail: '/erp-gateway-web/export/exportFavoriteBalanceDetail'
},
platform: {
queryShopsByAdminPid: '/SellerShopController/queryShopsByAdminPid',
... ... @@ -110,6 +118,11 @@ let domainApis = {
exportOneShopOverview: '/merchant/exportOneShopOverview',
queryOneShopProductOverview: '/merchant/queryOneShopProductOverview',
exportOneShopProductOverview: '/merchant/exportOneShopProductOverview',
batchAddProduct: '/SellerDistributionController/batchAddProduct',
queryWarehouseProductList: '/SellerDistributionController/queryWarehouseProductList',
batchDelProduct: '/SellerDistributionController/batchDelProduct',
queryPoolProductList: '/SellerDistributionController/queryPoolProductList',
getBrandNames: '/SellerDistributionController/getBrandNames'
},
shop: {
login: '/loginInter',
... ... @@ -120,13 +133,13 @@ let domainApis = {
// 域名列表
const domains = {
erp: 'http://192.168.103.82:9098',
platform: 'http://192.168.102.48:8088/platform',
platform: 'http://192.168.102.202:8088/platform',
shop: 'http://192.168.102.211:30016'
};
if (global.env.Test) {
domains.erp = 'http://192.168.103.82:9098';
domains.platform = 'http://192.168.102.48:8088/platform';
domains.platform = 'http://192.168.102.202:8088/platform';
domains.shop = 'http://192.168.102.211:30016';
}
... ...
This diff could not be displayed because it is too large.