| | |
| | | append-to-body |
| | | @opened="openDialog" |
| | | > |
| | | <FormTempalte |
| | | <FormTemplate |
| | | v-bind="$attrs" |
| | | :visible="visible" |
| | | :type="type" |
| | | :rowOid="rowOid" |
| | | :templateOid="templateOid" |
| | | ref="FormTempalte" |
| | | ref="FormTemplate" |
| | | @getFormData="getFormData" |
| | | ></FormTempalte> |
| | | ></FormTemplate> |
| | | |
| | | <div |
| | | class="tab_box" |
| | |
| | | " |
| | | > |
| | | <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick"> |
| | | <el-tab-pane label="码值申请" name="codeApply"> |
| | | <FormTempalte |
| | | <el-tab-pane label="码值申请" name="codeApply" v-if="showCodeApply"> |
| | | <FormTemplate |
| | | v-bind="$attrs" |
| | | :type="type" |
| | | :selfColumnType="selfColumnType" |
| | |
| | | ref="CodeApply" |
| | | @getFormData="getCodeApplyFormData" |
| | | @referConfigDataUpdate="referConfigDataUpdate" |
| | | ></FormTempalte> |
| | | ></FormTemplate> |
| | | </el-tab-pane> |
| | | <el-tab-pane |
| | | label="相似项查询" |
| | |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | <div class="avue-dialog__footer" v-if="type !== 'detail'"> |
| | | <el-button @click="close()">取 消</el-button> |
| | | <el-button @click="submit()" type="primary" :loading="submitBtnLoading">{{ |
| | | submitText |
| | | }}</el-button> |
| | | <el-button |
| | | @click="resembleQuerySubmit" |
| | | type="primary" |
| | | v-if="showResembleQuery" |
| | | >相似像查询</el-button |
| | | > |
| | | </div> |
| | | <template #footer> |
| | | <div class="" v-if="type !== 'detail'"> |
| | | <el-button @click="close()" size="small">取 消</el-button> |
| | | <el-button |
| | | @click="submit()" |
| | | type="primary" |
| | | :loading="submitBtnLoading" |
| | | size="small" |
| | | >{{ submitText }}</el-button |
| | | > |
| | | <el-button |
| | | @click="resembleQuerySubmit" |
| | | type="primary" |
| | | size="small" |
| | | v-if="showResembleQuery" |
| | | >相似像查询</el-button |
| | | > |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getCodeRule, getFormTemplate } from "@/api/formTemplate.js"; |
| | | import FormTempalte from "./FormTempalte"; |
| | | import FormTemplate from "./FormTemplate"; |
| | | import ResembleQuery from "./ResembleQuery"; |
| | | export default { |
| | | name: "FormTemplateDialog", |
| | | components: { ResembleQuery, FormTempalte }, |
| | | components: { ResembleQuery, FormTemplate }, |
| | | props: { |
| | | visible: { |
| | | type: Boolean, |
| | |
| | | this.activeName = "resembleQuery"; |
| | | this.showResembleQuery = true; |
| | | } |
| | | this.$refs.FormTempalte.templateRender(res.data.formDefineVO.items); |
| | | this.$refs.FormTemplate.templateRender(res.data.formDefineVO.items); |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | .catch(() => { |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | |
| | | "coderefersec", |
| | | ]; |
| | | this.secVOList = (res.data.data.secVOList || []).filter((item) => |
| | | typeList.includes(item) |
| | | typeList.includes(item.secType) |
| | | ); |
| | | this.$nextTick(() => { |
| | | if (this.secVOList.length > 0 && this.type === "add") { |
| | |
| | | }, |
| | | async submit() { |
| | | // 进行表单校验 |
| | | const formValidate = await this.$refs.FormTempalte.validate(); |
| | | const formValidate = await this.$refs.FormTemplate.validate(); |
| | | if (!formValidate) return; |
| | | let codeValidate = true; |
| | | // 进行码值申请校验 |
| | |
| | | this.form |
| | | ); |
| | | if (resembleQueryList.length === 0) { |
| | | let resForm = {} |
| | | const { defaultValue, formValue } = this.getDefaultValueAndFormValues(this.form) |
| | | resForm.data = formValue |
| | | resForm = Object.assign({}, resForm, defaultValue) |
| | | resForm.secDTOList = [] |
| | | let resForm = {}; |
| | | const { defaultValue, formValue } = this.getDefaultValueAndFormValues( |
| | | this.form |
| | | ); |
| | | resForm.data = formValue; |
| | | resForm = Object.assign({}, resForm, defaultValue); |
| | | resForm.secDTOList = []; |
| | | for (const key in this.codeApplyForm) { |
| | | if (Object.hasOwnProperty.call(this.codeApplyForm, key)) { |
| | | const value = this.codeApplyForm[key]; |
| | | if (value) { |
| | | resForm.secDTOList.push({[key]: value}) |
| | | if (Object.hasOwnProperty.call(this.codeApplyForm, key)) { |
| | | const value = this.codeApplyForm[key]; |
| | | if (value) { |
| | | resForm.secDTOList.push({ [key]: value }); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | this.$emit("submit", resForm); |
| | | } else { |
| | | this.$confirm( |
| | |
| | | }; |
| | | }, |
| | | getType(item) { |
| | | return this.selfColumnType[item.sectype]; |
| | | return this.selfColumnType[item.secType]; |
| | | }, |
| | | getReferConfig(item) { |
| | | let params = {}; |
| | | if (item.sectype == "codeclassifysec") { |
| | | if (item.secType == "codeclassifysec") { |
| | | params = { |
| | | isMuti: false, |
| | | type: "grid", |
| | |
| | | : "", |
| | | }, |
| | | }; |
| | | } else if (item.sectype == "coderefersec") { |
| | | params = JSON.parse(item.referValueInfo); |
| | | } else if (item.secType == "coderefersec") { |
| | | params = JSON.parse(item.referConfig); |
| | | } |
| | | return params; |
| | | }, |
| | | getDisabled(item) { |
| | | if (item.sectype === "codeclassifysec") { |
| | | if (item.secType === "codeclassifysec") { |
| | | if (item.parentClassifySecOid) { |
| | | if (!this.codeApplyForm[item.parentClassifySecOid]) { |
| | | return true; |