销售问题

product
Vayne 2 years ago
parent 7b643cf0f9
commit 70a8894243

@ -115,7 +115,7 @@ public class CollectionController {
}
/**
*
*
*
* @param param
* @return
@ -137,6 +137,20 @@ public class CollectionController {
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")
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.service.Collection_item0Service;
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.materialvo.entity.MaterialEntity;
import jnpf.materialvo.service.MaterialService;
@ -38,6 +42,7 @@ import jnpf.reservoirarea.entity.ReservoirareaEntity;
import jnpf.reservoirarea.service.ReservoirareaService;
import jnpf.saleorder.mapper.ReceiptoutsoitemMapper;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;
import org.springframework.transaction.annotation.Transactional;
@ -145,6 +150,10 @@ public class SaleorderitemController {
private Arinvoices_item1Service arinvoices_item1Service;
@Autowired
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){
}
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);
// for(ReceiptoutsoitemEntity receiptoutsoitemEntity : ReceiptoutsoitemList){
@ -711,31 +795,31 @@ public class SaleorderitemController {
SaleorderitemEntity entity= saleorderitemService.getInfo(id);
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);
for(Salesorder_item0Model jg_salesorder_item0Model : jg_salesorder_item0ModelList){
Map<String,Object> vehicleIdMap = new HashMap<>();
jg_salesorder_item0Model.setVehicleId(generaterSwapUtil.getPopupSelectValue("381432451370615173","id","ticketno",jg_salesorder_item0Model.getVehicleId(),vehicleIdMap));
Map<String,Object> materialIdMap = new HashMap<>();
jg_salesorder_item0Model.setMaterialId(generaterSwapUtil.getPopupSelectValue("381037852907038533","id","item_name",jg_salesorder_item0Model.getMaterialId(),materialIdMap));
}
// for(Salesorder_item0Model jg_salesorder_item0Model : jg_salesorder_item0ModelList){
// Map<String,Object> vehicleIdMap = new HashMap<>();
// jg_salesorder_item0Model.setVehicleId(generaterSwapUtil.getPopupSelectValue("381432451370615173","id","ticketno",jg_salesorder_item0Model.getVehicleId(),vehicleIdMap));
// Map<String,Object> materialIdMap = new HashMap<>();
// jg_salesorder_item0Model.setMaterialId(generaterSwapUtil.getPopupSelectValue("381037852907038533","id","item_name",jg_salesorder_item0Model.getMaterialId(),materialIdMap));
// }
vo.setSalesorder_item0List(jg_salesorder_item0ModelList);
List<ReceiptoutsoitemEntity> jg_receiptoutList = saleorderitemService.GetReceiptoutsoitemList(id);
List<ReceiptoutsoitemModel> jg_receiptoutModelList = new ArrayList<>();
if (jg_receiptoutList.size()>0) {
List<Receiptout_item0Entity> list = saleorderitemService.getReceiptout(jg_receiptoutList.get(0).getId());
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());
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));
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);
@ -781,10 +865,18 @@ public class SaleorderitemController {
//附表数据转换
//添加到详情表单对象中
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));
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());

@ -151,6 +151,9 @@ public class Salesorder_item0Entity {
@TableField(exist = false)
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 jnpf.poundlist.entity.PoundlistEntity;
import jnpf.poundlist.model.poundlist.PoundlistPagination;
import jnpf.receiptout.entity.Receiptout_item0Entity;
import jnpf.saleorder.entity.SaleorderitemEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.saleorder.entity.Salesorder_item0Entity;
import jnpf.saleorder.model.saleorderitem.SaleorderitemPagination;
import org.apache.ibatis.annotations.Param;
@ -23,5 +25,7 @@ import java.util.List;
public interface SaleorderitemMapper extends BaseMapper<SaleorderitemEntity> {
IPage<SaleorderitemEntity> querySalesOrder(@Param("page") Page<SaleorderitemEntity> page, @Param("saleorderitemPagination") SaleorderitemPagination saleorderitemPagination);
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")
private String invoiceCode;
/** 金额 **/
@JsonProperty("invoiceQuantity")
private String invoiceQuantity;
/** 金额 **/
@JsonProperty("involceAmount")
private String involceAmount;
@ -48,9 +52,9 @@ public class Arinvoices_item0soitemModel {
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")
private Date invoiceDate;
private Long invoiceDate;
/** 开票人 **/
@JsonProperty("creatorUserName")
private String creatorUserName;

@ -24,9 +24,9 @@ public class CollectionsoitemModel {
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")
private Date businessDate;
private Long businessDate;
/** 收款金额 **/
@JsonProperty("amountCollected")
private String amountCollected;

@ -24,9 +24,9 @@ public class PaymentsoitemModel {
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")
private Date duedate;
private Long duedate;
/** 付款金额 **/
@JsonProperty("paymentamount")
private String paymentamount;

@ -25,9 +25,9 @@ public class ReceiptoutsoitemModel {
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")
private Date issueDate;
private Long issueDate;
/** 车牌号 **/
@JsonProperty("vehicleId")
private String vehicleId;
@ -80,6 +80,15 @@ public class ReceiptoutsoitemModel {
@JsonProperty("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;
/** 退货日期 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("creatorTime")
private Date creatorTime;
private Long creatorTime;
/** 退货数量 **/
@JsonProperty("refundNum")
private String refundNum;

@ -77,5 +77,11 @@ public class Salesorder_item0Model {
@JsonProperty("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<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);
}
@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
a.*,
b.supplier_nm customerNm,
c.contract_name contractNm
a.*,
b.supplier_nm customerNm,
c.contract_name contractNm
FROM
jg_collection a
LEFT JOIN jg_customer b ON a.customer_id = b.id
LEFT JOIN jg_contract c ON a.contract_id = c.id
where 1=1
and a.delete_mark = '0'
jg_collection a
LEFT JOIN jg_customer b ON a.customer_id = b.id
LEFT JOIN jg_contract c ON a.contract_id = c.id
where 1=1
and a.delete_mark = '0' and b.delete_mark = '0' and c.delete_mark = '0'
/*添加权限*/
<if test="collectionPagination.departmentId != null and 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_salesorder c on a.source_no = c.id
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 != ''">
AND a.department_id = #{receiptoutPagination.departmentId}
@ -20,7 +20,6 @@
<if test="receiptoutPagination.orgnizeId != null and receiptoutPagination.orgnizeId != ''">
AND a.orgnize_id = #{receiptoutPagination.orgnizeId}
</if>
<if test="receiptoutPagination.documentNo != null and receiptoutPagination.documentNo != ''">
and a.document_no LIKE CONCAT('%',#{receiptoutPagination.documentNo},'%')
</if>

@ -13,7 +13,7 @@
LEFT JOIN jg_contract c on b.contract_id = c.id
LEFT JOIN jg_customer d on b.customer_id = d.id
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 != ''">
AND a.department_id = #{salebackPagination.departmentId}
@ -61,8 +61,8 @@ FROM
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 jg_customer g ON c.customer_id = g.id
WHERE
a.sales_back_id = #{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 g.delete_mark = '0'
and a.sales_back_id = #{id}
and a.delete_mark = '0'
</select>
</mapper>

@ -12,7 +12,7 @@
left join jg_contract b on a.contract_id = b.id
left join jg_customer c on a.customer_id = c.id
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 != ''">
AND a.department_id = #{saleorderitemPagination.departmentId}
@ -63,8 +63,38 @@ FROM
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 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}
</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>

@ -1,83 +1,118 @@
<template>
<el-dialog title="详情"
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="1000px">
width="1500px">
<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">
<el-col :span="8" >
<el-form-item label="单据编号"
prop="documentNo" >
<p>{{dataForm.documentNo}}</p>
<el-input v-model="dataForm.documentNo"
placeholder="系统自动生成" readonly >
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="业务日期"
prop="businessDate" >
<p>{{jnpf.dateFormat(dataForm.businessDate)}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-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-date-picker v-model="dataForm.businessDate"
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" disabled>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="币别 "
prop="currency" >
<el-select v-model="dataForm.currency"
placeholder="请选择" clearable :style='{"width":"100%"}' 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-tabs v-model="activezbtwpv" tab-position="top" class="mb-20">
<el-tab-pane label="应收明细">
@ -86,54 +121,84 @@
<div class="JNPF-common-title">
<h2></h2>
</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 prop="materialId" label="物料">
<template slot-scope="scope">
<p>{{scope.row.materialId}}</p>
</template>
<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="397736371898382533" :columnOptions="arinvoices_item1materialIdcolumnOptions" propsValue="id" relationField="item_name" popupType="dialog"
popupWidth="800px" disabled
>
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="quantity" label="数量">
<template slot-scope="scope">
<p>{{scope.row.quantity}}</p>
</template>
<el-table-column prop="quantity" label="数量" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.quantity"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="unitPrice" label="单价">
<template slot-scope="scope">
<p>{{scope.row.unitPrice}}</p>
</template>
</el-table-column>
<el-table-column prop="unit" label="单位">
<el-table-column prop="unitPrice" label="单价" align="center" width="130">
<template slot-scope="scope">
<p>{{scope.row.unit | dynamicText(unitOptions) }}</p>
</template>
<el-input v-model="scope.row.unitPrice"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="amount" label="金额">
<template slot-scope="scope">
<p>{{scope.row.amount}}</p>
<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="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="taxRate" label="税率 ">
<template slot-scope="scope">
<p>{{ scope.row.taxRate | dynamicText(taxRateOptions) }}</p>
</template>
<el-table-column prop="taxRate" label="税率 " align="center" width="130">
<template slot-scope="scope">
<el-select v-model="scope.row.taxRate"
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 prop="taxAmount" label="税额">
<template slot-scope="scope">
<p>{{scope.row.taxAmount}}</p>
</template>
<el-table-column prop="taxAmount" label="税额" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.taxAmount"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="amountNotTax" label="不含税金额">
<template slot-scope="scope">
<p>{{scope.row.amountNotTax}}</p>
</template>
<el-table-column prop="amountNotTax" label="不含税金额" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.amountNotTax"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注信息">
<template slot-scope="scope">
<p>{{scope.row.remark}}</p>
</template>
<el-table-column prop="remark" label="备注信息" align="center" width="250">
<template slot-scope="scope">
<el-input v-model="scope.row.remark"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</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="delarinvoices_item1List(scope.$index)"></el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<!-- <div class="table-actions" @click="addarinvoices_item1List()">-->
<!-- <el-button type="text" icon="el-icon-plus">添加</el-button>-->
<!-- </div>-->
</el-form-item>
</el-col>
</el-tab-pane >
@ -143,67 +208,96 @@
<div class="JNPF-common-title">
<h2></h2>
</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 prop="invoiceCode" label="发票代码">
<template slot-scope="scope">
<p>{{scope.row.invoiceCode}}</p>
</template>
<el-table-column prop="invoiceCode" label="发票代码" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.invoiceCode"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="invoiceNo" label="发票号码">
<template slot-scope="scope">
<p>{{scope.row.invoiceNo}}</p>
</template>
<el-table-column prop="invoiceNo" label="发票号码" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.invoiceNo"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="invoiceQuantity" label="发票数量">
<template slot-scope="scope">
<p>{{scope.row.invoiceQuantity}}</p>
</template>
<el-table-column prop="invoiceQuantity" label="发票数量" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.invoiceQuantity"
placeholder="请输入" clearable :style='{"width":"100%"}' @change="invoiceQuantitySum" disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="involceAmount" label="发票金额">
<template slot-scope="scope">
<p>{{scope.row.involceAmount}}</p>
</template>
<el-table-column prop="involceAmount" label="发票金额" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.involceAmount"
placeholder="请输入" clearable :style='{"width":"100%"}' @change="involceAmountSum" disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="taxRate" label="税率 ">
<template slot-scope="scope">
<p>{{ scope.row.taxRate | dynamicText(taxRateOptions) }}</p>
</template>
<el-table-column prop="taxRate" label="税率 " align="center" width="130">
<template slot-scope="scope">
<el-select v-model="scope.row.taxRate"
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 prop="taxAmount" label="税额">
<template slot-scope="scope">
<p>{{scope.row.taxAmount}}</p>
</template>
<el-table-column prop="taxAmount" label="税额" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.taxAmount"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="amountNotTax" label="不含税金额">
<template slot-scope="scope">
<p>{{scope.row.amountNotTax}}</p>
</template>
<el-table-column prop="amountNotTax" label="不含税金额" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.amountNotTax"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="invoiceStatus" label="发票状态">
<template slot-scope="scope">
<p>{{ scope.row.invoiceStatus | dynamicText(invoiceStatusOptions) }}</p>
</template>
<el-table-column prop="invoiceStatus" label="发票状态" align="center" width="130">
<template slot-scope="scope">
<el-select v-model="scope.row.invoiceStatus"
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 prop="creatorUserName" label="开票人">
<template slot-scope="scope">
<p>{{scope.row.creatorUserName}}</p>
</template>
<el-table-column prop="creatorUserName" label="开票人" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.creatorUserName"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="invoiceDate" label="开票日期">
<template slot-scope="scope">
<p>{{jnpf.dateFormat(scope.row.invoiceDate)}}</p>
</template>
<el-table-column prop="invoiceDate" label="开票日期" align="center" width="160">
<template slot-scope="scope">
<el-date-picker v-model="scope.row.invoiceDate"
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 prop="attachMent" label="发票附件">
<el-table-column prop="attachMent" label="发票附件" align="center" width="130">
<template slot-scope="scope">
<JNPF-UploadFz v-model="scope.row.attachMent"
disabled
detailed :fileSize="100" sizeUnit="MB" :limit="5" buttonText="点击上传" >
:fileSize="100" sizeUnit="MB" :limit="5" buttonText="点击上传" disabled >
</JNPF-UploadFz>
</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="delarinvoices_item0List(scope.$index)"></el-button>
</template>
</el-table-column> -->
</el-table>
<!-- <div class="table-actions" @click="addarinvoices_item0List()">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div> -->
</el-form-item>
</el-col>
</el-tab-pane >
@ -213,25 +307,27 @@
</el-form>
</el-row>
<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 type="primary" @click="dataFormSubmit()" v-if="!isDetail"> </el-button> -->
</span>
<ImportForm v-if="importFormVisible" ref="importForm" @importData="importData" />
</el-dialog>
</template>
<script>
import request from '@/utils/request'
import PrintBrowse from '@/components/PrintBrowse'
import jnpf from '@/utils/jnpf'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import ImportForm from '../saleorder/ImportForm'
export default {
components: {PrintBrowse},
components: { ImportForm },
props: [],
data() {
return {
visible: false,
loading: false,
printBrowseVisible: false,
printId: '',
isDetail: false,
dataForm: {
id :'',
documentNo : '',
businessDate : '',
amount : 0,
@ -248,51 +344,295 @@
arinvoices_item0List:[],
},
activezbtwpv:'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"}],
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"}],
rules:
{
},
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
statusOptions:[{"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: {},
watch: {},
created() {
},
mounted() {},
methods: {
dataInfo(dataAll){
let _dataAll =dataAll
for(let i=0;i<_dataAll.arinvoices_item1List.length;i++){
var _list = _dataAll.arinvoices_item1List[i];
invoiceQuantitySum(){
let sum = 0;
for (let i =0;i<this.dataForm.arinvoices_item0List.length;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) : ''
_list.attachMent = _list.attachMent? JSON.parse(_list.attachMent):[]
})
}
sum = this.jnpf.floatAdd(sum,this.dataForm.arinvoices_item0List[i].involceAmount)
}
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) {
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/arinvoices/Arinvoices/detail/'+this.dataForm.id,
url: '/api/arinvoices/Arinvoices/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
});
}else{
this.clearData(this.dataForm)
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
dataFormSubmit() {
this.$refs['elForm'].validate((valid) => {
if (valid) {
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">
<popupSelect v-model="scope.row.materialId"
placeholder="请选择" clearable :field="'materialId'+scope.$index" interfaceId="397736371898382533" :columnOptions="arinvoices_item1materialIdcolumnOptions" propsValue="id" relationField="item_name" popupType="dialog"
popupWidth="800px"
popupWidth="800px" disabled
>
</popupSelect>
</template>
@ -135,21 +135,21 @@
<el-table-column prop="quantity" label="数量" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.quantity"
placeholder="请输入" clearable :style='{"width":"100%"}'>
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="unitPrice" label="单价" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.unitPrice"
placeholder="请输入" clearable :style='{"width":"100%"}'>
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%"}'>
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>
@ -157,14 +157,14 @@
<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%"}'>
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="taxRate" label="税率 " align="center" width="130">
<template slot-scope="scope">
<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-select>
</template>
@ -172,21 +172,21 @@
<el-table-column prop="taxAmount" label="税额" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.taxAmount"
placeholder="请输入" clearable :style='{"width":"100%"}'>
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="amountNotTax" label="不含税金额" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.amountNotTax"
placeholder="请输入" clearable :style='{"width":"100%"}'>
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注信息" align="center" width="250">
<template slot-scope="scope">
<el-input v-model="scope.row.remark"
placeholder="请输入" clearable :style='{"width":"100%"}'>
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
@ -210,7 +210,7 @@
</div>
<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 prop="invoiceCode" label="发票代码">
<el-table-column prop="invoiceCode" label="发票代码" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.invoiceCode"
placeholder="请输入" clearable :style='{"width":"100%"}'>
@ -241,7 +241,7 @@
<el-table-column prop="taxRate" label="税率 " align="center" width="130">
<template slot-scope="scope">
<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-select>
</template>
@ -275,14 +275,14 @@
</el-input>
</template>
</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">
<el-date-picker v-model="scope.row.invoiceDate"
placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" >
</el-date-picker>
</template>
</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">
<JNPF-UploadFz v-model="scope.row.attachMent"
:fileSize="100" sizeUnit="MB" :limit="5" buttonText="点击上传" >
@ -375,10 +375,32 @@
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)
}
})
}
sum = this.jnpf.floatAdd(sum,this.dataForm.arinvoices_item0List[i].involceAmount)
}
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){
param.checkedList.forEach((column, index) => {
if(column.taxRate == '0.13'){

@ -9,6 +9,7 @@
<el-input v-model="query.documentNo" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<template v-if="showAll">
<el-col :span="6">
<el-form-item label="来源单号">
<el-input v-model="query.sourceOrderNo" placeholder="请输入" clearable> </el-input>
@ -32,10 +33,15 @@
</el-date-picker>
</el-form-item>
</el-col>
</template>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
<el-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-col>
</el-form>
@ -47,8 +53,8 @@
<!-- </el-button>-->
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
</el-button>
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
</el-button>
<!-- <el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
</el-button> -->
</div>
<div class="JNPF-common-head-right">
<el-tooltip effect="dark" content="刷新" placement="top">
@ -97,8 +103,8 @@ width="150" >
<el-button type="text"
@click="addOrUpdateHandle(scope.row.id)" >编辑
</el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button>
<!-- <el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button> -->
<el-button type="text"
@click="goDetail(scope.row.id)">详情
</el-button>
@ -126,6 +132,7 @@ width="150" >
components: {JNPFForm, ExportBox,Detail},
data() {
return {
showAll: false,
detailVisible: false,
query: {
documentNo:undefined,

@ -1,246 +1,678 @@
<template>
<el-dialog title="详情"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="1000px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="8" >
<el-form-item label="单据编号"
prop="documentNo" >
<p>{{dataForm.documentNo}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="客户名称"
prop="customerId" >
<p>{{dataForm.customerId}}</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="amountCollected" >
<p>{{dataForm.amountCollected}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="收款账户"
prop="collectionCount" >
<p>{{dataForm.collectionCount}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="收款银行"
prop="collectionBank" >
<p>{{dataForm.collectionBank}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="收款类型 "
prop="paymentType" >
<p>{{ dataForm.paymentType | dynamicText(paymentTypeOptions) }} </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="settlementType" >
<p>{{ dataForm.settlementType | dynamicText(settlementTypeOptions) }} </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="voucher" >
<JNPF-UploadFz v-model="dataForm.voucher"
disabled
detailed :fileSize="5" sizeUnit="MB" :limit="9" buttonText="点击上传" >
</JNPF-UploadFz>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="单据状态 "
prop="status" >
<p>{{ dataForm.status | dynamicText(statusOptions) }} </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="activeojnisi" 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.collection_item0List" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="amount" label="收款金额">
<template slot-scope="scope">
<p>{{scope.row.amount}}</p>
</template>
</el-table-column>
<el-table-column prop="price" label="订单金额">
<template slot-scope="scope">
<p>{{scope.row.price}}</p>
</template>
</el-table-column>
<el-table-column prop="amountCollected" label="已收款金额">
<template slot-scope="scope">
<p>{{scope.row.amountCollected}}</p>
</template>
</el-table-column>
<el-table-column prop="salesorderId" label="销售订单编号">
<template slot-scope="scope">
<p>{{scope.row.salesorderId}}</p>
</template>
</el-table-column>
<el-table-column prop="contractId" label="合同编号">
<template slot-scope="scope">
<p>{{scope.row.contractId}}</p>
</template>
</el-table-column>
<el-table-column prop="num" label="重量">
<template slot-scope="scope">
<p>{{scope.row.num}}</p>
</template>
</el-table-column>
<!-- <el-table-column prop="taxRate" label="税率">-->
<!-- <template slot-scope="scope">-->
<!-- <p>{{ scope.row.taxRate | dynamicText(taxRateOptions) }}</p>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column prop="advanceAmount" label="垫资金额">
<template slot-scope="scope">
<p>{{scope.row.advanceAmount}}</p>
</template>
</el-table-column>
<el-table-column prop="rate" label="税额">
<template slot-scope="scope">
<p>{{scope.row.rate}}</p>
</template>
</el-table-column>
<el-table-column prop="notPrice" label="不含税金额">
<template slot-scope="scope">
<p>{{scope.row.notPrice}}</p>
</template>
</el-table-column>
<el-table-column prop="creatorTime" label="业务日期">
<template slot-scope="scope">
<p>{{jnpf.dateFormat(scope.row.creatorTime)}}</p>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-col>
</el-tab-pane >
</el-tabs>
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1500px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
<template v-if="!loading">
<el-col :span="8">
<el-form-item label="单据编号" prop="documentNo">
<el-input v-model="dataForm.documentNo" placeholder="系统自动生成" readonly>
</el-input>
</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="393371066040385285" :columnOptions="customerNamecolumnOptions" propsValue="id"
relationField="supplier_nm" popupType="dialog" popupTitle="选择数据" popupWidth="800px"
@change="popupSelect" disabled>
</popupSelect>
</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="399835312982972805" :bissId="dataForm.customerId" :columnOptions="contractNamecolumnOptions" propsValue="id"
relationField="contract_name" popupType="dialog" popupTitle="选择数据" popupWidth="800px" @change="contractSelect" disabled
>
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收款金额" prop="amountCollected">
<el-input v-model="dataForm.amountCollected" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收款账户" prop="collectionCount">
<el-input v-model="dataForm.collectionCount" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收款银行" prop="collectionBank">
<el-input v-model="dataForm.collectionBank" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收款类型 " prop="paymentType">
<el-select v-model="paymentType" placeholder="请选择" clearable :style='{"width":"100%"}' @change="paymentTypeChange" disabled>
<el-option v-for="(item, index) in paymentTypeOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="币别 " prop="currency">
<el-select v-model="currency" placeholder="请选择" clearable :style='{"width":"100%"}' @change="currencyChange" 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="settlementType">
<el-select v-model="settlementType" placeholder="请选择" clearable :style='{"width":"100%"}' @change="settlementTypeChange" disabled>
<el-option v-for="(item, index) in settlementTypeOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注信息" prop="remark">
<el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="收款凭证" prop="voucher">
<JNPF-UploadFz v-model="dataForm.voucher" :fileSize="5" sizeUnit="MB" :limit="9" buttonText="点击上传" disabled>
</JNPF-UploadFz>
</el-form-item>
</el-col>
<!-- <el-col :span="8">-->
<!-- <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="8">-->
<!-- <el-form-item label="制单人" prop="creatorUserName">-->
<!-- <el-input v-model="dataForm.creatorUserName" placeholder="请输入" clearable :style='{"width":"100%"}'>-->
<!-- </el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="24">
<el-tabs v-model="activeojnisi" 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.collection_item0List" size='mini' show-summary :summary-method="getSummaries">
<el-table-column type="index" width="50" label="序号" align="center" />
<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%"}' @change="amountSum" disabled>
</el-input>
</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="amountCollected" label="已收款金额" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.amountCollected" placeholder="请输入" clearable
:style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="salesorderId" label="销售订单编号" align="center" width="130">
<template slot-scope="scope">
<popupSelect v-model="scope.row.salesorderId" placeholder="请选择" clearable
:field="'salesorderId'+scope.$index" interfaceId="393372436705378053"
:columnOptions="jg_collection_item0deleteTimecolumnOptions" propsValue="id"
relationField="document_no" popupType="dialog" popupWidth="800px"
:bissId="dataForm.contractId" @change="popupSelect2" disabled>
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="contractId" label="合同编号" align="center" width="130">
<template slot-scope="scope">
<popupSelect v-model="scope.row.contractId" placeholder="请选择" clearable
:field="'contractId'+scope.$index" interfaceId="398848549678332037"
:columnOptions="jg_collection_item0deleteTimecolumnOptions" propsValue="id"
relationField="contract_code" popupType="dialog" popupWidth="800px" disabled
>
</popupSelect>
</template>
</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>
</template>
</el-form>
</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 @click="visible = false"> </el-button>
<!-- <el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> </el-button> -->
</span>
</el-dialog>
</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 :'',
customerId: '',
contractId: '',
documentNo : '',
customerName : '',
amountCollected : '',
collectionCount : '',
collectionBank : '',
paymentType : "0",
currency : "0",
settlementType : "0",
remark : '',
voucher : [],
status : "0",
creatorUserName : '',
collection_item0List:[],
},
activeojnisi:'0',
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"}],
}
import request from '@/utils/request'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
export default {
components: {},
props: [],
data() {
return {
paymentType: "0",
currency: "0",
settlementType: "0",
visible: false,
loading: false,
isDetail: false,
dataForm: {
code: '',
customerCode: '',
documentNo: '',
customerName: '',
customerId: '',
contractId: '',
amountCollected: '',
collectionCount: '',
collectionBank: '',
paymentType: "0",
currency: "0",
settlementType: "0",
remark: '',
voucher: [],
status: "0",
creatorUserName: '',
collection_item0List: [],
},
computed: {},
watch: {},
created() {
},
mounted() {},
methods: {
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
activeojnisi: '0',
rules: {
customerId: [
{
required: true,
message: '请选择',
trigger: 'change'
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/collection/Collection/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
})
],
contractId: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
},
}
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>

@ -489,6 +489,34 @@
},
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;

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

@ -1,71 +1,107 @@
<template>
<el-dialog title="详情"
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="1000px">
width="1500px">
<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">
<el-col :span="8" >
<el-form-item label="单据编号"
prop="documentNo" >
<p>{{dataForm.documentNo}}</p>
<el-input v-model="dataForm.documentNo"
placeholder="系统自动生成" readonly >
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="业务类型"
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-col>
<el-col :span="8" >
<el-form-item label="来源单号"
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-col>
<el-col :span="8" >
<el-form-item label="出库金额"
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-col>
<el-col :span="8" >
<el-form-item label="币别"
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-col>
<el-col :span="8" >
<el-form-item label="出库数量"
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-col>
<el-col :span="8" >
<el-form-item label="客户"
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-col>
<el-col :span="16" >
<el-form-item label="备注"
prop="remark" >
<p>{{dataForm.remark}}</p>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="出库日期"
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-input v-model="dataForm.remark"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</el-form-item>
</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-tabs v-model="activezlqlfb" tab-position="top" class="mb-20">
<el-tab-pane label="磅单明细">
@ -74,69 +110,111 @@
<div class="JNPF-common-title">
<h2></h2>
</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 prop="vehicleId" label="车牌号">
<template slot-scope="scope">
<p>{{scope.row.vehicleId}}</p>
</template>
<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="398732963950472005" :columnOptions="receiptout_item0vehicleIdcolumnOptions" propsValue="id" relationField="ticketno" popupType="dialog"
popupWidth="800px" disabled
hasPage :pageSize="20" >
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="materialId" label="物料名称">
<template slot-scope="scope">
<p>{{scope.row.materialId}}</p>
</template>
<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="398719564478785669" :columnOptions="receiptout_item0materialIdcolumnOptions" propsValue="id" relationField="item_name" popupType="dialog"
popupWidth="800px" disabled
>
</popupSelect>
</template>
</el-table-column>
<el-table-column prop="reservoirareaId" label="库区名称">
<template slot-scope="scope">
<p>{{scope.row.reservoirareaId}}</p>
<el-table-column prop="reservoirareaId" label="库区名称" align="center" width="130">
<template slot-scope="scope">
<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>
</el-table-column>
<el-table-column prop="warehouseId" label="仓库名称">
<template slot-scope="scope">
<p>{{scope.row.warehouseId}}</p>
</el-table-column>
<el-table-column prop="warehouseId" label="仓库名称" align="center" width="130">
<template slot-scope="scope">
<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>
</el-table-column>
<el-table-column prop="deliveryNum" label="出库数量">
<template slot-scope="scope">
<p>{{scope.row.deliveryNum}}</p>
</el-table-column>
<el-table-column prop="batchNo" label="批次号" align="center" width="180">
<template slot-scope="scope">
<el-input v-model="scope.row.batchNo"
placeholder="系统自动生成" readonly>
</el-input>
</template>
</el-table-column>
<el-table-column prop="unit" label="计量单位">
<template slot-scope="scope">
<p>{{ scope.row.unit | dynamicText(unitOptions) }}</p>
</el-table-column>
<el-table-column prop="deliveryNum" label="出库数量" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.deliveryNum"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="price" label="单价">
<template slot-scope="scope">
<p>{{scope.row.price}}</p>
</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="rate" label="税率">
<template slot-scope="scope">
<p>{{ scope.row.rate | dynamicText(rateOptions) }}</p>
</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="amount" label="金额">
<template slot-scope="scope">
<p>{{scope.row.amount}}</p>
</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="rateAmount" label="税额">
<template slot-scope="scope">
<p>{{scope.row.rateAmount}}</p>
</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="batchNo" label="批次号">
<template slot-scope="scope">
<p>{{scope.row.batchNo}}</p>
</el-table-column>
<el-table-column prop="rateAmount" label="税额" align="center" width="130">
<template slot-scope="scope">
<el-input v-model="scope.row.rateAmount"
placeholder="请输入" clearable :style='{"width":"100%"}' disabled>
</el-input>
</template>
</el-table-column>
<el-table-column prop="poundType" label="磅单类型">
<template slot-scope="scope">
<p>{{ scope.row.poundType | dynamicText(poundTypeOptions) }}</p>
</el-table-column>
<el-table-column prop="poundType" label="磅单类型" align="center" width="130">
<template slot-scope="scope">
<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>
</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>
<!-- <div class="table-actions" @click="addreceiptout_item0List()">-->
<!-- <el-button type="text" icon="el-icon-plus">添加</el-button>-->
<!-- </div>-->
</el-form-item>
</el-col>
</el-tab-pane >
@ -147,24 +225,23 @@
</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 PrintBrowse from '@/components/PrintBrowse'
import jnpf from '@/utils/jnpf'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
export default {
components: {PrintBrowse},
components: {},
props: [],
data() {
return {
visible: false,
loading: false,
printBrowseVisible: false,
printId: '',
isDetail: false,
dataForm: {
id :'',
documentNo : '',
type : "0",
salesId : "XS002",
@ -172,7 +249,7 @@
amount : '',
currency : "0",
num : '',
customerName : '',
customerId : '',
remark : '',
issueDate : '',
status : "0",
@ -183,47 +260,203 @@
receiptout_item0List:[],
},
activezlqlfb:'0',
typeOptions:[{"fullName":"销售出库","id":"0"},{"fullName":"购销出库","id":"1"}],
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"审批中","id":"1"},{"fullName":"已审批","id":"2"}],
rules:
{
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"}],
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"}],
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"},],
receiptout_item0materialIdcolumnOptions:[ {"label":"物料编码","value":"item_code"}, {"label":"物料名称","value":"item_name"}, {"label":"单位","value":"primary_unit_of_measure"}, {"label":"默认入库区","value":"in_area"}, {"label":"默认出库区","value":"out_area"},],
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: {},
watch: {},
created() {
},
mounted() {},
methods: {
dataInfo(dataAll){
let _dataAll =dataAll
for(let i=0;i<_dataAll.receiptout_item0List.length;i++){
var _list = _dataAll.receiptout_item0List[i];
areaSelect(a,b){
for (let i = 0;i<this.dataForm.receiptout_item0List.length;i++) {
if (a == this.dataForm.receiptout_item0List[i].reservoirareaId) {
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) {
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/receipout/Receiptout/detail/'+this.dataForm.id,
url: '/api/receipout/Receiptout/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
});
}else{
this.clearData(this.dataForm)
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
dataFormSubmit() {
this.$refs['elForm'].validate((valid) => {
if (valid) {
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-form-item>
</el-col>
<template v-if="showAll">
<el-col :span="6">
<el-form-item label="来源单号">
<el-input v-model="query.sourceOrderNo" placeholder="请输入" clearable></el-input>
@ -37,10 +38,15 @@
</el-date-picker>
</el-form-item>
</el-col>
</template>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
<el-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-col>
</el-form>
@ -52,8 +58,8 @@
<!-- </el-button>-->
<el-button type="text" icon="el-icon-download" @click="exportData()">
</el-button>
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">
</el-button>
<!-- <el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">
</el-button> -->
</div>
<div class="JNPF-common-head-right">
<el-tooltip effect="dark" content="刷新" placement="top">
@ -106,8 +112,8 @@
<template slot-scope="scope">
<el-button type="text" v-has="'btn_edit'" @click="addOrUpdateHandle(scope.row.id)">
</el-button>
<el-button type="text" v-has="'btn_remove'" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button>
<!-- <el-button type="text" v-has="'btn_remove'" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button> -->
<el-button type="text" v-has="'btn_detail'" @click="goDetail(scope.row.id)">
</el-button>
</template>
@ -136,6 +142,7 @@
components: {JNPFForm, ExportBox, Detail},
data() {
return {
showAll: false,
detailVisible: false,
query: {
documentNo: undefined,

@ -1,241 +1,504 @@
<template>
<el-dialog title="详情"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="1000px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="8" >
<el-form-item label="单据编号"
prop="documentNo" >
<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"}],
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1500px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px"
label-position="right">
<template v-if="!loading">
<el-col :span="8">
<el-form-item label="单据编号" prop="documentNo">
<el-input v-model="dataForm.documentNo" placeholder="请输入" clearable
:style='{"width":"100%"}' readonly>
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"}],
}
},
computed: {},
watch: {},
created() {
</el-input>
</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="383568951197606085"
:columnOptions="salesOrderIdcolumnOptions" :excludeFields="excludeFields" propsValue="id" relationField="document_no"
popupType="dialog" popupTitle="选择数据" popupWidth="800px" @change="popupSelectChange" disabled>
},
mounted() {},
methods: {
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
debugger
},
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="币别" prop="currency">
<el-select v-model="dataForm.currency" placeholder="请选择" clearable
:style='{"width":"100%"}' disabled>
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
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-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="退款金额" prop="refundAmount" >
<el-input v-model="dataForm.refundAmount" readonly clearable :style='{"width":"100%"}' disabled>
})
},
},
}
</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>

File diff suppressed because it is too large Load Diff

@ -262,8 +262,8 @@
</el-form-item>
</el-col>
</el-tab-pane>
<!-- <el-tab-pane label="发货信息">-->
<!-- <el-col :span="24" >-->
<!-- <el-tab-pane label="发货信息">-->
<!-- <el-col :span="24" > -->
<!-- <el-form-item label-width="0">-->
<!-- <div class="JNPF-common-title">-->
<!-- <h2></h2>-->

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

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

Loading…
Cancel
Save