This commit is contained in:
zds
2022-10-17 16:34:18 +08:00
parent 2108c56109
commit 32ded42385
8 changed files with 231 additions and 5 deletions

View File

@@ -110,6 +110,12 @@ public class DevicerepairrequestServiceImpl implements DevicerepairrequestServic
String deptIds = deptService.getChildIdStr(Long.parseLong(dept_id)); String deptIds = deptService.getChildIdStr(Long.parseLong(dept_id));
map.put("deptIds", deptIds); map.put("deptIds", deptIds);
} }
// 归属部门
String use_groupid = MapUtil.getStr(whereJson, "use_groupid");
if (!StrUtil.isEmpty(use_groupid)) {
String use_groupidIds = deptService.getChildIdStr(Long.parseLong(use_groupid));
map.put("use_groupid", use_groupidIds);
}
JSONObject json = WQL.getWO("EM_BI_DEVICEREPAIRREQUEST001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.create_time DESC"); JSONObject json = WQL.getWO("EM_BI_DEVICEREPAIRREQUEST001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.create_time DESC");
return json; return json;
} }

View File

@@ -21,6 +21,7 @@
输入.begin_time TYPEAS s_string 输入.begin_time TYPEAS s_string
输入.end_time TYPEAS s_string 输入.end_time TYPEAS s_string
输入.deptIds TYPEAS f_string 输入.deptIds TYPEAS f_string
输入.use_groupid TYPEAS f_string
[临时表] [临时表]
@@ -144,7 +145,9 @@
OPTION 输入.classIds <> "" OPTION 输入.classIds <> ""
class.class_id in 输入.classIds class.class_id in 输入.classIds
ENDOPTION ENDOPTION
OPTION 输入.use_groupid <> ""
d2.dept_id in 输入.use_groupid
ENDOPTION
OPTION 输入.deptIds <> "" OPTION 输入.deptIds <> ""
d1.dept_id in 输入.deptIds d1.dept_id in 输入.deptIds
ENDOPTION ENDOPTION

View File

@@ -12,6 +12,7 @@ import com.alibaba.fastjson.JSON;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.nl.exception.BadRequestException; import org.nl.exception.BadRequestException;
import org.nl.modules.security.service.dto.JwtUserDto; import org.nl.modules.security.service.dto.JwtUserDto;
import org.nl.modules.system.service.DeptService;
import org.nl.modules.system.service.impl.ParamServiceImpl; import org.nl.modules.system.service.impl.ParamServiceImpl;
import org.nl.modules.system.util.CodeUtil; import org.nl.modules.system.util.CodeUtil;
import org.nl.utils.SpringContextHolder; import org.nl.utils.SpringContextHolder;
@@ -559,6 +560,7 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
@Override @Override
public Map<String, Object> query4(Map whereJson, Pageable page) { public Map<String, Object> query4(Map whereJson, Pageable page) {
DeptService deptService = SpringContextHolder.getBean(DeptService.class);
String material_type_id = MapUtil.getStr(whereJson, "material_type_id"); String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
String class_idStr = MapUtil.getStr(whereJson, "class_idStr"); String class_idStr = MapUtil.getStr(whereJson, "class_idStr");
String device_code = MapUtil.getStr(whereJson, "device_code"); String device_code = MapUtil.getStr(whereJson, "device_code");
@@ -585,12 +587,19 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
String classIds = classstandardService.getAllChildIdStr(class_idStr); String classIds = classstandardService.getAllChildIdStr(class_idStr);
map.put("classIds", classIds); map.put("classIds", classIds);
} }
// 归属部门
String dept_id = MapUtil.getStr(whereJson, "dept_id");
if (!StrUtil.isEmpty(dept_id)) {
String deptIds = deptService.getChildIdStr(Long.parseLong(dept_id));
map.put("deptIds", deptIds);
}
JSONObject json = WQL.getWO("EM_BIDEVICEMAINTENANCE001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.input_time DESC"); JSONObject json = WQL.getWO("EM_BIDEVICEMAINTENANCE001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.input_time DESC");
return json; return json;
} }
@Override @Override
public Map<String, Object> query5(Map whereJson, Pageable page) { public Map<String, Object> query5(Map whereJson, Pageable page) {
DeptService deptService = SpringContextHolder.getBean(DeptService.class);
String material_type_id = MapUtil.getStr(whereJson, "material_type_id"); String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
String class_idStr = MapUtil.getStr(whereJson, "class_idStr"); String class_idStr = MapUtil.getStr(whereJson, "class_idStr");
String device_code = MapUtil.getStr(whereJson, "device_code"); String device_code = MapUtil.getStr(whereJson, "device_code");
@@ -619,6 +628,12 @@ public class DevicemaintenancemstServiceImpl implements DevicemaintenancemstServ
String classIds = classstandardService.getAllChildIdStr(class_idStr); String classIds = classstandardService.getAllChildIdStr(class_idStr);
map.put("classIds", classIds); map.put("classIds", classIds);
} }
// 归属部门
String dept_id = MapUtil.getStr(whereJson, "dept_id");
if (!StrUtil.isEmpty(dept_id)) {
String deptIds = deptService.getChildIdStr(Long.parseLong(dept_id));
map.put("deptIds", deptIds);
}
JSONObject json = WQL.getWO("EM_BIDEVICEMAINTENANCE001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "input_time DESC"); JSONObject json = WQL.getWO("EM_BIDEVICEMAINTENANCE001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "input_time DESC");
return json; return json;
} }

