update 出入库记录页面,1修改时间查询条件的控件支持时分秒查询。2组织和仓库和货位要有关联关系.3作业类型按照常量表的SEQ排序

This commit is contained in:
18110972313 2025-05-20 19:31:12 +08:00
parent bc0a45cec4
commit 451adfd327

View File

@ -7,7 +7,7 @@
<el-row class="page-search" justify="space-between" align="bottom">
<el-form ref="queryFormRef" :model="queryParams" label-width="60px" label-position="left">
<el-row :gutter="24" class="form-row">
<el-col :span="4">
<el-col :span="6">
<el-form-item label="作业类型" prop="RECEIVEREQUESTNAMETYPE">
<el-select multiple filterable v-model="queryParams.RECEIVEREQUESTNAMETYPE" placeholder="选择作业类型"
style="width: 240px" default-first-option>
@ -16,7 +16,8 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<!-- <el-col :span="4">
<el-form-item label="组织" prop="ERPFACTORY">
<el-select multiple filterable v-model="queryParams.ERPFACTORY" placeholder="选择组织"
style="width: 240px" default-first-option>
@ -24,8 +25,19 @@
:value="item.ERPFACTORY" />
</el-select>
</el-form-item>
</el-col>-->
<el-col :span="6" class="col_height">
<el-form-item label="组织" prop="params.ERPFACTORY">
<el-select multiple filterable v-model="queryParams.ERPFACTORY" placeholder="下拉选择组织" style="width: 240px"
default-first-option @change="GetERPLocationForList">
<el-option v-for="item in state.ERPFactoryList" :key="item.ERPFACTORY" :label="item.DESCRIPTION"
:value="item.ERPFACTORY" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<!--
<el-col :span="6">
<el-form-item label="仓库" prop="ERPLOCATION">
<el-select multiple filterable v-model="queryParams.ERPLOCATION" placeholder="选择仓库"
style="width: 240px" default-first-option>
@ -33,34 +45,62 @@
:value="item.ENUMVALUE" />
</el-select>
</el-form-item>
</el-col>-->
<el-col :span="6" class="col_height">
<el-form-item label="仓库" prop="ERPLOCATION">
<el-select v-model="queryParams.ChangeERPLocation" placeholder="下拉选择仓库" multiple filterable style="width: 240px"
@visible-change="GetLocationListForSomeERPLocation" default-first-option>
<el-option v-for="item in state.erpLocationList" :key="item.ENUMVALUE" :label="item.DESCRIPTION"
:value="item.ENUMVALUE" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-col :span="6">
<el-form-item label="目的货位" prop="LOCATIONNAME">
<el-select
size="small"
v-model="queryParams.LOCATIONNAME"
multiple filterable
placeholder="下拉选择货位" :filter-method="getlocDec"
default-first-option
>
<el-option
v-for="item in state.locDecList2"
:key="item.VALUE"
:label="item.LABEL"
:value="item.VALUE"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="物料" prop="MATERIALSPECNAME">
<el-Input v-model="queryParams.MATERIALSPECNAME" clearable />
</el-form-item>
</el-col>
<el-col :span="4">
<el-col :span="6">
<el-form-item label="品名" prop="DESC_CN">
<el-Input v-model="queryParams.DESC_CN" clearable />
</el-form-item>
</el-col>
<el-col :span="4">
<el-col :span="6">
<el-form-item label="出库单号" prop="SHIPREQUESTNAME">
<el-Input v-model="queryParams.SHIPREQUESTNAME" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24" class="form-row">
<el-col :span="4">
<el-col :span="6">
<el-form-item label="入库单号" prop="RECEIVEREQUESTNAME">
<el-Input v-model="queryParams.RECEIVEREQUESTNAME" clearable />
</el-form-item>
</el-col>
<el-col :span="4">
<el-col :span="6">
<el-form-item label="批次" prop="CHARGE">
<el-Input v-model="queryParams.CHARGE" clearable />
</el-form-item>
</el-col>
<!--
<el-col :span="4">
<el-form-item label="开始时间" prop="FROMDATE">
<el-date-picker v-model="queryParams.FROMDATE" value-format="YYYYMMDD" type="date"
@ -73,6 +113,14 @@
placeholder="Pick a day" />
</el-form-item>
</el-col>
-->
<el-col :span="6">
<el-form-item label="入库时间" prop="params.USERNAME">
<el-date-picker v-model="queryParams.DateValue" type="datetimerange" unlink-panels range-separator="To"
v-model:start-placeholder="queryParams.FROMDATE"
v-model:end-placeholder="queryParams.TODATE" :shortcuts="shortcuts2" :size="size" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="page-search-btns">
@ -147,6 +195,7 @@ import { getQueryPageList, getQueryList } from '@/api/common';
import exportDataToExcel from '@/utils/export-excel';
import { bTableHeight } from "../../../../composables/calcTableHeight";
import { getORG } from '@/api/auth'
import { areAllNotEmpty, msToDate } from '@/utils/CommonUtil'
const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(155);
const { proxy }: any = getCurrentInstance();
@ -156,6 +205,7 @@ const materialTableConfig = ref({
column: [] as any,
data: [],
})
const size = ref<'default' | 'large' | 'small'>('small');//formdata
const state = reactive({
ERPFACTORY: '',
AllNumber: 0,//
@ -167,7 +217,14 @@ const state = reactive({
] as any,*/
ReceiveList: [] as any,
ERPFactoryList: [] as any,
ERPLocationList: [] as any,
erpLocationList: [] as any,
locDecList2: [] as any,
locDecListAll: [] as any,
EVENTOUT: ['BarCodeToTransferIn','调拨出库','MES消耗','auxiliaryStockOut','CompletedShipRequestZL','CompletedShipRequestBL','CompletedShipRequestLL','CompletedShipRequestNLCC'],
EVENTIN: ['AlloctionStockIn','FGStockIn','ReturnStockIn','NormalStockInForSDK','NoChargeStockIn','NoChargeStockIn',],
queryParams: {
MATERIALSPECNAME: '',
RECEIVEREQUESTNAMETYPE: '',
@ -183,6 +240,9 @@ const state = reactive({
RECEIVEREQUESTNAME: '',
REQUESTNAME: '',
DESC_CN: '',
DateValue: '',
ChangeERPLocation: '',
LOCATIONNAME: '',
},
page: {
pageNum: 1,
@ -193,10 +253,49 @@ const state = reactive({
loading: false,
list: [],
column: [] as any,
queryParamsERPLocation: {
queryId: "GetErpLocationList",
version: "WEB00005",
params: {
SITENAME: localStorage.getItem("siteName") || 'SDK',
ERPFACTORYNAME: '',
},
pageNum: 1,
pageSize: 10
},
});
const { ERPFACTORY,loading, list, column, queryParams, page } = toRefs(state)
//
const shortcuts2 = [
{
text: '',
value: () => {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
return [start, end]
},
},
{
text: '',
value: () => {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
return [start, end]
},
},
{
text: '',
value: () => {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
return [start, end]
},
},
]
onMounted(() => {
materialTableConfig.value.column = [
{ header: "作业类型", field: "LASTEVENTNAME", hide: false , width: '150px'},
@ -285,6 +384,10 @@ function getPRINTLIST() {
}
function handleQueryInfo() {
state.page.pageNum = 1
if (state.queryParams.DateValue.length > 0) {
state.queryParams.FROMDATE = msToDate(state.queryParams.DateValue[0]).hasTime
state.queryParams.TODATE = msToDate(state.queryParams.DateValue[1]).hasTime
}
/**
* 增加时间非空校验
* 2025-05-07
@ -306,9 +409,16 @@ function handleQuery() {
state.list = [];
state.page.total = 0;
let loactionString = ''
if (state.queryParams.RECEIVEREQUESTNAMETYPE.length > 0){
for (let i = 0; i < state.queryParams.RECEIVEREQUESTNAMETYPE.length; i++) {
loactionString = loactionString + state.queryParams.RECEIVEREQUESTNAMETYPE[i] + ','
}
}else {
loactionString = 'NormalStockInForSDK'
const combined = [...state.EVENTOUT, ...state.EVENTIN];
loactionString = combined.join(',');
}
/*
if (loactionString == '') {
loactionString = 'BarCodeToTransferIn,allocateStockIn,receiveMesShippInfo,Assign';
@ -319,8 +429,12 @@ function handleQuery() {
erpFactoryString = erpFactoryString + state.queryParams.ERPFACTORY[i] + ','
}
let erpLocationString = ''
for (let i = 0; i < state.queryParams.ERPLOCATION.length; i++) {
erpLocationString = erpLocationString + state.queryParams.ERPLOCATION[i] + ','
for (let i = 0; i < state.queryParams.ChangeERPLocation.length; i++) {
erpLocationString = erpLocationString + state.queryParams.ChangeERPLocation[i] + ','
}
let locationNameString = ''
for (let i = 0; i < state.queryParams.LOCATIONNAME.length; i++) {
locationNameString = locationNameString + state.queryParams.LOCATIONNAME[i] + ','
}
state.loading = true
queryFormRef.value.validate((isValid: boolean) => {
@ -342,10 +456,9 @@ function handleQuery() {
FROMDATE: state.queryParams.FROMDATE,
TODATE: state.queryParams.TODATE,
SITENAME: '',
//'BarCodeToTransferIn','','MES','auxiliaryStockOut''CompletedShipRequest'
EVENTOUT: ['BarCodeToTransferIn','调拨出库','MES消耗','auxiliaryStockOut','CompletedShipRequestZL','CompletedShipRequestBL','CompletedShipRequestLL','CompletedShipRequestNLCC'],
//'AlloctionStockIn','FGStockIn','ReturnStockIn','NormalStockInForSDK','NoChargeStockIn'
EVENTIN: ['AlloctionStockIn','FGStockIn','ReturnStockIn','NormalStockInForSDK','NoChargeStockIn','NoChargeStockIn',],
EVENTOUT: state.EVENTOUT,
EVENTIN: state.EVENTOUT,
LOCATIONNAME: locationNameString,
/*
UNDOID: state.queryParams.UNDOID,
STOCKSTATE: state.queryParams.STOCKSTATE,
@ -450,6 +563,12 @@ function resetQuery() {
//handleQuery();
state.list = [];
state.page.total = 0;
state.queryParams.ChangeERPLocation = '';
state.erpLocationList = [];
//state.ERPFactoryList = [];
state.queryParams.ERPFACTORY = '';
state.queryParams.FROMDATE = '';
state.queryParams.TODATE = '';
}
/**
@ -464,7 +583,10 @@ function getEnumdefValueList(param: any) {
ENUMNAME: param
},
}).then((res: any) => {
state.ReceiveList = res.data
const sortedData = [...res.data].sort((a, b) => {
return a.SEQ - b.SEQ;
});
state.ReceiveList = sortedData;
})
}
@ -527,6 +649,115 @@ function exportTransactionExcel() {
proxy.$ElMessage.warning('当前查询没有数据可以导出');
}
}
function GetERPLocationForList(value: any) {
ERPLocationQuery();
}
//ERP
function ERPLocationQuery() {
state.queryParamsERPLocation.params.ERPFACTORYNAME = state.queryParams.ERPFACTORY
let erpLoactionString = ''
for (let i = 0; i < state.queryParams.RECEIVEREQUESTNAMETYPE.length; i++) {
erpLoactionString = erpLoactionString + state.queryParams.RECEIVEREQUESTNAMETYPE[i] + ','
}
getQueryList({
queryId: "GetErpLocationList",
version: "WEB00005",
params: {
SITENAME: localStorage.getItem("siteName") || 'SDK',
ERPFACTORYNAME: erpLoactionString,
},
pageNum: 1,
pageSize: 10
})
.then((res: any) => {
state.erpLocationList = res.data;
// state.ERPLocationList.unshift({
// ENUMVALUE: ''
// });
})
.catch(() => { });
}
//ERP
function ERPFactoryQuery() {
getORG({ orgNo: null})
.then((res: any) => {
state.ERPFactoryList = res.resultObj;
state.ERPFactoryList.unshift({
ERPFACTORY: ''
});
})
.catch(() => { });
}
function GetLocationListForSomeERPLocation(value: any) {
state.queryParams.LOCATIONNAME = ''
state.locDecList2 = []
if (!areAllNotEmpty(state.queryParams.ERPFACTORY)) {
proxy.$ElMessage.warning('当前还未选择组织');
return
} else {
let erpLocationString = ''
for (let i = 0; i < state.queryParams.ChangeERPLocation.length; i++) {
erpLocationString = erpLocationString + state.queryParams.ChangeERPLocation[i] + ','
}
getQueryList({
queryId: 'GetLocationForCreatePO',
version: '00002',
params: {
ERPLOCATION: erpLocationString,
SITENAME: 'SDK'
}
}).then((res: any) => {
state.locDecListAll = res.data
//getlocDec('')
})
}
/*if (!value) {
let ERPLOCATIONList = state.ChangeERPLocation;
getQueryList({
queryId: "GetLocationListForSomeERPLocation",
version: "00001",
params: {
SITENAME: localStorage.getItem("siteName") || 'SDK',
ERPLOCATION: ERPLOCATIONList.length ? ERPLOCATIONList.join(','): ""
},
})
.then((res: any) => {
state.LocationList = res.data;
state.LocationList.unshift({
STORAGENAME: ''
});
})
.catch(() => { });
}*/
}
function getlocDec(query: any) {
if (!areAllNotEmpty(state.queryParams.ChangeERPLocation)) {
proxy.$ElMessage.warning('当前还未选择仓库');
state.queryParams.LOCATIONNAME = ''
state.locDecList2 = []
return
}
// console.log(query)
//let arr = state.locDecListAll;
let arr = state.locDecListAll.filter((item: any) => {
return item.LABEL.includes(query) || item.VALUE.includes(query)
})
// console.log(arr)
if (arr.length > 50) {
state.locDecList2 = arr.slice(0, 50)
} else {
state.locDecList2 = arr
}
}
</script>
<style scoped lang="scss">