|  | @@ -2,6 +2,8 @@ package fi.em.formPlugin;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  import kd.bos.dataentity.entity.DynamicObject;
 |  |  import kd.bos.dataentity.entity.DynamicObject;
 | 
											
												
													
														|  |  import kd.bos.dataentity.entity.DynamicObjectCollection;
 |  |  import kd.bos.dataentity.entity.DynamicObjectCollection;
 | 
											
												
													
														|  | 
 |  | +import kd.bos.entity.operate.result.OperationResult;
 | 
											
												
													
														|  | 
 |  | +import kd.bos.form.control.EntryGrid;
 | 
											
												
													
														|  |  import kd.bos.form.events.AfterDoOperationEventArgs;
 |  |  import kd.bos.form.events.AfterDoOperationEventArgs;
 | 
											
												
													
														|  |  import kd.bos.form.events.BeforeDoOperationEventArgs;
 |  |  import kd.bos.form.events.BeforeDoOperationEventArgs;
 | 
											
												
													
														|  |  import kd.bos.form.operate.AbstractOperate;
 |  |  import kd.bos.form.operate.AbstractOperate;
 | 
											
										
											
												
													
														|  | @@ -15,12 +17,13 @@ import java.util.Map;
 | 
											
												
													
														|  |  /**
 |  |  /**
 | 
											
												
													
														|  |   * @author cjz
 |  |   * @author cjz
 | 
											
												
													
														|  |   * @date 2024/11/7 15:45
 |  |   * @date 2024/11/7 15:45
 | 
											
												
													
														|  | - * @description:差旅汇总分录计算
 |  | 
 | 
											
												
													
														|  | 
 |  | + * @description:差旅汇总分录计算,条线产品分摊明细分录复制
 | 
											
												
													
														|  |   */
 |  |   */
 | 
											
												
													
														|  |  public class TravelTotalPlugin extends AbstractFormPlugin {
 |  |  public class TravelTotalPlugin extends AbstractFormPlugin {
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      private static String bar_save="save";//保存标识
 |  |      private static String bar_save="save";//保存标识
 | 
											
												
													
														|  |      private static String entryentity="nckd_entryentity";//差旅汇总标识
 |  |      private static String entryentity="nckd_entryentity";//差旅汇总标识
 | 
											
												
													
														|  | 
 |  | +    private static String invoiceandexpense="nckd_invoiceandexpense";//条线产品分摊明细分
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      @Override
 |  |      @Override
 | 
											
												
													
														|  |      public void beforeDoOperation(BeforeDoOperationEventArgs args) {
 |  |      public void beforeDoOperation(BeforeDoOperationEventArgs args) {
 | 
											
										
											
												
													
														|  | @@ -70,4 +73,39 @@ public class TravelTotalPlugin extends AbstractFormPlugin {
 | 
											
												
													
														|  |              this.getView().updateView("nckd_entryentity");
 |  |              this.getView().updateView("nckd_entryentity");
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +//    @Override
 | 
											
												
													
														|  | 
 |  | +//    public void afterDoOperation(AfterDoOperationEventArgs arg) {
 | 
											
												
													
														|  | 
 |  | +//        super.afterDoOperation(arg);
 | 
											
												
													
														|  | 
 |  | +//        AbstractOperate op = (AbstractOperate)arg.getSource();
 | 
											
												
													
														|  | 
 |  | +//        OperationResult operationResult = arg.getOperationResult();
 | 
											
												
													
														|  | 
 |  | +//        String key = op.getOperateKey();
 | 
											
												
													
														|  | 
 |  | +//        //点击复制按钮,获取分录中选中的数据行
 | 
											
												
													
														|  | 
 |  | +//        if ("copyentry".equals(key)) {
 | 
											
												
													
														|  | 
 |  | +//            EntryGrid entryGrid = this.getControl(invoiceandexpense);
 | 
											
												
													
														|  | 
 |  | +//            //这个是获取分录的选中行
 | 
											
												
													
														|  | 
 |  | +//            int [] selectRows = entryGrid.getSelectRows();
 | 
											
												
													
														|  | 
 |  | +//            //获取单据体数据集合
 | 
											
												
													
														|  | 
 |  | +//            DynamicObjectCollection entity=this.getModel().getEntryEntity(invoiceandexpense);
 | 
											
												
													
														|  | 
 |  | +//            if(selectRows != null){
 | 
											
												
													
														|  | 
 |  | +//                for(int selectRow :selectRows){
 | 
											
												
													
														|  | 
 |  | +//                    DynamicObject dynamicObject=entity.get(selectRow);  //获取选中行的单据体数据
 | 
											
												
													
														|  | 
 |  | +//                    //新增分录行
 | 
											
												
													
														|  | 
 |  | +//                    int rowIndex = this.getModel().createNewEntryRow(invoiceandexpense);
 | 
											
												
													
														|  | 
 |  | +//                    //条线
 | 
											
												
													
														|  | 
 |  | +//                    this.getModel().setValue("nckd_basedatafield",dynamicObject.getDynamicObject("nckd_basedatafield"),rowIndex);
 | 
											
												
													
														|  | 
 |  | +//                    //产品
 | 
											
												
													
														|  | 
 |  | +//                    this.getModel().setValue("nckd_basedatafield1",dynamicObject.getDynamicObject("nckd_basedatafield1"),rowIndex);
 | 
											
												
													
														|  | 
 |  | +//                    //分摊比例
 | 
											
												
													
														|  | 
 |  | +//                    this.getModel().setValue("nckd_decimalfield",dynamicObject.getBigDecimal("nckd_decimalfield"),rowIndex);
 | 
											
												
													
														|  | 
 |  | +//                    //分摊金额
 | 
											
												
													
														|  | 
 |  | +//                    this.getModel().setValue("nckd_amountfield3",dynamicObject.getBigDecimal("nckd_amountfield3"),rowIndex);
 | 
											
												
													
														|  | 
 |  | +//
 | 
											
												
													
														|  | 
 |  | +//                }
 | 
											
												
													
														|  | 
 |  | +//            }
 | 
											
												
													
														|  | 
 |  | +//
 | 
											
												
													
														|  | 
 |  | +//
 | 
											
												
													
														|  | 
 |  | +//        }
 | 
											
												
													
														|  | 
 |  | +//    }
 | 
											
												
													
														|  |  }
 |  |  }
 |