|
|
|
|
@ -1,5 +1,13 @@
|
|
|
|
|
<template>
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<!-- 统计卡片 -->
|
|
|
|
|
<div class="stock-check__header">
|
|
|
|
|
<div v-for="card in statusCards" :key="card.key" class="stock-check__stat"
|
|
|
|
|
:class="{ 'is-active': currentStatusKey === card.key }" @click="changeStatus(card.key, card.statusValue, card.checkStatusValue)">
|
|
|
|
|
<div class="stock-check__stat-title">{{ card.label }}</div>
|
|
|
|
|
<div class="stock-check__stat-value">{{ card.value }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<el-form
|
|
|
|
|
ref="queryFormRef"
|
|
|
|
|
:model="queryParams"
|
|
|
|
|
@ -42,7 +50,7 @@
|
|
|
|
|
class="!w-240px"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item :label="t('ErpStock.Check.status')" prop="status">
|
|
|
|
|
<el-form-item :label="t('ErpStock.Check.status')" prop="status" v-show="showAllFilters">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="queryParams.status"
|
|
|
|
|
:placeholder="t('ErpStock.Check.placeholderStatus')"
|
|
|
|
|
@ -57,6 +65,13 @@
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item v-if="filterCount > 3">
|
|
|
|
|
<el-button type="text" class="text-primary" @click="toggleFilters">
|
|
|
|
|
<Icon :icon="showAllFilters ? 'ep:arrow-up' : 'ep:arrow-down'" class="mr-5px" />
|
|
|
|
|
{{ showAllFilters ? t('FactoryModeling.FactoryStructure.collapseText') :
|
|
|
|
|
t('FactoryModeling.FactoryStructure.expandText') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button @click="handleQuery">
|
|
|
|
|
<Icon icon="ep:search" class="mr-5px" />
|
|
|
|
|
@ -295,6 +310,37 @@ const updatePlanTableMaxHeight = async () => {
|
|
|
|
|
const warehouseList = ref<WarehouseVO[]>([])
|
|
|
|
|
const selectionList = ref<StockCheckVO[]>([])
|
|
|
|
|
const queryFormRef = ref()
|
|
|
|
|
const currentStatusKey = ref('all')
|
|
|
|
|
const counters = reactive({
|
|
|
|
|
allCount: 0,
|
|
|
|
|
waitSubmitCount: 0,
|
|
|
|
|
rejectedCount: 0,
|
|
|
|
|
auditingCount: 0,
|
|
|
|
|
approvedCount: 0,
|
|
|
|
|
checkedCount: 0,
|
|
|
|
|
uncheckedCount: 0
|
|
|
|
|
})
|
|
|
|
|
const statusCards = computed(() => [
|
|
|
|
|
{ key: 'all', label: t('ErpStock.Check.all'), value: counters.allCount, statusValue: undefined, checkStatusValue: undefined },
|
|
|
|
|
{ key: 'waitSubmit', label: t('ErpStock.Check.waitSubmit'), value: counters.waitSubmitCount, statusValue: 0, checkStatusValue: undefined },
|
|
|
|
|
{ key: 'rejected', label: t('ErpStock.Check.rejected'), value: counters.rejectedCount, statusValue: 1, checkStatusValue: undefined },
|
|
|
|
|
{ key: 'auditing', label: t('ErpStock.Check.auditing'), value: counters.auditingCount, statusValue: 10, checkStatusValue: undefined },
|
|
|
|
|
{ key: 'approved', label: t('ErpStock.Check.approved'), value: counters.approvedCount, statusValue: 20, checkStatusValue: undefined },
|
|
|
|
|
{ key: 'checked', label: t('ErpStock.Check.checked'), value: counters.checkedCount, statusValue: undefined, checkStatusValue: 1 },
|
|
|
|
|
{ key: 'unchecked', label: t('ErpStock.Check.unchecked'), value: counters.uncheckedCount, statusValue: undefined, checkStatusValue: 0 }
|
|
|
|
|
])
|
|
|
|
|
const changeStatus = (key: string, statusValue: number | undefined, checkStatusValue: number | undefined) => {
|
|
|
|
|
currentStatusKey.value = key
|
|
|
|
|
queryParams.status = statusValue
|
|
|
|
|
queryParams.checkStatus = checkStatusValue
|
|
|
|
|
handleQuery()
|
|
|
|
|
}
|
|
|
|
|
const showAllFilters = ref(false)
|
|
|
|
|
const filterCount = 4
|
|
|
|
|
const toggleFilters = () => {
|
|
|
|
|
showAllFilters.value = !showAllFilters.value
|
|
|
|
|
updatePlanTableMaxHeight()
|
|
|
|
|
}
|
|
|
|
|
const formRef = ref()
|
|
|
|
|
const submitDialogVisible = ref(false)
|
|
|
|
|
const submitLoading = ref(false)
|
|
|
|
|
@ -322,7 +368,8 @@ const queryParams = reactive({
|
|
|
|
|
no: undefined as string | undefined,
|
|
|
|
|
warehouseId: undefined as number | undefined,
|
|
|
|
|
checkTime: [] as string[],
|
|
|
|
|
status: undefined as number | undefined
|
|
|
|
|
status: undefined as number | undefined,
|
|
|
|
|
checkStatus: undefined as number | undefined
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const getList = async () => {
|
|
|
|
|
@ -331,6 +378,13 @@ const getList = async () => {
|
|
|
|
|
const data = await StockCheckApi.getStockCheckPage(queryParams)
|
|
|
|
|
list.value = data?.list || []
|
|
|
|
|
total.value = data?.total || 0
|
|
|
|
|
counters.allCount = Number(data?.allCount ?? data?.total ?? 0)
|
|
|
|
|
counters.waitSubmitCount = Number(data?.waitSubmitCount ?? 0)
|
|
|
|
|
counters.rejectedCount = Number(data?.rejectedCount ?? 0)
|
|
|
|
|
counters.auditingCount = Number(data?.auditingCount ?? 0)
|
|
|
|
|
counters.approvedCount = Number(data?.approvedCount ?? 0)
|
|
|
|
|
counters.checkedCount = Number(data?.checkedCount ?? 0)
|
|
|
|
|
counters.uncheckedCount = Number(data?.uncheckedCount ?? 0)
|
|
|
|
|
} finally {
|
|
|
|
|
loading.value = false
|
|
|
|
|
updatePlanTableMaxHeight()
|
|
|
|
|
@ -353,6 +407,7 @@ const handleQuery = () => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const resetQuery = () => {
|
|
|
|
|
currentStatusKey.value = 'all'
|
|
|
|
|
queryFormRef.value?.resetFields()
|
|
|
|
|
handleQuery()
|
|
|
|
|
}
|
|
|
|
|
@ -478,3 +533,44 @@ onBeforeUnmount(() => {
|
|
|
|
|
window.removeEventListener('resize', updatePlanTableMaxHeight)
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.stock-check__header {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(7, minmax(0, 1fr));
|
|
|
|
|
gap: 12px;
|
|
|
|
|
width: 100%;
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.stock-check__stat {
|
|
|
|
|
padding: 16px 18px;
|
|
|
|
|
border: 1px solid var(--el-border-color-light);
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
transition: box-shadow 0.2s ease;
|
|
|
|
|
background: #fff;
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
box-shadow: 0 10px 24px rgba(64, 158, 255, 0.12);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.is-active {
|
|
|
|
|
border-color: var(--el-color-primary);
|
|
|
|
|
box-shadow: 0 10px 24px rgba(64, 158, 255, 0.12);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.stock-check__stat-title {
|
|
|
|
|
color: var(--el-text-color-regular);
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.stock-check__stat-value {
|
|
|
|
|
margin-top: 8px;
|
|
|
|
|
color: var(--el-text-color-primary);
|
|
|
|
|
font-size: 28px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
line-height: 1;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|