4 Komitmen fe72bf4167 ... fdb57e7d53

Pembuat SHA1 Pesan Tanggal
  hurx fdb57e7d53 修改发货部分 1 hari lalu
  hurx a48037a17e 1 4 hari lalu
  hurx 5d45d80b49 Merge branch 'hurx' of http://8.152.4.3:3000/yp_web/yoe-scm-web into hurx 4 hari lalu
  hurx 9f53b2e9af 修改 4 hari lalu

TEMPAT SAMPAH
dist (5).zip


TEMPAT SAMPAH
dist (6).zip


+ 2 - 0
src/api/order/orderDeliver/types.ts

@@ -82,6 +82,8 @@ export interface OrderDeliverVO {
   remark: string;
 
   deliverProductList: any[];
+
+  deliverCode?: string;
 }
 
 export interface OrderDeliverForm extends BaseEntity {

+ 0 - 1
src/views/customer/info/components/BasicInfoTab.vue

@@ -289,7 +289,6 @@
       </el-row>
     </div>
 
-   
     <div class="section-title">ERP供应商信息</div>
     <el-form :model="erpSupplierInfoForm" label-width="120px" class="detail-form">
       <el-row :gutter="12" class="form-row">

+ 1 - 2
src/views/customer/info/index.vue

@@ -67,11 +67,10 @@
       <el-table v-loading="loading" border :data="infoList" class="no-resize-table" @selection-change="handleSelectionChange">
         <el-table-column label="编号" align="center" prop="supplierNo" width="150" fixed="left" />
         <el-table-column label="名称" align="left" prop="enterpriseName" fixed="left" />
-        <el-table-column label="类型" align="center" prop="supplierTypeName" />
+        <el-table-column label="类型" align="center" />
         <el-table-column label="等级" align="left" prop="enterpriseScaleName" fixed="left" />
         <el-table-column label="企业规模" align="left" prop="enterpriseScaleName" fixed="left" />
         <el-table-column label="评价" align="left" prop="" fixed="left" />
-
         <el-table-column label="采销经理" align="center" prop="productManager" />
         <el-table-column label="产品专员" align="center" prop="buyer" />
         <!-- <el-table-column label="供应品牌" align="center" prop="brandName" width="200" />

+ 2 - 2
src/views/order/saleOrder/deliverDialog.vue

@@ -256,7 +256,7 @@ const loadProductList = async () => {
   try {
     const res = await getOrderMain(props.orderId);
     // 为每个商品添加发货数量字段,默认为未发货数量
-    productList.value = (res.data.orderProductList || []).map((item: OrderProductVO) => ({
+    productList.value = (res.data.orderProductList.filter((item) => item.unsentQuantity != 0) || []).map((item: OrderProductVO) => ({
       ...item,
       deliverNum: 0,
       productNo: item.productNo,
@@ -265,7 +265,7 @@ const loadProductList = async () => {
       productUnit: item.productUnit,
       productUnitId: item.productUnitId
     }));
-    total.value = res.data.orderProductList.length || 0;
+    total.value = res.data.orderProductList.filter((item) => item.unsentQuantity != 0).length || 0;
   } catch (error) {
     console.error('加载商品列表失败:', error);
     ElMessage.error('加载商品列表失败');

+ 50 - 25
src/views/order/saleOrder/logisticsDetail.vue

@@ -9,8 +9,8 @@
             <el-option
               v-for="item in logisticsList"
               :key="item.id"
-              :label="`${item.logisticNo},${getDictLabel(deliver_method, item.deliverMethod)}`"
-              :value="item.logisticNo"
+              :label="`${item.logisticNo || item.deliverCode},${getDictLabel(deliver_method, item.deliverMethod)}`"
+              :value="item.logisticNo || item.deliverCode"
             />
           </el-select>
         </el-form-item>
@@ -39,7 +39,7 @@
 <script setup lang="ts">
 import { listOrderDeliver, queryTrack } from '@/api/order/orderDeliver';
 import { OrderDeliverVO } from '@/api/order/orderDeliver/types';
-
+import { listOrderStatusLog } from '@/api/order/orderStatusLog';
 interface Props {
   modelValue: boolean;
   orderId?: string | number;
@@ -88,7 +88,7 @@ const loadLogisticsList = async () => {
     logisticsList.value = res.rows || [];
 
     if (logisticsList.value.length > 0) {
-      form.value.selectedLogisticNo = logisticsList.value[0].logisticNo;
+      form.value.selectedLogisticNo = logisticsList.value[0].logisticNo || logisticsList.value[0].deliverCode;
       handleLogisticNoChange(form.value.selectedLogisticNo);
     }
   } catch (error) {
@@ -98,29 +98,54 @@ const loadLogisticsList = async () => {
 
 const handleLogisticNoChange = async (logisticNo: string) => {
   const selected = logisticsList.value.find((item) => item.logisticNo === logisticNo);
-  if (!selected) return;
-
   try {
-    const res = await queryTrack({
-      logisticNo: logisticNo,
-      pageNum: 1,
-      pageSize: 100
-    });
-
-    if (res.data && Array.isArray(res.data) && res.data.length > 0) {
-      logisticsInfo.value = res.data.map((item: any) => ({
-        time: item.acceptTime || item.time || '',
-        location: selected.orderCode ? `${selected.orderCode}` : '',
-        status: item.context || ''
-      }));
+    if (selected) {
+      const res = await queryTrack({
+        logisticNo: logisticNo,
+        pageNum: 1,
+        pageSize: 100
+      });
+      // 1. 兼容处理:有些接口返回在 res.data,有些可能直接是 res
+      const dataList = res.data || [];
+      if (Array.isArray(dataList) && dataList.length > 0) {
+        logisticsInfo.value = dataList.map((item: any) => {
+          // 2. 核心修复:精准匹配时间字段
+          // 顺丰用 'time',韵达用 'ftime'。
+          // 优先取 ftime (韵达标准),如果没有则取 time (顺丰标准)
+          const displayTime = item.ftime || item.time || item.acceptTime || '';
+
+          return {
+            time: displayTime,
+            // 3. 建议:保留原始状态字段,方便后续筛选(如“已签收”)
+            status: item.context || item.content || '',
+            // 4. 建议:如果有地址字段,也可以映射进来,没有则保持订单号
+            location: item.location || (selected.orderCode ? `${selected.orderCode}` : '')
+          };
+        });
+      }
     } else {
-      logisticsInfo.value = [
-        {
-          time: (selected as any).createTime || '',
-          location: selected.orderCode ? `${selected.orderCode}` : '',
-          status: '已下单'
-        }
-      ];
+      await listOrderStatusLog({
+        orderId: props.orderId,
+        logisticNos: form.value.selectedLogisticNo,
+        pageNum: 1,
+        pageSize: 100
+      }).then((res) => {
+        logisticsInfo.value = res.rows.map((item: any) => {
+          return {
+            time: item.createTime,
+            location: item.orderCode ? `${item.orderCode}` : '',
+            status: item.statusName
+          };
+        });
+      });
+
+      // logisticsInfo.value = [
+      //   {
+      //     time: (selected as any).createTime || '',
+      //     location: selected.orderCode ? `${selected.orderCode}` : '',
+      //     status: '已下单'
+      //   }
+      // ];
     }
   } catch (error) {
     console.error('Failed to query track:', error);

+ 3 - 1
src/views/order/saleOrder/sendDetail.vue

@@ -315,7 +315,9 @@ const logisticsOrderId = ref<string | number>();
 const statusLogDrawerRef = ref<any>(null);
 
 /** 发货成功回调 */
-const handleDeliverSuccess = () => {};
+const handleDeliverSuccess = () => {
+  getOrderDetail();
+};
 
 // 计算商品总数(所有商品的采购数量之和)
 const totalQuantity = computed(() => {