2025-01-09 18:29:48 +08:00
|
|
|
<template>
|
|
|
|
|
<el-card class="hl-card">
|
|
|
|
|
<template #header>
|
|
|
|
|
<span>库存变动日志</span>
|
|
|
|
|
</template>
|
|
|
|
|
<ContentWrap class="borderxx">
|
|
|
|
|
<!-- 搜索工作栏 -->
|
|
|
|
|
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="120px">
|
2025-11-13 09:22:25 +08:00
|
|
|
<el-form-item label="单据编号" prop="codeNo">
|
|
|
|
|
<el-input v-model="queryParams.codeNo" placeholder="单据编号" clearable @keyup.enter="handleQuery" class="!w-240px" />
|
|
|
|
|
</el-form-item>
|
2025-01-09 18:29:48 +08:00
|
|
|
<el-form-item label="物料名称" prop="matName">
|
|
|
|
|
<el-input v-model="queryParams.matName" placeholder="物料名称" clearable @keyup.enter="handleQuery" class="!w-240px" />
|
|
|
|
|
</el-form-item>
|
2025-08-04 15:43:45 +08:00
|
|
|
<!-- <el-form-item label="物料类型" prop="matType">-->
|
|
|
|
|
<!-- <el-select v-model="queryParams.matType" placeholder="下拉选择" clearable class="!w-240px">-->
|
|
|
|
|
<!-- <el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_MATERIAL_TYPE)" :key="dict.label" :label="dict.label" :value="dict.label" />-->
|
|
|
|
|
<!-- </el-select>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
2025-01-09 18:29:48 +08:00
|
|
|
<el-form-item label="仓库" prop="whId">
|
|
|
|
|
<el-select v-model="queryParams.whId" placeholder="下拉选择" clearable class="!w-240px">
|
|
|
|
|
<el-option v-for="dict in whList" :key="dict.id" :label="dict.wh_name" :value="dict.id" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
2025-08-04 15:43:45 +08:00
|
|
|
<!-- <el-form-item label="批次号" prop="lotNo" v-if="false">-->
|
|
|
|
|
<!-- <el-input v-model="queryParams.lotNo" placeholder="批次号" clearable @keyup.enter="handleQuery" class="!w-240px" />-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- <el-form-item label="业务单据编号" prop="stockNo">-->
|
|
|
|
|
<!-- <el-input v-model="queryParams.stockNo" placeholder="业务单据编号" clearable @keyup.enter="handleQuery" class="!w-240px" />-->
|
|
|
|
|
<!-- </el-form-item>-->
|
2025-01-09 18:29:48 +08:00
|
|
|
<el-form-item label="变动方向" prop="stockType">
|
|
|
|
|
<el-select v-model="queryParams.stockType" placeholder="下拉选择" clearable class="!w-240px">
|
|
|
|
|
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.HELI_STORAGE_TYPE)" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
2025-11-13 09:22:25 +08:00
|
|
|
<el-form-item label="规格/型号" prop="matSpec">
|
|
|
|
|
<el-input v-model="queryParams.matSpec" placeholder="规格/型号" clearable @keyup.enter="handleQuery" class="!w-240px" />
|
|
|
|
|
</el-form-item>
|
2025-01-09 18:29:48 +08:00
|
|
|
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button @click="handleQuery" type="primary">
|
|
|
|
|
<Icon icon="ep:search" class="mr-5px" /> 搜索
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button @click="resetQuery">
|
|
|
|
|
<Icon icon="ep:refresh" class="mr-5px" /> 重置
|
|
|
|
|
</el-button>
|
2026-03-18 17:07:48 +08:00
|
|
|
|
2025-01-09 18:29:48 +08:00
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
|
|
|
|
|
<!-- 列表 -->
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" class="hl-table">
|
|
|
|
|
<el-table-column type="index" width="100" fixed label="序号" align="center" />
|
2026-03-18 17:07:48 +08:00
|
|
|
<el-table-column label="物料编码" align="center" prop="matCode" min-width="150" fixed>
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<template v-if="scope.row.goodsType == 2">
|
|
|
|
|
<el-form-item class="mb-0px!">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="scope.row.matId"
|
|
|
|
|
placeholder=""
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
filterable
|
|
|
|
|
clearable
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in scope.row.materialDOList"
|
|
|
|
|
:key="dict.id"
|
|
|
|
|
:label="dict.code + ' ' + dict.name"
|
|
|
|
|
:value="dict.id"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
{{ scope.row.matCode }}
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2025-01-09 18:29:48 +08:00
|
|
|
<el-table-column label="物料名称" align="center" prop="matName" min-width="120" fixed />
|
|
|
|
|
<el-table-column label="规格/型号" align="center" prop="matSpec" min-width="120" />
|
2025-08-04 15:43:45 +08:00
|
|
|
<el-table-column label="单据编号" align="center" prop="codeNo" min-width="180" />
|
|
|
|
|
<el-table-column label="业务单据类型" align="center" prop="stockMode" min-width="180" >
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.HELI_STOCK_MODE" :value="scope.row.stockMode" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="仓库" align="center" prop="whName" min-width="100" />
|
|
|
|
|
<el-table-column label="库区" align="center" prop="rgName" min-width="100" />
|
|
|
|
|
<el-table-column label="库位" align="center" prop="pnName" min-width="100" />
|
2026-03-18 17:07:48 +08:00
|
|
|
<!-- <el-table-column label="盘库前数量" align="center" prop="storageBef" min-width="140" />-->
|
|
|
|
|
<!-- <el-table-column label="盘库后数量" align="center" prop="storageAft" min-width="140" />-->
|
2025-08-04 15:43:45 +08:00
|
|
|
<el-table-column label="入/出库数量" align="center" prop="storageOkQty" min-width="140" fixed="right" >
|
|
|
|
|
<template #default="scope">
|
2025-11-13 09:22:25 +08:00
|
|
|
{{scope.row.stockType==1 || scope.row.storageOkQty<0?scope.row.storageOkQty:'-'+scope.row.storageOkQty}}
|
2025-08-04 15:43:45 +08:00
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="库存单位" align="center" prop="matUnit" fixed="right" min-width="120">
|
2025-01-09 18:29:48 +08:00
|
|
|
<template #default="scope">
|
2025-08-04 15:43:45 +08:00
|
|
|
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_UNIT" :value="scope.row.matUnit" />
|
2025-01-09 18:29:48 +08:00
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<!-- 分页 -->
|
|
|
|
|
<Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
</el-card>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import * as StorageLogApi from '@/api/heli/storagelog'
|
|
|
|
|
|
|
|
|
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
|
|
|
|
|
import * as WarehouseApi from '@/api/heli/warehouse'
|
2025-08-20 19:22:53 +08:00
|
|
|
import routeParamsCache from '@/utils/routeParamsCache'
|
2025-11-13 09:22:25 +08:00
|
|
|
import axios from "axios";
|
|
|
|
|
import {getAccessToken, getTenantId} from "@/utils/auth";
|
2026-03-18 17:07:48 +08:00
|
|
|
import Material from "@/views/heli/material/index.vue";
|
|
|
|
|
import MaterialSelect from "@/views/heli/hlvuestyle/materialSelect.vue";
|
2025-01-09 18:29:48 +08:00
|
|
|
|
|
|
|
|
defineOptions({ name: 'StorageLog' })
|
|
|
|
|
|
|
|
|
|
const whList = ref([])
|
|
|
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
const { t } = useI18n() // 国际化
|
2025-11-13 09:22:25 +08:00
|
|
|
const exportLoading = ref(false) // 导出的加载中
|
2025-01-09 18:29:48 +08:00
|
|
|
const loading = ref(true) // 列表的加载中
|
|
|
|
|
const list = ref([]) // 列表的数据
|
|
|
|
|
const total = ref(0) // 列表的总页数
|
|
|
|
|
const queryParams = reactive({
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
matCode: undefined,
|
|
|
|
|
matName: undefined,
|
|
|
|
|
matType: undefined,
|
|
|
|
|
whId:undefined,
|
|
|
|
|
lotNo: undefined,
|
|
|
|
|
pnId: undefined,
|
|
|
|
|
stockNo: undefined,
|
|
|
|
|
stockType: undefined,
|
2025-11-13 09:22:25 +08:00
|
|
|
headerNo: undefined,
|
|
|
|
|
codeNo:undefined,
|
|
|
|
|
matSpec:undefined,
|
2025-01-09 18:29:48 +08:00
|
|
|
})
|
|
|
|
|
const queryFormRef = ref() // 搜索的表单
|
|
|
|
|
|
|
|
|
|
/** 查询列表 */
|
|
|
|
|
const getList = async () => {
|
|
|
|
|
loading.value = true
|
|
|
|
|
try {
|
|
|
|
|
const data = await StorageLogApi.getStorageLogPage(queryParams)
|
|
|
|
|
list.value = data.list
|
|
|
|
|
total.value = data.total
|
|
|
|
|
} finally {
|
|
|
|
|
loading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
const handleQuery = () => {
|
|
|
|
|
queryParams.pageNo = 1
|
|
|
|
|
getList()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
const resetQuery = () => {
|
|
|
|
|
queryFormRef.value.resetFields()
|
|
|
|
|
handleQuery()
|
|
|
|
|
}
|
|
|
|
|
//仓库列表
|
|
|
|
|
const init_page_wh = (async ()=>{
|
|
|
|
|
whList.value = await WarehouseApi.getSimpList()
|
|
|
|
|
})
|
|
|
|
|
// //库区列表
|
|
|
|
|
// const init_page_rg = (async ()=>{
|
|
|
|
|
// rgList.value = await RgApi.getSimpList()
|
|
|
|
|
// })
|
|
|
|
|
// //库位列表
|
|
|
|
|
// const init_page_pn = (async ()=>{
|
|
|
|
|
// pnList.value = await PnApi.getSimpList()
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
/** 初始化 **/
|
2025-08-20 19:22:53 +08:00
|
|
|
const route = useRoute()
|
2025-08-20 20:23:56 +08:00
|
|
|
const routeValue = ref('')
|
2025-01-09 18:29:48 +08:00
|
|
|
onMounted(async () => {
|
2025-08-20 19:22:53 +08:00
|
|
|
let params = routeParamsCache.get(route.path);
|
2025-08-20 20:23:56 +08:00
|
|
|
routeValue.value = route.path
|
2025-08-20 19:22:53 +08:00
|
|
|
if (params ) {
|
|
|
|
|
Object.assign(queryParams, params);
|
|
|
|
|
}
|
2025-01-09 18:29:48 +08:00
|
|
|
await init_page_wh()
|
|
|
|
|
// await init_page_rg()
|
|
|
|
|
// await init_page_pn()
|
|
|
|
|
await getList()
|
|
|
|
|
})
|
2025-08-20 19:22:53 +08:00
|
|
|
onBeforeUnmount(() => {
|
|
|
|
|
const plainParams = JSON.parse(JSON.stringify(queryParams));
|
2025-08-20 20:23:56 +08:00
|
|
|
routeParamsCache.set(routeValue.value, plainParams);
|
2025-08-20 19:22:53 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
window.addEventListener('beforeunload', () => {
|
|
|
|
|
const plainParams = JSON.parse(JSON.stringify(queryParams));
|
2025-08-20 20:23:56 +08:00
|
|
|
routeParamsCache.set(routeValue.value, plainParams);
|
2025-08-20 19:22:53 +08:00
|
|
|
});
|
2025-01-09 18:29:48 +08:00
|
|
|
</script>
|