prinSeven.vue 30KB

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