joinMedia.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <view class="table">
  3. <view class="content">
  4. <view class="left">
  5. 姓名
  6. </view>
  7. <input type="text" value="" placeholder="请输入姓名" v-model="name" />
  8. </view>
  9. <view class="content">
  10. <view class="left">
  11. 联系电话
  12. </view>
  13. <input type="number" value="" placeholder="请输入联系电话" v-model="phone" />
  14. </view>
  15. <view class="content">
  16. <view class="left">
  17. 职务
  18. </view>
  19. <picker class="input" :range="choosePost" @change="bindPickerType">
  20. <view class="box-right" :class="{ 'hui' : post == '' }">{{ post || '请选择职务' }}</view>
  21. </picker>
  22. <!-- <input type="text" value="" focus placeholder="请选择所属行业" v-model="hangye"/> -->
  23. </view>
  24. <template v-if=" (post.indexOf('董事长') != -1)|| (post.indexOf('总经理') != -1)">
  25. <view class="content">
  26. <view class="left">
  27. 学历
  28. </view>
  29. <picker class="input" :range="xlList" @change="bindXl">
  30. <view class="box-right" :class="{ 'hui' : xl == '' }">{{ xl|| '请选择学历' }}</view>
  31. </picker>
  32. <!-- <input type="text" value="" focus placeholder="请选择所属行业" v-model="hangye"/> -->
  33. </view>
  34. <view class="content">
  35. <view class="left">
  36. 生日
  37. </view>
  38. <picker class="input" mode="date" @change="bindBrith">
  39. <view class="box-right" :class="{ 'hui' : brith == '' }">{{ brith|| '请选择生日' }}</view>
  40. </picker>
  41. </view>
  42. <view class="content">
  43. <view class="left">
  44. 职称
  45. </view>
  46. <input type="text" value="" placeholder="请输入职称(如高级工程师)" v-model="zc" />
  47. </view>
  48. </template>
  49. <view class="button" @click="commit()">
  50. 提交
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. import {
  56. postlist,
  57. joinSubmit
  58. } from '@/api/user.js'
  59. export default {
  60. data() {
  61. return {
  62. id: '',
  63. name: '', //姓名
  64. phone: '', //电话
  65. post: '', //职务
  66. choosePost: [], //职务列表名字
  67. postList: [], //职务列表详情
  68. index: '', //职务id
  69. xlList: ['博士','硕士','本科','专科','大专','高中','小学','其他'],
  70. xl:'',
  71. brith: '',
  72. zc: ''
  73. };
  74. },
  75. onLoad(option) {
  76. this.id = option.id;
  77. postlist().then(({
  78. data
  79. }) => {
  80. this.postList = data
  81. data.forEach(e => {
  82. this.choosePost.push(e.title)
  83. })
  84. console.log(data, "123456");
  85. })
  86. },
  87. methods: {
  88. commit() {
  89. if (this.name == '') {
  90. return this.$api.msg('请输入姓名')
  91. }
  92. if (this.post == '') {
  93. return this.$api.msg('请选择职务')
  94. }
  95. if (this.phone == '') {
  96. return this.$api.msg('请输入联系电话')
  97. }
  98. if((this.post.indexOf('董事长') != -1) || (this.post.indexOf('总经理') != -1)) {
  99. if(this.xl == '' ) {
  100. return this.$api.msg('请选择学历')
  101. }
  102. if(this.brith == '') {
  103. return this.$api.msg('请选择生日')
  104. }
  105. if(this.zc == '') {
  106. return this.$api.msg('请输入职称')
  107. }
  108. }
  109. joinSubmit({
  110. merId: this.id,
  111. applyUserName: this.name,
  112. applyUserMobile: this.phone,
  113. applyJobId: this.index,
  114. edu: this.xl,
  115. birthday:this.brith,
  116. title: this.zc
  117. }).then(e => {
  118. uni.navigateBack({
  119. delta: 1, //返回层数,2则上上页
  120. })
  121. })
  122. },
  123. //请选择职务
  124. bindPickerType(e) {
  125. this.post = this.choosePost[e.target.value];
  126. this.index = this.postList[e.target.value].id;
  127. console.log(this.index);
  128. },
  129. //
  130. bindXl(e) {
  131. this.xl = this.xlList[e.target.value];
  132. },
  133. bindBrith(e) {
  134. this.brith = e.detail.value
  135. }
  136. }
  137. }
  138. </script>
  139. <style lang="scss">
  140. .table {
  141. width: 750rpx;
  142. background: #FFFFFF;
  143. // margin: 30rpx auto;
  144. }
  145. .table-title {
  146. display: flex;
  147. align-items: center;
  148. .gg {
  149. margin-left: 30rpx;
  150. width: 3rpx;
  151. height: 30rpx;
  152. background: #FF6061;
  153. border-radius: 2px;
  154. }
  155. .title {
  156. margin-left: 15rpx;
  157. font-size: 30rpx;
  158. font-weight: bold;
  159. color: #333333;
  160. line-height: 80rpx;
  161. }
  162. }
  163. .content {
  164. border-top: 2rpx solid #F3F3F3;
  165. display: flex;
  166. align-items: center;
  167. line-height: 80rpx;
  168. .left {
  169. width: 120rpx;
  170. margin: 0 30rpx;
  171. font-size: 28rpx;
  172. font-weight: bold;
  173. color: #333333;
  174. }
  175. input {
  176. margin: 0;
  177. }
  178. .input {
  179. margin: 0;
  180. }
  181. }
  182. .button {
  183. margin: 100rpx auto;
  184. width: 650rpx;
  185. height: 80rpx;
  186. background: #FE5341;
  187. border-radius: 38rpx;
  188. font-size: 30rpx;
  189. font-weight: 500;
  190. color: #FFFFFF;
  191. line-height: 80rpx;
  192. text-align: center;
  193. }
  194. .hui {
  195. color: #999999 !important;
  196. }
  197. </style>