jg-waiwang-pro
XI_TENG\xixi_ 9 months ago
commit 99e2829f01

@ -0,0 +1,129 @@
package jnpf.database.config;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import jnpf.base.UserInfo;
import jnpf.constant.PermissionConst;
import jnpf.permission.entity.OrganizeEntity;
import jnpf.permission.entity.UserEntity;
import jnpf.permission.service.OrganizeService;
import jnpf.util.DateUtil;
import jnpf.util.StringUtil;
import jnpf.util.UserProvider;
import jnpf.util.context.SpringContext;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
/**
* MybatisPlus
*
* @author Allen Pan
* @version V3.4.1
* @copyright
* @date 2019927 9:18
*/
@Component
@Slf4j
//@Configuration
//@Intercepts({@Signature(type = Executor.class, method = "update", args = {MappedStatement.class, Object.class})})
public class MybatisPlusMetaObjectHandler implements MetaObjectHandler {
//@Autowired
private static ApplicationContext applicationContext;
private UserProvider userProvider;
private OrganizeService organizeService;
@Override
public void insertFill(MetaObject metaObject) {
String companyId = "";
// userProvider= applicationContext.getBean(UserProvider.class);
UserProvider userProvider = SpringContext.getBean(UserProvider.class);
OrganizeService organizeService = SpringContext.getBean(OrganizeService.class);
UserInfo userInfo= userProvider.get();
if(userInfo != null && StringUtil.isNotEmpty(userInfo.getOrganizeId())){
OrganizeEntity organizeEntity = organizeService.getInfo(userInfo.getOrganizeId());
companyId = organizeService.getOrganizeIdTree(organizeEntity);
}
/*if(userInfo != null && StringUtil.isNotEmpty(userInfo.getOrganizeId())){
OrganizeEntity organizeEntity = organizeService.getInfo(userInfo.getOrganizeId());
if(PermissionConst.DEPARTMENT.equals(organizeEntity.getCategory())){
userInfo.setDepartmentId(organizeEntity.getId());
do {
//获取父组织
organizeEntity = organizeService.getInfo(organizeEntity.getParentId());
}while (PermissionConst.DEPARTMENT.equals(organizeEntity.getCategory()));
companyId = organizeEntity.getId();
}else{
companyId = organizeEntity.getId();
}
}*/
// 可以在这里填充编码查询到编码规则自动填充
// TableInfo tableInfo = this.findTableInfo(metaObject);
// String tableName = tableInfo.getTableName();
log.info("start insert fill ....");
System.out.println(userInfo);
this.setFieldValByName("creatorUserId", userInfo.getUserId(), metaObject);
this.setFieldValByName("creatorTime", DateUtil.getNowDate(), metaObject);
this.setFieldValByName("creatorUserName", userInfo.getUserName(), metaObject);
this.setFieldValByName("creatoruserid", userInfo.getUserId(), metaObject);
this.setFieldValByName("creatortime", DateUtil.getNowDate(), metaObject);
this.setFieldValByName("creatorusername", userInfo.getUserName(), metaObject);
this.setFieldValByName("lastModifyUserId", userInfo.getUserId(), metaObject);
this.setFieldValByName("lastModifyTime", DateUtil.getNowDate(), metaObject);
this.setFieldValByName("lastModifyUserName", userInfo.getUserName(), metaObject);
this.setFieldValByName("orgnizeId", userInfo.getOrganizeId(), metaObject);
this.setFieldValByName("companyId", companyId, metaObject);
this.setFieldValByName("departmentId", userInfo.getDepartmentId(), metaObject);
// System.out.println(userProvider.getDepartmentId(userInfo.getUserId()));
/*if (userInfo.getUserId()!=null){
this.setFieldValByName("departmentId", userProvider.getDepartmentId(userInfo.getUserId()), metaObject);
}*/
}
@Override
public void updateFill(MetaObject metaObject) {
log.info("start update fill ....");
UserProvider userProvider = SpringContext.getBean(UserProvider.class);
System.out.println(userProvider.get());
// userProvider= applicationContext.getBean(UserProvider.class);
UserInfo userInfo = userProvider.get();
this.setFieldValByName("lastModifyTime", DateUtil.getNowDate(), metaObject);
this.setFieldValByName("lastModifyUserId", userInfo.getUserId(), metaObject);
this.setFieldValByName("lastModifyUserName", userInfo.getUserName(), metaObject);
this.setFieldValByName("deleteTime", DateUtil.getNowDate(), metaObject);
this.setFieldValByName("deleteUserId", userInfo.getUserId(), metaObject);
this.setFieldValByName("deleteUserName", userInfo.getUserName(), metaObject);
}
}

@ -3,7 +3,17 @@
<mapper namespace="jnpf.mapper.BusinessLineMapper">
<select id="queryBusinessLineList" resultType="jnpf.entity.BusinessLineEntity">
select * from jg_business_line where 1=1
select * from jg_business_line
</select>
<select id="queryOrganizeCount" resultType="Integer">
select count(0) from jg_business_enterprise_relational a
where a.business_line_id = #{id}
</select>
<select id="queryUserCount" resultType="Integer">
select count(0) from jg_business_user_relational a
where a.business_line_id = #{id}
</select>

@ -57,4 +57,10 @@ public class OrganizeEntity extends PermissionEntityBase{
*/
@TableField("F_ORGANIZE_ID_TREE")
private String organizeIdTree;
/**
* ERP
*/
@TableField("ERPCode")
private String ERPCode;
}

@ -311,5 +311,9 @@ public class UserEntity extends SuperExtendEntity.SuperExtendDEEntity<String> {
*/
@TableField("f_handover_mark")
private Integer handoverMark;
@TableField(exist = false)
private String companyId;
@TableField(exist = false)
private String departmentId;
}

@ -29,4 +29,7 @@ public class OrganizeCrForm {
private OrganizeCrModel propertyJson;
@Schema(description = "排序")
private Long sortCode;
@Schema(description = "ERP编码")
private String ERPCode;
}

@ -34,5 +34,13 @@ public class OrganizeCrModel {
private String enterpriseNature;
private String fax;
private String telePhone;
@Schema(description = "企业税号")
private String enyerpriseTaxNum;
@Schema(description = "发票抬头")
private String invoiceTitle;
@Schema(description = "注册地址")
private String registeredAddress;
@Schema(description = "ERP编码")
private String ERPCode;
}

@ -31,4 +31,6 @@ public class OrganizeDepartCrForm {
private String description;
@Schema(description = "排序")
private Long sortCode;
@Schema(description = "ERP编码")
private String ERPCode;
}

@ -32,6 +32,8 @@ public class OrganizeDepartInfoVO {
private String managerId;
@Schema(description = "排序码")
private Long sortCode;
@Schema(description = "ERP编码")
private String ERPCode;
@Schema(description = "组织id树")
private List<String> organizeIdTree;

@ -31,6 +31,8 @@ public class OrganizeInfoVO extends PermissionVoBase {
private String propertyJson;
@Schema(description = "排序")
private Long sortCode;
@Schema(description = "ERP编码")
private String ERPCode;
@Schema(description = "组织id树")
private List<String> organizeIdTree;

@ -50,4 +50,6 @@ public class OrganizeListVO {
@Schema(description ="组织id树")
private List<String> organizeIds;
@Schema(description = "ERP编码")
private String ERPCode;
}

@ -27,4 +27,6 @@ public class OrganizeModel extends SumTree {
private List<String> organizeIds;
private String lastFullName;
@Schema(description = "ERP编码")
private String ERPCode;
}

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

@ -16,4 +16,7 @@ import java.util.List;
public interface BusinessLineMapper extends BaseMapper<BusinessLineEntity> {
List<BusinessLineEntity> queryBusinessLineList();
Integer queryOrganizeCount(String id);
Integer queryUserCount(String id);
}

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

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

@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-01-29
* 2024-01-30
*/
public interface SubjectSettlementRulesMapper extends BaseMapper<SubjectSettlementRulesEntity> {

@ -0,0 +1,35 @@
package jnpf.service;
import jnpf.model.businessenterpriserelational.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* businessEnterpriseRelational
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-01-29
*/
public interface BusinessEnterpriseRelationalService extends IService<BusinessEnterpriseRelationalEntity> {
List<BusinessEnterpriseRelationalEntity> getList(BusinessEnterpriseRelationalPagination businessEnterpriseRelationalPagination);
List<BusinessEnterpriseRelationalEntity> getTypeList(BusinessEnterpriseRelationalPagination businessEnterpriseRelationalPagination,String dataType);
BusinessEnterpriseRelationalEntity getInfo(String id);
void delete(BusinessEnterpriseRelationalEntity entity);
void create(BusinessEnterpriseRelationalEntity entity);
boolean update(String id, BusinessEnterpriseRelationalEntity entity);
//子表方法
//副表数据方法
String checkForm(BusinessEnterpriseRelationalForm form,int i);
void saveOrUpdate(BusinessEnterpriseRelationalForm businessEnterpriseRelationalForm,String id, boolean isSave) throws Exception;
}

@ -46,4 +46,8 @@ public interface BusinessLineService extends IService<BusinessLineEntity> {
List<BusinessLineEntity> queryBusinessLineListInfo();
//查询业务线下的机构数量
int queryOrganizeCountInfo(String id);
//查询业务线下的员工数量
int queryUserCountInfo(String id);
}

@ -0,0 +1,35 @@
package jnpf.service;
import jnpf.model.businessuserrelational.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* businessUserRelational
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-01-30
*/
public interface BusinessUserRelationalService extends IService<BusinessUserRelationalEntity> {
List<BusinessUserRelationalEntity> getList(BusinessUserRelationalPagination businessUserRelationalPagination);
List<BusinessUserRelationalEntity> getTypeList(BusinessUserRelationalPagination businessUserRelationalPagination,String dataType);
BusinessUserRelationalEntity getInfo(String id);
void delete(BusinessUserRelationalEntity entity);
void create(BusinessUserRelationalEntity entity);
boolean update(String id, BusinessUserRelationalEntity entity);
//子表方法
//副表数据方法
String checkForm(BusinessUserRelationalForm form,int i);
void saveOrUpdate(BusinessUserRelationalForm businessUserRelationalForm,String id, boolean isSave) throws Exception;
}

@ -0,0 +1,35 @@
package jnpf.service;
import jnpf.model.subjectcreditrating.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* SubjectCreditRating
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-01-30
*/
public interface SubjectCreditRatingService extends IService<SubjectCreditRatingEntity> {
List<SubjectCreditRatingEntity> getList(SubjectCreditRatingPagination subjectCreditRatingPagination);
List<SubjectCreditRatingEntity> getTypeList(SubjectCreditRatingPagination subjectCreditRatingPagination,String dataType);
SubjectCreditRatingEntity getInfo(String id);
void delete(SubjectCreditRatingEntity entity);
void create(SubjectCreditRatingEntity entity);
boolean update(String id, SubjectCreditRatingEntity entity);
//子表方法
//副表数据方法
String checkForm(SubjectCreditRatingForm form,int i);
void saveOrUpdate(SubjectCreditRatingForm subjectCreditRatingForm,String id, boolean isSave) throws Exception;
}

@ -11,7 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-01-29
* 2024-01-30
*/
public interface SubjectSettlementRulesService extends IService<SubjectSettlementRulesEntity> {
List<SubjectSettlementRulesEntity> getList(SubjectSettlementRulesPagination subjectSettlementRulesPagination);

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

@ -655,4 +655,13 @@ public class BusinessLineServiceImpl extends ServiceImpl<BusinessLineMapper, Bus
public List<BusinessLineEntity> queryBusinessLineListInfo() {
return businessLineMapper.queryBusinessLineList();
}
@Override
public int queryOrganizeCountInfo(String id) {
return businessLineMapper.queryOrganizeCount(id);
}
@Override
public int queryUserCountInfo(String id) {
return businessLineMapper.queryUserCount(id);
}
}

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

@ -0,0 +1,308 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.SubjectCreditRatingMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.subjectcreditrating.*;
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;
/**
*
* SubjectCreditRating
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-01-30
*/
@Service
public class SubjectCreditRatingServiceImpl extends ServiceImpl<SubjectCreditRatingMapper, SubjectCreditRatingEntity> implements SubjectCreditRatingService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Override
public List<SubjectCreditRatingEntity> getList(SubjectCreditRatingPagination subjectCreditRatingPagination){
return getTypeList(subjectCreditRatingPagination,subjectCreditRatingPagination.getDataType());
}
/** 列表查询 */
@Override
public List<SubjectCreditRatingEntity> getTypeList(SubjectCreditRatingPagination subjectCreditRatingPagination,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 ? SubjectCreditRatingConstant.getAppColumnData() : SubjectCreditRatingConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int subjectCreditRatingNum =0;
QueryWrapper<SubjectCreditRatingEntity> subjectCreditRatingQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(subjectCreditRatingPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = subjectCreditRatingPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<SubjectCreditRatingEntity> subjectCreditRatingSuperWrapper = new QueryWrapper<>();
subjectCreditRatingSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(subjectCreditRatingSuperWrapper,SubjectCreditRatingEntity.class,queryJson,"0"));
int subjectCreditRatingNum1 = subjectCreditRatingSuperWrapper.getExpression().getNormal().size();
if (subjectCreditRatingNum1>0){
List<String> subjectCreditRatingList =this.list(subjectCreditRatingSuperWrapper).stream().map(SubjectCreditRatingEntity::getId).collect(Collectors.toList());
allSuperList.addAll(subjectCreditRatingList);
intersectionSuperList.add(subjectCreditRatingList);
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<SubjectCreditRatingEntity> subjectCreditRatingSuperWrapper = new QueryWrapper<>();
subjectCreditRatingSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(subjectCreditRatingSuperWrapper,SubjectCreditRatingEntity.class,ruleJson,"0"));
int subjectCreditRatingNum1 = subjectCreditRatingSuperWrapper.getExpression().getNormal().size();
if (subjectCreditRatingNum1>0){
List<String> subjectCreditRatingList =this.list(subjectCreditRatingSuperWrapper).stream().map(SubjectCreditRatingEntity::getId).collect(Collectors.toList());
allRuleList.addAll(subjectCreditRatingList);
intersectionRuleList.add(subjectCreditRatingList);
ruleNum++;
}
ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : "";
//and or
if(ruleOp.equalsIgnoreCase("and")){
allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList);
}else{
allRuleIDlist = allRuleList;
}
}
boolean pcPermission = true;
boolean appPermission = false;
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object subjectCreditRatingObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(subjectCreditRatingQueryWrapper,SubjectCreditRatingEntity.class,subjectCreditRatingPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(subjectCreditRatingObj)){
return new ArrayList<>();
} else {
subjectCreditRatingQueryWrapper = (QueryWrapper<SubjectCreditRatingEntity>)subjectCreditRatingObj;
if( subjectCreditRatingQueryWrapper.getExpression().getNormal().size()>0){
subjectCreditRatingNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object subjectCreditRatingObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(subjectCreditRatingQueryWrapper,SubjectCreditRatingEntity.class,subjectCreditRatingPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(subjectCreditRatingObj)){
return new ArrayList<>();
} else {
subjectCreditRatingQueryWrapper = (QueryWrapper<SubjectCreditRatingEntity>)subjectCreditRatingObj;
if( subjectCreditRatingQueryWrapper.getExpression().getNormal().size()>0){
subjectCreditRatingNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(subjectCreditRatingPagination.getCreditRating())){
subjectCreditRatingNum++;
List<String> idList = new ArrayList<>();
try {
String[][] creditRating = JsonUtil.getJsonToBean(subjectCreditRatingPagination.getCreditRating(),String[][].class);
for(int i=0;i<creditRating.length;i++){
if(creditRating[i].length>0){
idList.add(JsonUtil.getObjectToString(Arrays.asList(creditRating[i])));
}
}
}catch (Exception e1){
try {
List<String> creditRating = JsonUtil.getJsonToList(subjectCreditRatingPagination.getCreditRating(),String.class);
if(creditRating.size()>0){
idList.addAll(creditRating);
}
}catch (Exception e2){
idList.add(String.valueOf(subjectCreditRatingPagination.getCreditRating()));
}
}
subjectCreditRatingQueryWrapper.lambda().and(t->{
idList.forEach(tt->{
t.like(SubjectCreditRatingEntity::getCreditRating, tt).or();
});
});
}
if(ObjectUtil.isNotEmpty(subjectCreditRatingPagination.getScoreDown())){
subjectCreditRatingNum++;
String value = subjectCreditRatingPagination.getScoreDown() instanceof List ?
JsonUtil.getObjectToString(subjectCreditRatingPagination.getScoreDown()) :
String.valueOf(subjectCreditRatingPagination.getScoreDown());
subjectCreditRatingQueryWrapper.lambda().like(SubjectCreditRatingEntity::getScoreDown,value);
}
if(ObjectUtil.isNotEmpty(subjectCreditRatingPagination.getScoreUpper())){
subjectCreditRatingNum++;
String value = subjectCreditRatingPagination.getScoreUpper() instanceof List ?
JsonUtil.getObjectToString(subjectCreditRatingPagination.getScoreUpper()) :
String.valueOf(subjectCreditRatingPagination.getScoreUpper());
subjectCreditRatingQueryWrapper.lambda().like(SubjectCreditRatingEntity::getScoreUpper,value);
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
subjectCreditRatingQueryWrapper.lambda().in(SubjectCreditRatingEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
subjectCreditRatingQueryWrapper.lambda().and(t->t.in(SubjectCreditRatingEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
subjectCreditRatingQueryWrapper.lambda().and(t->t.in(SubjectCreditRatingEntity::getId, finalAllRuleIDlist));
}
//假删除标志
subjectCreditRatingQueryWrapper.lambda().isNull(SubjectCreditRatingEntity::getDeleteMark);
//排序
if(StringUtil.isEmpty(subjectCreditRatingPagination.getSidx())){
subjectCreditRatingQueryWrapper.lambda().orderByDesc(SubjectCreditRatingEntity::getId);
}else{
try {
String sidx = subjectCreditRatingPagination.getSidx();
String[] strs= sidx.split("_name");
SubjectCreditRatingEntity subjectCreditRatingEntity = new SubjectCreditRatingEntity();
Field declaredField = subjectCreditRatingEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
subjectCreditRatingQueryWrapper="asc".equals(subjectCreditRatingPagination.getSort().toLowerCase())?subjectCreditRatingQueryWrapper.orderByAsc(value):subjectCreditRatingQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<SubjectCreditRatingEntity> page=new Page<>(subjectCreditRatingPagination.getCurrentPage(), subjectCreditRatingPagination.getPageSize());
IPage<SubjectCreditRatingEntity> userIPage=this.page(page, subjectCreditRatingQueryWrapper);
return subjectCreditRatingPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<SubjectCreditRatingEntity> list = new ArrayList();
return subjectCreditRatingPagination.setData(list, list.size());
}
}else{
return this.list(subjectCreditRatingQueryWrapper);
}
}
@Override
public SubjectCreditRatingEntity getInfo(String id){
QueryWrapper<SubjectCreditRatingEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(SubjectCreditRatingEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(SubjectCreditRatingEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, SubjectCreditRatingEntity entity){
return this.updateById(entity);
}
@Override
public void delete(SubjectCreditRatingEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(SubjectCreditRatingForm 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 subjectCreditRatingForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(SubjectCreditRatingForm subjectCreditRatingForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
subjectCreditRatingForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(SubjectCreditRatingConstant.getFormData(),subjectCreditRatingForm),SubjectCreditRatingForm.class);
SubjectCreditRatingEntity entity = JsonUtil.getJsonToBean(subjectCreditRatingForm, SubjectCreditRatingEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setId(mainId);
}else{
}
this.saveOrUpdate(entity);
}
}

@ -36,7 +36,7 @@ import jnpf.permission.entity.UserEntity;
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-01-29
* 2024-01-30
*/
@Service
public class SubjectSettlementRulesServiceImpl extends ServiceImpl<SubjectSettlementRulesMapper, SubjectSettlementRulesEntity> implements SubjectSettlementRulesService{
@ -143,28 +143,6 @@ public class SubjectSettlementRulesServiceImpl extends ServiceImpl<SubjectSettle
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(subjectSettlementRulesPagination.getUnderpaymentAmountDown())){
subjectSettlementRulesNum++;
String value = subjectSettlementRulesPagination.getUnderpaymentAmountDown() instanceof List ?
JsonUtil.getObjectToString(subjectSettlementRulesPagination.getUnderpaymentAmountDown()) :
String.valueOf(subjectSettlementRulesPagination.getUnderpaymentAmountDown());
subjectSettlementRulesQueryWrapper.lambda().like(SubjectSettlementRulesEntity::getUnderpaymentAmountDown,value);
}
if(ObjectUtil.isNotEmpty(subjectSettlementRulesPagination.getUnderpaymentAmountUpper())){
subjectSettlementRulesNum++;
String value = subjectSettlementRulesPagination.getUnderpaymentAmountUpper() instanceof List ?
JsonUtil.getObjectToString(subjectSettlementRulesPagination.getUnderpaymentAmountUpper()) :
String.valueOf(subjectSettlementRulesPagination.getUnderpaymentAmountUpper());
subjectSettlementRulesQueryWrapper.lambda().like(SubjectSettlementRulesEntity::getUnderpaymentAmountUpper,value);
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
@ -188,6 +166,8 @@ public class SubjectSettlementRulesServiceImpl extends ServiceImpl<SubjectSettle
List<String> finalAllRuleIDlist = allRuleIDlist;
subjectSettlementRulesQueryWrapper.lambda().and(t->t.in(SubjectSettlementRulesEntity::getId, finalAllRuleIDlist));
}
//假删除标志
subjectSettlementRulesQueryWrapper.lambda().isNull(SubjectSettlementRulesEntity::getDeleteMark);
//排序
if(StringUtil.isEmpty(subjectSettlementRulesPagination.getSidx())){
@ -252,9 +232,69 @@ public class SubjectSettlementRulesServiceImpl extends ServiceImpl<SubjectSettle
if(StringUtil.isEmpty(form.getUnderpaymentAmountDown())){
return "压款金额下限不能为空";
}
if(StringUtil.isNotEmpty(form.getUnderpaymentAmountDown())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getUnderpaymentAmountDown())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isEmpty(form.getUnderpaymentAmountUpper())){
return "压款金额上限不能为空";
}
if(StringUtil.isNotEmpty(form.getUnderpaymentAmountUpper())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getUnderpaymentAmountUpper())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getUnderpaymentRateDown())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getUnderpaymentRateDown())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getUnderpaymentRateUpper())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getUnderpaymentRateUpper())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getMarginAmountDown())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getMarginAmountDown())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getMarginAmountUpper())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getMarginAmountUpper())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getMarginRateDown())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getMarginRateDown())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getMarginRateUpper())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getMarginRateUpper())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getOverdueAnnualizedDown())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getOverdueAnnualizedDown())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getOverdueAnnualizedUpper())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getOverdueAnnualizedUpper())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getOverdueMonthlyDown())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getOverdueMonthlyDown())).matches()){
return "请输入正确的金额";
}
}
if(StringUtil.isNotEmpty(form.getOverdueMonthlyUpper())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(form.getOverdueMonthlyUpper())).matches()){
return "请输入正确的金额";
}
}
return countRecover;
}
/**

@ -0,0 +1,324 @@
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.businessenterpriserelational.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.web.multipart.MultipartFile;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import java.io.File;
import jnpf.onlinedev.model.ExcelImFieldModel;
import jnpf.onlinedev.model.OnlineImport.ImportDataModel;
import jnpf.onlinedev.model.OnlineImport.ImportFormCheckUniqueModel;
import jnpf.onlinedev.model.OnlineImport.ExcelImportModel;
import jnpf.onlinedev.model.OnlineImport.VisualImportModel;
import cn.xuyanwu.spring.file.storage.FileInfo;
import lombok.Cleanup;
import jnpf.model.visualJson.config.HeaderModel;
import jnpf.base.model.ColumnDataModel;
import jnpf.base.util.VisualUtils;
import org.springframework.transaction.annotation.Transactional;
/**
* businessEnterpriseRelational
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-29
*/
@Slf4j
@RestController
@Tag(name = "businessEnterpriseRelational" , description = "scm")
@RequestMapping("/api/scm/BusinessEnterpriseRelational")
public class BusinessEnterpriseRelationalController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private BusinessEnterpriseRelationalService businessEnterpriseRelationalService;
@Autowired
private ConfigValueUtil configValueUtil;
/**
*
*
* @param businessEnterpriseRelationalPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody BusinessEnterpriseRelationalPagination businessEnterpriseRelationalPagination)throws IOException{
List<BusinessEnterpriseRelationalEntity> list= businessEnterpriseRelationalService.getList(businessEnterpriseRelationalPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (BusinessEnterpriseRelationalEntity entity : list) {
Map<String, Object> businessEnterpriseRelationalMap=JsonUtil.entityToMap(entity);
businessEnterpriseRelationalMap.put("id", businessEnterpriseRelationalMap.get("id"));
//副表数据
//子表数据
realList.add(businessEnterpriseRelationalMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, BusinessEnterpriseRelationalConstant.getFormData(), BusinessEnterpriseRelationalConstant.getColumnData(), businessEnterpriseRelationalPagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(businessEnterpriseRelationalPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param businessEnterpriseRelationalForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid BusinessEnterpriseRelationalForm businessEnterpriseRelationalForm) {
String b = businessEnterpriseRelationalService.checkForm(businessEnterpriseRelationalForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
businessEnterpriseRelationalService.saveOrUpdate(businessEnterpriseRelationalForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
* Excel
*
* @return
*/
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody BusinessEnterpriseRelationalPagination businessEnterpriseRelationalPagination) throws IOException {
if (StringUtil.isEmpty(businessEnterpriseRelationalPagination.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
List<BusinessEnterpriseRelationalEntity> list= businessEnterpriseRelationalService.getList(businessEnterpriseRelationalPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (BusinessEnterpriseRelationalEntity entity : list) {
Map<String, Object> businessEnterpriseRelationalMap=JsonUtil.entityToMap(entity);
businessEnterpriseRelationalMap.put("id", businessEnterpriseRelationalMap.get("id"));
//副表数据
//子表数据
realList.add(businessEnterpriseRelationalMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, BusinessEnterpriseRelationalConstant.getFormData(), BusinessEnterpriseRelationalConstant.getColumnData(), businessEnterpriseRelationalPagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(businessEnterpriseRelationalPagination.getSelectKey())?businessEnterpriseRelationalPagination.getSelectKey():new String[0];
UserInfo userInfo=userProvider.get();
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo);
return ActionResult.success(vo);
}
/**
*
*/
public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){
DownloadVO vo=DownloadVO.builder().build();
List<ExcelExportEntity> entitys=new ArrayList<>();
if(keys.length>0){
for(String key:keys){
switch(key){
case "businessLineId" :
entitys.add(new ExcelExportEntity("业务线id" ,"businessLineId"));
break;
case "enterpriseId" :
entitys.add(new ExcelExportEntity("企业id" ,"enterpriseId"));
break;
default:
break;
}
}
}
ExportParams exportParams = new ExportParams(null, "表单信息");
exportParams.setType(ExcelType.XSSF);
try{
@Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size()>0){
if (list.size()==0){
list.add(new HashMap<>());
}
//去除空数据
List<Map<String, Object>> dataList = new ArrayList<>();
for (Map<String, Object> map : list) {
int i = 0;
for (String key : keys) {
//子表
if (key.toLowerCase().startsWith("tablefield")) {
String tableField = key.substring(0, key.indexOf("-" ));
String field = key.substring(key.indexOf("-" ) + 1);
Object o = map.get(tableField);
if (o != null) {
List<Map<String, Object>> childList = (List<Map<String, Object>>) o;
for (Map<String, Object> childMap : childList) {
if (childMap.get(field) != null) {
i++;
}
}
}
} else {
Object o = map.get(key);
if (o != null) {
i++;
}
}
}
if (i > 0) {
dataList.add(map);
}
}
//复杂表头-表头和数据处理
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(BusinessEnterpriseRelationalConstant.getColumnData(), ColumnDataModel.class);
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList);
}
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList);
}
String fileName = "表单信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
String temporaryFilePath = configValueUtil.getTemporaryFilePath();
FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName);
vo.setName(fileInfo.getFilename());
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName);
} catch (Exception e) {
log.error("信息导出Excel错误:{}", e.getMessage());
e.printStackTrace();
}
return vo;
}
/**
*
* @param id
* @param businessEnterpriseRelationalForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid BusinessEnterpriseRelationalForm businessEnterpriseRelationalForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
businessEnterpriseRelationalForm.setId(id);
if (!isImport) {
String b = businessEnterpriseRelationalService.checkForm(businessEnterpriseRelationalForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
BusinessEnterpriseRelationalEntity entity= businessEnterpriseRelationalService.getInfo(id);
if(entity!=null){
try{
businessEnterpriseRelationalService.saveOrUpdate(businessEnterpriseRelationalForm,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){
BusinessEnterpriseRelationalEntity entity= businessEnterpriseRelationalService.getInfo(id);
if(entity!=null){
//假删除
entity.setDeleteMark(1);
businessEnterpriseRelationalService.update(id,entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
BusinessEnterpriseRelationalEntity entity= businessEnterpriseRelationalService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> businessEnterpriseRelationalMap=JsonUtil.entityToMap(entity);
businessEnterpriseRelationalMap.put("id", businessEnterpriseRelationalMap.get("id"));
//副表数据
//子表数据
businessEnterpriseRelationalMap = generaterSwapUtil.swapDataDetail(businessEnterpriseRelationalMap,BusinessEnterpriseRelationalConstant.getFormData(),"521706011501791237",false);
return ActionResult.success(businessEnterpriseRelationalMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
BusinessEnterpriseRelationalEntity entity= businessEnterpriseRelationalService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> businessEnterpriseRelationalMap=JsonUtil.entityToMap(entity);
businessEnterpriseRelationalMap.put("id", businessEnterpriseRelationalMap.get("id"));
//副表数据
//子表数据
businessEnterpriseRelationalMap = generaterSwapUtil.swapDataForm(businessEnterpriseRelationalMap,BusinessEnterpriseRelationalConstant.getFormData(),BusinessEnterpriseRelationalConstant.TABLEFIELDKEY,BusinessEnterpriseRelationalConstant.TABLERENAMES);
return ActionResult.success(businessEnterpriseRelationalMap);
}
}

@ -95,14 +95,14 @@ public class BusinessLineConfigController {
Map<String, Object> businessLineConfigMap=JsonUtil.entityToMap(entity);
businessLineConfigMap.put("id", businessLineConfigMap.get("id"));
//副表数据
BusinessLineSonEntity businessLineSonEntity = businessLineConfigService.getBusinessLineSon(entity.getId());
BusinessLineSonEntity businessLineSonEntity = businessLineConfigService.getBusinessLineSon(entity.getBusinessLineId());
if(ObjectUtil.isNotEmpty(businessLineSonEntity)){
Map<String, Object> businessLineSonMap=JsonUtil.entityToMap(businessLineSonEntity);
for(String key:businessLineSonMap.keySet()){
businessLineConfigMap.put("jnpf_jg_business_line_jnpf_"+key,businessLineSonMap.get(key));
}
}
BaseUserEntity baseUserEntity = businessLineConfigService.getBaseUser(entity.getId());
BaseUserEntity baseUserEntity = businessLineConfigService.getBaseUser(entity.getUserId());
if(ObjectUtil.isNotEmpty(baseUserEntity)){
Map<String, Object> baseUserMap=JsonUtil.entityToMap(baseUserEntity);
for(String key:baseUserMap.keySet()){

@ -75,22 +75,12 @@ public class BusinessLineController {
*/
@Operation(summary = "获取业务线树形")
@GetMapping("/Tree")
public ActionResult<ListVO<BusinessLineSonTree>> tree() {
List<BusinessLineEntity> list = businessLineService.queryBusinessLineListInfo();
public ActionResult<List<BusinessLineSonTree>> tree() {
List<BusinessLineEntity> list = businessLineService.list();
List<BusinessLineModel> models = JsonUtil.getJsonToList(list, BusinessLineModel.class);
List<SumTree<BusinessLineModel>> trees = TreeDotUtils.convertListToTreeDot(models);
List<BusinessLineSonTree> listVO = JsonUtil.getJsonToList(trees, BusinessLineSonTree.class);
//将子节点全部删除
Iterator<BusinessLineSonTree> iterator = listVO.iterator();
while (iterator.hasNext()) {
BusinessLineSonTree businessLineSonTree = iterator.next();
if (!"-1".equals(businessLineSonTree.getParentId())) {
iterator.remove();
}
}
ListVO vo = new ListVO();
vo.setList(listVO);
return ActionResult.success(vo);
return ActionResult.success(listVO);
}
@ -104,6 +94,10 @@ public class BusinessLineController {
@PostMapping("/getList")
public ActionResult list(@RequestBody BusinessLinePagination businessLinePagination)throws IOException{
List<BusinessLineEntity> list= businessLineService.getList(businessLinePagination);
for (BusinessLineEntity entity : list){
entity.setRelationInstitutionNum(businessLineService.queryOrganizeCountInfo(entity.getId()));
entity.setEmployeeNum(businessLineService.queryUserCountInfo(entity.getId()));
}
List<Map<String, Object>> realList=new ArrayList<>();
for (BusinessLineEntity entity : list) {
Map<String, Object> businessLineMap=JsonUtil.entityToMap(entity);
@ -121,6 +115,7 @@ public class BusinessLineController {
//数据转换
realList = generaterSwapUtil.swapDataList(realList, BusinessLineConstant.getFormData(), BusinessLineConstant.getColumnData(), businessLinePagination.getModuleId(),false);
//流程状态添加
for(Map<String, Object> vo:realList){
FlowTaskEntity flowTaskEntity = generaterSwapUtil.getInfoSubmit(String.valueOf(vo.get("id")), FlowTaskEntity::getStatus);
@ -271,11 +266,11 @@ public class BusinessLineController {
//副表数据
//子表数据
List<BusinessContactEntity> businessContactList = businessLineService.getBusinessContactList(entity.getId());
businessLineMap.put("businesscontactList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(businessContactList)));
businessLineMap.put("businessContactList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(businessContactList)));
List<BusinessAddressEntity> businessAddressList = businessLineService.getBusinessAddressList(entity.getId());
businessLineMap.put("businessaddressList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(businessAddressList)));
businessLineMap.put("businessAddressList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(businessAddressList)));
List<BusinessCargoEntity> businessCargoList = businessLineService.getBusinessCargoList(entity.getId());
businessLineMap.put("businesscargoList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(businessCargoList)));
businessLineMap.put("businessCargoList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(businessCargoList)));
businessLineMap = generaterSwapUtil.swapDataForm(businessLineMap,BusinessLineConstant.getFormData(),BusinessLineConstant.TABLEFIELDKEY,BusinessLineConstant.TABLERENAMES);
return ActionResult.success(businessLineMap);
}

@ -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.businessuserrelational.*;
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;
/**
* businessUserRelational
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-30
*/
@Slf4j
@RestController
@Tag(name = "businessUserRelational" , description = "scm")
@RequestMapping("/api/scm/BusinessUserRelational")
public class BusinessUserRelationalController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private BusinessUserRelationalService businessUserRelationalService;
/**
*
*
* @param businessUserRelationalPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody BusinessUserRelationalPagination businessUserRelationalPagination)throws IOException{
List<BusinessUserRelationalEntity> list= businessUserRelationalService.getList(businessUserRelationalPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (BusinessUserRelationalEntity entity : list) {
Map<String, Object> businessUserRelationalMap=JsonUtil.entityToMap(entity);
businessUserRelationalMap.put("id", businessUserRelationalMap.get("id"));
//副表数据
//子表数据
realList.add(businessUserRelationalMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, BusinessUserRelationalConstant.getFormData(), BusinessUserRelationalConstant.getColumnData(), businessUserRelationalPagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(businessUserRelationalPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param businessUserRelationalForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid BusinessUserRelationalForm businessUserRelationalForm) {
String b = businessUserRelationalService.checkForm(businessUserRelationalForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
businessUserRelationalService.saveOrUpdate(businessUserRelationalForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
*
* @param id
* @param businessUserRelationalForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid BusinessUserRelationalForm businessUserRelationalForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
businessUserRelationalForm.setId(id);
if (!isImport) {
String b = businessUserRelationalService.checkForm(businessUserRelationalForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
BusinessUserRelationalEntity entity= businessUserRelationalService.getInfo(id);
if(entity!=null){
try{
businessUserRelationalService.saveOrUpdate(businessUserRelationalForm,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){
BusinessUserRelationalEntity entity= businessUserRelationalService.getInfo(id);
if(entity!=null){
//主表数据删除
businessUserRelationalService.delete(entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
BusinessUserRelationalEntity entity= businessUserRelationalService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> businessUserRelationalMap=JsonUtil.entityToMap(entity);
businessUserRelationalMap.put("id", businessUserRelationalMap.get("id"));
//副表数据
//子表数据
businessUserRelationalMap = generaterSwapUtil.swapDataDetail(businessUserRelationalMap,BusinessUserRelationalConstant.getFormData(),"521966417814224965",false);
return ActionResult.success(businessUserRelationalMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
BusinessUserRelationalEntity entity= businessUserRelationalService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> businessUserRelationalMap=JsonUtil.entityToMap(entity);
businessUserRelationalMap.put("id", businessUserRelationalMap.get("id"));
//副表数据
//子表数据
businessUserRelationalMap = generaterSwapUtil.swapDataForm(businessUserRelationalMap,BusinessUserRelationalConstant.getFormData(),BusinessUserRelationalConstant.TABLEFIELDKEY,BusinessUserRelationalConstant.TABLERENAMES);
return ActionResult.success(businessUserRelationalMap);
}
}

@ -0,0 +1,345 @@
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.subjectcreditrating.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.web.multipart.MultipartFile;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import java.io.File;
import jnpf.onlinedev.model.ExcelImFieldModel;
import jnpf.onlinedev.model.OnlineImport.ImportDataModel;
import jnpf.onlinedev.model.OnlineImport.ImportFormCheckUniqueModel;
import jnpf.onlinedev.model.OnlineImport.ExcelImportModel;
import jnpf.onlinedev.model.OnlineImport.VisualImportModel;
import cn.xuyanwu.spring.file.storage.FileInfo;
import lombok.Cleanup;
import jnpf.model.visualJson.config.HeaderModel;
import jnpf.base.model.ColumnDataModel;
import jnpf.base.util.VisualUtils;
import org.springframework.transaction.annotation.Transactional;
/**
* SubjectCreditRating
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-30
*/
@Slf4j
@RestController
@Tag(name = "SubjectCreditRating" , description = "scm")
@RequestMapping("/api/scm/SubjectCreditRating")
public class SubjectCreditRatingController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private SubjectCreditRatingService subjectCreditRatingService;
@Autowired
private ConfigValueUtil configValueUtil;
/**
*
*
* @param subjectCreditRatingPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody SubjectCreditRatingPagination subjectCreditRatingPagination)throws IOException{
List<SubjectCreditRatingEntity> list= subjectCreditRatingService.getList(subjectCreditRatingPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (SubjectCreditRatingEntity entity : list) {
Map<String, Object> subjectCreditRatingMap=JsonUtil.entityToMap(entity);
subjectCreditRatingMap.put("id", subjectCreditRatingMap.get("id"));
//副表数据
//子表数据
realList.add(subjectCreditRatingMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, SubjectCreditRatingConstant.getFormData(), SubjectCreditRatingConstant.getColumnData(), subjectCreditRatingPagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(subjectCreditRatingPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param subjectCreditRatingForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid SubjectCreditRatingForm subjectCreditRatingForm) {
String b = subjectCreditRatingService.checkForm(subjectCreditRatingForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
subjectCreditRatingService.saveOrUpdate(subjectCreditRatingForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
* Excel
*
* @return
*/
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody SubjectCreditRatingPagination subjectCreditRatingPagination) throws IOException {
if (StringUtil.isEmpty(subjectCreditRatingPagination.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
List<SubjectCreditRatingEntity> list= subjectCreditRatingService.getList(subjectCreditRatingPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (SubjectCreditRatingEntity entity : list) {
Map<String, Object> subjectCreditRatingMap=JsonUtil.entityToMap(entity);
subjectCreditRatingMap.put("id", subjectCreditRatingMap.get("id"));
//副表数据
//子表数据
realList.add(subjectCreditRatingMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, SubjectCreditRatingConstant.getFormData(), SubjectCreditRatingConstant.getColumnData(), subjectCreditRatingPagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(subjectCreditRatingPagination.getSelectKey())?subjectCreditRatingPagination.getSelectKey():new String[0];
UserInfo userInfo=userProvider.get();
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo);
return ActionResult.success(vo);
}
/**
*
*/
public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){
DownloadVO vo=DownloadVO.builder().build();
List<ExcelExportEntity> entitys=new ArrayList<>();
if(keys.length>0){
for(String key:keys){
switch(key){
case "creditRating" :
entitys.add(new ExcelExportEntity("信用级别" ,"creditRating"));
break;
case "scoreDown" :
entitys.add(new ExcelExportEntity("评定分数最低" ,"scoreDown"));
break;
case "scoreUpper" :
entitys.add(new ExcelExportEntity("评定分数最高" ,"scoreUpper"));
break;
default:
break;
}
}
}
ExportParams exportParams = new ExportParams(null, "表单信息");
exportParams.setType(ExcelType.XSSF);
try{
@Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size()>0){
if (list.size()==0){
list.add(new HashMap<>());
}
//去除空数据
List<Map<String, Object>> dataList = new ArrayList<>();
for (Map<String, Object> map : list) {
int i = 0;
for (String key : keys) {
//子表
if (key.toLowerCase().startsWith("tablefield")) {
String tableField = key.substring(0, key.indexOf("-" ));
String field = key.substring(key.indexOf("-" ) + 1);
Object o = map.get(tableField);
if (o != null) {
List<Map<String, Object>> childList = (List<Map<String, Object>>) o;
for (Map<String, Object> childMap : childList) {
if (childMap.get(field) != null) {
i++;
}
}
}
} else {
Object o = map.get(key);
if (o != null) {
i++;
}
}
}
if (i > 0) {
dataList.add(map);
}
}
//复杂表头-表头和数据处理
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(SubjectCreditRatingConstant.getColumnData(), ColumnDataModel.class);
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList);
}
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList);
}
String fileName = "表单信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
String temporaryFilePath = configValueUtil.getTemporaryFilePath();
FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName);
vo.setName(fileInfo.getFilename());
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName);
} catch (Exception e) {
log.error("信息导出Excel错误:{}", e.getMessage());
e.printStackTrace();
}
return vo;
}
/**
*
* @param ids
* @return
*/
@DeleteMapping("/batchRemove")
@Transactional
@Operation(summary = "批量删除")
public ActionResult batchRemove(@RequestBody String ids){
List<String> idList = JsonUtil.getJsonToList(ids, String.class);
int i =0;
for (String allId : idList){
this.delete(allId);
i++;
}
if (i == 0 ){
return ActionResult.fail("删除失败");
}
return ActionResult.success("删除成功");
}
/**
*
* @param id
* @param subjectCreditRatingForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid SubjectCreditRatingForm subjectCreditRatingForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
subjectCreditRatingForm.setId(id);
if (!isImport) {
String b = subjectCreditRatingService.checkForm(subjectCreditRatingForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
SubjectCreditRatingEntity entity= subjectCreditRatingService.getInfo(id);
if(entity!=null){
try{
subjectCreditRatingService.saveOrUpdate(subjectCreditRatingForm,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){
SubjectCreditRatingEntity entity= subjectCreditRatingService.getInfo(id);
if(entity!=null){
//假删除
entity.setDeleteMark(1);
subjectCreditRatingService.update(id,entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
SubjectCreditRatingEntity entity= subjectCreditRatingService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> subjectCreditRatingMap=JsonUtil.entityToMap(entity);
subjectCreditRatingMap.put("id", subjectCreditRatingMap.get("id"));
//副表数据
//子表数据
subjectCreditRatingMap = generaterSwapUtil.swapDataDetail(subjectCreditRatingMap,SubjectCreditRatingConstant.getFormData(),"522005775749488005",false);
return ActionResult.success(subjectCreditRatingMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
SubjectCreditRatingEntity entity= subjectCreditRatingService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> subjectCreditRatingMap=JsonUtil.entityToMap(entity);
subjectCreditRatingMap.put("id", subjectCreditRatingMap.get("id"));
//副表数据
//子表数据
subjectCreditRatingMap = generaterSwapUtil.swapDataForm(subjectCreditRatingMap,SubjectCreditRatingConstant.getFormData(),SubjectCreditRatingConstant.TABLEFIELDKEY,SubjectCreditRatingConstant.TABLERENAMES);
return ActionResult.success(subjectCreditRatingMap);
}
}

@ -34,7 +34,7 @@ import org.springframework.transaction.annotation.Transactional;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-29
* @ 2024-01-30
*/
@Slf4j
@RestController
@ -169,8 +169,9 @@ public class SubjectSettlementRulesController {
e.printStackTrace();
}
}
//主表数据删除
subjectSettlementRulesService.delete(entity);
//假删除
entity.setDeleteMark(1);
subjectSettlementRulesService.update(id,entity);
}
return ActionResult.success("删除成功");
}

@ -0,0 +1,43 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
* 线
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-29
*/
@Data
@TableName("jg_business_enterprise_relational")
public class BusinessEnterpriseRelationalEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "BUSINESS_LINE_ID" , updateStrategy = FieldStrategy.IGNORED)
private String businessLineId;
@TableField(value = "ENTERPRISE_ID" , updateStrategy = FieldStrategy.IGNORED)
private String enterpriseId;
@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("F_VERSION")
private Integer version;
@TableField("F_FLOW_ID")
private String flowId;
}

@ -1,8 +1,14 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonProperty;
import jnpf.model.businessline.BusinessAddressModel;
import jnpf.model.businessline.BusinessCargoModel;
import jnpf.model.businessline.BusinessContactModel;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* 线
*
@ -106,4 +112,14 @@ public class BusinessLineEntity {
private Integer version;
@TableField("F_FLOW_ID")
private String flowId;
/** 子表数据 **/
@TableField(exist = false)
private List<BusinessContactModel> businessContactList;
/** 子表数据 **/
@TableField(exist = false)
private List<BusinessAddressModel> businessAddressList;
/** 子表数据 **/
@TableField(exist = false)
private List<BusinessCargoModel> businessCargoList;
}

@ -47,7 +47,7 @@ public class BusinessLineSonEntity {
@TableField("PHONE")
private Integer phone;
@TableField("DIFF_FLAG")
private String difflag;
private String diffFlag;
@TableField("FAX")
private String fax;
@TableField("URL")

@ -0,0 +1,45 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
* 线
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-30
*/
@Data
@TableName("jg_business_user_relational")
public class BusinessUserRelationalEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "BUSINESS_LINE_ID" , updateStrategy = FieldStrategy.IGNORED)
private String businessLineId;
@TableField(value = "USER_ID" , updateStrategy = FieldStrategy.IGNORED)
private String userId;
@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("F_VERSION")
private Integer version;
@TableField("F_FLOW_TASK_ID")
private String flowTaskId;
@TableField("F_FLOW_ID")
private String flowId;
}

@ -0,0 +1,62 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-30
*/
@Data
@TableName("jg_subject_credit_rating")
public class SubjectCreditRatingEntity {
@TableId(value ="ID" )
private String id;
@TableField("SUBJECT_BASIC_TYPE")
private String subjectBasicType;
@TableField(value = "CREDIT_RATING" , updateStrategy = FieldStrategy.IGNORED)
private String creditRating;
@TableField(value = "SCORE_DOWN" , updateStrategy = FieldStrategy.IGNORED)
private String scoreDown;
@TableField(value = "SCORE_UPPER" , updateStrategy = FieldStrategy.IGNORED)
private String scoreUpper;
@TableField("LEVEL_DESCRIPTION")
private String levelDescription;
@TableField("START_TIME")
private Date startTime;
@TableField("END_TIME")
private Date endTime;
@TableField("REMARK")
private String remark;
@TableField("ANNEX")
private String annex;
@TableField(value = "f_creator_time" , fill = FieldFill.INSERT)
private Date creatorTime;
@TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
private String creatorUserId;
@TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime;
@TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId;
@TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
private Date deleteTime;
@TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
private String deleteUserId;
@TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("F_FLOW_ID")
private String flowId;
@TableField(value = "company_id" , fill = FieldFill.INSERT)
private String companyId;
@TableField(value = "department_id" , fill = FieldFill.INSERT)
private String departmentId;
}

@ -9,7 +9,7 @@ import java.util.Date;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-29
* @ 2024-01-30
*/
@Data
@TableName("jg_subject_settlement_rules")
@ -58,11 +58,11 @@ public class SubjectSettlementRulesEntity {
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField(value = "UNDERPAYMENT_METHOD" , updateStrategy = FieldStrategy.IGNORED)
@TableField("UNDERPAYMENT_METHOD")
private String underpaymentMethod;
@TableField(value = "MARGIN_METHOD" , updateStrategy = FieldStrategy.IGNORED)
@TableField("MARGIN_METHOD")
private String marginMethod;
@TableField(value = "OVERDUE_METHOD" , updateStrategy = FieldStrategy.IGNORED)
@TableField("OVERDUE_METHOD")
private String overdueMethod;
@TableField("F_FLOW_ID")
private String flowId;

@ -0,0 +1,29 @@
package jnpf.model.businessenterpriserelational;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* businessEnterpriseRelational
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-29
*/
@Data
public class BusinessEnterpriseRelationalForm {
/** 主键 */
private String id;
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
/** 业务线id **/
@JsonProperty("businessLineId")
private String businessLineId;
/** 企业id **/
@JsonProperty("enterpriseId")
private String enterpriseId;
}

@ -0,0 +1,36 @@
package jnpf.model.businessenterpriserelational;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* businessEnterpriseRelational
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-29
*/
@Data
public class BusinessEnterpriseRelationalPagination 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;
/** 业务线id */
@JsonProperty("businessLineId")
private Object businessLineId;
/** 企业id */
@JsonProperty("enterpriseId")
private Object enterpriseId;
}

@ -0,0 +1,26 @@
package jnpf.model.businessuserrelational;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* businessUserRelational
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-30
*/
@Data
public class BusinessUserRelationalForm {
/** 主键 */
private String id;
/** 业务线/仓库id **/
@JsonProperty("businessLineId")
private String businessLineId;
/** 用户id **/
@JsonProperty("userId")
private String userId;
}

@ -0,0 +1,36 @@
package jnpf.model.businessuserrelational;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* businessUserRelational
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-30
*/
@Data
public class BusinessUserRelationalPagination 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;
/** 业务线/仓库id */
@JsonProperty("businessLineId")
private Object businessLineId;
/** 用户id */
@JsonProperty("userId")
private Object userId;
}

@ -0,0 +1,29 @@
package jnpf.model.subjectcreditrating;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* SubjectCreditRating
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-30
*/
@Data
public class SubjectCreditRatingForm {
/** 主键 */
private String id;
/** 信用级别 **/
@JsonProperty("creditRating")
private Object creditRating;
/** 评定分数最低 **/
@JsonProperty("scoreDown")
private String scoreDown;
/** 评定分数最高 **/
@JsonProperty("scoreUpper")
private String scoreUpper;
}

@ -0,0 +1,39 @@
package jnpf.model.subjectcreditrating;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* SubjectCreditRating
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-30
*/
@Data
public class SubjectCreditRatingPagination 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("creditRating")
private Object creditRating;
/** 评定分数最低 */
@JsonProperty("scoreDown")
private Object scoreDown;
/** 评定分数最高 */
@JsonProperty("scoreUpper")
private Object scoreUpper;
}

@ -10,7 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-29
* @ 2024-01-30
*/
@Data
public class SubjectSettlementRulesForm {
@ -20,45 +20,36 @@ public class SubjectSettlementRulesForm {
@JsonProperty("flowId")
private String flowId;
/** 压款方式 **/
@JsonProperty("underpaymentMethod")
private String underpaymentMethod;
/** 压款金额下限 **/
@JsonProperty("underpaymentAmountDown")
private String underpaymentAmountDown;
/** 压款金额上限 **/
@JsonProperty("underpaymentAmountUpper")
private String underpaymentAmountUpper;
/** 保证金方式 **/
@JsonProperty("marginMethod")
private String marginMethod;
/** 保证金金额下限 **/
@JsonProperty("marginAmountDown")
private String marginAmountDown;
/** 保证金金额上限 **/
@JsonProperty("marginAmountUpper")
private String marginAmountUpper;
/** 逾期利率方式 **/
@JsonProperty("overdueMethod")
private String overdueMethod;
/** 逾期年化下限 **/
@JsonProperty("overdueAnnualizedDown")
private String overdueAnnualizedDown;
/** 逾期年化上限 **/
@JsonProperty("overdueAnnualizedUpper")
private String overdueAnnualizedUpper;
/** 压款比例下限 **/
@JsonProperty("underpaymentRateDown")
private String underpaymentRateDown;
/** 压款比例上限 **/
@JsonProperty("underpaymentRateUpper")
private String underpaymentRateUpper;
/** 保证金金额下限 **/
@JsonProperty("marginAmountDown")
private String marginAmountDown;
/** 保证金金额上限 **/
@JsonProperty("marginAmountUpper")
private String marginAmountUpper;
/** 保证金比例下限 **/
@JsonProperty("marginRateDown")
private String marginRateDown;
/** 保证金比例上限 **/
@JsonProperty("marginRateUpper")
private String marginRateUpper;
/** 逾期年化下限 **/
@JsonProperty("overdueAnnualizedDown")
private String overdueAnnualizedDown;
/** 逾期年化上限 **/
@JsonProperty("overdueAnnualizedUpper")
private String overdueAnnualizedUpper;
/** 逾期月化下限 **/
@JsonProperty("overdueMonthlyDown")
private String overdueMonthlyDown;

@ -11,7 +11,7 @@ import java.util.List;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-29
* @ 2024-01-30
*/
@Data
public class SubjectSettlementRulesPagination extends Pagination {
@ -27,10 +27,4 @@ public class SubjectSettlementRulesPagination extends Pagination {
private String moduleId;
/** 菜单id */
private String menuId;
/** 压款金额下限 */
@JsonProperty("underpaymentAmountDown")
private Object underpaymentAmountDown;
/** 压款金额上限 */
@JsonProperty("underpaymentAmountUpper")
private Object underpaymentAmountUpper;
}

@ -0,0 +1,113 @@
<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" v-if="jnpf.hasFormP('creditRating')"
>
<jnpf-form-tip-item label="信用级别"
prop="creditRating" >
<p>{{ dataForm.creditRating }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="jnpf.hasFormP('scoreDown')"
>
<jnpf-form-tip-item label="评定分数最低"
prop="scoreDown" >
<p>{{dataForm.scoreDown}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="jnpf.hasFormP('scoreUpper')"
>
<jnpf-form-tip-item label="评定分数最高"
prop="scoreUpper" >
<p>{{dataForm.scoreUpper}}</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 :'',
creditRating : "",
scoreDown : '',
scoreUpper : '',
},
creditRatingOptions:[{"fullName":"一星","id":"1"},{"fullName":"二星","id":"2"},{"fullName":"三星","id":"3"}],
creditRatingProps:{"label":"fullName","value":"id" },
}
},
computed: {},
watch: {},
created() {
},
mounted() {},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(formData, modelId, defaultValue)
})
})
},
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/scm/SubjectCreditRating/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
})
},
},
}
</script>

