Bläddra i källkod

计量期表头换行

laiguoran 4 år sedan
förälder
incheckning
8f0ee4cec7
1 ändrade filer med 20 tillägg och 0 borttagningar
  1. 20 0
      app/public/js/measure_stage.js

+ 20 - 0
app/public/js/measure_stage.js

@@ -212,3 +212,23 @@ function checkValidForm() {
     $('#hide-all').show();
     return true;
 }
+$(window).resize(checkTableWidth);
+function checkTableWidth() {
+    if($('table th').eq(2).outerWidth() < 107) {
+        $('table th').eq(2).html('本期<br>合同计量');
+        $('table th').eq(3).html('本期数量<br>变更计量');
+        $('table th').eq(4).html('本期<br>完成计量');
+        $('table th').eq(5).html('截止上期<br>完成计量');
+        $('table th').eq(6).html('截止本期<br>完成计量');
+    } else {
+        $('table th').eq(2).html('本期合同计量');
+        $('table th').eq(3).html('本期数量变更计量');
+        $('table th').eq(4).html('本期完成计量');
+        $('table th').eq(5).html('截止上期完成计量');
+        $('table th').eq(6).html('截止本期完成计量');
+    }
+}
+
+$(function () {
+    checkTableWidth();
+});