| | |
| | | v-bind="$attrs" |
| | | :visible="visible" |
| | | :type="type" |
| | | :rowOid="rowOid" |
| | | v-if="dialogVisible" |
| | | ref="FormTempalte" |
| | | @getFormTemplateEnd="getFormTemplate" |
| | | @getFormData="getFormData" |
| | | ></FormTempalte> |
| | | |
| | | <div class="tab_box" v-if="type !== 'detail' && dialogVisible && (showCodeApply || showResembleQuery)"> |
| | | <el-tabs v-model="activeName" type="border-card"> |
| | | <div |
| | | class="tab_box" |
| | | v-if=" |
| | | type !== 'detail' && |
| | | dialogVisible && |
| | | (showCodeApply || showResembleQuery) |
| | | " |
| | | > |
| | | <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick"> |
| | | <el-tab-pane label="码值申请" name="codeApply" v-if="showCodeApply"> |
| | | <CodeApply |
| | | ref="CodeApply" |
| | |
| | | <el-button @click="submit()" type="primary" :loading="submitBtnLoading" |
| | | >确 定</el-button |
| | | > |
| | | <el-button @click="resembleQuerySubmit" type="primary" v-if="showResembleQuery" |
| | | <el-button |
| | | @click="resembleQuerySubmit" |
| | | type="primary" |
| | | v-if="showResembleQuery" |
| | | >相似像查询</el-button |
| | | > |
| | | </div> |
| | |
| | | type: String, |
| | | default: "80%", |
| | | }, |
| | | rowOid: '' |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | resembleTableColumn: [], |
| | | secVOList: [], |
| | | form: {}, |
| | | activeName: "", |
| | | }; |
| | | }, |
| | | created() {}, |
| | |
| | | }, |
| | | }, |
| | | showCodeApply() { |
| | | if (this.type === "add") { |
| | | if (this.hasResemble && this.secVOList.length === 0) { |
| | | return false; |
| | | } |
| | | } else { |
| | | return false; |
| | | } |
| | | // 测试数据展示 |
| | | // if (this.type === "add") { |
| | | // if (this.hasResemble && this.secVOList.length === 0) { |
| | | // return false; |
| | | // } |
| | | // } else { |
| | | // return false; |
| | | // } |
| | | return true; |
| | | }, |
| | | showResembleQuery() { |
| | | return this.hasResemble; |
| | | }, |
| | | activeName() { |
| | | return ( |
| | | (this.showCodeApply && "codeApply") || |
| | | (this.showResembleQuery && "resembleQuery") |
| | | ); |
| | | }, |
| | | }, |
| | | methods: { |
| | | openDialog() { |
| | | this.$nextTick(() => { |
| | | this.$refs.FormTempalte.init(); |
| | | this.$refs.CodeApply.getCodeRule(); |
| | | }); |
| | | }, |
| | | close() { |
| | |
| | | data.resembleTableVO.cols && |
| | | data.resembleTableVO.cols.length > 0; |
| | | this.resembleTableColumn = data.resembleTableVO.cols || []; |
| | | this.activeName = |
| | | (this.showCodeApply && "codeApply") || |
| | | (this.showResembleQuery && "resembleQuery"); |
| | | }, |
| | | getFormData(form) { |
| | | this.form = form; |
| | |
| | | resembleQuerySubmit() { |
| | | this.$refs.resembleQueryRef.resembleQuery(this.form); |
| | | }, |
| | | handleClick() { |
| | | if (this.activeName === 'resembleQuery') { |
| | | this.resembleQuerySubmit() |
| | | } |
| | | }, |
| | | async submit() { |
| | | const formValidate = await this.$refs.FormTempalte.validate(); |
| | | let codeValidate = true; |
| | | if (this.showCodeApply) { |
| | | const codeValidate = this.$refs.CodeApply.validate(); |
| | | console.log(formValidate, codeValidate); |
| | | codeValidate = await this.$refs.CodeApply.validate(); |
| | | } |
| | | this.$emit("submit", { |
| | | form: this.form, |
| | | flag: formValidate && codeValidate, |
| | | }); |
| | | }, |
| | | }, |
| | | }; |