jg-waiwang-pro
vayne 5 months ago
commit 4e0eb3c50c

@ -168,6 +168,7 @@ public class GatewayWhite {
whiteUrl.add("/api/visualdev/ShortLink/**");
whiteUrl.add("/api/scm/Cwpaymentreceipt/downloadPdf/**");
whiteUrl.add("/api/scm/BusinessOrder/exportPdf/**");
whiteUrl.add("/api/scm/PaymentApplication/downloadPdf/**");
}
private void excludePath(){

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

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

@ -0,0 +1,38 @@
package jnpf.service;
import jnpf.model.paymentapplication.*;
import jnpf.entity.*;
import java.io.IOException;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* PaymentApplication
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-06-06
*/
public interface PaymentApplicationService extends IService<PaymentApplicationEntity> {
List<PaymentApplicationEntity> getList(PaymentApplicationPagination paymentApplicationPagination);
List<PaymentApplicationEntity> getTypeList(PaymentApplicationPagination paymentApplicationPagination,String dataType);
PaymentApplicationEntity getInfo(String id);
void delete(PaymentApplicationEntity entity);
void create(PaymentApplicationEntity entity);
boolean update(String id, PaymentApplicationEntity entity);
//子表方法
//副表数据方法
String checkForm(PaymentApplicationForm form,int i);
void saveOrUpdate(PaymentApplicationForm paymentApplicationForm,String id, boolean isSave) throws Exception;
void getPaymentDocPdf(String id) throws IOException;
}

@ -2081,13 +2081,13 @@ public class BusinessOrderServiceImpl extends ServiceImpl<BusinessOrderMapper, B
// log.warn("路径"+(String)map1.get("filePath"));
// 添加一个段落
Paragraph paragraph1 = section.addParagraph();
paragraph1.appendText(String.valueOf(map.get("supplierNm")));
paragraph1.appendText((String) map.get("supplierName"));
paragraph1.applyStyle("paraStyle");
Paragraph paragraph = section.addParagraph();
File filePath = new File((String) map1.get("filePath"));
File filePath = new File(FileUploadUtils.getLocalBasePath() + (String) map1.get("filePath"));
DocPicture picture =null;
if (filePath.exists()){
picture = paragraph.appendPicture((String) map1.get("filePath"));
picture = paragraph.appendPicture(FileUploadUtils.getLocalBasePath() + (String) map1.get("filePath"));
Section sectionn = document.getLastSection();
PageSetup pageSetup = sectionn.getPageSetup();
//获取页面宽度
@ -2111,8 +2111,8 @@ public class BusinessOrderServiceImpl extends ServiceImpl<BusinessOrderMapper, B
picture.setHeight(width*i2);
picture.setWidth(width);
}else {
picture.setHeight(0);
picture.setWidth(0);
picture.setHeight(400);
picture.setWidth(500);
}
}
}
@ -2135,7 +2135,7 @@ public class BusinessOrderServiceImpl extends ServiceImpl<BusinessOrderMapper, B
Map<String, Object> stringObjectMap = list.get(i1);
if (!String.valueOf(stringObjectMap.get("filePath")).equals("null")) {
String s = String.valueOf(stringObjectMap.get("filePath"));
File vehicleImg = new File(s);
File vehicleImg = new File(FileUploadUtils.getLocalBasePath() + s);
String s2 = String.valueOf(map.get("ticketNo")).equals("null") ? "" : "-" + String.valueOf(map.get("ticketNo"));
String s3 = String.valueOf(map.get("drivername")).equals("null") ? "" : "-" + String.valueOf(map.get("drivername"));
String s4 = String.valueOf(map.get("contact")).equals("null") ? "" : "-" + String.valueOf(map.get("contact"));

@ -0,0 +1,485 @@
package jnpf.service.impl;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONArray;
import jnpf.base.ActionResult;
import jnpf.engine.controller.FlowBeforeController;
import jnpf.engine.model.flowbefore.FlowBeforeInfoVO;
import jnpf.engine.model.flowbefore.FlowTaskOperatorRecordModel;
import jnpf.engine.model.flowengine.FlowModel;
import jnpf.entity.*;
import jnpf.exception.WorkFlowException;
import jnpf.mapper.CwpaymentreceiptMapper;
import jnpf.mapper.PaymentApplicationMapper;
import jnpf.model.cwpaymentreceipt.PaymentdocMessage;
import jnpf.permission.entity.OrganizeEntity;
import jnpf.permission.service.OrganizeService;
import jnpf.permission.service.UserService;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.paymentapplication.*;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
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.net.URLEncoder;
import java.util.regex.Pattern;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel;
import jnpf.util.context.SpringContext;
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;
import javax.servlet.http.HttpServletResponse;
/**
*
* PaymentApplication
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-06-06
*/
@Service
public class PaymentApplicationServiceImpl extends ServiceImpl<PaymentApplicationMapper, PaymentApplicationEntity> implements PaymentApplicationService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private CwpaymentreceiptMapper cwpaymentreceiptMapper;
@Autowired
private OrganizeService organizeService;
@Autowired
private UserService userService;
@Autowired
private SubjectbasicService subjectbasicService;
@Override
public List<PaymentApplicationEntity> getList(PaymentApplicationPagination paymentApplicationPagination){
return getTypeList(paymentApplicationPagination,paymentApplicationPagination.getDataType());
}
/** 列表查询 */
@Override
public List<PaymentApplicationEntity> getTypeList(PaymentApplicationPagination paymentApplicationPagination,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 ? PaymentApplicationConstant.getAppColumnData() : PaymentApplicationConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int paymentApplicationNum =0;
QueryWrapper<PaymentApplicationEntity> paymentApplicationQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(paymentApplicationPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = paymentApplicationPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<PaymentApplicationEntity> paymentApplicationSuperWrapper = new QueryWrapper<>();
paymentApplicationSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(paymentApplicationSuperWrapper,PaymentApplicationEntity.class,queryJson,"0"));
int paymentApplicationNum1 = paymentApplicationSuperWrapper.getExpression().getNormal().size();
if (paymentApplicationNum1>0){
List<String> paymentApplicationList =this.list(paymentApplicationSuperWrapper).stream().map(PaymentApplicationEntity::getId).collect(Collectors.toList());
allSuperList.addAll(paymentApplicationList);
intersectionSuperList.add(paymentApplicationList);
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<PaymentApplicationEntity> paymentApplicationSuperWrapper = new QueryWrapper<>();
paymentApplicationSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(paymentApplicationSuperWrapper,PaymentApplicationEntity.class,ruleJson,"0"));
int paymentApplicationNum1 = paymentApplicationSuperWrapper.getExpression().getNormal().size();
if (paymentApplicationNum1>0){
List<String> paymentApplicationList =this.list(paymentApplicationSuperWrapper).stream().map(PaymentApplicationEntity::getId).collect(Collectors.toList());
allRuleList.addAll(paymentApplicationList);
intersectionRuleList.add(paymentApplicationList);
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 paymentApplicationObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(paymentApplicationQueryWrapper,PaymentApplicationEntity.class,paymentApplicationPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(paymentApplicationObj)){
return new ArrayList<>();
} else {
paymentApplicationQueryWrapper = (QueryWrapper<PaymentApplicationEntity>)paymentApplicationObj;
if( paymentApplicationQueryWrapper.getExpression().getNormal().size()>0){
paymentApplicationNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object paymentApplicationObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(paymentApplicationQueryWrapper,PaymentApplicationEntity.class,paymentApplicationPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(paymentApplicationObj)){
return new ArrayList<>();
} else {
paymentApplicationQueryWrapper = (QueryWrapper<PaymentApplicationEntity>)paymentApplicationObj;
if( paymentApplicationQueryWrapper.getExpression().getNormal().size()>0){
paymentApplicationNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(paymentApplicationPagination.getCode())){
paymentApplicationNum++;
String value = paymentApplicationPagination.getCode() instanceof List ?
JsonUtil.getObjectToString(paymentApplicationPagination.getCode()) :
String.valueOf(paymentApplicationPagination.getCode());
paymentApplicationQueryWrapper.lambda().like(PaymentApplicationEntity::getCode,value);
}
if(ObjectUtil.isNotEmpty(paymentApplicationPagination.getPreparationTime())){
paymentApplicationNum++;
List PreparationTimeList = JsonUtil.getJsonToList(paymentApplicationPagination.getPreparationTime(),String.class);
Long fir = Long.valueOf(String.valueOf(PreparationTimeList.get(0)));
Long sec = Long.valueOf(String.valueOf(PreparationTimeList.get(1)));
paymentApplicationQueryWrapper.ge("f_creator_time", new Date(fir))
.le("f_creator_time", DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
}
if(ObjectUtil.isNotEmpty(paymentApplicationPagination.getPayee())){
paymentApplicationNum++;
String value = paymentApplicationPagination.getPayee() instanceof List ?
JsonUtil.getObjectToString(paymentApplicationPagination.getPayee()) :
String.valueOf(paymentApplicationPagination.getPayee());
paymentApplicationQueryWrapper.lambda().like(PaymentApplicationEntity::getPayee,value);
}
if(ObjectUtil.isNotEmpty(paymentApplicationPagination.getPayer())){
paymentApplicationNum++;
String value = paymentApplicationPagination.getPayer() instanceof List ?
JsonUtil.getObjectToString(paymentApplicationPagination.getPayer()) :
String.valueOf(paymentApplicationPagination.getPayer());
paymentApplicationQueryWrapper.lambda().like(PaymentApplicationEntity::getPayer,value);
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
paymentApplicationQueryWrapper.lambda().in(PaymentApplicationEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
paymentApplicationQueryWrapper.lambda().and(t->t.in(PaymentApplicationEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
paymentApplicationQueryWrapper.lambda().and(t->t.in(PaymentApplicationEntity::getId, finalAllRuleIDlist));
}
//假删除标志
paymentApplicationQueryWrapper.lambda().isNull(PaymentApplicationEntity::getDeleteMark);
//排序
if(StringUtil.isEmpty(paymentApplicationPagination.getSidx())){
paymentApplicationQueryWrapper.lambda().orderByDesc(PaymentApplicationEntity::getId);
}else{
try {
String sidx = paymentApplicationPagination.getSidx();
String[] strs= sidx.split("_name");
PaymentApplicationEntity paymentApplicationEntity = new PaymentApplicationEntity();
Field declaredField = paymentApplicationEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
paymentApplicationQueryWrapper="asc".equals(paymentApplicationPagination.getSort().toLowerCase())?paymentApplicationQueryWrapper.orderByAsc(value):paymentApplicationQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<PaymentApplicationEntity> page=new Page<>(paymentApplicationPagination.getCurrentPage(), paymentApplicationPagination.getPageSize());
IPage<PaymentApplicationEntity> userIPage=this.page(page, paymentApplicationQueryWrapper);
return paymentApplicationPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<PaymentApplicationEntity> list = new ArrayList();
return paymentApplicationPagination.setData(list, list.size());
}
}else{
return this.list(paymentApplicationQueryWrapper);
}
}
@Override
public PaymentApplicationEntity getInfo(String id){
QueryWrapper<PaymentApplicationEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(PaymentApplicationEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(PaymentApplicationEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, PaymentApplicationEntity entity){
return this.updateById(entity);
}
@Override
public void delete(PaymentApplicationEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(PaymentApplicationForm 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.getPayee())){
return "收款方不能为空";
}
if(StringUtil.isEmpty(form.getPayer())){
return "付款方不能为空";
}
if(StringUtil.isNotEmpty(form.getPayer())){
form.setPayer(form.getPayer().trim());
QueryWrapper<PaymentApplicationEntity> payerWrapper=new QueryWrapper<>();
payerWrapper.lambda().eq(PaymentApplicationEntity::getPayer,form.getPayer());
//假删除标志
payerWrapper.lambda().isNull(PaymentApplicationEntity::getDeleteMark);
if (isUp){
payerWrapper.lambda().ne(PaymentApplicationEntity::getId, id);
}
if((int) this.count(payerWrapper)>0){
countRecover = "付款方不能重复";
}
}
return countRecover;
}
/**
* ()
* @param id
* @param paymentApplicationForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(PaymentApplicationForm paymentApplicationForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
paymentApplicationForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(PaymentApplicationConstant.getFormData(),paymentApplicationForm),PaymentApplicationForm.class);
PaymentApplicationEntity entity = JsonUtil.getJsonToBean(paymentApplicationForm, PaymentApplicationEntity.class);
if(isSave){
String mainId = id ;
entity.setCode(generaterSwapUtil.getBillNumber("FKSQ", false));
entity.setId(mainId);
entity.setFlowId(paymentApplicationForm.getFlowId());
entity.setVersion(0);
}else{
entity.setCode(generaterSwapUtil.getBillNumber("FKSQ", false));
entity.setFlowId(paymentApplicationForm.getFlowId());
}
this.saveOrUpdate(entity);
}
@Override
public void getPaymentDocPdf(String id) throws IOException {
List<Map<String, Object>> paymentDocNodeInfo = cwpaymentreceiptMapper.getPaymentDocNodeInfo(id);
String stringtime = null;
if (paymentDocNodeInfo != null && paymentDocNodeInfo.size() > 0) {
System.out.println( paymentDocNodeInfo.get(0).get("handleTime"));
stringtime=paymentDocNodeInfo.get(0).get("handleTime").toString();
}
PaymentdocMessage paymentdocMessage =new PaymentdocMessage();
PaymentApplicationEntity paymentApplicationEntity = this.getById(id);
SubjectbasicEntity subjectbasicEntity = subjectbasicService.getById(paymentApplicationEntity.getSubjectId());
UserEntity userEntity = userService.getInfo(paymentApplicationEntity.getCreatorUserId());
paymentdocMessage.setRealName(userEntity.getRealName());
paymentdocMessage.setMobilePhone(userEntity.getAccount());
paymentdocMessage.setNowTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(paymentApplicationEntity.getCreatorTime()));
OrganizeEntity companyEntity = organizeService.getById(paymentApplicationEntity.getCompanyId());
paymentdocMessage.setCustomerName(companyEntity.getFullName() + "请示");
paymentdocMessage.setDocumentNo(paymentApplicationEntity.getCode());
paymentdocMessage.setSupplierName(paymentApplicationEntity.getPayee());
paymentdocMessage.setRamout(paymentApplicationEntity.getApplyAmount().toString());
paymentdocMessage.setPaymentAmout("");
paymentdocMessage.setCollectionAccout(subjectbasicEntity.getBankAccount());
paymentdocMessage.setColletionBank(subjectbasicEntity.getBankBranchName());
paymentdocMessage.setRemark(paymentApplicationEntity.getRemark());
paymentdocMessage.setEnclosure(paymentApplicationEntity.getAnnex());
paymentdocMessage.setPayType("货款");
OrganizeEntity departmentEntity = organizeService.getById(paymentApplicationEntity.getDepartmentId());
paymentdocMessage.setFullName(companyEntity.getFullName() + "/" + departmentEntity.getFullName());
StringBuilder payEnclosureStr = new StringBuilder();
if (paymentdocMessage.getEnclosure() != null) {//附件不为空
String enclosure = paymentdocMessage.getEnclosure();
JSONArray jsonToJsonArray = JsonUtil.getJsonToJsonArray(enclosure);
for (int i = 0; i < jsonToJsonArray.size(); i++) {
Map o = (Map) jsonToJsonArray.get(i);
Object name = o.get("name");
if (i == 0) {
payEnclosureStr.append(name);
} else {
payEnclosureStr.append("<br/>" + name);
}
}
paymentdocMessage.setEnclosure(payEnclosureStr.toString());
}
// StringUtil.indexOf()
// String templateFilePath = configValueUtil.getTemplateFilePath() +"paymentDocPdf//";
Map<String, Object> map = JsonUtil.stringToMap(JSONUtil.toJsonStr(paymentdocMessage));
map.put("substring", companyEntity.getFullName());
map.put("substring1", departmentEntity.getFullName());
// map.put("reportList",paymentDocNodeInfo);
FlowBeforeController bean = SpringContext.getBean(FlowBeforeController.class);
ActionResult info = null;
try {
info = bean.info(id, new FlowModel());
} catch (WorkFlowException e) {
throw new RuntimeException(e);
}
FlowBeforeInfoVO data = (FlowBeforeInfoVO) info.getData();
List<FlowTaskOperatorRecordModel> recordList = data.getFlowTaskOperatorRecordList();
List<Map<String, Object>> maps = new ArrayList<>();
for (int i = 0; i < recordList.size(); i++) {
Map<String, Object> map1 = new HashMap<String, Object>();
FlowTaskOperatorRecordModel model = recordList.get(i);
Map<String, Object> map2 = paymentDocNodeInfo.get(i);
map1.put("realName", model.getUserName());
map1.put("nodeName", model.getNodeName());
map1.put("handleOpinion", model.getHandleOpinion());
map1.put("handleTime", DateUtil.daFormat(model.getHandleTime()));
map1.put("node", map2.get("node"));
maps.add(map1);
}
ArrayList<Map<String, Object>> maps1 = new ArrayList<Map<String, Object>>();
int num = 6;
if (maps.size() > num) {
for (int i = 0; i < maps.size(); i++) {
Map<String, Object> map1 = maps.get(i);
if (i >= num) {
maps1.add(map1);
}
}
while (maps.size() > num) {
maps.remove(num);
}
}
map.put("reportList", maps);
map.put("reportList1", maps1);
byte[] bytes = null;
ByteArrayOutputStream out = null;
ExportPdf exportPdf = new ExportPdf();
// word模板
try {
out = exportPdf.createPdf(map, "paymentDoc.ftl", "/templates/export");
bytes = out.toByteArray();
out.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
String fileName = paymentdocMessage.getCustomerName() == null ? companyEntity.getFullName() + "请示.pdf" : companyEntity.getFullName() + "请示(" + paymentdocMessage.getCustomerName() + ").pdf";
HttpServletResponse response = ServletUtil.getResponse();
response.reset();
String excelTitle = fileName;
String filen = null;
try {
filen = URLEncoder.encode(excelTitle, "UTF-8").replaceAll("\\+", "%20");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
// 设置response的Header
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + filen);
response.setContentType("application/x-download;charset=utf-8");
BufferedOutputStream toClient = null;
try {
toClient = new BufferedOutputStream(response.getOutputStream());
toClient.write(out.toByteArray());
toClient.flush();
toClient.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
log.warn("pdf文件生成成功");
}
}

@ -818,9 +818,9 @@ public class ProductWarehouseServiceImpl extends ServiceImpl<ProductWarehouseMap
idList.add(String.valueOf(productWarehousePagination.getInventoryType()));
}
}
productWarehouseQueryWrapper.lambda().and(t->{
productWarehouseQueryWrapper.and(t->{
idList.forEach(tt->{
t.like(ProductWarehouseEntity::getInventoryType, tt).or();
t.like("a.inventory_type", tt).or();
});
});

@ -0,0 +1,230 @@
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.paymentapplication.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.transaction.annotation.Transactional;
/**
* PaymentApplication
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-06-06
*/
@Slf4j
@RestController
@Tag(name = "PaymentApplication" , description = "scm")
@RequestMapping("/api/scm/PaymentApplication")
public class PaymentApplicationController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Autowired
private PaymentApplicationService paymentApplicationService;
/**
*
*
* @param paymentApplicationPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody PaymentApplicationPagination paymentApplicationPagination)throws IOException{
List<PaymentApplicationEntity> list= paymentApplicationService.getList(paymentApplicationPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (PaymentApplicationEntity entity : list) {
Map<String, Object> paymentApplicationMap=JsonUtil.entityToMap(entity);
paymentApplicationMap.put("id", paymentApplicationMap.get("id"));
//副表数据
//子表数据
realList.add(paymentApplicationMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, PaymentApplicationConstant.getFormData(), PaymentApplicationConstant.getColumnData(), paymentApplicationPagination.getModuleId(),false);
//流程状态添加
for(Map<String, Object> vo:realList){
FlowTaskEntity flowTaskEntity = generaterSwapUtil.getInfoSubmit(String.valueOf(vo.get("id")), FlowTaskEntity::getStatus);
if (flowTaskEntity!=null){
vo.put("flowState",flowTaskEntity.getStatus());
}else{
vo.put("flowState",null);
}
//添加流程id
String flowId="";
if(vo.get("flowid")!=null){
flowId = String.valueOf(vo.get("flowid"));
}
if(vo.get("flowid".toUpperCase())!=null){
flowId = String.valueOf(vo.get("flowid".toUpperCase()));
}
if(StringUtil.isNotEmpty(flowId)){
vo.put("flowId" ,flowId);
}
}
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(paymentApplicationPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param paymentApplicationForm
* @return
*/
@PostMapping("/{id}")
@Operation(summary = "创建")
public ActionResult create(@PathVariable("id") String id, @RequestBody @Valid PaymentApplicationForm paymentApplicationForm) {
String b = paymentApplicationService.checkForm(paymentApplicationForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
paymentApplicationService.saveOrUpdate(paymentApplicationForm, id ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
return ActionResult.success("创建成功");
}
/**
*
* @param id
* @param paymentApplicationForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid PaymentApplicationForm paymentApplicationForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
paymentApplicationForm.setId(id);
if (!isImport) {
String b = paymentApplicationService.checkForm(paymentApplicationForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
PaymentApplicationEntity entity= paymentApplicationService.getInfo(id);
if(entity!=null){
try{
paymentApplicationService.saveOrUpdate(paymentApplicationForm,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){
PaymentApplicationEntity entity= paymentApplicationService.getInfo(id);
if(entity!=null){
FlowTaskEntity taskEntity = generaterSwapUtil.getInfoSubmit(id, FlowTaskEntity::getId, FlowTaskEntity::getStatus);
if (taskEntity != null) {
try {
generaterSwapUtil.deleteFlowTask(taskEntity);
} catch (WorkFlowException e) {
e.printStackTrace();
}
}
//假删除
entity.setDeleteMark(1);
paymentApplicationService.update(id,entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
PaymentApplicationEntity entity= paymentApplicationService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> paymentApplicationMap=JsonUtil.entityToMap(entity);
paymentApplicationMap.put("id", paymentApplicationMap.get("id"));
//副表数据
//子表数据
paymentApplicationMap = generaterSwapUtil.swapDataDetail(paymentApplicationMap,PaymentApplicationConstant.getFormData(),"568458500523427653",false);
return ActionResult.success(paymentApplicationMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
PaymentApplicationEntity entity= paymentApplicationService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> paymentApplicationMap=JsonUtil.entityToMap(entity);
paymentApplicationMap.put("id", paymentApplicationMap.get("id"));
//副表数据
//子表数据
paymentApplicationMap = generaterSwapUtil.swapDataForm(paymentApplicationMap,PaymentApplicationConstant.getFormData(),PaymentApplicationConstant.TABLEFIELDKEY,PaymentApplicationConstant.TABLERENAMES);
return ActionResult.success(paymentApplicationMap);
}
/**
*
* @param id id
* @throws Exception
*/
@GetMapping(value = "/downloadPdf/{id}/{token}")
public void downloadPdf(HttpServletResponse response, @PathVariable("id") String id, @PathVariable("token")String token) throws IOException {
paymentApplicationService.getPaymentDocPdf(id);
}
}

@ -0,0 +1,70 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-06-06
*/
@Data
@TableName("jg_cw_payment_application")
public class PaymentApplicationEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "CODE" , updateStrategy = FieldStrategy.IGNORED)
private String code;
@TableField(value = "TYPE" , updateStrategy = FieldStrategy.IGNORED)
private String type;
@TableField(value = "APPLY_AMOUNT" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal applyAmount;
@TableField(value = "PAYEE" , updateStrategy = FieldStrategy.IGNORED)
private String payee;
@TableField(value = "PAYER" , updateStrategy = FieldStrategy.IGNORED)
private String payer;
@TableField(value = "REMARK" , updateStrategy = FieldStrategy.IGNORED)
private String remark;
@TableField(value = "f_creator_time" , fill = FieldFill.INSERT)
private Date creatorTime;
@TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
private String creatorUserId;
@TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
private Date lastModifyTime;
@TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
private String lastModifyUserId;
@TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
private Date deleteTime;
@TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
private String deleteUserId;
@TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("F_FLOW_ID")
private String flowId;
@TableField("F_VERSION")
private Integer version;
@TableField(value = "COMPANY_ID" , fill = FieldFill.INSERT)
private String companyId;
@TableField(value = "DEPARTMENT_ID" , fill = FieldFill.INSERT)
private String departmentId;
@TableField(value = "ORGANIZE_JSON_ID" , fill = FieldFill.INSERT)
private String organizeJsonId;
@TableField("F_FLOW_TASK_ID")
private String flowTaskId;
@TableField(value = "SUBJECT_ID" , updateStrategy = FieldStrategy.IGNORED)
private String subjectId;
@TableField(value = "CONTRACT_ID" , updateStrategy = FieldStrategy.IGNORED)
private String contractId;
@TableField(value = "CASE_STATUS" , updateStrategy = FieldStrategy.IGNORED)
private String caseStatus;
@TableField(value = "CLOSE_CASE_REMARK" , updateStrategy = FieldStrategy.IGNORED)
private String closeCaseRemark;
@TableField(value = "ANNEX" , updateStrategy = FieldStrategy.IGNORED)
private String annex;
}

@ -0,0 +1,59 @@
package jnpf.model.paymentapplication;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* PaymentApplication
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-06-06
*/
@Data
public class PaymentApplicationForm {
/** 主键 */
private String id;
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
/** 流程id **/
@JsonProperty("flowId")
private String flowId;
/** 类型 **/
@JsonProperty("type")
private String type;
/** 单据编号 **/
@JsonProperty("code")
private String code;
/** 供应商 **/
@JsonProperty("subjectId")
private String subjectId;
/** 合同 **/
@JsonProperty("contractId")
private String contractId;
/** 收款方 **/
@JsonProperty("payee")
private String payee;
/** 付款方 **/
@JsonProperty("payer")
private String payer;
/** 申请金额 **/
@JsonProperty("applyAmount")
private BigDecimal applyAmount;
/** 状态 **/
@JsonProperty("caseStatus")
private Object caseStatus;
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** 结案备注 **/
@JsonProperty("closeCaseRemark")
private String closeCaseRemark;
/** 附件 **/
@JsonProperty("annex")
private Object annex;
}

@ -0,0 +1,41 @@
package jnpf.model.paymentapplication;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* PaymentApplication
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-06-06
*/
@Data
public class PaymentApplicationPagination 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("code")
private Object code;
/** 收款方 */
@JsonProperty("payee")
private Object payee;
/** 付款方 */
@JsonProperty("payer")
private Object payer;
@JsonProperty("preparationTime")
private Object preparationTime;
}

@ -1,10 +1,10 @@
module.exports = {
// 开发环境接口配置
APIURl: 'http://127.0.0.1:30000'
APIURl: 'http://127.0.0.1:40000'
// 测试环境接口配置
// APIURl: 'http://222.71.165.188:30000'
// 生产环境接口配置
// APIURl: 'http://127.0.0.1:40000'
//APIURl: 'http://221.214.32.166:40000'
// 演示环境接口配置
// APIURl: 'http://222.71.165.188:50000'
}

@ -195,7 +195,7 @@ export default {
isLeaf: "isLeaf"
},
list: [],
listLoading: true,
listLoading: false,
multipleSelection: [],
total: 0,
queryData: {},
@ -641,7 +641,7 @@ export default {
},
async initSearchDataAndListData() {
await this.initSearchData();
this.initData();
// this.initData();
},
//
async initSearchData() { },

@ -1092,11 +1092,11 @@
</JnpfInput>
</template>
</el-table-column>
<el-table-column label="净重" v-if="judgeShow('cwaccountvoucher-netWeight')"
<el-table-column label="结算重量" v-if="judgeShow('cwaccountvoucher-netWeight')"
prop="netWeight" align="center" width="250">
<template slot="header">
<span class="required-sign"
v-if="judgeRequired('cwaccountvoucherList-netWeight')">*</span>净重
v-if="judgeRequired('cwaccountvoucherList-netWeight')">*</span>结算重量
</template>
<template slot-scope="scope">
<JnpfInput v-model="scope.row.netWeight"

@ -0,0 +1,591 @@
<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-dropdown class="dropdown" placement="bottom">
<el-button style="width:70px">
<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<template v-if="dataForm.id">
<el-dropdown-item @click.native="prev" :disabled='prevDis'>
{{'上一条'}}
</el-dropdown-item>
<el-dropdown-item @click.native="next" :disabled='nextDis'>
{{'下一条'}}
</el-dropdown-item>
</template>
<el-dropdown-item type="primary" @click.native="dataFormSubmit(2)" :loading="continueBtnLoading"
:disabled='btnLoading'>
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown> -->
<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="24">
<jnpf-form-tip-item label="类型" prop="type">
<JnpfRadio v-model="dataForm.type" @change="changeData('type',-1)" optionType="button"
direction="horizontal" size="medium" :options="typeOptions" :props="typeProps" :disabled="true" >
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="单据编号" prop="code">
<JnpfInput v-model="dataForm.code" @change="changeData('code',-1)" placeholder="系统自动生成" :disabled="true"
:style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="供应商" prop="subjectId">
<JnpfPopupSelect v-model="dataForm.subjectId" @change="changeData('subjectId',-1)" :rowIndex="null"
:formData="dataForm" :templateJson="interfaceRes.subjectId" placeholder="请选择" hasPage propsValue="id"
popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='name' field='subjectId'
interfaceId="542305697765799941" :pageSize="20" :columnOptions="subjectIdcolumnOptions" clearable :disabled="true"
:style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="合同" prop="contractId">
<JnpfPopupSelect v-model="dataForm.contractId" @change="changeData('contractId',-1)" :rowIndex="null"
:formData="dataForm" :templateJson="interfaceRes.contractId" placeholder="请选择" hasPage propsValue="id"
popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='contract_name'
field='contractId' interfaceId="545203391626777029" :pageSize="20"
:columnOptions="contractIdcolumnOptions" clearable :style='{"width":"100%"}' :disabled="true">
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="收款方" prop="payee">
<JnpfInput v-model="dataForm.payee" @change="changeData('payee',-1)" placeholder="请输入" clearable
:style='{"width":"100%"}' :disabled="true">
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="付款方" prop="payer">
<JnpfInput v-model="dataForm.payer" @change="changeData('payer',-1)" placeholder="请输入" clearable
:style='{"width":"100%"}' :disabled="true">
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="申请金额" prop="applyAmount">
<JnpfInputNumber v-model="dataForm.applyAmount" @change="changeData('applyAmount',-1)"
placeholder="数字文本" isAmountChinese :step="1" :disabled="true">
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="备注" prop="remark">
<JnpfTextarea v-model="dataForm.remark" @change="changeData('remark',-1)" placeholder="请输入"
:style='{"width":"100%"}' true type="textarea" :autosize='{"minRows":4,"maxRows":4}' :disabled="true">
</JnpfTextarea>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="结案备注" prop="closeCaseRemark">
<JnpfTextarea v-model="dataForm.closeCaseRemark" @change="changeData('closeCaseRemark',-1)" placeholder="请输入"
:style='{"width":"100%"}' true type="textarea" :autosize='{"minRows":4,"maxRows":4}'>
</JnpfTextarea>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="附件" prop="annex">
<JnpfUploadFile v-model="dataForm.annex" @change="changeData('annex',-1)"
tipText="支持格式:.rar .zip .doc .docx .pdf 单个文件不能超过20MB" :fileSize="10" sizeUnit="MB" :limit="9"
pathType="defaultPath" :isAccount="0" buttonText="点击上传">
</JnpfUploadFile>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="状态" prop="caseStatus" v-if="false">
<JnpfInput v-model="dataForm.caseStatus" @change="changeData('caseStatus',-1)" placeholder="请输入" clearable
:style='{"width":"100%"}' :disabled="true">
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
</el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
@select="addForSelect" @close="selectDialogVisible=false" />
</el-row>
</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"
export default {
components: {},
props: [],
data() {
return {
dataFormSubmitType: 0,
continueBtnLoading: false,
index: 0,
prevDis: false,
nextDis: false,
allList: [],
visible: false,
loading: false,
btnLoading: false,
formRef: 'formRef',
setting: {},
eventType: '',
userBoxVisible: false,
selectDialogVisible: false,
currTableConf: {},
dataValueAll: {},
addTableConf: {},
//
ableAll: {},
tableRows: {},
Vmodel: "",
currVmodel: "",
dataForm: {
type: "1",
code: undefined,
subjectId: undefined,
contractId: undefined,
payee: undefined,
payer: undefined,
applyAmount: undefined,
caseStatus: "2",
remark: undefined,
closeCaseRemark: undefined,
annex: [],
version: 0,
},
tableRequiredData: {},
dataRule: {
type: [{
required: true,
message: '请至少选择一个',
trigger: 'change'
}, ],
subjectId: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
contractId: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
payee: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
payer: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
applyAmount: [{
required: true,
message: '数字文本',
trigger: ["blur", "change"]
}, ],
closeCaseRemark: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
},
typeOptions: [{
"fullName": "采购付款",
"id": "1"
}],
typeProps: {
"label": "fullName",
"value": "id"
},
subjectIdcolumnOptions: [{
"label": "名称",
"value": "name"
}, ],
contractIdcolumnOptions: [{
"label": "合同名称",
"value": "contract_name"
}, ],
caseStatusOptions: [{
"fullName": "正常",
"id": "1"
}, {
"fullName": "结案",
"id": "2"
}],
caseStatusProps: {
"label": "fullName",
"value": "id"
},
childIndex: -1,
isEdit: false,
interfaceRes: {
type: [],
code: [],
subjectId: [],
contractId: [{
"dataType": "varchar",
"defaultValue": "",
"field": "subjectId",
"fieldName": "",
"id": "HmoSU22",
"jnpfKey": "popupSelect",
"relationField": "subjectId",
"required": "1"
}, {
"dataType": "varchar",
"defaultValue": "",
"field": "contractType",
"fieldName": "",
"id": "QnvSU22",
"jnpfKey": "radio",
"relationField": "type",
"required": "1"
}],
payee: [],
payer: [],
applyAmount: [],
caseStatus: [],
remark: [],
closeCaseRemark: [],
annex: [],
},
}
},
computed: {
...mapGetters(['userInfo'])
},
watch: {},
created() {
this.dataAll()
this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() {},
methods: {
prev() {
this.index--
if (this.index === 0) {
this.prevDis = true
}
this.nextDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
next() {
this.index++
if (this.index === this.allList.length - 1) {
this.nextDis = true
}
this.prevDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
getInfo(id) {
request({
url: '/api/scm/PaymentApplication/' + 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() {},
goBack() {
this.$emit('refresh')
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
init(id, isDetail, allList) {
this.prevDis = false
this.nextDis = false
this.allList = allList || []
if (allList.length) {
this.index = this.allList.findIndex(item => item.id === id)
if (this.index == 0) {
this.prevDis = true
}
if (this.index == this.allList.length - 1) {
this.nextDis = true
}
} else {
this.prevDis = true
this.nextDis = true
}
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/scm/PaymentApplication/' + this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
} else {
this.clearData()
this.initDefaultData()
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
initDefaultData() {
},
//
dataFormSubmit(type) {
this.dataFormSubmitType = type ? type : 0
this.$refs['formRef'].validate((valid) => {
if (valid) {
this.request()
}
})
},
request() {
let _data = this.dataList()
_data.caseStatus = '2';
if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true
} else {
this.btnLoading = true
}
if (!this.dataForm.id) {
request({
url: '/api/scm/PaymentApplication',
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/PaymentApplication/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) return this.continueBtnLoading = false
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
}
})
}).catch(() => {
this.btnLoading = false
this.continueBtnLoading = false
})
}
},
openSelectDialog(key) {
this.currTableConf = this.addTableConf[key]
this.currVmodel = key
this.selectDialogVisible = true
this.$nextTick(() => {
this.$refs.selectDialog.init()
})
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i]
if (this['get' + this.currVmodel]) {
this['get' + this.currVmodel](t)
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData)
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = new Date().getTime()
} else if (timeType == 4) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
}
} else if (timeType == 5) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
let timeDataValue = null
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || '00:00:00'
if (timeDataValue.split(':').length == 3) {
timeDataValue = timeDataValue
} else {
timeDataValue = timeDataValue + ':00'
}
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format)
} else if (timeType == 4) {
let previousDate = '';
previousDate = getBeforeTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
} else if (timeType == 5) {
let previousDate = '';
previousDate = getLaterTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
}
}
return timeDataValue;
},
dataList() {
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
this.childIndex = -1
},
},
}
</script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,477 @@
<template>
<div :style="{margin: '0 auto',width:'100%'}">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right"
:disabled="setting.readonly">
<template v-if="!loading && formOperates">
<!-- 具体表单 -->
<el-col :span="24" v-if="judgeShow('type')">
<jnpf-form-tip-item label="类型" v-if="judgeShow('type')" prop="type">
<JnpfRadio v-model="dataForm.type" @change="changeData('type',-1)" :disabled="judgeWrite('type')"
optionType="button" direction="horizontal" size="medium" :options="typeOptions" :props="typeProps">
</JnpfRadio>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('code')">
<jnpf-form-tip-item label="单据编号" v-if="judgeShow('code')" prop="code">
<JnpfInput v-model="dataForm.code" @change="changeData('code',-1)" placeholder="系统自动生成"
:disabled="judgeWrite('code')" readonly :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('subjectId')">
<jnpf-form-tip-item label="供应商" v-if="judgeShow('subjectId')" prop="subjectId">
<JnpfPopupSelect v-model="dataForm.subjectId" @change="subjectChangeData" :rowIndex="null"
:formData="dataForm" :templateJson="interfaceRes.subjectId" placeholder="请选择"
:disabled="judgeWrite('subjectId')" hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='name' field='subjectId' interfaceId="545165301679952325"
:pageSize="20" :columnOptions="subjectIdcolumnOptions" clearable :style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</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"
:formData="dataForm" :templateJson="interfaceRes.contractId" placeholder="请选择"
:disabled="judgeWrite('contractId')" hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='contract_name' field='contractId' interfaceId="545203391626777029"
:pageSize="20" :columnOptions="contractIdcolumnOptions" clearable :style='{"width":"100%"}'>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</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.payee" @change="changeData('payee',-1)" placeholder="请输入"
:disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('payer')">
<jnpf-form-tip-item label="付款方" v-if="judgeShow('payer')" prop="payer">
<JnpfInput v-model="dataForm.payer" @change="changeData('payer',-1)" placeholder="请输入"
:disabled="true" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="8" v-if="judgeShow('applyAmount')">
<jnpf-form-tip-item label="申请金额" v-if="judgeShow('applyAmount')" prop="applyAmount">
<JnpfInputNumber v-model="dataForm.applyAmount" @change="changeData('applyAmount',-1)" placeholder="数字文本"
:disabled="judgeWrite('applyAmount')" isAmountChinese :step="1">
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('remark')">
<jnpf-form-tip-item label="备注" v-if="judgeShow('remark')" prop="remark">
<JnpfTextarea v-model="dataForm.remark" @change="changeData('remark',-1)" placeholder="请输入"
:disabled="judgeWrite('remark')" :style='{"width":"100%"}' true type="textarea"
:autosize='{"minRows":4,"maxRows":4}'>
</JnpfTextarea>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
@select="addForSelect" @close="selectDialogVisible=false" />
</el-form>
</el-row>
<UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
</div>
</template>
<script>
import request from '@/utils/request'
import {
mapGetters
} from "vuex";
import {
getFormById
} from '@/api/workFlow/FormDesign'
import comMixin from '@/views/workFlow/workFlowForm/mixin';
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import {
getDefaultCurrentValueUserId
} from '@/api/permission/user'
import {
getDefaultCurrentValueDepartmentId
} from '@/api/permission/organize'
import {
getDateDay,
getLaterData,
getBeforeData,
getBeforeTime,
getLaterTime
} from '@/components/Generator/utils/index.js'
import {
thousandsFormat
} from "@/components/Generator/utils/index"
export default {
mixins: [comMixin],
components: {},
props: [],
data() {
return {
dataFormSubmitType: 0,
continueBtnLoading: false,
index: 0,
prevDis: false,
nextDis: false,
allList: [],
visible: false,
loading: false,
btnLoading: false,
formRef: 'formRef',
setting: {},
eventType: '',
userBoxVisible: false,
selectDialogVisible: false,
currTableConf: {},
dataValueAll: {},
addTableConf: {},
//
ableAll: {},
tableRows: {},
Vmodel: "",
currVmodel: "",
dataForm: {
type: "1",
code: undefined,
subjectId: undefined,
contractId: undefined,
payee: undefined,
payer: undefined,
applyAmount: undefined,
caseStatus: "1",
remark: undefined,
closeCaseRemark: undefined,
annex: [],
version: 0,
},
tableRequiredData: {},
dataRule: {
type: [{
required: true,
message: '请至少选择一个',
trigger: 'change'
}, ],
subjectId: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
contractId: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
payee: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
payer: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
applyAmount: [{
required: true,
message: '数字文本',
trigger: ["blur", "change"]
}, ],
},
typeOptions: [{
"fullName": "采购付款",
"id": "1"
}],
typeProps: {
"label": "fullName",
"value": "id"
},
subjectIdcolumnOptions: [{
"label": "名称",
"value": "name"
}, {
"label": "分类",
"value": "calssifyName"
}, {
"label": "星级",
"value": "customerStarRatingName"
}, {
"label": "归属人员",
"value": "belongPeopleName"
}],
contractIdcolumnOptions: [{
"label": "合同编码",
"value": "contract_number"
}, {
"label": "合同名称",
"value": "contract_name"
}, {
"label": "类型",
"value": "contractTypeName"
}, {
"label": "名称",
"value": "subjectName"
},],
caseStatusOptions: [{
"fullName": "正常",
"id": "1"
}, {
"fullName": "结案",
"id": "2"
}],
caseStatusProps: {
"label": "fullName",
"value": "id"
},
childIndex: -1,
isEdit: false,
interfaceRes: {
type: [],
code: [],
subjectId: [],
contractId: [{
"dataType": "varchar",
"defaultValue": "",
"field": "subjectId",
"fieldName": "",
"id": "HmoSU22",
"jnpfKey": "popupSelect",
"relationField": "subjectId",
"required": "1"
}, {
"dataType": "varchar",
"defaultValue": "",
"field": "contractType",
"fieldName": "",
"id": "QnvSU22",
"jnpfKey": "radio",
"relationField": "type",
"required": "1"
}],
payee: [],
payer: [],
applyAmount: [],
caseStatus: [],
remark: [],
closeCaseRemark: [],
annex: [],
},
}
},
computed: {
formOperates() {
return this.setting.formOperates
}
},
watch: {},
created() {
this.getFormById()
if (this.dataForm.id == null || this.dataForm.id == '' && this.dataForm.id == undefined || this.dataForm.id ==
0) {
this.initDefaultData()
this.dataForm.payer = this.$store.getters.userInfo.organizeName
}
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() {},
methods: {
subjectChangeData(model, row) {
this.dataForm.payee = row.name;
},
changeData(model, index) {
this.isEdit = false
this.childIndex = index
let modelAll = model.split("-");
let faceMode = "";
for (let i = 0; i < modelAll.length; i++) {
faceMode += modelAll[i];
}
for (let key in this.interfaceRes) {
if (key != faceMode) {
let faceReList = this.interfaceRes[key]
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options';
if (this[options]) {
this[options]()
}
this.changeData(key, index)
}
}
}
}
},
changeDataFormData(type, data, model, index, defaultValue) {
if (!this.isEdit) {
if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) {
this.dataForm[data][i][model] = defaultValue
} else if (index == i) {
this.dataForm[data][i][model] = defaultValue
}
}
} else {
this.dataForm[data] = defaultValue
}
}
},
dataAll() {},
selfGetInfo(dataForm) {
this.dataInfo(dataForm)
},
beforeSubmit() {
const _data = this.dataList()
return _data
},
selfInit() {
this.dataAll()
},
getFormById() {
getFormById("568458500523427653").then(res => {
this.dataForm.flowId = res.data && res.data.flowId
// this.encode = res.data&&res.data.encode
})
},
exist() {
let isOk = true
for (let key in this.tableRequiredData) {
if (this.dataForm[key] && Array.isArray(this.dataForm[key])) {
for (let i = 0; i < this.dataForm[key].length; i++) {
let item = this.dataForm[key][i]
inner: for (let id in item) {
let arr = this.tableRequiredData[key].filter(o => o.id === id) || []
if (!arr.length) continue inner
if (arr[0].required) {
let msg = `${arr[0].name}不能为空`
let boo = true
if (arr[0].dataType === 'array') {
boo = !this.jnpf.isEmptyArray(item[id])
} else {
boo = !this.jnpf.isEmpty(item[id])
}
if (!boo) {
this.$message({
message: msg,
type: 'error',
duration: 1000
})
isOk = false
break
}
}
}
}
}
}
return isOk
},
goBack() {
this.$emit('refresh')
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
//
initDefaultData() {
},
openSelectDialog(key) {
this.currTableConf = this.addTableConf[key]
this.currVmodel = key
this.selectDialogVisible = true
this.$nextTick(() => {
this.$refs.selectDialog.init()
})
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i]
if (this['get' + this.currVmodel]) {
this['get' + this.currVmodel](t)
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData)
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = new Date().getTime()
} else if (timeType == 4) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
}
} else if (timeType == 5) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
let timeDataValue = null
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || '00:00:00'
if (timeDataValue.split(':').length == 3) {
timeDataValue = timeDataValue
} else {
timeDataValue = timeDataValue + ':00'
}
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format)
} else if (timeType == 4) {
let previousDate = '';
previousDate = getBeforeTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
} else if (timeType == 5) {
let previousDate = '';
previousDate = getLaterTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
}
}
return timeDataValue;
},
dataList() {
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
this.childIndex = -1
},
},
}
</script>

