userCenteraddMyProject.vue 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243
  1. <template>
  2. <div
  3. style="width: 100%; background: #fff; min-height: 700px"
  4. class="userCenterAuthenticationPersonal"
  5. >
  6. <div
  7. v-show="$i18n.locale == 'zh'"
  8. style="
  9. height: 80px;
  10. line-height: 80px;
  11. margin-top: 20px;
  12. margin: 0 20px;
  13. color: #666;
  14. font-size: 15px;
  15. border-bottom: 1px solid #bcbcbc;
  16. "
  17. >
  18. 添加项目
  19. <!-- <span style="float: right;margin-top: 27px;"> <i class="el-icon-edit"></i> 修改</span> -->
  20. </div>
  21. <div v-show="$i18n.locale == 'zh'" style="width: 900px">
  22. <el-form
  23. ref="form"
  24. :model="baseProjectView"
  25. label-width="160px"
  26. class="demo-ruleForm"
  27. style="margin-left: 100px; margin-top: 20px; width: 900px"
  28. :rules="chineseFormRules"
  29. >
  30. <el-form-item label="项目名称(原语言):" prop="name">
  31. <el-input
  32. v-model="baseProjectView.originalLanguageProjectName"
  33. :disabled="false"
  34. style="width: 70%"
  35. maxlength="100"
  36. show-word-limit
  37. ></el-input>
  38. </el-form-item>
  39. <el-form-item label="项目名称(中文):" prop="chineseLanguageProjectName">
  40. <el-input
  41. v-model="baseProjectView.chineseLanguageProjectName"
  42. :disabled="false"
  43. style="width: 70%"
  44. maxlength="100"
  45. show-word-limit
  46. ></el-input>
  47. </el-form-item>
  48. <el-form-item label="项目名称(英文):" prop="englishLanguageProjectName">
  49. <el-input
  50. v-model="baseProjectView.englishLanguageProjectName"
  51. :disabled="false"
  52. style="width: 70%"
  53. maxlength="100"
  54. show-word-limit
  55. ></el-input>
  56. </el-form-item>
  57. <el-form-item label="项目业主:" prop="projectOwner">
  58. <el-input
  59. v-model="baseProjectView.projectOwner"
  60. :disabled="false"
  61. style="width: 70%"
  62. maxlength="50"
  63. show-word-limit
  64. ></el-input>
  65. </el-form-item>
  66. <el-form-item label="项目已有合作方:" prop="projectPartner">
  67. <el-input
  68. v-model="baseProjectView.projectPartner"
  69. :disabled="false"
  70. style="width: 70%"
  71. maxlength="100"
  72. show-word-limit
  73. ></el-input>
  74. </el-form-item>
  75. <el-form-item :required="true" label="大洲:" prop="continentCountry">
  76. <el-select
  77. v-model="baseProjectView.continentCountry"
  78. placeholder="请选择或输入大洲"
  79. filterable
  80. multiple
  81. :disabled="false"
  82. style="width: 70%"
  83. >
  84. <el-option
  85. v-for="item in continentCountryDicts"
  86. :key="item.value"
  87. :label="item.label"
  88. :value="item.value"
  89. :disabled="false"
  90. >
  91. </el-option>
  92. </el-select>
  93. </el-form-item>
  94. <el-form-item :required="true" label="国家:" prop="unitCountry">
  95. <el-select
  96. v-model="baseProjectView.unitCountry"
  97. placeholder="请选择或输入国家"
  98. filterable
  99. multiple
  100. style="width: 70%"
  101. >
  102. <el-option
  103. v-for="item in unitCountryDicts"
  104. :key="item.value"
  105. :label="item.label"
  106. :value="item.value"
  107. :disabled="false"
  108. >
  109. </el-option>
  110. </el-select>
  111. </el-form-item>
  112. <!-- <el-form-item label="城市:" prop='name'>
  113. <el-select v-model="baseProjectView.reserveOne" placeholder="请选择城市" style="width: 70%;">
  114. <el-option
  115. v-for="item in reserveOnes"
  116. :key="item.value"
  117. :label="item.label"
  118. :value="item.value"
  119. :disabled="false">
  120. </el-option>
  121. </el-select>
  122. </el-form-item> -->
  123. <el-form-item
  124. :required="true"
  125. label="项目门类:"
  126. prop="technicalCategories"
  127. >
  128. <el-select
  129. v-model="baseProjectView.technicalCategories"
  130. placeholder="请选择门类"
  131. style="width: 70%"
  132. >
  133. <el-option
  134. v-for="item in technicalCategoriesDicts"
  135. :key="item.value"
  136. :label="item.label"
  137. :value="item.value"
  138. :disabled="false"
  139. >
  140. </el-option>
  141. </el-select>
  142. </el-form-item>
  143. <el-form-item :required="true" label="技术范围:" prop="technicalScope">
  144. <el-select
  145. v-model="baseProjectView.technicalScope"
  146. placeholder="请选择范围"
  147. style="width: 70%"
  148. >
  149. <el-option
  150. v-for="item in technicalScopeDicts"
  151. :key="item.value"
  152. :label="item.label"
  153. :value="item.value"
  154. :disabled="false"
  155. >
  156. </el-option>
  157. </el-select>
  158. </el-form-item>
  159. <el-form-item :required="true" label="当前阶段:" prop="phaseType">
  160. <el-select
  161. v-model="baseProjectView.phaseType"
  162. placeholder="请选择当前阶段"
  163. style="width: 70%"
  164. >
  165. <el-option
  166. v-for="item in phaseTypeDicts"
  167. :key="item.value"
  168. :label="item.label"
  169. :value="item.value"
  170. :disabled="false"
  171. >
  172. </el-option>
  173. </el-select>
  174. </el-form-item>
  175. <el-form-item label="项目标签:" prop="name">
  176. <!-- <el-input v-model="baseProjectView.projectLabel" :disabled="false" style="width: 70%;"></el-input> -->
  177. <div>
  178. <el-tag
  179. :key="index"
  180. style="margin-right: 5px"
  181. v-for="(tag, index) in systemLabel"
  182. :disable-transitions="false"
  183. :type="tag.type"
  184. effect="plain"
  185. >
  186. {{ tag.label }}
  187. </el-tag>
  188. </div>
  189. <el-button type="success" @click="dialogVisibles()"
  190. >选择标签</el-button
  191. >
  192. </el-form-item>
  193. <el-form-item label="项目描述:" prop="name">
  194. <el-input
  195. type="textarea"
  196. :rows="10"
  197. v-model="baseProjectView.projectDescription"
  198. :placeholder="this.textareaMessaage"
  199. :disabled="false"
  200. style="width: 70%; min-height: 100px"
  201. maxlength="500"
  202. show-word-limit
  203. ></el-input>
  204. </el-form-item>
  205. <el-form-item label="项目评估:" prop="name">
  206. <el-input
  207. type="textarea"
  208. v-model="baseProjectView.projectRequirements"
  209. :disabled="false"
  210. style="width: 70%"
  211. maxlength="500"
  212. show-word-limit
  213. ></el-input>
  214. </el-form-item>
  215. <el-form-item label="项目附件:">
  216. <el-upload
  217. class="upload-demo"
  218. drag
  219. action="/api/file/upload/attachment?module=BaseProjectInfoForm&attachmentBusinessType=base_project_info"
  220. :on-change="handleChange"
  221. :on-success="handleAvatarSuccessAnnex"
  222. :on-preview="handlePreview"
  223. :headers="myHeaders"
  224. :on-remove="handleRemove"
  225. :before-upload="beforeUpload"
  226. :file-list="fileList"
  227. multiple
  228. >
  229. <i class="el-icon-upload"></i>
  230. <div class="el-upload__text">
  231. 将文件拖到此处,或<em>点击上传</em>
  232. </div>
  233. <div class="el-upload__tip" slot="tip">
  234. 提示:请上传ZIP,PDF,DOC,DOCX,XLS,XLSX格式的附件,文件不能超过50MB
  235. </div>
  236. </el-upload>
  237. </el-form-item>
  238. <el-form-item label="封面图片:" style="position: relative">
  239. <el-upload
  240. class="avatar-uploader"
  241. action="/api/file/upload/attachment?module=BaseProjectInfoForm&attachmentBusinessType=base_project_info_banner"
  242. :show-file-list="false"
  243. :headers="myHeaders"
  244. :on-success="photoSuccess"
  245. >
  246. <img
  247. v-if="path != ''"
  248. :src="'/api/file/pub/' + path"
  249. class="avatar"
  250. />
  251. <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  252. <div
  253. slot="tip"
  254. class="el-upload__tip"
  255. style="display: inline-block; margin-left: 5px"
  256. >
  257. {{ $t("common.resourceHint")
  258. }}{{ $t("common.resourceUploadJPGPNG") }},{{
  259. $t("common.resourceFilesCannotExceed10Mb")
  260. }},{{ $t("common.resourceUploadOne") }}
  261. </div>
  262. </el-upload>
  263. </el-form-item>
  264. <el-form-item label="信息是否公开:">
  265. <el-radio-group v-model="baseProjectView.messageOpenType">
  266. <el-radio
  267. :label="item.value"
  268. :key="item.value"
  269. v-for="(item, index) in isCreateNewUser"
  270. >{{ item.label }}</el-radio
  271. >
  272. </el-radio-group>
  273. </el-form-item>
  274. </el-form>
  275. </div>
  276. <div v-show="$i18n.locale == 'zh'" style="height: 200px">
  277. <div style="margin-top: 100px">
  278. <el-button type="warning" style="margin-left: 300px" @click="save"
  279. >保存</el-button
  280. >
  281. <el-button type="primary" style="margin-left: 30px" @click="close"
  282. >关闭</el-button
  283. >
  284. </div>
  285. </div>
  286. <div v-if="dialogVisible && $i18n.locale == 'zh'">
  287. <userCenterAddTag
  288. v-bind:systemLabel="systemLabel"
  289. :mergeSelectedLabels="mergeSelectedLabels"
  290. @closeMain="closeMain"
  291. ></userCenterAddTag>
  292. <!-- :mergeSelectedLabels="mergeSelectedLabels" -->
  293. </div>
  294. <div
  295. v-show="$i18n.locale == 'en'"
  296. style="
  297. height: 80px;
  298. line-height: 80px;
  299. margin-top: 20px;
  300. margin: 0 20px;
  301. color: #666;
  302. font-size: 15px;
  303. border-bottom: 1px solid #bcbcbc;
  304. "
  305. >
  306. Add Project
  307. </div>
  308. <div v-show="$i18n.locale == 'en'" style="width: 900px">
  309. <el-form
  310. ref="form"
  311. :model="baseProjectView"
  312. label-width="160px"
  313. class="demo-ruleForm"
  314. style="margin-left: 100px; margin-top: 20px; width: 900px"
  315. :rules="englishFormRules"
  316. >
  317. <el-form-item label="Project name (original language):" prop="name">
  318. <el-input
  319. v-model="baseProjectView.originalLanguageProjectName"
  320. :disabled="false"
  321. style="width: 70%"
  322. maxlength="100"
  323. show-word-limit
  324. ></el-input>
  325. </el-form-item>
  326. <el-form-item
  327. label="Project name (Chinese):"
  328. prop="chineseLanguageProjectName"
  329. >
  330. <el-input
  331. v-model="baseProjectView.chineseLanguageProjectName"
  332. :disabled="false"
  333. style="width: 70%"
  334. maxlength="100"
  335. show-word-limit
  336. ></el-input>
  337. </el-form-item>
  338. <el-form-item
  339. label="Project name (English):"
  340. prop="englishLanguageProjectName"
  341. >
  342. <el-input
  343. v-model="baseProjectView.englishLanguageProjectName"
  344. :disabled="false"
  345. style="width: 70%"
  346. maxlength="100"
  347. show-word-limit
  348. ></el-input>
  349. </el-form-item>
  350. <el-form-item label="Project owner:" prop="projectOwner">
  351. <el-input
  352. v-model="baseProjectView.projectOwner"
  353. :disabled="false"
  354. style="width: 70%"
  355. maxlength="100"
  356. show-word-limit
  357. ></el-input>
  358. </el-form-item>
  359. <el-form-item label="Project partners:" prop="projectPartner">
  360. <el-input
  361. v-model="baseProjectView.projectPartner"
  362. :disabled="false"
  363. style="width: 70%"
  364. maxlength="100"
  365. show-word-limit
  366. ></el-input>
  367. </el-form-item>
  368. <el-form-item
  369. :required="true"
  370. label="Continent:"
  371. prop="continentCountry"
  372. >
  373. <el-select
  374. v-model="baseProjectView.continentCountry"
  375. multiple
  376. :placeholder="placehoders"
  377. :disabled="false"
  378. style="width: 70%"
  379. >
  380. <el-option
  381. v-for="item in continentCountryDicts"
  382. :key="item.value"
  383. :label="item.label"
  384. :value="item.value"
  385. :disabled="false"
  386. >
  387. </el-option>
  388. </el-select>
  389. </el-form-item>
  390. <el-form-item :required="true" label="Country:" prop="unitCountry">
  391. <el-select
  392. v-model="baseProjectView.unitCountry"
  393. multiple
  394. :placeholder="placehoders"
  395. style="width: 70%"
  396. >
  397. <el-option
  398. v-for="item in unitCountryDicts"
  399. :key="item.value"
  400. :label="item.label"
  401. :value="item.value"
  402. :disabled="false"
  403. >
  404. </el-option>
  405. </el-select>
  406. </el-form-item>
  407. <!-- <el-form-item label="city:" prop='name'>
  408. <el-select v-model="baseProjectView.reserveOne" placeholder="Please select a city" style="width: 70%;">
  409. <el-option
  410. v-for="item in reserveOnes"
  411. :key="item.value"
  412. :label="item.label"
  413. :value="item.value"
  414. :disabled="false">
  415. </el-option>
  416. </el-select>
  417. </el-form-item> -->
  418. <el-form-item
  419. :required="true"
  420. label="Project category:"
  421. prop="technicalCategories"
  422. >
  423. <el-select
  424. v-model="baseProjectView.technicalCategories"
  425. placeholder="Please select the category"
  426. style="width: 70%"
  427. >
  428. <el-option
  429. v-for="item in technicalCategoriesDicts"
  430. :key="item.value"
  431. :label="item.label"
  432. :value="item.value"
  433. :disabled="false"
  434. >
  435. </el-option>
  436. </el-select>
  437. </el-form-item>
  438. <el-form-item
  439. :required="true"
  440. label="Technology:"
  441. prop="technicalScope"
  442. >
  443. <el-select
  444. v-model="baseProjectView.technicalScope"
  445. placeholder="Please select a range"
  446. style="width: 70%"
  447. >
  448. <el-option
  449. v-for="item in technicalScopeDicts"
  450. :key="item.value"
  451. :label="item.label"
  452. :value="item.value"
  453. :disabled="false"
  454. >
  455. </el-option>
  456. </el-select>
  457. </el-form-item>
  458. <el-form-item :required="true" label="Current stage:" prop="phaseType">
  459. <el-select
  460. v-model="baseProjectView.phaseType"
  461. placeholder="Please select current stage"
  462. style="width: 70%"
  463. >
  464. <el-option
  465. v-for="item in phaseTypeDicts"
  466. :key="item.value"
  467. :label="item.label"
  468. :value="item.value"
  469. :disabled="false"
  470. >
  471. </el-option>
  472. </el-select>
  473. </el-form-item>
  474. <el-form-item label="Tag:" prop="name">
  475. <div>
  476. <el-tag
  477. :key="index"
  478. style="margin-right: 5px"
  479. v-for="(tag, index) in systemLabel"
  480. :disable-transitions="false"
  481. :type="tag.type"
  482. effect="plain"
  483. >
  484. {{ tag.label }}
  485. </el-tag>
  486. </div>
  487. <el-button type="success" @click="dialogVisibles()"
  488. >Add tag</el-button
  489. >
  490. </el-form-item>
  491. <el-form-item label="Project description:" prop="name">
  492. <el-input
  493. :rows="10"
  494. type="textarea"
  495. v-model="baseProjectView.projectDescription"
  496. :placeholder="this.textareaMessaageEn"
  497. :disabled="false"
  498. resize="800"
  499. style="width: 70%"
  500. maxlength="500"
  501. show-word-limit
  502. ></el-input>
  503. </el-form-item>
  504. <el-form-item label="Project Evaluation:" prop="name">
  505. <el-input
  506. type="textarea"
  507. v-model="baseProjectView.projectRequirements"
  508. :disabled="false"
  509. style="width: 70%"
  510. maxlength="500"
  511. show-word-limit
  512. ></el-input>
  513. </el-form-item>
  514. <el-form-item label="Project attachment:">
  515. <el-upload
  516. class="upload-demo"
  517. drag
  518. action="/api/file/upload/attachment?module=BaseProjectInfoForm&attachmentBusinessType=base_project_info"
  519. :on-change="handleChange"
  520. :on-success="handleAvatarSuccessAnnex"
  521. :on-preview="handlePreview"
  522. :headers="myHeaders"
  523. :on-remove="handleRemove"
  524. :before-upload="beforeUpload"
  525. :file-list="fileList"
  526. multiple
  527. >
  528. <i class="el-icon-upload"></i>
  529. <div class="el-upload__text">
  530. Drag the file here, or<em>Click upload</em>
  531. </div>
  532. <div class="el-upload__tip" slot="tip">
  533. Hint: Please upload the attachment of ZIP,PDF,DOC,DOCX,XLS and
  534. XLSX, The file cannot exceed 50MB
  535. </div>
  536. </el-upload>
  537. </el-form-item>
  538. <el-form-item label="Cover image:" style="position: relative">
  539. <el-upload
  540. class="avatar-uploader"
  541. action="/api/file/upload/attachment?module=BaseProjectInfoForm&attachmentBusinessType=base_project_info_banner"
  542. :show-file-list="false"
  543. :headers="myHeaders"
  544. :on-success="photoSuccess"
  545. >
  546. <!-- <img v-if="path != ''" :src="'/api/file/pub/'+path" class="avatar"> -->
  547. <img
  548. v-if="path != ''"
  549. :src="'/api/file/pub/' + path"
  550. class="avatar"
  551. />
  552. <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  553. <div
  554. slot="tip"
  555. class="el-upload__tip"
  556. style="display: inline-block; margin-left: 5px"
  557. >
  558. {{ $t("common.resourceHint")
  559. }}{{ $t("common.resourceUploadJPGPNG") }},{{
  560. $t("common.resourceFilesCannotExceed10Mb")
  561. }},{{ $t("common.resourceUploadOne") }}
  562. </div>
  563. </el-upload>
  564. </el-form-item>
  565. <el-form-item label="Disclose project to public:">
  566. <el-radio-group v-model="baseProjectView.messageOpenType">
  567. <el-radio
  568. :label="item.value"
  569. :key="item.value"
  570. v-for="(item, index) in isCreateNewUserEn"
  571. >{{ item.label }}</el-radio
  572. >
  573. </el-radio-group>
  574. </el-form-item>
  575. </el-form>
  576. </div>
  577. <div v-show="$i18n.locale == 'en'" style="height: 200px">
  578. <div style="margin-top: 100px">
  579. <el-button type="warning" style="margin-left: 300px" @click="save"
  580. >Save</el-button
  581. >
  582. <el-button type="primary" style="margin-left: 30px" @click="close"
  583. >Close</el-button
  584. >
  585. </div>
  586. </div>
  587. <div v-if="dialogVisible && $i18n.locale == 'en'">
  588. <userCenterAddTag
  589. v-bind:systemLabel="systemLabel"
  590. :mergeSelectedLabels="mergeSelectedLabels"
  591. @closeMain="closeMain"
  592. ></userCenterAddTag>
  593. </div>
  594. </div>
  595. </template>
  596. <script>
  597. import { regionDataPlus } from "element-china-area-data";
  598. import ue from "@/components/ue";
  599. import userCenterAddTag from "./userCenterAddTag";
  600. import Base from "@/views/base/Base";
  601. import { getDicts } from "@/api/dict";
  602. import {
  603. getTreeByLanguagePortal,
  604. getAllCountryAndCity,
  605. } from "@/api/operation/baseCityInformationDict";
  606. import {
  607. saveOrUpdate,
  608. getBaseProjectBizViewById,
  609. } from "@/api/project/baseProjectInfo";
  610. import { getToken, resetToken } from "@/utils/auth";
  611. import { searchFiles } from "@/api/file";
  612. import { addIntegral, addGrowth } from "@/utils/toCompleteTask";
  613. export default {
  614. name: "userCenteraddMaintenanceJournalInformations",
  615. extends: Base,
  616. components: {
  617. ue,
  618. userCenterAddTag,
  619. },
  620. data() {
  621. return {
  622. placehoders: "Please select",
  623. textareaMessaage:
  624. "项目描述可包含但不限于以下方面:\n" +
  625. "(一)项目意义\n" +
  626. "(二)项目方案\n" +
  627. "(三)项目进展\n" +
  628. "(四)当前需求\n" +
  629. " ...",
  630. textareaMessaageEn:
  631. "Please add project description that may include but not limited to the subjects such as:\n" +
  632. "1.Project significance\n" +
  633. "2.Project plan\n" +
  634. "3.Project progress\n" +
  635. "4.Project Demand\n" +
  636. " ...",
  637. fileList: [],
  638. myHeaders: { Authorization: "Bearer " + getToken() },
  639. isCreateNewUser: [
  640. { label: "是", value: "Y" },
  641. { label: "否(只对合作组织公开)", value: "N" },
  642. ],
  643. isCreateNewUserEn: [
  644. { label: "Yes", value: "Y" },
  645. { label: "No (Visible only to GEIDCO)", value: "N" },
  646. ],
  647. informationsClass: "1",
  648. dialogVisible: false,
  649. ifDiaslog: "",
  650. title: "",
  651. options: regionDataPlus,
  652. selectedOptions: [],
  653. systemLabel: [],
  654. mergeSelectedLabels: [],
  655. baseProjectView: {
  656. originalLanguageProjectName: "",
  657. englishLanguageProjectName: "",
  658. chineseLanguageProjectName: "",
  659. projectOwner: "",
  660. projectPartner: "",
  661. projectLabel: "",
  662. projectDescription: "",
  663. projectRequirements: "",
  664. region: "普通用户",
  665. date1: "2018-05-19",
  666. date3: "2018-05-19",
  667. date2: "2020-05-25 11:20:23",
  668. delivery: false,
  669. type: [],
  670. resource: "",
  671. desc: "",
  672. startData: "",
  673. id: this.$route.params.key,
  674. projectNum: "",
  675. projectName: "",
  676. projectConsultantId: "",
  677. setUpDate: new Date(),
  678. setDownDate: "",
  679. technicalCategories: "",
  680. technicalScope: "",
  681. phaseType: "",
  682. releaseStatus: "0",
  683. approveStatus: "",
  684. publishingChannels: "1",
  685. continentCountry: "",
  686. unitCountry: "",
  687. unitInfo: "",
  688. recommendFlag: "n",
  689. messageOpenType: "Y",
  690. status: "",
  691. childCount: "",
  692. entityZh: "",
  693. entityEn: "",
  694. entityFr: "",
  695. entityDe: "",
  696. entityEs: "",
  697. entityJa: "",
  698. entityAr: "",
  699. entityRu: "",
  700. createBy: "",
  701. createDate: new Date(),
  702. updateBy: "",
  703. updateDate: "",
  704. reserveOne: "",
  705. reserveTwo: "",
  706. reserveThree: "",
  707. reserveFour: "",
  708. reserveFive: "",
  709. },
  710. continentCountryDicts: [],
  711. unitCountryDicts: [],
  712. reserveOnes: [],
  713. technicalCategoriesDicts: [],
  714. technicalScopeDicts: [],
  715. phaseTypeDicts: [],
  716. languageDicts: [],
  717. imageUrl: "",
  718. form: {},
  719. files: [],
  720. imgList: [],
  721. path: "",
  722. user: {
  723. umsUser: {},
  724. },
  725. };
  726. },
  727. watch: {
  728. // "baseProjectView.continentCountry"() {
  729. // this.continentCountryDicts.forEach((i) => {
  730. // if (this.baseProjectView.continentCountry == i.value) {
  731. // this.unitCountryDicts = i.data;
  732. // }
  733. // });
  734. // },
  735. // "baseProjectView.unitCountry"() {
  736. // this.unitCountryDicts.forEach((i) => {
  737. // if (this.baseProjectView.unitCountry == i.value) {
  738. // this.reserveOnes= i.data;
  739. // }
  740. // })
  741. // },
  742. "$i18n.locale"() {
  743. this.initData();
  744. // this.getBaseProject();
  745. },
  746. },
  747. mounted() {
  748. this.initData();
  749. },
  750. computed: {
  751. englishFormRules() {
  752. return {
  753. // resultTheResourceType: [
  754. // { required: true, message: this.$i18n.locale=='zh'?'请选择资源类型':'Select the resource type', trigger: 'change' },
  755. // ],
  756. chineseLanguageProjectName: [
  757. {
  758. required: true,
  759. message: "please input chineseLanguageProjectName",
  760. trigger: "change",
  761. },
  762. ],
  763. projectOwner: [
  764. {
  765. required: true,
  766. message: "please input projectOwner",
  767. trigger: "change",
  768. },
  769. ],
  770. projectPartner: [
  771. {
  772. required: true,
  773. message: "please input projectPartner",
  774. trigger: "change",
  775. },
  776. ],
  777. continentCountry: [
  778. {
  779. required: true,
  780. message: "please select continentCountry",
  781. trigger: "change",
  782. },
  783. ],
  784. unitCountry: [
  785. {
  786. required: true,
  787. message: "please select unitCountry",
  788. trigger: "change",
  789. },
  790. ],
  791. technicalCategories: [
  792. {
  793. required: true,
  794. message: "please select technicalCategories",
  795. trigger: "change",
  796. },
  797. ],
  798. technicalScope: [
  799. {
  800. required: true,
  801. message: "please select technicalScope",
  802. trigger: "change",
  803. },
  804. ],
  805. phaseType: [
  806. {
  807. required: true,
  808. message: "please select phaseType",
  809. trigger: "change",
  810. },
  811. ],
  812. englishLanguageProjectName: [
  813. {
  814. required: true,
  815. message: "please input englishLanguageProjectName",
  816. trigger: "change",
  817. },
  818. ],
  819. };
  820. },
  821. chineseFormRules() {
  822. return {
  823. // resultTheResourceType: [
  824. // { required: true, message: this.$i18n.locale=='zh'?'请选择资源类型':'Select the resource type', trigger: 'change' },
  825. // ],
  826. chineseLanguageProjectName: [
  827. {
  828. required: true,
  829. message: "请输入项目名称(中文)",
  830. trigger: "change",
  831. },
  832. ],
  833. projectOwner: [
  834. { required: true, message: "请输入项目业主", trigger: "change" },
  835. ],
  836. projectPartner: [
  837. { required: true, message: "请输入项目合作方", trigger: "change" },
  838. ],
  839. continentCountry: [
  840. { required: true, message: "请选择大洲", trigger: "change" },
  841. ],
  842. unitCountry: [
  843. { required: true, message: "请选择国家", trigger: "change" },
  844. ],
  845. technicalCategories: [
  846. { required: true, message: "请选择项目门类", trigger: "change" },
  847. ],
  848. technicalScope: [
  849. { required: true, message: "请选择技术范围", trigger: "change" },
  850. ],
  851. phaseType: [
  852. { required: true, message: "请选择当前阶段", trigger: "change" },
  853. ],
  854. englishLanguageProjectName: [
  855. {
  856. required: true,
  857. message: "请输入项目名称(英文)",
  858. trigger: "change",
  859. },
  860. ],
  861. };
  862. },
  863. },
  864. methods: {
  865. initData() {
  866. this.user = JSON.parse(window.localStorage.getItem("user"));
  867. },
  868. searchFiles() {
  869. var _that = this;
  870. var file1 = {
  871. attachmentBusinessId: _that.baseProjectView.reserveFive,
  872. attachmentBusinessType: "base_project_info",
  873. };
  874. var file2 = {
  875. attachmentBusinessId: _that.baseProjectView.reserveFive,
  876. attachmentBusinessType: "base_project_info_banner",
  877. };
  878. _that.path = "";
  879. searchFiles(file2).then((result) => {
  880. _that.path = result.data.attachmentInfos[0].attachmentSavePath;
  881. });
  882. _that.fileList = [];
  883. searchFiles(file1).then((result) => {
  884. result.data.attachmentInfos.forEach((i) => {
  885. var fileTo = {
  886. name: i.attachmentName,
  887. url: i.attachmentSavePath,
  888. uid: i.id,
  889. };
  890. _that.fileList.push(fileTo);
  891. _that.files.push(i.id);
  892. console.log(_that.files + "_that.files");
  893. });
  894. });
  895. },
  896. initData() {
  897. var _that = this;
  898. var language = _that.$i18n.locale.toUpperCase();
  899. if (_that.baseProjectView.id != null) {
  900. getBaseProjectBizViewById(_that.baseProjectView.id, language).then(
  901. (result) => {
  902. _that.baseProjectView = result.data
  903. ? result.data.baseProjectBizView
  904. : {};
  905. _that.baseProjectView.continentCountry =
  906. _that.baseProjectView.continentCountry.split(",");
  907. _that.baseProjectView.unitCountry =
  908. _that.baseProjectView.unitCountry.split(",");
  909. _that.searchFiles();
  910. }
  911. );
  912. }
  913. _that.continentCountryDicts = [];
  914. _that.unitCountryDicts = [];
  915. var language = _that.$i18n.locale.toUpperCase();
  916. getAllCountryAndCity().then((result) => {
  917. var allCountry = result.data.allCountry;
  918. var unitCountryDictsValue = [];
  919. if (_that.$i18n.locale == "zh") {
  920. allCountry.forEach((i) => {
  921. var j = {};
  922. j.data = [];
  923. j.value = i.country_iso_code;
  924. j.label = i.country_name;
  925. unitCountryDictsValue.push(j);
  926. });
  927. _that.unitCountryDicts = unitCountryDictsValue;
  928. }
  929. if (_that.$i18n.locale == "en") {
  930. allCountry.forEach((i) => {
  931. var j = {};
  932. j.data = [];
  933. j.value = i.country_iso_code;
  934. j.label = i.country_name_en;
  935. unitCountryDictsValue.push(j);
  936. });
  937. _that.unitCountryDicts = unitCountryDictsValue;
  938. }
  939. }),
  940. getTreeByLanguagePortal(language).then((result) => {
  941. var keys = Object.keys(result.data);
  942. for (var i = 0; i < keys.length; i++) {
  943. _that.continentCountryDicts.push(result.data[keys[i]]);
  944. }
  945. });
  946. // getTreeByLanguagePortal(language).then(result => {
  947. // var keys = Object.keys(result.data);
  948. // _that.continentCountryDicts = [];
  949. // for(var i = 0;i < keys.length;i++){
  950. // _that.continentCountryDicts.push(result.data[keys[i]]);
  951. // }
  952. // if (_that.baseProjectView.continentCountry != null) {
  953. // _that.continentCountryDicts.forEach((i) => {
  954. // if (_that.baseProjectView.continentCountry == i.value) {
  955. // _that.unitCountryDicts = i.data;
  956. // }
  957. // });
  958. // }
  959. // if (_that.baseProjectView.unitCountry != null) {
  960. // _that.unitCountryDicts.forEach((i) => {
  961. // if (_that.baseProjectView.unitCountry == i.value) {
  962. // _that.reserveOnes= i.data;
  963. // }
  964. // })
  965. // }
  966. // })
  967. if (_that.$i18n.locale.toUpperCase() == "ZH") {
  968. getDicts(
  969. "PROJECT_CATEGORIES_DICT,TECHNICAL_SCOPE_DICT,PHASE_TYPE_DICT,LANGUAGE_DICT"
  970. ).then((result) => {
  971. var data = result.data;
  972. if (data) {
  973. _that.technicalCategoriesDicts = result.data[0] || [];
  974. _that.technicalScopeDicts = result.data[1] || [];
  975. _that.phaseTypeDicts = result.data[2] || [];
  976. _that.languageDicts = result.data[3] || [];
  977. }
  978. });
  979. }
  980. if (_that.$i18n.locale.toUpperCase() == "EN") {
  981. getDicts(
  982. "PROJECT_CATEGORIES_DICT_EN,TECHNICAL_SCOPE_DICT_EN,PHASE_TYPE_DICT_EN,LANGUAGE_DICT"
  983. ).then((result) => {
  984. var data = result.data;
  985. if (data) {
  986. _that.technicalCategoriesDicts = result.data[0] || [];
  987. _that.technicalScopeDicts = result.data[1] || [];
  988. _that.phaseTypeDicts = result.data[2] || [];
  989. _that.languageDicts = result.data[3] || [];
  990. }
  991. });
  992. }
  993. },
  994. // 下载文件方法file参数为已上传文件的信息,其实就是取得fileList里的值
  995. handlePreview(file, fileList) {
  996. document.location.href = "http://localhost:8080/api/file/pub/" + file.url;
  997. },
  998. handleRemove(file, fileList) {
  999. this.files.forEach((i) => {
  1000. if (i == file.uid) {
  1001. var index = this.files.indexOf(i);
  1002. this.files.splice(index, 1);
  1003. }
  1004. });
  1005. },
  1006. handleAvatarSuccessAnnex(res, file) {
  1007. this.files.push(res.data.attachmentId);
  1008. },
  1009. beforeUpload(file) {
  1010. var FileExt = file.name.replace(/.+\./, "");
  1011. if (
  1012. ["zip", "pdf", "doc", "docx", "excel", "xls", "xlsx"].indexOf(
  1013. FileExt.toLowerCase()
  1014. ) === -1
  1015. ) {
  1016. if (this.$i18n.locale.toUpperCase() == "ZH") {
  1017. this.$message({
  1018. type: "warning",
  1019. message: "请上传zip,pdf,word,excel的附件!",
  1020. });
  1021. } else {
  1022. this.$message({
  1023. type: "warning",
  1024. message:
  1025. "Please upload the attachment of zip, PDF, word and excel!",
  1026. });
  1027. }
  1028. this.fileList.splice(this.fileList.indexOf(file), 1);
  1029. return false;
  1030. }
  1031. this.isLt2k = file.size / 1024 / 1024 < 2 ? "1" : "0";
  1032. if (this.isLt2k === "0") {
  1033. if (this.$i18n.locale.toUpperCase() == "ZH") {
  1034. this.$message({
  1035. message: "上传文件大小不能超过2M!",
  1036. type: "error",
  1037. });
  1038. } else {
  1039. this.$message({
  1040. message: "Upload file size cannot exceed 2m!",
  1041. type: "error",
  1042. });
  1043. }
  1044. this.fileList.splice(this.fileList.indexOf(file), 1);
  1045. return false;
  1046. }
  1047. },
  1048. save: function () {
  1049. this.baseProjectView.reserveFour = this.$i18n.locale.toUpperCase();
  1050. this.baseProjectView.id = this.$route.params.key;
  1051. this.baseProjectView.updateDate = new Date();
  1052. if (this.baseProjectView.continentCountry) {
  1053. var continentCountry = "";
  1054. console.log("this.baseProjectView.continentCountry",this.baseProjectView.continentCountry)
  1055. this.baseProjectView.continentCountry.forEach((item) => {
  1056. continentCountry = continentCountry + item + ",";
  1057. });
  1058. this.baseProjectView.continentCountry = continentCountry;
  1059. }
  1060. if (this.baseProjectView.unitCountry) {
  1061. var unitCountry = "";
  1062. this.baseProjectView.unitCountry.forEach((item) => {
  1063. unitCountry = unitCountry + item + ",";
  1064. });
  1065. this.baseProjectView.unitCountry = unitCountry;
  1066. }
  1067. this.baseProjectView.continentCountry =
  1068. this.baseProjectView.continentCountry.substring(
  1069. this.baseProjectView.continentCountry.length - 1
  1070. ) == ","
  1071. ? this.baseProjectView.continentCountry.substring(
  1072. 0,
  1073. this.baseProjectView.continentCountry.length - 1
  1074. )
  1075. : this.baseProjectView.continentCountry;
  1076. this.baseProjectView.unitCountry =
  1077. this.baseProjectView.unitCountry.substring(
  1078. this.baseProjectView.unitCountry.length - 1
  1079. ) == ","
  1080. ? this.baseProjectView.unitCountry.substring(
  1081. 0,
  1082. this.baseProjectView.unitCountry.length - 1
  1083. )
  1084. : this.baseProjectView.unitCountry;
  1085. let token = getToken();
  1086. this.submitHandler((token) => {
  1087. saveOrUpdate(
  1088. JSON.stringify(this.baseProjectView),
  1089. JSON.stringify(Array.from(this.files)),
  1090. JSON.stringify(Array.from(this.imgList)),
  1091. token
  1092. )
  1093. .then((result) => {
  1094. if (this.user.umsUser.userUsertypeDict !== "2") {
  1095. addIntegral("point_task_upload_resources_project", "50");
  1096. addGrowth("point_task_upload_resources_project");
  1097. }
  1098. if (this.$i18n.locale.toUpperCase() == "ZH") {
  1099. alert("项目保存成功");
  1100. } else {
  1101. alert("Project saved successfully");
  1102. }
  1103. this.baseProjectView = {};
  1104. this.$router.go(-1); //返回上一层
  1105. })
  1106. .catch((error) => {
  1107. // 此处你的业务代码
  1108. this.resetToken();
  1109. });
  1110. });
  1111. },
  1112. close() {
  1113. this.$router.go(-1);
  1114. },
  1115. closeMain(val) {
  1116. this.mergeSelectedLabels = [];
  1117. val.forEach((element, index) => {
  1118. this.mergeSelectedLabels.push(element.label);
  1119. });
  1120. this.systemLabel = val;
  1121. this.baseProjectView.projectLabel = JSON.stringify(
  1122. this.mergeSelectedLabels
  1123. )
  1124. .replace(/\[|]/g, "")
  1125. .replace(/\"/g, "");
  1126. this.dialogVisible = false;
  1127. },
  1128. goAithentication(num) {
  1129. this.$router.go(-1); //返回上一层
  1130. },
  1131. handleChange(file, fileList) {
  1132. this.fileList = fileList.slice(-3);
  1133. },
  1134. photoSuccess(res, file) {
  1135. this.imgList = [];
  1136. this.path = res.data.path;
  1137. this.imgList.push(res.data.attachmentId);
  1138. },
  1139. dialogVisibles() {
  1140. this.dialogVisible = true;
  1141. },
  1142. // beforeAvatarUpload(file) {
  1143. // const isJPG = file.type === 'image/jpeg';
  1144. // const isLt2M = file.size / 1024 / 1024 < 2;
  1145. // if (!isJPG) {
  1146. // this.$message.error('上传头像图片只能是 JPG 格式!');
  1147. // }
  1148. // if (!isLt2M) {
  1149. // this.$message.error('上传头像图片大小不能超过 2MB!');
  1150. // }
  1151. // return isJPG && isLt2M;
  1152. // },
  1153. },
  1154. };
  1155. </script>
  1156. <style scoped>
  1157. .el-button {
  1158. width: 200px;
  1159. height: 45px;
  1160. }
  1161. .authenticationBox1 {
  1162. margin-left: 35px;
  1163. margin-right: 150px;
  1164. height: 100px;
  1165. border: 1px solid rgba(153, 153, 153, 1);
  1166. border-radius: 10px;
  1167. margin-top: 50px;
  1168. position: relative;
  1169. }
  1170. .authenticationBox2 {
  1171. margin: 50px 150px 0 35px;
  1172. height: 100px;
  1173. border: 1px solid rgba(153, 153, 153, 1);
  1174. border-radius: 10px;
  1175. position: relative;
  1176. }
  1177. .authenticationBox1:hover,
  1178. .authenticationBox2:hover {
  1179. border: 1px solid #ff8400;
  1180. }
  1181. .avatar-uploader .el-upload {
  1182. border: 1px dashed #d9d9d9;
  1183. border-radius: 6px;
  1184. cursor: pointer;
  1185. position: relative;
  1186. overflow: hidden;
  1187. }
  1188. .avatar-uploader .el-upload:hover {
  1189. border-color: #409eff;
  1190. }
  1191. .userCenterAuthenticationPersonal >>> .el-upload {
  1192. border: 1px solid rgba(204, 204, 204, 1);
  1193. }
  1194. .avatar-uploader-icon {
  1195. font-size: 28px;
  1196. color: #8c939d;
  1197. width: 178px;
  1198. height: 178px;
  1199. line-height: 178px;
  1200. text-align: center;
  1201. }
  1202. .avatar {
  1203. width: 178px;
  1204. height: 178px;
  1205. display: block;
  1206. }
  1207. /deep/.el-textarea__inner {
  1208. display: block;
  1209. resize: vertical;
  1210. padding: 5px 15px;
  1211. line-height: 3;
  1212. -webkit-box-sizing: border-box;
  1213. box-sizing: border-box;
  1214. width: 100%;
  1215. font-size: inherit;
  1216. color: #606266;
  1217. background-color: #fff;
  1218. background-image: none;
  1219. border: 1px solid #dcdfe6;
  1220. border-radius: 4px;
  1221. -webkit-transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
  1222. transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
  1223. }
  1224. /*.el-textarea/deep/::-webkit-input-placeholder {*/
  1225. /* color: red;*/
  1226. /*}*/
  1227. /*.el-textarea/deep/::-moz-input-placeholder {*/
  1228. /* color: red;*/
  1229. /*}*/
  1230. /*.el-textarea/deep/::-ms-input-placeholder {*/
  1231. /* color: red;*/
  1232. /*}*/
  1233. </style>