From db67639449287bcec461916a7dca6003ee5dd03c Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期五, 05 十二月 2025 16:27:18 +0800
Subject: [PATCH] 出入库详单及补单页面及逻辑

---
 fzzy-igdss-web/src/main/resources/static/inout/inout-weight.js |  775 ++++++++++++++++++++++++-----------------------------------
 1 files changed, 320 insertions(+), 455 deletions(-)

diff --git a/fzzy-igdss-web/src/main/resources/static/inout/inout-weight.js b/fzzy-igdss-web/src/main/resources/static/inout/inout-weight.js
index b91f605..77d367e 100644
--- a/fzzy-igdss-web/src/main/resources/static/inout/inout-weight.js
+++ b/fzzy-igdss-web/src/main/resources/static/inout/inout-weight.js
@@ -5,44 +5,16 @@
 var recordData = null;// 涓氬姟鏁版嵁淇℃伅
 var snapData;//绯荤粺鎶撴媿瀵硅薄淇℃伅
 var timerWeight;
-var paramIntelCard;//璁惧璇嗗埆缁撴灉
-var paramIdCard;//璁惧璇嗗埆缁撴灉
-var curCheckItems = null;// 褰撳墠鏁版嵁鐨勬鏌ラ」淇℃伅
-var step = 1;
+var curProgress = null;
 
 $(function () {
     layui.use(['layer', 'laydate', 'form', 'table', 'util'], function () {
-        var util = layui.util;
         layer = layui.layer;
         form = layui.form;
         table = layui.table;
         layui.laydate.render({
             elem: '#test1',
             theme: '#7b8e9f'
-        });
-        // 鍙充笅瑙掓坊鍔犲浐瀹氫俊鎭�
-        util.fixbar({
-            bar1: true,
-            css: {
-                right: 10,
-                bottom: 20
-            },
-            bgcolor: '#53adce',
-            click: function (type) {
-                if (type === 'bar1') {
-                    layer.closeAll();
-                    layer.open({
-                        type: 2,
-                        title: false,
-                        shadeClose: true,
-                        shade: 0.3,
-                        closeBtn: 2,
-                        offset: ['50px', '120px'],
-                        area: ['1000px', '640px'],
-                        content: '../../basic/inout/inout-progress?type=' + type + "&t=" + Math.random()
-                    });
-                }
-            }
         });
 
         //鐩戝惉閫夋嫨鏁版嵁浜嬩欢
@@ -51,7 +23,8 @@
             if (obj.event === 'select') {
                 //娓呯┖琛ㄥ崟
                 resetForm();
-                flushData(data.intelCard, null);
+                flushData(data.id, null);
+                $("#listProgressData").css("display", "none");
                 layer.closeAll();
             }
         });
@@ -59,15 +32,12 @@
     });
 
     //鏄剧ず娴佺▼鐜妭
-    showProgress();
+    updateEditAndProgress();
 
     // 鐩戝惉閲嶉噺鍙樺寲
     $(".weight").blur(function () {
-        deAutoByIn(this.name);
+        deAuto(this.name);
     });
-
-    // 鍒濆鍖朩ebSocket
-    // initInoutWS(companyId, bizType, progress, userId);
 });
 
 window.onload = function () {
@@ -93,47 +63,41 @@
     });
 };
 
