UploadCommitteeInformation.vue 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054
  1. <!-- 委员会全部资料上传 -->
  2. <template>
  3. <div class="autoBox box1" style="position: relative; background: #f5f5f5">
  4. <div class="center" style="display: flex; background: #fff; height: 50px">
  5. <el-breadcrumb
  6. separator="/"
  7. style="
  8. float: left;
  9. margin-left: 15px;
  10. margin-top: 5px;
  11. line-height: 40px;
  12. "
  13. >
  14. <el-breadcrumb-item :to="{ path: 'nationalregionalCommittees' }">{{
  15. $t("common.committeeInformation")
  16. }}</el-breadcrumb-item>
  17. <el-breadcrumb-item
  18. ><span style="font-weight: 700; cursor: pointer; color: #303133">{{
  19. $t("common.upload")
  20. }}</span></el-breadcrumb-item
  21. >
  22. </el-breadcrumb>
  23. </div>
  24. <div
  25. class="content"
  26. style="background: #fff; margin-top: 20px; padding: 50px 100px"
  27. >
  28. <!--<div class="addEn" style="height: 50px">
  29. <span class="english">中文</span>
  30. <span
  31. @click="addlanguage()"
  32. style="margin-left: 20px; cursor: pointer; margin-top: 10px"
  33. >
  34. +
  35. </span>
  36. </div>-->
  37. <!-- <div class="addLanguage">
  38. <i
  39. class="el-icon-orange"
  40. style="
  41. font-size: 30px;
  42. line-height: 50px;
  43. color: #e6a23c;
  44. vertical-align: middle;
  45. "
  46. ></i>
  47. <span
  48. style="
  49. font-size: 18px;
  50. line-height: 50px;
  51. margin-left: 20px;
  52. vertical-align: middle;
  53. "
  54. >{{ $t("common.resourceLanguageVersion") }}</span
  55. >
  56. <i
  57. class="el-icon-plus"
  58. style="
  59. font-size: 30px;
  60. font-weight: 900;
  61. margin-left: 20px;
  62. line-height: 50px;
  63. color: #e6a23c;
  64. vertical-align: middle;
  65. "
  66. @click="addTabDialog(languageTabsValue)"
  67. ></i>
  68. </div> -->
  69. <div class="uploadForm">
  70. <el-form
  71. :model="ruleForm"
  72. ref="ruleForm"
  73. label-width="300px"
  74. class="demo-ruleForm"
  75. label-position="right"
  76. >
  77. <el-form-item :label="$t('common.approvalTitle')" prop="title">
  78. <el-input
  79. clearable
  80. style="width: 50%"
  81. v-model="ruleForm.title"
  82. :placeholder="$t('common.inputTitle')"
  83. ></el-input>
  84. <el-button
  85. @click="search"
  86. type="primary"
  87. style="margin-left: 20px; width: 91px"
  88. >{{ $t("common.search") }}</el-button
  89. >
  90. <div>
  91. <span>{{ $t("common.titleText") }}</span>
  92. </div>
  93. </el-form-item>
  94. <el-form-item
  95. prop="committee"
  96. >
  97. <span slot="label"><span style="color: red;padding-right: 3px;">*</span>{{$t('common.affiliatedCommittee')}}</span>
  98. <el-select
  99. clearable
  100. style="width: 50%"
  101. v-model="ruleForm.committee"
  102. :placeholder="$t('common.NoSelected')"
  103. >
  104. <el-option
  105. v-for="item in nationalCommitteeList"
  106. :key="item.label"
  107. :label="$i18n.locale === 'en' ? item.label2 : item.label"
  108. :value="item.id"
  109. >
  110. </el-option>
  111. </el-select>
  112. </el-form-item>
  113. <!-- <el-form-item :label="$t('common.cover')" prop="region">-->
  114. <!-- &lt;!&ndash; action="/api/nationregioncomittee-service/nrc/nrcMaterialStorehouses/uploadMeanImg" &ndash;&gt;-->
  115. <!-- &lt;!&ndash; action="/api/file/upload/img?module=BaseResearchResultInfoForm&attachmentBusinessType=base_research_result_info_cover" &ndash;&gt;-->
  116. <!-- <el-upload-->
  117. <!-- class="upload-demo"-->
  118. <!-- action="/api/nationregioncomittee-service/nrc/nrcMaterialStorehouses/uploadMeanImg"-->
  119. <!-- :on-remove="handleRemove2"-->
  120. <!-- :before-remove="beforeRemove2"-->
  121. <!-- :before-upload="beforeUpload2"-->
  122. <!-- :on-success="handleAvatarSuccessAnnex2"-->
  123. <!-- multiple-->
  124. <!-- :on-exceed="handleExceed2"-->
  125. <!-- :file-list="fileList2"-->
  126. <!-- :limit="1"-->
  127. <!-- >-->
  128. <!-- <el-button icon="el-icon-upload">{{-->
  129. <!-- $t("common.selectUpload")-->
  130. <!-- }}</el-button>-->
  131. <!-- <span style="margin-left: 20px">{{-->
  132. <!-- $t("common.selectUploadText")-->
  133. <!-- }}</span>-->
  134. <!-- </el-upload>-->
  135. <!-- </el-form-item>-->
  136. <!-- <el-form-item prop="name">-->
  137. <!-- <span slot="label"><span style="color: red;padding-right: 3px;">*</span>{{$t('common.name')}}</span>-->
  138. <!-- <el-input-->
  139. <!-- clearable-->
  140. <!-- style="width: 50%"-->
  141. <!-- v-model="ruleForm.name"-->
  142. <!-- :placeholder="$t('common.inputName')"-->
  143. <!-- ></el-input>-->
  144. <!-- </el-form-item>-->
  145. <!-- <el-form-item prop="committee">-->
  146. <!-- <span slot="label"><span style="color: red;padding-right: 3px;">*</span>{{$t('common.country')}}</span>-->
  147. <!-- <el-select-->
  148. <!-- filterable-->
  149. <!-- clearable-->
  150. <!-- style="width: 24%"-->
  151. <!-- v-model="ruleForm.national"-->
  152. <!-- :placeholder="$t('common.NoSelected')"-->
  153. <!-- >-->
  154. <!-- <el-option-->
  155. <!-- v-for="item in nationList"-->
  156. <!-- :key="item.id"-->
  157. <!-- :label="$i18n.locale === 'zh' ? item.label : item.countryNameEn"-->
  158. <!-- :value="item.countryIsoCode"-->
  159. <!-- >-->
  160. <!-- </el-option>-->
  161. <!-- </el-select>-->
  162. <!-- <el-select-->
  163. <!-- filterable-->
  164. <!-- clearable-->
  165. <!-- style="width: 24%; margin-left: 2%"-->
  166. <!-- v-model="ruleForm.city"-->
  167. <!-- :placeholder="$t('common.NoSelected')"-->
  168. <!-- >-->
  169. <!-- <el-option-->
  170. <!-- v-for="item in cityList"-->
  171. <!-- :key="item.id"-->
  172. <!-- :label="$i18n.locale === 'zh' ? item.cityName : item.cityNameEn"-->
  173. <!-- :value="item.cityIsoCode"-->
  174. <!-- >-->
  175. <!-- </el-option>-->
  176. <!--&lt;!&ndash; <el-pagination&ndash;&gt;-->
  177. <!--&lt;!&ndash; type="index"&ndash;&gt;-->
  178. <!--&lt;!&ndash; background&ndash;&gt;-->
  179. <!--&lt;!&ndash; layout="prev, pager, next"&ndash;&gt;-->
  180. <!--&lt;!&ndash; :page-size="10"&ndash;&gt;-->
  181. <!--&lt;!&ndash; :total="total - 0"&ndash;&gt;-->
  182. <!--&lt;!&ndash; @current-change="handleCurrentChange"&ndash;&gt;-->
  183. <!--&lt;!&ndash; ></el-pagination>&ndash;&gt;-->
  184. <!-- </el-select>-->
  185. <!-- </el-form-item>-->
  186. <!-- <el-form-item :label="$t('common.contacts')" prop="contacts">-->
  187. <!-- <el-input-->
  188. <!-- clearable-->
  189. <!-- style="width: 50%"-->
  190. <!-- v-model="ruleForm.contacts"-->
  191. <!-- :placeholder="$t('common.inputContact')"-->
  192. <!-- ></el-input>-->
  193. <!-- </el-form-item>-->
  194. <!-- <el-form-item :label="$t('common.mail')" prop="mail">-->
  195. <!-- <el-input-->
  196. <!-- clearable-->
  197. <!-- style="width: 50%"-->
  198. <!-- v-model="ruleForm.email"-->
  199. <!-- :placeholder="$t('common.inputEmail')"-->
  200. <!-- ></el-input>-->
  201. <!-- </el-form-item>-->
  202. <el-form-item prop="desc">
  203. <span slot="label"><span style="color: red;padding-right: 3px;">*</span>{{$t('common.abstract')}}</span>
  204. <el-input
  205. clearable
  206. :placeholder="$t('common.pleaseInput')"
  207. style="width: 50%; resize: none"
  208. maxlength="500"
  209. show-word-limit
  210. :autosize="{ minRows: 7, maxRows: 8 }"
  211. type="textarea"
  212. v-model="ruleForm.desc"
  213. ></el-input>
  214. </el-form-item>
  215. <el-form-item prop="region">
  216. <span slot="label"><span style="color: red;padding-right: 3px;">*</span>{{$t('common.cover')}}</span>
  217. <el-upload
  218. class="upload-demo"
  219. action="/api/nationregioncomittee-service/nrc/nrcMaterialStorehouses/uploadMeanImg"
  220. :on-remove="handleRemove"
  221. :before-remove="beforeRemove"
  222. :before-upload="beforeUpload"
  223. :on-success="handleAvatarSuccessAnnex"
  224. multiple
  225. :on-exceed="handleExceed"
  226. :file-list="fileList"
  227. :limit="1"
  228. >
  229. <el-button icon="el-icon-upload" style="float: left;">{{
  230. $t("common.selectUpload")
  231. }}</el-button>
  232. <span style="margin-left: 20px;display: inline-block;max-width: 72%;text-align: left;line-height: 20px;">{{
  233. $t("common.selectUploadText")
  234. }}</span>
  235. </el-upload>
  236. </el-form-item>
  237. <el-form-item prop="region">
  238. <span slot="label"><span style="color: red;padding-right: 3px;">*</span>{{$t('common.enclosure')}}</span>
  239. <el-upload
  240. class="upload-demo"
  241. action="/api/nationregioncomittee-service/nrc/nrcMaterialStorehouses/uploadEnclosurePDF"
  242. :on-remove="handleRemove1"
  243. :before-remove="beforeRemove1"
  244. :before-upload="beforeUpload1"
  245. :on-success="handleAvatarSuccessAnnex1"
  246. multiple
  247. :on-exceed="handleExceed1"
  248. :file-list="fileList1"
  249. >
  250. <el-button icon="el-icon-upload">{{
  251. $t("common.selectUpload")
  252. }}</el-button>
  253. <span style="margin-left: 20px;">{{
  254. $t("common.attachmentText")
  255. }}</span>
  256. </el-upload>
  257. </el-form-item>
  258. <el-form-item>
  259. <el-button
  260. style="width: 120px"
  261. type="primary"
  262. @click="submitForm('ruleForm')"
  263. >{{ $t("common.release") }}</el-button
  264. >
  265. <el-button
  266. style="width: 120px; margin-left: 20px"
  267. @click="resetForm('ruleForm')"
  268. >{{ $t("common.cancel") }}</el-button
  269. >
  270. </el-form-item>
  271. </el-form>
  272. </div>
  273. <!-- 添加英文dialog -->
  274. <el-dialog
  275. class="languages"
  276. title="添加语言"
  277. :visible.sync="dialogFormVisible2"
  278. >
  279. <el-form :model="form1" style="padding-left: 30%">
  280. <el-form-item label="语言" style="margin-left: 14px">
  281. <el-select
  282. multiple
  283. v-model="form1.language"
  284. placeholder="请选择"
  285. style="width: 415px"
  286. >
  287. <el-option
  288. style="width: 515px; margin-left: 10px"
  289. v-for="item in language"
  290. :key="item.value"
  291. :label="item.label"
  292. :value="item.value"
  293. >
  294. </el-option>
  295. </el-select>
  296. </el-form-item>
  297. <el-form-item label="翻译" style="margin-left: 14px">
  298. <el-radio-group v-model="form1.language_flag">
  299. <el-radio :label="1">是</el-radio>
  300. <el-radio :label="0">否</el-radio>
  301. </el-radio-group>
  302. </el-form-item>
  303. <el-form-item style="margin-top: 50px; margin-left: 100px">
  304. <el-button type="primary" @click="submit_lange">保存</el-button>
  305. <el-button @click="cancel_lange">关闭</el-button>
  306. </el-form-item>
  307. </el-form>
  308. </el-dialog>
  309. <!-- 查询标题dialog -->
  310. <el-dialog
  311. title="查询标题"
  312. :title="$i18n.locale === 'zh' ? '请选择' : 'Please Select'"
  313. :visible.sync="titleDialogVisible"
  314. width="40%"
  315. :before-close="dialogBeforeClose"
  316. >
  317. <div>
  318. <el-table
  319. :highlight-current-row="true"
  320. :cell-style="{ textAlign: 'center' }"
  321. :header-cell-style="{ textAlign: 'center' }"
  322. border
  323. :data="titleList"
  324. style="width: 100%"
  325. >
  326. <el-table-column prop="title" :label="$i18n.locale === 'zh' ? '标题' : 'Title'" width="width">
  327. </el-table-column>
  328. <el-table-column prop="createDate" :label="$i18n.locale === 'zh' ? '创建时间' : 'Create Time'" width="width">
  329. </el-table-column>
  330. <el-table-column :label="$i18n.locale === 'zh' ? '操作' : 'Operation'" width="width">
  331. <template slot-scope="scope">
  332. <el-button
  333. type="text"
  334. size="mini"
  335. style="display: block; margin-left: 43%"
  336. @click="choose(scope.row)"
  337. >
  338. <span>{{ $i18n.locale == 'en' ? 'Select ' : '选择' }}</span>
  339. </el-button>
  340. </template>
  341. </el-table-column>
  342. </el-table>
  343. </div>
  344. </el-dialog>
  345. </div>
  346. </div>
  347. </template>
  348. <script>
  349. import {
  350. getNationalCommittee,
  351. country,
  352. city,
  353. uploadCommissionData,
  354. getThroughTitleTheApplication,
  355. } from "@/api/committee/committeeWorkSpace";
  356. export default {
  357. name: "UploadCommitteeInformation",
  358. data() {
  359. return {
  360. ruleForm: {
  361. title: "",
  362. committee: "",
  363. national: "",
  364. city: "",
  365. name: "",
  366. contacts: "",
  367. email: "",
  368. date1: "",
  369. date2: "",
  370. delivery: false,
  371. type: [],
  372. resource: "",
  373. desc: "",
  374. },
  375. selectCity:undefined,
  376. nationalCommitteeList: [],
  377. nationalCommitteeListFull: [],
  378. nationList: [],
  379. cityList: [],
  380. cityList1: [{ cityName: "南京", cityNameEn: "NanJing",cityIsoCode:"ALB",id:"3123123123123123" }],
  381. fileList: [],
  382. fileList1: [],
  383. fileList2: [],
  384. total: "",
  385. pageNo: "",
  386. coverAddress: "",
  387. directoryAddress: "",
  388. attachmentAddress: "",
  389. dialogFormVisible2: false,
  390. filename:[],
  391. form1: {
  392. language: "", //总部流转
  393. language_flag: 0, //办理人
  394. },
  395. language: [
  396. {
  397. label: "英文",
  398. value: "1",
  399. },
  400. ],
  401. titleDialogVisible: false,
  402. titleList: [],
  403. titleId: "",
  404. uploadInformation: {
  405. id: 0,
  406. abstractInfo: "",
  407. attachmentPath: "",
  408. belongCommittee: "",
  409. city: "",
  410. contact: "",
  411. coverPath: "",
  412. createBy: "",
  413. createDate: "",
  414. mail: "",
  415. menuPath: "",
  416. name: "",
  417. nation: "",
  418. reserveFive: "",
  419. reserveFour: "",
  420. reserveOne: "",
  421. reserveThree: "",
  422. reserveTwo: "",
  423. title: "",
  424. titleFirstWord: "",
  425. updateBy: "",
  426. updateDate: "",
  427. uploadPeople: "",
  428. uploadTime: "",
  429. },
  430. // rules: {
  431. // name: [
  432. // { required: true, message: "请输入活动名称", trigger: "blur" },
  433. // { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
  434. // ],
  435. // region: [
  436. // { required: true, message: "请选择活动区域", trigger: "change" },
  437. // ],
  438. // date1: [
  439. // {
  440. // type: "date",
  441. // required: true,
  442. // message: "请选择日期",
  443. // trigger: "change",
  444. // },
  445. // ],
  446. // date2: [
  447. // {
  448. // type: "date",
  449. // required: true,
  450. // message: "请选择时间",
  451. // trigger: "change",
  452. // },
  453. // ],
  454. // type: [
  455. // {
  456. // type: "array",
  457. // required: true,
  458. // message: "请至少选择一个活动性质",
  459. // trigger: "change",
  460. // },
  461. // ],
  462. // resource: [
  463. // { required: true, message: "请选择活动资源", trigger: "change" },
  464. // ],
  465. // desc: [{ required: true, message: "请填写活动形式", trigger: "blur" }],
  466. // },
  467. };
  468. },
  469. watch: {
  470. "$i18n.locale"() {
  471. this.getNational();
  472. this.getNationalCommitteeList();
  473. },
  474. selectCity(val) {
  475. this.$refs.pagination.filter(val);
  476. },
  477. "ruleForm.national": {
  478. handler() {
  479. console.log(1111);
  480. this.getCity();
  481. if (this.ruleForm.national === "") {
  482. this.ruleForm.city = "";
  483. }
  484. },
  485. deep: true,
  486. },
  487. },
  488. mounted() {
  489. this.initData();
  490. },
  491. destroyed() {},
  492. methods: {
  493. initData() {
  494. this.getNationalCommitteeList();
  495. this.getNational();
  496. },
  497. // 上传 获取国家委员会
  498. getNationalCommitteeList() {
  499. this.nationalCommitteeList = [];
  500. getNationalCommittee().then((res) => {
  501. var data = res.data;
  502. if (data) {
  503. this.nationalCommitteeListFull = data;
  504. if(this.$i18n.locale == "en"){
  505. for(let i=0;i<this.nationalCommitteeListFull.length;i++){
  506. if(this.nationalCommitteeListFull[i].label2!="" && this.nationalCommitteeListFull[i].label2!=null && this.nationalCommitteeListFull[i].label2!=undefined){
  507. this.nationalCommitteeList.push(this.nationalCommitteeListFull[i]);
  508. }
  509. }
  510. }else {
  511. this.nationalCommitteeList = this.nationalCommitteeListFull;
  512. }
  513. }
  514. });
  515. },
  516. // 搜索
  517. search() {
  518. this.getTitle();
  519. },
  520. // 获取通过申请的标题
  521. getTitle() {
  522. let title = this.ruleForm.title;
  523. if (this.ruleForm.title === "") {
  524. if(this.$i18n.locale == 'en'){
  525. this.$message({
  526. message: "The title cannot be empty",
  527. type: "warning",
  528. });
  529. }else {
  530. this.$message({
  531. message: "标题不能为空",
  532. type: "warning",
  533. });
  534. }
  535. } else {
  536. let id = this.titleId;
  537. getThroughTitleTheApplication(title)
  538. .then((res) => {
  539. console.log(res);
  540. if (res.status == "200") {
  541. this.titleList = res.data;
  542. this.titleDialogVisible = true;
  543. }
  544. })
  545. .catch((error) => {
  546. this.$message({
  547. message: `${error.msg}`,
  548. type: "warning",
  549. });
  550. });
  551. }
  552. },
  553. // 获取国家
  554. getNational() {
  555. country().then((res) => {
  556. let nationListTemp = res.data.baseCountryInformationDicts;
  557. let allNames = new Array();
  558. let allIds = new Array();
  559. for (let i = 0; i < nationListTemp.length; i++) {
  560. if(allNames.indexOf(nationListTemp[i].countryName)==-1){
  561. allNames.push(nationListTemp[i].countryName)
  562. allIds.push(nationListTemp[i].id)
  563. }
  564. }
  565. for (let i = 0; i < nationListTemp.length; i++) {
  566. if(allIds.indexOf(nationListTemp[i].id)>0){
  567. this.nationList.push(nationListTemp[i]);
  568. }
  569. }
  570. // console.log(this.nationList);
  571. });
  572. },
  573. // 获取城市
  574. getCity() {
  575. var params = this.ruleForm.national;
  576. var query = this.pageNo ? this.pageNo : "1";
  577. city(params).then((res) => {
  578. this.cityList = res.data.baseCityInformationDicts
  579. ? res.data.baseCityInformationDicts
  580. : [];
  581. // this.total = res.data.page.totalCount;
  582. });
  583. },
  584. choose(data) {
  585. console.log(data);
  586. this.fileList = [];
  587. this.directoryAddress = '';
  588. this.fileList1 = [];
  589. this.attachmentAddress = '';
  590. this.ruleForm.title = data.title;
  591. this.ruleForm.committee = data.belongCommitteeName;
  592. this.ruleForm.desc = data.abstractInfo;
  593. if (data.files) {
  594. data.files.forEach((item) => {
  595. if (item.type == "2") {
  596. let obj = {};
  597. obj.name = item.fileNameDisplay;
  598. obj.url = item.filePath;
  599. obj.type = item.type;
  600. this.fileList.push(obj);
  601. this.directoryAddress = item.filePath;
  602. }
  603. if (item.type == "5") {
  604. let obj = {};
  605. obj.name = item.fileNameDisplay;
  606. obj.url = item.filePath;
  607. obj.type = item.type;
  608. this.fileList1.push(obj);
  609. this.attachmentAddress = item.filePath;
  610. }
  611. });
  612. }
  613. this.titleId = data.id;
  614. this.titleDialogVisible = false;
  615. },
  616. handleCurrentChange(val) {
  617. this.pageNo = val;
  618. this.getCity();
  619. },
  620. dialogBeforeClose() {
  621. this.titleDialogVisible = false;
  622. },
  623. // 上传相关 封面
  624. handleRemove2(file, fileList) {
  625. console.log(file, fileList);
  626. this.filename.forEach((item, index) => {
  627. if (file.name == item.fileNameDisplay) {
  628. this.filename.splice(index, 1);
  629. }
  630. });
  631. console.log(this.filename);
  632. },
  633. beforeRemove2(file, fileList) {
  634. if (this.$i18n.locale == "zh") {
  635. return this.$confirm(`确定移除 ${file.name}?`);
  636. }else {
  637. return this.$confirm(`Sure to remove ${file.name}?`);
  638. }
  639. },
  640. beforeUpload2(file) {
  641. var FileExt = file.name.replace(/.+\./, "");
  642. // , "doc", "docx", "excel", "xls", "xlsx"
  643. if (["jpg", "png"].indexOf(FileExt.toLowerCase()) === -1) {
  644. if (this.$i18n.locale == "zh") {
  645. this.$message({
  646. type: "warning",
  647. message: "请上传jpg,png的文件!",
  648. });
  649. } else {
  650. this.$message({
  651. type: "warning",
  652. message: "Please upload JPG, PNG files!",
  653. });
  654. }
  655. this.fileList2.splice(this.fileList2.indexOf(file), 1);
  656. abort();
  657. return false;
  658. }
  659. this.isLt2k = file.size / 1024 / 1024 < 10 ? "1" : "0";
  660. if (this.isLt2k === "0") {
  661. if (this.$i18n.locale.toUpperCase() == "ZH") {
  662. this.$message({
  663. message: "上传文件大小不能超过10M!",
  664. type: "error",
  665. });
  666. } else {
  667. this.$message({
  668. message: "Upload file size cannot exceed 10m!",
  669. type: "error",
  670. });
  671. }
  672. this.fileList2.splice(this.fileList2.indexOf(file), 1);
  673. abort();
  674. return false;
  675. }
  676. },
  677. handleAvatarSuccessAnnex2(res, file) {
  678. this.coverAddress = res.data.filePath;
  679. // console.log(res.data.filePath)
  680. let obj = {};
  681. obj.fileNameDisplay = file.name;
  682. obj.filePath = res.data.filePath;
  683. obj.type = 2;
  684. this.filename.push(obj);
  685. console.log(this.filename);
  686. },
  687. handleExceed2(files, fileList) {
  688. if (this.$i18n.locale == "zh") {
  689. this.$message.warning(`当前限制选择 1 个文件。`);
  690. } else {
  691. this.$message.warning(`The current limit is to select 1 file.`);
  692. }
  693. },
  694. // 上传相关 目录
  695. handleRemove(file, fileList) {
  696. console.log(file, fileList);
  697. this.filename.forEach((item, index) => {
  698. if (file.name == item.fileNameDisplay) {
  699. this.filename.splice(index, 1);
  700. }
  701. });
  702. console.log(this.filename);
  703. },
  704. beforeRemove(file, fileList) {
  705. if (this.$i18n.locale == "zh") {
  706. return this.$confirm(`确定移除 ${file.name}?`);
  707. }else {
  708. return this.$confirm(`Sure to remove ${file.name}?`);
  709. }
  710. },
  711. beforeUpload(file) {
  712. var FileExt = file.name.replace(/.+\./, "");
  713. // , "doc", "docx", "excel", "xls", "xlsx"
  714. if (["jpg", "png"].indexOf(FileExt.toLowerCase()) === -1) {
  715. if (this.$i18n.locale == "zh") {
  716. this.$message({
  717. type: "warning",
  718. message: "请上传jpg,png的文件!",
  719. });
  720. } else {
  721. this.$message({
  722. type: "warning",
  723. message: "Please upload JPG, PNG files!",
  724. });
  725. }
  726. this.fileList.splice(this.fileList.indexOf(file), 1);
  727. abort();
  728. return false;
  729. }
  730. this.isLt2k = file.size / 1024 / 1024 < 10 ? "1" : "0";
  731. if (this.isLt2k === "0") {
  732. if (this.$i18n.locale.toUpperCase() == "ZH") {
  733. this.$message({
  734. message: "上传文件大小不能超过10M!",
  735. type: "error",
  736. });
  737. } else {
  738. this.$message({
  739. message: "Upload file size cannot exceed 10m!",
  740. type: "error",
  741. });
  742. }
  743. this.fileList.splice(this.fileList.indexOf(file), 1);
  744. abort();
  745. return false;
  746. }
  747. },
  748. handleAvatarSuccessAnnex(res, file) {
  749. if (res.status==500){
  750. if (this.$i18n.locale.toUpperCase() == 'EN') {
  751. this.$message.error("Upload Failed");
  752. }else {
  753. this.$message.error("上传失败");
  754. }
  755. this.fileList.splice(this.fileList.indexOf(file), 1)
  756. return
  757. }
  758. this.directoryAddress = res.data.filePath;
  759. let obj = {};
  760. obj.fileNameDisplay = file.name;
  761. obj.filePath = res.data.filePath;
  762. obj.type = 2;
  763. this.filename.push(obj);
  764. console.log(this.filename);
  765. },
  766. handleExceed(files, fileList) {
  767. if (this.$i18n.locale == "zh") {
  768. this.$message.warning(`当前限制选择 1 个文件。`);
  769. } else {
  770. this.$message.warning(`The current limit is to select 1 file.`);
  771. }
  772. },
  773. // 上传相关 附件
  774. handleRemove1(file, fileList) {
  775. console.log(file, fileList);
  776. this.filename.forEach((item, index) => {
  777. if (file.name == item.fileNameDisplay) {
  778. this.filename.splice(index, 1);
  779. }
  780. });
  781. console.log(this.filename);
  782. },
  783. beforeRemove1(file, fileList) {
  784. if(this.$i18n.locale == "en"){
  785. return this.$confirm(`Sure to remove ${file.name}?`);
  786. }else {
  787. return this.$confirm(`确定移除 ${file.name}?`);
  788. }
  789. },
  790. beforeUpload1(file) {
  791. var FileExt = file.name.replace(/.+\./, "");
  792. if (['pdf'].indexOf(FileExt.toLowerCase()) === -1) {
  793. if(this.$i18n.locale == "en"){
  794. this.$message({
  795. type: 'warning',
  796. message: 'Please Upload PDF File!!'
  797. });
  798. }else {
  799. this.$message({
  800. type: 'warning',
  801. message: '请上传pdf的文件!!'
  802. });
  803. }
  804. this.fileList1.splice(this.fileList1.indexOf(file), 1)
  805. abort();
  806. return false;
  807. }
  808. this.isLt2k = file.size / 1024 / 1024 < 50 ? "1" : "0";
  809. console.log(file.size / 1024 / 1024)
  810. if (this.isLt2k === "0") {
  811. if (this.$i18n.locale == "ZH") {
  812. this.$message({
  813. message: "上传文件大小不能超过50M!",
  814. type: "error",
  815. });
  816. } else {
  817. this.$message({
  818. message: "Upload file size cannot exceed 10m!",
  819. type: "error",
  820. });
  821. }
  822. this.fileList1.splice(this.fileList1.indexOf(file), 1)
  823. abort();
  824. return false;
  825. }
  826. },
  827. handleAvatarSuccessAnnex1(res, file) {
  828. if (res.status==500){
  829. if (this.$i18n.locale.toUpperCase() == 'EN') {
  830. this.$message.error("Upload Failed");
  831. }else {
  832. this.$message.error("上传失败");
  833. }
  834. this.fileList1.splice(this.fileList1.indexOf(file), 1)
  835. return
  836. }
  837. this.attachmentAddress = res.data.filePath;
  838. console.log(this.attachmentAddress);
  839. let obj = {};
  840. obj.fileNameDisplay = file.name;
  841. obj.filePath = res.data.filePath;
  842. obj.type = 2;
  843. this.filename.push(obj);
  844. console.log(this.filename);
  845. },
  846. handleExceed1(files, fileList) {
  847. this.$message.warning(
  848. `当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
  849. files.length + fileList.length
  850. } 个文件`
  851. );
  852. },
  853. submitForm(formName) {
  854. // this.$refs[formName].validate((valid) => {
  855. // if (valid) {
  856. // alert("submit!");
  857. // } else {
  858. // console.log("error submit!!");
  859. // return false;
  860. // }
  861. // });
  862. if(this.ruleForm.committee == "" || this.ruleForm.committee == null || this.ruleForm.committee == undefined){
  863. if(this.$i18n.locale == "en"){
  864. this.$message.error('Please Select Committee')
  865. }else {
  866. this.$message.error('请选择所属委员会')
  867. }
  868. return
  869. }
  870. for (let i = 0; i <this.nationalCommitteeList.length; i++) {
  871. if(this.ruleForm.committee == this.nationalCommitteeList[i].label){
  872. this.ruleForm.committee = this.nationalCommitteeList[i].id;
  873. break;
  874. }
  875. }
  876. // if(this.ruleForm.name == "" || this.ruleForm.name == null || this.ruleForm.name == undefined){
  877. // if(this.$i18n.locale == "en"){
  878. // this.$message.error('Please Enter Name')
  879. // }else {
  880. // this.$message.error('请输入名称')
  881. // }
  882. // return
  883. // }
  884. // if(this.ruleForm.national == "" || this.ruleForm.national == null || this.ruleForm.national == undefined){
  885. // if(this.$i18n.locale == "en"){
  886. // this.$message.error('Please Select Country')
  887. // }else {
  888. // this.$message.error('请选择国家')
  889. // }
  890. // return
  891. // }
  892. if(this.ruleForm.desc == "" || this.ruleForm.desc == null || this.ruleForm.desc == undefined){
  893. if(this.$i18n.locale == "en"){
  894. this.$message.error('Please Enter Abstract')
  895. }else {
  896. this.$message.error('请输入摘要')
  897. }
  898. return
  899. }
  900. /*if(this.fileList.length != 0){
  901. this.$message.error('请选择目录')
  902. return
  903. }*/
  904. if(this.directoryAddress == "" || this.directoryAddress == null || this.directoryAddress == undefined){
  905. if(this.$i18n.locale == "en"){
  906. this.$message.error('Please Select cover')
  907. }else {
  908. this.$message.error('请选择封面')
  909. }
  910. return
  911. }
  912. if(this.attachmentAddress == "" || this.attachmentAddress == null || this.attachmentAddress == undefined){
  913. if(this.$i18n.locale == "en"){
  914. this.$message.error('Please Select The Attachment.')
  915. }else {
  916. this.$message.error('请选择附件')
  917. }
  918. return
  919. }
  920. this.uploadInformation.title = this.ruleForm.title;
  921. this.uploadInformation.belongCommittee = this.ruleForm.committee;
  922. this.uploadInformation.coverPath = this.coverAddress;
  923. this.uploadInformation.name = this.ruleForm.name;
  924. this.uploadInformation.nation = this.ruleForm.national;
  925. this.uploadInformation.city = this.ruleForm.city;
  926. this.uploadInformation.contact = this.ruleForm.contacts;
  927. this.uploadInformation.mail = this.ruleForm.email;
  928. this.uploadInformation.abstractInfo = this.ruleForm.desc;
  929. this.uploadInformation.menuPath = this.directoryAddress;
  930. this.uploadInformation.attachmentPath = this.attachmentAddress;
  931. this.uploadInformation.reserveTwo = "zh";
  932. console.log(this.uploadInformation);
  933. let params = this.uploadInformation;
  934. let id = this.titleId;
  935. uploadCommissionData(params, id)
  936. .then((res) => {
  937. console.log(res);
  938. let msg = "";
  939. if(this.$i18n.locale=='en'){
  940. msg = "Upload Succeeded";
  941. }else{
  942. msg = "上传成功";
  943. }
  944. if (res.status === "200") {
  945. this.$message({
  946. message: msg,
  947. type: "success",
  948. });
  949. this.$router.push({
  950. name: "nationalregionalCommittees",
  951. query: {
  952. key: "information",
  953. },
  954. });
  955. }
  956. })
  957. .catch((error) => {
  958. this.$message({
  959. message: `${error.msg}`,
  960. type: "error",
  961. });
  962. });
  963. },
  964. resetForm(formName) {
  965. this.$refs[formName].resetFields();
  966. this.$router.push({
  967. name: "nationalregionalCommittees",
  968. query: {
  969. key: "information",
  970. },
  971. });
  972. },
  973. addTabDialog(targetName) {
  974. // const that = this;
  975. // that.addLanguageDialog = true;
  976. },
  977. addlanguage() {
  978. this.dialogFormVisible2 = true;
  979. },
  980. submit_lange() {
  981. // if (this.form1.language && this.form1.language_flag) {
  982. // }
  983. this.dialogFormVisible2 = false;
  984. },
  985. cancel_lange() {
  986. this.dialogFormVisible2 = false;
  987. },
  988. },
  989. };
  990. </script>
  991. <style scoped>
  992. .content .addLanguage {
  993. width: 100%;
  994. height: 50px;
  995. border-bottom: 1px solid #666666;
  996. }
  997. /* 去除文本框右下角斜杠 */
  998. ::v-deep .el-textarea__inner {
  999. resize: none;
  1000. }
  1001. .box1 {
  1002. margin-top: 10px;
  1003. background: #fff;
  1004. padding: 24px 0;
  1005. position: absolute;
  1006. }
  1007. .crumbs {
  1008. margin-left: 20px;
  1009. }
  1010. .screen1 {
  1011. background: linear-gradient(180deg, #3280e2 0%, #144e97 100%);
  1012. border-radius: 20px 20px 20px 20px;
  1013. padding: 8px 12px;
  1014. color: #f0f3f8;
  1015. margin-left: 10px;
  1016. }
  1017. .screen2 {
  1018. font-size: 14px;
  1019. background: linear-gradient(180deg, #b4d5ff 0%, #4f81bf 100%);
  1020. border-radius: 20px;
  1021. padding: 8px 12px;
  1022. color: #165099;
  1023. margin-left: 10px;
  1024. }
  1025. </style>