Index: ssts-web/src/main/webapp/dx-disinfectsystem/js/deliveryPlanApplication/deliveryPlanApplication.js =================================================================== diff -u -r24628 -r24744 --- ssts-web/src/main/webapp/dx-disinfectsystem/js/deliveryPlanApplication/deliveryPlanApplication.js (.../deliveryPlanApplication.js) (revision 24628) +++ ssts-web/src/main/webapp/dx-disinfectsystem/js/deliveryPlanApplication/deliveryPlanApplication.js (.../deliveryPlanApplication.js) (revision 24744) @@ -1,6 +1,141 @@ -$(function(){ + var time="2018-08-05 12:30"; - $("#invoice-middle").collapse(); + //点击科室名后向弹出模态框的部分输入框赋值 + function deliverySave(indepartCode,indepart){ + departCode = indepartCode; + depart = indepart; + $("#deliveryDepartCodeHide").val(departCode); + $("#depart").val(indepart); + $("#sender").val("admin"); + $("#personInCharge").val("admin"); + var newArr = new Array(); + $.ajax({ + url:"/disinfectSystem/baseData/wareHouseController/getWareHouseData.mhtml", + type:"post", + contentType:"application/json", + data:[], + success:function(res){ + var dataArr = res.data; + for(var i=0;i"; + }, + } + ]; + $('#invoice').bootstrapTable("destroy"); + $('#invoice').bootstrapTable({ + striped: true, + cache: false, + pagination: false, + sortable: true, + sortOrder: "asc", + sidePagination: "client", + pageNumber:1, + pageSize: 15, + pageList: [10, 25, 50, 100], + search: false, + strictSearch: true, + showColumns: false, + showRefresh: false, + minimumCountColumns: 2, + clickToSelect: true, + height: 245, + uniqueId: "id", + cardView: false, + detailView: false, + removeByUniqueId:1, + columns: invoiceHeaderColumns, + data: invoiceData + }); + } + + function addInvoiceDelete(getBarcode){ + + var aidHide = JSON.parse($('#deliveryCode').val()); + var aidGet = getBarcode.replace("aid",""); + aidGet = parseInt(aidGet); + var fu = []; + for(var i=0; i= storageAmount){ + return; + } + } + if(goods.tousseFixedBarcode == true || (goods.diposable == '是')){ + if(notSendAmount < storageAmount){// 待发货数量小于库存 + count = notSendAmount; + }else{ + count = storageAmount; + } + } + // 固定条码每次增加的数量不能超过包定义的扫描数量 + if(goods.tousseFixedBarcode!=false){ + var remnantStorage = storageAmount - sendAmount; + count = Math.min(count,goods.scanAmount);// 单次增加数量不能超过每次扫描数量 + count = Math.min(count,remnantStorage);// 增加数量不能超过剩余库存 + if(count == 0){ + return; + } + } + //旧代码的参考与判断 end + if($('#deliveryCode').val()=='') + { + $('#invoice').bootstrapTable('append',invGoods2); + $('#deliveryCode').val(JSON.stringify(invGoods2)); + } + else + { + var bArrif = 0; + var bArr = JSON.parse($('#deliveryCode').val()) + bArr.push(invGoods2[0]); + $('#deliveryCode').val(JSON.stringify(bArr)); + var bar = JSON.parse( $("#deliveryCode").val() ); + invoiceTable(bar); + } + } + else{ + window.alert("没有该篮筐"); + } + }, + }) + } + }) + + // 解决谷歌下输入框不能输入的问题 + $.fn.modal.Constructor.prototype.enforceFocus = function () {}; + // 发货保存 + $("#deliveryRefer").click(function(){ + //条码不能为空 + if($("#deliveryCode").val()==null||$("#deliveryCode").val()==""||$("#deliveryCode").val()==[]){ + window.alert('条码不能为空'); + return 0; + } + var swn = $("#sourceWarehouseName").select2('data'); + var sA = (JSON.parse($("#deliveryCode").val())).length; + var addData = { + applyDate : null, + depart :$("#depart").val(), + sender :$("#sender").val(), + sourceWarehouseName :$("#sourceWarehouseName").val(), + orgUnitCoding : $("#deliveryDepartCodeHide").val(), + sendOutGoodsStoreData : $("#deliveryCode").val(), + sourceWarehouseId : swn[0].sourceWarehouseId, + sourceWarehouseName: swn[0].text + }; + if($("#depart").val()==""||$("#sender").val()==""||$("#sourceWarehouseName").val()=="") + { + window.alert('不能为空'); + } + else + { + $.ajax({ + url: "/disinfectSystem/invoice/invoiceController/saveInvoiceByDepartOrInvoicePlanId.mhtml", + type: "post", + dataType: "json", + data: addData , + contentType:"application/x-www-form-urlencoded", + success:function(result){ + if(result.success == false) + { + window.alert(result.message); + } + if(result.success==true) + { + window.alert(result.message); + $("#deliveryCode").val(""); + $("#sourceWarehouseName").select2("val", ""); + invoiceTable([]); + $("#myModal").modal('hide'); + } + }, + error:function(result){ + }, + }); + } + }) + + $(".select2").css("width","100%"); + //inputPrint end + //发货单物品关闭后的对模态框内数据以及隐藏域的清零 + + $('#myModal').on('hidden.bs.modal', function (){ + //关闭后清理模态框以及隐藏域里面的数据 + $("#sender").val(""); + $("#deliveryTime").val(""); + $("#deliveryGoods").val(""); + $("#deliveryCode").val(""); + invoiceTable([]); + }) + }); + \ No newline at end of file