-// socket淇℃伅杩斿洖铏曠悊
-function socketOnMessage(packet) {
-    //鏆傛棤
-}
-
-//鐐瑰嚮绉伴噸
+/**
+ * 绉伴噸鍙婃姄鎷�
+ */
 function weight() {
-    // 娌℃湁涓氬姟鏁版嵁涓嶅彲鎵ц
-    if (!recordData) {
-        alertError("娌℃湁鏌ヨ鍒颁笟鍔℃暟鎹紝鎵ц琚嫆缁濓紒");
-        return;
-    }
     // 濡傛灉鏄┖杞︾О閲�
-    if (InoutProgress.WEIGHT_EMPTY == recordData.progress) {
+    if (InoutProgress.WEIGHT_EMPTY === curProgress) {
         form.val("form-data", {
             emptyWeight: weightDto.weight
         });
         form.render();
     }
     // 濡傛灉鏄弧杞︾О閲�
-    if (InoutProgress.WEIGHT_FULL == recordData.progress) {
+    if (InoutProgress.WEIGHT_FULL === curProgress) {
         form.val("form-data", {
             fullWeight: weightDto.weight
         });
         form.render();
     }
 
+    var data = form.val("form-data");
+    if (!data.plateNum) {
+        alertError("鎻愮ず锛氬~鍐欑櫥璁拌溅鐗屼俊鎭�");
+        return;
+    }
+
     // 鐐瑰嚮绉伴噸鑷姩璋冪敤鎶撴媿
     snapData = {
         companyId: companyId,
         deptId: deptId,
-        progress: recordData.progress,
+        progress: curProgress,
         bizType: type,
-        bizId: recordData.id,
-        plateNum: recordData.plateNum,
         id1: snapDto1.id,
         id2: snapDto2.id,
         id3: snapDto3.id,
-        id4: snapDto2.id,
-        sort: $("#scaleName").val(),
-        weight: weightDto.weight
+        sort: $("#scaleName").val()
     };
 
     //褰撳墠AJAX鏈嶅姟涓哄悓姝ユ湇鍔★紝杩斿洖鏁版嵁鍖呰鐓х墖淇℃伅
@@ -141,7 +105,7 @@
     $.ajax({
         sync: false,
         type: "POST",
-        url: "../../inout/api/snap-img",
+        url: "/inout/api/snap-img",
         dataType: "json",
         contentType: "application/json;charset=UTF-8",
         data: JSON.stringify(snapData),
@@ -150,6 +114,7 @@
             if (result.code != "0000") {
                 alertError(result.msg);
             } else {
+                layer.msg("鎶撴媿鎴愬姛");
                 snapData = result.data;
             }
         },
@@ -158,151 +123,119 @@
             alertError("鍚庡彴璋冪敤鎴浘澶辫触锛岃閲嶆柊灏濊瘯");
         }
     });
-    //濡傛灉鏄浜屾绉伴噸锛岄粯璁ゆ墽琛岃嚜鍔ㄨ绠�
-    if (InoutProgress.WEIGHT_EMPTY == recordData.progress) {
-        deAutoByIn("emptyWeight");
-    }
-}
-
-//璇绘櫤鎱у崱
-function flushICCard() {
-    if (!cardDto.protocol) {
-        flushICCard1();
-    } else {
-        flushICCard2();
-    }
 }
 
 /**
- * 鍗忚璇诲彇鏅烘収鍗�
+ * 绉伴噸鎻愪氦
  */
