|
|
@@ -0,0 +1,262 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="80px">
|
|
|
+ <el-form-item label="订单编号" prop="orderCode">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.orderCode"
|
|
|
+ placeholder="请输入订单编号"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="会员电话" prop="userPhone">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.userPhone"
|
|
|
+ placeholder="请输入会员电话"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="支付状态" prop="isPay">
|
|
|
+ <el-select v-model="queryParams.isPay" placeholder="请选择支付状态" clearable size="small">
|
|
|
+ <el-option label="未支付" :value="0" />
|
|
|
+ <el-option label="已支付" :value="1" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="订单状态" prop="status">
|
|
|
+ <el-select v-model="queryParams.status" placeholder="请选择订单状态" clearable size="small">
|
|
|
+ <el-option
|
|
|
+ v-for="item in statusOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-tabs type="card" v-model="actName" @tab-click="handleClickX">
|
|
|
+ <el-tab-pane label="全部订单" name="10"></el-tab-pane>
|
|
|
+ <el-tab-pane v-for="item in statusOptions" :key="item.value" :label="item.label" :name="String(item.value)"></el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+
|
|
|
+ <el-table v-loading="loading" border :data="guCoinOrderList">
|
|
|
+ <el-table-column label="订单编号" align="center" prop="orderCode" width="200" />
|
|
|
+ <el-table-column label="会员名称" align="center" prop="userName" />
|
|
|
+ <el-table-column label="会员电话" align="center" prop="userPhone" width="120" />
|
|
|
+ <el-table-column label="收货地址" align="center" prop="userAddress" show-overflow-tooltip />
|
|
|
+ <el-table-column label="支付谷币" align="center" prop="guCoin" />
|
|
|
+ <el-table-column label="支付金额" align="center" prop="payMoney">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.payMoney != null">{{ Number(scope.row.payMoney).toFixed(2) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="支付类型" align="center" prop="payType" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ payTypeText(scope.row.payType) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="支付状态" align="center" prop="isPay" width="90">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag :type="scope.row.isPay === 1 ? 'success' : 'info'" size="mini">
|
|
|
+ {{ scope.row.isPay === 1 ? '已支付' : '未支付' }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="订单状态" align="center" prop="status" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag :type="statusTagType(scope.row.status)" size="mini">
|
|
|
+ {{ statusText(scope.row.status) }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="快递名称" align="center" prop="deliveryName" />
|
|
|
+ <el-table-column label="快递单号" align="center" prop="deliverySn" width="160" />
|
|
|
+ <el-table-column label="发货时间" align="center" prop="deliveryTime" width="160" />
|
|
|
+ <el-table-column label="下单时间" align="center" prop="createTime" width="160" />
|
|
|
+ <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="mini" type="text" @click="handleDetail(scope.row)">详情</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 订单详情对话框 -->
|
|
|
+ <el-dialog title="谷币订单详情" :visible.sync="detailOpen" width="800px" append-to-body>
|
|
|
+ <el-descriptions :column="2" border v-if="detailData">
|
|
|
+ <el-descriptions-item label="订单编号">{{ detailData.orderCode }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="订单状态">
|
|
|
+ <el-tag :type="statusTagType(detailData.status)" size="mini">{{ statusText(detailData.status) }}</el-tag>
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="会员名称">{{ detailData.userName }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="会员电话">{{ detailData.userPhone }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="收货地址" :span="2">{{ detailData.userAddress }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="订单总谷币">{{ detailData.totalGuCoin }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="折扣谷币">{{ detailData.discountGuCoin }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="实付谷币">{{ detailData.guCoin }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="订单总金额">{{ detailData.totalMoney }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="折扣金额">{{ detailData.discountMoney }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="实付金额">{{ detailData.payMoney }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="运费">{{ detailData.deliveryMoney }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="支付类型">{{ payTypeText(detailData.payType) }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="支付状态">{{ detailData.isPay === 1 ? '已支付' : '未支付' }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="支付时间">{{ detailData.payTime }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="快递名称">{{ detailData.deliveryName }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="快递单号">{{ detailData.deliverySn }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="发货时间">{{ detailData.deliveryTime }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="下单时间">{{ detailData.createTime }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="销售ID">{{ detailData.companyUserId }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="销售公司ID">{{ detailData.companyId }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="企业微信ID">{{ detailData.qwUserId }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="备注" :span="2">{{ detailData.remark }}</el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+
|
|
|
+ <div style="margin-top: 15px;" v-if="itemList.length > 0">
|
|
|
+ <div style="font-weight: bold; margin-bottom: 8px;">商品明细</div>
|
|
|
+ <el-table border :data="itemList" size="small">
|
|
|
+ <el-table-column label="商品图片" align="center" width="90">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-popover v-if="scope.row.imgUrl" placement="right" title="" trigger="hover">
|
|
|
+ <img slot="reference" :src="scope.row.imgUrl" width="50">
|
|
|
+ <img :src="scope.row.imgUrl" style="max-width: 150px">
|
|
|
+ </el-popover>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="商品名称" align="center" prop="goodsName" show-overflow-tooltip />
|
|
|
+ <el-table-column label="所需谷币" align="center" prop="guCoin" />
|
|
|
+ <el-table-column label="需支付金额" align="center" prop="cash">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.cash != null">{{ Number(scope.row.cash).toFixed(2) }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="数量" align="center" prop="num" />
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="detailOpen = false">关 闭</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { listGuCoinOrder, getGuCoinOrder } from "@/api/hisStore/guCoinOrder";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "GuCoinOrder",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ loading: true,
|
|
|
+ showSearch: true,
|
|
|
+ total: 0,
|
|
|
+ guCoinOrderList: [],
|
|
|
+ detailOpen: false,
|
|
|
+ detailData: null,
|
|
|
+ itemList: [],
|
|
|
+ actName: "10",
|
|
|
+ // 1待发货 2待收货 3已完成 4待支付 -1取消
|
|
|
+ statusOptions: [
|
|
|
+ { value: 4, label: "待支付" },
|
|
|
+ { value: 1, label: "待发货" },
|
|
|
+ { value: 2, label: "待收货" },
|
|
|
+ { value: 3, label: "已完成" },
|
|
|
+ { value: -1, label: "取消" }
|
|
|
+ ],
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ orderCode: null,
|
|
|
+ userPhone: null,
|
|
|
+ status: null,
|
|
|
+ isPay: null
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ listGuCoinOrder(this.queryParams).then(response => {
|
|
|
+ this.guCoinOrderList = response.rows;
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ resetQuery() {
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.actName = "10";
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ handleClickX(tab) {
|
|
|
+ if (tab.name === "10") {
|
|
|
+ this.queryParams.status = null;
|
|
|
+ } else {
|
|
|
+ this.queryParams.status = Number(tab.name);
|
|
|
+ }
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ statusText(status) {
|
|
|
+ const item = this.statusOptions.find(d => d.value === status);
|
|
|
+ return item ? item.label : "未知";
|
|
|
+ },
|
|
|
+ statusTagType(status) {
|
|
|
+ switch (status) {
|
|
|
+ case 4: return "warning";
|
|
|
+ case 1: return "warning";
|
|
|
+ case 2: return "primary";
|
|
|
+ case 3: return "success";
|
|
|
+ case -1: return "info";
|
|
|
+ default: return "info";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ payTypeText(payType) {
|
|
|
+ switch (payType) {
|
|
|
+ case 1: return "谷币";
|
|
|
+ case 2: return "现金";
|
|
|
+ case 3: return "谷币+现金";
|
|
|
+ default: return "-";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleDetail(row) {
|
|
|
+ getGuCoinOrder(row.orderId).then(response => {
|
|
|
+ this.detailData = response.data;
|
|
|
+ this.itemList = [];
|
|
|
+ if (this.detailData && this.detailData.itemJson) {
|
|
|
+ try {
|
|
|
+ this.itemList = JSON.parse(this.detailData.itemJson) || [];
|
|
|
+ } catch (e) {
|
|
|
+ this.itemList = [];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.detailOpen = true;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|