prineight.vue 33KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868
  1. <template>
  2. <div id="prescriptionPrint">
  3. <div v-for="(item, index) in advicePrint" :key="index">
  4. <div
  5. id="prescription-print"
  6. class="prescription-print"
  7. style="page-break-after: always;"
  8. >
  9. <div
  10. class="printTitle"
  11. v-if="
  12. prescriptions[index].med_type != '1111' &&
  13. prescriptions[index].med_type != '1112'
  14. "
  15. >
  16. {{ orgname }}处方笺
  17. </div>
  18. <!-- v-if="prescriptions[index].med_type == '1112'" -->
  19. <div class="printTitle" v-else>
  20. <div style="font-size: 14px;font-weight: normal;text-align: right;"
  21. v-if="prescriptions[index].med_type == '1112'">(精二)
  22. </div>
  23. <span>{{ orgname }}处方笺</span>
  24. </div>
  25. <!-- 非精神处方 -->
  26. <div style="border-bottom: 1px solid black;border-top: 1px solid black;width: 100%;"
  27. v-if="prescriptions[index].med_type != '1111' && prescriptions[index].med_type != '1112'">
  28. <div style="display: flex;margin: 10px 0;line-height: 24px;padding: 0 10px;">
  29. <div style="flex: 1;">
  30. NO:
  31. </div>
  32. <div style="flex: 1;">
  33. 开方日期:{{ getTime(item.ctime) ? getTime(item.ctime) : "" }}
  34. </div>
  35. </div>
  36. <div style="display: flex;line-height: 24px;padding: 0 10px;">
  37. <div style="flex: 1;">
  38. 透析号:{{ item.patient.dialysis_no }}
  39. </div>
  40. <div style="flex: 1;">
  41. 费别:居民医保/职工医保/自费
  42. </div>
  43. </div>
  44. <div style="display: flex;margin: 10px 0;line-height: 24px;padding: 0 10px;">
  45. <p style="width: 200px;">姓名:{{ item.patient.name ? item.patient.name : "" }}</p>
  46. <p style="width: 200px;">
  47. 性别:
  48. <span v-if="item.patient.gender == 1">男</span>
  49. <span v-if="item.patient.gender == 2">女</span>
  50. </p>
  51. <p style="width: 200px;">年龄:{{ getAge(item.patient) ? getAge(item.patient) : "" }}岁</p>
  52. </div>
  53. <div style="display: flex;line-height: 24px;padding: 0 10px;">
  54. <div style="flex: 1;">
  55. 临床诊断:{{ getDiagnosis(item.info.diagnosis) }}
  56. </div>
  57. <div style="flex: 1;">
  58. 过敏史:
  59. </div>
  60. </div>
  61. <div style="flex: 2;margin: 10px 0;">住址/电话:{{ item.patient.home_address }}&nbsp;<span>{{ item.patient.phone }}</span></div>
  62. </div>
  63. <!-- 精二 -->
  64. <div style="border-bottom: 1px solid black;border-top: 1px solid black;width: 100%;"
  65. v-if="prescriptions[index].med_type == '1112'">
  66. <div style="display: flex;">
  67. <div style="flex: 1;">处方编号:</div>
  68. <div style="flex: 1;">日期:{{ getTime(item.ctime) ? getTime(item.ctime) : "" }}</div>
  69. </div>
  70. <div style="display: flex;margin: 10px 0;line-height: 24px;padding: 0 10px;">
  71. <p style="width: 200px;">姓名:{{ item.patient.name ? item.patient.name : "" }}</p>
  72. <p style="width: 200px;">
  73. 性别:
  74. <span v-if="item.patient.gender == 1">男</span>
  75. <span v-if="item.patient.gender == 2">女</span>
  76. </p>
  77. <p style="width: 200px;">年龄:{{ getAge(item.patient) ? getAge(item.patient) : "" }}岁</p>
  78. </div>
  79. <div style="display: flex;margin: 10px 0;">
  80. <div style="flex: 1;">门诊号:{{ hisPatient.number ? hisPatient.number : "" }}</div>
  81. <div style="flex: 1;">费别:居民医保/职工医保/自费</div>
  82. </div>
  83. <div style="display: flex;">
  84. <div style="flex: 1;">临床诊断:{{ getDiagnosis(item.info.diagnosis) }}</div>
  85. <div style="flex: 1;">身份证号:</div>
  86. </div>
  87. <div style="flex: 2;margin: 10px 0;">住址/电话:{{ item.patient.home_address }}&nbsp;<span>{{ item.patient.phone }}</span></div>
  88. <div style="display: flex;">
  89. <div style="flex: 1;">代办人姓名:{{ }}</div>
  90. <div style="flex: 1;">身份证号(代办人):{{ }}</div>
  91. </div>
  92. </div>
  93. <div class="prescriptionBox" style="height: 300px;">
  94. <div class="Rp">Rp:</div>
  95. <div
  96. class="drugsBox"
  97. v-for="(it, index) in item.advices" :key="index"
  98. :style="{'page-break-after':index==yi&&item.advices.length>5? 'always':'auto'}"
  99. >
  100. <template v-if="index==yi+1&&item.advices.length>5">
  101. <!-- 非精神处方 -->
  102. <div style="margin: 20px 0px; border-bottom: 1px solid black;border-top: 1px solid black;"
  103. v-if="prescriptions[index].med_type != '1111' && prescriptions[index].med_type != '1112'">
  104. <div style="display: flex;margin: 10px 0;line-height: 24px;padding: 0 10px;">
  105. <div style="flex: 1;">
  106. NO:
  107. </div>
  108. <div style="flex: 1;">
  109. 开方时间:{{ getTime(item.ctime) ? getTime(item.ctime) : "" }}
  110. </div>
  111. </div>
  112. <div style="display: flex;line-height: 24px;padding: 0 10px;">
  113. <div style="flex: 1;">
  114. 透析号:{{ item.patient.dialysis_no }}
  115. </div>
  116. <div style="flex: 1;">
  117. 费别:居民医保/职工医保/自费
  118. </div>
  119. </div>
  120. <div style="display: flex;margin: 10px 0;line-height: 24px;padding: 0 10px;">
  121. <p style="width: 200px;">姓名:{{ item.patient.name ? item.patient.name : "" }}</p>
  122. <p style="width: 200px;">
  123. 性别:
  124. <span v-if="item.patient.gender == 1">男</span>
  125. <span v-if="item.patient.gender == 2">女</span>
  126. </p>
  127. <p style="width: 200px;">年龄:{{ getAge(item.patient) ? getAge(item.patient) : "" }}岁</p>
  128. </div>
  129. <div style="display: flex;line-height: 24px;padding: 0 10px;">
  130. <div style="flex: 1;">
  131. 临床诊断:{{ getDiagnosis(item.info.diagnosis) }}
  132. </div>
  133. <div style="flex: 1;">
  134. 过敏史:
  135. </div>
  136. </div>
  137. <div style="width: 100%;margin: 10px 0;padding: 0 10px;">地址/电话:{{ item.patient.home_address }}&nbsp;<span>{{ item.patient.phone }}</span></div>
  138. </div>
  139. <!-- 精二 -->
  140. <div style="margin: 20px 0px;border-bottom: 1px solid black;border-top: 1px solid black;width: 100%;"
  141. v-if="prescriptions[index].med_type == '1112'">
  142. <div style="display: flex;">
  143. <div style="flex: 1;">处方编号:</div>
  144. <div style="flex: 1;">日期:{{ getTime(item.ctime) ? getTime(item.ctime) : "" }}</div>
  145. </div>
  146. <div style="display: flex;margin: 10px 0;line-height: 24px;padding: 0 10px;">
  147. <p style="width: 200px;">姓名:{{ item.patient.name ? item.patient.name : "" }}</p>
  148. <p style="width: 200px;">
  149. 性别:
  150. <span v-if="item.patient.gender == 1">男</span>
  151. <span v-if="item.patient.gender == 2">女</span>
  152. </p>
  153. <p style="width: 200px;">年龄:{{ getAge(item.patient) ? getAge(item.patient) : "" }}岁</p>
  154. </div>
  155. <div style="display: flex;margin: 10px 0;">
  156. <div style="flex: 1;">门诊号:{{ hisPatient.number ? hisPatient.number : "" }}</div>
  157. <div style="flex: 1;">费别:居民医保/职工医保/自费</div>
  158. </div>
  159. <div style="display: flex;">
  160. <div style="flex: 1;">临床诊断:{{ getDiagnosis(item.info.diagnosis) }}</div>
  161. <div style="flex: 1;">身份证号:</div>
  162. </div>
  163. <div style="flex: 2;margin: 10px 0;">住址/电话:{{ item.patient.home_address }}&nbsp;<span>{{ item.patient.phone }}</span></div>
  164. <div style="display: flex;">
  165. <div style="flex: 1;">代办人姓名:{{ }}</div>
  166. <div style="flex: 1;">身份证号(代办人):{{ }}</div>
  167. </div>
  168. </div>
  169. </template>
  170. <div style="position: relative;">
  171. <div v-if="it.arr !== undefined">
  172. <div class="drugsOne" :style="{'border-right':it.arr.length>0 ? '1px solid black': 'none','width':'80%'}">
  173. <span style="font-weight: bold" >
  174. {{ index + 1 + "."}}
  175. </span>
  176. {{ it.advice_name ? it.advice_name : "" }}&nbsp;&nbsp;
  177. <span v-if="it.drug.min_unit != it.drug.dose_unit">
  178. {{ it.drug.dose }}{{ it.drug.dose_unit }}&nbsp;* {{ it.drug.min_number }}{{ it.drug.min_unit }}/
  179. {{it.drug.max_unit}}
  180. </span>&nbsp;
  181. <div>
  182. <template>
  183. <div>
  184. <span style="margin-left: 38px;">{{it.arr[0].advice_name ? it.arr[0].advice_name : ""}}</span>&nbsp;&nbsp;
  185. <!-- v-if="ite[0].drug.min_unit != ite[0].drug.dose_unit" -->
  186. <span >
  187. {{ it.arr[0].drug.dose }}{{ it.arr[0].drug.dose_unit }}&nbsp;* {{ it.arr[0].drug.min_number }}{{ it.arr[0].drug.min_unit }}/
  188. {{it.arr[0].drug.max_unit}}
  189. </span>&nbsp;
  190. </div>
  191. <div style="display: inline-block;position: absolute;left:85%;top:20px;margin-left: 5px;" >
  192. &nbsp;共{{ it.arr[0].single_dose }}{{ it.arr[0].single_dose_unit }}
  193. </div>
  194. </template>
  195. </div>
  196. <div style="margin-left: 70px" >
  197. <template>
  198. 用法:
  199. &nbsp;&nbsp;<span>
  200. {{ it.execution_frequency }}&nbsp;{{
  201. it.delivery_way
  202. }}&nbsp;共{{ it.day}}天</span>&nbsp;&nbsp;<span>{{ it.advice_desc}}</span>
  203. </template>
  204. </div>
  205. <div style="margin-left: 70px" v-if="it.remark !=''">
  206. 备注:<span > {{ it.remark }}</span>
  207. </div>
  208. </div>
  209. <div style="display: inline-block;position: absolute;left:80%;bottom:30px;margin-left: 5px;" >
  210. ×&nbsp;{{ it.prescribing_number}}
  211. </div>
  212. <!-- <div> -->
  213. <div style="display: inline-block;position: absolute;left:80%;bottom:15px;margin-left: 5px;" >
  214. ×&nbsp;{{ it.arr[0].prescribing_number}}
  215. </div>
  216. <!-- </div> -->
  217. <template>
  218. <div style="display: inline-block;position: absolute;left:85%;top:0px;margin-left: 5px;" >
  219. &nbsp;共{{ it.single_dose }}{{ it.single_dose_unit }}
  220. </div>
  221. </template>
  222. </div>
  223. <div v-if="it.arr === undefined">
  224. <div class="drugsOne" >
  225. <span style="font-weight: bold" >
  226. {{ index + 1 + "."}}
  227. </span>
  228. {{ it.advice_name ? it.advice_name : "" }}&nbsp;&nbsp;
  229. <span v-if="it.drug.min_unit != it.drug.dose_unit">
  230. {{ it.drug.dose }}{{ it.drug.dose_unit }}&nbsp;* {{ it.drug.min_number }}{{ it.drug.min_unit }}/
  231. {{it.drug.max_unit}}
  232. </span>&nbsp;
  233. <!-- <div>
  234. <template>
  235. <div>
  236. <span style="margin-left: 38px;">{{it.arr[0].advice_name ? it.arr[0].advice_name : ""}}</span>&nbsp;&nbsp;
  237. <span >
  238. {{ it.arr[0].drug.dose }}{{ it.arr[0].drug.dose_unit }}&nbsp;* {{ it.arr[0].drug.min_number }}{{ it.arr[0].drug.min_unit }}/
  239. {{it.arr[0].drug.max_unit}}
  240. </span>&nbsp;
  241. </div>
  242. <div style="display: inline-block;position: absolute;left:85%;top:20px;margin-left: 5px;" >
  243. &nbsp;共{{ it.arr[0].single_dose }}{{ it.arr[0].single_dose_unit }}
  244. </div>
  245. </template>
  246. </div> -->
  247. <div style="margin-left: 70px" >
  248. <template>
  249. 用法:
  250. <span style="margin-right: 0;" >{{ it.single_dose }}{{ it.single_dose_unit }}</span>
  251. &nbsp;&nbsp;<span>
  252. {{ it.execution_frequency }}&nbsp;{{
  253. it.delivery_way
  254. }}&nbsp;共{{ it.day}}天</span><span>{{ it.advice_desc}} </span>
  255. </template>
  256. </div>
  257. <div style="margin-left: 70px" v-if="it.remark !=''">
  258. 备注:<span > {{ it.remark }}</span>
  259. </div>
  260. </div>
  261. <div style="display: inline-block;position: absolute;left:80%;bottom:30px;margin-left: 5px;" >
  262. ×&nbsp;{{ it.prescribing_number}}
  263. </div>
  264. <template>
  265. <div style="display: inline-block;position: absolute;left:85%;top:0px;margin-left: 5px;">
  266. &nbsp;共{{ it.prescribing_number}}{{ it.prescribing_number_unit }}
  267. </div>
  268. </template>
  269. </div>
  270. </div>
  271. <template v-if="index==yi&&item.advices.length>5">
  272. <div style="margin: 20px 0px;"
  273. v-if="prescriptions[index].med_type != '1111' && prescriptions[index].med_type != '1112'">
  274. <div style="display: flex;border-top: 1px solid #000;margin: 10px 0;">
  275. <div style="flex: 1;">医师:{{ getAdminUser(item.creator)}}</div>
  276. <div style="flex: 1;">金额:
  277. {{ getTotalOne(item.id).toFixed(2)? getTotalOne(item.id).toFixed(2) : 0}}
  278. </div>
  279. <div style="flex: 1;">收费员:</div>
  280. </div>
  281. <div style="display: flex;">
  282. <div style="flex: 1;">审核医师:{{getDoctor(item.advices[0].checker)?getDoctor(item.advices[0].checker):""}}</div>
  283. <div style="flex: 1;">调配药师:</div>
  284. <div style="flex: 1;">核/发药师:</div>
  285. </div>
  286. </div>
  287. <div style="margin: 20px 0px;" v-if="prescriptions[index].med_type == '1112'">
  288. <div style="display: flex;border-top: 1px solid #000;margin: 10px 0;">
  289. <div style="flex: 1;">医师:{{ getAdminUser(item.creator)}}</div>
  290. <div style="flex: 1;">金额:
  291. {{ getTotalOne(item.id).toFixed(2)? getTotalOne(item.id).toFixed(2) : 0}}
  292. </div>
  293. <div style="flex: 1;">其他:</div>
  294. </div>
  295. <div style="display: flex;">
  296. <div style="flex: 1;">审核医师:{{getDoctor(item.advices[0].checker)?getDoctor(item.advices[0].checker):""}}</div>
  297. <div style="flex: 1;">调配药师:</div>
  298. <div style="flex: 1;">核/发药师:</div>
  299. </div>
  300. <div style="display: flex;margin: 10px 0;">
  301. <div style="flex: 1;">取药人:</div>
  302. <div style="flex: 1;">执行人:</div>
  303. <div style="flex: 1;">弃去量:</div>
  304. <div style="flex: 1;">证明人:</div>
  305. </div>
  306. <div style="display: flex;">
  307. <div style="flex: 1;">收回空安瓿或废贴批号:</div>
  308. <div style="flex: 1;">发出药品批号:</div>
  309. </div>
  310. </div>
  311. </template>
  312. </div>
  313. <div
  314. class="drugsBox"
  315. v-for="(it, i) in item.additionalcharge"
  316. :key="i"
  317. >
  318. <div class="drugsOne">
  319. {{ it.item_name ? it.item_name : "" }}:&nbsp;{{ it.price }}元/{{
  320. it.count
  321. }}次
  322. </div>
  323. </div>
  324. <div
  325. class="drugsBox"
  326. v-for="(it, index) in item.project"
  327. :key="index"
  328. >
  329. <div class="drugsOne">
  330. <span style="font-weight: bold">{{ index + 1 + "." }}</span>
  331. {{
  332. it.type == 2
  333. ? getProjectName(it.project_id)
  334. ? getProjectName(it.project_id)
  335. : ""
  336. : it.good_info.good_name
  337. }}&nbsp;&nbsp;{{ it.single_dose
  338. }}{{ it.single_dose_unit }}&nbsp;×&nbsp; {{ it.count }}{{ unit }}
  339. </div>
  340. <div style="margin-left: 100px">
  341. <span>用法:{{ it.single_dose }}{{ it.single_dose_unit }}</span
  342. >&nbsp;&nbsp;<span>{{ it.delivery_way }}</span
  343. >&nbsp;&nbsp;<span>{{ it.advice_desc }}</span>
  344. </div>
  345. </div>
  346. <div
  347. class="drugsBox"
  348. v-for="(it, i) in item.additionalcharge"
  349. :key="i"
  350. >
  351. <div class="drugsOne">
  352. {{ it.project_id ? it.project_id : "" }}:&nbsp;{{
  353. it.price.toFixed(2)
  354. }}元/{{ it.count }}次
  355. </div>
  356. </div>
  357. <div style="text-align: center">(以下空白)</div>
  358. <div style="text-align: center;">/</div>
  359. <div style="text-align: center;">/</div>
  360. <div style="text-align: center;">/</div>
  361. </div>
  362. <div style="margin-left: 70px">
  363. 备注信息:<span style="border-bottom: 1px solid black;"></span>
  364. </div>
  365. <div v-if="prescriptions[index].med_type != '1111' && prescriptions[index].med_type != '1112'">
  366. <div style="display: flex;border-top: 1px solid #000;margin: 10px 0;">
  367. <div style="flex: 1;">医师:{{ getAdminUser(item.creator)}}</div>
  368. <div style="flex: 1;">金额:
  369. {{ getTotalOne(item.id).toFixed(2)? getTotalOne(item.id).toFixed(2) : 0}}
  370. </div>
  371. <div style="flex: 1;">收费员:</div>
  372. </div>
  373. <div style="display: flex;">
  374. <div style="flex: 1;">审核医师:{{getDoctor(item.advices[0].checker)?getDoctor(item.advices[0].checker):""}}</div>
  375. <div style="flex: 1;">调配药师:</div>
  376. <div style="flex: 1;">核/发药师:</div>
  377. </div>
  378. </div>
  379. <div v-if="prescriptions[index].med_type == '1112'">
  380. <div style="display: flex;border-top: 1px solid #000;margin: 10px 0;">
  381. <div style="flex: 1;">医师:{{ getAdminUser(item.creator)}}</div>
  382. <div style="flex: 1;">金额:
  383. {{ getTotalOne(item.id).toFixed(2)? getTotalOne(item.id).toFixed(2) : 0}}
  384. </div>
  385. <div style="flex: 1;">其他:</div>
  386. </div>
  387. <div style="display: flex;">
  388. <div style="flex: 1;">审核医师:{{getDoctor(item.advices[0].checker)?getDoctor(item.advices[0].checker):""}}</div>
  389. <div style="flex: 1;">调配药师:</div>
  390. <div style="flex: 1;">核/发药师:</div>
  391. </div>
  392. <div style="display: flex;margin: 10px 0;">
  393. <div style="flex: 1;">取药人:</div>
  394. <div style="flex: 1;">执行人:</div>
  395. <div style="flex: 1;">弃去量:</div>
  396. <div style="flex: 1;">证明人:</div>
  397. </div>
  398. <div style="display: flex;">
  399. <div style="flex: 1;">收回空安瓿或废贴批号:</div>
  400. <div style="flex: 1;">发出药品批号:</div>
  401. </div>
  402. </div>
  403. </div>
  404. </div>
  405. </div>
  406. </template>
  407. <script>
  408. import { jsGetAge, uParseTime } from "@/utils/tools";
  409. import {
  410. getAllDoctorList,
  411. getPrescriptionPrint,
  412. getHisPatientDetail,
  413. } from "@/api/project/project";
  414. import { getInitData } from "@/api/his/his";
  415. export default{
  416. props: {
  417. patient_id: Number,
  418. record_date: String,
  419. prescription_id: Number,
  420. ids: String,
  421. },
  422. data() {
  423. return {
  424. doc_name:"",
  425. doctorList: [],
  426. advicePrint: {},
  427. yi:4,
  428. radio:'',
  429. arr:[],
  430. advicess:[],
  431. page:sessionStorage.getItem('dayin'),
  432. patient: {},
  433. tableData: [],
  434. prescriptionInfo: [],
  435. hisPatient: {},
  436. department: [],
  437. prescriptions: [],
  438. projectList: [],
  439. orgname: "",
  440. diagnoses: [],
  441. org_id: 0,
  442. operatorMaps: {},
  443. operators: [],
  444. doctorList_1: [],
  445. adminUser:[],
  446. };
  447. },
  448. methods: {
  449. // 电子签名
  450. setAdminUserES(id) {
  451. console.log('5555555555',this.operatorMaps);
  452. if (id == 0) {
  453. return "";
  454. }
  455. if (id in this.operatorMaps) {
  456. return this.operatorMaps[id].url;
  457. } else {
  458. return "";
  459. }
  460. },
  461. getAdminUser(id) {
  462. if (id == 0) {
  463. return "";
  464. }
  465. if (id == undefined) {
  466. return "";
  467. }
  468. for (let i = 0; i < this.adminUser.length; i++) {
  469. if (this.adminUser[i].admin_user_id == id) {
  470. return this.adminUser[i].user_name;
  471. }
  472. }
  473. },
  474. getAge(patient) {
  475. if(patient.id_card_no == "TWN001836483"){
  476. return patient.age
  477. }else{
  478. var thisLen = patient.id_card_no.length;
  479. var birth = "";
  480. if (thisLen == 15) {
  481. birth = "19" + patient.id_card_no.substr(6, 6);
  482. } else {
  483. birth = patient.id_card_no.substr(6, 8);
  484. }
  485. var births =
  486. birth.substr(0, 4) +
  487. "-" +
  488. birth.substr(4, 2) +
  489. "-" +
  490. birth.substr(6, 2);
  491. return jsGetAge(births, "-");
  492. }
  493. },
  494. getAllDoctorList() {
  495. getAllDoctorList().then((response) => {
  496. if (response.data.state == 1) {
  497. var doctor = response.data.data.doctor;
  498. this.doctorList = doctor;
  499. }
  500. });
  501. },
  502. getDoctor(id) {
  503. var name = "";
  504. for (let i = 0; i < this.doctorList.length; i++) {
  505. if (id == this.doctorList[i].admin_user_id) {
  506. name = this.doctorList[i].user_name;
  507. }
  508. }
  509. return name;
  510. },
  511. getTime(value, temp) {
  512. if (value != undefined) {
  513. return uParseTime(value, '{y}年{m}月{d}日 {h}:{i}:{s}')
  514. }
  515. return "";
  516. },
  517. //数据源
  518. getPrescriptionPrint() {
  519. var params = {
  520. patient_id: this.patient_id,
  521. record_date: this.record_date,
  522. prescription_id: this.prescription_id,
  523. ids: this.ids,
  524. p_type: 2,
  525. };
  526. getPrescriptionPrint(params).then((response) => {
  527. if (response.data.state == 1) {
  528. var advicePrint = response.data.data.advicePrint;
  529. console.log("adviceprint9999", advicePrint);
  530. console.log("response.data.data", response.data.data);
  531. this.advicePrint = advicePrint;
  532. this.prescriptions = advicePrint;
  533. this.adminUser = response.data.data.roles
  534. this.doctorList_1 = response.data.data.eles;
  535. for(let i=0;i<this.advicePrint.length;i++){
  536. const arr = new Array()
  537. var advicess = new Array()
  538. var advicess=advicePrint[i].advices
  539. for(let j=0;j<advicess.length;j++){
  540. for(let x=j+1;x<advicess.length;x++){
  541. if(advicess[j].groupno == advicess[x].groupno){
  542. arr.push(advicess.splice(x,1))
  543. }
  544. }
  545. }
  546. for(let x in arr){
  547. for(let j in this.advicePrint[i].advices){
  548. if(arr[x][0].groupno==this.advicePrint[i].advices[j].groupno){
  549. this.advicePrint[i]['advices'][j]['arr'] = arr[x]
  550. }
  551. }
  552. }
  553. }
  554. // console.log('4444444',this.advicePrint);
  555. // console.log('55555555',this.arr);
  556. // console.log(this.doctorList_1, "医生列表");
  557. if (this.doctorList_1.length > 0) {
  558. var operatorsLen = this.doctorList_1.length;
  559. for (var index = 0; index < operatorsLen; index++) {
  560. this.$set(
  561. this.operatorMaps,
  562. this.doctorList_1[index].creator,
  563. this.doctorList_1[index]
  564. );
  565. }
  566. }
  567. // console.log("处方222222", this.prescriptions);
  568. var hisPatient = response.data.data.hisPatient;
  569. // console.log("hisPatient", hisPatient);
  570. this.hisPatient = hisPatient;
  571. var projectlist = response.data.data.projectlist;
  572. // console.log("所有项目列表", projectlist);
  573. this.projectList = projectlist;
  574. }
  575. });
  576. },
  577. getHisPatientDetail() {
  578. const params = {
  579. patient_id: this.patient_id,
  580. };
  581. getHisPatientDetail(params).then((response) => {
  582. if (response.data.state == 1) {
  583. var hisPatient = response.data.data.hisPatient;
  584. console.log("挂号病人", hisPatient);
  585. this.hisPatient = hisPatient;
  586. }
  587. });
  588. },
  589. getInitData() {
  590. getInitData().then((response) => {
  591. if (response.data.state == 1) {
  592. this.department = response.data.data.department;
  593. this.diagnoses = response.data.data.diagnose;
  594. console.log("争端", this.diagnoses);
  595. }
  596. });
  597. },
  598. getDepart(id) {
  599. var name = "";
  600. for (let i = 0; i < this.department.length; i++) {
  601. if (id == this.department[i].id) {
  602. name = this.department[i].name;
  603. }
  604. }
  605. return name;
  606. },
  607. getTotalOne(id) {
  608. // console.log('999999999',this.prescriptions);
  609. var total = 0;
  610. var addtotal = 0;
  611. var zimuyao = 0;
  612. for (let i = 0; i < this.prescriptions.length; i++) {
  613. if (id == this.prescriptions[i].id) {
  614. if (this.prescriptions[i].project != null) {
  615. for (let a = 0; a < this.prescriptions[i].project.length; a++) {
  616. total =
  617. total +
  618. this.prescriptions[i].project[a].price *
  619. this.prescriptions[i].project[a].count ;
  620. }
  621. }
  622. if (this.prescriptions[i].additionalcharge != null) {
  623. for (
  624. let a = 0;
  625. a < this.prescriptions[i].additionalcharge.length;
  626. a++
  627. ) {
  628. addtotal =
  629. addtotal +
  630. this.prescriptions[i].additionalcharge[a].price *
  631. this.prescriptions[i].additionalcharge[a].count ;
  632. }
  633. }
  634. addtotal = Math.floor(addtotal * 100) / 100;
  635. }
  636. }
  637. for (let i = 0; i < this.prescriptions.length; i++) {
  638. if (id == this.prescriptions[i].id) {
  639. if (this.prescriptions[i].advices != null) {
  640. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  641. total =
  642. total +
  643. (this.prescriptions[i].advices[a].price *
  644. this.prescriptions[i].advices[a].prescribing_number) ;
  645. if(this.prescriptions[i].advices[a].arr !=undefined){
  646. zimuyao = zimuyao +
  647. this.prescriptions[i].advices[a].arr[0].price *
  648. this.prescriptions[i].advices[a].arr[0].prescribing_number
  649. }
  650. }
  651. }
  652. // if(this.prescriptions[i].arr[0] != null){
  653. // for(let b=0;b<this.prescriptions[i].arr[0].length;b++){
  654. // zimuyao = zimuyao +
  655. // this.prescriptions[i].arr[b][0].price *
  656. // this.prescriptions[i].arr[b][0].prescribing_number
  657. // }
  658. // }
  659. if (this.prescriptions[i].additionalcharge != null) {
  660. for (
  661. let a = 0;
  662. a < this.prescriptions[i].additionalcharge.length;
  663. a++
  664. ) {
  665. addtotal =
  666. addtotal +
  667. (this.prescriptions[i].additionalcharge[a].price *
  668. this.prescriptions[i].additionalcharge[a].count );
  669. }
  670. }
  671. addtotal = Math.floor(addtotal * 100) / 100;
  672. }
  673. }
  674. return total + addtotal + zimuyao ;
  675. },
  676. getProjectName(id) {
  677. var project_name = "";
  678. for (let i = 0; i < this.projectList.length; i++) {
  679. if (id == this.projectList[i].id) {
  680. project_name = this.projectList[i].project_name;
  681. }
  682. }
  683. return project_name;
  684. },
  685. getDiagnosis(id) {
  686. let arr = id.split(",");
  687. var name = "";
  688. for (let i = 0; i < this.diagnoses.length; i++) {
  689. if (arr.indexOf(String(this.diagnoses[i].id)) > -1) {
  690. name += this.diagnoses[i].class_name + " ";
  691. }
  692. }
  693. return name;
  694. },
  695. merge(arrA){
  696. var len=arrA.lenfth
  697. // for(let j=0;j<this.advicess.length;j++){
  698. // for(let x=j+1;x<this.advicess.length;x++){
  699. // if(this.advicess[j].groupno == this.advicess[x].groupno){
  700. // // this.arr.push(this.advicess.splice(x,1))
  701. // this.arrs=this.advicess.splice(x,1)
  702. // }
  703. // }
  704. // }
  705. for(let j=0;j<len;j++){
  706. for(let x=j+1;x<len;x++){
  707. if(arrA[j].groupno == arrA[x].groupno){
  708. this.arr.push(arrA.splice(x,1))
  709. }
  710. }
  711. }
  712. console.log('777777777',this.arr);
  713. return this.arr
  714. }
  715. },
  716. created() {
  717. this.getAllDoctorList();
  718. this.getInitData();
  719. this.getPrescriptionPrint();
  720. this.getHisPatientDetail();
  721. var xtuser = this.$store.getters.xt_user;
  722. this.orgname = xtuser.org.org_name;
  723. this.org_id = xtuser.org.id;
  724. console.log('jjjjjj',this.orgname);
  725. // for(let j=0;j<this.advicess.length;j++){
  726. // console.log('44444444');
  727. // for(let x=j+1;x<this.advicess.length;x++){
  728. // if(this.advicess[j].groupno == this.advicess[x].groupno){
  729. // this.arr.push(this.advicess.splice(x,1))
  730. // }
  731. // }
  732. // }
  733. // console.log('777777777',this.arr[0].advice_name);
  734. // return this.arr
  735. },
  736. watch: {
  737. ids: function (val) {
  738. this.ids = val;
  739. this.getPrescriptionPrint();
  740. },
  741. },
  742. };
  743. </script>
  744. <style lang="scss" scoped>
  745. .prescription-print {
  746. -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
  747. 0 0 60px rgba(0, 0, 0, 0.06) inset;
  748. -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
  749. 0 0 40px rgba(0, 0, 0, 0.06) inset;
  750. box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
  751. margin-bottom: 20px;
  752. padding: 20px 10px;
  753. }
  754. .printTitle {
  755. font-size: 22px;
  756. text-align: center;
  757. font-weight: bold;
  758. }
  759. .infoTitle {
  760. display: flex;
  761. border-top: 2px solid #000;
  762. margin-top: 10px;
  763. line-height: 24px;
  764. padding: 0 10px;
  765. }
  766. .infoTitle p {
  767. width: 200px;
  768. }
  769. .infoMain {
  770. display: flex;
  771. flex-wrap: wrap;
  772. border-bottom: 2px solid #000;
  773. padding: 0 10px;
  774. }
  775. .infoMain div {
  776. width: 50%;
  777. line-height: 24px;
  778. }
  779. .prescriptionBox {
  780. padding: 0 10px;
  781. max-height: 450px;
  782. }
  783. .Rp {
  784. font-size: 22px;
  785. font-weight: bold;
  786. }
  787. .drugsBox {
  788. padding-left: 40px;
  789. margin-bottom: 10px;
  790. position: relative;
  791. }
  792. .drugsBox div {
  793. line-height: 20px;
  794. }
  795. .drugsOne {
  796. line-height: 24px;
  797. display: inline-block;
  798. width: 80%;
  799. }
  800. .drugsOne span {
  801. margin-right: 20px;
  802. }
  803. .doctorBox {
  804. display: flex;
  805. justify-content: space-between;
  806. padding: 0 10px;
  807. line-height: 24px;
  808. border-bottom: 2px solid #000;
  809. }
  810. .doctorBoxs{
  811. width: 100%;
  812. margin-right: 30px;
  813. text-align: right;
  814. padding: 0 10px;
  815. line-height: 24px;
  816. }
  817. .doctorBoxtwo {
  818. display: flex;
  819. justify-content: space-between;
  820. padding: 0 10px;
  821. line-height: 24px;
  822. }
  823. .actionBar {
  824. display: flex;
  825. justify-content: space-between;
  826. line-height: 24px;
  827. padding: 0 10px;
  828. }
  829. .actionBar p {
  830. width: 150px;
  831. }
  832. </style>