@ -0,0 +1,633 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="单据编号">
<el-input v-model="query.code" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="收款方">
<el-input v-model="query.payee" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="付款方">
<el-input v-model="query.payer" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="制单时间">
<JnpfDateRangePicker v-model="query.preparationTime" format="yyyy-MM-dd"
startPlaceholder="开始日期" endPlaceholder="结束日期">
</JnpfDateRangePicker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button type="primary" icon="icon-ym icon-ym-btn-add" v-has="'btn_add'" @click="addOrUpdateHandle()">
</el-button>
</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="type" align="center" width="150" fixed="left">
<template slot-scope="scope">
{{ scope.row.type}}
</template>
</el-table-column>
<el-table-column prop="code" label="单据编号" align="center" width="200" fixed="left">
</el-table-column>
<el-table-column prop="subjectId" label="供应商" align="center" width="300">
</el-table-column>
<el-table-column prop="contractId" label="合同" align="center" width="300">
</el-table-column>
<el-table-column prop="payee" label="收款方" align="center" width="250">
</el-table-column>
<el-table-column prop="payer" label="付款方" align="center" width="500">
</el-table-column>
<el-table-column prop="applyAmount" label="申请金额" align="center" width="200">
<template slot-scope="scope" v-if="scope.row.applyAmount">
<JnpfNumber v-model="scope.row.applyAmount" :thousands="false" />
</template>
</el-table-column>
<el-table-column prop="flowState" label="状态" width="150" align="center">
<template slot-scope="scope" v-if="!scope.row.top">
<el-tag v-if="scope.row.flowState==1"></el-tag>
<el-tag type="success" v-else-if="scope.row.flowState==2">审核通过</el-tag>
<el-tag type="danger" v-else-if="scope.row.flowState==3">审核驳回</el-tag>
<el-tag type="info" v-else-if="scope.row.flowState==4">流程撤回</el-tag>
<el-tag type="info" v-else-if="scope.row.flowState==5">审核终止</el-tag>
<el-tag type="warning" v-else></el-tag>
</template>
</el-table-column>
<el-table-column prop="caseStatus" label="付款状态" align="center" width="150">
</el-table-column>
<el-table-column label="操作" fixed="right" width="250" align="center">
<template slot-scope="scope">
<el-button type="text" :disabled="[1,2,4,5].indexOf(scope.row.flowState)>-1"
@click="updateHandle(scope.row)" v-has="'btn_edit'">编辑
</el-button>
<el-button type="text" class="JNPF-table-delBtn" :disabled="[1,2,3,5].indexOf(scope.row.flowState)>-1"
v-has="'btn_remove'" @click="handleDel(scope.row.id)">删除
</el-button>
<el-button size="mini" type="text" :disabled="!scope.row.flowState"
@click="updateHandle(scope.row,scope.row.flowState)">详情</el-button>
<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>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
@pagination="initData" />
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<FlowBox v-if="flowVisible" ref="FlowBox" @close="colseFlow" />
<el-dialog title="请选择流程" :close-on-click-modal="false" append-to-body :visible.sync="flowListVisible"
class="JNPF-dialog template-dialog JNPF-dialog_center" lock-scroll width="400px">
<el-scrollbar class="template-list">
<div class="template-item" v-for="item in flowList" :key="item.id" @click="selectFlow(item)">{{item.fullName}}
</div>
</el-scrollbar>
</el-dialog>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson" @superQuery="superQuery" />
</div>
</template>
<script>
import request from '@/utils/request'
import {
mapGetters
} from "vuex";
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import {
getFormById
} from '@/api/workFlow/FormDesign'
import {
getFlowList
} from '@/api/workFlow/FlowEngine'
import FlowBox from '@/views/workFlow/components/FlowBox'
import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getConfigData
} from '@/api/onlineDev/visualDev'
import {
getDefaultCurrentValueUserIdAsync
} from '@/api/permission/user'
import {
getDefaultCurrentValueDepartmentIdAsync
} from '@/api/permission/organize'
import columnList from './columnList'
import {
thousandsFormat
} from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
import {getToken} from "@/utils/auth";
import JNPFForm from './caseCloseForm'
export default {
components: {
JNPFForm,
FlowBox,
ExportBox,
ToFormDetail,
SuperQuery
},
data() {
return {
keyword: '',
expandsTree: true,
refreshTree: true,
toFormDetailVisible: false,
expandObj: {},
columnOptions: [],
mergeList: [],
exportList: [],
columnList,
formVisible: false,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
code: undefined,
payee: undefined,
payer: undefined,
preparationTime: 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,
typeOptions: [{
"fullName": "采购付款",
"id": "1"
}],
typeProps: {
"label": "fullName",
"value": "id"
},
caseStatusOptions: [{
"fullName": "正常",
"id": "1"
}, {
"fullName": "结案",
"id": "2"
}],
caseStatusProps: {
"label": "fullName",
"value": "id"
},
interfaceRes: {
subjectId: [],
contractId: [{
"dataType": "varchar",
"defaultValue": "",
"field": "subjectId",
"fieldName": "",
"id": "HmoSU22",
"jnpfKey": "popupSelect",
"relationField": "subjectId",
"required": "1"
}, {
"dataType": "varchar",
"defaultValue": "",
"field": "contractType",
"fieldName": "",
"id": "QnvSU22",
"jnpfKey": "radio",
"relationField": "type",
"required": "1"
}],
},
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
getFormById("568458500523427653").then(res1 => {
let flowId = res1.data && res1.data.id
getFlowList(flowId, '1').then(res2 => {
this.flowList = res2.data
this.getColumnList(),
this.initSearchDataAndListData()
this.queryData = JSON.parse(JSON.stringify(this.query))
}).catch((e) => {
this.$message({
type: 'error',
message: e.message
});
this.$router.push('/404');
})
})
},
methods: {
downPayment(id) {
let url = "/api/scm/PaymentApplication/downloadPdf/" + id +"/"+getToken();
this.jnpf.downloadFile(url);
},
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.toFormDetailVisible = true
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue)
})
})
},
toggleTreeExpand(expands) {
this.refreshTree = false
this.expandsTree = expands
this.$nextTick(() => {
this.refreshTree = true
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null)
})
})
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data
const config = {
treeInterfaceId: "",
treeTemplateJson: []
}
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || ''
}
}
//
let query = {
paramList: config.treeTemplateJson || [],
}
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
})
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList)
},
transformColumnList(columnList) {
let list = []
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes('-')) {
list.push(e)
} else {
let prop = e.prop.split('-')[0]
let label = e.label.split('-')[0]
let vModel = e.prop.split('-')[1]
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
}
e.vModel = vModel
if (!this.expandObj.hasOwnProperty(`${prop}Expand`)) this.$set(this.expandObj, `${prop}Expand`, false)
if (!list.some(o => o.prop === prop)) list.push(newItem)
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e)
break
}
}
}
}
this.getMergeList(list)
this.getExportList(list)
return list
},
arraySpanMethod({
column
}) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list))
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + '-child-first'
}
item.children.unshift(child)
}
})
newList.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
})
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
})
}
})
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
})
}
})
},
getExportList(list) {
let exportList = []
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === 'table') {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j])
}
} else {
exportList.push(list[i])
}
}
this.exportList = exportList
},
goDetail(id) {
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(id)
})
},
sortChange({
column,
prop,
order
}) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
},
//
async initSearchData() {
let date = new Date();
let dateWithoutTime = new Date(date.getFullYear(), date.getMonth(), date.getDate());
this.query.preparationTime = [dateWithoutTime.getTime(), dateWithoutTime.getTime()]
},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId: this.menuId,
moduleId: '568458500523427653',
type: 1,
};
request({
url: `/api/scm/PaymentApplication/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/PaymentApplication/${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/PaymentApplication")
})
},
openSuperQuery() {
this.superQueryVisible = true
this.$nextTick(() => {
this.$refs.SuperQuery.init()
})
},
superQuery(queryJson) {
this.listQuery.superQueryJson = queryJson
this.listQuery.currentPage = 1
this.initData()
},
addOrUpdateHandle(row, flowState) {
if (!row) {
this.addHandle();
} else {
this.updateHandle(row, flowState)
}
},
exportData() {
this.exportBoxVisible = true
this.$nextTick(() => {
this.$refs.ExportBox.init(this.exportList)
})
},
download(data) {
let query = {
...data,
...this.listQuery,
...this.query,
menuId: this.menuId
}
request({
url: `/api/scm/PaymentApplication/Actions/Export`,
method: 'post',
data: query
}).then(res => {
if (!res.data.url) return
this.jnpf.downloadFile(res.data.url)
this.$refs.ExportBox.visible = false
this.exportBoxVisible = false
})
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.initData()
},
//
updateHandle(row, flowState) {
let data = {
id: row.id,
flowId: row.flowId || this.flowList[0].id,
opType: flowState ? 0 : '-1',
status: flowState
}
this.flowVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
closeCaseHandle(row, isDetail) {
let id = row?row.id:""
this.formVisible = true
this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail,this.list)
})
},
toApprovalDetail(row) {
let data = {
id: row.id,
flowId: row.flowId,
opType: 0,
status: row.currentState
}
this.formVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
addHandle() {
if (!this.flowList.length) {
this.$message({
type: 'error',
message: '流程不存在'
});
} else if (this.flowList.length === 1) {
this.selectFlow(this.flowList[0])
} else {
this.flowListVisible = true
}
},
//
selectFlow(item) {
let data = {
id: '',
formType: 1,
flowId: item.id,
opType: '-1'
}
this.flowListVisible = false
this.flowVisible = true
this.$nextTick(() => {
this.$refs.FlowBox.init(data)
})
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData))
this.search()
},
colseFlow(isrRefresh) {
this.flowVisible = false
if (isrRefresh) this.reset()
},
}
}
</script>

File diff suppressed because one or more lines are too long

@ -444,7 +444,7 @@ export default {
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
// this.initData()
},
//
async initSearchData() {

@ -250,7 +250,7 @@ export default {
isLeaf: "isLeaf"
},
list: [],
listLoading: true,
listLoading: false,
multipleSelection: [],
total: 0,
queryData: {},
@ -551,7 +551,7 @@ export default {
},
async initSearchDataAndListData() {
await this.initSearchData();
this.initData();
// this.initData();
},
//
async initSearchData() { },

@ -179,7 +179,7 @@ export default {
isLeaf: 'isLeaf'
},
list: [],
listLoading: true,
listLoading: false,
multipleSelection: [], total: 0,
queryData: {},
listQuery: {
@ -374,7 +374,7 @@ export default {
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
// this.initData()
},
//
async initSearchData() {

@ -219,7 +219,7 @@ export default {
isLeaf: "isLeaf"
},
list: [],
listLoading: true,
listLoading: false,
total: 0,
queryData: {},
listQuery: {
@ -609,7 +609,7 @@ export default {
},
async initSearchDataAndListData() {
await this.initSearchData();
this.initData();
// this.initData();
},
//
async initSearchData() { },

@ -180,7 +180,7 @@ export default {
isLeaf: 'isLeaf'
},
list: [],
listLoading: true,
listLoading: false,
multipleSelection: [],
total: 0,
queryData: {},
@ -397,7 +397,7 @@ export default {
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
// this.initData()
},
//
async initSearchData() { },

@ -98,7 +98,7 @@ export default {
if (excludeIdList && excludeIdList instanceof Array) {
this.excludeIdList = excludeIdList;
}
if (val && typeof(val) == 'string') {
if (val && typeof (val) == 'string') {
this.val = val;
}
let query = {
@ -107,6 +107,7 @@ export default {
excludeIdList: this.excludeIdList,
dataType: 0,
id: this.val,
inventoryType: 3,
}
/* GoodsList(query).then(res => {
this.list = res.data.list

@ -87,7 +87,7 @@ export default {
if (excludeIdList && excludeIdList instanceof Array) {
this.excludeIdList = excludeIdList;
}
if (val && typeof(val) == 'string') {
if (val && typeof (val) == 'string') {
this.val = val;
}
let query = {

@ -174,7 +174,7 @@ export default {
isLeaf: 'isLeaf'
},
list: [],
listLoading: true,
listLoading: false,
multipleSelection: [], total: 0,
queryData: {},
listQuery: {
@ -371,7 +371,7 @@ export default {
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
// this.initData()
},
//
async initSearchData() {

@ -443,7 +443,7 @@ export default {
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
// this.initData()
},
//
async initSearchData() {

@ -497,7 +497,7 @@ export default {
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
// this.initData()
},
//
async initSearchData() {

@ -49,9 +49,9 @@
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button type="primary" icon="icon-ym icon-ym-btn-add" v-has="'btn_add'"
<!-- <el-button type="primary" icon="icon-ym icon-ym-btn-add" v-has="'btn_add'"
@click="addOrUpdateHandle()">新增
</el-button>
</el-button> -->
<el-button type="text" icon="icon-ym icon-ym-btn-download" @click="exportData()"
v-has="'btn_download'">导出
</el-button>
@ -222,7 +222,7 @@ export default {
isLeaf: 'isLeaf'
},
list: [],
listLoading: true,
listLoading: false,
multipleSelection: [], total: 0,
queryData: {},
listQuery: {
@ -435,7 +435,7 @@ export default {
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
// this.initData()
},
//
async initSearchData() {

@ -473,7 +473,7 @@ export default {
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
// this.initData()
},
//
async initSearchData() {

@ -483,7 +483,7 @@ export default {
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
// this.initData()
},
//
async initSearchData() {

@ -499,7 +499,7 @@ export default {
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
// this.initData()
},
//
async initSearchData() {

@ -55,9 +55,9 @@
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button type="primary" icon="icon-ym icon-ym-btn-add" v-has="'btn_add'"
<!-- <el-button type="primary" icon="icon-ym icon-ym-btn-add" v-has="'btn_add'"
@click="addOrUpdateHandle()">新增
</el-button>
</el-button> -->
<el-button type="text" icon="icon-ym icon-ym-btn-download" @click="exportData()"
v-has="'btn_download'">导出
</el-button>
@ -250,7 +250,7 @@ export default {
isLeaf: 'isLeaf'
},
list: [],
listLoading: true,
listLoading: false,
multipleSelection: [],
total: 0,
queryData: {},
@ -507,7 +507,7 @@ export default {
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
// this.initData()
},
//
async initSearchData() { },

@ -215,7 +215,7 @@ export default {
isLeaf: 'isLeaf'
},
list: [],
listLoading: true,
listLoading: false,
multipleSelectionItem: [],
multipleSelection: [], total: 0,
queryData: {},
@ -479,7 +479,7 @@ export default {
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
// this.initData()
},
//
async initSearchData() {

@ -119,7 +119,6 @@
<el-button size="mini" type="text" :disabled="!scope.row.flowState"
@click="updateHandle(scope.row, scope.row.flowState)">详情</el-button>
</el-button>
<el-button v-if="scope.row.warehousingStatus != 4" size="mini" type="text"
v-has="'btn-warehousing'" @click="addwarehousing(scope.row)">出库
@ -219,7 +218,7 @@ export default {
isLeaf: 'isLeaf'
},
list: [],
listLoading: true,
listLoading: false,
multipleSelectionItem: [],
multipleSelection: [], total: 0,
queryData: {},
@ -482,7 +481,7 @@ export default {
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
// this.initData()
},
//
async initSearchData() {

@ -448,7 +448,7 @@ export default {
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
// this.initData()
},
//
async initSearchData() {

Loading…
Cancel
Save