PrescriptionD.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <div class="PrescriptionD">
  3. <div style="margin-bottom:10px;">
  4. <el-button size="small" type="primary" @click="$router.back()">返回</el-button>
  5. <el-button size="small" v-if="showPrintHTML" type="primary" icon="el-icon-download" :disabled="loading" @click="print()">下载打印</el-button>
  6. </div>
  7. <div class="detail print-containers" ref="print">
  8. <div class="detail-item flex-plane-center-l">
  9. <div class="title">方剂名称:</div>
  10. <div class="right">{{info.prename}}</div>
  11. </div>
  12. <div class="detail-item flex-plane-center-l">
  13. <div class="title">药品明细:</div>
  14. <div class="right">
  15. <div
  16. v-if="showTransitionPr"
  17. class="zhuanfag flex-center no-print"
  18. @click="$router.push({path:'/index/prescribing?recipeID='+$route.query.pried+'&kjType=kj-fj'})"
  19. >转方</div>
  20. <div>
  21. <span
  22. v-for="(item,index) in info.items"
  23. :key="index"
  24. >{{item.matname}}{{item.dose}}{{item.unit}}</span>
  25. </div>
  26. </div>
  27. </div>
  28. <div class="detail-item flex-plane-center-l">
  29. <div class="title">功效:</div>
  30. <div class="right">{{info.efficacy}}</div>
  31. </div>
  32. <div class="detail-item flex-plane-center-l">
  33. <div class="title">主治:</div>
  34. <div class="right">{{info.indication}}</div>
  35. </div>
  36. <div class="detail-item flex-plane-center-l">
  37. <div class="title">用法:</div>
  38. <div class="right">{{info.preusage}}</div>
  39. </div>
  40. <div class="detail-item flex-plane-center-l">
  41. <div class="title">书籍名称:</div>
  42. <div class="right">{{info.book}}</div>
  43. </div>
  44. <div class="detail-item flex-plane-center-l">
  45. <div class="title">原始出处:</div>
  46. <div class="right">{{info.content}}</div>
  47. </div>
  48. <!-- 笔记输入框 -->
  49. <div class="detail-item flex-plane-center-l no-print" v-if="isCollect">
  50. <div class="title">个人笔记:</div>
  51. <div class="right flex note">
  52. <el-input type="textarea" :rows="6" placeholder="请输入" v-model="text" :disabled="!isEdit" />
  53. <el-button type="primary" @click="isEdit=!isEdit">{{ isEdit?'保存':'修改' }}</el-button>
  54. </div>
  55. </div>
  56. </div>
  57. <!-- 收藏图标 -->
  58. <div class="collect" v-if="false">
  59. <img
  60. src="../../assets/new-icon/collectpng.png"
  61. alt
  62. v-if="!isCollect"
  63. @click="isCollect=!isCollect"
  64. />
  65. <img src="../../assets/new-icon/collectpng-fill.png" alt v-else @click="isCollect=!isCollect" />
  66. </div>
  67. </div>
  68. </template>
  69. <script>
  70. import { mapGetters } from 'vuex';
  71. import { getDataByKey } from '@/api/system';
  72. import { getPreDetal } from "@/api/knowledge.js";
  73. import printJS from 'print-js';
  74. export default {
  75. data() {
  76. return {
  77. loading: false,
  78. showPrintHTML: false,
  79. showTransitionPr: false,
  80. info: {},
  81. isCollect: false,
  82. isEdit: true,
  83. text: ""
  84. };
  85. },
  86. created() {
  87. getDataByKey({
  88. key: "transitionPr",
  89. organizationid: this.getuserinfo.organizationid,
  90. }).then(data => { this.showTransitionPr = data.enabled; });
  91. getDataByKey({
  92. key: "showPrintHTML",
  93. organizationid: this.getuserinfo.organizationid,
  94. }).then(data => { this.showPrintHTML = data.enabled; });
  95. this.getPreDetal();
  96. },
  97. computed: {
  98. ...mapGetters(["getuserinfo"])
  99. },
  100. methods: {
  101. // 获取详细信息
  102. async getPreDetal() {
  103. this.loading = true;
  104. let res = await getPreDetal({
  105. preid: this.$route.query.pried
  106. });
  107. if (res.code == 0) {
  108. this.info = res.data;
  109. this.loading = false;
  110. }
  111. },
  112. async print() {
  113. printJS({
  114. printable: this.$refs.print,
  115. type: 'html',
  116. documentTitle: `名医名方 - 方剂`,
  117. scanStyles: false,
  118. css: ['print/containers.css', 'print/PrescriptionD.css'],
  119. })
  120. }
  121. }
  122. };
  123. </script>
  124. <style lang="scss" scoped>
  125. @import "../../style/common.scss";
  126. .PrescriptionD {
  127. background: #ffffff;
  128. border-radius: 5px;
  129. padding: 10px 10px;
  130. height: 78vh;
  131. position: relative;
  132. .collect {
  133. position: absolute;
  134. top: 10px;
  135. right: 20px;
  136. img {
  137. width: 50px;
  138. }
  139. }
  140. .back {
  141. width: 74px;
  142. height: 36px;
  143. background: #5386f6;
  144. border-radius: 4px;
  145. font-size: 14px;
  146. font-family: PingFang SC;
  147. font-weight: 400;
  148. color: #ffffff;
  149. cursor: pointer;
  150. margin-bottom: 45px;
  151. }
  152. .detail {
  153. .detail-item {
  154. font-size: 16px;
  155. font-family: PingFang SC;
  156. font-weight: 400;
  157. color: #333333;
  158. margin-bottom: 10px;
  159. .title {
  160. width: 90px;
  161. text-align-last: justify;
  162. }
  163. .right {
  164. flex: 1;
  165. }
  166. .zhuanfag {
  167. width: 60px;
  168. height: 26px;
  169. background: #ffae45;
  170. border-radius: 2px 2px 2px 2px;
  171. font-size: 14px;
  172. font-family: PingFang SC;
  173. font-weight: 400;
  174. color: #ffffff;
  175. margin-bottom: 10px;
  176. }
  177. span {
  178. display: inline-block;
  179. margin-right: 30px;
  180. }
  181. }
  182. }
  183. }
  184. .note {
  185. align-items: flex-end;
  186. }
  187. .note ::v-deep .el-button {
  188. height: 36px;
  189. margin-left: 10px;
  190. }
  191. </style>
  192. <style lang="scss" scoped>
  193. @media screen and (min-width: 1681px) and (max-width: 1920px) {
  194. .PrescriptionD {
  195. height: 86vh;
  196. }
  197. }
  198. @media screen and (min-width: 1601px) and (max-width: 1680px) {
  199. .PrescriptionD {
  200. height: 86vh;
  201. }
  202. }
  203. @media screen and (min-width: 1361px) and (max-width: 1600px) {
  204. .PrescriptionD {
  205. height: 80vh;
  206. }
  207. }
  208. @media screen and(min-width:1281px) and (max-width: 1360px) {
  209. .PrescriptionD {
  210. height: 80vh;
  211. }
  212. }
  213. </style>