prinSeven.vue 34KB

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