From 4f3e63453523eb2ac7f3a35d32eaed9aec1eba51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Tue, 15 Oct 2019 12:04:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8D=95=E6=8D=AEjs=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- erp_web/js/pages/materials/in_out.js | 127 +++------------------------ 1 file changed, 14 insertions(+), 113 deletions(-) diff --git a/erp_web/js/pages/materials/in_out.js b/erp_web/js/pages/materials/in_out.js index 62e00570..76424c1f 100644 --- a/erp_web/js/pages/materials/in_out.js +++ b/erp_web/js/pages/materials/in_out.js @@ -24,7 +24,6 @@ var organUrl = ""; //组织数据接口地址 var amountNum = ""; //单据编号开头字符 var depotString = ""; //店铺id列表 - /**默认编号有意义吗,不如空着吧*/ var orgDefaultId=''; //单位默认编号 var orgDefaultList; //存储查询出来的会员列表 var accountList; //账户列表 @@ -180,9 +179,7 @@ } } }); - } - //初始化系统基础信息 function initSystemData_depot(){ $.ajax({ @@ -226,7 +223,6 @@ } }); } - //初始化供应商、客户、散户信息 function initSupplier(){ $('#OrganId').combobox({ @@ -283,7 +279,6 @@ } }); } - //初始化销售人员 function initSalesman(){ $('#Salesman').combobox({ @@ -293,7 +288,6 @@ multiple: true }); } - //初始化收入项目列表 function initOutItemList(){ $.ajax({ @@ -312,7 +306,6 @@ } }); } - //初始化商品属性 function initMProperty(){ $.ajax({ @@ -348,7 +341,6 @@ } }); } - //获取账户信息 function initSystemData_account(){ $.ajax({ @@ -379,7 +371,6 @@ } }); } - //防止表单提交重复 function initForm(){ $('#depotHeadFM').form({ @@ -388,7 +379,6 @@ } }); } - //初始化表格数据 function initTableData(){ if(pageType === "skip") { @@ -406,8 +396,7 @@ id:'addDepotHead', text:'增加', iconCls:'icon-add', - handler:function() - { + handler:function() { addDepotHead(); } }, @@ -415,8 +404,7 @@ id:'deleteDepotHead', text:'删除', iconCls:'icon-remove', - handler:function() - { + handler:function() { batDeleteDepotHead(); } } @@ -552,7 +540,6 @@ }); dgResize(); } - //查找库存的方法 function findStockNumById(depotId, mId, monthTime, body, input, ratio, type){ var thisRatio = 1; //比例 @@ -1109,7 +1096,6 @@ } }); } - //初始化表格数据-商品列表-查看状态 function initTableData_material_show(TotalPrice){ var isShowAnotherDepot = true; //显示对方仓库,true为隐藏,false为显示 @@ -1201,7 +1187,6 @@ } }); } - //分页信息处理 function ininPager(){ try { @@ -1223,7 +1208,6 @@ $.messager.alert('异常处理提示',"分页信息异常 : " + e.name + ": " + e.message,'error'); } } - //删除单据信息 function deleteDepotHead(depotHeadID, thisOrganId, totalPrice, status){ if(status == "1" || status == "2") { @@ -1234,7 +1218,6 @@ if (r) { $.ajax({ type:"post", - // url: "/depotHead/" + depotHeadID + "/delete", url: "/depotHead/deleteDepotHeadAndDetail", dataType: "json", data:{ @@ -1278,7 +1261,6 @@ } }); } - //订单转采购或销售 function skipDepotHead(index){ var res = $("#tableData").datagrid("getRows")[index]; @@ -1293,7 +1275,6 @@ } } } - //批量删除单据信息 function batDeleteDepotHead(){ var row = $('#tableData').datagrid('getChecked'); @@ -1341,7 +1322,6 @@ //批量删除 $.ajax({ type: "post", - // url: "/depotHead/batchDelete", url: "/depotHead/batchDeleteDepotHeadAndDetail", dataType: "json", async: false, @@ -1369,7 +1349,6 @@ }); } } - //批量审核|反审核 function setStatusFun(status) { var row = $('#tableData').datagrid('getChecked'); @@ -1421,7 +1400,6 @@ }); } } - //生成单据编号 function buildNumber() { $.ajax({ @@ -1440,7 +1418,6 @@ } }); } - //新增信息 function addDepotHead(){ $('#depotHeadFM').form('clear'); @@ -1524,7 +1501,6 @@ }); } } - //编辑信息 function editDepotHead(index, res){ if(!res) { @@ -1641,7 +1617,6 @@ url = '/depotHead/updateDepotHeadAndDetail?id=' + res.id; //更新接口 } } - //查看信息 function showDepotHead(index){ var res = $("#tableData").datagrid("getRows")[index]; @@ -1770,7 +1745,6 @@ } } } - //绑定操作事件 function bindEvent(){ showDepotHeadDetails(1,initPageSize); //初始化时自动查询 @@ -2398,10 +2372,7 @@ }); } - - /** - * 绑定供应商、客户事件 - */ + //绑定供应商、客户事件 function bindSupplierEvent() { if(listTitle === "采购入库列表" || listTitle === "其它入库列表" || listTitle === "采购订单列表" || listTitle === "零售出库列表"|| listTitle === "销售出库列表"|| listTitle === "销售订单列表"){ @@ -2493,7 +2464,7 @@ }); } } - + //查询单据列表信息 function showDepotHeadDetails(pageNo,pageSize){ var materialParam = $.trim($("#searchMaterial").val()); var beginTime = $.trim($("#searchBeginTime").val()); @@ -2536,7 +2507,6 @@ } }); } - //自动计算事件 function autoReckon() { //延时绑定事件 @@ -2557,7 +2527,6 @@ body.find("[field='TaxMoney']").find(input).val((UnitPrice*OperNumber*(taxRate/100)).toFixed(2)); //税额 body.find("[field='TaxLastMoney']").find(input).val((UnitPrice*OperNumber*(1+taxRate/100)).toFixed(2)); //价税合计 statisticsFun(body,UnitPrice,OperNumber,footer,taxRate); - }); //修改单价,自动计算金额和合计 body.find("[field='UnitPrice']").find(input).off("keyup").on("keyup",function(){ @@ -2570,64 +2539,6 @@ body.find("[field='TaxLastMoney']").find(input).val((UnitPrice*OperNumber*(1+taxRate/100)).toFixed(2)); //价税合计 statisticsFun(body,UnitPrice,OperNumber,footer,taxRate); }); - //点击单价,自动提示参考价格列表 - body.find("[field='UnitPrice']").find(input).off("click").on("click",function(){ - var self = this; - var mValue = body.find("[field='MaterialId'] .combo-value").attr("value"); //获取选中的商品id - if(!mValue) { - return; - } - else { - if(listTitle!="销售出库列表" && listTitle!="采购退货列表" && listTitle!="其它出库列表" && listTitle!="调拨出库列表") { - return; - } - $.ajax({ - url: "/material/findById", - type: "get", - dataType: "json", - data: { - id: mValue - 0 - }, - success: function(res){ - if(res && res.rows && res.rows[0]) { - var retailPrice = res.rows[0].RetailPrice; - var presetPriceOne = res.rows[0].PresetPriceOne; - var presetPriceTwo = res.rows[0].PresetPriceTwo; - //定义模版 - var temp = "