Merge branch 'master' of http://121.40.234.130:8899/root/hl_one
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
package org.nl.wms.device_manage.controller.userdevice;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
@@ -14,14 +16,14 @@ import org.nl.common.anno.Log;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.wms.device_manage.service.userdevice.IPdmBiPersoncorrdeviceService;
|
||||
import org.nl.wms.device_manage.service.userdevice.dao.PdmBiPersoncorrdevice;
|
||||
import org.nl.wms.device_manage.service.userdevice.dto.DeviceUserQuery;
|
||||
import org.nl.wms.mps.service.PersoncorrdeviceService;
|
||||
import org.nl.wms.mps.service.dto.PersoncorrdeviceDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -45,7 +47,7 @@ public class PersoncorrdeviceController {
|
||||
@GetMapping
|
||||
@Log("查询人员设备维护")
|
||||
@ApiOperation("查询人员设备维护")
|
||||
public ResponseEntity<Object> query(@RequestParam Map query, PageQuery page){
|
||||
public ResponseEntity<Object> query(DeviceUserQuery query, PageQuery page){
|
||||
Page<Object> result = PageHelper.startPage(page.getPage() + 1, page.getSize());
|
||||
List<Map> list = pdmBiPersoncorrdeviceService.queryAll(query);
|
||||
TableDataInfo build = TableDataInfo.build(list);
|
||||
@@ -53,24 +55,64 @@ public class PersoncorrdeviceController {
|
||||
return new ResponseEntity<>(build,HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/device")
|
||||
@Log("查询设备")
|
||||
@ApiOperation("查询设备")
|
||||
public ResponseEntity<Object> device(DeviceUserQuery query, PageQuery page){
|
||||
Page<Object> result = PageHelper.startPage(page.getPage() + 1, page.getSize());
|
||||
List<Map> list = pdmBiPersoncorrdeviceService.queryAllDevice(query);
|
||||
TableDataInfo build = TableDataInfo.build(list);
|
||||
build.setTotalElements(result.getTotal());
|
||||
return new ResponseEntity<>(build,HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增人员设备维护")
|
||||
@ApiOperation("新增人员设备维护")
|
||||
//@PreAuthorize("@el.check('personcorrdevice:add')")
|
||||
public ResponseEntity<Object> create(@RequestBody JSONObject entity){
|
||||
Assert.notNull(entity,"请求参数不能为空");
|
||||
|
||||
PdmBiPersoncorrdevice one = pdmBiPersoncorrdeviceService.getOne(
|
||||
new QueryWrapper<PdmBiPersoncorrdevice>().lambda()
|
||||
.eq(PdmBiPersoncorrdevice::getUser_id, entity.getString("user_id"))
|
||||
.eq(PdmBiPersoncorrdevice::getDevice_code, entity.getString("device_code"))
|
||||
);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(one)) throw new BadRequestException("设备重复");
|
||||
|
||||
PdmBiPersoncorrdevice pdmBiPersoncorrdevice = entity.toJavaObject(PdmBiPersoncorrdevice.class);
|
||||
pdmBiPersoncorrdevice.setId(IdUtil.getStringId());
|
||||
pdmBiPersoncorrdevice.setPerson_id(IdUtil.getStringId());
|
||||
pdmBiPersoncorrdeviceService.save(pdmBiPersoncorrdevice);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改人员设备维护")
|
||||
@ApiOperation("修改人员设备维护")
|
||||
//@PreAuthorize("@el.check('personcorrdevice:add')")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject entity){
|
||||
|
||||
PdmBiPersoncorrdevice one = pdmBiPersoncorrdeviceService.getOne(
|
||||
new QueryWrapper<PdmBiPersoncorrdevice>().lambda()
|
||||
.eq(PdmBiPersoncorrdevice::getUser_id, entity.getString("user_id"))
|
||||
.eq(PdmBiPersoncorrdevice::getDevice_code, entity.getString("device_code"))
|
||||
);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(one)) throw new BadRequestException("设备重复");
|
||||
|
||||
PdmBiPersoncorrdevice pdmBiPersoncorrdevice = pdmBiPersoncorrdeviceService.getById(entity.getString("person_id"));
|
||||
pdmBiPersoncorrdevice.setDevice_code(entity.getString("device_code"));
|
||||
pdmBiPersoncorrdeviceService.updateById(pdmBiPersoncorrdevice);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
|
||||
@Log("删除人员设备维护")
|
||||
@ApiOperation("删除人员设备维护")
|
||||
//@PreAuthorize("@el.check('personcorrdevice:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||
if (ids != null && ids.length>0){
|
||||
pdmBiPersoncorrdeviceService.removeByIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@ package org.nl.wms.device_manage.service.userdevice;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.device_manage.service.userdevice.dao.PdmBiPersoncorrdevice;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.device_manage.service.userdevice.dto.DeviceUserQuery;
|
||||
import org.nl.wms.mps.service.dto.PersoncorrdeviceDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
@@ -27,7 +27,7 @@ public interface IPdmBiPersoncorrdeviceService extends IService<PdmBiPersoncorrd
|
||||
* @param whereJson 条件
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
List<Map> queryAll(Map whereJson);
|
||||
List<Map> queryAll(DeviceUserQuery whereJson);
|
||||
|
||||
|
||||
/**
|
||||
@@ -80,4 +80,6 @@ public interface IPdmBiPersoncorrdeviceService extends IService<PdmBiPersoncorrd
|
||||
void addDevices(JSONObject param);
|
||||
|
||||
void deleteRow(JSONObject param);
|
||||
|
||||
List<Map> queryAllDevice(DeviceUserQuery whereJson);
|
||||
}
|
||||
|
||||
@@ -16,13 +16,13 @@ import lombok.EqualsAndHashCode;
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("pdm_bi_personcorrdevice")
|
||||
@TableName("mps_personcorrdevice")
|
||||
public class PdmBiPersoncorrdevice implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
@TableId
|
||||
private String person_id;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package org.nl.wms.device_manage.service.userdevice.dao.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.device_manage.service.userdevice.dao.PdmBiPersoncorrdevice;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.device_manage.service.userdevice.dto.DeviceUserQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -16,5 +18,7 @@ import java.util.Map;
|
||||
*/
|
||||
public interface PdmBiPersoncorrdeviceMapper extends BaseMapper<PdmBiPersoncorrdevice> {
|
||||
|
||||
List<Map> queryAll(Map query);
|
||||
List<Map> queryAll(@Param("query") DeviceUserQuery query);
|
||||
|
||||
List<Map> queryAllDevice(@Param("query") DeviceUserQuery query);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,32 @@
|
||||
<mapper namespace="org.nl.wms.device_manage.service.userdevice.dao.mapper.PdmBiPersoncorrdeviceMapper">
|
||||
|
||||
<select id="queryAll" resultType="java.util.Map">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
sys_user
|
||||
<where>
|
||||
is_used = '1'
|
||||
<if test="query.username != null and query.username != ''">
|
||||
and username = #{query.username}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="queryAllDevice" resultType="java.util.Map">
|
||||
SELECT
|
||||
device.device_code,
|
||||
device.device_name,
|
||||
use1.person_name,
|
||||
mps.person_id
|
||||
FROM
|
||||
mps_personcorrdevice mps
|
||||
LEFT JOIN pdm_bi_device device ON device.device_code = mps.device_code
|
||||
LEFT JOIN sys_user use1 ON use1.user_id = mps.user_id
|
||||
<where>
|
||||
mps.user_id = #{query.user_id}
|
||||
</where>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.nl.wms.device_manage.service.userdevice.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.common.domain.query.QParam;
|
||||
import org.nl.common.enums.QueryTEnum;
|
||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvCp;
|
||||
import org.nl.wms.system_manage.service.user.dto.UserDto;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/5/4 19:49
|
||||
*/
|
||||
@Data
|
||||
public class DeviceUserQuery extends BaseQuery<UserDto> {
|
||||
|
||||
private String username;
|
||||
|
||||
private String user_id;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("username", QParam.builder().k(new String[]{"username"}).type(QueryTEnum.LK).build());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -2,11 +2,11 @@ package org.nl.wms.device_manage.service.userdevice.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.device_manage.service.userdevice.dao.PdmBiPersoncorrdevice;
|
||||
import org.nl.wms.device_manage.service.userdevice.dao.mapper.PdmBiPersoncorrdeviceMapper;
|
||||
import org.nl.wms.device_manage.service.userdevice.IPdmBiPersoncorrdeviceService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.device_manage.service.userdevice.dto.DeviceUserQuery;
|
||||
import org.nl.wms.mps.service.dto.PersoncorrdeviceDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -26,9 +26,8 @@ import java.util.Map;
|
||||
public class PdmBiPersoncorrdeviceServiceImpl extends ServiceImpl<PdmBiPersoncorrdeviceMapper, PdmBiPersoncorrdevice> implements IPdmBiPersoncorrdeviceService {
|
||||
|
||||
@Override
|
||||
public List<Map> queryAll(Map query) {
|
||||
this.baseMapper.queryAll(query);
|
||||
return null;
|
||||
public List<Map> queryAll(DeviceUserQuery query) {
|
||||
return this.baseMapper.queryAll(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -85,4 +84,9 @@ public class PdmBiPersoncorrdeviceServiceImpl extends ServiceImpl<PdmBiPersoncor
|
||||
public void deleteRow(JSONObject param) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> queryAllDevice(DeviceUserQuery query) {
|
||||
return this.baseMapper.queryAllDevice(query);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
package org.nl.wms.product_manage.controller.teamcorrPerson;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.wms.device_manage.service.userdevice.dao.PdmBiPersoncorrdevice;
|
||||
import org.nl.wms.device_manage.service.userdevice.dto.DeviceUserQuery;
|
||||
import org.nl.wms.product_manage.service.teamcorrPerson.IPdmBiTeamcorrpersonService;
|
||||
import org.nl.wms.product_manage.service.teamcorrPerson.dao.PdmBiTeamcorrperson;
|
||||
import org.nl.wms.product_manage.service.teamcorrPerson.dto.WorkTeamQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 班组与人员对应关系表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-06-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/pdmBiTeamcorrperson")
|
||||
public class PdmBiTeamcorrpersonController {
|
||||
|
||||
@Autowired
|
||||
private IPdmBiTeamcorrpersonService iPdmBiTeamcorrpersonService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询人员设备维护")
|
||||
@ApiOperation("查询人员设备维护")
|
||||
public ResponseEntity<Object> query(WorkTeamQuery query, PageQuery page){
|
||||
Page<Object> result = PageHelper.startPage(page.getPage() + 1, page.getSize());
|
||||
List<Map> list = iPdmBiTeamcorrpersonService.queryAll(query);
|
||||
TableDataInfo build = TableDataInfo.build(list);
|
||||
build.setTotalElements(result.getTotal());
|
||||
return new ResponseEntity<>(build, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/queryUser")
|
||||
@Log("查询人员设备维护")
|
||||
@ApiOperation("查询人员设备维护")
|
||||
public ResponseEntity<Object> queryUser(WorkTeamQuery query, PageQuery page){
|
||||
Page<Object> result = PageHelper.startPage(page.getPage() + 1, page.getSize());
|
||||
List<Map> list = iPdmBiTeamcorrpersonService.queryUser(query);
|
||||
TableDataInfo build = TableDataInfo.build(list);
|
||||
build.setTotalElements(result.getTotal());
|
||||
return new ResponseEntity<>(build, HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping
|
||||
@Log("新增班组对应人员")
|
||||
@ApiOperation("新增班组对应人员")
|
||||
public ResponseEntity<Object> create(@RequestBody JSONObject entity){
|
||||
Assert.notNull(entity,"请求参数不能为空");
|
||||
|
||||
PdmBiTeamcorrperson one = iPdmBiTeamcorrpersonService.getOne(
|
||||
new QueryWrapper<PdmBiTeamcorrperson>().lambda()
|
||||
.eq(PdmBiTeamcorrperson::getUser_id, entity.getString("user_id"))
|
||||
.eq(PdmBiTeamcorrperson::getTeam_id, entity.getString("team_id"))
|
||||
);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(one)) throw new BadRequestException("人员重复");
|
||||
|
||||
PdmBiTeamcorrperson pdmBiTeamcorrperson = entity.toJavaObject(PdmBiTeamcorrperson.class);
|
||||
pdmBiTeamcorrperson.setTeam_person_id(IdUtil.getStringId());
|
||||
iPdmBiTeamcorrpersonService.save(pdmBiTeamcorrperson);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
|
||||
@PutMapping
|
||||
@Log("修改班组对应人员")
|
||||
@ApiOperation("修改班组对应人员")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject entity){
|
||||
|
||||
PdmBiTeamcorrperson one = iPdmBiTeamcorrpersonService.getOne(
|
||||
new QueryWrapper<PdmBiTeamcorrperson>().lambda()
|
||||
.eq(PdmBiTeamcorrperson::getUser_id, entity.getString("user_id"))
|
||||
.eq(PdmBiTeamcorrperson::getTeam_id, entity.getString("team_id"))
|
||||
);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(one)) throw new BadRequestException("人员重复");
|
||||
|
||||
PdmBiTeamcorrperson pdmBiTeamcorrperson = iPdmBiTeamcorrpersonService.getById(entity.getString("team_person_id"));
|
||||
pdmBiTeamcorrperson.setUser_id(entity.getString("user_id"));
|
||||
iPdmBiTeamcorrpersonService.updateById(pdmBiTeamcorrperson);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@Log("删除班组对应人员")
|
||||
@ApiOperation("删除班组对应人员")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||
if (ids != null && ids.length>0){
|
||||
iPdmBiTeamcorrpersonService.removeByIds(Arrays.asList(ids));
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,23 @@
|
||||
package org.nl.wms.product_manage.service.teamcorrPerson;
|
||||
|
||||
import org.nl.wms.product_manage.service.teamcorrPerson.dao.PdmBiTeamcorrperson;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.product_manage.service.teamcorrPerson.dto.WorkTeamQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 班组与人员对应关系表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-06-20
|
||||
*/
|
||||
public interface IPdmBiTeamcorrpersonService extends IService<PdmBiTeamcorrperson> {
|
||||
|
||||
List<Map> queryAll(WorkTeamQuery query);
|
||||
|
||||
List<Map> queryUser(WorkTeamQuery query);
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package org.nl.wms.product_manage.service.teamcorrPerson.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 班组与人员对应关系表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-06-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("pdm_bi_teamcorrperson")
|
||||
public class PdmBiTeamcorrperson implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 班组人员对应标识
|
||||
*/
|
||||
@TableId
|
||||
private String team_person_id;
|
||||
|
||||
/**
|
||||
* 班组标识
|
||||
*/
|
||||
private String team_id;
|
||||
|
||||
/**
|
||||
* 操作工标识
|
||||
*/
|
||||
private String user_id;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package org.nl.wms.product_manage.service.teamcorrPerson.dao.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.product_manage.service.teamcorrPerson.dao.PdmBiTeamcorrperson;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.product_manage.service.teamcorrPerson.dto.WorkTeamQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 班组与人员对应关系表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-06-20
|
||||
*/
|
||||
public interface PdmBiTeamcorrpersonMapper extends BaseMapper<PdmBiTeamcorrperson> {
|
||||
|
||||
List<Map> queryAll(@Param("query") WorkTeamQuery query);
|
||||
|
||||
List<Map> queryUser(@Param("query") WorkTeamQuery query);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.product_manage.service.teamcorrPerson.dao.mapper.PdmBiTeamcorrpersonMapper">
|
||||
|
||||
<select id="queryAll" resultType="java.util.Map">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
PDM_BI_WorkTeam
|
||||
<where>
|
||||
is_delete = '0'
|
||||
<if test="query.team_code != null and query.team_code != ''">
|
||||
and (team_code like #{query.team_code} or
|
||||
team_name like #{query.team_code})
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryUser" resultType="java.util.Map">
|
||||
SELECT
|
||||
u.*,
|
||||
person.team_person_id
|
||||
FROM
|
||||
pdm_bi_teamcorrperson person
|
||||
LEFT JOIN sys_user u ON u.user_id = person.user_id
|
||||
<where>
|
||||
person.team_id = #{query.team_id}
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.nl.wms.product_manage.service.teamcorrPerson.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.common.domain.query.QParam;
|
||||
import org.nl.common.enums.QueryTEnum;
|
||||
import org.nl.modules.common.base.BaseDTO;
|
||||
import org.nl.wms.system_manage.service.user.dto.UserDto;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/5/4 19:49
|
||||
*/
|
||||
@Data
|
||||
public class WorkTeamQuery extends BaseQuery<BaseDTO> {
|
||||
|
||||
private String team_code;
|
||||
|
||||
private String team_id;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("team_code", QParam.builder().k(new String[]{"team_code"}).type(QueryTEnum.LK).build());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package org.nl.wms.product_manage.service.teamcorrPerson.impl;
|
||||
|
||||
import org.nl.wms.product_manage.service.teamcorrPerson.dao.PdmBiTeamcorrperson;
|
||||
import org.nl.wms.product_manage.service.teamcorrPerson.dao.mapper.PdmBiTeamcorrpersonMapper;
|
||||
import org.nl.wms.product_manage.service.teamcorrPerson.IPdmBiTeamcorrpersonService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.wms.product_manage.service.teamcorrPerson.dto.WorkTeamQuery;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 班组与人员对应关系表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2023-06-20
|
||||
*/
|
||||
@Service
|
||||
public class PdmBiTeamcorrpersonServiceImpl extends ServiceImpl<PdmBiTeamcorrpersonMapper, PdmBiTeamcorrperson> implements IPdmBiTeamcorrpersonService {
|
||||
|
||||
@Override
|
||||
public List<Map> queryAll(WorkTeamQuery query) {
|
||||
return this.baseMapper.queryAll(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> queryUser(WorkTeamQuery query) {
|
||||
return this.baseMapper.queryUser(query);
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/teamcorrperson',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/teamcorrperson/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/teamcorrperson',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getPersonIdByTeamId(data) {
|
||||
return request({
|
||||
url: 'api/teamcorrperson/getPersonIdByTeamId',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function addPersons(data) {
|
||||
return request({
|
||||
url: 'api/teamcorrperson/addPersons',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getPersonIdByTeamId, addPersons }
|
||||
@@ -1,144 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="query.user_name === ''">
|
||||
<div class="my-code">点击查看设备详情</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length < 1"
|
||||
@click="deleteRows(crud.selections)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{'text-align':'center'}"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column prop="device_code" label="设备编码"/>
|
||||
<el-table-column prop="device_name" label="设备名称" :min-width="180" show-overflow-tooltip/>
|
||||
<el-table-column prop="workprocedure_name" label="所属工序" :min-width="180" show-overflow-tooltip/>
|
||||
<template v-for="(item, index) in tableLabel">
|
||||
<el-table-column
|
||||
v-if="item.show"
|
||||
:key="index"
|
||||
:show-overflow-tooltip="true"
|
||||
:prop="item.prop"
|
||||
:width="item.width"
|
||||
:label="item.label"
|
||||
/>
|
||||
</template>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import crudPersoncorrdevice from '@/api/wms/mps/personcorrdevice'
|
||||
import CRUD, {header, presenter, form} from '@crud/crud'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
|
||||
const defaultForm = {
|
||||
user_id: null,
|
||||
user_name: null,
|
||||
team_person_device_id: null,
|
||||
jockey_id: null,
|
||||
device_id: null
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'DevicesDialog',
|
||||
components: {pagination, crudOperation},
|
||||
cruds() {
|
||||
return [
|
||||
CRUD({
|
||||
title: '设备详情',
|
||||
url: 'api/personcorrdevice/getDeviceByPerson',
|
||||
idField: 'team_person_device_id',
|
||||
query: {user_id: '', user_name: ''},
|
||||
sort: ['update_time,asc'],
|
||||
crudMethod: {...crudPersoncorrdevice},
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
reset: false
|
||||
},
|
||||
queryOnPresenterCreated: false
|
||||
})
|
||||
]
|
||||
},
|
||||
mixins: [presenter(), header(), form(function() {
|
||||
return Object.assign({ person: { user_id: this.query.user_id }}, defaultForm)
|
||||
})],
|
||||
data() {
|
||||
return {
|
||||
materType: '',
|
||||
openParam: {},
|
||||
tableLabel: [],
|
||||
permission: {},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.getHeader()
|
||||
return true
|
||||
},
|
||||
deleteRows(data) {
|
||||
this.$confirm('此操作将删除"' + data.length + '"条信息, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudPersoncorrdevice.deleteRow({ user_id: this.query.user_id, rows: data }).then(res => {
|
||||
this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
})
|
||||
})
|
||||
},
|
||||
getHeader(workprocedure_id) {
|
||||
crudPersoncorrdevice.getHeader({user_id: this.query.user_id}).then(res => {
|
||||
this.tableLabel = res.newArray
|
||||
})
|
||||
},
|
||||
tableChanged3(row) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
canUd(row) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -18,15 +18,6 @@
|
||||
style="width: 220px;"
|
||||
class="filter-item"
|
||||
/>
|
||||
<label class="el-form-item-label">所属工序</label>
|
||||
<el-select v-model="query.workprocedure_id" filterable clearable size="small" placeholder="所属工序" class="filter-item" style="width: 220px" @change="changeHeader(query.search, query.workprocedure_id)">
|
||||
<el-option
|
||||
v-for="item in workList"
|
||||
:key="item.workprocedure_id"
|
||||
:label="item.workprocedure_name"
|
||||
:value="item.workprocedure_id"
|
||||
/>
|
||||
</el-select>
|
||||
<rrOperation :crud="crud" />
|
||||
|
||||
<!--表格渲染-->
|
||||
@@ -40,25 +31,20 @@
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="clickChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="选择" width="55">
|
||||
<template slot-scope="scope">
|
||||
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="device_code" label="设备编码" />
|
||||
<el-table-column prop="device_name" label="设备名称" />
|
||||
<template v-for="(item, index) in tableLabel">
|
||||
<el-table-column
|
||||
v-if="item.show"
|
||||
:key="index"
|
||||
:show-overflow-tooltip="true"
|
||||
:prop="item.prop"
|
||||
:width="item.width"
|
||||
:label="item.label"
|
||||
/>
|
||||
</template>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="closeDia">取 消</el-button>
|
||||
<el-button @click="close">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
@@ -70,34 +56,25 @@ import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudTeamcorrperson from '@/api/wms/mps/teamcorrperson'
|
||||
import crudPersoncorrdevice from '@/api/wms/mps/personcorrdevice'
|
||||
import crudDevice from '@/api/wms/pdm/device'
|
||||
|
||||
export default {
|
||||
name: 'SelectDeviceDialog',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '设备选择', url: 'api/device', crudMethod: { ...crudTeamcorrperson }, optShow: {}})
|
||||
return CRUD({ title: '设备选择', url: 'api/device', crudMethod: { ...crudDevice }, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
materOptCode: {
|
||||
type: String,
|
||||
default: '00'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
user_id: '',
|
||||
tableData: [],
|
||||
workList: [],
|
||||
tableLabel: []
|
||||
tableRadio: null,
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -109,72 +86,32 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
this.getWorkprocedure()
|
||||
this.getDeviceIdByUserId(this.user_id)
|
||||
},
|
||||
setForm(user_id) {
|
||||
this.user_id = user_id
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.afterRefresh]() {
|
||||
const that = this
|
||||
that.$nextTick(() => {
|
||||
that.crud.data.forEach(row => {
|
||||
this.tableData.forEach(person => {
|
||||
if (Number(row.device_id) === Number(person.device_id)) {
|
||||
that.$refs.table.toggleRowSelection(row, true)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
return true
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
closeDia() {
|
||||
this.crud.resetQuery(true)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
if (this.crud.selections.length <= 0) {
|
||||
if (this.tableRadio === null) {
|
||||
this.$message('至少选择一条设备信息')
|
||||
return
|
||||
}
|
||||
console.log(this.crud.selections)
|
||||
crudPersoncorrdevice.addDevices({ user_id: this.user_id, devices: this.crud.selections }).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
// 隐藏弹出框
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.crud.toQuery()
|
||||
// 向父组件传值
|
||||
this.$emit('tableChanged3', this.tableRadio)
|
||||
})
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged3', this.tableRadio)
|
||||
},
|
||||
changeHeader(search, workprocedure_id) {
|
||||
this.getHeader(search,workprocedure_id)
|
||||
this.crud.toQuery()
|
||||
clickChange(item) {
|
||||
this.tableRadio = item
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.getHeader(this.query.search, this.query.workprocedure_id)
|
||||
return true
|
||||
},
|
||||
getWorkprocedure() {
|
||||
crudDevice.getWorkprocedure().then(res => {
|
||||
this.workList = res
|
||||
})
|
||||
},
|
||||
getHeader(search, workprocedure_id) {
|
||||
crudDevice.getItemByDeviceId({ search: search, workprocedure_id: workprocedure_id }).then(res => {
|
||||
this.tableLabel = res.newArray
|
||||
})
|
||||
},
|
||||
getDeviceIdByUserId(user_id) {
|
||||
crudPersoncorrdevice.getDeviceIdByUserId({ user_id: user_id }).then(res => {
|
||||
this.tableData = res
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,153 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="人员选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="模糊搜索">
|
||||
<el-input
|
||||
v-model="query.blurry"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="名称或邮箱"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
border
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="username" label="用户名" />
|
||||
<el-table-column prop="nickName" label="昵称" />
|
||||
<el-table-column prop="gender" label="性别" />
|
||||
<el-table-column prop="phone" label="手机号码"/>
|
||||
<el-table-column prop="email" label="邮箱" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="closeDia">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudTeamcorrperson from '@/api/wms/mps/teamcorrperson'
|
||||
import crudPersoncorrdevice from '@/api/wms/mps/personcorrdevice'
|
||||
|
||||
export default {
|
||||
name: 'SelectPeersonDialog',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '人员信息', url: 'api/users', crudMethod: { ...crudTeamcorrperson }, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
materOptCode: {
|
||||
type: String,
|
||||
default: '00'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
user_id: '',
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
},
|
||||
setForm(user_id) {
|
||||
this.user_id = user_id
|
||||
},
|
||||
setData(data) {
|
||||
this.tableData = data
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.afterRefresh]() {
|
||||
console.log(this.tableData)
|
||||
const that = this
|
||||
that.$nextTick(() => {
|
||||
that.crud.data.forEach(row => {
|
||||
this.tableData.forEach(person => {
|
||||
if (row.id === Number(person.jockey_id)) {
|
||||
that.$refs.table.toggleRowSelection(row, true)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
return true
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
closeDia() {
|
||||
this.crud.resetQuery(true)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
if (this.crud.selections.length <= 0) {
|
||||
this.$message('至少选择一条人员信息')
|
||||
return
|
||||
}
|
||||
console.log(this.crud.selections)
|
||||
crudPersoncorrdevice.addPersons({ persons: this.crud.selections }).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
// 隐藏弹出框
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.crud.toQuery()
|
||||
// 向父组件传值
|
||||
this.$emit('tableChanged3', this.tableRadio)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
152
mes/qd/src/views/wms/mps/personcorrdevice/dictDetail.vue
Normal file
152
mes/qd/src/views/wms/mps/personcorrdevice/dictDetail.vue
Normal file
@@ -0,0 +1,152 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="query.user_id === ''">
|
||||
<div class="my-code">点击查看设备详情</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input
|
||||
v-model="query.label"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="输入字典标签查询"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="toQuery"
|
||||
/>
|
||||
<rrOperation />
|
||||
</div>
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="500px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="设备编码" prop="device_code">
|
||||
<template scope="scope">
|
||||
<el-input v-model="form.device_code" disabled style="width: 250px;" clearable >
|
||||
<el-button slot="append" icon="el-icon-plus" @click="queryDevice(scope.$index, scope.row)" />
|
||||
</el-input>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column label="所属人员" min-width="100" show-overflow-tooltip>
|
||||
{{ query.person_name }}
|
||||
</el-table-column>
|
||||
<el-table-column prop="device_code" label="设备编码" align="center" width="120" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
v-permission="['admin','dict:edit','dict:del']"
|
||||
label="操作"
|
||||
align="center"
|
||||
width="115px"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<SelectDeviceDialog ref="selectDeviceDialog" :dialog-show.sync="deviceShow" @tableChanged3="tableChanged3" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudPersoncorrdevice from '@/api/wms/mps/personcorrdevice'
|
||||
import CRUD, { form, header, presenter } from '@crud/crud'
|
||||
import pagination from '@crud/Pagination'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import SelectDeviceDialog from './SelectDeviceDialog'
|
||||
|
||||
const defaultForm = {
|
||||
device_code: null
|
||||
}
|
||||
|
||||
export default {
|
||||
components: { pagination, rrOperation, udOperation, SelectDeviceDialog },
|
||||
cruds() {
|
||||
return [
|
||||
CRUD({
|
||||
title: '设备详情',
|
||||
url: 'api/personcorrdevice/device',
|
||||
query: { code: '' },
|
||||
idField: 'person_id',
|
||||
sort: ['person_id,asc', 'person_id,desc'],
|
||||
crudMethod: { ...crudPersoncorrdevice },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
del: true,
|
||||
reset: false
|
||||
},
|
||||
queryOnPresenterCreated: false
|
||||
})
|
||||
]
|
||||
},
|
||||
mixins: [
|
||||
presenter(),
|
||||
header(),
|
||||
form(function() {
|
||||
return Object.assign({}, defaultForm)
|
||||
})],
|
||||
data() {
|
||||
return {
|
||||
dictId: null,
|
||||
deviceShow: false,
|
||||
rules: {
|
||||
device_code: [
|
||||
{ required: true, message: '请输入设备号', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
permission: {
|
||||
add: ['admin', 'dict:add'],
|
||||
edit: ['admin', 'dict:edit'],
|
||||
del: ['admin', 'dict:del']
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
queryDevice() {
|
||||
this.deviceShow = true
|
||||
},
|
||||
tableChanged3(row) {
|
||||
this.form.device_code = row.device_code
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-input-number .el-input__inner {
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
@@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 班组列表-->
|
||||
<!-- 字典列表 -->
|
||||
<el-row :gutter="10">
|
||||
<el-col :xs="24" :sm="24" :md="13" :lg="13" :xl="13" style="margin-bottom: 10px">
|
||||
<el-col :xs="13" :sm="13" :md="13" :lg="13" :xl="13" style="margin-bottom: 10px">
|
||||
<el-card class="box-card">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.search" clearable size="small" placeholder="输入人员名称或者电话" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<el-input v-model="query.username" clearable size="mini" placeholder="输入人员名称" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<rrOperation />
|
||||
</div>
|
||||
<crudOperation :permission="permission" />
|
||||
@@ -18,118 +18,119 @@
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
@current-change="handleCurrentChange">
|
||||
<el-table-column prop="username" label="用户名" />
|
||||
<el-table-column prop="nick_name" label="昵称" />
|
||||
<el-table-column prop="person_name" label="名称" />
|
||||
<el-table-column prop="gender" label="性别" />
|
||||
<el-table-column prop="phone" label="手机号码" width="110" />
|
||||
<el-table-column prop="email" label="邮箱" width="140" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addDevice(scope.row)">添加设备</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</el-card>
|
||||
</el-col>
|
||||
<!-- 物料详情列表 -->
|
||||
<el-col :xs="24" :sm="24" :md="11" :lg="11" :xl="11">
|
||||
<!-- 字典详情列表 -->
|
||||
<el-col :xs="11" :sm="11" :md="11" :lg="11" :xl="11">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>设备详情</span>
|
||||
<el-button
|
||||
v-if="this.rowDtl !== null"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
style="float: right;padding: 4px 10px"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="$refs.dictDetail && $refs.dictDetail.crud.toAdd()"
|
||||
>新增</el-button>
|
||||
</div>
|
||||
<DevicesDialog ref="devicesDialog" :permission="permission" />
|
||||
<dictDetail ref="dictDetail" :permission="permission" />
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<SelectPeersonDialog ref="selectPeersonDialog" :dialog-show.sync="selectPeersonDialog" @tableChanged3="tableChanged3" />
|
||||
<SelectDeviceDialog ref="selectDeviceDialog" :dialog-show.sync="selectDeviceDialog" @tableChanged3="tableChanged3" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import dictDetail from './dictDetail.vue'
|
||||
import crudPersoncorrdevice from '@/api/wms/mps/personcorrdevice'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
|
||||
import CRUD, { presenter, header, form } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DevicesDialog from './DevicesDialog'
|
||||
import SelectPeersonDialog from './SelectPeersonDialog'
|
||||
import SelectDeviceDialog from './SelectDeviceDialog'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
|
||||
const defaultForm = {}
|
||||
|
||||
const defaultForm = { team_person_device_id: null, jockey_id: null, device_id: null, user_id: null, user_name: null }
|
||||
export default {
|
||||
name: 'Personcorrdevice',
|
||||
components: { pagination, crudOperation, rrOperation, DevicesDialog, SelectPeersonDialog, SelectDeviceDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
name: 'Dict',
|
||||
components: { crudOperation, pagination, rrOperation, udOperation, dictDetail },
|
||||
cruds() {
|
||||
return CRUD({ title: '人员设备维护', url: 'api/personcorrdevice', idField: 'jockey_id', sort: 'team_id,desc',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: true,
|
||||
download: false,
|
||||
reset: true
|
||||
},
|
||||
crudMethod: { ...crudPersoncorrdevice }})
|
||||
return [
|
||||
CRUD({
|
||||
title: '人员对应设备',
|
||||
url: 'api/personcorrdevice',
|
||||
idField: 'jockey_id',
|
||||
crudMethod: { ...crudPersoncorrdevice },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
]
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm)],
|
||||
data() {
|
||||
return {
|
||||
selectPeersonDialog: false,
|
||||
selectDeviceDialog: false,
|
||||
permission: {},
|
||||
rowDtl: null,
|
||||
queryTypeOptions: [
|
||||
{ key: 'name', display_name: '字典名称' },
|
||||
{ key: 'description', display_name: '描述' }
|
||||
],
|
||||
rules: {
|
||||
code: [
|
||||
{ required: true, message: '请输入编码', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
permission: {
|
||||
add: ['admin', 'dict:add'],
|
||||
edit: ['admin', 'dict:edit'],
|
||||
del: ['admin', 'dict:del']
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
addDevice(row) {
|
||||
this.$refs.selectDeviceDialog.setForm(row.user_id)
|
||||
this.selectDeviceDialog = true
|
||||
this.$refs.selectDeviceDialog.crud.toQuery()
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
checkPermission,
|
||||
// 获取数据前设置好接口地址
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
if (this.$refs.devicesDialog) {
|
||||
this.$refs.devicesDialog.query.user_name = ''
|
||||
if (this.$refs.dictDetail) {
|
||||
this.$refs.dictDetail.query.user_id = ''
|
||||
this.rowDtl = null
|
||||
this.$refs.dictDetail.crud.toQuery()
|
||||
}
|
||||
return true
|
||||
},
|
||||
/** 新建 - 之前 */
|
||||
[CRUD.HOOK.beforeToAdd]() {
|
||||
this.$refs.selectPeersonDialog.setData(this.crud.data)
|
||||
this.selectPeersonDialog = true
|
||||
this.$refs.selectPeersonDialog.crud.toQuery()
|
||||
// return true
|
||||
},
|
||||
// 选中字典后,设置字典详情数据
|
||||
handleCurrentChange(val) {
|
||||
if (val) {
|
||||
this.$refs.devicesDialog.query.user_name = val.username
|
||||
this.$refs.devicesDialog.query.user_id = val.user_id
|
||||
this.$refs.devicesDialog.crud.toQuery()
|
||||
this.rowDtl = val
|
||||
this.$refs.dictDetail.query.user_id = val.user_id
|
||||
this.$refs.dictDetail.query.person_name = val.person_name
|
||||
this.$refs.dictDetail.form.user_id = val.user_id
|
||||
this.$refs.dictDetail.crud.toQuery()
|
||||
}
|
||||
},
|
||||
tableChanged3(row) {
|
||||
this.crud.toQuery()
|
||||
this.$refs.devicesDialog.crud.toQuery()
|
||||
},
|
||||
canUd(row) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="query.team_name === ''">
|
||||
<div class="my-code">点击查看人员详情</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
highlight-current-row
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{'text-align':'center'}"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" label="所属班组id">
|
||||
{{ query.team_id }}
|
||||
</el-table-column>
|
||||
<el-table-column label="所属班组">
|
||||
{{ query.team_name }}
|
||||
</el-table-column>
|
||||
<el-table-column prop="username" label="用户名" />
|
||||
<el-table-column prop="nick_name" label="昵称" />
|
||||
<el-table-column prop="gender" label="性别" />
|
||||
<el-table-column prop="phone" label="手机号码" width="110" />
|
||||
<el-table-column prop="email" label="邮箱" width="140" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter, form } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudTeamcorrperson from '@/api/wms/mps/teamcorrperson'
|
||||
// import crudStructrelamaterial from '@/api/wms/st/basedata/structrelamaterial'
|
||||
|
||||
const defaultForm = {
|
||||
material_id: null,
|
||||
material_name: null,
|
||||
team_id: null,
|
||||
team_code: null,
|
||||
team_name: null
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'PersonDialog',
|
||||
components: { pagination, crudOperation },
|
||||
cruds() {
|
||||
return [
|
||||
CRUD({
|
||||
title: '人员详情',
|
||||
url: 'api/teamcorrperson',
|
||||
idField: 'team_person_id',
|
||||
query: { team_id: '', team_name: '' },
|
||||
sort: ['update_time,asc'],
|
||||
crudMethod: { ...crudTeamcorrperson },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: true,
|
||||
reset: false
|
||||
},
|
||||
queryOnPresenterCreated: false
|
||||
})
|
||||
]
|
||||
},
|
||||
mixins: [presenter(), header(), form(function() {
|
||||
return Object.assign({ team: { team_id: this.query.team_id }}, defaultForm)
|
||||
})],
|
||||
data() {
|
||||
return {
|
||||
materType: '',
|
||||
openParam: {},
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
material_name: [
|
||||
{ required: true, message: '不能为空', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
[CRUD.HOOK.beforeDelete](row) {
|
||||
return true
|
||||
},
|
||||
tableChanged3(row) {
|
||||
this.crud.toQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
128
mes/qd/src/views/wms/mps/teamcorrperson/SelectDeviceDialog.vue
Normal file
128
mes/qd/src/views/wms/mps/teamcorrperson/SelectDeviceDialog.vue
Normal file
@@ -0,0 +1,128 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="设备选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label">模糊搜索</label>
|
||||
<el-input
|
||||
v-model="query.blurry"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="输入账号或者名称"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<rrOperation :crud="crud" />
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;margin-top: 15px"
|
||||
size="mini"
|
||||
border
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="clickChange"
|
||||
>
|
||||
<el-table-column label="选择" width="55">
|
||||
<template slot-scope="scope">
|
||||
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="person_name" label="人员名称" />
|
||||
<el-table-column prop="username" label="账号编码" />
|
||||
<el-table-column prop="gender" label="性别" />
|
||||
<el-table-column prop="phone" label="电话" />
|
||||
<el-table-column prop="email" label="邮箱" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="close">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudUser from '@/views/system/user/user'
|
||||
|
||||
export default {
|
||||
name: 'SelectDeviceDialog',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '人员选择', url: 'api/users', crudMethod: { ...crudUser }, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableRadio: null,
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
},
|
||||
setForm(user_id) {
|
||||
this.user_id = user_id
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.afterRefresh]() {
|
||||
return true
|
||||
},
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
if (this.tableRadio === null) {
|
||||
this.$message('至少选择一条设备信息')
|
||||
return
|
||||
}
|
||||
console.log(this.crud.selections)
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged3', this.tableRadio)
|
||||
},
|
||||
clickChange(item) {
|
||||
this.tableRadio = item
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="人员选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="模糊搜索">
|
||||
<el-input
|
||||
v-model="query.blurry"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="名称或邮箱"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
border
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="username" label="用户名" />
|
||||
<el-table-column prop="nickName" label="昵称" />
|
||||
<el-table-column prop="gender" label="性别" />
|
||||
<el-table-column prop="phone" label="手机号码" width="110" />
|
||||
<el-table-column prop="email" label="邮箱" width="140" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="closeDia">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudTeamcorrperson from '@/api/wms/mps/teamcorrperson'
|
||||
|
||||
export default {
|
||||
name: 'SelectPeersonDialog',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '人员信息', url: 'api/users', crudMethod: { ...crudTeamcorrperson }, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
materOptCode: {
|
||||
type: String,
|
||||
default: '00'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
team_id: '',
|
||||
personIds: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudTeamcorrperson.getPersonIdByTeamId({ team_id: this.team_id }).then(res => {
|
||||
this.personIds = res
|
||||
})
|
||||
},
|
||||
setForm(team_id) {
|
||||
this.team_id = team_id
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.afterRefresh]() {
|
||||
const that = this
|
||||
that.$nextTick(() => {
|
||||
that.crud.data.forEach(row => {
|
||||
this.personIds.forEach(person => {
|
||||
if (row.id === Number(person.jockey_id)) {
|
||||
that.$refs.table.toggleRowSelection(row, true)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
return true
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
closeDia() {
|
||||
this.crud.resetQuery(true)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
if (this.crud.selections.length <= 0) {
|
||||
this.$message('至少选择一条人员信息')
|
||||
return
|
||||
}
|
||||
console.log(this.crud.selections)
|
||||
crudTeamcorrperson.addPersons({ team_id: this.team_id, persons: this.crud.selections }).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
// 隐藏弹出框
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.crud.toQuery()
|
||||
// 向父组件传值
|
||||
this.$emit('tableChanged3', this.tableRadio)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
157
mes/qd/src/views/wms/mps/teamcorrperson/dictDetail.vue
Normal file
157
mes/qd/src/views/wms/mps/teamcorrperson/dictDetail.vue
Normal file
@@ -0,0 +1,157 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="query.team_id === ''">
|
||||
<div class="my-code">点击查看设备详情</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input
|
||||
v-model="query.label"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="输入字典标签查询"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="toQuery"
|
||||
/>
|
||||
<rrOperation />
|
||||
</div>
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="500px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="人员编码" prop="user_name">
|
||||
<template scope="scope">
|
||||
<el-input v-model="form.user_name" disabled style="width: 250px;" clearable >
|
||||
<el-button slot="append" icon="el-icon-plus" @click="queryDevice(scope.$index, scope.row)" />
|
||||
</el-input>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column label="所属班组" min-width="100" show-overflow-tooltip>
|
||||
{{ query.team_name }}
|
||||
</el-table-column>
|
||||
<el-table-column prop="username" label="人员编码" align="center" width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="person_name" label="人员名称" align="center" width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="phone" label="电话" align="center" width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="email" label="邮箱" align="center" width="120" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
v-permission="['admin','dict:edit','dict:del']"
|
||||
label="操作"
|
||||
align="center"
|
||||
width="115px"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<SelectDeviceDialog ref="selectDeviceDialog" :dialog-show.sync="userShow" @tableChanged3="tableChanged3" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudTeamcorrperson from '@/views/wms/mps/teamcorrperson/teamcorrperson'
|
||||
import CRUD, { form, header, presenter } from '@crud/crud'
|
||||
import pagination from '@crud/Pagination'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import SelectDeviceDialog from './SelectDeviceDialog'
|
||||
|
||||
const defaultForm = {
|
||||
user_id: null,
|
||||
user_name: null
|
||||
}
|
||||
|
||||
export default {
|
||||
components: { pagination, rrOperation, udOperation, SelectDeviceDialog },
|
||||
cruds() {
|
||||
return [
|
||||
CRUD({
|
||||
title: '人员详情',
|
||||
url: 'api/pdmBiTeamcorrperson/queryUser',
|
||||
query: { code: '' },
|
||||
idField: 'team_person_id',
|
||||
sort: ['team_person_id,asc', 'team_person_id,desc'],
|
||||
crudMethod: { ...crudTeamcorrperson },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
del: true,
|
||||
reset: false
|
||||
},
|
||||
queryOnPresenterCreated: false
|
||||
})
|
||||
]
|
||||
},
|
||||
mixins: [
|
||||
presenter(),
|
||||
header(),
|
||||
form(function() {
|
||||
return Object.assign({}, defaultForm)
|
||||
})],
|
||||
data() {
|
||||
return {
|
||||
dictId: null,
|
||||
userShow: false,
|
||||
rules: {
|
||||
user_name: [
|
||||
{ required: true, message: '请选择人员', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
permission: {
|
||||
add: ['admin', 'dict:add'],
|
||||
edit: ['admin', 'dict:edit'],
|
||||
del: ['admin', 'dict:del']
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
queryDevice() {
|
||||
this.userShow = true
|
||||
},
|
||||
tableChanged3(row) {
|
||||
this.form.user_name = row.person_name
|
||||
this.form.user_id = row.user_id
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-input-number .el-input__inner {
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
@@ -1,208 +1,133 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 班组列表-->
|
||||
<!-- 字典列表 -->
|
||||
<el-row :gutter="10">
|
||||
<el-col :xs="24" :sm="24" :md="13" :lg="13" :xl="13" style="margin-bottom: 10px">
|
||||
<el-col :xs="13" :sm="13" :md="13" :lg="13" :xl="13" style="margin-bottom: 10px">
|
||||
<el-card class="box-card">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.search" clearable size="small" placeholder="输入编码或者名称" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<el-input v-model="query.team_code" clearable size="mini" placeholder="输班组编码名称" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<rrOperation />
|
||||
</div>
|
||||
<crudOperation :permission="permission" />
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="班组编码" prop="team_code">
|
||||
<el-input v-model="form.team_code" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="班组名称" prop="team_name">
|
||||
<el-input v-model="form.team_name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="所属班制">
|
||||
<el-select v-model="form.classsystem_id" filterable clearable class="filter-item" style="width: 370px">
|
||||
<el-option
|
||||
v-for="item in classList"
|
||||
:key="item.classsystem_id"
|
||||
:label="item.classsystem_name"
|
||||
:value="item.classsystem_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" :rows="3" type="textarea" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
@current-change="handleCurrentChange">
|
||||
<el-table-column prop="team_code" label="班组编码" />
|
||||
<el-table-column prop="team_name" label="班组名称" />
|
||||
<el-table-column prop="is_active" label="是否启用">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
:value="format_is_active(scope.row.is_active)"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
@change="changeEnabled(scope.row, scope.row.is_active)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_name" label="创建人姓名" />
|
||||
<el-table-column prop="create_time" label="创建时间" width="150" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addPerson(scope.row)">添加人员</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</el-card>
|
||||
</el-col>
|
||||
<!-- 物料详情列表 -->
|
||||
<el-col :xs="24" :sm="24" :md="11" :lg="11" :xl="11">
|
||||
<!-- 字典详情列表 -->
|
||||
<el-col :xs="11" :sm="11" :md="11" :lg="11" :xl="11">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>人员详情</span>
|
||||
<span>班组详情</span>
|
||||
<el-button
|
||||
v-if="this.rowDtl !== null"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
style="float: right;padding: 4px 10px"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="$refs.dictDetail && $refs.dictDetail.crud.toAdd()"
|
||||
>新增</el-button>
|
||||
</div>
|
||||
<PersonDialog ref="personDialog" :permission="permission" />
|
||||
<dictDetail ref="dictDetail" :permission="permission" />
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<SelectPeersonDialog ref="selectPeersonDialog" :dialog-show.sync="selectPeersonDialog" @tableChanged3="tableChanged3" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudTeamcorrperson from '@/api/wms/mps/teamcorrperson'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import checkPermission from '@/utils/permission'
|
||||
import dictDetail from './dictDetail.vue'
|
||||
import crudTeamcorrperson from '@/views/wms/mps/teamcorrperson/teamcorrperson'
|
||||
|
||||
import CRUD, { presenter, header, form } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudWorkteam from "@/api/wms/mps/workteam"
|
||||
import PersonDialog from './PersonDialog'
|
||||
import SelectPeersonDialog from './SelectPeersonDialog'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
|
||||
const defaultForm = {}
|
||||
|
||||
const defaultForm = { team_id: null, team_code: null, team_name: null, classsystem_id: null, remark: null, is_active: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, sysdeptid: null, syscompanyid: null, is_delete: null }
|
||||
export default {
|
||||
name: 'Teamcorrperson',
|
||||
components: { pagination, crudOperation, rrOperation, PersonDialog, SelectPeersonDialog },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
name: 'Dict',
|
||||
components: { crudOperation, pagination, rrOperation, udOperation, dictDetail },
|
||||
cruds() {
|
||||
return CRUD({ title: '班组', url: 'api/workteam', idField: 'team_id', sort: 'team_id,desc',
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
del: true,
|
||||
download: false,
|
||||
reset: true
|
||||
},
|
||||
crudMethod: { ...crudWorkteam }})
|
||||
return [
|
||||
CRUD({
|
||||
title: '班组对应人员',
|
||||
url: 'api/pdmBiTeamcorrperson',
|
||||
idField: 'team_id',
|
||||
crudMethod: { ...crudTeamcorrperson },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
]
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm)],
|
||||
data() {
|
||||
return {
|
||||
selectPeersonDialog: false,
|
||||
permission: {},
|
||||
classList: [],
|
||||
personIds: [],
|
||||
rowDtl: null,
|
||||
queryTypeOptions: [
|
||||
{ key: 'name', display_name: '字典名称' },
|
||||
{ key: 'description', display_name: '描述' }
|
||||
],
|
||||
rules: {
|
||||
team_code: [
|
||||
{ required: true, message: '班组编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
team_name: [
|
||||
{ required: true, message: '班组名称不能为空', trigger: 'blur' }
|
||||
code: [
|
||||
{ required: true, message: '请选择人员', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
permission: {
|
||||
add: ['admin', 'dict:add'],
|
||||
edit: ['admin', 'dict:edit'],
|
||||
del: ['admin', 'dict:del']
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getClasssystem()
|
||||
},
|
||||
methods: {
|
||||
addPerson(row) {
|
||||
this.$refs.selectPeersonDialog.setForm(row.team_id)
|
||||
this.selectPeersonDialog = true
|
||||
this.$refs.selectPeersonDialog.crud.toQuery()
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
checkPermission,
|
||||
// 获取数据前设置好接口地址
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
if (this.$refs.personDialog) {
|
||||
this.$refs.personDialog.query.team_name = ''
|
||||
if (this.$refs.dictDetail) {
|
||||
this.$refs.dictDetail.query.team_id = ''
|
||||
this.rowDtl = null
|
||||
this.$refs.dictDetail.crud.toQuery()
|
||||
}
|
||||
return true
|
||||
},
|
||||
/** 新建 - 之前 */
|
||||
[CRUD.HOOK.beforeToAdd]() {
|
||||
// return true
|
||||
},
|
||||
// 选中字典后,设置字典详情数据
|
||||
handleCurrentChange(val) {
|
||||
if (val) {
|
||||
this.$refs.personDialog.query.team_name = val.team_name
|
||||
this.$refs.personDialog.query.team_id = val.team_id
|
||||
this.$refs.personDialog.crud.toQuery()
|
||||
this.rowDtl = val
|
||||
this.$refs.dictDetail.query.team_id = val.team_id
|
||||
this.$refs.dictDetail.query.team_name = val.team_name
|
||||
this.$refs.dictDetail.form.team_id = val.team_id
|
||||
this.$refs.dictDetail.crud.toQuery()
|
||||
}
|
||||
},
|
||||
tableChanged3(row) {
|
||||
this.crud.toQuery()
|
||||
this.$refs.personDialog.crud.toQuery()
|
||||
},
|
||||
canUd(row) {
|
||||
return true
|
||||
},
|
||||
// 改变状态
|
||||
format_is_active(is_active) {
|
||||
return is_active === '1'
|
||||
},
|
||||
changeEnabled(data, val) {
|
||||
let msg = '此操作将停用,是否继续!'
|
||||
if (val !== '1') {
|
||||
msg = '此操作将启用,是否继续!'
|
||||
}
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudWorkteam.changeActive(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
data.is_active = !data.is_active
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
getClasssystem() {
|
||||
crudWorkteam.getClasssystem().then(res => {
|
||||
this.classList = res
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
27
mes/qd/src/views/wms/mps/teamcorrperson/teamcorrperson.js
Normal file
27
mes/qd/src/views/wms/mps/teamcorrperson/teamcorrperson.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/pdmBiTeamcorrperson',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/pdmBiTeamcorrperson/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/pdmBiTeamcorrperson',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
Reference in New Issue
Block a user