Showing
3 changed files
with
21 additions
and
205 deletions
1 | <template> | 1 | <template> |
2 | <Row class="filter-item"> | 2 | <Row class="filter-item"> |
3 | - <Col class="label-col" span="6" v-if="label"> | 3 | + <Col class="label-col" span="8" v-if="label"> |
4 | <label>{{label}}:</label> | 4 | <label>{{label}}:</label> |
5 | </Col> | 5 | </Col> |
6 | - <Col class="item-col" span="18"> | 6 | + <Col class="item-col" :span="label ? 16 : 24"> |
7 | <slot></slot> | 7 | <slot></slot> |
8 | </Col> | 8 | </Col> |
9 | </Row> | 9 | </Row> |
@@ -28,7 +28,7 @@ export default { | @@ -28,7 +28,7 @@ export default { | ||
28 | <style lang="scss"> | 28 | <style lang="scss"> |
29 | .label-col { | 29 | .label-col { |
30 | line-height: 32px; | 30 | line-height: 32px; |
31 | - max-width: 100px; | 31 | + max-width: 80px; |
32 | } | 32 | } |
33 | .item-col { | 33 | .item-col { |
34 | input, select, .ivu-select, .ivu-cascader { | 34 | input, select, .ivu-select, .ivu-cascader { |
@@ -6,9 +6,9 @@ export default { | @@ -6,9 +6,9 @@ export default { | ||
6 | render(createElement) { | 6 | render(createElement) { |
7 | let slotChunks = _.chunk(this.$slots.default.filter(slot => | 7 | let slotChunks = _.chunk(this.$slots.default.filter(slot => |
8 | slot.data && slot.componentOptions.propsData.label), this.col); | 8 | slot.data && slot.componentOptions.propsData.label), this.col); |
9 | - let submitChunk = _.chunk(this.$slots.default.filter(slot => | ||
10 | - slot.data && !slot.componentOptions.propsData.label), this.col); | ||
11 | - let rowElements = _.map(_.concat(slotChunks, submitChunk), slotChunk => { | 9 | + let submitSlots = this.$slots.default.filter(slot => |
10 | + slot.data && !slot.componentOptions.propsData.label); | ||
11 | + let rowElements = _.map(slotChunks, slotChunk => { | ||
12 | return createElement('Row', { | 12 | return createElement('Row', { |
13 | class: { | 13 | class: { |
14 | 'filter-row': true | 14 | 'filter-row': true |
@@ -25,6 +25,21 @@ export default { | @@ -25,6 +25,21 @@ export default { | ||
25 | })); | 25 | })); |
26 | }); | 26 | }); |
27 | 27 | ||
28 | + _.each(submitSlots, slot => { | ||
29 | + rowElements.push(createElement('Row', { | ||
30 | + class: { | ||
31 | + 'filter-row': true | ||
32 | + }, | ||
33 | + props: { | ||
34 | + gutter: this.gutter | ||
35 | + } | ||
36 | + }, [createElement('Col', { | ||
37 | + props: { | ||
38 | + span: 24 | ||
39 | + } | ||
40 | + }, [slot])])); | ||
41 | + }); | ||
42 | + | ||
28 | if (!this.noLine) { | 43 | if (!this.noLine) { |
29 | rowElements.push(createElement('div', { | 44 | rowElements.push(createElement('div', { |
30 | class: { | 45 | class: { |
1 | -let filterFields = { | ||
2 | - sknCode: { | ||
3 | - label: 'SKN编码', | ||
4 | - labelSpan: 6, | ||
5 | - model: '', | ||
6 | - holder: '', | ||
7 | - fieldSpan: 18 | ||
8 | - }, | ||
9 | - prodCode: { | ||
10 | - label: '商家编码', | ||
11 | - labelSpan: 6, | ||
12 | - model: '', | ||
13 | - holder: '', | ||
14 | - fieldSpan: 18 | ||
15 | - }, | ||
16 | - prodName: { | ||
17 | - label: '商品名称', | ||
18 | - labelSpan: 6, | ||
19 | - model: '', | ||
20 | - holder: '', | ||
21 | - fieldSpan: 18 | ||
22 | - }, | ||
23 | - prodBarCode: { | ||
24 | - label: '商品条码', | ||
25 | - labelSpan: 6, | ||
26 | - model: '', | ||
27 | - holder: '', | ||
28 | - fieldSpan: 18 | ||
29 | - }, | ||
30 | - sort: { | ||
31 | - first: { | ||
32 | - label: '选择类目', | ||
33 | - holder: '选择一级类目', | ||
34 | - labelSpan: 6, | ||
35 | - fieldSpan: 18, | ||
36 | - model: '' | ||
37 | - }, | ||
38 | - second: { | ||
39 | - label: '二级类目', | ||
40 | - holder: '选择二级类目', | ||
41 | - labelSpan: 6, | ||
42 | - fieldSpan: 18, | ||
43 | - model: '' | ||
44 | - }, | ||
45 | - third: { | ||
46 | - label: '三级类目', | ||
47 | - holder: '选择三级类目', | ||
48 | - labelSpan: 6, | ||
49 | - fieldSpan: 18, | ||
50 | - model: '' | ||
51 | - } | ||
52 | - }, | ||
53 | - brand: { | ||
54 | - label: '选择品牌', | ||
55 | - labelSpan: 6, | ||
56 | - fieldSpan: 18, | ||
57 | - model: -1 | ||
58 | - }, | ||
59 | - verifyStatus: { | ||
60 | - label: '审核状态', | ||
61 | - labelSpan: 6, | ||
62 | - fieldSpan: 18, | ||
63 | - model: -1, | ||
64 | - options: [ | ||
65 | - { | ||
66 | - value: -1, | ||
67 | - label: '全部' | ||
68 | - }, | ||
69 | - { | ||
70 | - value: 1, | ||
71 | - label: '下架待审核' | ||
72 | - }, | ||
73 | - { | ||
74 | - value: 2, | ||
75 | - label: '下架驳回' | ||
76 | - } | ||
77 | - ] | ||
78 | - }, | ||
79 | - stockStatus: { | ||
80 | - label: '库存情况', | ||
81 | - labelSpan: 6, | ||
82 | - fieldSpan: 18, | ||
83 | - model: -1, | ||
84 | - options: [ | ||
85 | - { | ||
86 | - value: -1, | ||
87 | - label: '全部' | ||
88 | - }, | ||
89 | - { | ||
90 | - value: 1, | ||
91 | - label: '有库存' | ||
92 | - }, | ||
93 | - { | ||
94 | - value: 0, | ||
95 | - label: '无库存' | ||
96 | - } | ||
97 | - ] | ||
98 | - } | ||
99 | -}; | ||
100 | - | ||
101 | -let initialFields = JSON.stringify(filterFields); | ||
102 | - | ||
103 | -let tableCols = [ | ||
104 | - { | ||
105 | - title: '对账单号', | ||
106 | - key: 'image', | ||
107 | - width: 120, | ||
108 | - align: 'center', | ||
109 | - render (row, column, index) { | ||
110 | - return '<cell-image :image-src="row.picImgUrl" :product-url="row.productUrl"></cell-image>'; | ||
111 | - } | ||
112 | - }, | ||
113 | - { | ||
114 | - title: '生成日期', | ||
115 | - key: 'info', | ||
116 | - align: 'center', | ||
117 | - render(row, column, index) { | ||
118 | - return `<cell-info | ||
119 | - :skn="row.productSkn" | ||
120 | - :product-name="row.productName" | ||
121 | - :brand-name="row.brandName" | ||
122 | - :max-name="row.maxSortName" | ||
123 | - :middle-name="row.middleSortName" | ||
124 | - :small-name="row.smallSortName"> | ||
125 | - </cell-info>`; | ||
126 | - } | ||
127 | - }, | ||
128 | - { | ||
129 | - title: '结算周期', | ||
130 | - key: 'price', | ||
131 | - align: 'center', | ||
132 | - render(row, column, index) { | ||
133 | - row.lineIndex = index; | ||
134 | - return `<cell-price | ||
135 | - @click-change="editPrice(row)" | ||
136 | - @click-save="updatePrice" | ||
137 | - :can-change="true" | ||
138 | - :current-row="row" | ||
139 | - :show-change="row.changePrice" | ||
140 | - :retail-price="row.retailPrice" | ||
141 | - :sales-price="row.salesPrice"> | ||
142 | - </cell-price>`; | ||
143 | - } | ||
144 | - }, | ||
145 | - { | ||
146 | - title: '品牌', | ||
147 | - key: 'stock', | ||
148 | - width: 100, | ||
149 | - align: 'center', | ||
150 | - }, | ||
151 | - { | ||
152 | - title: '供应商', | ||
153 | - key: 'shelveTime', | ||
154 | - width: 150, | ||
155 | - align: 'center' | ||
156 | - }, | ||
157 | - { | ||
158 | - title: '结算金额', | ||
159 | - key: 'verify', | ||
160 | - align: 'center', | ||
161 | - render(row, column, index) { | ||
162 | - return `${auditStatus[row.auditStatus]}` | ||
163 | - } | ||
164 | - }, | ||
165 | - { | ||
166 | - title: '操作', | ||
167 | - key: 'action', | ||
168 | - width: 180, | ||
169 | - align: 'center', | ||
170 | - render: function(row, column, index) { | ||
171 | - return `<div class="action-btn-row"> | ||
172 | - <i-button type="primary" size="small" @click="editSize(row.productSkn)">尺码维护</i-button> | ||
173 | - <i-button v-if="row._disabled" type="primary" size="small" | ||
174 | - @click="editProduct(${row.productSkn})" disabled>内容编辑</i-button> | ||
175 | - <i-button v-else type="primary" size="small" @click="editProduct(${row.productSkn})">内容编辑</i-button> | ||
176 | - </div> | ||
177 | - <div class="btn-row-space"> | ||
178 | - <i-button v-if="row._disabled" type="error" size="small" | ||
179 | - @click="setOffSale(${row.productSkn})" disabled>下架</i-button> | ||
180 | - <i-button v-else type="error" size="small" @click="setOffSale(${row.productSkn})" >下架</i-button> | ||
181 | - </div>`; | ||
182 | - } | ||
183 | - } | ||
184 | -]; | ||
185 | - | ||
186 | -let tableData = []; | ||
187 | - | ||
188 | -let pageData = { | ||
189 | - total: 0, | ||
190 | - current: 1 | ||
191 | -}; | ||
192 | - | ||
193 | -export { | ||
194 | - filterFields, | ||
195 | - initialFields, | ||
196 | - tableCols, | ||
197 | - tableData, | ||
198 | - pageData | ||
199 | -}; |
-
Please register or login to post a comment