-function flushICCard2() {
+function submit() {
+
+    var data = form.val("form-data");
+    if (!data.depotId) {
+        alertError("鎻愮ず锛氳鍗镐粨搴撳繀濉�");
+        return;
+    }
+    if (!data.customerName) {
+        alertError("鎻愮ず锛氶�氱煡鍗曚俊鎭繀濉�");
+        return;
+    }
+    if (!data.foodVariety) {
+        alertError("鎻愮ず锛氱伯椋熷搧绉嶅繀濉�");
+        return;
+    }
+
+    // 鏍¢獙-鍏ュ簱婊¤溅绉伴噸
+    if (InoutProgress.WEIGHT_FULL === curProgress) {
+        if (data.fullWeight <= 0.0) {
+            alertError("鎻愮ず锛氭弧杞︾О閲嶄俊鎭繀濉�");
+            return;
+        }
+    }
+    if (InoutProgress.WEIGHT_EMPTY === curProgress) {
+        if (data.emptyWeight <= 0.0) {
+            alertError("鎻愮ず锛氱┖杞︾О閲嶄俊鎭繀濉�");
+            return;
+        }
+    }
+
+    if(recordData){
+        //鍚堝苟鏁版嵁
+        Object.assign(recordData, data);
+    }else {
+        recordData = data;
+    }
+    recordData.progress = curProgress;
+
+    // 鑾峰彇鐓х墖
+    var files = [{
+        fileName: snapData.fileName1
+    }, {
+        fileName: snapData.fileName2
+    }, {
+        fileName: snapData.fileName3
+    }];
+    recordData.files = files;
     var index = layer.load();
-    var param = JSON.stringify(cardDto);
     $.ajax({
         type: "POST",
-        url: "../../inout/api/get-icCard",
+        url: "/basic/inout/submit-weight",
         dataType: "json",
         contentType: "application/json;charset=UTF-8",
-        data: param,
+        data: JSON.stringify(recordData),
+        success: function (result) {
+            if (result.code != "0000") {
+                alertError(result.msg);
+            } else {
+                notify("鏁版嵁鎻愪氦鎴愬姛", result.data);
+                //绗竴娆$О閲嶅悗锛屽埛鏂伴〉闈�
+                if (recordData.recordWeight <= 0.0) {
+                    resetForm();
+                }
+            }
+            layer.close(index);
+        },
+        error: function () {
+            layer.close(index);
+            alertError("鎻愪氦澶辫触锛岃閲嶆柊灏濊瘯");
+        }
+    });
+}
+
+/**
+ * 鐐瑰嚮鎵撳嵃锛岀郴缁熷垽鏂槸鍚﹀凡缁忔墽琛屽畬鎴愶紝濡傛灉宸茬粡瀹屾垚锛岀洿鎺ユ墦鍗帮紝濡傛灉鏈畬鎴愬垯鍏堟墽琛屽畬鎴�
+ */
+function printBill() {
+    if (!recordData) {
+        alertError("娌℃湁鑾峰彇鍒颁笟鍔℃暟鎹紝鎵撳嵃琚嫆缁濓紒");
+        return;
+    }
+
+    var index = layer.load();
+    $.ajax({
+        type: "POST",
+        url: "/basic/print/bill-weight",
+        dataType: "json",
+        contentType: "application/json;charset=UTF-8",
+        data: JSON.stringify(recordData),
         success: function (result) {
             layer.close(index);
             if (result.code != "0000") {
                 alertError(result.msg);
             } else {
-                resultData = result.data;
-                paramIntelCard = resultData.icCardNo;
-                $("#text-param").text("璇嗗埆鍗″彿锛�" + paramIntelCard);
-                flushData(paramIntelCard, null);
+                layer.msg("寮�濮嬫覆鏌撴墦鍗板崟鈥︹��");
+                printWeight(result.data);
             }
         },
         error: function () {
             layer.close(index);
-            alertError("IC鍗¤鍙栧け璐�");
+            alertError("鑾峰彇鎵撳嵃妯$増澶辫触锛岃鑱旂郴绠$悊鍛樻煡鐪嬪師鍥�");
         }
     });
 }
 
 /**
- * 鏈湴璇诲彇鏅烘収鍗�
+ * 鍦扮鏁版嵁鍒锋柊
  */
-function flushICCard1() {
-    var index = layer.load();
-    $("#text-param").val(null);
-    $("#form-data")[0].reset();
-    form.render();
-    recordData = null;
-    $.ajax({
-        type: "GET",
-        async: true,
-        url: "http://127.0.0.1:9111/ICCARD",
-        data: {},
-        dataType: "json",
-        // jsonp: "callback",
-        // jsonpCallback: "jsonpCallback",
-        success: function (json) {
-            var data = json;
-            layer.close(index);
-            if (data.code === "200" || data.code == 200) {
-                paramIntelCard = data.no;
-                $("#text-param").text("璇嗗埆鍗″彿锛�" + paramIntelCard);
-                flushData(paramIntelCard, null);
-            } else {
-                alertError("璇烽噸鏂拌鍗★紒");
-            }
-        },
-        error: function () {
-            layer.close(index);
-            alertError("IC鍗¤鍙栧嚭閿欙紒");
-        }
-    });
-}
-
-// 浣跨敤鎻掍欢鑾峰彇韬唤璇�
-function flushIdCard() {
-    var index = layer.load();
-    $.ajax({
-        type: "GET",
-        async: true,
-        url: "http://127.0.0.1:9111/IDCARD",
-        data: {},
-        dataType: "json",
-        // jsonp: "callback",
-        // jsonpCallback: "jsonpCallback",
-        success: function (json) {
-            layer.close(index);
-            var data = json;
-            if (data.code === "200" || data.code == 200) {
-                paramIdCard = data.idNum;
-                $("#text-param").text("璇嗗埆韬唤璇侊細" + paramIdCard);
-                flushData(null, paramIdCard);
-            } else {
-                alertError("娌℃湁璇诲彇鍒拌韩浠借瘉淇℃伅锛�");
-                return;
-            }
-
-        },
-        error: function () {
-            alertError("娌℃湁璇诲彇鍒拌韩浠借瘉淇℃伅锛�");
-            layer.close(index);
-        }
-    });
-}
-
-function flushByHand() {
-    var intelCard = $("#intelCard").val();
-    flushData(intelCard, null);
-}
-
-/**
- * 鎵嬪姩閫夋嫨锛岃幏鍙栧緟绉伴噸鐨勬暟鎹紝寮瑰嚭閫夋嫨
- */
-function selectByHand() {
-    var param = {
-        deptId: deptId,
-        type: type,
-        timer: Math.random()
-    };
-    $.ajax({
-        type: "POST",
-        url: "../../basic/inout/list-only-progress",
-        dataType: "json",
-        contentType: "application/json;charset=UTF-8",
-        data: JSON.stringify(param),
-        success: function (result) {
-            if (result.code != "0000") {
-                layer.msg(result.msg);
-            } else {
-                renderTableProgressData(result.data);
-            }
-        },
-        error: function () {
-            layer.msg("绯荤粺鑾峰彇鏁版嵁鍑虹幇寮傚父锛岄噸鏂板皾璇�");
-        }
-    });
-}
-
-
 function flushWeight() {
     var ip = "127.0.0.1";
     if (weightDto.ip) {
@@ -339,46 +272,102 @@
     });
 }
 
