jg-waiwang-pro
胡川虎 3 months ago
parent 232a3ff431
commit 6a02ca4838

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

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

@ -0,0 +1,39 @@
package jnpf.service;
import jnpf.model.salecollection.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* Salecollection
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-25
*/
public interface SalecollectionService extends IService<SalecollectionEntity> {
List<SalecollectionEntity> getList(SalecollectionPagination salecollectionPagination);
List<SalecollectionEntity> getTypeList(SalecollectionPagination salecollectionPagination,String dataType);
SalecollectionEntity getInfo(String id);
void delete(SalecollectionEntity entity);
void create(SalecollectionEntity entity);
boolean update(String id, SalecollectionEntity entity);
//子表方法
List<SalecollectionsettlementEntity> getSalecollectionsettlementList(String id,SalecollectionPagination salecollectionPagination);
List<SalecollectionsettlementEntity> getSalecollectionsettlementList(String id);
//副表数据方法
String checkForm(SalecollectionForm form,int i);
void saveOrUpdate(SalecollectionForm salecollectionForm,String id, boolean isSave) throws Exception;
}

@ -0,0 +1,18 @@
package jnpf.service;
import jnpf.model.salecollection.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* Salecollection
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-25
*/
public interface SalecollectionsettlementService extends IService<SalecollectionsettlementEntity> {
QueryWrapper<SalecollectionsettlementEntity> getChild(SalecollectionPagination pagination,QueryWrapper<SalecollectionsettlementEntity> salecollectionsettlementQueryWrapper);
}

