|
|
<template>
|
|
|
<layout-body>
|
|
|
<layout-filter>
|
|
|
<filter-item :label="filters.id.label">
|
|
|
<Input v-model.trim="filters.id.model"
|
|
|
:placeholder="filters.id.holder" maxlength="9" ></Input>
|
|
|
<filter-item :label="filters.orderCode.label">
|
|
|
<Input v-model.trim="filters.orderCode.model"
|
|
|
:placeholder="filters.orderCode.holder" maxlength="9" ></Input>
|
|
|
</filter-item>
|
|
|
|
|
|
<filter-item :label="filters.expressNumber.label">
|
|
|
<Input v-model.trim="filters.expressNumber.model"
|
|
|
:placeholder="filters.expressNumber.holder" ></Input>
|
|
|
</filter-item>
|
|
|
|
|
|
<filter-item :label="filters.productSkn.label">
|
|
|
<Input v-model.trim="filters.productSkn.model"
|
|
|
:placeholder="filters.productSkn.holder" maxlength="9"></Input>
|
|
|
</filter-item>
|
|
|
|
|
|
<filter-item :label="filters.skuFactoryCode.label">
|
|
|
<Input v-model.trim="filters.skuFactoryCode.model"
|
|
|
:placeholder="filters.skuFactoryCode.holder"></Input>
|
|
|
<filter-item :label="filters.productSku.label">
|
|
|
<Input v-model.trim="filters.productSku.model"
|
|
|
:placeholder="filters.productSku.holder" maxlength="9"></Input>
|
|
|
</filter-item>
|
|
|
|
|
|
<filter-item>
|
|
|
<Button type="primary" @click="getExpress">筛选</Button>
|
|
|
<Button type="warning" @click="exportList">导出</Button>
|
|
|
<Button type="primary" @click="getSellBack">筛选</Button>
|
|
|
<Button @click="clearFilters">清空条件</Button>
|
|
|
</filter-item>
|
|
|
</layout-filter>
|
...
|
...
|
@@ -34,70 +23,77 @@ |
|
|
@on-change="pageChange" :page-size="20" show-total></Page>
|
|
|
</layout-list>
|
|
|
|
|
|
<edit-img ref="showImgEdit" @on-success="editSuccess"></edit-img>
|
|
|
|
|
|
</layout-body>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import {list} from './store';
|
|
|
import ExpressService from 'services/repository/sellback-service';
|
|
|
import EditImg from './components/edit-img.vue';
|
|
|
import SellService from 'services/repository/sellback-service';
|
|
|
|
|
|
export default {
|
|
|
created() {
|
|
|
this.expressService = new ExpressService();
|
|
|
this.sellService = new SellService();
|
|
|
},
|
|
|
data() {
|
|
|
return list.call(this);
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getExpress();
|
|
|
this.getSellBack();
|
|
|
},
|
|
|
methods: {
|
|
|
editImg(row) {
|
|
|
this.$refs.showImgEdit.show(row);
|
|
|
},
|
|
|
editSuccess() {
|
|
|
this.getImg();
|
|
|
},
|
|
|
clearFilters() {
|
|
|
this.filters.id.model = null;
|
|
|
this.filters.expressNumber.model = null;
|
|
|
this.filters.productSkn.model = null;
|
|
|
this.filters.skuFactoryCode.model = null;
|
|
|
this.filters.orderCode.model = null;
|
|
|
this.filters.productSku.model = null;
|
|
|
this.pageData.current = 1;
|
|
|
this.pageData.total = 0;
|
|
|
|
|
|
this.getExpress();
|
|
|
this.getSellBack();
|
|
|
},
|
|
|
filtersParams() {
|
|
|
let params = {};
|
|
|
let productSku = this.filters.productSku.model;
|
|
|
|
|
|
if (this.filters.id.model) {
|
|
|
if (this.isNumber(this.filters.id.model)) {
|
|
|
params.proReqFormId = this.filters.id.model;
|
|
|
if (this.filters.orderCode.model) {
|
|
|
if (this.isNumber(this.filters.orderCode.model)) {
|
|
|
params.proReqFormId = this.filters.orderCode.model;
|
|
|
} else {
|
|
|
return Promise.reject('入库单号必须是数字');
|
|
|
return Promise.reject('订单号必须是数字');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (this.filters.expressNumber.model) {
|
|
|
params.expressNumber = this.filters.expressNumber.model;
|
|
|
}
|
|
|
|
|
|
if (this.filters.productSkn.model) {
|
|
|
if (this.isNumber(this.filters.productSkn.model)) {
|
|
|
params.productSkn = this.filters.productSkn.model;
|
|
|
if (this.filters.productSku.model) {
|
|
|
if (this.isNumber(this.filters.productSku.model)) {
|
|
|
params.productSku = this.filters.productSku.model;
|
|
|
} else {
|
|
|
return Promise.reject('skn必须是数字');
|
|
|
}
|
|
|
return Promise.reject('sku必须是数字');
|
|
|
}
|
|
|
|
|
|
if (this.filters.skuFactoryCode.model) {
|
|
|
params.skuFactoryCode = this.filters.skuFactoryCode.model;
|
|
|
}
|
|
|
|
|
|
params.pageSize = this.pageData.pageSize;
|
|
|
params.pageNo = this.pageData.current;
|
|
|
|
|
|
return Promise.resolve(params);
|
|
|
return Promise.resolve({
|
|
|
params,
|
|
|
productSku
|
|
|
});
|
|
|
},
|
|
|
pageChange(page) {
|
|
|
this.pageData.current = page;
|
|
|
this.getSellBack();
|
|
|
},
|
|
|
getExpress() {
|
|
|
getSellBack() {
|
|
|
this.$Loading.start();
|
|
|
return this.filtersParams().then((params) => {
|
|
|
return this.expressService.list(params);
|
|
|
return this.sellService.list(params);
|
|
|
}).then((result) => {
|
|
|
if (result.code === 200) {
|
|
|
this.pageData.total = result.data.totalCount;
|
...
|
...
|
@@ -110,27 +106,23 @@ |
|
|
this.$Message.error(err);
|
|
|
});
|
|
|
},
|
|
|
info(data) {
|
|
|
this.$router.push({
|
|
|
name: 'repository.express.info',
|
|
|
params: {
|
|
|
id: data.expressNumber
|
|
|
},
|
|
|
query: {
|
|
|
time: data.createTime
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
exportList() {
|
|
|
this.expressService.exportList().then((url) => {
|
|
|
window.open(url, '_blank');
|
|
|
});
|
|
|
},
|
|
|
isNumber(numStr) {
|
|
|
const isNumber = /^[0-9]+$/;
|
|
|
|
|
|
return isNumber.test(numStr);
|
|
|
},
|
|
|
getImg() {
|
|
|
return this.filterParams().then((params) => {
|
|
|
return this.sellService.imgDetail(params).then((result) => {
|
|
|
if (result.code === 200) {
|
|
|
this.tableData = result.data;
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
},
|
|
|
components: {
|
|
|
EditImg
|
|
|
}
|
|
|
};
|
|
|
</script> |
...
|
...
|
|