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

@ -31,36 +31,3 @@ export function deleteStorage(data: any) {
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,
});
}
/**
*
*/
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>
<div class="vue-element-page-wrap" ref="tableContainer">
<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-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-form-item label="货位查询" prop="params.STORAGENAME">
<el-Input v-model="state.queryParams.params.STORAGENAME" placeholder="货位查询" v-on:keyup.enter="queryInfo"
clearable />
<el-form-item label="货位查询" prop="params.storageName">
<el-Input v-model="state.queryParams.params.storageName" placeholder="货位编码查询" clearable/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="货位名称查询" prop="params.DESCRIPTION">
<el-Input v-model="state.queryParams.params.DESCRIPTION" placeholder="货位名称查询"
v-on:keyup.enter="queryInfo" clearable />
<el-form-item label="货位名称查询" prop="params.description">
<el-Input v-model="state.queryParams.params.description" placeholder="货位描述查询" clearable/>
</el-form-item>
</el-col>
</el-row>
@ -117,11 +92,11 @@
<!-- 新增或编辑 -->
<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-item label="货位编码" prop="STORAGENAME" v-if="dialog.type === 'add'">
<el-input v-model="formData.STORAGENAME" placeholder="请输入货位编码" />
<el-form-item label="货位编码" prop="storageName" v-if="dialog.type === 'add'">
<el-input v-model="formData.storageName" placeholder="请输入货位编码" />
</el-form-item>
<el-form-item label="货位描述" prop="DESCRIPTION">
<el-input v-model="formData.DESCRIPTION" placeholder="请输入货位描述" />
<el-form-item label="货位描述" prop="description">
<el-input v-model="formData.description" placeholder="请输入货位描述" />
</el-form-item>
</el-form>
<template #footer>
@ -137,12 +112,12 @@ export default {
};
</script>
<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 { getQueryPageList, BpelEvent, getQueryList } from '@/api/common'
import { bTableHeight } from "../../../../composables/calcTableHeight";
import { BpelEvent, getQueryList } from '@/api/common'
import { bTableHeight } from '@/composables/calcTableHeight';
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 { printStorage } from '@/api/label'
@ -150,37 +125,12 @@ const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableH
const queryFormRef = ref(ElForm);
const formDataRef = ref(ElForm);
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({
loading: false,
column: [] as any,
data: [],
})
/***---------------------------------------------------------------------------
* -------------------------------------页面SQL语句配置------------------------------------------ */
const state = reactive({
ERPFactoryList: [] as any, //
disableds : false,
@ -188,25 +138,18 @@ const state = reactive({
rsa: '',
DBProcessType: 'save',
queryParams: {
ERPFACTORY: '',
queryId: 'GetStorageList',
version: 'G5000',
params: {
SITENAME: 'SDK',
ERPFACTORY: '',
ERPLOCATION: '',
STORAGENAME: '',
STORAGEOPERATIONTYPE: 'Manual',
DESCRIPTION: '',
siteName: 'SDK',
storageName: '',
description: '',
},
pageNum: 1,
pageSize: 10
},
formData: {
ERPFACTORY: '',
SITENAME: 'SDK',
STORAGENAME: "",
DESCRIPTION: ""
siteName: 'SDK',
storageName: "",
description: ""
} as any,
dialog: {
title: "新增货位",
@ -214,31 +157,15 @@ const state = reactive({
visible: false,
},
rules: {
STORAGENAME: [{ 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: '',//
}
storageName: [{ required: true, message: "请输入货位编码", trigger: "blur" }],
description: [{ required: true, message: "请输入货位描述", trigger: "blur" }],
},
// start
operateParams: {
date: new Date()
},
PRINTNAME: '',
PRINTLIST: [] as any,//
PRINTLIST: [] as any,//
button_print:false,
// end
wareHouseList: [] as any,
@ -248,11 +175,8 @@ const state = reactive({
})
const {
ERPFactoryList,
rsa,
// start
operateParams,
button_print,
// end
queryParams,
total,
@ -262,78 +186,41 @@ const {
selectItem
} = toRefs(state);
/***---------------------------------------------------------------------------
* -------------------------------------钩子函数区域------------------------------------------ */
onMounted(() => {
materialTableConfig.value.column = [
{ header: "组织", field: "ERPFACTORY", hide: false },
{ header: "组织(CN)", field: "ORGNAME", hide: false },
// { header: "", field: "ERPLOCATION", hide: false },
// { header: "(CN)", field: "ERPLOCATIONNAME", hide: false },
{ header: "货位编码", field: "STORAGENAME", hide: false },
{ header: "货位描述", field: "DESCRIPTION", 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();
updateTableHeight();
ERPFactoryQuery();
//
getPRINTLIST();
window.addEventListener('resize', handleResize);
});
})
//
const queryInfo = () => {
state.queryParams.pageNum = 1
handleQuery()
}
const handleQuery = () => {
console.log(queryParamsData.value);
state.disableds = true;
state.loadings = true;
state.wareHouseList = [];
getQueryPageList(state.queryParams)
.then((res: any) => {
state.wareHouseList = res.data.list;
state.total = res.data.total;
page(state.queryParams).then((res: any) => {
state.wareHouseList = res.resultObj.list;
state.total = res.resultObj.total;
state.disableds = false;
state.loadings = false;
})
.catch(() => { });
}
const resetQuery = () => {
queryFormRef.value.resetFields();
// state.queryParams.params.ERPFACTORY = '';
// state.queryParams.params.ERPLOCATION = '';
state.queryParams.params.STORAGENAME = '';
state.queryParams.params.DESCRIPTION = '';
state.queryParams.params.storageName = '';
state.queryParams.params.description = '';
}
const updateList = (col: any) => {
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
*/
@ -374,21 +261,13 @@ function delConfirm(row: any) {
function dialogOpend() {
formDataRef.value.resetFields();
state.formData.STORAGENAME = ''
state.formData.DESCRIPTION = ''
state.formData.storageName = ''
state.formData.description = ''
if (state.selectItem && state.dialog.type === 'edit') {
state.formData.STORAGENAME = state.selectItem.STORAGENAME
state.formData.DESCRIPTION = state.selectItem.DESCRIPTION
state.formData.storageName = state.selectItem.storageName
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 (state.selectItem) {
//
let params = {
...state.formData,
SITENAME: 'SDK'
};
editStorage(params).then((res: any) => {
if (res.code === "200") {
proxy.$ElMessage.success("修改成功");
editStorage(state.formData).then((res: any) => {
if (res.errorCode === 200) {
proxy.$ElMessage.success(res.message);
cancel();
handleQuery();
} else {
@ -418,8 +293,8 @@ function submitForm() {
})
} else {
createStorage(state.formData).then((res: any) => {
if (res.code === "200") {
proxy.$ElMessage.success("新增成功");
if (res.errorCode === 200) {
proxy.$ElMessage.success(res.message);
cancel();
handleQuery();
} else {
@ -435,15 +310,15 @@ function submitForm() {
* */
function handleDelete(row: any) {
const params = {
STORAGENAME: row.STORAGENAME,
SITENAME: 'SDK',
storageName: row.storageName,
siteName: 'SDK',
};
delStorage(params).then((res: any) => {
if (res.code === "200") {
proxy.$ElMessage.success("删除成功");
if (res.errorCode === 200) {
proxy.$ElMessage.success(res.message);
handleQuery();
} else {
proxy.$ElMessage.console.error("删除失败");
proxy.$ElMessage.error(res.message);
}
});
}
@ -499,4 +374,3 @@ const handleSelectionChange = (val: any) => {
state.multipleSelection = val;
}
</script>
<style scoped></style>