|
|
@@ -1,7 +1,14 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<div class="filters-container">
|
|
|
-
|
|
|
+
|
|
|
+ <el-select v-model="storeId" size="small" clearable filterable placeholder="店铺" @change="searchData" style="width:120px">
|
|
|
+ <el-option v-for="item in storeInfos" :key="item.id" :label="item.storeName" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-select v-model="userId" size="small" clearable filterable placeholder="用户" @change="searchData" style="width:120px">
|
|
|
+ <el-option v-for="item in userInfos" :key="item.id" :label="item.nickname" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+
|
|
|
<el-input placeholder="关键字" size="small" v-model="filter1" clearable class="filter-item"></el-input>
|
|
|
<el-button @click="searchData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
|
|
|
</el-button>
|
|
|
@@ -19,7 +26,7 @@
|
|
|
</el-button>
|
|
|
<el-dropdown trigger="click" size="medium" class="table-column-filter">
|
|
|
<span>
|
|
|
- 筛选数据<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ 筛选数据<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
</span>
|
|
|
<el-dropdown-menu slot="dropdown" class="table-column-filter-wrapper">
|
|
|
<el-checkbox v-for="item in tableColumns" :key="item.value" v-model="item.show">{{item.label}}
|
|
|
@@ -28,92 +35,101 @@
|
|
|
</el-dropdown>
|
|
|
</div>
|
|
|
<el-table
|
|
|
- :data="tableData"
|
|
|
- :height="tableHeight"
|
|
|
- row-key="id"
|
|
|
- ref="table">
|
|
|
+ :data="tableData"
|
|
|
+ :height="tableHeight"
|
|
|
+ row-key="id"
|
|
|
+ ref="table">
|
|
|
+ <el-table-column
|
|
|
+ v-if="multipleMode"
|
|
|
+ align="center"
|
|
|
+ type="selection"
|
|
|
+ width="50">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ type="index"
|
|
|
+ min-width="50"
|
|
|
+ align="center">
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ v-if="isColumnShow('userId')"
|
|
|
+ prop="userId"
|
|
|
+ label="用户"
|
|
|
+ min-width="70">
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ v-if="isColumnShow('storeId')"
|
|
|
+ prop="storeId"
|
|
|
+ label="店铺"
|
|
|
+ min-width="70">
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop="storeService.typeFlag"
|
|
|
+ label="类型"
|
|
|
+ min-width="100"
|
|
|
+ :formatter="TypeFlagFormatter">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="storeService.serviceName"
|
|
|
+ label="服务"
|
|
|
+ min-width="100">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ v-if="isColumnShow('serviceId')"
|
|
|
+ prop="serviceId"
|
|
|
+ label="服务"
|
|
|
+ min-width="70">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ v-if="isColumnShow('orderId')"
|
|
|
+ prop="orderId"
|
|
|
+ label="订单"
|
|
|
+ min-width="70">
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ v-if="isColumnShow('orderDetailId')"
|
|
|
+ prop="orderDetailId"
|
|
|
+ label="子订单"
|
|
|
+ min-width="70">
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
<el-table-column
|
|
|
- v-if="multipleMode"
|
|
|
- align="center"
|
|
|
- type="selection"
|
|
|
- width="50">
|
|
|
+ v-if="isColumnShow('amount')"
|
|
|
+ prop="amount"
|
|
|
+ label="数量"
|
|
|
+ min-width="100">
|
|
|
</el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ v-if="isColumnShow('message')"
|
|
|
+ prop="message"
|
|
|
+ label="留言"
|
|
|
+ min-width="100">
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ v-if="isColumnShow('remark')"
|
|
|
+ prop="remark"
|
|
|
+ label="备注"
|
|
|
+ min-width="100">
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
<el-table-column
|
|
|
- type="index"
|
|
|
- min-width="50"
|
|
|
- align="center">
|
|
|
+ v-if="isColumnShow('miniId')"
|
|
|
+ prop="miniId"
|
|
|
+ label="小程序"
|
|
|
+ min-width="100">
|
|
|
</el-table-column>
|
|
|
-
|
|
|
- <el-table-column
|
|
|
- v-if="isColumnShow('userId')"
|
|
|
- prop="userId"
|
|
|
- label="用户"
|
|
|
- min-width="100">
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column
|
|
|
- v-if="isColumnShow('storeId')"
|
|
|
- prop="storeId"
|
|
|
- label="店铺"
|
|
|
- min-width="100">
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column
|
|
|
- v-if="isColumnShow('serviceId')"
|
|
|
- prop="serviceId"
|
|
|
- label="服务"
|
|
|
- min-width="100">
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column
|
|
|
- v-if="isColumnShow('orderId')"
|
|
|
- prop="orderId"
|
|
|
- label="订单"
|
|
|
- min-width="100">
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column
|
|
|
- v-if="isColumnShow('orderDetailId')"
|
|
|
- prop="orderDetailId"
|
|
|
- label="子订单"
|
|
|
- min-width="100">
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column
|
|
|
- v-if="isColumnShow('amount')"
|
|
|
- prop="amount"
|
|
|
- label="数量"
|
|
|
- min-width="100">
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column
|
|
|
- v-if="isColumnShow('message')"
|
|
|
- prop="message"
|
|
|
- label="留言"
|
|
|
- min-width="100">
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column
|
|
|
- v-if="isColumnShow('remark')"
|
|
|
- prop="remark"
|
|
|
- label="备注"
|
|
|
- min-width="100">
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column
|
|
|
- v-if="isColumnShow('miniId')"
|
|
|
- prop="miniId"
|
|
|
- label="小程序"
|
|
|
- min-width="100">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="操作"
|
|
|
- align="center"
|
|
|
- fixed="right"
|
|
|
- min-width="150"
|
|
|
- >
|
|
|
+ <el-table-column
|
|
|
+ label="操作"
|
|
|
+ align="center"
|
|
|
+ fixed="right"
|
|
|
+ min-width="150">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
|
|
|
+ <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
|
|
|
<el-button @click="deleteRow(scope.row)" type="danger" size="mini" plain>删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -128,14 +144,14 @@
|
|
|
</el-button-group>
|
|
|
</div>
|
|
|
<el-pagination
|
|
|
- background
|
|
|
- @size-change="pageSizeChange"
|
|
|
- @current-change="currentPageChange"
|
|
|
- :current-page="currentPage"
|
|
|
- :page-sizes="[10, 20, 30, 40, 50]"
|
|
|
- :page-size="pageSize"
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
- :total="totalNumber">
|
|
|
+ background
|
|
|
+ @size-change="pageSizeChange"
|
|
|
+ @current-change="currentPageChange"
|
|
|
+ :current-page="currentPage"
|
|
|
+ :page-sizes="[10, 20, 30, 40, 50]"
|
|
|
+ :page-size="pageSize"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="totalNumber">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
<el-dialog title="高级查询" :visible.sync="showAdvancedQueryDialog">
|
|
|
@@ -230,307 +246,383 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
- import {mapState} from 'vuex'
|
|
|
- import {format} from 'date-fns'
|
|
|
- import zh from 'date-fns/locale/zh_cn'
|
|
|
-
|
|
|
- export default {
|
|
|
- name: 'OrderServices',
|
|
|
- created() {
|
|
|
+import { mapState } from 'vuex';
|
|
|
+import { format } from 'date-fns';
|
|
|
+import zh from 'date-fns/locale/zh_cn';
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'OrderServices',
|
|
|
+ created() {
|
|
|
+ this.getData();
|
|
|
+
|
|
|
+ this.$http
|
|
|
+ .get({
|
|
|
+ url: '/storeInfo/all',
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.storeInfos = res.data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ this.$http
|
|
|
+ .get({
|
|
|
+ url: '/userInfo/all',
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.userInfos = res.data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ totalNumber: 0,
|
|
|
+ totalPage: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ tableData: [],
|
|
|
+ filter1: '',
|
|
|
+ filter2: '',
|
|
|
+ tableColumns: [
|
|
|
+ {
|
|
|
+ label: '用户',
|
|
|
+ value: 'userId',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '店铺',
|
|
|
+ value: 'storeId',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '服务',
|
|
|
+ value: 'serviceId',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '订单',
|
|
|
+ value: 'orderId',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '子订单',
|
|
|
+ value: 'orderDetailId',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '数量',
|
|
|
+ value: 'amount',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '留言',
|
|
|
+ value: 'message',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '备注',
|
|
|
+ value: 'remark',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '小程序',
|
|
|
+ value: 'miniId',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ multipleMode: false,
|
|
|
+ showAdvancedQueryDialog: false,
|
|
|
+ advancedQueryFields: [],
|
|
|
+ showTableSortDialog: false,
|
|
|
+ tableSortFields: [],
|
|
|
+ searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
|
|
|
+ advancedQueryColumns: [
|
|
|
+ {
|
|
|
+ label: '用户',
|
|
|
+ value: 'user_id',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '店铺',
|
|
|
+ value: 'store_id',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '服务',
|
|
|
+ value: 'service_id',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '订单',
|
|
|
+ value: 'order_id',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '子订单',
|
|
|
+ value: 'order_detail_id',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '数量',
|
|
|
+ value: 'amount',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '留言',
|
|
|
+ value: 'message',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '备注',
|
|
|
+ value: 'remark',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '小程序',
|
|
|
+ value: 'mini_id',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ advancedQuerySearchKey: '',
|
|
|
+ orderByStr: '',
|
|
|
+ imgSrc: '',
|
|
|
+ imageDialogVisible: false,
|
|
|
+ typeFlagOptions: [
|
|
|
+ {
|
|
|
+ value: 'photographer',
|
|
|
+ label: '摄影师',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'makeup_artist',
|
|
|
+ label: '化妆师',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'clothing',
|
|
|
+ label: '服装道具',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'album',
|
|
|
+ label: '相框',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'other',
|
|
|
+ label: '其他',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'song',
|
|
|
+ label: '赠送增值',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ storeInfos: [],
|
|
|
+ storeId: '',
|
|
|
+ userInfos: [],
|
|
|
+ userId: '',
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['tableHeight']),
|
|
|
+ selection() {
|
|
|
+ return this.$refs.table.selection.map(i => i.id);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ pageSizeChange(size) {
|
|
|
+ this.currentPage = 1;
|
|
|
+ this.pageSize = size;
|
|
|
this.getData();
|
|
|
},
|
|
|
- data() {
|
|
|
- return {
|
|
|
- totalNumber: 0,
|
|
|
- totalPage: 10,
|
|
|
- currentPage: 1,
|
|
|
- pageSize: 20,
|
|
|
- tableData: [],
|
|
|
- filter1: '',
|
|
|
- filter2: '',
|
|
|
- tableColumns: [
|
|
|
- {
|
|
|
- label: '用户',
|
|
|
- value: 'userId',
|
|
|
- show: true
|
|
|
- },
|
|
|
- {
|
|
|
- label: '店铺',
|
|
|
- value: 'storeId',
|
|
|
- show: true
|
|
|
- },
|
|
|
- {
|
|
|
- label: '服务',
|
|
|
- value: 'serviceId',
|
|
|
- show: true
|
|
|
- },
|
|
|
- {
|
|
|
- label: '订单',
|
|
|
- value: 'orderId',
|
|
|
- show: true
|
|
|
- },
|
|
|
- {
|
|
|
- label: '子订单',
|
|
|
- value: 'orderDetailId',
|
|
|
- show: true
|
|
|
- },
|
|
|
- {
|
|
|
- label: '数量',
|
|
|
- value: 'amount',
|
|
|
- show: true
|
|
|
- },
|
|
|
- {
|
|
|
- label: '留言',
|
|
|
- value: 'message',
|
|
|
- show: true
|
|
|
- },
|
|
|
- {
|
|
|
- label: '备注',
|
|
|
- value: 'remark',
|
|
|
- show: true
|
|
|
- },
|
|
|
- {
|
|
|
- label: '小程序',
|
|
|
- value: 'miniId',
|
|
|
- show: true
|
|
|
- },
|
|
|
- ],
|
|
|
- multipleMode: false,
|
|
|
- showAdvancedQueryDialog: false,
|
|
|
- advancedQueryFields: [],
|
|
|
- showTableSortDialog: false,
|
|
|
- tableSortFields: [],
|
|
|
- searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
|
|
|
- advancedQueryColumns: [
|
|
|
- {
|
|
|
- label: '用户',
|
|
|
- value: 'user_id'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '店铺',
|
|
|
- value: 'store_id'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '服务',
|
|
|
- value: 'service_id'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '订单',
|
|
|
- value: 'order_id'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '子订单',
|
|
|
- value: 'order_detail_id'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '数量',
|
|
|
- value: 'amount'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '留言',
|
|
|
- value: 'message'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '备注',
|
|
|
- value: 'remark'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '小程序',
|
|
|
- value: 'mini_id'
|
|
|
- },
|
|
|
- ],
|
|
|
- advancedQuerySearchKey: '',
|
|
|
- orderByStr: '',
|
|
|
- imgSrc: '',
|
|
|
- imageDialogVisible: false,
|
|
|
- }
|
|
|
+ currentPageChange(page) {
|
|
|
+ this.currentPage = page;
|
|
|
+ this.getData();
|
|
|
},
|
|
|
- computed: {
|
|
|
- ...mapState(['tableHeight']),
|
|
|
- selection() {
|
|
|
- return this.$refs.table.selection.map(i => i.id);
|
|
|
+ getData() {
|
|
|
+ var data = {
|
|
|
+ currentPage: this.currentPage,
|
|
|
+ pageNumber: this.pageSize,
|
|
|
+ searchKey: this.filter1,
|
|
|
+ advancedQuery: this.advancedQuerySearchKey,
|
|
|
+ orderByStr: this.orderByStr,
|
|
|
+ storeId: this.storeId,
|
|
|
+ userId: this.userId,
|
|
|
+ };
|
|
|
+
|
|
|
+ if (this.$route.query.column) {
|
|
|
+ var tempColumn = this.$route.query.column;
|
|
|
+ data[tempColumn.split(',')[1]] = tempColumn.split(',')[0];
|
|
|
}
|
|
|
- },
|
|
|
- methods: {
|
|
|
- pageSizeChange(size) {
|
|
|
- this.currentPage = 1;
|
|
|
- this.pageSize = size;
|
|
|
- this.getData();
|
|
|
- },
|
|
|
- currentPageChange(page) {
|
|
|
- this.currentPage = page;
|
|
|
- this.getData();
|
|
|
- },
|
|
|
- getData() {
|
|
|
-
|
|
|
- var data = {
|
|
|
- currentPage: this.currentPage,
|
|
|
- pageNumber: this.pageSize,
|
|
|
- searchKey: this.filter1,
|
|
|
- advancedQuery: this.advancedQuerySearchKey,
|
|
|
- orderByStr: this.orderByStr,
|
|
|
- }
|
|
|
|
|
|
- if (this.$route.query.column) {
|
|
|
- var tempColumn = this.$route.query.column;
|
|
|
- data[tempColumn.split(',')[1]] = tempColumn.split(',')[0];
|
|
|
- }
|
|
|
-
|
|
|
- this.$http.get({
|
|
|
+ this.$http
|
|
|
+ .get({
|
|
|
url: '/orderService/page',
|
|
|
- data: data
|
|
|
- }).then(res => {
|
|
|
+ data: data,
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
if (res.success) {
|
|
|
this.totalNumber = res.data.page.totalNumber;
|
|
|
this.tableData = res.data.pp;
|
|
|
}
|
|
|
- })
|
|
|
- },
|
|
|
- isColumnShow(column) {
|
|
|
- var row = this.tableColumns.find(i => i.value === column);
|
|
|
- return row ? row.show : false;
|
|
|
- },
|
|
|
- toggleMultipleMode(multipleMode) {
|
|
|
- this.multipleMode = multipleMode;
|
|
|
- if (!multipleMode) {
|
|
|
- this.$refs.table.clearSelection();
|
|
|
- }
|
|
|
- },
|
|
|
- editRow(row) {
|
|
|
- this.$router.push({
|
|
|
- path: '/orderService',
|
|
|
- query: {
|
|
|
- id: row.id,
|
|
|
- column: this.$route.query.column,
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- operation1() {
|
|
|
- this.$notify({
|
|
|
- title: '提示',
|
|
|
- message: this.selection
|
|
|
});
|
|
|
- },
|
|
|
- operation2() {
|
|
|
- this.$message('操作2');
|
|
|
- },
|
|
|
- addField() {
|
|
|
- this.advancedQueryFields.push({
|
|
|
- link: 'AND',
|
|
|
- name: '',
|
|
|
- searchMethod: '=',
|
|
|
- value: '',
|
|
|
+ },
|
|
|
+ isColumnShow(column) {
|
|
|
+ var row = this.tableColumns.find(i => i.value === column);
|
|
|
+ return row ? row.show : false;
|
|
|
+ },
|
|
|
+ toggleMultipleMode(multipleMode) {
|
|
|
+ this.multipleMode = multipleMode;
|
|
|
+ if (!multipleMode) {
|
|
|
+ this.$refs.table.clearSelection();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ editRow(row) {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/orderService',
|
|
|
+ query: {
|
|
|
+ id: row.id,
|
|
|
+ column: this.$route.query.column,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ operation1() {
|
|
|
+ this.$notify({
|
|
|
+ title: '提示',
|
|
|
+ message: this.selection,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ operation2() {
|
|
|
+ this.$message('操作2');
|
|
|
+ },
|
|
|
+ addField() {
|
|
|
+ this.advancedQueryFields.push({
|
|
|
+ link: 'AND',
|
|
|
+ name: '',
|
|
|
+ searchMethod: '=',
|
|
|
+ value: '',
|
|
|
+ });
|
|
|
+ },
|
|
|
+ removeField(i) {
|
|
|
+ if (this.advancedQueryFields.length > 0) {
|
|
|
+ this.advancedQueryFields.splice(i, 1);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ advancedQuery() {
|
|
|
+ this.advancedQuerySearchKey = '';
|
|
|
+
|
|
|
+ if (this.advancedQueryFields.length > 0) {
|
|
|
+ var templist = [];
|
|
|
+
|
|
|
+ this.advancedQueryFields.forEach(item => {
|
|
|
+ if (
|
|
|
+ item.link &&
|
|
|
+ item.name &&
|
|
|
+ item.searchMethod &&
|
|
|
+ item.value
|
|
|
+ ) {
|
|
|
+ var tempItem =
|
|
|
+ item.link +
|
|
|
+ '_,' +
|
|
|
+ item.name +
|
|
|
+ '_,' +
|
|
|
+ item.searchMethod +
|
|
|
+ '_,' +
|
|
|
+ item.value;
|
|
|
+ templist.push(tempItem);
|
|
|
+ }
|
|
|
});
|
|
|
- },
|
|
|
- removeField(i) {
|
|
|
- if (this.advancedQueryFields.length > 0) {
|
|
|
- this.advancedQueryFields.splice(i, 1);
|
|
|
- }
|
|
|
- },
|
|
|
- advancedQuery() {
|
|
|
|
|
|
- this.advancedQuerySearchKey = '';
|
|
|
-
|
|
|
- if (this.advancedQueryFields.length > 0) {
|
|
|
-
|
|
|
- var templist = [];
|
|
|
+ if (templist.length > 0) {
|
|
|
+ this.advancedQuerySearchKey = templist.join('_;');
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- this.advancedQueryFields.forEach(item => {
|
|
|
- if (item.link && item.name && item.searchMethod && item.value) {
|
|
|
- var tempItem = item.link + '_,' + item.name + '_,' + item.searchMethod + '_,' + item.value;
|
|
|
- templist.push(tempItem);
|
|
|
- }
|
|
|
- })
|
|
|
+ this.getData();
|
|
|
+ this.showAdvancedQueryDialog = false;
|
|
|
+ },
|
|
|
+ addSortField() {
|
|
|
+ this.tableSortFields.push({
|
|
|
+ name: '',
|
|
|
+ order: 'asc',
|
|
|
+ });
|
|
|
+ },
|
|
|
+ removeSortField(i) {
|
|
|
+ if (this.tableSortFields.length > 0) {
|
|
|
+ this.tableSortFields.splice(i, 1);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ tableSortQuery() {
|
|
|
+ this.orderByStr = '';
|
|
|
|
|
|
- if (templist.length > 0) {
|
|
|
+ if (this.tableSortFields.length > 0) {
|
|
|
+ var templist = [];
|
|
|
|
|
|
- this.advancedQuerySearchKey = templist.join('_;');
|
|
|
+ this.tableSortFields.forEach(item => {
|
|
|
+ if (item.name && item.order) {
|
|
|
+ var tempItem = item.name + '_,' + item.order;
|
|
|
+ templist.push(tempItem);
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- this.getData();
|
|
|
- this.showAdvancedQueryDialog = false;
|
|
|
- },
|
|
|
- addSortField() {
|
|
|
- this.tableSortFields.push({
|
|
|
- name: '',
|
|
|
- order: 'asc',
|
|
|
});
|
|
|
- },
|
|
|
- removeSortField(i) {
|
|
|
- if (this.tableSortFields.length > 0) {
|
|
|
- this.tableSortFields.splice(i, 1);
|
|
|
- }
|
|
|
- },
|
|
|
- tableSortQuery() {
|
|
|
-
|
|
|
- this.orderByStr = '';
|
|
|
-
|
|
|
- if (this.tableSortFields.length > 0) {
|
|
|
-
|
|
|
- var templist = [];
|
|
|
|
|
|
- this.tableSortFields.forEach(item => {
|
|
|
- if (item.name && item.order) {
|
|
|
- var tempItem = item.name + '_,' + item.order;
|
|
|
- templist.push(tempItem);
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- if (templist.length > 0) {
|
|
|
-
|
|
|
- this.orderByStr = templist.join('_;');
|
|
|
- }
|
|
|
+ if (templist.length > 0) {
|
|
|
+ this.orderByStr = templist.join('_;');
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- this.getData();
|
|
|
- this.showTableSortDialog = false;
|
|
|
- },
|
|
|
- exportExcel() {
|
|
|
- window.location.href = this.$baseUrl + "/orderService/exportExcel?searchKey="
|
|
|
- + this.filter1 + "&advancedQuery=" + this.advancedQuerySearchKey+"&orderByStr=" + this.orderByStr;
|
|
|
- },
|
|
|
- searchData() {
|
|
|
- this.currentPage = 1;
|
|
|
- this.getData();
|
|
|
- },
|
|
|
- deleteRow(row) {
|
|
|
- this.$alert('删除将无法恢复,确认要删除么?', '警告', {type: 'error'}).then(() => {
|
|
|
+ this.getData();
|
|
|
+ this.showTableSortDialog = false;
|
|
|
+ },
|
|
|
+ exportExcel() {
|
|
|
+ window.location.href =
|
|
|
+ this.$baseUrl +
|
|
|
+ '/orderService/exportExcel?searchKey=' +
|
|
|
+ this.filter1 +
|
|
|
+ '&advancedQuery=' +
|
|
|
+ this.advancedQuerySearchKey +
|
|
|
+ '&orderByStr=' +
|
|
|
+ this.orderByStr;
|
|
|
+ },
|
|
|
+ searchData() {
|
|
|
+ this.currentPage = 1;
|
|
|
+ this.getData();
|
|
|
+ },
|
|
|
+ deleteRow(row) {
|
|
|
+ this.$alert('删除将无法恢复,确认要删除么?', '警告', {
|
|
|
+ type: 'error',
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
return this.$http.post({
|
|
|
url: '/orderService/del',
|
|
|
- data: {id: row.id}
|
|
|
- })
|
|
|
- }).then(() => {
|
|
|
+ data: { id: row.id },
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
this.$message.success('删除成功');
|
|
|
this.getData();
|
|
|
- }).catch(action => {
|
|
|
+ })
|
|
|
+ .catch(action => {
|
|
|
if (action === 'cancel') {
|
|
|
this.$message.info('删除取消');
|
|
|
} else {
|
|
|
this.$message.error('删除失败');
|
|
|
}
|
|
|
- })
|
|
|
- },
|
|
|
- DateTimeFormatter(row, column, cellValue) {
|
|
|
- if (cellValue) {
|
|
|
- return format(cellValue, 'YYYY/MM/DD HH:mm', {locale: zh})
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- DateFormatter(row, column, cellValue) {
|
|
|
- if (cellValue) {
|
|
|
- return format(cellValue, 'YYYY/MM/DD', {locale: zh})
|
|
|
+ });
|
|
|
+ },
|
|
|
+ DateTimeFormatter(row, column, cellValue) {
|
|
|
+ if (cellValue) {
|
|
|
+ return format(cellValue, 'YYYY/MM/DD HH:mm', { locale: zh });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ DateFormatter(row, column, cellValue) {
|
|
|
+ if (cellValue) {
|
|
|
+ return format(cellValue, 'YYYY/MM/DD', { locale: zh });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ showImg(img) {
|
|
|
+ this.imgSrc = img;
|
|
|
+ this.imageDialogVisible = true;
|
|
|
+ },
|
|
|
+ TypeFlagFormatter(row, column, cellValue) {
|
|
|
+ var valueStr = '';
|
|
|
+ this.typeFlagOptions.forEach(item => {
|
|
|
+ if (item.value == cellValue) {
|
|
|
+ valueStr = item.label;
|
|
|
}
|
|
|
+ });
|
|
|
|
|
|
- },
|
|
|
- showImg(img) {
|
|
|
- this.imgSrc = img;
|
|
|
- this.imageDialogVisible = true;
|
|
|
- },
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
+ return valueStr;
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
-
|
|
|
</style>
|