|  |  |  | 
|---|
|  |  |  | var layDate = layui.laydate; | 
|---|
|  |  |  | var laytpl = layui.laytpl; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 渲染搜索模板 | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl+"/docType/page/auth", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | data: { | 
|---|
|  |  |  | limit: 9999 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | method: 'POST', | 
|---|
|  |  |  | success: function (res) { | 
|---|
|  |  |  | if (res.code === 200){ | 
|---|
|  |  |  | let template = Handlebars.compile($('#docTypeTpl').html()); | 
|---|
|  |  |  | $('#docType-query').html(template(res.data)); | 
|---|
|  |  |  | layui.form.render('select'); | 
|---|
|  |  |  | } else if (res.code === 403){ | 
|---|
|  |  |  | top.location.href = baseUrl+"/"; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | layer.msg(res.msg, {icon: 2}) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | // // 渲染搜索模板 | 
|---|
|  |  |  | // $.ajax({ | 
|---|
|  |  |  | //     url: baseUrl+"/docType/page/auth", | 
|---|
|  |  |  | //     headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | //     data: { | 
|---|
|  |  |  | //         limit: 9999 | 
|---|
|  |  |  | //     }, | 
|---|
|  |  |  | //     method: 'POST', | 
|---|
|  |  |  | //     success: function (res) { | 
|---|
|  |  |  | //         if (res.code === 200){ | 
|---|
|  |  |  | //             let template = Handlebars.compile($('#docTypeTpl').html()); | 
|---|
|  |  |  | //             $('#docType-query').html(template(res.data)); | 
|---|
|  |  |  | //             layui.form.render('select'); | 
|---|
|  |  |  | //         } else if (res.code === 403){ | 
|---|
|  |  |  | //             top.location.href = baseUrl+"/"; | 
|---|
|  |  |  | //         } else { | 
|---|
|  |  |  | //             layer.msg(res.msg, {icon: 2}) | 
|---|
|  |  |  | //         } | 
|---|
|  |  |  | //     } | 
|---|
|  |  |  | // }) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | let docName = getQueryVariable('docName') | 
|---|
|  |  |  | let where = {}; | 
|---|
|  |  |  | if (docName != false) { | 
|---|
|  |  |  | where.docName = decodeURI(docName); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 渲染表格 | 
|---|
|  |  |  | var insTb = table.render({ | 
|---|
|  |  |  | 
|---|
|  |  |  | headers: {token: localStorage.getItem('token')}, | 
|---|
|  |  |  | page: true, | 
|---|
|  |  |  | cellMinWidth: 100, | 
|---|
|  |  |  | where: where, | 
|---|
|  |  |  | limit: 16, | 
|---|
|  |  |  | limits: [16, 30, 50, 100, 200, 500], | 
|---|
|  |  |  | cols: [[ | 
|---|
|  |  |  | 
|---|
|  |  |  | {field: 'maktx', title: '商品名称', width: 160}, | 
|---|
|  |  |  | {field: 'batch', title: '序列码'}, | 
|---|
|  |  |  | {field: 'anfme', title: '数量'}, | 
|---|
|  |  |  | {field: 'qty', title: '作业数量', style: 'font-weight: bold'}, | 
|---|
|  |  |  | // {field: 'unit', title: '单位'}, | 
|---|
|  |  |  | {field: 'workQty', title: '作业数量', style: 'font-weight: bold'}, | 
|---|
|  |  |  | {field: 'qty', title: '完成数量'}, | 
|---|
|  |  |  | // { | 
|---|
|  |  |  | //     field: 'createTime$', title: '创建时间', sort: true, templet: function (d) { | 
|---|
|  |  |  | //         return util.toDateString(d.createTime); | 
|---|
|  |  |  | 
|---|
|  |  |  | area: '1300px', | 
|---|
|  |  |  | success: function (layero, dIndex) { | 
|---|
|  |  |  | $(layero).children('.layui-layer-content').css('overflow', 'visible'); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl + "/docTypeQuery/auth", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | method: 'POST', | 
|---|
|  |  |  | data: { | 
|---|
|  |  |  | condition: decodeURI(docName) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | success: function (res) { | 
|---|
|  |  |  | if (res.code == 200) { | 
|---|
|  |  |  | if (res.data.length > 0) { | 
|---|
|  |  |  | $("#docType").val(res.data[0].id); | 
|---|
|  |  |  | $(document.getElementById("docType$")).val(res.data[0].value) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | var isExpAdd = !expTpe; | 
|---|
|  |  |  | // 回显数据 | 
|---|
|  |  |  | form.val('editForm', expTpe); | 
|---|