paymentDialog.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <ele-modal
  3. custom-class="ele-dialog-form long-dialog-form"
  4. :centered="true"
  5. :visible.sync="paymentDialogFlag"
  6. :title="title"
  7. :append-to-body="false"
  8. :close-on-click-modal="false"
  9. width="60%"
  10. :before-close="cancel"
  11. :maxable="true"
  12. :resizable="true"
  13. >
  14. <info-table ref="feeRelatedInfoTable" v-if="form.id" :form.sync="form"></info-table>
  15. <div slot="footer">
  16. <el-button type="primary" @click="handleSave(0)">保存</el-button>
  17. <el-button @click="cancel">返回</el-button>
  18. </div>
  19. </ele-modal>
  20. </template>
  21. <script>
  22. import infoTable from "./infoTable.vue";
  23. import {finPayableSaveAPI, getFinPayableInfoAPI, finPayableUpdateAmountAPI} from "@/api/financialManage/payableManage";
  24. export default {
  25. name: "collectionDialog",
  26. components: {
  27. infoTable
  28. },
  29. props: {
  30. paymentDialogFlag: {
  31. type: Boolean,
  32. default: false
  33. },
  34. },
  35. computed: {},
  36. data() {
  37. return {
  38. dialogType: '',
  39. title: '',
  40. form: {
  41. id: '',
  42. },
  43. rules: {}
  44. }
  45. },
  46. created() {
  47. },
  48. methods: {
  49. //初始化
  50. async init(row = {}, type) {
  51. this.title = '付款'
  52. this.dialogType = type
  53. await this.getInfo(row.id)
  54. },
  55. //获取详情
  56. async getInfo(id) {
  57. this.form = await getFinPayableInfoAPI(id)
  58. },
  59. //
  60. async handleSave() {
  61. let data = await this.$refs.feeRelatedInfoTable.getTableValidate()
  62. console.log('data~~~', data)
  63. let detailList = data[0]
  64. let payableTotalPrice = data[1]
  65. await finPayableUpdateAmountAPI(this.form.id, {
  66. payableTotalPrice: payableTotalPrice
  67. })
  68. await finPayableSaveAPI(detailList)
  69. this.$message.success('操作成功')
  70. this.done()
  71. this.cancel()
  72. },
  73. //刷新主列表数据
  74. done() {
  75. this.$emit('reload')
  76. },
  77. //关闭弹窗
  78. cancel() {
  79. this.$emit('update:paymentDialogFlag', false)
  80. }
  81. }
  82. }
  83. </script>
  84. <style scoped lang="scss">
  85. </style>