/**
 * 供应商变更审批页面
 * supplierChange/modify_examine.ftl
 * SupplierModifyRestController
 */

let el = {
    supplierId: '#supplierId',
    changeVersionId: '#changeVersionId',
    type: '#type',

    tab: '#tab',

    supplierInfo: '#supplierInfo',

    supplierTb: '#tb-supplier',
    bankTb: '#tb-bank',
    productType: '#tb-product-type',
    contactsTb: '#tb-contacts',
    qualificationTb: '#tb-qualification',
    purOrgTb: '#tb-pur-org',
    competitorTb: '#tb-competitor',
    agentProductTb: '#tb-agent-product',
    customerProductTb: '#tb-customer-product',
    mainProductTb: '#tb-main-product',
    perStatisticsTb: '#tb-personnel-statistics',
    salesSituationTb: '#tb-sales-situation',
    shareholderTb: '#tb-shareholder',
    staffConstituteTb: '#tb-staff-constitute',

    signUpRemark: '#signUpRemark',
    changeAttachmentTb: '#changeAttachmentTb',
};

let gridUrl = {
    bankUrl: g.ctx + 'pc/supplier/supplierChange/rest/supplierBankVersionList',
    contactsUrl: g.ctx + 'pc/supplier/supplierChange/rest/supplierContactsVersionList',
    productTypeUrl: g.ctx + 'pc/supplier/supplierChange/rest/supplierPurchaseCategoryVersionList',
    qualificationUrl: g.ctx + 'pc/supplier/supplierChange/rest/supplierQualificationVersionList',
};

let selfData = {
    supplierId: null, changeVersionId: null, type: null,

    height: 0, width: gridwidth - 90,

    bankCountry: [],

    queryParam: {}
};


/**
 * 表格参数，在表格添加事件中，表单的name值、表单内容，根据参数渲染页面
 */
let param = {
    /**
     * 表格的id列，提取出公共逻辑，用来显示数据是否已经保存
     */
    idColumn: {
        field: 'type', title: '状态', width: '6%', align: 'left', formatter: function (value) {
            switch (value) {
                case 1:
                    return '<span style="color:blue;">新建</span>';
                case 2:
                    return '<span style="color:green;">编辑</span>';
                case 3:
                    return '<span style="color:red;">删除</span>';
                default:
                    return '初始';
            }
        }
    },
};

$(function () {
    selfData.supplierId = $(el.supplierId).val();
    selfData.changeVersionId = $(el.changeVersionId).val();
    selfData.type = $(el.type).val();
    let query = {
        changeVersionId: selfData.changeVersionId,
    };
    query['supplierId'] = selfData.supplierId;
    //当类型为 0 的时候，表示审批，审批查看变更的数据。为 1 查看上版本的信息对比
    if (selfData.type === '0') {
        query.versionTypeList = [1, 2, 3];
    }
    initDict('payment_method,controlling_accounts,currency,supplier_role_type,payment_way,supplier_accetp_deadline')
    initNecessaryData("pc/sys/tax/rest/listAll")
    initNecessaryData("pc/sys/company/rest/listAll", 'companyCode', 'companyName')
    initNecessaryData("pc/sys/purchaseOrg/rest/listAll", 'purchaseOrgCode', 'purchaseOrgDesc')
    selfData.height = 370;

    loadGrid();
});

/**
 * 加载表格
 */
function loadGrid() {
    loadSupplierGird();
    loadBankGrid();
    loadContact();
    loadAttachment();
    loadProductTypeGrid();
    loadQualificationGrid();
}

/**
 * 渲染表格中的type，类型字段
 * @param value 1.新增 2.编辑 3.删除 default:初始
 */
function formatterType(value) {
    switch (value) {
        case 1:
            return '<span style="color:mediumvioletred;">新增</span>';
        case 2:
            return '<span style="color:royalblue;">编辑</span>';
        case 3:
            return '<span style="color:orangered;">删除</span>';
        default:
            return '初始';
    }
}

/**
 * 根据 type，判断字段如何显示
 * @param value formatter参数 字段值
 * @param row formatter参数 行
 * @return 新的字段值
 *
 *  type 1:新增  2:编辑  3:删除
 */
function formatterShowByType(value, row) {
    switch (row.type) {
        case 1:
            return '<span style="color:mediumvioletred;">' + value + '</span>';
        case 2:
            return '<span style="color:royalblue;">' + value + '</span>';
        case 3:
            return value;
        default:
            return value;
    }
}

/**
 *  根据type状态，显示背景颜色
 * @param value
 * @param row
 */
function backgroundShowByType(value, row) {
    switch (row.type) {
        case 1:
            return 'background-color : lightskyblue';
        case 2:
            return 'background-color : greenyellow';
        case 3:
            return 'background-color : darkgrey';
        default:
    }
}

//以下是表格渲染方法
/**
 * 加载 - 供应商变更表【基础字段】
 */
function loadSupplierGird() {
    $(el.supplierTb).datagrid({
        title: supplieri18n.gysjczd,
        iconCls: 'icon-list',
        height: selfData.height,
        width: selfData.width,
        method: "GET",
        url: g.ctx + 'pc/supplier/supplierChange/rest/supplierVersionList',
        idField: 'id',
        loadMsg: itablei8n.dataLoading,
        rownumbers: true,
        singleSelect: true,
        fitColumns: true,
        nowrap: true,
        remoteSort: true,
        striped: true,
        pagination: false,
        queryParams: {
            changeVersionId: selfData.changeVersionId
        },
        columns: [[{
            field: 'fieldText', title: '字段名称', width: '15%', align: 'left'
        }, {
            field: 'original', title: '字段(变更前)', width: '20%', align: 'left', formatter: function (value, row) {
                if (row.originalText) {
                    return row.originalText;
                } else {
                    return value;
                }
            }
        }, {
            field: 'value', title: '字段(变更后)', width: '20%', align: 'left', formatter: function (value, row) {
                if (row.valueText) {
                    return row.valueText;
                } else {
                    return value;
                }
            }
        }]],
        onLoadSuccess: function (data) {
            //没有数据隐藏表格
            if (!data.total) {
                $(el.supplierTb).parents('.table-version').hide();
            }
        }
    });
}

/**
 * 加载 - 供应商银行
 */
function loadBankGrid() {
    $(el.bankTb).datagrid({
        title: supplieri18n.gysyh,
        iconCls: 'icon-list',
        height: selfData.height,
        method: "GET",
        pagination: false,
        url: gridUrl.bankUrl,
        idField: 'id',
        loadMsg: itablei8n.dataLoading,
        rownumbers: true,
        singleSelect: true,
        fitColumns: true,
        nowrap: true,
        remoteSort: true,
        striped: true,
        queryParams: {
            changeVersionId: selfData.changeVersionId
        },
        columns: [[{
            field: 'type', title: '状态', width: '5%', align: 'left', formatter: function (value) {
                return formatterType(value);
            }, styler: function (value, row) {
                return backgroundShowByType(value, row);
            }
        }, {
            field: 'companyCodeOld',
            title: '公司代码(旧)',
            width: '13%',
            align: 'left',
            formatter: function (value, row) {
                return getNecessaryDataName("pc/sys/company/rest/listAll", value)
            },
            styler: function (value, row) {
                if (row.type == 3) {
                    return backgroundShowByType(value, row);

                }
            }
        }, {
            field: 'companyCode', title: '公司代码', width: '13%', align: 'left', formatter: function (value, row) {
                return getNecessaryDataName("pc/sys/company/rest/listAll", value)
            }
        },
            {
                field: 'companyNameOld',
                title: '收款单位（旧）',
                width: '13%',
                align: 'left',
                styler: function (value, row) {
                    if (row.type == 3) {
                        return backgroundShowByType(value, row);
                    }
                }
            }, {
                field: 'companyName', title: '收款单位', width: '13%', align: 'left', formatter: function (value, row) {
                    return formatterShowByType(value, row);
                }, styler: function (value, row) {
                    return backgroundShowByType(value, row);
                }
            },
            {
                field: 'openingBankNameOld',
                title: '收款银行（旧）',
                width: '13%',
                align: 'left',
                styler: function (value, row) {
                    if (row.type == 3) {
                        return backgroundShowByType(value, row);
                    }
                }
            }, {
                field: 'openingBankName',
                title: '收款银行',
                width: '13%',
                align: 'left',
                formatter: function (value, row) {
                    return formatterShowByType(value, row);
                },
                styler: function (value, row) {
                    return backgroundShowByType(value, row);
                }
            },
            {
                field: 'bankAccountOld',
                title: '银行账号(旧)',
                width: '15%',
                align: 'left',
                styler: function (value, row) {
                    if (row.type == 3) {
                        return backgroundShowByType(value, row);
                    }
                }
            }, {
                field: 'bankAccount', title: '银行账号', width: '15%', align: 'left', formatter: function (value, row) {
                    return formatterShowByType(value, row);
                }, styler: function (value, row) {
                    return backgroundShowByType(value, row);
                }
            },
            {
                field: 'bankCodeOld',
                title: '银行代码 Bank Code（旧）',
                width: '13%',
                align: 'left',
                styler: function (value, row) {
                    if (row.type == 3) {
                        return backgroundShowByType(value, row);
                    }
                }
            }, {
                field: 'bankCode',
                title: '银行行号',
                width: '13%',
                align: 'left',
                formatter: function (value, row) {
                    return formatterShowByType(value, row);
                },
                styler: function (value, row) {
                    return backgroundShowByType(value, row);
                }
            },
            {
                field: 'bankAddressOld',
                title: '银行地址（旧）',
                width: '13%',
                align: 'left',
                styler: function (value, row) {
                    if (row.type == 3) {
                        return backgroundShowByType(value, row);
                    }
                }
            }, {
                field: 'bankAddress',
                title: '银行地址',
                width: '13%',
                align: 'left',
                formatter: function (value, row) {
                    return formatterShowByType(value, row);
                },
                styler: function (value, row) {
                    return backgroundShowByType(value, row);
                }
            },
            {
                field: 'bankInterCodeOld',
                title: '银行国际代码（旧）',
                width: '13%',
                align: 'left',
                styler: function (value, row) {
                    if (row.type == 3) {
                        return backgroundShowByType(value, row);
                    }
                }
            }, {
                field: 'bankInterCode',
                title: '银行国际代码',
                width: '13%',
                align: 'left',
                formatter: function (value, row) {
                    return formatterShowByType(value, row);
                },
                styler: function (value, row) {
                    return backgroundShowByType(value, row);
                }
            }]],
        onLoadSuccess: function (data) {
            //没有数据隐藏表格
            if (!data.total) {
                $(el.bankTb).parents('.table-version').hide();
            }
            setTimeout(function () {
                $(el.bankTb).datagrid('resize')
            }, 2)
        }
    });
}

