Commit 54b5a2d7 by zhuzhequan

Merge remote-tracking branch 'origin/dev' into dev

parents 5501333a 3cb4dcf4
...@@ -174,9 +174,17 @@ export function printPickingOrderApi(orderIds: number[]) { ...@@ -174,9 +174,17 @@ export function printPickingOrderApi(orderIds: number[]) {
) )
} }
export function stockOutCheckApi(orderIds: number[]) { export function stockOutCheckApi(orderIds: number[]) {
return axios.get<never, BaseRespData<number[]>>( return axios.get<
`factory/podJomallOrderUs/replenishVerify?ids=${orderIds.join(',')}`, never,
) BaseRespData<
{
id: number
status: boolean
message?: string
factoryOrderNumber?: string
}[]
>
>(`factory/podJomallOrderUs/replenishVerify?ids=${orderIds.join(',')}`)
} }
export function toBePickingApi(orderIds: number[]) { export function toBePickingApi(orderIds: number[]) {
return axios.get<never, BaseRespData<never>>( return axios.get<never, BaseRespData<never>>(
...@@ -326,16 +334,16 @@ export function createLogisticsOrderApi(params: { ...@@ -326,16 +334,16 @@ export function createLogisticsOrderApi(params: {
// 创建物流 // 创建物流
export function uploadExpressSheet(params: { export function uploadExpressSheet(params: {
trackingNumber:string trackingNumber: string
file: File file: File
}) { }) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/uploadExpressSheet', 'factory/podJomallOrderUs/uploadExpressSheet',
params, params,
) )
}// 创建物流 } // 创建物流
export function updateSelfLogistics(params: { export function updateSelfLogistics(params: {
trackingNumber:string trackingNumber: string
expressSheet: string expressSheet: string
processNumber: string processNumber: string
id?: string id?: string
......
...@@ -74,11 +74,10 @@ const resultDialog = ref(false) ...@@ -74,11 +74,10 @@ const resultDialog = ref(false)
const isIndeterminate = ref(false) const isIndeterminate = ref(false)
const checkAll = ref(false) const checkAll = ref(false)
const selectedList = ref<IList[]>([]) const selectedList = ref<IList[]>([])
let key = ''
// 显示弹窗 // 显示弹窗
const showDialog = (type?: string) => { const showDialog = (type?: string) => {
console.log(type) key = type || ''
resultDialog.value = true resultDialog.value = true
selectedList.value = [] selectedList.value = []
checkAll.value = false checkAll.value = false
...@@ -127,6 +126,7 @@ const copyAllCode = (field: string) => { ...@@ -127,6 +126,7 @@ const copyAllCode = (field: string) => {
} }
function closedFn() { function closedFn() {
if (key === 'stockOut') return
emits('confirm', selectedList.value) emits('confirm', selectedList.value)
} }
......
...@@ -479,7 +479,6 @@ ...@@ -479,7 +479,6 @@
<TableView <TableView
ref="tableRef" ref="tableRef"
:columns="tableColumns" :columns="tableColumns"
:stripe="true"
:serial-numberable="true" :serial-numberable="true"
:selectionable="true" :selectionable="true"
:paginated-data="tableData" :paginated-data="tableData"
...@@ -1313,7 +1312,7 @@ ...@@ -1313,7 +1312,7 @@
<ResultInfo <ResultInfo
ref="resultRefs" ref="resultRefs"
:list="resultInfo" :list="resultInfo"
@confirm="resultConfim" @confirm="resultConfirm"
></ResultInfo> ></ResultInfo>
<el-dialog <el-dialog
...@@ -1813,8 +1812,8 @@ const rightClick = (e: MouseEvent) => { ...@@ -1813,8 +1812,8 @@ const rightClick = (e: MouseEvent) => {
const handleSelectionChange = (val: PodUsOrderListData[]) => { const handleSelectionChange = (val: PodUsOrderListData[]) => {
selection.value = val selection.value = val
// 只在手动清空选择时,且当前没有补货成功的行时,才清除补货成功状态 // 当清空选择时,清除补货校验成功的状态
if (val.length === 0 && stockOutSuccessIds.value.length === 0) { if (val.length === 0) {
stockOutSuccessIds.value = [] stockOutSuccessIds.value = []
} }
} }
...@@ -2672,7 +2671,7 @@ const resultInfo = ref< ...@@ -2672,7 +2671,7 @@ const resultInfo = ref<
message: string message: string
}[] }[]
>([]) >([])
const resultConfim = () => { const resultConfirm = () => {
search() search()
loadTabData() loadTabData()
} }
...@@ -2771,14 +2770,27 @@ const stockOutCheck = async () => { ...@@ -2771,14 +2770,27 @@ const stockOutCheck = async () => {
const res = await stockOutCheckApi(selectedIds) const res = await stockOutCheckApi(selectedIds)
if (res.code !== 200) return if (res.code !== 200) return
const successIds = res.data.filter((e) => e.status).map((ee) => ee.id) || []
const successIds = res.data || [] // if (successIds.length === 0) {
if (successIds.length === 0) { // ElMessage.warning('未补到货')
ElMessage.warning('未补到货') // return
return // }
resultInfo.value =
(res.data as {
id: string | number
status: boolean
factoryOrderNumber?: string
message: string
}[]) || []
if (
Array.isArray(res.data) &&
(res.data as { status: boolean }[]).some((item) => !item.status)
) {
resultRefs.value?.showDialog('stockOut')
} else {
ElMessage.success('操作成功')
} }
ElMessage.success('操作成功')
const { success, others } = ( const { success, others } = (
tableData.value as PodUsOrderListData[] tableData.value as PodUsOrderListData[]
).reduce( ).reduce(
...@@ -2795,11 +2807,11 @@ const stockOutCheck = async () => { ...@@ -2795,11 +2807,11 @@ const stockOutCheck = async () => {
) )
tableData.value = [...success, ...others] tableData.value = [...success, ...others]
// 更新补货成功的行ID
stockOutSuccessIds.value = successIds
// 等待DOM更新后再设置选中状态 // 等待DOM更新后再设置选中状态
await nextTick() await nextTick()
// 更新补货成功的行ID
stockOutSuccessIds.value = successIds
// 清除所有选中状态 // 清除所有选中状态
tableRef.value?.clearSelection() tableRef.value?.clearSelection()
// 选中补货成功的行 // 选中补货成功的行
......
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