NationalregionalCommissionsEventZH.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. <template>
  2. <div>
  3. <div class="autoBox2 ">
  4. <div >
  5. <div style="width: 100%;margin: auto;margin-top: 20px;">
  6. <el-collapse v-model="activeNames" >
  7. <!-- 基本信息 -->
  8. <el-collapse-item name="3" v-if="active==1">
  9. <template slot="title">
  10. <span style="color: red;margin-right: 3px;">* </span> 基本信息
  11. </template>
  12. <el-form ref="form" :model="baseLeagueApply" :rules="form1Rules" label-width="260px" class="demo-ruleForm"
  13. style="margin-top: 20px;width: 1000px;margin-left: 100px;">
  14. <!-- 类型 -->
  15. <el-form-item label="类型" prop='unitCountryDict'>
  16. <el-select
  17. filterable
  18. :no-match-text="$i18n.locale=='zh'?'无匹配数据':'No Data'"
  19. v-model="baseLeagueApply.unitCountryDict"
  20. placeholder="请选择类型"
  21. style="width: 70%;">
  22. <el-option :label="item.name" :value="item.value"
  23. v-for="(item,index) in type">
  24. </el-option>
  25. </el-select>
  26. </el-form-item>
  27. <!-- 委员会 -->
  28. <el-form-item label="委员会" prop='unitZhName' >
  29. <el-cascader
  30. style="width: 70%;"
  31. v-model="value"
  32. :options="options"
  33. >
  34. </el-cascader>
  35. </el-form-item>
  36. <!-- 活动时间 -->
  37. <el-form-item label="活动时间" prop='unitEnName' style="display: block;">
  38. <el-date-picker
  39. style="width: 70%;"
  40. v-model="value2"
  41. type="daterange"
  42. align="right"
  43. unlink-panels
  44. range-separator="至"
  45. start-placeholder="开始日期"
  46. end-placeholder="结束日期"
  47. >
  48. </el-date-picker>
  49. </el-form-item>
  50. <!-- 活动地点 -->
  51. <el-form-item label="活动地点">
  52. <el-input v-model="baseLeagueApply.unitWebsite"
  53. style="width: 70%;"
  54. placeholder="请参照格式:北京市-海淀区-交通大道123号"></el-input>
  55. </el-form-item>
  56. <!-- 报名时间 -->
  57. <el-form-item label="报名时间">
  58. <el-date-picker
  59. style="width: 70%;"
  60. v-model="value2"
  61. type="daterange"
  62. align="right"
  63. unlink-panels
  64. range-separator="至"
  65. start-placeholder="开始日期"
  66. end-placeholder="结束日期"
  67. >
  68. </el-date-picker>
  69. </el-form-item>
  70. <!-- 报名链接 -->
  71. <el-form-item label="报名链接">
  72. <el-input v-model="baseLeagueApply.postalCode" style="width: 70%;" ></el-input>
  73. </el-form-item>
  74. <!-- 相关附件 -->
  75. <el-form-item label="相关附件" prop='LegalRepresentative'>
  76. <el-upload
  77. class="upload-demo"
  78. action="./api/file/upload/attachment?module=committeeActivityInfo"
  79. :on-change="handleChange"
  80. :on-success="docSuccess"
  81. :headers="myHeaders"
  82. :before-upload="beforeUpload"
  83. :file-list="fileList">
  84. <el-button size="small" type="primary">{{$t('common.SelectUploadCUnit')}}</el-button>
  85. <div slot="tip" class="el-upload__tip">{{$t('common.OnlyUpload')}}</div>
  86. </el-upload>
  87. </el-form-item>
  88. </el-form>
  89. </el-collapse-item>
  90. <!-- 活动信息 -->
  91. <el-collapse-item name="1" v-if="active==1">
  92. <template slot="title">
  93. <span style="color: red;margin-right: 3px;">* </span> 活动信息
  94. </template>
  95. <el-form ref="form" :model="baseLeagueApply" :rules="form1Rules" label-width="260px" class="demo-ruleForm"
  96. style="margin-top: 20px;width: 1000px;margin-left: 100px;">
  97. <!-- 名称 -->
  98. <el-form-item label="名称" prop='unitCountryDict'>
  99. <el-input v-model="baseLeagueApply.unitCountryDict" style="width: 70%;" :placeholder="$t('common.PleaseEnter')+$t('common.NameoftheEntity')"></el-input>
  100. </el-form-item>
  101. <!-- 封面 -->
  102. <el-form-item label="封面" prop='photo' style="position: relative;">
  103. <el-upload
  104. class="avatar-uploader"
  105. action="/api/file/upload/img?module=authenticationUnit"
  106. :show-file-list="false"
  107. :on-success="photoSuccess"
  108. :headers="myHeaders"
  109. :before-upload="beforeAvatarUpload1">
  110. <img v-if="baseLeagueApply.photo" :src="'/api/file/pub/' + baseLeagueApply.photo" class="avatar">
  111. <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  112. </el-upload>
  113. <span style="position: absolute;left: 200px;top: 80px;">图片大小不超过10M,建议尺寸320*240</span>
  114. </el-form-item>
  115. <!-- 简介 -->
  116. <el-form-item label="简介" prop='unitEnName' style="display: block;">
  117. <layui-inline-ue
  118. label=""
  119. :cssStyle="{'width':'100%','height':'100%'}"
  120. :value="textarea2"
  121. :readonly="readOnly"
  122. ref="contentUe">
  123. </layui-inline-ue>
  124. </el-form-item>
  125. </el-form>
  126. </el-collapse-item>
  127. <!-- 详情 -->
  128. <el-collapse-item name="2" v-if="active==1">
  129. <template slot="title">
  130. <span style="color: red;margin-right: 3px;">* </span> 详情
  131. </template>
  132. <div style="margin: 30px 20px;">
  133. <span :class="textIndex==1?'textInfo cursor':'textInfo2 cursor'" @click="textIndex=1">活动预告</span>
  134. <span :class="textIndex==2?'textInfo cursor':'textInfo2 cursor'" @click="textIndex=2">活动回顾</span>
  135. </div>
  136. <div style="margin: 0px 20px;">
  137. 定制模板:
  138. <el-select
  139. filterable
  140. v-model="baseLeagueApply.unitCountryDict"
  141. placeholder="请选择类型"
  142. :no-match-text="$i18n.locale=='zh'?'无匹配数据':'No Data'"
  143. >
  144. <el-option :label="item.name" :value="item.value"
  145. v-for="(item,index) in type">
  146. </el-option>
  147. </el-select>
  148. </div>
  149. <div style="margin: 30px 20px;">
  150. <div style="display: inline-block;width: 100px;height: 760px;line-height: 760px;text-align: center;
  151. border: 1px solid rgba(210, 210, 210, 1);background: #fbfbfb;">
  152. {{textIndex==1?'活动预告':'活动回顾'}}
  153. </div>
  154. <div style="display: inline-block;width: 1000px;height: 760px;vertical-align: top;" class="edui">
  155. <layui-inline-ue
  156. label=""
  157. :cssStyle="{'width':'100%','height':'100%'}"
  158. :value="baseLeagueApply.contentHtml"
  159. :readonly="readOnly"
  160. ref="contentUe">
  161. </layui-inline-ue>
  162. </div>
  163. </div>
  164. </el-collapse-item>
  165. </el-collapse>
  166. </div>
  167. </div>
  168. </div>
  169. </div>
  170. </div>
  171. </template>
  172. <script>
  173. import {getDicts} from '@/api/dict'
  174. import {submitApplyPortal,getBaseLeagueApplys} from '@/api/cooperation/baseLeagueApply'
  175. import {getBaseLeagues} from '@/api/cooperation/baseLeagueEntity'
  176. import {country} from '@/api/country'
  177. import Base from '@/views/base/Base'
  178. import userCenterTaberListUnionPrint from '@/views/userCenter/userCenterItem/userCenterTaberListUnionPrint'
  179. import LayuiInlineUe from '@/components/LayuiInlineUe'
  180. export default {
  181. name: 'NationalregionalCommissionsEventZH',
  182. extends: Base,
  183. components:{userCenterTaberListUnionPrint,LayuiInlineUe},
  184. data () {
  185. return {
  186. active:1,
  187. readOnly: this.$route.params.readOnly || false,
  188. activeNames: ['1','2','3'],
  189. countryList:[],
  190. textIndex:1,
  191. type:[{
  192. name:'委员会活动',
  193. value:'0'
  194. },{
  195. name:'委员会动态',
  196. value:'1'
  197. }],
  198. options: [],
  199. screenIndex: 2,
  200. baseLeagueInfos:[],
  201. realTimeInfoScreens2:[{
  202. lable:"委员会简介",
  203. value:'0'
  204. },{
  205. lable:"委员会布局",
  206. value:'1'
  207. },{
  208. lable:"委员会活动",
  209. value:'2'
  210. }],
  211. dialogVisible:false,
  212. leagueType:[],
  213. baseLeagueApply: {
  214. id: null,
  215. userId: '',
  216. leagueName: '',
  217. contentHtml:'',
  218. leagueId: '',
  219. unitId: '',
  220. photo:'',
  221. unitZhName: '',
  222. unitEnName: '',
  223. unitCountry: '',
  224. unitCountryDict: '',
  225. corporateName: '',
  226. unitAddress: '',
  227. postalCode: '',
  228. unitWebsite: '',
  229. unitIntroduction: '',
  230. linkName: '',
  231. linkDuty: '',
  232. linkDept: '',
  233. linkPhoneNumber: '',
  234. linkEmail: '',
  235. linkFaxNumber: '',
  236. area: '',
  237. areaDict: '',
  238. leagueApplyDate: '',
  239. status: '',
  240. statusDict: '',
  241. phase: '',
  242. phaseDict: '1',
  243. firstApprovalUser: '',
  244. firstApprovalResult: '',
  245. firstApprovalComment: '',
  246. firstApprovalTime: '',
  247. secondApprovalUser: '',
  248. secondApprovalResult: '',
  249. secondApprovalComment: '',
  250. secondApprovalTime: '',
  251. auditUser: '',
  252. auditTime: '',
  253. auditStatusDict: '1',
  254. baseMessage: '',
  255. createBy: '',
  256. createDate: '',
  257. updateBy: '',
  258. updateDate: '',
  259. },
  260. baseContactsInfo:{
  261. id: null,
  262. contactsType: '',
  263. contactsTypeDict: '',
  264. contactsName: '',
  265. currentDuty: '',
  266. depart: '',
  267. telephoneNumber: '',
  268. mobilePhone: '',
  269. email: '',
  270. spareEmail: '',
  271. faxNumber: '',
  272. userId: '',
  273. userType:'alliance_apply',
  274. remarks: '',
  275. createBy: '',
  276. createDate: '',
  277. updateBy: '',
  278. updateDate: '',
  279. },
  280. processKey: 'ALLIANCE_APPROVAL',
  281. approvers:[],
  282. duty:'',
  283. group:'',
  284. leagueMap:{}
  285. }
  286. },
  287. created(){
  288. getBaseLeagueApplys().then(res=>{
  289. var data = res.data;
  290. if(data){
  291. this.baseLeagueApply = data.baseLeagueApplyList[0]||{};
  292. this.baseContactsInfo = data.baseContactsInfo||{};
  293. this.leagueType = data.leagueType||[];
  294. this.active=2;
  295. }
  296. });
  297. },
  298. mounted(){
  299. this.getIntaData();
  300. },
  301. watch:{
  302. "$i18n.locale"(){
  303. // this.$refs.form.clearValidate();
  304. // this.$refs.form2.clearValidate();
  305. this.getIntaData();
  306. },
  307. leagueType: function () {
  308. var leagueType = [];
  309. if(this.leagueType.length > 0){
  310. this.leagueType.forEach(e=>{
  311. leagueType.push(this.leagueMap[e])
  312. })
  313. }
  314. this.baseLeagueApply.leagueName = leagueType.join(',');
  315. },
  316. },
  317. computed:{
  318. form1Rules(){
  319. return {
  320. unitCountry:[
  321. {required: true, message: this.$t('common.PleaseSelect')+' '+this.$t('common.Country'), trigger: 'change'}
  322. ],
  323. unitZhName: [
  324. { required: true, message: this.$t('common.PleaseEnter')+' '+this.$t('common.NameoftheEntity'), trigger: 'blur' }
  325. ],
  326. unitAddress:[
  327. { required: true, message: "", trigger: 'blur' }
  328. ],
  329. LegalRepresentative:[
  330. { required: true, message: this.$t('common.PleaseEnter')+' '+this.$t('common.LegalRepresentative'), trigger: 'blur' }
  331. ],
  332. duty:[
  333. { required: true, message: this.$t('common.PleaseEnter')+' '+this.$t('common.Position'), trigger: 'blur' }
  334. ],
  335. unitIntroduction:[
  336. { required: true, message: this.$t('common.PleaseEnter')+' '+this.$t('common.BriefIntroductionOfApplicant'), trigger: 'blur' }
  337. ],
  338. }
  339. },
  340. rules(){
  341. return {
  342. contactsName: [
  343. { required: true, message: this.$t('common.PleaseEnter')+' '+this.$t('common.fullName'), trigger: 'blur' },
  344. ],
  345. depart:[{ required: true,trigger: 'blur' },],
  346. currentDuty: [
  347. { required: true, message: this.$t('common.PleaseEnter')+' '+this.$t('common.Position'), trigger: 'blur' }
  348. ],
  349. telephoneNumber: [
  350. { required: true, message: this.$t('common.PleaseEnter')+' '+this.$t('common.ContactPhoneNumber'), trigger: 'blur' }
  351. ],
  352. mobilePhone: [
  353. {required: true,message: this.$t('common.PleaseEnter')+' '+this.$t('common.mobilePhone'),trigger: 'blur'},
  354. { pattern: /^0{0,1}(13[0-9]|15[7-9]|17[1-9]|153|156|18[7-9])[0-9]{8}$/, message: this.$t('common.Theformatofmobilephonenumberisincorrect'), trigger: 'blur'}
  355. ],
  356. email: [
  357. { required: true, message: this.$t('common.PleaseEnter')+' '+this.$t('common.Email'), trigger: 'blur' },
  358. { pattern: /^[a-zA-Z0-9]+([-_.][a-zA-Z0-9]+)*@[a-zA-Z0-9]+([-_.][a-zA-Z0-9]+)*\.[a-z]{2,}$/, message: this.$t('common.Emailformatisnotcorrect'), trigger: 'blur'}
  359. ],
  360. }
  361. },
  362. },
  363. methods:{
  364. agreementChange(val){
  365. this.active=val;
  366. },
  367. getIntaData(){
  368. getBaseLeagues({language:this.$i18n.locale.toUpperCase()}).then(result =>{
  369. const data = result.data
  370. this.baseLeagueInfos = data.baseLeagueInfos;
  371. this.baseLeagueInfos.forEach(element=>{
  372. this.leagueMap[element.baseEntityId] = element.leagueName;
  373. })
  374. });
  375. country({language:this.$i18n.locale.toUpperCase()}).then(res=>{
  376. this.countryList=res.data.countryList;
  377. })
  378. },
  379. // 提交并下载
  380. submitForm(){
  381. this.$refs["form"].validate((valid1) => {
  382. if (valid1) {
  383. this.$refs["form2"].validate((valid2) => {
  384. if (valid2) {
  385. this.print()
  386. } else {
  387. this.$notify.error({
  388. title: 'error',
  389. message: this.$t('common.pleaseContactInformation')
  390. });
  391. this.activeNames=["2"]
  392. return false;
  393. }
  394. })
  395. } else {
  396. this.$notify.error({
  397. title: 'error',
  398. message: this.$t('common.unitInfo')
  399. });
  400. this.activeNames=["1"]
  401. return false;
  402. }
  403. });
  404. },
  405. print(){
  406. loading();
  407. if (this.duty || this.group) {
  408. getUsers({
  409. duty: this.duty,
  410. groups: this.group,
  411. }).then(res => {
  412. let data = res.data || {};
  413. let approvers = data.authUsers || [];
  414. if (approvers && approvers.length > 0) {
  415. this.approver = '';
  416. approvers.forEach(item => {
  417. this.approver += item.userId + ",";
  418. });
  419. this.approver = this.approver.substring(0, this.approver.length - 1);
  420. }
  421. });
  422. }
  423. this.baseLeagueApply.phaseDict = '1';
  424. this.baseLeagueApply.statusDict = this.submitStatus;
  425. this.baseLeagueApply.auditStatusDict = '1';
  426. this.baseLeagueApply.leagueId = this.leagueType.join(',');
  427. var leagueType = [];
  428. if(this.leagueType.length > 0){
  429. this.leagueType.forEach(e=>{
  430. leagueType.push(this.leagueMap[e])
  431. })
  432. }
  433. this.baseLeagueApply.leagueName = leagueType.join(',');
  434. this.submitHandler((token) => {
  435. submitApplyPortal(JSON.stringify(this.baseLeagueApply),JSON.stringify(this.baseContactsInfo),null,this.approver, this.taskComment,token).then(res=>{
  436. this.$message({
  437. message: this.$i18n.locale.toUpperCase()=="ZH"?'添加资料成功':'submit success',
  438. type: 'success'
  439. });
  440. this.resetToken();
  441. this.active=2;
  442. closeLoading();
  443. }).catch(error => {
  444. this.resetToken();
  445. closeLoading();
  446. });
  447. })
  448. },
  449. // 发送申请表
  450. submitFormApplication(){
  451. },
  452. realTimeInfoScreen(i,index){
  453. this.toView('nationalregionalCommissions2',index)
  454. },
  455. getIconUrl(url){
  456. return require("@/assets/img/introductionCooperation/"+url);
  457. },
  458. toView(router,json){
  459. this.$router.push({name:router,query:{key:json}})
  460. },
  461. toNewView(router,json){
  462. this.$store.commit('modify', router);
  463. window.localStorage.setItem('router', router);
  464. const { href } = this.$router.resolve({
  465. name: router,
  466. query: {
  467. key: json
  468. },
  469. });
  470. window.open(href, '_blank');
  471. },
  472. toViewCenter(router,json){
  473. this.$router.push({name:router,params:{index:json}})
  474. },
  475. resetForm(item) {
  476. this[item] = {};
  477. console.log( this.form2)
  478. this.$refs.form2.resetFields()
  479. if(this.$refs[formName]){
  480. this.$refs[item].resetFields()
  481. }
  482. }
  483. }
  484. }
  485. </script>
  486. <!-- Add "scoped" attribute to limit CSS to this component only -->
  487. <style scoped>
  488. .box {
  489. margin-top: 10px;
  490. background: #fff;
  491. min-height: 500px;
  492. padding: 20px 0;
  493. }
  494. .crumbs {
  495. margin-left: 20px;
  496. }
  497. body {
  498. margin: 0;
  499. }
  500. .crumbs >>>.el-step__icon {
  501. width: 37px;
  502. height: 37px;
  503. font-size: 18px;
  504. }
  505. .crumbs>>> .el-step.is-horizontal .el-step__line {
  506. top:20px;
  507. }
  508. .crumbs>>>.el-step__head.is-process {
  509. color: #409eff;
  510. border-color:inherit;
  511. }
  512. .crumbs>>>.el-step__head.is-process .el-step__icon.is-text {
  513. background: #409eff;
  514. color: #fff;
  515. border-color:#409eff;
  516. width: 46px;
  517. height: 46px;
  518. }
  519. .crumbs>>>.el-step__title.is-process,
  520. .crumbs>>>.el-step__description.is-process {
  521. color: #409eff;
  522. }
  523. .crumbs>>>.el-collapse-item {
  524. /* width: 80%; */
  525. margin: auto;
  526. }
  527. .el-collapse {
  528. border: none;
  529. }
  530. .crumbs>>>.el-collapse-item__header {
  531. padding: 0 20px 0 100px;
  532. font-weight: 700;
  533. }
  534. .crumbs>>>.el-collapse-item__content {
  535. padding: 0 0 0 0px;
  536. }
  537. .el-checkbox {
  538. display: inline-block;
  539. margin-bottom: 20px;
  540. }
  541. .avatar-uploader >>>.el-upload {
  542. border: 1px solid #d9d9d9;
  543. border-radius: 6px;
  544. cursor: pointer;
  545. position: relative;
  546. overflow: hidden;
  547. }
  548. .avatar-uploader .el-upload:hover {
  549. border-color: #409EFF;
  550. }
  551. .avatar-uploader-icon {
  552. font-size: 28px;
  553. color: #8c939d;
  554. width: 178px;
  555. height: 178px;
  556. line-height: 178px;
  557. text-align: center;
  558. }
  559. .avatar {
  560. width: 178px;
  561. height: 178px;
  562. display: block;
  563. }
  564. .crumbs>>>.el-collapse-item__header.is-active {
  565. border-bottom-color: #EBEEF5;
  566. }
  567. .button_409EFF {
  568. border-color:#409EFF ;
  569. color: #409EFF;
  570. }
  571. .textInfo {
  572. padding: 10px 20px;
  573. background-color: #1890ff;
  574. color: #fff;
  575. border: 1px solid rgba(228, 228, 228, 1);
  576. }
  577. .textInfo2 {
  578. padding: 10px 20px;
  579. background-color: rgba(249, 249, 249, 1);
  580. color: #333;
  581. border: 1px solid rgba(228, 228, 228, 1);
  582. }
  583. .form2Sty{
  584. margin-top: 20px;
  585. width: 100%;
  586. }
  587. .form2Sty>>>.el-collapse-item__content{
  588. /* padding-left: 20px; */
  589. width: 49%;
  590. }
  591. .form2Sty>>>.el-form-item{
  592. width: 50%;
  593. float: left;
  594. }
  595. .avatar-uploader .el-upload {
  596. border: 1px dashed #d9d9d9;
  597. border-radius: 6px;
  598. cursor: pointer;
  599. position: relative;
  600. overflow: hidden;
  601. }
  602. .avatar-uploader .el-upload:hover {
  603. border-color: #409EFF;
  604. }
  605. .avatar-uploader-icon {
  606. font-size: 28px;
  607. color: #8c939d;
  608. width: 178px;
  609. height: 178px;
  610. line-height: 178px;
  611. text-align: center;
  612. }
  613. .avatar {
  614. width: 178px;
  615. height: 178px;
  616. display: block;
  617. }
  618. .edui-editor {
  619. width: 100%;
  620. }
  621. .edui>>>.edui-editor-iframeholder {
  622. height: 679px !important;
  623. }
  624. </style>