| | |
| | | class="avue-dialog avue-dialog--top" |
| | | :width="width" |
| | | append-to-body |
| | | @opened="openDialog" |
| | | > |
| | | <FormTempalte |
| | | v-bind="$attrs" |
| | | :dialogOpen="visible" |
| | | :visible="visible" |
| | | :type="type" |
| | | v-if="dialogVisible" |
| | | ref="FormTempalte" |
| | | @getFormTemplateEnd="getFormTemplate" |
| | | @getFormData="getFormData" |
| | | ></FormTempalte> |
| | | |
| | | <div class="tab_box"> |
| | | <el-tabs v-model="activeName" type="card"> |
| | | <div class="tab_box" v-if="type !== 'detail' && dialogVisible && (showCodeApply || showResembleQuery)"> |
| | | <el-tabs v-model="activeName" type="border-card"> |
| | | <el-tab-pane label="码值申请" name="codeApply" v-if="showCodeApply"> |
| | | <CodeApply v-bind="$attrs"></CodeApply> |
| | | <CodeApply |
| | | ref="CodeApply" |
| | | v-bind="$attrs" |
| | | @getCodeRuleOid="getCodeRuleOid" |
| | | ></CodeApply> |
| | | </el-tab-pane> |
| | | <el-tab-pane |
| | | label="相似项查询" |
| | |
| | | </div> |
| | | <div class="avue-dialog__footer" v-if="type !== 'detail'"> |
| | | <el-button @click="close()">取 消</el-button> |
| | | <el-button @click="close()" type="primary" :loading="submitBtnLoading" |
| | | <el-button @click="submit()" type="primary" :loading="submitBtnLoading" |
| | | >确 定</el-button |
| | | > |
| | | <el-button @click="resembleQuerySubmit" type="primary" v-if="hasResemble" |
| | | <el-button @click="resembleQuerySubmit" type="primary" v-if="showResembleQuery" |
| | | >相似像查询</el-button |
| | | > |
| | | </div> |
| | |
| | | }, |
| | | title: { |
| | | type: String, |
| | | default: "表单模板", |
| | | default: "编码申请", |
| | | }, |
| | | width: { |
| | | type: String, |
| | |
| | | submitBtnLoading: false, |
| | | hasResemble: false, |
| | | resembleTableColumn: [], |
| | | activeName: "resembleQuery", |
| | | form: {} |
| | | secVOList: [], |
| | | form: {}, |
| | | }; |
| | | }, |
| | | created() {}, |
| | |
| | | }, |
| | | showCodeApply() { |
| | | if (this.type === "add") { |
| | | if (this.hasResemble && this.resembleTableColumn.length === 0) { |
| | | if (this.hasResemble && this.secVOList.length === 0) { |
| | | return false; |
| | | } |
| | | } else { |
| | | if (this.hasResemble) { |
| | | return false; |
| | | } |
| | | return false; |
| | | } |
| | | return true; |
| | | }, |
| | | showResembleQuery() { |
| | | return this.hasResemble; |
| | | }, |
| | | activeName() { |
| | | return ( |
| | | (this.showCodeApply && "codeApply") || |
| | | (this.showResembleQuery && "resembleQuery") |
| | | ); |
| | | }, |
| | | }, |
| | | methods: { |
| | | openDialog() { |
| | | this.$nextTick(() => { |
| | | this.$refs.FormTempalte.init(); |
| | | }); |
| | | }, |
| | | close() { |
| | | this.dialogVisible = false; |
| | | }, |
| | | getCodeRuleOid(data) { |
| | | this.secVOList = data.secVOList; |
| | | }, |
| | | getFormTemplate(data) { |
| | | this.hasResemble = |
| | |
| | | this.resembleTableColumn = data.resembleTableVO.cols || []; |
| | | }, |
| | | getFormData(form) { |
| | | this.form = form |
| | | this.form = form; |
| | | }, |
| | | resembleQuerySubmit() { |
| | | this.$refs.resembleQueryRef.resembleQuery(this.form); |
| | | }, |
| | | async submit() { |
| | | const formValidate = await this.$refs.FormTempalte.validate(); |
| | | if (this.showCodeApply) { |
| | | const codeValidate = this.$refs.CodeApply.validate(); |
| | | console.log(formValidate, codeValidate); |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |