人力-本機&測試機-前台整合會員註冊-自動填入欄位

車機廠商註冊-自動填入欄位

  1. // ==UserScript==
  2. // @name 人力-本機&測試機-前台整合會員註冊-自動填入欄位
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2.2
  5. // @description 車機廠商註冊-自動填入欄位
  6. // @author hander
  7. // @match http://localhost:30942/FrontRegisterNew/IntegratedRegister*
  8. // @match https://lcahr.lingcheng.tw/TalentMatch/FrontRegisterNew/IntegratedRegister*
  9. // @match https://lcahr.lingcheng.tw/TalentMatchBox/FrontRegisterNew/IntegratedRegister*
  10. // @icon https://www.google.com/s2/favicons?sz=64&domain=undefined.localhost
  11. // @grant none
  12. // @license MIT
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. let $autoFillBtn = $("<button>", {html: "腳本自動填入測資", class:"float-right btn btn-success", type: "button"});
  19. $autoFillBtn.on("click", autoFillColumns);
  20. $("#editForm").find("h5:first").append($autoFillBtn);
  21.  
  22. function autoFillColumns() {
  23. let newCode = makeNewCode(4);
  24. let newAcc = newCode + "01";
  25.  
  26. if (editForm.Account != undefined) {
  27. editForm.Account.value = newAcc;
  28. editForm.Password.value = "a123456789";
  29. editForm.ConfirmPwd.value = "a123456789";
  30. }
  31.  
  32. if (editForm.Name != undefined) {
  33. editForm.Name.value = newAcc;
  34. editForm.IdentityNo.value = getid();
  35. $("#tempBirthday").val("84/03/24").change();
  36. editForm.AreaNumber.value = "07";
  37. editForm.Telephone.value = "7123456";
  38. editForm.Cellphone.value = "0976562436";
  39. editForm.Email.value = "handertest@gmail.com";
  40. editForm.Location.value = "123";
  41. if (!$("[name=TempAgree]").is(":checked")) $("[name=TempAgree]").click()
  42.  
  43. setTimeout(function() {
  44. $("#County").val("01").change();
  45. setTimeout(function() {
  46. $("#Township").val("0101").change();
  47. }, 500);
  48. }, 500);
  49. }
  50. }
  51.  
  52. function makeNewCode(length) {
  53. var result = '';
  54. var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  55. var charactersLength = characters.length;
  56. for ( var i = 0; i < length; i++ ) {
  57. result += characters.charAt(Math.floor(Math.random() *
  58. charactersLength));
  59. }
  60. return result;
  61. }
  62.  
  63.  
  64.  
  65.  
  66.  
  67. //最小(包含)與最大(包含)值間的亂數
  68. function getRandom(min,max){
  69. return Math.floor(Math.random()*(max-min+1))+min;
  70. };
  71. //取得身份證字號
  72. function getid(){
  73. var a=[];
  74. var b=[10,11,12,13,14,15,16,17,34,18,19,20,21,22,35,23,24,25,26,27,28,29,32,30,31,33];
  75. var value="";
  76. for(let i = 65; i < 91; i++){
  77. a.push(String.fromCharCode(i));
  78. }
  79. value=a[getRandom(0,25)]+getRandom(1,2);
  80. for(let i=0;i<7;i++){
  81. value+=getRandom(1,9);
  82. }
  83. return value+=getchknum(value);
  84. }
  85. //取得身份證字號最後一個檢查碼
  86. function getchknum(x){
  87. try{
  88. var a=[];
  89. var b=[10,11,12,13,14,15,16,17,34,18,19,20,21,22,35,23,24,25,26,27,28,29,32,30,31,33];
  90.  
  91. for(var i = 65; i < 91; i++){
  92. a.push(String.fromCharCode(i));
  93. }
  94.  
  95. var num=a.indexOf(x.substr(0,1));
  96. var b1=parseInt(b[num].toString().substr(0,1));
  97. var b2=parseInt(b[num].toString().substr(1,1));
  98.  
  99. var fnum=b1+(b2*9); //英文字母算出的數字
  100. var ff=1;
  101. for(let i=8;i>0;i--){
  102. fnum+=x.substr(i,1)*ff;
  103. ff++;
  104. }
  105. var final=(fnum%10==0)?0:10-(fnum%10); //檢查碼
  106. return final;
  107. }catch{
  108. return null;
  109. }
  110. };
  111. })();

QingJ © 2025

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