|
|
@@ -24,9 +24,10 @@
|
|
|
:highlight-current-row="false"
|
|
|
style="width: 100%; background: #1c1e26"
|
|
|
>
|
|
|
- <el-table-column prop="payMethod" label="交易类型" width="158"> {{ payMethod }}</el-table-column>
|
|
|
+ <el-table-column prop="payMethod" label="交易类型" width="158" :formatter="statusFormatter">
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="name" label="藏品信息" width="164"> </el-table-column>
|
|
|
- <el-table-column style="color: #fdfb60" prop="store" label="来源" width="130"> </el-table-column>
|
|
|
+ <el-table-column style="color: #fdfb60" prop="source" label="来源" width="130"> </el-table-column>
|
|
|
<el-table-column prop="username" label="去向" width="190"> </el-table-column>
|
|
|
<el-table-column prop="payTime" label="交易时间" width="198"> </el-table-column>
|
|
|
<el-table-column fixed="right" label="操作">
|
|
|
@@ -62,27 +63,29 @@ export default {
|
|
|
tableData: [],
|
|
|
url: '/order/all',
|
|
|
search: '',
|
|
|
- list: []
|
|
|
+ list: [],
|
|
|
+ statusOptions: [
|
|
|
+ { label: '微信', value: 'WEIXIN' },
|
|
|
+ { label: '支付宝', value: 'ALIPAY' }
|
|
|
+ ]
|
|
|
};
|
|
|
},
|
|
|
mixins: [list],
|
|
|
|
|
|
computed: {
|
|
|
- ...mapState(['userInfo']),
|
|
|
- payMethod() {
|
|
|
- return this.tableData.map(item => {
|
|
|
- if (item.payMethod === 'WEIXIN') {
|
|
|
- return '微信';
|
|
|
- } else {
|
|
|
- return '支付宝';
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ ...mapState(['userInfo'])
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getData();
|
|
|
},
|
|
|
methods: {
|
|
|
+ statusFormatter(row, column, cellValue, index) {
|
|
|
+ let selectedOption = this.statusOptions.find(i => i.value === cellValue);
|
|
|
+ if (selectedOption) {
|
|
|
+ return selectedOption.label;
|
|
|
+ }
|
|
|
+ return '';
|
|
|
+ },
|
|
|
beforeData() {
|
|
|
return {
|
|
|
search: this.search,
|
|
|
@@ -98,18 +101,34 @@ export default {
|
|
|
this.$confirm('确定删除该订单吗?', '警告', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '退出',
|
|
|
+ customClass: 'myClass',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
this.$http.get('/order/del' + row.id).then(() => {
|
|
|
- this.getData();
|
|
|
- console.log('删除成功');
|
|
|
+ this.$message.success('删除成功');
|
|
|
+ setTimeout(() => {
|
|
|
+ this.getData();
|
|
|
+ }, 1000);
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
-
|
|
|
+<style lang="less">
|
|
|
+.myClass {
|
|
|
+ .el-button {
|
|
|
+ background: linear-gradient(133deg, @prim 0%, @warn 100%);
|
|
|
+ border-radius: 4px;
|
|
|
+ border: 0;
|
|
|
+ }
|
|
|
+ .el-button:nth-last-child(2) {
|
|
|
+ background: #c4c7cc;
|
|
|
+ color: #ffffff;
|
|
|
+ font-size: 13px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
<style lang="less" scoped>
|
|
|
/deep/ .el-table__header {
|
|
|
background: #1c1e26 !important;
|