新增 "集团二级类型": {

name: "GROUP_TYPE2",
      default: "小微企业",
    },
This commit is contained in:
manchuwork
2025-10-09 15:26:28 +08:00
parent 98fd77e107
commit ebe60b3ae6
8 changed files with 567 additions and 142 deletions

84
copy_html.js Normal file
View File

@@ -0,0 +1,84 @@
// ==UserScript==
// @name HTML Source Copier
// @namespace http://tampermonkey.net/
// @version 1.0
// @description 为网页添加按钮以复制完整HTML源码
// @author YourName
// @match *://*/*
// @grant GM_setClipboard
// ==/UserScript==
(function() {
'use strict';
// 创建按钮样式
const style = document.createElement('style');
style.textContent = `
.html-copy-btn {
position: fixed;
bottom: 20px;
right: 20px;
z-index: 9999;
padding: 10px 15px;
background: linear-gradient(135deg, #6e8efb, #a777e3);
color: white;
border: none;
border-radius: 50px;
cursor: pointer;
font-weight: bold;
box-shadow: 0 4px 15px rgba(0,0,0,0.2);
transition: all 0.3s ease;
}
.html-copy-btn:hover {
transform: translateY(-3px);
box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.html-copy-btn:active {
transform: translateY(1px);
}
.copy-notification {
position: fixed;
bottom: 70px;
right: 20px;
background: rgba(0,0,0,0.7);
color: white;
padding: 10px 15px;
border-radius: 5px;
opacity: 0;
transition: opacity 0.3s;
}
`;
document.head.appendChild(style);
// 创建按钮元素
const btn = document.createElement('button');
btn.className = 'html-copy-btn';
btn.textContent = 'Copy HTML';
document.body.appendChild(btn);
// 创建通知元素
const notification = document.createElement('div');
notification.className = 'copy-notification';
document.body.appendChild(notification);
// 按钮点击事件
btn.addEventListener('click', function() {
const html = document.documentElement.outerHTML;
GM_setClipboard(html, 'text')
.then(() => {
notification.textContent = 'HTML copied to clipboard!';
notification.style.opacity = '1';
setTimeout(() => {
notification.style.opacity = '0';
}, 2000);
})
.catch(err => {
notification.textContent = 'Copy failed: ' + err;
notification.style.opacity = '1';
setTimeout(() => {
notification.style.opacity = '0';
}, 3000);
});
});
})();

View File

@@ -0,0 +1 @@
undefined

55
optimized_legal_info.html Normal file
View File

@@ -0,0 +1,55 @@
<!DOCTYPE html>
<html>
<head>
<title>优化后的法人信息查询</title>
<style>
.legal-info-table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
}
.legal-info-table th, .legal-info-table td {
padding: 10px;
border: 1px solid #ddd;
text-align: left;
}
.legal-info-table th {
background-color: #f5f5f5;
font-weight: bold;
}
.legal-person {
font-weight: bold;
color: #1890ff;
}
.copy-btn {
cursor: pointer;
color: #1890ff;
margin-left: 5px;
}
</style>
</head>
<body>
<h2>法人信息查询</h2>
<table class="legal-info-table">
<tr>
<th width="15%">法定代表人</th>
<td width="35%">
<span class="legal-person">周观武</span>
<span class="copy-btn">[复制]</span>
</td>
<th width="15%">登记状态</th>
<td width="35%">存续</td>
</tr>
<tr>
<th>成立日期</th>
<td>2024-03-22 <span class="copy-btn">[复制]</span></td>
<th>注册资本</th>
<td>100万元</td>
</tr>
<tr>
<th>统一社会信用代码</th>
<td colspan="3">91330105MADFDTUR62 <span class="copy-btn">[复制]</span></td>
</tr>
</table>
</body>
</html>

View File

