feat 货位模块变更
This commit is contained in:
parent
1720ee6bda
commit
3476e3a3c0
@ -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,
|
||||
});
|
||||
}
|
@ -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,
|
||||
});
|
||||
}
|
@ -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;
|
||||
state.disableds = false;
|
||||
state.loadings = false;
|
||||
})
|
||||
.catch(() => { });
|
||||
page(state.queryParams).then((res: any) => {
|
||||
state.wareHouseList = res.resultObj.list;
|
||||
state.total = res.resultObj.total;
|
||||
state.disableds = false;
|
||||
state.loadings = false;
|
||||
})
|
||||
}
|
||||
|
||||
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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user