计量管理

master
vayne 2 months ago
parent 412651bfed
commit 1aa6de45f0

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.mapper.MeasureApplyLogMapper">
</mapper>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.mapper.MeasureLogMapper">
</mapper>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.mapper.MeasurePoundMapper">
</mapper>

@ -0,0 +1,16 @@
package jnpf.mapper;
import jnpf.entity.MeasureApplyLogEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* measureApplyLog
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-08-02
*/
public interface MeasureApplyLogMapper extends BaseMapper<MeasureApplyLogEntity> {
}

@ -0,0 +1,16 @@
package jnpf.mapper;
import jnpf.entity.MeasureLogEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* measureLog
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-08-02
*/
public interface MeasureLogMapper extends BaseMapper<MeasureLogEntity> {
}

@ -0,0 +1,16 @@
package jnpf.mapper;
import jnpf.entity.MeasurePoundEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* measurePound
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-08-02
*/
public interface MeasurePoundMapper extends BaseMapper<MeasurePoundEntity> {
}

@ -0,0 +1,35 @@
package jnpf.service;
import jnpf.model.measureapplylog.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* measureApplyLog
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-08-02
*/
public interface MeasureApplyLogService extends IService<MeasureApplyLogEntity> {
List<MeasureApplyLogEntity> getList(MeasureApplyLogPagination measureApplyLogPagination);
List<MeasureApplyLogEntity> getTypeList(MeasureApplyLogPagination measureApplyLogPagination,String dataType);
MeasureApplyLogEntity getInfo(String id);
void delete(MeasureApplyLogEntity entity);
void create(MeasureApplyLogEntity entity);
boolean update(String id, MeasureApplyLogEntity entity);
//子表方法
//副表数据方法
String checkForm(MeasureApplyLogForm form,int i);
void saveOrUpdate(MeasureApplyLogForm measureApplyLogForm,String id, boolean isSave) throws Exception;
}

@ -0,0 +1,35 @@
package jnpf.service;
import jnpf.model.measurelog.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* measureLog
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-08-02
*/
public interface MeasureLogService extends IService<MeasureLogEntity> {
List<MeasureLogEntity> getList(MeasureLogPagination measureLogPagination);
List<MeasureLogEntity> getTypeList(MeasureLogPagination measureLogPagination,String dataType);
MeasureLogEntity getInfo(String id);
void delete(MeasureLogEntity entity);
void create(MeasureLogEntity entity);
boolean update(String id, MeasureLogEntity entity);
//子表方法
//副表数据方法
String checkForm(MeasureLogForm form,int i);
void saveOrUpdate(MeasureLogForm measureLogForm,String id, boolean isSave) throws Exception;
}

@ -0,0 +1,35 @@
package jnpf.service;
import jnpf.model.measurepound.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* measurePound
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-08-02
*/
public interface MeasurePoundService extends IService<MeasurePoundEntity> {
List<MeasurePoundEntity> getList(MeasurePoundPagination measurePoundPagination);
List<MeasurePoundEntity> getTypeList(MeasurePoundPagination measurePoundPagination,String dataType);
MeasurePoundEntity getInfo(String id);
void delete(MeasurePoundEntity entity);
void create(MeasurePoundEntity entity);
boolean update(String id, MeasurePoundEntity entity);
//子表方法
//副表数据方法
String checkForm(MeasurePoundForm form,int i);
void saveOrUpdate(MeasurePoundForm measurePoundForm,String id, boolean isSave) throws Exception;
}

