Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

gatherPrintInvoice.vue 32KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956
  1. <template>
  2. <div>
  3. <div class="print_btn">
  4. <el-button type="primary" @click="printtpage">打印</el-button>
  5. </div>
  6. <div id="list-print" class="list-print">
  7. <div class="listTitle">{{$store.getters.xt_user.org.org_name}}费用发票</div>
  8. <div class="listTitle_1">{{$store.getters.xt_user.org.org_name}}发票联<span>收</span></div>
  9. <div class="listInfo">
  10. <div>收费日期:{{this.$route.query.end_time}}</div>
  11. <div style="width:400px">发票代码:
  12. <span>{{orderInfo.fa_piao_code}}</span>
  13. </div>
  14. </div>
  15. <table class="listTable" table border rules=none cellspacing=0 align=center>
  16. <tr>
  17. <td>姓名:{{patient.name}}</td>
  18. <td>科室:
  19. <span v-if="this.$store.getters.xt_user.org.id!=10215"> {{getDepartment(his_patient.departments)}}</span>
  20. {{ getDepartment(his_record_patient.departments) }}
  21. </td>
  22. <td></td>
  23. </tr>
  24. <tr>
  25. <td>费用类别:
  26. <!-- <span v-if="his_patient.balance_accounts_type == 2">自费</span>
  27. <span v-if="his_patient.balance_accounts_type != 2">医保</span> -->
  28. <span v-if="his_record_patient.balance_accounts_type == 2">自费</span>
  29. <span v-if="his_record_patient.balance_accounts_type != 2">医保</span>
  30. </td>
  31. <td>金额(元):{{getAllPice()}}</td>
  32. <td></td>
  33. </tr>
  34. <tr>
  35. <td>西药:{{getWesternMedicineCostTotal()}}</td>
  36. <td>中成药:{{getChineseTraditionalMedicineCostTotal()}}</td>
  37. <td>中草药:{{getChineseTotal()}}</td>
  38. </tr>
  39. <tr>
  40. <td>检查费:{{getCheckCostTotal()}}</td>
  41. <td>输氧费:{{getOxygen()}}</td>
  42. <td>手术费:{{getOperation()}}</td>
  43. </tr>
  44. <tr>
  45. <td>化验费:{{getLaboratoryCostTotal()}}</td>
  46. <td>输血费:{{getBlood()}}</td>
  47. <td>诊断费:{{getZhenChaCostTotal()}}</td>
  48. </tr>
  49. <tr>
  50. <td>治疗费:{{getTreatement()}}</td>
  51. <td>护理费:{{getNursing()}}</td>
  52. <td>床位费:{{getBedCostTotal()}}</td>
  53. </tr>
  54. <tr>
  55. <td>麻醉费:{{getAnesthesia()}}</td>
  56. <td>材料费::{{getMaterialCostTotal()}}</td>
  57. <td>其他:{{getOtherCostTotal()}}</td>
  58. </tr>
  59. <tr style="border: 1px solid;">
  60. <td>合计金额(大写):{{smalltoBIG(getAllPice())}}</td>
  61. <td>人民币¥:{{getAllPice()}}</td>
  62. <td></td>
  63. </tr>
  64. <tr style="height: 65px;">
  65. <td colspan="3">
  66. 附 注
  67. </td>
  68. </tr>
  69. </table>
  70. <div class="listInfo">
  71. <div>
  72. 收款单位(章):
  73. </div>
  74. <div style="width:300px">
  75. 收费员:{{getAdminRole(admin_user_id)}}
  76. </div>
  77. <div style="width:300px">
  78. {{printDate}}
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </template>
  84. <script>
  85. import print from "print-js";
  86. import { uParseTime } from '@/utils/tools'
  87. import { getGatherDetailList } from '@/api/his/his_tools'
  88. export default {
  89. data(){
  90. return{
  91. patient:{},
  92. tableData:[],
  93. list:[],
  94. order:[],
  95. his_patient:{},
  96. hisDepatment:[],
  97. chineseTraditionalMedicineCostTotal:"",//中成药
  98. checkCostTotal:"",//检查费
  99. materialCostTotal:"",//材料费
  100. laboratoryCostTotal:"",//化验费
  101. bedCostTotal:"",//床位费,
  102. operationCostTotal:"",//材料费
  103. zhenChaCostTotal:"",//诊查费
  104. otherCostTotal:"",//其他费用
  105. printDate:"",
  106. tableList:[],
  107. order_info_list:[],
  108. balanceAccountsType:0,
  109. medicalInsuranceLevelList:[],
  110. balanceAccountsType:0,
  111. doctorlist:[],
  112. orderInfo:{},
  113. his_record_patient:{},
  114. }
  115. },
  116. methods:{
  117. printtpage() {
  118. const style =
  119. '@media print {.list-print{width:960px;margin:0 auto} .listTitle {font-size: 24px;text-align: center;font-weight: bold;margin-bottom: 10px;}.listInfo {display: flex;font-size: 16px;justify-content: space-between;margin: 10px 0;}.listTable {width: 100%;text-align: center;border-collapse: collapse;line-height: 25px;font-size: 14px;border-color: #000;text-align: left;} .listTable tr td {padding: 0 5px;}.tableBottom {font-size: 16px;display: flex;margin-top: 20px;}.tableBottomOne {margin-right: 40px;} .listTitle_1{font-size: 18px;text-align: center;margin-bottom: 10px;}';
  120. printJS({
  121. printable: "list-print",
  122. type: "html",
  123. style: style,
  124. scanStyles: false,
  125. });
  126. },
  127. getNowTime: function () {
  128. let dateTime;
  129. let yy = new Date().getFullYear();
  130. let mm = new Date().getMonth() + 1;
  131. let dd = new Date().getDate();
  132. let hh = new Date().getHours();
  133. let mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes()
  134. :
  135. new Date().getMinutes();
  136. let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds()
  137. :
  138. new Date().getSeconds();
  139. dateTime = yy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf + ':' + ss;
  140. return dateTime
  141. },
  142. getTimes(time) {
  143. return uParseTime(time, '{y}-{m}-{d}')
  144. },
  145. getGatherDetailList() {
  146. let start_time = this.$route.query.start_time
  147. let end_time = this.$route.query.end_time
  148. let params = {
  149. patient_id:this.$route.query.patient_id,
  150. start_time: start_time,
  151. end_time: end_time,
  152. type: this.$route.query.type,
  153. keyword: this.$route.query.keyword
  154. }
  155. getGatherDetailList(params).then(response=>{
  156. if (response.data.state == 0) {
  157. this.$message.error(response.data.msg)
  158. return false
  159. } else {
  160. this.drugTypeList =response.data.data.drugTypeList
  161. this.costClassifyList = response.data.data.costClassifyList
  162. this.doctorlist = response.data.data.doctorlist
  163. var list = response.data.data.list
  164. console.log("listw3232323223",list)
  165. var new_arr = []
  166. for(let i=0;i<list.length;i++){
  167. for(let j=0;j<list[i].orders.length;j++){
  168. new_arr.push(list[i].orders[j])
  169. }
  170. }
  171. console.log("new_arr2332323232",new_arr)
  172. var order_info = []
  173. for(let i=0;i<new_arr.length;i++){
  174. for(let j=0;j<new_arr[i].order_info.length;j++){
  175. order_info.push(new_arr[i].order_info[j])
  176. }
  177. }
  178. for(let i=0;i<order_info.length;i++){
  179. if(order_info[i].advice_id > 0){
  180. order_info[i].item_id = order_info[i].advice.drug.id +"_" + order_info[i].pric
  181. }
  182. if(order_info[i].project_id > 0){
  183. if(order_info[i].project.type == 2){
  184. order_info[i].item_id = order_info[i].project.project.id + "_"+order_info[i].pric
  185. }
  186. if(order_info[i].project.type == 3){
  187. order_info[i].item_id = order_info[i].project.good_info.id + "_"+order_info[i].pric
  188. }
  189. }
  190. }
  191. console.log("order_info222222222222",order_info)
  192. //合并,相同的合并在一起
  193. let dataInfo = {}
  194. order_info.forEach((item, index) => {
  195. let { item_id } = item
  196. if (!dataInfo[item_id]) {
  197. dataInfo[item_id] = {
  198. item_id,
  199. child: [],
  200. count_number:0,
  201. record_date:"",
  202. cost_type:"",
  203. name:"",
  204. pric:item.pric,
  205. chrgitm_lv:"",
  206. advice_id:item.advice_id,
  207. project_id:item.project_id,
  208. type:0,
  209. spec:"",
  210. unit:"",
  211. medical_insurance_level:"",
  212. cost_type:"",
  213. is_total:2,
  214. }
  215. }
  216. dataInfo[item_id].child.push(item)
  217. })
  218. let arr = Object.values(dataInfo)
  219. for(let i=0;i<arr.length;i++){
  220. for(let j=0;j<arr[i].child.length;j++){
  221. if(arr[i].advice_id >0){
  222. arr[i].record_date = arr[i].child[0].advice.advice_date
  223. arr[i].type = 1
  224. arr[i].name = arr[i].child[0].advice.advice_name
  225. arr[i].spec = arr[i].child[0].advice.drug.dose + arr[i].child[0].advice.drug.dose_unit + "*"+arr[i].child[0].advice.drug.min_number + arr[i].child[0].advice.drug.min_unit+"/"+arr[i].child[0].advice.drug.max_unit
  226. arr[i].unit = arr[i].child[0].advice.prescribing_number_unit
  227. arr[i].cost_type = arr[i].child[0].advice.drug.drug_type
  228. arr[i].medical_insurance_level = arr[i].child[0].advice.drug.medical_insurance_level
  229. }
  230. if(arr[i].project_id > 0){
  231. arr[i].record_date = arr[i].child[0].project.record_date
  232. arr[i].type = arr[i].child[0].project.type
  233. if(arr[i].child[0].project.type == 2){
  234. arr[i].name = arr[i].child[0].project.project.project_name
  235. arr[i].spec = arr[i].child[0].project.project.project_name
  236. arr[i].unit = arr[i].child[0].project.project.unit
  237. arr[i].medical_insurance_level = arr[i].child[0].project.project.medical_coverage
  238. arr[i].cost_type = arr[i].child[0].project.project.cost_classify
  239. }
  240. if(arr[i].child[0].project.type == 3){
  241. arr[i].name = arr[i].child[0].project.good_info.good_name
  242. arr[i].spec = arr[i].child[0].project.good_info.specification_name
  243. arr[i].unit = arr[i].child[0].project.good_info.packing_unit
  244. arr[i].medical_insurance_level = arr[i].child[0].project.good_info.medical_insurance_level
  245. arr[i].cost_type = "材料费"
  246. }
  247. }
  248. arr[i].count_number +=arr[i].child[j].cnt
  249. }
  250. }
  251. console.log("arr2323233232322332",arr)
  252. var obj = {is_total:1,total:0}
  253. obj.total = this.getAllPiceTwo(arr)
  254. for(let i=0;i<arr.length;i++){
  255. if(arr[i].advice_id >0){
  256. arr[i].cost_type = this.getDrugType(arr[i].cost_type)
  257. }
  258. if(arr[i].type ==2){
  259. arr[i].cost_type = this.getCostType(arr[i].cost_type)
  260. }
  261. }
  262. arr.push(obj)
  263. this.tableList = arr
  264. console.log("打印",this.tableList)
  265. this.patient = response.data.data.patient
  266. console.log("patinet",this.patient)
  267. this.his_patient = response.data.data.his_patient
  268. this.hisDepatment = response.data.data.hisDepatment
  269. this.order = response.data.data.order
  270. this.his_record_patient = response.data.data.his_record_patient
  271. this.medicalInsuranceLevelList = response.data.data.medicalInsuranceLevelList
  272. this.orderInfo = response.data.data.orderInfo
  273. if(this.$route.query.id == 1){
  274. var new_arr = []
  275. for(let i=0;i<this.tableList.length;i++){
  276. if(this.tableList[i].type == 1){
  277. new_arr.push(this.tableList[i])
  278. }
  279. }
  280. this.tableList = []
  281. this.tableList = new_arr
  282. }
  283. if(this.$route.query.id == 2){
  284. var new_arr = []
  285. for(let i=0;i<this.tableList.length;i++){
  286. if(this.tableList[i].type == 2){
  287. new_arr.push(this.tableList[i])
  288. }
  289. }
  290. this.tableList = []
  291. this.tableList = new_arr
  292. }
  293. if(this.$route.query.id == 3){
  294. var new_arr = []
  295. for(let i=0;i<this.tableList.length;i++){
  296. if(this.tableList[i].type == 3){
  297. new_arr.push(this.tableList[i])
  298. }
  299. }
  300. this.tableList = []
  301. this.tableList = new_arr
  302. }
  303. }
  304. })
  305. },
  306. getAdviceName(id){
  307. var drug_name = ""
  308. for(let i= 0;i<this.tableData.length;i++){
  309. if(id == this.tableData[i].advice_id){
  310. drug_name = this.tableData[i].advice.advice_name
  311. }
  312. }
  313. return drug_name
  314. },
  315. getProjectName(id){
  316. var project_name = ""
  317. for(let i=0;i<this.tableData.length;i++){
  318. if(id == this.tableData[i].project_id){
  319. project_name = this.tableData[i].project.project.project_name
  320. }
  321. }
  322. return project_name
  323. },
  324. setNewData(details) {
  325. let drug_ids = []
  326. let project_ids = []
  327. for (let i = 0; i < details.length; i++) {
  328. if (details[i].advice && details[i].advice.id > 0 && details[i].advice.prescription && details[i].advice.prescription.type == 1) { //药品
  329. let obj = {
  330. id: details[i].advice.drug_id,
  331. price: details[i].advice.price,
  332. record_date:details[i].advice.advice_date
  333. }
  334. drug_ids.push(obj)
  335. } else if (details[i].project && details[i].project.id > 0 && details[i].project.prescription && details[i].project.prescription.type == 2) { //项目
  336. let obj = {
  337. id: details[i].project.project_id,
  338. price: details[i].project.price,
  339. record_date:details[i].advice.record_date
  340. }
  341. project_ids.push(obj)
  342. }
  343. }
  344. let new_drug_ids = this.unique(drug_ids)
  345. let new_project_ids = this.unique(project_ids)
  346. let list = []
  347. if (new_drug_ids.length > 0 && new_project_ids.length == 0) {
  348. for (let i = 0; i < new_drug_ids.length; i++) {
  349. let obj = {}
  350. let count = 0
  351. for (let a = 0; a < details.length; a++) {
  352. if (new_drug_ids[i].id == details[a].advice.drug_id && new_drug_ids[i].price == details[a].advice.price) {
  353. obj['name'] = details[a].advice.advice_name
  354. obj['spec'] = details[a].advice.drug.dose + details[a].advice.drug.dose_unit+"*" + details[a].advice.drug.min_number + details[a].advice.drug.min_unit+"/"+ details[a].advice.drug.max_unit
  355. obj['unit'] = details[a].advice.drug.min_unit
  356. obj['medicine_insurance_kind'] = this.getMedicineInsuranceType(details[a].chrgitm_lv)
  357. obj['med_chrgitm_type'] = this.getType(details[a].med_chrgitm_type)
  358. obj['price'] = parseFloat(details[a].pric)
  359. obj['is_total'] = 2
  360. obj['record_date'] = details[a].advice.record_date
  361. obj['chrgitm_lv'] = details[a].chrgitm_lv
  362. count = count + details[a].cnt
  363. }
  364. }
  365. obj['count'] = count
  366. list.push(obj)
  367. }
  368. }
  369. if (new_drug_ids.length == 0 && new_project_ids.length > 0) {
  370. for (let i = 0; i < new_project_ids.length; i++) {
  371. let obj = {}
  372. let count = 0
  373. for (let a = 0; a < details.length; a++) {
  374. if (new_project_ids[i].id == details[a].project.project_id && new_project_ids[i].price == details[a].project.price) {
  375. if( details[a].project.type == 2){
  376. obj['name'] = details[a].project.project.project_name
  377. obj['spec'] = ''
  378. obj['unit'] = details[a].project.project.unit
  379. }else if(details[a].project.type == 3){
  380. obj['name'] = details[a].project.good_info.good_name
  381. obj['spec'] = ''
  382. obj['unit'] = details[a].project.good_info.packing_unit
  383. }
  384. obj['medicine_insurance_kind'] = this.getMedicineInsuranceType(details[a].chrgitm_lv)
  385. obj['med_chrgitm_type'] = this.getType(details[a].med_chrgitm_type)
  386. obj['price'] = parseFloat(details[a].pric)
  387. obj['is_total'] = 2
  388. obj['chrgitm_lv'] = details[a].chrgitm_lv
  389. count = count + details[a].cnt
  390. }
  391. }
  392. obj['count'] = count
  393. list.push(obj)
  394. }
  395. }
  396. if (new_drug_ids.length > 0 && new_project_ids.length > 0) {
  397. for (let i = 0; i < new_drug_ids.length; i++) {
  398. let obj = {}
  399. let count = 0
  400. for (let a = 0; a < details.length; a++) {
  401. if (new_drug_ids[i].id == details[a].advice.drug_id && new_drug_ids[i].price == details[a].advice.price) {
  402. obj['name'] = details[a].advice.advice_name
  403. obj['spec'] = details[a].advice.drug.dose + details[a].advice.drug.dose_unit+"*" + details[a].advice.drug.min_number + details[a].advice.drug.min_unit+"/"+ details[a].advice.drug.max_unit
  404. obj['unit'] = details[a].advice.drug.min_unit
  405. obj['medicine_insurance_kind'] = this.getMedicineInsuranceType(details[a].chrgitm_lv)
  406. obj['med_chrgitm_type'] = this.getType(details[a].med_chrgitm_type)
  407. obj['price'] = parseFloat(details[a].pric)
  408. obj['is_total'] = 2
  409. obj['record_date'] = details[a].advice.record_date
  410. obj['chrgitm_lv'] = details[a].chrgitm_lv
  411. count = count + details[a].cnt
  412. }
  413. }
  414. obj['count'] = count
  415. list.push(obj)
  416. }
  417. for (let i = 0; i < new_project_ids.length; i++) {
  418. let obj = {}
  419. let count = 0
  420. for (let a = 0; a < details.length; a++) {
  421. if (new_project_ids[i].id == details[a].project.project_id && new_project_ids[i].price == details[a].project.price) {
  422. if( details[a].project.type == 2){
  423. obj['name'] = details[a].project.project.project_name
  424. obj['spec'] = ''
  425. obj['unit'] = details[a].project.project.unit
  426. }else if(details[a].project.type == 3){
  427. obj['name'] = details[a].project.good_info.good_name
  428. obj['spec'] = ''
  429. obj['unit'] = details[a].project.good_info.packing_unit
  430. }
  431. obj['medicine_insurance_kind'] = this.getMedicineInsuranceType(details[a].chrgitm_lv)
  432. obj['med_chrgitm_type'] = this.getType(details[a].med_chrgitm_type)
  433. obj['price'] = parseFloat(details[a].pric)
  434. obj['is_total'] = 2
  435. obj['record_date'] = details[a].project.record_date
  436. obj['chrgitm_lv'] = details[a].chrgitm_lv
  437. count = count + details[a].cnt
  438. }
  439. }
  440. obj['count'] = count
  441. list.push(obj)
  442. }
  443. }
  444. console.log("list232332322323332233223232323",list)
  445. return list
  446. },
  447. getMedicineInsuranceType(type) {
  448. switch (type) {
  449. case "01":
  450. return '甲类'
  451. break
  452. case "02":
  453. return '乙类'
  454. break
  455. case "03":
  456. return '自费'
  457. break
  458. }
  459. },
  460. getType(med_chrgitm_type){
  461. switch (med_chrgitm_type) {
  462. case '01':
  463. return '床位费'
  464. break
  465. case '02':
  466. return '诊察费'
  467. break
  468. case '03':
  469. return '检查费'
  470. break
  471. case '04':
  472. return '化验费'
  473. break
  474. case '05':
  475. return '治疗费'
  476. break
  477. case '06':
  478. return '手术费'
  479. break
  480. case '07':
  481. return '护理费'
  482. break
  483. case '08':
  484. return '材料费'
  485. break
  486. case '09':
  487. return '西药费'
  488. break
  489. case '10':
  490. return '中药饮片费'
  491. break
  492. case '11':
  493. return '中成药费'
  494. break
  495. case '12':
  496. return '一般诊疗费'
  497. break
  498. case '13':
  499. return '挂号费'
  500. break
  501. case '14':
  502. return '其他费'
  503. break
  504. }
  505. },
  506. unique(array) {
  507. // res用来存储结果
  508. var res = []
  509. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  510. for (var j = 0, resLen = res.length; j < resLen; j++) {
  511. if (array[i].id === res[j].id && array[i].price === res[j].price) {
  512. break
  513. }
  514. }
  515. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  516. if (j === resLen) {
  517. res.push(array[i])
  518. }
  519. }
  520. return res
  521. },
  522. getTotal:function(items){
  523. let total = 0
  524. for(let i = 0; i < items.length; i++){
  525. total = Number(total) + Number((parseFloat(items[i].count) * parseFloat(items[i].price)).toFixed(2))
  526. }
  527. return total.toFixed(2)
  528. },
  529. getTimes(time) {
  530. if(time < 0){
  531. return ""
  532. }else{
  533. return uParseTime(time, '{y}-{m}-{d}')
  534. }
  535. },
  536. getDepartment(id){
  537. var name = ""
  538. for(let i=0;i<this.hisDepatment.length;i++){
  539. if(id == this.hisDepatment[i].id){
  540. name = this.hisDepatment[i].name
  541. }
  542. }
  543. return name
  544. },
  545. smalltoBIG(n) {
  546. if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)){
  547. return "数据非法"; //判断数据是否大于0
  548. }
  549. var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
  550. n += "00";
  551. var indexpoint = n.indexOf('.'); // 如果是小数,截取小数点前面的位数
  552. if (indexpoint >= 0){
  553. n = n.substring(0, indexpoint) + n.substr(indexpoint+1, 2); // 若为小数,截取需要使用的unit单位
  554. }
  555. unit = unit.substr(unit.length - n.length); // 若为整数,截取需要使用的unit单位
  556. for (var i=0; i < n.length; i++){
  557. str += "零壹贰叁肆伍陆柒捌玖".charAt(n.charAt(i)) + unit.charAt(i); //遍历转化为大写的数字
  558. }
  559. this.zhongwen = str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
  560. return this.zhongwen
  561. },
  562. getTotalPrice(val){
  563. var total_price = 0
  564. for(let i=0;i<val.length;i++){
  565. total_price +=val[i].count * val[i].price
  566. }
  567. return total_price.toFixed(2)
  568. },
  569. getAdviceMedChrgintmType(name){
  570. var med_chrgitm_type = ""
  571. for(let i=0;i<this.order_info_list.length;i++){
  572. if(name == this.order_info_list[i].advice.advice_name){
  573. med_chrgitm_type = this.order_info_list[i].med_chrgitm_type
  574. }
  575. }
  576. return med_chrgitm_type
  577. },
  578. getProjectMedChrgintmType(project_id){
  579. var med_chrgitm_type = ""
  580. for(let i=0;i<this.order_info_list.length;i++){
  581. if(project_id == this.order_info_list[i].project_id){
  582. med_chrgitm_type = this.order_info_list[i].med_chrgitm_type
  583. }
  584. }
  585. return med_chrgitm_type
  586. },
  587. getChrgitmLv(value){
  588. var name = ""
  589. for(let i=0;i<this.medicalInsuranceLevelList.length;i++){
  590. if(value == this.medicalInsuranceLevelList[i].value){
  591. name = this.medicalInsuranceLevelList[i].name
  592. }
  593. }
  594. return name
  595. },
  596. getAdviceMedChrgintmLv(advice_id){
  597. var chrgitm_lv = ""
  598. for(let i=0;i<this.order_info_list.length;i++){
  599. if(advice_id == this.order_info_list[i].advice_id){
  600. chrgitm_lv = this.order_info_list[i].chrgitm_lv
  601. }
  602. }
  603. return chrgitm_lv
  604. },
  605. getProjectMedChrgintmLv(advice_id){
  606. var chrgitm_lv = ""
  607. for(let i=0;i<this.order_info_list.length;i++){
  608. if(advice_id == this.order_info_list[i].advice_id){
  609. chrgitm_lv = this.order_info_list[i].chrgitm_lv
  610. }
  611. }
  612. return chrgitm_lv
  613. },
  614. getWesternMedicineCostTotal(){
  615. var total_price = 0
  616. for(let i=0;i<this.tableList.length;i++){
  617. if(this.tableList[i].cost_type == "西药"){
  618. total_price += this.tableList[i].count_number * this.tableList[i].pric
  619. }
  620. }
  621. return total_price.toFixed(2)
  622. },
  623. getChineseTraditionalMedicineCostTotal(){
  624. var total_price = 0
  625. for(let i=0;i<this.tableList.length;i++){
  626. if(this.tableList[i].cost_type == "中成药"){
  627. total_price += this.tableList[i].count_number * this.tableList[i].pric
  628. }
  629. }
  630. return total_price.toFixed(2)
  631. },
  632. getChineseTotal(){
  633. var total_price = 0
  634. for(let i=0;i<this.tableList.length;i++){
  635. if(this.tableList[i].cost_type == "中草药"){
  636. total_price += this.tableList[i].count_number * this.tableList[i].pric
  637. }
  638. }
  639. return total_price.toFixed(2)
  640. },
  641. getCheckCostTotal(){
  642. var total_price = 0
  643. for(let i=0;i<this.tableList.length;i++){
  644. if(this.tableList[i].cost_type == "检验费"){
  645. total_price += this.tableList[i].count_number * this.tableList[i].pric
  646. }
  647. }
  648. return total_price.toFixed(2)
  649. },
  650. getOxygen(){
  651. var total_price = 0
  652. for(let i=0;i<this.tableList.length;i++){
  653. if(this.tableList[i].cost_type == "输氧费"){
  654. total_price += this.tableList[i].count_number * this.tableList[i].pric
  655. }
  656. }
  657. return total_price.toFixed(2)
  658. },
  659. getOperation(){
  660. var total_price = 0
  661. for(let i=0;i<this.tableList.length;i++){
  662. if(this.tableList[i].cost_type == "手术费"){
  663. total_price += this.tableList[i].count_number * this.tableList[i].pric
  664. }
  665. }
  666. return total_price.toFixed(2)
  667. },
  668. getLaboratoryCostTotal(){
  669. var total_price = 0
  670. for(let i=0;i<this.tableList.length;i++){
  671. if(this.tableList[i].cost_type == "化验费"){
  672. total_price += this.tableList[i].count_number * this.tableList[i].pric
  673. }
  674. }
  675. return total_price.toFixed(2)
  676. },
  677. getBlood(){
  678. var total_price = 0
  679. for(let i=0;i<this.tableList.length;i++){
  680. if(this.tableList[i].cost_type == "输血费"){
  681. total_price += this.tableList[i].count_number * this.tableList[i].pric
  682. }
  683. }
  684. return total_price.toFixed(2)
  685. },
  686. getZhenChaCostTotal(){
  687. var total_price = 0
  688. for(let i=0;i<this.tableList.length;i++){
  689. if(this.tableList[i].cost_type == "诊断费"){
  690. total_price += this.tableList[i].count_number * this.tableList[i].pric
  691. }
  692. }
  693. return total_price.toFixed(2)
  694. },
  695. getTreatement(){
  696. var total_price = 0
  697. for(let i=0;i<this.tableList.length;i++){
  698. if(this.tableList[i].cost_type == "治疗费"){
  699. total_price += this.tableList[i].count_number * this.tableList[i].pric
  700. }
  701. }
  702. return total_price.toFixed(2)
  703. },
  704. getNursing(){
  705. var total_price = 0
  706. for(let i=0;i<this.tableList.length;i++){
  707. if(this.tableList[i].cost_type == "护理费"){
  708. total_price += this.tableList[i].count_number * this.tableList[i].pric
  709. }
  710. }
  711. return total_price.toFixed(2)
  712. },
  713. getBedCostTotal(){
  714. var total_price = 0
  715. for(let i=0;i<this.tableList.length;i++){
  716. if(this.tableList[i].cost_type == "床位费"){
  717. total_price += this.tableList[i].count_number * this.tableList[i].pric
  718. }
  719. }
  720. return total_price.toFixed(2)
  721. },
  722. getAnesthesia(){
  723. var total_price = 0
  724. for(let i=0;i<this.tableList.length;i++){
  725. if(this.tableList[i].cost_type == "麻醉费"){
  726. total_price += this.tableList[i].count_number * this.tableList[i].pric
  727. }
  728. }
  729. return total_price.toFixed(2)
  730. },
  731. getMaterialCostTotal(){
  732. var total_price = 0
  733. for(let i=0;i<this.tableList.length;i++){
  734. if(this.tableList[i].cost_type == "材料费"){
  735. total_price += this.tableList[i].count_number * this.tableList[i].pric
  736. }
  737. }
  738. return total_price.toFixed(2)
  739. },
  740. getOtherCostTotal(){
  741. var total_price = 0
  742. for(let i=0;i<this.tableList.length;i++){
  743. if(this.tableList[i].cost_type == "其他"){
  744. total_price += this.tableList[i].count_number * this.tableList[i].pric
  745. }
  746. }
  747. return total_price.toFixed(2)
  748. },
  749. getDrugType(id){
  750. console.log("id2332323232233232232323",id)
  751. var name = ""
  752. for(let i=0;i<this.drugTypeList.length;i++){
  753. if(id == this.drugTypeList[i].value){
  754. name = this.drugTypeList[i].name
  755. }
  756. }
  757. return name
  758. },
  759. getCostType(id){
  760. var name = ""
  761. for(let i=0;i<this.costClassifyList.length;i++){
  762. if(id == this.costClassifyList[i].value){
  763. name = this.costClassifyList[i].name
  764. }
  765. }
  766. return name
  767. },
  768. getDrugType(id){
  769. console.log("id2332323232233232232323",id)
  770. var name = ""
  771. for(let i=0;i<this.drugTypeList.length;i++){
  772. if(id == this.drugTypeList[i].value){
  773. name = this.drugTypeList[i].name
  774. }
  775. }
  776. return name
  777. },
  778. getCostType(id){
  779. var name = ""
  780. for(let i=0;i<this.costClassifyList.length;i++){
  781. if(id == this.costClassifyList[i].value){
  782. name = this.costClassifyList[i].name
  783. }
  784. }
  785. return name
  786. },
  787. getAllPice(){
  788. var total_price = 0
  789. for(let i=0;i<this.tableList.length;i++){
  790. if(this.tableList[i].is_total ==2){
  791. total_price += (this.tableList[i].pric * parseInt(this.tableList[i].count_number))
  792. }
  793. }
  794. if(total_price > 0){
  795. return total_price.toFixed(2)
  796. }else{
  797. return total_price
  798. }
  799. },
  800. getAllPiceTwo(arr){
  801. var total_price = 0
  802. for(let i=0;i<arr.length;i++){
  803. if(arr[i].is_total ==2){
  804. total_price += (arr[i].pric * parseInt(arr[i].count_number))
  805. }
  806. }
  807. if(total_price > 0){
  808. return total_price.toFixed(2)
  809. }else{
  810. return total_price
  811. }
  812. },
  813. getAdminRole(id){
  814. var user_name = ""
  815. for(let i=0;i<this.doctorlist.length;i++){
  816. if(id == this.doctorlist[i].admin_user_id){
  817. user_name = this.doctorlist[i].user_name
  818. }
  819. }
  820. return user_name
  821. }
  822. },
  823. created(){
  824. this.admin_user_id = this.$store.getters.xt_user.user.id
  825. console.log("admin_user_id23323232323",this.admin_user_id)
  826. this.getGatherDetailList()
  827. var data = new Date();
  828. var month =data.getMonth() < 9 ? "0" + (data.getMonth() + 1) : data.getMonth() + 1;
  829. var date = data.getDate() <= 9 ? "0" + data.getDate() : data.getDate();
  830. this.printDate = data.getFullYear() + "年" + month + "月" + date+"日";
  831. }
  832. }
  833. </script>
  834. <style lang="scss" scoped>
  835. .list-print{
  836. -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
  837. -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
  838. box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
  839. margin-bottom: 20px;
  840. padding:20px 10px;
  841. width:960px;
  842. margin: 0 auto;
  843. height: 565px;
  844. }
  845. .listTitle{
  846. font-size: 24px;
  847. text-align: center;
  848. font-weight: bold;
  849. margin-bottom: 10px;
  850. }
  851. .listTitle_1{
  852. font-size: 18px;
  853. text-align: center;
  854. margin-bottom: 10px;
  855. span{
  856. font-size: 15px;
  857. padding: 0 10px;
  858. }
  859. }
  860. .listInfo{
  861. display: flex;
  862. font-size: 16px;
  863. justify-content: space-between;
  864. margin: 10px 0;
  865. }
  866. .listTable{
  867. width: 100%;
  868. text-align: center;
  869. border-collapse: collapse;
  870. line-height: 40px;
  871. font-size: 14px;
  872. border-color: #000;
  873. text-align: left;
  874. }
  875. .listTable tr td {
  876. padding: 0 5px;
  877. }
  878. .tableBottom{
  879. font-size: 16px;
  880. display: flex;
  881. margin-top: 20px;
  882. }
  883. .tableBottomOne{
  884. margin-right: 40px;
  885. }
  886. .print_btn {
  887. display: flex;
  888. justify-content: flex-end;
  889. }
  890. </style>