parent
e8b92f6a3a
commit
d038c43d13
|
|
@ -0,0 +1,248 @@
|
|||
let objParam;
|
||||
let form, table, tableIns, layer, element;
|
||||
let pageNum = 1;
|
||||
|
||||
function setParams(params) {
|
||||
objParam = JSON.parse(params);
|
||||
layui.use(["form", "table", 'layer', 'element'], function () {
|
||||
form = layui.form;
|
||||
table = layui.table;
|
||||
element = layui.element;
|
||||
layer = layui.layer;
|
||||
initTable();
|
||||
});
|
||||
}
|
||||
|
||||
// 查询/重置
|
||||
function queryTable(type) {
|
||||
if (type === 1) {
|
||||
let code = $('#code').val();
|
||||
let flag = checkValue(code);
|
||||
if (flag) {
|
||||
$('#code').val('');
|
||||
return layer.msg('需求计划编号查询包含特殊字符,请重新输入', { icon: 2 });
|
||||
}
|
||||
reloadTable(1);
|
||||
} else if (type === 2) {
|
||||
$('#code').val('');
|
||||
$('#status').val('');
|
||||
layui.form.render();
|
||||
reloadTable(1);
|
||||
}
|
||||
}
|
||||
|
||||
// 刷新页面数据
|
||||
function reloadData() {
|
||||
reloadTable(pageNum);
|
||||
}
|
||||
|
||||
// 重载表格
|
||||
function reloadTable(pageNum) {
|
||||
table.reload("currentTableId", {
|
||||
page: {
|
||||
curr: pageNum ? pageNum : 1,
|
||||
},
|
||||
where: {
|
||||
encryptedData: JSON.stringify({
|
||||
'code': $('#code').val(),
|
||||
'status': $('#status').val(),
|
||||
'proId': objParam.proId
|
||||
}),
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
tableIns = table.render({
|
||||
elem: "#currentTableId",
|
||||
id: 'currentTableId',
|
||||
headers: {
|
||||
authorization: sessionStorage.getItem("gz-token"),
|
||||
},
|
||||
height: "full-250",
|
||||
url: dataUrl + "backstage/carDriver/getRePlan",
|
||||
where: {
|
||||
encryptedData: JSON.stringify({
|
||||
'id': objParam.id
|
||||
}),
|
||||
},
|
||||
request: {
|
||||
pageName: 'pageNum',
|
||||
limitName: 'pageSize'
|
||||
},
|
||||
parseData: function (res) { // res 即为原始返回的数据
|
||||
if (res.code === 401) {
|
||||
closeWindowOpen();
|
||||
}
|
||||
return {
|
||||
"code": 0, // 解析接口状态
|
||||
"msg": '获取成功', // 解析提示文本
|
||||
"count": res.total, // 解析数据长度
|
||||
"data": res.list // 解析数据列表
|
||||
};
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
width: '5%',
|
||||
title: "序号",
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
return d.LAY_NUM;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "typeName",
|
||||
width: '19%',
|
||||
title: "计划类型",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
},
|
||||
{
|
||||
field: "code",
|
||||
width: '19%',
|
||||
title: "需求计划<br>编号",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
templet: function (d) {
|
||||
return "<a style='color:#409eff;' onclick='viewPlanDetail(" + JSON.stringify(d) + ")'>" + d.code + "</a>";
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "userName",
|
||||
width: '19%',
|
||||
title: "申请人",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
},
|
||||
{
|
||||
field: "appLyTime",
|
||||
title: "申请时间",
|
||||
width: '19%',
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
},
|
||||
{
|
||||
field: "remark",
|
||||
title: "备注",
|
||||
width: '19%',
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
templet: function (d) {
|
||||
if (d.remark) {
|
||||
if (d.remark.length > 60) {
|
||||
return '<span title="' + d.remark + '">' + d.remark.substring(0, 60) + '...</span>'
|
||||
} else {
|
||||
return '<span title="' + d.remark + '">' + d.remark + '</span>'
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
limits: [10, 15, 20, 25, 50, 100],
|
||||
limit: 10,
|
||||
page: true,
|
||||
done: function (res, curr, count) {
|
||||
pageNum = tableIns.config.page.curr;
|
||||
table.resize("currentTableId");
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 导出
|
||||
function exportExcel() {
|
||||
let params = {
|
||||
'planCode': $('#planCode').val(),
|
||||
'status': $('#status').val(),
|
||||
'proId': objParam.proId
|
||||
}
|
||||
let url = dataUrl + "backstage/purchase/exportDetails";
|
||||
exportExcelUtil(url, '需求计划详情', JSON.stringify(params));
|
||||
}
|
||||
|
||||
// 详情
|
||||
function dispatchCarDetail(obj, type) {
|
||||
let flag = isExistData(type, obj);
|
||||
if (!flag && type === 1) {
|
||||
return layer.msg('暂无派车批次数据', { icon: 7 });
|
||||
} else if (!flag && type === 2) {
|
||||
return layer.msg('暂无待审核批次数据', { icon: 7 });
|
||||
}
|
||||
let title = '详情';
|
||||
if (type === 2) {
|
||||
title = '审核';
|
||||
}
|
||||
obj.type = type;
|
||||
openIframeByParamObj2("dispatchCarDetail", title, "../car_demand_plan/child/dispatch_car_detail.html", "92%", "95%", obj, 2);
|
||||
}
|
||||
|
||||
// 修改记录
|
||||
function editRecord(obj) {
|
||||
let flag = isExistData(3, obj);
|
||||
if (!flag) {
|
||||
return layer.msg('暂无派车批次数据', { icon: 7 });
|
||||
}
|
||||
openIframeByParamObj2("editRecord", "修改记录", "../car_demand_plan/child/dispatch_car_edit_record_list.html", "92%", "95%", obj);
|
||||
}
|
||||
|
||||
// 派车分配
|
||||
function dispatchCarAllocation(obj) {
|
||||
openIframeByParamObj("dispatchCarAllocation", "派车分配", "./dispatch_car_allocation_form.html", "92%", "95%", obj);
|
||||
}
|
||||
|
||||
// 刷新页面数据
|
||||
function refreshAllData() {
|
||||
getProStatisticsDetails();
|
||||
reloadData();
|
||||
}
|
||||
|
||||
// 需求计划详情
|
||||
function viewPlanDetail(obj) {
|
||||
openIframeByParamObj2("viewPlanDetail", "需求计划详情", "../car_demand_plan/child/apply_plan_detail.html", "92%", "95%", obj);
|
||||
}
|
||||
|
||||
// 分配错误修改
|
||||
function allocationError() {
|
||||
openIframeByParamObj("allocationError", "分配错误修改", "./allocation_error_form.html", "50%", "65%", objParam);
|
||||
}
|
||||
|
||||
// 校验是否存在派车批次数据、待审核批次数据
|
||||
function isExistData(type, obj) {
|
||||
let flag = true;
|
||||
let params = {
|
||||
encryptedData: JSON.stringify({
|
||||
'planId': obj.id,
|
||||
})
|
||||
};
|
||||
let url = ''
|
||||
if (type === 1 || type === 3) {
|
||||
url = dataUrl + 'backstage/supDispatchCar/getAllOutList'; // 详情-派车批次
|
||||
} else if (type === 2) { // 审核-待审核批次
|
||||
url = dataUrl + 'backstage/dispatchCar/getAuditListNew';
|
||||
}
|
||||
ajaxRequest(url, "POST", params, false, function () {
|
||||
}, function (result) {
|
||||
if (result.code === 200) {
|
||||
if (result.data.length === 0 && (type === 1 || type === 3)) {
|
||||
flag = false;
|
||||
} else if (result.data.length === 0 && type === 2) {
|
||||
flag = false;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
}, function (xhr, status, error) {
|
||||
errorFn(xhr, status, error)
|
||||
}, null);
|
||||
return flag;
|
||||
}
|
||||
|
|
@ -95,7 +95,7 @@ function initTable() {
|
|||
},
|
||||
{
|
||||
field: "name",
|
||||
width: '12%',
|
||||
width: '10%',
|
||||
title: "姓名",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
|
|
@ -103,7 +103,7 @@ function initTable() {
|
|||
},
|
||||
{
|
||||
field: "phone",
|
||||
width: '12%',
|
||||
width: '10%',
|
||||
title: "联系方式",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
|
|
@ -111,7 +111,7 @@ function initTable() {
|
|||
},
|
||||
{
|
||||
field: "sfzNum",
|
||||
width: '12%',
|
||||
width: '10%',
|
||||
title: "身份证",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
|
|
@ -122,7 +122,7 @@ function initTable() {
|
|||
},
|
||||
{
|
||||
field: "jszNum",
|
||||
width: '12%',
|
||||
width: '10%',
|
||||
title: "驾驶证",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
|
|
@ -133,7 +133,7 @@ function initTable() {
|
|||
},
|
||||
{
|
||||
field: "otherNum",
|
||||
width: '12%',
|
||||
width: '10%',
|
||||
title: "其他操作证",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
|
|
@ -150,6 +150,19 @@ function initTable() {
|
|||
align: "center",
|
||||
sort:true,
|
||||
},
|
||||
{
|
||||
field: "num",
|
||||
width: '10%',
|
||||
title: "关联计划",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
templet: function (d) {
|
||||
let html = "";
|
||||
html += "<a style='color: #409eff;font-weight: bold;' onclick='reDetail(" + JSON.stringify(d) + ",2)'>"+d.num+"</a>";
|
||||
return html;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: '13%',
|
||||
|
|
@ -175,6 +188,11 @@ function initTable() {
|
|||
});
|
||||
}
|
||||
|
||||
// 关联详情
|
||||
function reDetail(obj) {
|
||||
openIframeByParamObj("reDetail", "关联详情", "./child/driver_re_detail.html", "92%", "95%", obj, 1);
|
||||
}
|
||||
|
||||
// 导出
|
||||
function exportExcel() {
|
||||
let params = {
|
||||
|
|
|
|||
|
|
@ -260,7 +260,9 @@ function initTable() {
|
|||
html += "<div class='splitLine'>|</div><a onclick='dispatchCarAllocation(" + JSON.stringify(d) + ")'>派车分配</a>";
|
||||
}
|
||||
if (d.statusName !== '待派车') {
|
||||
html += "<div class='splitLine'>|</div><a onclick='dispatchCarDetail(" + JSON.stringify(d) + ",2)'>审核</a>";
|
||||
if (d.statusName!=='已派车'){
|
||||
html += "<div class='splitLine'>|</div><a onclick='dispatchCarDetail(" + JSON.stringify(d) + ",2)'>审核</a>";
|
||||
}
|
||||
html += "<div class='splitLine'>|</div><a onclick='editRecord(" + JSON.stringify(d) + ")'>修改记录</a>";
|
||||
}
|
||||
return html;
|
||||
|
|
@ -348,7 +350,7 @@ function isExistData(type, obj) {
|
|||
if (type === 1 || type === 3) {
|
||||
url = dataUrl + 'backstage/supDispatchCar/getAllOutList'; // 详情-派车批次
|
||||
} else if (type === 2) { // 审核-待审核批次
|
||||
url = dataUrl + 'backstage/dispatchCar/getAuditList';
|
||||
url = dataUrl + 'backstage/dispatchCar/getAuditListNew';
|
||||
}
|
||||
ajaxRequest(url, "POST", params, false, function () {
|
||||
}, function (result) {
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ let formNum = 1;
|
|||
let carType;
|
||||
function setParams(obj) {
|
||||
objParam = JSON.parse(obj);
|
||||
$('#titleName').html(objParam.proName);;
|
||||
$('#code').html(objParam.code);;
|
||||
$('#titleName').html(objParam.proName);
|
||||
$('#code').html(objParam.code);
|
||||
layui.use(['form', 'layer', 'laydate', 'upload', 'table'], function () {
|
||||
form = layui.form;
|
||||
layer = layui.layer;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>关联详情</title>
|
||||
<link rel="stylesheet" href="../../../lib/layui-v2.9.18/layui/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="../../../css/font.css" media="all">
|
||||
<link rel="stylesheet" href="../../../css/public.css" media="all">
|
||||
</head>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<body id="body">
|
||||
<div class="layuimini-main">
|
||||
<table class="layui-hide" id="currentTableId" lay-filter="currentTableId2"></table>
|
||||
</div>
|
||||
</body>
|
||||
<script src="../../../lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
|
||||
<script src="../../../js/aes.js" charset="utf-8"></script>
|
||||
<script src="../../../js/public.js" charset="utf-8"></script>
|
||||
<script src="../../../js/Print.js" charset="utf-8"></script>
|
||||
<script src="../../../lib/layui-v2.9.18/layui/layui.js" charset="utf-8"></script>
|
||||
<script src="../../../js/openIframe.js" charset="utf-8"></script>
|
||||
<script src="../../../js/car_basic/child/driver_re_detail.js" charset="utf-8"></script>
|
||||
|
||||
</html>
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
<label class="layui-form-label required" style="width: 110px !important;">合同名称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input" name="name" id="name" autocomplete="off" lay-verify="required"
|
||||
maxlength="30" lay-affix="clear">
|
||||
maxlength="60" lay-affix="clear">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue