From 495da50c21fa91b3bd0d37d2ed158a0ba0d79335 Mon Sep 17 00:00:00 2001
From: 康东 <98470202+kangdong59@users.noreply.github.com>
Date: 星期一, 26 六月 2023 11:12:18 +0800
Subject: [PATCH] 业务类型Feign模糊查询
---
Source/UBCS-WEB/src/components/FormTemplate/index.vue | 297 +++++++++++++++++++++-------------------------------------
1 files changed, 108 insertions(+), 189 deletions(-)
diff --git a/Source/UBCS-WEB/src/components/FormTemplate/index.vue b/Source/UBCS-WEB/src/components/FormTemplate/index.vue
index a908408..f37041e 100644
--- a/Source/UBCS-WEB/src/components/FormTemplate/index.vue
+++ b/Source/UBCS-WEB/src/components/FormTemplate/index.vue
@@ -3,9 +3,8 @@
:visible.sync="dialogVisible"
v-if="dialogVisible"
v-dialogDrag
- top="0vh"
+ top="5vh"
:title="title"
- class="avue-dialog avue-dialog--top"
:width="width"
append-to-body
@opened="openDialog"
@@ -30,14 +29,14 @@
"
>
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
- <el-tab-pane label="鐮佸�肩敵璇�" name="codeApply">
+ <el-tab-pane label="鐮佸�肩敵璇�" name="codeApply" v-if="showCodeApply">
<FormTempalte
v-bind="$attrs"
:type="type"
:selfColumnType="selfColumnType"
:selfColumnConfig="selfColumnConfig"
ref="CodeApply"
- @getFormData="getFormData"
+ @getFormData="getCodeApplyFormData"
@referConfigDataUpdate="referConfigDataUpdate"
></FormTempalte>
</el-tab-pane>
@@ -58,18 +57,25 @@
</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>
@@ -119,6 +125,7 @@
resembleTableColumn: [],
secVOList: [],
form: {},
+ codeApplyForm: {},
activeName: "codeApply",
showCodeApply: true,
showResembleQuery: true,
@@ -154,6 +161,38 @@
},
},
},
+ defaultKeys: [
+ "oid",
+ "id",
+ "name",
+ "description",
+ "revisionoid",
+ "nameoid",
+ "btmname",
+ "lastr",
+ "firstr",
+ "lastv",
+ "firstv",
+ "creator",
+ "createtime",
+ "lastModifier",
+ "lastmodifytime",
+ "revisionrule",
+ "revisionseq",
+ "revisionvalue",
+ "versionrule",
+ "versionseq",
+ "versionvalue",
+ "lcstatus",
+ "ts",
+ "owner",
+ "checkinby",
+ "checkintime",
+ "checkoutby",
+ "checkouttime",
+ "copyfromversion",
+ "secretgrade",
+ ],
};
},
created() {},
@@ -199,12 +238,12 @@
})
.catch((err) => {
this.loading = false;
- console.log(err);
});
},
// 鑾峰彇鐮佸�肩敵璇锋暟鎹�
getCodeRule() {
getCodeRule({ codeClassifyOid: this.codeClassifyOid }).then((res) => {
+ console.log(res, "resresresresres");
if (res.data && res.data.code === 200) {
const typeList = [
"codefixedsec",
@@ -212,172 +251,10 @@
"codevariablesec",
"coderefersec",
];
-
- this.secVOList = [
- {
- btmname: "codebasicsec",
- checkInBy: "",
- checkInTime: null,
- checkOutBy: "",
- checkOutTime: null,
- codeDateFormatStr: "",
- codeFillFlag: "",
- codeFillLength: "",
- codeFillLimit: 0,
- codeFillSeparator: "",
- codeFillType: "",
- codeFillTypeText: "",
- codeGetValueType: "",
- codeGetValueTypeText: "",
- codeLevelType: "",
- codeLevelTypeText: "",
- codeLevelValue: 0,
- codeSecLength: "10",
- codeSecLengthType: "code_sec_length_variable",
- codeSecLengthTypeText: "",
- componentCodeFlag: "false",
- copyFromVersion: "",
- createTime: "2023-06-06 14:10:27.000",
- creator: "1",
- customCodeSerialClass: "",
- data: null,
- description: "",
- displayFlag: "false",
- filterSql: "",
- firstR: "1",
- firstV: "1",
- fixedValueVOList: null,
- getValueClass: "",
- id: "0001",
- lastModifier: "1",
- lastModifyTime: "2023-06-06 14:10:27.000",
- lastR: "1",
- lastV: "1",
- lcStatus: "Exist",
- lcStatusText: "瀛樺湪",
- lctid: "defaultLC",
- matchClassifyValueFlag: "false",
- name: "鍒嗙被鐮佹鐖�",
- nameOid: "C2998D32-E89E-6D41-0782-88E97E9EC65B",
- nullableFlag: "false",
- oid: "1668926002119708672",
- orderNum: 1,
- owner: "1",
- parentClassifySecOid: "",
- parentClassifySecText: "",
- pkCodeRule: "B4766355-E4E1-490A-833B-D5AB73E9B877",
- referAttributeId: "",
- referAttributeName: "",
- referBtmId: "",
- referBtmName: "",
- referCodeClassifyOid: "",
- referCodeClassifyOidName: "",
- referConfig: "",
- referValueInfo: "",
- revisionOid: "F0049108-6AAE-EAAD-BC76-E6714C2B8F2A",
- revisionRule: "",
- revisionSeq: 1,
- revisionValue: "",
- secretGrade: null,
- secretGradeText: "",
- sectype: "codeclassifysec",
- sectypeText: "鍒嗙被鐮佹",
- serialDependFlag: "false",
- serialDependOrder: 0,
- serialStart: "",
- serialStep: 0,
- ts: "2023-06-06 14:10:27.716",
- valueCutLength: 0,
- valueCutType: "",
- valueCutTypeText: "",
- versionRule: "0",
- versionSeq: 1,
- versionValue: "1",
- },
- {
- btmname: "codebasicsec",
- checkInBy: "",
- checkInTime: null,
- checkOutBy: "",
- checkOutTime: null,
- codeDateFormatStr: "",
- codeFillFlag: "",
- codeFillLength: "",
- codeFillLimit: 0,
- codeFillSeparator: "",
- codeFillType: "",
- codeFillTypeText: "",
- codeGetValueType: "",
- codeGetValueTypeText: "",
- codeLevelType: "",
- codeLevelTypeText: "",
- codeLevelValue: 0,
- codeSecLength: "10",
- codeSecLengthType: "code_sec_length_variable",
- codeSecLengthTypeText: "",
- componentCodeFlag: "false",
- copyFromVersion: "",
- createTime: "2023-06-06 14:10:50.000",
- creator: "1",
- customCodeSerialClass: "",
- data: null,
- description: "",
- displayFlag: "false",
- filterSql: "",
- firstR: "1",
- firstV: "1",
- fixedValueVOList: null,
- getValueClass: "",
- id: "000101",
- lastModifier: "1",
- lastModifyTime: "2023-06-06 14:10:50.000",
- lastR: "1",
- lastV: "1",
- lcStatus: "Exist",
- lcStatusText: "瀛樺湪",
- lctid: "defaultLC",
- matchClassifyValueFlag: "false",
- name: "鍒嗙被鐮佹瀛�",
- nameOid: "1FDB20E3-9F68-A5B0-D097-2142EA054F9B",
- nullableFlag: "false",
- oid: "00AD9FE0-A31D-7962-10DF-DC6115EF80A5",
- orderNum: 2,
- owner: "1",
- parentClassifySecOid: "1668926002119708672",
- parentClassifySecText: "鍒嗙被鐮佹",
- pkCodeRule: "B4766355-E4E1-490A-833B-D5AB73E9B877",
- referAttributeId: "",
- referAttributeName: "",
- referBtmId: "",
- referBtmName: "",
- referCodeClassifyOid: "",
- referCodeClassifyOidName: "",
- referConfig: "",
- referValueInfo: "",
- revisionOid: "95183EF9-C9AD-2941-1C99-9E9024330D40",
- revisionRule: "",
- revisionSeq: 1,
- revisionValue: "",
- secretGrade: null,
- secretGradeText: "",
- sectype: "codeclassifysec",
- sectypeText: "鍒嗙被鐮佹",
- serialDependFlag: "false",
- serialDependOrder: 0,
- serialStart: "",
- serialStep: 0,
- ts: "2023-06-06 14:10:50.084",
- valueCutLength: 0,
- valueCutType: "",
- valueCutTypeText: "",
- versionRule: "0",
- versionSeq: 1,
- versionValue: "1",
- },
- ];
- // this.secVOList = (res.data.data.secVOList || []).filter((item) =>
- // typeList.includes(item)
- // );
+ this.secVOList = (res.data.data.secVOList || []).filter((item) =>
+ typeList.includes(item.secType)
+ );
+ console.log(this.secVOList, "this.secVOListthis.secVOList");
this.$nextTick(() => {
if (this.secVOList.length > 0 && this.type === "add") {
this.showCodeApply = true;
@@ -393,6 +270,9 @@
getFormData(form) {
this.form = form;
},
+ getCodeApplyFormData(codeApplyForm) {
+ this.codeApplyForm = codeApplyForm;
+ },
// 鍙傜収缁勪欢鏁版嵁鍙樻洿
referConfigDataUpdate(data) {
const { field } = data;
@@ -401,8 +281,9 @@
this.$refs.CodeApply.form[item.oid] = undefined;
this.$refs.CodeApply.form[item.name] = undefined;
}
+ return item;
});
- this.$refs.CodeApply.templateRender();
+ this.$refs.CodeApply.templateRender(this.secVOList);
},
resembleQuerySubmit() {
this.activeName = "resembleQuery";
@@ -420,7 +301,8 @@
let codeValidate = true;
// 杩涜鐮佸�肩敵璇锋牎楠�
if (this.showCodeApply) {
- codeValidate = await this.$refs.codeApply.validate();
+ codeValidate = await this.$refs.CodeApply.validate();
+ console.log(9999);
if (!codeValidate) return;
}
// 杩涜鐩镐技椤规煡璇�
@@ -428,7 +310,22 @@
this.form
);
if (resembleQueryList.length === 0) {
- this.$emit("submit", this.form);
+ 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 });
+ }
+ }
+ }
+ this.$emit("submit", resForm);
} else {
this.$confirm(
`璇ョ墿鏂欏凡鏈�${resembleQueryList.length}鏉$浉浼兼暟鎹紝鏄惁缁х画淇濆瓨锛焋,
@@ -445,6 +342,24 @@
.catch(() => {});
}
},
+ getDefaultValueAndFormValues(form) {
+ let defaultValue = {};
+ let formValue = {};
+ for (const key in form) {
+ if (Object.hasOwnProperty.call(form, key)) {
+ const element = form[key];
+ if (this.defaultKeys.includes(key)) {
+ defaultValue[key] = element;
+ } else {
+ formValue[key] = element;
+ }
+ }
+ }
+ return {
+ defaultValue,
+ formValue,
+ };
+ },
getType(item) {
return this.selfColumnType[item.sectype];
},
@@ -489,16 +404,20 @@
url: "api/ubcs-code/ubcs-code/mdmEngineController/listCodeClassifyValueBySecOid",
extraParams: {
classifySecOid: item.oid,
- parentClassifyValueOid: "",
+ parentClassifyValueOid: item.parentClassifySecOid
+ ? this.codeApplyForm[item.parentClassifySecOid]
+ : "",
},
};
+ } else if (item.sectype == "coderefersec") {
+ params = JSON.parse(item.referValueInfo);
}
- return item.referConfig || params;
+ return params;
},
getDisabled(item) {
if (item.sectype === "codeclassifysec") {
if (item.parentClassifySecOid) {
- if (!this.form[item.parentClassifySecOid]) {
+ if (!this.codeApplyForm[item.parentClassifySecOid]) {
return true;
} else {
return false;
--
Gitblit v1.10.0