Dialectical.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. <template>
  2. <div class="dialectical flex-plane-center-top">
  3. <div class="dialectical-left">
  4. <!-- 头部 -->
  5. <header class="flex-vertical-center-l">
  6. <div class="screening flex-vertical-center-l">
  7. <div class="screening-title flex-vertical-center-l">
  8. <img src="~@/assets/filters.png" alt />
  9. </div>
  10. <div class="screening-item flex flex-col-center">
  11. <span>科室分类:</span>
  12. <div class="input">
  13. <!-- <el-select size="mini" v-model="type" placeholder="请选择" @change="classifyC">
  14. <el-option :label="item.classname" :value="item.classid"
  15. v-for="(item,index) in classify" :key="index"></el-option>
  16. </el-select>-->
  17. <!-- <el-cascader size="mini" placeholder="请选择" :options="classify" :props="props" filterable>
  18. </el-cascader>-->
  19. <Cascader :list="classify" @change="classifyC"></Cascader>
  20. </div>
  21. </div>
  22. <div class="screening-item flex flex-col-center">
  23. <span>病症查询:</span>
  24. <div class="input">
  25. <el-select size="mini" filterable remote :filter-method="filterMethod" v-model="bingzheng"
  26. placeholder="请选择" @change="getSymptomsPain(1,'',bingzheng)">
  27. <el-option :label="item.groupname" :value="item.groupname" v-for="(item,index) in bingzhengS"
  28. :key="index"></el-option>
  29. <!-- <el-option label="发烧" value="fs"></el-option> -->
  30. </el-select>
  31. </div>
  32. </div>
  33. <div class="screening-item flex flex-col-center" v-if="key2">
  34. <span>中医病名:</span>
  35. <div class="input">
  36. <el-input readonly size="mini" v-model="key2"></el-input>
  37. </div>
  38. </div>
  39. </div>
  40. <!-- <div class="screening flex-vertical-center-l">
  41. <span>科室选择:</span>
  42. <div class="screening_select">
  43. <el-select v-model="keshi" placeholder="请选择">
  44. <el-option label="内科" value="nk"></el-option>
  45. <el-option label="外科" value="wk"></el-option>
  46. </el-select>
  47. </div>
  48. </div>-->
  49. </header>
  50. <!-- 底部 -->
  51. <section class="section">
  52. <div class="section-item" v-for="(item,index) in showBZdata" :key="index">
  53. <div class="department flex flex-row-left flex-col-center">
  54. <img src="~@/assets/znbz-add.png" alt />
  55. <span>{{item.parent_NAME}}</span>
  56. </div>
  57. <div class="department-item flex flex-row-left flex-col-top" v-for="(item1,index1) in item.classifyVoNewList"
  58. :key="index1">
  59. <div class="d-i-name">{{item1.classifyname}}</div>
  60. <div class="d-i-dis flex flex-col-top flex-row-left flex-wrap">
  61. <div class="dis-item" v-for="(item2,index2) in item1.group" :key="index2"
  62. @click="toQuestion(item2.groupid)">{{item2.groupname}}</div>
  63. </div>
  64. </div>
  65. </div>
  66. </section>
  67. </div>
  68. <div class="dialectical-right">
  69. <div class="title flex-vertical-center-l">
  70. <!-- <span></span> -->
  71. <img src="~@/assets/znbz-add.png" alt />
  72. <div>我最常用</div>
  73. </div>
  74. <div class="list flex-vertical-between flex-wrap">
  75. <div class="item flex-center" @click="toQuestion(item.groupid)" v-for="(item,index) in oftenList" :key="index">
  76. {{item.groupname}}</div>
  77. </div>
  78. <div class="title flex-vertical-center-l">
  79. <!-- <span></span> -->
  80. <img src="~@/assets/znbz-add.png" alt />
  81. <div>常见病</div>
  82. </div>
  83. <div class="list flex-vertical-between flex-wrap">
  84. <div class="item flex-center" @click="toQuestion(item.groupid)" v-for="(item,index) in commonList" :key="index">
  85. {{item.groupname}}</div>
  86. </div>
  87. </div>
  88. </div>
  89. </template>
  90. <script>
  91. import {
  92. getDialecticalC,
  93. getSymptoms,
  94. getSymptomsPain
  95. } from "@/api/knowledge.js";
  96. import {
  97. getMyOfenUse,
  98. znQusetionShow
  99. } from "@/api/diagnosis.js";
  100. import Cascader from "@/components/ui/Cascader.vue";
  101. import IndexBar from "@/components/IndexBar.vue";
  102. import {
  103. mapGetters
  104. } from "vuex";
  105. import {addRecipeFrom} from '@/api/dataAnalysis';
  106. import {tryRun} from '@/tool';
  107. export default {
  108. components: {
  109. IndexBar,
  110. Cascader
  111. },
  112. data() {
  113. return {
  114. current: 0,
  115. type: "",
  116. bingzheng: "",
  117. keshi: "",
  118. classify: [],
  119. bingzhengS: [], // 选择器 病症查询\
  120. showBZdata: [],
  121. key: "",
  122. commonList: [],
  123. oftenList: [],
  124. total: 0,
  125. page: 1,
  126. key2: ""
  127. };
  128. },
  129. created() {
  130. this.getDialecticalC();
  131. this.getSymptoms(1);
  132. this.getSymptomsPain(1, "1", "");
  133. this.getCommonDis();
  134. this.getMyOfenUse();
  135. },
  136. beforeRouteEnter(to, from, next) {
  137. addRecipeFrom({ type: 0 }).catch()
  138. if (from.fullPath.indexOf("/index/dialecticalq") != -1) {
  139. next();
  140. } else {
  141. next(vm => {
  142. if (vm.$route.query.name) {
  143. vm.key2 = vm.$route.query.name;
  144. vm.getSymptoms1(1, "", vm.key2);
  145. } else {
  146. vm.key2 = "";
  147. vm._znQusetionShow();
  148. }
  149. });
  150. }
  151. },
  152. methods: {
  153. filterMethod(e) {
  154. let pinyin = /^[A-Za-z]+$/g;
  155. if (pinyin.test(e)) {
  156. this.getSymptoms(1, "1", e);
  157. } else {
  158. this.getSymptoms(1, "", e);
  159. }
  160. },
  161. // 分类选择框改变
  162. classifyC(e) {
  163. this.bingzheng = "";
  164. this.type = e.secondItem.classifyid ?
  165. e.secondItem.classifyid :
  166. e.firstItem.classid;
  167. this.bingzhengS = [];
  168. this.showBZdata = [];
  169. this.getSymptoms(1);
  170. this.getSymptomsPain(1, "1", this.key);
  171. this.current = 0;
  172. },
  173. toQuestion(id = "", type = "1") {
  174. const name = tryRun(() => this.bingzhengS.find(item => item.groupid === id).groupname);
  175. if (this.key2) {
  176. this.$router.push({
  177. path: `/index/dialecticalq`,
  178. query: {id, name, type: 3}
  179. });
  180. } else {
  181. this.$router.push({
  182. path: `/index/dialecticalq`,
  183. query: {id, name, type}
  184. });
  185. }
  186. },
  187. inBarc(e) {
  188. // console.log('e:', e)
  189. this.current = e.index;
  190. this.getSymptomsPain(1, "1", e.text);
  191. this.key = e.text;
  192. },
  193. // 分页面 切换
  194. pageChange(e) {
  195. // console.log(e, 'e');
  196. this.getSymptomsPain(e, "1", this.key);
  197. },
  198. //获取 分类
  199. async getDialecticalC() {
  200. let res = await getDialecticalC();
  201. if (res.code === 0) {
  202. // res.Data.forEach((item, index) => {
  203. // item.classifys.forEach((item1, index1) => {
  204. // this.classify.push(item1)
  205. // })
  206. // })
  207. this.classify = res.data;
  208. }
  209. },
  210. // 获取症状
  211. async getSymptoms(type, serchtype = "", key = "") {
  212. let params = {
  213. classifyid: this.type,
  214. serchtype: serchtype,
  215. keyword: key
  216. };
  217. let res = await getSymptoms(params);
  218. if (res.ResultCode == 0) {
  219. if (type == 1) {
  220. this.bingzhengS = [];
  221. res.Data.forEach(item => {
  222. item.classifyVoNewList.forEach(item1 => {
  223. item1.group.forEach(item2 => {
  224. this.bingzhengS.push(item2);
  225. });
  226. });
  227. });
  228. }
  229. }
  230. },
  231. // 获取症状 通过路由携带参数跳转页面
  232. async getSymptoms1(type, serchtype = "", key = "") {
  233. let params = {
  234. classifyid: this.type,
  235. serchtype: serchtype,
  236. keyword: key
  237. };
  238. let res = await getSymptoms(params);
  239. if (res.ResultCode == 0) {
  240. if (type == 1) {
  241. if (this.key2) {
  242. if (res.Data.length > 0) {
  243. this.toQuestion(
  244. res.Data[0].classifyVoNewList[0].group[0].groupid,
  245. 3
  246. );
  247. }
  248. }
  249. }
  250. }
  251. },
  252. async getSymptomsPain(page, serchtype = "", key = "") {
  253. const loading = this.$loading({
  254. lock: true,
  255. text: "正在查询,请稍等",
  256. spinner: "el-icon-loading",
  257. background: "rgba(0, 0, 0, 0.7)"
  258. });
  259. let params = {
  260. classifyid: this.type,
  261. serchtype: serchtype,
  262. keyword: key
  263. // limit: 15,
  264. // page: page
  265. };
  266. let res = await getSymptomsPain(params).catch(err => {
  267. loading.close();
  268. });
  269. if (res.ResultCode == 0) {
  270. this.showBZdata = [];
  271. this.total = res.Data.TotalRecordCount;
  272. // res.Data.Items.forEach(item => {
  273. // item.group.forEach(item1 => {
  274. // this.showBZdata.push(item1)
  275. // })
  276. // })
  277. loading.close();
  278. this.showBZdata = res.Data.Items;
  279. }
  280. },
  281. // 获取右侧常见病
  282. async getCommonDis() {
  283. let res = await getSymptoms({
  284. usual: "Y"
  285. });
  286. if (res.ResultCode == 0) {
  287. this.commonList = [];
  288. res.Data.forEach(item => {
  289. item.classifyVoNewList.forEach(item1 => {
  290. item1.group.forEach(item2 => {
  291. this.commonList.push(item2);
  292. });
  293. });
  294. });
  295. }
  296. },
  297. async getMyOfenUse() {
  298. let res = await getMyOfenUse();
  299. if (res.ResultCode == 0) {
  300. this.oftenList = res.Data;
  301. }
  302. },
  303. // 获取回显数据
  304. async _znQusetionShow(next) {
  305. let res = await znQusetionShow({
  306. recordId: this.getPatiensInfo.pid
  307. }).catch(errr => {});
  308. if (res.ResultCode == 0) {
  309. if (res.Data.groupids) {
  310. this.toQuestion(res.Data.groupids, 2);
  311. }
  312. }
  313. }
  314. },
  315. computed: {
  316. ...mapGetters(["getPatiensInfo"])
  317. }
  318. };
  319. </script>
  320. <style lang="scss" scoped>
  321. @import "../../style/common.scss";
  322. @import "../../style/base.scss";
  323. .dialectical-right {
  324. width: 230px;
  325. box-sizing: border-box;
  326. padding: 10px 10px;
  327. background: #ffffff;
  328. border-radius: 5px;
  329. margin-left: 10px;
  330. min-height: 470px;
  331. height: 82vh;
  332. overflow: auto;
  333. .title {
  334. img {
  335. width: 26px;
  336. }
  337. div {
  338. font-size: 16px;
  339. font-family: PingFang SC;
  340. font-weight: 400;
  341. color: #5386f6;
  342. margin-left: 10px;
  343. }
  344. }
  345. .list {
  346. margin-top: 10px;
  347. .item {
  348. width: 90px;
  349. border: 1px solid #5386f6;
  350. box-sizing: border-box;
  351. height: 30px;
  352. // background: #F5F5F5;
  353. border-radius: 5px;
  354. font-size: 14px;
  355. font-family: PingFang SC;
  356. font-weight: 400;
  357. color: #333333;
  358. cursor: pointer;
  359. margin-bottom: 5px;
  360. }
  361. }
  362. .title:last-child {
  363. margin-top: 10px;
  364. }
  365. }
  366. .dialectical-left {
  367. flex: 1;
  368. overflow: hidden;
  369. height: 82vh;
  370. header {
  371. padding: 5px 5px;
  372. background: #ffffff;
  373. border-radius: 5px;
  374. margin-bottom: 10px;
  375. width: 100%;
  376. box-sizing: border-box;
  377. }
  378. section {
  379. padding: 5px 10px;
  380. background: #ffffff;
  381. border-radius: 5px;
  382. width: 100%;
  383. box-sizing: border-box;
  384. // display: flex;
  385. // align-items: flex-start;
  386. // justify-content: flex-start;
  387. overflow-y: auto;
  388. min-height: 410px;
  389. height: 93%;
  390. .section-item {
  391. margin-bottom: 10px;
  392. }
  393. .department {
  394. img {
  395. width: 26px;
  396. }
  397. span {
  398. font-size: 16px;
  399. color: #000;
  400. margin-left: 10px;
  401. }
  402. }
  403. .department-item {
  404. margin-top: 5px;
  405. .d-i-name {
  406. width: 50px;
  407. // text-align: right;
  408. margin-left: 36px;
  409. font-size: 16px;
  410. color: #000;
  411. margin-right: 10px;
  412. }
  413. .d-i-dis {
  414. flex: 1;
  415. }
  416. .dis-item {
  417. padding: 5px 10px;
  418. border-radius: 5px;
  419. border: 1px solid #5386f6;
  420. margin-right: 10px;
  421. margin-bottom: 10px;
  422. font-size: 14px;
  423. cursor: pointer;
  424. }
  425. }
  426. }
  427. }
  428. .screening_select::v-deep .el-select {
  429. width: 100%;
  430. }
  431. </style>
  432. <style lang="scss" scoped>
  433. @media screen and(min-width: 1681px) and(max-width: 1920px) {
  434. .dialectical-right,
  435. .dialectical-left {
  436. height: 88vh;
  437. }
  438. }
  439. @media screen and(min-width: 1601px) and(max-width: 1680px) {
  440. .dialectical-right,
  441. .dialectical-left {
  442. height: 88vh;
  443. }
  444. }
  445. @media screen and(min-width: 1440px) and(max-width: 1600px) {
  446. .dialectical-right,
  447. .dialectical-left {
  448. height: 86vh;
  449. }
  450. }
  451. @media screen and(min-width: 1360px) and(max-width: 1439px) {
  452. .dialectical-right,
  453. .dialectical-left {
  454. height: 83vh;
  455. }
  456. }
  457. </style>