Authored by 李奇

废弃的文件删除

... ... @@ -75,7 +75,6 @@
export default {
data() {
return {
self: this,
tableCols: [],
tableData: {},
pageData: {},
... ...
... ... @@ -67,7 +67,6 @@
export default {
data() {
return {
self: this,
showSizeEdit: false,
tableCols: [],
tableData: {},
... ...
import diff from './diff-iframe';
import jit from './jit';
import prodReturn from './prod-return';
import invoice from './invoice';
import replenish from './replenish';
export default {
diff,
jit,
prodReturn,
invoice,
replenish
};
... ...
const page = r => require.ensure([], () => r(require('./return')), 'repository.return');
export default {
path: '/prodReturn.html',
name: 'prodReturn',
component: page,
meta: {
pageName: '商品退库'
}
};
... ...
<template>
<LayoutBody>
<LayoutFilter>
<FilterItem :label="filters.sknCode.label">
<Input v-model.trim.number="filters.sknCode.model"
:placeholder="filters.sknCode.holder" :maxlength="9"></Input>
</FilterItem>
<FilterItem :label="filters.prodCode.label">
<Input v-model.trim="filters.prodCode.model"
:placeholder="filters.prodCode.holder"></Input>
</FilterItem>
<FilterItem :label="filters.prodBarCode.label">
<Input v-model.trim="filters.prodBarCode.model"
:placeholder="filters.prodBarCode.holder"></Input>
</FilterItem>
<FilterItem :label="filters.priceStatus.label">
<Select v-model.trim="filters.priceStatus.model">
<Option v-for="option in filters.priceStatus.options"
:value="option.value"
:key="option.value">{{option.label}}</Option>
</Select>
</FilterItem>
<FilterItem :label="filters.saleStatus.label">
<Select v-model.trim="filters.saleStatus.model">
<Option v-for="option in filters.saleStatus.options"
:value="option.value"
:key="option.value">{{option.label}}</Option>
</Select>
</FilterItem>
<FilterItem :label="filters.stockStatus.label">
<Select v-model.trim="filters.stockStatus.model">
<Option v-for="option in filters.stockStatus.options"
:value="option.value"
:key="option.value">{{option.label}}</Option>
</Select>
</FilterItem>
<FilterItem label="选择类目">
<SelectCategory :value="categoryValue"
@select-change="sortChange"></SelectCategory>
</FilterItem>
<FilterItem>
<Button type="primary" @click="filterSearch">筛选</Button>
<Button @click="clearFilter">清空条件</Button>
<Button>导出</Button>
</FilterItem>
</LayoutFilter>
<LayoutList>
<Table border :columns="columns"
@on-selection-change="selectChange" :data="dataList"></Table>
<Page :total="page.total" :current="page.current"
@on-change="pageChange" :page-size="20" show-total></Page>
</LayoutList>
</LayoutBody>
</template>
<script>
import _ from 'lodash';
import service from 'product-service';
import {SelectBrand, SelectCategory} from 'components/select';
import {CellImage, CellInfo, CellPrice} from 'components/cell';
import vipStore from './store';
export default {
data() {
return {
columns: [],
dataList: {},
page: {},
filters: {},
batchRows: [],
submitting: false,
enableFilter: false,
categoryValue: []
};
},
created() {
const vip = vipStore.apply(this);
const params = this.filterValues();
this.productList(params);
this.filters = vip.filterFields;
this.columns = vip.tableCols;
this.dataList = vip.tableData;
this.page = vip.pageData;
},
methods: {
filterValues() {
const values = {
page: 1,
size: 20
};
const fields = this.filters;
const keyMap = {
productSkn: 'sknCode',
sknFactoryCode: 'prodCode',
status: 'saleStatus',
productVipStatus: 'priceStatus',
skuFactoryCode: 'prodBarCode',
stock: 'stockStatus',
maxSortId: 'maxSort',
middleSortId: 'midSort',
smallSortId: 'minSort'
};
const selectKeys = ['status', 'stock', 'productVipStatus'];
if (this.enableFilter) {
_.each(keyMap, (val, key) => {
values[key] = fields[val].model;
});
_.each(selectKeys, key => {
const val = values[key];
if (val === -1) {
values[key] = null;
}
});
}
return values;
},
filterSearch() {
let params = {};
this.enableFilter = true;
params = this.filterValues();
this.productList(params);
this.page.current = 1;
},
clearFilter() {
let params = {};
const store = vipStore.apply(this);
this.filters = store.filterFields;
this.enableFilter = false;
params = this.filterValues();
this.productList(params);
this.page.current = 1;
this.categoryValue = [];
},
productList(params) {
if (_.isObject(params) &&
typeof params.productSkn !== 'undefined' &&
!_.isFinite(+params.productSkn)) {
this.$Message.error('SKN编码只能是数字', 3);
return;
}
this.$Loading.start();
service.vipProductList(params)
.then(res => {
this.$Loading.finish();
if (res.code === 200) {
this.resolveData(res.data);
}
});
},
reloadList() {
let params = {};
if (this.enableFilter) {
params = this.filterValues();
}
_.merge(params, {
page: 1,
size: 20
});
this.productList(params);
this.page.current = 1;
},
resolveData(data) {
this.dataList = data.list;
this.page.total = data.total;
},
enableVipPrice(row) {
const skn = row.productSKN;
const canOpen = row.canOpenFlag;
if (canOpen) {
this.setPriceStatus([{
skn
}], 1);
} else {
this.$Message
.error('与平台签订vip会员价格相关合同后,才能开启', 3);
}
},
disableVipPrice(row) {
const skn = row.productSKN;
this.setPriceStatus([{
skn
}], 2);
},
batchSetVip(status) {
let list = [];
const vsMap = {
1: '启用',
2: '禁用'
};
const len = this.batchRows.length;
if (len) {
_.each(this.batchRows, item => {
list.push({
skn: item.productSKN,
status: item.productVipStatus
});
});
this.setPriceStatus(list, status);
} else {
this.$Message.error(`请先勾选要${vsMap[status]}的商品`, 3);
}
},
setPriceStatus(list, status) {
let sknList = [];
let params = {};
const vsMap = {
1: '启用',
2: '禁用'
};
list = _.filter(list, item => {
return item.status !== status;
});
if (!list.length) {
this.$Message.error(`当前选中的商品中,不包含要${vsMap[status]}的商品`, 3);
return;
}
_.each(list, item => {
sknList.push(item.skn);
});
params.productSknList = sknList;
params.productVipStatus = status;
if (sknList.length) {
if (this.submitting) {
return;
}
this.submitting = true;
service.setVipPriceStatus(params)
.then(() => {
this.reloadList();
this.submitting = false;
this.$Message.success('VIP价格状态变更成功');
});
}
},
sortChange({max, mid, min}) {
this.filters.maxSort.model = max || null;
this.filters.midSort.model = mid || null;
this.filters.minSort.model = min || null;
},
pageChange(page) {
let params = this.filterValues();
params.page = page;
this.page.current = page;
this.productList(params);
},
selectChange(rows) {
this.batchRows = rows;
}
},
components: {
SelectBrand,
SelectCategory,
CellImage,
CellInfo,
CellPrice
}
};
</script>
<style lang="scss">
</style>
... ...
/**
* repository return data
* @author: qi.li <qi.li@yoho.cn>
* @date: 2017/06/01
*/
export default function() {
return {
tableCols: [
{
type: 'selection',
width: 60,
align: 'center'
},
{
title: '请退单号',
align: 'center'
},
{
title: '品牌',
align: 'center'
},
{
title: '已退/请退数量',
align: 'center'
},
{
title: '物流信息',
align: 'center'
},
{
title: '备注',
align: 'center'
},
{
title: '审核状态',
align: 'center'
},
{
title: '请退/退库时间',
align: 'center'
},
{
title: '申请人',
align: 'center'
},
{
title: '操作',
align: 'center'
}
],
tableData: [],
pageData: {
total: 0,
current: 1
},
filterFields: {
sknCode: {
label: 'SKN编码',
model: '',
holder: ''
},
skuCode: {
label: 'SKU编码',
model: '',
holder: ''
},
prodBarCode: {
label: '商品条码',
model: '',
holder: ''
},
reqNum: {
label: '请退单号',
model: '',
holder: ''
},
reqTime: {
label: '请退时间',
model: '',
holder: ''
},
resTime: {
label: '退库时间',
model: '',
holder: ''
}
}
};
}
... ...
<template>
<div class="cell-info">
<div class="detail">
<p>SKU:{{sku}}</p>
<p>SKN:{{skn}}</p>
<p>规格:{{color}}/{{size}}</p>
<p>名称:{{name}}</p>
<p>品牌:{{brand}}</p>
<p>销售价:{{price}}</p>
<p>采购价:{{purchasePrice}}</p>
</div>
</div>
</template>
<script>
export default {
name: 'CellInfo',
props: {
skn: {
type: [String, Number]
},
sku: {
type: [String, Number]
},
color: {
type: String
},
size: {
type: String
},
brand: {
type: String
},
price: {
type: [String, Number]
},
purchasePrice: {
type: [String, Number]
},
name: {
type: String
}
}
};
</script>
<style lang="scss" scoped>
.cell-info {
text-align: left;
}
</style>
import CellDeliver from './cell-deliver';
import CellDispatch from './cell-dispatch';
import CellPrdInfo from './cell-prd-info';
import CellStockOut from './cell-stock-out';
export {
CellDeliver,
CellDispatch,
CellPrdInfo,
CellStockOut
};
... ...