销售问题

product
Vayne 2 years ago
parent 7b643cf0f9
commit 70a8894243

@ -115,7 +115,7 @@ public class CollectionController {
} }
/** /**
* *
* *
* @param param * @param param
* @return * @return
@ -137,6 +137,20 @@ public class CollectionController {
return ActionResult.success(entity); return ActionResult.success(entity);
} }
/**
*
*
* @param param
* @return
*/
@GetMapping("/show")
public ActionResult collectionShow(@Param("param") String param) {
ContractFileEntity entity = contractFileService.getInfo(param);
List<SaleorderitemEntity> list = collectionService.querySaleOrderInfo(param);
entity.setSaleorderitemList(list);
return ActionResult.success(entity);
}
/** /**
* *
* *

@ -122,4 +122,11 @@ public class Receiptout_item0Entity {
@TableField("MATERIAL_ID") @TableField("MATERIAL_ID")
private String materialId; private String materialId;
@TableField(exist = false)
private String vehicleName;
@TableField(exist = false)
private String name;
@TableField(exist = false)
private String areaName;
} }

@ -23,6 +23,10 @@ import jnpf.base.vo.DownloadVO;
import jnpf.collection.entity.Collection_item0Entity; import jnpf.collection.entity.Collection_item0Entity;
import jnpf.collection.service.Collection_item0Service; import jnpf.collection.service.Collection_item0Service;
import jnpf.config.ConfigValueUtil; import jnpf.config.ConfigValueUtil;
import jnpf.contractfile.entity.ContractFileEntity;
import jnpf.contractfile.service.ContractFileService;
import jnpf.customer.entity.CustomerEntity;
import jnpf.customer.service.CustomerService;
import jnpf.exception.DataException; import jnpf.exception.DataException;
import jnpf.materialvo.entity.MaterialEntity; import jnpf.materialvo.entity.MaterialEntity;
import jnpf.materialvo.service.MaterialService; import jnpf.materialvo.service.MaterialService;
@ -38,6 +42,7 @@ import jnpf.reservoirarea.entity.ReservoirareaEntity;
import jnpf.reservoirarea.service.ReservoirareaService; import jnpf.reservoirarea.service.ReservoirareaService;
import jnpf.saleorder.mapper.ReceiptoutsoitemMapper; import jnpf.saleorder.mapper.ReceiptoutsoitemMapper;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P; import org.springframework.security.core.parameters.P;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -145,6 +150,10 @@ public class SaleorderitemController {
private Arinvoices_item1Service arinvoices_item1Service; private Arinvoices_item1Service arinvoices_item1Service;
@Autowired @Autowired
private Receiptin_item0Service receiptin_item0Service; private Receiptin_item0Service receiptin_item0Service;
@Autowired
private ContractFileService contractFileService;
@Autowired
private CustomerService customerService;
/** /**
* *
@ -671,6 +680,81 @@ public class SaleorderitemController {
for(Salesorder_item0Entity salesorder_item0Entity : Salesorder_item0List){ for(Salesorder_item0Entity salesorder_item0Entity : Salesorder_item0List){
} }
vo.setSalesorder_item0List(JsonUtil.getJsonToList(Salesorder_item0List,Salesorder_item0Model.class )); vo.setSalesorder_item0List(JsonUtil.getJsonToList(Salesorder_item0List,Salesorder_item0Model.class ));
List<ReceiptoutsoitemEntity> jg_receiptoutList = saleorderitemService.GetReceiptoutsoitemList(id);
List<ReceiptoutsoitemModel> jg_receiptoutModelList = new ArrayList<>();
if (jg_receiptoutList!=null && jg_receiptoutList.size()>0) {
List<Receiptout_item0Entity> list = saleorderitemService.queryReceiptoutItemInfo(jg_receiptoutList.get(0).getId());
jg_receiptoutModelList = JsonUtil.getJsonToList(list, ReceiptoutsoitemModel.class);
for (ReceiptoutsoitemModel jg_receiptoutModel : jg_receiptoutModelList) {
jg_receiptoutModel.setDocumentNo(jg_receiptoutList.get(0).getDocumentNo());
jg_receiptoutModel.setIssueDate(jg_receiptoutList.get(0).getIssueDate().getTime());
// Map<String,Object> vehicleIdMap = new HashMap<>();
// jg_receiptoutModel.setVehicleId(generaterSwapUtil.getPopupSelectValue("398732963950472005","id","ticketno",jg_receiptoutModel.getVehicleId(),vehicleIdMap));
// Map<String,Object> materialIdMap = new HashMap<>();
// jg_receiptoutModel.setMaterialId(generaterSwapUtil.getPopupSelectValue("398719564478785669","id","item_name",jg_receiptoutModel.getMaterialId(),materialIdMap));
// Map<String,Object> reservoirareaIdMap = new HashMap<>();
// jg_receiptoutModel.setReservoirareaId(generaterSwapUtil.getPopupSelectValue("392939299932268421","id","areaname",jg_receiptoutModel.getReservoirareaId(),reservoirareaIdMap));
// Map<String,Object> warehouseMap = new HashMap<>();
// jg_receiptoutModel.setWarehouseId(generaterSwapUtil.getPopupSelectValue("399117969575232581","id","name",jg_receiptoutModel.getWarehouseId(),warehouseMap));
}
}
vo.setReceiptoutsoitemList(jg_receiptoutModelList);
QueryWrapper<ArinvoicesEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(ArinvoicesEntity::getSalesOrderId,id);
ArinvoicesEntity arinvoicesEntity = arinvoicesService.getOne(queryWrapper);
List<Arinvoices_item0soitemModel> jg_arinvoices_item0ModelList = new ArrayList<>();
if (ObjectUtils.isNotEmpty(arinvoicesEntity)) {
List<Arinvoices_item0soitemEntity> jg_arinvoices_item0List = saleorderitemService.GetArinvoices_item0soitemList(arinvoicesEntity.getId());
jg_arinvoices_item0ModelList = JsonUtil.getJsonToList(jg_arinvoices_item0List, Arinvoices_item0soitemModel.class);
for (Arinvoices_item0soitemModel jg_arinvoices_item0Model : jg_arinvoices_item0ModelList) {
jg_arinvoices_item0Model.setAttachMent(generaterSwapUtil.getFileNameInJson(jg_arinvoices_item0Model.getAttachMent()));
}
}
vo.setArinvoices_item0soitemList(jg_arinvoices_item0ModelList);
QueryWrapper<Collection_item0Entity> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.lambda().eq(Collection_item0Entity::getSalesorderId,id);
List<Collection_item0Entity> collection_item0Entity = collection_item0Service.list(queryWrapper1);
List<CollectionsoitemEntity> collectionsoitemEntityList = new ArrayList<>();
if (collection_item0Entity.size()>0) {
for (Collection_item0Entity collection_item0Entity1 : collection_item0Entity) {
List<CollectionsoitemEntity> jg_collectionList = saleorderitemService.GetCollectionsoitemList(collection_item0Entity1.getCollectionId());
collectionsoitemEntityList.addAll(jg_collectionList);
}
}
List<CollectionsoitemModel> jg_collectionModelList = JsonUtil.getJsonToList(collectionsoitemEntityList, CollectionsoitemModel.class);
for (CollectionsoitemModel jg_collectionModel : jg_collectionModelList) {
}
vo.setCollectionsoitemList(jg_collectionModelList);
List<SalesbacksoitemEntity> jg_salesbackList = saleorderitemService.GetSalesbacksoitemList(id);
List<SalesbacksoitemModel> jg_salesbackModelList = JsonUtil.getJsonToList(jg_salesbackList,SalesbacksoitemModel.class);
for(SalesbacksoitemModel jg_salesbackModel : jg_salesbackModelList){
}
vo.setSalesbacksoitemList(jg_salesbackModelList);
List<PaymentsoitemEntity> jg_paymentList = saleorderitemService.GetPaymentsoitemList(id);
List<PaymentsoitemModel> jg_paymentModelList = JsonUtil.getJsonToList(jg_paymentList,PaymentsoitemModel.class);
for(PaymentsoitemModel jg_paymentModel : jg_paymentModelList){
}
vo.setPaymentsoitemList(jg_paymentModelList);
List<PoundlistEntity> poundlist = saleorderitemService.GetPoundlistList(id);
vo.setPoundlistentityList(poundlist);
//附表数据转换
//添加到详情表单对象中
// ContractFileEntity contractFileEntity = contractFileService.getInfo(vo.getContractId());
// if (ObjectUtils.isNotEmpty(contractFileEntity) && StringUtils.isNotEmpty(contractFileEntity.getContractName())){
// vo.setContractId(contractFileEntity.getContractName());
// }
// CustomerEntity customerEntity = customerService.getInfo(vo.getCustomerId());
// if (ObjectUtils.isNotEmpty(customerEntity) && StringUtils.isNotEmpty(customerEntity.getSupplierNm())){
// vo.setCustomerId(customerEntity.getSupplierNm());
// }
// Map<String,Object> contractCodeMap = new HashMap<>();
// vo.setContractId(generaterSwapUtil.getPopupSelectValue("391146878474963333","id","contract_name",vo.getContractId(),contractCodeMap));
// Map<String,Object> costomerCodeMap = new HashMap<>();
// vo.setCustomerId(generaterSwapUtil.getPopupSelectValue("398016916830126469","id","supplier_nm",vo.getCustomerId(),costomerCodeMap));
// vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
// vo.setCreatorTime(vo.getCreatorTime());
// List<ReceiptoutsoitemEntity> ReceiptoutsoitemList = saleorderitemService.GetReceiptoutsoitemList(id); // List<ReceiptoutsoitemEntity> ReceiptoutsoitemList = saleorderitemService.GetReceiptoutsoitemList(id);
// for(ReceiptoutsoitemEntity receiptoutsoitemEntity : ReceiptoutsoitemList){ // for(ReceiptoutsoitemEntity receiptoutsoitemEntity : ReceiptoutsoitemList){
@ -711,31 +795,31 @@ public class SaleorderitemController {
SaleorderitemEntity entity= saleorderitemService.getInfo(id); SaleorderitemEntity entity= saleorderitemService.getInfo(id);
SaleorderitemInfoVO vo=JsonUtil.getJsonToBean(entity, SaleorderitemInfoVO.class); SaleorderitemInfoVO vo=JsonUtil.getJsonToBean(entity, SaleorderitemInfoVO.class);
//子表数据转换 //子表数据转换
List<Salesorder_item0Entity> jg_salesorder_item0List = saleorderitemService.GetSalesorder_item0List(id); List<Salesorder_item0Entity> jg_salesorder_item0List = saleorderitemService.querySaleOrderItemInfo(id);
List<Salesorder_item0Model> jg_salesorder_item0ModelList = JsonUtil.getJsonToList(jg_salesorder_item0List,Salesorder_item0Model.class); List<Salesorder_item0Model> jg_salesorder_item0ModelList = JsonUtil.getJsonToList(jg_salesorder_item0List,Salesorder_item0Model.class);
for(Salesorder_item0Model jg_salesorder_item0Model : jg_salesorder_item0ModelList){ // for(Salesorder_item0Model jg_salesorder_item0Model : jg_salesorder_item0ModelList){
Map<String,Object> vehicleIdMap = new HashMap<>(); // Map<String,Object> vehicleIdMap = new HashMap<>();
jg_salesorder_item0Model.setVehicleId(generaterSwapUtil.getPopupSelectValue("381432451370615173","id","ticketno",jg_salesorder_item0Model.getVehicleId(),vehicleIdMap)); // jg_salesorder_item0Model.setVehicleId(generaterSwapUtil.getPopupSelectValue("381432451370615173","id","ticketno",jg_salesorder_item0Model.getVehicleId(),vehicleIdMap));
Map<String,Object> materialIdMap = new HashMap<>(); // Map<String,Object> materialIdMap = new HashMap<>();
jg_salesorder_item0Model.setMaterialId(generaterSwapUtil.getPopupSelectValue("381037852907038533","id","item_name",jg_salesorder_item0Model.getMaterialId(),materialIdMap)); // jg_salesorder_item0Model.setMaterialId(generaterSwapUtil.getPopupSelectValue("381037852907038533","id","item_name",jg_salesorder_item0Model.getMaterialId(),materialIdMap));
} // }
vo.setSalesorder_item0List(jg_salesorder_item0ModelList); vo.setSalesorder_item0List(jg_salesorder_item0ModelList);
List<ReceiptoutsoitemEntity> jg_receiptoutList = saleorderitemService.GetReceiptoutsoitemList(id); List<ReceiptoutsoitemEntity> jg_receiptoutList = saleorderitemService.GetReceiptoutsoitemList(id);
List<ReceiptoutsoitemModel> jg_receiptoutModelList = new ArrayList<>(); List<ReceiptoutsoitemModel> jg_receiptoutModelList = new ArrayList<>();
if (jg_receiptoutList.size()>0) { if (jg_receiptoutList!=null && jg_receiptoutList.size()>0) {
List<Receiptout_item0Entity> list = saleorderitemService.getReceiptout(jg_receiptoutList.get(0).getId()); List<Receiptout_item0Entity> list = saleorderitemService.queryReceiptoutItemInfo(jg_receiptoutList.get(0).getId());
jg_receiptoutModelList = JsonUtil.getJsonToList(list, ReceiptoutsoitemModel.class); jg_receiptoutModelList = JsonUtil.getJsonToList(list, ReceiptoutsoitemModel.class);
for (ReceiptoutsoitemModel jg_receiptoutModel : jg_receiptoutModelList) { for (ReceiptoutsoitemModel jg_receiptoutModel : jg_receiptoutModelList) {
jg_receiptoutModel.setDocumentNo(jg_receiptoutList.get(0).getDocumentNo()); jg_receiptoutModel.setDocumentNo(jg_receiptoutList.get(0).getDocumentNo());
jg_receiptoutModel.setIssueDate(jg_receiptoutList.get(0).getIssueDate()); jg_receiptoutModel.setIssueDate(jg_receiptoutList.get(0).getIssueDate().getTime());
Map<String,Object> vehicleIdMap = new HashMap<>(); // Map<String,Object> vehicleIdMap = new HashMap<>();
jg_receiptoutModel.setVehicleId(generaterSwapUtil.getPopupSelectValue("398732963950472005","id","ticketno",jg_receiptoutModel.getVehicleId(),vehicleIdMap)); // jg_receiptoutModel.setVehicleId(generaterSwapUtil.getPopupSelectValue("398732963950472005","id","ticketno",jg_receiptoutModel.getVehicleId(),vehicleIdMap));
Map<String,Object> materialIdMap = new HashMap<>(); // Map<String,Object> materialIdMap = new HashMap<>();
jg_receiptoutModel.setMaterialId(generaterSwapUtil.getPopupSelectValue("398719564478785669","id","item_name",jg_receiptoutModel.getMaterialId(),materialIdMap)); // jg_receiptoutModel.setMaterialId(generaterSwapUtil.getPopupSelectValue("398719564478785669","id","item_name",jg_receiptoutModel.getMaterialId(),materialIdMap));
Map<String,Object> reservoirareaIdMap = new HashMap<>(); // Map<String,Object> reservoirareaIdMap = new HashMap<>();
jg_receiptoutModel.setReservoirareaId(generaterSwapUtil.getPopupSelectValue("392939299932268421","id","areaname",jg_receiptoutModel.getReservoirareaId(),reservoirareaIdMap)); // jg_receiptoutModel.setReservoirareaId(generaterSwapUtil.getPopupSelectValue("392939299932268421","id","areaname",jg_receiptoutModel.getReservoirareaId(),reservoirareaIdMap));
Map<String,Object> warehouseMap = new HashMap<>(); // Map<String,Object> warehouseMap = new HashMap<>();
jg_receiptoutModel.setWarehouseId(generaterSwapUtil.getPopupSelectValue("399117969575232581","id","name",jg_receiptoutModel.getWarehouseId(),warehouseMap)); // jg_receiptoutModel.setWarehouseId(generaterSwapUtil.getPopupSelectValue("399117969575232581","id","name",jg_receiptoutModel.getWarehouseId(),warehouseMap));
} }
} }
vo.setReceiptoutsoitemList(jg_receiptoutModelList); vo.setReceiptoutsoitemList(jg_receiptoutModelList);
@ -781,10 +865,18 @@ public class SaleorderitemController {
//附表数据转换 //附表数据转换
//添加到详情表单对象中 //添加到详情表单对象中
Map<String,Object> contractCodeMap = new HashMap<>(); ContractFileEntity contractFileEntity = contractFileService.getInfo(vo.getContractId());
vo.setContractId(generaterSwapUtil.getPopupSelectValue("391146878474963333","id","contract_name",vo.getContractId(),contractCodeMap)); if (ObjectUtils.isNotEmpty(contractFileEntity) && StringUtils.isNotEmpty(contractFileEntity.getContractName())){
Map<String,Object> costomerCodeMap = new HashMap<>(); vo.setContractId(contractFileEntity.getContractName());
vo.setCustomerId(generaterSwapUtil.getPopupSelectValue("398016916830126469","id","supplier_nm",vo.getCustomerId(),costomerCodeMap)); }
CustomerEntity customerEntity = customerService.getInfo(vo.getCustomerId());
if (ObjectUtils.isNotEmpty(customerEntity) && StringUtils.isNotEmpty(customerEntity.getSupplierNm())){
vo.setCustomerId(customerEntity.getSupplierNm());
}
// Map<String,Object> contractCodeMap = new HashMap<>();
// vo.setContractId(generaterSwapUtil.getPopupSelectValue("391146878474963333","id","contract_name",vo.getContractId(),contractCodeMap));
// Map<String,Object> costomerCodeMap = new HashMap<>();
// vo.setCustomerId(generaterSwapUtil.getPopupSelectValue("398016916830126469","id","supplier_nm",vo.getCustomerId(),costomerCodeMap));
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName())); vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
vo.setCreatorTime(vo.getCreatorTime()); vo.setCreatorTime(vo.getCreatorTime());

@ -151,6 +151,9 @@ public class Salesorder_item0Entity {
@TableField(exist = false) @TableField(exist = false)
private String batchNo; private String batchNo;
@TableField(exist = false)
private String vehicleName;
} }

@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import jnpf.poundlist.entity.PoundlistEntity; import jnpf.poundlist.entity.PoundlistEntity;
import jnpf.poundlist.model.poundlist.PoundlistPagination; import jnpf.poundlist.model.poundlist.PoundlistPagination;
import jnpf.receiptout.entity.Receiptout_item0Entity;
import jnpf.saleorder.entity.SaleorderitemEntity; import jnpf.saleorder.entity.SaleorderitemEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.saleorder.entity.Salesorder_item0Entity;
import jnpf.saleorder.model.saleorderitem.SaleorderitemPagination; import jnpf.saleorder.model.saleorderitem.SaleorderitemPagination;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -23,5 +25,7 @@ import java.util.List;
public interface SaleorderitemMapper extends BaseMapper<SaleorderitemEntity> { public interface SaleorderitemMapper extends BaseMapper<SaleorderitemEntity> {
IPage<SaleorderitemEntity> querySalesOrder(@Param("page") Page<SaleorderitemEntity> page, @Param("saleorderitemPagination") SaleorderitemPagination saleorderitemPagination); IPage<SaleorderitemEntity> querySalesOrder(@Param("page") Page<SaleorderitemEntity> page, @Param("saleorderitemPagination") SaleorderitemPagination saleorderitemPagination);
PoundlistEntity queryPoundlist(String poundlistId); PoundlistEntity queryPoundlist(String poundlistId);
List<Salesorder_item0Entity> querySaleOrderItem(String id);
List<Receiptout_item0Entity> queryReceiptoutItem(String id);
} }

@ -27,6 +27,10 @@ public class Arinvoices_item0soitemModel {
@JsonProperty("invoiceCode") @JsonProperty("invoiceCode")
private String invoiceCode; private String invoiceCode;
/** 金额 **/
@JsonProperty("invoiceQuantity")
private String invoiceQuantity;
/** 金额 **/ /** 金额 **/
@JsonProperty("involceAmount") @JsonProperty("involceAmount")
private String involceAmount; private String involceAmount;
@ -48,9 +52,9 @@ public class Arinvoices_item0soitemModel {
private String invoiceStatus; private String invoiceStatus;
/** 开票日期 **/ /** 开票日期 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("invoiceDate") @JsonProperty("invoiceDate")
private Date invoiceDate; private Long invoiceDate;
/** 开票人 **/ /** 开票人 **/
@JsonProperty("creatorUserName") @JsonProperty("creatorUserName")
private String creatorUserName; private String creatorUserName;

@ -24,9 +24,9 @@ public class CollectionsoitemModel {
private String documentNo; private String documentNo;
/** 收款时间 **/ /** 收款时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("businessDate") @JsonProperty("businessDate")
private Date businessDate; private Long businessDate;
/** 收款金额 **/ /** 收款金额 **/
@JsonProperty("amountCollected") @JsonProperty("amountCollected")
private String amountCollected; private String amountCollected;

@ -24,9 +24,9 @@ public class PaymentsoitemModel {
private String documentno; private String documentno;
/** 付款日期 **/ /** 付款日期 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("duedate") @JsonProperty("duedate")
private Date duedate; private Long duedate;
/** 付款金额 **/ /** 付款金额 **/
@JsonProperty("paymentamount") @JsonProperty("paymentamount")
private String paymentamount; private String paymentamount;

@ -25,9 +25,9 @@ public class ReceiptoutsoitemModel {
private String documentNo; private String documentNo;
/** 出库日期 **/ /** 出库日期 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("issueDate") @JsonProperty("issueDate")
private Date issueDate; private Long issueDate;
/** 车牌号 **/ /** 车牌号 **/
@JsonProperty("vehicleId") @JsonProperty("vehicleId")
private String vehicleId; private String vehicleId;
@ -80,6 +80,15 @@ public class ReceiptoutsoitemModel {
@JsonProperty("poundType") @JsonProperty("poundType")
private String poundType; private String poundType;
@JsonProperty("vehicleName")
private String vehicleName;
@JsonProperty("materialName")
private String materialName;
@JsonProperty("name")
private String name;
@JsonProperty("areaName")
private String areaName;
} }

@ -24,9 +24,9 @@ public class SalesbacksoitemModel {
private String documentNo; private String documentNo;
/** 退货日期 **/ /** 退货日期 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("creatorTime") @JsonProperty("creatorTime")
private Date creatorTime; private Long creatorTime;
/** 退货数量 **/ /** 退货数量 **/
@JsonProperty("refundNum") @JsonProperty("refundNum")
private String refundNum; private String refundNum;

@ -77,5 +77,11 @@ public class Salesorder_item0Model {
@JsonProperty("businessId") @JsonProperty("businessId")
private String businessId; private String businessId;
@JsonProperty("vehicleName")
private String vehicleName;
@JsonProperty("materialName")
private String materialName;
} }

@ -42,6 +42,9 @@ public interface SaleorderitemService extends IService<SaleorderitemEntity> {
List<Receiptout_item0Entity> getReceiptout(String id); List<Receiptout_item0Entity> getReceiptout(String id);
List<Salesorder_item0Entity> querySaleOrderItemInfo(String id);
List<Receiptout_item0Entity> queryReceiptoutItemInfo(String id);
//列表子表数据方法 //列表子表数据方法
} }

@ -560,6 +560,16 @@ public class SaleorderitemServiceImpl extends ServiceImpl<SaleorderitemMapper, S
return receiptout_item0Service.list(queryWrapper); return receiptout_item0Service.list(queryWrapper);
} }
@Override
public List<Salesorder_item0Entity> querySaleOrderItemInfo(String id) {
return saleorderitemMapper.querySaleOrderItem(id);
}
@Override
public List<Receiptout_item0Entity> queryReceiptoutItemInfo(String id) {
return saleorderitemMapper.queryReceiptoutItem(id);
}
//列表子表数据方法 //列表子表数据方法