View File

@@ -23,6 +23,7 @@
输入.begin_time TYPEAS s_string 输入.begin_time TYPEAS s_string
输入.end_time TYPEAS s_string 输入.end_time TYPEAS s_string
输入.maint_object TYPEAS s_string 输入.maint_object TYPEAS s_string
输入.deptIds TYPEAS f_string
[临时表] [临时表]
@@ -324,7 +325,9 @@
(mst.maint_code like 输入.maint_code or (mst.maint_code like 输入.maint_code or
mst.maint_code like 输入.maint_code) mst.maint_code like 输入.maint_code)
ENDOPTION ENDOPTION
OPTION 输入.deptIds <> ""
d2.dept_id in 输入.deptIds
ENDOPTION
OPTION 输入.classIds <> "" OPTION 输入.classIds <> ""
class.class_id in 输入.classIds class.class_id in 输入.classIds
ENDOPTION ENDOPTION
@@ -384,7 +387,9 @@
OPTION 输入.classIds <> "" OPTION 输入.classIds <> ""
class.class_id in 输入.classIds class.class_id in 输入.classIds
ENDOPTION ENDOPTION
OPTION 输入.deptIds <> ""
d2.dept_id in 输入.deptIds
ENDOPTION
OPTION 输入.maintenancecycle <> "" OPTION 输入.maintenancecycle <> ""
mst.maintenancecycle = 输入.maintenancecycle mst.maintenancecycle = 输入.maintenancecycle
ENDOPTION ENDOPTION

View File

@@ -29,6 +29,15 @@
placeholder="请选择" placeholder="请选择"
/> />
</el-form-item> </el-form-item>
<el-form-item label="使用班组">
<treeselect
v-model="query.use_groupid"
:load-options="loadDepts"
:options="depts"
style="width: 200px;"
placeholder="请选择"
/>
</el-form-item>
<el-form-item label="设备"> <el-form-item label="设备">
<el-input <el-input
v-model="query.device_code" v-model="query.device_code"
@@ -206,7 +215,8 @@ import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
import PicDialog from '@/views/wms/sb/repair/devicerepairrequest/PicDialog' import PicDialog from '@/views/wms/sb/repair/devicerepairrequest/PicDialog'
import DeviceDialog from '@/views/wms/sb/repair/devicevprs/DeviceDialog' import DeviceDialog from '@/views/wms/sb/repair/devicevprs/DeviceDialog'
import FaultDialog from '@/views/wms/sb/repair/devicevprs/FaultDialog' import FaultDialog from '@/views/wms/sb/repair/devicevprs/FaultDialog'
import { getDepts } from '@/api/system/dept' import { getDepts, getDeptSuperior } from '@/api/system/dept'
import { mapGetters } from 'vuex'
const defaultForm = { material_type_id: null, product_person_name: null, device_faultclass_name: null, device_code: null, request_id: null, request_code: null, devicerecord_id: null, fault_time: null, device_faultclass_id: null, fault_desc: null, fault_level: null, remark: null, status: null, create_id: null, create_name: null, create_time: null, is_passed: null, process_id: null, process_name: null, process_time: null, finish_id: null, finish_name: null, finish_time: null, is_delete: null, sysdeptid: null, syscompanyid: null } const defaultForm = { material_type_id: null, product_person_name: null, device_faultclass_name: null, device_code: null, request_id: null, request_code: null, devicerecord_id: null, fault_time: null, device_faultclass_id: null, fault_desc: null, fault_level: null, remark: null, status: null, create_id: null, create_name: null, create_time: null, is_passed: null, process_id: null, process_name: null, process_time: null, finish_id: null, finish_name: null, finish_time: null, is_delete: null, sysdeptid: null, syscompanyid: null }
export default { export default {
@@ -266,6 +276,11 @@ export default {
} }
} }
}, },
computed: {
...mapGetters({
user: 'user'
})
},
created() { created() {
const param = { const param = {
'materOpt_code': this.materOpt_code 'materOpt_code': this.materOpt_code
@@ -277,6 +292,9 @@ export default {
this.queryClassId() this.queryClassId()
}) })
this.getDepts() this.getDepts()
this.query.use_groupid = this.user.dept.id
this.getSupDepts(this.user.dept.id)
this.crud.toQuery()
}, },
methods: { methods: {
// 钩子在获取表格数据之前执行false 则代表不获取数据 // 钩子在获取表格数据之前执行false 则代表不获取数据
@@ -401,6 +419,25 @@ export default {
return obj return obj
}) })
}) })
},
getSupDepts(deptId) {
debugger
var number = parseFloat(deptId)
getDeptSuperior(number).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
}
})
} }
} }
} }

View File

@@ -29,6 +29,15 @@
@keyup.enter.native="crud.toQuery" @keyup.enter.native="crud.toQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="使用班组">
<treeselect
v-model="query.dept_id"
:load-options="loadDepts"
:options="depts"
style="width: 200px;"
placeholder="请选择"
/>
</el-form-item>
<el-form-item label="保养类型"> <el-form-item label="保养类型">
<el-select <el-select
v-model="query.maintenancecycle" v-model="query.maintenancecycle"
@@ -160,6 +169,8 @@ import DateRangePicker from '@/components/DateRangePicker'
import AddDialog from '@/views/wms/sb/upkeep/devicemaintenancegrid/AddDialog' import AddDialog from '@/views/wms/sb/upkeep/devicemaintenancegrid/AddDialog'
import { download } from '@/api/data' import { download } from '@/api/data'
import { downloadFile } from '@/utils' import { downloadFile } from '@/utils'
import { mapGetters } from 'vuex'
import { getDepts, getDeptSuperior } from '@/api/system/dept'
export default { export default {
name: 'Devicemaintenancegrid', name: 'Devicemaintenancegrid',
@@ -185,12 +196,18 @@ export default {
data() { data() {
return { return {
classes: [], classes: [],
depts: [],
class_idStr: null, class_idStr: null,
materOpt_code: '23', materOpt_code: '23',
permission: { permission: {
} }
} }
}, },
computed: {
...mapGetters({
user: 'user'
})
},
created() { created() {
const param = { const param = {
'materOpt_code': this.materOpt_code 'materOpt_code': this.materOpt_code
@@ -201,6 +218,10 @@ export default {
this.crud.toQuery() this.crud.toQuery()
this.queryClassId() this.queryClassId()
}) })
this.getDepts()
this.query.dept_id = this.user.dept.id
this.getSupDepts(this.user.dept.id)
this.crud.toQuery()
}, },
methods: { methods: {
// 钩子在获取表格数据之前执行false 则代表不获取数据 // 钩子在获取表格数据之前执行false 则代表不获取数据
@@ -266,6 +287,51 @@ export default {
this.crud.toQuery() this.crud.toQuery()
downloadFile(result, name, 'xlsx') downloadFile(result, name, 'xlsx')
}) })
},
// 获取弹窗内部门数据
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)
})
}
},
getDepts() {
getDepts({ enabled: true }).then(res => {
this.depts = res.content.map(function(obj) {
if (obj.hasChildren) {
obj.children = null
}
return obj
})
})
},
getSupDepts(deptId) {
debugger
var number = parseFloat(deptId)
getDeptSuperior(number).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
}
})
} }
} }
} }