/**
 * 加载-供应商品类
 */
function loadProductTypeGrid() {
    $(el.productType).datagrid({
        title: '供应商品类',
        iconCls: 'icon-list',
        height: selfData.height,
        pagination: false,
        method: "GET",
        url: gridUrl.productTypeUrl,
        idField: 'id',
        loadMsg: itablei8n.dataLoading,
        rownumbers: true,
        singleSelect: true,
        fitColumns: true,
        nowrap: true,
        remoteSort: true,
        striped: true,
        queryParams: {
            changeVersionId: selfData.changeVersionId
        },
        columns: [[{
            field: 'type', title: '状态', width: '5%', align: 'left', formatter: function (value) {
                return formatterType(value);
            }, styler: function (value, row) {
                return backgroundShowByType(value, row);
            }
        }, {
            field: 'isFreezeOld',
            title: '是否取消(旧)',
            width: '15%',
            align: 'center',
            formatter: function (value, row) {
                return value === 1 ? "是" : "否"
            },
            styler: function (value, row) {
                return backgroundShowByType(value, row);
            }
        }, {
            field: 'isFreeze', title: '是否取消', width: '15%', align: 'center',
            formatter: function (value, row) {
                return value === 1 ? "是" : "否"
            },
        }, {
            field: 'purchaseCategoryCodeOld',
            title: '品类编码(旧)',
            width: '15%',
            align: 'center',
            styler: function (value, row) {
                if (row.type === 3) {
                    return backgroundShowByType(value, row);

                }
            }
        }, {
            field: 'purchaseCategoryCode', title: '品类编码', width: '15%', align: 'center'
        }, {
            field: 'purchaseCategoryNameOld',
            title: '品类名称(旧)',
            width: '15%',
            align: 'center',
            styler: function (value, row) {
                if (row.type === 3) {
                    return backgroundShowByType(value, row);

                }
            }
        }, {
            field: 'purchaseCategoryName', title: '品类名称', width: '15%', align: 'center'
        }, {
            field: 'companyCodeOld', title: '公司(旧)', width: '13%', align: 'left', formatter: function (value, row) {
                return getNecessaryDataName("pc/sys/company/rest/listAll", value)
            }, styler: function (value, row) {
                if (row.type === 3) {
                    return backgroundShowByType(value, row);

                }
            }
        }, {
            field: 'companyCode', title: '公司', width: '13%', align: 'left', formatter: function (value, row) {
                return getNecessaryDataName("pc/sys/company/rest/listAll", value)
            }
        }, {
            field: 'paymentTermsOld',
            title: '付款条件(旧)',
            width: '15%',
            align: 'left',
            formatter: function (value, row) {
                return getDicName('payment_method', value)
            },
            styler: function (value, row) {
                if (row.type === 3) {
                    return backgroundShowByType(value, row);

                }
            }
        }, {
            field: 'paymentTerms', title: '付款条件', width: '15%', align: 'left', formatter: function (value, row) {
                return getDicName('payment_method', value)
            }, styler: function (value, row) {
                return backgroundShowByType(value, row);
            }
        }, {
            field: 'paymentMethodOld',
            title: '付款方式(旧)',
            width: '15%',
            align: 'left',
            formatter: function (value, row) {
                return getDicName('payment_way', value)
            },
            styler: function (value, row) {
                if (row.type === 3) {
                    return backgroundShowByType(value, row);

                }
            }
        }, {
            field: 'paymentMethod', title: '付款方式', width: '15%', align: 'left', formatter: function (value, row) {
                return getDicName('payment_way', value)
            }, styler: function (value, row) {
                return backgroundShowByType(value, row);
            }
        }, {
            field: 'acceptanceMethodOld',
            title: '承兑期限(旧)',
            width: '90',
            align: 'left',
            formatter: function (value, row) {
                return getDicName('supplier_accetp_deadline', value)
            },
            styler: function (value, row) {
                if (row.type === 3) {
                    return backgroundShowByType(value, row);

                }
            }
        }, {
            field: 'acceptanceMethod', title: '承兑期限', width: '90', align: 'left', formatter: function (value, row) {
                return getDicName('supplier_accetp_deadline', value)
            }, styler: function (value, row) {
                return backgroundShowByType(value, row);
            }
        }, {
            field: 'currencyCodeOld', title: '币种（旧）', width: '13%', align: 'left', formatter: function (value, row) {
                return getDicName('currency', value)
            }, styler: function (value, row) {
                if (row.type === 3) {
                    return backgroundShowByType(value, row);
                }
            }
        }, {
            field: 'currencyCode', title: '币种', width: '13%', align: 'left', formatter: function (value, row) {
                return getDicName('currency', value)
            }, styler: function (value, row) {
                return backgroundShowByType(value, row);
            }
        }, {
            field: 'taxCodeOld', title: '税率（旧）', width: '13%', align: 'left', formatter: function (value, row) {
                return getNecessaryDataName('pc/sys/tax/rest/listAll', value)
            }, styler: function (value, row) {
                if (row.type === 3) {
                    return backgroundShowByType(value, row);
                }
            }
        }, {
            field: 'taxCode', title: '税率', width: '13%', align: 'left', formatter: function (value, row) {
                return getNecessaryDataName('pc/sys/tax/rest/listAll', value)
            }, styler: function (value, row) {
                return backgroundShowByType(value, row);
            }
        }, {
            field: 'controlSubjectOld',
            title: '统御科目（旧）',
            width: '13%',
            align: 'left',
            formatter: function (value, row) {
                return getDicName('controlling_accounts', value)
            },
            styler: function (value, row) {
                if (row.type === 3) {
                    return backgroundShowByType(value, row);
                }
            }
        }, {
            field: 'controlSubject', title: '统御科目', width: '13%', align: 'left', formatter: function (value, row) {
                return getDicName('controlling_accounts', value)
            }, styler: function (value, row) {
                return backgroundShowByType(value, row);
            }
        }, {
            field: 'purchaseOrgCodeOld',
            title: ' 采购组织（旧）',
            width: '10%',
            align: 'center',
            formatter: function (value) {
                return getNecessaryDataName('pc/sys/purchaseOrg/rest/listAll', value)
            },
            styler: function (value, row) {
                if (row.type === 3) {
                    return backgroundShowByType(value, row);
                }
            }
        }, {
            field: 'purchaseOrgCode', title: ' 采购组织', width: '10%', align: 'center', formatter: function (value) {
                return getNecessaryDataName('pc/sys/purchaseOrg/rest/listAll', value)
            }, styler: function (value, row) {
                if (row.type === 3) {
                    return backgroundShowByType(value, row);
                }
            }
        }, {
            field: 'effectiveTimeOld',
            title: '有效期（旧）',
            width: '10%',
            align: 'center', formatter: function (value) {
                if(value){
                    return moment(value).format("YYYY-MM-DD");
                }
                return ''
            },
            styler: function (value, row) {
                if (row.type === 3) {
                    return backgroundShowByType(value, row);
                }
            }
        }, {
            field: 'effectiveTime', title: '有效期', width: '10%', align: 'center',formatter: function (value) {
                if(value){
                    return moment(value).format("YYYY-MM-DD");
                }
                return ''
            }, styler: function (value, row) {
                if (row.type === 3) {
                    return backgroundShowByType(value, row);
                }
            }
        }]],
        onLoadSuccess: function (data) {
            //没有数据隐藏表格
            if (!data.total) {
                $(el.productType).parents('.table-version').hide();
            }
            setTimeout(function () {
                $(el.productType).datagrid('resize')
            }, 2)
        }
    });
}