@ -502,6 +502,11 @@ public class CwsettlementServiceImpl extends ServiceImpl<CwsettlementMapper, Cws
cwsettlementNum++;
cwsettlementQueryWrapper.inSql("a.id", "SELECT settlement_id FROM jg_cw_settlement_subject WHERE subject_id = '" + cwsettlementPagination.getSubjectId() + "'");
}
if(ObjectUtil.isNotEmpty(cwsettlementPagination.getCustCode())){
cwsettlementNum++;
cwsettlementQueryWrapper.inSql("a.id", "SELECT settlement_id FROM jg_cw_settlement_subject WHERE subject_id in (SELECT id from jg_subject_basic where kucun_org_code = '"+ cwsettlementPagination.getOrgId() + "' AND code = '" + cwsettlementPagination.getCustCode() + "')");
}
if(ObjectUtil.isNotEmpty(cwsettlementPagination.getContractId())){
cwsettlementNum++;

@ -0,0 +1,456 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.SalecollectionMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.salecollection.*;
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;
/**
*
* Salecollection
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-25
*/
@Service
public class SalecollectionServiceImpl extends ServiceImpl<SalecollectionMapper, SalecollectionEntity> implements SalecollectionService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private SalecollectionsettlementService salecollectionsettlementService;
@Autowired
private CwsettlementService cwsettlementService;
@Override
public List<SalecollectionEntity> getList(SalecollectionPagination salecollectionPagination){
return getTypeList(salecollectionPagination,salecollectionPagination.getDataType());
}
/** 列表查询 */
@Override
public List<SalecollectionEntity> getTypeList(SalecollectionPagination salecollectionPagination,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 ? SalecollectionConstant.getAppColumnData() : SalecollectionConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int salecollectionNum =0;
QueryWrapper<SalecollectionEntity> salecollectionQueryWrapper=new QueryWrapper<>();
int salecollectionsettlementNum =0;
QueryWrapper<SalecollectionsettlementEntity> salecollectionsettlementQueryWrapper=new QueryWrapper<>();
long salecollectionsettlementcount = salecollectionsettlementService.count();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(salecollectionPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = salecollectionPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<SalecollectionEntity> salecollectionSuperWrapper = new QueryWrapper<>();
salecollectionSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(salecollectionSuperWrapper,SalecollectionEntity.class,queryJson,"0"));
int salecollectionNum1 = salecollectionSuperWrapper.getExpression().getNormal().size();
if (salecollectionNum1>0){
List<String> salecollectionList =this.list(salecollectionSuperWrapper).stream().map(SalecollectionEntity::getId).collect(Collectors.toList());
allSuperList.addAll(salecollectionList);
intersectionSuperList.add(salecollectionList);
superNum++;
}
String SalecollectionsettlementTable = "jg_cw_sale_collection_settlement";
boolean SalecollectionsettlementHasSql = queryJson.contains(SalecollectionsettlementTable);
List<String> salecollectionsettlementList = generaterSwapUtil.selectIdsByChildCondition(SalecollectionConstant.getTableList(), SalecollectionsettlementTable , queryJson, null);
if (SalecollectionsettlementHasSql){
allSuperList.addAll(salecollectionsettlementList);
intersectionSuperList.add(salecollectionsettlementList);
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<SalecollectionEntity> salecollectionSuperWrapper = new QueryWrapper<>();
salecollectionSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(salecollectionSuperWrapper,SalecollectionEntity.class,ruleJson,"0"));
int salecollectionNum1 = salecollectionSuperWrapper.getExpression().getNormal().size();
if (salecollectionNum1>0){
List<String> salecollectionList =this.list(salecollectionSuperWrapper).stream().map(SalecollectionEntity::getId).collect(Collectors.toList());
allRuleList.addAll(salecollectionList);
intersectionRuleList.add(salecollectionList);
ruleNum++;
}
String SalecollectionsettlementTable = "jg_cw_sale_collection_settlement";
boolean SalecollectionsettlementHasSql = ruleJson.contains(SalecollectionsettlementTable);
List<String> salecollectionsettlementList = generaterSwapUtil.selectIdsByChildCondition(SalecollectionConstant.getTableList(), SalecollectionsettlementTable , ruleJson, null);
if (SalecollectionsettlementHasSql){
allRuleList.addAll(salecollectionsettlementList);
intersectionRuleList.add(salecollectionsettlementList);
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 salecollectionObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(salecollectionQueryWrapper,SalecollectionEntity.class,salecollectionPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(salecollectionObj)){
return new ArrayList<>();
} else {
salecollectionQueryWrapper = (QueryWrapper<SalecollectionEntity>)salecollectionObj;
if( salecollectionQueryWrapper.getExpression().getNormal().size()>0){
salecollectionNum++;
}
}
Object salecollectionsettlementObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(salecollectionsettlementQueryWrapper,SalecollectionsettlementEntity.class,salecollectionPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(salecollectionsettlementObj)){
return new ArrayList<>();
} else {
salecollectionsettlementQueryWrapper = (QueryWrapper<SalecollectionsettlementEntity>)salecollectionsettlementObj;
if( salecollectionsettlementQueryWrapper.getExpression().getNormal().size()>0){
salecollectionsettlementNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object salecollectionObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(salecollectionQueryWrapper,SalecollectionEntity.class,salecollectionPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(salecollectionObj)){
return new ArrayList<>();
} else {
salecollectionQueryWrapper = (QueryWrapper<SalecollectionEntity>)salecollectionObj;
if( salecollectionQueryWrapper.getExpression().getNormal().size()>0){
salecollectionNum++;
}
}
Object salecollectionsettlementObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(salecollectionsettlementQueryWrapper,SalecollectionsettlementEntity.class,salecollectionPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(salecollectionsettlementObj)){
return new ArrayList<>();
} else {
salecollectionsettlementQueryWrapper = (QueryWrapper<SalecollectionsettlementEntity>)salecollectionsettlementObj;
if( salecollectionsettlementQueryWrapper.getExpression().getNormal().size()>0){
salecollectionsettlementNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(salecollectionPagination.getPrepaymentDt())){
salecollectionNum++;
List PrepaymentDtList = JsonUtil.getJsonToList(salecollectionPagination.getPrepaymentDt(),String.class);
Long fir = Long.valueOf(String.valueOf(PrepaymentDtList.get(0)));
Long sec = Long.valueOf(String.valueOf(PrepaymentDtList.get(1)));
salecollectionQueryWrapper.lambda().ge(SalecollectionEntity::getPrepaymentDt, new Date(fir))
.le(SalecollectionEntity::getPrepaymentDt, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
}
if(ObjectUtil.isNotEmpty(salecollectionPagination.getCustName())){
salecollectionNum++;
String value = salecollectionPagination.getCustName() instanceof List ?
JsonUtil.getObjectToString(salecollectionPagination.getCustName()) :
String.valueOf(salecollectionPagination.getCustName());
salecollectionQueryWrapper.lambda().like(SalecollectionEntity::getCustName,value);
}
if(ObjectUtil.isNotEmpty(salecollectionPagination.getSettlementState())){
salecollectionNum++;
List<String> idList = new ArrayList<>();
try {
String[][] settlementState = JsonUtil.getJsonToBean(salecollectionPagination.getSettlementState(),String[][].class);
for(int i=0;i<settlementState.length;i++){
if(settlementState[i].length>0){
idList.add(JsonUtil.getObjectToString(Arrays.asList(settlementState[i])));
}
}
}catch (Exception e1){
try {
List<String> settlementState = JsonUtil.getJsonToList(salecollectionPagination.getSettlementState(),String.class);
if(settlementState.size()>0){
idList.addAll(settlementState);
}
}catch (Exception e2){
idList.add(String.valueOf(salecollectionPagination.getSettlementState()));
}
}
salecollectionQueryWrapper.lambda().and(t->{
idList.forEach(tt->{
t.like(SalecollectionEntity::getSettlementState, tt).or();
});
});
}
}
if(salecollectionsettlementNum>0){
List<String> salecollectionsettlementIdList = salecollectionsettlementService.list(salecollectionsettlementQueryWrapper).stream().filter(t->StringUtil.isNotEmpty(t.getSaleCollectionId())).map(t->t.getSaleCollectionId()).collect(Collectors.toList());
long count = salecollectionsettlementService.count();
if (count>0){
intersectionList.add(salecollectionsettlementIdList);
}
AllIdList.addAll(salecollectionsettlementIdList);
}
total+=salecollectionsettlementNum;
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
salecollectionQueryWrapper.lambda().in(SalecollectionEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
salecollectionQueryWrapper.lambda().and(t->t.in(SalecollectionEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
salecollectionQueryWrapper.lambda().and(t->t.in(SalecollectionEntity::getId, finalAllRuleIDlist));
}
//假删除标志
salecollectionQueryWrapper.lambda().isNull(SalecollectionEntity::getDeleteMark);
//排序
if(StringUtil.isEmpty(salecollectionPagination.getSidx())){
salecollectionQueryWrapper.lambda().orderByDesc(SalecollectionEntity::getId);
}else{
try {
String sidx = salecollectionPagination.getSidx();
String[] strs= sidx.split("_name");
SalecollectionEntity salecollectionEntity = new SalecollectionEntity();
Field declaredField = salecollectionEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
salecollectionQueryWrapper="asc".equals(salecollectionPagination.getSort().toLowerCase())?salecollectionQueryWrapper.orderByAsc(value):salecollectionQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<SalecollectionEntity> page=new Page<>(salecollectionPagination.getCurrentPage(), salecollectionPagination.getPageSize());
IPage<SalecollectionEntity> userIPage=this.page(page, salecollectionQueryWrapper);
return salecollectionPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<SalecollectionEntity> list = new ArrayList();
return salecollectionPagination.setData(list, list.size());
}
}else{
return this.list(salecollectionQueryWrapper);
}
}
@Override
public SalecollectionEntity getInfo(String id){
QueryWrapper<SalecollectionEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(SalecollectionEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(SalecollectionEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, SalecollectionEntity entity){
return this.updateById(entity);
}
@Override
public void delete(SalecollectionEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** Salecollectionsettlement子表方法 */
@Override
public List<SalecollectionsettlementEntity> getSalecollectionsettlementList(String id,SalecollectionPagination salecollectionPagination){
Map<String, Object> newtabMap=SalecollectionConstant.TABLEFIELDKEY.entrySet()
.stream().collect( Collectors.toMap(e->e.getValue(),e->e.getKey()));
String tableName="salecollectionsettlement";
tableName=newtabMap.get(tableName)==null?tableName:newtabMap.get(tableName).toString();
QueryWrapper<SalecollectionsettlementEntity> queryWrapper = new QueryWrapper<>();
queryWrapper = salecollectionsettlementService.getChild(salecollectionPagination,queryWrapper);
queryWrapper.lambda().eq(SalecollectionsettlementEntity::getSaleCollectionId, id);
generaterSwapUtil.wrapperHandle(SalecollectionConstant.getColumnData(), SalecollectionConstant.getAppColumnData(), queryWrapper,SalecollectionsettlementEntity.class,"sub",tableName);
return salecollectionsettlementService.list(queryWrapper);
}
/** Salecollectionsettlement子表方法 */
@Override
public List<SalecollectionsettlementEntity> getSalecollectionsettlementList(String id){
QueryWrapper<SalecollectionsettlementEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(SalecollectionsettlementEntity::getSaleCollectionId, id);
return salecollectionsettlementService.list(queryWrapper);
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(SalecollectionForm 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.getPrepaymentNo())){
return "收款单号不能为空";
}
if(StringUtil.isEmpty(form.getCustCode())){
return "客户编码不能为空";
}
if(StringUtil.isEmpty(form.getCustName())){
return "客户名称不能为空";
}
if(StringUtil.isEmpty(form.getPrepaymentAmt())){
return "收款金额不能为空";
}
//子表字段验证
if (form.getSalecollectionsettlementList()!=null){
for(SalecollectionsettlementModel t : form.getSalecollectionsettlementList()){
if(StringUtil.isNotEmpty(t.getDistributionAmount())){
t.setDistributionAmount(t.getDistributionAmount().trim());
}
if(StringUtil.isNotEmpty(t.getDistributionAmount())){
if(!Pattern.compile("^([1-9][\\d]*|0)(\\.[\\d]+)?$").matcher(String.valueOf(t.getDistributionAmount())).matches()){
return "请输入正确的金额";
}
}
}
}
return countRecover;
}
/**
* ()
* @param id
* @param salecollectionForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(SalecollectionForm salecollectionForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
salecollectionForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(SalecollectionConstant.getFormData(),salecollectionForm),SalecollectionForm.class);
SalecollectionEntity entity = JsonUtil.getJsonToBean(salecollectionForm, SalecollectionEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setId(mainId);
entity.setVersion(0);
}else{
}
entity.setDistributionUserId(userInfo.getUserId());
entity.setDistributionTime(new Date());
entity.setSettlementState("3");
this.saveOrUpdate(entity);
//Salecollectionsettlement子表数据新增修改
if(!isSave){
QueryWrapper<SalecollectionsettlementEntity> SalecollectionsettlementqueryWrapper = new QueryWrapper<>();
SalecollectionsettlementqueryWrapper.lambda().eq(SalecollectionsettlementEntity::getSaleCollectionId, entity.getId());
List<SalecollectionsettlementEntity> salecollectionsettlementEntityList = salecollectionsettlementService.list(SalecollectionsettlementqueryWrapper);
for (SalecollectionsettlementEntity salecollectionsettlementEntity : salecollectionsettlementEntityList) {
//更新结算单表
CwsettlementEntity cwsettlementEntity = cwsettlementService.getById(salecollectionsettlementEntity.getSettlementId());
cwsettlementEntity.setApplyAmount(cwsettlementEntity.getApplyAmount().subtract(salecollectionsettlementEntity.getDistributionAmount()));
if(cwsettlementEntity.getApplyAmount().compareTo(new BigDecimal("0")) == 0){
cwsettlementEntity.setApplyState("未申请");
}else{
cwsettlementEntity.setApplyState("部分申请");
}
cwsettlementService.updateById(cwsettlementEntity);
}
salecollectionsettlementService.remove(SalecollectionsettlementqueryWrapper);
}
if (salecollectionForm.getSalecollectionsettlementList()!=null){
List<SalecollectionsettlementEntity> tableField108 = JsonUtil.getJsonToList(salecollectionForm.getSalecollectionsettlementList(),SalecollectionsettlementEntity.class);
for(SalecollectionsettlementEntity entitys : tableField108){
entitys.setId(RandomUtil.uuId());
entitys.setSaleCollectionId(entity.getId());
if(isSave){
}else{
}
salecollectionsettlementService.saveOrUpdate(entitys);
//更新结算单表
CwsettlementEntity cwsettlementEntity = cwsettlementService.getById(entitys.getSettlementId());
cwsettlementEntity.setApplyAmount(cwsettlementEntity.getApplyAmount().add(entitys.getDistributionAmount()));
if(cwsettlementEntity.getApplyAmount().compareTo(cwsettlementEntity.getSettlableAmount()) < 0){
cwsettlementEntity.setApplyState("部分申请");
}else if(cwsettlementEntity.getApplyAmount().compareTo(cwsettlementEntity.getSettlableAmount()) >= 0){
cwsettlementEntity.setApplyState("已申请");
}else{
cwsettlementEntity.setApplyState("未申请");
}
cwsettlementService.updateById(cwsettlementEntity);
}
}
}
}

@ -0,0 +1,59 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.SalecollectionsettlementMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.salecollection.*;
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 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;
/**
*
* Salecollection
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-25
*/
@Service
public class SalecollectionsettlementServiceImpl extends ServiceImpl<SalecollectionsettlementMapper, SalecollectionsettlementEntity> implements SalecollectionsettlementService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
//子表过滤方法
@Override
public QueryWrapper<SalecollectionsettlementEntity> getChild(SalecollectionPagination pagination, QueryWrapper<SalecollectionsettlementEntity> salecollectionsettlementQueryWrapper){
boolean pcPermission = true;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String ruleQueryJson = isPc?SalecollectionConstant.getColumnData():SalecollectionConstant.getAppColumnData();
ColumnDataModel dataModel = JsonUtil.getJsonToBean(ruleQueryJson,ColumnDataModel.class);
String ruleJson = isPc?JsonUtil.getObjectToString(dataModel.getRuleList()):JsonUtil.getObjectToString(dataModel.getRuleListApp());
if(isPc){
}
return salecollectionsettlementQueryWrapper;
}
}

@ -1,18 +1,23 @@
package jnpf.controller;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
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.model.yunguan.BFSPaymentOccupationModel;
import jnpf.permission.entity.OrganizeEntity;
import jnpf.permission.entity.UserEntity;
import jnpf.permission.service.OrganizeService;
import jnpf.permission.service.UserService;
import jnpf.service.*;
import jnpf.entity.*;
import jnpf.util.*;
import jnpf.model.paymentapplication.*;
import jnpf.util.wxutil.HttpUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -20,6 +25,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
@ -33,6 +39,11 @@ import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.transaction.annotation.Transactional;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
/**
* PaymentApplication
* @ V3.5
@ -62,7 +73,8 @@ public class PaymentApplicationController {
private SubjectbasicService subjectbasicService;
@Autowired
private UserService userService;
@Autowired
private OrganizeService organizeService;
/**
*
*
@ -254,10 +266,55 @@ public class PaymentApplicationController {
@GetMapping("uploadBFS/{id}")
@Transactional
public ActionResult closeCase(@PathVariable("id") String id){
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
PaymentApplicationEntity entity= paymentApplicationService.getInfo(id);
BFSPaymentOccupationModel bfsPaymentOccupationModel = new BFSPaymentOccupationModel();
bfsPaymentOccupationModel.setSerialNoErp(entity.getId());//流水号
bfsPaymentOccupationModel.setBillNo(entity.getCode());
bfsPaymentOccupationModel.setApplyDate(simpleDateFormat.format(entity.getCreatorTime()));
bfsPaymentOccupationModel.setAmt(entity.getApplyAmount().toString());
bfsPaymentOccupationModel.setCur("CYN");
bfsPaymentOccupationModel.setAbs("");//摘要
bfsPaymentOccupationModel.setPayerAccName(entity.getPayer());
bfsPaymentOccupationModel.setPayeeAccNo(entity.getPayeeAccount());
bfsPaymentOccupationModel.setPayeeAccName(entity.getPayee());//收款方户名
bfsPaymentOccupationModel.setPayeeBank(entity.getBankName());//收款方开户行
bfsPaymentOccupationModel.setPayeeCode(entity.getInterbankNumber());
bfsPaymentOccupationModel.setPayeeProv(entity.getProvince());
bfsPaymentOccupationModel.setPayeeCity(entity.getCity());
bfsPaymentOccupationModel.setCorpName(entity.getUnitName());
if(StringUtil.isNotEmpty(entity.getUnitName())){
List<OrganizeEntity> o = organizeService.getListByFullName(entity.getUnitName());
if(o != null && o.size() > 0){
bfsPaymentOccupationModel.setCorpCode(o.get(0).getEnCode());
}
}
bfsPaymentOccupationModel.setPurpose(entity.getPurpose());
bfsPaymentOccupationModel.setWishPayDay(simpleDateFormat.format(entity.getExpectPaymentDate()));
bfsPaymentOccupationModel.setItemCode(entity.getPlanSubjectCode());
bfsPaymentOccupationModel.setItemName(entity.getPlanSubjectName());
bfsPaymentOccupationModel.setBudgetDetailId(entity.getFundingPlanDetailCode());
bfsPaymentOccupationModel.setUrgencyFlag("0");//加急标志
bfsPaymentOccupationModel.setVoucherType(entity.getTransactionType());//交易类型34网银外付网银、50票据应收票据
bfsPaymentOccupationModel.setIsforindividual("0");//对公对私字段
bfsPaymentOccupationModel.setRmk("");
bfsPaymentOccupationModel.setDataSource("");//数据来源
JSONObject code = HttpUtil.httpRequest("http://172.16.173.160:8081/t2/rest/JgPaymentOccupationRestful", "POST", JsonUtil.getObjectToString(bfsPaymentOccupationModel));
if (ObjectUtil.isNotEmpty(code)){
if (code.get("status").equals("1")) {
entity.setBfsFlag("2");
entity.setBfsMessage("上传BFS成功");
entity.setBfsMessage(code.get("message").toString());
paymentApplicationService.updateById(entity);
}else{
entity.setBfsFlag("1");
entity.setBfsMessage(code.get("message").toString());
paymentApplicationService.updateById(entity);
}
}else{
entity.setBfsFlag("1");
entity.setBfsMessage("资金系统接口调用失败");
paymentApplicationService.updateById(entity);
}
return ActionResult.success("上传BFS成功");
}
@ -316,4 +373,162 @@ public class PaymentApplicationController {
public void downloadPdf(HttpServletResponse response, @PathVariable("id") String id, @PathVariable("token")String token) throws IOException {
paymentApplicationService.getPaymentDocPdf(id);
}
/**
*
*
* @return
*/
@Operation(summary = "调用资金系统视图获取开户行")
@PostMapping("/getBankList")
public ActionResult getBankList()
{
Connection con = null;// 创建一个数据库连接
PreparedStatement pre = null;// 创建预编译语句对象一般都是用这个而不用Statement
ResultSet result = null;// 创建一个结果集对象
List<PaymentApplicationEntity> list = new ArrayList<>();
PaymentApplicationEntity paymentApplicationEntity = new PaymentApplicationEntity();
paymentApplicationEntity.setInterbankNumber("kaihu001");
paymentApplicationEntity.setBankName("勋业路支行");
paymentApplicationEntity.setProvince("上海市");
paymentApplicationEntity.setCity("青浦区");
list.add(paymentApplicationEntity);
/*try
{
Class.forName("oracle.jdbc.driver.OracleDriver");// 加载Oracle驱动程序
System.out.println("开始尝试连接数据库!");
String url = "jdbc:oracle:thin:@172.16.173.160:61522:orcl";// 127.0.0.1是本机地址XE是精简版Oracle的默认数据库名
String user = "jgtest202407191";// 用户名,系统默认的账户名
String password = "jgtest202407191";// 你安装时选设置的密码
con = DriverManager.getConnection(url, user, password);// 获取连接
System.out.println("连接成功!");
String sql = "select * from JG_VIEW_INPUT_BANK_INFO";// 预编译语句,“?”代表参数; v_user其实是一个视图
pre = con.prepareStatement(sql);// 实例化预编译语句
//pre.setString(1, "张三");// 设置参数前面的1表示参数的索引而不是表中列名的索引
result = pre.executeQuery();// 执行查询,注意括号中不需要再加参数
System.out.println(result);
PaymentApplicationEntity paymentApplicationEntity = new PaymentApplicationEntity();
while (result.next())
// 当结果集不为空时
paymentApplicationEntity = new PaymentApplicationEntity();
paymentApplicationEntity.setInterbankNumber(result.getString("SYS_BANK_CODE"));
paymentApplicationEntity.setBankName(result.getString("BANK_NAME"));
paymentApplicationEntity.setProvince(result.getString("PROV_NAME"));
paymentApplicationEntity.setCity(result.getString("CITY_NAME"));
list.add(paymentApplicationEntity);
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
try
{
// 逐一将上面的几个对象关闭,因为不关闭的话会影响性能、并且占用资源
// 注意关闭的顺序,最后使用的最先关闭
if (result != null)
result.close();
if (pre != null)
pre.close();
if (con != null)
con.close();
System.out.println("数据库连接已关闭!");
}
catch (Exception e)
{
e.printStackTrace();
}
}*/
//返回对象
return ActionResult.success(list);
}
/**
*
*
* @return
*/
@Operation(summary = "调用资金计划数据视图")
@PostMapping("/getPlanList")
public ActionResult getPlanList()
{
Connection con = null;// 创建一个数据库连接
PreparedStatement pre = null;// 创建预编译语句对象一般都是用这个而不用Statement
ResultSet result = null;// 创建一个结果集对象
List<PaymentApplicationEntity> list = new ArrayList<>();
PaymentApplicationEntity paymentApplicationEntity = new PaymentApplicationEntity();
paymentApplicationEntity.setFundingPlanDetailCode("codedetail1111");
paymentApplicationEntity.setFundingPlanCode("code1111");
paymentApplicationEntity.setUnitName("单位1");
paymentApplicationEntity.setPlanSubjectCode("subject1");
paymentApplicationEntity.setPlanSubjectName("科目一");
paymentApplicationEntity.setCollectionUnitName("上海长江电气");
paymentApplicationEntity.setReportingAmount(new BigDecimal("800"));
paymentApplicationEntity.setAddAmount(new BigDecimal("700"));
paymentApplicationEntity.setUpwardFloatingAmount(new BigDecimal("600"));
paymentApplicationEntity.setProcessMoney(new BigDecimal("400"));
paymentApplicationEntity.setPlanAvailableAmount(new BigDecimal("500"));
paymentApplicationEntity.setPurpose("用于装修");
paymentApplicationEntity.setExpectPaymentDate(new Date());
list.add(paymentApplicationEntity);
/*try
{
Class.forName("oracle.jdbc.driver.OracleDriver");// 加载Oracle驱动程序
System.out.println("开始尝试连接数据库!");
String url = "jdbc:oracle:thin:@172.16.173.160:61522:orcl";// 127.0.0.1是本机地址XE是精简版Oracle的默认数据库名
String user = "jgtest202407191";// 用户名,系统默认的账户名
String password = "jgtest202407191";// 你安装时选设置的密码
con = DriverManager.getConnection(url, user, password);// 获取连接
System.out.println("连接成功!");
String sql = "select * from JG_VIEW_BUDGET_DETAIL_WEEK";// 预编译语句,“?”代表参数; v_user其实是一个视图
pre = con.prepareStatement(sql);// 实例化预编译语句
//pre.setString(1, "张三");// 设置参数前面的1表示参数的索引而不是表中列名的索引
result = pre.executeQuery();// 执行查询,注意括号中不需要再加参数
System.out.println(result);
PaymentApplicationEntity paymentApplicationEntity = new PaymentApplicationEntity();
while (result.next())
// 当结果集不为空时
paymentApplicationEntity = new PaymentApplicationEntity();
paymentApplicationEntity.setFundingPlanDetailCode(result.getString("DETAIL_ID"));
paymentApplicationEntity.setFundingPlanCode(result.getString("BUDGET_ID"));
paymentApplicationEntity.setUnitName(result.getString("CORP_NAME"));
paymentApplicationEntity.setPlanSubjectCode(result.getString("ITEM_CODE"));
paymentApplicationEntity.setPlanSubjectName(result.getString("ITEM_NAME"));
paymentApplicationEntity.setCollectionUnitName(result.getString("PAYEE_ACC_NAME"));
paymentApplicationEntity.setReportingAmount(result.getBigDecimal("B_MONEY"));
paymentApplicationEntity.setAddAmount(result.getBigDecimal("BSUPER_MONEY"));
paymentApplicationEntity.setUpwardFloatingAmount(result.getBigDecimal("OVER_MONEY"));
paymentApplicationEntity.setProcessMoney(result.getBigDecimal("PROCESS_MONEY"));
paymentApplicationEntity.setPlanAvailableAmount(result.getBigDecimal("AVAILABLE_BALANCE"));
paymentApplicationEntity.setPurpose(result.getString("PURPOSE"));
paymentApplicationEntity.setExpectPaymentDate(result.getDate("WISH_PAYDAY"));
list.add(paymentApplicationEntity);
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
try
{
// 逐一将上面的几个对象关闭,因为不关闭的话会影响性能、并且占用资源
// 注意关闭的顺序,最后使用的最先关闭
if (result != null)
result.close();
if (pre != null)
pre.close();
if (con != null)
con.close();
System.out.println("数据库连接已关闭!");
}
catch (Exception e)
{
e.printStackTrace();
}
}*/
//返回对象
return ActionResult.success(list);
}
}

@ -0,0 +1,389 @@
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.salecollection.*;
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;
/**
* Salecollection
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-25
*/
@Slf4j
@RestController
@Tag(name = "Salecollection" , description = "scm")
@RequestMapping("/api/scm/Salecollection")
public class SalecollectionController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private SalecollectionService salecollectionService;
@Autowired
private SalecollectionsettlementService salecollectionsettlementService;
@Autowired
private ConfigValueUtil configValueUtil;
/**
*
*
* @param salecollectionPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody SalecollectionPagination salecollectionPagination)throws IOException{
List<SalecollectionEntity> list= salecollectionService.getList(salecollectionPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (SalecollectionEntity entity : list) {
Map<String, Object> salecollectionMap=JsonUtil.entityToMap(entity);
salecollectionMap.put("id", salecollectionMap.get("id"));
//副表数据
//子表数据
List<SalecollectionsettlementEntity> salecollectionsettlementList = salecollectionService.getSalecollectionsettlementList(entity.getId(),salecollectionPagination);
salecollectionMap.put("tableField108",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(salecollectionsettlementList)));
realList.add(salecollectionMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, SalecollectionConstant.getFormData(), SalecollectionConstant.getColumnData(), salecollectionPagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(salecollectionPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param salecollectionForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid SalecollectionForm salecollectionForm) {
String b = salecollectionService.checkForm(salecollectionForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
salecollectionService.saveOrUpdate(salecollectionForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
* Excel
*
* @return
*/
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody SalecollectionPagination salecollectionPagination) throws IOException {
if (StringUtil.isEmpty(salecollectionPagination.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
List<SalecollectionEntity> list= salecollectionService.getList(salecollectionPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (SalecollectionEntity entity : list) {
Map<String, Object> salecollectionMap=JsonUtil.entityToMap(entity);
salecollectionMap.put("id", salecollectionMap.get("id"));
//副表数据
//子表数据
List<SalecollectionsettlementEntity> salecollectionsettlementList = salecollectionService.getSalecollectionsettlementList(entity.getId(),salecollectionPagination);
salecollectionMap.put("tableField108",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(salecollectionsettlementList)));
realList.add(salecollectionMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, SalecollectionConstant.getFormData(), SalecollectionConstant.getColumnData(), salecollectionPagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(salecollectionPagination.getSelectKey())?salecollectionPagination.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){
ExcelExportEntity tableField108ExcelEntity = new ExcelExportEntity("结算单信息","tableField108");
List<ExcelExportEntity> tableField108List = new ArrayList<>();
for(String key:keys){
switch(key){
case "prepaymentNo" :
entitys.add(new ExcelExportEntity("收款单号" ,"prepaymentNo"));
break;
case "custCode" :
entitys.add(new ExcelExportEntity("客户编码" ,"custCode"));
break;
case "custName" :
entitys.add(new ExcelExportEntity("客户名称" ,"custName"));
break;
case "prepaymentDt" :
entitys.add(new ExcelExportEntity("收款时间" ,"prepaymentDt"));
break;
case "prepaymentAmt" :
entitys.add(new ExcelExportEntity("收款金额" ,"prepaymentAmt"));
break;
case "settlementState" :
entitys.add(new ExcelExportEntity("分配状态" ,"settlementState"));
break;
case "distributionUserId" :
entitys.add(new ExcelExportEntity("分配人" ,"distributionUserId"));
break;
case "distributionTime" :
entitys.add(new ExcelExportEntity("分配时间" ,"distributionTime"));
break;
case "currencyCd" :
entitys.add(new ExcelExportEntity("币种" ,"currencyCd"));
break;
case "exchgRat" :
entitys.add(new ExcelExportEntity("汇率" ,"exchgRat"));
break;
case "tableField108-settlementCode":
tableField108List.add(new ExcelExportEntity("结算单编号" ,"settlementCode"));
break;
case "tableField108-settlementSubjectName":
tableField108List.add(new ExcelExportEntity("结算主体名称" ,"settlementSubjectName"));
break;
case "tableField108-settlementSum":
tableField108List.add(new ExcelExportEntity("结算数量" ,"settlementSum"));
break;
case "tableField108-settlableAmount":
tableField108List.add(new ExcelExportEntity("可结金额" ,"settlableAmount"));
break;
case "tableField108-type":
tableField108List.add(new ExcelExportEntity("结算类型" ,"type"));
break;
case "tableField108-contractCode":
tableField108List.add(new ExcelExportEntity("合同号" ,"contractCode"));
break;
case "tableField108-applyAmount":
tableField108List.add(new ExcelExportEntity("已申请金额" ,"applyAmount"));
break;
case "tableField108-assignableAmount":
tableField108List.add(new ExcelExportEntity("可分配金额" ,"assignableAmount"));
break;
case "tableField108-distributionAmount":
tableField108List.add(new ExcelExportEntity("分配金额" ,"distributionAmount"));
break;
default:
break;
}
}
if(tableField108List.size() > 0){
tableField108ExcelEntity.setList(tableField108List);
entitys.add(tableField108ExcelEntity);
}
}
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(SalecollectionConstant.getColumnData(), ColumnDataModel.class);
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList);
}
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList);
}
String fileName = "表单信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
String temporaryFilePath = configValueUtil.getTemporaryFilePath();
FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName);
vo.setName(fileInfo.getFilename());
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName);
} catch (Exception e) {
log.error("信息导出Excel错误:{}", e.getMessage());
e.printStackTrace();
}
return vo;
}
/**
*
* @param id
* @param salecollectionForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid SalecollectionForm salecollectionForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
salecollectionForm.setId(id);
if (!isImport) {
String b = salecollectionService.checkForm(salecollectionForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
SalecollectionEntity entity= salecollectionService.getInfo(id);
if(entity!=null){
try{
salecollectionService.saveOrUpdate(salecollectionForm,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){
SalecollectionEntity entity= salecollectionService.getInfo(id);
if(entity!=null){
//假删除
entity.setDeleteMark(1);
salecollectionService.update(id,entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
SalecollectionEntity entity= salecollectionService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> salecollectionMap=JsonUtil.entityToMap(entity);
salecollectionMap.put("id", salecollectionMap.get("id"));
//副表数据
//子表数据
List<SalecollectionsettlementEntity> salecollectionsettlementList = salecollectionService.getSalecollectionsettlementList(entity.getId());
salecollectionMap.put("tableField108",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(salecollectionsettlementList)));
salecollectionMap = generaterSwapUtil.swapDataDetail(salecollectionMap,SalecollectionConstant.getFormData(),"585785277943938629",false);
return ActionResult.success(salecollectionMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
SalecollectionEntity entity= salecollectionService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> salecollectionMap=JsonUtil.entityToMap(entity);
salecollectionMap.put("id", salecollectionMap.get("id"));
//副表数据
//子表数据
List<SalecollectionsettlementEntity> salecollectionsettlementList = salecollectionService.getSalecollectionsettlementList(entity.getId());
salecollectionMap.put("salecollectionsettlementList",JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(salecollectionsettlementList)));
salecollectionMap = generaterSwapUtil.swapDataForm(salecollectionMap,SalecollectionConstant.getFormData(),SalecollectionConstant.TABLEFIELDKEY,SalecollectionConstant.TABLERENAMES);
return ActionResult.success(salecollectionMap);
}
}

@ -133,4 +133,10 @@ public class PaymentApplicationEntity {
@TableField(exist = false)
private String currUserName;
@TableField(value = "process_money" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal processMoney;
@TableField(value = "funding_plan_detail_code" , updateStrategy = FieldStrategy.IGNORED)
private String fundingPlanDetailCode;
}

@ -0,0 +1,138 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-25
*/
@Data
@TableName("jg_cw_sale_collection")
public class SalecollectionEntity {
@TableId(value ="ID" )
private String id;
@TableField("COMP_CD")
private String compCd;
@TableField("ORG_ID")
private String orgId;
@TableField("DEPARTMENT_CD")
private String departmentCd;
@TableField(value = "PREPAYMENT_NO" , updateStrategy = FieldStrategy.IGNORED)
private String prepaymentNo;
@TableField("PREPAYMENT_STS")
private String prepaymentSts;
@TableField(value = "CUST_CODE" , updateStrategy = FieldStrategy.IGNORED)
private String custCode;
@TableField(value = "CUST_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String custName;
@TableField(value = "PREPAYMENT_AMT" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal prepaymentAmt;
@TableField(value = "CURRENCY_CD" , updateStrategy = FieldStrategy.IGNORED)
private String currencyCd;
@TableField(value = "EXCHG_RAT" , updateStrategy = FieldStrategy.IGNORED)
private String exchgRat;
@TableField("TAX_RATE")
private BigDecimal taxRate;
@TableField(value = "PREPAYMENT_DT" , updateStrategy = FieldStrategy.IGNORED)
private Date prepaymentDt;
@TableField("BILL_NOTE_NO")
private String billNoteNo;
@TableField("COLLECTION_TY")
private String collectionTy;
@TableField("REMARKS")
private String remarks;
@TableField("CREATE_EMP_ID")
private String createEmpId;
@TableField("CREATE_DTM")
private Date createDtm;
@TableField("MODIFY_EMP_ID")
private String modifyEmpId;
@TableField("MODIFY_DTM")
private Date modifyDtm;
@TableField("CANCLE_YN")
private String cancleYn;
@TableField("CANCLE_EMP_ID")
private String cancleEmpId;
@TableField("CANCLE_DTM")
private Date cancleDtm;
@TableField("PREP_ID")
private Integer prepId;
@TableField("SPARE_AMT")
private BigDecimal spareAmt;
@TableField("PREP_DISTRIBUTE_SIGN")
private String prepDistributeSign;
@TableField("RECEIPT_MTH")
private String receiptMth;
@TableField("ATTRIBUTE1")
private String attribute1;
@TableField("ATTRIBUTE3")
private String attribute3;
@TableField("ASN_USER_NM")
private String asnUserNm;
@TableField("ASN_DT")
private Date asnDt;
@TableField("APPROVE_STS")
private String approveSts;
@TableField("MANUAL_FLAG")
private String manualFlag;
@TableField("WRITE_OFF_FLAG")
private String writeOfflag;
@TableField("WRITE_OFF_NO")
private String writeOfno;
@TableField("WRITE_OFF_USER_NM")
private String writeOfuserNm;
@TableField("WRITE_OFF_DT")
private Date writeOfdt;
@TableField("READ_FLAG")
private String readFlag;
@TableField("READ_TIME")
private Date readTime;
@TableField("ERR_MESSAGE")
private String errMessage;
@TableField("ESB_STATUS")
private String esbStatus;
@TableField("ESB_DTM")
private Date esbDtm;
@TableField("ESB_MESSAGE")
private String esbMessage;
@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;
@TableField("F_VERSION")
private Integer version;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("ORGANIZE_JSON_ID")
private String organizeJsonId;
@TableField(value = "SETTLEMENT_STATE" , updateStrategy = FieldStrategy.IGNORED)
private String settlementState;
@TableField(value = "DISTRIBUTION_USER_ID" , updateStrategy = FieldStrategy.IGNORED)
private String distributionUserId;
@TableField(value = "DISTRIBUTION_TIME" , updateStrategy = FieldStrategy.IGNORED)
private Date distributionTime;
}

@ -0,0 +1,89 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-25
*/
@Data
@TableName("jg_cw_sale_collection_settlement")
public class SalecollectionsettlementEntity {
@TableId(value ="ID" )
private String id;
@TableField("SALE_COLLECTION_ID")
private String saleCollectionId;
@TableField("SALE_COLLECTION_CODE")
private String saleCollectionCode;
@TableField("SETTLEMENT_ID")
private String settlementId;
@TableField(value = "SETTLEMENT_CODE" , updateStrategy = FieldStrategy.IGNORED)
private String settlementCode;
@TableField("SETTLEMENT_AMOUNT")
private BigDecimal settlementAmount;
@TableField("ORDER_CODE")
private String orderCode;
@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;
@TableField("F_VERSION")
private Integer version;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("ORGANIZE_JSON_ID")
private String organizeJsonId;
@TableField("F_FLOW_TASK_ID")
private String flowTaskId;
@TableField(value = "SETTLEMENT_SUBJECT_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String settlementSubjectName;
@TableField(value = "SETTLEMENT_SUM" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal settlementSum;
@TableField(value = "CONTRACT_CODE" , updateStrategy = FieldStrategy.IGNORED)
private String contractCode;
@TableField(value = "SETTLABLE_AMOUNT" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal settlableAmount;
@TableField("PAYABLE_AMOUNT")
private BigDecimal payableAmount;
@TableField(value = "TYPE" , updateStrategy = FieldStrategy.IGNORED)
private String type;
@TableField(value = "APPLY_AMOUNT" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal applyAmount;
@TableField(value = "ASSIGNABLE_AMOUNT" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal assignableAmount;
@TableField(value = "DISTRIBUTION_AMOUNT" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal distributionAmount;
@TableField("APPLY_STATE")
private String applyState;
@TableField("INVOICE_AMOUNT")
private BigDecimal invoiceAmount;
}

@ -60,4 +60,10 @@ public class CwsettlementPagination extends Pagination {
private Object contractNo;
@JsonProperty("applyState")
private String applyState;
@JsonProperty("custCode")
private Object custCode;
@JsonProperty("orgId")
private String orgId;
}

@ -96,4 +96,7 @@ public class PaymentApplicationForm {
private String docState;
private String settlementState;
private BigDecimal processMoney;
private String fundingPlanDetailCode;
}

@ -0,0 +1,56 @@
package jnpf.model.salecollection;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Salecollection
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-25
*/
@Data
public class SalecollectionForm {
/** 主键 */
private String id;
/** 子表数据 **/
@JsonProperty("salecollectionsettlementList")
private List<SalecollectionsettlementModel> salecollectionsettlementList;
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
/** 收款单号 **/
@JsonProperty("prepaymentNo")
private String prepaymentNo;
/** 客户编码 **/
@JsonProperty("custCode")
private String custCode;
/** 客户名称 **/
@JsonProperty("custName")
private String custName;
/** 收款时间 **/
@JsonProperty("prepaymentDt")
private String prepaymentDt;
/** 收款金额 **/
@JsonProperty("prepaymentAmt")
private String prepaymentAmt;
/** 分配状态 **/
@JsonProperty("settlementState")
private Object settlementState;
/** 分配人 **/
@JsonProperty("distributionUserId")
private String distributionUserId;
/** 分配时间 **/
@JsonProperty("distributionTime")
private String distributionTime;
/** 币种 **/
@JsonProperty("currencyCd")
private String currencyCd;
/** 汇率 **/
@JsonProperty("exchgRat")
private String exchgRat;
}

@ -0,0 +1,39 @@
package jnpf.model.salecollection;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* Salecollection
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-25
*/
@Data
public class SalecollectionPagination 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("prepaymentDt")
private Object prepaymentDt;
/** 客户名称 */
@JsonProperty("custName")
private Object custName;
/** 分配状态 */
@JsonProperty("settlementState")
private Object settlementState;
}

@ -0,0 +1,57 @@
package jnpf.model.salecollection;
import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
* Salecollection
* V3.5
* : https://www.jnpfsoft.com
* JNPF
* 2024-07-25
*/
@Data
public class SalecollectionsettlementModel {
/** 结算单编号 **/
@JSONField(name = "settlementCode")
private String settlementCode;
/** 结算主体名称 **/
@JSONField(name = "settlementSubjectName")
private String settlementSubjectName;
/** 结算数量 **/
@JSONField(name = "settlementSum")
private String settlementSum;
/** 可结金额 **/
@JSONField(name = "settlableAmount")
private String settlableAmount;
/** 结算类型 **/
@JSONField(name = "type")
private String type;
/** 合同号 **/
@JSONField(name = "contractCode")
private String contractCode;
/** 已申请金额 **/
@JSONField(name = "applyAmount")
private String applyAmount;
/** 可分配金额 **/
@JSONField(name = "assignableAmount")
private String assignableAmount;
/** 分配金额 **/
@JSONField(name = "distributionAmount")
private String distributionAmount;
@JSONField(name = "settlementId")
private String settlementId;
@JSONField(name = "saleCollectionCode")
private String saleCollectionCode;
@JSONField(name = "saleCollectionId")
private String saleCollectionId;
}

@ -0,0 +1,87 @@
package jnpf.model.yunguan;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class BFSPaymentOccupationModel {
/** 流水号 **/
@JSONField(name = "serialNoErp")
private String serialNoErp;
/** 付款申请编号 **/
@JSONField(name = "billNo")
private String billNo;
/** 申请支付日期 **/
@JSONField(name = "applyDate")
private String applyDate;
/** 交易金额 **/
@JSONField(name = "amt")
private String amt;
/** 币别 **/
@JSONField(name = "cur")
private String cur;
/** 摘要 **/
@JSONField(name = "abs")
private String abs;
/** 付款方名称 **/
@JSONField(name = "payerAccName")
private String payerAccName;
/** 收款方账号 **/
@JSONField(name = "payeeAccNo")
private String payeeAccNo;
/** 收款方户名 **/
@JSONField(name = "payeeAccName")
private String payeeAccName;
/** 收款方开户行 **/
@JSONField(name = "payeeBank")
private String payeeBank;
/** 收方联行号 **/
@JSONField(name = "payeeCode")
private String payeeCode;
/** 收方账号省份 **/
@JSONField(name = "payeeProv")
private String payeeProv;
/** 收方账号城市 **/
@JSONField(name = "payeeCity")
private String payeeCity;
/** 计划单位代码 **/
@JSONField(name = "corpCode")
private String corpCode;
/** 计划单位名称 **/
@JSONField(name = "corpName")
private String corpName;
/** 资金计划用途 **/
@JSONField(name = "purpose")
private String purpose;
/** 资金计划期望支付日期 **/
@JSONField(name = "wishPayDay")
private String wishPayDay;
/** 资金计划科目名称 **/
@JSONField(name = "itemName")
private String itemName;
/** 资金计划科目编码 **/
@JSONField(name = "itemCode")
private String itemCode;
/** 资金计划明细id **/
@JSONField(name = "budgetDetailId")
private String budgetDetailId;
/** 加急标志 **/
@JSONField(name = "urgencyFlag")
private String urgencyFlag;
/** 交易类型 **/
@JSONField(name = "voucherType")
private String voucherType;
/** 对公对私字段 **/
@JSONField(name = "isforindividual")
private String isforindividual;
/** 付款说明 **/
@JSONField(name = "rmk")
private String rmk;
/** 数据来源 **/
@JSONField(name = "dataSource")
private String dataSource;
}

@ -37,7 +37,7 @@
</el-col>
<el-col :span="8" v-if="judgeShow('contractId')">
<jnpf-form-tip-item label="合同" v-if="judgeShow('contractId')" prop="contractId">
<JnpfPopupSelect v-model="dataForm.contractId" @change="changeData('contractId',-1)" :rowIndex="null"
<JnpfPopupSelect v-model="dataForm.contractId" @change="contractChangeData" :rowIndex="null"
:formData="dataForm" :templateJson="interfaceRes.contractId" placeholder="请选择"
:disabled="judgeWrite('contractId')" hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='contract_name' field='contractId' interfaceId="545203391626777029"
@ -54,8 +54,8 @@
</el-col>
<el-col :span="8" v-if="judgeShow('payee')">
<jnpf-form-tip-item label="收款方账号" v-if="judgeShow('payee')" prop="payee">
<JnpfInput v-model="dataForm.payeeAccount" @change="changeData('payee',-1)" placeholder="请输入"
:disabled="true" clearable :style='{"width":"100%"}'>
<JnpfInput v-model="dataForm.payeeAccount" @change="changeData('payee',-1)" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
@ -157,9 +157,16 @@
</el-col>
<el-col :span="8" v-if="judgeShow('payer')">
<jnpf-form-tip-item label="联行号" v-if="judgeShow('payer')">
<JnpfInput v-model="dataForm.interbankNumber" @change="changeData('payer',-1)" placeholder="请输入"
<!-- <JnpfInput v-model="dataForm.interbankNumber" @change="changeData('payer',-1)" placeholder="请输入"
:disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</JnpfInput> -->
<JnpfPopupSelect v-model="dataForm.interbankNumber" @change="interbankNumberChangeData"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.interbankNumber" placeholder="请选择"
propsValue="interbankNumber" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='interbankNumber' field='interbankNumber' interfaceId="587612474379903877" :pageSize="20"
:columnOptions="interbankNumbercolumnOptions" clearable :style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('payer')">
@ -185,9 +192,16 @@
</el-col>
<el-col :span="8" v-if="judgeShow('payer')">
<jnpf-form-tip-item label="资金计划编码" v-if="judgeShow('payer')">
<JnpfInput v-model="dataForm.fundingPlanCode" @change="changeData('payer',-1)" placeholder="请输入"
<!-- <JnpfInput v-model="dataForm.fundingPlanCode" @change="changeData('payer',-1)" placeholder="请输入"
:disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</JnpfInput> -->
<JnpfPopupSelect v-model="dataForm.fundingPlanCode" @change="fundingPlanCodeChangeData"
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.fundingPlanCode" placeholder="请选择"
propsValue="fundingPlanCode" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='fundingPlanCode' field='fundingPlanCode' interfaceId="587614540221424581" :pageSize="20"
:columnOptions="fundingPlanCodecolumnOptions" clearable :style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('payer')">
@ -208,14 +222,14 @@
<jnpf-form-tip-item label="期望支付日期" v-if="judgeShow('payer')">
<JnpfDatePicker v-model="dataForm.expectPaymentDate" @change="changeData('payer', -1)"
:startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')" placeholder="请选择"
:disabled="judgeWrite('payer')" clearable :style='{ "width": "100%" }' format="yyyy-MM-dd">
:disabled="true" clearable :style='{ "width": "100%" }' format="yyyy-MM-dd">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('applyAmount')">
<jnpf-form-tip-item label="上报金额" v-if="judgeShow('applyAmount')">
<JnpfInputNumber v-model="dataForm.reportingAmount" @change="changeData('applyAmount',-1)"
placeholder="数字文本" :disabled="judgeWrite('applyAmount')" isAmountChinese :step="1">
placeholder="数字文本" :disabled="true" :step="1">
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
@ -250,21 +264,28 @@
<el-col :span="8" v-if="judgeShow('applyAmount')">
<jnpf-form-tip-item label="计划可用金额" v-if="judgeShow('applyAmount')">
<JnpfInputNumber v-model="dataForm.planAvailableAmount" @change="changeData('applyAmount',-1)"
placeholder="数字文本" :disabled="judgeWrite('applyAmount')" isAmountChinese :step="1">
placeholder="数字文本" :disabled="true" :step="1">
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('applyAmount')">
<jnpf-form-tip-item label="计划已用总金额" v-if="judgeShow('applyAmount')">
<JnpfInputNumber v-model="dataForm.processMoney" @change="changeData('applyAmount',-1)"
placeholder="数字文本" :disabled="true" :step="1">
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('applyAmount')">
<jnpf-form-tip-item label="追加金额" v-if="judgeShow('applyAmount')">
<JnpfInputNumber v-model="dataForm.addAmount" @change="changeData('applyAmount',-1)" placeholder="数字文本"
:disabled="judgeWrite('applyAmount')" isAmountChinese :step="1">
:disabled="true" :step="1">
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('applyAmount')">
<jnpf-form-tip-item label="上浮总金额" v-if="judgeShow('applyAmount')">
<JnpfInputNumber v-model="dataForm.upwardFloatingAmount" @change="changeData('applyAmount',-1)"
placeholder="数字文本" :disabled="judgeWrite('applyAmount')" isAmountChinese :step="1">
placeholder="数字文本" :disabled="true" :step="1">
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
@ -294,43 +315,36 @@
</JnpfInput>
</template>
</el-table-column> -->
<el-table-column label="结算单编号"
prop="settlementCode">
<el-table-column label="结算单编号" prop="settlementCode">
<template slot="header">
<span class="required-sign">*</span>结算单编号
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.settlementCode"
@change="changeData('paymentapplicationsettlement-settlementCode',scope.$index)" placeholder="请输入"
:disabled="true"
clearable :style='{"width":"100%"}'>
:disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="结算金额"
prop="settlementAmount">
<el-table-column label="结算金额" prop="settlementAmount">
<template slot="header">
<span class="required-sign">*</span>结算金额
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.settlementAmount"
@change="changeData('paymentapplicationsettlement-settlementAmount',scope.$index)"
placeholder="请输入"
:disabled="true"
addonAfter="元" clearable :style='{"width":"100%"}'>
placeholder="请输入" :disabled="true" addonAfter="元" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="订单编号"
prop="orderCode">
<el-table-column label="订单编号" prop="orderCode">
<template slot="header">
<span class="required-sign">*</span>订单编号
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.orderCode"
@change="changeData('paymentapplicationsettlement-orderCode',scope.$index)" placeholder="请输入"
:disabled="true"
clearable :style='{"width":"100%"}'>
:disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
@ -341,7 +355,7 @@
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addpaymentapplicationsettlementList()" >
<div class="table-actions" @click="addpaymentapplicationsettlementList()">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</jnpf-form-tip-item>
@ -392,10 +406,14 @@
import settlementList from '@/views/extend/paymentapplication/settlementList'
export default {
mixins: [comMixin],
components: {settlementList},
components: {
settlementList
},
props: [],
data() {
return {
is_long_agreement: undefined,
total_amount: undefined,
BFSShow: false,
goodsBoxVisible: false,
dataFormSubmitType: 0,
@ -475,6 +493,8 @@
reportingAmount: undefined,
planSubjectCode: undefined,
planSubjectName: undefined,
fundingPlanDetailCode: undefined,
processMoney: undefined,
collectionUnitName: undefined,
purpose: undefined,
planAvailableAmount: undefined,
@ -527,6 +547,56 @@
"label": "fullName",
"value": "id"
},
interbankNumbercolumnOptions: [{
"label": "联行号",
"value": "interbankNumber"
}, {
"label": "银行开户行名称",
"value": "bankName"
}, {
"label": "开户行所在省",
"value": "province"
}, {
"label": "开户行所在市",
"value": "city"
}, ],
fundingPlanCodecolumnOptions: [{
"label": "计划主ID",
"value": "fundingPlanCode"
}, {
"label": "计划所属单位名称",
"value": "unitName"
}, {
"label": "计划科目名",
"value": "planSubjectName"
}, {
"label": "计划科目编码",
"value": "planSubjectCode"
}, {
"label": "收款单位/人名称",
"value": "collectionUnitName"
}, {
"label": "上报金额",
"value": "reportingAmount"
}, {
"label": "追加金额",
"value": "addAmount"
}, {
"label": "上浮总金额",
"value": "upwardFloatingAmount"
}, {
"label": "计划已用总金额",
"value": "processMoney"
}, {
"label": "计划可用金额",
"value": "planAvailableAmount"
}, {
"label": "用途",
"value": "purpose"
}, {
"label": "期望支付日期",
"value": "expectPaymentDate"
}, ],
subjectIdcolumnOptions: [{
"label": "名称",
"value": "name"
@ -601,11 +671,11 @@
"value": "id"
},
transactionTypeOptions: [{
"fullName": "离线转账",
"id": "1"
"fullName": "网银",
"id": "34"
}, {
"fullName": "在线支付",
"id": "2"
"fullName": "票据",
"id": "50"
}],
transactionTypeProps: {
"label": "fullName",
@ -643,6 +713,8 @@
remark: [],
closeCaseRemark: [],
annex: [],
interbankNumber: [],
fundingPlanCode:[] ,
paymentapplicationsettlementsettlementId: [],
paymentapplicationsettlementsettlementCode: [],
paymentapplicationsettlementsettlementAmount: [],
@ -667,6 +739,29 @@
},
mounted() {},
methods: {
fundingPlanCodeChangeData(var1, var2){
this.dataForm.planSubjectCode = var2.planSubjectCode;
this.dataForm.planSubjectName = var2.planSubjectName;
this.dataForm.unitName = var2.unitName;
this.dataForm.fundingPlanDetailCode = var2.fundingPlanDetailCode;
this.dataForm.collectionUnitName = var2.collectionUnitName;
this.dataForm.reportingAmount = var2.reportingAmount;
this.dataForm.addAmount = var2.addAmount;
this.dataForm.upwardFloatingAmount = var2.upwardFloatingAmount;
this.dataForm.processMoney = var2.processMoney;
this.dataForm.planAvailableAmount = var2.planAvailableAmount;
this.dataForm.purpose = var2.purpose;
this.dataForm.expectPaymentDate = var2.expectPaymentDate;
},
interbankNumberChangeData(var1, var2){
this.dataForm.bankName = var2.bankName;
this.dataForm.province = var2.province;
this.dataForm.city = var2.city;
},
contractChangeData(var1, var2) {
this.is_long_agreement = var2.is_long_agreement;
this.total_amount = var2.total_amount;
},
initList(list) {
for (let i = 0; i < list.length; i++) {
let e = {};
@ -738,6 +833,7 @@
})
},
exist() {
debugger
let isOk = true
for (let key in this.tableRequiredData) {
if (this.dataForm[key] && Array.isArray(this.dataForm[key])) {
@ -769,6 +865,15 @@
}
}
if (!this.paymentapplicationsettlementExist()) return
if (this.is_long_agreement && this.total_amount && this.is_long_agreement == 1 && this.dataForm.applyAmount >
this.total_amount) {
this.$message({
message: '非长协合同付款申请总数不能超过合同总额',
type: 'error',
duration: 1000
})
return false
}
return isOk
},
paymentapplicationsettlementExist() {
@ -785,8 +890,7 @@
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
//
initDefaultData() {
},
initDefaultData() {},
addpaymentapplicationsettlementList() {
this.goodsBoxVisible = true
let excludeIdList = [];
@ -899,7 +1003,7 @@
return _data;
},
dataInfo(dataAll) {
if(this.setting.uploadBFS){
if (this.setting.uploadBFS) {
this.BFSShow = true
}
let _dataAll = dataAll

@ -157,7 +157,8 @@
<el-button size="mini" type="text" :disabled="!scope.row.flowState"
@click="updateHandle(scope.row,scope.row.flowState)">详情</el-button>
<el-button size="mini" type="text" @click="downPayment(scope.row.id)"></el-button>
<el-button type="text" @click="closeCaseHandle(scope.row)" v-has="'btn_edit'">
<!-- <el-button type="text" @click="closeCaseHandle(scope.row)" v-has="'btn_edit'">
</el-button> -->
<el-button type="text" v-if="scope.row.tableField113.length > 0 && scope.row.bfsFlag == 1" @click="uploadBFSHandle(scope.row.id)" v-has="'btn_edit'">BFS
</el-button>
<el-button type="text" @click="settlementHandle(scope.row)" v-has="'btn_edit'">

@ -108,6 +108,7 @@ export default {
contractId: this.contractId,
applyState: '未申请,部分申请',
dataType: 0,
type: 1,
menuId: '532534180186188741',
queryFlowTaskPass: '1'//
}

@ -0,0 +1,194 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
<div class="JNPF-common-page-header">
<el-page-header @back="goBack"
content="详情"/>
<div class="options">
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="8" >
<jnpf-form-tip-item label="收款单号"
prop="prepaymentNo" >
<p>{{dataForm.prepaymentNo}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="客户编码"
prop="custCode" >
<p>{{dataForm.custCode}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="客户名称"
prop="custName" >
<p>{{dataForm.custName}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="收款时间"
prop="prepaymentDt" >
<p>{{dataForm.prepaymentDt}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="收款金额"
prop="prepaymentAmt" >
<p>{{dataForm.prepaymentAmt}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" >
<jnpf-form-tip-item label="分配状态"
prop="settlementState" >
<p>{{ dataForm.settlementState }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2>结算单信息</h2>
</div>
<el-table :data="dataForm.tableField108" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="settlementCode" label="结算单编号" >
<template slot-scope="scope">
<p>{{scope.row.settlementCode}}</p>
</template>
</el-table-column>
<el-table-column prop="settlementSubjectName" label="结算主体名称" >
<template slot-scope="scope">
<p>{{scope.row.settlementSubjectName}}</p>
</template>
</el-table-column>
<el-table-column prop="settlementSum" label="结算数量" >
<template slot-scope="scope">
<p>{{scope.row.settlementSum}}</p>
</template>
</el-table-column>
<el-table-column prop="settlableAmount" label="可结金额" >
<template slot-scope="scope">
<p>{{scope.row.settlableAmount}}</p>
</template>
</el-table-column>
<el-table-column prop="type" label="结算类型" >
<template slot-scope="scope">
<p>{{scope.row.type}}</p>
</template>
</el-table-column>
<el-table-column prop="contractCode" label="合同号" >
<template slot-scope="scope">
<p>{{scope.row.contractCode}}</p>
</template>
</el-table-column>
<el-table-column prop="applyAmount" label="已申请金额" >
<template slot-scope="scope">
<p>{{scope.row.applyAmount}}</p>
</template>
</el-table-column>
<el-table-column prop="assignableAmount" label="可分配金额" >
<template slot-scope="scope">
<p>{{scope.row.assignableAmount}}</p>
</template>
</el-table-column>
<el-table-column prop="distributionAmount" label="分配金额" >
<template slot-scope="scope">
<p>{{scope.row.distributionAmount}}</p>
</template>
</el-table-column>
</el-table>
</jnpf-form-tip-item>
</el-col>
</template>
</el-form>
</el-row>
</div>
</transition>
</template>
<script>
import request from '@/utils/request'
import { getConfigData } from '@/api/onlineDev/visualDev'
import jnpf from '@/utils/jnpf'
import Detail from '@/views/basic/dynamicModel/list/detail'
import { thousandsFormat } from "@/components/Generator/utils/index"
export default {
components: { Detail},
props: [],
data() {
return {
visible: false,
detailVisible: false,
loading: false,
dataForm: {
id :'',
prepaymentNo : '',
custCode : '',
custName : '',
prepaymentDt : '',
prepaymentAmt : '',
settlementState : "1",
distributionUserId : '',
distributionTime : '',
currencyCd : '',
exchgRat : '',
salecollectionsettlementList:[],
},
settlementStateOptions:[{"fullName":"未分配","id":"1"},{"fullName":"部分分配","id":"2"},{"fullName":"已分配","id":"3"}],
settlementStateProps:{"label":"fullName","value":"id" },
}
},
computed: {},
watch: {},
created() {
},
mounted() {},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(formData, modelId, defaultValue)
})
})
},
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
},
goBack() {
this.$emit('refresh')
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/scm/Salecollection/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,758 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<div class="JNPF-common-page-header">
<el-page-header @back="goBack" :content="!dataForm.id ? '关联结算单':'关联结算单'" />
<div class="options">
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading" :disabled='continueBtnLoading'>
</el-button>
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
label-position="right">
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="8">
<jnpf-form-tip-item label="收款单号" prop="prepaymentNo">
<JnpfInput v-model="dataForm.prepaymentNo" @change="changeData('prepaymentNo',-1)" placeholder="请输入"
readonly clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="客户编码" prop="custCode">
<JnpfInput v-model="dataForm.custCode" @change="changeData('custCode',-1)" placeholder="请输入" readonly
clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="客户名称" prop="custName">
<JnpfInput v-model="dataForm.custName" @change="changeData('custName',-1)" placeholder="请输入" readonly
clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="收款时间" prop="prepaymentDt">
<JnpfDatePicker v-model="dataForm.prepaymentDt" @change="changeData('prepaymentDt',-1)"
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择" readonly
clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="收款金额" prop="prepaymentAmt">
<JnpfInput v-model="dataForm.prepaymentAmt" @change="changeData('prepaymentAmt',-1)" placeholder="请输入"
readonly clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="分配状态" prop="settlementState">
<JnpfSelect v-model="dataForm.settlementState" @change="changeData('settlementState',-1)"
placeholder="请选择" disabled clearable :style='{"width":"100%"}' :options="settlementStateOptions"
:props="settlementStateProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2>结算单信息</h2>
</div>
<el-table :data="dataForm.salecollectionsettlementList" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column label="结算单编号" prop="settlementCode">
<template slot="header" v-if="false">
<span class="required-sign">*</span>结算单编号
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.settlementCode"
@change="changeData('salecollectionsettlement-settlementCode',scope.$index)" placeholder="请输入"
readonly clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="结算主体名称" prop="settlementSubjectName">
<template slot="header" v-if="false">
<span class="required-sign">*</span>结算主体名称
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.settlementSubjectName"
@change="changeData('salecollectionsettlement-settlementSubjectName',scope.$index)"
placeholder="请输入" readonly clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="结算数量" prop="settlementSum">
<template slot="header" v-if="false">
<span class="required-sign">*</span>结算数量
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.settlementSum"
@change="changeData('salecollectionsettlement-settlementSum',scope.$index)" placeholder="请输入"
readonly clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="可结金额" prop="settlableAmount">
<template slot="header" v-if="false">
<span class="required-sign">*</span>可结金额
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.settlableAmount"
@change="changeData('salecollectionsettlement-settlableAmount',scope.$index)" placeholder="请输入"
readonly clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="结算类型" prop="type">
<template slot="header" v-if="false">
<span class="required-sign">*</span>结算类型
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.type"
@change="changeData('salecollectionsettlement-type',scope.$index)" placeholder="请输入" readonly
clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="合同号" prop="contractCode">
<template slot="header" v-if="false">
<span class="required-sign">*</span>合同号
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.contractCode"
@change="changeData('salecollectionsettlement-contractCode',scope.$index)" placeholder="请输入"
readonly clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="已申请金额" prop="applyAmount">
<template slot="header" v-if="false">
<span class="required-sign">*</span>已申请金额
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.applyAmount"
@change="changeData('salecollectionsettlement-applyAmount',scope.$index)" placeholder="请输入"
readonly clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="可分配金额" prop="assignableAmount">
<template slot="header" v-if="false">
<span class="required-sign">*</span>可分配金额
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.assignableAmount"
@change="changeData('salecollectionsettlement-assignableAmount',scope.$index)" placeholder="请输入"
readonly clearable :style='{"width":"100%"}'>
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="分配金额" prop="distributionAmount">
<template slot="header" v-if="false">
<span class="required-sign">*</span>分配金额
</template>
<template slot-scope="scope">
<JnpfInputNumber v-model="scope.row.distributionAmount" placeholder="请输入"
clearable :style='{"width":"100%"}' :max="Number(scope.row.assignableAmount)" :min=0 :disabled='continueBtnLoading'>
</JnpfInputNumber>
</template>
</el-table-column>
<el-table-column label="操作" width="50">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delsalecollectionsettlementList(scope.$index)" :disabled='continueBtnLoading'>删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions">
<el-button type="text" icon="el-icon-plus" @click="addsalecollectionsettlementList()" :disabled='continueBtnLoading'>添加</el-button>
</div>
</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>
<settlementList v-if="goodsBoxVisible" ref="goodsBox" @refreshDataList="initList" />
</div>
</transition>
</template>
<script>
import request from '@/utils/request'
import {
mapGetters
} from "vuex";
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import {
getDefaultCurrentValueUserId
} from '@/api/permission/user'
import {
getDefaultCurrentValueDepartmentId
} from '@/api/permission/organize'
import {
getDateDay,
getLaterData,
getBeforeData,
getBeforeTime,
getLaterTime
} from '@/components/Generator/utils/index.js'
import {
thousandsFormat
} from "@/components/Generator/utils/index"
import settlementList from '@/views/extend/salecollection/settlementList'
export default {
components: {settlementList},
props: [],
data() {
return {
goodsBoxVisible: false,
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: {
salecollectionsettlementList: {
"popupType": "dialog",
"hasPage": true,
"popupTitle": "选择数据",
"pageSize": 20,
"columnOptions": [],
"interfaceId": "",
"interfaceName": "",
"relationOptions": [],
"templateJson": [],
"popupWidth": "800px"
},
},
//
ableAll: {},
tableRows: {
salecollectionsettlementList: {
settlementCode: '',
settlementCodeOptions: [],
settlementSubjectName: '',
settlementSubjectNameOptions: [],
settlementSum: '',
settlementSumOptions: [],
settlableAmount: '',
settlableAmountOptions: [],
type: '',
typeOptions: [],
contractCode: '',
contractCodeOptions: [],
applyAmount: '',
applyAmountOptions: [],
assignableAmount: '',
assignableAmountOptions: [],
distributionAmount: '',
distributionAmountOptions: [],
enabledmark: undefined
},
},
Vmodel: "",
currVmodel: "",
dataForm: {
prepaymentNo: undefined,
custCode: undefined,
custName: undefined,
prepaymentDt: undefined,
prepaymentAmt: undefined,
settlementState: "1",
distributionUserId: undefined,
distributionTime: undefined,
currencyCd: undefined,
exchgRat: undefined,
salecollectionsettlementList: [],
version: 0,
orgId: undefined,
},
tableRequiredData: {},
dataRule: {
prepaymentNo: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
custCode: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
custName: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
prepaymentDt: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
prepaymentAmt: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
},
settlementStateOptions: [{
"fullName": "未分配",
"id": "1"
}, {
"fullName": "部分分配",
"id": "2"
}, {
"fullName": "已分配",
"id": "3"
}],
settlementStateProps: {
"label": "fullName",
"value": "id"
},
childIndex: -1,
isEdit: false,
interfaceRes: {
prepaymentNo: [],
custCode: [],
custName: [],
prepaymentDt: [],
prepaymentAmt: [],
settlementState: [],
distributionUserId: [],
distributionTime: [],
currencyCd: [],
exchgRat: [],
salecollectionsettlementsettlementCode: [],
salecollectionsettlementsettlementSubjectName: [],
salecollectionsettlementsettlementSum: [],
salecollectionsettlementsettlableAmount: [],
salecollectionsettlementtype: [],
salecollectionsettlementcontractCode: [],
salecollectionsettlementapplyAmount: [],
salecollectionsettlementassignableAmount: [],
salecollectionsettlementdistributionAmount: [],
},
}
},
computed: {
...mapGetters(['userInfo'])
},
watch: {},
created() {
this.dataAll()
this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() {},
methods: {
initList(list) {
for (let i = 0; i < list.length; i++) {
let e = {};
e.saleCollectionId = this.dataForm.id;
e.saleCollectionCode = this.dataForm.code;
e.settlementId = list[i].id;
e.settlementCode = list[i].code;
e.settlementAmount = list[i].payableAmount;
e.settlementSubjectName = list[i].settlementSubjectName;
e.settlementSum = list[i].settlementSum;
e.contractCode = list[i].contractCode;
e.settlableAmount = list[i].settlableAmount;
e.payableAmount = list[i].payableAmount;
e.invoiceAmount = list[i].invoiceAmount;
e.applyState = list[i].applyState;
e.type = list[i].type == 1 ? '采购结算' : '销售结算';
e.applyAmount = list[i].applyAmount;
e.assignableAmount = this.jnpf.floatSub(list[i].settlableAmount, list[i].applyAmount);
this.dataForm.salecollectionsettlementList.push(e)
}
},
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/Salecollection/' + 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() {},
salecollectionsettlementExist() {
let isOk = true;
for (let i = 0; i < this.dataForm.salecollectionsettlementList.length; i++) {
const e = this.dataForm.salecollectionsettlementList[i];
if (e.distributionAmount) {
var regPos = [{
"pattern": "/^([1-9][\\d]*|0)(\\.[\\d]+)?$/",
"message": "请输入正确的金额"
}]
for (let i = 0; i < regPos.length; i++) {
const element = regPos[i];
if (element.pattern && !eval(element.pattern).test(e.distributionAmount)) {
this.$message({
message: element.message,
type: 'error',
duration: 1000
});
isOk = false
break;
}
}
}
}
return isOk;
},
goBack() {
this.$emit('refresh')
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
init(id, isDetail, allList) {
this.prevDis = false
this.nextDis = false
if(isDetail){
this.continueBtnLoading = true
}
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/Salecollection/' + 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) {
if(this.dataForm.salecollectionsettlementList && this.dataForm.salecollectionsettlementList.length > 0){
let distributionAmount = 0
for (let i = 0; i < this.dataForm.salecollectionsettlementList.length; i++) {
distributionAmount = this.jnpf.floatAdd(distributionAmount, this.dataForm.salecollectionsettlementList[i].distributionAmount);
}
if(distributionAmount == this.dataForm.prepaymentAmt){
this.dataFormSubmitType = type ? type : 0
this.$refs['formRef'].validate((valid) => {
if (valid) {
if (!this.salecollectionsettlementExist()) return
this.request()
}
})
}else{
this.$message({
message: '收款金额没有分配完成,请确认!',
type: 'error',
duration: 1000
});
}
}else{
this.$message({
message: '至少关联一条结算单',
type: 'error',
duration: 1000
});
}
},
request() {
let _data = this.dataList()
if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true
} else {
this.btnLoading = true
}
if (!this.dataForm.id) {
request({
url: '/api/scm/Salecollection',
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/Salecollection/' + 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
})
}
},
addsalecollectionsettlementList() {
this.goodsBoxVisible = true
let excludeIdList = [];
for (let i = 0; i < this.dataForm.salecollectionsettlementList.length; i++) {
excludeIdList.push(this.dataForm.salecollectionsettlementList[i].settlementId);
}
this.$nextTick(() => {
this.$refs.goodsBox.init(excludeIdList, this.dataForm.custCode, this.dataForm.orgId)
})
},
delsalecollectionsettlementList(index) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
this.dataForm.salecollectionsettlementList.splice(index, 1);
}).catch(() => {});
},
getsalecollectionsettlementList(value) {
let item = {
...this.tableRows.salecollectionsettlementList,
...value
}
this.dataForm.salecollectionsettlementList.push(item)
this.childIndex = this.dataForm.salecollectionsettlementList.length - 1
this.isEdit = true
this.isEdit = false
this.childIndex = -1
},
openSelectDialog(key) {
this.currTableConf = this.addTableConf[key]
this.currVmodel = key
this.selectDialogVisible = true
this.$nextTick(() => {
this.$refs.selectDialog.init()
})
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i]
if (this['get' + this.currVmodel]) {
this['get' + this.currVmodel](t)
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData)
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = new Date().getTime()
} else if (timeType == 4) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
}
} else if (timeType == 5) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
let timeDataValue = null
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || '00:00:00'
if (timeDataValue.split(':').length == 3) {
timeDataValue = timeDataValue
} else {
timeDataValue = timeDataValue + ':00'
}
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format)
} else if (timeType == 4) {
let previousDate = '';
previousDate = getBeforeTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
} else if (timeType == 5) {
let previousDate = '';
previousDate = getLaterTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
}
}
return timeDataValue;
},
dataList() {
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
for (let i = 0; i < _dataAll.salecollectionsettlementList.length; i++) {
this.childIndex = i
}
this.childIndex = -1
},
},
}
</script>

@ -0,0 +1,497 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="收款时间">
<JnpfDateRangePicker v-model="query.prepaymentDt" format="yyyy-MM-dd" startPlaceholder="开始日期"
endPlaceholder="结束日期">
</JnpfDateRangePicker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="客户名称">
<el-input v-model="query.custName" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="分配状态">
<JnpfSelect v-model="query.settlementState" placeholder="请选择" clearable :options="settlementStateOptions"
:props="settlementStateProps" multiple>
</JnpfSelect>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<!-- <el-button type="primary" icon="icon-ym icon-ym-btn-add" @click="addOrUpdateHandle()">
</el-button> -->
<el-button type="text" icon="icon-ym icon-ym-btn-download" @click="exportData()">
</el-button>
</div>
<div class="JNPF-common-head-right">
<el-tooltip content="高级查询" placement="top" v-if="true">
<el-link icon="icon-ym icon-ym-filter JNPF-common-head-icon" :underline="false"
@click="openSuperQuery()" />
</el-tooltip>
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="initData()" />
</el-tooltip>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' :span-method="arraySpanMethod" border>
<el-table-column label="分配状态" prop="settlementState" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.settlementState}}
</template>
</el-table-column>
<el-table-column prop="custCode" label="客户编码" align="center" width="200">
</el-table-column>
<el-table-column prop="custName" label="客户名称" align="center" width="400">
</el-table-column>
<el-table-column prop="prepaymentAmt" label="收款金额" align="center" width="150">
</el-table-column>
<el-table-column prop="prepaymentDt" label="收款时间" align="center" width="150">
</el-table-column>
<el-table-column prop="prepaymentNo" label="收款单号" align="center" width="300">
</el-table-column>
<el-table-column prop="currencyCd" label="币种" align="center" width="150">
</el-table-column>
<el-table-column prop="exchgRat" label="汇率" align="center" width="150">
</el-table-column>
<el-table-column prop="distributionUserId" label="分配人" align="center" width="150">
</el-table-column>
<el-table-column prop="distributionTime" label="分配时间" align="center" width="200">
</el-table-column>
<el-table-column label="操作" fixed="right" width="250" align="center">
<template slot-scope="scope">
<el-button type="text" @click="addOrUpdateHandle(scope.row)">
</el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button>
<el-button type="text" @click="goDetail(scope.row.id)">
</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
@pagination="initData" />
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson" @superQuery="superQuery" />
</div>
</template>
<script>
import request from '@/utils/request'
import {
mapGetters
} from "vuex";
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import JNPFForm from './form'
import Detail from './Detail'
import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getConfigData
} from '@/api/onlineDev/visualDev'
import {
getDefaultCurrentValueUserIdAsync
} from '@/api/permission/user'
import {
getDefaultCurrentValueDepartmentIdAsync
} from '@/api/permission/organize'
import columnList from './columnList'
import {
thousandsFormat
} from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
export default {
components: {
JNPFForm,
Detail,
ExportBox,
ToFormDetail,
SuperQuery
},
data() {
return {
keyword: '',
expandsTree: true,
refreshTree: true,
toFormDetailVisible: false,
expandObj: {},
columnOptions: [],
mergeList: [],
exportList: [],
columnList,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
prepaymentDt: undefined,
custName: undefined,
settlementState: 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,
settlementStateOptions: [{
"fullName": "未分配",
"id": "1"
}, {
"fullName": "部分分配",
"id": "2"
}, {
"fullName": "已分配",
"id": "3"
}],
settlementStateProps: {
"label": "fullName",
"value": "id"
},
interfaceRes: {},
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
this.getColumnList(),
this.initSearchDataAndListData()
this.queryData = JSON.parse(JSON.stringify(this.query))
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.toFormDetailVisible = true
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue)
})
})
},
toggleTreeExpand(expands) {
this.refreshTree = false
this.expandsTree = expands
this.$nextTick(() => {
this.refreshTree = true
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null)
})
})
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data
const config = {
treeInterfaceId: "",
treeTemplateJson: []
}
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || ''
}
}
//
let query = {
paramList: config.treeTemplateJson || [],
}
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
})
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList)
},
transformColumnList(columnList) {
let list = []
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes('-')) {
list.push(e)
} else {
let prop = e.prop.split('-')[0]
let label = e.label.split('-')[0]
let vModel = e.prop.split('-')[1]
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
}
e.vModel = vModel
if (!this.expandObj.hasOwnProperty(`${prop}Expand`)) this.$set(this.expandObj, `${prop}Expand`, false)
if (!list.some(o => o.prop === prop)) list.push(newItem)
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e)
break
}
}
}
}
this.getMergeList(list)
this.getExportList(list)
return list
},
arraySpanMethod({
column
}) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list))
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + '-child-first'
}
item.children.unshift(child)
}
})
newList.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
})
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
})
}
})
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
})
}
})
},
getExportList(list) {
let exportList = []
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === 'table') {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j])
}
} else {
exportList.push(list[i])
}
}
this.exportList = exportList
},
goDetail(id) {
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(id)
})
},
sortChange({
column,
prop,
order
}) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
},
//
async initSearchData() {},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId: this.menuId,
moduleId: '585785277943938629',
type: 1,
};
request({
url: `/api/scm/Salecollection/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/Salecollection/${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/Salecollection")
})
},
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/Salecollection/Actions/Export`,
method: 'post',
data: query
}).then(res => {
if (!res.data.url) return
this.jnpf.downloadFile(res.data.url)
this.$refs.ExportBox.visible = false
this.exportBoxVisible = false
})
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.initData()
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData))
this.search()
},
colseFlow(isrRefresh) {
this.flowVisible = false
if (isrRefresh) this.reset()
},
}
}
</script>

