fjl
fujunling
2023-06-19 1f5527cadc5101fcc4cf895bb476171d25413235
Source/UBCS-WEB/src/components/FormTemplate/ResembleQueryDialog.vue
@@ -22,7 +22,7 @@
</template>
<script>
import { getFormTemplate } from "@/api/formTemplate";
import { getFormTemplate, getFormDetail } from "@/api/formTemplate";
import ResembleQuery from "./ResembleQuery";
export default {
  name: "ResembleQueryDialog",
@@ -40,6 +40,7 @@
      type: String,
      default: "",
    },
    rowOid: "",
    codeRuleOid: {
      type: String,
      default: "",
@@ -56,7 +57,8 @@
  data() {
    return {
      column: [],
      loading: false
      loading: false,
      detailData: {},
    };
  },
  computed: {
@@ -71,23 +73,28 @@
  },
  methods: {
    openDialog() {
      this.loading = true
      getFormTemplate({
        templateOid: this.templateOid,
        codeClassifyOid: this.codeClassifyOid,
      }).then((res) => {
        this.loading = false
        if (
          res.data &&
          res.data.resembleTableVO.cols &&
          res.data.resembleTableVO.cols.length > 0
        ) {
          this.column = res.data.resembleTableVO.cols;
          this.$refs.ResembleQuery.resembleQuery();
        } else {
          this.column = [];
        }
      });
      this.loading = true;
      getFormDetail({ templateOid: this.templateOid, oid: this.rowOid })
        .then((res) => {
          this.detailData = res.data.data[0] || {};
          return getFormTemplate({
            templateOid: this.templateOid,
            codeClassifyOid: this.codeClassifyOid,
          });
        })
        .then((res) => {
          this.loading = false;
          if (
            res.data &&
            res.data.resembleTableVO.cols &&
            res.data.resembleTableVO.cols.length > 0
          ) {
            this.column = res.data.resembleTableVO.cols;
            this.$refs.ResembleQuery.resembleQuery(this.detailData);
          } else {
            this.column = [];
          }
        });
    },
  },
};