additionalCharges.vue 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <el-dialog
  3. title="附加收费"
  4. width="600px"
  5. :visible.sync="visible"
  6. :before-close="_close"
  7. >
  8. <el-table :data="chargeTable" border style="width: 100%;" height="350" :row-style="{ color: '#303133' }"
  9. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row
  10. @select-all="handleSelectionChange"
  11. @select='selectDrugs'>
  12. <el-table-column align="center" type="selection" width="60"></el-table-column>
  13. <el-table-column align="center" prop="name" label="名称" width="160">
  14. <template slot-scope="scope">{{ scope.row.item_name }}</template>
  15. </el-table-column>
  16. <el-table-column align="center" prop="name" label="金额(元)">
  17. <template slot-scope="scope">
  18. <el-input type="number" v-model="scope.row.price" placeholder="请输入金额"></el-input>
  19. </template>
  20. </el-table-column>
  21. </el-table>
  22. <div slot="footer" class="dialog-footer">
  23. <el-button @click="hide">取 消</el-button>
  24. <el-button type="primary" @click="submitAction()">保 存</el-button>
  25. </div>
  26. </el-dialog>
  27. </template>
  28. <script>
  29. import { saveCharges } from '@/api/project/project'
  30. export default {
  31. props: {
  32. hisPatientInfo: Object,
  33. patientInfo: Object,
  34. additions: Array
  35. },
  36. data() {
  37. return {
  38. visible: false,
  39. chargeTable: [],
  40. charges: []
  41. }
  42. },
  43. methods: {
  44. selectDrugs(selection, row) {
  45. this.charges = selection
  46. },
  47. _close: function(done) {
  48. // this.clear()
  49. done()
  50. },
  51. clear: function() {
  52. this.form.id = 0
  53. this.form.name = ''
  54. this.form.intro = ''
  55. },
  56. show() {
  57. this.chargeTable = []
  58. this.visible = true
  59. for (let i = 0; i < this.additions.length; i++) {
  60. let obj = {
  61. id: '0',
  62. item_id: this.additions[i].id,
  63. item_name: this.additions[i].name,
  64. price: this.additions[i].price,
  65. count: this.additions[i].count,
  66. }
  67. this.chargeTable.push(obj)
  68. }
  69. },
  70. hide() {
  71. this.visible = false
  72. },
  73. handleSelectionChange(val) {
  74. this.charges = val
  75. },
  76. submitAction() {
  77. this.$emit('setData', this.charges)
  78. }
  79. },
  80. watch: {
  81. }
  82. }
  83. </script>