Authored by 李奇

未上架商品修改

@@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
58 <label class="field-label">{{filters.verifyStatus.label}}:</label> 58 <label class="field-label">{{filters.verifyStatus.label}}:</label>
59 </Col> 59 </Col>
60 <Col :span="filters.verifyStatus.fieldSpan"> 60 <Col :span="filters.verifyStatus.fieldSpan">
61 - <Select v-model="filters.verifyStatus.model"> 61 + <Select v-model="filters.verifyStatus.model" clearable>
62 <Option v-for="option in filters.verifyStatus.options" :value="option.value" :key="option.value">{{option.label}}</Option> 62 <Option v-for="option in filters.verifyStatus.options" :value="option.value" :key="option.value">{{option.label}}</Option>
63 </Select> 63 </Select>
64 </Col> 64 </Col>
@@ -70,12 +70,24 @@ @@ -70,12 +70,24 @@
70 <label class="field-label">{{filters.stockStatus.label}}:</label> 70 <label class="field-label">{{filters.stockStatus.label}}:</label>
71 </Col> 71 </Col>
72 <Col :span="filters.stockStatus.fieldSpan"> 72 <Col :span="filters.stockStatus.fieldSpan">
73 - <Select v-model="filters.stockStatus.model"> 73 + <Select v-model="filters.stockStatus.model" clearable>
74 <Option v-for="option in filters.stockStatus.options" :value="option.value" :key="option.value">{{option.label}}</Option> 74 <Option v-for="option in filters.stockStatus.options" :value="option.value" :key="option.value">{{option.label}}</Option>
75 </Select> 75 </Select>
76 </Col> 76 </Col>
77 </Row> 77 </Row>
78 </Col> 78 </Col>
  79 + <Col span="6">
  80 + <Row>
  81 + <Col :span="filters.publishStatus.labelSpan">
  82 + <label class="field-label">{{filters.publishStatus.label}}:</label>
  83 + </Col>
  84 + <Col :span="filters.publishStatus.fieldSpan">
  85 + <Select v-model="filters.publishStatus.model" clearable>
  86 + <Option v-for="option in filters.publishStatus.options" :value="option.value" :key="option.value">{{option.label}}</Option>
  87 + </Select>
  88 + </Col>
  89 + </Row>
  90 + </Col>
