jg-waiwang-pro
胡川虎 9 months ago
parent 3637f230e5
commit d6d31c310a

@ -120,12 +120,12 @@
<artifactId>jnpf-visualdev-integrate-controller</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<!--<dependency>
<groupId>com.jnpf</groupId>
<artifactId>jnpf-scm</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
</dependency>-->
<!--打包WAR包删除注释-->
<!--<dependency>
<groupId>org.springframework.boot</groupId>

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

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

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

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

@ -0,0 +1,35 @@
package jnpf.service;
import jnpf.model.subjectsettlementrules.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* SubjectSettlementRules
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-01-29
*/
public interface SubjectSettlementRulesService extends IService<SubjectSettlementRulesEntity> {
List<SubjectSettlementRulesEntity> getList(SubjectSettlementRulesPagination subjectSettlementRulesPagination);
List<SubjectSettlementRulesEntity> getTypeList(SubjectSettlementRulesPagination subjectSettlementRulesPagination,String dataType);
SubjectSettlementRulesEntity getInfo(String id);
void delete(SubjectSettlementRulesEntity entity);
void create(SubjectSettlementRulesEntity entity);
boolean update(String id, SubjectSettlementRulesEntity entity);
//子表方法
//副表数据方法
String checkForm(SubjectSettlementRulesForm form,int i);
void saveOrUpdate(SubjectSettlementRulesForm subjectSettlementRulesForm,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-27
* 2024-01-29
*/
public interface SubjectfollowmanagementService extends IService<SubjectfollowmanagementEntity> {
List<SubjectfollowmanagementEntity> getList(SubjectfollowmanagementPagination subjectfollowmanagementPagination);

@ -0,0 +1,334 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.ContactsMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.contacts.*;
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;
/**
*
* Contacts
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-01-29
*/
@Service
public class ContactsServiceImpl extends ServiceImpl<ContactsMapper, ContactsEntity> implements ContactsService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Override
public List<ContactsEntity> getList(ContactsPagination contactsPagination){
return getTypeList(contactsPagination,contactsPagination.getDataType());
}
/** 列表查询 */
@Override
public List<ContactsEntity> getTypeList(ContactsPagination contactsPagination,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 ? ContactsConstant.getAppColumnData() : ContactsConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int contactsNum =0;
QueryWrapper<ContactsEntity> contactsQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(contactsPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = contactsPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<ContactsEntity> contactsSuperWrapper = new QueryWrapper<>();
contactsSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(contactsSuperWrapper,ContactsEntity.class,queryJson,"0"));
int contactsNum1 = contactsSuperWrapper.getExpression().getNormal().size();
if (contactsNum1>0){
List<String> contactsList =this.list(contactsSuperWrapper).stream().map(ContactsEntity::getId).collect(Collectors.toList());
allSuperList.addAll(contactsList);
intersectionSuperList.add(contactsList);
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<ContactsEntity> contactsSuperWrapper = new QueryWrapper<>();
contactsSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(contactsSuperWrapper,ContactsEntity.class,ruleJson,"0"));
int contactsNum1 = contactsSuperWrapper.getExpression().getNormal().size();
if (contactsNum1>0){
List<String> contactsList =this.list(contactsSuperWrapper).stream().map(ContactsEntity::getId).collect(Collectors.toList());
allRuleList.addAll(contactsList);
intersectionRuleList.add(contactsList);
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 contactsObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(contactsQueryWrapper,ContactsEntity.class,contactsPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(contactsObj)){
return new ArrayList<>();
} else {
contactsQueryWrapper = (QueryWrapper<ContactsEntity>)contactsObj;
if( contactsQueryWrapper.getExpression().getNormal().size()>0){
contactsNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object contactsObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(contactsQueryWrapper,ContactsEntity.class,contactsPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(contactsObj)){
return new ArrayList<>();
} else {
contactsQueryWrapper = (QueryWrapper<ContactsEntity>)contactsObj;
if( contactsQueryWrapper.getExpression().getNormal().size()>0){
contactsNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(contactsPagination.getContactsType())){
contactsNum++;
List<String> idList = new ArrayList<>();
try {
String[][] contactsType = JsonUtil.getJsonToBean(contactsPagination.getContactsType(),String[][].class);
for(int i=0;i<contactsType.length;i++){
if(contactsType[i].length>0){
idList.add(JsonUtil.getObjectToString(Arrays.asList(contactsType[i])));
}
}
}catch (Exception e1){
try {
List<String> contactsType = JsonUtil.getJsonToList(contactsPagination.getContactsType(),String.class);
if(contactsType.size()>0){
idList.addAll(contactsType);
}
}catch (Exception e2){
idList.add(String.valueOf(contactsPagination.getContactsType()));
}
}
contactsQueryWrapper.lambda().and(t->{
idList.forEach(tt->{
t.like(ContactsEntity::getContactsType, tt).or();
});
});
}
if(ObjectUtil.isNotEmpty(contactsPagination.getName())){
contactsNum++;
String value = contactsPagination.getName() instanceof List ?
JsonUtil.getObjectToString(contactsPagination.getName()) :
String.valueOf(contactsPagination.getName());
contactsQueryWrapper.lambda().like(ContactsEntity::getName,value);
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
contactsQueryWrapper.lambda().in(ContactsEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
contactsQueryWrapper.lambda().and(t->t.in(ContactsEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
contactsQueryWrapper.lambda().and(t->t.in(ContactsEntity::getId, finalAllRuleIDlist));
}
//假删除标志
contactsQueryWrapper.lambda().isNull(ContactsEntity::getDeleteMark);
//排序
if(StringUtil.isEmpty(contactsPagination.getSidx())){
contactsQueryWrapper.lambda().orderByDesc(ContactsEntity::getId);
}else{
try {
String sidx = contactsPagination.getSidx();
String[] strs= sidx.split("_name");
ContactsEntity contactsEntity = new ContactsEntity();
Field declaredField = contactsEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
contactsQueryWrapper="asc".equals(contactsPagination.getSort().toLowerCase())?contactsQueryWrapper.orderByAsc(value):contactsQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<ContactsEntity> page=new Page<>(contactsPagination.getCurrentPage(), contactsPagination.getPageSize());
IPage<ContactsEntity> userIPage=this.page(page, contactsQueryWrapper);
return contactsPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<ContactsEntity> list = new ArrayList();
return contactsPagination.setData(list, list.size());
}
}else{
return this.list(contactsQueryWrapper);
}
}
@Override
public ContactsEntity getInfo(String id){
QueryWrapper<ContactsEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(ContactsEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(ContactsEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, ContactsEntity entity){
return this.updateById(entity);
}
@Override
public void delete(ContactsEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(ContactsForm form,int i) {
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id="";
String countRecover = "";
if (isUp){
id = form.getId();
}
//主表字段验证
if(StringUtil.isEmpty(form.getName())){
return "姓名不能为空";
}
if(StringUtil.isEmpty(form.getPosition())){
return "职务不能为空";
}
if(StringUtil.isEmpty(form.getCompanyName())){
return "公司不能为空";
}
if(StringUtil.isEmpty(form.getMobile())){
return "手机不能为空";
}
if(StringUtil.isNotEmpty(form.getMobile())){
if(!Pattern.compile("^1[3456789]\\d{9}$|^0\\d{2,3}-?\\d{7,8}$").matcher(String.valueOf(form.getMobile())).matches()){
return "请输入正确的联系方式";
}
}
if(StringUtil.isEmpty(form.getPhone())){
return "电话不能为空";
}
if(StringUtil.isNotEmpty(form.getPhone())){
if(!Pattern.compile("^1[3456789]\\d{9}$|^0\\d{2,3}-?\\d{7,8}$").matcher(String.valueOf(form.getPhone())).matches()){
return "请输入正确的联系方式";
}
}
if(StringUtil.isEmpty(form.getEmaile())){
return "邮箱不能为空";
}
if(StringUtil.isNotEmpty(form.getEmaile())){
if(!Pattern.compile("^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$").matcher(String.valueOf(form.getEmaile())).matches()){
return "请输入正确的邮箱";
}
}
if(StringUtil.isEmpty(form.getAddress())){
return "地址不能为空";
}
return countRecover;
}
/**
* ()
* @param id
* @param contactsForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(ContactsForm contactsForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
contactsForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(ContactsConstant.getFormData(),contactsForm),ContactsForm.class);
ContactsEntity entity = JsonUtil.getJsonToBean(contactsForm, ContactsEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setId(mainId);
}else{
}
this.saveOrUpdate(entity);
}
}

@ -0,0 +1,285 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.SubjectSettlementRulesMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.subjectsettlementrules.*;
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;
/**
*
* SubjectSettlementRules
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-01-29
*/
@Service
public class SubjectSettlementRulesServiceImpl extends ServiceImpl<SubjectSettlementRulesMapper, SubjectSettlementRulesEntity> implements SubjectSettlementRulesService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Override
public List<SubjectSettlementRulesEntity> getList(SubjectSettlementRulesPagination subjectSettlementRulesPagination){
return getTypeList(subjectSettlementRulesPagination,subjectSettlementRulesPagination.getDataType());
}
/** 列表查询 */
@Override
public List<SubjectSettlementRulesEntity> getTypeList(SubjectSettlementRulesPagination subjectSettlementRulesPagination,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 ? SubjectSettlementRulesConstant.getAppColumnData() : SubjectSettlementRulesConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int subjectSettlementRulesNum =0;
QueryWrapper<SubjectSettlementRulesEntity> subjectSettlementRulesQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(subjectSettlementRulesPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = subjectSettlementRulesPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<SubjectSettlementRulesEntity> subjectSettlementRulesSuperWrapper = new QueryWrapper<>();
subjectSettlementRulesSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(subjectSettlementRulesSuperWrapper,SubjectSettlementRulesEntity.class,queryJson,"0"));
int subjectSettlementRulesNum1 = subjectSettlementRulesSuperWrapper.getExpression().getNormal().size();
if (subjectSettlementRulesNum1>0){
List<String> subjectSettlementRulesList =this.list(subjectSettlementRulesSuperWrapper).stream().map(SubjectSettlementRulesEntity::getId).collect(Collectors.toList());
allSuperList.addAll(subjectSettlementRulesList);
intersectionSuperList.add(subjectSettlementRulesList);
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<SubjectSettlementRulesEntity> subjectSettlementRulesSuperWrapper = new QueryWrapper<>();
subjectSettlementRulesSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(subjectSettlementRulesSuperWrapper,SubjectSettlementRulesEntity.class,ruleJson,"0"));
int subjectSettlementRulesNum1 = subjectSettlementRulesSuperWrapper.getExpression().getNormal().size();
if (subjectSettlementRulesNum1>0){
List<String> subjectSettlementRulesList =this.list(subjectSettlementRulesSuperWrapper).stream().map(SubjectSettlementRulesEntity::getId).collect(Collectors.toList());
allRuleList.addAll(subjectSettlementRulesList);
intersectionRuleList.add(subjectSettlementRulesList);
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 subjectSettlementRulesObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(subjectSettlementRulesQueryWrapper,SubjectSettlementRulesEntity.class,subjectSettlementRulesPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(subjectSettlementRulesObj)){
return new ArrayList<>();
} else {
subjectSettlementRulesQueryWrapper = (QueryWrapper<SubjectSettlementRulesEntity>)subjectSettlementRulesObj;
if( subjectSettlementRulesQueryWrapper.getExpression().getNormal().size()>0){
subjectSettlementRulesNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object subjectSettlementRulesObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(subjectSettlementRulesQueryWrapper,SubjectSettlementRulesEntity.class,subjectSettlementRulesPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(subjectSettlementRulesObj)){
return new ArrayList<>();
} else {
subjectSettlementRulesQueryWrapper = (QueryWrapper<SubjectSettlementRulesEntity>)subjectSettlementRulesObj;
if( subjectSettlementRulesQueryWrapper.getExpression().getNormal().size()>0){
subjectSettlementRulesNum++;
}
}
}
}
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){
intersection.add("jnpfNullList");
}
subjectSettlementRulesQueryWrapper.lambda().in(SubjectSettlementRulesEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
subjectSettlementRulesQueryWrapper.lambda().and(t->t.in(SubjectSettlementRulesEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
subjectSettlementRulesQueryWrapper.lambda().and(t->t.in(SubjectSettlementRulesEntity::getId, finalAllRuleIDlist));
}
//排序
if(StringUtil.isEmpty(subjectSettlementRulesPagination.getSidx())){
subjectSettlementRulesQueryWrapper.lambda().orderByDesc(SubjectSettlementRulesEntity::getId);
}else{
try {
String sidx = subjectSettlementRulesPagination.getSidx();
String[] strs= sidx.split("_name");
SubjectSettlementRulesEntity subjectSettlementRulesEntity = new SubjectSettlementRulesEntity();
Field declaredField = subjectSettlementRulesEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
subjectSettlementRulesQueryWrapper="asc".equals(subjectSettlementRulesPagination.getSort().toLowerCase())?subjectSettlementRulesQueryWrapper.orderByAsc(value):subjectSettlementRulesQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<SubjectSettlementRulesEntity> page=new Page<>(subjectSettlementRulesPagination.getCurrentPage(), subjectSettlementRulesPagination.getPageSize());
IPage<SubjectSettlementRulesEntity> userIPage=this.page(page, subjectSettlementRulesQueryWrapper);
return subjectSettlementRulesPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<SubjectSettlementRulesEntity> list = new ArrayList();
return subjectSettlementRulesPagination.setData(list, list.size());
}
}else{
return this.list(subjectSettlementRulesQueryWrapper);
}
}
@Override
public SubjectSettlementRulesEntity getInfo(String id){
QueryWrapper<SubjectSettlementRulesEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(SubjectSettlementRulesEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(SubjectSettlementRulesEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, SubjectSettlementRulesEntity entity){
return this.updateById(entity);
}
@Override
public void delete(SubjectSettlementRulesEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(SubjectSettlementRulesForm form,int i) {
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id="";
String countRecover = "";
if (isUp){
id = form.getId();
}
//主表字段验证
if(StringUtil.isEmpty(form.getUnderpaymentAmountDown())){
return "压款金额下限不能为空";
}
if(StringUtil.isEmpty(form.getUnderpaymentAmountUpper())){
return "压款金额上限不能为空";
}
return countRecover;
}
/**
* ()
* @param id
* @param subjectSettlementRulesForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(SubjectSettlementRulesForm subjectSettlementRulesForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
subjectSettlementRulesForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(SubjectSettlementRulesConstant.getFormData(),subjectSettlementRulesForm),SubjectSettlementRulesForm.class);
SubjectSettlementRulesEntity entity = JsonUtil.getJsonToBean(subjectSettlementRulesForm, SubjectSettlementRulesEntity.class);
if(isSave){
String mainId = id ;
entity.setId(mainId);
entity.setFlowId(subjectSettlementRulesForm.getFlowId());
}else{
entity.setFlowId(subjectSettlementRulesForm.getFlowId());
}
this.saveOrUpdate(entity);
}
}

@ -36,7 +36,7 @@ import jnpf.permission.entity.UserEntity;
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-01-27
* 2024-01-29
*/
@Service
public class SubjectfollowmanagementServiceImpl extends ServiceImpl<SubjectfollowmanagementMapper, SubjectfollowmanagementEntity> implements SubjectfollowmanagementService{
@ -291,9 +291,11 @@ public class SubjectfollowmanagementServiceImpl extends ServiceImpl<Subjectfollo
SubjectfollowmanagementEntity entity = JsonUtil.getJsonToBean(subjectfollowmanagementForm, SubjectfollowmanagementEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
String mainId = id ;
entity.setId(mainId);
entity.setFlowId(subjectfollowmanagementForm.getFlowId());
}else{
entity.setFlowId(subjectfollowmanagementForm.getFlowId());
}
this.saveOrUpdate(entity);

@ -0,0 +1,372 @@
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.contacts.*;
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;
/**
* Contacts
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-29
*/
@Slf4j
@RestController
@Tag(name = "Contacts" , description = "scm")
@RequestMapping("/api/scm/Contacts")
public class ContactsController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private ContactsService contactsService;
@Autowired
private ConfigValueUtil configValueUtil;
/**
*
*
* @param contactsPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody ContactsPagination contactsPagination)throws IOException{
List<ContactsEntity> list= contactsService.getList(contactsPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (ContactsEntity entity : list) {
Map<String, Object> contactsMap=JsonUtil.entityToMap(entity);
contactsMap.put("id", contactsMap.get("id"));
//副表数据
//子表数据
realList.add(contactsMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, ContactsConstant.getFormData(), ContactsConstant.getColumnData(), contactsPagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(contactsPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param contactsForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid ContactsForm contactsForm) {
String b = contactsService.checkForm(contactsForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
contactsService.saveOrUpdate(contactsForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
* Excel
*
* @return
*/
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody ContactsPagination contactsPagination) throws IOException {
if (StringUtil.isEmpty(contactsPagination.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
List<ContactsEntity> list= contactsService.getList(contactsPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (ContactsEntity entity : list) {
Map<String, Object> contactsMap=JsonUtil.entityToMap(entity);
contactsMap.put("id", contactsMap.get("id"));
//副表数据
//子表数据
realList.add(contactsMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, ContactsConstant.getFormData(), ContactsConstant.getColumnData(), contactsPagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(contactsPagination.getSelectKey())?contactsPagination.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 "logo" :
entitys.add(new ExcelExportEntity("联系人头像" ,"logo"));
break;
case "contactsType" :
entitys.add(new ExcelExportEntity("联系人类型" ,"contactsType"));
break;
case "subjectBasicId" :
entitys.add(new ExcelExportEntity("关联客户" ,"subjectBasicId"));
break;
case "name" :
entitys.add(new ExcelExportEntity("姓名" ,"name"));
break;
case "position" :
entitys.add(new ExcelExportEntity("职务" ,"position"));
break;
case "companyName" :
entitys.add(new ExcelExportEntity("公司" ,"companyName"));
break;
case "mobile" :
entitys.add(new ExcelExportEntity("手机" ,"mobile"));
break;
case "phone" :
entitys.add(new ExcelExportEntity("电话" ,"phone"));
break;
case "emaile" :
entitys.add(new ExcelExportEntity("邮箱" ,"emaile"));
break;
case "address" :
entitys.add(new ExcelExportEntity("地址" ,"address"));
break;
case "markColor" :
entitys.add(new ExcelExportEntity("是否星标" ,"markColor"));
break;
case "annex" :
entitys.add(new ExcelExportEntity("附件" ,"annex"));
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(ContactsConstant.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 contactsForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid ContactsForm contactsForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
contactsForm.setId(id);
if (!isImport) {
String b = contactsService.checkForm(contactsForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
ContactsEntity entity= contactsService.getInfo(id);
if(entity!=null){
try{
contactsService.saveOrUpdate(contactsForm,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){
ContactsEntity entity= contactsService.getInfo(id);
if(entity!=null){
//假删除
entity.setDeleteMark(1);
contactsService.update(id,entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
ContactsEntity entity= contactsService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> contactsMap=JsonUtil.entityToMap(entity);
contactsMap.put("id", contactsMap.get("id"));
//副表数据
//子表数据
contactsMap = generaterSwapUtil.swapDataDetail(contactsMap,ContactsConstant.getFormData(),"521664611062126789",false);
return ActionResult.success(contactsMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
ContactsEntity entity= contactsService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> contactsMap=JsonUtil.entityToMap(entity);
contactsMap.put("id", contactsMap.get("id"));
//副表数据
//子表数据
contactsMap = generaterSwapUtil.swapDataForm(contactsMap,ContactsConstant.getFormData(),ContactsConstant.TABLEFIELDKEY,ContactsConstant.TABLERENAMES);
return ActionResult.success(contactsMap);
}
}

@ -0,0 +1,218 @@
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.subjectsettlementrules.*;
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;
/**
* SubjectSettlementRules
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-29
*/
@Slf4j
@RestController
@Tag(name = "SubjectSettlementRules" , description = "scm")
@RequestMapping("/api/scm/SubjectSettlementRules")
public class SubjectSettlementRulesController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private SubjectSettlementRulesService subjectSettlementRulesService;
/**
*
*
* @param subjectSettlementRulesPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody SubjectSettlementRulesPagination subjectSettlementRulesPagination)throws IOException{
List<SubjectSettlementRulesEntity> list= subjectSettlementRulesService.getList(subjectSettlementRulesPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (SubjectSettlementRulesEntity entity : list) {
Map<String, Object> subjectSettlementRulesMap=JsonUtil.entityToMap(entity);
subjectSettlementRulesMap.put("id", subjectSettlementRulesMap.get("id"));
//副表数据
//子表数据
realList.add(subjectSettlementRulesMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, SubjectSettlementRulesConstant.getFormData(), SubjectSettlementRulesConstant.getColumnData(), subjectSettlementRulesPagination.getModuleId(),false);
//流程状态添加
for(Map<String, Object> vo:realList){
FlowTaskEntity flowTaskEntity = generaterSwapUtil.getInfoSubmit(String.valueOf(vo.get("id")), FlowTaskEntity::getStatus);
if (flowTaskEntity!=null){
vo.put("flowState",flowTaskEntity.getStatus());
}else{
vo.put("flowState",null);
}
//添加流程id
String flowId="";
if(vo.get("flowid")!=null){
flowId = String.valueOf(vo.get("flowid"));
}
if(vo.get("flowid".toUpperCase())!=null){
flowId = String.valueOf(vo.get("flowid".toUpperCase()));
}
if(StringUtil.isNotEmpty(flowId)){
vo.put("flowId" ,flowId);
}
}
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(subjectSettlementRulesPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param subjectSettlementRulesForm
* @return
*/
@PostMapping("/{id}")
@Operation(summary = "创建")
public ActionResult create(@PathVariable("id") String id, @RequestBody @Valid SubjectSettlementRulesForm subjectSettlementRulesForm) {
String b = subjectSettlementRulesService.checkForm(subjectSettlementRulesForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
subjectSettlementRulesService.saveOrUpdate(subjectSettlementRulesForm, id ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
*
* @param id
* @param subjectSettlementRulesForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid SubjectSettlementRulesForm subjectSettlementRulesForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
subjectSettlementRulesForm.setId(id);
if (!isImport) {
String b = subjectSettlementRulesService.checkForm(subjectSettlementRulesForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
SubjectSettlementRulesEntity entity= subjectSettlementRulesService.getInfo(id);
if(entity!=null){
try{
subjectSettlementRulesService.saveOrUpdate(subjectSettlementRulesForm,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){
SubjectSettlementRulesEntity entity= subjectSettlementRulesService.getInfo(id);
if(entity!=null){
FlowTaskEntity taskEntity = generaterSwapUtil.getInfoSubmit(id, FlowTaskEntity::getId, FlowTaskEntity::getStatus);
if (taskEntity != null) {
try {
generaterSwapUtil.deleteFlowTask(taskEntity);
} catch (WorkFlowException e) {
e.printStackTrace();
}
}
//主表数据删除
subjectSettlementRulesService.delete(entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
SubjectSettlementRulesEntity entity= subjectSettlementRulesService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> subjectSettlementRulesMap=JsonUtil.entityToMap(entity);
subjectSettlementRulesMap.put("id", subjectSettlementRulesMap.get("id"));
//副表数据
//子表数据
subjectSettlementRulesMap = generaterSwapUtil.swapDataDetail(subjectSettlementRulesMap,SubjectSettlementRulesConstant.getFormData(),"521677714441116549",false);
return ActionResult.success(subjectSettlementRulesMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
SubjectSettlementRulesEntity entity= subjectSettlementRulesService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> subjectSettlementRulesMap=JsonUtil.entityToMap(entity);
subjectSettlementRulesMap.put("id", subjectSettlementRulesMap.get("id"));
//副表数据
//子表数据
subjectSettlementRulesMap = generaterSwapUtil.swapDataForm(subjectSettlementRulesMap,SubjectSettlementRulesConstant.getFormData(),SubjectSettlementRulesConstant.TABLEFIELDKEY,SubjectSettlementRulesConstant.TABLERENAMES);
return ActionResult.success(subjectSettlementRulesMap);
}
}

@ -1,7 +1,6 @@
package jnpf.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
@ -55,7 +54,7 @@ import org.springframework.transaction.annotation.Transactional;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-27
* @ 2024-01-29
*/
@Slf4j
@RestController
@ -71,13 +70,14 @@ public class SubjectfollowmanagementController {
@Autowired
private SubjectfollowmanagementService subjectfollowmanagementService;
@Autowired
private SubjectbasicService subjectbasicService;
@Autowired
private SubjectbasicService subjectbasicService;
@Autowired
private ConfigValueUtil configValueUtil;
/**
*
*
@ -105,6 +105,26 @@ public class SubjectfollowmanagementController {
//数据转换
realList = generaterSwapUtil.swapDataList(realList, SubjectfollowmanagementConstant.getFormData(), SubjectfollowmanagementConstant.getColumnData(), subjectfollowmanagementPagination.getModuleId(),false);
//流程状态添加
for(Map<String, Object> vo:realList){
FlowTaskEntity flowTaskEntity = generaterSwapUtil.getInfoSubmit(String.valueOf(vo.get("id")), FlowTaskEntity::getStatus);
if (flowTaskEntity!=null){
vo.put("flowState",flowTaskEntity.getStatus());
}else{
vo.put("flowState",null);
}
//添加流程id
String flowId="";
if(vo.get("flowid")!=null){
flowId = String.valueOf(vo.get("flowid"));
}
if(vo.get("flowid".toUpperCase())!=null){
flowId = String.valueOf(vo.get("flowid".toUpperCase()));
}
if(StringUtil.isNotEmpty(flowId)){
vo.put("flowId" ,flowId);
}
}
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
@ -118,15 +138,15 @@ public class SubjectfollowmanagementController {
* @param subjectfollowmanagementForm
* @return
*/
@PostMapping()
@PostMapping("/{id}")
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid SubjectfollowmanagementForm subjectfollowmanagementForm) {
public ActionResult create(@PathVariable("id") String id, @RequestBody @Valid SubjectfollowmanagementForm subjectfollowmanagementForm) {
String b = subjectfollowmanagementService.checkForm(subjectfollowmanagementForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
subjectfollowmanagementService.saveOrUpdate(subjectfollowmanagementForm, null ,true);
subjectfollowmanagementService.saveOrUpdate(subjectfollowmanagementForm, id ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
@ -196,6 +216,24 @@ public class SubjectfollowmanagementController {
case "annex" :
entitys.add(new ExcelExportEntity("附件" ,"annex"));
break;
case "reportType" :
entitys.add(new ExcelExportEntity("报告类型" ,"reportType"));
break;
case "reportDate" :
entitys.add(new ExcelExportEntity("报告日期" ,"reportDate"));
break;
case "followTimeStart" :
entitys.add(new ExcelExportEntity("跟进日期开始" ,"followTimeStart"));
break;
case "followTimeEnd" :
entitys.add(new ExcelExportEntity("跟进日期结束" ,"followTimeEnd"));
break;
case "reportdescription" :
entitys.add(new ExcelExportEntity("报告内容" ,"reportdescription"));
break;
case "reportannex" :
entitys.add(new ExcelExportEntity("报告附件" ,"reportannex"));
break;
default:
break;
}
@ -270,16 +308,34 @@ public class SubjectfollowmanagementController {
@Transactional
@Operation(summary = "批量删除")
public ActionResult batchRemove(@RequestBody String ids){
List<String> idList = JsonUtil.getJsonToList(ids, String.class);
int i =0;
for (String allId : idList){
List<String> idList = JsonUtil.getJsonToList(ids, String.class);
List<String> columnIdList = new ArrayList<>(20);
int i =0;
String errInfo = "";
for (String allId : idList){
FlowTaskEntity taskEntity = generaterSwapUtil.getInfoSubmit(allId, FlowTaskEntity::getId, FlowTaskEntity::getStatus);
if (taskEntity==null){
columnIdList.add(allId);
this.delete(allId);
i++;
}
if (i == 0 ){
return ActionResult.fail("删除失败");
}else if (taskEntity.getStatus().equals(0) || taskEntity.getStatus().equals(4)){
try {
generaterSwapUtil.deleteFlowTask(taskEntity);
columnIdList.add(allId);
this.delete(allId);
i++;
} catch (WorkFlowException e) {
errInfo = e.getMessage();
e.printStackTrace();
}
}
return ActionResult.success("删除成功");
}
if (i == 0 && columnIdList.size()==0){
return ActionResult.fail("流程已发起,无法删除");
}
if (StringUtil.isNotEmpty(errInfo)){
return ActionResult.fail(errInfo);
}
return ActionResult.success("删除成功");
}
/**
*
@ -321,6 +377,14 @@ public class SubjectfollowmanagementController {
public ActionResult delete(@PathVariable("id") String id){
SubjectfollowmanagementEntity entity= subjectfollowmanagementService.getInfo(id);
if(entity!=null){
FlowTaskEntity taskEntity = generaterSwapUtil.getInfoSubmit(id, FlowTaskEntity::getId, FlowTaskEntity::getStatus);
if (taskEntity != null) {
try {
generaterSwapUtil.deleteFlowTask(taskEntity);
} catch (WorkFlowException e) {
e.printStackTrace();
}
}
//假删除
entity.setDeleteMark(1);
subjectfollowmanagementService.update(id,entity);

@ -0,0 +1,61 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-29
*/
@Data
@TableName("jg_subject_contacts")
public class ContactsEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "SUBJECT_BASIC_ID" , updateStrategy = FieldStrategy.IGNORED)
private String subjectBasicId;
@TableField(value = "CONTACTS_TYPE" , updateStrategy = FieldStrategy.IGNORED)
private String contactsType;
@TableField(value = "LOGO" , updateStrategy = FieldStrategy.IGNORED)
private String logo;
@TableField(value = "MARK_COLOR" , updateStrategy = FieldStrategy.IGNORED)
private String markColor;
@TableField(value = "NAME" , updateStrategy = FieldStrategy.IGNORED)
private String name;
@TableField(value = "COMPANY_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String companyName;
@TableField(value = "POSITION" , updateStrategy = FieldStrategy.IGNORED)
private String position;
@TableField(value = "MOBILE" , updateStrategy = FieldStrategy.IGNORED)
private String mobile;
@TableField(value = "PHONE" , updateStrategy = FieldStrategy.IGNORED)
private String phone;
@TableField(value = "EMAILE" , updateStrategy = FieldStrategy.IGNORED)
private String emaile;
@TableField(value = "ADDRESS" , updateStrategy = FieldStrategy.IGNORED)
private String address;
@TableField(value = "ANNEX" , updateStrategy = FieldStrategy.IGNORED)
private String annex;
@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_FLOW_ID")
private String flowId;
}

@ -0,0 +1,69 @@
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_subject_settlement_rules")
public class SubjectSettlementRulesEntity {
@TableId(value ="ID" )
private String id;
@TableField("BUSINESS_TYPE")
private String businessType;
@TableField(value = "UNDERPAYMENT_AMOUNT_DOWN" , updateStrategy = FieldStrategy.IGNORED)
private String underpaymentAmountDown;
@TableField(value = "UNDERPAYMENT_AMOUNT_UPPER" , updateStrategy = FieldStrategy.IGNORED)
private String underpaymentAmountUpper;
@TableField(value = "UNDERPAYMENT_RATE_DOWN" , updateStrategy = FieldStrategy.IGNORED)
private String underpaymentRateDown;
@TableField(value = "UNDERPAYMENT_RATE_UPPER" , updateStrategy = FieldStrategy.IGNORED)
private String underpaymentRateUpper;
@TableField(value = "MARGIN_AMOUNT_DOWN" , updateStrategy = FieldStrategy.IGNORED)
private String marginAmountDown;
@TableField(value = "MARGIN_AMOUNT_UPPER" , updateStrategy = FieldStrategy.IGNORED)
private String marginAmountUpper;
@TableField(value = "MARGIN_RATE_DOWN" , updateStrategy = FieldStrategy.IGNORED)
private String marginRateDown;
@TableField(value = "MARGIN_RATE_UPPER" , updateStrategy = FieldStrategy.IGNORED)
private String marginRateUpper;
@TableField(value = "OVERDUE_ANNUALIZED_DOWN" , updateStrategy = FieldStrategy.IGNORED)
private String overdueAnnualizedDown;
@TableField(value = "OVERDUE_ANNUALIZED_UPPER" , updateStrategy = FieldStrategy.IGNORED)
private String overdueAnnualizedUpper;
@TableField(value = "OVERDUE_MONTHLY_DOWN" , updateStrategy = FieldStrategy.IGNORED)
private String overdueMonthlyDown;
@TableField(value = "OVERDUE_MONTHLY_UPPER" , updateStrategy = FieldStrategy.IGNORED)
private String overdueMonthlyUpper;
@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(value = "UNDERPAYMENT_METHOD" , updateStrategy = FieldStrategy.IGNORED)
private String underpaymentMethod;
@TableField(value = "MARGIN_METHOD" , updateStrategy = FieldStrategy.IGNORED)
private String marginMethod;
@TableField(value = "OVERDUE_METHOD" , updateStrategy = FieldStrategy.IGNORED)
private String overdueMethod;
@TableField("F_FLOW_ID")
private String flowId;
}

@ -9,7 +9,7 @@ import java.util.Date;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-27
* @ 2024-01-29
*/
@Data
@TableName("jg_subject_follow_management")
@ -62,6 +62,22 @@ public class SubjectfollowmanagementEntity {
private String flowTaskId;
@TableField("F_FLOW_ID")
private String flowId;
@TableField(value = "REPORT_TYPE" , updateStrategy = FieldStrategy.IGNORED)
private String reportType;
@TableField(value = "FOLLOW_TIME_START" , updateStrategy = FieldStrategy.IGNORED)
private Date followTimeStart;
@TableField(value = "REPORTANNEX" , updateStrategy = FieldStrategy.IGNORED)
private String reportannex;
@TableField(value = "REPORTDESCRIPTION" , updateStrategy = FieldStrategy.IGNORED)
private String reportdescription;
@TableField("READ_OVER_USER")
private String readOverUser;
@TableField("MAKE_COPY_USER")
private String makeCopyUser;
@TableField(value = "REPORT_DATE" , updateStrategy = FieldStrategy.IGNORED)
private Date reportDate;
@TableField(value = "FOLLOW_TIME_END" , updateStrategy = FieldStrategy.IGNORED)
private Date followTimeEnd;
@TableField(exist = false)
private String name;

@ -0,0 +1,56 @@
package jnpf.model.contacts;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Contacts
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-29
*/
@Data
public class ContactsForm {
/** 主键 */
private String id;
/** 联系人头像 **/
@JsonProperty("logo")
private Object logo;
/** 联系人类型 **/
@JsonProperty("contactsType")
private Object contactsType;
/** 关联客户 **/
@JsonProperty("subjectBasicId")
private String subjectBasicId;
/** 姓名 **/
@JsonProperty("name")
private String name;
/** 职务 **/
@JsonProperty("position")
private String position;
/** 公司 **/
@JsonProperty("companyName")
private String companyName;
/** 手机 **/
@JsonProperty("mobile")
private String mobile;
/** 电话 **/
@JsonProperty("phone")
private String phone;
/** 邮箱 **/
@JsonProperty("emaile")
private String emaile;
/** 地址 **/
@JsonProperty("address")
private String address;
/** 是否星标 **/
@JsonProperty("markColor")
private Integer markColor;
/** 附件 **/
@JsonProperty("annex")
private Object annex;
}

@ -0,0 +1,36 @@
package jnpf.model.contacts;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* Contacts
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-29
*/
@Data
public class ContactsPagination 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("contactsType")
private Object contactsType;
/** 姓名 */
@JsonProperty("name")
private Object name;
}

@ -10,12 +10,15 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-27
* @ 2024-01-29
*/
@Data
public class SubjectfollowmanagementForm {
/** 主键 */
private String id;
/** 流程id **/
@JsonProperty("flowId")
private String flowId;
/** 任务标题 **/
@JsonProperty("title")
@ -44,4 +47,22 @@ public class SubjectfollowmanagementForm {
/** 附件 **/
@JsonProperty("annex")
private Object annex;
/** 报告类型 **/
@JsonProperty("reportType")
private String reportType;
/** 报告日期 **/
@JsonProperty("reportDate")
private String reportDate;
/** 跟进日期开始 **/
@JsonProperty("followTimeStart")
private String followTimeStart;
/** 跟进日期结束 **/
@JsonProperty("followTimeEnd")
private String followTimeEnd;
/** 报告内容 **/
@JsonProperty("reportdescription")
private String reportdescription;
/** 报告附件 **/
@JsonProperty("reportannex")
private Object reportannex;
}

@ -11,7 +11,7 @@ import java.util.List;
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-27
* @ 2024-01-29
*/
@Data
public class SubjectfollowmanagementPagination extends Pagination {

@ -0,0 +1,68 @@
package jnpf.model.subjectsettlementrules;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* SubjectSettlementRules
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-29
*/
@Data
public class SubjectSettlementRulesForm {
/** 主键 */
private String id;
/** 流程id **/
@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("marginRateDown")
private String marginRateDown;
/** 保证金比例上限 **/
@JsonProperty("marginRateUpper")
private String marginRateUpper;
/** 逾期月化下限 **/
@JsonProperty("overdueMonthlyDown")
private String overdueMonthlyDown;
/** 逾期月化上限 **/
@JsonProperty("overdueMonthlyUpper")
private String overdueMonthlyUpper;
}

@ -0,0 +1,36 @@
package jnpf.model.subjectsettlementrules;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* SubjectSettlementRules
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-01-29
*/
@Data
public class SubjectSettlementRulesPagination 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("underpaymentAmountDown")
private Object underpaymentAmountDown;
/** 压款金额上限 */
@JsonProperty("underpaymentAmountUpper")
private Object underpaymentAmountUpper;
}

@ -0,0 +1,176 @@
<template>
<el-dialog title="详情"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="1000px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="24" >
<jnpf-form-tip-item label="联系人头像"
prop="logo" >
<JnpfUploadImg v-model="dataForm.logo"
disabled
detailed :fileSize="10" sizeUnit="MB" :limit="1" pathType="defaultPath" :isAccount="0" >
</JnpfUploadImg>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="联系人类型"
prop="contactsType" >
<p>{{ dataForm.contactsType }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="关联客户"
prop="subjectBasicId" >
<p>{{dataForm.subjectBasicId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="姓名"
prop="name" >
<p>{{dataForm.name}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="职务"
prop="position" >
<p>{{dataForm.position}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="公司"
prop="companyName" >
<p>{{dataForm.companyName}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="手机"
prop="mobile" >
<p>{{dataForm.mobile}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="电话"
prop="phone" >
<p>{{dataForm.phone}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="邮箱"
prop="emaile" >
<p>{{dataForm.emaile}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="地址"
prop="address" >
<p>{{dataForm.address}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="是否星标"
prop="markColor" >
<p>{{dataForm.markColor}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="附件"
prop="annex" >
<JnpfUploadFile v-model="dataForm.annex"
disabled
detailed :fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0" buttonText="点击上传" >
</JnpfUploadFile>
</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 :'',
logo : [],
contactsType : "2",
subjectBasicId : "",
name : '',
position : '',
companyName : '',
mobile : '',
phone : '',
emaile : '',
address : '',
markColor : 0,
annex : [],
},
contactsTypeOptions:[{"fullName":"默认","id":"1"},{"fullName":"联系人","id":"2"}],
contactsTypeProps:{"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/Contacts/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
})
},
},
}
</script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,573 @@
<template>
<el-dialog :title="!dataForm.id ? '新建' :'编辑'"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="1000px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="24" >
<jnpf-form-tip-item
label="联系人头像" prop="logo" >
<JnpfUploadImg v-model="dataForm.logo" @change="changeData('logo',-1)"
:fileSize="10" sizeUnit="MB" :limit="1" pathType="defaultPath" :isAccount="0" >
</JnpfUploadImg>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="联系人类型" prop="contactsType" >
<JnpfSelect v-model="dataForm.contactsType" @change="changeData('contactsType',-1)"
placeholder="请选择" clearable :style='{"width":"100%"}' :options="contactsTypeOptions" :props="contactsTypeProps" >
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="关联客户" prop="subjectBasicId" >
<JnpfPopupSelect v-model="dataForm.subjectBasicId" @change="changeData('subjectBasicId',-1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.subjectBasicId" placeholder="请选择" propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='name' field='subjectBasicId' interfaceId="520962013808039429" :pageSize="20" :columnOptions="subjectBasicIdcolumnOptions" clearable :style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="姓名" prop="name" >
<JnpfInput v-model="dataForm.name" @change="changeData('name',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="职务" prop="position" >
<JnpfInput v-model="dataForm.position" @change="changeData('position',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="公司" prop="companyName" >
<JnpfInput v-model="dataForm.companyName" @change="changeData('companyName',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="手机" prop="mobile" >
<JnpfInput v-model="dataForm.mobile" @change="changeData('mobile',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="电话" prop="phone" >
<JnpfInput v-model="dataForm.phone" @change="changeData('phone',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="邮箱" prop="emaile" >
<JnpfInput v-model="dataForm.emaile" @change="changeData('emaile',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="地址" prop="address" >
<JnpfInput v-model="dataForm.address" @change="changeData('address',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="是否星标" prop="markColor" >
<JnpfSwitch v-model="dataForm.markColor" @change="changeData('markColor',-1)"
:active-value="1" :inactive-value="0" >
</JnpfSwitch>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="附件" prop="annex" >
<JnpfUploadFile v-model="dataForm.annex" @change="changeData('annex',-1)"
:fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0" buttonText="点击上传" >
</JnpfUploadFile>
</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: {
logo : [],
contactsType : "2",
subjectBasicId : undefined,
name : undefined,
position : undefined,
companyName : undefined,
mobile : undefined,
phone : undefined,
emaile : undefined,
address : undefined,
markColor : 0,
annex : [],
},
tableRequiredData: {},
dataRule:
{
subjectBasicId: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
name: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
position: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
companyName: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
mobile: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
{
pattern: /^1[3456789]\d{9}$|^0\d{2,3}-?\d{7,8}$/,
message: '请输入正确的联系方式',
trigger: 'blur'
},
],
phone: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
{
pattern: /^1[3456789]\d{9}$|^0\d{2,3}-?\d{7,8}$/,
message: '请输入正确的联系方式',
trigger: 'blur'
},
],
emaile: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
{
pattern: /^[a-z0-9]+([._\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/,
message: '请输入正确的邮箱',
trigger: 'blur'
},
],
address: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
},
contactsTypeOptions:[{"fullName":"默认","id":"1"},{"fullName":"联系人","id":"2"}],
contactsTypeProps:{"label":"fullName","value":"id" },
subjectBasicIdcolumnOptions:[ {"label":"客户名称","value":"name"}, {"label":"客户编码","value":"code"},],
childIndex:-1,
isEdit:false,
interfaceRes: {
logo:[] ,
contactsType:[] ,
subjectBasicId:[] ,
name:[] ,
position:[] ,
companyName:[] ,
mobile:[] ,
phone:[] ,
emaile:[] ,
address:[] ,
markColor:[] ,
annex:[] ,
},
}
},
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/Contacts/'+ 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/Contacts/'+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/Contacts',
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/Contacts/'+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,525 @@
<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.contactsType" placeholder="请选择" clearable :options="contactsTypeOptions"
:props="contactsTypeProps">
</JnpfSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="姓名">
<el-input v-model="query.name" 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="contactsType" algin="left">
<template slot-scope="scope">
{{ scope.row.contactsType}}
</template>
</el-table-column>
<el-table-column prop="name" label="姓名" align="left">
</el-table-column>
<el-table-column prop="subjectBasicId" label="所属客户" align="left">
</el-table-column>
<el-table-column prop="position" label="职务" align="left">
</el-table-column>
<el-table-column prop="companyName" label="公司" align="left">
</el-table-column>
<el-table-column prop="mobile" label="手机" align="left">
</el-table-column>
<el-table-column prop="phone" label="电话" align="left">
</el-table-column>
<el-table-column prop="emaile" label="邮箱" align="left">
</el-table-column>
<el-table-column prop="address" label="地址" align="left">
</el-table-column>
<el-table-column prop="markColor" label="是否星标" align="left">
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button type="text" @click="addOrUpdateHandle(scope.row)" v-has="'btn_edit'">
</el-button>
<el-button type="text" class="JNPF-table-delBtn" v-has="'btn_remove'" @click="handleDel(scope.row.id)">
</el-button>
<el-button type="text" v-has="'btn_detail'" @click="goDetail(scope.row.id)">
</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
@pagination="initData" />
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson" @superQuery="superQuery" />
</div>
</template>
<script>
import request from '@/utils/request'
import {
mapGetters
} from "vuex";
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import JNPFForm from './form'
import Detail from './Detail'
import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getConfigData
} from '@/api/onlineDev/visualDev'
import {
getDefaultCurrentValueUserIdAsync
} from '@/api/permission/user'
import {
getDefaultCurrentValueDepartmentIdAsync
} from '@/api/permission/organize'
import columnList from './columnList'
import {
thousandsFormat
} from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
export default {
components: {
JNPFForm,
Detail,
ExportBox,
ToFormDetail,
SuperQuery
},
data() {
return {
keyword: '',
expandsTree: true,
refreshTree: true,
toFormDetailVisible: false,
expandObj: {},
columnOptions: [],
mergeList: [],
exportList: [],
columnList,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
contactsType: undefined,
name: 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,
contactsTypeOptions: [{
"fullName": "默认",
"id": "1"
}, {
"fullName": "联系人",
"id": "2"
}],
contactsTypeProps: {
"label": "fullName",
"value": "id"
},
interfaceRes: {
subjectBasicId: [],
},
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
this.getColumnList(),
this.initSearchDataAndListData()
this.queryData = JSON.parse(JSON.stringify(this.query))
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.toFormDetailVisible = true
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue)
})
})
},
toggleTreeExpand(expands) {
this.refreshTree = false
this.expandsTree = expands
this.$nextTick(() => {
this.refreshTree = true
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null)
})
})
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data
const config = {
treeInterfaceId: "",
treeTemplateJson: []
}
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || ''
}
}
//
let query = {
paramList: config.treeTemplateJson || [],
}
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
})
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList)
},
transformColumnList(columnList) {
let list = []
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes('-')) {
list.push(e)
} else {
let prop = e.prop.split('-')[0]
let label = e.label.split('-')[0]
let vModel = e.prop.split('-')[1]
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
}
e.vModel = vModel
if (!this.expandObj.hasOwnProperty(`${prop}Expand`)) this.$set(this.expandObj, `${prop}Expand`, false)
if (!list.some(o => o.prop === prop)) list.push(newItem)
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e)
break
}
}
}
}
this.getMergeList(list)
this.getExportList(list)
return list
},
arraySpanMethod({
column
}) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list))
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + '-child-first'
}
item.children.unshift(child)
}
})
newList.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
})
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
})
}
})
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
})
}
})
},
getExportList(list) {
let exportList = []
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === 'table') {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j])
}
} else {
exportList.push(list[i])
}
}
this.exportList = exportList
},
goDetail(id) {
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(id)
})
},
sortChange({
column,
prop,
order
}) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
},
//
async initSearchData() {},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId: this.menuId,
moduleId: '521664611062126789',
type: 1,
};
request({
url: `/api/scm/Contacts/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/Contacts/${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/Contacts")
})
},
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/Contacts/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/Contacts/Actions/Export`,
method: 'post',
data: query
}).then(res => {
if (!res.data.url) return
this.jnpf.downloadFile(res.data.url)
this.$refs.ExportBox.visible = false
this.exportBoxVisible = false
})
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.initData()
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData))
this.search()
},
colseFlow(isrRefresh) {
this.flowVisible = false
if (isrRefresh) this.reset()
},
}
}
</script>

File diff suppressed because one or more lines are too long

@ -769,6 +769,7 @@
flowId: item.id,
opType: '-1'
}
debugger
this.flowListVisible = false
this.flowVisible = true
this.$nextTick(() => {

File diff suppressed because one or more lines are too long

@ -48,35 +48,54 @@
@selection-change="handleSelectionChange" :span-method="arraySpanMethod">
<el-table-column prop="title" label="任务标题" align="left">
</el-table-column>
<el-table-column prop="name" label="客户名称" align="left">
</el-table-column>
<el-table-column label="紧要程度" prop="urgency" algin="left">
<template slot-scope="scope">
{{ scope.row.urgency}}
</template>
</el-table-column>
<el-table-column label="客户分类" prop="calssify" algin="left">
</el-table-column>
<el-table-column label="企业性质" prop="enterpriseNature" algin="left">
</el-table-column>
<el-table-column label="信用等级" prop="customerStarRating" algin="left">
<el-table-column prop="subjectBasicId" label="客户名称" align="left">
</el-table-column>
<el-table-column prop="responsible" label="负责人员" align="left">
</el-table-column>
<!-- <el-table-column prop="calssify" label="客户分类" align="left">
</el-table-column> -->
<el-table-column prop="calssify" label="客户分类" align="left">
<template slot-scope="scope">
<el-tag v-if="scope.row.calssify==1"></el-tag>
<el-tag v-if="scope.row.calssify==2"></el-tag>
</template>
</el-table-column>
<el-table-column prop="enterpriseNature" label="企业性质" align="left">
</el-table-column>
<el-table-column prop="customerStarRating" label="信用等级" align="left">
</el-table-column>
<el-table-column prop="startTime" label="开始时间" align="left">
</el-table-column>
<el-table-column prop="endTime" label="结束时间" align="left">
</el-table-column>
<el-table-column prop="subjectBasicId" label="关联客户" align="left">
<el-table-column label="紧要程度" prop="urgency" algin="left">
<template slot-scope="scope">
{{ scope.row.urgency}}
</template>
</el-table-column>
<el-table-column prop="responsible" label="负责人员" align="left">
<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>
<el-tag type="success" v-else-if="scope.row.flowState==2">审核通过</el-tag>
<el-tag type="danger" v-else-if="scope.row.flowState==3">审核驳回</el-tag>
<el-tag type="info" v-else-if="scope.row.flowState==4">流程撤回</el-tag>
<el-tag type="info" v-else-if="scope.row.flowState==5">审核终止</el-tag>
<el-tag type="warning" v-else></el-tag>
</template>
</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 type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1"
@click="editHandle(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 type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1"
@click="updateReportHandle(scope.row)" v-has="'btn_edit'">报告
</el-button>
<el-button type="text" v-has="'btn_detail'" @click="goDetail(scope.row.id)">
<el-button type="text" class="JNPF-table-delBtn" :disabled="[1,2,3,5].indexOf(scope.row.flowState)>-1"
v-has="'btn_remove'" @click="handleDel(scope.row.id)">删除
</el-button>
<el-button size="mini" type="text" :disabled="!scope.row.flowState"
@click="updateHandle(scope.row,scope.row.flowState)">详情</el-button>
</template>
</el-table-column>
</JNPF-table>
@ -89,6 +108,15 @@
<FlowBox v-if="flowVisible" ref="FlowBox" @close="colseFlow" />
<FlowReportBox v-if="FlowReportVisible" ref="FlowReportBox" @close="colseFlow" />
<el-dialog title="请选择流程" :close-on-click-modal="false" append-to-body :visible.sync="flowListVisible"
class="JNPF-dialog template-dialog JNPF-dialog_center" lock-scroll width="400px">
<el-scrollbar class="template-list">
<div class="template-item" v-for="item in flowList" :key="item.id" @click="selectFlow(item)">{{item.fullName}}
</div>
</el-scrollbar>
</el-dialog>
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
@ -105,8 +133,14 @@
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import JNPFForm from './form'
import Detail from './Detail'
import {
getFormById
} from '@/api/workFlow/FormDesign'
import {
getFlowList
} from '@/api/workFlow/FlowEngine'
import FlowBox from '@/views/workFlow/components/FlowBox'
import FlowReportBox from '@/views/workFlow/components/FlowReportBox'
import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import {
@ -130,8 +164,8 @@
export default {
components: {
JNPFForm,
Detail,
FlowBox,
FlowReportBox,
ExportBox,
ToFormDetail,
SuperQuery
@ -177,6 +211,7 @@
},
formVisible: false,
flowVisible: false,
FlowReportVisible:false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
@ -197,6 +232,17 @@
"label": "fullName",
"value": "id"
},
reportTypeOptions: [{
"fullName": "跟进报告",
"id": "1"
}, {
"fullName": "其他报告",
"id": "2"
}],
reportTypeProps: {
"label": "fullName",
"value": "id"
},
interfaceRes: {
subjectBasicId: [],
},
@ -209,9 +255,21 @@
}
},
created() {
this.getColumnList(),
this.initSearchDataAndListData()
this.queryData = JSON.parse(JSON.stringify(this.query))
getFormById("520958674882008389").then(res1 => {
let flowId = res1.data && res1.data.id
getFlowList(flowId, '1').then(res2 => {
this.flowList = res2.data
this.getColumnList(),
this.initSearchDataAndListData()
this.queryData = JSON.parse(JSON.stringify(this.query))
}).catch((e) => {
this.$message({
type: 'error',
message: e.message
});
this.$router.push('/404');
})
})
},
methods: {
toDetail(defaultValue, modelId) {
@ -476,12 +534,12 @@
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)
})
addOrUpdateHandle(row, flowState) {
if (!row) {
this.addHandle();
} else {
this.updateHandle(row, flowState)
}
},
exportData() {
this.exportBoxVisible = true
@ -514,6 +572,95 @@
this.listQuery.sidx = ""
this.initData()
},
updateReportHandle(row, flowState){
let data = {
id: row.id,
flowId: row.flowId || this.flowList[0].id,
opType: flowState ? 0 : '-1',
status: flowState,
report: 0
}
this.flowVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
editHandle(row, flowState) {
let data = {
id: row.id,
flowId: row.flowId || this.flowList[0].id,
opType: flowState ? 0 : '-1',
status: flowState
}
this.FlowReportVisible = true
this.$nextTick(() => {
this.$refs.FlowReportBox.init(data)
})
},
//
updateHandle(row, flowState) {
let data = {
id: row.id,
flowId: row.flowId || this.flowList[0].id,
opType: flowState ? 0 : '-1',
status: flowState
}
this.flowVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
toApprovalDetail(row) {
let data = {
id: row.id,
flowId: row.flowId,
opType: 0,
status: row.currentState
}
this.formVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
addHandle() {
if (!this.flowList.length) {
this.$message({
type: 'error',
message: '流程不存在'
});
} else if (this.flowList.length === 1) {
this.selectReportFlow(this.flowList[0])
} else {
this.flowListVisible = true
}
},
selectReportFlow(item) {
let data = {
id: '',
formType: 1,
flowId: item.id,
opType: '-1'
}
this.flowListVisible = false
this.FlowReportVisible = true
this.$nextTick(() => {
this.$refs.FlowReportBox.init(data)
})
},
//
selectFlow(item) {
let data = {
id: '',
formType: 1,
flowId: item.id,
opType: '-1'
}
this.flowListVisible = false
this.flowVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
@ -524,6 +671,7 @@
},
colseFlow(isrRefresh) {
this.flowVisible = false
this.FlowReportVisible = false
if (isrRefresh) this.reset()
},
}

@ -0,0 +1,538 @@
<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="24" v-if="judgeShow('title')">
<jnpf-form-tip-item label="任务标题" v-if="judgeShow('title')" prop="title">
<JnpfInput v-model="dataForm.title" @change="changeData('title',-1)" placeholder="请输入"
:disabled="judgeWrite('title')" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('startTime')">
<jnpf-form-tip-item label="开始时间" v-if="judgeShow('startTime')" prop="startTime">
<JnpfDatePicker v-model="dataForm.startTime" @change="changeData('startTime',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择"
:disabled="judgeWrite('startTime')" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('endTime')">
<jnpf-form-tip-item label="结束时间" v-if="judgeShow('endTime')" prop="endTime">
<JnpfDatePicker v-model="dataForm.endTime" @change="changeData('endTime',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择"
:disabled="judgeWrite('endTime')" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('subjectBasicId')">
<jnpf-form-tip-item label="关联客户" v-if="judgeShow('subjectBasicId')" prop="subjectBasicId">
<JnpfPopupSelect v-model="dataForm.subjectBasicId" @change="changeData('subjectBasicId',-1)"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.subjectBasicId" placeholder="请选择"
:disabled="judgeWrite('subjectBasicId')" propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='name' field='subjectBasicId' interfaceId="520962013808039429"
:pageSize="20" :columnOptions="subjectBasicIdcolumnOptions" clearable :style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('responsible')">
<jnpf-form-tip-item label="负责人员" v-if="judgeShow('responsible')" prop="responsible">
<JnpfUserSelect v-model="dataForm.responsible" @change="changeData('responsible',-1)" placeholder="请选择"
selectType="all" :ableIds="ableAll.responsibleableIds" :disabled="judgeWrite('responsible')" clearable
:style='{"width":"100%"}'>
</JnpfUserSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('partake')">
<jnpf-form-tip-item label="参与人员" v-if="judgeShow('partake')" prop="partake">
<JnpfUserSelect v-model="dataForm.partake" @change="changeData('partake',-1)" placeholder="请选择"
selectType="all" :ableIds="ableAll.partakeableIds" :disabled="judgeWrite('partake')" clearable
:style='{"width":"100%"}' :multiple="true">
</JnpfUserSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('urgency')">
<jnpf-form-tip-item label="紧要程度" v-if="judgeShow('urgency')" prop="urgency">
<JnpfSelect v-model="dataForm.urgency" @change="changeData('urgency',-1)" placeholder="请选择"
:disabled="judgeWrite('urgency')" clearable :style='{"width":"100%"}' :options="urgencyOptions"
:props="urgencyProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('description')">
<jnpf-form-tip-item label="任务描述" v-if="judgeShow('description')" prop="description">
<JnpfTextarea v-model="dataForm.description" @change="changeData('description',-1)" placeholder="请输入"
:disabled="judgeWrite('description')" :style='{"width":"100%"}' true type="textarea"
:autosize='{"minRows":4,"maxRows":4}'>
</JnpfTextarea>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('annex')">
<jnpf-form-tip-item label="附件" v-if="judgeShow('annex')" prop="annex">
<JnpfUploadFile v-model="dataForm.annex" @change="changeData('annex',-1)" :disabled="judgeWrite('annex')"
tipText="支持格式:.rar .zip .doc .docx .pdf 单个文件不能超过20MB" :fileSize="10" sizeUnit="MB" :limit="9"
pathType="defaultPath" :isAccount="0" buttonText="点击上传">
</JnpfUploadFile>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('reportType')">
<jnpf-form-tip-item label="报告类型" v-if="judgeShow('reportType')" prop="reportType">
<JnpfRadio v-model="dataForm.reportType" @change="changeData('reportType',-1)"
:disabled="judgeWrite('reportType')" optionType="button" direction="horizontal" size="medium"
:options="reportTypeOptions" :props="reportTypeProps">
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('reportDate')">
<jnpf-form-tip-item label="报告日期" v-if="judgeShow('reportDate')" prop="reportDate">
<JnpfDatePicker v-model="dataForm.reportDate" @change="changeData('reportDate',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择"
:disabled="true" clearable :style='{"width":"100%"}' type="date"
format="yyyy-MM-dd">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('followTimeStart')">
<jnpf-form-tip-item label="跟进日期" v-if="judgeShow('followTimeStart')">
<el-date-picker v-model="operationDate" type="daterange" start-placeholder=""
end-placeholder="结束日期" value-format="yyyy-MM-dd">
</el-date-picker>
<!-- <JnpfDatePicker v-model="dataForm.followTimeStart" @change="changeData('followTimeStart',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择"
:disabled="judgeWrite('followTimeStart')" clearable :style='{"width":"100%"}' type="date"
format="yyyy-MM-dd">
</JnpfDatePicker> -->
</jnpf-form-tip-item>
</el-col>
<!-- <el-col :span="24" v-if="judgeShow('followTimeEnd')">
<jnpf-form-tip-item label="跟进日期结束" v-if="judgeShow('followTimeEnd')" prop="followTimeEnd">
<JnpfDatePicker v-model="dataForm.followTimeEnd" @change="changeData('followTimeEnd',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择"
:disabled="judgeWrite('followTimeEnd')" clearable :style='{"width":"100%"}' type="date"
format="yyyy-MM-dd">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col> -->
<el-col :span="24" v-if="judgeShow('reportdescription')">
<jnpf-form-tip-item label="报告内容" v-if="judgeShow('reportdescription')" prop="reportdescription">
<JnpfEditor v-model="dataForm.reportdescription" @change="changeData('reportdescription',-1)"
placeholder="请输入" :disabled="judgeWrite('reportdescription')" :style='{"width":"100%"}'>
</JnpfEditor>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('reportannex')">
<jnpf-form-tip-item label="报告附件" v-if="judgeShow('reportannex')" prop="reportannex">
<JnpfUploadFile v-model="dataForm.reportannex" @change="changeData('reportannex',-1)"
:disabled="judgeWrite('reportannex')" tipText="支持格式:.rar .zip .doc .docx .pdf 单个文件不能超过20MB"
:fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0" buttonText="点击上传">
</JnpfUploadFile>
</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>
<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: {},
Vmodel: "",
currVmodel: "",
operationDate: [],
dataForm: {
title: undefined,
startTime: undefined,
endTime: undefined,
subjectBasicId: undefined,
responsible: undefined,
partake: [],
urgency: "4",
description: undefined,
annex: [],
reportType: "1",
reportDate: undefined,
followTimeStart: undefined,
followTimeEnd: undefined,
reportdescription: undefined,
reportannex: [],
},
tableRequiredData: {},
dataRule: {
title: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
startTime: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
endTime: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
subjectBasicId: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
reportDate: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
followTimeStart: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
followTimeEnd: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
reportdescription: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
},
subjectBasicIdcolumnOptions: [{
"label": "客户名称",
"value": "name"
}, ],
urgencyOptions: [{
"fullName": "重要",
"id": "1"
}, {
"fullName": "紧急",
"id": "2"
}, {
"fullName": "普通",
"id": "3"
}, {
"fullName": "较低",
"id": "4"
}],
urgencyProps: {
"label": "fullName",
"value": "id"
},
reportTypeOptions: [{
"fullName": "跟进报告",
"id": "1"
}/* , {
"fullName": "其他报告",
"id": "2"
} */],
reportTypeProps: {
"label": "fullName",
"value": "id"
},
childIndex: -1,
isEdit: false,
interfaceRes: {
title: [],
startTime: [],
endTime: [],
subjectBasicId: [],
responsible: [],
partake: [],
urgency: [],
description: [],
annex: [],
reportType: [],
reportDate: [],
followTimeStart: [],
followTimeEnd: [],
reportdescription: [],
reportannex: [],
},
}
},
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)
}
}
}
}
},
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() {},
selfGetInfo(dataForm) {
this.dataInfo(dataForm)
},
beforeSubmit() {
const _data = this.dataList()
return _data
},
selfInit() {
this.dataAll()
},
getFormById() {
getFormById("520958674882008389").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
}
}
}
}
}
}
return isOk
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
//
initDefaultData() {
this.dataForm.reportDate = new Date().getTime()
},
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() {
if (this.operationDate && this.operationDate.length) {
this.dataForm.followTimeStart = this.operationDate[0]
this.dataForm.followTimeEnd = this.operationDate[1]
} else {
this.followTimeStart = ''
this.followTimeEnd = ''
}
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.dataForm = _dataAll
this.operationDate = [];
if (this.dataForm.followTimeStart && this.dataForm.followTimeEnd) {
this.operationDate[0] = new Date(this.dataForm.followTimeStart)
this.operationDate[1] = new Date(this.dataForm.followTimeEnd)
}
this.isEdit = true
this.dataAll()
this.childIndex = -1
},
},
}
</script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,2 @@
const columnList = [{"clearable":true,"maxlength":null,"jnpfKey":"input","suffixIcon":"","fullName":"压款金额下限","label":"压款金额下限","sortable":false,"align":"left","addonAfter":"","__config__":{"formId":101,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"压款金额下限","trigger":"blur","showLabel":true,"required":true,"tableName":"jg_subject_settlement_rules","renderKey":1706514013986,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":8},"readonly":false,"prop":"underpaymentAmountDown","showWordLimit":false,"width":0,"__vModel__":"underpaymentAmountDown","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"underpaymentAmountDown","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"jnpfKey":"input","suffixIcon":"","fullName":"压款金额上限","label":"压款金额上限","sortable":false,"align":"left","addonAfter":"","__config__":{"formId":102,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"压款金额上限","trigger":"blur","showLabel":true,"required":true,"tableName":"jg_subject_settlement_rules","renderKey":1706514016369,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":8},"readonly":false,"prop":"underpaymentAmountUpper","showWordLimit":false,"width":0,"__vModel__":"underpaymentAmountUpper","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"underpaymentAmountUpper","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,484 @@
<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('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%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('underpaymentAmountUpper')">
<jnpf-form-tip-item label="压款金额上限" v-if="judgeShow('underpaymentAmountUpper')"
prop="underpaymentAmountUpper">
<JnpfInput v-model="dataForm.underpaymentAmountUpper" @change="changeData('underpaymentAmountUpper',-1)"
placeholder="请输入" :disabled="judgeWrite('underpaymentAmountUpper')" clearable :style='{"width":"100%"}'>
</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%"}'>
</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%"}'>
</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%"}'>
</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%"}'>
</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%"}'>
</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%"}'>
</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%"}'>
</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%"}'>
</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%"}'>
</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>
<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>
<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: {},
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,
marginRateDown: undefined,
marginRateUpper: undefined,
overdueMonthlyDown: undefined,
overdueMonthlyUpper: undefined,
},
tableRequiredData: {},
dataRule: {
underpaymentMethod: [{
required: true,
message: '请至少选择一个',
trigger: 'change'
}, ],
underpaymentAmountDown: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
underpaymentAmountUpper: [{
required: true,
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: [],
marginRateDown: [],
marginRateUpper: [],
overdueMonthlyDown: [],
overdueMonthlyUpper: [],
},
}
},
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)
}
}
}
}
},
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() {},
selfGetInfo(dataForm) {
this.dataInfo(dataForm)
},
beforeSubmit() {
const _data = this.dataList()
return _data
},
selfInit() {
this.dataAll()
},
getFormById() {
getFormById("521677714441116549").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
}
}
}
}
}
}
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
},
},
}
</script>

