| | |
| | | <div><button type="button" class="layui-btn layui-btn-primary layui-btn-xs btn-edit" id="otherSave">另存为</button></div> |
| | | <div><button type="button" class="layui-btn layui-btn-primary layui-btn-xs btn-edit" id="allprint">全部打印</button></div> |
| | | <div><button type="button" class="layui-btn layui-btn-primary layui-btn-xs btn-edit" id="print">选区打印</button></div> |
| | | <div><button type="button" class="layui-btn layui-btn-primary layui-btn-xs btn-edit" id="download">下载</button></div> |
| | | <!-- <div><button type="button" class="layui-btn layui-btn-primary layui-btn-xs btn-edit" id="download">下载</button></div>--> |
| | | </div> |
| | | <div id="luckysheet" style="margin:0px;padding:0px;position:absolute;width:100%;height: 100vh;left: 0px;top: 0px;"></div> |
| | | <script> |
| | |
| | | //新增 |
| | | $.ajax({ |
| | | type:"get", |
| | | url: "../../static/js/priQuote/data.txt", |
| | | dataType:"text", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | success:function(res) { |
| | | options.data = unzip(res) |
| | | url: baseUrl + "/static/js/priQuote/data" + getUrlParams('template') + ".txt", |
| | | success:function(sheetData) { |
| | | options.data = unzip(sheetData) |
| | | // options.title = getUrlParams('name') |
| | | luckysheet.create(options) |
| | | $("#luckysheet_info_detail_update").hide() |
| | | $("#luckysheet_info_detail_save").hide() |
| | |
| | | //修改 |
| | | $.ajax({ |
| | | type:"get", |
| | | url: "/priQuote/" + getUrlParams('id') + "/auth", |
| | | url: baseUrl + "/priQuote/" + getUrlParams('id') + "/auth", |
| | | dataType:"json", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | success:function(res) { |
| | |
| | | if(getUrlParams('id') == false || getUrlParams('id') == undefined){ |
| | | //新增 |
| | | $.ajax({ |
| | | url: "/priQuote/add/auth", |
| | | url: baseUrl + "/priQuote/add/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | title: luckysheet.toJson().title, |
| | | sheetData: zip(luckysheet.getAllSheets()), |
| | | priQuoteBudgetId: getUrlParams('priQuoteBudgetId') |
| | | priQuoteBudgetId: getUrlParams('priQuoteBudgetId'), |
| | | template: getUrlParams('template') |
| | | }), |
| | | method: 'POST', |
| | | dataType: "json", |
| | |
| | | }else { |
| | | //修改 |
| | | $.ajax({ |
| | | url: "/priQuote/update/auth", |
| | | url: baseUrl + "/priQuote/update/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | id: getUrlParams('id'), |
| | |
| | | }else { |
| | | //另存 |
| | | $.ajax({ |
| | | url: "/priQuote/addOther/auth", |
| | | url: baseUrl + "/priQuote/addOther/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | id: getUrlParams('id'), |
| | |
| | | |
| | | $("#download").on("click",() => { |
| | | $.ajax({ |
| | | url: "/priQuote/excel/downfile", |
| | | url: baseUrl + "/priQuote/excel/downfile", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | exceldata: JSON.stringify(luckysheet.getAllSheets()) |
| | | exceldata: JSON.stringify(luckysheet.getAllSheets()), |
| | | template: getUrlParams('template') |
| | | }), |
| | | method: 'POST', |
| | | dataType: "json", |
| | | contentType:'application/json;charset=UTF-8', |
| | | success: function (res) { |
| | | if(res.code == 200){ |
| | | window.open(res.msg) |
| | | window.open(baseUrl+res.msg) |
| | | } |
| | | } |
| | | }) |