Commit 89ba691e authored by 鲁鑫's avatar 鲁鑫

宝绅内部变更申请/通知单该界面增加打印功能。

parent 72d0d505
......@@ -181,7 +181,7 @@ function initializeToolBar(){
{ id: 'sleep', remark: '暂缓',name:'common.button.sleep', icon: 'fa-pause-circle', event: sleep },
{ id: 'abort', remark: '终止',name:'common.button.abort', icon: 'fa-stop-circle', event: abort},
//{ id: 'relate', remark: '协同关联',name:'common.button.relate', icon: 'fa-link', event: relate},
//{ id: 'print', remark: '打印',name:'common.button.print', icon: 'fa-print', event: print },
{ id: 'print', remark: '打印',name:'common.button.print', icon: 'fa-print', event: print },
{ id: 'showChart', remark: '流程图',name:'common.button.flowchart', icon: 'fa-sitemap', event: showChart},
{ id: 'showApprovalHistory', remark: '流程轨迹',name:'common.button.approvalhistory', icon: 'fa-table', event: showApprovalHistory},
{ id: 'taskCollect', remark: '收藏任务',name:'common.button.taskcollect', icon: 'fa-star', event: saveTaskCollect}
......@@ -1033,9 +1033,9 @@ function abort() {
* 打印
*/
function print() {
var url = location.href;
url=url.replace(/\.(job)\?/g,'.print?');
Public.openPostWindow(url);
// var url = location.href;
// url=url.replace(/\.(job)\?/g,'.print?');
// Public.openPostWindow(url);
}
// 流程图
......
......@@ -297,3 +297,12 @@ function getExtendedData(processAction) {
}
return extendedData;
}
function print(){
if ($("#statusId").val() != 3){
Public.tip("请审批完成再打印!");
return;
}
var url='/epChangeForm/print.load';
Public.openPostWindow(web_app.name+url,{id :$("#id").val()});
}
......@@ -32,7 +32,7 @@
</div>
<div class="hg-form-row">
<x:checkboxListC name="reasonForChange" dictionary="reasonForChange" required="true" label="变更原因" labelCol="2" fieldCol="6"/>
<x:inputC name="otherReason" required="false" label="其他原因" labelCol="2" fieldCol="2"/>
<x:inputC name="reasonDesc" required="false" label="原因描述" labelCol="2" fieldCol="2"/>
</div>
<div class="hg-form-row">
<x:checkboxListC name="changeEffective" dictionary="changeEffective" required="true" label="生效日期" labelCol="2" fieldCol="10"/>
......
......@@ -11,6 +11,11 @@ function initUI() {
function loadGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: addHandler,
printHandler: {
id: 'print', text: '打印', img:'fa-clipboard', click: function(){
printHandler();
}
},
});
gridManager = UICtrl.grid("#maingrid", {
columns: [
......@@ -69,3 +74,16 @@ function doView(id) {
url: web_app.name + '/epChangeForm/showEpChangeFormDetail.job?bizId='+id+"&isReadOnly=true"
});
}
function printHandler(){
var row = DataUtil.getUpdateRow(gridManager);
if (!row) {
return;
}
if (row.status != 3){
Public.tip("请审批完成再打印!");
return;
}
var url='/epChangeForm/print.load';
Public.openPostWindow(web_app.name+url,{id :row.id});
}
......@@ -18,21 +18,7 @@ function bindEvent(){
function loadGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: function () {
UICtrl.addGridRow(gridManager);
},
deleteHandler: function () {
var _grid = UICtrl.getGridManager('#maingrid');
DataUtil.delSelectedRows({
action: 'epSaleOrderCancelItem/deleteEpSaleOrderCancelItem.ajax',
param: {},
gridManager: _grid,
idFieldName: 'id',
onSuccess: function () {
reloadGrid();
}
});
}
});
gridManager = UICtrl.grid("#maingrid", {
columns: [
......
......@@ -21,21 +21,6 @@ function bindEvent(){
function loadGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: function () {
UICtrl.addGridRow(gridManager);
},
deleteHandler: function () {
var _grid = UICtrl.getGridManager('#maingrid');
DataUtil.delSelectedRows({
action: 'epSaleOrderItem/deleteEpSaleOrderItem.ajax',
param: {},
gridManager: _grid,
idFieldName: 'id',
onSuccess: function () {
reloadGrid();
}
});
}
});
gridManager = UICtrl.grid("#maingrid", {
columns: [
......
<!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 class="billTitle">宝绅内部变更申请/通知单</div>
<div class="billTitle">Specification Change Form</div>
<table cellspacing="0px" cellpadding="0px" class="tablePrint">
<colgroup>
<col width="34%"/>
</colgroup>
<tr>
<td class="right">变更编号SCF#:${billCode?default("")?html}</td>
</tr>
</table>
<div class="title" style="background: #CC8F81;text-align: center">General Information 基本信息</div>
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
<colgroup>
<col width='17%' />
<col width='17%' />
<col width='17%' />
<col width='16%' />
<col width='17%' />
<col width="16%" />
</colgroup>
<tr>
<td class="center">DATE日期:</td>
<td class="center"><@formatDate date=fillinDate/></td>
<td class="center">BRAND品牌名称:</td>
<td class="center">${brandName?default("")?html}</td>
<td class="center">CHANGE REQUESTED BY (DEPT/NAME)变更申请部门/姓名:</td>
<td class="center">${deptName?default("")?html}</td>
</tr>
</table>
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
<colgroup>
<col width='100%' />
</colgroup>
<tr>
<td class="left">REASON FOR CHANGE变更原因:${reasonDesc?default("")?html}</td>
</tr>
</table>
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
<colgroup>
<col width='100%' />
</colgroup>
<tr>
<td class="left">${reasonForChange?default("")?html}</td>
</tr>
</table>
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
<colgroup>
<col width='17%' />
<col width='83%' />
</colgroup>
<tr>
<td class="center">CHANGE EFFECTIVE 生效日期:</td>
<td class="left">${changeEffective?default("")?html}</td>
</tr>
</table>
<div class="title" style="background: #CC8F81;text-align: center">Change Details 变更内容</div>
<div class="title" style="background: yellow;text-align: left">CURRENT SPEC 目前产品信息</div>
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
<colgroup>
<col width='17%' />
<col width='83%' />
</colgroup>
<tr>
<td class="left">
PD#
产品代号#:</td>
<td class="left">${pd?default("")?html}</td>
</tr>
<tr>
<td class="left">
PRODUCT NAME:
产品名称:</td>
<td class="left">${productName?default("")?html}</td>
</tr>
<tr>
<td class="left">
PROCESS:
制程工艺:</td>
<td class="left">${process?default("")?html}</td>
</tr>
<tr>
<td class="left">MATERIAL原材料:</td>
<td class="left">${material?default("")?html}</td>
</tr>
<tr>
<td class="left">OTHERS 其他:</td>
<td class="left">${others?default("")?html}</td>
</tr>
</table>
<div class="title" style="background: yellow;text-align: left">REVISED SPEC 变更后产品信息</div>
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
<colgroup>
<col width='17%' />
<col width='83%' />
</colgroup>
<tr>
<td class="left">
PD#
产品代号#:</td>
<td class="left">${changedPd?default("")?html}</td>
</tr>
<tr>
<td class="left">
PRODUCT NAME:
产品名称:</td>
<td class="left">${changedProductName?default("")?html}</td>
</tr>
<tr>
<td class="left">
PROCESS:
制程工艺:</td>
<td class="left">${changedProcess?default("")?html}</td>
</tr>
<tr>
<td class="left">MATERIAL原材料:</td>
<td class="left">${changedMaterial?default("")?html}</td>
</tr>
<tr>
<td class="left">OTHERS 其他:</td>
<td class="left">${changedOthers?default("")?html}</td>
</tr>
</table>
<div class="blank_div"></div>
<div class="fontBold">审批明细</div>
<#include "/print/taskExecutionPrint.ftl" />
<div class="title" style="background: #CC8F81;text-align: center">Implementation 执行人(版具/模具等)</div>
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
<colgroup>
<col width='25%' />
<col width='25%' />
<col width='25%' />
<col width='25%' />
</colgroup>
<tr>
<td class="center" style="background: yellow">部门</td>
<td class="center" style="background: yellow">执行人</td>
<td class="center" style="background: yellow">签名确认</td>
<td class="center" style="background: yellow">DATE日期</td>
</tr>
<#if implItemMaps?? && implItemMaps?size gt 0>
<#list implItemMaps as detail>
<tr>
<td class="center">${detail.deptName?default("")?html}</td>
<td class="center">${detail.executor?default("")?html}</td>
<td class="center">${detail.confirmTextView?default("")?html}</td>
<td class="center">${detail.date?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>
</tr>
</#if>
</table>
<div class="title" style="background: #CC8F81;text-align: center">Stock / Inventory 库存</div>
<table cellspacing="0px" cellpadding="0px" class="tableBorder">
<colgroup>
<col width='25%' />
<col width='25%' />
<col width='25%' />
<col width='25%' />
</colgroup>
<tr>
<td class="center" style="background: yellow">部门</td>
<td class="center" style="background: yellow">专属原材料/半成品/在制品/成品数量(张)</td>
<td class="center" style="background: yellow">签名确认</td>
<td class="center" style="background: yellow">DATE日期</td>
</tr>
<#if stockItemMaps?? && stockItemMaps?size gt 0>
<#list stockItemMaps as detail>
<tr>
<td class="center">${detail.deptName?default("")?html}</td>
<td class="center">${detail.description?default("")?html}</td>
<td class="center">${detail.confirmTextView?default("")?html}</td>
<td class="center">${detail.date?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>
</tr>
</#if>
</table>
</body>
</html>
......@@ -2,6 +2,7 @@ package com.huigou.topsun.ep.change.controller;
import com.huigou.context.Operator;
import com.huigou.context.OrgUnit;
import com.huigou.data.domain.query.QueryPageRequest;
import com.huigou.topsun.ep.change.application.EpChangeFormApplication;
import com.huigou.topsun.ep.change.application.EpChangeFormImplItemApplication;
import com.huigou.topsun.ep.change.application.EpChangeFormStockItemApplication;
......@@ -10,14 +11,20 @@ import com.huigou.topsun.ep.change.domain.query.EpChangeFormQueryRequest;
import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.client.CommonController;
import com.huigou.util.ClassHelper;
import com.huigou.util.SDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import static sun.plugin2.os.windows.OSVERSIONINFOA.size;
/**
* @Auther: xin.lu
* @Date: 2024/06/19/10:05
......@@ -96,4 +103,54 @@ public class EpChangeFormController extends CommonController {
changeFormStockItemApplication.deleteItems(ids);
return success();
}
/**
* 打印
* @return
*/
public String print() {
SDO sdo = this.getSDO();
String id = sdo.getId();
EpChangeFormQueryRequest queryRequest = sdo.toQueryRequest(EpChangeFormQueryRequest.class);
queryRequest.setId(id);
Map<String, Object> objectMap = this.epChangeFormApplication.slicedEpChangeFormList(queryRequest);
List<Map<String, Object>> objectMaps = (List<Map<String, Object>>) objectMap.get("Rows");
Map<String,Object> map = objectMaps.get(0);
map.put("deptName",map.get("deptName")+"-"+map.get("personMemberName"));
String[] split = map.get("reasonForChange").toString().split(",");
String[] splitText = map.get("reasonForChangeTextView").toString().split(",");
List<String> strings = Arrays.asList(split);
List<String> stringTexts = Arrays.asList(splitText);
StringBuilder change = new StringBuilder();
for (int i = 0; i < strings.size(); i++) {
String s = strings.get(i);
change.append(" √ ").append(s).append(" ").append(stringTexts.get(i));
}
map.put("reasonForChange",change.toString());
StringBuilder effective = new StringBuilder();
String[] splitE = map.get("changeEffective").toString().split(",");
String[] splitETextView = map.get("changeEffectiveTextView").toString().split(",");
List<String> stringList = Arrays.asList(splitE);
List<String> stringListTextView = Arrays.asList(splitETextView);
for (int i = 0; i < stringList.size(); i++) {
String s = stringList.get(i);
effective.append(" √ ").append(s).append(" ").append(stringListTextView.get(i));
}
map.put("changeEffective",effective.toString());
// 获取Grid数据
QueryPageRequest pageModel = queryRequest.getPageModel();
pageModel.setPageSize(20);
queryRequest.setPageModel(pageModel);
queryRequest.setEpChangeFormId(id);
Map<String, Object> implItemMap = changeFormImplItemApplication.findByEpChangeFormId(queryRequest);
Map<String, Object> stockItemMap = changeFormStockItemApplication.findByEpChangeFormId(queryRequest);
List<Map<String, Object>> implItemMaps = (List<Map<String, Object>>) implItemMap.get("Rows");
List<Map<String, Object>> stockItemMaps = (List<Map<String, Object>>) stockItemMap.get("Rows");
map.put("printTime", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm").format(LocalDateTime.now()));
map.put("implItemMaps", implItemMaps);
map.put("stockItemMaps", stockItemMaps);
String pintPage = String.format("/print/topsun/epChangeForm.ftl");
return outputAndProcUnitHandlerPDF(pintPage, id, map);
}
}
......@@ -36,6 +36,12 @@ public class EpChangeForm extends FlowBillAbstractEntity {
@Column(name = "reason_for_change")
private String reasonForChange;
/**
* 原因描述
*/
@Column(name = "reason_desc")
private String reasonDesc;
/**
* 生效日期:
* □ IMMEDIATE立即变更 □ RUNNING CHANGE 正常变更(用完后变更) £ SEASON换季更改
......
......@@ -12,4 +12,5 @@ import lombok.Data;
public class EpChangeFormQueryRequest extends QueryAbstractRequest {
private String billCode;
private String epChangeFormId;
private String id;
}
......@@ -5,6 +5,7 @@
select t.* from ep_change_form t
</sql-query>
<condition column="bill_code" name="billCode" type="java.lang.String" symbol="like" alias="t"/>
<condition column="id" name="id" type="java.lang.String" symbol="=" alias="t"/>
</query>
<query name="epSaleOrderItems" label="EP销售订单明细" table="ep_sale_order_item">
......
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