@ -0,0 +1,301 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.MeasureApplyLogMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.measureapplylog.*;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.util.GeneraterSwapUtil;
import jnpf.database.model.superQuery.SuperQueryJsonModel;
import jnpf.database.model.superQuery.ConditionJsonModel;
import jnpf.database.model.superQuery.SuperQueryConditionModel;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.regex.Pattern;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity;
/**
*
* measureApplyLog
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-08-02
*/
@Service
public class MeasureApplyLogServiceImpl extends ServiceImpl<MeasureApplyLogMapper, MeasureApplyLogEntity> implements MeasureApplyLogService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Override
public List<MeasureApplyLogEntity> getList(MeasureApplyLogPagination measureApplyLogPagination){
return getTypeList(measureApplyLogPagination,measureApplyLogPagination.getDataType());
}
/** 列表查询 */
@Override
public List<MeasureApplyLogEntity> getTypeList(MeasureApplyLogPagination measureApplyLogPagination,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 ? MeasureApplyLogConstant.getAppColumnData() : MeasureApplyLogConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int measureApplyLogNum =0;
QueryWrapper<MeasureApplyLogEntity> measureApplyLogQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(measureApplyLogPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = measureApplyLogPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<MeasureApplyLogEntity> measureApplyLogSuperWrapper = new QueryWrapper<>();
measureApplyLogSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(measureApplyLogSuperWrapper,MeasureApplyLogEntity.class,queryJson,"0"));
int measureApplyLogNum1 = measureApplyLogSuperWrapper.getExpression().getNormal().size();
if (measureApplyLogNum1>0){
List<String> measureApplyLogList =this.list(measureApplyLogSuperWrapper).stream().map(MeasureApplyLogEntity::getId).collect(Collectors.toList());
allSuperList.addAll(measureApplyLogList);
intersectionSuperList.add(measureApplyLogList);
superNum++;
}
superOp = superNum > 0 ? superJsonModel.getMatchLogic() : "";
//and or
if(superOp.equalsIgnoreCase("and")){
allSuperIDlist = generaterSwapUtil.getIntersection(intersectionSuperList);
}else{
allSuperIDlist = allSuperList;
}
}
List<String> allRuleIDlist = new ArrayList<>();
String ruleOp ="";
if (ObjectUtil.isNotEmpty(ruleJson)){
List<String> allRuleList = new ArrayList<>();
List<List<String>> intersectionRuleList = new ArrayList<>();
SuperJsonModel ruleJsonModel = JsonUtil.getJsonToBean(ruleJson, SuperJsonModel.class);
int ruleNum = 0;
QueryWrapper<MeasureApplyLogEntity> measureApplyLogSuperWrapper = new QueryWrapper<>();
measureApplyLogSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(measureApplyLogSuperWrapper,MeasureApplyLogEntity.class,ruleJson,"0"));
int measureApplyLogNum1 = measureApplyLogSuperWrapper.getExpression().getNormal().size();
if (measureApplyLogNum1>0){
List<String> measureApplyLogList =this.list(measureApplyLogSuperWrapper).stream().map(MeasureApplyLogEntity::getId).collect(Collectors.toList());
allRuleList.addAll(measureApplyLogList);
intersectionRuleList.add(measureApplyLogList);
ruleNum++;
}
ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : "";
//and or
if(ruleOp.equalsIgnoreCase("and")){
allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList);
}else{
allRuleIDlist = allRuleList;
}
}
boolean pcPermission = false;
boolean appPermission = false;
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object measureApplyLogObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(measureApplyLogQueryWrapper,MeasureApplyLogEntity.class,measureApplyLogPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(measureApplyLogObj)){
return new ArrayList<>();
} else {
measureApplyLogQueryWrapper = (QueryWrapper<MeasureApplyLogEntity>)measureApplyLogObj;
if( measureApplyLogQueryWrapper.getExpression().getNormal().size()>0){
measureApplyLogNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object measureApplyLogObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(measureApplyLogQueryWrapper,MeasureApplyLogEntity.class,measureApplyLogPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(measureApplyLogObj)){
return new ArrayList<>();
} else {
measureApplyLogQueryWrapper = (QueryWrapper<MeasureApplyLogEntity>)measureApplyLogObj;
if( measureApplyLogQueryWrapper.getExpression().getNormal().size()>0){
measureApplyLogNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(measureApplyLogPagination.getMerchantName())){
measureApplyLogNum++;
String value = measureApplyLogPagination.getMerchantName() instanceof List ?
JsonUtil.getObjectToString(measureApplyLogPagination.getMerchantName()) :
String.valueOf(measureApplyLogPagination.getMerchantName());
measureApplyLogQueryWrapper.lambda().like(MeasureApplyLogEntity::getMerchantName,value);
}
if(ObjectUtil.isNotEmpty(measureApplyLogPagination.getCargoType())){
measureApplyLogNum++;
List<String> idList = new ArrayList<>();
try {
String[][] cargoType = JsonUtil.getJsonToBean(measureApplyLogPagination.getCargoType(),String[][].class);
for(int i=0;i<cargoType.length;i++){
if(cargoType[i].length>0){
idList.add(JsonUtil.getObjectToString(Arrays.asList(cargoType[i])));
}
}
}catch (Exception e1){
try {
List<String> cargoType = JsonUtil.getJsonToList(measureApplyLogPagination.getCargoType(),String.class);
if(cargoType.size()>0){
idList.addAll(cargoType);
}
}catch (Exception e2){
idList.add(String.valueOf(measureApplyLogPagination.getCargoType()));
}
}
measureApplyLogQueryWrapper.lambda().and(t->{
idList.forEach(tt->{
t.like(MeasureApplyLogEntity::getCargoType, tt).or();
});
});
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
measureApplyLogQueryWrapper.lambda().in(MeasureApplyLogEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
measureApplyLogQueryWrapper.lambda().and(t->t.in(MeasureApplyLogEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
measureApplyLogQueryWrapper.lambda().and(t->t.in(MeasureApplyLogEntity::getId, finalAllRuleIDlist));
}
//排序
if(StringUtil.isEmpty(measureApplyLogPagination.getSidx())){
measureApplyLogQueryWrapper.lambda().orderByDesc(MeasureApplyLogEntity::getId);
}else{
try {
String sidx = measureApplyLogPagination.getSidx();
String[] strs= sidx.split("_name");
MeasureApplyLogEntity measureApplyLogEntity = new MeasureApplyLogEntity();
Field declaredField = measureApplyLogEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
measureApplyLogQueryWrapper="asc".equals(measureApplyLogPagination.getSort().toLowerCase())?measureApplyLogQueryWrapper.orderByAsc(value):measureApplyLogQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<MeasureApplyLogEntity> page=new Page<>(measureApplyLogPagination.getCurrentPage(), measureApplyLogPagination.getPageSize());
IPage<MeasureApplyLogEntity> userIPage=this.page(page, measureApplyLogQueryWrapper);
return measureApplyLogPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<MeasureApplyLogEntity> list = new ArrayList();
return measureApplyLogPagination.setData(list, list.size());
}
}else{
return this.list(measureApplyLogQueryWrapper);
}
}
@Override
public MeasureApplyLogEntity getInfo(String id){
QueryWrapper<MeasureApplyLogEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(MeasureApplyLogEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(MeasureApplyLogEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, MeasureApplyLogEntity entity){
return this.updateById(entity);
}
@Override
public void delete(MeasureApplyLogEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(MeasureApplyLogForm form,int i) {
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id="";
String countRecover = "";
if (isUp){
id = form.getId();
}
//主表字段验证
if(StringUtil.isNotEmpty(form.getApply())){
if(!Pattern.compile("^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$").matcher(String.valueOf(form.getApply())).matches()){
return "请输入正确的身份证号码";
}
}
return countRecover;
}
/**
* ()
* @param id
* @param measureApplyLogForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(MeasureApplyLogForm measureApplyLogForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
measureApplyLogForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(MeasureApplyLogConstant.getFormData(),measureApplyLogForm),MeasureApplyLogForm.class);
MeasureApplyLogEntity entity = JsonUtil.getJsonToBean(measureApplyLogForm, MeasureApplyLogEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setId(mainId);
}else{
}
this.saveOrUpdate(entity);
}
}

@ -0,0 +1,270 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.MeasureLogMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.measurelog.*;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.util.GeneraterSwapUtil;
import jnpf.database.model.superQuery.SuperQueryJsonModel;
import jnpf.database.model.superQuery.ConditionJsonModel;
import jnpf.database.model.superQuery.SuperQueryConditionModel;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.regex.Pattern;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity;
/**
*
* measureLog
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-08-02
*/
@Service
public class MeasureLogServiceImpl extends ServiceImpl<MeasureLogMapper, MeasureLogEntity> implements MeasureLogService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Override
public List<MeasureLogEntity> getList(MeasureLogPagination measureLogPagination){
return getTypeList(measureLogPagination,measureLogPagination.getDataType());
}
/** 列表查询 */
@Override
public List<MeasureLogEntity> getTypeList(MeasureLogPagination measureLogPagination,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 ? MeasureLogConstant.getAppColumnData() : MeasureLogConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int measureLogNum =0;
QueryWrapper<MeasureLogEntity> measureLogQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(measureLogPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = measureLogPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<MeasureLogEntity> measureLogSuperWrapper = new QueryWrapper<>();
measureLogSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(measureLogSuperWrapper,MeasureLogEntity.class,queryJson,"0"));
int measureLogNum1 = measureLogSuperWrapper.getExpression().getNormal().size();
if (measureLogNum1>0){
List<String> measureLogList =this.list(measureLogSuperWrapper).stream().map(MeasureLogEntity::getId).collect(Collectors.toList());
allSuperList.addAll(measureLogList);
intersectionSuperList.add(measureLogList);
superNum++;
}
superOp = superNum > 0 ? superJsonModel.getMatchLogic() : "";
//and or
if(superOp.equalsIgnoreCase("and")){
allSuperIDlist = generaterSwapUtil.getIntersection(intersectionSuperList);
}else{
allSuperIDlist = allSuperList;
}
}
List<String> allRuleIDlist = new ArrayList<>();
String ruleOp ="";
if (ObjectUtil.isNotEmpty(ruleJson)){
List<String> allRuleList = new ArrayList<>();
List<List<String>> intersectionRuleList = new ArrayList<>();
SuperJsonModel ruleJsonModel = JsonUtil.getJsonToBean(ruleJson, SuperJsonModel.class);
int ruleNum = 0;
QueryWrapper<MeasureLogEntity> measureLogSuperWrapper = new QueryWrapper<>();
measureLogSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(measureLogSuperWrapper,MeasureLogEntity.class,ruleJson,"0"));
int measureLogNum1 = measureLogSuperWrapper.getExpression().getNormal().size();
if (measureLogNum1>0){
List<String> measureLogList =this.list(measureLogSuperWrapper).stream().map(MeasureLogEntity::getId).collect(Collectors.toList());
allRuleList.addAll(measureLogList);
intersectionRuleList.add(measureLogList);
ruleNum++;
}
ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : "";
//and or
if(ruleOp.equalsIgnoreCase("and")){
allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList);
}else{
allRuleIDlist = allRuleList;
}
}
boolean pcPermission = false;
boolean appPermission = false;
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object measureLogObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(measureLogQueryWrapper,MeasureLogEntity.class,measureLogPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(measureLogObj)){
return new ArrayList<>();
} else {
measureLogQueryWrapper = (QueryWrapper<MeasureLogEntity>)measureLogObj;
if( measureLogQueryWrapper.getExpression().getNormal().size()>0){
measureLogNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object measureLogObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(measureLogQueryWrapper,MeasureLogEntity.class,measureLogPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(measureLogObj)){
return new ArrayList<>();
} else {
measureLogQueryWrapper = (QueryWrapper<MeasureLogEntity>)measureLogObj;
if( measureLogQueryWrapper.getExpression().getNormal().size()>0){
measureLogNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(measureLogPagination.getDocumentNo())){
measureLogNum++;
String value = measureLogPagination.getDocumentNo() instanceof List ?
JsonUtil.getObjectToString(measureLogPagination.getDocumentNo()) :
String.valueOf(measureLogPagination.getDocumentNo());
measureLogQueryWrapper.lambda().like(MeasureLogEntity::getDocumentNo,value);
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
measureLogQueryWrapper.lambda().in(MeasureLogEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
measureLogQueryWrapper.lambda().and(t->t.in(MeasureLogEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
measureLogQueryWrapper.lambda().and(t->t.in(MeasureLogEntity::getId, finalAllRuleIDlist));
}
//假删除标志
measureLogQueryWrapper.lambda().isNull(MeasureLogEntity::getDeleteMark);
//排序
if(StringUtil.isEmpty(measureLogPagination.getSidx())){
measureLogQueryWrapper.lambda().orderByDesc(MeasureLogEntity::getId);
}else{
try {
String sidx = measureLogPagination.getSidx();
String[] strs= sidx.split("_name");
MeasureLogEntity measureLogEntity = new MeasureLogEntity();
Field declaredField = measureLogEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
measureLogQueryWrapper="asc".equals(measureLogPagination.getSort().toLowerCase())?measureLogQueryWrapper.orderByAsc(value):measureLogQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<MeasureLogEntity> page=new Page<>(measureLogPagination.getCurrentPage(), measureLogPagination.getPageSize());
IPage<MeasureLogEntity> userIPage=this.page(page, measureLogQueryWrapper);
return measureLogPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<MeasureLogEntity> list = new ArrayList();
return measureLogPagination.setData(list, list.size());
}
}else{
return this.list(measureLogQueryWrapper);
}
}
@Override
public MeasureLogEntity getInfo(String id){
QueryWrapper<MeasureLogEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(MeasureLogEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(MeasureLogEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, MeasureLogEntity entity){
return this.updateById(entity);
}
@Override
public void delete(MeasureLogEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(MeasureLogForm form,int i) {
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id="";
String countRecover = "";
if (isUp){
id = form.getId();
}
//主表字段验证
return countRecover;
}
/**
* ()
* @param id
* @param measureLogForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(MeasureLogForm measureLogForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
measureLogForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(MeasureLogConstant.getFormData(),measureLogForm),MeasureLogForm.class);
MeasureLogEntity entity = JsonUtil.getJsonToBean(measureLogForm, MeasureLogEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setId(mainId);
entity.setVersion(0);
}else{
}
this.saveOrUpdate(entity);
}
}

@ -0,0 +1,312 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.MeasurePoundMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.measurepound.*;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.util.GeneraterSwapUtil;
import jnpf.database.model.superQuery.SuperQueryJsonModel;
import jnpf.database.model.superQuery.ConditionJsonModel;
import jnpf.database.model.superQuery.SuperQueryConditionModel;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.regex.Pattern;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity;
/**
*
* measurePound
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-08-02
*/
@Service
public class MeasurePoundServiceImpl extends ServiceImpl<MeasurePoundMapper, MeasurePoundEntity> implements MeasurePoundService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Override
public List<MeasurePoundEntity> getList(MeasurePoundPagination measurePoundPagination){
return getTypeList(measurePoundPagination,measurePoundPagination.getDataType());
}
/** 列表查询 */
@Override
public List<MeasurePoundEntity> getTypeList(MeasurePoundPagination measurePoundPagination,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 ? MeasurePoundConstant.getAppColumnData() : MeasurePoundConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int measurePoundNum =0;
QueryWrapper<MeasurePoundEntity> measurePoundQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(measurePoundPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = measurePoundPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<MeasurePoundEntity> measurePoundSuperWrapper = new QueryWrapper<>();
measurePoundSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(measurePoundSuperWrapper,MeasurePoundEntity.class,queryJson,"0"));
int measurePoundNum1 = measurePoundSuperWrapper.getExpression().getNormal().size();
if (measurePoundNum1>0){
List<String> measurePoundList =this.list(measurePoundSuperWrapper).stream().map(MeasurePoundEntity::getId).collect(Collectors.toList());
allSuperList.addAll(measurePoundList);
intersectionSuperList.add(measurePoundList);
superNum++;
}
superOp = superNum > 0 ? superJsonModel.getMatchLogic() : "";
//and or
if(superOp.equalsIgnoreCase("and")){
allSuperIDlist = generaterSwapUtil.getIntersection(intersectionSuperList);
}else{
allSuperIDlist = allSuperList;
}
}
List<String> allRuleIDlist = new ArrayList<>();
String ruleOp ="";
if (ObjectUtil.isNotEmpty(ruleJson)){
List<String> allRuleList = new ArrayList<>();
List<List<String>> intersectionRuleList = new ArrayList<>();
SuperJsonModel ruleJsonModel = JsonUtil.getJsonToBean(ruleJson, SuperJsonModel.class);
int ruleNum = 0;
QueryWrapper<MeasurePoundEntity> measurePoundSuperWrapper = new QueryWrapper<>();
measurePoundSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(measurePoundSuperWrapper,MeasurePoundEntity.class,ruleJson,"0"));
int measurePoundNum1 = measurePoundSuperWrapper.getExpression().getNormal().size();
if (measurePoundNum1>0){
List<String> measurePoundList =this.list(measurePoundSuperWrapper).stream().map(MeasurePoundEntity::getId).collect(Collectors.toList());
allRuleList.addAll(measurePoundList);
intersectionRuleList.add(measurePoundList);
ruleNum++;
}
ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : "";
//and or
if(ruleOp.equalsIgnoreCase("and")){
allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList);
}else{
allRuleIDlist = allRuleList;
}
}
boolean pcPermission = false;
boolean appPermission = false;
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object measurePoundObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(measurePoundQueryWrapper,MeasurePoundEntity.class,measurePoundPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(measurePoundObj)){
return new ArrayList<>();
} else {
measurePoundQueryWrapper = (QueryWrapper<MeasurePoundEntity>)measurePoundObj;
if( measurePoundQueryWrapper.getExpression().getNormal().size()>0){
measurePoundNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object measurePoundObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(measurePoundQueryWrapper,MeasurePoundEntity.class,measurePoundPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(measurePoundObj)){
return new ArrayList<>();
} else {
measurePoundQueryWrapper = (QueryWrapper<MeasurePoundEntity>)measurePoundObj;
if( measurePoundQueryWrapper.getExpression().getNormal().size()>0){
measurePoundNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(measurePoundPagination.getPoundDate())){
measurePoundNum++;
List PoundDateList = JsonUtil.getJsonToList(measurePoundPagination.getPoundDate(),String.class);
Long fir = Long.valueOf(String.valueOf(PoundDateList.get(0)));
Long sec = Long.valueOf(String.valueOf(PoundDateList.get(1)));
measurePoundQueryWrapper.lambda().ge(MeasurePoundEntity::getPoundDate, new Date(fir))
.le(MeasurePoundEntity::getPoundDate, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
}
if(ObjectUtil.isNotEmpty(measurePoundPagination.getMerchantName())){
measurePoundNum++;
String value = measurePoundPagination.getMerchantName() instanceof List ?
JsonUtil.getObjectToString(measurePoundPagination.getMerchantName()) :
String.valueOf(measurePoundPagination.getMerchantName());
measurePoundQueryWrapper.lambda().like(MeasurePoundEntity::getMerchantName,value);
}
if(ObjectUtil.isNotEmpty(measurePoundPagination.getPoundType())){
measurePoundNum++;
List<String> idList = new ArrayList<>();
try {
String[][] poundType = JsonUtil.getJsonToBean(measurePoundPagination.getPoundType(),String[][].class);
for(int i=0;i<poundType.length;i++){
if(poundType[i].length>0){
idList.add(JsonUtil.getObjectToString(Arrays.asList(poundType[i])));
}
}
}catch (Exception e1){
try {
List<String> poundType = JsonUtil.getJsonToList(measurePoundPagination.getPoundType(),String.class);
if(poundType.size()>0){
idList.addAll(poundType);
}
}catch (Exception e2){
idList.add(String.valueOf(measurePoundPagination.getPoundType()));
}
}
measurePoundQueryWrapper.lambda().and(t->{
idList.forEach(tt->{
t.like(MeasurePoundEntity::getPoundType, tt).or();
});
});
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
measurePoundQueryWrapper.lambda().in(MeasurePoundEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
measurePoundQueryWrapper.lambda().and(t->t.in(MeasurePoundEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
measurePoundQueryWrapper.lambda().and(t->t.in(MeasurePoundEntity::getId, finalAllRuleIDlist));
}
//假删除标志
measurePoundQueryWrapper.lambda().isNull(MeasurePoundEntity::getDeleteMark);
//排序
if(StringUtil.isEmpty(measurePoundPagination.getSidx())){
measurePoundQueryWrapper.lambda().orderByDesc(MeasurePoundEntity::getId);
}else{
try {
String sidx = measurePoundPagination.getSidx();
String[] strs= sidx.split("_name");
MeasurePoundEntity measurePoundEntity = new MeasurePoundEntity();
Field declaredField = measurePoundEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
measurePoundQueryWrapper="asc".equals(measurePoundPagination.getSort().toLowerCase())?measurePoundQueryWrapper.orderByAsc(value):measurePoundQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<MeasurePoundEntity> page=new Page<>(measurePoundPagination.getCurrentPage(), measurePoundPagination.getPageSize());
IPage<MeasurePoundEntity> userIPage=this.page(page, measurePoundQueryWrapper);
return measurePoundPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<MeasurePoundEntity> list = new ArrayList();
return measurePoundPagination.setData(list, list.size());
}
}else{
return this.list(measurePoundQueryWrapper);
}
}
@Override
public MeasurePoundEntity getInfo(String id){
QueryWrapper<MeasurePoundEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(MeasurePoundEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(MeasurePoundEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, MeasurePoundEntity entity){
return this.updateById(entity);
}
@Override
public void delete(MeasurePoundEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(MeasurePoundForm form,int i) {
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id="";
String countRecover = "";
if (isUp){
id = form.getId();
}
//主表字段验证
return countRecover;
}
/**
* ()
* @param id
* @param measurePoundForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(MeasurePoundForm measurePoundForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
measurePoundForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(MeasurePoundConstant.getFormData(),measurePoundForm),MeasurePoundForm.class);
MeasurePoundEntity entity = JsonUtil.getJsonToBean(measurePoundForm, MeasurePoundEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setId(mainId);
entity.setVersion(0);
}else{
}
this.saveOrUpdate(entity);
}
}

@ -0,0 +1,327 @@
package jnpf.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.exception.DataException;
import jnpf.permission.entity.UserEntity;
import jnpf.service.*;
import jnpf.entity.*;
import jnpf.util.*;
import jnpf.model.measureapplylog.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.web.multipart.MultipartFile;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import java.io.File;
import jnpf.onlinedev.model.ExcelImFieldModel;
import jnpf.onlinedev.model.OnlineImport.ImportDataModel;
import jnpf.onlinedev.model.OnlineImport.ImportFormCheckUniqueModel;
import jnpf.onlinedev.model.OnlineImport.ExcelImportModel;
import jnpf.onlinedev.model.OnlineImport.VisualImportModel;
import cn.xuyanwu.spring.file.storage.FileInfo;
import lombok.Cleanup;
import jnpf.model.visualJson.config.HeaderModel;
import jnpf.base.model.ColumnDataModel;
import jnpf.base.util.VisualUtils;
import org.springframework.transaction.annotation.Transactional;
/**
* measureApplyLog
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-02
*/
@Slf4j
@RestController
@Tag(name = "measureApplyLog" , description = "example")
@RequestMapping("/api/example/MeasureApplyLog")
public class MeasureApplyLogController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private MeasureApplyLogService measureApplyLogService;
@Autowired
private ConfigValueUtil configValueUtil;
/**
*
*
* @param measureApplyLogPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody MeasureApplyLogPagination measureApplyLogPagination)throws IOException{
List<MeasureApplyLogEntity> list= measureApplyLogService.getList(measureApplyLogPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (MeasureApplyLogEntity entity : list) {
Map<String, Object> measureApplyLogMap=JsonUtil.entityToMap(entity);
measureApplyLogMap.put("id", measureApplyLogMap.get("id"));
//副表数据
//子表数据
realList.add(measureApplyLogMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, MeasureApplyLogConstant.getFormData(), MeasureApplyLogConstant.getColumnData(), measureApplyLogPagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(measureApplyLogPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param measureApplyLogForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid MeasureApplyLogForm measureApplyLogForm) {
String b = measureApplyLogService.checkForm(measureApplyLogForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
measureApplyLogService.saveOrUpdate(measureApplyLogForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
* Excel
*
* @return
*/
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody MeasureApplyLogPagination measureApplyLogPagination) throws IOException {
if (StringUtil.isEmpty(measureApplyLogPagination.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
List<MeasureApplyLogEntity> list= measureApplyLogService.getList(measureApplyLogPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (MeasureApplyLogEntity entity : list) {
Map<String, Object> measureApplyLogMap=JsonUtil.entityToMap(entity);
measureApplyLogMap.put("id", measureApplyLogMap.get("id"));
//副表数据
//子表数据
realList.add(measureApplyLogMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, MeasureApplyLogConstant.getFormData(), MeasureApplyLogConstant.getColumnData(), measureApplyLogPagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(measureApplyLogPagination.getSelectKey())?measureApplyLogPagination.getSelectKey():new String[0];
UserInfo userInfo=userProvider.get();
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo);
return ActionResult.success(vo);
}
/**
*
*/
public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){
DownloadVO vo=DownloadVO.builder().build();
List<ExcelExportEntity> entitys=new ArrayList<>();
if(keys.length>0){
for(String key:keys){
switch(key){
case "applyName" :
entitys.add(new ExcelExportEntity("姓名" ,"applyName"));
break;
case "apply" :
entitys.add(new ExcelExportEntity("身份证号" ,"apply"));
break;
case "merchantName" :
entitys.add(new ExcelExportEntity("商户" ,"merchantName"));
break;
case "cargoType" :
entitys.add(new ExcelExportEntity("货物类型" ,"cargoType"));
break;
default:
break;
}
}
}
ExportParams exportParams = new ExportParams(null, "表单信息");
exportParams.setType(ExcelType.XSSF);
try{
@Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size()>0){
if (list.size()==0){
list.add(new HashMap<>());
}
//去除空数据
List<Map<String, Object>> dataList = new ArrayList<>();
for (Map<String, Object> map : list) {
int i = 0;
for (String key : keys) {
//子表
if (key.toLowerCase().startsWith("tablefield")) {
String tableField = key.substring(0, key.indexOf("-" ));
String field = key.substring(key.indexOf("-" ) + 1);
Object o = map.get(tableField);
if (o != null) {
List<Map<String, Object>> childList = (List<Map<String, Object>>) o;
for (Map<String, Object> childMap : childList) {
if (childMap.get(field) != null) {
i++;
}
}
}
} else {
Object o = map.get(key);
if (o != null) {
i++;
}
}
}
if (i > 0) {
dataList.add(map);
}
}
//复杂表头-表头和数据处理
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(MeasureApplyLogConstant.getColumnData(), ColumnDataModel.class);
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList);
}
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList);
}
String fileName = "表单信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
String temporaryFilePath = configValueUtil.getTemporaryFilePath();
FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName);
vo.setName(fileInfo.getFilename());
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName);
} catch (Exception e) {
log.error("信息导出Excel错误:{}", e.getMessage());
e.printStackTrace();
}
return vo;
}
/**
*
* @param id
* @param measureApplyLogForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid MeasureApplyLogForm measureApplyLogForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
measureApplyLogForm.setId(id);
if (!isImport) {
String b = measureApplyLogService.checkForm(measureApplyLogForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
MeasureApplyLogEntity entity= measureApplyLogService.getInfo(id);
if(entity!=null){
try{
measureApplyLogService.saveOrUpdate(measureApplyLogForm,id,false);
}catch(Exception e){
return ActionResult.fail("修改数据失败");
}
return ActionResult.success("更新成功");
}else{
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
*
* @param id
* @return
*/
@Operation(summary = "删除")
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id){
MeasureApplyLogEntity entity= measureApplyLogService.getInfo(id);
if(entity!=null){
//主表数据删除
measureApplyLogService.delete(entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
MeasureApplyLogEntity entity= measureApplyLogService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> measureApplyLogMap=JsonUtil.entityToMap(entity);
measureApplyLogMap.put("id", measureApplyLogMap.get("id"));
//副表数据
//子表数据
measureApplyLogMap = generaterSwapUtil.swapDataDetail(measureApplyLogMap,MeasureApplyLogConstant.getFormData(),"589104056488692549",false);
return ActionResult.success(measureApplyLogMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
MeasureApplyLogEntity entity= measureApplyLogService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> measureApplyLogMap=JsonUtil.entityToMap(entity);
measureApplyLogMap.put("id", measureApplyLogMap.get("id"));
//副表数据
//子表数据
measureApplyLogMap = generaterSwapUtil.swapDataForm(measureApplyLogMap,MeasureApplyLogConstant.getFormData(),MeasureApplyLogConstant.TABLEFIELDKEY,MeasureApplyLogConstant.TABLERENAMES);
return ActionResult.success(measureApplyLogMap);
}
}

@ -0,0 +1,328 @@
package jnpf.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.exception.DataException;
import jnpf.permission.entity.UserEntity;
import jnpf.service.*;
import jnpf.entity.*;
import jnpf.util.*;
import jnpf.model.measurelog.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.web.multipart.MultipartFile;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import java.io.File;
import jnpf.onlinedev.model.ExcelImFieldModel;
import jnpf.onlinedev.model.OnlineImport.ImportDataModel;
import jnpf.onlinedev.model.OnlineImport.ImportFormCheckUniqueModel;
import jnpf.onlinedev.model.OnlineImport.ExcelImportModel;
import jnpf.onlinedev.model.OnlineImport.VisualImportModel;
import cn.xuyanwu.spring.file.storage.FileInfo;
import lombok.Cleanup;
import jnpf.model.visualJson.config.HeaderModel;
import jnpf.base.model.ColumnDataModel;
import jnpf.base.util.VisualUtils;
import org.springframework.transaction.annotation.Transactional;
/**
* measureLog
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-02
*/
@Slf4j
@RestController
@Tag(name = "measureLog" , description = "example")
@RequestMapping("/api/example/MeasureLog")
public class MeasureLogController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private MeasureLogService measureLogService;
@Autowired
private ConfigValueUtil configValueUtil;
/**
*
*
* @param measureLogPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody MeasureLogPagination measureLogPagination)throws IOException{
List<MeasureLogEntity> list= measureLogService.getList(measureLogPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (MeasureLogEntity entity : list) {
Map<String, Object> measureLogMap=JsonUtil.entityToMap(entity);
measureLogMap.put("id", measureLogMap.get("id"));
//副表数据
//子表数据
realList.add(measureLogMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, MeasureLogConstant.getFormData(), MeasureLogConstant.getColumnData(), measureLogPagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(measureLogPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param measureLogForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid MeasureLogForm measureLogForm) {
String b = measureLogService.checkForm(measureLogForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
measureLogService.saveOrUpdate(measureLogForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
* Excel
*
* @return
*/
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody MeasureLogPagination measureLogPagination) throws IOException {
if (StringUtil.isEmpty(measureLogPagination.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
List<MeasureLogEntity> list= measureLogService.getList(measureLogPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (MeasureLogEntity entity : list) {
Map<String, Object> measureLogMap=JsonUtil.entityToMap(entity);
measureLogMap.put("id", measureLogMap.get("id"));
//副表数据
//子表数据
realList.add(measureLogMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, MeasureLogConstant.getFormData(), MeasureLogConstant.getColumnData(), measureLogPagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(measureLogPagination.getSelectKey())?measureLogPagination.getSelectKey():new String[0];
UserInfo userInfo=userProvider.get();
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo);
return ActionResult.success(vo);
}
/**
*
*/
public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){
DownloadVO vo=DownloadVO.builder().build();
List<ExcelExportEntity> entitys=new ArrayList<>();
if(keys.length>0){
for(String key:keys){
switch(key){
case "documentNo" :
entitys.add(new ExcelExportEntity("流水号" ,"documentNo"));
break;
case "siteCode" :
entitys.add(new ExcelExportEntity("站点编码" ,"siteCode"));
break;
case "siteName" :
entitys.add(new ExcelExportEntity("站点名称" ,"siteName"));
break;
case "applyNo" :
entitys.add(new ExcelExportEntity("申请单号" ,"applyNo"));
break;
default:
break;
}
}
}
ExportParams exportParams = new ExportParams(null, "表单信息");
exportParams.setType(ExcelType.XSSF);
try{
@Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size()>0){
if (list.size()==0){
list.add(new HashMap<>());
}
//去除空数据
List<Map<String, Object>> dataList = new ArrayList<>();
for (Map<String, Object> map : list) {
int i = 0;
for (String key : keys) {
//子表
if (key.toLowerCase().startsWith("tablefield")) {
String tableField = key.substring(0, key.indexOf("-" ));
String field = key.substring(key.indexOf("-" ) + 1);
Object o = map.get(tableField);
if (o != null) {
List<Map<String, Object>> childList = (List<Map<String, Object>>) o;
for (Map<String, Object> childMap : childList) {
if (childMap.get(field) != null) {
i++;
}
}
}
} else {
Object o = map.get(key);
if (o != null) {
i++;
}
}
}
if (i > 0) {
dataList.add(map);
}
}
//复杂表头-表头和数据处理
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(MeasureLogConstant.getColumnData(), ColumnDataModel.class);
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList);
}
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList);
}
String fileName = "表单信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
String temporaryFilePath = configValueUtil.getTemporaryFilePath();
FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName);
vo.setName(fileInfo.getFilename());
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName);
} catch (Exception e) {
log.error("信息导出Excel错误:{}", e.getMessage());
e.printStackTrace();
}
return vo;
}
/**
*
* @param id
* @param measureLogForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid MeasureLogForm measureLogForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
measureLogForm.setId(id);
if (!isImport) {
String b = measureLogService.checkForm(measureLogForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
MeasureLogEntity entity= measureLogService.getInfo(id);
if(entity!=null){
try{
measureLogService.saveOrUpdate(measureLogForm,id,false);
}catch(Exception e){
return ActionResult.fail("修改数据失败");
}
return ActionResult.success("更新成功");
}else{
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
*
* @param id
* @return
*/
@Operation(summary = "删除")
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id){
MeasureLogEntity entity= measureLogService.getInfo(id);
if(entity!=null){
//假删除
entity.setDeleteMark(1);
measureLogService.update(id,entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
MeasureLogEntity entity= measureLogService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> measureLogMap=JsonUtil.entityToMap(entity);
measureLogMap.put("id", measureLogMap.get("id"));
//副表数据
//子表数据
measureLogMap = generaterSwapUtil.swapDataDetail(measureLogMap,MeasureLogConstant.getFormData(),"589111214320126789",false);
return ActionResult.success(measureLogMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
MeasureLogEntity entity= measureLogService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> measureLogMap=JsonUtil.entityToMap(entity);
measureLogMap.put("id", measureLogMap.get("id"));
//副表数据
//子表数据
measureLogMap = generaterSwapUtil.swapDataForm(measureLogMap,MeasureLogConstant.getFormData(),MeasureLogConstant.TABLEFIELDKEY,MeasureLogConstant.TABLERENAMES);
return ActionResult.success(measureLogMap);
}
}

@ -0,0 +1,375 @@
package jnpf.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.exception.DataException;
import jnpf.permission.entity.UserEntity;
import jnpf.service.*;
import jnpf.entity.*;
import jnpf.util.*;
import jnpf.model.measurepound.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.web.multipart.MultipartFile;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import java.io.File;
import jnpf.onlinedev.model.ExcelImFieldModel;
import jnpf.onlinedev.model.OnlineImport.ImportDataModel;
import jnpf.onlinedev.model.OnlineImport.ImportFormCheckUniqueModel;
import jnpf.onlinedev.model.OnlineImport.ExcelImportModel;
import jnpf.onlinedev.model.OnlineImport.VisualImportModel;
import cn.xuyanwu.spring.file.storage.FileInfo;
import lombok.Cleanup;
import jnpf.model.visualJson.config.HeaderModel;
import jnpf.base.model.ColumnDataModel;
import jnpf.base.util.VisualUtils;
import org.springframework.transaction.annotation.Transactional;
/**
* measurePound
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-02
*/
@Slf4j
@RestController
@Tag(name = "measurePound" , description = "example")
@RequestMapping("/api/example/MeasurePound")
public class MeasurePoundController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private MeasurePoundService measurePoundService;
@Autowired
private ConfigValueUtil configValueUtil;
/**
*
*
* @param measurePoundPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody MeasurePoundPagination measurePoundPagination)throws IOException{
List<MeasurePoundEntity> list= measurePoundService.getList(measurePoundPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (MeasurePoundEntity entity : list) {
Map<String, Object> measurePoundMap=JsonUtil.entityToMap(entity);
measurePoundMap.put("id", measurePoundMap.get("id"));
//副表数据
//子表数据
realList.add(measurePoundMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, MeasurePoundConstant.getFormData(), MeasurePoundConstant.getColumnData(), measurePoundPagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(measurePoundPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param measurePoundForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid MeasurePoundForm measurePoundForm) {
String b = measurePoundService.checkForm(measurePoundForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
measurePoundService.saveOrUpdate(measurePoundForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
* Excel
*
* @return
*/
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody MeasurePoundPagination measurePoundPagination) throws IOException {
if (StringUtil.isEmpty(measurePoundPagination.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
List<MeasurePoundEntity> list= measurePoundService.getList(measurePoundPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (MeasurePoundEntity entity : list) {
Map<String, Object> measurePoundMap=JsonUtil.entityToMap(entity);
measurePoundMap.put("id", measurePoundMap.get("id"));
//副表数据
//子表数据
realList.add(measurePoundMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, MeasurePoundConstant.getFormData(), MeasurePoundConstant.getColumnData(), measurePoundPagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(measurePoundPagination.getSelectKey())?measurePoundPagination.getSelectKey():new String[0];
UserInfo userInfo=userProvider.get();
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo);
return ActionResult.success(vo);
}
/**
*
*/
public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){
DownloadVO vo=DownloadVO.builder().build();
List<ExcelExportEntity> entitys=new ArrayList<>();
if(keys.length>0){
for(String key:keys){
switch(key){
case "poundNo" :
entitys.add(new ExcelExportEntity("磅单号" ,"poundNo"));
break;
case "status" :
entitys.add(new ExcelExportEntity("磅单状态" ,"status"));
break;
case "applyNo" :
entitys.add(new ExcelExportEntity("申请单号" ,"applyNo"));
break;
case "merchantName" :
entitys.add(new ExcelExportEntity("商户名称" ,"merchantName"));
break;
case "poundType" :
entitys.add(new ExcelExportEntity("磅单类型" ,"poundType"));
break;
case "vehicle" :
entitys.add(new ExcelExportEntity("车牌号" ,"vehicle"));
break;
case "cargoType" :
entitys.add(new ExcelExportEntity("货物类型" ,"cargoType"));
break;
case "grossWeight" :
entitys.add(new ExcelExportEntity("毛重" ,"grossWeight"));
break;
case "tareWeight" :
entitys.add(new ExcelExportEntity("皮重" ,"tareWeight"));
break;
case "netWeight" :
entitys.add(new ExcelExportEntity("净重" ,"netWeight"));
break;
case "poundDate" :
entitys.add(new ExcelExportEntity("磅单时间" ,"poundDate"));
break;
case "confirmer" :
entitys.add(new ExcelExportEntity("确认人" ,"confirmer"));
break;
case "confirmDate" :
entitys.add(new ExcelExportEntity("确认时间" ,"confirmDate"));
break;
default:
break;
}
}
}
ExportParams exportParams = new ExportParams(null, "表单信息");
exportParams.setType(ExcelType.XSSF);
try{
@Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size()>0){
if (list.size()==0){
list.add(new HashMap<>());
}
//去除空数据
List<Map<String, Object>> dataList = new ArrayList<>();
for (Map<String, Object> map : list) {
int i = 0;
for (String key : keys) {
//子表
if (key.toLowerCase().startsWith("tablefield")) {
String tableField = key.substring(0, key.indexOf("-" ));
String field = key.substring(key.indexOf("-" ) + 1);
Object o = map.get(tableField);
if (o != null) {
List<Map<String, Object>> childList = (List<Map<String, Object>>) o;
for (Map<String, Object> childMap : childList) {
if (childMap.get(field) != null) {
i++;
}
}
}
} else {
Object o = map.get(key);
if (o != null) {
i++;
}
}
}
if (i > 0) {
dataList.add(map);
}
}
//复杂表头-表头和数据处理
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(MeasurePoundConstant.getColumnData(), ColumnDataModel.class);
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList);
}
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList);
}
String fileName = "表单信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
String temporaryFilePath = configValueUtil.getTemporaryFilePath();
FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName);
vo.setName(fileInfo.getFilename());
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName);
} catch (Exception e) {
log.error("信息导出Excel错误:{}", e.getMessage());
e.printStackTrace();
}
return vo;
}
/**
*
* @param ids
* @return
*/
@DeleteMapping("/batchRemove")
@Transactional
@Operation(summary = "批量删除")
public ActionResult batchRemove(@RequestBody String ids){
List<String> idList = JsonUtil.getJsonToList(ids, String.class);
int i =0;
for (String allId : idList){
this.delete(allId);
i++;
}
if (i == 0 ){
return ActionResult.fail("删除失败");
}
return ActionResult.success("删除成功");
}
/**
*
* @param id
* @param measurePoundForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid MeasurePoundForm measurePoundForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
measurePoundForm.setId(id);
if (!isImport) {
String b = measurePoundService.checkForm(measurePoundForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
MeasurePoundEntity entity= measurePoundService.getInfo(id);
if(entity!=null){
try{
measurePoundService.saveOrUpdate(measurePoundForm,id,false);
}catch(Exception e){
return ActionResult.fail("修改数据失败");
}
return ActionResult.success("更新成功");
}else{
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
*
* @param id
* @return
*/
@Operation(summary = "删除")
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id){
MeasurePoundEntity entity= measurePoundService.getInfo(id);
if(entity!=null){
//假删除
entity.setDeleteMark(1);
measurePoundService.update(id,entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
MeasurePoundEntity entity= measurePoundService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> measurePoundMap=JsonUtil.entityToMap(entity);
measurePoundMap.put("id", measurePoundMap.get("id"));
//副表数据
//子表数据
measurePoundMap = generaterSwapUtil.swapDataDetail(measurePoundMap,MeasurePoundConstant.getFormData(),"589085812277119749",false);
return ActionResult.success(measurePoundMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
MeasurePoundEntity entity= measurePoundService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> measurePoundMap=JsonUtil.entityToMap(entity);
measurePoundMap.put("id", measurePoundMap.get("id"));
//副表数据
//子表数据
measurePoundMap = generaterSwapUtil.swapDataForm(measurePoundMap,MeasurePoundConstant.getFormData(),MeasurePoundConstant.TABLEFIELDKEY,MeasurePoundConstant.TABLERENAMES);
return ActionResult.success(measurePoundMap);
}
}

@ -0,0 +1,80 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-02
*/
@Data
@TableName("yq_measure_apply_log")
public class MeasureApplyLogEntity {
@TableId(value ="ID" )
private String id;
@TableField("MEASURE_APPLY_CODE")
private String measureApplyCode;
@TableField("STATUS")
private String status;
@TableField("VEHICLE")
private String vehicle;
@TableField(value = "CARGO_TYPE" , updateStrategy = FieldStrategy.IGNORED)
private String cargoType;
@TableField("MERCHANT_ID")
private String merchantId;
@TableField(value = "MERCHANT_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String merchantName;
@TableField(value = "APPLY" , updateStrategy = FieldStrategy.IGNORED)
private String apply;
@TableField(value = "APPLY_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String applyName;
@TableField("APPLY_DATE")
private Date applyDate;
@TableField("SITE_ID")
private String siteId;
@TableField("SITE_CODE")
private String siteCode;
@TableField("SITE_NAME")
private String siteName;
@TableField("GROSS_WEIGHT")
private BigDecimal grossWeight;
@TableField("TARE_WEIGHT")
private BigDecimal tareWeight;
@TableField("NET_WEIGHT")
private BigDecimal netWeight;
@TableField("REMARK")
private String remark;
@TableField("F_CREATOR_TIME")
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
private String deleteUserId;
@TableField("F_DELETE_MARK")
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("ORGANIZE_JSON_ID")
private String organizeJsonId;
@TableField("F_VERSION")
private Integer version;
@TableField("F_FLOW_ID")
private String flowId;
}

@ -0,0 +1,66 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-02
*/
@Data
@TableName("yq_measure_log")
public class MeasureLogEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "DOCUMENT_NO" , updateStrategy = FieldStrategy.IGNORED)
private String documentNo;
@TableField("SITE_ID")
private String siteId;
@TableField(value = "SITE_CODE" , updateStrategy = FieldStrategy.IGNORED)
private String siteCode;
@TableField(value = "SITE_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String siteName;
@TableField("APPLY_ID")
private String applyId;
@TableField(value = "APPLY_NO" , updateStrategy = FieldStrategy.IGNORED)
private String applyNo;
@TableField("WEIGHT")
private BigDecimal weight;
@TableField("WEIGHT_DATE")
private Date weightDate;
@TableField("STATUS")
private String status;
@TableField("REMARK")
private String remark;
@TableField("F_CREATOR_TIME")
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
private String deleteUserId;
@TableField("F_DELETE_MARK")
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("ORGANIZE_JSON_ID")
private String organizeJsonId;
@TableField("F_VERSION")
private Integer version;
@TableField("F_FLOW_ID")
private String flowId;
}

@ -0,0 +1,85 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-02
*/
@Data
@TableName("yq_measure_pound")
public class MeasurePoundEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "POUND_NO" , updateStrategy = FieldStrategy.IGNORED)
private String poundNo;
@TableField("APPLY_ID")
private String applyId;
@TableField(value = "APPLY_NO" , updateStrategy = FieldStrategy.IGNORED)
private String applyNo;
@TableField("MERCHANT_ID")
private String merchantId;
@TableField(value = "MERCHANT_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String merchantName;
@TableField(value = "POUND_TYPE" , updateStrategy = FieldStrategy.IGNORED)
private String poundType;
@TableField(value = "VEHICLE" , updateStrategy = FieldStrategy.IGNORED)
private String vehicle;
@TableField(value = "CARGO_TYPE" , updateStrategy = FieldStrategy.IGNORED)
private String cargoType;
@TableField(value = "GROSS_WEIGHT" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal grossWeight;
@TableField(value = "TARE_WEIGHT" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal tareWeight;
@TableField("BUCKLE_WEIGHT")
private BigDecimal buckleWeight;
@TableField(value = "NET_WEIGHT" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal netWeight;
@TableField("POUND_USER")
private String poundUser;
@TableField(value = "POUND_DATE" , updateStrategy = FieldStrategy.IGNORED)
private Date poundDate;
@TableField(value = "STATUS" , updateStrategy = FieldStrategy.IGNORED)
private String status;
@TableField(value = "CONFIRMER" , updateStrategy = FieldStrategy.IGNORED)
private String confirmer;
@TableField(value = "CONFIRM_DATE" , updateStrategy = FieldStrategy.IGNORED)
private Date confirmDate;
@TableField("REMARK")
private String remark;
@TableField("F_CREATOR_TIME")
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
private String deleteUserId;
@TableField("F_DELETE_MARK")
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("ORGANIZE_JSON_ID")
private String organizeJsonId;
@TableField("F_VERSION")
private Integer version;
@TableField("F_FLOW_ID")
private String flowId;
}

@ -0,0 +1,32 @@
package jnpf.model.measureapplylog;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* measureApplyLog
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-02
*/
@Data
public class MeasureApplyLogForm {
/** 主键 */
private String id;
/** 姓名 **/
@JsonProperty("applyName")
private String applyName;
/** 身份证号 **/
@JsonProperty("apply")
private String apply;
/** 商户 **/
@JsonProperty("merchantName")
private String merchantName;
/** 货物类型 **/
@JsonProperty("cargoType")
private Object cargoType;
}

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

@ -0,0 +1,35 @@
package jnpf.model.measurelog;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* measureLog
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-02
*/
@Data
public class MeasureLogForm {
/** 主键 */
private String id;
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
/** 流水号 **/
@JsonProperty("documentNo")
private String documentNo;
/** 站点编码 **/
@JsonProperty("siteCode")
private String siteCode;
/** 站点名称 **/
@JsonProperty("siteName")
private String siteName;
/** 申请单号 **/
@JsonProperty("applyNo")
private String applyNo;
}

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

@ -0,0 +1,62 @@
package jnpf.model.measurepound;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* measurePound
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-02
*/
@Data
public class MeasurePoundForm {
/** 主键 */
private String id;
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
/** 磅单号 **/
@JsonProperty("poundNo")
private String poundNo;
/** 磅单状态 **/
@JsonProperty("status")
private Object status;
/** 申请单号 **/
@JsonProperty("applyNo")
private String applyNo;
/** 商户名称 **/
@JsonProperty("merchantName")
private String merchantName;
/** 磅单类型 **/
@JsonProperty("poundType")
private Object poundType;
/** 车牌号 **/
@JsonProperty("vehicle")
private String vehicle;
/** 货物类型 **/
@JsonProperty("cargoType")
private Object cargoType;
/** 毛重 **/
@JsonProperty("grossWeight")
private BigDecimal grossWeight;
/** 皮重 **/
@JsonProperty("tareWeight")
private BigDecimal tareWeight;
/** 净重 **/
@JsonProperty("netWeight")
private BigDecimal netWeight;
/** 磅单时间 **/
@JsonProperty("poundDate")
private String poundDate;
/** 确认人 **/
@JsonProperty("confirmer")
private String confirmer;
/** 确认时间 **/
@JsonProperty("confirmDate")
private String confirmDate;
}

@ -0,0 +1,39 @@
package jnpf.model.measurepound;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* measurePound
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-02
*/
@Data
public class MeasurePoundPagination extends Pagination {
/** 查询key */
private String[] selectKey;
/** json */
private String json;
/** 数据类型 0-当前页1-全部数据 */
private String dataType;
/** 高级查询 */
private String superQueryJson;
/** 功能id */
private String moduleId;
/** 菜单id */
private String menuId;
/** 磅单时间 */
@JsonProperty("poundDate")
private Object poundDate;
/** 商户名称 */
@JsonProperty("merchantName")
private Object merchantName;
/** 磅单类型 */
@JsonProperty("poundType")
private Object poundType;
}

@ -0,0 +1,114 @@
<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="12" >
<jnpf-form-tip-item label="姓名"
prop="applyName" >
<p>{{dataForm.applyName}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item label="身份证号"
prop="apply" >
<p>{{dataForm.apply}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item label="商户"
prop="merchantName" >
<p>{{dataForm.merchantName}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item label="货物类型"
prop="cargoType" >
<p>{{ dataForm.cargoType }} </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>
</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 :'',
applyName : '',
apply : '',
merchantName : '',
cargoType : "",
},
cargoTypeOptions:[{"fullName":"货物1","id":"10"},{"fullName":"货物2","id":"20"}],
cargoTypeProps:{"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
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/example/MeasureApplyLog/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
})
},
},
}
</script>

@ -0,0 +1,2 @@
const columnList = [{"clearable":true,"maxlength":null,"jnpfKey":"input","suffixIcon":"","fullName":"姓名","label":"姓名","sortable":false,"align":"left","addonAfter":"","__config__":{"formId":101,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"姓名","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_measure_apply_log","renderKey":1722588504781,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"prop":"applyName","showWordLimit":false,"width":0,"__vModel__":"applyName","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"applyName","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"jnpfKey":"input","suffixIcon":"","fullName":"身份证号","label":"身份证号","sortable":false,"align":"left","addonAfter":"","__config__":{"formId":102,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"身份证号","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_measure_apply_log","renderKey":1722589177166,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[{"pattern":"/^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$/","message":"请输入正确的身份证号码"}],"span":12},"readonly":false,"prop":"apply","showWordLimit":false,"width":0,"__vModel__":"apply","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"apply","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"jnpfKey":"input","suffixIcon":"","fullName":"商户","label":"商户","sortable":false,"align":"left","addonAfter":"","__config__":{"formId":104,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"商户","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_measure_apply_log","renderKey":1722589351592,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"prop":"merchantName","showWordLimit":false,"width":0,"__vModel__":"merchantName","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"merchantName","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"filterable":false,"clearable":true,"jnpfKey":"select","multiple":false,"fullName":"货物类型","label":"货物类型","sortable":false,"align":"left","props":{"label":"fullName","value":"id"},"__config__":{"formId":105,"visibility":["pc","app"],"jnpfKey":"select","defaultValue":"","noShow":false,"dataType":"static","dictionaryType":"","tipLabel":"","dragDisabled":false,"className":[],"label":"货物类型","trigger":"change","propsUrl":"","templateJson":[],"showLabel":true,"required":false,"tableName":"yq_measure_apply_log","renderKey":1722589368643,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-select","propsName":"","tag":"JnpfSelect","regList":[],"span":12},"prop":"cargoType","width":0,"options":[{"fullName":"货物1","id":"10"},{"fullName":"货物2","id":"20"}],"__vModel__":"cargoType","fixed":"none","style":{"width":"100%"},"disabled":false,"interfaceHasPage":false,"id":"cargoType","placeholder":"请选择","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}]
export default columnList

@ -0,0 +1,473 @@
<template>
<el-dialog
:title="!dataForm.id ? '新建' : '编辑'"
: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"
:rules="dataRule"
size="small"
label-width="100px"
label-position="right"
>
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="12">
<jnpf-form-tip-item label="姓名" prop="applyName">
<JnpfInput
v-model="dataForm.applyName"
@change="changeData('applyName', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="身份证号" prop="apply">
<JnpfInput
v-model="dataForm.apply"
@change="changeData('apply', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="商户" prop="merchantName">
<JnpfInput
v-model="dataForm.merchantName"
@change="changeData('merchantName', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="货物类型" prop="cargoType">
<JnpfSelect
v-model="dataForm.cargoType"
@change="changeData('cargoType', -1)"
placeholder="请选择"
clearable
:style="{ width: '100%' }"
:options="cargoTypeOptions"
:props="cargoTypeProps"
>
</JnpfSelect>
</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>
<span slot="footer" class="dialog-footer">
<div class="upAndDown-button" v-if="dataForm.id">
<el-button @click="prev" :disabled="prevDis">
{{ "上一条" }}
</el-button>
<el-button @click="next" :disabled="nextDis">
{{ "下一条" }}
</el-button>
</div>
<el-button
type="primary"
@click="dataFormSubmit(2)"
:loading="continueBtnLoading"
>
{{ !dataForm.id ? "确定并新增" : "确定并继续" }}</el-button
>
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading">
</el-button
>
</span>
</el-dialog>
</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: {
applyName: undefined,
apply: undefined,
merchantName: undefined,
cargoType: undefined
},
tableRequiredData: {},
dataRule: {
apply: [
{
pattern: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
message: "请输入正确的身份证号码",
trigger: "blur"
}
]
},
cargoTypeOptions: [
{ fullName: "货物1", id: "10" },
{ fullName: "货物2", id: "20" }
],
cargoTypeProps: { label: "fullName", value: "id" },
childIndex: -1,
isEdit: false,
interfaceRes: {
applyName: [],
apply: [],
merchantName: [],
cargoType: []
}
};
},
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/example/MeasureApplyLog/" + 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() {},
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/example/MeasureApplyLog/" + 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/example/MeasureApplyLog",
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/example/MeasureApplyLog/" + this.dataForm.id,
method: "PUT",
data: _data
})
.then(res => {
this.$message({
message: res.msg,
type: "success",
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2)
return (this.continueBtnLoading = false);
this.visible = false;
this.btnLoading = false;
this.$emit("refresh", true);
}
});
})
.catch(() => {
this.btnLoading = false;
this.continueBtnLoading = false;
});
}
},
openSelectDialog(key) {
this.currTableConf = this.addTableConf[key];
this.currVmodel = key;
this.selectDialogVisible = true;
this.$nextTick(() => {
this.$refs.selectDialog.init();
});
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i];
if (this["get" + this.currVmodel]) {
this["get" + this.currVmodel](t);
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData);
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue;
} else if (timeType == 2) {
timeDataValue = dataValue;
} else if (timeType == 3) {
timeDataValue = new Date().getTime();
} else if (timeType == 4) {
let previousDate = "";
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue);
timeDataValue = new Date(previousDate).getTime();
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue);
timeDataValue = new Date(previousDate).getTime();
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime();
}
} else if (timeType == 5) {
let previousDate = "";
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue);
timeDataValue = new Date(previousDate).getTime();
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue);
timeDataValue = new Date(previousDate).getTime();
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime();
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == "HH:mm" ? "HH:mm:00" : formatType;
let timeDataValue = null;
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || "00:00:00";
if (timeDataValue.split(":").length == 3) {
timeDataValue = timeDataValue;
} else {
timeDataValue = timeDataValue + ":00";
}
} else if (timeType == 2) {
timeDataValue = dataValue;
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format);
} else if (timeType == 4) {
let previousDate = "";
previousDate = getBeforeTime(timeTarget, timeValue);
timeDataValue = this.jnpf.toDate(previousDate, format);
} else if (timeType == 5) {
let previousDate = "";
previousDate = getLaterTime(timeTarget, timeValue);
timeDataValue = this.jnpf.toDate(previousDate, format);
}
}
return timeDataValue;
},
dataList() {
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll;
this.dataForm = _dataAll;
this.isEdit = true;
this.dataAll();
this.childIndex = -1;
}
}
};
</script>

