|
|
@@ -91,22 +91,32 @@ function fmtRivetStatus(v){
|
|
|
if (v == 3 || v === '3') return '<span class="label label-danger">打印失败</span>';
|
|
|
return v;
|
|
|
}
|
|
|
+// 客户码前缀 → 产品映射
|
|
|
+function fmtProduct(customerSn){
|
|
|
+ if (!customerSn) return '';
|
|
|
+ var pfx = customerSn.substring(0, 4).toUpperCase();
|
|
|
+ if (pfx === '+KB6') return 'T09';
|
|
|
+ if (pfx === '+KB8') return 'T68';
|
|
|
+ // 精确匹配前 5 位再兜底
|
|
|
+ pfx = customerSn.substring(0, 5).toUpperCase();
|
|
|
+ if (pfx === '+KB60') return 'T09';
|
|
|
+ if (pfx === '+KB87') return 'T68';
|
|
|
+ return '';
|
|
|
+}
|
|
|
$('#dataGrid').dataGrid({
|
|
|
searchForm: $("#searchForm"),
|
|
|
columnModel: [
|
|
|
- {header:'${text("产品标识")}', name:'prodCode', index:'a.prod_code', width:80, align:"center"},
|
|
|
+ {header:'${text("产品")}', name:'customerSn', index:'a.customer_sn', width:70, align:"center",
|
|
|
+ formatter: function(v){ return fmtProduct(v); }},
|
|
|
{header:'${text("钢印码")}', name:'steelSn', index:'a.steel_sn', width:160, align:"center"},
|
|
|
{header:'${text("客户码")}', name:'customerSn', index:'a.customer_sn', width:200, align:"center"},
|
|
|
- {header:'${text("产线")}', name:'lineSn', index:'a.line_sn', width:70, align:"center"},
|
|
|
{header:'${text("CMT")}', name:'cmtPrintStatus', index:'a.cmt_print_status', width:80, align:"center",
|
|
|
formatter: function(v){ return fmtCmtStatus(v); }},
|
|
|
{header:'${text("拉铆")}', name:'rivetPrintStatus', index:'a.rivet_print_status', width:80, align:"center",
|
|
|
formatter: function(v){ return fmtRivetStatus(v); }},
|
|
|
{header:'${text("CMT打印时间")}', name:'cmtPrintTime', index:'a.cmt_print_time', width:140, align:"center"},
|
|
|
{header:'${text("拉铆打印时间")}', name:'rivetPrintTime', index:'a.rivet_print_time', width:140, align:"center"},
|
|
|
- {header:'${text("失败原因")}', name:'printMsg', index:'a.print_msg', width:180, align:"left"},
|
|
|
- {header:'${text("创建时间")}', name:'createDate', index:'a.create_date', width:140, align:"center"},
|
|
|
- {header:'${text("更新时间")}', name:'updateDate', index:'a.update_date', width:140, align:"center"}
|
|
|
+ {header:'${text("创建时间")}', name:'createDate', index:'a.create_date', width:140, align:"center"}
|
|
|
],
|
|
|
ajaxSuccess: function(data){
|
|
|
}
|