yantian yue
2023-10-17 487b2f2a353b89ab46cd9b784226b600b7b915b8
guns-vip-main/src/main/webapp/assets/modular/kb/formula/formulaView.js
@@ -7,6 +7,29 @@
    var form = layui.form;
    var element = layui.element;
    /**
     * 配方配置子信息管理
     */
    var FormulaChildInfo = {
        tableId: "formulaChildInfoTable"
    };
    $('#imgs').attr("src", "http://localhost:8081/img/9f2f070828381f30fdf1be0da9014c086f06f0ad.jpg");
    /**
     * 初始化表格的列
     */
    FormulaChildInfo.initColumn = function () {
        return [[
            {field: 'id', hide: true, title: 'id'},
            {type:"numbers" ,title:'工步',width:40},
            {field: 'operationSteps', sort: true, title: '操作内容'},
            {field: 'techRequirement', sort: true, title: '技术要求'},
            {field: 'operationType', sort: true, title: '类型'},
        ]];
    };
    initLineInfo();
    var ajax = new $ax(Feng.ctxPath + "/workOrder/list?state=3");
@@ -22,6 +45,37 @@
    $('#recipeCode').text(msg.recipeCode);
    var radioElement = $('#sex1');
    var queryData = {};
    queryData['formulaCode'] = msg.recipeCode;
    // 渲染表格
    table.render({
        elem: '#' + FormulaChildInfo.tableId,
        url: Feng.ctxPath + '/formulaChildInfo/list',
        page: false,
        // height: "full-158",
        height: 460,
        cellMinWidth: 100,
        where: queryData,
        cols: FormulaChildInfo.initColumn(),
        done: function (res, curr, count) {
            console.log(res);
            //得到当前页码
            console.log(curr);
            //得到数据总量
            console.log(count);
            // 根据条件判断加背景色
            $.each(res.data, function (index, item) {
                console.log(item)
                console.log(item.spareField1)
                if (item.spareField1 === "3") {
                    // 法1
                    $("#formulaChildInfoTable").next().find('tbody tr[data-index="' + index +
                        '"]').css("background-color", "#00ff66");
                }
            });
        }
    });
    function initLineInfo(){
        $.ajax({
            type: "POST",