conference-offline-zh.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. <template>
  2. <view class="bigbox">
  3. <!-- 顶部导航栏 -->
  4. <uni-nav-bar status-bar=true fixed=true left-icon="arrowleft" background-color="#3387ff" color="#ffffff"
  5. @clickLeft="navigateBack">
  6. <text slot="default" style="text-align: center; flex: 1; font-size: 18px; font-weight: bold;">报名信息</text>
  7. <button slot="right" @click="submitForm" size="mini" class="sunmit-btn" type="submit"
  8. hover-class="button-hover">提交</button>
  9. </uni-nav-bar>
  10. <!-- 背景装饰物 -->
  11. <view class="decorate">
  12. <!-- <view class="decorates"></view> -->
  13. </view>
  14. <!-- 表单部分 -->
  15. <uni-list :border="false"
  16. style="width: 686rpx;margin: 100rpx 32rpx;border-radius: 12rpx;overflow: hidden;box-shadow: 0px 3px 6px #000000;">
  17. <uni-list-item showArrow clickable @click="toUpload">
  18. <view slot="header" class="text_style" style="line-height: 104rpx;">
  19. <text style="margin-left: 26rpx;">照片</text>
  20. </view>
  21. <image v-if="meetingApply.photoUrl" @click="toUpload" slot="footer"
  22. :src="websiteUrl+meetingApply.photoUrl"
  23. style="width: 100rpx;height: 140rpx; border-radius: 16rpx;margin-top: -134rpx;"></image>
  24. </uni-list-item>
  25. <uni-list-item clickable>
  26. <text slot="header" class="text_style text_style_s label">邀请码</text>
  27. <input placeholder="请填写邀请码(如无,请填写“000000”)" slot="body" class="uni-input-info text_style_s"
  28. v-model="meetingApply.invitationCode" />
  29. </uni-list-item>
  30. <uni-list-item clickable>
  31. <text slot="header" class="text_style text_style_s label">姓名</text>
  32. <input placeholder="请填写您的姓名" slot="body" class="uni-input-info text_style_s"
  33. v-model="meetingApply.name" />
  34. </uni-list-item>
  35. <uni-list-item clickable>
  36. <text slot="header" class="text_style text_style_s" style="margin-left: 8rpx;">英文姓名</text>
  37. <input placeholder="请填写您的英文姓名" slot="body" class="uni-input-info text_style_s"
  38. v-model="meetingApply.nameEn" />
  39. </uni-list-item>
  40. <uni-list-item showArrow>
  41. <text slot="header" class="text_style text_style_s label">性别</text>
  42. <view slot="body" class="uni-list select-view">
  43. <view class="uni-list-cell">
  44. <view class="uni-list-cell-db">
  45. <picker @change="bindPickerChange" :value="genderIndex" :range="genderRange"
  46. range-key="label">
  47. <view class="uni-input">{{genderRange[genderIndex].label}}</view>
  48. </picker>
  49. </view>
  50. </view>
  51. </view>
  52. </uni-list-item>
  53. <uni-list-item clickable>
  54. <text slot="header" class="text_style text_style_s label">邮箱</text>
  55. <input placeholder="请填写您的邮箱" slot="body" class="uni-input-info text_style_s"
  56. v-model="meetingApply.email" />
  57. </uni-list-item>
  58. <uni-list-item clickable>
  59. <text slot="header" class="text_style text_style_s label">手机</text>
  60. <input placeholder="请填写您的手机" slot="body" class="uni-input-info text_style_s"
  61. v-model="meetingApply.tel" />
  62. </uni-list-item>
  63. <uni-list-item showArrow clickable @click="toUnitCountryDict">
  64. <view slot="header" class="text_style select-view"
  65. style="line-height: 92rpx; font-weight: bold;padding-left: 28rpx;">
  66. <text class="label" style="margin-left: 10rpx;">国家</text>
  67. </view>
  68. <text slot="footer" style="line-height: 92rpx;">{{unitCountry}}</text>
  69. </uni-list-item>
  70. <uni-list-item clickable>
  71. <text slot="header" class="text_style text_style_s label">所在单位</text>
  72. <input placeholder="请填写您的所在单位" slot="body" class="uni-input-info text_style_s"
  73. v-model="meetingApply.unitName" />
  74. </uni-list-item>
  75. <uni-list-item clickable>
  76. <text slot="header" class="text_style text_style_s" style="margin-left: 8rpx;">英文单位</text>
  77. <input placeholder="请填写您的所在英文单位" slot="body" class="uni-input-info text_style_s"
  78. v-model="meetingApply.unitNameEn" />
  79. </uni-list-item>
  80. <uni-list-item showArrow>
  81. <text slot="header" class="text_style text_style_s label">单位类型</text>
  82. <view slot="body" class="uni-list select-view">
  83. <view class="uni-list-cell" v-if="UnitTypeDictRange.length">
  84. <view class="uni-list-cell-db">
  85. <picker @change="bindUnitTypePickerChange" :value="unitTypeIndex" :range="UnitTypeDictRange"
  86. range-key="label">
  87. <view class="uni-input">{{UnitTypeDictRange[unitTypeIndex].label}}</view>
  88. </picker>
  89. </view>
  90. </view>
  91. </view>
  92. </uni-list-item>
  93. <uni-list-item clickable>
  94. <text slot="header" class="text_style text_style_s label">职务</text>
  95. <input placeholder="请填写您的职务" slot="body" class="uni-input-info text_style_s"
  96. v-model="meetingApply.positionName" />
  97. </uni-list-item>
  98. <uni-list-item clickable>
  99. <text slot="header" class="text_style text_style_s" style="margin-left: 8rpx;">英文职务</text>
  100. <input placeholder="请填写您的英文职务" slot="body" class="uni-input-info text_style_s"
  101. v-model="meetingApply.positionNameEn" />
  102. </uni-list-item>
  103. <uni-list-item clickable>
  104. <text slot="header" class="text_style text_style_s label">联系人姓名</text>
  105. <input placeholder="请填写您的联系人姓名" slot="body" class="uni-input-info text_style_s"
  106. v-model="meetingApply.contactPersonName" />
  107. </uni-list-item>
  108. <uni-list-item clickable>
  109. <text slot="header" class="text_style text_style_s label">联系人手机</text>
  110. <input placeholder="请填写您的联系人手机" slot="body" class="uni-input-info text_style_s"
  111. v-model="meetingApply.contactCellphone" />
  112. </uni-list-item>
  113. <uni-list-item clickable>
  114. <text slot="header" class="text_style text_style_s label">联系人邮箱</text>
  115. <input placeholder="请填写您的联系人邮箱" slot="body" class="uni-input-info text_style_s"
  116. v-model="meetingApply.contactEmail" />
  117. </uni-list-item>
  118. </uni-list>
  119. <activities-select v-if="baseInfo!= {} && baseInfo.isShowZhOnsiteIntention=='Yes'"
  120. :meetingId="meetingApply.meetingId" @getcheckedIds="getActivityIds" @getcheckDetermine="getdetermine"></activities-select>
  121. </view>
  122. </template>
  123. <script>
  124. import {
  125. addIntegral,
  126. addGrowth
  127. } from '@/components/addPointDetailByTaskDict.js'
  128. import uniNavBar from "@/components/uni-nav-bar/uni-nav-bar.vue";
  129. import chineseToPinYin from "@/components/uni-pinyin/uni-pinyin.js";
  130. import informationInput from "@/pages/conference/conferenceOfflineZh/information.vue";
  131. import activitiesSelect from "@/pages/conference/activitiesSelect.vue";
  132. export default {
  133. components: {
  134. uniNavBar,
  135. informationInput,
  136. activitiesSelect,
  137. addIntegral,
  138. addGrowth
  139. },
  140. data() {
  141. return {
  142. unitCountry: '中国',
  143. genderRange: [{
  144. value: 'M',
  145. label: '男'
  146. },
  147. {
  148. value: 'F',
  149. label: '女'
  150. }
  151. ],
  152. genderIndex: 0,
  153. unitTypeIndex: 0,
  154. UnitTypeDictRange: [],
  155. baseInfo: {},
  156. invitationCodePrefix: [], //邀请码集合
  157. invitationCodeArr: [], //邀请码集合
  158. meetingApply: {
  159. meetingYearplanTypeDict: 'main_meeting',
  160. isNeedLetter: 'No',
  161. meetingId: '',
  162. applyWay: 'zh',
  163. unitCountryDict: 'china',
  164. auditStatusDict: '',
  165. photoUrl: '',
  166. invitationCode: '',
  167. name: '',
  168. nameEn: '',
  169. genderDict: 'M',
  170. email: '',
  171. mobileAreaCodeDictEn: '0086',
  172. tel: '',
  173. unitName: '',
  174. unitNameEn: '',
  175. meetingUnitTypeDict: '01',
  176. positionName: '',
  177. positionNameEn: '',
  178. contactPersonName: '',
  179. contactMobileAreacodeDictEn: '0086',
  180. contactCellphone: '',
  181. contactEmail: '',
  182. languageDictEn: '',
  183. },
  184. approverId: '',
  185. pinyin: '',
  186. checkedIds: '',
  187. checkDetermine: true,
  188. }
  189. },
  190. mounted() {
  191. // this.getUnitTypeDict();
  192. },
  193. onLoad(option) {
  194. if (option && option.id) {
  195. this.meetingApply.meetingId = option.id;
  196. const myId = option.id
  197. this.getConfrenceDetail(myId)
  198. // console.log(option.id)
  199. } else {
  200. let that = this;
  201. const eventChannel = this.getOpenerEventChannel()
  202. eventChannel.on('reapply', function(data) {
  203. that.meetingApply = data.data;
  204. that.getConfrenceDetail(data.data.meetingId);
  205. })
  206. that.initDicts()
  207. }
  208. },
  209. watch: {
  210. 'meetingApply.name'(val) {
  211. this.meetingApply.contactPersonName = val
  212. this.meetingApply.nameEn = chineseToPinYin(val);
  213. },
  214. 'meetingApply.email'(val) {
  215. this.meetingApply.contactEmail = val
  216. },
  217. 'meetingApply.tel'(val) {
  218. this.meetingApply.contactCellphone = val
  219. }
  220. },
  221. methods: {
  222. getActivityIds(ids) {
  223. console.log('ids', ids)
  224. this.checkedIds = ids;
  225. },
  226. getdetermine(checkDetermine) {
  227. this.checkDetermine = checkDetermine;
  228. console.log('checkDetermine', this.checkDetermine)
  229. },
  230. async initDicts() {
  231. const res = await this.$myRequest({
  232. url: '/sys/sysDicts',
  233. data: {
  234. type: 'unit_country_dict,meeting_unit_type_dict'
  235. }
  236. })
  237. res.data[0].forEach(item => {
  238. // console.log(item)
  239. if (this.meetingApply.unitCountryDict == item.value) {
  240. this.unitCountry = item.label
  241. }
  242. })
  243. res.data[1].forEach((item, i) => {
  244. // console.log(item)
  245. if (this.meetingApply.meetingUnitTypeDict == item.value) {
  246. this.unitTypeIndex = i
  247. }
  248. })
  249. this.genderRange.forEach((item, i) => {
  250. if (this.meetingApply.genderDict == item.value) {
  251. this.genderIndex = i
  252. }
  253. })
  254. },
  255. async getDict(rand) {
  256. const res = await this.$myRequest({
  257. url: '/sys/sysDicts',
  258. data: {
  259. type: 'geidco_dept_dict,meeting_unit_type_dict'
  260. }
  261. })
  262. if (res.data) {
  263. this.UnitTypeDictRange = res.data[1];
  264. // this.invitationCodePrefix = res.data
  265. res.data[0].forEach(item => {
  266. // console.log(item)
  267. this.invitationCodeArr.push(item.value + '' + rand)
  268. })
  269. this.invitationCodeArr.push("000000")
  270. console.log(this.invitationCodeArr)
  271. }
  272. },
  273. async getConfrenceDetail(myId) {
  274. console.log('myId', myId)
  275. const res = await this.$myRequest({
  276. url: '/meeting/meetingOutInfos/findMeetingDetail/',
  277. data: {
  278. id: myId
  279. }
  280. });
  281. this.baseInfo = res.data.basicInfo;
  282. this.getDict(res.data.basicInfo.meetingRand);
  283. },
  284. async submitForm() {
  285. //必填项验证
  286. if (!this.checkContent(this.meetingApply.invitationCode)) {
  287. uni.showToast({
  288. title: '邀请码未填写',
  289. icon: 'none'
  290. });
  291. return;
  292. } else if (!this.invitationCodeArr.includes(this.meetingApply.invitationCode)) {
  293. uni.showToast({
  294. title: '邀请码错误',
  295. icon: 'none'
  296. });
  297. return;
  298. } else if (!this.checkContent(this.meetingApply.name)) {
  299. uni.showToast({
  300. title: '姓名未填写',
  301. icon: 'none'
  302. });
  303. return;
  304. } else if (!this.checkContent(this.meetingApply.email)) {
  305. uni.showToast({
  306. title: '邮箱未填写',
  307. icon: 'none'
  308. });
  309. return;
  310. } else if (!this.checkEmail(this.meetingApply.email)) {
  311. uni.showToast({
  312. title: '邮箱格式错误',
  313. icon: 'none'
  314. });
  315. return;
  316. } else if (!this.checkContent(this.meetingApply.tel)) {
  317. uni.showToast({
  318. title: '手机未填写',
  319. icon: 'none'
  320. });
  321. return;
  322. } else if (!this.checkMobile(this.meetingApply.tel)) {
  323. uni.showToast({
  324. title: '手机格式错误',
  325. icon: 'none'
  326. });
  327. return;
  328. } else if (!this.checkContent(this.meetingApply.unitName)) {
  329. uni.showToast({
  330. title: '所在单位未填写',
  331. icon: 'none'
  332. });
  333. return;
  334. } else if (!this.checkContent(this.meetingApply.positionName)) {
  335. uni.showToast({
  336. title: '职务未填写',
  337. icon: 'none'
  338. });
  339. return;
  340. } else if (!this.checkContent(this.meetingApply.contactPersonName)) {
  341. uni.showToast({
  342. title: '联系人姓名未填写',
  343. icon: 'none'
  344. });
  345. return;
  346. } else if (!this.checkContent(this.meetingApply.contactCellphone)) {
  347. uni.showToast({
  348. title: '联系人手机未填写',
  349. icon: 'none'
  350. });
  351. return;
  352. } else if (!this.checkMobile(this.meetingApply.contactCellphone)) {
  353. uni.showToast({
  354. title: '联系人手机格式错误',
  355. icon: 'none'
  356. });
  357. return;
  358. } else if (!this.checkContent(this.meetingApply.contactEmail)) {
  359. uni.showToast({
  360. title: '联系人邮箱未填写',
  361. icon: 'none'
  362. });
  363. return;
  364. } else if (!this.checkEmail(this.meetingApply.contactEmail)) {
  365. uni.showToast({
  366. title: '联系人邮箱格式错误',
  367. icon: 'none'
  368. });
  369. return;
  370. }else if (!this.checkDetermine) {
  371. uni.showToast({
  372. title: '温馨提示: 同一时段平行召开的会议仅限选择一场参加,祝您参会愉快!',
  373. icon: 'none'
  374. });
  375. return;
  376. }
  377. if (this.meetingApply.auditStatusDict == '') {
  378. this.meetingApply.auditStatusDict = '4';
  379. } else {
  380. this.meetingApply.auditStatusDict = this.meetingApply.auditStatusDict;
  381. }
  382. var res = await this.$myRequest({
  383. url: '/meeting/meetingApplys/getApproverId',
  384. data: {
  385. invitationCode: this.meetingApply.invitationCode
  386. },
  387. });
  388. res = res.data; //20210401添加此行代码
  389. var str = "";
  390. for (var i = 0; i < res.length; i++) {
  391. str += res[i].userId + ",";
  392. }
  393. if (str.length > 0) {
  394. str = str.substr(0, str.length - 1);
  395. }
  396. this.approverId = str;
  397. console.log('approverId', this.approverId)
  398. const token = await this.$myRequest({
  399. url: '/sys/token',
  400. data: {}
  401. });
  402. console.log('meetingApply', this.meetingApply)
  403. const result = await this.$myRequest({
  404. url: '/meeting/meetingApplys',
  405. method: (this.meetingApply.id ? 'PUT' : 'POST'),
  406. data: {
  407. meetingApply: JSON.stringify(this.meetingApply),
  408. approver: this.approverId,
  409. taskComment: '',
  410. token: token.data,
  411. activityIds: this.checkedIds
  412. }
  413. });
  414. // debugger
  415. if (result.data && result.data.isRepeat) {
  416. uni.showToast({
  417. title: '请勿重复提交!',
  418. icon: 'none'
  419. })
  420. }
  421. if (result.msg == '提交成功' || result.msg == '重新提交成功') {
  422. addIntegral('meeting_registration_successful', '10')
  423. addGrowth('meeting_registration_successful', '10')
  424. uni.navigateTo({
  425. url: '/pages/conference/conferenceOfflineZh/successfully'
  426. })
  427. }
  428. console.log('result', result)
  429. },
  430. bindPickerChange(e) {
  431. this.meetingApply.genderDict = this.genderRange[e.target.value].value;
  432. this.genderIndex = e.target.value;
  433. },
  434. bindUnitTypePickerChange(e) {
  435. console.log(this.UnitTypeDictRange[e.target.value].value)
  436. this.meetingApply.meetingUnitTypeDict = this.UnitTypeDictRange[e.target.value].value;
  437. this.unitTypeIndex = e.target.value;
  438. },
  439. toUnitCountryDict() {
  440. uni.navigateTo({
  441. url: 'CountryDict',
  442. events: {
  443. acceptSelectedCountry: data => {
  444. this.unitCountry = data.country;
  445. this.meetingApply.unitCountryDict = data.key;
  446. },
  447. },
  448. })
  449. },
  450. toUpload() {
  451. uni.navigateTo({
  452. url: 'uni-list-item-upload',
  453. events: {
  454. acceptImageUrl: data => {
  455. this.meetingApply.photoUrl = data.url;
  456. }
  457. },
  458. })
  459. },
  460. navigateBack() {
  461. uni.navigateBack()
  462. },
  463. checkEmail(email) {
  464. return RegExp(/^\w+.*\w+@[a-zA-Z0-9]+.*[a-zA-Z0-9]+\.[a-zA-Z]{2,4}$/).test(email);
  465. },
  466. checkMobile(mobile) {
  467. return RegExp(/^1[34578]\d{9}$/).test(mobile);
  468. },
  469. checkContent(content) {
  470. return RegExp(/^[\s\S]*.*[^\s][\s\S]*$/).test(content);
  471. },
  472. }
  473. }
  474. </script>
  475. <style lang="scss" scoped>
  476. .bigbox {
  477. background-color: #FFFFFF;
  478. padding-bottom: 20px;
  479. }
  480. /deep/.uni-list--border::after {
  481. background-color: #FFFFFF;
  482. }
  483. .uni-list-item {
  484. height: 144rpx;
  485. line-height: 104rpx;
  486. border-bottom: 1px solid #dadada;
  487. }
  488. /deep/.uni-list-item__container {
  489. flex-wrap: wrap;
  490. }
  491. .decorate {
  492. width: 100%;
  493. height: 170px;
  494. background-color: #3387ff;
  495. position: absolute;
  496. border-radius: 0 0 50px 50px
  497. }
  498. .decorates {
  499. width: 323px;
  500. height: 30px;
  501. background-color: rgb(255, 255, 255);
  502. opacity: 0.5;
  503. border-radius: 5px;
  504. position: absolute;
  505. top: 60rpx;
  506. left: 52rpx;
  507. }
  508. .text_style {
  509. width: 100%;
  510. font-weight: bold;
  511. font-size: 14px;
  512. display: flex;
  513. align-items: center;
  514. margin-bottom: 10rpx;
  515. }
  516. .text_style_s {
  517. padding-left: 14rpx;
  518. }
  519. .uni-common-mt {
  520. // margin-left: 90rpx;
  521. }
  522. .uni-list {
  523. width: auto;
  524. background-color: #d7d7d7;
  525. }
  526. .uni-list:after,
  527. .uni-list:before {
  528. height: 0px;
  529. }
  530. .select-view {
  531. position: absolute;
  532. width: 100%;
  533. height: 100%;
  534. text-align: right;
  535. top: 0;
  536. left: 0;
  537. background-color: transparent;
  538. }
  539. .select-view .uni-input {
  540. line-height: 140rpx;
  541. }
  542. .sunmit-btn {
  543. width: 57px;
  544. height: 30px;
  545. color: #FFFFFF;
  546. background-color: #2d79e5;
  547. padding: 0 10px;
  548. border-radius: 18px;
  549. }
  550. .button-hover[type=submit] {
  551. opacity: .75;
  552. transform: scale(0.95, 0.95);
  553. }
  554. .uni-input-info {
  555. height: 54rpx;
  556. width: 650rpx;
  557. font-size: 30rpx;
  558. // border-bottom: 1px solid #dadada;
  559. // background: #E4E7ED;
  560. }
  561. .uni-input-placeholder {
  562. font-size: 28rpx;
  563. padding-left: 10rpx;
  564. }
  565. .label:before {
  566. content: '* ';
  567. color: red;
  568. }
  569. </style>