回收提交

master
XI_TENG\xixi_ 4 months ago
parent 3e1eeae101
commit e167fee757

@ -2,6 +2,16 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.mapper.RecycleDeviceMapper"> <mapper namespace="jnpf.mapper.RecycleDeviceMapper">
<select id="QueryRecycleDevice" resultType="jnpf.entity.RecycleDeviceEntity">
SELECT
a.id,
a.address,
a.device_name AS deviceName,
a.device_code AS deviceCode
FROM
nx_recycle_device a
${ew.customSqlSegment}
and
a.id not in (SELECT device_code from nx_recycle_staff_device where f_delete_mark is null)
</select>
</mapper> </mapper>

@ -0,0 +1,7 @@
<?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="jnpf.mapper.RecycleStaffDeviceMapper">
</mapper>

@ -1,8 +1,14 @@
package jnpf.mapper; package jnpf.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import jnpf.entity.RecycleDeviceEntity; import jnpf.entity.RecycleDeviceEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* *
@ -13,6 +19,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface RecycleDeviceMapper extends BaseMapper<RecycleDeviceEntity> { public interface RecycleDeviceMapper extends BaseMapper<RecycleDeviceEntity> {
List<RecycleDeviceEntity> QueryRecycleDevice(@Param("stationId") String stationId);
IPage<RecycleDeviceEntity> QueryRecycleDevice(@Param("page") Page<RecycleDeviceEntity> page, @Param("ew") QueryWrapper<RecycleDeviceEntity> queryWrapper);
} }

@ -0,0 +1,16 @@
package jnpf.mapper;
import jnpf.entity.RecycleStaffDeviceEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* recycleStationStaff
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-06-24
*/
public interface RecycleStaffDeviceMapper extends BaseMapper<RecycleStaffDeviceEntity> {
}

@ -32,4 +32,8 @@ public interface RecycleDeviceService extends IService<RecycleDeviceEntity> {
void saveOrUpdate(RecycleDeviceForm recycleDeviceForm,String id, boolean isSave) throws Exception; void saveOrUpdate(RecycleDeviceForm recycleDeviceForm,String id, boolean isSave) throws Exception;
//回收员关联设备查询
List<RecycleDeviceEntity> queryRecycleSaffDeviceList(RecycleDevicePagination recycleDevicePagination);
} }

@ -0,0 +1,18 @@
package jnpf.service;
import jnpf.model.recyclestationstaff.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* recycleStationStaff
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-06-24
*/
public interface RecycleStaffDeviceService extends IService<RecycleStaffDeviceEntity> {
QueryWrapper<RecycleStaffDeviceEntity> getChild(RecycleStationStaffPagination pagination,QueryWrapper<RecycleStaffDeviceEntity> recycleStaffDeviceQueryWrapper);
}

@ -30,9 +30,14 @@ public interface RecycleStationStaffService extends IService<RecycleStationStaff
boolean update(String id, RecycleStationStaffEntity entity); boolean update(String id, RecycleStationStaffEntity entity);
//子表方法 //子表方法
List<RecycleStaffDeviceEntity> getRecycleStaffDeviceList(String id,RecycleStationStaffPagination recycleStationStaffPagination);
List<RecycleStaffDeviceEntity> getRecycleStaffDeviceList(String id);
//副表数据方法 //副表数据方法
String checkForm(RecycleStationStaffForm form,int i); String checkForm(RecycleStationStaffForm form,int i);
void saveOrUpdate(RecycleStationStaffForm recycleStationStaffForm,String id, boolean isSave) throws Exception; void saveOrUpdate(RecycleStationStaffForm recycleStationStaffForm,String id, boolean isSave) throws Exception;
// 注册回收员 // 注册回收员

@ -1,7 +1,9 @@
package jnpf.service.impl; package jnpf.service.impl;
import com.alibaba.fastjson.JSON;
import jnpf.entity.*; import jnpf.entity.*;
import jnpf.mapper.RecycleDeviceMapper; import jnpf.mapper.RecycleDeviceMapper;
import jnpf.permission.entity.OrganizeEntity;
import jnpf.service.*; import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.recycledevice.*; import jnpf.model.recycledevice.*;
@ -18,6 +20,7 @@ import java.util.regex.Pattern;
import jnpf.model.QueryModel; import jnpf.model.QueryModel;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel; import jnpf.base.model.ColumnDataModel;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel; import jnpf.database.model.superQuery.SuperJsonModel;
@ -30,6 +33,9 @@ import jnpf.util.*;
import java.util.*; import java.util.*;
import jnpf.base.UserInfo; import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity; import jnpf.permission.entity.UserEntity;
import javax.annotation.Resource;
/** /**
* *
* *
@ -45,6 +51,8 @@ public class RecycleDeviceServiceImpl extends ServiceImpl<RecycleDeviceMapper, R
@Autowired @Autowired
private UserProvider userProvider; private UserProvider userProvider;
@Resource
private RecycleDeviceMapper recycleDeviceMapper;
@Override @Override
public List<RecycleDeviceEntity> getList(RecycleDevicePagination recycleDevicePagination){ public List<RecycleDeviceEntity> getList(RecycleDevicePagination recycleDevicePagination){
@ -366,4 +374,18 @@ public class RecycleDeviceServiceImpl extends ServiceImpl<RecycleDeviceMapper, R
this.saveOrUpdate(entity); this.saveOrUpdate(entity);
} }
@Override
public List<RecycleDeviceEntity> queryRecycleSaffDeviceList(RecycleDevicePagination recycleDevicePagination) {
// return recycleDeviceMapper.QueryRecycleDevice(stationId);
QueryWrapper<RecycleDeviceEntity> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("a.document_type",voucherPagination.getDocumentType());
queryWrapper.notIn(ObjectUtils.isNotEmpty(recycleDevicePagination.getExcludeIdList()),"a.id",recycleDevicePagination.getExcludeIdList());
queryWrapper.eq("a.be_long_station_id",recycleDevicePagination.getStationId());
Page<RecycleDeviceEntity> page=new Page<>(recycleDevicePagination.getCurrentPage(), recycleDevicePagination.getPageSize());
IPage<RecycleDeviceEntity> voucherEntityIPage = recycleDeviceMapper.QueryRecycleDevice(page,queryWrapper);
return recycleDevicePagination.setData(voucherEntityIPage.getRecords(),voucherEntityIPage.getTotal());
}
} }

@ -0,0 +1,59 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.RecycleStaffDeviceMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.recyclestationstaff.*;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.util.GeneraterSwapUtil;
import jnpf.database.model.superQuery.SuperQueryJsonModel;
import jnpf.database.model.superQuery.ConditionJsonModel;
import jnpf.database.model.superQuery.SuperQueryConditionModel;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity;
/**
*
* recycleStationStaff
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-06-24
*/
@Service
public class RecycleStaffDeviceServiceImpl extends ServiceImpl<RecycleStaffDeviceMapper, RecycleStaffDeviceEntity> implements RecycleStaffDeviceService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
//子表过滤方法
@Override
public QueryWrapper<RecycleStaffDeviceEntity> getChild(RecycleStationStaffPagination pagination, QueryWrapper<RecycleStaffDeviceEntity> recycleStaffDeviceQueryWrapper){
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String ruleQueryJson = isPc?RecycleStationStaffConstant.getColumnData():RecycleStationStaffConstant.getAppColumnData();
ColumnDataModel dataModel = JsonUtil.getJsonToBean(ruleQueryJson,ColumnDataModel.class);
String ruleJson = isPc?JsonUtil.getObjectToString(dataModel.getRuleList()):JsonUtil.getObjectToString(dataModel.getRuleListApp());
if(isPc){
}
return recycleStaffDeviceQueryWrapper;
}
}

