...
|
...
|
@@ -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
|
|
|
}
|
|
|
});
|
|
|
|
...
|
...
|
|