Merge remote-tracking branch 'origin/main'

# Conflicts:
#	SC-web/src/views/scm/basicInformation/material/Form.vue
product
chuang 2 years ago
commit 35741ee8c9

@ -53,31 +53,31 @@ public class TokenInterceptor implements HandlerInterceptor {
//测试版本可以关闭验证 //测试版本可以关闭验证
if ("false".equals(configValueUtil.getTestVersion())) { if ("false".equals(configValueUtil.getTestVersion())) {
//token验证 //token验证
// if (StringUtil.isEmpty(realToken) || !redisUtil.exists(realToken)) { if (StringUtil.isEmpty(realToken) || !redisUtil.exists(realToken)) {
// ActionResult result = ActionResult.fail(ActionResultCode.SessionOverdue.getCode(), ActionResultCode.SessionOverdue.getMessage()); ActionResult result = ActionResult.fail(ActionResultCode.SessionOverdue.getCode(), ActionResultCode.SessionOverdue.getMessage());
// ServletUtil.renderString(response, JsonUtil.getObjectToString(result)); ServletUtil.renderString(response, JsonUtil.getObjectToString(result));
// return false; return false;
// } }
// //是否过期 //是否过期
// Date exp = JwtUtil.getExp(token); Date exp = JwtUtil.getExp(token);
// if (exp.getTime() < System.currentTimeMillis()) { if (exp.getTime() < System.currentTimeMillis()) {
// ActionResult result = ActionResult.fail(ActionResultCode.SessionOverdue.getCode(), ActionResultCode.SessionOverdue.getMessage()); ActionResult result = ActionResult.fail(ActionResultCode.SessionOverdue.getCode(), ActionResultCode.SessionOverdue.getMessage());
// ServletUtil.renderString(response, JsonUtil.getObjectToString(result)); ServletUtil.renderString(response, JsonUtil.getObjectToString(result));
// return false; return false;
// } }
// //判断是否可多人登录 //判断是否可多人登录
// Integer singleLogin = JwtUtil.getSingleLogin(token); Integer singleLogin = JwtUtil.getSingleLogin(token);
// if (!"1".equals(String.valueOf(singleLogin))) { if (!"1".equals(String.valueOf(singleLogin))) {
// //是否在线 //是否在线
// if (!userProvider.isOnLine()) { if (!userProvider.isOnLine()) {
// ActionResult result = ActionResult.fail(ActionResultCode.SessionOffLine.getCode(), ActionResultCode.SessionOffLine.getMessage()); ActionResult result = ActionResult.fail(ActionResultCode.SessionOffLine.getCode(), ActionResultCode.SessionOffLine.getMessage());
// redisUtil.remove(realToken); redisUtil.remove(realToken);
// ServletUtil.renderString(response, JsonUtil.getObjectToString(result)); ServletUtil.renderString(response, JsonUtil.getObjectToString(result));
// return false; return false;
// } }
// } }
//增加在线过期时间 //增加在线过期时间
// tokenTimeout(userInfo); tokenTimeout(userInfo);
} }
return true; return true;
} }

@ -54,7 +54,7 @@ spring:
config: config:
#===================== 是否开启测试环境 ===================== #===================== 是否开启测试环境 =====================
TestVersion: false TestVersion: true
#===================== 文件模板配置 ===================== #===================== 文件模板配置 =====================
fileType: local #文件存储类型(local-本地存储minio-网络存储) fileType: local #文件存储类型(local-本地存储minio-网络存储)

