|
8 | 8 | <el-form-item label="搜索方式" prop="searchValue">
|
9 | 9 | <el-input v-model="queryParams.searchValue" style="width: 240px">
|
10 | 10 | <el-select v-model="queryParams.searchType" slot="prepend" style="width: 100px">
|
11 |
| - <el-option v-for="dict in dicData.searchType" v-bind="dict" :key="dict.value"/> |
| 11 | + <el-option v-for="dict in searchTypes" :key="dict.value" :label="dict.label" :value="dict.value"/> |
12 | 12 | </el-select>
|
13 | 13 | </el-input>
|
14 | 14 | </el-form-item>
|
@@ -156,103 +156,100 @@ import { getOrderPage } from "@/api/mall/trade/order";
|
156 | 156 | import { datePickerOptions } from "@/utils/constants";
|
157 | 157 | import { DICT_TYPE, getDictDatas } from "@/utils/dict";
|
158 | 158 |
|
159 |
| -const dicData = { |
160 |
| - searchType: [ |
161 |
| - { label: '订单号', value: 'no' }, |
162 |
| - { label: '会员编号', value: 'userId' }, |
163 |
| - { label: '会员昵称', value: 'userNickname' }, |
164 |
| - { label: '会员手机号', value: 'userMobile' }, |
165 |
| - { label: '收货人姓名', value: 'receiverName' }, |
166 |
| - { label: '收货人手机号码', value: 'receiverMobile' }, |
167 |
| - ], |
168 |
| - } |
169 |
| - export default { |
170 |
| - name: "index", |
171 |
| - data () { |
172 |
| - return { |
173 |
| - dicData, |
174 |
| - // 遮罩层 |
175 |
| - loading: true, |
176 |
| - // 导出遮罩层 |
177 |
| - exportLoading: false, |
178 |
| - // 显示搜索条件 |
179 |
| - showSearch: true, |
180 |
| - // 总条数 |
181 |
| - total: 0, |
182 |
| - // 交易售后列表 |
183 |
| - list: [], |
184 |
| - queryParams: { |
185 |
| - pageNo: 1, |
186 |
| - pageSize: 10, |
187 |
| - searchType: 'no', |
188 |
| - searchValue: '', |
189 |
| - type: null, |
190 |
| - status: null, |
191 |
| - payChannelCode: null, |
192 |
| - createTime: [], |
193 |
| - }, |
194 |
| - // Tab 筛选 |
195 |
| - activeTab: 'all', |
196 |
| - statusTabs: [{ |
197 |
| - label: '全部', |
198 |
| - value: 'all' |
199 |
| - }], |
200 |
| - // 静态变量 |
201 |
| - datePickerOptions: datePickerOptions |
202 |
| - } |
| 159 | +export default { |
| 160 | + name: "index", |
| 161 | + data () { |
| 162 | + return { |
| 163 | + // 遮罩层 |
| 164 | + loading: true, |
| 165 | + // 导出遮罩层 |
| 166 | + exportLoading: false, |
| 167 | + // 显示搜索条件 |
| 168 | + showSearch: true, |
| 169 | + // 总条数 |
| 170 | + total: 0, |
| 171 | + // 交易售后列表 |
| 172 | + list: [], |
| 173 | + queryParams: { |
| 174 | + pageNo: 1, |
| 175 | + pageSize: 10, |
| 176 | + searchType: 'no', |
| 177 | + searchValue: '', |
| 178 | + type: null, |
| 179 | + status: null, |
| 180 | + payChannelCode: null, |
| 181 | + createTime: [], |
| 182 | + }, |
| 183 | + // Tab 筛选 |
| 184 | + activeTab: 'all', |
| 185 | + statusTabs: [{ |
| 186 | + label: '全部', |
| 187 | + value: 'all' |
| 188 | + }], |
| 189 | + // 静态变量 |
| 190 | + datePickerOptions: datePickerOptions, |
| 191 | + searchTypes: [ |
| 192 | + { label: '订单号', value: 'no' }, |
| 193 | + { label: '会员编号', value: 'userId' }, |
| 194 | + { label: '会员昵称', value: 'userNickname' }, |
| 195 | + { label: '会员手机号', value: 'userMobile' }, |
| 196 | + { label: '收货人姓名', value: 'receiverName' }, |
| 197 | + { label: '收货人手机号码', value: 'receiverMobile' }, |
| 198 | + ], |
| 199 | + } |
| 200 | + }, |
| 201 | + created() { |
| 202 | + this.getList(); |
| 203 | + // 设置 statuses 过滤 |
| 204 | + for (const dict of getDictDatas(DICT_TYPE.TRADE_ORDER_STATUS)) { |
| 205 | + this.statusTabs.push({ |
| 206 | + label: dict.label, |
| 207 | + value: dict.value |
| 208 | + }) |
| 209 | + } |
| 210 | + }, |
| 211 | + methods: { |
| 212 | + /** 查询列表 */ |
| 213 | + getList() { |
| 214 | + this.loading = true; |
| 215 | + // 执行查询 |
| 216 | + getOrderPage({ |
| 217 | + ...this.queryParams, |
| 218 | + searchType: undefined, |
| 219 | + searchValue: undefined, |
| 220 | + no: this.queryParams.searchType === 'no' ? this.queryParams.searchValue : undefined, |
| 221 | + userId: this.queryParams.searchType === 'userId' ? this.queryParams.searchValue : undefined, |
| 222 | + userNickname: this.queryParams.searchType === 'userNickname' ? this.queryParams.searchValue : undefined, |
| 223 | + userMobile: this.queryParams.searchType === 'userMobile' ? this.queryParams.searchValue : undefined, |
| 224 | + receiverName: this.queryParams.searchType === 'receiverName' ? this.queryParams.searchValue : undefined, |
| 225 | + receiverMobile: this.queryParams.searchType === 'receiverMobile' ? this.queryParams.searchValue : undefined, |
| 226 | + }).then(response => { |
| 227 | + this.list = response.data.list; |
| 228 | + this.total = response.data.total; |
| 229 | + this.loading = false; |
| 230 | + }); |
203 | 231 | },
|
204 |
| - created() { |
| 232 | + /** 搜索按钮操作 */ |
| 233 | + handleQuery() { |
| 234 | + this.queryParams.pageNo = 1; |
| 235 | + this.activeTab = this.queryParams.status ? this.queryParams.status : 'all'; // 处理 tab |
205 | 236 | this.getList();
|
206 |
| - // 设置 statuses 过滤 |
207 |
| - for (const dict of getDictDatas(DICT_TYPE.TRADE_ORDER_STATUS)) { |
208 |
| - this.statusTabs.push({ |
209 |
| - label: dict.label, |
210 |
| - value: dict.value |
211 |
| - }) |
212 |
| - } |
213 | 237 | },
|
214 |
| - methods: { |
215 |
| - /** 查询列表 */ |
216 |
| - getList() { |
217 |
| - this.loading = true; |
218 |
| - // 执行查询 |
219 |
| - getOrderPage({ |
220 |
| - ...this.queryParams, |
221 |
| - searchType: undefined, |
222 |
| - searchValue: undefined, |
223 |
| - no: this.queryParams.searchType === 'no' ? this.queryParams.searchValue : undefined, |
224 |
| - userId: this.queryParams.searchType === 'userId' ? this.queryParams.searchValue : undefined, |
225 |
| - userNickname: this.queryParams.searchType === 'userNickname' ? this.queryParams.searchValue : undefined, |
226 |
| - userMobile: this.queryParams.searchType === 'userMobile' ? this.queryParams.searchValue : undefined, |
227 |
| - receiverName: this.queryParams.searchType === 'receiverName' ? this.queryParams.searchValue : undefined, |
228 |
| - receiverMobile: this.queryParams.searchType === 'receiverMobile' ? this.queryParams.searchValue : undefined, |
229 |
| - }).then(response => { |
230 |
| - this.list = response.data.list; |
231 |
| - this.total = response.data.total; |
232 |
| - this.loading = false; |
233 |
| - }); |
234 |
| - }, |
235 |
| - /** 搜索按钮操作 */ |
236 |
| - handleQuery() { |
237 |
| - this.queryParams.pageNo = 1; |
238 |
| - this.activeTab = this.queryParams.status ? this.queryParams.status : 'all'; // 处理 tab |
239 |
| - this.getList(); |
240 |
| - }, |
241 |
| - /** 重置按钮操作 */ |
242 |
| - resetQuery() { |
243 |
| - this.resetForm("queryForm"); |
244 |
| - this.handleQuery(); |
245 |
| - }, |
246 |
| - /** tab 切换 */ |
247 |
| - tabClick(tab) { |
248 |
| - this.queryParams.status = tab.name === 'all' ? undefined : tab.name; |
249 |
| - this.getList(); |
250 |
| - }, |
251 |
| - goToDetail (row) { |
252 |
| - this.$router.push({ path: '/mall/trade/order/detail', query: { orderNo: row.orderNo }}) |
253 |
| - } |
| 238 | + /** 重置按钮操作 */ |
| 239 | + resetQuery() { |
| 240 | + this.resetForm("queryForm"); |
| 241 | + this.handleQuery(); |
| 242 | + }, |
| 243 | + /** tab 切换 */ |
| 244 | + tabClick(tab) { |
| 245 | + this.queryParams.status = tab.name === 'all' ? undefined : tab.name; |
| 246 | + this.getList(); |
| 247 | + }, |
| 248 | + goToDetail (row) { |
| 249 | + this.$router.push({ path: '/mall/trade/order/detail', query: { id: row.id }}) |
254 | 250 | }
|
255 | 251 | }
|
| 252 | +} |
256 | 253 | </script>
|
257 | 254 |
|
258 | 255 | <style lang="scss" scoped>
|
|
0 commit comments