SpotcheckModal.Style#Drawer.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <a-drawer
  3. :title="title"
  4. :width="width"
  5. placement="right"
  6. :closable="false"
  7. @close="close"
  8. destroyOnClose
  9. :visible="visible">
  10. <!-- <cmms-spotcheck-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></cmms-spotcheck-form> -->
  11. <spotcheck-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></spotcheck-form>
  12. <div class="drawer-footer">
  13. <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
  14. <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
  15. </div>
  16. </a-drawer>
  17. </template>
  18. <script>
  19. import SpotcheckForm from './SpotcheckForm.vue'
  20. export default {
  21. name: 'SpotcheckModal',
  22. components: {
  23. SpotcheckForm
  24. },
  25. data () {
  26. return {
  27. title:"操作",
  28. width:800,
  29. visible: false,
  30. disableSubmit: false
  31. }
  32. },
  33. methods: {
  34. add () {
  35. this.visible=true
  36. this.$nextTick(()=>{
  37. this.$refs.realForm.add();
  38. })
  39. },
  40. edit (record) {
  41. this.visible=true
  42. this.$nextTick(()=>{
  43. this.$refs.realForm.edit(record);
  44. });
  45. },
  46. close () {
  47. this.$emit('close');
  48. this.visible = false;
  49. },
  50. submitCallback(){
  51. this.$emit('ok');
  52. this.visible = false;
  53. },
  54. handleOk () {
  55. this.$refs.realForm.submitForm();
  56. },
  57. handleCancel () {
  58. this.close()
  59. }
  60. }
  61. }
  62. </script>
  63. <style lang="less" scoped>
  64. /** Button按钮间距 */
  65. .ant-btn {
  66. margin-left: 30px;
  67. margin-bottom: 30px;
  68. float: right;
  69. }
  70. .drawer-footer{
  71. position: absolute;
  72. bottom: -8px;
  73. width: 100%;
  74. border-top: 1px solid #e8e8e8;
  75. padding: 10px 16px;
  76. text-align: right;
  77. left: 0;
  78. background: #fff;
  79. border-radius: 0 0 2px 2px;
  80. }
  81. </style>