Jelajahi Sumber

付款码订单

suochencheng 6 tahun lalu
induk
melakukan
ba9df25fa3

+ 23 - 0
src/main/java/com/izouma/awesomeadmin/constant/AppConstant.java

@@ -588,5 +588,28 @@ public interface AppConstant {
 
     }
 
+    public interface PayCodeOrderStatus {
+
+        /**
+         * 待支付
+         */
+        int wait_pay = 0;
+        /**
+         * 成功
+         */
+        int success = 1;
+
+        /**
+         * 取消
+         */
+        int cancel = 2;
+
+        /**
+         * 退款
+         */
+        int refund = 3;
+
+
+    }
 
 }

+ 4 - 0
src/main/java/com/izouma/awesomeadmin/service/PayCodeOrderService.java

@@ -27,5 +27,9 @@ public interface PayCodeOrderService{
 
     /*generatedEnd*/
     Result submit(PayCodeOrder record);
+
+    Result pay(PayCodeOrder record);
+
+    Result cancel(PayCodeOrder record);
 }
 

+ 81 - 1
src/main/java/com/izouma/awesomeadmin/service/impl/PayCodeOrderServiceImpl.java

@@ -4,7 +4,9 @@ import java.util.*;
 
 import com.izouma.awesomeadmin.dao.PayCodeStockMapper;
 import com.izouma.awesomeadmin.dto.Result;
+import com.izouma.awesomeadmin.model.MemberTicket;
 import com.izouma.awesomeadmin.model.PayCodeStock;
+import com.izouma.awesomeadmin.service.MemberTicketService;
 import com.izouma.awesomeadmin.util.MbappUtil;
 import org.apache.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -26,10 +28,15 @@ public class PayCodeOrderServiceImpl implements PayCodeOrderService {
     @Autowired
     private PayCodeOrderMapper payCodeOrderMapper;
     /*generatedEnd*/
-    /*generatedStart*/
+
     @Autowired
     private PayCodeStockMapper payCodeStockMapper;
 
+    @Autowired
+    private MemberTicketService memberTicketService;
+
+    /*generatedStart*/
+
     @Override
     public List<PayCodeOrder> getPayCodeOrderList(PayCodeOrder record) {
         logger.info("getPayCodeOrderList");
@@ -162,5 +169,78 @@ public class PayCodeOrderServiceImpl implements PayCodeOrderService {
         }
         return new Result(false, "下单失败");
     }
+
+    @Override
+    public Result pay(PayCodeOrder record) {
+        logger.info("pay 付款码付款");
+        try {
+
+            PayCodeOrder payCodeOrder = payCodeOrderMapper.selectByPrimaryKey(record.getId());
+
+            if (payCodeOrder == null) {
+                return new Result(false, "订单不存在");
+            }
+            if (payCodeOrder.getMoney().compareTo(record.getPayMoney()) > 0) {
+                return new Result(false, "支付金额小于订单金额");
+            }
+            if (payCodeOrder.getStatusFlag() != AppConstant.PayCodeOrderStatus.wait_pay) {
+                return new Result(false, "订单状态不能付款");
+            }
+
+            MemberTicket memberTicket = new MemberTicket();
+            memberTicket.setMoney(record.getPayMoney());
+            memberTicket.setUserId(payCodeOrder.getUserId());
+            memberTicket.setRemark("充值" + record.getPayMoney() + " 门票");
+            memberTicket.setRechargeType(AppConstant.RechargeType.OTHER);
+
+            memberTicketService.recharge(memberTicket);
+
+            record.setStatusFlag(AppConstant.PayCodeOrderStatus.success);
+
+            payCodeOrderMapper.updateByPrimaryKeySelective(record);
+
+            return new Result(true, "付款成功");
+
+        } catch (Exception e) {
+            logger.error("pay", e);
+        }
+        return new Result(false, "付款失败");
+    }
+
+    @Override
+    public Result cancel(PayCodeOrder record) {
+        logger.info("cancel 付款码取消");
+        try {
+
+            PayCodeOrder payCodeOrder = payCodeOrderMapper.selectByPrimaryKey(record.getId());
+
+            if (payCodeOrder == null) {
+                return new Result(false, "订单不存在");
+            }
+            if (payCodeOrder.getStatusFlag() != AppConstant.PayCodeOrderStatus.wait_pay) {
+                return new Result(false, "订单状态不能取消");
+            }
+
+            record.setStatusFlag(AppConstant.PayCodeOrderStatus.cancel);
+
+            payCodeOrderMapper.updateByPrimaryKeySelective(record);
+
+
+            PayCodeStock payCodeStock = new PayCodeStock();
+            payCodeStock.setId(record.getStockId());
+            payCodeStock = payCodeStockMapper.queryPayCodeStock(payCodeStock);
+            if (payCodeStock != null) {
+                payCodeStock.setAmount(payCodeStock.getAmount() + 1);
+                payCodeStockMapper.updateByPrimaryKeySelective(payCodeStock);
+            }
+
+
+            return new Result(true, "付款码取消成功");
+
+        } catch (Exception e) {
+            logger.error("cancel 付款码取消", e);
+        }
+        return new Result(false, "付款码取消失败");
+    }
 }
 

