瀏覽代碼

Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_adminUI

caoliqin 2 天之前
父節點
當前提交
128c63bdec

+ 3 - 0
.gitignore

@@ -25,3 +25,6 @@ pnpm-debug.log*
 
 package-lock.json
 yarn.lock
+
+# AGENTS.md - 项目指导文档,不上传到远程仓库
+AGENTS.md

+ 8 - 0
src/api/his/integralOrder.js

@@ -132,4 +132,12 @@ export function getIntegralTemplate(){
     url: '/his/integralOrder/importUpdateOrderTemplate',
     method: 'get'
   })
+}
+
+// 获取订单操作记录
+export function getOrderLogs(orderId) {
+  return request({
+    url: '/his/logs/order/' + orderId,
+    method: 'get'
+  })
 }

+ 10 - 0
src/api/live/liveAfterSales.js

@@ -90,3 +90,13 @@ export function audit2(data) {
     data: data
   })
 }
+
+export function handleImmediatelyRefund(data) {
+  return request({
+    url: '/live/liveAfterSales/handleImmediatelyRefund',
+    method: 'post',
+    data: data
+  })
+}
+
+

+ 75 - 2
src/views/components/his/integralOrderDetails.vue

@@ -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>

+ 23 - 1
src/views/live/components/productAfterSalesOrder.vue

@@ -20,6 +20,7 @@
             <el-button size="mini"  v-hasPermi="['store:storeAfterSales:audit1']" v-show="afterSales.salesStatus==0&&afterSales.status===0" @click="handleAudit1">平台审核</el-button>
             <el-button size="mini"  v-hasPermi="['store:storeAfterSales:audit2']" v-show="afterSales.salesStatus==0&&afterSales.status===2" @click="handleAudit2">仓库审核</el-button>
             <el-button size="mini"  v-hasPermi="['store:storeAfterSales:refund']" @click="handleRefund"  v-show="afterSales.salesStatus==0&&afterSales.status===3">财务审核</el-button>
+            <el-button size="mini"  v-hasPermi="['store:storeAfterSales:refund']" @click="handleImmediatelyRefund"  v-show="afterSales.salesStatus==0">立即退款</el-button>
             <el-button size="mini"  v-hasPermi="['store:storeAfterSales:cancel']" @click="cancel"  v-show="afterSales.salesStatus==0">撤销</el-button>
             <el-button size="mini"  @click="showOrder">查看订单</el-button>
           </div>
@@ -208,7 +209,7 @@
 </template>
 
 <script>
-import {getLiveAfterSales,cancel,refund,audit,updateLiveAfterSales,audit1,audit2 } from "@/api/live/liveAfterSales";
+import {getLiveAfterSales,cancel,refund,audit,updateLiveAfterSales,audit1,audit2,handleImmediatelyRefund } from "@/api/live/liveAfterSales";
 
 import productOrder from "./productOrder";
 export default {
@@ -327,6 +328,27 @@ export default {
       this.form.salesId=this.afterSales.id;
       this.form.refundAmount=this.afterSales.refundAmount;
     },
+    handleImmediatelyRefund(){
+      let _this = this;
+       this.$confirm('确认立即退款吗?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+       
+        let param ={orderId:_this.order.orderId}
+        console.log(param)
+         debugger;
+        handleImmediatelyRefund(param).then(res=>{
+          _this.msgSuccess("操作成功");
+          _this.getLiveAfterSales(_this.afterSales.id);
+        }).catch(res=>{
+          console.log(res);
+        });
+      }).then(() => {
+        // this.getLiveAfterSales(id);
+      }).catch(function() {});
+    },
     handleAudit1(){
       var id=this.afterSales.id;
       this.$confirm('确定审请通过?', "警告", {