Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | 1x 3x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 2x | import { http } from "@/utils/http";
// ============ 类型定义 ============
/** 提货委托项 */
export type DeliveryItem = {
id: string;
orderNumber: string; // 提货委托单号
blNumber: string; // 提单号1
blNumber2: string; // 提单号2
licensePlate: string; // 车牌号
driverName: string; // 司机姓名
driverPhone: string; // 司机电话
driverIdCard: string; // 司机身份证号
commodity: string; // 商品品类
quantity: number; // 数量
unit: string; // 单位
deliveryDate: string; // 提货日期
deliveryAddress: string; // 提货地址
warehouse: string; // 仓库
status: "pending" | "approved" | "in_progress" | "completed" | "cancelled"; // 状态
createTime: string; // 创建时间
updateTime: string; // 更新时间
remark?: string; // 备注
};
/** 提货委托表单数据 */
export type DeliveryFormData = {
blNumber: string; // 提单号1
blNumber2?: string; // 提单号2
licensePlate: string; // 车牌号
driverName: string; // 司机姓名
driverPhone: string; // 司机电话
driverIdCard: string; // 司机身份证号
commodity: string; // 商品品类
quantity: number; // 数量
unit: string; // 单位
deliveryDate: string; // 提货日期
deliveryAddress: string; // 提货地址
warehouse: string; // 仓库
remark?: string; // 备注
};
/** API基础响应 */
export type BaseResponse<T = any> = {
success: boolean;
message: string;
data?: T;
};
/** 提货委托列表响应 */
export type DeliveryListResponse = BaseResponse<{
items: DeliveryItem[];
total: number;
page: number;
pageSize: number;
}>;
/** 提货委托详情响应 */
export type DeliveryDetailResponse = BaseResponse<DeliveryItem>;
/** 创建提货委托响应 */
export type CreateDeliveryResponse = BaseResponse<{
id: string;
orderNumber: string;
}>;
/** 更新提货委托响应 */
export type UpdateDeliveryResponse = BaseResponse<DeliveryItem>;
/** 取消提货委托响应 */
export type CancelDeliveryResponse = BaseResponse<DeliveryItem>;
/** 下载模板响应 */
export type DownloadTemplateResponse = BaseResponse<{
fileName: string;
url: string;
}>;
/** 导出列表响应 */
export type ExportListResponse = BaseResponse<{
fileName: string;
url: string;
}>;
// ============ API函数 ============
/** 获取提货委托列表 */
export const getDeliveryList = (params?: {
page?: number;
pageSize?: number;
orderNumber?: string;
blNumber?: string;
blNumber2?: string;
licensePlate?: string;
driverName?: string;
status?: string;
startDate?: string;
endDate?: string;
}) => {
return http.request<DeliveryListResponse>("get", "/api/apply-delivery/list", {
params
});
};
/** 获取提货委托详情 */
export const getDeliveryDetail = (id: string) => {
return http.request<DeliveryDetailResponse>(
"get",
`/api/apply-delivery/detail/${id}`
);
};
/** 新增提货委托 */
export const createDelivery = (data: DeliveryFormData) => {
return http.request<CreateDeliveryResponse>(
"post",
"/api/apply-delivery/create",
{ data }
);
};
/** 更新提货委托 */
export const updateDelivery = (id: string, data: Partial<DeliveryFormData>) => {
return http.request<UpdateDeliveryResponse>(
"put",
`/api/apply-delivery/update/${id}`,
{ data }
);
};
/** 取消提货委托 */
export const cancelDelivery = (id: string) => {
return http.request<CancelDeliveryResponse>(
"put",
`/api/apply-delivery/cancel/${id}`
);
};
/** 下载提货单模板 */
export const downloadDeliveryTemplate = () => {
return http.request<DownloadTemplateResponse>(
"get",
"/api/apply-delivery/template/download"
);
};
/** 删除提货委托 */
export const deleteDelivery = (id: string) => {
return http.request<BaseResponse>("delete", `/api/apply-delivery/${id}`);
};
/** 导出提货委托列表 */
export const exportDeliveryList = (params?: {
orderNumber?: string;
blNumber?: string;
licensePlate?: string;
driverName?: string;
status?: string;
startDate?: string;
endDate?: string;
}) => {
return http.request<ExportListResponse>("get", "/api/apply-delivery/export", {
params
});
};
|