选中行状态数据进行判断,非新增状态点击编辑按钮不执行操作

获取list选中行数据,当状态栏位不为【新增】是,点击编辑按钮弹出错误提醒
1.加button按钮
在这里插入图片描述
2.在这里插入图片描述

<button class="edit" name="saleoppControl" url="${ctx}/scSaleopp/updateMain/">编辑</button>
	<table class="frog-table" id="saleoppTable">
		<thead>
			<tr>
				<th width="30px">序号</th>
				<th width="100px">商机编号</th>
				<th width="100px">商机名称</th>
				<th width="180px">客户</th>
				<th width="100px">商机金额</th>
				<th width="100px">预计成交日期</th>
				<th width="100px">商机阶段</th>
				<th width="100px">业务部门</th>
				<th width="90px">业务员</th>
				<th width="100px">备注</th>
				<th width="100px">状态</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${list}" var="scSaleopp" varStatus="status">
				<tr target="slt_uid" rel="${scSaleopp.id}" id="${scSaleopp.id}">
				    <td>${page.pageBeginCount + status.index + 1}</td>
					<td>${scSaleopp.saleOppNo}</td>
					<td>${scSaleopp.saleOppName}</td>
					<td>${scSaleopp.custName}</td>
					<td>${scSaleopp.saleOppAMt}</td>
					<td>${scSaleopp.expectDate}</td>
					<td>${saleOppStageMap[scSaleopp.saleOppStage]}</td>
					<td>${scSaleopp.salesUnit}</td>
					<td>${scSaleopp.salesMan}</td>
					<td>${scSaleopp.remark}</td>
					<td>${scSaleopp.state}</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
<script>
		//按钮管控
		$('button[name=saleoppControl]').on('click',function (event) {
			let jsObj = event.target;
			let url = $(jsObj).attr("url");
			let objClass = jsObj.getAttribute("class");
			let selectTr = $('#saleoppTable').find('.selected');
			let id = selectTr.attr("rel");
			let status = selectTr.find("td:eq(10)")[0].innerText;
			if(objClass=="edit"){
				if (status!="新增"){
					Dialog.error("该数据状态非新增,不能执行编辑操作!")
					return ;
				}
				let opt ={
					max: true,
					title: "编辑界面"
				}
				Dialog.open(url+id,"",opt);
			}
		})
	</script>
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值