// ==UserScript== // @name 爱房JS脚本 // @namespace http://tampermonkey.net/ // @version 0.7 // @description 可以跳转项目页,打开合同扫描件,一键下载订单明细 // @author 熊伟良 // @match https://daiketong.58corp.com/* // @match https://max.58corp.com/* // @icon https://pages.anjukestatic.com/fe/ifang_node_admin_web/favicon.ico // @grant none // @license MIT // @downloadURL none // ==/UserScript== window.onload = function () { if (window.location.href.indexOf("commissionall") > -1) { setTimeout(function () { let el_col = document.querySelectorAll(".el-col-22")[5] console.log(el_col) let btn = document.createElement("div") btn.innerHTML = `` el_col.appendChild(btn) console.log(btn) console.log(typeof (el_col), typeof (btn)) document.querySelector("#关闭暗佣").addEventListener("click", function () { let fontColorList = document.querySelectorAll(".fontColor") if (fontColorList.length > 0) { fontColorList.forEach(function (item) { if (item.innerText == "关闭暗佣") { console.log(item.innerHTML) item.click() } }) } else { console.log("待加载") // guanbianyong() } }, false) console.log(el_col) }, 2000) } else if (window.location.href.indexOf("organizationManagement") > -1) { fetch("https://daiketong.58corp.com/japi/companyExport", { "headers": { "accept": "application/json, text/plain, */*", "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7,eu;q=0.6", "authorization": "", "cache-control": "no-cache", "content-type": "application/json;charset=UTF-8", "login-type": "pc", "pragma": "no-cache", "sec-ch-ua": "\"Chromium\";v=\"106\", \"Google Chrome\";v=\"106\", \"Not;A=Brand\";v=\"99\"", "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": "\"Windows\"", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "sw8": "1-NWJiMWJjMTYwNjc5NDMzNmExMzgxYmQ0Yjk2Zjk1MTY=-ZWJiY2JjZjA3MDQxNDQxZGI2NDQ1MTNhZTUxNzY0ZjE=-0-NTAz-aHR0cHM6Ly9kYWlrZXRvbmcuNThjb3JwLmNvbQ==-L2phcGkvY29tcGFueUV4cG9ydA==-ZGFpa2V0b25nLjU4Y29ycC5jb20=-0", "sw8-correlation": "c291cmNl:YmVpZG91", "timestamp": "1665980177" }, "referrer": "https://daiketong.58corp.com/", "referrerPolicy": "strict-origin-when-cross-origin", "body": "{\"company_name\":\"\",\"time_range\":\"all\",\"time_quantum\":[],\"company_co_type\":\"\",\"is_guakao\":\"\",\"manage_status\":\"1\",\"city_ids\":[362,389],\"channel_id\":\"\",\"email_address\":\"735645514@qq.com\",\"cooperation_status\":\"\",\"crm_company_id\":\"\",\"page_index\":1}", "method": "POST", "mode": "cors", "credentials": "include" }); } else if (window.location.href.indexOf("transactionInformationAudit") > -1) { const cookie = document.cookie; // console.log(cookie) var bc_id = "1" setTimeout(function () { let contentList = document.querySelectorAll(".section-content-item-value") contentList.forEach(function (contract, contractindex) { let reg = /^B/ if (reg.test(contract.innerText) == true) { var buildingId = contract.innerText.substring(3, 8).toString(); var bc_code = contract.innerText; console.log(buildingId, bc_code); console.log(contentList[1]) contentList[0].onclick = function () { console.log(`https://daiketong.58corp.com/#/refactorProject/projectManager/projectManagerIndex/projectManagerDetail?building_id=${buildingId}&active=4&city_id=362`) let win = window.open(`https://daiketong.58corp.com/#/refactorProject/projectManager/projectManagerIndex/projectManagerDetail?building_id=${buildingId}&active=4&city_id=362`) } fetch("https://daiketong.58corp.com/japi/buildings/contract/list", { "headers": { "accept": "application/json, text/plain, */*", "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7", "authorization": "", "content-type": "application/json;charset=UTF-8", "login-type": "pc", "sec-ch-ua": "\"Chromium\";v=\"106\", \"Google Chrome\";v=\"106\", \"Not;A=Brand\";v=\"99\"", "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": "\"Windows\"", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "sw8": "1-MWE1YmNiZTAzOTE5NDIyOTk4MDgwODNhNDAwZDg2NDA=-ODNiMmUwMWU2YTc2NDMyMTkyNmQ1NTI1ZjNjZDUyNzE=-0-NTAz-aHR0cHM6Ly9kYWlrZXRvbmcuNThjb3JwLmNvbQ==-L2phcGkvYnVpbGRpbmdzL2NvbnRyYWN0L2xpc3Q=-ZGFpa2V0b25nLjU4Y29ycC5jb20=-0", "sw8-correlation": "c291cmNl:YmVpZG91", "timestamp": "1665145024" }, "referrer": "https://daiketong.58corp.com/", "referrerPolicy": "strict-origin-when-cross-origin", "body": "{\"building_id\":\"" + buildingId + "\"}", "method": "POST", "mode": "cors", "credentials": "include" }).then(res => { return res.json() }).then(json => { console.log(json) json["data"].forEach(function (item, index) { if (item["bc_code"] == bc_code) { let bc_id = item["bc_id"] console.log(bc_id) fetch("https://daiketong.58corp.com/japi/buildings/contract/get-packing-list", { "headers": { "accept": "application/json, text/plain, */*", "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7", "authorization": "", "content-type": "application/json;charset=UTF-8", "login-type": "pc", "sec-ch-ua": "\"Chromium\";v=\"106\", \"Google Chrome\";v=\"106\", \"Not;A=Brand\";v=\"99\"", "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": "\"Windows\"", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "sw8": "1-MWE1YmNiZTAzOTE5NDIyOTk4MDgwODNhNDAwZDg2NDA=-ODNiMmUwMWU2YTc2NDMyMTkyNmQ1NTI1ZjNjZDUyNzE=-0-NTAz-aHR0cHM6Ly9kYWlrZXRvbmcuNThjb3JwLmNvbQ==-L2phcGkvYnVpbGRpbmdzL2NvbnRyYWN0L2xpc3Q=-ZGFpa2V0b25nLjU4Y29ycC5jb20=-0", "sw8-correlation": "c291cmNl:YmVpZG91", "timestamp": "1665146852" }, "referrer": "https://daiketong.58corp.com/", "referrerPolicy": "strict-origin-when-cross-origin", "body": "{\"contract_id\":" + bc_id.toString() + ",\"contract_type\":\"1\",\"status\":\"\"}", "method": "POST", "mode": "cors", "credentials": "include" }).then(res => { return res.json() }).then(json => { json["data"].forEach(function (item, index) { contract.addEventListener("click", function () { console.log("qwwqqwqw") window.open(item["url"]) }, false) console.log(item["url"]) }) }) } }) }); console.log(bc_id, "1111"); } }) if (document.querySelector(".header-menu").childNodes[2].innerText == "xiongweiliang") { alert("熊伟良") let re = setInterval(function () { let viewerHalf = document.querySelector(".viewerHalf") if (viewerHalf) { console.log(re) viewerHalf.className = "viewer-container viewer-backdrop viewer-fixed viewer-fade viewer-transition viewer-in" clearInterval(re) } else { // console.log(1) } }, 1000) document.onkeyup = function (event) { let viewer_move = document.querySelector(".viewer-move") if (viewer_move) { let a = document.documentElement.clientWidth / 2 let b = viewer_move.style["width"].slice(0, -2) * 1 / 2 viewer_move.style["margin-left"] = (a - b) + "px" } } document.onmousewheel = function (event) { let viewer_move = document.querySelector(".viewer-move") if (viewer_move) { let a = document.documentElement.clientWidth / 2 let b = viewer_move.style["width"].slice(0, -2) * 1 / 2 viewer_move.style["margin-left"] = (a - b) + "px" } } } }, 1000) } else if (window.location.href.indexOf("max") > -1) { function getSystemTime(timeFormat) { // 实例化日期类 var time = new Date(); // 获取完整的年份(4位) var year = time.getFullYear(); // 获取月份(0-11,0代表1月) var month = time.getMonth() + 1; month = month < 10 ? '0' + month : month; // 获取日期(1-31) var day = time.getDate(); dd = day < 10 ? '0' + day : day; yd = day - 1 < 10 ? '0' + (day - 1).toString() : day - 1; // 获取小时 var h = time.getHours(); hh = h < 10 ? '0' + h : h; // 获取分钟 var m = time.getMinutes(); mm = m < 10 ? '0' + m : m; // 获取秒钟 var s = time.getSeconds(); ss = s < 10 ? '0' + s : s; console.log(timeFormat); if (timeFormat == "today") { var date = `${year}-${month}-${dd}` } else if (timeFormat == "yesterday") { var date = `${year}-${month}-${yd}` } else if (timeFormat == "mm-dd hhmm") { var date = `${month}-${dd} ${hh}${mm}` } console.log(date); return (date); } getSystemTime("today") let nav_topNav = document.querySelector(".topNav") let list = ["订单明细认购不含退户", "订单明细认购含退户", "资金流水"] list.forEach(element => { let li = document.createElement("li") li.innerHTML = `` nav_topNav.appendChild(li) }); async function getToken() { let res = await fetch("https://max.58corp.com/chart/view/4257", { "headers": { "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7", "cache-control": "max-age=0", "sec-ch-ua": "\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\"", "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": "\"Windows\"", "sec-fetch-dest": "document", "sec-fetch-mode": "navigate", "sec-fetch-site": "same-origin", "sec-fetch-user": "?1", "upgrade-insecure-requests": "1" }, "referrer": "https://max.58corp.com/chart/view/4493", "referrerPolicy": "strict-origin-when-cross-origin", "body": null, "method": "GET", "mode": "cors", "credentials": "include" }) let text = await res.text() var token = text.match(/Token=(.*?),/)[1] console.log(token) function download(id, fileName) { fetch("https://datamap.58.com/report/order/download?downloadId=" + id + "&fileName=" + fileName + "", { "headers": { "accept": "*/*", "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7", "content-type": "application/json", "responsetype": "blob", "sec-ch-ua": "\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\"", "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": "\"Windows\"", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "cross-site", "token": token }, "referrer": "https://max.58corp.com/", "referrerPolicy": "strict-origin-when-cross-origin", "body": null, "method": "GET", "mode": "cors", "credentials": "omit" }).then(res => res.blob().then(blob => { let url = window.URL.createObjectURL(blob) let a = document.createElement('a') a.style.display = 'none' a.href = url a.download = fileName + ".xlsx" document.body.appendChild(a) a.click() document.body.removeChild(a) window.URL.revokeObjectURL(url) })) } function getExcelId(fileName) { fetch("https://datamap.58.com/report/order/list?page=1&limit=1000&key=" + fileName + "&menuId=1154", { "headers": { "accept": "*/*", "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7", "content-type": "application/json", "sec-ch-ua": "\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\"", "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": "\"Windows\"", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "cross-site", "token": token }, "referrer": "https://max.58corp.com/", "referrerPolicy": "strict-origin-when-cross-origin", "body": null, "method": "GET", "mode": "cors", "credentials": "omit" }).then(res => { return res.json() }).then(json => { let id = json["page"]["list"][0]["id"].toString() let status = json["page"]["list"][0]["status"] console.log(status) console.log(json) if (status != 2) { getExcelId(fileName) } else { download(id, fileName) } }); } function getExcel(fileName, body) { fetch("https://datamap.58.com/report/order/export", { "headers": { "accept": "*/*", "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7", "content-type": "application/json", "sec-ch-ua": "\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\"", "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": "\"Windows\"", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "cross-site", "token": token }, "referrer": "https://max.58corp.com/", "referrerPolicy": "strict-origin-when-cross-origin", "body": body, "method": "POST", "mode": "cors", "credentials": "omit" }).then(res => { return res.json() }).then(json => { console.log(json.msg) if (json.msg != "success") { getExcel(fileName, body.replace(today, yesterday)) } else { getExcelId(fileName) } } ); } var queryColumns = `[1, 3, 5, 7, 2, 4, 323, 324, 1085, 964, 6, 325, 8, 9, 10, 11, 12, 13, 730, 1025, 14, 15, 326, 16, 17, 18, 19, 20, 21, 22, 23, 24, 528, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 731, 732, 733, 734, 735, 736, 737, 757, 39, 761, 40, 43, 121, 122, 899, 900, 902, 1242, 901, 1088, 1087, 44, 762, 45, 46, 1022, 327, 328, 47, 329, 48, 49, 50, 1080, 51, 763, 965, 966, 967, 1029, 1030, 1278, 1277, 960, 961, 962, 963, 58, 336, 59, 60, 61, 337, 62, 63, 64, 65, 66, 67, 1023, 68, 69, 1024, 70, 691, 71, 1063, 1279, 1280, 1281, 72, 73, 74, 75, 76, 320, 77, 78, 79, 321, 80, 81, 82, 83, 84, 85, 93, 94, 95, 96, 97, 322, 98, 99, 100, 101, 102, 103, 104, 105, 107, 109, 110, 111, 112, 113, 114, 115, 116, 330, 331, 332, 333, 334, 335, 898, 1216, 1217, 1218, 1219, 1220, 1221, 334, 760, 1029, 1237, 1250, 1258, 328, 329, 334, 757, 760, 1029, 1244, 1237, 1250, 1258]` var refundStatus = `[0,1,2,3]` var today = getSystemTime("today") var yesterday = getSystemTime("yesterday") let rengoubutui = document.querySelector("#订单明细认购不含退户") rengoubutui.onclick = function () { let fileName = getSystemTime("mm-dd hhmm") + " 订单明细(认购)" var refundStatus = `[0,1,2]` var body = "{\"fileName\":\"" + fileName + "\",\"calDt\":\"" + today + "\",\"buildingRegionId\":-1,\"buildingCityId\":-1,\"orderStatus\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14],\"ssStatus\":[0,2,3,1,4,5],\"refundStatus\":" + refundStatus + ",\"receivableStatus\":[0,1,2],\"settlementType\":[1,2,0,3,-99],\"prepaidType\":[1,-99,0],\"queryColumns\":" + queryColumns + ",\"menuId\":1153,\"cusErr\":true,\"subscribeTime\": [\"2021-01-01\", \"2023-01-01\"]}" console.log(body) getExcel(fileName = fileName, body = body) } let rengoutui = document.querySelector("#订单明细认购含退户") rengoutui.onclick = function () { let fileName = getSystemTime("mm-dd hhmm") + " 订单明细(认购含退户)" var refundStatus = `[0,1,2,3]` var body = "{\"fileName\":\"" + fileName + "\",\"calDt\":\"" + today + "\",\"buildingRegionId\":-1,\"buildingCityId\":-1,\"orderStatus\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14],\"ssStatus\":[0,2,3,1,4,5],\"refundStatus\":" + refundStatus + ",\"receivableStatus\":[0,1,2],\"settlementType\":[1,2,0,3,-99],\"prepaidType\":[1,-99,0],\"queryColumns\":" + queryColumns + ",\"menuId\":1153,\"cusErr\":true,\"subscribeTime\": [\"2021-01-01\", \"2023-01-01\"]}" console.log(body) getExcel(fileName = fileName, body = body) } } getToken() } else if (window.location.href.indexOf("masterContractSee") > -1) { async function getData() { let res = await fetch("https://daiketong.58corp.com/japi/buildings/contract/detail?contract_type=1&building_id=125429&contract_id=76673&active=4&renew=0&hiddenEdit=1&bc_status=2&isDraft=false", { "headers": { "accept": "application/json, text/plain, */*", "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7,eu;q=0.6", "authorization": "", "cache-control": "no-cache", "login-type": "pc", "pragma": "no-cache", "sec-ch-ua": "\"Chromium\";v=\"106\", \"Google Chrome\";v=\"106\", \"Not;A=Brand\";v=\"99\"", "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": "\"Windows\"", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "sw8": "1-ZjRkMWNhZDIzYzYzNDA0ODk0Yzc5YmVlMjBkMjIyNzg=-NzBiOGNmNWM0Yjg2NGUyM2EyZTE1MzhjOGZkYjNjM2Y=-0-NTAz-aHR0cHM6Ly9kYWlrZXRvbmcuNThjb3JwLmNvbQ==-L2phcGkvYnVpbGRpbmdzL2NvbnRyYWN0L2RldGFpbA==-ZGFpa2V0b25nLjU4Y29ycC5jb20=-0", "sw8-correlation": "c291cmNl:YmVpZG91", "timestamp": "1665834595" }, "referrer": "https://daiketong.58corp.com/", "referrerPolicy": "strict-origin-when-cross-origin", "body": null, "method": "GET", "mode": "cors", "credentials": "include" }); let json = await res.json() console.table(json.data); } getData() } else if (window.location.href.indexOf("evidenceChainList") > -1) { var timer = setInterval(() => { // 获取表格行集合 var rows = document.querySelectorAll(".el-table__row") // 如果表格行存在,执行addChild函数,并清除定时器 if (rows.length > 0) { addChild(rows) clearInterval(timer); } }, 1000); // 添加订单审核链接到每一行 function addChild() { let nav_topNav = document.querySelectorAll(".el-table__row") nav_topNav.forEach((nav) => { let idNode = nav.querySelectorAll("td")[4] let ID = idNode.querySelector(".cell").innerHTML let handleNode = nav.querySelectorAll("td")[12] let a = document.createElement("a") a.innerHTML = `订单审核界面` handleNode.appendChild(a) console.log(ID, handleNode) async function getData() { let res = await fetch(`https://daiketong.58corp.com/daiketong/v1/success-sale/audit-list?page=1&status=PASSED&order_id=${ID}`, { "headers": { "accept": "application/json, text/plain, */*", "accept-language": "zh-CN,zh;q=0.9,en;q=0.8", "authorization": "", "cache-control": "no-cache", "login-type": "pc", "pragma": "no-cache", "sec-ch-ua": "\"Chromium\";v=\"106\", \"Google Chrome\";v=\"106\", \"Not;A=Brand\";v=\"99\"", "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": "\"Windows\"", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "sw8": "1-YjQyNzY4ZDFiMDM0NGRlZjg2NTI2NmFhYmM0Njc2YzU=-Y2I2YTg3YzM1MmZiNGVlN2JiMTM5ODgyYmFkZGQyMDc=-0-NTAz-aHR0cHM6Ly9kYWlrZXRvbmcuNThjb3JwLmNvbQ==-L2RhaWtldG9uZy92MS9zdWNjZXNzLXNhbGUvYXVkaXQtbGlzdA==-ZGFpa2V0b25nLjU4Y29ycC5jb20=-0", "sw8-correlation": "c291cmNl:YmVpZG91", "timestamp": "1679399184" }, "referrer": "https://daiketong.58corp.com/", "referrerPolicy": "strict-origin-when-cross-origin", "body": null, "method": "GET", "mode": "cors", "credentials": "include" }); let json = await res.json() if (json.data.data[0]) { console.log(ID, json.data.data[0]) return json.data.data[0]['batch_id'] } } async function useData() { let value = await getData(); // value等于data.data的值 if (value) { let a = document.createElement("a") a.innerHTML = ` | 成销界面` handleNode.appendChild(a) } } useData() }) } } };