expertInfo.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <div id="expertInfo">
  3. <el-row>
  4. <el-col :span="24" class="main">
  5. <el-col :span="24" class="one">
  6. <el-col :span="24" class="top">
  7. <el-col :span="6" class="left">
  8. <el-image v-if="form.img_path != null || undefined" :src="form.img_path" style="width:100%;height:220px;"></el-image>
  9. <el-image v-else :src="img_url" style="width:100%;height:220px;"></el-image>
  10. </el-col>
  11. <el-col :span="18" class="right">
  12. <el-col :span="24" class="name textOver">
  13. {{ form.name || '暂无' }}
  14. </el-col>
  15. <el-col :span="24">
  16. <el-col :span="4" class="otherInfo textOver">
  17. 工作单位
  18. </el-col>
  19. <el-col :span="20" class="otherInfo textOver">
  20. {{ form.company || '暂无' }}
  21. </el-col>
  22. </el-col>
  23. <el-col :span="12">
  24. <el-col :span="8" class="otherInfo textOver">
  25. 毕业院校
  26. </el-col>
  27. <el-col :span="16" class="otherInfo textOver">
  28. {{ form.school || '暂无' }}
  29. </el-col>
  30. </el-col>
  31. <el-col :span="12">
  32. <el-col :span="8" class="otherInfo textOver">
  33. 最高学历
  34. </el-col>
  35. <el-col :span="16" class="otherInfo textOver">
  36. {{ form.education || '暂无' }}
  37. </el-col>
  38. </el-col>
  39. <el-col :span="12">
  40. <el-col :span="8" class="otherInfo textOver">
  41. 出生日期
  42. </el-col>
  43. <el-col :span="16" class="otherInfo textOver">
  44. {{ form.birthDate || '暂无' }}
  45. </el-col>
  46. </el-col>
  47. <el-col :span="12">
  48. <el-col :span="8" class="otherInfo textOver">
  49. 职务职称
  50. </el-col>
  51. <el-col :span="16" class="otherInfo textOver">
  52. {{ form.zwzc || '暂无' }}
  53. </el-col>
  54. </el-col>
  55. <el-col :span="12">
  56. <el-col :span="8" class="otherInfo textOver">
  57. 电子邮箱
  58. </el-col>
  59. <el-col :span="16" class="otherInfo textOver">
  60. {{ form.email || '暂无' }}
  61. </el-col>
  62. </el-col>
  63. <el-col :span="12">
  64. <el-col :span="8" class="otherInfo textOver">
  65. 擅长领域
  66. </el-col>
  67. <el-col :span="16" class="otherInfo textOver">
  68. {{ form.expertise || '暂无' }}
  69. </el-col>
  70. </el-col>
  71. </el-col>
  72. </el-col>
  73. <el-col :span="24" class="down">
  74. <el-col :span="24" class="downInfo">
  75. <el-col :span="4" class="tit">
  76. <h2>工作经历</h2>
  77. </el-col>
  78. <el-col :span="20" class="info">
  79. {{ form.workexperience || '暂无' }}
  80. </el-col>
  81. </el-col>
  82. <el-col :span="24" class="downInfo">
  83. <el-col :span="4" class="tit">
  84. <h2>科研综述</h2>
  85. </el-col>
  86. <el-col :span="20" class="info">
  87. {{ form.scientific || '暂无' }}
  88. </el-col>
  89. </el-col>
  90. <el-col :span="24" class="downInfo">
  91. <el-col :span="4" class="tit">
  92. <h2>承担项目</h2>
  93. </el-col>
  94. <el-col :span="20" class="info">
  95. {{ form.undertakingproject || '暂无' }}
  96. </el-col>
  97. </el-col>
  98. <el-col :span="24" class="downInfo">
  99. <el-col :span="4" class="tit">
  100. <h2>科技奖励</h2>
  101. </el-col>
  102. <el-col :span="20" class="info">
  103. {{ form.scienceaward || '暂无' }}
  104. </el-col>
  105. </el-col>
  106. <el-col :span="24" class="downInfo">
  107. <el-col :span="4" class="tit">
  108. <h2>社会任职</h2>
  109. </el-col>
  110. <el-col :span="20" class="info">
  111. {{ form.social || '暂无' }}
  112. </el-col>
  113. </el-col>
  114. </el-col>
  115. </el-col>
  116. <el-col :span="24" class="btn" v-if="showBtn">
  117. <el-button type="primary" size="mini" @click="btnPhone()">交流洽谈</el-button>
  118. <el-button type="success" size="mini" @click="onSubmit()">供求对接</el-button>
  119. </el-col>
  120. </el-col>
  121. </el-row>
  122. <el-dialog title="对接" :visible.sync="dialogTableVisible" destroy-on-close>
  123. <chat :room="room"></chat>
  124. </el-dialog>
  125. </div>
  126. </template>
  127. <script>
  128. import chat from '@c/chat.vue';
  129. const _ = require('lodash');
  130. import { mapState, createNamespacedHelpers } from 'vuex';
  131. const { mapActions: personRoom } = createNamespacedHelpers('personRoom');
  132. const { mapActions: transaction } = createNamespacedHelpers('transaction');
  133. export default {
  134. name: 'expertInfo',
  135. props: {
  136. form: { type: Object },
  137. showBtn: { type: Boolean, default: () => true },
  138. },
  139. components: { chat },
  140. data: function() {
  141. return {
  142. img_url: require('@common/src/assets/live/d10_fbb1.png'),
  143. dialogTableVisible: false,
  144. room: {},
  145. };
  146. },
  147. created() {},
  148. methods: {
  149. ...personRoom(['create']),
  150. ...transaction({ getTran: 'query', createTran: 'create' }),
  151. async btnPhone() {
  152. if (!this.room.id) {
  153. //TODO 请求房间号
  154. let obj = {};
  155. if (!_.get(this.user, 'id')) {
  156. // this.$message.error('游客身份无法与卖家对话,请先注册');
  157. this.$message({
  158. dangerouslyUseHTMLString: true,
  159. message: '<strong><a href="http://broadcast.waityou24.cn/live/login" style="color:red;">游客身份无法与卖家对话,请先注册</a></strong>',
  160. type: 'error',
  161. });
  162. return;
  163. } else {
  164. obj.p1_id = this.user.id;
  165. obj.p1 = this.user.name;
  166. }
  167. if (!this.form.id) {
  168. this.$message.error('缺少专家信息,请联系管理员');
  169. return;
  170. } else {
  171. obj.p2_id = this.form.id;
  172. obj.p2 = this.form.name;
  173. }
  174. let res = await this.create(obj);
  175. if (this.$checkRes(res)) {
  176. this.$set(this, `room`, res.data);
  177. }
  178. }
  179. this.dialogTableVisible = true;
  180. },
  181. //供求对接
  182. async onSubmit(data) {
  183. const obj = {
  184. supplier: _.get(data, 'id'),
  185. s_name: _.get(data, 'name'),
  186. s_phone: _.get(data, 'phone'),
  187. product_id: _.get(data, 'id'),
  188. product: _.get(data, 'name'),
  189. demander: _.get(this.user, 'id'),
  190. d_name: _.get(this.user, 'name'),
  191. d_phone: _.get(this.user, 'phone'),
  192. };
  193. if (obj.demander === obj.supplier) {
  194. this.$message.error('您不能对自己进行对接!');
  195. return;
  196. }
  197. const list = await this.getTran({ product_id: obj.product_id, demander: obj.demander });
  198. if (list.total > 0) {
  199. this.$message.warning('您已申请供求对接,无需再次申请!');
  200. return;
  201. }
  202. const res = await this.createTran(obj);
  203. this.$checkRes(res, '对接成功', res.errmsg || '对接失败');
  204. },
  205. },
  206. computed: {
  207. ...mapState(['user']),
  208. },
  209. watch: {},
  210. };
  211. </script>
  212. <style lang="less" scoped>
  213. .main {
  214. .one {
  215. .top {
  216. height: 230px;
  217. overflow: hidden;
  218. .right {
  219. padding: 0 0 0 10px;
  220. .name {
  221. font-size: 18px;
  222. font-weight: bold;
  223. padding: 10px;
  224. text-align: center;
  225. border: 1px solid #ccc;
  226. }
  227. .otherInfo {
  228. font-size: 16px;
  229. padding: 10px;
  230. border: 1px solid #ccc;
  231. }
  232. }
  233. }
  234. .down {
  235. margin: 0 0 15px 0;
  236. .downInfo {
  237. border: 1px solid #ccc;
  238. .tit {
  239. height: 150px;
  240. line-height: 150px;
  241. text-align: center;
  242. border-right: 1px solid #ccc;
  243. }
  244. .info {
  245. font-size: 16px;
  246. padding: 10px;
  247. min-height: 150px;
  248. }
  249. }
  250. }
  251. }
  252. .btn {
  253. text-align: center;
  254. }
  255. }
  256. </style>