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

detailStatistics.vue 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. <template>
  2. <div>
  3. <div style="display: flex;justify-content: space-between;margin-bottom:10px;">
  4. <div>
  5. <el-select size="small" v-model="item_type" placeholder="请选择"
  6. style="width:150px;margin-left:10px;" @change="changeItem">
  7. <el-option
  8. label="全部"
  9. value="0">
  10. </el-option>
  11. <el-option
  12. v-for="(item,index) in items"
  13. :key="index"
  14. :label="item.name"
  15. :value="item.id">
  16. </el-option>
  17. </el-select>
  18. <el-input
  19. size="small"
  20. style="width: 150px"
  21. v-model="keywords"
  22. class="filter-item"
  23. placeholder="请输入项目名称"
  24. />
  25. <el-button
  26. size="small"
  27. style="margin: 0 10px"
  28. class="filter-item"
  29. type="primary"
  30. @click="searchAction"
  31. >搜索
  32. </el-button>
  33. <el-date-picker
  34. v-model="chargeDate"
  35. type="daterange"
  36. value-format="yyyy-MM-dd"
  37. range-separator="至"
  38. start-placeholder="开始日期"
  39. @change="changeDate"
  40. end-placeholder="结束日期">
  41. </el-date-picker>
  42. <el-button type="primary" size="small" @click="toPrint">打印</el-button>
  43. </div>
  44. <div>
  45. </div>
  46. </div>
  47. <el-table :data="tableData" border :row-style="{ color: '#303133' }" ref="table"
  48. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  49. max-height="600"
  50. v-loading="detail_loading"
  51. highlight-current-row>
  52. <el-table-column type="index" label="序号" width="60px" align="center">
  53. <template slot-scope="scope">
  54. {{scope.row.index}}
  55. </template>
  56. </el-table-column>
  57. <el-table-column align="center" prop="name" label="处方日期">
  58. <template slot-scope="scope">{{getTime(scope.row.record_date)}}</template>
  59. </el-table-column>
  60. <el-table-column align="center" prop="name" label="费用编码">
  61. <template slot-scope="scope">
  62. {{scope.row.number}}
  63. </template>
  64. </el-table-column>
  65. <el-table-column align="center" prop="name" label="项目名称">
  66. <template slot-scope="scope">
  67. <span v-if="scope.row.advice_id > 0">{{scope.row.advice.advice_name}}</span>
  68. <span v-if="scope.row.project_id > 0">
  69. <span v-if="scope.row.project.type == 2">{{scope.row.project.project.project_name}}</span>
  70. <span v-if="scope.row.project.type == 3">{{scope.row.project.good_info.good_name}}</span>
  71. </span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column align="center" prop="name" label="规格">
  75. <template slot-scope="scope">
  76. <span v-if="scope.row.advice_id > 0">{{scope.row.advice.drug.dose}}{{scope.row.advice.drug.dose_unit}}*{{scope.row.advice.drug.min_number}}{{scope.row.advice.drug.min_unit}}/{{scope.row.advice.drug.max_unit}}</span>
  77. <span v-if="scope.row.project_id > 0">
  78. <span v-if="scope.row.project.type == 2">{{scope.row.project.project.project_name}}</span>
  79. <span v-if="scope.row.project.type == 3">{{scope.row.project.good_info.specification_name}}</span>
  80. </span>
  81. </template>
  82. </el-table-column>
  83. <el-table-column align="center" prop="name" label="数量">
  84. <template slot-scope="scope">
  85. {{scope.row.cnt}}
  86. </template>
  87. </el-table-column>
  88. <el-table-column align="center" prop="name" label="单位">
  89. <template slot-scope="scope">
  90. <span v-if="scope.row.advice_id > 0">{{scope.row.advice.prescribing_number_unit}}</span>
  91. <span v-if="scope.row.project_id > 0">
  92. <span v-if="scope.row.project.type == 2">{{scope.row.project.project.unit}}</span>
  93. <span v-if="scope.row.project.type == 3">{{scope.row.project.good_info.packing_unit}}</span>
  94. </span>
  95. </template>
  96. </el-table-column>
  97. <el-table-column align="center" prop="name" label="单价">
  98. <template slot-scope="scope">
  99. {{scope.row.pric}}
  100. </template>
  101. </el-table-column>
  102. <el-table-column align="center" prop="name" label="金额">
  103. <template slot-scope="scope">
  104. <div>
  105. {{scope.row.total_price}}
  106. </div>
  107. </template>
  108. </el-table-column>
  109. <el-table-column align="center" prop="name" label="备注">
  110. <template slot-scope="scope">
  111. <div>
  112. <span v-if="scope.row.advice_id > 0">{{scope.row.advice.remark}}</span>
  113. <span v-if="scope.row.project_id > 0">
  114. <span v-if="scope.row.project.type == 2">{{scope.row.project.remark}}</span>
  115. <span v-if="scope.row.project.type == 3">{{scope.row.project.remark}}</span>
  116. </span>
  117. </div>
  118. </template>
  119. </el-table-column>
  120. </el-table>
  121. <div style="display:flex;justify-content: space-around;">
  122. <div>总费用:{{getAllPice()}}</div>
  123. <div>个人支付:
  124. <span v-if="his_patient.balance_accounts_type == 2"></span> {{getAllPice()}}
  125. <span v-if="his_patient.balance_accounts_type != 2"></span> {{getActPay()}}
  126. </div>
  127. <div>基金支付记账:{{getFundPaySumamt()}}</div>
  128. <div>补充医疗支付记账:{{getHifesPay()}}</div>
  129. <div>救助支付金额:{{getMafPay()}}</div>
  130. </div>
  131. </div>
  132. <!-- </div> -->
  133. </template>
  134. <script>
  135. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  136. import { getHisSummaryDetailList } from '@/api/his/his_tools'
  137. const moment = require('moment')
  138. import { uParseTime } from '@/utils/tools'
  139. export default {
  140. components: {
  141. BreadCrumb
  142. },
  143. props: {
  144. patient_id: {
  145. type: Number,
  146. default: 0
  147. }
  148. },
  149. data() {
  150. return {
  151. detail_loading: false,
  152. tempArr: [],
  153. pos: 0,
  154. search_input: '',
  155. sameRowArr: [],
  156. keywords: '',
  157. tableData: [],
  158. chargeDate: [moment(new Date()).add('year', 0).format('YYYY-MM-DD'), moment(new Date()).add('year', 0).format('YYYY-MM-DD')],
  159. item_type: '0',
  160. items: [
  161. { id: 1, name: '药品' },
  162. { id: 2, name: '项目' },
  163. { id: 3, name: '耗材' },
  164. ],
  165. list:[],
  166. his_patient:{},
  167. id:0,
  168. }
  169. },
  170. methods: {
  171. getTime(val) {
  172. if(val <= 0){
  173. return ""
  174. }
  175. if(val == ""){
  176. return ""
  177. }else {
  178. return uParseTime(val, '{y}-{m}-{d}')
  179. }
  180. },
  181. searchAction(){
  182. this.getHisSummaryDetailList()
  183. },
  184. changeDate() {
  185. this.getHisSummaryDetailList()
  186. },
  187. changeItem(id) {
  188. this.id = id
  189. this.getHisSummaryDetailList()
  190. },
  191. getHisSummaryDetailList() {
  192. let start_time = this.chargeDate[0]
  193. let end_time = this.chargeDate[1]
  194. let params = {
  195. patient_id:this.patient_id,
  196. start_time: start_time,
  197. end_time: end_time,
  198. type: this.item_type,
  199. keyword: this.keywords
  200. }
  201. getHisSummaryDetailList(params).then(response=>{
  202. if(response.data.state == 1){
  203. var list = response.data.data.list
  204. this.his_patient = response.data.data.his_patient
  205. this.list = list
  206. this.tableData = []
  207. for(let i=0;i<list.length;i++){
  208. for(let j=0;j<list[i].orders.length;j++){
  209. for(let z=0;z<list[i].orders[j].order_info.length;z++){
  210. list[i].orders[j].order_info[z].record_date = list[i].orders[j].settle_accounts_date
  211. list[i].orders[j].order_info[z].number = list[i].orders[j].number
  212. this.tableData.push(list[i].orders[j].order_info[z])
  213. }
  214. }
  215. }
  216. var obj = {index:"合计",total_price:0,record_date:"0"}
  217. for(let i=0;i<this.tableData.length;i++){
  218. this.tableData[i].index = i+1
  219. this.tableData[i].total_price = 0
  220. this.tableData[i].total_price = (this.tableData[i].cnt * this.tableData[i].pric).toFixed(2)
  221. obj.total_price += (this.tableData[i].cnt * this.tableData[i].pric)
  222. }
  223. obj.total_price = (obj.total_price).toFixed(2)
  224. this.tableData.push(obj)
  225. console.log("tabledata23233232233232",this.tableData)
  226. var new_arr = []
  227. if(this.keywords!=""){
  228. for(let i=0;i<this.tableData.length;i++){
  229. if(this.tableData[i].index!="合计"){
  230. if(this.tableData[i].advice_id > 0){
  231. if(this.tableData[i].advice.advice_name.indexOf(this.keywords) > -1){
  232. new_arr.push(this.tableData[i])
  233. }
  234. }
  235. if(this.tableData[i].project_id >0){
  236. if(this.tableData[i].project.type == 2){
  237. if(this.tableData[i].project.project.project_name.indexOf(this.keywords) > -1){
  238. new_arr.push(this.tableData[i])
  239. }
  240. }
  241. if(this.tableData[i].project.type == 3){
  242. if(this.tableData[i].project.good_info.good_name.indexOf(this.keywords)> - 1){
  243. new_arr.push(this.tableData[i])
  244. }
  245. }
  246. }
  247. }
  248. }
  249. var objs = {index:"合计",total_price:0,record_date:"0"}
  250. objs.total_price = this.getPrice(new_arr)
  251. new_arr.push(objs)
  252. this.tableData = new_arr
  253. }
  254. if(this.id == 1){
  255. var obj = {index:"合计",total_price:0,record_date:"0"}
  256. var new_arr = []
  257. for(let i=0;i<this.tableData.length;i++){
  258. if(this.tableData[i].index!="合计"){
  259. if(this.tableData[i].advice_id > 0){
  260. new_arr.push(this.tableData[i])
  261. }
  262. }
  263. }
  264. this.tableData = []
  265. obj.total_price = this.getPrice(new_arr)
  266. new_arr.push(obj)
  267. this.tableData = new_arr
  268. }
  269. if(this.id == 2){
  270. var obj = {index:"合计",total_price:0,record_date:"0"}
  271. var new_arr = []
  272. for(let i=0;i<this.tableData.length;i++){
  273. if(this.tableData[i].index!="合计"){
  274. if(this.tableData[i].project_id > 0){
  275. if(this.tableData[i].project.type ==2){
  276. new_arr.push(this.tableData[i])
  277. }
  278. }
  279. }
  280. }
  281. console.log("项目new_arr",new_arr)
  282. this.tableData = []
  283. obj.total_price = this.getPrice(new_arr)
  284. console.log("ar3233223232",new_arr)
  285. new_arr.push(obj)
  286. this.tableData = new_arr
  287. }
  288. if(this.id == 3){
  289. var new_arr = []
  290. var obj = {index:"合计",total_price:0,record_date:"0"}
  291. for(let i=0;i<this.tableData.length;i++){
  292. if(this.tableData[i].index!="合计"){
  293. if(this.tableData[i].project_id > 0){
  294. if(this.tableData[i].project.type == 3){
  295. new_arr.push(this.tableData[i])
  296. }
  297. }
  298. }
  299. }
  300. this.tableData = []
  301. obj.total_price = this.getPrice(new_arr)
  302. new_arr.push(obj)
  303. console.log("new_arr2332323232",new_arr)
  304. this.tableData = new_arr
  305. }
  306. }
  307. })
  308. },
  309. getAllPice(){
  310. console.log("表哥233323232323223",this.tableData)
  311. var total_price = 0
  312. for(let i=0;i<this.tableData.length;i++){
  313. if(this.tableData[i].index =="合计"){
  314. total_price = this.tableData[i].total_price
  315. }
  316. }
  317. return total_price
  318. },
  319. getActPay(){
  320. console.log("list2332323232323232",this.list)
  321. var act_pay = 0
  322. for(let i=0;i<this.list.length;i++){
  323. for(let j=0;j<this.list[i].orders.length;j++){
  324. act_pay +=this.list[i].orders[j].acct_pay
  325. }
  326. }
  327. return act_pay
  328. },
  329. getFundPaySumamt(){
  330. var fund_pay_sumamt = 0
  331. for(let i=0;i<this.list.length;i++){
  332. for(let j=0;j<this.list[i].orders.length;j++){
  333. fund_pay_sumamt +=this.list[i].orders[j].fund_pay_sumamt
  334. }
  335. }
  336. return fund_pay_sumamt
  337. },
  338. getHifesPay(){
  339. var hifes_pay = 0
  340. for(let i=0;i<this.list.length;i++){
  341. for(let j=0;j<this.list[i].orders.length;j++){
  342. hifes_pay +=this.list[i].orders[j].hifes_pay
  343. }
  344. }
  345. return hifes_pay
  346. },
  347. getMafPay(){
  348. var maf_pay = 0
  349. for(let i=0;i<this.list.length;i++){
  350. for(let j=0;j<this.list[i].orders.length;j++){
  351. maf_pay +=this.list[i].orders[j].maf_pay
  352. }
  353. }
  354. return maf_pay
  355. },
  356. toPrint(){
  357. this.$router.push({path:"/hisTool/detailPrint?patient_id="+this.patient_id+"&start_time="+this.chargeDate[0]+"&end_time="+this.chargeDate[1]+"&type="+this.item_type +"&keyword="+this.keywords+"&id="+this.id+"&balance_accounts_type="+this.his_patient.balance_accounts_type})
  358. },
  359. getPrice(val){
  360. var total_price = 0
  361. for(let i=0;i<val.length;i++){
  362. total_price += val[i].cnt * val[i].pric
  363. }
  364. return total_price.toFixed(2)
  365. }
  366. },
  367. created() {
  368. this.getHisSummaryDetailList()
  369. },
  370. watch:{
  371. "patient_id":function(){
  372. this.patient_id = this.patient_id
  373. this.getHisSummaryDetailList()
  374. }
  375. }
  376. }
  377. </script>