+ 12 - 0
src/main/java/com/izouma/awesomeadmin/web/PayCodeOrderController.java

@@ -136,5 +136,17 @@ public class PayCodeOrderController {
         return payCodeOrderService.submit(record);
     }
 
+    @RequestMapping(value = "/pay", method = RequestMethod.POST)
+    @ResponseBody
+    public Result pay(PayCodeOrder record) {
+        return payCodeOrderService.pay(record);
+    }
+
+    @RequestMapping(value = "/cancel", method = RequestMethod.POST)
+    @ResponseBody
+    public Result cancel(PayCodeOrder record) {
+        return payCodeOrderService.cancel(record);
+    }
+
 }
 

+ 630 - 406
src/main/vue/src/pages/PayCodeOrders.vue

@@ -1,7 +1,17 @@
 <template>
     <div>
         <div class="filters-container">
-        
+
+            <el-select v-model="payType" size="small" clearable filterable placeholder="支付类型" @change="searchData" style="width:120px">
+                <el-option v-for="item in payTypeOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
+            </el-select>
+            <el-select v-model="codeId" size="small" clearable filterable placeholder="付款码" @change="searchData" style="width:120px">
+                <el-option v-for="item in payCodeOptions" :key="item.id" :label="item.codeName" :value="item.id"></el-option>
+            </el-select>
+            <el-select v-model="stockId" size="small" clearable filterable placeholder="库存" @change="searchData" style="width:120px">
+                <el-option v-for="item in payStockOptions" :key="item.id" :label="item.name" :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 +29,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,115 +38,113 @@
             </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('id')"
+                             prop="id"
+                             label="ID"
+                             min-width="100">
+            </el-table-column>
+
+            <el-table-column
+                             v-if="isColumnShow('orderCode')"
+                             prop="orderCode"
+                             label="订单code"
+                             min-width="100">
+            </el-table-column>
+
+            <el-table-column
+                             v-if="isColumnShow('codeId')"
+                             prop="codeId"
+                             label="付款码"
+                             :formatter="PayCodeFormatter"
+                             min-width="100">
+            </el-table-column>
+
+            <el-table-column
+                             v-if="isColumnShow('stockId')"
+                             prop="stockId"
+                             label="库存ID"
+                             :formatter="PayStockFormatter"
+                             min-width="100">
+            </el-table-column>
+
+            <el-table-column
+                             v-if="isColumnShow('payType')"
+                             prop="payType"
+                             label="支付类型"
+                             :formatter="PayTypeFormatter"
+                             min-width="100">
+            </el-table-column>
+
+            <el-table-column
+                             v-if="isColumnShow('money')"
+                             prop="money"
+                             label="金额"
+                             min-width="100">
+            </el-table-column>
+
+            <el-table-column
+                             v-if="isColumnShow('payMoney')"
+                             prop="payMoney"
+                             label="支付金额"
+                             min-width="100">
+            </el-table-column>
+
+            <el-table-column
+                             v-if="isColumnShow('statusFlag')"
+                             prop="statusFlag"
+                             label="状态"
+                             :formatter="StatusFormatter"
+                             min-width="100">
+            </el-table-column>
+
+            <el-table-column
+                             v-if="isColumnShow('payTime')"
+                             prop="payTime"
+                             label="支付时间"
+                             :formatter="DateTimeFormatter"
+                             min-width="100">
+            </el-table-column>
+
             <el-table-column
-                    v-if="multipleMode"
-                    align="center"
-                    type="selection"
-                    width="50">
+                             v-if="isColumnShow('userId')"
+                             prop="userId"
+                             label="用户"
+                             min-width="100">
             </el-table-column>
+
             <el-table-column
-                    type="index"
-                    min-width="50"
-                    align="center">
+                             v-if="isColumnShow('remark')"
+                             prop="remark"
+                             label="备注"
+                             min-width="100">
             </el-table-column>
