Authored by 李奇

vip价格管理页面修改

@@ -5,9 +5,9 @@ @@ -5,9 +5,9 @@
5 */ 5 */
6 const auditStatus = { 6 const auditStatus = {
7 0: '无状态', 7 0: '无状态',
8 - 1: '下架待审核',  
9 - 2: '下架驳回',  
10 - 3: '已上架' 8 + 1: '上架待审核',
  9 + 2: '上架驳回',
  10 + 3: '已下架'
11 }; 11 };
12 12
13 let filterFields = { 13 let filterFields = {
@@ -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 {
@@ -149,12 +170,7 @@ let tableCols = [ @@ -149,12 +170,7 @@ let tableCols = [
149 render(row, column, index) { 170 render(row, column, index) {
150 row.lineIndex = index; 171 row.lineIndex = index;
151 return `<p>吊牌价:${row.retailPrice}</p> 172 return `<p>吊牌价:${row.retailPrice}</p>
152 - <p v-if="!row.changePrice">销售价:${row.salesPrice}  
153 - <i-button type="info" size="small" @click="changePrice(row)"></i-button>  
154 - </p>  
155 - <p v-else>销售价:<Input v-model="row.salesPrice" size="4"></Input>  
156 - <i-button type="warning" size="small" @click="updatePrice(row)"></i-button>  
157 - </p>`; 173 + <p v-if="!row.changePrice">销售价:${row.salesPrice}</p>`;
158 } 174 }
159 }, 175 },
160 { 176 {
@@ -163,8 +179,8 @@ let tableCols = [ @@ -163,8 +179,8 @@ let tableCols = [
163 align: 'center', 179 align: 'center',
164 }, 180 },
165 { 181 {
166 - title: '上架时间',  
167 - key: 'shelveTime', 182 + title: '下架时间',
  183 + key: 'offshelveTime',
168 align: 'center' 184 align: 'center'
169 }, 185 },
170 { 186 {
@@ -180,11 +196,7 @@ let tableCols = [ @@ -180,11 +196,7 @@ let tableCols = [
180 key: 'action', 196 key: 'action',
181 align: 'center', 197 align: 'center',
182 render: function(row, column, index) { 198 render: function(row, column, index) {
183 - return `<div class="">  
184 - <i-button type="primary" size="small">尺码维护</i-button>  
185 - <i-button type="primary" size="small" @click="editProduct(${row.productSkn})">内容编辑</i-button>  
186 - </div>  
187 - <i-button type="error" size="small" @click="setOffSale(${row.productSkn})">下架</i-button>`; 199 + return `<div class="action-btn-row"><i-button type="primary" size="small" @click="setOnSale(${row.productSkn})">启用</i-button></div>`;
188 } 200 }
189 } 201 }
190 ]; 202 ];
@@ -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,8 @@ @@ -86,7 +98,8 @@
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="error" @click="batchSetOffSale">下架</Button> 101 + <Button type="primary" @click="batchSetOnSale">启用</Button>
  102 + <Button type="error" @click="batchSetOnSale">禁用</Button>
90 </div> 103 </div>
91 <Table border :columns="tableCols" :data="tableData" @on-selection-change="selectChange"></Table> 104 <Table border :columns="tableCols" :data="tableData" @on-selection-change="selectChange"></Table>
92 <div class="list-page"> 105 <div class="list-page">
@@ -104,7 +117,6 @@ @@ -104,7 +117,6 @@
104 import {filterFields, initialFields, tableCols, tableData, pageData} from './store'; 117 import {filterFields, initialFields, tableCols, tableData, pageData} from './store';
105 118
106 export default { 119 export default {
107 - name: 'vips',  
108 data() { 120 data() {
109 return { 121 return {
110 tableCols, 122 tableCols,
@@ -121,32 +133,38 @@ @@ -121,32 +133,38 @@
121 this.initialFilters = JSON.stringify(filterFields); 133 this.initialFilters = JSON.stringify(filterFields);
122 }, 134 },
123 methods: { 135 methods: {
124 - filterSearch() {  
125 - const params = {  
126 - productSkn: this.filters.sknCode.model,  
127 - factoryCode: this.filters.prodCode.model,  
128 - productName: this.filters.prodName.model,  
129 - skuFactoryCode: this.filters.prodBarCode.model,  
130 - maxSortId: this.filters.sort.first.model,  
131 - middleSortId: this.filters.sort.second.model,  
132 - smallSortId: this.filters.sort.third.model,  
133 - brandId: this.filters.brand.model,  
134 - auditStatus: this.filters.verifyStatus.model,  
135 - stock: this.filters.stockStatus.model != -1 ? this.filters.stockStatus.model : null 136 + filterParams() {
  137 + const fts = this.filters;
  138 + const data = {
  139 + productSkn: fts.sknCode.model,
  140 + factoryCode: fts.prodCode.model,
  141 + skuFactoryCode: fts.prodBarCode.model,
  142 + maxSortId: fts.sort.first.model,
  143 + middleSortId: fts.sort.second.model,
  144 + smallSortId: fts.sort.third.model,
  145 + isPublished: fts.publishStatus.model,
  146 + brandId: fts.brand.model != -1 ? fts.brand.model : null,
  147 + auditStatus: fts.verifyStatus.model != -1 ? fts.verifyStatus.model : null,
  148 + stock: fts.stockStatus.model != -1 ? this.filters.stockStatus.model : null
136 }; 149 };
137 150
  151 + return data;
  152 + },
  153 + filterSearch() {
  154 + const params = this.filterParams();
  155 +
138 this.useFilterSign = true; 156 this.useFilterSign = true;
139 this.productList(params); 157 this.productList(params);
140 }, 158 },
141 clearFilter() { 159 clearFilter() {
  160 + this.filters = JSON.parse(this.initialFilters);
142 this.productList(); 161 this.productList();
143 this.useFilterSign = false; 162 this.useFilterSign = false;
144 - this.filters = JSON.parse(this.initialFilters);  
145 }, 163 },
146 productList(params) { 164 productList(params) {
147 service.productList( 165 service.productList(
148 _.merge(params || {}, { 166 _.merge(params || {}, {
149 - shelfStatus: 1, 167 + shelfStatus: 0,
150 size: 20 168 size: 20
151 })) 169 }))
152 .then(res => { 170 .then(res => {
@@ -167,25 +185,31 @@ @@ -167,25 +185,31 @@
167 this.pageData.current = 1; 185 this.pageData.current = 1;
168 }, 186 },
169 sortChange(sort) { 187 sortChange(sort) {
170 - this.filters.sort.first.model = sort.first || null;  
171 - this.filters.sort.second.model = sort.second || null;  
172 - this.filters.sort.third.model = sort.third || null; 188 + this.filters.sort.first.model = sort.first;
  189 + this.filters.sort.second.model = sort.second;
  190 + this.filters.sort.third.model = sort.third;
173 }, 191 },
174 brandChange(val) { 192 brandChange(val) {
175 _.set(this.filters, 'brand.model', val); 193 _.set(this.filters, 'brand.model', val);
176 }, 194 },
177 pageChange(page) { 195 pageChange(page) {
178 - let params = { 196 + let params = {};
  197 +
  198 + if(this.useFilterSign) {
  199 + params = this.filterParams();
  200 + }
  201 +
  202 + _.merge(params, {
179 page, 203 page,
180 size: 20, 204 size: 20,
181 productStatusStr: 1 205 productStatusStr: 1
182 - }; 206 + });
183 207
184 this.productList(params); 208 this.productList(params);
185 }, 209 },
186 - setOffSale(skns) { 210 + setOnSale(skns) {
187 const params = { 211 const params = {
188 - targetStatus: 0 212 + targetStatus: 1
189 }; 213 };
190 214
191 if(_.isArray(skns)) { 215 if(_.isArray(skns)) {
@@ -194,15 +218,15 @@ @@ -194,15 +218,15 @@
194 params['productSkns'] = `[${skns}]` 218 params['productSkns'] = `[${skns}]`
195 } 219 }
196 220
197 - service.setOffSale(params) 221 + service.setOnSale(params)
198 .then(res => { 222 .then(res => {
199 this.$Message.success(res.data.message); 223 this.$Message.success(res.data.message);
200 }); 224 });
201 }, 225 },
202 226
203 - batchSetOffSale() { 227 + batchSetOnSale() {
204 if(!this.batchOffSale.length) { 228 if(!this.batchOffSale.length) {
205 - return this.$Message.error('请选择要架的商品'); 229 + return this.$Message.error('请选择要架的商品');
206 } 230 }
207 231
208 let skns = []; 232 let skns = [];
@@ -211,7 +235,7 @@ @@ -211,7 +235,7 @@
211 skns.push(item.productSkn); 235 skns.push(item.productSkn);
212 }); 236 });
213 237
214 - this.setOffSale(skns); 238 + this.setOnSale(skns);
215 }, 239 },
216 changePrice(row) { 240 changePrice(row) {
217 row.changePrice = true; 241 row.changePrice = true;
@@ -253,7 +277,7 @@ @@ -253,7 +277,7 @@
253 } 277 }
254 </script> 278 </script>
255 279
256 -<style lang="scss" scoped> 280 +<style lang="scss">
257 .filter-row { 281 .filter-row {
258 margin-bottom: 20px; 282 margin-bottom: 20px;
259 283
@@ -275,4 +299,12 @@ @@ -275,4 +299,12 @@
275 float: right; 299 float: right;
276 margin-top: 20px; 300 margin-top: 20px;
277 } 301 }
  302 +
  303 + .prd-img {
  304 + max-height: 200px;
  305 + }
  306 +
  307 + .action-btn-row {
  308 + margin-top: 10px;
  309 + }
278 </style> 310 </style>