插件实现凭证录入支持核算维度的批量指定和清除原创
金蝶云社区-战斗的凯文
战斗的凯文
5人赞赏了该文章 241次浏览 未经作者许可,禁止转载编辑于2023年11月02日 11:12:48

        本方案实现在凭证分录中,所有挂了指定维度的科目,当该维度未录入时,批量填充指定的维度值,或批量清除指定的维度

        方案思路:扩展凭证,增加【维度选择】下拉列表,【维度值】文本框和【批量填充】批量清除】按键。当点击按键批量填充】时,自动遍历当前凭证的所有分录行,如当前行科目如果挂了指定的维度且未录入内容时,就自动将维度值填充进去。批量清除】则实现自动将指定的维度值清空。


  • 扩展凭证,增加【维度选择】下拉列表,【维度值】文本框和【批量填充】批量清除】按键

    在BOS设计器中,实现上述内容,注意各字段的标识值分别为:FFlexCombo,FFlexValue和FBtFill,FBtClear。注意标记部分的属性内容如下:

    image.pngimage.pngimage.pngimage.png

  • 完成后的界面如下图所示:
    image.png

  • 注册凭证表单插件

    找到组件的dll文件,在BOS设计器的凭证表单插件中完成插件注册:

    image.png

  • 运行效果图:

    image.png

  • 附代码

    1,扩展元数据

<FormMetadata>
  <BusinessInfo>
    <BusinessInfo>
      <Elements>
        <Form action="edit" oid="BOS_BillModel" ElementType="100" ElementStyle="0">
          <Id>33bb284e-453e-45aa-a575-5d963c2ff289</Id>
          <FormPlugins>
            <PlugIn ElementType="0" ElementStyle="0">
              <ClassName>MyPlugIn.VoucherFlexFillClear, MyPlugIn</ClassName>
              <OrderId>8</OrderId>
            </PlugIn>
          </FormPlugins>
        </Form>
        <TextField ElementType="1" ElementStyle="0">
          <ConditionType>0</ConditionType>
          <PropertyName>FFlexValue</PropertyName>
          <FieldName />
          <ListTabIndex>118</ListTabIndex>
          <Name>维度值</Name>
          <Id>708649249c844d89ad801d627e474ad1</Id>
          <Key>FFlexValue</Key>
        </TextField>
        <ComboField ElementType="9" ElementStyle="0">
          <EnumType>1</EnumType>
          <Editlen>20</Editlen>
          <FireUpdateEvent>1</FireUpdateEvent>
          <PropertyName>FFlexCombo</PropertyName>
          <FieldName />
          <FieldType>167</FieldType>
          <ConditionType>5</ConditionType>
          <DefaultCondition>29</DefaultCondition>
          <ListTabIndex>119</ListTabIndex>
          <Name>维度选择</Name>
          <Id>25a2d740b839457c867e469beaa9ca3a</Id>
          <Key>FFlexCombo</Key>
        </ComboField>
      </Elements>
    </BusinessInfo>
  </BusinessInfo>
  <LayoutInfos>
    <LayoutInfo action="edit" oid="bc952920-057d-4790-9c27-1134091eb298">
      <Appearances>
        <FormAppearance action="edit" oid="ecbac0e9-50b5-436c-9dce-241b5b7682b9" ElementType="100" ElementStyle="1">
          <Width>1669</Width>
        </FormAppearance>
        <TextFieldAppearance ElementType="1" ElementStyle="1">
          <EmptyText action="setnull" />
          <Key>FFlexValue</Key>
          <TextEditStyle>2</TextEditStyle>
          <ListDefaultWidth>100</ListDefaultWidth>
          <Container>FPANELTOP</Container>
          <ZOrderIndex>20</ZOrderIndex>
          <Tabindex>45</Tabindex>
          <Left>1172</Left>
          <Top>58</Top>
          <LabelWidth>100</LabelWidth>
          <Width>500</Width>
          <Visible>253</Visible>
          <VisibleExt>10011100</VisibleExt>
          <Caption>维度值</Caption>
          <Id>2e14674c374b48fa9e9dabcdaa737af6</Id>
        </TextFieldAppearance>
        <ComboFieldAppearance ElementType="9" ElementStyle="1">
          <EmptyText action="setnull" />
          <Key>FFlexCombo</Key>
          <ListDefaultWidth>100</ListDefaultWidth>
          <Container>FPANELTOP</Container>
          <ZOrderIndex>21</ZOrderIndex>
          <Tabindex>46</Tabindex>
          <Left>1172</Left>
          <Top>32</Top>
          <LabelWidth>100</LabelWidth>
          <Width>500</Width>
          <Visible>253</Visible>
          <VisibleExt>10011100</VisibleExt>
          <Caption>维度选择</Caption>
          <Id>ad882b8467df44b78b7967deddab3488</Id>
        </ComboFieldAppearance>
        <ButtonAppearance ElementType="1002" ElementStyle="1">
          <Container>FPANELTOP</Container>
          <ZOrderIndex>22</ZOrderIndex>
          <Tabindex>10</Tabindex>
          <Left>1271</Left>
          <Top>83</Top>
          <Width>150</Width>
          <Visible>253</Visible>
          <VisibleExt>10011100</VisibleExt>
          <Caption>批量填充</Caption>
          <Id>a500a2aef22442ba8bbd6613ccb69539</Id>
          <Key>FBtFill</Key>
        </ButtonAppearance>
        <ButtonAppearance ElementType="1002" ElementStyle="1">
          <Container>FPANELTOP</Container>
          <ZOrderIndex>23</ZOrderIndex>
          <Tabindex>10</Tabindex>
          <Left>1493</Left>
          <Top>83</Top>
          <Width>150</Width>
          <Visible>253</Visible>
          <VisibleExt>10011100</VisibleExt>
          <Caption>批量清除</Caption>
          <Id>e0586fdf94504535ad149f8702f354d5</Id>
          <Key>FBtClear</Key>
        </ButtonAppearance>
      </Appearances>
    </LayoutInfo>
  </LayoutInfos>
</FormMetadata>

        2,C#插件代码见附件

        3,插件需要引用的官方组件一览:

image.png    

图标赞 5
5人点赞
还没有人点赞,快来当第一个点赞的人吧!
图标打赏
0人打赏
还没有人打赏,快来当第一个打赏的人吧!