Commit 99480eb7 authored by 刘学辉's avatar 刘学辉

采购信息记录编辑方式调整

parent 983e71b7
......@@ -11,11 +11,30 @@ function bindEvent() {
function initItemGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: function(){
UICtrl.addGridRow(itemGridManager,{
/* UICtrl.addGridRow(itemGridManager,{
datab: $("#fillinDate").val()
}); */
UICtrl.showAjaxDialog({
title: "添加采购信息记录",
url: web_app.name + '/sapPurchaseInfoRecord/addSapPurchaseInfoRecordDetail.load',
param: {
id: $('#id').val
},
width:1200,
height:860,
init: initShowDialog,
ok: doSaveDefine,
close: onDialogCloseHandler
});
},
deleteHandler: function (){
debugger
var row = DataUtil.getSelectedRow(itemGridManager);
for (var r=0;r<row.length;r++) {
if (itemGridManager.rows[u].id=="undefined") {
itemGridManager.deleteRow(itemGridManager.rows[u]);
}
}
var _grid = UICtrl.getGridManager('#maingrid');
DataUtil.delSelectedRows({
action: 'sapPurchaseInfoRecordItem/deleteSapPurchaseInfoRecordItem.ajax',
......@@ -46,20 +65,22 @@ function initItemGrid() {
//autoApplyNextEditor:false,
toolbar: toolbarOptions,
onBeforeEdit: function (editParma) {
if (Public.isNotBlank(editParma.record.matnr) && editParma.column.name=='matklName'){
/*if (Public.isNotBlank(editParma.record.matnr) && editParma.column.name=='matklName'){
return false;
}
if (Public.isNotBlank(editParma.record.matklName) && Public.isBlank(editParma.record.maktx) && editParma.column.name=='matnr'){
return false;
}
return true;
return true;*/
},onAfterEdit: function (editParma) {
if (editParma.column.name=='matnr' ){
/* if (editParma.column.name=='matnr' ){
editParma.record.meinsName=editParma.record.bprmeName;
editParma.record.meins=editParma.record.bprme;
}
}
} */
}, onDblClickRow: function (data, rowindex, rowobj) {
viewHandler(data);
},
}
);
UICtrl.setSearchAreaToggle(itemGridManager);
......@@ -71,11 +92,13 @@ function getGridColumns() {
// {display: "语言", name: "zyy", width: "80", align: "left", type: "string",
// editor: {required: false, type: "text"}
// },
{display: "采购信息记录号", name: "infnr", width: "100", align: "left", type: "string",
editor: {required: false, type: "text"}
{display: "id", name: "id", width: "100", align: "left", type: "string",hide:true},
{display: "采购信息记录号", name: "infnr", width: "100", align: "left", type: "string"
// ,editor: {required: false, type: "text"}
},
{display: "工厂", name: "werksName", width: "200", align: "left", type: "string",
editor: {
{display: "工厂", name: "werks", width: "10", align: "left", type: "string",hide:true},
{display: "工厂", name: "werksName", width: "200", align: "left", type: "string"
/* ,editor: {
required: true, type: "select",
data: {
type: 'system',
......@@ -88,10 +111,11 @@ function getGridColumns() {
NAME1: "werksName",
}
},
}
}*/
},
{display: "采购组织", name: "ekorgName", width: "200", align: "left", type: "string",
editor: {
{display: "采购组织", name: "ekorg", width: "10", align: "left", type: "string",hide:true},
{display: "采购组织", name: "ekorgName", width: "200", align: "left", type: "string"
/*,editor: {
required: true, type: "select",
data: {
type: 'system',
......@@ -107,10 +131,10 @@ function getGridColumns() {
EKOTX: "ekorgName",
}
},
}
} */
},
{display: "供应商", name: "lifnr", width: "200", align: "left", type: "string",
editor: {
{display: "供应商", name: "lifnr", width: "200", align: "left", type: "string"
/*,editor: {
required: true, type: "select",
data: {
type: 'suppliers',
......@@ -123,16 +147,16 @@ function getGridColumns() {
nameOrg1: "name1",
}
},
}
} */
},
{display: "名称1", name: "name1", width: "300", align: "left", type: "string",
editor: {required: false, type: "text"}
{display: "名称1", name: "name1", width: "300", align: "left", type: "string"
// ,editor: {required: false, type: "text"}
},
{display: "供应商物料编码", name: "idnlf", width: "200", align: "left", type: "string",
editor: {required: false, type: "text"}
{display: "供应商物料编码", name: "idnlf", width: "200", align: "left", type: "string"
// ,editor: {required: false, type: "text"}
},
{display: "物料编码", name: "matnr", width: "200", align: "left", type: "string",
editor: {
/*,editor: {
required: true, type: "select",
data: {
type: 'system',
......@@ -156,13 +180,14 @@ function getGridColumns() {
MSEHL: "bprmeName",
},
},
}
}*/
},
{display: "物料描述", name: "maktx", width: "200", align: "left", type: "string",
editor: {required: true, type: "text"}
//,editor: {required: true, type: "text"}
},
{display: "物料组", name: "matklName", width: "200", align: "left", type: "string",
editor: {
{display: "物料组编号", name: "matkl", width: "10", align: "left", type: "string",hide:true},
{display: "物料组", name: "matklName", width: "200", align: "left", type: "string"
/*,editor: {
required: true, type: "select",
data: {
type: 'system',
......@@ -177,10 +202,11 @@ function getGridColumns() {
WGBEZ: "matklName",
}
},
}
}*/
},
{display: "采购信息记录分类", name: "esokzTextView", width: "200", align: "left", type: "string",
editor: {
{display: "采购信息记录分类编号", name: "esokz", width: "20", align: "left", type: "string",hide:true},
{display: "采购信息记录分类", name: "esokzTextView", width: "200", align: "left", type: "string"
/* ,editor: {
type: 'dictionary',
data: {name: 'esokz'},
textField: 'esokzTextView',
......@@ -189,10 +215,11 @@ function getGridColumns() {
render: function (item) {
return item.esokzTextView;
}
},
},*/
},
{display: "采购组", name: "ekgrpName", width: "200", align: "left", type: "string",
editor: {
{display: "采购组编号", name: "ekgrp", width: "20", align: "left", type: "string",hide:true},
{display: "采购组", name: "ekgrpName", width: "200", align: "left", type: "string"
/*,editor: {
required: true, type: "select",
data: {
type: 'system',
......@@ -205,16 +232,17 @@ function getGridColumns() {
EKNAM: "ekgrpName"
}
},
}
}*/
},
// {display: "生产版本", name: "verid", width: "200", align: "left", type: "string",
// editor: {required: false, type: "text"}
// },
{display: "净价", name: "netpr", width: "100", align: "left", type: "string",
editor: {required: true,type: 'text', mask: '9999999.99'}
{display: "净价", name: "netpr", width: "100", align: "left", type: "string"
//,editor: {required: true,type: 'text', mask: '9999999.99'}
},
{display: "货币码", name: "waersTextView", width: "100", align: "left", type: "string",
editor: {
{display: "货币码编号", name: "waers", width: "20", align: "left", type: "string",hide:true},
{display: "货币码", name: "waersTextView", width: "100", align: "left", type: "string"
/*,editor: {
type: 'dictionary',
data: {name: 'waers'},
textField: 'waersTextView',
......@@ -223,13 +251,14 @@ function getGridColumns() {
render: function (item) {
return item.waersTextView;
}
},
},*/
},
{display: "价格单位", name: "peinh", width: "100", align: "left", type: "string",
editor: {required: false, type: "text"}
{display: "价格单位", name: "peinh", width: "100", align: "left", type: "string"
//,editor: {required: false, type: "text"}
},
{display: "订单价格单位(采购)", name: "bprmeName", width: "90", align: "left", type: "string",
editor: {
{display: "订单价格单位编号", name: "bprme", width: "20", align: "left", type: "string",hide:true},
{display: "订单价格单位(采购)", name: "bprmeName", width: "90", align: "left", type: "string"
/*,editor: {
required: false, type: "select",
data: {
type: 'system',
......@@ -243,21 +272,24 @@ function getGridColumns() {
MSEHL: "bprmeName",
}
},
}
}*/
},
{display: "标准采购订单数量", name: "norbm", width: "120", align: "left", type: "string",
editor: {type: 'text', mask: '9999999.99'}
{display: "标准采购订单数量", name: "norbm", width: "120", align: "left", type: "string"
//,editor: {type: 'text', mask: '9999999.99'}
},
{display: "基本计量单位", name: "meinsName", width: "100", align: "left", type: "string" },
{display: "基本计量单位", name: "meins", width: "40", align: "left", type: "string",hide:"true" },
{display: "单位转换分母", name: "umren", width: "100", align: "left", type: "string",
editor: {type: 'text', mask: '9999999.99'}
{display: "单位转换分母", name: "umren", width: "100", align: "left", type: "string"
// ,editor: {type: 'text', mask: '9999999.99'}
},
{display: "单位转换分子", name: "umrez", width: "100", align: "left", type: "string",
editor: {type: 'text', mask: '9999999.99'}
{display: "单位转换分子", name: "umrez", width: "100", align: "left", type: "string"
//,editor: {type: 'text', mask: '9999999.99'}
},
{display: "销售/购买税代码", name: "mwskzTextView", width: "100", align: "left", type: "string",
editor: {
{display: "销售/购买税代码", name: "mwskz", width: "40", align: "left", type: "string",hide:"true" },
{display: "销售/购买税代码", name: "mwskzTextView", width: "100", align: "left", type: "string"
/*,editor: {
type: 'dictionary',
data: {name: 'mwskz'},
textField: 'mwskzTextView',
......@@ -266,23 +298,23 @@ function getGridColumns() {
render: function (item) {
return item.mwskzTextView;
}
},
},*/
},
{display: "开始生效日期", name: "datab", width: "100", align: "left", type: "string",
editor: {type: 'date'},
{display: "开始生效日期", name: "datab", width: "100", align: "left", type: "string"
//,editor: {type: 'date'},
},
{display: "有效期至日期", name: "datbi", width: "100", align: "left", type: "string",
editor: {type: 'date'},
{display: "有效期至日期", name: "datbi", width: "100", align: "left", type: "string"
//,editor: {type: 'date'},
},
{display: "销售员", name: "verkf", width: "100", align: "left", type: "string",
editor: {required: false, type: "text"}
{display: "销售员", name: "verkf", width: "100", align: "left", type: "string"
//,editor: {required: false, type: "text"}
},
{display: "电话", name: "telf1", width: "100", align: "left", type: "string",
editor: {required: false, type: "text"}
{display: "电话", name: "telf1", width: "100", align: "left", type: "string"
//,editor: {required: false, type: "text"}
},
{display: "原产地国", name: "urzlaTextView", width: 150, minWidth: 60, type: "string", align: "center",
editor: {
{display: "原产地国代码", name: "urzla", width: "40", align: "left", type: "string",hide:"true"},
{display: "原产地国", name: "urzlaName", width: 150, minWidth: 60, type: "string", align: "center"
/*,editor: {
required: false, type: "select",
data: {
type: 'system',
......@@ -295,10 +327,11 @@ function getGridColumns() {
name:"urzlaTextView"
}
},
}
}*/
},
{display: "地区", name: "regioName", width: 150, minWidth: 60, type: "string", align: "center",
editor: {
{display: "地区", name: "regio", width: 10, minWidth: 60, type: "string", align: "center",hide:"true"},
{display: "地区", name: "regioName", width: 150, minWidth: 60, type: "string", align: "center"
/*,editor: {
required: false, type: "select",
data: {
type: 'system',
......@@ -317,10 +350,11 @@ function getGridColumns() {
BEZEI: "regioName",
}
},
}
}*/
},
{display: "删除标志", name: "loekzTextView", width: 150, minWidth: 60, type: "string", align: "center",
editor: {
{display: "删除标志", name: "loekz", width: "40", align: "left", type: "string",hide:"true" },
{display: "删除标志", name: "loekzTextView", width: 150, minWidth: 60, type: "string", align: "center"
/* ,editor: {
type: 'dictionary',
data: {name: 'loekz'},
textField: 'loekzTextView',
......@@ -329,23 +363,24 @@ function getGridColumns() {
render: function (item) {
return item.loekzTextView;
}
},
},*/
},
{display: "排序字段", name: "sortl", width: 150, minWidth: 60, type: "string", align: "center",
editor: {required: false, type: "text"}
{display: "排序字段", name: "sortl", width: 150, minWidth: 60, type: "string", align: "center"
//,editor: {required: false, type: "text"}
},
{display: "最小采购订单数量", name: "minbm", width: "120", align: "left", type: "string",
editor: { required: true,type: 'text', mask: '9999999.99'}
{display: "最小采购订单数量", name: "minbm", width: "120", align: "left", type: "string"
//,editor: { required: true,type: 'text', mask: '9999999.99'}
},
{display: "计划交货时间(天)", name: "aplfz", width: "150", align: "left", type: "string",
editor: {required: true,type: 'text', mask: '9999999.99'}
{display: "计划交货时间(天)", name: "aplfz", width: "150", align: "left", type: "string"
//,editor: {required: true,type: 'text', mask: '9999999.99'}
},
// {display: "业务标识", name: "zflag", width: 150, minWidth: 60, type: "string", align: "center",
// editor: {required: false, type: "text"}
// },
{display: '基于收货的发票验证', name: "webreTextView", width: "100", align: "left", type: "string",
editor: {
{display: "基于收货的发票验证", name: "webre", width: "40", align: "left", type: "string",hide:"true" },
{display: '基于收货的发票验证', name: "webreTextView", width: "100", align: "left", type: "string"
/*,editor: {
type: 'dictionary',
data: {name: 'webre'},
textField: 'webreTextView',
......@@ -354,7 +389,7 @@ function getGridColumns() {
render: function (item) {
return item.webreTextView;
}
},
},*/
},
// {display: "条件类型", name: "kschl", width: "100", align: "left", type: "string",
// editor: {type: 'text', required: false}
......@@ -371,8 +406,9 @@ function getGridColumns() {
// {display: "订单价格单位转换为订单单位的分子", name: "bpumz", width: "100", align: "left", type: "string",
// editor: {type: 'text', mask: '9999999.99'}
// },
{display: "等级类型", name: "stfkz", width: "40", align: "left", type: "string",hide:"true" },
{display: "等级类型", name:"stfkzTextView", width: "200", align: "left", type: "string",
editor: {
/*, editor: {
type: 'dictionary',
data: {name: 'stfkz'},
textField: 'stfkzTextView',
......@@ -381,35 +417,35 @@ function getGridColumns() {
render: function (item) {
return item.stfkzTextView;
}
},
},*/
},
{display: "条件等级计量单位", name: "konms", width: "100", align: "left", type: "string",
{display: "条件等级计量单位", name: "konms", width: "100", align: "left", type: "string"
//editor: {type: 'text'},
render: function (item){
/* ,render: function (item){
if (Public.isNotBlank(item.bprme)){
return item.konms = item.bprme
}else {
return item.konms = item.meins
}
}
}*/
},
{display: "等级数量1", name: "kstbm", width: "100", align: "left", type: "string",
editor: {type: 'text', mask: '9999999.99'}
{display: "等级数量1", name: "kstbm", width: "100", align: "left", type: "string"
//,editor: {type: 'text', mask: '9999999.99'}
},
{display: "等级金额1", name: "kbetr", width: "100", align: "left", type: "string",
editor: {type: 'text', mask: '9999999.99'}
{display: "等级金额1", name: "kbetr", width: "100", align: "left", type: "string"
//,editor: {type: 'text', mask: '9999999.99'}
},
{display: "等级数量2", name: "kstbm2", width: "100", align: "left", type: "string",
editor: {type: 'text', mask: '9999999.99'}
{display: "等级数量2", name: "kstbm2", width: "100", align: "left", type: "string"
//,editor: {type: 'text', mask: '9999999.99'}
},
{display: "等级金额2", name: "kbetr2", width: "100", align: "left", type: "string",
editor: {type: 'text', mask: '9999999.99'}
{display: "等级金额2", name: "kbetr2", width: "100", align: "left", type: "string"
//,editor: {type: 'text', mask: '9999999.99'}
},
{display: "等级数量3", name: "kstbm3", width: "100", align: "left", type: "string",
editor: {type: 'text', mask: '9999999.99'}
{display: "等级数量3", name: "kstbm3", width: "100", align: "left", type: "string"
//,editor: {type: 'text', mask: '9999999.99'}
},
{display: "等级金额3", name: "kbetr3", width: "100", align: "left", type: "string",
editor: {type: 'text', mask: '9999999.99'}
{display: "等级金额3", name: "kbetr3", width: "100", align: "left", type: "string"
//,editor: {type: 'text', mask: '9999999.99'}
},
// {
// display: "传输日期", name: "sendTime", width: "100", align: "left", type: "string",
......@@ -475,3 +511,212 @@ function getGridData(){
return datas;
}
function initShowDialog() {
// var mainFileTable = $('#compensateLibraryList').fileList();
// mainFileTable.find('table').css({
// borderTopWidth: 0
// });
}
function doSaveDefine() {
var _self = this;
// debugger
// alert( "id:==="+$("#id").val());
//var ss=_self.getParam("partner");
//var id = getId();
var returnResult=checkInput();
var row = itemGridManager.rows;
var rId="";
if (returnResult) {
if (row.length > 0) {
for (var u = 0; u < row.length; u++) {
rId = itemGridManager.rows[u].__id;
if ($("#rowId").val() == rId) {
itemGridManager.deleteRow(itemGridManager.rows[u]);
break;
}
}
}
UICtrl.addGridRow(itemGridManager, {
id: $("#id").val(),
infnr: $("#infnr").val(),
werks: $("#werks").val(),
werksName: $("#werksName").val(),
ekorg: $("#ekorg").val(),
ekorgName: $("#ekorgName").val(),
lifnr: $("#lifnr").val(),
name1: $("#name1").val(),
idnlf: $("#idnlf").val(),
matnr: $("#matnr").val(),
maktx: $("#maktx").val(),
matkl: $("#matkl").val(),
matklName: $("#matklName").val(),
esokz: $("#esokz").val(),
esokzTextView: $("#esokz").find("option:selected").text(),
ekgrp: $("#ekgrp").val(),
ekgrpName: $("#ekgrpName").val(),
netpr: $("#netpr").val(),
waers: $("#waers").val(),
waersTextView: $("#waers").find("option:selected").text(),
peinh: $("#peinh").val(),
bprme: $("#bprme").val(),
bprmeName: $("#bprmeName").val(),
norbm: $("#norbm").val(),
meins: $("#meins").val(),
meinsName: $("#meinsName").val(),
umren: $("#umren").val(),
umrez: $("#umrez").val(),
mwskz: $("#mwskz").val(),
mwskzTextView: $("#mwskz").find("option:selected").text(),
datab: $("#datab").val(),
datbi: $("#datbi").val(),
verkf: $("#verkf").val(),
telf1: $("#telf1").val(),
urzlaName: $("#urzlaName").val(),
urzla: $("#urzla").val(),
regioName: $("#regioName").val(),
regio: $("#regio").val(),
loekz: $("#loekz").val(),
loekzTextView: $("#loekz").find("option:selected").text(),
sortl: $("#sortl").val(),
minbm: $("#minbm").val(),
aplfz: $("#aplfz").val(),
webre: $("#webre").val(),
webreTextView: $("#webre").find("option:selected").text(),
stfkz: $("#stfkz").val(),
stfkzTextView: $("#stfkz").find("option:selected").text(),
konms: $("#konms").val(),
kstbm: $("#kstbm").val(),
kbetr: $("#kbetr").val(),
kstbm2: $("#kstbm2").val(),
kbetr2: $("#kbetr2").val(),
kstbm3: $("#kstbm3").val(),
kbetr3: $("#kbetr3").val(),
});
this.close();
}
// var obj=$("#infoRecord[name='nameOrg1']");
// var url = "/sapPurchaseInfoRecord/saveSapPurchaseInfoRecordDetail.ajax";
//if (id && id.length > 0)
// url = "/enterpriseInfo/saveSapPurchaseInfoRecordDetail.ajax";
/* $('#infoRecord').ajaxSubmit({
url : web_app.name + (url),
success : function(id) {
//setId(id);
parent.reloadGrid();
//refreshFlag = true;
}
}); */
}
function checkInput() {
if ($("#werks").val()==""){
Public.errorTip("工厂必输!");
return false;
}
if ($("#ekorg").val()==""){
Public.errorTip("采购组织必输!");
return false;
}
if ($("#lifnr").val()==""){
Public.errorTip("供应商必输!");
return false;
}
if ($("#matnr").val()==""){
Public.errorTip("物料编码必输!");
return false;
}
if ($("#esokz").val()==""){
Public.errorTip("记录分类必输!");
return false;
}
if ($("#ekgrp").val()==""){
Public.errorTip("采购组必输!");
return false;
}
if ($("#netpr").val()==""){
Public.errorTip("净价必输!");
return false;
}
if ($("#waers").val()==""){
Public.errorTip("货币码必输!");
return false;
}
if ($("#mwskz").val()==""){
Public.errorTip("销售/购买税代码必输!");
return false;
}
if ($("#datab").val()==""){
Public.errorTip("生效日期起必输!");
return false;
}
if ($("#datbi").val()==""){
Public.errorTip("生效日期止必输!");
return false;
}
if ($("#minbm").val()==""){
Public.errorTip("最小采购订单数量必输!");
return false;
}
if ($("#aplfz").val()==""){
Public.errorTip("计划交货时间必输!");
return false;
}
if ($("#webre").val()==""){
Public.errorTip("基于收货的发票验证必输!");
return false;
}
if ($("#stfkz").val()==""){
Public.errorTip("等级类型必输!");
return false;
}
return true;
}
function viewHandler(data){
//alert($("#isReadOnly").val());
// alert(data.id+"------"+data.infnr+"=="+data.werks+data.werksName);
//debugger
var param = JSON.stringify(data);
var rowId=data.__id;
if ($("#isReadOnly").val()=="true") {
UICtrl.showAjaxDialog({
title: "添加采购信息记录",
url: web_app.name + '/sapPurchaseInfoRecord/addSapPurchaseInfoRecordDetail.load?id=' + data.id + '&rowId=' + rowId,
param: {
param
},
width: 1200,
height: 860,
init: initShowDialog,
ok:false,
close: onDialogCloseHandler
});
} else {
UICtrl.showAjaxDialog({
title: "添加采购信息记录",
url: web_app.name + '/sapPurchaseInfoRecord/addSapPurchaseInfoRecordDetail.load?id=' + data.id + '&rowId=' + rowId,
param: {
param
},
width: 1200,
height: 860,
init: initShowDialog,
ok: doSaveDefine,
close: onDialogCloseHandler
});
}
}
// 关闭对话框
function onDialogCloseHandler() {
//if (refreshFlag) {
parent.reloadGrid();
// refreshFlag = false;
// }
}
\ No newline at end of file
......@@ -4,7 +4,7 @@
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<x:base include="layout,dialog,grid,tree,dateTime,combox,attachment,commonTree,comboDialog"/>
<x:base include="layout,dialog,grid,tree,date,dateTime,combox,attachment,commonTree,comboDialog"/>
<x:script src="/biz/topsun/sap/purchaseInfoRecord/purchaseInfoRecordDetail.js"/>
</head>
<body>
......@@ -26,6 +26,7 @@
<x:hidden name="personMemberName"/>
<x:hidden name="statusId"/>
<x:hidden name="ids"/>
<x:hidden name="isReadOnly"/>
<div class="hg-form-cols">
<div class="hg-form-row">
</div>
......
......@@ -209,6 +209,7 @@ public class SapPurchaseInfoRecordApplicationImpl extends FlowBroker implements
queryModel.putDictionary("status", BizBillStatus.getMap());
queryModel.putDictionary("urzla", DictUtil.getDictionary("country"));
queryModel.putDictionary("loekz", DictUtil.getDictionary("loekz"));
queryModel.addCriteria(" order by fillin_date desc ");
return this.sqlExecutorDao.executeSlicedQuery(queryModel);
}
......
package com.huigou.topsun.sap.purchaseInfoRecord.controller;
import com.alibaba.fastjson.JSON;
import com.huigou.context.Operator;
import com.huigou.context.OrgUnit;
import com.huigou.topsun.sap.purchaseInfoRecord.application.SapPurchaseInfoRecordApplication;
import com.huigou.topsun.sap.purchaseInfoRecord.application.SapPurchaseInfoRecordItemApplication;
import com.huigou.topsun.sap.purchaseInfoRecord.domain.SapPurchaseInfoRecord;
import com.huigou.topsun.sap.purchaseInfoRecord.domain.SapPurchaseInfoRecordItem;
import com.huigou.topsun.sap.purchaseInfoRecord.domain.query.SapPurchaseInfoRecordQueryRequest;
import com.huigou.topsun.sap.purchaseInfoRecord.repository.SapPurchaseInfoRecordItemRepository;
import com.huigou.topsun.sap.suppliers.domain.SuppliersInfo;
import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.client.CommonController;
import com.huigou.util.SDO;
import com.huigou.util.StringUtil;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
......@@ -33,6 +39,8 @@ public class SapPurchaseInfoRecordController extends CommonController {
private SapPurchaseInfoRecordApplication sapPurchaseInfoRecordApplication;
@Autowired
private SapPurchaseInfoRecordItemApplication sapPurchaseInfoRecordItemApplication;
@Autowired
private SapPurchaseInfoRecordItemRepository sapPurchaseInfoRecordItemRepository;
public String forwardSapPurchaseInfoRecordList(){
return forward("purchaseInfoRecordList");
......@@ -59,10 +67,42 @@ public class SapPurchaseInfoRecordController extends CommonController {
return forward("purchaseInfoRecordDetail",sapPurchaseInfoRecord);
}
public String addSapPurchaseInfoRecordDetail() {
SDO sdo = this.getSDO();
String id = sdo.getId();
//String edit=sdo.getString("edit");
String rowId=sdo.getString("rowId");
SapPurchaseInfoRecordItem item = (SapPurchaseInfoRecordItem) com.alibaba.fastjson.JSONObject.parseObject(sdo.getString("param"), SapPurchaseInfoRecordItem.class);
if (StringUtil.isNotBlank(id)&&id.length()>30){ //编辑明细
// item=this.sapPurchaseInfoRecordItemRepository.findOne(id);
} else {
// item = (SapPurchaseInfoRecordItem) com.alibaba.fastjson.JSONObject.parseObject(sdo.getString("param"), SapPurchaseInfoRecordItem.class);
}
if (item!=null){
item.setRowId(rowId);
if (id.equals(rowId)){
item.setId("");
} else {
item.setId(id);
}
}
// SapPurchaseInfoRecord sapPurchaseInfoRecord = sapPurchaseInfoRecordApplication.loadSapPurchaseInfoRecord(id);
return forward("addPurchaseInfoRecordDetail",item);
}
public String saveSapPurchaseInfoRecordDetail() {
SDO sdo = this.getSDO();
String id = sdo.getId();
//SapPurchaseInfoRecord sapPurchaseInfoRecord = sapPurchaseInfoRecordApplication.loadSapPurchaseInfoRecord(id);
return forward("addPurchaseInfoRecordDetail",sdo);
// return success();
}
public String showSapPurchaseInfoRecordDetail(){
SDO sdo = this.getSDO();
String id = sdo.getBizId();
SapPurchaseInfoRecord sapPurchaseInfoRecord = sapPurchaseInfoRecordApplication.loadSapPurchaseInfoRecord(id);
this.putAttribute("isReadOnly",sdo.getString("isReadOnly"));
return forward("purchaseInfoRecordDetail",sapPurchaseInfoRecord);
}
......
......@@ -41,7 +41,18 @@ public class SapPurchaseInfoRecordItemController extends CommonController {
public String deleteSapPurchaseInfoRecordItem(){
SDO sdo = this.getSDO();
List<String> ids = sdo.getIds();
sapPurchaseInfoRecordItemApplication.deleteByIds(ids);
for (String id:ids){
if (id.equals("undefined")){
ids.remove(id);
if (ids.size()==0){
break;
}
}
}
System.out.println("ids==="+ids);
if (ids!=null&&ids.size()>0) {
sapPurchaseInfoRecordItemApplication.deleteByIds(ids);
}
return success();
}
}
......@@ -2,6 +2,7 @@ package com.huigou.topsun.sap.purchaseInfoRecord.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.huigou.data.domain.model.AbstractEntity;
import com.topsunit.query.annotations.Dictionary;
import lombok.Data;
import javax.persistence.*;
......@@ -190,6 +191,10 @@ public class SapPurchaseInfoRecordItem extends AbstractEntity {
*/
@Column(name = "URZLA")
private String urzla;
@Column(name = "URZLA_NAME")
private String urzlaName;
/**
* 地区
*/
......@@ -324,5 +329,8 @@ public class SapPurchaseInfoRecordItem extends AbstractEntity {
@Column(name = "MESSAGE")
private String MESSAGE;
@Transient
private String rowId;
}
......@@ -3,7 +3,9 @@ package com.huigou.topsun.sap.qualityInfoRecord.controller;
import com.huigou.context.Operator;
import com.huigou.context.OrgUnit;
import com.huigou.topsun.sap.qualityInfoRecord.application.SapQualityInfoRecordApplication;
import com.huigou.topsun.sap.qualityInfoRecord.application.SapQualityInfoRecordItemApplication;
import com.huigou.topsun.sap.qualityInfoRecord.domain.SapQualityInfoRecord;
import com.huigou.topsun.sap.qualityInfoRecord.domain.SapQualityInfoRecordItem;
import com.huigou.topsun.sap.qualityInfoRecord.domain.query.SapQualityInfoRecordQueryRequest;
import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.bmp.common.BizBillStatus;
......@@ -13,6 +15,7 @@ import oracle.sql.NUMBER;
import org.springframework.stereotype.Controller;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
......@@ -30,6 +33,8 @@ public class SapQualityInfoRecordController extends CommonController {
@Resource
private SapQualityInfoRecordApplication sapQualityInfoRecordApplication;
@Resource
private SapQualityInfoRecordItemApplication sapQualityInfoRecordItemApplication;
public String forwardSapQualityInfoRecordList(){
return forward("qualityInfoRecordList");
......@@ -60,7 +65,8 @@ public class SapQualityInfoRecordController extends CommonController {
SDO sdo = this.getSDO();
String id = sdo.getBizId();
SapQualityInfoRecord sapQualityInfoRecord = sapQualityInfoRecordApplication.loadSapQualityInfoRecord(id);
return forward("qualityInfoRecordDetail", sapQualityInfoRecord);
List<SapQualityInfoRecordItem> list=sapQualityInfoRecordItemApplication.findBySapQualityInfoRecordId(id);
return forward("qualityInfoRecordDetail", list.get(0));
}
public String copyQualityInfoRecord(){
......
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