@ -10,15 +10,15 @@
<select id="queryCollection" resultType="jnpf.collection.entity.CollectionEntity"> <select id="queryCollection" resultType="jnpf.collection.entity.CollectionEntity">
SELECT SELECT
a.*, a.*,
b.supplier_nm customerNm, b.supplier_nm customerNm,
c.contract_name contractNm c.contract_name contractNm
FROM FROM
jg_collection a jg_collection a
LEFT JOIN jg_customer b ON a.customer_id = b.id LEFT JOIN jg_customer b ON a.customer_id = b.id
LEFT JOIN jg_contract c ON a.contract_id = c.id LEFT JOIN jg_contract c ON a.contract_id = c.id
where 1=1 where 1=1
and a.delete_mark = '0' and a.delete_mark = '0' and b.delete_mark = '0' and c.delete_mark = '0'
/*添加权限*/ /*添加权限*/
<if test="collectionPagination.departmentId != null and collectionPagination.departmentId != ''"> <if test="collectionPagination.departmentId != null and collectionPagination.departmentId != ''">
AND a.department_id = #{collectionPagination.departmentId} AND a.department_id = #{collectionPagination.departmentId}

@ -12,7 +12,7 @@
LEFT JOIN jg_customer b on a.customer_id = b.id LEFT JOIN jg_customer b on a.customer_id = b.id
LEFT JOIN jg_salesorder c on a.source_no = c.id LEFT JOIN jg_salesorder c on a.source_no = c.id
where 1=1 where 1=1
and a.delete_mark = '0' and a.delete_mark = '0' and b.delete_mark = '0' and c.delete_mark = '0'
/*添加权限*/ /*添加权限*/
<if test="receiptoutPagination.departmentId != null and receiptoutPagination.departmentId != ''"> <if test="receiptoutPagination.departmentId != null and receiptoutPagination.departmentId != ''">
AND a.department_id = #{receiptoutPagination.departmentId} AND a.department_id = #{receiptoutPagination.departmentId}
@ -20,7 +20,6 @@
<if test="receiptoutPagination.orgnizeId != null and receiptoutPagination.orgnizeId != ''"> <if test="receiptoutPagination.orgnizeId != null and receiptoutPagination.orgnizeId != ''">
AND a.orgnize_id = #{receiptoutPagination.orgnizeId} AND a.orgnize_id = #{receiptoutPagination.orgnizeId}
</if> </if>
<if test="receiptoutPagination.documentNo != null and receiptoutPagination.documentNo != ''"> <if test="receiptoutPagination.documentNo != null and receiptoutPagination.documentNo != ''">
and a.document_no LIKE CONCAT('%',#{receiptoutPagination.documentNo},'%') and a.document_no LIKE CONCAT('%',#{receiptoutPagination.documentNo},'%')
</if> </if>

@ -13,7 +13,7 @@
LEFT JOIN jg_contract c on b.contract_id = c.id LEFT JOIN jg_contract c on b.contract_id = c.id
LEFT JOIN jg_customer d on b.customer_id = d.id LEFT JOIN jg_customer d on b.customer_id = d.id
where 1 = 1 where 1 = 1
and a.delete_mark = '0' and a.delete_mark = '0' and b.delete_mark = '0' and c.delete_mark = '0' and d.delete_mark = '0'
/*添加权限*/ /*添加权限*/
<if test="salebackPagination.departmentId != null and salebackPagination.departmentId != ''"> <if test="salebackPagination.departmentId != null and salebackPagination.departmentId != ''">
AND a.department_id = #{salebackPagination.departmentId} AND a.department_id = #{salebackPagination.departmentId}
@ -61,8 +61,8 @@ FROM
LEFT JOIN jg_material e ON c.material_id = e.id LEFT JOIN jg_material e ON c.material_id = e.id
LEFT JOIN base_user f ON c.business_id = f.F_Id LEFT JOIN base_user f ON c.business_id = f.F_Id
LEFT JOIN jg_customer g ON c.customer_id = g.id LEFT JOIN jg_customer g ON c.customer_id = g.id
WHERE WHERE a.delete_mark = '0' and b.delete_mark = '0' and c.delete_mark = '0' and d.delete_mark = '0' and e.delete_mark = '0' and g.delete_mark = '0'
a.sales_back_id = #{id} and a.sales_back_id = #{id}
and a.delete_mark = '0' and a.delete_mark = '0'
</select> </select>
</mapper> </mapper>

@ -12,7 +12,7 @@
left join jg_contract b on a.contract_id = b.id left join jg_contract b on a.contract_id = b.id
left join jg_customer c on a.customer_id = c.id left join jg_customer c on a.customer_id = c.id
where 1=1 where 1=1
and a.delete_mark = '0' and a.delete_mark = '0' and b.delete_mark = '0' and c.delete_mark = '0'
/*添加权限*/ /*添加权限*/
<if test="saleorderitemPagination.departmentId != null and saleorderitemPagination.departmentId != ''"> <if test="saleorderitemPagination.departmentId != null and saleorderitemPagination.departmentId != ''">
AND a.department_id = #{saleorderitemPagination.departmentId} AND a.department_id = #{saleorderitemPagination.departmentId}
@ -63,8 +63,38 @@ FROM
LEFT JOIN jg_contract g ON a.purchase_id = g.id LEFT JOIN jg_contract g ON a.purchase_id = g.id
LEFT JOIN base_user h ON a.business_id = h.f_id LEFT JOIN base_user h ON a.business_id = h.f_id
LEFT JOIN jg_natural i ON a.natural_id = i.id LEFT JOIN jg_natural i ON a.natural_id = i.id
where a.delete_mark = '0' where a.delete_mark = '0' and b.delete_mark = '0' and c.delete_mark = '0' and d.delete_mark = '0' and e.delete_mark = '0' and f.delete_mark = '0' and g.delete_mark = '0' and i.delete_mark = '0'
and a.id = #{poundlistId} and a.id = #{poundlistId}
</select> </select>
<select id="querySaleOrderItem" resultType="jnpf.saleorder.entity.Salesorder_item0Entity">
SELECT
a.*,
b.ticketno vehicleName,
c.item_name materialName
FROM
jg_salesorder_item0 a
LEFT JOIN jg_vehicle b ON a.vehicle_id = b.id
LEFT JOIN jg_material c ON a.material_id = c.id
WHERE a.delete_mark = '0' and b.delete_mark = '0' and c.delete_mark = '0'
and a.sales_order_id = #{id}
</select>
<select id="queryReceiptoutItem" resultType="jnpf.receiptout.entity.Receiptout_item0Entity">
SELECT
a.*,
b.ticketno vehicleName,
c.item_name materialName,
d.name,
e.areaname areaName
FROM
jg_receiptout_item0 a
LEFT JOIN jg_vehicle b ON a.vehicle_id = b.id
LEFT JOIN jg_material c ON a.material_id = c.id
LEFT JOIN jg_warehouse d ON a.warehouse_id = d.id
LEFT JOIN jg_reservoirarea e ON a.reservoirarea_id = e.id
WHERE a.delete_mark = '0' and b.delete_mark = '0' and c.delete_mark = '0' and d.delete_mark = '0' and e.delete_mark = '0'
and a.receiptin_id = #{id}
</select>
</mapper> </mapper>

@ -1,83 +1,118 @@
<template> <template>
<el-dialog title="详情" <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="1000px"> width="1500px">
<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" :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" >
<p>{{dataForm.documentNo}}</p> <el-input v-model="dataForm.documentNo"
placeholder="系统自动生成" readonly >
</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" > prop="businessDate" >
<p>{{jnpf.dateFormat(dataForm.businessDate)}}</p> <el-date-picker v-model="dataForm.businessDate"
</el-form-item> placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" disabled>
</el-col>
<el-col :span="8" > </el-date-picker>
<el-form-item label="金额"
prop="amount" >
<p>{{dataForm.amount}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="数量"
prop="quantity" >
<p>{{dataForm.quantity}}</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="备注"
prop="remark" >
<p>{{dataForm.remark}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="单据状态 "
prop="status" >
<p>{{ dataForm.status | dynamicText(statusOptions) }} </p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="发票金额"
prop="invoiceAmount" >
<p>{{dataForm.invoiceAmount}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="发票数量"
prop="invoiceQuantity" >
<p>{{dataForm.invoiceQuantity}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="销售订单号"
prop="salesOrderId" >
<p>{{dataForm.salesOrderId}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="合同名称"
prop="contractId" >
<p>{{dataForm.contractId}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="客户"
prop="customerId" >
<p>{{dataForm.customerId}}</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" >
<el-form-item label="币别 "
prop="currency" >
<el-select v-model="dataForm.currency"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in currencyOptions" :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="amount" >
<el-input-number v-model="dataForm.amount"
placeholder="数字文本" :step="1" :style='{"width":"100%"}' disabled>
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="数量"
prop="quantity" >
<el-input-number v-model="dataForm.quantity"
placeholder="数字文本" :step="1" :style='{"width":"100%"}' disabled>
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="合同名称"
prop="contractId" >
<popupSelect v-model="dataForm.contractId"
placeholder="请选择" clearable field="contractId" interfaceId="398361758806411909" :columnOptions="contractIdcolumnOptions" propsValue="id" relationField="contract_name" popupType="dialog"
popupTitle="选择数据" popupWidth="800px" disabled
>
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="发票金额"
prop="invoiceAmount" >
<el-input-number v-model="dataForm.invoiceAmount"
placeholder="数字文本" :step="1" :style='{"width":"100%"}' disabled>
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="发票数量"
prop="invoiceQuantity" >
<el-input-number v-model="dataForm.invoiceQuantity"
placeholder="数字文本" :step="1" :style='{"width":"100%"}' disabled>
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="来源单号"
prop="salesOrderId" >
<popupSelect v-model="dataForm.salesOrderId"
placeholder="请选择" clearable field="salesOrderId" interfaceId="400235058386036741" :columnOptions="salesOrderIdcolumnOptions" propsValue="id" relationField="document_no" popupType="dialog"
popupTitle="选择数据" popupWidth="800px" disabled
>
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="客户"
prop="customerId" >
<popupSelect v-model="dataForm.customerId"
placeholder="请选择" clearable field="customerId" interfaceId="398362084892576389" :columnOptions="customerIdcolumnOptions" propsValue="id" relationField="supplier_nm" popupType="dialog"
popupTitle="选择数据" popupWidth="800px" disabled
>
</popupSelect>
</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%"}' disabled>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24"> <el-col :span="24">
<el-tabs v-model="activezbtwpv" tab-position="top" class="mb-20"> <el-tabs v-model="activezbtwpv" tab-position="top" class="mb-20">
<el-tab-pane label="应收明细"> <el-tab-pane label="应收明细">
@ -86,54 +121,84 @@
<div class="JNPF-common-title"> <div class="JNPF-common-title">
<h2></h2> <h2></h2>
</div> </div>
<el-table :data="dataForm.arinvoices_item1List" size='mini' > <el-table :data="dataForm.arinvoices_item1List" size='mini' show-summary :summary-method="getSummaries">
<el-table-column type="index" width="50" label="序号" align="center" /> <el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="materialId" label="物料"> <el-table-column prop="materialId" label="物料" align="center" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.materialId}}</p> <popupSelect v-model="scope.row.materialId"
</template> placeholder="请选择" clearable :field="'materialId'+scope.$index" interfaceId="397736371898382533" :columnOptions="arinvoices_item1materialIdcolumnOptions" propsValue="id" relationField="item_name" popupType="dialog"
popupWidth="800px" disabled
>
</popupSelect>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="quantity" label="数量"> <el-table-column prop="quantity" label="数量" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.quantity}}</p> <el-input v-model="scope.row.quantity"
</template> placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="unitPrice" label="单价"> <el-table-column prop="unitPrice" label="单价" align="center" width="130">
<template slot-scope="scope">
<p>{{scope.row.unitPrice}}</p>
</template>
</el-table-column>
<el-table-column prop="unit" label="单位">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.unit | dynamicText(unitOptions) }}</p> <el-input v-model="scope.row.unitPrice"
</template> placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="amount" label="金额"> <el-table-column prop="unit" label="单位" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.amount}}</p> <el-select v-model="scope.row.unit"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</template> </template>
</el-table-column>
<el-table-column prop="amount" label="金额" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.amount"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="taxRate" label="税率 "> <el-table-column prop="taxRate" label="税率 " align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{ scope.row.taxRate | dynamicText(taxRateOptions) }}</p> <el-select v-model="scope.row.taxRate"
</template> placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<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>
<el-table-column prop="taxAmount" label="税额"> <el-table-column prop="taxAmount" label="税额" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.taxAmount}}</p> <el-input v-model="scope.row.taxAmount"
</template> placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="amountNotTax" label="不含税金额"> <el-table-column prop="amountNotTax" label="不含税金额" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.amountNotTax}}</p> <el-input v-model="scope.row.amountNotTax"
</template> placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="备注信息"> <el-table-column prop="remark" label="备注信息" align="center" width="250">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.remark}}</p> <el-input v-model="scope.row.remark"
</template> placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="操作" width="50" >-->
<!-- <template slot-scope="scope">-->
<!-- <el-button size="mini" type="text" class="JNPF-table-delBtn" @click="delarinvoices_item1List(scope.$index)"></el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table> </el-table>
<!-- <div class="table-actions" @click="addarinvoices_item1List()">-->
<!-- <el-button type="text" icon="el-icon-plus">添加</el-button>-->
<!-- </div>-->
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-tab-pane > </el-tab-pane >
@ -143,67 +208,96 @@
<div class="JNPF-common-title"> <div class="JNPF-common-title">
<h2></h2> <h2></h2>
</div> </div>
<el-table :data="dataForm.arinvoices_item0List" size='mini' > <el-table :data="dataForm.arinvoices_item0List" size='mini' show-summary :summary-method="getSummaries2" >
<el-table-column type="index" width="50" label="序号" align="center" /> <el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="invoiceCode" label="发票代码"> <el-table-column prop="invoiceCode" label="发票代码" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.invoiceCode}}</p> <el-input v-model="scope.row.invoiceCode"
</template> placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="invoiceNo" label="发票号码"> <el-table-column prop="invoiceNo" label="发票号码" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.invoiceNo}}</p> <el-input v-model="scope.row.invoiceNo"
</template> placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="invoiceQuantity" label="发票数量"> <el-table-column prop="invoiceQuantity" label="发票数量" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.invoiceQuantity}}</p> <el-input v-model="scope.row.invoiceQuantity"
</template> placeholder="请输入" clearable :style='{"width":"100%"}' @change="invoiceQuantitySum" disabled>
</el-input>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="involceAmount" label="发票金额"> <el-table-column prop="involceAmount" label="发票金额" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.involceAmount}}</p> <el-input v-model="scope.row.involceAmount"
</template> placeholder="请输入" clearable :style='{"width":"100%"}' @change="involceAmountSum" disabled>
</el-input>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="taxRate" label="税率 "> <el-table-column prop="taxRate" label="税率 " align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{ scope.row.taxRate | dynamicText(taxRateOptions) }}</p> <el-select v-model="scope.row.taxRate"
</template> placeholder="请选择" clearable :style='{"width":"100%"}' @change="rateCompute" disabled>
<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>
<el-table-column prop="taxAmount" label="税额"> <el-table-column prop="taxAmount" label="税额" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.taxAmount}}</p> <el-input v-model="scope.row.taxAmount"
</template> placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="amountNotTax" label="不含税金额"> <el-table-column prop="amountNotTax" label="不含税金额" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.amountNotTax}}</p> <el-input v-model="scope.row.amountNotTax"
</template> placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="invoiceStatus" label="发票状态"> <el-table-column prop="invoiceStatus" label="发票状态" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{ scope.row.invoiceStatus | dynamicText(invoiceStatusOptions) }}</p> <el-select v-model="scope.row.invoiceStatus"
</template> placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in invoiceStatusOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="creatorUserName" label="开票人"> <el-table-column prop="creatorUserName" label="开票人" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.creatorUserName}}</p> <el-input v-model="scope.row.creatorUserName"
</template> placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="invoiceDate" label="开票日期"> <el-table-column prop="invoiceDate" label="开票日期" align="center" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{jnpf.dateFormat(scope.row.invoiceDate)}}</p> <el-date-picker v-model="scope.row.invoiceDate"
</template> placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" disabled>
</el-date-picker>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="attachMent" label="发票附件"> <el-table-column prop="attachMent" label="发票附件" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<JNPF-UploadFz v-model="scope.row.attachMent" <JNPF-UploadFz v-model="scope.row.attachMent"
disabled :fileSize="100" sizeUnit="MB" :limit="5" buttonText="点击上传" disabled >
detailed :fileSize="100" sizeUnit="MB" :limit="5" buttonText="点击上传" >
</JNPF-UploadFz> </JNPF-UploadFz>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="操作" width="50" >
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn" @click="delarinvoices_item0List(scope.$index)"></el-button>
</template>
</el-table-column> -->
</el-table> </el-table>
<!-- <div class="table-actions" @click="addarinvoices_item0List()">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-tab-pane > </el-tab-pane >
@ -213,25 +307,27 @@
</el-form> </el-form>
</el-row> </el-row>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<!-- <el-button type="primary" icon="el-icon-upload2" @click="uploadForm"></el-button> -->
<el-button @click="visible = false"> </el-button> <el-button @click="visible = false"> </el-button>
<!-- <el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> </el-button> -->
</span> </span>
<ImportForm v-if="importFormVisible" ref="importForm" @importData="importData" />
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import PrintBrowse from '@/components/PrintBrowse' import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import jnpf from '@/utils/jnpf' import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import ImportForm from '../saleorder/ImportForm'
export default { export default {
components: {PrintBrowse}, components: { ImportForm },
props: [], props: [],
data() { data() {
return { return {
visible: false, visible: false,
loading: false, loading: false,
printBrowseVisible: false, isDetail: false,
printId: '',
dataForm: { dataForm: {
id :'',
documentNo : '', documentNo : '',
businessDate : '', businessDate : '',
amount : 0, amount : 0,
@ -248,51 +344,295 @@
arinvoices_item0List:[], arinvoices_item0List:[],
}, },
activezbtwpv:'0', activezbtwpv:'0',
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}], rules:
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}], {
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}], },
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"}], currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
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"}], statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}],
invoiceStatusOptions:[{"fullName":"正常","id":"0"},{"fullName":"红冲","id":"1"},{"fullName":"作废","id":"2"}], salesOrderIdcolumnOptions:[ {"label":"销售订单号","value":"document_no"}, {"label":"合同","value":"contractName"}, {"label":"客户名称","value":"supplier_nm"}, {"label":"金额","value":"price"}, {"label":"数量","value":"num"},],
contractIdcolumnOptions:[ {"label":"合同编码","value":"contract_code"}, {"label":"合同名称","value":"contract_name"},],
customerIdcolumnOptions:[ {"label":"客户编码","value":"supplier_cd"}, {"label":"客户名称","value":"supplier_nm"}, {"label":"地址","value":"address"},],
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
arinvoices_item1materialIdcolumnOptions:[ {"label":"物料编码","value":"item_code"}, {"label":"物料名称","value":"item_name"}, {"label":"单位","value":"primary_unit_of_measure"}, {"label":"可采购","value":"purchase_flag_name"}, {"label":"可销售","value":"sales_flag_name"},],
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"}],
invoiceStatusOptions:[{"fullName":"正常","id":"0"},{"fullName":"红冲","id":"1"},{"fullName":"作废","id":"2"}],
} }
}, },
computed: {}, computed: {},
watch: {}, watch: {},
created() { created() {
}, },
mounted() {}, mounted() {},
methods: { methods: {
dataInfo(dataAll){ invoiceQuantitySum(){
let _dataAll =dataAll let sum = 0;
for(let i=0;i<_dataAll.arinvoices_item1List.length;i++){ for (let i =0;i<this.dataForm.arinvoices_item0List.length;i++){
var _list = _dataAll.arinvoices_item1List[i]; sum = this.jnpf.floatAdd(sum,this.dataForm.arinvoices_item0List[i].invoiceQuantity)
}
this.dataForm.invoiceQuantity = sum
},
involceAmountSum(){
let sum = 0;
for (let i =0;i<this.dataForm.arinvoices_item0List.length;i++){
if(this.dataForm.arinvoices_item0List[i].taxRate){
this.taxRateOptions.find((item) => {
if (this.dataForm.arinvoices_item0List[i].taxRate == item.id) {
debugger
// this.dataForm.arinvoices_item0List[i].taxAmount = this.jnpf.floatDiv(this.jnpf.floatMul(this.dataForm.arinvoices_item0List[i].involceAmount,item.fullName),100)
this.dataForm.arinvoices_item0List[i].taxAmount = this.dataForm.arinvoices_item0List[i].involceAmount*item.fullName/100
debugger
this.dataForm.arinvoices_item0List[i].amountNotTax = this.jnpf.floatSub(this.dataForm.arinvoices_item0List[i].involceAmount, this.dataForm.arinvoices_item0List[i].taxAmount)
} }
for(let i=0;i<_dataAll.arinvoices_item0List.length;i++){ })
var _list = _dataAll.arinvoices_item0List[i]; }
_list.invoiceDate = _list.invoiceDate ? jnpf.dateFormat(_list.invoiceDate) : '' sum = this.jnpf.floatAdd(sum,this.dataForm.arinvoices_item0List[i].involceAmount)
_list.attachMent = _list.attachMent? JSON.parse(_list.attachMent):[] }
this.dataForm.invoiceAmount = sum
},
rateCompute(){
debugger
for (let i = 0;i<this.dataForm.arinvoices_item0List.length;i++) {
this.taxRateOptions.find((item) => {
if (this.dataForm.arinvoices_item0List[i].taxRate == item.id) {
this.dataForm.arinvoices_item0List[i].taxAmount = this.jnpf.floatDiv(this.jnpf.floatMul(this.dataForm.arinvoices_item0List[i].involceAmount,item.fullName),100)
this.dataForm.arinvoices_item0List[i].amountNotTax = this.jnpf.floatSub(this.dataForm.arinvoices_item0List[i].involceAmount, this.dataForm.arinvoices_item0List[i].taxAmount)
} }
this.dataForm = _dataAll })
}
},
importData(param){
param.checkedList.forEach((column, index) => {
if(column.taxRate == '0.13'){
column.taxRate = '0';
}else if(column.taxRate == '0.09'){
column.taxRate = '1';
}else if(column.taxRate == '0.06'){
column.taxRate = '2';
}else if(column.taxRate == '0.05'){
column.taxRate = '3';
}else if(column.taxRate == '0.03'){
column.taxRate = '4';
}else if(column.taxRate == '0'){
column.taxRate = '5';
}
this.dataForm.invoicesitem0List.push(column);
});
},
uploadForm() {
this.importFormVisible = true
this.$nextTick(() => {
this.$refs.importForm.init()
})
},
getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value)) && (index === 2 || index === 3 || index === 5 || index === 7 || index === 8)) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return this.jnpf.floatAdd(prev, curr);
} else {
return prev;
}
}, 0);
} else {
sums[index] = '';
}
});
return sums;
},
getSummaries2(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value)) && (index === 3 || index === 4 || index === 6 || index === 7 )) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return this.jnpf.floatAdd(prev, curr);
} else {
return prev;
}
}, 0);
} else {
sums[index] = '';
}
});
return sums;
},
arinvoices_item1Exist() {
let isOk = true;
for(let i=0;i<this.dataForm.arinvoices_item1List.length;i++){
const e = this.dataForm.arinvoices_item1List[i];
}
return isOk;
},
arinvoices_item0Exist() {
let isOk = true;
for(let i=0;i<this.dataForm.arinvoices_item0List.length;i++){
const e = this.dataForm.arinvoices_item0List[i];
}
return isOk;
},
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] = "";
}
}
let param = {
"param" : 'arinvoices'
}
request({
url: '/api/collection/Collection/autoSerialNum',
method: 'get',
data: param
}).then(res => {
this.dataForm.documentNo = res.msg
this.loading = false
});
}, },
init(id, isDetail) {
init(id) {
this.dataForm.id = id || 0; this.dataForm.id = id || 0;
this.visible = true; this.visible = true;
this.isDetail = isDetail || false;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['elForm'].resetFields();
if(this.dataForm.id){ if(this.dataForm.id){
this.loading = true this.loading = true
request({ request({
url: '/api/arinvoices/Arinvoices/detail/'+this.dataForm.id, url: '/api/arinvoices/Arinvoices/'+this.dataForm.id,
method: 'get' method: 'get'
}).then(res => { }).then(res => {
this.dataInfo(res.data) this.dataInfo(res.data)
this.loading = false this.loading = false
}) });
}else{
this.clearData(this.dataForm)
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
dataFormSubmit() {
this.$refs['elForm'].validate((valid) => {
if (valid) {
if (!this.arinvoices_item1Exist()) return
if (!this.arinvoices_item0Exist()) return
this.request()
} }
}) })
}, },
request() {
var _data =this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/arinvoices/Arinvoices',
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/arinvoices/Arinvoices/'+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)
}
})
})
}
},
addarinvoices_item1List(){
let item = {
materialId:undefined,
quantity:undefined,
unitPrice:undefined,
amount:undefined,
taxRate:undefined,
taxAmount:undefined,
amountNotTax:undefined,
remark:undefined,
}
this.dataForm.arinvoices_item1List.push(item)
},
delarinvoices_item1List(index) {
this.dataForm.arinvoices_item1List.splice(index, 1);
},
addarinvoices_item0List(){
let item = {
invoiceCode:undefined,
invoiceNo:undefined,
invoiceQuantity:undefined,
involceAmount:undefined,
taxRate:undefined,
taxAmount:undefined,
amountNotTax:undefined,
invoiceStatus:undefined,
creatorUserName:undefined,
invoiceDate:undefined,
attachMent:undefined,
}
this.dataForm.arinvoices_item0List.push(item)
},
delarinvoices_item0List(index) {
this.dataForm.arinvoices_item0List.splice(index, 1);
},
dataList(){
var _data = JSON.parse(JSON.stringify(this.dataForm));
for(let i=0;i<_data.arinvoices_item1List.length;i++){
var _list = _data.arinvoices_item1List[i];
}
for(let i=0;i<_data.arinvoices_item0List.length;i++){
var _list = _data.arinvoices_item0List[i];
_list.attachMent = JSON.stringify(_list.attachMent)
}
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
for(let i=0;i<_dataAll.arinvoices_item1List.length;i++){
var _list = _dataAll.arinvoices_item1List[i];
}
for(let i=0;i<_dataAll.arinvoices_item0List.length;i++){
var _list = _dataAll.arinvoices_item0List[i];
_list.attachMent = JSON.parse(_list.attachMent)
}
this.dataForm = _dataAll
},
}, },
} }

