printOne.vue 27KB

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