DFDJLAdjfldjgdfsdf

try to help you for your report

目前为 2024-05-29 提交的版本。查看 最新版本

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/496442/1385143/DFDJLAdjfldjgdfsdf.js

  1. (function () {
  2. "use strict";
  3. // // 创建一个新的按钮元素
  4. // var button11;
  5. // var pdfUrl;
  6. // openMyFile();
  7. var origSend;
  8. var origOpen;
  9. var button;
  10. var initialX, initialY;
  11. var isDragging;
  12. var input;
  13. var isDragging1;
  14. var initialX1, initialY1;
  15. var offsetX1, offsetY1;
  16. preprocessData();
  17.  
  18. //变量定义
  19. //变量定义
  20. var strtip = "";
  21. var tipnum = 0;
  22. var enable = true;
  23. var strinput = "记录填写情况:\n";
  24. var strreport = "报告模板:\n";
  25. var keyvalarr1 = null,
  26. keyvalarr2 = null,
  27. keyvalarr3 = null,
  28. keyvalarr4 = null;
  29. var keyvalArr;
  30. var manufactureStr = '';
  31. var supervisionStr = '';
  32. var renovationStr = '';
  33. var coverInspectionStr = '';
  34. var nextInspectionStr = '';
  35. var lastBrakingStr = '';
  36. var generalInspectionStr = document
  37. var manufactureDate = null;
  38. var supervisionDate = null;
  39. var renovationDate = null;
  40. var coverInspectionDate = null;
  41. var nextInspectionDate = null;
  42. var lastBrakingDate = null;
  43. var username = '';
  44. var usernameGK = '';
  45. var usernamee = '';
  46. var usernameGKK = '';
  47. var jyrq;
  48. var jyrqq;
  49. var zhizaorq;
  50. var gaizaorq;
  51. var zhidongrq;
  52. var jiandurq;
  53. var gkxiacijianyanriqi;
  54. var jyrqgk;
  55. var keyname;
  56. var qgsf;
  57. var regions;
  58. var nx;
  59. var dat;
  60.  
  61. function main() {
  62. MyVarObject();
  63. describeFormFillStatus();
  64. XiaoHe();
  65. }
  66. function XiaoHe() {
  67. isItemsEmpty();
  68. //封面信息
  69. //封面信息
  70. CoverInfo();
  71. //概况信息
  72. //概况信息
  73. ProfileInfo();
  74. //概况日期比较和检验记录
  75. //概况日期比较和检验记录
  76. DateInfo();
  77. //检验记录
  78. //检验记录
  79. //验证检验结论是否正确,检验项目备注是否有填写
  80. InspectionRecordInfo();
  81. displayResult();
  82. }
  83. function MyVarObject() {
  84. keyname = [
  85. "JYJG1_JYJL1",
  86. "DTBZ1",
  87. "JYJG2_JYJL1",
  88. "DTBZ2",
  89. "JYJG3_JYJL1",
  90. "DTBZ3",
  91. "JYJG4_JYJL2",
  92. "DTBZ4",
  93. "JYJG5_JYJL2",
  94. "DTBZ5",
  95. "JYJG6_JYJL3",
  96. "DTBZ6",
  97. "JYJG7_JYJL4",
  98. "DTBZ7",
  99. "JYJG8_JYJL4",
  100. "DTBZ8",
  101. "JYJG9_JYJL4",
  102. "DTBZ9",
  103. "JYJG10_JYJL4",
  104. "DTBZ10",
  105. "JYJG11_JYJL5",
  106. "DTBZ11",
  107. "JYJG12_JYJL6",
  108. "DTBZ12",
  109. "JYJG13_JYJL6",
  110. "DTBZ13",
  111. "JYJG14_JYJL6",
  112. "DTBZ14",
  113. "JYJG15_JYJL6",
  114. "DTBZ15",
  115. "JYJG16_JYJL7",
  116. "DTBZ16",
  117. "JYJG17_JYJL8",
  118. "DTBZ17",
  119. "JYJG18_JYJL8",
  120. "DTBZ18",
  121. "JYJG19_JYJL9",
  122. "DTBZ19",
  123. "JYJG20_JYJL10",
  124. "DTBZ20",
  125. "JYJG21_JYJL11",
  126. "DTBZ21",
  127. "JYJG22_JYJL12",
  128. "DTBZ22",
  129. "JYJG23_JYJL12",
  130. "DTBZ23",
  131. "JYJG24_JYJL12",
  132. "DTBZ24",
  133. "JYJG25_JYJL13",
  134. "DTBZ25",
  135. "JYJG26_JYJL13",
  136. "DTBZ26",
  137. "JYJG27_JYJL13",
  138. "DTBZ27",
  139. "JYJG28_JYJL13",
  140. "DTBZ28",
  141. "JYJG29_JYJL13",
  142. "DTBZ29",
  143. "JYJG30_JYJL14",
  144. "DTBZ30",
  145. "JYJG31_JYJL14",
  146. "DTBZ31",
  147. "JYJG32_JYJL15",
  148. "DTBZ32",
  149. "JYJG33_JYJL15",
  150. "DTBZ33",
  151. "JYJG34_JYJL15",
  152. "DTBZ34",
  153. "JYJG35_JYJL16",
  154. "DTBZ35",
  155. "JYJG36_JYJL17",
  156. "DTBZ36",
  157. "JYJG37_JYJL18",
  158. "DTBZ37",
  159. "JYJG38_JYJL18",
  160. "DTBZ38",
  161. "JYJG39_JYJL18",
  162. "DTBZ39",
  163. "JYJG40_JYJL18",
  164. "DTBZ40",
  165. "JYJG41_JYJL19",
  166. "DTBZ41",
  167. "JYJG42_JYJL20",
  168. "DTBZ42",
  169. "JYJG43_JYJL21",
  170. "DTBZ43",
  171. "JYJG44_JYJL21",
  172. "DTBZ44",
  173. "JYJG45_JYJL21",
  174. "DTBZ45",
  175. "JYJG46_JYJL21",
  176. "DTBZ46",
  177. "JYJG47_JYJL22",
  178. "DTBZ47",
  179. "JYJG48_JYJL22",
  180. "DTBZ48",
  181. "JYJG49_JYJL23",
  182. "DTBZ49",
  183. "DTSJ503",
  184. "JYJG50_JYJL24",
  185. "DTBZ50",
  186. "DTSJ504",
  187. "JYJG51_JYJL24",
  188. "DTBZ51",
  189. "JYJG52_JYJL25",
  190. "DTBZ52",
  191. "JYJG53_JYJL26",
  192. "DTBZ53",
  193. "JYJG54_JYJL26",
  194. "DTBZ54",
  195. "JYJG55_JYJL26",
  196. "DTBZ55",
  197. "JYJG56_JYJL27",
  198. "DTBZ56",
  199. "JYJG57_JYJL27",
  200. "DTBZ57",
  201. "JYJG58_JYJL28",
  202. "DTBZ58",
  203. "JYJG59_JYJL28",
  204. "DTBZ59",
  205. "JYJG60_JYJL29",
  206. "DTBZ60",
  207. "DTSJ700",
  208. "JYJG61_JYJL29",
  209. "DTBZ61",
  210. "JYJG62_JYJL29",
  211. "DTBZ62",
  212. "JYJG63_JYJL29",
  213. "DTBZ63",
  214. "JYJG64_JYJL30",
  215. "DTBZ64",
  216. "JYJG65_JYJL30",
  217. "DTBZ65",
  218. "JYJG66_JYJL30",
  219. "DTBZ66",
  220. "DTSJ702",
  221. "JYJG67_JYJL31",
  222. "DTBZ67",
  223. "DTSJ74",
  224. "JYJG68_JYJL31",
  225. "DTBZ68",
  226. "JYJG69_JYJL32",
  227. "DTBZ69",
  228. "JYJG70_JYJL33",
  229. "DTBZ70",
  230. "JYJG71_JYJL33",
  231. "DTBZ71",
  232. "JYJG72_JYJL34",
  233. "DTBZ72",
  234. "JYJG73_JYJL34",
  235. "DTBZ73",
  236. "JYJG74_JYJL34",
  237. "DTBZ74",
  238. "JYJG75_JYJL34",
  239. "DTBZ75",
  240. "JYJG76_JYJL35",
  241. "DTBZ76",
  242. "JYJG77_JYJL36",
  243. "DTBZ77",
  244. "JYJG78_JYJL36",
  245. "DTBZ78",
  246. "JYJG79_JYJL38",
  247. "DTBZ79",
  248. "JYJG80_JYJL39",
  249. "DTBZ80",
  250. "JYJG81_JYJL39",
  251. "DTBZ81",
  252. "JYJG82_JYJL39",
  253. "DTBZ82",
  254. "JYJG83_JYJL39",
  255. "DTBZ83",
  256. "JYJG84_JYJL40",
  257. "DTBZ84",
  258. "JYJG85_JYJL40",
  259. "DTBZ85",
  260. "JYJG86_JYJL40",
  261. "DTBZ86",
  262. "JYJG87_JYJL40",
  263. "DTBZ87",
  264. "JYJG88_JYJL41",
  265. "DTBZ88",
  266. "JYJG89_JYJL41",
  267. "DTBZ89",
  268. "JYJG90_JYJL42",
  269. "DTBZ90",
  270. "JYJG91_JYJL43",
  271. "DTBZ91",
  272. ];
  273. qgsf = {
  274. 北京市: "11",
  275. 天津市: "12",
  276. 河北省: "13",
  277. 山西省: "14",
  278. 内蒙古自治区: "15",
  279. 辽宁省: "21",
  280. 吉林省: "22",
  281. 黑龙江省: "23",
  282. 上海市: "31",
  283. 江苏省: "32",
  284. 浙江省: "33",
  285. 安徽省: "34",
  286. 福建省: "35",
  287. 江西省: "36",
  288. 山东省: "37",
  289. 河南省: "41",
  290. 湖北省: "42",
  291. 湖南省: "43",
  292. 广东省: "44",
  293. 广西壮族自治区: "45",
  294. 海南省: "46",
  295. 重庆市: "50",
  296. 四川省: "51",
  297. 贵州省: "52",
  298. 云南省: "53",
  299. 西藏自治区: "54",
  300. 陕西省: "61",
  301. 甘肃省: "62",
  302. 青海省: "63",
  303. 宁夏回族自治区: "64",
  304. 新疆维吾尔自治区: "65",
  305. 台湾省: "71",
  306. 香港特别行政区: "81",
  307. 澳门特别行政区: "82",
  308. };
  309. regions = {
  310. 银川市: {
  311. 银川市市辖区: {
  312. 兴庆区: {},
  313. 西夏区: {},
  314. 金凤区: {},
  315. },
  316. 兴庆区: {},
  317. 西夏区: {},
  318. 金凤区: {},
  319. 永宁县: {},
  320. 贺兰县: {},
  321. 灵武市: {},
  322. },
  323. 石嘴山市: {
  324. 大武口区: {},
  325. 惠农区: {},
  326. 平罗县: {},
  327. },
  328. 吴忠市: {
  329. 利通区: {},
  330. 红寺堡区: {},
  331. 盐池县: {},
  332. 同心县: {},
  333. 青铜峡市: {},
  334. },
  335. 固原市: {
  336. 原州区: {},
  337. 西吉县: {},
  338. 隆德县: {},
  339. 泾源县: {},
  340. 彭阳县: {},
  341. },
  342. 中卫市: {
  343. 中卫市市辖区: {
  344. 沙坡头区: {},
  345. },
  346. 沙坡头区: {},
  347. 中宁县: {},
  348. 海原县: {},
  349. },
  350. };
  351. nx = {
  352. 宁夏回族自治区: "640000",
  353. 银川市: "640100",
  354. 银川市市辖区: "640101",
  355. 兴庆区: "640104",
  356. 西夏区: "640105",
  357. 金凤区: "640106",
  358. 永宁县: "640121",
  359. 贺兰县: "640122",
  360. 灵武市: "640181",
  361. 石嘴山市: "640200",
  362. 大武口区: "640202",
  363. 惠农区: "640205",
  364. 平罗县: "640221",
  365. 吴忠市: "640300",
  366. 利通区: "640302",
  367. 红寺堡区: "640303",
  368. 盐池县: "640323",
  369. 同心县: "640324",
  370. 青铜峡市: "640381",
  371. 固原市: "640400",
  372. 原州区: "640402",
  373. 西吉县: "640422",
  374. 隆德县: "640423",
  375. 泾源县: "640424",
  376. 彭阳县: "640425",
  377. 中卫市: "640500",
  378. 中卫市市辖区: "640501",
  379. 沙坡头区: "640502",
  380. 中宁县: "640521",
  381. 海原县: "640522",
  382. };
  383.  
  384. keyvalarr1 = {
  385. REPORTNO: "NTD11202405871",
  386. 使用单位名称: "宁夏永建建筑工程有限公司",
  387. 设备代码: "311010339201203353",
  388. SHEBEILEIBIE: "曳引与强制驱动电梯",
  389. "内部(全面)检验日期(电类定检)": "2024年04月17日",
  390. };
  391.  
  392. keyvalarr2 = {
  393. 使用单位名称: "宁夏永建建筑工程有限公司",
  394. 使用单位组织机构代码: "916401212279302618",
  395. "设备使用(所在)地点": "永宁县团结社区日间照料中心",
  396. 设备分类代码: "曳引驱动乘客电梯",
  397. 设备型号: "DPN35",
  398. "产品编号(出厂编号)": "202209146",
  399. 使用证编号: "56",
  400. 安全管理人员: "张飞",
  401. 安全管理人员联系电话: "09514100765",
  402. 制造单位: "苏州德奥电梯有限公司",
  403. 制造日期: "2006年09月26日",
  404. GZDWMC: "-",
  405. 改造监督检验日期: "-",
  406. 维保单位名称: "宁夏通宇电梯制造发展股份有限公司",
  407. ZDSYRQ: "2023年04月",
  408. 安装监督检验日期: "2016年06月",
  409. 是否加装电梯: "否",
  410. 是否住宅电梯: "否",
  411. "内部(全面)下次检验日期(电类定检)": "2025年04月",
  412. 电梯额定载荷: "800",
  413. 电梯运行速度: "1.5",
  414. 电梯层站: "6",
  415. 电梯站数: "6",
  416. 电梯门数: "6",
  417. 控制方式: "单台集选控制",
  418. DTJYYJ: "《电梯监督检验和定期检验规则》(TSG T7001-2023)",
  419. YQSB: "详见(2)号工具箱",
  420. DTBZCS3: "-",
  421. DTBZCS4: "-",
  422. XCJYTJ: "符合",
  423. XCAQTJ: "符合",
  424. "内部(全面)检验结论(电类定检)": "合格",
  425. JYRY: "",
  426. "内部(全面)检验日期(电类定检)": "2024年04月17日",
  427. JHRY: "",
  428. JHRQ: "",
  429. };
  430. keyvalarr3 = {
  431. JYJG1_JYJL1: "",
  432. DTBZ1: "-",
  433. JYJG2_JYJL1: "×",
  434. DTBZ2: "-",
  435. JYJG3_JYJL1: "×",
  436. DTBZ3: "-",
  437. JYJG4_JYJL2: "×",
  438. DTBZ4: "-",
  439. JYJG5_JYJL2: "√",
  440. DTBZ5: "-",
  441. JYJG6_JYJL3: "√",
  442. DTBZ6: "-",
  443. JYJG7_JYJL4: "√",
  444. DTBZ7: "-",
  445. JYJG8_JYJL4: "-",
  446. DTBZ8: "-",
  447. JYJG9_JYJL4: "√",
  448. DTBZ9: "-",
  449. JYJG10_JYJL4: "√",
  450. DTBZ10: "-",
  451. JYJG11_JYJL5: "√",
  452. DTBZ11: "-",
  453. JYJG12_JYJL6: "-",
  454. DTBZ12: "-",
  455. JYJG13_JYJL6: "-",
  456. DTBZ13: "-",
  457. JYJG14_JYJL6: "-",
  458. DTBZ14: "-",
  459. JYJG15_JYJL6: "-",
  460. DTBZ15: "-",
  461. JYJG16_JYJL7: "√",
  462. DTBZ16: "-",
  463. JYJG17_JYJL8: "-",
  464. DTBZ17: "-",
  465. JYJG18_JYJL8: "-",
  466. DTBZ18: "-",
  467. JYJG19_JYJL9: "-",
  468. DTBZ19: "-",
  469. JYJG20_JYJL10: "√",
  470. DTBZ20: "-",
  471. JYJG21_JYJL11: "√",
  472. DTBZ21: "-",
  473. JYJG22_JYJL12: "√",
  474. DTBZ22: "-",
  475. JYJG23_JYJL12: "√",
  476. DTBZ23: "-",
  477. JYJG24_JYJL12: "-",
  478. DTBZ24: "-",
  479. JYJG25_JYJL13: "√",
  480. DTBZ25: "-",
  481. JYJG26_JYJL13: "√",
  482. DTBZ26: "-",
  483. JYJG27_JYJL13: "√",
  484. DTBZ27: "-",
  485. JYJG28_JYJL13: "-",
  486. DTBZ28: "-",
  487. JYJG29_JYJL13: "√",
  488. DTBZ29: "-",
  489. JYJG30_JYJL14: "-",
  490. DTBZ30: "-",
  491. JYJG31_JYJL14: "√",
  492. DTBZ31: "-",
  493. JYJG32_JYJL15: "√",
  494. DTBZ32: "-",
  495. JYJG33_JYJL15: "-",
  496. DTBZ33: "-",
  497. JYJG34_JYJL15: "-",
  498. DTBZ34: "-",
  499. JYJG35_JYJL16: "√",
  500. DTBZ35: "-",
  501. JYJG36_JYJL17: "-",
  502. DTBZ36: "-",
  503. JYJG37_JYJL18: "√",
  504. DTBZ37: "-",
  505. JYJG38_JYJL18: "√",
  506. DTBZ38: "-",
  507. JYJG39_JYJL18: "√",
  508. DTBZ39: "-",
  509. JYJG40_JYJL18: "√",
  510. DTBZ40: "-",
  511. JYJG41_JYJL19: "-",
  512. DTBZ41: "-",
  513. JYJG42_JYJL20: "-",
  514. DTBZ42: "-",
  515. };
  516.  
  517. keyvalarr4 = {
  518. JYJG43_JYJL21: "√",
  519. DTBZ43: "-",
  520. JYJG44_JYJL21: "√",
  521. DTBZ44: "-",
  522. JYJG45_JYJL21: "-",
  523. DTBZ45: "-",
  524. JYJG46_JYJL21: "√",
  525. DTBZ46: "-",
  526. JYJG47_JYJL22: "√",
  527. DTBZ47: "-",
  528. JYJG48_JYJL22: "√",
  529. DTBZ48: "-",
  530. JYJG49_JYJL23: "×",
  531. DTBZ49: "-",
  532. DTSJ503: "≤6",
  533. JYJG50_JYJL24: "√",
  534. DTBZ50: "-",
  535. DTSJ504: "≤45",
  536. JYJG51_JYJL24: "√",
  537. DTBZ51: "-",
  538. JYJG52_JYJL25: "√",
  539. DTBZ52: "-",
  540. JYJG53_JYJL26: "√",
  541. DTBZ53: "-",
  542. JYJG54_JYJL26: "√",
  543. DTBZ54: "-",
  544. JYJG55_JYJL26: "√",
  545. DTBZ55: "-",
  546. JYJG56_JYJL27: "√",
  547. DTBZ56: "-",
  548. JYJG57_JYJL27: "√",
  549. DTBZ57: "-",
  550. JYJG58_JYJL28: "√",
  551. DTBZ58: "-",
  552. JYJG59_JYJL28: "√",
  553. DTBZ59: "-",
  554. JYJG60_JYJL29: "√",
  555. DTBZ60: "-",
  556. DTSJ700: "7",
  557. JYJG61_JYJL29: "√",
  558. DTBZ61: "-",
  559. JYJG62_JYJL29: "√",
  560. DTBZ62: "-",
  561. JYJG63_JYJL29: "√",
  562. DTBZ63: "-",
  563. JYJG64_JYJL30: "√",
  564. DTBZ64: "-",
  565. JYJG65_JYJL30: "√",
  566. DTBZ65: "-",
  567. JYJG66_JYJL30: "√",
  568. DTBZ66: "-",
  569. DTSJ702: "45",
  570. JYJG67_JYJL31: "√",
  571. DTBZ67: "-",
  572. DTSJ74: "23",
  573. JYJG68_JYJL31: "-",
  574. DTBZ68: "-",
  575. JYJG69_JYJL32: "√",
  576. DTBZ69: "-",
  577. JYJG70_JYJL33: "√",
  578. DTBZ70: "-",
  579. JYJG71_JYJL33: "√",
  580. DTBZ71: "-",
  581. JYJG72_JYJL34: "√",
  582. DTBZ72: "-",
  583. JYJG73_JYJL34: "√",
  584. DTBZ73: "-",
  585. JYJG74_JYJL34: "√",
  586. DTBZ74: "-",
  587. JYJG75_JYJL34: "√",
  588. DTBZ75: "-",
  589. JYJG76_JYJL35: "√",
  590. DTBZ76: "-",
  591. JYJG77_JYJL36: "-",
  592. DTBZ77: "-",
  593. JYJG78_JYJL36: "-",
  594. DTBZ78: "-",
  595. JYJG79_JYJL38: "√",
  596. DTBZ79: "-",
  597. JYJG80_JYJL39: "-",
  598. DTBZ80: "-",
  599. JYJG81_JYJL39: "√",
  600. DTBZ81: "-",
  601. JYJG82_JYJL39: "√",
  602. DTBZ82: "-",
  603. JYJG83_JYJL39: "√",
  604. DTBZ83: "-",
  605. JYJG84_JYJL40: "-",
  606. DTBZ84: "-",
  607. JYJG85_JYJL40: "-",
  608. DTBZ85: "-",
  609. JYJG86_JYJL40: "-",
  610. DTBZ86: "-",
  611. JYJG87_JYJL40: "√",
  612. DTBZ87: "-",
  613. JYJG88_JYJL41: "√",
  614. DTBZ88: "-",
  615. JYJG89_JYJL41: "√",
  616. DTBZ89: "-",
  617. JYJG90_JYJL42: "√",
  618. DTBZ90: "-",
  619. JYJG91_JYJL43: "√",
  620. DTBZ91: "-",
  621. };
  622.  
  623. keyvalArr = {
  624. ...keyvalarr1,
  625. ...keyvalarr2,
  626. ...keyvalarr3,
  627. ...keyvalarr4,
  628. };
  629. dat = replaceValuesWithFun(keyvalArr, gett);
  630.  
  631. }
  632. function displayResult() {
  633. if (strtip.trim() === "") {
  634. strtip = "未发现问题";
  635. }
  636. input.value = strtip + "\n\n" + strinput;
  637. strtip = "";
  638. strinput = "记录填写情况:\n";
  639. tipnum = 0;
  640. }
  641. function InspectionRecordInfo() {
  642.  
  643. if (1) {
  644. //判断关键、一般项目结论与报告结论的关系
  645. if (1) {
  646. // 指定的数集合
  647. const specificNumbers = new Set([
  648. 4, 7, 9, 10, 12, 13, 18, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35,
  649. 36, 37, 38, 39, 40, 41, 42,
  650. ]);
  651. const normalNumbers = new Set([
  652. 1, 2, 3, 5, 6, 8, 11, 14, 15, 16, 17, 19, 20, 21, 22, 23, 32, 43,
  653. ]);
  654. const symbolToCheckBHG = "×";
  655. const symbolToCheckWCX = "-";
  656. const symbolToCheckFJHG = "△";
  657. //关键项目
  658. const GJbuhegeJson = getXMKeyValues(
  659. dat,
  660. specificNumbers,
  661. symbolToCheckBHG
  662. );
  663. //一般项目
  664. const YBbuhegeJson = getXMKeyValues(
  665. dat,
  666. normalNumbers,
  667. symbolToCheckBHG
  668. );
  669. //关键项目复检合格
  670. const GJFJHGJson = getXMKeyValues(
  671. dat,
  672. specificNumbers,
  673. symbolToCheckFJHG
  674. );
  675. //一般项目复检合格
  676. const YBFJHGJson = getXMKeyValues(
  677. dat,
  678. normalNumbers,
  679. symbolToCheckFJHG
  680. );
  681.  
  682. if (Object.keys(GJbuhegeJson).length === 0) {
  683. if (Object.keys(YBbuhegeJson).length === 0) {
  684. if (gett("内部(全面)检验结论(电类定检)") != "合格") {
  685. addstrtip("检验项目全部符合,检验结论应该为“合格”!");
  686. }
  687. } else if (
  688. Object.keys(YBbuhegeJson).length +
  689. Object.keys(YBFJHGJson).length <=
  690. 3
  691. ) {
  692. // 初始化一个数组来存储提取的数字
  693. const extractedNumbers = [];
  694. // 遍历JSON对象的每个键
  695. for (const key in YBbuhegeJson) {
  696. // 使用正则表达式匹配"JYJL"后面的数字
  697. const match = key.match(/JYJL(\d+)/);
  698. if (match) {
  699. // 如果找到了匹配项,则将数字添加到数组中
  700. extractedNumbers.push(parseInt(match[1], 10)); // 使用parseInt将字符串转换为整数
  701. }
  702. }
  703. // 如果你只想要唯一的数字,并且不关心它们在原始JSON中的顺序,可以使用Set来去除重复项
  704. const uniqueNumbers = [...new Set(extractedNumbers)];
  705. if (!validateString1(dat.DTBZCS3, uniqueNumbers)) {
  706. addstrtip(
  707. "关键项目全部符合,一般项目不符合监护使用项及整改后符合项共不超过3项,备注有误!备注模板“本记录第1、2、3项的检验结果为不符合,使用单位已经承诺采取安全措施,对电梯实行监护使用(见编号为TZS-DT-2401804的《电梯检验意见通知书》)”,考虑格式、不符合项序号、意见通知书年份等是否有误!"
  708. );
  709. }
  710. if (gett("内部(全面)检验结论(电类定检)") != "整改后合格") {
  711. addstrtip(
  712. "关键项目全部符合,一般项目不符合监护使用及整改后符合项共不超过3项,检验结论应该为“整改后合格”!"
  713. );
  714. }
  715. } else if (
  716. Object.keys(YBbuhegeJson).length +
  717. Object.keys(YBFJHGJson).length >
  718. 3
  719. ) {
  720. addstrtip(
  721. "关键项目全部符合,一般项目不符合监护使用项及整改后符合项共超过3项,一般项目都应打“×””!"
  722. );
  723. } else if (Object.keys(YBbuhegeJson).length > 3) {
  724. if (gett("内部(全面)检验结论(电类定检)") != "不合格") {
  725. addstrtip(
  726. "关键项目全部符合,一般项目不符合共超过3项,检验结论应该为“不合格”!"
  727. );
  728. }
  729. }
  730. } else {
  731. if (gett("内部(全面)检验结论(电类定检)") != "不合格") {
  732. addstrtip("关键项目有不符合,检验结论应该为“不合格”!");
  733. }
  734. }
  735. const xiangmuBeizuJson = checkDTBZValues(dat);
  736. if (dat.DTBZ44 != "") {
  737. if (Object.keys(xiangmuBeizuJson).length > 1) {
  738. //"JYJG44_JYJL21":"√","DTBZ44":"-"对重块
  739. addstrtip("除对重块备注外仍有检验项目备注不是空!");
  740. }
  741. } else if (Object.keys(xiangmuBeizuJson).length > 0) {
  742. //"JYJG44_JYJL21":"√","DTBZ44":"-"对重块
  743. addstrtip("除对重块备注外仍有检验项目备注不是空!");
  744. }
  745. }
  746. //1-9
  747. //"JYJG1_JYJL1":"√","DTBZ1":""
  748. if (1) {
  749. //1
  750. if (dat.JYJG1_JYJL1 === "×") {
  751. addstrtip(
  752. "备注应说明“未注册(不可用),请持不合格报告到市民大厅办理注册(不可用)后重新报检!”"
  753. );
  754. }
  755. //4
  756. if (dat.JYJG8_JYJL4 === "-") {
  757. if (parseFloat(dat.电梯运行速度) > 1) {
  758. addstrtip("电梯速度与缓冲器类型不匹配!");
  759. }
  760. }
  761. //5
  762. if (supervisionDate != null) {
  763. const curdate = new Date();
  764. if (curdate.getFullYear() - supervisionDate.getFullYear() > 14) {
  765. if (dat.JYJG11_JYJL5 === "-") {
  766. addstrtip("注意超过15年的电梯应检验第5项接地故障保护!");
  767. }
  768. }
  769. if (curdate.getFullYear() - supervisionDate.getFullYear() < 15) {
  770. if (dat.JYJG11_JYJL5 != "-") {
  771. addstrtip("不超过15年的第5项电梯接地故障保护不需要检验!");
  772. }
  773. }
  774. }
  775. //6
  776. //"JYJG12_JYJL6":"","DTBZ12":"","JYJG13_JYJL6":"","DTBZ13":""
  777. //,"JYJG14_JYJL6":"","DTBZ14":"","JYJG15_JYJL6":"","DTBZ15":""
  778. if (supervisionDate != null) {
  779. if (supervisionDate < new Date("2017-10-01")) {
  780. if (
  781. dat.JYJG12_JYJL6 != "-" ||
  782. dat.JYJG13_JYJL6 != "-" ||
  783. dat.JYJG14_JYJL6 != "-" ||
  784. dat.JYJG15_JYJL6 != "-"
  785. ) {
  786. addstrtip("注意2017.10.1以前的电梯没有第6项旁路装置!");
  787. }
  788. }
  789. if (supervisionDate >= new Date("2017-10-01")) {
  790. if (
  791. dat.JYJG12_JYJL6 === "-" ||
  792. dat.JYJG13_JYJL6 === "-" ||
  793. dat.JYJG14_JYJL6 === "-" ||
  794. dat.JYJG15_JYJL6 === "-"
  795. ) {
  796. addstrtip("注意2017.10.1以后的电梯有第6项旁路装置!");
  797. }
  798. }
  799. }
  800. //7
  801. if (supervisionDate != null) {
  802. if (supervisionDate < new Date("2017-10-01")) {
  803. if (dat.JYJG16_JYJL7 != "-") {
  804. addstrtip(
  805. "注意2017.10.1以前的电梯不检验第7项制动器状态监测功能!"
  806. );
  807. }
  808. }
  809. if (supervisionDate >= new Date("2017-10-01")) {
  810. if (dat.JYJG16_JYJL7 === "-") {
  811. addstrtip(
  812. "注意2017.10.1以后的电梯应检验第7项制动器状态监测功能!"
  813. );
  814. }
  815. }
  816. }
  817. }
  818. //10-19
  819. if (1) {
  820. //10
  821. //10."JYJG20_JYJL10":"","DTBZ20":""
  822. if (1) {
  823. if (dat.JYJG20_JYJL10 === "-") {
  824. addstrtip("注意第10项紧急报警装置是否应设置!");
  825. }
  826. }
  827. //12
  828. //"JYJG22_JYJL12":"","DTBZ22":"","JYJG23_JYJL12":"","DTBZ23":"","JYJG24_JYJL12":"","DTBZ24":""
  829. if (supervisionDate != null) {
  830. if (supervisionDate < new Date('2024-04-02')) {
  831. if (dat.JYJG22_JYJL12 != "-") {
  832. addstrtip("未按照TSG T7001-2023监督检验的电梯,12-1不检验!");
  833. }
  834. }
  835. if (supervisionDate >= new Date('2024-04-02')) {
  836. if (dat.JYJG22_JYJL12 === "-") {
  837. addstrtip("按照TSG T7001-2023监督检验的电梯,12-1需要检验!");
  838. }
  839. }
  840. }
  841. //13手动紧急操作装置
  842. //JYJG28_JYJL13
  843. if (manufactureDate != null) {
  844. if (manufactureDate < new Date('2004-01-01')) {
  845. if (dat.JYJG28_JYJL13 != "-") {
  846. addstrtip(
  847. "按照GB7588-1995及更早标准生产的电梯,如果未依据TSG T7001、2023检验,第13(4)是否不检验!"
  848. );
  849. }
  850. }
  851. if (manufactureDate >= new Date('2004-01-01')) {
  852. if (dat.JYJG28_JYJL13 === "-") {
  853. addstrtip(
  854. "注意按照GB7588-2003及之后新标准生产的电梯,若带有盘车手轮,第13(4)是否应检验!"
  855. );
  856. }
  857. }
  858. if (dat.JYJG27_JYJL13 === '-') {
  859. if (dat.JYJG28_JYJL13 != '-') {
  860. addstrtip('若13(3)无此项,那么13(4)也应是无此项!');
  861. }
  862. }
  863. if (dat.JYJG28_JYJL13 != '-') {
  864. if (dat.JYJG27_JYJL13 === '-') {
  865. addstrtip('若13(4)符合,那么13(3)也应是符合!');
  866. }
  867. }
  868. }
  869. if ((dat.JYJG27_JYJL13 != '-' || dat.JYJG28_JYJL13 != '-') && dat.JYJG19_JYJL9 != '-') {
  870. addstrtip('注意第9项和第13(3)(4)项是否可以同时勾选!');
  871. }
  872. //14、15
  873. //钢丝绳、包覆带
  874. if (1) {
  875. if (dat.JYJG30_JYJL14 != "-" || dat.JYJG31_JYJL14 != "-") {
  876. if (
  877. dat.JYJG32_JYJL15 != "-" ||
  878. dat.JYJG33_JYJL15 != "-" ||
  879. dat.JYJG34_JYJL15 != "-"
  880. ) {
  881. addstrtip("14、15钢丝绳和包覆带有同时勾选!");
  882. }
  883. }
  884. if (supervisionDate != null) {
  885. const curdate = new Date();
  886. if (curdate.getFullYear() - supervisionDate.getFullYear() < 15) {
  887. if (dat.JYJG30_JYJL14 != "-" || dat.JYJG31_JYJL14 != "-") {
  888. addstrtip("不超过15年的电梯14项钢丝绳不需要检验!");
  889. }
  890. }
  891. }
  892. if (supervisionDate != null) {
  893. const curdate = new Date();
  894. if (curdate.getFullYear() - supervisionDate.getFullYear() < 15) {
  895. if (
  896. dat.JYJG32_JYJL15 != "-" ||
  897. dat.JYJG33_JYJL15 != "-" ||
  898. dat.JYJG34_JYJL15 != "-"
  899. ) {
  900. addstrtip("不超过15年的电梯15项包覆带不需要检验!");
  901. }
  902. }
  903. }
  904. if (supervisionDate != null) {
  905. const curdate = new Date();
  906. if (curdate.getFullYear() - supervisionDate.getFullYear() > 14) {
  907. if (dat.JYJG30_JYJL14 === "-" && dat.JYJG31_JYJL14 === "-") {
  908. if (
  909. dat.JYJG32_JYJL15 === "-" ||
  910. dat.JYJG33_JYJL15 === "-" ||
  911. dat.JYJG34_JYJL15 === "-"
  912. ) {
  913. addstrtip("注意超过15年的电梯,14、15钢丝绳和包覆带至少选一类!");
  914. }
  915. }
  916. }
  917. }
  918. if (supervisionDate != null) {
  919. if (supervisionDate < new Date('2024-04-02')) {
  920. if (dat.JYJG33_JYJL15 != "-" || dat.JYJG34_JYJL15 != "-") {
  921. addstrtip(
  922. "未按照TSG T7001-2023监督检验的电梯,15-2、3不检验!"
  923. );
  924. }
  925. }
  926. if (supervisionDate >= new Date('2024-04-02')) {
  927. if (dat.JYJG33_JYJL15 === "-" || dat.JYJG34_JYJL15 === "-") {
  928. addstrtip(
  929. "按照TSG T7001-2023监督检验的电梯,15-2、3需要检验!"
  930. );
  931. }
  932. }
  933. }
  934. }
  935. //16悬挂装置端部固定
  936. if (supervisionDate != null) {
  937. const curdate = new Date();
  938. if (curdate.getFullYear() - supervisionDate.getFullYear() > 14) {
  939. if (dat.JYJG35_JYJL16 === "-") {
  940. addstrtip("注意超过15年的电梯应检验第16项悬挂装置端部固定!");
  941. }
  942. }
  943. if (curdate.getFullYear() - supervisionDate.getFullYear() < 15) {
  944. if (dat.JYJG35_JYJL16 != "-") {
  945. addstrtip("不超过15年的第16项悬挂装置端部固定不需要检验!");
  946. }
  947. }
  948. }
  949. //18_JYJL18))
  950. //速度与反绳轮
  951.  
  952. if (1) {
  953. if (supervisionDate >= new Date("2024-04-02")) {
  954. if (parseFloat(dat.电梯运行速度) <= 1.75) {
  955. if (
  956. !(
  957. (dat.JYJG37_JYJL18 === "-" &&
  958. dat.JYJG38_JYJL18 === "-" &&
  959. dat.JYJG39_JYJL18 === "-" &&
  960. dat.JYJG40_JYJL18 === "-") ||
  961. (dat.JYJG37_JYJL18 != "-" &&
  962. dat.JYJG38_JYJL18 != "-" &&
  963. dat.JYJG39_JYJL18 != "-" &&
  964. dat.JYJG40_JYJL18 != "-")
  965. )
  966. ) {
  967. addstrtip("2024-04-02及之后监督,速度不大于1.75,第18项全部有(采用非金属)或者无此项(采用金属)!");
  968. }
  969. if (dat.JYJG37_JYJL18 != "-" &&
  970. dat.JYJG38_JYJL18 != "-" &&
  971. dat.JYJG39_JYJL18 != "-" &&
  972. dat.JYJG40_JYJL18 != "-") {
  973. if (!(dat.JYJG37_JYJL18 === "√" || dat.JYJG37_JYJL18 === "△")) {
  974. addstrtip('2024-04-02及之后监督,速度不大于1.75,第18项采用非金属反绳轮时,18(1)应为符合或整改后符合!');
  975. }
  976. }
  977. } else {
  978. if (!(dat.JYJG37_JYJL18 === "-" &&
  979. dat.JYJG38_JYJL18 === "-" &&
  980. dat.JYJG39_JYJL18 === "-" &&
  981. dat.JYJG40_JYJL18 === "-")) {
  982. addstrtip('2024-04-02及之后监督,速度大于1.75,第18项只能采用金属反绳轮!');
  983. }
  984. }
  985. } else {
  986. if (parseFloat(dat.电梯运行速度) <= 1.75) {
  987. if (!(dat.JYJG37_JYJL18 === "-" &&
  988. dat.JYJG38_JYJL18 === "-" &&
  989. dat.JYJG39_JYJL18 === "-" &&
  990. dat.JYJG40_JYJL18 === "-")) {
  991. if (dat.JYJG39_JYJL18 != "-" &&
  992. dat.JYJG40_JYJL18 != "-") {
  993. if (!(dat.JYJG37_JYJL18 === "√" || dat.JYJG37_JYJL18 === "△" || dat.JYJG37_JYJL18 === "-")) {
  994. addstrtip('2024-04-02之前监督,速度不大于1.75,第18项采用非金属反绳轮时,18(1)应为符合、整改后符合或无此项!');
  995. }
  996. if (!(dat.JYJG38_JYJL18 === "√" || dat.JYJG38_JYJL18 === "△" || dat.JYJG38_JYJL18 === "-")) {
  997. addstrtip('2024-04-02之前监督,速度不大于1.75,第18项采用非金属反绳轮时,18(2)应为符合、整改后符合或无此项!');
  998. }
  999. } else {
  1000. addstrtip('2024-04-02之前监督,速度不大于1.75,第18项采用非金属反绳轮时,18(3)(4)都应不是无此项!');
  1001. }
  1002. }
  1003. } else {
  1004. if (!(dat.JYJG37_JYJL18 === "-" &&
  1005. dat.JYJG38_JYJL18 === "-" &&
  1006. dat.JYJG39_JYJL18 === "-" &&
  1007. dat.JYJG40_JYJL18 === "-")) {
  1008. if (dat.JYJG39_JYJL18 != "-" &&
  1009. dat.JYJG40_JYJL18 != "-") {
  1010. if (dat.JYJG37_JYJL18 != "-") {
  1011. addstrtip('2024-04-02之前监督,速度大于1.75,第18项采用非金属反绳轮时,18(1)应为无此项!');
  1012. }
  1013. if (!(dat.JYJG38_JYJL18 === "√" || dat.JYJG38_JYJL18 === "△" || dat.JYJG38_JYJL18 === "-")) {
  1014. addstrtip('2024-04-02之前监督,速度大于1.75,第18项采用非金属反绳轮时,18(2)应为符合、整改后符合或无此项!');
  1015. }
  1016. } else {
  1017. addstrtip('2024-04-02之前监督,速度大于1.75,第18项采用非金属反绳轮时,18(3)(4)都应不是无此项!');
  1018. }
  1019. }
  1020. }
  1021. }
  1022. }
  1023. }
  1024. //20-29
  1025. if (1) {
  1026. //21对重块数量或高度
  1027. //"JYJG44_JYJL21":"√","DTBZ44":"-"
  1028. if (dat.JYJG44_JYJL21 === "√") {
  1029. if (
  1030. !/^\d+(\.\d+)?\s*(块|厘米|cm|毫米|mm|米|m)$/i.test(dat.DTBZ44)
  1031. ) {
  1032. addstrtip("第21(2)对重块备注信息填写错误!");
  1033. }
  1034. }
  1035. if (supervisionDate < new Date("2024-04-02")) {
  1036. if (dat.JYJG45_JYJL21 != '-') {
  1037. addstrtip('注意2024.4.2之前监督检验的电梯,21(3)是否不检验!')
  1038. }
  1039. } else {
  1040. if (dat.JYJG45_JYJL21 === '-') {
  1041. addstrtip('注意2024.4.2及之后监督检验的电梯,21(3)是否需要检验!')
  1042. }
  1043. }
  1044. //23轿厢语音播报系统
  1045. if (supervisionDate != null) {
  1046. if (supervisionDate < new Date('2024-04-02')) {
  1047. if (dat.JYJG49_JYJL23 != "-") {
  1048. addstrtip("未按照TSG T7001-2023监督检验的电梯,第23项不检验!");
  1049. }
  1050. }
  1051. if (supervisionDate >= new Date('2024-04-02')) {
  1052. if (dat.JYJG49_JYJL23 === "-") {
  1053. addstrtip("按照TSG T7001-2023监督检验的电梯,第23项需要检验!");
  1054. }
  1055. }
  1056. }
  1057. //24门扇间隙
  1058. if (
  1059. (dat.JYJG50_JYJL24 === "-" && dat.DTSJ503 != "-") ||
  1060. (dat.JYJG50_JYJL24 != "-" && dat.DTSJ503 === "-")
  1061. ) {
  1062. addstrtip("第24项门间隙(1)测量数据与结果矛盾!");
  1063. }
  1064. if (
  1065. (dat.JYJG51_JYJL24 === "-" && dat.DTSJ504 != "-") ||
  1066. (dat.JYJG51_JYJL24 != "-" && dat.DTSJ504 === "-")
  1067. ) {
  1068. addstrtip("第24项门间隙(2)测量数据与结果矛盾!");
  1069. }
  1070. if (supervisionDate != null) {
  1071. const curdate = new Date();
  1072. if (curdate.getFullYear() - supervisionDate.getFullYear() > 14) {
  1073. if (
  1074. dat.JYJG50_JYJL24 === "-" ||
  1075. dat.JYJG51_JYJL24 === "-" ||
  1076. dat.DTSJ503 === "-" ||
  1077. dat.DTSJ504 === "-"
  1078. ) {
  1079. addstrtip("注意超过15年的电梯应检验第24项门间隙!");
  1080. } else {
  1081. if (dat.设备分类代码 === "曳引驱动乘客电梯") {
  1082. if (/^([1-9]\d*(\.\d+)?|0\.\d+)(mm|MM|毫米)?$/.test(dat.DTSJ503)) {
  1083. if (
  1084. parseFloat(dat.DTSJ503) <= 6 &&
  1085. parseFloat(dat.DTSJ503) >= 0
  1086. ) {
  1087. if (dat.JYJG50_JYJL24 === "×") {
  1088. addstrtip(
  1089. "第24项门间隙(1)实测值:" + dat.DTSJ503 + "应为符合!"
  1090. );
  1091. }
  1092. } else if (parseFloat(dat.DTSJ503) > 6) {
  1093. if (dat.JYJG50_JYJL24 != "×") {
  1094. addstrtip(
  1095. "第24项门间隙(1)实测值:" +
  1096. dat.DTSJ503 +
  1097. "应为不符合!"
  1098. );
  1099. }
  1100. }
  1101. } else if (/^≤6(mm|MM|毫米)?$/.test(dat.DTSJ503)) {
  1102. if (dat.JYJG50_JYJL24 === "×") {
  1103. addstrtip(
  1104. "第24项门间隙(1)目测值:" + dat.DTSJ503 + "应为符合!"
  1105. );
  1106. }
  1107. } else {
  1108. addstrtip("第24项门间隙(1)测量值格式错误!");
  1109. }
  1110. } else if (dat.设备分类代码 === "曳引驱动载货电梯") {
  1111. if (/^([1-9]\d*(\.\d+)?|0\.\d+)(mm|MM|毫米)?$/.test(dat.DTSJ503)) {
  1112. if (
  1113. parseFloat(dat.DTSJ503) <= 10 &&
  1114. parseFloat(dat.DTSJ503) >= 0
  1115. ) {
  1116. if (dat.JYJG50_JYJL24 === "×") {
  1117. addstrtip(
  1118. "第24项门间隙(1)实测值:" + dat.DTSJ503 + "应为符合!"
  1119. );
  1120. }
  1121. } else if (parseFloat(dat.DTSJ503) > 10) {
  1122. if (dat.JYJG50_JYJL24 != "×") {
  1123. addstrtip(
  1124. "第24项门间隙(1)实测值:" +
  1125. dat.DTSJ503 +
  1126. "应为不符合!"
  1127. );
  1128. }
  1129. }
  1130. } else if (/^≤10(mm|MM|毫米)?$/.test(dat.DTSJ503)) {
  1131. if (dat.JYJG50_JYJL24 === "×") {
  1132. addstrtip(
  1133. "第24项门间隙(1)目测值:" + dat.DTSJ503 + "应为符合!"
  1134. );
  1135. } else {
  1136. addstrtip("第24项门间隙(1)测量值格式错误!");
  1137. }
  1138. }
  1139. }
  1140. if (/^([1-9]\d*(\.\d+)?|0\.\d+)(mm|MM|毫米)?$/.test(dat.DTSJ504)) {
  1141. if (parseFloat(dat.DTSJ504) <= 30) {
  1142. if (dat.JYJG51_JYJL24 === "×") {
  1143. addstrtip(
  1144. "第24项门间隙(2)实测值:" + dat.DTSJ504 + "应为符合!"
  1145. );
  1146. }
  1147. } else if (
  1148. parseFloat(dat.DTSJ504) > 30 &&
  1149. parseFloat(dat.DTSJ504) <= 45
  1150. ) {
  1151. if (dat.JYJG51_JYJL24 === "×") {
  1152. addstrtip(
  1153. "若为中分门,第24项门间隙(2)实测值:" +
  1154. dat.DTSJ504 +
  1155. "应为符合!"
  1156. );
  1157. } else if (dat.JYJG51_JYJL24 != "×") {
  1158. addstrtip(
  1159. "若为旁开门,第24项门间隙(2)实测值:" +
  1160. dat.DTSJ504 +
  1161. "应为不符合!"
  1162. );
  1163. }
  1164. } else {
  1165. if (dat.JYJG51_JYJL24 != "×") {
  1166. addstrtip(
  1167. "第24项门间隙(2)实测值:" + dat.DTSJ504 + "应为不符合!"
  1168. );
  1169. }
  1170. }
  1171. } else if (dat.DTSJ504 === "≤45(mm|MM|毫米)?") {
  1172. if (dat.JYJG51_JYJL24 === "×") {
  1173. addstrtip(
  1174. "第24项门间隙(2)实测值:" + dat.DTSJ504 + "应为符合!"
  1175. );
  1176. }
  1177. } else {
  1178. addstrtip("第24项门间隙(2)实测值格式错误!");
  1179. }
  1180. }
  1181. }
  1182. if (curdate.getFullYear() - supervisionDate.getFullYear() < 15) {
  1183. if (
  1184. dat.JYJG50_JYJL24 != "-" ||
  1185. dat.JYJG51_JYJL24 != "-" ||
  1186. dat.DTSJ503 != "-" ||
  1187. dat.DTSJ504 != "-"
  1188. ) {
  1189. addstrtip("不超过15年的第24项门间隙不需要检验!");
  1190. }
  1191. }
  1192. }
  1193. //26门的运行和导向装置
  1194. if (supervisionDate != null) {
  1195. if (supervisionDate < new Date('2024-04-02')) {
  1196. if (dat.JYJG55_JYJL26 != "-") {
  1197. addstrtip(
  1198. "注意2024.04.02以前监督检验的电梯不检验第26项(3)层门啮合标记!"
  1199. );
  1200. }
  1201. }
  1202. if (supervisionDate >= new Date('2024-04-02')) {
  1203. if (dat.JYJG55_JYJL26 === "-") {
  1204. addstrtip(
  1205. "注意2024.04.02及以后监督检验的电梯应检验第26项(3)层门啮合标记!"
  1206. );
  1207. }
  1208. }
  1209. }
  1210. //28紧急开锁
  1211. if (supervisionDate != null) {
  1212. if (supervisionDate < new Date('2024-04-02')) {
  1213. if (dat.JYJG59_JYJL28 != "-") {
  1214. addstrtip("注意2024.04.02以前监督检验的电梯不检验第28项(2)紧急开锁!");
  1215. }
  1216. }
  1217. if (supervisionDate >= new Date('2024-04-02')) {
  1218. if (dat.JYJG59_JYJL28 === "-") {
  1219. addstrtip("注意2024.04.02及以后监督检验的电梯应检验第28项(2)紧急开锁!");
  1220. }
  1221. }
  1222. }
  1223. //29门的锁紧
  1224. //"JYJG60_JYJL29":"","DTBZ60":"","DTSJ700":"7mm","JYJG61_JYJL29":"","DTBZ61":"","JYJG62_JYJL29":"","DTBZ62":"","JYJG63_JYJL29":"","DTBZ63":""
  1225. if (
  1226. (dat.JYJG61_JYJL29 === "-" && dat.DTSJ700 != "-") ||
  1227. (dat.JYJG61_JYJL29 != "-" && dat.DTSJ700 === "-")
  1228. ) {
  1229. addstrtip("第29项门锁紧(2)测量数据与结果矛盾!");
  1230. }
  1231. if (/^(>|≥|大于|大于等于)?([1-9]\d*(\.\d+)?|0\.\d+)?(mm|MM|毫米)?$/.test(dat.DTSJ700)) {
  1232. if (dat.JYJG61_JYJL29 === "√" || dat.JYJG61_JYJL29 === "△") {
  1233. if (parseFloat(dat.DTSJ700) < 7) {
  1234. addstrtip("第29项锁紧啮合深度测量数据显示结果应为不符合!");
  1235. }
  1236. }
  1237. if (dat.JYJG61_JYJL29 === "×") {
  1238. if (parseFloat(dat.DTSJ700) >= 7) {
  1239. addstrtip("第29项锁紧啮合深度测量数据显示结果应为符合!");
  1240. }
  1241. }
  1242. } else {
  1243. addstrtip("第29项锁紧啮合深度测量数值格式错误!");
  1244. }
  1245. }
  1246. //30-39
  1247. if (1) {
  1248. //31平衡系数
  1249. //DTSJ702,"JYJG67_JYJL31":"","DTBZ67":"","DTSJ74":"","JYJG68_JYJL31":"","DTBZ68":""
  1250. if (1) {
  1251. if (
  1252. (dat.JYJG67_JYJL31 === "-" && dat.DTSJ702 != "-") ||
  1253. (dat.JYJG67_JYJL31 != "-" && dat.DTSJ702 === "-")
  1254. ) {
  1255. addstrtip("第31项平衡系数(1)测量数据与结果矛盾!");
  1256. }
  1257. if (
  1258. (dat.JYJG68_JYJL31 === "-" && dat.DTSJ74 != "-") ||
  1259. (dat.JYJG68_JYJL31 != "-" && dat.DTSJ74 === "-")
  1260. ) {
  1261. addstrtip("第31项平衡系数(2)测量数据与结果矛盾!");
  1262. }
  1263. if (dat.JYJG90_JYJL42 != "-") {
  1264. if (/^([1-9]\d*(\.\d+)?|0\.\d+)$/.test(dat.DTSJ702)) {
  1265. if (dat.JYJG67_JYJL31 === "√" || dat.JYJG67_JYJL31 === "△") {
  1266. if (
  1267. parseFloat(dat.DTSJ702) < 40 ||
  1268. parseFloat(dat.DTSJ702) > 50
  1269. ) {
  1270. addstrtip("第31项平衡系数(1)测量数据显示结果应为不符合!");
  1271. }
  1272. }
  1273. if (dat.JYJG67_JYJL31 === "×") {
  1274. if (
  1275. parseFloat(dat.DTSJ702) >= 40 &&
  1276. parseFloat(dat.DTSJ702) <= 50
  1277. ) {
  1278. addstrtip("第31项平衡系数(1)测量数据显示结果应为符合!");
  1279. }
  1280. }
  1281. if (dat.JYJG67_JYJL31 === "-") {
  1282. addstrtip("第31项平衡系数(1)测量数据与结果矛盾!");
  1283. }
  1284. if (dat.JYJG67_JYJL31 === "×") {
  1285. const rs32_34 =
  1286. dat.JYJG69_JYJL32 !== "-" ||
  1287. dat.JYJG70_JYJL33 !== "-" ||
  1288. dat.JYJG71_JYJL33 !== "-" ||
  1289. dat.JYJG72_JYJL34 !== "-" ||
  1290. dat.JYJG73_JYJL34 !== "-" ||
  1291. dat.JYJG74_JYJL34 !== "-" ||
  1292. dat.JYJG75_JYJL34 !== "-";
  1293. const rs35_39 =
  1294. dat.JYJG76_JYJL35 !== "-" ||
  1295. dat.JYJG77_JYJL36 !== "-" ||
  1296. dat.JYJG78_JYJL36 !== "-" ||
  1297. dat.JYJG79_JYJL38 !== "-" ||
  1298. dat.JYJG80_JYJL39 !== "-" ||
  1299. dat.JYJG81_JYJL39 !== "-" ||
  1300. dat.JYJG82_JYJL39 !== "-" ||
  1301. dat.JYJG83_JYJL39 !== "-";
  1302. const rs40_43 =
  1303. dat.JYJG84_JYJL40 !== "-" ||
  1304. dat.JYJG85_JYJL40 !== "-" ||
  1305. dat.JYJG86_JYJL40 !== "-" ||
  1306. dat.JYJG87_JYJL40 !== "-" ||
  1307. dat.JYJG88_JYJL41 !== "-" ||
  1308. dat.JYJG89_JYJL41 !== "-" ||
  1309. dat.JYJG90_JYJL42 !== "-" ||
  1310. dat.JYJG91_JYJL43 !== "-";
  1311. if (rs32_34 || rs35_39 || rs40_43) {
  1312. addstrtip("平衡系数不合格,第32-43项应为“-”!");
  1313. }
  1314. }
  1315. } else {
  1316. addstrtip("第31项平衡系数(1)测量数值格式错误!");
  1317. }
  1318. const phxs2 = document
  1319. .getElementById("1701504018295d212")
  1320. .innerText.trim();
  1321. if (phxs2 != "-" || dat.JYJG68_JYJL31 != "-") {
  1322. addstrtip("制动试验时只进行第31项(1)的检验!");
  1323. }
  1324. } else {
  1325. if (dat.DTSJ702 != "-" || dat.JYJG67_JYJL31 != "-") {
  1326. addstrtip("没有制动试验时只进行第31项(2)的检验!");
  1327. }
  1328. const phxs22 = document
  1329. .getElementById("1701504018295d212")
  1330. .innerText.trim();
  1331. if (/^([1-9]\d*(\.\d+)?|0\.\d+)$/.test(phxs22)) {
  1332. if (dat.JYJG68_JYJL31 === "√" || dat.JYJG68_JYJL31 === "△") {
  1333. if (parseFloat(phxs22) < 40 || parseFloat(phxs22) > 50) {
  1334. addstrtip("第31项平衡系数(2)测量数据显示结果应为不符合!");
  1335. }
  1336. }
  1337. if (dat.JYJG68_JYJL31 === "×") {
  1338. if (parseFloat(phxs22) >= 40 && parseFloat(phxs22) <= 50) {
  1339. addstrtip("第31项平衡系数(2)测量数据显示结果应为符合!");
  1340. }
  1341. }
  1342. if (dat.JYJG68_JYJL31 === "-") {
  1343. addstrtip("第31项平衡系数(2)测量数据与结果矛盾!");
  1344. }
  1345. if (dat.JYJG68_JYJL31 === "×") {
  1346. const rs32_34 =
  1347. dat.JYJG69_JYJL32 !== "-" ||
  1348. dat.JYJG70_JYJL33 !== "-" ||
  1349. dat.JYJG71_JYJL33 !== "-" ||
  1350. dat.JYJG72_JYJL34 !== "-" ||
  1351. dat.JYJG73_JYJL34 !== "-" ||
  1352. dat.JYJG74_JYJL34 !== "-" ||
  1353. dat.JYJG75_JYJL34 !== "-";
  1354. const rs35_39 =
  1355. dat.JYJG76_JYJL35 !== "-" ||
  1356. dat.JYJG77_JYJL36 !== "-" ||
  1357. dat.JYJG78_JYJL36 !== "-" ||
  1358. dat.JYJG79_JYJL38 !== "-" ||
  1359. dat.JYJG80_JYJL39 !== "-" ||
  1360. dat.JYJG81_JYJL39 !== "-" ||
  1361. dat.JYJG82_JYJL39 !== "-" ||
  1362. dat.JYJG83_JYJL39 !== "-";
  1363. const rs40_43 =
  1364. dat.JYJG84_JYJL40 !== "-" ||
  1365. dat.JYJG85_JYJL40 !== "-" ||
  1366. dat.JYJG86_JYJL40 !== "-" ||
  1367. dat.JYJG87_JYJL40 !== "-" ||
  1368. dat.JYJG88_JYJL41 !== "-" ||
  1369. dat.JYJG89_JYJL41 !== "-" ||
  1370. dat.JYJG90_JYJL42 !== "-" ||
  1371. dat.JYJG91_JYJL43 !== "-";
  1372. if (rs32_34 || rs35_39 || rs40_43) {
  1373. addstrtip("平衡系数不合格,第32-43项应为“-”!");
  1374. }
  1375. }
  1376. } else {
  1377. if (/^40(%)?-50$/.test(phxs22)) {
  1378. if (dat.JYJG68_JYJL31 === "×") {
  1379. addstrtip('第31项平衡系数(2)"40-50"表明结果应为符合!');
  1380. }
  1381. } else {
  1382. addstrtip("第31项平衡系数(2)测量数值格式错误!");
  1383. }
  1384. }
  1385. }
  1386. }
  1387. }
  1388. //39 上行超速保护
  1389. //"JYJG80_JYJL39":"","DTBZ80":"","JYJG81_JYJL39":"","DTBZ81":"","JYJG82_JYJL39":"","DTBZ82":"","JYJG83_JYJL39":"","DTBZ83":""
  1390. if (manufactureDate != null) {
  1391. if (manufactureDate < new Date(2004, 0, 1)) {
  1392. if (
  1393. dat.JYJG80_JYJL39 != "-" ||
  1394. dat.JYJG81_JYJL39 != "-" ||
  1395. dat.JYJG83_JYJL39 != "-"
  1396. ) {
  1397. addstrtip("注意2004.1.1之前制造的电梯,上行超速保护是否不检验!");
  1398. }
  1399. }
  1400. if (manufactureDate > new Date(2004, 0, 1)) {
  1401. if (
  1402. dat.JYJG80_JYJL39 === "-" ||
  1403. dat.JYJG81_JYJL39 === "-" ||
  1404. dat.JYJG83_JYJL39 === "-"
  1405. ) {
  1406. addstrtip(
  1407. "注意2004.1.1之后制造的电梯,上行超速保护是否需要检验!"
  1408. );
  1409. }
  1410. }
  1411. }
  1412. if (supervisionDate != null) {
  1413. if (supervisionDate < new Date(2016, 6, 1)) {
  1414. if (
  1415. dat.JYJG82_JYJL39 != "-"
  1416. ) {
  1417. addstrtip("注意2016.7.1之前监督的电梯,上行超速保护是否不检验!");
  1418. }
  1419. }
  1420. if (supervisionDate > new Date(2016, 6, 1)) {
  1421. if (
  1422. dat.JYJG82_JYJL39 === "-"
  1423. ) {
  1424. addstrtip(
  1425. "注意2016.7.1之后监督的电梯,上行超速保护是否需要检验!"
  1426. );
  1427. }
  1428. }
  1429. }
  1430. //40-43
  1431. if (1) {
  1432. //40 轿厢意外移动
  1433. //40."JYJG84_JYJL40":"","DTBZ84":"","JYJG85_JYJL40":"","DTBZ85":"","JYJG86_JYJL40":"","DTBZ86":"","JYJG87_JYJL40":"","DTBZ87":""
  1434. if (manufactureDate != null) {
  1435. if (manufactureDate < new Date('2016-07-01')) {
  1436. if (
  1437. dat.JYJG84_JYJL40 != "-" ||
  1438. dat.JYJG85_JYJL40 != "-" ||
  1439. dat.JYJG86_JYJL40 != "-" ||
  1440. dat.JYJG87_JYJL40 != "-"
  1441. ) {
  1442. addstrtip(
  1443. "注意2016.7.1之前生产的电梯,轿厢意外移动是否不检验!"
  1444. );
  1445. }
  1446. }
  1447. if (manufactureDate >= new Date('2016-07-01')) {
  1448. if (
  1449. dat.JYJG84_JYJL40 === "-" ||
  1450. dat.JYJG85_JYJL40 === "-" ||
  1451. dat.JYJG87_JYJL40 === "-"
  1452. ) {
  1453. addstrtip(
  1454. "注意2016.7.1之后生产的电梯,轿厢意外移动是否需要检验!"
  1455. );
  1456. }
  1457. }
  1458. }
  1459. if (manufactureDate != null) {
  1460. if (manufactureDate >= new Date('2004-01-01') && manufactureDate < new Date('2016-07-01')) {
  1461. if (dat.JYJG86_JYJL40 != "-") {
  1462. addstrtip('注意制造于2004.01.01至2016.07.01的电梯,UCMP40(3)是否应为无此项!')
  1463. }
  1464. }
  1465. if (manufactureDate >= new Date('2016-07-01')) {
  1466. if (dat.JYJG82_JYJL39 != dat.JYJG86_JYJL40) {
  1467. addstrtip('注意制造于2016.07.01以后的电梯,上行超速保护39(3)和UCMP40(3)是否应相同,若确实采用了不同的制动装置,可忽略!')
  1468. }
  1469. }
  1470. }
  1471. //42 125制动试验
  1472. //"JYJG90_JYJL42":"","DTBZ90":""
  1473. if (lastBrakingDate != null) {
  1474. if (lastBrakingDate.getFullYear() === new Date().getFullYear()) {
  1475. if (dat.JYJG90_JYJL42 === "-") {
  1476. addstrtip("最近制动试验是在今年,第42项应为符合!");
  1477. }
  1478. }
  1479. if (lastBrakingDate.getFullYear() != new Date().getFullYear()) {
  1480. if (dat.JYJG90_JYJL42 != "-") {
  1481. addstrtip("最近制动试验不在今年,第42项应为“-”!");
  1482. }
  1483. }
  1484. }
  1485. }
  1486. }
  1487. }
  1488. function StringToDate(str) {
  1489. var strDate = str.split(" ");
  1490.  
  1491. var strDatepart = strDate[0].split("-");
  1492.  
  1493. var dtDate = new Date(strDatepart[0], strDatepart[1] - 1, strDatepart[2]);
  1494.  
  1495. return dtDate;
  1496. }
  1497. function YearMonthToYearMonthDay(str) {
  1498. if (str.length === 7) {
  1499. str = str.concat("-01");
  1500. }
  1501. return str.trim();
  1502. }
  1503. function ZifuchuanIsDate(strdate) {
  1504. //isNaN(strdate)返回为false则是日期格式;排除data为纯数字的情况(此处不考虑只有年份的日期,如‘2020)
  1505. if (isNaN(strdate) && !isNaN(Date.parse(strdate))) {
  1506. return true;
  1507. } else {
  1508. return false;
  1509. }
  1510. }
  1511. function addstrtip(str) {
  1512. strtip = strtip.concat("\n");
  1513. tipnum = tipnum + 1;
  1514. strtip = strtip.concat(tipnum.toString());
  1515. strtip = strtip.concat("、");
  1516. strtip = strtip.concat(str);
  1517. }
  1518. function isNormalInteger(str) {
  1519. var n = Math.floor(Number(str));
  1520.  
  1521. return n !== Infinity && String(n) === str && n >= 0;
  1522. }
  1523. function isValidSBDMFormat(text) {
  1524. // 完整的正则表达式,匹配格式:(3110|3120) + 数组中的值 + 2000到2100之间的年份 + 五位数字顺序号
  1525. const regex = /^(3110|3120)\d{6}(\d{4})\d{6}$/;
  1526. // 首先判断基本的格式匹配
  1527. if (regex.test(text)) {
  1528. const match = text.match(regex);
  1529. if (match) {
  1530. var year = parseInt(match[2], 10);
  1531. if (year >= 2000 && year <= 2100) {
  1532. return true;
  1533. } else {
  1534. return false;
  1535. }
  1536. }
  1537. } else {
  1538. return false;
  1539. }
  1540. }
  1541. // 解析日期,如果没有具体的日,则默认为月的第一天
  1542. function parseDate(dateStr) {
  1543. const dateRegex = /^(\d{4})年(\d{1,2})月(\d{1,2})?日?$/;
  1544. const match = dateStr.match(dateRegex);
  1545. if (!match) {
  1546. return null;
  1547. }
  1548. const year = parseInt(match[1], 10);
  1549. const month = parseInt(match[2], 10) - 1;
  1550. const day = match[3] ? parseInt(match[3], 10) : 1;
  1551. return new Date(year, month, day);
  1552. }
  1553. //根据监督检验日期验证某一年是检验还是检测,并给出该年具体检验检测日期
  1554. //接收一个监督检验日期字符串
  1555. function elevatorInspectionStr(supervisionDateStr, queryYear) {
  1556. const dateRegex = /^(\d{4})年(\d{1,2})月/; // 正则表达式用于解析年份和月份
  1557. const match = supervisionDateStr.match(dateRegex);
  1558. if (match) {
  1559. const supervisionYear = parseInt(match[1], 10);
  1560. const supervisionMonth = parseInt(match[2], 10);
  1561. const inspectionYears = [1, 4, 7, 9, 11, 13, 15]; // 检验规则年份
  1562. let inspectionDates = [];
  1563. // 生成检验日期
  1564. inspectionYears.forEach((year) => {
  1565. if (supervisionYear + year <= queryYear) {
  1566. inspectionDates.push(supervisionYear + year);
  1567. }
  1568. });
  1569. // 处理超过15年后每年都检验的情况
  1570. if (queryYear - supervisionYear > 15) {
  1571. for (let year = supervisionYear + 16; year <= queryYear; year++) {
  1572. inspectionDates.push(year);
  1573. }
  1574. }
  1575. // 判断查询年份需要的操作
  1576. if (inspectionDates.includes(queryYear)) {
  1577. return { result: "检验", year: queryYear, month: supervisionMonth };
  1578. } else {
  1579. return { result: "检测", year: queryYear, month: supervisionMonth };
  1580. }
  1581. } else {
  1582. return { result: "错误", year: 0, month: 0 };
  1583. }
  1584. }
  1585. //根据监督检验日期验证某一年是检验还是检测,并给出该年份后下次检验日期
  1586. //接收监督检验日期和验证日期date类对象
  1587. function elevatorInspection(supervisionDate, queryDate) {
  1588. if (supervisionDate >= queryDate) {
  1589. return { result: "错误", date: null };
  1590. }
  1591. if (
  1592. new Date(
  1593. queryDate.getFullYear(),
  1594. supervisionDate.getMonth(),
  1595. supervisionDate.getDate()
  1596. ) < new Date(2023, 3, 1)
  1597. ) {
  1598. // 输出结果
  1599. return {
  1600. result: "检验",
  1601. date: new Date(
  1602. queryDate.getFullYear() + 1,
  1603. supervisionDate.getMonth(),
  1604. supervisionDate.getDate()
  1605. ),
  1606. };
  1607. } else {
  1608. const supervisionYear = supervisionDate.getFullYear();
  1609. const supervisionMonth = supervisionDate.getMonth();
  1610. const queryYear = queryDate.getFullYear();
  1611. const inspectionIntervals = [1, 4, 7, 9, 11, 13, 15]; // 定期检验的间隔年份
  1612. let inspectionYears = new Set();
  1613. // 生成所有定期检验的年份
  1614. for (let year = supervisionYear; year <= queryYear + 15; year++) {
  1615. if (
  1616. year - supervisionYear > 15 ||
  1617. inspectionIntervals.includes(year - supervisionYear)
  1618. ) {
  1619. inspectionYears.add(year);
  1620. }
  1621. }
  1622. // 确定查询年份是否是检验年份
  1623. let inspectionStatus = inspectionYears.has(queryYear) ? "检验" : "检测";
  1624. // 计算下一次检验的年份
  1625. let nextInspectionYear = [...inspectionYears].find(
  1626. (year) => year > queryYear
  1627. );
  1628.  
  1629. // 创建下次检验日期的Date对象
  1630. let nextInspectionDate = nextInspectionYear
  1631. ? new Date(nextInspectionYear, supervisionMonth, 1)
  1632. : null;
  1633.  
  1634. // 输出结果
  1635. return { result: inspectionStatus, date: nextInspectionDate };
  1636. }
  1637. }
  1638. function isValidSYDJFormat(text) {
  1639. // 完整的正则表达式,匹配格式:(3110|3120) + 数组中的值 + 2000到2100之间的年份 + 五位数字顺序号
  1640. const regex = /^(3110|3120)\d{6}(\d{4})\d{6}$/;
  1641. // 首先判断基本的格式匹配
  1642. if (regex.test(text)) {
  1643. const match = text.match(regex);
  1644. if (match) {
  1645. var year = parseInt(match[2], 10);
  1646. if (year >= 2000 && year <= 2100) {
  1647. return true;
  1648. } else {
  1649. return false;
  1650. }
  1651. }
  1652. } else {
  1653. return false;
  1654. }
  1655. }
  1656. function calculateBrakeDate(initialDate, queryDate) {
  1657. const brakeIntervalBefore2024 = 5; // 2024年4月1日之前的制动间隔
  1658. const brakeIntervalAfter2024 = 6; // 2024年4月1日及以后的制动间隔
  1659. let resultDate = new Date(initialDate.getTime());
  1660. let resultDatetemp = null;
  1661. let currentYear = 0;
  1662. while (resultDate <= queryDate) {
  1663. resultDatetemp = new Date(resultDate.getTime());
  1664. currentYear = resultDate.getFullYear();
  1665. // 如果检验日期在2013年1月1日之前,第一次制动日期是2018年
  1666. if (resultDate < new Date(2013, 0, 1)) {
  1667. resultDate.setFullYear(2018);
  1668. }
  1669. // 如果检验日期在2013年1月1日及之后,2019.4.1之前,第一次制动日期隔5年做
  1670. else if (resultDate < new Date(2019, 3, 1)) {
  1671. resultDate.setFullYear(currentYear + brakeIntervalBefore2024);
  1672. }
  1673. // 如果检验日期在2019年4月1日及之后,第一次制动日期隔6年做
  1674. else {
  1675. resultDate.setFullYear(currentYear + brakeIntervalAfter2024);
  1676. }
  1677. }
  1678. return resultDatetemp;
  1679. }
  1680. // 检查项目的键值对
  1681. function getXMKeyValues(jsonData, specificNumbers, symbolToCheck) {
  1682. const regex = /^JYJG(\d+)_JYJL(\d+)$/;
  1683. let validKeyValues = {};
  1684.  
  1685. for (let key in jsonData) {
  1686. const match = key.match(regex);
  1687. if (match) {
  1688. const value = jsonData[key];
  1689. const number = parseInt(match[2], 10);
  1690. if (value === symbolToCheck && specificNumbers.has(number)) {
  1691. validKeyValues[key] = value;
  1692. }
  1693. }
  1694. }
  1695.  
  1696. return validKeyValues;
  1697. }
  1698. // 检查键值对是否符合条件
  1699. function checkDTBZValues(jsonData) {
  1700. const regex = /^DTBZ(\d+)$/;
  1701. let results = [];
  1702.  
  1703. for (let key in jsonData) {
  1704. const match = key.match(regex);
  1705. if (match) {
  1706. const number = parseInt(match[1], 10);
  1707. if (number >= 1 && number <= 91) {
  1708. if (jsonData[key] !== "") {
  1709. results.push({ key, value: jsonData[key] });
  1710. }
  1711. }
  1712. }
  1713. }
  1714. return results;
  1715. }
  1716. // 封面前得到后
  1717. function getdtt(label) {
  1718. var labelEl = Array.from(document.getElementsByTagName("span")).find(
  1719. (el) => el.textContent === label
  1720. );
  1721. var widgetFieldEl = labelEl.parentElement;
  1722. while (!widgetFieldEl.classList.contains("widget-field")) {
  1723. widgetFieldEl = widgetFieldEl.parentElement;
  1724. }
  1725. return widgetFieldEl.nextElementSibling.innerText.trim();
  1726. }
  1727. // 表格前得到后
  1728. function gethtt(label) {
  1729. var labelEl = Array.from(document.getElementsByTagName("td")).find(
  1730. (el) => el.textContent.trim() === label
  1731. );
  1732. return labelEl.nextElementSibling.innerText.trim();
  1733. }
  1734. // 直接得到
  1735. function getdt(label) {
  1736. var labelEl = Array.from(document.getElementsByTagName("span")).find(
  1737. (el) => el.textContent === label
  1738. );
  1739. var widgetFieldEl = labelEl.parentElement;
  1740. while (!widgetFieldEl.classList.contains("widget-field")) {
  1741. widgetFieldEl = widgetFieldEl.parentElement;
  1742. }
  1743. return widgetFieldEl.innerText.trim();
  1744. }
  1745. // 获取表格对应值
  1746. function getht(label) {
  1747. var labelEl = Array.from(document.getElementsByTagName("td")).find(
  1748. (el) => el.textContent.trim() === label
  1749. );
  1750. return labelEl.innerText.trim();
  1751. }
  1752. // 假设这段HTML代码已经在页面上加载
  1753.  
  1754. // 定义一个函数来根据label的文本内容找到对应的span元素并获取其文本
  1755. function gett(labelText) {
  1756. // 使用XPath选择器来找到包含特定文本的label元素
  1757. var label = document.evaluate(
  1758. "//label[contains(., '" + labelText + "')]",
  1759. document,
  1760. null,
  1761. XPathResult.FIRST_ORDERED_NODE_TYPE,
  1762. null
  1763. ).singleNodeValue;
  1764.  
  1765. // 如果找到了label元素,则寻找它后面的span元素
  1766. if (label) {
  1767. var span = label.nextElementSibling; // 获取label元素的下一个兄弟元素
  1768. if (span && span.classList.contains("widget-content")) {
  1769. // 确保找到的元素是我们要的span
  1770. return span.textContent || span.innerText; // 获取span元素的文本内容
  1771. }
  1772. }
  1773. return null; // 如果没有找到,返回null
  1774. }
  1775. function replaceValuesWithFun(jn, fun) {
  1776. // 遍历JSON对象的所有键
  1777. for (var key in jn) {
  1778. if (jn.hasOwnProperty(key)) {
  1779. // 获取当前键对应的值
  1780. var value = jn[key];
  1781. // 使用提供的函数fun处理键名,并获取返回值
  1782. var funResult = fun(key);
  1783. // 如果fun返回的不是null,则用fun的返回值替换原值
  1784. if (funResult !== null) {
  1785. jn[key] = funResult;
  1786. }
  1787. }
  1788. }
  1789. // 返回修改后的JSON对象
  1790. return jn;
  1791. }
  1792. function validateAndExplainCode(input) {
  1793. // 正则表达式匹配形式“详见(JD101)号工具箱”,并仅提取最后两位数字
  1794. const regex =
  1795. /^详见((JD\d{1}\d{2}|SZSJD\d{2}|WZJD\d{2}|ZWJD\d{2}|GYJD\d{2}))号工具箱$/;
  1796. const match = input.match(regex);
  1797.  
  1798. if (!match) {
  1799. return { isValid: false, message: "输入格式不正确。" };
  1800. }
  1801.  
  1802. // 提取编码部分
  1803. const code = match[1];
  1804. let department = "";
  1805. // 只提取最后两位数字
  1806. let sequence = parseInt(code.slice(-2), 10); // 使用slice(-2)直接从字符串末尾取最后两个字符
  1807.  
  1808. // 根据编码解释其含义
  1809. if (/^JD1\d{2}$/.test(code)) {
  1810. department = "机电一部";
  1811. if (sequence > 10)
  1812. return { isValid: false, message: "机电一部顺序号超出范围。" };
  1813. } else if (/^JD2\d{2}$/.test(code)) {
  1814. department = "机电二部";
  1815. if (sequence < 1 || sequence > 4)
  1816. return { isValid: false, message: "机电二部顺序号超出范围。" };
  1817. } else if (/^JD3\d{2}$/.test(code)) {
  1818. department = "机电三部";
  1819. if (sequence > 8)
  1820. return { isValid: false, message: "机电三部顺序号超出范围。" };
  1821. } else if (/^SZSJD\d{2}$/.test(code)) {
  1822. department = "石嘴山分院";
  1823. if (sequence > 3)
  1824. return { isValid: false, message: "石嘴山分院顺序号超出范围。" };
  1825. } else if (/^WZJD\d{2}$/.test(code)) {
  1826. department = "吴忠分院";
  1827. if (sequence > 3)
  1828. return { isValid: false, message: "吴忠分院顺序号超出范围。" };
  1829. } else if (/^ZWJD\d{2}$/.test(code)) {
  1830. department = "中卫分院";
  1831. if (sequence > 3)
  1832. return { isValid: false, message: "中卫分院顺序号超出范围。" };
  1833. } else if (/^GYJD\d{2}$/.test(code)) {
  1834. department = "固原分院";
  1835. if (sequence > 3)
  1836. return { isValid: false, message: "固原分院顺序号超出范围。" };
  1837. } else {
  1838. return { isValid: false, message: "未知的编码部分。" };
  1839. }
  1840.  
  1841. return {
  1842. isValid: true,
  1843. message: `本次检验使用了${department}:${code},序号为${sequence}的工具箱。`,
  1844. };
  1845. }
  1846. function validateString(str) {
  1847. // 获取当前年份的后两位
  1848. const currentYearSuffix = new Date().getFullYear().toString().slice(-2);
  1849.  
  1850. // 正则表达式匹配中文全角或英文半角的小括号
  1851. const regex =
  1852. /^本记录第([\d+、,]+)项的检验结果为不符合使用单位已经承诺采取安全措施,对电梯实行监护使用(见编号为TZS-DT-${currentYearSuffix}\d{5}的《电梯检验意见通知书》)$/;
  1853. const match = str.match(regex);
  1854.  
  1855. if (!match) {
  1856. // 如果不匹配,直接返回false
  1857. return false;
  1858. }
  1859.  
  1860. // 提取并分割数字字符串
  1861. const numbersStr = match[1];
  1862. const numbers = numbersStr
  1863. .split(/[\d+、,]+/)
  1864. .filter((n) => n !== "")
  1865. .map(Number);
  1866.  
  1867. // 验证数字是否在1到43的范围内
  1868. const isValidNumbers = numbers.every((num) => num >= 1 && num <= 43);
  1869.  
  1870. // 验证XX4是否符合格式
  1871. const xx4Match = str.match(/TZS-DT-${currentYearSuffix}(\d{5})/);
  1872. const isValidXX4 = xx4Match && xx4Match[1].length === 5;
  1873.  
  1874. // 返回最终验证结果
  1875. return isValidNumbers && isValidXX4;
  1876. }
  1877. //不符合项序号也验证
  1878. function validateString1(str, ssz) {
  1879. // 将数组 ssz 转换成字符串并用顿号连接,同时支持中文和英文逗号
  1880. const items = ssz.join("[、,]");
  1881. // 构建正则表达式的动态部分,用于匹配 "第XX1、XX2、XX3项"
  1882. const itemPattern = `第${items}项`;
  1883. // 获取当前年份的最后两位
  1884. const year = new Date().getFullYear().toString().slice(-2);
  1885. // 定义正则表达式,匹配整个字符串
  1886. // 注意:此处假设XX4的格式是 "TZS-DT-" 后跟 7 位数字,其中前两位是年份
  1887. // 添加对中英文小括号的支持
  1888. const regex = new RegExp(
  1889. `^本记录${itemPattern}的检验结果为不符合[,,]使用单位已经承诺采取安全措施[,,]对电梯实行监护使用[((]见编号为TZS-DT-${year}\\d{5}的《电梯检验意见通知书》[))]$`
  1890. );
  1891. // 测试字符串是否符合正则表达式
  1892. return regex.test(str);
  1893. }
  1894. //通过全国统一社会信用代码得到所在省份名称
  1895. function getProvinceByKeyValue(code, jsonData) {
  1896. // 确保字符串长度为18
  1897. if (code.length !== 18) {
  1898. return "";
  1899. }
  1900.  
  1901. // 获取第3到4位的子字符串
  1902. const keyValue = code.substring(2, 4);
  1903.  
  1904. // 查找qg对象中对应的键名
  1905. for (const province in jsonData) {
  1906. if (jsonData[province] === keyValue) {
  1907. return province; // 返回找到的键名(省份名)
  1908. }
  1909. }
  1910.  
  1911. // 如果没有找到对应的键,返回错误信息
  1912. return "";
  1913. }
  1914. //对全国统一社会信用代码进行校验,有问题,和实际计算有差异
  1915. function isValidUnifiedSocialCreditCode(code) {
  1916. // 权重数组
  1917. const weights = [
  1918. 1, 3, 9, 27, 19, 26, 16, 17, 20, 29, 25, 13, 8, 24, 10, 30, 28,
  1919. ];
  1920. // 校验码对应表
  1921. const checkCodes = "0123456789ABCDEFGHJKLMNPQRTUWXY";
  1922. // 字符到数字的映射,大写字母按照顺序映射,不包括I、O、S、V、Z
  1923. const charToNumberMap = {
  1924. A: 10,
  1925. B: 11,
  1926. C: 12,
  1927. D: 13,
  1928. E: 14,
  1929. F: 15,
  1930. G: 16,
  1931. H: 17,
  1932. J: 18,
  1933. K: 19,
  1934. L: 20,
  1935. M: 21,
  1936. N: 22,
  1937. P: 23,
  1938. Q: 24,
  1939. R: 25,
  1940. T: 26,
  1941. U: 27,
  1942. W: 28,
  1943. X: 29,
  1944. Y: 30,
  1945. };
  1946.  
  1947. // 确保统一社会信用代码长度为18位
  1948. if (code.length !== 18) {
  1949. return false;
  1950. }
  1951.  
  1952. // 计算加权和
  1953. let sum = 0;
  1954. for (let i = 0; i < 17; i++) {
  1955. const char = code.charAt(i);
  1956. let charCode;
  1957. if (!isNaN(char)) {
  1958. // 如果是数字,直接转换
  1959. charCode = parseInt(char, 10);
  1960. } else {
  1961. // 如果是字母,通过映射转换
  1962. charCode = charToNumberMap[char];
  1963. if (charCode === undefined) {
  1964. // 如果字母不在映射中(如I、O、S、V、Z),则代码无效
  1965. return false;
  1966. }
  1967. }
  1968. sum += charCode * weights[i];
  1969. }
  1970.  
  1971. // 计算校验码
  1972. const remainder = sum % 31;
  1973. const expectedCheckCode = checkCodes.charAt(remainder);
  1974.  
  1975. // 校验最后一位是否匹配
  1976. const actualCheckCode = code.charAt(17).toUpperCase();
  1977. return expectedCheckCode === actualCheckCode;
  1978. }
  1979. // 函数用于判断18位字符串中第3到8位是否是nx对象中某个键的值,并返回对应的键名
  1980. function findKeyFromCode(str, jsonData) {
  1981. // 将给定字符串中的第3到8位提取出来
  1982. var code = str.substr(2, 6);
  1983. // 循环遍历 JSON 数据,查找匹配的键名
  1984. for (var key in jsonData) {
  1985. if (jsonData.hasOwnProperty(key)) {
  1986. if (jsonData[key] === code) {
  1987. return key;
  1988. }
  1989. }
  1990. }
  1991.  
  1992. // 如果没有找到匹配的键名,返回空字符串
  1993. return "";
  1994. }
  1995. function checkRegionContainment(a, b) {
  1996. // 检查b是否直接是a
  1997. if (a === b) {
  1998. return true;
  1999. }
  2000.  
  2001. // 寻找a和b所在的最高级区域
  2002. const aRegion = findRegion(a, regions);
  2003. const bRegion = findRegion(b, regions);
  2004.  
  2005. if (!aRegion || !bRegion) {
  2006. return false; // 如果a或b没有找到对应的区域,返回false
  2007. }
  2008.  
  2009. // 判断b所在的区域是否包含a所在的区域
  2010. return isInRegion(a, b, regions);
  2011. }
  2012. // 递归地在regions中查找key所在的区域
  2013. function findRegion(key, region) {
  2014. if (region.hasOwnProperty(key)) {
  2015. return region; // 如果找到了key,返回包含它的区域对象
  2016. }
  2017.  
  2018. // 遍历当前区域的所有子区域
  2019. for (const subKey in region) {
  2020. if (region[subKey] instanceof Object) {
  2021. const result = findRegion(key, region[subKey]);
  2022. if (result) return result;
  2023. }
  2024. }
  2025. return null; // 如果没有找到,返回null
  2026. }
  2027. //验证为空
  2028. //验证为空
  2029. function isItemsEmpty() {
  2030. //封面
  2031. if (1) {
  2032. if (getdtt("使用单位:") === "") {
  2033. addstrtip("使用单位名称为空!");
  2034. //highlightedFields.push(ddh('使用单位:'))
  2035. }
  2036. if (getdtt("设备代码:") === "") {
  2037. addstrtip("设备代码为空!");
  2038. }
  2039. if (getdtt("设备类别:") === "") {
  2040. addstrtip("设备类别为空!");
  2041. }
  2042. if (getdtt("检验日期:") === "") {
  2043. addstrtip("封面检验日期为空!");
  2044. }
  2045. }
  2046. //概况
  2047. if (1) {
  2048. if (gethtt("使用单位名称") === "") {
  2049. addstrtip("概况使用单位名称为空!");
  2050. }
  2051. if (gethtt("统一社会信用代码") === "") {
  2052. addstrtip("统一社会信用代码为空!");
  2053. }
  2054. if (gethtt("安装地点") === "") {
  2055. addstrtip("安装地点为空!");
  2056. }
  2057. if (gethtt("设备品种") === "") {
  2058. addstrtip("设备品种为空!");
  2059. }
  2060. if (gethtt("产品型号") === "") {
  2061. addstrtip("产品型号为空!");
  2062. }
  2063. if (gethtt("产品编号") === "") {
  2064. addstrtip("产品编号为空!");
  2065. }
  2066. if (gethtt("单位内编号") === "") {
  2067. addstrtip("单位内编号为空!");
  2068. }
  2069. if (gethtt("使用登记证编号") === "") {
  2070. addstrtip("使用登记证编号为空!");
  2071. }
  2072. if (gethtt("安全管理人员") === "") {
  2073. addstrtip("安全管理人员为空!");
  2074. }
  2075. if (gethtt("电话") === "") {
  2076. addstrtip("安全管理人员联系电话为空!");
  2077. }
  2078. if (gethtt("制造单位名称") === "") {
  2079. addstrtip("制造单位名称为空!");
  2080. }
  2081. if (gethtt("制造日期") === "") {
  2082. addstrtip("制造日期为空!");
  2083. }
  2084. if (gethtt("改造单位名称") === "") {
  2085. addstrtip("改造单位名称为空!");
  2086. }
  2087. if (gethtt("改造日期") === "") {
  2088. addstrtip("改造日期为空!");
  2089. }
  2090. if (gethtt("维护保养单位名称") === "") {
  2091. addstrtip("维保单位名称为空!");
  2092. }
  2093. if (gethtt("最近一次制动试验确认日期") === "") {
  2094. addstrtip("最近一次制动试验确认日期为空!");
  2095. }
  2096. if (gethtt("监督检验日期") === "") {
  2097. addstrtip("监督检验日期为空!");
  2098. }
  2099. if (gethtt("是否加装电梯") === "") {
  2100. addstrtip("是否加装电梯信息为空!");
  2101. }
  2102. if (gethtt("是否住宅电梯") === "") {
  2103. addstrtip("是否住宅电梯信息为空!");
  2104. }
  2105. if (gethtt("下次检验日期") === "") {
  2106. addstrtip("下次检验日期为空!");
  2107. }
  2108. if (gethtt("额定载重量") === "") {
  2109. addstrtip("电梯额定载荷为空!");
  2110. }
  2111. if (gethtt("额定速度") === "") {
  2112. addstrtip("电梯运行速度为空!");
  2113. }
  2114. if (dat.电梯层站 === "") {
  2115. addstrtip("电梯层站为空!");
  2116. }
  2117. if (dat.电梯站数 === "") {
  2118. addstrtip("电梯站数为空!");
  2119. }
  2120. if (dat.电梯门数 === "") {
  2121. addstrtip("电梯门数为空!");
  2122. }
  2123. if (gethtt("控制方式") === "") {
  2124. addstrtip("控制方式为空!");
  2125. }
  2126. if (gethtt("检验依据") === "") {
  2127. addstrtip("检验依据为空!");
  2128. }
  2129. if (gethtt("主要检验仪器设备") === "") {
  2130. addstrtip("主要检验仪器设备为空!");
  2131. }
  2132. if (getdt("XCJYTJ") === "") {
  2133. addstrtip("现场检验条件为空!");
  2134. }
  2135. if (getdt("XCAQTJ") === "") {
  2136. addstrtip("现场安全条件为空!");
  2137. }
  2138. if (getdt("内部(全面)检验结论(电类定检)") === "") {
  2139. addstrtip("检验结论为空!");
  2140. }
  2141. if (getdt("内部(全面)检验日期(电类定检)") === "") {
  2142. addstrtip("概况检验日期为空!");
  2143. }
  2144. }
  2145. //1-5
  2146. if (1) {
  2147. if (gett("JYJG1_JYJL1") === "") {
  2148. addstrtip("第1项第1个检验结果为空!");
  2149. }
  2150. if (gett("JYJG2_JYJL1") === "") {
  2151. addstrtip("第1项第2个检验结果为空!");
  2152. }
  2153. if (gett("JYJG3_JYJL1") === "") {
  2154. addstrtip("第1项第3个检验结果空!");
  2155. }
  2156.  
  2157. if (gett("JYJG4_JYJL2") === "") {
  2158. addstrtip("第2项第1个检验结果空!");
  2159. }
  2160.  
  2161. if (gett("JYJG5_JYJL2") === "") {
  2162. addstrtip("第2项第2个检验结果空!");
  2163. }
  2164.  
  2165. if (gett("JYJG6_JYJL3") === "") {
  2166. addstrtip("第3项第1个检验结果空!");
  2167. }
  2168.  
  2169. if (gett("JYJG7_JYJL4") === "") {
  2170. addstrtip("第4项第1个检验结果空!");
  2171. }
  2172.  
  2173. if (gett("JYJG8_JYJL4") === "") {
  2174. addstrtip("第4项第2个检验结果空!");
  2175. }
  2176.  
  2177. if (gett("JYJG9_JYJL4") === "") {
  2178. addstrtip("第4项第3个检验结果空!");
  2179. }
  2180.  
  2181. if (gett("JYJG10_JYJL4") === "") {
  2182. addstrtip("第4项第4个检验结果空!");
  2183. }
  2184.  
  2185. if (gett("JYJG11_JYJL5") === "") {
  2186. addstrtip("第5项第1个检验结果空!");
  2187. }
  2188. }
  2189. //6-10
  2190. if (1) {
  2191. if (gett("JYJG12_JYJL6") === "") {
  2192. addstrtip("第6项第1个检验结果为空!");
  2193. }
  2194. if (gett("JYJG13_JYJL6") === "") {
  2195. addstrtip("第6项第2个检验结果为空!");
  2196. }
  2197. if (gett("JYJG14_JYJL6") === "") {
  2198. addstrtip("第6项第3个检验结果为空!");
  2199. }
  2200. if (gett("JYJG15_JYJL6") === "") {
  2201. addstrtip("第6项第4个检验结果为空!");
  2202. }
  2203. if (gett("JYJG16_JYJL7") === "") {
  2204. addstrtip("第7项第1个检验结果为空!");
  2205. }
  2206. if (gett("JYJG17_JYJL8") === "") {
  2207. addstrtip("第8项第1个检验结果为空!");
  2208. }
  2209. if (gett("JYJG18_JYJL8") === "") {
  2210. addstrtip("第8项第2个检验结果为空!");
  2211. }
  2212. if (gett("JYJG19_JYJL9") === "") {
  2213. addstrtip("第9项第1个检验结果为空!");
  2214. }
  2215. if (gett("JYJG20_JYJL10") === "") {
  2216. addstrtip("第10项第1个检验结果为空!");
  2217. }
  2218. }
  2219. //11-15
  2220. if (1) {
  2221. if (gett("JYJG21_JYJL11") === "") {
  2222. addstrtip("第11项第1个检验结果为空!");
  2223. }
  2224. if (gett("JYJG22_JYJL12") === "") {
  2225. addstrtip("第12项第1个检验结果为空!");
  2226. }
  2227. if (gett("JYJG23_JYJL12") === "") {
  2228. addstrtip("第12项第2个检验结果为空!");
  2229. }
  2230. if (gett("JYJG24_JYJL12") === "") {
  2231. addstrtip("第12项第3个检验结果为空!");
  2232. }
  2233. if (gett("JYJG25_JYJL13") === "") {
  2234. addstrtip("第13项第1个检验结果为空!");
  2235. }
  2236. if (gett("JYJG26_JYJL13") === "") {
  2237. addstrtip("第13项第2个检验结果为空!");
  2238. }
  2239. if (gett("JYJG27_JYJL13") === "") {
  2240. addstrtip("第13项第3个检验结果为空!");
  2241. }
  2242. if (gett("JYJG28_JYJL13") === "") {
  2243. addstrtip("第13项第4个检验结果为空!");
  2244. }
  2245. if (gett("JYJG29_JYJL13") === "") {
  2246. addstrtip("第13项第5个检验结果为空!");
  2247. }
  2248. if (gett("JYJG30_JYJL14") === "") {
  2249. addstrtip("第14项第1个检验结果为空!");
  2250. }
  2251. if (gett("JYJG31_JYJL14") === "") {
  2252. addstrtip("第14项第2个检验结果为空!");
  2253. }
  2254. if (gett("JYJG32_JYJL15") === "") {
  2255. addstrtip("第15项第1个检验结果为空!");
  2256. }
  2257. if (gett("JYJG33_JYJL15") === "") {
  2258. addstrtip("第15项第2个检验结果为空!");
  2259. }
  2260. if (gett("JYJG34_JYJL15") === "") {
  2261. addstrtip("第15项第3个检验结果为空!");
  2262. }
  2263. }
  2264. //16-20
  2265. if (1) {
  2266. if (gett("JYJG35_JYJL16") === "") {
  2267. addstrtip("第16项第1个检验结果为空!");
  2268. }
  2269. if (gett("JYJG36_JYJL17") === "") {
  2270. addstrtip("第17项第1个检验结果为空!");
  2271. }
  2272. if (gett("JYJG37_JYJL18") === "") {
  2273. addstrtip("第18项第1个检验结果为空!");
  2274. }
  2275. if (gett("JYJG38_JYJL18") === "") {
  2276. addstrtip("第18项第2个检验结果为空!");
  2277. }
  2278. if (gett("JYJG39_JYJL18") === "") {
  2279. addstrtip("第18项第3个检验结果为空!");
  2280. }
  2281. if (gett("JYJG40_JYJL18") === "") {
  2282. addstrtip("第18项第4个检验结果为空!");
  2283. }
  2284. if (gett("JYJG41_JYJL19") === "") {
  2285. addstrtip("第19项第1个检验结果为空!");
  2286. }
  2287. if (gett("JYJG42_JYJL20") === "") {
  2288. addstrtip("第20项第1个检验结果为空!");
  2289. }
  2290. }
  2291. //21-25
  2292. if (1) {
  2293. if (gett("JYJG43_JYJL21") === "") {
  2294. addstrtip("第21项第1个检验结果为空!");
  2295. }
  2296. if (gett("JYJG44_JYJL21") === "") {
  2297. addstrtip("第21项第2个检验结果为空!");
  2298. }
  2299. if (gett("JYJG45_JYJL21") === "") {
  2300. addstrtip("第21项第3个检验结果为空!");
  2301. }
  2302. if (gett("JYJG46_JYJL21") === "") {
  2303. addstrtip("第21项第4个检验结果为空!");
  2304. }
  2305. if (gett("JYJG47_JYJL22") === "") {
  2306. addstrtip("第22项第1个检验结果为空!");
  2307. }
  2308. if (gett("JYJG48_JYJL22") === "") {
  2309. addstrtip("第22项第2个检验结果为空!");
  2310. }
  2311. if (gett("JYJG49_JYJL23") === "") {
  2312. addstrtip("第23项第1个检验结果为空!");
  2313. }
  2314. if (gett("JYJG50_JYJL24") === "") {
  2315. addstrtip("第24项第1个检验结果为空!");
  2316. }
  2317. if (gett("JYJG51_JYJL24") === "") {
  2318. addstrtip("第24项第2个检验结果为空!");
  2319. }
  2320. if (gett("JYJG52_JYJL25") === "") {
  2321. addstrtip("第25项第1个检验结果为空!");
  2322. }
  2323. }
  2324. //26-30
  2325. if (1) {
  2326. if (gett("JYJG53_JYJL26") === "") {
  2327. addstrtip("第26项第1个检验结果为空!");
  2328. }
  2329. if (gett("JYJG54_JYJL26") === "") {
  2330. addstrtip("第26项第2个检验结果为空!");
  2331. }
  2332. if (gett("JYJG55_JYJL26") === "") {
  2333. addstrtip("第26项第3个检验结果为空!");
  2334. }
  2335. if (gett("JYJG56_JYJL27") === "") {
  2336. addstrtip("第27项第1个检验结果为空!");
  2337. }
  2338. if (gett("JYJG57_JYJL27") === "") {
  2339. addstrtip("第27项第2个检验结果为空!");
  2340. }
  2341. if (gett("JYJG58_JYJL28") === "") {
  2342. addstrtip("第28项第1个检验结果为空!");
  2343. }
  2344. if (gett("JYJG59_JYJL28") === "") {
  2345. addstrtip("第28项第2个检验结果为空!");
  2346. }
  2347. if (gett("JYJG60_JYJL29") === "") {
  2348. addstrtip("第29项第1个检验结果为空!");
  2349. }
  2350. if (gett("JYJG61_JYJL29") === "") {
  2351. addstrtip("第29项第2个检验结果为空!");
  2352. }
  2353. if (gett("JYJG62_JYJL29") === "") {
  2354. addstrtip("第29项第3个检验结果为空!");
  2355. }
  2356. if (gett("JYJG63_JYJL29") === "") {
  2357. addstrtip("第29项第4个检验结果为空!");
  2358. }
  2359. if (gett("JYJG64_JYJL30") === "") {
  2360. addstrtip("第30项第1个检验结果为空!");
  2361. }
  2362. if (gett("JYJG65_JYJL30") === "") {
  2363. addstrtip("第30项第2个检验结果为空!");
  2364. }
  2365. if (gett("JYJG66_JYJL30") === "") {
  2366. addstrtip("第30项第3个检验结果为空!");
  2367. }
  2368. }
  2369. //31-35
  2370. if (1) {
  2371. if (gett("JYJG67_JYJL31") === "") {
  2372. addstrtip("第31项第1个检验结果为空!");
  2373. }
  2374. if (gett("JYJG68_JYJL31") === "") {
  2375. addstrtip("第31项第2个检验结果为空!");
  2376. }
  2377. if (gett("JYJG69_JYJL32") === "") {
  2378. addstrtip("第32项第1个检验结果为空!");
  2379. }
  2380. if (gett("JYJG70_JYJL33") === "") {
  2381. addstrtip("第33项第1个检验结果为空!");
  2382. }
  2383. if (gett("JYJG71_JYJL33") === "") {
  2384. addstrtip("第33项第2个检验结果为空!");
  2385. }
  2386. if (gett("JYJG72_JYJL34") === "") {
  2387. addstrtip("第34项第1个检验结果为空!");
  2388. }
  2389. if (gett("JYJG73_JYJL34") === "") {
  2390. addstrtip("第34项第2个检验结果为空!");
  2391. }
  2392. if (gett("JYJG74_JYJL34") === "") {
  2393. addstrtip("第34项第3个检验结果为空!");
  2394. }
  2395. if (gett("JYJG75_JYJL34") === "") {
  2396. addstrtip("第34项第4个检验结果为空!");
  2397. }
  2398. if (gett("JYJG76_JYJL35") === "") {
  2399. addstrtip("第35项第1个检验结果为空!");
  2400. }
  2401. }
  2402. //36-40
  2403. if (1) {
  2404. if (gett("JYJG77_JYJL36") === "") {
  2405. addstrtip("第36项第1个检验结果为空!");
  2406. }
  2407. if (gett("JYJG78_JYJL36") === "") {
  2408. addstrtip("第37项第1个检验结果为空!");
  2409. }
  2410. if (gett("JYJG79_JYJL38") === "") {
  2411. addstrtip("第38项第1个检验结果为空!");
  2412. }
  2413. if (gett("JYJG80_JYJL39") === "") {
  2414. addstrtip("第39项第1个检验结果为空!");
  2415. }
  2416. if (gett("JYJG81_JYJL39") === "") {
  2417. addstrtip("第39项第2个检验结果为空!");
  2418. }
  2419. if (gett("JYJG82_JYJL39") === "") {
  2420. addstrtip("第39项第3个检验结果为空!");
  2421. }
  2422. if (gett("JYJG83_JYJL39") === "") {
  2423. addstrtip("第39项第4个检验结果为空!");
  2424. }
  2425. if (gett("JYJG84_JYJL40") === "") {
  2426. addstrtip("第40项第1个检验结果为空!");
  2427. }
  2428. if (gett("JYJG85_JYJL40") === "") {
  2429. addstrtip("第40项第2个检验结果为空!");
  2430. }
  2431. if (gett("JYJG86_JYJL40") === "") {
  2432. addstrtip("第40项第3个检验结果为空!");
  2433. }
  2434. if (gett("JYJG87_JYJL40") === "") {
  2435. addstrtip("第40项第4个检验结果为空!");
  2436. }
  2437. }
  2438. //41-43
  2439. if (1) {
  2440. if (gett("JYJG88_JYJL41") === "") {
  2441. addstrtip("第41项第1个检验结果为空!");
  2442. }
  2443. if (gett("JYJG89_JYJL41") === "") {
  2444. addstrtip("第41项第2个检验结果为空!");
  2445. }
  2446. if (gett("JYJG90_JYJL42") === "") {
  2447. addstrtip("第42项第1个检验结果为空!");
  2448. }
  2449. if (gett("JYJG91_JYJL43") === "") {
  2450. addstrtip("第43项第1个检验结果为空!");
  2451. }
  2452. }
  2453. //检验项目中的数值
  2454. if (1) {
  2455. /* if (gett(DTSJ503) === "") {
  2456. addstrtip("第24项(1)测量值为空!");
  2457. } */
  2458. if (dat.DTSJ503 === "") {
  2459. addstrtip("第24项(1)测量值为空!");
  2460. }
  2461. /* if (gett(DTSJ504) === "") {
  2462. addstrtip("第24项(2)测量值为空!");
  2463. } */
  2464. if (dat.DTSJ504 === "") {
  2465. addstrtip("第24项(2)测量值为空!");
  2466. }
  2467. /* if (gett(DTSJ700) === "") {
  2468. addstrtip("第29项(2)测量值为空!");
  2469. } */
  2470. if (dat.DTSJ700 === "") {
  2471. addstrtip("第29项(2)测量值为空!");
  2472. }
  2473. /* if (gett(DTSJ702) === "") {
  2474. addstrtip("第31项(1)测量值为空!");
  2475. } */
  2476. if (dat.DTSJ702 === "") {
  2477. addstrtip("第31项(1)测量值为空!");
  2478. }
  2479. /* if (gett(DTSJ74) === "") {
  2480. addstrtip("第31项(2)测量值为空!");
  2481. } */
  2482. if (dat.DTSJ74 === "") {
  2483. addstrtip("第31项(2)测量值为空!");
  2484. }
  2485. }
  2486.  
  2487. }
  2488. function CoverInfo() {
  2489.  
  2490. usernamee = document
  2491. .getElementById("1581261202417784a")
  2492. .innerText.trim();
  2493. if (usernamee.includes("使用单位")) {
  2494. username = usernamee.substring(6).trim();
  2495. } else {
  2496. username = usernamee;
  2497. }
  2498. //username=getdtt('使用单位:')
  2499. if (!/^[\u4e00-\u9fa5\(\)\(\)]{1,39}$/g.test(username)) {
  2500. addstrtip("注意封面使用单位名称!");
  2501. }
  2502. usernameGKK = document
  2503. .getElementById("1555396405619039a")
  2504. .innerText.trim();
  2505. if (usernameGKK.includes("使用单位")) {
  2506. usernameGK = usernameGKK.substring(7).trim();
  2507. } else {
  2508. usernameGK = usernameGKK;
  2509. }
  2510. // usernameGK=getdtt('使用单位名称')
  2511. if (username != usernameGK) {
  2512. addstrtip("封面与概况使用单位名称不一致!");
  2513. }
  2514. //设备代码
  2515. if (1) {
  2516. if (gett("设备代码") != "-") {
  2517. const regex = /^(3110|3120)\d{5,6}(\d{4})\d{5,6}$/;
  2518. if (regex.test(gett("设备代码"))) {
  2519. const sbdmfm = gett("设备代码").match(/^(\d{4})(\d{14}|\d{16})$/);
  2520. if (
  2521. /^3110$/.test(sbdmfm[1]) &&
  2522. !/^曳引驱动乘客电梯$/.test(gett("设备分类代码"))
  2523. ) {
  2524. addstrtip('封面设备代码3110表示"曳引驱动乘客电梯"!');
  2525. }
  2526. if (
  2527. /^3120$/.test(sbdmfm[1]) &&
  2528. !/^曳引驱动载货电梯$/.test(gett("设备分类代码"))
  2529. ) {
  2530. addstrtip('封面设备代码3120表示"曳引驱动载货电梯"!');
  2531. }
  2532. } else {
  2533. addstrtip("封面设备代码格式错误!");
  2534. }
  2535. }
  2536. }
  2537. if (!/^曳引与强制驱动电梯$/.test(gett("SHEBEILEIBIE"))) {
  2538. addstrtip("封面设备类别错误!");
  2539. }
  2540. jyrqq = document
  2541. .getElementById("1710387041337455d")
  2542. .innerText.trim(); //封面检验日期
  2543. if (jyrqq.includes("电类定检")) {
  2544. jyrq = jyrqq.substring(16).trim();
  2545. } else {
  2546. jyrq = jyrqq;
  2547. }
  2548. if (
  2549. /^\d{4}年\d{1,2}月\d{1,2}日$/.test(jyrq)
  2550. ) {
  2551. } else {
  2552. addstrtip("封面检验日期格式为xxxx年xx月xx日");
  2553. }
  2554. jyrqq = document
  2555. .getElementById("1710387041337455d")
  2556. .innerText.trim()
  2557. .replace(/年|月|日/g, "-")
  2558. .slice(0, -1); //封面检验日期
  2559. if (jyrqq.includes("电类定检")) {
  2560. jyrq = jyrqq.substring(16).trim();
  2561. } else {
  2562. jyrq = jyrqq;
  2563. }
  2564. jyrq = YearMonthToYearMonthDay(jyrq);
  2565. if (!ZifuchuanIsDate(jyrq)) {
  2566. addstrtip("封面检验日期格式错误!");
  2567. }
  2568.  
  2569. }
  2570. function ProfileInfo() {
  2571. if (!/^-$/.test(gett("使用单位组织机构代码"))) {
  2572. if (!/^[^IOZSV]{18}$/.test(gett("使用单位组织机构代码"))) {
  2573. addstrtip("统一社会信用代码错误!");
  2574. } else {
  2575. let sf = getProvinceByKeyValue(gett("使用单位组织机构代码"), qgsf);
  2576. let nxdm = findKeyFromCode(gett("使用单位组织机构代码"), nx);
  2577. let sfs = gett("使用单位组织机构代码").substring(2, 4);
  2578. let nxdms = gett("使用单位组织机构代码").substring(2, 8);
  2579. if (sf === "") {
  2580. addstrtip("统一社会信用代码3、4位省份信息错误!");
  2581. } else if (sf != "宁夏回族自治区") {
  2582. addstrtip('统一社会信用代码3、4位:"' + sfs + '"显示省份为:' + sf);
  2583. } else {
  2584. if (nxdm === "") {
  2585. addstrtip("统一社会信用代码第3到8位行政区划代码错误!");
  2586. } else {
  2587. if (nxdm != "宁夏回族自治区") {
  2588. if (!dat["设备使用(所在)地点"].includes(nxdm)) {
  2589. if (!checkRegionContainment(nxdm, dat["设备使用(所在)地点"])) {
  2590. addstrtip(
  2591. '注意使用单位统一社会信用代码注册(不可用)地:"' +
  2592. nxdm +
  2593. '"是否不在设备所在地!'
  2594. );
  2595. } else {
  2596. addstrtip(
  2597. '统一社会信用代码第3到8位:"' +
  2598. nxdms +
  2599. '"显示使用单位在' +
  2600. nxdm
  2601. );
  2602. }
  2603. }
  2604. }
  2605.  
  2606. }
  2607. }
  2608. }
  2609. }
  2610.  
  2611. if (!/^(曳引驱动乘客电梯|曳引驱动载货电梯)$/.test(gett("设备分类代码"))) {
  2612. addstrtip("设备品种错误!");
  2613. }
  2614. if (gett("设备型号") != "不明") {
  2615. if (!/^[a-zA-Z0-9./\\_\-()()\s]+$/gi.test(gett("设备型号"))) {
  2616. addstrtip("注意型号!");
  2617. }
  2618. }
  2619. if (gett("设备型号") === "-") {
  2620. addstrtip("产品型号找不到的填“不明”");
  2621. }
  2622. if (gett("产品编号(出厂编号)") != "不明") {
  2623. if (!/^[a-zA-Z0-9./\\_\-()()]+$/gi.test(gett("产品编号(出厂编号)"))) {
  2624. addstrtip("注意产品编号!");
  2625. }
  2626. }
  2627. if (gett("产品编号(出厂编号)") === "-") {
  2628. addstrtip("产品编号找不到的填“不明”");
  2629. }
  2630. //使用登记证编号
  2631. if (1) {
  2632. if (gett("使用证编号") != "-") {
  2633. if (isValidSYDJFormat(gett("使用证编号"))) {
  2634. const sbdmfm = gett("使用证编号").match(/^(\d{4})*$/);
  2635. if (
  2636. /^3110$/.test(sbdmfm[1]) &&
  2637. !/^曳引驱动乘客电梯$/.test(gett("设备分类代码"))
  2638. ) {
  2639. addstrtip('使用登记证编号3110表示"曳引驱动乘客电梯"!');
  2640. }
  2641. if (
  2642. /^3120$/.test(sbdmfm[1]) &&
  2643. !/^曳引驱动载货电梯$/.test(gett("设备分类代码"))
  2644. ) {
  2645. addstrtip('使用登记证编号3120表示"曳引驱动载货电梯"!');
  2646. }
  2647. } else {
  2648. const regex = /^梯(11|12)[宁](A|B|C|D|E)\d{5}[\(\(]\d{2}[\)\)]$/;
  2649. // 首先判断基本的格式匹配
  2650. if (regex.test(gett("使用证编号"))) {
  2651. const match = gett("使用证编号").match(regex);
  2652. if (match) {
  2653. if (
  2654. /^11$/.test(match[1]) &&
  2655. !/^曳引驱动乘客电梯$/.test(gett("设备分类代码"))
  2656. ) {
  2657. addstrtip('使用登记证编号11表示"曳引驱动乘客电梯"!');
  2658. }
  2659. if (
  2660. /^12$/.test(match[1]) &&
  2661. !/^曳引驱动载货电梯$/.test(gett("设备分类代码"))
  2662. ) {
  2663. addstrtip('使用登记证编号12表示"曳引驱动载货电梯"!');
  2664. }
  2665.  
  2666. let checkA_E = checkStringContainsLocation(match[2], dat["设备使用(所在)地点"], regions);
  2667. if (checkA_E.contains) {
  2668. } else {
  2669. if (checkA_E.azdstrContains === null && checkA_E.zcdstrRepresents != null) {
  2670. addstrtip('注意设备所在地:' + dat["设备使用(所在)地点"] + '可能不在使用登记证注册(不可用)地:' + checkA_E.zcdstrRepresents + '!');
  2671. }
  2672. }
  2673. // if (/^A$/.test(match[2])) {
  2674. // addstrtip('使用登记证注册(不可用)地在银川!');
  2675. // }
  2676. // if (/^B$/.test(match[2])) {
  2677. // addstrtip('使用登记证注册(不可用)地在石嘴山!');
  2678. // }
  2679. // if (/^C$/.test(match[2])) {
  2680. // addstrtip('使用登记证注册(不可用)地在吴忠!');
  2681. // }
  2682. // if (/^D$/.test(match[2])) {
  2683. // addstrtip('使用登记证注册(不可用)地在固原!');
  2684. // }
  2685. // if (/^E$/.test(match[2])) {
  2686. // addstrtip('使用登记证注册(不可用)地在中卫!');
  2687. // }
  2688. }
  2689. } else {
  2690. addstrtip('注意是否使用登记证编号错误!');
  2691. }
  2692. }
  2693. }
  2694. }
  2695. if (!/^[\u4e00-\u9fa5]{2,4}$/g.test(gett("安全管理人员"))) {
  2696. addstrtip("注意安全管理人员!");
  2697. }
  2698. if (!/^(1[3-9]\d{9}|\d{4}-?\d{7})$/g.test(gett("安全管理人员联系电话"))) {
  2699. addstrtip("安全管理人员电话不正确!");
  2700. }
  2701. //制造、改造单位及日期
  2702. if (1) {
  2703. if (!/^[\u4e00-\u9fa5\(\)\(\)]{1,39}$/g.test(gett("制造单位"))) {
  2704. addstrtip("注意制造单位名称!");
  2705. }
  2706. if (gett("制造日期") === "-") {
  2707. addstrtip("制造日期查不到填“不明”!");
  2708. } else {
  2709. if (gett("制造日期") != "不明") {
  2710. zhizaorq = document
  2711. .getElementById("1555396405618f688")
  2712. .innerText.trim()
  2713. .replace(/年|月|日/g, "-")
  2714. .slice(0, -1); // 封面检验日期
  2715. jyrq = YearMonthToYearMonthDay(jyrq);
  2716. if (!ZifuchuanIsDate(jyrq)) {
  2717. addstrtip("制造日期格式错误!");
  2718. }
  2719. }
  2720. }
  2721. if (gett("GZDWMC") != '-') {
  2722. if (!/^[\u4e00-\u9fa5\(\)\(\)]{1,39}$/g.test(gett("GZDWMC"))) {
  2723. addstrtip("注意改造单位名称!");
  2724. }
  2725. }
  2726.  
  2727. if (gett("改造监督检验日期") === "不明") {
  2728. addstrtip("未进行改造或查不出改造日期填“-”!");
  2729. }
  2730. if (
  2731. /^-$/g.test(gett("GZDWMC")) &&
  2732. !/^-$/g.test(gett("改造监督检验日期"))
  2733. ) {
  2734. addstrtip("注意改造单位名称与改造日期的关系!");
  2735. }
  2736. if (
  2737. !/^-$/g.test(gett("GZDWMC")) &&
  2738. /^-$/g.test(gett("改造监督检验日期"))
  2739. ) {
  2740. addstrtip("注意改造单位名称与改造日期的关系!");
  2741. }
  2742. if (!/^-$/g.test(gett("改造监督检验日期"))) {
  2743. gaizaorq = document
  2744. .getElementById("17104840421050d39")
  2745. .innerText.trim()
  2746. .replace(/年|月|日/g, "-")
  2747. .slice(0, -1); //封面检验日期
  2748. gaizaorq = YearMonthToYearMonthDay(gaizaorq);
  2749. if (!ZifuchuanIsDate(gaizaorq)) {
  2750. addstrtip("改造日期格式错误!");
  2751. }
  2752. }
  2753. }
  2754. if (!/^[\u4e00-\u9fa5\(\)\(\)]{1,39}$/g.test(gett("维保单位名称"))) {
  2755. addstrtip("注意维保单位名称!");
  2756. }
  2757. zhidongrq = document
  2758. .getElementById("1710148356446ba4c")
  2759. .innerText.trim()
  2760. .replace(/年|月|日/g, "-")
  2761. .slice(0, -1); //封面检验日期
  2762. zhidongrq = YearMonthToYearMonthDay(zhidongrq);
  2763. if (!ZifuchuanIsDate(zhidongrq)) {
  2764. addstrtip("最近一次制动试验确认日期格式错误!");
  2765. }
  2766. jiandurq = document
  2767. .getElementById("17101483999266548")
  2768. .innerText.trim()
  2769. .replace(/年|月|日/g, "-")
  2770. .slice(0, -1); //封面检验日期
  2771. jiandurq = YearMonthToYearMonthDay(jiandurq);
  2772. if (!ZifuchuanIsDate(jiandurq)) {
  2773. addstrtip("监督日期格式错误!");
  2774. }
  2775. if (!/^(是|否)$/.test(gett("是否加装电梯"))) {
  2776. addstrtip("是否加装错误!");
  2777. }
  2778. if (!/^(是|否)$/.test(gett("是否住宅电梯"))) {
  2779. addstrtip("是否住宅错误!");
  2780. }
  2781. gkxiacijianyanriqi = document
  2782. .getElementById("171038882039234f4")
  2783. .innerText.trim()
  2784. .replace(/年|月|日/g, "-")
  2785. .slice(0, -1); //下次检验日期
  2786. if (
  2787. !/^\d{4}年\d{2}月$/.test(gett("内部(全面)下次检验日期(电类定检)"))
  2788. ) {
  2789. addstrtip("下次检验日期精确到月!");
  2790. }
  2791. gkxiacijianyanriqi = YearMonthToYearMonthDay(gkxiacijianyanriqi);
  2792. if (!ZifuchuanIsDate(gkxiacijianyanriqi)) {
  2793. addstrtip("下次检验日期格式错误!");
  2794. }
  2795. //额定载荷与速度
  2796. if (1) {
  2797. if (!/^([1-9]\d*(\.\d+)?|0\.\d+)$/.test(gett("电梯额定载荷"))) {
  2798. addstrtip("额定载荷错误!");
  2799. }
  2800. if (!/^([1-9]\d*(\.\d+)?|0\.\d+)$/.test(gett("电梯运行速度"))) {
  2801. addstrtip("额定速度错误!");
  2802. }
  2803. if (/^曳引驱动乘客电梯$/.test(gett("设备分类代码"))) {
  2804. const standardLoads = [450, 630, 800, 825, 1000, 1050, 1250, 1350, 1600];
  2805. if (!standardLoads.includes(parseFloat(gett("电梯额定载荷")))) {
  2806. addstrtip(
  2807. "额定载荷不是常见量450, 630, 800, 825,1000, 1250,1350, 1600!"
  2808. );
  2809. }
  2810. const standardSpeeds = [1, 1.5, 1.6, 1.75, 2, 2.5];
  2811. if (!standardSpeeds.includes(parseFloat(gett("电梯运行速度")))) {
  2812. addstrtip("额定速度不是常见量1, 1.5, 1.6,1.75, 2, 2.5!");
  2813. }
  2814. }
  2815. if (/^曳引驱动载货电梯$/.test(gett("设备分类代码"))) {
  2816. const standardLoads = [1000, 1250, 1600, 2000, 3000];
  2817. if (!standardLoads.includes(parseFloat(gett("电梯额定载荷")))) {
  2818. addstrtip("额定载荷不是常见量1000, 1250, 1600, 2000, 3000!");
  2819. }
  2820. const standardSpeeds = [0.5];
  2821. if (!standardSpeeds.includes(parseFloat(gett("电梯运行速度")))) {
  2822. addstrtip("额定速度不是常见量0.5!");
  2823. }
  2824. }
  2825. }
  2826.  
  2827. //层站门数
  2828. if (1) {
  2829. const dtcz = document
  2830. .getElementById("1591338788552be31")
  2831. .innerText.trim(); //dt.电梯层站
  2832. const dtzs = document
  2833. .getElementById("15554041568959913")
  2834. .innerText.trim(); //dt.电梯站数
  2835. const dtms = document
  2836. .getElementById("1555404248649fa78")
  2837. .innerText.trim(); //dt.电梯门数
  2838. if (
  2839. !(
  2840. isNormalInteger(dtcz) &&
  2841. isNormalInteger(dtzs) &&
  2842. isNormalInteger(dtms)
  2843. )
  2844. ) {
  2845. addstrtip("层站门数不是正整数!");
  2846. }
  2847. if (
  2848. parseInt(dtcz) < parseInt(dtzs) ||
  2849. parseInt(dtzs) * 2 < parseInt(dtms)
  2850. ) {
  2851. addstrtip("注意层站门数是否合理!");
  2852. }
  2853. }
  2854. //控制方式
  2855. if (1) {
  2856. const validControlTypes = [
  2857. "集选控制",
  2858. "信号控制",
  2859. "单台集选控制",
  2860. "两台并联控制",
  2861. "多台群组控制",
  2862. ];
  2863. if (!validControlTypes.includes(gett("控制方式"))) {
  2864. addstrtip(
  2865. "控制方式不是常见控制:集选控制,信号控制,单台集选控制,两台并联控制,多台群组控制!"
  2866. );
  2867. }
  2868. }
  2869. //工具箱
  2870. if (1) {
  2871. const gjxjh = validateAndExplainCode(gett("YQSB"));
  2872. let tip = gjxjh.message;
  2873. let fixtip = "";
  2874. if (gjxjh.isValid) {
  2875. const regex =
  2876. /^详见((JD\d{1}\d{2}|SZSJD\d{2}|WZJD\d{2}|ZWJD\d{2}|GYJD\d{2}))号工具箱$/;
  2877. const match = gett("YQSB").match(regex);
  2878. const code = match[1];
  2879. if (!checkAreaForDepartmentPrefix(code, dat["设备使用(所在)地点"])) {
  2880. fixtip = "注意" + code + "的仪器是否在其检验区域范围内使用!";
  2881. }
  2882. let tipp = tip + fixtip
  2883. addstrtip(tip + fixtip)
  2884. } else {
  2885. addstrtip("工具箱填写错误!参考模板:“详见()号工具箱”")
  2886. }
  2887. }
  2888. //检验现场条件及安全确认
  2889. if (1) {
  2890. if (!/^符合$/.test(gett("XCJYTJ"))) {
  2891. addstrtip("检验现场条件确认不是“符合”!");
  2892. }
  2893. if (!/^符合$/.test(gett("XCAQTJ"))) {
  2894. addstrtip("检验现场安全确认不是“符合”!");
  2895. }
  2896. if (!/^合格$/.test(gett("内部(全面)检验结论(电类定检)"))) {
  2897. addstrtip("检验结论不是“合格”!");
  2898. }
  2899. if (
  2900. /^不符合$/.test(gett("XCJYTJ")) &&
  2901. /^合格$/.test(gett("内部(全面)检验结论(电类定检)"))
  2902. ) {
  2903. addstrtip("检验结论与检验现场条件确认矛盾!");
  2904. }
  2905. if (
  2906. /^不符合$/.test(gett("XCAQTJ")) &&
  2907. /^合格$/.test(gett("内部(全面)检验结论(电类定检)"))
  2908. ) {
  2909. addstrtip("检验结论与检验现场安全确认矛盾!");
  2910. }
  2911. }
  2912. //报告结论与下次检验日期的关系
  2913. if (1) {
  2914. if (
  2915. /^[合格,整改后合格]$/.test(gett("内部(全面)检验结论(电类定检)"))
  2916. ) {
  2917. if (
  2918. document.getElementById("1710387041337455d").innerText.trim() ===
  2919. "-"
  2920. ) {
  2921. addstrtip("报告结论合格应该有下次检验日期!");
  2922. }
  2923. }
  2924. if (/^不合格$/.test(gett("内部(全面)检验结论(电类定检)"))) {
  2925. if (
  2926. document.getElementById("1710387041337455d").innerText.trim() !==
  2927. "-"
  2928. ) {
  2929. addstrtip("报告结论不合格下次检验日期为“-”!");
  2930. }
  2931. }
  2932. }
  2933. jyrqgk = document
  2934. .getElementById("1710387111107bbd2")
  2935. .innerText.trim()
  2936. .replace(/年|月|日/g, "-")
  2937. .slice(0, -1);
  2938. jyrqgk = YearMonthToYearMonthDay(jyrqgk);
  2939. if (!ZifuchuanIsDate(jyrqgk)) {
  2940. addstrtip("概况检验日期格式错误!");
  2941. }
  2942. }
  2943. function DateInfo() {
  2944. //封面检验日期 概况检验日期 改造日期
  2945. //制造日期
  2946. //最近一次制动日期 监督日期
  2947. //下次检验日期
  2948. //制造日期 <= 监督日期 < 改造日期 <= 封面检验日期 < 下次检验日期
  2949. //监督日期 < 最近一次制动日期 <= 封面检验日期
  2950. manufactureStr = gett("制造日期");
  2951. supervisionStr = gett("安装监督检验日期");
  2952. renovationStr = gett("改造监督检验日期");
  2953. // 封面检验日期
  2954. coverInspectionStr = document
  2955. .getElementById("1710387041337455d")
  2956. .innerText.trim();
  2957. // 下次检验日期
  2958. nextInspectionStr = gett("内部(全面)下次检验日期(电类定检)");
  2959. // 最近制动日期
  2960. lastBrakingStr = gett("ZDSYRQ");
  2961. //概况检验日期
  2962. generalInspectionStr = document
  2963. .getElementById("1710387111107bbd2")
  2964. .innerText.trim();
  2965. // 验证封面检验日期和概况检验日期相同
  2966. if (coverInspectionStr !== generalInspectionStr) {
  2967. addstrtip("封面检验日期和概况检验日期不一致!");
  2968. }
  2969. // 解析所有日期
  2970. manufactureDate = parseDate(manufactureStr);
  2971. supervisionDate = parseDate(supervisionStr);
  2972. renovationDate = parseDate(renovationStr);
  2973. coverInspectionDate = parseDate(coverInspectionStr);
  2974. nextInspectionDate = parseDate(nextInspectionStr);
  2975. lastBrakingDate = parseDate(lastBrakingStr);
  2976. if (1) {
  2977. //与当前日期进行比较
  2978. if (1) {
  2979. const now = new Date();
  2980. const oneMonthInMillis = 30 * 24 * 60 * 60 * 1000; // 30天转换为毫秒
  2981. const diff = now - coverInspectionDate;
  2982. if (!(diff >= 0 && diff < oneMonthInMillis)) {
  2983. addstrtip("注意是否封面检验日期超出当前日期前一个月范围!");
  2984. }
  2985. if (manufactureDate != null && manufactureDate >= now) {
  2986. addstrtip("注意是否制造日期大于当前日期!");
  2987. }
  2988. if (supervisionDate != null && supervisionDate >= now) {
  2989. addstrtip("注意是否监督日期大于当前日期!");
  2990. }
  2991. if (renovationDate != null && renovationDate >= now) {
  2992. addstrtip("注意是否改造日期大于当前日期!");
  2993. }
  2994. if (coverInspectionDate != null && coverInspectionDate > now) {
  2995. addstrtip("注意是否检验日期大于当前日期!");
  2996. }
  2997. if (lastBrakingDate != null && lastBrakingDate > now) {
  2998. addstrtip("注意是否制动日期大于当前日期!");
  2999. }
  3000. }
  3001. // 验证日期逻辑顺序
  3002. if (1) {
  3003. if (manufactureDate != null && supervisionDate != null) {
  3004. if (!(manufactureDate <= supervisionDate)) {
  3005. addstrtip("注意是否制造日期在监督日期之后!");
  3006. }
  3007. }
  3008. if (supervisionDate != null && renovationDate != null) {
  3009. if (!(supervisionDate <= renovationDate)) {
  3010. addstrtip("注意是否监督日期在改造日期之后!");
  3011. }
  3012. }
  3013. if (renovationDate != null && coverInspectionDate != null) {
  3014. if (!(renovationDate <= coverInspectionDate)) {
  3015. addstrtip("注意是否改造日期在检验日期之后!");
  3016. }
  3017. }
  3018. if (coverInspectionDate != null && nextInspectionDate != null) {
  3019. if (!(coverInspectionDate <= nextInspectionDate)) {
  3020. addstrtip("注意是否检验日期在下次检验日期之后!");
  3021. }
  3022. }
  3023. if (supervisionDate != null && lastBrakingDate != null) {
  3024. let supervisionDatetemp = new Date(supervisionDate.getFullYear(), supervisionDate.getMonth(), 1);
  3025. if (!(supervisionDatetemp <= lastBrakingDate)) {
  3026. addstrtip("注意是否监督检验日期在最近制动日期之后!");
  3027. }
  3028. }
  3029. if (lastBrakingDate != null && coverInspectionDate != null) {
  3030. if (!(lastBrakingDate <= coverInspectionDate)) {
  3031. addstrtip("注意是否最近制动日期在检验日期之后!");
  3032. }
  3033. }
  3034. }
  3035. // 如果封面设备代码有填写,验证和解析设备代码中的年份,与制造日期和监督日期比较
  3036. if (1) {
  3037. const serialRegex = /^(3110|3120)\d{5}(\d{4})\d{5}$/;
  3038. const matchSerial = gett("设备代码").match(serialRegex);
  3039. if (matchSerial) {
  3040. // 提取年份
  3041. const yearFromSerial = parseInt(matchSerial[2], 10);
  3042. if (manufactureDate != null) {
  3043. // 判断序列号中的年份是否在制造日期之前
  3044. if (yearFromSerial > manufactureDate.getFullYear()) {
  3045. addstrtip(
  3046. "封面设备代码中的年份" + matchSerial[2] + "不应在制造日期之后"
  3047. );
  3048. }
  3049. }
  3050. if (supervisionDate != null && manufactureDate === null) {
  3051. // 判断序列号中的年份是否在监督日期之前
  3052. if (yearFromSerial > supervisionDate.getFullYear()) {
  3053. addstrtip(
  3054. "封面设备代码中的年份" + matchSerial[2] + "不应在监督日期之后"
  3055. );
  3056. }
  3057. }
  3058. }
  3059. }
  3060. //如果使用登记证编号形如梯11宁A12345(19),则验证其年份与制造监督日期的关系
  3061. if (1) {
  3062. const regexsy =
  3063. /^梯(11|12)[宁](A|B|C|D|E)\d{5}[\(\(](\d{2})[\)\)]$/;
  3064. const matchsy = gett("使用证编号").match(regexsy);
  3065. if (matchsy) {
  3066. // 提取两位数年份并转换为四位数
  3067. const yearShort = parseInt(matchsy[3], 10);
  3068. const yearFull =
  3069. yearShort >= 0 && yearShort <= 99 ? 2000 + yearShort : yearShort;
  3070. // 创建年份的Date对象,并与传入的日期对象比较
  3071. //const yearDate = new Date(yearFull, 0); // 0 是一月份
  3072. if (supervisionDate != null) {
  3073. // 判断序列号中的年份是否在制造日期之前
  3074. if (yearFull < supervisionDate.getFullYear()) {
  3075. addstrtip(
  3076. "使用登记证编号中的年份" + matchsy[3] + "在监督检验日期之前"
  3077. );
  3078. }
  3079. }
  3080. if (manufactureDate != null && supervisionDate === null) {
  3081. // 判断序列号中的年份是否在监督日期之前
  3082. if (yearFull < manufactureDate.getFullYear()) {
  3083. addstrtip(
  3084. "使用登记证编号中的年份" + matchsy[3] + "在制造检验日期之前"
  3085. );
  3086. }
  3087. }
  3088. }
  3089. }
  3090. //如果使用登记证编号形如31106523252023562563,则验证其年份与制造监督日期的关系
  3091. if (1) {
  3092. const regexsyy = /^(3110|3120)\d{6}(\d{4})\d{6}$/;
  3093. const matchsyy = gett("使用证编号").match(regexsyy);
  3094. if (matchsyy) {
  3095. // 提取两位数年份并转换为四位数
  3096. const year = parseInt(matchsyy[2], 10);
  3097. //const yearDate = new Date(year, 0); // 0 是一月份
  3098. if (supervisionDate != null) {
  3099. // 判断序列号中的年份是否在制造日期之前
  3100. if (year < supervisionDate.getFullYear()) {
  3101. addstrtip(
  3102. "使用登记证编号中的年份" + matchsyy[2] + "在监督检验日期之前"
  3103. );
  3104. }
  3105. }
  3106. if (manufactureDate != null && supervisionDate === null) {
  3107. // 判断序列号中的年份是否在监督日期之前
  3108. if (year < manufactureDate.getFullYear()) {
  3109. addstrtip(
  3110. "使用登记证编号中的年份" + matchsyy[2] + "在制造检验日期之前"
  3111. );
  3112. }
  3113. }
  3114. }
  3115. }
  3116. //验证最近一次制动日期是否合理
  3117. if (1) {
  3118. if (supervisionDate != null && coverInspectionDate != null) {
  3119. let lastBrakingDateCal = calculateBrakeDate(
  3120. supervisionDate,
  3121. new Date(
  3122. coverInspectionDate.getFullYear(),
  3123. supervisionDate.getMonth(),
  3124. supervisionDate.getDate()
  3125. )
  3126. );
  3127. if (lastBrakingDate != null && lastBrakingDateCal != null) {
  3128. if (
  3129. lastBrakingDateCal.getFullYear() !=
  3130. lastBrakingDate.getFullYear() ||
  3131. lastBrakingDateCal.getMonth() != lastBrakingDate.getMonth()
  3132. ) {
  3133. const zjzdjc = elevatorInspection(
  3134. supervisionDate,
  3135. lastBrakingDateCal
  3136. );
  3137. let jyztstr = "";
  3138. if (lastBrakingDateCal < new Date(2024, 3, 1)) {
  3139. jyztstr = "检验";
  3140. } else {
  3141. jyztstr = zjzdjc.result;
  3142. }
  3143. addstrtip(
  3144. "注意最近一次制动日期是否应为:" +
  3145. lastBrakingDateCal.getFullYear() +
  3146. "年" +
  3147. (lastBrakingDateCal.getMonth() + 1).toString() +
  3148. "月,该日期属于" +
  3149. jyztstr +
  3150. "年份。"
  3151. );
  3152. }
  3153. }
  3154. }
  3155. }
  3156. //验证本次下次检验日期是否合理
  3157. if (supervisionDate != null && coverInspectionDate != null) {
  3158. const yanzhengre = elevatorInspection(
  3159. supervisionDate,
  3160. coverInspectionDate
  3161. );
  3162. if (yanzhengre.result != "错误") {
  3163. if (
  3164. !(
  3165. yanzhengre.date.getFullYear() ===
  3166. nextInspectionDate.getFullYear() &&
  3167. yanzhengre.date.getMonth() === nextInspectionDate.getMonth()
  3168. )
  3169. ) {
  3170. addstrtip(
  3171. "注意下次检验日期是否应该是" +
  3172. yanzhengre.date.getFullYear() +
  3173. "年" +
  3174. (yanzhengre.date.getMonth() + 1).toString() +
  3175. "月。"
  3176. );
  3177. }
  3178. if (yanzhengre.result === "检测") {
  3179. addstrtip(
  3180. coverInspectionDate.getFullYear() +
  3181. "年" +
  3182. (supervisionDate.getMonth() + 1).toString() +
  3183. "月应该进行检测,下次检验日期是:" +
  3184. yanzhengre.date.getFullYear() +
  3185. "年" +
  3186. (yanzhengre.date.getMonth() + 1).toString() +
  3187. "月"
  3188. );
  3189. }
  3190. if (yanzhengre.result === "检验") {
  3191. // addstrtip(
  3192. // "下次检验日期是:" +
  3193. // yanzhengre.date.getFullYear() +
  3194. // "年" +
  3195. // (yanzhengre.date.getMonth() + 1).toString() +
  3196. // "月"
  3197. // );
  3198. }
  3199. }
  3200. }
  3201. }
  3202.  
  3203. }
  3204. function preprocessData() {
  3205. // 保存原始的XMLHttpRequest.send方法
  3206. origSend = XMLHttpRequest.prototype.send;
  3207. // 覆盖原始的send方法
  3208. XMLHttpRequest.prototype.send = function (body) {
  3209. if (
  3210. this._url.includes(
  3211. "http://111.51.123.233:8088/intf/report/itemJson/save"
  3212. )
  3213. ) {
  3214. // 检查URL,确保它是你想要拦截的
  3215. //console.log('Sent data:', body);
  3216. //start
  3217. // 解析数据
  3218. try {
  3219. const parsedData = parseCustomUrlEncodedData(body);
  3220. //console.log('结构化:',parsedData);
  3221. //XiaoHe(parsedData);
  3222. } catch (error) {
  3223. console.error("解析数据时发生错误:", error);
  3224. }
  3225.  
  3226. //end
  3227. // var data = JSON.parse(body);
  3228.  
  3229. // 你可以在这里添加更多的逻辑来处理捕获的数据
  3230. }
  3231. // 调用原始的send方法
  3232. origSend.call(this, body);
  3233. };
  3234.  
  3235. // 覆盖原始的XMLHttpRequest.open方法来捕获请求的URL
  3236. origOpen = XMLHttpRequest.prototype.open;
  3237. XMLHttpRequest.prototype.open = function (method, url) {
  3238. this._url = url; // 将URL附加到XHR对象上,以便后续使用
  3239. origOpen.apply(this, arguments);
  3240. };
  3241.  
  3242. button = document.createElement("button");
  3243. button.innerText = "审核系统";
  3244. button.title = "点击进行审核"; // 添加一个提示,当鼠标悬停在按钮上时显示
  3245. button.style.position = "fixed"; // 使用 fixed 定位以便按钮始终停留在视口内
  3246. button.style.right = window.innerWidth / 15 + "px"; // 距离视口右边四分之一窗口宽度
  3247. button.style.bottom = window.innerHeight / 15 + "px"; // 距离视口底部四分之一窗口高度
  3248. button.style.cursor = "grab"; // 更改鼠标样式,表示可以拖动
  3249. // 添加样式
  3250. button.style.fontSize = "16px"; // 字体大小
  3251. button.style.color = "#ffffff"; // 字体颜色
  3252. button.style.backgroundColor = "#add8e6"; // 背景颜色
  3253. button.style.border = "none"; // 无边框
  3254. button.style.borderRadius = "5px"; // 边框圆角
  3255. button.style.padding = "10px 20px"; // 内边距
  3256. button.style.transition = "background-color 0.3s ease"; // 背景色过渡效果
  3257. // 可选:添加鼠标悬停效果
  3258. button.onmouseover = function () {
  3259. this.style.backgroundColor = "#87CEEB"; // 鼠标悬停时背景色稍深一些
  3260. };
  3261. button.onmouseout = function () {
  3262. this.style.backgroundColor = "#add8e6"; // 鼠标离开时恢复为原来的浅蓝色
  3263. };
  3264.  
  3265. // 初始化拖动逻辑
  3266. isDragging = false;
  3267.  
  3268. button.onmousedown = function (e) {
  3269. initialX = e.clientX - button.getBoundingClientRect().right;
  3270. initialY = e.clientY - button.getBoundingClientRect().bottom;
  3271. isDragging = true;
  3272.  
  3273. document.onmousemove = function (e) {
  3274. if (!isDragging) return;
  3275. var newX = e.clientX - initialX;
  3276. var newY = e.clientY - initialY;
  3277. button.style.right = window.innerWidth - newX + "px";
  3278. button.style.bottom = window.innerHeight - newY + "px";
  3279. };
  3280.  
  3281. document.onmouseup = function () {
  3282. isDragging = false;
  3283. document.onmousemove = null;
  3284. document.onmouseup = null;
  3285. };
  3286.  
  3287. e.preventDefault();
  3288. return false;
  3289. };
  3290.  
  3291. // 拖动函数
  3292. function drag(e) {
  3293. if (!isDragging) return;
  3294. // 计算按钮的新位置
  3295. var newX = e.clientX - initialX;
  3296. var newY = e.clientY - initialY;
  3297.  
  3298. // 应用新的位置
  3299. button.style.left = newX + "px";
  3300. button.style.top = newY + "px";
  3301.  
  3302. // 阻止默认事件和冒泡
  3303. e.preventDefault();
  3304. return false;
  3305. }
  3306.  
  3307. // 停止拖动函数
  3308. function stopDragging() {
  3309. // 取消全局的mousemove和mouseup事件绑定
  3310. document.onmousemove = null;
  3311. document.onmouseup = null;
  3312. // 标记为不再拖动
  3313. isDragging = false;
  3314. }
  3315.  
  3316. // 初始化按钮样式
  3317. Object.assign(button.style, {
  3318. fontSize: "16px",
  3319. zIndex: 1000,
  3320. borderRadius: "50%",
  3321. backgroundColor: "#FF8C00",
  3322. boxShadow: "0 4px 8px 0 rgba(0, 0, 0, 0.2)",
  3323. padding: "15px 32px",
  3324. cursor: "grab",
  3325. transition: "all 0.3s ease",
  3326. outline: "none",
  3327. border: "none",
  3328. color: "white",
  3329. textTransform: "uppercase",
  3330. fontWeight: "bold",
  3331. });
  3332.  
  3333. // 将按钮添加到文档中
  3334. document.body.appendChild(button);
  3335. button.onclick = function (e) {
  3336. main();
  3337. };
  3338. //拖动
  3339. if (1) {
  3340. //随意拖动,可编辑,不可以动态调整大小
  3341. if (1) {
  3342. input = document.createElement("TEXTAREA");
  3343.  
  3344. input.id = "information";
  3345. input.name = "information";
  3346.  
  3347. // 设置基本样式
  3348. input.style.width = "320px";
  3349. input.style.height = "400px";
  3350. input.style.resize = "none"; // 禁止用户调整大小
  3351. input.style.position = "absolute"; // 初始时使用绝对定位
  3352. input.style.left = window.innerWidth / 15 + "px"; // 初始时靠左
  3353. input.style.top = window.innerWidth / 4 + "px"; // 初始时靠上
  3354. input.style.zIndex = 100; // 确保它显示在其它元素之上
  3355. input.style.backgroundColor = "#add8e6"; // 浅蓝色背景
  3356. // 可选:添加鼠标悬停效果
  3357. input.onmouseover = function () {
  3358. this.style.backgroundColor = "#87CEEB"; // 鼠标悬停时背景色稍深一些
  3359. };
  3360. input.onmouseout = function () {
  3361. this.style.backgroundColor = "#add8e6"; // 鼠标离开时恢复为原来的浅蓝色
  3362. };
  3363.  
  3364. // 标记拖动状态
  3365. isDragging1 = false;// 用于记录鼠标相对于textarea的偏移量
  3366.  
  3367. // 右键按下时开始拖动
  3368. input.onmousedown = function (e) {
  3369. if (e.button === 2) {
  3370. // 右键
  3371. e.preventDefault(); // 阻止默认行为
  3372.  
  3373. // 记录鼠标按下时的位置
  3374. initialX1 = e.clientX - parseInt(input.style.left, 10);
  3375. initialY1 = e.clientY - parseInt(input.style.top, 10);
  3376.  
  3377. // 记录鼠标相对于textarea的偏移量
  3378. offsetX1 = e.clientX - input.offsetLeft;
  3379. offsetY1 = e.clientY - input.offsetTop;
  3380.  
  3381. // 标记为正在拖动
  3382. isDragging1 = true;
  3383.  
  3384. // 绑定鼠标移动和释放事件
  3385. document.onmousemove = drag1;
  3386. document.onmouseup = stopDrag1;
  3387. }
  3388. };
  3389.  
  3390. // 鼠标移动时拖动textarea
  3391. function drag1(e) {
  3392. if (!isDragging1) return;
  3393.  
  3394. // 计算新的位置
  3395. var newX = e.clientX - offsetX1;
  3396. var newY = e.clientY - offsetY1;
  3397.  
  3398. // 限制textarea不超出视口
  3399. newX = Math.max(
  3400. 0,
  3401. Math.min(newX, window.innerWidth - input.offsetWidth)
  3402. );
  3403. newY = Math.max(
  3404. 0,
  3405. Math.min(newY, window.innerHeight - input.offsetHeight)
  3406. );
  3407.  
  3408. // 更新textarea的位置
  3409. input.style.left = newX + "px";
  3410. input.style.top = newY + "px";
  3411. }
  3412.  
  3413. // 停止拖动
  3414. function stopDrag1() {
  3415. // 标记为不再拖动
  3416. isDragging1 = false;
  3417.  
  3418. // 移除鼠标移动和释放事件的绑定
  3419. document.onmousemove = null;
  3420. document.onmouseup = null;
  3421. }
  3422.  
  3423. // 将textarea添加到文档中
  3424. document.body.appendChild(input);
  3425.  
  3426. // 设置textarea的美观样式
  3427. Object.assign(input.style, {
  3428. border: "2px solid #ccc", // 添加边框
  3429. borderRadius: "10px", // 使用更平滑的圆角
  3430. backgroundColor: "white",
  3431. padding: "10px", // 增加内边距
  3432. boxShadow: "0 0 5px rgba(0, 0, 0, 0.1)", // 添加阴影
  3433. fontSize: "16px",
  3434. overflow: "auto", // 当内容超出时显示滚动条
  3435. });
  3436. }
  3437. }
  3438.  
  3439. function parseCustomUrlEncodedData(dataString) {
  3440. const parts = dataString.split("&");
  3441. const objects = [];
  3442.  
  3443. parts.forEach((part) => {
  3444. const [key, encodedValue] = part.split("=");
  3445. const decodedValue = decodeURIComponent(encodedValue);
  3446. const parsedValue = JSON.parse(decodedValue);
  3447. objects.push(parsedValue);
  3448. });
  3449. let mergedObject = {};
  3450.  
  3451. objects.forEach((obj) => {
  3452. Object.assign(mergedObject, obj);
  3453. });
  3454. return mergedObject;
  3455. }
  3456. }
  3457. function checkAreaForDepartmentPrefix(bumenstr, areastr) {
  3458. const departmentPrefixes = [
  3459. 'JD1', 'JD2', 'JD3',
  3460. 'SZSJD', 'WZJD', 'ZWJD', 'GYJD'
  3461. ];
  3462. const departmentMappings = {
  3463. 'JD1': ['金凤区', '宁东'],
  3464. 'JD2': ['西夏区', '永宁县'],
  3465. 'JD3': ['兴庆区', '贺兰县'],
  3466. 'SZSJD': ['大武口区', '惠农区', '平罗县'],
  3467. 'WZJD': ['利通区', '红寺堡区', '盐池县', '同心县', '铜峡市'],
  3468. 'ZWJD': ['沙坡头区', '中宁县', '海原县'],
  3469. 'GYJD': ['原州区', '西吉县', '隆德县', '泾源县', '彭阳县']
  3470. };
  3471.  
  3472. // 检查bumenstr是否包含任意部门前缀
  3473. for (let prefix of departmentPrefixes) {
  3474. if (bumenstr.includes(prefix)) {
  3475. // 获取对应的区域数组
  3476. const areas = departmentMappings[prefix];
  3477. // 遍历对应区域,检查areastr是否包含任意一个
  3478. for (let area of areas) {
  3479. if (areastr.includes(area)) {
  3480. return true; // 如果包含,返回true
  3481. }
  3482. }
  3483. }
  3484. }
  3485. return false; // 如果不包含,返回false
  3486. }
  3487. function checkStringContainsLocation(zcdstr, azdstr, regions) {
  3488. // 创建一个映射表,将字母映射到对应的地级市
  3489. const cityMapping = {
  3490. 'A': '银川市',
  3491. 'B': '石嘴山市',
  3492. 'C': '吴忠市',
  3493. 'D': '固原市',
  3494. 'E': '中卫市'
  3495. };
  3496.  
  3497. // 检查`azdstr`中是否包含`zcdstr`对应的地名或其子地名
  3498. function checkLocation(city, str) {
  3499. // 检查是否直接包含城市名
  3500. if (str.includes(city)) {
  3501. return city;
  3502. }
  3503. // 遍历城市的子地名
  3504. for (let district in regions[city]) {
  3505. if (str.includes(district)) {
  3506. return district;
  3507. }
  3508. // 如果有更深层级的地名,也进行检查
  3509. if (regions[city][district] && typeof regions[city][district] === 'object') {
  3510. for (let subDistrict in regions[city][district]) {
  3511. if (str.includes(subDistrict)) {
  3512. return subDistrict;
  3513. }
  3514. }
  3515. }
  3516. }
  3517. return null;
  3518. }
  3519.  
  3520. // 转换zcdstr为对应的地名
  3521. let targetCity = cityMapping[zcdstr];
  3522. if (!targetCity) {
  3523. return {
  3524. contains: false,
  3525. zcdstrRepresents: null,
  3526. azdstrContains: null
  3527. };
  3528. }
  3529. // 检查azdstr是否包含目标地名或其子地名
  3530. let containedLocation = checkLocation(targetCity, azdstr);
  3531. let result = {
  3532. contains: containedLocation !== null,
  3533. zcdstrRepresents: targetCity,
  3534. azdstrContains: containedLocation
  3535. };
  3536.  
  3537. return result;
  3538. }
  3539. function openMyFile() {
  3540. button11 = document.createElement("button");
  3541. // PDF文件的URL,替换为你想要打开的PDF文件的实际URL
  3542. pdfUrl = 'https://wenku.baidu.com/view/6d4397b4b7daa58da0116c175f0e7cd1842518ad';
  3543. button11.innerText = "电梯监督检验和定期检验规则2023";
  3544. button11.title = "点击进行审核"; // 添加一个提示,当鼠标悬停在按钮上时显示
  3545. button11.style.position = "fixed"; // 使用 fixed 定位以便按钮始终停留在视口内
  3546. button11.style.right = window.innerWidth / 100 + "px"; // 距离视口右边四分之一窗口宽度
  3547. button11.style.bottom = window.innerHeight / 3 + "px"; // 距离视口底部四分之一窗口高度
  3548. button11.style.cursor = "grab"; // 更改鼠标样式,表示可以拖动
  3549. // 添加样式
  3550. button11.style.fontSize = "16px"; // 字体大小
  3551. button11.style.color = "#ffffff"; // 字体颜色
  3552. button11.style.backgroundColor = "#add8e6"; // 背景颜色
  3553. button11.style.border = "none"; // 无边框
  3554. button11.style.borderRadius = "5px"; // 边框圆角
  3555. button11.style.padding = "10px 20px"; // 内边距
  3556. button11.style.transition = "background-color 0.3s ease"; // 背景色过渡效果
  3557. button11.onclick = function () {
  3558. // 在新窗口或标签页中打开PDF文件
  3559. window.open(pdfUrl, '_blank');
  3560. };
  3561. document.body.appendChild(button11);
  3562. }
  3563. function describeFormFillStatus() {
  3564. des("4(2)液压缓冲器", "JYJG8_JYJL4");
  3565. des("5(3)接地故障保护", "JYJG11_JYJL5");
  3566. des("6(1)旁路", "JYJG12_JYJL6");
  3567. des("7制动器状态监测", "JYJG16_JYJL7");
  3568. des("8(1)紧急电动运行", "JYJG17_JYJL8");
  3569. des("9(1)紧急操作和动态测试装置", "JYJG19_JYJL9");
  3570. des("10紧急报警(对讲)", "JYJG20_JYJL10");
  3571. des("11驱动主机停止装置", "JYJG21_JYJL11");
  3572. des("12(1)井道外独立测试制动组", "JYJG22_JYJL12");
  3573. des("12(2)鼓式制动器动作", "JYJG23_JYJL12");
  3574. des("12(3)鼓式制动器拆解", "JYJG24_JYJL12");
  3575. des("13(3)盘车手轮", "JYJG27_JYJL13");
  3576. des("13(4)盘车手轮电气验证", "JYJG28_JYJL13");
  3577. des("14(1)钢丝绳", "JYJG30_JYJL14");
  3578. des("15(1)包覆带", "JYJG32_JYJL15");
  3579. des("17钢丝绳、包覆带异常伸长保护", "JYJG36_JYJL17");
  3580. des("18(3)非金属反绳轮", "JYJG39_JYJL18");
  3581. des("19(3)轿厢安全窗电气", "JYJG41_JYJL19");
  3582. des("20(3)轿厢安全门电气", "JYJG42_JYJL20");
  3583. des("21(2)非金属对重", "JYJG44_JYJL21");
  3584. des("23轿厢语音播报系统", "JYJG49_JYJL23");
  3585. des("26(3)层门底部啮合深度标记", "JYJG55_JYJL26");
  3586. des("27(2)层门防重锤坠落", "JYJG57_JYJL27");
  3587. des("36对重限速器", "JYJG77_JYJL36");
  3588. des("37对重联动试验", "JYJG78_JYJL36");
  3589. des("38缓冲器试验", "JYJG79_JYJL38");
  3590. des("39(3)上行超速冗余制动器", "JYJG82_JYJL39");
  3591. des("40(3)意外移动冗余制动器", "JYJG86_JYJL40");
  3592. des("42 125%制动试验", "JYJG90_JYJL42");
  3593. }
  3594. function dess(namestr) {
  3595. if (dat[namestr] === '√') {
  3596. return "符合";
  3597. } else if (dat[namestr] === '×') {
  3598. return "不符合";
  3599. } else if (dat[namestr] === '△') {
  3600. return "整改后符合";
  3601. } else if (dat[namestr] === '-') {
  3602. return "无此项";
  3603. } else {
  3604. return "空";
  3605. }
  3606. }
  3607. function des(smstr, namestr) {
  3608. strinput = strinput + smstr + ' ' + dess(namestr) + "\n";
  3609. }
  3610. function detectBrowser() {
  3611. var userAgent = navigator.userAgent || window.opera;
  3612.  
  3613. // Firefox detection
  3614. if (userAgent.includes("Firefox")) {
  3615. return "Firefox";
  3616. }
  3617.  
  3618. // Microsoft Edge detection (new Edge is based on Chromium)
  3619. if (userAgent.includes("Edg")) { // Note: New Edge uses "Edg" instead of "Edge" in userAgent
  3620. return "Edge";
  3621. }
  3622.  
  3623. // 360 Secure Browser and 360 Extreme Browser detection
  3624. // Note: These keywords may vary depending on the browser version and configuration
  3625. if (userAgent.includes("360SE")) {
  3626. return "360 Secure Browser";
  3627. } else if (userAgent.includes("360EE")) {
  3628. return "360 Extreme Browser";
  3629. }
  3630.  
  3631. // Chrome and Chromium-based browsers (excluding new Edge)
  3632. if (userAgent.includes("Chrome") && !userAgent.includes("Edg")) {
  3633. return "Chrome";
  3634. }
  3635.  
  3636. // If none of the above conditions are met, return unknown
  3637. return "Unknown";
  3638. }
  3639. })();
  3640.  

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址