170 lines
6.9 KiB
Vue
170 lines
6.9 KiB
Vue
![]() |
<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">
|
||
|
<el-form-item label="物料编码" prop="matCode">
|
||
|
<el-input v-model="queryParams.matCode" placeholder="物料编码" clearable @keyup.enter="handleQuery" class="!w-240px" />
|
||
|
</el-form-item>
|
||
|
<el-form-item label="物料名称" prop="matName">
|
||
|
<el-input v-model="queryParams.matName" placeholder="物料名称" clearable @keyup.enter="handleQuery" class="!w-240px" />
|
||
|
</el-form-item>
|
||
|
<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>
|
||
|
<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>
|
||
|
<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>
|
||
|
<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>
|
||
|
<el-form-item label="上游单据编号" prop="headerNo">
|
||
|
<el-input v-model="queryParams.headerNo" placeholder="上游单据编号" clearable @keyup.enter="handleQuery" class="!w-240px" />
|
||
|
</el-form-item>
|
||
|
|
||
|
<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>
|
||
|
</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" />
|
||
|
<el-table-column label="物料编码" align="center" prop="matCode" min-width="120" fixed />
|
||
|
<el-table-column label="物料名称" align="center" prop="matName" min-width="120" fixed />
|
||
|
<el-table-column label="物料类型" align="center" prop="matType" min-width="120" />
|
||
|
<el-table-column label="物料简称" align="center" prop="shortName" min-width="120" />
|
||
|
<el-table-column label="规格/型号" align="center" prop="matSpec" min-width="120" />
|
||
|
<el-table-column label="品牌" align="center" prop="matBrand" min-width="120" />
|
||
|
<el-table-column label="业务单据编号" align="center" prop="stockNo" min-width="180" />
|
||
|
<el-table-column label="业务单据类型" align="center" prop="stockTypeName" min-width="120" />
|
||
|
<el-table-column label="上游单据编号" align="center" prop="headerNo" min-width="120" />
|
||
|
<el-table-column label="仓库" align="center" prop="whName" min-width="120" />
|
||
|
<el-table-column label="库区" align="center" prop="rgName" min-width="120" />
|
||
|
<el-table-column label="库位" align="center" prop="pnName" min-width="140" />
|
||
|
<el-table-column label="批次号" align="center" prop="lotNo" min-width="120" v-if="false" />
|
||
|
<el-table-column label="变动数量" align="center" prop="storageOkQty" fixed="right" min-width="120">
|
||
|
<template #default="scope">
|
||
|
<span v-if="scope.row.storageOkQty<0" style="color:#EC808D;">
|
||
|
{{scope.row.storageOkQty}}
|
||
|
</span>
|
||
|
<span v-else-if="scope.row.storageOkQty>0" style="color:#63A103;">
|
||
|
+{{scope.row.storageOkQty}}
|
||
|
</span>
|
||
|
<span v-else>
|
||
|
{{scope.row.storageOkQty}}
|
||
|
</span>
|
||
|
</template>
|
||
|
</el-table-column>
|
||
|
<el-table-column label="库存单位" align="center" prop="matUnit" fixed="right" min-width="120" />
|
||
|
</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 download from '@/utils/download'
|
||
|
import * as StorageLogApi from '@/api/heli/storagelog'
|
||
|
|
||
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||
|
|
||
|
import * as WarehouseApi from '@/api/heli/warehouse'
|
||
|
// import * as RgApi from '@/api/heli/rg'
|
||
|
// import * as PnApi from '@/api/heli/pn'
|
||
|
|
||
|
defineOptions({ name: 'StorageLog' })
|
||
|
|
||
|
const whList = ref([])
|
||
|
// const rgList = ref([])
|
||
|
// const pnList = ref([])
|
||
|
|
||
|
const message = useMessage() // 消息弹窗
|
||
|
const { t } = useI18n() // 国际化
|
||
|
|
||
|
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,
|
||
|
headerNo: undefined
|
||
|
})
|
||
|
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()
|
||
|
// })
|
||
|
|
||
|
/** 初始化 **/
|
||
|
onMounted(async () => {
|
||
|
await init_page_wh()
|
||
|
// await init_page_rg()
|
||
|
// await init_page_pn()
|
||
|
await getList()
|
||
|
})
|
||
|
</script>
|