数据表名:rsmc_shi_chang_huo_dong_zhu_biao,包含字段 id ,shichanghuodongmingchen
下推到的数据表名:rsmc_huo_dong_zhi_xing_zhu_biao,包含字段,id,shichanghuodongmingcheng
思路是,查询 shichanghuodongmingcheng是否已经存在
目前sql语句:
select
count(b.shichanghuodongmingcheng) as sl
from
rsmc_huo_dong_zhi_xing_zhu_biao b
where
b.shichanghuodongmingcheng in (
select
c.shichanghuodongmingchen
from
rsmc_shi_chang_huo_dong_zhu_biao c
where
c.shichanghuodongmingchen = :shichanghuodongmingcheng
)
and b.tenant_id = :tenantId
and b.is_deleted = 0
点击事件代码:
const sl = await jwpf.getFieldValBySql("TRes7ZXvM3vvY12E",{"fix_EQL_id": data["shichanghuodongmingcheng"]},"sl");
if(sl > 0){
alert("活动已在执行中,请查询活动执行!")
} else {
const status = jwpf.getFormVal("status");
if (status === "31") {
const mainData = {
"shichanghuodongmingchen": jwpf.getFormVal("shichanghuodongmingchen"),
}
jwpf.setPageValue("bjMainData", mainData);
// 将子表的值存储到页面缓存中
var ckdUrl =
"/res_rsmc_shichangyingxiao/res_rsmc_huodongxinxi/res_rsmc_huodongzhixing/view?title=活动执行-新增&entityName=rsmc.huodongzhixing.HuoDongZhiXingZhuBiao&moduleName=活动执行&pageType=addPage"
// 打开活动执行的新增页面
jwpf.doOpenUrl("新增活动执行", ckdUrl);
} else {
alert("只有审核通过的活动才能执行!");
}
}
现在执行结果: