marketlists.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. <template>
  2. <div id="marketlists">
  3. <el-row>
  4. <el-col :span="24" class="main">
  5. <div class="w_1200">
  6. <el-col :span="5" class="menu">
  7. <el-image :src="squareImage"></el-image>
  8. <span class="menuTitle">Menu</span>
  9. <el-col :span="24" class="menuList" v-for="(item, index) in menuList" :key="index">
  10. <p @click="changeMenu(item.name, index)" :style="`color:${menuIndex == index ? menuColor : ''}`">{{ item.name }}</p>
  11. </el-col>
  12. </el-col>
  13. <el-col :span="19" class="listInfo">
  14. <span v-if="display == 'list'">
  15. <el-col :span="24">
  16. <span v-if="column_name == '技术成果'">
  17. <achieve
  18. :achieveList="achieveList"
  19. :column_name="column_name"
  20. :total="achieveTotal"
  21. @clickDetail="clickDetail"
  22. @searchData="searchData"
  23. @changeCom="changeCom"
  24. :dropList="dropList"
  25. ></achieve>
  26. </span>
  27. <span v-else-if="column_name == 'e专利'">
  28. <patent :patentList="patentList" :column_name="column_name" :total="patentTotal" @clickDetail="clickDetail" @searchData="searchData"></patent>
  29. </span>
  30. <span v-else-if="column_name == '商务服务'">
  31. <business
  32. :businessList="businessList"
  33. :column_name="column_name"
  34. :total="businessTotal"
  35. @clickDetail="clickDetail"
  36. @searchData="searchData"
  37. ></business>
  38. </span>
  39. <span v-else-if="column_name == '专家智库'">
  40. <expert
  41. :expertList="expertList"
  42. :column_name="column_name"
  43. :total="expertTotal"
  44. @clickDetail="clickDetail"
  45. @searchData="searchData"
  46. @changeExpertCom="changeExpertCom"
  47. :dropList="expertdropList"
  48. ></expert>
  49. </span>
  50. <span v-else-if="column_name == '科技需求'">
  51. <technology
  52. :technologyList="technologyList"
  53. :column_name="column_name"
  54. :total="technologyTotal"
  55. @clickDetail="clickDetail"
  56. @searchData="searchData"
  57. ></technology>
  58. </span>
  59. <span v-else-if="column_name == '项目路演'">
  60. <roadshow
  61. :roadshowList="roadshowList"
  62. :column_name="column_name"
  63. :total="roadshowTotal"
  64. @clickDetail="clickDetail"
  65. @searchData="searchData"
  66. ></roadshow>
  67. </span>
  68. </el-col>
  69. </span>
  70. <span v-else>
  71. <span v-if="column_name == '技术成果'">
  72. <el-col :span="24" style="text-align:right;">
  73. <el-button type="primary" size="mini" @click="display = 'list'">返回</el-button>
  74. </el-col>
  75. <el-col :span="24">
  76. <achiDetail :detailInfo="achiDetail" @onSubmit="techSubmit" :displayBtn="displayBtn"></achiDetail>
  77. </el-col>
  78. </span>
  79. <span v-else-if="column_name == 'e专利'">
  80. <el-col :span="24" style="text-align:right;">
  81. <el-button type="primary" size="mini" @click="display = 'list'">返回</el-button>
  82. </el-col>
  83. <el-col :span="24">
  84. <patentDetail :detailInfo="patentDetail"></patentDetail>
  85. </el-col>
  86. </span>
  87. <span v-else-if="column_name == '商务服务'">
  88. <el-col :span="24" style="text-align:right;">
  89. <el-button type="primary" size="mini" @click="display = 'list'">返回</el-button>
  90. </el-col>
  91. <el-col :span="24">
  92. <busiDetail :detailInfo="busiDetail" @onSubmit="techSubmit" :displayBtn="displayBtn"></busiDetail>
  93. </el-col>
  94. </span>
  95. <span v-else-if="column_name == '专家智库'">
  96. <el-col :span="24" style="text-align:right;">
  97. <el-button type="primary" size="mini" @click="display = 'list'">返回</el-button>
  98. </el-col>
  99. <el-col :span="24">
  100. <expeDetail :detailInfo="expeDetail" @onSubmit="expertSuubmit" :displayBtn="displayBtn"></expeDetail>
  101. </el-col>
  102. </span>
  103. <span v-else-if="column_name == '科技需求'">
  104. <el-col :span="24" style="text-align:right;">
  105. <el-button type="primary" size="mini" @click="display = 'list'">返回</el-button>
  106. </el-col>
  107. <el-col :span="24">
  108. <techDetail :detailInfo="techDetail" @onSubmit="techSubmit" :displayBtn="displayBtn"></techDetail>
  109. </el-col>
  110. </span>
  111. <span v-else-if="column_name == '项目路演'">
  112. <el-col :span="24" style="text-align:right;">
  113. <el-button type="primary" size="mini" @click="display = 'list'">返回</el-button>
  114. </el-col>
  115. <el-col :span="24">
  116. <roadDetail :detailInfo="roadDetail"></roadDetail>
  117. </el-col>
  118. </span>
  119. </span>
  120. </el-col>
  121. </div>
  122. </el-col>
  123. </el-row>
  124. </div>
  125. </template>
  126. <script>
  127. // 列表
  128. import achieve from './list/achieve.vue';
  129. import patent from './list/patent.vue';
  130. import business from './list/business.vue';
  131. import expert from './list/expert.vue';
  132. import technology from './list/technology.vue';
  133. import roadshow from './list/roadshow.vue';
  134. // 详情
  135. import achiDetail from './detail/achiDetail.vue';
  136. import patentDetail from './detail/patentDetail.vue';
  137. import busiDetail from './detail/busiDetail.vue';
  138. import expeDetail from './detail/expeDetail.vue';
  139. import techDetail from './detail/techDetail.vue';
  140. import roadDetail from './detail/roadDetail.vue';
  141. import { mapState, createNamespacedHelpers } from 'vuex';
  142. const { mapActions: product } = createNamespacedHelpers('marketproduct');
  143. const { mapActions: patents } = createNamespacedHelpers('patent');
  144. const { mapActions: expertsuser } = createNamespacedHelpers('expertsuser');
  145. const { mapActions: transaction } = createNamespacedHelpers('transaction');
  146. const { mapActions: markettype } = createNamespacedHelpers('markettype');
  147. const { mapActions: newsroadshow } = createNamespacedHelpers('newsroadshow');
  148. import _ from 'lodash';
  149. export default {
  150. metaInfo() {
  151. return { title: this.$route.meta.title };
  152. },
  153. name: 'marketlists',
  154. props: {},
  155. components: {
  156. // 技术成果
  157. achieve,
  158. achiDetail,
  159. // e专利
  160. patent,
  161. patentDetail,
  162. // 商务服务
  163. business,
  164. busiDetail,
  165. // 专家智库
  166. expert,
  167. expeDetail,
  168. // 科技需求
  169. technology,
  170. techDetail,
  171. // 项目路演
  172. roadshow,
  173. roadDetail,
  174. },
  175. data: function() {
  176. return {
  177. squareImage: require('@/assets/live/square_big.png'),
  178. // 菜单
  179. menuList: [{ name: '技术成果' }, { name: 'e专利' }, { name: '商务服务' }, { name: '专家智库' }, { name: '科技需求' }, { name: '项目路演' }],
  180. menuIndex: '0',
  181. menuColor: 'rgb(254, 149, 14)',
  182. display: 'list',
  183. // 右侧头部栏目
  184. column_name: '技术成果',
  185. // 搜索
  186. infoName: '',
  187. // 技术成果
  188. // 原数组
  189. priAchieve: [],
  190. priAchieveTotal: 0,
  191. // 显示数组
  192. achieveList: [],
  193. achieveTotal: 0,
  194. achiDetail: {},
  195. // 其他单位列表
  196. dropList: [],
  197. // e专利
  198. patentList: [],
  199. patentTotal: 0,
  200. patentDetail: {},
  201. // 商务服务
  202. businessList: [],
  203. businessTotal: 0,
  204. busiDetail: {},
  205. // 专家信息
  206. // 原数组
  207. priExpert: [],
  208. priExpertTotal: 0,
  209. expertList: [],
  210. expertTotal: 0,
  211. expeDetail: {},
  212. // 单位列表
  213. expertdropList: [],
  214. // 显示按钮
  215. displayBtn: true,
  216. // 科技需求
  217. technologyList: [],
  218. technologyTotal: 0,
  219. techDetail: {},
  220. // 项目路演
  221. roadshowList: [],
  222. roadshowTotal: 0,
  223. roadDetail: {},
  224. };
  225. },
  226. async created() {
  227. await this.searchColumn();
  228. await this.searchCom();
  229. },
  230. methods: {
  231. ...product({ productList: 'newquery', productFetch: 'newfetch' }),
  232. ...patents({ patentQuery: 'query', patentFetch: 'fetch' }),
  233. ...expertsuser({ expertsuserList: 'query', expertsuserFetch: 'fetch' }),
  234. ...transaction({ transactioncreate: 'create', transactionfetch: 'fetch' }),
  235. ...markettype({ markettypeList: 'query' }),
  236. ...newsroadshow({ adshowQuery: 'query', adshowFetch: 'fetch' }),
  237. // 查询栏目,列表,详情
  238. async searchColumn() {
  239. if (this.type == 1) {
  240. this.changeMenu(this.columnName, 0);
  241. } else if (this.type == 5) {
  242. this.changeMenu(this.columnName, 1);
  243. } else if (this.type == 2) {
  244. this.changeMenu(this.columnName, 2);
  245. } else if (this.type == 3) {
  246. this.changeMenu(this.columnName, 3);
  247. } else if (this.type == 0) {
  248. this.changeMenu(this.columnName, 4);
  249. } else if (this.type == 4) {
  250. this.changeMenu(this.columnName, 5);
  251. }
  252. if (this.id) {
  253. this.display = 'detail';
  254. // 查看详情
  255. this.searchDetail(this.columnName, this.id);
  256. } else {
  257. this.display = 'list';
  258. }
  259. },
  260. // 选择菜单
  261. changeMenu(columnName, index) {
  262. this.display = 'list';
  263. this.column_name = columnName;
  264. this.menuIndex = index;
  265. this.menuColor = 'rgb(254, 149, 14)';
  266. this.searchInfo({ columnName });
  267. },
  268. // 查看列表
  269. async searchInfo({ skip = 0, limit = 10, columnName, name, ...info } = {}) {
  270. if (name) info.name = name;
  271. if (columnName == '技术成果') {
  272. let res = await this.productList({ skip, limit, type: '1', status: '1', ...info });
  273. if (this.$checkRes(res)) this.$set(this, `priAchieve`, res.data);
  274. this.$set(this, `priAchieveTotal`, res.total);
  275. this.$set(this, `achieveList`, res.data);
  276. this.$set(this, `achieveTotal`, res.total);
  277. } else if (columnName == 'e专利') {
  278. console.log('e专利');
  279. } else if (columnName == '商务服务') {
  280. let res = await this.productList({ skip, type: '2', status: '1', ...info });
  281. if (this.$checkRes(res)) this.$set(this, `businessList`, res.data);
  282. this.$set(this, `businessTotal`, res.total);
  283. } else if (columnName == '专家智库') {
  284. let res = await this.expertsuserList({ skip, ...info });
  285. if (this.$checkRes(res)) this.$set(this, `priExpert`, res.data);
  286. this.$set(this, `priExpertTotal`, res.total);
  287. this.$set(this, `expertList`, res.data);
  288. this.$set(this, `expertTotal`, res.total);
  289. } else if (columnName == '科技需求') {
  290. let res = await this.productList({ skip, type: '0', status: '1', ...info });
  291. if (this.$checkRes(res)) this.$set(this, `technologyList`, res.data);
  292. this.$set(this, `technologyTotal`, res.total);
  293. } else if (columnName == '项目路演') {
  294. let res = await this.adshowQuery({ skip: 0, ...info });
  295. let data = _.uniqBy(res.data, 'title');
  296. if (this.$checkRes(res)) this.$set(this, `roadshowList`, data);
  297. this.$set(this, `roadshowTotal`, data.length);
  298. }
  299. },
  300. // 点击查看详情
  301. clickDetail({ column_name, id }) {
  302. this.$set(this, `column_name`, column_name);
  303. this.display = 'detail';
  304. this.searchDetail(column_name, id);
  305. },
  306. // 查看详情
  307. async searchDetail(columnName, id) {
  308. if (columnName == '技术成果') {
  309. let res = await this.productFetch(id);
  310. if (this.$checkRes(res)) this.$set(this, `achiDetail`, res.data);
  311. } else if (columnName == 'e专利') {
  312. let res = await this.patentFetch(id);
  313. // res.data.inventor = '朱妍; 朱叶; 于翠萍; 方琳; 周婷婷; 李慧超; 张海彬; 王冬; 郑海筝; 岳红';
  314. if (this.$checkRes(res)) this.$set(this, `patentDetail`, res.data);
  315. } else if (columnName == '商务服务') {
  316. let res = await this.productFetch(id);
  317. if (this.$checkRes(res)) this.$set(this, `busiDetail`, res.data);
  318. } else if (columnName == '专家智库') {
  319. let res = await this.expertsuserFetch(id);
  320. if (this.$checkRes(res)) this.$set(this, `expeDetail`, res.data);
  321. } else if (columnName == '科技需求') {
  322. let res = await this.productFetch(id);
  323. if (this.$checkRes(res)) this.$set(this, `techDetail`, res.data);
  324. } else if (columnName == '项目路演') {
  325. let res = await this.adshowFetch(id);
  326. console.log(res);
  327. if (this.$checkRes(res)) this.$set(this, `roadDetail`, res.data);
  328. }
  329. },
  330. // 名字查询
  331. searchData({ name, columnName }) {
  332. this.searchInfo({ columnName, name });
  333. },
  334. // 查询成果单位,专家工作单位
  335. async searchCom() {
  336. // 成果单位
  337. let res = await this.markettypeList({ category: '05' });
  338. if (this.$checkRes(res)) {
  339. let newRes = res.data;
  340. newRes.push({ name: '其他' });
  341. this.$set(this, `dropList`, newRes);
  342. }
  343. // 专家工作单位
  344. res = await this.markettypeList({ category: '06' });
  345. if (this.$checkRes(res)) {
  346. let newRes = res.data;
  347. newRes.push({ name: '其他' });
  348. this.$set(this, `expertdropList`, newRes);
  349. }
  350. },
  351. // 成果选择单位
  352. async changeCom(data) {
  353. if (data) {
  354. if (data == '中科系') {
  355. let newRes = this.priAchieve.filter(
  356. i =>
  357. i.company == '中科院长春分院' ||
  358. i.company == '中国科学院东北地理与农业生态研究所' ||
  359. i.company == '中国科学院长春应用化学研究所' ||
  360. i.company == '中科院长春光学精密机械与物理研究所'
  361. );
  362. this.$set(this, `achieveList`, newRes);
  363. this.$set(this, `achieveTotal`, newRes.length);
  364. } else if (data == '其他') {
  365. let newRes = this.priAchieve.filter(
  366. i =>
  367. i.company != '中科院长春分院' &&
  368. i.company != '中国科学院东北地理与农业生态研究所' &&
  369. i.company != '中国科学院长春应用化学研究所' &&
  370. i.company != '中科院长春光学精密机械与物理研究所' &&
  371. i.company != '吉林大学' &&
  372. i.company != '长春工业大学'
  373. );
  374. this.$set(this, `achieveList`, newRes);
  375. this.$set(this, `achieveTotal`, newRes.length);
  376. } else {
  377. let newRes = this.priAchieve.filter(f => f.company.includes(data));
  378. if (newRes) {
  379. this.$set(this, `achieveList`, newRes);
  380. this.$set(this, `achieveTotal`, newRes.length);
  381. }
  382. }
  383. } else {
  384. this.$set(this, `achieveList`, this.priAchieve);
  385. this.$set(this, `achieveTotal`, this.priAchieve.length);
  386. }
  387. },
  388. // 专家选择单位
  389. async changeExpertCom(data) {
  390. if (data) {
  391. if (data == '中科系') {
  392. let newRes = this.priExpert.filter(
  393. i =>
  394. i.company == '中科院长春分院' ||
  395. i.company == '中国科学院东北地理与农业生态研究所' ||
  396. i.company == '中国科学院长春应用化学研究所' ||
  397. i.company == '中科院长春光学精密机械与物理研究所'
  398. );
  399. this.$set(this, `expertList`, newRes);
  400. this.$set(this, `expertTotal`, newRes.length);
  401. } else if (data == '其他') {
  402. let newRes = this.priExpert.filter(
  403. i =>
  404. i.company != '中科院长春分院' &&
  405. i.company != '中国科学院东北地理与农业生态研究所' &&
  406. i.company != '中国科学院长春应用化学研究所' &&
  407. i.company != '中科院长春光学精密机械与物理研究所' &&
  408. i.company != '吉林大学' &&
  409. i.company != '长春工业大学' &&
  410. i.company != '长春工程学院'
  411. );
  412. this.$set(this, `expertList`, newRes);
  413. this.$set(this, `expertTotal`, newRes.length);
  414. } else {
  415. let newRes = this.priExpert.filter(f => f.company.includes(data));
  416. if (newRes) {
  417. this.$set(this, `expertList`, newRes);
  418. this.$set(this, `expertTotal`, newRes.length);
  419. }
  420. }
  421. } else {
  422. this.$set(this, `expertList`, this.priExpert);
  423. this.$set(this, `expertTotal`, this.priExpert.legnth);
  424. }
  425. },
  426. // 科技需求,技术成果,商务服务洽谈
  427. async techSubmit({ data }) {
  428. let form = {
  429. userid: this.user.uid,
  430. username: this.user.name,
  431. product_id: data.id,
  432. product_name: data.name,
  433. market_userid: data.userid,
  434. market_username: data.contacts,
  435. status: '0',
  436. };
  437. if (!this.user.uid) {
  438. this.$message({
  439. dangerouslyUseHTMLString: true,
  440. message: '<strong><a href="http://broadcast.waityou24.cn/platlive/webLogin" style="color:red;">游客身份无法与卖家对话,请先注册</a></strong>',
  441. type: 'error',
  442. });
  443. return;
  444. } else {
  445. let res = await this.transactioncreate(form);
  446. this.$checkRes(res, '购买申请成功', res.errmsg || '购买申请失败');
  447. }
  448. },
  449. // 专家智库
  450. async expertSuubmit({ data }) {
  451. let form = {
  452. userid: this.user.uid,
  453. username: this.user.name,
  454. product_id: data.id,
  455. product_name: data.name,
  456. market_userid: data.id,
  457. market_username: data.name,
  458. status: '0',
  459. type: '1',
  460. };
  461. if (!this.user.uid) {
  462. // this.$message.error('游客身份无法与卖家对话,请先注册');
  463. this.$message({
  464. dangerouslyUseHTMLString: true,
  465. message: '<strong><a href="http://broadcast.waityou24.cn/platlive/webLogin" style="color:red;">游客身份无法与卖家对话,请先注册</a></strong>',
  466. type: 'error',
  467. });
  468. return;
  469. } else {
  470. let res = await this.transactioncreate(form);
  471. this.$checkRes(res, '购买申请成功', res.errmsg || '购买申请失败');
  472. }
  473. },
  474. },
  475. computed: {
  476. ...mapState(['user']),
  477. type() {
  478. return this.$route.query.type;
  479. },
  480. columnName() {
  481. return this.$route.query.column_name;
  482. },
  483. id() {
  484. return this.$route.query.id;
  485. },
  486. },
  487. watch: {},
  488. };
  489. </script>
  490. <style lang="less" scoped>
  491. .main {
  492. min-height: 500px;
  493. padding: 10px 0;
  494. .menu {
  495. height: 600px;
  496. overflow: hidden;
  497. padding: 15px 10px;
  498. background: no-repeat 100% 100%;
  499. background-image: url('~@/assets/live/menu_back.jpg');
  500. box-sizing: border-box;
  501. box-shadow: 0 0 10px #bbbaba;
  502. .menuTitle {
  503. font-size: 24px;
  504. color: #92959a;
  505. font-weight: bold;
  506. position: relative;
  507. top: -10px;
  508. left: 10px;
  509. }
  510. .menuList {
  511. height: 60px;
  512. line-height: 60px;
  513. border-bottom: 1px solid #2d64b3;
  514. p {
  515. font-weight: bold;
  516. font-size: 18px;
  517. color: #044b79;
  518. }
  519. }
  520. .menuList:hover {
  521. cursor: pointer;
  522. }
  523. }
  524. .listInfo {
  525. float: right;
  526. width: 78%;
  527. min-height: 600px;
  528. overflow: hidden;
  529. box-shadow: 0 0 10px #2d64b3;
  530. padding: 10px;
  531. }
  532. }
  533. </style>