From 4da816a88a0dec5a43c70f007275f12f353effe6 Mon Sep 17 00:00:00 2001 From: syruan <321359594@qq.com> Date: Sun, 29 Jun 2025 18:28:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E5=85=AC=E9=87=8C=E6=95=B0?= =?UTF-8?q?=E6=AD=A3=E6=95=B0=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/init.json | 55 ++++++++++++------- index.html | 10 ++-- js/car_basic/child/supplier_band_user_form.js | 46 +++++++++++++++- .../child/emerg_internal_car_edit_form.js | 3 +- .../child/emerg_internal_car_form.js | 17 +++--- js/public.js | 10 ++-- .../child/apply_plan_edit_form.html | 8 +-- .../child/apply_plan_form.html | 8 +-- .../child/emerg_internal_car_edit_form.html | 2 +- .../child/emerg_internal_car_form.html | 2 +- 10 files changed, 112 insertions(+), 49 deletions(-) diff --git a/api/init.json b/api/init.json index 47d71f8..7cf80aa 100644 --- a/api/init.json +++ b/api/init.json @@ -16,29 +16,17 @@ "target": "_self", "child": [ { - "title": "基础管理", + "title": "人员及车辆管理", "href": "", "icon": "fa fa-cog", "target": "_self", "child": [ { - "title": "类型管理", + "title": "车辆类型管理", "href": "page/car_basic/type_list.html", "icon": "fa fa-asterisk", "target": "_self" }, - { - "title": "供应商管理", - "href": "page/car_basic/supplier_list.html", - "icon": "fa fa-university", - "target": "_self" - }, - { - "title": "框架合同", - "href": "page/car_basic/framework_contract_list.html", - "icon": "fa fa-university", - "target": "_self" - }, { "title": "车辆管理", "href": "page/car_basic/car_list.html", @@ -59,6 +47,27 @@ } ] }, + { + "title": "供应商管理", + "href": "", + "icon": "fa fa-cog", + "target": "_self", + "child": [ + { + "title": "供应商管理", + "href": "page/car_basic/supplier_list.html", + "icon": "fa fa-university", + "target": "_self" + }, + { + "title": "框架合同", + "href": "page/car_basic/framework_contract_list.html", + "icon": "fa fa-university", + "target": "_self" + } + + ] + }, { "title": "车辆需求计划管理", "href": "", @@ -66,13 +75,13 @@ "target": "_self", "child": [ { - "title": "需求计划申请", + "title": "用车计划申请", "href": "page/car_demand_plan/apply_plan_list.html", "icon": "fa fa-asterisk", "target": "_self" }, { - "title": "需求计划审核", + "title": "用车计划审核", "href": "page/car_demand_plan/apply_plan_audit_list.html", "icon": "fa fa-asterisk", "target": "_self" @@ -82,7 +91,15 @@ "href": "page/car_demand_plan/emerg_internal_car_list.html", "icon": "fa fa-asterisk", "target": "_self" - }, + } + ] + }, + { + "title": "派车、到货确认", + "href": "", + "icon": "fa fa-cog", + "target": "_self", + "child": [ { "title": "派车管理", "href": "page/car_demand_plan/dispatch_car_list.html", @@ -96,7 +113,7 @@ "target": "_self" }, { - "title": "到货确认单", + "title": "车辆到货确认单", "href": "page/car_demand_plan/arrival_confirm_list.html", "icon": "fa fa-asterisk", "target": "_self" @@ -104,7 +121,7 @@ ] }, { - "title": "结算管理", + "title": "结算及付款管理", "href": "", "icon": "fa fa-cog", "target": "_self", diff --git a/index.html b/index.html index d07b18b..f35cfd5 100644 --- a/index.html +++ b/index.html @@ -206,7 +206,7 @@ // 初始化页面 function initPage(miniAdmin){ - var options = { + const options = { iniUrl: "api/init.json", // 初始化接口 clearUrl: "api/clear.json", // 缓存清理接口 urlHashLocation: true, // 是否打开hash定位 @@ -224,10 +224,10 @@ // 登录获取token let login_url = dataUrl + 'login/userLogin' const params = { - // "username": 'sa', - // "password": 'ebbd6ea34bbab2b0813afcf59c8c9556', - "username": 'bns', - "password": '1769fb2837e10e9d22c1c25add76355a', + "username": 'sa', + "password": 'ebbd6ea34bbab2b0813afcf59c8c9556', + // "username": 'bns', + // "password": '1769fb2837e10e9d22c1c25add76355a', } ajaxRequest(login_url, "POST", params, true, function () { }, function (result) { diff --git a/js/car_basic/child/supplier_band_user_form.js b/js/car_basic/child/supplier_band_user_form.js index cf11559..8684c5e 100644 --- a/js/car_basic/child/supplier_band_user_form.js +++ b/js/car_basic/child/supplier_band_user_form.js @@ -67,6 +67,8 @@ function getDTreeData() { if (result.code === 200) { if (result.data.tree && result.data.tree.length > 0) { $.each(result.data.tree, function (index, item) { + // 处理树节点,为用户节点添加昵称显示 + processTreeNode(item); dataNum += (item.children ? item.children.length : 0); list.push(item); }) @@ -84,15 +86,49 @@ function getDTreeData() { return list; } +// 处理树节点,为用户节点添加昵称显示 +function processTreeNode(node) { + // 如果节点有子节点,递归处理 + if (node.children && node.children.length > 0) { + $.each(node.children, function (index, child) { + // 如果子节点有nikeName字段,则在title中显示昵称 + if (child.nikeName && child.nikeName.trim() !== '') { + child.title = child.title + "(" + child.nikeName + ")"; + } + // 递归处理子节点 + processTreeNode(child); + }); + } + + // 处理当前节点 + if (node.nikeName && node.nikeName.trim() !== '') { + node.title = node.title + "(" + node.nikeName + ")"; + } +} + // 添加人员数据 function addUserData(list, type) { if (list.length > 0) { let html = ""; $.each(list, function (index, item) { + // 获取显示名称,优先显示昵称,如果没有昵称则显示原名称 + let displayName = ""; + if (type) { + // type为1时,item来自后端数据,可能包含nikeName字段 + displayName = item.title ? (item.title + "(" + item.nikeName + ")") : item.title; + } else { + // type为0或undefined时,item来自dtree节点,需要从原始数据中查找nikeName + displayName = item.context; + // 如果节点数据中有nikeName信息,则显示 + if (item.nikeName) { + displayName = item.context + "(" + item.nikeName + ")"; + } + } + html += "
-计划附件上传*
+计划附件上传
diff --git a/page/car_demand_plan/child/emerg_internal_car_form.html b/page/car_demand_plan/child/emerg_internal_car_form.html index c2a0692..47b9259 100644 --- a/page/car_demand_plan/child/emerg_internal_car_form.html +++ b/page/car_demand_plan/child/emerg_internal_car_form.html @@ -77,7 +77,7 @@
-计划附件上传*
+计划附件上传
![]()