Commit 62403d57 authored by 刘学辉's avatar 刘学辉

物料主数据、异常单调整

parent 3bd2ba83
...@@ -27,12 +27,14 @@ function initItemGrid() { ...@@ -27,12 +27,14 @@ function initItemGrid() {
$('#werksName').val(data.NAME1); $('#werksName').val(data.NAME1);
} }
}); });
$('input[name="customerName"]').change(function () { $('input[name="payMoney"]').change(function () {
// alert(22223); if (isNaN(Number($('#payMoney').val()))){
// Public.ajax(web_app.name + '/exceptionReport/getCustomerOrders.ajax' Public.errorTip("赔付金额必须输入数字!");
// , {customerNo:"4ttdssd"}, function (data) { $('#payMoney').val("");
// alert(18883); countSum();
// }); return false;
}
countSum();
}) })
/*$('#customerName').searchbox({ /*$('#customerName').searchbox({
type: "system", name: "sapCustomerOrderSelect", type: "system", name: "sapCustomerOrderSelect",
...@@ -53,8 +55,12 @@ function initItemGrid() { ...@@ -53,8 +55,12 @@ function initItemGrid() {
$('#customerOrderNo').searchbox({ $('#customerOrderNo').searchbox({
type: "system", name: "sapCustomerOrderSelect", type: "system", name: "sapCustomerOrderSelect",
getParam: function (item) { getParam: function (item) {
if (Public.isBlank($('#werksName').val())){
Public.tip("请先选择工厂!")
return false
}
if (Public.isBlank($('#customerNo').val())){ if (Public.isBlank($('#customerNo').val())){
Public.tip("请先选择客户编号!") Public.tip("请先输入客户编号!")
return false return false
} }
return { return {
...@@ -69,6 +75,10 @@ function initItemGrid() { ...@@ -69,6 +75,10 @@ function initItemGrid() {
}); });
var toolbarOptions = UICtrl.getDefaultToolbarOptions({ var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: function(){ addHandler: function(){
if (Public.isBlank($('#customerOrderNo').val())){
Public.tip("请先输入客户订单号!")
return false
}
UICtrl.addGridRow(itemGridManager); UICtrl.addGridRow(itemGridManager);
}, },
deleteHandler: function (){ deleteHandler: function (){
...@@ -102,6 +112,14 @@ function initItemGrid() { ...@@ -102,6 +112,14 @@ function initItemGrid() {
selectRowButtonOnly: true, selectRowButtonOnly: true,
//autoApplyNextEditor:false, //autoApplyNextEditor:false,
toolbar: toolbarOptions, toolbar: toolbarOptions,
onAfterEdit: function (item) {
if (item.column.name=='rmbMoney' ){
countSum();
}
},
onAfterShowData(){
countSum();
}
}) })
UICtrl.setSearchAreaToggle(itemGridManager); UICtrl.setSearchAreaToggle(itemGridManager);
} }
...@@ -194,30 +212,23 @@ dutyPersonGridManager = UICtrl.grid('#dutyPersonGrid', { ...@@ -194,30 +212,23 @@ dutyPersonGridManager = UICtrl.grid('#dutyPersonGrid', {
selectRowButtonOnly: true, selectRowButtonOnly: true,
//autoApplyNextEditor:false, //autoApplyNextEditor:false,
toolbar: toolbarOptions, toolbar: toolbarOptions,
onAfterEdit: function (item) {
if (item.column.name=='dutyMoney' ){
countSum();
}
},
onAfterShowData(){
countSum();
}
} }
); );
UICtrl.setSearchAreaToggle(dutyPersonGridManager); UICtrl.setSearchAreaToggle(dutyPersonGridManager);
} }
function countSum(){ function countSum(){
var row=dutyPersonGridManager.rows; //var row=itemGridManager.rows;
var zrow=itemGridManager.rows; var zrow=itemGridManager.rows;
var money=0; var money=0;
for (var r=0;r<zrow.length;r++){ for (var r=0;r<zrow.length;r++){
money = MathUtil.add(zrow[r].rmbMoney,money); money = MathUtil.add(zrow[r].rmbMoney,money);
}
for (var x=0;x<row.length;x++){
money = MathUtil.add(row[x].dutyMoney,money);
} }
$('#payMoney').val(money); money = MathUtil.add($('#payMoney').val(),money);
// for (var x=0;x<row.length;x++){
// money = MathUtil.add(row[x].dutyMoney,money);
// }
$('#loseMoney').val(money);
} }
function getDutyPersonGridColumns() { function getDutyPersonGridColumns() {
var columns = []; var columns = [];
...@@ -306,3 +317,12 @@ function printPage() { ...@@ -306,3 +317,12 @@ function printPage() {
Public.openPostWindow(web_app.name + '/PDFViewer/PDFViewer.do',{id: $("#id").val(),applicationType:"exceptionReport"}); Public.openPostWindow(web_app.name + '/PDFViewer/PDFViewer.do',{id: $("#id").val(),applicationType:"exceptionReport"});
} }
function isNumber(val){
var regPos = /^\+?[1-9][0-9]*$/;
// var regNeg = /^\-[1-9][0-9]*$/; // 负整数
if(regPos.test(val)){
return true;
}else{
return false;
}
}
...@@ -38,14 +38,16 @@ ...@@ -38,14 +38,16 @@
<div class="hg-form-row"> <div class="hg-form-row">
<x:selectC name="exceptionType" label="异常类型" labelCol="1" fieldCol="2" required="true" dictionary="exceptionType"/> <x:selectC name="exceptionType" label="异常类型" labelCol="1" fieldCol="2" required="true" dictionary="exceptionType"/>
<x:inputC name="reportDate" label="呈报日期" labelCol="1" fieldCol="2" required="true" wrapper="date"/> <x:inputC name="reportDate" label="呈报日期" labelCol="1" fieldCol="2" required="true" wrapper="date"/>
</div>
<div class="hg-form-row">
<x:inputC name="werksName" required="true" label="工厂" labelCol="1" wrapper="select" fieldCol="2"/> <x:inputC name="werksName" required="true" label="工厂" labelCol="1" wrapper="select" fieldCol="2"/>
<x:hidden name="werks"/> <x:hidden name="werks"/>
</div>
<div class="hg-form-row">
<x:inputC name="customerNo" label="客户编号" labelCol="1" fieldCol="2" required="true"/> <x:inputC name="customerNo" label="客户编号" labelCol="1" fieldCol="2" required="true"/>
<x:inputC name="customerOrderNo" label="客户订单号" labelCol="1" fieldCol="2" wrapper="select" required="true"/>
<x:inputC name="customerName" label="客户名称" labelCol="1" fieldCol="2" required="false" readonly="true"/> <x:inputC name="customerName" label="客户名称" labelCol="1" fieldCol="2" required="false" readonly="true"/>
<!--x:inputC name="customerOrderNo" label="客户单号" labelCol="1" fieldCol="2" required="true"/--> <!--x:inputC name="customerOrderNo" label="客户单号" labelCol="1" fieldCol="2" required="true"/-->
<x:inputC name="customerOrderNo" label="客户订单号" labelCol="1" fieldCol="2" wrapper="select"/>
</div> </div>
</div> </div>
<x:title title="单号信息" name="group" hideTable="#info" /> <x:title title="单号信息" name="group" hideTable="#info" />
...@@ -84,7 +86,8 @@ ...@@ -84,7 +86,8 @@
<x:title title="责任人信息" name="group" hideTable="#info" /> <x:title title="责任人信息" name="group" hideTable="#info" />
<div id="dutyPersonGrid"></div> <div id="dutyPersonGrid"></div>
<div class="hg-form-row"> <div class="hg-form-row">
<x:inputC name="payMoney" label="赔付金额" labelCol="1" fieldCol="2" required="false" readonly="true"/> <x:inputC name="payMoney" label="赔付金额" labelCol="1" fieldCol="2" required="false" readonly="false" />
<x:inputC name="loseMoney" label="损失金额" labelCol="1" fieldCol="2" required="false" readonly="true" />
</div> </div>
</form> </form>
</div> </div>
......
...@@ -21,9 +21,10 @@ function initGrid() { ...@@ -21,9 +21,10 @@ function initGrid() {
, {display: "报告编号", name: "billCode", width: 150, minWidth: 60, type: "string", align: "center"} , {display: "报告编号", name: "billCode", width: 150, minWidth: 60, type: "string", align: "center"}
, {display: "异常类型", name: "exceptionTypeTextView", width: 100, minWidth: 60, type: "string", align: "center"} , {display: "异常类型", name: "exceptionTypeTextView", width: 100, minWidth: 60, type: "string", align: "center"}
, {display: "呈报日期", name: "reportDate", width: 140, minWidth: 60, type: "date", align: "center"} , {display: "呈报日期", name: "reportDate", width: 140, minWidth: 60, type: "date", align: "center"}
, {display: "客户名称/供应商名称", name: "customerName", width: 200, minWidth: 60, type: "date", align: "center"} , {display: "客户编号", name: "customerName", width: 200, minWidth: 60, type: "date", align: "center"}
, {display: "客户名称", name: "customerName", width: 200, minWidth: 60, type: "date", align: "center"}
, {display: "客户单号", name: "customerOrderNo", width: 180, minWidth: 60, type: "date", align: "center"} , {display: "客户单号", name: "customerOrderNo", width: 180, minWidth: 60, type: "date", align: "center"}
, {display: "异常陈诉", name: "exceptionState", width: 200, minWidth: 60, type: "date", align: "center"} // , {display: "异常陈诉", name: "exceptionState", width: 200, minWidth: 60, type: "date", align: "center"}
, {display: "改善措施", name: "dealMethod", width: 200, minWidth: 60, type: "date", align: "center"} , {display: "改善措施", name: "dealMethod", width: 200, minWidth: 60, type: "date", align: "center"}
, {display: "异常原因", name: "exceptionReason", width: 200, minWidth: 60, type: "date", align: "center"} , {display: "异常原因", name: "exceptionReason", width: 200, minWidth: 60, type: "date", align: "center"}
, {display: "责任人", name: "checkOperatorName", width: 160, minWidth: 60, type: "date", align: "center"} , {display: "责任人", name: "checkOperatorName", width: 160, minWidth: 60, type: "date", align: "center"}
......
...@@ -431,6 +431,12 @@ function warehouseMustInput(flag) { ...@@ -431,6 +431,12 @@ function warehouseMustInput(flag) {
} }
function financialMustInput(flag) { function financialMustInput(flag) {
UICtrl.setElRequiredFlag("#bklas",flag); UICtrl.setElRequiredFlag("#bklas",flag);
UICtrl.setElRequiredFlag("#vprsv",flag);
UICtrl.setElRequiredFlag("#mlast",flag);
UICtrl.setElRequiredFlag("#peinh",flag);
UICtrl.setElRequiredFlag("#ncost",flag);
UICtrl.setElRequiredFlag("#hkmat",flag);
UICtrl.setElRequiredFlag("#ekalr",flag);
var peinh = $("#peinh").val(); //定价基数 var peinh = $("#peinh").val(); //定价基数
if (Public.isBlank(peinh)){ if (Public.isBlank(peinh)){
$("#peinh").val("1000"); $("#peinh").val("1000");
...@@ -443,6 +449,8 @@ function financialDisplayNcost(vprsv) { // alert("-="+vprsv); ...@@ -443,6 +449,8 @@ function financialDisplayNcost(vprsv) { // alert("-="+vprsv);
if (vprsv == 'S') { //标准价格 if (vprsv == 'S') { //标准价格
$('#ncost').val('0'); $('#ncost').val('0');
$('#ncost_text').val('空'); $('#ncost_text').val('空');
$('#mlast').val('3');
$('#mlast_text').val('单/多级');
} else if (vprsv == 'V') { //移动平均价格 } else if (vprsv == 'V') { //移动平均价格
if ($('#beskz').val() == 'F' || $('#sobsl').val() == '40' || $('#sobsl').val() == '70') { //外部采购,库存转储,从1010工厂领料 if ($('#beskz').val() == 'F' || $('#sobsl').val() == '40' || $('#sobsl').val() == '70') { //外部采购,库存转储,从1010工厂领料
$('#ncost').val('0'); $('#ncost').val('0');
...@@ -451,6 +459,8 @@ function financialDisplayNcost(vprsv) { // alert("-="+vprsv); ...@@ -451,6 +459,8 @@ function financialDisplayNcost(vprsv) { // alert("-="+vprsv);
$('#ncost').val('X'); $('#ncost').val('X');
$('#ncost_text').val('是'); $('#ncost_text').val('是');
} }
$('#mlast').val('2');
$('#mlast_text').val('基于交易的');
} }
} }
......
...@@ -354,18 +354,19 @@ ...@@ -354,18 +354,19 @@
<!--x:selectC name="bklas" label="评估分类" labelCol="1" fieldCol="2" dictionary="bklas"/--> <!--x:selectC name="bklas" label="评估分类" labelCol="1" fieldCol="2" dictionary="bklas"/-->
<x:inputC name="bklas" label="评估分类" labelCol="1" fieldCol="2" readonly="true"/> <x:inputC name="bklas" label="评估分类" labelCol="1" fieldCol="2" readonly="true"/>
<!--x:inputC name="mlast" label="价格确定" labelCol="1" fieldCol="2" required="false"/--> <!--x:inputC name="mlast" label="价格确定" labelCol="1" fieldCol="2" required="false"/-->
<x:selectC name="vprsv" label="价格控制" labelCol="1" fieldCol="2" dictionary="vprsv" />
<x:selectC name="mlast" label="价格确定" labelCol="1" fieldCol="2" dictionary="mlast"/> <x:selectC name="mlast" label="价格确定" labelCol="1" fieldCol="2" dictionary="mlast"/>
<x:selectC name="vprsv" label="价格控制" labelCol="1" fieldCol="2" dictionary="vprsv"/>
<x:inputC name="peinh" label="定价基数" labelCol="1" fieldCol="2" required="false"/> <x:inputC name="peinh" label="定价基数" labelCol="1" fieldCol="2" required="false"/>
<x:inputC name="verpr" label="移动平均价" labelCol="1" fieldCol="2"/> <x:inputC name="verpr" label="移动平均价" labelCol="1" fieldCol="2"/>
<x:inputC name="stprs" label="标准价" labelCol="1" fieldCol="2"/> <x:inputC name="stprs" label="标准价" labelCol="1" fieldCol="2"/>
<x:selectC name="ncost" label="不参与成本核算" labelCol="2" fieldCol="1" dictionary="xchpf"/> <x:selectC name="ncost" label="不参与成本核算" labelCol="2" fieldCol="1" dictionary="xchpf"/>
<x:selectC name="hkmat" label="物料来源" labelCol="1" fieldCol="2" dictionary="xchpf"/>
</div> </div>
<div class="hg-form-row"> <div class="hg-form-row">
<x:selectC name="ekalr" label="数量结构" labelCol="1" fieldCol="2" dictionary="xchpf"/> <x:selectC name="ekalr" label="根据数量结构进行成本核算" labelCol="2" fieldCol="1" dictionary="xchpf"/>
<x:selectC name="hkmat" label="物料来源" labelCol="1" fieldCol="2" dictionary="xchpf"/>
<x:inputC name="awsls" label="差异码" labelCol="1" fieldCol="2"/> <x:inputC name="awsls" label="差异码" labelCol="1" fieldCol="2"/>
<x:inputC name="eklas" label="销售评估类" labelCol="1" fieldCol="2"/> <x:inputC name="eklas" label="销售评估类" labelCol="1" fieldCol="2"/>
</div> </div>
......
...@@ -58,43 +58,15 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except ...@@ -58,43 +58,15 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "exceptionReport"); QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "exceptionReport");
QueryModel queryModel = this.sqlExecutorDao.getQueryModel(queryDescriptor, queryRequest); QueryModel queryModel = this.sqlExecutorDao.getQueryModel(queryDescriptor, queryRequest);
if (StringUtil.isNotBlank(queryRequest.getCustomerName())) { // if (queryRequest.getStartDate() != null&&!"".equals(queryRequest.getStartDate())) {
queryModel.addCriteria(" and t.customer_name like:customerName"); // queryModel.addCriteria(" and t.report_date >=:startDate");
queryModel.putLikeParam("customerName", queryRequest.getCustomerName()); // queryModel.putParam("startDate", queryRequest.getStartDate());
} // }
if (StringUtil.isNotBlank(queryRequest.getCustomerOrderNo())) { // if (queryRequest.getEndDate() != null&&!"".equals(queryRequest.getEndDate())) {
queryModel.addCriteria(" and t.customer_order_no like:customerOrderNo"); // queryModel.addCriteria(" and t.report_date <=:endDate");
queryModel.putLikeParam("customerOrderNo", queryRequest.getCustomerOrderNo()); // queryModel.putParam("endDate", queryRequest.getEndDate());
} // }
if (StringUtil.isNotBlank(queryRequest.getDeptName())) { queryModel.addCriteria(" order by bill_code desc ");
queryModel.addCriteria(" and t.dept_name like:deptName");
queryModel.putLikeParam("deptName", queryRequest.getDeptName());
}
if (StringUtil.isNotBlank(queryRequest.getPersonMemberName())) {
queryModel.addCriteria(" and t.person_member_name like:personMemberName");
queryModel.putLikeParam("personMemberName", queryRequest.getPersonMemberName());
}
if (queryRequest.getStatus() != null) {
queryModel.addCriteria(" and t.status =:status");
queryModel.putParam("status", queryRequest.getStatus());
}
if (queryRequest.getStartDate() != null&&!"".equals(queryRequest.getStartDate())) {
queryModel.addCriteria(" and t.report_date >=:startDate");
queryModel.putParam("startDate", queryRequest.getStartDate());
}
if (queryRequest.getEndDate() != null&&!"".equals(queryRequest.getEndDate())) {
queryModel.addCriteria(" and t.report_date <=:endDate");
queryModel.putParam("endDate", queryRequest.getEndDate());
}
if (queryRequest.getCheckOperatorName() != null) {
queryModel.addCriteria(" and t.check_operator_name =:checkOperatorName");
queryModel.putParam("checkOperatorName", queryRequest.getCheckOperatorName());
}
if (queryRequest.getDutyDeptName() != null) {
queryModel.addCriteria(" and t.duty_dept_name =:getDutyDeptName");
queryModel.putParam("getDutyDeptName", queryRequest.getDutyDeptName());
}
queryModel.putDictionary("status", BizBillStatus.getMap()); queryModel.putDictionary("status", BizBillStatus.getMap());
return this.sqlExecutorDao.executeSlicedQuery(queryModel); return this.sqlExecutorDao.executeSlicedQuery(queryModel);
} }
...@@ -263,18 +235,7 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except ...@@ -263,18 +235,7 @@ public class ExceptionReportApplicationImpl extends FlowBroker implements Except
response.reset(); response.reset();
response.setHeader("Content-Type", "application/pdf-stream"); response.setHeader("Content-Type", "application/pdf-stream");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("异常单据.pdf", "UTF-8")); response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("异常单据.pdf", "UTF-8"));
/* String randoms=CommonUtil.createGUID().substring(0,10);
File fileDir=new File("bar");
if(!fileDir.exists()) {
fileDir.mkdirs();
}*/
/* File file = new File("bar-"+permit.getBillCode()+".png");
if(!file.exists()) {
String IMG_TYPE_PNG = "image/png";
data.put("barCode", CommonUtils.genBarCode128(permit.getBillCode(), IMG_TYPE_PNG, file));
} else {
data.put("barCode",file);
}*/
File fileb = new File("baoshen.png"); File fileb = new File("baoshen.png");
data.put("baoshen",fileb); data.put("baoshen",fileb);
Template template = freemarkerConfigurer.getConfiguration().getTemplate("exceptionReport.ftl"); Template template = freemarkerConfigurer.getConfiguration().getTemplate("exceptionReport.ftl");
......
...@@ -6,6 +6,7 @@ import lombok.Data; ...@@ -6,6 +6,7 @@ import lombok.Data;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Table; import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
...@@ -36,6 +37,15 @@ public class ExceptionReport extends FlowBillAbstractEntity { ...@@ -36,6 +37,15 @@ public class ExceptionReport extends FlowBillAbstractEntity {
@Column(name = "customer_name") @Column(name = "customer_name")
private String customerName; private String customerName;
@Column(name = "customer_no")
private String customerNo;
@Column(name = "werks")
private String werks;
@Column(name = "werks_name")
private String werksName;
/** /**
* 客户单号 * 客户单号
*/ */
...@@ -119,6 +129,14 @@ public class ExceptionReport extends FlowBillAbstractEntity { ...@@ -119,6 +129,14 @@ public class ExceptionReport extends FlowBillAbstractEntity {
@Column(name = "attbiz_id") @Column(name = "attbiz_id")
private String attbizId; private String attbizId;
@Column(name = "pay_money")
private BigDecimal payMoney;
@Column(name = "lose_money")
private BigDecimal loseMoney;
@Override @Override
protected String getCodeRuleId() { protected String getCodeRuleId() {
return "exceptionReport"; return "exceptionReport";
......
...@@ -12,6 +12,7 @@ import lombok.Data; ...@@ -12,6 +12,7 @@ import lombok.Data;
public class ExceptionReportQueryRequest extends QueryAbstractRequest { public class ExceptionReportQueryRequest extends QueryAbstractRequest {
private String exceptionReportId; private String exceptionReportId;
private String customerName; private String customerName;
private String customerNo;
private String customerOrderNo; private String customerOrderNo;
private String personMemberName; private String personMemberName;
private String deptName; private String deptName;
...@@ -20,4 +21,5 @@ public class ExceptionReportQueryRequest extends QueryAbstractRequest { ...@@ -20,4 +21,5 @@ public class ExceptionReportQueryRequest extends QueryAbstractRequest {
private String endDate; private String endDate;
private String checkOperatorName; private String checkOperatorName;
private String dutyDeptName; private String dutyDeptName;
private String billCode;
} }
...@@ -5,6 +5,15 @@ ...@@ -5,6 +5,15 @@
select t.* from sap_exception_report t select t.* from sap_exception_report t
</sql-query> </sql-query>
<condition column="bill_code" name="billCode" type="java.lang.String" symbol="like" alias="t"/> <condition column="bill_code" name="billCode" type="java.lang.String" symbol="like" alias="t"/>
<condition column="customer_name" name="customerName" type="java.lang.String" symbol="like" alias="t"/>
<condition column="status" name="status" type="java.lang.String" symbol="=" alias="t"/>
<condition column="customer_order_no" name="customerOrderNo" type="java.lang.String" symbol="like" alias="t"/>
<condition column="dept_name" name="deptName" type="java.lang.String" symbol="like" alias="t"/>
<condition column="person_member_name" name="personMemberName" type="java.lang.String" symbol="like" alias="t"/>
<condition column="check_operator_name" name="checkOperatorName" type="java.lang.String" symbol="like" alias="t"/>
<condition column="duty_dept_name" name="dutyDeptName" type="java.lang.String" symbol="like" alias="t"/>
<condition column="report_date" name="startDate" type="java.util.Date" symbol="&gt;=" alias="t"/>
<condition column="report_date" name="endDate" type="java.util.Date" symbol="&lt;=" alias="t"/>
</query> </query>
<query name="exceptionReportItems" label="品质异常报告明细" table="sap_exception_report_item"> <query name="exceptionReportItems" label="品质异常报告明细" table="sap_exception_report_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