edit-date-dialog.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <div>
  3. <el-dialog
  4. title="修改服务单日期"
  5. :visible.sync="isShow"
  6. :show-close="false"
  7. width="400px"
  8. :close-on-click-modal="false"
  9. >
  10. <el-form ref="dateForm" :model="dateForm" :rules="dateFormRules" label-position="left" label-width="80px">
  11. <el-form-item label="选择日期" prop="date">
  12. <el-date-picker
  13. v-model="dateForm.date"
  14. type="date"
  15. value-format="yyyy-MM-dd"
  16. style="width: 100%"
  17. placeholder="选择日期"
  18. >
  19. </el-date-picker>
  20. </el-form-item>
  21. </el-form>
  22. <div slot="footer" class="dialog-footer">
  23. <el-button @click="cancelDateForm">取 消</el-button>
  24. <el-button type="primary" @click="submitDateForm">确 定</el-button>
  25. </div>
  26. </el-dialog>
  27. </div>
  28. </template>
  29. <script>
  30. export default {
  31. name: 'EditDateDialog',
  32. props: {
  33. isShow: {
  34. type: Boolean,
  35. default: false
  36. },
  37. dateForm: {
  38. type: Object,
  39. default: {
  40. date: ''
  41. }
  42. }
  43. },
  44. data() {
  45. return {
  46. dateFormRules: {
  47. date: [{ required: true, message: '请选择服务单日期', trigger: 'change' }]
  48. }
  49. }
  50. },
  51. methods: {
  52. cancelDateForm() {
  53. this.$emit('update:isShow', false)
  54. },
  55. submitDateForm() {
  56. this.$refs.dateForm.validate(valid => {
  57. if (valid) {
  58. this.$parent.submitDateForm()
  59. }
  60. })
  61. }
  62. }
  63. }
  64. </script>
  65. <style></style>