selectBdc.vue 1.42 KB
<!--
 * @Description: 
 * @Autor: renchao
 * @LastEditTime: 2023-03-02 14:04:16
-->
<template>
  <dialogBox :title="title" width="85%" @closeDialog="closeDialog" v-model="value" isMain :isButton="false">
    <component :is="router" :sqywInfo="sqywInfo" @closeDialog="closeDialog" @updateDialog="updateDialog" />
  </dialogBox>
</template>
<script>
import { queueDjywmc } from "./slectBdcdata.js";
export default {
  props: {
    value: { type: Boolean, default: true },
    sqywInfo: { type: Object, default: () => { } },
    djywbm: { type: String, default: '' }
  },
  data () {
    return {
      title: "",
      router: "",
    };
  },
  watch: {
    value (val) {
      if (val) {
        this.title = "申请业务:" + this.sqywInfo?.djywmc ? this.sqywInfo?.djywmc : '';
        let view = queueDjywmc(this.sqywInfo?.djywbm || this.djywbm);
        this.router = this.loadView(view);
      }
    },
  },
  methods: {
    loadView (view) {
      console.log(view, 'viewviewview');
      return (r) =>
        require.ensure([], () => r(require(`./components/${view}.vue`)));
    },
    closeDialog () {
      this.$emit("input", false);
    },
    updateDialog () {
      this.$emit("input", false);
      this.$emit("updateDialog", true);
    },
  },
};
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
@import "~@/styles/public.scss";

/deep/.submit_button {
  text-align: center;
  padding: 10px;
  margin: 10px;
}
</style>