Administrator
2023-03-10 1c4e40639d73faae3ba87156e0e4478c50b8ee33
WebContent/basic/js/vehicleBindMaterials.js
@@ -14,7 +14,8 @@
window.I = {
    id: $('#_id').val(),
    bsNo: $('#_bsNo').val(),
    printBtn: $('#printBtn')
    printBtn: $('#printBtn'),
    detailModal:  $("#modal"),
var ViewModel = function() {
@@ -24,9 +25,13 @@
    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');
    }
}
@@ -45,6 +50,35 @@
        e.preventDefault();
        newTab(I.numberplates);
    });
    $("#confirmBtn").click(function (e) {
        e.preventDefault();
        saveRemark();
    })
    $("#clearSortBtn").click(function (e){
        e.preventDefault();
        I.detailModal.modal('hide');
    })
    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) {
@@ -120,7 +154,7 @@
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) {