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 += "
" + "
" + "" + - "" + (type ? item.title : item.context) + "" + + "" + displayName + "" + "
" + "" + "
"; @@ -152,7 +188,13 @@ function submitApply() { if(dataList.length > 0){ $.each(dataList, function (index, item) { idArr.push(item.nodeId); - nameArr.push(item.context); + // 提交时使用原始的context,不包含昵称的括号部分 + let originalName = item.context; + // 如果context中包含昵称格式(nikeName),则提取原始名称 + if (originalName.includes('(') && originalName.includes(')')) { + originalName = originalName.substring(0, originalName.lastIndexOf('(')); + } + nameArr.push(originalName); }) } console.error(idArr); diff --git a/js/car_demand_plan/child/emerg_internal_car_edit_form.js b/js/car_demand_plan/child/emerg_internal_car_edit_form.js index fed35e3..cd9a5d5 100644 --- a/js/car_demand_plan/child/emerg_internal_car_edit_form.js +++ b/js/car_demand_plan/child/emerg_internal_car_edit_form.js @@ -199,7 +199,8 @@ function setNumColor(value, type) { // 1.需要量 2.已发货量 3.差缺量 function submitApply(data) { let length = $('.file-iteme').length; if (length === 0) { - return layer.msg('请上传计划附件', { icon: 7 }); + console.log("未上传计划附件"); + // return layer.msg('请上传计划附件', { icon: 7 }); } let list = getBaseTableData(); // 校验配件入库数量 diff --git a/js/car_demand_plan/child/emerg_internal_car_form.js b/js/car_demand_plan/child/emerg_internal_car_form.js index a8cf435..3bf60d1 100644 --- a/js/car_demand_plan/child/emerg_internal_car_form.js +++ b/js/car_demand_plan/child/emerg_internal_car_form.js @@ -152,10 +152,6 @@ function setNumColor(value, type) { // 1.需要量 2.已发货量 3.差缺量 // 提交 function submitApply(data) { - // 校验附件是否上传 - if (fileList.length === 0) { - return layer.msg('请上传计划附件', { icon: 7 }); - } let list = getBaseTableData(); if (list.length === 0) { return layer.msg('未添加申请明细数据', { icon: 7 }); @@ -171,10 +167,17 @@ function submitApply(data) { let loadingMsg = layer.msg('正在提交保存,请稍等...', { icon: 16, shade: 0.01, time: '0' }); let url = dataUrl + 'backstage/carNeedPlan/addNeedPlanData'; let formData = new FormData(); - //遍历最终文件集合 - for (let i = 0; i < fileList.length; i++) { - formData.append("file[]", fileList[i].file) + // 校验附件是否上传 + if (fileList.length === 0) { + // return layer.msg('请上传计划附件', { icon: 7 }); + formData.append("file[]", null); + } else { + //遍历最终文件集合 + for (let i = 0; i < fileList.length; i++) { + formData.append("file[]", fileList[i].file) + } } + data.field.detailList = list; data.field.applyType = '1'; data.field.code = 'spec-' + data.field.code; diff --git a/js/public.js b/js/public.js index 770e3c4..f01fab5 100644 --- a/js/public.js +++ b/js/public.js @@ -1,11 +1,11 @@ -// const dataUrl = 'http://127.0.0.1:21522/gz_car/'; // 数据请求路径 +// const dataUrl = 'http://localhost:21522/'; // 数据请求路径 // const fileUrl = 'http://127.0.0.1:21522/gz_car/statics'; // 文件路径 -// const viewFileUrl = 'http://192.168.0.14:8012/onlinePreview?url=' //14服务器预览文件 +const viewFileUrl = 'http://192.168.0.14:8012/onlinePreview?url=' //14服务器预览文件 const dataUrl = 'http://192.168.0.16:21522/gz-car/'; // 数据请求路径 const fileUrl = 'http://192.168.0.16:21522/gz-car/statics'; // 文件路径 const signFileUrl = 'http://127.0.0.1:21995/statics'; // 签名文件路径 -const viewFileUrl = 'http://192.168.0.14:8012/onlinePreview?url=' //14服务器预览文件 +// const viewFileUrl = 'http://192.168.0.14:8012/onlinePreview?url=' //14服务器预览文件 */ /* 请求 */ function ajaxRequest(url, type, data, async, beforeFn, successFn, errorFn, contentType) { @@ -231,7 +231,7 @@ function getUrlParam(key) { // 预览文件 function commonViewFile(params) { let path = fileUrl + params + '?auth=' + sessionStorage.getItem("gz-token"); - // path = fileUrl + params + // path = fileUrl + params console.log(path); let encodePath = encodeURIComponent(useBase64.encode64(path)); window.open(viewFileUrl + encodePath + '&token=' + generateToken()); @@ -544,4 +544,4 @@ function numToChinese(num) { } else if (num === 36) { return '三十六'; } -} +} \ No newline at end of file diff --git a/page/car_demand_plan/child/apply_plan_edit_form.html b/page/car_demand_plan/child/apply_plan_edit_form.html index edcf005..2b571e2 100644 --- a/page/car_demand_plan/child/apply_plan_edit_form.html +++ b/page/car_demand_plan/child/apply_plan_edit_form.html @@ -119,17 +119,17 @@
- +
+ maxlength="50" lay-affix="clear" style="width: 150px;">
- +
+ maxlength="50" lay-affix="clear" style="width: 150px;">
diff --git a/page/car_demand_plan/child/apply_plan_form.html b/page/car_demand_plan/child/apply_plan_form.html index 542c83a..b11adbb 100644 --- a/page/car_demand_plan/child/apply_plan_form.html +++ b/page/car_demand_plan/child/apply_plan_form.html @@ -78,17 +78,17 @@
- +
+ maxlength="50" lay-affix="clear" style="width: 150px;">
- +
+ maxlength="50" lay-affix="clear" style="width: 150px;">
diff --git a/page/car_demand_plan/child/emerg_internal_car_edit_form.html b/page/car_demand_plan/child/emerg_internal_car_edit_form.html index c3a889b..069071d 100644 --- a/page/car_demand_plan/child/emerg_internal_car_edit_form.html +++ b/page/car_demand_plan/child/emerg_internal_car_edit_form.html @@ -77,7 +77,7 @@
-

计划附件上传*

+

计划附件上传

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 @@
-

计划附件上传*

+

计划附件上传