feat 库位维护
This commit is contained in:
parent
ce759f0a6f
commit
56686dc243
@ -31,3 +31,36 @@ 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,
|
||||
});
|
||||
}
|
@ -20,20 +20,20 @@
|
||||
clearable />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="4">
|
||||
<!-- <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>-->
|
||||
<el-col :span="4">
|
||||
<el-form-item label="货位查询" prop="params.RECEIVEREQUESTNAME">
|
||||
<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>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-form-item label="货位名称查询" prop="params.RECEIVEREQUESTNAME">
|
||||
<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>
|
||||
@ -54,6 +54,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="page-table-operateBtns">
|
||||
<el-button type="primary" @click="handleAdd">
|
||||
<el-icon>
|
||||
<Plus />
|
||||
</el-icon>
|
||||
创建
|
||||
</el-button>
|
||||
<el-popover :persistent="false" placement="right" popper-class="config-table-wrap" trigger="click">
|
||||
<template #reference>
|
||||
<el-button class="operateBtns-setting">
|
||||
@ -73,10 +79,36 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
|
||||
<el-table-column width="300" label="操作" align="center" class-name="table-operation" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" link @click.stop="handleUpdate(scope.row)" v-if="!scope.row.status"> 编辑
|
||||
</el-button>
|
||||
<div class="splitLine" v-if="!scope.row.status"></div>
|
||||
<el-button type="danger" link @click.stop="delConfirm(scope.row)" v-if="!scope.row.status"> 删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination v-if="total > 0" :total="total" v-model:pageNumTo="queryParams.pageNum"
|
||||
v-model:pageSizeTo="queryParams.pageSize" @pagination="handleQuery" />
|
||||
</div>
|
||||
|
||||
<!-- 新增或编辑 -->
|
||||
<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>
|
||||
<el-form-item label="货位描述" prop="DESCRIPTION">
|
||||
<el-input v-model="formData.DESCRIPTION" placeholder="请输入货位描述" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
</template>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
@ -89,10 +121,14 @@ import { reactive, ref, onMounted, toRefs, getCurrentInstance, nextTick } from "
|
||||
import { ElForm, ElMessageBox, ElTable } from "element-plus";
|
||||
import { getQueryPageList, BpelEvent } from '@/api/common';
|
||||
import { bTableHeight } from "../../../../composables/calcTableHeight";
|
||||
import { getORG } from '@/api/auth'
|
||||
import { createStorage, delStorage, editStorage } from '@/api/basics/storage/index'
|
||||
|
||||
const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(180);
|
||||
const queryFormRef = ref(ElForm);
|
||||
const formDataRef = ref(ElForm);
|
||||
const { proxy }: any = getCurrentInstance();
|
||||
|
||||
const queryParamsData = ref({
|
||||
MATERIALSPECNAME: ''
|
||||
})
|
||||
@ -124,13 +160,15 @@ const materialTableConfig = ref({
|
||||
/***---------------------------------------------------------------------------
|
||||
* -------------------------------------页面SQL语句配置------------------------------------------ */
|
||||
const state = reactive({
|
||||
ERPFactoryList: [] as any, // 组织
|
||||
disableds : false,
|
||||
loadings : false,
|
||||
rsa: '',
|
||||
DBProcessType: 'save',
|
||||
queryParams: {
|
||||
queryId: 'GetSTORAGEList',
|
||||
version: '00001',
|
||||
ERPFACTORY: '',
|
||||
queryId: 'GetStorageList',
|
||||
version: 'G5000',
|
||||
params: {
|
||||
SITENAME: 'SDK',
|
||||
ERPFACTORY: '',
|
||||
@ -142,6 +180,21 @@ const state = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
formData: {
|
||||
ERPFACTORY: '',
|
||||
SITENAME: 'SDK',
|
||||
STORAGENAME: "",
|
||||
DESCRIPTION: ""
|
||||
} as any,
|
||||
dialog: {
|
||||
title: "新增货位",
|
||||
type: 'add',
|
||||
visible: false,
|
||||
},
|
||||
rules: {
|
||||
STORAGENAME: [{ required: true, message: "请输入货位编码", trigger: "blur" }],
|
||||
DESCRIPTION: [{ required: true, message: "请输入货位描述", trigger: "blur" }],
|
||||
},
|
||||
ChangeParams: {
|
||||
header: {
|
||||
MESSAGENAME: '',
|
||||
@ -159,14 +212,19 @@ const state = reactive({
|
||||
}
|
||||
},
|
||||
wareHouseList: [] as any,
|
||||
total: 0
|
||||
total: 0,
|
||||
selectItem: undefined as any
|
||||
})
|
||||
|
||||
const {
|
||||
ERPFactoryList,
|
||||
rsa,
|
||||
queryParams,
|
||||
total,
|
||||
|
||||
dialog,
|
||||
formData,
|
||||
rules,
|
||||
selectItem
|
||||
} = toRefs(state);
|
||||
|
||||
/***---------------------------------------------------------------------------
|
||||
@ -175,15 +233,17 @@ 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: "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();
|
||||
updateTableHeight();
|
||||
ERPFactoryQuery();
|
||||
window.addEventListener('resize', handleResize);
|
||||
});
|
||||
const queryInfo = () => {
|
||||
@ -216,8 +276,8 @@ const handleQuery = () => {
|
||||
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields();
|
||||
state.queryParams.params.ERPFACTORY = '';
|
||||
state.queryParams.params.ERPLOCATION = '';
|
||||
// state.queryParams.params.ERPFACTORY = '';
|
||||
// state.queryParams.params.ERPLOCATION = '';
|
||||
state.queryParams.params.STORAGENAME = '';
|
||||
state.queryParams.params.DESCRIPTION = '';
|
||||
}
|
||||
@ -245,6 +305,121 @@ const saveInfo = () => {
|
||||
const exiteInfo = () => {
|
||||
formDataRef.value.resetFields()
|
||||
}
|
||||
</script>
|
||||
|
||||
/**
|
||||
* 新增货位 dialog
|
||||
*/
|
||||
function handleAdd() {
|
||||
selectItem.value = undefined;
|
||||
dialog.value = {
|
||||
title: "新增货位",
|
||||
visible: true,
|
||||
type: 'add'
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑货位 dialog
|
||||
*/
|
||||
function handleUpdate(row: any) {
|
||||
state.dialog = {
|
||||
title: "编辑货位",
|
||||
visible: true,
|
||||
type: 'edit'
|
||||
};
|
||||
state.selectItem = row;
|
||||
}
|
||||
|
||||
// 删除确认
|
||||
function delConfirm(row: any) {
|
||||
ElMessageBox.confirm('确认删除?',
|
||||
'提示', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
distinguishCancelAndClose: true,
|
||||
type: 'warning',
|
||||
}).then(() => {
|
||||
handleDelete(row);
|
||||
})
|
||||
.catch(() => { });
|
||||
}
|
||||
|
||||
function dialogOpend() {
|
||||
formDataRef.value.resetFields();
|
||||
state.formData.STORAGENAME = ''
|
||||
state.formData.DESCRIPTION = ''
|
||||
if (state.selectItem && state.dialog.type === 'edit') {
|
||||
state.formData = {
|
||||
STORAGENAME: state.selectItem.STORAGENAME,
|
||||
DESCRIPTION: state.selectItem.DESCRIPTION
|
||||
};
|
||||
}
|
||||
}
|
||||
// ERP工厂查询
|
||||
function ERPFactoryQuery() {
|
||||
getORG({ orgNo: null })
|
||||
.then((res: any) => {
|
||||
state.ERPFactoryList = res.resultObj
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
/**
|
||||
* 取消关闭弹窗
|
||||
*/
|
||||
function cancel() {
|
||||
state.dialog.visible = false;
|
||||
}
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
function submitForm() {
|
||||
formDataRef.value.validate((isValid: boolean) => {
|
||||
if (isValid) {
|
||||
if (state.selectItem) {
|
||||
// 编辑
|
||||
let params = {
|
||||
...state.formData,
|
||||
SITENAME: 'SDK'
|
||||
};
|
||||
editStorage(params).then((res: any) => {
|
||||
if (res.code === "0") {
|
||||
proxy.$ElMessage.success("修改成功");
|
||||
cancel();
|
||||
handleQuery();
|
||||
} else {
|
||||
proxy.$ElMessage.error(res.message);
|
||||
}
|
||||
})
|
||||
} else {
|
||||
createStorage(state.formData).then((res: any) => {
|
||||
if (res.code === "0") {
|
||||
proxy.$ElMessage.success("新增成功");
|
||||
cancel();
|
||||
handleQuery();
|
||||
} else {
|
||||
proxy.$ElMessage.error(res.message);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
* */
|
||||
function handleDelete(row: any) {
|
||||
const params = {
|
||||
STORAGENAME: row.STORAGENAME,
|
||||
SITENAME: 'SDK',
|
||||
};
|
||||
delStorage(params).then((res: any) => {
|
||||
if (res.code === "0") {
|
||||
proxy.$ElMessage.success("删除成功");
|
||||
handleQuery();
|
||||
} else {
|
||||
proxy.$ElMessage.console.error("删除失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style scoped></style>
|
||||
|
Loading…
x
Reference in New Issue
Block a user