@ -0,0 +1,171 @@
<template>
<el-dialog title="选择结算单" :close-on-click-modal="false" :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center"
lock-scroll append-to-body width="800px">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="10">
<el-form-item label="关键字">
<el-input v-model="keyword" placeholder="请输入关键字查询" clearable @keyup.enter.native="search()" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()">{{ $t('common.search') }}
</el-button>
<el-button icon="el-icon-refresh-right" @click="refresh()">{{ $t('common.reset') }}
</el-button>
</el-form-item>
</el-col>
</el-form>
<div class="JNPF-common-search-box-right">
<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="search()" />
</el-tooltip>
</div>
</el-row>
<JNPF-table v-loading="listLoading" :data="list" hasC @selection-change="handleSelectionChange" :border="false">
<el-table-column prop="code" label="单据编号" align="center" width="200">
</el-table-column>
<el-table-column prop="settlementSubjectName" label="结算主体名称" align="center" width="250">
</el-table-column>
<el-table-column prop="settlementSum" label="结算数量" align="center" width="150">
</el-table-column>
<!-- <el-table-column prop="paymentAmount" label="已付金额" align="center" width="150">
</el-table-column>
<el-table-column prop="prepaidDeductionAmount" label="预付抵扣" align="center" width="150">
</el-table-column>
<el-table-column prop="returnAmount" label="退回金额" align="center" width="150">
</el-table-column> -->
<el-table-column prop="settlableAmount" label="可结金额" align="center" width="150">
</el-table-column>
<el-table-column prop="applyAmount" label="已申请金额" align="center" width="150">
</el-table-column>
<el-table-column prop="applyState" label="申请状态" align="center" width="150">
</el-table-column>
<el-table-column prop="businessType" label="业务类型" width="150" align="center">
<template slot-scope="scope" v-if="!scope.row.top">
<el-tag type="warning" v-if="scope.row.businessType==1"></el-tag>
<el-tag type="success" v-else-if="scope.row.businessType==2">采购退供</el-tag>
<el-tag type="danger" v-else-if="scope.row.businessType==3">销售订单</el-tag>
<el-tag type="info" v-else-if="scope.row.businessType==4">销售退供</el-tag>
</template>
</el-table-column>
<el-table-column prop="realName" label="创建用户" align="center" width="150">
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="init" />
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">{{ $t('common.cancelButton') }}</el-button>
<el-button type="primary" @click="select()">{{ $t('common.confirmButton') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import {
GoodsList
} from '@/api/extend/order'
export default {
data() {
return {
visible: false,
listLoading: true,
keyword: '',
list: [],
total: 0,
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
excludeIdList: [],
custCode: '',
orgId: '',
checked: []
}
},
methods: {
init(excludeIdList, custCode, orgId) {
this.visible = true
this.listLoading = true
if (excludeIdList && excludeIdList instanceof Array) {
this.excludeIdList = excludeIdList;
}
if (custCode && typeof(custCode) == 'string') {
this.custCode = custCode;
}
if (orgId && typeof(orgId) == 'string') {
this.orgId = orgId;
}
let query = {
...this.listQuery,
keyword: this.keyword,
excludeIdList: this.excludeIdList,
custCode: this.custCode,
orgId: this.orgId,
applyState: '未申请,部分申请',
dataType: 0,
type: 2,
menuId: '532534180186188741',
queryFlowTaskPass: '1'//
}
/* GoodsList(query).then(res => {
this.list = res.data.list
this.listLoading = false
}) */
request({
url: `/api/scm/Cwsettlement/getList`,
method: 'post',
data: query
}).then(res => {
this.list = res.data.list
this.listLoading = false
this.total = res.data.pagination.total
})
},
refresh() {
this.keyword = ''
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.init()
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.init()
},
select() {
if (!this.checked.length) return
this.visible = false
this.$emit('refreshDataList', this.checked)
},
handleSelectionChange(val) {
this.checked = val
}
}
}
</script>
<style lang="scss" scoped>
>>>.el-dialog__body {
height: 70vh;
padding: 0 0 10px !important;
display: flex;
flex-direction: column;
overflow: hidden;
.JNPF-common-search-box {
margin-bottom: 0;
.JNPF-common-search-box-right {
padding: 10px 10px 0 0;
}
}
}
</style>

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