<template>
|
<div class="app-container">
|
<el-form :model="queryParams" ref="queryRef" v-show="showSearch" :inline="true">
|
<el-form-item label="购买人" prop="buyName">
|
<el-input v-model="queryParams.buyName" placeholder="请输入购买人名称" clearable style="width: 200px"></el-input>
|
</el-form-item>
|
<el-form-item label="订单号" prop="orderNo">
|
<el-input v-model="queryParams.orderNo" placeholder="请输入订单号" clearable style="width: 200px"></el-input>
|
</el-form-item>
|
<!-- <el-form-item label="支付方式" prop="payType">
|
<el-select v-model="queryParams.payType" placeholder="支付方式" clearable style="width: 200px">
|
<el-option v-for="dict in pay_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
</el-select>
|
</el-form-item> -->
|
<!-- <el-form-item label="审核状态" prop="checkState">
|
<el-select v-model="queryParams.checkState" placeholder="审核状态" clearable style="width: 200px">
|
<el-option v-for="dict in check_state" :key="dict.value" :label="dict.label" :value="dict.value" />
|
</el-select>
|
</el-form-item> -->
|
<el-form-item>
|
<el-button type="primary" icon="Search" @click="getDataList">搜索</el-button>
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
</el-form-item>
|
</el-form>
|
<el-row :gutter="10" class="mb8">
|
<!-- <el-col :span="1.5">
|
<el-button type="primary" plain :disabled="power.add" @click="handleRate">解冻</el-button>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button type="warning" plain icon="Download" @click="handleExport">导出</el-button>
|
</el-col> -->
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getDataList"></right-toolbar>
|
</el-row>
|
<el-table v-loading="tableOption.loading" :data="dataTable" @cell-dblclick="handleInfo">
|
<el-table-column type="index" width="50" />
|
<el-table-column label="购买人" align="center" key="buyName" prop="buyName" />
|
<el-table-column label="订单号" align="center" key="orderNo" prop="orderNo" />
|
<el-table-column label="类型" align="center">
|
<template #default="scope">
|
<span>{{ dispOrderType(scope.row.orderType) }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="订单金额" align="center" key="orderMoney" prop="orderMoney" />
|
<el-table-column label="支付方式" align="center">
|
<template #default="scope">
|
<span>{{ dispPayType(scope.row.payType) }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="支付金额" align="center" key="payMoney" prop="payMoney" />
|
<el-table-column label="审核状态" align="center">
|
<template #default="scope">
|
<span>{{ dispCheckState(scope.row.checkState) }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="创建时间" align="center" key="addTime" prop="addTime" />
|
<el-table-column label="操作" align="center" width="120">
|
<template #default="scope">
|
<el-button type="primary" size="small" @click="handleCheck(scope.row)">审核</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getDataList" />
|
<el-dialog title="订单详情" v-model="isOpenInfo" width="1000px" draggable :close-on-click-modal="false">
|
<el-descriptions :column="3">
|
<el-descriptions-item label="订单号">{{ dataInfo.orderNo }}</el-descriptions-item>
|
<el-descriptions-item label="订单类型">{{ dispOrderType(dataInfo.orderType) }}</el-descriptions-item>
|
<el-descriptions-item label="订单金额">{{ dataInfo.orderMoney }}</el-descriptions-item>
|
<el-descriptions-item label="创建时间">{{ dataInfo.addTime }}</el-descriptions-item>
|
<el-descriptions-item label="支付时间">{{ dataInfo.payTime }}</el-descriptions-item>
|
<el-descriptions-item label="购买人">{{ dataInfo.buyName }}</el-descriptions-item>
|
<el-descriptions-item label="支付方式">{{ dispPayType(dataInfo.payType) }}</el-descriptions-item>
|
<el-descriptions-item label="支付金额">{{ dataInfo.payMoney }}</el-descriptions-item>
|
<el-descriptions-item label="审核状态">{{ dispCheckState(dataInfo.checkState) }}</el-descriptions-item>
|
<el-descriptions-item label="审核时间" v-if="dataInfo.checkState == '3' || dataInfo.checkState == '4'">{{ dataInfo.checkTime }}</el-descriptions-item>
|
<el-descriptions-item label="审核备注" v-if="dataInfo.checkState == '3' || dataInfo.checkState == '4'">{{ dataInfo.checkRemark }}</el-descriptions-item>
|
</el-descriptions>
|
<el-row v-if="dataInfo.payType == '3' || dataInfo.payType == '4'">
|
<el-col :span="2">支付凭证</el-col>
|
<el-col :span="20">
|
<div style="display: flex">
|
<ImagePreview :src="dataInfo.payImg" width="60px" height="60px"></ImagePreview>
|
</div>
|
</el-col>
|
</el-row>
|
</el-dialog>
|
<!-- 审核-->
|
<el-dialog title="审核" :close-on-click-modal="false" v-model="isOpenRate" width="400px" top="20vh" draggable>
|
<el-row class="_cu_row">
|
<el-col :span="3"> 审核 </el-col>
|
<el-col :span="18" :offset="1">
|
<el-radio-group v-model="formData.type">
|
<el-radio :label="1">通过</el-radio>
|
<el-radio :label="2">拒绝</el-radio>
|
</el-radio-group>
|
</el-col>
|
</el-row>
|
<el-row class="_cu_row">
|
<el-col :span="3"> 备注 </el-col>
|
<el-col :span="18" :offset="1">
|
<el-input v-model="formData.checkRemark" type="textarea" :row="2" resize="none" clearable placeholder="备注" style="width: 250px" />
|
</el-col>
|
</el-row>
|
<template #footer>
|
<el-button @click="state.isOpenRate = false">取消</el-button>
|
<el-button type="primary" @click="sumbitCheckOrder()"> 提交 </el-button>
|
</template>
|
</el-dialog>
|
</div>
|
</template>
|
<script setup lang="ts">
|
import { reactive, onMounted, toRefs, ref, getCurrentInstance } from "vue";
|
import { GetDataList, GetDataInfo } from "@/api/orders/index";
|
import { checkOrder } from "@/api/check";
|
import type { FormInstance } from "element-plus";
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { order_type, check_state, pay_type } = proxy.useDict("order_type", "check_state", "pay_type");
|
const state = reactive({
|
dataTable: [] as any[], //数据列表
|
total: 0, //总条数
|
tableOption: {
|
//表格配置
|
loading: true,
|
},
|
power: {
|
//操作权限
|
add: false,
|
single: false, //
|
multiple: true, //
|
},
|
dataInfo: {} as any, //数据详情
|
showSearch: true, //是否显示分类
|
isOpenInfo: false,
|
isOpenRate: false,
|
});
|
const { dataTable, total, tableOption, power, showSearch, isOpenRate, isOpenInfo, dataInfo } = toRefs(state);
|
|
onMounted(() => {
|
getDataList();
|
});
|
|
//#region commonDisp
|
/**
|
* 订单类型
|
* @param e
|
*/
|
const dispOrderType = (e: string) => {
|
let stt = order_type.value.find((f: Dict.dictType) => f.value == e);
|
return stt ? stt.label : "";
|
};
|
|
/**
|
* 审核状态
|
* @param e
|
*/
|
const dispCheckState = (e: string) => {
|
let stt = check_state.value.find((f: Dict.dictType) => f.value == e);
|
return stt ? stt.label : "";
|
};
|
|
/**
|
* 支付方式
|
* @param e
|
*/
|
const dispPayType = (e: string) => {
|
let stt = pay_type.value.find((f: Dict.dictType) => f.value == e);
|
return stt ? stt.label : "";
|
};
|
|
//#endregion
|
|
//#region 查询
|
|
const queryRef = ref<FormInstance>();
|
const queryParams = reactive({
|
//查询配置参数
|
pageNum: 1,
|
pageSize: 10,
|
buyName: "", //购买人
|
payType: "3", //支付方式
|
orderNo: "", //订单号
|
checkState: "1", //审核状态
|
});
|
/**
|
* 获取数据列表
|
*/
|
const getDataList = async () => {
|
// if (queryParams.shopState == 0) queryParams.shopState = "";
|
await GetDataList(queryParams).then((res) => {
|
if (res.code == 200) {
|
state.dataTable = res.rows;
|
state.total = res.total;
|
state.tableOption.loading = false;
|
}
|
});
|
};
|
|
/**
|
* 重置
|
*/
|
const resetQuery = () => {
|
queryRef.value!.resetFields();
|
};
|
|
//#endregion
|
|
//#region 详情
|
|
/**
|
* 查看详情
|
*/
|
const handleInfo = (e: any) => {
|
getDataInfo(e.id, () => {
|
state.isOpenInfo = true;
|
});
|
};
|
|
/**
|
* 查看详情
|
*/
|
const getDataInfo = (e: number, f: () => void) => {
|
GetDataInfo(e).then((res) => {
|
if (res.code == 200) {
|
state.dataInfo = res.data;
|
f();
|
}
|
});
|
};
|
//#endregion
|
|
//#region 审核
|
|
const formData = reactive({
|
type: 1, // 类型:1通过,2拒绝
|
orderNo: "",
|
checkRemark: "",
|
});
|
|
/**
|
* 打开审核
|
* @param e
|
*/
|
const handleCheck = (e: any) => {
|
formData.orderNo = e.orderNo;
|
formData.checkRemark = "";
|
formData.type = 1;
|
state.isOpenRate = true;
|
};
|
|
/**
|
* 提交审核的订单
|
*/
|
const sumbitCheckOrder = async () => {
|
await checkOrder(formData).then((res) => {
|
if (res.code == 200) {
|
proxy.$modal.msgSuccess("操作成功");
|
getDataList();
|
state.isOpenRate = false;
|
} else {
|
proxy.$modal.msgError(res.msg);
|
}
|
});
|
};
|
//#endregion
|
</script>
|
|
<style scoped lang="scss">
|
._cu_row {
|
padding: 5px 0px;
|
align-items: center;
|
}
|
.el-table :deep(.danger-row) {
|
--el-table-tr-bg-color: var(--el-color-danger-light-9);
|
}
|
|
// .td {
|
// overflow: hidden;
|
// }
|
// :deep(.el-descriptions__table) {
|
// table-layout: fixed;
|
// }
|
:deep(.el-descriptions__cell) {
|
padding: 8px 0px !important;
|
}
|
// .custom-item-sty {
|
// color: #333;
|
// padding: 8px 0px;
|
// font-weight: bold;
|
// overflow-x: hidden;
|
// }
|
</style>
|