@@ -47,10 +47,53 @@
document.body.removeChild(textarea); document.body.removeChild(textarea);
if (successMessage) { if (successMessage) {
alert(successMessage); this.showAutoCloseMessage(successMessage, "success");
} }
} }
static showAutoCloseMessage(message, type = "info") {
// 创建一个自动关闭的提示框替代 alert
const alertBox = document.createElement("div");
alertBox.textContent = message;
alertBox.style.position = "fixed";
alertBox.style.top = "50%";
alertBox.style.left = "50%";
alertBox.style.transform = "translate(-50%, -50%)";
// 根据消息类型设置不同颜色
if (type === "success") {
alertBox.style.backgroundColor = "#52c41a";
} else if (type === "error") {
alertBox.style.backgroundColor = "#f5222d";
} else {
alertBox.style.backgroundColor = "#1890ff";
}
alertBox.style.color = "white";
alertBox.style.padding = "10px 20px";
alertBox.style.borderRadius = "4px";
alertBox.style.zIndex = "10001";
alertBox.style.boxShadow = "0 2px 8px rgba(0,0,0,0.15)";
alertBox.style.transition = "opacity 0.3s";
document.body.appendChild(alertBox);
// 2秒后自动关闭
setTimeout(() => {
if (document.body.contains(alertBox)) {
// 添加淡出效果
alertBox.style.opacity = "0";
// 真正移除元素
setTimeout(() => {
if (document.body.contains(alertBox)) {
document.body.removeChild(alertBox);
}
}, 300);
}
}, 2000);
}
static showResult(data) { static showResult(data) {
const modal = document.createElement("div"); const modal = document.createElement("div");
modal.style.position = "fixed"; modal.style.position = "fixed";
@@ -83,7 +126,7 @@
copyBtn.addEventListener("click", () => { copyBtn.addEventListener("click", () => {
navigator.clipboard navigator.clipboard
.writeText(JSON.stringify(data, null, 2)) .writeText(JSON.stringify(data, null, 2))
.then(() => alert("已复制到剪贴板")) .then(() => this.showAutoCloseMessage("已复制到剪贴板", "success"))
.catch((err) => alert("复制失败: " + err)); .catch((err) => alert("复制失败: " + err));
}); });
@@ -109,11 +152,30 @@
modal.appendChild(closeBtn); modal.appendChild(closeBtn);
document.body.appendChild(modal); document.body.appendChild(modal);
// // Automatically close the modal after 2 seconds
// setTimeout(() => {
// if (document.body.contains(modal)) {
// document.body.removeChild(modal);
// }
// }, 2000);
} }
} }
// 爱企查解析类 // 爱企查解析类
class AiQiChaParser { class AiQiChaParser {
getPhoneNumber() {
// 查找电话信息容器
const phoneContainer = document.querySelector(
"div.business-info div.telphone-lists-wrap"
);
if (!phoneContainer) return "未找到电话信息";
// 查找包含电话号码的元素
const phoneElement = phoneContainer.querySelector("span.copy-box span");
if (!phoneElement) return "未找到电话号码";
return ToolUtils.cleanText(phoneElement.textContent);
}
constructor() { constructor() {
this.table = null; this.table = null;
} }
@@ -140,7 +202,8 @@
let valueCell = titleCell.nextElementSibling; let valueCell = titleCell.nextElementSibling;
if (!valueCell) return null; if (!valueCell) return null;
const valueElement = valueCell.querySelector(".enter-bg-ele") || const valueElement =
valueCell.querySelector(".enter-bg-ele") ||
valueCell.querySelector(".addr-enter-bg-ele") || valueCell.querySelector(".addr-enter-bg-ele") ||
valueCell; valueCell;
@@ -149,9 +212,9 @@
// 获取法定代表人 // 获取法定代表人
getLegalRepresentative() { getLegalRepresentative() {
const legalElements = Array.from(this.table.querySelectorAll("td")).filter( const legalElements = Array.from(
(td) => ToolUtils.cleanText(td.textContent) === "法定代表人" this.table.querySelectorAll("td")
); ).filter((td) => ToolUtils.cleanText(td.textContent) === "法定代表人");
if (legalElements.length > 0) { if (legalElements.length > 0) {
const valueCell = legalElements[0].nextElementSibling; const valueCell = legalElements[0].nextElementSibling;
@@ -164,9 +227,9 @@
} }
} }
const titleElements = Array.from(this.table.querySelectorAll("td")).filter( const titleElements = Array.from(
(td) => td.textContent.includes("法定代表人") this.table.querySelectorAll("td")
); ).filter((td) => td.textContent.includes("法定代表人"));
if (titleElements.length > 0 && titleElements[0].nextElementSibling) { if (titleElements.length > 0 && titleElements[0].nextElementSibling) {
const valueCell = titleElements[0].nextElementSibling; const valueCell = titleElements[0].nextElementSibling;
@@ -190,7 +253,9 @@
if (codeElements.length > 0) { if (codeElements.length > 0) {
const valueCell = codeElements[0].nextElementSibling; const valueCell = codeElements[0].nextElementSibling;
const rawValue = valueCell.querySelector(".enter-bg-ele")?.textContent || valueCell.textContent; const rawValue =
valueCell.querySelector(".enter-bg-ele")?.textContent ||
valueCell.textContent;
return ToolUtils.cleanText(rawValue); return ToolUtils.cleanText(rawValue);
} }
@@ -200,7 +265,9 @@
if (taxElements.length > 0 && taxElements[0].nextElementSibling) { if (taxElements.length > 0 && taxElements[0].nextElementSibling) {
const valueCell = taxElements[0].nextElementSibling; const valueCell = taxElements[0].nextElementSibling;
const rawValue = valueCell.querySelector(".enter-bg-ele")?.textContent || valueCell.textContent; const rawValue =
valueCell.querySelector(".enter-bg-ele")?.textContent ||
valueCell.textContent;
return ToolUtils.cleanText(rawValue); return ToolUtils.cleanText(rawValue);
} }
@@ -215,7 +282,9 @@
if (regElements.length > 0 && regElements[0].nextElementSibling) { if (regElements.length > 0 && regElements[0].nextElementSibling) {
const valueCell = regElements[0].nextElementSibling; const valueCell = regElements[0].nextElementSibling;
const rawValue = valueCell.querySelector(".enter-bg-ele")?.textContent || valueCell.textContent; const rawValue =
valueCell.querySelector(".enter-bg-ele")?.textContent ||
valueCell.textContent;
return ToolUtils.cleanText(rawValue); return ToolUtils.cleanText(rawValue);
} }
@@ -231,18 +300,22 @@
if (orgCodeElements.length > 0) { if (orgCodeElements.length > 0) {
const valueCell = orgCodeElements[0].closest("td").nextElementSibling; const valueCell = orgCodeElements[0].closest("td").nextElementSibling;
if (valueCell && valueCell.classList.contains("enter-bg")) { if (valueCell && valueCell.classList.contains("enter-bg")) {
const rawValue = valueCell.querySelector(".enter-bg-ele")?.textContent || valueCell.textContent; const rawValue =
valueCell.querySelector(".enter-bg-ele")?.textContent ||
valueCell.textContent;
return ToolUtils.cleanText(rawValue); return ToolUtils.cleanText(rawValue);
} }
} }
const titleElements = Array.from(this.table.querySelectorAll("td")).filter( const titleElements = Array.from(
(td) => ToolUtils.cleanText(td.textContent) === "组织机构代码" this.table.querySelectorAll("td")
); ).filter((td) => ToolUtils.cleanText(td.textContent) === "组织机构代码");
if (titleElements.length > 0 && titleElements[0].nextElementSibling) { if (titleElements.length > 0 && titleElements[0].nextElementSibling) {
const valueCell = titleElements[0].nextElementSibling; const valueCell = titleElements[0].nextElementSibling;
const rawValue = valueCell.querySelector(".enter-bg-ele")?.textContent || valueCell.textContent; const rawValue =
valueCell.querySelector(".enter-bg-ele")?.textContent ||
valueCell.textContent;
return ToolUtils.cleanText(rawValue); return ToolUtils.cleanText(rawValue);
} }
@@ -257,17 +330,23 @@
if (taxElements.length > 0 && taxElements[0].nextElementSibling) { if (taxElements.length > 0 && taxElements[0].nextElementSibling) {
const valueCell = taxElements[0].nextElementSibling; const valueCell = taxElements[0].nextElementSibling;
const rawValue = valueCell.querySelector(".enter-bg-ele")?.textContent || valueCell.textContent; const rawValue =
valueCell.querySelector(".enter-bg-ele")?.textContent ||
valueCell.textContent;
return ToolUtils.cleanText(rawValue); return ToolUtils.cleanText(rawValue);
} }
const creditElements = Array.from(this.table.querySelectorAll("td")).filter( const creditElements = Array.from(
(td) => ToolUtils.cleanText(td.textContent).includes("统一社会信用代码") this.table.querySelectorAll("td")
).filter((td) =>
ToolUtils.cleanText(td.textContent).includes("统一社会信用代码")
); );
if (creditElements.length > 0 && creditElements[0].nextElementSibling) { if (creditElements.length > 0 && creditElements[0].nextElementSibling) {
const valueCell = creditElements[0].nextElementSibling; const valueCell = creditElements[0].nextElementSibling;
const rawValue = valueCell.querySelector(".enter-bg-ele")?.textContent || valueCell.textContent; const rawValue =
valueCell.querySelector(".enter-bg-ele")?.textContent ||
valueCell.textContent;
return ToolUtils.cleanText(rawValue); return ToolUtils.cleanText(rawValue);
} }
@@ -276,14 +355,14 @@
// 获取参保人数 // 获取参保人数
getInsuranceNumber() { getInsuranceNumber() {
const insuranceElements = Array.from(this.table.querySelectorAll("td")).filter( const insuranceElements = Array.from(
(td) => { this.table.querySelectorAll("td")
).filter((td) => {
return ( return (
td.textContent.includes("参保人数") && td.textContent.includes("参保人数") &&
td.querySelector(".insurance-info") td.querySelector(".insurance-info")
); );
} });
);
if (insuranceElements.length > 0) { if (insuranceElements.length > 0) {
const valueCell = insuranceElements[0].nextElementSibling; const valueCell = insuranceElements[0].nextElementSibling;
@@ -329,9 +408,9 @@
} }
} }
const titleElements = Array.from(this.table.querySelectorAll("td")).filter( const titleElements = Array.from(
(td) => ToolUtils.cleanText(td.textContent) === "核准日期" this.table.querySelectorAll("td")
); ).filter((td) => ToolUtils.cleanText(td.textContent) === "核准日期");
if (titleElements.length > 0 && titleElements[0].nextElementSibling) { if (titleElements.length > 0 && titleElements[0].nextElementSibling) {
const valueCell = titleElements[0].nextElementSibling; const valueCell = titleElements[0].nextElementSibling;
@@ -352,6 +431,7 @@
企业名称: this.getOptimizedValue("企业名称"), 企业名称: this.getOptimizedValue("企业名称"),
统一社会信用代码: this.getUnifiedSocialCreditCode(), 统一社会信用代码: this.getUnifiedSocialCreditCode(),
法定代表人: this.getLegalRepresentative(), 法定代表人: this.getLegalRepresentative(),
电话: this.getPhoneNumber(),
经营状态: this.getOptimizedValue("经营状态"), 经营状态: this.getOptimizedValue("经营状态"),
成立日期: this.getOptimizedValue("成立日期"), 成立日期: this.getOptimizedValue("成立日期"),
行政区划: this.getOptimizedValue("行政区划"), 行政区划: this.getOptimizedValue("行政区划"),
@@ -376,7 +456,7 @@
} }
} }
// QCC解析类 // QCC解析类 企查查
class QCCParser { class QCCParser {
constructor() { constructor() {
this.table = null; this.table = null;
@@ -384,13 +464,13 @@ class QCCParser {
// 初始化表格 // 初始化表格
initTable() { initTable() {
const cominfoNormal = document.querySelector('div.cominfo-normal'); const cominfoNormal = document.querySelector("div.cominfo-normal");
if (!cominfoNormal) { if (!cominfoNormal) {
alert("未找到企业信息容器"); alert("未找到企业信息容器");
return false; return false;
} }
this.table = cominfoNormal.querySelector('table.ntable'); this.table = cominfoNormal.querySelector("table.ntable");
if (!this.table) { if (!this.table) {
alert("未找到企业信息表格"); alert("未找到企业信息表格");
return false; return false;
@@ -400,15 +480,20 @@ class QCCParser {
// 获取优化后的值 // 获取优化后的值
getOptimizedValue(title) { getOptimizedValue(title) {
const rows = Array.from(this.table.querySelectorAll('tr')); const headerCells = Array.from(this.table.querySelectorAll("td.tb"));
let value = null; let value = null;
rows.forEach(row => { headerCells.forEach((header) => {
const th = row.querySelector('th'); if (ToolUtils.cleanText(header.textContent).includes(title)) {
if (th && ToolUtils.cleanText(th.textContent) === title) { const valueCell = header.nextElementSibling;
const td = row.querySelector('td'); if (valueCell) {
if (td) { // 尝试从copy-value类中获取值
value = ToolUtils.cleanText(td.textContent); const copyValue = valueCell.querySelector(".copy-value");
if (copyValue) {
value = ToolUtils.cleanText(copyValue.textContent);
} else {
value = ToolUtils.cleanText(valueCell.textContent);
}
} }
} }
}); });
@@ -418,38 +503,146 @@ class QCCParser {
// 获取法定代表人 // 获取法定代表人
getLegalRepresentative() { getLegalRepresentative() {
return this.getOptimizedValue('法定代表人') || this.getOptimizedValue('法人'); // Try the existing method first
const basicValue =
this.getOptimizedValue("法定代表人") || this.getOptimizedValue("法人");
if (basicValue && basicValue.trim()) {
// Remove any "关联企业 X" text
return basicValue.replace(/\s*关联企业\s*\d+$/, "").trim();
}
// If basic extraction fails, try more specific approach
const headerCell = Array.from(this.table.querySelectorAll("td.tb")).find(
(cell) => ToolUtils.cleanText(cell.textContent).includes("法定代表人")
);
if (!headerCell) return null;
const valueCell = headerCell.nextElementSibling;
if (!valueCell) return null;
// Try to find the name within the complex structure
// Look for anchor tags with target="_blank" which typically contain the legal representative's name
const nameLinks = valueCell.querySelectorAll('a[target="_blank"]');
for (const link of nameLinks) {
const name = ToolUtils.cleanText(link.textContent);
// Make sure it's not empty and doesn't contain obvious non-name text
if (name && !name.includes("关联企业") && !name.includes("复制")) {
return name;
}
}
// Alternative approach - look for the first anchor tag in the cell
const firstLink = valueCell.querySelector("a");
if (firstLink) {
const name = ToolUtils.cleanText(firstLink.textContent);
// Remove any trailing "关联企业 X" text
return name.replace(/\s*关联企业\s*\d+$/, "").trim();
}
// Fallback to general value extraction
const copyValue = valueCell.querySelector(".copy-value");
if (copyValue) {
const name = ToolUtils.cleanText(copyValue.textContent);
// Remove any trailing "关联企业 X" text
return name.replace(/\s*关联企业\s*\d+$/, "").trim();
}
const rawText = ToolUtils.cleanText(valueCell.textContent);
// Remove any trailing "关联企业 X" text
return rawText.replace(/\s*关联企业\s*\d+$/, "").trim();
} }
// 获取统一社会信用代码 // 获取统一社会信用代码
getUnifiedSocialCreditCode() { getUnifiedSocialCreditCode() {
return this.getOptimizedValue('统一社会信用代码') || this.getOptimizedValue('信用代码'); return (
this.getOptimizedValue("统一社会信用代码") ||
this.getOptimizedValue("信用代码")
);
} }
// 获取工商注册号 // 获取工商注册号
getBusinessRegistrationNo() { getBusinessRegistrationNo() {
return this.getOptimizedValue('工商注册号') || this.getOptimizedValue('注册号'); return (
this.getOptimizedValue("工商注册号") || this.getOptimizedValue("注册号")
);
} }
// 获取组织机构代码 // 获取组织机构代码
getOrganizationCode() { getOrganizationCode() {
return this.getOptimizedValue('组织机构代码'); return this.getOptimizedValue("组织机构代码");
} }
// 获取纳税人识别号 // 获取纳税人识别号
getTaxpayerId() { getTaxpayerId() {
return this.getOptimizedValue('纳税人识别号') || this.getUnifiedSocialCreditCode(); return (
this.getOptimizedValue("纳税人识别号") ||
this.getUnifiedSocialCreditCode()
);
} }
// 获取参保人数 // 获取参保人数
getInsuranceNumber() { getInsuranceNumber() {
const value = this.getOptimizedValue('参保人数'); // 查找参保人数表头
return value ? value.replace(/[^0-9]/g, '') + '人' : null; const headerCell = Array.from(this.table.querySelectorAll("td.tb")).find(
(cell) => ToolUtils.cleanText(cell.textContent).includes("参保人数")
);
if (!headerCell) return null;
const valueCell = headerCell.nextElementSibling;
if (!valueCell) return null;
// 提取参保人数数字
const numberSpan = valueCell.querySelector("span");
const number = numberSpan
? ToolUtils.cleanText(numberSpan.textContent)
: null;
// 提取年报年份
const reportLink = valueCell.querySelector("a.m-l-r-10");
const reportYear = reportLink
? ToolUtils.cleanText(reportLink.textContent)
: "";
// 组合结果
return number ? `${number}${reportYear}` : null;
}
// 获取联系电话
getPhoneNumber() {
// 查找联系信息容器
const contactInfo = document.querySelector("div.contact-info");
if (!contactInfo) return null;
// 查找右侧信息区域
const rightPart = contactInfo.querySelector("div.main-part-item.right");
if (!rightPart) return null;
// 查找包含电话的行
const rows = Array.from(rightPart.querySelectorAll("div.rline"));
const phoneRow = rows.find((row) =>
ToolUtils.cleanText(row.textContent).includes("电话:")
);
if (!phoneRow) return null;
// 提取电话号码
const spans = Array.from(
phoneRow.querySelectorAll("span.need-copy-field")
);
const phoneSpan = spans.find(
(span) => !ToolUtils.cleanText(span.textContent).includes("电话:")
);
return phoneSpan ? ToolUtils.cleanText(phoneSpan.textContent) : null;
} }
// 获取核准日期 // 获取核准日期
getApprovalDate() { getApprovalDate() {
return this.getOptimizedValue('核准日期') || this.getOptimizedValue('成立日期'); return (
this.getOptimizedValue("核准日期") || this.getOptimizedValue("成立日期")
);
} }
// 解析公司信息主方法 // 解析公司信息主方法
@@ -457,27 +650,30 @@ class QCCParser {
if (!this.initTable()) return; if (!this.initTable()) return;
const companyData = { const companyData = {
企业名称: this.getOptimizedValue('企业名称') || this.getOptimizedValue('公司名称'), 企业名称:
this.getOptimizedValue("企业名称") ||
this.getOptimizedValue("公司名称"),
统一社会信用代码: this.getUnifiedSocialCreditCode(), 统一社会信用代码: this.getUnifiedSocialCreditCode(),
法定代表人: this.getLegalRepresentative(), 法定代表人: this.getLegalRepresentative(),
经营状态: this.getOptimizedValue('经营状态'), 经营状态: this.getOptimizedValue("登记状态"),
成立日期: this.getOptimizedValue('成立日期'), 成立日期: this.getOptimizedValue("成立日期"),
行政区划: this.getOptimizedValue('行政区划'), 行政区划: this.getOptimizedValue("行政区划"),
注册资本: this.getOptimizedValue('注册资本'), 注册资本: this.getOptimizedValue("注册资本"),
实缴资本: this.getOptimizedValue('实缴资本'), 实缴资本: this.getOptimizedValue("实缴资本"),
企业类型: this.getOptimizedValue('企业类型'), 企业类型: this.getOptimizedValue("企业类型"),
所属行业: this.getOptimizedValue('所属行业'), 所属行业: this.getOptimizedValue("国标行业"),
工商注册号: this.getBusinessRegistrationNo(), 工商注册号: this.getBusinessRegistrationNo(),
组织机构代码: this.getOrganizationCode(), 组织机构代码: this.getOrganizationCode(),
纳税人识别号: this.getTaxpayerId(), 纳税人识别号: this.getTaxpayerId(),
纳税人资质: this.getOptimizedValue('纳税人资质'), 纳税人资质: this.getOptimizedValue("纳税人资质"),
营业期限: this.getOptimizedValue('营业期限'), 营业期限: this.getOptimizedValue("营业期限"),
核准日期: this.getApprovalDate(), 核准日期: this.getApprovalDate(),
参保人数: this.getInsuranceNumber(), 参保人数: this.getInsuranceNumber(),
登记机关: this.getOptimizedValue('登记机关'), 电话: this.getPhoneNumber(),
曾用名: this.getOptimizedValue('曾用名'), 登记机关: this.getOptimizedValue("登记机关"),
注册地址: this.getOptimizedValue('注册地址'), 曾用名: this.getOptimizedValue("曾用名"),
经营范围: this.getOptimizedValue('经营范围'), 注册地址: this.getOptimizedValue("注册地址"),
经营范围: this.getOptimizedValue("经营范围"),
}; };
ToolUtils.showResult(companyData); ToolUtils.showResult(companyData);
@@ -612,19 +808,17 @@ class QCCParser {
const parseInfoButton = createButton("解析公司信息", () => { const parseInfoButton = createButton("解析公司信息", () => {
// 根据当前URL选择对应的解析器 // 根据当前URL选择对应的解析器
let parser; let parser;
if (window.location.host.includes('aiqicha.baidu.com')) { if (window.location.host.includes("aiqicha.baidu.com")) {
parser = new AiQiChaParser(); parser = new AiQiChaParser();
} else if (window.location.host.includes('qcc.com')) { } else if (window.location.host.includes("qcc.com")) {
parser = new QCCParser(); parser = new QCCParser();
} else { } else {
alert('不支持的网站'); alert("不支持的网站");
return; return;
} }
parser.parseCompanyInfo(); parser.parseCompanyInfo();
}); });
// 添加按钮到容器 // 添加按钮到容器
container.appendChild(copySourceButton); container.appendChild(copySourceButton);
container.appendChild(parseInfoButton); container.appendChild(parseInfoButton);

View File

@@ -4,7 +4,7 @@
// @version 0.1 // @version 0.1
// @description 从剪贴板读取JSON数据并自动填写表单 // @description 从剪贴板读取JSON数据并自动填写表单
// @author You // @author You
// @match https://intraecrm.yw.zj.chinamobile.com/page/newGroupAddCustome*
// @grant none // @grant none
// ==/UserScript== // ==/UserScript==
@@ -61,9 +61,58 @@
}, },
"营业期限":{ "营业期限":{
name: "CUST_CERT_EXPIRE" name: "CUST_CERT_EXPIRE"
},
"电话":{
name:"CONT_PHONE"
},
"集团二级类型": {
name: "GROUP_TYPE2",
default: "小微企业",
} }
}; };
function showAutoCloseMessage(message, type = "info") {
// 创建一个自动关闭的提示框替代 alert
const alertBox = document.createElement("div");
alertBox.textContent = message;
alertBox.style.position = "fixed";
alertBox.style.top = "50%";
alertBox.style.left = "50%";
alertBox.style.transform = "translate(-50%, -50%)";
// 根据消息类型设置不同颜色
if (type === "success") {
alertBox.style.backgroundColor = "#52c41a";
} else if (type === "error") {
alertBox.style.backgroundColor = "#f5222d";
} else {
alertBox.style.backgroundColor = "#1890ff";
}
alertBox.style.color = "white";
alertBox.style.padding = "10px 20px";
alertBox.style.borderRadius = "4px";
alertBox.style.zIndex = "10001";
alertBox.style.boxShadow = "0 2px 8px rgba(0,0,0,0.15)";
alertBox.style.transition = "opacity 0.3s";
document.body.appendChild(alertBox);
// 2秒后自动关闭
setTimeout(() => {
if (document.body.contains(alertBox)) {
// 添加淡出效果
alertBox.style.opacity = "0";
// 真正移除元素
setTimeout(() => {
if (document.body.contains(alertBox)) {
document.body.removeChild(alertBox);
}
}, 300);
}
}, 2000);
}
// 创建按钮容器 // 创建按钮容器
function createButtonContainer() { function createButtonContainer() {
const container = document.createElement("div"); const container = document.createElement("div");
@@ -251,8 +300,8 @@
} }
} }
alert( showAutoCloseMessage(
"表单填写完成!共填充 " + Object.keys(companyInfo).length + " 个字段" "表单填写完成!共填充 " + Object.keys(companyInfo).length + " 个字段",'success'
); );
} catch (error) { } catch (error) {
alert("填写失败: " + error.message); alert("填写失败: " + error.message);

42
script4-.js Normal file
View File

@@ -0,0 +1,42 @@
// ==UserScript==
// @name Auto Click Audit Tab
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Automatically click the "审核建档" tab on the specified page
// @author You
// @match https://intraecrm.yw.zj.chinamobile.com/page/newGroupAddCustomer
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Function to check for the tab and click it
function checkAndClickTab() {
// Look for the specific tab element
const auditTab = document.querySelector('a.tabs-inner span.tabs-title');
// If the tab exists and has the correct text
if (auditTab && auditTab.textContent.trim() === '审核建档') {
// Click the parent <a> element
auditTab.closest('a.tabs-inner').click();
console.log('Successfully clicked the "审核建档" tab');
}
}
// Wait for the page to load completely
window.addEventListener('load', function() {
// Also use a small delay to ensure elements are rendered
setTimeout(checkAndClickTab, 1000);
});
// In case the page content loads dynamically, check periodically
const interval = setInterval(function() {
checkAndClickTab();
}, 2000);
// Stop checking after 30 seconds to avoid infinite loops
setTimeout(function() {
clearInterval(interval);
}, 30000);
})();