opt:优化更新仓库管理相关代码
This commit is contained in:
@@ -44,16 +44,6 @@ public class Storattr implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String simple_name;
|
private String simple_name;
|
||||||
|
|
||||||
/**
|
|
||||||
* 容量
|
|
||||||
*/
|
|
||||||
private BigDecimal stor_capacity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 总面积(㎡)
|
|
||||||
*/
|
|
||||||
private BigDecimal total_area;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仓库性质
|
* 仓库性质
|
||||||
*/
|
*/
|
||||||
@@ -67,38 +57,20 @@ public class Storattr implements Serializable {
|
|||||||
|
|
||||||
private String is_productstore;
|
private String is_productstore;
|
||||||
|
|
||||||
|
private String is_attachment;
|
||||||
|
|
||||||
private String is_reversed;
|
private String is_reversed;
|
||||||
|
|
||||||
private String is_mvout_auto_cfm;
|
private String is_mvout_auto_cfm;
|
||||||
|
|
||||||
private String is_mvin_auto_cfm;
|
private String is_mvin_auto_cfm;
|
||||||
|
|
||||||
private String area;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 地址
|
|
||||||
*/
|
|
||||||
private String storea_ddress;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 负责人
|
|
||||||
*/
|
|
||||||
private String principal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系电话
|
|
||||||
*/
|
|
||||||
private String office_phone;
|
|
||||||
|
|
||||||
private String mobile_no;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
private BigDecimal order_index;
|
|
||||||
|
|
||||||
private String whstate_scode;
|
private String whstate_scode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -106,8 +78,6 @@ public class Storattr implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String is_used;
|
private String is_used;
|
||||||
|
|
||||||
private String base_class_id;
|
|
||||||
|
|
||||||
private String create_id;
|
private String create_id;
|
||||||
|
|
||||||
private String create_name;
|
private String create_name;
|
||||||
@@ -131,8 +101,4 @@ public class Storattr implements Serializable {
|
|||||||
private String ext_id;
|
private String ext_id;
|
||||||
|
|
||||||
private String depart_name;
|
private String depart_name;
|
||||||
|
|
||||||
private String company_name;
|
|
||||||
|
|
||||||
private String is_attachment;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,8 @@
|
|||||||
<mapper namespace="org.nl.wms.basedata.master.storattr.service.dao.mapper.StorattrMapper">
|
<mapper namespace="org.nl.wms.basedata.master.storattr.service.dao.mapper.StorattrMapper">
|
||||||
|
|
||||||
<select id="queryAll" resultType="org.nl.wms.basedata.master.storattr.service.dao.Storattr">
|
<select id="queryAll" resultType="org.nl.wms.basedata.master.storattr.service.dao.Storattr">
|
||||||
SELECT stor.*,
|
SELECT stor.*
|
||||||
detail.label
|
|
||||||
FROM st_ivt_bsrealstorattr stor
|
FROM st_ivt_bsrealstorattr stor
|
||||||
LEFT JOIN sys_dict detail ON detail.value = stor.stor_type_scode AND detail.code = 'st_stor_type'
|
|
||||||
<where>
|
<where>
|
||||||
stor.is_delete = '0'
|
stor.is_delete = '0'
|
||||||
<if test="search != null">
|
<if test="search != null">
|
||||||
@@ -19,7 +17,6 @@
|
|||||||
<select id="queryAllTotal" resultType="java.lang.Integer">
|
<select id="queryAllTotal" resultType="java.lang.Integer">
|
||||||
SELECT COUNT(*)
|
SELECT COUNT(*)
|
||||||
FROM st_ivt_bsrealstorattr stor
|
FROM st_ivt_bsrealstorattr stor
|
||||||
LEFT JOIN sys_dict detail ON detail.value = stor.stor_type_scode AND detail.code = 'st_stor_type'
|
|
||||||
<where>
|
<where>
|
||||||
stor.is_delete = '0'
|
stor.is_delete = '0'
|
||||||
<if test="map.search != null">
|
<if test="map.search != null">
|
||||||
|
|||||||
@@ -47,18 +47,6 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="仓库容量" prop="stor_capacity">
|
|
||||||
<el-input v-model="form.stor_capacity" style="width: 200px;" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="总面积(㎡)" prop="total_area">
|
|
||||||
<el-input v-model="form.total_area" style="width: 200px;" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="仓库性质" prop="stor_type_scode">
|
<el-form-item label="仓库性质" prop="stor_type_scode">
|
||||||
@@ -76,23 +64,6 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="仓库地址">
|
|
||||||
<el-input v-model="form.storea_ddress" style="width: 200px;" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="负责人">
|
|
||||||
<el-input v-model="form.principal" style="width: 200px;" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="联系电话" prop="office_phone">
|
|
||||||
<el-input v-model="form.office_phone" style="width: 200px;" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-form-item label="仓库类型" required>
|
<el-form-item label="仓库类型" required>
|
||||||
@@ -141,12 +112,7 @@
|
|||||||
<el-table-column prop="stor_code" label="仓库编码" />
|
<el-table-column prop="stor_code" label="仓库编码" />
|
||||||
<el-table-column prop="stor_name" label="仓库名称" width="150" />
|
<el-table-column prop="stor_name" label="仓库名称" width="150" />
|
||||||
<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_type_scode" label="仓库性质" />
|
||||||
<el-table-column prop="total_area" width="100px" label="总面积(㎡)" />
|
|
||||||
<el-table-column prop="label" label="仓库性质" />
|
|
||||||
<el-table-column prop="storea_ddress" label="地址" />
|
|
||||||
<el-table-column prop="principal" label="负责人" />
|
|
||||||
<el-table-column prop="office_phone" label="联系电话" width="130" />
|
|
||||||
<el-table-column prop="ext_id" label="外部标识" width="130" />
|
<el-table-column prop="ext_id" 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">
|
||||||
@@ -160,7 +126,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="remark" label="备注" />
|
<el-table-column prop="remark" label="备注" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-permission="['admin','stIvtBsrealstorattr:edit','stIvtBsrealstorattr:del']"
|
v-permission="['admin','stor:edit','stor:del']"
|
||||||
label="操作"
|
label="操作"
|
||||||
fixed="right"
|
fixed="right"
|
||||||
width="120px"
|
width="120px"
|
||||||
@@ -187,55 +153,37 @@ import rrOperation from '@crud/RR.operation'
|
|||||||
import crudOperation from '@crud/CRUD.operation'
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
import udOperation from '@crud/UD.operation'
|
import udOperation from '@crud/UD.operation'
|
||||||
import pagination from '@crud/Pagination'
|
import pagination from '@crud/Pagination'
|
||||||
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
|
||||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||||
import { getDepts, getDeptSuperior } from '@/views/system/dept/dept'
|
|
||||||
import { isvalidPhone } from '@/utils/validate'
|
|
||||||
|
|
||||||
const defaultForm = {
|
const defaultForm = {
|
||||||
stor_id: null,
|
stor_id: null,
|
||||||
stor_code: null,
|
stor_code: null,
|
||||||
stor_name: null,
|
stor_name: null,
|
||||||
simple_name: null,
|
simple_name: null,
|
||||||
stor_capacity: null,
|
|
||||||
total_area: null,
|
|
||||||
stor_type_scode: null,
|
stor_type_scode: null,
|
||||||
is_virtualstore: null,
|
is_virtualstore: null,
|
||||||
is_semi_finished: null,
|
is_semi_finished: null,
|
||||||
|
is_attachment: null,
|
||||||
is_materialstore: null,
|
is_materialstore: null,
|
||||||
is_productstore: null,
|
is_productstore: null,
|
||||||
is_reversed: null,
|
is_reversed: null,
|
||||||
is_mvout_auto_cfm: null,
|
is_mvout_auto_cfm: null,
|
||||||
is_mvin_auto_cfm: null,
|
is_mvin_auto_cfm: null,
|
||||||
area: null,
|
|
||||||
storea_ddress: null,
|
|
||||||
principal: null,
|
|
||||||
office_phone: null,
|
|
||||||
mobile_no: null,
|
|
||||||
remark: null,
|
remark: null,
|
||||||
order_index: null,
|
|
||||||
whstate_scode: null,
|
whstate_scode: null,
|
||||||
is_used: '1',
|
is_used: '1',
|
||||||
base_class_id: null,
|
|
||||||
create_id: null,
|
|
||||||
create_name: null,
|
|
||||||
create_time: null,
|
|
||||||
update_optid: null,
|
|
||||||
update_optname: null,
|
|
||||||
update_time: null,
|
|
||||||
sysownerid: null,
|
sysownerid: null,
|
||||||
sysdeptid: null,
|
sysdeptid: null,
|
||||||
syscompanyid: null,
|
syscompanyid: null,
|
||||||
is_delete: null,
|
is_delete: null,
|
||||||
ext_id: null,
|
ext_id: null,
|
||||||
depart_name: null,
|
depart_name: null
|
||||||
company_name: null,
|
|
||||||
is_attachment: null
|
|
||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
name: 'StIvtBsrealstorattr',
|
name: 'Stor',
|
||||||
dicts: ['st_stor_type', 'is_used'],
|
dicts: ['st_stor_type', 'is_used'],
|
||||||
components: { pagination, crudOperation, rrOperation, udOperation, Treeselect },
|
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({
|
return CRUD({
|
||||||
@@ -243,64 +191,29 @@ export default {
|
|||||||
optShow: { add: true, reset: true },
|
optShow: { add: true, reset: true },
|
||||||
url: 'api/Storattr',
|
url: 'api/Storattr',
|
||||||
idField: 'stor_id',
|
idField: 'stor_id',
|
||||||
sort: 'stor_id,desc',
|
sort: '',
|
||||||
crudMethod: { ...crudStorattr }
|
crudMethod: { ...crudStorattr }
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const validPhone = (rule, value, callback) => {
|
|
||||||
if (value && !isvalidPhone(value)) {
|
|
||||||
callback(new Error('请输入正确的11位手机号码'))
|
|
||||||
} else {
|
|
||||||
callback()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const numberOne = (rule, value, callback) => {
|
|
||||||
const numReg = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/
|
|
||||||
const numRe = new RegExp(numReg)
|
|
||||||
if (value) {
|
|
||||||
if (!numRe.test(value)) {
|
|
||||||
callback(new Error('只能输入数字'))
|
|
||||||
} else {
|
|
||||||
callback()
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
callback()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return {
|
return {
|
||||||
depts: [],
|
permission: {
|
||||||
permission: {},
|
add: ['admin', 'stor:add'],
|
||||||
|
edit: ['admin', 'stor:edit'],
|
||||||
|
del: ['admin', 'stor:del']
|
||||||
|
},
|
||||||
rules: {
|
rules: {
|
||||||
stor_code: [
|
stor_code: [
|
||||||
{ required: true, message: '仓库编码不能为空', trigger: 'blur' }
|
{ required: true, message: '仓库编码不能为空', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
stor_name: [
|
stor_name: [
|
||||||
{ required: true, message: '仓库名称不能为空', trigger: 'blur' }
|
{ required: true, message: '仓库名称不能为空', trigger: 'blur' }
|
||||||
],
|
|
||||||
stor_capacity: [
|
|
||||||
{ required: false, message: '不能为空', trigger: 'blur' },
|
|
||||||
{ validator: numberOne }
|
|
||||||
],
|
|
||||||
total_area: [
|
|
||||||
{ required: false, message: '不能为空', trigger: 'blur' },
|
|
||||||
{ validator: numberOne }
|
|
||||||
],
|
|
||||||
office_phone: [
|
|
||||||
{ required: false, trigger: 'blur', validator: validPhone }
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 新增与编辑前做的操作
|
// 新增与编辑前做的操作
|
||||||
[CRUD.HOOK.afterToCU](crud, form) {
|
|
||||||
if (form.id == null) {
|
|
||||||
this.getDepts()
|
|
||||||
} else {
|
|
||||||
this.getSupDepts(form.dept.id)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[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' &&
|
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.form.is_productstore === '0' && this.form.is_attachment === '0') {
|
||||||
@@ -313,16 +226,6 @@ export default {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getDepts() {
|
|
||||||
getDepts({ enabled: true }).then(res => {
|
|
||||||
this.depts = res.content.map(function(obj) {
|
|
||||||
if (obj.hasChildren) {
|
|
||||||
obj.children = null
|
|
||||||
}
|
|
||||||
return obj
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 改变状态
|
// 改变状态
|
||||||
format_is_used(is_used) {
|
format_is_used(is_used) {
|
||||||
return is_used === '1'
|
return is_used === '1'
|
||||||
@@ -346,38 +249,6 @@ export default {
|
|||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getSupDepts(deptId) {
|
|
||||||
getDeptSuperior(deptId).then(res => {
|
|
||||||
const date = res.content
|
|
||||||
this.buildDepts(date)
|
|
||||||
this.depts = date
|
|
||||||
})
|
|
||||||
},
|
|
||||||
buildDepts(depts) {
|
|
||||||
depts.forEach(data => {
|
|
||||||
if (data.children) {
|
|
||||||
this.buildDepts(data.children)
|
|
||||||
}
|
|
||||||
if (data.hasChildren && !data.children) {
|
|
||||||
data.children = null
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
loadDepts({ action, parentNode, callback }) {
|
|
||||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
|
||||||
getDepts({ enabled: true, pid: parentNode.id }).then(res => {
|
|
||||||
parentNode.children = res.content.map(function(obj) {
|
|
||||||
if (obj.hasChildren) {
|
|
||||||
obj.children = null
|
|
||||||
}
|
|
||||||
return obj
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
callback()
|
|
||||||
}, 200)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
[CRUD.HOOK.beforeRefresh]() {
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user