@ -58,6 +58,8 @@ public class RecycleStationStaffServiceImpl extends ServiceImpl<RecycleStationSt
@Resource @Resource
private UserBindService userBindService; private UserBindService userBindService;
@Autowired
private RecycleStaffDeviceService recycleStaffDeviceService;
@Override @Override
public List<RecycleStationStaffEntity> getList(RecycleStationStaffPagination recycleStationStaffPagination){ public List<RecycleStationStaffEntity> getList(RecycleStationStaffPagination recycleStationStaffPagination){
@ -77,6 +79,9 @@ public class RecycleStationStaffServiceImpl extends ServiceImpl<RecycleStationSt
int total=0; int total=0;
int recycleStationStaffNum =0; int recycleStationStaffNum =0;
QueryWrapper<RecycleStationStaffEntity> recycleStationStaffQueryWrapper=new QueryWrapper<>(); QueryWrapper<RecycleStationStaffEntity> recycleStationStaffQueryWrapper=new QueryWrapper<>();
int recycleStaffDeviceNum =0;
QueryWrapper<RecycleStaffDeviceEntity> recycleStaffDeviceQueryWrapper=new QueryWrapper<>();
long recycleStaffDevicecount = recycleStaffDeviceService.count();
List<String> allSuperIDlist = new ArrayList<>(); List<String> allSuperIDlist = new ArrayList<>();
String superOp =""; String superOp ="";
if (ObjectUtil.isNotEmpty(recycleStationStaffPagination.getSuperQueryJson())){ if (ObjectUtil.isNotEmpty(recycleStationStaffPagination.getSuperQueryJson())){
@ -94,6 +99,15 @@ public class RecycleStationStaffServiceImpl extends ServiceImpl<RecycleStationSt
intersectionSuperList.add(recycleStationStaffList); intersectionSuperList.add(recycleStationStaffList);
superNum++; superNum++;
} }
String recycleStaffDeviceTable = "nx_recycle_staff_device";
boolean recycleStaffDeviceHasSql = queryJson.contains(recycleStaffDeviceTable);
List<String> recycleStaffDeviceList = generaterSwapUtil.selectIdsByChildCondition(RecycleStationStaffConstant.getTableList(), recycleStaffDeviceTable , queryJson, null);
if (recycleStaffDeviceHasSql){
allSuperList.addAll(recycleStaffDeviceList);
intersectionSuperList.add(recycleStaffDeviceList);
superNum++;
}
superOp = superNum > 0 ? superJsonModel.getMatchLogic() : ""; superOp = superNum > 0 ? superJsonModel.getMatchLogic() : "";
//and or //and or
if(superOp.equalsIgnoreCase("and")){ if(superOp.equalsIgnoreCase("and")){
@ -118,6 +132,14 @@ public class RecycleStationStaffServiceImpl extends ServiceImpl<RecycleStationSt
intersectionRuleList.add(recycleStationStaffList); intersectionRuleList.add(recycleStationStaffList);
ruleNum++; ruleNum++;
} }
String recycleStaffDeviceTable = "nx_recycle_staff_device";
// boolean recycleStaffDeviceHasSql = ruleJson.contains(recycleStaffDeviceTable);
// List<String> recycleStaffDeviceList = generaterSwapUtil.selectIdsByChildCondition(RecycleStationStaffConstant.getTableList(), recycleStaffDeviceTable , ruleJson, null);
// if (recycleStaffDeviceHasSql){
// allRuleList.addAll(recycleStaffDeviceList);
// intersectionRuleList.add(recycleStaffDeviceList);
// ruleNum++;
// }
ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : ""; ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : "";
//and or //and or
if(ruleOp.equalsIgnoreCase("and")){ if(ruleOp.equalsIgnoreCase("and")){
@ -126,7 +148,9 @@ public class RecycleStationStaffServiceImpl extends ServiceImpl<RecycleStationSt
allRuleIDlist = allRuleList; allRuleIDlist = allRuleList;
} }
} }
boolean pcPermission = true;
boolean pcPermission = true;
boolean appPermission = false; boolean appPermission = false;
if(isPc && pcPermission){ if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){ if (!userProvider.get().getIsAdministrator()){
@ -139,6 +163,18 @@ public class RecycleStationStaffServiceImpl extends ServiceImpl<RecycleStationSt
recycleStationStaffNum++; recycleStationStaffNum++;
} }
} }
Object recycleStaffDeviceObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(recycleStaffDeviceQueryWrapper,RecycleStaffDeviceEntity.class,recycleStationStaffPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(recycleStaffDeviceObj)){
return new ArrayList<>();
} else {
recycleStaffDeviceQueryWrapper = (QueryWrapper<RecycleStaffDeviceEntity>)recycleStaffDeviceObj;
if( recycleStaffDeviceQueryWrapper.getExpression().getNormal().size()>0){
recycleStaffDeviceNum++;
}
}
} }
} }
if(!isPc && appPermission){ if(!isPc && appPermission){
@ -152,6 +188,15 @@ public class RecycleStationStaffServiceImpl extends ServiceImpl<RecycleStationSt
recycleStationStaffNum++; recycleStationStaffNum++;
} }
} }
Object recycleStaffDeviceObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(recycleStaffDeviceQueryWrapper,RecycleStaffDeviceEntity.class,recycleStationStaffPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(recycleStaffDeviceObj)){
return new ArrayList<>();
} else {
recycleStaffDeviceQueryWrapper = (QueryWrapper<RecycleStaffDeviceEntity>)recycleStaffDeviceObj;
if( recycleStaffDeviceQueryWrapper.getExpression().getNormal().size()>0){
recycleStaffDeviceNum++;
}
}
} }
@ -269,6 +314,7 @@ public class RecycleStationStaffServiceImpl extends ServiceImpl<RecycleStationSt
return this.getOne(queryWrapper); return this.getOne(queryWrapper);
} }
@Override @Override
public RecycleStationStaffEntity getInfoByOpenId(String openId){ public RecycleStationStaffEntity getInfoByOpenId(String openId){
QueryWrapper<RecycleStationStaffEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<RecycleStationStaffEntity> queryWrapper = new QueryWrapper<>();
@ -290,6 +336,28 @@ public class RecycleStationStaffServiceImpl extends ServiceImpl<RecycleStationSt
this.removeById(entity.getId()); this.removeById(entity.getId());
} }
} }
/** RecycleStaffDevice子表方法 */
@Override
public List<RecycleStaffDeviceEntity> getRecycleStaffDeviceList(String id,RecycleStationStaffPagination recycleStationStaffPagination){
Map<String, Object> newtabMap=RecycleStationStaffConstant.TABLEFIELDKEY.entrySet()
.stream().collect( Collectors.toMap(e->e.getValue(),e->e.getKey()));
String tableName="recycleStaffDevice";
tableName=newtabMap.get(tableName)==null?tableName:newtabMap.get(tableName).toString();
QueryWrapper<RecycleStaffDeviceEntity> queryWrapper = new QueryWrapper<>();
queryWrapper = recycleStaffDeviceService.getChild(recycleStationStaffPagination,queryWrapper);
queryWrapper.lambda().eq(RecycleStaffDeviceEntity::getOpenId, id);
generaterSwapUtil.wrapperHandle(RecycleStationStaffConstant.getColumnData(), RecycleStationStaffConstant.getAppColumnData(), queryWrapper,RecycleStaffDeviceEntity.class,"sub",tableName);
return recycleStaffDeviceService.list(queryWrapper);
}
/** RecycleStaffDevice子表方法 */
@Override
public List<RecycleStaffDeviceEntity> getRecycleStaffDeviceList(String id){
QueryWrapper<RecycleStaffDeviceEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(RecycleStaffDeviceEntity::getOpenId, id);
return recycleStaffDeviceService.list(queryWrapper);
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/ /** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override @Override
public String checkForm(RecycleStationStaffForm form,int i) { public String checkForm(RecycleStationStaffForm form,int i) {
@ -332,7 +400,7 @@ public class RecycleStationStaffServiceImpl extends ServiceImpl<RecycleStationSt
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId()); UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
recycleStationStaffForm = JsonUtil.getJsonToBean( recycleStationStaffForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(RecycleStationStaffConstant.getFormData(),recycleStationStaffForm),RecycleStationStaffForm.class); generaterSwapUtil.swapDatetime(RecycleStationStaffConstant.getFormData(),recycleStationStaffForm),RecycleStationStaffForm.class);
RecycleStationStaffEntity entity = JsonUtil.getJsonToBean(recycleStationStaffForm, RecycleStationStaffEntity.class); RecycleStationStaffEntity entity = JsonUtil.getJsonToBean(recycleStationStaffForm, RecycleStationStaffEntity.class);
@ -343,7 +411,24 @@ public class RecycleStationStaffServiceImpl extends ServiceImpl<RecycleStationSt
}else{ }else{
} }
this.saveOrUpdate(entity); this.saveOrUpdate(entity);
//RecycleStaffDevice子表数据新增修改
if(!isSave){
QueryWrapper<RecycleStaffDeviceEntity> RecycleStaffDevicequeryWrapper = new QueryWrapper<>();
RecycleStaffDevicequeryWrapper.lambda().eq(RecycleStaffDeviceEntity::getOpenId, entity.getOpenid());
recycleStaffDeviceService.remove(RecycleStaffDevicequeryWrapper);
}
if (recycleStationStaffForm.getRecycleStaffDeviceList()!=null){
List<RecycleStaffDeviceEntity> tableField114 = JsonUtil.getJsonToList(recycleStationStaffForm.getRecycleStaffDeviceList(),RecycleStaffDeviceEntity.class);
for(RecycleStaffDeviceEntity entitys : tableField114){
entitys.setId(RandomUtil.uuId());
entitys.setStationId(entity.getStationId());
entitys.setOpenId(entity.getOpenid());
if(isSave){
}else{
}
recycleStaffDeviceService.saveOrUpdate(entitys);
}
}
} }
/** /**

@ -1,5 +1,6 @@
package jnpf.controller; package jnpf.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult; import jnpf.base.ActionResult;
@ -19,6 +20,7 @@ import jnpf.util.JsonUtil;
import jnpf.util.StringUtil; import jnpf.util.StringUtil;
import jnpf.util.UserProvider; import jnpf.util.UserProvider;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import oracle.jdbc.proxy.annotation.Post;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -203,4 +205,28 @@ public class RecycleDeviceController {
return ActionResult.success(recycleDeviceMap); return ActionResult.success(recycleDeviceMap);
} }
/**
*
*
* @return
*/
@Operation(summary = "回收单关联设备")
@PostMapping("/queryRecycleDevie")
public ActionResult queryRecycleSaffDevie(@RequestBody RecycleDevicePagination recycleDevicePagination)throws IOException {
//查询凭证列表弹窗
// RecycleDevicePagination.setMenuId("530034857632334469");
// List<VoucherEntity> list= voucherService.queryInspectionVoucherPopupInfo(voucherPagination);
List<RecycleDeviceEntity> recycleDeviceEntityList = recycleDeviceService.queryRecycleSaffDeviceList(recycleDevicePagination);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(recycleDeviceEntityList);
PaginationVO page = JsonUtil.getJsonToBean(recycleDevicePagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
// public ActionResult queryRecycleSaffDevie(@RequestParam("stationId") String stationId)throws IOException{
// List<RecycleDeviceEntity> recycleDeviceEntityList = recycleDeviceService.queryRecycleSaffDeviceList(stationId);
// return ActionResult.success(recycleDeviceEntityList);
// }
} }

@ -50,6 +50,8 @@ public class RecycleStationStaffController {
@Autowired @Autowired
private RecycleStationStaffService recycleStationStaffService; private RecycleStationStaffService recycleStationStaffService;
@Autowired
private RecycleStaffDeviceService recycleStaffDeviceService;
@ -69,6 +71,8 @@ public class RecycleStationStaffController {
recycleStationStaffMap.put("id", recycleStationStaffMap.get("id")); recycleStationStaffMap.put("id", recycleStationStaffMap.get("id"));
//副表数据 //副表数据
//子表数据 //子表数据
List<RecycleStaffDeviceEntity> recycleStaffDeviceList = recycleStationStaffService.getRecycleStaffDeviceList(entity.getId(),recycleStationStaffPagination);
recycleStationStaffMap.put("tableField114",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(recycleStaffDeviceList)));
realList.add(recycleStationStaffMap); realList.add(recycleStationStaffMap);
} }
//数据转换 //数据转换
@ -143,6 +147,10 @@ public class RecycleStationStaffController {
if(entity!=null){ if(entity!=null){
//主表数据删除 //主表数据删除
recycleStationStaffService.delete(entity); recycleStationStaffService.delete(entity);
QueryWrapper<RecycleStaffDeviceEntity> queryWrapperRecycleStaffDevice=new QueryWrapper<>();
queryWrapperRecycleStaffDevice.lambda().eq(RecycleStaffDeviceEntity::getOpenId,entity.getOpenid());
//子表数据删除
recycleStaffDeviceService.remove(queryWrapperRecycleStaffDevice);
} }
return ActionResult.success("删除成功"); return ActionResult.success("删除成功");
} }
@ -163,8 +171,11 @@ public class RecycleStationStaffController {
recycleStationStaffMap.put("id", recycleStationStaffMap.get("id")); recycleStationStaffMap.put("id", recycleStationStaffMap.get("id"));
//副表数据 //副表数据
//子表数据 //子表数据
List<RecycleStaffDeviceEntity> recycleStaffDeviceList = recycleStationStaffService.getRecycleStaffDeviceList(entity.getId());
recycleStationStaffMap.put("tableField114",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(recycleStaffDeviceList)));
recycleStationStaffMap = generaterSwapUtil.swapDataDetail(recycleStationStaffMap,RecycleStationStaffConstant.getFormData(),"520258938264883781",false); recycleStationStaffMap = generaterSwapUtil.swapDataDetail(recycleStationStaffMap,RecycleStationStaffConstant.getFormData(),"520258938264883781",false);
return ActionResult.success(recycleStationStaffMap); return ActionResult.success(recycleStationStaffMap);
} }
/** /**
* () * ()
@ -183,8 +194,11 @@ public class RecycleStationStaffController {
recycleStationStaffMap.put("id", recycleStationStaffMap.get("id")); recycleStationStaffMap.put("id", recycleStationStaffMap.get("id"));
//副表数据 //副表数据
//子表数据 //子表数据
List<RecycleStaffDeviceEntity> recycleStaffDeviceList = recycleStationStaffService.getRecycleStaffDeviceList(entity.getOpenid());
recycleStationStaffMap.put("recycleStaffDeviceList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(recycleStaffDeviceList)));
recycleStationStaffMap = generaterSwapUtil.swapDataForm(recycleStationStaffMap,RecycleStationStaffConstant.getFormData(),RecycleStationStaffConstant.TABLEFIELDKEY,RecycleStationStaffConstant.TABLERENAMES); recycleStationStaffMap = generaterSwapUtil.swapDataForm(recycleStationStaffMap,RecycleStationStaffConstant.getFormData(),RecycleStationStaffConstant.TABLEFIELDKEY,RecycleStationStaffConstant.TABLERENAMES);
return ActionResult.success(recycleStationStaffMap); return ActionResult.success(recycleStationStaffMap);
} }
} }

@ -0,0 +1,56 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-06-24
*/
@Data
@TableName("nx_recycle_staff_device")
public class RecycleStaffDeviceEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "DEVICE_CODE" , updateStrategy = FieldStrategy.IGNORED)
private String deviceCode;
@TableField("STATION_ID")
private String stationId;
@TableField("OPEN_ID")
private String openId;
@TableField("USER_NAME")
private String userName;
@TableField("PHONE")
private String phone;
@TableField(value = "f_creator_time" , fill = FieldFill.INSERT)
private Date creatorTime;
@TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
private String creatorUserId;
@TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime;
@TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId;
@TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
private Date deleteTime;
@TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
private String deleteUserId;
@TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField(value = "company_id" , fill = FieldFill.INSERT)
private String companyId;
@TableField(value = "department_id" , fill = FieldFill.INSERT)
private String departmentId;
@TableField(value = "organize_json_id" , fill = FieldFill.INSERT)
private String organizeJsonId;
@TableField(value = "address" )
private String address;
@TableField("DEVICE_NAME")
private String device_name;
}

@ -45,4 +45,11 @@ public class RecycleDevicePagination extends Pagination {
/** 设备状态 */ /** 设备状态 */
@JsonProperty("status") @JsonProperty("status")
private Object status; private Object status;
@JsonProperty("excludeIdList")
private List<String> excludeIdList;
/** id */
@JsonProperty("stationId")
private String stationId;
} }

@ -0,0 +1,37 @@
package jnpf.model.recyclestationstaff;
import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
* recycleStationStaff
* V3.5
* : https://www.jnpfsoft.com
* JNPF
* 2024-06-24
*/
@Data
public class RecycleStaffDeviceModel {
/** 设备编码 **/
@JSONField(name = "deviceCode")
private String deviceCode;
/** 创建人 **/
@JSONField(name = "creatorUserId")
private String creatorUserId;
/** 创建时间 **/
@JSONField(name = "creatorTime")
private Long creatorTime;
/** 设备名称 **/
@JSONField(name = "deviceName")
private String deviceName;
/** 地址 **/
@JSONField(name = "address")
private String address;
}

@ -16,6 +16,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
public class RecycleStationStaffForm { public class RecycleStationStaffForm {
/** 主键 */ /** 主键 */
private String id; private String id;
/** 子表数据 **/
@JsonProperty("recycleStaffDeviceList")
private List<RecycleStaffDeviceModel> recycleStaffDeviceList;
/** 回收站 **/ /** 回收站 **/
@JsonProperty("stationId") @JsonProperty("stationId")

@ -0,0 +1,168 @@
<template>
<el-dialog
title="设备信息"
:close-on-click-modal="false"
:visible.sync="visible"
class="JNPF-dialog JNPF-dialog_center"
lock-scroll
append-to-body
width="800px"
>
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="10">
<el-form-item label="关键词">
<el-input
v-model="keyword"
placeholder="请输入关键词查询"
clearable
@keyup.enter.native="search()"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"
>{{ $t("common.search") }}
</el-button>
<el-button icon="el-icon-refresh-right" @click="refresh()"
>{{ $t("common.reset") }}
</el-button>
</el-form-item>
</el-col>
</el-form>
<div class="JNPF-common-search-box-right">
<el-tooltip
effect="dark"
:content="$t('common.refresh')"
placement="top"
>
<el-link
icon="icon-ym icon-ym-Refresh JNPF-common-head-icon"
:underline="false"
@click="search()"
/>
</el-tooltip>
</div>
</el-row>
<JNPF-table v-loading="listLoading" :data="list" hasC @selection-change="handleSelectionChange"
:border="false">
<el-table-column prop="deviceCode" label="设备编码" align="left"> </el-table-column>
<el-table-column prop="deviceName" label="设备名称" align="left"> </el-table-column>
<el-table-column prop="address" label="地址" align="left"> </el-table-column>
<el-table-column prop="status" label="状态" align="left"> </el-table-column>
</JNPF-table>
<pagination
:total="total"
:page.sync="listQuery.currentPage"
:limit.sync="listQuery.pageSize"
@pagination="init"
/>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">{{
$t("common.cancelButton")
}}</el-button>
<el-button type="primary" @click="select()">{{
$t("common.confirmButton")
}}</el-button>
</span>
</el-dialog>
</template>
<script>
import request from "@/utils/request";
import { GoodsList } from "@/api/extend/order";
export default {
data() {
return {
visible: false,
listLoading: true,
keyword: "",
list: [],
total: 0,
listQuery: {
superQueryJson: "",
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
excludeIdList: [],
checked: [],
};
},
methods: {
init(excludeIdList,stationId) {
this.visible = true;
this.listLoading = true;
if (excludeIdList) {
this.excludeIdList = excludeIdList;
}
if (stationId && typeof(stationId) == 'string') {
this.stationId = stationId;
}
let query = {
...this.listQuery,
keyword: this.keyword,
excludeIdList: this.excludeIdList,
dataType: 0,
stationId: this.stationId,
};
request({
url: `/api/scm/RecycleDevice/queryRecycleDevie`,
method: "post",
data: query,
}).then((res) => {
console.log(res,'---------------');
this.list = res.data.list;
this.listLoading = false;
this.total = res.data.pagination.total;
});
},
refresh() {
this.keyword = "";
this.listQuery.currentPage = 1;
this.listQuery.pageSize = 20;
this.listQuery.sort = "desc";
this.listQuery.sidx = "";
this.init();
},
search() {
this.listQuery.currentPage = 1;
this.listQuery.pageSize = 20;
this.listQuery.sort = "desc";
this.listQuery.sidx = "";
this.init();
},
select() {
if (!this.checked.length) return;
this.visible = false;
this.$emit("refreshDataList", this.checked);
},
handleSelectionChange(val) {
this.checked = val;
},
},
};
</script>
<style lang="scss" scoped>
>>> .el-dialog__body {
height: 70vh;
padding: 0 0 10px !important;
display: flex;
flex-direction: column;
overflow: hidden;
.JNPF-common-search-box {
margin-bottom: 0;
.JNPF-common-search-box-right {
padding: 10px 10px 0 0;
}
}
}
</style>

@ -61,6 +61,33 @@
<p>{{dataForm.autoEnabled}}</p> <p>{{dataForm.autoEnabled}}</p>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2>设备列表</h2>
</div>
<el-table :data="dataForm.tableField114" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="deviceCode" label="设备编码">
<template slot-scope="scope">
<p>{{ scope.row.deviceCode }}</p>
</template>
</el-table-column>
<el-table-column prop="creatorUserId" label="创建人">
<template slot-scope="scope">
<p>{{ scope.row.creatorUserId }}</p>
</template>
</el-table-column>
<el-table-column prop="creatorTime" label="创建时间">
<template slot-scope="scope">
<p>{{ scope.row.creatorTime }}</p>
</template>
</el-table-column>
</el-table>
</jnpf-form-tip-item>
</el-col>
</template> </template>
</el-form> </el-form>
</el-row> </el-row>
@ -92,6 +119,7 @@ export default {
gender: "1", gender: "1",
birthday: '', birthday: '',
autoEnabled: 1, autoEnabled: 1,
recyclestaffdeviceList: [],
}, },
stationIdProps: { "label": "station_name", "value": "id" }, stationIdProps: { "label": "station_name", "value": "id" },
genderOptions: [{ "fullName": "男", "id": "1" }, { "fullName": "女", "id": "2" }], genderOptions: [{ "fullName": "男", "id": "1" }, { "fullName": "女", "id": "2" }],

