service.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. <template>
  2. <div class="instr-container">
  3. <div class="search-wrap"></div>
  4. <div class="common-container">
  5. <section class="section-container">
  6. <div class="service-list">
  7. <div class="service-list-header">
  8. <h4 class="title">技术服务</h4>
  9. </div>
  10. <el-empty
  11. v-if="serviceDataList.length == 0"
  12. description="很抱歉,没有找到相关的技术服务~"
  13. ></el-empty>
  14. <div v-else>
  15. <div class="flex list-header">
  16. <div>共{{ serviceDataList.length }}项技术服务</div>
  17. <div class="btn" @click="handleAppoint">
  18. 需求提报({{ needList.length }})
  19. </div>
  20. </div>
  21. <div class="instr-item" v-for="v in serviceDataList" :key="v.id">
  22. <div class="img-item">
  23. <img
  24. src="../../assets/img/service.png"
  25. style="width: 100%"
  26. alt=""
  27. />
  28. </div>
  29. <div class="text-item">
  30. <p class="name">{{ v.name }}</p>
  31. <div class="info" style="flex: 1">
  32. <div class="info-txt">{{ v.content }}</div>
  33. </div>
  34. <div class="info">
  35. <div class="info-title">技术服务平台:</div>
  36. <div class="info-txt">
  37. <div>{{ v.plat }} - {{ v.user }}</div>
  38. <div class="btns flex">
  39. <div class="btn btn1" @click="openDetail(v)">详情</div>
  40. <div class="btn btn2" @click="joinNeedList(v.id)">
  41. 加入需求
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. <!-- <div class="appoint-item">
  48. <div class="mb20">
  49. <el-button
  50. type="primary"
  51. size="default"
  52. v-if="v.instStatus == '10' && v.isAppointment == '10'"
  53. @click="handleAppoint(v)"
  54. >
  55. 使用预约
  56. </el-button>
  57. </div>
  58. <div>
  59. <el-button
  60. type="primary"
  61. plain
  62. size="default"
  63. @click="linkToDetails(v)"
  64. >
  65. 查看详情
  66. </el-button>
  67. </div>
  68. </div> -->
  69. </div>
  70. </div>
  71. <div class="pagination">
  72. <el-pagination
  73. background
  74. @size-change="handleSizeChange"
  75. @current-change="handleCurrentChange"
  76. :current-page="searchForm.pageNum"
  77. :page-sizes="[10, 50, 100]"
  78. :page-size="searchForm.pageSize"
  79. layout="total, sizes, prev, pager, next, jumper"
  80. :total="total"
  81. ></el-pagination>
  82. </div>
  83. </div>
  84. </section>
  85. </div>
  86. <appointEdit ref="appointRef" ></appointEdit>
  87. </div>
  88. </template>
  89. <script name="service-detail">
  90. import to from "await-to-js";
  91. import { getToken } from "@/utils/auth";
  92. import { Loading } from "element-ui";
  93. import { getInstrList, getInstNameEnCount } from "@/api/instr/index";
  94. import appointEdit from "./components/edit.vue";
  95. export default {
  96. name: "equipment",
  97. components: { appointEdit },
  98. data() {
  99. return {
  100. platFilterExpand: false,
  101. instrTypeFilterExpand: false,
  102. searchForm: {
  103. searchText: "",
  104. laboratoryName: "",
  105. instClassDesc: "",
  106. instNameEn: "",
  107. pageNum: 1,
  108. pageSize: 10,
  109. },
  110. needList: [],
  111. total: 4,
  112. serviceDataList: [
  113. {
  114. id: 1,
  115. name: "Western Blot相关实验",
  116. content:
  117. "Western Blot(蛋白质印迹法)是一种广泛应用于分子生物学、生物化学和免疫遗传学中的实验技术,用于检测样品中特定蛋白质的存在、大小和表达量。包含样品制备、SDS - PAGE 电泳、蛋白质转印、抗体孵育、检测与分析等步骤。",
  118. plat: "细胞平台",
  119. user: "张老师",
  120. },
  121. {
  122. id: 2,
  123. name: "高效液相色谱实验",
  124. content:
  125. "高效液相色谱(High - Performance Liquid Chromatography,HPLC)实验是一种重要的分离分析技术,广泛应用于化学、生物、医药等众多领域,用于分离、鉴定和定量分析各种复杂混合物中的化学成分。",
  126. plat: "光学平台",
  127. user: "张老师",
  128. },
  129. {
  130. id: 3,
  131. name: "核酸提取扩增相关实验",
  132. content:
  133. "核酸包括 DNA 和 RNA,提取的基本原理是利用核酸与其他细胞成分在物理和化学性质上的差异进行分离。",
  134. plat: "分子平台",
  135. user: "张老师",
  136. },
  137. {
  138. id: 4,
  139. name: "组织与病理学相关实验",
  140. content:
  141. "组织样本采集是组织与病理学实验的基础。目的是获取能够代表病变或正常组织特征的样本,用于后续的病理诊断和研究。采集过程需要遵循无菌、快速、准确的原则。",
  142. plat: "病理平台",
  143. user: "张老师",
  144. },
  145. ],
  146. laboratoryNameOptions: [],
  147. instClassDescOptions: [],
  148. instNameEnOptions: [],
  149. options: {
  150. text: "正在加载中,请稍后...",
  151. background: "rgba(0, 0, 0, 0.6)",
  152. },
  153. };
  154. },
  155. created() {},
  156. mounted() {
  157. // this.getInstrData();
  158. },
  159. methods: {
  160. openDetail(row) {
  161. console.log(row);
  162. this.$router.push("/technical/service-detail");
  163. },
  164. joinNeedList(id) {
  165. this.needList.push(id);
  166. this.needList = [...new Set(this.needList)];
  167. this.$message.success("加入成功");
  168. },
  169. handleAppoint() {
  170. this.$refs.appointRef.openDialog();
  171. // const token = getToken();
  172. // if (!token) {
  173. // return this.$router.push("/login?redirect=/appointment/equipment");
  174. // }
  175. // this.$refs.appointRef.openDialog(row);
  176. },
  177. // 获取型号数量
  178. async getInstNameEnCountData() {
  179. const params = {
  180. instClassDesc: this.searchForm.instClassDesc,
  181. laboratoryName: this.searchForm.laboratoryName,
  182. searchText: this.searchForm.searchText,
  183. };
  184. const [err, res] = await to(getInstNameEnCount(params));
  185. if (err) return;
  186. if (res.code == 200) {
  187. this.instNameEnOptions = res.data;
  188. }
  189. },
  190. // 上方搜索查询
  191. async globalSearch() {
  192. this.searchForm.pageNum = 1;
  193. this.searchForm.instClassDesc = "";
  194. this.searchForm.laboratoryName = "";
  195. this.searchForm.instNameEn = "";
  196. this.getInstrData();
  197. },
  198. async getInstrData() {
  199. // Loading.service(this.loadingOption);
  200. // const [err, res] = await to(getInstrList(this.searchForm));
  201. // setTimeout(() => {
  202. // Loading.service(this.loadingOption).close();
  203. // });
  204. // if (err) return;
  205. // if (res.code == 200) {
  206. // this.serviceDataList = res.data.list;
  207. // this.total = res.data.total;
  208. // this.laboratoryNameOptions = this.objTransforArr(
  209. // res.data.count.laboratoryName
  210. // );
  211. // this.instClassDescOptions = this.objTransforArr(
  212. // res.data.count.instClassDesc
  213. // );
  214. // this.getInstNameEnCountData();
  215. // }
  216. },
  217. // 对象转数组
  218. objTransforArr(obj) {
  219. const arr = Object.entries(obj).map(([key, value]) => ({
  220. name: key,
  221. count: value,
  222. }));
  223. return arr;
  224. },
  225. // 删除查询条件
  226. closeTag(type) {
  227. switch (type) {
  228. case "laboratoryName":
  229. this.searchForm.laboratoryName = "";
  230. break;
  231. case "instClassDesc":
  232. this.searchForm.instClassDesc = "";
  233. break;
  234. case "instNameEn":
  235. this.searchForm.instNameEn = "";
  236. break;
  237. }
  238. this.searchForm.pageNum = 1;
  239. this.getInstrData();
  240. },
  241. // 展开 合并
  242. handleExpandFilter(type = "plat" | "instrType") {
  243. if (type === "plat") {
  244. this.platFilterExpand = !this.platFilterExpand;
  245. } else if (type === "instrType") {
  246. this.instrTypeFilterExpand = !this.instrTypeFilterExpand;
  247. }
  248. },
  249. // 选择查询条件
  250. selectFilterItem(name, val) {
  251. switch (val) {
  252. case "laboratoryName":
  253. if (this.searchForm.laboratoryName != name) {
  254. this.searchForm.laboratoryName = name;
  255. this.searchForm.pageNum = 1;
  256. this.getInstrData();
  257. }
  258. break;
  259. case "instClassDesc":
  260. if (this.searchForm.instClassDesc != name) {
  261. this.searchForm.instClassDesc = name;
  262. this.searchForm.pageNum = 1;
  263. this.getInstrData();
  264. }
  265. break;
  266. case "instNameEn":
  267. if (this.searchForm.instNameEn != name) {
  268. this.searchForm.instNameEn = name;
  269. this.searchForm.pageNum = 1;
  270. this.getInstrData();
  271. }
  272. break;
  273. }
  274. },
  275. handleSizeChange(val) {
  276. this.searchForm.pageSize = val;
  277. this.getInstrData();
  278. },
  279. handleCurrentChange(val) {
  280. this.searchForm.pageNum = val;
  281. this.getInstrData();
  282. },
  283. linkToDetails(v) {
  284. this.$router.push("/appointment/equipment-details?id=" + v.id);
  285. },
  286. },
  287. };
  288. </script>
  289. <style lang="scss" scoped>
  290. .search-wrap {
  291. width: 100%;
  292. height: 240px;
  293. position: relative;
  294. &::after {
  295. display: block;
  296. content: "";
  297. width: 100%;
  298. height: 100%;
  299. position: absolute;
  300. top: 0;
  301. left: 0;
  302. background: url("../../assets/img/equipment-banner1.png") center;
  303. background-size: 100% 240px;
  304. }
  305. }
  306. .section-container {
  307. width: 1200px;
  308. margin: 0 auto;
  309. }
  310. .filter-wrap {
  311. width: 100%;
  312. .filter-item {
  313. width: 100%;
  314. min-height: 48px;
  315. display: flex;
  316. border-bottom: 2px dashed rgba(112, 112, 112, 0.18);
  317. &:last-child {
  318. border-bottom: none;
  319. }
  320. }
  321. .left-tit {
  322. width: 120px;
  323. background: #f1f1f1;
  324. display: flex;
  325. align-items: center;
  326. justify-content: center;
  327. font-weight: bold;
  328. }
  329. .right-filter-content {
  330. flex: 1;
  331. padding: 9px 24px 9px 36px;
  332. display: flex;
  333. flex-wrap: wrap;
  334. position: relative;
  335. .list {
  336. max-height: 120px;
  337. overflow: auto;
  338. width: 100%;
  339. display: flex;
  340. flex-wrap: wrap;
  341. // &::-webkit-scrollbar {
  342. // display: none;
  343. // }
  344. .dragger-container {
  345. position: absolute;
  346. width: 6px;
  347. top: 36px;
  348. right: 34px;
  349. height: 84px;
  350. background: #ccc;
  351. border-radius: 20px;
  352. .dragger-bar {
  353. position: absolute;
  354. width: 6px;
  355. height: 60px;
  356. top: 0px;
  357. border-radius: 20px;
  358. background: rgba(0, 0, 0, 0.75);
  359. }
  360. }
  361. }
  362. .name {
  363. font-size: 14px;
  364. margin: 5px 30px 5px 0;
  365. cursor: pointer;
  366. &:hover {
  367. text-decoration: underline;
  368. color: #1677ff;
  369. }
  370. &.avtive {
  371. text-decoration: underline;
  372. color: #1677ff;
  373. }
  374. }
  375. .more-item {
  376. position: absolute;
  377. top: 12px;
  378. right: 0;
  379. padding-right: 16px;
  380. font-size: 14px;
  381. cursor: pointer;
  382. z-index: 2;
  383. i {
  384. color: #b1b1b1;
  385. }
  386. }
  387. }
  388. }
  389. .service-list-header {
  390. padding: 15px 18px;
  391. display: flex;
  392. border: 1px solid rgba(112, 112, 112, 0.06);
  393. position: relative;
  394. .title {
  395. width: 120px;
  396. font-size: 16px;
  397. color: #333;
  398. font-weight: 700;
  399. padding-right: 18px;
  400. padding-top: 3px;
  401. flex: 0 0 120px;
  402. }
  403. .filter-wrap {
  404. min-height: 45px;
  405. padding-right: 80px;
  406. }
  407. }
  408. .service-list {
  409. background: #fff;
  410. border-radius: 6px;
  411. margin-top: 20px;
  412. min-height: 200px;
  413. .list-header {
  414. padding: 12px 30px 10px;
  415. border-bottom: 1px solid rgba(112, 112, 112, 0.06);
  416. align-items: center;
  417. justify-content: space-between;
  418. .btn {
  419. cursor: pointer;
  420. background: #facd91;
  421. border-top-left-radius: 8px;
  422. border-top-right-radius: 8px;
  423. padding: 8px 50px;
  424. }
  425. }
  426. .instr-item {
  427. padding: 24px 30px;
  428. display: flex;
  429. border-bottom: 1px solid rgba(112, 112, 112, 0.06);
  430. .img-item {
  431. width: 180px;
  432. height: 180px;
  433. border-radius: 6px;
  434. overflow: hidden;
  435. margin-right: 18px;
  436. position: relative;
  437. background: #f3f6fb;
  438. }
  439. .text-item {
  440. flex: 1;
  441. width: 0;
  442. font-size: 14px;
  443. padding-top: 6px;
  444. display: flex;
  445. flex-direction: column;
  446. .name {
  447. font-weight: bold;
  448. font-size: 20px;
  449. margin-bottom: 12px;
  450. }
  451. .info {
  452. color: #666;
  453. display: flex;
  454. font-size: 14px;
  455. margin-bottom: 8px;
  456. .info-title {
  457. width: 100px;
  458. }
  459. .info-txt {
  460. width: 0;
  461. flex: 1;
  462. position: relative;
  463. .btns {
  464. position: absolute;
  465. right: 0;
  466. top: -8px;
  467. }
  468. .btn {
  469. width: 90px;
  470. padding: 8px;
  471. cursor: pointer;
  472. display: flex;
  473. align-items: center;
  474. justify-content: center;
  475. &.btn1 {
  476. border-top-left-radius: 8px;
  477. border-bottom-left-radius: 8px;
  478. background: #facd91;
  479. }
  480. &.btn2 {
  481. color: #fff;
  482. border-top-right-radius: 8px;
  483. border-bottom-right-radius: 8px;
  484. background: #1c9bfd;
  485. }
  486. }
  487. }
  488. }
  489. }
  490. .appoint-item {
  491. width: 120px;
  492. padding: 0 0 0 18px;
  493. display: flex;
  494. flex-direction: column;
  495. align-items: center;
  496. justify-content: center;
  497. }
  498. }
  499. }
  500. .pagination {
  501. width: 100%;
  502. height: 50px;
  503. display: flex;
  504. align-items: center;
  505. justify-content: center;
  506. }
  507. div {
  508. color: #333;
  509. }
  510. </style>