CZT
2023-09-04 fae4bd828a6b81b95f53e285fcb4749fbd80c7bf
igds-web/src/main/resources/static/admin/inout/in-weight.js
@@ -7,6 +7,8 @@
var timerWeight;
var paramIntelCard;//设备识别结果
var paramIdCard;//设备识别结果
var curCheckItems = null;// 当前数据的检查项信息
var step = 1;
$(function () {
    layui.use(['layer', 'laydate', 'form', 'table', 'util'], function () {
@@ -113,6 +115,7 @@
        deptId: deptId,
        progress: recordData.progress,
        bizType: bizType,
        bizId: recordData.id,
        plateNum: recordData.plateNum,
        id1: snapDto1.id,
        id2: snapDto2.id,
@@ -143,7 +146,6 @@
            alertError("后台调用截图失败,请重新尝试");
        }
    });
    //如果是第二次称重,默认执行自动计算
    if (InoutProgress.WEIGHT_EMPTY == recordData.progress) {
        deAutoByIn("emptyWeight");
@@ -324,6 +326,8 @@
    weightDto.weight = 0.0;
    $("#weightValue").text("0.0");
    $("#img_scale_statule").attr("src", "../../static/images/icon-red.png");
    $("#text-param").val(null);
}
function flushPage() {
@@ -473,7 +477,7 @@
        data: JSON.stringify(recordData),
        success: function (result) {
            if (result.code != "0000") {
                notify(result.msg, result.data);
                alertError(result.msg);
            } else {
                notify("数据提交成功", result.data);
            }
@@ -488,5 +492,169 @@
//显示质检信息
function showCheck() {
    alertError("调整");
    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("后台异常,请重试或者联系管理员!!");
        }
    });
}
/**
 * 弹出提醒框
 * @param msg 提醒信息
 * @param data 数据信息,可能为空
 */
function notify(msg, data) {
    if (data) {
        //赋值
        $("#resultMsg").text(msg);
        $("#resultUserName").text(data.userName);
        $("#resultPlateNum").text(data.plateNum);
        if ("IN" == data.type) {
            $("#resultType").text("入库-" + INOUT_PROGRESS_MSG(data.progress));
        } else {
            $("#resultType").text("出库-" + INOUT_PROGRESS_MSG(data.progress));
        }
        $("#resultIntelCard").text(data.intelCard);
        layer.open({
            type: 1,
            offset: ['150px', '200px'],
            area: '450px;',
            shade: 0.8,
            id: 'dialog_notify_info',
            btn: ['确定'],
            content: $('#dialog-from-notify'),
            yes: function (index) {
                layer.closeAll();
            }
        });
    } else {
        layer.alert(msg, {offset: ['300px', '300px']});
    }
}
/**
 * 渲染表格
 */
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: '扣重',
            align: 'center',
            width: '9%'
        }, {
            field: 'addNum',
            title: '增重',
            align: 'center',
            width: '9%'
        }, {
            field: 'dePrice',
            title: '扣价',
            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"
    });
}