-                            
-                                            <el-table-column
-                                v-if="isColumnShow('id')"
-                                prop="id"
-                                label="ID"
-                                min-width="100">
-                        </el-table-column>
-                                                                                                                                                                                                            
-                                            <el-table-column
-                                v-if="isColumnShow('orderCode')"
-                                prop="orderCode"
-                                label="订单code"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('typeFlag')"
-                                prop="typeFlag"
-                                label="类型"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('codeId')"
-                                prop="codeId"
-                                label="付款码"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('stockId')"
-                                prop="stockId"
-                                label="库存ID"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('payType')"
-                                prop="payType"
-                                label="支付类型"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('money')"
-                                prop="money"
-                                label="金额"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('payMoney')"
-                                prop="payMoney"
-                                label="支付金额"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('statusFlag')"
-                                prop="statusFlag"
-                                label="状态"
-                                min-width="100">
-                        </el-table-column>
-                                                                
-                                            <el-table-column
-                                v-if="isColumnShow('payTime')"
-                                prop="payTime"
-                                label="支付时间"
-                                :formatter="DateTimeFormatter"
-                                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('remark')"
-                                prop="remark"
-                                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="220">
                 <template slot-scope="scope">
-                                        <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>
+                    <el-button @click="jieSuan(scope.row)" v-if="scope.row.statusFlag==0" type="primary" size="mini" plain>付款</el-button>
+                    <el-button @click="cancel(scope.row)" v-if="scope.row.statusFlag==0" 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>
         </el-table>
@@ -150,14 +158,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">
@@ -249,337 +257,553 @@
             <img width="100%" :src="imgSrc" alt="">
         </el-dialog>
 
+        <el-dialog title="手动付款" :visible.sync="jieSuanShowDialog">
+            <el-form :model="jieSuanRow" label-width="120px">
+                <el-form-item label="实付金额">
+                    <el-input type="Number" v-model="jieSuanRow.payMoney"></el-input>
+                </el-form-item>
+                <el-form-item label="支付时间">
+                    <template>
+                        <div class="block">
+                            <el-date-picker
+                                            v-model="jieSuanRow.payTime"
+                                            type="datetime"
+                                            value-format="timestamp"
+                                            placeholder="选择时间">
+                            </el-date-picker>
+                        </div>
+                    </template>
+                </el-form-item>
+                <el-form-item label="备注">
+                    <el-input v-model="jieSuanRow.remark"></el-input>
+                </el-form-item>
+            </el-form>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="jieSuanShowDialog = false">取 消</el-button>
+                <el-button type="primary" @click="jieSuanSubmit">付款完成</el-button>
+            </span>
+        </el-dialog>
+
     </div>
 </template>
 <script>
