' +
'
' + operData + '' +
@@ -577,9 +669,31 @@ function withdrawData(data) {
})
}
+// 查看附件
+function viewFileDetail(obj, type) {
+ let title = '行驶证/挂靠协议驾驶证/身份证/导航图'
+ if (type === 1) {
+ title = '行驶证/挂靠协议驾驶证/身份证/导航图'
+ } else if (type === 2) {
+ title = '操作证/身份证/导航图'
+ }
+ obj.type = type;
+ openIframeByParamObj("viewFileDetail", title, '../../car_demand_plan/child/view_file_detail.html', "92%", "95%", obj);
+}
+
+// 需求计划详情
+function viewPlanDetail(obj) {
+ obj.id = obj.planId;
+ obj.code = obj.planCode;
+ let content = '../car_demand_plan/child/apply_plan_detail.html';
+ if (obj.code.indexOf('spec-') > -1) {
+ content = '../car_demand_plan/child/emerg_internal_car_detail.html';
+ }
+ openIframeByParamObj2("viewPlanDetail", "车辆需求计划", content, "92%", "95%", obj);
+}
+
// 需求计划申请审核
function check() {
- objParam.checkType = '2'; // 需求计划申请审核
objParam.token = token;
openIframeByParamObj("check", "审核", "./car_audit_form.html", "40%", "50%", objParam, 1);
}
diff --git a/js/car_application_audit/car_audit_form.js b/js/car_application_audit/car_audit_form.js
index 8708921..3780faf 100644
--- a/js/car_application_audit/car_audit_form.js
+++ b/js/car_application_audit/car_audit_form.js
@@ -13,13 +13,13 @@ function setParams(params) {
submitApply(data);
});
form.on('radio(auditStatus)', function (data) {
- if (data.value === '2') { // 通过
- $('#remark').removeAttr('lay-verify');
- $('#remark').val("申请通过"); // textarea 设置内容用 val()
+ if (data.value === '1') { // 通过
+ $('#auditReason').removeAttr('lay-verify');
+ $('#auditReason').val("申请通过"); // textarea 设置内容用 val()
$('#auditRemarksLabel').removeClass('required');
- } else if (data.value === '3') { // 不通过
- $('#remark').attr('lay-verify', 'required');
- $('#remark').val("申请驳回"); // textarea 设置内容用 val()
+ } else if (data.value === '2') { // 不通过
+ $('#auditReason').attr('lay-verify', 'required');
+ $('#auditReason').val("申请驳回"); // textarea 设置内容用 val()
$('#auditRemarksLabel').addClass('required');
}
});
@@ -38,25 +38,13 @@ function submitApply(data) {
shade: 0.01,
time: '0'
});
-
- let url = '';
- if (objParam.checkType === '1') { // 派车录入审核
- url = dataUrl + 'backstage/dispatchCar/dispatchAudit';
- // 出库单ID、合同ID
- data.field.id = idParam;
- data.field.contractId = objParam.contractId;
- data.field.outId = objParam.outId;
- data.field.planId = objParam.planId;
- data.field.supId = objParam.supId;
- data.field.status = data.field.status === '2' ? '1' : '2';
- } else if (objParam.checkType === '2') { // 需求计划审核
- url = dataUrl + 'backstage/carPlanAudit/auditInfo';
- data.field.id = idParam;
- }
+ let url = dataUrl + 'backstage/carBalance/sltAudit';
+ data.field.id = idParam;
+ data.field.auditStatus = data.field.status;
let params = {
encryptedData: JSON.stringify(data.field)
};
- ajaxRequest(url, "POST", params, true, function () {
+ ajaxRequest(url, "GET", params, true, function () {
$('.save').addClass("layui-btn-disabled").attr("disabled", true);
$('.cancel').addClass("layui-btn-disabled").attr("disabled", true);
}, function (result) {
@@ -64,18 +52,28 @@ function submitApply(data) {
$('.save').removeClass("layui-btn-disabled").attr("disabled", false);
$('.cancel').removeClass("layui-btn-disabled").attr("disabled", false);
if (result.code === 200) {
- top.layer.msg(result.msg, {icon: 1});
- if (objParam.token) {
- // 如果没有 token,直接关闭整个窗口
- window.parent.open('', '_self');
- window.parent.close();
- return;
- } else {
- closePage(1);
+ // top.layer.msg(result.data, {icon: 1});
+ // if (objParam.token) {
+ // // 如果没有 token,直接关闭整个窗口
+ // window.parent.open('', '_self');
+ // window.parent.close();
+ // return;
+ // } else {
+ // closePage(1);
+ // }
+
+ const topParent = window.top;
+ // 2. 调用最外层父页面的刷新表格函数
+ if (topParent.queryTable) {
+ topParent.queryTable(1); // 执行最外层的刷新
}
+ // 3. 关闭所有layui弹窗(包括所有iframe层)
+ topParent.layer.closeAll();
+ // 4. 提示成功
+ topParent.layer.msg(result.data, {icon: 1});
} else {
- layer.msg(result.msg, {icon: 2});
+ layer.msg(result.data, {icon: 2});
}
}, function (xhr, status, error) {
layer.close(loadingMsg); // 关闭提示层
@@ -89,14 +87,5 @@ function submitApply(data) {
// 关闭页面
function closePage(type) {
let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
-
-
- if (type == 1) {
- if (objParam.checkType === '1') { // 派车录入审核
- window.parent.reloadAuditData();
- } else if (objParam.checkType === '2') { // 需求计划审核
- window.parent.closePage();
- }
- }
parent.layer.close(index); // 再执行关闭
}
diff --git a/js/car_application_audit/car_audit_list.js b/js/car_application_audit/car_audit_list.js
index c20968a..6f8d7ac 100644
--- a/js/car_application_audit/car_audit_list.js
+++ b/js/car_application_audit/car_audit_list.js
@@ -102,6 +102,30 @@ function initTable() {
align: "center",
sort:true,
},
+ {
+ field: "carName",
+ width: '14%',
+ title: "车辆类型",
+ unresize: true,
+ align: "center",
+ sort:true,
+ templet: function (d) {
+ var type = d.type;
+ if (type == 1) {
+ return '车辆';
+ } else if (type == 2) {
+ return '吊车';
+ }
+ },
+ },
+ {
+ field: "planNum",
+ width: '10%',
+ title: "车辆数量",
+ unresize: true,
+ align: "center",
+ sort:true,
+ },
{
field: "ygMoney",
width: '14%',
@@ -127,7 +151,7 @@ function initTable() {
sort:true,
align: "center",
templet: function (d) {
- return getCheckStatus(d.status);
+ return getCheckStatus(d.auditType ,d.status);
},
},
{
@@ -173,20 +197,22 @@ function initTable() {
unresize: true,
templet: function (d) {
let html = "";
- let content = getCheckStatus(d.status);
- if(!(content.indexOf('驳回') > -1)){
+ let status = d.status;
+ if(status == -1){
html += "
提交|
"
}
-
- if(!(content.indexOf('驳回') > -1)){
+ if(status == -1 || status == 2){
html += "
修改|
"
- }
-
+ html += "
|
删除";
+ }
html += "
详情";
-
- if (!(content.indexOf('驳回') > -1 || content.indexOf('已撤回') > -1 || content.indexOf('通过') > -1)) {
+ if ( status == 1 ) {
html += "
|
审核";
}
+
+ if(status == 0){
+ html += "
|
审核记录";
+ }
return html;
},
},
@@ -213,28 +239,30 @@ function exportExcel() {
}
//审核状态
-function getCheckStatus(status) {
- if(status === 0){
+function getCheckStatus(auditType,status) {
+
+ if(status == 0){
return "
●全部通过";
}
- /*var company = "";
- if (statusType === 1) {
- return "
●审核通过";
- } else if (statusType === 2) {
- company = "分公司";
- } else if (statusType === 3) {
- company = "项目管理中心";
- } else if (statusType === 4) {
- company = "机具公司";
- }*/
- if (status === 1) {
- return "
●待审核";
- } else if (status === 2) {
+ let name = '分包商';
+ if(auditType == 1){
+ name = "项目部"
+ }else if(auditType == 2){
+ name = "防线部门"
+ }else if(auditType == 3){
+ name = "分公司"
+ }else if(auditType == 4){
+ name = "经营部"
+ }else if(auditType == 5){
+ name = "总公司"
+ }
+ if (status == 1) {
+ return "
●"+ name+"待审核";
+ } else if (status == 2) {
return "
●审核驳回";
- } else if (status === -3) {
+ } else if (status == -1) {
return "
●待提交";
}
- return "
●待提交";
}
// 详情
@@ -248,35 +276,68 @@ function checkDetail(obj) {
openIframeByParamObj("car_check_detail", "审核", "./child/car_audit_detail.html", "92%", "95%", obj,1);
}
+
+function checkAuditDetail(obj) {
+ // obj.checkType = 2;
+ openIframeByParamObj("car_check_detail", "审核", "./child/car_audit_detail.html", "92%", "95%", obj,1);
+}
+
+
//提交
function checkSubmit(obj) {
layer.confirm("确定提交此条数据吗?", { 'title': '操作提示', move: false }, function () {
let loadingMsg = layer.msg('数据提交中,请稍候...', { icon: 16, scrollbar: false, time: 0 });
- let url = dataUrl + "backstage/carType/deleteType"
- let obj = { 'id': id }
+ let url = dataUrl + "backstage/carBalance/sltSubmitAudit"
+ let data = { 'id': obj.id }
let params = {
- encryptedData: JSON.stringify(obj)
+ encryptedData: JSON.stringify(data)
}
- ajaxRequest(url, "POST", params, true, function () {
+ ajaxRequest(url, "GET", params, true, function () {
}, function (result) {
layer.close(loadingMsg); // 关闭提示层
if (result.code === 200) {
- layer.msg(result.msg, { icon: 1 })
- if (type === 1) {
- fitTypeTree.partialRefreshDel($div); // 删除节点
- } else if (type === 2) {
- dtreeData = getDTreeData();
- dtree.reload("fitTypeTree", {
- data: dtreeData
- });
- }
+ layer.msg(result.data, { icon: 1 })
queryTable(1);
} else {
- layer.msg(result.msg, { icon: 2 })
+ layer.msg(result.data, { icon: 2 })
}
}, function (xhr) {
layer.close(loadingMsg); // 关闭提示层
- error(xhr)
+ });
+ })
+}
+
+// 删除
+function checkDelete(obj) {
+ layer.confirm("确定删除此条数据吗?", { 'title': '操作提示', move: false }, function () {
+ let loadingMsg = layer.msg('数据提交中,请稍候...', { icon: 16, scrollbar: false, time: 0 });
+ let url = dataUrl + "backstage/carBalance/delBalanceData"
+ let postData = { 'id': obj.id };
+
+ $.ajax({
+ url: url,
+ headers: {
+ "authorization": sessionStorage.getItem("gz-token"),
+ },
+ type: "POST",
+ contentType: "application/json;charset=utf-8", // 指定Body为JSON格式
+ data: JSON.stringify(postData), // 直接传JSON字符串,不加密
+ dataType: "json",
+ success: function (result) {
+ layer.close(loadingMsg);
+ if (result.code === 200) { // 假设后端返回code=200代表成功
+ layer.msg('删除成功!', { icon: 1 });
+ queryTable(1); // 刷新表格
+ layer.closeAll(); // 关闭所有弹窗
+ } else {
+ layer.msg('删除失败:' + (result.msg || '未知错误'), { icon: 2 });
+ }
+ },
+ error: function (xhr, status, error) {
+ layer.close(loadingMsg);
+ layer.msg('删除失败,服务异常!', { icon: 2 });
+ console.error('删除请求错误:', error); // 调试用
+ }
});
})
}
diff --git a/js/car_application_audit/car_audit_update.js b/js/car_application_audit/car_audit_update.js
index 5cb316f..c1c79d3 100644
--- a/js/car_application_audit/car_audit_update.js
+++ b/js/car_application_audit/car_audit_update.js
@@ -74,6 +74,7 @@ function getBalanceDataDetails() {
//基本信息回显
let dataObj = result.data;
+ $('#supId').val(dataObj.supId);
$('#supName').val(dataObj.supName);
$('#fkTime').val(util.toDateString(dataObj.fkTime, 'yyyy-MM-dd'));
$('#money').val(dataObj.money);
@@ -409,7 +410,7 @@ function submitApply(data) {
let obj = {
id: item.id || '',
planId: item.planId || item.id,
- supId: objParam.supId,
+ supId: item.supId,
money: item.money,
type: item.type || '1',
proId: item.proId || '',
@@ -434,7 +435,7 @@ function submitApply(data) {
exeGls: carActual?.exeGls || item.exeGls || '',
inMoney: carActual?.inMoney || craneActual?.inMoney || '',
exeDay: craneActual?.exeDay || item.exeDay || '',
- outDetailId: item.id || '',
+ outDetailId: item.outDetailId || '',
modelId: item.modelId || '',
ton: item.ton || 0
};
@@ -697,12 +698,12 @@ function getEditedActualValues() {
// 修复列索引:实际公里数输入框在td:eq(9),预估公里数在td:eq(8)
const actualGls = $tr.find('.actual-gls').val().trim() || $tr.find('td:eq(8)').text().trim() || '0.00';
- const actualMoney = $tr.find('.actual-money').val()?.trim() || '0.00';
+ // const actualMoney = $tr.find('.actual-money').val()?.trim() || '0.00';
actualValues.carActualList.push({
outDetailId: itemId,
exeGls: formatToTwoDecimals(actualGls),
- inMoney: formatToTwoDecimals(actualMoney)
+ inMoney: 0
});
});
diff --git a/js/car_settlement/child/payment_form.js b/js/car_settlement/child/payment_form.js
index f2845e7..f2408df 100644
--- a/js/car_settlement/child/payment_form.js
+++ b/js/car_settlement/child/payment_form.js
@@ -131,7 +131,7 @@ function submitApply(data) {
};
planList.push(obj);
})
-
+
const actualValues = getEditedActualValues();
$.each(allDataList, function (index, item) {
@@ -146,7 +146,7 @@ function submitApply(data) {
money: item.cost,
outId: item.outId,
exeGls: carActual?.exeGls || '',
- inMoney: carActual?.inMoney || craneActual?.inMoney || '',
+ inMoney: carActual?.inMoney || craneActual?.inMoney || '',
exeDay: craneActual?.exeDay || '',
outDetailId:item.id,
modelId:item.modelId,
@@ -156,9 +156,9 @@ function submitApply(data) {
})
data.field.planList = planList;
data.field.detailsList = detailsList;
-
-
+
+
let formData = new FormData();
//遍历最终文件集合
for (let i = 0; i < fileList.length; i++) {
@@ -166,7 +166,7 @@ function submitApply(data) {
}
formData.append('params', JSON.stringify(data.field));
console.log(jjDataArr);
-
+
console.log(data.field);
let loadingMsg = layer.msg('正在提交保存,请稍等...', { icon: 16, shade: 0.01, time: '0' });
let url = dataUrl + 'backstage/carBalance/addBalanceData';
@@ -263,10 +263,10 @@ function getPayCarDetails(id) {
imgNum += item.carImage.filter(item => { return item.type !== '6' }).length;
imgNum += item.driverUserImage.filter(item => { return item.type !== '6' }).length;
imgNum += item.fileList.length;
-
+
const actualGls = formatToTwoDecimals(item.gls) || 0.00; // 实际公里数初始=预估公里数
// const actualMoney = formatToTwoDecimals(0); // 实际金额初始=预估金额
-
+
html += "
" +
"| " + item.type + " | " +
"" + item.name + " | " +
@@ -277,16 +277,16 @@ function getPayCarDetails(id) {
"" + item.startAddress + " | " +
"" + item.endAddress + " | " +
"" + item.gls + " | " +
-
- " | " +
-
+
"" + item.glsPrice + " | " +
" ¥ " + (item.glsMoney ? item.glsMoney : 0) + " | " +
-
- // " | " +
-
+
"" + imgNum + "查看附件>> | " +
"" + item.planCode + " | " +
"
";
@@ -311,10 +311,10 @@ function getPayCarDetails(id) {
imgNum += item.driverUserImage.filter(item => { return item.type === '2' || item.type === '3' }).length;
imgNum += item.operaImage.filter(item => { return item.type === '2' || item.type === '3' || item.type === '6' }).length;
imgNum += item.fileList.length;
-
+
const actualPlanDay = item.planDay|| 0;
const actualDcMoney = formatToTwoDecimals(0);
-
+
html += '
' +
'| ' + item.type + ' | ' +
'' + item.name + ' | ' +
@@ -326,10 +326,10 @@ function getPayCarDetails(id) {
"' style='width: 100%; padding: 2px; border: 1px solid #ddd;' data-id='" + item.id + "'>" +
'' + setZlPrice(item) + ' | ' +
' ¥ ' + item.dcMoney + ' | ' +
-
- " | " +
-
+
"" + imgNum + "查看附件>> | " +
"" + item.planCode + " | " +
'
';
@@ -403,7 +403,7 @@ function getEditedActualValues() {
actualValues.carActualList.push({
outDetailId: itemId,
exeGls: actualGls,
- inMoney: actualMoney
+ inMoney: 0
});
});
@@ -464,4 +464,4 @@ function closePage(type) {
}
parent.layer.close(index); // 再执行关闭
-}
\ No newline at end of file
+}
diff --git a/page/car_application_audit/child/car_audit_detail.html b/page/car_application_audit/child/car_audit_detail.html
index 29a5c2b..5ad8a83 100644
--- a/page/car_application_audit/child/car_audit_detail.html
+++ b/page/car_application_audit/child/car_audit_detail.html
@@ -30,6 +30,7 @@