index.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24" class="main">
  5. <div class="w_1200">
  6. <el-col :span="24" class="one">
  7. <el-col :span="4" class="list" v-for="(item, index) in list" :key="index" @click.native="btn(item)">
  8. <el-col :span="24" class="name">
  9. <i class="iconfont" :class="item.icon"></i>
  10. <p>{{ item.name }}</p>
  11. </el-col>
  12. </el-col>
  13. </el-col>
  14. <el-col :span="24" class="two">
  15. <el-col :span="24" class="two_1">
  16. <el-col :span="12" class="left">
  17. <top topText="成果评价" @more="more(0)"></top>
  18. <achieve-frame :list="achieveList" @detail="achDetail"></achieve-frame>
  19. </el-col>
  20. <el-col :span="12" class="right">
  21. <top topText="科技需求" @more="more(1)"></top>
  22. <techol-frame :list="techolList" @detail="tecDetail"></techol-frame>
  23. </el-col>
  24. </el-col>
  25. <el-col :span="24" class="two_2">
  26. <el-image :src="imgUrl"></el-image>
  27. </el-col>
  28. <el-col :span="24" class="two_1">
  29. <el-col :span="12" class="left">
  30. <top topText="专利交易公告" @more="more(2)"></top>
  31. <trans-frame :list="transList" @detail="transDetail"></trans-frame>
  32. </el-col>
  33. <el-col :span="12" class="right">
  34. <top topText="专利导航" @more="more(3)"></top>
  35. <nav-frame :list="navList" @detail="navDetail"></nav-frame>
  36. </el-col>
  37. </el-col>
  38. <!-- <el-col :span="24" class="two_1 two_3" style="display:none">
  39. <el-col :span="24" class="left">
  40. <top topText="项目申报" @more="more(2)"></top>
  41. <project-frame :list="declareList" @detail="proDetail"></project-frame>
  42. </el-col>
  43. </el-col> -->
  44. </el-col>
  45. </div>
  46. </el-col>
  47. </el-row>
  48. <el-dialog :title="dialogInfo.name" class="dialog" :visible.sync="dialog" width="70%" :before-close="close">
  49. <info :type="dialogInfo.type"></info>
  50. <el-col :span="24" class="two" v-if="dialogInfo.type == '5'">
  51. <el-form :model="form2" :rules="rulesForm2" ref="form2" label-width="80px">
  52. <el-form-item label="用户账号" prop="institution_code">
  53. <el-input v-model="form2.institution_code" placeholder="请输入用户账号" maxlength="18"></el-input>
  54. </el-form-item>
  55. <el-form-item label="登录密码" prop="passwd">
  56. <el-input v-model="form2.password" placeholder="请输入登录密码" type="password" show-password></el-input>
  57. </el-form-item>
  58. <el-col :span="24" class="btn">
  59. <el-button type="primary" @click="onSubmit2('form2')">提交登录</el-button>
  60. </el-col>
  61. </el-form>
  62. </el-col>
  63. </el-dialog>
  64. </div>
  65. </template>
  66. <script>
  67. import info from './parts/info.vue';
  68. import top from './parts/top.vue';
  69. import achieveFrame from './index/achieve.vue';
  70. import techolFrame from './index/techol.vue';
  71. import projectFrame from './index/project.vue';
  72. import transFrame from './index/trans.vue';
  73. import navFrame from './index/nav.vue';
  74. import { mapState, createNamespacedHelpers } from 'vuex';
  75. const { mapActions: organization } = createNamespacedHelpers('organization');
  76. const { mapActions: achieveApply } = createNamespacedHelpers('achieveApply');
  77. const { mapActions: product } = createNamespacedHelpers('product');
  78. const { mapActions: declare } = createNamespacedHelpers('declare');
  79. const { mapActions: patenttrans } = createNamespacedHelpers('patenttrans');
  80. const { mapActions: patentnav } = createNamespacedHelpers('patentnav');
  81. export default {
  82. name: 'index',
  83. props: {},
  84. components: {
  85. info,
  86. top,
  87. achieveFrame,
  88. techolFrame,
  89. // projectFrame,
  90. transFrame,
  91. navFrame,
  92. },
  93. data: function() {
  94. return {
  95. list: [
  96. { icon: 'iconzhengji', name: '项目征集', type: '1' },
  97. { icon: 'iconwenjuan', name: '问卷调查', type: '2' },
  98. { icon: 'iconchengguo', name: '成果评价', type: '3' },
  99. { icon: 'iconinformation-delivery', name: '信息发布', type: '4' },
  100. { icon: 'iconshenbao', name: '高企申报', type: '5' },
  101. { icon: 'iconyuyuefuwu', name: '预约服务', type: '6' },
  102. ],
  103. dialogInfo: {},
  104. dialog: false,
  105. form2: {},
  106. rulesForm2: {},
  107. // 公共信息
  108. imgUrl: require('@common/src/assets/center/cxfw.png'),
  109. // 成果评价
  110. achieveList: [],
  111. // 科技需求
  112. techolList: [],
  113. // 项目申报
  114. declareList: [],
  115. // 专利交易公告
  116. transList: [],
  117. // 专利导航
  118. navList: [],
  119. };
  120. },
  121. created() {
  122. this.search();
  123. },
  124. methods: {
  125. ...organization(['orgLogin', 'fetch']),
  126. ...achieveApply(['query']),
  127. ...product({ productQuery: 'query' }),
  128. ...declare({ declareQuery: 'query' }),
  129. ...patenttrans({ patenttransQuery: 'query' }),
  130. ...patentnav({ patentnavQuery: 'query' }),
  131. // 查询列表
  132. async search({ skip = 0, limit = 10, ...info } = {}) {
  133. let res = await this.query({ skip, limit: 5, status: '7', ...info });
  134. if (this.$checkRes(res)) {
  135. this.$set(this, `achieveList`, res.data);
  136. }
  137. res = await this.productQuery({ skip, limit: 6, type: '0', status: '2', ...info });
  138. if (this.$checkRes(res)) {
  139. this.$set(this, `techolList`, res.data);
  140. }
  141. res = await this.declareQuery({ skip, limit: 6, is_cashing: '1', ...info });
  142. if (this.$checkRes(res)) {
  143. this.$set(this, `declareList`, res.data);
  144. }
  145. // 专利交易公告
  146. res = await this.patenttransQuery({ skip, limit: 5, status: '4', ...info });
  147. if (this.$checkRes(res)) {
  148. this.$set(this, `transList`, res.data);
  149. }
  150. // 专利导航
  151. res = await this.patentnavQuery({ skip, limit: 8, is_show: true, ...info });
  152. if (this.$checkRes(res)) {
  153. this.$set(this, `navList`, res.data);
  154. }
  155. },
  156. // 打开弹框
  157. btn(data) {
  158. if (data.type == '1') {
  159. this.$router.push({ path: '/twoweb/service/project' });
  160. } else if (data.type == '2') {
  161. this.$router.push({ path: '/twoweb/service/question' });
  162. } else if (data.type == '4') {
  163. this.$router.push({ path: '/twoweb/service/product' });
  164. } else if (data.type == '6') {
  165. this.$router.push({ path: '/twoweb/service/order' });
  166. } else {
  167. this.$set(this, `dialogInfo`, data);
  168. this.dialog = true;
  169. }
  170. },
  171. // 关闭弹框
  172. close() {
  173. this.dialog = false;
  174. },
  175. // 提交登录
  176. onSubmit2(formName) {
  177. this.$refs[formName].validate(async valid => {
  178. if (valid) {
  179. let data = this.form2;
  180. const res = await this.orgLogin({ user: data });
  181. if (this.$checkRes(res)) {
  182. if (this.dialogInfo.type === '5') this.$router.push({ path: '/twoweb/service/policy' });
  183. }
  184. } else {
  185. console.log('error submit!!');
  186. return false;
  187. }
  188. });
  189. },
  190. // 更多
  191. more(index) {
  192. this.$router.push({ path: '/twoweb/service/list', query: { index: index } });
  193. },
  194. // 成果评价详情
  195. achDetail(data) {
  196. this.$router.push({ path: '/twoweb/service/list', query: { index: 0, id: data.id } });
  197. },
  198. // 科技需求详情
  199. tecDetail(data) {
  200. this.$router.push({ path: '/twoweb/service/list', query: { index: 1, id: data.id } });
  201. },
  202. // // 项目申报
  203. // proDetail(data) {
  204. // this.$router.push({ path: '/twoweb/service/list', query: { index: 2, id: data._id } });
  205. // },
  206. // 专利交易公告
  207. transDetail(data) {
  208. // this.$router.push({ path: '/twoweb/service/list', query: { index: 2, id: data._id } });
  209. },
  210. // 专利导航
  211. navDetail(data) {
  212. this.$router.push({ path: '/twoweb/service/list', query: { index: 3, id: data._id } });
  213. },
  214. },
  215. computed: {
  216. ...mapState(['user']),
  217. },
  218. metaInfo() {
  219. return { title: this.$route.meta.title };
  220. },
  221. watch: {
  222. test: {
  223. deep: true,
  224. immediate: true,
  225. handler(val) {},
  226. },
  227. },
  228. };
  229. </script>
  230. <style lang="less" scoped>
  231. .main {
  232. padding: 10px 0;
  233. .one {
  234. margin: 0 0 20px 0;
  235. .list {
  236. width: 15.9%;
  237. height: 140px;
  238. margin: 0 10px 0px 0;
  239. text-align: center;
  240. padding: 30px 0;
  241. border-radius: 5px;
  242. box-shadow: 0 0 5px #409eff;
  243. .name {
  244. .iconfont {
  245. font-size: 40px;
  246. }
  247. p {
  248. font-size: 16px;
  249. font-weight: bold;
  250. margin: 10px 0 0 0;
  251. }
  252. }
  253. }
  254. .list:last-child {
  255. margin: 0 0 0 0;
  256. }
  257. .list:hover {
  258. cursor: pointer;
  259. .name {
  260. p {
  261. color: #6495ed;
  262. }
  263. }
  264. }
  265. }
  266. .two {
  267. .two_1 {
  268. margin: 0 0 10px 0;
  269. .left {
  270. width: 49%;
  271. min-height: 530px;
  272. background: #ffffff;
  273. padding: 15px;
  274. border-radius: 20px;
  275. margin: 0 24px 0 0;
  276. box-shadow: 0 0 5px #409eff;
  277. }
  278. .right {
  279. width: 49%;
  280. min-height: 530px;
  281. background: #ffffff;
  282. border-radius: 20px;
  283. padding: 15px;
  284. box-shadow: 0 0 5px #409eff;
  285. }
  286. }
  287. .two_2 {
  288. height: 140px;
  289. overflow: hidden;
  290. margin: 0 0 10px 0;
  291. }
  292. .two_3 {
  293. .left {
  294. width: 100%;
  295. }
  296. }
  297. }
  298. }
  299. .dialog {
  300. .two {
  301. height: 200px;
  302. background: #fff;
  303. padding: 10px 20%;
  304. .btn {
  305. text-align: center;
  306. padding: 10px 0;
  307. }
  308. }
  309. /deep/.el-dialog__body {
  310. padding: 0;
  311. }
  312. }
  313. </style>