Growing cancer vaccin

The main function is to verify the correctness of the report, only to provide suggestions

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

QingJ © 2025

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