personal-info.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. (function() {
  2. Vue.component('personal-info', {
  3. template: `<div class="container ptb20 ">
  4. <div class="row w3-row">
  5. <left-menu :code="code"></left-menu>
  6. <div class="pl251">
  7. <div class="bgc-fff c-border ptb30">
  8. <form class="mainbox" id="form" role="form" onsubmit="return false;">
  9. <div class="c-t-center mb10">
  10. <img src="../image/touxiang.jpg" class="img-circle" width="100" height="100" id="personalImg" />
  11. <div class="c-f14 c-909090 pt15">
  12. <input type="file" @change="uploadImg()" class="c-vam c-inline-block type-hide pl105" accept="image/jpg,image/jpeg,image/png"><span class="changeImg">修改头像</span></div>
  13. </div>
  14. <div class="w3-row mt50">
  15. <div class="w3-col c-f16 m5 c-t-right" style="width:80px;">姓&emsp;&emsp;名</div>
  16. <div class="w3-rest pl15">
  17. <input type="text" class="form-control">
  18. </div>
  19. </div>
  20. <div class="w3-row">
  21. <div class="w3-col c-f16 m5 c-t-right" style="width:80px;">性&emsp;&emsp;别</div>
  22. <div class="w3-rest pl15 c-f14">
  23. <input type="radio" name="sex" id="male" checked="checked" value="male">&emsp;男&emsp;
  24. <input type="radio" name="sex" id="female" value="female">&emsp;女
  25. </div>
  26. </div>
  27. <div class="w3-row mt25">
  28. <div class="w3-col c-f16 m5 c-t-right" style="width:80px;">手机号码</div>
  29. <div class="w3-rest pl15">
  30. <input type="text" class="form-control">
  31. </div>
  32. </div>
  33. <div class="w3-row mt25">
  34. <div class="w3-col c-f16 m5 c-t-right" style="width:80px;">身份证号</div>
  35. <div class="w3-rest pl15">
  36. <input type="text" class="form-control">
  37. </div>
  38. </div>
  39. <div class="w3-row mt25">
  40. <div class="w3-col c-f16 m5 c-t-right" style="width:80px;">社保卡号</div>
  41. <div class="w3-rest pl15">
  42. <input type="text" class="form-control">
  43. </div>
  44. </div>
  45. <div class="w3-row mt25">
  46. <div class="w3-col c-f16 m5 c-t-right" style="width:80px;">医疗保险号</div>
  47. <div class="w3-rest pl15">
  48. <input type="text" class="form-control">
  49. </div>
  50. </div>
  51. <div class="w3-row mt25">
  52. <div class="w3-col c-323232 c-f16 m5 c-t-right" style="width:80px;">行&emsp;&emsp;业</div>
  53. <div class="pl105" data-toggle="modal" data-target="#selindustry">
  54. <input id="industry" placeholder="请选择行业" type="text" class="form-control" name="industry"><span class="caret selcaret"></span>
  55. </div>
  56. </div>
  57. <div class="w3-row mt25">
  58. <div class="w3-col c-323232 c-f16 m5 c-t-right" style="width:80px;">家庭住址</div>
  59. <div class="pl105">
  60. <div class="dropdown">
  61. <a id="addressLabel" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
  62. <input id="addrcode" placeholder="请选择家庭住址" type="text" class="form-control" name="addrcode"><span class="caret selcaret"></span>
  63. </a>
  64. <selsect-address></selsect-address>
  65. </div>
  66. <textarea class="form-control mt10"></textarea>
  67. </div>
  68. </div>
  69. <div class="c-t-center ">
  70. <button type="submit" class="btn btn-theme c-f16 mtb30" style="width:144px;" >保 存</button>
  71. </div>
  72. </form>
  73. <select-industry :industryid="industryid" :directionid="directionid" ref="getIndustry"></select-industry>
  74. </div>
  75. </div>
  76. </div>
  77. </div>`,
  78. props: [],
  79. data: function() {
  80. return {
  81. gotoAddid: "Province",
  82. code: "info",
  83. industryid: -1,
  84. directionid: -1,
  85. industryname: "",
  86. directionname: "",
  87. }
  88. },
  89. mounted: function() {
  90. var vm = this
  91. $('.dropdown-toggle').dropdown()
  92. $('#selindustry').on('hidden.bs.modal', function(e) {
  93. vm.getNewIndustry()
  94. })
  95. },
  96. methods: {
  97. getNewIndustry: function() {
  98. var vm = this
  99. var aaa = vm.$refs.getIndustry.industryname
  100. var bbb = vm.$refs.getIndustry.directionname
  101. if(aaa != "") {
  102. vm.industryname = aaa
  103. vm.industryid = vm.$refs.getIndustry.industryid
  104. }
  105. if(bbb != "") {
  106. vm.directionname = bbb
  107. vm.directionid = vm.$refs.getIndustry.directionid
  108. }
  109. if(vm.industryname == "请选择行业") {
  110. $("#industry").val("")
  111. } else {
  112. $("#industry").val(vm.industryname + ">" + vm.directionname)
  113. }
  114. }
  115. },
  116. })
  117. var gotoAddid = "Province"
  118. function initInterfaceTypeSelect(industry) {
  119. $(".dropdown-menu").on("click", "[data-stopPropagation]", function(e) {
  120. e.stopPropagation();
  121. });
  122. Selectors.createDefinedSelect(industry.el, industry.data)
  123. }
  124. function gotoAdd(id) {
  125. var addid = $(id).attr("id")
  126. if(addid == undefined) {
  127. addid = id
  128. }
  129. $("#" + gotoAddid).removeClass("active")
  130. $("#" + addid).addClass("active")
  131. $("#_" + gotoAddid).addClass("hidden")
  132. $("#_" + addid).removeClass("hidden")
  133. gotoAddid = addid
  134. }
  135. })()