@ -0,0 +1,508 @@
<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.merchantName"
placeholder="请输入"
clearable
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="货物类型">
<JnpfSelect
v-model="query.cargoType"
placeholder="请选择"
clearable
:options="cargoTypeOptions"
:props="cargoTypeProps"
multiple
>
</JnpfSelect>
</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"
@click="addOrUpdateHandle()"
>新增
</el-button>
<el-button
type="text"
icon="icon-ym icon-ym-btn-download"
@click="exportData()"
>导出
</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="applyName" label="姓名" align="left">
</el-table-column>
<el-table-column prop="apply" label="身份证号" align="left">
</el-table-column>
<el-table-column prop="merchantName" label="商户" align="left">
</el-table-column>
<el-table-column label="货物类型" prop="cargoType" algin="left">
<template slot-scope="scope">
{{ scope.row.cargoType }}
</template>
</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,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
merchantName: undefined,
cargoType: 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,
cargoTypeOptions: [
{ fullName: "货物1", id: "10" },
{ fullName: "货物2", id: "20" }
],
cargoTypeProps: { label: "fullName", value: "id" },
interfaceRes: {}
};
},
computed: {
...mapGetters(["userInfo"]),
menuId() {
return this.$route.meta.modelId || "";
}
},
created() {
this.getColumnList(), this.initSearchDataAndListData();
this.queryData = JSON.parse(JSON.stringify(this.query));
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return;
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return;
let formData = JSON.parse(res.data.formData);
formData.popupType = "general";
this.toFormDetailVisible = true;
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue);
});
});
},
toggleTreeExpand(expands) {
this.refreshTree = false;
this.expandsTree = expands;
this.$nextTick(() => {
this.refreshTree = true;
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null);
});
});
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data;
const config = {
treeInterfaceId: "",
treeTemplateJson: []
};
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || "";
}
}
//
let query = {
paramList: config.treeTemplateJson || []
};
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data;
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
});
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList);
},
transformColumnList(columnList) {
let list = [];
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes("-")) {
list.push(e);
} else {
let prop = e.prop.split("-")[0];
let label = e.label.split("-")[0];
let vModel = e.prop.split("-")[1];
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
};
e.vModel = vModel;
if (!this.expandObj.hasOwnProperty(`${prop}Expand`))
this.$set(this.expandObj, `${prop}Expand`, false);
if (!list.some(o => o.prop === prop)) list.push(newItem);
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e);
break;
}
}
}
}
this.getMergeList(list);
this.getExportList(list);
return list;
},
arraySpanMethod({ column }) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan];
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list));
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + "-child-first"
};
item.children.unshift(child);
}
});
newList.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
});
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
});
}
});
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
});
}
});
},
getExportList(list) {
let exportList = [];
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === "table") {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j]);
}
} else {
exportList.push(list[i]);
}
}
this.exportList = exportList;
},
goDetail(id) {
this.detailVisible = true;
this.$nextTick(() => {
this.$refs.Detail.init(id);
});
},
sortChange({ column, prop, order }) {
this.listQuery.sort = order == "ascending" ? "asc" : "desc";
this.listQuery.sidx = !order ? "" : prop;
this.initData();
},
async initSearchDataAndListData() {
await this.initSearchData();
this.initData();
},
//
async initSearchData() {},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId: this.menuId,
moduleId: "589104056488692549",
type: 1
};
request({
url: `/api/example/MeasureApplyLog/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/example/MeasureApplyLog/${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("", "example/MeasureApplyLog");
});
},
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/example/MeasureApplyLog/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>

@ -0,0 +1,2 @@
const superQueryJson = [{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"姓名","addonAfter":"","__config__":{"formId":101,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"姓名","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_measure_apply_log","renderKey":1722588504781,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"applyName","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"applyName","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"身份证号","addonAfter":"","__config__":{"formId":102,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"身份证号","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_measure_apply_log","renderKey":1722589177166,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[{"pattern":"/^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$/","message":"请输入正确的身份证号码"}],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"apply","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"apply","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"商户","addonAfter":"","__config__":{"formId":104,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"商户","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_measure_apply_log","renderKey":1722589351592,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"merchantName","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"merchantName","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"filterable":false,"clearable":true,"multiple":false,"fullName":"货物类型","props":{"label":"fullName","value":"id"},"__config__":{"formId":105,"visibility":["pc","app"],"jnpfKey":"select","defaultValue":"","noShow":false,"dataType":"static","dictionaryType":"","tipLabel":"","dragDisabled":false,"className":[],"label":"货物类型","trigger":"change","propsUrl":"","templateJson":[],"showLabel":true,"required":false,"tableName":"yq_measure_apply_log","renderKey":1722589368643,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-select","propsName":"","tag":"JnpfSelect","regList":[],"span":12},"options":[{"fullName":"货物1","id":"10"},{"fullName":"货物2","id":"20"}],"__vModel__":"cargoType","style":{"width":"100%"},"disabled":false,"interfaceHasPage":false,"id":"cargoType","placeholder":"请选择","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}]
export default superQueryJson

@ -0,0 +1,114 @@
<template>
<el-dialog
title="详情"
:close-on-click-modal="false"
append-to-body
:visible.sync="visible"
class="JNPF-dialog JNPF-dialog_center"
lock-scroll
width="800px"
>
<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="12">
<jnpf-form-tip-item label="流水号" prop="documentNo">
<p>{{ dataForm.documentNo }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="站点编码" prop="siteCode">
<p>{{ dataForm.siteCode }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="站点名称" prop="siteName">
<p>{{ dataForm.siteName }}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="申请单号" prop="applyNo">
<p>{{ dataForm.applyNo }}</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>
</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: "",
documentNo: "",
siteCode: "",
siteName: "",
applyNo: ""
}
};
},
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;
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if (this.dataForm.id) {
this.loading = true;
request({
url: "/api/example/MeasureLog/detail/" + this.dataForm.id,
method: "get"
}).then(res => {
this.dataInfo(res.data);
this.loading = false;
});
}
});
}
}
};
</script>

@ -0,0 +1,2 @@
const columnList = [{"clearable":true,"maxlength":null,"jnpfKey":"input","suffixIcon":"","fullName":"流水号","label":"流水号","sortable":false,"align":"left","addonAfter":"","__config__":{"formId":101,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"流水号","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_measure_log","renderKey":1722591373747,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"prop":"documentNo","showWordLimit":false,"width":0,"__vModel__":"documentNo","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"documentNo","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"jnpfKey":"input","suffixIcon":"","fullName":"站点编码","label":"站点编码","sortable":false,"align":"left","addonAfter":"","__config__":{"formId":102,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"站点编码","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_measure_log","renderKey":1722591412451,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"prop":"siteCode","showWordLimit":false,"width":0,"__vModel__":"siteCode","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"siteCode","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"jnpfKey":"input","suffixIcon":"","fullName":"站点名称","label":"站点名称","sortable":false,"align":"left","addonAfter":"","__config__":{"formId":103,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"站点名称","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_measure_log","renderKey":1722591420011,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"prop":"siteName","showWordLimit":false,"width":0,"__vModel__":"siteName","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"siteName","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"jnpfKey":"input","suffixIcon":"","fullName":"申请单号","label":"申请单号","sortable":false,"align":"left","addonAfter":"","__config__":{"formId":104,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"申请单号","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_measure_log","renderKey":1722591423984,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"prop":"applyNo","showWordLimit":false,"width":0,"__vModel__":"applyNo","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"applyNo","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}]
export default columnList

@ -0,0 +1,444 @@
<template>
<el-dialog
:title="!dataForm.id ? '新建' : '编辑'"
:close-on-click-modal="false"
append-to-body
:visible.sync="visible"
class="JNPF-dialog JNPF-dialog_center"
lock-scroll
width="800px"
>
<el-row :gutter="15" class="">
<el-form
ref="formRef"
:model="dataForm"
:rules="dataRule"
size="small"
label-width="100px"
label-position="right"
>
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="12">
<jnpf-form-tip-item label="流水号" prop="documentNo">
<JnpfInput
v-model="dataForm.documentNo"
@change="changeData('documentNo', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="站点编码" prop="siteCode">
<JnpfInput
v-model="dataForm.siteCode"
@change="changeData('siteCode', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="站点名称" prop="siteName">
<JnpfInput
v-model="dataForm.siteName"
@change="changeData('siteName', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="申请单号" prop="applyNo">
<JnpfInput
v-model="dataForm.applyNo"
@change="changeData('applyNo', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
</el-form>
<SelectDialog
v-if="selectDialogVisible"
:config="currTableConf"
:formData="dataForm"
ref="selectDialog"
@select="addForSelect"
@close="selectDialogVisible = false"
/>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading">
</el-button
>
</span>
</el-dialog>
</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: {
documentNo: undefined,
siteCode: undefined,
siteName: undefined,
applyNo: undefined,
version: 0
},
tableRequiredData: {},
dataRule: {},
childIndex: -1,
isEdit: false,
interfaceRes: {
documentNo: [],
siteCode: [],
siteName: [],
applyNo: []
}
};
},
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/example/MeasureLog/" + 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() {},
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/example/MeasureLog/" + 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/example/MeasureLog",
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/example/MeasureLog/" + this.dataForm.id,
method: "PUT",
data: _data
})
.then(res => {
this.$message({
message: res.msg,
type: "success",
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2)
return (this.continueBtnLoading = false);
this.visible = false;
this.btnLoading = false;
this.$emit("refresh", true);
}
});
})
.catch(() => {
this.btnLoading = false;
this.continueBtnLoading = false;
});
}
},
openSelectDialog(key) {
this.currTableConf = this.addTableConf[key];
this.currVmodel = key;
this.selectDialogVisible = true;
this.$nextTick(() => {
this.$refs.selectDialog.init();
});
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i];
if (this["get" + this.currVmodel]) {
this["get" + this.currVmodel](t);
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData);
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue;
} else if (timeType == 2) {
timeDataValue = dataValue;
} else if (timeType == 3) {
timeDataValue = new Date().getTime();
} else if (timeType == 4) {
let previousDate = "";
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue);
timeDataValue = new Date(previousDate).getTime();
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue);
timeDataValue = new Date(previousDate).getTime();
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime();
}
} else if (timeType == 5) {
let previousDate = "";
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue);
timeDataValue = new Date(previousDate).getTime();
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue);
timeDataValue = new Date(previousDate).getTime();
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime();
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == "HH:mm" ? "HH:mm:00" : formatType;
let timeDataValue = null;
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || "00:00:00";
if (timeDataValue.split(":").length == 3) {
timeDataValue = timeDataValue;
} else {
timeDataValue = timeDataValue + ":00";
}
} else if (timeType == 2) {
timeDataValue = dataValue;
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format);
} else if (timeType == 4) {
let previousDate = "";
previousDate = getBeforeTime(timeTarget, timeValue);
timeDataValue = this.jnpf.toDate(previousDate, format);
} else if (timeType == 5) {
let previousDate = "";
previousDate = getLaterTime(timeTarget, timeValue);
timeDataValue = this.jnpf.toDate(previousDate, format);
}
}
return timeDataValue;
},
dataList() {
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll;
this.dataForm = _dataAll;
this.isEdit = true;
this.dataAll();
this.childIndex = -1;
}
}
};
</script>

@ -0,0 +1,486 @@
<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.documentNo"
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"
@click="addOrUpdateHandle()"
>新增
</el-button>
<el-button
type="text"
icon="icon-ym icon-ym-btn-download"
@click="exportData()"
>导出
</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="documentNo" label="流水号" align="left">
</el-table-column>
<el-table-column prop="siteCode" label="站点编码" align="left">
</el-table-column>
<el-table-column prop="siteName" label="站点名称" align="left">
</el-table-column>
<el-table-column prop="applyNo" 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,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
documentNo: 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,
interfaceRes: {}
};
},
computed: {
...mapGetters(["userInfo"]),
menuId() {
return this.$route.meta.modelId || "";
}
},
created() {
this.getColumnList(), this.initSearchDataAndListData();
this.queryData = JSON.parse(JSON.stringify(this.query));
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return;
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return;
let formData = JSON.parse(res.data.formData);
formData.popupType = "general";
this.toFormDetailVisible = true;
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue);
});
});
},
toggleTreeExpand(expands) {
this.refreshTree = false;
this.expandsTree = expands;
this.$nextTick(() => {
this.refreshTree = true;
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null);
});
});
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data;
const config = {
treeInterfaceId: "",
treeTemplateJson: []
};
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || "";
}
}
//
let query = {
paramList: config.treeTemplateJson || []
};
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data;
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
});
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList);
},
transformColumnList(columnList) {
let list = [];
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes("-")) {
list.push(e);
} else {
let prop = e.prop.split("-")[0];
let label = e.label.split("-")[0];
let vModel = e.prop.split("-")[1];
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
};
e.vModel = vModel;
if (!this.expandObj.hasOwnProperty(`${prop}Expand`))
this.$set(this.expandObj, `${prop}Expand`, false);
if (!list.some(o => o.prop === prop)) list.push(newItem);
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e);
break;
}
}
}
}
this.getMergeList(list);
this.getExportList(list);
return list;
},
arraySpanMethod({ column }) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan];
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list));
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + "-child-first"
};
item.children.unshift(child);
}
});
newList.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
});
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
});
}
});
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
});
}
});
},
getExportList(list) {
let exportList = [];
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === "table") {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j]);
}
} else {
exportList.push(list[i]);
}
}
this.exportList = exportList;
},
goDetail(id) {
this.detailVisible = true;
this.$nextTick(() => {
this.$refs.Detail.init(id);
});
},
sortChange({ column, prop, order }) {
this.listQuery.sort = order == "ascending" ? "asc" : "desc";
this.listQuery.sidx = !order ? "" : prop;
this.initData();
},
async initSearchDataAndListData() {
await this.initSearchData();
this.initData();
},
//
async initSearchData() {},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId: this.menuId,
moduleId: "589111214320126789",
type: 1
};
request({
url: `/api/example/MeasureLog/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/example/MeasureLog/${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("", "example/MeasureLog");
});
},
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/example/MeasureLog/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>

