Commit 70fb178e by qinjianhui

feat: 子状态tab条件

parent d3309db6
...@@ -22,7 +22,7 @@ export function getFactoryOrderNewListApi( ...@@ -22,7 +22,7 @@ export function getFactoryOrderNewListApi(
currentPage: number, currentPage: number,
pageSize: number, pageSize: number,
status?: string, status?: string,
subStatus?: string, subStatus?: number,
) { ) {
return axios.post<never, BasePaginationData<FactoryOrderNewListData>>( return axios.post<never, BasePaginationData<FactoryOrderNewListData>>(
'factory/podOrder/list_page', 'factory/podOrder/list_page',
...@@ -31,7 +31,7 @@ export function getFactoryOrderNewListApi( ...@@ -31,7 +31,7 @@ export function getFactoryOrderNewListApi(
currentPage, currentPage,
pageSize, pageSize,
status, status,
subStatus, acceptedStatus: subStatus,
}, },
) )
} }
......
...@@ -24,10 +24,12 @@ ...@@ -24,10 +24,12 @@
</ElFormItem> </ElFormItem>
</ElForm> </ElForm>
<template #footer> <template #footer>
<div class="dialog-footer" style="text-align: center">
<ElButton @click="visible = false">取消</ElButton> <ElButton @click="visible = false">取消</ElButton>
<ElButton type="primary" :loading="submitLoading" @click="handleSubmit"> <ElButton type="primary" :loading="submitLoading" @click="handleSubmit">
确认 确认
</ElButton> </ElButton>
</div>
</template> </template>
</ElDialog> </ElDialog>
</template> </template>
......
...@@ -132,8 +132,12 @@ ...@@ -132,8 +132,12 @@
<ElFormItem label="数量"> <ElFormItem label="数量">
<el-radio-group v-model="searchForm.multi"> <el-radio-group v-model="searchForm.multi">
<el-radio-button :value="false" @click="toggleMulti(false)">单件</el-radio-button> <el-radio-button :value="false" @click="toggleMulti(false)"
<el-radio-button :value="true" @click="toggleMulti(true)">多件</el-radio-button> >单件</el-radio-button
>
<el-radio-button :value="true" @click="toggleMulti(true)"
>多件</el-radio-button
>
</el-radio-group> </el-radio-group>
</ElFormItem> </ElFormItem>
...@@ -426,8 +430,15 @@ ...@@ -426,8 +430,15 @@
<!-- ====== 操作按钮栏 ====== --> <!-- ====== 操作按钮栏 ====== -->
<div v-if="!isSpecialLayout" class="operation-list"> <div v-if="!isSpecialLayout" class="operation-list">
<span v-if="status === 'PENDING_RECEIVE'" class="item"> <span v-if="status === 'PENDING_RECEIVE'" class="item">
<ElButton type="success" @click="handleConfirmOrder"> <ElButton
{{ pendingAcceptSubTab === 'ACCEPT_FAIL_OUT_OF_STOCK' ? '重新接单' : '确认接单' }} type="success"
@click="handleConfirmOrder"
>
{{
pendingAcceptSubTab === 'ACCEPT_FAIL_OUT_OF_STOCK'
? '重新接单'
: '确认接单'
}}
</ElButton> </ElButton>
</span> </span>
<span <span
...@@ -680,7 +691,9 @@ ...@@ -680,7 +691,9 @@
}" }"
@click="handlePendingAcceptTabClick('ACCEPT_FAIL_OUT_OF_STOCK')" @click="handlePendingAcceptTabClick('ACCEPT_FAIL_OUT_OF_STOCK')"
> >
接单失败-缺货<span> ({{ pendingAcceptCounts.acceptFailOutOfStockCount }}) </span> 接单失败-缺货<span>
({{ pendingAcceptCounts.acceptFailOutOfStockCount }})
</span>
</div> </div>
</div> </div>
<!-- 批次管理 --> <!-- 批次管理 -->
...@@ -723,9 +736,9 @@ ...@@ -723,9 +736,9 @@
type="primary" type="primary"
link link
size="small" size="small"
@click.stop="handleSingleArrange(row)" @click.stop="handleSingleConfirmOrder(row)"
> >
</ElButton> </ElButton>
</template> </template>
</TableView> </TableView>
...@@ -938,7 +951,10 @@ const status = ref<string>('PENDING_RECEIVE') ...@@ -938,7 +951,10 @@ const status = ref<string>('PENDING_RECEIVE')
const pendingAcceptSubTab = ref<'PENDING_RECEIVE' | 'ACCEPT_FAIL_OUT_OF_STOCK'>( const pendingAcceptSubTab = ref<'PENDING_RECEIVE' | 'ACCEPT_FAIL_OUT_OF_STOCK'>(
'PENDING_RECEIVE', 'PENDING_RECEIVE',
) )
const pendingAcceptCounts = ref({ pendingCount: 0, acceptFailOutOfStockCount: 0 }) const pendingAcceptCounts = ref({
pendingCount: 0,
acceptFailOutOfStockCount: 0,
})
const suspendedTabs = [ const suspendedTabs = [
{ label: '客户拦截', value: 'CUSTOMER_INTERCEPT', count: 0 }, { label: '客户拦截', value: 'CUSTOMER_INTERCEPT', count: 0 },
{ label: '地址异常', value: 'ADDRESS_EXCEPTION', count: 0 }, { label: '地址异常', value: 'ADDRESS_EXCEPTION', count: 0 },
...@@ -1219,6 +1235,7 @@ const mainColumns = [ ...@@ -1219,6 +1235,7 @@ const mainColumns = [
prop: 'operation', prop: 'operation',
label: '操作', label: '操作',
minWidth: 120, minWidth: 120,
align: 'center',
slot: 'operation', slot: 'operation',
fixed: 'right', fixed: 'right',
}, },
...@@ -1368,16 +1385,20 @@ const { ...@@ -1368,16 +1385,20 @@ const {
size, size,
status.value, status.value,
).then(async (res) => { ).then(async (res) => {
const { records } = res.data const records = Array.isArray(res.data?.records) ? res.data.records : []
await nextTick(() => { await nextTick(() => {
tableRef.value.setCurrentRow(records[0]) tableRef.value.setCurrentRow(records[0])
currentRow.value = (records as never)[0] currentRow.value = records[0] as never
}) })
return res.data return res.data
}) })
} }
const currentSubStatus = const currentSubStatus =
status.value === 'PENDING_RECEIVE' ? pendingAcceptSubTab.value : undefined status.value === 'PENDING_RECEIVE'
? pendingAcceptSubTab.value === 'PENDING_RECEIVE'
? 0
: 2
: undefined
return getFactoryOrderNewListApi( return getFactoryOrderNewListApi(
getQueryPayload(), getQueryPayload(),
page, page,
...@@ -1385,17 +1406,18 @@ const { ...@@ -1385,17 +1406,18 @@ const {
status.value === 'ALL' ? undefined : status.value, status.value === 'ALL' ? undefined : status.value,
currentSubStatus, currentSubStatus,
).then(async (res) => { ).then(async (res) => {
const { records } = res.data const records = Array.isArray(res.data?.records) ? res.data.records : []
const extra = res.data as unknown as Record<string, unknown> const extra = res.data as unknown as Record<string, unknown>
if (status.value === 'PENDING_RECEIVE') { if (status.value === 'PENDING_RECEIVE') {
pendingAcceptCounts.value = { pendingAcceptCounts.value = {
pendingCount: (extra.pendingCount as number) ?? 0, pendingCount: (extra.pendingCount as number) ?? 0,
acceptFailOutOfStockCount: (extra.acceptFailOutOfStockCount as number) ?? 0, acceptFailOutOfStockCount:
(extra.acceptFailOutOfStockCount as number) ?? 0,
} }
} }
await nextTick(() => { await nextTick(() => {
tableRef.value.setCurrentRow(records[0]) tableRef.value.setCurrentRow(records[0])
currentRow.value = (records as never)[0] currentRow.value = records[0] as never
}) })
return res.data return res.data
}) })
...@@ -1466,7 +1488,9 @@ const handleStatusNodeClick = (node: StatusTreeNode) => { ...@@ -1466,7 +1488,9 @@ const handleStatusNodeClick = (node: StatusTreeNode) => {
refreshCurrentView() refreshCurrentView()
} }
} }
const handlePendingAcceptTabClick = (tab: 'PENDING_RECEIVE' | 'ACCEPT_FAIL_OUT_OF_STOCK') => { const handlePendingAcceptTabClick = (
tab: 'PENDING_RECEIVE' | 'ACCEPT_FAIL_OUT_OF_STOCK',
) => {
if (pendingAcceptSubTab.value === tab) return if (pendingAcceptSubTab.value === tab) return
pendingAcceptSubTab.value = tab pendingAcceptSubTab.value = tab
refreshTableList() refreshTableList()
...@@ -1509,13 +1533,13 @@ const getOrderDetailsById = async (tabName?: 'product' | 'log') => { ...@@ -1509,13 +1533,13 @@ const getOrderDetailsById = async (tabName?: 'product' | 'log') => {
const productRes = isSuspend const productRes = isSuspend
? await getSuspendDetailApi(id) ? await getSuspendDetailApi(id)
: await getFactoryOrderNewDetailApi(id) : await getFactoryOrderNewDetailApi(id)
productList.value = productRes.data || [] productList.value = Array.isArray(productRes.data) ? productRes.data : []
} else { } else {
logList.value = [] logList.value = []
const logRes = isSuspend const logRes = isSuspend
? await getSuspendLogApi(id) ? await getSuspendLogApi(id)
: await getFactoryOrderNewLogApi(id) : await getFactoryOrderNewLogApi(id)
logList.value = logRes.data || [] logList.value = Array.isArray(logRes.data) ? logRes.data : []
} }
} catch (e) { } catch (e) {
console.error(e) console.error(e)
...@@ -1666,12 +1690,8 @@ const handleArrange = async () => { ...@@ -1666,12 +1690,8 @@ const handleArrange = async () => {
showAutoSwitch: true, showAutoSwitch: true,
}) })
} }
const handleSingleArrange = (row: FactoryOrderNewListData) => { const handleSingleConfirmOrder = (row: FactoryOrderNewListData) => {
arrangeDialogRef.value?.open({ confirmOrderDialogRef.value?.open([row.id])
productIdList: [row.id],
requestUrl: 'factory/podOrder/updateLogisticsToArrange',
showAutoSwitch: true,
})
} }
const podOrderVisible = ref(false) const podOrderVisible = ref(false)
const warehouseList = ref<WarehouseListData[]>([]) const warehouseList = ref<WarehouseListData[]>([])
......
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