效果如下:
实现方法:
$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开始,所以要 +1
const 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.color = 'gray'; // 设置为灰色以表明链接不可用
}
});
}
});
}, 150);
});
标签:function,const,E9,wev,var,link,btn,泛微,页面
From: https://www.cnblogs.com/oeuvres/p/18577438