feat 货位模块变更
This commit is contained in:
parent
1720ee6bda
commit
3476e3a3c0
@ -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,
|
|
||||||
});
|
|
||||||
}
|
}
|
@ -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,
|
||||||
|
});
|
||||||
|
}
|
@ -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>
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user