提交 93e19db3 编写于 作者: doc_wei's avatar doc_wei

车辆年检托管到表单布局

上级 371591a9
// 车辆年检
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;
// 获取当前登录员工信息
systemCommonUtil.getSysCurrentLoginUserMation(function (data) {
var userName = data.bean.userName;
$("#inspectionTitle").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: '#thisInspectionTime', type: 'date', trigger: 'click'});
// 下次年检时间
laydate.render({elem: '#nextInspectionTime', type: 'date', trigger: 'click'});
skyeyeEnclosure.init('enclosureUpload');
matchingLanguage();
form.render();
form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem)) {
var params = {
inspectionTitle: $("#inspectionTitle").html(),
inspectionArea: $("#inspectionArea").val(),
contactInformation: $("#contactInformation").val(),
inspectionPrice: $("#inspectionPrice").val(),
thisInspectionTime: $("#thisInspectionTime").val(),
nextInspectionTime: $("#nextInspectionTime").val(),
roomAddDesc: $("#roomAddDesc").val(),
vehicleId: $("#licensePlate").val(),
enclosureInfo: skyeyeEnclosure.getEnclosureIdsByBoxId('enclosureUpload')
};
if(params.contactInformation != ""){
var mobile = /^0?1[3|4|5|8][0-9]\d{8}$/, phone = /^0[\d]{2,3}-[\d]{7,8}$/;
var flag = mobile.test(params.contactInformation) || phone.test(params.contactInformation);
if(!flag){
winui.window.msg('请输入正确的联系电话', {icon: 2, time: 2000});
return false;
}
}
if(params.inspectionPrice != ""){
var str = /^0{1}([.]\d{1,2})?$|^[1-9]\d*([.]{1}[0-9]{1,2})?$/;
var flag = str.test(params.inspectionPrice);
if(!flag){
winui.window.msg('年检费用小数点后最多两位!', {icon: 2, time: 2000});
return false;
}
}
AjaxPostUtil.request({url: flowableBasePath + "inspection002", 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.$;
var reg = new RegExp("<br>", "g");
showGrid({
id: "showForm",
url: flowableBasePath + "inspection006",
params: {rowId:parent.rowId},
pagination: false,
template: getFileContent('tpl/vehicleManageInspection/vehicleManageInspectionDetailsTemplate.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 + "inspection004",
params: {rowId:parent.rowId},
pagination: false,
template: getFileContent('tpl/vehicleManageInspection/vehicleManageInspectionEditTemplate.tpl'),
ajaxSendLoadBefore: function(hdb) {
},
ajaxSendAfter:function (json) {
// 本次年检时间
laydate.render({elem: '#thisInspectionTime', type: 'date', trigger: 'click'});
// 下次年检时间
laydate.render({elem: '#nextInspectionTime', 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,
inspectionArea: $("#inspectionArea").val(),
contactInformation: $("#contactInformation").val(),
inspectionPrice: $("#inspectionPrice").val(),
thisInspectionTime: $("#thisInspectionTime").val(),
nextInspectionTime: $("#nextInspectionTime").val(),
roomAddDesc: $("#roomAddDesc").val(),
enclosureInfo: skyeyeEnclosure.getEnclosureIdsByBoxId('enclosureUpload')
};
if(params.contactInformation != ""){
var mobile = /^0?1[3|4|5|8][0-9]\d{8}$/, phone = /^0[\d]{2,3}-[\d]{7,8}$/;
var flag = mobile.test(params.contactInformation) || phone.test(params.contactInformation);
if(!flag){
winui.window.msg('请输入正确的联系电话', {icon: 2, time: 2000});
return false;
}
}
if(params.inspectionPrice != ""){
var str = /^0{1}([.]\d{1,2})?$|^[1-9]\d*([.]{1}[0-9]{1,2})?$/;
var flag = str.test(params.inspectionPrice);
if(!flag){
winui.window.msg('年检费用小数点后最多两位!', {icon: 2, time: 2000});
return false;
}
}
AjaxPostUtil.request({url: flowableBasePath + "inspection005", 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('1597470685417');
// 查询所有的车牌号用于下拉选择框
adminAssistantUtil.queryAllVehicleList(function (data) {
$("#inspectionPlate").html(getDataUseHandlebars(getFileContent('tpl/template/select-option.tpl'), data));
form.render('select');
});
showInspectionList();
// 年检管理开始
function showInspectionList(){
table.render({
id: 'inspectionTable',
elem: '#inspectionTable',
method: 'post',
url: flowableBasePath + "inspection001",
where: getTableParams(),
even: true,
page: true,
limits: getLimits(),
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'inspectionTitle', title: '主题', align: 'left', width: 300, templet: function (d) {
return '<a lay-event="inspectiondetails" class="notice-title-click">' + d.inspectionTitle + '</a>';
}},
{ field: 'licensePlate', title: '车牌号', align: 'center', width: 120},
{ field: 'thisInspectionTime', title: '本次年检时间', align: 'center', width: 150 },
{ field: 'nextInspectionTime', title: '下次年检时间', align: 'center', width: 150 },
{ field: 'inspectionPrice', title: '年检费用(元)', width: 120},
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 150, toolbar: '#inspectiontableBar'}
]],
done: function(json) {
matchingLanguage();
}
});
}
table.on('tool(inspectionTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'inspectiondetails') { //详情
inspectiondetails(data);
} else if (layEvent === 'inspectiondelet'){ //删除
inspectiondelet(data);
} else if (layEvent === 'inspectionedit'){ //编辑
inspectionedit(data);
}
});
form.render();
// 年检信息详情
function inspectiondetails(data) {
rowId = data.id;
_openNewWindows({
url: "../../tpl/vehicleManageInspection/vehicleManageInspectionDetails.html",
title: systemLanguage["com.skyeye.detailsPageTitle"][languageType],
pageId: "vehicleManageInspectionDetails",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
}});
}
// 删除年检信息
function inspectiondelet(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 + "inspection003", params: {rowId: data.id}, type: 'json', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadInspectionTable();
}});
});
}
// 登记年检信息
$("body").on("click", "#addInspectionBean", function() {
_openNewWindows({
url: "../../tpl/vehicleManageInspection/vehicleManageInspectionAdd.html",
title: "车辆年检登记单",
pageId: "vehicleManageInspectionAdd",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadInspectionTable();
}});
});
// 编辑年检信息
function inspectionedit(data) {
rowId = data.id;
_openNewWindows({
url: "../../tpl/vehicleManageInspection/vehicleManageInspectionEdit.html",
title: "编辑车辆年检信息",
pageId: "vehicleManageInspectionEdit",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadInspectionTable();
}});
}
// 搜索表单
$("body").on("click", "#inspectionformSearch", function() {
table.reloadData("inspectionTable", {page: {curr: 1}, where: getTableParams()});
});
$("body").on("click", "#reloadInspectionTable", function() {
loadInspectionTable();
});
function loadInspectionTable(){
table.reloadData("inspectionTable", {where: getTableParams()});
}
function getTableParams() {
return {
inspectionTitle: $("#inspectionTitle").val(),
inspectionPlate: $("#inspectionPlate").val()
};
}
exports('vehicleManageInspectionList', {});
});
<!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="inspectionTitle"></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">年检地点</label>
<div class="layui-input-block">
<input type="text" id="inspectionArea" name="inspectionArea" placeholder="请输入年检地点" class="layui-input"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">联系电话</label>
<div class="layui-input-block">
<input type="text" id="contactInformation" name="contactInformation" placeholder="请输入联系电话" class="layui-input" maxlength="15"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">年检费用</label>
<div class="layui-input-block">
<input type="number" id="inspectionPrice" name="inspectionPrice" 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="text" id="thisInspectionTime" name="thisInspectionTime" 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="text" id="nextInspectionTime" name="nextInspectionTime" win-verify="required" 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/vehicleManageInspection/'}).use('vehicleManageInspectionAdd');
</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/vehicleManageInspection/'}).use('vehicleManageInspectionDetails');
</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">
{{inspectionTitle}}
</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">
{{inspectionArea}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">联系电话:</label>
<div class="layui-input-block ver-center">
{{contactInformation}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">年检费用:</label>
<div class="layui-input-block ver-center">
{{inspectionPrice}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">本次年检时间:</label>
<div class="layui-input-block ver-center">
{{thisInspectionTime}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">下次年检时间:</label>
<div class="layui-input-block ver-center">
{{nextInspectionTime}}
</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/vehicleManageInspection/'}).use('vehicleManageInspectionEdit');
</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">
{{inspectionTitle}}
</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">年检地点</label>
<div class="layui-input-block">
<input type="text" id="inspectionArea" name="inspectionArea" placeholder="请输入年检地点" class="layui-input" value="{{inspectionArea}}"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">联系电话</label>
<div class="layui-input-block">
<input type="text" id="contactInformation" name="contactInformation" placeholder="请输入联系电话" class="layui-input" value="{{contactInformation}}" maxlength="15"/>
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">年检费用</label>
<div class="layui-input-block">
<input type="number" id="inspectionPrice" name="inspectionPrice" placeholder="请输入年检费用(元)" class="layui-input" value="{{inspectionPrice}}"/>
</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="thisInspectionTime" name="thisInspectionTime" win-verify="required" placeholder="请输入本次年检时间" class="layui-input" value="{{thisInspectionTime}}"/>
</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="nextInspectionTime" name="nextInspectionTime" win-verify="required" placeholder="请输入下次年检时间" class="layui-input" value="{{nextInspectionTime}}"/>
</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="inspectionTitle" name="inspectionTitle"
placeholder="请输入主题" class="layui-input" />
</div>
<label class="layui-form-label">车牌号</label>
<div class="layui-input-inline">
<select id="inspectionPlate" name="inspectionPlate" lay-filter="inspectionPlate" lay-search="">
</select>
</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="inspectionformSearch"><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="reloadInspectionTable" class="winui-toolbtn"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button>
<button id="addInspectionBean" class="winui-toolbtn" auth="1597470685417"><i class="fa fa-plus" aria-hidden="true"></i>登记</button>
</div>
</div>
<div style="margin: auto 10px;">
<table id="inspectionTable" lay-filter="inspectionTable"></table>
<script type="text/html" id="inspectiontableBar">
{{# if(auth('1597470695612')){ }}
<a class="layui-btn layui-btn-xs" lay-event="inspectionedit"><language showName="com.skyeye.editBtn"></language></a>
{{# } }}
{{# if(auth('1597470705599')){ }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="inspectiondelet"><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/vehicleManageInspection/'}).use('vehicleManageInspectionList');
</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.
先完成此消息的编辑!
想要评论请 注册