Authored by 李奇

已上架data store归集

@@ -59,32 +59,16 @@ @@ -59,32 +59,16 @@
59 59
60 <script> 60 <script>
61 import _ from 'lodash'; 61 import _ from 'lodash';
62 - import ProductService from 'services/product/product-service';  
63 import onSaleStore from './store'; 62 import onSaleStore from './store';
  63 + import ProductService from 'services/product/product-service';
64 64
65 export default { 65 export default {
66 data() { 66 data() {
67 - return {  
68 - showSizeEdit: false,  
69 - tableCols: [],  
70 - tableData: {},  
71 - pageData: {},  
72 - filters: {},  
73 - batchOffSale: [],  
74 - useFilterSign: false,  
75 - categoryValue: []  
76 - }; 67 + return onSaleStore.apply(this);
77 }, 68 },
78 created() { 69 created() {
79 this.productService = new ProductService(); 70 this.productService = new ProductService();
80 - const store = onSaleStore.apply(this);  
81 -  
82 this.productList(); 71 this.productList();
83 - this.filters = store.filterFields;  
84 - this.tableCols = store.tableCols;  
85 - this.tableData = store.tableData;  
86 - this.pageData = store.pageData;  
87 -  
88 }, 72 },
89 methods: { 73 methods: {
90 editSize(skn) { 74 editSize(skn) {
@@ -117,10 +101,15 @@ @@ -117,10 +101,15 @@
117 this.pageData.current = 1; 101 this.pageData.current = 1;
118 }, 102 },
119 clearFilter() { 103 clearFilter() {
120 - const store = onSaleStore.apply(this);  
121 -  
122 - this.filters = store.filterFields; 104 + this.reset();
123 this.productList(); 105 this.productList();
  106 + },
  107 + reset() {
  108 + _.each(this.filters, item => {
  109 + if (_.has(item, 'model')) {
  110 + item.model = '';
  111 + }
  112 + });
124 this.useFilterSign = false; 113 this.useFilterSign = false;
125 this.pageData.current = 1; 114 this.pageData.current = 1;
126 this.categoryValue = []; 115 this.categoryValue = [];
@@ -16,6 +16,10 @@ const auditStatus = { @@ -16,6 +16,10 @@ const auditStatus = {
16 16
17 export default function() { 17 export default function() {
18 return { 18 return {
  19 + showSizeEdit: false,
  20 + batchOffSale: [],
  21 + useFilterSign: false,
  22 + categoryValue: [],
19 tableCols: [ 23 tableCols: [
20 { 24 {
21 type: 'selection', 25 type: 'selection',
@@ -155,7 +159,7 @@ export default function() { @@ -155,7 +159,7 @@ export default function() {
155 total: 0, 159 total: 0,
156 current: 1 160 current: 1
157 }, 161 },
158 - filterFields: { 162 + filters: {
159 sknCode: { 163 sknCode: {
160 label: 'SKN编码', 164 label: 'SKN编码',
161 model: '', 165 model: '',