add:仓库管理
This commit is contained in:
@@ -5,12 +5,15 @@ package org.nl.wms.masterdata_manage.storage.controller.storage;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.common.TableDataInfo;
|
import org.nl.common.TableDataInfo;
|
||||||
import org.nl.common.anno.Log;
|
import org.nl.common.anno.Log;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.wms.device_manage.service.userdevice.dto.DeviceUserQuery;
|
||||||
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
|
import org.nl.wms.masterdata_manage.storage.service.storage.IStIvtBsrealstorattrService;
|
||||||
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr;
|
||||||
import org.nl.wms.masterdata_manage.storage.service.storage.dto.StorattrQuery;
|
import org.nl.wms.masterdata_manage.storage.service.storage.dto.StorattrQuery;
|
||||||
@@ -38,6 +41,13 @@ public class StorattrController {
|
|||||||
protected IStIvtBsrealstorattrService stIvtBsrealstorattrService;
|
protected IStIvtBsrealstorattrService stIvtBsrealstorattrService;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping()
|
||||||
|
@Log("查询仓库")
|
||||||
|
//("查询仓库")
|
||||||
|
public ResponseEntity<Object> query(StorattrQuery query, PageQuery page) {
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(stIvtBsrealstorattrService.page(page.build(), query.build())), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/queryStor")
|
@PostMapping("/queryStor")
|
||||||
@Log("查询仓库")
|
@Log("查询仓库")
|
||||||
//("查询仓库")
|
//("查询仓库")
|
||||||
|
|||||||
@@ -22,6 +22,6 @@ public class StorattrQuery extends BaseQuery<StIvtBsrealstorattr> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void paramMapping() {
|
public void paramMapping() {
|
||||||
super.doP.put("search", QParam.builder().k(new String[]{"struct_code","struct_name"}).type(QueryTEnum.LK).build());
|
super.doP.put("search", QParam.builder().k(new String[]{"stor_code","stor_name"}).type(QueryTEnum.ORLK).build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,8 @@ public class StIvtBsrealstorattrServiceImpl extends ServiceImpl<StIvtBsrealstora
|
|||||||
if (byId == null) {
|
if (byId == null) {
|
||||||
throw new BadRequestException(form.getString("stor_id")+"被删除,操作失败!");
|
throw new BadRequestException(form.getString("stor_id")+"被删除,操作失败!");
|
||||||
}
|
}
|
||||||
StIvtBsrealstorattr byCode = this.getOne(new QueryWrapper<StIvtBsrealstorattr>().eq("stor_code", form.getString("stor_code")));
|
StIvtBsrealstorattr byCode = this.getOne(new QueryWrapper<StIvtBsrealstorattr>()
|
||||||
|
.eq("stor_code", form.getString("stor_code")).ne("stor_name",form.getString("stor_name")));
|
||||||
if (byCode != null ) {
|
if (byCode != null ) {
|
||||||
throw new BadRequestException(form.getString("stor_code")+"存在相同的仓库编号");
|
throw new BadRequestException(form.getString("stor_code")+"存在相同的仓库编号");
|
||||||
}
|
}
|
||||||
|
|||||||
16
mes/hd/nladmin-system/src/main/resources/sql/0901维护.sql
Normal file
16
mes/hd/nladmin-system/src/main/resources/sql/0901维护.sql
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
--仓库管理sql仓库类型枚举--
|
||||||
|
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1697425596130398208', 'stor_type', '仓库性质', '虚拟库', '1', 0, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-01 09:46:13', '1694303357524643840', '管理员', '2023-09-01 09:46:13');
|
||||||
|
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1697426120640696320', 'stor_type', '仓库性质', '半成品库', '2', 0, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-01 09:48:18', '1694303357524643840', '管理员', '2023-09-01 09:48:18');
|
||||||
|
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1697426155990290432', 'stor_type', '仓库性质', '原材料库', '3', 0, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-01 09:48:26', '1694303357524643840', '管理员', '2023-09-01 09:48:26');
|
||||||
|
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1697426215268388864', 'stor_type', '仓库性质', '成品库', '4', 0, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-01 09:48:41', '1694303357524643840', '管理员', '2023-09-01 09:48:41');
|
||||||
|
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1697426251763027968', 'stor_type', '仓库性质', '备件库', '5', 0, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-01 09:48:49', '1694303357524643840', '管理员', '2023-09-01 09:48:49');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@ import request from '@/utils/request'
|
|||||||
|
|
||||||
export function add(data) {
|
export function add(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/Storattr',
|
url: '/api/stIvtBsrealstorattr',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -10,7 +10,7 @@ export function add(data) {
|
|||||||
|
|
||||||
export function del(ids) {
|
export function del(ids) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/Storattr',
|
url: '/api/stIvtBsrealstorattr',
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: ids
|
data: ids
|
||||||
})
|
})
|
||||||
@@ -18,7 +18,7 @@ export function del(ids) {
|
|||||||
|
|
||||||
export function edit(data) {
|
export function edit(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/Storattr',
|
url: '/api/stIvtBsrealstorattr',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -26,7 +26,7 @@ export function edit(data) {
|
|||||||
|
|
||||||
export function getStor(params) {
|
export function getStor(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/Storattr/getStor',
|
url: '/api/stIvtBsrealstorattr/getStor',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params
|
||||||
})
|
})
|
||||||
@@ -34,7 +34,7 @@ export function getStor(params) {
|
|||||||
|
|
||||||
export function changeActive(data) {
|
export function changeActive(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/Storattr/changeActive',
|
url: '/api/stIvtBsrealstorattr/changeActive',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -42,7 +42,7 @@ export function changeActive(data) {
|
|||||||
|
|
||||||
export function queryStor(data) {
|
export function queryStor(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/Storattr/queryStor',
|
url: '/api/stIvtBsrealstorattr/queryStor',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -42,14 +42,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="所属部门" prop="sysdeptid">
|
<el-form-item label="联系电话" prop="office_phone">
|
||||||
<treeselect
|
<el-input v-model="form.office_phone" style="width: 200px;" />
|
||||||
v-model="form.sysdeptid"
|
|
||||||
:options="depts"
|
|
||||||
:load-options="loadDepts"
|
|
||||||
style="width: 200px"
|
|
||||||
placeholder="选择部门"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -95,32 +89,22 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="联系电话" prop="office_phone">
|
<el-form-item label="仓库类型" prop="stor_type">
|
||||||
<el-input v-model="form.office_phone" style="width: 200px;" />
|
<el-select
|
||||||
|
v-model="form.stor_type"
|
||||||
|
placeholder=""
|
||||||
|
style="width: 200px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.stor_type"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-form-item label="仓库类型" required>
|
|
||||||
<el-col :span="4" />
|
|
||||||
<el-col :span="4">
|
|
||||||
<el-checkbox v-model="form.is_materialstore" true-label="1" false-label="0">原材料库</el-checkbox>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="4">
|
|
||||||
<el-checkbox v-model="form.is_semi_finished" true-label="1" false-label="0">半成品库</el-checkbox>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="4">
|
|
||||||
<el-checkbox v-model="form.is_productstore" true-label="1" false-label="0">成品库</el-checkbox>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="4">
|
|
||||||
<el-checkbox v-model="form.is_attachment" true-label="1" false-label="0">备件库</el-checkbox>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="4">
|
|
||||||
<el-checkbox v-model="form.is_virtualstore" true-label="1" false-label="0">虚拟库</el-checkbox>
|
|
||||||
</el-col>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="备注">
|
<el-form-item label="备注">
|
||||||
@@ -149,14 +133,23 @@
|
|||||||
<el-table-column prop="simple_name" label="简称" width="130" />
|
<el-table-column prop="simple_name" label="简称" width="130" />
|
||||||
<el-table-column prop="stor_capacity" label="容量" />
|
<el-table-column prop="stor_capacity" label="容量" />
|
||||||
<el-table-column prop="total_area" label="总面积(㎡)" />
|
<el-table-column prop="total_area" label="总面积(㎡)" />
|
||||||
<el-table-column prop="label" label="仓库性质" />
|
<el-table-column prop="stor_type_scode" label="仓库性质">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ dict.label.st_stor_type[scope.row.stor_type_scode] }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="stor_type" label="仓库类型">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ dict.label.stor_type[scope.row.stor_type] }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="storea_ddress" label="地址" />
|
<el-table-column prop="storea_ddress" label="地址" />
|
||||||
<el-table-column prop="principal" label="负责人" />
|
<el-table-column prop="principal" label="负责人" />
|
||||||
<el-table-column prop="office_phone" label="联系电话" width="130" />
|
<el-table-column prop="office_phone" label="联系电话" width="130" />
|
||||||
<el-table-column label="是否启用" align="center" prop="is_used">
|
<el-table-column label="是否启用" align="center" prop="is_used" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-switch
|
<el-switch
|
||||||
:value="format_is_used(scope.row.is_used)"
|
v-model="scope.row.is_used"
|
||||||
active-color="#409EFF"
|
active-color="#409EFF"
|
||||||
inactive-color="#F56C6C"
|
inactive-color="#F56C6C"
|
||||||
@change="changeEnabled(scope.row, scope.row.is_used)"
|
@change="changeEnabled(scope.row, scope.row.is_used)"
|
||||||
@@ -240,14 +233,14 @@ const defaultForm = {
|
|||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
name: 'StIvtBsrealstorattr',
|
name: 'StIvtBsrealstorattr',
|
||||||
dicts: ['st_stor_type', 'is_used'],
|
dicts: ['st_stor_type', 'is_used', 'stor_type'],
|
||||||
components: { pagination, crudOperation, rrOperation, udOperation, Treeselect },
|
components: { pagination, crudOperation, rrOperation, udOperation, Treeselect },
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({
|
return CRUD({
|
||||||
title: '仓库',
|
title: '仓库',
|
||||||
optShow: { add: true, reset: true },
|
optShow: { add: true, reset: true },
|
||||||
url: 'api/Storattr',
|
url: 'api/stIvtBsrealstorattr',
|
||||||
idField: 'stor_id',
|
idField: 'stor_id',
|
||||||
sort: 'stor_id,desc',
|
sort: 'stor_id,desc',
|
||||||
crudMethod: { ...crudStorattr }
|
crudMethod: { ...crudStorattr }
|
||||||
@@ -281,12 +274,12 @@ export default {
|
|||||||
stor_code: [
|
stor_code: [
|
||||||
{ required: true, message: '仓库编码不能为空', trigger: 'blur' }
|
{ required: true, message: '仓库编码不能为空', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
|
stor_type: [
|
||||||
|
{ required: true, message: '仓库类型不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
stor_name: [
|
stor_name: [
|
||||||
{ required: true, message: '仓库名称不能为空', trigger: 'blur' }
|
{ required: true, message: '仓库名称不能为空', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
sysdeptid: [
|
|
||||||
{ required: true, message: '所属部门不能为空', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
stor_capacity: [
|
stor_capacity: [
|
||||||
{ required: false, message: '不能为空', trigger: 'blur' },
|
{ required: false, message: '不能为空', trigger: 'blur' },
|
||||||
{ validator: numberOne }
|
{ validator: numberOne }
|
||||||
@@ -311,16 +304,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
[CRUD.HOOK.beforeSubmit](crud, form) {
|
[CRUD.HOOK.beforeSubmit](crud, form) {
|
||||||
if (this.form.is_virtualstore === '0' && this.form.is_semi_finished === '0' && this.form.is_materialstore === '0' &&
|
|
||||||
this.form.is_productstore === '0' && this.form.is_attachment === '0') {
|
|
||||||
this.crud.notify('仓库类型至少选一条', CRUD.NOTIFICATION_TYPE.INFO)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if (!this.form.is_virtualstore && !this.form.is_semi_finished && !this.form.is_materialstore &&
|
|
||||||
!this.form.is_productstore && !this.form.is_attachment) {
|
|
||||||
this.crud.notify('仓库类型至少选一条', CRUD.NOTIFICATION_TYPE.INFO)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
getDepts() {
|
getDepts() {
|
||||||
getDepts({ enabled: true }).then(res => {
|
getDepts({ enabled: true }).then(res => {
|
||||||
@@ -332,16 +315,21 @@ export default {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
formatBoolean: function(row, column) {
|
||||||
|
var ret = ''
|
||||||
|
if (row[column.property] === true) {
|
||||||
|
ret = '是' // 根据自己的需求设定
|
||||||
|
} else {
|
||||||
|
ret = '否'
|
||||||
|
}
|
||||||
|
return ret
|
||||||
|
},
|
||||||
// 改变状态
|
// 改变状态
|
||||||
format_is_used(is_used) {
|
format_is_used(is_used) {
|
||||||
return is_used === '1'
|
return is_used === '1'
|
||||||
},
|
},
|
||||||
changeEnabled(data, val) {
|
changeEnabled(data, val) {
|
||||||
let msg = '此操作将停用,是否继续!'
|
this.$confirm('此操作将改变'+ data.unit_name + '状态, 是否继续?', '提示', {
|
||||||
if (val !== '1') {
|
|
||||||
msg = '此操作将启用,是否继续!'
|
|
||||||
}
|
|
||||||
this.$confirm(msg, '提示', {
|
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
@@ -350,9 +338,22 @@ export default {
|
|||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
data.is_used = !data.is_used
|
if (data.is_used === false) {
|
||||||
|
data.is_used = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (data.is_used === true) {
|
||||||
|
data.is_used = false
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
|
if (data.is_used === false) {
|
||||||
|
data.is_used = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (data.is_used === true) {
|
||||||
|
data.is_used = false
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getSupDepts(deptId) {
|
getSupDepts(deptId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user