@ -13,8 +13,11 @@ import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO; import jnpf.base.vo.PaginationVO;
import jnpf.base.UserInfo; import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO; import jnpf.base.vo.DownloadVO;
import jnpf.collection.service.SaleorderCETService;
import jnpf.config.ConfigValueUtil; import jnpf.config.ConfigValueUtil;
import jnpf.exception.DataException; import jnpf.exception.DataException;
import jnpf.saleback.entity.SaleorderEntity;
import org.bytedeco.opencv.presets.opencv_core;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import jnpf.base.entity.ProvinceEntity; import jnpf.base.entity.ProvinceEntity;
import jnpf.collection.model.collection.*; import jnpf.collection.model.collection.*;
@ -44,6 +47,8 @@ import java.io.FileNotFoundException;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import jnpf.util.GeneraterSwapUtil; import jnpf.util.GeneraterSwapUtil;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
import jnpf.util.file.UploadUtil; import jnpf.util.file.UploadUtil;
@ -55,7 +60,7 @@ import jnpf.util.enums.FileTypeEnum;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-11 * @ 2023-02-09
*/ */
@Slf4j @Slf4j
@RestController @RestController
@ -78,23 +83,58 @@ public class CollectionController {
@Autowired @Autowired
private Collection_item0Service collection_item0Service; private Collection_item0Service collection_item0Service;
@Autowired
private SaleorderCETService saleorderCETService;
@PostMapping("/confirmprice")
@Transactional
public ActionResult confirmPrice(@RequestBody CollectionListVO collectionListVO) {
CollectionEntity collectionEntity = collectionService.getInfo(collectionListVO.getId());
if (!collectionEntity.getStatus().equals("2")){
return ActionResult.fail("审核中,请先通过审核");
}
QueryWrapper<Collection_item0Entity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(Collection_item0Entity::getCollectionId,collectionListVO.getId());
List<Collection_item0Entity> collection_item0EntityList = collection_item0Service.list(queryWrapper);
for (Collection_item0Entity collection_item0Entity : collection_item0EntityList){
SaleorderCETEntity saleordercetEntity = saleorderCETService.getById(collection_item0Entity.getSalesorderId());
if (saleordercetEntity.getAmountCollected().equals(saleordercetEntity.getPrice())){
return ActionResult.fail("已回款金额等于金额");
}
if (saleordercetEntity.getAmountCollected()!=null && collection_item0Entity.getAmount() !=null) {
BigDecimal sum =saleordercetEntity.getAmountCollected().add(collection_item0Entity.getAmount());
saleordercetEntity.setAmountCollected(sum);
if (saleordercetEntity.getAmountCollected().compareTo(saleordercetEntity.getPrice()) > 0) {
return ActionResult.fail("总回款金额大于金额");
}
saleordercetEntity.setStatus("2");
saleorderCETService.updateById(saleordercetEntity);
}else {
return ActionResult.fail("已回款金额或回款金额不能为空");
}
}
return ActionResult.success("认款成功");
}
/** /**
* *
* *
* @param collectionPagination * @param collectionPagination
* @return * @return
*/ */
@PostMapping("/getList") @PostMapping("/getList")
public ActionResult list(@RequestBody CollectionPagination collectionPagination)throws IOException{ public ActionResult list(@RequestBody CollectionPagination collectionPagination)throws IOException{
List<CollectionEntity> list= collectionService.getList(collectionPagination); List<CollectionEntity> list= collectionService.getList(collectionPagination);
//处理id字段转名称若无需转或者为空可删除 //处理id字段转名称若无需转或者为空可删除
for(CollectionEntity entity:list){ for(CollectionEntity entity:list){
} Map<String,Object> customerNameMap = new HashMap<>();
List<CollectionListVO> listVO=JsonUtil.getJsonToList(list,CollectionListVO.class); entity.setCustomerName(generaterSwapUtil.getPopupSelectValue("393371066040385285","supplier_nm","supplier_nm",entity.getCustomerName(),customerNameMap));
for(CollectionListVO collectionVO:listVO){ entity.setVoucher(generaterSwapUtil.getFileNameInJson(entity.getVoucher()));
} }
List<CollectionListVO> listVO=JsonUtil.getJsonToList(list,CollectionListVO.class);
for(CollectionListVO jg_collectionVO:listVO){
}
PageListVO vo=new PageListVO(); PageListVO vo=new PageListVO();
@ -116,19 +156,15 @@ public class CollectionController {
public ActionResult create(@RequestBody @Valid CollectionCrForm collectionCrForm) throws DataException { public ActionResult create(@RequestBody @Valid CollectionCrForm collectionCrForm) throws DataException {
String mainId =RandomUtil.uuId(); String mainId =RandomUtil.uuId();
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
collectionCrForm.setDocumentNo(generaterSwapUtil.getBillNumber("collection", false));
CollectionEntity entity = JsonUtil.getJsonToBean(collectionCrForm, CollectionEntity.class); CollectionEntity entity = JsonUtil.getJsonToBean(collectionCrForm, CollectionEntity.class);
entity.setId(mainId); entity.setId(mainId);
collectionService.save(entity); collectionService.save(entity);
List<Collection_item0Entity> Collection_item0List = JsonUtil.getJsonToList(collectionCrForm.getCollection_item0List(),Collection_item0Entity.class); List<Collection_item0Entity> Collection_item0List = JsonUtil.getJsonToList(collectionCrForm.getCollection_item0List(),Collection_item0Entity.class);
for(Collection_item0Entity entitys : Collection_item0List){ for(Collection_item0Entity entitys : Collection_item0List){
entitys.setSalesorderId(entitys.getId());
entitys.setId(RandomUtil.uuId()); entitys.setId(RandomUtil.uuId());
entitys.setCollectionId(entity.getId()); entitys.setCollectionId(entity.getId());
collection_item0Service.save(entitys); collection_item0Service.save(entitys);
} }
@ -172,6 +208,9 @@ public class CollectionController {
List<CollectionEntity> list= collectionService.getTypeList(collectionPagination,collectionPaginationExportModel.getDataType()); List<CollectionEntity> list= collectionService.getTypeList(collectionPagination,collectionPaginationExportModel.getDataType());
//处理id字段转名称若无需转或者为空可删除 //处理id字段转名称若无需转或者为空可删除
for(CollectionEntity entity:list){ for(CollectionEntity entity:list){
Map<String,Object> customerNameMap = new HashMap<>();
entity.setCustomerName(generaterSwapUtil.getPopupSelectValue("393371066040385285","supplier_nm","supplier_nm",entity.getCustomerName(),customerNameMap));
entity.setVoucher(generaterSwapUtil.getFileNameInJson(entity.getVoucher()));
} }
List<CollectionListVO> listVO=JsonUtil.getJsonToList(list,CollectionListVO.class); List<CollectionListVO> listVO=JsonUtil.getJsonToList(list,CollectionListVO.class);
for(CollectionListVO collectionVO:listVO){ for(CollectionListVO collectionVO:listVO){
@ -194,33 +233,33 @@ public class CollectionController {
case "documentNo" : case "documentNo" :
entitys.add(new ExcelExportEntity("单据编号" ,"documentNo")); entitys.add(new ExcelExportEntity("单据编号" ,"documentNo"));
break; break;
case "businessDate" :
entitys.add(new ExcelExportEntity("业务日期" ,"businessDate"));
break;
case "customerName" : case "customerName" :
entitys.add(new ExcelExportEntity("客户名称" ,"customerName")); entitys.add(new ExcelExportEntity("客户名称" ,"customerName"));
break; break;
case "amountCollected" : case "amountCollected" :
entitys.add(new ExcelExportEntity("收款金额" ,"amountCollected")); entitys.add(new ExcelExportEntity("收款金额" ,"amountCollected"));
break; break;
case "paymentType" :
entitys.add(new ExcelExportEntity("收款类型 " ,"paymentType"));
break;
case "collectionCount" : case "collectionCount" :
entitys.add(new ExcelExportEntity("收款账户" ,"collectionCount")); entitys.add(new ExcelExportEntity("收款账户" ,"collectionCount"));
break; break;
case "collectionBank" : case "collectionBank" :
entitys.add(new ExcelExportEntity("收款银行" ,"collectionBank")); entitys.add(new ExcelExportEntity("收款银行" ,"collectionBank"));
break; break;
case "settlementType" : case "paymentType" :
entitys.add(new ExcelExportEntity("结算类型" ,"settlementType")); entitys.add(new ExcelExportEntity("收款类型 " ,"paymentType"));
break; break;
case "currency" : case "currency" :
entitys.add(new ExcelExportEntity("币别 " ,"currency")); entitys.add(new ExcelExportEntity("币别 " ,"currency"));
break; break;
case "settlementType" :
entitys.add(new ExcelExportEntity("结算类型" ,"settlementType"));
break;
case "remark" : case "remark" :
entitys.add(new ExcelExportEntity("备注信息" ,"remark")); entitys.add(new ExcelExportEntity("备注信息" ,"remark"));
break; break;
case "voucher" :
entitys.add(new ExcelExportEntity("收款凭证" ,"voucher"));
break;
case "status" : case "status" :
entitys.add(new ExcelExportEntity("单据状态 " ,"status")); entitys.add(new ExcelExportEntity("单据状态 " ,"status"));
break; break;
@ -293,9 +332,24 @@ public class CollectionController {
//子表 //子表
List<Collection_item0Entity> Collection_item0List = collectionService.GetCollection_item0List(id); List<Collection_item0Entity> Collection_item0List = collectionService.GetCollection_item0List(id);
List<Collection_item0Model> collection_item0ModelList = new ArrayList<>();
Collection_item0Model collection_item0Model = new Collection_item0Model();
for(Collection_item0Entity collection_item0Entity : Collection_item0List){ for(Collection_item0Entity collection_item0Entity : Collection_item0List){
SaleorderCETEntity saleorderCETEntity = saleorderCETService.getById(collection_item0Entity.getSalesorderId());
collection_item0Model.setId(collection_item0Entity.getSalesorderId());
collection_item0Model.setAmount(String.valueOf(collection_item0Entity.getAmount()));
collection_item0Model.setPrice(String.valueOf(saleorderCETEntity.getPrice()));
collection_item0Model.setAmountCollected(String.valueOf(saleorderCETEntity.getAmountCollected()));
collection_item0Model.setDocumentNo(String.valueOf(saleorderCETEntity.getDocumentNo()));
collection_item0Model.setContractCode(String.valueOf(saleorderCETEntity.getContractCode()));
collection_item0Model.setNum(String.valueOf(saleorderCETEntity.getNum()));
collection_item0Model.setAdvanceAmount(String.valueOf(saleorderCETEntity.getAdvanceAmount()));
collection_item0Model.setRate(String.valueOf(saleorderCETEntity.getRate()));
collection_item0Model.setNotPrice(String.valueOf(saleorderCETEntity.getNotPrice()));
collection_item0Model.setCreatorTime(String.valueOf(saleorderCETEntity.getCreatorTime()));
collection_item0ModelList.add(collection_item0Model);
} }
vo.setCollection_item0List(JsonUtil.getJsonToList(Collection_item0List,Collection_item0Model.class )); vo.setCollection_item0List(JsonUtil.getJsonToList(collection_item0ModelList,Collection_item0Model.class ));
//副表 //副表
return ActionResult.success(vo); return ActionResult.success(vo);
} }
@ -315,12 +369,15 @@ public class CollectionController {
List<Collection_item0Entity> jg_collection_item0List = collectionService.GetCollection_item0List(id); List<Collection_item0Entity> jg_collection_item0List = collectionService.GetCollection_item0List(id);
List<Collection_item0Model> jg_collection_item0ModelList = JsonUtil.getJsonToList(jg_collection_item0List,Collection_item0Model.class); List<Collection_item0Model> jg_collection_item0ModelList = JsonUtil.getJsonToList(jg_collection_item0List,Collection_item0Model.class);
for(Collection_item0Model jg_collection_item0Model : jg_collection_item0ModelList){ for(Collection_item0Model jg_collection_item0Model : jg_collection_item0ModelList){
Map<String,Object> deleteTimeMap = new HashMap<>();
jg_collection_item0Model.setDocumentNo(generaterSwapUtil.getPopupSelectValue("393372436705378053","document_no","document_no",jg_collection_item0Model.getDocumentNo(),deleteTimeMap));
} }
vo.setCollection_item0List(jg_collection_item0ModelList); vo.setCollection_item0List(jg_collection_item0ModelList);
//附表数据转换 //附表数据转换
//添加到详情表单对象中 //添加到详情表单对象中
vo.setVoucher(generaterSwapUtil.getFileNameInJson(vo.getVoucher()));
return ActionResult.success(vo); return ActionResult.success(vo);
} }
@ -339,6 +396,9 @@ public class CollectionController {
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid CollectionUpForm collectionUpForm) throws DataException { public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid CollectionUpForm collectionUpForm) throws DataException {
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
CollectionEntity entity= collectionService.getInfo(id); CollectionEntity entity= collectionService.getInfo(id);
if (entity.getStatus().equals("2") || entity.getStatus().equals("3")){
return ActionResult.fail("已审核,不允许编辑");
}
if(entity!=null){ if(entity!=null){
CollectionEntity subentity=JsonUtil.getJsonToBean(collectionUpForm, CollectionEntity.class); CollectionEntity subentity=JsonUtil.getJsonToBean(collectionUpForm, CollectionEntity.class);
collectionService.update(id, subentity); collectionService.update(id, subentity);
@ -346,15 +406,13 @@ public class CollectionController {
QueryWrapper<Collection_item0Entity> Collection_item0queryWrapper = new QueryWrapper<>(); QueryWrapper<Collection_item0Entity> Collection_item0queryWrapper = new QueryWrapper<>();
Collection_item0queryWrapper.lambda().eq(Collection_item0Entity::getCollectionId, entity.getId()); Collection_item0queryWrapper.lambda().eq(Collection_item0Entity::getCollectionId, entity.getId());
collection_item0Service.remove(Collection_item0queryWrapper); collection_item0Service.remove(Collection_item0queryWrapper);
for (Collection_item0Model collection_item0Model : collectionUpForm.getCollection_item0List()){
collection_item0Model.setCreatorTime(null);
}
List<Collection_item0Entity> Collection_item0List = JsonUtil.getJsonToList(collectionUpForm.getCollection_item0List(),Collection_item0Entity.class); List<Collection_item0Entity> Collection_item0List = JsonUtil.getJsonToList(collectionUpForm.getCollection_item0List(),Collection_item0Entity.class);
for(Collection_item0Entity entitys : Collection_item0List){ for(Collection_item0Entity entitys : Collection_item0List){
entitys.setSalesorderId(entitys.getId());
entitys.setId(RandomUtil.uuId()); entitys.setId(RandomUtil.uuId());
entitys.setCollectionId(entity.getId()); entitys.setCollectionId(entity.getId());
collection_item0Service.save(entitys); collection_item0Service.save(entitys);

@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-11 * @ 2023-02-09
*/ */
@Data @Data
@TableName("jg_collection") @TableName("jg_collection")
@ -26,36 +26,6 @@ public class CollectionEntity {
@TableId("ID") @TableId("ID")
private String id; private String id;
@TableField("CREATOR_USER_ID")
private String creatorUserId;
@TableField("CREATOR_USER_NAME")
private String creatorUserName;
@TableField("CREATOR_TIME")
private Date creatorTime;
@TableField("LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("LAST_MODIFY_USER_NAME")
private String lastModifyUserName;
@TableField("LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("DELETE_USER_ID")
private String deleteUserId;
@TableField("DELETE_USER_NAME")
private String deleteUserName;
@TableField("DELETE_TIME")
private Date deleteTime;
@TableField("DELETE_MARK")
private String deleteMark;
@TableField("ORGNIZE_ID") @TableField("ORGNIZE_ID")
private String orgnizeId; private String orgnizeId;
@ -92,9 +62,15 @@ public class CollectionEntity {
@TableField("PAYMENT_TYPE") @TableField("PAYMENT_TYPE")
private String paymentType; private String paymentType;
@TableField("VOUCHER")
private String voucher;
@TableField("SETTLEMENT_TYPE") @TableField("SETTLEMENT_TYPE")
private String settlementType; private String settlementType;
@TableField("IS_COLLECTION")
private String IS_COLLECTION;
@TableField("REMARK") @TableField("REMARK")
private String remark; private String remark;
@ -104,4 +80,34 @@ public class CollectionEntity {
@TableField("COLLECTION_BANK") @TableField("COLLECTION_BANK")
private String collectionBank; private String collectionBank;
@TableField("CREATOR_USER_ID")
private String creatorUserId;
@TableField("CREATOR_USER_NAME")
private String creatorUserName;
@TableField("CREATOR_TIME")
private Date creatorTime;
@TableField("LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("LAST_MODIFY_USER_NAME")
private String lastModifyUserName;
@TableField("LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("DELETE_USER_ID")
private String deleteUserId;
@TableField("DELETE_USER_NAME")
private String deleteUserName;
@TableField("DELETE_TIME")
private Date deleteTime;
@TableField("DELETE_MARK")
private String deleteMark;
} }

@ -8,11 +8,8 @@ import lombok.Data;
import java.util.Date; 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 com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import org.bytedeco.opencv.presets.opencv_core;
/** /**
@ -21,7 +18,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-11 * @ 2023-02-09
*/ */
@Data @Data
@TableName("jg_collection_item0") @TableName("jg_collection_item0")
@ -69,34 +66,10 @@ public class Collection_item0Entity {
@TableField("COLLECTION_ID") @TableField("COLLECTION_ID")
private String collectionId; private String collectionId;
@TableField("ORDER_ID") @TableField("SALESORDER_ID")
private Integer orderId; private String salesorderId;
@TableField("CAR_NUMBER")
private String carNumber;
@TableField("MATERIAL_NAME")
private String materialName;
@TableField("QUANTITY")
private BigDecimal quantity;
@TableField("SALE_PRICE")
private BigDecimal salePrice;
@TableField("TAX_RATE")
private String taxRate;
@TableField("AMOUNT") @TableField("AMOUNT")
private BigDecimal amount; private BigDecimal amount;
@TableField("AMOUNT_NOT_TAX")
private BigDecimal amountNotTax;
@TableField("TAX_AMOUNT")
private BigDecimal taxAmount;
@TableField("REMARK")
private String remark;
} }

@ -0,0 +1,144 @@
package jnpf.collection.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-03
*/
@Data
@TableName("jg_salesorder")
public class SaleorderCETEntity {
@TableId("ID")
private String id;
@TableField("CREATOR_USER_ID")
private String creatorUserId;
@TableField("CREATOR_USER_NAME")
private String creatorUserName;
@TableField("CREATOR_TIME")
private Date creatorTime;
@TableField("LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("LAST_MODIFY_USER_NAME")
private String lastModifyUserName;
@TableField("LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("DELETE_USER_ID")
private String deleteUserId;
@TableField("DELETE_USER_NAME")
private String deleteUserName;
@TableField("DELETE_TIME")
private Date deleteTime;
@TableField("DELETE_MARK")
private String deleteMark;
@TableField("ORGNIZE_ID")
private String orgnizeId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("DOCUMENT_NO")
private String documentNo;
@TableField("ERP_NO")
private String erpNo;
@TableField("SOURCE_PO_NO")
private String sourcePoNo;
@TableField("CONTRACT_CODE")
private String contractCode;
@TableField("CONTRACT_NAME")
private String contractName;
@TableField("CONTRACT_NO")
private String contractNo;
@TableField("COSTOMER_CODE")
private String costomerCode;
@TableField("COSTOMER_NAME")
private String costomerName;
@TableField("NUM")
private BigDecimal num;
@TableField("PRICE")
private BigDecimal price;
@TableField("NOT_PRICE")
private BigDecimal notPrice;
@TableField("RATE")
private BigDecimal rate;
@TableField("POUND_NUM")
private Integer poundNum;
@TableField("CURRENCY")
private String currency;
@TableField("ADVANCE_AMOUNT")
private BigDecimal advanceAmount;
@TableField("AMOUNT_COLLECTED")
private BigDecimal amountCollected;
@TableField("INVOICE_NUM")
private BigDecimal invoiceNum;
@TableField("INVOICE_AMOUNT")
private BigDecimal invoiceAmount;
@TableField("RETURN_QUANTITY")
private BigDecimal returnQuantity;
@TableField("REF_AMOUNT")
private BigDecimal reamount;
@TableField("STATUS")
private String status;
@TableField("SOURCE_SYSTEM")
private String sourceSystem;
@TableField("IS_SETTLE")
private String isSettle;
@TableField("ISSUE")
private String issue;
@TableField("REMARK")
private String remark;
@TableField("CLOSING_DATE")
private Date closingDate;
@TableField("OVERDUE_INTEREST")
private BigDecimal overdueInterest;
}

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-11 * 2023-02-09
*/ */
public interface CollectionMapper extends BaseMapper<CollectionEntity> { public interface CollectionMapper extends BaseMapper<CollectionEntity> {

@ -10,7 +10,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-11 * 2023-02-09
*/ */
public interface Collection_item0Mapper extends BaseMapper<Collection_item0Entity> { public interface Collection_item0Mapper extends BaseMapper<Collection_item0Entity> {

@ -0,0 +1,17 @@
package jnpf.collection.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.collection.entity.SaleorderCETEntity;
/**
*
* saleorder
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-03
*/
public interface SaleorderCETMapper extends BaseMapper<SaleorderCETEntity> {
}

@ -15,19 +15,19 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-11 * @ 2023-02-09
*/ */
@Data @Data
public class CollectionCrForm { public class CollectionCrForm {
/** 客户名称 **/
@JsonProperty("customerCode")
private String customerCode;
/** 单据编号 **/ /** 单据编号 **/
@JsonProperty("documentNo") @JsonProperty("documentNo")
private String documentNo; private String documentNo;
/** 业务日期 **/
@JsonProperty("businessDate")
private Long businessDate;
/** 客户名称 **/ /** 客户名称 **/
@JsonProperty("customerName") @JsonProperty("customerName")
private String customerName; private String customerName;
@ -36,10 +36,6 @@ public class CollectionCrForm {
@JsonProperty("amountCollected") @JsonProperty("amountCollected")
private String amountCollected; private String amountCollected;
/** 收款类型 **/
@JsonProperty("paymentType")
private String paymentType;
/** 收款账户 **/ /** 收款账户 **/
@JsonProperty("collectionCount") @JsonProperty("collectionCount")
private String collectionCount; private String collectionCount;
@ -48,18 +44,26 @@ public class CollectionCrForm {
@JsonProperty("collectionBank") @JsonProperty("collectionBank")
private String collectionBank; private String collectionBank;
/** 结算类型 **/ /** 收款类型 **/
@JsonProperty("settlementType") @JsonProperty("paymentType")
private String settlementType; private String paymentType;
/** 币别 **/ /** 币别 **/
@JsonProperty("currency") @JsonProperty("currency")
private String currency; private String currency;
/** 结算类型 **/
@JsonProperty("settlementType")
private String settlementType;
/** 备注信息 **/ /** 备注信息 **/
@JsonProperty("remark") @JsonProperty("remark")
private String remark; private String remark;
/** 收款凭证 **/
@JsonProperty("voucher")
private String voucher;
/** 单据状态 **/ /** 单据状态 **/
@JsonProperty("status") @JsonProperty("status")
private String status; private String status;

@ -16,7 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-11 * @ 2023-02-09
*/ */
@Data @Data
public class CollectionInfoVO{ public class CollectionInfoVO{
@ -28,9 +28,9 @@ public class CollectionInfoVO{
@JsonProperty("documentNo") @JsonProperty("documentNo")
private String documentNo; private String documentNo;
/** 业务日期 **/ /** 客户名称 **/
@JsonProperty("businessDate") @JsonProperty("customerCode")
private Long businessDate; private String customerCode;
/** 客户名称 **/ /** 客户名称 **/
@JsonProperty("customerName") @JsonProperty("customerName")
@ -40,10 +40,6 @@ public class CollectionInfoVO{
@JsonProperty("amountCollected") @JsonProperty("amountCollected")
private String amountCollected; private String amountCollected;
/** 收款类型 **/
@JsonProperty("paymentType")
private String paymentType;
/** 收款账户 **/ /** 收款账户 **/
@JsonProperty("collectionCount") @JsonProperty("collectionCount")
private String collectionCount; private String collectionCount;
@ -52,18 +48,26 @@ public class CollectionInfoVO{
@JsonProperty("collectionBank") @JsonProperty("collectionBank")
private String collectionBank; private String collectionBank;
/** 结算类型 **/ /** 收款类型 **/
@JsonProperty("settlementType") @JsonProperty("paymentType")
private String settlementType; private String paymentType;
/** 币别 **/ /** 币别 **/
@JsonProperty("currency") @JsonProperty("currency")
private String currency; private String currency;
/** 结算类型 **/
@JsonProperty("settlementType")
private String settlementType;
/** 备注信息 **/ /** 备注信息 **/
@JsonProperty("remark") @JsonProperty("remark")
private String remark; private String remark;
/** 收款凭证 **/
@JsonProperty("voucher")
private String voucher;
/** 单据状态 **/ /** 单据状态 **/
@JsonProperty("status") @JsonProperty("status")
private String status; private String status;

@ -10,7 +10,7 @@ import java.util.List;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-11 * @ 2023-02-09
*/ */
@Data @Data
public class CollectionListQuery extends Pagination { public class CollectionListQuery extends Pagination {

@ -15,7 +15,7 @@ import java.math.BigDecimal;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-11 * @ 2023-02-09
*/ */
@Data @Data
public class CollectionListVO{ public class CollectionListVO{
@ -28,11 +28,9 @@ public class CollectionListVO{
@JsonProperty("documentNo") @JsonProperty("documentNo")
private String documentNo; private String documentNo;
/** 客户名称 **/
/** 业务日期 **/ @JsonProperty("customerCode")
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private String customerCode;
@JsonProperty("businessDate")
private Date businessDate;
/** 客户名称 **/ /** 客户名称 **/
@ -45,11 +43,6 @@ public class CollectionListVO{
private String amountCollected; private String amountCollected;
/** 收款类型 **/
@JsonProperty("paymentType")
private String paymentType;
/** 收款账户 **/ /** 收款账户 **/
@JsonProperty("collectionCount") @JsonProperty("collectionCount")
private String collectionCount; private String collectionCount;
@ -60,9 +53,9 @@ public class CollectionListVO{
private String collectionBank; private String collectionBank;
/** 结算类型 **/ /** 收款类型 **/
@JsonProperty("settlementType") @JsonProperty("paymentType")
private String settlementType; private String paymentType;
/** 币别 **/ /** 币别 **/
@ -70,11 +63,21 @@ public class CollectionListVO{
private String currency; private String currency;
/** 结算类型 **/
@JsonProperty("settlementType")
private String settlementType;
/** 备注信息 **/ /** 备注信息 **/
@JsonProperty("remark") @JsonProperty("remark")
private String remark; private String remark;
/** 收款凭证 **/
@JsonProperty("voucher")
private String voucher;
/** 单据状态 **/ /** 单据状态 **/
@JsonProperty("status") @JsonProperty("status")
private String status; private String status;

@ -11,7 +11,7 @@ import java.util.List;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-11 * @ 2023-02-09
*/ */
@Data @Data
public class CollectionPagination extends Pagination { public class CollectionPagination extends Pagination {

@ -9,7 +9,7 @@ import java.util.*;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-11 * @ 2023-02-09
*/ */
@Data @Data
public class CollectionPaginationExportModel extends Pagination { public class CollectionPaginationExportModel extends Pagination {

@ -16,7 +16,7 @@ import lombok.Data;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-11 * @ 2023-02-09
*/ */
@Data @Data
public class CollectionUpForm{ public class CollectionUpForm{
@ -28,10 +28,9 @@ public class CollectionUpForm{
@JsonProperty("documentNo") @JsonProperty("documentNo")
private String documentNo; private String documentNo;
/** 客户名称 **/
/** 业务日期 **/ @JsonProperty("customerCode")
@JsonProperty("businessDate") private String customerCode;
private Long businessDate;
/** 客户名称 **/ /** 客户名称 **/
@ -44,11 +43,6 @@ public class CollectionUpForm{
private String amountCollected; private String amountCollected;
/** 收款类型 **/
@JsonProperty("paymentType")
private String paymentType;
/** 收款账户 **/ /** 收款账户 **/
@JsonProperty("collectionCount") @JsonProperty("collectionCount")
private String collectionCount; private String collectionCount;
@ -59,9 +53,9 @@ public class CollectionUpForm{
private String collectionBank; private String collectionBank;
/** 结算类型 **/ /** 收款类型 **/
@JsonProperty("settlementType") @JsonProperty("paymentType")
private String settlementType; private String paymentType;
/** 币别 **/ /** 币别 **/
@ -69,11 +63,21 @@ public class CollectionUpForm{
private String currency; private String currency;
/** 结算类型 **/
@JsonProperty("settlementType")
private String settlementType;
/** 备注信息 **/ /** 备注信息 **/
@JsonProperty("remark") @JsonProperty("remark")
private String remark; private String remark;
/** 收款凭证 **/
@JsonProperty("voucher")
private String voucher;
/** 单据状态 **/ /** 单据状态 **/
@JsonProperty("status") @JsonProperty("status")
private String status; private String status;

@ -13,34 +13,53 @@ import com.alibaba.fastjson.annotation.JSONField;
* V3.2.0 * V3.2.0
* : LINKAGE-BOOT * : LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-11 * 2023-02-09
*/ */
@Data @Data
public class Collection_item0Model { public class Collection_item0Model {
/** 金额 **/ /** 收款金额 **/
@JsonProperty("amount") @JsonProperty("amount")
private String amount; private String amount;
/** 数量 **/ /** 销售订单主表id **/
@JsonProperty("quantity") @JsonProperty("id")
private String quantity; private String id;
/** 税率 **/ /** 订单金额 **/
@JsonProperty("taxRate") @JsonProperty("price")
private String taxRate; private String price;
/** 已收款金额 **/
@JsonProperty("amountCollected")
private String amountCollected;
/** 销售订单编号 **/
@JsonProperty("documentNo")
private String documentNo;
/** 合同编号 **/
@JsonProperty("contractCode")
private String contractCode;
/** 重量 **/
@JsonProperty("num")
private String num;
/** 垫资金额 **/
@JsonProperty("advanceAmount")
private String advanceAmount;
/** 税额 **/ /** 税额 **/
@JsonProperty("taxAmount") @JsonProperty("rate")
private String taxAmount; private String rate;
/** 不含税金额 **/ /** 不含税金额 **/
@JsonProperty("amountNotTax") @JsonProperty("notPrice")
private String amountNotTax; private String notPrice;
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** 业务日期 **/
@JsonProperty("creatorTime")
private String creatorTime;
} }

@ -12,7 +12,7 @@ import java.util.*;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-11 * 2023-02-09
*/ */
public interface CollectionService extends IService<CollectionEntity> { public interface CollectionService extends IService<CollectionEntity> {

@ -8,7 +8,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-11 * 2023-02-09
*/ */
public interface Collection_item0Service extends IService<Collection_item0Entity> { public interface Collection_item0Service extends IService<Collection_item0Entity> {

@ -0,0 +1,20 @@
package jnpf.collection.service;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.collection.entity.*;
import jnpf.saleorder.model.saleorder.SaleorderPagination;
import java.util.List;
/**
*
* saleorder
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-03
*/
public interface SaleorderCETService extends IService<SaleorderCETEntity> {
}

@ -38,7 +38,7 @@ import java.util.*;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-11 * 2023-02-09
*/ */
@Service @Service
public class CollectionServiceImpl extends ServiceImpl<CollectionMapper, CollectionEntity> implements CollectionService{ public class CollectionServiceImpl extends ServiceImpl<CollectionMapper, CollectionEntity> implements CollectionService{

@ -32,7 +32,7 @@ import java.util.*;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-11 * 2023-02-09
*/ */
@Service @Service
public class Collection_item0ServiceImpl extends ServiceImpl<Collection_item0Mapper, Collection_item0Entity> implements Collection_item0Service{ public class Collection_item0ServiceImpl extends ServiceImpl<Collection_item0Mapper, Collection_item0Entity> implements Collection_item0Service{

@ -0,0 +1,28 @@
package jnpf.collection.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.collection.entity.*;
import jnpf.collection.mapper.SaleorderCETMapper;
import jnpf.collection.service.*;
import org.springframework.stereotype.Service;
/**
*
* saleorder
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-03
*/
@Service
public class SaleorderCETServiceImpl extends ServiceImpl<SaleorderCETMapper, SaleorderCETEntity> implements SaleorderCETService {
}

@ -1,55 +1,56 @@
package jnpf.customer.controller; package jnpf.customer.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import jnpf.base.ActionResult; import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO;
import jnpf.base.vo.PageListVO; import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO; import jnpf.base.vo.PaginationVO;
import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil; import jnpf.config.ConfigValueUtil;
import jnpf.customer.entity.CustomerJGEntity;
import jnpf.customer.entity.CustomerJGMobileEntity;
import jnpf.customer.model.customer.*;
import jnpf.customer.service.CustomerJGService;
import jnpf.exception.DataException; import jnpf.exception.DataException;
import org.springframework.transaction.annotation.Transactional;
import jnpf.customer.model.customer.*;
import jnpf.customer.model.customer.CustomerPagination;
import jnpf.util.*; import jnpf.util.*;
import jnpf.util.enums.FileTypeEnum;
import jnpf.util.file.UploadUtil;
import lombok.Cleanup;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import lombok.Cleanup;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.RestController;
import jnpf.customer.entity.CustomerJGMobileEntity;
import jnpf.customer.service.CustomerJGMobileService;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import javax.validation.Valid; import javax.validation.Valid;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import jnpf.util.GeneraterSwapUtil;
import java.util.List; import java.util.*;
import java.util.Map;
import jnpf.util.file.UploadUtil;
import jnpf.util.enums.FileTypeEnum;
/** /**
* *
* * customer
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-04 * @ 2023-02-13
*/ */
@Slf4j @Slf4j
@RestController @RestController
@Api(tags = "客户档案" , value = "customer") @Api(tags = "customer" , value = "customer")
@RequestMapping("/api/customer/Customer") @RequestMapping("/api/customer/Customer")
public class CustomerJGController { public class CustomerJGMobileController {
@Autowired @Autowired
private GeneraterSwapUtil generaterSwapUtil; private GeneraterSwapUtil generaterSwapUtil;
@ -61,7 +62,7 @@ public class CustomerJGController {
private UserProvider userProvider; private UserProvider userProvider;
@Autowired @Autowired
private CustomerJGService customerService; private CustomerJGMobileService customerJGMobileService;
@ -74,9 +75,10 @@ public class CustomerJGController {
*/ */
@PostMapping("/getList") @PostMapping("/getList")
public ActionResult list(@RequestBody CustomerPagination customerPagination)throws IOException{ public ActionResult list(@RequestBody CustomerPagination customerPagination)throws IOException{
List<CustomerJGMobileEntity> list= customerService.getList(customerPagination); List<CustomerJGMobileEntity> list= customerJGMobileService.getList(customerPagination);
//处理id字段转名称若无需转或者为空可删除 //处理id字段转名称若无需转或者为空可删除
for(CustomerJGMobileEntity entity:list){ for(CustomerJGMobileEntity entity:list){
entity.setOrgId(generaterSwapUtil.comSelectValues(entity.getOrgId()));
entity.setStatus(generaterSwapUtil.switchSelectValue(entity.getStatus() ,"1" ,"2")); entity.setStatus(generaterSwapUtil.switchSelectValue(entity.getStatus() ,"1" ,"2"));
} }
List<CustomerListVO> listVO=JsonUtil.getJsonToList(list,CustomerListVO.class); List<CustomerListVO> listVO=JsonUtil.getJsonToList(list,CustomerListVO.class);
@ -103,9 +105,9 @@ public class CustomerJGController {
public ActionResult create(@RequestBody @Valid CustomerCrForm customerCrForm) throws DataException { public ActionResult create(@RequestBody @Valid CustomerCrForm customerCrForm) throws DataException {
String mainId =RandomUtil.uuId(); String mainId =RandomUtil.uuId();
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
CustomerJGEntity entity = JsonUtil.getJsonToBean(customerCrForm, CustomerJGEntity.class); CustomerJGMobileEntity entity = JsonUtil.getJsonToBean(customerCrForm, CustomerJGMobileEntity.class);
entity.setId(mainId); entity.setId(mainId);
customerService.save(entity); customerJGMobileService.save(entity);
return ActionResult.success("创建成功"); return ActionResult.success("创建成功");
@ -143,9 +145,10 @@ public class CustomerJGController {
return ActionResult.fail("请选择导出字段"); return ActionResult.fail("请选择导出字段");
} }
CustomerPagination customerPagination=JsonUtil.getJsonToBean(customerPaginationExportModel, CustomerPagination.class); CustomerPagination customerPagination=JsonUtil.getJsonToBean(customerPaginationExportModel, CustomerPagination.class);
List<CustomerJGEntity> list= customerService.getTypeList(customerPagination,customerPaginationExportModel.getDataType()); List<CustomerJGMobileEntity> list= customerJGMobileService.getTypeList(customerPagination,customerPaginationExportModel.getDataType());
//处理id字段转名称若无需转或者为空可删除 //处理id字段转名称若无需转或者为空可删除
for(CustomerJGEntity entity:list){ for(CustomerJGMobileEntity entity:list){
entity.setOrgId(generaterSwapUtil.comSelectValues(entity.getOrgId()));
entity.setStatus(generaterSwapUtil.switchSelectValue(entity.getStatus() ,"1" ,"2")); entity.setStatus(generaterSwapUtil.switchSelectValue(entity.getStatus() ,"1" ,"2"));
} }
List<CustomerListVO> listVO=JsonUtil.getJsonToList(list,CustomerListVO.class); List<CustomerListVO> listVO=JsonUtil.getJsonToList(list,CustomerListVO.class);
@ -173,23 +176,20 @@ public class CustomerJGController {
entitys.add(new ExcelExportEntity("客户名称" ,"supplierNm")); entitys.add(new ExcelExportEntity("客户名称" ,"supplierNm"));
break; break;
case "orgId" : case "orgId" :
entitys.add(new ExcelExportEntity("所属公司ID" ,"orgId")); entitys.add(new ExcelExportEntity("公司名称" ,"orgId"));
break; break;
case "orgName" : case "contactName" :
entitys.add(new ExcelExportEntity("公司代码" ,"orgName")); entitys.add(new ExcelExportEntity("联系人" ,"contactName"));
break; break;
case "customerLevel" : case "customerLevel" :
entitys.add(new ExcelExportEntity("客户等级" ,"customerLevel")); entitys.add(new ExcelExportEntity("客户等级" ,"customerLevel"));
break; break;
case "contactName" : case "contactPhone" :
entitys.add(new ExcelExportEntity("联系人" ,"contactName")); entitys.add(new ExcelExportEntity("电话" ,"contactPhone"));
break; break;
case "address" : case "address" :
entitys.add(new ExcelExportEntity("地址" ,"address")); entitys.add(new ExcelExportEntity("地址" ,"address"));
break; break;
case "contactPhone" :
entitys.add(new ExcelExportEntity("电话" ,"contactPhone"));
break;
case "status" : case "status" :
entitys.add(new ExcelExportEntity("是否启用" ,"status")); entitys.add(new ExcelExportEntity("是否启用" ,"status"));
break; break;
@ -254,7 +254,7 @@ public class CustomerJGController {
*/ */
@GetMapping("/{id}") @GetMapping("/{id}")
public ActionResult<CustomerInfoVO> info(@PathVariable("id") String id){ public ActionResult<CustomerInfoVO> info(@PathVariable("id") String id){
CustomerJGEntity entity= customerService.getInfo(id); CustomerJGMobileEntity entity= customerJGMobileService.getInfo(id);
CustomerInfoVO vo=JsonUtil.getJsonToBean(entity, CustomerInfoVO.class); CustomerInfoVO vo=JsonUtil.getJsonToBean(entity, CustomerInfoVO.class);
//子表 //子表
@ -270,7 +270,7 @@ public class CustomerJGController {
*/ */
@GetMapping("/detail/{id}") @GetMapping("/detail/{id}")
public ActionResult<CustomerInfoVO> detailInfo(@PathVariable("id") String id){ public ActionResult<CustomerInfoVO> detailInfo(@PathVariable("id") String id){
CustomerJGEntity entity= customerService.getInfo(id); CustomerJGMobileEntity entity= customerJGMobileService.getInfo(id);
CustomerInfoVO vo=JsonUtil.getJsonToBean(entity, CustomerInfoVO.class); CustomerInfoVO vo=JsonUtil.getJsonToBean(entity, CustomerInfoVO.class);
//子表数据转换 //子表数据转换
@ -278,6 +278,7 @@ public class CustomerJGController {
//附表数据转换 //附表数据转换
//添加到详情表单对象中 //添加到详情表单对象中
vo.setOrgId(generaterSwapUtil.comSelectValues(vo.getOrgId()));
vo.setStatus(generaterSwapUtil.switchSelectValue(vo.getStatus() ,"1" ,"2")); vo.setStatus(generaterSwapUtil.switchSelectValue(vo.getStatus() ,"1" ,"2"));
return ActionResult.success(vo); return ActionResult.success(vo);
@ -296,10 +297,10 @@ public class CustomerJGController {
@Transactional @Transactional
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid CustomerUpForm customerUpForm) throws DataException { public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid CustomerUpForm customerUpForm) throws DataException {
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
CustomerJGEntity entity= customerService.getInfo(id); CustomerJGMobileEntity entity= customerJGMobileService.getInfo(id);
if(entity!=null){ if(entity!=null){
CustomerJGEntity subentity=JsonUtil.getJsonToBean(customerUpForm, CustomerJGEntity.class); CustomerJGMobileEntity subentity=JsonUtil.getJsonToBean(customerUpForm, CustomerJGMobileEntity.class);
customerService.update(id, subentity); customerJGMobileService.update(id, subentity);
return ActionResult.success("更新成功"); return ActionResult.success("更新成功");
}else{ }else{
return ActionResult.fail("更新失败,数据不存在"); return ActionResult.fail("更新失败,数据不存在");
@ -317,9 +318,9 @@ public class CustomerJGController {
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@Transactional @Transactional
public ActionResult delete(@PathVariable("id") String id){ public ActionResult delete(@PathVariable("id") String id){
CustomerJGEntity entity= customerService.getInfo(id); CustomerJGMobileEntity entity= customerJGMobileService.getInfo(id);
if(entity!=null){ if(entity!=null){
customerService.delete(entity); customerJGMobileService.delete(entity);
} }
return ActionResult.success("删除成功"); return ActionResult.success("删除成功");

@ -1,100 +0,0 @@
package jnpf.customer.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-04
*/
@Data
@TableName("jg_customer")
public class CustomerJGEntity {
@TableId("ID")
private String id;
@TableField("CREATOR_USER_ID")
private String creatoruserid;
@TableField("CREATOR_USER_NAME")
private String creatorusername;
@TableField("CREATOR_TIME")
private Date creatortime;
@TableField("LAST_MODIFY_USER_ID")
private String lastmodifyuserid;
@TableField("LAST_MODIFY_USER_NAME")
private String lastmodifyusername;
@TableField("LAST_MODIFY_TIME")
private Date lastmodifytime;
@TableField("DELETE_USER_ID")
private String deleteuserid;
@TableField("DELETE_USER_NAME")
private String deleteusername;
@TableField("DELETE_TIME")
private Date deletetime;
@TableField("DELETE_MARK")
@TableLogic
private String deletemark;
@TableField("orgnize_id")
private String originId;
@TableField("department_id")
private String deptId;
@TableField("SUPPLIER_CD")
private String supplierCd;
@TableField("SUPPLIER_NM")
private String supplierNm;
@TableField("SUPPLIER_SITE_ID")
private String supplierSiteId;
@TableField("SUPPLIER_SITE_CODE")
private String supplierSiteCode;
@TableField("ORG_ID")
private String orgId;
@TableField("ORG_NAME")
private String orgName;
@TableField("VAT_REGISTRATION_NUM")
private String vatRegistrationNum;
@TableField("CUSTOMER_LEVEL")
private String customerLevel;
@TableField("CONTACT_NAME")
private String contactName;
@TableField("CONTACT_PHONE")
private String contactPhone;
@TableField("STATUS")
private String status;
@TableField("ADDRESS")
private String address;
}

@ -1,58 +1,65 @@
package jnpf.customer.entity; package jnpf.customer.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* @Author: WangChuang *
* @Date: 8/2/2023 8:35 *
* @Description //注释: * @ V3.2.0
* @Version 1.0 * @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-13
*/ */
@Data @Data
@TableName("jg_customer")
public class CustomerJGMobileEntity { public class CustomerJGMobileEntity {
@TableId("ID") @TableId("ID")
private String id; private String id;
@TableField("CREATOR_USER_ID") @TableField("CREATOR_USER_ID")
private String creatoruserid; private String creatorUserId;
@TableField("CREATOR_USER_NAME") @TableField("CREATOR_USER_NAME")
private String creatorusername; private String creatorUserName;
@TableField("CREATOR_TIME") @TableField("CREATOR_TIME")
private Date creatortime; private Date creatorTime;
@TableField("LAST_MODIFY_USER_ID") @TableField("LAST_MODIFY_USER_ID")
private String lastmodifyuserid; private String lastModifyUserId;
@TableField("LAST_MODIFY_USER_NAME") @TableField("LAST_MODIFY_USER_NAME")
private String lastmodifyusername; private String lastModifyUserName;
@TableField("LAST_MODIFY_TIME") @TableField("LAST_MODIFY_TIME")
private Date lastmodifytime; private Date lastModifyTime;
@TableField("DELETE_USER_ID") @TableField("DELETE_USER_ID")
private String deleteuserid; private String deleteUserId;
@TableField("DELETE_USER_NAME") @TableField("DELETE_USER_NAME")
private String deleteusername; private String deleteUserName;
@TableField("DELETE_TIME") @TableField("DELETE_TIME")
private Date deletetime; private Date deleteTime;
@TableField("DELETE_MARK") @TableField("DELETE_MARK")
private String deletemark; private String deleteMark;
@TableField("orgnize_id") @TableField("ORGNIZE_ID")
private String originId; private String orgnizeId;
@TableField("department_id") @TableField("DEPARTMENT_ID")
private String deptId; private String departmentId;
@TableField("SUPPLIER_CD") @TableField("SUPPLIER_CD")
private String supplierCd; private String supplierCd;
@ -90,15 +97,4 @@ public class CustomerJGMobileEntity {
@TableField("ADDRESS") @TableField("ADDRESS")
private String address; private String address;
// 收获量
private BigDecimal settlemenSum;
// 净重
private BigDecimal weightSum;
// 扣重
private BigDecimal buckleWeightSum;
// 总重
private BigDecimal grossWeightSum;
// 总额
private BigDecimal salesPriceSum;
} }

@ -1,24 +0,0 @@
package jnpf.customer.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import jnpf.customer.entity.CustomerJGEntity;
import jnpf.customer.entity.CustomerJGMobileEntity;
import org.apache.ibatis.annotations.Param;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-04
*/
public interface CustomerJGMapper extends BaseMapper<CustomerJGEntity> {
IPage<CustomerJGMobileEntity> getMobileList(@Param("page") Page<CustomerJGMobileEntity> page, @Param("ew") Wrapper<CustomerJGEntity> ew);
}

@ -0,0 +1,17 @@
package jnpf.customer.mapper;
import jnpf.customer.entity.CustomerJGMobileEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
*
* customer
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-13
*/
public interface CustomerJGMobileMapper extends BaseMapper<CustomerJGMobileEntity> {
}

@ -14,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-04 * @ 2023-02-13
*/ */
@Data @Data
public class CustomerCrForm { public class CustomerCrForm {
@ -27,30 +27,26 @@ public class CustomerCrForm {
@JsonProperty("supplierNm") @JsonProperty("supplierNm")
private String supplierNm; private String supplierNm;
/** 所属公司ID **/ /** 公司名称 **/
@JsonProperty("orgId") @JsonProperty("orgId")
private String orgId; private String orgId;
/** 公司代码 **/ /** 联系人 **/
@JsonProperty("orgName") @JsonProperty("contactName")
private String orgName; private String contactName;
/** 客户等级 **/ /** 客户等级 **/
@JsonProperty("customerLevel") @JsonProperty("customerLevel")
private String customerLevel; private String customerLevel;
/** 联系人 **/ /** 电话 **/
@JsonProperty("contactName") @JsonProperty("contactPhone")
private String contactName; private String contactPhone;
/** 地址 **/ /** 地址 **/
@JsonProperty("address") @JsonProperty("address")
private String address; private String address;
/** 电话 **/
@JsonProperty("contactPhone")
private String contactPhone;
/** 是否启用 **/ /** 是否启用 **/
@JsonProperty("status") @JsonProperty("status")
private String status; private String status;

@ -15,7 +15,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-04 * @ 2023-02-13
*/ */
@Data @Data
public class CustomerInfoVO{ public class CustomerInfoVO{
@ -31,30 +31,26 @@ public class CustomerInfoVO{
@JsonProperty("supplierNm") @JsonProperty("supplierNm")
private String supplierNm; private String supplierNm;
/** 所属公司ID **/ /** 公司名称 **/
@JsonProperty("orgId") @JsonProperty("orgId")
private String orgId; private String orgId;
/** 公司代码 **/ /** 联系人 **/
@JsonProperty("orgName") @JsonProperty("contactName")
private String orgName; private String contactName;
/** 客户等级 **/ /** 客户等级 **/
@JsonProperty("customerLevel") @JsonProperty("customerLevel")
private String customerLevel; private String customerLevel;
/** 联系人 **/ /** 电话 **/
@JsonProperty("contactName") @JsonProperty("contactPhone")
private String contactName; private String contactPhone;
/** 地址 **/ /** 地址 **/
@JsonProperty("address") @JsonProperty("address")
private String address; private String address;
/** 电话 **/
@JsonProperty("contactPhone")
private String contactPhone;
/** 是否启用 **/ /** 是否启用 **/
@JsonProperty("status") @JsonProperty("status")
private String status; private String status;

@ -10,7 +10,7 @@ import java.util.List;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-04 * @ 2023-02-13
*/ */
@Data @Data
public class CustomerListQuery extends Pagination { public class CustomerListQuery extends Pagination {

@ -3,15 +3,19 @@
package jnpf.customer.model.customer; package jnpf.customer.model.customer;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data; import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.math.BigDecimal;
/** /**
* *
* *
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-04 * @ 2023-02-13
*/ */
@Data @Data
public class CustomerListVO{ public class CustomerListVO{
@ -30,14 +34,14 @@ public class CustomerListVO{
private String supplierNm; private String supplierNm;
/** 所属公司ID **/ /** 公司名称 **/
@JsonProperty("orgId") @JsonProperty("orgId")
private String orgId; private String orgId;
/** 公司代码 **/ /** 联系人 **/
@JsonProperty("orgName") @JsonProperty("contactName")
private String orgName; private String contactName;
/** 客户等级 **/ /** 客户等级 **/
@ -45,9 +49,9 @@ public class CustomerListVO{
private String customerLevel; private String customerLevel;
/** 联系人 **/ /** 电话 **/
@JsonProperty("contactName") @JsonProperty("contactPhone")
private String contactName; private String contactPhone;
/** 地址 **/ /** 地址 **/
@ -55,28 +59,9 @@ public class CustomerListVO{
private String address; private String address;
/** 电话 **/
@JsonProperty("contactPhone")
private String contactPhone;
/** 是否启用 **/ /** 是否启用 **/
@JsonProperty("status") @JsonProperty("status")
private String status; private String status;
// 收获量
@JsonProperty("settlemenSum")
private Double settlemenSum;
// 净重
@JsonProperty("weightSum")
private Double weightSum;
// 扣重
@JsonProperty("buckleWeightSum")
private Double buckleWeightSum;
// 总重
@JsonProperty("grossWeightSum")
private Double grossWeightSum;
// 总额
@JsonProperty("salesPriceSum")
private Double salesPriceSum;
} }

@ -11,7 +11,7 @@ import java.util.List;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-04 * @ 2023-02-13
*/ */
@Data @Data
public class CustomerPagination extends Pagination { public class CustomerPagination extends Pagination {

@ -9,7 +9,7 @@ import java.util.*;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-04 * @ 2023-02-13
*/ */
@Data @Data
public class CustomerPaginationExportModel extends Pagination { public class CustomerPaginationExportModel extends Pagination {

@ -15,7 +15,7 @@ import lombok.Data;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-04 * @ 2023-02-13
*/ */
@Data @Data
public class CustomerUpForm{ public class CustomerUpForm{
@ -33,14 +33,14 @@ public class CustomerUpForm{
private String supplierNm; private String supplierNm;
/** 所属公司ID **/ /** 公司名称 **/
@JsonProperty("orgId") @JsonProperty("orgId")
private String orgId; private String orgId;
/** 公司代码 **/ /** 联系人 **/
@JsonProperty("orgName") @JsonProperty("contactName")
private String orgName; private String contactName;
/** 客户等级 **/ /** 客户等级 **/
@ -48,9 +48,9 @@ public class CustomerUpForm{
private String customerLevel; private String customerLevel;
/** 联系人 **/ /** 电话 **/
@JsonProperty("contactName") @JsonProperty("contactPhone")
private String contactName; private String contactPhone;
/** 地址 **/ /** 地址 **/
@ -58,11 +58,6 @@ public class CustomerUpForm{
private String address; private String address;
/** 电话 **/
@JsonProperty("contactPhone")
private String contactPhone;
/** 是否启用 **/ /** 是否启用 **/
@JsonProperty("status") @JsonProperty("status")
private String status; private String status;

@ -0,0 +1,34 @@
package jnpf.customer.service;
import jnpf.customer.entity.CustomerJGMobileEntity;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.customer.model.customer.CustomerPagination;
import java.util.*;
/**
*
* customer
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-13
*/
public interface CustomerJGMobileService extends IService<CustomerJGMobileEntity> {
List<CustomerJGMobileEntity> getList(CustomerPagination customerPagination);
List<CustomerJGMobileEntity> getTypeList(CustomerPagination customerPagination, String dataType);
CustomerJGMobileEntity getInfo(String id);
void delete(CustomerJGMobileEntity entity);
void create(CustomerJGMobileEntity entity);
boolean update( String id, CustomerJGMobileEntity entity);
// 子表方法
//列表子表数据方法
}

@ -1,40 +0,0 @@
package jnpf.customer.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.customer.entity.CustomerJGEntity;
import jnpf.customer.entity.CustomerJGMobileEntity;
import jnpf.customer.model.customer.CustomerPagination;
import java.util.*;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-04
*/
public interface CustomerJGService extends IService<CustomerJGEntity> {
List<CustomerJGMobileEntity> getList(CustomerPagination customerPagination);
List<CustomerJGEntity> getTypeList(CustomerPagination customerPagination, String dataType);
CustomerJGEntity getInfo(String id);
void delete(CustomerJGEntity entity);
void create(CustomerJGEntity entity);
boolean update(String id, CustomerJGEntity entity);
public IPage<CustomerJGMobileEntity> page(Page<CustomerJGMobileEntity> page, Wrapper<CustomerJGEntity> queryWrapper);
// 子表方法
//列表子表数据方法
}

@ -0,0 +1,223 @@
package jnpf.customer.service.impl;
import jnpf.customer.entity.*;
import jnpf.customer.mapper.CustomerJGMobileMapper;
import jnpf.customer.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.customer.model.customer.CustomerPagination;
import jnpf.permission.service.AuthorizeService;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import jnpf.util.*;
import java.util.*;
/**
*
* customer
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-13
*/
@Service
public class CustomerJGMobileServiceImpl extends ServiceImpl<CustomerJGMobileMapper, CustomerJGMobileEntity> implements CustomerJGMobileService {
@Autowired
private UserProvider userProvider;
@Autowired
private AuthorizeService authorizeService;
@Override
public List<CustomerJGMobileEntity> getList(CustomerPagination customerPagination){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int customerNum =0;
QueryWrapper<CustomerJGMobileEntity> customerQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object customerObj=authorizeService.getCondition(new AuthorizeConditionModel(customerQueryWrapper,customerPagination.getMenuId(),"customer"));
if (ObjectUtil.isEmpty(customerObj)){
return new ArrayList<>();
} else {
customerQueryWrapper = (QueryWrapper<CustomerJGMobileEntity>)customerObj;
customerNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object customerObj=authorizeService.getCondition(new AuthorizeConditionModel(customerQueryWrapper,customerPagination.getMenuId(),"customer"));
if (ObjectUtil.isEmpty(customerObj)){
return new ArrayList<>();
} else {
customerQueryWrapper = (QueryWrapper<CustomerJGMobileEntity>)customerObj;
customerNum++;
}
}
}
if(StringUtil.isNotEmpty(customerPagination.getSupplierCd())){
customerNum++;
customerQueryWrapper.lambda().like(CustomerJGMobileEntity::getSupplierCd,customerPagination.getSupplierCd());
}
if(StringUtil.isNotEmpty(customerPagination.getSupplierNm())){
customerNum++;
customerQueryWrapper.lambda().like(CustomerJGMobileEntity::getSupplierNm,customerPagination.getSupplierNm());
}
if(AllIdList.size()>0){
customerQueryWrapper.lambda().in(CustomerJGMobileEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(customerPagination.getSidx())){
customerQueryWrapper.lambda().orderByDesc(CustomerJGMobileEntity::getSupplierCd);
}else{
try {
String sidx = customerPagination.getSidx();
CustomerJGMobileEntity customerJGMobileEntity = new CustomerJGMobileEntity();
Field declaredField = customerJGMobileEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
customerQueryWrapper="asc".equals(customerPagination.getSort().toLowerCase())?customerQueryWrapper.orderByAsc(value):customerQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if((total>0 && AllIdList.size()>0) || total==0){
Page<CustomerJGMobileEntity> page=new Page<>(customerPagination.getCurrentPage(), customerPagination.getPageSize());
IPage<CustomerJGMobileEntity> userIPage=this.page(page, customerQueryWrapper);
return customerPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<CustomerJGMobileEntity> list = new ArrayList();
return customerPagination.setData(list, list.size());
}
}
@Override
public List<CustomerJGMobileEntity> getTypeList(CustomerPagination customerPagination, String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int customerNum =0;
QueryWrapper<CustomerJGMobileEntity> customerQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object customerObj=authorizeService.getCondition(new AuthorizeConditionModel(customerQueryWrapper,customerPagination.getMenuId(),"customer"));
if (ObjectUtil.isEmpty(customerObj)){
return new ArrayList<>();
} else {
customerQueryWrapper = (QueryWrapper<CustomerJGMobileEntity>)customerObj;
customerNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object customerObj=authorizeService.getCondition(new AuthorizeConditionModel(customerQueryWrapper,customerPagination.getMenuId(),"customer"));
if (ObjectUtil.isEmpty(customerObj)){
return new ArrayList<>();
} else {
customerQueryWrapper = (QueryWrapper<CustomerJGMobileEntity>)customerObj;
customerNum++;
}
}
}
if(StringUtil.isNotEmpty(customerPagination.getSupplierCd())){
customerNum++;
customerQueryWrapper.lambda().like(CustomerJGMobileEntity::getSupplierCd,customerPagination.getSupplierCd());
}
if(StringUtil.isNotEmpty(customerPagination.getSupplierNm())){
customerNum++;
customerQueryWrapper.lambda().like(CustomerJGMobileEntity::getSupplierNm,customerPagination.getSupplierNm());
}
if(AllIdList.size()>0){
customerQueryWrapper.lambda().in(CustomerJGMobileEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(customerPagination.getSidx())){
customerQueryWrapper.lambda().orderByDesc(CustomerJGMobileEntity::getSupplierCd);
}else{
try {
String sidx = customerPagination.getSidx();
CustomerJGMobileEntity customerJGMobileEntity = new CustomerJGMobileEntity();
Field declaredField = customerJGMobileEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
customerQueryWrapper="asc".equals(customerPagination.getSort().toLowerCase())?customerQueryWrapper.orderByAsc(value):customerQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<CustomerJGMobileEntity> page=new Page<>(customerPagination.getCurrentPage(), customerPagination.getPageSize());
IPage<CustomerJGMobileEntity> userIPage=this.page(page, customerQueryWrapper);
return customerPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<CustomerJGMobileEntity> list = new ArrayList();
return customerPagination.setData(list, list.size());
}
}else{
return this.list(customerQueryWrapper);
}
}
@Override
public CustomerJGMobileEntity getInfo(String id){
QueryWrapper<CustomerJGMobileEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(CustomerJGMobileEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(CustomerJGMobileEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, CustomerJGMobileEntity entity){
entity.setId(id);
return this.updateById(entity);
}
@Override
public void delete(CustomerJGMobileEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
//子表方法
//列表子表数据方法
}

@ -1,250 +0,0 @@
package jnpf.customer.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.customer.entity.CustomerJGEntity;
import jnpf.customer.entity.CustomerJGMobileEntity;
import jnpf.customer.mapper.CustomerJGMapper;
import jnpf.customer.model.customer.CustomerPagination;
import jnpf.customer.service.CustomerJGService;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.permission.service.AuthorizeService;
import jnpf.util.ServletUtil;
import jnpf.util.StringUtil;
import jnpf.util.UserProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-04
*/
@Service
public class CustomerJGServiceImpl extends ServiceImpl<CustomerJGMapper, CustomerJGEntity> implements CustomerJGService{
@Autowired
private UserProvider userProvider;
@Autowired
private AuthorizeService authorizeService;
@Resource
private CustomerJGMapper customerJGMapper;
@Override
public List<CustomerJGMobileEntity> getList(CustomerPagination customerPagination){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int customerNum =0;
QueryWrapper<CustomerJGEntity> customerQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object customerObj=authorizeService.getCondition(new AuthorizeConditionModel(customerQueryWrapper,customerPagination.getMenuId(),"customer"));
if (ObjectUtil.isEmpty(customerObj)){
return new ArrayList<>();
} else {
customerQueryWrapper = (QueryWrapper<CustomerJGEntity>)customerObj;
customerNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object customerObj=authorizeService.getCondition(new AuthorizeConditionModel(customerQueryWrapper,customerPagination.getMenuId(),"customer"));
if (ObjectUtil.isEmpty(customerObj)){
return new ArrayList<>();
} else {
customerQueryWrapper = (QueryWrapper<CustomerJGEntity>)customerObj;
customerNum++;
}
}
}
if(StringUtil.isNotEmpty(customerPagination.getSupplierCd())){
customerNum++;
customerQueryWrapper.lambda().like(CustomerJGEntity::getSupplierCd,customerPagination.getSupplierCd());
}
if(StringUtil.isNotEmpty(customerPagination.getSupplierNm())){
customerNum++;
customerQueryWrapper.lambda().like(CustomerJGEntity::getSupplierNm,customerPagination.getSupplierNm());
}
if(StringUtil.isNotEmpty(customerPagination.getKeyword())){
customerNum++;
customerQueryWrapper.lambda().and(wq -> {
// 拼接sql
wq.like(CustomerJGEntity::getSupplierNm,customerPagination.getKeyword())
.or()
.like(CustomerJGEntity::getOrgName,customerPagination.getKeyword())
.or()
.like(CustomerJGEntity::getAddress,customerPagination.getKeyword());
});
}
if(AllIdList.size()>0){
customerQueryWrapper.lambda().in(CustomerJGEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(customerPagination.getSidx())){
customerQueryWrapper.lambda().orderByDesc(CustomerJGEntity::getSupplierCd);
}else{
try {
String sidx = customerPagination.getSidx();
CustomerJGEntity customerEntity = new CustomerJGEntity();
Field declaredField = customerEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
customerQueryWrapper="asc".equals(customerPagination.getSort().toLowerCase())?customerQueryWrapper.orderByAsc(value):customerQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if((total>0 && AllIdList.size()>0) || total==0){
Page<CustomerJGMobileEntity> page=new Page<>(customerPagination.getCurrentPage(), customerPagination.getPageSize());
IPage<CustomerJGMobileEntity> userIPage=this.page(page, customerQueryWrapper);
return customerPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<CustomerJGMobileEntity> list = new ArrayList();
return customerPagination.setData(list, list.size());
}
}
/**
* @TODO page
* @param page
* @param queryWrapper
* @return
*/
@Override
public IPage<CustomerJGMobileEntity> page( Page<CustomerJGMobileEntity> page, Wrapper<CustomerJGEntity> queryWrapper) {
return customerJGMapper.getMobileList(page, queryWrapper);
}
@Override
public List<CustomerJGEntity> getTypeList(CustomerPagination customerPagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int customerNum =0;
QueryWrapper<CustomerJGEntity> customerQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object customerObj=authorizeService.getCondition(new AuthorizeConditionModel(customerQueryWrapper,customerPagination.getMenuId(),"customer"));
if (ObjectUtil.isEmpty(customerObj)){
return new ArrayList<>();
} else {
customerQueryWrapper = (QueryWrapper<CustomerJGEntity>)customerObj;
customerNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object customerObj=authorizeService.getCondition(new AuthorizeConditionModel(customerQueryWrapper,customerPagination.getMenuId(),"customer"));
if (ObjectUtil.isEmpty(customerObj)){
return new ArrayList<>();
} else {
customerQueryWrapper = (QueryWrapper<CustomerJGEntity>)customerObj;
customerNum++;
}
}
}
if(StringUtil.isNotEmpty(customerPagination.getSupplierCd())){
customerNum++;
customerQueryWrapper.lambda().like(CustomerJGEntity::getSupplierCd,customerPagination.getSupplierCd());
}
if(StringUtil.isNotEmpty(customerPagination.getSupplierNm())){
customerNum++;
customerQueryWrapper.lambda().like(CustomerJGEntity::getSupplierNm,customerPagination.getSupplierNm());
}
if(AllIdList.size()>0){
customerQueryWrapper.lambda().in(CustomerJGEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(customerPagination.getSidx())){
customerQueryWrapper.lambda().orderByDesc(CustomerJGEntity::getSupplierCd);
}else{
try {
String sidx = customerPagination.getSidx();
CustomerJGEntity customerEntity = new CustomerJGEntity();
Field declaredField = customerEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
customerQueryWrapper="asc".equals(customerPagination.getSort().toLowerCase())?customerQueryWrapper.orderByAsc(value):customerQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<CustomerJGEntity> page=new Page<>(customerPagination.getCurrentPage(), customerPagination.getPageSize());
IPage<CustomerJGEntity> userIPage=this.page(page, customerQueryWrapper);
return customerPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<CustomerJGEntity> list = new ArrayList();
return customerPagination.setData(list, list.size());
}
}else{
return this.list(customerQueryWrapper);
}
}
@Override
public CustomerJGEntity getInfo(String id){
QueryWrapper<CustomerJGEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(CustomerJGEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(CustomerJGEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, CustomerJGEntity entity){
entity.setId(id);
return this.updateById(entity);
}
@Override
public void delete(CustomerJGEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
//子表方法
//列表子表数据方法
}

@ -1,40 +1,62 @@
package jnpf.payment.controller; package jnpf.payment.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import jdk.nashorn.internal.ir.IfNode;
import jnpf.base.ActionResult; import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO;
import jnpf.base.vo.PageListVO; import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO; import jnpf.base.vo.PaginationVO;
import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO;
import jnpf.collection.model.collection.Collection_item0Model;
import jnpf.config.ConfigValueUtil; import jnpf.config.ConfigValueUtil;
import jnpf.exception.DataException; import jnpf.exception.DataException;
import jnpf.payment.entity.PaymentEntity; import jnpf.paymentdoc.entity.Paymentdoc_item0Entity;
import jnpf.paymentdoc.service.Paymentdoc_item0Service;
import jnpf.purchaseback.entity.PurchaseorderEntity;
import jnpf.purchaseback.service.PurchaseorderService;
import org.apache.commons.lang3.math.NumberUtils;
import org.springframework.transaction.annotation.Transactional;
import jnpf.base.entity.ProvinceEntity;
import jnpf.payment.model.payment.*; import jnpf.payment.model.payment.*;
import jnpf.payment.service.PaymentService; import jnpf.payment.model.payment.PaymentPagination;
import jnpf.payment.entity.*;
import jnpf.payment.entity.Payment_item0Entity;
import jnpf.util.*; import jnpf.util.*;
import jnpf.util.enums.FileTypeEnum; import jnpf.base.util.*;
import jnpf.util.file.UploadUtil; import jnpf.base.vo.ListVO;
import lombok.Cleanup; import jnpf.util.context.SpringContext;
import cn.hutool.core.util.ObjectUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import lombok.Cleanup;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.RestController;
import jnpf.payment.entity.PaymentEntity;
import jnpf.payment.service.PaymentService;
import jnpf.payment.entity.Payment_item0Entity;
import jnpf.payment.service.Payment_item0Service;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid; import javax.validation.Valid;
import java.io.FileNotFoundException;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import jnpf.util.GeneraterSwapUtil;
import java.util.List;
import java.util.Map; import java.math.BigDecimal;
import java.util.*;
import jnpf.util.file.UploadUtil;
import jnpf.util.enums.FileTypeEnum;
/** /**
* *
@ -42,12 +64,12 @@ import java.util.Map;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-11 * @ 2023-02-10
*/ */
@Slf4j @Slf4j
@RestController @RestController
@Api(tags = "payment" , value = "example") @Api(tags = "payment" , value = "payment")
@RequestMapping("/api/example/Payment") @RequestMapping("/api/payment/Payment")
public class PaymentController { public class PaymentController {
@Autowired @Autowired
@ -62,9 +84,43 @@ public class PaymentController {
@Autowired @Autowired
private PaymentService paymentService; private PaymentService paymentService;
@Autowired
private Payment_item0Service payment_item0Service;
@Autowired
private Paymentdoc_item0Service paymentdoc_item0Service;
@Autowired
private PurchaseorderService purchaseorderService;
@PostMapping("/confirmprice")
@Transactional
public ActionResult confirmPrice(@RequestBody PaymentListVO paymentListVO) {
PaymentEntity paymentEntity = paymentService.getInfo(paymentListVO.getId());
if (!paymentEntity.getStatus().equals("2")){
return ActionResult.fail("审核中,请先通过审核");
}
QueryWrapper<Payment_item0Entity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(Payment_item0Entity::getPaymentId,paymentListVO.getId());
List<Payment_item0Entity> dList = payment_item0Service.list(queryWrapper);
for (Payment_item0Entity payment_item0Entity : dList){
Paymentdoc_item0Entity paymentdoc_item0Entity = paymentdoc_item0Service.getById(payment_item0Entity.getPaymentdocitemId());
PurchaseorderEntity purchaseorderEntity = purchaseorderService.getById(paymentdoc_item0Entity.getPurchaseorderId());
if (purchaseorderEntity.getPayPrice().equals(purchaseorderEntity.getAmount())){
return ActionResult.fail("回款金额等于金额");
}
BigDecimal sum = purchaseorderEntity.getPayPrice().add(payment_item0Entity.getAmount());
if (sum.compareTo(purchaseorderEntity.getAmount()) > 0){
return ActionResult.fail("总回款金额大于金额");
}
purchaseorderEntity.setPayPrice(sum);
purchaseorderEntity.setStatus("1");
purchaseorderService.updateById(purchaseorderEntity);
}
return ActionResult.success("认款成功");
}
/** /**
* *
* *
@ -76,12 +132,6 @@ public class PaymentController {
List<PaymentEntity> list= paymentService.getList(paymentPagination); List<PaymentEntity> list= paymentService.getList(paymentPagination);
//处理id字段转名称若无需转或者为空可删除 //处理id字段转名称若无需转或者为空可删除
for(PaymentEntity entity:list){ for(PaymentEntity entity:list){
entity.setCreatorUserId(generaterSwapUtil.comSelectValue(entity.getCreatorUserId(), "last"));
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName()));
entity.setLastModifyUserId(generaterSwapUtil.userSelectValue(entity.getLastModifyUserId()));
entity.setLastModifyUserName(generaterSwapUtil.userSelectValue(entity.getLastModifyUserName()));
entity.setDepartmentId(generaterSwapUtil.posSelectValue(entity.getDepartmentId()));
entity.setOrgnizeId(generaterSwapUtil.posSelectValue(entity.getOrgnizeId()));
} }
List<PaymentListVO> listVO=JsonUtil.getJsonToList(list,PaymentListVO.class); List<PaymentListVO> listVO=JsonUtil.getJsonToList(list,PaymentListVO.class);
for(PaymentListVO paymentVO:listVO){ for(PaymentListVO paymentVO:listVO){
@ -107,18 +157,17 @@ public class PaymentController {
public ActionResult create(@RequestBody @Valid PaymentCrForm paymentCrForm) throws DataException { public ActionResult create(@RequestBody @Valid PaymentCrForm paymentCrForm) throws DataException {
String mainId =RandomUtil.uuId(); String mainId =RandomUtil.uuId();
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
paymentCrForm.setCreatorUserId(StringUtil.isEmpty(userInfo.getDepartmentId()) ? userInfo.getOrganizeId() : userInfo.getDepartmentId()); paymentCrForm.setDocumentno(generaterSwapUtil.getBillNumber("payment", false));
paymentCrForm.setCreatorUserName(userInfo.getUserId());
paymentCrForm.setCreatorTime(DateUtil.getNow());
if(userInfo.getPositionIds()!=null&&userInfo.getPositionIds().length>0){
paymentCrForm.setDepartmentId(userInfo.getPositionIds()[0]);
}
if(userInfo.getPositionIds()!=null&&userInfo.getPositionIds().length>0){
paymentCrForm.setOrgnizeId(userInfo.getPositionIds()[0]);
}
PaymentEntity entity = JsonUtil.getJsonToBean(paymentCrForm, PaymentEntity.class); PaymentEntity entity = JsonUtil.getJsonToBean(paymentCrForm, PaymentEntity.class);
entity.setId(mainId); entity.setId(mainId);
paymentService.save(entity); paymentService.save(entity);
List<Payment_item0Entity> Payment_item0List = JsonUtil.getJsonToList(paymentCrForm.getPayment_item0List(),Payment_item0Entity.class);
for(Payment_item0Entity entitys : Payment_item0List){
entitys.setId(RandomUtil.uuId());
entitys.setPaymentId(entity.getId());
payment_item0Service.save(entitys);
}
return ActionResult.success("创建成功"); return ActionResult.success("创建成功");
@ -159,12 +208,6 @@ public class PaymentController {
List<PaymentEntity> list= paymentService.getTypeList(paymentPagination,paymentPaginationExportModel.getDataType()); List<PaymentEntity> list= paymentService.getTypeList(paymentPagination,paymentPaginationExportModel.getDataType());
//处理id字段转名称若无需转或者为空可删除 //处理id字段转名称若无需转或者为空可删除
for(PaymentEntity entity:list){ for(PaymentEntity entity:list){
entity.setCreatorUserId(generaterSwapUtil.comSelectValue(entity.getCreatorUserId(), "last"));
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName()));
entity.setLastModifyUserId(generaterSwapUtil.userSelectValue(entity.getLastModifyUserId()));
entity.setLastModifyUserName(generaterSwapUtil.userSelectValue(entity.getLastModifyUserName()));
entity.setDepartmentId(generaterSwapUtil.posSelectValue(entity.getDepartmentId()));
entity.setOrgnizeId(generaterSwapUtil.posSelectValue(entity.getOrgnizeId()));
} }
List<PaymentListVO> listVO=JsonUtil.getJsonToList(list,PaymentListVO.class); List<PaymentListVO> listVO=JsonUtil.getJsonToList(list,PaymentListVO.class);
for(PaymentListVO paymentVO:listVO){ for(PaymentListVO paymentVO:listVO){
@ -184,20 +227,14 @@ public class PaymentController {
if(keys.length>0){ if(keys.length>0){
for(String key:keys){ for(String key:keys){
switch(key){ switch(key){
case "businessdate" :
entitys.add(new ExcelExportEntity("业务日期" ,"businessdate"));
break;
case "documentno" : case "documentno" :
entitys.add(new ExcelExportEntity("单据编号" ,"documentno")); entitys.add(new ExcelExportEntity("单据编号" ,"documentno"));
break; break;
case "suppliername" : case "suppliername" :
entitys.add(new ExcelExportEntity("客户" ,"suppliername")); entitys.add(new ExcelExportEntity("供应商" ,"suppliername"));
break;
case "currency" :
entitys.add(new ExcelExportEntity("币别" ,"currency"));
break; break;
case "paymentamount" : case "paymenttype" :
entitys.add(new ExcelExportEntity("付款金额" ,"paymentamount")); entitys.add(new ExcelExportEntity("付款类型" ,"paymenttype"));
break; break;
case "paymentaccount" : case "paymentaccount" :
entitys.add(new ExcelExportEntity("付款账户" ,"paymentaccount")); entitys.add(new ExcelExportEntity("付款账户" ,"paymentaccount"));
@ -205,38 +242,35 @@ public class PaymentController {
case "paymentbank" : case "paymentbank" :
entitys.add(new ExcelExportEntity("付款银行" ,"paymentbank")); entitys.add(new ExcelExportEntity("付款银行" ,"paymentbank"));
break; break;
case "paymenttype" : case "paymentamount" :
entitys.add(new ExcelExportEntity("付款类型" ,"paymenttype")); entitys.add(new ExcelExportEntity("付款金额" ,"paymentamount"));
break;
case "settlementtype" :
entitys.add(new ExcelExportEntity("结算类型" ,"settlementtype"));
break; break;
case "status" : case "collectionaccount" :
entitys.add(new ExcelExportEntity("单据状态" ,"status")); entitys.add(new ExcelExportEntity("收款账户" ,"collectionaccount"));
break; break;
case "creatorUserId" : case "collectionbank" :
entitys.add(new ExcelExportEntity("创建人id" ,"creatorUserId")); entitys.add(new ExcelExportEntity("收款银行" ,"collectionbank"));
break; break;
case "creatorUserName" : case "requestedamount" :
entitys.add(new ExcelExportEntity("创建人名称" ,"creatorUserName")); entitys.add(new ExcelExportEntity("申请金额" ,"requestedamount"));
break; break;
case "creatorTime" : case "duedate" :
entitys.add(new ExcelExportEntity("创建时间" ,"creatorTime")); entitys.add(new ExcelExportEntity("应付日期" ,"duedate"));
break; break;
case "lastModifyUserId" : case "currency" :
entitys.add(new ExcelExportEntity("修改人id" ,"lastModifyUserId")); entitys.add(new ExcelExportEntity("币别 " ,"currency"));
break; break;
case "lastModifyUserName" : case "settlementtype" :
entitys.add(new ExcelExportEntity("修改人名称" ,"lastModifyUserName")); entitys.add(new ExcelExportEntity("结算类型" ,"settlementtype"));
break; break;
case "lastModifyTime" : case "paymentno" :
entitys.add(new ExcelExportEntity("修改时间" ,"lastModifyTime")); entitys.add(new ExcelExportEntity("来源单号" ,"paymentno"));
break; break;
case "departmentId" : case "remark" :
entitys.add(new ExcelExportEntity("部门id" ,"departmentId")); entitys.add(new ExcelExportEntity("备注" ,"remark"));
break; break;
case "orgnizeId" : case "status" :
entitys.add(new ExcelExportEntity("组织id" ,"orgnizeId")); entitys.add(new ExcelExportEntity("单据状态" ,"status"));
break; break;
default: default:
break; break;
@ -269,6 +303,28 @@ public class PaymentController {
} }
/**
*
*
* @param ids
* @return
*/
@DeleteMapping("/batchRemove/{ids}")
@Transactional
public ActionResult batchRemove(@PathVariable("ids") String ids){
String[] idList = ids.split(",");
int i =0;
for (String allId : idList){
this.delete(allId);
i++;
}
if (i == 0 ){
return ActionResult.fail("删除失败");
}
return ActionResult.success("删除成功");
}
/** /**
* *
* *
@ -279,20 +335,27 @@ public class PaymentController {
public ActionResult<PaymentInfoVO> info(@PathVariable("id") String id){ public ActionResult<PaymentInfoVO> info(@PathVariable("id") String id){
PaymentEntity entity= paymentService.getInfo(id); PaymentEntity entity= paymentService.getInfo(id);
PaymentInfoVO vo=JsonUtil.getJsonToBean(entity, PaymentInfoVO.class); PaymentInfoVO vo=JsonUtil.getJsonToBean(entity, PaymentInfoVO.class);
vo.setCreatorUserId(generaterSwapUtil.comSelectValue(vo.getCreatorUserId(), "last"));
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
if(vo.getCreatorTime()!=null){
vo.setCreatorTime(vo.getCreatorTime());
}
vo.setLastModifyUserId(generaterSwapUtil.userSelectValue(vo.getLastModifyUserId()));
vo.setLastModifyUserName(generaterSwapUtil.userSelectValue(vo.getLastModifyUserName()));
if(vo.getLastModifyTime()!=null){
vo.setLastModifyTime(vo.getLastModifyTime());
}
vo.setDepartmentId(generaterSwapUtil.posSelectValue(vo.getDepartmentId()));
vo.setOrgnizeId(generaterSwapUtil.posSelectValue(vo.getOrgnizeId()));
//子表 //子表
List<Payment_item0Entity> Payment_item0List = paymentService.GetPayment_item0List(id);
List<Payment_item0Model> payment_item0Models = new ArrayList<>();
Payment_item0Model payment_item0Model = new Payment_item0Model();
for(Payment_item0Entity payment_item0Entity : Payment_item0List){
Paymentdoc_item0Entity paymentdoc_item0Entity = paymentdoc_item0Service.getById(payment_item0Entity.getPaymentdocitemId());
PurchaseorderEntity purchaseorderEntity = purchaseorderService.getById(paymentdoc_item0Entity.getPurchaseorderId());
payment_item0Model.setAmount(String.valueOf(payment_item0Entity.getAmount()));
// payment_item0Model.setAmount(String.valueOf(purchaseorderEntity.getAmount()));
// payment_item0Model.setAmount(String.valueOf(purchaseorderEntity.getAmount()));
payment_item0Model.setPayPrice(String.valueOf(purchaseorderEntity.getPayPrice()));
payment_item0Model.setDocumentNo(String.valueOf(purchaseorderEntity.getDocumentNo()));
payment_item0Model.setContractCode(String.valueOf(purchaseorderEntity.getContractCode()));
payment_item0Model.setNum(String.valueOf(purchaseorderEntity.getNum()));
payment_item0Model.setAdvanceAmount(String.valueOf(purchaseorderEntity.getAdvanceAmount()));
payment_item0Model.setRate(String.valueOf(purchaseorderEntity.getRate()));
payment_item0Model.setNotAmount(String.valueOf(purchaseorderEntity.getNotAmount()));
payment_item0Models.add(payment_item0Model);
}
vo.setPayment_item0List(payment_item0Models);
//副表 //副表
return ActionResult.success(vo); return ActionResult.success(vo);
} }
@ -309,16 +372,15 @@ public class PaymentController {
PaymentInfoVO vo=JsonUtil.getJsonToBean(entity, PaymentInfoVO.class); PaymentInfoVO vo=JsonUtil.getJsonToBean(entity, PaymentInfoVO.class);
//子表数据转换 //子表数据转换
List<Payment_item0Entity> jg_payment_item0List = paymentService.GetPayment_item0List(id);
List<Payment_item0Model> jg_payment_item0ModelList = JsonUtil.getJsonToList(jg_payment_item0List,Payment_item0Model.class);
for(Payment_item0Model jg_payment_item0Model : jg_payment_item0ModelList){
}
vo.setPayment_item0List(jg_payment_item0ModelList);
//附表数据转换 //附表数据转换
//添加到详情表单对象中 //添加到详情表单对象中
vo.setCreatorUserId(generaterSwapUtil.comSelectValue(vo.getCreatorUserId(), "last"));
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
vo.setLastModifyUserId(generaterSwapUtil.userSelectValue(vo.getLastModifyUserId()));
vo.setLastModifyUserName(generaterSwapUtil.userSelectValue(vo.getLastModifyUserName()));
vo.setDepartmentId(generaterSwapUtil.posSelectValue(vo.getDepartmentId()));
vo.setOrgnizeId(generaterSwapUtil.posSelectValue(vo.getOrgnizeId()));
return ActionResult.success(vo); return ActionResult.success(vo);
} }
@ -336,26 +398,29 @@ public class PaymentController {
@Transactional @Transactional
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid PaymentUpForm paymentUpForm) throws DataException { public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid PaymentUpForm paymentUpForm) throws DataException {
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
PaymentEntity entity= paymentService.getInfo(id); PaymentEntity entity= paymentService.getInfo(id);
if (entity.getStatus().equals("2")){
return ActionResult.fail("已审核,不允许编辑");
}
if(entity!=null){ if(entity!=null){
// paymentCrForm.setCreatorUserId(StringUtil.isEmpty(userInfo.getDepartmentId()) ? userInfo.getOrganizeId() : userInfo.getDepartmentId());
// paymentCrForm.setCreatorUserName(userInfo.getUserId());
paymentUpForm.setCreatorUserId(entity.getCreatorUserId());
paymentUpForm.setLastModifyUserId(userInfo.getUserId());
paymentUpForm.setLastModifyUserName(userInfo.getUserId());
paymentUpForm.setLastModifyTime(DateUtil.getNow());
paymentUpForm.setDepartmentId(entity.getDepartmentId());
paymentUpForm.setOrgnizeId(entity.getOrgnizeId());
PaymentEntity subentity=JsonUtil.getJsonToBean(paymentUpForm, PaymentEntity.class); PaymentEntity subentity=JsonUtil.getJsonToBean(paymentUpForm, PaymentEntity.class);
subentity.setCreatorUserName(entity.getCreatorUserName());
subentity.setCreatorTime(entity.getCreatorTime());
paymentService.update(id, subentity); paymentService.update(id, subentity);
System.out.println("#################");
System.out.println(subentity); QueryWrapper<Payment_item0Entity> Payment_item0queryWrapper = new QueryWrapper<>();
System.out.println(userInfo); Payment_item0queryWrapper.lambda().eq(Payment_item0Entity::getPaymentId, entity.getId());
List<Payment_item0Entity> list = payment_item0Service.list(Payment_item0queryWrapper);
payment_item0Service.remove(Payment_item0queryWrapper);
List<Payment_item0Entity> Payment_item0List = JsonUtil.getJsonToList(paymentUpForm.getPayment_item0List(),Payment_item0Entity.class);
for(Payment_item0Entity entitys : Payment_item0List){
entitys.setId(RandomUtil.uuId());
entitys.setPaymentId(entity.getId());
for (Payment_item0Entity payment_item0Entity : list) {
entitys.setPaymentdocitemId(payment_item0Entity.getPaymentdocitemId());
}
payment_item0Service.save(entitys);
}
return ActionResult.success("更新成功"); return ActionResult.success("更新成功");
}else{ }else{
return ActionResult.fail("更新失败,数据不存在"); return ActionResult.fail("更新失败,数据不存在");
@ -376,6 +441,9 @@ public class PaymentController {
PaymentEntity entity= paymentService.getInfo(id); PaymentEntity entity= paymentService.getInfo(id);
if(entity!=null){ if(entity!=null){
paymentService.delete(entity); paymentService.delete(entity);
QueryWrapper<Payment_item0Entity> queryWrapperPayment_item0=new QueryWrapper<>();
queryWrapperPayment_item0.lambda().eq(Payment_item0Entity::getPaymentId,entity.getId());
payment_item0Service.remove(queryWrapperPayment_item0);
} }
return ActionResult.success("删除成功"); return ActionResult.success("删除成功");

@ -1,12 +1,15 @@
package jnpf.payment.entity; package jnpf.payment.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.math.BigDecimal;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
@ -15,7 +18,7 @@ import java.util.Date;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-11 * @ 2023-02-10
*/ */
@Data @Data
@TableName("jg_payment") @TableName("jg_payment")

@ -1,12 +1,14 @@
package jnpf.payment.entity; package jnpf.payment.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
@ -15,7 +17,7 @@ import java.util.Date;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-11 * @ 2023-02-10
*/ */
@Data @Data
@TableName("jg_payment_item0") @TableName("jg_payment_item0")
@ -63,37 +65,10 @@ public class Payment_item0Entity {
@TableField("PAYMENT_ID") @TableField("PAYMENT_ID")
private String paymentId; private String paymentId;
@TableField("PAYMENTID")
private String paymentid;
@TableField("CARNUMBER")
private String carnumber;
@TableField("MATERIALNAME")
private String materialname;
@TableField("QUANTITY")
private BigDecimal quantity;
@TableField("PURCHASEPRICE")
private BigDecimal purchaseprice;
@TableField("TAXRATE")
private String taxrate;
@TableField("AMOUNT") @TableField("AMOUNT")
private BigDecimal amount; private BigDecimal amount;
@TableField("AMOUNTNOTTAX") @TableField("PAYMENTDOCITEM_ID")
private BigDecimal amountnottax; private String paymentdocitemId;
@TableField("TAXAMOUNT")
private BigDecimal taxamount;
@TableField("REMARK")
private String remark;
@TableField("ISPAY")
private String ispay;
} }

@ -1,8 +1,8 @@
package jnpf.payment.mapper; package jnpf.payment.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.payment.entity.PaymentEntity; import jnpf.payment.entity.PaymentEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/** /**
* *
@ -10,7 +10,7 @@ import jnpf.payment.entity.PaymentEntity;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-11 * 2023-02-10
*/ */
public interface PaymentMapper extends BaseMapper<PaymentEntity> { public interface PaymentMapper extends BaseMapper<PaymentEntity> {

@ -1,8 +1,8 @@
package jnpf.payment.mapper; package jnpf.payment.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.payment.entity.Payment_item0Entity; import jnpf.payment.entity.Payment_item0Entity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/** /**
* *
@ -10,7 +10,7 @@ import jnpf.payment.entity.Payment_item0Entity;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-11 * 2023-02-10
*/ */
public interface Payment_item0Mapper extends BaseMapper<Payment_item0Entity> { public interface Payment_item0Mapper extends BaseMapper<Payment_item0Entity> {

@ -2,6 +2,7 @@
package jnpf.payment.model.payment; package jnpf.payment.model.payment;
import jnpf.payment.model.payment.Payment_item0Model;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -14,30 +15,22 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-11 * @ 2023-02-10
*/ */
@Data @Data
public class PaymentCrForm { public class PaymentCrForm {
/** 业务日期 **/
@JsonProperty("businessdate")
private Long businessdate;
/** 单据编号 **/ /** 单据编号 **/
@JsonProperty("documentno") @JsonProperty("documentno")
private String documentno; private String documentno;
/** 客户 **/ /** 供应商 **/
@JsonProperty("suppliername") @JsonProperty("suppliername")
private String suppliername; private String suppliername;
/** 币别 **/ /** 付款类型 **/
@JsonProperty("currency") @JsonProperty("paymenttype")
private String currency; private String paymenttype;
/** 付款金额 **/
@JsonProperty("paymentamount")
private String paymentamount;
/** 付款账户 **/ /** 付款账户 **/
@JsonProperty("paymentaccount") @JsonProperty("paymentaccount")
@ -47,50 +40,49 @@ public class PaymentCrForm {
@JsonProperty("paymentbank") @JsonProperty("paymentbank")
private String paymentbank; private String paymentbank;
/** 付款类型 **/ /** 付款金额 **/
@JsonProperty("paymenttype") @JsonProperty("paymentamount")
private String paymenttype; private String paymentamount;
/** 结算类型 **/
@JsonProperty("settlementtype")
private String settlementtype;
/** 单据状态 **/ /** 收款账户 **/
@JsonProperty("status") @JsonProperty("collectionaccount")
private String status; private String collectionaccount;
/** 创建人id **/ /** 收款银行 **/
@JsonProperty("creatorUserId") @JsonProperty("collectionbank")
private String creatorUserId; private String collectionbank;
/** 创建人名称 **/ /** 申请金额 **/
@JsonProperty("creatorUserName") @JsonProperty("requestedamount")
private String creatorUserName; private String requestedamount;
/** 创建时间 **/ /** 应付日期 **/
@JsonProperty("creatorTime") @JsonProperty("duedate")
private String creatorTime; private Long duedate;
/** 修改人id **/ /** 币别 **/
@JsonProperty("lastModifyUserId") @JsonProperty("currency")
private String lastModifyUserId; private String currency;
/** 修改人名称 **/ /** 结算类型 **/
@JsonProperty("lastModifyUserName") @JsonProperty("settlementtype")
private String lastModifyUserName; private String settlementtype;
/** 修改时间 **/ /** 来源单号 **/
@JsonProperty("lastModifyTime") @JsonProperty("paymentno")
private String lastModifyTime; private String paymentno;
/** 部门id **/ /** 备注 **/
@JsonProperty("departmentId") @JsonProperty("remark")
private String departmentId; private String remark;
/** 组织id **/ /** 单据状态 **/
@JsonProperty("orgnizeId") @JsonProperty("status")
private String orgnizeId; private String status;
/** 子表数据 **/
@JsonProperty("payment_item0List")
private List<Payment_item0Model> payment_item0List;
} }

@ -3,6 +3,7 @@
package jnpf.payment.model.payment; package jnpf.payment.model.payment;
import jnpf.payment.model.payment.Payment_item0Model;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List; import java.util.List;
@ -15,7 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-11 * @ 2023-02-10
*/ */
@Data @Data
public class PaymentInfoVO{ public class PaymentInfoVO{
@ -23,25 +24,17 @@ public class PaymentInfoVO{
@JsonProperty("id") @JsonProperty("id")
private String id; private String id;
/** 业务日期 **/
@JsonProperty("businessdate")
private Long businessdate;
/** 单据编号 **/ /** 单据编号 **/
@JsonProperty("documentno") @JsonProperty("documentno")
private String documentno; private String documentno;
/** 客户 **/ /** 供应商 **/
@JsonProperty("suppliername") @JsonProperty("suppliername")
private String suppliername; private String suppliername;
/** 币别 **/ /** 付款类型 **/
@JsonProperty("currency") @JsonProperty("paymenttype")
private String currency; private String paymenttype;
/** 付款金额 **/
@JsonProperty("paymentamount")
private String paymentamount;
/** 付款账户 **/ /** 付款账户 **/
@JsonProperty("paymentaccount") @JsonProperty("paymentaccount")
@ -51,50 +44,47 @@ public class PaymentInfoVO{
@JsonProperty("paymentbank") @JsonProperty("paymentbank")
private String paymentbank; private String paymentbank;
/** 付款类型 **/ /** 付款金额 **/
@JsonProperty("paymenttype") @JsonProperty("paymentamount")
private String paymenttype; private String paymentamount;
/** 结算类型 **/
@JsonProperty("settlementtype")
private String settlementtype;
/** 单据状态 **/ /** 收款账户 **/
@JsonProperty("status") @JsonProperty("collectionaccount")
private String status; private String collectionaccount;
/** 创建人id **/ /** 收款银行 **/
@JsonProperty("creatorUserId") @JsonProperty("collectionbank")
private String creatorUserId; private String collectionbank;
/** 创建人名称 **/ /** 申请金额 **/
@JsonProperty("creatorUserName") @JsonProperty("requestedamount")
private String creatorUserName; private String requestedamount;
/** 创建时间 **/ /** 应付日期 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") @JsonProperty("duedate")
@JsonProperty("creatorTime") private Long duedate;
private Date creatorTime;
/** 修改人id **/ /** 币别 **/
@JsonProperty("lastModifyUserId") @JsonProperty("currency")
private String lastModifyUserId; private String currency;
/** 修改人名称 **/ /** 结算类型 **/
@JsonProperty("lastModifyUserName") @JsonProperty("settlementtype")
private String lastModifyUserName; private String settlementtype;
/** 修改时间 **/ /** 来源单号 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") @JsonProperty("paymentno")
@JsonProperty("lastModifyTime") private String paymentno;
private Date lastModifyTime;
/** 部门id **/ /** 备注 **/
@JsonProperty("departmentId") @JsonProperty("remark")
private String departmentId; private String remark;
/** 组织id **/ /** 单据状态 **/
@JsonProperty("orgnizeId") @JsonProperty("status")
private String orgnizeId; private String status;
/** 子表数据 **/
@JsonProperty("payment_item0List")
private List<Payment_item0Model> payment_item0List;
} }

@ -10,16 +10,13 @@ import java.util.List;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-11 * @ 2023-02-10
*/ */
@Data @Data
public class PaymentListQuery extends Pagination { public class PaymentListQuery extends Pagination {
/** 单据编号 */ /** 单据编号 */
private String documentno; private String documentno;
/** 客户 */
private String suppliername;
/** /**
* id * id
*/ */

@ -15,7 +15,7 @@ import java.math.BigDecimal;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-11 * @ 2023-02-10
*/ */
@Data @Data
public class PaymentListVO{ public class PaymentListVO{
@ -24,30 +24,19 @@ public class PaymentListVO{
private String id; private String id;
/** 业务日期 **/
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
@JsonProperty("businessdate")
private Date businessdate;
/** 单据编号 **/ /** 单据编号 **/
@JsonProperty("documentno") @JsonProperty("documentno")
private String documentno; private String documentno;
/** 客户 **/ /** 供应商 **/
@JsonProperty("suppliername") @JsonProperty("suppliername")
private String suppliername; private String suppliername;
/** 币别 **/ /** 付款类型 **/
@JsonProperty("currency") @JsonProperty("paymenttype")
private String currency; private String paymenttype;
/** 付款金额 **/
@JsonProperty("paymentamount")
private String paymentamount;
/** 付款账户 **/ /** 付款账户 **/
@ -60,61 +49,55 @@ public class PaymentListVO{
private String paymentbank; private String paymentbank;
/** 付款类型 **/ /** 付款金额 **/
@JsonProperty("paymenttype") @JsonProperty("paymentamount")
private String paymenttype; private String paymentamount;
/** 结算类型 **/
@JsonProperty("settlementtype")
private String settlementtype;
/** 单据状态 **/ /** 收款账户 **/
@JsonProperty("status") @JsonProperty("collectionaccount")
private String status; private String collectionaccount;
/** 创建人id **/ /** 收款银行 **/
@JsonProperty("creatorUserId") @JsonProperty("collectionbank")
private String creatorUserId; private String collectionbank;
/** 创建人名称 **/ /** 申请金额 **/
@JsonProperty("creatorUserName") @JsonProperty("requestedamount")
private String creatorUserName; private String requestedamount;
/** 创建时间 **/ /** 应付日期 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
@JsonProperty("creatorTime") @JsonProperty("duedate")
private Date creatorTime; private Date duedate;
/** 修改人id **/ /** 币别 **/
@JsonProperty("lastModifyUserId") @JsonProperty("currency")
private String lastModifyUserId; private String currency;
/** 修改人名称 **/ /** 结算类型 **/
@JsonProperty("lastModifyUserName") @JsonProperty("settlementtype")
private String lastModifyUserName; private String settlementtype;
/** 修改时间 **/ /** 来源单号 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") @JsonProperty("paymentno")
@JsonProperty("lastModifyTime") private String paymentno;
private Date lastModifyTime;
/** 部门id **/ /** 备注 **/
@JsonProperty("departmentId") @JsonProperty("remark")
private String departmentId; private String remark;
/** 组织id **/ /** 单据状态 **/
@JsonProperty("orgnizeId") @JsonProperty("status")
private String orgnizeId; private String status;
} }

@ -11,16 +11,13 @@ import java.util.List;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-11 * @ 2023-02-10
*/ */
@Data @Data
public class PaymentPagination extends Pagination { public class PaymentPagination extends Pagination {
/** 单据编号 */ /** 单据编号 */
private String documentno; private String documentno;
/** 客户 */
private String suppliername;
/** /**
* id * id
*/ */

@ -9,7 +9,7 @@ import java.util.*;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-11 * @ 2023-02-10
*/ */
@Data @Data
public class PaymentPaginationExportModel extends Pagination { public class PaymentPaginationExportModel extends Pagination {
@ -23,7 +23,4 @@ public class PaymentPaginationExportModel extends Pagination {
/** 单据编号 */ /** 单据编号 */
private String documentno; private String documentno;
/** 客户 */
private String suppliername;
} }

@ -2,7 +2,12 @@
package jnpf.payment.model.payment; package jnpf.payment.model.payment;
import jnpf.payment.model.payment.Payment_item0Model;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data; import lombok.Data;
/** /**
@ -11,7 +16,7 @@ import lombok.Data;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-11 * @ 2023-02-10
*/ */
@Data @Data
public class PaymentUpForm{ public class PaymentUpForm{
@ -19,29 +24,19 @@ public class PaymentUpForm{
private String id; private String id;
/** 业务日期 **/
@JsonProperty("businessdate")
private Long businessdate;
/** 单据编号 **/ /** 单据编号 **/
@JsonProperty("documentno") @JsonProperty("documentno")
private String documentno; private String documentno;
/** 客户 **/ /** 供应商 **/
@JsonProperty("suppliername") @JsonProperty("suppliername")
private String suppliername; private String suppliername;
/** 币别 **/ /** 付款类型 **/
@JsonProperty("currency") @JsonProperty("paymenttype")
private String currency; private String paymenttype;
/** 付款金额 **/
@JsonProperty("paymentamount")
private String paymentamount;
/** 付款账户 **/ /** 付款账户 **/
@ -54,59 +49,57 @@ public class PaymentUpForm{
private String paymentbank; private String paymentbank;
/** 付款类型 **/ /** 付款金额 **/
@JsonProperty("paymenttype") @JsonProperty("paymentamount")
private String paymenttype; private String paymentamount;
/** 结算类型 **/
@JsonProperty("settlementtype")
private String settlementtype;
/** 单据状态 **/ /** 收款账户 **/
@JsonProperty("status") @JsonProperty("collectionaccount")
private String status; private String collectionaccount;
/** 创建人id **/ /** 收款银行 **/
@JsonProperty("creatorUserId") @JsonProperty("collectionbank")
private String creatorUserId; private String collectionbank;
/** 创建人名称 **/ /** 申请金额 **/
@JsonProperty("creatorUserName") @JsonProperty("requestedamount")
private String creatorUserName; private String requestedamount;
/** 创建时间 **/ /** 应付日期 **/
@JsonProperty("creatorTime") @JsonProperty("duedate")
private String creatorTime; private Long duedate;
/** 修改人id **/ /** 币别 **/
@JsonProperty("lastModifyUserId") @JsonProperty("currency")
private String lastModifyUserId; private String currency;
/** 修改人名称 **/ /** 结算类型 **/
@JsonProperty("lastModifyUserName") @JsonProperty("settlementtype")
private String lastModifyUserName; private String settlementtype;
/** 修改时间 **/ /** 来源单号 **/
@JsonProperty("lastModifyTime") @JsonProperty("paymentno")
private String lastModifyTime; private String paymentno;
/** 部门id **/ /** 备注 **/
@JsonProperty("departmentId") @JsonProperty("remark")
private String departmentId; private String remark;
/** 组织id **/ /** 单据状态 **/
@JsonProperty("orgnizeId") @JsonProperty("status")
private String orgnizeId; private String status;
/** 子表数据 **/
@JsonProperty("payment_item0List")
private List<Payment_item0Model> payment_item0List;
} }

@ -0,0 +1,73 @@
package jnpf.payment.model.payment;
import lombok.Data;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
/**
*
*
* V3.2.0
* : LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-10
*/
@Data
public class Payment_item0Model {
/** 付款金额 **/
@JsonProperty("amount")
private String amount;
/** 采购订单主表id **/
@JsonProperty("id")
private String id;
/** 付款申请子表id **/
@JsonProperty("paymentdocitemId")
private String paymentdocitemId;
// /** 申请金额 **/
// @JsonProperty("amount")
// private String amount;
//
// /** 订单金额 **/
// @JsonProperty("amount")
// private String amount;
/** 已付金额 **/
@JsonProperty("payPrice")
private String payPrice;
/** 订单编号 **/
@JsonProperty("documentNo")
private String documentNo;
/** 合同编码 **/
@JsonProperty("contractCode")
private String contractCode;
/** 重量 **/
@JsonProperty("num")
private String num;
/** 垫资金额 **/
@JsonProperty("advanceAmount")
private String advanceAmount;
/** 税额 **/
@JsonProperty("rate")
private String rate;
/** 不含税金额 **/
@JsonProperty("notAmount")
private String notAmount;
/** 业务日期 **/
@JsonProperty("creatorTime")
private Long creatorTime;
}

@ -1,17 +1,18 @@
package jnpf.payment.service; package jnpf.payment.service;
import jnpf.payment.entity.Payment_item0Entity;
import jnpf.payment.service.Payment_item0Service;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.payment.entity.PaymentEntity; import jnpf.payment.entity.PaymentEntity;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.payment.model.payment.PaymentPagination; import jnpf.payment.model.payment.PaymentPagination;
import java.util.*;
import java.util.List;
/** /**
* *
* payment * payment
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-11 * 2023-02-10
*/ */
public interface PaymentService extends IService<PaymentEntity> { public interface PaymentService extends IService<PaymentEntity> {
@ -30,6 +31,7 @@ public interface PaymentService extends IService<PaymentEntity> {
boolean update( String id, PaymentEntity entity); boolean update( String id, PaymentEntity entity);
// 子表方法 // 子表方法
List<Payment_item0Entity> GetPayment_item0List(String id);
//列表子表数据方法 //列表子表数据方法
} }

@ -1,15 +1,14 @@
package jnpf.payment.service; package jnpf.payment.service;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.payment.entity.Payment_item0Entity; import jnpf.payment.entity.Payment_item0Entity;
import com.baomidou.mybatisplus.extension.service.IService;
/** /**
* *
* jg_payment_item0 * jg_payment_item0
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-11 * 2023-02-10
*/ */
public interface Payment_item0Service extends IService<Payment_item0Entity> { public interface Payment_item0Service extends IService<Payment_item0Entity> {

@ -1,27 +1,36 @@
package jnpf.payment.service.impl; package jnpf.payment.service.impl;
import cn.hutool.core.util.ObjectUtil; import jnpf.payment.entity.*;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.payment.entity.PaymentEntity;
import jnpf.payment.entity.Payment_item0Entity;
import jnpf.payment.mapper.PaymentMapper; import jnpf.payment.mapper.PaymentMapper;
import jnpf.payment.model.payment.PaymentPagination; import jnpf.payment.service.*;
import jnpf.payment.service.PaymentService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.util.RandomUtil;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel; import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.permission.service.AuthorizeService;
import jnpf.util.ServletUtil;
import jnpf.util.StringUtil;
import jnpf.util.UserProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import jnpf.payment.model.payment.PaymentPagination;
import jnpf.permission.service.AuthorizeService;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.ArrayList; import com.baomidou.mybatisplus.annotation.TableField;
import java.util.List; import java.util.stream.Collectors;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.*;
/** /**
* *
@ -29,10 +38,10 @@ import java.util.List;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-11 * 2023-02-10
*/ */
@Service @Service
public class PaymentServiceImpl extends ServiceImpl<PaymentMapper, PaymentEntity> implements PaymentService { public class PaymentServiceImpl extends ServiceImpl<PaymentMapper, PaymentEntity> implements PaymentService{
@Autowired @Autowired
@ -42,6 +51,9 @@ public class PaymentServiceImpl extends ServiceImpl<PaymentMapper, PaymentEntity
private AuthorizeService authorizeService; private AuthorizeService authorizeService;
@Autowired
private Payment_item0Service payment_item0Service;
@ -102,11 +114,6 @@ public class PaymentServiceImpl extends ServiceImpl<PaymentMapper, PaymentEntity
paymentQueryWrapper.lambda().like(PaymentEntity::getDocumentno,paymentPagination.getDocumentno()); paymentQueryWrapper.lambda().like(PaymentEntity::getDocumentno,paymentPagination.getDocumentno());
} }
if(StringUtil.isNotEmpty(paymentPagination.getSuppliername())){
paymentNum++;
paymentQueryWrapper.lambda().like(PaymentEntity::getSuppliername,paymentPagination.getSuppliername());
}
if(AllIdList.size()>0){ if(AllIdList.size()>0){
paymentQueryWrapper.lambda().in(PaymentEntity::getId, AllIdList); paymentQueryWrapper.lambda().in(PaymentEntity::getId, AllIdList);
} }
@ -191,11 +198,6 @@ public class PaymentServiceImpl extends ServiceImpl<PaymentMapper, PaymentEntity
paymentQueryWrapper.lambda().like(PaymentEntity::getDocumentno,paymentPagination.getDocumentno()); paymentQueryWrapper.lambda().like(PaymentEntity::getDocumentno,paymentPagination.getDocumentno());
} }
if(StringUtil.isNotEmpty(paymentPagination.getSuppliername())){
paymentNum++;
paymentQueryWrapper.lambda().like(PaymentEntity::getSuppliername,paymentPagination.getSuppliername());
}
if(AllIdList.size()>0){ if(AllIdList.size()>0){
paymentQueryWrapper.lambda().in(PaymentEntity::getId, AllIdList); paymentQueryWrapper.lambda().in(PaymentEntity::getId, AllIdList);
} }
@ -252,6 +254,12 @@ public class PaymentServiceImpl extends ServiceImpl<PaymentMapper, PaymentEntity
} }
} }
//子表方法 //子表方法
@Override
public List<Payment_item0Entity> GetPayment_item0List(String id){
QueryWrapper<Payment_item0Entity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(Payment_item0Entity::getPaymentId, id);
return payment_item0Service.list(queryWrapper);
}
//列表子表数据方法 //列表子表数据方法

@ -1,10 +1,30 @@
package jnpf.payment.service.impl; package jnpf.payment.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import jnpf.payment.entity.*;
import jnpf.payment.entity.Payment_item0Entity;
import jnpf.payment.mapper.Payment_item0Mapper; import jnpf.payment.mapper.Payment_item0Mapper;
import jnpf.payment.service.Payment_item0Service; import jnpf.payment.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.util.RandomUtil;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.*;
/** /**
* *
@ -12,10 +32,10 @@ import org.springframework.stereotype.Service;
* V3.2.0 * V3.2.0
* LINKAGE-BOOT * LINKAGE-BOOT
* LINKAGE-BOOT * LINKAGE-BOOT
* 2023-01-11 * 2023-02-10
*/ */
@Service @Service
public class Payment_item0ServiceImpl extends ServiceImpl<Payment_item0Mapper, Payment_item0Entity> implements Payment_item0Service { public class Payment_item0ServiceImpl extends ServiceImpl<Payment_item0Mapper, Payment_item0Entity> implements Payment_item0Service{
} }

@ -15,8 +15,11 @@ import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO; import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil; import jnpf.config.ConfigValueUtil;
import jnpf.exception.DataException; import jnpf.exception.DataException;
import jnpf.purchaseback.entity.PurchaseorderEntity;
import jnpf.purchaseback.service.PurchaseorderService;
import jnpf.purchaseorder.entity.*; import jnpf.purchaseorder.entity.*;
import jnpf.purchaseorder.service.*; import jnpf.purchaseorder.service.*;
import org.bytedeco.opencv.presets.opencv_core;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import jnpf.purchaseorder.model.purchaseorder.*; import jnpf.purchaseorder.model.purchaseorder.*;
import jnpf.purchaseorder.model.purchaseorder.PurchaseorderPagination; import jnpf.purchaseorder.model.purchaseorder.PurchaseorderPagination;
@ -80,6 +83,8 @@ public class PurchaseorderController {
private PaymentdocpoService paymentdocpoService; private PaymentdocpoService paymentdocpoService;
@Autowired @Autowired
private InvoicesitemService invoicesitemService; private InvoicesitemService invoicesitemService;
@Autowired
private PurchaseorderService purchaseorderService;
/** /**
@ -88,7 +93,8 @@ public class PurchaseorderController {
* @param * @param
* @return * @return
*/ */
@PostMapping("pigeonhole") @PostMapping("/pigeonhole")
@Transactional
public ActionResult pigeonhole(@RequestBody PigeonholeModel pigeonholeModel) { public ActionResult pigeonhole(@RequestBody PigeonholeModel pigeonholeModel) {
PurchaseorderitemEntity purchaseorder = purchaseorderitemService.getById(pigeonholeModel.getId()); PurchaseorderitemEntity purchaseorder = purchaseorderitemService.getById(pigeonholeModel.getId());
if (purchaseorder.getInvoiceAmount().equals(purchaseorder.getAmount()) && purchaseorder.getInvoiceAmount().equals(purchaseorder.getPayPrice())){ if (purchaseorder.getInvoiceAmount().equals(purchaseorder.getAmount()) && purchaseorder.getInvoiceAmount().equals(purchaseorder.getPayPrice())){
@ -100,6 +106,37 @@ public class PurchaseorderController {
} }
} }
/**
*
*
* @param
* @return
*/
@PutMapping("/paymentapply/{ids}")
@Transactional
public ActionResult paymentapply(@PathVariable("ids") String ids) {
String[] idList = ids.split(",");
String supplier = "";
int i = 0;
for (String id : idList){
PurchaseorderEntity purchaseorderEntity = purchaseorderService.getById(id);
if (!purchaseorderEntity.getStatus().equals("2")){
return ActionResult.fail("请先完成入库操作");
}
if (purchaseorderEntity.getPayPrice().equals(purchaseorderEntity.getAmount())){
return ActionResult.fail("已完成付款");
}
if (!purchaseorderEntity.getInvoiceAmount().equals(purchaseorderEntity.getAmount())){
return ActionResult.fail("请先开具发票");
}
if (i>0 && !supplier.equals(purchaseorderEntity.getSupplierName())){
return ActionResult.fail("存在多个不同供应商,请重新勾选");
}
supplier = purchaseorderEntity.getSupplierName();
i++;
}
return ActionResult.success("付款申请通过");
}
/** /**
* *

@ -1,55 +1,56 @@
package jnpf.supplier.controller; package jnpf.supplier.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import jnpf.base.ActionResult; import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO;
import jnpf.base.vo.PageListVO; import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO; import jnpf.base.vo.PaginationVO;
import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil; import jnpf.config.ConfigValueUtil;
import jnpf.exception.DataException; import jnpf.exception.DataException;
import jnpf.supplier.entity.SupplierEntity; import org.springframework.transaction.annotation.Transactional;
import jnpf.supplier.entity.SupplierMobileEntity;
import jnpf.supplier.model.supplier.*; import jnpf.supplier.model.supplier.*;
import jnpf.supplier.service.SupplierService; import jnpf.supplier.model.supplier.SupplierPagination;
import jnpf.util.*; import jnpf.util.*;
import jnpf.util.enums.FileTypeEnum;
import jnpf.util.file.UploadUtil;
import lombok.Cleanup;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import lombok.Cleanup;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.RestController;
import jnpf.supplier.entity.SupplierMobileEntity;
import jnpf.supplier.service.SupplierMobileService;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import javax.validation.Valid; import javax.validation.Valid;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import jnpf.util.GeneraterSwapUtil;
import java.util.List; import java.util.*;
import java.util.Map;
import jnpf.util.file.UploadUtil;
import jnpf.util.enums.FileTypeEnum;
/** /**
* *
* * supplier
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-04 * @ 2023-02-13
*/ */
@Slf4j @Slf4j
@RestController @RestController
@Api(tags = "供应商档案" , value = "supplier") @Api(tags = "supplier" , value = "supplier")
@RequestMapping("/api/supplier/Supplier") @RequestMapping("/api/supplier/Supplier")
public class SupplierController { public class SupplierMobileController {
@Autowired @Autowired
private GeneraterSwapUtil generaterSwapUtil; private GeneraterSwapUtil generaterSwapUtil;
@ -61,7 +62,7 @@ public class SupplierController {
private UserProvider userProvider; private UserProvider userProvider;
@Autowired @Autowired
private SupplierService supplierService; private SupplierMobileService supplierMobileService;
@ -74,9 +75,10 @@ public class SupplierController {
*/ */
@PostMapping("/getList") @PostMapping("/getList")
public ActionResult list(@RequestBody SupplierPagination supplierPagination)throws IOException{ public ActionResult list(@RequestBody SupplierPagination supplierPagination)throws IOException{
List<SupplierMobileEntity> list= supplierService.getList(supplierPagination); List<SupplierMobileEntity> list= supplierMobileService.getList(supplierPagination);
//处理id字段转名称若无需转或者为空可删除 //处理id字段转名称若无需转或者为空可删除
for(SupplierMobileEntity entity:list){ for(SupplierMobileEntity entity:list){
entity.setCompanyId(generaterSwapUtil.comSelectValues(entity.getCompanyId()));
entity.setStatus(generaterSwapUtil.switchSelectValue(entity.getStatus() ,"1" ,"0")); entity.setStatus(generaterSwapUtil.switchSelectValue(entity.getStatus() ,"1" ,"0"));
} }
List<SupplierListVO> listVO=JsonUtil.getJsonToList(list,SupplierListVO.class); List<SupplierListVO> listVO=JsonUtil.getJsonToList(list,SupplierListVO.class);
@ -103,9 +105,9 @@ public class SupplierController {
public ActionResult create(@RequestBody @Valid SupplierCrForm supplierCrForm) throws DataException { public ActionResult create(@RequestBody @Valid SupplierCrForm supplierCrForm) throws DataException {
String mainId =RandomUtil.uuId(); String mainId =RandomUtil.uuId();
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
SupplierEntity entity = JsonUtil.getJsonToBean(supplierCrForm, SupplierEntity.class); SupplierMobileEntity entity = JsonUtil.getJsonToBean(supplierCrForm, SupplierMobileEntity.class);
entity.setId(mainId); entity.setId(mainId);
supplierService.save(entity); supplierMobileService.save(entity);
return ActionResult.success("创建成功"); return ActionResult.success("创建成功");
@ -143,9 +145,10 @@ public class SupplierController {
return ActionResult.fail("请选择导出字段"); return ActionResult.fail("请选择导出字段");
} }
SupplierPagination supplierPagination=JsonUtil.getJsonToBean(supplierPaginationExportModel, SupplierPagination.class); SupplierPagination supplierPagination=JsonUtil.getJsonToBean(supplierPaginationExportModel, SupplierPagination.class);
List<SupplierEntity> list= supplierService.getTypeList(supplierPagination,supplierPaginationExportModel.getDataType()); List<SupplierMobileEntity> list= supplierMobileService.getTypeList(supplierPagination,supplierPaginationExportModel.getDataType());
//处理id字段转名称若无需转或者为空可删除 //处理id字段转名称若无需转或者为空可删除
for(SupplierEntity entity:list){ for(SupplierMobileEntity entity:list){
entity.setCompanyId(generaterSwapUtil.comSelectValues(entity.getCompanyId()));
entity.setStatus(generaterSwapUtil.switchSelectValue(entity.getStatus() ,"1" ,"0")); entity.setStatus(generaterSwapUtil.switchSelectValue(entity.getStatus() ,"1" ,"0"));
} }
List<SupplierListVO> listVO=JsonUtil.getJsonToList(list,SupplierListVO.class); List<SupplierListVO> listVO=JsonUtil.getJsonToList(list,SupplierListVO.class);
@ -173,16 +176,16 @@ public class SupplierController {
entitys.add(new ExcelExportEntity("供应商名称" ,"supplierName")); entitys.add(new ExcelExportEntity("供应商名称" ,"supplierName"));
break; break;
case "supplierSiteId" : case "supplierSiteId" :
entitys.add(new ExcelExportEntity("地点ID" ,"supplierSiteId")); entitys.add(new ExcelExportEntity("供应商地点ID" ,"supplierSiteId"));
break; break;
case "supplierSiteCode" : case "supplierSiteCode" :
entitys.add(new ExcelExportEntity("地点名称" ,"supplierSiteCode")); entitys.add(new ExcelExportEntity("供应商地点名称" ,"supplierSiteCode"));
break; break;
case "companyId" : case "companyId" :
entitys.add(new ExcelExportEntity("所属公司编码" ,"companyId")); entitys.add(new ExcelExportEntity("公司名称" ,"companyId"));
break; break;
case "companyName" : case "address" :
entitys.add(new ExcelExportEntity("所属公司名称" ,"companyName")); entitys.add(new ExcelExportEntity("地址" ,"address"));
break; break;
case "contactName" : case "contactName" :
entitys.add(new ExcelExportEntity("联系人" ,"contactName")); entitys.add(new ExcelExportEntity("联系人" ,"contactName"));
@ -193,9 +196,6 @@ public class SupplierController {
case "supplierLevel" : case "supplierLevel" :
entitys.add(new ExcelExportEntity("供应商等级" ,"supplierLevel")); entitys.add(new ExcelExportEntity("供应商等级" ,"supplierLevel"));
break; break;
case "address" :
entitys.add(new ExcelExportEntity("地址" ,"address"));
break;
case "status" : case "status" :
entitys.add(new ExcelExportEntity("启用" ,"status")); entitys.add(new ExcelExportEntity("启用" ,"status"));
break; break;
@ -260,7 +260,7 @@ public class SupplierController {
*/ */
@GetMapping("/{id}") @GetMapping("/{id}")
public ActionResult<SupplierInfoVO> info(@PathVariable("id") String id){ public ActionResult<SupplierInfoVO> info(@PathVariable("id") String id){
SupplierEntity entity= supplierService.getInfo(id); SupplierMobileEntity entity= supplierMobileService.getInfo(id);
SupplierInfoVO vo=JsonUtil.getJsonToBean(entity, SupplierInfoVO.class); SupplierInfoVO vo=JsonUtil.getJsonToBean(entity, SupplierInfoVO.class);
//子表 //子表
@ -276,7 +276,7 @@ public class SupplierController {
*/ */
@GetMapping("/detail/{id}") @GetMapping("/detail/{id}")
public ActionResult<SupplierInfoVO> detailInfo(@PathVariable("id") String id){ public ActionResult<SupplierInfoVO> detailInfo(@PathVariable("id") String id){
SupplierEntity entity= supplierService.getInfo(id); SupplierMobileEntity entity= supplierMobileService.getInfo(id);
SupplierInfoVO vo=JsonUtil.getJsonToBean(entity, SupplierInfoVO.class); SupplierInfoVO vo=JsonUtil.getJsonToBean(entity, SupplierInfoVO.class);
//子表数据转换 //子表数据转换
@ -284,6 +284,7 @@ public class SupplierController {
//附表数据转换 //附表数据转换
//添加到详情表单对象中 //添加到详情表单对象中
vo.setCompanyId(generaterSwapUtil.comSelectValues(vo.getCompanyId()));
vo.setStatus(generaterSwapUtil.switchSelectValue(vo.getStatus() ,"1" ,"0")); vo.setStatus(generaterSwapUtil.switchSelectValue(vo.getStatus() ,"1" ,"0"));
return ActionResult.success(vo); return ActionResult.success(vo);
@ -302,10 +303,10 @@ public class SupplierController {
@Transactional @Transactional
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid SupplierUpForm supplierUpForm) throws DataException { public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid SupplierUpForm supplierUpForm) throws DataException {
UserInfo userInfo=userProvider.get(); UserInfo userInfo=userProvider.get();
SupplierEntity entity= supplierService.getInfo(id); SupplierMobileEntity entity= supplierMobileService.getInfo(id);
if(entity!=null){ if(entity!=null){
SupplierEntity subentity=JsonUtil.getJsonToBean(supplierUpForm, SupplierEntity.class); SupplierMobileEntity subentity=JsonUtil.getJsonToBean(supplierUpForm, SupplierMobileEntity.class);
supplierService.update(id, subentity); supplierMobileService.update(id, subentity);
return ActionResult.success("更新成功"); return ActionResult.success("更新成功");
}else{ }else{
return ActionResult.fail("更新失败,数据不存在"); return ActionResult.fail("更新失败,数据不存在");
@ -323,9 +324,9 @@ public class SupplierController {
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@Transactional @Transactional
public ActionResult delete(@PathVariable("id") String id){ public ActionResult delete(@PathVariable("id") String id){
SupplierEntity entity= supplierService.getInfo(id); SupplierMobileEntity entity= supplierMobileService.getInfo(id);
if(entity!=null){ if(entity!=null){
supplierService.delete(entity); supplierMobileService.delete(entity);
} }
return ActionResult.success("删除成功"); return ActionResult.success("删除成功");

@ -1,108 +0,0 @@
package jnpf.supplier.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-04
*/
@Data
@TableName("jg_supplier")
public class SupplierEntity {
@TableId("ID")
private String id;
@TableField("CREATOR_USER_ID")
private String creatoruserid;
@TableField("CREATOR_USER_NAME")
private String creatorusername;
@TableField("CREATOR_TIME")
private Date creatortime;
@TableField("LAST_MODIFY_USER_ID")
private String lastmodifyuserid;
@TableField("LAST_MODIFY_USER_NAME")
private String lastmodifyusername;
@TableField("LAST_MODIFY_TIME")
private Date lastmodifytime;
@TableField("DELETE_USER_ID")
private String deleteuserid;
@TableField("DELETE_USER_NAME")
private String deleteusername;
@TableField("DELETE_TIME")
private Date deletetime;
@TableField("DELETE_MARK")
private String deletemark;
@TableField("SUPPLIER_CODE")
private String supplierCode;
@TableField("SUPPLIER_NAME")
private String supplierName;
@TableField("SUPPLIER_SITE_ID")
private String supplierSiteId;
@TableField("SUPPLIER_SITE_CODE")
private String supplierSiteCode;
@TableField("COMPANY_ID")
private String companyId;
@TableField("COMPANY_NAME")
private String companyName;
@TableField("VAT_REGISTRATION_NUM")
private String vatRegistrationNum;
// @TableField("ORGNIZE_ID")
// private String orgnizeId;
@TableField("orgnize_id")
private String orgId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("SUPPLY")
private Integer supply;
@TableField("CONTACT_NAME")
private String contactName;
@TableField("CONTACT_PHONE")
private String contactPhone;
@TableField("SUPPLIER_LEVEL")
private String supplierLevel;
@TableField("ADDRESS")
private String address;
@TableField("STATUS")
private String status;
}

@ -1,52 +1,59 @@
package jnpf.supplier.entity; package jnpf.supplier.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* @Author: WangChuang *
* @Date: 8/2/2023 1:37 *
* @Description //注释: * @ V3.2.0
* @Version 1.0 * @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-13
*/ */
@Data @Data
@TableName("jg_supplier")
public class SupplierMobileEntity { public class SupplierMobileEntity {
@TableId("ID") @TableId("ID")
private String id; private String id;
@TableField("CREATOR_USER_ID") @TableField("CREATOR_USER_ID")
private String creatoruserid; private String creatorUserId;
@TableField("CREATOR_USER_NAME") @TableField("CREATOR_USER_NAME")
private String creatorusername; private String creatorUserName;
@TableField("CREATOR_TIME") @TableField("CREATOR_TIME")
private Date creatortime; private Date creatorTime;
@TableField("LAST_MODIFY_USER_ID") @TableField("LAST_MODIFY_USER_ID")
private String lastmodifyuserid; private String lastModifyUserId;
@TableField("LAST_MODIFY_USER_NAME") @TableField("LAST_MODIFY_USER_NAME")
private String lastmodifyusername; private String lastModifyUserName;
@TableField("LAST_MODIFY_TIME") @TableField("LAST_MODIFY_TIME")
private Date lastmodifytime; private Date lastModifyTime;
@TableField("DELETE_USER_ID") @TableField("DELETE_USER_ID")
private String deleteuserid; private String deleteUserId;
@TableField("DELETE_USER_NAME") @TableField("DELETE_USER_NAME")
private String deleteusername; private String deleteUserName;
@TableField("DELETE_TIME") @TableField("DELETE_TIME")
private Date deletetime; private Date deleteTime;
@TableField("DELETE_MARK") @TableField("DELETE_MARK")
private String deletemark; private String deleteMark;
@TableField("SUPPLIER_CODE") @TableField("SUPPLIER_CODE")
private String supplierCode; private String supplierCode;
@ -69,13 +76,8 @@ public class SupplierMobileEntity {
@TableField("VAT_REGISTRATION_NUM") @TableField("VAT_REGISTRATION_NUM")
private String vatRegistrationNum; private String vatRegistrationNum;
@TableField("ORGNIZE_ID")
// @TableField("ORGNIZE_ID") private String orgnizeId;
// private String orgnizeId;
@TableField("orgnize_id")
private String orgId;
@TableField("DEPARTMENT_ID") @TableField("DEPARTMENT_ID")
private String departmentId; private String departmentId;
@ -98,14 +100,4 @@ public class SupplierMobileEntity {
@TableField("STATUS") @TableField("STATUS")
private String status; private String status;
// 收获量
private Double settlemenSum;
// 净重
private Double weightSum;
// 扣重
private Double buckleWeightSum;
// 总重
private Double grossWeightSum;
// 总额
private Double salesPriceSum;
} }

@ -1,23 +0,0 @@
package jnpf.supplier.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import jnpf.supplier.entity.SupplierEntity;
import jnpf.supplier.entity.SupplierMobileEntity;
import org.apache.ibatis.annotations.Param;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-04
*/
public interface SupplierMapper extends BaseMapper<SupplierEntity> {
IPage<SupplierMobileEntity> getSupplierList(@Param("page") Page<SupplierMobileEntity> page, @Param("ew")Wrapper<SupplierEntity> wrapper);
}

@ -0,0 +1,17 @@
package jnpf.supplier.mapper;
import jnpf.supplier.entity.SupplierMobileEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
*
* supplier
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-13
*/
public interface SupplierMobileMapper extends BaseMapper<SupplierMobileEntity> {
}

@ -14,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-04 * @ 2023-02-13
*/ */
@Data @Data
public class SupplierCrForm { public class SupplierCrForm {
@ -27,21 +27,21 @@ public class SupplierCrForm {
@JsonProperty("supplierName") @JsonProperty("supplierName")
private String supplierName; private String supplierName;
/** 地点ID **/ /** 供应商地点ID **/
@JsonProperty("supplierSiteId") @JsonProperty("supplierSiteId")
private String supplierSiteId; private String supplierSiteId;
/** 地点名称 **/ /** 供应商地点名称 **/
@JsonProperty("supplierSiteCode") @JsonProperty("supplierSiteCode")
private String supplierSiteCode; private String supplierSiteCode;
/** 所属公司编码 **/ /** 公司名称 **/
@JsonProperty("companyId") @JsonProperty("companyId")
private String companyId; private String companyId;
/** 所属公司名称 **/ /** 地址 **/
@JsonProperty("companyName") @JsonProperty("address")
private String companyName; private String address;
/** 联系人 **/ /** 联系人 **/
@JsonProperty("contactName") @JsonProperty("contactName")
@ -55,10 +55,6 @@ public class SupplierCrForm {
@JsonProperty("supplierLevel") @JsonProperty("supplierLevel")
private String supplierLevel; private String supplierLevel;
/** 地址 **/
@JsonProperty("address")
private String address;
/** 启用 **/ /** 启用 **/
@JsonProperty("status") @JsonProperty("status")
private String status; private String status;

@ -15,7 +15,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-04 * @ 2023-02-13
*/ */
@Data @Data
public class SupplierInfoVO{ public class SupplierInfoVO{
@ -31,21 +31,21 @@ public class SupplierInfoVO{
@JsonProperty("supplierName") @JsonProperty("supplierName")
private String supplierName; private String supplierName;
/** 地点ID **/ /** 供应商地点ID **/
@JsonProperty("supplierSiteId") @JsonProperty("supplierSiteId")
private String supplierSiteId; private String supplierSiteId;
/** 地点名称 **/ /** 供应商地点名称 **/
@JsonProperty("supplierSiteCode") @JsonProperty("supplierSiteCode")
private String supplierSiteCode; private String supplierSiteCode;
/** 所属公司编码 **/ /** 公司名称 **/
@JsonProperty("companyId") @JsonProperty("companyId")
private String companyId; private String companyId;
/** 所属公司名称 **/ /** 地址 **/
@JsonProperty("companyName") @JsonProperty("address")
private String companyName; private String address;
/** 联系人 **/ /** 联系人 **/
@JsonProperty("contactName") @JsonProperty("contactName")
@ -59,10 +59,6 @@ public class SupplierInfoVO{
@JsonProperty("supplierLevel") @JsonProperty("supplierLevel")
private String supplierLevel; private String supplierLevel;
/** 地址 **/
@JsonProperty("address")
private String address;
/** 启用 **/ /** 启用 **/
@JsonProperty("status") @JsonProperty("status")
private String status; private String status;

@ -10,7 +10,7 @@ import java.util.List;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-04 * @ 2023-02-13
*/ */
@Data @Data
public class SupplierListQuery extends Pagination { public class SupplierListQuery extends Pagination {

@ -3,15 +3,19 @@
package jnpf.supplier.model.supplier; package jnpf.supplier.model.supplier;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data; import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.math.BigDecimal;
/** /**
* *
* *
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-04 * @ 2023-02-13
*/ */
@Data @Data
public class SupplierListVO{ public class SupplierListVO{
@ -30,24 +34,24 @@ public class SupplierListVO{
private String supplierName; private String supplierName;
/** 地点ID **/ /** 供应商地点ID **/
@JsonProperty("supplierSiteId") @JsonProperty("supplierSiteId")
private String supplierSiteId; private String supplierSiteId;
/** 地点名称 **/ /** 供应商地点名称 **/
@JsonProperty("supplierSiteCode") @JsonProperty("supplierSiteCode")
private String supplierSiteCode; private String supplierSiteCode;
/** 所属公司编码 **/ /** 公司名称 **/
@JsonProperty("companyId") @JsonProperty("companyId")
private String companyId; private String companyId;
/** 所属公司名称 **/ /** 地址 **/
@JsonProperty("companyName") @JsonProperty("address")
private String companyName; private String address;
/** 联系人 **/ /** 联系人 **/
@ -65,23 +69,9 @@ public class SupplierListVO{
private String supplierLevel; private String supplierLevel;
/** 地址 **/
@JsonProperty("address")
private String address;
/** 启用 **/ /** 启用 **/
@JsonProperty("status") @JsonProperty("status")
private String status; private String status;
// 收获量
private Double settlemenSum;
// 净重
private Double weightSum;
// 扣重
private Double buckleWeightSum;
// 总重
private Double grossWeightSum;
// 总额
private Double salesPriceSum;
} }

@ -11,7 +11,7 @@ import java.util.List;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-04 * @ 2023-02-13
*/ */
@Data @Data
public class SupplierPagination extends Pagination { public class SupplierPagination extends Pagination {

@ -9,7 +9,7 @@ import java.util.*;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-04 * @ 2023-02-13
*/ */
@Data @Data
public class SupplierPaginationExportModel extends Pagination { public class SupplierPaginationExportModel extends Pagination {

@ -15,7 +15,7 @@ import lombok.Data;
* @ V3.2.0 * @ V3.2.0
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ LINKAGE-BOOT * @ LINKAGE-BOOT
* @ 2023-01-04 * @ 2023-02-13
*/ */
@Data @Data
public class SupplierUpForm{ public class SupplierUpForm{
@ -33,24 +33,24 @@ public class SupplierUpForm{
private String supplierName; private String supplierName;
/** 地点ID **/ /** 供应商地点ID **/
@JsonProperty("supplierSiteId") @JsonProperty("supplierSiteId")
private String supplierSiteId; private String supplierSiteId;
/** 地点名称 **/ /** 供应商地点名称 **/
@JsonProperty("supplierSiteCode") @JsonProperty("supplierSiteCode")
private String supplierSiteCode; private String supplierSiteCode;
/** 所属公司编码 **/ /** 公司名称 **/
@JsonProperty("companyId") @JsonProperty("companyId")
private String companyId; private String companyId;
/** 所属公司名称 **/ /** 地址 **/
@JsonProperty("companyName") @JsonProperty("address")
private String companyName; private String address;
/** 联系人 **/ /** 联系人 **/
@ -68,11 +68,6 @@ public class SupplierUpForm{
private String supplierLevel; private String supplierLevel;
/** 地址 **/
@JsonProperty("address")
private String address;
/** 启用 **/ /** 启用 **/
@JsonProperty("status") @JsonProperty("status")
private String status; private String status;

@ -0,0 +1,34 @@
package jnpf.supplier.service;
import jnpf.supplier.entity.SupplierMobileEntity;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.supplier.model.supplier.SupplierPagination;
import java.util.*;
/**
*
* supplier
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-13
*/
public interface SupplierMobileService extends IService<SupplierMobileEntity> {
List<SupplierMobileEntity> getList(SupplierPagination supplierPagination);
List<SupplierMobileEntity> getTypeList(SupplierPagination supplierPagination, String dataType);
SupplierMobileEntity getInfo(String id);
void delete(SupplierMobileEntity entity);
void create(SupplierMobileEntity entity);
boolean update( String id, SupplierMobileEntity entity);
// 子表方法
//列表子表数据方法
}

@ -1,42 +0,0 @@
package jnpf.supplier.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.supplier.entity.SupplierEntity;
import jnpf.supplier.entity.SupplierMobileEntity;
import jnpf.supplier.model.supplier.SupplierPagination;
import java.util.List;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-04
*/
public interface SupplierService extends IService<SupplierEntity> {
List<SupplierMobileEntity> getList(SupplierPagination supplierPagination);
IPage<SupplierMobileEntity>page(Page<SupplierMobileEntity> page, Wrapper<SupplierEntity> queryWrapper) ;
List<SupplierEntity> getTypeList(SupplierPagination supplierPagination, String dataType);
SupplierEntity getInfo(String id);
void delete(SupplierEntity entity);
void create(SupplierEntity entity);
boolean update(String id, SupplierEntity entity);
// 子表方法
//列表子表数据方法
}

@ -0,0 +1,223 @@
package jnpf.supplier.service.impl;
import jnpf.supplier.entity.*;
import jnpf.supplier.mapper.SupplierMobileMapper;
import jnpf.supplier.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.supplier.model.supplier.SupplierPagination;
import jnpf.permission.service.AuthorizeService;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import jnpf.util.*;
import java.util.*;
/**
*
* supplier
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-13
*/
@Service
public class SupplierMobileServiceImpl extends ServiceImpl<SupplierMobileMapper, SupplierMobileEntity> implements SupplierMobileService {
@Autowired
private UserProvider userProvider;
@Autowired
private AuthorizeService authorizeService;
@Override
public List<SupplierMobileEntity> getList(SupplierPagination supplierPagination){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int supplierNum =0;
QueryWrapper<SupplierMobileEntity> supplierQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object supplierObj=authorizeService.getCondition(new AuthorizeConditionModel(supplierQueryWrapper,supplierPagination.getMenuId(),"supplier"));
if (ObjectUtil.isEmpty(supplierObj)){
return new ArrayList<>();
} else {
supplierQueryWrapper = (QueryWrapper<SupplierMobileEntity>)supplierObj;
supplierNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object supplierObj=authorizeService.getCondition(new AuthorizeConditionModel(supplierQueryWrapper,supplierPagination.getMenuId(),"supplier"));
if (ObjectUtil.isEmpty(supplierObj)){
return new ArrayList<>();
} else {
supplierQueryWrapper = (QueryWrapper<SupplierMobileEntity>)supplierObj;
supplierNum++;
}
}
}
if(StringUtil.isNotEmpty(supplierPagination.getSupplierCode())){
supplierNum++;
supplierQueryWrapper.lambda().like(SupplierMobileEntity::getSupplierCode,supplierPagination.getSupplierCode());
}
if(StringUtil.isNotEmpty(supplierPagination.getSupplierName())){
supplierNum++;
supplierQueryWrapper.lambda().like(SupplierMobileEntity::getSupplierName,supplierPagination.getSupplierName());
}
if(AllIdList.size()>0){
supplierQueryWrapper.lambda().in(SupplierMobileEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(supplierPagination.getSidx())){
supplierQueryWrapper.lambda().orderByDesc(SupplierMobileEntity::getSupplierCode);
}else{
try {
String sidx = supplierPagination.getSidx();
SupplierMobileEntity supplierMobileEntity = new SupplierMobileEntity();
Field declaredField = supplierMobileEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
supplierQueryWrapper="asc".equals(supplierPagination.getSort().toLowerCase())?supplierQueryWrapper.orderByAsc(value):supplierQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if((total>0 && AllIdList.size()>0) || total==0){
Page<SupplierMobileEntity> page=new Page<>(supplierPagination.getCurrentPage(), supplierPagination.getPageSize());
IPage<SupplierMobileEntity> userIPage=this.page(page, supplierQueryWrapper);
return supplierPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<SupplierMobileEntity> list = new ArrayList();
return supplierPagination.setData(list, list.size());
}
}
@Override
public List<SupplierMobileEntity> getTypeList(SupplierPagination supplierPagination, String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int supplierNum =0;
QueryWrapper<SupplierMobileEntity> supplierQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object supplierObj=authorizeService.getCondition(new AuthorizeConditionModel(supplierQueryWrapper,supplierPagination.getMenuId(),"supplier"));
if (ObjectUtil.isEmpty(supplierObj)){
return new ArrayList<>();
} else {
supplierQueryWrapper = (QueryWrapper<SupplierMobileEntity>)supplierObj;
supplierNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object supplierObj=authorizeService.getCondition(new AuthorizeConditionModel(supplierQueryWrapper,supplierPagination.getMenuId(),"supplier"));
if (ObjectUtil.isEmpty(supplierObj)){
return new ArrayList<>();
} else {
supplierQueryWrapper = (QueryWrapper<SupplierMobileEntity>)supplierObj;
supplierNum++;
}
}
}
if(StringUtil.isNotEmpty(supplierPagination.getSupplierCode())){
supplierNum++;
supplierQueryWrapper.lambda().like(SupplierMobileEntity::getSupplierCode,supplierPagination.getSupplierCode());
}
if(StringUtil.isNotEmpty(supplierPagination.getSupplierName())){
supplierNum++;
supplierQueryWrapper.lambda().like(SupplierMobileEntity::getSupplierName,supplierPagination.getSupplierName());
}
if(AllIdList.size()>0){
supplierQueryWrapper.lambda().in(SupplierMobileEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(supplierPagination.getSidx())){
supplierQueryWrapper.lambda().orderByDesc(SupplierMobileEntity::getSupplierCode);
}else{
try {
String sidx = supplierPagination.getSidx();
SupplierMobileEntity supplierMobileEntity = new SupplierMobileEntity();
Field declaredField = supplierMobileEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
supplierQueryWrapper="asc".equals(supplierPagination.getSort().toLowerCase())?supplierQueryWrapper.orderByAsc(value):supplierQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<SupplierMobileEntity> page=new Page<>(supplierPagination.getCurrentPage(), supplierPagination.getPageSize());
IPage<SupplierMobileEntity> userIPage=this.page(page, supplierQueryWrapper);
return supplierPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<SupplierMobileEntity> list = new ArrayList();
return supplierPagination.setData(list, list.size());
}
}else{
return this.list(supplierQueryWrapper);
}
}
@Override
public SupplierMobileEntity getInfo(String id){
QueryWrapper<SupplierMobileEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(SupplierMobileEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(SupplierMobileEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, SupplierMobileEntity entity){
entity.setId(id);
return this.updateById(entity);
}
@Override
public void delete(SupplierMobileEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
//子表方法
//列表子表数据方法
}

@ -1,243 +0,0 @@
package jnpf.supplier.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.permission.service.AuthorizeService;
import jnpf.supplier.entity.SupplierEntity;
import jnpf.supplier.entity.SupplierMobileEntity;
import jnpf.supplier.mapper.SupplierMapper;
import jnpf.supplier.model.supplier.SupplierPagination;
import jnpf.supplier.service.SupplierService;
import jnpf.util.ServletUtil;
import jnpf.util.StringUtil;
import jnpf.util.UserProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-04
*/
@Service
public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, SupplierEntity> implements SupplierService {
@Autowired
private UserProvider userProvider;
@Autowired
private AuthorizeService authorizeService;
@Resource
private SupplierMapper supplierMapper;
@Override
public List<SupplierMobileEntity> getList(SupplierPagination supplierPagination){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int supplierNum =0;
QueryWrapper<SupplierEntity> supplierQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object supplierObj=authorizeService.getCondition(new AuthorizeConditionModel(supplierQueryWrapper,supplierPagination.getMenuId(),"supplier"));
if (ObjectUtil.isEmpty(supplierObj)){
return new ArrayList<>();
} else {
supplierQueryWrapper = (QueryWrapper<SupplierEntity>)supplierObj;
supplierNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object supplierObj=authorizeService.getCondition(new AuthorizeConditionModel(supplierQueryWrapper,supplierPagination.getMenuId(),"supplier"));
if (ObjectUtil.isEmpty(supplierObj)){
return new ArrayList<>();
} else {
supplierQueryWrapper = (QueryWrapper<SupplierEntity>)supplierObj;
supplierNum++;
}
}
}
if(StringUtil.isNotEmpty(supplierPagination.getSupplierCode())){
supplierNum++;
supplierQueryWrapper.lambda().like(SupplierEntity::getSupplierCode,supplierPagination.getSupplierCode());
}
if(StringUtil.isNotEmpty(supplierPagination.getSupplierName())){
supplierNum++;
supplierQueryWrapper.lambda().like(SupplierEntity::getSupplierName,supplierPagination.getSupplierName());
}
if(StringUtil.isNotEmpty(supplierPagination.getKeyword())){
supplierNum++;
supplierQueryWrapper.lambda().and(wq -> {
// 拼接sql
wq.like(SupplierEntity::getSupplierName,supplierPagination.getKeyword())
.or()
.like(SupplierEntity::getCompanyName,supplierPagination.getKeyword())
.or()
.like(SupplierEntity::getAddress,supplierPagination.getKeyword());
});
}
if(AllIdList.size()>0){
supplierQueryWrapper.lambda().in(SupplierEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(supplierPagination.getSidx())){
supplierQueryWrapper.lambda().orderByDesc(SupplierEntity::getSupplierCode);
}else{
try {
String sidx = supplierPagination.getSidx();
SupplierEntity supplierEntity = new SupplierEntity();
Field declaredField = supplierEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
supplierQueryWrapper="asc".equals(supplierPagination.getSort().toLowerCase())?supplierQueryWrapper.orderByAsc(value):supplierQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if((total>0 && AllIdList.size()>0) || total==0){
Page<SupplierMobileEntity> page=new Page<>(supplierPagination.getCurrentPage(), supplierPagination.getPageSize());
IPage<SupplierMobileEntity> userIPage=this.page(page, supplierQueryWrapper);
return supplierPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<SupplierMobileEntity> list = new ArrayList();
return supplierPagination.setData(list, list.size());
}
}
@Override
public IPage<SupplierMobileEntity> page(Page<SupplierMobileEntity> page, Wrapper<SupplierEntity> queryWrapper) {
return supplierMapper.getSupplierList(page,queryWrapper);
}
@Override
public List<SupplierEntity> getTypeList(SupplierPagination supplierPagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
int supplierNum =0;
QueryWrapper<SupplierEntity> supplierQueryWrapper=new QueryWrapper<>();
boolean pcPermission = false;
boolean appPermission = false;
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object supplierObj=authorizeService.getCondition(new AuthorizeConditionModel(supplierQueryWrapper,supplierPagination.getMenuId(),"supplier"));
if (ObjectUtil.isEmpty(supplierObj)){
return new ArrayList<>();
} else {
supplierQueryWrapper = (QueryWrapper<SupplierEntity>)supplierObj;
supplierNum++;
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object supplierObj=authorizeService.getCondition(new AuthorizeConditionModel(supplierQueryWrapper,supplierPagination.getMenuId(),"supplier"));
if (ObjectUtil.isEmpty(supplierObj)){
return new ArrayList<>();
} else {
supplierQueryWrapper = (QueryWrapper<SupplierEntity>)supplierObj;
supplierNum++;
}
}
}
if(StringUtil.isNotEmpty(supplierPagination.getSupplierCode())){
supplierNum++;
supplierQueryWrapper.lambda().like(SupplierEntity::getSupplierCode,supplierPagination.getSupplierCode());
}
if(StringUtil.isNotEmpty(supplierPagination.getSupplierName())){
supplierNum++;
supplierQueryWrapper.lambda().like(SupplierEntity::getSupplierName,supplierPagination.getSupplierName());
}
if(AllIdList.size()>0){
supplierQueryWrapper.lambda().in(SupplierEntity::getId, AllIdList);
}
//排序
if(StringUtil.isEmpty(supplierPagination.getSidx())){
supplierQueryWrapper.lambda().orderByDesc(SupplierEntity::getSupplierCode);
}else{
try {
String sidx = supplierPagination.getSidx();
SupplierEntity supplierEntity = new SupplierEntity();
Field declaredField = supplierEntity.getClass().getDeclaredField(sidx);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
supplierQueryWrapper="asc".equals(supplierPagination.getSort().toLowerCase())?supplierQueryWrapper.orderByAsc(value):supplierQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<SupplierEntity> page=new Page<>(supplierPagination.getCurrentPage(), supplierPagination.getPageSize());
IPage<SupplierEntity> userIPage=this.page(page, supplierQueryWrapper);
return supplierPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<SupplierEntity> list = new ArrayList();
return supplierPagination.setData(list, list.size());
}
}else{
return this.list(supplierQueryWrapper);
}
}
@Override
public SupplierEntity getInfo(String id){
QueryWrapper<SupplierEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(SupplierEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(SupplierEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, SupplierEntity entity){
entity.setId(id);
return this.updateById(entity);
}
@Override
public void delete(SupplierEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
//子表方法
//列表子表数据方法
}

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.supplier.mapper.SupplierMapper"> <mapper namespace="jnpf.supplier.mapper.SupplierMobileMapper">

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.supplier.mapper.SupplierMapper"> <mapper namespace="jnpf.supplier.mapper.SupplierMobileMapper">
<select id="getSupplierList" resultMap="supplierMap"> <select id="getSupplierList" resultMap="supplierMap">
SELECT SELECT
* *

@ -456,7 +456,7 @@ public class UserController {
if ("1".equals(String.valueOf(originUser.getIsAdministrator()))) { if ("1".equals(String.valueOf(originUser.getIsAdministrator()))) {
UserInfo operatorUser = userProvider.get(); UserInfo operatorUser = userProvider.get();
// 管理员可以修改自己,但是无法修改其他管理员 // 管理员可以修改自己,但是无法修改其他管理员
if (operatorUser.getIsAdministrator()) { /*if (operatorUser.getIsAdministrator()) {
if (!"admin".equals(operatorUser.getUserId())) { if (!"admin".equals(operatorUser.getUserId())) {
if (!operatorUser.getUserId().equals(id)) { if (!operatorUser.getUserId().equals(id)) {
return ActionResult.fail("管理员只能修改自己,不能修改其他管理员"); return ActionResult.fail("管理员只能修改自己,不能修改其他管理员");
@ -464,7 +464,7 @@ public class UserController {
} }
} else { } else {
return ActionResult.fail("无法修改管理员账户"); return ActionResult.fail("无法修改管理员账户");
} }*/
} }
//直属主管不能是自己 //直属主管不能是自己
if (id.equals(userUpForm.getManagerId())) { if (id.equals(userUpForm.getManagerId())) {

@ -2,7 +2,7 @@
<el-dialog title="详情" <el-dialog title="详情"
:close-on-click-modal="false" append-to-body :close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="800px"> width="1000px">
<el-row :gutter="15" class=""> <el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" > <el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading"> <template v-if="!loading">
@ -12,12 +12,6 @@
<p>{{dataForm.documentNo}}</p> <p>{{dataForm.documentNo}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" >
<el-form-item label="业务日期"
prop="businessDate" >
<p>{{jnpf.dateFormat(dataForm.businessDate)}}</p>
</el-form-item>
</el-col>
<el-col :span="8" > <el-col :span="8" >
<el-form-item label="客户名称" <el-form-item label="客户名称"
prop="customerName" > prop="customerName" >
@ -30,12 +24,6 @@
<p>{{dataForm.amountCollected}}</p> <p>{{dataForm.amountCollected}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" >
<el-form-item label="收款类型 "
prop="paymentType" >
<p>{{ dataForm.paymentType | dynamicText(paymentTypeOptions) }} </p>
</el-form-item>
</el-col>
<el-col :span="8" > <el-col :span="8" >
<el-form-item label="收款账户" <el-form-item label="收款账户"
prop="collectionCount" > prop="collectionCount" >
@ -49,9 +37,9 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8" >
<el-form-item label="结算类型" <el-form-item label="收款类型 "
prop="settlementType" > prop="paymentType" >
<p>{{ dataForm.settlementType | dynamicText(settlementTypeOptions) }} </p> <p>{{ dataForm.paymentType | dynamicText(paymentTypeOptions) }} </p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8" >
@ -60,26 +48,41 @@
<p>{{ dataForm.currency | dynamicText(currencyOptions) }} </p> <p>{{ dataForm.currency | dynamicText(currencyOptions) }} </p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="8" >
<el-form-item label="结算类型"
prop="settlementType" >
<p>{{ dataForm.settlementType | dynamicText(settlementTypeOptions) }} </p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="备注信息" <el-form-item label="备注信息"
prop="remark" > prop="remark" >
<p>{{dataForm.remark}}</p> <p>{{dataForm.remark}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="8" >
<el-form-item label="收款凭证"
prop="voucher" >
<JNPF-UploadFz v-model="dataForm.voucher"
disabled
detailed :fileSize="5" sizeUnit="MB" :limit="9" buttonText="点击上传" >
</JNPF-UploadFz>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="单据状态 " <el-form-item label="单据状态 "
prop="status" > prop="status" >
<p>{{ dataForm.status | dynamicText(statusOptions) }} </p> <p>{{ dataForm.status | dynamicText(statusOptions) }} </p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="8" >
<el-form-item label="制单人" <el-form-item label="制单人"
prop="creatorUserName" > prop="creatorUserName" >
<p>{{dataForm.creatorUserName}}</p> <p>{{dataForm.creatorUserName}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-tabs v-model="activeukycpv" tab-position="top" class="mb-20"> <el-tabs v-model="activeojnisi" tab-position="top" class="mb-20">
<el-tab-pane label="收款明细"> <el-tab-pane label="收款明细">
<el-col :span="24" > <el-col :span="24" >
<el-form-item label-width="0"> <el-form-item label-width="0">
@ -88,14 +91,34 @@
</div> </div>
<el-table :data="dataForm.collection_item0List" size='mini' > <el-table :data="dataForm.collection_item0List" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" /> <el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="amount" label="金额"> <el-table-column prop="amount" label="收款金额">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.amount}}</p> <p>{{scope.row.amount}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="quantity" label="数量"> <el-table-column prop="creatorUserId" label="订单金额">
<template slot-scope="scope">
<p>{{scope.row.creatorUserId}}</p>
</template>
</el-table-column>
<el-table-column prop="creatorUserName" label="已收款金额">
<template slot-scope="scope">
<p>{{scope.row.creatorUserName}}</p>
</template>
</el-table-column>
<el-table-column prop="deleteTime" label="删除时间">
<template slot-scope="scope">
<p>{{scope.row.deleteTime}}</p>
</template>
</el-table-column>
<el-table-column prop="lastModifyUserId" label="合同编号">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.quantity}}</p> <p>{{scope.row.lastModifyUserId}}</p>
</template>
</el-table-column>
<el-table-column prop="lastModifyUserName" label="重量">
<template slot-scope="scope">
<p>{{scope.row.lastModifyUserName}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="taxRate" label="税率"> <el-table-column prop="taxRate" label="税率">
@ -103,19 +126,24 @@
<p>{{ scope.row.taxRate | dynamicText(taxRateOptions) }}</p> <p>{{ scope.row.taxRate | dynamicText(taxRateOptions) }}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="taxAmount" label="税额"> <el-table-column prop="lastModifyTime" label="垫资金额">
<template slot-scope="scope">
<p>{{scope.row.lastModifyTime}}</p>
</template>
</el-table-column>
<el-table-column prop="deleteUserId" label="税额">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.taxAmount}}</p> <p>{{scope.row.deleteUserId}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="amountNotTax" label="不含税金额"> <el-table-column prop="deleteUserName" label="不含税金额">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.amountNotTax}}</p> <p>{{scope.row.deleteUserName}}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="备注"> <el-table-column prop="creatorTime" label="业务日期">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.remark}}</p> <p>{{jnpf.dateFormat(scope.row.creatorTime)}}</p>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -148,23 +176,23 @@
dataForm: { dataForm: {
id :'', id :'',
documentNo : '', documentNo : '',
businessDate : '',
customerName : '', customerName : '',
amountCollected : '', amountCollected : '',
paymentType : "0",
collectionCount : '', collectionCount : '',
collectionBank : '', collectionBank : '',
settlementType : "0", paymentType : "0",
currency : "0", currency : "0",
settlementType : "0",
remark : '', remark : '',
voucher : [],
status : "0", status : "0",
creatorUserName : '', creatorUserName : '',
collection_item0List:[], collection_item0List:[],
}, },
activeukycpv:'0', activeojnisi:'0',
paymentTypeOptions:[{"fullName":"货款","id":"0"},{"fullName":"运费","id":"1"},{"fullName":"仓储","id":"2"}], paymentTypeOptions:[{"fullName":"货款","id":"0"},{"fullName":"运费","id":"1"},{"fullName":"仓储","id":"2"}],
settlementTypeOptions:[{"fullName":"现金","id":"0"},{"fullName":"赊购","id":"1"},{"fullName":"网银","id":"2"},{"fullName":"银企直连","id":"3"},{"fullName":"银票","id":"4"},{"fullName":"商票","id":"5"}],
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}], currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
settlementTypeOptions:[{"fullName":"现金","id":"0"},{"fullName":"赊购","id":"1"},{"fullName":"网银","id":"2"},{"fullName":"银企直连","id":"3"},{"fullName":"银票","id":"4"},{"fullName":"商票","id":"5"}],
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"},{"fullName":"已付款","id":"3"}], statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"},{"fullName":"已付款","id":"3"}],
taxRateOptions:[{"fullName":"13","id":"0"},{"fullName":"9","id":"1"},{"fullName":"6","id":"2"},{"fullName":"5","id":"3"},{"fullName":"3","id":"4"},{"fullName":"0","id":"5"}], taxRateOptions:[{"fullName":"13","id":"0"},{"fullName":"9","id":"1"},{"fullName":"6","id":"2"},{"fullName":"5","id":"3"},{"fullName":"3","id":"4"},{"fullName":"0","id":"5"}],
@ -179,8 +207,10 @@
methods: { methods: {
dataInfo(dataAll){ dataInfo(dataAll){
let _dataAll =dataAll let _dataAll =dataAll
_dataAll.voucher = _dataAll.voucher ? JSON.parse( _dataAll.voucher):[]
for(let i=0;i<_dataAll.collection_item0List.length;i++){ for(let i=0;i<_dataAll.collection_item0List.length;i++){
var _list = _dataAll.collection_item0List[i]; var _list = _dataAll.collection_item0List[i];
_list.creatorTime = _list.creatorTime ? jnpf.dateFormat(_list.creatorTime) : ''
} }
this.dataForm = _dataAll this.dataForm = _dataAll
}, },

@ -2,39 +2,31 @@
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" <el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
:close-on-click-modal="false" append-to-body :close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="800px"> width="1000px">
<el-row :gutter="15" class=""> <el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" > <el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
<template v-if="!loading"> <template v-if="!loading">
<el-col :span="8" > <el-col :span="8" >
<el-form-item label="单据编号" <el-form-item label="单据编号"
prop="documentNo" > prop="documentNo" >
<el-input v-model="dataForm.documentNo" <el-input v-model="dataForm.documentNo"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="系统自动生成" readonly>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8" >
<el-form-item label="业务日期" <el-form-item label="客户名称"
prop="businessDate" >
<el-date-picker v-model="dataForm.businessDate"
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" >
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="客户名称"
prop="customerName" > prop="customerName" >
<el-input v-model="dataForm.customerName" <popupSelect v-model="dataForm.customerName"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请选择" clearable field="customerName" interfaceId="393371066040385285" :columnOptions="customerNamecolumnOptions" propsValue="supplier_nm" relationField="supplier_nm" popupType="dialog"
popupTitle="选择数据" popupWidth="800px" @change="popupSelect"
</el-input> >
</popupSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8" >
<el-form-item label="收款金额" <el-form-item label="收款金额"
prop="amountCollected" > prop="amountCollected" >
<el-input v-model="dataForm.amountCollected" <el-input v-model="dataForm.amountCollected"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
@ -43,17 +35,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8" >
<el-form-item label="收款类型 " <el-form-item label="收款账户"
prop="paymentType" >
<el-select v-model="dataForm.paymentType"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in paymentTypeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="收款账户"
prop="collectionCount" > prop="collectionCount" >
<el-input v-model="dataForm.collectionCount" <el-input v-model="dataForm.collectionCount"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
@ -62,7 +44,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8" >
<el-form-item label="收款银行" <el-form-item label="收款银行"
prop="collectionBank" > prop="collectionBank" >
<el-input v-model="dataForm.collectionBank" <el-input v-model="dataForm.collectionBank"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
@ -71,17 +53,17 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8" >
<el-form-item label="结算类型" <el-form-item label="收款类型 "
prop="settlementType" > prop="paymentType" >
<el-select v-model="dataForm.settlementType" <el-select v-model="dataForm.paymentType"
placeholder="请选择" clearable :style='{"width":"100%"}'> placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in settlementTypeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> <el-option v-for="(item, index) in paymentTypeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" > <el-col :span="8" >
<el-form-item label="币别 " <el-form-item label="币别 "
prop="currency" > prop="currency" >
<el-select v-model="dataForm.currency" <el-select v-model="dataForm.currency"
placeholder="请选择" clearable :style='{"width":"100%"}'> placeholder="请选择" clearable :style='{"width":"100%"}'>
@ -90,8 +72,18 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" > <el-col :span="8" >
<el-form-item label="备注信息" <el-form-item label="结算类型"
prop="settlementType" >
<el-select v-model="dataForm.settlementType"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in settlementTypeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="备注信息"
prop="remark" > prop="remark" >
<el-input v-model="dataForm.remark" <el-input v-model="dataForm.remark"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
@ -99,8 +91,17 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="8" >
<el-form-item label="单据状态 " <el-form-item label="收款凭证"
prop="voucher" >
<JNPF-UploadFz v-model="dataForm.voucher"
:fileSize="5" sizeUnit="MB" :limit="9" buttonText="点击上传" >
</JNPF-UploadFz>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="单据状态 "
prop="status" > prop="status" >
<el-select v-model="dataForm.status" <el-select v-model="dataForm.status"
placeholder="请选择" clearable :style='{"width":"100%"}'> placeholder="请选择" clearable :style='{"width":"100%"}'>
@ -109,8 +110,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="8" >
<el-form-item label="制单人" <el-form-item label="制单人"
prop="creatorUserName" > prop="creatorUserName" >
<el-input v-model="dataForm.creatorUserName" <el-input v-model="dataForm.creatorUserName"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
@ -119,7 +120,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-tabs v-model="activeukycpv" tab-position="top" class="mb-20"> <el-tabs v-model="activeojnisi" tab-position="top" class="mb-20">
<el-tab-pane label="收款明细"> <el-tab-pane label="收款明细">
<el-col :span="24" > <el-col :span="24" >
<el-form-item label-width="0"> <el-form-item label-width="0">
@ -128,49 +129,86 @@
</div> </div>
<el-table :data="dataForm.collection_item0List" size='mini' > <el-table :data="dataForm.collection_item0List" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" /> <el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="amount" label="金额"> <el-table-column prop="amount" label="收款金额">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.amount" <el-input v-model="scope.row.amount"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"200%"}'>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="quantity" label="数量"> <el-table-column prop="creatorUserId" label="订单金额">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.quantity" <el-input v-model="scope.row.price"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"200%"}'>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="taxRate" label="税率"> <el-table-column prop="creatorUserName" label="已收款金额">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.taxRate" <el-input v-model="scope.row.amountCollected"
placeholder="请选择" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"200%"}'>
<el-option v-for="(item, index) in taxRateOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> </el-input>
</el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="taxAmount" label="税额"> <el-table-column prop="deleteTime" label="销售订单编号">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.taxAmount" <popupSelect v-model="scope.row.documentNo"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请选择" clearable :field="'deleteTime'+scope.$index" interfaceId="393372436705378053" :columnOptions="jg_collection_item0deleteTimecolumnOptions" propsValue="document_no" relationField="document_no" popupType="dialog"
popupWidth="800px" :bissId="dataForm.customerCode" @change="popupSelect2"
>
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="lastModifyUserId" label="合同编号">
<template slot-scope="scope">
<el-input v-model="scope.row.contractCode"
placeholder="请输入" clearable :style='{"width":"200%"}'>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="amountNotTax" label="不含税金额"> <el-table-column prop="lastModifyUserName" label="重量">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.amountNotTax" <el-input v-model="scope.row.num"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"200%"}'>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="备注"> <!-- <el-table-column prop="taxRate" label="税率">-->
<!-- <template slot-scope="scope">-->
<!-- <el-select v-model="scope.row.taxRate"-->
<!-- placeholder="请选择" clearable :style='{"width":"100%"}'>-->
<!-- <el-option v-for="(item, index) in taxRateOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>-->
<!-- </el-select>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column prop="lastModifyTime" label="垫资金额">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.remark" <el-input v-model="scope.row.advanceAmount"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"200%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="deleteUserId" label="税额">
<template slot-scope="scope">
<el-input v-model="scope.row.rate"
placeholder="请输入" clearable :style='{"width":"200%"}'>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="deleteUserName" label="不含税金额">
<template slot-scope="scope">
<el-input v-model="scope.row.notPrice"
placeholder="请输入" clearable :style='{"width":"200%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="creatorTime" label="业务日期">
<template slot-scope="scope">
<el-date-picker v-model="scope.row.creatorTime"
placeholder="请选择" clearable :style='{"width":"200%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" >
</el-date-picker>
</template>
</el-table-column>
<el-table-column label="操作" width="50" > <el-table-column label="操作" width="50" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn" @click="delcollection_item0List(scope.$index)"></el-button> <el-button size="mini" type="text" class="JNPF-table-delBtn" @click="delcollection_item0List(scope.$index)"></el-button>
@ -207,27 +245,33 @@
loading: false, loading: false,
isDetail: false, isDetail: false,
dataForm: { dataForm: {
customerCode : '',
documentNo : '', documentNo : '',
businessDate : '',
customerName : '', customerName : '',
amountCollected : '', amountCollected : '',
paymentType : "0",
collectionCount : '', collectionCount : '',
collectionBank : '', collectionBank : '',
settlementType : "0", paymentType : "0",
currency : "0", currency : "0",
settlementType : "0",
remark : '', remark : '',
voucher : [],
status : "0", status : "0",
creatorUserName : '', creatorUserName : '',
collection_item0List:[], collection_item0List:[],
}, },
activeukycpv:'0', activeojnisi:'0',
rules: rules:
{ {
}, },
customerNamecolumnOptions:[ {"label":"客户编码","value":"supplier_cd"}, {"label":"客户名称","value":"supplier_nm"}, {"label":"客户地点名称","value":"supplier_site_code"}, {"label":"客户等级","value":"customer_level"},],
jg_collection_item0deleteTimecolumnOptions:[ {"label":"销售订单ID","value":"id"},{"label":"销售订单编号","value":"document_no"}, {"label":"合同编号","value":"contract_code"},
{"label":"订单金额","value":"price"}, {"label":"已收款金额","value":"amount_collected"},
{"label":"重量","value":"num"}, {"label":"垫资金额","value":"advance_amount"},
{"label":"税额","value":"rate"}, {"label":"不含税金额","value":"not_price"}, {"label":"业务日期","value":"creator_time"},],
paymentTypeOptions:[{"fullName":"货款","id":"0"},{"fullName":"运费","id":"1"},{"fullName":"仓储","id":"2"}], paymentTypeOptions:[{"fullName":"货款","id":"0"},{"fullName":"运费","id":"1"},{"fullName":"仓储","id":"2"}],
settlementTypeOptions:[{"fullName":"现金","id":"0"},{"fullName":"赊购","id":"1"},{"fullName":"网银","id":"2"},{"fullName":"银企直连","id":"3"},{"fullName":"银票","id":"4"},{"fullName":"商票","id":"5"}],
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}], currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
settlementTypeOptions:[{"fullName":"现金","id":"0"},{"fullName":"赊购","id":"1"},{"fullName":"网银","id":"2"},{"fullName":"银企直连","id":"3"},{"fullName":"银票","id":"4"},{"fullName":"商票","id":"5"}],
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"},{"fullName":"已付款","id":"3"}], statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"},{"fullName":"已付款","id":"3"}],
taxRateOptions:[{"fullName":"13","id":"0"},{"fullName":"9","id":"1"},{"fullName":"6","id":"2"},{"fullName":"5","id":"3"},{"fullName":"3","id":"4"},{"fullName":"0","id":"5"}], taxRateOptions:[{"fullName":"13","id":"0"},{"fullName":"9","id":"1"},{"fullName":"6","id":"2"},{"fullName":"5","id":"3"},{"fullName":"3","id":"4"},{"fullName":"0","id":"5"}],
@ -239,6 +283,24 @@
}, },
mounted() {}, mounted() {},
methods: { methods: {
popupSelect(e,d){
this.dataForm.customerCode = d.id;
},
popupSelect2(a,b) {
for (let i = 0; i < this.dataForm.collection_item0List.length; i++) {
if (a == this.dataForm.collection_item0List[i].documentNo) {
this.dataForm.collection_item0List[i].id = b.id;
this.dataForm.collection_item0List[i].price = b.price;
this.dataForm.collection_item0List[i].amountCollected = b.amount_collected;
this.dataForm.collection_item0List[i].contractCode = b.contract_code;
this.dataForm.collection_item0List[i].num = b.num;
this.dataForm.collection_item0List[i].advanceAmount = b.advance_amount;
this.dataForm.collection_item0List[i].rate = b.rate;
this.dataForm.collection_item0List[i].notPrice = b.not_price;
this.dataForm.collection_item0List[i].creatorTime = b.creator_time;
}
}
},
collection_item0Exist() { collection_item0Exist() {
let isOk = true; let isOk = true;
for(let i=0;i<this.dataForm.collection_item0List.length;i++){ for(let i=0;i<this.dataForm.collection_item0List.length;i++){
@ -326,11 +388,16 @@
addcollection_item0List(){ addcollection_item0List(){
let item = { let item = {
amount:undefined, amount:undefined,
quantity:undefined, creatorUserId:undefined,
creatorUserName:undefined,
deleteTime:undefined,
lastModifyUserId:undefined,
lastModifyUserName:undefined,
taxRate:undefined, taxRate:undefined,
taxAmount:undefined, lastModifyTime:undefined,
amountNotTax:undefined, deleteUserId:undefined,
remark:undefined, deleteUserName:undefined,
creatorTime:undefined,
} }
this.dataForm.collection_item0List.push(item) this.dataForm.collection_item0List.push(item)
}, },
@ -339,6 +406,7 @@
}, },
dataList(){ dataList(){
var _data = JSON.parse(JSON.stringify(this.dataForm)); var _data = JSON.parse(JSON.stringify(this.dataForm));
_data.voucher = JSON.stringify(_data.voucher)
for(let i=0;i<_data.collection_item0List.length;i++){ for(let i=0;i<_data.collection_item0List.length;i++){
var _list = _data.collection_item0List[i]; var _list = _data.collection_item0List[i];
} }
@ -346,6 +414,7 @@
}, },
dataInfo(dataAll){ dataInfo(dataAll){
let _dataAll =dataAll let _dataAll =dataAll
_dataAll.voucher = JSON.parse( _dataAll.voucher)
for(let i=0;i<_dataAll.collection_item0List.length;i++){ for(let i=0;i<_dataAll.collection_item0List.length;i++){
var _list = _dataAll.collection_item0List[i]; var _list = _dataAll.collection_item0List[i];
} }

@ -26,6 +26,8 @@
</el-button> </el-button>
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除 <el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
</el-button> </el-button>
<el-button type="primary" icon="el-icon-plus" @click="confirmprice()">
</el-button>
</div> </div>
<div class="JNPF-common-head-right"> <div class="JNPF-common-head-right">
<el-tooltip effect="dark" content="刷新" placement="top"> <el-tooltip effect="dark" content="刷新" placement="top">
@ -36,8 +38,6 @@
</div> </div>
</div> </div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange"> <JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
<el-table-column prop="businessDate" label="业务日期" width="0" align="left"
/>
<el-table-column prop="documentNo" label="单据编号" width="0" align="left" <el-table-column prop="documentNo" label="单据编号" width="0" align="left"
/> />
<el-table-column prop="customerName" label="客户名称" width="0" align="left" <el-table-column prop="customerName" label="客户名称" width="0" align="left"
@ -82,7 +82,7 @@ width="150" >
</el-button> </el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)"> <el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button> </el-button>
<el-button type="text" <el-button type="text"
@click="goDetail(scope.row.id)">详情 @click="goDetail(scope.row.id)">详情
</el-button> </el-button>
</template> </template>
@ -130,7 +130,6 @@ width="150" >
formVisible: false, formVisible: false,
exportBoxVisible: false, exportBoxVisible: false,
columnList: [ columnList: [
{prop: 'businessDate', label: '业务日期'},
{prop: 'documentNo', label: '单据编号'}, {prop: 'documentNo', label: '单据编号'},
{prop: 'customerName', label: '客户名称'}, {prop: 'customerName', label: '客户名称'},
{prop: 'currency', label: '币别 '}, {prop: 'currency', label: '币别 '},
@ -144,10 +143,10 @@ width="150" >
], ],
paymentTypeOptions:[{"fullName":"货款","id":"0"},{"fullName":"运费","id":"1"},{"fullName":"仓储","id":"2"}], paymentTypeOptions:[{"fullName":"货款","id":"0"},{"fullName":"运费","id":"1"},{"fullName":"仓储","id":"2"}],
paymentTypeProps:{"label":"fullName","value":"id"}, paymentTypeProps:{"label":"fullName","value":"id"},
settlementTypeOptions:[{"fullName":"现金","id":"0"},{"fullName":"赊购","id":"1"},{"fullName":"网银","id":"2"},{"fullName":"银企直连","id":"3"},{"fullName":"银票","id":"4"},{"fullName":"商票","id":"5"}],
settlementTypeProps:{"label":"fullName","value":"id"},
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}], currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
currencyProps:{"label":"fullName","value":"id"}, currencyProps:{"label":"fullName","value":"id"},
settlementTypeOptions:[{"fullName":"现金","id":"0"},{"fullName":"赊购","id":"1"},{"fullName":"网银","id":"2"},{"fullName":"银企直连","id":"3"},{"fullName":"银票","id":"4"},{"fullName":"商票","id":"5"}],
settlementTypeProps:{"label":"fullName","value":"id"},
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"},{"fullName":"已付款","id":"3"}], statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"},{"fullName":"已付款","id":"3"}],
statusProps:{"label":"fullName","value":"id"}, statusProps:{"label":"fullName","value":"id"},
} }
@ -246,6 +245,35 @@ width="150" >
}).catch(() => { }).catch(() => {
}) })
}, },
confirmprice(){
if (!this.multipleSelection.length) {
this.$message({
type: 'error',
message: '请选择一条数据',
duration: 1500,
})
return
}
let id = this.multipleSelection.join()
let param = {};
param = this.list.find(function(param) {
debugger
return param.id == id;
})
request({
url: `/api/collection/Collection/confirmprice`,
method: 'POST',
data: param
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
},
addOrUpdateHandle(id, isDetail) { addOrUpdateHandle(id, isDetail) {
this.formVisible = true this.formVisible = true
this.$nextTick(() => { this.$nextTick(() => {

@ -150,7 +150,7 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="金额" prop="amount"> <el-form-item label="金额" prop="amount">
<el-input-number v-model="dataForm.amount" :min="0" label="请输入" :style='{"width":"100%"}'></el-input-number> <el-input v-model="dataForm.amount" placeholder="请输入" clearable :style='{"width":"100%"}'></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
@ -215,13 +215,13 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
--> -->
<el-col :span="24"> <!-- <el-col :span="24">-->
<el-form-item label="集团审批" prop="approval"> <!-- <el-form-item label="集团审批" prop="approval">-->
<el-switch v-model="dataForm.approval" :active-value="1" :inactive-value="0"> <!-- <el-switch v-model="dataForm.approval" :active-value="1" :inactive-value="0">-->
</el-switch> <!-- </el-switch>-->
</el-form-item> <!-- </el-form-item>-->
</el-col> <!-- </el-col>-->
<el-col :span="24"> <el-col :span="24">
<el-tabs v-model="activemdfrsi" tab-position="top" class="mb-20"> <el-tabs v-model="activemdfrsi" tab-position="top" class="mb-20">
<el-tab-pane label="物料明细"> <el-tab-pane label="物料明细">
@ -267,27 +267,29 @@
</el-table-column> </el-table-column>
<el-table-column prop="price" label="单价" align="center"> <el-table-column prop="price" label="单价" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number v-model="scope.row.price" :min="0" label="请输入" :style='{"width":"100%"}'></el-input-number> <el-input v-model="scope.row.price" placeholder="请输入" clearable :style='{"width":"100%"}'></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="amount" label="金额" align="center"> <el-table-column prop="amount" label="金额" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number v-model="scope.row.amount" :min="0" label="请输入" :style='{"width":"100%"}'></el-input-number> <el-input v-model="scope.row.amount" placeholder="请输入" clearable :style='{"width":"100%"}'></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="rate" label="税率 " align="center"> <el-table-column prop="rate" label="税率 " align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number v-model="scope.row.rate" :min="0" label="请输入" :style='{"width":"100%"}'></el-input-number> <el-select v-model="scope.row.rate" :min="0" label="请输入" :style='{"width":"100%"}'>
<el-option v-for="(item, index) in rateOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="notPrice" label="不含税单价" align="center"> <el-table-column prop="notPrice" label="不含税单价" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number v-model="scope.row.notPrice" :min="0" label="请输入" :style='{"width":"100%"}'></el-input-number> <el-input v-model="scope.row.notPrice" placeholder="请输入" clearable :style='{"width":"100%"}'></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="notAmount" label="不含税金额" align="center"> <el-table-column prop="notAmount" label="不含税金额" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number v-model="scope.row.notAmount" :min="0" label="请输入" :style='{"width":"100%"}'></el-input-number> <el-input v-model="scope.row.notAmount" placeholder="请输入" clearable :style='{"width":"100%"}'></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="备注" align="center"> <el-table-column prop="remark" label="备注" align="center">
@ -448,7 +450,13 @@
"id": "6" "id": "6"
} }
], ],
rateOptions:[
{"fullName":"13","id":"0"},
{"fullName":"9","id":"1"},
{"fullName":"6","id":"2"},
{"fullName":"5","id":"3"},
{"fullName":"3","id":"4"},
{"fullName":"0","id":"5"}],
} }
}, },
computed: {}, computed: {},

@ -25,12 +25,14 @@
<div class="JNPF-common-layout-main JNPF-flex-main"> <div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head"> <div class="JNPF-common-head">
<div> <div>
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()"> <!-- <el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">-->
</el-button> <!-- </el-button>-->
<!-- <el-button type="text" icon="=el-icon-detail" @click="goDetail(scope.row.id)">-->
<!-- </el-button>-->
<el-button type="text" icon="el-icon-download" @click="exportData()"> <el-button type="text" icon="el-icon-download" @click="exportData()">
</el-button> </el-button>
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()"> <!-- <el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">-->
</el-button> <!-- </el-button>-->
</div> </div>
<div class="JNPF-common-head-right"> <div class="JNPF-common-head-right">
<el-tooltip effect="dark" content="刷新" placement="top"> <el-tooltip effect="dark" content="刷新" placement="top">
@ -59,14 +61,26 @@
<el-table-column prop="remark" label="备注" width="0" align="left" /> <el-table-column prop="remark" label="备注" width="0" align="left" />
<el-table-column prop="creatorusername" label="录入人" width="0" align="left" /> <el-table-column prop="creatorusername" label="录入人" width="0" align="left" />
<el-table-column prop="status" label="合同状态" width="0" align="left" /> <el-table-column prop="status" label="合同状态" width="0" align="left" />
<el-table-column prop="approval" label="集团审批" width="0" align="left" />
<el-table-column prop="approval" label="集团审批" width="0" align="left" >
<template slot-scope="scope">
<el-tag type="danger" disable-transitions v-if="scope.row.approval == '关'">
</el-tag>
<el-tag type="success" disable-transitions v-else></el-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="150"> <el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)"> <el-button type="text" @click="exportData()">
</el-button> </el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)"> <!-- <el-button type="text" @click="addOrUpdateHandle(scope.row.id)">-->
</el-button> <!-- </el-button>-->
<el-button type="text" @click="goDetail(scope.row.id)"> <!-- <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> </el-button>
</template> </template>
</el-table-column> </el-table-column>

@ -19,15 +19,15 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="所属公司ID" <el-form-item label="公司名称"
prop="orgId" > prop="orgId" >
<p>{{dataForm.orgId}}</p> <p>{{dataForm.orgId}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="公司代码" <el-form-item label="联系人"
prop="orgName" > prop="contactName" >
<p>{{dataForm.orgName}}</p> <p>{{dataForm.contactName}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
@ -37,9 +37,9 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="联系人" <el-form-item label="电话"
prop="contactName" > prop="contactPhone" >
<p>{{dataForm.contactName}}</p> <p>{{dataForm.contactPhone}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
@ -48,12 +48,6 @@
<p>{{dataForm.address}}</p> <p>{{dataForm.address}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" >
<el-form-item label="电话"
prop="contactPhone" >
<p>{{dataForm.contactPhone}}</p>
</el-form-item>
</el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="是否启用" <el-form-item label="是否启用"
prop="status" > prop="status" >
@ -85,12 +79,11 @@
id :'', id :'',
supplierCd : '', supplierCd : '',
supplierNm : '', supplierNm : '',
orgId : '', orgId : [],
orgName : '',
customerLevel : "1",
contactName : '', contactName : '',
address : '', customerLevel : "1",
contactPhone : '', contactPhone : '',
address : '',
status : 1, status : 1,
}, },
customerLevelOptions:[{"fullName":"一级","id":"1"},{"fullName":"二级","id":"2"},{"fullName":"三级","id":"3"}], customerLevelOptions:[{"fullName":"一级","id":"1"},{"fullName":"二级","id":"2"},{"fullName":"三级","id":"3"}],

@ -1,235 +1,233 @@
<template> <template>
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body <el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1000px"> :close-on-click-modal="false" append-to-body
<el-row :gutter="15" class=""> :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" width="600px">
label-position="right"> <el-row :gutter="15" class="">
<template v-if="!loading"> <el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
<el-col :span="12"> <template v-if="!loading">
<el-form-item label="客户编码" prop="supplierCd"> <el-col :span="12" >
<el-input v-model="dataForm.supplierCd" placeholder="请输入客户编码" clearable <el-form-item label="客户编码"
:style='{"width":"100%"}'> prop="supplierCd" >
<el-input v-model="dataForm.supplierCd"
placeholder="请输入客户编码" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" >
<el-form-item label="客户名称" prop="supplierNm"> <el-form-item label="客户名称"
<el-input v-model="dataForm.supplierNm" placeholder="请输入客户名称" clearable prop="supplierNm" >
:style='{"width":"100%"}'> <el-input v-model="dataForm.supplierNm"
placeholder="请输入客户名称" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" >
<el-form-item label="所属公司ID" prop="orgId"> <el-form-item label="公司名称"
<el-input v-model="dataForm.orgId" placeholder="请输入所属公司ID" clearable prop="orgId" >
:style='{"width":"100%"}'> <com-select v-model="dataForm.orgId"
placeholder="请选择" clearable >
</el-input> </com-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" >
<el-form-item label="公司代码" prop="orgName"> <el-form-item label="联系人"
<el-input v-model="dataForm.orgName" placeholder="请输入公司代码" clearable prop="contactName" >
:style='{"width":"100%"}'> <el-input v-model="dataForm.contactName"
placeholder="请输入联系人" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" >
<el-form-item label="客户等级" prop="customerLevel"> <el-form-item label="客户等级"
<el-select v-model="dataForm.customerLevel" placeholder="请选择客户等级" :style='{"width":"100%"}'> prop="customerLevel" >
<el-option v-for="(item, index) in customerLevelOptions" :key="index" <el-select v-model="dataForm.customerLevel"
:label="item.fullName" :value="item.id" :disabled="item.disabled"></el-option> placeholder="请选择客户等级" :style='{"width":"100%"}'>
<el-option v-for="(item, index) in customerLevelOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" >
<el-form-item label="联系人" prop="contactName"> <el-form-item label="电话"
<el-input v-model="dataForm.contactName" placeholder="请输入联系人" clearable prop="contactPhone" >
:style='{"width":"100%"}'> <el-input v-model="dataForm.contactPhone"
placeholder="请输入电话" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" >
<el-form-item label="地址" prop="address"> <el-form-item label="地址"
<el-input v-model="dataForm.address" placeholder="请输入地址" clearable prop="address" >
:style='{"width":"100%"}'> <el-input v-model="dataForm.address"
placeholder="请输入地址" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" >
<el-form-item label="电话" prop="contactPhone"> <el-form-item label="是否启用"
<el-input v-model="dataForm.contactPhone" placeholder="请输入电话" clearable prop="status" >
:style='{"width":"100%"}'> <el-switch v-model="dataForm.status"
:active-value="1" :inactive-value="0" >
</el-input> </el-switch>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> </template>
<el-form-item label="是否启用" prop="status"> </el-form>
<el-switch v-model="dataForm.status" :active-value="1" :inactive-value="0"> </el-row>
<span slot="footer" class="dialog-footer">
</el-switch> <el-button @click="visible = false"> </el-button>
</el-form-item> <el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> </el-button>
</el-col> </span>
</template> </el-dialog>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> </el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import { import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
getDataInterfaceRes import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
} from '@/api/systemData/dataInterface' export default {
import { components: {},
getDictionaryDataSelector props: [],
} from '@/api/systemData/dictionary' data() {
export default { return {
components: {}, visible: false,
props: [], loading: false,
data() { isDetail: false,
return { dataForm: {
visible: false, supplierCd : '',
loading: false, supplierNm : '',
isDetail: false, orgId : [],
dataForm: { contactName : '',
supplierCd: '', customerLevel : "1",
supplierNm: '', contactPhone : '',
orgId: '', address : '',
orgName: '', status : 1,
customerLevel: "1", },
contactName: '', rules:
address: '', {
contactPhone: '', supplierCd: [
status: 1, {
}, required: true,
rules: { message: '请输入客户编码',
supplierCd: [{ trigger: 'blur'
required: true, },
message: '请输入客户编码', ],
trigger: 'blur' supplierNm: [
}, ], {
supplierNm: [{ required: true,
required: true, message: '请输入客户名称',
message: '请输入客户名称', trigger: 'blur'
trigger: 'blur' },
}, ], ],
contactPhone: [], contactPhone: [
}, ],
customerLevelOptions: [{ },
"fullName": "一级", customerLevelOptions:[{"fullName":"一级","id":"1"},{"fullName":"二级","id":"2"},{"fullName":"三级","id":"3"}],
"id": "1"
}, { }
"fullName": "二级", },
"id": "2" computed: {},
}, { watch: {},
"fullName": "三级", created() {
"id": "3" },
}], mounted() {},
methods: {
clearData(data){
for (let key in data) {
if (data[key] instanceof Array) {
data[key] = [];
} else if (data[key] instanceof Object) {
this.clearData(data[key]);
} else {
data[key] = "";
}
}
},
init(id, isDetail) {
this.dataForm.id = id || 0;
this.visible = true;
this.isDetail = isDetail || false;
this.$nextTick(() => {
this.$refs['elForm'].resetFields();
if(this.dataForm.id){
this.loading = true
request({
url: '/api/customer/Customer/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
}else{
this.clearData(this.dataForm)
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
dataFormSubmit() {
this.$refs['elForm'].validate((valid) => {
if (valid) {
this.request()
}
})
},
request() {
var _data =this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/customer/Customer',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}else{
request({
url: '/api/customer/Customer/'+this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}
},
dataList(){
var _data = JSON.parse(JSON.stringify(this.dataForm));
_data.orgId = JSON.stringify(_data.orgId)
_data.status = parseInt(_data.status)
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
_dataAll.orgId = JSON.parse( _dataAll.orgId)
_dataAll.status = parseInt( _dataAll.status)
this.dataForm = _dataAll
},
},
}
}
},
computed: {},
watch: {},
created() {},
mounted() {},
methods: {
clearData(data) {
for (let key in data) {
if (data[key] instanceof Array) {
data[key] = [];
} else if (data[key] instanceof Object) {
this.clearData(data[key]);
} else {
data[key] = "";
}
}
},
init(id, isDetail) {
this.dataForm.id = id || 0;
this.visible = true;
this.isDetail = isDetail || false;
this.$nextTick(() => {
this.$refs['elForm'].resetFields();
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/customer/Customer/' + this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
} else {
this.clearData(this.dataForm)
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
dataFormSubmit() {
this.$refs['elForm'].validate((valid) => {
if (valid) {
this.request()
}
})
},
request() {
var _data = this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/customer/Customer',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
} else {
request({
url: '/api/customer/Customer/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}
},
dataList() {
var _data = JSON.parse(JSON.stringify(this.dataForm));
_data.status = parseInt(_data.status)
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
_dataAll.status = parseInt(_dataAll.status)
this.dataForm = _dataAll
},
},
}
</script> </script>

@ -1,321 +1,279 @@
<template> <template>
<div class="JNPF-common-layout"> <div class="JNPF-common-layout">
<div class="JNPF-common-layout-center"> <div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16"> <el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent> <el-form @submit.native.prevent>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="客户编码"> <el-form-item label="客户编码">
<el-input v-model="query.supplierCd" placeholder="请输入" clearable> </el-input> <el-input v-model="query.supplierCd" placeholder="请输入" clearable> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="客户名称"> <el-form-item label="客户名称">
<el-input v-model="query.supplierNm" placeholder="请输入" clearable> </el-input> <el-input v-model="query.supplierNm" placeholder="请输入" clearable> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button> <el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button> <el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
</el-row> </el-row>
<div class="JNPF-common-layout-main JNPF-flex-main"> <div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head"> <div class="JNPF-common-head">
<div> <div>
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()"> <el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">
</el-button> </el-button>
<el-button type="text" icon="el-icon-download" @click="exportData()"> <el-button type="text" icon="el-icon-download" @click="exportData()" >导出
</el-button> </el-button>
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()"> <el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
</el-button> </el-button>
</div> </div>
<div class="JNPF-common-head-right"> <div class="JNPF-common-head-right">
<el-tooltip effect="dark" content="刷新" placement="top"> <el-tooltip effect="dark" content="刷新" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" <el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
@click="reset()" /> @click="reset()"/>
</el-tooltip> </el-tooltip>
<screenfull isContainer /> <screenfull isContainer/>
</div> </div>
</div> </div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c <JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
@selection-change="handleSelectionChange"> <el-table-column prop="supplierCd" label="客户编码" width="0" align="left"
<el-table-column prop="supplierCd" label="客户编码" width="0" align="left" sortable="custom" /> sortable="custom" />
<el-table-column prop="supplierNm" label="客户名称" width="0" align="left" sortable="custom" /> <el-table-column prop="supplierNm" label="客户名称" width="0" align="left"
<el-table-column prop="orgId" label="所属公司ID" width="0" align="left" sortable="custom" /> sortable="custom" />
<el-table-column prop="orgName" label="公司代码" width="0" align="left" sortable="custom" /> <el-table-column prop="orgId" label="公司名称" width="0" align="left"
<el-table-column label="客户等级" width="0" prop="customerLevel" algin="left" sortable="custom"> sortable="custom" />
<template slot-scope="scope"> <el-table-column label="客户等级" width="0" prop="customerLevel" algin="left"
{{ scope.row.customerLevel | dynamicText(customerLevelOptions) }} sortable="custom" >
</template> <template slot-scope="scope">
</el-table-column> {{ scope.row.customerLevel | dynamicText(customerLevelOptions) }}
<el-table-column prop="contactName" label="联系人" width="0" align="left" sortable="custom" /> </template>
<el-table-column prop="address" label="地址" width="0" align="left" sortable="custom" /> </el-table-column>
<el-table-column prop="contactPhone" label="电话" width="0" align="left" sortable="custom" /> <el-table-column prop="contactName" label="联系人" width="0" align="left"
<el-table-column prop="status" label="是否启用" width="0" align="left" /> sortable="custom" />
<el-table-column label="操作" fixed="right" width="150"> <el-table-column prop="contactPhone" label="电话" width="0" align="left"
<template slot-scope="scope"> sortable="custom" />
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)"> <el-table-column prop="address" label="地址" width="0" align="left"
</el-button> sortable="custom" />
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)"> <el-table-column prop="status" label="是否启用" width="0" align="left" sortable="custom" >
</el-button> <template slot-scope="scope">
<el-button type="text" @click="goDetail(scope.row.id)"> <el-tag type="success" disable-transitions v-if="scope.row.status == '1'">
</el-button> </el-tag>
</template> <el-tag type="danger" disable-transitions v-else></el-tag>
</el-table-column> </template>
</JNPF-table> </el-table-column>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" <el-table-column label="操作" fixed="right"
@pagination="initData" /> width="150" >
</div> <template slot-scope="scope">
</div> <el-button type="text"
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" /> @click="addOrUpdateHandle(scope.row.id)" >编辑
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" /> </el-button>
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" /> <el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</div> </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"/>
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
</div>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import { import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
getDictionaryDataSelector import JNPFForm from './Form'
} from '@/api/systemData/dictionary' import ExportBox from './ExportBox'
import JNPFForm from './Form' import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
import ExportBox from './ExportBox' import Detail from './Detail'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import Detail from './Detail'
export default { export default {
components: { components: {JNPFForm, ExportBox,Detail},
JNPFForm, data() {
ExportBox, return {
Detail detailVisible: false,
}, query: {
data() { supplierCd:undefined,
return { supplierNm:undefined,
detailVisible: false, },
query: { treeProps: {
supplierCd: undefined, children: 'children',
supplierNm: undefined, label: 'fullName',
}, value: 'id'
treeProps: { },
children: 'children', list: [],
label: 'fullName', listLoading: true,
value: 'id' multipleSelection: [], total: 0,
}, listQuery: {
list: [], currentPage: 1,
listLoading: true, pageSize: 20,
multipleSelection: [], sort: "desc",
total: 0, sidx: "supplierCd",
listQuery: { },
currentPage: 1, formVisible: false,
pageSize: 20, exportBoxVisible: false,
sort: "desc", columnList: [
sidx: "supplierCd", {prop: 'supplierCd', label: '客户编码'},
}, {prop: 'supplierNm', label: '客户名称'},
formVisible: false, {prop: 'orgId', label: '公司名称'},
exportBoxVisible: false, {prop: 'customerLevel', label: '客户等级'},
columnList: [{ {prop: 'contactName', label: '联系人'},
prop: 'supplierCd', {prop: 'contactPhone', label: '电话'},
label: '客户编码' {prop: 'address', label: '地址'},
}, {prop: 'status', label: '是否启用'},
{ ],
prop: 'supplierNm', customerLevelOptions:[{"fullName":"一级","id":"1"},{"fullName":"二级","id":"2"},{"fullName":"三级","id":"3"}],
label: '客户名称' customerLevelProps:{"label":"fullName","value":"id"},
}, }
{ },
prop: 'orgId', computed: {
label: '所属公司ID' menuId() {
}, return this.$route.meta.modelId || ''
{ }
prop: 'orgName', },
label: '公司代码' created() {
}, this.initData()
{ },
prop: 'customerLevel', methods: {
label: '客户等级' goDetail(id){
}, this.detailVisible = true
{ this.$nextTick(() => {
prop: 'contactName', this.$refs.Detail.init(id)
label: '联系人' })
}, },
{ sortChange({column, prop, order}) {
prop: 'address', this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
label: '地址' this.listQuery.sidx = !order ? '' : prop
}, this.initData()
{ },
prop: 'contactPhone', initData() {
label: '电话' this.listLoading = true;
}, let _query = {
{ ...this.listQuery,
prop: 'status', ...this.query,
label: '是否启用' menuId:this.menuId
}, };
], request({
customerLevelOptions: [{ url: `/api/customer/Customer/getList`,
"fullName": "一级", method: 'post',
"id": "1" data: _query
}, { }).then(res => {
"fullName": "二级", var _list =[];
"id": "2" for(let i=0;i<res.data.list.length;i++){
}, { let _data = res.data.list[i];
"fullName": "三级", _list.push(_data)
"id": "3" }
}], this.list = _list
customerLevelProps: { this.total = res.data.pagination.total
"label": "fullName",
"value": "id"
},
}
},
computed: {
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
this.initData()
},
methods: {
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()
},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
menuId: this.menuId
};
request({
url: `/api/customer/Customer/getList`,
method: 'post',
data: _query
}).then(res => {
var _list = [];
for (let i = 0; i < res.data.list.length; i++) {
let _data = res.data.list[i];
_list.push(_data)
}
this.list = _list
this.total = res.data.pagination.total
this.listLoading = false this.listLoading = false
}) })
}, },
handleDel(id) { handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
request({ request({
url: `/api/customer/Customer/${id}`, url: `/api/customer/Customer/${id}`,
method: 'DELETE' method: 'DELETE'
}).then(res => { }).then(res => {
this.$message({ this.$message({
type: 'success', type: 'success',
message: res.msg, message: res.msg,
onClose: () => { onClose: () => {
this.initData() this.initData()
} }
}); });
}) })
}).catch(() => {}); }).catch(() => {
}, });
handleSelectionChange(val) { },
const res = val.map(item => item.id) handleSelectionChange(val) {
this.multipleSelection = res const res = val.map(item => item.id)
}, this.multipleSelection = res
handleBatchRemoveDel() { },
if (!this.multipleSelection.length) { handleBatchRemoveDel() {
this.$message({ if (!this.multipleSelection.length) {
type: 'error', this.$message({
message: '请选择一条数据', type: 'error',
duration: 1500, message: '请选择一条数据',
}) duration: 1500,
return })
} return
const ids = this.multipleSelection.join() }
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', { const ids = this.multipleSelection.join()
type: 'warning' this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
}).then(() => { type: 'warning'
request({ }).then(() => {
url: `/api/customer/Customer/batchRemove/${ids}`, request({
method: 'DELETE' url: `/api/customer/Customer/batchRemove/${ids}`,
}).then(res => { method: 'DELETE'
this.$message({ }).then(res => {
type: 'success', this.$message({
message: res.msg, type: 'success',
onClose: () => { message: res.msg,
this.initData() onClose: () => {
} this.initData()
}); }
}) });
}).catch(() => {}) })
}, }).catch(() => {
addOrUpdateHandle(id, isDetail) { })
this.formVisible = true },
this.$nextTick(() => { addOrUpdateHandle(id, isDetail) {
this.$refs.JNPFForm.init(id, isDetail) this.formVisible = true
}) this.$nextTick(() => {
}, this.$refs.JNPFForm.init(id, isDetail)
exportData() { })
this.exportBoxVisible = true },
this.$nextTick(() => { exportData() {
this.$refs.ExportBox.init(this.columnList) this.exportBoxVisible = true
}) this.$nextTick(() => {
}, this.$refs.ExportBox.init(this.columnList)
download(data) { })
let query = { },
...data, download(data) {
...this.listQuery, let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
...this.query, request({
menuId: this.menuId url: `/api/customer/Customer/Actions/Export`,
} method: 'GET',
request({ data: query
url: `/api/customer/Customer/Actions/Export`, }).then(res => {
method: 'GET', if (!res.data.url) return
data: query this.jnpf.downloadFile(res.data.url)
}).then(res => { this.$refs.ExportBox.visible = false
if (!res.data.url) return this.exportBoxVisible = false
this.jnpf.downloadFile(res.data.url) })
this.$refs.ExportBox.visible = false },
this.exportBoxVisible = false search() {
}) this.listQuery = {
}, currentPage: 1,
search() { pageSize: 20,
this.listQuery = { sort: "desc",
currentPage: 1, sidx: "supplierCd",
pageSize: 20, }
sort: "desc", this.initData()
sidx: "supplierCd", },
} refresh(isrRefresh) {
this.initData() this.formVisible = false
}, if (isrRefresh) this.reset()
refresh(isrRefresh) { },
this.formVisible = false reset() {
if (isrRefresh) this.reset() for (let key in this.query) {
}, this.query[key] = undefined
reset() { }
for (let key in this.query) { this.search()
this.query[key] = undefined }
} }
this.search() }
}
}
}
</script> </script>

@ -7,7 +7,7 @@
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" > <el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
<template v-if="!loading"> <template v-if="!loading">
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="物料编码" <el-form-item label="物料编码"
prop="itemCode" > prop="itemCode" >
<el-input v-model="dataForm.itemCode" <el-input v-model="dataForm.itemCode"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
@ -16,7 +16,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="物料名称" <el-form-item label="物料名称"
prop="itemName" > prop="itemName" >
<el-input v-model="dataForm.itemName" <el-input v-model="dataForm.itemName"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
@ -25,7 +25,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="物料说明" <el-form-item label="物料说明"
prop="description" > prop="description" >
<el-input v-model="dataForm.description" <el-input v-model="dataForm.description"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
@ -34,7 +34,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="主单位名称" <el-form-item label="主单位名称"
prop="primaryUnitOmeasure" > prop="primaryUnitOmeasure" >
<el-select v-model="dataForm.primaryUnitOmeasure" <el-select v-model="dataForm.primaryUnitOmeasure"
placeholder="请选择单位名称" clearable :style='{"width":"100%"}'> placeholder="请选择单位名称" clearable :style='{"width":"100%"}'>
@ -44,7 +44,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="是否可采购" <el-form-item label="是否可采购"
prop="purchaseFlag" > prop="purchaseFlag" >
<el-select v-model="dataForm.purchaseFlag" <el-select v-model="dataForm.purchaseFlag"
placeholder="请选择" clearable :style='{"width":"100%"}'> placeholder="请选择" clearable :style='{"width":"100%"}'>
@ -54,7 +54,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="是否可销售 " <el-form-item label="是否可销售 "
prop="salesFlag" > prop="salesFlag" >
<el-select v-model="dataForm.salesFlag" <el-select v-model="dataForm.salesFlag"
placeholder="请选择" clearable :style='{"width":"100%"}'> placeholder="请选择" clearable :style='{"width":"100%"}'>
@ -64,7 +64,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="默认出库区" <el-form-item label="默认出库区"
prop="outArea" > prop="outArea" >
<popupSelect v-model="dataForm.outArea" <popupSelect v-model="dataForm.outArea"
placeholder="请选择" clearable field="outArea" interfaceId="381404161809350213" :columnOptions="outAreacolumnOptions" propsValue="id" relationField="areaname" popupType="dialog" placeholder="请选择" clearable field="outArea" interfaceId="381404161809350213" :columnOptions="outAreacolumnOptions" propsValue="id" relationField="areaname" popupType="dialog"
@ -75,7 +75,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="默认入库区" <el-form-item label="默认入库区"
prop="inArea" > prop="inArea" >
<popupSelect v-model="dataForm.inArea" <popupSelect v-model="dataForm.inArea"
placeholder="请选择" clearable field="inArea" interfaceId="381404161809350213" :columnOptions="inAreacolumnOptions" propsValue="id" relationField="areaname" popupType="dialog" placeholder="请选择" clearable field="inArea" interfaceId="381404161809350213" :columnOptions="inAreacolumnOptions" propsValue="id" relationField="areaname" popupType="dialog"
@ -86,7 +86,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="标准成本" <el-form-item label="标准成本"
prop="standardCost" > prop="standardCost" >
<el-input v-model="dataForm.standardCost" <el-input v-model="dataForm.standardCost"
placeholder="请输入标准成本" clearable :style='{"width":"100%"}'> placeholder="请输入标准成本" clearable :style='{"width":"100%"}'>
@ -95,7 +95,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="财务类别" <el-form-item label="财务类别"
prop="financial" > prop="financial" >
<el-input v-model="dataForm.financial" <el-input v-model="dataForm.financial"
placeholder="请输入财务类别" clearable :style='{"width":"100%"}'> placeholder="请输入财务类别" clearable :style='{"width":"100%"}'>
@ -104,7 +104,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="类别名称" <el-form-item label="类别名称"
prop="financialName" > prop="financialName" >
<el-input v-model="dataForm.financialName" <el-input v-model="dataForm.financialName"
placeholder="请输入类别名称" clearable :style='{"width":"100%"}'> placeholder="请输入类别名称" clearable :style='{"width":"100%"}'>
@ -113,7 +113,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="生效状态" <el-form-item label="生效状态"
prop="effectiveStatus" > prop="effectiveStatus" >
<el-select v-model="dataForm.effectiveStatus" <el-select v-model="dataForm.effectiveStatus"
placeholder="请选择" clearable :style='{"width":"100%"}'> placeholder="请选择" clearable :style='{"width":"100%"}'>

@ -2,70 +2,171 @@
<el-dialog title="详情" <el-dialog title="详情"
:close-on-click-modal="false" append-to-body :close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px"> width="1000px">
<el-row :gutter="15" class=""> <el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" > <el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading"> <template v-if="!loading">
<el-col :span="12" > <el-col :span="8" >
<el-form-item label="业务日期"
prop="businessdate" >
<p>{{jnpf.dateFormat(dataForm.businessdate)}}</p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="单据编号" <el-form-item label="单据编号"
prop="documentno" > prop="documentno" >
<p>{{dataForm.documentno}}</p> <p>{{dataForm.documentno}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="8" >
<el-form-item label="客户" <el-form-item label="供应商"
prop="suppliername" > prop="suppliername" >
<p>{{dataForm.suppliername}}</p> <p>{{dataForm.suppliername}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="8" >
<el-form-item label="币别" <el-form-item label="付款类型"
prop="currency" > prop="paymenttype" >
<p>{{ dataForm.currency | dynamicText(currencyOptions) }} </p> <p>{{ dataForm.paymenttype | dynamicText(paymenttypeOptions) }} </p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="付款金额"
prop="paymentamount" >
<p>{{dataForm.paymentamount}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="8" >
<el-form-item label="付款账户" <el-form-item label="付款账户"
prop="paymentaccount" > prop="paymentaccount" >
<p>{{dataForm.paymentaccount}}</p> <p>{{dataForm.paymentaccount}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="8" >
<el-form-item label="付款银行" <el-form-item label="付款银行"
prop="paymentbank" > prop="paymentbank" >
<p>{{dataForm.paymentbank}}</p> <p>{{dataForm.paymentbank}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="8" >
<el-form-item label="付款类型" <el-form-item label="付款金额"
prop="paymenttype" > prop="paymentamount" >
<p>{{ dataForm.paymenttype | dynamicText(paymenttypeOptions) }} </p> <p>{{dataForm.paymentamount}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="收款账户"
prop="collectionaccount" >
<p>{{dataForm.collectionaccount}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="8" >
<el-form-item label="收款银行"
prop="collectionbank" >
<p>{{dataForm.collectionbank}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="申请金额"
prop="requestedamount" >
<p>{{dataForm.requestedamount}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="应付日期"
prop="duedate" >
<p>{{jnpf.dateFormat(dataForm.duedate)}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="币别 "
prop="currency" >
<p>{{ dataForm.currency | dynamicText(currencyOptions) }} </p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="结算类型" <el-form-item label="结算类型"
prop="settlementtype" > prop="settlementtype" >
<p>{{ dataForm.settlementtype | dynamicText(settlementtypeOptions) }} </p> <p>{{ dataForm.settlementtype | dynamicText(settlementtypeOptions) }} </p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="8" >
<el-form-item label="来源单号"
prop="paymentno" >
<p>{{dataForm.paymentno}}</p>
</el-form-item>
</el-col>
<el-col :span="16" >
<el-form-item label="备注"
prop="remark" >
<p>{{dataForm.remark}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="单据状态" <el-form-item label="单据状态"
prop="status" > prop="status" >
<p>{{ dataForm.status | dynamicText(statusOptions) }} </p> <p>{{ dataForm.status | dynamicText(statusOptions) }} </p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24">
<el-tabs v-model="activeivpzpd" tab-position="top" class="mb-20">
<el-tab-pane label="Tab 1">
<el-col :span="24" >
<el-form-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.payment_item0List" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="amount" label="付款金额">
<template slot-scope="scope">
<p>{{scope.row.amount}}</p>
</template>
</el-table-column>
<el-table-column prop="creatorUserId" label="申请金额">
<template slot-scope="scope">
<p>{{scope.row.creatorUserId}}</p>
</template>
</el-table-column>
<el-table-column prop="creatorUserName" label="订单金额">
<template slot-scope="scope">
<p>{{scope.row.creatorUserName}}</p>
</template>
</el-table-column>
<el-table-column prop="lastModifyUserId" label="已付金额">
<template slot-scope="scope">
<p>{{scope.row.lastModifyUserId}}</p>
</template>
</el-table-column>
<el-table-column prop="lastModifyUserName" label="订单编号">
<template slot-scope="scope">
<p>{{scope.row.lastModifyUserName}}</p>
</template>
</el-table-column>
<el-table-column prop="lastModifyTime" label="合同编码">
<template slot-scope="scope">
<p>{{scope.row.lastModifyTime}}</p>
</template>
</el-table-column>
<el-table-column prop="deleteUserId" label="重量">
<template slot-scope="scope">
<p>{{scope.row.deleteUserId}}</p>
</template>
</el-table-column>
<el-table-column prop="deleteTime" label="垫资金额">
<template slot-scope="scope">
<p>{{scope.row.deleteTime}}</p>
</template>
</el-table-column>
<el-table-column prop="orgnizeId" label="税额">
<template slot-scope="scope">
<p>{{scope.row.orgnizeId}}</p>
</template>
</el-table-column>
<el-table-column prop="departmentId" label="不含税金额">
<template slot-scope="scope">
<p>{{scope.row.departmentId}}</p>
</template>
</el-table-column>
<el-table-column prop="creatorTime" label="业务日期">
<template slot-scope="scope">
<p>{{jnpf.dateFormat(scope.row.creatorTime)}}</p>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-col>
</el-tab-pane >
</el-tabs>
</el-col>
</template> </template>
</el-form> </el-form>
</el-row> </el-row>
@ -89,27 +190,26 @@
printId: '', printId: '',
dataForm: { dataForm: {
id :'', id :'',
businessdate : '',
documentno : '', documentno : '',
suppliername : '', suppliername : '',
currency : "0", paymenttype : "0",
paymentamount : '',
paymentaccount : '', paymentaccount : '',
paymentbank : '', paymentbank : '',
paymenttype : "", paymentamount : '',
settlementtype : "", collectionaccount : '',
status : "", collectionbank : '',
creatorUserId : "", requestedamount : '',
creatorUserName : "", duedate : '',
creatorTime : "", currency : "0",
lastModifyUserId : "", settlementtype : "0",
lastModifyUserName : "", paymentno : '',
lastModifyTime : "", remark : '',
departmentId : "", status : "0",
orgnizeId : "", payment_item0List:[],
}, },
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}], activeivpzpd:'0',
paymenttypeOptions:[{"fullName":"贷款","id":"0"},{"fullName":"运费","id":"1"},{"fullName":"仓储","id":"2"}], paymenttypeOptions:[{"fullName":"贷款","id":"0"},{"fullName":"运费","id":"1"},{"fullName":"仓储","id":"2"}],
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
settlementtypeOptions:[{"fullName":"现金","id":"0"},{"fullName":"赊购","id":"1"},{"fullName":"网银","id":"2"},{"fullName":"银企直连","id":"3"},{"fullName":"银票","id":"4"},{"fullName":"商票","id":"5"}], settlementtypeOptions:[{"fullName":"现金","id":"0"},{"fullName":"赊购","id":"1"},{"fullName":"网银","id":"2"},{"fullName":"银企直连","id":"3"},{"fullName":"银票","id":"4"},{"fullName":"商票","id":"5"}],
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"},{"fullName":"已付款","id":"3"}], statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"},{"fullName":"已付款","id":"3"}],
@ -124,6 +224,10 @@
methods: { methods: {
dataInfo(dataAll){ dataInfo(dataAll){
let _dataAll =dataAll let _dataAll =dataAll
for(let i=0;i<_dataAll.payment_item0List.length;i++){
var _list = _dataAll.payment_item0List[i];
_list.creatorTime = _list.creatorTime ? jnpf.dateFormat(_list.creatorTime) : ''
}
this.dataForm = _dataAll this.dataForm = _dataAll
}, },
@ -134,7 +238,7 @@
if(this.dataForm.id){ if(this.dataForm.id){
this.loading = true this.loading = true
request({ request({
url: '/api/example/Payment/detail/'+this.dataForm.id, url: '/api/payment/Payment/detail/'+this.dataForm.id,
method: 'get' method: 'get'
}).then(res => { }).then(res => {
this.dataInfo(res.data) this.dataInfo(res.data)

@ -2,49 +2,58 @@
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" <el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
:close-on-click-modal="false" append-to-body :close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px"> width="1000px">
<el-row :gutter="15" class=""> <el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" > <el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
<template v-if="!loading"> <template v-if="!loading">
<el-col :span="12" > <el-col :span="8" >
<el-form-item label="业务日期" <el-form-item label="单据编号"
prop="businessdate" >
<el-date-picker v-model="dataForm.businessdate"
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" >
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="单据编号"
prop="documentno" > prop="documentno" >
<el-input v-model="dataForm.documentno" <el-input v-model="dataForm.documentno"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="系统自动生成" readonly >
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="8" >
<el-form-item label="客户" <el-form-item label="供应商"
prop="suppliername" > prop="suppliername" >
<el-input v-model="dataForm.suppliername" <el-input v-model="dataForm.suppliername"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入付款账户" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="8" >
<el-form-item label="币别" <el-form-item label="付款类型"
prop="currency" > prop="paymenttype" >
<el-select v-model="dataForm.currency" <el-select v-model="dataForm.paymenttype"
placeholder="请选择" :style='{"width":"100%"}'> placeholder="请选择付款类型" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> <el-option v-for="(item, index) in paymenttypeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="8" >
<el-form-item label="付款金额" <el-form-item label="付款账户"
prop="paymentaccount" >
<el-input v-model="dataForm.paymentaccount"
placeholder="请输入付款账户" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="付款银行"
prop="paymentbank" >
<el-input v-model="dataForm.paymentbank"
placeholder="请输入付款银行" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="付款金额"
prop="paymentamount" > prop="paymentamount" >
<el-input v-model="dataForm.paymentamount" <el-input v-model="dataForm.paymentamount"
placeholder="请输入付款金额" clearable :style='{"width":"100%"}'> placeholder="请输入付款金额" clearable :style='{"width":"100%"}'>
@ -52,36 +61,54 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="8" >
<el-form-item label="付款账户" <el-form-item label="收款账户"
prop="paymentaccount" > prop="collectionaccount" >
<el-input v-model="dataForm.paymentaccount" <el-input v-model="dataForm.collectionaccount"
placeholder="请输入付款账户" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="8" >
<el-form-item label="付款银行" <el-form-item label="收款银行"
prop="paymentbank" > prop="collectionbank" >
<el-input v-model="dataForm.paymentbank" <el-input v-model="dataForm.collectionbank"
placeholder="请输入付款银行" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="8" >
<el-form-item label="付款类型" <el-form-item label="申请金额"
prop="paymenttype" > prop="requestedamount" >
<el-select v-model="dataForm.paymenttype" <el-input v-model="dataForm.requestedamount"
placeholder="请选择付款类型" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in paymenttypeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="应付日期"
prop="duedate" >
<el-date-picker v-model="dataForm.duedate"
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" >
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="币别 "
prop="currency" >
<el-select v-model="dataForm.currency"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="8" >
<el-form-item label="结算类型" <el-form-item label="结算类型"
prop="settlementtype" > prop="settlementtype" >
<el-select v-model="dataForm.settlementtype" <el-select v-model="dataForm.settlementtype"
placeholder="请选择" clearable :style='{"width":"100%"}'> placeholder="请选择" clearable :style='{"width":"100%"}'>
@ -90,16 +117,135 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="8" >
<el-form-item label="单据状态" <el-form-item label="来源单号"
prop="paymentno" >
<el-input v-model="dataForm.paymentno"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="16" >
<el-form-item label="备注"
prop="remark" >
<el-input v-model="dataForm.remark"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="单据状态"
prop="status" > prop="status" >
<el-select v-model="dataForm.status" <el-select v-model="dataForm.status"
placeholder="请选择单据状态" clearable :style='{"width":"100%"}'> placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> <el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24">
<el-tabs v-model="activeivpzpd" tab-position="top" class="mb-20">
<el-tab-pane label="申请明细">
<el-col :span="24" >
<el-form-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.payment_item0List" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="amount" label="付款金额">
<template slot-scope="scope">
<el-input v-model="scope.row.amount"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<!-- <el-table-column prop="creatorUserId" label="申请金额">-->
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.creatorUserId"-->
<!-- placeholder="请输入" clearable :style='{"width":"100%"}'>-->
<!-- </el-input>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="creatorUserName" label="订单金额">-->
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.creatorUserName"-->
<!-- placeholder="请输入" clearable :style='{"width":"100%"}'>-->
<!-- </el-input>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column prop="lastModifyUserId" label="已付金额">
<template slot-scope="scope">
<el-input v-model="scope.row.payPrice"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="lastModifyUserName" label="订单编号">
<template slot-scope="scope">
<el-input v-model="scope.row.documentNo"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="lastModifyTime" label="合同编码">
<template slot-scope="scope">
<el-input v-model="scope.row.contractCode"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="deleteUserId" label="重量">
<template slot-scope="scope">
<el-input v-model="scope.row.num"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="deleteTime" label="垫资金额">
<template slot-scope="scope">
<el-input v-model="scope.row.advanceAmount"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="orgnizeId" label="税额">
<template slot-scope="scope">
<el-input v-model="scope.row.rate"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="departmentId" label="不含税金额">
<template slot-scope="scope">
<el-input v-model="scope.row.notAmount"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="creatorTime" label="业务日期">
<template slot-scope="scope">
<el-date-picker v-model="scope.row.creatorTime"
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" >
</el-date-picker>
</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="delpayment_item0List(scope.$index)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addpayment_item0List()">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</el-form-item>
</el-col>
</el-tab-pane >
</el-tabs>
</el-col>
</template> </template>
</el-form> </el-form>
</el-row> </el-row>
@ -122,41 +268,45 @@
loading: false, loading: false,
isDetail: false, isDetail: false,
dataForm: { dataForm: {
businessdate : '',
documentno : '', documentno : '',
suppliername : '', suppliername : '',
currency : "0", paymenttype : "0",
paymentamount : '',
paymentaccount : '', paymentaccount : '',
paymentbank : '', paymentbank : '',
paymenttype : "", paymentamount : '',
settlementtype : "", collectionaccount : '',
status : "", collectionbank : '',
creatorUserId : "", requestedamount : '',
creatorUserName : "", duedate : '',
creatorTime : "", currency : "0",
lastModifyUserId : "", settlementtype : "0",
lastModifyUserName : "", paymentno : '',
lastModifyTime : "", remark : '',
departmentId : "", status : "0",
orgnizeId : "", payment_item0List:[],
}, },
activeivpzpd:'0',
rules: rules:
{ {
currency: [ suppliername: [
],
paymentaccount: [
],
paymentamount: [
{ {
required: true, required: true,
message: '请至少选择一个', message: '请输入付款金额',
trigger: 'change' trigger: 'blur'
}, },
], {
paymentamount: [ pattern: /^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0$/,
], message: '请输入正确的金额',
paymentaccount: [ trigger: 'blur'
},
], ],
}, },
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
paymenttypeOptions:[{"fullName":"贷款","id":"0"},{"fullName":"运费","id":"1"},{"fullName":"仓储","id":"2"}], paymenttypeOptions:[{"fullName":"贷款","id":"0"},{"fullName":"运费","id":"1"},{"fullName":"仓储","id":"2"}],
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
settlementtypeOptions:[{"fullName":"现金","id":"0"},{"fullName":"赊购","id":"1"},{"fullName":"网银","id":"2"},{"fullName":"银企直连","id":"3"},{"fullName":"银票","id":"4"},{"fullName":"商票","id":"5"}], settlementtypeOptions:[{"fullName":"现金","id":"0"},{"fullName":"赊购","id":"1"},{"fullName":"网银","id":"2"},{"fullName":"银企直连","id":"3"},{"fullName":"银票","id":"4"},{"fullName":"商票","id":"5"}],
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"},{"fullName":"已付款","id":"3"}], statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"},{"fullName":"已付款","id":"3"}],
@ -168,6 +318,13 @@
}, },
mounted() {}, mounted() {},
methods: { methods: {
payment_item0Exist() {
let isOk = true;
for(let i=0;i<this.dataForm.payment_item0List.length;i++){
const e = this.dataForm.payment_item0List[i];
}
return isOk;
},
clearData(data){ clearData(data){
for (let key in data) { for (let key in data) {
if (data[key] instanceof Array) { if (data[key] instanceof Array) {
@ -188,7 +345,7 @@
if(this.dataForm.id){ if(this.dataForm.id){
this.loading = true this.loading = true
request({ request({
url: '/api/example/Payment/'+this.dataForm.id, url: '/api/payment/Payment/'+this.dataForm.id,
method: 'get' method: 'get'
}).then(res => { }).then(res => {
this.dataInfo(res.data) this.dataInfo(res.data)
@ -204,6 +361,7 @@
dataFormSubmit() { dataFormSubmit() {
this.$refs['elForm'].validate((valid) => { this.$refs['elForm'].validate((valid) => {
if (valid) { if (valid) {
if (!this.payment_item0Exist()) return
this.request() this.request()
} }
}) })
@ -212,7 +370,7 @@
var _data =this.dataList() var _data =this.dataList()
if (!this.dataForm.id) { if (!this.dataForm.id) {
request({ request({
url: '/api/example/Payment', url: '/api/payment/Payment',
method: 'post', method: 'post',
data: _data data: _data
}).then((res) => { }).then((res) => {
@ -228,7 +386,7 @@
}) })
}else{ }else{
request({ request({
url: '/api/example/Payment/'+this.dataForm.id, url: '/api/payment/Payment/'+this.dataForm.id,
method: 'PUT', method: 'PUT',
data: _data data: _data
}).then((res) => { }).then((res) => {
@ -244,12 +402,37 @@
}) })
} }
}, },
addpayment_item0List(){
let item = {
amount:undefined,
creatorUserId:undefined,
creatorUserName:undefined,
lastModifyUserId:undefined,
lastModifyUserName:undefined,
lastModifyTime:undefined,
deleteUserId:undefined,
deleteTime:undefined,
orgnizeId:undefined,
departmentId:undefined,
creatorTime:undefined,
}
this.dataForm.payment_item0List.push(item)
},
delpayment_item0List(index) {
this.dataForm.payment_item0List.splice(index, 1);
},
dataList(){ dataList(){
var _data = JSON.parse(JSON.stringify(this.dataForm)); var _data = JSON.parse(JSON.stringify(this.dataForm));
for(let i=0;i<_data.payment_item0List.length;i++){
var _list = _data.payment_item0List[i];
}
return _data; return _data;
}, },
dataInfo(dataAll){ dataInfo(dataAll){
let _dataAll =dataAll let _dataAll =dataAll
for(let i=0;i<_dataAll.payment_item0List.length;i++){
var _list = _dataAll.payment_item0List[i];
}
this.dataForm = _dataAll this.dataForm = _dataAll
}, },
}, },

@ -9,11 +9,6 @@
<el-input v-model="query.documentno" placeholder="请输入" clearable> </el-input> <el-input v-model="query.documentno" placeholder="请输入" clearable> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-form-item label="客户">
<el-input v-model="query.suppliername" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button> <el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
@ -29,6 +24,10 @@
</el-button> </el-button>
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出 <el-button type="text" icon="el-icon-download" @click="exportData()" >导出
</el-button> </el-button>
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
</el-button>
<el-button type="primary" icon="el-icon-plus" @click="confirmprice()">
</el-button>
</div> </div>
<div class="JNPF-common-head-right"> <div class="JNPF-common-head-right">
<el-tooltip effect="dark" content="刷新" placement="top"> <el-tooltip effect="dark" content="刷新" placement="top">
@ -38,20 +37,22 @@
<screenfull isContainer/> <screenfull isContainer/>
</div> </div>
</div> </div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' > <JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
<el-table-column prop="businessdate" label="业务日期" width="0" align="left" <el-table-column prop="paymentno" label="来源单号" width="0" align="left"
sortable="custom" /> />
<el-table-column prop="documentno" label="单据编号" width="0" align="left" <el-table-column prop="documentno" label="单据编号" width="0" align="left"
/> />
<el-table-column prop="suppliername" label="客户" width="0" align="left" <el-table-column prop="suppliername" label="供应商" width="0" align="left"
/> />
<el-table-column label="币别" width="0" prop="currency" algin="left" <el-table-column label="币别 " width="0" prop="currency" algin="left"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.currency | dynamicText(currencyOptions) }} {{ scope.row.currency | dynamicText(currencyOptions) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="paymentamount" label="付款金额" width="0" align="left" <el-table-column prop="paymentamount" label="付款金额" width="0" align="left"
/>
<el-table-column prop="requestedamount" label="申请金额" width="0" align="left"
/> />
<el-table-column prop="paymentaccount" label="付款账户" width="0" align="left" <el-table-column prop="paymentaccount" label="付款账户" width="0" align="left"
/> />
@ -83,7 +84,7 @@ width="150" >
</el-button> </el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)"> <el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button> </el-button>
<el-button type="text" <el-button type="text"
@click="goDetail(scope.row.id)">详情 @click="goDetail(scope.row.id)">详情
</el-button> </el-button>
</template> </template>
@ -113,7 +114,6 @@ width="150" >
detailVisible: false, detailVisible: false,
query: { query: {
documentno:undefined, documentno:undefined,
suppliername:undefined,
}, },
treeProps: { treeProps: {
children: 'children', children: 'children',
@ -122,7 +122,7 @@ width="150" >
}, },
list: [], list: [],
listLoading: true, listLoading: true,
total: 0, multipleSelection: [], total: 0,
listQuery: { listQuery: {
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
@ -132,21 +132,22 @@ width="150" >
formVisible: false, formVisible: false,
exportBoxVisible: false, exportBoxVisible: false,
columnList: [ columnList: [
{prop: 'businessdate', label: '业务日期'}, {prop: 'paymentno', label: '来源单号'},
{prop: 'documentno', label: '单据编号'}, {prop: 'documentno', label: '单据编号'},
{prop: 'suppliername', label: '客户'}, {prop: 'suppliername', label: '供应商'},
{prop: 'currency', label: '币别'}, {prop: 'currency', label: '币别 '},
{prop: 'paymentamount', label: '付款金额'}, {prop: 'paymentamount', label: '付款金额'},
{prop: 'requestedamount', label: '申请金额'},
{prop: 'paymentaccount', label: '付款账户'}, {prop: 'paymentaccount', label: '付款账户'},
{prop: 'paymentbank', label: '付款银行'}, {prop: 'paymentbank', label: '付款银行'},
{prop: 'paymenttype', label: '付款类型'}, {prop: 'paymenttype', label: '付款类型'},
{prop: 'settlementtype', label: '结算类型'}, {prop: 'settlementtype', label: '结算类型'},
{prop: 'status', label: '单据状态'}, {prop: 'status', label: '单据状态'},
], ],
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
currencyProps:{"label":"fullName","value":"id"},
paymenttypeOptions:[{"fullName":"贷款","id":"0"},{"fullName":"运费","id":"1"},{"fullName":"仓储","id":"2"}], paymenttypeOptions:[{"fullName":"贷款","id":"0"},{"fullName":"运费","id":"1"},{"fullName":"仓储","id":"2"}],
paymenttypeProps:{"label":"fullName","value":"id"}, paymenttypeProps:{"label":"fullName","value":"id"},
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
currencyProps:{"label":"fullName","value":"id"},
settlementtypeOptions:[{"fullName":"现金","id":"0"},{"fullName":"赊购","id":"1"},{"fullName":"网银","id":"2"},{"fullName":"银企直连","id":"3"},{"fullName":"银票","id":"4"},{"fullName":"商票","id":"5"}], settlementtypeOptions:[{"fullName":"现金","id":"0"},{"fullName":"赊购","id":"1"},{"fullName":"网银","id":"2"},{"fullName":"银企直连","id":"3"},{"fullName":"银票","id":"4"},{"fullName":"商票","id":"5"}],
settlementtypeProps:{"label":"fullName","value":"id"}, settlementtypeProps:{"label":"fullName","value":"id"},
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"},{"fullName":"已付款","id":"3"}], statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"},{"fullName":"已付款","id":"3"}],
@ -181,7 +182,7 @@ width="150" >
menuId:this.menuId menuId:this.menuId
}; };
request({ request({
url: `/api/example/Payment/getList`, url: `/api/payment/Payment/getList`,
method: 'post', method: 'post',
data: _query data: _query
}).then(res => { }).then(res => {
@ -201,7 +202,7 @@ width="150" >
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
request({ request({
url: `/api/example/Payment/${id}`, url: `/api/payment/Payment/${id}`,
method: 'DELETE' method: 'DELETE'
}).then(res => { }).then(res => {
this.$message({ this.$message({
@ -215,6 +216,67 @@ width="150" >
}).catch(() => { }).catch(() => {
}); });
}, },
handleSelectionChange(val) {
const res = val.map(item => item.id)
this.multipleSelection = res
},
handleBatchRemoveDel() {
if (!this.multipleSelection.length) {
this.$message({
type: 'error',
message: '请选择一条数据',
duration: 1500,
})
return
}
const ids = this.multipleSelection.join()
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/payment/Payment/batchRemove/${ids}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {
})
},
confirmprice(){
if (!this.multipleSelection.length) {
this.$message({
type: 'error',
message: '请选择一条数据',
duration: 1500,
})
return
}
let id = this.multipleSelection.join()
let param = {};
param = this.list.find(function(param) {
debugger
return param.id == id;
})
request({
url: `/api/payment/Payment/confirmprice`,
method: 'POST',
data: param
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
},
addOrUpdateHandle(id, isDetail) { addOrUpdateHandle(id, isDetail) {
this.formVisible = true this.formVisible = true
this.$nextTick(() => { this.$nextTick(() => {
@ -230,7 +292,7 @@ width="150" >
download(data) { download(data) {
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId} let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
request({ request({
url: `/api/example/Payment/Actions/Export`, url: `/api/payment/Payment/Actions/Export`,
method: 'GET', method: 'GET',
data: query data: query
}).then(res => { }).then(res => {

@ -297,7 +297,7 @@
</el-tab-pane > </el-tab-pane >
<el-tab-pane v-if="" label="发票信息"> <!-- <el-tab-pane v-if="" label="发票信息">
<el-col :span="24" > <el-col :span="24" >
<el-form-item label-width="0"> <el-form-item label-width="0">
<div class="JNPF-common-title"> <div class="JNPF-common-title">
@ -388,8 +388,8 @@
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-tab-pane > </el-tab-pane >-->
<el-tab-pane label="付款信息"> <!-- <el-tab-pane label="付款信息">
<el-col :span="24" > <el-col :span="24" >
<el-form-item label-width="0"> <el-form-item label-width="0">
<div class="JNPF-common-title"> <div class="JNPF-common-title">
@ -562,7 +562,7 @@
</div> </div>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-tab-pane > </el-tab-pane >-->
@ -708,9 +708,6 @@
this.dataForm.purchaseorder_item0List[i].poundPictures = b.pound_pictures; this.dataForm.purchaseorder_item0List[i].poundPictures = b.pound_pictures;
this.dataForm.purchaseorder_item0List[i].vehiclePictures = b.vehicle_pictures; this.dataForm.purchaseorder_item0List[i].vehiclePictures = b.vehicle_pictures;
this.dataForm.purchaseorder_item0List[i].pountType = b.pound_type; this.dataForm.purchaseorder_item0List[i].pountType = b.pound_type;
// a = a + pound_pictures;
// }{
// a = a + this.dataForm.purchaseorder_item0List[i].poundPictures;
} }
} }
}, },

@ -28,7 +28,7 @@
</el-button> </el-button>
<el-button type="primary" icon="el-icon-plus" @click="pigeonhole()"> <el-button type="primary" icon="el-icon-plus" @click="pigeonhole()">
</el-button> </el-button>
<el-button type="primary" icon="el-icon-plus" @click="payment()"> <el-button type="primary" icon="el-icon-plus" @click="paymentApply()">
</el-button> </el-button>
</div> </div>
<div class="JNPF-common-head-right"> <div class="JNPF-common-head-right">
@ -269,13 +269,11 @@
}) })
return return
} }
// let id = {}
let id = this.multipleSelection.join() let id = this.multipleSelection.join()
let param ={}; let param ={};
param = this.list.find(function(param) { param = this.list.find(function(param) {
return param.id == id; return param.id == id;
}) })
debugger
request({ request({
url: `/api/purchaseorder/Purchaseorder/pigeonhole`, url: `/api/purchaseorder/Purchaseorder/pigeonhole`,
method: 'POST', method: 'POST',
@ -290,7 +288,7 @@
}); });
}) })
}, },
payment(){ paymentApply(){
if (!this.multipleSelection.length) { if (!this.multipleSelection.length) {
this.$message({ this.$message({
type: 'error', type: 'error',
@ -300,12 +298,19 @@
return return
} }
let ids = this.multipleSelection.join() let ids = this.multipleSelection.join()
if (this.multipleSelection.length ===1){ request({
let info = {}; url: `/api/purchaseorder/Purchaseorder/paymentapply/${ids}`,
info = this.list.find(function(info) { method: 'put',
return info.id == ids }).then(res => {
}) this.$message({
if (info.amount != info.invoiceAmount){ type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
/* if (info.amount != info.invoiceAmount){
this.$message({ this.$message({
type: 'error', type: 'error',
message: '请先开具发票', message: '请先开具发票',
@ -321,8 +326,7 @@
// this.$refs.JNPFForm.init(id, isDetail) // this.$refs.JNPFForm.init(id, isDetail)
// }) // })
this.$router.push({path:'/paymentdoc'}) this.$router.push({path:'/paymentdoc'})
} }*/
}
}, },
exportData() { exportData() {
this.exportBoxVisible = true this.exportBoxVisible = true

@ -40,7 +40,7 @@
<el-form-item label="入库金额" <el-form-item label="入库金额"
prop="receiptamount" > prop="receiptamount" >
<el-input v-model="dataForm.receiptamount" <el-input v-model="dataForm.receiptamount"
placeholder="请输入入库金额" clearable :style='{"width":"100%"}'> placeholder="请输入入库金额" readonly>
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -49,7 +49,7 @@
<el-form-item label="币别" <el-form-item label="币别"
prop="currency" > prop="currency" >
<el-select v-model="dataForm.currency" <el-select v-model="dataForm.currency"
placeholder="请选择币别" clearable :style='{"width":"100%"}'> placeholder="请选择币别" readonly>
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> <el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select> </el-select>
@ -59,7 +59,7 @@
<el-form-item label="入库数量" <el-form-item label="入库数量"
prop="receiptnum" > prop="receiptnum" >
<el-input v-model="dataForm.receiptnum" <el-input v-model="dataForm.receiptnum"
placeholder="请输入入库数量" clearable :style='{"width":"100%"}'> placeholder="请输入入库数量" readonly>
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -68,7 +68,7 @@
<el-form-item label="供应商名称" <el-form-item label="供应商名称"
prop="suppliername" > prop="suppliername" >
<el-input v-model="dataForm.suppliername" <el-input v-model="dataForm.suppliername"
placeholder="请输入供应商名称" clearable :style='{"width":"100%"}'> placeholder="请输入供应商名称" readonly>
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -82,25 +82,25 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <!-- <el-col :span="12" >-->
<el-form-item label="入库日期" <!-- <el-form-item label="入库日期"-->
prop="warehousingdate" > <!-- prop="warehousingdate" >-->
<el-date-picker v-model="dataForm.warehousingdate" <!-- <el-date-picker v-model="dataForm.warehousingdate"-->
placeholder="请选择入库日期" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" > <!-- placeholder="请选择入库日期" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >-->
</el-date-picker> <!-- </el-date-picker>-->
</el-form-item> <!-- </el-form-item>-->
</el-col> <!-- </el-col>-->
<el-col :span="12" > <!-- <el-col :span="12" >-->
<el-form-item label="单据状态" <!-- <el-form-item label="单据状态"-->
prop="status" > <!-- prop="status" >-->
<el-select v-model="dataForm.status" <!-- <el-select v-model="dataForm.status"-->
placeholder="请选择单据状态" clearable :style='{"width":"100%"}'> <!-- placeholder="请选择单据状态" clearable :style='{"width":"100%"}'>-->
<el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> <!-- <el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>-->
</el-select> <!-- </el-select>-->
</el-form-item> <!-- </el-form-item>-->
</el-col> <!-- </el-col>-->
<el-col :span="24"> <el-col :span="24">
<el-tabs v-model="activevpzhms" tab-position="top" class="mb-20"> <el-tabs v-model="activevpzhms" tab-position="top" class="mb-20">
<el-tab-pane label="磅单明细"> <el-tab-pane label="磅单明细">
@ -123,7 +123,7 @@
<el-table-column prop="materialname" label="物料名称"> <el-table-column prop="materialname" label="物料名称">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.materialname" <el-input v-model="scope.row.materialname"
placeholder="请输入" clearable :style='{"width":"200%"}'> placeholder="请输入" :disabled="true">
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>

@ -26,27 +26,27 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="地点ID" <el-form-item label="供应商地点ID"
prop="supplierSiteId" > prop="supplierSiteId" >
<p>{{dataForm.supplierSiteId}}</p> <p>{{dataForm.supplierSiteId}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="地点名称" <el-form-item label="供应商地点名称"
prop="supplierSiteCode" > prop="supplierSiteCode" >
<p>{{dataForm.supplierSiteCode}}</p> <p>{{dataForm.supplierSiteCode}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="所属公司编码" <el-form-item label="公司名称"
prop="companyId" > prop="companyId" >
<p>{{dataForm.companyId}}</p> <p>{{dataForm.companyId}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="所属公司名称" <el-form-item label="地址"
prop="companyName" > prop="address" >
<p>{{dataForm.companyName}}</p> <p>{{dataForm.address}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
@ -67,12 +67,6 @@
<p>{{ dataForm.supplierLevel | dynamicText(supplierLevelOptions) }} </p> <p>{{ dataForm.supplierLevel | dynamicText(supplierLevelOptions) }} </p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" >
<el-form-item label="地址"
prop="address" >
<p>{{dataForm.address}}</p>
</el-form-item>
</el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="启用" <el-form-item label="启用"
prop="status" > prop="status" >
@ -106,12 +100,11 @@
supplierName : '', supplierName : '',
supplierSiteId : '', supplierSiteId : '',
supplierSiteCode : '', supplierSiteCode : '',
companyId : '', companyId : [],
companyName : '', address : '',
contactName : '', contactName : '',
contactPhone : '', contactPhone : '',
supplierLevel : "1", supplierLevel : "1",
address : '',
status : 1, status : 1,
}, },
supplierLevelOptions:[{"fullName":"一级","id":"1"},{"fullName":"二级","id":"2"},{"fullName":"三级","id":"3"},{"fullName":"四级","id":"4"}], supplierLevelOptions:[{"fullName":"一级","id":"1"},{"fullName":"二级","id":"2"},{"fullName":"三级","id":"3"},{"fullName":"四级","id":"4"}],

@ -1,264 +1,258 @@
<template> <template>
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body <el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1000px"> :close-on-click-modal="false" append-to-body
<el-row :gutter="15" class=""> :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" width="1000px">
label-position="right"> <el-row :gutter="15" class="">
<template v-if="!loading"> <el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
<el-col :span="24"> <template v-if="!loading">
<el-form-item label-width="0"> <el-col :span="24" >
<JNPF-Text :style='{"width":"100%"}' <el-form-item label-width="0">
:textStyle='{"color":"#000000","font-weight":"bold","text-decoration":"none","font-size":18,"line-height":32,"font-style":"normal","text-align":"left"}' <JNPF-Text :style='{"width":"100%"}'
value="供应商编辑"> :textStyle='{"color":"#000000","font-weight":"bold","text-decoration":"none","font-size":18,"line-height":32,"font-style":"normal","text-align":"left"}' value="供应商编辑">
</JNPF-Text> </JNPF-Text>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" >
<el-form-item label="供应商编码" prop="supplierCode"> <el-form-item label="供应商编码"
<el-input v-model="dataForm.supplierCode" placeholder="请输入供应商编码" clearable prop="supplierCode" >
:style='{"width":"100%"}'> <el-input v-model="dataForm.supplierCode"
placeholder="请输入供应商编码" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" >
<el-form-item label="供应商名称" prop="supplierName"> <el-form-item label="供应商名称"
<el-input v-model="dataForm.supplierName" placeholder="请输入供应商名称" clearable prop="supplierName" >
:style='{"width":"100%"}'> <el-input v-model="dataForm.supplierName"
placeholder="请输入供应商名称" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" >
<el-form-item label="地点ID" prop="supplierSiteId"> <el-form-item label="供应商地点ID"
<el-input v-model="dataForm.supplierSiteId" placeholder="请输入供应商地点ID" clearable prop="supplierSiteId" >
:style='{"width":"100%"}'> <el-input v-model="dataForm.supplierSiteId"
placeholder="请输入供应商地点ID" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" >
<el-form-item label="地点名称" prop="supplierSiteCode"> <el-form-item label="供应商地点名称"
<el-input v-model="dataForm.supplierSiteCode" placeholder="请输入供应商地点名称" clearable prop="supplierSiteCode" >
:style='{"width":"100%"}'> <el-input v-model="dataForm.supplierSiteCode"
placeholder="请输入供应商地点名称" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" >
<el-form-item label="所属公司编码" prop="companyId"> <el-form-item label="公司名称"
<el-input v-model="dataForm.companyId" placeholder="请输入所属公司编码" clearable prop="companyId" >
:style='{"width":"100%"}'> <com-select v-model="dataForm.companyId"
placeholder="请选择" clearable >
</el-input> </com-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" >
<el-form-item label="所属公司名称" prop="companyName"> <el-form-item label="地址"
<el-input v-model="dataForm.companyName" placeholder="请输入公司名称" clearable prop="address" >
:style='{"width":"100%"}'> <el-input v-model="dataForm.address"
placeholder="请输入地址" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" >
<el-form-item label="联系人" prop="contactName"> <el-form-item label="联系人"
<el-input v-model="dataForm.contactName" placeholder="请输入联系人" clearable prop="contactName" >
:style='{"width":"100%"}'> <el-input v-model="dataForm.contactName"
placeholder="请输入联系人" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" >
<el-form-item label="联系电话" prop="contactPhone"> <el-form-item label="联系电话"
<el-input v-model="dataForm.contactPhone" placeholder="请输入联系电话" clearable prop="contactPhone" >
:style='{"width":"100%"}'> <el-input v-model="dataForm.contactPhone"
placeholder="请输入联系电话" clearable :style='{"width":"100%"}'>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" >
<el-form-item label="供应商等级" prop="supplierLevel"> <el-form-item label="供应商等级"
<el-select v-model="dataForm.supplierLevel" placeholder="请选择" clearable prop="supplierLevel" >
:style='{"width":"100%"}'> <el-select v-model="dataForm.supplierLevel"
<el-option v-for="(item, index) in supplierLevelOptions" :key="index" placeholder="请选择" clearable :style='{"width":"100%"}'>
:label="item.fullName" :value="item.id" :disabled="item.disabled"></el-option> <el-option v-for="(item, index) in supplierLevelOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" >
<el-form-item label="地址" prop="address"> <el-form-item label="启用"
<el-input v-model="dataForm.address" placeholder="请输入地址" clearable prop="status" >
:style='{"width":"100%"}'> <el-switch v-model="dataForm.status"
:active-value="1" :inactive-value="0" >
</el-input> </el-switch>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> </template>
<el-form-item label="启用" prop="status"> </el-form>
<el-switch v-model="dataForm.status" :active-value="1" :inactive-value="0"> </el-row>
<span slot="footer" class="dialog-footer">
</el-switch> <el-button @click="visible = false"> </el-button>
</el-form-item> <el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> </el-button>
</el-col> </span>
</template> </el-dialog>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> </el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import { import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
getDataInterfaceRes import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
} from '@/api/systemData/dataInterface' export default {
import { components: {},
getDictionaryDataSelector props: [],
} from '@/api/systemData/dictionary' data() {
export default { return {
components: {}, visible: false,
props: [], loading: false,
data() { isDetail: false,
return { dataForm: {
visible: false, supplierCode : '',
loading: false, supplierName : '',
isDetail: false, supplierSiteId : '',
dataForm: { supplierSiteCode : '',
supplierCode: '', companyId : [],
supplierName: '', address : '',
supplierSiteId: '', contactName : '',
supplierSiteCode: '', contactPhone : '',
companyId: '', supplierLevel : "1",
companyName: '', status : 1,
contactName: '', },
contactPhone: '', rules:
supplierLevel: "1", {
address: '', supplierCode: [
status: 1, {
}, required: true,
rules: { message: '请输入供应商编码',
supplierCode: [{ trigger: 'blur'
required: true, },
message: '请输入供应商编码', ],
trigger: 'blur' supplierName: [
}, ], {
supplierName: [{ required: true,
required: true, message: '请输入供应商名称',
message: '请输入供应商名称', trigger: 'blur'
trigger: 'blur' },
}, ], ],
}, },
supplierLevelOptions: [{ supplierLevelOptions:[{"fullName":"一级","id":"1"},{"fullName":"二级","id":"2"},{"fullName":"三级","id":"3"},{"fullName":"四级","id":"4"}],
"fullName": "一级",
"id": "1" }
}, { },
"fullName": "二级", computed: {},
"id": "2" watch: {},
}, { created() {
"fullName": "三级", },
"id": "3" mounted() {},
}, { methods: {
"fullName": "四级", clearData(data){
"id": "4" for (let key in data) {
}], if (data[key] instanceof Array) {
data[key] = [];
} else if (data[key] instanceof Object) {
this.clearData(data[key]);
} else {
data[key] = "";
}
}
},
init(id, isDetail) {
this.dataForm.id = id || 0;
this.visible = true;
this.isDetail = isDetail || false;
this.$nextTick(() => {
this.$refs['elForm'].resetFields();
if(this.dataForm.id){
this.loading = true
request({
url: '/api/supplier/Supplier/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
}else{
this.clearData(this.dataForm)
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
dataFormSubmit() {
this.$refs['elForm'].validate((valid) => {
if (valid) {
this.request()
}
})
},
request() {
var _data =this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/supplier/Supplier',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}else{
request({
url: '/api/supplier/Supplier/'+this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}
},
dataList(){
var _data = JSON.parse(JSON.stringify(this.dataForm));
_data.companyId = JSON.stringify(_data.companyId)
_data.status = parseInt(_data.status)
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
_dataAll.companyId = JSON.parse( _dataAll.companyId)
_dataAll.status = parseInt( _dataAll.status)
this.dataForm = _dataAll
},
},
}
}
},
computed: {},
watch: {},
created() {},
mounted() {},
methods: {
clearData(data) {
for (let key in data) {
if (data[key] instanceof Array) {
data[key] = [];
} else if (data[key] instanceof Object) {
this.clearData(data[key]);
} else {
data[key] = "";
}
}
},
init(id, isDetail) {
this.dataForm.id = id || 0;
this.visible = true;
this.isDetail = isDetail || false;
this.$nextTick(() => {
this.$refs['elForm'].resetFields();
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/supplier/Supplier/' + this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
} else {
this.clearData(this.dataForm)
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
dataFormSubmit() {
this.$refs['elForm'].validate((valid) => {
if (valid) {
this.request()
}
})
},
request() {
var _data = this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/supplier/Supplier',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
} else {
request({
url: '/api/supplier/Supplier/' + this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
this.visible = false
this.$emit('refresh', true)
}
})
})
}
},
dataList() {
var _data = JSON.parse(JSON.stringify(this.dataForm));
_data.status = parseInt(_data.status)
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
_dataAll.status = parseInt(_dataAll.status)
this.dataForm = _dataAll
},
},
}
</script> </script>

@ -1,345 +1,285 @@
<template> <template>
<div class="JNPF-common-layout"> <div class="JNPF-common-layout">
<div class="JNPF-common-layout-center"> <div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16"> <el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent> <el-form @submit.native.prevent>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="供应商编码"> <el-form-item label="供应商编码">
<el-input v-model="query.supplierCode" placeholder="请输入" clearable> </el-input> <el-input v-model="query.supplierCode" placeholder="请输入" clearable> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="供应商名称"> <el-form-item label="供应商名称">
<el-input v-model="query.supplierName" placeholder="请输入" clearable> </el-input> <el-input v-model="query.supplierName" placeholder="请输入" clearable> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button> <el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button> <el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
</el-row> </el-row>
<div class="JNPF-common-layout-main JNPF-flex-main"> <div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head"> <div class="JNPF-common-head">
<div> <div>
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()"> <el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">
</el-button> </el-button>
<el-button type="text" icon="el-icon-download" @click="exportData()"> <el-button type="text" icon="el-icon-download" @click="exportData()" >导出
</el-button> </el-button>
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()"> <el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
</el-button> </el-button>
</div> </div>
<div class="JNPF-common-head-right"> <div class="JNPF-common-head-right">
<el-tooltip effect="dark" content="刷新" placement="top"> <el-tooltip effect="dark" content="刷新" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" <el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
@click="reset()" /> @click="reset()"/>
</el-tooltip> </el-tooltip>
<screenfull isContainer /> <screenfull isContainer/>
</div> </div>
</div> </div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c <JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
@selection-change="handleSelectionChange"> <el-table-column prop="supplierCode" label="供应商编码" width="0" align="left"
<el-table-column prop="supplierCode" label="供应商编码" width="0" align="left" sortable="custom" /> sortable="custom" />
<el-table-column prop="supplierName" label="供应商名称" width="0" align="left" sortable="custom" /> <el-table-column prop="supplierName" label="供应商名称" width="0" align="left"
<el-table-column prop="supplierSiteId" label="地点ID" width="0" align="left" sortable="custom" /> sortable="custom" />
<el-table-column prop="supplierSiteCode" label="地点名称" width="0" align="left" sortable="custom" /> <el-table-column prop="supplierSiteId" label="供应商地点ID" width="0" align="left"
<el-table-column prop="companyId" label="所属公司编码" width="0" align="left" sortable="custom" /> sortable="custom" />
<el-table-column prop="companyName" label="所属公司名称" width="0" align="left" sortable="custom" /> <el-table-column prop="supplierSiteCode" label="供应商地点名称" width="0" align="left"
<el-table-column prop="contactName" label="联系人" width="0" align="left" sortable="custom" /> sortable="custom" />
<el-table-column prop="contactPhone" label="联系电话" width="0" align="left" sortable="custom" /> <el-table-column prop="companyId" label="公司名称" width="0" align="left"
<el-table-column label="供应商等级" width="0" prop="supplierLevel" algin="left" sortable="custom"> sortable="custom" />
<template slot-scope="scope"> <el-table-column prop="contactName" label="联系人" width="0" align="left"
{{ scope.row.supplierLevel | dynamicText(supplierLevelOptions) }} sortable="custom" />
</template> <el-table-column prop="contactPhone" label="联系电话" width="0" align="left"
</el-table-column> sortable="custom" />
<el-table-column prop="address" label="地址" width="0" align="left" sortable="custom" /> <el-table-column label="供应商等级" width="0" prop="supplierLevel" algin="left"
<!-- <el-table-column prop="status" label="启用" width="0" align="left" sortable="custom" >
sortable="custom" /> --> <template slot-scope="scope">
{{ scope.row.supplierLevel | dynamicText(supplierLevelOptions) }}
<el-table-column prop="status" label="状态" width="0" align="left"> </template>
<template slot-scope="scope"> </el-table-column>
<el-tag type="success" disable-transitions v-if="scope.row.status == 1"> <el-table-column prop="address" label="地址" width="0" align="left"
</el-tag> sortable="custom" />
<el-tag type="danger" disable-transitions v-else></el-tag> <el-table-column prop="status" label="启用" width="0" align="left" sortable="custom" >
</template> <template slot-scope="scope">
</el-table-column> <el-tag type="success" disable-transitions v-if="scope.row.status == '1'">
</el-tag>
<el-tag type="danger" disable-transitions v-else></el-tag>
<el-table-column label="操作" fixed="right" width="150"> </template>
<template slot-scope="scope"> </el-table-column>
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)"> <el-table-column label="操作" fixed="right"
</el-button> width="150" >
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)"> <template slot-scope="scope">
</el-button> <el-button type="text"
<el-button type="text" @click="goDetail(scope.row.id)"> @click="addOrUpdateHandle(scope.row.id)" >编辑
</el-button> </el-button>
</template> <el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-table-column> </el-button>
</JNPF-table> <el-button type="text"
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @click="goDetail(scope.row.id)">详情
@pagination="initData" /> </el-button>
</div> </template>
</div> </el-table-column>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" /> </JNPF-table>
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" /> <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" /> </div>
</div> </div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
</div>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import { import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
getDictionaryDataSelector import JNPFForm from './Form'
} from '@/api/systemData/dictionary' import ExportBox from './ExportBox'
import JNPFForm from './Form' import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
import ExportBox from './ExportBox' import Detail from './Detail'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import Detail from './Detail'
export default { export default {
components: { components: {JNPFForm, ExportBox,Detail},
JNPFForm, data() {
ExportBox, return {
Detail detailVisible: false,
}, query: {
data() { supplierCode:undefined,
return { supplierName:undefined,
detailVisible: false, },
query: { treeProps: {
supplierCode: undefined, children: 'children',
supplierName: undefined, label: 'fullName',
}, value: 'id'
treeProps: { },
children: 'children', list: [],
label: 'fullName', listLoading: true,
value: 'id' multipleSelection: [], total: 0,
}, listQuery: {
list: [], currentPage: 1,
listLoading: true, pageSize: 20,
multipleSelection: [], sort: "desc",
total: 0, sidx: "supplierCode",
listQuery: { },
currentPage: 1, formVisible: false,
pageSize: 20, exportBoxVisible: false,
sort: "desc", columnList: [
sidx: "supplierCode", {prop: 'supplierCode', label: '供应商编码'},
}, {prop: 'supplierName', label: '供应商名称'},
formVisible: false, {prop: 'supplierSiteId', label: '供应商地点ID'},
exportBoxVisible: false, {prop: 'supplierSiteCode', label: '供应商地点名称'},
columnList: [{ {prop: 'companyId', label: '公司名称'},
prop: 'supplierCode', {prop: 'contactName', label: '联系人'},
label: '供应商编码' {prop: 'contactPhone', label: '联系电话'},
}, {prop: 'supplierLevel', label: '供应商等级'},
{ {prop: 'address', label: '地址'},
prop: 'supplierName', {prop: 'status', label: '启用'},
label: '供应商名称' ],
}, supplierLevelOptions:[{"fullName":"一级","id":"1"},{"fullName":"二级","id":"2"},{"fullName":"三级","id":"3"},{"fullName":"四级","id":"4"}],
{ supplierLevelProps:{"label":"fullName","value":"id"},
prop: 'supplierSiteId', }
label: '地点ID' },
}, computed: {
{ menuId() {
prop: 'supplierSiteCode', return this.$route.meta.modelId || ''
label: '地点名称' }
}, },
{ created() {
prop: 'companyId', this.initData()
label: '所属公司编码' },
}, methods: {
{ goDetail(id){
prop: 'companyName', this.detailVisible = true
label: '所属公司名称' this.$nextTick(() => {
}, this.$refs.Detail.init(id)
{ })
prop: 'contactName', },
label: '联系人' sortChange({column, prop, order}) {
}, this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
{ this.listQuery.sidx = !order ? '' : prop
prop: 'contactPhone', this.initData()
label: '联系电话' },
}, initData() {
{ this.listLoading = true;
prop: 'supplierLevel', let _query = {
label: '供应商等级' ...this.listQuery,
}, ...this.query,
{ menuId:this.menuId
prop: 'address', };
label: '地址' request({
}, url: `/api/supplier/Supplier/getList`,
{ method: 'post',
prop: 'status', data: _query
label: '启用' }).then(res => {
}, var _list =[];
], for(let i=0;i<res.data.list.length;i++){
supplierLevelOptions: [{ let _data = res.data.list[i];
"fullName": "一级", _list.push(_data)
"id": "1" }
}, { this.list = _list
"fullName": "二级", this.total = res.data.pagination.total
"id": "2"
}, {
"fullName": "三级",
"id": "3"
}, {
"fullName": "四级",
"id": "4"
}],
supplierLevelProps: {
"label": "fullName",
"value": "id"
},
}
},
computed: {
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
this.initData()
},
methods: {
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()
},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
menuId: this.menuId
};
request({
url: `/api/supplier/Supplier/getList`,
method: 'post',
data: _query
}).then(res => {
var _list = [];
for (let i = 0; i < res.data.list.length; i++) {
let _data = res.data.list[i];
_list.push(_data)
}
this.list = _list
this.total = res.data.pagination.total
this.listLoading = false this.listLoading = false
}) })
}, },
handleDel(id) { handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
request({ request({
url: `/api/supplier/Supplier/${id}`, url: `/api/supplier/Supplier/${id}`,
method: 'DELETE' method: 'DELETE'
}).then(res => { }).then(res => {
this.$message({ this.$message({
type: 'success', type: 'success',
message: res.msg, message: res.msg,
onClose: () => { onClose: () => {
this.initData() this.initData()
} }
}); });
}) })
}).catch(() => {}); }).catch(() => {
}, });
handleSelectionChange(val) { },
const res = val.map(item => item.id) handleSelectionChange(val) {
this.multipleSelection = res const res = val.map(item => item.id)
}, this.multipleSelection = res
handleBatchRemoveDel() { },
if (!this.multipleSelection.length) { handleBatchRemoveDel() {
this.$message({ if (!this.multipleSelection.length) {
type: 'error', this.$message({
message: '请选择一条数据', type: 'error',
duration: 1500, message: '请选择一条数据',
}) duration: 1500,
return })
} return
const ids = this.multipleSelection.join() }
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', { const ids = this.multipleSelection.join()
type: 'warning' this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
}).then(() => { type: 'warning'
request({ }).then(() => {
url: `/api/supplier/Supplier/batchRemove/${ids}`, request({
method: 'DELETE' url: `/api/supplier/Supplier/batchRemove/${ids}`,
}).then(res => { method: 'DELETE'
this.$message({ }).then(res => {
type: 'success', this.$message({
message: res.msg, type: 'success',
onClose: () => { message: res.msg,
this.initData() onClose: () => {
} this.initData()
}); }
}) });
}).catch(() => {}) })
}, }).catch(() => {
addOrUpdateHandle(id, isDetail) { })
this.formVisible = true },
this.$nextTick(() => { addOrUpdateHandle(id, isDetail) {
this.$refs.JNPFForm.init(id, isDetail) this.formVisible = true
}) this.$nextTick(() => {
}, this.$refs.JNPFForm.init(id, isDetail)
exportData() { })
this.exportBoxVisible = true },
this.$nextTick(() => { exportData() {
this.$refs.ExportBox.init(this.columnList) this.exportBoxVisible = true
}) this.$nextTick(() => {
}, this.$refs.ExportBox.init(this.columnList)
download(data) { })
let query = { },
...data, download(data) {
...this.listQuery, let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
...this.query, request({
menuId: this.menuId url: `/api/supplier/Supplier/Actions/Export`,
} method: 'GET',
request({ data: query
url: `/api/supplier/Supplier/Actions/Export`, }).then(res => {
method: 'GET', if (!res.data.url) return
data: query this.jnpf.downloadFile(res.data.url)
}).then(res => { this.$refs.ExportBox.visible = false
if (!res.data.url) return this.exportBoxVisible = false
this.jnpf.downloadFile(res.data.url) })
this.$refs.ExportBox.visible = false },
this.exportBoxVisible = false search() {
}) this.listQuery = {
}, currentPage: 1,
search() { pageSize: 20,
this.listQuery = { sort: "desc",
currentPage: 1, sidx: "supplierCode",
pageSize: 20, }
sort: "desc", this.initData()
sidx: "supplierCode", },
} refresh(isrRefresh) {
this.initData() this.formVisible = false
}, if (isrRefresh) this.reset()
refresh(isrRefresh) { },
this.formVisible = false reset() {
if (isrRefresh) this.reset() for (let key in this.query) {
}, this.query[key] = undefined
reset() { }
for (let key in this.query) { this.search()
this.query[key] = undefined }
} }
this.search() }
}
}
}
</script> </script>

@ -22,8 +22,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="司机名称" prop="drivername"> <el-form-item label="司机" prop="drivername">
<el-input v-model="dataForm.drivername" placeholder="请输入司机名称" clearable <el-input v-model="dataForm.drivername" placeholder="请输入司机" clearable
:style='{"width":"100%"}'> :style='{"width":"100%"}'>
</el-input> </el-input>
@ -45,7 +45,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="12" > <!-- <el-col :span="12" >
<el-form-item label="录入人" <el-form-item label="录入人"
prop="creatorusername" > prop="creatorusername" >
<el-input v-model="dataForm.creatorusername" <el-input v-model="dataForm.creatorusername"
placeholder="请输入录入人" clearable :style='{"width":"100%"}'> placeholder="请输入录入人" clearable :style='{"width":"100%"}'>
@ -54,7 +54,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" > <el-col :span="12" >
<el-form-item label="创建时间" <el-form-item label="创建时间"
prop="creatortime" > prop="creatortime" >
<el-input v-model="dataForm.creatortime" <el-input v-model="dataForm.creatortime"
placeholder="系统自动生成" readonly > placeholder="系统自动生成" readonly >

@ -42,25 +42,25 @@
</div> </div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c <JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c
@selection-change="handleSelectionChange"> @selection-change="handleSelectionChange">
<!-- <el-table-column prop="id" label="ID" width="0" align="left" /> --> <el-table-column prop="id" label="ID" width="0" align="left" />
<el-table-column prop="ticketno" label="车牌号" width="0" align="left" /> <el-table-column prop="ticketno" label="车牌号" width="0" align="left" />
<el-table-column prop="drivername" label="司机名称" width="0" align="left" /> <el-table-column prop="drivername" label="司机" width="0" align="left" />
<el-table-column prop="contact" label="手机号" width="0" align="left" /> <el-table-column prop="vehiclephotos" label="车辆照片" width="0" align="left">
<el-table-column prop="vehiclephotos" label="车辆照片" width="0" align="left"> <template slot-scope="scope">
<template slot-scope="scope">
<span v-for="(item,index) in JSON.parse(scope.row.vehiclephotos)" :key="index"> <span v-for="(item,index) in JSON.parse(scope.row.vehiclephotos)" :key="index">
<el-popover placement="bottom" trigger="click" width="1000"> <el-popover placement="bottom" trigger="click" width="1000">
<img :src="`/dev${item.url}`" width="100%" /> <img :src="`/dev${item.url}`" width="100%" />
<img <img
slot="reference" slot="reference"
:src="`/dev${item.url}`" :src="`/dev${item.url}`"
:alt="`/dev${item.url}`" :alt="`/dev${item.url}`"
style="max-height: 70px;max-width: 70px; padding: 5px" style="max-height: 70px;max-width: 70px; padding: 5px"
/> />
</el-popover> </el-popover>
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="contact" label="手机号" width="0" align="left" />
<el-table-column prop="creatorusername" label="录入人" width="0" align="left" /> <el-table-column prop="creatorusername" label="录入人" width="0" align="left" />
<el-table-column prop="creatortime" label="创建时间" width="0" align="left" /> <el-table-column prop="creatortime" label="创建时间" width="0" align="left" />
<el-table-column label="操作" fixed="right" width="100"> <el-table-column label="操作" fixed="right" width="100">

Loading…
Cancel
Save