插件实现凭证录入支持核算维度的批量指定和清除

栏目:云星空知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:1

插件实现凭证录入支持核算维度的批量指定和清除

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

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


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

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

    image.webpimage.webpimage.webpimage.webp

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

  • 注册凭证表单插件

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

    image.webp

  • 运行效果图:

    image.webp

  • 附代码

    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.webp    

插件实现凭证录入支持核算维度的批量指定和清除.zip

插件实现凭证录入支持核算维度的批量指定和清除

本方案实现在凭证分录中,所有挂了指定维度的科目,当该维度未录入时,批量填充指定的维度值,或批量清除指定的维度。 方案...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息