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

warehousing.vue 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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-date-picker
  10. v-model="start_time"
  11. prefix-icon="el-icon-date"
  12. :editable="false"
  13. style="width: 196px;margin-right:10px;"
  14. type="date"
  15. placeholder="选择日期时间"
  16. align="right"
  17. format="yyyy-MM-dd"
  18. value-format="yyyy-MM-dd"
  19. ></el-date-picker>
  20. <el-select v-model="admin_user_id" placeholder="请选择">
  21. <el-option
  22. v-for="item in staffTable"
  23. :key="item.admin_user_id"
  24. :label="item.user_name"
  25. :value="item.admin_user_id">
  26. </el-option>
  27. </el-select>
  28. </div>
  29. <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>
  30. <el-table-column align="center" label="药品名称">
  31. <template slot-scope="scope">{{scope.row.drug_name}}</template>
  32. </el-table-column>
  33. <el-table-column align="center" label="规格名称">
  34. <template slot-scope="scope">{{scope.row.drug_spec}}</template>
  35. </el-table-column>
  36. <el-table-column align="center" label="入库数量">
  37. <template slot-scope="scope">
  38. <el-input v-model="scope.row.store_number" placeholder="请输入内容"></el-input>
  39. </template>
  40. </el-table-column>
  41. <el-table-column align="center" label="备注">
  42. <template slot-scope="scope">
  43. <el-input v-model="scope.row.remarks" placeholder="请输入内容"></el-input>
  44. </template>
  45. </el-table-column>
  46. </el-table>
  47. <div slot="footer" class="dialog-footer">
  48. <el-button @click="hide">取 消</el-button>
  49. <el-button type="primary" @click="saveStock">保 存</el-button>
  50. </div>
  51. </el-dialog>
  52. </template>
  53. <script>
  54. const moment = require('moment')
  55. import {getCurrentOrgAllStaff,getAllDrugNameList,saveStock,getDrugDataByPatientId} from "@/api/drug/drug"
  56. export default {
  57. data(){
  58. return{
  59. visible:false,
  60. formTitle:'',
  61. tableData: [],
  62. staffTable: [],
  63. value: '',
  64. start_time: moment(new Date()).add('year',0).format("YYYY-MM-DD"),
  65. admin_user_id:this.$store.getters.xt_user.user.id,
  66. patient_name:"",
  67. patient_id:""
  68. }
  69. },
  70. methods:{
  71. _close: function(done) {
  72. // this.clear()
  73. done()
  74. },
  75. clear: function() {
  76. this.form.id = 0;
  77. this.form.name = "";
  78. this.form.intro = "";
  79. },
  80. show(name,id) {
  81. this.patient_id = id
  82. this.formTitle = "自备药入库("+name+")"
  83. this.visible = true
  84. //根据患者ID 获取该患者的自备药
  85. this.getDrugDataByPatientId()
  86. },
  87. hide() {
  88. this.visible = false
  89. },
  90. getCurrentOrgAllStaff(){
  91. getCurrentOrgAllStaff().then(response=>{
  92. if(response.data.state == 1){
  93. var staff = response.data.data.staff
  94. this.staffTable = staff
  95. }
  96. })
  97. },
  98. // getAllDrugNameList(){
  99. // getAllDrugNameList().then(response=>{
  100. // if(response.data.state == 1){
  101. // var rullername = response.data.data.rullerName
  102. // for(let i=0;i<rullername.length;i++){
  103. // rullername[i].store_number = ""
  104. // rullername[i].remarks = ""
  105. // }
  106. // this.tableData = rullername
  107. // }
  108. // })
  109. // },
  110. saveStock(){
  111. const params ={
  112. stocks:this.tableData
  113. }
  114. if(this.admin_user_id ==''){
  115. this.$message.error("请选择入库人")
  116. return
  117. }
  118. console.log("params",params)
  119. saveStock(params,this.start_time,this.admin_user_id,this.patient_id).then(response=>{
  120. if(response.data.state == 1){
  121. var msg = response.data.data.msg
  122. this.$message.success("保存成功")
  123. this.visible = false
  124. }
  125. })
  126. },
  127. getDrugDataByPatientId(){
  128. const params = {
  129. patient_id:this.patient_id
  130. }
  131. console.log("params",params)
  132. getDrugDataByPatientId(params).then(response=>{
  133. if(response.data.state == 1){
  134. var medicalList = response.data.data.medicalList
  135. for(let i=0;i<medicalList.length;i++){
  136. medicalList[i].outstore_number = ""
  137. medicalList[i].remarks = ""
  138. }
  139. this.tableData = medicalList
  140. }
  141. })
  142. }
  143. },
  144. created(){
  145. //获取当前机构的所有人员
  146. this.getCurrentOrgAllStaff()
  147. //获取药品名称规格
  148. // this.getAllDrugNameList()
  149. }
  150. }
  151. </script>