|
|
@@ -106,6 +106,27 @@
|
|
|
|
|
|
</el-table>
|
|
|
</div>
|
|
|
+
|
|
|
+ <!-- 操作记录 -->
|
|
|
+ <div class="contentx" v-if="item != null" style="padding-bottom: 70px;">
|
|
|
+ <div class="desct">
|
|
|
+ 操作记录
|
|
|
+ </div>
|
|
|
+ <el-table :data="orderLogs" border style="width: 100%; margin-top: 20px;" v-loading="logsLoading">
|
|
|
+ <!-- <el-table-column prop="changeType" label="操作类型" align="center" width="120">
|
|
|
+ </el-table-column> -->
|
|
|
+ <el-table-column prop="changeTime" label="操作时间" align="center" width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ parseTime(scope.row.changeTime) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="changeMessage" label="操作备注" align="center">
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column prop="operator" label="操作员" align="center" width="120">
|
|
|
+ </el-table-column> -->
|
|
|
+
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
<el-dialog width="35%" title="发货" :visible.sync="sendVisible" append-to-body @close="sendCancel">
|
|
|
<el-form ref="form" :model="form" label-width="120px">
|
|
|
<el-form-item label="快递名称" prop="deliveryName">
|
|
|
@@ -179,7 +200,10 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<el-dialog :title="expressDialog.title" :visible.sync="expressDialog.open" width="600px" append-to-body>
|
|
|
- <el-table style="margin-top: 20px;width: 100%" ref="orderHistoryTable" :data="traces" border>
|
|
|
+ <div style="margin-bottom: 10px; text-align: right;">
|
|
|
+ <el-button type="primary" size="small" @click="syncExpressInfo" :loading="syncLoading">同步物流信息</el-button>
|
|
|
+ </div>
|
|
|
+ <el-table style="margin-top: 20px;width: 100%" ref="orderHistoryTable" :data="traces" border v-loading="tableLoading">
|
|
|
<el-table-column label="操作时间" width="160" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.row.AcceptTime }}
|
|
|
@@ -345,7 +369,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getExpress,mandatoryRefunds,getCitys,finishOrder, listIntegralOrder, sendgoods, getIntegralOrder, delIntegralOrder, addIntegralOrder, updateIntegralOrder, exportIntegralOrder, getOrderUserPhone } from "@/api/his/integralOrder";
|
|
|
+import { getExpress,mandatoryRefunds,getCitys,finishOrder, listIntegralOrder, sendgoods, getIntegralOrder, delIntegralOrder, addIntegralOrder, updateIntegralOrder, exportIntegralOrder, getOrderUserPhone, getOrderLogs } from "@/api/his/integralOrder";
|
|
|
import { getExpressList } from "@/api/his/express";
|
|
|
import { listAccount } from "@/api/his/dfAccount";
|
|
|
export default {
|
|
|
@@ -429,6 +453,11 @@ export default {
|
|
|
selectedDistrict: null, // 选中的区
|
|
|
detailAddress: '', // 详细地址
|
|
|
deliveryTypeOptions:[],
|
|
|
+ // 操作记录相关数据
|
|
|
+ orderLogs: [], // 订单操作记录
|
|
|
+ logsLoading: false, // 操作记录加载状态
|
|
|
+ syncLoading: false, // 同步物流信息按钮加载状态
|
|
|
+ tableLoading: false // 物流信息表格加载状态
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -726,13 +755,31 @@ export default {
|
|
|
},
|
|
|
showExpress() {
|
|
|
this.expressDialog.open = true;
|
|
|
+ this.loadExpressInfo();
|
|
|
+ },
|
|
|
+ // 加载物流信息
|
|
|
+ loadExpressInfo() {
|
|
|
+ this.tableLoading = true;
|
|
|
getExpress(this.item.orderId).then(response => {
|
|
|
this.express = response.data;
|
|
|
if (this.express != null && this.express.Traces != null) {
|
|
|
this.traces = this.express.Traces
|
|
|
+ } else {
|
|
|
+ this.traces = [];
|
|
|
}
|
|
|
+ this.tableLoading = false;
|
|
|
+ }).catch(error => {
|
|
|
+ this.traces = [];
|
|
|
+ this.tableLoading = false;
|
|
|
+ console.error('获取物流信息失败:', error);
|
|
|
});
|
|
|
},
|
|
|
+ // 同步物流信息
|
|
|
+ syncExpressInfo() {
|
|
|
+ this.syncLoading = true;
|
|
|
+ this.loadExpressInfo();
|
|
|
+ this.syncLoading = false;
|
|
|
+ },
|
|
|
sendGoods() {
|
|
|
// 手动验证所有必填字段
|
|
|
if (!this.selectedRow) {
|
|
|
@@ -772,9 +819,12 @@ export default {
|
|
|
},
|
|
|
getDetails(orderId) {
|
|
|
this.item = null;
|
|
|
+ this.orderLogs = []; // 清空操作记录
|
|
|
getIntegralOrder(orderId).then(response => {
|
|
|
this.item = response.data;
|
|
|
this.prod = [JSON.parse(this.item.itemJson)][0];
|
|
|
+ // 获取操作记录
|
|
|
+ this.getOrderLogsData();
|
|
|
});
|
|
|
},
|
|
|
// 代服账号选择变化
|
|
|
@@ -884,6 +934,29 @@ export default {
|
|
|
console.error('完成订单失败:', error);
|
|
|
});
|
|
|
},
|
|
|
+ // 获取订单操作记录
|
|
|
+ getOrderLogsData() {
|
|
|
+ if (!this.item || !this.item.orderId) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.logsLoading = true;
|
|
|
+ getOrderLogs(this.item.orderId).then(response => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ // 按照时间升序排列
|
|
|
+ this.orderLogs = response.data.sort((a, b) => {
|
|
|
+ return new Date(a.changeTime) - new Date(b.changeTime);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.orderLogs = [];
|
|
|
+ }
|
|
|
+ this.logsLoading = false;
|
|
|
+ }).catch(error => {
|
|
|
+ this.orderLogs = [];
|
|
|
+ this.logsLoading = false;
|
|
|
+ console.error('获取操作记录失败:', error);
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|