From 45d539e1c3ba8283dae0af83150be1eb41622880 Mon Sep 17 00:00:00 2001 From: qiankunpingtai Date: Tue, 21 May 2019 15:22:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=B0=83=E6=8B=A8=E5=87=BA?= =?UTF-8?q?=E5=BA=93=E5=88=97=E8=A1=A8=E4=BB=8E=E5=90=8E=E5=8F=B0=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=9C=80=E5=A4=A7id=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/pages/materials/allocation_out_list.js | 100 ------------------ 1 file changed, 100 deletions(-) diff --git a/erp_web/js/pages/materials/allocation_out_list.js b/erp_web/js/pages/materials/allocation_out_list.js index c04f794a..cf98c8a0 100644 --- a/erp_web/js/pages/materials/allocation_out_list.js +++ b/erp_web/js/pages/materials/allocation_out_list.js @@ -11,8 +11,6 @@ var personID = null; var ProjectSearch=null; var userBusinessList=null; var userdepot=null; -var depotHeadMaxId=null; //获取最大的Id -var accepId=null; //保存的主表id var url; var depotHeadID = 0; var preTotalPrice = 0; //前一次加载的金额 @@ -1603,49 +1601,6 @@ function bindEvent(){ updateDepotHeadAndDetail(url,infoStr,preTotalPrice); return; } - $.ajax({ - type:"post", - url: url, - dataType: "json", - async : false, - data: ({ - info:infoStr - }), - success: function (tipInfo) - { - if(tipInfo) - { - function closeDialog(){ - $('#depotHeadDlg').dialog('close'); - var opts = $("#tableData").datagrid('options'); - showDepotHeadDetails(opts.pageNumber,opts.pageSize); - } - //保存明细记录 - if(depotHeadID ==0) - { - getMaxId(); //查找最大的Id - accept(depotHeadMaxId,closeDialog); //新增 - } - else - { - accept(depotHeadID,closeDialog); //修改 - } - } - else - { - $.messager.show({ - title: '错误提示', - msg: '保存信息失败,请稍后重试!' - }); - } - }, - //此处添加错误处理 - error:function() - { - $.messager.alert('提示','保存信息异常,请稍后再试!','error'); - return; - } - }); } }); @@ -2328,62 +2283,7 @@ function CheckData(type) { } return true; } -//保存 -function accept(accepId,fun) { - var inserted = $("#materialData").datagrid('getChanges', "inserted"); - var deleted = $("#materialData").datagrid('getChanges', "deleted"); - var updated = $("#materialData").datagrid('getChanges', "updated"); - $.ajax({ - type: "post", - url: "/depotItem/saveDetials", - data: { - inserted: JSON.stringify(inserted), - deleted: JSON.stringify(deleted), - updated: JSON.stringify(updated), - headerId:accepId - }, - success: function (tipInfo) - { - if (tipInfo) { - $.messager.alert('提示','保存成功!','info'); - } - else { - $.messager.alert('提示', '保存失败!', 'error'); - } - fun && fun(); - }, - error: function (XmlHttpRequest, textStatus, errorThrown) - { - $.messager.alert('提示',XmlHttpRequest.responseText,'error'); - fun && fun(); - } - }); - if (endEditing()) { - $('#materialData').datagrid('acceptChanges'); - } -} -//获取MaxId -function getMaxId(){ - var depotHeadMax=null; - $.ajax({ - type:"get", - url: "/depotHead/getMaxId", - //设置为同步 - async:false, - dataType: "json", - success: function (res) { - if(res && res.code === 200) { - if(res.data) { - depotHeadMax = res.data.maxId; - } - } - } - }); - if(depotHeadMax !=null) { - depotHeadMaxId=depotHeadMax; - } -} /** * 新增单据主表及单据子表