...
|
...
|
@@ -6,14 +6,18 @@ |
|
|
<Input v-model.trim="filters.productSku.model"
|
|
|
:placeholder="filters.productSku.holder" :maxlength="9"></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.factoryCode.label">
|
|
|
<Input v-model.trim="filters.factoryCode.model"
|
|
|
:placeholder="filters.factoryCode.holder" :maxlength="100" ></Input>
|
|
|
</filter-item>
|
|
|
<filter-item :label="filters.upmCode.label">
|
|
|
<Input v-model.trim="filters.upmCode.model"
|
|
|
:placeholder="filters.upmCode.holder" :maxlength="100" ></Input>
|
|
|
</filter-item>
|
|
|
<!--<filter-item :label="filters.upmCode.label">-->
|
|
|
<!--<Input v-model.trim="filters.upmCode.model"-->
|
|
|
<!--:placeholder="filters.upmCode.holder" :maxlength="100" ></Input>-->
|
|
|
<!--</filter-item>-->
|
|
|
|
|
|
<filter-item>
|
|
|
<Button type="primary" @click="filterSearch">筛选</Button>
|
...
|
...
|
@@ -42,9 +46,13 @@ |
|
|
|
|
|
export default {
|
|
|
created() {
|
|
|
this.tableFalse = false;
|
|
|
this.inventoryService = new InventoryService();
|
|
|
if (this.$route.query.productSkn) {
|
|
|
this.getInventory();
|
|
|
} else {
|
|
|
this.tableFalse = false;
|
|
|
this.noFilteredDataText = '请输入查询条件,进行数据筛选展示!';
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
return store.call(this);
|
...
|
...
|
@@ -52,8 +60,10 @@ |
|
|
watch: {
|
|
|
data() {
|
|
|
this.filters.productSku.model = null;
|
|
|
this.filters.productSkn.model = null;
|
|
|
this.filters.factoryCode.model = null;
|
|
|
this.filters.upmCode.model = null;
|
|
|
|
|
|
// this.filters.upmCode.model = null;
|
|
|
|
|
|
this.pageData.current = 1;
|
|
|
}
|
...
|
...
|
@@ -68,8 +78,11 @@ |
|
|
},
|
|
|
clearFilters() {
|
|
|
this.filters.productSku.model = null;
|
|
|
this.filters.productSkn.model = null;
|
|
|
this.filters.factoryCode.model = null;
|
|
|
this.filters.upmCode.model = null;
|
|
|
|
|
|
// this.filters.upmCode.model = null;
|
|
|
this.$route.query.productSkn = null;
|
|
|
|
|
|
this.pageData.current = 1;
|
|
|
this.tableData = [];
|
...
|
...
|
@@ -82,8 +95,10 @@ |
|
|
filtersParams() {
|
|
|
let params = {};
|
|
|
let productSku = this.filters.productSku.model || null;
|
|
|
let productSkn = this.filters.productSkn.model || null;
|
|
|
let factoryCode = this.filters.factoryCode.model || null;
|
|
|
let upmCode = this.filters.upmCode.model || null;
|
|
|
|
|
|
// let upmCode = this.filters.upmCode.model || null;
|
|
|
|
|
|
let pageNo = this.pageData.current;
|
|
|
let pageSize = this.pageData.pageSize;
|
...
|
...
|
@@ -96,13 +111,29 @@ |
|
|
}
|
|
|
}
|
|
|
|
|
|
if (this.filters.productSkn.model) {
|
|
|
if (this.isNumber(this.filters.productSkn.model)) {
|
|
|
params.productSkn = this.filters.productSkn.model;
|
|
|
} else {
|
|
|
return Promise.reject('skn必须是数字');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (this.$route.query.productSkn && !productSkn) {
|
|
|
productSkn = this.$route.query.productSkn;
|
|
|
params.productSkn = productSkn;
|
|
|
} else {
|
|
|
productSkn = this.filters.productSkn.model;
|
|
|
}
|
|
|
params.pageSize = this.pageData.pageSize;
|
|
|
params.pageNo = this.pageData.current;
|
|
|
|
|
|
return Promise.resolve({
|
|
|
productSku,
|
|
|
productSkn,
|
|
|
factoryCode,
|
|
|
upmCode,
|
|
|
|
|
|
// upmCode,
|
|
|
pageNo,
|
|
|
pageSize
|
|
|
});
|
...
|
...
|
@@ -113,7 +144,7 @@ |
|
|
},
|
|
|
getInventory() {
|
|
|
return this.filtersParams().then((params) => {
|
|
|
if (params.productSku || params.factoryCode || params.upmCode) {
|
|
|
if (params.productSku || params.productSkn || params.factoryCode || params.upmCode) {
|
|
|
this.noFilteredDataText = '暂无数据';
|
|
|
this.$Loading.start();
|
|
|
return this.inventoryService.list(params).then((result) => {
|
...
|
...
|
@@ -144,8 +175,10 @@ |
|
|
exportList() {
|
|
|
const keysMap = {
|
|
|
productSku: 'productSku',
|
|
|
productSkn: 'productSkn',
|
|
|
factoryCode: 'factoryCode',
|
|
|
upmCode: 'upmCode',
|
|
|
|
|
|
// upmCode: 'upmCode',
|
|
|
|
|
|
};
|
|
|
const fields = this.filters;
|
...
|
...
|
|