@ -0,0 +1,578 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="压款金额下限">
<el-input v-model="query.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>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button type="primary" icon="icon-ym icon-ym-btn-add" @click="addOrUpdateHandle()">
</el-button>
</div>
<div class="JNPF-common-head-right">
<el-tooltip content="高级查询" placement="top" v-if="true">
<el-link icon="icon-ym icon-ym-filter JNPF-common-head-icon" :underline="false"
@click="openSuperQuery()" />
</el-tooltip>
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="initData()" />
</el-tooltip>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' :span-method="arraySpanMethod">
<el-table-column prop="underpaymentAmountDown" label="压款金额下限" align="left">
</el-table-column>
<el-table-column prop="underpaymentAmountUpper" 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>
<el-tag type="success" v-else-if="scope.row.flowState==2">审核通过</el-tag>
<el-tag type="danger" v-else-if="scope.row.flowState==3">审核驳回</el-tag>
<el-tag type="info" v-else-if="scope.row.flowState==4">流程撤回</el-tag>
<el-tag type="info" v-else-if="scope.row.flowState==5">审核终止</el-tag>
<el-tag type="warning" v-else></el-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1"
@click="updateHandle(scope.row)">编辑
</el-button>
<el-button type="text" class="JNPF-table-delBtn" :disabled="[1,2,3,5].indexOf(scope.row.flowState)>-1"
@click="handleDel(scope.row.id)">删除
</el-button>
<el-button size="mini" type="text" :disabled="!scope.row.flowState"
@click="updateHandle(scope.row,scope.row.flowState)">详情</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" />
<FlowBox v-if="flowVisible" ref="FlowBox" @close="colseFlow" />
<el-dialog title="请选择流程" :close-on-click-modal="false" append-to-body :visible.sync="flowListVisible"
class="JNPF-dialog template-dialog JNPF-dialog_center" lock-scroll width="400px">
<el-scrollbar class="template-list">
<div class="template-item" v-for="item in flowList" :key="item.id" @click="selectFlow(item)">{{item.fullName}}
</div>
</el-scrollbar>
</el-dialog>
<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 {
getFormById
} from '@/api/workFlow/FormDesign'
import {
getFlowList
} from '@/api/workFlow/FlowEngine'
import FlowBox from '@/views/workFlow/components/FlowBox'
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: {
FlowBox,
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: {
underpaymentAmountDown: undefined,
underpaymentAmountUpper: undefined,
},
treeProps: {
children: 'children',
label: 'fullName',
value: 'id',
isLeaf: 'isLeaf'
},
list: [],
listLoading: true,
total: 0,
queryData: {},
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
formVisible: false,
flowVisible: false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
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: {},
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
getFormById("521677714441116549").then(res1 => {
let flowId = res1.data && res1.data.id
getFlowList(flowId, '1').then(res2 => {
this.flowList = res2.data
this.getColumnList(),
this.initSearchDataAndListData()
this.queryData = JSON.parse(JSON.stringify(this.query))
}).catch((e) => {
this.$message({
type: 'error',
message: e.message
});
this.$router.push('/404');
})
})
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.toFormDetailVisible = true
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue)
})
})
},
toggleTreeExpand(expands) {
this.refreshTree = false
this.expandsTree = expands
this.$nextTick(() => {
this.refreshTree = true
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null)
})
})
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data
const config = {
treeInterfaceId: "",
treeTemplateJson: []
}
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || ''
}
}
//
let query = {
paramList: config.treeTemplateJson || [],
}
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
})
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList)
},
transformColumnList(columnList) {
let list = []
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes('-')) {
list.push(e)
} else {
let prop = e.prop.split('-')[0]
let label = e.label.split('-')[0]
let vModel = e.prop.split('-')[1]
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
}
e.vModel = vModel
if (!this.expandObj.hasOwnProperty(`${prop}Expand`)) this.$set(this.expandObj, `${prop}Expand`, false)
if (!list.some(o => o.prop === prop)) list.push(newItem)
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e)
break
}
}
}
}
this.getMergeList(list)
this.getExportList(list)
return list
},
arraySpanMethod({
column
}) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list))
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + '-child-first'
}
item.children.unshift(child)
}
})
newList.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
})
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
})
}
})
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
})
}
})
},
getExportList(list) {
let exportList = []
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === 'table') {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j])
}
} else {
exportList.push(list[i])
}
}
this.exportList = exportList
},
goDetail(id) {
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(id)
})
},
sortChange({
column,
prop,
order
}) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
},
//
async initSearchData() {},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId: this.menuId,
moduleId: '521677714441116549',
type: 1,
};
request({
url: `/api/scm/SubjectSettlementRules/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/SubjectSettlementRules/${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/SubjectSettlementRules")
})
},
openSuperQuery() {
this.superQueryVisible = true
this.$nextTick(() => {
this.$refs.SuperQuery.init()
})
},
superQuery(queryJson) {
this.listQuery.superQueryJson = queryJson
this.listQuery.currentPage = 1
this.initData()
},
addOrUpdateHandle(row, flowState) {
if (!row) {
this.addHandle();
} else {
this.updateHandle(row, flowState)
}
},
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/SubjectSettlementRules/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()
},
//
updateHandle(row, flowState) {
let data = {
id: row.id,
flowId: row.flowId || this.flowList[0].id,
opType: flowState ? 0 : '-1',
status: flowState
}
this.flowVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
toApprovalDetail(row) {
let data = {
id: row.id,
flowId: row.flowId,
opType: 0,
status: row.currentState
}
this.formVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
addHandle() {
if (!this.flowList.length) {
this.$message({
type: 'error',
message: '流程不存在'
});
} else if (this.flowList.length === 1) {
this.selectFlow(this.flowList[0])
} else {
this.flowListVisible = true
}
},
//
selectFlow(item) {
let data = {
id: '',
formType: 1,
flowId: item.id,
opType: '-1'
}
this.flowListVisible = false
this.flowVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData))
this.search()
},
colseFlow(isrRefresh) {
this.flowVisible = false
if (isrRefresh) this.reset()
},
}
}
</script>

File diff suppressed because one or more lines are too long

@ -504,6 +504,9 @@ export default {
},
getBeforeInfo(data) {
FlowBeforeInfo(data.id || 0, { taskNodeId: data.taskNodeId, taskOperatorId: data.taskId, flowId: data.flowId }).then(res => {
if(res.data.flowFormInfo.urlAddress == 'extend/subjectfollowmanagement/form.vue'){
res.data.flowFormInfo.urlAddress = 'extend/subjectfollowmanagement/report.vue'
}
this.flowFormInfo = res.data.flowFormInfo
this.flowTaskInfo = res.data.flowTaskInfo || {}
this.flowTemplateInfo = res.data.flowTemplateInfo

Loading…
Cancel
Save