@ -0,0 +1,2 @@
const superQueryJson = [{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"流水号","addonAfter":"","__config__":{"formId":101,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"流水号","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_measure_log","renderKey":1722591373747,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"documentNo","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"documentNo","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"站点编码","addonAfter":"","__config__":{"formId":102,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"站点编码","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_measure_log","renderKey":1722591412451,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"siteCode","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"siteCode","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"站点名称","addonAfter":"","__config__":{"formId":103,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"站点名称","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_measure_log","renderKey":1722591420011,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"siteName","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"siteName","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"申请单号","addonAfter":"","__config__":{"formId":104,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"申请单号","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_measure_log","renderKey":1722591423984,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"applyNo","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"applyNo","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}]
export default superQueryJson

@ -0,0 +1,190 @@
<template>
<el-dialog title="详情"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="1000px">
<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="8" >
<jnpf-form-tip-item label="磅单号"
prop="poundNo" >
<p>{{dataForm.poundNo}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="磅单状态"
prop="status" >
<p>{{ dataForm.status }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="申请单号"
prop="applyNo" >
<p>{{dataForm.applyNo}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="商户名称"
prop="merchantName" >
<p>{{dataForm.merchantName}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="磅单类型"
prop="poundType" >
<p>{{ dataForm.poundType }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="车牌号"
prop="vehicle" >
<p>{{dataForm.vehicle}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="货物类型"
prop="cargoType" >
<p>{{ dataForm.cargoType }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="毛重"
prop="grossWeight" >
<JnpfNumber v-model="dataForm.grossWeight"
placeholder="数字文本" disabled
:step="1" >
</JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="皮重"
prop="tareWeight" >
<JnpfNumber v-model="dataForm.tareWeight"
placeholder="数字文本" disabled
:step="1" >
</JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="净重"
prop="netWeight" >
<JnpfNumber v-model="dataForm.netWeight"
placeholder="数字文本" disabled
:step="1" >
</JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="磅单时间"
prop="poundDate" >
<p>{{dataForm.poundDate}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="确认人"
prop="confirmer" >
<p>{{dataForm.confirmer}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="确认时间"
prop="confirmDate" >
<p>{{dataForm.confirmDate}}</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>
</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 :'',
poundNo : '',
status : "",
applyNo : '',
merchantName : '',
poundType : "",
vehicle : '',
cargoType : "",
grossWeight : '',
tareWeight : '',
netWeight : '',
poundDate : '',
confirmer : '',
confirmDate : "",
},
statusOptions:[{"fullName":"已确认","id":"1"},{"fullName":"未确认","id":"2"}],
statusProps:{"label":"fullName","value":"id" },
poundTypeOptions:[{"fullName":"进货","id":"1"},{"fullName":"出货","id":"2"}],
poundTypeProps:{"label":"fullName","value":"id" },
cargoTypeOptions:[{"fullName":"成品","id":"1"},{"fullName":"半成品","id":"2"}],
cargoTypeProps:{"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
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/example/MeasurePound/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
})
},
},
}
</script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,616 @@
<template>
<el-dialog
:title="!dataForm.id ? '新建' : '编辑'"
:close-on-click-modal="false"
append-to-body
:visible.sync="visible"
class="JNPF-dialog JNPF-dialog_center"
lock-scroll
width="1000px"
>
<el-row :gutter="15" class="">
<el-form
ref="formRef"
:model="dataForm"
:rules="dataRule"
size="small"
label-width="100px"
label-position="right"
>
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="8">
<jnpf-form-tip-item label="磅单号" prop="poundNo">
<JnpfInput
v-model="dataForm.poundNo"
@change="changeData('poundNo', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="磅单状态" prop="status">
<JnpfSelect
v-model="dataForm.status"
@change="changeData('status', -1)"
placeholder="请选择"
clearable
:style="{ width: '100%' }"
:options="statusOptions"
:props="statusProps"
>
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="申请单号" prop="applyNo">
<JnpfInput
v-model="dataForm.applyNo"
@change="changeData('applyNo', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="商户名称" prop="merchantName">
<JnpfInput
v-model="dataForm.merchantName"
@change="changeData('merchantName', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="磅单类型" prop="poundType">
<JnpfSelect
v-model="dataForm.poundType"
@change="changeData('poundType', -1)"
placeholder="请选择"
clearable
:style="{ width: '100%' }"
:options="poundTypeOptions"
:props="poundTypeProps"
>
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="车牌号" prop="vehicle">
<JnpfInput
v-model="dataForm.vehicle"
@change="changeData('vehicle', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="货物类型" prop="cargoType">
<JnpfSelect
v-model="dataForm.cargoType"
@change="changeData('cargoType', -1)"
placeholder="请选择"
clearable
:style="{ width: '100%' }"
:options="cargoTypeOptions"
:props="cargoTypeProps"
>
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="毛重" prop="grossWeight">
<JnpfInputNumber
v-model="dataForm.grossWeight"
@change="changeData('grossWeight', -1)"
placeholder="数字文本"
:step="1"
>
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="皮重" prop="tareWeight">
<JnpfInputNumber
v-model="dataForm.tareWeight"
@change="changeData('tareWeight', -1)"
placeholder="数字文本"
:step="1"
>
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="净重" prop="netWeight">
<JnpfInputNumber
v-model="dataForm.netWeight"
@change="changeData('netWeight', -1)"
placeholder="数字文本"
:step="1"
>
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="磅单时间" prop="poundDate">
<JnpfDatePicker
v-model="dataForm.poundDate"
@change="changeData('poundDate', -1)"
:startTime="dateTime(false, 1, 1, '', '')"
:endTime="dateTime(false, 1, 1, '', '')"
placeholder="请选择"
clearable
:style="{ width: '100%' }"
type="datetime"
format="yyyy-MM-dd HH:mm:ss"
>
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="确认人" prop="confirmer">
<JnpfInput
v-model="dataForm.confirmer"
@change="changeData('confirmer', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="确认时间" prop="confirmDate">
<JnpfDatePicker
v-model="dataForm.confirmDate"
@change="changeData('confirmDate', -1)"
:startTime="dateTime(false, 1, 1, '', '')"
:endTime="dateTime(false, 1, 1, '', '')"
placeholder="请选择"
clearable
:style="{ width: '100%' }"
type="datetime"
format="yyyy-MM-dd HH:mm:ss"
>
</JnpfDatePicker>
</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>
<span slot="footer" class="dialog-footer">
<!-- <div class="upAndDown-button" v-if="dataForm.id">
<el-button @click="prev" :disabled="prevDis">
{{ "上一条" }}
</el-button>
<el-button @click="next" :disabled="nextDis">
{{ "下一条" }}
</el-button>
</div>
<el-button
type="primary"
@click="dataFormSubmit(2)"
:loading="continueBtnLoading"
>
{{ !dataForm.id ? "确定并新增" : "确定并继续" }}</el-button
> -->
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading">
</el-button
>
</span>
</el-dialog>
</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: {
poundNo: undefined,
status: undefined,
applyNo: undefined,
merchantName: undefined,
poundType: undefined,
vehicle: undefined,
cargoType: undefined,
grossWeight: undefined,
tareWeight: undefined,
netWeight: undefined,
poundDate: undefined,
confirmer: undefined,
confirmDate: undefined,
version: 0
},
tableRequiredData: {},
dataRule: {},
statusOptions: [
{ fullName: "已确认", id: "1" },
{ fullName: "未确认", id: "2" }
],
statusProps: { label: "fullName", value: "id" },
poundTypeOptions: [
{ fullName: "进货", id: "1" },
{ fullName: "出货", id: "2" }
],
poundTypeProps: { label: "fullName", value: "id" },
cargoTypeOptions: [
{ fullName: "成品", id: "1" },
{ fullName: "半成品", id: "2" }
],
cargoTypeProps: { label: "fullName", value: "id" },
childIndex: -1,
isEdit: false,
interfaceRes: {
poundNo: [],
status: [],
applyNo: [],
merchantName: [],
poundType: [],
vehicle: [],
cargoType: [],
grossWeight: [],
tareWeight: [],
netWeight: [],
poundDate: [],
confirmer: [],
confirmDate: []
}
};
},
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/example/MeasurePound/" + 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() {},
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/example/MeasurePound/" + 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() {
this.dataForm.poundDate = new Date().getTime();
this.dataForm.confirmDate = new Date().getTime();
},
//
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/example/MeasurePound",
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/example/MeasurePound/" + this.dataForm.id,
method: "PUT",
data: _data
})
.then(res => {
this.$message({
message: res.msg,
type: "success",
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2)
return (this.continueBtnLoading = false);
this.visible = false;
this.btnLoading = false;
this.$emit("refresh", true);
}
});
})
.catch(() => {
this.btnLoading = false;
this.continueBtnLoading = false;
});
}
},
openSelectDialog(key) {
this.currTableConf = this.addTableConf[key];
this.currVmodel = key;
this.selectDialogVisible = true;
this.$nextTick(() => {
this.$refs.selectDialog.init();
});
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i];
if (this["get" + this.currVmodel]) {
this["get" + this.currVmodel](t);
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData);
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue;
} else if (timeType == 2) {
timeDataValue = dataValue;
} else if (timeType == 3) {
timeDataValue = new Date().getTime();
} else if (timeType == 4) {
let previousDate = "";
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue);
timeDataValue = new Date(previousDate).getTime();
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue);
timeDataValue = new Date(previousDate).getTime();
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime();
}
} else if (timeType == 5) {
let previousDate = "";
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue);
timeDataValue = new Date(previousDate).getTime();
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue);
timeDataValue = new Date(previousDate).getTime();
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime();
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == "HH:mm" ? "HH:mm:00" : formatType;
let timeDataValue = null;
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || "00:00:00";
if (timeDataValue.split(":").length == 3) {
timeDataValue = timeDataValue;
} else {
timeDataValue = timeDataValue + ":00";
}
} else if (timeType == 2) {
timeDataValue = dataValue;
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format);
} else if (timeType == 4) {
let previousDate = "";
previousDate = getBeforeTime(timeTarget, timeValue);
timeDataValue = this.jnpf.toDate(previousDate, format);
} else if (timeType == 5) {
let previousDate = "";
previousDate = getLaterTime(timeTarget, timeValue);
timeDataValue = this.jnpf.toDate(previousDate, format);
}
}
return timeDataValue;
},
dataList() {
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll;
this.dataForm = _dataAll;
this.isEdit = true;
this.dataAll();
this.childIndex = -1;
}
}
};
</script>

