|
@@ -0,0 +1,59 @@
|
|
|
+package fi.cas.formplugin;
|
|
|
+
|
|
|
+import kd.bos.dataentity.entity.DynamicObject;
|
|
|
+import kd.bos.form.plugin.AbstractFormPlugin;
|
|
|
+import kd.sdk.plugin.Plugin;
|
|
|
+
|
|
|
+import java.util.EventObject;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author cjz
|
|
|
+ * @date 2024/11/6 14:52
|
|
|
+ * @description:代发处理单,控制按钮显隐
|
|
|
+ */
|
|
|
+public class AgpaybillButPlugin extends AbstractFormPlugin implements Plugin {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void afterBindData(EventObject e) {
|
|
|
+ super.afterBindData(e);
|
|
|
+ //设置付款给前置按钮不可见
|
|
|
+ this.getView().setVisible(false,"nckd_payforfront");
|
|
|
+ //设置付款执行按钮不可见
|
|
|
+ this.getView().setVisible(false,"nckd_payzx");
|
|
|
+ //设置重新支付按钮不可见
|
|
|
+ this.getView().setVisible(false,"nckd_cxzf");
|
|
|
+ //设置支付关闭按钮不可见
|
|
|
+ this.getView().setVisible(false,"nckd_payclose");
|
|
|
+
|
|
|
+
|
|
|
+ //获取当前单据
|
|
|
+ DynamicObject dynamicObject=this.getModel().getDataEntity(true);
|
|
|
+ //单据状态
|
|
|
+ String billstatus = dynamicObject.getString("billstatus");
|
|
|
+ //支付状态
|
|
|
+ String paystatus=dynamicObject.getString("nckd_paystatus");
|
|
|
+ //核心状态
|
|
|
+ String nckdHxzt = dynamicObject.getString("nckd_hxzt");
|
|
|
+ //已审核,支付状态未支付,或者支付状态为空,或者支付失败才可看到付款给前置按钮,核心状态未登记
|
|
|
+ if ("C".equals(billstatus)&&"E".equals(nckdHxzt)&&(paystatus.isEmpty()|| "A".equals(paystatus)|| "D".equals(paystatus))) {
|
|
|
+ this.getView().setVisible(true,"nckd_payforfront");
|
|
|
+ }
|
|
|
+ //核心状态为已登记执行失败,已审批,才能看到付款执行按钮
|
|
|
+ if ( "A".equals(nckdHxzt)&&"C".equals(billstatus)) {
|
|
|
+ this.getView().setVisible(true,"nckd_payzx");
|
|
|
+ }
|
|
|
+ //支付状态--支付中,已审批,核心状态--支付处理部分成功才能看到重新支付按钮
|
|
|
+ if ("B".equals(paystatus)&&"C".equals(billstatus)&&"B".equals(nckdHxzt)) {
|
|
|
+ this.getView().setVisible(true,"nckd_cxzf");
|
|
|
+ }
|
|
|
+ //支付状态--支付中,核心状态--支付处理部分成功或执行失败才能看到支付关闭按钮
|
|
|
+ if ("B".equals(paystatus)&&"B".equals(nckdHxzt)||"A".equals(nckdHxzt)) {
|
|
|
+ this.getView().setVisible(true,"nckd_payclose");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|