From 2161d64f31d8c43d3a1aed16a11d79b635dc61d5 Mon Sep 17 00:00:00 2001 From: qiankunpingtai Date: Thu, 23 May 2019 15:29:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B4=A2=E5=8A=A1=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=A8=A1=E5=9D=97=E4=BF=9D=E5=AD=98=E6=97=B6js?= =?UTF-8?q?=E5=87=BA=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- erp_web/js/pages/financial/advance_in.js | 15 +++++++++------ erp_web/js/pages/financial/giro.js | 10 ++++------ erp_web/js/pages/financial/item_in.js | 10 ++++------ erp_web/js/pages/financial/item_out.js | 10 ++++------ erp_web/js/pages/financial/money_in.js | 10 ++++------ erp_web/js/pages/financial/money_out.js | 10 ++++------ 6 files changed, 29 insertions(+), 36 deletions(-) diff --git a/erp_web/js/pages/financial/advance_in.js b/erp_web/js/pages/financial/advance_in.js index 8dd24496..5fd73939 100644 --- a/erp_web/js/pages/financial/advance_in.js +++ b/erp_web/js/pages/financial/advance_in.js @@ -894,8 +894,10 @@ function CheckData() { return true; } function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { - append(); - removeit(); + if (editIndex != undefined) { + $('#accountData').datagrid('endEdit', editIndex); + editIndex = undefined; + } if (!CheckData()) return false; var inserted = $("#accountData").datagrid('getChanges', "inserted"); @@ -929,9 +931,6 @@ function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { $('#accountHeadDlg').dialog('close'); var opts = $("#tableData").datagrid('options'); showAccountHeadDetails(opts.pageNumber, opts.pageSize); - if (endEditing()) { - $('#accountData').datagrid('acceptChanges'); - } } else{ @@ -947,6 +946,10 @@ function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { $.messager.alert('提示',XmlHttpRequest.responseText,'error'); } }); - } + + + + + diff --git a/erp_web/js/pages/financial/giro.js b/erp_web/js/pages/financial/giro.js index c4db3a2d..a36e1e36 100644 --- a/erp_web/js/pages/financial/giro.js +++ b/erp_web/js/pages/financial/giro.js @@ -801,8 +801,10 @@ function CheckData() { return true; } function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { - append(); - removeit(); + if (editIndex != undefined) { + $('#accountData').datagrid('endEdit', editIndex); + editIndex = undefined; + } if (!CheckData()) return false; var inserted = $("#accountData").datagrid('getChanges', "inserted"); @@ -836,9 +838,6 @@ function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { $('#accountHeadDlg').dialog('close'); var opts = $("#tableData").datagrid('options'); showAccountHeadDetails(opts.pageNumber, opts.pageSize); - if (endEditing()) { - $('#accountData').datagrid('acceptChanges'); - } } else{ @@ -854,5 +853,4 @@ function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { $.messager.alert('提示',XmlHttpRequest.responseText,'error'); } }); - } \ No newline at end of file diff --git a/erp_web/js/pages/financial/item_in.js b/erp_web/js/pages/financial/item_in.js index e68bcafb..04abb162 100644 --- a/erp_web/js/pages/financial/item_in.js +++ b/erp_web/js/pages/financial/item_in.js @@ -817,8 +817,10 @@ function CheckData() { return true; } function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { - append(); - removeit(); + if (editIndex != undefined) { + $('#accountData').datagrid('endEdit', editIndex); + editIndex = undefined; + } if (!CheckData()) return false; var inserted = $("#accountData").datagrid('getChanges', "inserted"); @@ -852,9 +854,6 @@ function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { $('#accountHeadDlg').dialog('close'); var opts = $("#tableData").datagrid('options'); showAccountHeadDetails(opts.pageNumber, opts.pageSize); - if (endEditing()) { - $('#accountData').datagrid('acceptChanges'); - } } else{ @@ -870,5 +869,4 @@ function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { $.messager.alert('提示',XmlHttpRequest.responseText,'error'); } }); - } \ No newline at end of file diff --git a/erp_web/js/pages/financial/item_out.js b/erp_web/js/pages/financial/item_out.js index 57028e4c..5ba534dd 100644 --- a/erp_web/js/pages/financial/item_out.js +++ b/erp_web/js/pages/financial/item_out.js @@ -823,8 +823,10 @@ function CheckData() { return true; } function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { - append(); - removeit(); + if (editIndex != undefined) { + $('#accountData').datagrid('endEdit', editIndex); + editIndex = undefined; + } if (!CheckData()) return false; var inserted = $("#accountData").datagrid('getChanges', "inserted"); @@ -858,9 +860,6 @@ function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { $('#accountHeadDlg').dialog('close'); var opts = $("#tableData").datagrid('options'); showAccountHeadDetails(opts.pageNumber, opts.pageSize); - if (endEditing()) { - $('#accountData').datagrid('acceptChanges'); - } } else{ @@ -876,5 +875,4 @@ function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { $.messager.alert('提示',XmlHttpRequest.responseText,'error'); } }); - } \ No newline at end of file diff --git a/erp_web/js/pages/financial/money_in.js b/erp_web/js/pages/financial/money_in.js index 47f2c483..fa1f64b6 100644 --- a/erp_web/js/pages/financial/money_in.js +++ b/erp_web/js/pages/financial/money_in.js @@ -813,8 +813,10 @@ function CheckData() { return true; } function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { - append(); - removeit(); + if (editIndex != undefined) { + $('#accountData').datagrid('endEdit', editIndex); + editIndex = undefined; + } if (!CheckData()) return false; var inserted = $("#accountData").datagrid('getChanges', "inserted"); @@ -848,9 +850,6 @@ function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { $('#accountHeadDlg').dialog('close'); var opts = $("#tableData").datagrid('options'); showAccountHeadDetails(opts.pageNumber, opts.pageSize); - if (endEditing()) { - $('#accountData').datagrid('acceptChanges'); - } } else{ @@ -866,5 +865,4 @@ function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { $.messager.alert('提示',XmlHttpRequest.responseText,'error'); } }); - } \ No newline at end of file diff --git a/erp_web/js/pages/financial/money_out.js b/erp_web/js/pages/financial/money_out.js index 6b8eb843..d7dbdb43 100644 --- a/erp_web/js/pages/financial/money_out.js +++ b/erp_web/js/pages/financial/money_out.js @@ -835,8 +835,10 @@ function CheckData() { return true; } function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { - append(); - removeit(); + if (editIndex != undefined) { + $('#accountData').datagrid('endEdit', editIndex); + editIndex = undefined; + } if (!CheckData()) return false; var inserted = $("#accountData").datagrid('getChanges', "inserted"); @@ -870,9 +872,6 @@ function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { $('#accountHeadDlg').dialog('close'); var opts = $("#tableData").datagrid('options'); showAccountHeadDetails(opts.pageNumber, opts.pageSize); - if (endEditing()) { - $('#accountData').datagrid('acceptChanges'); - } } else{ @@ -888,5 +887,4 @@ function saveAccountHeadAndDetail(listType,ChangeAmount,TotalPrice,OrganId) { $.messager.alert('提示',XmlHttpRequest.responseText,'error'); } }); - } \ No newline at end of file