You need to sign in or sign up before continuing.
Commit c76818ee authored by 刘帅's avatar 刘帅

1.优化

parent f051971d
......@@ -48,8 +48,8 @@ public class SysDeptController extends BaseController {
*/
@SaCheckPermission("system:dept:list")
@GetMapping("/current/list")
public R<List<SysDept>> getCurrentDeptList() {
List<SysDept> depts = deptService.selectCurrentDeptList();
public R<List<SysDept>> getCurrentDeptList(SysDept dept) {
List<SysDept> depts = deptService.selectCurrentDeptList(dept);
return R.ok(depts);
}
......
......@@ -92,5 +92,9 @@ public class ErpMaterialPicking extends BaseEntity {
* 出库时间
*/
private Date outTime;
/**
* 创建部门(数据权限)
*/
private Long createDeptId;
}
......@@ -64,7 +64,7 @@ public class ErpGroupServiceImpl implements IErpGroupService {
}
private LambdaQueryWrapper<ErpGroup> buildQueryWrapper(ErpGroupBo bo) {
List<SysDept> deptList = deptMapper.selectChildrenDeptById(LoginHelper.getDeptId());
List<SysDept> deptList = deptMapper.selectChildrenDeptById(LoginHelper.getDeptId(), null);
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<ErpGroup> lqw = Wrappers.lambdaQuery();
lqw.like(StringUtils.isNotBlank(bo.getCode()), ErpGroup::getCode, bo.getCode());
......
......@@ -151,6 +151,7 @@ public class ErpMaterialPickingServiceImpl implements IErpMaterialPickingService
add.setReceiveTime(new Date());
BigDecimal moneyTotal = bo.getMaterialList().stream().map(ErpMaterialPickingInfoBo::getMoney).reduce(BigDecimal.ZERO, BigDecimal::add);
add.setOutMoney(moneyTotal);
add.setCreateDeptId(LoginHelper.getUserId());
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
......
......@@ -177,7 +177,7 @@ public class ErpRepairFormServiceImpl implements IErpRepairFormService {
}
private QueryWrapper<ErpRepairForm> buildCustomQueryWrapper(ErpRepairFormBo bo) {
List<SysDept> sysDeptList = deptMapper.selectChildrenDeptById(LoginHelper.getDeptId());
List<SysDept> sysDeptList = deptMapper.selectChildrenDeptById(LoginHelper.getDeptId(), null);
QueryWrapper<ErpRepairForm> query = Wrappers.query();
query
.like(StringUtils.isNotBlank(bo.getRepairNumber()), "erf.repair_number", bo.getRepairNumber())
......
......@@ -64,7 +64,7 @@ public class ErpWarehouseServiceImpl implements IErpWarehouseService {
}
private LambdaQueryWrapper<ErpWarehouse> buildQueryWrapper(ErpWarehouseBo bo) {
List<SysDept> deptList = deptMapper.selectChildrenDeptById(LoginHelper.getDeptId());
List<SysDept> deptList = deptMapper.selectChildrenDeptById(LoginHelper.getDeptId(), null);
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<ErpWarehouse> lqw = Wrappers.lambdaQuery();
lqw.like(StringUtils.isNotBlank(bo.getCode()), ErpWarehouse::getCode, bo.getCode());
......
package com.maintain.common.enums;
import lombok.Getter;
/**
* 用户状态
*
* @author maintain
*/
@Getter
public enum DeptType {
ONE("1", "总公司"),
TWO("2", "分公司"),
THREE("3", "车队"),
FOUR("4", "车间"),
FIVE("5", "总公司管理部门"),
SIX("6", "分公司管理部门"),
SEVEN("7", "维修点");
private final String code;
private final String info;
DeptType(String code, String info) {
this.code = code;
this.info = info;
}
}
......@@ -43,6 +43,6 @@ public interface SysDeptMapper extends BaseMapperPlus<SysDeptMapper, SysDept, Sy
* @param deptId 部门ID
* @return 选中部门列表
*/
List<SysDept> selectChildrenDeptById(@Param("deptId") Long deptId);
List<SysDept> selectChildrenDeptById(@Param("deptId") Long deptId, @Param("type") String type);
}
......@@ -24,7 +24,7 @@ public interface ISysDeptService {
*
* @return 部门信息集合
*/
List<SysDept> selectCurrentDeptList();
List<SysDept> selectCurrentDeptList(SysDept dept);
/**
* 查询部门树结构信息
......
......@@ -75,8 +75,8 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
* @return 部门信息集合
*/
@Override
public List<SysDept> selectCurrentDeptList() {
return baseMapper.selectChildrenDeptById(LoginHelper.getDeptId());
public List<SysDept> selectCurrentDeptList(SysDept dept) {
return baseMapper.selectChildrenDeptById(LoginHelper.getDeptId(), dept.getType());
}
/**
......
......@@ -39,6 +39,9 @@
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
select * from sys_dept where (find_in_set(#{deptId}, ancestors) or dept_id = #{deptId}) and status = 0 and del_flag = 0
<if test="type != null">
and type = #{type}
</if>
</select>
</mapper>
......@@ -52,9 +52,10 @@ export function getUnitTree(id) {
}
// 查询维修站点-单位-站点树结构
export function getSiteTree(id) {
export function getCurrentDeptTree(query) {
return request({
url: '/system/dept/current/list',
method: 'get'
method: 'get',
params: query
})
}
\ No newline at end of file
}
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="115px">
<el-form-item label="分类名称" prop="typeName">
<el-input
v-model="queryParams.typeName"
placeholder="请输入分类名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="分类名称" prop="typeName">-->
<!-- <el-input-->
<!-- v-model="queryParams.typeName"-->
<!-- placeholder="请输入分类名称"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="检验项目编号" prop="examineCode">
<el-input
v-model="queryParams.examineCode"
......@@ -31,7 +31,7 @@
</el-form-item>
</el-form>
<projectType type="3" ref="projectType" v-if="type==1">
<projectType type="3" ref="projectType" @child-click="handleNodeClick" v-if="type==1">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
......@@ -374,12 +374,8 @@ export default {
pageNum: 1,
pageSize: 10,
typeId: undefined,
typeName: undefined,
examineCode: undefined,
examineName: undefined,
isGeneral: undefined,
state: undefined,
isDelete: undefined,
},
// 表单参数
form: {
......@@ -460,6 +456,11 @@ export default {
};
this.resetForm("form");
},
/** 节点点击 */
handleNodeClick(item) {
this.queryParams.typeId = item.id;
this.getList();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
......@@ -468,6 +469,7 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.typeId = undefined;
this.handleQuery();
},
// 多选框选中数据
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
<el-form-item label="维修原因" prop="maintainCauseName">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="维修原因编号" prop="maintainCauseCode" label-width="120px">
<el-input
v-model="queryParams.maintainCauseName"
placeholder="请输入维修原因"
v-model="queryParams.maintainCauseCode"
placeholder="请输入维修原因编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="维修原因编号" prop="maintainCauseCode">
<el-form-item label="维修原因" prop="maintainCauseName">
<el-input
v-model="queryParams.maintainCauseCode"
placeholder="请输入维修原因编号"
v-model="queryParams.maintainCauseName"
placeholder="请输入维修原因"
clearable
@keyup.enter.native="handleQuery"
/>
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="项目类别" prop="projectCode">
<Treeselect v-model="queryParams.typeId" :options="$refs.projectType?$refs.projectType.treeData:[]" placeholder="请选择" :props="{value:'id'}" :show-count="true" style="width:200px;" />
</el-form-item>
<!-- <el-form-item label="项目类别" prop="projectCode">-->
<!-- <Treeselect v-model="queryParams.typeId" :options="$refs.projectType?$refs.projectType.treeData:[]" placeholder="请选择" :props="{value:'id'}" :show-count="true" style="width:200px;" />-->
<!-- </el-form-item>-->
<el-form-item label="项目编号" prop="projectCode">
<el-input
v-model="queryParams.projectCode"
......@@ -26,7 +26,7 @@
</el-form-item>
</el-form>
<projectType type="1" ref="projectType" v-if="type==1">
<projectType type="1" ref="projectType" @child-click="handleNodeClick" v-if="type==1">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
......@@ -300,15 +300,8 @@ export default {
pageNum: 1,
pageSize: 10,
typeId: undefined,
typeName: undefined,
projectCode: undefined,
projectName: undefined,
standardManHour: undefined,
standardPrice: undefined,
warrantyPeriod: undefined,
technicalSpecification: undefined,
state: undefined,
isDelete: undefined
},
// 表单参数
form: {},
......@@ -405,14 +398,8 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams={
pageNum: 1,
pageSize: this.queryParams.pageSize,
typeId: undefined,
projectCode: undefined,
projectName: undefined,
},
this.resetForm("queryForm");
this.queryParams.typeId = undefined;
this.handleQuery();
},
// 多选框选中数据
......@@ -422,6 +409,11 @@ export default {
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 节点点击 */
handleNodeClick(item) {
this.queryParams.typeId = item.id;
this.getList();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
......
......@@ -22,7 +22,7 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<projectType type="2" ref="projectType" v-if="type==1">
<projectType type="2" ref="projectType" @child-click="handleNodeClick" v-if="type==1">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
......@@ -357,6 +357,11 @@ export default {
};
this.resetForm("form");
},
/** 节点点击 */
handleNodeClick(item) {
this.queryParams.typeId = item.id;
this.getList();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
......@@ -365,6 +370,7 @@ export default {
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.typeId = undefined;
this.handleQuery();
},
// 多选框选中数据
......
......@@ -462,7 +462,7 @@ import {
} from '@/api/business/materialCheck'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { getSiteTree } from '@/api/business/unit'
import { getCurrentDeptTree } from '@/api/business/unit'
import {listSiteWarehouse, listWarehouseAll} from '@/api/business/siteWarehouse'
import {customListAll, customListAllByWarehouseId, listMaterial} from '@/api/business/material'
import { formatDate } from '@/utils'
......@@ -571,7 +571,7 @@ export default {
});
},
getDeptTree(){
getSiteTree().then(response => {
getCurrentDeptTree().then(response => {
this.deptTreeData = this.handleTree(response.data, "deptId")
});
},
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="仓库名称" prop="warehouseName">
<el-input
v-model="queryParams.warehouseName"
placeholder="请输入仓库名称"
clearable
@keyup.enter.native="handleQuery"
/>
<el-form-item label="仓库名称" prop="warehouseId">
<el-select v-model="queryParams.warehouseId" filterable placeholder="选择仓库" clearable>
<el-option
v-for="item in warehouseList"
:key="item.id"
:value="item.id"
:label="item.name"
/>
</el-select>
</el-form-item>
<el-form-item label="物资编码" prop="materialCode">
<el-input
......@@ -143,6 +145,7 @@
import {listByMaterialId, listMaterialInventory} from "@/api/business/material";
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import {listWarehouseAll} from "@/api/business/siteWarehouse";
export default {
name: "Material",
......@@ -168,6 +171,8 @@ export default {
total: 0,
// 物资表格数据
materialList: [],
// 仓库列表
warehouseList: [],
// 物料入库明细表格数据
materialPutawayInfoList: [],
// 物料退货明细表格数据
......@@ -196,6 +201,7 @@ export default {
},
created() {
this.getList();
this.getWarehouseList();
},
methods: {
/** 查询物资列表 */
......@@ -207,6 +213,12 @@ export default {
this.loading = false;
});
},
/** 仓库列表 */
getWarehouseList() {
listWarehouseAll().then(response => {
this.warehouseList = response.data;
});
},
/** 物资分类更改 */
// materialTypeIdChange() {
// this.$refs.form.clearValidate('materialTypeId')
......
......@@ -22,7 +22,9 @@
ref="tree"
node-key="id"
default-expand-all
highlight-current>
highlight-current
@node-click="treeDataChange"
>
<span class="custom-tree-node" slot-scope="{ node, data }" @mouseenter="showIcons(node)" @mouseleave="hideIcons(node)">
<span>{{ node.label }}</span>
<span class="tree-node-icons" v-show="node.showIcons" v-if="data.id !== 1 && data.id !== 2 && data.id !== 3">
......@@ -134,10 +136,17 @@ export default {
};
this.resetForm("form");
},
/** 点击事件 */
treeDataChange(item) {
this.form = { type: this.type, parentId: item.id }
this.$emit("child-click", item);
},
/** 新增按钮操作 */
handleAdd(data) {
console.log('data', data)
this.form={ type: this.type, parentId: data.id }
if (data.id) {
console.log('data', data)
this.form={ type: this.type, parentId: data.id }
}
this.open = true;
this.title = `添加${this.type==1?'维修':this.type==2?'故障':this.type==3?'检验':this.type}项目分类`;
},
......
......@@ -476,7 +476,7 @@ import malfunctionProject from '../malfunctionProject/index'
import {listCar} from '@/api/business/car'
import {listClient} from '@/api/business/client'
import {listMaintainCause} from '@/api/business/maintainCause'
import {getSiteTree} from '@/api/business/unit'
import {getCurrentDeptTree} from '@/api/business/unit'
import {listSiteGroup} from '@/api/business/siteGroup'
import {getVehicleModel} from '@/api/business/vehicleModel'
import repairFormProject from '@/views/business/repairFormProject/index.vue'
......@@ -724,8 +724,6 @@ export default {
}else {
this.deliveryForm.deliveryTime = formatDate(new Date().getTime())
}
})
},
/** 查询人员-人员列表 */
......@@ -769,7 +767,7 @@ export default {
})
},
getTreeData(){
getSiteTree().then(response => {
getCurrentDeptTree({type: 4}).then(response => {
this.treeData = this.handleTree(response.data, "deptId")
});
},
......
......@@ -173,7 +173,7 @@ import { listSiteGroup, getSiteGroup, delSiteGroup, addSiteGroup, updateSiteGrou
import { listDept } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { getSiteTree } from "@/api/business/unit";
import { getCurrentDeptTree } from "@/api/business/unit";
import { getToken } from '@/utils/auth'
export default {
......@@ -279,7 +279,7 @@ export default {
// listDept().then(response => {
// this.treeData = this.handleTree(response.data, "deptId");
// });
getSiteTree().then(response => {
getCurrentDeptTree({type: 4}).then(response => {
this.treeData = this.handleTree(response.data, "deptId")
});
},
......
......@@ -167,7 +167,7 @@
<script>
import { listSiteWarehouse, getSiteWarehouse, delSiteWarehouse, addSiteWarehouse, updateSiteWarehouse } from "@/api/business/siteWarehouse";
import { listDept } from "@/api/system/dept";
import { getSiteTree } from "@/api/business/unit";
import { getCurrentDeptTree } from "@/api/business/unit";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { getToken } from '@/utils/auth'
......@@ -277,7 +277,7 @@ export default {
// listDept().then(response => {
// this.treeData = this.handleTree(response.data, "deptId");
// });
getSiteTree().then(response => {
getCurrentDeptTree().then(response => {
this.treeData = this.handleTree(response.data, "deptId")
});
},
......
......@@ -235,7 +235,7 @@
<script>
import { listUser, getUser, delUser, addUser, updateUser, getUserCode } from "@/api/business/user";
import { getSiteTree } from "@/api/business/unit";
import { getCurrentDeptTree } from "@/api/business/unit";
import { listSiteGroup } from "@/api/business/siteGroup";
import { listPost } from "@/api/business/post";
import { formatDate } from "@/utils/index"
......@@ -354,7 +354,7 @@ export default {
},
methods: {
getSiteTre(){
getSiteTree().then(response => {
getCurrentDeptTree().then(response => {
this.siteLists = this.handleTree(response.data, "deptId")
});
},
......
......@@ -210,7 +210,7 @@ import {
} from '@/api/business/warehouseLocation'
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { getSiteTree } from '@/api/business/unit'
import { getCurrentDeptTree } from '@/api/business/unit'
import { listSiteWarehouse } from '@/api/business/siteWarehouse'
import { parseTime } from '../../../utils/ruoyi'
import { typeTree } from '../../../api/business/materialType'
......@@ -313,7 +313,7 @@ export default {
},
methods: {
getDeptTree(){
getSiteTree().then(response => {
getCurrentDeptTree().then(response => {
this.treeData = this.handleTree(response.data, "deptId")
});
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment