Compare commits
No commits in common. "ce0d10eb952f308549571136da9b77ccaa03a6f9" and "fb258dafae4a33e0a96ec885687c9d8479b9e9bb" have entirely different histories.
ce0d10eb95
...
fb258dafae
@ -28,19 +28,6 @@ export function getReceivingDetail(data: any): Promise<any> {
|
||||
})
|
||||
}
|
||||
|
||||
export function queryReceivingLogs(data: any): Promise<any> {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'storage.receiving.queryReceivingLogs',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 未使用
|
||||
// export function getReceivingProduct(data: any): Promise<any> {
|
||||
// return request({
|
||||
|
||||
@ -4,11 +4,10 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
:icon="Refresh"
|
||||
@click="fetchReceivingLogs"
|
||||
icon="Refresh"
|
||||
@click="fetchStockInfo"
|
||||
title="刷新"
|
||||
:loading="loading"
|
||||
:disabled="!props.id"
|
||||
class="toolbar-btn"
|
||||
>
|
||||
刷新
|
||||
@ -86,15 +85,15 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, watch } from 'vue'
|
||||
import { ref, reactive, watch, onMounted } from 'vue'
|
||||
import { useResizeObserver } from '@vueuse/core'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Refresh } from '@element-plus/icons-vue'
|
||||
import * as receivingApi from '@/api/storage_receiving/receiving'
|
||||
import * as stockApi from '@/api/stock/stock'
|
||||
import RequestData from '@/components/RequestData/index.vue'
|
||||
|
||||
const props = defineProps<{
|
||||
id?: number | string
|
||||
id?: number
|
||||
}>()
|
||||
|
||||
const loading = ref(false)
|
||||
@ -120,13 +119,17 @@ useResizeObserver(tableHostRef, (entries) => {
|
||||
|
||||
watch(() => props.id, (newVal) => {
|
||||
if (newVal) {
|
||||
pagination.page = 1
|
||||
fetchReceivingLogs()
|
||||
fetchStockInfo()
|
||||
} else {
|
||||
tableData.value = []
|
||||
pagination.total = 0
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
if (props.id) {
|
||||
fetchStockInfo()
|
||||
}
|
||||
requestAnimationFrame(() => {
|
||||
const el = tableHostRef.value
|
||||
if (el) {
|
||||
@ -134,55 +137,26 @@ watch(() => props.id, (newVal) => {
|
||||
if (h >= 100) tableHeight.value = Math.floor(h)
|
||||
}
|
||||
})
|
||||
}, { immediate: true })
|
||||
})
|
||||
|
||||
async function handlePageChange(page: number) {
|
||||
pagination.page = page
|
||||
await fetchReceivingLogs()
|
||||
await fetchStockInfo()
|
||||
}
|
||||
|
||||
async function handlePageSizeChange(pageSize: number) {
|
||||
pagination.pageSize = pageSize
|
||||
pagination.page = 1
|
||||
await fetchReceivingLogs()
|
||||
await fetchStockInfo()
|
||||
}
|
||||
|
||||
async function fetchReceivingLogs() {
|
||||
async function fetchStockInfo() {
|
||||
if (!props.id) return
|
||||
|
||||
loading.value = true
|
||||
try {
|
||||
const res: any = await receivingApi.queryReceivingLogs({
|
||||
receiving_id: props.id,
|
||||
pagination: {
|
||||
page: pagination.page,
|
||||
pageSize: pagination.pageSize
|
||||
}
|
||||
})
|
||||
|
||||
if (res && (res.code === 200 || res.code === 0 || res.code === 1)) {
|
||||
const data = res.data || {}
|
||||
tableData.value = Array.isArray(data.list) ? data.list : []
|
||||
pagination.page = data.pagination?.page ?? pagination.page
|
||||
pagination.pageSize = data.pagination?.pageSize ?? pagination.pageSize
|
||||
pagination.total = data.pagination?.total ?? 0
|
||||
} else {
|
||||
tableData.value = []
|
||||
pagination.total = 0
|
||||
ElMessage.error(res?.message || '获取收货单操作日志失败')
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error('获取收货单操作日志失败', error)
|
||||
tableData.value = []
|
||||
pagination.total = 0
|
||||
ElMessage.error(error?.message || '获取收货单操作日志失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function viewData(row: any) {
|
||||
requestId.value = Number(row.external_log_id) || 0
|
||||
requestId.value = row.external_log_id
|
||||
requestType.value = row.external_log_type
|
||||
showRequestData.value = true
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user