@ -127,7 +127,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<popupSelect v-model="scope.row.materialId" <popupSelect v-model="scope.row.materialId"
placeholder="请选择" clearable :field="'materialId'+scope.$index" interfaceId="397736371898382533" :columnOptions="arinvoices_item1materialIdcolumnOptions" propsValue="id" relationField="item_name" popupType="dialog" placeholder="请选择" clearable :field="'materialId'+scope.$index" interfaceId="397736371898382533" :columnOptions="arinvoices_item1materialIdcolumnOptions" propsValue="id" relationField="item_name" popupType="dialog"
popupWidth="800px" popupWidth="800px" disabled
> >
</popupSelect> </popupSelect>
</template> </template>
@ -135,21 +135,21 @@
<el-table-column prop="quantity" label="数量" align="center" width="130"> <el-table-column prop="quantity" label="数量" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.quantity" <el-input v-model="scope.row.quantity"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="unitPrice" label="单价" align="center" width="130"> <el-table-column prop="unitPrice" label="单价" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.unitPrice" <el-input v-model="scope.row.unitPrice"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="unit" label="单位" align="center" width="130"> <el-table-column prop="unit" label="单位" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.unit" <el-select v-model="scope.row.unit"
placeholder="请选择" clearable :style='{"width":"100%"}'> placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> <el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select> </el-select>
</template> </template>
@ -157,14 +157,14 @@
<el-table-column prop="amount" label="金额" align="center" width="130"> <el-table-column prop="amount" label="金额" align="center" width="130">
<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":"100%"}' disabled>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="taxRate" label="税率 " align="center" width="130"> <el-table-column prop="taxRate" label="税率 " align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.taxRate" <el-select v-model="scope.row.taxRate"
placeholder="请选择" clearable :style='{"width":"100%"}'> placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in taxRateOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> <el-option v-for="(item, index) in taxRateOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select> </el-select>
</template> </template>
@ -172,21 +172,21 @@
<el-table-column prop="taxAmount" label="税额" align="center" width="130"> <el-table-column prop="taxAmount" label="税额" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.taxAmount" <el-input v-model="scope.row.taxAmount"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="amountNotTax" label="不含税金额" align="center" width="130"> <el-table-column prop="amountNotTax" label="不含税金额" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.amountNotTax" <el-input v-model="scope.row.amountNotTax"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="备注信息" align="center" width="250"> <el-table-column prop="remark" label="备注信息" align="center" width="250">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.remark" <el-input v-model="scope.row.remark"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
@ -210,7 +210,7 @@
</div> </div>
<el-table :data="dataForm.arinvoices_item0List" size='mini' show-summary :summary-method="getSummaries2" > <el-table :data="dataForm.arinvoices_item0List" size='mini' show-summary :summary-method="getSummaries2" >
<el-table-column type="index" width="50" label="序号" align="center" /> <el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="invoiceCode" label="发票代码"> <el-table-column prop="invoiceCode" label="发票代码" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.invoiceCode" <el-input v-model="scope.row.invoiceCode"
placeholder="请输入" clearable :style='{"width":"100%"}'> placeholder="请输入" clearable :style='{"width":"100%"}'>
@ -241,7 +241,7 @@
<el-table-column prop="taxRate" label="税率 " align="center" width="130"> <el-table-column prop="taxRate" label="税率 " align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.taxRate" <el-select v-model="scope.row.taxRate"
placeholder="请选择" clearable :style='{"width":"100%"}'> placeholder="请选择" clearable :style='{"width":"100%"}' @change="rateCompute">
<el-option v-for="(item, index) in taxRateOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option> <el-option v-for="(item, index) in taxRateOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select> </el-select>
</template> </template>
@ -275,14 +275,14 @@
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="invoiceDate" label="开票日期" align="center" width="130"> <el-table-column prop="invoiceDate" label="开票日期" align="center" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker v-model="scope.row.invoiceDate" <el-date-picker v-model="scope.row.invoiceDate"
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" > placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" >
</el-date-picker> </el-date-picker>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="attachMent" label="发票附件" width="130"> <el-table-column prop="attachMent" label="发票附件" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<JNPF-UploadFz v-model="scope.row.attachMent" <JNPF-UploadFz v-model="scope.row.attachMent"
:fileSize="100" sizeUnit="MB" :limit="5" buttonText="点击上传" > :fileSize="100" sizeUnit="MB" :limit="5" buttonText="点击上传" >
@ -375,10 +375,32 @@
involceAmountSum(){ involceAmountSum(){
let sum = 0; let sum = 0;
for (let i =0;i<this.dataForm.arinvoices_item0List.length;i++){ for (let i =0;i<this.dataForm.arinvoices_item0List.length;i++){
if(this.dataForm.arinvoices_item0List[i].taxRate){
this.taxRateOptions.find((item) => {
if (this.dataForm.arinvoices_item0List[i].taxRate == item.id) {
debugger
// this.dataForm.arinvoices_item0List[i].taxAmount = this.jnpf.floatDiv(this.jnpf.floatMul(this.dataForm.arinvoices_item0List[i].involceAmount,item.fullName),100)
this.dataForm.arinvoices_item0List[i].taxAmount = this.dataForm.arinvoices_item0List[i].involceAmount*item.fullName/100
debugger
this.dataForm.arinvoices_item0List[i].amountNotTax = this.jnpf.floatSub(this.dataForm.arinvoices_item0List[i].involceAmount, this.dataForm.arinvoices_item0List[i].taxAmount)
}
})
}
sum = this.jnpf.floatAdd(sum,this.dataForm.arinvoices_item0List[i].involceAmount) sum = this.jnpf.floatAdd(sum,this.dataForm.arinvoices_item0List[i].involceAmount)
} }
this.dataForm.invoiceAmount = sum this.dataForm.invoiceAmount = sum
}, },
rateCompute(){
debugger
for (let i = 0;i<this.dataForm.arinvoices_item0List.length;i++) {
this.taxRateOptions.find((item) => {
if (this.dataForm.arinvoices_item0List[i].taxRate == item.id) {
this.dataForm.arinvoices_item0List[i].taxAmount = this.jnpf.floatDiv(this.jnpf.floatMul(this.dataForm.arinvoices_item0List[i].involceAmount,item.fullName),100)
this.dataForm.arinvoices_item0List[i].amountNotTax = this.jnpf.floatSub(this.dataForm.arinvoices_item0List[i].involceAmount, this.dataForm.arinvoices_item0List[i].taxAmount)
}
})
}
},
importData(param){ importData(param){
param.checkedList.forEach((column, index) => { param.checkedList.forEach((column, index) => {
if(column.taxRate == '0.13'){ if(column.taxRate == '0.13'){

@ -9,6 +9,7 @@
<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>
<template v-if="showAll">
<el-col :span="6"> <el-col :span="6">
<el-form-item label="来源单号"> <el-form-item label="来源单号">
<el-input v-model="query.sourceOrderNo" placeholder="请输入" clearable> </el-input> <el-input v-model="query.sourceOrderNo" placeholder="请输入" clearable> </el-input>
@ -32,10 +33,15 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</template>
<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-button type="text" icon="el-icon-arrow-down" @click="showAll=true"
v-if="!showAll">展开</el-button>
<el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>
收起</el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
@ -47,8 +53,8 @@
<!-- </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">
@ -97,8 +103,8 @@ width="150" >
<el-button type="text" <el-button type="text"
@click="addOrUpdateHandle(scope.row.id)" >编辑 @click="addOrUpdateHandle(scope.row.id)" >编辑
</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>
@ -126,6 +132,7 @@ width="150" >
components: {JNPFForm, ExportBox,Detail}, components: {JNPFForm, ExportBox,Detail},
data() { data() {
return { return {
showAll: false,
detailVisible: false, detailVisible: false,
query: { query: {
documentNo:undefined, documentNo:undefined,

@ -1,246 +1,678 @@
<template> <template>
<el-dialog title="详情" <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 width="1500px">
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll <el-row :gutter="15" class="">
width="1000px"> <el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
<el-row :gutter="15" class=""> <template v-if="!loading">
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" > <el-col :span="8">
<template v-if="!loading"> <el-form-item label="单据编号" prop="documentNo">
<el-col :span="8" > <el-input v-model="dataForm.documentNo" placeholder="系统自动生成" readonly>
<el-form-item label="单据编号"
prop="documentNo" > </el-input>
<p>{{dataForm.documentNo}}</p> </el-form-item>
</el-form-item> </el-col>
</el-col> <el-col :span="8">
<el-col :span="8" > <el-form-item label="客户名称" prop="customerId">
<el-form-item label="客户名称" <popupSelect v-model="dataForm.customerId" placeholder="请选择" clearable field="customerId"
prop="customerId" > interfaceId="393371066040385285" :columnOptions="customerNamecolumnOptions" propsValue="id"
<p>{{dataForm.customerId}}</p> relationField="supplier_nm" popupType="dialog" popupTitle="选择数据" popupWidth="800px"
</el-form-item> @change="popupSelect" disabled>
</el-col> </popupSelect>
<el-col :span="8" > </el-form-item>
<el-form-item label="合同名称" </el-col>
prop="contractId" >
<p>{{dataForm.contractId}}</p> <el-col :span="8">
</el-form-item> <el-form-item label="合同名称" prop="contractId">
</el-col> <popupSelect v-model="dataForm.contractId" placeholder="请选择" clearable field="contractId"
<el-col :span="8" > interfaceId="399835312982972805" :bissId="dataForm.customerId" :columnOptions="contractNamecolumnOptions" propsValue="id"
<el-form-item label="收款金额" relationField="contract_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" @change="contractSelect" disabled
prop="amountCollected" > >
<p>{{dataForm.amountCollected}}</p> </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="collectionCount" > <el-input v-model="dataForm.amountCollected" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
<p>{{dataForm.collectionCount}}</p>
</el-form-item> </el-input>
</el-col> </el-form-item>
<el-col :span="8" > </el-col>
<el-form-item label="收款银行" <el-col :span="8">
prop="collectionBank" > <el-form-item label="收款账户" prop="collectionCount">
<p>{{dataForm.collectionBank}}</p> <el-input v-model="dataForm.collectionCount" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-form-item>
</el-col> </el-input>
<el-col :span="8" > </el-form-item>
<el-form-item label="收款类型 " </el-col>
prop="paymentType" > <el-col :span="8">
<p>{{ dataForm.paymentType | dynamicText(paymentTypeOptions) }} </p> <el-form-item label="收款银行" prop="collectionBank">
</el-form-item> <el-input v-model="dataForm.collectionBank" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-col>
<el-col :span="8" > </el-input>
<el-form-item label="币别 " </el-form-item>
prop="currency" > </el-col>
<p>{{ dataForm.currency | dynamicText(currencyOptions) }} </p> <el-col :span="8">
</el-form-item> <el-form-item label="收款类型 " prop="paymentType">
</el-col> <el-select v-model="paymentType" placeholder="请选择" clearable :style='{"width":"100%"}' @change="paymentTypeChange" disabled>
<el-col :span="8" > <el-option v-for="(item, index) in paymentTypeOptions" :key="index" :label="item.fullName"
<el-form-item label="结算类型" :value="item.id" :disabled="item.disabled" ></el-option>
prop="settlementType" >
<p>{{ dataForm.settlementType | dynamicText(settlementTypeOptions) }} </p> </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="remark" > <el-select v-model="currency" placeholder="请选择" clearable :style='{"width":"100%"}' @change="currencyChange" disabled>
<p>{{dataForm.remark}}</p> <el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id"
</el-form-item> :disabled="item.disabled"></el-option>
</el-col>
<el-col :span="8" > </el-select>
<el-form-item label="收款凭证" </el-form-item>
prop="voucher" > </el-col>
<JNPF-UploadFz v-model="dataForm.voucher" <el-col :span="8">
disabled <el-form-item label="结算类型" prop="settlementType">
detailed :fileSize="5" sizeUnit="MB" :limit="9" buttonText="点击上传" > <el-select v-model="settlementType" placeholder="请选择" clearable :style='{"width":"100%"}' @change="settlementTypeChange" disabled>
</JNPF-UploadFz> <el-option v-for="(item, index) in settlementTypeOptions" :key="index" :label="item.fullName"
</el-form-item> :value="item.id" :disabled="item.disabled"></el-option>
</el-col>
<el-col :span="8" > </el-select>
<el-form-item label="单据状态 " </el-form-item>
prop="status" > </el-col>
<p>{{ dataForm.status | dynamicText(statusOptions) }} </p> <el-col :span="8">
</el-form-item> <el-form-item label="备注信息" prop="remark">
</el-col> <el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
<el-col :span="8" >
<el-form-item label="制单人" </el-input>
prop="creatorUserName" > </el-form-item>
<p>{{dataForm.creatorUserName}}</p> </el-col>
</el-form-item> <el-col :span="8">
</el-col> <el-form-item label="收款凭证" prop="voucher">
<el-col :span="24"> <JNPF-UploadFz v-model="dataForm.voucher" :fileSize="5" sizeUnit="MB" :limit="9" buttonText="点击上传" disabled>
<el-tabs v-model="activeojnisi" tab-position="top" class="mb-20">
<el-tab-pane label="收款明细"> </JNPF-UploadFz>
<el-col :span="24" > </el-form-item>
<el-form-item label-width="0"> </el-col>
<div class="JNPF-common-title"> <!-- <el-col :span="8">-->
<h2></h2> <!-- <el-form-item label="单据状态 " prop="status">-->
</div> <!-- <el-select v-model="dataForm.status" placeholder="请选择" clearable :style='{"width":"100%"}'>-->
<el-table :data="dataForm.collection_item0List" size='mini' > <!-- <el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id"-->
<el-table-column type="index" width="50" label="序号" align="center" /> <!-- :disabled="item.disabled"></el-option>-->
<el-table-column prop="amount" label="收款金额">
<template slot-scope="scope"> <!-- </el-select>-->
<p>{{scope.row.amount}}</p> <!-- </el-form-item>-->
</template> <!-- </el-col>-->
</el-table-column> <!-- <el-col :span="8">-->
<el-table-column prop="price" label="订单金额"> <!-- <el-form-item label="制单人" prop="creatorUserName">-->
<template slot-scope="scope"> <!-- <el-input v-model="dataForm.creatorUserName" placeholder="请输入" clearable :style='{"width":"100%"}'>-->
<p>{{scope.row.price}}</p>
</template> <!-- </el-input>-->
</el-table-column> <!-- </el-form-item>-->
<el-table-column prop="amountCollected" label="已收款金额"> <!-- </el-col>-->
<template slot-scope="scope"> <el-col :span="24">
<p>{{scope.row.amountCollected}}</p> <el-tabs v-model="activeojnisi" tab-position="top" class="mb-20">
</template> <el-tab-pane label="收款明细">
</el-table-column> <el-col :span="24">
<el-table-column prop="salesorderId" label="销售订单编号"> <el-form-item label-width="0">
<template slot-scope="scope"> <div class="JNPF-common-title">
<p>{{scope.row.salesorderId}}</p> <h2></h2>
</template> </div>
</el-table-column> <el-table :data="dataForm.collection_item0List" size='mini' show-summary :summary-method="getSummaries">
<el-table-column prop="contractId" label="合同编号"> <el-table-column type="index" width="50" label="序号" align="center" />
<template slot-scope="scope"> <el-table-column prop="amount" label="收款金额" align="center" width="130">
<p>{{scope.row.contractId}}</p> <template slot-scope="scope">
</template> <el-input v-model="scope.row.amount" placeholder="请输入" clearable :style='{"width":"100%"}' @change="amountSum" disabled>
</el-table-column> </el-input>
<el-table-column prop="num" label="重量"> </template>
<template slot-scope="scope"> </el-table-column>
<p>{{scope.row.num}}</p> <el-table-column prop="price" label="订单金额" align="center" width="130">
</template> <template slot-scope="scope">
</el-table-column> <el-input v-model="scope.row.price" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
<!-- <el-table-column prop="taxRate" label="税率">--> </el-input>
<!-- <template slot-scope="scope">--> </template>
<!-- <p>{{ scope.row.taxRate | dynamicText(taxRateOptions) }}</p>--> </el-table-column>
<!-- </template>--> <el-table-column prop="amountCollected" label="已收款金额" align="center" width="130">
<!-- </el-table-column>--> <template slot-scope="scope">
<el-table-column prop="advanceAmount" label="垫资金额"> <el-input v-model="scope.row.amountCollected" placeholder="请输入" clearable
<template slot-scope="scope"> :style='{"width":"100%"}' disabled>
<p>{{scope.row.advanceAmount}}</p> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="rate" label="税额"> <el-table-column prop="salesorderId" label="销售订单编号" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.rate}}</p> <popupSelect v-model="scope.row.salesorderId" placeholder="请选择" clearable
</template> :field="'salesorderId'+scope.$index" interfaceId="393372436705378053"
</el-table-column> :columnOptions="jg_collection_item0deleteTimecolumnOptions" propsValue="id"
<el-table-column prop="notPrice" label="不含税金额"> relationField="document_no" popupType="dialog" popupWidth="800px"
<template slot-scope="scope"> :bissId="dataForm.contractId" @change="popupSelect2" disabled>
<p>{{scope.row.notPrice}}</p> </popupSelect>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="creatorTime" label="业务日期"> <el-table-column prop="contractId" label="合同编号" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{jnpf.dateFormat(scope.row.creatorTime)}}</p> <popupSelect v-model="scope.row.contractId" placeholder="请选择" clearable
</template> :field="'contractId'+scope.$index" interfaceId="398848549678332037"
</el-table-column> :columnOptions="jg_collection_item0deleteTimecolumnOptions" propsValue="id"
</el-table> relationField="contract_code" popupType="dialog" popupWidth="800px" disabled
</el-form-item> >
</el-col> </popupSelect>
</el-tab-pane > </template>
</el-tabs> </el-table-column>
<el-table-column prop="num" label="数量" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.num" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<!-- <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="advanceAmount" label="垫资金额" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.advanceAmount" placeholder="请输入" clearable
:style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="rate" label="税额" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.rate" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="notPrice" label="不含税金额" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.notPrice" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="creatorTime" label="业务日期" align="center" width="130">
<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" disabled>
</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="delcollection_item0List(scope.$index)">删除</el-button>
</template>
</el-table-column> -->
</el-table>
<!-- <div class="table-actions" @click="addcollection_item0List()">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div> -->
</el-form-item>
</el-col> </el-col>
</template> </el-tab-pane>
</el-form> </el-tabs>
</el-col>
</template>
</el-form>
</el-row> </el-row>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button> <el-button @click="visible = false"> </el-button>
<!-- <el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> </el-button> -->
</span> </span>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import PrintBrowse from '@/components/PrintBrowse' import {
import jnpf from '@/utils/jnpf' getDataInterfaceRes
export default { } from '@/api/systemData/dataInterface'
components: {PrintBrowse}, import {
props: [], getDictionaryDataSelector
data() { } from '@/api/systemData/dictionary'
return { export default {
visible: false, components: {},
loading: false, props: [],
printBrowseVisible: false, data() {
printId: '', return {
dataForm: { paymentType: "0",
id :'', currency: "0",
customerId: '', settlementType: "0",
contractId: '', visible: false,
documentNo : '', loading: false,
customerName : '', isDetail: false,
amountCollected : '', dataForm: {
collectionCount : '', code: '',
collectionBank : '', customerCode: '',
paymentType : "0", documentNo: '',
currency : "0", customerName: '',
settlementType : "0", customerId: '',
remark : '', contractId: '',
voucher : [], amountCollected: '',
status : "0", collectionCount: '',
creatorUserName : '', collectionBank: '',
collection_item0List:[], paymentType: "0",
}, currency: "0",
activeojnisi:'0', settlementType: "0",
paymentTypeOptions:[{"fullName":"货款","id":"0"},{"fullName":"运费","id":"1"},{"fullName":"仓储","id":"2"}], remark: '',
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}], voucher: [],
settlementTypeOptions:[{"fullName":"现金","id":"0"},{"fullName":"赊购","id":"1"},{"fullName":"网银","id":"2"},{"fullName":"银企直连","id":"3"},{"fullName":"银票","id":"4"},{"fullName":"商票","id":"5"}], status: "0",
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"},{"fullName":"已付款","id":"3"}], creatorUserName: '',
collection_item0List: [],
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"}],
}
}, },
computed: {}, activeojnisi: '0',
watch: {}, rules: {
created() { customerId: [
{
}, required: true,
mounted() {}, message: '请选择',
methods: { trigger: 'change'
dataInfo(dataAll){
let _dataAll =dataAll
_dataAll.voucher = _dataAll.voucher ? JSON.parse( _dataAll.voucher):[]
for(let i=0;i<_dataAll.collection_item0List.length;i++){
var _list = _dataAll.collection_item0List[i];
_list.creatorTime = _list.creatorTime ? jnpf.dateFormat(_list.creatorTime) : ''
}
this.dataForm = _dataAll
}, },
],
init(id) { contractId: [
this.dataForm.id = id || 0; {
this.visible = true; required: true,
this.$nextTick(() => { message: '请选择',
if(this.dataForm.id){ trigger: 'change'
this.loading = true
request({
url: '/api/collection/Collection/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
})
}, },
],
}, },
} customerNamecolumnOptions: [{
"label": "客户编码",
"value": "supplier_cd"
}, {
"label": "客户名称",
"value": "supplier_nm"
}, {
"label": "客户地点名称",
"value": "supplier_site_code"
}, {
"label": "客户等级",
"value": "customer_level"
}, {
"label": "银行账号",
"value": "bank_account"
}, {
"label": "开户行",
"value": "bank"
},],
contractNamecolumnOptions: [{
"label": "合同编码",
"value": "contract_code"
}, {
"label": "合同名称",
"value": "contract_name"
} ],
jg_collection_item0deleteTimecolumnOptions: [ {
"label": "销售订单编号",
"value": "document_no"
}, {
"label": "合同编号",
"value": "contract_id"
},
{
"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"
}],
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"
}],
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"
}],
}
},
computed: {},
watch: {},
created() {},
mounted() {},
methods: {
paymentTypeChange(e){
this.dataForm.paymentType = e;
},
currencyChange(e){
this.dataForm.currency = e;
},
settlementTypeChange(e){
this.dataForm.settlementType = e;
},
getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value)) && (index === 1 || index === 2 || index === 3 || index === 6 || index === 7 || index === 8 || index === 9)) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return this.jnpf.floatAdd(prev, curr);
} else {
return prev;
}
}, 0);
} else {
sums[index] = '';
}
});
return sums;
},
amountSum(){
let sum = 0;
for (let i = 0; i<this.dataForm.collection_item0List.length;i++){
sum = this.jnpf.floatAdd(sum,this.dataForm.collection_item0List[i].amount);
}
this.dataForm.amountCollected = sum;
},
popupSelect(e, d) {
this.dataForm.code = d.id;
this.dataForm.collectionCount = d.bank_account;
this.dataForm.collectionBank = d.bank;
this.dataForm.collection_item0List = [];
let params = {
"param" : this.dataForm.customerId
}
request({
url: '/api/collection/Collection/display',
method: 'get',
data: params
}).then(res => {
let data = res.data;
let amountSum = 0;
this.dataForm.contractId = data.id;
for (let i = 0; i< data.saleorderitemList.length;i++){
this.addcollection_item0List();
this.dataForm.collection_item0List[i].salesorderId = data.saleorderitemList[i].id;
this.dataForm.collection_item0List[i].price = data.saleorderitemList[i].price;
this.dataForm.collection_item0List[i].amountCollected = data.saleorderitemList[i].amountCollected;
this.dataForm.collection_item0List[i].contractId = data.saleorderitemList[i].contractId;
this.dataForm.collection_item0List[i].num = data.saleorderitemList[i].num;
this.dataForm.collection_item0List[i].advanceAmount = data.saleorderitemList[i].advanceAmount;
this.dataForm.collection_item0List[i].rate = data.saleorderitemList[i].rate;
this.dataForm.collection_item0List[i].notPrice = data.saleorderitemList[i].notPrice;
this.dataForm.collection_item0List[i].amount = this.jnpf.floatSub(data.saleorderitemList[i].price,data.saleorderitemList[i].amountCollected);
this.dataForm.collection_item0List[i].creatorTime = new Date().getTime();
amountSum = this.jnpf.floatAdd(amountSum,this.dataForm.collection_item0List[i].amount);
}
this.dataForm.amountCollected = amountSum;
this.loading = false
});
},
contractSelect(){
this.dataForm.collection_item0List = [];
let params = {
"param" : this.dataForm.contractId
}
request({
url: '/api/collection/Collection/show',
method: 'get',
data: params
}).then(res => {
let data = res.data;
let amountSum = 0;
this.dataForm.contractId = data.id;
for (let i = 0; i< data.saleorderitemList.length;i++){
this.addcollection_item0List();
this.dataForm.collection_item0List[i].salesorderId = data.saleorderitemList[i].id;
this.dataForm.collection_item0List[i].price = data.saleorderitemList[i].price;
this.dataForm.collection_item0List[i].amountCollected = data.saleorderitemList[i].amountCollected;
this.dataForm.collection_item0List[i].contractId = data.saleorderitemList[i].contractId;
this.dataForm.collection_item0List[i].num = data.saleorderitemList[i].num;
this.dataForm.collection_item0List[i].advanceAmount = data.saleorderitemList[i].advanceAmount;
this.dataForm.collection_item0List[i].rate = data.saleorderitemList[i].rate;
this.dataForm.collection_item0List[i].notPrice = data.saleorderitemList[i].notPrice;
this.dataForm.collection_item0List[i].amount = this.jnpf.floatSub(data.saleorderitemList[i].price,data.saleorderitemList[i].amountCollected);
this.dataForm.collection_item0List[i].creatorTime = new Date().getTime();
amountSum = this.jnpf.floatAdd(amountSum,this.dataForm.collection_item0List[i].amount);
}
this.dataForm.amountCollected = amountSum;
this.loading = false
});
},
popupSelect2(a, b) {
let amountCollectedSum = 0;
for (let i = 0; i < this.dataForm.collection_item0List.length; i++) {
debugger
if (a == this.dataForm.collection_item0List[i].salesorderId) {
this.dataForm.collection_item0List[i].price = b.price;
this.dataForm.collection_item0List[i].amountCollected = b.amount_collected;
this.dataForm.collection_item0List[i].contractId = b.contract_id;
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].amount = this.jnpf.floatSub(b.price,b.amount_collected);
this.dataForm.collection_item0List[i].creatorTime = new Date().getTime();
amountCollectedSum = this.jnpf.floatAdd(amountCollectedSum,this.dataForm.collection_item0List[i].amount);
}
}
this.dataForm.amountCollected = amountCollectedSum;
},
collection_item0Exist() {
let isOk = true;
for (let i = 0; i < this.dataForm.collection_item0List.length; i++) {
const e = this.dataForm.collection_item0List[i];
}
return isOk;
},
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] = "";
}
}
this.dataForm.paymentType = '0'
this.dataForm.currency = '0'
this.dataForm.settlementType = '0'
let params = {
"param" : 'collection'
}
request({
url: '/api/collection/Collection/autoSerialNum',
method: 'get',
data: params
}).then(res => {
this.dataForm.documentNo = res.msg
this.loading = false
});
},
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/collection/Collection/' + this.dataForm.id,
method: 'get'
}).then(res => {
debugger
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) {
if (!this.collection_item0Exist()) return
this.request()
}
})
},
request() {
var _data = this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/collection/Collection',
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/collection/Collection/' + 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)
}
})
})
}
},
addcollection_item0List() {
let item = {
amount: undefined,
price: undefined,
amountCollected: undefined,
salesorderId: undefined,
contractId: undefined,
num: undefined,
advanceAmount: undefined,
rate: undefined,
notPrice: undefined,
creatorTime: undefined,
}
this.dataForm.collection_item0List.push(item)
},
delcollection_item0List(index) {
this.dataForm.collection_item0List.splice(index, 1);
this.amountSum();
},
dataList() {
var _data = JSON.parse(JSON.stringify(this.dataForm));
_data.voucher = JSON.stringify(_data.voucher)
for (let i = 0; i < _data.collection_item0List.length; i++) {
var _list = _data.collection_item0List[i];
}
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
_dataAll.voucher = JSON.parse(_dataAll.voucher)
for (let i = 0; i < _dataAll.collection_item0List.length; i++) {
var _list = _dataAll.collection_item0List[i];
}
this.dataForm = _dataAll
debugger
},
},
}
</script> </script>

@ -489,6 +489,34 @@
}, },
contractSelect(){ contractSelect(){
this.dataForm.collection_item0List = []; this.dataForm.collection_item0List = [];
let params = {
"param" : this.dataForm.contractId
}
request({
url: '/api/collection/Collection/show',
method: 'get',
data: params
}).then(res => {
let data = res.data;
let amountSum = 0;
this.dataForm.contractId = data.id;
for (let i = 0; i< data.saleorderitemList.length;i++){
this.addcollection_item0List();
this.dataForm.collection_item0List[i].salesorderId = data.saleorderitemList[i].id;
this.dataForm.collection_item0List[i].price = data.saleorderitemList[i].price;
this.dataForm.collection_item0List[i].amountCollected = data.saleorderitemList[i].amountCollected;
this.dataForm.collection_item0List[i].contractId = data.saleorderitemList[i].contractId;
this.dataForm.collection_item0List[i].num = data.saleorderitemList[i].num;
this.dataForm.collection_item0List[i].advanceAmount = data.saleorderitemList[i].advanceAmount;
this.dataForm.collection_item0List[i].rate = data.saleorderitemList[i].rate;
this.dataForm.collection_item0List[i].notPrice = data.saleorderitemList[i].notPrice;
this.dataForm.collection_item0List[i].amount = this.jnpf.floatSub(data.saleorderitemList[i].price,data.saleorderitemList[i].amountCollected);
this.dataForm.collection_item0List[i].creatorTime = new Date().getTime();
amountSum = this.jnpf.floatAdd(amountSum,this.dataForm.collection_item0List[i].amount);
}
this.dataForm.amountCollected = amountSum;
this.loading = false
});
}, },
popupSelect2(a, b) { popupSelect2(a, b) {
let amountCollectedSum = 0; let amountCollectedSum = 0;

@ -86,7 +86,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="addOrUpdateHandle(scope.row)"> <el-button type="text" @click="addOrUpdateHandle(scope.row)">
</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)">
</el-button> </el-button>
<el-button type="text" @click="goDetail(scope.row.id)"> <el-button type="text" @click="goDetail(scope.row.id)">
</el-button> </el-button>
@ -129,6 +129,7 @@
}, },
data() { data() {
return { return {
showAll: false,
detailVisible: false, detailVisible: false,
query: { query: {
documentNo: undefined, documentNo: undefined,
@ -141,6 +142,7 @@
list: [], list: [],
listLoading: true, listLoading: true,
multipleSelection: [], multipleSelection: [],
multipleSelectionItem: [],
total: 0, total: 0,
listQuery: { listQuery: {
currentPage: 1, currentPage: 1,
@ -309,12 +311,20 @@
this.listLoading = false this.listLoading = false
}) })
}, },
handleDel(id) { handleDel(row) {
if(row.Status != '0'){
this.$message({
type: 'error',
message: '已认款无法删除',
duration: 1500,
})
return
}
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
request({ request({
url: `/api/collection/Collection/${id}`, url: `/api/collection/Collection/${row.id}`,
method: 'DELETE' method: 'DELETE'
}).then(res => { }).then(res => {
this.$message({ this.$message({
@ -328,6 +338,7 @@
}).catch(() => {}); }).catch(() => {});
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelectionItem = val
const res = val.map(item => item.id) const res = val.map(item => item.id)
this.multipleSelection = res this.multipleSelection = res
}, },
@ -340,6 +351,20 @@
}) })
return return
} }
var statusFlag = true;
this.multipleSelectionItem.forEach((item, index)=>{
if(item.status != '0'){
statusFlag = false;
}
});
if(!statusFlag){
this.$message({
type: 'error',
message: '已认款无法删除',
duration: 1000
});
return
}
const ids = this.multipleSelection.join() const ids = this.multipleSelection.join()
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', { this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
type: 'warning' type: 'warning'

