|
|
@@ -0,0 +1,251 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+ <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="userName">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.userName"
|
|
|
+ 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="status">
|
|
|
+ <el-select v-model="queryParams.status" placeholder="状态" clearable size="small">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in statusOptions"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictLabel"
|
|
|
+ :value="dict.dictValue"
|
|
|
+ />
|
|
|
+ </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-table v-loading="loading" border :data="externalOrderList">
|
|
|
+ <el-table-column label="订单编号" align="center" prop="orderCode" />
|
|
|
+ <el-table-column label="销售公司" align="center" prop="companyName" />
|
|
|
+ <el-table-column label="销售账号" align="center" prop="companyUserName" />
|
|
|
+ <el-table-column label="用户名称" align="center" prop="userName" />
|
|
|
+ <el-table-column label="用户电话" align="center" prop="userPhone" />
|
|
|
+ <el-table-column label="商品名称" align="center" prop="productNames" show-overflow-tooltip />
|
|
|
+ <el-table-column label="应收金额" align="center" prop="receivablePrice" />
|
|
|
+ <el-table-column label="实付金额" align="center" prop="payPrice" />
|
|
|
+ <el-table-column label="状态" align="center" prop="statusDesc" />
|
|
|
+ <el-table-column label="提交时间" align="center" prop="externalCreateTime" width="180"/>
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="handleDetail(scope.row)"
|
|
|
+ >详情
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="handleAudit(scope.row)"
|
|
|
+ v-if="scope.row.status === 1"
|
|
|
+ v-hasPermi="['his:externalOrder:audit']"
|
|
|
+ >审核
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ @click="handleCancel(scope.row)"
|
|
|
+ v-if="scope.row.status === 1 || scope.row.status === 2"
|
|
|
+ v-hasPermi="['his:externalOrder:cancel']"
|
|
|
+ >取消
|
|
|
+ </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-drawer
|
|
|
+ :with-header="false"
|
|
|
+ size="60%"
|
|
|
+ :title="drawer.title" :visible.sync="drawer.open">
|
|
|
+ <div class="drawer-content" v-if="detail">
|
|
|
+ <el-descriptions title="订单详情" :column="2" border>
|
|
|
+ <el-descriptions-item label="订单编号">{{ detail.orderCode }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="外部来源">{{ detail.source }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="销售公司">{{ detail.companyName }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="销售账号">{{ detail.companyUserName }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="收货人">{{ detail.userName }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="收货电话">{{ detail.userPhone }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="收货地址" :span="2">{{ detail.userAddress }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="商品总数">{{ detail.totalNum }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="订单总价">{{ detail.totalPrice }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="应收金额">{{ detail.receivablePrice }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="实付金额">{{ detail.payPrice }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="运费">{{ detail.freightPrice }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="支付方式">
|
|
|
+ <span v-if="detail.payType === 1">微信支付</span>
|
|
|
+ <span v-else-if="detail.payType === 2">支付宝</span>
|
|
|
+ <span v-else>{{ detail.payType }}</span>
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="是否支付">
|
|
|
+ <span v-if="detail.isPay === 1">已支付</span>
|
|
|
+ <span v-else>未支付</span>
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="支付时间">{{ detail.payTime }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="快递公司">{{ detail.deliveryName }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="快递单号">{{ detail.deliverySn }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="发货时间">{{ detail.deliveryTime }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="备注" :span="2">{{ detail.remark }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="外部创建时间">{{ detail.externalCreateTime }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="系统创建时间">{{ detail.createTime }}</el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+
|
|
|
+ <el-divider content-position="left">商品明细</el-divider>
|
|
|
+ <el-table :data="detail.productList" border>
|
|
|
+ <el-table-column label="商品图片" align="center" prop="productImage">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-image style="width: 50px; height: 50px" :src="scope.row.productImage" fit="cover"></el-image>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="商品名称" align="center" prop="productName" />
|
|
|
+ <el-table-column label="规格" align="center" prop="productSpec" />
|
|
|
+ <el-table-column label="单价" align="center" prop="price" />
|
|
|
+ <el-table-column label="数量" align="center" prop="num" />
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { listExternalOrder, getExternalOrder, auditExternalOrder, cancelExternalOrder } from "@/api/his/externalOrder";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "ExternalOrder",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ loading: true,
|
|
|
+ showSearch: true,
|
|
|
+ total: 0,
|
|
|
+ externalOrderList: [],
|
|
|
+ statusOptions: [],
|
|
|
+ drawer: {
|
|
|
+ open: false,
|
|
|
+ title: "订单详情"
|
|
|
+ },
|
|
|
+ detail: null,
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ orderCode: null,
|
|
|
+ userName: null,
|
|
|
+ userPhone: null,
|
|
|
+ status: null
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.statusOptions = [
|
|
|
+ { dictValue: 1, dictLabel: "待审核" },
|
|
|
+ { dictValue: 2, dictLabel: "待发货" },
|
|
|
+ { dictValue: 3, dictLabel: "待收货" },
|
|
|
+ { dictValue: 4, dictLabel: "已完成" },
|
|
|
+ { dictValue: -3, dictLabel: "已取消" }
|
|
|
+ ];
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ listExternalOrder(this.queryParams).then(response => {
|
|
|
+ this.externalOrderList = response.rows;
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ resetQuery() {
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ handleDetail(row) {
|
|
|
+ this.drawer.open = true;
|
|
|
+ getExternalOrder(row.orderId).then(response => {
|
|
|
+ this.detail = response.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleAudit(row) {
|
|
|
+ this.$confirm('确认审核通过订单"' + row.orderCode + '"吗?', "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ auditExternalOrder(row.orderId).then(response => {
|
|
|
+ if (response.code === 0) {
|
|
|
+ this.msgSuccess("审核成功");
|
|
|
+ this.getList();
|
|
|
+ } else {
|
|
|
+ this.msgError(response.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
+ handleCancel(row) {
|
|
|
+ this.$confirm('确认取消订单"' + row.orderCode + '"吗?', "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ cancelExternalOrder(row.orderId).then(response => {
|
|
|
+ if (response.code === 0) {
|
|
|
+ this.msgSuccess("取消成功");
|
|
|
+ this.getList();
|
|
|
+ } else {
|
|
|
+ this.msgError(response.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }).catch(() => {});
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.drawer-content {
|
|
|
+ padding: 20px;
|
|
|
+}
|
|
|
+</style>
|