From 837b7843401691146aa2856e3069444e2f4ffcce Mon Sep 17 00:00:00 2001 From: qiankunpingtai Date: Tue, 21 May 2019 15:27:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=85=B6=E5=AE=83=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 --- erp_web/js/pages/materials/other_out_list.js | 101 ------------------ .../erp/controller/DepotItemController.java | 25 ----- 2 files changed, 126 deletions(-) diff --git a/erp_web/js/pages/materials/other_out_list.js b/erp_web/js/pages/materials/other_out_list.js index c60fa244..a3352c8a 100644 --- a/erp_web/js/pages/materials/other_out_list.js +++ b/erp_web/js/pages/materials/other_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; //前一次加载的金额 @@ -1600,50 +1598,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; - } - }); } }); @@ -2325,62 +2279,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; - } -} /** * 新增单据主表及单据子表 diff --git a/src/main/java/com/jsh/erp/controller/DepotItemController.java b/src/main/java/com/jsh/erp/controller/DepotItemController.java index 3c573e32..01ec28f6 100644 --- a/src/main/java/com/jsh/erp/controller/DepotItemController.java +++ b/src/main/java/com/jsh/erp/controller/DepotItemController.java @@ -261,31 +261,6 @@ public class DepotItemController { return allNumber; } - /** - * 保存明细 - * @param inserted - * @param deleted - * @param updated - * @param headerId - * @param request - * @return - */ - @PostMapping(value = "/saveDetials") - public String saveDetials(@RequestParam("inserted") String inserted, - @RequestParam("deleted") String deleted, - @RequestParam("updated") String updated, - @RequestParam("headerId") Long headerId, - HttpServletRequest request) throws Exception{ - Map objectMap = new HashMap(); - try { - depotItemService.saveDetials(inserted,deleted,updated,headerId); - return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code); - } catch (DataAccessException e) { - e.printStackTrace(); - logger.error(">>>>>>>>>>>>>>>>>>>保存明细信息异常", e); - return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code); - } - } /** * 查询计量单位信息