|
|
@@ -1,22 +1,24 @@
|
|
|
<template>
|
|
|
- <div class="list-view">
|
|
|
+ <div class="list-view">
|
|
|
<page-title>
|
|
|
- <el-button @click="addRow" type="primary" icon="el-icon-plus" :disabled="fetchingData || downloading" class="filter-item">
|
|
|
- 新增
|
|
|
- </el-button>
|
|
|
- <el-button @click="download" icon="el-icon-upload2" :loading="downloading" :disabled="fetchingData" class="filter-item">
|
|
|
- 导出
|
|
|
- </el-button>
|
|
|
+ <!-- <el-button @click="addRow" type="primary" icon="el-icon-plus" :disabled="fetchingData || downloading"-->
|
|
|
+ <!-- class="filter-item">-->
|
|
|
+ <!-- 新增-->
|
|
|
+ <!-- </el-button>-->
|
|
|
+ <!-- <el-button @click="download" icon="el-icon-upload2" :loading="downloading" :disabled="fetchingData"-->
|
|
|
+ <!-- class="filter-item">-->
|
|
|
+ <!-- 导出-->
|
|
|
+ <!-- </el-button>-->
|
|
|
</page-title>
|
|
|
<div class="filters-container">
|
|
|
<el-input
|
|
|
- placeholder="搜索..."
|
|
|
- v-model="search"
|
|
|
- clearable
|
|
|
- class="filter-item search"
|
|
|
- @keyup.enter.native="getData"
|
|
|
+ placeholder="搜索..."
|
|
|
+ v-model="search"
|
|
|
+ clearable
|
|
|
+ class="filter-item search"
|
|
|
+ @keyup.enter.native="getData"
|
|
|
>
|
|
|
- <el-button @click="getData" slot="append" icon="el-icon-search"> </el-button>
|
|
|
+ <el-button @click="getData" slot="append" icon="el-icon-search"></el-button>
|
|
|
</el-input>
|
|
|
</div>
|
|
|
<el-table :data="tableData" row-key="id" ref="table"
|
|
|
@@ -29,46 +31,45 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="id" label="ID" width="100">
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="userId" label="用户id"
|
|
|
->
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="userName" label="用户名"
|
|
|
->
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="userAvatar" label="用户头像"
|
|
|
->
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="picName" label="图片名称"
|
|
|
->
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="domainName" label="图片名称"
|
|
|
->
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="status" label="状态"
|
|
|
- :formatter="statusFormatter"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="auditResult" label="审核结果"
|
|
|
->
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="orderStatus" label="orderStatus"
|
|
|
- :formatter="orderStatusFormatter"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="payMethod" label="payMethod"
|
|
|
- :formatter="payMethodFormatter"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="操作"
|
|
|
- align="center"
|
|
|
- fixed="right"
|
|
|
- width="150">
|
|
|
- <template slot-scope="{row}">
|
|
|
- <el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>
|
|
|
- <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button>
|
|
|
- </template>
|
|
|
+ <el-table-column prop="userId" label="用户id"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="userName" label="用户名"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column prop="userAvatar" label="用户头像"-->
|
|
|
+ <!-- >-->
|
|
|
+ <!-- </el-table-column>-->
|
|
|
+ <el-table-column prop="picName" label="域名名称"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="domainName" label="域名(包含后缀)"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="transactionId" label="交易流水号"
|
|
|
+ >
|
|
|
</el-table-column>
|
|
|
+ <el-table-column prop="auditResult" label="审核结果"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="orderStatus" label="订单状态"
|
|
|
+ :formatter="orderStatusFormatter"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="payMethod" label="支付方式"
|
|
|
+ :formatter="payMethodFormatter"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column-->
|
|
|
+ <!-- label="操作"-->
|
|
|
+ <!-- align="center"-->
|
|
|
+ <!-- fixed="right"-->
|
|
|
+ <!-- width="150">-->
|
|
|
+ <!-- <template slot-scope="{row}">-->
|
|
|
+ <!-- <el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>-->
|
|
|
+ <!-- <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button>-->
|
|
|
+ <!-- </template>-->
|
|
|
+ <!-- </el-table-column>-->
|
|
|
</el-table>
|
|
|
<div class="pagination-wrapper">
|
|
|
<!-- <div class="multiple-mode-wrapper">
|
|
|
@@ -90,125 +91,140 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
- import { mapState } from "vuex";
|
|
|
- import pageableTable from "@/mixins/pageableTable";
|
|
|
+import {mapState} from "vuex";
|
|
|
+import pageableTable from "@/mixins/pageableTable";
|
|
|
|
|
|
- export default {
|
|
|
- name: 'DomainOrderList',
|
|
|
- mixins: [pageableTable],
|
|
|
- data() {
|
|
|
- return {
|
|
|
- multipleMode: false,
|
|
|
- search: "",
|
|
|
- url: "/domainOrder/all",
|
|
|
- downloading: false,
|
|
|
- statusOptions:[{"label":"审核中","value":"PENDING"},{"label":"通过","value":"SUCCESS"},{"label":"失败","value":"FAIL"}],
|
|
|
- orderStatusOptions:[{"label":"未支付","value":"NOT_PAID"},{"label":"已支付,处理中","value":"PROCESSING"},{"label":"已完成","value":"FINISH"},{"label":"已取消","value":"CANCELLED"}],
|
|
|
- payMethodOptions:[{"label":"微信","value":"WEIXIN"},{"label":"支付宝","value":"ALIPAY"},{"label":"无GAS费","value":"FREE"},{"label":"衫德支付","value":"SANDPAY"},{"label":"河马支付","value":"HMPAY"},{"label":"首信易","value":"PAYEASE"},{"label":"余额支付","value":"BALANCE"},{"label":"销毁藏品","value":"DESTROY"}],
|
|
|
+export default {
|
|
|
+ name: 'DomainOrderList',
|
|
|
+ mixins: [pageableTable],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ multipleMode: false,
|
|
|
+ search: "",
|
|
|
+ url: "/domainOrder/all",
|
|
|
+ downloading: false,
|
|
|
+ statusOptions: [{"label": "审核中", "value": "PENDING"}, {"label": "通过", "value": "SUCCESS"}, {
|
|
|
+ "label": "失败",
|
|
|
+ "value": "FAIL"
|
|
|
+ }],
|
|
|
+ orderStatusOptions: [{"label": "未支付", "value": "NOT_PAID"}, {
|
|
|
+ "label": "已支付,处理中",
|
|
|
+ "value": "PROCESSING"
|
|
|
+ }, {"label": "已完成", "value": "FINISH"}, {"label": "已取消", "value": "CANCELLED"}],
|
|
|
+ payMethodOptions: [{"label": "微信", "value": "WEIXIN"}, {
|
|
|
+ "label": "支付宝",
|
|
|
+ "value": "ALIPAY"
|
|
|
+ }, {"label": "无GAS费", "value": "FREE"}, {"label": "衫德支付", "value": "SANDPAY"}, {
|
|
|
+ "label": "河马支付",
|
|
|
+ "value": "HMPAY"
|
|
|
+ }, {"label": "首信易", "value": "PAYEASE"}, {"label": "余额支付", "value": "BALANCE"}, {
|
|
|
+ "label": "销毁藏品",
|
|
|
+ "value": "DESTROY"
|
|
|
+ }],
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ selection() {
|
|
|
+ return this.$refs.table.selection.map(i => i.id);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ statusFormatter(row, column, cellValue, index) {
|
|
|
+ let selectedOption = this.statusOptions.find(i => i.value === cellValue);
|
|
|
+ if (selectedOption) {
|
|
|
+ return selectedOption.label;
|
|
|
+ }
|
|
|
+ return '';
|
|
|
+ },
|
|
|
+ orderStatusFormatter(row, column, cellValue, index) {
|
|
|
+ let selectedOption = this.orderStatusOptions.find(i => i.value === cellValue);
|
|
|
+ if (selectedOption) {
|
|
|
+ return selectedOption.label;
|
|
|
}
|
|
|
+ return '';
|
|
|
},
|
|
|
- computed: {
|
|
|
- selection() {
|
|
|
- return this.$refs.table.selection.map(i => i.id);
|
|
|
+ payMethodFormatter(row, column, cellValue, index) {
|
|
|
+ let selectedOption = this.payMethodOptions.find(i => i.value === cellValue);
|
|
|
+ if (selectedOption) {
|
|
|
+ return selectedOption.label;
|
|
|
}
|
|
|
+ return '';
|
|
|
+ },
|
|
|
+ beforeGetData() {
|
|
|
+ return {search: this.search, query: {orderStatus: 'FINISH', del: false}};
|
|
|
},
|
|
|
- methods: {
|
|
|
- statusFormatter(row, column, cellValue, index) {
|
|
|
- let selectedOption = this.statusOptions.find(i => i.value === cellValue);
|
|
|
- if (selectedOption) {
|
|
|
- return selectedOption.label;
|
|
|
- }
|
|
|
- return '';
|
|
|
- },
|
|
|
- orderStatusFormatter(row, column, cellValue, index) {
|
|
|
- let selectedOption = this.orderStatusOptions.find(i => i.value === cellValue);
|
|
|
- if (selectedOption) {
|
|
|
- return selectedOption.label;
|
|
|
- }
|
|
|
- return '';
|
|
|
- },
|
|
|
- payMethodFormatter(row, column, cellValue, index) {
|
|
|
- let selectedOption = this.payMethodOptions.find(i => i.value === cellValue);
|
|
|
- if (selectedOption) {
|
|
|
- return selectedOption.label;
|
|
|
- }
|
|
|
- return '';
|
|
|
- },
|
|
|
- beforeGetData() {
|
|
|
- return { search: this.search, query: { del: false } };
|
|
|
- },
|
|
|
- toggleMultipleMode(multipleMode) {
|
|
|
- this.multipleMode = multipleMode;
|
|
|
- if (!multipleMode) {
|
|
|
- this.$refs.table.clearSelection();
|
|
|
+ toggleMultipleMode(multipleMode) {
|
|
|
+ this.multipleMode = multipleMode;
|
|
|
+ if (!multipleMode) {
|
|
|
+ this.$refs.table.clearSelection();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ addRow() {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/domainOrderEdit",
|
|
|
+ query: {
|
|
|
+ ...this.$route.query
|
|
|
}
|
|
|
- },
|
|
|
- addRow() {
|
|
|
- this.$router.push({
|
|
|
- path: "/domainOrderEdit",
|
|
|
- query: {
|
|
|
- ...this.$route.query
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- editRow(row) {
|
|
|
- this.$router.push({
|
|
|
- path: "/domainOrderEdit",
|
|
|
- query: {
|
|
|
+ });
|
|
|
+ },
|
|
|
+ editRow(row) {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/domainOrderEdit",
|
|
|
+ query: {
|
|
|
id: row.id
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- download() {
|
|
|
- this.downloading = true;
|
|
|
- this.$axios
|
|
|
- .get("/domainOrder/excel", {
|
|
|
- responseType: "blob",
|
|
|
- params: { size: 10000 }
|
|
|
- })
|
|
|
- .then(res => {
|
|
|
- console.log(res);
|
|
|
- this.downloading = false;
|
|
|
- const downloadUrl = window.URL.createObjectURL(new Blob([res.data]));
|
|
|
- const link = document.createElement("a");
|
|
|
- link.href = downloadUrl;
|
|
|
- link.setAttribute(
|
|
|
- "download",
|
|
|
- res.headers["content-disposition"].split("filename=")[1]
|
|
|
- );
|
|
|
- document.body.appendChild(link);
|
|
|
- link.click();
|
|
|
- link.remove();
|
|
|
- })
|
|
|
- .catch(e => {
|
|
|
- console.log(e);
|
|
|
- this.downloading = false;
|
|
|
- this.$message.error(e.error);
|
|
|
- });
|
|
|
- },
|
|
|
- operation1() {
|
|
|
- this.$notify({
|
|
|
- title: '提示',
|
|
|
- message: this.selection
|
|
|
- });
|
|
|
- },
|
|
|
- operation2() {
|
|
|
- this.$message('操作2');
|
|
|
- },
|
|
|
- deleteRow(row) {
|
|
|
- this.$alert('删除将无法恢复,确认要删除么?', '警告', {type: 'error'}).then(() => {
|
|
|
- return this.$http.post(`/domainOrder/del/${row.id}`)
|
|
|
- }).then(() => {
|
|
|
- this.$message.success('删除成功');
|
|
|
- this.getData();
|
|
|
- }).catch(e => {
|
|
|
- if (e !== 'cancel') {
|
|
|
- this.$message.error(e.error);
|
|
|
- }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ download() {
|
|
|
+ this.downloading = true;
|
|
|
+ this.$axios
|
|
|
+ .get("/domainOrder/excel", {
|
|
|
+ responseType: "blob",
|
|
|
+ params: {size: 10000}
|
|
|
})
|
|
|
- },
|
|
|
- }
|
|
|
+ .then(res => {
|
|
|
+ console.log(res);
|
|
|
+ this.downloading = false;
|
|
|
+ const downloadUrl = window.URL.createObjectURL(new Blob([res.data]));
|
|
|
+ const link = document.createElement("a");
|
|
|
+ link.href = downloadUrl;
|
|
|
+ link.setAttribute(
|
|
|
+ "download",
|
|
|
+ res.headers["content-disposition"].split("filename=")[1]
|
|
|
+ );
|
|
|
+ document.body.appendChild(link);
|
|
|
+ link.click();
|
|
|
+ link.remove();
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ this.downloading = false;
|
|
|
+ this.$message.error(e.error);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ operation1() {
|
|
|
+ this.$notify({
|
|
|
+ title: '提示',
|
|
|
+ message: this.selection
|
|
|
+ });
|
|
|
+ },
|
|
|
+ operation2() {
|
|
|
+ this.$message('操作2');
|
|
|
+ },
|
|
|
+ deleteRow(row) {
|
|
|
+ this.$alert('删除将无法恢复,确认要删除么?', '警告', {type: 'error'}).then(() => {
|
|
|
+ return this.$http.post(`/domainOrder/del/${row.id}`)
|
|
|
+ }).then(() => {
|
|
|
+ this.$message.success('删除成功');
|
|
|
+ this.getData();
|
|
|
+ }).catch(e => {
|
|
|
+ if (e !== 'cancel') {
|
|
|
+ this.$message.error(e.error);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
+}
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
</style>
|