wuHanReimbursementGatheringTimeForm.vue 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <el-dialog
  3. :title="title"
  4. :close-on-click-modal="false"
  5. v-dialogDrag
  6. :visible.sync="visible">
  7. <el-form size="small" :model="inputForm" ref="inputForm" @keyup.enter.native="doSubmit()"
  8. label-width="80px" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="method==='view'" @submit.native.prevent>
  9. <el-row :gutter="15">
  10. <el-col :span="12">
  11. <el-form-item label="收款日期" prop="gatheringTime"
  12. :rules="[
  13. {required: true, message:'收款日期不能为空', trigger:'blur'}
  14. ]">
  15. <el-date-picker
  16. style="width: 100%;"
  17. v-model="inputForm.gatheringTime"
  18. type="datetime"
  19. value-format="yyyy-MM-dd HH:mm:ss"
  20. placeholder="选择日期时间">
  21. </el-date-picker>
  22. </el-form-item>
  23. </el-col>
  24. </el-row>
  25. </el-form>
  26. <span slot="footer" class="dialog-footer">
  27. <el-button size="small" @click="visible = false" icon="el-icon-circle-close">关闭</el-button>
  28. <el-button size="small" v-if="method != 'view'" type="primary" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
  29. </span>
  30. </el-dialog>
  31. </template>
  32. <script>
  33. import ReimbursementSys from '@/api/reimbursementSys/wuHanReimbursementSysService'
  34. export default {
  35. data () {
  36. return {
  37. title: '',
  38. method: '',
  39. visible: false,
  40. loading: false,
  41. inputForm: {
  42. id: '',
  43. name: '',
  44. parent: {
  45. id: ''
  46. },
  47. gatheringTime: '' // 业务编码
  48. }
  49. }
  50. },
  51. reimbursementSys: null,
  52. created () {
  53. this.reimbursementSys = new ReimbursementSys()
  54. },
  55. methods: {
  56. init (method, obj) {
  57. this.method = method
  58. if (method === 'edit') {
  59. this.title = '修改收款日期'
  60. }
  61. this.visible = true
  62. this.$nextTick(() => {
  63. this.$refs['inputForm'].resetFields()
  64. this.inputForm.id = obj.id
  65. })
  66. },
  67. // 表单提交
  68. doSubmit () {
  69. this.$refs['inputForm'].validate((valid) => {
  70. if (valid) {
  71. this.loading = true
  72. this.reimbursementSys.saveGatheringTime(this.inputForm).then(({data}) => {
  73. this.loading = false
  74. this.$message({
  75. message: '操作成功',
  76. type: 'success',
  77. duration: 1500
  78. })
  79. this.visible = false
  80. this.$emit('refreshDataList')
  81. }).catch(() => {
  82. this.loading = false
  83. })
  84. }
  85. })
  86. }
  87. }
  88. }
  89. </script>