conference-offline-zh-other.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  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 clickable>
  18. <text slot="header" class="text_style text_style_s label">邀请码</text>
  19. <input placeholder="请填写邀请码(如无,请填写“000000”)" slot="body" class="uni-input-info text_style_s"
  20. v-model="meetingApply.invitationCode" />
  21. </uni-list-item>
  22. <uni-list-item clickable>
  23. <text slot="header" class="text_style text_style_s label">姓名</text>
  24. <input placeholder="请填写您的姓名" slot="body" class="uni-input-info text_style_s"
  25. v-model="meetingApply.name" />
  26. </uni-list-item>
  27. <uni-list-item clickable>
  28. <text slot="header" class="text_style text_style_s label">邮箱</text>
  29. <input placeholder="请填写您的邮箱" slot="body" class="uni-input-info text_style_s"
  30. v-model="meetingApply.mail" />
  31. </uni-list-item>
  32. <uni-list-item showArrow clickable @click="toUnitCountryDict">
  33. <view slot="header" class="text_style select-view"
  34. style="line-height: 92rpx; font-weight: bold;padding-left: 28rpx;">
  35. <!-- <view style="width: 6rpx;height: 24rpx;background-color: #fac900;"></view> -->
  36. <text class="label" style="margin-left: 10rpx;">国家</text>
  37. </view>
  38. <text slot="footer" style="line-height: 92rpx;">{{unitCountry}}</text>
  39. </uni-list-item>
  40. <uni-list-item clickable>
  41. <text slot="header" class="text_style text_style_s label">所在单位</text>
  42. <input placeholder="请填写您的所在单位" slot="body" class="uni-input-info text_style_s"
  43. v-model="meetingApply.filmName" />
  44. </uni-list-item>
  45. <uni-list-item showArrow>
  46. <text slot="header" class="text_style text_style_s label">单位类型</text>
  47. <view slot="body" class="uni-list select-view">
  48. <view class="uni-list-cell" v-if="UnitTypeDictRange.length">
  49. <view class="uni-list-cell-db">
  50. <picker @change="bindUnitTypePickerChange" :value="unitTypeIndex" :range="UnitTypeDictRange"
  51. range-key="label">
  52. <view class="uni-input">{{UnitTypeDictRange[unitTypeIndex].label}}</view>
  53. </picker>
  54. </view>
  55. </view>
  56. </view>
  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.title" />
  62. </uni-list-item>
  63. </uni-list>
  64. <activities-select v-if="baseInfo!= {} && baseInfo.isShowZhOnlineIntention=='Yes'"
  65. :meetingId="meetingApply.meetingId" @getcheckedIds="getActivityIds" @getcheckDetermine="getdetermine"></activities-select>
  66. </view>
  67. </template>
  68. <script>
  69. import {
  70. addIntegral,
  71. addGrowth
  72. } from '@/components/addPointDetailByTaskDict.js'
  73. import uniNavBar from "@/components/uni-nav-bar/uni-nav-bar.vue";
  74. import chineseToPinYin from "@/components/uni-pinyin/uni-pinyin.js";
  75. import informationInput from "@/pages/conference/conferenceOfflineZh/information.vue";
  76. import activitiesSelect from "@/pages/conference/activitiesSelect.vue";
  77. export default {
  78. components: {
  79. uniNavBar,
  80. informationInput,
  81. activitiesSelect,
  82. addIntegral,
  83. addGrowth
  84. },
  85. data() {
  86. return {
  87. unitCountry: '中国',
  88. genderRange: [{
  89. value: 'M',
  90. label: '男'
  91. },
  92. {
  93. value: 'F',
  94. label: '女'
  95. }
  96. ],
  97. genderIndex: 0,
  98. unitTypeIndex: 0,
  99. UnitTypeDictRange: [],
  100. baseInfo: {},
  101. invitationCodePrefix: [], //邀请码集合
  102. invitationCodeArr: [], //邀请码集合
  103. meetingApply: {
  104. meetingId: '',
  105. applyWay: 'zh',
  106. unitCountryDict: 'china',
  107. invitationCode: '',
  108. name: '',
  109. middleName: '',
  110. givenName: '',
  111. sumame: '',
  112. filmName: '',
  113. filmType: '',
  114. filmTypeDict: '01',
  115. title: '',
  116. mail: '',
  117. },
  118. approverId: '',
  119. pinyin: '',
  120. checkedIds: '',
  121. checkDetermine: true,
  122. }
  123. },
  124. mounted() {
  125. // this.getUnitTypeDict();
  126. },
  127. onLoad(option) {
  128. if (option && option.id) {
  129. this.meetingApply.meetingId = option.id;
  130. const myId = option.id
  131. this.getConfrenceDetail(myId)
  132. // console.log(option.id)
  133. } else {
  134. let that = this;
  135. const eventChannel = this.getOpenerEventChannel()
  136. eventChannel.on('reapply', function(data) {
  137. that.meetingApply = data.data;
  138. that.getConfrenceDetail(data.data.meetingId);
  139. })
  140. that.initDicts()
  141. }
  142. },
  143. // watch:{
  144. // 'meetingApply.name'(val){
  145. // this.meetingApply.contactPersonName = val
  146. // this.meetingApply.nameEn = chineseToPinYin(val);
  147. // },
  148. // 'meetingApply.email'(val){
  149. // this.meetingApply.contactEmail = val
  150. // },
  151. // 'meetingApply.tel'(val){
  152. // this.meetingApply.contactCellphone = val
  153. // }
  154. // },
  155. methods: {
  156. getActivityIds(ids,checkDetermine) {
  157. //console.log('ids', ids)
  158. this.checkedIds = ids;
  159. },
  160. getdetermine(checkDetermine) {
  161. this.checkDetermine = checkDetermine;
  162. console.log('checkDetermine', this.checkDetermine)
  163. },
  164. async initDicts() {
  165. const res = await this.$myRequest({
  166. url: '/sys/sysDicts',
  167. data: {
  168. type: 'unit_country_dict,meeting_unit_type_dict'
  169. }
  170. })
  171. res.data[0].forEach(item => {
  172. // console.log(item)
  173. if (this.meetingApply.unitCountryDict == item.value) {
  174. this.unitCountry = item.label
  175. }
  176. })
  177. res.data[1].forEach((item, i) => {
  178. // console.log(item)
  179. if (this.meetingApply.filmTypeDict == item.value) {
  180. this.unitTypeIndex = i
  181. }
  182. })
  183. this.genderRange.forEach((item, i) => {
  184. if (this.meetingApply.genderDict == item.value) {
  185. this.genderIndex = i
  186. }
  187. })
  188. },
  189. async getDict(rand) {
  190. const res = await this.$myRequest({
  191. url: '/sys/sysDicts',
  192. data: {
  193. type: 'geidco_dept_dict,meeting_unit_type_dict'
  194. }
  195. })
  196. if (res.data) {
  197. this.UnitTypeDictRange = res.data[1];
  198. // this.invitationCodePrefix = res.data
  199. res.data[0].forEach(item => {
  200. // console.log(item)
  201. this.invitationCodeArr.push(item.value + '' + rand)
  202. })
  203. this.invitationCodeArr.push("000000")
  204. console.log(this.invitationCodeArr)
  205. }
  206. },
  207. async getConfrenceDetail(myId) {
  208. console.log('myId', myId)
  209. const res = await this.$myRequest({
  210. url: '/meeting/meetingOutInfos/findMeetingDetail/',
  211. data: {
  212. id: myId
  213. }
  214. });
  215. this.baseInfo = res.data.basicInfo;
  216. this.getDict(res.data.basicInfo.meetingRand);
  217. },
  218. async submitForm() {
  219. //必填项验证
  220. if (!this.checkContent(this.meetingApply.invitationCode)) {
  221. uni.showToast({
  222. title: '邀请码未填写',
  223. icon: 'none'
  224. });
  225. return;
  226. } else if (!this.invitationCodeArr.includes(this.meetingApply.invitationCode)) {
  227. uni.showToast({
  228. title: '邀请码错误',
  229. icon: 'none'
  230. });
  231. return;
  232. } else if (!this.checkContent(this.meetingApply.name)) {
  233. uni.showToast({
  234. title: '姓名未填写',
  235. icon: 'none'
  236. });
  237. return;
  238. } else if (!this.checkContent(this.meetingApply.mail)) {
  239. uni.showToast({
  240. title: '邮箱未填写',
  241. icon: 'none'
  242. });
  243. return;
  244. } else if (!this.checkEmail(this.meetingApply.mail)) {
  245. uni.showToast({
  246. title: '邮箱格式错误',
  247. icon: 'none'
  248. });
  249. return;
  250. } else if (!this.checkContent(this.meetingApply.filmName)) {
  251. uni.showToast({
  252. title: '所在单位未填写',
  253. icon: 'none'
  254. });
  255. return;
  256. } else if (!this.checkContent(this.meetingApply.title)) {
  257. uni.showToast({
  258. title: '职务未填写',
  259. icon: 'none'
  260. });
  261. return;
  262. }else if (!this.checkDetermine) {
  263. uni.showToast({
  264. title: '温馨提示: 同一时段平行召开的会议仅限选择一场参加,祝您参会愉快!',
  265. icon: 'none'
  266. });
  267. return;
  268. }
  269. // if (this.meetingApply.auditStatusDict == '') {
  270. // this.meetingApply.auditStatusDict = '4';
  271. // } else {
  272. // this.meetingApply.auditStatusDict = this.meetingApply.auditStatusDict;
  273. // }
  274. var res = await this.$myRequest({
  275. url: '/meeting/meetingApplys/getApproverId',
  276. data: {
  277. invitationCode: this.meetingApply.invitationCode
  278. },
  279. });
  280. res = res.data; //20210401添加此行代码
  281. console.log('xxxxxxxxxx', res);
  282. var str = "";
  283. for (var i = 0; i < res.length; i++) {
  284. str += res[i].userId + ",";
  285. }
  286. if (str.length > 0) {
  287. str = str.substr(0, str.length - 1);
  288. }
  289. this.approverId = str;
  290. console.log('approverId', this.approverId)
  291. const token = await this.$myRequest({
  292. url: '/sys/token',
  293. data: {}
  294. });
  295. console.log('meetingApply', this.meetingApply)
  296. const result = await this.$myRequest({
  297. url: '/meeting/meetingApplyOnlines',
  298. method: (this.meetingApply.id ? 'PUT' : 'POST'),
  299. data: {
  300. meetingApplyOnline: JSON.stringify(this.meetingApply),
  301. token: token.data,
  302. activityIds: this.checkedIds
  303. }
  304. });
  305. // debugger
  306. if (result.data && result.data.isRepeat) {
  307. uni.showToast({
  308. title: '请勿重复提交!',
  309. icon: 'none'
  310. })
  311. }
  312. if (result.msg == '保存成功' || result.msg == '重新提交成功') {
  313. addIntegral('meeting_registration_successful', '10')
  314. addGrowth('meeting_registration_successful', '10')
  315. uni.navigateTo({
  316. url: '/pages/conference/conferenceOfflineZh/successfully'
  317. })
  318. }
  319. console.log('result', result)
  320. },
  321. bindPickerChange(e) {
  322. this.meetingApply.genderDict = this.genderRange[e.target.value].value;
  323. this.genderIndex = e.target.value;
  324. },
  325. bindUnitTypePickerChange(e) {
  326. console.log(this.UnitTypeDictRange[e.target.value].value)
  327. this.meetingApply.filmTypeDict = this.UnitTypeDictRange[e.target.value].value;
  328. this.unitTypeIndex = e.target.value;
  329. },
  330. toUnitCountryDict() {
  331. uni.navigateTo({
  332. url: 'CountryDict',
  333. events: {
  334. acceptSelectedCountry: data => {
  335. this.unitCountry = data.country;
  336. this.meetingApply.unitCountryDict = data.key;
  337. // console.log(data)
  338. }
  339. },
  340. })
  341. },
  342. navigateBack() {
  343. uni.navigateBack()
  344. },
  345. checkEmail(email) {
  346. return RegExp(/^\w+.*\w+@[a-zA-Z0-9]+.*[a-zA-Z0-9]+\.[a-zA-Z]{2,4}$/).test(email);
  347. },
  348. checkMobile(mobile) {
  349. return RegExp(/^1[34578]\d{9}$/).test(mobile);
  350. },
  351. checkContent(content) {
  352. return RegExp(/^[\s\S]*.*[^\s][\s\S]*$/).test(content);
  353. },
  354. }
  355. }
  356. </script>
  357. <style lang="scss" scoped>
  358. .bigbox {
  359. background-color: #FFFFFF;
  360. padding-bottom: 20px;
  361. }
  362. /deep/.uni-list--border::after {
  363. background-color: #FFFFFF;
  364. }
  365. .uni-list-item {
  366. height: 144rpx;
  367. line-height: 104rpx;
  368. border-bottom: 1px solid #dadada;
  369. }
  370. /deep/.uni-list-item__container {
  371. flex-wrap: wrap;
  372. }
  373. .decorate {
  374. width: 100%;
  375. height: 170px;
  376. background-color: #3387ff;
  377. position: absolute;
  378. border-radius: 0 0 50px 50px
  379. }
  380. .decorates {
  381. width: 323px;
  382. height: 30px;
  383. background-color: rgb(255, 255, 255);
  384. opacity: 0.5;
  385. border-radius: 5px;
  386. position: absolute;
  387. top: 60rpx;
  388. left: 52rpx;
  389. }
  390. .text_style {
  391. width: 100%;
  392. font-weight: bold;
  393. font-size: 14px;
  394. display: flex;
  395. align-items: center;
  396. margin-bottom: 10rpx;
  397. }
  398. .text_style_s {
  399. padding-left: 14rpx;
  400. }
  401. .uni-common-mt {
  402. // margin-left: 90rpx;
  403. }
  404. .uni-list {
  405. width: auto;
  406. background-color: #d7d7d7;
  407. }
  408. .uni-list:after,
  409. .uni-list:before {
  410. height: 0px;
  411. }
  412. .select-view {
  413. position: absolute;
  414. width: 100%;
  415. height: 100%;
  416. text-align: right;
  417. top: 0;
  418. left: 0;
  419. background-color: transparent;
  420. }
  421. .select-view .uni-input {
  422. line-height: 140rpx;
  423. }
  424. .sunmit-btn {
  425. width: 57px;
  426. height: 30px;
  427. color: #FFFFFF;
  428. background-color: #2d79e5;
  429. padding: 0 10px;
  430. border-radius: 18px;
  431. }
  432. .button-hover[type=submit] {
  433. opacity: .75;
  434. transform: scale(0.95, 0.95);
  435. }
  436. .uni-input-info {
  437. height: 54rpx;
  438. width: 650rpx;
  439. font-size: 30rpx;
  440. // border-bottom: 1px solid #dadada;
  441. // background: #E4E7ED;
  442. }
  443. .uni-input-placeholder {
  444. font-size: 28rpx;
  445. padding-left: 10rpx;
  446. }
  447. .label:before {
  448. content: '* ';
  449. color: red;
  450. }
  451. </style>