Authored by 李奇

商品退库修改

... ... @@ -25,7 +25,7 @@
return store.apply(this);
},
created() {
const returnId = this.$route.params.returnId;
const returnId = this.$route.params.id;
const supplierId = this.$route.params.supplierId;
const supplierName = this.$route.params.supplierName;
const params = { supplierId, returnedSupplierId: returnId };
... ...
... ... @@ -2,28 +2,24 @@
<LayoutBody>
<LayoutFilter>
<FilterItem :label="filters.sknCode.label">
<Input v-model.trim.number="filters.sknCode.model"
:placeholder="filters.sknCode.holder" :maxlength="9"></Input>
<Input v-model.trim.number="filters.sknCode.model" :maxlength="9"></Input>
</FilterItem>
<FilterItem :label="filters.skuCode.label">
<Input v-model.trim.number="filters.skuCode.model"
:placeholder="filters.skuCode.holder" :maxlength="9"></Input>
<Input v-model.trim.number="filters.skuCode.model" :maxlength="9"></Input>
</FilterItem>
<FilterItem :label="filters.prodBarCode.label">
<Input v-model.trim.number="filters.prodBarCode.model"
:placeholder="filters.prodBarCode.holder" :maxlength="9"></Input>
<Input v-model.trim="filters.prodBarCode.model"></Input>
</FilterItem>
<FilterItem :label="filters.reqNum.label">
<Input v-model.trim.number="filters.reqNum.model"
:placeholder="filters.reqNum.holder" :maxlength="9"></Input>
<Input v-model.trim.number="filters.reqNum.model" :maxlength="9"></Input>
</FilterItem>
<FilterItem :label="filters.reqTime.label">
<Input v-model.trim.number="filters.reqTime.model"
:placeholder="filters.reqTime.holder" :maxlength="9"></Input>
<FilterItem :label="filters.createTime.label">
<Date-picker type="datetimerange" placeholder="选择日期和时间"
@on-change="createTimeChange"></Date-picker>
</FilterItem>
<FilterItem :label="filters.resTime.label">
<Input v-model.trim.number="filters.resTime.model"
:placeholder="filters.resTime.holder" :maxlength="9"></Input>
<FilterItem :label="filters.outTime.label">
<Date-picker type="datetimerange" placeholder="选择日期和时间"
@on-change="outTimeChange"></Date-picker>
</FilterItem>
<FilterItem>
<Button type="primary" @click="filterSearch">筛选</Button>
... ... @@ -42,6 +38,7 @@
<script>
import _ from 'lodash';
import moment from 'moment';
import rs from 'return-service';
import listStore from './store/list';
... ... @@ -59,31 +56,21 @@
size: 20
};
const fields = this.filters;
const keyMap = {
const keysMap = {
productSkn: 'sknCode',
sknFactoryCode: 'prodCode',
status: 'saleStatus',
productVipStatus: 'priceStatus',
skuFactoryCode: 'prodBarCode',
stock: 'stockStatus',
maxSortId: 'maxSort',
middleSortId: 'midSort',
smallSortId: 'minSort'
productSku: 'skuCode',
factoryCode: 'prodBarCode',
returnedSupplierId: 'reqNum',
bCreateTime: 'bCreateTime',
eCreateTime: 'eCreateTime',
bOutTime: 'bOutTime',
eOutTime: 'eOutTime'
};
const selectKeys = ['status', 'stock', 'productVipStatus'];
if (this.enableFilter) {
_.each(keyMap, (val, key) => {
_.each(keysMap, (val, key) => {
values[key] = fields[val].model;
});
_.each(selectKeys, key => {
const val = values[key];
if (val === -1) {
values[key] = null;
}
});
}
return values;
},
... ... @@ -97,22 +84,59 @@
},
clearFilter() {
},
createTimeChange(time) {
// 兼容: https://github.com/iview/iview/issues/973
if (!_.isArray(time)) {
time = time.split(' - ');
}
this.filters.bCreateTime.model = +moment(time[0]).format('X');
this.filters.eCreateTime.model = +moment(time[1]).format('X');
},
outTimeChange(time) {
// 兼容: https://github.com/iview/iview/issues/973
if (!_.isArray(time)) {
time = time.split(' - ');
}
this.filters.bOutTime.model = +moment(time[0]).format('X');
this.filters.eOutTime.model = +moment(time[1]).format('X');
},
returnList(params) {
const isValid = this.checkParams(params);
if (isValid) {
this.$Loading.start();
rs.list(params)
.then(res => {
this.$Loading.finish();
if (res.code === 200) {
this.resolveData(res.data);
}
});
}
},
checkParams(params) {
if (_.isObject(params) &&
typeof params.productSkn !== 'undefined' &&
!_.isFinite(+params.productSkn)) {
this.$Message.error('SKN编码只能是数字', 3);
return;
return false;
}
this.$Loading.start();
rs.list()
.then(res => {
this.$Loading.finish();
if (res.code === 200) {
this.resolveData(res.data);
}
});
if (_.isObject(params) &&
typeof params.productSku !== 'undefined' &&
!_.isFinite(+params.productSku)) {
this.$Message.error('SKU编码只能是数字', 3);
return false;
}
if (_.isObject(params) &&
typeof params.returnedSupplierId !== 'undefined' &&
!_.isFinite(+params.returnedSupplierId)) {
this.$Message.error('请退单号只能是数字', 3);
return false;
}
return true;
},
resolveData(data) {
this.dataList = data.records;
... ... @@ -136,9 +160,9 @@
this.$router.push({
name: 'repository.prodReturn.detail',
params: {
returnId,
supplierId,
supplierName
supplierName,
id: returnId
}
});
... ...
... ... @@ -3,6 +3,7 @@
* @author: qi.li <qi.li@yoho.cn>
* @date: 2017/06/01
*/
import timeFormat from 'filters/time-format';
export default function() {
return {
... ... @@ -39,7 +40,13 @@ export default function() {
{
title: '条码',
align: 'center',
key: 'factoryCode'
render: (h, params) => {
const row = params.row;
return (
<span>{row.factoryCode || '-'}</span>
);
}
},
{
title: '品牌',
... ... @@ -84,12 +91,24 @@ export default function() {
{
title: '退货原因',
align: 'center',
key: 'returndReason'
render: (h, params) => {
const row = params.row;
return (
<span>{row.returndReason || '-'}</span>
);
}
},
{
title: '物流单号',
align: 'center',
key: 'expressCode'
render: (h, params) => {
const row = params.row;
return (
<span>{row.expressCode || '-'}</span>
);
}
},
{
title: '承担方',
... ... @@ -99,12 +118,20 @@ export default function() {
{
title: '请退时间',
align: 'center',
key: 'createTime'
render: (h, params) => {
return (
<span>{timeFormat(params.row.createTime)}</span>
);
}
},
{
title: '退库时间',
align: 'center',
key: 'outTime'
render: (h, params) => {
return (
<span>{timeFormat(params.row.outTime)}</span>
);
}
}
],
dataList: []
... ...
... ... @@ -6,51 +6,47 @@
import timeFormat from 'filters/time-format';
const statusMap = {
10: 'todo'
};
export default function() {
return {
enableFilter: false,
filters: {
sknCode: {
label: 'SKN编码',
model: '',
holder: ''
model: ''
},
skuCode: {
label: 'SKU编码',
model: '',
holder: ''
model: ''
},
prodBarCode: {
label: '商品条码',
model: '',
holder: ''
model: ''
},
reqNum: {
label: '请退单号',
model: '',
holder: ''
},
reqTime: {
label: '请退时间',
model: '',
holder: ''
},
resTime: {
label: '退库时间',
model: '',
holder: ''
}
model: ''
},
createTime: {
label: '请退时间'
},
bCreateTime: {
model: ''
},
eCreateTime: {
model: ''
},
outTime: {
label: '退库时间'
},
bOutTime: {
model: ''
},
eOutTime: {
model: ''
},
},
columns: [
{
type: 'selection',
width: 60,
align: 'center'
},
{
title: '请退单号',
align: 'center',
key: 'returnedSupplierId'
... ... @@ -105,7 +101,7 @@ export default function() {
align: 'center',
render(h, params) {
return (
<span>{statusMap[params.row.status]}</span>
<span>{params.row.statusName}</span>
);
}
},
... ... @@ -113,8 +109,13 @@ export default function() {
title: '请退/退库时间',
align: 'center',
render: (h, params) => {
const row = params.row;
return (
<span>{timeFormat(params.row.createTime)}</span>
<div>
<p>请退时间:<span>{timeFormat(row.createTime)}</span></p>
<p>退库时间:<span>{timeFormat(row.outTime)}</span></p>
</div>
);
}
},
... ...
... ... @@ -16,8 +16,8 @@ let domainApis = {
allotExpressCompList: '/erp-shop-web/express/getExpressList',
allotExportList: '/erp-shop-web/export/exportForPurchaseForm',
allotPrintExpressDetail: '/erp-shop-web/purchase/queryExpressListByExpressNumber',
returnSupplierList: '/erp-shop-web/logistics/returnedSupploer/list',
returnSupplierDetail: '/erp-shop-web/logistics/returnedSupploer/detail',
returnSupplierList: '/erp-shop-web/logistics/returnedSupplier/list',
returnSupplierDetail: '/erp-shop-web/logistics/returnedSupplier/detail',
jitProductList: '/erp-shop-web/product/jitProductList',
getJitStorageListBySkn: '/erp-shop-web/product/getJitStorageListBySkn',
importJitStorage: '/erp-shop-web/product/importJitStorage',
... ...