@ -0,0 +1,616 @@
<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="磅单时间">
<JnpfDateRangePicker
v-model="query.poundDate"
format="yyyy-MM-dd"
startPlaceholder="开始日期"
endPlaceholder="结束日期"
>
</JnpfDateRangePicker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="商户名称">
<el-input
v-model="query.merchantName"
placeholder="请输入"
clearable
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="磅单类型">
<JnpfSelect
v-model="query.poundType"
placeholder="请选择"
clearable
:options="poundTypeOptions"
:props="poundTypeProps"
>
</JnpfSelect>
</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"
@click="addOrUpdateHandle()"
>新增
</el-button> -->
<el-button
type="success"
icon="icon-ym icon-ym-btn-upload"
@click="exportData()"
>导出
</el-button>
<!-- <el-button
type="text"
icon="icon-ym icon-ym-btn-clearn"
@click="handleBatchRemoveDel()"
>批量删除
</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"
has-c
@selection-change="handleSelectionChange"
:span-method="arraySpanMethod"
>
<el-table-column prop="poundNo" label="磅单号" align="left">
</el-table-column>
<el-table-column label="磅单状态" prop="status" algin="left">
<template slot-scope="scope">
{{ scope.row.status }}
</template>
</el-table-column>
<el-table-column prop="applyNo" label="申请单号" align="left">
</el-table-column>
<el-table-column prop="merchantName" label="商户名称" align="left">
</el-table-column>
<el-table-column label="磅单类型" prop="poundType" algin="left">
<template slot-scope="scope">
{{ scope.row.poundType }}
</template>
</el-table-column>
<el-table-column prop="vehicle" label="车牌号" align="left">
</el-table-column>
<el-table-column label="货物类型" prop="cargoType" algin="left">
<template slot-scope="scope">
{{ scope.row.cargoType }}
</template>
</el-table-column>
<el-table-column prop="grossWeight" label="毛重" align="left">
<template slot-scope="scope" v-if="scope.row.grossWeight">
<JnpfNumber v-model="scope.row.grossWeight" :thousands="false" />
</template>
</el-table-column>
<el-table-column prop="tareWeight" label="皮重" align="left">
<template slot-scope="scope" v-if="scope.row.tareWeight">
<JnpfNumber v-model="scope.row.tareWeight" :thousands="false" />
</template>
</el-table-column>
<el-table-column prop="netWeight" label="净重" align="left">
<template slot-scope="scope" v-if="scope.row.netWeight">
<JnpfNumber v-model="scope.row.netWeight" :thousands="false" />
</template>
</el-table-column>
<el-table-column prop="poundDate" label="磅单时间" align="left">
</el-table-column>
<el-table-column prop="confirmer" label="确认人" align="left">
</el-table-column>
<el-table-column prop="confirmDate" 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,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
poundDate: undefined,
merchantName: undefined,
poundType: undefined
},
treeProps: {
children: "children",
label: "fullName",
value: "id",
isLeaf: "isLeaf"
},
list: [],
listLoading: false,
multipleSelection: [],
total: 0,
queryData: {},
listQuery: {
superQueryJson: "",
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: ""
},
formVisible: false,
flowVisible: false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
statusOptions: [
{ fullName: "已确认", id: "1" },
{ fullName: "未确认", id: "2" }
],
statusProps: { label: "fullName", value: "id" },
poundTypeOptions: [
{ fullName: "进货", id: "1" },
{ fullName: "出货", id: "2" }
],
poundTypeProps: { label: "fullName", value: "id" },
cargoTypeOptions: [
{ fullName: "成品", id: "1" },
{ fullName: "半成品", id: "2" }
],
cargoTypeProps: { label: "fullName", value: "id" },
interfaceRes: {}
};
},
computed: {
...mapGetters(["userInfo"]),
menuId() {
return this.$route.meta.modelId || "";
}
},
created() {
this.getColumnList(), this.initSearchDataAndListData();
this.queryData = JSON.parse(JSON.stringify(this.query));
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return;
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return;
let formData = JSON.parse(res.data.formData);
formData.popupType = "general";
this.toFormDetailVisible = true;
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue);
});
});
},
toggleTreeExpand(expands) {
this.refreshTree = false;
this.expandsTree = expands;
this.$nextTick(() => {
this.refreshTree = true;
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null);
});
});
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data;
const config = {
treeInterfaceId: "",
treeTemplateJson: []
};
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || "";
}
}
//
let query = {
paramList: config.treeTemplateJson || []
};
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data;
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
});
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList);
},
transformColumnList(columnList) {
let list = [];
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes("-")) {
list.push(e);
} else {
let prop = e.prop.split("-")[0];
let label = e.label.split("-")[0];
let vModel = e.prop.split("-")[1];
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
};
e.vModel = vModel;
if (!this.expandObj.hasOwnProperty(`${prop}Expand`))
this.$set(this.expandObj, `${prop}Expand`, false);
if (!list.some(o => o.prop === prop)) list.push(newItem);
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e);
break;
}
}
}
}
this.getMergeList(list);
this.getExportList(list);
return list;
},
arraySpanMethod({ column }) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan];
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list));
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + "-child-first"
};
item.children.unshift(child);
}
});
newList.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
});
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
});
}
});
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
});
}
});
},
getExportList(list) {
let exportList = [];
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === "table") {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j]);
}
} else {
exportList.push(list[i]);
}
}
this.exportList = exportList;
},
goDetail(id) {
this.detailVisible = true;
this.$nextTick(() => {
this.$refs.Detail.init(id);
});
},
sortChange({ column, prop, order }) {
this.listQuery.sort = order == "ascending" ? "asc" : "desc";
this.listQuery.sidx = !order ? "" : prop;
this.initData();
},
async initSearchDataAndListData() {
await this.initSearchData();
// this.initData();
},
//
async initSearchData() {
let date = new Date();
let dateWithoutTime = new Date(
date.getFullYear(),
date.getMonth(),
date.getDate()
);
this.query.poundDate = [
dateWithoutTime.getTime(),
dateWithoutTime.getTime()
];
},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId: this.menuId,
moduleId: "589085812277119749",
type: 1
};
request({
url: `/api/example/MeasurePound/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/example/MeasurePound/${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("", "example/MeasurePound");
});
},
handleSelectionChange(val) {
const res = val.map(item => item.id);
this.multipleSelection = res;
},
handleBatchRemoveDel() {
if (!this.multipleSelection.length) {
this.$message({
type: "error",
message: "请选择一条数据",
duration: 1500
});
return;
}
const ids = this.multipleSelection;
this.$confirm("您确定要删除这些数据吗, 是否继续?", "提示", {
type: "warning"
})
.then(() => {
request({
url: `/api/example/MeasurePound/batchRemove`,
data: ids,
method: "DELETE"
}).then(res => {
this.$message({
type: "success",
message: res.msg,
onClose: () => {
this.initData();
}
});
});
})
.catch(() => {});
},
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/example/MeasurePound/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

@ -38,7 +38,7 @@
</el-button>
<el-button
type="success"
icon="icon-ym icon-ym-btn-download"
icon="icon-ym icon-ym-btn-upload"
@click="exportData()"
>导出
</el-button>
@ -204,7 +204,7 @@ export default {
isLeaf: "isLeaf"
},
list: [],
listLoading: true,
listLoading: false,
multipleSelection: [],
total: 0,
queryData: {},
@ -400,7 +400,7 @@ export default {
},
async initSearchDataAndListData() {
await this.initSearchData();
this.initData();
// this.initData();
},
//
async initSearchData() {},

Loading…
Cancel
Save