diff --git a/src/components/negative/distribute.vue b/src/components/negative/distribute.vue
index d26182e..a10af9e 100644
--- a/src/components/negative/distribute.vue
+++ b/src/components/negative/distribute.vue
@@ -22,22 +22,53 @@
+
+
+
+
+
+
+
请根据问题信息的内容,再次确认涉及单位是否正确
+
+
+
+
-
-
-
-
请根据问题信息的内容,再次确认涉及单位是否正确
-
-
+
+
+ (form.involveDepartName =
+ row.shortName)
+ "
+ />
+ 关联问题办理单位
+
+
@@ -67,6 +98,7 @@ import useCatchStore from "@/stores/modules/catch";
import { secondList, listChildren, departTree, listByFirstHost } from "@/api/system/depart";
import { FlowNodeEnum } from "@/enums/flowEnums";
import { HostLevel } from "@/enums/dictEnums";
+import feedback from "@/utils/feedback";
const dict = useCatchStore().getDicts([
"hostLevel",
@@ -152,9 +184,22 @@ const rules = {
};
function handleSelectDepart(val: string) {
- form.value.departName = departs.value.filter(
- (item) => item.id === val
- )[0].shortName;
+ // form.value.departName = departs.value.filter(
+ // (item) => item.id === val
+ // )[0].shortName;
+ const node = findDepartById(departs.value, val)
+ form.value.departName = node?.shortName ?? ''
+}
+
+function findDepartById(list: any[], id: string): any | null {
+ for (const item of list) {
+ if (String(item.id) === String(id)) return item
+ if (item.children?.length) {
+ const found = findDepartById(item.children, id)
+ if (found) return found
+ }
+ }
+ return null
}
async function validate() {
@@ -164,6 +209,17 @@ async function validate() {
}
}
+function handleLinkDepart() {
+ if (!form.value.departId) {
+ feedback.msgWarning(
+ "请先选择办理单位!"
+ );
+ return;
+ }
+ form.value.involveDepartId = form.value.departId;
+ form.value.involveDepartName = form.value.departName;
+}
+
defineExpose({
validate,
});