12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <template>
- <j-modal
- :title="title"
- :width="width"
- :visible="visible"
- switchFullscreen
- @ok="handleOk"
- :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
- @cancel="handleCancel"
- cancelText="关闭">
- <repair-manage-form v-if="modalType==='form'" ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></repair-manage-form>
- <repair-manage-dispatch v-if="modalType==='dispatch'" ref="dispatchForm"></repair-manage-dispatch>
- </j-modal>
- </template>
- <script>
- import RepairManageForm from './RepairManageForm'
- import RepairManageDispatch from './RepairManageDispatch.vue'
- export default {
- name: 'RepairManageModal',
- components: {
- RepairManageForm,
- RepairManageDispatch
- },
- data () {
- return {
- title:'',
- width:800,
- visible: false,
- disableSubmit: false,
- modalType: 'form',
- }
- },
- methods: {
- add () {
- this.visible=true
- this.$nextTick(()=>{
- this.$refs.realForm.add();
- })
- },
- edit (record) {
- this.visible=true
- this.$nextTick(()=>{
- this.$refs.realForm.edit(record);
- })
- },
- dispatch (record) {
- console.log(this.modalType)
- this.modalType = 'dispatch'
- this.visible=true
- this.$nextTick(()=>{
- this.$refs.dispatchForm.dispatch(record);
- })
- },
- close () {
- this.$emit('close');
- this.visible = false;
- this.modalType = 'form';
- },
- handleOk () {
- this.$refs.realForm.submitForm();
- },
- submitCallback(){
- this.$emit('ok');
- this.visible = false;
- this.modalType = 'form';
- },
- handleCancel () {
- this.close()
- }
- }
- }
- </script>
|