From 63fbfddabe08e353ad75e495c2ac8dc5203da88c Mon Sep 17 00:00:00 2001
From: Administrator <hbal>
Date: 星期一, 17 四月 2023 17:13:32 +0800
Subject: [PATCH] 明晟、义瑞装车

---
 WebContent/basic/js/vehicleBindMaterials.js |   51 +++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 49 insertions(+), 2 deletions(-)

diff --git a/WebContent/basic/js/vehicleBindMaterials.js b/WebContent/basic/js/vehicleBindMaterials.js
index 050ef01..6597bb8 100644
--- a/WebContent/basic/js/vehicleBindMaterials.js
+++ b/WebContent/basic/js/vehicleBindMaterials.js
@@ -14,7 +14,9 @@
 window.I = {
     id: $('#_id').val(),
     bsNo: $('#_bsNo').val(),
-    printBtn: $('#printBtn') 
+    printBtn: $('#printBtn'),
+    detailModal:  $("#modal"),
+    addCarPersons: $("#addCarPersons")
 } 
 
 var ViewModel = function() {
@@ -24,9 +26,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 +51,47 @@
         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) {
@@ -120,7 +167,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) {

--
Gitblit v1.9.3