车辆公里数正数问题修改

This commit is contained in:
syruan 2025-06-29 18:28:48 +08:00
parent d038c43d13
commit 4da816a88a
10 changed files with 112 additions and 49 deletions

View File

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

View File

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

View File

@ -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 += "<div class='layout user-data'>" +
"<div>" +
"<img src='../../../images/user_head_icon.png'>" +
"<span>" + (type ? item.title : item.context) + "</span>" +
"<span>" + displayName + "</span>" +
"</div>" +
"<img style='cursor: pointer;' src='../../../images/del_icon2.png' onclick='emptyData(2,this," + (type ? item.id : item.nodeId) + ")'>" +
"</div>";
@ -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);

View File

@ -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();
// 校验配件入库数量

View File

@ -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();
// 校验附件是否上传
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;

View File

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

View File

@ -119,17 +119,17 @@
</div>
</div>
<div class="layui-inline" style="display: flex;">
<label class="layui-form-label required" style="width: 120px !important;">运输起点</label>
<label class="layui-form-label" style="width: 120px !important;">运输起点</label>
<div class="layui-input-inline" style="display: flex;">
<input class="layui-input" name="carStart" id="carStart" autocomplete="off"
lay-verify="required" maxlength="50" lay-affix="clear" style="width: 150px;">
maxlength="50" lay-affix="clear" style="width: 150px;">
</div>
</div>
<div class="layui-inline" style="display: flex;">
<label class="layui-form-label required" style="width: 120px !important;">运输终点</label>
<label class="layui-form-label" style="width: 120px !important;">运输终点</label>
<div class="layui-input-inline" style="display: flex;">
<input class="layui-input" name="carEnd" id="carEnd" autocomplete="off"
lay-verify="required" maxlength="50" lay-affix="clear" style="width: 150px;">
maxlength="50" lay-affix="clear" style="width: 150px;">
</div>
</div>
</div>

View File

@ -78,17 +78,17 @@
</div>
</div>
<div class="layui-inline" style="display: flex;">
<label class="layui-form-label required" style="width: 120px !important;">运输起点</label>
<label class="layui-form-label" style="width: 120px !important;">运输起点</label>
<div class="layui-input-inline" style="display: flex;">
<input class="layui-input" name="carStart" id="carStart" autocomplete="off"
lay-verify="required" maxlength="50" lay-affix="clear" style="width: 150px;">
maxlength="50" lay-affix="clear" style="width: 150px;">
</div>
</div>
<div class="layui-inline" style="display: flex;">
<label class="layui-form-label required" style="width: 120px !important;">运输终点</label>
<label class="layui-form-label" style="width: 120px !important;">运输终点</label>
<div class="layui-input-inline" style="display: flex;">
<input class="layui-input" name="carEnd" id="carEnd" autocomplete="off"
lay-verify="required" maxlength="50" lay-affix="clear" style="width: 150px;">
maxlength="50" lay-affix="clear" style="width: 150px;">
</div>
</div>
</div>

View File

@ -77,7 +77,7 @@
</form>
<div class="layui-upload" style="padding: 0 39px;">
<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;width: auto;border: none;">
<p>计划附件上传<span class="required">*</span></p>
<p>计划附件上传</p>
<div class="layui-upload-list uploader-list" style="overflow: auto;" id="uploader-list"></div>
<div id="test2" style="margin-left: 10px;">
<img src="../../../images/add.png">

View File

@ -77,7 +77,7 @@
</form>
<div class="layui-upload" style="padding: 0 39px;">
<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;width: auto;border: none;">
<p>计划附件上传<span class="required">*</span></p>
<p>计划附件上传</p>
<div class="layui-upload-list uploader-list" style="overflow: auto;" id="uploader-list"></div>
<div id="test2" style="margin-left: 10px;">
<img src="../../../images/add.png">