@ -1,71 +1,107 @@
<template> <template>
<el-dialog title="详情" <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="1000px"> width="1500px">
<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" :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" >
<p>{{dataForm.documentNo}}</p> <el-input v-model="dataForm.documentNo"
placeholder="系统自动生成" readonly >
</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="type" > prop="type" >
<p>{{ dataForm.type | dynamicText(typeOptions) }} </p> <el-select v-model="dataForm.type"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in typeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</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="sourceNo" > prop="sourceNo" >
<p>{{dataForm.sourceNo}}</p> <popupSelect v-model="dataForm.sourceNo"
placeholder="请选择" clearable field="sourceNo" interfaceId="392956668264114117" :columnOptions="salesIdcolumnOptions" propsValue="id" relationField="document_no" popupType="dialog"
popupTitle="选择数据" popupWidth="800px" disabled
hasPage :pageSize="20" >
</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="amount" > prop="amount" >
<p>{{dataForm.amount}}</p> <el-input v-model="dataForm.amount"
placeholder="请输入出库金额" readonly clearable :style='{"width":"100%"}' disabled>
</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="currency" > prop="currency" >
<p>{{ dataForm.currency | dynamicText(currencyOptions) }} </p> <el-select v-model="dataForm.currency"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</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="num" > prop="num" >
<p>{{dataForm.num}}</p> <el-input v-model="dataForm.num"
placeholder="请输入出库数量" readonly clearable :style='{"width":"100%"}' disabled>
</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="customerId" > prop="customerId" >
<p>{{dataForm.customerId}}</p> <popupSelect v-model="dataForm.customerId"
placeholder="请选择" clearable field="customerId" interfaceId="395936123471343749" :columnOptions="customerIdcolumnOptions" propsValue="id" relationField="supplier_nm" popupType="dialog"
popupTitle="选择数据" popupWidth="800px" disabled
hasPage :pageSize="20" >
</popupSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="16" > <el-col :span="16" >
<el-form-item label="备注" <el-form-item label="备注"
prop="remark" > prop="remark" >
<p>{{dataForm.remark}}</p> <el-input v-model="dataForm.remark"
</el-form-item> placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-col>
<el-col :span="8" > </el-input>
<el-form-item label="出库日期"
prop="issueDate" >
<p>{{jnpf.dateFormat(dataForm.issueDate)}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="单据状态"
prop="status" >
<p>{{ dataForm.status | dynamicText(statusOptions) }} </p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="12" >-->
<!-- <el-form-item label="出库日期"-->
<!-- prop="issueDate" >-->
<!-- <el-date-picker v-model="dataForm.issueDate"-->
<!-- 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="status" >-->
<!-- <el-select v-model="dataForm.status"-->
<!-- 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-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="24"> <el-col :span="24">
<el-tabs v-model="activezlqlfb" tab-position="top" class="mb-20"> <el-tabs v-model="activezlqlfb" tab-position="top" class="mb-20">
<el-tab-pane label="磅单明细"> <el-tab-pane label="磅单明细">
@ -74,69 +110,111 @@
<div class="JNPF-common-title"> <div class="JNPF-common-title">
<h2></h2> <h2></h2>
</div> </div>
<el-table :data="dataForm.receiptout_item0List" size='mini' > <el-table :data="dataForm.receiptout_item0List" size='mini' show-summary :summary-method="getSummaries" >
<el-table-column type="index" width="50" label="序号" align="center" /> <el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="vehicleId" label="车牌号"> <el-table-column prop="vehicleId" label="车牌号" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.vehicleId}}</p> <popupSelect v-model="scope.row.vehicleId"
</template> placeholder="请选择" clearable :field="'vehicleId'+scope.$index" interfaceId="398732963950472005" :columnOptions="receiptout_item0vehicleIdcolumnOptions" propsValue="id" relationField="ticketno" popupType="dialog"
popupWidth="800px" disabled
hasPage :pageSize="20" >
</popupSelect>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="materialId" label="物料名称"> <el-table-column prop="materialId" label="物料名称" align="center" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.materialId}}</p> <popupSelect v-model="scope.row.materialId"
</template> placeholder="请选择" clearable :field="'materialId'+scope.$index" interfaceId="398719564478785669" :columnOptions="receiptout_item0materialIdcolumnOptions" propsValue="id" relationField="item_name" popupType="dialog"
popupWidth="800px" disabled
>
</popupSelect>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="reservoirareaId" label="库区名称"> <el-table-column prop="reservoirareaId" label="库区名称" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.reservoirareaId}}</p> <popupSelect v-model="scope.row.reservoirareaId"
placeholder="请选择" clearable :field="'reservoirareaId'+scope.$index" interfaceId="381404161809350213" :columnOptions="receiptout_item0reservoirareaIdcolumnOptions" propsValue="id" relationField="areaname" popupType="dialog"
popupWidth="800px" @change="areaSelect" disabled
>
</popupSelect>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="warehouseId" label="仓库名称"> <el-table-column prop="warehouseId" label="仓库名称" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.warehouseId}}</p> <popupSelect v-model="scope.row.warehouseId"
placeholder="请选择" clearable :field="'reservoirareaId'+scope.$index" interfaceId="399117969575232581" :columnOptions="receiptout_item0reservoirareaIdcolumnOptions" propsValue="id" relationField="name" popupType="dialog"
popupWidth="800px" disabled>
</popupSelect>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="deliveryNum" label="出库数量"> <el-table-column prop="batchNo" label="批次号" align="center" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.deliveryNum}}</p> <el-input v-model="scope.row.batchNo"
placeholder="系统自动生成" readonly>
</el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="unit" label="计量单位"> <el-table-column prop="deliveryNum" label="出库数量" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{ scope.row.unit | dynamicText(unitOptions) }}</p> <el-input v-model="scope.row.deliveryNum"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="price" label="单价"> <el-table-column prop="unit" label="计量单位" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.price}}</p> <el-select v-model="scope.row.unit"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in unitOptions" :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="rate" label="税率"> <el-table-column prop="price" label="单价" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{ scope.row.rate | dynamicText(rateOptions) }}</p> <el-input v-model="scope.row.price"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="amount" label="金额"> <el-table-column prop="rate" label="税率" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.amount}}</p> <el-select v-model="scope.row.rate"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<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="rateAmount" label="税额"> <el-table-column prop="amount" label="金额" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.rateAmount}}</p> <el-input v-model="scope.row.amount"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="batchNo" label="批次号"> <el-table-column prop="rateAmount" label="税额" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{scope.row.batchNo}}</p> <el-input v-model="scope.row.rateAmount"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="poundType" label="磅单类型"> <el-table-column prop="poundType" label="磅单类型" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<p>{{ scope.row.poundType | dynamicText(poundTypeOptions) }}</p> <el-select v-model="scope.row.poundType"
placeholder="请选择" clearable :style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in poundTypeOptions" :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 label="操作" width="50" >-->
<!-- <template slot-scope="scope">-->
<!-- <el-button size="mini" type="text" class="JNPF-table-delBtn" @click="delreceiptout_item0List(scope.$index)"></el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table> </el-table>
<!-- <div class="table-actions" @click="addreceiptout_item0List()">-->
<!-- <el-button type="text" icon="el-icon-plus">添加</el-button>-->
<!-- </div>-->
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-tab-pane > </el-tab-pane >
@ -147,24 +225,23 @@
</el-row> </el-row>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button> <el-button @click="visible = false"> </el-button>
<!-- <el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> </el-button> -->
</span> </span>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import request from '@/utils/request' import request from '@/utils/request'
import PrintBrowse from '@/components/PrintBrowse' import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import jnpf from '@/utils/jnpf' import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
export default { export default {
components: {PrintBrowse}, components: {},
props: [], props: [],
data() { data() {
return { return {
visible: false, visible: false,
loading: false, loading: false,
printBrowseVisible: false, isDetail: false,
printId: '',
dataForm: { dataForm: {
id :'',
documentNo : '', documentNo : '',
type : "0", type : "0",
salesId : "XS002", salesId : "XS002",
@ -172,7 +249,7 @@
amount : '', amount : '',
currency : "0", currency : "0",
num : '', num : '',
customerName : '', customerId : '',
remark : '', remark : '',
issueDate : '', issueDate : '',
status : "0", status : "0",
@ -183,47 +260,203 @@
receiptout_item0List:[], receiptout_item0List:[],
}, },
activezlqlfb:'0', activezlqlfb:'0',
typeOptions:[{"fullName":"销售出库","id":"0"},{"fullName":"购销出库","id":"1"}], rules:
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}], {
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}], type: [
{
required: true,
message: '请至少选择一个',
trigger: 'change'
},
],
sourceNo: [
{
required: true,
message: '请至少选择一个',
trigger: 'change'
},
],
},
typeOptions:[{"fullName":"销售出库","id":"0"},{"fullName":"购销出库","id":"1"}],
salesIdcolumnOptions:[ {"label":"单据编号","value":"document_no"}, {"label":"币别","value":"currency"}, {"label":"客户名称","value":"customer_name"},],
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}],
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}], receiptout_item0vehicleIdcolumnOptions:[ {"label":"车辆号","value":"ticketno"}, {"label":"物料名称","value":"material_name"}, {"label":"出库数量","value":"settlement"}, {"label":"计量单位","value":"unit"}, {"label":"含税单价","value":"unit_price"}, {"label":"税率","value":"rate"}, {"label":"金额","value":"price"}, {"label":"批次号","value":"poundlist_id"}, {"label":"磅单类型","value":"pound_type"},],
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"}], receiptout_item0materialIdcolumnOptions:[ {"label":"物料编码","value":"item_code"}, {"label":"物料名称","value":"item_name"}, {"label":"单位","value":"primary_unit_of_measure"}, {"label":"默认入库区","value":"in_area"}, {"label":"默认出库区","value":"out_area"},],
poundTypeOptions:[{"fullName":"贸易","id":"0"},{"fullName":"自加工","id":"1"},{"fullName":"委外","id":"2"},{"fullName":"倒运","id":"3"}], receiptout_item0reservoirareaIdcolumnOptions:[ {"label":"库区名称","value":"areaname"}, {"label":"最高库存","value":"maximum"}, {"label":"安全库存","value":"safety"}, {"label":"最低库存","value":"minimum"}, {"label":"仓库名称","value":"name"},],
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
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"}],
poundTypeOptions:[{"fullName":"贸易","id":"0"},{"fullName":"自加工","id":"1"},{"fullName":"委外","id":"2"},{"fullName":"倒运","id":"3"}],
} }
}, },
computed: {}, computed: {},
watch: {}, watch: {},
created() { created() {
}, },
mounted() {}, mounted() {},
methods: { methods: {
dataInfo(dataAll){ areaSelect(a,b){
let _dataAll =dataAll for (let i = 0;i<this.dataForm.receiptout_item0List.length;i++) {
for(let i=0;i<_dataAll.receiptout_item0List.length;i++){ if (a == this.dataForm.receiptout_item0List[i].reservoirareaId) {
var _list = _dataAll.receiptout_item0List[i]; this.dataForm.receiptout_item0List[i].warehouseId = b.warehouse_id
}
}
},
getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value)) && (index === 6 || index === 8 || index === 10 || index === 11 )) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return this.jnpf.floatAdd(prev, curr);
} else {
return prev;
}
}, 0);
} else {
sums[index] = '';
}
});
return sums;
},
receiptout_item0Exist() {
let isOk = true;
for(let i=0;i<this.dataForm.receiptout_item0List.length;i++){
const e = this.dataForm.receiptout_item0List[i];
}
return isOk;
},
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] = "";
}
} }
this.dataForm = _dataAll let param = {
"param" : 'chuku',
"batchNum" : 'receiptout-num'
}
request({
url: '/api/collection/Collection/autoSerialNum',
method: 'get',
data: param
}).then(res => {
this.dataForm.documentNo = res.msg
this.loading = false
});
}, },
init(id, isDetail) {
init(id) {
this.dataForm.id = id || 0; this.dataForm.id = id || 0;
this.visible = true; this.visible = true;
this.isDetail = isDetail || false;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['elForm'].resetFields();
if(this.dataForm.id){ if(this.dataForm.id){
this.loading = true this.loading = true
request({ request({
url: '/api/receipout/Receiptout/detail/'+this.dataForm.id, url: '/api/receipout/Receiptout/'+this.dataForm.id,
method: 'get' method: 'get'
}).then(res => { }).then(res => {
this.dataInfo(res.data) this.dataInfo(res.data)
this.loading = false this.loading = false
}) });
}else{
this.clearData(this.dataForm)
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
dataFormSubmit() {
this.$refs['elForm'].validate((valid) => {
if (valid) {
if (!this.receiptout_item0Exist()) return
this.request()
} }
}) })
}, },
request() {
var _data =this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/receipout/Receiptout',
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/receipout/Receiptout/'+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)
}
})
})
}
},
addreceiptout_item0List(){
let item = {
vehicleId:undefined,
materialId:undefined,
reservoirareaId:undefined,
warehouseId:undefined,
deliveryNum:undefined,
unit:undefined,
price:undefined,
rate:undefined,
amount:undefined,
rateAmount:undefined,
batchNo:undefined,
poundType:undefined,
}
this.dataForm.receiptout_item0List.push(item)
},
delreceiptout_item0List(index) {
this.dataForm.receiptout_item0List.splice(index, 1);
},
dataList(){
var _data = JSON.parse(JSON.stringify(this.dataForm));
for(let i=0;i<_data.receiptout_item0List.length;i++){
var _list = _data.receiptout_item0List[i];
}
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
for(let i=0;i<_dataAll.receiptout_item0List.length;i++){
var _list = _dataAll.receiptout_item0List[i];
}
this.dataForm = _dataAll
},
}, },
} }