79 </Row> 91 </Row>
80 <div class="filter-row"> 92 <div class="filter-row">
81 <Category :field-sort="filters.sort" @on-change="sortChange"></Category> 93 <Category :field-sort="filters.sort" @on-change="sortChange"></Category>
@@ -86,7 +98,7 @@ @@ -86,7 +98,7 @@
86 </Row> 98 </Row>
87 <div class="hr"></div> 99 <div class="hr"></div>
88 <div class="batch-row"> 100 <div class="batch-row">
89 - <Button type="success" @click="batchSetOffSale">上架</Button> 101 + <Button type="success" @click="batchSetOnSale">上架</Button>
90 </div> 102 </div>
91 <Table border :columns="tableCols" :data="tableData" @on-selection-change="selectChange"></Table> 103 <Table border :columns="tableCols" :data="tableData" @on-selection-change="selectChange"></Table>
92 <div class="list-page"> 104 <div class="list-page">
@@ -120,27 +132,33 @@ @@ -120,27 +132,33 @@
120 this.initialFilters = JSON.stringify(filterFields); 132 this.initialFilters = JSON.stringify(filterFields);
121 }, 133 },
122 methods: { 134 methods: {
123 - filterSearch() {  
124 - const params = {  
125 - productSkn: this.filters.sknCode.model,  
126 - factoryCode: this.filters.prodCode.model,  
127 - productName: this.filters.prodName.model,  
128 - skuFactoryCode: this.filters.prodBarCode.model,  
129 - maxSortId: this.filters.sort.first.model,  
130 - middleSortId: this.filters.sort.second.model,  
131 - smallSortId: this.filters.sort.third.model,  
132 - brandId: this.filters.brand.model,  
133 - auditStatus: this.filters.verifyStatus.model,  
134 - stock: this.filters.stockStatus.model != -1 ? this.filters.stockStatus.model : null 135 + filterParams() {
  136 + const fts = this.filters;
  137 + const data = {
  138 + productSkn: fts.sknCode.model,
  139 + factoryCode: fts.prodCode.model,
  140 + skuFactoryCode: fts.prodBarCode.model,
  141 + maxSortId: fts.sort.first.model,
  142 + middleSortId: fts.sort.second.model,
  143 + smallSortId: fts.sort.third.model,
  144 + isPublished: fts.publishStatus.model,
  145 + brandId: fts.brand.model != -1 ? fts.brand.model : null,
  146 + auditStatus: fts.verifyStatus.model != -1 ? fts.verifyStatus.model : null,
  147 + stock: fts.stockStatus.model != -1 ? this.filters.stockStatus.model : null
135 }; 148 };
136 149
  150 + return data;
  151 + },
  152 + filterSearch() {
  153 + const params = this.filterParams();
  154 +
137 this.useFilterSign = true; 155 this.useFilterSign = true;
138 this.productList(params); 156 this.productList(params);
139 }, 157 },
140 clearFilter() { 158 clearFilter() {
  159 + this.filters = JSON.parse(this.initialFilters);
141 this.productList(); 160 this.productList();
142 this.useFilterSign = false; 161 this.useFilterSign = false;
143 - this.filters = JSON.parse(this.initialFilters);  
144 }, 162 },
145 productList(params) { 163 productList(params) {
146 service.productList( 164 service.productList(
@@ -166,25 +184,31 @@ @@ -166,25 +184,31 @@
166 this.pageData.current = 1; 184 this.pageData.current = 1;
167 }, 185 },
168 sortChange(sort) { 186 sortChange(sort) {
169 - this.filters.sort.first.model = sort.first || null;  
170 - this.filters.sort.second.model = sort.second || null;  
171 - this.filters.sort.third.model = sort.third || null; 187 + this.filters.sort.first.model = sort.first;
  188 + this.filters.sort.second.model = sort.second;
  189 + this.filters.sort.third.model = sort.third;
172 }, 190 },
173 brandChange(val) { 191 brandChange(val) {
174 _.set(this.filters, 'brand.model', val); 192 _.set(this.filters, 'brand.model', val);
175 }, 193 },
176 pageChange(page) { 194 pageChange(page) {
177 - let params = { 195 + let params = {};
  196 +
  197 + if(this.useFilterSign) {
  198 + params = this.filterParams();
  199 + }
  200 +
  201 + _.merge(params, {
178 page, 202 page,
179 size: 20, 203 size: 20,
180 productStatusStr: 1 204 productStatusStr: 1
181 - }; 205 + });
182 206
183 this.productList(params); 207 this.productList(params);
184 }, 208 },
185 - setOffSale(skns) { 209 + setOnSale(skns) {
186 const params = { 210 const params = {
187 - targetStatus: 0 211 + targetStatus: 1
188 }; 212 };
189 213
190 if(_.isArray(skns)) { 214 if(_.isArray(skns)) {
@@ -193,13 +217,13 @@ @@ -193,13 +217,13 @@
193 params['productSkns'] = `[${skns}]` 217 params['productSkns'] = `[${skns}]`
194 } 218 }
195 219
196 - service.setOffSale(params) 220 + service.setOnSale(params)
197 .then(res => { 221 .then(res => {
198 this.$Message.success(res.data.message); 222 this.$Message.success(res.data.message);
199 }); 223 });
200 }, 224 },
201 225
202 - batchSetOffSale() { 226 + batchSetOnSale() {
203 if(!this.batchOffSale.length) { 227 if(!this.batchOffSale.length) {
204 return this.$Message.error('请选择要上架的商品'); 228 return this.$Message.error('请选择要上架的商品');
205 } 229 }
@@ -210,7 +234,7 @@ @@ -210,7 +234,7 @@
210 skns.push(item.productSkn); 234 skns.push(item.productSkn);
211 }); 235 });
212 236
213 - this.setOffSale(skns); 237 + this.setOnSale(skns);
214 }, 238 },
215 changePrice(row) { 239 changePrice(row) {
216 row.changePrice = true; 240 row.changePrice = true;
@@ -252,7 +276,7 @@ @@ -252,7 +276,7 @@
252 } 276 }
253 </script> 277 </script>
254 278
255 -<style lang="scss" scoped> 279 +<style lang="scss">
256 .filter-row { 280 .filter-row {
257 margin-bottom: 20px; 281 margin-bottom: 20px;
258 282
@@ -274,4 +298,12 @@ @@ -274,4 +298,12 @@
274 float: right; 298 float: right;
275 margin-top: 20px; 299 margin-top: 20px;
276 } 300 }
  301 +
  302 + .prd-img {
  303 + max-height: 200px;
  304 + }
  305 +
  306 + .action-btn-row {
  307 + margin-top: 10px;
  308 + }
