提交 8c0856e7 编写于 作者: doc_wei's avatar doc_wei

BOM清单商品选择修改,删除多余接口的调用

上级 95e2dabf
//bom表商品选择必备参数
var productMationList = [];//选择的商品列表
// bom表商品选择必备参数
var materialMationList = [];
//工序选择必备参数
var procedureCheckType = 2;//工序选择类型:1.单选procedureMation;2.多选procedureMationList
......@@ -34,12 +34,12 @@ layui.config({
var childObject = new Array();
var wheatherError = false;
$.each(ztreeNode, function(i, item) {
item.needNum = $("#needNum" + item.productId).val();
item.type = $("#type" + item.productId).val();
item.wastagePrice = $("#wastage" + item.productId).val();
item.remark = $("#remark" + item.productId).val();
item.needNum = $("#needNum" + item.materialId).val();
item.type = $("#type" + item.materialId).val();
item.wastagePrice = $("#wastage" + item.materialId).val();
item.remark = $("#remark" + item.materialId).val();
childObject.push(item);
if(item.productId == erpOrderUtil.chooseProductMation.productId){
if(item.materialId == erpOrderUtil.chooseProductMation.materialId){
winui.window.msg('子件清单中不能包含父件信息。', {icon: 2, time: 2000});
wheatherError = true;
return false;
......@@ -109,7 +109,7 @@ layui.config({
},
simpleData: {
enable: true,
idKey: 'productId',
idKey: 'materialId',
pIdKey: 'pId',
rootPId: 0
}
......@@ -147,7 +147,7 @@ layui.config({
}
//刷新节点数据重置金额
$.each(ztreeNode, function(i, item) {
$("#allPrice" + item.productId).html(parseInt(item.needNum) * parseFloat(item.unitPrice));
$("#allPrice" + item.materialId).html(parseInt(item.needNum) * parseFloat(item.unitPrice));
});
}
......@@ -166,7 +166,7 @@ layui.config({
var nodesIndex = -1;//拖拽节点所在索引
$.each(ztreeNode, function(i, item) {
//拖拽节点
if(item.productId == treeNodes[0].productId){
if(item.materialId == treeNodes[0].materialId){
nodesIndex = i;
return false;
}
......@@ -177,7 +177,7 @@ layui.config({
if('inner' == moveType){
//依然为父节点
if(nodesIndex >= 0){
ztreeNode[nodesIndex].pId = targetNode.productId;
ztreeNode[nodesIndex].pId = targetNode.materialId;
}
}
}
......@@ -205,7 +205,7 @@ layui.config({
//删除节点操作
function deleteNode(treeNode){
$.each(ztreeNode, function(i, item) {
if(item.productId == treeNode.productId){
if(item.materialId == treeNode.materialId){
treeNodeIndex = i;
return false;
}
......@@ -251,7 +251,7 @@ layui.config({
switchObj.before(spaceStr);
aObj.append(getDataUseHandlebars($("#tableBody").html(), treeNode));
//设置商品来源选中
$("#type" + treeNode.productId).val(treeNode.type);
$("#type" + treeNode.materialId).val(treeNode.type);
form.render("select");
}
......@@ -262,15 +262,15 @@ layui.config({
//新增子件
$("body").on("click", "#addRow", function (e) {
productMationList = [];
materialMationList = [];
_openNewWindows({
url: "../../tpl/material/materialChooseToProduce.html",
title: "选择商品",
pageId: "materialChooseToProduce",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
$.each(productMationList, function(i, item) {
if(!inZtreeNode(item.productId)){
$.each(materialMationList, function(i, item) {
if(!inZtreeNode(item.materialId)){
ztreeNode.push(item);
}
});
......@@ -284,7 +284,7 @@ layui.config({
var proId = $(this).attr("id").replace("procedureSel", "");
var selIndex = -1;
$.each(ztreeNode, function(i, item) {
if(item.productId == proId){
if(item.materialId == proId){
selIndex = i;
return false;
}
......@@ -326,10 +326,10 @@ layui.config({
/**
* 判断该商品是否在树节点里面
*/
function inZtreeNode(productId){
function inZtreeNode(materialId){
var inNodeIndex = -1;
$.each(ztreeNode, function(i, item) {
if(item.productId == productId){
if(item.materialId == materialId){
inNodeIndex = i;
return false;
}
......@@ -355,7 +355,7 @@ layui.config({
function calculatedTotalPrice(proId, needNum){
var inNodeIndex = -1;
$.each(ztreeNode, function(i, item) {
if(item.productId == proId){
if(item.materialId == proId){
inNodeIndex = i;
return false;
}
......@@ -365,7 +365,7 @@ layui.config({
$("#allPrice" + proId).html(needNum * parseFloat(ztreeNode[inNodeIndex].unitPrice));
//修改节点信息
var zTree = $.fn.zTree.getZTreeObj("treeDemo");
var node = zTree.getNodeByParam("productId", proId);
var node = zTree.getNodeByParam("materialId", proId);
node.needNum = needNum;
zTree.updateNode(node);
}
......
//bom表商品选择必备参数
var productMationList = [];//选择的商品列表
// bom表商品选择必备参数
var materialMationList = [];
//工序选择必备参数
var procedureCheckType = 2;//工序选择类型:1.单选procedureMation;2.多选procedureMationList
......@@ -28,7 +28,7 @@ layui.config({
// 初始化父件商品信息
erpOrderUtil.chooseProductMation = {
materialId: json.bean.productId,
materialId: json.bean.materialId,
materialName: json.bean.productName,
materialModel: json.bean.productModel,
unitList: json.bean.unitList
......@@ -55,12 +55,12 @@ layui.config({
var childObject = new Array();
var wheatherError = false;
$.each(ztreeNode, function(i, item) {
item.needNum = $("#needNum" + item.productId).val();
item.type = $("#type" + item.productId).val();
item.wastagePrice = $("#wastage" + item.productId).val();
item.remark = $("#remark" + item.productId).val();
item.needNum = $("#needNum" + item.materialId).val();
item.type = $("#type" + item.materialId).val();
item.wastagePrice = $("#wastage" + item.materialId).val();
item.remark = $("#remark" + item.materialId).val();
childObject.push(item);
if(item.productId == erpOrderUtil.chooseProductMation.productId){
if(item.materialId == erpOrderUtil.chooseProductMation.materialId){
winui.window.msg('子件清单中不能包含父件信息。', {icon: 2, time: 2000});
wheatherError = true;
return false;
......@@ -129,7 +129,7 @@ layui.config({
},
simpleData: {
enable: true,
idKey: 'productId',
idKey: 'materialId',
pIdKey: 'pId',
rootPId: 0
}
......@@ -165,7 +165,7 @@ layui.config({
}
//刷新节点数据重置金额
$.each(ztreeNode, function(i, item) {
$("#allPrice" + item.productId).html(parseInt(item.needNum) * parseFloat(item.unitPrice));
$("#allPrice" + item.materialId).html(parseInt(item.needNum) * parseFloat(item.unitPrice));
});
}
......@@ -184,7 +184,7 @@ layui.config({
var nodesIndex = -1;//拖拽节点所在索引
$.each(ztreeNode, function(i, item) {
//拖拽节点
if(item.productId == treeNodes[0].productId){
if(item.materialId == treeNodes[0].materialId){
nodesIndex = i;
return false;
}
......@@ -195,7 +195,7 @@ layui.config({
if('inner' == moveType){
//依然为父节点
if(nodesIndex >= 0){
ztreeNode[nodesIndex].pId = targetNode.productId;
ztreeNode[nodesIndex].pId = targetNode.materialId;
}
}
}
......@@ -223,7 +223,7 @@ layui.config({
//删除节点操作
function deleteNode(treeNode){
$.each(ztreeNode, function(i, item) {
if(item.productId == treeNode.productId){
if(item.materialId == treeNode.materialId){
treeNodeIndex = i;
return false;
}
......@@ -269,7 +269,7 @@ layui.config({
switchObj.before(spaceStr);
aObj.append(getDataUseHandlebars($("#tableBody").html(), treeNode));
//设置商品来源选中
$("#type" + treeNode.productId).val(treeNode.type);
$("#type" + treeNode.materialId).val(treeNode.type);
form.render("select");
}
......@@ -280,15 +280,15 @@ layui.config({
//新增子件
$("body").on("click", "#addRow", function (e) {
productMationList = [];
materialMationList = [];
_openNewWindows({
url: "../../tpl/material/materialChooseToProduce.html",
title: "选择商品",
pageId: "materialChooseToProduce",
area: ['90vw', '90vh'],
callBack: function (refreshCode) {
$.each(productMationList, function(i, item) {
if(!inZtreeNode(item.productId)){
$.each(materialMationList, function(i, item) {
if(!inZtreeNode(item.materialId)){
ztreeNode.push(item);
}
});
......@@ -302,7 +302,7 @@ layui.config({
var proId = $(this).attr("id").replace("procedureSel", "");
var selIndex = -1;
$.each(ztreeNode, function(i, item) {
if(item.productId == proId){
if(item.materialId == proId){
selIndex = i;
return false;
}
......@@ -343,10 +343,10 @@ layui.config({
/**
* 判断该商品是否在树节点里面
*/
function inZtreeNode(productId){
function inZtreeNode(materialId){
var inNodeIndex = -1;
$.each(ztreeNode, function(i, item) {
if(item.productId == productId){
if(item.materialId == materialId){
inNodeIndex = i;
return false;
}
......@@ -372,7 +372,7 @@ layui.config({
function calculatedTotalPrice(proId, needNum){
var inNodeIndex = -1;
$.each(ztreeNode, function(i, item) {
if(item.productId == proId){
if(item.materialId == proId){
inNodeIndex = i;
return false;
}
......@@ -382,7 +382,7 @@ layui.config({
$("#allPrice" + proId).html(needNum * parseFloat(ztreeNode[inNodeIndex].unitPrice));
//修改节点信息
var zTree = $.fn.zTree.getZTreeObj("treeDemo");
var node = zTree.getNodeByParam("productId", proId);
var node = zTree.getNodeByParam("materialId", proId);
node.needNum = needNum;
zTree.updateNode(node);
}
......
......@@ -14,7 +14,7 @@ layui.config({
tableCheckBoxUtil = layui.tableCheckBoxUtil;
// 选择的多商品列表
productMationList = parent.productMationList;
materialMationList = parent.materialMationList;
// 设置提示信息
var s = "商品选择规则:1.多选;如没有查到要选择的商品,请检查商品信息是否满足当前规则。";
......@@ -30,18 +30,14 @@ layui.config({
function initTable(){
var ids = [];
$.each(productMationList, function(i, item) {
ids.push(item.productId);
});
tableCheckBoxUtil.setIds({
gridId: 'messageTable',
fieldName: 'materialId',
ids: ids
$.each(materialMationList, function(i, item) {
ids.push(item.materialId);
});
tableCheckBoxUtil.init({
gridId: 'messageTable',
filterId: 'messageTable',
fieldName: 'materialId'
fieldName: 'materialId',
ids: ids
});
table.render({
......@@ -67,13 +63,12 @@ layui.config({
str += '<span class="layui-badge layui-bg-gray">' + item.number + '</span>' + item.procedureName + '<br>';
});
return str;
}},
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 }
}}
]],
done: function(json, curr, count){
matchingLanguage();
// 设置选中
tableCheckBoxUtil.checkedDefault({
done: function (json, curr, count) {
matchingLanguage();
// 设置选中
tableCheckBoxUtil.checkedDefault({
gridId: 'messageTable',
fieldName: 'materialId'
});
......@@ -81,7 +76,7 @@ layui.config({
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入商品名称,型号", function () {
table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()});
});
}
}
});
form.render();
......@@ -96,51 +91,45 @@ layui.config({
// 下一步
$("body").on("click", "#nextTab", function() {
var selectedData = tableCheckBoxUtil.getValue({
var selectedData = tableCheckBoxUtil.getValueList({
gridId: 'messageTable'
});
if(selectedData.length == 0){
winui.window.msg("请选择商品", {icon: 2, time: 2000});
return false;
}
AjaxPostUtil.request({url: flowableBasePath + "material014", params: {ids: selectedData.toString()}, type: 'json', callback: function (json) {
productMationList = json.rows;
$step.nextStep();
$("#firstTab").hide();
$("#secondTab").show();
$("#tBody").html(getDataUseHandlebars($("#tableBody").html(), {rows: productMationList}));
//设置商品来源选中
$.each(productMationList, function(i, item) {
$("#type" + item.productId).val(item.typeId);
});
form.render();
}});
materialMationList = [].concat(selectedData);
$step.nextStep();
$("#firstTab").hide();
$("#secondTab").show();
$("#tBody").html(getDataUseHandlebars($("#tableBody").html(), {rows: materialMationList}));
// 设置商品来源选中
$.each(materialMationList, function(i, item) {
$("#type" + item.materialId).val(item.typeId);
});
form.render();
});
// 保存
$("body").on("click", "#saveChoose", function() {
var rows = $("#tBody tr");
if(rows.length == 0){
winui.window.msg("请选择商品", {icon: 2, time: 2000});
return false;
}
var proList = new Array();
$.each(rows, function(i, item) {
var _object = $(item);
var productId = _object.attr("rowid");
var materialId = _object.attr("rowid");
proList.push({
productId: productId,
productName: $("#name" + productId).html(),
productModel: $("#model" + productId).html(),
bomId: $("#bom" + productId).val(),
normsId: $("#norms" + productId).val(),
unitName: $("#norms" + productId).find("option:selected").text(),
procedureMationList: getProcedureMationList(productId),
materialId: materialId,
materialName: $("#name" + materialId).html(),
materialModel: $("#model" + materialId).html(),
bomId: $("#bom" + materialId).val(),
normsId: $("#norms" + materialId).val(),
unitName: $("#norms" + materialId).find("option:selected").text(),
procedureMationList: getProcedureMationList(materialId),
pId: '0',
needNum: '1',
unitPrice: getNormsPrice(productId, $("#norms" + productId).val()),
unitPrice: getNormsPrice(materialId, $("#norms" + materialId).val()),
wastagePrice: '0.00',
type: $("#type" + productId).val(),
type: $("#type" + materialId).val(),
remark: '',
open: 'true',
isParent: 1
......@@ -150,7 +139,7 @@ layui.config({
proList: JSON.stringify(proList)
};
AjaxPostUtil.request({url: flowableBasePath + "material015", params: params, type: 'json', callback: function(json) {
parent.productMationList = [].concat(json.rows);
parent.materialMationList = [].concat(json.rows);
parent.layer.close(index);
parent.refreshCode = '0';
}});
......@@ -159,16 +148,16 @@ layui.config({
/**
* 获取商品工序
*/
function getProcedureMationList(productId){
function getProcedureMationList(materialId) {
var proIndex = -1;
$.each(productMationList, function(i, item) {
if(productId == item.productId){
$.each(materialMationList, function (i, item) {
if (materialId == item.materialId) {
proIndex = i;
return false;
}
});
if(proIndex >= 0){
return productMationList[proIndex].procedureMationList;
if (proIndex >= 0) {
return materialMationList[proIndex].procedureMationList;
} else {
return new Array();
}
......@@ -177,13 +166,13 @@ layui.config({
/**
* 获取指定规格的采购价/成本价
*/
function getNormsPrice(productId, normsId){
function getNormsPrice(materialId, normsId){
//项目索引
var proIndex = -1;
//规格索引
var normsIndex = -1;
$.each(productMationList, function(i, item) {
if(productId == item.productId){
$.each(materialMationList, function(i, item) {
if(materialId == item.materialId){
proIndex = i;
$.each(item.unitList, function(j, bean){
normsIndex = j;
......@@ -193,7 +182,7 @@ layui.config({
}
});
if(proIndex >= 0 && normsIndex >= 0){
return productMationList[proIndex].unitList[normsIndex].estimatePurchasePrice;
return materialMationList[proIndex].unitList[normsIndex].estimatePurchasePrice;
} else {
return new Array();
}
......
......@@ -44,10 +44,10 @@
<div id="secondTab" style="display: none;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
<table class="layui-table">
<table class="layui-table" style="margin: 0px 10px;">
<thead>
<tr>
<th>商品名称</th>
<th style="width: 100px">商品名称</th>
<th>型号</th>
<th>所属类型</th>
<th>商品来源</th>
......@@ -71,25 +71,25 @@
<script type="text/html" id="tableBody">
{{#each rows}}
<tr rowid="{{productId}}">
<td id="name{{productId}}">{{productName}}</td>
<td id="model{{productId}}">{{productModel}}</td>
<tr rowid="{{materialId}}">
<td id="name{{materialId}}">{{materialName}}</td>
<td id="model{{materialId}}">{{materialModel}}</td>
<td>{{categoryName}}</td>
<td>
<select lay-filter="typeId" lay-search="" id="type{{productId}}" disabled>
<select lay-filter="typeId" lay-search="" id="type{{materialId}}" disabled>
<option value="1">自产</option>
<option value="2">外购</option>
</select>
</td>
<td>
<select lay-filter="unitListChoose" lay-search="" id="norms{{productId}}">
<select lay-filter="unitListChoose" lay-search="" id="norms{{materialId}}">
{{#each unitList}}
<option value="{{id}}">{{name}}</option>
{{/each}}
</select>
</td>
<td>
<select lay-filter="bomListChoose" lay-search="" id="bom{{productId}}">
<select lay-filter="bomListChoose" lay-search="" id="bom{{materialId}}">
<option value="">全部</option>
{{#each bomList}}
<option value="{{id}}">{{name}}</option>
......
//表格分页复选框
layui.define(['jquery', 'table'], function(exports) {
var $ = layui.jquery,
table = layui.table;
//记录选中表格记录编号
var checkedList = {};
var tableCheckBoxUtil = {
/*初始化分页设置*/
init: function(settings) {
var param = {
//表格id
gridId: '',
//表格lay-filter值
filterId: '',
//表格主键字段名
fieldName: ''
};
$.extend(param, settings);
//设置当前保存数据参数
if(checkedList[param.gridId] == null) {
checkedList[param.gridId] = [];
}
//监听选中行
table.on('checkbox(' + param.filterId + ')', function(obj) {
var type = obj.type;
var checked = obj.checked;
//当前页数据
var currentPageData = table.cache[param.gridId];
//当前选中数据
var checkRowData = [];
//当前取消选中的数据
var cacelCheckedRowData = [];
//debugger;
//选中
if(checked) {
checkRowData = table.checkStatus(param.gridId).data;
}
// 取消选中
else {
if(type == 'all') {
cacelCheckedRowData = currentPageData;
} else {
cacelCheckedRowData.push(obj.data);
}
}
//debugger;
//清除数据
$.each(cacelCheckedRowData, function(index, item) {
var itemValue = item[param.fieldName];
checkedList[param.gridId] = checkedList[param.gridId].filter(function(fItem, fIndex) {
return fItem != itemValue;
})
});
//添加选中数据
$.each(checkRowData, function(index, item) {
var itemValue = item[param.fieldName];
if(checkedList[param.gridId].indexOf(itemValue) < 0) {
checkedList[param.gridId].push(itemValue);
}
});
});
},
//设置页面默认选中(在表格加载完成之后调用)
checkedDefault: function(settings) {
var param = {
//表格id
gridId: '',
//表格主键字段名
fieldName: ''
};
$.extend(param, settings);
//当前页数据
var currentPageData = table.cache[param.gridId];
if(checkedList[param.gridId] != null && checkedList[param.gridId].length > 0) {
$.each(currentPageData, function(index, item) {
var itemValue = item[param.fieldName];
if(checkedList[param.gridId].indexOf(itemValue) >= 0) {
//设置选中状态
item.LAY_CHECKED = true;
var rowIndex = item['LAY_TABLE_INDEX'];
updateRowCheckStatus(param.gridId, 'tr[data-index=' + rowIndex + '] input[type="checkbox"]');
}
});
}
//判断当前页是否全选
var currentPageCheckedAll = table.checkStatus(param.gridId).isAll;
if(currentPageCheckedAll) {
updateRowCheckStatus(param.gridId, 'thead tr input[type="checkbox"]');
}
},
//获取当前获取的所有集合值
getValue: function(settings) {
var param = {
//表格id
gridId: ''
};
$.extend(param, settings);
return checkedList[param.gridId];
},
//设置选中的id(一般在编辑时候调用初始化选中值)
setIds: function(settings) {
var param = {
gridId: '',
//数据集合
ids: []
};
$.extend(param, settings);
checkedList[param.gridId] = [];
$.each(param.ids, function(index, item) {
checkedList[param.gridId].push(item);
});
}
};
var updateRowCheckStatus = function(gridId, ele) {
var layTableView = $('.layui-table-view');
//一个页面多个表格,这里防止更新表格错误
$.each(layTableView, function(index, item) {
if($(item).attr('lay-id') == gridId) {
$(item).find(ele).prop('checked', true);
$(item).find(ele).next().addClass('layui-form-checked');
}
});
}
//输出
exports('tableCheckBoxUtil', tableCheckBoxUtil);
layui.define(['jquery', 'table'], function (exports) {
var $ = layui.jquery,
table = layui.table;
//记录选中表格记录编号
var checkedList = {};
var checkedDataMap = {};
var tableCheckBoxUtil = {
init: function (settings) {
var param = {
// 表格id
gridId: '',
// 表格lay-filter值
filterId: '',
// 表格主键字段名
fieldName: '',
// 默认回显的数据
ids: []
};
$.extend(param, settings);
// 设置当前保存数据参数
if (checkedList[param.gridId] == null) {
checkedList[param.gridId] = [];
}
if (checkedDataMap[param.gridId] == null) {
checkedDataMap[param.gridId] = [];
}
if (!isNull(param.ids) && param.ids.length > 0) {
this.setIds(settings);
}
// 监听选中行
table.on('checkbox(' + param.filterId + ')', function (obj) {
var type = obj.type;
var checked = obj.checked;
// 当前页数据
var currentPageData = table.cache[param.gridId];
// 当前选中数据
var checkRowData = [];
// 当前取消选中的数据
var cacelCheckedRowData = [];
if (checked) {
// 选中
checkRowData = table.checkStatus(param.gridId).data;
} else {
// 取消选中
if (type == 'all') {
cacelCheckedRowData = currentPageData;
} else {
cacelCheckedRowData.push(obj.data);
}
}
// 清除数据
$.each(cacelCheckedRowData, function (index, item) {
var itemValue = item[param.fieldName];
checkedList[param.gridId] = checkedList[param.gridId].filter(function (fItem, fIndex) {
return fItem != itemValue;
});
checkedDataMap[param.gridId] = checkedDataMap[param.gridId].filter(function (fItem, fIndex) {
return fItem[param.fieldName] != itemValue;
})
});
// 添加选中数据
$.each(checkRowData, function (index, item) {
var itemValue = item[param.fieldName];
if (checkedList[param.gridId].indexOf(itemValue) < 0) {
checkedList[param.gridId].push(itemValue);
checkedDataMap[param.gridId].push(item);
}
});
});
},
//设置页面默认选中(在表格加载完成之后调用)
checkedDefault: function (settings) {
var param = {
//表格id
gridId: '',
//表格主键字段名
fieldName: ''
};
$.extend(param, settings);
// 当前页数据
var currentPageData = table.cache[param.gridId];
if (checkedList[param.gridId] != null && checkedList[param.gridId].length > 0) {
$.each(currentPageData, function (index, item) {
var itemValue = item[param.fieldName];
if (checkedList[param.gridId].indexOf(itemValue) >= 0) {
//设置选中状态
item.LAY_CHECKED = true;
var rowIndex = item['LAY_TABLE_INDEX'];
updateRowCheckStatus(param.gridId, 'tr[data-index=' + rowIndex + '] input[type="checkbox"]');
var tmpBean = getInPoingArr(checkedDataMap[param.gridId], param.fieldName, itemValue);
if (tmpBean == null) {
checkedDataMap[param.gridId].push(item);
}
}
});
}
//判断当前页是否全选
var currentPageCheckedAll = table.checkStatus(param.gridId).isAll;
if (currentPageCheckedAll) {
updateRowCheckStatus(param.gridId, 'thead tr input[type="checkbox"]');
}
},
//获取当前获取的所有集合值
getValue: function (settings) {
var param = {
//表格id
gridId: ''
};
$.extend(param, settings);
return checkedList[param.gridId];
},
// 获取当前选中的数据
getValueList: function (settings) {
var param = {
//表格id
gridId: ''
};
$.extend(param, settings);
return checkedDataMap[param.gridId];
},
//设置选中的id(一般在编辑时候调用初始化选中值)
setIds: function (settings) {
var param = {
gridId: '',
//数据集合
ids: []
};
$.extend(param, settings);
checkedList[param.gridId] = [];
$.each(param.ids, function (index, item) {
checkedList[param.gridId].push(item);
});
}
};
var updateRowCheckStatus = function (gridId, ele) {
var layTableView = $('.layui-table-view');
// 一个页面多个表格,这里防止更新表格错误
$.each(layTableView, function (index, item) {
if ($(item).attr('lay-id') == gridId) {
$(item).find(ele).prop('checked', true);
$(item).find(ele).next().addClass('layui-form-checked');
}
});
}
//输出
exports('tableCheckBoxUtil', tableCheckBoxUtil);
});
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册