<template>
|
<div class="wmsRecordPackageProcess-container">
|
<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
|
<el-form :model="queryParamsWmsRecordPackageProcess" ref="queryForm" labelWidth="90">
|
<el-row>
|
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10">
|
<el-form-item label="关键字">
|
<el-input v-model="queryParamsWmsRecordPackageProcess.searchKey" clearable="" placeholder="包装号,生产单号,批次号,订单号,位置,备注,创建人"/>
|
|
</el-form-item>
|
</el-col>
|
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsRecordPackageProcess">
|
<el-form-item label="包装号">
|
<el-input v-model="queryParamsWmsRecordPackageProcess.packageCode" clearable="" placeholder="请输入包装号"/>
|
|
</el-form-item>
|
</el-col>
|
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsRecordPackageProcess">
|
<el-form-item label="生产单号">
|
<el-input v-model="queryParamsWmsRecordPackageProcess.info5" clearable="" placeholder="请输入生产单号"/>
|
|
</el-form-item>
|
</el-col>
|
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsRecordPackageProcess">
|
<el-form-item label="批次号">
|
<el-input v-model="queryParamsWmsRecordPackageProcess.planNo" clearable="" placeholder="请输入批次号"/>
|
|
</el-form-item>
|
</el-col>
|
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsRecordPackageProcess">
|
<el-form-item label="订单号">
|
<el-input v-model="queryParamsWmsRecordPackageProcess.orderId" clearable="" placeholder="请输入订单号"/>
|
|
</el-form-item>
|
</el-col>
|
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsRecordPackageProcess">
|
<el-form-item label="包状态">
|
<el-select clearable="" v-model="queryParamsWmsRecordPackageProcess.upiStatus" placeholder="请选择包状态">
|
<el-option v-for="(item,index) in getEnumUpiStatusData_Index" :key="index" :value="item.value" :label="`${item.describe}`" />
|
|
</el-select>
|
|
</el-form-item>
|
</el-col>
|
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsRecordPackageProcess">
|
<el-form-item label="标记">
|
<el-select clearable="" v-model="queryParamsWmsRecordPackageProcess.upiFlag" placeholder="请选择标记">
|
<el-option v-for="(item,index) in getEnumUpiFlagData_Index" :key="index" :value="item.value" :label="`${item.describe}`" />
|
|
</el-select>
|
|
</el-form-item>
|
</el-col>
|
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsRecordPackageProcess">
|
<el-form-item label="位置">
|
<el-input v-model="queryParamsWmsRecordPackageProcess.location" clearable="" placeholder="请输入位置"/>
|
|
</el-form-item>
|
</el-col>
|
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsRecordPackageProcess">
|
<el-form-item label="备注">
|
<el-input v-model="queryParamsWmsRecordPackageProcess.operRemark" clearable="" placeholder="请输入备注"/>
|
|
</el-form-item>
|
</el-col>
|
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIWmsRecordPackageProcess">
|
<el-form-item label="创建时间">
|
<el-date-picker placeholder="请选择创建时间" value-format="YYYY/MM/DD HH:mm:ss" type="datetimerange" :default-time="defaultTimeRange" v-model="queryParamsWmsRecordPackageProcess.createTimeRange" />
|
|
</el-form-item>
|
</el-col>
|
<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" class="mb10">
|
<el-form-item>
|
<el-button-group style="display: flex; align-items: center;">
|
<el-button type="primary" icon="ele-Search" @click="handleQueryWmsRecordPackageProcess" v-auth="'wmsRecordPackageProcess:page'" :disabled="disabled_btnWmsRecordPackageProcess"> 查询 </el-button>
|
<el-button icon="ele-Refresh" @click="resetWmsRecordPackageProcess"> 重置 </el-button>
|
<el-button icon="ele-ZoomIn" @click="changeAdvanceQueryUIWmsRecordPackageProcess" v-if="!showAdvanceQueryUIWmsRecordPackageProcess" style="margin-left:5px;"> 高级查询 </el-button>
|
<el-button icon="ele-ZoomOut" @click="changeAdvanceQueryUIWmsRecordPackageProcess" v-if="showAdvanceQueryUIWmsRecordPackageProcess" style="margin-left:5px;"> 隐藏 </el-button>
|
<el-button type="primary" style="margin-left:5px;" icon="ele-Plus" @click="openAddWmsRecordPackageProcess" v-auth="'wmsRecordPackageProcess:add'"> 新增 </el-button>
|
<el-button type="primary" style="margin-left:5px;" icon="ele-Download" @click="handleExportExcelWmsRecordPackageProcess" v-auth="'wmsRecordPackageProcess:exportExcel'" > 导出 </el-button>
|
</el-button-group>
|
</el-form-item>
|
|
</el-col>
|
</el-row>
|
</el-form>
|
</el-card>
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-table
|
ref="tableRefWmsRecordPackageProcess"
|
:data="tableDataWmsRecordPackageProcess"
|
style="width: 100%"
|
v-loading="loadingWmsRecordPackageProcess"
|
tooltip-effect="light"
|
row-key="id"
|
@sort-change="sortChangeWmsRecordPackageProcess"
|
border="">
|
<el-table-column type="index" label="序号" width="55" align="center"/>
|
<el-table-column prop="packageCode" label="包装号" show-overflow-tooltip="" />
|
<el-table-column prop="info5" label="生产单号" show-overflow-tooltip="" />
|
<el-table-column prop="planNo" label="批次号" show-overflow-tooltip="" />
|
<el-table-column prop="orderId" label="订单号" show-overflow-tooltip="" />
|
<el-table-column prop="upiStatus" label="包状态" show-overflow-tooltip="" >
|
<template #default="scope">
|
<el-tag>{{ getEnumDesc(scope.row.upiStatus, getEnumUpiStatusData_Index)}}</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column prop="upiFlag" label="标记" show-overflow-tooltip="" >
|
<template #default="scope">
|
<el-tag>{{ getEnumDesc(scope.row.upiFlag, getEnumUpiFlagData_Index)}}</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column prop="location" label="位置" show-overflow-tooltip="" />
|
<el-table-column prop="operRemark" label="备注" show-overflow-tooltip="" />
|
<el-table-column prop="createTime" label="创建时间" width="130" :formatter="formatDate_T_Time" show-overflow-tooltip="" />
|
<el-table-column prop="createUserName" label="创建人" show-overflow-tooltip="" />
|
<el-table-column label="操作" width="140" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('wmsRecordPackageProcess:update') || auth('wmsRecordPackageProcess:delete')">
|
<template #default="scope">
|
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditWmsRecordPackageProcess(scope.row)" v-auth="'wmsRecordPackageProcess:update'"> 编辑 </el-button>
|
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delWmsRecordPackageProcess(scope.row)" v-auth="'wmsRecordPackageProcess:delete'"> 删除 </el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<el-pagination
|
v-model:currentPage="tableParamsWmsRecordPackageProcess.page"
|
v-model:page-size="tableParamsWmsRecordPackageProcess.pageSize"
|
:total="tableParamsWmsRecordPackageProcess.total"
|
:page-sizes="[10, 20, 50, 100, 200, 500]"
|
small=""
|
background=""
|
@size-change="handleSizeChangeWmsRecordPackageProcess"
|
@current-change="handleCurrentChangeWmsRecordPackageProcess"
|
layout="total, sizes, prev, pager, next, jumper"
|
/>
|
<printDialogWmsRecordPackageProcess
|
ref="printDialogRefWmsRecordPackageProcess"
|
:title="printWmsRecordPackageProcessTitle"
|
@reloadTable="handleQueryWmsRecordPackageProcess" />
|
<editDialogWmsRecordPackageProcess
|
ref="editDialogRefWmsRecordPackageProcess"
|
:title="editWmsRecordPackageProcessTitle"
|
@reloadTable="handleQueryWmsRecordPackageProcess"
|
/>
|
</el-card>
|
</div>
|
</template>
|
|
<script lang="ts" setup="" name="wmsRecordPackageProcess">
|
import { ref,onMounted } from "vue";
|
import { ElMessageBox, ElMessage } from "element-plus";
|
import { auth } from '/@/utils/authFunction';
|
import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
|
import { formatDate,formatDate_T_Date,formatDate_T_Time,defaultTimeRange } from '/@/utils/formatTime';
|
import { exportPageExcel } from '/@/utils/exportPageExcel' //引入导出方法
|
|
|
import printDialogWmsRecordPackageProcess from '/@/views/system/print/component/hiprint/preview.vue'
|
import { pageWmsRecordPackageProcess, deleteWmsRecordPackageProcess,importExcelWmsRecordPackageProcess,downloadExcelTemplateWmsRecordPackageProcess } from '/@/api/main/ReportCenter/wmsRecordPackageProcess';
|
import { getAPI } from '/@/utils/axios-utils';
|
import { SysEnumApi } from '/@/api-services/api';
|
import commonFunction from '/@/utils/commonFunction';
|
|
const getEnumUpiStatusData_Index = ref<any>([]);
|
const getEnumUpiFlagData_Index = ref<any>([]);
|
|
const { getEnumDesc } = commonFunction();
|
|
/***************************************************[包过程履历操作]开始***************************************************/
|
const showAdvanceQueryUIWmsRecordPackageProcess = ref(false);
|
const tableRefWmsRecordPackageProcess = ref(null);
|
const printDialogRefWmsRecordPackageProcess = ref();
|
const editDialogRefWmsRecordPackageProcess = ref();
|
const loadingWmsRecordPackageProcess = ref(false);
|
const disabled_btnWmsRecordPackageProcess = ref(false);
|
const tableDataWmsRecordPackageProcess = ref<any>([]);
|
const queryParamsWmsRecordPackageProcess = ref<any>({});
|
const tableParamsWmsRecordPackageProcess = ref({
|
page: 1,
|
pageSize: 10,
|
total: 0,
|
});
|
|
const printWmsRecordPackageProcessTitle = ref("");
|
const editWmsRecordPackageProcessTitle = ref("");
|
|
// 改变高级查询的控件显示状态
|
const changeAdvanceQueryUIWmsRecordPackageProcess = () => {
|
showAdvanceQueryUIWmsRecordPackageProcess.value = !showAdvanceQueryUIWmsRecordPackageProcess.value;
|
}
|
|
// 查询包过程履历
|
const handleQueryWmsRecordPackageProcess = async () => {
|
loadingWmsRecordPackageProcess.value = true;
|
disabled_btnWmsRecordPackageProcess.value = true;
|
var res = await pageWmsRecordPackageProcess(Object.assign(queryParamsWmsRecordPackageProcess.value, tableParamsWmsRecordPackageProcess.value));
|
if(res.data.type=="success"){
|
tableDataWmsRecordPackageProcess.value = res.data.result?.items ?? [];
|
tableParamsWmsRecordPackageProcess.value.total = res.data.result?.total;
|
}
|
loadingWmsRecordPackageProcess.value = false;
|
disabled_btnWmsRecordPackageProcess.value = false;
|
};
|
|
// 重置包过程履历查询
|
const resetWmsRecordPackageProcess = async () => {
|
queryParamsWmsRecordPackageProcess.value = {}
|
};
|
|
// 包过程履历列排序
|
const sortChangeWmsRecordPackageProcess = async (column: any) => {
|
queryParamsWmsRecordPackageProcess.value.field = column.prop;
|
queryParamsWmsRecordPackageProcess.value.order = column.order;
|
await handleQueryWmsRecordPackageProcess();
|
};
|
|
// 打开新增包过程履历页面
|
const openAddWmsRecordPackageProcess = () => {
|
editWmsRecordPackageProcessTitle.value = '添加包过程履历';
|
editDialogRefWmsRecordPackageProcess.value.openDialog(1,{});
|
};
|
|
// 打开打印包过程履历页面
|
const openPrintWmsRecordPackageProcess = async (row: any) => {
|
printWmsRecordPackageProcessTitle.value = '打印包过程履历';
|
}
|
|
// 打开编辑包过程履历页面
|
const openEditWmsRecordPackageProcess = (row: any) => {
|
editWmsRecordPackageProcessTitle.value = '编辑包过程履历';
|
editDialogRefWmsRecordPackageProcess.value.openDialog(2,row);
|
};
|
|
// 删除包过程履历
|
const delWmsRecordPackageProcess = (row: any) => {
|
ElMessageBox.confirm(`确定要删除吗?`, "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
})
|
.then(async () => {
|
loadingWmsRecordPackageProcess.value = true;
|
var ret = await deleteWmsRecordPackageProcess(row);
|
if(ret.data.type=="success"){
|
ElMessage.success("删除成功");
|
}
|
loadingWmsRecordPackageProcess.value = false;
|
handleQueryWmsRecordPackageProcess();
|
})
|
.catch(() => {});
|
};
|
|
// 改变包过程履历页面容量
|
const handleSizeChangeWmsRecordPackageProcess = (val: number) => {
|
tableParamsWmsRecordPackageProcess.value.pageSize = val;
|
handleQueryWmsRecordPackageProcess();
|
};
|
|
// 改变包过程履历页码序号
|
const handleCurrentChangeWmsRecordPackageProcess = (val: number) => {
|
tableParamsWmsRecordPackageProcess.value.page = val;
|
handleQueryWmsRecordPackageProcess();
|
};
|
|
/***************************************************[包过程履历操作]结束***************************************************/
|
/***************************************************[包过程履历导出]开始***************************************************/
|
//定义当前页面的方法组
|
const functionMapWmsRecordPackageProcess = {
|
getEnumUpiStatusData_Index,
|
getEnumUpiFlagData_Index,
|
formatDate_T_Date,
|
formatDate_T_Time
|
};
|
//点击导出按钮
|
const handleExportExcelWmsRecordPackageProcess = async (formData:Blob) => {
|
loadingWmsRecordPackageProcess.value = true;
|
disabled_btnWmsRecordPackageProcess.value = true;
|
var new_tableParamsWmsRecordPackageProcess=JSON.parse(JSON.stringify(tableParamsWmsRecordPackageProcess.value));
|
new_tableParamsWmsRecordPackageProcess.page = 1;
|
new_tableParamsWmsRecordPackageProcess.pageSize = 100000;
|
var res = await pageWmsRecordPackageProcess(Object.assign(queryParamsWmsRecordPackageProcess.value, new_tableParamsWmsRecordPackageProcess));
|
if(res.data.type=="success"){
|
exportExcelWmsRecordPackageProcess(res.data.result?.items ?? []);
|
}
|
loadingWmsRecordPackageProcess.value = false;
|
disabled_btnWmsRecordPackageProcess.value = false;
|
};
|
//导出
|
const exportExcelWmsRecordPackageProcess = async (exportDataList:Array) => {
|
exportPageExcel(exportDataList, tableRefWmsRecordPackageProcess,"包过程履历",functionMapWmsRecordPackageProcess);
|
};
|
/***************************************************[包过程履历导出]结束***************************************************/
|
// 包过程履历页面加载时
|
onMounted(async () => {
|
getEnumUpiStatusData_Index.value = (await getAPI(SysEnumApi).apiSysEnumEnumDataListGet('UpiStatusEnum')).data.result ?? [];
|
getEnumUpiFlagData_Index.value = (await getAPI(SysEnumApi).apiSysEnumEnumDataListGet('UpiFlagEnum')).data.result ?? [];
|
});
|
|
handleQueryWmsRecordPackageProcess();
|
</script>
|
<style scoped>
|
:deep(.el-input),
|
:deep(.el-select),
|
:deep(.el-input-number) {
|
width: 100%;
|
}
|
</style>
|