277 </style> 309 </style>
@@ -68,14 +68,14 @@ let filterFields = { @@ -68,14 +68,14 @@ let filterFields = {
68 label: '选择品牌', 68 label: '选择品牌',
69 labelSpan: 6, 69 labelSpan: 6,
70 fieldSpan: 18, 70 fieldSpan: 18,
71 - model: '' 71 + model: -1
72 }, 72 },
73 73
74 verifyStatus: { 74 verifyStatus: {
75 label: '审核状态', 75 label: '审核状态',
76 labelSpan: 6, 76 labelSpan: 6,
77 fieldSpan: 18, 77 fieldSpan: 18,
78 - model: '', 78 + model: -1,
79 options: [ 79 options: [
80 { 80 {
81 value: -1, 81 value: -1,
@@ -83,11 +83,11 @@ let filterFields = { @@ -83,11 +83,11 @@ let filterFields = {
83 }, 83 },
84 { 84 {
85 value: 1, 85 value: 1,
86 - label: '架待审核' 86 + label: '架待审核'
87 }, 87 },
88 { 88 {
89 value: 2, 89 value: 2,
90 - label: '架驳回' 90 + label: '架驳回'
91 } 91 }
92 ] 92 ]
93 }, 93 },
@@ -111,6 +111,27 @@ let filterFields = { @@ -111,6 +111,27 @@ let filterFields = {
111 label: '无库存' 111 label: '无库存'
112 } 112 }
113 ] 113 ]
  114 + },
  115 +
  116 + publishStatus: {
  117 + label: '商品状态',
  118 + labelSpan: 6,
  119 + fieldSpan: 18,
  120 + model: -1,
  121 + options: [
  122 + {
  123 + value: -1,
  124 + label: '全部'
  125 + },
  126 + {
  127 + value: 0,
  128 + label: '从未发布'
  129 + },
  130 + {
  131 + value: 1,
  132 + label: '我下架的'
  133 + }
  134 + ]
114 } 135 }
115 }; 136 };
116 137
@@ -127,7 +148,7 @@ let tableCols = [ @@ -127,7 +148,7 @@ let tableCols = [
127 key: 'image', 148 key: 'image',
128 align: 'center', 149 align: 'center',
129 render (row, column, index) { 150 render (row, column, index) {
130 - return `<img src="${row.picImgUrl}">`; 151 + return `<img class="prd-img" src="${row.picImgUrl}">`;
131 } 152 }
132 }, 153 },
133 { 154 {
@@ -164,7 +185,7 @@ let tableCols = [ @@ -164,7 +185,7 @@ let tableCols = [
164 }, 185 },
165 { 186 {
166 title: '下架时间', 187 title: '下架时间',
167 - key: 'shelveTime', 188 + key: 'offshelveTime',
168 align: 'center' 189 align: 'center'
169 }, 190 },
170 { 191 {
@@ -180,11 +201,11 @@ let tableCols = [ @@ -180,11 +201,11 @@ let tableCols = [
180 key: 'action', 201 key: 'action',
181 align: 'center', 202 align: 'center',
182 render: function(row, column, index) { 203 render: function(row, column, index) {
183 - return `<div class=""> 204 + return `<div class="action-btn-row">
184 <i-button type="primary" size="small">尺码维护</i-button> 205 <i-button type="primary" size="small">尺码维护</i-button>
185 <i-button type="primary" size="small" @click="editProduct(${row.productSkn})">内容编辑</i-button> 206 <i-button type="primary" size="small" @click="editProduct(${row.productSkn})">内容编辑</i-button>
186 </div> 207 </div>
187 - <i-button type="success" size="small" @click="setOffSale(${row.productSkn})">上架</i-button>`; 208 + <div class="action-btn-row"><i-button type="success" size="small" @click="setOnSale(${row.productSkn})">上架</i-button></div>`;
188 } 209 }
189 } 210 }
190 ]; 211 ];
@@ -13,6 +13,7 @@ let domainApis = { @@ -13,6 +13,7 @@ let domainApis = {
13 querySortSize: '/SellerSortSizeController/querySortSize', 13 querySortSize: '/SellerSortSizeController/querySortSize',
14 querySellerProductList: '/SellerProductController/querySellerProductList', 14 querySellerProductList: '/SellerProductController/querySellerProductList',
15 productOutSale: '/SellerSknStatusController/productOutSale', 15 productOutSale: '/SellerSknStatusController/productOutSale',
  16 + productOnSale: '/SellerSknStatusController/productOnSale',
16 querySellerProductMaterial: '/SellerProductController/querySellerProductMaterial', 17 querySellerProductMaterial: '/SellerProductController/querySellerProductMaterial',
17 addProduct: '/SellerProductController/addProduct', 18 addProduct: '/SellerProductController/addProduct',
18 getSellerAllSortInfo: '/SellerProductController/getSellerAllSortInfo', 19 getSellerAllSortInfo: '/SellerProductController/getSellerAllSortInfo',