setAllValue.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <el-button
  3. size="small"
  4. type="primary"
  5. class="ele-btn-icon"
  6. style="margin-left: 5px"
  7. :disabled="disabled"
  8. @click="show = true"
  9. >批量设置{{ title }}
  10. <ele-modal
  11. custom-class="ele-dialog-form long-dialog-form"
  12. :centered="true"
  13. :visible.sync="show"
  14. :close-on-click-modal="false"
  15. width="600px"
  16. :maxable="true"
  17. :resizable="true"
  18. :append-to-body="true"
  19. >
  20. <div>
  21. {{ title }}:
  22. <el-date-picker
  23. v-model="value"
  24. type="date"
  25. placeholder="选择日期"
  26. value-format="yyyy-MM-dd"
  27. >
  28. </el-date-picker>
  29. </div>
  30. <div slot="footer" class="footer">
  31. <el-button type="primary" @click="warehouseChangeAll">确认</el-button>
  32. <el-button @click="show = false">返回</el-button>
  33. </div>
  34. </ele-modal>
  35. </el-button>
  36. </template>
  37. <script>
  38. export default {
  39. components: {},
  40. data() {
  41. return {
  42. show: false,
  43. value: ''
  44. };
  45. },
  46. props: {
  47. disabled: {
  48. default: true,
  49. type: Boolean
  50. },
  51. valueKey: '',
  52. title: ''
  53. },
  54. created() {},
  55. computed: {},
  56. methods: {
  57. warehouseChangeAll() {
  58. if (!this.value) {
  59. return this.$message.error(this.title + '不能为空!');
  60. }
  61. this.$emit('success', { key: this.valueKey, value: this.value });
  62. this.cancel();
  63. },
  64. cancel() {
  65. this.show = false;
  66. }
  67. }
  68. };
  69. </script>
  70. <style scoped lang="scss"></style>