feat 货位模块变更

This commit is contained in:
Amjacks 2025-04-15 11:29:21 +08:00
parent 1720ee6bda
commit 3476e3a3c0
3 changed files with 103 additions and 207 deletions

View File

@ -30,37 +30,4 @@ export function deleteStorage(data: any) {
method: 'post', method: 'post',
data: data, data: data,
}); });
}
/**
*
* */
export function createStorage(data: any) {
return request({
url: '/api/api/storage/addStorage',
method: 'post',
data: data,
});
}
/**
*
* */
export function editStorage(data: any) {
return request({
url: '/api/api/storage/editStorage',
method: 'post',
data: data,
});
}
/**
*
* */
export function delStorage(data: any) {
return request({
url: '/api/api/storage/delStorage',
method: 'post',
data: data,
});
} }

View File

@ -7,3 +7,58 @@ export function editWareHouse(params: any) {
data: params, data: params,
}); });
} }
/**
*
*/
export function page(data: any) {
return request({
url: '/api/api/wareHouse/page',
method: 'post',
data: data,
});
}
/**
*
*/
export function search(data: any) {
return request({
url: '/api/api/wareHouse/search',
method: 'post',
data: data,
});
}
/**
*
*/
export function createStorage(data: any) {
return request({
url: '/api/api/wareHouse/addStorage',
method: 'post',
data: data,
});
}
/**
*
*/
export function editStorage(data: any) {
return request({
url: '/api/api/wareHouse/editStorage',
method: 'post',
data: data,
});
}
/**
*
*/
export function delStorage(data: any) {
return request({
url: '/api/api/wareHouse/delStorage',
method: 'post',
data: data,
});
}

View File

