| | |
| | | }, |
| | | { |
| | | "type": "text", |
| | | "title": "生产日期", |
| | | "field": "ProductionDate", |
| | | "tid": "configModule.ProductionDate", |
| | | "editable": true, |
| | | "columndisplayeditable": true, |
| | | "columndisplayindexeditable": true, |
| | | "columntitleeditable": true, |
| | | "columnresizable": true, |
| | | "columnaligneditable": true, |
| | | "columns": null |
| | | }, |
| | | { |
| | | "type": "text", |
| | | "title": "总件数", |
| | | "field": "Count", |
| | | "tid": "configModule.Count", |
| | |
| | | }, |
| | | { |
| | | "type": "text", |
| | | "title": "整件数", |
| | | "title": "零头数量", |
| | | "field": "ZeroCount", |
| | | "tid": "configModule.ZeroCount", |
| | | "editable": true, |
| | |
| | | "title": "请验时间", |
| | | "field": "QTTime", |
| | | "tid": "configModule.QTTime", |
| | | "editable": true, |
| | | "columndisplayeditable": true, |
| | | "columndisplayindexeditable": true, |
| | | "columntitleeditable": true, |
| | | "columnresizable": true, |
| | | "columnaligneditable": true, |
| | | "columns": null |
| | | }, |
| | | { |
| | | "type": "text", |
| | | "title": "请验部门", |
| | | "field": "QTDepartment", |
| | | "tid": "configModule.QTDepartment", |
| | | "editable": true, |
| | | "columndisplayeditable": true, |
| | | "columndisplayindexeditable": true, |
| | |
| | | } |
| | | |
| | | //调用打印 |
| | | function openPrintDialog(printData){ |
| | | function openPrintDialog(printData, printType){ |
| | | layer.open({ |
| | | type: 2, |
| | | title: '打印', |
| | | // content: '../../js/hiprint/custom.html', |
| | | content: '/views/SystemSettings/PrintModule.html', |
| | | maxmin: true, |
| | | area: ['100%', '100%'], |
| | |
| | | success: function (layero, index) { |
| | | var body = layer.getChildFrame('body',index); |
| | | body.find('#printData').val(JSON.stringify(printData)); |
| | | body.find('#printType').val(printType); |
| | | } |
| | | }); |
| | | } |
| | |
| | | height: auto; |
| | | line-height: 23px; |
| | | } |
| | | .layui-table-tool-panel{ |
| | | |
| | | .layui-table-tool-panel { |
| | | top: auto; |
| | | bottom: 29px; |
| | | } |
| | | .layui-table-tool{ |
| | | |
| | | .layui-table-tool { |
| | | padding-left: 5px; |
| | | } |
| | | |
| | | /* 表格下拉小箭头隐藏 */ |
| | | .layui-table-grid-down { |
| | | display: none; |
| | |
| | | </style> |
| | | <script> |
| | | // 这里是需要在页面渲染之前执行的代码 |
| | | document.addEventListener("DOMContentLoaded", function() { |
| | | document.addEventListener("DOMContentLoaded", function () { |
| | | //获取table默认显示数 |
| | | pageCntFirst(); |
| | | console.log(pageCnt) |
| | | //判断是否开启table列表列宽调整功能。 |
| | | GetIsSetColW(); |
| | | }); |
| | | </script> |
| | | </script> |
| | | </head> |
| | | |
| | | <body id="body"> |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">入库单号</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" id="ASNNo" name="ASNNo" placeholder="入库单号" |
| | | autocomplete="off" class="layui-input"> |
| | | <input type="text" id="ASNNo" name="ASNNo" placeholder="入库单号" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">客户名称</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" id="CustomerName" name="CustomerName" placeholder="客户名称" autocomplete="off" |
| | | class="layui-input"> |
| | | <input type="text" id="CustomerName" name="CustomerName" placeholder="客户名称" |
| | | autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | <label class="layui-form-label">撤销原因</label> |
| | | <div class="layui-input-inline"> |
| | | <textarea id="Reason" name="Reason" placeholder="请输入内容" class="layui-textarea"></textarea> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <button class="layui-btn layui-btn-sm layuiadmin-btn-list" lay-submit |
| | | lay-filter="LAY-app-contlist-search"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>搜索 |
| | | </button> |
| | | </div> |
| | | |
| | | |
| | | <!-- 维护备注弹框 --> |
| | | <div class="layui-inline" id="divEditDemo" style="display: none; padding-top: 10px;"> |
| | | <label class="layui-form-label">备注</label> |
| | | <div class="layui-input-inline" style="width: 300px;height: 100%;"> |
| | | <textarea placeholder="请输入内容" id="NoticeDemo" name="NoticeDemo" class="layui-textarea"></textarea> |
| | | <textarea placeholder="请输入内容" id="NoticeDemo" name="NoticeDemo" |
| | | class="layui-textarea"></textarea> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="center"> |
| | | <div id="center"> |
| | | </div> |
| | | |
| | | <div class="layui-card-body"> |
| | |
| | | default : |
| | | break; |
| | | } |
| | | html += `<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="Print"> |
| | | <i class="layui-icon layui-icon-print"></i>打印</a>`; |
| | | html += `<a class="layui-btn layui-btn-normal layui-btn-xs editDemoClass" lay-event="editDemo"> |
| | | <i class="layui-icon layui-icon-edit"></i>备注</a>`; |
| | | return html; |
| | |
| | | <i class="layui-icon"></i>添加 |
| | | </button> |
| | | </script> |
| | | |
| | | |
| | | <script type="text/html" id="toolbarDemoList"> |
| | | {{# function GetBtn2(d){ |
| | | var html = ``; |
| | |
| | | html = `<a class="layui-btn layui-btn-danger layui-btn-xs delClass" lay-event="del"> |
| | | <i class="layui-icon layui-icon-delete"></i>删除</a>`; |
| | | } |
| | | html += `<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="Print"> |
| | | <i class="layui-icon layui-icon-print"></i>打印</a>`; |
| | | return html; |
| | | } |
| | | }} |
| | |
| | | }).extend({ |
| | | index: 'lib/index' //主入口模块 |
| | | }).use(['index', 'table', 'laypage', 'layer', 'laydate'], function () { |
| | | |
| | | |
| | | var doing = true; |
| | | |
| | | |
| | | var table = layui.table, |
| | | form = layui.form, |
| | | laypage = layui.laypage, |
| | | layer = layui.layer; |
| | | |
| | | |
| | | laydate = layui.laydate; |
| | | |
| | | laydate.render({ |
| | |
| | | var h1 = GetTableTopHeight(); |
| | | var h2 = GetTableBottomHeight(); |
| | | |
| | | |
| | | |
| | | refreshTable(); |
| | | refreshTablemx("单号"); |
| | | refreshTablemx("单号"); |
| | | //渲染总单 |
| | | //#region 自定义表头 |
| | | var TotalColsArr = [[ |
| | | {field: '',title: '序号',type:'numbers',width: 50,align: 'center',fixed: 'left', "disabled": true}, |
| | | {field: 'ASNNo',title: '入库单号',align: 'center',fixed: 'left',sort: true,width: 180, "disabled": true}, |
| | | {field: 'Status',title: '执行状态',align: 'center',templet: '#buttonTpl'}, |
| | | {field: 'Origin',title: '来源',align: 'center',width: 80}, |
| | | {field: 'CustomerName',title: '客户名称',align: 'center'}, |
| | | {field: 'Type',title: '单据类型',align: 'center',templet: '#templetType'}, |
| | | {field: 'CompleteTime',title: '完成时间',align: 'center',templet: '#templetCompleteTime'}, |
| | | {field: 'Demo',title: '备注',align: 'center',width: 180}, |
| | | {field: 'CreateUserName',title: '创建人',align: 'center',width: 110}, |
| | | {field: 'CreateTime',title: '创建时间',align: 'center',templet: '#templetCreateTime'}, |
| | | {field: 'UpdateUserName',title: '修改人',align: 'center',width: 110}, |
| | | {field: 'UpdateTime',title: '修改时间',align: 'center',templet: '#templetUpdateTime'}, |
| | | {field: 'caozuo',title: '操作',fixed: 'right',width: 280,align: 'center',toolbar: '#toolbarDemo1', "disabled": true} |
| | | ]]; |
| | | var TotalColsSysArr=encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//将表头数据进行url编码 |
| | | { field: '', title: '序号', type: 'numbers', width: 50, align: 'center', fixed: 'left', "disabled": true }, |
| | | { field: 'ASNNo', title: '入库单号', align: 'center', fixed: 'left', sort: true, width: 180, "disabled": true }, |
| | | { field: 'Status', title: '执行状态', align: 'center', templet: '#buttonTpl' }, |
| | | { field: 'Origin', title: '来源', align: 'center', width: 80 }, |
| | | { field: 'CustomerName', title: '客户名称', align: 'center' }, |
| | | { field: 'Type', title: '单据类型', align: 'center', templet: '#templetType' }, |
| | | { field: 'CompleteTime', title: '完成时间', align: 'center', templet: '#templetCompleteTime' }, |
| | | { field: 'Demo', title: '备注', align: 'center', width: 180 }, |
| | | { field: 'CreateUserName', title: '创建人', align: 'center', width: 110 }, |
| | | { field: 'CreateTime', title: '创建时间', align: 'center', templet: '#templetCreateTime' }, |
| | | { field: 'UpdateUserName', title: '修改人', align: 'center', width: 110 }, |
| | | { field: 'UpdateTime', title: '修改时间', align: 'center', templet: '#templetUpdateTime' }, |
| | | { field: 'caozuo', title: '操作', fixed: 'right', width: 280, align: 'center', toolbar: '#toolbarDemo1', "disabled": true } |
| | | ]]; |
| | | var TotalColsSysArr = encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//将表头数据进行url编码 |
| | | //#endregion |
| | | function refreshTable() { |
| | | //#region 原始非自定义列 |
| | |
| | | // cellMinWidth: 60, //全局定义常规单元格的最小宽度,layui 2.2.1 新增 |
| | | // done: function(res) { |
| | | // setRight(); |
| | | |
| | | |
| | | // //aaa = $('#LAY-app-content-list').next().find('.layui-table-main').find('tr[data-index="0"]').find('td[data-field="ASNNo"]'); |
| | | // // refreshTablemx(res.data[0].ASNNo); |
| | | // }, |
| | |
| | | |
| | | //#region 自定义表头 |
| | | var colsJson |
| | | var param1={ |
| | | Href:'BllAsn/GetArrivalNoticeList' |
| | | var param1 = { |
| | | Href: 'BllAsn/GetArrivalNoticeList' |
| | | }; |
| | | sendData(IP + "/Sys/GetTableColsByUserId", param1, 'post', function(res) { |
| | | if (res.code == 0){ |
| | | if(res.data=='' || res.data==undefined || res.data==null){ |
| | | colsJson=TotalColsArr |
| | | }else{ |
| | | colsJson= eval(res.data); |
| | | sendData(IP + "/Sys/GetTableColsByUserId", param1, 'post', function (res) { |
| | | if (res.code == 0) { |
| | | if (res.data == '' || res.data == undefined || res.data == null) { |
| | | colsJson = TotalColsArr |
| | | } else { |
| | | colsJson = eval(res.data); |
| | | } |
| | | }else{ |
| | | colsJson=TotalColsArr |
| | | } else { |
| | | colsJson = TotalColsArr |
| | | } |
| | | var param = { |
| | | ASNNo: $("#ASNNo").val(), |
| | |
| | | LotNo: $("#LotNo").val(), |
| | | SkuNo: $("#SkuNo").val(), |
| | | SkuName: $("#SkuName").val(), |
| | | StartTime:$("#StartTime").val(), |
| | | StartTime: $("#StartTime").val(), |
| | | EndTime: $("#EndTime").val() |
| | | }; |
| | | table.render({ |
| | |
| | | id: 'LAY-app-content-list', |
| | | where: param, |
| | | contentType: 'application/json', |
| | | headers:{ToKen:$.cookie('token')}, |
| | | headers: { ToKen: $.cookie('token') }, |
| | | page: true, |
| | | even: true, |
| | | limit: pageCnt, |
| | | limits: pageLimits, |
| | | cellMinWidth: 60, //全局定义常规单元格的最小宽度,layui 2.2.1 新增 |
| | | done: function(res) { |
| | | setRight(); |
| | | done: function (res) { |
| | | setRight(); |
| | | //自定义列宽 |
| | | SetTableColW('LAY-app-content-list','BllAsn/GetArrivalNoticeList',TotalColsSysArr); |
| | | SetTableColW('LAY-app-content-list', 'BllAsn/GetArrivalNoticeList', TotalColsSysArr); |
| | | }, |
| | | cols: colsJson |
| | | }); |
| | |
| | | //#endregion |
| | | } |
| | | // 入库单table单机事件 |
| | | table.on('row(LAY-app-content-list)', function(obj) { |
| | | table.on('row(LAY-app-content-list)', function (obj) { |
| | | refreshTablemx(obj.data.ASNNo); |
| | | }); |
| | | //渲染明细 |
| | | //渲染明细 |
| | | //#region 自定义表头 |
| | | var DetailColsArr = [[ |
| | | {field: '',title: '序号',type:'numbers',width: 50,align: 'center',fixed: 'left', "disabled": true}, |
| | | {field: 'ASNNo',title: '入库单号',align: 'center',fixed: 'left',sort: true,width: 180, "disabled": true}, |
| | | {field: 'SkuNo',title: '物料编码',align: 'center',width: 100}, |
| | | {field: 'SkuName',title: '物料名称',align: 'center',width: 200}, |
| | | {field: 'Standard',title: '物料规格',align: 'center',width: 130}, |
| | | {field: 'LotNo',title: '批次号',align: 'center',width: 100}, |
| | | {field: 'SupplierLot',title: '供货批次',align: 'center',width: 100}, |
| | | {field: 'Qty',title: '数量',align: 'center',width: 70}, |
| | | {field: 'FactQty',title: '已组数量',align: 'center',width: 90}, |
| | | {field: 'CompleteQty',title: '完成数量',align: 'center',width: 90}, |
| | | {field: 'CompleteTime',title: '完成时间',align: 'center', width: 160,templet: '#templetCompleteTime2'}, |
| | | {field: 'UnitName',title: '计量单位',align: 'center',width: 90}, |
| | | {field: 'Price',title: '单价',align: 'center',width: 65}, |
| | | {field: 'Money',title: '金额',align: 'center',width: 65}, |
| | | {field: 'LotText',title: '批次描述',align: 'center',width: 120}, |
| | | {field: 'PackagName',title: '包装名称',align: 'center',width: 110,}, |
| | | {field: 'IsBale',title: '是否裹包',align: 'center',width: 150}, |
| | | {field: 'IsBelt',title: '是否打带',align: 'center',width: 150}, |
| | | {field: 'UDF1',title: '自定义列1',align: 'center',width: 140}, |
| | | {field: 'UDF2',title: '自定义列2',align: 'center',width: 140}, |
| | | {field: 'UDF3',title: '自定义列3',align: 'center',width: 140}, |
| | | {field: 'UDF4',title: '自定义列4',align: 'center',width: 140}, |
| | | {field: 'UDF5',title: '自定义列5',align: 'center',width: 140,templet:'#templetUDF5'}, |
| | | {field: 'CreateUserName',title: '创建人',align: 'center',width: 100}, |
| | | {field: 'CreateTime',title: '创建时间',align: 'center',width: 160,templet: '#templetCreateTime2'}, |
| | | {field: 'UpdateUserName',title: '修改人',align: 'center',width: 150,}, |
| | | {field: 'UpdateTime',title: '修改时间',align: 'center',width: 150,templet: '#templetUpdateTime3'}, |
| | | {field: 'caozuo',title: '操作',fixed: 'right',width: 100,align: 'left',toolbar: '#toolbarDemoList', "disabled": true} |
| | | ]]; |
| | | var DetailColsSysArr=encodeURIComponent(encodeURIComponent(JSON.stringify(DetailColsArr)))//将表头数据进行url编码 |
| | | { field: '', title: '序号', type: 'numbers', width: 50, align: 'center', fixed: 'left', "disabled": true }, |
| | | { field: 'ASNNo', title: '入库单号', align: 'center', fixed: 'left', sort: true, width: 180, "disabled": true }, |
| | | { field: 'SkuNo', title: '物料编码', align: 'center', width: 100 }, |
| | | { field: 'SkuName', title: '物料名称', align: 'center', width: 200 }, |
| | | { field: 'Standard', title: '物料规格', align: 'center', width: 130 }, |
| | | { field: 'LotNo', title: '批次号', align: 'center', width: 100 }, |
| | | { field: 'SupplierLot', title: '供货批次', align: 'center', width: 100 }, |
| | | { field: 'Qty', title: '数量', align: 'center', width: 70 }, |
| | | { field: 'FactQty', title: '已组数量', align: 'center', width: 90 }, |
| | | { field: 'CompleteQty', title: '完成数量', align: 'center', width: 90 }, |
| | | { field: 'CompleteTime', title: '完成时间', align: 'center', width: 160, templet: '#templetCompleteTime2' }, |
| | | { field: 'UnitName', title: '计量单位', align: 'center', width: 90 }, |
| | | { field: 'Price', title: '单价', align: 'center', width: 65 }, |
| | | { field: 'Money', title: '金额', align: 'center', width: 65 }, |
| | | { field: 'LotText', title: '批次描述', align: 'center', width: 120 }, |
| | | { field: 'PackagName', title: '包装名称', align: 'center', width: 110, }, |
| | | { field: 'IsBale', title: '是否裹包', align: 'center', width: 150 }, |
| | | { field: 'IsBelt', title: '是否打带', align: 'center', width: 150 }, |
| | | { field: 'UDF1', title: '自定义列1', align: 'center', width: 140 }, |
| | | { field: 'UDF2', title: '自定义列2', align: 'center', width: 140 }, |
| | | { field: 'UDF3', title: '自定义列3', align: 'center', width: 140 }, |
| | | { field: 'UDF4', title: '自定义列4', align: 'center', width: 140 }, |
| | | { field: 'UDF5', title: '自定义列5', align: 'center', width: 140, templet: '#templetUDF5' }, |
| | | { field: 'CreateUserName', title: '创建人', align: 'center', width: 100 }, |
| | | { field: 'CreateTime', title: '创建时间', align: 'center', width: 160, templet: '#templetCreateTime2' }, |
| | | { field: 'UpdateUserName', title: '修改人', align: 'center', width: 150, }, |
| | | { field: 'UpdateTime', title: '修改时间', align: 'center', width: 150, templet: '#templetUpdateTime3' }, |
| | | { field: 'caozuo', title: '操作', fixed: 'right', width: 100, align: 'left', toolbar: '#toolbarDemoList', "disabled": true } |
| | | ]]; |
| | | var DetailColsSysArr = encodeURIComponent(encodeURIComponent(JSON.stringify(DetailColsArr)))//将表头数据进行url编码 |
| | | //#endregion |
| | | function refreshTablemx(asnNo) { |
| | | //#region 原始非自定义列 |
| | |
| | | |
| | | //#region 自定义表头 |
| | | var colsJson2 |
| | | var param1={ |
| | | Href:'BllAsn/GetArrivalNoticeDetailList' |
| | | var param1 = { |
| | | Href: 'BllAsn/GetArrivalNoticeDetailList' |
| | | }; |
| | | sendData(IP + "/Sys/GetTableColsByUserId", param1, 'post', function(res) { |
| | | if (res.code == 0){ |
| | | if(res.data=='' || res.data==undefined || res.data==null){ |
| | | colsJson2=DetailColsArr |
| | | }else{ |
| | | colsJson2= eval(res.data); |
| | | sendData(IP + "/Sys/GetTableColsByUserId", param1, 'post', function (res) { |
| | | if (res.code == 0) { |
| | | if (res.data == '' || res.data == undefined || res.data == null) { |
| | | colsJson2 = DetailColsArr |
| | | } else { |
| | | colsJson2 = eval(res.data); |
| | | } |
| | | } else { |
| | | colsJson2 = DetailColsArr |
| | | } |
| | | }else{ |
| | | colsJson2=DetailColsArr |
| | | } |
| | | var param = { |
| | | ASNNo:asnNo |
| | | }; |
| | | table.render({ |
| | | var param = { |
| | | ASNNo: asnNo |
| | | }; |
| | | table.render({ |
| | | elem: '#LAY-app-content-list2', |
| | | url: IP + "/BllAsn/GetArrivalNoticeDetailList", |
| | | method: 'POST', |
| | |
| | | id: 'LAY-app-content-list2', |
| | | where: param, |
| | | contentType: 'application/json', |
| | | toolbar:'#toolbarDemo', |
| | | defaultToolbar: [], //'filter','print', 'exports' |
| | | headers:{ToKen:$.cookie('token')}, |
| | | toolbar: '#toolbarDemo', |
| | | defaultToolbar: [], //'filter','print', 'exports' |
| | | headers: { ToKen: $.cookie('token') }, |
| | | page: true, |
| | | limit: pageCnt, |
| | | limits: pageLimits, |
| | | cellMinWidth: 60, //全局定义常规单元格的最小宽度,layui 2.2.1 新增 |
| | | done: function() { |
| | | done: function () { |
| | | setRight() |
| | | //自定义列宽 |
| | | SetTableColW('LAY-app-content-list2','BllAsn/GetArrivalNoticeDetailList',DetailColsSysArr); |
| | | }, |
| | | SetTableColW('LAY-app-content-list2', 'BllAsn/GetArrivalNoticeDetailList', DetailColsSysArr); |
| | | }, |
| | | cols: colsJson2 |
| | | }); |
| | | }); |
| | | //#endregion |
| | | } |
| | | |
| | | function setRight() |
| | | { |
| | | $(function() { |
| | | function setRight() { |
| | | $(function () { |
| | | $(".addClass").hide(); |
| | | $(".editClass").hide(); |
| | | $(".delClass").hide(); |
| | | $(".cheXiaoClass").hide(); |
| | | $(".clossClass").hide(); |
| | | $(".delClass").hide(); |
| | | $(".cheXiaoClass").hide(); |
| | | $(".clossClass").hide(); |
| | | $(".editDemoClass").hide();//备注 |
| | | }); |
| | | sendData(IP + "/Basis/GetRoleRightList", {}, 'get', function(res) { |
| | | sendData(IP + "/Basis/GetRoleRightList", {}, 'get', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | for (var k = 0; k < res.data.length; k++) { |
| | | if (res.data[k].MenuName == "添加入库单") { |
| | | $(function() { |
| | | $(function () { |
| | | $(".addClass").show(); |
| | | }); |
| | | } |
| | | if (res.data[k].MenuName == "编辑入库单") { |
| | | $(function() { |
| | | $(function () { |
| | | $(".editClass").show(); |
| | | }); |
| | | } |
| | | if (res.data[k].MenuName == "删除入库单") { |
| | | $(function() { |
| | | $(".delClass").show(); |
| | | $(function () { |
| | | $(".delClass").show(); |
| | | }); |
| | | } |
| | | if (res.data[k].MenuName == "撤销入库单") { |
| | | $(function() { |
| | | $(".cheXiaoClass").show(); |
| | | $(function () { |
| | | $(".cheXiaoClass").show(); |
| | | }); |
| | | } |
| | | if (res.data[k].MenuName == "关闭入库单") { |
| | | $(function() { |
| | | $(".clossClass").show(); |
| | | $(function () { |
| | | $(".clossClass").show(); |
| | | }); |
| | | } |
| | | if (res.data[k].MenuName == "维护入库单备注") { |
| | | $(function() { |
| | | $(".editDemoClass").show(); |
| | | $(function () { |
| | | $(".editDemoClass").show(); |
| | | }); |
| | | } |
| | | } |
| | |
| | | layer.msg('获取权限信息失败', { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function() {}); |
| | | }, function () { }); |
| | | } |
| | | }); |
| | | } |
| | |
| | | // 页面监控,点击查询加载入库总单 |
| | | form.on('submit(LAY-app-contlist-search)', function (data) { |
| | | refreshTable(); |
| | | refreshTablemx("单号"); |
| | | refreshTablemx("单号"); |
| | | }); |
| | | |
| | | table.on('toolbar(LAY-app-content-list2)', function(obj){ |
| | | if (obj.event == "add") { |
| | | |
| | | table.on('toolbar(LAY-app-content-list2)', function (obj) { |
| | | if (obj.event == "add") { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '添加入库单据', |
| | |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | var ImportId = 0; |
| | | table.on('tool(LAY-app-content-list)', function (obj) { |
| | | var data = obj.data; |
| | | switch(obj.event) |
| | | { |
| | | case "edit" : |
| | | switch (obj.event) { |
| | | case "edit": |
| | | // 代码区域 |
| | | var id = data.ASNNo; |
| | | layer.open({ |
| | |
| | | area: ['70%', '90%'] |
| | | }); |
| | | break; |
| | | case "del" : |
| | | layer.confirm('确定删除此单据吗?', function(index) { |
| | | case "del": |
| | | layer.confirm('确定删除此单据吗?', function (index) { |
| | | // 代码区域 |
| | | var param = { |
| | | ASNNo:data.ASNNo, |
| | | ASNNo: data.ASNNo, |
| | | }; |
| | | sendData(IP + "/BllAsn/DelArrivalNotice", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { |
| | | refreshTable(); |
| | | refreshTablemx("单号"); |
| | | refreshTablemx("单号"); |
| | | doing = true |
| | | }); |
| | | } else { //不成功 |
| | |
| | | }, function () { doing = true }); |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | break; |
| | | case "closs" : |
| | | case "closs": |
| | | // 代码区域 |
| | | layer.confirm('确定关闭此单据吗?', function(index) { |
| | | layer.confirm('确定关闭此单据吗?', function (index) { |
| | | // 代码区域 |
| | | var param = { |
| | | Id:data.Id, |
| | | Id: data.Id, |
| | | }; |
| | | sendData(IP + "/UpApi/FinishAsn", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | |
| | | }, function () { doing = true }); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | }); |
| | | |
| | | break; |
| | | case "chexiao" : |
| | | case "chexiao": |
| | | layer.open({ |
| | | type: 1, |
| | | title: '撤销申请', |
| | | content: $('#divReason'), |
| | | maxmin: true, |
| | | area: ['300px','265px'], |
| | | area: ['300px', '265px'], |
| | | btn: ['确定', '取消'], |
| | | yes: function(index, layero) { |
| | | yes: function (index, layero) { |
| | | var pa = $('#Reason').val(); |
| | | if (doing== true) { |
| | | doing= false; |
| | | |
| | | if (doing == true) { |
| | | doing = false; |
| | | |
| | | var param = { |
| | | Id: data.Id, |
| | | Id: data.Id, |
| | | Reason: pa, |
| | | }; |
| | | console.log(param); |
| | | sendData(IP + "/BllAsn/CancelOrder", param, 'get', function(res) { |
| | | sendData(IP + "/BllAsn/CancelOrder", param, 'get', function (res) { |
| | | console.log(res); |
| | | if (res.code == 0) { //成功 |
| | | layer.msg(res.msg, { |
| | | icon: 1, |
| | | time: 3000 //1秒关闭(如果不配置,默认是3秒) |
| | | }, function() { |
| | | }, function () { |
| | | refreshTable(); |
| | | doing= true; |
| | | doing = true; |
| | | }); |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 3000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function() { |
| | | }, function () { |
| | | refreshTable(); |
| | | doing= true; |
| | | doing = true; |
| | | }); |
| | | } |
| | | layer.close(index); |
| | | }); |
| | | }else{ |
| | | } else { |
| | | layer.msg("请勿重复点击", { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | | }); |
| | | |
| | | }); |
| | | |
| | | break; |
| | | case "editDemo" : |
| | | case "editDemo": |
| | | $('#NoticeDemo').val(data.Demo); |
| | | layer.open({ |
| | | type: 1, |
| | | title: '维护备注', |
| | | content: $('#divEditDemo'), |
| | | maxmin: false, |
| | | area: ['420px','260px'], |
| | | area: ['420px', '260px'], |
| | | btn: ['确定', '取消'], |
| | | yes: function(index, layero) { |
| | | yes: function (index, layero) { |
| | | var demo = $('#NoticeDemo').val(); |
| | | var param = { |
| | | id: data.Id, |
| | | demo: demo, |
| | | }; |
| | | sendData(IP + "/BllAsn/EditNoticeDemo", param, 'get', function(res) { |
| | | sendData(IP + "/BllAsn/EditNoticeDemo", param, 'get', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | refreshTable(); |
| | | layer.msg(res.msg, { |
| | | icon: 1, |
| | | time: 1500 //1秒关闭(如果不配置,默认是3秒) |
| | | }, function() { |
| | | |
| | | }, function () { |
| | | |
| | | }); |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 3000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function() { |
| | | }, function () { |
| | | refreshTable(); |
| | | }); |
| | | } |
| | | layer.close(index); |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | default:break; |
| | | case "Print": |
| | | console.log(data); |
| | | var param = { |
| | | limit: 1000, |
| | | page: 1, |
| | | ASNNo: data.ASNNo |
| | | }; |
| | | sendData(IP + "/BllAsn/GetArrivalNoticeDetailList", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | data.ArrivalNoticeDetail = res.data; |
| | | openPrintDialog(data, 'ArrivalNotice'); |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { doing = true }); |
| | | } |
| | | }); |
| | | break; |
| | | default: break; |
| | | } |
| | | }); |
| | | //明细表操作栏事件 |
| | | table.on('tool(LAY-app-content-list2)', function (obj) { |
| | | var data = obj.data; |
| | | switch(obj.event) |
| | | { |
| | | case "del" : |
| | | layer.confirm('确定删除入库单明细吗?', function(index) { |
| | | switch (obj.event) { |
| | | case "del": |
| | | layer.confirm('确定删除入库单明细吗?', function (index) { |
| | | // 代码区域 |
| | | var param = { |
| | | ASNNo:data.ASNNo, |
| | | Id:data.Id, |
| | | }; |
| | | ASNNo: data.ASNNo, |
| | | Id: data.Id, |
| | | }; |
| | | sendData(IP + "/BllAsn/DelArrivalNoticeDetail", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | layer.msg(res.msg, { |
| | |
| | | }, function () { doing = true }); |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | break; |
| | | default:break; |
| | | case "Print": |
| | | console.log(data); |
| | | openPrintDialog(data, 'MaterialLabel'); |
| | | break; |
| | | default: break; |
| | | } |
| | | }); |
| | | |
| | | //#region 自定义表头 |
| | | //自定义表头 |
| | | active = { |
| | | customCols: function(){ |
| | | customCols: function () { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '自定义列', |
| | | content: '../SystemSettings/HeaderSetting.html?Href=BllAsn/GetArrivalNoticeList&ColsSysArr='+TotalColsSysArr, |
| | | content: '../SystemSettings/HeaderSetting.html?Href=BllAsn/GetArrivalNoticeList&ColsSysArr=' + TotalColsSysArr, |
| | | maxmin: false, |
| | | resize: false, |
| | | area: ['970px', '650px'] |
| | | }); |
| | | }, |
| | | customCols2: function(){ |
| | | customCols2: function () { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '自定义列', |
| | | content: '../SystemSettings/HeaderSetting.html?Href=BllAsn/GetArrivalNoticeDetailList&ColsSysArr='+DetailColsSysArr, |
| | | content: '../SystemSettings/HeaderSetting.html?Href=BllAsn/GetArrivalNoticeDetailList&ColsSysArr=' + DetailColsSysArr, |
| | | maxmin: false, |
| | | resize: false, |
| | | area: ['970px', '650px'] |
| | |
| | | } |
| | | |
| | | }; |
| | | $('.layui-btn').on('click', function() { |
| | | $('.layui-btn').on('click', function () { |
| | | var type = $(this).data('type'); |
| | | active[type] ? active[type].call(this) : ''; |
| | | }); |
| | |
| | | html += `<a class="layui-btn layui-btn-normal layui-btn-xs shangClass" lay-event="xml"> |
| | | <i class="layui-icon layui-icon-ok"></i>XML |
| | | </a>`; |
| | | html += `<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="Print"> |
| | | <i class="layui-icon layui-icon-print"></i>打印</a>`; |
| | | html += `<a class="layui-btn layui-btn-normal layui-btn-xs editDemoClass" lay-event="editDemo"> |
| | | <i class="layui-icon layui-icon-edit"></i>备注</a>`; |
| | | return html; |
| | |
| | | } |
| | | }); |
| | | } |
| | | else if(obj.event === 'Print'){ |
| | | console.log(data); |
| | | var param = { |
| | | limit: 1000, |
| | | page: 1, |
| | | SONo: data.SONo |
| | | }; |
| | | sendData(IP + "/BllSo/GetExportNoticeDetailList", param, 'post', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | data.ExportNoticeDetail = res.data; |
| | | openPrintDialog(data, 'ExportNotice'); |
| | | } else { //不成功 |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { doing = true }); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | table.on('tool(LAY-app-content-list2)', function(obj) { |
| | |
| | | <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" type="text/css" href="../../js/HiPrint/css/hiprint.css?t=' + Math.random() + '" /> |
| | | <link rel="stylesheet" type="text/css" href="../../js/HiPrint/css/print-lock.css" /> |
| | | <link rel="stylesheet" media="print" href="../../js/HiPrint/css/print-lock.css" /> |
| | | <!-- <link rel="stylesheet" type="text/css" href="../../js/HiPrint/css/bootstrap.min.css" > --> |
| | | <style> |
| | | .layui-form-label { |
| | |
| | | <body> |
| | | <div class="layui-card"> |
| | | <input type="hidden" id="printData" name="printData"> |
| | | <input type="hidden" id="printType" name="printType"> |
| | | <div class="row"> |
| | | |
| | | <!--左侧div--> |
| | |
| | | <script src="../../js/jquery-3.5.1.min.js"></script> |
| | | <script src="../../js/jquery.cookie.js"></script> |
| | | <script src="../../js/hiprint/content/bootstrap.min.js"></script> |
| | | <script src="../../js/HiPrint/hiprint.bundle.js?t=' + Math.random() + '"></script> |
| | | <script src="../../js/HiPrint/polyfill.min.js"></script> |
| | | <script src="../../js/HiPrint/plugins/jquery.minicolors.min.js"></script> |
| | | <script src="../../js/HiPrint/plugins/JsBarcode.all.min.js"></script> |
| | | <script src="../../js/HiPrint/plugins/qrcode.js"></script> |
| | | <script src="../../js/HiPrint/hiprint.bundle.js"></script> |
| | | <script src="../../js/HiPrint/plugins/jquery.hiwprint.js"></script> |
| | | <script src="../../js/HiPrint/plugins/socket.io.js"></script> |
| | | <!-- <script src="../../js/HiPrint/plugins/socket.io.js"></script> --> |
| | | <script src="../../js/HiPrint/plugins/config-etype-provider.js"></script> |
| | | <script src="../../js/HiPrint/plugins/jspdf/canvas2image.js"></script> |
| | | <script src="../../js/HiPrint/plugins/jspdf/canvg.min.js"></script> |
| | | <script src="../../js/HiPrint/plugins/jspdf/html2canvas.min.js"></script> |
| | | <script src="../../js/HiPrint/plugins/jspdf/jspdf.min.js"></script> |
| | | <script src="../../js/HiPrint/plugins/print-data-list.js"></script> |
| | | <script src="../../js/HiPrint/hiprint.config.js"></script> |
| | | <script src="../../layuiadmin/layui/layui.js"></script> |
| | | <script src="../../js/public.js"></script> |
| | | <script> |
| | | var configPrintJson; |
| | | |
| | | var datalist = []; |
| | | //初始化打印插件渲染 |
| | | $(".hiprintEpContainer").html(""); //清除div内容 |
| | | |
| | | hiprint.init({ |
| | | providers: [new configElementTypeProvider()] |
| | | }); |
| | | //设置左侧拖拽事件 |
| | | hiprint.PrintElementTypeManager.build('.hiprintEpContainer', 'testModule'); |
| | | |
| | | |
| | | var hiprintTemplate; |
| | | // var JsonData = JSON.parse('{"panels":[{"index":0,"height":50,"width":50,"paperHeader":0,"paperFooter":141.73228346456693,"printElements":[{"tid":"configModule.SkuName","options":{"left":9,"top":12,"height":9.75,"width":120}},{"tid":"configModule.SkuNo","options":{"left":9,"top":37.5,"height":78,"width":120,"textType":"qrcode"}}],"paperNumberLeft":178.5,"paperNumberTop":123}]}') |
| | | var JsonData = {}; |
| | | synData(IP + "/sys/GetDefaultPrintTemplate", {}, 'get', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | JsonData = JSON.parse(res.data.PositionJson); |
| | | $("#customWidth").val(JsonData.panels[0].width); |
| | | $("#customHeight").val(JsonData.panels[0].height); |
| | | hiprintTemplate = new hiprint.PrintTemplate({ |
| | | template: JsonData,//模板JSON |
| | | settingContainer: '#PrintElementOptionSetting', |
| | | paginationContainer: '.hiprint-printPagination' |
| | | }); |
| | | setTimeout(function () { |
| | | var printType = $("#printType").val(); |
| | | datalist = getPrintDataList()(printType); |
| | | synData(IP + "/sys/GetDefaultPrintTemplate?Type=" + printType, {}, 'get', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | hiprint.init({ |
| | | providers: [new configElementTypeProvider()] |
| | | }); |
| | | //设置左侧拖拽事件 |
| | | hiprint.PrintElementTypeManager.build('.hiprintEpContainer', 'testModule'); |
| | | JsonData = JSON.parse(res.data.PositionJson); |
| | | $("#customWidth").val(JsonData.panels[0].width); |
| | | $("#customHeight").val(JsonData.panels[0].height); |
| | | hiprintTemplate = new hiprint.PrintTemplate({ |
| | | template: JsonData,//模板JSON |
| | | settingContainer: '#PrintElementOptionSetting', |
| | | paginationContainer: '.hiprint-printPagination' |
| | | }); |
| | | |
| | | //打印设计 |
| | | hiprintTemplate.design('#hiprint-printTemplate'); |
| | | //打印设计 |
| | | hiprintTemplate.design('#hiprint-printTemplate'); |
| | | |
| | | //打印 |
| | | setTimeout(function () { |
| | | //打印 |
| | | //这里获取上级页面的printData数据打印 |
| | | // var printData = deepClone(parent.printData); |
| | | var printData = JSON.parse($("#printData").val()); |
| | | hiprintTemplate.print(printData,'打印'); |
| | | hiprintTemplate.print(printData, '打印'); |
| | | parent.layer.closeAll(); |
| | | }, 100); |
| | | } |
| | | else //不成功 |
| | | { |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { parent.layer.closeAll(); }); |
| | | } |
| | | }); |
| | | } |
| | | else //不成功 |
| | | { |
| | | layer.msg(res.msg, { |
| | | icon: 2, |
| | | time: 2000 //2秒关闭(如果不配置,默认是3秒) |
| | | }, function () { parent.layer.closeAll(); }); |
| | | } |
| | | }); |
| | | }, 100); |
| | | |
| | | |
| | | |
| | | $('#directPrint').click(function () { |
| | | hiprintTemplate.print(printData); |
| | | }); |
| | | var datalist = []; |
| | | </script> |
| | | </body> |
| | | |
| | |
| | | }); |
| | | |
| | | // //测试打印 |
| | | // printData = [{ |
| | | // SkuNo: '000001', |
| | | // SkuName: '测试物料1', |
| | | // Standard: 'xxxxxx', |
| | | // LotNo: '20230801', |
| | | // Qty: 100 |
| | | // }, { |
| | | // SkuNo: '000002', |
| | | // SkuName: '测试物料2', |
| | | // Standard: 'xxxxxx', |
| | | // LotNo: '20230801', |
| | | // Qty: 100 |
| | | // }]; |
| | | // openPrintDialog(printData) |
| | | // printData = { |
| | | // Id: 4052, |
| | | // ASNNo: "ASN2024052800005", |
| | | // ArrivalNoticeDetail: [ |
| | | // { SkuNo: '000001' } |
| | | // ], |
| | | // // workExperience: [ |
| | | // // { position: '数据分析师', company: '某宝', address: '北京', date: '四月-2010-八月-2011', work: '专题分析/模型,根据业务分析分析各类专题,例如:商品等级,会员消费行为营销活动,重要产品数据等。' }, |
| | | // // { position: '数据分析师', company: '某东', address: '北京', date: '九月-2011-三月-2016', work: '数据指标监控,根据产品,运营以及管理的需求,针对产品数据,运营,业务进展及KPI指标的监控,经营分析,对口BU的经营报告,分析KPI进度,交易产品异动原因,分析市场动态,汇报对象为BU经理。' }, |
| | | // // { position: '数据产品经理', company: '大米', address: '北京', date: '四月-2016-至今', work: '负责具体分析项目,例如实时监控,数据后台管理,协调开发资源,控制项目进度。' } |
| | | // // ], |
| | | // }; |
| | | // openPrintDialog(printData, 'ArrivalNotice'); |
| | | }); |
| | | </script> |
| | | </body> |
| | |
| | | <!--打印部分--> |
| | | <div class="layui-col-xs8" style="overflow: hidden;outline: none;"> |
| | | <!--打印头部分--> |
| | | <div class="hiprint-toolbar" style="margin-top:15px;"> |
| | | <div class="hiprint-toolbar" style="margin-top:15px;margin-left:10px;"> |
| | | <ul> |
| | | <!-- <li><a class="hiprint-tizee-btn" onclick="setPaper('A3')">A3</a></li> --> |
| | | <li><a class="hiprint-tizee-btn" onclick="setPaper('A4')">A4</a></li> |
| | |
| | | <div style="clear:both;"></div> |
| | | </div> |
| | | <!--打印主体部分--> |
| | | <div id="hiprint-printTemplate" class="hiprint-printTemplate" |
| | | style="margin-top:20px; overflow-x: scroll; overflow-y: hidden;"> |
| | | <div style="overflow-x: scroll; overflow-y: hidden;"> |
| | | <div id="hiprint-printTemplate" class="hiprint-printTemplate" |
| | | style="margin-top:20px;margin-left:20px;"> |
| | | </div> |
| | | </div> |
| | | <textarea class="form-control" rows="10" id="A4_textarea_json" style="display: none;"></textarea> |
| | | </div> |
| | |
| | | |
| | | //初始化打印插件渲染 |
| | | // $(".hiprintEpContainer").html(""); //清除div内容 |
| | | |
| | | if (parent.objRowsData.Type) { |
| | | datalist = getPrintDataList()(parent.objRowsData.Type); |
| | | } |
| | | hiprint.init({ |
| | | providers: [new configElementTypeProvider()] |
| | | }); |
| | |
| | | 'testModule'); |
| | | |
| | | let hiprintTemplate; |
| | | if (window.parent.objRowsData.PositionJson) |
| | | var JsonData = JSON.parse(window.parent.objRowsData.PositionJson) |
| | | if (parent.objRowsData.PositionJson) |
| | | var JsonData = JSON.parse(parent.objRowsData.PositionJson) |
| | | if (JsonData) { |
| | | $("#customWidth").val(JsonData.panels[0].width); |
| | | $("#customHeight").val(JsonData.panels[0].height); |