summaryDetail.vue 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <template>
  2. <div class="main-contain summaryDetail">
  3. <div class="position">
  4. <bread-crumb :crumbs='crumbs'></bread-crumb>
  5. </div>
  6. <div class="app-container" style="display:flex;flex: 1;padding: 20px 20px 0px 20px;">
  7. <div class="mainCenter">
  8. <div class="centerLeft">
  9. <div class="tabsBox">
  10. <el-tabs class="preTabs" v-model="editableTabsValue" type="card" @tab-click="tabclickEvent">
  11. <el-tab-pane
  12. v-for="(item, index) in prescriptions"
  13. :key="index"
  14. :label="item.name"
  15. :name="item.name"
  16. >
  17. </el-tab-pane>
  18. <div class="RP">
  19. Rp
  20. </div>
  21. <prescription-table ref="prescription_tables"
  22. :prescription="curPrescriptions"></prescription-table>
  23. </el-tabs>
  24. </div>
  25. <div class="costBox">
  26. <span>当前处方总费用:<span style="color:red;">{{ getTotal() }}元</span></span>
  27. <span>{{ state }}</span>
  28. </div>
  29. </div>
  30. <div class="centerRight">
  31. <p class="centerRightTitle">人员信息</p>
  32. <ul class="basicUl">
  33. <li style="width:50%;">姓名:{{patientInfo.name}}</li>
  34. <li style="width:50%;">性别:{{patientInfo.gender == 1 ? '男' : '女' }}</li>
  35. <li style="width:50%;">年龄:{{patientInfo.age }}</li>
  36. <li style="width:50%;">身高:{{patientInfo.height?patientInfo.height:''}}</li>
  37. <li style="width:50%;">体重:{{patientInfo.weight?patientInfo.weight:''}}</li>
  38. <li style="width:50%;">电话:{{patientInfo.phone}}</li>
  39. </ul>
  40. <p class="centerRightTitle">收费信息</p>
  41. <ul class="basicUl">
  42. <li style="width:50%;">应收金额:0.00元</li>
  43. <li style="width:50%;">实收金额:0.00元</li>
  44. <li style="width:50%;">舍入金额:0.00元</li>
  45. <li style="width:50%;">优惠金额:0.00元</li>
  46. <li style="width:50%;">总金额</li>
  47. <li style="width:50%;">0.00元</li>
  48. </ul>
  49. <p class="centerRightTitle">发票费用</p>
  50. <ul class="basicUl">
  51. <li style="width:100%;">西药费:0.00元</li>
  52. </ul>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </template>
  58. <script>
  59. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  60. import { getHisOrder } from '@/api/his/his'
  61. import prescriptionTable from './components/prescriptionTable'
  62. export default {
  63. components:{
  64. BreadCrumb,
  65. prescriptionTable,
  66. },
  67. data(){
  68. return{
  69. crumbs: [
  70. { path: false, name: '门诊收费' },
  71. { path: false, name: '项目消费明细汇总详情' }
  72. ],
  73. info: {},
  74. curPrescriptions: {},
  75. prescriptions: [],
  76. record_date: '',
  77. tableData: [],
  78. editableTabsValue: '1',
  79. loadingone: false,
  80. editableTabs: [{
  81. title: '处方1',
  82. name: '1'
  83. }],
  84. tabIndex: 1,
  85. hisPatientInfo: {},
  86. loadingtwo: false,
  87. patientTableData: [{
  88. name: '杨美英',
  89. mdtrt_id: '1709946'
  90. }],
  91. patientInfo: { id: 0 },
  92. doctor: {},
  93. total: 0,
  94. state: '未收费',
  95. radio: 1,
  96. radioStatus: 1,
  97. search_input: '',
  98. }
  99. },created(){
  100. this.GetOrderDetail()
  101. },methods:{
  102. tabclickEvent(val) {
  103. for (let i = 0; i < this.prescriptions.length; i++) {
  104. if (this.prescriptions[i].name == val.name) {
  105. this.curPrescriptions = {}
  106. var temp = this.deepClone(this.prescriptions[i])
  107. this.curPrescriptions = temp
  108. }
  109. }
  110. },
  111. deepClone(source) {
  112. if (!source && typeof source !== 'object') {
  113. throw new Error('error arguments', 'shallowClone')
  114. }
  115. const targetObj = source.constructor === Array ? [] : {}
  116. Object.keys(source).forEach((keys) => {
  117. if (source[keys] && typeof source[keys] === 'object') {
  118. targetObj[keys] = this.deepClone(source[keys])
  119. } else {
  120. targetObj[keys] = source[keys]
  121. }
  122. })
  123. return targetObj
  124. },
  125. getTotal() {
  126. var total = 0
  127. for (let i = 0; i < this.prescriptions.length; i++) {
  128. if (this.prescriptions[i].advices != null) {
  129. for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
  130. total = total + this.prescriptions[i].advices[a].retail_price * this.prescriptions[i].advices[a].prescribing_number
  131. }
  132. }
  133. if (this.prescriptions[i].project != null) {
  134. for (let b = 0; b < this.prescriptions[i].project.length; b++) {
  135. total = total + this.prescriptions[i].project[b].price * this.prescriptions[i].project[b].total
  136. }
  137. }
  138. }
  139. return total
  140. },
  141. moreState(tab, event) {
  142. if (tab == 'more') {
  143. return false
  144. }
  145. },
  146. GetOrderDetail(){
  147. let params={
  148. number:this.$route.query.number,
  149. patient_id:this.$route.query.patient_id,
  150. }
  151. getHisOrder(params).then(response => {
  152. if (response.data.state == 0) {
  153. this.$message.error(response.data.msg)
  154. return false
  155. } else {
  156. this.patientInfo = response.data.data.order.patient
  157. this.hisPatientInfo = response.data.data.order.his_patient
  158. this.info = response.data.data.p_info
  159. this.prescriptions = []
  160. for (let i = 0; i < response.data.data.prescription.length; i++) {
  161. var prescription = response.data.data.prescription[i]
  162. let tempAdvice = []
  163. let tempProject = []
  164. for (let b = 0; b < prescription.advices.length; b++) {
  165. let obj = {
  166. advice_id: prescription.advices[b].id,
  167. drug_name: prescription.advices[b].advice_name,
  168. single_dose: prescription.advices[b].single_dose,
  169. delivery_way: prescription.advices[b].delivery_way,
  170. execution_frequency: prescription.advices[b].execution_frequency,
  171. retail_price: prescription.advices[b].price.toString(),
  172. remark: prescription.advices[b].remark,
  173. prescribing_number: prescription.advices[b].prescribing_number.toString(),
  174. single_dose_unit: prescription.advices[b].single_dose_unit,
  175. prescribing_number_unit: prescription.advices[b].prescribing_number_unit,
  176. min_unit: prescription.advices[b].single_dose_unit,
  177. medical_insurance_number: prescription.advices[b].med_list_codg
  178. }
  179. tempAdvice.push(obj)
  180. }
  181. for (let b = 0; b < prescription.project.length; b++) {
  182. console.log(prescription.project[b].project.project_name)
  183. let obj = {
  184. id: prescription.project[b].id,
  185. project_id: prescription.project[b].project.id,
  186. project_name: prescription.project[b].project.project_name,
  187. statistical_classification: prescription.project[b].statistical_classification,
  188. single_dose: prescription.project[b].single_dose,
  189. delivery_way: prescription.project[b].delivery_way,
  190. execution_frequency: prescription.project[b].execution_frequency,
  191. number_days: prescription.project[b].day,
  192. total: prescription.project[b].count.toString(),
  193. price: prescription.project[b].price,
  194. remark: prescription.project[b].remark,
  195. medical_code: prescription.project[b].project.medical_code
  196. }
  197. tempProject.push(obj)
  198. }
  199. let index = i + 1
  200. let obj = {
  201. id: prescription.id,
  202. name: '处方' + index,
  203. advices: tempAdvice,
  204. project: tempProject,
  205. type: response.data.data.prescription[i].type
  206. }
  207. this.prescriptions.push(obj)
  208. this.curPrescriptions = this.prescriptions[0]
  209. }
  210. // this.tableData = response.data.data.order
  211. }
  212. })
  213. }
  214. }
  215. }
  216. </script>
  217. <style lang="scss" scoped>
  218. .summaryDetail{
  219. height: 100%;
  220. display: flex;
  221. flex-direction: column;
  222. .tabsBox{
  223. position: relative;
  224. height: 90%;
  225. overflow-y: auto;
  226. margin-bottom: 60px;
  227. .el-tabs__item{
  228. padding: 0 10px;
  229. }
  230. }
  231. .addTab{
  232. position: absolute;
  233. right: 0;
  234. top: 6px;
  235. z-index: 20;
  236. }
  237. .mainCenter{
  238. display: flex;
  239. flex:1;
  240. }
  241. .costBox{
  242. width:100%;
  243. height:60px;
  244. background:#fff;
  245. position: absolute;
  246. bottom:0;
  247. display: flex;
  248. justify-content: space-between;
  249. align-items: center;
  250. }
  251. .centerLeft{
  252. flex: 1;
  253. display: flex;
  254. flex-direction: column;
  255. position: relative;
  256. }
  257. .centerRight{
  258. width: 300px;
  259. margin-left: 5px;
  260. display: flex;
  261. flex-direction: column;
  262. }
  263. .RP{
  264. color:#409EFF;
  265. font-size: 20px;
  266. margin-bottom: 5px;
  267. }
  268. .centerRightTitle{
  269. color:#409EFF;
  270. padding: 10px 0;
  271. }
  272. .basicUl{
  273. border-top: 1px solid #e5e5e5;
  274. border-left: 1px solid #e5e5e5;
  275. display: flex;
  276. flex-wrap: wrap;
  277. li{
  278. border-bottom: 1px solid #e5e5e5;
  279. border-right: 1px solid #e5e5e5;
  280. width: 100%;
  281. height: 38px;
  282. line-height: 38px;
  283. text-indent: 5px;
  284. font-size: 14px;
  285. }
  286. }
  287. }
  288. </style>
  289. <style lang="scss">
  290. .summaryDetail{
  291. .el-table th .cell, .el-table td .cell{
  292. padding: 0 2px;
  293. white-space: pre-line;
  294. }
  295. .el-icon-delete{
  296. color:red;
  297. }
  298. }
  299. </style>