Commit ff1c4200 by wusiyi

feat: 修改pod cn 创建物流方式逻辑

parent a1a21d52
......@@ -94,12 +94,15 @@ const logisticCompanyList = ref<ILogisticsCompany[]>([])
const selectedLogisticCompany = ref<ILogisticsCompany | null>(null)
const logisticsWayList = ref<LogisticsWayData[]>([])
const logisticsWayId = ref<number | null>(null)
const orderIdList = ref<(string | number)[]>([])
const cancelDialog = () => {
logisticsWayList.value = []
logisticCompanyList.value = []
selectedLogisticCompany.value = null
logisticsWayId.value = null
orderIdList.value = []
isAutoMatch.value = false
createLogisticDialogVisible.value = false
}
......@@ -126,19 +129,23 @@ const selectLogisticCompany = async (item: ILogisticsCompany) => {
}
const confirmDialog = async () => {
await createLogisticsOrdersApi(
[logisticsWayId.value as unknown as string],
logisticsWayId.value,
)
await createLogisticsOrdersApi(orderIdList.value, logisticsWayId.value)
.then((res) => {
emits('show-result', res.data)
})
.finally(() => {
logisticsWayList.value = []
logisticCompanyList.value = []
selectedLogisticCompany.value = null
logisticsWayId.value = null
orderIdList.value = []
isAutoMatch.value = false
createLogisticDialogVisible.value = false
})
}
const showDialog = async () => {
const showDialog = async (ids: (string | number)[]) => {
orderIdList.value = ids
createLogisticDialogVisible.value = true
}
......
......@@ -753,7 +753,7 @@
selection.length === 0 ||
selection.some((item) => item.shipmentType !== 1)
"
@click="handleCreateLogistic(row)"
@click="handleCreateLogistic()"
>创建物流订单</ElDropdownItem
>
<ElDropdownItem
......@@ -5984,10 +5984,10 @@ const handleStockOut = async (row: PodCnOrderListData) => {
}
// 创建物流订单
const handleCreateLogistic = (row: PodCnOrderListData) => {
currentItem.value = row
const handleCreateLogistic = () => {
const ids = selection.value.map((item) => item.id)
nextTick(() => {
createLogisticDialogRef.value?.showDialog()
createLogisticDialogRef.value?.showDialog(ids)
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment