Merge remote-tracking branch 'origin/master'

master
jiyufei 4 months ago
commit d2d47a9131

@ -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.RecycleDeviceConfigOneMapper">
</mapper>

@ -0,0 +1,16 @@
package jnpf.mapper;
import jnpf.entity.RecycleDeviceConfigOneEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* RecycleDeviceConfigOne
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-03
*/
public interface RecycleDeviceConfigOneMapper extends BaseMapper<RecycleDeviceConfigOneEntity> {
}

@ -0,0 +1,35 @@
package jnpf.service;
import jnpf.model.recycledeviceconfigone.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* RecycleDeviceConfigOne
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-03
*/
public interface RecycleDeviceConfigOneService extends IService<RecycleDeviceConfigOneEntity> {
List<RecycleDeviceConfigOneEntity> getList(RecycleDeviceConfigOnePagination recycleDeviceConfigOnePagination);
List<RecycleDeviceConfigOneEntity> getTypeList(RecycleDeviceConfigOnePagination recycleDeviceConfigOnePagination,String dataType);
RecycleDeviceConfigOneEntity getInfo(String id);
void delete(RecycleDeviceConfigOneEntity entity);
void create(RecycleDeviceConfigOneEntity entity);
boolean update(String id, RecycleDeviceConfigOneEntity entity);
//子表方法
//副表数据方法
String checkForm(RecycleDeviceConfigOneForm form,int i);
void saveOrUpdate(RecycleDeviceConfigOneForm recycleDeviceConfigOneForm,String id, boolean isSave) throws Exception;
}