function loadQualificationGrid() {
    $(el.qualificationTb).datagrid({
        title: '供应商资质',
        iconCls: 'icon-list',
        height: selfData.height,
        pagination: false,
        method: "GET",
        url: gridUrl.qualificationUrl,
        idField: 'id',
        loadMsg: itablei8n.dataLoading,
        rownumbers: true,
        singleSelect: true,
        fitColumns: true,
        nowrap: true,
        remoteSort: true,
        striped: true,
        queryParams: {
            changeVersionId: selfData.changeVersionId
        },
        columns: [[
            {field: 'ck', checkbox: true},
            {
                field: 'qualificationCode', title: supplieri18n.zzbm,
                width: '160', align: 'left'
            },
            {
                field: 'qualificationName', title: supplieri18n.zzmc,
                width: '160', align: 'left'
            },
            {
                field: 'fileName', title: supplieri18n.yzswj,
                width: '160', align: 'left',
                formatter: function (value, row) {
                    if (value) {
                        return "<a href='" + g.ctx + "pc/sys/file/rest/download/" + row.fileId + "'>" + value + "</a>"
                    }
                    return ''
                }
            }, {
                field: 'newFileId', title: supplieri18n.xzswj,
                width: '200', align: 'left',
                formatter: function (value, row, rowIndex) {
                    var html = ''
                    if (value) {
                        html = "<a href='" + g.ctx + "pc/sys/file/rest/download/" + value + "'>" + row.newFileName + "</a>";
                    }
                    return html;
                }
            },
            {
                field: 'qualificationNumber', title: "原证书编号",
                width: '80', align: 'left',
            }, {
                field: 'newQualificationNumber', title: "新原证书编号",
                width: '160', align: 'left'
            },
            {
                field: 'availableStartDate', title: supplieri18n.ysxrq,
                width: '80', align: 'left',
            }, {
                field: 'newAvailableStartDate', title: supplieri18n.xsxrq,
                width: '160', align: 'left'
            },
            {
                field: 'availableEndDate', title: supplieri18n.ysixrq,
                width: '80', align: 'left',
            },

            {
                field: 'newAvailableEndDate', title: supplieri18n.xsixrq,
                width: '160', align: 'left'
            }
        ]],
        onLoadSuccess: function (data) {
            //没有数据隐藏表格
            if (!data.total) {
                $(el.qualificationTb).parents('.table-version').hide();
            }
            setTimeout(function () {
                $(el.qualificationTb).datagrid('resize')
            }, 2)
        }
    });
}

