|
@@ -9,10 +9,6 @@ |
|
@@ -9,10 +9,6 @@ |
9
|
<Input v-model.trim="filters.prodCode.model"
|
9
|
<Input v-model.trim="filters.prodCode.model"
|
10
|
:placeholder="filters.prodCode.holder"></Input>
|
10
|
:placeholder="filters.prodCode.holder"></Input>
|
11
|
</FilterItem>
|
11
|
</FilterItem>
|
12
|
- <FilterItem :label="filters.prodCode.label">
|
|
|
13
|
- <Input v-model.trim="filters.prodCode.model"
|
|
|
14
|
- :placeholder="filters.prodCode.holder"></Input>
|
|
|
15
|
- </FilterItem>
|
|
|
16
|
<FilterItem :label="filters.prodName.label">
|
12
|
<FilterItem :label="filters.prodName.label">
|
17
|
<Input v-model.trim="filters.prodName.model"
|
13
|
<Input v-model.trim="filters.prodName.model"
|
18
|
:placeholder="filters.prodName.holder"></Input>
|
14
|
:placeholder="filters.prodName.holder"></Input>
|
|
@@ -21,6 +17,11 @@ |
|
@@ -21,6 +17,11 @@ |
21
|
<Input v-model.trim="filters.prodBarCode.model"
|
17
|
<Input v-model.trim="filters.prodBarCode.model"
|
22
|
:placeholder="filters.prodBarCode.holder"></Input>
|
18
|
:placeholder="filters.prodBarCode.holder"></Input>
|
23
|
</FilterItem>
|
19
|
</FilterItem>
|
|
|
20
|
+
|
|
|
21
|
+ <FilterItem label="选择类目">
|
|
|
22
|
+ <SelectCategory :value="categoryValue" @select-change="sortChange"></SelectCategory>
|
|
|
23
|
+ </FilterItem>
|
|
|
24
|
+
|
24
|
<FilterItem label="选择品牌">
|
25
|
<FilterItem label="选择品牌">
|
25
|
<SelectBrand @on-change="brandChange"
|
26
|
<SelectBrand @on-change="brandChange"
|
26
|
:field-label="filters.brand.label"
|
27
|
:field-label="filters.brand.label"
|
|
@@ -30,13 +31,6 @@ |
|
@@ -30,13 +31,6 @@ |
30
|
:option-list="filters.brand.options">
|
31
|
:option-list="filters.brand.options">
|
31
|
</SelectBrand>
|
32
|
</SelectBrand>
|
32
|
</FilterItem>
|
33
|
</FilterItem>
|
33
|
- <FilterItem :label="filters.verifyStatus.label">
|
|
|
34
|
- <Select v-model.trim="filters.verifyStatus.model">
|
|
|
35
|
- <Option v-for="option in filters.verifyStatus.options"
|
|
|
36
|
- :value="option.value"
|
|
|
37
|
- :key="option.value">{{option.label}}</Option>
|
|
|
38
|
- </Select>
|
|
|
39
|
- </FilterItem>
|
|
|
40
|
<FilterItem :label="filters.stockStatus.label">
|
34
|
<FilterItem :label="filters.stockStatus.label">
|
41
|
<Select v-model.trim="filters.stockStatus.model">
|
35
|
<Select v-model.trim="filters.stockStatus.model">
|
42
|
<Option v-for="option in filters.stockStatus.options"
|
36
|
<Option v-for="option in filters.stockStatus.options"
|
|
@@ -44,59 +38,49 @@ |
|
@@ -44,59 +38,49 @@ |
44
|
:key="option.value">{{option.label}}</Option>
|
38
|
:key="option.value">{{option.label}}</Option>
|
45
|
</Select>
|
39
|
</Select>
|
46
|
</FilterItem>
|
40
|
</FilterItem>
|
47
|
- <FilterItem label="选择类目">
|
|
|
48
|
- <SelectCategory :value="categoryValue" @select-change="sortChange"></SelectCategory>
|
|
|
49
|
- </FilterItem>
|
|
|
50
|
<FilterItem>
|
41
|
<FilterItem>
|
51
|
<Button type="primary" @click="filterSearch">筛选</Button>
|
42
|
<Button type="primary" @click="filterSearch">筛选</Button>
|
52
|
<Button @click="clearFilter">清空条件</Button>
|
43
|
<Button @click="clearFilter">清空条件</Button>
|
53
|
</FilterItem>
|
44
|
</FilterItem>
|
54
|
</LayoutFilter>
|
45
|
</LayoutFilter>
|
55
|
|
46
|
|
56
|
- <LayoutAction>
|
|
|
57
|
- <Button type="error" @click="batchSetOffSale">下架</Button>
|
|
|
58
|
- </LayoutAction>
|
|
|
59
|
-
|
|
|
60
|
<LayoutList>
|
47
|
<LayoutList>
|
61
|
<Table border :context="self" :columns="tableCols" :data="tableData" @on-selection-change="selectChange"></Table>
|
48
|
<Table border :context="self" :columns="tableCols" :data="tableData" @on-selection-change="selectChange"></Table>
|
62
|
<Page :total="pageData.total" :current="pageData.current"
|
49
|
<Page :total="pageData.total" :current="pageData.current"
|
63
|
@on-change="pageChange" :page-size="20" show-total></Page>
|
50
|
@on-change="pageChange" :page-size="20" show-total></Page>
|
64
|
</LayoutList>
|
51
|
</LayoutList>
|
65
|
|
52
|
|
66
|
- <SizeEdit ref="showSizeEdit" :show="showSizeEdit"></SizeEdit>
|
53
|
+ <EditStore ref="showStoreEdit"></EditStore>
|
67
|
</LayoutBody>
|
54
|
</LayoutBody>
|
68
|
</template>
|
55
|
</template>
|
69
|
|
56
|
|
70
|
<script>
|
57
|
<script>
|
71
|
- import Vue from 'vue';
|
|
|
72
|
import _ from 'lodash';
|
58
|
import _ from 'lodash';
|
73
|
- import service from 'product-service';
|
|
|
74
|
- import {SizeEdit} from 'product/size-edit';
|
59
|
+ import service from 'jit-service';
|
75
|
import {SelectBrand, SelectCategory} from 'product/filter-select';
|
60
|
import {SelectBrand, SelectCategory} from 'product/filter-select';
|
76
|
- import {CellImage, CellInfo, CellPrice} from 'product/table-cell';
|
61
|
+ import {CellImage, CellInfo} from 'product/table-cell';
|
|
|
62
|
+ import EditStore from './views/edit-store';
|
77
|
import {filterFields, initialFields, tableCols, tableData, pageData} from './store';
|
63
|
import {filterFields, initialFields, tableCols, tableData, pageData} from './store';
|
78
|
|
64
|
|
79
|
export default {
|
65
|
export default {
|
80
|
data() {
|
66
|
data() {
|
81
|
return {
|
67
|
return {
|
82
|
self: this,
|
68
|
self: this,
|
83
|
- showSizeEdit: false,
|
|
|
84
|
tableCols,
|
69
|
tableCols,
|
85
|
tableData,
|
70
|
tableData,
|
86
|
pageData,
|
71
|
pageData,
|
87
|
filters: '',
|
72
|
filters: '',
|
88
|
batchOffSale: [],
|
73
|
batchOffSale: [],
|
89
|
useFilterSign: false,
|
74
|
useFilterSign: false,
|
90
|
- categoryValue: []
|
75
|
+ categoryValue: [],
|
91
|
}
|
76
|
}
|
92
|
},
|
77
|
},
|
93
|
created() {
|
78
|
created() {
|
94
|
- this.productList();
|
|
|
95
|
this.filters = JSON.parse(initialFields);
|
79
|
this.filters = JSON.parse(initialFields);
|
96
|
},
|
80
|
},
|
97
|
methods: {
|
81
|
methods: {
|
98
|
- editSize(skn) {
|
|
|
99
|
- this.$refs.showSizeEdit.show(skn);
|
82
|
+ editStore(skn) {
|
|
|
83
|
+ this.$refs.showStoreEdit.show(skn);
|
100
|
},
|
84
|
},
|
101
|
filterParams() {
|
85
|
filterParams() {
|
102
|
const fts = this.filters;
|
86
|
const fts = this.filters;
|
|
@@ -109,7 +93,6 @@ |
|
@@ -109,7 +93,6 @@ |
109
|
middleSortId: fts.sort.second.model,
|
93
|
middleSortId: fts.sort.second.model,
|
110
|
smallSortId: fts.sort.third.model,
|
94
|
smallSortId: fts.sort.third.model,
|
111
|
brandId: fts.brand.model != -1 ? fts.brand.model : null,
|
95
|
brandId: fts.brand.model != -1 ? fts.brand.model : null,
|
112
|
- auditStatus: fts.verifyStatus.model != -1 ? fts.verifyStatus.model : null,
|
|
|
113
|
stock: fts.stockStatus.model != -1 ? this.filters.stockStatus.model : null
|
96
|
stock: fts.stockStatus.model != -1 ? this.filters.stockStatus.model : null
|
114
|
};
|
97
|
};
|
115
|
|
98
|
|
|
@@ -119,37 +102,15 @@ |
|
@@ -119,37 +102,15 @@ |
119
|
const params = this.filterParams();
|
102
|
const params = this.filterParams();
|
120
|
|
103
|
|
121
|
this.useFilterSign = true;
|
104
|
this.useFilterSign = true;
|
122
|
- this.productList(params);
|
|
|
123
|
this.pageData.current = 1;
|
105
|
this.pageData.current = 1;
|
124
|
|
106
|
|
125
|
},
|
107
|
},
|
126
|
clearFilter() {
|
108
|
clearFilter() {
|
127
|
this.filters = JSON.parse(initialFields);
|
109
|
this.filters = JSON.parse(initialFields);
|
128
|
- this.productList();
|
|
|
129
|
this.useFilterSign = false;
|
110
|
this.useFilterSign = false;
|
130
|
this.pageData.current = 1;
|
111
|
this.pageData.current = 1;
|
131
|
this.categoryValue = [];
|
112
|
this.categoryValue = [];
|
132
|
},
|
113
|
},
|
133
|
- productList(params) {
|
|
|
134
|
-
|
|
|
135
|
- if(_.isObject(params) &&
|
|
|
136
|
- params.productSkn !== undefined &&
|
|
|
137
|
- !_.isFinite(+params.productSkn)) {
|
|
|
138
|
- this.$Message.error('SKN编码只能是数字', 3);
|
|
|
139
|
- return;
|
|
|
140
|
- };
|
|
|
141
|
-
|
|
|
142
|
- service.productList(
|
|
|
143
|
- _.merge(params || {}, {
|
|
|
144
|
- shelfStatus: 1,
|
|
|
145
|
- size: 20
|
|
|
146
|
- }))
|
|
|
147
|
- .then(res => {
|
|
|
148
|
- if(res.code === 200) {
|
|
|
149
|
- this.updateStore(res.data);
|
|
|
150
|
- }
|
|
|
151
|
- });
|
|
|
152
|
- },
|
|
|
153
|
reloadList() {
|
114
|
reloadList() {
|
154
|
let params = {};
|
115
|
let params = {};
|
155
|
|
116
|
|
|
@@ -163,7 +124,6 @@ |
|
@@ -163,7 +124,6 @@ |
163
|
productStatusStr: 1
|
124
|
productStatusStr: 1
|
164
|
});
|
125
|
});
|
165
|
|
126
|
|
166
|
- this.productList(params);
|
|
|
167
|
this.pageData.current = 1;
|
127
|
this.pageData.current = 1;
|
168
|
},
|
128
|
},
|
169
|
updateStore(data) {
|
129
|
updateStore(data) {
|
|
@@ -197,71 +157,6 @@ |
|
@@ -197,71 +157,6 @@ |
197
|
size: 20,
|
157
|
size: 20,
|
198
|
productStatusStr: 1
|
158
|
productStatusStr: 1
|
199
|
});
|
159
|
});
|
200
|
-
|
|
|
201
|
- this.productList(params);
|
|
|
202
|
- },
|
|
|
203
|
- setOffSale(skns) {
|
|
|
204
|
- const params = {
|
|
|
205
|
- targetStatus: 0
|
|
|
206
|
- };
|
|
|
207
|
-
|
|
|
208
|
- if(_.isArray(skns)) {
|
|
|
209
|
- params['productSkns'] = `[${skns.join(',')}]`;
|
|
|
210
|
- } else {
|
|
|
211
|
- params['productSkns'] = `[${skns}]`
|
|
|
212
|
- }
|
|
|
213
|
-
|
|
|
214
|
- service.setOffSale(params)
|
|
|
215
|
- .then(res => {
|
|
|
216
|
- this.$Message.success(res.data.message);
|
|
|
217
|
- this.reloadList();
|
|
|
218
|
- });
|
|
|
219
|
- },
|
|
|
220
|
- batchSetOffSale() {
|
|
|
221
|
- if(!this.batchOffSale.length) {
|
|
|
222
|
- return this.$Message.error('请选择要下架的商品');
|
|
|
223
|
- }
|
|
|
224
|
-
|
|
|
225
|
- let skns = [];
|
|
|
226
|
-
|
|
|
227
|
- _.each(this.batchOffSale, (item) => {
|
|
|
228
|
- skns.push(item.productSkn);
|
|
|
229
|
- });
|
|
|
230
|
-
|
|
|
231
|
- this.setOffSale(skns);
|
|
|
232
|
- },
|
|
|
233
|
- editPrice(row) {
|
|
|
234
|
- row.changePrice = true;
|
|
|
235
|
- },
|
|
|
236
|
- updatePrice(row, newSalesPrice) {
|
|
|
237
|
- const index = row.lineIndex;
|
|
|
238
|
- const salesPrice = newSalesPrice;
|
|
|
239
|
- const productSkn = row.productSkn;
|
|
|
240
|
-
|
|
|
241
|
- if(newSalesPrice === row.salesPrice) {
|
|
|
242
|
- row.changePrice = false;
|
|
|
243
|
- return;
|
|
|
244
|
- }
|
|
|
245
|
-
|
|
|
246
|
- const params = {
|
|
|
247
|
- salesPrice,
|
|
|
248
|
- productSkn
|
|
|
249
|
- };
|
|
|
250
|
-
|
|
|
251
|
- service.updateSalesPrice(params)
|
|
|
252
|
- .then(res => {
|
|
|
253
|
- this.tableData[index].salesPrice = salesPrice;
|
|
|
254
|
- row.changePrice = false;
|
|
|
255
|
- this.$Message.success(res.data.message);
|
|
|
256
|
- });
|
|
|
257
|
- },
|
|
|
258
|
- editProduct(skn) {
|
|
|
259
|
- this.$router.push({
|
|
|
260
|
- name: 'product.edit',
|
|
|
261
|
- params: {
|
|
|
262
|
- id: skn
|
|
|
263
|
- }
|
|
|
264
|
- });
|
|
|
265
|
},
|
160
|
},
|
266
|
selectChange(selection) {
|
161
|
selectChange(selection) {
|
267
|
this.batchOffSale = selection;
|
162
|
this.batchOffSale = selection;
|
|
@@ -270,10 +165,9 @@ |
|
@@ -270,10 +165,9 @@ |
270
|
components: {
|
165
|
components: {
|
271
|
SelectBrand,
|
166
|
SelectBrand,
|
272
|
SelectCategory,
|
167
|
SelectCategory,
|
273
|
- SizeEdit,
|
|
|
274
|
CellImage,
|
168
|
CellImage,
|
275
|
CellInfo,
|
169
|
CellInfo,
|
276
|
- CellPrice
|
170
|
+ EditStore
|
277
|
}
|
171
|
}
|
278
|
}
|
172
|
}
|
279
|
</script>
|
173
|
</script>
|