效果如下:
实现方法:
$load(function() {setTimeout(function() {var kpbm = $f("kpbm").val();var zcbm = $f("zcbm").val();const date = new Date();const year = date.getFullYear();const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以要 +1const currentYearMonth = `${year}-${month}`;Mobile_NS.SQL("SELECT sfypd FROM uf_zcpdxx WHERE kpbm = ? AND pdny = ? ",[kpbm,currentYearMonth], function(result) {var sfypd = result[0].sfypd;if(sfypd == 0){// Mobile_NS.alert("该资产此次已经盘点过,无需重复盘点");// 使用querySelectorAll选择所有wev-btn-wrapper下的a标签var links = document.querySelectorAll('.wev-btn-wrapper .wev-btn.wev-btn-custom');// 遍历所有选中的链接links.forEach(function(link) {// 检查链接的文本内容是否包含“资产盘点”if (link.textContent.trim() === '资产盘点') {// 更改链接的样式以表明它已被禁用link.style.pointerEvents = 'none';// link.style.cursor = 'not-allowed';link.style.color = 'gray'; // 设置为灰色以表明链接不可用// link.style.textDecoration = 'none'; // 移除下划线}});}});}, 150);
});