@ -9,6 +9,7 @@
<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>
<template v-if="showAll">
<el-col :span="6"> <el-col :span="6">
<el-form-item label="来源单号"> <el-form-item label="来源单号">
<el-input v-model="query.sourceOrderNo" placeholder="请输入" clearable></el-input> <el-input v-model="query.sourceOrderNo" placeholder="请输入" clearable></el-input>
@ -37,10 +38,15 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</template>
<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-button type="text" icon="el-icon-arrow-down" @click="showAll=true"
v-if="!showAll">展开</el-button>
<el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>
收起</el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
@ -52,8 +58,8 @@
<!-- </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">
@ -106,8 +112,8 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" v-has="'btn_edit'" @click="addOrUpdateHandle(scope.row.id)"> <el-button type="text" v-has="'btn_edit'" @click="addOrUpdateHandle(scope.row.id)">
</el-button> </el-button>
<el-button type="text" v-has="'btn_remove'" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)"> <!-- <el-button type="text" v-has="'btn_remove'" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button> </el-button> -->
<el-button type="text" v-has="'btn_detail'" @click="goDetail(scope.row.id)"> <el-button type="text" v-has="'btn_detail'" @click="goDetail(scope.row.id)">
</el-button> </el-button>
</template> </template>
@ -136,6 +142,7 @@
components: {JNPFForm, ExportBox, Detail}, components: {JNPFForm, ExportBox, Detail},
data() { data() {
return { return {
showAll: false,
detailVisible: false, detailVisible: false,
query: { query: {
documentNo: undefined, documentNo: undefined,

@ -1,241 +1,504 @@
<template> <template>
<el-dialog title="详情" <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 width="1500px">
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll <el-row :gutter="15" class="">
width="1000px"> <el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px"
<el-row :gutter="15" class=""> 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="8">
<el-col :span="8" > <el-form-item label="单据编号" prop="documentNo">
<el-form-item label="单据编号" <el-input v-model="dataForm.documentNo" placeholder="请输入" clearable
prop="documentNo" > :style='{"width":"100%"}' readonly>
<p>{{dataForm.documentNo}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="销售订单"
prop="salesOrderId" >
<p>{{dataForm.salesOrderId}}</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="退款金额"
prop="refundAmount" >
<p>{{dataForm.refundAmount}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="退货数量"
prop="refundNum" >
<p>{{dataForm.refundNum}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="备注"
prop="remark" >
<p>{{dataForm.remark}}</p>
</el-form-item>
</el-col>
<!-- <el-col :span="8" >-->
<!-- <el-form-item label="合同名称"-->
<!-- prop="jnpf_jg_salesorder_jnpf_contractName" >-->
<!-- <p>{{dataForm.jnpf_jg_salesorder_jnpf_contractName}}</p>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8" >-->
<!-- <el-form-item label="客户名称"-->
<!-- prop="jnpf_jg_salesorder_jnpf_costomerName" >-->
<!-- <p>{{dataForm.jnpf_jg_salesorder_jnpf_costomerName}}</p>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8" >-->
<!-- <el-form-item label="实退金额"-->
<!-- prop="actualAmount" >-->
<!-- <p>{{dataForm.actualAmount}}</p>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8" >-->
<!-- <el-form-item label="单据状态 "-->
<!-- prop="status" >-->
<!-- <p>{{ dataForm.status | dynamicText(statusOptions) }} </p>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8" >-->
<!-- <el-form-item label="创建时间"-->
<!-- prop="creatorTime" >-->
<!-- <p>{{dataForm.creatorTime}}</p>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8" >-->
<!-- <el-form-item label="创建人"-->
<!-- prop="creatorUserName" >-->
<!-- <p>{{dataForm.creatorUserName}}</p>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="24">
<el-tabs v-model="activeqkzogz" 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.saleback_item0List" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="vehicleName" label="车牌号">
<template slot-scope="scope">
<p>{{scope.row.vehicleName}}</p>
</template>
</el-table-column>
<el-table-column prop="materialName" label="物料名称">
<template slot-scope="scope">
<p>{{scope.row.materialName}}</p>
</template>
</el-table-column>
<el-table-column prop="settlement" label="结算重量 ">
<template slot-scope="scope">
<p>{{scope.row.settlement}}</p>
</template>
</el-table-column>
<el-table-column prop="unit" label="计量单位 ">
<template slot-scope="scope">
<p>{{ scope.row.unit | dynamicText(unitOptions) }}</p>
</template>
</el-table-column>
<el-table-column prop="salesPrice" label="销售单价">
<template slot-scope="scope">
<p>{{scope.row.salesPrice}}</p>
</template>
</el-table-column>
<el-table-column prop="rate" label="税率">
<template slot-scope="scope">
<p>{{ scope.row.rate | dynamicText(rateOptions) }}</p>
</template>
</el-table-column>
<el-table-column prop="amount" label="应退金额">
<template slot-scope="scope">
<p>{{scope.row.amount}}</p>
</template>
</el-table-column>
<el-table-column prop="notAmount" label="税额">
<template slot-scope="scope">
<p>{{scope.row.notAmount}}</p>
</template>
</el-table-column>
<el-table-column prop="businessName" label="业务员">
<template slot-scope="scope">
<p>{{scope.row.businessName}}</p>
</template>
</el-table-column>
<el-table-column prop="pountType" label="磅单类型 ">
<template slot-scope="scope">
<p>{{ scope.row.pountType | dynamicText(pountTypeOptions) }}</p>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-col>
</el-tab-pane >
</el-tabs>
</el-col>
</template>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false"> </el-button>
</span>
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import PrintBrowse from '@/components/PrintBrowse'
import jnpf from '@/utils/jnpf'
export default {
components: {PrintBrowse},
props: [],
data() {
return {
visible: false,
loading: false,
printBrowseVisible: false,
printId: '',
dataForm: {
id :'',
documentNo : '',
salesOrderId : "",
currency : "0",
refundAmount : '',
refundNum : '',
remark : '',
actualAmount : '',
status : "0",
creatorTime : "",
creatorUserName : "",
saleback_item0List:[],
// jg_salesorder:
// {
// contractName:'',
// costomerName:'',
// },
// jnpf_jg_salesorder_jnpf_contractName:'',
// jnpf_jg_salesorder_jnpf_costomerName:'',
},
activeqkzogz:'0',
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}],
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}], </el-input>
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"}], </el-form-item>
pountTypeOptions:[{"fullName":"贸易","id":"0"},{"fullName":"其他","id":"1"}], </el-col>
} <el-col :span="8">
}, <el-form-item label="销售订单" prop="salesOrderId">
computed: {}, <popupSelect v-model="dataForm.salesOrderId" placeholder="请选择" clearable
watch: {}, field="salesOrderId" interfaceId="383568951197606085"
created() { :columnOptions="salesOrderIdcolumnOptions" :excludeFields="excludeFields" propsValue="id" relationField="document_no"
popupType="dialog" popupTitle="选择数据" popupWidth="800px" @change="popupSelectChange" disabled>
}, </popupSelect>
mounted() {}, </el-form-item>
methods: { </el-col>
dataInfo(dataAll){ <el-col :span="8">
let _dataAll =dataAll <el-form-item label="币别" prop="currency">
// _dataAll.jnpf_jg_salesorder_jnpf_contractName = _dataAll.jg_salesorder.contractName <el-select v-model="dataForm.currency" placeholder="请选择" clearable
// _dataAll.jnpf_jg_salesorder_jnpf_costomerName = _dataAll.jg_salesorder.costomerName :style='{"width":"100%"}' disabled>
for(let i=0;i<_dataAll.saleback_item0List.length;i++){ <el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName"
var _list = _dataAll.saleback_item0List[i]; :value="item.id" :disabled="item.disabled"></el-option>
}
this.dataForm = _dataAll
debugger
},
init(id) { </el-select>
this.dataForm.id = id || 0; </el-form-item>
this.visible = true; </el-col>
this.$nextTick(() => { <el-col :span="8">
if(this.dataForm.id){ <el-form-item label="退款金额" prop="refundAmount" >
this.loading = true <el-input v-model="dataForm.refundAmount" readonly clearable :style='{"width":"100%"}' disabled>
request({
url: '/api/saleback/Saleback/detail2/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
for (let i = 0;i<res.data.saleback_item0List.length;i++){
this.dataForm.saleback_item0List[i].amount = res.data.saleback_item0List[i].price
this.dataForm.saleback_item0List[i].price = res.data.saleback_item0List[i].salesPrice
this.dataForm.saleback_item0List[i].notAmount = this.dataForm.saleback_item0List[i].amount - res.data.saleback_item0List[i].noPrice
}
this.loading = false
})
}
}) </el-input>
}, </el-form-item>
}, </el-col>
} <el-col :span="8">
<el-form-item label="退货数量" prop="refundNum" >
<el-input v-model="dataForm.refundNum" readonly clearable :style='{"width":"100%"}' disabled>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-tabs v-model="activeqkzogz" 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.saleback_item0List" size='mini' show-summary :summary-method="getSummaries">
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="vehicleId" label="车牌号" align="center" width="130">
<template slot-scope="scope">
<popupSelect v-model="scope.row.vehicleId"
placeholder="请选择" clearable :field="'vehicleId'+scope.$index" interfaceId="400554150653457925"
:bissId="dataForm.salesOrderId" :columnOptions="salesback_item0vehicleIdcolumnOptions" propsValue="vehicleId"
relationField="ticketno" popupType="dialog" @change="popupSelectChange2" disabled
popupWidth="800px">
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="materialId" label="物料名称" align="center" width="180">
<template slot-scope="scope">
<popupSelect v-model="scope.row.materialId"
placeholder="请选择" clearable :field="'materialId'+scope.$index" interfaceId="381037852907038533" :columnOptions="jg_salesback_item0materialIdcolumnOptions" propsValue="id" relationField="item_name" popupType="dialog"
popupWidth="800px" disabled>
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="settlement" label="结算重量 " align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.settlement" placeholder="请输入" clearable
:style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="unit" label="计量单位 " align="center" width="130">
<template slot-scope="scope">
<el-select v-model="scope.row.unit" placeholder="请选择" clearable
:style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in unitOptions" :key="index"
:label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="price" label="销售单价" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.price" placeholder="请输入" clearable
:style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="rate" label="税率" align="center" width="130">
<template slot-scope="scope">
<el-select v-model="scope.row.rate" placeholder="请选择" clearable
:style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in rateOptions" :key="index"
:label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="amount" label="应退金额" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.amount" placeholder="请输入" clearable
:style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="notAmount" label="税额" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.notAmount" placeholder="请输入" clearable
:style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="businessId" label="业务员" align="center" width="130">
<template slot-scope="scope">
<popupSelect v-model="scope.row.businessId"
placeholder="请选择" clearable :field="'businessId'+scope.$index" interfaceId="ebcc44be142e43b795c0d769abd6d25a" :columnOptions="jg_salesback_item0businessIdcolumnOptions" propsValue="F_Id" relationField="F_RealName" popupType="dialog"
popupWidth="800px" disabled>
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="pountType" label="磅单类型 " align="center" width="130">
<template slot-scope="scope">
<el-select v-model="scope.row.pountType" placeholder="请选择" clearable
:style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in pountTypeOptions"
:key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</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="delsaleback_item0List(scope.$index)">删除</el-button>
</template>
</el-table-column> -->
</el-table>
<!-- <div class="table-actions" @click="addsaleback_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>
</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>
<script>
import request from '@/utils/request'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
export default {
components: {},
props: [],
data() {
return {
excludeFields: [],
visible: false,
loading: false,
isDetail: false,
dataForm: {
documentNo: '',
salesOrderId: "",
currency: "0",
refundAmount: '',
refundNum: '',
remark: '',
actualAmount: '',
status: "0",
creatorTime: "",
creatorUserName: "",
saleback_item0List: [],
// jg_salesorder: {
// contractName: '',
// costomerName: '',
// },
// jnpf_jg_salesorder_jnpf_contractName: '',
// jnpf_jg_salesorder_jnpf_costomerName: '',
},
activeqkzogz: '0',
rules: {},
salesOrderIdcolumnOptions: [{
"label": "ID",
"value": "id"
}, {
"label": "销售订单号",
"value": "document_no"
}, {
"label": "合同名称",
"value": "contract_name"
}, {
"label": "客户名称",
"value": "costomer_name"
}, {
"label": "币别",
"value": "currency"
}, {
"label": "状态",
"value": "status"
}, ],
currencyOptions: [{
"fullName": "人民币",
"id": "0"
}, {
"fullName": "美元",
"id": "1"
}, {
"fullName": "英镑",
"id": "2"
}],
statusOptions: [{
"fullName": "已保存",
"id": "0"
}, {
"fullName": "审批中",
"id": "1"
}, {
"fullName": "已审批",
"id": "2"
}],
salesback_item0vehicleIdcolumnOptions:[ {"label":"车牌号","value":"ticketno"},
{"label":"物料名称","value":"material_name"},
{"label":"结算重量","value":"settlement"},
{"label":"计量单位","value":"unit"},
{"label":"采购单价","value":"unit_price"},
{"label":"税率","value":"rate"},
{"label":"应退金额","value":"price"},
{"label":"税额","value":"no_price"},
{"label":"业务员","value":"business_id"},
{"label":"磅单类型","value":"pound_type"},],
jg_salesback_item0materialIdcolumnOptions:[ {"label":"物料编码","value":"item_code"}, {"label":"物料名称","value":"item_name"}, {"label":"单位","value":"primary_unit_of_measure"}, {"label":"默认入库区","value":"in_area"}, {"label":"默认出库区","value":"out_area"},],
unitOptions: [{
"fullName": "吨",
"id": "0"
}, {
"fullName": "千克",
"id": "1"
}],
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"
}],
pountTypeOptions: [{
"fullName": "贸易",
"id": "0"
}, {
"fullName": "其他",
"id": "1"
}],
jg_salesback_item0businessIdcolumnOptions:[ {"label":"人员名称","value":"F_RealName"}, {"label":"人员职位","value":"F_FullName"},],
}
},
computed: {},
watch: {},
created() {},
mounted() {},
methods: {
getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value)) && (index === 3 || index === 5 || index === 7 || index === 8 )) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return this.jnpf.floatAdd(prev, curr);
} else {
return prev;
}
}, 0);
} else {
sums[index] = '';
}
});
return sums;
},
popupSelectChange2(a, b){
var sumPrice = 0;
var sumNum = 0;
var excludeFields = [];
var floatMul2 = 0;
for (let i = 0; i < this.dataForm.saleback_item0List.length; i++) {
excludeFields.push(this.dataForm.saleback_item0List[i].vehicleId);
if(a == this.dataForm.saleback_item0List[i].vehicleId){
this.dataForm.saleback_item0List[i].materialId = b.material_id;
this.dataForm.saleback_item0List[i].settlement = b.settlement;
this.dataForm.saleback_item0List[i].unit = b.unit;
this.dataForm.saleback_item0List[i].price = b.sales_price;
this.dataForm.saleback_item0List[i].rate = b.rate;
this.dataForm.saleback_item0List[i].amount = this.jnpf.floatMul(b.sales_price, b.settlement);
this.dataForm.saleback_item0List[i].pountType = b.pound_type;
this.dataForm.saleback_item0List[i].businessId = b.business_id;
this.dataForm.saleback_item0List[i].salesorderItem0Id = b.saleitemId;
this.dataForm.saleback_item0List[i].poundlistId = b.poundlistId;
this.rateOptions.find((item) => {
if (this.dataForm.saleback_item0List[i].rate == item.id) {
this.dataForm.saleback_item0List[i].notAmount =this.jnpf.floatDiv(this.jnpf.floatMul(this.dataForm.saleback_item0List[i].amount,item.fullName),100)
}
})
sumNum = this.jnpf.floatAdd(sumNum,b.settlement);
sumPrice = this.jnpf.floatAdd(sumPrice,this.dataForm.saleback_item0List[i].amount);
}
}
this.dataForm.refundNum = sumNum;
this.dataForm.refundAmount = sumPrice;
this.excludeFields = excludeFields;
},
popupSelectChange(e,d){
this.dataForm.currency = d.currency;
this.excludeFields = [];
this.dataForm.saleback_item0List = [];
},
saleback_item0Exist() {
let isOk = true;
for (let i = 0; i < this.dataForm.saleback_item0List.length; i++) {
const e = this.dataForm.saleback_item0List[i];
}
return isOk;
},
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] = "";
}
}
let param = {
"param" : 'salesBack'
}
request({
url: '/api/collection/Collection/autoSerialNum',
method: 'get',
data: param
}).then(res => {
this.dataForm.documentNo = res.msg
this.loading = false
});
},
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/saleback/Saleback/' + this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
for (let i = 0;i<res.data.saleback_item0List.length;i++){
this.dataForm.saleback_item0List[i].amount = res.data.saleback_item0List[i].price
this.dataForm.saleback_item0List[i].price = res.data.saleback_item0List[i].salesPrice
this.dataForm.saleback_item0List[i].notAmount = this.jnpf.floatSub(this.dataForm.saleback_item0List[i].amount, res.data.saleback_item0List[i].noPrice)
}
this.loading = false
});
} else {
this.clearData(this.dataForm)
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
dataFormSubmit() {
this.$refs['elForm'].validate((valid) => {
if (valid) {
if (!this.saleback_item0Exist()) return
this.request()
}
})
},
request() {
var _data = this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/saleback/Saleback',
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/saleback/Saleback/' + 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)
}
})
})
}
},
addsaleback_item0List() {
let item = {
licenseNum: undefined,
materialName: undefined,
settlement: undefined,
unit: undefined,
price: undefined,
rate: undefined,
amount: undefined,
notAmount: undefined,
pountUser: undefined,
pountType: undefined,
}
this.dataForm.saleback_item0List.push(item)
},
delsaleback_item0List(index) {
this.dataForm.saleback_item0List.splice(index, 1);
},
dataList() {
var _data = JSON.parse(JSON.stringify(this.dataForm));
// _data.jg_salesorder.contractName = _data.jnpf_jg_salesorder_jnpf_contractName
// _data.jg_salesorder.costomerName = _data.jnpf_jg_salesorder_jnpf_costomerName
for (let i = 0; i < _data.saleback_item0List.length; i++) {
var _list = _data.saleback_item0List[i];
}
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
// _dataAll.jnpf_jg_salesorder_jnpf_contractName = _dataAll.jg_salesorder.contractName
// _dataAll.jnpf_jg_salesorder_jnpf_costomerName = _dataAll.jg_salesorder.costomerName
for (let i = 0; i < _dataAll.saleback_item0List.length; i++) {
var _list = _dataAll.saleback_item0List[i];
}
this.dataForm = _dataAll
},
},
}
</script> </script>

