From af94df67fe0229fc8bde81204da4eb0745f10d38 Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期一, 25 九月 2023 16:38:50 +0800 Subject: [PATCH] 修改参照联动 --- Source/UBCS-WEB/src/components/refer/vciWebRefer.vue | 8 ++++---- Source/UBCS-WEB/src/components/FormTemplate/index.vue | 3 ++- Source/UBCS-WEB/src/components/code-dialog-page/maxSerialnumDialog.vue | 6 ++++-- Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue | 21 ++++++++++++--------- Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue | 5 ++--- 5 files changed, 24 insertions(+), 19 deletions(-) diff --git a/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue b/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue index 9f69e9b..d3aa4cd 100644 --- a/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue +++ b/Source/UBCS-WEB/src/components/FormTemplate/FormTemplate.vue @@ -26,13 +26,14 @@ </template> <template :slot="item.prop + ''" v-for="item in slotColumnList"> <vciWebRefer - :key="item.prop" :data-key="item.prop" + :key="item.dataKey" :data-key="item.dataKey" v-if="item.type == 'refer'" :referConfig="item.referConfig || {}" :value="form[item.referConfig.field] || item.value" :text="form[item.referConfig.showField]" :disabled="item.disabled" :display="item.display" + :reloadData="item.referConfig.reloadData || false" @setReferValue="setReferValue" ></vciWebRefer> </template> @@ -218,6 +219,7 @@ formItem.fieldMap[formItem.field+'id']='id' } let columnItem = { + dataKey:formItem.dataKey || formItem.field, label: formItem.text, labelslot: true, prop: this.$utilFunc.isValuableObj(formItem.referConfig) @@ -301,6 +303,7 @@ changeChildItem(items,TreeValue) { let column = this.option.column; let group = this.option.group; + let that=this; items.forEach((item) => { let formItem = this.resetFormConfig(item); if (formItem.field == "lcstatus") { @@ -384,22 +387,22 @@ }; if (group.length === 0) { - this.slotColumnList.forEach((index, colItem) => { + that.slotColumnList.forEach((colItem,index) => { if (colItem.field == columnItem.field) { - this.slotColumnList[index] = columnItem; + that.slotColumnList[index] = columnItem; column[index] = columnItem; return; } }) } else { - this.slotColumnList.forEach((index, colItem) => { + that.slotColumnList.forEach((colItem,index) => { if (colItem.field == columnItem.field) { - this.slotColumnList[index] = columnItem; + that.slotColumnList[index] = columnItem; return; } }) - group.forEach((index, groupItem) => { - groupItem.column.forEach((colIndex, colItem) => { + group.forEach((groupItem,index) => { + groupItem.column.forEach((colItem,colIndex) => { if (colItem.field == columnItem.field) { group[index].column[colIndex] = columnItem; return; @@ -408,8 +411,8 @@ }); } }); - this.$set(this.option, "column", column); - this.$set(this.option, "group", group); + that.$set(that.option, "column", column); + that.$set(that.option, "group", group); }, // 浣跨敤浼犲叆鐨勮〃鍗曟暟鎹厤缃� resetFormConfig(formItem) { diff --git a/Source/UBCS-WEB/src/components/FormTemplate/index.vue b/Source/UBCS-WEB/src/components/FormTemplate/index.vue index 858400a..6e36920 100644 --- a/Source/UBCS-WEB/src/components/FormTemplate/index.vue +++ b/Source/UBCS-WEB/src/components/FormTemplate/index.vue @@ -325,6 +325,7 @@ this.$refs.CodeApply.form[item.name] = undefined; item.readOnly=false; item.referConfig.extraParams.parentClassifyValueOid=data.value; + item.referConfig.reloadData = true; childItems.push(item) } return item; @@ -355,7 +356,7 @@ // } // } let resembleQueryList = []; - if (this.$refs.resembleQueryRef) { + if (this.showResembleQuery && this.$refs.resembleQueryRef) { // 杩涜鐩镐技椤规煡璇� resembleQueryList = await this.$refs.resembleQueryRef.resembleQuery( this.form diff --git a/Source/UBCS-WEB/src/components/code-dialog-page/maxSerialnumDialog.vue b/Source/UBCS-WEB/src/components/code-dialog-page/maxSerialnumDialog.vue index 155d24a..183b735 100644 --- a/Source/UBCS-WEB/src/components/code-dialog-page/maxSerialnumDialog.vue +++ b/Source/UBCS-WEB/src/components/code-dialog-page/maxSerialnumDialog.vue @@ -201,6 +201,8 @@ this.$refs.CodeApply.form[item.name] = undefined; item.readOnly = false; item.referConfig.extraParams.parentClassifyValueOid = data.value; + item.referConfig.reloadData = true; + item.dataKey=item.oid+'_'+new Date().getTime(); childItems.push(item) } return item; @@ -230,7 +232,7 @@ if (item.secType == "codeclassifysec") { params = { isMuti: false, - valueField: 'id', + valueField: 'oid', type: "grid", tableConfig: { limit: -1, @@ -270,7 +272,7 @@ parentClassifyValueOid: item.parentClassifySecOid ? this.codeApplyForm[item.parentClassifySecOid] : "", - }, + } }; } else if (item.secType == "coderefersec") { params = JSON.parse(item.referValueInfo); diff --git a/Source/UBCS-WEB/src/components/refer/vciWebRefer.vue b/Source/UBCS-WEB/src/components/refer/vciWebRefer.vue index f73ca39..046f761 100644 --- a/Source/UBCS-WEB/src/components/refer/vciWebRefer.vue +++ b/Source/UBCS-WEB/src/components/refer/vciWebRefer.vue @@ -1,8 +1,8 @@ <template> <div v-if="display"> - <vciWebReferTree :key="referConfig.field" :data-key="referConfig.field" ref="vciWebReferTree" v-if="refertype=='tree'" @setValue="setValue" :value="value" :text="text" :title="title" :disabled="disabled" :referConfig="referConfig"></vciWebReferTree> - <vciWebReferTable :key="referConfig.field" :data-key="referConfig.field" v-else-if="refertype=='table'" @setValue="setValue" :value="value" :text="text" :title="title" :disabled="disabled" :referConfig="referConfig"></vciWebReferTable> - <vciWebReferDefalut :key="referConfig.field" :data-key="referConfig.field" v-else @setValue="setValue" :value="value" :text="text" :title="title" :disabled="disabled" :referConfig="referConfig"></vciWebReferDefalut> + <vciWebReferTree :key="key" :data-key="key" ref="vciWebReferTree" v-if="refertype=='tree'" @setValue="setValue" :value="value" :text="text" :title="title" :disabled="disabled" :referConfig="referConfig"></vciWebReferTree> + <vciWebReferTable :key="key" :data-key="key" v-else-if="refertype=='table'" @setValue="setValue" :value="value" :text="text" :title="title" :disabled="disabled" :referConfig="referConfig"></vciWebReferTable> + <vciWebReferDefalut :key="key" :data-key="key" v-else @setValue="setValue" :value="value" :text="text" :title="title" :disabled="disabled" :referConfig="referConfig"></vciWebReferDefalut> </div> </template> @@ -13,7 +13,7 @@ import vciWebReferDefalut from "./vciWebReferDefalut.vue"; export default { name: "vciWebRefer", - props: ["referConfig","value","text","disabled","display"], + props: ["referConfig","value","text","disabled","display",'key'], components: {vciWebReferTree, vciWebReferTable, vciWebReferDefalut}, data() { return { diff --git a/Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue b/Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue index f1ac96e..f1a8c0d 100644 --- a/Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue +++ b/Source/UBCS-WEB/src/components/refer/vciWebReferTree.vue @@ -188,7 +188,7 @@ this.checkedData=checkedData var value = []; var text = []; - const textSep =this.config.textSep;debugger; + const textSep =this.config.textSep; for(var j =0;j<checkedData.checkedNodes.length;j++){ const item=checkedData.checkedNodes[j]; var v=this.config.valueField.indexOf("attribute.")>=0?(item.attributes[this.config.valueField.replace("attribute.","")] || item.attributes.data[this.config.valueField.replace("attribute.","")]):(item.attributes[this.config.valueField] || item[this.config.valueField] || item.attributes.data[this.config.valueField]) @@ -223,8 +223,7 @@ fieldMap:mapFields }); } - }, - watch:{} + } } </script> -- Gitblit v1.9.3