-    import {mapState} from 'vuex'
-    import {format} from 'date-fns'
-    import zh from 'date-fns/locale/zh_cn'
-
-    export default {
-        name: 'PayCodeOrders',
-        created() {
+import { mapState } from 'vuex';
+import { format } from 'date-fns';
+import zh from 'date-fns/locale/zh_cn';
+
+export default {
+    name: 'PayCodeOrders',
+    created() {
+        this.getData();
+
+        this.$http
+            .get({
+                url: '/payCodeInfo/all',
+            })
+            .then(res => {
+                if (res.success) {
+                    this.payCodeOptions = res.data;
+                }
+            });
+
+        this.$http
+            .get({
+                url: '/payCodeStock/all',
+            })
+            .then(res => {
+                if (res.success) {
+                    this.payStockOptions = res.data;
+                }
+            });
+    },
+    data() {
+        return {
+            totalNumber: 0,
+            totalPage: 10,
+            currentPage: 1,
+            pageSize: 20,
+            tableData: [],
+            filter1: '',
+            filter2: '',
+            tableColumns: [
+                {
+                    label: 'ID',
+                    value: 'id',
+                    show: true,
+                },
+                {
+                    label: '订单code',
+                    value: 'orderCode',
+                    show: true,
+                },
+                {
+                    label: '类型',
+                    value: 'typeFlag',
+                    show: true,
+                },
+                {
+                    label: '付款码',
+                    value: 'codeId',
+                    show: true,
+                },
+                {
+                    label: '库存ID',
+                    value: 'stockId',
+                    show: true,
+                },
+                {
+                    label: '支付类型',
+                    value: 'payType',
+                    show: true,
+                },
+                {
+                    label: '金额',
+                    value: 'money',
+                    show: true,
+                },
+                {
+                    label: '支付金额',
+                    value: 'payMoney',
+                    show: true,
+                },
+                {
+                    label: '状态',
+                    value: 'statusFlag',
+                    show: true,
+                },
+                {
+                    label: '支付时间',
+                    value: 'payTime',
+                    show: true,
+                },
+                {
+                    label: '用户',
+                    value: 'userId',
+                    show: true,
+                },
+                {
+                    label: '备注',
+                    value: 'remark',
+                    show: true,
+                },
+            ],
+            multipleMode: false,
+            showAdvancedQueryDialog: false,
+            advancedQueryFields: [],
+            showTableSortDialog: false,
+            tableSortFields: [],
+            searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
+            advancedQueryColumns: [
+                {
+                    label: 'ID',
+                    value: 'id',
+                },
+                {
+                    label: '订单code',
+                    value: 'order_code',
+                },
+                {
+                    label: '类型',
+                    value: 'type_flag',
+                },
+                {
+                    label: '付款码',
+                    value: 'code_id',
+                },
+                {
+                    label: '库存ID',
+                    value: 'stock_id',
+                },
+                {
+                    label: '支付类型',
+                    value: 'pay_type',
+                },
+                {
+                    label: '金额',
+                    value: 'money',
+                },
+                {
+                    label: '支付金额',
+                    value: 'pay_money',
+                },
+                {
+                    label: '状态',
+                    value: 'status_flag',
+                },
+                {
+                    label: '支付时间',
+                    value: 'pay_time',
+                },
+                {
+                    label: '用户',
+                    value: 'user_id',
+                },
+                {
+                    label: '备注',
+                    value: 'remark',
+                },
+            ],
+            advancedQuerySearchKey: '',
+            orderByStr: '',
+            imgSrc: '',
+            imageDialogVisible: false,
+            payTypeOptions: [
+                {
+                    value: 'wechat',
+                    label: '微信',
+                },
+                {
+                    value: 'alipay',
+                    label: '支付宝',
+                },
+                {
+                    value: 'cloud_flash',
+                    label: '云闪付',
+                },
+                {
+                    value: 'union_pay',
+                    label: '银联',
+                },
+                {
+                    value: 'wechat_real_time',
+                    label: '微信实时',
+                },
+                {
+                    value: 'taobao',
+                    label: '淘宝',
+                },
+                {
+                    value: 'credit_card',
+                    label: '信用卡',
+                },
+            ],
+            payType: '',
+            codeId: '',
+            payCodeOptions: [],
+            stockId: '',
+            payStockOptions: [],
+            statusOptions: [
+                {
+                    value: 0,
+                    label: '待支付',
+                },
+                {
+                    value: 1,
+                    label: '成功',
+                },
+                {
+                    value: 2,
+                    label: '取消',
+                },
+                {
+                    value: 3,
+                    label: '退款',
+                },
+            ],
+            jieSuanRow: {},
+            jieSuanShowDialog: false,
+        };
+    },
+    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: 'ID',
-                                value: 'id',
-                                show: true
-                            },
-                                                                                                                                                                                                                                                                                                                            {
-                                label: '订单code',
-                                value: 'orderCode',
-                                show: true
-                            },
-                                                                                                {
-                                label: '类型',
-                                value: 'typeFlag',
-                                show: true
-                            },
-                                                                                                {
-                                label: '付款码',
-                                value: 'codeId',
-                                show: true
-                            },
-                                                                                                {
-                                label: '库存ID',
-                                value: 'stockId',
-                                show: true
-                            },
-                                                                                                {
-                                label: '支付类型',
-                                value: 'payType',
-                                show: true
-                            },
-                                                                                                {
-                                label: '金额',
-                                value: 'money',
-                                show: true
-                            },
-                                                                                                {
-                                label: '支付金额',
-                                value: 'payMoney',
-                                show: true
-                            },
-                                                                                                {
-                                label: '状态',
-                                value: 'statusFlag',
-                                show: true
-                            },
-                                                                                                {
-                                label: '支付时间',
-                                value: 'payTime',
-                                show: true
-                            },
-                                                                                                {
-                                label: '用户',
-                                value: 'userId',
-                                show: true
-                            },
-                                                                                                {
-                                label: '备注',
-                                value: 'remark',
-                                show: true
-                            },
-                                                            ],
-                multipleMode: false,
-                showAdvancedQueryDialog: false,
-                advancedQueryFields: [],
-                showTableSortDialog: false,
-                tableSortFields: [],
-                searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
-                advancedQueryColumns: [
-                                                                        {
-                                label: 'ID',
-                                value: 'id'
-                            },
-                                                                                                                                                                                                                                                                                                                            {
-                                label: '订单code',
-                                value: 'order_code'
-                            },
-                                                                                                {
-                                label: '类型',
-                                value: 'type_flag'
-                            },
-                                                                                                {
-                                label: '付款码',
-                                value: 'code_id'
-                            },
-                                                                                                {
-                                label: '库存ID',
-                                value: 'stock_id'
-                            },
-                                                                                                {
-                                label: '支付类型',
-                                value: 'pay_type'
-                            },
-                                                                                                {
-                                label: '金额',
-                                value: 'money'
-                            },
-                                                                                                {
-                                label: '支付金额',
-                                value: 'pay_money'
-                            },
-                                                                                                {
-                                label: '状态',
-                                value: 'status_flag'
-                            },
-                                                                                                {
-                                label: '支付时间',
-                                value: 'pay_time'
-                            },
-                                                                                                {
-                                label: '用户',
-                                value: 'user_id'
-                            },
-                                                                                                {
-                                label: '备注',
-                                value: 'remark'
-                            },
-                                                            ],
-                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,
+                payType: this.payType,
+                codeId: this.codeId,
+                stockId: this.stockId,
+            };
+
+            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: '/payCodeOrder/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: '/payCodeOrder',
-                    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: '/payCodeOrder',
+                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 + "/payCodeOrder/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 +
+                '/payCodeOrder/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: '/payCodeOrder/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('删除失败');
                     }
