# Conflicts:
#	jnpf-java-boot/jnpf-scm/jnpf-scm-biz/src/main/java/jnpf/service/RecycleDeviceService.java
#	jnpf-java-boot/jnpf-scm/jnpf-scm-biz/src/main/java/jnpf/service/impl/RecycleDeviceServiceImpl.java
master
XI_TENG\xixi_ 4 months ago
commit 415e9ff6ae

@ -2,7 +2,9 @@ package jnpf.service;
import jnpf.model.recycledeviceconfig.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -16,7 +18,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
public interface RecycleDeviceConfigService extends IService<RecycleDeviceConfigEntity> {
List<RecycleDeviceConfigEntity> getList(RecycleDeviceConfigPagination recycleDeviceConfigPagination);
List<RecycleDeviceConfigEntity> getTypeList(RecycleDeviceConfigPagination recycleDeviceConfigPagination,String dataType);
List<RecycleDeviceConfigEntity> getTypeList(RecycleDeviceConfigPagination recycleDeviceConfigPagination, String dataType);
RecycleDeviceConfigEntity getInfo(String id);
@ -28,8 +30,17 @@ public interface RecycleDeviceConfigService extends IService<RecycleDeviceConfig
//子表方法
//副表数据方法
String checkForm(RecycleDeviceConfigForm form,int i);
String checkForm(RecycleDeviceConfigForm form, int i);
RecycleDeviceConfigEntity getByOrganize(String organizeJsonId);
void saveOrUpdate(RecycleDeviceConfigForm recycleDeviceConfigForm,String id, boolean isSave) throws Exception;
void saveOrUpdate(RecycleDeviceConfigForm recycleDeviceConfigForm, String id, boolean isSave) throws Exception;
/**
*
*
* @param companyIds id
* @return map
*/
Map<String, RecycleDeviceConfigEntity> getConfigs(List<String> companyIds);
}

@ -2,7 +2,9 @@ package jnpf.service;
import jnpf.model.recycledevice.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -16,7 +18,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
public interface RecycleDeviceService extends IService<RecycleDeviceEntity> {
List<RecycleDeviceEntity> getList(RecycleDevicePagination recycleDevicePagination);
List<RecycleDeviceEntity> getTypeList(RecycleDevicePagination recycleDevicePagination,String dataType);
List<RecycleDeviceEntity> getTypeList(RecycleDevicePagination recycleDevicePagination, String dataType);
RecycleDeviceEntity getInfo(String id);
@ -26,14 +28,25 @@ public interface RecycleDeviceService extends IService<RecycleDeviceEntity> {
boolean update(String id, RecycleDeviceEntity entity);
String generateQRCode(String deviceCode);
//子表方法
//副表数据方法
String checkForm(RecycleDeviceForm form,int i);
String checkForm(RecycleDeviceForm form, int i);
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);
/**
*
*
* @param deviceCodes
*/
List<String> getInfoByDeviceCode(List<String> deviceCodes);
}