/**
 * 加载 - 供应商联系人
 */
function loadContact() {
    $(el.contactsTb).datagrid({
        iconCls: 'icon-list',
        title: supplieri18n.gyslxr,
        url: gridUrl.contactsUrl,
        pagination: true,
        method: "GET",
        page: 1,
        rows: 10,
        height: selfData.height,
        width: selfData.width,
        singleSelect: true,
        idField: 'id',
        autoHeight: true,
        loadMsg: itablei8n.dataLoading,
        rownumbers: true,
        fitColumns: true,
        nowrap: true,
        remoteSort: true,
        striped: true,
        queryParams: {
            changeVersionId: selfData.changeVersionId
        },
        columns: [[{
            field: 'type', title: '状态', width: '10%', align: 'left', formatter: function (value) {
                return formatterType(value);
            }, styler: function (value, row) {
                return backgroundShowByType(value, row);
            }
        }, {
            field: 'contactsTypeOld',
            title: '联系人类型(旧)',
            width: '10%',
            align: 'left',
            formatter: function (value, row) {
                return getDicName("supplier_role_type", value);
            },
            styler: function (value, row) {
                if (row.type == 3) {
                    return backgroundShowByType(value, row);
                }
            }
        }, {
            field: 'contactsType', title: '联系人类型', width: '10%', align: 'left', formatter: function (value, row) {
                return getDicName("supplier_role_type", value);
            }, styler: function (value, row) {
                return backgroundShowByType(value, row);
            }
        }, {
            field: 'contactsNameOld', title: '姓名(旧)', width: '15%', align: 'left', styler: function (value, row) {
                if (row.type == 3) {
                    return backgroundShowByType(value, row);
                }
            }
        }, {
            field: 'contactsName', title: '姓名', width: '15%', align: 'left', formatter: function (value, row) {
                return formatterShowByType(value, row);
            }, styler: function (value, row) {
                return backgroundShowByType(value, row);
            }
        },
            //     {
            //     field: 'contactsMobileOld',
            //     title: '手机(旧)',
            //     width: '20%',
            //     align: 'left',
            //     styler: function (value, row) {
            //         if (row.type == 3) {
            //             return backgroundShowByType(value, row);
            //         }
            //     }
            // }, {
            //     field: 'contactsMobile', title: '手机', width: '20%', align: 'left', formatter: function (value, row) {
            //         return formatterShowByType(value, row);
            //     }, styler: function (value, row) {
            //         return backgroundShowByType(value, row);
            //     }
            // },
            {
                field: 'contactsTelOld', title: '电话(旧)', width: '20%', align: 'left', // hidden:true
                styler: function (value, row) {
                    if (row.type == 3) {
                        return backgroundShowByType(value, row);
                    }
                }
            }, {
                field: 'contactsTel', title: '电话', width: '20%', align: 'left', // hidden:true,
                formatter: function (value, row) {
                    return formatterShowByType(value, row);
                }, styler: function (value, row) {
                    return backgroundShowByType(value, row);
                }
            }, {
                field: 'emailOld', title: '电子邮箱(旧)', width: '15%', align: 'left', styler: function (value, row) {
                    if (row.type == 3) {
                        return backgroundShowByType(value, row);
                    }
                }
            }, {
                field: 'email', title: '电子邮箱', width: '15%', align: 'left', formatter: function (value, row) {
                    return formatterShowByType(value, row);
                }, styler: function (value, row) {
                    return backgroundShowByType(value, row);
                }
            }]],
        onLoadSuccess: function (data) {
            //没有数据隐藏表格
            if (!data.total) {
                $(el.contactsTb).parents('.table-version').hide();
            }
        }
    });
}