+                });
+        },
+        cancel(row) {
+            this.$alert('取消将无法恢复,确认要取消么?', '警告', {
+                type: 'error',
+            })
+                .then(() => {
+                    return this.$http.post({
+                        url: '/payCodeOrder/cancel',
+                        data: { id: row.id },
+                    });
+                })
+                .then(() => {
+                    this.$message.success('取消成功');
+                    this.getData();
                 })
-            },
-            DateTimeFormatter(row, column, cellValue) {
-                if (cellValue) {
-                    return format(cellValue, 'YYYY/MM/DD HH:mm', {locale: zh})
+                .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 });
+            }
+        },
+        showImg(img) {
+            this.imgSrc = img;
+            this.imageDialogVisible = true;
+        },
+        PayTypeFormatter(row, column, cellValue) {
+            var valueStr = '';
+            this.payTypeOptions.forEach(item => {
+                if (item.value == cellValue) {
+                    valueStr = item.label;
+                }
+            });
+
+            return valueStr;
+        },
+        PayCodeFormatter(row, column, cellValue) {
+            var valueStr = '';
+            this.payCodeOptions.forEach(item => {
+                if (item.id == cellValue) {
+                    valueStr = item.codeName;
+                }
+            });
+
+            return valueStr;
+        },
+        PayStockFormatter(row, column, cellValue) {
+            var valueStr = '';
+            this.payStockOptions.forEach(item => {
+                if (item.id == cellValue) {
+                    valueStr = item.name;
                 }
+            });
 
-            },
-            DateFormatter(row, column, cellValue) {
-                if (cellValue) {
-                    return format(cellValue, 'YYYY/MM/DD', {locale: zh})
+            return valueStr;
+        },
+        StatusFormatter(row, column, cellValue) {
+            var valueStr = '';
+            this.statusOptions.forEach(item => {
+                if (item.value == cellValue) {
+                    valueStr = item.label;
                 }
+            });
 
-            },
-            showImg(img) {
-                this.imgSrc = img;
-                this.imageDialogVisible = true;
-            },
+            return valueStr;
+        },
+        jieSuan(row) {
+            this.jieSuanRow = row;
+            this.jieSuanRow.remark = '后台管理手动z支付';
+            this.jieSuanRow.payMoney = row.money;
+            this.jieSuanShowDialog = true;
+        },
+        jieSuanSubmit() {
+            if (!this.jieSuanRow.payMoney) {
+                this.$message.warning('请输入付款金额');
+            } else if (!this.jieSuanRow.payTIme) {
+                this.$message.warning('请输入付款时间');
+            } else {
+                this.$http
+                    .post({
+                        url: '/payCodeOrder/pay',
+                        data: {
+                            id: this.jieSuanRow.id,
+                            payMoney: this.jieSuanRow.payMoney,
+                            payTime: this.jieSuanRow.payTime,
+                            remark: this.jieSuanRow.remark,
+                        },
+                    })
+                    .then(res => {
+                        if (res.success) {
+                            this.$message.success('保存成功');
+                            this.getData();
+                        } else {
+                            this.$message.error(res.error);
+                        }
 
-        }
-    }
+                        this.jieSuanRow = {};
+                        this.jieSuanShowDialog = false;
+                    });
+            }
+        },
+    },
+};
 </script>
 <style lang="less" scoped>
-
 </style>