File diff suppressed because one or more lines are too long

@ -1,11 +1,8 @@
<template>
<template>
<transition name="el-zoom-in-center"> <transition name="el-zoom-in-center">
<div class="JNPF-preview-main"> <div class="JNPF-preview-main">
<div class="JNPF-common-page-header"> <div class="JNPF-common-page-header">
<el-page-header @back="goBack" :content="!dataForm.id ? '新建':'编辑'" /> <el-page-header @back="goBack" :content="!dataForm.id ? '新建' : '编辑'" />
<div class="options"> <div class="options">
<el-dropdown class="dropdown" placement="bottom"> <el-dropdown class="dropdown" placement="bottom">
<el-button style="width:70px"> <el-button style="width:70px">
@ -14,25 +11,26 @@
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<template v-if="dataForm.id"> <template v-if="dataForm.id">
<el-dropdown-item @click.native="prev" :disabled='prevDis'> <el-dropdown-item @click.native="prev" :disabled='prevDis'>
{{'上一条'}} {{ '上一条' }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item @click.native="next" :disabled='nextDis'> <el-dropdown-item @click.native="next" :disabled='nextDis'>
{{'下一条'}} {{ '下一条' }}
</el-dropdown-item> </el-dropdown-item>
</template> </template>
<el-dropdown-item type="primary" @click.native="dataFormSubmit(2)" <el-dropdown-item type="primary" @click.native="dataFormSubmit(2)" :loading="continueBtnLoading"
:loading="continueBtnLoading" :disabled='btnLoading'> :disabled='btnLoading'>
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-dropdown-item> {{ !dataForm.id ? '确定并新增' : '确定并继续' }}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading" <el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading" :disabled='continueBtnLoading'>
:disabled='continueBtnLoading'> </el-button> </el-button>
<el-button @click="goBack"> </el-button> <el-button @click="goBack"> </el-button>
</div> </div>
</div> </div>
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}"> <el-row :gutter="15" class=" main" :style="{ margin: '0 auto', width: '100%' }">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" <el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
label-position="right"> label-position="right">
<template v-if="!loading"> <template v-if="!loading">
<!-- 具体表单 --> <!-- 具体表单 -->
<el-col :span="24"> <el-col :span="24">
@ -43,70 +41,144 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<jnpf-form-tip-item label="回收站" prop="stationId"> <jnpf-form-tip-item label="回收站" prop="stationId">
<JnpfSelect v-model="dataForm.stationId" @change="changeData('stationId',-1)" <JnpfSelect v-model="dataForm.stationId" @change="changeData('stationId', -1)" placeholder="请选择"
placeholder="请选择" clearable :style='{"width":"100%"}' :options="stationIdOptions" clearable :style='{ "width": "100%" }' :options="stationIdOptions" :props="stationIdProps">
:props="stationIdProps">
</JnpfSelect> </JnpfSelect>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<jnpf-form-tip-item> <jnpf-form-tip-item>
<JnpfGroupTitle content="回收员信息" contentPosition="left"> <JnpfGroupTitle content="回收员信息" contentPosition="left">
</JnpfGroupTitle> </JnpfGroupTitle>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<jnpf-form-tip-item label="头像" prop="headIcon"> <jnpf-form-tip-item label="头像" prop="headIcon">
<JnpfUploadImg v-model="dataForm.headIcon" @change="changeData('headIcon',-1)" <JnpfUploadImg v-model="dataForm.headIcon" @change="changeData('headIcon', -1)" :fileSize="10"
:fileSize="10" sizeUnit="MB" :limit="1" pathType="defaultPath" :isAccount="0"> sizeUnit="MB" :limit="1" pathType="defaultPath" :isAccount="0">
</JnpfUploadImg> </JnpfUploadImg>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<jnpf-form-tip-item label="回收员姓名" prop="staffsName"> <jnpf-form-tip-item label="回收员姓名" prop="staffsName">
<JnpfInput v-model="dataForm.staffsName" @change="changeData('staffsName',-1)" <JnpfInput v-model="dataForm.staffsName" @change="changeData('staffsName', -1)" placeholder="请输入"
placeholder="请输入" clearable :style='{"width":"100%"}'> clearable :style='{ "width": "100%" }'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<jnpf-form-tip-item label="回收员手机" prop="mobilePhone"> <jnpf-form-tip-item label="回收员手机" prop="mobilePhone">
<JnpfInput v-model="dataForm.mobilePhone" @change="changeData('mobilePhone',-1)" <JnpfInput v-model="dataForm.mobilePhone" @change="changeData('mobilePhone', -1)" placeholder="请输入"
placeholder="请输入" clearable :style='{"width":"100%"}'> clearable :style='{ "width": "100%" }'>
</JnpfInput> </JnpfInput>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<jnpf-form-tip-item label="性别" prop="gender"> <jnpf-form-tip-item label="性别" prop="gender">
<JnpfRadio v-model="dataForm.gender" @change="changeData('gender',-1)" <JnpfRadio v-model="dataForm.gender" @change="changeData('gender', -1)" optionType="default"
optionType="default" direction="horizontal" size="small" :options="genderOptions" direction="horizontal" size="small" :options="genderOptions" :props="genderProps">
:props="genderProps">
</JnpfRadio> </JnpfRadio>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<jnpf-form-tip-item label="生日" prop="birthday"> <jnpf-form-tip-item label="生日" prop="birthday">
<JnpfDatePicker v-model="dataForm.birthday" @change="changeData('birthday',-1)" <JnpfDatePicker v-model="dataForm.birthday" @change="changeData('birthday', -1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" :startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')" placeholder="请选择"
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" clearable :style='{ "width": "100%" }' type="date" format="yyyy-MM-dd">
format="yyyy-MM-dd">
</JnpfDatePicker> </JnpfDatePicker>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<jnpf-form-tip-item label="自动接单" prop="autoEnabled"> <jnpf-form-tip-item label="自动接单" prop="autoEnabled">
<JnpfSwitch v-model="dataForm.autoEnabled" @change="changeData('autoEnabled',-1)" <JnpfSwitch v-model="dataForm.autoEnabled" @change="changeData('autoEnabled', -1)" :active-value="1"
:active-value="1" :inactive-value="0"> :inactive-value="0">
</JnpfSwitch> </JnpfSwitch>
</jnpf-form-tip-item> </jnpf-form-tip-item>
</el-col> </el-col>
<el-col :span="24">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2>设备列表</h2>
</div>
<el-table :data="dataForm.recycleStaffDeviceList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<!-- <el-table-column label="设备编码" prop="deviceCode">
<template slot="header" v-if="false">
<span class="required-sign">*</span>设备编码
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.deviceCode"
@change="changeData('recyclestaffdevice-deviceName', scope.$index)" placeholder="请输入"
clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
<template slot-scope="scope">
<JnpfPopupSelect v-model="scope.row.deviceCode"
@change="changeData('recyclestaffdevice-deviceCode', scope.$index)" :rowIndex="scope.$index"
:formData="dataForm" :templateJson="interfaceRes.recyclestaffdevicedeviceCode" placeholder="请选择"
propsValue="device_code" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='device_name' :field="'deviceCode' + scope.$index"
interfaceId="573775077175212421" :pageSize="20"
:columnOptions="recyclestaffdevicedeviceCodecolumnOptions" clearable
:style='{ "width": "100%" }'>
</JnpfPopupSelect>
</template>
</el-table-column> -->
<el-table-column label="设备名称" prop="deviceName">
<template slot="header" v-if="false">
<span class="required-sign">*</span>设备名称
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.deviceName"
@change="changeData('recyclestaffdevice-deviceName', scope.$index)" placeholder="请输入"
clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="地址" prop="address">
<template slot="header" v-if="false">
<span class="required-sign">*</span>地址
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.address"
@change="changeData('recyclestaffdevice-address', scope.$index)" placeholder="请输入"
clearable :style='{ "width": "100%" }'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="操作" width="50">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delrecyclestaffdeviceList(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- <div class="table-actions" @click="addrecyclestaffdeviceList()">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div> -->
<div class="table-actions" @click="choice(dataForm.stationId)">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 --> <!-- 表单结束 -->
</template> </template>
</el-form> </el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" <SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false" /> @select="addForSelect" @close="selectDialogVisible = false" />
</el-row> </el-row>
<recycleSaffDeviceBox v-if="recycleSaffDeviceBoxVisible" ref="deviceBox" @refreshDataList="initList" />
</div> </div>
</transition> </transition>
</template> </template>
@ -121,8 +193,10 @@ import { getDefaultCurrentValueUserId } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize' import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js' import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
import { thousandsFormat } from "@/components/Generator/utils/index" import { thousandsFormat } from "@/components/Generator/utils/index"
import recycleSaffDeviceBox from "@/views/publicPopup/recycleSaffDevice";
export default { export default {
components: {}, components: {recycleSaffDeviceBox},
props: [], props: [],
data() { data() {
return { return {
@ -139,15 +213,26 @@ export default {
setting: {}, setting: {},
eventType: '', eventType: '',
userBoxVisible: false, userBoxVisible: false,
recycleSaffDeviceBoxVisible: false,
selectDialogVisible: false, selectDialogVisible: false,
currTableConf: {}, currTableConf: {},
dataValueAll: {}, dataValueAll: {},
addTableConf: { addTableConf: {
recycleStaffDeviceList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
}, },
// //
ableAll: { ableAll: {
}, },
tableRows: { tableRows: {
recycleStaffDeviceList: {
deviceCode: '',
deviceCodeOptions: [],
creatorUserId: '',
creatorUserIdOptions: [],
creatorTime: '',
creatorTimeOptions: [],
enabledmark: undefined
},
}, },
Vmodel: "", Vmodel: "",
currVmodel: "", currVmodel: "",
@ -159,6 +244,7 @@ export default {
gender: "1", gender: "1",
birthday: undefined, birthday: undefined,
autoEnabled: 1, autoEnabled: 1,
recycleStaffDeviceList: [],
}, },
tableRequiredData: {}, tableRequiredData: {},
dataRule: dataRule:
@ -189,6 +275,7 @@ export default {
stationIdProps: { "label": "station_name", "value": "id" }, stationIdProps: { "label": "station_name", "value": "id" },
genderOptions: [{ "fullName": "男", "id": "1" }, { "fullName": "女", "id": "2" }], genderOptions: [{ "fullName": "男", "id": "1" }, { "fullName": "女", "id": "2" }],
genderProps: { "label": "fullName", "value": "id" }, genderProps: { "label": "fullName", "value": "id" },
recyclestaffdevicedeviceCodecolumnOptions: [{ "label": "设备编码", "value": "device_code" }, { "label": "设备名称", "value": "device_name" }, { "label": "地址", "value": "address" },],
childIndex: -1, childIndex: -1,
isEdit: false, isEdit: false,
interfaceRes: { interfaceRes: {
@ -199,6 +286,9 @@ export default {
gender: [], gender: [],
birthday: [], birthday: [],
autoEnabled: [], autoEnabled: [],
recyclestaffdevicedeviceCode: [{ "fieldName": "回收站id", "field": "station_id", "defaultValue": "", "jnpfKey": "select", "dataType": "varchar", "id": "XOoSv92", "relationField": "stationId", "required": "1" }],
recyclestaffdevicecreatorUserId: [],
recyclestaffdevicecreatorTime: [],
}, },
} }
}, },
@ -213,6 +303,31 @@ export default {
}, },
mounted() { }, mounted() { },
methods: { methods: {
choice(stationId) {
this.recycleSaffDeviceBoxVisible = true;
let excludeIdList = [];
for (let i = 0; i < this.dataForm.recycleStaffDeviceList.length; i++) {
excludeIdList.push(this.dataForm.recycleStaffDeviceList[i].deviceCode);
}
this.$nextTick(() => {
this.$refs.deviceBox.init(excludeIdList,stationId);
});
},
initList(list) {
for (let i = 0; i < list.length; i++) {
const e = list[i];
let item = {
deviceCode: e.id,
deviceName: e.deviceName,
address: e.address,
// hasSchedule: e.hasSchedule,
// recycleAddress: e.recycleAddress,
};
this.dataForm.recycleStaffDeviceList.push(item);
}
},
prev() { prev() {
this.index-- this.index--
if (this.index === 0) { if (this.index === 0) {
@ -292,6 +407,13 @@ export default {
dataAll() { dataAll() {
this.getstationIdOptions(); this.getstationIdOptions();
}, },
recyclestaffdeviceExist() {
let isOk = true;
for (let i = 0; i < this.dataForm.recycleStaffDeviceList.length; i++) {
const e = this.dataForm.recycleStaffDeviceList[i];
}
return isOk;
},
getstationIdOptions() { getstationIdOptions() {
const index = this.childIndex const index = this.childIndex
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.stationId)) let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.stationId))
@ -429,6 +551,30 @@ export default {
}) })
} }
}, },
addrecyclestaffdeviceList() {
let item = {
deviceCode: '',
creatorUserId: undefined,
creatorTime: undefined,
}
this.getrecyclestaffdeviceList(item)
},
delrecyclestaffdeviceList(index) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.recycleStaffDeviceList.splice(index, 1);
}).catch(() => {
});
},
getrecyclestaffdeviceList(value) {
let item = { ...this.tableRows.recycleStaffDeviceList, ...value }
this.dataForm.recycleStaffDeviceList.push(item)
this.childIndex = this.dataForm.recycleStaffDeviceList.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
},
openSelectDialog(key) { openSelectDialog(key) {
this.currTableConf = this.addTableConf[key] this.currTableConf = this.addTableConf[key]
this.currVmodel = key this.currVmodel = key
@ -517,6 +663,9 @@ export default {
this.dataForm = _dataAll this.dataForm = _dataAll
this.isEdit = true this.isEdit = true
this.dataAll() this.dataAll()
for (let i = 0; i < _dataAll.recycleStaffDeviceList.length; i++) {
this.childIndex = i
}
this.childIndex = -1 this.childIndex = -1
}, },
}, },