File diff suppressed because it is too large Load Diff

@ -262,8 +262,8 @@
</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">-->
<!-- <h2></h2>--> <!-- <h2></h2>-->

@ -287,14 +287,14 @@
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="invoiceDate" label="开票日期" align="center" width="130"> <el-table-column prop="invoiceDate" label="开票日期" align="center" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker v-model="scope.row.invoiceDate" <el-date-picker v-model="scope.row.invoiceDate"
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" > placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" >
</el-date-picker> </el-date-picker>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="attachMent" label="发票附件"> <el-table-column prop="attachMent" label="发票附件" align="center" width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<JNPF-UploadFz v-model="scope.row.attachMent" <JNPF-UploadFz v-model="scope.row.attachMent"
:fileSize="100" sizeUnit="MB" :limit="5" buttonText="点击上传" > :fileSize="100" sizeUnit="MB" :limit="5" buttonText="点击上传" >
@ -455,17 +455,26 @@
return sums; return sums;
}, },
invoiceQuantitySum(){ invoiceQuantitySum(){
debugger
let sum = 0; let sum = 0;
for (let i =0;i<this.dataForm.arinvoices_item0List.length;i++){ for (let i =0;i<this.dataForm.arinvoices_item0List.length;i++){
sum = this.jnpf.floatAdd(sum,this.dataForm.arinvoices_item0List[i].invoiceQuantity) sum = this.jnpf.floatAdd(sum,this.dataForm.arinvoices_item0List[i].invoiceQuantity)
} }
this.dataForm.invoiceQuantity = sum this.dataForm.invoiceQuantity = sum
debugger
}, },
involceAmountSum(){ involceAmountSum(){
let sum = 0; let sum = 0;
for (let i =0;i<this.dataForm.arinvoices_item0List.length;i++){ for (let i =0;i<this.dataForm.arinvoices_item0List.length;i++){
if(this.dataForm.arinvoices_item0List[i].taxRate){
this.taxRateOptions.find((item) => {
if (this.dataForm.arinvoices_item0List[i].taxRate == item.id) {
debugger
// this.dataForm.arinvoices_item0List[i].taxAmount = this.jnpf.floatDiv(this.jnpf.floatMul(this.dataForm.arinvoices_item0List[i].involceAmount,item.fullName),100)
this.dataForm.arinvoices_item0List[i].taxAmount = this.dataForm.arinvoices_item0List[i].involceAmount*item.fullName/100
debugger
this.dataForm.arinvoices_item0List[i].amountNotTax = this.jnpf.floatSub(this.dataForm.arinvoices_item0List[i].involceAmount, this.dataForm.arinvoices_item0List[i].taxAmount)
}
})
}
sum = this.jnpf.floatAdd(sum,this.dataForm.arinvoices_item0List[i].involceAmount) sum = this.jnpf.floatAdd(sum,this.dataForm.arinvoices_item0List[i].involceAmount)
} }
this.dataForm.invoiceAmount = sum this.dataForm.invoiceAmount = sum
@ -516,14 +525,12 @@
}, },
init(list) { init(list) {
this.dataForm.businessDate = new Date().getTime(); this.dataForm.businessDate = new Date().getTime();
debugger
this.visible = true; this.visible = true;
let amount = 0; let amount = 0;
let num = 0; let num = 0;
this.dataForm.documentNo = list[0].documentNo; this.dataForm.documentNo = list[0].documentNo;
this.dataForm.contractId = list[0].contractId; this.dataForm.contractId = list[0].contractId;
this.dataForm.customerId = list[0].customerId; this.dataForm.customerId = list[0].customerId;
debugger
this.dataForm.salesOrderId = list[0].id; this.dataForm.salesOrderId = list[0].id;
this.dataForm.arinvoices_item1List = list[0].list; this.dataForm.arinvoices_item1List = list[0].list;
for (let i = 0;i<list[0].list.length;i++){ for (let i = 0;i<list[0].list.length;i++){
@ -546,17 +553,12 @@
this.$store.commit('generator/UPDATE_RELATION_DATA', {}) this.$store.commit('generator/UPDATE_RELATION_DATA', {})
}, },
init2(list2) { init2(list2) {
// this.dataInfo(list2);
this.visible = true; this.visible = true;
this.dataForm = list2 this.dataForm = list2
this.dataForm.businessDate = new Date().getTime(); this.dataForm.businessDate = new Date().getTime();
this.dataForm.arinvoices_item1List = list2.arinvoices_item1EntityList; this.dataForm.arinvoices_item1List = list2.arinvoices_item1EntityList;
this.dataForm.arinvoices_item0List = list2.arinvoices_item0EntityList; this.dataForm.arinvoices_item0List = list2.arinvoices_item0EntityList;
for (let i = 0;i<list2.arinvoices_item0EntityList.length;i++){ for (let i = 0;i<list2.arinvoices_item0EntityList.length;i++){
// list2.list0[i].invoiceCode;
// debugger
// this.dataForm.arinvoices_item0List[i].invoiceCode = list2.list0[i].invoiceCode;
// debugger
this.dataForm.arinvoices_item0List[i].attachMent = JSON.parse(list2.arinvoices_item0EntityList[i].attachMent); this.dataForm.arinvoices_item0List[i].attachMent = JSON.parse(list2.arinvoices_item0EntityList[i].attachMent);
} }

@ -9,6 +9,7 @@
<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>
<template v-if="showAll">
<el-col :span="6"> <el-col :span="6">
<el-form-item label="合同名称"> <el-form-item label="合同名称">
<el-input v-model="query.contractName" placeholder="请输入" clearable></el-input> <el-input v-model="query.contractName" placeholder="请输入" clearable></el-input>
@ -37,10 +38,15 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</template>
<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-button type="text" icon="el-icon-arrow-down" @click="showAll=true"
v-if="!showAll">展开</el-button>
<el-button type="text" icon="el-icon-arrow-up" @click="showAll=false" v-else>
收起</el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
@ -124,7 +130,7 @@
<el-button type="text" <el-button type="text"
@click="addOrUpdateHandle(scope.row)">编辑 @click="addOrUpdateHandle(scope.row)">编辑
</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)">
</el-button> </el-button>
<el-button type="text" <el-button type="text"
@click="goDetail(scope.row.id)">详情 @click="goDetail(scope.row.id)">详情
@ -162,6 +168,7 @@
components: {JNPFForm, JNPFForm2, JNPFForm3, JNPFForm4, JNPFForm5, ExportBox, Detail}, components: {JNPFForm, JNPFForm2, JNPFForm3, JNPFForm4, JNPFForm5, ExportBox, Detail},
data() { data() {
return { return {
showAll: false,
detailVisible: false, detailVisible: false,
query: { query: {
documentNo: undefined, documentNo: undefined,
@ -174,7 +181,9 @@
}, },
list: [], list: [],
listLoading: true, listLoading: true,
multipleSelection: [], total: 0, multipleSelection: [],
multipleSelectionItem: [],
total: 0,
listQuery: { listQuery: {
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
@ -442,12 +451,20 @@
this.listLoading = false this.listLoading = false
}) })
}, },
handleDel(id) { handleDel(row) {
if (row.status == '2' || row.status == '3') {
this.$message({
type: 'error',
message: '发票录入后无法删除',
duration: 1500
});
return
}
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
request({ request({
url: `/api/saleorder/Saleorderitem/${id}`, url: `/api/saleorder/Saleorderitem/${row.id}`,
method: 'DELETE' method: 'DELETE'
}).then(res => { }).then(res => {
this.$message({ this.$message({
@ -462,6 +479,7 @@
}); });
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelectionItem = val
const res = val.map(item => item.id) const res = val.map(item => item.id)
this.multipleSelection = res this.multipleSelection = res
}, },
@ -474,6 +492,20 @@
}) })
return return
} }
var statusFlag = true;
this.multipleSelectionItem.forEach((item, index)=>{
if(item.status == '2' || item.status == '3'){
statusFlag = false;
}
});
if(!statusFlag){
this.$message({
type: 'error',
message: '发票录入后无法删除',
duration: 1000
});
return
}
const ids = this.multipleSelection.join() const ids = this.multipleSelection.join()
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', { this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
type: 'warning' type: 'warning'

Loading…
Cancel
Save