@ -0,0 +1,364 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.RecycleDeviceConfigOneMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.recycledeviceconfigone.*;
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 java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.regex.Pattern;
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;
/**
*
* RecycleDeviceConfigOne
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-03
*/
@Service
public class RecycleDeviceConfigOneServiceImpl extends ServiceImpl<RecycleDeviceConfigOneMapper, RecycleDeviceConfigOneEntity> implements RecycleDeviceConfigOneService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Override
public List<RecycleDeviceConfigOneEntity> getList(RecycleDeviceConfigOnePagination recycleDeviceConfigOnePagination){
return getTypeList(recycleDeviceConfigOnePagination,recycleDeviceConfigOnePagination.getDataType());
}
/** 列表查询 */
@Override
public List<RecycleDeviceConfigOneEntity> getTypeList(RecycleDeviceConfigOnePagination recycleDeviceConfigOnePagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
List<List<String>> intersectionList =new ArrayList<>();
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String columnData = !isPc ? RecycleDeviceConfigOneConstant.getAppColumnData() : RecycleDeviceConfigOneConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int recycleDeviceConfigOneNum =0;
QueryWrapper<RecycleDeviceConfigOneEntity> recycleDeviceConfigOneQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(recycleDeviceConfigOnePagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = recycleDeviceConfigOnePagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<RecycleDeviceConfigOneEntity> recycleDeviceConfigOneSuperWrapper = new QueryWrapper<>();
recycleDeviceConfigOneSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(recycleDeviceConfigOneSuperWrapper,RecycleDeviceConfigOneEntity.class,queryJson,"0"));
int recycleDeviceConfigOneNum1 = recycleDeviceConfigOneSuperWrapper.getExpression().getNormal().size();
if (recycleDeviceConfigOneNum1>0){
List<String> recycleDeviceConfigOneList =this.list(recycleDeviceConfigOneSuperWrapper).stream().map(RecycleDeviceConfigOneEntity::getId).collect(Collectors.toList());
allSuperList.addAll(recycleDeviceConfigOneList);
intersectionSuperList.add(recycleDeviceConfigOneList);
superNum++;
}
superOp = superNum > 0 ? superJsonModel.getMatchLogic() : "";
//and or
if(superOp.equalsIgnoreCase("and")){
allSuperIDlist = generaterSwapUtil.getIntersection(intersectionSuperList);
}else{
allSuperIDlist = allSuperList;
}
}
List<String> allRuleIDlist = new ArrayList<>();
String ruleOp ="";
if (ObjectUtil.isNotEmpty(ruleJson)){
List<String> allRuleList = new ArrayList<>();
List<List<String>> intersectionRuleList = new ArrayList<>();
SuperJsonModel ruleJsonModel = JsonUtil.getJsonToBean(ruleJson, SuperJsonModel.class);
int ruleNum = 0;
QueryWrapper<RecycleDeviceConfigOneEntity> recycleDeviceConfigOneSuperWrapper = new QueryWrapper<>();
recycleDeviceConfigOneSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(recycleDeviceConfigOneSuperWrapper,RecycleDeviceConfigOneEntity.class,ruleJson,"0"));
int recycleDeviceConfigOneNum1 = recycleDeviceConfigOneSuperWrapper.getExpression().getNormal().size();
if (recycleDeviceConfigOneNum1>0){
List<String> recycleDeviceConfigOneList =this.list(recycleDeviceConfigOneSuperWrapper).stream().map(RecycleDeviceConfigOneEntity::getId).collect(Collectors.toList());
allRuleList.addAll(recycleDeviceConfigOneList);
intersectionRuleList.add(recycleDeviceConfigOneList);
ruleNum++;
}
ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : "";
//and or
if(ruleOp.equalsIgnoreCase("and")){
allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList);
}else{
allRuleIDlist = allRuleList;
}
}
boolean pcPermission = true;
boolean appPermission = false;
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object recycleDeviceConfigOneObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(recycleDeviceConfigOneQueryWrapper,RecycleDeviceConfigOneEntity.class,recycleDeviceConfigOnePagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(recycleDeviceConfigOneObj)){
return new ArrayList<>();
} else {
recycleDeviceConfigOneQueryWrapper = (QueryWrapper<RecycleDeviceConfigOneEntity>)recycleDeviceConfigOneObj;
if( recycleDeviceConfigOneQueryWrapper.getExpression().getNormal().size()>0){
recycleDeviceConfigOneNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object recycleDeviceConfigOneObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(recycleDeviceConfigOneQueryWrapper,RecycleDeviceConfigOneEntity.class,recycleDeviceConfigOnePagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(recycleDeviceConfigOneObj)){
return new ArrayList<>();
} else {
recycleDeviceConfigOneQueryWrapper = (QueryWrapper<RecycleDeviceConfigOneEntity>)recycleDeviceConfigOneObj;
if( recycleDeviceConfigOneQueryWrapper.getExpression().getNormal().size()>0){
recycleDeviceConfigOneNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(recycleDeviceConfigOnePagination.getOrganizeJsonId())){
recycleDeviceConfigOneNum++;
List<String> idList = new ArrayList<>();
try {
String[][] organizeJsonId = JsonUtil.getJsonToBean(recycleDeviceConfigOnePagination.getOrganizeJsonId(),String[][].class);
for(int i=0;i<organizeJsonId.length;i++){
if(organizeJsonId[i].length>0){
idList.add(JsonUtil.getObjectToString(Arrays.asList(organizeJsonId[i])));
}
}
}catch (Exception e1){
try {
List<String> organizeJsonId = JsonUtil.getJsonToList(recycleDeviceConfigOnePagination.getOrganizeJsonId(),String.class);
if(organizeJsonId.size()>0){
idList.add(organizeJsonId.get(organizeJsonId.size()-1));
}
}catch (Exception e2){
idList.add(String.valueOf(recycleDeviceConfigOnePagination.getOrganizeJsonId()));
}
}
recycleDeviceConfigOneQueryWrapper.lambda().and(t->{
idList.forEach(tt->{
t.like(RecycleDeviceConfigOneEntity::getOrganizeJsonId, tt).or();
});
});
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
recycleDeviceConfigOneQueryWrapper.lambda().in(RecycleDeviceConfigOneEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
recycleDeviceConfigOneQueryWrapper.lambda().and(t->t.in(RecycleDeviceConfigOneEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
recycleDeviceConfigOneQueryWrapper.lambda().and(t->t.in(RecycleDeviceConfigOneEntity::getId, finalAllRuleIDlist));
}
//假删除标志
recycleDeviceConfigOneQueryWrapper.lambda().isNull(RecycleDeviceConfigOneEntity::getDeleteMark);
//排序
if(StringUtil.isEmpty(recycleDeviceConfigOnePagination.getSidx())){
recycleDeviceConfigOneQueryWrapper.lambda().orderByDesc(RecycleDeviceConfigOneEntity::getId);
}else{
try {
String sidx = recycleDeviceConfigOnePagination.getSidx();
String[] strs= sidx.split("_name");
RecycleDeviceConfigOneEntity recycleDeviceConfigOneEntity = new RecycleDeviceConfigOneEntity();
Field declaredField = recycleDeviceConfigOneEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
recycleDeviceConfigOneQueryWrapper="asc".equals(recycleDeviceConfigOnePagination.getSort().toLowerCase())?recycleDeviceConfigOneQueryWrapper.orderByAsc(value):recycleDeviceConfigOneQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<RecycleDeviceConfigOneEntity> page=new Page<>(recycleDeviceConfigOnePagination.getCurrentPage(), recycleDeviceConfigOnePagination.getPageSize());
IPage<RecycleDeviceConfigOneEntity> userIPage=this.page(page, recycleDeviceConfigOneQueryWrapper);
return recycleDeviceConfigOnePagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<RecycleDeviceConfigOneEntity> list = new ArrayList();
return recycleDeviceConfigOnePagination.setData(list, list.size());
}
}else{
return this.list(recycleDeviceConfigOneQueryWrapper);
}
}
@Override
public RecycleDeviceConfigOneEntity getInfo(String id){
QueryWrapper<RecycleDeviceConfigOneEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(RecycleDeviceConfigOneEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(RecycleDeviceConfigOneEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, RecycleDeviceConfigOneEntity entity){
return this.updateById(entity);
}
@Override
public void delete(RecycleDeviceConfigOneEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(RecycleDeviceConfigOneForm form,int i) {
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id="";
String countRecover = "";
if (isUp){
id = form.getId();
}
//主表字段验证
if(StringUtil.isNotEmpty(form.getDeliveryPrice())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getDeliveryPrice())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getBucket1Price())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getBucket1Price())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getBucket2Price())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getBucket2Price())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getBucket3Price())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getBucket3Price())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getBucket4Price())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getBucket4Price())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getBucket5Price())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getBucket5Price())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getBucket6Price())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getBucket6Price())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getBucket7Price())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getBucket7Price())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getBucket8Price())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getBucket8Price())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getBucket9Price())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getBucket9Price())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getBucket10Price())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getBucket10Price())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getBucket11Price())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getBucket11Price())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getBucket12Price())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getBucket12Price())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getWarningWeight())){
if(!Pattern.compile("^\\d+$").matcher(String.valueOf(form.getWarningWeight())).matches()){
return "请输入正确的重量";
}
}
return countRecover;
}
/**
* ()
* @param id
* @param recycleDeviceConfigOneForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(RecycleDeviceConfigOneForm recycleDeviceConfigOneForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
recycleDeviceConfigOneForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(RecycleDeviceConfigOneConstant.getFormData(),recycleDeviceConfigOneForm),RecycleDeviceConfigOneForm.class);
RecycleDeviceConfigOneEntity entity = JsonUtil.getJsonToBean(recycleDeviceConfigOneForm, RecycleDeviceConfigOneEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setLastModifyUserId(null);
entity.setLastModifyTime(null);
entity.setOrganizeJsonId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(),"all"));
entity.setId(mainId);
}else{
entity.setLastModifyUserId(null);
entity.setLastModifyTime(null);
entity.setOrganizeJsonId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(),"all"));
}
this.saveOrUpdate(entity);
}
}

@ -0,0 +1,191 @@
package jnpf.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.exception.DataException;
import jnpf.permission.entity.UserEntity;
import jnpf.service.*;
import jnpf.entity.*;
import jnpf.util.*;
import jnpf.model.recycledeviceconfigone.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.transaction.annotation.Transactional;
/**
* RecycleDeviceConfigOne
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-03
*/
@Slf4j
@RestController
@Tag(name = "RecycleDeviceConfigOne" , description = "scm")
@RequestMapping("/api/scm/RecycleDeviceConfigOne")
public class RecycleDeviceConfigOneController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private RecycleDeviceConfigOneService recycleDeviceConfigOneService;
/**
*
*
* @param recycleDeviceConfigOnePagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody RecycleDeviceConfigOnePagination recycleDeviceConfigOnePagination)throws IOException{
List<RecycleDeviceConfigOneEntity> list= recycleDeviceConfigOneService.getList(recycleDeviceConfigOnePagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (RecycleDeviceConfigOneEntity entity : list) {
Map<String, Object> recycleDeviceConfigOneMap=JsonUtil.entityToMap(entity);
recycleDeviceConfigOneMap.put("id", recycleDeviceConfigOneMap.get("id"));
//副表数据
//子表数据
realList.add(recycleDeviceConfigOneMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, RecycleDeviceConfigOneConstant.getFormData(), RecycleDeviceConfigOneConstant.getColumnData(), recycleDeviceConfigOnePagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(recycleDeviceConfigOnePagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param recycleDeviceConfigOneForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid RecycleDeviceConfigOneForm recycleDeviceConfigOneForm) {
String b = recycleDeviceConfigOneService.checkForm(recycleDeviceConfigOneForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
recycleDeviceConfigOneService.saveOrUpdate(recycleDeviceConfigOneForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
*
* @param id
* @param recycleDeviceConfigOneForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid RecycleDeviceConfigOneForm recycleDeviceConfigOneForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
recycleDeviceConfigOneForm.setId(id);
if (!isImport) {
String b = recycleDeviceConfigOneService.checkForm(recycleDeviceConfigOneForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
RecycleDeviceConfigOneEntity entity= recycleDeviceConfigOneService.getInfo(id);
if(entity!=null){
try{
recycleDeviceConfigOneService.saveOrUpdate(recycleDeviceConfigOneForm,id,false);
}catch(Exception e){
return ActionResult.fail("修改数据失败");
}
return ActionResult.success("更新成功");
}else{
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
*
* @param id
* @return
*/
@Operation(summary = "删除")
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id){
RecycleDeviceConfigOneEntity entity= recycleDeviceConfigOneService.getInfo(id);
if(entity!=null){
//假删除
entity.setDeleteMark("1");
recycleDeviceConfigOneService.update(id,entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
RecycleDeviceConfigOneEntity entity= recycleDeviceConfigOneService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> recycleDeviceConfigOneMap=JsonUtil.entityToMap(entity);
recycleDeviceConfigOneMap.put("id", recycleDeviceConfigOneMap.get("id"));
//副表数据
//子表数据
recycleDeviceConfigOneMap = generaterSwapUtil.swapDataDetail(recycleDeviceConfigOneMap,RecycleDeviceConfigOneConstant.getFormData(),"578190840367677829",false);
return ActionResult.success(recycleDeviceConfigOneMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
RecycleDeviceConfigOneEntity entity= recycleDeviceConfigOneService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> recycleDeviceConfigOneMap=JsonUtil.entityToMap(entity);
recycleDeviceConfigOneMap.put("id", recycleDeviceConfigOneMap.get("id"));
//副表数据
//子表数据
recycleDeviceConfigOneMap = generaterSwapUtil.swapDataForm(recycleDeviceConfigOneMap,RecycleDeviceConfigOneConstant.getFormData(),RecycleDeviceConfigOneConstant.TABLEFIELDKEY,RecycleDeviceConfigOneConstant.TABLERENAMES);
return ActionResult.success(recycleDeviceConfigOneMap);
}
}

@ -7,9 +7,12 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.base.model.datainterface.DataInterfacePage;
import jnpf.base.model.datainterface.DataInterfaceParamModel;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.entity.*;
import jnpf.model.datainterface.DIDeviceListInfoModel;
import jnpf.model.recycledevice.Command;
import jnpf.model.recycledevice.RecycleDeviceConstant;
import jnpf.model.recycledevice.RecycleDeviceForm;
@ -52,6 +55,8 @@ public class RecycleDeviceController {
@Autowired
private RecycleDeviceService recycleDeviceService;
@Autowired
private CompanyService companyService;
@Resource
private RecycleBucketService recycleBucketService;
@Resource
@ -297,6 +302,33 @@ public class RecycleDeviceController {
List<RecycleDeviceEntity> list = recycleDeviceService.list(lambda);
return ActionResult.success(list);
}
//获取设备信息
@PostMapping("/getDeviceListInfo")
@Operation(summary = "获取设备清单信息")
public ActionResult getDeviceListInfo( @RequestBody(required = false) Map<String, Object> objectMap) {
DIDeviceListInfoModel model = JsonUtil.getJsonToBean(objectMap, DIDeviceListInfoModel.class);
List<String> ids = model.getIds();
QueryWrapper<RecycleDeviceEntity> wrapper = new QueryWrapper<>();
LambdaQueryWrapper<RecycleDeviceEntity> lambda = wrapper.lambda();
lambda.in(RecycleDeviceEntity::getDeviceCode, ids);
List<RecycleDeviceEntity> list = recycleDeviceService.list(lambda);
return ActionResult.success(list);
}
//获取商户列表
@PostMapping("/getCompanyList")
@Operation(summary = "获取商户列表下拉")
public ActionResult getCompanyList() {
UserInfo userInfo = userProvider.get();
Boolean isAdministrator = userInfo.getIsAdministrator();
String organizeId = userInfo.getOrganizeId();
QueryWrapper<CompanyEntity> wrapper = new QueryWrapper<>();
LambdaQueryWrapper<CompanyEntity> lambda = wrapper.lambda();
if(!isAdministrator){
lambda.eq(CompanyEntity::getId,organizeId);
}
List<CompanyEntity> list = companyService.list(lambda);
return ActionResult.success(list);
}
}

@ -0,0 +1,115 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
* ()
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-03
*/
@Data
@TableName("nx_recycle_device_config")
public class RecycleDeviceConfigOneEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "DELIVERY_PRICE" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal deliveryPrice;
@TableField(value = "BUCKET1_PRICE" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal bucket1Price;
@TableField(value = "BUCKET2_PRICE" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal bucket2Price;
@TableField(value = "BUCKET3_PRICE" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal bucket3Price;
@TableField(value = "BUCKET4_PRICE" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal bucket4Price;
@TableField(value = "BUCKET5_PRICE" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal bucket5Price;
@TableField(value = "BUCKET6_PRICE" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal bucket6Price;
@TableField(value = "BUCKET7_PRICE" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal bucket7Price;
@TableField(value = "BUCKET8_PRICE" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal bucket8Price;
@TableField(value = "BUCKET9_PRICE" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal bucket9Price;
@TableField(value = "BUCKET10_PRICE" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal bucket10Price;
@TableField(value = "BUCKET11_PRICE" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal bucket11Price;
@TableField(value = "BUCKET12_PRICE" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal bucket12Price;
@TableField(value = "DELIVERY_ADJUST_SET" , updateStrategy = FieldStrategy.IGNORED)
private String deliveryAdjustSet;
@TableField(value = "CLEAN_ADJUST_SET" , updateStrategy = FieldStrategy.IGNORED)
private String cleanAdjustSet;
@TableField(value = "WARNING_WEIGHT" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal warningWeight;
@TableField(value = "CLOSE_DELAY" , updateStrategy = FieldStrategy.IGNORED)
private Integer closeDelay;
@TableField(value = "FULL_SET" , updateStrategy = FieldStrategy.IGNORED)
private String fullSet;
@TableField(value = "SMOG_SET" , updateStrategy = FieldStrategy.IGNORED)
private String smogSet;
@TableField(value = "CLEAN_LOCK" , updateStrategy = FieldStrategy.IGNORED)
private String cleanLock;
@TableField(value = "PROMOTION_SET" , updateStrategy = FieldStrategy.IGNORED)
private String promotionSet;
@TableField(value = "ALLOW_PHONE_LOGIN" , updateStrategy = FieldStrategy.IGNORED)
private String allowPhoneLogin;
@TableField("PROMOTION_SLOGANS")
private String promotionSlogans;
@TableField(value = "PROMOTION_PIC1" , updateStrategy = FieldStrategy.IGNORED)
private String promotionPic1;
@TableField("PROMOTION_PIC2")
private String promotionPic2;
@TableField("PROMOTION_PIC3")
private String promotionPic3;
@TableField("PROMOTION_PIC4")
private String promotionPic4;
@TableField("PROMOTION_PIC5")
private String promotionPic5;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("F_CREATOR_TIME")
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
private String deleteUserId;
@TableField("F_DELETE_MARK")
private String deleteMark;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("ORGANIZE_JSON_ID")
private String organizeJsonId;
@TableField("F_VERSION")
private Integer version;
@TableField("F_FLOW_ID")
private String flowId;
}

@ -0,0 +1,11 @@
package jnpf.model.datainterface;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class DIDeviceListInfoModel implements Serializable {
private List<String> ids;
}

@ -0,0 +1,101 @@
package jnpf.model.recycledeviceconfigone;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* RecycleDeviceConfigOne
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-03
*/
@Data
public class RecycleDeviceConfigOneForm {
/** 主键 */
private String id;
/** 统一投递价格 **/
@JsonProperty("deliveryPrice")
private String deliveryPrice;
/** 1号桶价格 **/
@JsonProperty("bucket1Price")
private String bucket1Price;
/** 2号桶价格 **/
@JsonProperty("bucket2Price")
private String bucket2Price;
/** 3号桶价格 **/
@JsonProperty("bucket3Price")
private String bucket3Price;
/** 4号桶价格 **/
@JsonProperty("bucket4Price")
private String bucket4Price;
/** 5号桶价格 **/
@JsonProperty("bucket5Price")
private String bucket5Price;
/** 6号桶价格 **/
@JsonProperty("bucket6Price")
private String bucket6Price;
/** 7号桶价格 **/
@JsonProperty("bucket7Price")
private String bucket7Price;
/** 8号桶价格 **/
@JsonProperty("bucket8Price")
private String bucket8Price;
/** 9号桶价格 **/
@JsonProperty("bucket9Price")
private String bucket9Price;
/** 10号桶价格 **/
@JsonProperty("bucket10Price")
private String bucket10Price;
/** 11号桶价格 **/
@JsonProperty("bucket11Price")
private String bucket11Price;
/** 12号桶价格 **/
@JsonProperty("bucket12Price")
private String bucket12Price;
/** 投递审核配置 **/
@JsonProperty("deliveryAdjustSet")
private String deliveryAdjustSet;
/** 手机号登录 **/
@JsonProperty("allowPhoneLogin")
private String allowPhoneLogin;
/** 清运锁 **/
@JsonProperty("cleanLock")
private String cleanLock;
/** 清运审核配置 **/
@JsonProperty("cleanAdjustSet")
private String cleanAdjustSet;
/** 烟雾报警 **/
@JsonProperty("smogSet")
private String smogSet;
/** 投递关门 **/
@JsonProperty("closeDelay")
private String closeDelay;
/** 满溢报警 **/
@JsonProperty("fullSet")
private String fullSet;
/** 报警重量 **/
@JsonProperty("warningWeight")
private String warningWeight;
/** 宣传配置 **/
@JsonProperty("promotionSet")
private String promotionSet;
/** 宣传标语 **/
@JsonProperty("promotionalSlogans")
private String promotionalSlogans;
/** 宣传海报 **/
@JsonProperty("promotionPic1")
private Object promotionPic1;
/** 修改用户 **/
@JsonProperty("lastModifyUserId")
private String lastModifyUserId;
/** 修改时间 **/
@JsonProperty("lastModifyTime")
private String lastModifyTime;
/** 组织架构 **/
@JsonProperty("organizeJsonId")
private Object organizeJsonId;
}

@ -0,0 +1,33 @@
package jnpf.model.recycledeviceconfigone;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* RecycleDeviceConfigOne
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-03
*/
@Data
public class RecycleDeviceConfigOnePagination extends Pagination {
/** 查询key */
private String[] selectKey;
/** json */
private String json;
/** 数据类型 0-当前页1-全部数据 */
private String dataType;
/** 高级查询 */
private String superQueryJson;
/** 功能id */
private String moduleId;
/** 菜单id */
private String menuId;
/** 当前商户 */
@JsonProperty("organizeJsonId")
private Object organizeJsonId;
}

@ -194,3 +194,28 @@ export function cmdBucket(cmd, deviceCode, bucketCode) {
break;
}
}
// 获取设备列表
export function getDeviceListOption() {
return request({
url: `/api/scm/RecycleDevice/getDeviceListOption`,
method: "POST"
});
}
// 获取设备信息
export function getDeviceListInfo(query) {
// let query = {
// ids: [this.value]
// };
return request({
url: `/api/scm/RecycleDevice/getDeviceListInfo`,
method: "POST",
data: query
});
}
// 获取商户列表
export function getCompanyList() {
return request({
url: `/api/scm/RecycleDevice/getCompanyList`,
method: "POST"
});
}

@ -0,0 +1,526 @@
<template>
<div class="popupSelect-container">
<div class="el-select" @click="openDialog">
<el-input
:placeholder="placeholder"
v-model="innerValue"
readonly
:validate-event="false"
@mouseenter.native="inputHovering = true"
@mouseleave.native="inputHovering = false"
>
<template slot="suffix">
<i
v-show="!showClose"
:class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up']"
></i>
<i
v-if="showClose"
class="el-select__caret el-input__icon el-icon-circle-close"
@click="clear"
></i>
</template>
</el-input>
</div>
<template v-if="popupType === 'dialog'">
<el-dialog
:title="popupTitle"
:close-on-click-modal="false"
:visible.sync="visible"
v-if="visible"
class="JNPF-dialog JNPF-dialog_center"
lock-scroll
append-to-body
:width="popupWidth"
>
<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="listQuery.keyword"
placeholder="请输入关键词查询"
clearable
@keyup.enter.native="search()"
class="search-input"
/>
</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="reset()"
>{{ $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="initData()"
/>
</el-tooltip>
</div>
</el-row>
<JNPF-table
v-loading="listLoading"
:data="list"
:border="false"
highlight-current-row
@row-click="rowClick"
:hasNO="false"
>
<el-table-column width="35">
<template slot-scope="scope">
<el-radio :label="scope.row[propsValue]" v-model="checked"
>&nbsp;</el-radio
>
</template>
</el-table-column>
<el-table-column
type="index"
width="50"
label="序号"
align="center"
/>
<el-table-column
:prop="item.value"
:label="item.label"
v-for="(item, i) in columnOptions"
:key="i"
/>
</JNPF-table>
<pagination
:total="total"
:page.sync="listQuery.currentPage"
:limit.sync="listQuery.pageSize"
@pagination="initData"
v-if="hasPage"
/>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false" size="small">{{
$t("common.cancelButton")
}}</el-button>
<el-button type="primary" @click="select()" size="small"
>{{ $t("common.confirmButton") }}
</el-button>
</span>
</el-dialog>
</template>
<template v-if="popupType === 'drawer'">
<el-drawer
:title="popupTitle"
:visible.sync="visible"
:wrapperClosable="false"
ref="drawer"
:size="popupWidth"
append-to-body
class="JNPF-common-drawer"
>
<div class="JNPF-flex-main">
<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="listQuery.keyword"
placeholder="请输入关键词查询"
clearable
@keyup.enter.native="search()"
class="search-input"
/>
</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="reset()"
>{{ $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="initData()"
/>
</el-tooltip>
</div>
</el-row>
<JNPF-table
v-loading="listLoading"
:data="list"
:border="false"
highlight-current-row
@row-click="rowClick"
:hasNO="false"
>
<el-table-column width="35">
<template slot-scope="scope">
<el-radio :label="scope.row[propsValue]" v-model="checked"
>&nbsp;</el-radio
>
</template>
</el-table-column>
<el-table-column
type="index"
width="50"
label="序号"
align="center"
/>
<el-table-column
:prop="item.value"
:label="item.label"
v-for="(item, i) in columnOptions"
:key="i"
/>
</JNPF-table>
<pagination
:total="total"
:page.sync="listQuery.currentPage"
:limit.sync="listQuery.pageSize"
@pagination="initData"
v-if="hasPage"
/>
<div class="drawer-footer">
<el-button @click="visible = false" size="small"
>{{ $t("common.cancelButton") }}
</el-button>
<el-button type="primary" @click="select()" size="small"
>{{ $t("common.confirmButton") }}
</el-button>
</div>
</div>
</el-drawer>
</template>
</div>
</template>
<script>
import {
getDataInterfaceDataSelect,
getDataInterfaceDataInfoByIds
} from "@/api/systemData/dataInterface";
import emitter from "element-ui/src/mixins/emitter";
import { getDeviceListOption, getDeviceListInfo } from "@/api/device";
let {
methods: { dispatch }
} = emitter;
export default {
name: "PopupSelectDeviceCode",
props: {
value: {
default: ""
},
rowIndex: {
default: null
},
formData: {
type: Object
},
templateJson: {
type: Array,
default: () => []
},
interfaceId: {
type: String,
default: ""
},
placeholder: {
type: String,
default: "请选择"
},
propsValue: {
type: String,
default: "id"
},
relationField: {
type: String,
default: "fullName"
},
popupType: {
type: String,
default: "dialog"
},
popupTitle: {
type: String,
default: "选择数据"
},
popupWidth: {
type: String,
default: "800px"
},
field: {
type: String,
default: ""
},
columnOptions: {
type: Array,
default: () => []
},
hasPage: {
type: Boolean,
default: false
},
pageSize: {
type: Number,
default: 20
},
multiple: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
},
clearable: {
type: Boolean,
default: true
}
},
model: {
prop: "value",
event: "input"
},
data() {
return {
list: [],
innerValue: "",
listQuery: {
keyword: "",
currentPage: 1,
pageSize: 20
},
total: 0,
checked: "",
checkedTxt: "",
checkedRow: {},
listLoading: false,
visible: false,
inputHovering: false
};
},
watch: {
value(val) {
this.setDefault();
}
},
computed: {
showClose() {
let hasValue = this.multiple
? Array.isArray(this.value) && this.value.length > 0
: this.value !== undefined && this.value !== null && this.value !== "";
let criteria =
this.clearable && !this.disabled && this.inputHovering && hasValue;
return criteria;
},
propsLabel() {
return this.columnOptions[0].value;
}
},
created() {
this.listQuery.pageSize = this.hasPage ? this.pageSize : 100000;
this.setDefault();
},
methods: {
initData() {
if (!this.interfaceId) return;
this.listLoading = true;
// const paramList = this.getParamList();
// const columnOptions = this.columnOptions.map(o => o.value);
// let query = {
// ...this.listQuery,
// interfaceId: this.interfaceId,
// propsValue: this.propsValue,
// relationField: this.relationField,
// columnOptions: columnOptions.join(","),
// paramList
// };
// console.log(query);
// getDataInterfaceDataSelect(this.interfaceId, query)
// .then(res => {
// this.list = res.data.list;
// this.total = res.data.pagination.total;
// this.listLoading = false;
// console.log(this.list);
// console.log((this.total = res.data.pagination.total));
// })
// .catch(() => {
// this.listLoading = false;
// });
getDeviceListOption()
.then(res => {
this.list = res.data;
this.total = res.data.length;
this.listLoading = false;
})
.catch(() => {
this.listLoading = false;
});
},
getParamList() {
let templateJson = this.templateJson;
if (!this.formData) return templateJson;
for (let i = 0; i < templateJson.length; i++) {
if (templateJson[i].relationField) {
if (templateJson[i].relationField.includes("-")) {
let tableVModel = templateJson[i].relationField.split("-")[0];
let childVModel = templateJson[i].relationField.split("-")[1];
templateJson[i].defaultValue =
(this.formData[tableVModel] &&
this.formData[tableVModel][this.rowIndex] &&
this.formData[tableVModel][this.rowIndex][childVModel]) ||
"";
} else {
templateJson[i].defaultValue =
this.formData[templateJson[i].relationField] || "";
}
}
}
return templateJson;
},
interfaceDataHandler(data) {
if (!data.dataProcessing) return data.list;
const dataHandler = this.jnpf.getScriptFunc.call(
this,
data.dataProcessing
);
if (!dataHandler) return data.list;
return dataHandler(data.list);
},
search() {
this.initData();
this.listQuery.currentPage = 1;
this.listQuery.pageSize = this.hasPage ? this.pageSize : 10000;
},
reset() {
this.listQuery.keyword = "";
this.listQuery.currentPage = 1;
this.listQuery.pageSize = this.hasPage ? this.pageSize : 10000;
this.initData();
},
openDialog() {
if (this.disabled) return;
this.checked = this.value;
this.visible = true;
this.reset();
},
clear(event) {
this.checked = "";
this.innerValue = "";
this.checkedRow = {};
this.$emit("input", this.checked);
this.$emit("change", this.checked, this.checkedRow);
dispatch.call(this, "ElFormItem", "el.form.change", this.checked);
event.stopPropagation();
},
select() {
if (!this.checked) return;
this.innerValue = this.checkedTxt;
console.log(this.checked);
console.log(this.checkedRow);
this.$emit("input", this.checked);
// this.$emit("change", this.checked, this.checkedRow);
// dispatch.call(this, "ElFormItem", "el.form.change", this.checked);
this.visible = false;
},
rowClick(row) {
this.checked = row[this.propsValue];
this.checkedTxt = row[this.relationField];
this.checkedRow = row;
},
setDefault() {
console.log("zzzzzzzzzzz");
if (this.value) {
console.log(this.value);
if (!this.interfaceId) return;
const paramList = this.getParamList();
// let query = {
// ids: [this.value],
// interfaceId: this.interfaceId,
// propsValue: this.propsValue,
// relationField: this.relationField,
// paramList
// };
let query = {
ids: [this.value]
};
console.log(this.interfaceId);
console.log(this.value);
getDeviceListInfo(query).then(res => {
const data = res.data && res.data.length ? res.data[0] : {};
this.innerValue = data[this.relationField];
if (!this.field) return;
let relationData = this.$store.state.generator.relationData;
console.log(relationData)
console.log(this.field)
this.$set(relationData, this.field, data);
this.$eventBus.$emit("popupAttrEventBus", relationData, this.field);
this.$store.commit("generator/UPDATE_RELATION_DATA", relationData);
});
// getDataInterfaceDataInfoByIds(this.interfaceId, query).then(res => {
// console.log(res);
// const data = res.data && res.data.length ? res.data[0] : {};
// this.innerValue = data[this.relationField];
// if (!this.field) return;
// let relationData = this.$store.state.generator.relationData;
// this.$set(relationData, this.field, data);
// this.$eventBus.$emit("popupAttrEventBus", relationData, this.field);
// this.$store.commit("generator/UPDATE_RELATION_DATA", relationData);
// });
} else {
this.innerValue = "";
if (!this.field) return;
let relationData = this.$store.state.generator.relationData;
this.$set(relationData, this.field, {});
this.$eventBus.$emit("popupAttrEventBus", relationData, this.field);
this.$store.commit("generator/UPDATE_RELATION_DATA", relationData);
}
}
}
};
</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>

@ -43,6 +43,7 @@ import JnpfUsersSelect from '@/components/Jnpf/UsersSelect'
import JnpfRoleSelect from '@/components/Jnpf/RoleSelect'
import JnpfInputTable from '@/components/Jnpf/InputTable'
import JnpfPopupSelect from '@/components/Jnpf/PopupSelect'
import PopupSelectDeviceCode from '@/components/Jnpf/PopupSelectDeviceCode'
import JnpfPopupTableSelect from '@/components/Jnpf/PopupTableSelect'
import JnpfPopupAttr from '@/components/Jnpf/PopupAttr'
import JnpfRelationForm from '@/components/Jnpf/RelationForm'
@ -112,6 +113,7 @@ export default {
Vue.component('JnpfRoleSelect', JnpfRoleSelect)
Vue.component('JnpfInputTable', JnpfInputTable)
Vue.component('JnpfPopupSelect', JnpfPopupSelect)
Vue.component('PopupSelectDeviceCode', PopupSelectDeviceCode)
Vue.component('JnpfPopupTableSelect', JnpfPopupTableSelect)
Vue.component('JnpfPopupAttr', JnpfPopupAttr)
Vue.component('JnpfRelationForm', JnpfRelationForm)

@ -60,18 +60,18 @@
<!-- 具体表单 -->
<el-col :span="8">
<jnpf-form-tip-item label="设备编码" prop="deviceCode">
<JnpfPopupSelect
<PopupSelectDeviceCode
v-model="dataForm.deviceCode"
@change="changeData('deviceCode', -1)"
:rowIndex="null"
:formData="dataForm"
:templateJson="interfaceRes.deviceCode"
placeholder="请选择"
propsValue="device_code"
propsValue="deviceCode"
popupWidth="800px"
popupTitle="选择数据"
popupType="dialog"
relationField="device_name"
relationField="deviceName"
field="deviceCode"
interfaceId="564713894723988869"
:pageSize="20"
@ -79,7 +79,7 @@
clearable
:style="{ width: '100%' }"
>
</JnpfPopupSelect>
</PopupSelectDeviceCode>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
@ -576,8 +576,8 @@ export default {
// ]
},
deviceCodecolumnOptions: [
{ label: "设备编码", value: "device_code" },
{ label: "设备名称", value: "device_name" }
{ label: "设备编码", value: "deviceCode" },
{ label: "设备名称", value: "deviceName" }
],
productCodeOptions: [],
productCodeProps: { label: "name", value: "id" },
@ -607,7 +607,7 @@ export default {
{
dataType: "varchar",
defaultValue: "",
field: "device_code",
field: "deviceCode",
fieldName: "",
id: "ow3vw72",
jnpfKey: "select",

File diff suppressed because it is too large Load Diff

@ -0,0 +1,310 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
<div class="JNPF-common-page-header">
<el-page-header @back="goBack"
content="详情"/>
<div class="options">
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
<el-form ref="formRef" :model="dataForm" size="medium" label-width="150px" label-position="right" >
<template v-if="!loading">
<el-col :span="24">
<el-collapse :accordion="false" v-model="activebufuev" class="mb-20">
<el-collapse-item title="价格配置" name="1">
<el-col :span="8" >
<jnpf-form-tip-item label="统一投递价格"
prop="deliveryPrice" >
<p>{{dataForm.deliveryPrice}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label-width="0">
<JnpfAlert
:show-icon= "true" type="success" :closable= "false" title ="温馨提示" description ="当前画面对本商户下的所有投递柜统一配置回收结算价格,若《回收桶配置》画面针对单个桶配置了回收价格,则优先按照《回收桶配置》中的价格结算!!!" >
</JnpfAlert>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="1号桶价格"
prop="bucket1Price" >
<p>{{dataForm.bucket1Price}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="2号桶价格"
prop="bucket2Price" >
<p>{{dataForm.bucket2Price}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="3号桶价格"
prop="bucket3Price" >
<p>{{dataForm.bucket3Price}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="4号桶价格"
prop="bucket4Price" >
<p>{{dataForm.bucket4Price}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="5号桶价格"
prop="bucket5Price" >
<p>{{dataForm.bucket5Price}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="6号桶价格"
prop="bucket6Price" >
<p>{{dataForm.bucket6Price}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="7号桶价格"
prop="bucket7Price" >
<p>{{dataForm.bucket7Price}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="8号桶价格"
prop="bucket8Price" >
<p>{{dataForm.bucket8Price}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="9号桶价格"
prop="bucket9Price" >
<p>{{dataForm.bucket9Price}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="10号桶价格"
prop="bucket10Price" >
<p>{{dataForm.bucket10Price}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="11号桶价格"
prop="bucket11Price" >
<p>{{dataForm.bucket11Price}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="12号桶价格"
prop="bucket12Price" >
<p>{{dataForm.bucket12Price}}</p>
</jnpf-form-tip-item>
</el-col>
</el-collapse-item>
<el-collapse-item title="设备配置" name="2">
<el-col :span="8" >
<jnpf-form-tip-item label="投递审核配置 "
prop="deliveryAdjustSet" tip-label="投递后审核结算" >
<p>{{ dataForm.deliveryAdjustSet }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="手机号登录"
prop="allowPhoneLogin" tip-label="投递柜手机号登录入库" >
<p>{{dataForm.allowPhoneLogin}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="清运锁"
prop="cleanLock" tip-label="清运时是否输入垃圾袋编号" >
<p>{{dataForm.cleanLock}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="清运审核配置"
prop="cleanAdjustSet" tip-label="清运数据审核入库" >
<p>{{ dataForm.cleanAdjustSet }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="烟雾报警"
prop="smogSet" tip-label="烟雾报警事件上报" >
<p>{{dataForm.smogSet}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="投递关门"
prop="closeDelay" >
<p>{{dataForm.closeDelay}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="满溢报警"
prop="fullSet" tip-label="满溢时发送通知" >
<p>{{dataForm.fullSet}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="报警重量"
prop="warningWeight" >
<p>{{dataForm.warningWeight}}KG</p>
</jnpf-form-tip-item>
</el-col>
</el-collapse-item>
<el-collapse-item title="宣传配置" name="BwNYw72">
<el-col :span="24" >
<jnpf-form-tip-item label-width="0">
<JnpfAlert
:show-icon= "true" type="success" :closable= "false" title ="温馨提示" description ="开启宣传配置后,投递柜将在空闲时播报宣传标语,播放宣传海报" >
</JnpfAlert>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="宣传配置"
prop="promotionSet" tip-label="开启空闲设备宣传" >
<p>{{dataForm.promotionSet}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="宣传标语"
prop="promotionalSlogans" tip-label="宣传标语" >
<p>{{dataForm.promotionalSlogans}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="宣传海报"
prop="promotionPic1" tip-label="设备空闲时展示海报" >
<JnpfUploadImg v-model="dataForm.promotionPic1"
disabled
detailed :fileSize="2" sizeUnit="MB" :limit="5" pathType="defaultPath" :isAccount="0" >
</JnpfUploadImg>
</jnpf-form-tip-item>
</el-col>
</el-collapse-item>
</el-collapse>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="修改用户"
prop="lastModifyUserId" >
<p>{{dataForm.lastModifyUserId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="修改时间"
prop="lastModifyTime" >
<p>{{dataForm.lastModifyTime}}</p>
</jnpf-form-tip-item>
</el-col>
</template>
</el-form>
</el-row>
</div>
</transition>
</template>
<script>
import request from '@/utils/request'
import { getConfigData } from '@/api/onlineDev/visualDev'
import jnpf from '@/utils/jnpf'
import Detail from '@/views/basic/dynamicModel/list/detail'
import { thousandsFormat } from "@/components/Generator/utils/index"
export default {
components: { Detail},
props: [],
data() {
return {
visible: false,
detailVisible: false,
loading: false,
dataForm: {
id :'',
deliveryPrice : '',
bucket1Price : '',
bucket2Price : '',
bucket3Price : '',
bucket4Price : '',
bucket5Price : '',
bucket6Price : '',
bucket7Price : '',
bucket8Price : '',
bucket9Price : '',
bucket10Price : '',
bucket11Price : '',
bucket12Price : '',
deliveryAdjustSet : "",
allowPhoneLogin : "",
cleanLock : "",
cleanAdjustSet : "",
smogSet : "",
closeDelay : '',
fullSet : "",
warningWeight : '',
promotionSet : "",
promotionalSlogans : '',
promotionPic1 : [],
lastModifyUserId : "",
lastModifyTime : "",
organizeJsonId : "",
},
activebufuev:["1","2","BwNYw72"],
deliveryAdjustSetOptions:[{"fullName":"即时自动","id":"1"},{"fullName":"24H自动","id":"2"},{"fullName":"48H自动","id":"3"}],
deliveryAdjustSetProps:{"label":"fullName","value":"id" },
allowPhoneLoginProps:{"label":"fullName","value":"enCode" },
cleanLockProps:{"label":"fullName","value":"enCode" },
cleanAdjustSetOptions:[{"fullName":"自动","id":"1"},{"fullName":"手动","id":"2"}],
cleanAdjustSetProps:{"label":"fullName","value":"id" },
smogSetProps:{"label":"fullName","value":"enCode" },
fullSetProps:{"label":"fullName","value":"enCode" },
promotionSetProps:{"label":"fullName","value":"enCode" },
}
},
computed: {},
watch: {},
created() {
},
mounted() {},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(formData, modelId, defaultValue)
})
})
},
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
},
goBack() {
this.$emit('refresh')
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/scm/RecycleDeviceConfigOne/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
})
},
},
}
</script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,871 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<div class="JNPF-common-page-header">
<el-page-header @back="goBack"
:content="!dataForm.id ? '新建':'编辑'"/>
<div class="options">
<el-dropdown class="dropdown" placement="bottom">
<el-button style="width:70px">
<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<template v-if="dataForm.id">
<el-dropdown-item @click.native="prev" :disabled='prevDis'>
{{'上一条'}}
</el-dropdown-item>
<el-dropdown-item @click.native="next" :disabled='nextDis'>
{{'下一条'}}
</el-dropdown-item>
</template>
<el-dropdown-item type="primary" @click.native="dataFormSubmit(2)"
:loading="continueBtnLoading" :disabled='btnLoading'>
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading" :disabled='continueBtnLoading'> </el-button>
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="medium" label-width="150px" label-position="right" >
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="24">
<el-collapse :accordion="false" v-model="activebufuev" class="mb-20">
<el-collapse-item title="价格配置" name="1">
<el-col :span="8" >
<jnpf-form-tip-item
label="统一投递价格" prop="deliveryPrice" >
<JnpfInput v-model="dataForm.deliveryPrice" @change="changeData('deliveryPrice',-1)"
placeholder="请输入金额" addonAfter="元" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item>
<JnpfAlert
title='温馨提示' description="当前画面对本商户下的所有投递柜统一配置回收结算价格,若《回收桶配置》画面针对单个桶配置了回收价格,则优先按照《回收桶配置》中的价格结算!!!" showIcon type='success'>
</JnpfAlert>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="1号桶价格" prop="bucket1Price" >
<JnpfInput v-model="dataForm.bucket1Price" @change="changeData('bucket1Price',-1)"
placeholder="请输入金额" addonAfter="元" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="2号桶价格" prop="bucket2Price" >
<JnpfInput v-model="dataForm.bucket2Price" @change="changeData('bucket2Price',-1)"
placeholder="请输入金额" addonAfter="元" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="3号桶价格" prop="bucket3Price" >
<JnpfInput v-model="dataForm.bucket3Price" @change="changeData('bucket3Price',-1)"
placeholder="请输入金额" addonAfter="元" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="4号桶价格" prop="bucket4Price" >
<JnpfInput v-model="dataForm.bucket4Price" @change="changeData('bucket4Price',-1)"
placeholder="请输入金额" addonAfter="元" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="5号桶价格" prop="bucket5Price" >
<JnpfInput v-model="dataForm.bucket5Price" @change="changeData('bucket5Price',-1)"
placeholder="请输入金额" addonAfter="元" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="6号桶价格" prop="bucket6Price" >
<JnpfInput v-model="dataForm.bucket6Price" @change="changeData('bucket6Price',-1)"
placeholder="请输入金额" addonAfter="元" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="7号桶价格" prop="bucket7Price" >
<JnpfInput v-model="dataForm.bucket7Price" @change="changeData('bucket7Price',-1)"
placeholder="请输入金额" addonAfter="元" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="8号桶价格" prop="bucket8Price" >
<JnpfInput v-model="dataForm.bucket8Price" @change="changeData('bucket8Price',-1)"
placeholder="请输入金额" addonAfter="元" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="9号桶价格" prop="bucket9Price" >
<JnpfInput v-model="dataForm.bucket9Price" @change="changeData('bucket9Price',-1)"
placeholder="请输入金额" addonAfter="元" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="10号桶价格" prop="bucket10Price" >
<JnpfInput v-model="dataForm.bucket10Price" @change="changeData('bucket10Price',-1)"
placeholder="请输入金额" addonAfter="元" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="11号桶价格" prop="bucket11Price" >
<JnpfInput v-model="dataForm.bucket11Price" @change="changeData('bucket11Price',-1)"
placeholder="请输入金额" addonAfter="元" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="12号桶价格" prop="bucket12Price" >
<JnpfInput v-model="dataForm.bucket12Price" @change="changeData('bucket12Price',-1)"
placeholder="请输入金额" addonAfter="元" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
</el-collapse-item>
<el-collapse-item title="设备配置" name="2">
<el-col :span="8" >
<jnpf-form-tip-item
label="投递审核配置 " tipLabel="投递后审核结算" prop="deliveryAdjustSet" >
<JnpfRadio v-model="dataForm.deliveryAdjustSet" @change="changeData('deliveryAdjustSet',-1)"
optionType="button" direction="horizontal" size="small" :options="deliveryAdjustSetOptions" :props="deliveryAdjustSetProps" >
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="手机号登录" tipLabel="投递柜手机号登录入库" prop="allowPhoneLogin" >
<JnpfRadio v-model="dataForm.allowPhoneLogin" @change="changeData('allowPhoneLogin',-1)"
optionType="button" direction="horizontal" size="small" :options="allowPhoneLoginOptions" :props="allowPhoneLoginProps" >
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="清运锁" tipLabel="清运时是否输入垃圾袋编号" prop="cleanLock" >
<JnpfRadio v-model="dataForm.cleanLock" @change="changeData('cleanLock',-1)"
optionType="button" direction="horizontal" size="small" :options="cleanLockOptions" :props="cleanLockProps" >
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="清运审核配置" tipLabel="清运数据审核入库" prop="cleanAdjustSet" >
<JnpfRadio v-model="dataForm.cleanAdjustSet" @change="changeData('cleanAdjustSet',-1)"
optionType="button" direction="horizontal" size="small" :options="cleanAdjustSetOptions" :props="cleanAdjustSetProps" >
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="烟雾报警" tipLabel="烟雾报警事件上报" prop="smogSet" >
<JnpfRadio v-model="dataForm.smogSet" @change="changeData('smogSet',-1)"
optionType="button" direction="horizontal" size="small" :options="smogSetOptions" :props="smogSetProps" >
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="投递关门" prop="closeDelay" >
<JnpfInput v-model="dataForm.closeDelay" @change="changeData('closeDelay',-1)"
placeholder="请输入" addonAfter="秒" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="满溢报警" tipLabel="满溢时发送通知" prop="fullSet" >
<JnpfRadio v-model="dataForm.fullSet" @change="changeData('fullSet',-1)"
optionType="button" direction="horizontal" size="small" :options="fullSetOptions" :props="fullSetProps" >
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="报警重量" prop="warningWeight" >
<JnpfInput v-model="dataForm.warningWeight" @change="changeData('warningWeight',-1)"
placeholder="请输入" addonAfter="KG" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
</el-collapse-item>
<el-collapse-item title="宣传配置" name="BwNYw72">
<el-col :span="24" >
<jnpf-form-tip-item>
<JnpfAlert
title='温馨提示' description="开启宣传配置后,投递柜将在空闲时播报宣传标语,播放宣传海报" showIcon type='success'>
</JnpfAlert>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="宣传配置" tipLabel="开启空闲设备宣传" prop="promotionSet" >
<JnpfRadio v-model="dataForm.promotionSet" @change="changeData('promotionSet',-1)"
optionType="button" direction="horizontal" size="small" :options="promotionSetOptions" :props="promotionSetProps" >
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="宣传标语" tipLabel="宣传标语" prop="promotionalSlogans" >
<JnpfTextarea v-model="dataForm.promotionalSlogans" @change="changeData('promotionalSlogans',-1)"
placeholder="请输入设备空闲时希望播放的宣传内容" :maxlength="500" :style='{"width":"100%"}' true type="textarea" :autosize='{"minRows":2,"maxRows":4}' >
</JnpfTextarea>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="宣传海报" tipLabel="设备空闲时展示海报" prop="promotionPic1" >
<JnpfUploadImg v-model="dataForm.promotionPic1" @change="changeData('promotionPic1',-1)"
:fileSize="2" sizeUnit="MB" :limit="5" pathType="defaultPath" :isAccount="0" >
</JnpfUploadImg>
</jnpf-form-tip-item>
</el-col>
</el-collapse-item>
</el-collapse>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="修改用户" prop="lastModifyUserId" >
<JnpfInput v-model="dataForm.lastModifyUserId" @change="changeData('lastModifyUserId',-1)"
placeholder="系统自动生成" readonly :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="修改时间" prop="lastModifyTime" >
<JnpfInput v-model="dataForm.lastModifyTime" @change="changeData('lastModifyTime',-1)"
placeholder="系统自动生成" readonly :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
</el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false"/>
</el-row>
</div>
</transition>
</template>
<script>
import request from '@/utils/request'
import {mapGetters} from "vuex";
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getDefaultCurrentValueUserId } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
import { thousandsFormat } from "@/components/Generator/utils/index"
export default {
components: { },
props: [],
data() {
return {
dataFormSubmitType: 0,
continueBtnLoading: false,
index: 0,
prevDis: false,
nextDis: false,
allList: [],
visible: false,
loading: false,
btnLoading: false,
formRef: 'formRef',
setting:{},
eventType: '',
userBoxVisible:false,
selectDialogVisible: false,
currTableConf:{},
dataValueAll:{},
addTableConf:{
},
//
ableAll:{
},
tableRows:{
},
Vmodel:"",
currVmodel:"",
dataForm: {
deliveryPrice : undefined,
bucket1Price : undefined,
bucket2Price : undefined,
bucket3Price : undefined,
bucket4Price : undefined,
bucket5Price : undefined,
bucket6Price : undefined,
bucket7Price : undefined,
bucket8Price : undefined,
bucket9Price : undefined,
bucket10Price : undefined,
bucket11Price : undefined,
bucket12Price : undefined,
deliveryAdjustSet : undefined,
allowPhoneLogin : undefined,
cleanLock : undefined,
cleanAdjustSet : undefined,
smogSet : undefined,
closeDelay : undefined,
fullSet : undefined,
warningWeight : undefined,
promotionSet : undefined,
promotionalSlogans : undefined,
promotionPic1 : [],
lastModifyUserId : undefined,
lastModifyTime : undefined,
organizeJsonId : undefined,
},
tableRequiredData: {},
activebufuev:["1","2","BwNYw72"],
dataRule:
{
deliveryPrice: [
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
},
],
bucket1Price: [
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
},
],
bucket2Price: [
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
},
],
bucket3Price: [
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
},
],
bucket4Price: [
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
},
],
bucket5Price: [
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
},
],
bucket6Price: [
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
},
],
bucket7Price: [
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
},
],
bucket8Price: [
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
},
],
bucket9Price: [
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
},
],
bucket10Price: [
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
},
],
bucket11Price: [
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
},
],
bucket12Price: [
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
},
],
deliveryAdjustSet: [
{
required: true,
message: '不能为空',
trigger: 'change'
},
],
allowPhoneLogin: [
{
required: true,
message: '不能为空',
trigger: 'change'
},
],
cleanLock: [
{
required: true,
message: '不能为空',
trigger: 'change'
},
],
cleanAdjustSet: [
{
required: true,
message: '不能为空',
trigger: 'change'
},
],
smogSet: [
{
required: true,
message: '不能为空',
trigger: 'change'
},
],
fullSet: [
{
required: true,
message: '不能为空',
trigger: 'change'
},
],
warningWeight: [
{
pattern: /^\d+$/,
message: '请输入正确的重量',
trigger: 'blur'
},
],
promotionSet: [
{
required: true,
message: '不能为空',
trigger: 'change'
},
],
},
deliveryAdjustSetOptions:[{"fullName":"即时自动","id":"1"},{"fullName":"24H自动","id":"2"},{"fullName":"48H自动","id":"3"}],
deliveryAdjustSetProps:{"label":"fullName","value":"id" },
allowPhoneLoginOptions:[],
allowPhoneLoginProps:{"label":"fullName","value":"enCode" },
cleanLockOptions:[],
cleanLockProps:{"label":"fullName","value":"enCode" },
cleanAdjustSetOptions:[{"fullName":"自动","id":"1"},{"fullName":"手动","id":"2"}],
cleanAdjustSetProps:{"label":"fullName","value":"id" },
smogSetOptions:[],
smogSetProps:{"label":"fullName","value":"enCode" },
fullSetOptions:[],
fullSetProps:{"label":"fullName","value":"enCode" },
promotionSetOptions:[],
promotionSetProps:{"label":"fullName","value":"enCode" },
childIndex:-1,
isEdit:false,
interfaceRes: {
deliveryPrice:[] ,
bucket1Price:[] ,
bucket2Price:[] ,
bucket3Price:[] ,
bucket4Price:[] ,
bucket5Price:[] ,
bucket6Price:[] ,
bucket7Price:[] ,
bucket8Price:[] ,
bucket9Price:[] ,
bucket10Price:[] ,
bucket11Price:[] ,
bucket12Price:[] ,
deliveryAdjustSet:[] ,
allowPhoneLogin:[] ,
cleanLock:[] ,
cleanAdjustSet:[] ,
smogSet:[] ,
closeDelay:[] ,
fullSet:[] ,
warningWeight:[] ,
promotionSet:[] ,
promotionalSlogans:[] ,
promotionPic1:[] ,
lastModifyUserId:[] ,
lastModifyTime:[] ,
organizeJsonId:[] ,
},
}
},
computed: {
...mapGetters(['userInfo'])
},
watch: {},
created() {
this.dataAll()
this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() {},
methods: {
prev() {
this.index--
if (this.index === 0) {
this.prevDis = true
}
this.nextDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
next() {
this.index++
if (this.index === this.allList.length - 1) {
this.nextDis = true
}
this.prevDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
getInfo(id) {
request({
url: '/api/scm/RecycleDeviceConfigOne/'+ id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
});
},
goBack() {
this.visible = false
this.$emit('refreshDataList', true)
},
changeData(model, index) {
this.isEdit = false
this.childIndex = index
let modelAll = model.split("-");
let faceMode = "";
for (let i = 0; i < modelAll.length; i++) {
faceMode += modelAll[i];
}
for (let key in this.interfaceRes) {
if (key != faceMode) {
let faceReList = this.interfaceRes[key]
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options';
if(this[options]){
this[options]()
}
this.changeData(key, index)
}
}
}
}
},
changeDataFormData(type, data, model,index,defaultValue) {
if(!this.isEdit) {
if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) {
this.dataForm[data][i][model] = defaultValue
} else if (index == i) {
this.dataForm[data][i][model] = defaultValue
}
}
} else {
this.dataForm[data] = defaultValue
}
}
},
dataAll(){
this.getallowPhoneLoginOptions();
this.getcleanLockOptions();
this.getsmogSetOptions();
this.getfullSetOptions();
this.getpromotionSetOptions();
},
getallowPhoneLoginOptions() {
getDictionaryDataSelector('565902955111256581').then(res => {
this.allowPhoneLoginOptions = res.data.list
})
},
getcleanLockOptions() {
getDictionaryDataSelector('565902955111256581').then(res => {
this.cleanLockOptions = res.data.list
})
},
getsmogSetOptions() {
getDictionaryDataSelector('565902955111256581').then(res => {
this.smogSetOptions = res.data.list
})
},
getfullSetOptions() {
getDictionaryDataSelector('565902955111256581').then(res => {
this.fullSetOptions = res.data.list
})
},
getpromotionSetOptions() {
getDictionaryDataSelector('565902955111256581').then(res => {
this.promotionSetOptions = res.data.list
})
},
goBack() {
this.$emit('refresh')
},
clearData(){
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
init(id,isDetail,allList) {
this.prevDis = false
this.nextDis = false
this.allList = allList || []
if (allList.length) {
this.index = this.allList.findIndex(item => item.id === id)
if (this.index == 0) {
this.prevDis = true
}
if (this.index == this.allList.length - 1) {
this.nextDis = true
}
} else {
this.prevDis = true
this.nextDis = true
}
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/scm/RecycleDeviceConfigOne/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
}else{
this.clearData()
this.initDefaultData()
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
initDefaultData() {
},
//
dataFormSubmit(type) {
this.dataFormSubmitType = type ? type : 0
this.$refs['formRef'].validate((valid) => {
if (valid) {
this.request()
}
})
},
request() {
let _data =this.dataList()
if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true
} else {
this.btnLoading = true
}
if (!this.dataForm.id) {
request({
url: '/api/scm/RecycleDeviceConfigOne',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) {
this.$nextTick(() => {
this.clearData()
this.initDefaultData()
})
this.continueBtnLoading = false
return
}
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
}
})
}).catch(()=>{
this.btnLoading = false
this.continueBtnLoading = false
})
}else{
request({
url: '/api/scm/RecycleDeviceConfigOne/'+this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) return this.continueBtnLoading = false
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
}
})
}).catch(()=>{
this.btnLoading = false
this.continueBtnLoading = false
})
}
},
openSelectDialog(key) {
this.currTableConf=this.addTableConf[key]
this.currVmodel=key
this.selectDialogVisible = true
this.$nextTick(() => {
this.$refs.selectDialog.init()
})
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i]
if(this['get'+this.currVmodel]){
this['get'+this.currVmodel](t)
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData)
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = new Date().getTime()
} else if (timeType == 4) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
}
} else if (timeType == 5) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
let timeDataValue = null
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || '00:00:00'
if (timeDataValue.split(':').length == 3) {
timeDataValue = timeDataValue
} else {
timeDataValue = timeDataValue + ':00'
}
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format)
} else if (timeType == 4) {
let previousDate = '';
previousDate = getBeforeTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
} else if (timeType == 5) {
let previousDate = '';
previousDate = getLaterTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
}
}
return timeDataValue;
},
dataList(){
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
this.childIndex=-1
},
},
}
</script>

@ -0,0 +1,582 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="当前商户">
<JnpfOrganizeSelect
v-model="query.organizeJsonId"
placeholder="请选择"
:lastLevel="false"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"
>查询</el-button
>
<el-button icon="el-icon-refresh-right" @click="reset()"
>重置</el-button
>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button
type="primary"
icon="icon-ym icon-ym-btn-add"
v-has="'btn_add'"
@click="addOrUpdateHandle()"
>新增
</el-button>
</div>
<div class="JNPF-common-head-right">
<el-tooltip content="高级查询" placement="top" v-if="true">
<el-link
icon="icon-ym icon-ym-filter JNPF-common-head-icon"
:underline="false"
@click="openSuperQuery()"
/>
</el-tooltip>
<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="initData()"
/>
</el-tooltip>
</div>
</div>
<JNPF-table
v-loading="listLoading"
:data="list"
@sort-change="sortChange"
:span-method="arraySpanMethod"
>
<el-table-column prop="organizeJsonId" label="组织架构" align="left">
</el-table-column>
<el-table-column
prop="deliveryPrice"
label="统一投递价格"
align="left"
>
</el-table-column>
<el-table-column prop="bucket1Price" label="1号桶价格" align="left">
</el-table-column>
<el-table-column prop="bucket2Price" label="2号桶价格" align="left">
</el-table-column>
<el-table-column prop="bucket3Price" label="3号桶价格" align="left">
</el-table-column>
<el-table-column prop="bucket4Price" label="4号桶价格" align="left">
</el-table-column>
<el-table-column prop="bucket5Price" label="5号桶价格" align="left">
</el-table-column>
<el-table-column prop="bucket6Price" label="6号桶价格" align="left">
</el-table-column>
<el-table-column prop="bucket7Price" label="7号桶价格" align="left">
</el-table-column>
<el-table-column prop="bucket8Price" label="8号桶价格" align="left">
</el-table-column>
<el-table-column prop="bucket9Price" label="9号桶价格" align="left">
</el-table-column>
<el-table-column prop="bucket10Price" label="10号桶价格" align="left">
</el-table-column>
<el-table-column prop="bucket11Price" label="11号桶价格" align="left">
</el-table-column>
<el-table-column prop="bucket12Price" label="12号桶价格" align="left">
</el-table-column>
<el-table-column
prop="allowPhoneLogin"
label="手机号登录"
align="left"
>
</el-table-column>
<el-table-column prop="closeDelay" label="投递关门" align="left">
</el-table-column>
<el-table-column prop="warningWeight" label="报警重量" align="left">
</el-table-column>
<el-table-column
label="投递审核配置 "
prop="deliveryAdjustSet"
algin="left"
>
<template slot-scope="scope">
{{ scope.row.deliveryAdjustSet }}
</template>
</el-table-column>
<el-table-column
label="清运审核配置"
prop="cleanAdjustSet"
algin="left"
>
<template slot-scope="scope">
{{ scope.row.cleanAdjustSet }}
</template>
</el-table-column>
<el-table-column prop="cleanLock" label="清运锁" align="left">
</el-table-column>
<el-table-column prop="fullSet" label="满溢报警" align="left">
</el-table-column>
<el-table-column prop="smogSet" label="烟雾报警" align="left">
</el-table-column>
<el-table-column prop="promotionSet" label="宣传配置" align="left">
</el-table-column>
<el-table-column
prop="promotionalSlogans"
label="宣传标语"
align="left"
>
</el-table-column>
<el-table-column
prop="lastModifyUserId"
label="修改用户"
align="left"
>
</el-table-column>
<el-table-column prop="lastModifyTime" label="修改时间" align="left">
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button
type="text"
@click="addOrUpdateHandle(scope.row)"
v-has="'btn_edit'"
>编辑
</el-button>
<el-button
type="text"
class="JNPF-table-delBtn"
v-has="'btn_remove'"
@click="handleDel(scope.row.id)"
>删除
</el-button>
<el-button
type="text"
v-has="'btn_detail'"
@click="goDetail(scope.row.id)"
>详情
</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination
:total="total"
:page.sync="listQuery.currentPage"
:limit.sync="listQuery.pageSize"
@pagination="initData"
/>
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail
v-if="detailVisible"
ref="Detail"
@refresh="detailVisible = false"
/>
<ToFormDetail
v-if="toFormDetailVisible"
ref="toFormDetail"
@close="toFormDetailVisible = false"
/>
<SuperQuery
v-if="superQueryVisible"
ref="SuperQuery"
:columnOptions="superQueryJson"
@superQuery="superQuery"
/>
</div>
</template>
<script>
import request from "@/utils/request";
import { mapGetters } from "vuex";
import { getDictionaryDataSelector } from "@/api/systemData/dictionary";
import JNPFForm from "./form";
import Detail from "./Detail";
import ExportBox from "@/components/ExportBox";
import ToFormDetail from "@/views/basic/dynamicModel/list/detail";
import { getDataInterfaceRes } from "@/api/systemData/dataInterface";
import { getConfigData } from "@/api/onlineDev/visualDev";
import { getDefaultCurrentValueUserIdAsync } from "@/api/permission/user";
import { getDefaultCurrentValueDepartmentIdAsync } from "@/api/permission/organize";
import columnList from "./columnList";
import { thousandsFormat } from "@/components/Generator/utils/index";
import SuperQuery from "@/components/SuperQuery";
import superQueryJson from "./superQueryJson";
export default {
components: {
JNPFForm,
Detail,
ExportBox,
ToFormDetail,
SuperQuery
},
data() {
return {
keyword: "",
expandsTree: true,
refreshTree: true,
toFormDetailVisible: false,
expandObj: {},
columnOptions: [],
mergeList: [],
exportList: [],
columnList,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
organizeJsonId: undefined
},
treeProps: {
children: "children",
label: "fullName",
value: "id",
isLeaf: "isLeaf"
},
list: [],
listLoading: true,
total: 0,
queryData: {},
listQuery: {
superQueryJson: "",
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: ""
},
formVisible: false,
flowVisible: false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
deliveryAdjustSetOptions: [
{ fullName: "即时自动", id: "1" },
{ fullName: "24H自动", id: "2" },
{ fullName: "48H自动", id: "3" }
],
deliveryAdjustSetProps: { label: "fullName", value: "id" },
allowPhoneLoginOptions: [],
allowPhoneLoginProps: { label: "fullName", value: "enCode" },
cleanLockOptions: [],
cleanLockProps: { label: "fullName", value: "enCode" },
cleanAdjustSetOptions: [
{ fullName: "自动", id: "1" },
{ fullName: "手动", id: "2" }
],
cleanAdjustSetProps: { label: "fullName", value: "id" },
smogSetOptions: [],
smogSetProps: { label: "fullName", value: "enCode" },
fullSetOptions: [],
fullSetProps: { label: "fullName", value: "enCode" },
promotionSetOptions: [],
promotionSetProps: { label: "fullName", value: "enCode" },
interfaceRes: {}
};
},
computed: {
...mapGetters(["userInfo"]),
menuId() {
return this.$route.meta.modelId || "";
}
},
created() {
this.getColumnList(), this.initSearchDataAndListData();
this.queryData = JSON.parse(JSON.stringify(this.query));
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return;
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return;
let formData = JSON.parse(res.data.formData);
formData.popupType = "general";
this.toFormDetailVisible = true;
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue);
});
});
},
toggleTreeExpand(expands) {
this.refreshTree = false;
this.expandsTree = expands;
this.$nextTick(() => {
this.refreshTree = true;
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null);
});
});
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data;
const config = {
treeInterfaceId: "",
treeTemplateJson: []
};
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || "";
}
}
//
let query = {
paramList: config.treeTemplateJson || []
};
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data;
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
});
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList);
},
transformColumnList(columnList) {
let list = [];
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes("-")) {
list.push(e);
} else {
let prop = e.prop.split("-")[0];
let label = e.label.split("-")[0];
let vModel = e.prop.split("-")[1];
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
};
e.vModel = vModel;
if (!this.expandObj.hasOwnProperty(`${prop}Expand`))
this.$set(this.expandObj, `${prop}Expand`, false);
if (!list.some(o => o.prop === prop)) list.push(newItem);
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e);
break;
}
}
}
}
this.getMergeList(list);
this.getExportList(list);
return list;
},
arraySpanMethod({ column }) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan];
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list));
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + "-child-first"
};
item.children.unshift(child);
}
});
newList.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
});
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
});
}
});
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
});
}
});
},
getExportList(list) {
let exportList = [];
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === "table") {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j]);
}
} else {
exportList.push(list[i]);
}
}
this.exportList = exportList;
},
goDetail(id) {
this.detailVisible = true;
this.$nextTick(() => {
this.$refs.Detail.init(id);
});
},
sortChange({ column, prop, order }) {
this.listQuery.sort = order == "ascending" ? "asc" : "desc";
this.listQuery.sidx = !order ? "" : prop;
this.initData();
},
async initSearchDataAndListData() {
await this.initSearchData();
this.initData();
},
//
async initSearchData() {},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId: this.menuId,
moduleId: "578190840367677829",
type: 1
};
request({
url: `/api/scm/RecycleDeviceConfigOne/getList`,
method: "post",
data: _query
}).then(res => {
var _list = res.data.list;
this.list = _list.map(o => ({
...o,
...this.expandObj
}));
this.total = res.data.pagination.total;
this.listLoading = false;
});
},
handleDel(id) {
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
type: "warning"
})
.then(() => {
request({
url: `/api/scm/RecycleDeviceConfigOne/${id}`,
method: "DELETE"
}).then(res => {
this.$message({
type: "success",
message: res.msg,
onClose: () => {
this.initData();
}
});
});
})
.catch(() => {});
},
handelUpload() {
this.uploadBoxVisible = true;
this.$nextTick(() => {
this.$refs.UploadBox.init("", "scm/RecycleDeviceConfigOne");
});
},
openSuperQuery() {
this.superQueryVisible = true;
this.$nextTick(() => {
this.$refs.SuperQuery.init();
});
},
superQuery(queryJson) {
this.listQuery.superQueryJson = queryJson;
this.listQuery.currentPage = 1;
this.initData();
},
addOrUpdateHandle(row, isDetail) {
let id = row ? row.id : "";
this.formVisible = true;
this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail, this.list);
});
},
exportData() {
this.exportBoxVisible = true;
this.$nextTick(() => {
this.$refs.ExportBox.init(this.exportList);
});
},
download(data) {
let query = {
...data,
...this.listQuery,
...this.query,
menuId: this.menuId
};
request({
url: `/api/scm/RecycleDeviceConfigOne/Actions/Export`,
method: "post",
data: query
}).then(res => {
if (!res.data.url) return;
this.jnpf.downloadFile(res.data.url);
this.$refs.ExportBox.visible = false;
this.exportBoxVisible = false;
});
},
search() {
this.listQuery.currentPage = 1;
this.listQuery.pageSize = 20;
this.listQuery.sort = "desc";
this.listQuery.sidx = "";
this.initData();
},
refresh(isrRefresh) {
this.formVisible = false;
if (isrRefresh) this.reset();
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData));
this.search();
},
colseFlow(isrRefresh) {
this.flowVisible = false;
if (isrRefresh) this.reset();
}
}
};
</script>

File diff suppressed because one or more lines are too long

@ -132,6 +132,7 @@ import {
import {
thousandsFormat
} from "@/components/Generator/utils/index"
import { getDeviceListOption } from "@/api/device";
export default {
components: {},
props: [],
@ -178,8 +179,8 @@ export default {
dataRule: {},
deviceCodeOptions: [],
deviceCodeProps: {
"label": "device_name",
"value": "device_code"
"label": "deviceName",
"value": "deviceCode"
},
bucketCodeOptions: [],
bucketCodeProps: {
@ -404,7 +405,13 @@ export default {
let template = {
paramList: templateJsonList
}
getDataInterfaceRes('564713894723988869', template).then(res => {
// getDataInterfaceRes('564713894723988869', template).then(res => {
// let data = res.data
// this.deviceCodeOptions = data
// this.changeDataFormData(1, 'deviceCode', 'deviceCode', index, '')
// })
getDeviceListOption().then(res => {
console.log(res.data)
let data = res.data
this.deviceCodeOptions = data
this.changeDataFormData(1, 'deviceCode', 'deviceCode', index, '')

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save