| | |
| | | window.I = { |
| | | id: $('#_id').val(), |
| | | bsNo: $('#_bsNo').val(), |
| | | printBtn: $('#printBtn') |
| | | printBtn: $('#printBtn'), |
| | | detailModal: $("#modal"), |
| | | addCarPersons: $("#addCarPersons") |
| | | } |
| | | |
| | | var ViewModel = function() { |
| | |
| | | self.totalJZ = ko.observable(0); |
| | | self.vehicleLoadweight = ko.observable(0); |
| | | self.overWeight = ko.observable(0); |
| | | self.remark = ko.observable(''); |
| | | self.isAdmin = ko.observable(typeof(parent.G) != 'undefined' ? parent.G.isAdmin : false); |
| | | self.del = function(item) { |
| | | delConfirm(item); |
| | | } |
| | | self.addRemark = function(item) { |
| | | I.detailModal.modal('show'); |
| | | } |
| | | } |
| | | |
| | |
| | | e.preventDefault(); |
| | | newTab(I.numberplates); |
| | | }); |
| | | $("#confirmBtn").click(function (e) { |
| | | e.preventDefault(); |
| | | saveRemark(); |
| | | }) |
| | | $("#clearSortBtn").click(function (e){ |
| | | e.preventDefault(); |
| | | I.detailModal.modal('hide'); |
| | | }) |
| | | I.addCarPersons.click(function (e) { |
| | | e.preventDefault(); |
| | | var item = {businessNo: I.bsNo,vehicleId: I.numberplates} |
| | | console.log("item",item); |
| | | parent.closableTab.addTab({ |
| | | 'id': "carPersons-" + item.businessNo + "-" + item.vehicleId, |
| | | 'name': '添加随行人员', |
| | | 'url': '/basic/carPersons.jsf?businessNo=' + item.businessNo + '&vehicleId=' + item.vehicleId, |
| | | 'closable': true |
| | | }); |
| | | |
| | | }) |
| | | getRemarkDetail(); |
| | | } |
| | | function saveRemark() { |
| | | $.post("/vehicle/saveRemark.htm", {numberplates: I.numberplates, bsNo: I.bsNo, remark: vm.remark()}, |
| | | function (data, textStatus, jqXHR) { |
| | | if(data.code == 0) { |
| | | parent.showErrmsg('保存成功!'); |
| | | }else { |
| | | swal({title:'',text:data.errmsg,type:'error',confirmButtonText:'确定'}); |
| | | } |
| | | }); |
| | | } |
| | | function getRemarkDetail() { |
| | | $.post("/vehicle/getDetail.htm", {numberplates: I.numberplates, bsNo: I.bsNo}, |
| | | function (data, textStatus, jqXHR) { |
| | | if(data.code == 0) { |
| | | if(data.item) vm.remark(data.item.remark); |
| | | }else { |
| | | swal({title:'',text:data.errmsg,type:'error',confirmButtonText:'确定'}); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function getVehicleDetails(bsNo) { |
| | |
| | | |
| | | function autoHeight() { |
| | | $('.page-content').css('min-height', $(parent.window).height() - 159); |
| | | $('.table-responsive').css('height', $(parent.window).height() - 159); |
| | | $('.table-responsive').css('height', $(parent.window).height() - 239); |
| | | } |
| | | |
| | | function delConfirm(item) { |