DiagCalc.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. <template>
  2. <div class="container">
  3. <div class="bgimg"></div>
  4. <div class="content" v-if="!popupVisible">
  5. <div class="title">FVIII药代动力学检测</div>
  6. <div class="diagForm">
  7. <mt-field label="病例体重(kg)" placeholder="整数或1位小数" type="number" v-model="form.bltz"></mt-field>
  8. <mt-field label="注射产品" placeholder="请选择产品" class="inputDisable" disabled v-model="form.mpro"
  9. @click.native="mproFlag=true;mfreqFlag=false">
  10. <img src="../assets/images/down.png" alt="" width="16px">
  11. </mt-field>
  12. <mt-field label="注射剂量(IU)" placeholder="请输入整数" v-model="form.zsjl" type="number"></mt-field>
  13. <div class="numSubTitle">
  14. <mt-field class="inputDisable" disabled placeholder="请选择时间" v-model="form.zssjt0"
  15. @click.native="$refs.t0Picker.open()">
  16. <img src="../assets/images/down.png" alt="" width="16px">
  17. </mt-field>
  18. <span>注射时间t<sub>0</sub></span>
  19. </div>
  20. <mt-field label="基础活性%" placeholder="请输入2位小数" v-model="form.jchx"></mt-field>
  21. <!-- <mt-field label="注射后半小时内活性%" placeholder="请输入2位小数" type="number" v-model="form.zs30hx"></mt-field> -->
  22. <div class="numSubTitle">
  23. <mt-field class="inputDisable" disabled placeholder="请选择时间" v-model="form.cxsjt1"
  24. @click.native="$refs.t1Picker.open()">
  25. <img src="../assets/images/down.png" alt="" width="16px">
  26. </mt-field>
  27. <span>采血时间t<sub>1</sub></span>
  28. </div>
  29. <div class="numSubTitle">
  30. <mt-field placeholder="请输入2位小数" v-model="form.t1hx" type="number"></mt-field>
  31. <span>t<sub>1</sub>点活性%</span>
  32. </div>
  33. <div class="numSubTitle">
  34. <mt-field class="inputDisable" disabled placeholder="请选择时间" v-model="form.cxsjt2"
  35. @click.native="$refs.t2Picker.open()">
  36. <img src="../assets/images/down.png" alt="" width="16px">
  37. </mt-field>
  38. <span>采血时间t<sub>2</sub></span>
  39. </div>
  40. <div class="numSubTitle">
  41. <mt-field placeholder="请输入2位小数" v-model="form.t2hx" type="number"></mt-field>
  42. <span>t<sub>2</sub>点活性%</span>
  43. </div>
  44. <div class="numSubTitle">
  45. <mt-field class="inputDisable" disabled placeholder="请选择时间" v-model="form.cxsjt3"
  46. @click.native="$refs.t3Picker.open()">
  47. <img src="../assets/images/down.png" alt="" width="16px">
  48. </mt-field>
  49. <span>采血时间t<sub>3</sub></span>
  50. </div>
  51. <div class="numSubTitle">
  52. <mt-field placeholder="请输入2位小数" v-model="form.t3hx" type="number"></mt-field>
  53. <span>t<sub>3</sub>点活性%</span>
  54. </div>
  55. </div>
  56. <!-- <div class="diagForm">
  57. <div class="formTitle">血友病治疗方案</div>
  58. <mt-field label="预防谷活性" type="number" placeholder="请输入整数" v-model="form.yfghx"></mt-field>
  59. <mt-field class="inputDisable" disabled label="注射频次" placeholder="请选择" v-model="form.zspc"
  60. @click.native="mfreqFlag=true">
  61. <img src="../assets/images/down.png" alt="" width="16px">
  62. </mt-field>
  63. </div> -->
  64. <div class="footer">
  65. <div class="jbbtn" @click="$router.go(-1)">返回</div>
  66. <div class="jbbtn" @click="submit">确定</div>
  67. </div>
  68. </div>
  69. <!-- 注射时间t0 -->
  70. <mt-datetime-picker ref="t0Picker" type="datetime" year-format="{value} 年" month-format="{value} 月"
  71. date-format="{value} 日" hourFormat="{value}时" minuteFormat="{value}分" @confirm='changeTime0' :endDate='endDate'
  72. :startDate='startDate' v-model="now" @touchmove.native.stop.prevent>
  73. </mt-datetime-picker>
  74. <!-- 采血时间t1 -->
  75. <mt-datetime-picker ref="t1Picker" type="datetime" year-format="{value} 年" month-format="{value} 月"
  76. date-format="{value} 日" hourFormat="{value}时" minuteFormat="{value}分" @confirm='changeTime1' :endDate='endDate'
  77. :startDate='startDate' v-model="now" @touchmove.native.stop.prevent>
  78. </mt-datetime-picker>
  79. <!-- 采血时间t2 -->
  80. <mt-datetime-picker ref="t2Picker" type="datetime" year-format="{value} 年" month-format="{value} 月"
  81. date-format="{value} 日" hourFormat="{value}时" minuteFormat="{value}分" @confirm='changeTime2' :endDate='endDate'
  82. :startDate='startDate' v-model="now" @touchmove.native.stop.prevent>
  83. </mt-datetime-picker>
  84. <!-- 采血时间t3 -->
  85. <mt-datetime-picker ref="t3Picker" type="datetime" year-format="{value} 年" month-format="{value} 月"
  86. date-format="{value} 日" hourFormat="{value}时" minuteFormat="{value}分" @confirm='changeTime3' :endDate='endDate'
  87. :startDate='startDate' v-model="now" @touchmove.native.stop.prevent>
  88. </mt-datetime-picker>
  89. <!-- 注射频次 -->
  90. <!-- <mt-picker @change="onValuesChange1" v-if="mfreqFlag" :slots="slots1" ref="sexPicker1" class="sexPicker"
  91. :showToolbar="true" @touchmove.native.stop.prevent>
  92. <div class="pickerConfirm" @click="mfreqFlag=false">确认</div>
  93. </mt-picker> -->
  94. <!-- 注射产品 -->
  95. <mt-picker @change="onValuesChange" v-if="mproFlag" :slots="slots" ref="sexPicker" class="sexPicker"
  96. :showToolbar="true">
  97. <div class="pickerConfirm" @click="mproFlag=false">确认</div>
  98. </mt-picker>
  99. <!-- 试算弹出框 -->
  100. <div class="content" v-if="popupVisible">
  101. <div class="popupContainer">
  102. <!-- 药代动力学参数 -->
  103. <div class="diagShowForm">
  104. <div class="formTitle">FVIII 药代动力学参数</div>
  105. <div style="display:flex;">
  106. <div class="rowfont" style="width:50%;">半衰期(小时)</div>
  107. <div class="rowfont" style="width:50%;color:#888;">{{form.bsq}}</div>
  108. </div>
  109. <div style="display:flex;">
  110. <div class="rowfont" style="width:50%;">利用率%</div>
  111. <div class="rowfont" style="width:50%;color:#888;">{{form.lyl*100}}</div>
  112. </div>
  113. <div style="display:flex;">
  114. <div class="rowfont" style="width:50%;">预期峰值活性%</div>
  115. <div class="rowfont" style="width:50%;color:#888;">{{form.yqfzhx}}</div>
  116. </div>
  117. </div>
  118. <!-- 血友病预防治疗剂量计算 -->
  119. <div class="diagShowForm">
  120. <div class="formTitle">血友病预防治疗剂量计算</div>
  121. <div class="popupDiagForm">
  122. <mt-field label="目标谷活性%" type="number" placeholder="请输入整数" v-model="form.yfghx" @input.native="mczsjl=''">
  123. </mt-field>
  124. <mt-field class="inputDisable" disabled label="注射频次" placeholder="请选择" v-model="form.zspc"
  125. @click.native="mfreqFlag=true">
  126. <img src="../assets/images/down.png" alt="" width="16px">
  127. </mt-field>
  128. <mt-field label="每次注射剂量(IU)" type="number" placeholder="" v-model="mczsjl" disabled></mt-field>
  129. </div>
  130. </div>
  131. <div class="popupFooter">
  132. <div class="jbbtn" @click="goback">返回</div>
  133. <div class="jbbtn" @click="goSelect">确定</div>
  134. <div class="jbbtn" @click="calc_mczsjl">计算</div>
  135. </div>
  136. </div>
  137. <!-- 注射频次 -->
  138. <mt-picker @change="onValuesChange1" v-if="mfreqFlag" :slots="slots1" ref="sexPicker1" class="sexPicker"
  139. :showToolbar="true" @touchmove.native.stop.prevent>
  140. <div class="pickerConfirm" @click="mfreqFlag=false">确认</div>
  141. </mt-picker>
  142. </div>
  143. </div>
  144. </template>
  145. <script>
  146. import {
  147. Field,
  148. MessageBox,
  149. Toast,
  150. Popup
  151. } from 'mint-ui'
  152. export default {
  153. name: 'Index',
  154. components: {
  155. Field,
  156. MessageBox,
  157. Toast,
  158. Popup
  159. },
  160. data() {
  161. return {
  162. msg: 'Welcome to Your Vue.js App',
  163. mfreqFlag: false,
  164. form: {
  165. jchx: '',
  166. zssjt0: '',
  167. cxsjt1: '',
  168. cxsjt2: '',
  169. cxsjt3: '',
  170. mczsjl: null
  171. },
  172. mczsjl: null,
  173. slots1: [{
  174. flex: 1,
  175. values: this.$const.zspc,
  176. className: 'slot1',
  177. textAlign: 'center'
  178. }],
  179. startDate: new Date(this.$datetime.formatDateTime(new Date("2013-01-01 00:00:00"))),
  180. endDate: new Date(this.$datetime.formatDateTime(new Date("2024-01-01 00:00:00"))),
  181. now: new Date(),
  182. mproFlag: false,
  183. slots: [{
  184. flex: 1,
  185. values: this.$const.mprolist,
  186. className: 'slot1',
  187. textAlign: 'center'
  188. }],
  189. popupVisible: this.$route.query.edit ? true : false,
  190. patient_id: this.$route.query.patid
  191. }
  192. },
  193. methods: {
  194. goback() {
  195. if (this.$route.query && this.$route.query.edit && this.$route.query.back) {
  196. this.$router.push({
  197. path: this.$route.query.back
  198. });
  199. } else {
  200. this.popupVisible = false;
  201. }
  202. },
  203. goPage() {
  204. this.$router.push('/diagcalcshow')
  205. },
  206. changeTime0(value) {
  207. this.form.zssjt0 = this.$datetime.formatDateTime(value).replaceAll("/", "-")
  208. },
  209. changeTime1(value) {
  210. this.form.cxsjt1 = this.$datetime.formatDateTime(value).replaceAll("/", "-")
  211. },
  212. changeTime2(value) {
  213. this.form.cxsjt2 = this.$datetime.formatDateTime(value).replaceAll("/", "-")
  214. },
  215. changeTime3(value) {
  216. this.form.cxsjt3 = this.$datetime.formatDateTime(value).replaceAll("/", "-")
  217. },
  218. onValuesChange(picker, values) {
  219. if (picker.getSlotValue(0)) {
  220. this.form.mpro = picker.getSlotValue(0)
  221. } else {
  222. this.form.mpro = "人血FVIII"
  223. }
  224. },
  225. onValuesChange1(picker, values) {
  226. if (picker.getSlotValue(0)) {
  227. this.form.zspc = picker.getSlotValue(0)
  228. } else {
  229. this.form.zspc = this.$const.zspc[0]
  230. }
  231. this.form.mczsjl = ""
  232. },
  233. goSelect() {
  234. let params = this.form
  235. params.patient_id = this.patient_id
  236. let that = this
  237. this.$api.regPatientCase(params).then(res => {
  238. if (!res.data.code) {
  239. this.$router.push({
  240. path: 'pretraitcase',
  241. query: {
  242. id: res.data.data.id
  243. }
  244. })
  245. } else {
  246. Toast(res.data.message)
  247. }
  248. })
  249. },
  250. submit() {
  251. if (!this.form.bltz) {
  252. MessageBox({
  253. title: '提示',
  254. message: '请输入病例体重'
  255. })
  256. return
  257. } else {
  258. if (!this.$recheck.checkIntFloat1(this.form.bltz)) {
  259. MessageBox({
  260. title: '提示',
  261. message: '病例体重请输入整数或1位小数'
  262. })
  263. return
  264. }
  265. }
  266. if (!this.form.zsjl) {
  267. MessageBox({
  268. title: '提示',
  269. message: '请输入注射剂量'
  270. })
  271. return
  272. } else {
  273. if (!this.$recheck.checkInt(this.form.zsjl)) {
  274. MessageBox({
  275. title: '提示',
  276. message: '注射剂量请输入整数'
  277. })
  278. return
  279. }
  280. }
  281. if (!this.form.zssjt0) {
  282. MessageBox({
  283. title: '提示',
  284. message: '请选择注射时间t<sub>0</sub>'
  285. })
  286. return
  287. }
  288. if (!this.$recheck.checkIntFloat12(this.form.jchx)) {
  289. MessageBox({
  290. title: '提示',
  291. message: '请输入整数或2位小数?'
  292. })
  293. return
  294. }
  295. // if (!this.form.zs30hx) {
  296. // MessageBox({
  297. // title: '提示',
  298. // message: '请输入注射后半小时内活性'
  299. // })
  300. // return
  301. // } else {
  302. // if (!this.$recheck.checkIntFloat12(this.form.zs30hx)) {
  303. // MessageBox({
  304. // title: '提示',
  305. // message: '注射后半小时内活性请输入整数或2位小数'
  306. // })
  307. // return
  308. // }
  309. // }
  310. if (!this.form.cxsjt1) {
  311. MessageBox({
  312. title: '提示',
  313. message: '请选择采血时间t<sub>1</sub>'
  314. })
  315. return
  316. }
  317. if (!this.form.t1hx) {
  318. MessageBox({
  319. title: '提示',
  320. message: '请输入t<sub>1</sub>点活性'
  321. })
  322. return
  323. } else {
  324. if (!this.$recheck.checkIntFloat12(this.form.t1hx)) {
  325. MessageBox({
  326. title: '提示',
  327. message: 't<sub>1</sub>点活性请输入整数或2位小数'
  328. })
  329. return
  330. }
  331. }
  332. if (!this.form.cxsjt2) {
  333. MessageBox({
  334. title: '提示',
  335. message: '请选择采血时间t<sub>2</sub>'
  336. })
  337. return
  338. }
  339. if (!this.form.t2hx) {
  340. MessageBox({
  341. title: '提示',
  342. message: '请输入t<sub>2</sub>点活性'
  343. })
  344. return
  345. } else {
  346. if (!this.$recheck.checkIntFloat12(this.form.t2hx)) {
  347. MessageBox({
  348. title: '提示',
  349. message: 't<sub>2</sub>点活性请输入整数或2位小数'
  350. })
  351. return
  352. }
  353. }
  354. if (!this.form.cxsjt3) {
  355. MessageBox({
  356. title: '提示',
  357. message: '请选择采血时间t<sub>3</sub>'
  358. })
  359. return
  360. }
  361. if (!this.form.t3hx) {
  362. MessageBox({
  363. title: '提示',
  364. message: '请输入t<sub>3</sub>点活性'
  365. })
  366. return
  367. } else {
  368. if (!this.$recheck.checkIntFloat12(this.form.t3hx)) {
  369. MessageBox({
  370. title: '提示',
  371. message: 't<sub>3</sub>点活性请输入整数或2位小数'
  372. })
  373. return
  374. }
  375. }
  376. // if (!this.form.yfghx) {
  377. // MessageBox({
  378. // title: '提示',
  379. // message: '请输入预防谷活性'
  380. // })
  381. // return
  382. // } else {
  383. // if (!this.$recheck.checkInt(this.form.yfghx)) {
  384. // MessageBox({
  385. // title: '提示',
  386. // message: '预防谷活性请输入整数'
  387. // })
  388. // return
  389. // }
  390. // }
  391. // if (!this.form.zspc) {
  392. // MessageBox({
  393. // title: '提示',
  394. // message: '请选择注射频次'
  395. // })
  396. // return
  397. // }
  398. let params = this.form
  399. params.patient_id = this.patient_id
  400. let that = this
  401. this.$api.regPatientCase(params).then(res => {
  402. if (!res.data.code) {
  403. that.form = res.data.data;
  404. this.popupVisible = true;
  405. } else {
  406. Toast(res.data.message)
  407. }
  408. })
  409. },
  410. calc_mczsjl() {
  411. let that = this;
  412. this.$api.calc_mczsjl(this.form).then(res => {
  413. if (res.data.code == 0) {
  414. this.$set(this.form, "mczsjl", res.data.data)
  415. this.mczsjl = res.data.data
  416. }
  417. })
  418. }
  419. },
  420. created() {
  421. let patid = this.$route.query.patid;
  422. if (!patid) {
  423. this.$router.push("regpatinfo")
  424. } else {
  425. if(this.$route.query && this.$route.query.id){
  426. let case_id = this.$route.query.id
  427. this.$api.getPatientCaseInfo({id:case_id}).then(res=>{
  428. this.form = res.data.data
  429. this.mczsjl = res.data.data.mczsjl
  430. })
  431. }else{
  432. this.$api.getPatientDoingCase({
  433. patid: patid
  434. }).then(res => {
  435. if (res.data.code == 0 && res.data.data.id) {
  436. this.form = res.data.data
  437. this.mczsjl = res.data.data.mczsjl
  438. }
  439. })
  440. }
  441. }
  442. },
  443. }
  444. </script>
  445. <style scoped lang="scss">
  446. .diagForm {
  447. width: 84%;
  448. margin: auto;
  449. margin-top: 1rem;
  450. background: #fff;
  451. padding: 1rem;
  452. border-radius: 5px;
  453. .formTitle {
  454. height: 1rem;
  455. line-height: 1rem;
  456. text-align: left;
  457. color: #2882F4;
  458. padding-bottom: 0.5rem;
  459. border-bottom: 1px solid #2882F4;
  460. font-weight: bold;
  461. }
  462. .mint-field {
  463. border: 1px solid #ccc;
  464. border-radius: 50px;
  465. margin-top: 1rem;
  466. }
  467. .mint-cell {
  468. min-height: 2rem;
  469. }
  470. }
  471. .container {
  472. height: 100vh;
  473. .content {
  474. height: 100vh;
  475. }
  476. }
  477. .numSubTitle {
  478. position: relative;
  479. span {
  480. position: absolute;
  481. left: 25px;
  482. top: 5px;
  483. }
  484. }
  485. /deep/ .numSubTitle .mint-field-core {
  486. margin-left: 105px;
  487. }
  488. /deep/ .picker-items {
  489. width: 100% !important;
  490. }
  491. /* 试算样式 */
  492. /deep/ .mint-popup {
  493. width: 90%;
  494. }
  495. .diagShowForm {
  496. width: 84%;
  497. margin: auto;
  498. margin-top: 1rem;
  499. background: #fff;
  500. padding: 1rem;
  501. border-radius: 5px;
  502. .formTitle {
  503. height: 1rem;
  504. line-height: 1rem;
  505. text-align: left;
  506. color: #2882F4;
  507. padding-bottom: 0.5rem;
  508. border-bottom: 1px solid #2882F4;
  509. font-weight: bold;
  510. }
  511. .mint-cell {
  512. min-height: 2.5rem;
  513. }
  514. /deep/ .mint-cell .mint-cell-title {
  515. width: 60%;
  516. text-align: left;
  517. }
  518. /deep/ .mint-cell .mint-cell-value {
  519. width: 40%;
  520. text-align: right;
  521. }
  522. }
  523. .popupContainer {
  524. background: #EFEFEF;
  525. padding: 2px;
  526. height: 100vh;
  527. width: 84%;
  528. margin: auto;
  529. }
  530. .popupFooter {
  531. display: flex;
  532. /* padding: 2rem; */
  533. background: #EFEFEF;
  534. margin-top: 2rem;
  535. .jbbtn {
  536. width: 26%;
  537. margin-top: 1rem;
  538. margin-bottom: 1rem;
  539. }
  540. }
  541. .footer{
  542. display: flex;
  543. .jbbtn {
  544. width: 42%;
  545. margin-top: 1rem;
  546. margin-bottom: 1rem;
  547. }
  548. }
  549. </style>