Prechádzať zdrojové kódy

修改订单发货功能

hurx 2 mesiacov pred
rodič
commit
af4825e810

+ 8 - 0
src/api/order/deliverProduct/types.ts

@@ -36,6 +36,10 @@ export interface DeliverProductVO {
    */
   deliverNum: number;
 
+  orderPrice: number;
+
+  subtotal: number;
+
   dataSource: string;
 
   /**
@@ -82,6 +86,10 @@ export interface DeliverProductForm extends BaseEntity {
    */
   deliverNum?: number;
 
+  orderPrice: number;
+
+  subtotal: number;
+
   dataSource?: string;
 
   /**

+ 34 - 0
src/api/order/orderDeliver/index.ts

@@ -75,3 +75,37 @@ export const queryTrack = (query?: OrderDeliverQuery): AxiosPromise<OrderDeliver
     params: query
   });
 };
+
+/**
+ * 根据客户ID查询发货单(分页)
+ * @param customerId 客户ID
+ * @param pageQuery 分页参数
+ */
+export const getCustomerDeliverOrders = (customerId: string | number, pageQuery?: { pageNum?: number; pageSize?: number }) => {
+  return request({
+    url: '/order/orderDeliver/getCustomerDeliverOrders/' + customerId,
+    method: 'get',
+    params: pageQuery
+  });
+};
+
+/**
+ * 根据多个订单ID查询对应的订单商品列表
+ * @param orderIds
+ */
+export function getCustomerOrderProductList(orderIds: (string | number)[]) {
+  if (!Array.isArray(orderIds) || orderIds.length === 0) {
+    return Promise.reject(new Error('订单ID不能为空'));
+  }
+
+  // 手动构造查询参数,确保格式为 orderId=1&orderId=2&orderId=3
+  const params = new URLSearchParams();
+  orderIds.forEach((id) => {
+    params.append('orderId', String(id));
+  });
+
+  return request({
+    url: '/order/orderDeliver/getCustomerOrderProductList?' + params.toString(),
+    method: 'get'
+  });
+}

+ 1 - 1
src/views/order/orderDeliver/index.vue

@@ -76,7 +76,7 @@
         </el-table-column>
         <el-table-column label="操作" align="center" class-name="small-padding fixed-width" :resizable="false">
           <template #default="scope">
-            <el-button link type="primary" @click="handleDeliver(scope.row)">发货</el-button>
+            <el-button link type="primary" v-if="scope.row.orderStatus != '4'" @click="handleDeliver(scope.row)">发货</el-button>
             <el-button link type="primary" @click="handleReview(scope.row)">查看发货信息</el-button>
             <el-button link type="primary">取消订单</el-button>
           </template>

+ 4 - 1
src/views/order/saleOrder/deliverDialog.vue

@@ -69,6 +69,7 @@
       <el-table-column prop="categoryName" label="类别" width="120" />
       <el-table-column prop="productUnit" label="单位" width="80" />
       <el-table-column prop="orderQuantity" label="商品总数" width="100" />
+      <el-table-column prop="orderPrice" label="商品单价" width="100" />
       <el-table-column prop="quantitySent" label="已发货数量" width="100" />
       <el-table-column prop="unsentQuantity" label="未发货数量" width="100" />
       <el-table-column label="发货数量">
@@ -262,6 +263,7 @@ const loadProductList = async () => {
       deliverNum: 0,
       productNo: item.productNo,
       productId: item.productId,
+      orderPrice: item.orderPrice,
       productUnit: item.productUnit,
       productUnitId: item.productUnitId
     }));
@@ -359,7 +361,8 @@ const handleSubmit = async () => {
         productName: item.productName,
         productUnitId: item.productUnitId,
         productUnit: item.productUnit,
-        deliverNum: item.deliverNum
+        deliverNum: item.deliverNum,
+        orderPrice: item.orderPrice
       }))
     };