提交 371591a9 编写于 作者: doc_wei's avatar doc_wei

车辆加油管理托管到表单布局

上级 f37020ae
// 车辆加油
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'fileUpload', 'tagEditor', 'laydate'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
laydate = layui.laydate;
skyeyeEnclosure.init('enclosureUpload');
// 获取当前登录员工信息
systemCommonUtil.getSysCurrentLoginUserMation(function (data) {
var userName = data.bean.userName;
$("#oilTitle").html("车辆加油登记单-" + userName + "-" + (new Date()).getTime()) + Math.floor(Math.random() * 100);
});
// 查询所有的车牌号用于下拉选择框
adminAssistantUtil.queryAllVehicleList(function (data) {
$("#licensePlate").html(getDataUseHandlebars(getFileContent('tpl/template/select-option-must.tpl'), data));
form.render('select');
});
// 加油日期
laydate.render({elem: '#oilTime', type: 'date', trigger: 'click'});
matchingLanguage();
form.render();
form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem)) {
var params = {
oilTitle: $("#oilTitle").html(),
oilTime: $("#oilTime").val(),
oilCapacity: $("#oilCapacity").val(),
oilPrice: $("#oilPrice").val(),
roomAddDesc: $("#roomAddDesc").val(),
vehicleId: $("#licensePlate").val(),
enclosureInfo: skyeyeEnclosure.getEnclosureIdsByBoxId('enclosureUpload')
};
AjaxPostUtil.request({url: flowableBasePath + "oiling002", params: params, type: 'json', callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
}
return false;
});
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
});
});
\ No newline at end of file
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$;
showGrid({
id: "showForm",
url: flowableBasePath + "oiling006",
params: {rowId:parent.rowId},
pagination: false,
template: getFileContent('tpl/vehicleManageOiling/vehicleManageOilingDetailsTemplate.tpl'),
ajaxSendLoadBefore: function(hdb) {
},
ajaxSendAfter:function (json) {
// 附件回显
skyeyeEnclosure.showDetails({"enclosureUploadBtn": json.bean.enclosureInfo});
matchingLanguage();
}
});
});
});
\ No newline at end of file
// 车辆加油
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'fileUpload', 'tagEditor', 'laydate'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
laydate = layui.laydate;
showGrid({
id: "showForm",
url: flowableBasePath + "oiling004",
params: {rowId:parent.rowId},
pagination: false,
template: getFileContent('tpl/vehicleManageOiling/vehicleManageOilingEditTemplate.tpl'),
ajaxSendLoadBefore: function(hdb) {
},
ajaxSendAfter:function (json) {
// 加油日期
laydate.render({elem: '#oilTime', type: 'date', trigger: 'click'});
// 附件回显
skyeyeEnclosure.initTypeISData({'enclosureUpload': json.bean.enclosureInfo});
matchingLanguage();
form.render();
form.on('submit(formEditBean)', function (data) {
if (winui.verifyForm(data.elem)) {
var params = {
rowId: parent.rowId,
oilTime: $("#oilTime").val(),
oilCapacity: $("#oilCapacity").val(),
oilPrice: $("#oilPrice").val(),
roomAddDesc: $("#roomAddDesc").val(),
enclosureInfo: skyeyeEnclosure.getEnclosureIdsByBoxId('enclosureUpload')
};
AjaxPostUtil.request({url: flowableBasePath + "oiling005", params: params, type: 'json', callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
}
return false;
});
}
});
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
});
});
\ No newline at end of file
var rowId = "";
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form', 'laydate'], function (exports) {
winui.renderColor();
var $ = layui.$,
form = layui.form,
table = layui.table,
laydate = layui.laydate;
// 新增车辆加油
authBtn('1597469406320');
// 查询所有的车牌号用于下拉选择框
adminAssistantUtil.queryAllVehicleList(function (data) {
$("#oilPlate").html(getDataUseHandlebars(getFileContent('tpl/template/select-option.tpl'), data));
form.render('select');
});
laydate.render({elem: '#oilTime', type: 'datetime', range: true});
showOilingList();
// 加油管理开始
function showOilingList(){
table.render({
id: 'oilingTable',
elem: '#oilingTable',
method: 'post',
url: flowableBasePath + "oiling001",
where: getTableParams(),
even: true,
page: true,
limits: getLimits(),
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'oilTitle', title: '主题', align: 'left', width: 300, templet: function (d) {
return '<a lay-event="oilingdetails" class="notice-title-click">' + d.oilTitle + '</a>';
}},
{ field: 'licensePlate', title: '车牌号', align: 'center', width: 120},
{ field: 'oilTime', title: '加油日期', align: 'center', width: 170 },
{ field: 'oilCapacity', title: '加油容量(升)', width: 120},
{ field: 'oilPrice', title: '加油金额(元)', width: 150 },
{ field: 'userName', title: '申请人', align: 'center', width: 100 },
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 150, toolbar: '#oilingtableBar'}
]],
done: function(json) {
matchingLanguage();
}
});
}
table.on('tool(oilingTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'oilingdetails') { //详情
oilingdetails(data);
} else if (layEvent === 'oilingdelet'){ //删除
oilingdelet(data);
} else if (layEvent === 'oilingedit'){ //编辑
oilingedit(data);
}
});
form.render();
// 加油信息详情
function oilingdetails(data) {
rowId = data.id;
_openNewWindows({
url: "../../tpl/vehicleManageOiling/vehicleManageOilingDetails.html",
title: systemLanguage["com.skyeye.detailsPageTitle"][languageType],
pageId: "vehicleManageOilingDetails",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
}});
}
// 删除加油信息
function oilingdelet(data) {
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function (index) {
layer.close(index);
AjaxPostUtil.request({url: flowableBasePath + "oiling003", params: {rowId: data.id}, type: 'json', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadOilingTable();
}});
});
}
// 登记加油信息
$("body").on("click", "#addOilingBean", function() {
_openNewWindows({
url: "../../tpl/vehicleManageOiling/vehicleManageOilingAdd.html",
title: "车辆加油登记单",
pageId: "vehicleManageOilingAdd",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadOilingTable();
}});
});
// 编辑加油信息
function oilingedit(data) {
rowId = data.id;
_openNewWindows({
url: "../../tpl/vehicleManageOiling/vehicleManageOilingEdit.html",
title: "编辑车辆加油信息",
pageId: "vehicleManageOilingEdit",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadOilingTable();
}});
}
// 搜索表单
$("body").on("click", "#oilingformSearch", function() {
table.reloadData("oilingTable", {page: {curr: 1}, where: getTableParams()});
});
$("body").on("click", "#reloadOilingTable", function() {
loadOilingTable();
});
function loadOilingTable(){
table.reloadData("oilingTable", {where: getTableParams()});
}
function getTableParams() {
var startTime = "", endTime = "";
if (!isNull($("#oilTime").val())) {
startTime = $("#oilTime").val().split(' - ')[0].trim();
endTime = $("#oilTime").val().split(' - ')[1].trim();
}
return {
oilTitle: $("#oilTitle").val(),
oilPlate: $("#oilPlate").val(),
startTime: startTime,
endTime: endTime
};
}
exports('vehicleManageOilingList', {});
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="padding:20px; margin:0 auto;">
<form class="layui-form" action="" id="showForm">
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">标题<i class="red">*</i></label>
<div class="layui-input-block ver-center">
<span id="oilTitle"></span>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">车牌号<i class="red">*</i></label>
<div class="layui-input-block">
<select id="licensePlate" name="licensePlate" lay-filter="licensePlate" lay-search="" win-verify="required">
</select>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">加油日期<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="oilTime" name="oilTime" win-verify="required" placeholder="请输入加油日期" class="layui-input"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">加油容量<i class="red">*</i></label>
<div class="layui-input-block">
<input type="number" id="oilCapacity" name="oilCapacity" win-verify="required|double" placeholder="请输入加油容量(升)" class="layui-input"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">加油金额<i class="red">*</i></label>
<div class="layui-input-block">
<input type="number" id="oilPrice" name="oilPrice" win-verify="required|double" placeholder="请输入加油金额(元)" class="layui-input"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">备注:</label>
<div class="layui-input-block">
<textarea id="roomAddDesc" name="roomAddDesc" placeholder="请输入备注" class="layui-textarea" style="height: 100px;" maxlength="200"></textarea>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">相关附件</label>
<div class="layui-input-block" id="enclosureUpload">
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formAddBean"><language showName="com.skyeye.save"></language></button>
</div>
</div>
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/vehicleManageOiling/'}).use('vehicleManageOilingAdd');
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="padding:20px; margin:0 auto;">
<form class="layui-form" action="" id="showForm">
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/vehicleManageOiling/'}).use('vehicleManageOilingDetails');
</script>
</body>
</html>
\ No newline at end of file
{{#bean}}
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">标题:</label>
<div class="layui-input-block ver-center">
{{oilTitle}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">车牌号:</label>
<div class="layui-input-block ver-center">
{{licensePlate}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">加油日期:</label>
<div class="layui-input-block ver-center">
{{oilTime}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">加油容量:</label>
<div class="layui-input-block ver-center">
{{oilCapacity}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">加油金额:</label>
<div class="layui-input-block ver-center">
{{oilPrice}}
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">备注:</label>
<div class="layui-input-block ver-center">
{{roomAddDesc}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">相关附件:</label>
<div class="layui-input-block ver-center" id="enclosureUploadBtn">
</div>
</div>
{{/bean}}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="padding:20px; margin:0 auto;">
<form class="layui-form" action="" id="showForm">
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/vehicleManageOiling/'}).use('vehicleManageOilingEdit');
</script>
</body>
</html>
\ No newline at end of file
{{#bean}}
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">标题<i class="red">*</i></label>
<div class="layui-input-block ver-center">
{{oilTitle}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">车牌号<i class="red">*</i></label>
<div class="layui-input-block ver-center">
{{licensePlate}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">加油日期<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="oilTime" name="oilTime" win-verify="required" placeholder="请输入加油日期" class="layui-input" value="{{oilTime}}"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">加油容量<i class="red">*</i></label>
<div class="layui-input-block">
<input type="number" id="oilCapacity" name="oilCapacity" win-verify="required|double" placeholder="请输入加油容量(升)" class="layui-input" value="{{oilCapacity}}"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">加油金额<i class="red">*</i></label>
<div class="layui-input-block">
<input type="number" id="oilPrice" name="oilPrice" win-verify="required|double" placeholder="请输入加油金额(元)" class="layui-input" value="{{oilPrice}}"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">备注:</label>
<div class="layui-input-block">
<textarea id="roomAddDesc" name="roomAddDesc" placeholder="请输入备注" class="layui-textarea" style="height: 100px;" maxlength="200">{{roomAddDesc}}</textarea>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">相关附件</label>
<div class="layui-input-block" id="enclosureUpload">
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formEditBean"><language showName="com.skyeye.save"></language></button>
</div>
</div>
{{/bean}}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="margin:0 auto; height: 100%;">
<div class="txtcenter" style="margin: 0 auto; padding-top: 10px;">
<form class="layui-form layui-form-pane" action=""
autocomplete="off">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">主题</label>
<div class="layui-input-inline">
<input type="text" id="oilTitle" name="oilTitle" placeholder="请输入主题" class="layui-input" />
</div>
<label class="layui-form-label">车牌号</label>
<div class="layui-input-inline">
<select id="oilPlate" name="oilPlate" lay-filter="oilPlate" lay-search="">
</select>
</div>
<label class="layui-form-label">加油日期</label>
<div class="layui-input-inline">
<input type="text" id="oilTime" name="oilTime" placeholder="请输入加油日期" class="layui-input" />
</div>
<button type="reset" class="layui-btn layui-btn-primary list-form-search"><language showName="com.skyeye.reset"></language></button>
<button class="layui-btn list-form-search" type="button" id="oilingformSearch"><language showName="com.skyeye.search2"></language></button>
</div>
</div>
</form>
</div>
<div class="winui-toolbar">
<div class="winui-tool" style="text-align: left;">
<button id="reloadOilingTable" class="winui-toolbtn"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button>
<button id="addOilingBean" class="winui-toolbtn" auth="1597469406320"><i class="fa fa-plus" aria-hidden="true"></i>登记</button>
</div>
</div>
<div style="margin: auto 10px;">
<table id="oilingTable" lay-filter="oilingTable"></table>
<script type="text/html" id="oilingtableBar">
{{# if(auth('1597469416397')){ }}
<a class="layui-btn layui-btn-xs" lay-event="oilingedit"><language showName="com.skyeye.editBtn"></language></a>
{{# } }}
{{# if(auth('1597469426467')){ }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="oilingdelet"><language showName="com.skyeye.deleteBtn"></language></a>
{{# } }}
</script>
</div>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/vehicleManageOiling/'}).use('vehicleManageOilingList');
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册