@ -1,23 +1,34 @@
package jnpf.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import jnpf.entity.*;
import jnpf.mapper.RecycleDeviceConfigMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.recycledeviceconfig.*;
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.function.Function;
import java.util.regex.Pattern;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel;
@ -25,13 +36,17 @@ 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;
/**
*
*
* V3.5
* https://www.jnpfsoft.com
@ -47,320 +62,358 @@ public class RecycleDeviceConfigServiceImpl extends ServiceImpl<RecycleDeviceCon
private UserProvider userProvider;
@Override
public List<RecycleDeviceConfigEntity> getList(RecycleDeviceConfigPagination recycleDeviceConfigPagination){
return getTypeList(recycleDeviceConfigPagination,recycleDeviceConfigPagination.getDataType());
public List<RecycleDeviceConfigEntity> getList(RecycleDeviceConfigPagination recycleDeviceConfigPagination) {
return getTypeList(recycleDeviceConfigPagination, recycleDeviceConfigPagination.getDataType());
}
/** 列表查询 */
/**
*
*/
@Override
public List<RecycleDeviceConfigEntity> getTypeList(RecycleDeviceConfigPagination recycleDeviceConfigPagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
List<List<String>> intersectionList =new ArrayList<>();
public List<RecycleDeviceConfigEntity> getTypeList(RecycleDeviceConfigPagination recycleDeviceConfigPagination, 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 ? RecycleDeviceConfigConstant.getAppColumnData() : RecycleDeviceConfigConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int recycleDeviceConfigNum =0;
QueryWrapper<RecycleDeviceConfigEntity> recycleDeviceConfigQueryWrapper=new QueryWrapper<>();
int total = 0;
int recycleDeviceConfigNum = 0;
QueryWrapper<RecycleDeviceConfigEntity> recycleDeviceConfigQueryWrapper = new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(recycleDeviceConfigPagination.getSuperQueryJson())){
String superOp = "";
if (ObjectUtil.isNotEmpty(recycleDeviceConfigPagination.getSuperQueryJson())) {
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = recycleDeviceConfigPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<RecycleDeviceConfigEntity> recycleDeviceConfigSuperWrapper = new QueryWrapper<>();
recycleDeviceConfigSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(recycleDeviceConfigSuperWrapper,RecycleDeviceConfigEntity.class,queryJson,"0"));
recycleDeviceConfigSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(recycleDeviceConfigSuperWrapper, RecycleDeviceConfigEntity.class, queryJson, "0"));
int recycleDeviceConfigNum1 = recycleDeviceConfigSuperWrapper.getExpression().getNormal().size();
if (recycleDeviceConfigNum1>0){
List<String> recycleDeviceConfigList =this.list(recycleDeviceConfigSuperWrapper).stream().map(RecycleDeviceConfigEntity::getId).collect(Collectors.toList());
if (recycleDeviceConfigNum1 > 0) {
List<String> recycleDeviceConfigList = this.list(recycleDeviceConfigSuperWrapper).stream().map(RecycleDeviceConfigEntity::getId).collect(Collectors.toList());
allSuperList.addAll(recycleDeviceConfigList);
intersectionSuperList.add(recycleDeviceConfigList);
superNum++;
}
superOp = superNum > 0 ? superJsonModel.getMatchLogic() : "";
//and or
if(superOp.equalsIgnoreCase("and")){
if (superOp.equalsIgnoreCase("and")) {
allSuperIDlist = generaterSwapUtil.getIntersection(intersectionSuperList);
}else{
} else {
allSuperIDlist = allSuperList;
}
}
List<String> allRuleIDlist = new ArrayList<>();
String ruleOp ="";
if (ObjectUtil.isNotEmpty(ruleJson)){
String ruleOp = "";
if (ObjectUtil.isNotEmpty(ruleJson)) {
List<String> allRuleList = new ArrayList<>();
List<List<String>> intersectionRuleList = new ArrayList<>();
List<List<String>> intersectionRuleList = new ArrayList<>();
SuperJsonModel ruleJsonModel = JsonUtil.getJsonToBean(ruleJson, SuperJsonModel.class);
int ruleNum = 0;
QueryWrapper<RecycleDeviceConfigEntity> recycleDeviceConfigSuperWrapper = new QueryWrapper<>();
recycleDeviceConfigSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(recycleDeviceConfigSuperWrapper,RecycleDeviceConfigEntity.class,ruleJson,"0"));
recycleDeviceConfigSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(recycleDeviceConfigSuperWrapper, RecycleDeviceConfigEntity.class, ruleJson, "0"));
int recycleDeviceConfigNum1 = recycleDeviceConfigSuperWrapper.getExpression().getNormal().size();
if (recycleDeviceConfigNum1>0){
List<String> recycleDeviceConfigList =this.list(recycleDeviceConfigSuperWrapper).stream().map(RecycleDeviceConfigEntity::getId).collect(Collectors.toList());
if (recycleDeviceConfigNum1 > 0) {
List<String> recycleDeviceConfigList = this.list(recycleDeviceConfigSuperWrapper).stream().map(RecycleDeviceConfigEntity::getId).collect(Collectors.toList());
allRuleList.addAll(recycleDeviceConfigList);
intersectionRuleList.add(recycleDeviceConfigList);
ruleNum++;
}
ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : "";
//and or
if(ruleOp.equalsIgnoreCase("and")){
if (ruleOp.equalsIgnoreCase("and")) {
allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList);
}else{
} else {
allRuleIDlist = allRuleList;
}
}
boolean pcPermission = true;
boolean appPermission = false;
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object recycleDeviceConfigObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(recycleDeviceConfigQueryWrapper,RecycleDeviceConfigEntity.class,recycleDeviceConfigPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(recycleDeviceConfigObj)){
return new ArrayList<>();
} else {
recycleDeviceConfigQueryWrapper = (QueryWrapper<RecycleDeviceConfigEntity>)recycleDeviceConfigObj;
if( recycleDeviceConfigQueryWrapper.getExpression().getNormal().size()>0){
recycleDeviceConfigNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object recycleDeviceConfigObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(recycleDeviceConfigQueryWrapper,RecycleDeviceConfigEntity.class,recycleDeviceConfigPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(recycleDeviceConfigObj)){
return new ArrayList<>();
} else {
recycleDeviceConfigQueryWrapper = (QueryWrapper<RecycleDeviceConfigEntity>)recycleDeviceConfigObj;
if( recycleDeviceConfigQueryWrapper.getExpression().getNormal().size()>0){
recycleDeviceConfigNum++;
}
boolean pcPermission = true;
boolean appPermission = false;
if (isPc && pcPermission) {
if (!userProvider.get().getIsAdministrator()) {
Object recycleDeviceConfigObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(recycleDeviceConfigQueryWrapper, RecycleDeviceConfigEntity.class, recycleDeviceConfigPagination.getMenuId(), "0"));
if (ObjectUtil.isEmpty(recycleDeviceConfigObj)) {
return new ArrayList<>();
} else {
recycleDeviceConfigQueryWrapper = (QueryWrapper<RecycleDeviceConfigEntity>) recycleDeviceConfigObj;
if (recycleDeviceConfigQueryWrapper.getExpression().getNormal().size() > 0) {
recycleDeviceConfigNum++;
}
}
}
}
if (!isPc && appPermission) {
if (!userProvider.get().getIsAdministrator()) {
Object recycleDeviceConfigObj = generaterSwapUtil.getAuthorizeCondition(new QueryModel(recycleDeviceConfigQueryWrapper, RecycleDeviceConfigEntity.class, recycleDeviceConfigPagination.getMenuId(), "0"));
if (ObjectUtil.isEmpty(recycleDeviceConfigObj)) {
return new ArrayList<>();
} else {
recycleDeviceConfigQueryWrapper = (QueryWrapper<RecycleDeviceConfigEntity>) recycleDeviceConfigObj;
if (recycleDeviceConfigQueryWrapper.getExpression().getNormal().size() > 0) {
recycleDeviceConfigNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(recycleDeviceConfigPagination.getOrganizeJsonId())){
recycleDeviceConfigNum++;
List<String> idList = new ArrayList<>();
try {
String[][] organizeJsonId = JsonUtil.getJsonToBean(recycleDeviceConfigPagination.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(recycleDeviceConfigPagination.getOrganizeJsonId(),String.class);
if(organizeJsonId.size()>0){
idList.add(organizeJsonId.get(organizeJsonId.size()-1));
}
}catch (Exception e2){
idList.add(String.valueOf(recycleDeviceConfigPagination.getOrganizeJsonId()));
}
}
}
recycleDeviceConfigQueryWrapper.lambda().and(t->{
idList.forEach(tt->{
t.like(RecycleDeviceConfigEntity::getOrganizeJsonId, tt).or();
});
});
if (isPc) {
if (ObjectUtil.isNotEmpty(recycleDeviceConfigPagination.getOrganizeJsonId())) {
recycleDeviceConfigNum++;
List<String> idList = new ArrayList<>();
try {
String[][] organizeJsonId = JsonUtil.getJsonToBean(recycleDeviceConfigPagination.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(recycleDeviceConfigPagination.getOrganizeJsonId(), String.class);
if (organizeJsonId.size() > 0) {
idList.add(organizeJsonId.get(organizeJsonId.size() - 1));
}
} catch (Exception e2) {
idList.add(String.valueOf(recycleDeviceConfigPagination.getOrganizeJsonId()));
}
}
recycleDeviceConfigQueryWrapper.lambda().and(t -> {
idList.forEach(tt -> {
t.like(RecycleDeviceConfigEntity::getOrganizeJsonId, tt).or();
});
});
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
if (total > 0) {
if (intersection.size() == 0) {
intersection.add("jnpfNullList");
}
recycleDeviceConfigQueryWrapper.lambda().in(RecycleDeviceConfigEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)) {
if (allSuperIDlist.size() == 0) {
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
recycleDeviceConfigQueryWrapper.lambda().and(t->t.in(RecycleDeviceConfigEntity::getId, finalAllSuperIDlist));
recycleDeviceConfigQueryWrapper.lambda().and(t -> t.in(RecycleDeviceConfigEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)) {
if (allRuleIDlist.size() == 0) {
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
recycleDeviceConfigQueryWrapper.lambda().and(t->t.in(RecycleDeviceConfigEntity::getId, finalAllRuleIDlist));
recycleDeviceConfigQueryWrapper.lambda().and(t -> t.in(RecycleDeviceConfigEntity::getId, finalAllRuleIDlist));
}
//排序
if(StringUtil.isEmpty(recycleDeviceConfigPagination.getSidx())){
if (StringUtil.isEmpty(recycleDeviceConfigPagination.getSidx())) {
recycleDeviceConfigQueryWrapper.lambda().orderByDesc(RecycleDeviceConfigEntity::getId);
}else{
} else {
try {
String sidx = recycleDeviceConfigPagination.getSidx();
String[] strs= sidx.split("_name");
String[] strs = sidx.split("_name");
RecycleDeviceConfigEntity recycleDeviceConfigEntity = new RecycleDeviceConfigEntity();
Field declaredField = recycleDeviceConfigEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
recycleDeviceConfigQueryWrapper="asc".equals(recycleDeviceConfigPagination.getSort().toLowerCase())?recycleDeviceConfigQueryWrapper.orderByAsc(value):recycleDeviceConfigQueryWrapper.orderByDesc(value);
recycleDeviceConfigQueryWrapper = "asc".equals(recycleDeviceConfigPagination.getSort().toLowerCase()) ? recycleDeviceConfigQueryWrapper.orderByAsc(value) : recycleDeviceConfigQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<RecycleDeviceConfigEntity> page=new Page<>(recycleDeviceConfigPagination.getCurrentPage(), recycleDeviceConfigPagination.getPageSize());
IPage<RecycleDeviceConfigEntity> userIPage=this.page(page, recycleDeviceConfigQueryWrapper);
return recycleDeviceConfigPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
if ("0".equals(dataType)) {
if ((total > 0 && AllIdList.size() > 0) || total == 0) {
Page<RecycleDeviceConfigEntity> page = new Page<>(recycleDeviceConfigPagination.getCurrentPage(), recycleDeviceConfigPagination.getPageSize());
IPage<RecycleDeviceConfigEntity> userIPage = this.page(page, recycleDeviceConfigQueryWrapper);
return recycleDeviceConfigPagination.setData(userIPage.getRecords(), userIPage.getTotal());
} else {
List<RecycleDeviceConfigEntity> list = new ArrayList();
return recycleDeviceConfigPagination.setData(list, list.size());
}
}else{
} else {
return this.list(recycleDeviceConfigQueryWrapper);
}
}
@Override
public RecycleDeviceConfigEntity getInfo(String id){
QueryWrapper<RecycleDeviceConfigEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(RecycleDeviceConfigEntity::getId,id);
public RecycleDeviceConfigEntity getInfo(String id) {
QueryWrapper<RecycleDeviceConfigEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(RecycleDeviceConfigEntity::getId, id);
return this.getOne(queryWrapper);
}
@Override
public void create(RecycleDeviceConfigEntity entity){
String organizeJsonId = entity.getOrganizeJsonId();
RecycleDeviceConfigEntity config = getByOrganize(organizeJsonId);
if(config!=null){
// throw new ("该组织下已存在回收设备配置");
}
this.save(entity);
}
@Override
public boolean update(String id, RecycleDeviceConfigEntity entity){
public boolean update(String id, RecycleDeviceConfigEntity entity) {
return this.updateById(entity);
}
@Override
public void delete(RecycleDeviceConfigEntity entity){
if(entity!=null){
public void delete(RecycleDeviceConfigEntity entity) {
if (entity != null) {
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
/**
* i-0-1
*/
@Override
public String checkForm(RecycleDeviceConfigForm form,int i) {
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id="";
public String checkForm(RecycleDeviceConfigForm form, int i) {
boolean isUp = StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id = "";
String countRecover = "";
if (isUp){
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.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.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.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.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.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.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.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.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.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.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.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.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.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 "请输入正确的重量";
if (StringUtil.isNotEmpty(form.getWarningWeight())) {
if (!Pattern.compile("^\\d+$").matcher(String.valueOf(form.getWarningWeight())).matches()) {
return "请输入正确的重量";
}
}
}
return countRecover;
}
@Override
public RecycleDeviceConfigEntity getByOrganize(String organizeJsonId) {
QueryWrapper<RecycleDeviceConfigEntity> query = new QueryWrapper<>();
query.lambda()
.eq(RecycleDeviceConfigEntity::getOrganizeJsonId,organizeJsonId)
.isNull(RecycleDeviceConfigEntity::getDeleteMark)//删除标记
.last("LIMIT 1");
RecycleDeviceConfigEntity one = this.getOne(query);
return one;
}
/**
* ()
* @param id
* @param recycleDeviceConfigForm
* @return
*/
* ()
*
* @param id
* @param recycleDeviceConfigForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(RecycleDeviceConfigForm recycleDeviceConfigForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
public void saveOrUpdate(RecycleDeviceConfigForm recycleDeviceConfigForm, String id, boolean isSave) throws Exception {
UserInfo userInfo = userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
recycleDeviceConfigForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(RecycleDeviceConfigConstant.getFormData(),recycleDeviceConfigForm),RecycleDeviceConfigForm.class);
generaterSwapUtil.swapDatetime(RecycleDeviceConfigConstant.getFormData(), recycleDeviceConfigForm), RecycleDeviceConfigForm.class);
RecycleDeviceConfigEntity entity = JsonUtil.getJsonToBean(recycleDeviceConfigForm, RecycleDeviceConfigEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setLastModifyUserId(null);
entity.setLastModifyTime(null);
entity.setOrganizeJsonId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(),"all"));
entity.setCompanyId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(),"all"));
entity.setDepartmentId(userEntity.getPositionId());
if (isSave) {
String mainId = RandomUtil.uuId();
entity.setLastModifyUserId(null);
entity.setLastModifyTime(null);
entity.setOrganizeJsonId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(), "all"));
entity.setCompanyId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(), "all"));
entity.setDepartmentId(userEntity.getPositionId());
entity.setId(mainId);
}else{
entity.setLastModifyUserId(null);
entity.setLastModifyTime(null);
entity.setOrganizeJsonId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(),"all"));
entity.setCompanyId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(),"all"));
entity.setDepartmentId(userEntity.getPositionId());
} else {
entity.setLastModifyUserId(null);
entity.setLastModifyTime(null);
entity.setOrganizeJsonId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(), "all"));
entity.setCompanyId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(), "all"));
entity.setDepartmentId(userEntity.getPositionId());
}
this.saveOrUpdate(entity);
}
@Override
public Map<String, RecycleDeviceConfigEntity> getConfigs(List<String> companyIds) {
List<RecycleDeviceConfigEntity> list = this.list(new LambdaQueryWrapper<>(RecycleDeviceConfigEntity.class)
.in(RecycleDeviceConfigEntity::getCompanyId, companyIds));
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyMap();
}
return list.stream().collect(Collectors.toMap(RecycleDeviceConfigEntity::getCompanyId, Function.identity()));
}
}

@ -1,6 +1,9 @@
package jnpf.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import jnpf.entity.*;
import jnpf.mapper.RecycleDeviceMapper;
import jnpf.permission.entity.OrganizeEntity;
@ -9,33 +12,49 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.recycledevice.*;
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 cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.util.*;
import java.util.regex.Pattern;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.collections4.CollectionUtils;
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 com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.base.UserInfo;
import jnpf.base.model.ColumnDataModel;
import jnpf.database.model.superQuery.SuperJsonModel;
import jnpf.entity.RecycleDeviceEntity;
import jnpf.mapper.RecycleDeviceMapper;
import jnpf.model.QueryModel;
import jnpf.model.recycledevice.RecycleDeviceConstant;
import jnpf.model.recycledevice.RecycleDeviceForm;
import jnpf.model.recycledevice.RecycleDevicePagination;
import jnpf.permission.entity.UserEntity;
import javax.annotation.Resource;
import jnpf.service.RecycleDeviceService;
import jnpf.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.lang.reflect.Field;
import java.util.stream.Collectors;
/**
*
*
@ -54,6 +73,9 @@ public class RecycleDeviceServiceImpl extends ServiceImpl<RecycleDeviceMapper, R
@Resource
private RecycleDeviceMapper recycleDeviceMapper;
@Value("${nxhs.url}")
private String wx_url;
@Override
public List<RecycleDeviceEntity> getList(RecycleDevicePagination recycleDevicePagination){
return getTypeList(recycleDevicePagination,recycleDevicePagination.getDataType());
@ -356,36 +378,55 @@ public class RecycleDeviceServiceImpl extends ServiceImpl<RecycleDeviceMapper, R
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setDeviceCode(generaterSwapUtil.getBillNumber("deviceCode", false));
entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId());
entity.setLastModifyUserId(null);
entity.setLastModifyTime(null);
entity.setOrganizeJsonId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(),"all"));
entity.setDeviceCode(generaterSwapUtil.getBillNumber("deviceCode", false));
entity.setId(mainId);
String deviceCode = entity.getDeviceCode();
String qrCode = generateQRCode(deviceCode);
entity.setDeviceCodeQr(qrCode);
}else{
entity.setDeviceCode(generaterSwapUtil.getBillNumber("deviceCode", false));
entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId());
entity.setLastModifyUserId(null);
entity.setLastModifyTime(null);
entity.setOrganizeJsonId(generaterSwapUtil.getCurrentOrgIds(userInfo.getOrganizeId(),"all"));
}
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());
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());
}
public String generateQRCode(String deviceCode) {
HashMap<String, Object> param = new HashMap<>();
param.put("deviceCode",deviceCode);
param.put("page","");
HttpResponse response = HttpRequest.post(wx_url + "/api/wx/generateDeviceQRCode")
.header("Content-Type", "application/json")
.body(JSONUtil.toJsonStr(param))
.timeout(1000)
.execute();
String body = response.body();
JSONObject result = JSONUtil.parseObj(body);
String data = result.getStr("data");
return data;
Page<RecycleDeviceEntity> page=new Page<>(recycleDevicePagination.getCurrentPage(), recycleDevicePagination.getPageSize());
IPage<RecycleDeviceEntity> voucherEntityIPage = recycleDeviceMapper.QueryRecycleDevice(page,queryWrapper);
return recycleDevicePagination.setData(voucherEntityIPage.getRecords(),voucherEntityIPage.getTotal());
}
@Override
public List<String> getInfoByDeviceCode(List<String> deviceCodes) {
List<RecycleDeviceEntity> list = this.list(new LambdaQueryWrapper<>(RecycleDeviceEntity.class)
.in(RecycleDeviceEntity::getDeviceCode, deviceCodes));
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
}
return list.stream().map(RecycleDeviceEntity::getBeLongCompanyId).collect(Collectors.toList());
}
}

@ -18,6 +18,11 @@
</properties>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.3</version>
</dependency>
<dependency>
<groupId>com.jnpf</groupId>
<artifactId>jnpf-scm-biz</artifactId>

@ -12,25 +12,34 @@ import jnpf.service.*;
import jnpf.entity.*;
import jnpf.util.*;
import jnpf.model.recyclebucket.*;
import jnpf.utils.CompareUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.math.BigDecimal;
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;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
@ -38,7 +47,7 @@ import org.springframework.transaction.annotation.Transactional;
*/
@Slf4j
@RestController
@Tag(name = "回收桶配置" , description = "scm")
@Tag(name = "回收桶配置", description = "scm")
@RequestMapping("/api/scm/RecycleBucket")
public class RecycleBucketController {
@ -51,28 +60,52 @@ public class RecycleBucketController {
@Autowired
private RecycleBucketService recycleBucketService;
@Resource
private RecycleDeviceService recycleDeviceService;
@Resource
private RecycleDeviceConfigService recycleDeviceConfigService;
/**
*
*
* @param recycleBucketPagination
* @return
*/
*
*
* @param recycleBucketPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody RecycleBucketPagination recycleBucketPagination)throws IOException{
List<RecycleBucketEntity> list= recycleBucketService.getList(recycleBucketPagination);
List<Map<String, Object>> realList=new ArrayList<>();
public ActionResult list(@RequestBody RecycleBucketPagination recycleBucketPagination) throws IOException {
List<RecycleBucketEntity> list = recycleBucketService.getList(recycleBucketPagination);
if (CollectionUtils.isEmpty(list)) {
return ActionResult.success();
}
List<String> companyIds = list.stream().map(RecycleBucketEntity::getCompanyId).collect(Collectors.toList());
//查询统一配置
Map<String, RecycleDeviceConfigEntity> configCollect = recycleDeviceConfigService.getConfigs(companyIds);
List<Map<String, Object>> realList = new ArrayList<>();
for (RecycleBucketEntity entity : list) {
Map<String, Object> recycleBucketMap=JsonUtil.entityToMap(entity);
recycleBucketMap.put("id", recycleBucketMap.get("id"));
//副表数据
//子表数据
if (configCollect.containsKey(entity.getCompanyId())) {
RecycleDeviceConfigEntity deviceConfig = configCollect.get(entity.getCompanyId());
//如果为空 则获取公共配置
if (Objects.isNull(entity.getPrice())) {
entity.setPrice(CompareUtil.compareBigDecimal(entity.getDoorNum(), deviceConfig));
}
if (entity.getFullSet() == -1) {
entity.setFullSet(Integer.valueOf(deviceConfig.getFullSet()));
}
if (entity.getSmogSet() == -1) {
entity.setSmogSet(Integer.valueOf(deviceConfig.getSmogSet()));
}
}
Map<String, Object> recycleBucketMap = JsonUtil.entityToMap(entity);
recycleBucketMap.put("id", recycleBucketMap.get("id"));
//副表数据
//子表数据
realList.add(recycleBucketMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, RecycleBucketConstant.getFormData(), RecycleBucketConstant.getColumnData(), recycleBucketPagination.getModuleId(),false);
realList = generaterSwapUtil.swapDataList(realList, RecycleBucketConstant.getFormData(), RecycleBucketConstant.getColumnData(), recycleBucketPagination.getModuleId(), false);
//返回对象
PageListVO vo = new PageListVO();
@ -81,109 +114,132 @@ public class RecycleBucketController {
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param recycleBucketForm
* @return
*/
*
*
* @param recycleBucketForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid RecycleBucketForm recycleBucketForm) {
String b = recycleBucketService.checkForm(recycleBucketForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
String b = recycleBucketService.checkForm(recycleBucketForm, 0);
if (StringUtil.isNotEmpty(b)) {
return ActionResult.fail(b);
}
try{
recycleBucketService.saveOrUpdate(recycleBucketForm, null ,true);
}catch(Exception e){
try {
//查询设备 所绑定的商户 赋值
List<String> companyId = recycleDeviceService.getInfoByDeviceCode(Collections.singletonList(recycleBucketForm.getDeviceCode()));
if (CollectionUtils.isNotEmpty(companyId)) {
//只会查询出来一个
recycleBucketForm.setCompanyId(companyId.get(0));
}
recycleBucketService.saveOrUpdate(recycleBucketForm, null, true);
} catch (Exception e) {
e.printStackTrace();
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
*
* @param id
* @param recycleBucketForm
* @return
*/
*
*
* @param id
* @param recycleBucketForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid RecycleBucketForm recycleBucketForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid RecycleBucketForm recycleBucketForm,
@RequestParam(value = "isImport", required = false) boolean isImport) {
recycleBucketForm.setId(id);
if (!isImport) {
String b = recycleBucketService.checkForm(recycleBucketForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
String b = recycleBucketService.checkForm(recycleBucketForm, 1);
if (StringUtil.isNotEmpty(b)) {
return ActionResult.fail(b);
}
}
RecycleBucketEntity entity= recycleBucketService.getInfo(id);
if(entity!=null){
try{
recycleBucketService.saveOrUpdate(recycleBucketForm,id,false);
}catch(Exception e){
RecycleBucketEntity entity = recycleBucketService.getInfo(id);
if (entity != null) {
//查询设备 所绑定的商户 赋值
List<String> companyId = recycleDeviceService.getInfoByDeviceCode(Collections.singletonList(recycleBucketForm.getDeviceCode()));
if (CollectionUtils.isNotEmpty(companyId)) {
//只会查询出来一个
recycleBucketForm.setCompanyId(companyId.get(0));
}
try {
recycleBucketService.saveOrUpdate(recycleBucketForm, id, false);
} catch (Exception e) {
e.printStackTrace();
return ActionResult.fail("修改数据失败");
}
return ActionResult.success("更新成功");
}else{
} else {
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
*
* @param id
* @return
*/
*
*
* @param id
* @return
*/
@Operation(summary = "删除")
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id){
RecycleBucketEntity entity= recycleBucketService.getInfo(id);
if(entity!=null){
public ActionResult delete(@PathVariable("id") String id) {
RecycleBucketEntity entity = recycleBucketService.getInfo(id);
if (entity != null) {
//主表数据删除
recycleBucketService.delete(entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
* ()
* 使-
*
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
RecycleBucketEntity entity= recycleBucketService.getInfo(id);
if(entity==null){
public ActionResult detailInfo(@PathVariable("id") String id) {
RecycleBucketEntity entity = recycleBucketService.getInfo(id);
if (entity == null) {
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> recycleBucketMap=JsonUtil.entityToMap(entity);
Map<String, Object> recycleBucketMap = JsonUtil.entityToMap(entity);
recycleBucketMap.put("id", recycleBucketMap.get("id"));
//副表数据
//子表数据
recycleBucketMap = generaterSwapUtil.swapDataDetail(recycleBucketMap,RecycleBucketConstant.getFormData(),"564718669121203589",false);
recycleBucketMap = generaterSwapUtil.swapDataDetail(recycleBucketMap, RecycleBucketConstant.getFormData(), "564718669121203589", false);
return ActionResult.success(recycleBucketMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
* ()
* 使-
*
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
RecycleBucketEntity entity= recycleBucketService.getInfo(id);
if(entity==null){
public ActionResult info(@PathVariable("id") String id) {
RecycleBucketEntity entity = recycleBucketService.getInfo(id);
if (entity == null) {
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> recycleBucketMap=JsonUtil.entityToMap(entity);
Map<String, Object> recycleBucketMap = JsonUtil.entityToMap(entity);
recycleBucketMap.put("id", recycleBucketMap.get("id"));
//副表数据
//子表数据
recycleBucketMap = generaterSwapUtil.swapDataForm(recycleBucketMap,RecycleBucketConstant.getFormData(),RecycleBucketConstant.TABLEFIELDKEY,RecycleBucketConstant.TABLERENAMES);
recycleBucketMap = generaterSwapUtil.swapDataForm(recycleBucketMap, RecycleBucketConstant.getFormData(), RecycleBucketConstant.TABLEFIELDKEY, RecycleBucketConstant.TABLERENAMES);
return ActionResult.success(recycleBucketMap);
}

@ -7,7 +7,9 @@ import jnpf.base.ActionResult;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.entity.RecycleBucketEntity;
import jnpf.entity.RecycleCameraEntity;
import jnpf.entity.RecycleDeviceEntity;
import jnpf.entity.SimCardEntity;
import jnpf.model.recycledevice.RecycleDeviceConstant;
import jnpf.model.recycledevice.RecycleDeviceForm;
import jnpf.model.recycledevice.RecycleDevicePagination;
@ -81,8 +83,11 @@ public class RecycleDeviceController {
List<RecycleBucketEntity> buckets = recycleBucketService.getByDeviceCode(deviceCode);
recycleDeviceMap.put("buckets", buckets);
//sim卡信息
SimCardEntity simCard = simCardService.getByDeviceCode(deviceCode);
recycleDeviceMap.put("simCard", simCard);
//摄像头信息
List<RecycleCameraEntity> cameras = cameraService.getByDeviceCode(deviceCode);
recycleDeviceMap.put("cameras", cameras);
realList.add(recycleDeviceMap);
}
//数据转换
@ -97,21 +102,22 @@ public class RecycleDeviceController {
}
/**
*
*
* @param recycleDeviceForm
* @return
*/
*
*
* @param recycleDeviceForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid RecycleDeviceForm recycleDeviceForm) {
String b = recycleDeviceService.checkForm(recycleDeviceForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
String b = recycleDeviceService.checkForm(recycleDeviceForm, 0);
if (StringUtil.isNotEmpty(b)) {
return ActionResult.fail(b);
}
try{
recycleDeviceService.saveOrUpdate(recycleDeviceForm, null ,true);
}catch(Exception e){
try {
recycleDeviceService.saveOrUpdate(recycleDeviceForm, null, true);
} catch (Exception e) {
e.printStackTrace();
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
@ -126,82 +132,105 @@ public class RecycleDeviceController {
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid RecycleDeviceForm recycleDeviceForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid RecycleDeviceForm recycleDeviceForm,
@RequestParam(value = "isImport", required = false) boolean isImport) {
recycleDeviceForm.setId(id);
if (!isImport) {
String b = recycleDeviceService.checkForm(recycleDeviceForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
String b = recycleDeviceService.checkForm(recycleDeviceForm, 1);
if (StringUtil.isNotEmpty(b)) {
return ActionResult.fail(b);
}
}
RecycleDeviceEntity entity= recycleDeviceService.getInfo(id);
if(entity!=null){
try{
recycleDeviceService.saveOrUpdate(recycleDeviceForm,id,false);
}catch(Exception e){
RecycleDeviceEntity entity = recycleDeviceService.getInfo(id);
if (entity != null) {
try {
recycleDeviceService.saveOrUpdate(recycleDeviceForm, id, false);
} catch (Exception e) {
e.printStackTrace();
return ActionResult.fail("修改数据失败");
}
return ActionResult.success("更新成功");
}else{
} else {
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
*
* @param id
* @return
*/
*
*
* @param id
* @return
*/
@Operation(summary = "删除")
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id){
RecycleDeviceEntity entity= recycleDeviceService.getInfo(id);
if(entity!=null){
public ActionResult delete(@PathVariable("id") String id) {
RecycleDeviceEntity entity = recycleDeviceService.getInfo(id);
SimCardEntity simCard = simCardService.getByDeviceCode(entity.getDeviceCode());
List<RecycleBucketEntity> buckets = recycleBucketService.getByDeviceCode(entity.getDeviceCode());
List<RecycleCameraEntity> cameras = cameraService.getByDeviceCode(entity.getDeviceCode());
StringBuilder builder = new StringBuilder();
if (simCard != null) {
builder.append("simCard表中存在与该设备关联的sim卡信息请先删除simCard表中的sim卡信息\n");
}
if (buckets.size() > 0) {
builder.append("recycleBucket表中存在与该设备关联的回收桶信息请先删除recycleBucket表中的回收桶信息\n");
}
if (cameras.size() > 0) {
builder.append("recycleCamera表中存在与该设备关联的摄像头信息请先删除recycleCamera表中的摄像头信息\n");
}
if (builder.length() > 0) {
return ActionResult.fail(builder.toString());
}
if (entity != null) {
//假删除
// entity.setDeleteMark(1);
recycleDeviceService.update(id,entity);
entity.setDeleteMark(1);
recycleDeviceService.update(id, entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
* ()
* 使-
*
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
RecycleDeviceEntity entity= recycleDeviceService.getInfo(id);
if(entity==null){
public ActionResult detailInfo(@PathVariable("id") String id) {
RecycleDeviceEntity entity = recycleDeviceService.getInfo(id);
if (entity == null) {
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> recycleDeviceMap=JsonUtil.entityToMap(entity);
Map<String, Object> recycleDeviceMap = JsonUtil.entityToMap(entity);
recycleDeviceMap.put("id", recycleDeviceMap.get("id"));
//副表数据
//子表数据
recycleDeviceMap = generaterSwapUtil.swapDataDetail(recycleDeviceMap,RecycleDeviceConstant.getFormData(),"563701730794023749",false);
recycleDeviceMap = generaterSwapUtil.swapDataDetail(recycleDeviceMap, RecycleDeviceConstant.getFormData(), "563701730794023749", false);
return ActionResult.success(recycleDeviceMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
* ()
* 使-
*
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
RecycleDeviceEntity entity= recycleDeviceService.getInfo(id);
if(entity==null){
public ActionResult info(@PathVariable("id") String id) {
RecycleDeviceEntity entity = recycleDeviceService.getInfo(id);
if (entity == null) {
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> recycleDeviceMap=JsonUtil.entityToMap(entity);
Map<String, Object> recycleDeviceMap = JsonUtil.entityToMap(entity);
recycleDeviceMap.put("id", recycleDeviceMap.get("id"));
//副表数据
//子表数据
recycleDeviceMap = generaterSwapUtil.swapDataForm(recycleDeviceMap,RecycleDeviceConstant.getFormData(),RecycleDeviceConstant.TABLEFIELDKEY,RecycleDeviceConstant.TABLERENAMES);
recycleDeviceMap = generaterSwapUtil.swapDataForm(recycleDeviceMap, RecycleDeviceConstant.getFormData(), RecycleDeviceConstant.TABLEFIELDKEY, RecycleDeviceConstant.TABLERENAMES);
return ActionResult.success(recycleDeviceMap);
}

@ -0,0 +1,62 @@
package jnpf.utils;
import jnpf.entity.RecycleDeviceConfigEntity;
import java.math.BigDecimal;
import java.util.Objects;
/**
*
*
* @author jiyufei
*/
public class CompareUtil {
//判断属于几号桶价格
public static BigDecimal compareBigDecimal(int doorNum, RecycleDeviceConfigEntity config) {
BigDecimal result;
switch (doorNum) {
case 1:
result = config.getBucket1Price();
break;
case 2:
result = config.getBucket2Price();
break;
case 3:
result = config.getBucket3Price();
break;
case 4:
result = config.getBucket4Price();
break;
case 5:
result = config.getBucket5Price();
break;
case 6:
result = config.getBucket6Price();
break;
case 7:
result = config.getBucket7Price();
break;
case 8:
result = config.getBucket8Price();
break;
case 9:
result = config.getBucket9Price();
break;
case 10:
result = config.getBucket10Price();
break;
case 11:
result = config.getBucket11Price();
break;
case 12:
result = config.getBucket12Price();
break;
default:
result = new BigDecimal(0);
}
if (Objects.isNull(result)) {
return config.getDeliveryPrice();
}
return result;
}
}

@ -9,7 +9,7 @@ import java.util.Date;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-06-22
* @ 2024-06-24
*/
@Data
@TableName("nx_recycle_device")

@ -86,4 +86,7 @@ public class RecycleBucketForm {
/** 租户 **/
@JsonProperty("tenantId")
private Object tenantId;
/** 商户 **/
@JsonProperty("companyId")
private String companyId;
}

@ -6,11 +6,11 @@ import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-06-22
* @ 2024-06-24
*/
@Data
public class RecycleDeviceForm {
@ -38,7 +38,7 @@ public class RecycleDeviceForm {
/** 所属商户 **/
@JsonProperty("beLongCompanyId")
private Object beLongCompanyId;
/** 分配回收站 **/
/** 所属回收站 **/
@JsonProperty("beLongStationId")
private Object beLongStationId;
/** 所属清运员 **/

@ -7,11 +7,11 @@ import java.util.List;
/**
*
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-06-22
* @ 2024-06-24
*/
@Data
public class RecycleDevicePagination extends Pagination {

@ -1,278 +0,0 @@
<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="small" label-width="120px" label-position="right" >
<template v-if="!loading">
<el-col :span="8" >
<jnpf-form-tip-item label="设备编码"
prop="deviceCode" >
<p>{{dataForm.deviceCode}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="桶编码"
prop="bucketCode" >
<p>{{dataForm.bucketCode}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="门号"
prop="doorNum" >
<p>{{dataForm.doorNum}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="回收品大类"
prop="productCode" >
<p>{{dataForm.productCode}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="回收品子类"
prop="productSubCode" >
<p>{{dataForm.productSubCode}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="机柜清运单号"
prop="deviceOrderNo" >
<p>{{dataForm.deviceOrderNo}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="单价"
prop="price" >
<JnpfNumber v-model="dataForm.price"
placeholder="数字文本" disabled
:step="1" :precision="2" >
</JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="清运重量"
prop="weight" >
<JnpfNumber v-model="dataForm.weight"
placeholder="数字文本" disabled
:step="1" :precision="2" >
</JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="总价"
prop="totalPrice" >
<JnpfNumber v-model="dataForm.totalPrice"
placeholder="数字文本" disabled
:step="1" :precision="2" >
</JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="审核后重量"
prop="adjustWeight" >
<JnpfNumber v-model="dataForm.adjustWeight"
placeholder="数字文本" disabled
:step="1" :precision="2" >
</JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="审核后总价"
prop="adjustPrice" >
<JnpfNumber v-model="dataForm.adjustPrice"
placeholder="数字文本" disabled
:step="1" :precision="2" >
</JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="清运员"
prop="cleanUserId" >
<p>{{dataForm.cleanUserId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="清运员手机号"
prop="phone" >
<p>{{dataForm.phone}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="登录方式"
prop="loginType" >
<p>{{ dataForm.loginType }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="开始时间"
prop="startTime" >
<p>{{dataForm.startTime}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="完成时间"
prop="finishTime" >
<p>{{dataForm.finishTime}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="上报时间"
prop="reportTime" >
<p>{{dataForm.reportTime}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="审核状态"
prop="adjustStatus" >
<p>{{ dataForm.adjustStatus }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="入库状态"
prop="entryStatus" >
<p>{{ dataForm.entryStatus }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="审核说明"
prop="adjustComm" >
<p>{{dataForm.adjustComm}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="抓拍图片"
prop="photo" >
<JnpfUploadImg v-model="dataForm.photo"
disabled
detailed :fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0" >
</JnpfUploadImg>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="垃圾袋号"
prop="bagNo" >
<p>{{dataForm.bagNo}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="租户id"
prop="tenantId" >
<p>{{dataForm.tenantId}}</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 :'',
orderNo : '',
deviceCode : "",
bucketCode : '',
doorNum : '',
productCode : "",
productSubCode : "",
deviceOrderNo : '',
price : '',
weight : '',
totalPrice : '',
adjustWeight : '',
adjustPrice : '',
cleanUserId : "",
phone : '',
loginType : '',
startTime : '',
finishTime : '',
reportTime : '',
adjustStatus : '',
entryStatus : '',
adjustComm : '',
photo : [],
bagNo : '',
tenantId : [],
},
productCodeProps:{"label":"name","value":"id" },
productSubCodeProps:{"label":"name","value":"id" },
loginTypeOptions:[{"fullName":"扫码","id":"1"},{"fullName":"手机号","id":"2"}],
loginTypeProps:{"label":"fullName","value":"id" },
adjustStatusOptions:[{"fullName":"未审核","id":"0"},{"fullName":"已审核","id":"1"}],
adjustStatusProps:{"label":"fullName","value":"id" },
entryStatusOptions:[{"fullName":"未入库","id":"0"},{"fullName":"已入库","id":"1"}],
entryStatusProps:{"label":"fullName","value":"id" },
}
},
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/RecycleCleanOrder/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

@ -1,688 +0,0 @@
<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="small" label-width="120px" label-position="right" >
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="8" >
<jnpf-form-tip-item
label="设备编码" prop="deviceCode" >
<JnpfPopupSelect v-model="dataForm.deviceCode" @change="changeData('deviceCode',-1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.deviceCode" placeholder="请选择" propsValue="device_code" popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='device_name' field='deviceCode' interfaceId="564713894723988869" :pageSize="20" :columnOptions="deviceCodecolumnOptions" clearable :style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="桶编码" prop="bucketCode" >
<JnpfInput v-model="dataForm.bucketCode" @change="changeData('bucketCode',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="门号" prop="doorNum" >
<JnpfInput v-model="dataForm.doorNum" @change="changeData('doorNum',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="回收品大类" prop="productCode" >
<JnpfRadio v-model="dataForm.productCode" @change="changeData('productCode',-1)"
optionType="default" direction="horizontal" size="small" :options="productCodeOptions" :props="productCodeProps" >
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="回收品子类" prop="productSubCode" >
<JnpfRadio v-model="dataForm.productSubCode" @change="changeData('productSubCode',-1)"
optionType="default" direction="horizontal" size="small" :options="productSubCodeOptions" :props="productSubCodeProps" >
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="机柜清运单号" prop="deviceOrderNo" >
<JnpfInput v-model="dataForm.deviceOrderNo" @change="changeData('deviceOrderNo',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="单价" prop="price" >
<JnpfInputNumber v-model="dataForm.price" @change="changeData('price',-1)"
placeholder="数字文本" :precision="2" :step="1" >
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="清运重量" prop="weight" >
<JnpfInputNumber v-model="dataForm.weight" @change="changeData('weight',-1)"
placeholder="数字文本" :precision="2" :step="1" >
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="总价" prop="totalPrice" >
<JnpfInputNumber v-model="dataForm.totalPrice" @change="changeData('totalPrice',-1)"
placeholder="数字文本" :precision="2" :step="1" >
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="审核后重量" prop="adjustWeight" >
<JnpfInputNumber v-model="dataForm.adjustWeight" @change="changeData('adjustWeight',-1)"
placeholder="数字文本" :precision="2" :step="1" >
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="审核后总价" prop="adjustPrice" >
<JnpfInputNumber v-model="dataForm.adjustPrice" @change="changeData('adjustPrice',-1)"
placeholder="数字文本" :precision="2" :step="1" >
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="清运员" prop="cleanUserId" >
<JnpfUserSelect v-model="dataForm.cleanUserId" @change="changeData('cleanUserId',-1)"
placeholder="请选择" selectType="all" :ableIds="ableAll.cleanUserIdableIds" clearable :style='{"width":"100%"}'>
</JnpfUserSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="清运员手机号" prop="phone" >
<JnpfInput v-model="dataForm.phone" @change="changeData('phone',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="登录方式" prop="loginType" >
<JnpfRadio v-model="dataForm.loginType" @change="changeData('loginType',-1)"
optionType="button" direction="horizontal" size="small" :options="loginTypeOptions" :props="loginTypeProps" >
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="开始时间" prop="startTime" >
<JnpfInput v-model="dataForm.startTime" @change="changeData('startTime',-1)"
placeholder="请输入" readonly :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="完成时间" prop="finishTime" >
<JnpfInput v-model="dataForm.finishTime" @change="changeData('finishTime',-1)"
placeholder="请输入" readonly :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="上报时间" prop="reportTime" >
<JnpfInput v-model="dataForm.reportTime" @change="changeData('reportTime',-1)"
placeholder="请输入" readonly :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="审核状态" prop="adjustStatus" >
<JnpfRadio v-model="dataForm.adjustStatus" @change="changeData('adjustStatus',-1)"
optionType="button" direction="horizontal" size="small" :options="adjustStatusOptions" :props="adjustStatusProps" >
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="入库状态" prop="entryStatus" >
<JnpfRadio v-model="dataForm.entryStatus" @change="changeData('entryStatus',-1)"
optionType="button" direction="horizontal" size="small" :options="entryStatusOptions" :props="entryStatusProps" >
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="审核说明" prop="adjustComm" >
<JnpfInput v-model="dataForm.adjustComm" @change="changeData('adjustComm',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="抓拍图片" prop="photo" >
<JnpfUploadImg v-model="dataForm.photo" @change="changeData('photo',-1)"
:fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0" >
</JnpfUploadImg>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="垃圾袋号" prop="bagNo" >
<JnpfInput v-model="dataForm.bagNo" @change="changeData('bagNo',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="租户id" prop="tenantId" >
<JnpfOrganizeSelect v-model="dataForm.tenantId" @change="changeData('tenantId',-1)"
placeholder="请选择" selectType="all" :ableIds="ableAll.tenantIdableIds" clearable :style='{"width":"100%"}'>
</JnpfOrganizeSelect>
</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: {
orderNo : undefined,
deviceCode : undefined,
bucketCode : undefined,
doorNum : undefined,
productCode : undefined,
productSubCode : undefined,
deviceOrderNo : undefined,
price : undefined,
weight : undefined,
totalPrice : undefined,
adjustWeight : undefined,
adjustPrice : undefined,
cleanUserId : undefined,
phone : undefined,
loginType : undefined,
startTime : undefined,
finishTime : undefined,
reportTime : undefined,
adjustStatus : undefined,
entryStatus : undefined,
adjustComm : undefined,
photo : [],
bagNo : undefined,
tenantId : [],
},
tableRequiredData: {},
dataRule:
{
},
deviceCodecolumnOptions:[ {"label":"设备编码","value":"device_code"}, {"label":"设备名称","value":"device_name"},],
productCodeOptions:[],
productCodeProps:{"label":"name","value":"id" },
productSubCodeOptions:[],
productSubCodeProps:{"label":"name","value":"id" },
loginTypeOptions:[{"fullName":"扫码","id":"1"},{"fullName":"手机号","id":"2"}],
loginTypeProps:{"label":"fullName","value":"id" },
adjustStatusOptions:[{"fullName":"未审核","id":"0"},{"fullName":"已审核","id":"1"}],
adjustStatusProps:{"label":"fullName","value":"id" },
entryStatusOptions:[{"fullName":"未入库","id":"0"},{"fullName":"已入库","id":"1"}],
entryStatusProps:{"label":"fullName","value":"id" },
childIndex:-1,
isEdit:false,
interfaceRes: {
orderNo:[] ,
deviceCode:[] ,
bucketCode:[] ,
doorNum:[] ,
productCode:[] ,
productSubCode:[{"dataType":"varchar","defaultValue":"","field":"parent_id","fieldName":"","id":"ZBu5m72","jnpfKey":"radio","relationField":"productCode","required":"0"}] ,
deviceOrderNo:[] ,
price:[] ,
weight:[] ,
totalPrice:[] ,
adjustWeight:[] ,
adjustPrice:[] ,
cleanUserId:[] ,
phone:[] ,
loginType:[] ,
startTime:[] ,
finishTime:[] ,
reportTime:[] ,
adjustStatus:[] ,
entryStatus:[] ,
adjustComm:[] ,
photo:[] ,
bagNo:[] ,
tenantId:[] ,
},
}
},
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/RecycleCleanOrder/'+ 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.getproductCodeOptions();
this.getproductSubCodeOptions();
},
getproductCodeOptions() {
const index = this.childIndex
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.productCode))
for (let i = 0; i < templateJsonList.length; i++) {
let json = templateJsonList[i];
if(json.relationField){
let relationFieldAll = json.relationField.split("-");
let val = json.defaultValue;
if(relationFieldAll.length>1 && index>-1){
val = this.dataForm[relationFieldAll[0]+'List']&&this.dataForm[relationFieldAll[0]+'List'].length?this.dataForm[relationFieldAll[0]+'List'][index][relationFieldAll[1]]:''
}else {
val = this.dataForm[relationFieldAll]
}
json.defaultValue = val
}
}
let template ={
paramList:templateJsonList
}
getDataInterfaceRes('565507078836203205',template).then(res => {
let data = res.data
this.productCodeOptions = data
this.changeDataFormData(1,'productCode','productCode',index,'')
})
},
getproductSubCodeOptions() {
const index = this.childIndex
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.productSubCode))
for (let i = 0; i < templateJsonList.length; i++) {
let json = templateJsonList[i];
if(json.relationField){
let relationFieldAll = json.relationField.split("-");
let val = json.defaultValue;
if(relationFieldAll.length>1 && index>-1){
val = this.dataForm[relationFieldAll[0]+'List']&&this.dataForm[relationFieldAll[0]+'List'].length?this.dataForm[relationFieldAll[0]+'List'][index][relationFieldAll[1]]:''
}else {
val = this.dataForm[relationFieldAll]
}
json.defaultValue = val
}
}
let template ={
paramList:templateJsonList
}
getDataInterfaceRes('565508644465028805',template).then(res => {
let data = res.data
this.productSubCodeOptions = data
this.changeDataFormData(1,'productSubCode','productSubCode',index,'')
})
},
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/RecycleCleanOrder/'+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/RecycleCleanOrder',
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/RecycleCleanOrder/'+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>

@ -1,583 +0,0 @@
<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="清运单号">
<el-input v-model="query.orderNo" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="桶编码">
<el-input v-model="query.bucketCode" placeholder="请输入" clearable> </el-input>
</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="orderNo"
label="清运单号" align="left"
>
</el-table-column>
<el-table-column
prop="deviceCode"
label="设备编码" align="left"
>
</el-table-column>
<el-table-column
prop="bucketCode"
label="桶编码" align="left"
>
</el-table-column>
<el-table-column
prop="doorNum"
label="门号" align="left"
>
</el-table-column>
<el-table-column
prop="productCode"
label="回收品大类" align="left"
>
</el-table-column>
<el-table-column
prop="productSubCode"
label="回收品子类" align="left"
>
</el-table-column>
<el-table-column
prop="deviceOrderNo"
label="机柜清运单号" align="left"
>
</el-table-column>
<el-table-column
prop="price"
label="单价" align="left"
>
<template slot-scope="scope" v-if="scope.row.price" >
<JnpfNumber v-model="scope.row.price" :thousands="false"/>
</template>
</el-table-column>
<el-table-column
prop="weight"
label="清运重量" align="left"
>
<template slot-scope="scope" v-if="scope.row.weight" >
<JnpfNumber v-model="scope.row.weight" :thousands="false"/>
</template>
</el-table-column>
<el-table-column
prop="totalPrice"
label="总价" align="left"
>
<template slot-scope="scope" v-if="scope.row.totalPrice" >
<JnpfNumber v-model="scope.row.totalPrice" :thousands="false"/>
</template>
</el-table-column>
<el-table-column
prop="adjustWeight"
label="审核后重量" align="left"
>
<template slot-scope="scope" v-if="scope.row.adjustWeight" >
<JnpfNumber v-model="scope.row.adjustWeight" :thousands="false"/>
</template>
</el-table-column>
<el-table-column
prop="adjustPrice"
label="审核后总价" align="left"
>
<template slot-scope="scope" v-if="scope.row.adjustPrice" >
<JnpfNumber v-model="scope.row.adjustPrice" :thousands="false"/>
</template>
</el-table-column>
<el-table-column
prop="cleanUserId"
label="清运员" align="left"
>
</el-table-column>
<el-table-column
prop="phone"
label="清运员手机号" align="left"
>
</el-table-column>
<el-table-column label="入库状态" prop="entryStatus" algin="left"
>
<template slot-scope="scope">
{{ scope.row.entryStatus}}
</template>
</el-table-column>
<el-table-column
prop="bagNo"
label="垃圾袋号" align="left"
>
</el-table-column>
<el-table-column label="审核状态" prop="adjustStatus" algin="left"
>
<template slot-scope="scope">
{{ scope.row.adjustStatus}}
</template>
</el-table-column>
<el-table-column
prop="adjustComm"
label="审核说明" align="left"
>
</el-table-column>
<el-table-column
prop="tenantId"
label="租户id" align="left"
>
</el-table-column>
<el-table-column label="登录方式" prop="loginType" algin="left"
>
<template slot-scope="scope">
{{ scope.row.loginType}}
</template>
</el-table-column>
<el-table-column
prop="startTime"
label="开始时间" align="left"
>
</el-table-column>
<el-table-column
prop="finishTime"
label="完成时间" align="left"
>
</el-table-column>
<el-table-column
prop="reportTime"
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: {
orderNo:undefined,
bucketCode: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,
productCodeOptions:[],
productCodeProps:{"label":"name","value":"id" },
productSubCodeOptions:[],
productSubCodeProps:{"label":"name","value":"id" },
loginTypeOptions:[{"fullName":"扫码","id":"1"},{"fullName":"手机号","id":"2"}],
loginTypeProps:{"label":"fullName","value":"id" },
adjustStatusOptions:[{"fullName":"未审核","id":"0"},{"fullName":"已审核","id":"1"}],
adjustStatusProps:{"label":"fullName","value":"id" },
entryStatusOptions:[{"fullName":"未入库","id":"0"},{"fullName":"已入库","id":"1"}],
entryStatusProps:{"label":"fullName","value":"id" },
interfaceRes: {
deviceCode:[] ,
},
}
},
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:'564710229816651141',
type:1,
};
request({
url: `/api/scm/RecycleCleanOrder/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/RecycleCleanOrder/${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/RecycleCleanOrder")
})
},
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/RecycleCleanOrder/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

@ -1,327 +0,0 @@
<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="small" label-width="150px" label-position="right" >
<template v-if="!loading">
<el-col :span="24">
<el-collapse :accordion="false" v-model="activeigptod" class="mb-20">
<el-collapse-item title="投递情况" name="1">
<el-col :span="8" >
<jnpf-form-tip-item label="投递单号"
prop="orderNo" >
<p>{{dataForm.orderNo}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="投递机柜"
prop="deviceCode" >
<p>{{dataForm.deviceCode}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="投递人手机"
prop="phone" >
<p>{{dataForm.phone}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="桶编号"
prop="doorNum" >
<p>{{ dataForm.doorNum }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="回收品大类"
prop="productCode" >
<p>{{dataForm.productCode}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="回收品子类"
prop="productSubCode" >
<p>{{dataForm.productSubCode}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="上报重量"
prop="reportWeight" >
<p>{{dataForm.reportWeight}}KG</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="单价"
prop="price" >
<p>{{dataForm.price}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="总价"
prop="totalPrice" >
<p>{{dataForm.totalPrice}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="桶内原重"
prop="originalWeight" >
<p>{{dataForm.originalWeight}}KG</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="审核重量"
prop="adjustWeight" >
<p>{{dataForm.adjustWeight}}KG</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="审核总价"
prop="adjustPrice" >
<p>{{dataForm.adjustPrice}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="审核状态 "
prop="adjustStatus" >
<p>{{dataForm.adjustStatus}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="审核设置"
prop="adjustSet" >
<p>{{dataForm.adjustSet}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="审核说明"
prop="adjustComm" >
<p>{{dataForm.adjustComm}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="投递照片"
prop="photo" >
<JnpfUploadImg v-model="dataForm.photo"
disabled
detailed :fileSize="2" sizeUnit="MB" :limit="4" pathType="defaultPath" :isAccount="0" >
</JnpfUploadImg>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="开始时间"
prop="startTime" >
<p>{{dataForm.startTime}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="完成时间"
prop="finishTime" >
<p>{{dataForm.finishTime}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="登录方式"
prop="loginType" >
<p>{{ dataForm.loginType }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="机柜单号"
prop="deviceOrderNo" >
<p>{{dataForm.deviceOrderNo}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="桶编号"
prop="bucketCode" >
<p>{{dataForm.bucketCode}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="垃圾袋编号"
prop="bagNo" >
<p>{{dataForm.bagNo}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="上报时间"
prop="reportTime" >
<p>{{dataForm.reportTime}}</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="cleanNo" >
<p>{{dataForm.cleanNo}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="清运员手机号"
prop="cleanerPhone" >
<p>{{dataForm.cleanerPhone}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="清运状态"
prop="cleanStatus" >
<p>{{ dataForm.cleanStatus }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="公司id"
prop="companyId" >
<p>{{dataForm.companyId}}</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>
<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="组织JSONID"
prop="organizeJsonId" >
<p>{{dataForm.organizeJsonId}}</p>
</jnpf-form-tip-item>
</el-col>
</el-collapse-item>
</el-collapse>
</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 :'',
orderNo : '',
deviceCode : "",
phone : '',
doorNum : "",
productCode : "542988676150333899",
productSubCode : [],
reportWeight : '',
price : '',
totalPrice : '',
originalWeight : '',
adjustWeight : "",
adjustPrice : '',
adjustStatus : "",
adjustSet : "",
deliverId : '',
adjustComm : '',
photo : [],
startTime : '',
finishTime : '',
loginType : "",
deviceOrderNo : '',
bucketCode : [],
bagNo : '',
reportTime : '',
cleanNo : '',
cleanerPhone : '',
cleanStatus : "",
companyId : "",
lastModifyTime : "",
lastModifyUserId : "",
organizeJsonId : "",
creatorTime : "",
creatorUserId : "",
},
activeigptod:["1","2"],
deviceCodeProps:{"label":"device_name","value":"device_code" },
doorNumOptions:[{"fullName":"1号","id":"1"},{"fullName":"2号","id":"2"},{"fullName":"3号","id":"3"},{"fullName":"4号","id":"4"},{"fullName":"5号","id":"5"},{"fullName":"6号","id":"6"},{"fullName":"7号","id":"7"},{"fullName":"8号","id":"8"},{"fullName":"9号","id":"9"},{"fullName":"10号","id":"10"},{"fullName":"11号","id":"11"},{"fullName":"12号","id":"12"}],
doorNumProps:{"label":"fullName","value":"id" },
productCodeProps:{"label":"name","value":"id" },
productSubCodeProps:{"label":"name","value":"id" ,"children":"children" },
adjustStatusProps:{"label":"fullName","value":"enCode" },
adjustSetProps:{"label":"fullName","value":"enCode" },
loginTypeOptions:[{"fullName":"扫码","id":"1"},{"fullName":"手机号","id":"2"}],
loginTypeProps:{"label":"fullName","value":"id" },
bucketCodeProps:{"label":"show_name","value":"bucket_code" ,"children":"children" },
cleanStatusOptions:[{"fullName":"未清运","id":"0"},{"fullName":"已清运","id":"1"}],
cleanStatusProps:{"label":"fullName","value":"id" },
}
},
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/RecycleDeliveryOrder/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

@ -1,962 +0,0 @@
<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="small" label-width="150px" label-position="right" >
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="24">
<el-collapse :accordion="false" v-model="activeigptod" class="mb-20">
<el-collapse-item title="投递情况" name="1">
<el-col :span="8" >
<jnpf-form-tip-item
label="投递单号" prop="orderNo" >
<JnpfInput v-model="dataForm.orderNo" @change="changeData('orderNo',-1)"
placeholder="系统自动生成" readonly :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="投递机柜" prop="deviceCode" >
<JnpfSelect v-model="dataForm.deviceCode" @change="changeData('deviceCode',-1)"
placeholder="请选择" clearable :style='{"width":"100%"}' :options="deviceCodeOptions" :props="deviceCodeProps" >
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="投递人手机" prop="phone" >
<JnpfInput v-model="dataForm.phone" @change="changeData('phone',-1)"
placeholder="投递员手机" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="桶编号" prop="doorNum" >
<JnpfSelect v-model="dataForm.doorNum" @change="changeData('doorNum',-1)"
placeholder="请选择" clearable :style='{"width":"100%"}' :options="doorNumOptions" :props="doorNumProps" >
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="回收品大类" prop="productCode" >
<JnpfSelect v-model="dataForm.productCode" @change="changeData('productCode',-1)"
placeholder="请选择" clearable :style='{"width":"100%"}' :options="productCodeOptions" :props="productCodeProps" >
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="回收品子类" prop="productSubCode" >
<JnpfCascader v-model="dataForm.productSubCode" @change="changeData('productSubCode',-1)"
placeholder="请选择" show-all-levels clearable :style='{"width":"100%"}' separator="/" :options="productSubCodeOptions" :props="productSubCodeProps" >
</JnpfCascader>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="上报重量" prop="reportWeight" >
<JnpfInput v-model="dataForm.reportWeight" @change="changeData('reportWeight',-1)"
placeholder="请输入" addonAfter="KG" :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="单价" prop="price" >
<JnpfInput v-model="dataForm.price" @change="changeData('price',-1)"
placeholder="请输入" addonAfter="元" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="总价" prop="totalPrice" >
<JnpfInput v-model="dataForm.totalPrice" @change="changeData('totalPrice',-1)"
placeholder="审核后本单总价" addonAfter="元" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="桶内原重" prop="originalWeight" >
<JnpfInput v-model="dataForm.originalWeight" @change="changeData('originalWeight',-1)"
placeholder="投递前桶内重量" addonAfter="KG" :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="审核重量" prop="adjustWeight" >
<JnpfInput v-model="dataForm.adjustWeight" @change="changeData('adjustWeight',-1)"
placeholder="请输入" addonAfter="KG" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="审核总价" prop="adjustPrice" >
<JnpfInput v-model="dataForm.adjustPrice" @change="changeData('adjustPrice',-1)"
placeholder="审核后本单总价" addonAfter="元" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="审核状态 " prop="adjustStatus" >
<JnpfRadio v-model="dataForm.adjustStatus" @change="changeData('adjustStatus',-1)"
optionType="button" direction="horizontal" size="small" :options="adjustStatusOptions" :props="adjustStatusProps" >
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="审核设置" prop="adjustSet" >
<JnpfRadio v-model="dataForm.adjustSet" @change="changeData('adjustSet',-1)"
disabled optionType="button" direction="horizontal" size="small" :options="adjustSetOptions" :props="adjustSetProps" >
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="审核说明" prop="adjustComm" >
<JnpfTextarea v-model="dataForm.adjustComm" @change="changeData('adjustComm',-1)"
placeholder="请输入" :style='{"width":"100%"}' true type="textarea" :autosize='{"minRows":1,"maxRows":4}' >
</JnpfTextarea>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="投递照片" prop="photo" >
<JnpfUploadImg v-model="dataForm.photo" @change="changeData('photo',-1)"
disabled :fileSize="2" sizeUnit="MB" :limit="4" pathType="defaultPath" :isAccount="0" >
</JnpfUploadImg>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="开始时间" prop="startTime" >
<JnpfInput v-model="dataForm.startTime" @change="changeData('startTime',-1)"
placeholder="请输入" readonly clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="完成时间" prop="finishTime" >
<JnpfInput v-model="dataForm.finishTime" @change="changeData('finishTime',-1)"
placeholder="请输入" readonly clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="登录方式" prop="loginType" >
<JnpfRadio v-model="dataForm.loginType" @change="changeData('loginType',-1)"
optionType="button" direction="horizontal" size="small" :options="loginTypeOptions" :props="loginTypeProps" >
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="机柜单号" prop="deviceOrderNo" >
<JnpfInput v-model="dataForm.deviceOrderNo" @change="changeData('deviceOrderNo',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="桶编号" prop="bucketCode" >
<JnpfCascader v-model="dataForm.bucketCode" @change="changeData('bucketCode',-1)"
placeholder="请选择" show-all-levels clearable :style='{"width":"100%"}' separator="/" :options="bucketCodeOptions" :props="bucketCodeProps" >
</JnpfCascader>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="垃圾袋编号" prop="bagNo" >
<JnpfInput v-model="dataForm.bagNo" @change="changeData('bagNo',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="上报时间" prop="reportTime" >
<JnpfInput v-model="dataForm.reportTime" @change="changeData('reportTime',-1)"
placeholder="请输入" readonly 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="清运单号" prop="cleanNo" >
<JnpfInput v-model="dataForm.cleanNo" @change="changeData('cleanNo',-1)"
placeholder="请输入" readonly clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="清运员手机号" prop="cleanerPhone" >
<JnpfInput v-model="dataForm.cleanerPhone" @change="changeData('cleanerPhone',-1)"
placeholder="请输入" readonly clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="清运状态" prop="cleanStatus" >
<JnpfRadio v-model="dataForm.cleanStatus" @change="changeData('cleanStatus',-1)"
optionType="button" direction="horizontal" size="small" :options="cleanStatusOptions" :props="cleanStatusProps" >
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item
label="公司id" prop="companyId" >
<JnpfOpenData v-model="dataForm.companyId" @change="changeData('companyId',-1)"
placeholder="系统自动生成" readonly :style='{"width":"100%"}' type="currOrganize" showLevel="all" >
</JnpfOpenData>
</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>
<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="组织JSONID" prop="organizeJsonId" >
<JnpfOpenData v-model="dataForm.organizeJsonId" @change="changeData('organizeJsonId',-1)"
placeholder="系统自动生成" readonly :style='{"width":"100%"}' type="currOrganize" showLevel="all" >
</JnpfOpenData>
</jnpf-form-tip-item>
</el-col>
</el-collapse-item>
</el-collapse>
</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: {
orderNo : undefined,
deviceCode : undefined,
phone : undefined,
doorNum : undefined,
productCode : "542988676150333899",
productSubCode : [],
reportWeight : undefined,
price : undefined,
totalPrice : undefined,
originalWeight : undefined,
adjustWeight : undefined,
adjustPrice : undefined,
adjustStatus : undefined,
adjustSet : undefined,
deliverId : undefined,
adjustComm : undefined,
photo : [],
startTime : undefined,
finishTime : undefined,
loginType : undefined,
deviceOrderNo : undefined,
bucketCode : [],
bagNo : undefined,
reportTime : undefined,
cleanNo : undefined,
cleanerPhone : undefined,
cleanStatus : undefined,
companyId : undefined,
lastModifyTime : undefined,
lastModifyUserId : undefined,
organizeJsonId : undefined,
creatorTime : undefined,
creatorUserId : undefined,
},
tableRequiredData: {},
activeigptod:["1","2"],
dataRule:
{
phone: [
{
required: true,
message: '投递员手机',
trigger: 'blur'
},
],
doorNum: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
productCode: [
{
required: true,
message: '请至少选择一个',
trigger: 'change'
},
],
reportWeight: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
price: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
},
],
totalPrice: [
{
required: true,
message: '审核后本单总价',
trigger: 'blur'
},
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的重量',
trigger: 'blur'
},
],
originalWeight: [
{
required: true,
message: '投递前桶内重量',
trigger: 'blur'
},
],
adjustWeight: [
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的重量',
trigger: 'blur'
},
],
adjustPrice: [
{
required: true,
message: '审核后本单总价',
trigger: 'blur'
},
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的重量',
trigger: 'blur'
},
],
adjustStatus: [
{
required: true,
message: '不能为空',
trigger: 'change'
},
],
deviceOrderNo: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
bucketCode: [
{
required: true,
message: '请至少选择一个',
trigger: 'change'
},
],
bagNo: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
cleanerPhone: [
{
pattern: /^1[3456789]\d{9}$/,
message: '请输入正确的手机号码',
trigger: 'blur'
},
],
cleanStatus: [
{
required: true,
message: '不能为空',
trigger: 'change'
},
],
},
deviceCodeOptions:[],
deviceCodeProps:{"label":"device_name","value":"device_code" },
doorNumOptions:[{"fullName":"1号","id":"1"},{"fullName":"2号","id":"2"},{"fullName":"3号","id":"3"},{"fullName":"4号","id":"4"},{"fullName":"5号","id":"5"},{"fullName":"6号","id":"6"},{"fullName":"7号","id":"7"},{"fullName":"8号","id":"8"},{"fullName":"9号","id":"9"},{"fullName":"10号","id":"10"},{"fullName":"11号","id":"11"},{"fullName":"12号","id":"12"}],
doorNumProps:{"label":"fullName","value":"id" },
productCodeOptions:[],
productCodeProps:{"label":"name","value":"id" },
productSubCodeOptions:[],
productSubCodeProps:{"label":"name","value":"id" ,"children":"children" },
adjustStatusOptions:[],
adjustStatusProps:{"label":"fullName","value":"enCode" },
adjustSetOptions:[],
adjustSetProps:{"label":"fullName","value":"enCode" },
loginTypeOptions:[{"fullName":"扫码","id":"1"},{"fullName":"手机号","id":"2"}],
loginTypeProps:{"label":"fullName","value":"id" },
bucketCodeOptions:[],
bucketCodeProps:{"label":"show_name","value":"bucket_code" ,"children":"children" },
cleanStatusOptions:[{"fullName":"未清运","id":"0"},{"fullName":"已清运","id":"1"}],
cleanStatusProps:{"label":"fullName","value":"id" },
childIndex:-1,
isEdit:false,
interfaceRes: {
orderNo:[] ,
deviceCode:[] ,
phone:[] ,
doorNum:[] ,
productCode:[] ,
productSubCode:[{"dataType":"varchar","defaultValue":"","field":"parent_id","fieldName":"","id":"ZBu5m72","jnpfKey":"select","relationField":"productCode","required":"0"}] ,
reportWeight:[] ,
price:[] ,
totalPrice:[] ,
originalWeight:[] ,
adjustWeight:[] ,
adjustPrice:[] ,
adjustStatus:[] ,
adjustSet:[] ,
deliverId:[] ,
adjustComm:[] ,
photo:[] ,
startTime:[] ,
finishTime:[] ,
loginType:[] ,
deviceOrderNo:[] ,
bucketCode:[{"dataType":"varchar","defaultValue":"","field":"device_code","fieldName":"","id":"ow3vw72","jnpfKey":"select","relationField":"deviceCode","required":"0"}] ,
bagNo:[] ,
reportTime:[] ,
cleanNo:[] ,
cleanerPhone:[] ,
cleanStatus:[] ,
companyId:[] ,
lastModifyTime:[] ,
lastModifyUserId:[] ,
organizeJsonId:[] ,
creatorTime:[] ,
creatorUserId:[] ,
},
}
},
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/RecycleDeliveryOrder/'+ 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.getdeviceCodeOptions();
this.getproductCodeOptions();
this.getproductSubCodeOptions();
this.getadjustStatusOptions();
this.getadjustSetOptions();
this.getbucketCodeOptions();
},
getdeviceCodeOptions() {
const index = this.childIndex
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.deviceCode))
for (let i = 0; i < templateJsonList.length; i++) {
let json = templateJsonList[i];
if(json.relationField){
let relationFieldAll = json.relationField.split("-");
let val = json.defaultValue;
if(relationFieldAll.length>1 && index>-1){
val = this.dataForm[relationFieldAll[0]+'List']&&this.dataForm[relationFieldAll[0]+'List'].length?this.dataForm[relationFieldAll[0]+'List'][index][relationFieldAll[1]]:''
}else {
val = this.dataForm[relationFieldAll]
}
json.defaultValue = val
}
}
let template ={
paramList:templateJsonList
}
getDataInterfaceRes('564713894723988869',template).then(res => {
let data = res.data
this.deviceCodeOptions = data
this.changeDataFormData(1,'deviceCode','deviceCode',index,'')
})
},
getproductCodeOptions() {
const index = this.childIndex
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.productCode))
for (let i = 0; i < templateJsonList.length; i++) {
let json = templateJsonList[i];
if(json.relationField){
let relationFieldAll = json.relationField.split("-");
let val = json.defaultValue;
if(relationFieldAll.length>1 && index>-1){
val = this.dataForm[relationFieldAll[0]+'List']&&this.dataForm[relationFieldAll[0]+'List'].length?this.dataForm[relationFieldAll[0]+'List'][index][relationFieldAll[1]]:''
}else {
val = this.dataForm[relationFieldAll]
}
json.defaultValue = val
}
}
let template ={
paramList:templateJsonList
}
getDataInterfaceRes('565507078836203205',template).then(res => {
let data = res.data
this.productCodeOptions = data
this.changeDataFormData(1,'productCode','productCode',index,'542988676150333899')
})
},
getproductSubCodeOptions() {
const index = this.childIndex
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.productSubCode))
for (let i = 0; i < templateJsonList.length; i++) {
let json = templateJsonList[i];
if(json.relationField){
let relationFieldAll = json.relationField.split("-");
let val = json.defaultValue;
if(relationFieldAll.length>1 && index>-1){
val = this.dataForm[relationFieldAll[0]+'List']&&this.dataForm[relationFieldAll[0]+'List'].length?this.dataForm[relationFieldAll[0]+'List'][index][relationFieldAll[1]]:''
}else {
val = this.dataForm[relationFieldAll]
}
json.defaultValue = val
}
}
let template ={
paramList:templateJsonList
}
getDataInterfaceRes('565508644465028805',template).then(res => {
let data = res.data
this.productSubCodeOptions = data
this.changeDataFormData(1,'productSubCode','productSubCode',index,[])
})
},
getadjustStatusOptions() {
getDictionaryDataSelector('565908107083911685').then(res => {
this.adjustStatusOptions = res.data.list
})
},
getadjustSetOptions() {
getDictionaryDataSelector('565907359503749637').then(res => {
this.adjustSetOptions = res.data.list
})
},
getbucketCodeOptions() {
const index = this.childIndex
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.bucketCode))
for (let i = 0; i < templateJsonList.length; i++) {
let json = templateJsonList[i];
if(json.relationField){
let relationFieldAll = json.relationField.split("-");
let val = json.defaultValue;
if(relationFieldAll.length>1 && index>-1){
val = this.dataForm[relationFieldAll[0]+'List']&&this.dataForm[relationFieldAll[0]+'List'].length?this.dataForm[relationFieldAll[0]+'List'][index][relationFieldAll[1]]:''
}else {
val = this.dataForm[relationFieldAll]
}
json.defaultValue = val
}
}
let template ={
paramList:templateJsonList
}
getDataInterfaceRes('565524506681020549',template).then(res => {
let data = res.data
this.bucketCodeOptions = data
this.changeDataFormData(1,'bucketCode','bucketCode',index,[])
})
},
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/RecycleDeliveryOrder/'+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/RecycleDeliveryOrder',
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/RecycleDeliveryOrder/'+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>

@ -1,686 +0,0 @@
<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="投递单号">
<el-input v-model="query.orderNo" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="审核状态 ">
<JnpfSelect v-model="query.adjustStatus" placeholder="请选择" clearable
:options="adjustStatusOptions"
:props="adjustStatusProps" >
</JnpfSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="投递员手机">
<el-input v-model="query.phone" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<template v-if="showAll">
<el-col :span="6">
<el-form-item label="机柜编码">
<JnpfSelect v-model="query.deviceCode" placeholder="请选择" clearable
:options="deviceCodeOptions"
:props="deviceCodeProps" multiple >
</JnpfSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="桶编号">
<JnpfSelect v-model="query.doorNum" placeholder="请选择" clearable
:options="doorNumOptions"
:props="doorNumProps" multiple >
</JnpfSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="桶编码">
<JnpfCascader v-model="query.bucketCode" placeholder="请选择" :options ="bucketCodeOptions" :props="bucketCodeProps"
clearable/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="垃圾袋编号">
<el-input v-model="query.bagNo" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="所属商户">
<JnpfOrganizeSelect v-model="query.companyId" placeholder="请选择" :lastLevel="false" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="清运员手机">
<el-input v-model="query.cleanerPhone" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="清运状态">
<JnpfSelect v-model="query.cleanStatus" placeholder="请选择" clearable
:options="cleanStatusOptions"
:props="cleanStatusProps" >
</JnpfSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="清运单号">
<el-input v-model="query.cleanNo" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
</template>
<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-button type="text" icon="el-icon-arrow-down" @click="showAll=true" v-if="!showAll">
展开
</el-button>
<el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>
收起
</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" @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="companyId"
label="公司id" align="left"
>
</el-table-column>
<el-table-column
prop="orderNo"
label="投递单号" align="left"
>
</el-table-column>
<el-table-column
prop="phone"
label="投递人手机" align="left"
>
</el-table-column>
<el-table-column
prop="deviceCode"
label="投递机柜" align="left"
>
</el-table-column>
<el-table-column label="桶编号" prop="doorNum" algin="left"
>
<template slot-scope="scope">
{{ scope.row.doorNum}}
</template>
</el-table-column>
<el-table-column
prop="originalWeight"
label="桶内原重" align="left"
>
</el-table-column>
<el-table-column
prop="reportWeight"
label="上报重量" align="left"
>
</el-table-column>
<el-table-column
prop="price"
label="单价" align="left"
>
</el-table-column>
<el-table-column
prop="totalPrice"
label="总价" align="left"
>
</el-table-column>
<el-table-column
prop="adjustStatus"
label="审核状态 " align="left"
>
</el-table-column>
<el-table-column
prop="adjustWeight"
label="审核重量" align="left"
>
</el-table-column>
<el-table-column
prop="adjustPrice"
label="审核总价" align="left"
>
</el-table-column>
<el-table-column
prop="adjustComm"
label="审核说明" align="left"
>
</el-table-column>
<el-table-column
prop="bucketCode"
label="桶编号" align="left"
>
</el-table-column>
<el-table-column
prop="bagNo"
label="垃圾袋编号" align="left"
>
</el-table-column>
<el-table-column
prop="productCode"
label="回收品大类" align="left"
>
</el-table-column>
<el-table-column
prop="productSubCode"
label="回收品子类" align="left"
>
</el-table-column>
<el-table-column label="登录方式" prop="loginType" algin="left"
>
<template slot-scope="scope">
{{ scope.row.loginType}}
</template>
</el-table-column>
<el-table-column
prop="startTime"
label="开始时间" align="left"
>
</el-table-column>
<el-table-column
prop="finishTime"
label="完成时间" align="left"
>
</el-table-column>
<el-table-column
prop="reportTime"
label="上报时间" align="left"
>
</el-table-column>
<el-table-column label="清运状态" prop="cleanStatus" algin="left"
>
<template slot-scope="scope">
{{ scope.row.cleanStatus}}
</template>
</el-table-column>
<el-table-column
prop="cleanNo"
label="清运单号" align="left"
>
</el-table-column>
<el-table-column
prop="cleanerPhone"
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)" >编辑
</el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button>
<el-button type="text"
@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,
showAll: false,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
orderNo:undefined,
adjustStatus:undefined,
phone:undefined,
deviceCode:undefined,
doorNum:undefined,
bucketCode:undefined,
bagNo:undefined,
companyId:undefined,
cleanerPhone:undefined,
cleanStatus:undefined,
cleanNo: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,
deviceCodeOptions:[],
deviceCodeProps:{"label":"device_name","value":"device_code" },
doorNumOptions:[{"fullName":"1号","id":"1"},{"fullName":"2号","id":"2"},{"fullName":"3号","id":"3"},{"fullName":"4号","id":"4"},{"fullName":"5号","id":"5"},{"fullName":"6号","id":"6"},{"fullName":"7号","id":"7"},{"fullName":"8号","id":"8"},{"fullName":"9号","id":"9"},{"fullName":"10号","id":"10"},{"fullName":"11号","id":"11"},{"fullName":"12号","id":"12"}],
doorNumProps:{"label":"fullName","value":"id" },
productCodeOptions:[],
productCodeProps:{"label":"name","value":"id" },
productSubCodeOptions:[],
productSubCodeProps:{"label":"name","value":"id" ,"children":"children" },
adjustStatusOptions:[],
adjustStatusProps:{"label":"fullName","value":"enCode" },
adjustSetOptions:[],
adjustSetProps:{"label":"fullName","value":"enCode" },
loginTypeOptions:[{"fullName":"扫码","id":"1"},{"fullName":"手机号","id":"2"}],
loginTypeProps:{"label":"fullName","value":"id" },
bucketCodeOptions:[],
bucketCodeProps:{"label":"show_name","value":"bucket_code" ,"children":"children" },
cleanStatusOptions:[{"fullName":"未清运","id":"0"},{"fullName":"已清运","id":"1"}],
cleanStatusProps:{"label":"fullName","value":"id" },
interfaceRes: {
},
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
this.getColumnList(),
this.initSearchDataAndListData()
this.getadjustStatusOptions();
this.getdeviceCodeOptions();
this.getbucketCodeOptions();
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
},
getadjustStatusOptions() {
getDictionaryDataSelector('565908107083911685').then(res => {
this.adjustStatusOptions = res.data.list
})
},
getdeviceCodeOptions() {
getDataInterfaceRes('564713894723988869').then(res => {
let data = res.data
this.deviceCodeOptions = data
})
},
getbucketCodeOptions() {
getDataInterfaceRes('565524506681020549').then(res => {
let data = res.data
this.bucketCodeOptions = data
})
},
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:'565540808741097605',
type:1,
};
request({
url: `/api/scm/RecycleDeliveryOrder/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/RecycleDeliveryOrder/${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/RecycleDeliveryOrder")
})
},
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/RecycleDeliveryOrder/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>

@ -1,195 +1,191 @@
<template>
<el-dialog title="详情"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right">
<template v-if="!loading">
<el-col :span="24">
<jnpf-form-tip-item label="设备编码"
prop="deviceCode">
<p>{{ dataForm.deviceCode }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="设备名称"
prop="deviceName" tip-label="设备名称">
<p>{{ dataForm.deviceName }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="所在城市"
prop="city">
<p>{{ dataForm.city }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="地址"
prop="address">
<p>{{ dataForm.address }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="投用状态"
prop="useStatus">
<p>{{ dataForm.useStatus }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="设备状态"
prop="status">
<p>{{ dataForm.status }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="所属商户"
prop="beLongCompanyId">
<p>{{ dataForm.beLongCompanyId }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="分配回收站"
prop="beLongStationId" tip-label="分配回收站">
<p>{{ dataForm.beLongStationId }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="所属清运员"
prop="beLongRecyclerPhone">
<p>{{ dataForm.beLongRecyclerPhone }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="设备码二维码"
prop="deviceCodeQr">
<JnpfUploadImg v-model="dataForm.deviceCodeQr"
disabled
detailed :fileSize="100" sizeUnit="MB" :limit="1" pathType="defaultPath" :isAccount="0">
</JnpfUploadImg>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="设备总重"
prop="boxWeight">
<p>{{ dataForm.boxWeight }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="修改用户"
prop="lastModifyUserId">
<p>{{ dataForm.lastModifyUserId }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="修改时间"
prop="lastModifyTime">
<p>{{ dataForm.lastModifyTime }}</p>
</jnpf-form-tip-item>
</el-col>
</template>
</el-form>
<el-dialog title="详情"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="24" >
<jnpf-form-tip-item label="设备编码"
prop="deviceCode" >
<p>{{dataForm.deviceCode}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="设备名称"
prop="deviceName" tip-label="设备名称" >
<p>{{dataForm.deviceName}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="所在城市"
prop="city" >
<p>{{dataForm.city}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="地址"
prop="address" >
<p>{{dataForm.address}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="投用状态"
prop="useStatus" >
<p>{{ dataForm.useStatus }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="设备状态"
prop="status" >
<p>{{ dataForm.status }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="所属商户"
prop="beLongCompanyId" tip-label="绑定回收站" >
<p>{{dataForm.beLongCompanyId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="所属回收站"
prop="beLongStationId" tip-label="绑定回收站" >
<p>{{dataForm.beLongStationId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="所属清运员"
prop="beLongRecyclerPhone" >
<p>{{dataForm.beLongRecyclerPhone}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="设备码二维码"
prop="deviceCodeQr" >
<JnpfUploadImg v-model="dataForm.deviceCodeQr"
disabled
detailed :fileSize="100" sizeUnit="MB" :limit="1" pathType="defaultPath" :isAccount="0" >
</JnpfUploadImg>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="设备总重"
prop="boxWeight" >
<p>{{dataForm.boxWeight}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="修改用户"
prop="lastModifyUserId" >
<p>{{dataForm.lastModifyUserId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="修改时间"
prop="lastModifyTime" >
<p>{{dataForm.lastModifyTime}}</p>
</jnpf-form-tip-item>
</el-col>
</template>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
</span>
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false"/>
</el-dialog>
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
</el-dialog>
</template>
<script>
import request from '@/utils/request'
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"
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,
export default {
components: {Detail},
props: [],
data() {
return {
visible: false,
detailVisible: false,
loading: false,
dataForm: {
id :'',
deviceCode : '',
deviceName : '',
city : [],
address : '',
useStatus : "0",
status : "0",
beLongCompanyId : "",
beLongStationId : "",
beLongRecyclerPhone : "",
deviceCodeQr : [],
ipAddress : '',
boxWeight : '',
latitude : '',
longitude : '',
creatorTime : "",
creatorUserId : "",
lastModifyUserId : "",
lastModifyTime : "",
organizeJsonId : "",
},
useStatusOptions:[{"fullName":"启用","id":"1"},{"fullName":"暂停服务","id":"2"},{"fullName":"关闭","id":"0"}],
useStatusProps:{"label":"fullName","value":"id" },
statusOptions:[{"fullName":"离线","id":"0"},{"fullName":"在线","id":"1"}],
statusProps:{"label":"fullName","value":"id" },
beLongCompanyIdProps:{"label":"f_full_name","value":"f_id" },
beLongStationIdProps:{"label":"station_name","value":"id" },
beLongRecyclerPhoneProps:{"label":"staffs_name","value":"mobile_phone" },
dataForm: {
id: '',
deviceCode: '',
deviceName: '',
city: [],
address: '',
useStatus: "0",
status: "0",
beLongCompanyId: [],
beLongStationId: [],
beLongRecyclerPhone: "",
deviceCodeQr: [],
ipAddress: '',
boxWeight: '',
latitude: '',
longitude: '',
creatorTime: "",
creatorUserId: "",
lastModifyUserId: "",
lastModifyTime: "",
organizeJsonId: "",
},
useStatusOptions: [{"fullName": "启用", "id": "1"}, {"fullName": "暂停服务", "id": "2"}, {
"fullName": "关闭",
"id": "0"
}],
useStatusProps: {"label": "fullName", "value": "id"},
statusOptions: [{"fullName": "离线", "id": "0"}, {"fullName": "在线", "id": "1"}],
statusProps: {"label": "fullName", "value": "id"},
beLongStationIdProps: {"label": "station_name", "value": "id", "children": "children"},
beLongRecyclerPhoneProps: {"label": "staffs_name", "value": "mobile_phone"},
}
},
computed: {},
watch: {},
created() {
}
},
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
},
},
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
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/scm/RecycleDevice/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/scm/RecycleDevice/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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

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