<template>
|
<div class="notice">
|
<el-dialog
|
v-model="dialogVisible"
|
:title="title"
|
width="50%"
|
:before-close="handleClose"
|
:close-on-press-escape="false"
|
:close-on-click-modal="false"
|
>
|
<el-table v-loading="loading" :data="state.dataList" :border="true">
|
<el-table-column label="序号" type="index" align="center" width="80" />
|
<el-table-column label="时间" prop="createTime" align="center" width="120" />
|
<el-table-column label="类型" prop="state" align="center">
|
<template #default="scope">
|
<span>{{scope.row.state ===0 ? '批量导入' : scope.row.state ===3 ? '标签作废' : scope.row.state ===5 ? '销售' : ''}}</span>
|
|
</template>
|
</el-table-column>
|
<el-table-column label="数量" prop="num" align="center" />
|
<el-table-column label="操作人" prop="createName" align="center" />
|
<el-table-column label="变动后剩余" prop="remaining" align="center" />
|
</el-table>
|
<pagination
|
v-show="state.total > 0"
|
:total="state.total"
|
v-model:page="state.queryParams.pageNum"
|
v-model:limit="state.queryParams.pageSize"
|
@pagination="getRecord"
|
/>
|
|
</el-dialog>
|
</div>
|
</template>
|
<script setup>
|
import {reactive, ref, toRefs} from 'vue'
|
import {ElMessage} from "element-plus";
|
import {addWarehouse, checkName, editWarehouse} from "@/api/hazardousChemicals/warehouse";
|
import {verifyPhone} from "@/utils/validate";
|
import {checkBasicName} from "@/api/hazardousChemicals/basicInfo";
|
import {getProductRecord, getProWarehouseRecord} from "@/api/hazardousChemicals/productRecord";
|
|
const dialogVisible = ref(false);
|
const title = ref("");
|
const busRef = ref();
|
const length = ref()
|
const emit = defineEmits(["getList"]);
|
const loading = ref(false)
|
const state = reactive({
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
warehouseId: '',
|
basicId: ''
|
},
|
total: 0,
|
dataList: []
|
|
})
|
|
|
const openDialog = async (value) => {
|
title.value = value.productBasic.name + ' ' + '(编号:' + value.productBasic.productSn + ')' + ' '+ '的取用记录'
|
state.form = JSON.parse(JSON.stringify(value));
|
await getRecord()
|
dialogVisible.value = true;
|
}
|
|
const getRecord = async () => {
|
loading.value = true
|
state.queryParams.basicId = state.form.basicId;
|
state.queryParams.warehouseId = state.form.warehouseId;
|
const res = await getProWarehouseRecord(state.queryParams)
|
if(res.code == 200){
|
state.dataList = res.data.list
|
state.total = res.data.total
|
}else{
|
ElMessage.warning(res.message)
|
}
|
loading.value = false
|
}
|
|
const handleClose = () => {
|
reset();
|
dialogVisible.value = false;
|
emit("getList")
|
}
|
const reset = () => {
|
state.form = {
|
id: '',
|
name: '',
|
remark: '',
|
}
|
}
|
defineExpose({
|
openDialog
|
});
|
|
</script>
|
|
<style scoped lang="scss">
|
.notice{
|
:deep(.el-form .el-form-item__label) {
|
font-size: 15px;
|
}
|
.file {
|
display: flex;
|
flex-direction: column;
|
align-items: flex-start;
|
}
|
}
|
</style>
|