master
zengchenxi 2 months ago
parent 1993f4ee1a
commit 6c3b5d4bb8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -0,0 +1,287 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.YysBillMaterialMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.yysbillmaterial.*;
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;
/**
*
* yysBillMaterial
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-08-08
*/
@Service
public class YysBillMaterialServiceImpl extends ServiceImpl<YysBillMaterialMapper, YysBillMaterialEntity> implements YysBillMaterialService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Override
public List<YysBillMaterialEntity> getList(YysBillMaterialPagination yysBillMaterialPagination){
return getTypeList(yysBillMaterialPagination,yysBillMaterialPagination.getDataType());
}
/** 列表查询 */
@Override
public List<YysBillMaterialEntity> getTypeList(YysBillMaterialPagination yysBillMaterialPagination,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 ? YysBillMaterialConstant.getAppColumnData() : YysBillMaterialConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int yysBillMaterialNum =0;
QueryWrapper<YysBillMaterialEntity> yysBillMaterialQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(yysBillMaterialPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = yysBillMaterialPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<YysBillMaterialEntity> yysBillMaterialSuperWrapper = new QueryWrapper<>();
yysBillMaterialSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysBillMaterialSuperWrapper,YysBillMaterialEntity.class,queryJson,"0"));
int yysBillMaterialNum1 = yysBillMaterialSuperWrapper.getExpression().getNormal().size();
if (yysBillMaterialNum1>0){
List<String> yysBillMaterialList =this.list(yysBillMaterialSuperWrapper).stream().map(YysBillMaterialEntity::getId).collect(Collectors.toList());
allSuperList.addAll(yysBillMaterialList);
intersectionSuperList.add(yysBillMaterialList);
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<YysBillMaterialEntity> yysBillMaterialSuperWrapper = new QueryWrapper<>();
yysBillMaterialSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysBillMaterialSuperWrapper,YysBillMaterialEntity.class,ruleJson,"0"));
int yysBillMaterialNum1 = yysBillMaterialSuperWrapper.getExpression().getNormal().size();
if (yysBillMaterialNum1>0){
List<String> yysBillMaterialList =this.list(yysBillMaterialSuperWrapper).stream().map(YysBillMaterialEntity::getId).collect(Collectors.toList());
allRuleList.addAll(yysBillMaterialList);
intersectionRuleList.add(yysBillMaterialList);
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 yysBillMaterialObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysBillMaterialQueryWrapper,YysBillMaterialEntity.class,yysBillMaterialPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(yysBillMaterialObj)){
return new ArrayList<>();
} else {
yysBillMaterialQueryWrapper = (QueryWrapper<YysBillMaterialEntity>)yysBillMaterialObj;
if( yysBillMaterialQueryWrapper.getExpression().getNormal().size()>0){
yysBillMaterialNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object yysBillMaterialObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysBillMaterialQueryWrapper,YysBillMaterialEntity.class,yysBillMaterialPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(yysBillMaterialObj)){
return new ArrayList<>();
} else {
yysBillMaterialQueryWrapper = (QueryWrapper<YysBillMaterialEntity>)yysBillMaterialObj;
if( yysBillMaterialQueryWrapper.getExpression().getNormal().size()>0){
yysBillMaterialNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(yysBillMaterialPagination.getPieceId())){
yysBillMaterialNum++;
String value = yysBillMaterialPagination.getPieceId() instanceof List ?
JsonUtil.getObjectToString(yysBillMaterialPagination.getPieceId()) :
String.valueOf(yysBillMaterialPagination.getPieceId());
yysBillMaterialQueryWrapper.lambda().like(YysBillMaterialEntity::getPieceId,value);
}
if(ObjectUtil.isNotEmpty(yysBillMaterialPagination.getPieceName())){
yysBillMaterialNum++;
String value = yysBillMaterialPagination.getPieceName() instanceof List ?
JsonUtil.getObjectToString(yysBillMaterialPagination.getPieceName()) :
String.valueOf(yysBillMaterialPagination.getPieceName());
yysBillMaterialQueryWrapper.lambda().like(YysBillMaterialEntity::getPieceName,value);
}
if(ObjectUtil.isNotEmpty(yysBillMaterialPagination.getDocumentStatus())){
yysBillMaterialNum++;
String value = yysBillMaterialPagination.getDocumentStatus() instanceof List ?
JsonUtil.getObjectToString(yysBillMaterialPagination.getDocumentStatus()) :
String.valueOf(yysBillMaterialPagination.getDocumentStatus());
yysBillMaterialQueryWrapper.lambda().like(YysBillMaterialEntity::getDocumentStatus,value);
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
yysBillMaterialQueryWrapper.lambda().in(YysBillMaterialEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
yysBillMaterialQueryWrapper.lambda().and(t->t.in(YysBillMaterialEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
yysBillMaterialQueryWrapper.lambda().and(t->t.in(YysBillMaterialEntity::getId, finalAllRuleIDlist));
}
//排序
if(StringUtil.isEmpty(yysBillMaterialPagination.getSidx())){
yysBillMaterialQueryWrapper.lambda().orderByDesc(YysBillMaterialEntity::getId);
}else{
try {
String sidx = yysBillMaterialPagination.getSidx();
String[] strs= sidx.split("_name");
YysBillMaterialEntity yysBillMaterialEntity = new YysBillMaterialEntity();
Field declaredField = yysBillMaterialEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
yysBillMaterialQueryWrapper="asc".equals(yysBillMaterialPagination.getSort().toLowerCase())?yysBillMaterialQueryWrapper.orderByAsc(value):yysBillMaterialQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<YysBillMaterialEntity> page=new Page<>(yysBillMaterialPagination.getCurrentPage(), yysBillMaterialPagination.getPageSize());
IPage<YysBillMaterialEntity> userIPage=this.page(page, yysBillMaterialQueryWrapper);
return yysBillMaterialPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<YysBillMaterialEntity> list = new ArrayList();
return yysBillMaterialPagination.setData(list, list.size());
}
}else{
return this.list(yysBillMaterialQueryWrapper);
}
}
@Override
public YysBillMaterialEntity getInfo(String id){
QueryWrapper<YysBillMaterialEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(YysBillMaterialEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(YysBillMaterialEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, YysBillMaterialEntity entity){
return this.updateById(entity);
}
@Override
public void delete(YysBillMaterialEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(YysBillMaterialForm 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 yysBillMaterialForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(YysBillMaterialForm yysBillMaterialForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
yysBillMaterialForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(YysBillMaterialConstant.getFormData(),yysBillMaterialForm),YysBillMaterialForm.class);
YysBillMaterialEntity entity = JsonUtil.getJsonToBean(yysBillMaterialForm, YysBillMaterialEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setId(mainId);
}else{
}
this.saveOrUpdate(entity);
}
}

@ -0,0 +1,287 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.YysInventoryQueryMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.yysinventoryquery.*;
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;
/**
*
* yysInventoryQuery
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-08-08
*/
@Service
public class YysInventoryQueryServiceImpl extends ServiceImpl<YysInventoryQueryMapper, YysInventoryQueryEntity> implements YysInventoryQueryService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Override
public List<YysInventoryQueryEntity> getList(YysInventoryQueryPagination yysInventoryQueryPagination){
return getTypeList(yysInventoryQueryPagination,yysInventoryQueryPagination.getDataType());
}
/** 列表查询 */
@Override
public List<YysInventoryQueryEntity> getTypeList(YysInventoryQueryPagination yysInventoryQueryPagination,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 ? YysInventoryQueryConstant.getAppColumnData() : YysInventoryQueryConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int yysInventoryQueryNum =0;
QueryWrapper<YysInventoryQueryEntity> yysInventoryQueryQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(yysInventoryQueryPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = yysInventoryQueryPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<YysInventoryQueryEntity> yysInventoryQuerySuperWrapper = new QueryWrapper<>();
yysInventoryQuerySuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysInventoryQuerySuperWrapper,YysInventoryQueryEntity.class,queryJson,"0"));
int yysInventoryQueryNum1 = yysInventoryQuerySuperWrapper.getExpression().getNormal().size();
if (yysInventoryQueryNum1>0){
List<String> yysInventoryQueryList =this.list(yysInventoryQuerySuperWrapper).stream().map(YysInventoryQueryEntity::getId).collect(Collectors.toList());
allSuperList.addAll(yysInventoryQueryList);
intersectionSuperList.add(yysInventoryQueryList);
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<YysInventoryQueryEntity> yysInventoryQuerySuperWrapper = new QueryWrapper<>();
yysInventoryQuerySuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysInventoryQuerySuperWrapper,YysInventoryQueryEntity.class,ruleJson,"0"));
int yysInventoryQueryNum1 = yysInventoryQuerySuperWrapper.getExpression().getNormal().size();
if (yysInventoryQueryNum1>0){
List<String> yysInventoryQueryList =this.list(yysInventoryQuerySuperWrapper).stream().map(YysInventoryQueryEntity::getId).collect(Collectors.toList());
allRuleList.addAll(yysInventoryQueryList);
intersectionRuleList.add(yysInventoryQueryList);
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 yysInventoryQueryObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysInventoryQueryQueryWrapper,YysInventoryQueryEntity.class,yysInventoryQueryPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(yysInventoryQueryObj)){
return new ArrayList<>();
} else {
yysInventoryQueryQueryWrapper = (QueryWrapper<YysInventoryQueryEntity>)yysInventoryQueryObj;
if( yysInventoryQueryQueryWrapper.getExpression().getNormal().size()>0){
yysInventoryQueryNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object yysInventoryQueryObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysInventoryQueryQueryWrapper,YysInventoryQueryEntity.class,yysInventoryQueryPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(yysInventoryQueryObj)){
return new ArrayList<>();
} else {
yysInventoryQueryQueryWrapper = (QueryWrapper<YysInventoryQueryEntity>)yysInventoryQueryObj;
if( yysInventoryQueryQueryWrapper.getExpression().getNormal().size()>0){
yysInventoryQueryNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(yysInventoryQueryPagination.getMaterialCode())){
yysInventoryQueryNum++;
String value = yysInventoryQueryPagination.getMaterialCode() instanceof List ?
JsonUtil.getObjectToString(yysInventoryQueryPagination.getMaterialCode()) :
String.valueOf(yysInventoryQueryPagination.getMaterialCode());
yysInventoryQueryQueryWrapper.lambda().like(YysInventoryQueryEntity::getMaterialCode,value);
}
if(ObjectUtil.isNotEmpty(yysInventoryQueryPagination.getMaterialName())){
yysInventoryQueryNum++;
String value = yysInventoryQueryPagination.getMaterialName() instanceof List ?
JsonUtil.getObjectToString(yysInventoryQueryPagination.getMaterialName()) :
String.valueOf(yysInventoryQueryPagination.getMaterialName());
yysInventoryQueryQueryWrapper.lambda().like(YysInventoryQueryEntity::getMaterialName,value);
}
if(ObjectUtil.isNotEmpty(yysInventoryQueryPagination.getMaterialClassification())){
yysInventoryQueryNum++;
String value = yysInventoryQueryPagination.getMaterialClassification() instanceof List ?
JsonUtil.getObjectToString(yysInventoryQueryPagination.getMaterialClassification()) :
String.valueOf(yysInventoryQueryPagination.getMaterialClassification());
yysInventoryQueryQueryWrapper.lambda().like(YysInventoryQueryEntity::getMaterialClassification,value);
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
yysInventoryQueryQueryWrapper.lambda().in(YysInventoryQueryEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
yysInventoryQueryQueryWrapper.lambda().and(t->t.in(YysInventoryQueryEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
yysInventoryQueryQueryWrapper.lambda().and(t->t.in(YysInventoryQueryEntity::getId, finalAllRuleIDlist));
}
//排序
if(StringUtil.isEmpty(yysInventoryQueryPagination.getSidx())){
yysInventoryQueryQueryWrapper.lambda().orderByDesc(YysInventoryQueryEntity::getId);
}else{
try {
String sidx = yysInventoryQueryPagination.getSidx();
String[] strs= sidx.split("_name");
YysInventoryQueryEntity yysInventoryQueryEntity = new YysInventoryQueryEntity();
Field declaredField = yysInventoryQueryEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
yysInventoryQueryQueryWrapper="asc".equals(yysInventoryQueryPagination.getSort().toLowerCase())?yysInventoryQueryQueryWrapper.orderByAsc(value):yysInventoryQueryQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<YysInventoryQueryEntity> page=new Page<>(yysInventoryQueryPagination.getCurrentPage(), yysInventoryQueryPagination.getPageSize());
IPage<YysInventoryQueryEntity> userIPage=this.page(page, yysInventoryQueryQueryWrapper);
return yysInventoryQueryPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<YysInventoryQueryEntity> list = new ArrayList();
return yysInventoryQueryPagination.setData(list, list.size());
}
}else{
return this.list(yysInventoryQueryQueryWrapper);
}
}
@Override
public YysInventoryQueryEntity getInfo(String id){
QueryWrapper<YysInventoryQueryEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(YysInventoryQueryEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(YysInventoryQueryEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, YysInventoryQueryEntity entity){
return this.updateById(entity);
}
@Override
public void delete(YysInventoryQueryEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(YysInventoryQueryForm 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 yysInventoryQueryForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(YysInventoryQueryForm yysInventoryQueryForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
yysInventoryQueryForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(YysInventoryQueryConstant.getFormData(),yysInventoryQueryForm),YysInventoryQueryForm.class);
YysInventoryQueryEntity entity = JsonUtil.getJsonToBean(yysInventoryQueryForm, YysInventoryQueryEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setId(mainId);
}else{
}
this.saveOrUpdate(entity);
}
}

@ -0,0 +1,287 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.YysMaterialClassMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.yysmaterialclass.*;
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;
/**
*
* yysMaterialClass
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-08-08
*/
@Service
public class YysMaterialClassServiceImpl extends ServiceImpl<YysMaterialClassMapper, YysMaterialClassEntity> implements YysMaterialClassService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Override
public List<YysMaterialClassEntity> getList(YysMaterialClassPagination yysMaterialClassPagination){
return getTypeList(yysMaterialClassPagination,yysMaterialClassPagination.getDataType());
}
/** 列表查询 */
@Override
public List<YysMaterialClassEntity> getTypeList(YysMaterialClassPagination yysMaterialClassPagination,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 ? YysMaterialClassConstant.getAppColumnData() : YysMaterialClassConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int yysMaterialClassNum =0;
QueryWrapper<YysMaterialClassEntity> yysMaterialClassQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(yysMaterialClassPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = yysMaterialClassPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<YysMaterialClassEntity> yysMaterialClassSuperWrapper = new QueryWrapper<>();
yysMaterialClassSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysMaterialClassSuperWrapper,YysMaterialClassEntity.class,queryJson,"0"));
int yysMaterialClassNum1 = yysMaterialClassSuperWrapper.getExpression().getNormal().size();
if (yysMaterialClassNum1>0){
List<String> yysMaterialClassList =this.list(yysMaterialClassSuperWrapper).stream().map(YysMaterialClassEntity::getId).collect(Collectors.toList());
allSuperList.addAll(yysMaterialClassList);
intersectionSuperList.add(yysMaterialClassList);
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<YysMaterialClassEntity> yysMaterialClassSuperWrapper = new QueryWrapper<>();
yysMaterialClassSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysMaterialClassSuperWrapper,YysMaterialClassEntity.class,ruleJson,"0"));
int yysMaterialClassNum1 = yysMaterialClassSuperWrapper.getExpression().getNormal().size();
if (yysMaterialClassNum1>0){
List<String> yysMaterialClassList =this.list(yysMaterialClassSuperWrapper).stream().map(YysMaterialClassEntity::getId).collect(Collectors.toList());
allRuleList.addAll(yysMaterialClassList);
intersectionRuleList.add(yysMaterialClassList);
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 yysMaterialClassObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysMaterialClassQueryWrapper,YysMaterialClassEntity.class,yysMaterialClassPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(yysMaterialClassObj)){
return new ArrayList<>();
} else {
yysMaterialClassQueryWrapper = (QueryWrapper<YysMaterialClassEntity>)yysMaterialClassObj;
if( yysMaterialClassQueryWrapper.getExpression().getNormal().size()>0){
yysMaterialClassNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object yysMaterialClassObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysMaterialClassQueryWrapper,YysMaterialClassEntity.class,yysMaterialClassPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(yysMaterialClassObj)){
return new ArrayList<>();
} else {
yysMaterialClassQueryWrapper = (QueryWrapper<YysMaterialClassEntity>)yysMaterialClassObj;
if( yysMaterialClassQueryWrapper.getExpression().getNormal().size()>0){
yysMaterialClassNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(yysMaterialClassPagination.getClassName())){
yysMaterialClassNum++;
String value = yysMaterialClassPagination.getClassName() instanceof List ?
JsonUtil.getObjectToString(yysMaterialClassPagination.getClassName()) :
String.valueOf(yysMaterialClassPagination.getClassName());
yysMaterialClassQueryWrapper.lambda().like(YysMaterialClassEntity::getClassName,value);
}
if(ObjectUtil.isNotEmpty(yysMaterialClassPagination.getParentClassification())){
yysMaterialClassNum++;
String value = yysMaterialClassPagination.getParentClassification() instanceof List ?
JsonUtil.getObjectToString(yysMaterialClassPagination.getParentClassification()) :
String.valueOf(yysMaterialClassPagination.getParentClassification());
yysMaterialClassQueryWrapper.lambda().like(YysMaterialClassEntity::getParentClassification,value);
}
if(ObjectUtil.isNotEmpty(yysMaterialClassPagination.getEnableStatus())){
yysMaterialClassNum++;
String value = yysMaterialClassPagination.getEnableStatus() instanceof List ?
JsonUtil.getObjectToString(yysMaterialClassPagination.getEnableStatus()) :
String.valueOf(yysMaterialClassPagination.getEnableStatus());
yysMaterialClassQueryWrapper.lambda().like(YysMaterialClassEntity::getEnableStatus,value);
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
yysMaterialClassQueryWrapper.lambda().in(YysMaterialClassEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
yysMaterialClassQueryWrapper.lambda().and(t->t.in(YysMaterialClassEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
yysMaterialClassQueryWrapper.lambda().and(t->t.in(YysMaterialClassEntity::getId, finalAllRuleIDlist));
}
//排序
if(StringUtil.isEmpty(yysMaterialClassPagination.getSidx())){
yysMaterialClassQueryWrapper.lambda().orderByDesc(YysMaterialClassEntity::getId);
}else{
try {
String sidx = yysMaterialClassPagination.getSidx();
String[] strs= sidx.split("_name");
YysMaterialClassEntity yysMaterialClassEntity = new YysMaterialClassEntity();
Field declaredField = yysMaterialClassEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
yysMaterialClassQueryWrapper="asc".equals(yysMaterialClassPagination.getSort().toLowerCase())?yysMaterialClassQueryWrapper.orderByAsc(value):yysMaterialClassQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<YysMaterialClassEntity> page=new Page<>(yysMaterialClassPagination.getCurrentPage(), yysMaterialClassPagination.getPageSize());
IPage<YysMaterialClassEntity> userIPage=this.page(page, yysMaterialClassQueryWrapper);
return yysMaterialClassPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<YysMaterialClassEntity> list = new ArrayList();
return yysMaterialClassPagination.setData(list, list.size());
}
}else{
return this.list(yysMaterialClassQueryWrapper);
}
}
@Override
public YysMaterialClassEntity getInfo(String id){
QueryWrapper<YysMaterialClassEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(YysMaterialClassEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(YysMaterialClassEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, YysMaterialClassEntity entity){
return this.updateById(entity);
}
@Override
public void delete(YysMaterialClassEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(YysMaterialClassForm 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 yysMaterialClassForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(YysMaterialClassForm yysMaterialClassForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
yysMaterialClassForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(YysMaterialClassConstant.getFormData(),yysMaterialClassForm),YysMaterialClassForm.class);
YysMaterialClassEntity entity = JsonUtil.getJsonToBean(yysMaterialClassForm, YysMaterialClassEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setId(mainId);
}else{
}
this.saveOrUpdate(entity);
}
}

@ -0,0 +1,297 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.YysMaterialInformationMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.yysmaterialinformation.*;
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;
/**
*
* yysMaterialInformation
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-08-08
*/
@Service
public class YysMaterialInformationServiceImpl extends ServiceImpl<YysMaterialInformationMapper, YysMaterialInformationEntity> implements YysMaterialInformationService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Override
public List<YysMaterialInformationEntity> getList(YysMaterialInformationPagination yysMaterialInformationPagination){
return getTypeList(yysMaterialInformationPagination,yysMaterialInformationPagination.getDataType());
}
/** 列表查询 */
@Override
public List<YysMaterialInformationEntity> getTypeList(YysMaterialInformationPagination yysMaterialInformationPagination,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 ? YysMaterialInformationConstant.getAppColumnData() : YysMaterialInformationConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int yysMaterialInformationNum =0;
QueryWrapper<YysMaterialInformationEntity> yysMaterialInformationQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(yysMaterialInformationPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = yysMaterialInformationPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<YysMaterialInformationEntity> yysMaterialInformationSuperWrapper = new QueryWrapper<>();
yysMaterialInformationSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysMaterialInformationSuperWrapper,YysMaterialInformationEntity.class,queryJson,"0"));
int yysMaterialInformationNum1 = yysMaterialInformationSuperWrapper.getExpression().getNormal().size();
if (yysMaterialInformationNum1>0){
List<String> yysMaterialInformationList =this.list(yysMaterialInformationSuperWrapper).stream().map(YysMaterialInformationEntity::getId).collect(Collectors.toList());
allSuperList.addAll(yysMaterialInformationList);
intersectionSuperList.add(yysMaterialInformationList);
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<YysMaterialInformationEntity> yysMaterialInformationSuperWrapper = new QueryWrapper<>();
yysMaterialInformationSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysMaterialInformationSuperWrapper,YysMaterialInformationEntity.class,ruleJson,"0"));
int yysMaterialInformationNum1 = yysMaterialInformationSuperWrapper.getExpression().getNormal().size();
if (yysMaterialInformationNum1>0){
List<String> yysMaterialInformationList =this.list(yysMaterialInformationSuperWrapper).stream().map(YysMaterialInformationEntity::getId).collect(Collectors.toList());
allRuleList.addAll(yysMaterialInformationList);
intersectionRuleList.add(yysMaterialInformationList);
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 yysMaterialInformationObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysMaterialInformationQueryWrapper,YysMaterialInformationEntity.class,yysMaterialInformationPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(yysMaterialInformationObj)){
return new ArrayList<>();
} else {
yysMaterialInformationQueryWrapper = (QueryWrapper<YysMaterialInformationEntity>)yysMaterialInformationObj;
if( yysMaterialInformationQueryWrapper.getExpression().getNormal().size()>0){
yysMaterialInformationNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object yysMaterialInformationObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysMaterialInformationQueryWrapper,YysMaterialInformationEntity.class,yysMaterialInformationPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(yysMaterialInformationObj)){
return new ArrayList<>();
} else {
yysMaterialInformationQueryWrapper = (QueryWrapper<YysMaterialInformationEntity>)yysMaterialInformationObj;
if( yysMaterialInformationQueryWrapper.getExpression().getNormal().size()>0){
yysMaterialInformationNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(yysMaterialInformationPagination.getMaterialId())){
yysMaterialInformationNum++;
String value = yysMaterialInformationPagination.getMaterialId() instanceof List ?
JsonUtil.getObjectToString(yysMaterialInformationPagination.getMaterialId()) :
String.valueOf(yysMaterialInformationPagination.getMaterialId());
yysMaterialInformationQueryWrapper.lambda().like(YysMaterialInformationEntity::getMaterialId,value);
}
if(ObjectUtil.isNotEmpty(yysMaterialInformationPagination.getMaterialName())){
yysMaterialInformationNum++;
String value = yysMaterialInformationPagination.getMaterialName() instanceof List ?
JsonUtil.getObjectToString(yysMaterialInformationPagination.getMaterialName()) :
String.valueOf(yysMaterialInformationPagination.getMaterialName());
yysMaterialInformationQueryWrapper.lambda().like(YysMaterialInformationEntity::getMaterialName,value);
}
if(ObjectUtil.isNotEmpty(yysMaterialInformationPagination.getMaterialClassification())){
yysMaterialInformationNum++;
String value = yysMaterialInformationPagination.getMaterialClassification() instanceof List ?
JsonUtil.getObjectToString(yysMaterialInformationPagination.getMaterialClassification()) :
String.valueOf(yysMaterialInformationPagination.getMaterialClassification());
yysMaterialInformationQueryWrapper.lambda().like(YysMaterialInformationEntity::getMaterialClassification,value);
}
if(ObjectUtil.isNotEmpty(yysMaterialInformationPagination.getEnableStatus())){
yysMaterialInformationNum++;
String value = yysMaterialInformationPagination.getEnableStatus() instanceof List ?
JsonUtil.getObjectToString(yysMaterialInformationPagination.getEnableStatus()) :
String.valueOf(yysMaterialInformationPagination.getEnableStatus());
yysMaterialInformationQueryWrapper.lambda().like(YysMaterialInformationEntity::getEnableStatus,value);
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
yysMaterialInformationQueryWrapper.lambda().in(YysMaterialInformationEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
yysMaterialInformationQueryWrapper.lambda().and(t->t.in(YysMaterialInformationEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
yysMaterialInformationQueryWrapper.lambda().and(t->t.in(YysMaterialInformationEntity::getId, finalAllRuleIDlist));
}
//排序
if(StringUtil.isEmpty(yysMaterialInformationPagination.getSidx())){
yysMaterialInformationQueryWrapper.lambda().orderByDesc(YysMaterialInformationEntity::getId);
}else{
try {
String sidx = yysMaterialInformationPagination.getSidx();
String[] strs= sidx.split("_name");
YysMaterialInformationEntity yysMaterialInformationEntity = new YysMaterialInformationEntity();
Field declaredField = yysMaterialInformationEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
yysMaterialInformationQueryWrapper="asc".equals(yysMaterialInformationPagination.getSort().toLowerCase())?yysMaterialInformationQueryWrapper.orderByAsc(value):yysMaterialInformationQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<YysMaterialInformationEntity> page=new Page<>(yysMaterialInformationPagination.getCurrentPage(), yysMaterialInformationPagination.getPageSize());
IPage<YysMaterialInformationEntity> userIPage=this.page(page, yysMaterialInformationQueryWrapper);
return yysMaterialInformationPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<YysMaterialInformationEntity> list = new ArrayList();
return yysMaterialInformationPagination.setData(list, list.size());
}
}else{
return this.list(yysMaterialInformationQueryWrapper);
}
}
@Override
public YysMaterialInformationEntity getInfo(String id){
QueryWrapper<YysMaterialInformationEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(YysMaterialInformationEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(YysMaterialInformationEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, YysMaterialInformationEntity entity){
return this.updateById(entity);
}
@Override
public void delete(YysMaterialInformationEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(YysMaterialInformationForm 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 yysMaterialInformationForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(YysMaterialInformationForm yysMaterialInformationForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
yysMaterialInformationForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(YysMaterialInformationConstant.getFormData(),yysMaterialInformationForm),YysMaterialInformationForm.class);
YysMaterialInformationEntity entity = JsonUtil.getJsonToBean(yysMaterialInformationForm, YysMaterialInformationEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setId(mainId);
}else{
}
this.saveOrUpdate(entity);
}
}

@ -0,0 +1,287 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.YysSupplierClassMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.yyssupplierclass.*;
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;
/**
*
* yysSupplierClass
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-08-08
*/
@Service
public class YysSupplierClassServiceImpl extends ServiceImpl<YysSupplierClassMapper, YysSupplierClassEntity> implements YysSupplierClassService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Override
public List<YysSupplierClassEntity> getList(YysSupplierClassPagination yysSupplierClassPagination){
return getTypeList(yysSupplierClassPagination,yysSupplierClassPagination.getDataType());
}
/** 列表查询 */
@Override
public List<YysSupplierClassEntity> getTypeList(YysSupplierClassPagination yysSupplierClassPagination,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 ? YysSupplierClassConstant.getAppColumnData() : YysSupplierClassConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int yysSupplierClassNum =0;
QueryWrapper<YysSupplierClassEntity> yysSupplierClassQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(yysSupplierClassPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = yysSupplierClassPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<YysSupplierClassEntity> yysSupplierClassSuperWrapper = new QueryWrapper<>();
yysSupplierClassSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysSupplierClassSuperWrapper,YysSupplierClassEntity.class,queryJson,"0"));
int yysSupplierClassNum1 = yysSupplierClassSuperWrapper.getExpression().getNormal().size();
if (yysSupplierClassNum1>0){
List<String> yysSupplierClassList =this.list(yysSupplierClassSuperWrapper).stream().map(YysSupplierClassEntity::getId).collect(Collectors.toList());
allSuperList.addAll(yysSupplierClassList);
intersectionSuperList.add(yysSupplierClassList);
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<YysSupplierClassEntity> yysSupplierClassSuperWrapper = new QueryWrapper<>();
yysSupplierClassSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysSupplierClassSuperWrapper,YysSupplierClassEntity.class,ruleJson,"0"));
int yysSupplierClassNum1 = yysSupplierClassSuperWrapper.getExpression().getNormal().size();
if (yysSupplierClassNum1>0){
List<String> yysSupplierClassList =this.list(yysSupplierClassSuperWrapper).stream().map(YysSupplierClassEntity::getId).collect(Collectors.toList());
allRuleList.addAll(yysSupplierClassList);
intersectionRuleList.add(yysSupplierClassList);
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 yysSupplierClassObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysSupplierClassQueryWrapper,YysSupplierClassEntity.class,yysSupplierClassPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(yysSupplierClassObj)){
return new ArrayList<>();
} else {
yysSupplierClassQueryWrapper = (QueryWrapper<YysSupplierClassEntity>)yysSupplierClassObj;
if( yysSupplierClassQueryWrapper.getExpression().getNormal().size()>0){
yysSupplierClassNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object yysSupplierClassObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysSupplierClassQueryWrapper,YysSupplierClassEntity.class,yysSupplierClassPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(yysSupplierClassObj)){
return new ArrayList<>();
} else {
yysSupplierClassQueryWrapper = (QueryWrapper<YysSupplierClassEntity>)yysSupplierClassObj;
if( yysSupplierClassQueryWrapper.getExpression().getNormal().size()>0){
yysSupplierClassNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(yysSupplierClassPagination.getClassName())){
yysSupplierClassNum++;
String value = yysSupplierClassPagination.getClassName() instanceof List ?
JsonUtil.getObjectToString(yysSupplierClassPagination.getClassName()) :
String.valueOf(yysSupplierClassPagination.getClassName());
yysSupplierClassQueryWrapper.lambda().like(YysSupplierClassEntity::getClassName,value);
}
if(ObjectUtil.isNotEmpty(yysSupplierClassPagination.getParentClassification())){
yysSupplierClassNum++;
String value = yysSupplierClassPagination.getParentClassification() instanceof List ?
JsonUtil.getObjectToString(yysSupplierClassPagination.getParentClassification()) :
String.valueOf(yysSupplierClassPagination.getParentClassification());
yysSupplierClassQueryWrapper.lambda().like(YysSupplierClassEntity::getParentClassification,value);
}
if(ObjectUtil.isNotEmpty(yysSupplierClassPagination.getEnableStatus())){
yysSupplierClassNum++;
String value = yysSupplierClassPagination.getEnableStatus() instanceof List ?
JsonUtil.getObjectToString(yysSupplierClassPagination.getEnableStatus()) :
String.valueOf(yysSupplierClassPagination.getEnableStatus());
yysSupplierClassQueryWrapper.lambda().like(YysSupplierClassEntity::getEnableStatus,value);
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
yysSupplierClassQueryWrapper.lambda().in(YysSupplierClassEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
yysSupplierClassQueryWrapper.lambda().and(t->t.in(YysSupplierClassEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
yysSupplierClassQueryWrapper.lambda().and(t->t.in(YysSupplierClassEntity::getId, finalAllRuleIDlist));
}
//排序
if(StringUtil.isEmpty(yysSupplierClassPagination.getSidx())){
yysSupplierClassQueryWrapper.lambda().orderByDesc(YysSupplierClassEntity::getId);
}else{
try {
String sidx = yysSupplierClassPagination.getSidx();
String[] strs= sidx.split("_name");
YysSupplierClassEntity yysSupplierClassEntity = new YysSupplierClassEntity();
Field declaredField = yysSupplierClassEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
yysSupplierClassQueryWrapper="asc".equals(yysSupplierClassPagination.getSort().toLowerCase())?yysSupplierClassQueryWrapper.orderByAsc(value):yysSupplierClassQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<YysSupplierClassEntity> page=new Page<>(yysSupplierClassPagination.getCurrentPage(), yysSupplierClassPagination.getPageSize());
IPage<YysSupplierClassEntity> userIPage=this.page(page, yysSupplierClassQueryWrapper);
return yysSupplierClassPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<YysSupplierClassEntity> list = new ArrayList();
return yysSupplierClassPagination.setData(list, list.size());
}
}else{
return this.list(yysSupplierClassQueryWrapper);
}
}
@Override
public YysSupplierClassEntity getInfo(String id){
QueryWrapper<YysSupplierClassEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(YysSupplierClassEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(YysSupplierClassEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, YysSupplierClassEntity entity){
return this.updateById(entity);
}
@Override
public void delete(YysSupplierClassEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(YysSupplierClassForm 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 yysSupplierClassForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(YysSupplierClassForm yysSupplierClassForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
yysSupplierClassForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(YysSupplierClassConstant.getFormData(),yysSupplierClassForm),YysSupplierClassForm.class);
YysSupplierClassEntity entity = JsonUtil.getJsonToBean(yysSupplierClassForm, YysSupplierClassEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setId(mainId);
}else{
}
this.saveOrUpdate(entity);
}
}

@ -0,0 +1,287 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.YysSupplierInformationMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.yyssupplierinformation.*;
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;
/**
*
* yysSupplierInformation
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-08-08
*/
@Service
public class YysSupplierInformationServiceImpl extends ServiceImpl<YysSupplierInformationMapper, YysSupplierInformationEntity> implements YysSupplierInformationService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Override
public List<YysSupplierInformationEntity> getList(YysSupplierInformationPagination yysSupplierInformationPagination){
return getTypeList(yysSupplierInformationPagination,yysSupplierInformationPagination.getDataType());
}
/** 列表查询 */
@Override
public List<YysSupplierInformationEntity> getTypeList(YysSupplierInformationPagination yysSupplierInformationPagination,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 ? YysSupplierInformationConstant.getAppColumnData() : YysSupplierInformationConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int yysSupplierInformationNum =0;
QueryWrapper<YysSupplierInformationEntity> yysSupplierInformationQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(yysSupplierInformationPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = yysSupplierInformationPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<YysSupplierInformationEntity> yysSupplierInformationSuperWrapper = new QueryWrapper<>();
yysSupplierInformationSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysSupplierInformationSuperWrapper,YysSupplierInformationEntity.class,queryJson,"0"));
int yysSupplierInformationNum1 = yysSupplierInformationSuperWrapper.getExpression().getNormal().size();
if (yysSupplierInformationNum1>0){
List<String> yysSupplierInformationList =this.list(yysSupplierInformationSuperWrapper).stream().map(YysSupplierInformationEntity::getId).collect(Collectors.toList());
allSuperList.addAll(yysSupplierInformationList);
intersectionSuperList.add(yysSupplierInformationList);
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<YysSupplierInformationEntity> yysSupplierInformationSuperWrapper = new QueryWrapper<>();
yysSupplierInformationSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysSupplierInformationSuperWrapper,YysSupplierInformationEntity.class,ruleJson,"0"));
int yysSupplierInformationNum1 = yysSupplierInformationSuperWrapper.getExpression().getNormal().size();
if (yysSupplierInformationNum1>0){
List<String> yysSupplierInformationList =this.list(yysSupplierInformationSuperWrapper).stream().map(YysSupplierInformationEntity::getId).collect(Collectors.toList());
allRuleList.addAll(yysSupplierInformationList);
intersectionRuleList.add(yysSupplierInformationList);
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 yysSupplierInformationObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysSupplierInformationQueryWrapper,YysSupplierInformationEntity.class,yysSupplierInformationPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(yysSupplierInformationObj)){
return new ArrayList<>();
} else {
yysSupplierInformationQueryWrapper = (QueryWrapper<YysSupplierInformationEntity>)yysSupplierInformationObj;
if( yysSupplierInformationQueryWrapper.getExpression().getNormal().size()>0){
yysSupplierInformationNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object yysSupplierInformationObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysSupplierInformationQueryWrapper,YysSupplierInformationEntity.class,yysSupplierInformationPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(yysSupplierInformationObj)){
return new ArrayList<>();
} else {
yysSupplierInformationQueryWrapper = (QueryWrapper<YysSupplierInformationEntity>)yysSupplierInformationObj;
if( yysSupplierInformationQueryWrapper.getExpression().getNormal().size()>0){
yysSupplierInformationNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(yysSupplierInformationPagination.getSupplierId())){
yysSupplierInformationNum++;
String value = yysSupplierInformationPagination.getSupplierId() instanceof List ?
JsonUtil.getObjectToString(yysSupplierInformationPagination.getSupplierId()) :
String.valueOf(yysSupplierInformationPagination.getSupplierId());
yysSupplierInformationQueryWrapper.lambda().like(YysSupplierInformationEntity::getSupplierId,value);
}
if(ObjectUtil.isNotEmpty(yysSupplierInformationPagination.getSupplierSname())){
yysSupplierInformationNum++;
String value = yysSupplierInformationPagination.getSupplierSname() instanceof List ?
JsonUtil.getObjectToString(yysSupplierInformationPagination.getSupplierSname()) :
String.valueOf(yysSupplierInformationPagination.getSupplierSname());
yysSupplierInformationQueryWrapper.lambda().like(YysSupplierInformationEntity::getSupplierSname,value);
}
if(ObjectUtil.isNotEmpty(yysSupplierInformationPagination.getEnableStatus())){
yysSupplierInformationNum++;
String value = yysSupplierInformationPagination.getEnableStatus() instanceof List ?
JsonUtil.getObjectToString(yysSupplierInformationPagination.getEnableStatus()) :
String.valueOf(yysSupplierInformationPagination.getEnableStatus());
yysSupplierInformationQueryWrapper.lambda().like(YysSupplierInformationEntity::getEnableStatus,value);
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
yysSupplierInformationQueryWrapper.lambda().in(YysSupplierInformationEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
yysSupplierInformationQueryWrapper.lambda().and(t->t.in(YysSupplierInformationEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
yysSupplierInformationQueryWrapper.lambda().and(t->t.in(YysSupplierInformationEntity::getId, finalAllRuleIDlist));
}
//排序
if(StringUtil.isEmpty(yysSupplierInformationPagination.getSidx())){
yysSupplierInformationQueryWrapper.lambda().orderByDesc(YysSupplierInformationEntity::getId);
}else{
try {
String sidx = yysSupplierInformationPagination.getSidx();
String[] strs= sidx.split("_name");
YysSupplierInformationEntity yysSupplierInformationEntity = new YysSupplierInformationEntity();
Field declaredField = yysSupplierInformationEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
yysSupplierInformationQueryWrapper="asc".equals(yysSupplierInformationPagination.getSort().toLowerCase())?yysSupplierInformationQueryWrapper.orderByAsc(value):yysSupplierInformationQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<YysSupplierInformationEntity> page=new Page<>(yysSupplierInformationPagination.getCurrentPage(), yysSupplierInformationPagination.getPageSize());
IPage<YysSupplierInformationEntity> userIPage=this.page(page, yysSupplierInformationQueryWrapper);
return yysSupplierInformationPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<YysSupplierInformationEntity> list = new ArrayList();
return yysSupplierInformationPagination.setData(list, list.size());
}
}else{
return this.list(yysSupplierInformationQueryWrapper);
}
}
@Override
public YysSupplierInformationEntity getInfo(String id){
QueryWrapper<YysSupplierInformationEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(YysSupplierInformationEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(YysSupplierInformationEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, YysSupplierInformationEntity entity){
return this.updateById(entity);
}
@Override
public void delete(YysSupplierInformationEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(YysSupplierInformationForm 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 yysSupplierInformationForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(YysSupplierInformationForm yysSupplierInformationForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
yysSupplierInformationForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(YysSupplierInformationConstant.getFormData(),yysSupplierInformationForm),YysSupplierInformationForm.class);
YysSupplierInformationEntity entity = JsonUtil.getJsonToBean(yysSupplierInformationForm, YysSupplierInformationEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setId(mainId);
}else{
}
this.saveOrUpdate(entity);
}
}

@ -0,0 +1,277 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.YysUnitInformationMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.yysunitinformation.*;
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;
/**
*
* yysUnitInformation
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-08-08
*/
@Service
public class YysUnitInformationServiceImpl extends ServiceImpl<YysUnitInformationMapper, YysUnitInformationEntity> implements YysUnitInformationService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Override
public List<YysUnitInformationEntity> getList(YysUnitInformationPagination yysUnitInformationPagination){
return getTypeList(yysUnitInformationPagination,yysUnitInformationPagination.getDataType());
}
/** 列表查询 */
@Override
public List<YysUnitInformationEntity> getTypeList(YysUnitInformationPagination yysUnitInformationPagination,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 ? YysUnitInformationConstant.getAppColumnData() : YysUnitInformationConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int yysUnitInformationNum =0;
QueryWrapper<YysUnitInformationEntity> yysUnitInformationQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(yysUnitInformationPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = yysUnitInformationPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<YysUnitInformationEntity> yysUnitInformationSuperWrapper = new QueryWrapper<>();
yysUnitInformationSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysUnitInformationSuperWrapper,YysUnitInformationEntity.class,queryJson,"0"));
int yysUnitInformationNum1 = yysUnitInformationSuperWrapper.getExpression().getNormal().size();
if (yysUnitInformationNum1>0){
List<String> yysUnitInformationList =this.list(yysUnitInformationSuperWrapper).stream().map(YysUnitInformationEntity::getId).collect(Collectors.toList());
allSuperList.addAll(yysUnitInformationList);
intersectionSuperList.add(yysUnitInformationList);
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<YysUnitInformationEntity> yysUnitInformationSuperWrapper = new QueryWrapper<>();
yysUnitInformationSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(yysUnitInformationSuperWrapper,YysUnitInformationEntity.class,ruleJson,"0"));
int yysUnitInformationNum1 = yysUnitInformationSuperWrapper.getExpression().getNormal().size();
if (yysUnitInformationNum1>0){
List<String> yysUnitInformationList =this.list(yysUnitInformationSuperWrapper).stream().map(YysUnitInformationEntity::getId).collect(Collectors.toList());
allRuleList.addAll(yysUnitInformationList);
intersectionRuleList.add(yysUnitInformationList);
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 yysUnitInformationObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysUnitInformationQueryWrapper,YysUnitInformationEntity.class,yysUnitInformationPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(yysUnitInformationObj)){
return new ArrayList<>();
} else {
yysUnitInformationQueryWrapper = (QueryWrapper<YysUnitInformationEntity>)yysUnitInformationObj;
if( yysUnitInformationQueryWrapper.getExpression().getNormal().size()>0){
yysUnitInformationNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object yysUnitInformationObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(yysUnitInformationQueryWrapper,YysUnitInformationEntity.class,yysUnitInformationPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(yysUnitInformationObj)){
return new ArrayList<>();
} else {
yysUnitInformationQueryWrapper = (QueryWrapper<YysUnitInformationEntity>)yysUnitInformationObj;
if( yysUnitInformationQueryWrapper.getExpression().getNormal().size()>0){
yysUnitInformationNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(yysUnitInformationPagination.getUnitName())){
yysUnitInformationNum++;
String value = yysUnitInformationPagination.getUnitName() instanceof List ?
JsonUtil.getObjectToString(yysUnitInformationPagination.getUnitName()) :
String.valueOf(yysUnitInformationPagination.getUnitName());
yysUnitInformationQueryWrapper.lambda().like(YysUnitInformationEntity::getUnitName,value);
}
if(ObjectUtil.isNotEmpty(yysUnitInformationPagination.getEnableStatus())){
yysUnitInformationNum++;
String value = yysUnitInformationPagination.getEnableStatus() instanceof List ?
JsonUtil.getObjectToString(yysUnitInformationPagination.getEnableStatus()) :
String.valueOf(yysUnitInformationPagination.getEnableStatus());
yysUnitInformationQueryWrapper.lambda().like(YysUnitInformationEntity::getEnableStatus,value);
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
yysUnitInformationQueryWrapper.lambda().in(YysUnitInformationEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
yysUnitInformationQueryWrapper.lambda().and(t->t.in(YysUnitInformationEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
yysUnitInformationQueryWrapper.lambda().and(t->t.in(YysUnitInformationEntity::getId, finalAllRuleIDlist));
}
//排序
if(StringUtil.isEmpty(yysUnitInformationPagination.getSidx())){
yysUnitInformationQueryWrapper.lambda().orderByDesc(YysUnitInformationEntity::getId);
}else{
try {
String sidx = yysUnitInformationPagination.getSidx();
String[] strs= sidx.split("_name");
YysUnitInformationEntity yysUnitInformationEntity = new YysUnitInformationEntity();
Field declaredField = yysUnitInformationEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
yysUnitInformationQueryWrapper="asc".equals(yysUnitInformationPagination.getSort().toLowerCase())?yysUnitInformationQueryWrapper.orderByAsc(value):yysUnitInformationQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<YysUnitInformationEntity> page=new Page<>(yysUnitInformationPagination.getCurrentPage(), yysUnitInformationPagination.getPageSize());
IPage<YysUnitInformationEntity> userIPage=this.page(page, yysUnitInformationQueryWrapper);
return yysUnitInformationPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<YysUnitInformationEntity> list = new ArrayList();
return yysUnitInformationPagination.setData(list, list.size());
}
}else{
return this.list(yysUnitInformationQueryWrapper);
}
}
@Override
public YysUnitInformationEntity getInfo(String id){
QueryWrapper<YysUnitInformationEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(YysUnitInformationEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(YysUnitInformationEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, YysUnitInformationEntity entity){
return this.updateById(entity);
}
@Override
public void delete(YysUnitInformationEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(YysUnitInformationForm 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 yysUnitInformationForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(YysUnitInformationForm yysUnitInformationForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
yysUnitInformationForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(YysUnitInformationConstant.getFormData(),yysUnitInformationForm),YysUnitInformationForm.class);
YysUnitInformationEntity entity = JsonUtil.getJsonToBean(yysUnitInformationForm, YysUnitInformationEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setId(mainId);
}else{
}
this.saveOrUpdate(entity);
}
}

@ -0,0 +1,190 @@
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.yysbillmaterial.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.transaction.annotation.Transactional;
/**
* yysBillMaterial
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Slf4j
@RestController
@Tag(name = "yysBillMaterial" , description = "example")
@RequestMapping("/api/example/YysBillMaterial")
public class YysBillMaterialController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private YysBillMaterialService yysBillMaterialService;
/**
*
*
* @param yysBillMaterialPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody YysBillMaterialPagination yysBillMaterialPagination)throws IOException{
List<YysBillMaterialEntity> list= yysBillMaterialService.getList(yysBillMaterialPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (YysBillMaterialEntity entity : list) {
Map<String, Object> yysBillMaterialMap=JsonUtil.entityToMap(entity);
yysBillMaterialMap.put("id", yysBillMaterialMap.get("id"));
//副表数据
//子表数据
realList.add(yysBillMaterialMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, YysBillMaterialConstant.getFormData(), YysBillMaterialConstant.getColumnData(), yysBillMaterialPagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(yysBillMaterialPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param yysBillMaterialForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid YysBillMaterialForm yysBillMaterialForm) {
String b = yysBillMaterialService.checkForm(yysBillMaterialForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
yysBillMaterialService.saveOrUpdate(yysBillMaterialForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
*
* @param id
* @param yysBillMaterialForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid YysBillMaterialForm yysBillMaterialForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
yysBillMaterialForm.setId(id);
if (!isImport) {
String b = yysBillMaterialService.checkForm(yysBillMaterialForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
YysBillMaterialEntity entity= yysBillMaterialService.getInfo(id);
if(entity!=null){
try{
yysBillMaterialService.saveOrUpdate(yysBillMaterialForm,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){
YysBillMaterialEntity entity= yysBillMaterialService.getInfo(id);
if(entity!=null){
//主表数据删除
yysBillMaterialService.delete(entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
YysBillMaterialEntity entity= yysBillMaterialService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> yysBillMaterialMap=JsonUtil.entityToMap(entity);
yysBillMaterialMap.put("id", yysBillMaterialMap.get("id"));
//副表数据
//子表数据
yysBillMaterialMap = generaterSwapUtil.swapDataDetail(yysBillMaterialMap,YysBillMaterialConstant.getFormData(),"591255830234402757",false);
return ActionResult.success(yysBillMaterialMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
YysBillMaterialEntity entity= yysBillMaterialService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> yysBillMaterialMap=JsonUtil.entityToMap(entity);
yysBillMaterialMap.put("id", yysBillMaterialMap.get("id"));
//副表数据
//子表数据
yysBillMaterialMap = generaterSwapUtil.swapDataForm(yysBillMaterialMap,YysBillMaterialConstant.getFormData(),YysBillMaterialConstant.TABLEFIELDKEY,YysBillMaterialConstant.TABLERENAMES);
return ActionResult.success(yysBillMaterialMap);
}
}

@ -0,0 +1,190 @@
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.yysinventoryquery.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.transaction.annotation.Transactional;
/**
* yysInventoryQuery
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Slf4j
@RestController
@Tag(name = "yysInventoryQuery" , description = "example")
@RequestMapping("/api/example/YysInventoryQuery")
public class YysInventoryQueryController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private YysInventoryQueryService yysInventoryQueryService;
/**
*
*
* @param yysInventoryQueryPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody YysInventoryQueryPagination yysInventoryQueryPagination)throws IOException{
List<YysInventoryQueryEntity> list= yysInventoryQueryService.getList(yysInventoryQueryPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (YysInventoryQueryEntity entity : list) {
Map<String, Object> yysInventoryQueryMap=JsonUtil.entityToMap(entity);
yysInventoryQueryMap.put("id", yysInventoryQueryMap.get("id"));
//副表数据
//子表数据
realList.add(yysInventoryQueryMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, YysInventoryQueryConstant.getFormData(), YysInventoryQueryConstant.getColumnData(), yysInventoryQueryPagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(yysInventoryQueryPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param yysInventoryQueryForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid YysInventoryQueryForm yysInventoryQueryForm) {
String b = yysInventoryQueryService.checkForm(yysInventoryQueryForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
yysInventoryQueryService.saveOrUpdate(yysInventoryQueryForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
*
* @param id
* @param yysInventoryQueryForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid YysInventoryQueryForm yysInventoryQueryForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
yysInventoryQueryForm.setId(id);
if (!isImport) {
String b = yysInventoryQueryService.checkForm(yysInventoryQueryForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
YysInventoryQueryEntity entity= yysInventoryQueryService.getInfo(id);
if(entity!=null){
try{
yysInventoryQueryService.saveOrUpdate(yysInventoryQueryForm,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){
YysInventoryQueryEntity entity= yysInventoryQueryService.getInfo(id);
if(entity!=null){
//主表数据删除
yysInventoryQueryService.delete(entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
YysInventoryQueryEntity entity= yysInventoryQueryService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> yysInventoryQueryMap=JsonUtil.entityToMap(entity);
yysInventoryQueryMap.put("id", yysInventoryQueryMap.get("id"));
//副表数据
//子表数据
yysInventoryQueryMap = generaterSwapUtil.swapDataDetail(yysInventoryQueryMap,YysInventoryQueryConstant.getFormData(),"591261094123671493",false);
return ActionResult.success(yysInventoryQueryMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
YysInventoryQueryEntity entity= yysInventoryQueryService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> yysInventoryQueryMap=JsonUtil.entityToMap(entity);
yysInventoryQueryMap.put("id", yysInventoryQueryMap.get("id"));
//副表数据
//子表数据
yysInventoryQueryMap = generaterSwapUtil.swapDataForm(yysInventoryQueryMap,YysInventoryQueryConstant.getFormData(),YysInventoryQueryConstant.TABLEFIELDKEY,YysInventoryQueryConstant.TABLERENAMES);
return ActionResult.success(yysInventoryQueryMap);
}
}

@ -0,0 +1,190 @@
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.yysmaterialclass.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.transaction.annotation.Transactional;
/**
* yysMaterialClass
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Slf4j
@RestController
@Tag(name = "yysMaterialClass" , description = "example")
@RequestMapping("/api/example/YysMaterialClass")
public class YysMaterialClassController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private YysMaterialClassService yysMaterialClassService;
/**
*
*
* @param yysMaterialClassPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody YysMaterialClassPagination yysMaterialClassPagination)throws IOException{
List<YysMaterialClassEntity> list= yysMaterialClassService.getList(yysMaterialClassPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (YysMaterialClassEntity entity : list) {
Map<String, Object> yysMaterialClassMap=JsonUtil.entityToMap(entity);
yysMaterialClassMap.put("id", yysMaterialClassMap.get("id"));
//副表数据
//子表数据
realList.add(yysMaterialClassMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, YysMaterialClassConstant.getFormData(), YysMaterialClassConstant.getColumnData(), yysMaterialClassPagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(yysMaterialClassPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param yysMaterialClassForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid YysMaterialClassForm yysMaterialClassForm) {
String b = yysMaterialClassService.checkForm(yysMaterialClassForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
yysMaterialClassService.saveOrUpdate(yysMaterialClassForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
*
* @param id
* @param yysMaterialClassForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid YysMaterialClassForm yysMaterialClassForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
yysMaterialClassForm.setId(id);
if (!isImport) {
String b = yysMaterialClassService.checkForm(yysMaterialClassForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
YysMaterialClassEntity entity= yysMaterialClassService.getInfo(id);
if(entity!=null){
try{
yysMaterialClassService.saveOrUpdate(yysMaterialClassForm,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){
YysMaterialClassEntity entity= yysMaterialClassService.getInfo(id);
if(entity!=null){
//主表数据删除
yysMaterialClassService.delete(entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
YysMaterialClassEntity entity= yysMaterialClassService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> yysMaterialClassMap=JsonUtil.entityToMap(entity);
yysMaterialClassMap.put("id", yysMaterialClassMap.get("id"));
//副表数据
//子表数据
yysMaterialClassMap = generaterSwapUtil.swapDataDetail(yysMaterialClassMap,YysMaterialClassConstant.getFormData(),"591248879769358277",false);
return ActionResult.success(yysMaterialClassMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
YysMaterialClassEntity entity= yysMaterialClassService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> yysMaterialClassMap=JsonUtil.entityToMap(entity);
yysMaterialClassMap.put("id", yysMaterialClassMap.get("id"));
//副表数据
//子表数据
yysMaterialClassMap = generaterSwapUtil.swapDataForm(yysMaterialClassMap,YysMaterialClassConstant.getFormData(),YysMaterialClassConstant.TABLEFIELDKEY,YysMaterialClassConstant.TABLERENAMES);
return ActionResult.success(yysMaterialClassMap);
}
}

@ -0,0 +1,190 @@
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.yysmaterialinformation.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.transaction.annotation.Transactional;
/**
* yysMaterialInformation
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Slf4j
@RestController
@Tag(name = "yysMaterialInformation" , description = "example")
@RequestMapping("/api/example/YysMaterialInformation")
public class YysMaterialInformationController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private YysMaterialInformationService yysMaterialInformationService;
/**
*
*
* @param yysMaterialInformationPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody YysMaterialInformationPagination yysMaterialInformationPagination)throws IOException{
List<YysMaterialInformationEntity> list= yysMaterialInformationService.getList(yysMaterialInformationPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (YysMaterialInformationEntity entity : list) {
Map<String, Object> yysMaterialInformationMap=JsonUtil.entityToMap(entity);
yysMaterialInformationMap.put("id", yysMaterialInformationMap.get("id"));
//副表数据
//子表数据
realList.add(yysMaterialInformationMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, YysMaterialInformationConstant.getFormData(), YysMaterialInformationConstant.getColumnData(), yysMaterialInformationPagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(yysMaterialInformationPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param yysMaterialInformationForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid YysMaterialInformationForm yysMaterialInformationForm) {
String b = yysMaterialInformationService.checkForm(yysMaterialInformationForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
yysMaterialInformationService.saveOrUpdate(yysMaterialInformationForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
*
* @param id
* @param yysMaterialInformationForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid YysMaterialInformationForm yysMaterialInformationForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
yysMaterialInformationForm.setId(id);
if (!isImport) {
String b = yysMaterialInformationService.checkForm(yysMaterialInformationForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
YysMaterialInformationEntity entity= yysMaterialInformationService.getInfo(id);
if(entity!=null){
try{
yysMaterialInformationService.saveOrUpdate(yysMaterialInformationForm,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){
YysMaterialInformationEntity entity= yysMaterialInformationService.getInfo(id);
if(entity!=null){
//主表数据删除
yysMaterialInformationService.delete(entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
YysMaterialInformationEntity entity= yysMaterialInformationService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> yysMaterialInformationMap=JsonUtil.entityToMap(entity);
yysMaterialInformationMap.put("id", yysMaterialInformationMap.get("id"));
//副表数据
//子表数据
yysMaterialInformationMap = generaterSwapUtil.swapDataDetail(yysMaterialInformationMap,YysMaterialInformationConstant.getFormData(),"591246118818418565",false);
return ActionResult.success(yysMaterialInformationMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
YysMaterialInformationEntity entity= yysMaterialInformationService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> yysMaterialInformationMap=JsonUtil.entityToMap(entity);
yysMaterialInformationMap.put("id", yysMaterialInformationMap.get("id"));
//副表数据
//子表数据
yysMaterialInformationMap = generaterSwapUtil.swapDataForm(yysMaterialInformationMap,YysMaterialInformationConstant.getFormData(),YysMaterialInformationConstant.TABLEFIELDKEY,YysMaterialInformationConstant.TABLERENAMES);
return ActionResult.success(yysMaterialInformationMap);
}
}

@ -0,0 +1,190 @@
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.yyssupplierclass.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.transaction.annotation.Transactional;
/**
* yysSupplierClass
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Slf4j
@RestController
@Tag(name = "yysSupplierClass" , description = "example")
@RequestMapping("/api/example/YysSupplierClass")
public class YysSupplierClassController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private YysSupplierClassService yysSupplierClassService;
/**
*
*
* @param yysSupplierClassPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody YysSupplierClassPagination yysSupplierClassPagination)throws IOException{
List<YysSupplierClassEntity> list= yysSupplierClassService.getList(yysSupplierClassPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (YysSupplierClassEntity entity : list) {
Map<String, Object> yysSupplierClassMap=JsonUtil.entityToMap(entity);
yysSupplierClassMap.put("id", yysSupplierClassMap.get("id"));
//副表数据
//子表数据
realList.add(yysSupplierClassMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, YysSupplierClassConstant.getFormData(), YysSupplierClassConstant.getColumnData(), yysSupplierClassPagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(yysSupplierClassPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param yysSupplierClassForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid YysSupplierClassForm yysSupplierClassForm) {
String b = yysSupplierClassService.checkForm(yysSupplierClassForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
yysSupplierClassService.saveOrUpdate(yysSupplierClassForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
*
* @param id
* @param yysSupplierClassForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid YysSupplierClassForm yysSupplierClassForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
yysSupplierClassForm.setId(id);
if (!isImport) {
String b = yysSupplierClassService.checkForm(yysSupplierClassForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
YysSupplierClassEntity entity= yysSupplierClassService.getInfo(id);
if(entity!=null){
try{
yysSupplierClassService.saveOrUpdate(yysSupplierClassForm,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){
YysSupplierClassEntity entity= yysSupplierClassService.getInfo(id);
if(entity!=null){
//主表数据删除
yysSupplierClassService.delete(entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
YysSupplierClassEntity entity= yysSupplierClassService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> yysSupplierClassMap=JsonUtil.entityToMap(entity);
yysSupplierClassMap.put("id", yysSupplierClassMap.get("id"));
//副表数据
//子表数据
yysSupplierClassMap = generaterSwapUtil.swapDataDetail(yysSupplierClassMap,YysSupplierClassConstant.getFormData(),"591243486263512901",false);
return ActionResult.success(yysSupplierClassMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
YysSupplierClassEntity entity= yysSupplierClassService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> yysSupplierClassMap=JsonUtil.entityToMap(entity);
yysSupplierClassMap.put("id", yysSupplierClassMap.get("id"));
//副表数据
//子表数据
yysSupplierClassMap = generaterSwapUtil.swapDataForm(yysSupplierClassMap,YysSupplierClassConstant.getFormData(),YysSupplierClassConstant.TABLEFIELDKEY,YysSupplierClassConstant.TABLERENAMES);
return ActionResult.success(yysSupplierClassMap);
}
}

@ -0,0 +1,190 @@
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.yyssupplierinformation.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.transaction.annotation.Transactional;
/**
* yysSupplierInformation
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Slf4j
@RestController
@Tag(name = "yysSupplierInformation" , description = "example")
@RequestMapping("/api/example/YysSupplierInformation")
public class YysSupplierInformationController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private YysSupplierInformationService yysSupplierInformationService;
/**
*
*
* @param yysSupplierInformationPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody YysSupplierInformationPagination yysSupplierInformationPagination)throws IOException{
List<YysSupplierInformationEntity> list= yysSupplierInformationService.getList(yysSupplierInformationPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (YysSupplierInformationEntity entity : list) {
Map<String, Object> yysSupplierInformationMap=JsonUtil.entityToMap(entity);
yysSupplierInformationMap.put("id", yysSupplierInformationMap.get("id"));
//副表数据
//子表数据
realList.add(yysSupplierInformationMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, YysSupplierInformationConstant.getFormData(), YysSupplierInformationConstant.getColumnData(), yysSupplierInformationPagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(yysSupplierInformationPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param yysSupplierInformationForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid YysSupplierInformationForm yysSupplierInformationForm) {
String b = yysSupplierInformationService.checkForm(yysSupplierInformationForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
yysSupplierInformationService.saveOrUpdate(yysSupplierInformationForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
*
* @param id
* @param yysSupplierInformationForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid YysSupplierInformationForm yysSupplierInformationForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
yysSupplierInformationForm.setId(id);
if (!isImport) {
String b = yysSupplierInformationService.checkForm(yysSupplierInformationForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
YysSupplierInformationEntity entity= yysSupplierInformationService.getInfo(id);
if(entity!=null){
try{
yysSupplierInformationService.saveOrUpdate(yysSupplierInformationForm,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){
YysSupplierInformationEntity entity= yysSupplierInformationService.getInfo(id);
if(entity!=null){
//主表数据删除
yysSupplierInformationService.delete(entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
YysSupplierInformationEntity entity= yysSupplierInformationService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> yysSupplierInformationMap=JsonUtil.entityToMap(entity);
yysSupplierInformationMap.put("id", yysSupplierInformationMap.get("id"));
//副表数据
//子表数据
yysSupplierInformationMap = generaterSwapUtil.swapDataDetail(yysSupplierInformationMap,YysSupplierInformationConstant.getFormData(),"591239930433244933",false);
return ActionResult.success(yysSupplierInformationMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
YysSupplierInformationEntity entity= yysSupplierInformationService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> yysSupplierInformationMap=JsonUtil.entityToMap(entity);
yysSupplierInformationMap.put("id", yysSupplierInformationMap.get("id"));
//副表数据
//子表数据
yysSupplierInformationMap = generaterSwapUtil.swapDataForm(yysSupplierInformationMap,YysSupplierInformationConstant.getFormData(),YysSupplierInformationConstant.TABLEFIELDKEY,YysSupplierInformationConstant.TABLERENAMES);
return ActionResult.success(yysSupplierInformationMap);
}
}

@ -0,0 +1,190 @@
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.yysunitinformation.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.transaction.annotation.Transactional;
/**
* yysUnitInformation
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Slf4j
@RestController
@Tag(name = "yysUnitInformation" , description = "example")
@RequestMapping("/api/example/YysUnitInformation")
public class YysUnitInformationController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private YysUnitInformationService yysUnitInformationService;
/**
*
*
* @param yysUnitInformationPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody YysUnitInformationPagination yysUnitInformationPagination)throws IOException{
List<YysUnitInformationEntity> list= yysUnitInformationService.getList(yysUnitInformationPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (YysUnitInformationEntity entity : list) {
Map<String, Object> yysUnitInformationMap=JsonUtil.entityToMap(entity);
yysUnitInformationMap.put("id", yysUnitInformationMap.get("id"));
//副表数据
//子表数据
realList.add(yysUnitInformationMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, YysUnitInformationConstant.getFormData(), YysUnitInformationConstant.getColumnData(), yysUnitInformationPagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(yysUnitInformationPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param yysUnitInformationForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid YysUnitInformationForm yysUnitInformationForm) {
String b = yysUnitInformationService.checkForm(yysUnitInformationForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
yysUnitInformationService.saveOrUpdate(yysUnitInformationForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
*
* @param id
* @param yysUnitInformationForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid YysUnitInformationForm yysUnitInformationForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
yysUnitInformationForm.setId(id);
if (!isImport) {
String b = yysUnitInformationService.checkForm(yysUnitInformationForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
YysUnitInformationEntity entity= yysUnitInformationService.getInfo(id);
if(entity!=null){
try{
yysUnitInformationService.saveOrUpdate(yysUnitInformationForm,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){
YysUnitInformationEntity entity= yysUnitInformationService.getInfo(id);
if(entity!=null){
//主表数据删除
yysUnitInformationService.delete(entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
YysUnitInformationEntity entity= yysUnitInformationService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> yysUnitInformationMap=JsonUtil.entityToMap(entity);
yysUnitInformationMap.put("id", yysUnitInformationMap.get("id"));
//副表数据
//子表数据
yysUnitInformationMap = generaterSwapUtil.swapDataDetail(yysUnitInformationMap,YysUnitInformationConstant.getFormData(),"591253620058492869",false);
return ActionResult.success(yysUnitInformationMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
YysUnitInformationEntity entity= yysUnitInformationService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> yysUnitInformationMap=JsonUtil.entityToMap(entity);
yysUnitInformationMap.put("id", yysUnitInformationMap.get("id"));
//副表数据
//子表数据
yysUnitInformationMap = generaterSwapUtil.swapDataForm(yysUnitInformationMap,YysUnitInformationConstant.getFormData(),YysUnitInformationConstant.TABLEFIELDKEY,YysUnitInformationConstant.TABLERENAMES);
return ActionResult.success(yysUnitInformationMap);
}
}

@ -0,0 +1,61 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Data
@TableName("yys_bill_material")
public class YysBillMaterialEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "PIECE_ID" , updateStrategy = FieldStrategy.IGNORED)
private String pieceId;
@TableField(value = "PIECE_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String pieceName;
@TableField(value = "MODELS" , updateStrategy = FieldStrategy.IGNORED)
private String models;
@TableField(value = "UNIT" , updateStrategy = FieldStrategy.IGNORED)
private String unit;
@TableField(value = "VERSION_CODE" , updateStrategy = FieldStrategy.IGNORED)
private String versionCode;
@TableField(value = "VERSION_ILLUSTRATE" , updateStrategy = FieldStrategy.IGNORED)
private String versionIllustrate;
@TableField(value = "VERSION_DATE" , updateStrategy = FieldStrategy.IGNORED)
private Date versionDate;
@TableField(value = "DOCUMENT_STATUS" , updateStrategy = FieldStrategy.IGNORED)
private String documentStatus;
@TableField("REAMRK")
private String reamrk;
@TableField(value = "F_CREATOR_TIME" , updateStrategy = FieldStrategy.IGNORED)
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_FLOW_ID")
private String flowId;
}

@ -0,0 +1,60 @@
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-08
*/
@Data
@TableName("yys_inventory_query")
public class YysInventoryQueryEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "MATERIAL_CODE" , updateStrategy = FieldStrategy.IGNORED)
private String materialCode;
@TableField(value = "MATERIAL_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String materialName;
@TableField(value = "MATERIAL_CLASSIFICATION" , updateStrategy = FieldStrategy.IGNORED)
private String materialClassification;
@TableField(value = "UNIT" , updateStrategy = FieldStrategy.IGNORED)
private String unit;
@TableField(value = "MATERIAL_SNAME" , updateStrategy = FieldStrategy.IGNORED)
private String materialSname;
@TableField(value = "MODELS" , updateStrategy = FieldStrategy.IGNORED)
private String models;
@TableField(value = "INVENTORY_NUMBER" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal inventoryNumber;
@TableField("REAMRK")
private String reamrk;
@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_FLOW_ID")
private String flowId;
}

@ -0,0 +1,53 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Data
@TableName("yys_material_class")
public class YysMaterialClassEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "CLASS_ID" , updateStrategy = FieldStrategy.IGNORED)
private String classId;
@TableField(value = "CLASS_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String className;
@TableField(value = "PARENT_CLASSIFICATION" , updateStrategy = FieldStrategy.IGNORED)
private String parentClassification;
@TableField(value = "ENABLE_STATUS" , updateStrategy = FieldStrategy.IGNORED)
private String enableStatus;
@TableField("REAMRK")
private String reamrk;
@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_FLOW_ID")
private String flowId;
}

@ -0,0 +1,61 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Data
@TableName("yys_material_information")
public class YysMaterialInformationEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "MATERIAL_ID" , updateStrategy = FieldStrategy.IGNORED)
private String materialId;
@TableField(value = "MATERIAL_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String materialName;
@TableField(value = "MATERIAL_CLASSIFICATION" , updateStrategy = FieldStrategy.IGNORED)
private String materialClassification;
@TableField(value = "UNIT_MEASUREMENT" , updateStrategy = FieldStrategy.IGNORED)
private String unitMeasurement;
@TableField(value = "MATERIAL_SNAME" , updateStrategy = FieldStrategy.IGNORED)
private String materialSname;
@TableField(value = "MODEL" , updateStrategy = FieldStrategy.IGNORED)
private String model;
@TableField(value = "SAFETY_STOCK" , updateStrategy = FieldStrategy.IGNORED)
private String safetyStock;
@TableField(value = "ENABLE_STATUS" , updateStrategy = FieldStrategy.IGNORED)
private String enableStatus;
@TableField("REAMRK")
private String reamrk;
@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_FLOW_ID")
private String flowId;
}

@ -0,0 +1,53 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Data
@TableName("yys_supplier_class")
public class YysSupplierClassEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "CLASS_ID" , updateStrategy = FieldStrategy.IGNORED)
private String classId;
@TableField(value = "CLASS_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String className;
@TableField(value = "PARENT_CLASSIFICATION" , updateStrategy = FieldStrategy.IGNORED)
private String parentClassification;
@TableField(value = "ENABLE_STATUS" , updateStrategy = FieldStrategy.IGNORED)
private String enableStatus;
@TableField("REAMRK")
private String reamrk;
@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_FLOW_ID")
private String flowId;
}

@ -0,0 +1,55 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Data
@TableName("yys_supplier_information")
public class YysSupplierInformationEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "SUPPLIER_ID" , updateStrategy = FieldStrategy.IGNORED)
private String supplierId;
@TableField(value = "SUPPLIER_SNAME" , updateStrategy = FieldStrategy.IGNORED)
private String supplierSname;
@TableField(value = "SUPPLIER_CNAME" , updateStrategy = FieldStrategy.IGNORED)
private String supplierCname;
@TableField(value = "SUPPLIER_CLASSIFICATION" , updateStrategy = FieldStrategy.IGNORED)
private String supplierClassification;
@TableField(value = "ENABLE_STATUS" , updateStrategy = FieldStrategy.IGNORED)
private String enableStatus;
@TableField("REAMRK")
private String reamrk;
@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_FLOW_ID")
private String flowId;
}

@ -0,0 +1,51 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Data
@TableName("yys_unit_information")
public class YysUnitInformationEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "UNIT_ID" , updateStrategy = FieldStrategy.IGNORED)
private String unitId;
@TableField(value = "UNIT_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String unitName;
@TableField(value = "ENABLE_STATUS" , updateStrategy = FieldStrategy.IGNORED)
private String enableStatus;
@TableField("REAMRK")
private String reamrk;
@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_FLOW_ID")
private String flowId;
}

@ -0,0 +1,47 @@
package jnpf.model.yysbillmaterial;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* yysBillMaterial
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Data
public class YysBillMaterialForm {
/** 主键 */
private String id;
/** 母件编码 **/
@JsonProperty("pieceId")
private String pieceId;
/** 母件名称 **/
@JsonProperty("pieceName")
private String pieceName;
/** 规格型号 **/
@JsonProperty("models")
private String models;
/** 计量单位 **/
@JsonProperty("unit")
private String unit;
/** 版本代号 **/
@JsonProperty("versionCode")
private String versionCode;
/** 版本说明 **/
@JsonProperty("versionIllustrate")
private String versionIllustrate;
/** 版本日期 **/
@JsonProperty("versionDate")
private String versionDate;
/** 创建时间 **/
@JsonProperty("creatorTime")
private String creatorTime;
/** 单据状态 **/
@JsonProperty("documentStatus")
private String documentStatus;
}

@ -0,0 +1,39 @@
package jnpf.model.yysbillmaterial;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* yysBillMaterial
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Data
public class YysBillMaterialPagination 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("pieceId")
private Object pieceId;
/** 母件名称 */
@JsonProperty("pieceName")
private Object pieceName;
/** 单据状态 */
@JsonProperty("documentStatus")
private Object documentStatus;
}

@ -0,0 +1,41 @@
package jnpf.model.yysinventoryquery;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* yysInventoryQuery
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Data
public class YysInventoryQueryForm {
/** 主键 */
private String id;
/** 物料编码 **/
@JsonProperty("materialCode")
private String materialCode;
/** 物料名称 **/
@JsonProperty("materialName")
private String materialName;
/** 物料分类 **/
@JsonProperty("materialClassification")
private String materialClassification;
/** 计量单位 **/
@JsonProperty("unit")
private String unit;
/** 物料简称 **/
@JsonProperty("materialSname")
private String materialSname;
/** 规格型号 **/
@JsonProperty("models")
private String models;
/** 库存数量 **/
@JsonProperty("inventoryNumber")
private String inventoryNumber;
}

@ -0,0 +1,39 @@
package jnpf.model.yysinventoryquery;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* yysInventoryQuery
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Data
public class YysInventoryQueryPagination 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("materialCode")
private Object materialCode;
/** 物料名称 */
@JsonProperty("materialName")
private Object materialName;
/** 物料分类 */
@JsonProperty("materialClassification")
private Object materialClassification;
}

@ -0,0 +1,32 @@
package jnpf.model.yysmaterialclass;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* yysMaterialClass
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Data
public class YysMaterialClassForm {
/** 主键 */
private String id;
/** 分类编码 **/
@JsonProperty("classId")
private String classId;
/** 分类名称 **/
@JsonProperty("className")
private String className;
/** 上级分类 **/
@JsonProperty("parentClassification")
private String parentClassification;
/** 启用状态 **/
@JsonProperty("enableStatus")
private String enableStatus;
}

@ -0,0 +1,39 @@
package jnpf.model.yysmaterialclass;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* yysMaterialClass
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Data
public class YysMaterialClassPagination 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("className")
private Object className;
/** 上级分类 */
@JsonProperty("parentClassification")
private Object parentClassification;
/** 启用状态 */
@JsonProperty("enableStatus")
private Object enableStatus;
}

@ -0,0 +1,44 @@
package jnpf.model.yysmaterialinformation;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* yysMaterialInformation
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Data
public class YysMaterialInformationForm {
/** 主键 */
private String id;
/** 物料编码 **/
@JsonProperty("materialId")
private String materialId;
/** 物料名称 **/
@JsonProperty("materialName")
private String materialName;
/** 物料分类 **/
@JsonProperty("materialClassification")
private String materialClassification;
/** 计量单位 **/
@JsonProperty("unitMeasurement")
private String unitMeasurement;
/** 物料简称 **/
@JsonProperty("materialSname")
private String materialSname;
/** 规格/型号 **/
@JsonProperty("model")
private String model;
/** 安全库存 **/
@JsonProperty("safetyStock")
private String safetyStock;
/** 启用状态 **/
@JsonProperty("enableStatus")
private String enableStatus;
}

@ -0,0 +1,42 @@
package jnpf.model.yysmaterialinformation;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* yysMaterialInformation
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Data
public class YysMaterialInformationPagination 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("materialId")
private Object materialId;
/** 物料名称 */
@JsonProperty("materialName")
private Object materialName;
/** 物料分类 */
@JsonProperty("materialClassification")
private Object materialClassification;
/** 启用状态 */
@JsonProperty("enableStatus")
private Object enableStatus;
}

@ -0,0 +1,32 @@
package jnpf.model.yyssupplierclass;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* yysSupplierClass
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Data
public class YysSupplierClassForm {
/** 主键 */
private String id;
/** 分类编码 **/
@JsonProperty("classId")
private String classId;
/** 分类名称 **/
@JsonProperty("className")
private String className;
/** 上级分类 **/
@JsonProperty("parentClassification")
private String parentClassification;
/** 启用状态 **/
@JsonProperty("enableStatus")
private String enableStatus;
}

@ -0,0 +1,39 @@
package jnpf.model.yyssupplierclass;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* yysSupplierClass
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Data
public class YysSupplierClassPagination 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("className")
private Object className;
/** 上级分类 */
@JsonProperty("parentClassification")
private Object parentClassification;
/** 启用状态 */
@JsonProperty("enableStatus")
private Object enableStatus;
}

@ -0,0 +1,35 @@
package jnpf.model.yyssupplierinformation;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* yysSupplierInformation
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Data
public class YysSupplierInformationForm {
/** 主键 */
private String id;
/** 供应商编码 **/
@JsonProperty("supplierId")
private String supplierId;
/** 供应商简称 **/
@JsonProperty("supplierSname")
private String supplierSname;
/** 供应商全称 **/
@JsonProperty("supplierCname")
private String supplierCname;
/** 供应商分类 **/
@JsonProperty("supplierClassification")
private String supplierClassification;
/** 启用状态 **/
@JsonProperty("enableStatus")
private String enableStatus;
}

@ -0,0 +1,39 @@
package jnpf.model.yyssupplierinformation;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* yysSupplierInformation
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Data
public class YysSupplierInformationPagination 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("supplierId")
private Object supplierId;
/** 供应商简称 */
@JsonProperty("supplierSname")
private Object supplierSname;
/** 启用状态 */
@JsonProperty("enableStatus")
private Object enableStatus;
}

@ -0,0 +1,29 @@
package jnpf.model.yysunitinformation;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* yysUnitInformation
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Data
public class YysUnitInformationForm {
/** 主键 */
private String id;
/** 单位编码 **/
@JsonProperty("unitId")
private String unitId;
/** 单位名称 **/
@JsonProperty("unitName")
private String unitName;
/** 启用状态 **/
@JsonProperty("enableStatus")
private String enableStatus;
}

@ -0,0 +1,36 @@
package jnpf.model.yysunitinformation;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* yysUnitInformation
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-08-08
*/
@Data
public class YysUnitInformationPagination 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("unitName")
private Object unitName;
/** 启用状态 */
@JsonProperty("enableStatus")
private Object enableStatus;
}

@ -0,0 +1,147 @@
<template>
<el-dialog title="详情"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="24" >
<jnpf-form-tip-item label="母件编码"
prop="pieceId" >
<p>{{dataForm.pieceId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="母件名称"
prop="pieceName" >
<p>{{dataForm.pieceName}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="规格型号"
prop="models" >
<p>{{dataForm.models}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="计量单位"
prop="unit" >
<p>{{dataForm.unit}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="版本代号"
prop="versionCode" >
<p>{{dataForm.versionCode}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="版本说明"
prop="versionIllustrate" >
<p>{{dataForm.versionIllustrate}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="版本日期"
prop="versionDate" >
<p>{{dataForm.versionDate}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="创建时间"
prop="creatorTime" >
<p>{{dataForm.creatorTime}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="单据状态"
prop="documentStatus" >
<p>{{dataForm.documentStatus}}</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 :'',
pieceId : '',
pieceName : '',
models : '',
unit : '',
versionCode : '',
versionIllustrate : '',
versionDate : '',
creatorTime : '',
documentStatus : '',
},
}
},
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/YysBillMaterial/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,469 @@
<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="24" >
<jnpf-form-tip-item
label="母件编码" prop="pieceId" >
<JnpfInput v-model="dataForm.pieceId" @change="changeData('pieceId',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="母件名称" prop="pieceName" >
<JnpfInput v-model="dataForm.pieceName" @change="changeData('pieceName',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="规格型号" prop="models" >
<JnpfInput v-model="dataForm.models" @change="changeData('models',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="计量单位" prop="unit" >
<JnpfInput v-model="dataForm.unit" @change="changeData('unit',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="版本代号" prop="versionCode" >
<JnpfInput v-model="dataForm.versionCode" @change="changeData('versionCode',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="版本说明" prop="versionIllustrate" >
<JnpfInput v-model="dataForm.versionIllustrate" @change="changeData('versionIllustrate',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="版本日期" prop="versionDate" >
<JnpfInput v-model="dataForm.versionDate" @change="changeData('versionDate',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="创建时间" prop="creatorTime" >
<JnpfInput v-model="dataForm.creatorTime" @change="changeData('creatorTime',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="单据状态" prop="documentStatus" >
<JnpfInput v-model="dataForm.documentStatus" @change="changeData('documentStatus',-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">
<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: {
pieceId : undefined,
pieceName : undefined,
models : undefined,
unit : undefined,
versionCode : undefined,
versionIllustrate : undefined,
versionDate : undefined,
creatorTime : undefined,
documentStatus : undefined,
},
tableRequiredData: {},
dataRule:
{
},
childIndex:-1,
isEdit:false,
interfaceRes: {
pieceId:[] ,
pieceName:[] ,
models:[] ,
unit:[] ,
versionCode:[] ,
versionIllustrate:[] ,
versionDate:[] ,
creatorTime:[] ,
documentStatus:[] ,
},
}
},
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/YysBillMaterial/'+ 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/YysBillMaterial/'+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/YysBillMaterial',
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/YysBillMaterial/'+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,452 @@
<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.pieceId" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="母件名称">
<el-input v-model="query.pieceName" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="单据状态">
<el-input v-model="query.documentStatus" 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>
</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" border>
<el-table-column prop="pieceId" label="母件编码" align="center">
</el-table-column>
<el-table-column prop="pieceName" label="母件名称" align="center">
</el-table-column>
<el-table-column prop="models" label="规格型号" align="center">
</el-table-column>
<el-table-column prop="unit" label="计量单位" align="center">
</el-table-column>
<el-table-column prop="versionCode" label="版本代号" align="center">
</el-table-column>
<el-table-column prop="versionIllustrate" label="版本说明" align="center">
</el-table-column>
<el-table-column prop="versionDate" label="版本日期" align="center">
</el-table-column>
<el-table-column prop="creatorTime" label="创建时间" align="center">
</el-table-column>
<el-table-column prop="documentStatus" label="单据状态" align="center">
</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: {
pieceId: undefined,
pieceName: undefined,
documentStatus: 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: '591255830234402757',
type: 1,
};
request({
url: `/api/example/YysBillMaterial/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/YysBillMaterial/${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/YysBillMaterial")
})
},
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/YysBillMaterial/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

@ -0,0 +1,133 @@
<template>
<el-dialog title="详情"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="24" >
<jnpf-form-tip-item label="物料编码"
prop="materialCode" >
<p>{{dataForm.materialCode}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="物料名称"
prop="materialName" >
<p>{{dataForm.materialName}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="物料分类"
prop="materialClassification" >
<p>{{dataForm.materialClassification}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="计量单位"
prop="unit" >
<p>{{dataForm.unit}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="物料简称"
prop="materialSname" >
<p>{{dataForm.materialSname}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="规格型号"
prop="models" >
<p>{{dataForm.models}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="库存数量"
prop="inventoryNumber" >
<p>{{dataForm.inventoryNumber}}</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 :'',
materialCode : '',
materialName : '',
materialClassification : '',
unit : '',
materialSname : '',
models : '',
inventoryNumber : '',
},
}
},
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/YysInventoryQuery/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,449 @@
<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="24" >
<jnpf-form-tip-item
label="物料编码" prop="materialCode" >
<JnpfInput v-model="dataForm.materialCode" @change="changeData('materialCode',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="物料名称" prop="materialName" >
<JnpfInput v-model="dataForm.materialName" @change="changeData('materialName',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="物料分类" prop="materialClassification" >
<JnpfInput v-model="dataForm.materialClassification" @change="changeData('materialClassification',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="计量单位" prop="unit" >
<JnpfInput v-model="dataForm.unit" @change="changeData('unit',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="物料简称" prop="materialSname" >
<JnpfInput v-model="dataForm.materialSname" @change="changeData('materialSname',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="规格型号" prop="models" >
<JnpfInput v-model="dataForm.models" @change="changeData('models',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="库存数量" prop="inventoryNumber" >
<JnpfInput v-model="dataForm.inventoryNumber" @change="changeData('inventoryNumber',-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">
<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: {
materialCode : undefined,
materialName : undefined,
materialClassification : undefined,
unit : undefined,
materialSname : undefined,
models : undefined,
inventoryNumber : undefined,
},
tableRequiredData: {},
dataRule:
{
},
childIndex:-1,
isEdit:false,
interfaceRes: {
materialCode:[] ,
materialName:[] ,
materialClassification:[] ,
unit:[] ,
materialSname:[] ,
models:[] ,
inventoryNumber:[] ,
},
}
},
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/YysInventoryQuery/'+ 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/YysInventoryQuery/'+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/YysInventoryQuery',
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/YysInventoryQuery/'+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,448 @@
<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.materialCode" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="物料名称">
<el-input v-model="query.materialName" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="物料分类">
<el-input v-model="query.materialClassification" 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>
</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" border>
<el-table-column prop="materialCode" label="物料编码" align="center">
</el-table-column>
<el-table-column prop="materialName" label="物料名称" align="center">
</el-table-column>
<el-table-column prop="materialClassification" label="物料分类" align="center">
</el-table-column>
<el-table-column prop="unit" label="计量单位" align="center">
</el-table-column>
<el-table-column prop="materialSname" label="物料简称" align="center">
</el-table-column>
<el-table-column prop="models" label="规格型号" align="center">
</el-table-column>
<el-table-column prop="inventoryNumber" label="库存数量" align="center">
</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: {
materialCode: undefined,
materialName: undefined,
materialClassification: 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: '591261094123671493',
type: 1,
};
request({
url: `/api/example/YysInventoryQuery/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/YysInventoryQuery/${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/YysInventoryQuery")
})
},
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/YysInventoryQuery/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

@ -0,0 +1,112 @@
<template>
<el-dialog title="详情"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="24" >
<jnpf-form-tip-item label="分类编码"
prop="classId" >
<p>{{dataForm.classId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="分类名称"
prop="className" >
<p>{{dataForm.className}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="上级分类"
prop="parentClassification" >
<p>{{dataForm.parentClassification}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="启用状态"
prop="enableStatus" >
<p>{{dataForm.enableStatus}}</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 :'',
classId : '',
className : '',
parentClassification : '',
enableStatus : '',
},
}
},
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/YysMaterialClass/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":"yys_material_class","renderKey":1723098935509,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"prop":"classId","showWordLimit":false,"width":0,"__vModel__":"classId","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"classId","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":"yys_material_class","renderKey":1723098935685,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"prop":"className","showWordLimit":false,"width":0,"__vModel__":"className","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"className","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":"yys_material_class","renderKey":1723098935921,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"prop":"parentClassification","showWordLimit":false,"width":0,"__vModel__":"parentClassification","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"parentClassification","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":"yys_material_class","renderKey":1723098936272,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"prop":"enableStatus","showWordLimit":false,"width":0,"__vModel__":"enableStatus","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"enableStatus","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,419 @@
<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="24" >
<jnpf-form-tip-item
label="分类编码" prop="classId" >
<JnpfInput v-model="dataForm.classId" @change="changeData('classId',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="分类名称" prop="className" >
<JnpfInput v-model="dataForm.className" @change="changeData('className',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="上级分类" prop="parentClassification" >
<JnpfInput v-model="dataForm.parentClassification" @change="changeData('parentClassification',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="启用状态" prop="enableStatus" >
<JnpfInput v-model="dataForm.enableStatus" @change="changeData('enableStatus',-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">
<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: {
classId : undefined,
className : undefined,
parentClassification : undefined,
enableStatus : undefined,
},
tableRequiredData: {},
dataRule:
{
},
childIndex:-1,
isEdit:false,
interfaceRes: {
classId:[] ,
className:[] ,
parentClassification:[] ,
enableStatus:[] ,
},
}
},
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/YysMaterialClass/'+ 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/YysMaterialClass/'+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/YysMaterialClass',
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/YysMaterialClass/'+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,442 @@
<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.className" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="上级分类">
<el-input v-model="query.parentClassification" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="启用状态">
<el-input v-model="query.enableStatus" 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>
</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="classId" label="分类编码" align="center">
</el-table-column>
<el-table-column prop="className" label="分类名称" align="center">
</el-table-column>
<el-table-column prop="parentClassification" label="上级分类" align="center">
</el-table-column>
<el-table-column prop="enableStatus" label="启用状态" align="center">
</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: {
className: undefined,
parentClassification: undefined,
enableStatus: 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: '591248879769358277',
type: 1,
};
request({
url: `/api/example/YysMaterialClass/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/YysMaterialClass/${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/YysMaterialClass")
})
},
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/YysMaterialClass/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":"yys_material_class","renderKey":1723098935509,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"classId","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"classId","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":"yys_material_class","renderKey":1723098935685,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"className","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"className","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":"yys_material_class","renderKey":1723098935921,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"parentClassification","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"parentClassification","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":"yys_material_class","renderKey":1723098936272,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"enableStatus","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"enableStatus","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,140 @@
<template>
<el-dialog title="详情"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="24" >
<jnpf-form-tip-item label="物料编码"
prop="materialId" >
<p>{{dataForm.materialId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="物料名称"
prop="materialName" >
<p>{{dataForm.materialName}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="物料分类"
prop="materialClassification" >
<p>{{dataForm.materialClassification}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="计量单位"
prop="unitMeasurement" >
<p>{{dataForm.unitMeasurement}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="物料简称"
prop="materialSname" >
<p>{{dataForm.materialSname}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="规格/型号"
prop="model" >
<p>{{dataForm.model}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="安全库存"
prop="safetyStock" >
<p>{{dataForm.safetyStock}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="启用状态"
prop="enableStatus" >
<p>{{dataForm.enableStatus}}</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 :'',
materialId : '',
materialName : '',
materialClassification : '',
unitMeasurement : '',
materialSname : '',
model : '',
safetyStock : '',
enableStatus : '',
},
}
},
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/YysMaterialInformation/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,459 @@
<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="24" >
<jnpf-form-tip-item
label="物料编码" prop="materialId" >
<JnpfInput v-model="dataForm.materialId" @change="changeData('materialId',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="物料名称" prop="materialName" >
<JnpfInput v-model="dataForm.materialName" @change="changeData('materialName',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="物料分类" prop="materialClassification" >
<JnpfInput v-model="dataForm.materialClassification" @change="changeData('materialClassification',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="计量单位" prop="unitMeasurement" >
<JnpfInput v-model="dataForm.unitMeasurement" @change="changeData('unitMeasurement',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="物料简称" prop="materialSname" >
<JnpfInput v-model="dataForm.materialSname" @change="changeData('materialSname',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="规格/型号" prop="model" >
<JnpfInput v-model="dataForm.model" @change="changeData('model',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="安全库存" prop="safetyStock" >
<JnpfInput v-model="dataForm.safetyStock" @change="changeData('safetyStock',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="启用状态" prop="enableStatus" >
<JnpfInput v-model="dataForm.enableStatus" @change="changeData('enableStatus',-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">
<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: {
materialId : undefined,
materialName : undefined,
materialClassification : undefined,
unitMeasurement : undefined,
materialSname : undefined,
model : undefined,
safetyStock : undefined,
enableStatus : undefined,
},
tableRequiredData: {},
dataRule:
{
},
childIndex:-1,
isEdit:false,
interfaceRes: {
materialId:[] ,
materialName:[] ,
materialClassification:[] ,
unitMeasurement:[] ,
materialSname:[] ,
model:[] ,
safetyStock:[] ,
enableStatus:[] ,
},
}
},
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/YysMaterialInformation/'+ 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/YysMaterialInformation/'+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/YysMaterialInformation',
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/YysMaterialInformation/'+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,465 @@
<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.materialId" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="物料名称">
<el-input v-model="query.materialName" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="物料分类">
<el-input v-model="query.materialClassification" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<template v-if="showAll">
<el-col :span="6">
<el-form-item label="启用状态">
<el-input v-model="query.enableStatus" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
</template>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
<el-button type="text" icon="el-icon-arrow-down" @click="showAll = true" v-if="!showAll">
展开
</el-button>
<el-button type="text" icon="el-icon-arrow-up" @click="showAll = false" v-else>
收起
</el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button type="primary" icon="icon-ym icon-ym-btn-add" @click="addOrUpdateHandle()">
</el-button>
</div>
<div class="JNPF-common-head-right">
<el-tooltip content="高级查询" placement="top" v-if="true">
<el-link icon="icon-ym icon-ym-filter JNPF-common-head-icon" :underline="false"
@click="openSuperQuery()" />
</el-tooltip>
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
@click="initData()" />
</el-tooltip>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange'
:span-method="arraySpanMethod" border>
<el-table-column prop="materialId" label="物料编码" align="center">
</el-table-column>
<el-table-column prop="materialName" label="物料名称" align="center">
</el-table-column>
<el-table-column prop="materialClassification" label="物料分类" align="center">
</el-table-column>
<el-table-column prop="unitMeasurement" label="计量单位" align="center">
</el-table-column>
<el-table-column prop="materialSname" label="物料简称" align="center">
</el-table-column>
<el-table-column prop="model" label="规格/型号" align="center">
</el-table-column>
<el-table-column prop="safetyStock" label="安全库存" align="center">
</el-table-column>
<el-table-column prop="enableStatus" label="启用状态" align="center">
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button type="text" @click="addOrUpdateHandle(scope.row)">
</el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button>
<el-button type="text" @click="goDetail(scope.row.id)">
</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
@pagination="initData" />
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible = false" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson"
@superQuery="superQuery" />
</div>
</template>
<script>
import request from '@/utils/request'
import { mapGetters } from "vuex";
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import JNPFForm from './form'
import Detail from './Detail'
import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getConfigData } from '@/api/onlineDev/visualDev'
import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize'
import columnList from './columnList'
import { thousandsFormat } from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
export default {
components: {
JNPFForm,
Detail,
ExportBox, ToFormDetail, SuperQuery
},
data() {
return {
keyword: '',
expandsTree: true,
refreshTree: true,
toFormDetailVisible: false,
expandObj: {},
columnOptions: [],
mergeList: [],
exportList: [],
columnList,
showAll: false,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
materialId: undefined,
materialName: undefined,
materialClassification: undefined,
enableStatus: 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: '591246118818418565',
type: 1,
};
request({
url: `/api/example/YysMaterialInformation/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/YysMaterialInformation/${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/YysMaterialInformation")
})
},
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/YysMaterialInformation/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

@ -0,0 +1,112 @@
<template>
<el-dialog title="详情"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="24" >
<jnpf-form-tip-item label="分类编码"
prop="classId" >
<p>{{dataForm.classId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="分类名称"
prop="className" >
<p>{{dataForm.className}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="上级分类"
prop="parentClassification" >
<p>{{dataForm.parentClassification}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="启用状态"
prop="enableStatus" >
<p>{{dataForm.enableStatus}}</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 :'',
classId : '',
className : '',
parentClassification : '',
enableStatus : '',
},
}
},
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/YysSupplierClass/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":"yys_supplier_class","renderKey":1723098935509,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"prop":"classId","showWordLimit":false,"width":0,"__vModel__":"classId","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"classId","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":"yys_supplier_class","renderKey":1723098935685,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"prop":"className","showWordLimit":false,"width":0,"__vModel__":"className","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"className","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":"yys_supplier_class","renderKey":1723098935921,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"prop":"parentClassification","showWordLimit":false,"width":0,"__vModel__":"parentClassification","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"parentClassification","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":"yys_supplier_class","renderKey":1723098936272,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"prop":"enableStatus","showWordLimit":false,"width":0,"__vModel__":"enableStatus","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"enableStatus","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,419 @@
<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="24" >
<jnpf-form-tip-item
label="分类编码" prop="classId" >
<JnpfInput v-model="dataForm.classId" @change="changeData('classId',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="分类名称" prop="className" >
<JnpfInput v-model="dataForm.className" @change="changeData('className',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="上级分类" prop="parentClassification" >
<JnpfInput v-model="dataForm.parentClassification" @change="changeData('parentClassification',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="启用状态" prop="enableStatus" >
<JnpfInput v-model="dataForm.enableStatus" @change="changeData('enableStatus',-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">
<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: {
classId : undefined,
className : undefined,
parentClassification : undefined,
enableStatus : undefined,
},
tableRequiredData: {},
dataRule:
{
},
childIndex:-1,
isEdit:false,
interfaceRes: {
classId:[] ,
className:[] ,
parentClassification:[] ,
enableStatus:[] ,
},
}
},
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/YysSupplierClass/'+ 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/YysSupplierClass/'+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/YysSupplierClass',
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/YysSupplierClass/'+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,442 @@
<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.className" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="上级分类">
<el-input v-model="query.parentClassification" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="启用状态">
<el-input v-model="query.enableStatus" 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>
</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" border >
<el-table-column prop="classId" label="分类编码" align="center">
</el-table-column>
<el-table-column prop="className" label="分类名称" align="center">
</el-table-column>
<el-table-column prop="parentClassification" label="上级分类" align="center">
</el-table-column>
<el-table-column prop="enableStatus" label="启用状态" align="center">
</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: {
className: undefined,
parentClassification: undefined,
enableStatus: 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: '591243486263512901',
type: 1,
};
request({
url: `/api/example/YysSupplierClass/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/YysSupplierClass/${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/YysSupplierClass")
})
},
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/YysSupplierClass/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":"yys_supplier_class","renderKey":1723098935509,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"classId","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"classId","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":"yys_supplier_class","renderKey":1723098935685,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"className","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"className","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":"yys_supplier_class","renderKey":1723098935921,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"parentClassification","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"parentClassification","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":"yys_supplier_class","renderKey":1723098936272,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"enableStatus","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"enableStatus","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,119 @@
<template>
<el-dialog title="详情"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="24" >
<jnpf-form-tip-item label="供应商编码"
prop="supplierId" >
<p>{{dataForm.supplierId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="供应商简称"
prop="supplierSname" >
<p>{{dataForm.supplierSname}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="供应商全称"
prop="supplierCname" >
<p>{{dataForm.supplierCname}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="供应商分类"
prop="supplierClassification" >
<p>{{dataForm.supplierClassification}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="启用状态"
prop="enableStatus" >
<p>{{dataForm.enableStatus}}</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 :'',
supplierId : '',
supplierSname : '',
supplierCname : '',
supplierClassification : '',
enableStatus : '',
},
}
},
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/YysSupplierInformation/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,421 @@
<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="24">
<jnpf-form-tip-item label="供应商编码" prop="supplierId">
<JnpfInput v-model="dataForm.supplierId" @change="changeData('supplierId', -1)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="供应商简称" prop="supplierSname">
<JnpfInput v-model="dataForm.supplierSname" @change="changeData('supplierSname', -1)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="供应商全称" prop="supplierCname">
<JnpfInput v-model="dataForm.supplierCname" @change="changeData('supplierCname', -1)"
placeholder="请输入" clearable :style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="供应商分类" prop="supplierClassification">
<JnpfInput v-model="dataForm.supplierClassification"
@change="changeData('supplierClassification', -1)" placeholder="请输入" clearable
:style='{ "width": "100%" }'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="启用状态" prop="enableStatus">
<JnpfInput v-model="dataForm.enableStatus" @change="changeData('enableStatus', -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">
<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: {
supplierId: undefined,
supplierSname: undefined,
supplierCname: undefined,
supplierClassification: undefined,
enableStatus: undefined,
},
tableRequiredData: {},
dataRule:
{
},
childIndex: -1,
isEdit: false,
interfaceRes: {
supplierId: [],
supplierSname: [],
supplierCname: [],
supplierClassification: [],
enableStatus: [],
},
}
},
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/YysSupplierInformation/' + 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/YysSupplierInformation/' + 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/YysSupplierInformation',
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/YysSupplierInformation/' + 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,444 @@
<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.supplierId" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="供应商简称">
<el-input v-model="query.supplierSname" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="启用状态">
<el-input v-model="query.enableStatus" 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>
</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" border>
<el-table-column prop="supplierId" label="供应商编码" align="center">
</el-table-column>
<el-table-column prop="supplierSname" label="供应商简称" align="center">
</el-table-column>
<el-table-column prop="supplierCname" label="供应商全称" align="center">
</el-table-column>
<el-table-column prop="supplierClassification" label="供应商分类" align="center">
</el-table-column>
<el-table-column prop="enableStatus" label="启用状态" align="center">
</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: {
supplierId: undefined,
supplierSname: undefined,
enableStatus: 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: '591239930433244933',
type: 1,
};
request({
url: `/api/example/YysSupplierInformation/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/YysSupplierInformation/${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/YysSupplierInformation")
})
},
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/YysSupplierInformation/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

@ -0,0 +1,105 @@
<template>
<el-dialog title="详情"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="24" >
<jnpf-form-tip-item label="单位编码"
prop="unitId" >
<p>{{dataForm.unitId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="单位名称"
prop="unitName" >
<p>{{dataForm.unitName}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="启用状态"
prop="enableStatus" >
<p>{{dataForm.enableStatus}}</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 :'',
unitId : '',
unitName : '',
enableStatus : '',
},
}
},
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/YysUnitInformation/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":"yys_unit_information","renderKey":1723102213960,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"prop":"unitId","showWordLimit":false,"width":0,"__vModel__":"unitId","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"unitId","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":"yys_unit_information","renderKey":1723102214103,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"prop":"unitName","showWordLimit":false,"width":0,"__vModel__":"unitName","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"unitName","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":"yys_unit_information","renderKey":1723102214513,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"prop":"enableStatus","showWordLimit":false,"width":0,"__vModel__":"enableStatus","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"enableStatus","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,409 @@
<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="24" >
<jnpf-form-tip-item
label="单位编码" prop="unitId" >
<JnpfInput v-model="dataForm.unitId" @change="changeData('unitId',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="单位名称" prop="unitName" >
<JnpfInput v-model="dataForm.unitName" @change="changeData('unitName',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="启用状态" prop="enableStatus" >
<JnpfInput v-model="dataForm.enableStatus" @change="changeData('enableStatus',-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">
<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: {
unitId : undefined,
unitName : undefined,
enableStatus : undefined,
},
tableRequiredData: {},
dataRule:
{
},
childIndex:-1,
isEdit:false,
interfaceRes: {
unitId:[] ,
unitName:[] ,
enableStatus:[] ,
},
}
},
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/YysUnitInformation/'+ 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/YysUnitInformation/'+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/YysUnitInformation',
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/YysUnitInformation/'+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,434 @@
<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.unitName" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="启用状态">
<el-input v-model="query.enableStatus" 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>
</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" border>
<el-table-column prop="unitId" label="单位编码" align="center">
</el-table-column>
<el-table-column prop="unitName" label="单位名称" align="center">
</el-table-column>
<el-table-column prop="enableStatus" label="启用状态" align="center">
</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: {
unitName: undefined,
enableStatus: 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: '591253620058492869',
type: 1,
};
request({
url: `/api/example/YysUnitInformation/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/YysUnitInformation/${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/YysUnitInformation")
})
},
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/YysUnitInformation/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":"yys_unit_information","renderKey":1723102213960,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"unitId","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"unitId","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":"yys_unit_information","renderKey":1723102214103,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"unitName","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"unitName","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":"yys_unit_information","renderKey":1723102214513,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"enableStatus","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"enableStatus","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,165 @@
{
"name": "jnpf-java-boot",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"dependencies": {
"axios": "^1.7.3"
}
},
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
},
"node_modules/axios": {
"version": "1.7.3",
"resolved": "https://registry.npmmirror.com/axios/-/axios-1.7.3.tgz",
"integrity": "sha512-Ar7ND9pU99eJ9GpoGQKhKf58GpUOgnzuaB7ueNQ5BMi0p+LZ5oaEnfF999fAArcTIBwXTCHAmGcHOZJaWPq9Nw==",
"dependencies": {
"follow-redirects": "^1.15.6",
"form-data": "^4.0.0",
"proxy-from-env": "^1.1.0"
}
},
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dependencies": {
"delayed-stream": "~1.0.0"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/follow-redirects": {
"version": "1.15.6",
"resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.6.tgz",
"integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==",
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/RubenVerborgh"
}
],
"engines": {
"node": ">=4.0"
},
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/mime-db": {
"version": "1.52.0",
"resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime-types": {
"version": "2.1.35",
"resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"dependencies": {
"mime-db": "1.52.0"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/proxy-from-env": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
}
},
"dependencies": {
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
},
"axios": {
"version": "1.7.3",
"resolved": "https://registry.npmmirror.com/axios/-/axios-1.7.3.tgz",
"integrity": "sha512-Ar7ND9pU99eJ9GpoGQKhKf58GpUOgnzuaB7ueNQ5BMi0p+LZ5oaEnfF999fAArcTIBwXTCHAmGcHOZJaWPq9Nw==",
"requires": {
"follow-redirects": "^1.15.6",
"form-data": "^4.0.0",
"proxy-from-env": "^1.1.0"
}
},
"combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"requires": {
"delayed-stream": "~1.0.0"
}
},
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="
},
"follow-redirects": {
"version": "1.15.6",
"resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.6.tgz",
"integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA=="
},
"form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
}
},
"mime-db": {
"version": "1.52.0",
"resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="
},
"mime-types": {
"version": "2.1.35",
"resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"requires": {
"mime-db": "1.52.0"
}
},
"proxy-from-env": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
}
}
}

@ -0,0 +1,5 @@
{
"dependencies": {
"axios": "^1.7.3"
}
}
Loading…
Cancel
Save