MainPage.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776
  1. <template>
  2. <div class="page">
  3. <Head
  4. :activeTab="activeTab"
  5. :allMoudles="allMoudles"
  6. :progressNum="progressNum"
  7. :progress="progress"
  8. />
  9. <!-- <div class="progress-bar">
  10. <div class="title">
  11. <span :class="{'active':activeTab==i.type}" :style="{width:(100/allMoudles.length)+'%'}" v-for="i in allMoudles">{{i.name}}</span>
  12. </div>
  13. <div class="progress">
  14. <p :style="{width:progress}"></p>
  15. </div>
  16. </div> -->
  17. <div class="wrapper">
  18. <div class="scrollPart" :style="{ paddingBottom: pdbm }">
  19. <!--<div class="right clearfix">
  20. <img src="../assets/patient.png" alt="" class="fr">
  21. <div class="content fr">
  22. <p>医生您好!我想咨询新型冠状病毒。(个人信息:{{userInfo.patientName}}{{userInfo.patientSex?','+userInfo.patientSex:''}}{{userInfo.patientAge?','+userInfo.patientAge+'岁':''}})</p>
  23. </div>
  24. </div>-->
  25. <div class="left clearfix">
  26. <img src="../images/doctor.png" alt="" class="fl" />
  27. <div class="content fl">
  28. <p>
  29. 欢迎来到{{
  30. userInfo.hospitalName
  31. }}!候诊期间请先填写自己的实际症状,信息会马上传送到您的预约医生,便于您实现快速就诊。
  32. </p>
  33. </div>
  34. </div>
  35. <!--<div class="left clearfix" @click="selectToggle(2,disData.symptom.result,true)">
  36. <img src="../assets/doctor.png" alt="" class="fl">
  37. <div class="content fl">
  38. <p>您哪里不舒服?</p>
  39. </div>
  40. </div>-->
  41. <UsualSymptom
  42. v-if="showUsual"
  43. @selectUsual="selectUsual"
  44. ></UsualSymptom>
  45. <div class="right clearfix" v-if="selectedSymptom.name">
  46. <img src="../images/patient.png" alt="" class="fr" />
  47. <div class="content fr">
  48. <p>{{ selectedSymptom.description || selectedSymptom.name }}</p>
  49. </div>
  50. <span
  51. v-if="!canceledSym && activeNum == 0 && cancelNum === -1"
  52. class="edit"
  53. @click="cancelSymptom"
  54. >修改</span
  55. >
  56. </div>
  57. <div v-for="(item, idx) in symptomQasList" :key="'0' + idx + item.id">
  58. <Dialog
  59. :idx="idx"
  60. v-if="item.show"
  61. :item="item"
  62. @cancel="cancelSelected"
  63. :num="activeNum"
  64. :cancelNum="cancelNum"
  65. :extNum="[]"
  66. />
  67. </div>
  68. <div v-for="(item, idx) in diagnoseQasList" :key="'1' + idx + item.id">
  69. <Dialog
  70. :idx="idx"
  71. v-if="item.show"
  72. :item="item"
  73. @cancel="cancelSelected"
  74. :num="activeNum"
  75. :extNum="[symptomQasList.length]"
  76. :cancelNum="cancelNum"
  77. />
  78. </div>
  79. <div v-for="(item, idx) in othersQasList" :key="'2' + idx + item.id">
  80. <Dialog
  81. :idx="idx"
  82. v-if="item.show"
  83. :item="item"
  84. @cancel="cancelSelected"
  85. :num="activeNum"
  86. :extNum="[symptomQasList.length, diagnoseQasList.length]"
  87. :cancelNum="cancelNum"
  88. />
  89. </div>
  90. <div
  91. v-for="(item, idx) in addContentQasList"
  92. :key="'3' + idx + item.id"
  93. >
  94. <Dialog
  95. :idx="idx"
  96. v-if="item.show"
  97. :item="item"
  98. @cancel="cancelSelected"
  99. :num="activeNum"
  100. :extNum="[
  101. symptomQasList.length,
  102. diagnoseQasList.length,
  103. othersQasList.length,
  104. ]"
  105. :cancelNum="cancelNum"
  106. />
  107. </div>
  108. <!-- <div v-for="(item,idx) in diagnoseQasList" :key="'1'+idx+item.id" v-if="activeTab==moduleKeys[1]||activeTab==moduleKeys[2]||activeTab==moduleKeys[3]">
  109. <Dialog :idx="idx" v-if="item.show" :item="item" @cancel="cancelSelected" :num="activeNum" :extNum ="[symptomQasList.length]" :cancelNum="cancelNum"/>
  110. </div>
  111. <div v-for="(item,idx) in othersQasList" :key="'2'+idx+item.id" v-if="activeTab==moduleKeys[2]||activeTab==moduleKeys[3]">
  112. <Dialog :idx="idx" v-if="item.show" :item="item" @cancel="cancelSelected" :num="activeNum" :extNum ="[symptomQasList.length,diagnoseQasList.length]" :cancelNum="cancelNum"/>
  113. </div>
  114. <div v-for="(item,idx) in addContentQasList" :key="'3'+idx+item.id" v-if="activeTab==moduleKeys[3]">
  115. <Dialog :idx="idx" v-if="item.show" :item="item" @cancel="cancelSelected" :num="activeNum" :extNum ="[symptomQasList.length,diagnoseQasList.length,othersQasList.length]" :cancelNum="cancelNum"/>
  116. </div> -->
  117. </div>
  118. </div>
  119. <MultSelect
  120. @updataResult="updataResultSingle"
  121. :num="num"
  122. :symptomResult="symptomResult"
  123. v-if="type == 3"
  124. ></MultSelect>
  125. <Select
  126. @updataResult="updataResultSingle"
  127. :num="num"
  128. @warning="showWarn"
  129. @getExtQa="addExtQa"
  130. :symptomResult="symptomResult"
  131. v-if="type == 2"
  132. ></Select>
  133. <Radio
  134. @updataResultSingle="updataResultSingle"
  135. @warning="showWarn"
  136. @getExtQa="addExtQa"
  137. :num="num"
  138. :symptomResult="symptomResult"
  139. v-if="type == 1"
  140. ></Radio>
  141. <!--普通单列拨盘-->
  142. <Picker
  143. v-if="type == 10"
  144. @confirm="updataResultSingle"
  145. :columns="getColumns().arr"
  146. :columnsp="getColumns().arrp"
  147. :num="num"
  148. :defaultIndex="defaultIndex"
  149. ></Picker>
  150. <!--时间拨盘,拨盘内容写死-->
  151. <Picker
  152. v-if="type == 9"
  153. :symptomResult="symptomResult"
  154. :columns="timeColumns"
  155. :columnsp="timeColumns"
  156. :defaultVal="pickDVal"
  157. @confirm="updataResultSingle"
  158. :num="num"
  159. :defaultIndex="defaultIndex"
  160. ></Picker>
  161. <PushSymptom
  162. v-if="type == 99"
  163. @updataResult="updataResultSingle"
  164. :num="num"
  165. @warning="showWarn"
  166. ></PushSymptom>
  167. <!-- 上传图片 -->
  168. <UploadImg
  169. v-if="type == 4"
  170. :num="num"
  171. :item="symptomResult"
  172. :moduleType="symptomResult.type"
  173. @warning="showWarn"
  174. @updataResult="updataResultSingle"
  175. :imgList="imgs"
  176. />
  177. <!-- 输入框 -->
  178. <!--<Input v-if="type==7"
  179. :num="num"
  180. :item="symptomResult"
  181. :key="symptomResult.id"
  182. @updata="updataResultSingle"/>-->
  183. <!-- 文本域 -->
  184. <ComTextArea
  185. v-if="type == 5"
  186. :num="num"
  187. :item="symptomResult"
  188. width="92%"
  189. @updata="updataResultSingle"
  190. />
  191. <div class="submit" v-if="showPreview">
  192. <a href="javascript:void(0)" @click="previewRes">提交并预览</a>
  193. </div>
  194. <!--<div v-if="wrong" class="tip">{{waring}}</div>-->
  195. <TipWarning v-if="wrong" :text="waring" @close="closeTip" />
  196. <Toast
  197. message="预问诊填写成功,是否需要填写量表?"
  198. :show="showToast"
  199. title="去填写"
  200. title2="提交并预览病历"
  201. @comfirn="comfirn"
  202. @cancel="cancel"
  203. />
  204. </div>
  205. </template>
  206. <script>
  207. import BScroll from "better-scroll";
  208. import Radio from "../common/Radio";
  209. import Select from "../common/Select";
  210. import Dialog from "../common/Dialog";
  211. import Picker from "../common/Picker";
  212. import Label from "../common/Label.vue";
  213. import ComTextArea from "../common/ComTextArea.vue";
  214. /*import Input from '../common/Input.vue';*/
  215. import PickTime from "../common/PickTime.vue";
  216. import UploadImg from "../common/UploadImg.vue";
  217. import PushSymptom from "../common/PushSymptom.vue";
  218. import ConfirmBox from "../common/ConfirmBox";
  219. import UsualSymptom from "../common/UsualSymptom";
  220. import MultSelect from "../common/MultSelect.vue";
  221. import TipWarning from "../common/TipWarning.vue";
  222. import Head from "../common/Head.vue";
  223. import api from "../utils/api.js";
  224. import Toast from "../common/Toast.vue";
  225. import { mapState } from "vuex";
  226. import { moduleCP, moduleConfig, getValuesArr, getNSum } from "@utils/tools";
  227. export default {
  228. name: "MainPage",
  229. data() {
  230. return {
  231. noAllowed: false, //未登录
  232. num: -1, //题目计数
  233. pickDVal: "1天", //时间控件默认值
  234. allMoudles: [],
  235. showUsual: false, //常用症状显示
  236. timeColumns: [], //固定2列时间滑块数据
  237. activeTab: 1, //当前模块
  238. activeNum: 0, //当前问题的index,整体顺序
  239. scroll: null,
  240. canceledSym: false, //是否已修改过主症状
  241. canceledQa: -1, //在对应模块的排行
  242. cancelNum: -1, //整体排行
  243. cancelTab: -1,
  244. deledUpload: [], //被删除的上传控件数据(记录用于修改时恢复)
  245. type: -1, //当前显示的控件类型
  246. showPreview: false, //显示预览按钮
  247. selectedSymptom: {},
  248. symptomResult: "", //症状选择
  249. connectResult: [], //关联问题的id
  250. contentResult: {}, //选中的结果val医生端显示,valp患者端显示
  251. symptomQasList: [], //症状详情所有的问题
  252. diagnoseQasList: [], //诊疗详情所有问题
  253. othersQasList: [], //其他情况所有问题
  254. addContentQasList: [],
  255. moduleMap: {
  256. 1: "symptom",
  257. 51: "diagnose",
  258. 3: "others",
  259. 52: "addContent",
  260. },
  261. defaultIndex: 0, //温度默认值
  262. order: 0,
  263. userInfo: {}, //用户信息
  264. pdbm: "8.5rem",
  265. waring: "", //错误提示语
  266. wrong: false, //是否显示错误toast
  267. showConfirm: false,
  268. time: 1000,
  269. progressNum: "",
  270. showToast: false,
  271. };
  272. },
  273. created() {
  274. //const userInfo= JSON.parse(localStorage.getItem("userInfo"))
  275. const userInfo = this.$store.state.pathInfo;
  276. if (!userInfo.hospitalCode) {
  277. //用户数据丢失,刷新或本页面分享时,跳回登录页
  278. const code =
  279. JSON.parse(localStorage.getItem("infoParam")) ||
  280. JSON.parse(localStorage.getItem("loginParam"));
  281. this.noAllowed = true;
  282. this.$router.push({
  283. path: "/?hospitalCode=" + code.hospitalCode,
  284. });
  285. return;
  286. }
  287. this.userInfo = userInfo;
  288. let tmpModule = moduleConfig(this.config, this.tmpAllMoudles);
  289. this.allMoudles = tmpModule.data;
  290. this.getTimeColumns();
  291. this.updata();
  292. console.log(this.userInfo);
  293. },
  294. mounted() {
  295. if (this.noAllowed) return;
  296. this.$nextTick(() => {
  297. let bs = new BScroll(".wrapper", {
  298. probeType: 3,
  299. click: true,
  300. });
  301. this.scroll = bs;
  302. });
  303. // this.tmpSymptom = JSON.parse(JSON.stringify(data))
  304. //this.symptomResult = data.symptom.result;
  305. },
  306. computed: {
  307. ...mapState({
  308. imgs: (state) => state.diagnose.imgSrc,
  309. tmpAllMoudles: (state) => state.allMoudles,
  310. config: (state) => state.sysConfig,
  311. scaleInfo:(state) => state.scaleInfo,
  312. }),
  313. moduleKeys() {
  314. return this.allMoudles.map((it) => {
  315. return it.type;
  316. });
  317. },
  318. progress() {
  319. if (this.num === -1) {
  320. return "0.1px";
  321. }
  322. const moduleName = this.moduleMap[this.activeTab] + "QasList";
  323. const pnum = this[moduleName].length;
  324. const snum = this.num + 1 > pnum ? pnum : this.num + 1;
  325. this.progressNum = (pnum === 0 ? 0 : snum) + "/" + pnum;
  326. const precent = (this.num + 1) / this[moduleName].length;
  327. return precent * 100 + "%";
  328. },
  329. },
  330. watch: {
  331. num: function () {
  332. let n = 0;
  333. let numArr = this.moduleKeys.map((i, index) => {
  334. if (this.activeTab !== -1 && i === this.activeTab) {
  335. n = index;
  336. }
  337. return this[this.moduleMap[i] + "QasList"].length;
  338. });
  339. let numArrCopy = [...numArr];
  340. numArrCopy.length = this.cancelTab !== -1 ? this.cancelTab : 0;
  341. numArr.length = n;
  342. this.cancelNum = getNSum(numArrCopy) + this.canceledQa;
  343. this.activeNum = getNSum(numArr) + this.num;
  344. },
  345. },
  346. methods: {
  347. comfirn() {},
  348. comfirn() {
  349. this.$router.push({
  350. path: "/chooseScale",
  351. });
  352. },
  353. cancel() {
  354. this.$router.push({
  355. path: "/preview",
  356. });
  357. },
  358. getColumns() {
  359. //后台数据为空,则使用默认值
  360. const obj = getValuesArr(this.symptomResult.questionDetailList);
  361. const arr = obj.vals.length > 0 ? obj.vals : undefined;
  362. const arrp = obj.vals.length > 0 ? obj.valsp : undefined;
  363. return { arr, arrp };
  364. },
  365. previewRes() {
  366. if (
  367. (this.userInfo.hospitalDeptName == "呼吸内科/咳嗽/戒烟门诊xs" ||
  368. this.userInfo.hospitalDeptName == "全科") &&
  369. !this.scaleInfo
  370. ) {
  371. this.showToast = true;
  372. this.$store.commit("setistrue", 'true');
  373. } else {
  374. this.$router.replace({
  375. path: "/preview",
  376. });
  377. this.$store.commit("setistrue", 'true');
  378. }
  379. },
  380. updata() {
  381. this.symptomQasList = [];
  382. //this.pdbm = '8.5rem';
  383. this.showUsual = true;
  384. this.num = 0;
  385. },
  386. selectToggle(type, result, flg, idx, order) {
  387. return;
  388. if (flg) {
  389. this.num = 1;
  390. }
  391. this.symptomResult = result;
  392. this.type = type;
  393. this.order = order;
  394. this.scrollDown();
  395. },
  396. getTimeColumns() {
  397. let num = [];
  398. for (let i = 1; i <= 60; i++) {
  399. num.push(i);
  400. }
  401. let unit = ["分钟", "小时", "天", "周", "月", "年"];
  402. this.timeColumns = [
  403. {
  404. values: num,
  405. className: "column1",
  406. defaultIndex: 0,
  407. },
  408. {
  409. values: unit,
  410. className: "column2",
  411. defaultIndex: 2,
  412. },
  413. ];
  414. },
  415. cancelSelected() {
  416. //修改题目
  417. let moduleName = "",
  418. tmpArr = [],
  419. tmpPreItem = {},
  420. tmpNowItem = {};
  421. moduleName = this.moduleMap[this.activeTab] + "QasList";
  422. tmpArr = this[moduleName];
  423. tmpNowItem = tmpArr[this.num];
  424. this.type = -1;
  425. if (tmpNowItem) {
  426. tmpNowItem.show = false;
  427. } else {
  428. //最后一题时没有下一题
  429. this.showPreview = false;
  430. }
  431. const keyIdx = this.moduleKeys.findIndex((i) => i == this.activeTab);
  432. if (this.activeTab !== this.moduleKeys[0] && this.num === 0) {
  433. //取消上一阶段的最后一题时
  434. this.activeTab = this.moduleKeys[keyIdx - 1];
  435. this.cancelTab = keyIdx - 1;
  436. moduleName = this.moduleMap[this.activeTab] + "QasList";
  437. const n = this[moduleName].length - 1;
  438. tmpPreItem = this[moduleName][n];
  439. this.num = n;
  440. } else {
  441. this.cancelTab = keyIdx;
  442. tmpPreItem = tmpArr[this.num - 1];
  443. this.num = this.num - 1;
  444. }
  445. this.delExtQa(tmpPreItem, this.num); //修改时已关联的问题先删除
  446. +tmpPreItem.controlType === 5 ? "" : (tmpPreItem.content = "");
  447. this.symptomResult = tmpPreItem;
  448. const timer = setTimeout(() => {
  449. this.type = tmpPreItem.controlType;
  450. clearTimeout(timer);
  451. });
  452. this.canceledQa = this.num; //记录被修改过的题目,只可修改一次
  453. },
  454. formatQaArr(obj) {
  455. let arr = [],
  456. nobj = JSON.parse(JSON.stringify(obj));
  457. for (let i in nobj) {
  458. arr.push(Object.assign({}, nobj[i]));
  459. }
  460. return arr;
  461. },
  462. addExtQa(obj, i, selectedN) {
  463. const mName = this.moduleMap[this.activeTab];
  464. let moduleName = mName + "QasList";
  465. const dataArr = this.formatQaArr(obj);
  466. this[moduleName][i].selectedNum = selectedN; //选中项关联子问题的个数
  467. this[moduleName].splice(i + 1, 0, ...dataArr);
  468. this.$store.commit("setModuleDatas", { data: this[moduleName], mName });
  469. },
  470. delExtQa(obj, i) {
  471. //修改时已关联的问题先删除
  472. const mName = this.moduleMap[this.activeTab];
  473. let moduleName = mName + "QasList";
  474. let n = obj.selectedNum;
  475. if (n) {
  476. this[moduleName].splice(i + 1, n);
  477. }
  478. this.$store.commit("setModuleDatas", { data: this[moduleName], mName });
  479. },
  480. updataResultSingle(result, contentResult, num) {
  481. this.num = num;
  482. this.type = -1;
  483. const mkeys = this.moduleKeys;
  484. let moduleName = this.moduleMap[this.activeTab] + "QasList";
  485. let tmpArr = JSON.parse(JSON.stringify(this[moduleName]));
  486. tmpArr[num - 1].content = contentResult.valp;
  487. //选没有可上传报告,则上传控件不显示
  488. const noUpload =
  489. this.symptomResult.id === 999999 &&
  490. contentResult.valp.indexOf("没有") !== -1;
  491. if (noUpload && this.deledUpload.length === 0) {
  492. //是否可上传没有被修改过
  493. this.deledUpload = tmpArr.splice(num, 1);
  494. this.$store.commit("cancelImgs");
  495. } else if (
  496. this.symptomResult.id === 999999 &&
  497. !noUpload &&
  498. this.deledUpload.length > 0
  499. ) {
  500. tmpArr.splice(num, 0, ...this.deledUpload);
  501. this.$store.commit("cancelImgs");
  502. }
  503. this[moduleName] = tmpArr;
  504. //上传的图片及是否有可上传***答案不显示在预览所以不记录到state.diagnose.text中
  505. if (
  506. this.symptomResult.id !== 999999 &&
  507. this.symptomResult.controlType != 4
  508. ) {
  509. // console.log('当前问题单选',this.num-1,this.canceledQa,contentResult.val,contentResult.valp)
  510. this.$store.commit("setText", {
  511. type: this.activeTab,
  512. text: contentResult.val,
  513. textP: contentResult.valp,
  514. idx: contentResult.idx,
  515. flag: contentResult.flag,
  516. isEdit: this.num - 1 == this.canceledQa,
  517. });
  518. }
  519. //console.log(this.$store.state); //最后一题答完
  520. if (
  521. +num === this[moduleName].length ||
  522. (noUpload && +num === this[moduleName].length + 1)
  523. ) {
  524. if (this.activeTab === mkeys[mkeys.length - 1] || mkeys.length == 1) {
  525. //最后一个模块时显示预览按钮
  526. this.showPreview = true;
  527. return;
  528. }
  529. const state = this.$store.state;
  530. const tabIndx = this.moduleKeys.findIndex((i) => i == this.activeTab);
  531. this.activeTab = this.moduleKeys[+tabIndx + 1]; //进入下一个阶段问题
  532. moduleName = this.moduleMap[this.activeTab] + "QasList";
  533. const mDataName = this.moduleMap[this.activeTab];
  534. this[moduleName] = JSON.parse(JSON.stringify(state[mDataName].datas));
  535. let tmpArrDetail1 = JSON.parse(JSON.stringify(this[moduleName][0]));
  536. this[moduleName][0] = tmpArrDetail1;
  537. let timer = setTimeout(() => {
  538. // this.activeTab=this.moduleKeys[+tabIndx+1]; //进入下一个阶段问题
  539. this.num = 0;
  540. const tmpNowItem = this[moduleName][this.num];
  541. this.type = tmpNowItem.controlType;
  542. tmpNowItem.show = true;
  543. //console.log(tmpNowItem)
  544. this.symptomResult = tmpNowItem;
  545. });
  546. this.canceledQa = -1; //进入下一阶段需要初始化
  547. this.$nextTick(() => {
  548. this.scroll.refresh();
  549. this.scroll.scrollTo(0, this.scroll.maxScrollY, 500);
  550. });
  551. return;
  552. }
  553. let tmpArrDetailResult = JSON.parse(
  554. JSON.stringify(this[moduleName][num])
  555. );
  556. let tmpArrDetail = JSON.parse(JSON.stringify(tmpArr[num]));
  557. let timer = setTimeout(() => {
  558. this.type = tmpArrDetail.controlType;
  559. tmpArrDetail.show = true;
  560. tmpArr[num] = tmpArrDetail;
  561. this.symptomResult = tmpArrDetailResult;
  562. clearTimeout(timer);
  563. }, this.time);
  564. this.$nextTick(() => {
  565. this.scroll.refresh();
  566. this.scroll.scrollTo(0, this.scroll.maxScrollY, 500);
  567. });
  568. },
  569. showWarn(text) {
  570. this.waring = text;
  571. this.wrong = true;
  572. },
  573. closeTip() {
  574. this.wrong = false;
  575. },
  576. cancelSymptom() {
  577. //修改(即删除)已选主症
  578. this.symptomQasList = []; //console.log(this.$store.state)
  579. this.selectedSymptom = [];
  580. this.showUsual = true;
  581. this.canceledSym = true;
  582. this.type = -1;
  583. this.$store.commit("clearDeledBuried"); //症状修改删除原埋点暂存数据
  584. this.$store.commit("setChoose", { choose: [], type: moduleCP["symp"] });
  585. },
  586. selectUsual(sym) {
  587. this.getSymptomQas(sym.questionId); //获取症状下的关联问题
  588. sym.idx = 1; //标记主诉
  589. this.$store.commit("setChoose", {
  590. choose: [sym],
  591. type: moduleCP["symp"],
  592. });
  593. this.selectedSymptom = sym; //设置搜索选中症状
  594. this.showUsual = false; //关闭症状选择进入下一个问题
  595. this.pdbm = "10.2rem";
  596. setTimeout(() => {
  597. this.scrollDown();
  598. }, 0);
  599. },
  600. getSymptomQas(id) {
  601. const param = {
  602. age: this.userInfo.patientAge,
  603. id: id,
  604. sexType: this.userInfo.sexType,
  605. };
  606. api.getById(param).then((res) => {
  607. const result = res.data;
  608. if (result.code === "0") {
  609. const data = result.data;
  610. if (!data) {
  611. return;
  612. }
  613. let qaLis = data.questionMapping;
  614. if (qaLis.length === 0) {
  615. this.wrong = true;
  616. this.waring = "该症状数据未维护";
  617. return;
  618. }
  619. //qaLis.length=2; //开发测试代码,要删除
  620. qaLis[0].show = true; //第一题自动显示
  621. this.type = qaLis[0].controlType;
  622. this.symptomResult = qaLis[0];
  623. this.$store.commit("setSymptomDatas", qaLis);
  624. this.symptomQasList = this.$store.state.symptom.origin;
  625. } else {
  626. }
  627. });
  628. },
  629. scrollDown() {
  630. this.scroll.scrollTo(0, this.scroll.maxScrollY);
  631. },
  632. },
  633. components: {
  634. Radio,
  635. Select,
  636. Dialog,
  637. Picker,
  638. Label,
  639. ComTextArea,
  640. /*Input,*/
  641. PickTime,
  642. UploadImg,
  643. PushSymptom,
  644. ConfirmBox,
  645. UsualSymptom,
  646. MultSelect,
  647. TipWarning,
  648. Head,
  649. Toast
  650. },
  651. };
  652. </script>
  653. <style lang="less" scoped>
  654. @import "../less/base.less";
  655. .wrapper {
  656. height: 100%;
  657. width: 100%;
  658. position: fixed;
  659. box-sizing: border-box;
  660. overflow: hidden;
  661. top: 1.4rem;
  662. }
  663. .scrollPart {
  664. // padding-bottom: 5rem;
  665. // padding-top: 1.44rem;
  666. // box-sizing: border-box;
  667. }
  668. .progress-bar {
  669. height: 0.8rem;
  670. line-height: 0.44rem;
  671. background: #fff;
  672. color: #aaa;
  673. /*margin-bottom:.4rem;*/
  674. .title {
  675. height: 100%;
  676. }
  677. span {
  678. display: inline-block;
  679. font-size: 0.26rem;
  680. color: #aaa;
  681. text-align: center;
  682. &:not(:last-child):after {
  683. content: ">";
  684. float: right;
  685. color: #aaa;
  686. }
  687. }
  688. .active {
  689. font-size: #font[dialog];
  690. color: #colors[theme];
  691. font-weight: 500;
  692. }
  693. .progress {
  694. height: 0.06rem;
  695. background: #f5f5f5;
  696. p {
  697. width: 0.1px;
  698. height: 100%;
  699. background: #colors[theme];
  700. }
  701. }
  702. }
  703. .right {
  704. padding-top: 0.2rem;
  705. margin-bottom: 0.12rem;
  706. padding-right: 0.24rem;
  707. .content {
  708. max-width: 5rem;
  709. background-color: #colors[theme];
  710. border-radius: 0.24rem 0 0.24rem 0.24rem;
  711. margin-top: 0.3rem;
  712. font-size: #font[dialog];
  713. padding: 0.24rem;
  714. display: inline-block;
  715. p {
  716. color: #fff;
  717. }
  718. }
  719. img {
  720. width: 0.8rem;
  721. height: 0.8rem;
  722. margin-left: 0.24rem;
  723. }
  724. }
  725. .left {
  726. margin-bottom: 0.2rem;
  727. padding-top: 0.12rem;
  728. padding-left: 0.24rem;
  729. .content {
  730. max-width: 5rem;
  731. background-color: #colors[bgques];
  732. border-radius: 0 0.24rem 0.24rem 0.24rem;
  733. margin-top: 0.3rem;
  734. font-size: #font[dialog];
  735. padding: 0.24rem;
  736. display: inline-block;
  737. }
  738. img {
  739. width: 0.8rem;
  740. height: 0.8rem;
  741. margin-right: 0.24rem;
  742. }
  743. }
  744. .edit {
  745. color: #colors[theme];
  746. font-style: normal;
  747. font-size: #font[dialog];
  748. float: right;
  749. display: inline-block;
  750. margin-top: 0.56rem;
  751. margin-right: 0.24rem;
  752. }
  753. .submit {
  754. position: fixed;
  755. bottom: 0;
  756. width: 100%;
  757. a {
  758. display: inline-block;
  759. width: 100%;
  760. height: 0.88rem;
  761. font-size: #font[dialog];
  762. background-color: #colors[btn];
  763. line-height: 0.88rem;
  764. margin-top: 0.8rem;
  765. text-align: center;
  766. color: #fff;
  767. }
  768. }
  769. </style>