View File

@@ -29,6 +29,15 @@
@keyup.enter.native="crud.toQuery" @keyup.enter.native="crud.toQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="使用班组">
<treeselect
v-model="query.dept_id"
:load-options="loadDepts"
:options="depts"
style="width: 200px;"
placeholder="请选择"
/>
</el-form-item>
<el-form-item label="保养类型"> <el-form-item label="保养类型">
<el-select <el-select
v-model="query.maintenancecycle" v-model="query.maintenancecycle"
@@ -184,6 +193,8 @@ import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
import DateRangePicker from '@/components/DateRangePicker' import DateRangePicker from '@/components/DateRangePicker'
import ExecuteDialog from '@/views/wms/sb/upkeep/devicemaintenancepagrid/ExecuteDialog' import ExecuteDialog from '@/views/wms/sb/upkeep/devicemaintenancepagrid/ExecuteDialog'
import StartDialog from '@/views/wms/sb/upkeep/devicemaintenancepagrid/StartDialog' import StartDialog from '@/views/wms/sb/upkeep/devicemaintenancepagrid/StartDialog'
import { getDepts, getDeptSuperior } from '@/api/system/dept'
import { mapGetters } from 'vuex'
export default { export default {
name: 'Devicemaintenancepagrid', name: 'Devicemaintenancepagrid',
@@ -213,6 +224,7 @@ export default {
end_flag: true, end_flag: true,
confirm_flag: true, confirm_flag: true,
classes: [], classes: [],
depts: [],
class_idStr: null, class_idStr: null,
materOpt_code: '23', materOpt_code: '23',
openParam: null, openParam: null,
@@ -222,6 +234,11 @@ export default {
} }
} }
}, },
computed: {
...mapGetters({
user: 'user'
})
},
created() { created() {
const param = { const param = {
'materOpt_code': this.materOpt_code 'materOpt_code': this.materOpt_code
@@ -232,6 +249,10 @@ export default {
this.crud.toQuery() this.crud.toQuery()
this.queryClassId() this.queryClassId()
}) })
this.getDepts()
this.query.dept_id = this.user.dept.id
this.getSupDepts(this.user.dept.id)
this.crud.toQuery()
}, },
methods: { methods: {
// 钩子在获取表格数据之前执行false 则代表不获取数据 // 钩子在获取表格数据之前执行false 则代表不获取数据
@@ -369,6 +390,51 @@ export default {
this.execu_flag = true this.execu_flag = true
this.end_flag = true this.end_flag = true
this.confirm_flag = true this.confirm_flag = true
},
// 获取弹窗内部门数据
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)
})
}
},
getDepts() {
getDepts({ enabled: true }).then(res => {
this.depts = res.content.map(function(obj) {
if (obj.hasChildren) {
obj.children = null
}
return obj
})
})
},
getSupDepts(deptId) {
debugger
var number = parseFloat(deptId)
getDeptSuperior(number).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
}
})
} }
} }
} }

View File

@@ -95,7 +95,8 @@ import pagination from '@crud/Pagination'
import crudDevicemaintenanceplanmst from '@/api/wms/sb/devicemaintenanceplanmst' import crudDevicemaintenanceplanmst from '@/api/wms/sb/devicemaintenanceplanmst'
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect' 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 } from '@/api/system/dept' import { getDepts, getDeptSuperior } from '@/api/system/dept'
import { mapGetters } from 'vuex'
export default { export default {
name: 'Device', name: 'Device',
@@ -135,8 +136,16 @@ export default {
} }
} }
}, },
computed: {
...mapGetters({
user: 'user'
})
},
created() { created() {
this.getDepts() this.getDepts()
this.query.use_id = this.user.dept.id
this.getSupDepts(this.user.dept.id)
this.crud.toQuery()
}, },
methods: { methods: {
clickChange(item) { clickChange(item) {
@@ -209,6 +218,25 @@ export default {
return obj return obj
}) })
}) })
},
getSupDepts(deptId) {
debugger
var number = parseFloat(deptId)
getDeptSuperior(number).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
}
})
} }
} }
} }