-
-// 鐐瑰嚮鎵撳嵃锛岀郴缁熷垽鏂槸鍚﹀凡缁忔墽琛屽畬鎴愶紝濡傛灉宸茬粡瀹屾垚锛岀洿鎺ユ墦鍗帮紝濡傛灉鏈畬鎴愬垯鍏堟墽琛屽畬鎴�
-function printBill() {
-    if (!recordData) {
-        alertError("娌℃湁鑾峰彇鍒颁笟鍔℃暟鎹紝鎵撳嵃琚嫆缁濓紒");
-        return;
-    }
-    // 浠庡悗鍙拌幏鍙栨ā鐗堝苟鎵撳嵃
-    var data = form.val("form-data");
-    // 鍚堝苟鏇存柊鐣跺墠缂栬緫鏁版嵁
-    Object.assign(recordData, data);
-
+/**
+ * 璇诲彇韬唤璇�
+ */
+function flushIdCard() {
     var index = layer.load();
     $.ajax({
-        type: "POST",
-        url: "../../basic/inout/report/bill-weight",
+        type: "GET",
+        async: true,
+        url: "http://127.0.0.1:9111/IDCARD",
+        data: {},
         dataType: "json",
-        contentType: "application/json;charset=UTF-8",
-        data: JSON.stringify(recordData),
-        success: function (result) {
+        success: function (json) {
             layer.close(index);
-            if (result.code != "0000") {
-                alertError(result.msg);
+            var data = json;
+            if (data.code === "200" || data.code == 200) {
+                // 涓存椂璧嬪��
+                $("#userName").val(data.cnName);
+                $("#userAddress").val(data.address);
+                $("#userId").val(data.idNum);
             } else {
-                layer.msg("寮�濮嬫覆鏌撴墦鍗板崟鈥︹��");
-                printWeight(result.data);
+                alertError("娌℃湁鑾峰彇鍒拌韩浠借瘉淇℃伅锛�");
+                return;
             }
         },
         error: function () {
+            layer.alert("韬唤璇佽鍙栧け璐ワ紒", {
+                offset: ['300px', '300px']
+            });
             layer.close(index);
-            alertError("鑾峰彇鎵撳嵃妯$増澶辫触锛岃鑱旂郴绠$悊鍛樻煡鐪嬪師鍥�");
         }
     });
 }
 
-// 琛ㄥ崟娓呯┖
+/**
+ * 璇诲彇杞︾墝鍙�
+ */
+function flushPlateNum() {
+    var param = JSON.stringify(snapDto1);
+    var index = layer.load();
+    $.ajax({
+        type: "POST",
+        url: "/inout/api/get-plateNum",
+        dataType: "json",
+        contentType: "application/json;charset=UTF-8",
+        data: param,
+        success: function (result) {
+            if (result.code != "0000") {
+                alertError(result.msg);
+            } else {
+                $("#plateNum").val(result.data.plateNum);
+            }
+            layer.close(index);
+        },
+        error: function () {
+            layer.close(index);
+            alertError("杞︾墝璇嗗埆澶辫触锛�");
+        }
+    });
+}
+
+/**
+ * 鎵嬪姩閫夋嫨锛岃幏鍙栧緟绉伴噸鐨勬暟鎹紝寮瑰嚭閫夋嫨
+ */
+function selectByHand() {
+    var param = {
+        deptId: deptId,
+        type: type,
+        timer: Math.random()
+    };
+    $.ajax({
+        type: "POST",
+        url: "/basic/inout/list-weight-data",
+        dataType: "json",
+        contentType: "application/json;charset=UTF-8",
+        data: JSON.stringify(param),
+        success: function (result) {
+            if (result.code != "0000") {
+                layer.msg(result.msg);
+            } else {
+                renderTableProgressData(result.data);
+            }
+        },
+        error: function () {
+            layer.msg("绯荤粺鑾峰彇鏁版嵁鍑虹幇寮傚父锛岄噸鏂板皾璇�");
+        }
+    });
+}
+
+/**
+ * 琛ㄥ崟鏁版嵁閲嶇疆
+ */
 function resetForm() {
     $("#form-data")[0].reset();
     form.render();
     recordData = null;
+    curProgress = null;
     weightDto.weight = 0.0;
     $("#weightValue").text("0.0");
     $("#img_scale_statule").attr("src", "/img/web/inout/icon-red.png");
@@ -386,6 +375,9 @@
     $("#text-param").val(null);
 }
 
+/**
+ * 椤甸潰鍒锋柊
+ */
 function flushPage() {
     layer.confirm('纭畾瑕佸埛鏂伴〉闈㈠悧锛�', {icon: 3, title: '鎻愮ず'}, function (index) {
         resetForm();
@@ -393,31 +385,22 @@
     });
 }
 
-
-//鐩戝惉琛ㄥ崟閲岀殑鏁板�煎彉鍖�
-document.getElementById('intelCard').addEventListener('input', function (event) {
-    var intelCard = $("#intelCard").val();
-    if (intelCard.length == 10) {
-        flushData(intelCard, null);
-    }
-});
-
-// --鏌ヨ鏂规硶,鑾峰彇韬唤璇佸彿銆佸崱鍙枫�佽溅鐗屽彿锛岃繘琛屾煡璇�
-function flushData(intelCard, userIdCard) {
+/**
+ * 鏌ヨ鏁版嵁
+ * @param id
+ * @param plateNum
+ */
+function flushData(id, plateNum) {
     var index = layer.load();
-    var userIdCard = userIdCard;
-    var intelCard = intelCard;
-    var plateNum = $("#plateNum").val();
     var param = {
         type: type,
-        progress: progress,
-        intelCard: intelCard,
-        userId: userIdCard,
+        progress: curProgress,
+        id: id,
         plateNum: plateNum
     };
     $.ajax({
         type: "POST",
-        url: "../../basic/inout/inout-query",
+        url: "/basic/inout/inout-query",
         dataType: "json",
         contentType: "application/json;charset=UTF-8",
         data: JSON.stringify(param),
@@ -427,6 +410,7 @@
                 notifyProgress(result.msg, result.data);
             } else {
                 recordData = result.data;
+                curProgress = recordData.progress;
                 // 杩斿洖鐨勬暟鎹繘琛岃祴鍊�
                 form.val("form-data", recordData);
                 form.render();
@@ -441,41 +425,109 @@
     });
 }
 
-
 /**
  * 鏍规嵁涓氬姟鏁版嵁鏇存柊椤甸潰涓殑鐘舵��
  */
 function updateEditAndProgress() {
-    if (recordData) {
-        if (InoutProgress.WEIGHT_EMPTY == recordData.progress) {
-            $("#emptyWeight").removeClass("rkbk-search-input");
-            $("#emptyWeight").attr("disabled", false);
-
-            $("#progress-hand").addClass("active");
-            $("#progress-emptyWeight").addClass("active");
-
-            $("#fullWeight").addClass("rkbk-search-input");
-            $("#fullWeight").attr("disabled", true);
+    //褰撳墠娴佺▼鑺傜偣
+    if (curProgress == null) {
+        if (type === "IN") {
+            curProgress = "WEIGHT_FULL";
         }
-        if (InoutProgress.WEIGHT_FULL == recordData.progress) {
+        if (type === "OUT") {
+            curProgress = "WEIGHT_EMPTY";
+        }
+    }
+    //鏄剧ず褰撳墠娴佺▼
+    if (type === "IN") {
+        $("#rk-progress-register").addClass("active");
+        if (curProgress === InoutProgress.WEIGHT_FULL) {
+            $("#rk-progress-fullWeight").addClass("active");
+            $("#rk-progress-hand").removeClass("active");
+            $("#rk-progress-emptyWeight").removeClass("active");
+
+            //婊¤溅閲嶉噺鍙紪杈�
             $("#fullWeight").removeClass("rkbk-search-input");
             $("#fullWeight").attr("disabled", false);
 
-            $("#progress-hand").removeClass("active");
-            $("#progress-emptyWeight").removeClass("active");
-
+            //绌鸿溅閲嶉噺涓嶈兘缂栬緫
             $("#emptyWeight").addClass("rkbk-search-input");
             $("#emptyWeight").attr("disabled", true);
         }
-    } else {
-        $("#fullWeight").addClass("rkbk-search-input");
-        $("#fullWeight").attr("disabled", true);
+        if (curProgress === InoutProgress.WEIGHT_EMPTY) {
+            $("#rk-progress-fullWeight").addClass("active");
+            $("#rk-progress-hand").addClass("active");
+            $("#rk-progress-emptyWeight").addClass("active");
 
-        $("#emptyWeight").addClass("rkbk-search-input");
-        $("#emptyWeight").attr("disabled", true);
+            //婊¤溅閲嶉噺涓嶈兘缂栬緫
+            $("#fullWeight").addClass("rkbk-search-input");
+            $("#fullWeight").attr("disabled", true);
 
-        $("#progress-hand").removeClass("active");
-        $("#progress-emptyWeight").removeClass("active");
+            //绌鸿溅閲嶉噺鍙紪杈�
+            $("#emptyWeight").removeClass("rkbk-search-input");
+            $("#emptyWeight").attr("disabled", false);
+        }
+    }
+    if (type === "OUT") {
+        $("#ck-progress-register").addClass("active");
+        if (curProgress === InoutProgress.WEIGHT_EMPTY) {
+            $("#ck-progress-emptyWeight").addClass("active");
+            $("#ck-progress-hand").removeClass("active");
+            $("#ck-progress-fullWeight").removeClass("active");
+
+            //婊¤溅閲嶉噺涓嶈兘缂栬緫
+            $("#fullWeight").addClass("rkbk-search-input");
+            $("#fullWeight").attr("disabled", true);
+
+            //绌鸿溅閲嶉噺鍙紪杈�
+            $("#emptyWeight").removeClass("rkbk-search-input");
+            $("#emptyWeight").attr("disabled", false);
+        }
+        if (curProgress === InoutProgress.WEIGHT_FULL) {
+            $("#ck-progress-emptyWeight").addClass("active");
+            $("#ck-progress-hand").addClass("active");
+            $("#ck-progress-fullWeight").addClass("active");
+
+            //婊¤溅閲嶉噺鍙紪杈�
+            $("#fullWeight").removeClass("rkbk-search-input");
+            $("#fullWeight").attr("disabled", false);
+
+            //绌鸿溅閲嶉噺涓嶈兘缂栬緫
+            $("#emptyWeight").addClass("rkbk-search-input");
+            $("#emptyWeight").attr("disabled", true);
+        }
+    }
+    //娴佺▼鏄剧ず
+    if (inoutProgress) {
+        if (inoutProgress.indexOf("REGISTER") === -1) {
+            $("#rk-progress-register").css("display", "none");
+            $("#ck-progress-register").css("display", "none");
+        }
+        if (inoutProgress.indexOf("WEIGHT_FULL") === -1) {
+            $("#rk-progress-fullWeight").css("display", "none");
+            $("#ck-progress-fullWeight").css("display", "none");
+        }
+        if (inoutProgress.indexOf("HANDLE") === -1) {
+            $("#rk-progress-hand").css("display", "none");
+            $("#ck-progress-hand").css("display", "none");
+        }
+        if (inoutProgress.indexOf("WEIGHT_EMPTY") === -1) {
+            $("#rk-progress-emptyWeight").css("display", "none");
+            $("#ck-progress-emptyWeight").css("display", "none");
+        }
+        if (inoutProgress.indexOf("CARD_BACK") === -1) {
+            $("#rk-progress-cardBack").css("display", "none");
+            $("#ck-progress-cardBack").css("display", "none");
+        }
+
+        if (type === "IN") {
+            $("#rk_progress").css("display", "block");
+            $("#ck_progress").css("display", "none");
+        }
+        if (type === "OUT") {
+            $("#ck_progress").css("display", "block");
+            $("#rk_progress").css("display", "none");
+        }
     }
     //鏍规嵁閰嶇疆淇℃伅璁剧疆鍦扮鏄惁鍙紪杈�
     if (weightEditTag && weightEditTag == 'N') {
@@ -485,138 +537,6 @@
         $("#emptyWeight").addClass("rkbk-search-input");
         $("#emptyWeight").attr("disabled", true);
     }
-}
-
-// 褰撳墠瀹屾垚
-function submit() {
-    if (!recordData) {
-        alertError("娌℃湁涓氬姟鏁版嵁淇℃伅锛屾墽琛岃鎷掔粷");
-        return;
-    }
-    var data = form.val("form-data");
-
-    if (!data.depotId) {
-        alertError("鎻愮ず锛氳鍗镐粨搴撳繀濉�");
-        return;
-    }
-    if (!data.customerName) {
-        alertError("鎻愮ず锛氬鎴峰悕绉板繀濉�");
-        return;
-    }
-
-    // 鏍¢獙-鍏ュ簱婊¤溅绉伴噸
-    if (InoutProgress.WEIGHT_FULL == recordData.progress) {
-        if (data.fullWeight <= 0.0) {
-            alertError("鎻愮ず锛氭弧杞︾О閲嶄俊鎭繀濉�");
-            return;
-        }
-    }
-    if (InoutProgress.WEIGHT_EMPTY == recordData.progress) {
-        if (data.emptyWeight <= 0.0) {
-            alertError("鎻愮ず锛氱┖杞︾О閲嶄俊鎭繀濉�");
-            return;
-        }
-        if (!data.foodVariety) {
-            alertError("鎻愮ず锛氱伯椋熷搧绉嶅繀濉�");
-            return;
-        }
-
-        if (!data.settleWeight || data.settleWeight <= 0.0) {
-            alertError("缁撶畻閲嶉噺涓嶅悎瑙勶紝璇锋牳瀵�");
-            return;
-        }
-        if (!data.recordWeight || data.recordWeight <= 0.0) {
-            alertError("鍏ュ簱閲嶉噺涓嶅悎瑙勶紝璇锋牳瀵�");
-            return;
-        }
-    }
-    //鍚堝苟鏁版嵁
-    Object.assign(recordData, data);
-    // 鑾峰彇鐓х墖
-    var files = [{
-        fileName: snapData.fileName1
-    }, {
-        fileName: snapData.fileName2
-    }, {
-        fileName: snapData.fileName3
-    }, {
-        fileName: snapData.fileName4
-    }];
-    recordData.files = files;
-    var index = layer.load();
-    $.ajax({
-        type: "POST",
-        url: "../../basic/inout/submit-weight",
-        dataType: "json",
-        contentType: "application/json;charset=UTF-8",
-        data: JSON.stringify(recordData),
-        success: function (result) {
-            if (result.code != "0000") {
-                alertError(result.msg);
-            } else {
-                notify("鏁版嵁鎻愪氦鎴愬姛", result.data);
-                if (InoutProgress.WEIGHT_FULL == recordData.progress) {
-                    resetForm();
-                }
-            }
-            layer.close(index);
-        },
-        error: function () {
-            layer.close(index);
-            alertError("鎻愪氦澶辫触锛岃閲嶆柊灏濊瘯");
-        }
-    });
-}
-
-//鏄剧ず璐ㄦ淇℃伅
-function showCheck() {
-    if (!recordData) {
-        alertError("娌℃湁涓氬姟鏁版嵁淇℃伅锛屾墽琛岃鎷掔粷");
-        return;
-    }
-    // 鑾峰彇鍖栭獙椤逛俊鎭�
-    flushCheckItem();
-    layer.open({
-        type: 1,
-        title: "璐ㄦ璇︾粏",
-        offset: ['120px', '100px'],
-        area: ['1000px', '520px'],
-        shade: 0,
-        content: $('#checkDetail'),
-        btnAlign: 'c',
-        btn: ['鍙栨秷'],
-        yes: function () {
-            layer.closeAll();
-        },
-        closeBtn: 0
-    });
-}
-
-/**
- * 鍒锋柊鍖栭獙缁撴灉椤�
- */
-function flushCheckItem() {
-    curCheckItems = null;
-    $.ajax({
-        type: "POST",
-        url: "../../basic/inout/get-check-item",
-        dataType: "json",
-        contentType: "application/json;charset=UTF-8",
-        data: JSON.stringify(recordData),
-        success: function (result) {
-            if (result.code != "0000") {
-                layer.msg(result.msg);
-            } else {
-                curCheckItems = result.data;
-
-                // 椤甸潰娓叉煋妫�娴嬮」
-                renderTableCheckItem();
-            }
-        },
-        error: function () {
-            layer.msg("鍚庡彴寮傚父锛岃閲嶈瘯鎴栬�呰仈绯荤鐞嗗憳锛侊紒");
-        }
-    });
 }
 
 /**
@@ -655,104 +575,35 @@
 }
 
 /**
- * 娓叉煋琛ㄦ牸
+ * 杞﹁締閫夋嫨寮圭獥
+ * @param list
  */
-function renderTableCheckItem() {
-    // 娓呯┖鏁版嵁
-    $("#tableCheckItem").empty();
-    table.render({
-        elem: '#tableCheckItem',
-        data: curCheckItems,
-        page: false,
-        even: true,
-        cols: [[{
-            field: 'standardName',
-            title: '妫�楠岄」鐩�',
-            align: 'center',
-            width: '13%'
-        }, {
-            field: 'value',
-            title: '妫�楠屽��',
-            align: 'center',
-            width: '9%'
-        }, {
-            field: 'operaSymbolValue',
-            title: '鏍囧噯鍊�',
-            align: 'center',
-            width: '10%'
-        }, {
-            field: 'unit',
-            title: '鍗曚綅',
-            align: 'center',
-            width: '10%'
-        }, {
-            field: 'deNum',
-            title: '鎵i噸',
-            align: 'center',
-            width: '9%'
-        }, {
-            field: 'addNum',
-            title: '澧為噸',
-            align: 'center',
-            width: '9%'
-        }, {
-            field: 'dePrice',
-            title: '鎵d环',
-            align: 'center',
-            width: '9%'
-        }, {
-            field: 'addPrice',
-            title: '澧炰环',
-            align: 'center',
-            width: '9%'
-        }, {
-            field: 'result',
-            title: '妫�楠岀粨鏋�',
-            align: 'center',
-            width: '10%',
-            templet: function (item) {
-                if (item.result == null) {
-                    return "";
-                }
-                if (item.result == '0') {
-                    return "涓嶅悎鏍�";
-                }
-                if (item.result == '1') {
-                    return "鍚堟牸";
-                }
-            }
-        }, {
-            field: 'remarks',
-            title: '澶囨敞璇存槑',
-            align: 'center'
-        }]]
-    });
-
-    $("thead tr").css({
-        "border-bottom": "2px solid #53adce",
-        "background": "#eff4f6"
-    });
-}
-
 function renderTableProgressData(list) {
     // 娓呯┖鏁版嵁
     $("#tableListProgressData").empty();
     layer.open({
         type: 1,
-        title: "閫夋嫨娴佺▼涓溅杈�",
-        offset: ['120px', '100px'],
-        area: ['1000px', '520px'],
+        title: "閫夋嫨绉伴噸涓溅杈�",
+        offset: ['240px', '100px'],
+        area: ['1000px', '560px'],
+        cancel: function (index, layero) {
+            $("#listProgressData").css("display", "none");
+        },
         shade: 0,
+        scrollbar: 0,
         content: $('#listProgressData'),
         closeBtn: 1
     });
     table.render({
         elem: '#tableListProgressData',
         data: list,
-        page: true,
+        page: false,
         even: true,
         cols: [[
-            {type: 'numbers'}, {
+            {
+                type: 'numbers',
+                title: '搴忓彿'
+            }, {
                 field: 'id',
                 title: '鍗曟嵁鍙�',
                 align: 'center'
@@ -764,7 +615,21 @@
                 field: 'plateNum',
                 title: '杞︾墝鍙�',
                 align: 'center'
-            }, {fixed: 'right', title: '閫夋嫨鎿嶄綔', align: 'center', toolbar: '#barSelectProgress'}]]
+            }, {
+                field: 'progress',
+                title: '娴佺▼杩涘害',
+                align: 'center',
+                style: 'font-weight: bold',
+                templet: function (item) {
+                    return INOUT_PROGRESS_MSG(item.progress);
+                }
+            }, {
+                fixed: 'right',
+                title: '閫夋嫨鎿嶄綔',
+                align: 'center',
+                toolbar: '#barSelectProgress'
+            }
+        ]]
     });
     $("thead tr").css({
         "border-bottom": "2px solid #53adce",

--
Gitblit v1.9.3