| | |
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { getFormTemplate } from "@/api/formTemplate";
|
| | | import { getFormTemplate, getFormDetail } from "@/api/formTemplate";
|
| | | import ResembleQuery from "./ResembleQuery";
|
| | | export default {
|
| | | name: "ResembleQueryDialog",
|
| | |
| | | type: String,
|
| | | default: "",
|
| | | },
|
| | | rowOid: "",
|
| | | codeRuleOid: {
|
| | | type: String,
|
| | | default: "",
|
| | |
| | | data() {
|
| | | return {
|
| | | column: [],
|
| | | loading: false
|
| | | loading: false,
|
| | | detailData: {},
|
| | | };
|
| | | },
|
| | | computed: {
|
| | |
| | | },
|
| | | 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 = [];
|
| | | }
|
| | | });
|
| | | },
|
| | | },
|
| | | };
|