三合一
This commit is contained in:
parent
e4f085bb32
commit
4621c9235c
|
|
@ -4,15 +4,55 @@
|
|||
justify-content: center;
|
||||
}
|
||||
|
||||
|
||||
#no_data_title {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
|
||||
flex-direction: column;
|
||||
justify-content: space-evenly;
|
||||
margin-top: 2%;
|
||||
}
|
||||
|
||||
#search-info {
|
||||
#no_data_titleJJ {
|
||||
width: 100%;
|
||||
|
||||
flex-direction: column;
|
||||
justify-content: space-evenly;
|
||||
margin-top: 2%;
|
||||
}
|
||||
|
||||
#no_data_titleDC {
|
||||
width: 100%;
|
||||
|
||||
flex-direction: column;
|
||||
justify-content: space-evenly;
|
||||
margin-top: 2%;
|
||||
}
|
||||
|
||||
#no_data_titleYS {
|
||||
width: 100%;
|
||||
|
||||
|
||||
flex-direction: column;
|
||||
justify-content: space-evenly;
|
||||
margin-top: 2%;
|
||||
}
|
||||
search-info {
|
||||
border-width: 1px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#search-infoJJ {
|
||||
border-width: 1px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#search-infoDC {
|
||||
border-width: 1px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#search-infoYS {
|
||||
border-width: 1px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
let idParam, objParam;
|
||||
let idParam, objParam;fileList = new Array(), imgListUp = new Array();
|
||||
let form, laydate, layer, upload, table, util;
|
||||
let pageNum = 1, tableIns; // 定义分页
|
||||
let jjDataArr = []; // 配件数据
|
||||
|
|
@ -16,15 +16,157 @@ function setParams(obj) {
|
|||
laydate.render({
|
||||
elem: '#needTime'
|
||||
});
|
||||
form.verify();
|
||||
// form.verify();
|
||||
// 自定义验证规则
|
||||
form.verify({
|
||||
atLeastOne: function(value){
|
||||
var checkboxes = document.querySelectorAll('input[name="applyType"]:checked');
|
||||
if(checkboxes.length === 0){
|
||||
return '请至少选择一个申请类型';
|
||||
}
|
||||
}
|
||||
});
|
||||
form.on('submit(formData)', function (data) {
|
||||
submitApply(data);
|
||||
const isVehicleChecked = $('input[name="applyType"][value="vehicle"]').is(':checked');
|
||||
if (isVehicleChecked) {
|
||||
form.on('submit(formDataTwo)', function (data){
|
||||
submitApply(data);
|
||||
})
|
||||
}else{
|
||||
submitApply(data);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
form.on('checkbox', function(data) {
|
||||
console.log("xxxxxxxxxxxx", data.elem);
|
||||
var detailId = data.elem.value === 'tool' ? 'tool-details' :
|
||||
data.elem.value === 'safety-tool' ? 'safety-tool-details' :
|
||||
data.elem.value === 'crane' ? 'crane-details' :
|
||||
'vehicle-details';
|
||||
toggleDetails(detailId,data.elem.value);
|
||||
});
|
||||
form.render();
|
||||
let uploadObj = upload.render({
|
||||
elem: '#test2',
|
||||
multiple: true,
|
||||
dataType: "json",
|
||||
exts: 'jpg|png|jpeg|doc|docx|pdf|xlsx|xls',
|
||||
acceptMime: 'image/jpg,image/png,image/jpeg,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
number: 5, //最大上传数量
|
||||
size: 1024 * 10, //最大文件大小,单位k
|
||||
auto: false, //是否自动上传 ,默认为true
|
||||
bindAction: '#hideUpload', //绑定的按钮
|
||||
choose: function (obj) {
|
||||
uploadObj.config.elem.next()[0].value = '';
|
||||
let length = $('.file-iteme').length;
|
||||
if (length >= 5) {
|
||||
return layer.msg('最多上传5个附件证明', { icon: 7 });
|
||||
}
|
||||
let num = 0;
|
||||
obj.preview(function (index, file, result) {
|
||||
num ++;
|
||||
if(num <= (5 - length)){
|
||||
$('#uploader-list').append(
|
||||
'<div id="" class="file-iteme">' +
|
||||
'<div class="handle"><p>x</p></div>' +
|
||||
handleFileType(index, file, result) +
|
||||
'</div>'
|
||||
);
|
||||
let map = new Map();//将选择的图片索引和图片写成对象存入集合
|
||||
map.index = index;
|
||||
map.file = file;
|
||||
fileList.push(map);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
getProList();
|
||||
});
|
||||
}
|
||||
|
||||
// 删除文件
|
||||
$(document).on("click", ".file-iteme .handle", function (event) {
|
||||
imgListUp.splice(0, imgListUp.length);
|
||||
let index = $(this).next().attr('data-index');
|
||||
$.each(fileList, function (inx, ele) {
|
||||
//对比删除文件索引
|
||||
//将未删除的存入新集合
|
||||
if (index != ele.index) {
|
||||
imgListUp.push(ele);
|
||||
}
|
||||
});
|
||||
$(this).parent().remove();
|
||||
//将新文件集合替换老集合
|
||||
fileList.splice(0, fileList.length);
|
||||
$.each(imgListUp, function (inx, ele) {
|
||||
fileList.push(ele)
|
||||
});
|
||||
});
|
||||
|
||||
// 设置文件类型
|
||||
function handleFileType(index, file, result) {
|
||||
let html = '', img = '';
|
||||
if(file.ext){
|
||||
file.ext = file.ext.toLowerCase();
|
||||
}
|
||||
if(file.name){
|
||||
file.name = file.name.toLowerCase();
|
||||
}
|
||||
if (file.ext === 'doc' || file.ext === 'docx') {
|
||||
img = '../../../images/docx.png';
|
||||
} else if (file.ext === 'xls' || file.ext === 'xlsx') {
|
||||
img = '../../../images/xlsx.png';
|
||||
} else if (file.ext === 'pdf') {
|
||||
img = '../../../images/pdf.png';
|
||||
} else {
|
||||
return '<img class="img" style="width: 130px;height: 120px;" data-index=' + index + ' data-name=' + file.name + ' src=' + result + '>';
|
||||
}
|
||||
html += '<div class="layout upload-file" data-index=' + index + '>' +
|
||||
'<img src="' + img + '">' +
|
||||
'<p style="text-align: center;font-size:12px;">' + file.name + '</p>' +
|
||||
'</div>';
|
||||
return html;
|
||||
}
|
||||
|
||||
|
||||
// // 验证 formDataTwo 表单
|
||||
// function validateFormDataTwo(data) {
|
||||
// // 这里可以添加具体的表单验证逻辑
|
||||
// // 例如,检查某些字段是否为空
|
||||
// const requiredFields = ['carLength', 'carWidth', 'carHeight', 'carWeight','carStart','carEnd'];
|
||||
// for (let i = 0; i < requiredFields.length; i++) {
|
||||
// const field = requiredFields[i];
|
||||
// if (!data.field[field]) {
|
||||
// layer.msg(`${field} 是必填项`, { icon: 7 });
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
|
||||
function toggleDetails(detailId,applyType) {
|
||||
console.log("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",applyType)
|
||||
const detailElement = document.getElementById(detailId);
|
||||
if (detailElement.style.display === 'none') {
|
||||
detailElement.style.display = 'block';
|
||||
} else {
|
||||
detailElement.style.display = 'none';
|
||||
}
|
||||
if (applyType === 'vehicle') {
|
||||
// 重置运输车辆明细表单
|
||||
var form = document.getElementById('formTwo');
|
||||
if (form) {
|
||||
form.reset();
|
||||
}
|
||||
var tableBody = document.getElementById('baseTableYS').getElementsByTagName('tbody')[0];
|
||||
if (tableBody) {
|
||||
tableBody.innerHTML = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 工程下拉选
|
||||
function getProList() {
|
||||
let url = dataUrl + 'backstage/planApply/getProSelect';
|
||||
|
|
@ -50,6 +192,11 @@ function setSelectData(proList) {
|
|||
|
||||
function saveData2() {
|
||||
$('#formSubmit').trigger('click')
|
||||
const isVehicleChecked = $('input[name="applyType"][value="vehicle"]').is(':checked');
|
||||
if (isVehicleChecked) {
|
||||
$('#formSubmitTwo').trigger('click')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function setNumColor(value, type) { // 1.需要量 2.已发货量 3.差缺量
|
||||
|
|
@ -68,7 +215,14 @@ function setNumColor(value, type) { // 1.需要量 2.已发货量 3.差缺量
|
|||
// 提交
|
||||
function submitApply(data) {
|
||||
let list = getBaseTableData();
|
||||
// 校验配件入库数量
|
||||
const isVehicleChecked = $('input[name="applyType"][value="vehicle"]').is(':checked');
|
||||
if (isVehicleChecked) {
|
||||
// 校验附件是否上传
|
||||
if (fileList.length === 0) {
|
||||
return layer.msg('请上传附件', { icon: 7 });
|
||||
}
|
||||
}
|
||||
//校验配件入库数量
|
||||
if (list.length === 0) {
|
||||
return layer.msg('未添加安全工器具明细数据', { icon: 7 });
|
||||
}
|
||||
|
|
@ -130,11 +284,25 @@ function getBaseTableData() {
|
|||
|
||||
|
||||
// 选择需求计划安全工器具类型
|
||||
function chooseFitType() {
|
||||
function chooseFitTypeTwo() {
|
||||
let params = {};
|
||||
openIframeByParamObj("choose_type", '选择需求计划安全工器具类型', "./choose_type_list.html", '92%', '95%', params);
|
||||
openIframeByParamObj("choose_type_two", '选择需求计划安全工器具类型', "./choose_type_list.html", '92%', '95%', params);
|
||||
}
|
||||
// 选择机具类型
|
||||
function chooseFitTypeOne() {
|
||||
let params = {};
|
||||
openIframeByParamObj("choose_type_one", '选择需求计划机具类型<span style="color:red;font-size:14px">(设备类请备注大、中、小)</span>', "./choose_tool_type_list.html", '92%', '95%', params);
|
||||
}
|
||||
// 选择车辆类型
|
||||
function chooseFitTypeThree() {
|
||||
let params = {};
|
||||
openIframeByParamObj("choose_type_three", '选择需求计划安车辆类型', "./choose_crane_type_list.html", '92%', '95%', params);
|
||||
}
|
||||
//选择吊车类型
|
||||
function chooseFitTypeFour() {
|
||||
let params = {};
|
||||
openIframeByParamObj("choose_type_four", '选择需求计划吊车类型', "./choose_vehicle_type_list.html", '92%', '95%', params);
|
||||
}
|
||||
|
||||
// 查询
|
||||
function search() {
|
||||
let keyWord = $('#modelName').val();
|
||||
|
|
@ -167,8 +335,9 @@ function resetSearch() {
|
|||
}
|
||||
|
||||
// 子页面回调数据
|
||||
function addFitDatas(data) {
|
||||
function addFitDatas(data,pageSource) {
|
||||
console.log('新增的数据:' + data);
|
||||
console.log('回调的页面:' + pageSource);
|
||||
if (jjDataArr.length > 0) { // 继续添加数据
|
||||
let newJjDataArr = JSON.parse(data);
|
||||
$.each(newJjDataArr, function (index, item) {
|
||||
|
|
@ -179,9 +348,9 @@ function addFitDatas(data) {
|
|||
} else { // 第一次添加数据
|
||||
jjDataArr = JSON.parse(data);
|
||||
if (jjDataArr && jjDataArr.length > 0) {
|
||||
$('#no_data_title').css({ 'display': 'none' });
|
||||
$('#search-info').removeAttr('style');
|
||||
$('#table-box').removeAttr('style');
|
||||
$('#no_data_titleJJ').css({ 'display': 'none' });
|
||||
$('#search-infoJJ').removeAttr('style');
|
||||
$('#table-boxJJ').removeAttr('style');
|
||||
setTableData(jjDataArr);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,339 @@
|
|||
let objParam;
|
||||
let form, table, element, tableIns, layer, util;
|
||||
let pageNum = 1;
|
||||
let quanju = new Array();//全局
|
||||
let huancun = new Array();//缓存
|
||||
let huancunObj = new Array();//缓存2
|
||||
let cjList = [];
|
||||
let jjDetailArr = []; // 入库配件类型数据
|
||||
function setParams(obj) {
|
||||
objParam = JSON.parse(obj);
|
||||
layui.use(["form", "table", 'element', 'layer', 'util'], function () {
|
||||
form = layui.form;
|
||||
table = layui.table;
|
||||
element = layui.element;
|
||||
layer = layui.layer;
|
||||
util = layui.util;
|
||||
initTable();
|
||||
});
|
||||
}
|
||||
|
||||
// 查询/重置
|
||||
function queryTable(type) {
|
||||
if (type === 1) {
|
||||
let pName = $('#pName').val();
|
||||
let flag = checkValue(pName);
|
||||
if (flag) {
|
||||
$('#pName').val('');
|
||||
return layer.msg('物机名称查询包含特殊字符,请重新输入', { icon: 2 });
|
||||
}
|
||||
let name = $('#name').val();
|
||||
let flag2 = checkValue(name);
|
||||
if (flag2) {
|
||||
$('#name').val('');
|
||||
return layer.msg('规格查询包含特殊字符,请重新输入', { icon: 2 });
|
||||
}
|
||||
reloadTable(1);
|
||||
} else if (type === 2) {
|
||||
$('#pName').val('');
|
||||
$('#name').val('');
|
||||
layui.form.render();
|
||||
reloadTable(1);
|
||||
}
|
||||
}
|
||||
|
||||
// 重载表格
|
||||
function reloadTable(pageNum) {
|
||||
table.reload("currentTableId", {
|
||||
page: {
|
||||
curr: pageNum ? pageNum : 1,
|
||||
},
|
||||
where: {
|
||||
encryptedData: JSON.stringify({
|
||||
'pName': $('#pName').val(),
|
||||
'name': $('#name').val(),
|
||||
}),
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// 表格数据
|
||||
function initTable() {
|
||||
tableIns = table.render({
|
||||
elem: "#currentTableId",
|
||||
id: 'currentTableId',
|
||||
height: "full-200",
|
||||
headers: {
|
||||
authorization: sessionStorage.getItem("gz-token"),
|
||||
},
|
||||
url: dataUrl + "backstage/planApplication/getTypeList",
|
||||
where: {
|
||||
encryptedData: JSON.stringify({
|
||||
'pName': $('#pName').val(),
|
||||
'name': $('#name').val(),
|
||||
}),
|
||||
},
|
||||
request: {
|
||||
pageName: 'pageNum',
|
||||
limitName: 'pageSize'
|
||||
},
|
||||
parseData: function (res) { // res 即为原始返回的数据
|
||||
if(res.code === 401){
|
||||
closeWindowOpen();
|
||||
}
|
||||
if (jjDetailArr && res.list) {
|
||||
$.each(res.list, function (index, item) {
|
||||
$.each(jjDetailArr, function (index2, item2) {
|
||||
if (item.id === item2.id) {
|
||||
item.needNum = item2.needNum;
|
||||
item.tiems = item2.tiems;
|
||||
item.remarks = item2.remarks;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
return {
|
||||
"code": 0, // 解析接口状态
|
||||
"msg": '获取成功', // 解析提示文本
|
||||
"count": res.total, // 解析数据长度
|
||||
"data": res.list // 解析数据列表
|
||||
};
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{ type: 'checkbox', width: '5%' },
|
||||
{
|
||||
width: '6%',
|
||||
title: "序号",
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
return d.LAY_NUM;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "ppName",
|
||||
width: '10%',
|
||||
title: "物机类型",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
},
|
||||
{
|
||||
field: "pName",
|
||||
width: '10%',
|
||||
title: "物机名称",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
width: '10%',
|
||||
title: "规格",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
},
|
||||
{
|
||||
field: "unit",
|
||||
title: "单位",
|
||||
width: '10%',
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
},
|
||||
{
|
||||
field: "needNum",
|
||||
width: '15%',
|
||||
title: "<span style='color:red'> * </span>需用量",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
edit: 'text',
|
||||
style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;'
|
||||
},
|
||||
{
|
||||
field: "times",
|
||||
width: '15%',
|
||||
title: "<span style='color:red'> * </span>需用天数",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
edit: 'text',
|
||||
style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;',
|
||||
},
|
||||
{
|
||||
field: "remarks",
|
||||
width: '18.9%',
|
||||
title: "备注",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
edit: 'textarea',
|
||||
style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;'
|
||||
},
|
||||
|
||||
],
|
||||
],
|
||||
limits: [10, 15, 20, 25, 50, 100],
|
||||
limit: 10,
|
||||
page: true,
|
||||
done: function (res, curr, count) {
|
||||
table.resize("currentTableId");
|
||||
pageNum = tableIns.config.page.curr;
|
||||
//设置全部数据到全局变量
|
||||
quanju = res.data;
|
||||
for (var i = 0; i < res.data.length; i++) {
|
||||
for (var j = 0; j < huancun.length; j++) {
|
||||
//数据id和要勾选的id相同时checkbox选中
|
||||
if (res.data[i].id === huancun[j]) {
|
||||
//这里才是真正的有效勾选
|
||||
res.data[i]["LAY_CHECKED"] = 'true';
|
||||
//找到对应数据改变勾选样式,呈现出选中效果
|
||||
var index = res.data[i]['LAY_INDEX'];
|
||||
$('.layui-table tr[data-index=' + index + '] input[type="checkbox"]').prop('checked', true);
|
||||
$('.layui-table tr[data-index=' + index + '] input[type="checkbox"]').next().addClass('layui-form-checked');
|
||||
}
|
||||
}
|
||||
}
|
||||
//设置全选checkbox的选中状态,只有改变LAY_CHECKED的值, table.checkStatus才能抓取到选中的状态
|
||||
let checkStatus = table.checkStatus('currentTableId');//这里的lightTable是指分页中的id
|
||||
if (checkStatus.isAll) {//是否全选
|
||||
//layTableAllChoose
|
||||
$('.layui-table th[data-field="0"] input[type="checkbox"]').prop('checked', true);//data-field值默认为0,如果在分页部分自定义了属性名,则需要改成对应的属性名
|
||||
$('.layui-table th[data-field="0"] input[type="checkbox"]').next().addClass('layui-form-checked');//data-field值默认为0,如果在分页部分自定义了属性名,则需要改成对应的属性名
|
||||
}
|
||||
},
|
||||
});
|
||||
table.on('edit(currentTableId2)', function (obj) {
|
||||
var field = obj.field; // 得到修改的字段
|
||||
var value = obj.value // 得到修改后的值
|
||||
if (field === 'needNum' || field === 'times') { // 需用量 / 需用天数
|
||||
if (value) {
|
||||
const regex = /^(0|[1-9]\d{0,6})$/;
|
||||
if (!regex.test(value)) {
|
||||
obj.reedit();
|
||||
return layer.msg('格式不正确,最大输入6位数,且为正整数!', { icon: 7 })
|
||||
}
|
||||
}
|
||||
} else if (field === 'remarks') { // 备注
|
||||
if (value) {
|
||||
if (value.length > 255) {
|
||||
obj.reedit();
|
||||
return layer.msg('备注最多输入255位!', { icon: 7 })
|
||||
}
|
||||
}
|
||||
}
|
||||
// 显示 - 仅用于演示
|
||||
// layer.msg('[ID: ' + data.id + '] ' + field + ' 字段更改值为:' + util.escape(value));
|
||||
let id = obj.data.id;
|
||||
updateOrAddObject(id, obj.data);
|
||||
});
|
||||
//复选框选中监听,将选中的id 设置到缓存数组,或者删除缓存数组
|
||||
table.on('checkbox(currentTableId2)', function (obj) {
|
||||
if (obj.checked === true) {
|
||||
if (obj.type === 'one' && huancun.indexOf(obj.data.id) === -1) {
|
||||
huancun.push(obj.data.id);
|
||||
huancunObj.push(obj.data);
|
||||
} else {
|
||||
for (let i = 0; i < quanju.length; i++) {
|
||||
if (huancun.indexOf(quanju[i].id) === -1) {
|
||||
huancun.push(quanju[i].id);
|
||||
huancunObj.push(quanju[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (obj.type === 'one') {
|
||||
for (let i = 0; i < huancun.length; i++) {
|
||||
if (huancun[i] === obj.data.id) {
|
||||
removeByValue(huancun, huancun[i]);//调用自定义的根据值移除函数
|
||||
removeByValue(huancunObj, huancunObj[i]);//调用自定义的根据值移除函数
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < quanju.length; i++) {
|
||||
for (let j = 0; j < huancun.length; j++) {
|
||||
if (huancun[j] === quanju[i].id) {
|
||||
removeByValue(huancun, +huancun[j]);//调用自定义的根据值移除函数
|
||||
removeByValue(huancunObj, +huancunObj[j]);//调用自定义的根据值移除函数
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$('#num').html(huancun.length);
|
||||
});
|
||||
}
|
||||
|
||||
// 根据id 判断对象数组的对象是否存在 如果存在则替换,不存在则添加
|
||||
function updateOrAddObject(id, newObject) {
|
||||
const index = jjDetailArr.findIndex(obj => obj.id === id);
|
||||
if (index !== -1) {
|
||||
// 如果对象存在,则替换它
|
||||
jjDetailArr[index] = newObject;
|
||||
} else {
|
||||
// 如果对象不存在,则添加到数组
|
||||
jjDetailArr.push(newObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//自定义方法,根据值去移除
|
||||
function removeByValue(arr, val) {
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if (arr[i] == val) {
|
||||
arr.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < huancunObj.length; i++) {
|
||||
if (huancunObj[i].id == val) {
|
||||
huancunObj.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 保存数据
|
||||
function saveData2(params) {
|
||||
let dataArr = [];
|
||||
if (huancun.length === 0) {
|
||||
return layer.msg('未添加数据', { icon: 7 });
|
||||
} else {
|
||||
$.each(huancunObj, function (index, item) {
|
||||
dataArr.push(item);
|
||||
})
|
||||
for (let i = 0; i < huancun.length; i++) {
|
||||
const id = huancun[i];
|
||||
for (let j = 0; j < jjDetailArr.length; j++) {
|
||||
const obj = jjDetailArr[j];
|
||||
if (id === obj.id) {
|
||||
updateOrAddObject2(id, obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let layerIndex = layer.confirm('<h5 style="color:red">数据即将被添加,请仔细检查数据是否有错误!</h5>', { title: '操作提示' }, function () {
|
||||
layer.close(layerIndex);
|
||||
closePage(1, JSON.stringify(dataArr));
|
||||
});
|
||||
// 替换对象
|
||||
function updateOrAddObject2(id, newObject) {
|
||||
const index = dataArr.findIndex(obj => obj.id === id);
|
||||
if (index !== -1) {
|
||||
// 如果对象存在,则替换它
|
||||
dataArr[index] = newObject;
|
||||
} else {
|
||||
// 如果对象不存在,则添加到数组
|
||||
dataArr.push(newObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function closePage(type, params) {
|
||||
let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
|
||||
if (type == 1) {
|
||||
window.parent.addFitDatas(params);
|
||||
}
|
||||
parent.layer.close(index); // 再执行关闭
|
||||
}
|
||||
|
|
@ -0,0 +1,338 @@
|
|||
let objParam;
|
||||
let form, table, element, tableIns, layer, util;
|
||||
let pageNum = 1;
|
||||
let quanju = new Array();//全局
|
||||
let huancun = new Array();//缓存
|
||||
let huancunObj = new Array();//缓存2
|
||||
let cjList = [];
|
||||
let jjDetailArr = []; // 入库配件类型数据
|
||||
function setParams(obj) {
|
||||
objParam = JSON.parse(obj);
|
||||
layui.use(["form", "table", 'element', 'layer', 'util'], function () {
|
||||
form = layui.form;
|
||||
table = layui.table;
|
||||
element = layui.element;
|
||||
layer = layui.layer;
|
||||
util = layui.util;
|
||||
initTable();
|
||||
});
|
||||
}
|
||||
|
||||
// 查询/重置
|
||||
function queryTable(type) {
|
||||
if (type === 1) {
|
||||
let pName = $('#pName').val();
|
||||
let flag = checkValue(pName);
|
||||
if (flag) {
|
||||
$('#pName').val('');
|
||||
return layer.msg('物机名称查询包含特殊字符,请重新输入', { icon: 2 });
|
||||
}
|
||||
let name = $('#name').val();
|
||||
let flag2 = checkValue(name);
|
||||
if (flag2) {
|
||||
$('#name').val('');
|
||||
return layer.msg('规格查询包含特殊字符,请重新输入', { icon: 2 });
|
||||
}
|
||||
reloadTable(1);
|
||||
} else if (type === 2) {
|
||||
$('#pName').val('');
|
||||
$('#name').val('');
|
||||
layui.form.render();
|
||||
reloadTable(1);
|
||||
}
|
||||
}
|
||||
|
||||
// 重载表格
|
||||
function reloadTable(pageNum) {
|
||||
table.reload("currentTableId", {
|
||||
page: {
|
||||
curr: pageNum ? pageNum : 1,
|
||||
},
|
||||
where: {
|
||||
encryptedData: JSON.stringify({
|
||||
'pName': $('#pName').val(),
|
||||
'name': $('#name').val(),
|
||||
}),
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 表格数据
|
||||
function initTable() {
|
||||
tableIns = table.render({
|
||||
elem: "#currentTableId",
|
||||
id: 'currentTableId',
|
||||
height: "full-200",
|
||||
headers: {
|
||||
authorization: sessionStorage.getItem("gz-token"),
|
||||
},
|
||||
url: dataUrl + "backstage/planApplication/getTypeList",
|
||||
where: {
|
||||
encryptedData: JSON.stringify({
|
||||
'pName': $('#pName').val(),
|
||||
'name': $('#name').val(),
|
||||
}),
|
||||
},
|
||||
request: {
|
||||
pageName: 'pageNum',
|
||||
limitName: 'pageSize'
|
||||
},
|
||||
parseData: function (res) { // res 即为原始返回的数据
|
||||
if(res.code === 401){
|
||||
closeWindowOpen();
|
||||
}
|
||||
if (jjDetailArr && res.list) {
|
||||
$.each(res.list, function (index, item) {
|
||||
$.each(jjDetailArr, function (index2, item2) {
|
||||
if (item.id === item2.id) {
|
||||
item.needNum = item2.needNum;
|
||||
item.tiems = item2.tiems;
|
||||
item.remarks = item2.remarks;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
return {
|
||||
"code": 0, // 解析接口状态
|
||||
"msg": '获取成功', // 解析提示文本
|
||||
"count": res.total, // 解析数据长度
|
||||
"data": res.list // 解析数据列表
|
||||
};
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{ type: 'checkbox', width: '5%' },
|
||||
{
|
||||
width: '6%',
|
||||
title: "序号",
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
return d.LAY_NUM;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "ppName",
|
||||
width: '10%',
|
||||
title: "物机类型",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
},
|
||||
{
|
||||
field: "pName",
|
||||
width: '10%',
|
||||
title: "物机名称",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
width: '10%',
|
||||
title: "规格",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
},
|
||||
{
|
||||
field: "unit",
|
||||
title: "单位",
|
||||
width: '10%',
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
},
|
||||
{
|
||||
field: "needNum",
|
||||
width: '15%',
|
||||
title: "<span style='color:red'> * </span>需用量",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
edit: 'text',
|
||||
style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;'
|
||||
},
|
||||
{
|
||||
field: "times",
|
||||
width: '15%',
|
||||
title: "<span style='color:red'> * </span>需用天数",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
edit: 'text',
|
||||
style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;',
|
||||
},
|
||||
{
|
||||
field: "remarks",
|
||||
width: '18.9%',
|
||||
title: "备注",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
edit: 'textarea',
|
||||
style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;'
|
||||
},
|
||||
|
||||
],
|
||||
],
|
||||
limits: [10, 15, 20, 25, 50, 100],
|
||||
limit: 10,
|
||||
page: true,
|
||||
done: function (res, curr, count) {
|
||||
table.resize("currentTableId");
|
||||
pageNum = tableIns.config.page.curr;
|
||||
//设置全部数据到全局变量
|
||||
quanju = res.data;
|
||||
for (var i = 0; i < res.data.length; i++) {
|
||||
for (var j = 0; j < huancun.length; j++) {
|
||||
//数据id和要勾选的id相同时checkbox选中
|
||||
if (res.data[i].id === huancun[j]) {
|
||||
//这里才是真正的有效勾选
|
||||
res.data[i]["LAY_CHECKED"] = 'true';
|
||||
//找到对应数据改变勾选样式,呈现出选中效果
|
||||
var index = res.data[i]['LAY_INDEX'];
|
||||
$('.layui-table tr[data-index=' + index + '] input[type="checkbox"]').prop('checked', true);
|
||||
$('.layui-table tr[data-index=' + index + '] input[type="checkbox"]').next().addClass('layui-form-checked');
|
||||
}
|
||||
}
|
||||
}
|
||||
//设置全选checkbox的选中状态,只有改变LAY_CHECKED的值, table.checkStatus才能抓取到选中的状态
|
||||
let checkStatus = table.checkStatus('currentTableId');//这里的lightTable是指分页中的id
|
||||
if (checkStatus.isAll) {//是否全选
|
||||
//layTableAllChoose
|
||||
$('.layui-table th[data-field="0"] input[type="checkbox"]').prop('checked', true);//data-field值默认为0,如果在分页部分自定义了属性名,则需要改成对应的属性名
|
||||
$('.layui-table th[data-field="0"] input[type="checkbox"]').next().addClass('layui-form-checked');//data-field值默认为0,如果在分页部分自定义了属性名,则需要改成对应的属性名
|
||||
}
|
||||
},
|
||||
});
|
||||
table.on('edit(currentTableId2)', function (obj) {
|
||||
var field = obj.field; // 得到修改的字段
|
||||
var value = obj.value // 得到修改后的值
|
||||
if (field === 'needNum' || field === 'times') { // 需用量 / 需用天数
|
||||
if (value) {
|
||||
const regex = /^(0|[1-9]\d{0,6})$/;
|
||||
if (!regex.test(value)) {
|
||||
obj.reedit();
|
||||
return layer.msg('格式不正确,最大输入6位数,且为正整数!', { icon: 7 })
|
||||
}
|
||||
}
|
||||
} else if (field === 'remarks') { // 备注
|
||||
if (value) {
|
||||
if (value.length > 255) {
|
||||
obj.reedit();
|
||||
return layer.msg('备注最多输入255位!', { icon: 7 })
|
||||
}
|
||||
}
|
||||
}
|
||||
// 显示 - 仅用于演示
|
||||
// layer.msg('[ID: ' + data.id + '] ' + field + ' 字段更改值为:' + util.escape(value));
|
||||
let id = obj.data.id;
|
||||
updateOrAddObject(id, obj.data);
|
||||
});
|
||||
//复选框选中监听,将选中的id 设置到缓存数组,或者删除缓存数组
|
||||
table.on('checkbox(currentTableId2)', function (obj) {
|
||||
if (obj.checked === true) {
|
||||
if (obj.type === 'one' && huancun.indexOf(obj.data.id) === -1) {
|
||||
huancun.push(obj.data.id);
|
||||
huancunObj.push(obj.data);
|
||||
} else {
|
||||
for (let i = 0; i < quanju.length; i++) {
|
||||
if (huancun.indexOf(quanju[i].id) === -1) {
|
||||
huancun.push(quanju[i].id);
|
||||
huancunObj.push(quanju[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (obj.type === 'one') {
|
||||
for (let i = 0; i < huancun.length; i++) {
|
||||
if (huancun[i] === obj.data.id) {
|
||||
removeByValue(huancun, huancun[i]);//调用自定义的根据值移除函数
|
||||
removeByValue(huancunObj, huancunObj[i]);//调用自定义的根据值移除函数
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < quanju.length; i++) {
|
||||
for (let j = 0; j < huancun.length; j++) {
|
||||
if (huancun[j] === quanju[i].id) {
|
||||
removeByValue(huancun, +huancun[j]);//调用自定义的根据值移除函数
|
||||
removeByValue(huancunObj, +huancunObj[j]);//调用自定义的根据值移除函数
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$('#num').html(huancun.length);
|
||||
});
|
||||
}
|
||||
|
||||
// 根据id 判断对象数组的对象是否存在 如果存在则替换,不存在则添加
|
||||
function updateOrAddObject(id, newObject) {
|
||||
const index = jjDetailArr.findIndex(obj => obj.id === id);
|
||||
if (index !== -1) {
|
||||
// 如果对象存在,则替换它
|
||||
jjDetailArr[index] = newObject;
|
||||
} else {
|
||||
// 如果对象不存在,则添加到数组
|
||||
jjDetailArr.push(newObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//自定义方法,根据值去移除
|
||||
function removeByValue(arr, val) {
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if (arr[i] == val) {
|
||||
arr.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < huancunObj.length; i++) {
|
||||
if (huancunObj[i].id == val) {
|
||||
huancunObj.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 保存数据
|
||||
function saveData2(params) {
|
||||
let dataArr = [];
|
||||
if (huancun.length === 0) {
|
||||
return layer.msg('未添加数据', { icon: 7 });
|
||||
} else {
|
||||
$.each(huancunObj, function (index, item) {
|
||||
dataArr.push(item);
|
||||
})
|
||||
for (let i = 0; i < huancun.length; i++) {
|
||||
const id = huancun[i];
|
||||
for (let j = 0; j < jjDetailArr.length; j++) {
|
||||
const obj = jjDetailArr[j];
|
||||
if (id === obj.id) {
|
||||
updateOrAddObject2(id, obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let layerIndex = layer.confirm('<h5 style="color:red">数据即将被添加,请仔细检查数据是否有错误!</h5>', { title: '操作提示' }, function () {
|
||||
layer.close(layerIndex);
|
||||
closePage(1, JSON.stringify(dataArr),"page1");
|
||||
});
|
||||
// 替换对象
|
||||
function updateOrAddObject2(id, newObject) {
|
||||
const index = dataArr.findIndex(obj => obj.id === id);
|
||||
if (index !== -1) {
|
||||
// 如果对象存在,则替换它
|
||||
dataArr[index] = newObject;
|
||||
} else {
|
||||
// 如果对象不存在,则添加到数组
|
||||
dataArr.push(newObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function closePage(type, params,pageSource) {
|
||||
let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
|
||||
if (type == 1) {
|
||||
window.parent.addFitDatas(params,pageSource);
|
||||
}
|
||||
parent.layer.close(index); // 再执行关闭
|
||||
}
|
||||
|
|
@ -0,0 +1,339 @@
|
|||
let objParam;
|
||||
let form, table, element, tableIns, layer, util;
|
||||
let pageNum = 1;
|
||||
let quanju = new Array();//全局
|
||||
let huancun = new Array();//缓存
|
||||
let huancunObj = new Array();//缓存2
|
||||
let cjList = [];
|
||||
let jjDetailArr = []; // 入库配件类型数据
|
||||
function setParams(obj) {
|
||||
objParam = JSON.parse(obj);
|
||||
layui.use(["form", "table", 'element', 'layer', 'util'], function () {
|
||||
form = layui.form;
|
||||
table = layui.table;
|
||||
element = layui.element;
|
||||
layer = layui.layer;
|
||||
util = layui.util;
|
||||
initTable();
|
||||
});
|
||||
}
|
||||
|
||||
// 查询/重置
|
||||
function queryTable(type) {
|
||||
if (type === 1) {
|
||||
let pName = $('#pName').val();
|
||||
let flag = checkValue(pName);
|
||||
if (flag) {
|
||||
$('#pName').val('');
|
||||
return layer.msg('物机名称查询包含特殊字符,请重新输入', { icon: 2 });
|
||||
}
|
||||
let name = $('#name').val();
|
||||
let flag2 = checkValue(name);
|
||||
if (flag2) {
|
||||
$('#name').val('');
|
||||
return layer.msg('规格查询包含特殊字符,请重新输入', { icon: 2 });
|
||||
}
|
||||
reloadTable(1);
|
||||
} else if (type === 2) {
|
||||
$('#pName').val('');
|
||||
$('#name').val('');
|
||||
layui.form.render();
|
||||
reloadTable(1);
|
||||
}
|
||||
}
|
||||
|
||||
// 重载表格
|
||||
function reloadTable(pageNum) {
|
||||
table.reload("currentTableId", {
|
||||
page: {
|
||||
curr: pageNum ? pageNum : 1,
|
||||
},
|
||||
where: {
|
||||
encryptedData: JSON.stringify({
|
||||
'pName': $('#pName').val(),
|
||||
'name': $('#name').val(),
|
||||
}),
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// 表格数据
|
||||
function initTable() {
|
||||
tableIns = table.render({
|
||||
elem: "#currentTableId",
|
||||
id: 'currentTableId',
|
||||
height: "full-200",
|
||||
headers: {
|
||||
authorization: sessionStorage.getItem("gz-token"),
|
||||
},
|
||||
url: dataUrl + "backstage/planApplication/getTypeList",
|
||||
where: {
|
||||
encryptedData: JSON.stringify({
|
||||
'pName': $('#pName').val(),
|
||||
'name': $('#name').val(),
|
||||
}),
|
||||
},
|
||||
request: {
|
||||
pageName: 'pageNum',
|
||||
limitName: 'pageSize'
|
||||
},
|
||||
parseData: function (res) { // res 即为原始返回的数据
|
||||
if(res.code === 401){
|
||||
closeWindowOpen();
|
||||
}
|
||||
if (jjDetailArr && res.list) {
|
||||
$.each(res.list, function (index, item) {
|
||||
$.each(jjDetailArr, function (index2, item2) {
|
||||
if (item.id === item2.id) {
|
||||
item.needNum = item2.needNum;
|
||||
item.tiems = item2.tiems;
|
||||
item.remarks = item2.remarks;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
return {
|
||||
"code": 0, // 解析接口状态
|
||||
"msg": '获取成功', // 解析提示文本
|
||||
"count": res.total, // 解析数据长度
|
||||
"data": res.list // 解析数据列表
|
||||
};
|
||||
},
|
||||
cols: [
|
||||
[
|
||||
{ type: 'checkbox', width: '5%' },
|
||||
{
|
||||
width: '6%',
|
||||
title: "序号",
|
||||
align: "center",
|
||||
templet: function (d) {
|
||||
return d.LAY_NUM;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "ppName",
|
||||
width: '10%',
|
||||
title: "物机类型",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
},
|
||||
{
|
||||
field: "pName",
|
||||
width: '10%',
|
||||
title: "物机名称",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
width: '10%',
|
||||
title: "规格",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
},
|
||||
{
|
||||
field: "unit",
|
||||
title: "单位",
|
||||
width: '10%',
|
||||
unresize: true,
|
||||
align: "center",
|
||||
sort:true,
|
||||
},
|
||||
{
|
||||
field: "needNum",
|
||||
width: '15%',
|
||||
title: "<span style='color:red'> * </span>需用量",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
edit: 'text',
|
||||
style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;'
|
||||
},
|
||||
{
|
||||
field: "times",
|
||||
width: '15%',
|
||||
title: "<span style='color:red'> * </span>需用天数",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
edit: 'text',
|
||||
style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;',
|
||||
},
|
||||
{
|
||||
field: "remarks",
|
||||
width: '18.9%',
|
||||
title: "备注",
|
||||
unresize: true,
|
||||
align: "center",
|
||||
edit: 'textarea',
|
||||
style: 'outline: 1px solid #e6e6e6;outline-offset: -5px;'
|
||||
},
|
||||
|
||||
],
|
||||
],
|
||||
limits: [10, 15, 20, 25, 50, 100],
|
||||
limit: 10,
|
||||
page: true,
|
||||
done: function (res, curr, count) {
|
||||
table.resize("currentTableId");
|
||||
pageNum = tableIns.config.page.curr;
|
||||
//设置全部数据到全局变量
|
||||
quanju = res.data;
|
||||
for (var i = 0; i < res.data.length; i++) {
|
||||
for (var j = 0; j < huancun.length; j++) {
|
||||
//数据id和要勾选的id相同时checkbox选中
|
||||
if (res.data[i].id === huancun[j]) {
|
||||
//这里才是真正的有效勾选
|
||||
res.data[i]["LAY_CHECKED"] = 'true';
|
||||
//找到对应数据改变勾选样式,呈现出选中效果
|
||||
var index = res.data[i]['LAY_INDEX'];
|
||||
$('.layui-table tr[data-index=' + index + '] input[type="checkbox"]').prop('checked', true);
|
||||
$('.layui-table tr[data-index=' + index + '] input[type="checkbox"]').next().addClass('layui-form-checked');
|
||||
}
|
||||
}
|
||||
}
|
||||
//设置全选checkbox的选中状态,只有改变LAY_CHECKED的值, table.checkStatus才能抓取到选中的状态
|
||||
let checkStatus = table.checkStatus('currentTableId');//这里的lightTable是指分页中的id
|
||||
if (checkStatus.isAll) {//是否全选
|
||||
//layTableAllChoose
|
||||
$('.layui-table th[data-field="0"] input[type="checkbox"]').prop('checked', true);//data-field值默认为0,如果在分页部分自定义了属性名,则需要改成对应的属性名
|
||||
$('.layui-table th[data-field="0"] input[type="checkbox"]').next().addClass('layui-form-checked');//data-field值默认为0,如果在分页部分自定义了属性名,则需要改成对应的属性名
|
||||
}
|
||||
},
|
||||
});
|
||||
table.on('edit(currentTableId2)', function (obj) {
|
||||
var field = obj.field; // 得到修改的字段
|
||||
var value = obj.value // 得到修改后的值
|
||||
if (field === 'needNum' || field === 'times') { // 需用量 / 需用天数
|
||||
if (value) {
|
||||
const regex = /^(0|[1-9]\d{0,6})$/;
|
||||
if (!regex.test(value)) {
|
||||
obj.reedit();
|
||||
return layer.msg('格式不正确,最大输入6位数,且为正整数!', { icon: 7 })
|
||||
}
|
||||
}
|
||||
} else if (field === 'remarks') { // 备注
|
||||
if (value) {
|
||||
if (value.length > 255) {
|
||||
obj.reedit();
|
||||
return layer.msg('备注最多输入255位!', { icon: 7 })
|
||||
}
|
||||
}
|
||||
}
|
||||
// 显示 - 仅用于演示
|
||||
// layer.msg('[ID: ' + data.id + '] ' + field + ' 字段更改值为:' + util.escape(value));
|
||||
let id = obj.data.id;
|
||||
updateOrAddObject(id, obj.data);
|
||||
});
|
||||
//复选框选中监听,将选中的id 设置到缓存数组,或者删除缓存数组
|
||||
table.on('checkbox(currentTableId2)', function (obj) {
|
||||
if (obj.checked === true) {
|
||||
if (obj.type === 'one' && huancun.indexOf(obj.data.id) === -1) {
|
||||
huancun.push(obj.data.id);
|
||||
huancunObj.push(obj.data);
|
||||
} else {
|
||||
for (let i = 0; i < quanju.length; i++) {
|
||||
if (huancun.indexOf(quanju[i].id) === -1) {
|
||||
huancun.push(quanju[i].id);
|
||||
huancunObj.push(quanju[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (obj.type === 'one') {
|
||||
for (let i = 0; i < huancun.length; i++) {
|
||||
if (huancun[i] === obj.data.id) {
|
||||
removeByValue(huancun, huancun[i]);//调用自定义的根据值移除函数
|
||||
removeByValue(huancunObj, huancunObj[i]);//调用自定义的根据值移除函数
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < quanju.length; i++) {
|
||||
for (let j = 0; j < huancun.length; j++) {
|
||||
if (huancun[j] === quanju[i].id) {
|
||||
removeByValue(huancun, +huancun[j]);//调用自定义的根据值移除函数
|
||||
removeByValue(huancunObj, +huancunObj[j]);//调用自定义的根据值移除函数
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$('#num').html(huancun.length);
|
||||
});
|
||||
}
|
||||
|
||||
// 根据id 判断对象数组的对象是否存在 如果存在则替换,不存在则添加
|
||||
function updateOrAddObject(id, newObject) {
|
||||
const index = jjDetailArr.findIndex(obj => obj.id === id);
|
||||
if (index !== -1) {
|
||||
// 如果对象存在,则替换它
|
||||
jjDetailArr[index] = newObject;
|
||||
} else {
|
||||
// 如果对象不存在,则添加到数组
|
||||
jjDetailArr.push(newObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//自定义方法,根据值去移除
|
||||
function removeByValue(arr, val) {
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if (arr[i] == val) {
|
||||
arr.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < huancunObj.length; i++) {
|
||||
if (huancunObj[i].id == val) {
|
||||
huancunObj.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 保存数据
|
||||
function saveData2(params) {
|
||||
let dataArr = [];
|
||||
if (huancun.length === 0) {
|
||||
return layer.msg('未添加数据', { icon: 7 });
|
||||
} else {
|
||||
$.each(huancunObj, function (index, item) {
|
||||
dataArr.push(item);
|
||||
})
|
||||
for (let i = 0; i < huancun.length; i++) {
|
||||
const id = huancun[i];
|
||||
for (let j = 0; j < jjDetailArr.length; j++) {
|
||||
const obj = jjDetailArr[j];
|
||||
if (id === obj.id) {
|
||||
updateOrAddObject2(id, obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let layerIndex = layer.confirm('<h5 style="color:red">数据即将被添加,请仔细检查数据是否有错误!</h5>', { title: '操作提示' }, function () {
|
||||
layer.close(layerIndex);
|
||||
closePage(1, JSON.stringify(dataArr));
|
||||
});
|
||||
// 替换对象
|
||||
function updateOrAddObject2(id, newObject) {
|
||||
const index = dataArr.findIndex(obj => obj.id === id);
|
||||
if (index !== -1) {
|
||||
// 如果对象存在,则替换它
|
||||
dataArr[index] = newObject;
|
||||
} else {
|
||||
// 如果对象不存在,则添加到数组
|
||||
dataArr.push(newObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function closePage(type, params) {
|
||||
let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe层的索引
|
||||
if (type == 1) {
|
||||
window.parent.addFitDatas(params);
|
||||
}
|
||||
parent.layer.close(index); // 再执行关闭
|
||||
}
|
||||
|
|
@ -51,6 +51,17 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline" style="display: flex;width:100%">
|
||||
<label class="layui-form-label required" style="width: 100px !important;">申请类型</label>
|
||||
<div>
|
||||
<input type="checkbox" name="applyType" value="tool" title="机具需求" lay-skin="primary" onchange="toggleDetails('tool-details','tool')">
|
||||
<input type="checkbox" name="applyType" value="safety-tool" title="安全工器具需求" lay-skin="primary" onchange="toggleDetails('safety-tool-details','safety-tool')">
|
||||
<input type="checkbox" name="applyType" value="crane" title="吊车需求" lay-skin="primary" onchange="toggleDetails('crane-details','crane')">
|
||||
<input type="checkbox" name="applyType" value="vehicle" title="运输车辆需求" lay-skin="primary" onchange="toggleDetails('vehicle-details','vehicle')">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required" style="width: 100px !important;">计划说明</label>
|
||||
<div class="layui-input-inline" style="width: 764px;">
|
||||
|
|
@ -58,10 +69,75 @@
|
|||
class="layui-textarea" maxLength="250" lay-affix="clear"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" id="formSubmit" class="layui-btn" lay-submit="" lay-filter="formData"
|
||||
style="display: none;"></button>
|
||||
<button type="submit" id="formSubmit" class="layui-btn" lay-submit="" lay-filter="formData" lay-verify="atLeastOne"
|
||||
style="display: none;"></button>
|
||||
</form>
|
||||
<div class="title layout">
|
||||
<div id="tool-details" style="display: none;">
|
||||
<div class="title layout" >
|
||||
<span style="font-weight:700;text-decoration:none;color:#409EFF;">▋</span>
|
||||
<p>机具明细</p>
|
||||
</div>
|
||||
<!-- 无数据时-展示 -->
|
||||
<div id="no_data_titleJJ" class="layout">
|
||||
<img src="../../../images/no_data_icon.png" alt="无数据">
|
||||
<p style="font-size: 16px;font-weight: bold;">您还没选择需用机具类型</p>
|
||||
<p style="color: #999999;">请先添加机具类型后再执申请操作</p>
|
||||
<button class="layui-btn layui-bg-blue" onclick="chooseFitTypeOne()">选择类型</button>
|
||||
</div>
|
||||
<!-- 有数据时-展示 -->
|
||||
<fieldset class="table-search-fieldset" id="search-infoJJ" style="display: none;">
|
||||
<legend>搜索信息</legend>
|
||||
<div style="margin: 10px 10px 10px 10px">
|
||||
<form class="layui-form layui-form-pane" action="#" onsubmit="return false;">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="width: 200px;">
|
||||
<input type="text" name="pName" id="pName" autocomplete="off" class="layui-input"
|
||||
lay-affix="clear" placeholder="输入物机名称" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="width: 200px;">
|
||||
<input type="text" name="name" id="name" autocomplete="off" class="layui-input"
|
||||
lay-affix="clear" placeholder="输入规格" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn layui-bg-blue" onclick="search()"><i class="layui-icon"></i> 搜
|
||||
索</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="resetSearch()"><i
|
||||
class="layui-icon layui-icon-refresh"></i> 重 置</button>
|
||||
<button class="layui-btn layui-bg-blue" onclick="chooseFitTypeOne()">选择机具</button>
|
||||
<button class="layui-btn layui-bg-red" onclick="delFitType()">删除选中</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="table-box" table-responsive style="display: none;" id="table-boxJJ">
|
||||
<table id="baseTableJJ" class="classTable table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 5%" class="center">
|
||||
<input id="allCheckJJ" onclick="selectAll(this.checked)" type="checkbox">
|
||||
</th>
|
||||
<th style="width: 5%" class="center">序号</th>
|
||||
<th style="width: 10%" class="center">物机类型</th>
|
||||
<th style="width: 15%" class="center">物机名称</th>
|
||||
<th style="width: 10%" class="center">规格</th>
|
||||
<th style="width: 10%" class="center">单位</th>
|
||||
<th style="width: 15%" class="center"><span style="color: red;">*</span>需用量</th>
|
||||
<th style="width: 15%" class="center"><span style="color: red;">*</span>需用天数</th>
|
||||
<th style="width: 15%" class="center">备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="safety-tool-details" style="display: none;">
|
||||
<div class="title layout" >
|
||||
<span style="font-weight:700;text-decoration:none;color:#409EFF;">▋</span>
|
||||
<p>安全工器具明细</p>
|
||||
</div>
|
||||
|
|
@ -69,8 +145,8 @@
|
|||
<div id="no_data_title" class="layout">
|
||||
<img src="../../../images/no_data_icon.png" alt="无数据">
|
||||
<p style="font-size: 16px;font-weight: bold;">您还没选择需用安全工器具类型</p>
|
||||
<p style="color: #999999;">请先添加请你工器具类型后再执申请操作</p>
|
||||
<button class="layui-btn layui-bg-blue" onclick="chooseFitType()">选择类型</button>
|
||||
<p style="color: #999999;">请先添加工器具类型后再执申请操作</p>
|
||||
<button class="layui-btn layui-bg-blue" onclick="chooseFitTypeTwo()">选择类型</button>
|
||||
</div>
|
||||
<fieldset class="table-search-fieldset" id="search-info" style="display: none;">
|
||||
<legend>搜索信息</legend>
|
||||
|
|
@ -94,7 +170,7 @@
|
|||
索</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="resetSearch()"><i
|
||||
class="layui-icon layui-icon-refresh"></i> 重 置</button>
|
||||
<button class="layui-btn layui-bg-blue" onclick="chooseFitType()">选择类型</button>
|
||||
<button class="layui-btn layui-bg-blue" onclick="chooseFitTypeTwo()">选择类型</button>
|
||||
<button class="layui-btn layui-bg-red" onclick="delFitType()">删除选中</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -121,7 +197,209 @@
|
|||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div id="crane-details" style="display: none;">
|
||||
<div class="title layout" >
|
||||
<span style="font-weight:700;text-decoration:none;color:#409EFF;">▋</span>
|
||||
<p>吊车明细</p>
|
||||
</div>
|
||||
<div id="no_data_titleDC" class="layout">
|
||||
<img src="../../../images/no_data_icon.png" alt="无数据">
|
||||
<p style="font-size: 16px;font-weight: bold;">您还没选择需用车辆吊车类型</p>
|
||||
<p style="color: #999999;">请先添加吊车类型后再执申请操作</p>
|
||||
<button class="layui-btn layui-bg-blue" onclick="chooseFitTypeThree()">选择类型</button>
|
||||
</div>
|
||||
<!-- 有数据时-展示 -->
|
||||
<fieldset class="table-search-fieldset" id="search-infoDC" style="display: none;">
|
||||
<legend>搜索信息</legend>
|
||||
<div style="margin: 10px 10px 10px 10px">
|
||||
<form class="layui-form layui-form-pane" action="#" onsubmit="return false;">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="width: 200px;">
|
||||
<input type="text" name="pName" id="pName1" autocomplete="off" class="layui-input"
|
||||
lay-affix="clear" placeholder="输入物机名称" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="width: 200px;">
|
||||
<input type="text" name="name" id="name1" autocomplete="off" class="layui-input"
|
||||
lay-affix="clear" placeholder="输入规格" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn layui-bg-blue" onclick="search()"><i class="layui-icon"></i> 搜
|
||||
索</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="resetSearch()"><i
|
||||
class="layui-icon layui-icon-refresh"></i> 重 置</button>
|
||||
<button class="layui-btn layui-bg-blue" onclick="chooseFitTypeThree()">选择机具</button>
|
||||
<button class="layui-btn layui-bg-red" onclick="delFitType()">删除选中</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="table-box" table-responsive style="display: none;" id="table-boxDC">
|
||||
<table id="baseTableDC" class="classTable table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 5%" class="center">
|
||||
<input id="allCheckDC" onclick="selectAll(this.checked)" type="checkbox">
|
||||
</th>
|
||||
<th style="width: 5%" class="center">序号</th>
|
||||
<th style="width: 10%" class="center">物机类型</th>
|
||||
<th style="width: 15%" class="center">物机名称</th>
|
||||
<th style="width: 10%" class="center">规格</th>
|
||||
<th style="width: 10%" class="center">单位</th>
|
||||
<th style="width: 15%" class="center"><span style="color: red;">*</span>需用量</th>
|
||||
<th style="width: 15%" class="center"><span style="color: red;">*</span>需用天数</th>
|
||||
<th style="width: 15%" class="center">备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div id="vehicle-details" style="display: none;">
|
||||
<div class="title layout" >
|
||||
<span style="font-weight:700;text-decoration:none;color:#409EFF;">▋</span>
|
||||
<p>运输车辆明细</p>
|
||||
</div>
|
||||
<form id="formTwo" class="layui-form layuimini-form" onclick="return false;">
|
||||
<div class="layui-form-item" style="display: flex;">
|
||||
<div class="layui-inline" style="display: flex;">
|
||||
<label class="layui-form-label required" style="width: 120px !important;">所需运输车辆车长</label>
|
||||
<div class="layui-input-inline" style="display: flex;">
|
||||
<input class="layui-input" name="carLength" id="carLength" autocomplete="off"
|
||||
lay-verify="required" maxlength="50" lay-affix="clear" style="width: 150px;" type="number">
|
||||
<span style="margin-left: 5px;margin-top:10px">米</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline" style="display: flex;">
|
||||
<label class="layui-form-label required" style="width: 120px !important;">所需运输车辆车宽</label>
|
||||
<div class="layui-input-inline" style="display: flex;">
|
||||
<input class="layui-input" name="carWidth" id="carWidth" autocomplete="off"
|
||||
lay-verify="required" maxlength="50" lay-affix="clear" style="width: 150px;" type="number">
|
||||
<span style="margin-left: 5px;margin-top:10px">米</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline" style="display: flex;">
|
||||
<label class="layui-form-label required" style="width: 120px !important;">所需运输车辆车高</label>
|
||||
<div class="layui-input-inline" style="display: flex;">
|
||||
<input class="layui-input" name="carHeight" id="carHeight" autocomplete="off"
|
||||
lay-verify="required" maxlength="50" lay-affix="clear" style="width: 150px;" type="number">
|
||||
<span style="margin-left: 5px;margin-top:10px">米</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="display: flex;">
|
||||
<div class="layui-inline" style="display: flex;">
|
||||
<label class="layui-form-label required" style="width: 120px !important;">预计运输物品重量</label>
|
||||
<div class="layui-input-inline" style="display: flex;">
|
||||
<input class="layui-input" name="carWeight" id="carWeight" autocomplete="off"
|
||||
lay-verify="required" maxlength="50" lay-affix="clear" style="width: 150px;" type="number">
|
||||
<span style="margin-left: 5px;margin-top:10px">吨</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline" style="display: flex;">
|
||||
<label class="layui-form-label required" style="width: 120px !important;">运输起点</label>
|
||||
<div class="layui-input-inline" style="display: flex;">
|
||||
<input class="layui-input" name="carStart" id="carStart" autocomplete="off"
|
||||
lay-verify="required" maxlength="50" lay-affix="clear" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline" style="display: flex;">
|
||||
<label class="layui-form-label required" style="width: 120px !important;">运输终点</label>
|
||||
<div class="layui-input-inline" style="display: flex;">
|
||||
<input class="layui-input" name="carEnd" id="carEnd" autocomplete="off"
|
||||
lay-verify="required" maxlength="50" lay-affix="clear" style="width: 150px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" id="formSubmitTwo" class="layui-btn" lay-submit="" lay-filter="formDataTwo"
|
||||
style="display: none;"></button>
|
||||
</form>
|
||||
<div class="layui-upload" style="padding: 0 39px;">
|
||||
<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;width: auto;border: none;">
|
||||
<p>上传附件<span class="required">*</span></p>
|
||||
<div class="layui-upload-list uploader-list" style="overflow: auto;" id="uploader-list"></div>
|
||||
<div id="test2" style="margin-left: 10px;">
|
||||
<img src="../../../images/add.png">
|
||||
</div>
|
||||
<div class="layout" style="flex-direction: column;margin-left: 2px;">
|
||||
<p style="color: red;">请上传运输起始点高德地图截图</p>
|
||||
<!-- <p style="color: red;">支持格式:jpg、png、jpeg</p>-->
|
||||
<!-- <p style="color: red;">doc、docx、pdf、xlsx、xls</p>-->
|
||||
</div>
|
||||
</blockquote>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="no_data_titleYS" class="layout">
|
||||
<img src="../../../images/no_data_icon.png" alt="无数据">
|
||||
<p style="font-size: 16px;font-weight: bold;">您还没选择需用车辆类型</p>
|
||||
<p style="color: #999999;">请先添加运输车辆类型后再执申请操作</p>
|
||||
<button class="layui-btn layui-bg-blue" onclick="chooseFitTypeFour()">选择类型</button>
|
||||
</div>
|
||||
<!-- 有数据时-展示 -->
|
||||
<fieldset class="table-search-fieldset" id="search-infoYS" style="display: none;">
|
||||
<legend>搜索信息</legend>
|
||||
<div style="margin: 10px 10px 10px 10px">
|
||||
<form class="layui-form layui-form-pane" action="#" onsubmit="return false;">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="width: 200px;">
|
||||
<input type="text" name="pName" id="pName2" autocomplete="off" class="layui-input"
|
||||
lay-affix="clear" placeholder="输入物机名称" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="width: 200px;">
|
||||
<input type="text" name="name" id="name2" autocomplete="off" class="layui-input"
|
||||
lay-affix="clear" placeholder="输入规格" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn layui-bg-blue" onclick="search()"><i class="layui-icon"></i> 搜
|
||||
索</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="resetSearch()"><i
|
||||
class="layui-icon layui-icon-refresh"></i> 重 置</button>
|
||||
<button class="layui-btn layui-bg-blue" onclick="chooseFitTypeFour()">选择机具</button>
|
||||
<button class="layui-btn layui-bg-red" onclick="delFitType()">删除选中</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="table-box" table-responsive style="display: none;" id="table-boxYS">
|
||||
<table id="baseTableYS" class="classTable table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 5%" class="center">
|
||||
<input id="allCheckYS" onclick="selectAll(this.checked)" type="checkbox">
|
||||
</th>
|
||||
<th style="width: 5%" class="center">序号</th>
|
||||
<th style="width: 10%" class="center">物机类型</th>
|
||||
<th style="width: 15%" class="center">物机名称</th>
|
||||
<th style="width: 10%" class="center">规格</th>
|
||||
<th style="width: 10%" class="center">单位</th>
|
||||
<th style="width: 15%" class="center"><span style="color: red;">*</span>需用量</th>
|
||||
<th style="width: 15%" class="center"><span style="color: red;">*</span>需用天数</th>
|
||||
<th style="width: 15%" class="center">备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="btn-box">
|
||||
<button class="layui-btn layui-bg-blue save" onclick="saveData2()">提交申请</button>
|
||||
<button class="layui-btn layui-btn-primary cancel" onclick="closePage()">返回</button>
|
||||
|
|
@ -133,5 +411,4 @@
|
|||
<script src="../../../lib/layui-v2.9.18/layui/layui.js" charset="utf-8"></script>
|
||||
<script src="../../../js/aq_demand_plan/child/apply_plan_form.js" charset="utf-8"></script>
|
||||
<script src="../../../js/openIframe.js" charset="utf-8"></script>
|
||||
|
||||
</html>
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
<!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>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.layui-table-view .layui-table th {
|
||||
font-size: 18px;
|
||||
color: #262626;
|
||||
letter-spacing: 1px;
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
.btn-box {
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<div class="layuimini-container">
|
||||
<div class="layuimini-main">
|
||||
<fieldset class="table-search-fieldset">
|
||||
<legend>搜索信息</legend>
|
||||
<div style="margin: 10px 10px 10px 10px">
|
||||
<form class="layui-form layui-form-pane" action="#" onsubmit="return false;">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="width: 250px;">
|
||||
<input type="text" name="pName" id="pName" autocomplete="off"
|
||||
class="layui-input" lay-affix="clear" placeholder="输入物机名称" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="width: 250px;">
|
||||
<input type="text" name="name" id="name" autocomplete="off"
|
||||
class="layui-input" lay-affix="clear" placeholder="输入规格" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn layui-bg-blue" onclick="queryTable(1)"><i
|
||||
class="layui-icon"></i> 搜 索</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="queryTable(2)"><i
|
||||
class="layui-icon layui-icon-refresh"></i> 重 置</button>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<p style="color: red;font-weight: bold;">已选:<span id="num">0</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="table-box" table-responsive style="z-index: 1;">
|
||||
<table class="layui-hide" id="currentTableId" lay-filter="currentTableId2"></table>
|
||||
</div>
|
||||
<div class="btn-box">
|
||||
<button class="layui-btn layui-bg-blue save" onclick="saveData2()">确定</button>
|
||||
<button class="layui-btn layui-btn-primary cancel" onclick="closePage()">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="../../../lib/jquery-3.4.1/jquery-3.4.1.min.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/aq_demand_plan/child/choose_tool_type_list.js" charset="utf-8"></script>
|
||||
<script src="../../../js/openIframe.js" charset="utf-8"></script>
|
||||
|
||||
</html>
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
<!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>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.layui-table-view .layui-table th {
|
||||
font-size: 18px;
|
||||
color: #262626;
|
||||
letter-spacing: 1px;
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
.btn-box {
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<div class="layuimini-container">
|
||||
<div class="layuimini-main">
|
||||
<fieldset class="table-search-fieldset">
|
||||
<legend>搜索信息</legend>
|
||||
<div style="margin: 10px 10px 10px 10px">
|
||||
<form class="layui-form layui-form-pane" action="#" onsubmit="return false;">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="width: 250px;">
|
||||
<input type="text" name="pName" id="pName" autocomplete="off"
|
||||
class="layui-input" lay-affix="clear" placeholder="输入物机名称" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="width: 250px;">
|
||||
<input type="text" name="name" id="name" autocomplete="off"
|
||||
class="layui-input" lay-affix="clear" placeholder="输入规格" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn layui-bg-blue" onclick="queryTable(1)"><i
|
||||
class="layui-icon"></i> 搜 索</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="queryTable(2)"><i
|
||||
class="layui-icon layui-icon-refresh"></i> 重 置</button>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<p style="color: red;font-weight: bold;">已选:<span id="num">0</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="table-box" table-responsive style="z-index: 1;">
|
||||
<table class="layui-hide" id="currentTableId" lay-filter="currentTableId2"></table>
|
||||
</div>
|
||||
<div class="btn-box">
|
||||
<button class="layui-btn layui-bg-blue save" onclick="saveData2()">确定</button>
|
||||
<button class="layui-btn layui-btn-primary cancel" onclick="closePage()">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="../../../lib/jquery-3.4.1/jquery-3.4.1.min.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/aq_demand_plan/child/choose_tool_type_list.js" charset="utf-8"></script>
|
||||
<script src="../../../js/openIframe.js" charset="utf-8"></script>
|
||||
|
||||
</html>
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
<!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>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.layui-table-view .layui-table th {
|
||||
font-size: 18px;
|
||||
color: #262626;
|
||||
letter-spacing: 1px;
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
.btn-box {
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<div class="layuimini-container">
|
||||
<div class="layuimini-main">
|
||||
<fieldset class="table-search-fieldset">
|
||||
<legend>搜索信息</legend>
|
||||
<div style="margin: 10px 10px 10px 10px">
|
||||
<form class="layui-form layui-form-pane" action="#" onsubmit="return false;">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="width: 250px;">
|
||||
<input type="text" name="pName" id="pName" autocomplete="off"
|
||||
class="layui-input" lay-affix="clear" placeholder="输入物机名称" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="width: 250px;">
|
||||
<input type="text" name="name" id="name" autocomplete="off"
|
||||
class="layui-input" lay-affix="clear" placeholder="输入规格" maxlength="30">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn layui-bg-blue" onclick="queryTable(1)"><i
|
||||
class="layui-icon"></i> 搜 索</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="queryTable(2)"><i
|
||||
class="layui-icon layui-icon-refresh"></i> 重 置</button>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<p style="color: red;font-weight: bold;">已选:<span id="num">0</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="table-box" table-responsive style="z-index: 1;">
|
||||
<table class="layui-hide" id="currentTableId" lay-filter="currentTableId2"></table>
|
||||
</div>
|
||||
<div class="btn-box">
|
||||
<button class="layui-btn layui-bg-blue save" onclick="saveData2()">确定</button>
|
||||
<button class="layui-btn layui-btn-primary cancel" onclick="closePage()">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="../../../lib/jquery-3.4.1/jquery-3.4.1.min.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/aq_demand_plan/child/choose_tool_type_list.js" charset="utf-8"></script>
|
||||
<script src="../../../js/openIframe.js" charset="utf-8"></script>
|
||||
|
||||
</html>
|
||||
Loading…
Reference in New Issue