/**
 * 加载 - 供应商变更附件列表
 */
function loadAttachment() {
    $(el.changeAttachmentTb).datagrid({
        singleSelect: true,
        height: '240',
        method: "GET",
        striped: true,
        url: g.ctx + 'pc/supplier/supplierChange/rest/attachmentList',
        queryParams: {
            changeVersionId: selfData.changeVersionId
        },
        pagination: true,
        title: '变更附件',
        columns: [[{
            field: 'type', title: '附件类型', width: '40%', align: 'left', formatter: function (value) {
                switch (value) {
                    case 1:
                        return '供应商名称变更';
                    case 2:
                        return '法人代表变更';
                    case 3:
                        return '结算方式变更';
                    case 4:
                        return '银行信息变更';
                    case 5:
                        return '供应商变更申请';
                    default:
                        return value;
                }
            }
        }, {
            field: 'fileName', title: '文件名称', width: '50%', align: 'left', formatter: function (value, row) {
                return "<a href='" + g.ctx + "pc/sys/file/rest/download/" + row.fileId + "'>" + value + "</a>"
            }
        },]],
    });
}

function getRemark() {
    const oaType = $("#oaType").combobox("getValue");
    const isFreeze = $("#isFreeze").combobox("getValue");
    return {remark: $("#examineRemark").val(), oaType: oaType, isFreeze: isFreeze};
}