jiazx0107@163.com
2023-05-31 607e62cd6ec91d53bac549299d986c23e5143d28
igds-web/src/main/resources/static/admin/inout/in-weight.js
@@ -5,6 +5,8 @@
var recordData = null;// 业务数据信息
var snapData;//系统抓拍对象信息
var timerWeight;
var textParam;//设备识别结果
var curProgress;//当前详细流程
$(function () {
    layui.use(['layer', 'laydate', 'form', 'table', 'util'], function () {
@@ -34,7 +36,7 @@
                        shadeClose: true,
                        shade: 0.3,
                        closeBtn: 2,
                        offset: ['50px','120px'],
                        offset: ['50px', '120px'],
                        area: ['1000px', '640px'],
                        content: '../../basic/inout/inout-progress?type=' + type + "&t=" + Math.random()
                    });
@@ -48,8 +50,7 @@
    // 监听重量变化
    $(".weight").blur(function () {
        var name = this.name;
        deAutoByIn(name);
        deAutoByIn(this.name);
    });
    // 初始化WebSocket
@@ -77,7 +78,6 @@
            updateWeight();
        });
    });
};
// socket信息返回處理
@@ -91,7 +91,6 @@
        $("#btn-submit").removeClass("layui-btn-disabled");
        $("#btn-submit").attr("disabled", false);
    }
    if ("btn-submit" == btnId) {
        $("#btn-submit").addClass("layui-btn-disabled");
        $("#btn-submit").attr("disabled", true);
@@ -104,8 +103,6 @@
            $("#btn-printBill").removeClass("layui-btn-disabled");
            $("#btn-printBill").attr("disabled", false);
            addDisabled();
        }
    }
    if ("btn-printBill" == btnId) {// 打印过磅单,说明业务完成
@@ -118,70 +115,15 @@
        $("#btn-printBill").addClass("layui-btn-disabled");
        $("#btn-printBill").attr("disabled", true);
        delDisabled();
        resetForm();
    }
}
//控制流程环节显示
function showProgress() {
    if (!inoutProgress) {
        return;
    }
    if (inoutProgress.indexOf("REGISTER") == -1) {
        $("#progress-register").css("display", "none");
    }
    if (inoutProgress.indexOf("CHECK") == -1) {
        $("#progress-check").css("display", "none");
    }
    if (inoutProgress.indexOf("WEIGHT_FULL") == -1) {
        $("#progress-fullWeight").css("display", "none");
    }
    if (inoutProgress.indexOf("HANDLE") == -1) {
        $("#progress-hand").css("display", "none");
    }
    if (inoutProgress.indexOf("WEIGHT_EMPTY") == -1) {
        $("#progress-emptyWeight").css("display", "none");
    }
    if (inoutProgress.indexOf("CARD_BACK") == -1) {
        $("#progress-cardBack").css("display", "none");
    }
}
//更改扣重信息框不可编辑
function addDisabled() {
    //杂质
    $("#impurity").attr("disabled", true);
    $("#deImpurity").attr("disabled", true);
    //水分
    $("#wet").attr("disabled", true);
    $("#deWet").attr("disabled", true);
    //值仓
    $("#deHandle").attr("disabled", true);
    //其他
    $("#deOther").attr("disabled", true);
}
//恢复扣重信息框编辑状态
function delDisabled() {
    //杂质
    $("#impurity").attr("disabled", false);
    $("#deImpurity").attr("disabled", false);
    //水分
    $("#wet").attr("disabled", false);
    $("#deWet").attr("disabled", false);
    //值仓
    $("#deHandle").attr("disabled", false);
    //其他
    $("#deOther").attr("disabled", false);
}
// 点击称重
//点击称重
function weight() {
    // 没有业务数据不可执行
    if (!recordData) {
        layer.alert("没有查询到业务数据,执行被拒绝!!");
        alertError("没有查询到业务数据,执行被拒绝!!");
        return;
    }
@@ -249,13 +191,7 @@
//新的读卡方式
function flushICCard() {
    if(cardDto && cardDto.protocol != "TCP_DEFAULT"){
        //协议获取
        flushICCard2();
    }else {
        //本地读取
        flushICCard1();
    }
    flushICCard1();
}
/**
@@ -299,7 +235,7 @@
 * 本地读取智慧卡
 */
function flushICCard1() {
    $("#intelCard").val(null);
    $("#text-param").val(null);
    $("#form-data")[0].reset();
    form.render();
    recordData = null;
@@ -312,18 +248,17 @@
        jsonp: "callback",
        jsonpCallback: "jsonpCallback",
        success: function (json) {
            //console.log(json);
            var data = json.no;
            //console.log(data);
            if (data === "not found") {
                layer.alert("请重新读卡!", {offset: ['300px', '300px']});
                alertError("请重新读卡!");
            } else {
                $("#intelCard").val(data);
                textParam = data;
                $("#text-param").text("识别卡号:" + textParam);
                flushData();
            }
        },
        error: function () {
            layer.alert("IC卡读取出错!", {offset: ['300px', '300px']});
            alertError("IC卡读取出错!");
        }
    });
}
@@ -661,7 +596,7 @@
            field: 'name',
            title: '通知单名称',
            width: '15%'
        },{
        }, {
            field: 'customerName',
            title: '送货单位'
        }, {
@@ -743,35 +678,36 @@
    });
}
function controlGate(targetStatus){
        if(gateDto){
            var data = {"companyId":companyId
                ,"deptId":deptId
                ,"bizType":type
                ,"confId":gateDto.id
                ,"targetStatus":targetStatus
                ,"sort":gateDto.sort
            };
            $.ajax({
                type: "POST",
                url: "../../basic/inout/gate-ctrl",
                dataType: "json",
                contentType: "application/json;charset=UTF-8",
                data: JSON.stringify(data),
                success: function (result) {
                    if (result.code != "0000") {
                        layer.msg("操作失败:"+result.msg);
                    } else {
                        layer.msg("操作成功");
                    }
                },
                error: function () {
                    layer.alert("操作失败,请重新尝试!!");
function controlGate(targetStatus) {
    if (gateDto) {
        var data = {
            "companyId": companyId
            , "deptId": deptId
            , "bizType": type
            , "confId": gateDto.id
            , "targetStatus": targetStatus
            , "sort": gateDto.sort
        };
        $.ajax({
            type: "POST",
            url: "../../basic/inout/gate-ctrl",
            dataType: "json",
            contentType: "application/json;charset=UTF-8",
            data: JSON.stringify(data),
            success: function (result) {
                if (result.code != "0000") {
                    layer.msg("操作失败:" + result.msg);
                } else {
                    layer.msg("操作成功");
                }
            });
        }else{
            layer.msg("没有获取到设备!");
        }
            },
            error: function () {
                layer.alert("操作失败,请重新尝试!!");
            }
        });
    } else {
        layer.msg("没有获取到设备!");
    }
}
//-------------------------道闸操作--------------------------//