在头部增加;工程、专业、工序选择

This commit is contained in:
lSun 2025-05-23 17:47:16 +08:00
parent 71d96179ed
commit 94b3efb10d
6 changed files with 253 additions and 164 deletions

View File

@ -2,7 +2,7 @@
<html>
<head>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
@ -10,29 +10,27 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<title>项目全过程影像管理工具</title>
<link rel="stylesheet" href="css/font-awesome/css/font-awesome.css" media="all" />
<link rel="stylesheet" href="css/index2.css" media="all" />
<link rel="stylesheet" href="css/global.css" media="all" />
<link rel="stylesheet" href="css/font-awesome/css/font-awesome.css" media="all"/>
<link rel="stylesheet" href="css/index2.css" media="all"/>
<link rel="stylesheet" href="css/global.css" media="all"/>
<link rel="stylesheet" href="js/layui-v2.6.8/css/layui.css" media="all">
<!-- <link rel="stylesheet" href="layui/css/layui.css" media="all" />-->
<!-- <link rel="stylesheet" href="layui/css/layui.css" media="all" />-->
</head>
<style>
.layui-nav-itemed>.layui-nav-child {
</head>
<style>
.layui-nav-itemed > .layui-nav-child {
background-color: rgba(0, 0, 0, 0.01) !important;
}
.layui-nav-tree .layui-nav-child dd {
margin: 0;
margin-left: 15px;
}
.selectd{
padding-top: 1%;
color: #FFFFFF;
font-size: 20px;
}
</style>
<body>
</style>
<body>
<form class="layui-form" onsubmit="return false;">
<div class="layui-layout layui-layout-admin" style="border-bottom: solid 5px #eeecec;height: 65px;">
<!-- 标题栏 -->
<div class="layui-header header header-demo" style="background-color: #00377A;height: 65px;">
@ -45,23 +43,25 @@
<i class="fa fa-bars" aria-hidden="true"></i>
</div>
<div class="layui-form-item selectd" style="margin-left: 8%;" >
<label class="layui-form-label" style="width: 100px;">项目名称:</label>
<div class="layui-form-item" style="margin-left: 15%;padding-top:1%; ">
<label class="layui-form-label" style="width: 100px; font-size: 16px;color: #FFFFFF;">项目名称:</label>
<div class="layui-input-inline" style="width: 210px;">
<select class="layui-input" id="proId" name="proName" lay-verify="required" lay-search="" lay-filter="proId">
<select class="layui-input" id="proIdMain" name="proName" lay-verify="required" lay-search=""
lay-filter="proIdMain">
</select>
</div>
<label class="layui-form-label">专业:</label>
<label class="layui-form-label" style="font-size: 18px;color: #FFFFFF;">专业:</label>
<div class="layui-input-inline">
<select class="layui-input" id="majorId" name="majorName" lay-filter="majorId" lay-search="">
<select class="layui-input" id="majorIdMain" name="majorName" lay-filter="majorIdMain"
lay-search="">
</select>
</div>
<label class="layui-form-label">工序:</label>
<label class="layui-form-label" style="font-size: 18px;color: #FFFFFF;">工序:</label>
<div class="layui-input-inline">
<select class="layui-input" id="gxId" name="gxName" lay-filter="gxId" lay-search="">
<select class="layui-input" id="gxIdMain" name="gxName" lay-filter="gxIdMain" lay-search="">
</select>
</div>
@ -70,22 +70,25 @@
<ul class="layui-nav" pc style="background-color: transparent !important;">
<li class="layui-nav-item">
<!-- <a href='javascript:;' lay-id="-997" data-url="pages/notice/noticePubList.html"><i class="fa fa-envelope-o" aria-hidden="true" title="公告" unreadNotice></i></a>-->
<!-- <a href='javascript:;' lay-id="-997" data-url="pages/notice/noticePubList.html"><i class="fa fa-envelope-o" aria-hidden="true" title="公告" unreadNotice></i></a>-->
</li>
<li class="layui-nav-item" pc>
<a href="javascript:;" style="color: #fff !important;" class="admin-header-user">
<img />
<img/>
<span style="color: #fff !important;"></span>
</a>
<dl class="layui-nav-child">
<!-- <dd>-->
<!-- <a href='javascript:;' lay-id="-999" data-url="pages/user/updateMyself.html"><i class="fa fa-user-circle" aria-hidden="true"></i> 个人信息</a>-->
<!-- </dd>-->
<!-- <dd>-->
<!-- <a href='javascript:;' lay-id="-999" data-url="pages/user/updateMyself.html"><i class="fa fa-user-circle" aria-hidden="true"></i> 个人信息</a>-->
<!-- </dd>-->
<dd>
<a href='javascript:;' lay-id="-998" onclick="changeUserPwd()"><i class="fa fa-drupal" aria-hidden="true"></i> 修改密码</a>
<a href='javascript:;' lay-id="-998" onclick="changeUserPwd()"><i class="fa fa-drupal"
aria-hidden="true"></i>
修改密码</a>
</dd>
<dd>
<a href="javascript:;" onclick="logout()"><i class="fa fa-sign-out" aria-hidden="true"></i> 退出</a>
<a href="javascript:;" onclick="logout()"><i class="fa fa-sign-out"
aria-hidden="true"></i> 退出</a>
</dd>
</dl>
</li>
@ -135,6 +138,7 @@
<script type="text/javascript" src="js/openIframe.js"></script>
</div>
</form>
</body>
</html>

View File

@ -226,6 +226,37 @@ function setParams(params) {
processList = getProcessSelected();
if (idParam) {
getUserById();
}else{
setTimeout(function () {
var proIdMain = top.$('#proIdMain').val();
var proIdMainName = top.$('#proIdMain option:selected').text();
if(proIdMain){
$('#proId option[value=' + proIdMain + ']').attr('selected', true)
layui.form.render('select');
proId = proIdMain;
proName = proIdMainName;
}
var majorIdMain = top.$('#majorIdMain').val();
var majorIdMainName = top.$('#majorIdMain option:selected').text();
if (majorIdMain){
$('#majorId option[value=' + majorIdMain + ']').attr('selected', true)
layui.form.render('select')
let gxs = getGxsSelect(majorIdMain);
setSelectValueName(gxs, 'gxId', '请选择工序');
majorId= majorIdMain;
majorName = majorIdMainName;
}
var gxIdMain = top.$('#gxIdMain').val();
var gxIdMainName = top.$('#gxIdMain option:selected').text();
if(gxIdMain){
$('#gxId option[value=' + gxIdMain + ']').attr('selected', true)
layui.form.render('select')
gxId = gxIdMain;
gxName = gxIdMainName;
}
},100)
}
form.on('select(proId)', function (data) {

View File

@ -221,6 +221,36 @@ function setParams(params) {
processList = getProcessSelected();
if (idParam) {
getUserById();
}else{
setTimeout(function () {
var proIdMain = top.$('#proIdMain').val();
var proIdMainName = top.$('#proIdMain option:selected').text();
if(proIdMain){
$('#proId option[value=' + proIdMain + ']').attr('selected', true)
layui.form.render('select');
proId = proIdMain;
proName = proIdMainName;
}
var majorIdMain = top.$('#majorIdMain').val();
var majorIdMainName = top.$('#majorIdMain option:selected').text();
if (majorIdMain){
$('#majorId option[value=' + majorIdMain + ']').attr('selected', true)
layui.form.render('select')
let gxs = getGxsSelect(majorIdMain);
setSelectValueName(gxs, 'gxId', '请选择工序');
majorId= majorIdMain;
majorName = majorIdMainName;
}
var gxIdMain = top.$('#gxIdMain').val();
var gxIdMainName = top.$('#gxIdMain option:selected').text();
if(gxIdMain){
$('#gxId option[value=' + gxIdMain + ']').attr('selected', true)
layui.form.render('select')
gxId = gxIdMain;
gxName = gxIdMainName;
}
},100)
}
form.on('select(proId)', function (data) {

View File

@ -106,6 +106,37 @@ function setParams(params) {
processList = getProcessSelected();
if (idParam) {
getUserById();
}else{
setTimeout(function () {
var proIdMain = top.$('#proIdMain').val();
var proIdMainName = top.$('#proIdMain option:selected').text();
if(proIdMain){
$('#proId option[value=' + proIdMain + ']').attr('selected', true)
layui.form.render('select');
proId = proIdMain;
proName = proIdMainName;
}
var majorIdMain = top.$('#majorIdMain').val();
var majorIdMainName = top.$('#majorIdMain option:selected').text();
if (majorIdMain){
$('#majorId option[value=' + majorIdMain + ']').attr('selected', true)
layui.form.render('select')
let gxs = getGxsSelect(majorIdMain);
setSelectValueName(gxs, 'gxId', '请选择工序');
majorId= majorIdMain;
majorName = majorIdMainName;
}
var gxIdMain = top.$('#gxIdMain').val();
var gxIdMainName = top.$('#gxIdMain option:selected').text();
if(gxIdMain){
$('#gxId option[value=' + gxIdMain + ']').attr('selected', true)
layui.form.render('select')
gxId = gxIdMain;
gxName = gxIdMainName;
}
},100)
}
form.on('select(proId)', function (data) {

View File

@ -19,15 +19,6 @@ let files1, files2;
let proId, proName, majorId, majorName, gxId, gxName;
let formData;
let selectedProId = localStorage.getItem('selectedProId');
let selectedProName = localStorage.getItem('selectedProName');
let selectedMajor = localStorage.getItem('selectedMajor');
let selectedMajorName = localStorage.getItem('selectedMajorName');
let selectedGxId = localStorage.getItem('selectedGxId');
let selectedGxName = localStorage.getItem('selectedGxName');
layui.use(['laydate', 'upload', 'form'], function () {
var upload = layui.upload;
var layer = layui.layer;
@ -233,29 +224,32 @@ function setParams(params) {
getUserById();
}else{
setTimeout(function () {
var s = parent.$('#proId').val()
alert(s);
if(selectedProId){
proId = selectedProId ;
proName = selectedProName;
$('#proId option[value=' + selectedProId + ']').attr('selected', true)
layui.form.render('select')
var proIdMain = top.$('#proIdMain').val();
var proIdMainName = top.$('#proIdMain option:selected').text();
if(proIdMain){
$('#proId option[value=' + proIdMain + ']').attr('selected', true)
layui.form.render('select');
proId = proIdMain;
proName = proIdMainName;
}
if(selectedMajor){
majorId = selectedMajor ;
majorName = selectedMajorName;
$('#majorId option[value=' + selectedMajor + ']').attr('selected', true)
var majorIdMain = top.$('#majorIdMain').val();
var majorIdMainName = top.$('#majorIdMain option:selected').text();
if (majorIdMain){
$('#majorId option[value=' + majorIdMain + ']').attr('selected', true)
layui.form.render('select')
}
if(selectedMajor && selectedGxId){
let gxs = getGxsSelect(selectedMajor);
let gxs = getGxsSelect(majorIdMain);
setSelectValueName(gxs, 'gxId', '请选择工序');
gxId = selectedGxId ;
gxName = selectedGxName;
$('#gxId option[value=' + selectedGxId + ']').attr('selected', true)
majorId= majorIdMain;
majorName = majorIdMainName;
}
var gxIdMain = top.$('#gxIdMain').val();
var gxIdMainName = top.$('#gxIdMain option:selected').text();
if(gxIdMain){
$('#gxId option[value=' + gxIdMain + ']').attr('selected', true)
layui.form.render('select')
gxId = gxIdMain;
gxName = gxIdMainName;
}
},100)
}
@ -279,7 +273,7 @@ function setParams(params) {
}
gxId = '';
gxName = '';
let gxs = getGxsSelect(data.value);
let gxs = getGxsSelect(selectedId);
setSelectValueName(gxs, 'gxId', '请选择工序');
});

View File

@ -254,18 +254,17 @@ layui.use(['form', 'layer', 'element'], function () {
$('body').removeClass('site-mobile');
});
// 监听选择事件并存储选中的值
document.getElementById('majorId').addEventListener('change', function () {
const selectElement = event.target;
const selectedId = selectElement.value; // 获取选中项的 value (id)
if (selectedId === '' || selectedId == '') {
setSelectValueName("", 'gxId', '请先选择专业');
} else {
let gxs = getGxsSelect(selectedId);
setSelectValueName(gxs, 'gxId', '请选择工序');
form.on('select(majorIdMain)', function (data) {
const selectedId = data.value; // 获取选中项的 value 值
const selectedName = $(data.elem).find("option:selected").text(); // 获取选中项的文本
if(selectedId === '' || selectedId == ''){
setSelectValueName("", 'gxIdMain', '请先选择专业');
}else{
let gxs = getGxsSelect(data.value);
setSelectValueName(gxs, 'gxIdMain', '请选择工序');
}
});
});
/**
@ -314,7 +313,7 @@ function getProSelected() {
ajaxRequest(url, "POST", data, true, function () {
}, function (result) {
if (result.code === 200) {
setSelectValueName(result.data, 'proId', "请选择项目(可搜索)");
setSelectValueName(result.data, 'proIdMain', "请选择项目(可搜索)");
} else {
layer.alert(result.msg, {icon: 2})
}
@ -331,7 +330,7 @@ function getMajorSelected() {
ajaxRequest(url, "GET", null, true, function () {
}, function (result) {
if (result.code === 200) {
setSelectValueName(result.data, 'majorId', "请选择专业");
setSelectValueName(result.data, 'majorIdMain', "请选择专业");
} else {
layer.alert(result.msg, {icon: 2})
}
@ -344,5 +343,5 @@ function getMajorSelected() {
* 获取工序数据
*/
function getProcessSelected() {
setSelectValueName("", 'gxId', '请先选择专业');
setSelectValueName("", 'gxIdMain', '请先选择专业');
}