jg-waiwang-pro
胡川虎 4 months ago
parent 23042bece4
commit 525f734a6d

@ -63,6 +63,24 @@
</jnpf-number-box>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('applyWeight')" :required="requiredList.applyWeight" label="申请重量"
prop="applyAmount">
<jnpf-number-box v-model="dataForm.applyWeight" :disabled="judgeWrite('applyWeight')"
@change="changeData('applyWeight',-1)" :controls="false" placeholder="数字文本"
:step="1">
</jnpf-number-box>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('annex')" :required="requiredList. annex" label="附件文件"
prop=" annex">
<jnpf-file v-model="dataForm. annex" :disabled="judgeWrite(' annex')"
@change="changeData(' annex',-1)" :list="dataForm. annex" sizeUnit="MB" :fileSize="10"
:limit="1" pathType="defaultPath" :isAccount="0">
</jnpf-file>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('remark')" :required="requiredList.remark" label="备注" prop="remark">
<u-input v-model="dataForm.remark" :disabled="judgeWrite('remark')"
@ -71,6 +89,62 @@
</u-input>
</u-form-item>
</view>
<view class="jnpf-table" v-if="false">
<view class="jnpf-table-item" v-for="(item,i) in dataForm.paymentapplicationsettlementList" :key="i">
<view class="jnpf-table-item-title u-flex u-row-between">
<text class="jnpf-table-item-title-num">关联结算单({{i+1}})</text>
<view class="jnpf-table-item-title-action"
v-if=" !judgeWrite('paymentapplicationsettlementList') && dataForm.paymentapplicationsettlementList.length>0"
@click="delpaymentapplicationsettlementList(i)">删除</view>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('paymentapplicationsettlementList-settlementId')"
:required="requiredList['paymentapplicationsettlementList-settlementId']" label="结算单id">
<u-input v-model="dataForm.paymentapplicationsettlementList[i].settlementId"
:disabled="judgeWrite('paymentapplicationsettlementList')||judgeWrite('paymentapplicationsettlementList-settlementId')"
@change="changeData('paymentapplicationsettlement-settlementId',i)" input-align='right'
clearable placeholder="请输入" :style='{"width":"100%"}'>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('paymentapplicationsettlementList-settlementCode')"
:required="requiredList['paymentapplicationsettlementList-settlementCode']" label="结算单编号">
<u-input v-model="dataForm.paymentapplicationsettlementList[i].settlementCode"
:disabled="judgeWrite('paymentapplicationsettlementList')||judgeWrite('paymentapplicationsettlementList-settlementCode')"
@change="changeData('paymentapplicationsettlement-settlementCode',i)"
input-align='right' clearable placeholder="请输入" :style='{"width":"100%"}'>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('paymentapplicationsettlementList-settlementAmount')"
:required="requiredList['paymentapplicationsettlementList-settlementAmount']" label="结算金额">
<u-input v-model="dataForm.paymentapplicationsettlementList[i].settlementAmount"
:disabled="judgeWrite('paymentapplicationsettlementList')||judgeWrite('paymentapplicationsettlementList-settlementAmount')"
@change="changeData('paymentapplicationsettlement-settlementAmount',i)"
input-align='right' addonAfter="元" clearable placeholder="请输入"
:style='{"width":"100%"}'>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('paymentapplicationsettlementList-orderCode')"
:required="requiredList['paymentapplicationsettlementList-orderCode']" label="订单编号">
<u-input v-model="dataForm.paymentapplicationsettlementList[i].orderCode"
:disabled="judgeWrite('paymentapplicationsettlementList')||judgeWrite('paymentapplicationsettlementList-orderCode')"
@change="changeData('paymentapplicationsettlement-orderCode',i)" input-align='right'
clearable placeholder="请输入" :style='{"width":"100%"}'>
</u-input>
</u-form-item>
</view>
</view>
<view class="jnpf-table-addBtn" @click="addpaymentapplicationsettlementList"
v-if="!judgeWrite('paymentapplicationsettlementList')">
<u-icon name="plus" color="#2979ff"></u-icon>
<span>{{dataForm.paymentapplicationsettlementList.length==0?"添加关联结算单":"添加"}}</span>
</view>
</view>
</u-form>
<u-modal v-model="show" :content="content" width='70%' border-radius="16"
:content-style="{fontSize: '28rpx',padding: '20rpx',lineHeight: '44rpx',textAlign: 'left'}"
@ -122,6 +196,7 @@
remark: '',
closeCaseRemark: '',
annex: [],
paymentapplicationsettlementList: [],
},
rules: {
type: [{
@ -152,6 +227,9 @@
typeOptions: [{
"fullName": "采购付款",
"id": "1"
}, {
"fullName": "销售付款",
"id": "2"
}],
typeProps: {
"label": "fullName",
@ -183,7 +261,9 @@
labelwidth: 100 * 1.5,
menuId: '',
jurisdictionType: '',
ruleList: {},
ruleList: {
paymentapplicationsettlementList: {},
},
interfaceRes: {
type: [],
code: [],
@ -216,8 +296,19 @@
remark: [],
closeCaseRemark: [],
annex: [],
paymentapplicationsettlementsettlementId: [],
paymentapplicationsettlementsettlementCode: [],
paymentapplicationsettlementsettlementAmount: [],
paymentapplicationsettlementorderCode: [],
},
regList: {
paymentapplicationsettlementList: {
settlementId: [],
settlementCode: [],
settlementAmount: [],
orderCode: [],
},
},
regList: {},
ableAll: {},
childIndex: -1,
dataValue: {},
@ -314,7 +405,9 @@
},
watch: {
dataForm: {
handler(val, oldVal) {},
handler(val, oldVal) {
this.paymentapplicationsettlement()
},
deep: true
}
},
@ -494,6 +587,31 @@
}
return timeDataValue;
},
paymentapplicationsettlement() {
let table = this.dataForm.paymentapplicationsettlementList
let summaryField = []
let summaryFieldName = {}
let data = {}
let thousandsField = []
for (let i in summaryField) {
let map = {}
let val = 0
for (let j = 0; j < table.length; j++) {
let summary = table[j][summaryField[i]];
if (summary) {
let data = isNaN(summary) ? 0 : Number(summary)
val += data
}
}
map.id = summaryField[i];
map.name = summaryFieldName[summaryField[i]];
map.val = (thousandsField.includes(summaryField[i])) ? Number(val).toLocaleString('zh', {
maximumFractionDigits: '2'
}) : val;
data[summaryField[i]] = map;
}
return data;
},
initData() {
this.$nextTick(function() {
if (this.dataForm.id) {
@ -525,6 +643,42 @@
this.dataForm.id = this.dataForm.id
this.dataInfo(dataForm)
},
addpaymentapplicationsettlementList() {
let value = {}
this.tableKey = 'paymentapplicationsettlementList';
this.getpaymentapplicationsettlementList(value)
this.childIndex = -1
this.collapse()
},
delpaymentapplicationsettlementList(index) {
var that = this
uni.showModal({
title: '提示',
content: '确认删除该条信息吗?',
success: function(res) {
if (res.confirm) {
that.dataForm.paymentapplicationsettlementList.splice(index, 1);
that.collapse()
}
}
})
},
getpaymentapplicationsettlementList(value) {
let item = {
settlementId: '',
settlementCode: '',
settlementAmount: '',
orderCode: '',
}
let result = {
...item,
...value
}
this.dataForm.paymentapplicationsettlementList.push(result)
this.childIndex = this.dataForm.paymentapplicationsettlementList.length - 1
this.isEdit = true
this.isEdit = false
},
dataList() {
var _data = this.dataForm;
return _data;
@ -534,6 +688,12 @@
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
if(!_dataAll.paymentapplicationsettlementList){
_dataAll.paymentapplicationsettlementList = [];
}
for (let i = 0; i < _dataAll.paymentapplicationsettlementList.length; i++) {
this.childIndex = i
}
this.childIndex = -1
this.collapse()
},

@ -122,7 +122,12 @@
IFNULL(j.price_rate,0) contractPrice,
f.unit settlementUnit,
k.name productName,
IFNULL(ROUND(c.purchase_amount / f.net_weight, 6),0) settlementPrice
IFNULL(ROUND(c.purchase_amount / f.net_weight, 6),0) settlementPrice,
m.business_price businessPrice,
m.tax tax,
m.tax_count taxCount,
m.not_tax_price notTaxPrice,
m.not_tax_count notTaxCount
from jg_warehousing_storage_poundlist a
LEFT JOIN jg_warehousing_storage b on a.warehousing_storage_id = b.id
LEFT JOIN jg_voucher c on a.voucher_id = c.id
@ -134,6 +139,7 @@
LEFT JOIN jg_contract i on h.contract_id = i.id
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
LEFT JOIN jg_product k on f.product_id = k.id
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
where a.warehousing_storage_id in
<foreach item="item" index="index" collection="storageIdList"
open="(" separator="," close=")">
@ -166,7 +172,12 @@
f.unit settlementUnit,
k.name productName,
IFNULL(ROUND(c.sale_amount / f.net_weight, 6),0) settlementPrice,
c.business_order_id businessOrderId
c.business_order_id businessOrderId,
m.business_price businessPrice,
m.tax tax,
m.tax_count taxCount,
m.not_tax_price notTaxPrice,
m.not_tax_count notTaxCount
from jg_warehousing_storage_poundlist a
LEFT JOIN jg_warehousing_storage b on a.warehousing_storage_id = b.id
LEFT JOIN jg_voucher c on a.voucher_id = c.id
@ -179,6 +190,7 @@
LEFT JOIN jg_contract i on h.contract_id = i.id
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
LEFT JOIN jg_product k on f.product_id = k.id
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
where a.warehousing_storage_id in
<foreach item="item" index="index" collection="storageIdList"
open="(" separator="," close=")">
@ -211,7 +223,12 @@
f.unit settlementUnit,
k.name productName,
IFNULL(ROUND(c.sale_amount / f.net_weight, 6),0) settlementPrice,
c.business_order_id businessOrderId
c.business_order_id businessOrderId,
m.business_price businessPrice,
m.tax tax,
m.tax_count taxCount,
m.not_tax_price notTaxPrice,
m.not_tax_count notTaxCount
from jg_warehousing_storage_poundlist a
LEFT JOIN jg_warehousing_storage b on a.warehousing_storage_id = b.id
LEFT JOIN jg_voucher c on a.voucher_id = c.id
@ -224,6 +241,7 @@
LEFT JOIN jg_contract i on h.contract_id = i.id
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
LEFT JOIN jg_product k on f.product_id = k.id
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
where a.warehousing_storage_id in
<foreach item="item" index="index" collection="storageIdList"
open="(" separator="," close=")">
@ -255,7 +273,12 @@
IFNULL(j.price_rate,0) contractPrice,
f.unit settlementUnit,
k.name productName,
IFNULL(ROUND(c.purchase_amount / f.net_weight, 6),0) settlementPrice
IFNULL(ROUND(c.purchase_amount / f.net_weight, 6),0) settlementPrice,
m.business_price businessPrice,
m.tax tax,
m.tax_count taxCount,
m.not_tax_price notTaxPrice,
m.not_tax_count notTaxCount
from jg_warehousing_storage_poundlist a
LEFT JOIN jg_warehousing_storage b on a.warehousing_storage_id = b.id
LEFT JOIN jg_voucher c on a.voucher_id = c.id
@ -268,7 +291,7 @@
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
LEFT JOIN jg_product k on f.product_id = k.id
LEFT JOIN jg_warehousing_storage_product l on l.warehousing_storage_id = b.id
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
where a.warehousing_storage_id in
<foreach item="item" index="index" collection="storageIdList"
open="(" separator="," close=")">
@ -302,7 +325,12 @@
f.unit settlementUnit,
k.name productName,
IFNULL(ROUND(c.sale_amount / f.net_weight, 6),0) settlementPrice,
c.business_order_id businessOrderId
c.business_order_id businessOrderId,
m.business_price businessPrice,
m.tax tax,
m.tax_count taxCount,
m.not_tax_price notTaxPrice,
m.not_tax_count notTaxCount
from jg_warehousing_outbound_poundlist a
LEFT JOIN jg_warehousing_outbound b on a.warehousing_outbound_id = b.id
LEFT JOIN jg_voucher c on a.voucher_id = c.id
@ -314,6 +342,7 @@
LEFT JOIN jg_contract i on h.contract_id = i.id
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
LEFT JOIN jg_product k on f.product_id = k.id
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
where a.warehousing_outbound_id in
<foreach item="item" index="index" collection="storageIdList"
open="(" separator="," close=")">
@ -345,7 +374,12 @@
IFNULL(j.price_rate,0) contractPrice,
f.unit settlementUnit,
k.name productName,
IFNULL(ROUND(c.purchase_amount / f.net_weight, 6),0) settlementPrice
IFNULL(ROUND(c.purchase_amount / f.net_weight, 6),0) settlementPrice,
m.business_price businessPrice,
m.tax tax,
m.tax_count taxCount,
m.not_tax_price notTaxPrice,
m.not_tax_count notTaxCount
from jg_warehousing_outbound_poundlist a
LEFT JOIN jg_warehousing_outbound b on a.warehousing_outbound_id = b.id
LEFT JOIN jg_voucher c on a.voucher_id = c.id
@ -358,6 +392,7 @@
LEFT JOIN jg_contract i on h.contract_id = i.id
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
LEFT JOIN jg_product k on f.product_id = k.id
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
where a.warehousing_outbound_id in
<foreach item="item" index="index" collection="storageIdList"
open="(" separator="," close=")">
@ -390,7 +425,12 @@
f.unit settlementUnit,
k.name productName,
IFNULL(ROUND(c.sale_amount / f.net_weight, 6),0) settlementPrice,
c.business_order_id businessOrderId
c.business_order_id businessOrderId,
m.business_price businessPrice,
m.tax tax,
m.tax_count taxCount,
m.not_tax_price notTaxPrice,
m.not_tax_count notTaxCount
from jg_warehousing_outbound_poundlist a
LEFT JOIN jg_warehousing_outbound b on a.warehousing_outbound_id = b.id
LEFT JOIN jg_voucher c on a.voucher_id = c.id
@ -403,6 +443,7 @@
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
LEFT JOIN jg_product k on f.product_id = k.id
LEFT JOIN jg_warehousing_outbound_product l on l.warehousing_outbound_id = b.id
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
where a.warehousing_outbound_id in
<foreach item="item" index="index" collection="storageIdList"
open="(" separator="," close=")">
@ -435,7 +476,12 @@
IFNULL(j.price_rate,0) contractPrice,
f.unit settlementUnit,
k.name productName,
IFNULL(ROUND(c.purchase_amount / f.net_weight, 6),0) settlementPrice
IFNULL(ROUND(c.purchase_amount / f.net_weight, 6),0) settlementPrice,
m.business_price businessPrice,
m.tax tax,
m.tax_count taxCount,
m.not_tax_price notTaxPrice,
m.not_tax_count notTaxCount
from jg_warehousing_outbound_poundlist a
LEFT JOIN jg_warehousing_outbound b on a.warehousing_outbound_id = b.id
LEFT JOIN jg_voucher c on a.voucher_id = c.id
@ -448,6 +494,7 @@
LEFT JOIN jg_contract i on h.contract_id = i.id
LEFT JOIN jg_contract_commodity j on (j.contract_id = i.id and f.product_id = j.product_id)
LEFT JOIN jg_product k on f.product_id = k.id
LEFT JOIN jg_business_order_product_relational m on (h.id = m.business_order_id and c.order_no = m.ord_ln)
where a.warehousing_outbound_id in
<foreach item="item" index="index" collection="storageIdList"
open="(" separator="," close=")">

@ -97,5 +97,7 @@ public interface BusinessOrderService extends IService<BusinessOrderEntity> {
void getPdfInfo(BusinessOrderEntity businessOrderEntity, HttpServletResponse response, String token) throws Exception;
Map printPDF(BusinessOrderEntity businessOrderEntity, HttpServletResponse response) throws Exception;
BigDecimal getSaleAmountSumInfo(String id);
}

@ -2,6 +2,8 @@ package jnpf.service;
import jnpf.model.paymentapplication.*;
import jnpf.entity.*;
import java.io.IOException;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -36,4 +38,5 @@ public interface PaymentApplicationService extends IService<PaymentApplicationEn
void saveOrUpdate(PaymentApplicationForm paymentApplicationForm,String id, boolean isSave) throws Exception;
void getPaymentDocPdf(String id) throws IOException;
}

@ -47,6 +47,8 @@ import jnpf.yozo.utils.HttpRequestUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.printing.PDFPageable;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.Sheet;
@ -80,6 +82,8 @@ import com.spire.doc.documents.HorizontalAlignment;
import com.spire.doc.documents.Paragraph;
import com.spire.doc.documents.ParagraphStyle;
import com.spire.doc.fields.DocPicture;
import java.io.File;
/**
*
* businessOrder
@ -1242,6 +1246,49 @@ public class BusinessOrderServiceImpl extends ServiceImpl<BusinessOrderMapper, B
return businessOrderMapper.querySaleOrderProductByYunGuan(id);
}
@Override
public Map printPDF(BusinessOrderEntity businessOrderEntity, HttpServletResponse response) throws Exception{
// 临时文件夹地址
String s = UUID.randomUUID().toString();
String templateFilePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemplateFilePath() + "info\\"+s+"\\";
FileCopy.createFile(templateFilePath);
LambdaQueryWrapper<BusinessOrderEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BusinessOrderEntity::getCode, businessOrderEntity.getCode());
businessOrderEntity = this.getOne(wrapper);
/*BigDecimal amount = BigDecimal.ZERO;
if (purchaseorderitemEntities!=null&&purchaseorderitemEntities.size()>0){
amount = purchaseorderitemEntities.get(0).getAmount();
}*/
//查询总数量和总金额
List<HashMap<String, Object>> info = businessOrderMapper.getWordExcelInfo(businessOrderEntity.getCode());
if(info == null || info.size() == 0){
info = businessOrderMapper.getWordExcelInfo2(businessOrderEntity.getCode());
}
if (info != null && info.size() > 0) {
BigDecimal settlement = new BigDecimal("0");
BigDecimal amount = new BigDecimal("0");
for (HashMap<String, Object> hashMap : info) {
settlement = settlement.add(new BigDecimal(hashMap.get("settlement").toString()));
amount = amount.add(new BigDecimal(hashMap.get("purchasePrice").toString()));
}
String settlementPdf = settlement.toString()+"_"+businessOrderEntity.getCompanyId()+"_"+businessOrderEntity.getDepartmentId();
String settlementExcel= settlement.toString()+"_"+businessOrderEntity.getCompanyId();
// 要打印的PDF文件路径
Map map = this.getPrintPdf(businessOrderEntity, templateFilePath,settlementPdf);
return map;
} else {
log.error("采购订单号出错!查不到该采购订单!");
}
return new HashMap();
}
@Override
public void getPdfInfo(BusinessOrderEntity businessOrderEntity, HttpServletResponse response, String token) throws Exception{
@ -2103,6 +2150,68 @@ public class BusinessOrderServiceImpl extends ServiceImpl<BusinessOrderMapper, B
log.warn("pdf文件生成成功");
}
/**
* @param businessOrderEntity
* @param templateFilePath
* @throws Exception
*/
public Map getPrintPdf(BusinessOrderEntity businessOrderEntity, String templateFilePath,String settlements) throws Exception {
String[] s = settlements.split("_");
settlements=s[0];
String companyName=s[1];
String departmentName=s[2];
QueryWrapper<BusinessOrderProductRelationalEntity> businessOrderProductRelationalEntityQueryWrapper = new QueryWrapper<>();
businessOrderProductRelationalEntityQueryWrapper.lambda().eq(BusinessOrderProductRelationalEntity::getBusinessOrderId,businessOrderEntity.getId());
List<BusinessOrderProductRelationalEntity> BusinessOrderProductRelationalEntitys = businessOrderProductRelationalService.list(businessOrderProductRelationalEntityQueryWrapper);
ContractLEntity contractLEntity = contractLService.getById(businessOrderEntity.getContractId());
SubjectbasicEntity subjectbasicEntity = subjectbasicService.getById(businessOrderEntity.getFirstSubjectBasicId());
byte[] bytes = null;
HttpHeaders headers = null;
ByteArrayOutputStream out = null;
ExportPdf exportPdf = new ExportPdf();
Map map = new HashMap();
//pdf表标题
OrganizeEntity organizeEntityDdf =organizeService.getInfo(companyName);
if (organizeEntityDdf!=null){
map.put("title", organizeEntityDdf.getFullName()+"采购订单");
}
//pdf部门
OrganizeEntity organizeEntityDdfDept =organizeService.getInfo(departmentName);
if (organizeEntityDdfDept!=null){
map.put("name", organizeEntityDdfDept.getFullName());
}
// map.put("title", companyName+"采购订单");
// map.put("name", departmentName);
map.put("creatorTime", new SimpleDateFormat("yyyy-MM-dd").format(businessOrderEntity.getCreatorTime()));
map.put("contractNo", contractLEntity.getContractNo());
map.put("contractCode", contractLEntity.getContractNumber());
map.put("supplierName", subjectbasicEntity.getName());
map.put("documentNo", businessOrderEntity.getCode());
BigDecimal settlementSum = new BigDecimal("0");
BigDecimal amountSum = new BigDecimal("0");
List<Map> reportList = new ArrayList<>();
for (BusinessOrderProductRelationalEntity businessOrderProductRelationalEntity : BusinessOrderProductRelationalEntitys) {
Map map1 = new HashMap();
map1.put("itemCode", "");
map1.put("itemName", businessOrderProductRelationalEntity.getName());
map1.put("rate", businessOrderProductRelationalEntity.getTax());
map1.put("price", businessOrderProductRelationalEntity.getBusinessPrice());
map1.put("settlement", businessOrderProductRelationalEntity.getBusinessNum());
map1.put("unit", businessOrderProductRelationalEntity.getSalesMainUnitId());
map1.put("amount", businessOrderProductRelationalEntity.getTaxCount());
settlementSum = settlementSum.add(businessOrderProductRelationalEntity.getBusinessNum());
amountSum = amountSum.add(new BigDecimal(businessOrderProductRelationalEntity.getTaxCount()));
reportList.add(map1);
}
map.put("settlementSum", settlementSum);
map.put("amountSum", amountSum);
map.put("reportList", reportList);
return map;
}
/**
* @param list word
* @param templateFilePath

@ -1,10 +1,28 @@
package jnpf.service.impl;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONArray;
import jnpf.base.ActionResult;
import jnpf.engine.controller.FlowBeforeController;
import jnpf.engine.model.flowbefore.FlowBeforeInfoVO;
import jnpf.engine.model.flowbefore.FlowTaskOperatorRecordModel;
import jnpf.engine.model.flowengine.FlowModel;
import jnpf.entity.*;
import jnpf.exception.WorkFlowException;
import jnpf.mapper.CwpaymentreceiptMapper;
import jnpf.mapper.PaymentApplicationMapper;
import jnpf.model.cwpaymentreceipt.PaymentdocMessage;
import jnpf.permission.entity.OrganizeEntity;
import jnpf.permission.service.OrganizeService;
import jnpf.permission.service.UserService;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.paymentapplication.*;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
@ -14,10 +32,13 @@ import jnpf.database.model.superQuery.ConditionJsonModel;
import jnpf.database.model.superQuery.SuperQueryConditionModel;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import java.net.URLEncoder;
import java.util.regex.Pattern;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel;
import jnpf.util.context.SpringContext;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel;
@ -30,6 +51,9 @@ import jnpf.util.*;
import java.util.*;
import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity;
import javax.servlet.http.HttpServletResponse;
/**
*
* PaymentApplication
@ -45,6 +69,14 @@ public class PaymentApplicationServiceImpl extends ServiceImpl<PaymentApplicatio
@Autowired
private UserProvider userProvider;
@Autowired
private CwpaymentreceiptMapper cwpaymentreceiptMapper;
@Autowired
private OrganizeService organizeService;
@Autowired
private UserService userService;
@Autowired
private SubjectbasicService subjectbasicService;
@Autowired
private PaymentapplicationsettlementService paymentapplicationsettlementService;
@ -185,6 +217,12 @@ public class PaymentApplicationServiceImpl extends ServiceImpl<PaymentApplicatio
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(paymentApplicationPagination.getApplyWeight())){
paymentApplicationNum++;
paymentApplicationQueryWrapper.lambda().eq(PaymentApplicationEntity::getApplyWeight,new BigDecimal(paymentApplicationPagination.getApplyWeight()));
}
if(ObjectUtil.isNotEmpty(paymentApplicationPagination.getCode())){
paymentApplicationNum++;
@ -288,6 +326,9 @@ public class PaymentApplicationServiceImpl extends ServiceImpl<PaymentApplicatio
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
if(ObjectUtil.isNotEmpty(paymentApplicationPagination.getCreatorUserName())){
paymentApplicationQueryWrapper.inSql("f_creator_user_id", "SELECT f_id from base_user where f_real_name like '%" + paymentApplicationPagination.getCreatorUserName() + "%'");
}
Page<PaymentApplicationEntity> page=new Page<>(paymentApplicationPagination.getCurrentPage(), paymentApplicationPagination.getPageSize());
IPage<PaymentApplicationEntity> userIPage=this.page(page, paymentApplicationQueryWrapper);
return paymentApplicationPagination.setData(userIPage.getRecords(),userIPage.getTotal());
@ -420,4 +461,138 @@ public class PaymentApplicationServiceImpl extends ServiceImpl<PaymentApplicatio
}
}
}
@Override
public void getPaymentDocPdf(String id) throws IOException {
List<Map<String, Object>> paymentDocNodeInfo = cwpaymentreceiptMapper.getPaymentDocNodeInfo(id);
String stringtime = null;
if (paymentDocNodeInfo != null && paymentDocNodeInfo.size() > 0) {
System.out.println( paymentDocNodeInfo.get(0).get("handleTime"));
stringtime=paymentDocNodeInfo.get(0).get("handleTime").toString();
}
PaymentdocMessage paymentdocMessage =new PaymentdocMessage();
PaymentApplicationEntity paymentApplicationEntity = this.getById(id);
SubjectbasicEntity subjectbasicEntity = subjectbasicService.getById(paymentApplicationEntity.getSubjectId());
UserEntity userEntity = userService.getInfo(paymentApplicationEntity.getCreatorUserId());
paymentdocMessage.setRealName(userEntity.getRealName());
paymentdocMessage.setMobilePhone(userEntity.getAccount());
paymentdocMessage.setNowTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(paymentApplicationEntity.getCreatorTime()));
OrganizeEntity companyEntity = organizeService.getById(paymentApplicationEntity.getCompanyId());
if(companyEntity == null){
companyEntity = new OrganizeEntity();
}
paymentdocMessage.setCustomerName(companyEntity.getFullName() + "请示");
paymentdocMessage.setDocumentNo(paymentApplicationEntity.getCode());
paymentdocMessage.setSupplierName(paymentApplicationEntity.getPayee());
paymentdocMessage.setRamout(paymentApplicationEntity.getApplyAmount().toString());
paymentdocMessage.setPaymentAmout("");
paymentdocMessage.setCollectionAccout(subjectbasicEntity.getBankAccount());
paymentdocMessage.setColletionBank(subjectbasicEntity.getBankBranchName());
paymentdocMessage.setRemark(paymentApplicationEntity.getRemark());
paymentdocMessage.setEnclosure(paymentApplicationEntity.getAnnex());
paymentdocMessage.setPayType("货款");
OrganizeEntity departmentEntity = organizeService.getById(paymentApplicationEntity.getDepartmentId());
if(departmentEntity == null){
departmentEntity = new OrganizeEntity();
}
paymentdocMessage.setFullName(companyEntity.getFullName() + "/" + departmentEntity.getFullName());
StringBuilder payEnclosureStr = new StringBuilder();
if (paymentdocMessage.getEnclosure() != null) {//附件不为空
String enclosure = paymentdocMessage.getEnclosure();
JSONArray jsonToJsonArray = JsonUtil.getJsonToJsonArray(enclosure);
for (int i = 0; i < jsonToJsonArray.size(); i++) {
Map o = (Map) jsonToJsonArray.get(i);
Object name = o.get("name");
if (i == 0) {
payEnclosureStr.append(name);
} else {
payEnclosureStr.append("<br/>" + name);
}
}
paymentdocMessage.setEnclosure(payEnclosureStr.toString());
}
// StringUtil.indexOf()
// String templateFilePath = configValueUtil.getTemplateFilePath() +"paymentDocPdf//";
Map<String, Object> map = JsonUtil.stringToMap(JSONUtil.toJsonStr(paymentdocMessage));
map.put("substring", companyEntity.getFullName());
map.put("substring1", departmentEntity.getFullName());
// map.put("reportList",paymentDocNodeInfo);
FlowBeforeController bean = SpringContext.getBean(FlowBeforeController.class);
ActionResult info = null;
try {
info = bean.info(id, new FlowModel());
} catch (WorkFlowException e) {
throw new RuntimeException(e);
}
FlowBeforeInfoVO data = (FlowBeforeInfoVO) info.getData();
List<FlowTaskOperatorRecordModel> recordList = data.getFlowTaskOperatorRecordList();
List<Map<String, Object>> maps = new ArrayList<>();
for (int i = 0; i < recordList.size(); i++) {
Map<String, Object> map1 = new HashMap<String, Object>();
FlowTaskOperatorRecordModel model = recordList.get(i);
Map<String, Object> map2 = paymentDocNodeInfo.get(i);
map1.put("realName", model.getUserName());
map1.put("nodeName", model.getNodeName());
map1.put("handleOpinion", model.getHandleOpinion());
map1.put("handleTime", DateUtil.daFormat(model.getHandleTime()));
map1.put("node", map2.get("node"));
maps.add(map1);
}
ArrayList<Map<String, Object>> maps1 = new ArrayList<Map<String, Object>>();
int num = 6;
if (maps.size() > num) {
for (int i = 0; i < maps.size(); i++) {
Map<String, Object> map1 = maps.get(i);
if (i >= num) {
maps1.add(map1);
}
}
while (maps.size() > num) {
maps.remove(num);
}
}
map.put("reportList", maps);
map.put("reportList1", maps1);
byte[] bytes = null;
ByteArrayOutputStream out = null;
ExportPdf exportPdf = new ExportPdf();
// word模板
try {
out = exportPdf.createPdf(map, "paymentDoc.ftl", "/templates/export");
bytes = out.toByteArray();
out.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
String fileName = paymentdocMessage.getCustomerName() == null ? companyEntity.getFullName() + "请示.pdf" : companyEntity.getFullName() + "请示(" + paymentdocMessage.getCustomerName() + ").pdf";
HttpServletResponse response = ServletUtil.getResponse();
response.reset();
String excelTitle = fileName;
String filen = null;
try {
filen = URLEncoder.encode(excelTitle, "UTF-8").replaceAll("\\+", "%20");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
// 设置response的Header
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + filen);
response.setContentType("application/x-download;charset=utf-8");
BufferedOutputStream toClient = null;
try {
toClient = new BufferedOutputStream(response.getOutputStream());
toClient.write(out.toByteArray());
toClient.flush();
toClient.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
log.warn("pdf文件生成成功");
}
}

@ -1287,4 +1287,18 @@ public class BusinessOrderController {
businessOrderEntity.setCode(code);
businessOrderService.getPdfInfo(businessOrderEntity,response,token);
}
/**
*
*
* @param code
* @return
*/
@GetMapping(value = "/printPDF/{code}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ActionResult printPDF(HttpServletResponse response, @PathVariable("code") String code) throws Exception {
BusinessOrderEntity businessOrderEntity = new BusinessOrderEntity();
businessOrderEntity.setCode(code);
Map map = businessOrderService.printPDF(businessOrderEntity,response);
return ActionResult.success(map);
}
}

@ -16,6 +16,8 @@ import jnpf.model.paymentapplication.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
@ -244,4 +246,13 @@ public class PaymentApplicationController {
return ActionResult.success("结案成功");
}
/**
*
* @param id id
* @throws Exception
*/
@GetMapping(value = "/downloadPdf/{id}/{token}")
public void downloadPdf(HttpServletResponse response, @PathVariable("id") String id, @PathVariable("token")String token) throws IOException {
paymentApplicationService.getPaymentDocPdf(id);
}
}

@ -68,4 +68,6 @@ public class CwaccountEntity {
private String flowId;
@TableField("F_VERSION")
private Integer version;
@TableField(value = "summary_type" , updateStrategy = FieldStrategy.IGNORED)
private String summaryType;
}

@ -131,4 +131,15 @@ public class CwaccountvoucherEntity {
@TableField("ORDER_NO")
private String orderNo;
@TableField(exist = false)
private BigDecimal businessPrice;
@TableField(exist = false)
private String tax;
@TableField(exist = false)
private String taxCount;
@TableField(exist = false)
private String notTaxPrice;
@TableField(exist = false)
private String notTaxCount;
}

@ -88,4 +88,6 @@ public class CwaccountForm {
/** 对账主体类型 **/
@JsonProperty("accountSubjectType")
private String accountSubjectType;
@JsonProperty("summaryType")
private String summaryType;
}

@ -41,4 +41,7 @@ public class PaymentApplicationPagination extends Pagination {
private Object paymentState;
@JsonProperty("doc_state")
private Object docState;
private String applyWeight;
private String creatorUserName;
}

@ -1366,6 +1366,15 @@
<span style="font-size: 14px;font-weight: 500;color:rgb(102, 102, 102);">对账汇总</span>
</div>
</el-col>
<el-col :span="6">
<jnpf-form-tip-item label="汇总类型">
<JnpfSelect v-model="dataForm.summaryType" @change="changeData('summaryType', -1)"
placeholder="请选择" :disabled="judgeWrite('accountSubjectId')"
:style='{ "width": "100%" }' :options="summaryTypeOptions"
:props="summaryTypeProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('cwaccountvoucher-${html.relationField}')">
<jnpf-form-tip-item label-width="0">
<el-table :data="dataForm.cwaccountsummaryList" size='mini' show-summary
@ -1857,6 +1866,7 @@ export default {
Vmodel: "",
currVmodel: "",
dataForm: {
summaryType: '1',
subjectId: '',
contractType: '',
type: '1',
@ -1982,6 +1992,17 @@ export default {
"label": "name",
"value": "id"
},
summaryTypeOptions: [{
"fullName": "按磅单",
"id": "1"
}, {
"fullName": "按订单",
"id": "2"
}],
summaryTypeProps: {
"label": "fullName",
"value": "id"
},
cwaccountvoucherdocumentTypeOptions: [{
"fullName": "收货凭证",
"id": "1"
@ -2901,6 +2922,11 @@ export default {
if (res.data) {
this.dataForm.cwaccountvoucherList = res.data
this.dataForm.cwaccountvoucherList.forEach(item => {
item.businessPrice = Number(item.businessPrice);//
item.tax = Number(item.tax);//
item.taxCount = Number(item.taxCount);//
item.notTaxPrice = Number(item.notTaxPrice);//
item.notTaxCount = Number(item.notTaxCount);//
//
item.bucklesWeight = 0;
//
@ -3063,11 +3089,11 @@ export default {
return item.businessOrderId === cur.businessOrderId && item.productId === cur.productId && item.orderNo === cur.orderNo
})
if (found) {
found.settlementSum = this.jnpf.floatAdd(Number(found.settlementSum), Number(cur.settlementSum));
found.settlementSubtotal = this.jnpf.floatAdd(Number(found.settlementSubtotal), Number(cur.settlementSubtotal));
found.settlementSubtotalNo = this.jnpf.floatAdd(Number(found.settlementSubtotalNo), Number(cur.settlementSubtotalNo));
found.settlementTotal = this.jnpf.floatAdd(Number(found.settlementTotal), Number(cur.settlementTotal));
found.settlementTotalNo = this.jnpf.floatAdd(Number(found.settlementTotalNo), Number(cur.settlementTotalNo));
found.settlementSum = this.jnpf.floatAdd(Number(found.settlementSum), Number(cur.settlementSum));//
found.settlementSubtotal = this.jnpf.floatAdd(Number(found.settlementSubtotal), Number(cur.settlementSubtotal));//
found.settlementSubtotalNo = this.jnpf.floatAdd(Number(found.settlementSubtotalNo), Number(cur.settlementSubtotalNo));//
found.settlementTotal = this.jnpf.floatAdd(Number(found.settlementTotal), Number(cur.settlementTotal));//
found.settlementTotalNo = this.jnpf.floatAdd(Number(found.settlementTotalNo), Number(cur.settlementTotalNo));//
if (cur.otherType == '1') {
found.otherExpenses = this.jnpf.floatAdd(Number(found.otherExpenses), Number(cur.otherExpenses)).toFixed(2);
} else if (cur.otherType == '2') {
@ -3080,6 +3106,32 @@ export default {
}, [])
return result
},
sameReduce2(arr) {
let result = arr.reduce((acc, cur) => {
// let found = acc.find((item) => {
// return item.productId === cur.productId
// })
let found = acc.find((item) => {
return item.businessOrderId === cur.businessOrderId && item.productId === cur.productId && item.orderNo === cur.orderNo
})
if (found) {
found.settlementSum = this.jnpf.floatAdd(Number(found.settlementSum), Number(cur.settlementSum));//
found.settlementSubtotal = this.jnpf.floatAdd(Number(found.taxCount), Number(cur.taxCount));//
found.settlementSubtotalNo = this.jnpf.floatAdd(Number(found.notTaxCount), Number(cur.notTaxCount));//
found.settlementTotal = this.jnpf.floatAdd(Number(found.taxCount), Number(cur.taxCount));//
found.settlementTotalNo = this.jnpf.floatAdd(Number(found.notTaxCount), Number(cur.notTaxCount));//
if (cur.otherType == '1') {
found.otherExpenses = this.jnpf.floatAdd(Number(found.otherExpenses), Number(cur.otherExpenses)).toFixed(2);
} else if (cur.otherType == '2') {
found.otherExpenses = this.jnpf.floatSub(Number(found.otherExpenses), Number(cur.otherExpenses)).toFixed(2);
}
} else {
acc.push({ productId: cur.productId, productName: cur.productName, spec: cur.spec, rate: cur.rate, settlementSum: cur.settlementSum, settlementTotal: cur.taxCount, settlementUnit: cur.unit, settlementPrice: cur.businessPrice, settlementSubtotal: cur.taxCount, settlementPriceNo: cur.notTaxPrice, settlementSubtotalNo: cur.notTaxCount, otherType: cur.otherType, otherExpenses: cur.otherExpenses, settlementTotal: cur.taxCount, settlementTotalNo: cur.notTaxCount, businessOrderId: cur.businessOrderId, orderNo: cur.orderNo })
}
return acc
}, [])
return result
},
addcwaccountsummaryList() {
if (!this.dataForm.cwaccountvoucherList || this.dataForm.cwaccountvoucherList.length == 0) {
this.$message({
@ -3107,7 +3159,7 @@ export default {
// }
// })
// })
if(this.dataForm.summaryType == 1){
this.dataForm.cwaccountsummaryList = this.sameReduce(this.dataForm.cwaccountvoucherList);
this.dataForm.cwaccountsummaryList.forEach(item => {
item.settlementSum = item.settlementSum.toFixed(4);
@ -3117,8 +3169,27 @@ export default {
item.settlementTotalNo = item.settlementTotalNo.toFixed(2);
item.settlementPrice = this.jnpf.floatDiv(item.settlementSubtotal, item.settlementSum);
item.settlementPriceNo = this.jnpf.floatDiv(item.settlementSubtotalNo, item.settlementSum);
console.log(item.settlementPriceNo + "111");
})
}else if(this.dataForm.summaryType == 2){
this.dataForm.cwaccountsummaryList = this.sameReduce2(this.dataForm.cwaccountvoucherList);
this.dataForm.cwaccountsummaryList.forEach(item => {
item.settlementSum = item.settlementSum.toFixed(4);
item.settlementSubtotal = item.settlementSubtotal.toFixed(2);
item.settlementSubtotalNo = item.settlementSubtotalNo.toFixed(2);
item.settlementTotal = item.settlementTotal.toFixed(2);
item.settlementTotalNo = item.settlementTotalNo.toFixed(2);
item.settlementPrice = this.jnpf.floatDiv(item.settlementSubtotal, item.settlementSum);
item.settlementPriceNo = this.jnpf.floatDiv(item.settlementSubtotalNo, item.settlementSum);
})
}else{
this.$message({
type: 'error',
message: '请选择汇总类型',
duration: 1500,
})
return
}
// console.log(this.dataForm.cwaccountsummaryList + "111");
/* let item = {

@ -1335,11 +1335,24 @@
</JnpfTextarea>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<div style="padding:15px 0px">
<span style="color: #409EFF;"></span>
<span style="font-size: 14px;font-weight: 500;color:rgb(102, 102, 102);">结算汇总</span>
</div>
</el-col>
<el-col :span="8">
<jnpf-form-tip-item label="汇总类型">
<JnpfSelect v-model="dataForm.summaryType" @change="changeData('summaryType', -1)"
placeholder="请选择" :disabled="judgeWrite('remark')"
:style='{ "width": "100%" }' :options="summaryTypeOptions"
:props="summaryTypeProps">
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" v-if="judgeShow('cwsettlementpaymentreceipt-${html.relationField}')">
<jnpf-form-tip-item label-width="0">
<div class="JNPF-common-title">
<h2>结算汇总</h2>
</div>
<el-table :data="dataForm.cwsettlementsummaryList" size='mini' show-summary
:summary-method="getSummaries">
<el-table-column type="index" width="50" label="序号" align="center" fixed="left" />
@ -1817,6 +1830,7 @@ export default {
Vmodel: "",
currVmodel: "",
dataForm: {
summaryType: '1',
type: "1",
businessType: '1',
code: undefined,
@ -2044,6 +2058,17 @@ export default {
"label": "fullName",
"value": "id"
},
summaryTypeOptions: [{
"fullName": "按磅单",
"id": "1"
}, {
"fullName": "按订单",
"id": "2"
}],
summaryTypeProps: {
"label": "fullName",
"value": "id"
},
businessType1Options: [{
"fullName": "采购订单",
"id": "1"

@ -25,6 +25,16 @@
<el-input v-model="query.payer" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="申请重量">
<el-input v-model="query.applyWeight" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="提交人">
<el-input v-model="query.creatorUserName" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
@ -75,6 +85,8 @@
</el-table-column>
<el-table-column prop="applyWeight" label="申请重量" align="center" width="150">
</el-table-column>
<el-table-column prop="creatorUserName" label="提交人" align="center" width="150">
</el-table-column>
<el-table-column prop="flowState" label="状态" width="150" align="center">
<template slot-scope="scope" v-if="!scope.row.top">
<el-tag v-if="scope.row.flowState==1"></el-tag>
@ -199,6 +211,8 @@ export default {
payee: undefined,
payer: undefined,
preparationTime: undefined,
applyWeight: undefined,
creatorUserName: undefined
},
treeProps: {
children: 'children',

@ -0,0 +1,363 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<!-- <div class="JNPF-preview-main">
<div class="JNPF-common-page-header">
<el-page-header @back="goBack" content="打印预览" />
<div class="options">
<el-button type="primary" @click="dataFormSubmit()"> </el-button>
<el-button @click="goBack"> </el-button>
</div>
</div>
</div> -->
<!-- <span slot="footer" class="dialog-footer">
<el-button @click="visible = false">{{ $t('common.cancelButton') }}</el-button>
<el-button type="primary" @click="select()">{{ $t('common.confirmButton') }}</el-button>
</span> -->
<div ref="print">
<div class='wrapper'>
<h1 style="text-align: center">{{bill.title}}</h1>
<p style="font-weight: bold">业务部门:{{bill.name}}</p>
<table border="1" cellspacing="0" width="100%">
<tr bgcolor="#6495ed" style="line-height: 44px" >
<td colspan="1" rowspan="2">订单日期</td>
<td colspan="5" rowspan="2">${creatorTime!""}</td>
<td colspan="3" rowspan="2">对方合同编号</td>
<td colspan="5" rowspan="2">${contractNo!""}</td>
<td colspan="4" rowspan="2">合同编号</td>
<td colspan="5" rowspan="2">${contractCode!""}</td>
</tr>
<tr bgcolor="#6495ed" style="">
</tr>
<tr bgcolor="#6495ed" style="line-height: 44px">
<td colspan="1" rowspan="2">供货单位</td>
<td colspan="22" rowspan="2">${supplierName!""}</td>
</tr>
<tr bgcolor="#6495ed" style="">
</tr>
<tr bgcolor="#6495ed" style="line-height: 22px">
<td colspan="3">订单号</td>
<td colspan="1" style="text-align: center">行号</td>
<td colspan="5">物料名称规格型号</td>
<td colspan="2">数量</td>
<td colspan="2">单位</td>
<td colspan="3">单价/含税</td>
<td colspan="3" >金额/含税</td>
<td colspan="1">税率</td>
</tr>
<tr>
</tr>
<#if reportList?? && (reportList?size>0)>
<#list reportList as reportData>
<#if reportData??>
<tr bgcolor="#6495ed" style="line-height: 22px">
<td colspan="3" style="text-align: center">${documentNo!""}</td>
<td colspan="1" style="text-align: center">${reportData_index+1!""}</td>
<td colspan="5" style="text-align: center">${reportData.itemName!""}</td>
<td colspan="2" style="text-align: center">${reportData.settlement!""}</td>
<td colspan="2" style="text-align: center">${reportData.unit!""}</td>
<td colspan="3" style="text-align: center">${reportData.price?string["0.######"]!""}</td>
<td colspan="3" style="text-align: center">
${reportData.amount!""}
</td>
<td colspan="1" style="text-align: center">${reportData.rate!""}</td>
</tr>
<tr>
</tr>
</#if>
</#list>
</#if>
<tr bgcolor="#6495ed" style="line-height: 22px">
<td colspan="3">合计</td>
<td colspan="1"></td>
<td colspan="5"></td>
<td colspan="2" style="text-align: center">${settlementSum!""}</td>
<td colspan="2"></td>
<td colspan="3"></td>
<td colspan="3" style="text-align: center">${amountSum!""}</td>
<td colspan="1"></td>
</tr>
</table>
<br/>
<br/>
</div>
<!-- <div class="bill">
<h1 class="bill-title">水电费用清单汇总</h1>
<el-table :data="tableData" border id="bill1">
<el-table-column prop="month" label="月份"> </el-table-column>
<el-table-column label="2015" width="80">
<el-table-column label="电费" prop="electric1"></el-table-column>
<el-table-column label="水费" prop="waterFee1"></el-table-column>
</el-table-column>
<el-table-column label="2016" width="80">
<el-table-column label="电费" prop="electric2"></el-table-column>
<el-table-column label="水费" prop="waterFee2"></el-table-column>
</el-table-column>
<el-table-column label="2017" width="80">
<el-table-column label="电费" prop="electric3"></el-table-column>
<el-table-column label="水费" prop="waterFee3"></el-table-column>
</el-table-column>
<el-table-column label="2018" width="80">
<el-table-column label="电费" prop="electric4"></el-table-column>
<el-table-column label="水费" prop="waterFee4"></el-table-column>
</el-table-column>
</el-table>
</div> -->
</div>
</div>
</transition>
</template>
<script>
import request from '@/utils/request'
import {
GoodsList
} from '@/api/extend/order'
import printStyle from './printStyle'
export default {
data() {
return {
tableData: [
{
month: "1月份",
electric1: "968.00",
electric2: "734.00",
electric3: "737.00",
electric4: "651.00",
waterFee1: "144.00",
waterFee2: "241.00",
waterFee3: "234.00",
waterFee4: "179.00",
},
{
month: "2月份",
electric1: "968.00",
electric2: "734.00",
electric3: "737.00",
electric4: "651.00",
waterFee1: "144.00",
waterFee2: "241.00",
waterFee3: "234.00",
waterFee4: "179.00",
},
{
month: "3月份",
electric1: "968.00",
electric2: "734.00",
electric3: "737.00",
electric4: "651.00",
waterFee1: "144.00",
waterFee2: "241.00",
waterFee3: "234.00",
waterFee4: "179.00",
},
{
month: "4月份",
electric1: "968.00",
electric2: "734.00",
electric3: "737.00",
electric4: "651.00",
waterFee1: "144.00",
waterFee2: "241.00",
waterFee3: "234.00",
waterFee4: "179.00",
},
{
month: "5月份",
electric1: "968.00",
electric2: "734.00",
electric3: "737.00",
electric4: "651.00",
waterFee1: "144.00",
waterFee2: "241.00",
waterFee3: "234.00",
waterFee4: "179.00",
},
{
month: "6月份",
electric1: "968.00",
electric2: "734.00",
electric3: "737.00",
electric4: "651.00",
waterFee1: "144.00",
waterFee2: "241.00",
waterFee3: "234.00",
waterFee4: "179.00",
},
{
month: "7月份",
electric1: "837.00",
electric2: "518.00",
electric3: "737.00",
electric4: "651.00",
waterFee1: "144.00",
waterFee2: "241.00",
waterFee3: "234.00",
waterFee4: "179.00",
},
{
month: "8月份",
electric1: "938.00",
electric2: "976.00",
electric3: "923.00",
electric4: "856.00",
waterFee1: "180.00",
waterFee2: "103.00",
waterFee3: "285.00",
waterFee4: "215.00",
},
{
month: "9月份",
electric1: "938.00",
electric2: "976.00",
electric3: "923.00",
electric4: "856.00",
waterFee1: "180.00",
waterFee2: "103.00",
waterFee3: "285.00",
waterFee4: "215.00",
},
{
month: "10月份",
electric1: "938.00",
electric2: "976.00",
electric3: "923.00",
electric4: "856.00",
waterFee1: "180.00",
waterFee2: "103.00",
waterFee3: "285.00",
waterFee4: "215.00",
},
{
month: "11月份",
electric1: "938.00",
electric2: "976.00",
electric3: "923.00",
electric4: "856.00",
waterFee1: "180.00",
waterFee2: "103.00",
waterFee3: "285.00",
waterFee4: "215.00",
},
{
month: "12月份",
electric1: "938.00",
electric2: "976.00",
electric3: "923.00",
electric4: "856.00",
waterFee1: "180.00",
waterFee2: "103.00",
waterFee3: "285.00",
waterFee4: "215.00",
},
],
visible: false,
listLoading: true,
keyword: '',
list: [],
total: 0,
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
excludeIdList: [],
accountSubjectName: '',
contractCode: '',
accountState: '',
type: '',
businessType: '',
checked: [],
bill: {},
}
},
methods: {
goBack() {
this.$emit('refresh')
},
init(bill) {
this.bill = bill
this.visible = true
let print = this.$refs.print.innerHTML
let printPart = print + printStyle;
let newTab = window.open('_blank');
newTab.document.body.innerHTML = printPart;
newTab.print();
newTab.close();
this.visible = false
},
refresh() {
this.keyword = ''
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.init()
},
search() {
this.listQuery.currentPage = 1
this.listQuery.pageSize = 20
this.listQuery.sort = "desc"
this.listQuery.sidx = ""
this.init()
},
select() {
if (!this.checked.length) return
this.visible = false
this.$emit('refreshDataList', this.checked)
},
handleSelectionChange(val) {
this.checked = val
}
}
}
</script>
<style lang="scss" scoped>
.JNPF-preview-main {
font-family: SimSun;
margin:0;
overflow:hidden;
}
tr{
font-size: 12px;
}
.wrapper{
transform: rotate(90deg);
transform-origin:bottom left;
position:absolute;
top: -100vw;
left: 0;
height:100vw;
width:100vh;
overflow:auto;
}
</style>

@ -227,6 +227,8 @@
</template>
<el-button size="mini" type="text"
@click="downLoadPDF(scope.row.code)">开票文件下载</el-button>
<!-- <el-button size="mini" type="text"
@click="printPDF(scope.row.code)">打印</el-button> -->
<!-- <template v-if="scope.row.yunguanMark !== '200'">
<el-button size="mini" type="text" @click="repush(scope.row.id)"></el-button>
</template> -->
@ -253,6 +255,7 @@
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible = false" />
<bill v-if="billVisible" ref="bill" @refresh="initData" ></bill>
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail"
@close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson"
@ -281,17 +284,18 @@ import { thousandsFormat } from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
import { getToken } from "@/utils/auth";
import bill from "./Bill";
export default {
components: {
FlowBox,
SaleFlowBox,
SaleFlowBox,bill,
ExportBox, ToFormDetail, SuperQuery
},
data() {
return {
billVisible: false,
keyword: '',
expandsTree: true,
refreshTree: true,
@ -446,6 +450,17 @@ export default {
getToken()
);
},
printPDF(code) {
request({
url: `/api/scm/BusinessOrder/printPDF/` + code,
method: 'get'
}).then(res => {
this.billVisible = true
this.$nextTick(() => {
this.$refs.bill.init(res.data)
})
})
},
inBoundNotice(row) {
const selectData = row
selectData.flag = '采购入库通知'
@ -867,6 +882,7 @@ export default {
},
refresh(isrRefresh) {
this.formVisible = false
this.billVisible = false
if (isrRefresh) this.reset()
},
reset() {

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