Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function (c) {
- (function(console){
- console.save = function(data, filename){
- if(!data) {
- console.error('Console.save: No data')
- return;
- }
- if(!filename) filename = 'console.json'
- if(typeof data === "object"){
- data = JSON.stringify(data, undefined, 4)
- }
- var blob = new Blob([data], {type: 'text/json'}),
- e = document.createEvent('MouseEvents'),
- a = document.createElement('a')
- a.download = filename
- a.href = window.URL.createObjectURL(blob)
- a.dataset.downloadurl = ['text/json', a.download, a.href].join(':')
- e.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null)
- a.dispatchEvent(e)
- }
- })(c);
- var pagesize = 5000, total = 10291, pages = Math.ceil(total / pagesize), data = [], response;
- var url = "/ordermanagement/channel/all";
- var json = {
- "descriptionProvider": $("#descriptionProvider").val(),
- "description": $("#description").val(),
- "categoryId": $("#category").val(),
- "subCategoryId": $("#subCategory").val(),
- "business": $("#business").val(),
- "advertisement": $("#advertisement").val(),
- "freight": $("#freight").val(),
- "shippingMode": $("#shippingMode").val(),
- "channel": $("#channel").val(),
- "status": $("#statusMl").val(),
- "visits": $("#visits").val(),
- "ean": $("#ean").val(),
- "qtySales": $("#qtySales").val(),
- "sku": $("#sku").val(),
- "findSkuBy": $("#findSkuBy").is(":checked") ? "channelId" : "productSku",
- "updatePriceByInterface": "-1",
- "isPromotionalPrice": $("#isPromotionalPrice").val(),
- "isKit": $("#isKit").val(),
- "datePaused": $("#date_paused").val(),
- "subStatus": $("#subStatus").val(),
- "hasVariation": $("#hasVariation").val(),
- "priceFrom": $("#priceFrom").val(),
- "priceTo": $("#priceTo").val(),
- "isBuybox": $("#isBuybox").val(),
- "logisticType": $("#logisticType").val(),
- "page": 1,
- "pageSize": pagesize
- }
- for(var i = 1; i <= pages ; i++) {
- json.page = i;
- loadPagination(ajaxEnvio, url, json, true, false, mountTable)['list'][0]
- .forEach(
- elem => {if (elem) data.push(elem)}
- );
- }
- console.save(data, "test.json");
- })(console);
Add Comment
Please, Sign In to add comment