|
@@ -0,0 +1,410 @@
|
|
|
+<template>
|
|
|
+ <div id="">
|
|
|
+ <el-dialog
|
|
|
+ :visible.sync="visible"
|
|
|
+ width="1200px"
|
|
|
+ :show-close="false"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :append-to-body="true"
|
|
|
+ @closed="close"
|
|
|
+ >
|
|
|
+ <div slot="title" class="hearders">
|
|
|
+ <div class="leftTitle">详情</div>
|
|
|
+ <div class="rightBoxs">
|
|
|
+ <img
|
|
|
+ src="@/assets/images/Close@2x.png"
|
|
|
+ alt=""
|
|
|
+ @click="visible = false"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="top_box">
|
|
|
+ <div>
|
|
|
+ 订单编号:<span style="margin-right: 14px; color: #007aff">{{
|
|
|
+ orderInfo.handleOrderSn
|
|
|
+ }}</span
|
|
|
+ >订单状态:<span style="margin-right: 14px; color: #007aff">{{
|
|
|
+ getPayStatus(orderInfo.payStatus)
|
|
|
+ }}</span>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-button
|
|
|
+ v-if="shStatus"
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ @click="submit(1)"
|
|
|
+ >审核通过</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="shStatus"
|
|
|
+ size="small"
|
|
|
+ type="warning"
|
|
|
+ @click="submit(2)"
|
|
|
+ >审核不通过</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-main v-loading="loading" style="padding: 20px 0px">
|
|
|
+ <el-descriptions class="margin-top" :column="3" border>
|
|
|
+ <el-descriptions-item label="创建时间">
|
|
|
+ {{ $methodsTools.onlyForma(orderInfo.createTime) }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="通过时间">
|
|
|
+ {{ $methodsTools.onlyForma(orderInfo.payTime) }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="商品类型">
|
|
|
+ {{
|
|
|
+ orderInfo.goodsType == 1
|
|
|
+ ? "课程"
|
|
|
+ : orderInfo.goodsType == 2
|
|
|
+ ? "题库"
|
|
|
+ : ""
|
|
|
+ }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="教育类型">
|
|
|
+ {{ orderInfo.educationName }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="培训项目">
|
|
|
+ {{ orderInfo.projectName + " - " + orderInfo.businessName }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="订购人数">
|
|
|
+ {{ orderInfo.userNum || 0 }}位
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="订购数量">
|
|
|
+ {{ orderInfo.goodsNum || 0 }}个
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="下单金额">
|
|
|
+ ¥{{ orderInfo.orderPrice | formatPrice }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="退款金额">
|
|
|
+ ¥{{ orderInfo.goodsRefund | formatPrice }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="实际金额">
|
|
|
+ ¥{{ orderInfo.payPrice | formatPrice }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="支付方式">
|
|
|
+ {{ orderInfo.payType == 1 ? "微信" : "对公转账" }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="转账凭证">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ v-if="
|
|
|
+ (orderInfo.payStatus == 1 ||
|
|
|
+ orderInfo.payStatus == 2 ||
|
|
|
+ orderInfo.payStatus == -2) && orderInfo.payType == 2
|
|
|
+ "
|
|
|
+ @click="openZZ(orderInfo.handleOrderSn)"
|
|
|
+ >查看</el-button
|
|
|
+ >
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="发票状态">
|
|
|
+ {{ showInvoice(orderInfo.invoiceStatus) }}
|
|
|
+ <span v-if="orderInfo.invoiceUrl"
|
|
|
+ >({{ orderInfo.invoiceUrl.split(",").length }}张)<el-button
|
|
|
+ type="text"
|
|
|
+ @click="downinvoice(orderInfo.invoiceUrl.split(','))"
|
|
|
+ >下载</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="下单备注">
|
|
|
+ {{ orderInfo.companyRemark }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="审核意见">
|
|
|
+ {{ orderInfo.checkReason }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+ </el-main>
|
|
|
+ <el-divider></el-divider>
|
|
|
+ <el-main style="padding: 20px 0px">
|
|
|
+ <el-table
|
|
|
+ max-height="400px"
|
|
|
+ ref="table"
|
|
|
+ size="small"
|
|
|
+ :data="tableData"
|
|
|
+ style="width: 100%"
|
|
|
+ border
|
|
|
+ :header-cell-style="{
|
|
|
+ 'background-color': '#eee',
|
|
|
+ color: '#333',
|
|
|
+ fontSize: '14px',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <el-table-column align="center" type="index" width="50" label="序号">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ v-for="(item, index) in tableSet"
|
|
|
+ :key="index"
|
|
|
+ :label="item.label"
|
|
|
+ :prop="item.prop"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="item.scope == 'progress'">
|
|
|
+ {{ scope.row.stuAllNum + scope.row.recordNum }} /
|
|
|
+ {{ scope.row.secAllNum + scope.row.examNum }}
|
|
|
+ </span>
|
|
|
+ <div v-else-if="item.scope == 'isOptions'">
|
|
|
+ <span v-for="(items, indexs) in item.options" :key="indexs"
|
|
|
+ ><span v-if="items.value == scope.row[item.prop]">{{
|
|
|
+ items.label
|
|
|
+ }}</span></span
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <span v-else-if="item.scope == 'price'">
|
|
|
+ ¥{{ scope.row[item.prop] | formatPrice }}
|
|
|
+ </span>
|
|
|
+ <span v-else>{{ scope.row[item.prop] }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-main>
|
|
|
+ </el-dialog>
|
|
|
+ <public-transfer ref="publicTransfer" />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import publicTransfer from "./publicTransfer.vue";
|
|
|
+export default {
|
|
|
+ components: { publicTransfer },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ loading: false,
|
|
|
+ visible: false,
|
|
|
+ shStatus: false,
|
|
|
+ orderInfo: {},
|
|
|
+ tableData: [],
|
|
|
+ tableSet: [
|
|
|
+ { label: "姓名", prop: "realname" },
|
|
|
+ { label: "年份", prop: "year" },
|
|
|
+ { label: "科目", prop: "subjectNames" },
|
|
|
+ { label: "商品", prop: "goodsName" },
|
|
|
+ { label: "金额", prop: "goodsRealPrice", scope: "price" },
|
|
|
+ { label: "学习进度", scope: "progress" },
|
|
|
+ {
|
|
|
+ label: "退款状态",
|
|
|
+ prop: "refundStatus",
|
|
|
+ scope: "isOptions",
|
|
|
+ options: [
|
|
|
+ { label: "待审核", value: 0 },
|
|
|
+ { label: "已退款", value: 1 },
|
|
|
+ { label: "不通过", value: 2 },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ { label: "退款原因", prop: "refundReason" },
|
|
|
+ { label: "审核意见", prop: "periodReason" },
|
|
|
+ ],
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ openBoxs(sn, shStatus = false) {
|
|
|
+ this.shStatus = shStatus;
|
|
|
+ this.orderInfo = {};
|
|
|
+ this.tableData = [];
|
|
|
+ this.visible = true;
|
|
|
+ this.loading = true;
|
|
|
+ this.$api
|
|
|
+ .orderhandledetail({ handleOrderSn: sn })
|
|
|
+ .then((res) => {
|
|
|
+ this.orderInfo = res.data;
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ this.$api.orderhandlegoodsList({ handleOrderSn: sn }).then((res) => {
|
|
|
+ this.tableData = res.rows || [];
|
|
|
+ });
|
|
|
+ },
|
|
|
+ close() {
|
|
|
+ this.loading = false;
|
|
|
+ },
|
|
|
+ openZZ(sn) {
|
|
|
+ this.$refs.publicTransfer.openBoxs(sn);
|
|
|
+ },
|
|
|
+ showInvoice(i) {
|
|
|
+ var str = "";
|
|
|
+ switch (i) {
|
|
|
+ case 1:
|
|
|
+ str = "待审核";
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ str = "已开票";
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ str = "不通过";
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return str;
|
|
|
+ },
|
|
|
+ downinvoice(ary) {
|
|
|
+ for (let i = 0; i < ary.length; i++) {
|
|
|
+ this.download(this.$tools.splitImgHost(ary[i]));
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //下载
|
|
|
+ download(url, fileName = "") {
|
|
|
+ let xhr = new XMLHttpRequest();
|
|
|
+ xhr.open("get", url, true);
|
|
|
+ xhr.setRequestHeader("Content-Type", `application/pdf`);
|
|
|
+ xhr.responseType = "blob";
|
|
|
+ let that = this;
|
|
|
+ xhr.onload = function () {
|
|
|
+ if (this.status == 200) {
|
|
|
+ //接受二进制文件流
|
|
|
+ var blob = this.response;
|
|
|
+ that.downloadExportFile(blob, fileName);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ xhr.send();
|
|
|
+ },
|
|
|
+
|
|
|
+ downloadExportFile(blob, tagFileName) {
|
|
|
+ let downloadElement = document.createElement("a");
|
|
|
+ let href = "";
|
|
|
+ if (typeof blob == "string") {
|
|
|
+ downloadElement.target = "_blank";
|
|
|
+ } else {
|
|
|
+ href = window.URL.createObjectURL(blob); //创建下载的链接
|
|
|
+ }
|
|
|
+ downloadElement.href = href;
|
|
|
+ downloadElement.download = tagFileName;
|
|
|
+ //下载后文件名
|
|
|
+ document.body.appendChild(downloadElement);
|
|
|
+ downloadElement.click(); //点击下载
|
|
|
+ document.body.removeChild(downloadElement); //下载完成移除元素
|
|
|
+ if (typeof blob != "string") {
|
|
|
+ window.URL.revokeObjectURL(href); //释放掉blob对象
|
|
|
+ }
|
|
|
+ },
|
|
|
+ submit(int) {
|
|
|
+ if (int == 1) {
|
|
|
+ this.$confirm("确定审核通过吗?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$api
|
|
|
+ .orderhandlecheck({
|
|
|
+ orderHandleSn: this.orderInfo.handleOrderSn,
|
|
|
+ checkResult: 1,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ this.visible = false;
|
|
|
+ this.$parent.search();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ }
|
|
|
+ if (int == 2) {
|
|
|
+ this.$prompt("输入不通过原因", "确定审核不通过吗?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ inputPattern: /^.{1,10000}$/,
|
|
|
+ inputErrorMessage: "请输入不通过原因",
|
|
|
+ })
|
|
|
+ .then(({ value }) => {
|
|
|
+ this.$api
|
|
|
+ .orderhandlecheck({
|
|
|
+ orderHandleSn: this.orderInfo.handleOrderSn,
|
|
|
+ checkResult: 2,
|
|
|
+ checkReason: value,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ this.visible = false;
|
|
|
+ this.$parent.search();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getPayStatus(i) {
|
|
|
+ var str = "";
|
|
|
+ switch (i) {
|
|
|
+ case 0:
|
|
|
+ str = "待支付";
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ str = "已支付";
|
|
|
+ break;
|
|
|
+ case -1:
|
|
|
+ str = "已关闭";
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ str = "审核中";
|
|
|
+ break;
|
|
|
+ case -2:
|
|
|
+ str = "不通过";
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return str;
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+/deep/ .el-divider--horizontal {
|
|
|
+ margin: 14px 0px;
|
|
|
+}
|
|
|
+/deep/ .el-dialog {
|
|
|
+ margin-top: 3vh !important;
|
|
|
+ border-radius: 8px !important;
|
|
|
+ .el-dialog__header {
|
|
|
+ padding: 0;
|
|
|
+ .hearders {
|
|
|
+ height: 40px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 0px 18px 0px 20px;
|
|
|
+ border-bottom: 1px solid #e2e2e2;
|
|
|
+ .leftTitle {
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #2f4378;
|
|
|
+ }
|
|
|
+ .rightBoxs {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ img {
|
|
|
+ width: 14px;
|
|
|
+ height: 14px;
|
|
|
+ margin-left: 13px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .el-dialog__footer {
|
|
|
+ padding: 0;
|
|
|
+ .dialog-footer {
|
|
|
+ padding: 0px 40px;
|
|
|
+ height: 70px;
|
|
|
+ border-top: 1px solid #e2e2e2;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-end;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+/deep/.el-button {
|
|
|
+ border-radius: 8px;
|
|
|
+}
|
|
|
+.top_box {
|
|
|
+ font-size: 14px;
|
|
|
+ color: #333;
|
|
|
+ margin: 0px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+}
|
|
|
+</style>
|