| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">状态</label> |
| | | <div class="layui-input-block"> |
| | | <select name="HStatus" id="HStatus" lay-filter=""> |
| | | <option value="" selected="">全部</option> |
| | | <option value="未打印">未打印</option> |
| | | <option value="已打印">已打印</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">条码编号</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" class="layui-input" name="HBarCode" id="HBarCode"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">源单单号</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" class="layui-input" name="HSourceBillNo" id="HSourceBillNo"> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">物料代码</label> |
| | | <label class="layui-form-label">物料名称</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" class="layui-input" name="HNumber" id="HNumber"> |
| | | <input type="text" class="layui-input" name="HName" id="HName"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">规格型号</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" class="layui-input" name="HModel" id="HModel"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">供应商</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" class="layui-input" name="HSupName" id="HSupName"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="f_Query"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> |
| | |
| | | </div> |
| | | <div class="layui-colla-content" style="padding-left:82px"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">物料名称</label> |
| | | <label class="layui-form-label">状态</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" class="layui-input" name="HName" id="HName"> |
| | | <select name="HStatus" id="HStatus" lay-filter=""> |
| | | <option value="" selected="">全部</option> |
| | | <option value="未打印">未打印</option> |
| | | <option value="已打印">已打印</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">规格型号</label> |
| | | <label class="layui-form-label">条码编号</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" class="layui-input" name="HModel" id="HModel"> |
| | | <input type="text" class="layui-input" name="HBarCode" id="HBarCode"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">物料代码</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" class="layui-input" name="HNumber" id="HNumber"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-confirm"><i class="layui-icon layui-icon-ok-circle"></i>确认</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-back"><i class="layui-icon layui-icon-close-fill"></i>驳回</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-details"><i class="layui-icon layui-icon-form"></i>详情</button>--> |
| | | <button type="button" class="layui-btn layui-btn-sm" id="btn_HideColumn" lay-event="btn-HideColumn"><i class="layui-icon layui-icon-return"></i>隐藏列设置</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print"><i class="layui-icon layui-icon-print"></i>条码打印</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print-Convenient"><i class="layui-icon layui-icon-print"></i>一键打印</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-delete"></i>删除</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-exit"><i class="layui-icon layui-icon-return"></i>退出</button> |
| | | </div> |
| | |
| | | //CreateReport("Report"); //打印 |
| | | // Report.LoadFromURL("物料条码(七行纸大)_五云.grf"); |
| | | var _cur_page = 1; |
| | | var sql = " and 1=1"; |
| | | var sql = ""; |
| | | |
| | | var options = document.getElementById('HStatus').children; |
| | | function getUrlVars() { |
| | |
| | | |
| | | var params = getUrlVars(); |
| | | var type = params[params[0]]; |
| | | switch (type) { |
| | | case "UnPrint": |
| | | options[1].selected = true; |
| | | sql += " and 状态 like ^^%未打印%^^"; |
| | | break; |
| | | case "RePrint": |
| | | options[2].selected = true; |
| | | sql += " and 状态 like ^^%已打印%^^"; |
| | | break; |
| | | } |
| | | var HSourceBillNo = params[params[1]]; |
| | | |
| | | layui.config({ |
| | | base: '../../layuiadmin/' //静态资源所在路径 |
| | |
| | | , table = layui.table |
| | | , form = layui.form |
| | | , element = layui.element; |
| | | |
| | | switch (type) { |
| | | case "UnPrint": |
| | | options[1].selected = true; |
| | | sql += " and 状态 like ^^%未打印%^^"; |
| | | break; |
| | | case "RePrint": |
| | | options[2].selected = true; |
| | | sql += " and 状态 like ^^%已打印%^^"; |
| | | break; |
| | | case "check": |
| | | if (HSourceBillNo != undefined) { |
| | | $("#HSourceBillNo").val(HSourceBillNo); |
| | | |
| | | sql += " and 源单单号 like ^^%" + HSourceBillNo + "%^^"; |
| | | } |
| | | break; |
| | | } |
| | | |
| | | //不需要显示的字段 可扩展 |
| | | var titleData = ["HItemID", "HParentID", "单据号", "日期", "状态", "单位", "金额"]; |
| | | var HModName = "SRM_BarCodeBillList"; |
| | | var option = []; |
| | | //常规用法 |
| | | laydate.render({ |
| | | elem: '#HDate1' |
| | |
| | | // , where: { msg: "", NowPage: 1, OnePage: 10 } |
| | | , cellMinWidth: 100 |
| | | , cols: [[ |
| | | { checkbox: true/*, fixed: true*/ } |
| | | { type: 'checkbox', fixed: 'left', totalRowText: '合计' } |
| | | //{ checkbox: true/*, fixed: true*/ } |
| | | , { field: 'sorderid', title: '序号', width: 80/*, fixed: true*/ } |
| | | , { field: 'HItemID', title: '主键', width: 100, hide: true } |
| | | , { field: '状态', title: '状态', width: 100, sort: true/*, fixed: true*/ } |
| | | , { field: '条码编号', title: '条码编号', width: 180, sort: true/*, fixed: true*/ } |
| | | , { field: '物料编码', title: '物料编码', width: 120, sort: true/*, fixed: true*/ } |
| | | , { field: '旧物料编码', title: '旧物料编码', width: 120, sort: true/*, fixed: true*/ } |
| | | , { field: '物料代码', title: '物料代码', width: 120, sort: true/*, fixed: true*/ } |
| | | , { field: '物料名称', title: '物料名称', width: 120, sort: true } |
| | | , { field: '数量', title: '数量', width: 100, sort: true } |
| | |
| | | //, skin: 'row' //表格风格 |
| | | // , even: true |
| | | , page: true //是否显示分页 |
| | | , limits: [10, 20, 50, 100] |
| | | , limits: [10, 20, 50, 100,500,5000,10000] |
| | | , limit: 50 //每页默认显示的数量 |
| | | //, height: 500 |
| | | , done: function (res, curr, count) { |
| | |
| | | layer.msg("至少选择一行记录!") |
| | | } |
| | | else { |
| | | var url = "linteridSession"; |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: GetWEBURL() + url, //方法所在页面和方法名 |
| | | async: true, |
| | | data: { "linterid": rows.toString(), "HUserName": sessionStorage["HUserName"] }, |
| | | dataType: "json", |
| | | success: function (data) { |
| | | layer.closeAll("loading"); |
| | | }, |
| | | error: function (err) { |
| | | layer.alert("错误:" + err, { icon: 5 }); |
| | | } |
| | | }); |
| | | sessionStorage["linterid"] = rows.toString(); |
| | | layer.open({ |
| | | type: 2 |
| | | , area: ['50%', '50%'] |
| | | , area: ['40%', '80%'] |
| | | , title: '打印模版选择' |
| | | , shade: 0.6 //遮罩透明度 |
| | | , maxmin: false //允许全屏最小化 |
| | | , anim: 0 //0-6的动画形式,-1不开启 |
| | | , content: ['../../views/BaseSet/SRM_OpenTmpList.html?linterid=' + rows.toString() + '&HBarcode=' + rows2.toString() + '&Type=HBarCodePrint', 'yes'] |
| | | , content: ['../../views/BaseSet/SRM_OpenTmpList.html?linterid=' + sessionStorage["linterid"] + '&HBarcode=&Type=SRM_POOrderBillList', 'yes']// 安瑞 type ='SRM_POOrderBillList' 原type = 'HBarCodePrint' |
| | | , resize: false |
| | | //, cancel: function () { |
| | | // $(".layui-btn").removeClass("layui-btn-disabled"); |
| | | //} |
| | | }) |
| | | } |
| | | //if (OpenTmp != "") |
| | | //{ |
| | | // window.open("../../views/SRM/HBarPlanPrint.html?linterid=" + rows.toString() + "&Type=HBarCodePrint&OpenTmp=" + OpenTmp.toString()); |
| | | // $.ajax( |
| | | // { |
| | | // type: "POST", |
| | | // url: GetWEBURL() + "UpdateBarcodePrintQty", //方法所在页面和方法名 |
| | | // async: true, |
| | | // data: { "msg": rows2 }, |
| | | // dataType: "json", |
| | | // success: function (data) { |
| | | // //if (data.count == 1) { // 说明验证成功了, |
| | | // // layer.msg(data.Message, { icon: 1 }); |
| | | // //} |
| | | // //else { |
| | | // // layer.msg(data.Message, { icon: 5 }); |
| | | // //} |
| | | // layer.closeAll("loading"); |
| | | // }, |
| | | // error: function (err) { |
| | | // f_alert("错误:" + err); |
| | | // } |
| | | // }); |
| | | //} |
| | | break; |
| | | case 'btn-print-Convenient': |
| | | convenientPrint(); |
| | | break; |
| | | case 'btn-Delete': |
| | | var checkStatus = table.checkStatus('mainTable') |
| | |
| | | InterID += data[i].HItemID.toString() + ","; |
| | | } |
| | | InterID = InterID.substring(0, InterID.length - 1) |
| | | |
| | | var oData = JSON.stringify(InterID) + ";" + sessionStorage["HUserName"]; |
| | | |
| | | //逻辑删除方法 |
| | | layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) { |
| | | $.ajax({ |
| | | type: "GET", |
| | | type: "POST", |
| | | url: GetWEBURL() + "/DeltetBarCodeBill", //方法所在页面和方法名 |
| | | data: { "HInterID": InterID, "HUserName": sessionStorage["HUserName"] }, |
| | | data: { "oData": oData}, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () { |
| | |
| | | } |
| | | }); |
| | | }) |
| | | |
| | | |
| | | break; |
| | | case 'btn-HideColumn': |
| | | get_HideColumn(); |
| | | break; |
| | | case 'btn-exit': |
| | | parent.layui.admin.events.closeThisTabs(); |
| | | break; |
| | | }; |
| | | }); |
| | | |
| | | table.on('sort(mainTable)', function (obj) { //注:sort 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值" |
| | | table.reload('mainTable', { |
| | | initSort: obj //记录初始排序,如果不设的话,将无法标记表头的排序状态。 layui 2.1.1 新增参数 |
| | | , where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式) |
| | | field: obj.field //排序字段 在接口作为参数字段 field order |
| | | , order: obj.type //排序方式 在接口作为参数字段 field order |
| | | } |
| | | }); |
| | | option.data = layui.table.cache["mainTable"]; |
| | | table.render(option); |
| | | }); |
| | | |
| | | //行监听事件 |
| | | table.on('row(mainTable)', function (obj) { |
| | | var flag = !obj.tr.find(':checkbox:first').prop('checked'); |
| | | obj.tr.find(':checkbox').prop('checked', flag); |
| | | if (flag) { |
| | | obj.tr.find('.layui-form-checkbox').addClass('layui-form-checked'); //设置复选框选中样式 |
| | | $(obj.tr.selector).attr({ "style": "background:#ceedfa;color:black" });//改变当前tr背景颜色和字体颜色 |
| | | } else { |
| | | obj.tr.find('.layui-form-checkbox').removeClass('layui-form-checked');//取消复选框选中样式 |
| | | $(obj.tr.selector).attr({ "style": "background:" });//取消当前tr颜色 |
| | | } |
| | | //mainTable 为表格ID 注意此处如果ID不正确将导致你在监听复选框时获取不到你选择的数据,前面的只是添加或删除选中未选中样式以及设置背景色,字体颜色 |
| | | layui.each(table.cache.mainTable, function (i, l) { |
| | | if (obj.tr.index() == l.LAY_TABLE_INDEX) { |
| | | l.LAY_CHECKED = flag; |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | ///加载显示数据 |
| | | function RoadHBillNo(sqlWhere) { |
| | | var wait = layer.load();//遮罩 |
| | | where = sqlWhere; |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: GetWEBURL() + "GetBarCodeShowList", |
| | | async: true, |
| | | data: { "HSupNo": sessionStorage["HUserName"], "sqlWhere": sqlWhere }, |
| | | success: function (result) { |
| | | ajaxReturnData = JSON.parse(JSON.stringify(result)).data; |
| | | table.reload('mainTable', { |
| | | data: ajaxReturnData |
| | | , height: 'full-10' |
| | | , page: { |
| | | curr: _cur_page //必须从第 1 页开始 |
| | | } |
| | | , loading: false |
| | | , done: function (index, res) { |
| | | data: { "HSupIDs": sessionStorage["HSupIDs"], "sqlWhere": sqlWhere }, |
| | | success: function (data1) { |
| | | //ajaxReturnData = JSON.parse(JSON.stringify(result)).data; |
| | | //table.reload('mainTable', { |
| | | // data: ajaxReturnData |
| | | // , height: 'full-10' |
| | | // , page: { |
| | | // curr: _cur_page //必须从第 1 页开始 |
| | | // } |
| | | // , loading: false |
| | | // , done: function (index, res) { |
| | | |
| | | // } |
| | | //}); |
| | | if (data1.Message == "获取成功") { |
| | | var data = []; |
| | | var col = []; |
| | | //给空的数组赋值 |
| | | for (var key in data1.list) { |
| | | data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType }); |
| | | } |
| | | }); |
| | | //在列表左边添加勾选框 |
| | | col.push({ type: 'checkbox', fixed: 'left', totalRowText: '合计' }); |
| | | for (var i = 0; i < data.length; i++) { |
| | | // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') { |
| | | if ($.inArray(data[i].name, titleData) > -1) { |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列 |
| | | } |
| | | else if (data[i].name.indexOf('id') > -1) { |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //id列 |
| | | } |
| | | else { |
| | | switch (data[i].Type) { |
| | | //int |
| | | case 'DateTime': |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 }); |
| | | break; |
| | | default: |
| | | if (data[i].name == '订单数量' || data[i].name == '已发货数量' || data[i].name == '未发货数量') { |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, totalRow: true }); |
| | | } else if (data[i].name == '供应商交期回复') { |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, event: 'HSupSendGoodsDateRemark' }); |
| | | } else { |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 }); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //动态显示列名 |
| | | option = { |
| | | elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | | , cols: [col] |
| | | , data: data1.data |
| | | , height: 'full-80' |
| | | , totalRow: true |
| | | , page: true |
| | | , cellMinWidth: 90 |
| | | , limit: 500 |
| | | , limits: [50, 500, 5000, 20000] |
| | | } |
| | | table.render(option); |
| | | //刷新表格数据 |
| | | DisPlay_HideColumn(); |
| | | layer.close(wait); |
| | | } else { |
| | | layer.close(wait); |
| | | layer.alert(data1.Message, { icon: 5 }); |
| | | } |
| | | }, |
| | | error: function (result) { |
| | | console.log(result); |
| | |
| | | }); |
| | | }; |
| | | form.on('submit(f_Query)', function (data) {//查询 |
| | | var sqlWhere = " and 1=1 "; |
| | | var sqlWhere = ""; |
| | | if ($("#HStatus").val() != "") |
| | | sqlWhere += " and 状态 like ^^%" + $("#HStatus").val() + "%^^"; |
| | | if ($("#HBarCode").val() != "") |
| | |
| | | sqlWhere += " and 物料代码 like ^^%" + $("#HNumber").val() + "%^^"; |
| | | if ($("#HName").val() != "") |
| | | sqlWhere += " and 物料名称 like ^^%" + $("#HName").val() + "%^^"; |
| | | if ($("#HSupName").val() != "") |
| | | sqlWhere += " and 供应商 like ^^%" + $("#HSupName").val() + "%^^"; |
| | | if ($("#HModel").val() != "") |
| | | sqlWhere += " and 规格型号 like ^^%" + $("#HModel").val() + "%^^"; |
| | | //if ($("#HClStatus").val() != "") |
| | |
| | | RoadHBillNo(sqlWhere); |
| | | }); |
| | | var $ = layui.$, active = { |
| | | //f_Query: function () { //查询 |
| | | // var sqlWhere = " and 1=1 "; |
| | | // if ($("#HBarCode").val() != "") |
| | | // sqlWhere += " and 条码编号 like ''%" + $("#HBarCode").val() + "%''"; |
| | | // RoadHBillNo(sqlWhere); |
| | | //}, |
| | | }; |
| | | $('.test-table-reload-btn .layui-btn').on('click', function () { |
| | | var type = $(this).data('type'); |
| | | active[type] ? active[type].call(this) : ''; |
| | | }); |
| | | |
| | | //一键打印 |
| | | function convenientPrint() { |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | var rows = ''; |
| | | var rows2 = ''; |
| | | for (var i = 0; i < data.length; i++) { |
| | | rows += data[i].HItemID.toString() + ','; |
| | | rows2 += data[i].条码编号.toString() + ','; |
| | | } |
| | | rows = rows.substring(rows.length - 1, 0); |
| | | rows2 = rows2.substring(rows2.length - 1, 0); |
| | | if (rows == "") { |
| | | layer.msg("至少选择一行记录!") |
| | | } |
| | | else { |
| | | var url = "linteridSession"; |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: GetWEBURL() + url, //方法所在页面和方法名 |
| | | async: true, |
| | | data: { "linterid": rows.toString(), "HUserName": sessionStorage["HUserName"] }, |
| | | dataType: "json", |
| | | success: function (data) { |
| | | layer.closeAll("loading"); |
| | | }, |
| | | error: function (err) { |
| | | layer.alert("错误:" + err, { icon: 5 }); |
| | | } |
| | | }); |
| | | sessionStorage["linterid"] = rows.toString(); |
| | | $.ajax({ |
| | | type: "get", |
| | | url: GetWEBURL() + "/Open_PrintTem/GetDefaultOpenTmp_Json", |
| | | async: true, |
| | | data: { "HNumber": 'SRM_POOrderBillList' }, |
| | | //data: { "Value": Value }, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | var OpenTmp = result.data[0].模板名称 |
| | | window.open("../../views/SRM/HBarPlanPrint.html?linterid=" + sessionStorage["linterid"].toString() + "&Type=SRM_POOrderBillList" + "&OpenTmp=" + OpenTmp.toString()); |
| | | } else { |
| | | layer.msg(result.Message); |
| | | } |
| | | }, |
| | | error: function (result) { |
| | | console.log(result); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | //隐藏列设置 |
| | | function get_HideColumn() { |
| | | var colName = ""; |
| | | for (var i = 1; i < option.cols[0].length - 1; i++) { |
| | | colName += option.cols[0][i]["title"] + ","; |
| | | } |
| | | |
| | | colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI 进行编码 |
| | | layer.open({ |
| | | type: 2 |
| | | , skin: "layui-layer-rim" //加上边框 |
| | | , title: "隐藏列设置" //标题 |
| | | , closeBtn: 1 //窗体右上角关闭 的 样式 |
| | | , shift: 2 //弹出动画 |
| | | , area: ["50%", "90%"] //窗体大小 |
| | | , maxmin: true //设置最大最小按钮是否显示 |
| | | , content: ['../基础资料/隐藏列设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName, "yes"] |
| | | , btn: ["确定", "取消"] |
| | | , btn1: function (index, laero) { |
| | | //刷新表格数据 |
| | | DisPlay_HideColumn(); |
| | | //更新表格缓存的数据 |
| | | layer.close(index);//关闭弹窗 |
| | | } |
| | | }) |
| | | } |
| | | //显示列数据 |
| | | function DisPlay_HideColumn() { |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', |
| | | type: "GET", |
| | | data: { "HModName": HModName, "user": sessionStorage["HUserName"] }, |
| | | success: function (data1) { |
| | | if (data1.data.length != 0) { |
| | | var dataCol = [];//数据库查询出的列数据 |
| | | dataCol = data1.data[0].HGridString.split(','); |
| | | for (var i = 0; i < dataCol.length; i++) { |
| | | var dataCols = dataCol[i].split('|'); |
| | | //隐藏列 |
| | | if (dataCols[1] == 1) { |
| | | option.cols[0][i + 1]["hide"] = true; |
| | | } |
| | | //显示列 |
| | | if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) { |
| | | option.cols[0][i + 1]["hide"] = false; |
| | | } |
| | | //隐藏id |
| | | //设置列宽 |
| | | if (dataCols[3] > 0) { |
| | | if (option.cols[0][i + 1]["field"] == '供应商交期回复') { |
| | | option.cols[0][i + 1]["width"] = 120; |
| | | } else { |
| | | option.cols[0][i + 1]["width"] = dataCols[3]; |
| | | } |
| | | } |
| | | //设置内容字体大小 |
| | | if (data1.data[0].HFontSize != 0) { |
| | | option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;"; |
| | | } else { |
| | | option.cols[0][i + 1]["style"] = "font-size:100%"; |
| | | } |
| | | //设置列宽 |
| | | //if (data1.data[0].HColumnWidth != 0) { |
| | | // option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;"; |
| | | //} else { |
| | | // option.cols[0][i + 1]["width"] = ""; |
| | | //} |
| | | |
| | | //字体所在位置(左 居中 右) |
| | | switch (dataCols[2]) { |
| | | case "L": |
| | | option.cols[0][i + 1]["align"] = "left"; |
| | | break; |
| | | case "M": |
| | | option.cols[0][i + 1]["align"] = "center"; |
| | | break; |
| | | case "R": |
| | | option.cols[0][i + 1]["align"] = "right"; |
| | | break; |
| | | } |
| | | } |
| | | //取消冻结列 |
| | | for (var i = 1; i < option.cols[0].length - 1; i++) { |
| | | if (option.cols[0][i]["fixed"] != null) { |
| | | option.cols[0][i]["fixed"] = null; |
| | | } |
| | | else { |
| | | break; |
| | | } |
| | | } |
| | | //冻结列 |
| | | if (data1.data[0].HFixCols != 0) { |
| | | for (var i = 0; i < data1.data[0].HFixCols; i++) { |
| | | if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) { |
| | | data1.data[0].HFixCols += 1; |
| | | } |
| | | option.cols[0][i + 1]["fixed"] = "left"; |
| | | } |
| | | } |
| | | table.render(option); |
| | | } else { |
| | | table.render(option); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("接口请求失败!", { icon: 5 }); |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | </script> |
| | | </body> |