|
|
@@ -32,6 +32,19 @@
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="申请时间" prop="applyTime">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="applyTime"
|
|
|
+ size="small"
|
|
|
+ style="width: 220px"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="-"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ @change="handleApplyTimeChange"
|
|
|
+ />
|
|
|
+ </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>
|
|
|
@@ -39,6 +52,17 @@
|
|
|
</el-form>
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="el-icon-download"
|
|
|
+ size="mini"
|
|
|
+ :loading="exportLoading"
|
|
|
+ v-hasPermi="['his:storeOrder:financeAuditList']"
|
|
|
+ @click="handleExport"
|
|
|
+ >导出</el-button>
|
|
|
+ </el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
@@ -72,7 +96,31 @@
|
|
|
<el-table-column label="申请时间" align="center" prop="applyTime" width="160" />
|
|
|
<el-table-column label="审核人" align="center" prop="auditUserName" />
|
|
|
<el-table-column label="审核时间" align="center" prop="auditTime" width="160" />
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="100px">
|
|
|
+ <el-table-column label="物流单号" align="center" prop="deliverySn" width="160" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.deliverySn">{{ scope.row.deliverySn }}</span>
|
|
|
+ <span v-else>-</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="物流状态" align="center" prop="deliveryStatus" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag v-if="scope.row.deliveryStatus != null" :options="deliveryStatusOptions" :value="scope.row.deliveryStatus" />
|
|
|
+ <span v-else>-</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="物流公司" align="center" prop="deliveryName" width="120" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.deliveryName">{{ scope.row.deliveryName }}</span>
|
|
|
+ <span v-else>-</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="物流跟踪" align="center" prop="deliveryType" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag v-if="scope.row.deliveryType != null" :options="deliveryTypeOptions" :value="scope.row.deliveryType" />
|
|
|
+ <span v-else>-</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="220px">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
@@ -81,6 +129,19 @@
|
|
|
v-if="scope.row.auditStatus === 0"
|
|
|
@click="handleAudit(scope.row)"
|
|
|
>审核</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ v-hasPermi="['his:storeOrder:financeAuditList']"
|
|
|
+ @click="handleView(scope.row)"
|
|
|
+ >查看详情</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ v-hasPermi="['his:storeOrder:financeAuditList']"
|
|
|
+ v-if="scope.row.deliverySn"
|
|
|
+ @click="handleExpress(scope.row)"
|
|
|
+ >查看物流</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -166,11 +227,78 @@
|
|
|
<el-button type="primary" @click="submitAudit">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 订单详情 -->
|
|
|
+ <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="订单类型">
|
|
|
+ <span v-if="detailData.orderType === 0">外部订单</span>
|
|
|
+ <span v-else-if="detailData.orderType === 1">普通订单</span>
|
|
|
+ <span v-else>普通订单</span>
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="应收金额">{{ (detailData.receivablePrice || detailData.totalPrice) ? (detailData.receivablePrice || detailData.totalPrice) + ' 元' : '-' }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="实收金额">{{ detailData.payPrice ? detailData.payPrice + ' 元' : '-' }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="订单状态">
|
|
|
+ <dict-tag v-if="detailData.status != null" :options="statusOptions" :value="detailData.status" />
|
|
|
+ <span v-else>-</span>
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="收货人">{{ detailData.userName || detailData.realName || '-' }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="收货人电话">{{ detailData.userPhone || '-' }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="收货地址">{{ detailData.userAddress || '-' }}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="支付方式">
|
|
|
+ <dict-tag v-if="detailData.payType" :options="payTypeOptions" :value="detailData.payType" />
|
|
|
+ <span v-else>-</span>
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="创建时间">{{ detailData.externalCreateTime || detailData.createTime || '-' }}</el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+ <el-divider v-if="detailData && detailData.productList && detailData.productList.length > 0" content-position="left">商品信息</el-divider>
|
|
|
+ <el-table v-if="detailData && detailData.productList && detailData.productList.length > 0" border :data="detailData.productList">
|
|
|
+ <el-table-column label="商品名称" align="center" prop="productName">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.productName">{{ scope.row.productName }}</span>
|
|
|
+ <span v-else-if="scope.row.jsonInfo">{{ parseProductName(scope.row.jsonInfo) }}</span>
|
|
|
+ <span v-else>-</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="商品价格" align="center" prop="price">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.price != null">{{ scope.row.price }}</span>
|
|
|
+ <span v-else>-</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="数量" align="center" prop="num" />
|
|
|
+ <el-table-column label="小计" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.price != null && scope.row.num != null">{{ (scope.row.price * scope.row.num).toFixed(2) }}</span>
|
|
|
+ <span v-else>-</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 物流轨迹 -->
|
|
|
+ <el-dialog :title="'物流轨迹 - ' + expressOrderCode" :visible.sync="expressOpen" width="700px" append-to-body>
|
|
|
+ <div style="margin-bottom: 10px;">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="primary"
|
|
|
+ v-hasPermi="['his:storeOrder:financeAuditList']"
|
|
|
+ @click="handleSyncExpress"
|
|
|
+ v-if="expressRow && expressRow.deliverySn"
|
|
|
+ >同步物流状态</el-button>
|
|
|
+ </div>
|
|
|
+ <el-table style="width: 100%" :data="traces" border v-loading="expressLoading">
|
|
|
+ <el-table-column label="操作时间" width="160" align="center" prop="AcceptTime" />
|
|
|
+ <el-table-column label="位置" align="center" prop="Location" />
|
|
|
+ <el-table-column label="描述" align="center" prop="AcceptStation" />
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {financeAuditList, financeAudit} from "@/api/store/storeOrder";
|
|
|
+import {financeAuditList, financeAudit, financeAuditDetail, financeAuditExpress, financeAuditSyncExpress, financeAuditExport} from "@/api/store/storeOrder";
|
|
|
|
|
|
export default {
|
|
|
name: "Order",
|
|
|
@@ -207,11 +335,36 @@ export default {
|
|
|
auditStatus: [
|
|
|
{ required: true, message: "请选择审核结果", trigger: "change" }
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
+ detailOpen: false,
|
|
|
+ detailData: null,
|
|
|
+ expressOpen: false,
|
|
|
+ expressOrderCode: '',
|
|
|
+ expressRow: null,
|
|
|
+ expressLoading: false,
|
|
|
+ traces: [],
|
|
|
+ applyTime: [],
|
|
|
+ exportLoading: false,
|
|
|
+ statusOptions: [],
|
|
|
+ deliveryStatusOptions: [],
|
|
|
+ deliveryTypeOptions: [],
|
|
|
+ payTypeOptions: []
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.getList();
|
|
|
+ this.getDicts("sys_order_status").then(response => {
|
|
|
+ this.statusOptions = response.data;
|
|
|
+ });
|
|
|
+ this.getDicts("sys_store_order_delivery_status").then(response => {
|
|
|
+ this.deliveryStatusOptions = response.data;
|
|
|
+ });
|
|
|
+ this.getDicts("sys_delivery_type").then(response => {
|
|
|
+ this.deliveryTypeOptions = response.data;
|
|
|
+ });
|
|
|
+ this.getDicts("sys_package_pay_type").then(response => {
|
|
|
+ this.payTypeOptions = response.data;
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
getList() {
|
|
|
@@ -258,14 +411,93 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ handleView(row) {
|
|
|
+ financeAuditDetail(row.orderId, row.orderType).then(response => {
|
|
|
+ this.detailData = response.data;
|
|
|
+ this.detailData.orderType = row.orderType;
|
|
|
+ this.detailOpen = true;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ handleExpress(row) {
|
|
|
+ this.expressOrderCode = row.orderCode;
|
|
|
+ this.expressRow = row;
|
|
|
+ this.expressOpen = true;
|
|
|
+ this.expressLoading = true;
|
|
|
+ this.traces = [];
|
|
|
+ financeAuditExpress(row.orderId, row.orderType).then(response => {
|
|
|
+ const express = response.data;
|
|
|
+ if (express != null && express.Traces != null) {
|
|
|
+ this.traces = express.Traces;
|
|
|
+ }
|
|
|
+ this.expressLoading = false;
|
|
|
+ }).catch(() => {
|
|
|
+ this.expressLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
handleQuery() {
|
|
|
this.queryParams.pageNum = 1;
|
|
|
this.getList();
|
|
|
},
|
|
|
|
|
|
+ handleApplyTimeChange(val) {
|
|
|
+ if (val) {
|
|
|
+ this.queryParams.sApplyTime = val[0];
|
|
|
+ this.queryParams.eApplyTime = val[1];
|
|
|
+ } else {
|
|
|
+ this.queryParams.sApplyTime = null;
|
|
|
+ this.queryParams.eApplyTime = null;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ handleExport() {
|
|
|
+ this.$confirm("是否确认导出财务审核数据?", "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.exportLoading = true;
|
|
|
+ return financeAuditExport(this.queryParams);
|
|
|
+ }).then(response => {
|
|
|
+ this.download(response.msg);
|
|
|
+ this.exportLoading = false;
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
+
|
|
|
+ handleSyncExpress() {
|
|
|
+ if (!this.expressRow || !this.expressRow.orderId) {
|
|
|
+ this.msgError("订单信息缺失");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$confirm("确定同步物流状态吗?", "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ return financeAuditSyncExpress(this.expressRow.orderId, this.expressRow.orderType);
|
|
|
+ }).then(() => {
|
|
|
+ this.msgSuccess("同步成功");
|
|
|
+ this.expressOpen = false;
|
|
|
+ this.getList();
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
+
|
|
|
resetQuery() {
|
|
|
+ this.applyTime = [];
|
|
|
+ this.queryParams.sApplyTime = null;
|
|
|
+ this.queryParams.eApplyTime = null;
|
|
|
this.resetForm("queryForm");
|
|
|
this.handleQuery();
|
|
|
+ },
|
|
|
+
|
|
|
+ parseProductName(jsonInfo) {
|
|
|
+ try {
|
|
|
+ const obj = typeof jsonInfo === 'string' ? JSON.parse(jsonInfo) : jsonInfo;
|
|
|
+ return obj.productName || obj.name || obj.title || '-';
|
|
|
+ } catch (e) {
|
|
|
+ return '-';
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
};
|