@ -1,41 +1,16 @@
<!--
功能功能描述 货位信息
作者Libra
邮箱mingxichen@163.com
时间2024年04月08日 15:46:01
版本v1.0
修改记录
修改内容
修改人员liwenhu
修改时间2024/04/15
-->
<template> <template>
<div class="vue-element-page-wrap" ref="tableContainer"> <div class="vue-element-page-wrap" ref="tableContainer">
<el-row class="page-search" justify="space-between" align="middle"> <el-row class="page-search" justify="space-between" align="middle">
<el-form ref="queryFormRef" :model="queryParamsData" :inline="true" @submit.native.prevent> <el-form ref="queryFormRef" :model="state.queryParams.params" :inline="true">
<el-row :gutter="20"> <el-row :gutter="20">
<!-- <el-col :span="4">
<el-form-item label="组织" prop="params.RECEIVEREQUESTNAME">
<el-Input v-model="state.queryParams.params.ERPFACTORY" placeholder="组织" v-on:keyup.enter="queryInfo"
clearable />
</el-form-item>
</el-col> -->
<!-- <el-col :span="4">
<el-form-item label="仓库" prop="params.RECEIVEREQUESTNAME">
<el-Input v-model="state.queryParams.params.ERPLOCATION" placeholder="仓库" v-on:keyup.enter="queryInfo"
clearable />
</el-form-item>
</el-col>-->
<el-col :span="4"> <el-col :span="4">
<el-form-item label="货位查询" prop="params.STORAGENAME"> <el-form-item label="货位查询" prop="params.storageName">
<el-Input v-model="state.queryParams.params.STORAGENAME" placeholder="货位查询" v-on:keyup.enter="queryInfo" <el-Input v-model="state.queryParams.params.storageName" placeholder="货位编码查询" clearable/>
clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="货位名称查询" prop="params.DESCRIPTION"> <el-form-item label="货位名称查询" prop="params.description">
<el-Input v-model="state.queryParams.params.DESCRIPTION" placeholder="货位名称查询" <el-Input v-model="state.queryParams.params.description" placeholder="货位描述查询" clearable/>
v-on:keyup.enter="queryInfo" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -117,11 +92,11 @@
<!-- 新增或编辑 --> <!-- 新增或编辑 -->
<el-drawer :title="dialog.title" v-model="dialog.visible" @close="cancel" @opened="dialogOpend"> <el-drawer :title="dialog.title" v-model="dialog.visible" @close="cancel" @opened="dialogOpend">
<el-form ref="formDataRef" :model="formData" :rules="rules" label-position="top"> <el-form ref="formDataRef" :model="formData" :rules="rules" label-position="top">
<el-form-item label="货位编码" prop="STORAGENAME" v-if="dialog.type === 'add'"> <el-form-item label="货位编码" prop="storageName" v-if="dialog.type === 'add'">
<el-input v-model="formData.STORAGENAME" placeholder="请输入货位编码" /> <el-input v-model="formData.storageName" placeholder="请输入货位编码" />
</el-form-item> </el-form-item>
<el-form-item label="货位描述" prop="DESCRIPTION"> <el-form-item label="货位描述" prop="description">
<el-input v-model="formData.DESCRIPTION" placeholder="请输入货位描述" /> <el-input v-model="formData.description" placeholder="请输入货位描述" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
@ -137,12 +112,12 @@ export default {
}; };
</script> </script>
<script lang="ts" setup> <script lang="ts" setup>
import { reactive, ref, onMounted, toRefs, getCurrentInstance, nextTick } from "vue"; import { reactive, ref, onMounted, toRefs, getCurrentInstance } from "vue";
import { ElForm, ElMessageBox, ElTable } from "element-plus"; import { ElForm, ElMessageBox, ElTable } from "element-plus";
import { getQueryPageList, BpelEvent, getQueryList } from '@/api/common' import { BpelEvent, getQueryList } from '@/api/common'
import { bTableHeight } from "../../../../composables/calcTableHeight"; import { bTableHeight } from '@/composables/calcTableHeight';
import { getORG } from '@/api/auth' import { getORG } from '@/api/auth'
import { createStorage, delStorage, editStorage } from '@/api/basics/storage/index' import { createStorage, delStorage, editStorage, page } from '@/api/wareHouse'
import { localStorage as ls } from "@/utils/storage"; import { localStorage as ls } from "@/utils/storage";
import { printStorage } from '@/api/label' import { printStorage } from '@/api/label'
@ -150,37 +125,12 @@ const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableH
const queryFormRef = ref(ElForm); const queryFormRef = ref(ElForm);
const formDataRef = ref(ElForm); const formDataRef = ref(ElForm);
const { proxy }: any = getCurrentInstance(); const { proxy }: any = getCurrentInstance();
const queryParamsData = ref({
MATERIALSPECNAME: ''
})
const formDataRefData = ref({
SITENAME: 'SDK',
F: [{ label: 'A', value: 'a' }],
S: [{ label: 'A', value: 'a' }],
Y: [{ label: 'A', value: 'a' }],
X: [{ label: 'A', value: 'a' }],
Z: [{ label: 'A', value: 'a' }],
STORAGEOPERATIONTYPE: [{ label: 'A', value: 'a' }],//
CAPACITY: '',//
USESTATE: '',//使
RESOURCESTATE: '',//
RESPPERSON: '',//
STORAGENAME: '',//
})
const materialTableConfig = ref({ const materialTableConfig = ref({
loading: false, loading: false,
column: [] as any, column: [] as any,
data: [], data: [],
}) })
/***---------------------------------------------------------------------------
* -------------------------------------页面SQL语句配置------------------------------------------ */
const state = reactive({ const state = reactive({
ERPFactoryList: [] as any, // ERPFactoryList: [] as any, //
disableds : false, disableds : false,
@ -188,25 +138,18 @@ const state = reactive({
rsa: '', rsa: '',
DBProcessType: 'save', DBProcessType: 'save',
queryParams: { queryParams: {
ERPFACTORY: '',
queryId: 'GetStorageList',
version: 'G5000',
params: { params: {
SITENAME: 'SDK', siteName: 'SDK',
ERPFACTORY: '', storageName: '',
ERPLOCATION: '', description: '',
STORAGENAME: '',
STORAGEOPERATIONTYPE: 'Manual',
DESCRIPTION: '',
}, },
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}, },
formData: { formData: {
ERPFACTORY: '', siteName: 'SDK',
SITENAME: 'SDK', storageName: "",
STORAGENAME: "", description: ""
DESCRIPTION: ""
} as any, } as any,
dialog: { dialog: {
title: "新增货位", title: "新增货位",
@ -214,31 +157,15 @@ const state = reactive({
visible: false, visible: false,
}, },
rules: { rules: {
STORAGENAME: [{ required: true, message: "请输入货位编码", trigger: "blur" }], storageName: [{ required: true, message: "请输入货位编码", trigger: "blur" }],
DESCRIPTION: [{ required: true, message: "请输入货位描述", trigger: "blur" }], description: [{ required: true, message: "请输入货位描述", trigger: "blur" }],
},
ChangeParams: {
header: {
MESSAGENAME: '',
LANGUAGE: 'Chinese',
},
body: {
ERPFACTORY: '',
ERPLOCATION: '',
SITENAME: 'SDK',
DESCRIPTION: '',
USESTATE: '',//使
RESOURCESTATE: '',//
RESPPERSON: '',//
STORAGENAME: '',//
}
}, },
// start // start
operateParams: { operateParams: {
date: new Date() date: new Date()
}, },
PRINTNAME: '', PRINTNAME: '',
PRINTLIST: [] as any,// PRINTLIST: [] as any,//
button_print:false, button_print:false,
// end // end
wareHouseList: [] as any, wareHouseList: [] as any,
@ -248,11 +175,8 @@ const state = reactive({
}) })
const { const {
ERPFactoryList,
rsa,
// start // start
operateParams, operateParams,
button_print,
// end // end
queryParams, queryParams,
total, total,
@ -262,78 +186,41 @@ const {
selectItem selectItem
} = toRefs(state); } = toRefs(state);
/***---------------------------------------------------------------------------
* -------------------------------------钩子函数区域------------------------------------------ */
onMounted(() => { onMounted(() => {
materialTableConfig.value.column = [ materialTableConfig.value.column = [
{ header: "组织", field: "ERPFACTORY", hide: false }, { header: "货位编码", field: "storageName", hide: false },
{ header: "组织(CN)", field: "ORGNAME", hide: false }, { header: "货位描述", field: "description", hide: false }
// { header: "", field: "ERPLOCATION", hide: false },
// { header: "(CN)", field: "ERPLOCATIONNAME", hide: false },
{ header: "货位编码", field: "STORAGENAME", hide: false },
{ header: "货位描述", field: "DESCRIPTION", hide: false },
] ]
let pwd: any = localStorage.getItem('remeberPwd');
state.queryParams.params.ERPFACTORY = JSON.parse(localStorage.getItem('orgNo')) || '';
state.formData.ERPFACTORY = JSON.parse(localStorage.getItem('orgNo')) || '';
handleQuery(); handleQuery();
updateTableHeight(); updateTableHeight();
ERPFactoryQuery();
// //
getPRINTLIST(); getPRINTLIST();
window.addEventListener('resize', handleResize); window.addEventListener('resize', handleResize);
}); })
//
const queryInfo = () => { const queryInfo = () => {
state.queryParams.pageNum = 1 state.queryParams.pageNum = 1
handleQuery() handleQuery()
} }
const handleQuery = () => { const handleQuery = () => {
console.log(queryParamsData.value);
state.disableds = true; state.disableds = true;
state.loadings = true; state.loadings = true;
state.wareHouseList = []; state.wareHouseList = [];
getQueryPageList(state.queryParams) page(state.queryParams).then((res: any) => {
.then((res: any) => { state.wareHouseList = res.resultObj.list;
state.wareHouseList = res.data.list; state.total = res.resultObj.total;
state.total = res.data.total; state.disableds = false;
state.disableds = false; state.loadings = false;
state.loadings = false; })
})
.catch(() => { });
} }
const resetQuery = () => { const resetQuery = () => {
queryFormRef.value.resetFields(); queryFormRef.value.resetFields();
// state.queryParams.params.ERPFACTORY = ''; state.queryParams.params.storageName = '';
// state.queryParams.params.ERPLOCATION = ''; state.queryParams.params.description = '';
state.queryParams.params.STORAGENAME = '';
state.queryParams.params.DESCRIPTION = '';
} }
const updateList = (col: any) => { const updateList = (col: any) => {
materialTableConfig.value.column = col materialTableConfig.value.column = col
} }
const buildInfo = () => { state.DBProcessType = 'Insert' }
const editInfo = () => { state.DBProcessType = 'Update' }
/* /
参数ChangeParams
时间:2024-4-24
作者李文虎
*/
const saveInfo = () => {
if (state.DBProcessType == 'Insert') {
state.ChangeParams.header.MESSAGENAME = 'CreateMaterialSpec'
} else if (state.DBProcessType == 'Update') {
state.ChangeParams.header.MESSAGENAME = 'ModifyMaterialSpec'
}
BpelEvent(state.ChangeParams).then((res: any) => {
})
.catch(() => { });
}
const exiteInfo = () => {
formDataRef.value.resetFields()
}
/** /**
* 新增货位 dialog * 新增货位 dialog
*/ */
@ -374,21 +261,13 @@ function delConfirm(row: any) {
function dialogOpend() { function dialogOpend() {
formDataRef.value.resetFields(); formDataRef.value.resetFields();
state.formData.STORAGENAME = '' state.formData.storageName = ''
state.formData.DESCRIPTION = '' state.formData.description = ''
if (state.selectItem && state.dialog.type === 'edit') { if (state.selectItem && state.dialog.type === 'edit') {
state.formData.STORAGENAME = state.selectItem.STORAGENAME state.formData.storageName = state.selectItem.storageName
state.formData.DESCRIPTION = state.selectItem.DESCRIPTION state.formData.description = state.selectItem.description
} }
} }
// ERP
function ERPFactoryQuery() {
getORG({ orgNo: null })
.then((res: any) => {
state.ERPFactoryList = res.resultObj
})
.catch(() => {})
}
/** /**
* 取消关闭弹窗 * 取消关闭弹窗
*/ */
@ -403,13 +282,9 @@ function submitForm() {
if (isValid) { if (isValid) {
if (state.selectItem) { if (state.selectItem) {
// //
let params = { editStorage(state.formData).then((res: any) => {
...state.formData, if (res.errorCode === 200) {
SITENAME: 'SDK' proxy.$ElMessage.success(res.message);
};
editStorage(params).then((res: any) => {
if (res.code === "200") {
proxy.$ElMessage.success("修改成功");
cancel(); cancel();
handleQuery(); handleQuery();
} else { } else {
@ -418,8 +293,8 @@ function submitForm() {
}) })
} else { } else {
createStorage(state.formData).then((res: any) => { createStorage(state.formData).then((res: any) => {
if (res.code === "200") { if (res.errorCode === 200) {
proxy.$ElMessage.success("新增成功"); proxy.$ElMessage.success(res.message);
cancel(); cancel();
handleQuery(); handleQuery();
} else { } else {
@ -435,15 +310,15 @@ function submitForm() {
* */ * */
function handleDelete(row: any) { function handleDelete(row: any) {
const params = { const params = {
STORAGENAME: row.STORAGENAME, storageName: row.storageName,
SITENAME: 'SDK', siteName: 'SDK',
}; };
delStorage(params).then((res: any) => { delStorage(params).then((res: any) => {
if (res.code === "200") { if (res.errorCode === 200) {
proxy.$ElMessage.success("删除成功"); proxy.$ElMessage.success(res.message);
handleQuery(); handleQuery();
} else { } else {
proxy.$ElMessage.console.error("删除失败"); proxy.$ElMessage.error(res.message);
} }
}); });
} }
@ -499,4 +374,3 @@ const handleSelectionChange = (val: any) => {
state.multipleSelection = val; state.multipleSelection = val;
} }
</script> </script>
<style scoped></style>