(function ($) { //========= ts 时间戳转换 // 年月日时分 $.extend($.fn.fmatter, { ts: function (cellvalue, options, rowdata) { var date = new Date(); date.setTime(cellvalue); var y = date.getFullYear(); var m = date.getMonth() + 1; m = m < 10 ? ('0' + m) : m; var d = date.getDate(); d = d < 10 ? ('0' + d) : d; var h = date.getHours(); h = h < 10 ? ('0' + h) : h; var minute = date.getMinutes(); var second = date.getSeconds(); minute = minute < 10 ? ('0' + minute) : minute; second = second < 10 ? ('0' + second) : second; //如果是1900-1-1,就返回空 // if (y == '1900' && m == '01' && d == '01') // return ""; if (y == 1970) return ""; if (y <= 1900) return ""; if (y >= 2199) return ""; // return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second; // return y + '-' + m + '-' + d; return y + '-' + m + '-' + d + ' ' + h + ':' + minute; } }); $.extend($.fn.fmatter.ts, { unformat: function (cellvalue, options) { return (new Date(cellvalue)).valueOf(); } }); //========= ts 时间戳转换 // 格式化年月日 $.extend($.fn.fmatter, { tsymd: function (cellvalue, options, rowdata) { if (cellvalue == undefined || cellvalue == null || cellvalue == "") return ""; var date = new Date(); date.setTime(cellvalue); var y = date.getFullYear(); var m = date.getMonth() + 1; m = m < 10 ? ('0' + m) : m; var d = date.getDate(); d = d < 10 ? ('0' + d) : d; var h = date.getHours(); h = h < 10 ? ('0' + h) : h; var minute = date.getMinutes(); var second = date.getSeconds(); minute = minute < 10 ? ('0' + minute) : minute; second = second < 10 ? ('0' + second) : second; //如果是1900-1-1,就返回空 // if (y == '1900' && m == '01' && d == '01') // return ""; if (y == 1970) return ""; if (y <= 1900) return ""; if (y >= 2199) return ""; // return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second; return y + '-' + m + '-' + d; // return y + '-' + m + '-' + d + ' ' + h + ':' + minute; } }); //========= ts 时间戳转换,只返回year $.extend($.fn.fmatter, { tsyyyy: function (cellvalue, options, rowdata) { if (cellvalue == undefined || cellvalue == null || cellvalue == "") return ""; var date = new Date(); date.setTime(cellvalue); var y = date.getFullYear(); var m = date.getMonth() + 1; m = m < 10 ? ('0' + m) : m; var d = date.getDate(); d = d < 10 ? ('0' + d) : d; var h = date.getHours(); h = h < 10 ? ('0' + h) : h; var minute = date.getMinutes(); var second = date.getSeconds(); minute = minute < 10 ? ('0' + minute) : minute; second = second < 10 ? ('0' + second) : second; //如果是1900-1-1,就返回空 // if (y == '1900' && m == '01' && d == '01') // return ""; if (y == 1970) return ""; if (y <= 1900) return ""; if (y >= 2199) return ""; return y; } }); $.extend($.fn.fmatter.tsymd, { unformat: function (cellvalue, options) { return (new Date(cellvalue)).valueOf(); } }); // 格式化年月日时分秒 $.extend($.fn.fmatter, { tsymds: function (cellvalue, options) { if (!cellvalue) { return ""; } var timestamp = moment(new Date(parseInt(cellvalue))); return timestamp.format("YYYY-MM-DD HH:mm:ss"); } }); // 保留两位小数 $.extend($.fn.fmatter, { decimalPlaces: function (cellvalue, options) { if (!cellvalue) { return ""; } if (isNaN(cellvalue)) { return cellvalue; } return (cellvalue ? (parseFloat(cellvalue).toFixed(2) + '') : ""); } }); // 格式化金额千分位 $.extend($.fn.fmatter, { thousands: function (cellvalue, options) { if (!cellvalue) { return ""; } if (isNaN(cellvalue)) { return cellvalue; } return (cellvalue ? ('¥' + parseFloat(cellvalue).toFixed(2) + '').replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') : ""); } }); // 去掉小数后面的零,针对 BigDecimal 类型 $.extend($.fn.fmatter, { formatZero: function (cellvalue, options) { if (!cellvalue) { return ""; } return (cellvalue ? (parseFloat(cellvalue) + '') : ""); } }); //========= enable 转换 $.extend($.fn.fmatter, { enable: function (cellvalue, options, rowdata) { switch ($.trim(cellvalue)) { case '1': return '启用'; case '0': return '禁用'; case '-1': return '删除'; } return cellvalue; } }); $.extend($.fn.fmatter.enable, { unformat: function (cellvalue, options) { if (cellvalue === '启用') { return 1; } else if (cellvalue === '禁用') { return 0; } else if (cellvalue === '删除') { return -1; } return cellvalue; } }); //========= c1转换 $.extend($.fn.fmatter, { c1: function (cellvalue, options, rowdata) { if (cellvalue) { return '#' + cellvalue; } return ''; } }); $.extend($.fn.fmatter.c1, { unformat: function (cellvalue, options) { if (cellvalue) { return cellvalue.slice(1); } return cellvalue.slice(1); } }); //========= beAction 转换 $.extend($.fn.fmatter, { ba: function (cellvalue, options, rowdata) { if (cellvalue === 'Y') { return '启用'; } else if (cellvalue === 'N') { return '禁用'; } else if (cellvalue === 'D') { return '删除'; } return cellvalue; } }); $.extend($.fn.fmatter.ba, { unformat: function (cellvalue, options) { if (cellvalue === '启用') { return 'Y'; } else if (cellvalue === '禁用') { return 'N'; } else if (cellvalue === '删除') { return 'D'; } return cellvalue; } }); //========= loginType登录类型转换 $.extend($.fn.fmatter, { lt: function (cellvalue, options, rowdata) { if (cellvalue === 'pwd') { return '账号密码'; } return cellvalue; } }); $.extend($.fn.fmatter.lt, { unformat: function (cellvalue, options) { if (cellvalue === '账号密码') { return 'pwd'; } return cellvalue; } }); //========= double转换 $.extend($.fn.fmatter, { double: function (cellvalue, options, rowdata) { if (cellvalue != null) { return parseFloat(cellvalue).toFixed(2); } return ''; } }); //========= 特殊字符的浮点 转换 $.extend($.fn.fmatter, { doubleToFixed: function (cellvalue, options, rowdata) { if (cellvalue != null) { var res = parseFloat(cellvalue).toFixed(2); if (isNaN(res)) { return ''; } else { return res; } } return ''; } }); //========= 是否 转换 $.extend($.fn.fmatter, { yesOrNo: function (cellvalue, options, rowdata) { switch ($.trim(cellvalue)) { case '1': return '是'; case '0': return '否'; } return ""; } }); $.extend($.fn.fmatter.yesOrNo, { unformat: function (cellvalue, options) { if (cellvalue === '是') { return 1; } else if (cellvalue === '否') { return 0; } return ""; } }); $.extend($.fn.fmatter, { isMust: function (cellvalue, options, rowdata) { switch ($.trim(cellvalue)) { case '1': return '必换件'; case '0': return ''; } return ""; } }); //========= 取消、未取消 转换 $.extend($.fn.fmatter, { cancel: function (cellvalue, options, rowdata) { switch ($.trim(cellvalue)) { case '1': return '取消'; case '0': return '未取消'; } return ""; } }); $.extend($.fn.fmatter.cancel, { unformat: function (cellvalue, options) { if (cellvalue === '取消') { return 1; } else if (cellvalue === '未取消') { return 0; } return ""; } }); //========= 2019-02-25 $.extend($.fn.fmatter, { status: function (cellvalue, options, rowdata) { if (cellvalue == 1) { return "正常"; } else if (cellvalue == -1) { return "停用"; } else if (cellvalue == 0) { return '草稿'; } return ""; } }); $.extend($.fn.fmatter, { matQc: function (cellvalue, options, rowdata) { if (cellvalue == 1) { return "正常"; } else if (cellvalue == 2) { return "超期"; } else if (cellvalue == 3) { return "报废"; } return "无"; } }); $.extend($.fn.fmatter, { stockupStatus: function (cellvalue, options, rowdata) { if (cellvalue == 1) { return "已完成"; } else if (cellvalue == 0) { return "未完成"; } return ""; } }); $.extend($.fn.fmatter, { stockupStatusAll: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('stockupStatusAll'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { // return obj.data[i].text; if (cellvalue == 6) { return "" + obj.data[i].text + ""; } else { return obj.data[i].text; } } } // return cellvalue; // if (cellvalue == 1) { // return "已完成"; // } else if (cellvalue == 0) { // return "未完成"; // } return ""; } }); $.extend($.fn.fmatter, { scrapStatus: function (cellvalue, options, rowdata) { if (cellvalue == 0) { return "待处理"; } else if (cellvalue == 1) { return "撤销"; } else if (cellvalue == 2) { return "完成"; } return ""; } }); $.extend($.fn.fmatter, { expStatus: function (cellvalue, options, rowdata) { if (cellvalue == 1) { return "正常"; } else if (cellvalue == 2) { return "预警"; } else if (cellvalue == 3) { return "紧急"; } return ""; } }); $.extend($.fn.fmatter.status, { unformat: function (cellvalue, options) { if (cellvalue === '正常') { return 1; } else if (cellvalue === '禁用') { return 0; } else if (cellvalue === '删除') { return -1; } return ""; } }); /*--add by sjq----------------------------------------------*/ // one can consider to use $.type instead of some functions below (see http://api.jquery.com/jQuery.type/) /*var ffmatter = {}; $.extend(ffmatter, { // one can consider to use $.type instead of some functions below (see http://api.jquery.com/jQuery.type/) isObject: function (o) { return (o && (typeof o === "object" || $.isFunction(o))) || false; }, isNumber: function (o) { // probably Number.isFinite can be used instead. return typeof o === "number" && isFinite(o); // return false for +infinity, -infinity, or NaN }, isValue: function (o) { return (this.isObject(o) || typeof o === "string" || this.isNumber(o) || typeof o === "boolean"); }, isEmpty: function (o) { if (typeof o !== "string" && this.isValue(o)) { return false; } if (!this.isValue(o)) { return true; } o = $.trim(o).replace(/ /ig, "").replace(/ /ig, ""); return o === ""; }, NumberFormat: function (nData, opts) { var isNumber = ffmatter.isNumber; if (!isNumber(nData)) { nData *= 1; } if (isNumber(nData)) { var bNegative = (nData < 0); var sOutput = String(nData); var sDecimalSeparator = opts.decimalSeparator || "."; var nDotIndex; if (isNumber(opts.decimalPlaces)) { // Round to the correct decimal place var nDecimalPlaces = opts.decimalPlaces; // we use rounding described in http://www.jacklmoore.com/notes/rounding-in-javascript/ sOutput = String(Number(Math.round(nData + "e" + nDecimalPlaces) + "e-" + nDecimalPlaces)); nDotIndex = sOutput.lastIndexOf("."); if (nDecimalPlaces > 0) { // Add the decimal separator if (nDotIndex < 0) { sOutput += sDecimalSeparator; nDotIndex = sOutput.length - 1; } else if (sDecimalSeparator !== ".") { // Replace the "." sOutput = sOutput.replace(".", sDecimalSeparator); } // Add missing zeros while ((sOutput.length - 1 - nDotIndex) < nDecimalPlaces) { sOutput += "0"; } } } if (opts.thousandsSeparator) { var sThousandsSeparator = opts.thousandsSeparator; nDotIndex = sOutput.lastIndexOf(sDecimalSeparator); nDotIndex = (nDotIndex > -1) ? nDotIndex : sOutput.length; // we cut the part after the point for integer numbers // it will prevent storing/restoring of wrong numbers during inline editing var sNewOutput = opts.decimalSeparator === undefined ? "" : sOutput.substring(nDotIndex); var nCount = -1, i; for (i = nDotIndex; i > 0; i--) { nCount++; if ((nCount % 3 === 0) && (i !== nDotIndex) && (!bNegative || (i > 1))) { sNewOutput = sThousandsSeparator + sNewOutput; } sNewOutput = sOutput.charAt(i - 1) + sNewOutput; } sOutput = sNewOutput; } return sOutput; } return nData; } }); var insertPrefixAndSuffix = function (sOutput, opts) { // Prepend prefix sOutput = (opts.prefix) ? opts.prefix + sOutput : sOutput; // Append suffix return (opts.suffix) ? sOutput + opts.suffix : sOutput; }, numberHelper = function (cellval, opts, formatType) { var colModel = opts.colModel, op = $.extend({}, opts[formatType]); if (colModel != null) { op = $.extend({}, op, colModel.formatoptions || {}); } if (ffmatter.isEmpty(cellval)) { return insertPrefixAndSuffix(op.defaultValue, op); } return insertPrefixAndSuffix(ffmatter.NumberFormat(cellval, op), op); }; integer = function (cellval, opts) { return numberHelper(cellval, opts, "integer"); }; number = function (cellval, opts) { return numberHelper(cellval, opts, "number"); }; currency = function (cellval, opts) { return numberHelper(cellval, opts, "currency"); };*/ // 格式化为整数 $.extend($.fn.fmatter, { formatNumber: function (cellvalue, options, rowdata) { // cellvalue = 24001000.00; if (undefined == options) { // 在预览时,没有数据,需要初始化 options = {}; options.colModel = {}; options.colModel.formatoptions = {}; } options.colModel.formatoptions = {decimalSeparator: ".", decimalPlaces: 0, thousandsSeparator: ""}; var tmp = $.fn.fmatter.number(cellvalue, options); // 此方法只能在grid中使用,$.fn.fmatter.number实际调用路径static/plugins/jqgrid_4.15.6/jquery.jqgrid.src.js // var tmp = number(cellvalue, options); // options.decimalSeparator,//小数分隔符,如"." // options.tousandsSwparator,//千分位分隔符,如"," // options.decimalPlaces,//小数保留位数 // options.defaulValue return undefined == tmp ? cellvalue : tmp; } }); //去掉小数,小数后有值,保留小数 $.extend($.fn.fmatter, { formatNumberBigDecimal: function (cellvalue, options, rowdata) { return parseFloat(cellvalue) } }); //去掉小数,小数后有值,保留小数 $.extend($.fn.fmatter, { formatNumberBigDecimalWhenNull: function (cellvalue, options, rowdata) { if (cellvalue == null) { return ''; } return parseFloat(cellvalue) } }); // 格式化为钱 $.extend($.fn.fmatter, { formatCurrency: function (cellvalue, options, rowdata) { // cellvalue = 24001000.00; if (undefined == options) { // 在预览时,没有数据,需要初始化 options = {}; options.colModel = {}; options.colModel.formatoptions = {}; } var tmpcellvalue = cellvalue; if ("planPriceView" == options.colModel.name) { tmpcellvalue = options.rowData.planPrice; } else if ("planMoneyView" == options.colModel.name) { tmpcellvalue = options.rowData.planMoney; } options.colModel.formatoptions = { decimalSeparator: ".", thousandsSeparator: ",", decimalPlaces: 2, prefix: "¥" }; var tmp = $.fn.fmatter.currency(tmpcellvalue, options); // var tmp = currency(cellvalue, options); // decimalSeparator,//小数分隔符,如"." // thousandsSeparator,//千分位分隔符,如"," // decimalPlaces,//小数保留位数 // defaulValue, // prefix//前缀,如加上"$" // suffix//后缀 return undefined == tmp ? tmpcellvalue : tmp; } }); $.extend($.fn.fmatter, { formatNumberWithColor: function (cellvalue, options, rowdata) { var tmp = $.fn.fmatter.formatNumber(cellvalue, options, rowdata); if (0 == tmp) { return "" + tmp + ""; } else { return tmp; } } }); // xxxSrc命名的是原始的字段;xxxView的是加了html的字段 // 1是0否 $.extend($.fn.fmatter, { yesOrNoSrc: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('yesOrNo'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); // 信息是否完整 // 1是0否 $.extend($.fn.fmatter, { isFull: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('isFull'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); // 预警级别 $.extend($.fn.fmatter, { lev: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('lev'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); // 三期是否正常 // 1是0否 $.extend($.fn.fmatter, { rExp: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('rExp'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); // 执行状态 // 1是0否 $.extend($.fn.fmatter, { exeStatus: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('exeStatus'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //执行原因 $.extend($.fn.fmatter, { exeType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('exeType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); // 数据是否相符 // 1是0否 $.extend($.fn.fmatter, { ifWrong: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('ifWrong'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //物资单位类型 $.extend($.fn.fmatter, { unitType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('unitType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //账号类型 $.extend($.fn.fmatter, { accType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('accType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); // 1男0女 $.extend($.fn.fmatter, { genderSrc: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('gender'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); // 1抽查0普查 $.extend($.fn.fmatter, { invTypeSrc: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('invType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); // 1内部、2外部企业 $.extend($.fn.fmatter, { corpTypeSrc: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('corpType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); // 1内部、2外部企业 $.extend($.fn.fmatter, { outStatus: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('outStatus'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); // 发布状态 $.extend($.fn.fmatter, { statusPub: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('statusPub'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); // 盘存的6中状态 $.extend($.fn.fmatter, { qita: function (cellvalue, options, rowdata) { var b = ['锈蚀霉变', '三期异常', '无登记卡', '无合格证', '包装破损', '物资混批']; for (var i = 0; i < 5; i++) { i = cellvalue.split(","); if (i > 0) { return b[i]; } } for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); // 发布状态 $.extend($.fn.fmatter, { allStatus: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('allStatus'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); // 是否当前记录 $.extend($.fn.fmatter, { isCur: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('isCur'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); // 1邮箱、2手机、3工号、4IC卡ID $.extend($.fn.fmatter, { accTypeSrc: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('accType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //--Excel导入start----------------------------------- $.extend($.fn.fmatter, { tbNameSrc: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('tbName'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //--Excel导入end----------------------------------- //--派工号start----------------------------------- // 0分类1机型 $.extend($.fn.fmatter, { treeNodeSrc: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('treeNode'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); // 1主机2部附件 $.extend($.fn.fmatter, { pghTypeSrc: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('pghType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } // 处理excel出错信息-999时给出错误返回 if (-999 == cellvalue) { return "填写错误"; } return cellvalue; } }); // 1小保养2中保养3大保养 $.extend($.fn.fmatter, { mfLevSrc: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('mfLev'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } // 处理excel出错信息-999时给出错误返回 if (-999 == cellvalue) { return "填写错误"; } return cellvalue; } }); /* //0草稿/1发布/2完成 $.extend($.fn.fmatter, { pubStatusSrc: function (cellvalue, options, rowdata) { var tmp = options.rowData.pubStatus; var obj = $.yvan.sysDict('pubStatus'); for (i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } });*/ //--派工号end----------------------------------- //--到货通知单start----------------------------------- $.extend($.fn.fmatter, { trackTypeSrc: function (cellvalue, options, rowdata) { if (0 == cellvalue) { return ""; } var obj = $.yvan.sysDict('trackType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //0草稿、1发布 $.extend($.fn.fmatter, { pubStatusView: function (cellvalue, options, rowdata) { var tmp = cellvalue; if (options != undefined) { tmp = options.rowData.pubStatus; var color = tmp == 1 ? "green" : ""; } var obj = $.yvan.sysDict('pubStatus'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { if (options != undefined) return "" + obj.data[i].text + ""; else return obj.data[i].text; } } return cellvalue; } }); //0草稿、1发布 $.extend($.fn.fmatter, { billPubStatusView: function (cellvalue, options, rowdata) { var tmp = cellvalue; if (options != undefined) { tmp = options.rowData.billPubStatus; var color = tmp == 1 ? "green" : ""; } var obj = $.yvan.sysDict('pubStatus'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { if (options != undefined) return "" + obj.data[i].text + ""; else return obj.data[i].text; } } return cellvalue; } }); //收货 $.extend($.fn.fmatter, { inTypeSrc: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('inType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //收货 $.extend($.fn.fmatter, { qcnoTypeSrc: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('qcnoType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //--到货通知单end----------------------------------- //检验三期阶段 $.extend($.fn.fmatter, { qcstStage: function (cellvalue, options, rowdata) { if (!isNotNull(cellvalue)) return ""; var obj = $.yvan.sysDict('qcstStage'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //定检类型 $.extend($.fn.fmatter, { qcstExp: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('qcstExp'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } if (cellvalue == undefined || cellvalue == null || cellvalue == 0) { return ""; } return cellvalue; } }); //三期类型 $.extend($.fn.fmatter, { qcstExpView: function (cellvalue, options, rowdata) { var tmp = options.rowData.qcstExp; var obj = $.yvan.sysDict('qcstExp'); for (i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return obj.data[i].text; } } if (tmp == undefined || tmp == null || tmp == 0) { return ""; } return tmp; } }); //物资类型 $.extend($.fn.fmatter, { matType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('matType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } if (cellvalue == undefined || cellvalue == null || cellvalue == 0) { return ""; } return cellvalue; } }); //物流类型 $.extend($.fn.fmatter, { allotTrackType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('allotTrackType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } if (cellvalue == undefined || cellvalue == null || cellvalue == 0) { return ""; } return cellvalue; } }); //单据类型 $.extend($.fn.fmatter, { poolType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('poolType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } if (cellvalue == undefined || cellvalue == null || cellvalue == 0) { return ""; } return cellvalue; } }); //物资类型 $.extend($.fn.fmatter, { matTypeOut: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('matTypeOut'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } if (cellvalue == undefined || cellvalue == null || cellvalue == 0) { return ""; } return cellvalue; } }); //需求阶段 $.extend($.fn.fmatter, { outapType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('outapType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return ''; } }); //成套类型 $.extend($.fn.fmatter, { pkgId: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('pkgId'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return ''; } }); $.extend($.fn.fmatter, { pkgIdView: function (cellvalue, options, rowdata) { var tmp = options.rowData.pkgId; var obj = $.yvan.sysDict('pkgId'); for (i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return obj.data[i].text; } } return ''; } }); $.extend($.fn.fmatter, { matapType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('matapType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return ''; } }); $.extend($.fn.fmatter, { matapStep: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('matapStep'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { if (cellvalue == 2) { return "" + obj.data[i].text + ""; } else { return obj.data[i].text; } } } return cellvalue; } }); //配发状态 $.extend($.fn.fmatter, { wkStatus: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('wkStatus'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //是否允许混批 $.extend($.fn.fmatter, { batchMix: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('batchMix'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //送货方式 $.extend($.fn.fmatter, { shipType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('shipType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //送货方式 $.extend($.fn.fmatter, { shipTypeView: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('shipType'); for (i = 0; i < obj.data.length; i++) { if (options.rowData.shipType == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //签收状态 $.extend($.fn.fmatter, { signStatus: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('signStatus'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //是否需要物流 $.extend($.fn.fmatter, { isTrack: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('isTrack'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //撤销状态 $.extend($.fn.fmatter, { cancelStatus: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('cancelStatus'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //合格证类型 $.extend($.fn.fmatter, { hgzType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('hgzType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //审核状态 $.extend($.fn.fmatter, { auditStatus: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('auditStatus'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //是否人工 $.extend($.fn.fmatter, { isManual: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('isManual'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //物资清册 $.extend($.fn.fmatter, { matQingce: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('matQingce'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //货区类型 $.extend($.fn.fmatter, { workArea: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('workArea'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //货区类型 $.extend($.fn.fmatter, { workArea001: function (cellvalue, matQc) { switch ($.trim(cellvalue)) { case '1': return '收货区'; case '2': return '发货区'; case '3': return '待检区'; case '4': return '不合格品区'; case '5': if (matQc == 1) { return '货架区_正常'; } else if (matQc == 2) { return '货架区_超期'; } else if (matQc == 3) { return '货架区_报废'; } case '6': return '工作区'; } return cellvalue; } }); //仓库类型 $.extend($.fn.fmatter, { roomType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('roomType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //物资编码方式 $.extend($.fn.fmatter, { matCodeRule: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('matCodeRule'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }) //件号管理 $.extend($.fn.fmatter, { pnType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('pnType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //物资编码方式 $.extend($.fn.fmatter, { gbType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('gbType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } if (cellvalue == 0) return ""; return cellvalue; } }); //物资编码方式 $.extend($.fn.fmatter, { codeType: function (cellvalue, options, rowdata) { var tmp = options.rowData.codeType; var obj = $.yvan.sysDict('gbType'); for (i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return obj.data[i].text; } } if (tmp == 0) return ""; return tmp; } }); //形状状态 $.extend($.fn.fmatter, { shapeStatus: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('shapeStatus'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //形状是否可拆分 $.extend($.fn.fmatter, { shapeCut: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('shapeCut'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //存储状态 $.extend($.fn.fmatter, { storStatus: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('storStatus'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //领用状态 $.extend($.fn.fmatter, { takeStatus: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('takeStatus'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //领用单位类型 $.extend($.fn.fmatter, { takeUnit: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('takeUnit'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //检验不合格原因 $.extend($.fn.fmatter, { qcChangeType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('qcChangeType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return ""; } }); //领用配送方式 $.extend($.fn.fmatter, { takeMode: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('takeMode'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //是否校对 $.extend($.fn.fmatter, { isInfo: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('isInfo'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //物资信息确认 $.extend($.fn.fmatter, { isMatinfo: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('isMatinfo'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //批次号类型 $.extend($.fn.fmatter, { batchCodeType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('batchCodeType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } if (cellvalue == null || cellvalue == undefined || cellvalue == 0) return ""; return cellvalue; } }); //当前步骤 $.extend($.fn.fmatter, { step: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('step'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //合并类型 $.extend($.fn.fmatter, { equalType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('equalType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //1启用/-1停用状态 $.extend($.fn.fmatter, { statusView: function (cellvalue, options, rowdata) { var tmp = options.rowData.status; var color = tmp == 1 ? "green" : "red"; var obj = $.yvan.sysDict('status'); for (i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; } } return tmp; } }); //1启用/-1停用状态 $.extend($.fn.fmatter, { yjStatusView: function (cellvalue, options, rowdata) { var tmp = options.rowData.yjStatus; var color = tmp == 1 ? "green" : "red"; var obj = $.yvan.sysDict('yjStatus'); for (i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; } } return tmp; } }); //1启用/-1停用状态 $.extend($.fn.fmatter, { gbattrStatusView: function (cellvalue, options, rowdata) { var tmp = options.rowData.gbattrStatus; var color = tmp == 1 ? "green" : "red"; var obj = $.yvan.sysDict('status'); for (i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; } } return tmp; } }); //1启用/-1停用状态 $.extend($.fn.fmatter, { allStatusView: function (cellvalue, options, rowdata) { var tmp = options.rowData.status; var color = (tmp == 1) ? "green" : (tmp == -1 || tmp == -2) ? "red" : ""; var obj = $.yvan.sysDict('allStatus'); for (i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; } } return tmp; } }); //1正常、2数据不完整/格式错误、3重复列、4数据已存在 $.extend($.fn.fmatter, { excelStatusView: function (cellvalue, options, rowdata) { var tmp = options.rowData.status; var color = (tmp == 1) ? "green" : "red"; var obj = $.yvan.sysDict('excelStatus'); for (i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; } } return tmp; } }); //1在职/-1离职状态 $.extend($.fn.fmatter, { userQuitView: function (cellvalue, options, rowdata) { var tmp = options.rowData.userQuit; var color = tmp == 1 ? "green" : "red"; var obj = $.yvan.sysDict('userStatus'); for (i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; } } return tmp; } }); //1在职/-1离职状态 $.extend($.fn.fmatter, { userStatusView: function (cellvalue, options, rowdata) { var tmp = options.rowData.status; var color = tmp == 1 ? "green" : "red"; var obj = $.yvan.sysDict('userStatus'); for (i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; } } return tmp; } }); //1在职/-1离职状态 $.extend($.fn.fmatter, { accountStatusView: function (cellvalue, options, rowdata) { var tmp = options.rowData.status; var color = tmp == 1 ? "green" : "red"; var obj = $.yvan.sysDict('accountStatus'); for (i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; } } return tmp; } }); //发布状态 $.extend($.fn.fmatter, { statusPubView: function (cellvalue, options, rowdata) { var tmp = options.rowData.statusPub; var color = tmp == 1 ? "green" : tmp == -1 ? "red" : "black"; var obj = $.yvan.sysDict('statusPub'); for (i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; } } return tmp; } }); //物资信息-发布状态 $.extend($.fn.fmatter, { matStatusPubView: function (cellvalue, options, rowdata) { var tmp = ""; if (isNotNull(options) && isNotNull(options.rowData.status)) { tmp = options.rowData.status; } else { tmp = cellvalue; } var color = tmp == 1 ? "green" : tmp == -1 ? "red" : "black"; var obj = $.yvan.sysDict('matStatusPub'); for (i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; } } return tmp; } }); //必填/非必填状态 $.extend($.fn.fmatter, { isMustView: function (cellvalue, options, rowdata) { var tmp = options.rowData.isMust; var color = tmp == 1 ? "green" : "red"; var obj = $.yvan.sysDict('isMust'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; } } return tmp; } }); //启用/停用状态 $.extend($.fn.fmatter, { statusFixView: function (cellvalue, options, rowdata) { var tmp = options.rowData.statusFix; var color = tmp == 0 ? "green" : tmp == -1 ? "red" : "black"; var obj = $.yvan.sysDict('statusFix'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; } } return tmp; } }); //设备类型 $.extend($.fn.fmatter, { termTypeView: function (cellvalue, options, rowdata) { var tmp = options.rowData.termType; var obj = $.yvan.sysDict('termType'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return obj.data[i].text; } } return tmp; } }); //标准实施状态:-1废止、1现行 $.extend($.fn.fmatter, { gbStatusView: function (cellvalue, options, rowdata) { var tmp = options.rowData.gbStatus; var color = tmp == 1 ? "green" : "red"; var obj = $.yvan.sysDict('gbStatus'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; } } return tmp; } }); //标准整体状态:-2删除、-1作废、0草稿、1发布, 删除不显示 $.extend($.fn.fmatter, { matGbStatusView: function (cellvalue, options, rowdata) { var tmp = options.rowData.status; var color = tmp == 1 ? "green" : tmp == -1 ? "red" : "black"; var obj = $.yvan.sysDict('matGbStatus'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; } } return tmp; } }); //附件业务类型 $.extend($.fn.fmatter, { busiTypeView: function (cellvalue, options, rowdata) { var tmp = ""; if (options.rowData != undefined && options.rowData != null) { tmp = options.rowData.busiType; } else { tmp = options.busiType; } // var color = tmp == 1 ? "green" : tmp == -1 ? "red" : "black"; var obj = $.yvan.sysDict('fileBusiType'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; // return "" + obj.data[i].text + ""; } } return tmp; } }); //企业状态:1有效、-1无效 $.extend($.fn.fmatter, { corpStatusView: function (cellvalue, options, rowdata) { var tmp = options.rowData.status; var color = tmp == 1 ? "green" : "red"; var obj = $.yvan.sysDict('corpStatus'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; } } return tmp; } }); //批次信息是否完整:1是、0否 $.extend($.fn.fmatter, { isFullView: function (cellvalue, options, rowdata) { var tmp = options.rowData.isFull; var color = tmp == 1 ? "green" : "red"; var obj = $.yvan.sysDict('isFull'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; } } return tmp; } }); //批次状态:状态:-2删除、-1作废、0草稿、1发布 $.extend($.fn.fmatter, { batchStatusView: function (cellvalue, options, rowdata) { var tmp = options.rowData.status; var color = tmp == 1 ? "green" : tmp == -1 ? "red" : "black"; var obj = $.yvan.sysDict('batchStatus'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; } } return tmp; } }); //批次混批 $.extend($.fn.fmatter, { batchMixView: function (cellvalue, options, rowdata) { var tmp = cellvalue; if (options != undefined) { tmp = options.rowData.pubStatus; var color = tmp == 1 ? "green" : ""; } var color = tmp == 1 ? "green" : tmp == -1 ? "red" : "black"; var obj = $.yvan.sysDict('batchMix'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return obj.data[i].text; } } return tmp; } }); //批次混批 $.extend($.fn.fmatter, { matQingceView: function (cellvalue, options, rowdata) { var tmp = cellvalue; if (options != undefined) { tmp = options.rowData.pubStatus; var color = tmp == 1 ? "green" : ""; } var color = tmp == 1 ? "green" : tmp == -1 ? "red" : "black"; var obj = $.yvan.sysDict('matQingce'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return obj.data[i].text; } } return tmp; } }); //批次步骤:0待发布、1审核中、2已审核、3完成 $.extend($.fn.fmatter, { batchStepView: function (cellvalue, options, rowdata) { var tmp = options.rowData.step; var color = tmp == 3 ? "green" : tmp == -1 ? "red" : "black"; var obj = $.yvan.sysDict('step'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; } } return tmp; } }); $.extend($.fn.fmatter, { treeNameView: function (cellvalue, options, rowdata, value) { var tmp = cellvalue; if ("orgNameView" == options.colModel.name) { tmp = options.rowData.orgName; } else if ("orgName" == options.colModel.name) { tmp = options.rowData.orgName; } else if ("corpNameView" == options.colModel.name) { tmp = options.rowData.corpName; } else if ("apmNameView" == options.colModel.name) { tmp = options.rowData.apmName; } else if ("matcNameView" == options.colModel.name) { tmp = options.rowData.matcName; } else if ("stepNameView" == options.colModel.name) { tmp = options.rowData.stepName; } else if ("menuNameView" == options.colModel.name) { tmp = options.rowData.menuName; } else if ("dictNameView" == options.colModel.name) { tmp = options.rowData.dictName; } if (options == undefined || options.rowData == undefined || options.rowData.treeLev == undefined) return cellvalue; var html = ""; for (var i = 1; i < options.rowData.treeLev; i++) { if (html == "") html += "|----"; else html += "----"; } return html + " " + tmp; } }); //应用程序类型 $.extend($.fn.fmatter, { appType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('appType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //应用程序版本状态 $.extend($.fn.fmatter, { appVerStatus: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('appVerStatus'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //应用程序版本类型 $.extend($.fn.fmatter, { appVerType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('appVerType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //应用程序文件类型 $.extend($.fn.fmatter, { appFileType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('appFileType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //附件文件类型 $.extend($.fn.fmatter, { fileType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('fileType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //新物资申请-发布状态 $.extend($.fn.fmatter, { newApplePubStatusView: function (cellvalue, options, rowdata) { var tmp = options.rowData.pubStatus; var color = tmp == 1 ? "green" : tmp == -1 ? "red" : "black"; var obj = $.yvan.sysDict('statusPub'); for (i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; } } return tmp; } }); //任务执行步骤 $.extend($.fn.fmatter, { taskStepView: function (cellvalue, options, rowdata) { var tmp = options.rowData.taskStep; var color = tmp == 3 ? "green" : ""; var obj = $.yvan.sysDict('taskStep'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; } } return cellvalue; } }); //任务作废状态 $.extend($.fn.fmatter, { cancelStatusView: function (cellvalue, options, rowdata) { var tmp = options.rowData.cancelStatus; var color = tmp == 1 ? "red" : ""; var obj = $.yvan.sysDict('cancelStatus'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { // return obj.data[i].text; return "" + obj.data[i].text + ""; } } return cellvalue; } }); //任务归档状态 $.extend($.fn.fmatter, { hisStatusView: function (cellvalue, options, rowdata) { var tmp = cellvalue; if (options != undefined) { tmp = options.rowData.hisStatus; var color = tmp == 1 ? "green" : ""; } var obj = $.yvan.sysDict('hisStatus'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { if (options != undefined) return "" + obj.data[i].text + ""; else return obj.data[i].text; } } return cellvalue; } }); //是否是样品 $.extend($.fn.fmatter, { isSampleView: function (cellvalue, options, rowdata) { var tmp = cellvalue; var obj = $.yvan.sysDict('isSample'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { if (options != undefined) return "" + obj.data[i].text + ""; else return obj.data[i].text; } } return cellvalue; } }); //物資状态 $.extend($.fn.fmatter, { matQcView: function (cellvalue, options, rowdata) { var tmp = cellvalue; if (options != undefined) { tmp = options.rowData.matQc; var color = tmp == 1 ? "green" : ""; } var obj = $.yvan.sysDict('matQc'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { if (options != undefined) return "" + obj.data[i].text + ""; else return obj.data[i].text; } } return cellvalue; } }); //任务状态-仓储使用 $.extend($.fn.fmatter, { taskStatusView: function (cellvalue, options, rowdata) { var tmp = cellvalue; if (options != undefined) { tmp = options.rowData.taskStatus; var color = tmp == 1 ? "green" : ""; } var obj = $.yvan.sysDict('taskStatus'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { if (options != undefined) // return "" + obj.data[i].text + ""; return obj.data[i].text; else return obj.data[i].text; } } return cellvalue; } }); //任务状态-物资编码使用 $.extend($.fn.fmatter, { taskStatusBillView: function (cellvalue, options, rowdata) { var tmp = cellvalue; if (options != undefined) { tmp = options.rowData.taskStatus; var color = tmp == 1 ? "green" : ""; } var obj = $.yvan.sysDict('taskStatusBill'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { if (options != undefined) // return "" + obj.data[i].text + ""; return obj.data[i].text; else return obj.data[i].text; } } return cellvalue; } }); //检验状态 $.extend($.fn.fmatter, { qcStatusView: function (cellvalue, options, rowdata) { var tmp = cellvalue; if (options != undefined) { tmp = options.rowData.qcStatus; var color = tmp == 1 ? "green" : ""; } var obj = $.yvan.sysDict('qcStatus'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { if (options != undefined) return obj.data[i].text; else return obj.data[i].text; } } return cellvalue; } }); $.extend($.fn.fmatter, { taskStatusInv: function (cellvalue, options, rowdata) { var tmp = cellvalue; if (cellvalue == 0 || cellvalue == undefined) { tmp = ''; } else if (cellvalue == 1) { tmp = '进行中'.fontcolor('brown'); } else if (cellvalue == 2) { tmp = '已完成'.fontcolor('green'); } return tmp; } }); $.extend($.fn.fmatter, { taskStatusInvCmp: function (cellvalue, options, rowdata) { var tmp = cellvalue; if (cellvalue == 0 || cellvalue == undefined) { tmp = '无'; } else if (cellvalue == 1) { tmp = '未完成'.fontcolor('brown'); } else if (cellvalue == 2) { tmp = '已完成'.fontcolor('green'); } return tmp; } }); // 盘存状态 $.extend($.fn.fmatter, { taskStatus001: function (cellvalue, options, rowdata) { var tmp = cellvalue; if (cellvalue == 0 || cellvalue == undefined) { tmp = '未开始'; } else if (cellvalue == 1) { tmp = '进行中'.fontcolor('brown'); } else if (cellvalue == 2) { tmp = '已完成'.fontcolor('green'); } return tmp; } }); // //工艺规程附录-编码类型 // $.extend($.fn.fmatter, { // detaCodeType: function (cellvalue, options, rowdata) { // var obj = $.yvan.sysDict('detaCodeType'); // for (i = 0; i < obj.data.length; i++) { // if (cellvalue == obj.data[i].id) { // return obj.data[i].text; // } // } // //0是无效状态 // if (cellvalue != undefined && cellvalue == 0) // return ""; // return cellvalue; // } // }); //工艺规程附录-对应状态 $.extend($.fn.fmatter, { detaMatchStatus: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('detaMatchStatus'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); $.extend($.fn.fmatter, { techDetaType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('techDetaType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //工艺规程附录-是否必换件 $.extend($.fn.fmatter, { mustReplace: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('mustReplace'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //物资比对模板详情-模板类型 $.extend($.fn.fmatter, { matchType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('matchType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //物资比对模板详情-比对结果 $.extend($.fn.fmatter, { errType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('errType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //同步状态:0未同步、1已同步 $.extend($.fn.fmatter, { isSyncView: function (cellvalue, options, rowdata) { var tmp = options.rowData.isSync; var color = tmp == 1 ? "green" : "red"; var obj = $.yvan.sysDict('isSync'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { return "" + obj.data[i].text + ""; } } return tmp; } }); //仓库类型 $.extend($.fn.fmatter, { roomType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('roomType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } if (cellvalue == null || cellvalue == undefined || cellvalue == 0) return ""; return cellvalue; } }); // 损溢类型 $.extend($.fn.fmatter, { syType: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('syType'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //损溢原因 $.extend($.fn.fmatter, { dutyRole: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('dutyRole'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //责任对象 $.extend($.fn.fmatter, { dutyCause: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('dutyCuse'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //处理状态 $.extend($.fn.fmatter, { taskStatus: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('taskStatus'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); // 盘存执行类型 $.extend($.fn.fmatter, { exeRole: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('exeRole'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //损溢上报处理状态 $.extend($.fn.fmatter, { pubStatus: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('pubStatus'); for (i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //列表,格式化小数值 $.extend($.fn.fmatter, { float: function (cellvalue, options, rowdata) { return formatFloat(cellvalue); } }); //件号使用状态 $.extend($.fn.fmatter, { useStatus: function (cellvalue, options, rowdata) { var obj = $.yvan.sysDict('useStatus'); for (var i = 0; i < obj.data.length; i++) { if (cellvalue == obj.data[i].id) { return obj.data[i].text; } } return cellvalue; } }); //货位存放模式 $.extend($.fn.fmatter, { storeMode: function (value, options, rowdata) { var obj = $.yvan.sysDict('storeMode'); for (var i = 0; i < obj.data.length; i++) { if (value == obj.data[i].id) { return obj.data[i].text; } } return ""; } }); $.extend($.fn.fmatter, { pubStatusJd: function (cellvalue, options, rowdata) { var tmp = cellvalue; if (options != undefined) { tmp = options.rowData.pubStatus; var color = tmp == 2 ? "green" : tmp == -1 ? "red" : ""; } var obj = $.yvan.sysDict('pubStatus'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { if (options != undefined) return "" + obj.data[i].text + ""; else return obj.data[i].text; } } return cellvalue; } }); //一级一档 $.extend($.fn.fmatter, { useStatusJd: function (cellvalue, options, rowdata) { var tmp = cellvalue; if (options != undefined) { tmp = options.rowData.useStatus; var color = tmp == 1 ? "red" : ""; } var obj = $.yvan.sysDict('useStatus'); for (var i = 0; i < obj.data.length; i++) { if (tmp == obj.data[i].id) { if (options != undefined) return "" + obj.data[i].text + ""; else return obj.data[i].text; } } return ""; } }); //一级一档 //物资编码-批次入库类型 $.extend($.fn.fmatter, { batchInType: function (value, options, rowdata) { var obj = $.yvan.sysDict('batchInType'); for (var i = 0; i < obj.data.length; i++) { if (value == obj.data[i].id) { return obj.data[i].text; } } return ""; } }); }) (jQuery); // 去掉文本的html标签 var filterHTMLTag = function (msg) { var msg = msg.replace(/<\/?[^>]*>/g, ''); //去除HTML Tag msg = msg.replace(/[|]*\n/, '') //去除行尾空格 msg = msg.replace(/&npsp;/ig, ''); //去掉npsp return msg; } // 获取当前时间并格式化YY-MM-DD function getFormatDate() { var date = new Date(); var year = date.getFullYear(); var month = date.getMonth() + 1; var nowDate = date.getDate(); if(month >=1 && month <=9) { month = "0" + month; } if(nowDate >=0 && nowDate <=9) { nowDate = "0" + nowDate; } var newDate = year + "-" + month + "-" + nowDate; return newDate; }