drugStockUserDetail.vue 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs='crumbs'></bread-crumb>
  5. </div>
  6. <div class="app-container">
  7. <div class="filter-container">
  8. <span style="font-size: 18px;color: #606266">商品使用明细</span>
  9. </div>
  10. <div class="cell clearfix">
  11. <span style="width: 300px;color: #606266">商品类型: {{userList[0].drug.drug_name}} </span>
  12. <span style="width: 300px;color: #606266">规格名称: {{userList[0].drug.drug_spec}}</span>
  13. </div>
  14. <el-row :gutter="12" style="margin-top: 10px">
  15. <el-table :data="userList" :class="signAndWeighBoxPatients" style="width: 50%"
  16. border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
  17. >
  18. <el-table-column min-width="35" align="center">
  19. <template slot="header" slot-scope="scope">
  20. <span>序号</span>
  21. </template>
  22. <template slot-scope="scope">
  23. <span v-if="scope.row.is_total == 0">{{scope.$index+1}}</span>
  24. <span v-if="scope.row.is_total == 1">{{'合计'}}</span>
  25. </template>
  26. </el-table-column>
  27. <el-table-column min-width="35" align="center">
  28. <template slot="header" slot-scope="scope">
  29. <span>使用人</span>
  30. </template>
  31. <template slot-scope="scope">
  32. <span v-if="scope.row.is_total == 0">{{scope.row.user.name}}</span>
  33. <span v-if="scope.row.is_total == 1"></span>
  34. </template>
  35. </el-table-column>
  36. <el-table-column min-width="35" align="center">
  37. <template slot="header" slot-scope="scope">
  38. <span>使用数量</span>
  39. </template>
  40. <template slot-scope="scope">
  41. <span >{{scope.row.count}}</span>
  42. </template>
  43. </el-table-column>
  44. <el-table-column min-width="35" align="center">
  45. <template slot="header" slot-scope="scope">
  46. <span>使用时间</span>
  47. </template>
  48. <template slot-scope="scope">
  49. <span v-if="scope.row.is_total == 0">{{scope.row.ctime | parseTime('{y}-{m}-{d} {h}:{i}')}} </span>
  50. <span v-if="scope.row.is_total == 1">{{scope.row.total}} </span>
  51. </template>
  52. </el-table-column>
  53. </el-table>
  54. </el-row>
  55. </div>
  56. </div>
  57. </template>
  58. <script>
  59. import { uParseTime } from '@/utils/tools'
  60. import { getDrugWarehouseOutUser } from '@/api/drug/drug_stock'
  61. import BreadCrumb from '../../components/bread-crumb'
  62. export default {
  63. name: 'stockInOrderDetail',
  64. components: { BreadCrumb },
  65. created() {
  66. const order_id = this.$route.query.id
  67. this.GetOrderDetail(order_id)
  68. },
  69. data() {
  70. return {
  71. crumbs: [
  72. { path: false, name: '库存管理' },
  73. { path: false, name: '耗材出库单' },
  74. { path: false, name: '出库单详情' },
  75. { path: false, name: '使用明细' }
  76. ],
  77. signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
  78. userList:[]
  79. }
  80. },
  81. methods: {
  82. GetOrderDetail: function(order_id) {
  83. const params = {
  84. 'id': order_id
  85. }
  86. getDrugWarehouseOutUser(params).then(response => {
  87. if (response.data.state == 0) {
  88. this.$message.error(response.data.msg)
  89. return false
  90. } else {
  91. var total = 0
  92. for (let i = 0; i < response.data.data.list.length; i++) {
  93. var obj = response.data.data.list[i]
  94. obj['is_total'] = 0
  95. this.userList.push(obj)
  96. total = total + response.data.data.list[i].count
  97. }
  98. this.userList.push({
  99. is_total: 1,
  100. total: total,
  101. })
  102. console.log(this.userList)
  103. }
  104. })
  105. }
  106. }
  107. }
  108. </script>
  109. <style rel="stylesheet/css" lang="scss" scoped>
  110. .information {
  111. border: 1px #dcdfe6 solid;
  112. padding: 30px 20px 30px 20px;
  113. .border {
  114. border-bottom: 1px #dcdfe6 solid;
  115. margin: 0px 0 20px 0;
  116. }
  117. }
  118. .edit_separater {
  119. border-top: 1px solid rgb(233, 233, 233);
  120. margin-top: 15px;
  121. margin-bottom: 15px;
  122. }
  123. </style>
  124. <style>
  125. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  126. font-size: 12px;
  127. }
  128. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  129. background: #6fb5fa;
  130. }
  131. .count {
  132. color: #bd2c00;
  133. }
  134. </style>