<template>
|
<!-- 单详情 -->
|
<el-drawer v-model="drawerVisible" :title="`订单详情`" direction="rtl" size="80%" @close="handleDrawerClose">
|
<template #title>
|
<div class="slot_title">
|
<div class="title_orderNo">{{ title }}</div>
|
<div>物料详情</div>
|
</div>
|
</template>
|
|
<div class="detailBoxWrap">
|
<!-- 详情组件 -->
|
<!-- <open-details ref="propDetailRef"></open-details> -->
|
<div class="msi-form">
|
<el-form :model="detailForm">
|
<el-row>
|
<el-col :span="6">
|
<el-form-item label="跟踪码">
|
<el-input v-model="detailForm.snCode" clearable placeholder="请输入跟踪码" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="2">
|
<el-form-item label-width="20px">
|
<el-button type="primary" icon="ele-Search" @click="getDetail">查询</el-button>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</el-form>
|
</div>
|
<div class="msi-content">
|
<!-- <p style="margin-bottom: 10px">物料明细</p> -->
|
<el-table :data="drawerList" border striped :max-height="480">
|
<el-table-column fixed="left" type="index" label="序号" width="55" align="center" />
|
<el-table-column fixed="left" prop="materialCode" min-width="120px" label="物料编号" show-overflow-tooltip="" />
|
<el-table-column prop="materialName" label="物料名称" show-overflow-tooltip="" />
|
<el-table-column prop="quantity" label="库存数" show-overflow-tooltip="" />
|
<el-table-column prop="snCode" width="180" label="跟踪码" show-overflow-tooltip="" />
|
<el-table-column prop="containerCode" width="100" label="容器编号" show-overflow-tooltip="" />
|
<el-table-column prop="placeName" width="100" label="所在库位" show-overflow-tooltip="" />
|
<el-table-column prop="areaName" width="100" label="所在库区" show-overflow-tooltip="" />
|
<el-table-column prop="stockStatus" label="库存状态" show-overflow-tooltip="">
|
<template #default="scope">
|
{{ getEnumDesc(scope.row.stockStatus, getEnumStockStatusData_Index) }}
|
</template>
|
</el-table-column>
|
<el-table-column prop="containerIsDisabled" label="容器是否禁用" min-width="110px" show-overflow-tooltip="">
|
<template #default="scope">
|
{{ scope.row.containerIsDisabled ? "是" : "否" }}
|
</template>
|
</el-table-column>
|
<el-table-column prop="placeStatus" label="库位属性" show-overflow-tooltip="">
|
<template #default="scope">
|
{{ getEnumDesc(scope.row.placeStatus, getEnumPlaceStatusData_Index) }}
|
</template>
|
</el-table-column>
|
|
<el-table-column prop="qcStatus" label="质检状态" show-overflow-tooltip="">
|
<template #default="scope">
|
{{ getEnumDesc(scope.row.qcStatus, getEnumQCStatusData_Index) }}
|
</template>
|
</el-table-column>
|
|
<el-table-column prop="materialUnit" label="库存单位" show-overflow-tooltip="" />
|
<el-table-column prop="batch" label="批次" width="140" show-overflow-tooltip="" />
|
<el-table-column prop="relationNo" label="关联单号" min-width="150px" show-overflow-tooltip="" />
|
<el-table-column prop="recordInsertTime" label="收货时间" width="140px" :formatter="formatDate_T_Time"
|
show-overflow-tooltip="" />
|
<el-table-column prop="supplierCode" label="供应商编号" width="100" show-overflow-tooltip="" />
|
<el-table-column prop="supplierName" label="供应商名称" width="140" show-overflow-tooltip="" />
|
<el-table-column prop="supplierBatch" label="供应商批次" width="80" show-overflow-tooltip="" />
|
<el-table-column prop="erpCode" width="100" label="ERP库存地" show-overflow-tooltip="" />
|
|
<el-table-column prop="erpVoucher" width="120" label="ERP凭证" show-overflow-tooltip="" />
|
|
</el-table>
|
<Pagination :total="detailCount" v-model:page="detailForm.Page" v-model:limit="detailForm.PageSize"
|
@pagination="getDetail" style="margin-top: 20px; text-align: center"></Pagination>
|
|
<div></div>
|
</div>
|
</div>
|
</el-drawer>
|
</template>
|
<script lang="ts" setup>
|
import Pagination from "/@/components/Pagination/index.vue";
|
import { ElMessage, ElMessageBox } from "element-plus";
|
import {
|
ref,
|
nextTick,
|
computed,
|
getCurrentInstance,
|
watch,
|
defineExpose,
|
defineProps,
|
onMounted,
|
} from "vue";
|
import {
|
getTypeStatus
|
} from "/@/utils/formate";
|
|
import { formatDecimalData } from "/@/utils/formate";
|
import { expandMore } from "/@/hooks/expandMore";
|
import cache from "/@/utils/cache";
|
import { pageWmsMaterial } from "/@/api/main/WmsBase/wmsMaterial";
|
import { getAPI } from "/@/utils/axios-utils";
|
import { SysEnumApi } from "/@/api-services/api";
|
import OpenDetails from "/@/components/openDetails/openDetails.vue";
|
import { formatDate, formatDate_T_Date, formatDate_T_Time, defaultTimeRange } from '/@/utils/formatTime';
|
import commonFunction from "/@/utils/commonFunction";
|
import { handleSlectDataWmsBusinessType } from "/@/utils/selectData";
|
import { pageWmsStockQuan } from "/@/api/main/ReportCenter/wmsStockQuan_new";
|
const { proxy }: any = getCurrentInstance(); // 访问实例上下文 proxy同时支持开发 线上环境
|
const getEnumStockStatusData_Index = ref<any>([]);
|
const getContainerIsDisabled_Index = ref<any>([]);
|
const getEnumPlaceState_Index = ref<any>([]);
|
const getEnumQCStatusData_Index = ref<any>([]);
|
const getEnumPlaceStatusData_Index = ref<any>([]);
|
const { getEnumDesc } = commonFunction();
|
const emits = defineEmits(["getTabelData"]);
|
const props = defineProps({
|
titleAuthor: {
|
type: Number,
|
required: true,
|
},
|
hexiao: {
|
type: Number,
|
default: 1,
|
required: true,
|
},
|
});
|
|
// -------------------获取PO单下物料详情-----------------------------------
|
//入库单下物料详情请求
|
const detailForm = ref({
|
materialCode: "",
|
snCode:"",
|
Page: 1,
|
PageSize: 10,
|
});
|
|
// 物料详情抽屉
|
const drawerVisible = ref(false);
|
const drawerType = ref("drawerAll");
|
// const
|
//单号
|
const purchaseNo = ref("");
|
|
//打开抽屉
|
const openDrawer = async (type: number, scope: any = {}, entozhExcell?: any) => {
|
|
detailForm.value.Page = 1; //bug:点编辑-再点详情
|
detailForm.value.PageSize = 10; //bug:点编辑-再点详情
|
|
if (scope.materialCode) {
|
title.value = `${scope.materialCode}`;
|
}
|
drawerType.value = "drawerAll";
|
drawerVisible.value = true;
|
purchaseNo.value = scope.materialCode;
|
detailForm.value.materialCode = scope.materialCode;
|
|
//------------------获取物料列表物料明细
|
getDetail();
|
//------------------获取物料列表物料明细
|
|
getEnumStockStatusData_Index.value =
|
(await getAPI(SysEnumApi).apiSysEnumEnumDataListGet("StockStatusEnum")).data.result ??
|
[];
|
getContainerIsDisabled_Index.value = (await getAPI(SysEnumApi).apiSysEnumEnumDataListGet("StockStatusEnum")).data.result ?? [];
|
getEnumPlaceState_Index.value = (await getAPI(SysEnumApi).apiSysEnumEnumDataListGet("StockStatusEnum")).data.result ?? [];
|
getEnumQCStatusData_Index.value =
|
(await getAPI(SysEnumApi).apiSysEnumEnumDataListGet("StockQcStatusEnum")).data
|
.result ?? [];
|
getEnumPlaceStatusData_Index.value = (await getAPI(SysEnumApi).apiSysEnumEnumDataListGet('PlaceStatusEnum')).data.result ?? [];
|
// //----------------物料明细
|
// // 根据状态转中文 保留3位小数
|
// let scopetrans = JSON.parse(JSON.stringify(scope));
|
// // scopetrans.totalquantity = Number(scopetrans.totalquantity).toFixed(3);
|
// nextTick(() => {
|
// scopetrans.poStatus = getEnumDesc(scopetrans.poStatus, getEnumPoDetailStatusData_Index.value);
|
// scopetrans.businessType = getEnumDesc(scopetrans.businessType, getBusinessTypeData_Index.value);
|
// scopetrans.orderType = getEnumDesc(scopetrans.orderType, getEnumOrderTypeData_Index.value);
|
// proxy.$refs["propDetailRef"].openADialog(scopetrans, entozhExcell);
|
// });
|
};
|
|
//关闭抽屉
|
const handleDrawerClose = () => {
|
detailForm.value = {
|
materialCode: "",
|
snCode:"",
|
Page: 1,
|
PageSize: 10,
|
};
|
deltailList.value = [];
|
detailCount.value = 0;
|
drawerList.value = [];
|
detailCount.value = 0;
|
};
|
|
//物料详情类型
|
interface DetailType {
|
id: number;
|
}
|
|
//入库单详情列表
|
const deltailList = ref<DetailType[]>([]);
|
//弹出层数据
|
const drawerList = ref<DetailType[]>([]);
|
|
//入库单详情列表数据条数
|
const detailCount = ref(0);
|
const loading = ref(false)
|
//弹出层标题
|
let title = ref("");
|
//获取入库单下物料详情
|
const getDetail = async (callback?: any) => {
|
loading.value = true;
|
|
var res = await pageWmsStockQuan(Object.assign(detailForm.value));
|
if (res.data.type == "success") {
|
|
drawerList.value = res.data.result?.items ?? [];
|
detailCount.value = res.data.result?.total;
|
|
}
|
loading.value = false;
|
};
|
|
// 页面加载时
|
onMounted(async () => {
|
|
});
|
|
|
// 暴露方法
|
defineExpose({ openDrawer });
|
</script>
|
<style lang="less" scoped>
|
.detailBoxWrap {
|
margin: 10px;
|
}
|
|
.msi-form {
|
margin-top: 10px;
|
}
|
|
.msi-form {
|
margin-bottom: 10px;
|
}
|
|
.slot_title {
|
display: flex;
|
align-items: center;
|
|
// margin-left: 20px;
|
.title_orderNo {
|
font-size: 18px;
|
color: #F18201;
|
font-weight: bold;
|
margin-right: 5px;
|
}
|
}
|
</style>
|