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

warehouseOut.vue 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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" prop="name" label="药品名称">
  31. <template slot-scope="scope">{{scope.row.drug_name}}</template>
  32. </el-table-column>
  33. <el-table-column align="center" prop="name" label="规格名称">
  34. <template slot-scope="scope">{{scope.row.drug_name}}</template>
  35. </el-table-column>
  36. <el-table-column align="center" prop="name" label="出库数量">
  37. <template slot-scope="scope">
  38. <el-input v-model="scope.row.outstore_number" placeholder="请输入内容"></el-input>
  39. </template>
  40. </el-table-column>
  41. <el-table-column align="center" prop="name" 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="saveOutStock">保 存</el-button>
  50. </div>
  51. </el-dialog>
  52. </template>
  53. <script>
  54. const moment = require('moment')
  55. import { getCurrentOrgAllStaff,getAllDrugNameList,saveOutStock,getDrugDataByPatientId } from '@/api/drug/drug'
  56. export default {
  57. data(){
  58. return{
  59. visible:false,
  60. formTitle:'',
  61. tableData: [],
  62. value: '',
  63. start_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
  64. staffTable:[],
  65. admin_user_id:this.$store.getters.xt_user.user.id,
  66. patient_id:""
  67. }
  68. },
  69. methods:{
  70. _close: function(done) {
  71. // this.clear()
  72. done()
  73. },
  74. clear: function() {
  75. this.form.id = 0;
  76. this.form.name = "";
  77. this.form.intro = "";
  78. },
  79. show(name,id) {
  80. this.patient_id = id
  81. this.formTitle = "自备药出库("+name+")"
  82. this.visible = true
  83. //根据患者ID 获取该患者的自备药
  84. this.getDrugDataByPatientId()
  85. },
  86. hide() {
  87. // this.clear()
  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].outstore_number = ""
  104. // rullername[i].remarks = ""
  105. // }
  106. // this.tableData = rullername
  107. // }
  108. // })
  109. // },
  110. saveOutStock(){
  111. var arr=[]
  112. for(let i=0;i<this.tableData.length;i++){
  113. if(this.tableData[i].outstore_number){
  114. arr.push(this.tableData[i])
  115. }
  116. }
  117. const params = {
  118. outStocks:arr,
  119. }
  120. if(this.admin_user_id ==''){
  121. this.$message.error("请选择出库人")
  122. return
  123. }
  124. saveOutStock(params,this.start_time,this.admin_user_id,this.patient_id).then(response=>{
  125. if(response.data.state == 1){
  126. var msg = response.data.data.msg
  127. this.$message.success("保存成功")
  128. this.visible = false
  129. this.$emit('getlist');
  130. }
  131. })
  132. },
  133. getDrugDataByPatientId(){
  134. const params = {
  135. patient_id:this.patient_id
  136. }
  137. getDrugDataByPatientId(params).then(response=>{
  138. if(response.data.state == 1){
  139. var medicalList = response.data.data.medicalList
  140. for(let i=0;i<medicalList.length;i++){
  141. medicalList[i].store_number = ""
  142. medicalList[i].remarks = ""
  143. }
  144. this.tableData = medicalList
  145. }
  146. })
  147. }
  148. },
  149. created(){
  150. //获取当前机构的所有人员
  151. this.getCurrentOrgAllStaff()
  152. // this.getAllDrugNameList()
  153. }
  154. }
  155. </script>