|
@@ -36,7 +36,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="detail-item">
|
|
<div class="detail-item">
|
|
|
<span class="label">发票类型:</span>
|
|
<span class="label">发票类型:</span>
|
|
|
- <span>{{ invoiceTypeInfo.invoiceTypeNo || '--' }},{{ invoiceTypeInfo.invoiceTypeName || '--' }}</span>
|
|
|
|
|
|
|
+ <span>{{ orderDetail.invoiceType }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="detail-item">
|
|
<div class="detail-item">
|
|
|
<span class="label">发货仓库:</span>
|
|
<span class="label">发货仓库:</span>
|
|
@@ -154,32 +154,56 @@
|
|
|
</el-table>
|
|
</el-table>
|
|
|
</el-card>
|
|
</el-card>
|
|
|
<!-- 发货对话框 -->
|
|
<!-- 发货对话框 -->
|
|
|
- <DeliverDialog v-model="showDeliverDialog" :order-id="currentOrderId" :order-no="currentOrderNo" @success="handleDeliverSuccess" />
|
|
|
|
|
|
|
+ <DeliverDialog
|
|
|
|
|
+ v-model="showDeliverDialog"
|
|
|
|
|
+ :order-id="currentOrderId"
|
|
|
|
|
+ :order-no="currentOrderNo"
|
|
|
|
|
+ :operate-type="operateType"
|
|
|
|
|
+ @success="handleDeliverSuccess"
|
|
|
|
|
+ />
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 编辑发货信息对话框 -->
|
|
|
|
|
+ <EditDeliverDialog v-model="showEditDeliverDialog" :deliver-id="editDeliverId" @success="handleDeliverSuccess" />
|
|
|
<!-- 发货信息 -->
|
|
<!-- 发货信息 -->
|
|
|
<el-card shadow="never" class="mb-2" v-show="orderDetail.orderStatus != '0'">
|
|
<el-card shadow="never" class="mb-2" v-show="orderDetail.orderStatus != '0'">
|
|
|
<template #header>
|
|
<template #header>
|
|
|
<div class="card-header">
|
|
<div class="card-header">
|
|
|
- <span>发货信息:共{{ 0 }}个包裹</span>
|
|
|
|
|
- <el-button type="primary" style="float: right" @click="handleAddDeliver(orderDetail)">添加发货信息</el-button>
|
|
|
|
|
|
|
+ <span>发货信息:共{{ orderDeliverList.length }}个包裹</span>
|
|
|
|
|
+ <el-button type="primary" v-if="orderDetail.orderStatus == '2' || orderDetail.orderStatus == '3'" @click="handleAddDeliver(orderDetail)"
|
|
|
|
|
+ >添加发货信息</el-button
|
|
|
|
|
+ >
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
- <div v-show="totalQuantitySent > 0">
|
|
|
|
|
- <div style="white-space: nowrap" class="mb-2">
|
|
|
|
|
- <span style="margin-right: 16px">发货单号:--</span>
|
|
|
|
|
- <span style="margin-right: 16px">发货时间:--</span>
|
|
|
|
|
- <span style="margin-right: 16px">发货方式:--</span>
|
|
|
|
|
- <span style="margin-right: 16px">送货人:--</span>
|
|
|
|
|
- <span style="margin-right: 16px">手机:--</span>
|
|
|
|
|
- <span style="margin-right: 16px">物流状态:--</span>
|
|
|
|
|
- <span>发货备注:--</span>
|
|
|
|
|
|
|
+ <el-card v-for="deliver in orderDeliverList" :key="deliver.id">
|
|
|
|
|
+ <div class="mb-2" style="background: #f3f3f3; padding: 10px">
|
|
|
|
|
+ <el-row :gutter="20" justify="space-between" align="middle">
|
|
|
|
|
+ <el-col :span="18">
|
|
|
|
|
+ <div style="display: flex; flex-wrap: wrap; gap: 16px">
|
|
|
|
|
+ <span>发货单号:{{ (deliver as any).deliverCode || '--' }}</span>
|
|
|
|
|
+ <span>发货时间:{{ (deliver as any).createTime || '--' }}</span>
|
|
|
|
|
+ <span>发货方式:{{ getDictLabel(deliver_method, deliver.deliverMethod || '--') }}</span>
|
|
|
|
|
+ <span>送货人:{{ deliver.deliverMan || '--' }}</span>
|
|
|
|
|
+ <span>手机:{{ deliver.phone || '--' }}</span>
|
|
|
|
|
+ <span style="margin-left: 30px">物流状态:{{ deliver.logisticsStatus || '--' }}</span>
|
|
|
|
|
+ <span style="margin-left: 20px">发货备注:{{ deliver.deliverRemark || '--' }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="6">
|
|
|
|
|
+ <div style="text-align: right">
|
|
|
|
|
+ <el-button type="primary" @click="handleEditDeliver(deliver)">编辑发货信息</el-button>
|
|
|
|
|
+ <el-button type="primary" v-if="deliver.deliverMethod == '0'" @click="handleEditLogistics(deliver)">变更物流状态</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="handleViewLogistics(orderDetail)">查看物流</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
</div>
|
|
</div>
|
|
|
- <el-table :data="deliverProductList" border style="width: 100%">
|
|
|
|
|
|
|
+ <el-table :data="deliver.deliverProductList" border style="width: 100%">
|
|
|
<el-table-column label="产品编号" prop="productNo" align="center" />
|
|
<el-table-column label="产品编号" prop="productNo" align="center" />
|
|
|
<el-table-column label="商品名称" prop="productName" align="center" />
|
|
<el-table-column label="商品名称" prop="productName" align="center" />
|
|
|
<el-table-column label="单位" prop="productUnit" align="center" />
|
|
<el-table-column label="单位" prop="productUnit" align="center" />
|
|
|
<el-table-column label="发货数量" prop="deliverNum" align="center" />
|
|
<el-table-column label="发货数量" prop="deliverNum" align="center" />
|
|
|
</el-table>
|
|
</el-table>
|
|
|
- </div>
|
|
|
|
|
|
|
+ </el-card>
|
|
|
</el-card>
|
|
</el-card>
|
|
|
|
|
|
|
|
<!-- A10备货信息 -->
|
|
<!-- A10备货信息 -->
|
|
@@ -207,18 +231,27 @@
|
|
|
<div class="text-center mt-4">
|
|
<div class="text-center mt-4">
|
|
|
<el-button @click="goBack">返回</el-button>
|
|
<el-button @click="goBack">返回</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <!-- 物流详情对话框 -->
|
|
|
|
|
+ <LogisticsDetail v-model="showLogisticsDialog" :order-id="logisticsOrderId" />
|
|
|
|
|
+ <!-- 订单状态日志抽屉 -->
|
|
|
|
|
+ <AddOrderStatusLogDrawer ref="statusLogDrawerRef" />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup name="SendDetail" lang="ts">
|
|
<script setup name="SendDetail" lang="ts">
|
|
|
import { ref, computed, onMounted } from 'vue';
|
|
import { ref, computed, onMounted } from 'vue';
|
|
|
import DeliverDialog from './deliverDialog.vue';
|
|
import DeliverDialog from './deliverDialog.vue';
|
|
|
|
|
+import EditDeliverDialog from './editDeliverDialog.vue';
|
|
|
|
|
+import AddOrderStatusLogDrawer from './addOrderStatusLogDrawer.vue';
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
import { getOrderMain } from '@/api/order/orderMain';
|
|
import { getOrderMain } from '@/api/order/orderMain';
|
|
|
import { OrderMainVO } from '@/api/order/orderMain/types';
|
|
import { OrderMainVO } from '@/api/order/orderMain/types';
|
|
|
import { listOrderProduct } from '@/api/order/orderProduct';
|
|
import { listOrderProduct } from '@/api/order/orderProduct';
|
|
|
import { OrderProductVO } from '@/api/order/orderProduct/types';
|
|
import { OrderProductVO } from '@/api/order/orderProduct/types';
|
|
|
import { DeliverProductVO } from '@/api/order/deliverProduct/types';
|
|
import { DeliverProductVO } from '@/api/order/deliverProduct/types';
|
|
|
|
|
+import { listOrderDeliver } from '@/api/order/orderDeliver';
|
|
|
|
|
+import { OrderDeliverVO } from '@/api/order/orderDeliver/types';
|
|
|
|
|
+import { listDeliverProduct } from '@/api/order/deliverProduct';
|
|
|
import { getShippingAddress } from '@/api/customer/customerFile/shippingAddress';
|
|
import { getShippingAddress } from '@/api/customer/customerFile/shippingAddress';
|
|
|
import { ShippingAddressVO } from '@/api/customer/customerFile/shippingAddress/types';
|
|
import { ShippingAddressVO } from '@/api/customer/customerFile/shippingAddress/types';
|
|
|
import { getWarehouse } from '@/api/company/warehouse';
|
|
import { getWarehouse } from '@/api/company/warehouse';
|
|
@@ -229,10 +262,12 @@ import { getCustomerInfo } from '@/api/customer/customerFile/customerInfo';
|
|
|
import { CustomerInfoVO } from '@/api/customer/customerFile/customerInfo/types';
|
|
import { CustomerInfoVO } from '@/api/customer/customerFile/customerInfo/types';
|
|
|
import { getInvoiceType } from '@/api/customer/invoiceType';
|
|
import { getInvoiceType } from '@/api/customer/invoiceType';
|
|
|
import { InvoiceTypeVO } from '@/api/customer/invoiceType/types';
|
|
import { InvoiceTypeVO } from '@/api/customer/invoiceType/types';
|
|
|
|
|
+import { selectNewOneLog } from '@/api/order/orderStatusLog';
|
|
|
|
|
|
|
|
|
|
+import LogisticsDetail from './logisticsDetail.vue';
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
-const { order_status, payment_status, fee_type, pay_method } = toRefs<any>(
|
|
|
|
|
- proxy?.useDict('order_status', 'payment_status', 'fee_type', 'pay_method')
|
|
|
|
|
|
|
+const { order_status, payment_status, fee_type, pay_method, deliver_method } = toRefs<any>(
|
|
|
|
|
+ proxy?.useDict('order_status', 'payment_status', 'fee_type', 'pay_method', 'deliver_method')
|
|
|
);
|
|
);
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
@@ -255,18 +290,34 @@ const invoiceTypeInfo = ref<InvoiceTypeVO>({} as InvoiceTypeVO);
|
|
|
// 商品明细列表
|
|
// 商品明细列表
|
|
|
const productList = ref<OrderProductVO[]>([]);
|
|
const productList = ref<OrderProductVO[]>([]);
|
|
|
|
|
|
|
|
|
|
+// 发货包裹列表
|
|
|
|
|
+const orderDeliverList = ref<OrderDeliverVO[]>([]);
|
|
|
const deliverProductList = ref<DeliverProductVO[]>([]);
|
|
const deliverProductList = ref<DeliverProductVO[]>([]);
|
|
|
|
|
|
|
|
// 收货地址信息
|
|
// 收货地址信息
|
|
|
const shippingAddress = ref<ShippingAddressVO>({} as ShippingAddressVO);
|
|
const shippingAddress = ref<ShippingAddressVO>({} as ShippingAddressVO);
|
|
|
|
|
|
|
|
|
|
+const operateType = ref('add');
|
|
|
|
|
+
|
|
|
// 发货对话框
|
|
// 发货对话框
|
|
|
const showDeliverDialog = ref(false);
|
|
const showDeliverDialog = ref(false);
|
|
|
const currentOrderId = ref<string | number>();
|
|
const currentOrderId = ref<string | number>();
|
|
|
const currentOrderNo = ref<string>();
|
|
const currentOrderNo = ref<string>();
|
|
|
|
|
|
|
|
|
|
+// 编辑发货对话框
|
|
|
|
|
+const showEditDeliverDialog = ref(false);
|
|
|
|
|
+const editDeliverId = ref<string | number>();
|
|
|
|
|
+
|
|
|
|
|
+const showLogisticsDialog = ref(false);
|
|
|
|
|
+const logisticsOrderId = ref<string | number>();
|
|
|
|
|
+
|
|
|
|
|
+// 订单状态日志抽屉
|
|
|
|
|
+const statusLogDrawerRef = ref<any>(null);
|
|
|
|
|
+
|
|
|
/** 发货成功回调 */
|
|
/** 发货成功回调 */
|
|
|
-const handleDeliverSuccess = () => {};
|
|
|
|
|
|
|
+const handleDeliverSuccess = () => {
|
|
|
|
|
+ getOrderDetail();
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
// 计算商品总数(所有商品的采购数量之和)
|
|
// 计算商品总数(所有商品的采购数量之和)
|
|
|
const totalQuantity = computed(() => {
|
|
const totalQuantity = computed(() => {
|
|
@@ -308,6 +359,11 @@ const getOrderDetail = async () => {
|
|
|
await getDeliverProductList(orderDetail.value);
|
|
await getDeliverProductList(orderDetail.value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 获取发货单及关联的物流商品信息
|
|
|
|
|
+ if (orderDetail.value.id) {
|
|
|
|
|
+ await getOrderDeliverListData(orderDetail.value.id);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 获取收货地址
|
|
// 获取收货地址
|
|
|
if (orderDetail.value.shippingAddressId) {
|
|
if (orderDetail.value.shippingAddressId) {
|
|
|
await getShippingAddressDetail(orderDetail.value.shippingAddressId);
|
|
await getShippingAddressDetail(orderDetail.value.shippingAddressId);
|
|
@@ -329,9 +385,9 @@ const getOrderDetail = async () => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 获取发票类型信息
|
|
// 获取发票类型信息
|
|
|
- if (orderDetail.value.invoiceType) {
|
|
|
|
|
- await getInvoiceTypeDetail(orderDetail.value.invoiceType);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (orderDetail.value.invoiceType) {
|
|
|
|
|
+ // await getInvoiceTypeDetail(orderDetail.value.invoiceType);
|
|
|
|
|
+ // }
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('获取订单详情失败:', error);
|
|
console.error('获取订单详情失败:', error);
|
|
|
proxy?.$modal.msgError('获取订单详情失败');
|
|
proxy?.$modal.msgError('获取订单详情失败');
|
|
@@ -344,11 +400,64 @@ const handleAddDeliver = (row?: OrderMainVO) => {
|
|
|
proxy?.$modal.msgWarning('订单ID不能为空');
|
|
proxy?.$modal.msgWarning('订单ID不能为空');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ operateType.value = 'add';
|
|
|
currentOrderId.value = row.id;
|
|
currentOrderId.value = row.id;
|
|
|
currentOrderNo.value = row.orderNo;
|
|
currentOrderNo.value = row.orderNo;
|
|
|
showDeliverDialog.value = true;
|
|
showDeliverDialog.value = true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+/** 编辑发货信息操作 */
|
|
|
|
|
+const handleEditDeliver = (deliver: any) => {
|
|
|
|
|
+ if (!deliver?.id) {
|
|
|
|
|
+ proxy?.$modal.msgWarning('发货信息ID不能为空');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ editDeliverId.value = deliver.id;
|
|
|
|
|
+ showEditDeliverDialog.value = true;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const handleViewLogistics = (row?: OrderMainVO) => {
|
|
|
|
|
+ if (!row?.id) {
|
|
|
|
|
+ proxy?.$modal.msgWarning('订单ID不能为空');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ logisticsOrderId.value = row.id;
|
|
|
|
|
+
|
|
|
|
|
+ showLogisticsDialog.value = true;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+/** 变更物流状态 */
|
|
|
|
|
+const handleEditLogistics = async (row?: any) => {
|
|
|
|
|
+ if (!row?.orderId) {
|
|
|
|
|
+ proxy?.$modal.msgWarning('订单ID不能为空');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 补充客户信息
|
|
|
|
|
+ row.customerId = orderDetail.value.customerId;
|
|
|
|
|
+ row.customerNo = orderDetail.value.customerCode;
|
|
|
|
|
+
|
|
|
|
|
+ let currentOrderStatus = '';
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await selectNewOneLog({
|
|
|
|
|
+ orderId: row.orderId,
|
|
|
|
|
+ customerId: row.customerId,
|
|
|
|
|
+ logisticNos: row.deliverCode
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ if (res.code == 200 && res.data) {
|
|
|
|
|
+ row.images = res.data.images;
|
|
|
|
|
+ currentOrderStatus = res.data.statusName || '';
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('查询物流失败:', error);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 4. 使用获取到的状态打开弹窗
|
|
|
|
|
+ statusLogDrawerRef.value?.openDrawer(row, currentOrderStatus);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
// 获取商品明细列表
|
|
// 获取商品明细列表
|
|
|
const getProductList = async (orderDetail: OrderMainVO) => {
|
|
const getProductList = async (orderDetail: OrderMainVO) => {
|
|
|
try {
|
|
try {
|
|
@@ -367,6 +476,31 @@ const getDeliverProductList = async (orderDetail: OrderMainVO) => {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// 获取发货单列表
|
|
|
|
|
+const getOrderDeliverListData = async (orderId: string | number) => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await listOrderDeliver({ orderId, pageNum: 1, pageSize: 100 });
|
|
|
|
|
+ const deliverList = (res as any).rows || res.data || [];
|
|
|
|
|
+
|
|
|
|
|
+ // 为每条发货记录获取商品明细
|
|
|
|
|
+ for (const deliver of deliverList) {
|
|
|
|
|
+ if (deliver.id) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const productRes = await listDeliverProduct({ deliverId: deliver.id, pageNum: 1, pageSize: 100 });
|
|
|
|
|
+ deliver.deliverProductList = (productRes as any).rows || productRes.data || [];
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error(`获取发货单${deliver.id}的商品明细失败:`, error);
|
|
|
|
|
+ deliver.deliverProductList = [];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ orderDeliverList.value = deliverList;
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('获取发货单列表失败:', error);
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
// 获取收货地址详情
|
|
// 获取收货地址详情
|
|
|
const getShippingAddressDetail = async (addressId: string | number) => {
|
|
const getShippingAddressDetail = async (addressId: string | number) => {
|
|
|
try {
|
|
try {
|
|
@@ -496,6 +630,13 @@ onMounted(() => {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+.card-header {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ min-height: 40px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
@media print {
|
|
@media print {
|
|
|
.el-button {
|
|
.el-button {
|
|
|
display: none;
|
|
display: none;
|