|
|
|
@ -0,0 +1,84 @@
|
|
|
|
|
<template>
|
|
|
|
|
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
|
|
|
|
<el-form ref="matSubFormRef" :model="list" v-loading="formLoading" label-width="0">
|
|
|
|
|
<el-table :data="list" class="hl-table" @selection-change="handleSelectionChange">
|
|
|
|
|
<el-table-column type="selection" width="55" disabled="true" />
|
|
|
|
|
<el-table-column prop="cid" label="序号" :width="80" />
|
|
|
|
|
<el-table-column prop="matCode" label="物料编码" min-width="120" align="center" />
|
|
|
|
|
<el-table-column prop="matName" label="物料名称" min-width="140" align="center" />
|
|
|
|
|
<el-table-column prop="matType" label="物料类型" min-width="120" align="center" />
|
|
|
|
|
<el-table-column prop="shortName" label="物料简称" min-width="120" align="center" />
|
|
|
|
|
<el-table-column prop="matSpec" label="规格/型号" min-width="120" align="center" />
|
|
|
|
|
<el-table-column prop="matBrand" label="品牌" min-width="120" align="center" />
|
|
|
|
|
<el-table-column prop="rgName" label="库区" min-width="120" align="center" />
|
|
|
|
|
<el-table-column prop="pnName" label="库位" min-width="140" align="center" />
|
|
|
|
|
<el-table-column prop="matRest" label="库存数量" min-width="120" align="center" />
|
|
|
|
|
<el-table-column prop="matUnit" label="库存单位" min-width="120" align="center" />
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-form>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
|
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</Dialog>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
import * as StorageLogApi from '@/api/heli/storagelog'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
|
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
|
|
const dialogTitle = ref('') // 弹窗的标题
|
|
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
|
|
|
|
const list = ref([]) // 列表的数据
|
|
|
|
|
const total = ref(0) // 列表的总页数
|
|
|
|
|
const multipleSelection = ref([])
|
|
|
|
|
|
|
|
|
|
const handleSelectionChange = async (val) =>{
|
|
|
|
|
multipleSelection.value = val;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const queryParams = reactive({
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 10
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
/** 打开弹窗 */
|
|
|
|
|
const open = async (noZero: number, whId?: number, isAll?: number) => {
|
|
|
|
|
dialogVisible.value = true
|
|
|
|
|
dialogTitle.value = '物料列表'
|
|
|
|
|
|
|
|
|
|
message.alertWarning(noZero)
|
|
|
|
|
// 修改时,设置数据
|
|
|
|
|
|
|
|
|
|
formLoading.value = true
|
|
|
|
|
const data = await StorageLogApi.getStorageNowPage(queryParams)
|
|
|
|
|
list.value = data.list
|
|
|
|
|
total.value = data.total
|
|
|
|
|
try {
|
|
|
|
|
// 获取物料库存实时列表
|
|
|
|
|
} finally {
|
|
|
|
|
formLoading.value = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|
|
|
|
|
|
|
|
|
/** 提交表单 */
|
|
|
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
|
|
|
|
const submitForm = async () => {
|
|
|
|
|
// 提交请求
|
|
|
|
|
formLoading.value = true
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
dialogVisible.value = false
|
|
|
|
|
// 发送操作成功的事件
|
|
|
|
|
emit('success', multipleSelection.value)
|
|
|
|
|
} finally {
|
|
|
|
|
formLoading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|