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

medicineDetail.vue 7.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <el-dialog
  3. :title="formTitle"
  4. width="900px"
  5. :visible.sync="visible"
  6. :before-close="_close"
  7. >
  8. <div style="margin-bottom:10px;">
  9. <el-select v-model="type" placeholder="请选择"
  10. @change="changOption">
  11. <el-option
  12. v-for="item in options"
  13. :key="item.value"
  14. :label="item.label"
  15. :value="item.value">
  16. </el-option>
  17. </el-select>
  18. <el-date-picker
  19. v-model="start_time"
  20. prefix-icon="el-icon-date"
  21. :editable="false"
  22. style="width: 196px;margin-right:10px;"
  23. type="date"
  24. placeholder="选择日期时间"
  25. align="right"
  26. format="yyyy-MM-dd"
  27. value-format="yyyy-MM-dd"
  28. @change="changeStartime">
  29. </el-date-picker>
  30. <el-date-picker
  31. v-model="end_time"
  32. prefix-icon="el-icon-date"
  33. :editable="false"
  34. style="width: 196px;margin-right:10px;"
  35. type="date"
  36. placeholder="选择日期时间"
  37. align="right"
  38. format="yyyy-MM-dd"
  39. value-format="yyyy-MM-dd"
  40. @change="changeEndtime">
  41. </el-date-picker>
  42. </div>
  43. <el-table :data="tableData" border style="width: 100%;" height="300" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
  44. <el-table-column align="center" prop="name" label="日期">
  45. <template slot-scope="scope">
  46. {{getTimes(scope.row.storck_time)}}
  47. </template>
  48. </el-table-column>
  49. <el-table-column align="center" prop="name" label="操作类型">
  50. <template slot-scope="scope">
  51. <span v-if="scope.row.opration_type == 1">入库</span>
  52. <span v-if="scope.row.opration_type == 2">出库</span>
  53. </template>
  54. </el-table-column>
  55. <el-table-column align="center" prop="name" label="数量">
  56. <template slot-scope="scope">
  57. <span v-if="scope.row.opration_type == 1">{{scope.row.store_number}}</span>
  58. <span v-if="scope.row.opration_type == 2">{{scope.row.outstore_number}}</span>
  59. </template>
  60. </el-table-column>
  61. <el-table-column align="center" prop="name" label="操作人">
  62. <template slot-scope="scope">
  63. {{getName(scope.row.admin_user_id)}}
  64. </template>
  65. </el-table-column>
  66. <el-table-column align="center" prop="name" label="出库方式">
  67. <template slot-scope="scope">
  68. <span v-if="scope.row.opration_type == 1 && scope.row.storage_mode == 1">手动入库</span>
  69. <span v-if="scope.row.opration_type == 2 && scope.row.exit_mode == 1">手动出库</span>
  70. <span v-if="scope.row.opration_type == 2 && scope.row.exit_mode == 2">自动出库</span>
  71. </template>
  72. </el-table-column>
  73. <el-table-column align="center" prop="name" label="备注">
  74. <template slot-scope="scope">
  75. {{scope.row.remarks}}
  76. </template>
  77. </el-table-column>
  78. </el-table>
  79. </el-dialog>
  80. </template>
  81. <script>
  82. const moment = require('moment')
  83. import { uParseTime } from "@/utils/tools";
  84. import { getDrugDetail,getCurrentOrgAllStaff } from "@/api/drug/drug"
  85. export default {
  86. data(){
  87. return{
  88. visible:false,
  89. formTitle:'',
  90. tableData: [],
  91. options: [{
  92. value: 1,
  93. label: '全部'
  94. }, {
  95. value: 2,
  96. label: '入库'
  97. }, {
  98. value: 3,
  99. label: '出库'
  100. }],
  101. value: '',
  102. drug_name:"",
  103. drug_spec:"",
  104. patient_id:"",
  105. type:1,
  106. start_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
  107. end_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
  108. staffList:[]
  109. }
  110. },
  111. methods:{
  112. _close: function(done) {
  113. // this.clear()
  114. done()
  115. },
  116. clear: function() {
  117. this.form.id = 0;
  118. this.form.name = "";
  119. this.form.intro = "";
  120. },
  121. show(name,drugspec,patientid) {
  122. this.formTitle = "明细("+name+")"
  123. this.drug_name = name
  124. this.drug_spec = drugspec
  125. this.patient_id = patientid
  126. this.visible = true
  127. this.getDrugDetail()
  128. },
  129. hide() {
  130. // this.clear()
  131. this.visible = false
  132. },
  133. changOption(){
  134. this.getDrugDetail()
  135. },
  136. getDrugDetail(){
  137. const params = {
  138. drug_name:this.drug_name,
  139. drug_spec:this.drug_spec,
  140. patient_id:this.patient_id,
  141. start_time:this.start_time,
  142. end_time:this.end_time
  143. }
  144. getDrugDetail(params).then(response=>{
  145. if(response.data.state == 1){
  146. var stockDetail = response.data.data.stockDetail
  147. for(let i=0;i<stockDetail.length;i++){
  148. stockDetail[i].opration_type = 1
  149. }
  150. var outStockDetail = response.data.data.outStockDetail
  151. for(let j=0;j<outStockDetail.length;j++){
  152. outStockDetail[j].opration_type = 2
  153. }
  154. if(this.type == 1){
  155. stockDetail.push(...outStockDetail)
  156. var arr = stockDetail
  157. var newarr = arr.sort((a,b)=>{ return a.storck_time-b.storck_time})
  158. this.tableData = newarr
  159. }
  160. if(this.type == 2){
  161. this.tableData = stockDetail
  162. }
  163. if(this.type == 3){
  164. this.tableData = outStockDetail
  165. }
  166. }
  167. })
  168. },
  169. getCurrentOrgAllStaff(){
  170. getCurrentOrgAllStaff().then(response=>{
  171. if(response.data.state == 1){
  172. var staff = response.data.data.staff
  173. this.staffList = staff
  174. }
  175. })
  176. },
  177. getName(adminUserId){
  178. var user_name = ""
  179. for(let i=0;i<this.staffList.length;i++){
  180. if(this.staffList[i].admin_user_id == adminUserId){
  181. user_name = this.staffList[i].user_name
  182. }
  183. }
  184. return user_name
  185. },
  186. getTimes(time) {
  187. return uParseTime(time, "{y}-{m}-{d}");
  188. },
  189. changeStartime(){
  190. this.getDrugDetail()
  191. },
  192. changeEndtime(){
  193. this.getDrugDetail()
  194. }
  195. },
  196. created(){
  197. this.getCurrentOrgAllStaff()
  198. }
  199. }
  200. </script>