@ -0,0 +1,2 @@
const columnList = [{"filterable":false,"clearable":true,"jnpfKey":"select","multiple":false,"fullName":"信用级别","label":"信用级别","sortable":false,"align":"left","props":{"label":"fullName","value":"id"},"__config__":{"formId":103,"visibility":["pc","app"],"jnpfKey":"select","defaultValue":"","noShow":false,"dataType":"static","dictionaryType":"","tipLabel":"","dragDisabled":false,"className":[],"label":"信用级别","trigger":"change","propsUrl":"","templateJson":[],"showLabel":true,"required":false,"tableName":"jg_subject_credit_rating","renderKey":1706592206543,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-select","propsName":"","tag":"JnpfSelect","regList":[],"span":24},"prop":"creditRating","width":0,"options":[{"fullName":"一星","id":"1"},{"fullName":"二星","id":"2"},{"fullName":"三星","id":"3"}],"__vModel__":"creditRating","fixed":"none","style":{"width":"100%"},"disabled":false,"interfaceHasPage":false,"id":"creditRating","placeholder":"请选择","on":{"change":"({ 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":101,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"评定分数最低","trigger":"blur","showLabel":true,"required":false,"tableName":"jg_subject_credit_rating","renderKey":1706592177015,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"prop":"scoreDown","showWordLimit":false,"width":0,"__vModel__":"scoreDown","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"scoreDown","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":"jg_subject_credit_rating","renderKey":1706592246774,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"prop":"scoreUpper","showWordLimit":false,"width":0,"__vModel__":"scoreUpper","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"scoreUpper","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,411 @@
<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" v-if="jnpf.hasFormP('creditRating')" >
<jnpf-form-tip-item
label="信用级别" v-if="jnpf.hasFormP('creditRating')" prop="creditRating" >
<JnpfSelect v-model="dataForm.creditRating" @change="changeData('creditRating',-1)"
placeholder="请选择" clearable :style='{"width":"100%"}' :options="creditRatingOptions" :props="creditRatingProps" >
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="jnpf.hasFormP('scoreDown')" >
<jnpf-form-tip-item
label="评定分数最低" v-if="jnpf.hasFormP('scoreDown')" prop="scoreDown" >
<JnpfInput v-model="dataForm.scoreDown" @change="changeData('scoreDown',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="jnpf.hasFormP('scoreUpper')" >
<jnpf-form-tip-item
label="评定分数最高" v-if="jnpf.hasFormP('scoreUpper')" prop="scoreUpper" >
<JnpfInput v-model="dataForm.scoreUpper" @change="changeData('scoreUpper',-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: {
creditRating : undefined,
scoreDown : undefined,
scoreUpper : undefined,
},
tableRequiredData: {},
dataRule:
{
},
creditRatingOptions:[{"fullName":"一星","id":"1"},{"fullName":"二星","id":"2"},{"fullName":"三星","id":"3"}],
creditRatingProps:{"label":"fullName","value":"id" },
childIndex:-1,
isEdit:false,
interfaceRes: {
creditRating:[] ,
scoreDown:[] ,
scoreUpper:[] ,
},
}
},
computed: {
...mapGetters(['userInfo'])
},
watch: {},
created() {
this.dataAll()
this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() {},
methods: {
prev() {
this.index--
if (this.index === 0) {
this.prevDis = true
}
this.nextDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
next() {
this.index++
if (this.index === this.allList.length - 1) {
this.nextDis = true
}
this.prevDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
getInfo(id) {
request({
url: '/api/scm/SubjectCreditRating/'+ 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/scm/SubjectCreditRating/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
}else{
this.clearData()
this.initDefaultData()
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
initDefaultData() {
},
//
dataFormSubmit(type) {
this.dataFormSubmitType = type ? type : 0
this.$refs['formRef'].validate((valid) => {
if (valid) {
this.request()
}
})
},
request() {
let _data =this.dataList()
if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true
} else {
this.btnLoading = true
}
if (!this.dataForm.id) {
request({
url: '/api/scm/SubjectCreditRating',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) {
this.$nextTick(() => {
this.clearData()
this.initDefaultData()
})
this.continueBtnLoading = false
return
}
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
}
})
}).catch(()=>{
this.btnLoading = false
this.continueBtnLoading = false
})
}else{
request({
url: '/api/scm/SubjectCreditRating/'+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,516 @@
<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="信用级别">
<JnpfSelect v-model="query.creditRating" placeholder="请选择" clearable
:options="creditRatingOptions"
:props="creditRatingProps" multiple >
</JnpfSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="评定分数最低">
<el-input v-model="query.scoreDown" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="评定分数最高">
<el-input v-model="query.scoreUpper" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button type="primary" icon="icon-ym icon-ym-btn-add" v-has="'btn_add'" @click="addOrUpdateHandle()">
</el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-download" @click="exportData()" v-has="'btn_download'" >导出
</el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-clearn" @click="handleBatchRemoveDel()" v-has="'btn_batchRemove'" >批量删除
</el-button>
</div>
<div class="JNPF-common-head-right">
<el-tooltip content="高级查询" placement="top" v-if="true">
<el-link icon="icon-ym icon-ym-filter JNPF-common-head-icon" :underline="false"
@click="openSuperQuery()" />
</el-tooltip>
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
@click="initData()" />
</el-tooltip>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange"
:span-method="arraySpanMethod"
>
<el-table-column label="信用级别" prop="creditRating" algin="left"
v-if="jnpf.hasP('creditRating')" >
<template slot-scope="scope">
{{ scope.row.creditRating}}
</template>
</el-table-column>
<el-table-column
prop="scoreDown"
label="评定分数最低" align="left"
v-if="jnpf.hasP('scoreDown')" >
</el-table-column>
<el-table-column
prop="scoreUpper"
label="评定分数最高" align="left"
v-if="jnpf.hasP('scoreUpper')" >
</el-table-column>
<el-table-column label="操作"
fixed="right" width="150" >
<template slot-scope="scope" >
<el-button type="text"
@click="addOrUpdateHandle(scope.row)" v-has="'btn_edit'" >编辑
</el-button>
<el-button type="text" class="JNPF-table-delBtn" v-has="'btn_remove'" @click="handleDel(scope.row.id)">
</el-button>
<el-button type="text" v-has="'btn_detail'"
@click="goDetail(scope.row.id)">详情
</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson"
@superQuery="superQuery" />
</div>
</template>
<script>
import request from '@/utils/request'
import {mapGetters} from "vuex";
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
import JNPFForm from './form'
import Detail from './Detail'
import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
import { getConfigData } from '@/api/onlineDev/visualDev'
import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize'
import columnList from './columnList'
import { thousandsFormat } from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
export default {
components: {
JNPFForm,
Detail,
ExportBox,ToFormDetail , SuperQuery
},
data() {
return {
keyword:'',
expandsTree: true,
refreshTree: true,
toFormDetailVisible:false,
expandObj:{},
columnOptions: [],
mergeList: [],
exportList:[],
columnList,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
creditRating:undefined,
scoreDown:undefined,
scoreUpper:undefined,
},
treeProps: {
children: 'children',
label: 'fullName',
value: 'id',
isLeaf: 'isLeaf'
},
list: [],
listLoading: true,
multipleSelection: [], total: 0,
queryData: {},
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
formVisible: false,
flowVisible: false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
creditRatingOptions:[{"fullName":"一星","id":"1"},{"fullName":"二星","id":"2"},{"fullName":"三星","id":"3"}],
creditRatingProps:{"label":"fullName","value":"id" },
interfaceRes: {
},
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
this.getColumnList(),
this.initSearchDataAndListData()
this.queryData = JSON.parse(JSON.stringify(this.query))
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.toFormDetailVisible = true
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue)
})
})
},
toggleTreeExpand(expands) {
this.refreshTree = false
this.expandsTree = expands
this.$nextTick(() => {
this.refreshTree = true
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null)
})
})
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data
const config ={
treeInterfaceId:"",
treeTemplateJson:[]
}
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || ''
}
}
//
let query = {
paramList: config.treeTemplateJson || [],
}
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
})
}
},
getColumnList() {
//
let columnPermissionList = []
const permissionList = this.$store.getters.permissionList
const modelId = this.$route.meta.modelId
const list = permissionList.filter(o => o.modelId === modelId)
const columnList = list[0] && list[0].column ? list[0].column : []
for (let i = 0; i < this.columnList.length; i++) {
inner: for (let j = 0; j < columnList.length; j++) {
if (this.columnList[i].prop === columnList[j].enCode) {
columnPermissionList.push(this.columnList[i])
break inner
}
}
}
this.columnOptions = this.transformColumnList(columnPermissionList)
},
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:'522005775749488005',
type:1,
};
request({
url: `/api/scm/SubjectCreditRating/getList`,
method: 'post',
data: _query
}).then(res => {
var _list =res.data.list;
this.list = _list.map(o => ({
...o,
...this.expandObj,
}))
this.total = res.data.pagination.total
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/scm/SubjectCreditRating/${id}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {
});
},
handelUpload(){
this.uploadBoxVisible = true
this.$nextTick(() => {
this.$refs.UploadBox.init("","scm/SubjectCreditRating")
})
},
handleSelectionChange(val) {
const res = val.map(item => item.id)
this.multipleSelection = res
},
handleBatchRemoveDel() {
if (!this.multipleSelection.length) {
this.$message({
type: 'error',
message: '请选择一条数据',
duration: 1500,
})
return
}
const ids = this.multipleSelection
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/scm/SubjectCreditRating/batchRemove`,
data: ids,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {
})
},
openSuperQuery() {
this.superQueryVisible = true
this.$nextTick(() => {
this.$refs.SuperQuery.init()
})
},
superQuery(queryJson) {
this.listQuery.superQueryJson = queryJson
this.listQuery.currentPage = 1
this.initData()
},
addOrUpdateHandle(row, isDetail) {
let id = row?row.id:""
this.formVisible = true
this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail,this.list)
})
},
exportData() {
this.exportBoxVisible = true
this.$nextTick(() => {
this.$refs.ExportBox.init(this.exportList)
})
},
download(data) {
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
request({
url: `/api/scm/SubjectCreditRating/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 = [{"filterable":false,"clearable":true,"multiple":false,"fullName":"信用级别","props":{"label":"fullName","value":"id"},"__config__":{"formId":103,"visibility":["pc","app"],"jnpfKey":"select","defaultValue":"","noShow":false,"dataType":"static","dictionaryType":"","tipLabel":"","dragDisabled":false,"className":[],"label":"信用级别","trigger":"change","propsUrl":"","templateJson":[],"showLabel":true,"required":false,"tableName":"jg_subject_credit_rating","renderKey":1706592206543,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-select","propsName":"","tag":"JnpfSelect","regList":[],"span":24},"options":[{"fullName":"一星","id":"1"},{"fullName":"二星","id":"2"},{"fullName":"三星","id":"3"}],"__vModel__":"creditRating","style":{"width":"100%"},"disabled":false,"interfaceHasPage":false,"id":"creditRating","placeholder":"请选择","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"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":"jg_subject_credit_rating","renderKey":1706592177015,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"scoreDown","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"scoreDown","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":"jg_subject_credit_rating","renderKey":1706592246774,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"scoreUpper","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"scoreUpper","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

File diff suppressed because one or more lines are too long

@ -5,114 +5,73 @@
:disabled="setting.readonly">
<template v-if="!loading && formOperates">
<!-- 具体表单 -->
<el-col :span="8" v-if="judgeShow('underpaymentMethod')">
<jnpf-form-tip-item label="压款方式" v-if="judgeShow('underpaymentMethod')" prop="underpaymentMethod">
<JnpfRadio v-model="dataForm.underpaymentMethod" @change="changeData('underpaymentMethod',-1)"
:disabled="judgeWrite('underpaymentMethod')" optionType="default" direction="horizontal" size="small"
:options="underpaymentMethodOptions" :props="underpaymentMethodProps">
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('underpaymentAmountDown')">
<jnpf-form-tip-item label="压款金额下限" v-if="judgeShow('underpaymentAmountDown')" prop="underpaymentAmountDown">
<JnpfInput v-model="dataForm.underpaymentAmountDown" @change="changeData('underpaymentAmountDown',-1)"
placeholder="请输入" :disabled="judgeWrite('underpaymentAmountDown')" clearable :style='{"width":"100%"}'>
<el-col :span="12" v-if="judgeShow('underpaymentAmountDown')">
<jnpf-form-tip-item label="压款金额" v-if="judgeShow('underpaymentAmountDown')" prop="underpaymentAmountDown">
<JnpfInput v-model="dataForm.underpaymentAmountDown" @change="changeData('underpaymentAmountDown',-1)" placeholder="请输入"
:disabled="judgeWrite('underpaymentAmountDown')" addonAfter="元" clearable :style='{"width":"40%"}'>
</JnpfInput>
<label></label>
<JnpfInput v-model="dataForm.underpaymentAmountUpper" @change="changeData('underpaymentAmountUpper',-1)" placeholder="请输入"
:disabled="judgeWrite('underpaymentAmountUpper')" addonAfter="元" clearable :style='{"width":"40%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('underpaymentAmountUpper')">
<jnpf-form-tip-item label="压款金额上限" v-if="judgeShow('underpaymentAmountUpper')"
<el-col :span="12" v-if="judgeShow('underpaymentRateDown')">
<jnpf-form-tip-item label="压款比例" v-if="judgeShow('underpaymentRateDown')"
prop="underpaymentAmountUpper">
<JnpfInput v-model="dataForm.underpaymentAmountUpper" @change="changeData('underpaymentAmountUpper',-1)"
placeholder="请输入" :disabled="judgeWrite('underpaymentAmountUpper')" clearable :style='{"width":"100%"}'>
<JnpfInput v-model="dataForm.underpaymentRateDown" @change="changeData('underpaymentRateDown',-1)" placeholder="请输入"
:disabled="judgeWrite('underpaymentRateDown')" addonAfter="%" clearable :style='{"width":"40%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('marginMethod')">
<jnpf-form-tip-item label="保证金方式" v-if="judgeShow('marginMethod')" prop="marginMethod">
<JnpfRadio v-model="dataForm.marginMethod" @change="changeData('marginMethod',-1)"
:disabled="judgeWrite('marginMethod')" optionType="default" direction="horizontal" size="small"
:options="marginMethodOptions" :props="marginMethodProps">
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('marginAmountDown')">
<jnpf-form-tip-item label="保证金金额下限" v-if="judgeShow('marginAmountDown')" prop="marginAmountDown">
<JnpfInput v-model="dataForm.marginAmountDown" @change="changeData('marginAmountDown',-1)"
placeholder="请输入" :disabled="judgeWrite('marginAmountDown')" clearable :style='{"width":"100%"}'>
<label></label>
<JnpfInput v-model="dataForm.underpaymentRateUpper" @change="changeData('underpaymentRateUpper',-1)" placeholder="请输入"
:disabled="judgeWrite('underpaymentRateUpper')" addonAfter="%" clearable :style='{"width":"40%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('marginAmountUpper')">
<jnpf-form-tip-item label="保证金金额上限" v-if="judgeShow('marginAmountUpper')" prop="marginAmountUpper">
<JnpfInput v-model="dataForm.marginAmountUpper" @change="changeData('marginAmountUpper',-1)"
placeholder="请输入" :disabled="judgeWrite('marginAmountUpper')" clearable :style='{"width":"100%"}'>
<el-col :span="12" v-if="judgeShow('marginAmountDown')">
<jnpf-form-tip-item label="保证金金额" v-if="judgeShow('marginAmountDown')" prop="marginAmountDown">
<JnpfInput v-model="dataForm.marginAmountDown" @change="changeData('marginAmountDown',-1)" placeholder="请输入"
:disabled="judgeWrite('marginAmountDown')" addonAfter="元" clearable :style='{"width":"40%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('overdueMethod')">
<jnpf-form-tip-item label="逾期利率方式" v-if="judgeShow('overdueMethod')" prop="overdueMethod">
<JnpfRadio v-model="dataForm.overdueMethod" @change="changeData('overdueMethod',-1)"
:disabled="judgeWrite('overdueMethod')" optionType="default" direction="horizontal" size="small"
:options="overdueMethodOptions" :props="overdueMethodProps">
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('overdueAnnualizedDown')">
<jnpf-form-tip-item label="逾期年化下限" v-if="judgeShow('overdueAnnualizedDown')" prop="overdueAnnualizedDown">
<JnpfInput v-model="dataForm.overdueAnnualizedDown" @change="changeData('overdueAnnualizedDown',-1)"
placeholder="请输入" :disabled="judgeWrite('overdueAnnualizedDown')" clearable :style='{"width":"100%"}'>
<label></label>
<JnpfInput v-model="dataForm.marginAmountUpper" @change="changeData('marginAmountUpper',-1)" placeholder="请输入"
:disabled="judgeWrite('marginAmountUpper')" addonAfter="元" clearable :style='{"width":"40%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('overdueAnnualizedUpper')">
<jnpf-form-tip-item label="逾期年化上限" v-if="judgeShow('overdueAnnualizedUpper')" prop="overdueAnnualizedUpper">
<JnpfInput v-model="dataForm.overdueAnnualizedUpper" @change="changeData('overdueAnnualizedUpper',-1)"
placeholder="请输入" :disabled="judgeWrite('overdueAnnualizedUpper')" clearable :style='{"width":"100%"}'>
<el-col :span="12" v-if="judgeShow('marginRateDown')">
<jnpf-form-tip-item label="保证金比例" v-if="judgeShow('marginRateDown')" prop="marginRateDown">
<JnpfInput v-model="dataForm.marginRateDown" @change="changeData('marginRateDown',-1)" placeholder="请输入"
:disabled="judgeWrite('marginRateDown')" addonAfter="%" clearable :style='{"width":"40%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('underpaymentRateDown')">
<jnpf-form-tip-item label="压款比例下限" v-if="judgeShow('underpaymentRateDown')" prop="underpaymentRateDown">
<JnpfInput v-model="dataForm.underpaymentRateDown" @change="changeData('underpaymentRateDown',-1)"
placeholder="请输入" :disabled="judgeWrite('underpaymentRateDown')" clearable :style='{"width":"100%"}'>
<label></label>
<JnpfInput v-model="dataForm.marginRateUpper" @change="changeData('marginRateUpper',-1)" placeholder="请输入"
:disabled="judgeWrite('marginRateUpper')" addonAfter="%" clearable :style='{"width":"40%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('underpaymentRateUpper')">
<jnpf-form-tip-item label="压款比例上限" v-if="judgeShow('underpaymentRateUpper')" prop="underpaymentRateUpper">
<JnpfInput v-model="dataForm.underpaymentRateUpper" @change="changeData('underpaymentRateUpper',-1)"
placeholder="请输入" :disabled="judgeWrite('underpaymentRateUpper')" clearable :style='{"width":"100%"}'>
<el-col :span="12" v-if="judgeShow('overdueAnnualizedDown')">
<jnpf-form-tip-item label="逾期年化" v-if="judgeShow('overdueAnnualizedDown')" prop="overdueAnnualizedDown">
<JnpfInput v-model="dataForm.overdueAnnualizedDown" @change="changeData('overdueAnnualizedDown',-1)" placeholder="请输入"
:disabled="judgeWrite('overdueAnnualizedDown')" addonAfter="%" clearable :style='{"width":"40%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('marginRateDown')">
<jnpf-form-tip-item label="保证金比例下限" v-if="judgeShow('marginRateDown')" prop="marginRateDown">
<JnpfInput v-model="dataForm.marginRateDown" @change="changeData('marginRateDown',-1)" placeholder="请输入"
:disabled="judgeWrite('marginRateDown')" clearable :style='{"width":"100%"}'>
<label></label>
<JnpfInput v-model="dataForm.overdueAnnualizedUpper" @change="changeData('overdueAnnualizedUpper',-1)" placeholder="请输入"
:disabled="judgeWrite('overdueAnnualizedUpper')" addonAfter="%" clearable :style='{"width":"40%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('marginRateUpper')">
<jnpf-form-tip-item label="保证金比例上限" v-if="judgeShow('marginRateUpper')" prop="marginRateUpper">
<JnpfInput v-model="dataForm.marginRateUpper" @change="changeData('marginRateUpper',-1)" placeholder="请输入"
:disabled="judgeWrite('marginRateUpper')" clearable :style='{"width":"100%"}'>
<el-col :span="12" v-if="judgeShow('overdueMonthlyDown')">
<jnpf-form-tip-item label="逾期月化" v-if="judgeShow('overdueMonthlyDown')" prop="overdueMonthlyDown">
<JnpfInput v-model="dataForm.overdueMonthlyDown" @change="changeData('overdueMonthlyDown',-1)" placeholder="请输入"
:disabled="judgeWrite('overdueMonthlyDown')" addonAfter="%" clearable :style='{"width":"40%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('overdueMonthlyDown')">
<jnpf-form-tip-item label="逾期月化下限" v-if="judgeShow('overdueMonthlyDown')" prop="overdueMonthlyDown">
<JnpfInput v-model="dataForm.overdueMonthlyDown" @change="changeData('overdueMonthlyDown',-1)"
placeholder="请输入" :disabled="judgeWrite('overdueMonthlyDown')" clearable :style='{"width":"100%"}'>
<label></label>
<JnpfInput v-model="dataForm.overdueMonthlyUpper" @change="changeData('overdueMonthlyUpper',-1)" placeholder="请输入"
:disabled="judgeWrite('overdueMonthlyUpper')" addonAfter="%" clearable :style='{"width":"40%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('overdueMonthlyUpper')">
<jnpf-form-tip-item label="逾期月化上限" v-if="judgeShow('overdueMonthlyUpper')" prop="overdueMonthlyUpper">
<JnpfInput v-model="dataForm.overdueMonthlyUpper" @change="changeData('overdueMonthlyUpper',-1)"
placeholder="请输入" :disabled="judgeWrite('overdueMonthlyUpper')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
@ -184,95 +143,97 @@
Vmodel: "",
currVmodel: "",
dataForm: {
underpaymentMethod: "1",
underpaymentAmountDown: undefined,
underpaymentAmountUpper: undefined,
marginMethod: "1",
marginAmountDown: undefined,
marginAmountUpper: undefined,
overdueMethod: "1",
overdueAnnualizedDown: undefined,
overdueAnnualizedUpper: undefined,
underpaymentRateDown: undefined,
underpaymentRateUpper: undefined,
marginAmountDown: undefined,
marginAmountUpper: undefined,
marginRateDown: undefined,
marginRateUpper: undefined,
overdueAnnualizedDown: undefined,
overdueAnnualizedUpper: undefined,
overdueMonthlyDown: undefined,
overdueMonthlyUpper: undefined,
},
tableRequiredData: {},
dataRule: {
underpaymentMethod: [{
required: true,
message: '请至少选择一个',
trigger: 'change'
}, ],
underpaymentAmountDown: [{
required: true,
message: '请输入',
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
},
],
underpaymentAmountUpper: [{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
},
],
underpaymentRateDown: [{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
}, ],
underpaymentAmountUpper: [{
required: true,
message: '请输入',
underpaymentRateUpper: [{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
}, ],
marginAmountDown: [{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
}, ],
marginAmountUpper: [{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
}, ],
marginRateDown: [{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
}, ],
marginRateUpper: [{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
}, ],
overdueAnnualizedDown: [{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
}, ],
overdueAnnualizedUpper: [{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
}, ],
overdueMonthlyDown: [{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
}, ],
overdueMonthlyUpper: [{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '请输入正确的金额',
trigger: 'blur'
}, ],
},
underpaymentMethodOptions: [{
"fullName": "无",
"id": "1"
}, {
"fullName": "按金额",
"id": "2"
}, {
"fullName": "按比例",
"id": "3"
}],
underpaymentMethodProps: {
"label": "fullName",
"value": "id"
},
marginMethodOptions: [{
"fullName": "无",
"id": "1"
}, {
"fullName": "按金额",
"id": "2"
}, {
"fullName": "按比例",
"id": "3"
}],
marginMethodProps: {
"label": "fullName",
"value": "id"
},
overdueMethodOptions: [{
"fullName": "按年化",
"id": "1"
}, {
"fullName": "按月化",
"id": "2"
}],
overdueMethodProps: {
"label": "fullName",
"value": "id"
},
childIndex: -1,
isEdit: false,
interfaceRes: {
underpaymentMethod: [],
underpaymentAmountDown: [],
underpaymentAmountUpper: [],
marginMethod: [],
marginAmountDown: [],
marginAmountUpper: [],
overdueMethod: [],
overdueAnnualizedDown: [],
overdueAnnualizedUpper: [],
underpaymentRateDown: [],
underpaymentRateUpper: [],
marginAmountDown: [],
marginAmountUpper: [],
marginRateDown: [],
marginRateUpper: [],
overdueAnnualizedDown: [],
overdueAnnualizedUpper: [],
overdueMonthlyDown: [],
overdueMonthlyUpper: [],
},
@ -382,6 +343,9 @@
}
return isOk
},
goBack() {
this.$emit('refresh')
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},

@ -1,18 +1,8 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<!-- <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.underpaymentAmountDown" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="压款金额上限">
<el-input v-model="query.underpaymentAmountUpper" 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>
@ -20,7 +10,7 @@
</el-form-item>
</el-col>
</el-form>
</el-row>
</el-row> -->
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
@ -42,6 +32,26 @@
</el-table-column>
<el-table-column prop="underpaymentAmountUpper" label="压款金额上限" align="left">
</el-table-column>
<el-table-column prop="marginAmountDown" label="保证金金额下限" align="left">
</el-table-column>
<el-table-column prop="marginAmountUpper" label="保证金金额上限" align="left">
</el-table-column>
<el-table-column prop="overdueAnnualizedDown" label="逾期年化下限" align="left">
</el-table-column>
<el-table-column prop="overdueAnnualizedUpper" label="逾期年化上限" align="left">
</el-table-column>
<el-table-column prop="underpaymentRateDown" label="压款比例下限" align="left">
</el-table-column>
<el-table-column prop="underpaymentRateUpper" label="压款比例上限" align="left">
</el-table-column>
<el-table-column prop="marginRateDown" label="保证金比例下限" align="left">
</el-table-column>
<el-table-column prop="marginRateUpper" label="保证金比例上限" align="left">
</el-table-column>
<el-table-column prop="overdueMonthlyDown" label="逾期月化下限" align="left">
</el-table-column>
<el-table-column prop="overdueMonthlyUpper" label="逾期月化上限" align="left">
</el-table-column>
<el-table-column prop="flowState" label="状态" width="100">
<template slot-scope="scope" v-if="!scope.row.top">
<el-tag v-if="scope.row.flowState==1"></el-tag>
@ -150,10 +160,7 @@
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
underpaymentAmountDown: undefined,
underpaymentAmountUpper: undefined,
},
query: {},
treeProps: {
children: 'children',
label: 'fullName',
@ -176,45 +183,6 @@
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
underpaymentMethodOptions: [{
"fullName": "无",
"id": "1"
}, {
"fullName": "按金额",
"id": "2"
}, {
"fullName": "按比例",
"id": "3"
}],
underpaymentMethodProps: {
"label": "fullName",
"value": "id"
},
marginMethodOptions: [{
"fullName": "无",
"id": "1"
}, {
"fullName": "按金额",
"id": "2"
}, {
"fullName": "按比例",
"id": "3"
}],
marginMethodProps: {
"label": "fullName",
"value": "id"
},
overdueMethodOptions: [{
"fullName": "按年化",
"id": "1"
}, {
"fullName": "按月化",
"id": "2"
}],
overdueMethodProps: {
"label": "fullName",
"value": "id"
},
interfaceRes: {},
}
},

File diff suppressed because one or more lines are too long

@ -33,6 +33,11 @@
<el-input v-model="dataForm.enCode" placeholder="输入公司编码" />
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="ERP编码" prop="ERPCode">
<el-input v-model="dataForm.ERPCode" placeholder="输入ERP编码" />
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="公司简称" prop="propertyJson.shortName">
<el-input v-model="dataForm.propertyJson.shortName" placeholder="输入公司简称" />
@ -95,8 +100,8 @@
</div>
<el-row :gutter="20" class="custom-row">
<el-col :sm="12" :xs="24">
<el-form-item label="公司法人" prop="propertyJson.managerName">
<el-input v-model="dataForm.propertyJson.managerName" placeholder="输入公司法人" />
<el-form-item label="首联系人" prop="propertyJson.managerName">
<el-input v-model="dataForm.propertyJson.managerName" placeholder="输入首联系人" />
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
@ -114,6 +119,16 @@
<el-input v-model="dataForm.propertyJson.manageEmail" placeholder="输入联系邮箱" />
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="企业税号" prop="propertyJson.enyerpriseTaxNum">
<el-input v-model="dataForm.propertyJson.enyerpriseTaxNum" placeholder="输入企业税号" />
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="发票抬头" prop="propertyJson.invoiceTitle">
<el-input v-model="dataForm.propertyJson.invoiceTitle" placeholder="输入发票抬头" />
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="开户银行" prop="propertyJson.bankName">
<el-input v-model="dataForm.propertyJson.bankName" placeholder="输入开户银行" />
@ -124,6 +139,11 @@
<el-input v-model="dataForm.propertyJson.bankAccount" placeholder="输入银行账户" />
</el-form-item>
</el-col>
<el-col :sm="12" :xs="24">
<el-form-item label="注册地址" prop="propertyJson.registeredAddress">
<el-input v-model="dataForm.propertyJson.registeredAddress" placeholder="输入注册地址" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="经营范围" prop="propertyJson.businessscope">
<el-input v-model="dataForm.propertyJson.businessscope" type="textarea" :rows="3" />
@ -153,6 +173,7 @@ export default {
enabledMark: 1,
sortCode: 0,
description: '',
ERPCode: '',
propertyJson: {
shortName: '',
enterpriseNature: '',
@ -168,7 +189,10 @@ export default {
manageEmail: '',
bankName: '',
bankAccount: '',
businessscope: ''
businessscope: '',
enyerpriseTaxNum: '',
invoiceTitle: '',
registeredAddress: '',
}
},
parentId: '',

@ -15,6 +15,9 @@
<el-form-item label="部门编码" prop="enCode">
<el-input v-model="dataForm.enCode" placeholder="输入编码" />
</el-form-item>
<el-form-item label="ERP编码" prop="ERPCode">
<el-input v-model="dataForm.ERPCode" placeholder="输入ERP编码" />
</el-form-item>
<el-form-item label="部门主管" prop="managerId">
<JnpfUserSelect v-model="dataForm.managerId" placeholder="选择部门主管" />
</el-form-item>
@ -51,7 +54,8 @@ export default {
enCode: '',
sortCode: 0,
enabledMark: 1,
description: ''
description: '',
ERPCode: ''
},
organizeIdTree: [],
dataRule: {
@ -82,6 +86,7 @@ export default {
if (this.dataForm.id) {
getDepartmentInfo(this.dataForm.id).then(res => {
this.dataForm = res.data
debugger
this.organizeIdTree = res.data.organizeIdTree
this.formLoading = false
})

@ -239,7 +239,6 @@ export default {
this.filterText = ''
this.treeLoading = true
getDepartmentSelectorByAuth().then(res => {
debugger
this.treeData = res.data.list
this.treeLoading = false
if (isInit) this.initData()

@ -85,7 +85,7 @@
</el-col>
<el-col :span="24" v-if="judgeShow('-${html.relationField}')">
<jnpf-form-tip-item label-width="0">
<el-table :data="dataForm.businesscontactList" size='mini'>
<el-table :data="dataForm.businessContactList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="类型" v-if="judgeShow('businesscontact-contactType')"
prop="contactType">
@ -243,13 +243,13 @@ export default {
currTableConf: {},
dataValueAll: {},
addTableConf: {
businesscontactList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
businessContactList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
},
//
ableAll: {
},
tableRows: {
businesscontactList: {
businessContactList: {
contactTypeOptions: [],
name: '',
nameOptions: [],
@ -277,7 +277,7 @@ export default {
city: [],
establishDate: undefined,
description: undefined,
businesscontactList: [],
businessContactList: [],
version: 0,
diffFlag: undefined,
},
@ -458,8 +458,8 @@ export default {
},
businesscontactExist() {
let isOk = true;
for (let i = 0; i < this.dataForm.businesscontactList.length; i++) {
const e = this.dataForm.businesscontactList[i];
for (let i = 0; i < this.dataForm.businessContactList.length; i++) {
const e = this.dataForm.businessContactList[i];
if (!e.contactType) {
this.$message({
message: '类型不能为空',
@ -541,14 +541,14 @@ export default {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.businesscontactList.splice(index, 1);
this.dataForm.businessContactList.splice(index, 1);
}).catch(() => {
});
},
getbusinesscontactList(value) {
let item = { ...this.tableRows.businesscontactList, ...value }
this.dataForm.businesscontactList.push(item)
this.childIndex = this.dataForm.businesscontactList.length - 1
let item = { ...this.tableRows.businessContactList, ...value }
this.dataForm.businessContactList.push(item)
this.childIndex = this.dataForm.businessContactList.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
@ -641,7 +641,7 @@ export default {
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
for (let i = 0; i < _dataAll.businesscontactList.length; i++) {
for (let i = 0; i < _dataAll.businessContactList.length; i++) {
this.childIndex = i
}
this.childIndex = -1

@ -84,18 +84,22 @@
</el-table-column>
<el-table-column prop="name" label="业务线名称" align="left">
</el-table-column>
<el-table-column prop="simpleName" label="业务线简称" align="left">
</el-table-column>
<el-table-column prop="type" label="类型" align="left">
</el-table-column>
<el-table-column prop="industry" label="所属分类" align="left">
</el-table-column>
<el-table-column prop="city" label="所在城市" align="left">
<el-table-column prop="status" label="状态" align="left">
</el-table-column>
<el-table-column prop="relationInstitutionNum" label="关联机构" align="left">
</el-table-column>
<el-table-column prop="establishDate" label="成立时间" align="left">
<el-table-column prop="employeeNum" label="成员数量" align="left">
</el-table-column>
<el-table-column prop="belongUserId" label="主管人员" align="left">
</el-table-column>
<el-table-column prop="description" label="描述" align="left">
</el-table-column>
<el-table-column prop="lastModifyTime" label="更新时间" align="left">
</el-table-column>
<el-table-column prop="flowState" label="状态" width="100">
<template slot-scope="scope" v-if="!scope.row.top">
<el-tag v-if="scope.row.flowState==1"></el-tag>
@ -106,8 +110,10 @@
<el-tag type="warning" v-else></el-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<el-table-column label="操作" fixed="right" width="200">
<template slot-scope="scope">
<OrganizeSelect ref="OrganizeSelect" :auth="true" :isOnlyOrg="true"
:businessLineId="scope.row.id" @change="organizeSubmit" />
<el-button type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1"
@click="updateHandle(scope.row)" v-has="'btn_edit'">编辑
</el-button>
@ -165,11 +171,13 @@ import columnList from './columnList'
import { thousandsFormat } from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
// import JnpfOrganizeSelect from '@/components/Jnpf/OrganizeSelect'
import OrganizeSelect from '@/views/scm/publicPage/organizeSelectIndex'
export default {
components: {
FlowBox,
ExportBox, ToFormDetail, SuperQuery
ExportBox, ToFormDetail, SuperQuery, OrganizeSelect
},
data() {
return {
@ -251,6 +259,30 @@ export default {
})
},
methods: {
organizeSubmit(val, val2, val3) {
let enterpriseId = ''
if (!val || !val.length) return enterpriseId = ''
enterpriseId = val[val.length - 1]
let data = {
enterpriseId: '',
businessLineId: ''
}
data.enterpriseId = enterpriseId
data.businessLineId = val3
request({
url: `/api/scm/BusinessEnterpriseRelational`,
method: 'post',
data: data
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
},
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {

@ -1,368 +1,383 @@
<template>
<div :style="{margin: '0 auto',width:'100%'}">
<template>
<div :style="{margin: '0 auto',width:'100%'}">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right" :disabled="setting.readonly" >
<template v-if="!loading && formOperates">
<!-- 具体表单 -->
<el-col :span="8" v-if="judgeShow('jnpf_base_user_jnpf_realName')" >
<jnpf-form-tip-item
label="姓名" v-if="judgeShow('jnpf_base_user_jnpf_realName')" prop="jnpf_base_user_jnpf_realName" >
<JnpfInput v-model="dataForm.jnpf_base_user_jnpf_realName" @change="changeData('jnpf_base_user_jnpf_realName',-1)"
placeholder="请输入" :disabled="judgeWrite('jnpf_base_user_jnpf_realName')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('jnpf_base_user_jnpf_enabledMark')" >
<jnpf-form-tip-item
label="帐号状态" v-if="judgeShow('jnpf_base_user_jnpf_enabledMark')" prop="jnpf_base_user_jnpf_enabledMark" >
<JnpfSelect v-model="dataForm.jnpf_base_user_jnpf_enabledMark" @change="changeData('jnpf_base_user_jnpf_enabledMark',-1)"
placeholder="请选择" :disabled="judgeWrite('jnpf_base_user_jnpf_enabledMark')" clearable :style='{"width":"100%"}' :options="jnpf_base_user_jnpf_enabledMarkOptions" :props="jnpf_base_user_jnpf_enabledMarkProps" >
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('jnpf_base_user_jnpf_mobilePhone')" >
<jnpf-form-tip-item
label="手机" v-if="judgeShow('jnpf_base_user_jnpf_mobilePhone')" prop="jnpf_base_user_jnpf_mobilePhone" >
<JnpfInput v-model="dataForm.jnpf_base_user_jnpf_mobilePhone" @change="changeData('jnpf_base_user_jnpf_mobilePhone',-1)"
placeholder="请输入" :disabled="judgeWrite('jnpf_base_user_jnpf_mobilePhone')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
label-position="right" :disabled="setting.readonly">
<template v-if="!loading && formOperates">
<!-- 具体表单 -->
<el-col :span="8" v-if="judgeShow('jnpf_base_user_jnpf_realName')">
<jnpf-form-tip-item label="姓名" v-if="judgeShow('jnpf_base_user_jnpf_realName')"
prop="jnpf_base_user_jnpf_realName">
<JnpfInput v-model="dataForm.jnpf_base_user_jnpf_realName"
@change="changeData('jnpf_base_user_jnpf_realName',-1)" placeholder="请输入"
:disabled="judgeWrite('jnpf_base_user_jnpf_realName')" clearable
:style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('jnpf_base_user_jnpf_enabledMark')">
<jnpf-form-tip-item label="帐号状态" v-if="judgeShow('jnpf_base_user_jnpf_enabledMark')"
prop="jnpf_base_user_jnpf_enabledMark">
<JnpfSelect v-model="dataForm.jnpf_base_user_jnpf_enabledMark"
@change="changeData('jnpf_base_user_jnpf_enabledMark',-1)" placeholder="请选择"
:disabled="judgeWrite('jnpf_base_user_jnpf_enabledMark')" clearable
:style='{"width":"100%"}' :options="jnpf_base_user_jnpf_enabledMarkOptions"
:props="jnpf_base_user_jnpf_enabledMarkProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('jnpf_base_user_jnpf_mobilePhone')">
<jnpf-form-tip-item label="手机" v-if="judgeShow('jnpf_base_user_jnpf_mobilePhone')"
prop="jnpf_base_user_jnpf_mobilePhone">
<JnpfInput v-model="dataForm.jnpf_base_user_jnpf_mobilePhone"
@change="changeData('jnpf_base_user_jnpf_mobilePhone',-1)" placeholder="请输入"
:disabled="judgeWrite('jnpf_base_user_jnpf_mobilePhone')" clearable
:style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('jnpf_base_user_jnpf_lastLogTime')" >
<jnpf-form-tip-item
label="最后登录" v-if="judgeShow('jnpf_base_user_jnpf_lastLogTime')" prop="jnpf_base_user_jnpf_lastLogTime" >
<JnpfDatePicker v-model="dataForm.jnpf_base_user_jnpf_lastLogTime" @change="changeData('jnpf_base_user_jnpf_lastLogTime',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择" :disabled="judgeWrite('jnpf_base_user_jnpf_lastLogTime')" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" >
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('jnpf_base_user_jnpf_lastLogTime')">
<jnpf-form-tip-item label="最后登录" v-if="judgeShow('jnpf_base_user_jnpf_lastLogTime')"
prop="jnpf_base_user_jnpf_lastLogTime">
<JnpfDatePicker v-model="dataForm.jnpf_base_user_jnpf_lastLogTime"
@change="changeData('jnpf_base_user_jnpf_lastLogTime',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')"
placeholder="请选择" :disabled="judgeWrite('jnpf_base_user_jnpf_lastLogTime')"
clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('jnpf_base_user_jnpf_creatorTime')" >
<jnpf-form-tip-item
label="创建时间" v-if="judgeShow('jnpf_base_user_jnpf_creatorTime')" prop="jnpf_base_user_jnpf_creatorTime" >
<JnpfDatePicker v-model="dataForm.jnpf_base_user_jnpf_creatorTime" @change="changeData('jnpf_base_user_jnpf_creatorTime',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择" :disabled="judgeWrite('jnpf_base_user_jnpf_creatorTime')" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" >
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('jnpf_base_user_jnpf_creatorTime')">
<jnpf-form-tip-item label="创建时间" v-if="judgeShow('jnpf_base_user_jnpf_creatorTime')"
prop="jnpf_base_user_jnpf_creatorTime">
<JnpfDatePicker v-model="dataForm.jnpf_base_user_jnpf_creatorTime"
@change="changeData('jnpf_base_user_jnpf_creatorTime',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')"
placeholder="请选择" :disabled="judgeWrite('jnpf_base_user_jnpf_creatorTime')"
clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('jnpf_base_user_jnpf_lastModifyTime')" >
<jnpf-form-tip-item
label="修改时间" v-if="judgeShow('jnpf_base_user_jnpf_lastModifyTime')" prop="jnpf_base_user_jnpf_lastModifyTime" >
<JnpfDatePicker v-model="dataForm.jnpf_base_user_jnpf_lastModifyTime" @change="changeData('jnpf_base_user_jnpf_lastModifyTime',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择" :disabled="judgeWrite('jnpf_base_user_jnpf_lastModifyTime')" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" >
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('jnpf_jg_business_line_jnpf_name')" >
<jnpf-form-tip-item
label="业务线名称" v-if="judgeShow('jnpf_jg_business_line_jnpf_name')" prop="jnpf_jg_business_line_jnpf_name" >
<JnpfInput v-model="dataForm.jnpf_jg_business_line_jnpf_name" @change="changeData('jnpf_jg_business_line_jnpf_name',-1)"
placeholder="请输入" :disabled="judgeWrite('jnpf_jg_business_line_jnpf_name')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false"/>
</el-form>
<el-col :span="8" v-if="judgeShow('jnpf_base_user_jnpf_lastModifyTime')">
<jnpf-form-tip-item label="修改时间" v-if="judgeShow('jnpf_base_user_jnpf_lastModifyTime')"
prop="jnpf_base_user_jnpf_lastModifyTime">
<JnpfDatePicker v-model="dataForm.jnpf_base_user_jnpf_lastModifyTime"
@change="changeData('jnpf_base_user_jnpf_lastModifyTime',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')"
placeholder="请选择" :disabled="judgeWrite('jnpf_base_user_jnpf_lastModifyTime')"
clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('jnpf_jg_business_line_jnpf_name')">
<jnpf-form-tip-item label="业务线名称" v-if="judgeShow('jnpf_jg_business_line_jnpf_name')"
prop="jnpf_jg_business_line_jnpf_name">
<JnpfInput v-model="dataForm.jnpf_jg_business_line_jnpf_name"
@change="changeData('jnpf_jg_business_line_jnpf_name',-1)" placeholder="请输入"
:disabled="judgeWrite('jnpf_jg_business_line_jnpf_name')" clearable
:style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false" />
</el-form>
</el-row>
<UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
</div>
</template>
</div>
</template>
<script>
import request from '@/utils/request'
import {mapGetters} from "vuex";
import {getFormById} from '@/api/workFlow/FormDesign'
import comMixin from '@/views/workFlow/workFlowForm/mixin';
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 {
mixins: [comMixin],
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:{
import request from '@/utils/request'
import { mapGetters } from "vuex";
import { getFormById } from '@/api/workFlow/FormDesign'
import comMixin from '@/views/workFlow/workFlowForm/mixin';
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 {
mixins: [comMixin],
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: {
jg_business_line:
{
name: '',
},
Vmodel:"",
currVmodel:"",
dataForm: {
jg_business_line:
{
name:'',
},
base_user:
{
realName:'',
enabledMark:'',
mobilePhone:'',
lastLogTime:'',
creatorTime:'',
lastModifyTime:'',
},
jnpf_base_user_jnpf_realName : '',
jnpf_base_user_jnpf_enabledMark : "",
jnpf_base_user_jnpf_mobilePhone : '',
jnpf_base_user_jnpf_lastLogTime : '',
jnpf_base_user_jnpf_creatorTime : '',
jnpf_base_user_jnpf_lastModifyTime : '',
jnpf_jg_business_line_jnpf_name : '',
version: 0,
},
tableRequiredData: {},
dataRule:
{
},
jnpf_base_user_jnpf_enabledMarkOptions:[{"fullName":"选项一","id":"1"},{"fullName":"选项二","id":"2"}],
jnpf_base_user_jnpf_enabledMarkProps:{"label":"fullName","value":"id" },
childIndex:-1,
isEdit:false,
interfaceRes: {
jnpf_base_user_jnpf_realName:[] ,
jnpf_base_user_jnpf_enabledMark:[] ,
jnpf_base_user_jnpf_mobilePhone:[] ,
jnpf_base_user_jnpf_lastLogTime:[] ,
jnpf_base_user_jnpf_creatorTime:[] ,
jnpf_base_user_jnpf_lastModifyTime:[] ,
jnpf_jg_business_line_jnpf_name:[] ,
},
}
base_user:
{
realName: '',
enabledMark: '',
mobilePhone: '',
lastLogTime: '',
creatorTime: '',
lastModifyTime: '',
},
computed: {
formOperates() {
return this.setting.formOperates
jnpf_base_user_jnpf_realName: '',
jnpf_base_user_jnpf_enabledMark: "",
jnpf_base_user_jnpf_mobilePhone: '',
jnpf_base_user_jnpf_lastLogTime: '',
jnpf_base_user_jnpf_creatorTime: '',
jnpf_base_user_jnpf_lastModifyTime: '',
jnpf_jg_business_line_jnpf_name: '',
version: 0,
},
tableRequiredData: {},
dataRule:
{
},
jnpf_base_user_jnpf_enabledMarkOptions: [{ "fullName": "选项一", "id": "1" }, { "fullName": "选项二", "id": "2" }],
jnpf_base_user_jnpf_enabledMarkProps: { "label": "fullName", "value": "id" },
childIndex: -1,
isEdit: false,
interfaceRes: {
jnpf_base_user_jnpf_realName: [],
jnpf_base_user_jnpf_enabledMark: [],
jnpf_base_user_jnpf_mobilePhone: [],
jnpf_base_user_jnpf_lastLogTime: [],
jnpf_base_user_jnpf_creatorTime: [],
jnpf_base_user_jnpf_lastModifyTime: [],
jnpf_jg_business_line_jnpf_name: [],
},
}
},
computed: {
formOperates() {
return this.setting.formOperates
}
},
watch: {},
created() {
this.getFormById()
if (this.dataForm.id == null || this.dataForm.id == '' && this.dataForm.id == undefined || this.dataForm.id == 0) {
this.initDefaultData()
}
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() { },
methods: {
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)
}
},
watch: {},
created() {
this.getFormById()
if(this.dataForm.id == null || this.dataForm.id == '' && this.dataForm.id == undefined || this.dataForm.id == 0) {
this.initDefaultData()
}
}
}
},
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
}
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() {},
methods: {
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
}
}
} else {
this.dataForm[data] = defaultValue
}
}
},
dataAll() {
},
selfGetInfo(dataForm) {
this.dataInfo(dataForm)
},
beforeSubmit() {
const _data = this.dataList()
return _data
},
selfInit() {
this.dataAll()
},
getFormById() {
getFormById("520890418406097989").then(res => {
this.dataForm.flowId = res.data && res.data.flowId
// this.encode = res.data&&res.data.encode
})
},
exist() {
let isOk = true
for (let key in this.tableRequiredData) {
if (this.dataForm[key] && Array.isArray(this.dataForm[key])) {
for (let i = 0; i < this.dataForm[key].length; i++) {
let item = this.dataForm[key][i]
inner: for (let id in item) {
let arr = this.tableRequiredData[key].filter(o => o.id === id) || []
if (!arr.length) continue inner
if (arr[0].required) {
let msg = `${arr[0].name}不能为空`
let boo = true
if (arr[0].dataType === 'array') {
boo = !this.jnpf.isEmptyArray(item[id])
} else {
boo = !this.jnpf.isEmpty(item[id])
}
},
dataAll(){
},
selfGetInfo(dataForm) {
this.dataInfo(dataForm)
},
beforeSubmit(){
const _data =this.dataList()
return _data
},
selfInit() {
this.dataAll()
},
getFormById() {
getFormById("520890418406097989").then(res => {
this.dataForm.flowId = res.data&&res.data.flowId
// this.encode = res.data&&res.data.encode
})
},
exist() {
let isOk = true
for (let key in this.tableRequiredData) {
if (this.dataForm[key] && Array.isArray(this.dataForm[key])) {
for (let i = 0; i < this.dataForm[key].length; i++) {
let item = this.dataForm[key][i]
inner: for (let id in item) {
let arr = this.tableRequiredData[key].filter(o => o.id === id) || []
if (!arr.length) continue inner
if (arr[0].required) {
let msg = `${arr[0].name}不能为空`
let boo = true
if (arr[0].dataType === 'array') {
boo = !this.jnpf.isEmptyArray(item[id])
} else {
boo = !this.jnpf.isEmpty(item[id])
}
if (!boo) {
this.$message({
message: msg,
type: 'error',
duration: 1000
})
isOk = false
break
}
}
}
}
}
if (!boo) {
this.$message({
message: msg,
type: 'error',
duration: 1000
})
isOk = false
break
}
return isOk
},
clearData(){
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
//
initDefaultData() {
}
}
}
}
}
return isOk
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
//
initDefaultData() {
},
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
},
},
}
},
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>

@ -2,7 +2,7 @@
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-left">
<div class="JNPF-common-title">
<h2>左侧标题</h2>
<h2>{{ title }}</h2>
<el-dropdown>
<el-link icon="icon-ym icon-ym-mpMenu" :underline="false" />
<el-dropdown-menu slot="dropdown">
@ -12,7 +12,7 @@
</el-dropdown>
</div>
<div class="JNPF-common-tree-search-box">
<el-input placeholder="输入关键字" v-model="keyword" suffix-icon="el-icon-search" clearable />
<el-input placeholder="输入业务线名称" v-model="keyword" suffix-icon="el-icon-search" clearable />
</div>
<el-tree :data="treeData" class="JNPF-common-el-tree" highlight-current ref="treeBox"
:expand-on-click-node="false" @node-click="handleNodeClick" node-key="id" :props="treeProps"
@ -167,6 +167,7 @@ export default {
data() {
return {
title: '',
keyword: '',
expandsTree: true,
refreshTree: true,
@ -400,9 +401,11 @@ export default {
this.initData()
},
getTreeView() {
getDataInterfaceRes('519521191191380165').then(res => {
let data = res.data
this.treeData = data
request({
url: `/api/scm/BusinessLine/Tree`,
method: 'get'
}).then(res => {
this.treeData = res.data
this.initSearchDataAndListData()
})
},
@ -416,11 +419,12 @@ export default {
return fullPath
},
handleNodeClick(data, node) {
this.title = data.name
this.treeActiveId = data.id
for (let key in this.query) {
this.query[key] = undefined
}
this.query.jnpf_jg_business_line_jnpf_name = data.id
this.query.businessLineId = data.id
this.listQuery = {
currentPage: 1,
pageSize: 20,
@ -452,6 +456,7 @@ export default {
method: 'post',
data: _query
}).then(res => {
debugger
var _list = res.data.list;
this.list = _list.map(o => ({
...o,

@ -198,7 +198,7 @@
</el-col>
<el-col :span="24" v-if="judgeShow('-${html.relationField}')">
<jnpf-form-tip-item label-width="0">
<el-table :data="dataForm.businesscontactList" size='mini'>
<el-table :data="dataForm.businessContactList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="类型" v-if="judgeShow('businesscontact-contactType')"
prop="contactType">
@ -320,7 +320,7 @@
</el-col>
<el-col :span="24" v-if="judgeShow('businesscontact-${html.relationField}')">
<jnpf-form-tip-item label-width="0">
<el-table :data="dataForm.businessaddressList" size='mini'>
<el-table :data="dataForm.businessAddressList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="类型" v-if="judgeShow('businessaddress-addressType')"
prop="addressType">
@ -434,7 +434,7 @@
</el-col>
<el-col :span="24" v-if="judgeShow('businessaddress-${html.relationField}')">
<jnpf-form-tip-item label-width="0">
<el-table :data="dataForm.businesscargoList" size='mini'>
<el-table :data="dataForm.businessCargoList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="货区名称" v-if="judgeShow('businesscargo-cargoName')"
prop="cargoName">
@ -597,15 +597,15 @@ export default {
currTableConf: {},
dataValueAll: {},
addTableConf: {
businesscontactList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
businessaddressList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
businesscargoList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
businessContactList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
businessAddressList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
businessCargoList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
},
//
ableAll: {
},
tableRows: {
businesscontactList: {
businessContactList: {
contactTypeOptions: [],
name: '',
nameOptions: [],
@ -621,7 +621,7 @@ export default {
lastModifyTimeOptions: [],
enabledmark: undefined
},
businessaddressList: {
businessAddressList: {
addressTypeOptions: [],
country: '',
countryOptions: [],
@ -635,7 +635,7 @@ export default {
lastModifyTimeOptions: [],
enabledmark: undefined
},
businesscargoList: {
businessCargoList: {
cargoName: '',
cargoNameOptions: [],
cargoTypeOptions: [],
@ -673,9 +673,9 @@ export default {
allowUnloadingStart: undefined,
unloadingDuration: undefined,
unloadingEfficiency: undefined,
businesscontactList: [],
businessaddressList: [],
businesscargoList: [],
businessContactList: [],
businessAddressList: [],
businessCargoList: [],
version: 0,
diffFlag: undefined,
},
@ -904,8 +904,8 @@ export default {
},
businesscontactExist() {
let isOk = true;
for (let i = 0; i < this.dataForm.businesscontactList.length; i++) {
const e = this.dataForm.businesscontactList[i];
for (let i = 0; i < this.dataForm.businessContactList.length; i++) {
const e = this.dataForm.businessContactList[i];
if (!e.contactType) {
this.$message({
message: '类型不能为空',
@ -947,8 +947,8 @@ export default {
},
businessaddressExist() {
let isOk = true;
for (let i = 0; i < this.dataForm.businessaddressList.length; i++) {
const e = this.dataForm.businessaddressList[i];
for (let i = 0; i < this.dataForm.businessAddressList.length; i++) {
const e = this.dataForm.businessAddressList[i];
if (!e.addressType) {
this.$message({
message: '类型不能为空',
@ -990,8 +990,8 @@ export default {
},
businesscargoExist() {
let isOk = true;
for (let i = 0; i < this.dataForm.businesscargoList.length; i++) {
const e = this.dataForm.businesscargoList[i];
for (let i = 0; i < this.dataForm.businessCargoList.length; i++) {
const e = this.dataForm.businessCargoList[i];
if (!e.cargoName) {
this.$message({
message: '货区名称不能为空',
@ -1059,7 +1059,7 @@ export default {
let template = {
paramList: templateJsonList
}
getDataInterfaceRes('519521191191380165', template).then(res => {
getDataInterfaceRes('517979330417001669', template).then(res => {
let data = res.data
this.parentIdOptions = data
this.changeDataFormData(1, 'parentId', 'parentId', index, '')
@ -1117,14 +1117,14 @@ export default {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.businesscontactList.splice(index, 1);
this.dataForm.businessContactList.splice(index, 1);
}).catch(() => {
});
},
getbusinesscontactList(value) {
let item = { ...this.tableRows.businesscontactList, ...value }
this.dataForm.businesscontactList.push(item)
this.childIndex = this.dataForm.businesscontactList.length - 1
let item = { ...this.tableRows.businessContactList, ...value }
this.dataForm.businessContactList.push(item)
this.childIndex = this.dataForm.businessContactList.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
@ -1145,14 +1145,14 @@ export default {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.businessaddressList.splice(index, 1);
this.dataForm.businessAddressList.splice(index, 1);
}).catch(() => {
});
},
getbusinessaddressList(value) {
let item = { ...this.tableRows.businessaddressList, ...value }
this.dataForm.businessaddressList.push(item)
this.childIndex = this.dataForm.businessaddressList.length - 1
let item = { ...this.tableRows.businessAddressList, ...value }
this.dataForm.businessAddressList.push(item)
this.childIndex = this.dataForm.businessAddressList.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
@ -1174,14 +1174,14 @@ export default {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.businesscargoList.splice(index, 1);
this.dataForm.businessCargoList.splice(index, 1);
}).catch(() => {
});
},
getbusinesscargoList(value) {
let item = { ...this.tableRows.businesscargoList, ...value }
this.dataForm.businesscargoList.push(item)
this.childIndex = this.dataForm.businesscargoList.length - 1
let item = { ...this.tableRows.businessCargoList, ...value }
this.dataForm.businessCargoList.push(item)
this.childIndex = this.dataForm.businessCargoList.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
@ -1274,13 +1274,13 @@ export default {
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
for (let i = 0; i < _dataAll.businesscontactList.length; i++) {
for (let i = 0; i < _dataAll.businessContactList.length; i++) {
this.childIndex = i
}
for (let i = 0; i < _dataAll.businessaddressList.length; i++) {
for (let i = 0; i < _dataAll.businessAddressList.length; i++) {
this.childIndex = i
}
for (let i = 0; i < _dataAll.businesscargoList.length; i++) {
for (let i = 0; i < _dataAll.businessCargoList.length; i++) {
this.childIndex = i
}
this.childIndex = -1

@ -1,10 +1,3 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
@ -88,13 +81,15 @@
</el-table-column>
<el-table-column prop="type" label="类型" align="left">
</el-table-column>
<el-table-column prop="city" label="所在城市" align="left">
<el-table-column prop="status" label="状态" align="left">
</el-table-column>
<el-table-column prop="employeeNum" label="成员数量" align="left">
</el-table-column>
<el-table-column prop="establishDate" label="成立时间" align="left">
<el-table-column prop="belongUserId" label="主管人员" align="left">
</el-table-column>
<el-table-column prop="description" label="描述" align="left">
</el-table-column>
<el-table-column prop="belongUserId" label="归属人员" align="left">
<el-table-column prop="lastModifyTime" label="更新时间" align="left">
</el-table-column>
<el-table-column prop="flowState" label="状态" width="100">
<template slot-scope="scope" v-if="!scope.row.top">
@ -107,7 +102,7 @@
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<template slot-scope="scope" v-if="scope.row.diffFlag != '1'">
<el-button type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1"
@click="updateHandle(scope.row)" v-has="'btn_edit'">编辑
</el-button>

@ -0,0 +1,452 @@
<template>
<span class="popupSelect-container">
<span @click.stop="openDialog" style="cursor: pointer; color: blue;">关联机构</span>
<!-- <div class="el-select" @click.stop="openDialog">
<div class="el-select__tags" v-if="multiple" ref="tags"
:style="{ 'max-width': inputWidth - 32 + 'px', width: '100%',cursor:'pointer' }">
<span v-if="collapseTags && tagsList.length">
<el-tag :closable="!selectDisabled" :size="collapseTagSize" type="info"
@close="deleteTag($event, 0)" disable-transitions>
<span class="el-select__tags-text">{{ tagsList[0] }}</span>
</el-tag>
<el-tag v-if="tagsList.length > 1" :closable="false" type="info" disable-transitions>
<span class="el-select__tags-text">+ {{ tagsList.length - 1 }}</span>
</el-tag>
</span>
<transition-group @after-leave="resetInputHeight" v-if="!collapseTags">
<el-tag v-for="(item,i) in tagsList" :key="item" :size="collapseTagSize"
:closable="!selectDisabled" type="info" @close="deleteTag($event, i)"
disable-transitions>
<span class="el-select__tags-text">{{ item }}</span>
</el-tag>
</transition-group>
</div>
<el-input ref="reference" v-model="innerValue" type="text" :placeholder="currentPlaceholder"
:disabled="selectDisabled" readonly :validate-event="false"
:tabindex="(multiple) ? '-1' : null" @mouseenter.native="inputHovering = true"
@mouseleave.native="inputHovering = false">
<template slot="suffix">
<i v-show="!showClose"
:class="['el-select__caret', 'el-input__icon', 'el-icon-arrow-up']"></i>
<i v-if="showClose" class="el-select__caret el-input__icon el-icon-circle-close"
@click="handleClearClick"></i>
</template>
</el-input>
</div> -->
<el-dialog title="选择组织" :close-on-click-modal="false" :visible.sync="visible"
class="JNPF-dialog JNPF-dialog_center transfer-dialog" lock-scroll append-to-body
width="800px" :modal-append-to-body="false" @close="onClose">
<div class="transfer__body">
<div class="transfer-pane">
<div class="transfer-pane__tools">
<el-input placeholder="请输入关键词查询" v-model="keyword" @keyup.enter.native="search"
clearable class="search-input">
<el-button slot="append" icon="el-icon-search" @click="search"></el-button>
</el-input>
</div>
<div class="transfer-pane__body">
<el-tree :data="treeData" :props="props" check-on-click-node
:expand-on-click-node="false" default-expand-all @node-click="handleNodeClick"
class="JNPF-common-el-tree" node-key="id" v-loading="loading" ref="tree"
:filter-node-method="filterNode">
<span class="custom-tree-node" slot-scope="{ node, data }" :title="node.label">
<i :class="data.icon"></i>
<span class="text">{{node.label}}</span>
</span>
</el-tree>
</div>
</div>
<div class="transfer-pane">
<div class="transfer-pane__tools">
<span>已选</span>
<el-button @click="removeAll" type="text" class="removeAllBtn">清空列表</el-button>
</div>
<div class="transfer-pane__body shadow right-pane">
<template>
<div v-for="(item, index) in selectedData" :key="index" class="selected-item">
<span :title="item">{{item}}</span>
<i class="el-icon-delete" @click="removeData(index)"></i>
</div>
</template>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="setDefault(),visible=false">{{$t('common.cancelButton')}}</el-button>
<el-button type="primary" @click="confirm">{{$t('common.confirmButton')}}</el-button>
</span>
</el-dialog>
</span>
</template>
<script>
import { addResizeListener, removeResizeListener } from 'element-ui/src/utils/resize-event';
import { getDepartmentSelectorByAuth } from "@/api/permission/department";
import { getOrganizeSelectorByAuth, getOrgByOrganizeCondition } from '@/api/permission/organize'
import emitter from 'element-ui/src/mixins/emitter'
let { methods: { dispatch } } = emitter
export default {
name: 'JnpfOrganizeSelect',
inject: {
elForm: {
default: ''
},
elFormItem: {
default: ''
}
},
props: {
value: {
default: () => []
},
placeholder: {
type: String,
default: '请选择'
},
disabled: {
type: Boolean,
default: false
},
multiple: {
type: Boolean,
default: false
},
collapseTags: {
type: Boolean,
default: false
},
clearable: {
type: Boolean,
default: false
},
auth: {
type: Boolean,
default: false
},
isOnlyOrg: {
type: Boolean,
default: false
},
size: String,
currOrgId: {
default: '0'
},
parentId: {
default: ''
},
selectType: {
type: String,
default: 'all'
},
ableIds: {
type: Array,
default: () => []
},
businessLineId: {
default: ''
}
},
data() {
return {
treeData: [],
allList: [],
keyword: '',
innerValue: '',
visible: false,
loading: false,
props: {
children: 'children',
label: 'fullName',
isLeaf: 'isLeaf'
},
selectedData: [],
selectedIds: [],
tagsList: [],
inputHovering: false,
inputWidth: 0,
initialInputHeight: 0,
businessLineId: '',
}
},
computed: {
showClose() {
let hasValue = Array.isArray(this.value) && this.value.length > 0
let criteria = this.clearable &&
!this.selectDisabled &&
this.inputHovering &&
hasValue;
return criteria;
},
currentPlaceholder() {
if (this.multiple && Array.isArray(this.value) && this.value.length) {
return ''
} else {
return this.placeholder
}
},
selectDisabled() {
return this.disabled || (this.elForm || {}).disabled;
},
_elFormItemSize() {
return (this.elFormItem || {}).elFormItemSize;
},
selectSize() {
return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
},
collapseTagSize() {
return ['small', 'mini'].indexOf(this.selectSize) > -1
? 'mini'
: 'small';
},
},
created() {
this.getData()
this.businessLineId = businessLineId
},
mounted() {
addResizeListener(this.$el, this.handleResize);
const reference = this.$refs.reference;
if (reference && reference.$el) {
const sizeMap = {
medium: 36,
small: 32,
mini: 28
};
const input = reference.$el.querySelector('input');
this.initialInputHeight = input.getBoundingClientRect().height || sizeMap[this.selectSize];
}
if (this.multiple) {
this.resetInputHeight();
}
this.$nextTick(() => {
if (reference && reference.$el) {
this.inputWidth = reference.$el.getBoundingClientRect().width;
}
});
this.setDefault()
},
beforeDestroy() {
if (this.$el && this.handleResize) removeResizeListener(this.$el, this.handleResize);
},
watch: {
value(val) {
this.setDefault()
},
selectDisabled() {
this.$nextTick(() => {
this.resetInputHeight();
});
},
allList: {
handler: function (val) {
this.setDefault()
},
deep: true
}
},
methods: {
async getData() {
const treeData = await this.$store.dispatch('generator/getDepTree')
const topItem = {
fullName: "顶级节点",
hasChildren: true,
id: "-1",
icon: "icon-ym icon-ym-tree-organization3",
organize: '顶级节点',
organizeIds: ['-1']
}
this.allList = [...this.$store.getters.departmentList, topItem]
if (this.selectType === 'all') {
if (this.auth) {
if (this.isOnlyOrg && this.parentId === '-1') {
this.treeData = [topItem]
return
}
const method = this.isOnlyOrg ? getOrganizeSelectorByAuth : getDepartmentSelectorByAuth
method(this.currOrgId).then(res => {
this.treeData = res.data.list
})
} else {
this.treeData = treeData
}
} else {
if (!this.ableIds.length) {
this.treeData = [];
return
}
const departIds = this.ableIds ? this.ableIds.map(o => o[o.length - 1]) : [];
const query = { departIds };
getOrgByOrganizeCondition(query).then(res => {
this.treeData = res.data.list;
})
}
},
onClose() { },
clear() {
if (this.selectDisabled) return
this.innerValue = ''
this.selectedData = []
this.selectedIds = []
this.tagsList = []
this.$emit('input', [])
this.$emit('change', [], [])
dispatch.call(this, 'ElFormItem', 'el.form.change', [])
},
openDialog() {
if (this.selectDisabled) return
this.keyword = ''
this.treeData = []
this.getData()
this.setDefault()
this.visible = true
},
search() {
this.$refs.tree && this.$refs.tree.filter(this.keyword)
},
filterNode(value, data) {
if (!value) return true;
return data[this.props.label].indexOf(value) !== -1;
},
getNodePath(node) {
let fullPath = []
const loop = (node) => {
if (node.level) fullPath.unshift(node.data)
if (node.parent) loop(node.parent)
}
loop(node)
return fullPath
},
handleNodeClick(data) {
if (data.disabled) return
let currId = data.organizeIds
let currData = data.organize
if (this.multiple) {
const boo = this.selectedIds.some(o => o.join('/') === currId.join('/'))
if (boo) return
this.selectedIds.push(currId)
this.selectedData.push(currData)
} else {
this.selectedIds = [currId]
this.selectedData = [currData]
}
},
removeAll() {
this.selectedData = []
this.selectedIds = []
},
removeData(index) {
this.selectedData.splice(index, 1)
this.selectedIds.splice(index, 1)
},
confirm() {
let selectedData = []
for (let i = 0; i < this.selectedIds.length; i++) {
let item = []
let selectedNames = this.selectedData[i].split('/')
for (let j = 0; j < this.selectedIds[i].length; j++) {
item.push({
id: this.selectedIds[i][j],
fullName: selectedNames[j],
})
}
selectedData.push(item)
}
if (this.multiple) {
this.innerValue = ''
this.tagsList = JSON.parse(JSON.stringify(this.selectedData))
this.$emit('input', this.selectedIds)
this.$emit('change', this.selectedIds, selectedData, this.businessLineId)
dispatch.call(this, 'ElFormItem', 'el.form.change', this.selectedIds)
} else {
this.innerValue = this.selectedData.join(',')
this.$emit('input', this.selectedIds[0] || [])
this.$emit('change', this.selectedIds[0] || [], selectedData[0] || [], this.businessLineId)
dispatch.call(this, 'ElFormItem', 'el.form.change', this.selectedIds[0] || [])
}
this.visible = false
},
setDefault() {
if (!this.value || !this.value.length) {
this.innerValue = ''
this.selectedIds = []
this.selectedData = []
this.tagsList = []
this.$nextTick(() => {
this.resetInputHeight();
})
return
}
let selectedIds = this.multiple ? this.value : [this.value]
this.selectedIds = JSON.parse(JSON.stringify(selectedIds))
let textList = []
for (let i = 0; i < selectedIds.length; i++) {
const item = selectedIds[i];
let textItem = JSON.parse(JSON.stringify(item))
for (let j = 0; j < item.length; j++) {
inner: for (let ii = 0; ii < this.allList.length; ii++) {
if (item[j] === this.allList[ii].id) {
textItem[j] = this.allList[ii].fullName
break inner
}
}
}
textList.push(textItem)
}
this.selectedData = textList.map(o => o.join('/'))
if (this.multiple) {
this.innerValue = ''
this.tagsList = JSON.parse(JSON.stringify(this.selectedData))
this.$nextTick(() => {
this.resetInputHeight();
})
} else {
this.innerValue = this.selectedData.join(',')
}
},
deleteTag(event, index) {
this.selectedData.splice(index, 1)
this.selectedIds.splice(index, 1)
this.confirm()
event.stopPropagation();
},
handleClearClick(event) {
this.selectedData = []
this.selectedIds = []
this.confirm()
event.stopPropagation();
},
resetInputWidth() {
this.inputWidth = this.$refs.reference.$el.getBoundingClientRect().width;
},
handleResize() {
this.resetInputWidth();
if (this.multiple) this.resetInputHeight();
},
resetInputHeight() {
if (this.collapseTags) return;
this.$nextTick(() => {
if (!this.$refs.reference) return;
let inputChildNodes = this.$refs.reference.$el.childNodes;
let input = [].filter.call(inputChildNodes, item => item.tagName === 'INPUT')[0];
const tags = this.$refs.tags;
const tagsHeight = tags ? Math.round(tags.getBoundingClientRect().height) : 0;
const sizeInMap = this.initialInputHeight || 40;
input.style.height = this.selectedData.length === 0
? sizeInMap + 'px'
: Math.max(
tags ? (tagsHeight + (tagsHeight > sizeInMap ? 6 : 0)) : 0,
sizeInMap
) + 'px';
});
},
resetInputWidth() {
this.inputWidth = this.$refs.reference.$el.getBoundingClientRect().width;
},
handleResize() {
this.resetInputWidth();
if (this.multiple) this.resetInputHeight();
}
}
}
</script>
Loading…
Cancel
Save