@ -46,23 +46,22 @@
</el-tooltip> </el-tooltip>
</div> </div>
</div> </div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c <JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c custom-column border
custom-column border @selection-change="handleSelectionChange" @selection-change="handleSelectionChange" :span-method="arraySpanMethod">
:span-method="arraySpanMethod"> <el-table-column prop="stationId" label="回收站" sortable width="200px" align="center">
<el-table-column prop="stationId" label="回收站" sortable width="200px" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="staffsName" label="回收员姓名" width="200px" align="center"> <el-table-column prop="staffsName" label="回收员姓名" width="200px" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="mobilePhone" label="回收员手机" width="200px" align="center"> <el-table-column prop="mobilePhone" label="回收员手机" width="200px" align="center">
</el-table-column> </el-table-column>
<el-table-column label="性别" prop="gender" width="100px" align="center"> <el-table-column label="性别" prop="gender" width="100px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.gender }} {{ scope.row.gender }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="birthday" label="生日" width="150px" align="center"> <el-table-column prop="birthday" label="生日" width="150px" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="autoEnabled" label="自动接单" width="80px" align="center"> <el-table-column prop="autoEnabled" label="自动接单" width="80px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.autoEnabled == '开'" style="display: flex; align-items: center"> <div v-if="scope.row.autoEnabled == '开'" style="display: flex; align-items: center">
@ -76,7 +75,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" width="160px" align="center"> <el-table-column label="操作" fixed="right" width="160px" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="addOrUpdateHandle(scope.row)"> <el-button type="text" @click="addOrUpdateHandle(scope.row)">

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save