Commit 312b9767 authored by 鲁鑫's avatar 鲁鑫

报价打印预览

parent 7d6588f1
......@@ -294,7 +294,6 @@ function startup(operate, fn, showTips) {
// 保存
function save(fn, showTips) {
debugger
var extendedData = getExtendedData(ProcessAction.SAVE);
if (extendedData === false) {
return false;
......@@ -361,7 +360,7 @@ function doQueryAdvance() {
});
}
function doQueryHandlers() {debugger
function doQueryHandlers() {
var extendedData = getExtendedData(ProcessAction.QUERY_HANDLERS);
if (extendedData === false) {
return;
......
......@@ -3,7 +3,7 @@ var bomGridManager = null, technologyGridManager = null;
$(document).ready(function () {
initializateUI();
initializateBomGrid();
initializateTechnologyGrid();
//initializateTechnologyGrid();
});
......@@ -17,6 +17,18 @@ function initializateBomGrid() {
addHandler: function(){
UICtrl.addGridRow(bomGridManager,{ sequence: bomGridManager.getData().length + 1 });
},
deleteHandler: function (){
var _grid = UICtrl.getGridManager('#bomGrid');
DataUtil.delSelectedRows({
action: 'quotationItem/deleteQuotationItem.ajax',
param: {},
gridManager: _grid,
idFieldName: 'quotationItemId',
onSuccess: function () {
reloadGrid();
}
});
},
});
bomGridManager = UICtrl.grid("#bomGrid", {
columns: [
......@@ -24,43 +36,69 @@ function initializateBomGrid() {
editor: { type: 'spinner', min: 1, max: 100, mask: 'nnn'}
},
{
display: "产品编码", name: "productCode", width: 140, minWidth: 60, type: "string", align: "left",
display: "名称", name: "productName", width: 140, minWidth: 60, type: "string", align: "left",
editor: {
data: {
type: 'system',
name: "productChoose",
back: {
productId: "productId",
productCode: "productCode",
//productCode: "productCode",
productName: "productName",
productUnit: "productUnit",
//productUnit: "productUnit",
}
},
required: true,
required: false,
type: "select"
}
},
{display: "产品名称", name: "productName", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "单位", name: "productUnit", width: 120, minWidth: 60, type: "string", align: "left"},
/*{
display: "币别", name: "currency", width: 140, minWidth: 60, type: "string", align: "left",
{display: "产品代号", name: "productCodeName", width: 120, minWidth: 60, type: "string", align: "left",
editor: {
required: true,
required: false,
type: 'text'
}
},*/
},
{display: "图片", name: "picture", width: 120, minWidth: 60, type: "string", align: "left",
editor: {
required: false,
type: 'text'
}
},
{
display: "用量", name: "price", width: 120, minWidth: 60, type: "string", align: "left",
display: "产品参数", name: "productParameter", width: 300, minWidth: 60, type: "string", align: "left",
editor: {
required: true,
required: false,
type: 'text'
}
},
{
display: "含13%增值税&含运费单价(RMB/张)", name: "taxPrice", width: 250, minWidth: 60, type: "string", align: "left",
editor: {
required: false,
type: 'text',
mask: '9999999.99'
}
},
{
display: "备注", name: "remark", width: 140, minWidth: 60, type: "string", align: "left",
display: "出厂价单价(USD/张)", name: "price", width: 200, minWidth: 60, type: "string", align: "left",
editor: {
required: true,
required: false,
type: 'text',
mask: '9999999.99'
}
},
{
display: "MOQ(最小起订量)", name: "moq", width: 120, minWidth: 60, type: "string", align: "left",
editor: {
required: false,
type: 'text',
mask: '9999999.99'
}
},
{
display: "备注", name: "remark", width: 200, minWidth: 60, type: "string", align: "left",
editor: {
required: false,
type: 'text'
}
},
......@@ -73,7 +111,7 @@ function initializateBomGrid() {
toolbar: toolbarOptions,
enabledEdit: true,
width: "100%",
height: "400",
height: "90%",
heightDiff: -8,
checkbox: true,
fixedCellHeight: true,
......@@ -84,13 +122,13 @@ function initializateBomGrid() {
onAfterShowData: function (currentData) {
setTimeout(function () {
//加载工艺
reloadTechnologyGrid();
//reloadTechnologyGrid();
},200)
},
onAfterEdit:function (item) {
//加载工艺
if (item.column.name == "productCode") {
reloadTechnologyGrid();
//reloadTechnologyGrid();
}
}
});
......@@ -101,9 +139,19 @@ function initializateTechnologyGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({});
technologyGridManager = UICtrl.grid("#technologyGrid", {
columns: [
{display: "工艺", name: "technologyName", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "工序", name: "processName", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "资源", name: "resourceName", width: 120, minWidth: 60, type: "string", align: "left"},
//{display: "工艺", name: "technologyName", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "工序", name: "processName", width: 120, minWidth: 60, type: "string", align: "left",
editor: {
required: false,
type: 'text'
}
},
{display: "资源", name: "resourceName", width: 120, minWidth: 60, type: "string", align: "left",
editor: {
required: false,
type: 'text'
}
},
],
dataAction: "server",
url: web_app.name + '/technology/queryTechnologyByProduct.ajax',
......
......@@ -37,8 +37,8 @@
<x:title title="BOM信息" name="group" hideTable="#info" />
<div id="bomGrid" style="margin: 2px;"></div>
<x:title title="工艺信息" name="group" hideTable="#info" />
<div id="technologyGrid" style="margin: 2px;"></div>
<%--<x:title title="工艺信息" name="group" hideTable="#info" />
<div id="technologyGrid" style="margin: 2px;"></div>--%>
</form>
</div>
</body>
......
......@@ -8,7 +8,7 @@ $(document).ready(function () {
function loadProcessListGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: function () {
UICtrl.addGridRow(processGridManager,{ sequence: processGridManager.getData().length + 1 });
UICtrl.addGridRow(processGridManager,{ sortNum: processGridManager.getData().length + 1 });
},
deleteHandler: function () {
var _grid = UICtrl.getGridManager('#processListGrid');
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title> 品牌报价单</title>
<#include "/print/commonStyleTemplate.ftl" />
<style type="text/css">
td {
font-size: 13px;
}
</style>
</head>
<body>
<div style="text-align: center;font-size: large;font-weight:bold;"> ${companyNameEn?default("")?html}</div>
<div style="text-align: center">${address?default("")?html}</div>
<div style="text-align: center">tel:${tel?default("")?html} fax: ${fax?default("")?html}</div>
<div style="text-align: center">email: ${email?default("")?html}</div>
<div style="text-align: center">————————————————————————————</div>
<div class="billTitle"> 报价单</div>
<table cellspacing="0px" cellpadding="0px" class="tablePrint">
<div style="text-align: left">${fillinDate?default("")?html}</div>
<div style="text-align: left">Attn: ${Attn?default("")?html} </div>
<div style="text-align: left">From: ${From?default("")?html}</div>
<div style="text-align: left">Re: ${Re?default("")?html}</div>
<div style="text-align: left">${bsn?default("")?html}</div>
</table>
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
<colgroup>
<col width='10%'/>
<col width='20%'/>
<col width='15%'/>
<col width='40%'/>
<col width='6%'/>
<col width='9%'/>
</colgroup>
<tr>
<td class="center">Item#(项目)</td>
<td class="center">Product Name(品名)</td>
<td class="center">Image(图片)</td>
<td class="center">Spec(规格)</td>
<td class="center">(Exw)出厂价 Unit Price (US$/pc)</td>
<td class="center">Remark(备注)</td>
</tr>
<#if gridData?? && gridData?size gt 0>
<#list gridData as detail>
<tr>
<td class="center">${detail.sequence?default("")?html}</td>
<td class="center">${detail.productName?default("")?html}</td>
<td class="center">${detail.picture?default("")?html}</td>
<td class="center">${detail.spec?default("")?html}</td>
<td class="center">${detail.price?default("")?html}</td>
<td class="center">${detail.remark?default("")?html}</td>
</tr>
</#list>
<#else>
<tr>
<td class="center">&nbsp;</td>
<td class="center">&nbsp;</td>
<td class="center">&nbsp;</td>
<td class="center">&nbsp;</td>
<td class="center">&nbsp;</td>
<td class="center">&nbsp;</td>
</tr>
</#if>
</table>
<div class="blank_div"></div>
<div style="text-align: left;font-size: large"> Terms</div>
<div style="text-align: left">${term1?default("")?html}</div>
<div style="text-align: left">${term2?default("")?html}</div>
<div style="text-align: left">${term3?default("")?html}</div>
<div style="text-align: left">${term4?default("")?html}</div>
<div style="text-align: left">${term5?default("")?html}</div>
<div class="blank_div"></div>
<div class="fontBold">审批明细</div>
<#include "/print/taskExecutionPrint.ftl" />
</body>
</html>
......@@ -14,7 +14,6 @@
</head>
<body>
<div class="billTitle"> ${companyName?default("")?html}</div>
<div style="text-align: center">${companyName?default("")?html}</div>
<div style="text-align: center">${address?default("")?html}</div>
<div style="text-align: center">tel:${tel?default("")?html} fax: ${fax?default("")?html}</div>
<div style="text-align: center">email: ${email?default("")?html}</div>
......
......@@ -15,12 +15,19 @@ import com.huigou.topsun.quotation.vo.QuotationItemVo;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.bpm.FlowBroker;
import com.huigou.util.ClassHelper;
import com.huigou.util.DateUtil;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.DelegateTask;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.Instant;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.stream.Collectors;
......@@ -64,6 +71,30 @@ public class QuotationApplicationImpl extends FlowBroker implements QuotationApp
return ClassHelper.toMap(quotationRepository.getOne(bizId));
}
/**
* 设置任务名称
*/
@Override
protected void setTaskDescription(DelegateTask delegateTask) {
String bizId = delegateTask.getExecution().getProcessBusinessKey();
delegateTask.setDescription(this.getApprovalSubjectName(bizId));
}
/**
* 获取任务标题
*
* @param bizId
* @return
*/
private String getApprovalSubjectName(String bizId) {
Quotation quotation = this.findById(bizId);
String subjectName = String.format("%s-%s(%s)"
,quotation.getQuotationNo()
,quotation.getPersonMemberName()
,DateUtil.getDateFormat(ClassHelper.convert(quotation.getFillinDate(), Date.class)));
return subjectName;
}
@Override
protected void onEnd(DelegateExecution delegateExecution) {
super.onEnd(delegateExecution);
......@@ -128,10 +159,8 @@ public class QuotationApplicationImpl extends FlowBroker implements QuotationApp
QuotationItemVo quotationItemVo = new QuotationItemVo();
BeanUtil.copyProperties(quotationItem, quotationItemVo);
Product product = productRepository.findOne(quotationItem.getProductId());
quotationItemVo.setProductCode(product.getProductSampleCode());
quotationItemVo.setProductName(product.getProductName());
quotationItemVo.setProductUnit(product.getProductUnit());
//Product product = productRepository.findOne(quotationItem.getProductId());
//quotationItemVo.setProductUnit(product.getProductUnit());
return quotationItemVo;
})
.collect(Collectors.toList());
......@@ -171,12 +200,26 @@ public class QuotationApplicationImpl extends FlowBroker implements QuotationApp
String email = SystemCache.getParameter("bsn.brand.email", String.class);
String fax = SystemCache.getParameter("bsn.brand.fax", String.class);
String tel = SystemCache.getParameter("bsn.brand.tel", String.class);
String term1 = SystemCache.getParameter("bsn.brand.term1", String.class);
String term2 = SystemCache.getParameter("bsn.brand.term2", String.class);
String term3 = SystemCache.getParameter("bsn.brand.term3", String.class);
String term4 = SystemCache.getParameter("bsn.brand.term4", String.class);
String term5 = SystemCache.getParameter("bsn.brand.term5", String.class);
map.put("companyName",companyName);
map.put("companyNameEn",companyNameEn);
map.put("address",address);
map.put("email",email);
map.put("fax",fax);
map.put("tel",tel);
map.put("term1",term1);
map.put("term2",term2);
map.put("term3",term3);
map.put("term4",term4);
map.put("term5",term5);
map.put("Attn","Mitzi Cavour");
map.put("From","Paul Rao");
map.put("Re","BSN offer to Cariuma for Polybag&Label");
map.put("bsn","BSN (Baoshen) is glad to make the following quotation and look forward to working with Cariuma.");
return map;
}
}
......
......@@ -37,4 +37,11 @@ public class QuotationItemController extends CommonController {
}
return packGridDataAndResult(quotationItemVos);
}
public String deleteQuotationItem(){
SDO sdo = getSDO();
List<String> ids = sdo.getIds();
quotationItemApplication.deleteQuotationItem(ids);
return success();
}
}
......@@ -33,6 +33,7 @@ public class QuotationItem implements Serializable {
/**
* 序号/行项目
*/
@Column(name = "sequence")
private Integer sequence;
/**
......@@ -42,90 +43,61 @@ public class QuotationItem implements Serializable {
private String productId;
/**
* 单价
* 名称
*/
private BigDecimal price;
@Column(name = "product_name")
private String productName;
/**
* 币别(码表currency)
* 产品代号
*/
private String currency;
@Column(name = "product_code_name")
private String productCodeName;
/**
* 备注
* 图片
*/
private String remark;
@Column(name = "picture")
private String picture;
/**
* 产品参数
*/
@Column(name = "product_parameter")
private String productParameter;
/**
* 含13%增值税&含运费单价
*/
@Column(name = "tax_price")
private BigDecimal taxPrice;
/**
* 预估
* 出厂价单
*/
@Column(name = "presale_price")
private BigDecimal presalePrice;
@Column(name = "price")
private BigDecimal price;
/**
* 最小起订量
*/
@Column(name = "moq")
private BigDecimal moq;
/**
* 币别(码表currency)
*/
@Column(name = "currency")
private String currency;
/**
* 正式价格
* 备注
*/
@Column(name = "formal_price")
private BigDecimal formalPrice;
@Column(name = "remark")
private String remark;
private static final long serialVersionUID = 1L;
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
QuotationItem other = (QuotationItem) that;
return (this.getQuotationItemId() == null ? other.getQuotationItemId() == null : this.getQuotationItemId().equals(other.getQuotationItemId()))
&& (this.getQuotationId() == null ? other.getQuotationId() == null : this.getQuotationId().equals(other.getQuotationId()))
&& (this.getSequence() == null ? other.getSequence() == null : this.getSequence().equals(other.getSequence()))
&& (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId()))
&& (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
&& (this.getCurrency() == null ? other.getCurrency() == null : this.getCurrency().equals(other.getCurrency()))
&& (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
&& (this.getPresalePrice() == null ? other.getPresalePrice() == null : this.getPresalePrice().equals(other.getPresalePrice()))
&& (this.getFormalPrice() == null ? other.getFormalPrice() == null : this.getFormalPrice().equals(other.getFormalPrice()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getQuotationItemId() == null) ? 0 : getQuotationItemId().hashCode());
result = prime * result + ((getQuotationId() == null) ? 0 : getQuotationId().hashCode());
result = prime * result + ((getSequence() == null) ? 0 : getSequence().hashCode());
result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
result = prime * result + ((getCurrency() == null) ? 0 : getCurrency().hashCode());
result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
result = prime * result + ((getPresalePrice() == null) ? 0 : getPresalePrice().hashCode());
result = prime * result + ((getFormalPrice() == null) ? 0 : getFormalPrice().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", quotationItemId=").append(quotationItemId);
sb.append(", quotationId=").append(quotationId);
sb.append(", sequence=").append(sequence);
sb.append(", productId=").append(productId);
sb.append(", price=").append(price);
sb.append(", currency=").append(currency);
sb.append(", remark=").append(remark);
sb.append(", presalePrice=").append(presalePrice);
sb.append(", formalPrice=").append(formalPrice);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
package com.huigou.topsun.quotation.vo;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
......@@ -13,9 +10,6 @@ import java.math.BigDecimal;
*/
@Data
public class QuotationItemVo implements Serializable {
/**
*
*/
private String quotationItemId;
/**
......@@ -34,34 +28,53 @@ public class QuotationItemVo implements Serializable {
private String productId;
/**
* 单价
* 名称
*/
private BigDecimal price;
private String productName;
/**
* 币别(码表currency)
* 产品代号
*/
private String currency;
private String productCodeName;
/**
* 备注
* 图片
*/
private String remark;
private String picture;
/**
* 预估价
* 产品参数
*/
@Column(name = "presale_price")
private BigDecimal presalePrice;
private String productParameter;
/**
* 正式价格
* 含13%增值税&含运费单价
*/
private BigDecimal formalPrice;
private BigDecimal taxPrice;
private String productCode;
/**
* 出厂价单价
*/
private BigDecimal price;
private String productName;
/**
* 最小起订量
*/
private BigDecimal moq;
/**
* 币别(码表currency)
*/
private String currency;
/**
* 备注
*/
private String remark;
/**
* 单位
*/
private String productUnit;
}
\ No newline at end of file
......@@ -4,15 +4,20 @@
<query name="queryQuotationItemList" label="报价明细表" table="quotation_item">
<sql-query>
SELECT
qi.*,
p.product_name,
p.product_unit,
pc.product_category_code AS product_code
FROM
quotation_item qi
LEFT JOIN product p ON qi.product_id = p.product_id
LEFT JOIN product_category pc ON p.product_category_id = pc.product_category_id
where qi.quotation_id = ?
qi.quotation_item_id,
qi.quotation_id,
qi.sequence,
qi.product_id,
qi.price,
qi.currency,
qi.remark,
qi.product_name,
qi.product_code_name,
qi.picture,
qi.product_parameter,
qi.tax_price,
qi.moq
FROM quotation_item qi where qi.quotation_id = ?
</sql-query>
</query>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment