<template>
    <i-form :model="this.data" class='app-form' ref='form'  id='form' style="">
    <input style="display:none;" />
    <row >
            
<i-col v-show="detailsModel.group1.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-group layoutType="TABLE_24COL" titleStyle="groupta" class=' ht1' uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('im.main3_form.details.group1')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false">
    
    <row>
        <i-col v-show="detailsModel.imname.visible" :style="{}"  :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }">
    <app-form-item name='imname' :itemRules="this.rules.imname" class='def' :caption="$t('im.main3_form.details.imname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.imname.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.imname"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.imname.disabled" type='text'  style=""></input-box>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.lcbh.visible" :style="{}"  :lg="{ span: 12, offset: 0 }" :xl="{ span: 12, offset: 0 }">
    <app-form-item name='lcbh' :itemRules="this.rules.lcbh" class='def2' :caption="$t('im.main3_form.details.lcbh')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.lcbh.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.lcbh"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.lcbh.disabled" type='text'  style=""></input-box>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.ngrname.visible" :style="{}"  :lg="{ span: 12, offset: 0 }" :xl="{ span: 12, offset: 0 }">
    <app-form-item name='ngrname' :itemRules="this.rules.ngrname" class='def3' :caption="$t('im.main3_form.details.ngrname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.ngrname.error" :isEmptyCaption="false" labelPos="LEFT">
    <app-picker 
  :formState="formState"
  :data="data"
  :context="context"
  :viewparams="viewparams"
  :itemParam='{ }' 
  :disabled="detailsModel.ngrname.disabled"
  name='ngrname'
  deMajorField='orgusername'
  deKeyField='orguser'
  :service="service"
  :acParams="{ serviceName: 'OrgUserService', interfaceName: 'FetchDefault'}"
  valueitem='ngrid' 
  :value="data.ngrname" 
  editortype="" 
  :pickupView="{ viewname: 'org-user-pickup-view', title: '组织用户数据选择视图', deResParameters: [], parameters: [{ pathName: 'orgusers', parameterName: 'orguser' }, { pathName: 'pickupview', parameterName: 'pickupview' } ], placement:'' }"
  style=""  
  @formitemvaluechange="onFormItemValueChange">
</app-picker>

</app-form-item>

</i-col>
<i-col v-show="detailsModel.ngrbmname.visible" :style="{}"  :lg="{ span: 12, offset: 0 }" :xl="{ span: 12, offset: 0 }">
    <app-form-item name='ngrbmname' :itemRules="this.rules.ngrbmname" class='def2' :caption="$t('im.main3_form.details.ngrbmname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.ngrbmname.error" :isEmptyCaption="false" labelPos="LEFT">
    <app-picker 
  :formState="formState"
  :data="data"
  :context="context"
  :viewparams="viewparams"
  :itemParam='{ }' 
  :disabled="detailsModel.ngrbmname.disabled"
  name='ngrbmname'
  deMajorField='orgdeptname'
  deKeyField='orgdept'
  :service="service"
  :acParams="{ serviceName: 'OrgDeptService', interfaceName: 'FetchDefault'}"
  valueitem='ngrbmid' 
  :value="data.ngrbmname" 
  editortype="" 
  :pickupView="{ viewname: 'org-dept-pickup-view', title: '部门数据选择视图', deResParameters: [], parameters: [{ pathName: 'orgdepts', parameterName: 'orgdept' }, { pathName: 'pickupview', parameterName: 'pickupview' } ], placement:'' }"
  style=""  
  @formitemvaluechange="onFormItemValueChange">
</app-picker>

</app-form-item>

</i-col>
<i-col v-show="detailsModel.ngrjg.visible" :style="{}"  :lg="{ span: 12, offset: 0 }" :xl="{ span: 12, offset: 0 }">
    <app-form-item name='ngrjg' :itemRules="this.rules.ngrjg" class='def3' :caption="$t('im.main3_form.details.ngrjg')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.ngrjg.error" :isEmptyCaption="false" labelPos="LEFT">
    <app-span style="" :data="data.ngrjg" ></app-span>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.ngrlxfs.visible" :style="{}"  :lg="{ span: 12, offset: 0 }" :xl="{ span: 12, offset: 0 }">
    <app-form-item name='ngrlxfs' :itemRules="this.rules.ngrlxfs" class='def2' :caption="$t('im.main3_form.details.ngrlxfs')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.ngrlxfs.error" :isEmptyCaption="false" labelPos="LEFT">
    <app-span style="" :data="data.ngrlxfs" ></app-span>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.ngrq.visible" :style="{}"  :lg="{ span: 12, offset: 0 }" :xl="{ span: 12, offset: 0 }">
    <app-form-item name='ngrq' :itemRules="this.rules.ngrq" class='def3' :caption="$t('im.main3_form.details.ngrq')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.ngrq.error" :isEmptyCaption="false" labelPos="LEFT">
    <date-picker type="date" :transfer="true" format="yyyy-MM-dd" placeholder="请选择时间..." :value="data.ngrq" :disabled="detailsModel.ngrq.disabled" style="min-width: 150px; width:100px;" @on-change="(val1, val2) => { this.data.ngrq = val1 }"></date-picker>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.hjcd.visible" :style="{}"  :lg="{ span: 12, offset: 0 }" :xl="{ span: 12, offset: 0 }">
    <app-form-item name='hjcd' :itemRules="this.rules.hjcd" class='def2' :caption="$t('im.main3_form.details.hjcd')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.hjcd.error" :isEmptyCaption="false" labelPos="LEFT">
    <app-radio-group v-model="data.hjcd"  :disabled="detailsModel.hjcd.disabled"  name="hjcd" tag='HJCD' codelistType='STATIC' style=""></app-radio-group>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.jjyy.visible" :style="{}"  :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }">
    <app-form-item name='jjyy' :itemRules="this.rules.jjyy" class='def' :caption="$t('im.main3_form.details.jjyy')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.jjyy.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.jjyy"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.jjyy.disabled" type='text'  style=""></input-box>
</app-form-item>

</i-col>
    
    </row>
</app-form-group>

</i-col>
<i-col v-show="detailsModel.grouppanel1.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-group layoutType="TABLE_24COL" titleStyle="groupta" class=' ht2' uiActionGroup="detailsModel.grouppanel1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('im.main3_form.details.grouppanel1')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false">
    
    <row>
        <i-col v-show="detailsModel.sblb.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-item name='sblb' :itemRules="this.rules.sblb" class='def' :caption="$t('im.main3_form.details.sblb')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.sblb.error" :isEmptyCaption="false" labelPos="LEFT">
    <app-radio-group v-model="data.sblb"  :disabled="detailsModel.sblb.disabled"  name="sblb" tag='SBLB' codelistType='STATIC' style=""></app-radio-group>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.sblx.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-item name='sblx' :itemRules="this.rules.sblx" class='def' :caption="$t('im.main3_form.details.sblx')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.sblx.error" :isEmptyCaption="false" labelPos="LEFT">
    <app-radio-group v-model="data.sblx"  :disabled="detailsModel.sblx.disabled"  name="sblx" tag='SBLX' codelistType='STATIC' style=""></app-radio-group>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.druipart1.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-druipart
    
    :formState="formState"
    paramItem='im' 
    :parentdata='{"srfparentdename":"IM","SRFPARENTTYPE":"CUSTOM"}'
    :parameters="[
    ]"
    :context="context"
    :viewparams="viewparams"
    parameterName='im'
    parentName="IM"  
    refviewtype='DEGRIDVIEW9' 
    refreshitems='' 
    :ignorefieldvaluechange="ignorefieldvaluechange"
    viewname='fjgrid-view9' 
    :data="JSON.stringify(this.data)" 
    @drdatasaved="drdatasaved($event)"
    style=";overflow: auto;">
</app-form-druipart>

</i-col>
<i-col v-show="detailsModel.bz.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-item name='bz' :itemRules="this.rules.bz" class='def' :caption="$t('im.main3_form.details.bz')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.bz.error" :isEmptyCaption="false" labelPos="LEFT">
    <div class="ivu-input-wrapper ivu-input-wrapper-default ivu-input-type">
    <textarea class="ivu-input" :rows="10" v-model="data.bz" :disabled="detailsModel.bz.disabled" style="height:200px;"></textarea>
</div>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.ngsh.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-item name='ngsh' :itemRules="this.rules.ngsh" class='def' :caption="$t('im.main3_form.details.ngsh')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.ngsh.error" :isEmptyCaption="false" labelPos="LEFT">
    <app-mpicker
    :activeData="data"
    :disabled="detailsModel.ngsh.disabled"
    :curvalue="data.ngsh"
    name="ngsh"
    :context="context"
    :viewparams="viewparams"
    :service="service"
    :acParams="{ }"
    :pickupView="{ viewname: 'org-user-mpickup-view', title: '组织用户数据多项选择视图', deResParameters: [], parameters: [{ pathName: 'orgusers', parameterName: 'orguser' }, { pathName: 'mpickupview', parameterName: 'mpickupview' } ], placement:'' }"
    @formitemvaluechange="onFormItemValueChange" 
    style="">
</app-mpicker>

</app-form-item>

</i-col>
<i-col v-show="detailsModel.shfs.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-item name='shfs' :itemRules="this.rules.shfs" class='def' :caption="$t('im.main3_form.details.shfs')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.shfs.error" :isEmptyCaption="false" labelPos="LEFT">
    <app-radio-group v-model="data.shfs"  :disabled="detailsModel.shfs.disabled"  name="shfs" tag='SHFS' codelistType='STATIC' style=""></app-radio-group>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.bmld.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-item name='bmld' :itemRules="this.rules.bmld" class='def' :caption="$t('im.main3_form.details.bmld')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.bmld.error" :isEmptyCaption="false" labelPos="LEFT">
    <app-mpicker
    :activeData="data"
    :disabled="detailsModel.bmld.disabled"
    :curvalue="data.bmld"
    name="bmld"
    :context="context"
    :viewparams="viewparams"
    :service="service"
    :acParams="{ }"
    :pickupView="{ viewname: 'org-user-mpickup-view', title: '组织用户数据多项选择视图', deResParameters: [], parameters: [{ pathName: 'orgusers', parameterName: 'orguser' }, { pathName: 'mpickupview', parameterName: 'mpickupview' } ], placement:'' }"
    @formitemvaluechange="onFormItemValueChange" 
    style="">
</app-mpicker>

</app-form-item>

</i-col>
<i-col v-show="detailsModel.sjbm.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-item name='sjbm' :itemRules="this.rules.sjbm" class='def' :caption="$t('im.main3_form.details.sjbm')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.sjbm.error" :isEmptyCaption="false" labelPos="LEFT">
    <app-radio-group v-model="data.sjbm"  :disabled="detailsModel.sjbm.disabled"  name="sjbm" tag='YesNo1' codelistType='STATIC' style=""></app-radio-group>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.kgsbm.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-item name='kgsbm' :itemRules="this.rules.kgsbm" class='def' :caption="$t('im.main3_form.details.kgsbm')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.kgsbm.error" :isEmptyCaption="false" labelPos="LEFT">
    <app-mpicker
    :activeData="data"
    :disabled="detailsModel.kgsbm.disabled"
    :curvalue="data.kgsbm"
    name="kgsbm"
    :context="context"
    :viewparams="viewparams"
    :service="service"
    :acParams="{ }"
    :pickupView="{ viewname: 'org-dept-mpickup-view', title: '部门数据多项选择视图', deResParameters: [], parameters: [{ pathName: 'orgdepts', parameterName: 'orgdept' }, { pathName: 'mpickupview', parameterName: 'mpickupview' } ], placement:'' }"
    @formitemvaluechange="onFormItemValueChange" 
    style="">
</app-mpicker>

</app-form-item>

</i-col>
<i-col v-show="detailsModel.kgsld.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-item name='kgsld' :itemRules="this.rules.kgsld" class='def' :caption="$t('im.main3_form.details.kgsld')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.kgsld.error" :isEmptyCaption="false" labelPos="LEFT">
    <app-mpicker
    :activeData="data"
    :disabled="detailsModel.kgsld.disabled"
    :curvalue="data.kgsld"
    name="kgsld"
    :context="context"
    :viewparams="viewparams"
    :service="service"
    :acParams="{ }"
    :pickupView="{ viewname: 'org-user-mpickup-view', title: '组织用户数据多项选择视图', deResParameters: [], parameters: [{ pathName: 'orgusers', parameterName: 'orguser' }, { pathName: 'mpickupview', parameterName: 'mpickupview' } ], placement:'' }"
    @formitemvaluechange="onFormItemValueChange" 
    style="">
</app-mpicker>

</app-form-item>

</i-col>
<i-col v-show="detailsModel.ld.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-item name='ld' :itemRules="this.rules.ld" class='def' :caption="$t('im.main3_form.details.ld')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.ld.error" :isEmptyCaption="false" labelPos="LEFT">
    <app-mpicker
    :activeData="data"
    :disabled="detailsModel.ld.disabled"
    :curvalue="data.ld"
    name="ld"
    :context="context"
    :viewparams="viewparams"
    :service="service"
    :acParams="{ }"
    :pickupView="{ viewname: 'org-user-mpickup-view', title: '组织用户数据多项选择视图', deResParameters: [], parameters: [{ pathName: 'orgusers', parameterName: 'orguser' }, { pathName: 'mpickupview', parameterName: 'mpickupview' } ], placement:'' }"
    @formitemvaluechange="onFormItemValueChange" 
    style="">
</app-mpicker>

</app-form-item>

</i-col>
<i-col v-show="detailsModel.sdfs.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-item name='sdfs' :itemRules="this.rules.sdfs" class='def' :caption="$t('im.main3_form.details.sdfs')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.sdfs.error" :isEmptyCaption="false" labelPos="LEFT">
    <app-radio-group v-model="data.sdfs"  :disabled="detailsModel.sdfs.disabled"  name="sdfs"  style=""></app-radio-group>
</app-form-item>

</i-col>
    
    </row>
</app-form-group>

</i-col>
<i-col v-show="detailsModel.grouppanel4.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-group layoutType="TABLE_24COL" titleStyle="groupta" class=' ht2' uiActionGroup="detailsModel.grouppanel4.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('im.main3_form.details.grouppanel4')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false">
    
    <row>
        <i-col v-show="detailsModel.druipart2.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-druipart
    
    :formState="formState"
    paramItem='im' 
    :parentdata='{"srfparentdefname":"IMID","srfparentdename":"IM","SRFPARENTTYPE":"DER1N","srfparentmode":"DER1N_BC_IM_IMID","SRFDER1NID":"DER1N_BC_IM_IMID"}'
    :parameters="[
    ]"
    :context="context"
    :viewparams="viewparams"
    parameterName='im'
    parentName="IM"  
    refviewtype='DEGRIDVIEW9' 
    refreshitems='' 
    :ignorefieldvaluechange="ignorefieldvaluechange"
    viewname='bcgrid-view9' 
    :data="JSON.stringify(this.data)" 
    @drdatasaved="drdatasaved($event)"
    style=";overflow: auto;">
</app-form-druipart>

</i-col>
    
    </row>
</app-form-group>

</i-col>
<i-col v-show="detailsModel.grouppanel2.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-group layoutType="TABLE_24COL" titleStyle="groupta" class=' ht2' uiActionGroup="detailsModel.grouppanel2.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('im.main3_form.details.grouppanel2')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false">
    
    <row>
        <i-col v-show="detailsModel.yzdx.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-item name='yzdx' :itemRules="this.rules.yzdx" class='def' :caption="$t('im.main3_form.details.yzdx')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.yzdx.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.yzdx"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.yzdx.disabled" type='text'  style=""></input-box>
</app-form-item>

</i-col>
    
    </row>
</app-form-group>

</i-col>
<i-col v-show="detailsModel.grouppanel3.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-group layoutType="TABLE_24COL" titleStyle="groupta" class=' ht2' uiActionGroup="detailsModel.grouppanel3.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('im.main3_form.details.grouppanel3')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="false">
    
    <row>
        <i-col v-show="detailsModel.tzyd.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-item name='tzyd' :itemRules="this.rules.tzyd" class='def' :caption="$t('im.main3_form.details.tzyd')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.tzyd.error" :isEmptyCaption="false" labelPos="LEFT">
    <app-radio-group v-model="data.tzyd"  :disabled="detailsModel.tzyd.disabled"  name="tzyd" tag='YesNo1' codelistType='STATIC' style=""></app-radio-group>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.tzydyy.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-item name='tzydyy' :itemRules="this.rules.tzydyy" class='def' :caption="$t('im.main3_form.details.tzydyy')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.tzydyy.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.tzydyy"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.tzydyy.disabled" type='text'  style=""></input-box>
</app-form-item>

</i-col>
<i-col v-show="detailsModel.qttzyddx.visible" :style="{}"  :lg="{ span: 24, offset: 0 }">
    <app-form-item name='qttzyddx' :itemRules="this.rules.qttzyddx" class='def' :caption="$t('im.main3_form.details.qttzyddx')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.qttzyddx.error" :isEmptyCaption="false" labelPos="LEFT">
    <input-box v-model="data.qttzyddx"  @enter="onEnter($event)"   unit=""  :disabled="detailsModel.qttzyddx.disabled" type='text'  style=""></input-box>
</app-form-item>

</i-col>
    
    </row>
</app-form-group>

</i-col>


    </row>
</i-form>
</template>

<script lang='ts'>
import { Vue, Component, Prop, Provide, Emit, Watch, Model } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { ControlInterface } from '@/interface/control';
import { UIActionTool,Util } from '@/utils';
import IMService from '@/service/im/im-service';
import Main3Service from './main3-form-service';

import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';


@Component({
    components: {
      
    }
})
export default class Main3Base extends Vue implements ControlInterface {

    /**
     * 名称
     *
     * @type {string}
     * @memberof Main3
     */
    @Prop() protected name?: string;

    /**
     * 视图通讯对象
     *
     * @type {Subject<ViewState>}
     * @memberof Main3
     */
    @Prop() protected viewState!: Subject<ViewState>;

    /**
     * 应用上下文
     *
     * @type {*}
     * @memberof Main3
     */
    @Prop() protected context: any;

    /**
     * 视图参数
     *
     * @type {*}
     * @memberof Main3
     */
    @Prop() protected viewparams: any;

    /**
     * 视图状态事件
     *
     * @protected
     * @type {(Subscription | undefined)}
     * @memberof Main3
     */
    protected viewStateEvent: Subscription | undefined;

    /**
     * 获取部件类型
     *
     * @returns {string}
     * @memberof Main3
     */
    protected getControlType(): string {
        return 'FORM'
    }



    /**
     * 计数器服务对象集合
     *
     * @type {Array<*>}
     * @memberof Main3
     */    
    protected counterServiceArray:Array<any> = [];

    /**
     * 建构部件服务对象
     *
     * @type {Main3Service}
     * @memberof Main3
     */
    protected service: Main3Service = new Main3Service({ $store: this.$store });

    /**
     * 实体服务对象
     *
     * @type {IMService}
     * @memberof Main3
     */
    protected appEntityService: IMService = new IMService({ $store: this.$store });
    


    /**
     * 关闭视图
     *
     * @param {any[]} args
     * @memberof Main3
     */
    protected closeView(args: any[]): void {
        let _this: any = this;
        _this.$emit('closeview', args);
    }

    /**
     *  计数器刷新
     *
     * @memberof Main3
     */
    public counterRefresh(){
        const _this:any =this;
        if(_this.counterServiceArray && _this.counterServiceArray.length >0){
            _this.counterServiceArray.forEach((item:any) =>{
                if(item.refreshData && item.refreshData instanceof Function){
                    item.refreshData();
                }
            })
        }
    }


    
    /**
     * 获取多项数据
     *
     * @returns {any[]}
     * @memberof Main3
     */
    public getDatas(): any[] {
        return [this.data];
    }

    /**
     * 获取单项树
     *
     * @returns {*}
     * @memberof Main3
     */
    public getData(): any {
        return this.data;
    }

    /**
     * 是否默认保存
     *
     * @type {boolean}
     * @memberof Main3
     */
    @Prop({ default: false }) protected autosave?: boolean;

    /**
     * 显示处理提示
     *
     * @type {boolean}
     * @memberof Main3
     */
    @Prop({ default: true }) protected showBusyIndicator?: boolean;

    /**
     * 部件行为--submit
     *
     * @type {string}
     * @memberof Main3
     */
    @Prop() protected WFSubmitAction!: string;
    
    /**
     * 部件行为--start
     *
     * @type {string}
     * @memberof Main3
     */
    @Prop() protected WFStartAction!: string;
    
    /**
     * 部件行为--update
     *
     * @type {string}
     * @memberof Main3
     */
    @Prop() protected updateAction!: string;
    
    /**
     * 部件行为--remove
     *
     * @type {string}
     * @memberof Main3
     */
    @Prop() protected removeAction!: string;
    
    /**
     * 部件行为--loaddraft
     *
     * @type {string}
     * @memberof Main3
     */
    @Prop() protected loaddraftAction!: string;
    
    /**
     * 部件行为--load
     *
     * @type {string}
     * @memberof Main3
     */
    @Prop() protected loadAction!: string;
    
    /**
     * 部件行为--create
     *
     * @type {string}
     * @memberof Main3
     */
    @Prop() protected createAction!: string;

    /**
     * 部件行为--create
     *
     * @type {string}
     * @memberof Main3
     */
    @Prop() protected searchAction!: string;

    /**
     * 视图标识
     *
     * @type {string}
     * @memberof Main3
     */
    @Prop() protected viewtag!: string;

    /**
     * 表单状态
     *
     * @type {Subject<any>}
     * @memberof Main3
     */
    protected formState: Subject<any> = new Subject();

    /**
     * 忽略表单项值变化
     *
     * @type {boolean}
     * @memberof Main3
     */
    protected ignorefieldvaluechange: boolean = false;

    /**
     * 数据变化
     *
     * @private
     * @type {Subject<any>}
     * @memberof Main3
     */
    private dataChang: Subject<any> = new Subject();

    /**
     * 视图状态事件
     *
     * @private
     * @type {(Subscription | undefined)}
     * @memberof Main3
     */
    private dataChangEvent: Subscription | undefined;

    /**
     * 原始数据
     *
     * @private
     * @type {*}
     * @memberof Main3
     */
    private oldData: any = {};

    /**
     * 表单数据对象
     *
     * @type {*}
     * @memberof Main3
     */
    protected data: any = {
        srfupdatedate: null,
        srforikey: null,
        srfkey: null,
        srfmajortext: null,
        srftempmode: null,
        srfuf: null,
        srfdeid: null,
        srfsourcekey: null,
        imname: null,
        lcbh: null,
        ngrname: null,
        ngrbmname: null,
        ngrjg: null,
        ngrlxfs: null,
        ngrq: null,
        hjcd: null,
        jjyy: null,
        ngrbmid: null,
        ngrid: null,
        sblb: null,
        sblx: null,
        bz: null,
        ngsh: null,
        shfs: null,
        bmld: null,
        sjbm: null,
        kgsbm: null,
        kgsld: null,
        ld: null,
        sdfs: null,
        yzdx: null,
        tzyd: null,
        tzydyy: null,
        qttzyddx: null,
        imid: null,
        im:null,
    };

    /**
      * 当前执行的行为逻辑
      *
      * @type {string}
      * @memberof Main3
      */
    protected currentAction: string = "";

    /**
      * 关系界面计数器
      *
      * @type {number}
      * @memberof Main3
      */
    protected drcounter: number = 0;

    /**
      * 表单保存回调存储对象
      *
      * @type {any}
      * @memberof Main3
      */
    protected saveState:any ;

    /**
     * 属性值规则
     *
     * @type {*}
     * @memberof Main3
     */
    protected rules: any = {
        srfupdatedate: [
            { type: 'string', message: '更新时间 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '更新时间 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'blur' },
        ],
        srforikey: [
            { type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
        ],
        srfkey: [
            { type: 'string', message: '重要事项标识 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '重要事项标识 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '重要事项标识 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '重要事项标识 值不能为空', trigger: 'blur' },
        ],
        srfmajortext: [
            { type: 'string', message: '标题 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '标题 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '标题 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '标题 值不能为空', trigger: 'blur' },
        ],
        srftempmode: [
            { type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
        ],
        srfuf: [
            { type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
        ],
        srfdeid: [
            { type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
        ],
        srfsourcekey: [
            { type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: ' 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
        ],
        imname: [
            { type: 'string', message: '标题 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '标题 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '标题 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '标题 值不能为空', trigger: 'blur' },
        ],
        lcbh: [
            { type: 'string', message: '流程编号 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '流程编号 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '流程编号 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '流程编号 值不能为空', trigger: 'blur' },
        ],
        ngrname: [
            { type: 'string', message: '拟稿人 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '拟稿人 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '拟稿人 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '拟稿人 值不能为空', trigger: 'blur' },
        ],
        ngrbmname: [
            { type: 'string', message: '拟稿人所在部门 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '拟稿人所在部门 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '拟稿人所在部门 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '拟稿人所在部门 值不能为空', trigger: 'blur' },
        ],
        ngrjg: [
            { type: 'string', message: '拟稿人所在机构 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '拟稿人所在机构 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '拟稿人所在机构 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '拟稿人所在机构 值不能为空', trigger: 'blur' },
        ],
        ngrlxfs: [
            { type: 'string', message: '拟稿人联系方式 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '拟稿人联系方式 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '拟稿人联系方式 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '拟稿人联系方式 值不能为空', trigger: 'blur' },
        ],
        ngrq: [
            { type: 'string', message: '拟稿日期 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '拟稿日期 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '拟稿日期 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '拟稿日期 值不能为空', trigger: 'blur' },
        ],
        hjcd: [
            { type: 'string', message: '缓急程度 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '缓急程度 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '缓急程度 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '缓急程度 值不能为空', trigger: 'blur' },
        ],
        jjyy: [
            { type: 'string', message: '加急原因 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '加急原因 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '加急原因 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '加急原因 值不能为空', trigger: 'blur' },
        ],
        ngrbmid: [
            { type: 'string', message: '部门标识 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '部门标识 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '部门标识 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '部门标识 值不能为空', trigger: 'blur' },
        ],
        ngrid: [
            { type: 'string', message: '组织用户标识 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '组织用户标识 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '组织用户标识 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '组织用户标识 值不能为空', trigger: 'blur' },
        ],
        sblb: [
            { type: 'string', message: '申报类别 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '申报类别 值必须为字符串类型', trigger: 'blur' },
            { required: true, type: 'string', message: '申报类别 值不能为空', trigger: 'change' },
            { required: true, type: 'string', message: '申报类别 值不能为空', trigger: 'blur' },
        ],
        sblx: [
            { type: 'string', message: '申报类型 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '申报类型 值必须为字符串类型', trigger: 'blur' },
            { required: true, type: 'string', message: '申报类型 值不能为空', trigger: 'change' },
            { required: true, type: 'string', message: '申报类型 值不能为空', trigger: 'blur' },
        ],
        bz: [
            { type: 'string', message: '备注 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '备注 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '备注 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '备注 值不能为空', trigger: 'blur' },
        ],
        ngsh: [
            { type: 'string', message: '内部审核 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '内部审核 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '内部审核 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '内部审核 值不能为空', trigger: 'blur' },
        ],
        shfs: [
            { type: 'string', message: '审核方式 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '审核方式 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '审核方式 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '审核方式 值不能为空', trigger: 'blur' },
        ],
        bmld: [
            { type: 'string', message: '部门领导 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '部门领导 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '部门领导 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '部门领导 值不能为空', trigger: 'blur' },
        ],
        sjbm: [
            { type: 'number', message: '上级部门 值必须为数值类型', trigger: 'change' },
            { type: 'number', message: '上级部门 值必须为数值类型', trigger: 'blur' },
            { required: false, type: 'number', message: '上级部门 值不能为空', trigger: 'change' },
            { required: false, type: 'number', message: '上级部门 值不能为空', trigger: 'blur' },
        ],
        kgsbm: [
            { type: 'string', message: '跨公司部门 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '跨公司部门 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '跨公司部门 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '跨公司部门 值不能为空', trigger: 'blur' },
        ],
        kgsld: [
            { type: 'string', message: '跨公司领导 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '跨公司领导 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '跨公司领导 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '跨公司领导 值不能为空', trigger: 'blur' },
        ],
        ld: [
            { type: 'string', message: '领导 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '领导 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '领导 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '领导 值不能为空', trigger: 'blur' },
        ],
        sdfs: [
            { type: 'string', message: '送达方式 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '送达方式 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '送达方式 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '送达方式 值不能为空', trigger: 'blur' },
        ],
        yzdx: [
            { type: 'string', message: '阅知对象 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '阅知对象 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '阅知对象 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '阅知对象 值不能为空', trigger: 'blur' },
        ],
        tzyd: [
            { type: 'number', message: '通知阅读 值必须为数值类型', trigger: 'change' },
            { type: 'number', message: '通知阅读 值必须为数值类型', trigger: 'blur' },
            { required: false, type: 'number', message: '通知阅读 值不能为空', trigger: 'change' },
            { required: false, type: 'number', message: '通知阅读 值不能为空', trigger: 'blur' },
        ],
        tzydyy: [
            { type: 'string', message: '通知阅读原因 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '通知阅读原因 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '通知阅读原因 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '通知阅读原因 值不能为空', trigger: 'blur' },
        ],
        qttzyddx: [
            { type: 'string', message: '其他通知阅读对象 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '其他通知阅读对象 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '其他通知阅读对象 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '其他通知阅读对象 值不能为空', trigger: 'blur' },
        ],
        imid: [
            { type: 'string', message: '重要事项标识 值必须为字符串类型', trigger: 'change' },
            { type: 'string', message: '重要事项标识 值必须为字符串类型', trigger: 'blur' },
            { required: false, type: 'string', message: '重要事项标识 值不能为空', trigger: 'change' },
            { required: false, type: 'string', message: '重要事项标识 值不能为空', trigger: 'blur' },
        ],
    }

    /**
     * 详情模型集合
     *
     * @type {*}
     * @memberof Main3
     */
    protected detailsModel: any = {
        group1: new FormGroupPanelModel({ caption: '基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: true, form: this, uiActionGroup: { caption: '', langbase: 'im.main3_form', extractMode: 'ITEM', details: [] } })
, 
        druipart1: new FormDRUIPartModel({ caption: '', detailType: 'DRUIPART', name: 'druipart1', visible: true, isShowCaption: true, form: this })
, 
        grouppanel1: new FormGroupPanelModel({ caption: '重要事项申报相关信息', detailType: 'GROUPPANEL', name: 'grouppanel1', visible: true, isShowCaption: true, form: this, uiActionGroup: { caption: '', langbase: 'im.main3_form', extractMode: 'ITEM', details: [] } })
, 
        druipart2: new FormDRUIPartModel({ caption: '', detailType: 'DRUIPART', name: 'druipart2', visible: true, isShowCaption: true, form: this })
, 
        grouppanel4: new FormGroupPanelModel({ caption: '业务协作跟踪', detailType: 'GROUPPANEL', name: 'grouppanel4', visible: true, isShowCaption: true, form: this, uiActionGroup: { caption: '', langbase: 'im.main3_form', extractMode: 'ITEM', details: [] } })
, 
        grouppanel2: new FormGroupPanelModel({ caption: '阅知', detailType: 'GROUPPANEL', name: 'grouppanel2', visible: true, isShowCaption: true, form: this, uiActionGroup: { caption: '', langbase: 'im.main3_form', extractMode: 'ITEM', details: [] } })
, 
        grouppanel3: new FormGroupPanelModel({ caption: '通知阅读', detailType: 'GROUPPANEL', name: 'grouppanel3', visible: true, isShowCaption: true, form: this, uiActionGroup: { caption: '', langbase: 'im.main3_form', extractMode: 'ITEM', details: [] } })
, 
        formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this })
, 
        srfupdatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'srfupdatedate', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        srforikey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srforikey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        srfkey: new FormItemModel({ caption: '重要事项标识', detailType: 'FORMITEM', name: 'srfkey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        srfmajortext: new FormItemModel({ caption: '标题', detailType: 'FORMITEM', name: 'srfmajortext', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        srftempmode: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srftempmode', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        srfuf: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfuf', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        srfdeid: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfdeid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        srfsourcekey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfsourcekey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        imname: new FormItemModel({ caption: '标题', detailType: 'FORMITEM', name: 'imname', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        lcbh: new FormItemModel({ caption: '流程编号', detailType: 'FORMITEM', name: 'lcbh', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        ngrname: new FormItemModel({ caption: '拟稿人', detailType: 'FORMITEM', name: 'ngrname', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        ngrbmname: new FormItemModel({ caption: '拟稿人所在部门', detailType: 'FORMITEM', name: 'ngrbmname', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        ngrjg: new FormItemModel({ caption: '拟稿人所在机构', detailType: 'FORMITEM', name: 'ngrjg', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        ngrlxfs: new FormItemModel({ caption: '拟稿人联系方式', detailType: 'FORMITEM', name: 'ngrlxfs', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        ngrq: new FormItemModel({ caption: '拟稿日期', detailType: 'FORMITEM', name: 'ngrq', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        hjcd: new FormItemModel({ caption: '缓急程度', detailType: 'FORMITEM', name: 'hjcd', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        jjyy: new FormItemModel({ caption: '加急原因', detailType: 'FORMITEM', name: 'jjyy', visible: false, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        ngrbmid: new FormItemModel({ caption: '部门标识', detailType: 'FORMITEM', name: 'ngrbmid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        ngrid: new FormItemModel({ caption: '组织用户标识', detailType: 'FORMITEM', name: 'ngrid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        sblb: new FormItemModel({ caption: '申报类别', detailType: 'FORMITEM', name: 'sblb', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        sblx: new FormItemModel({ caption: '申报类型', detailType: 'FORMITEM', name: 'sblx', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        bz: new FormItemModel({ caption: '备注', detailType: 'FORMITEM', name: 'bz', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        ngsh: new FormItemModel({ caption: '内部审核', detailType: 'FORMITEM', name: 'ngsh', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        shfs: new FormItemModel({ caption: '审核方式', detailType: 'FORMITEM', name: 'shfs', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        bmld: new FormItemModel({ caption: '部门领导', detailType: 'FORMITEM', name: 'bmld', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        sjbm: new FormItemModel({ caption: '上级部门', detailType: 'FORMITEM', name: 'sjbm', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        kgsbm: new FormItemModel({ caption: '跨公司部门', detailType: 'FORMITEM', name: 'kgsbm', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        kgsld: new FormItemModel({ caption: '跨公司领导', detailType: 'FORMITEM', name: 'kgsld', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        ld: new FormItemModel({ caption: '领导', detailType: 'FORMITEM', name: 'ld', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        sdfs: new FormItemModel({ caption: '送达方式', detailType: 'FORMITEM', name: 'sdfs', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        yzdx: new FormItemModel({ caption: '阅知对象', detailType: 'FORMITEM', name: 'yzdx', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        tzyd: new FormItemModel({ caption: '通知阅读', detailType: 'FORMITEM', name: 'tzyd', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        tzydyy: new FormItemModel({ caption: '通知阅读原因', detailType: 'FORMITEM', name: 'tzydyy', visible: false, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        qttzyddx: new FormItemModel({ caption: '其他通知阅读对象', detailType: 'FORMITEM', name: 'qttzyddx', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
        imid: new FormItemModel({ caption: '重要事项标识', detailType: 'FORMITEM', name: 'imid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
, 
    };

    /**
     * 监控表单属性 srfupdatedate 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.srfupdatedate')
    onSrfupdatedateChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'srfupdatedate', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 srforikey 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.srforikey')
    onSrforikeyChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'srforikey', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 srfkey 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.srfkey')
    onSrfkeyChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'srfkey', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 srfmajortext 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.srfmajortext')
    onSrfmajortextChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'srfmajortext', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 srftempmode 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.srftempmode')
    onSrftempmodeChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'srftempmode', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 srfuf 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.srfuf')
    onSrfufChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'srfuf', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 srfdeid 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.srfdeid')
    onSrfdeidChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'srfdeid', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 srfsourcekey 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.srfsourcekey')
    onSrfsourcekeyChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'srfsourcekey', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 imname 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.imname')
    onImnameChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'imname', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 lcbh 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.lcbh')
    onLcbhChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'lcbh', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 ngrname 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.ngrname')
    onNgrnameChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'ngrname', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 ngrbmname 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.ngrbmname')
    onNgrbmnameChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'ngrbmname', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 ngrjg 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.ngrjg')
    onNgrjgChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'ngrjg', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 ngrlxfs 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.ngrlxfs')
    onNgrlxfsChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'ngrlxfs', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 ngrq 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.ngrq')
    onNgrqChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'ngrq', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 hjcd 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.hjcd')
    onHjcdChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'hjcd', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 jjyy 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.jjyy')
    onJjyyChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'jjyy', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 ngrbmid 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.ngrbmid')
    onNgrbmidChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'ngrbmid', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 ngrid 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.ngrid')
    onNgridChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'ngrid', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 sblb 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.sblb')
    onSblbChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'sblb', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 sblx 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.sblx')
    onSblxChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'sblx', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 bz 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.bz')
    onBzChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'bz', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 ngsh 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.ngsh')
    onNgshChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'ngsh', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 shfs 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.shfs')
    onShfsChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'shfs', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 bmld 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.bmld')
    onBmldChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'bmld', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 sjbm 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.sjbm')
    onSjbmChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'sjbm', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 kgsbm 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.kgsbm')
    onKgsbmChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'kgsbm', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 kgsld 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.kgsld')
    onKgsldChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'kgsld', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 ld 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.ld')
    onLdChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'ld', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 sdfs 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.sdfs')
    onSdfsChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'sdfs', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 yzdx 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.yzdx')
    onYzdxChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'yzdx', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 tzyd 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.tzyd')
    onTzydChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'tzyd', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 tzydyy 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.tzydyy')
    onTzydyyChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'tzydyy', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 qttzyddx 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.qttzyddx')
    onQttzyddxChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'qttzyddx', newVal: newVal, oldVal: oldVal });
    }

    /**
     * 监控表单属性 imid 值
     *
     * @param {*} newVal
     * @param {*} oldVal
     * @memberof Main3
     */
    @Watch('data.imid')
    onImidChange(newVal: any, oldVal: any) {
        this.formDataChange({ name: 'imid', newVal: newVal, oldVal: oldVal });
    }


    /**
     * 重置表单项值
     *
     * @private
     * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
     * @memberof Main3
     */
    private resetFormData({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
    }

    /**
      * 置空对象
      *
      * @param {any[]} args
      * @memberof EditForm
      */
    protected ResetData(_datas:any){
        if(Object.keys(_datas).length >0){
            Object.keys(_datas).forEach((name: string) => {
                if (this.data.hasOwnProperty(name)) {
                    this.data[name] = null;
                }
            });
        }
    }

    /**
     * 表单逻辑
     *
     * @private
     * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
     * @memberof Main3
     */
    private formLogic({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
                
























        if (Object.is(name, '') || Object.is(name, 'hjcd')) {
            let ret = false;
            const _hjcd = this.data.hjcd;
            if (this.$verify.testCond(_hjcd, 'EQ', '20') || this.$verify.testCond(_hjcd, 'EQ', '30')) {
                ret = true;
            }
            this.detailsModel.jjyy.setVisible(ret);
        }
















        if (Object.is(name, '') || Object.is(name, 'tzyd')) {
            let ret = false;
            const _tzyd = this.data.tzyd;
            if (this.$verify.testCond(_tzyd, 'EQ', '1')) {
                ret = true;
            }
            this.detailsModel.tzydyy.setVisible(ret);
        }



    }

    /**
     * 表单值变化
     *
     * @private
     * @param {{ name: string, newVal: any, oldVal: any }} { name, newVal, oldVal }
     * @returns {void}
     * @memberof Main3
     */
    private formDataChange({ name, newVal, oldVal }: { name: string, newVal: any, oldVal: any }): void {
        if (this.ignorefieldvaluechange) {
            return;
        }
        this.resetFormData({ name: name, newVal: newVal, oldVal: oldVal });
        this.formLogic({ name: name, newVal: newVal, oldVal: oldVal });
        this.dataChang.next(JSON.stringify(this.data));
    }

    /**
     * 表单加载完成
     *
     * @private
     * @param {*} [data={}]
     * @param {string} [action]
     * @memberof Main3
     */
    private onFormLoad(data: any = {},action:string): void {
        this.setFormEnableCond(data);
        this.fillForm(data,action);
        this.oldData = {};
        Object.assign(this.oldData, JSON.parse(JSON.stringify(this.data)));
        this.$store.commit('viewaction/setViewDataChange', { viewtag: this.viewtag, viewdatachange: false });
        this.formLogic({ name: '', newVal: null, oldVal: null });
    }

    /**
     * 值填充
     *
     * @param {*} [_datas={}]
     * @param {string} [action]
     * @memberof Main3
     */
    protected fillForm(_datas: any = {},action:string): void {
        this.ignorefieldvaluechange = true;
        Object.keys(_datas).forEach((name: string) => {
            if (this.data.hasOwnProperty(name)) {
                this.data[name] = _datas[name];
            }
        });
        if(Object.is(action,'loadDraft')){
            this.createDefault();
        }
        this.$nextTick(function () {
            this.ignorefieldvaluechange = false;
        })
    }

    /**
     * 设置表单项是否启用
     *
     * @protected
     * @param {*} data
     * @memberof Main3
     */
    protected setFormEnableCond(data: any): void {
        Object.values(this.detailsModel).forEach((detail: any) => {
            if (!Object.is(detail.detailType, 'FORMITEM')) {
                return;
            }
            const formItem: FormItemModel = detail;
            formItem.setEnableCond(data.srfuf);
        });
    }

    /**
     * 重置草稿表单状态
     *
     * @private
     * @memberof Main3
     */
    private resetDraftFormStates(): void {
        const form: any = this.$refs.form;
        if (form) {
            form.resetFields();
        }
    }

    /**
     * 重置校验结果
     *
     * @memberof Main3
     */
    protected resetValidates(): void {
        Object.values(this.detailsModel).forEach((detail: any) => {
            if (!Object.is(detail.detailType, 'FORMITEM')) {
                return;
            }
            const formItem: FormItemModel = detail;
            formItem.setError('');
        });
    }

    /**
     * 填充校验结果 （后台）
     *
     * @param {any[]} fieldErrors
     * @memberof Main3
     */
    protected fillValidates(fieldErrors: any[]): void {
        fieldErrors.forEach((error: any) => {
            const formItem: FormItemModel = this.detailsModel[error.field];
            if (!formItem) {
                return;
            }
            this.$nextTick(() => {
                formItem.setError(error.message);
            });
        });
    }

    /**
     * 表单校验状态
     *
     * @returns {boolean} 
     * @memberof Main3
     */
    protected formValidateStatus(): boolean {
        const form: any = this.$refs.form;
        let validatestate: boolean = true;
        form.validate((valid: boolean) => {
            validatestate = valid ? true : false;
        });
        return validatestate
    }

    /**
     * 获取全部值
     *
     * @returns {*}
     * @memberof Main3
     */
    protected getValues(): any {
        return this.data;
    }

    /**
     * 表单项值变更
     *
     * @param {{ name: string, value: any }} $event
     * @returns {void}
     * @memberof Main3
     */
    protected onFormItemValueChange($event: { name: string, value: any }): void {
        if (!$event) {
            return;
        }
        if (!$event.name || Object.is($event.name, '') || !this.data.hasOwnProperty($event.name)) {
            return;
        }
        this.data[$event.name] = $event.value;
    }

    /**
     * 设置数据项值
     *
     * @param {string} name
     * @param {*} value
     * @returns {void}
     * @memberof Main3
     */
    protected setDataItemValue(name: string, value: any): void {
        if (!name || Object.is(name, '') || !this.data.hasOwnProperty(name)) {
            return;
        }
        if (Object.is(this.data[name], value)) {
            return;
        }
        this.data[name] = value;
    }



    /**
     * 分组界面行为事件
     *
     * @param {*} $event
     * @memberof Main3
     */
    protected groupUIActionClick($event: any): void {
        if (!$event) {
            return;
        }
        const item:any = $event.item;
    }

    /**
     * Vue声明周期(处理组件的输入属性)
     *
     * @memberof Main3
     */
    protected created(): void {
        this.afterCreated();
    }

    /**
     * 执行created后的逻辑
     *
     *  @memberof Main3
     */    
    protected afterCreated(){
        if (this.viewState) {
            this.viewStateEvent = this.viewState.subscribe(({ tag, action, data }) => {
                if (!Object.is(tag, this.name)) {
                    return;
                }
                if (Object.is('autoload', action)) {
                    this.autoLoad(data);
                }
                if (Object.is('load', action)) {
                    this.load(data);
                }
                if (Object.is('loaddraft', action)) {
                    this.loadDraft(data);
                }
                if (Object.is('save', action)) {
                    this.save(data,data.showResultInfo);
                }
                if (Object.is('remove', action)) {
                    this.remove(data);
                }
                if (Object.is('saveandexit', action)) {
                    this.saveAndExit(data);
                }
                if (Object.is('saveandnew', action)) {
                    this.saveAndNew(data);
                }
                if (Object.is('removeandexit', action)) {
                    this.removeAndExit(data);
                }
                if (Object.is('refresh', action)) {
                    this.refresh(data);
                }
            });
        }
        this.dataChang
            .pipe(
                debounceTime(300),
                distinctUntilChanged()
            ).subscribe((data: any) => {
                if (this.autosave) {
                    this.autoSave();
                }
                const state = !Object.is(JSON.stringify(this.oldData), JSON.stringify(this.data)) ? true : false;
                this.$store.commit('viewaction/setViewDataChange', { viewtag: this.viewtag, viewdatachange: state });
            });
    }

    /**
     * vue 生命周期
     *
     * @memberof Main3
     */
    protected destroyed() {
        this.afterDestroy();
    }

    /**
     * 执行destroyed后的逻辑
     *
     * @memberof Main3
     */
    protected afterDestroy() {
        if (this.viewStateEvent) {
            this.viewStateEvent.unsubscribe();
        }
        if (this.dataChangEvent) {
            this.dataChangEvent.unsubscribe();
        }
    }

    /**
     * 拷贝内容
     *
     * @param {*} [arg={}]
     * @memberof @memberof Main3
     */
    protected copy(arg: any = {}): void {
        this.loadDraft(arg);
    }

    /**
     *打印
     *@memberof @memberof Main3
     */
    protected print(){
        let _this:any = this;
        _this.$print({id:'form',popTitle:'分送'});
    }

    /**
     * 部件刷新
     *
     * @param {any[]} args
     * @memberof Main3
     */
    protected refresh(args: any[]): void {
        let arg: any = {};
        Object.assign(arg,args[0]);
        if (this.data.srfkey && !Object.is(this.data.srfkey, '')) {
            Object.assign(arg, { srfkey: this.data.srfkey });
            this.load(arg);
            return;
        }
        if (this.data.srfkeys && !Object.is(this.data.srfkeys, '')) {
            Object.assign(arg, { srfkey: this.data.srfkeys });
            this.load(arg);
            return;
        }
    }

    /**
     * 自动加载
     *
     * @param {*} [arg={}]
     * @returns {void}
     * @memberof Main3
     */
    protected autoLoad(arg: any = {}): void {
        if (arg.srfkey && !Object.is(arg.srfkey, '')) {
            Object.assign(arg, { srfkey: arg.srfkey });
            this.load(arg);
            return;
        }
        if (arg.srfkeys && !Object.is(arg.srfkeys, '')) {
            Object.assign(arg, { srfkey: arg.srfkeys });
            this.load(arg);
            return;
        }
        this.loadDraft(arg);
    }

    /**
     * 加载
     *
     * @private
     * @param {*} [opt={}]
     * @memberof Main3
     */
    private load(opt: any = {}): void {
        if(!this.loadAction){
            this.$Notice.error({ title: '错误', desc: 'IMMS_20_30EditView视图表单loadAction参数未配置' });
            return;
        }
        const arg: any = { ...opt };
        let viewparamResult:any = Object.assign(arg,this.viewparams);
        const get: Promise<any> = this.service.get(this.loadAction,JSON.parse(JSON.stringify(this.context)),{viewparams:viewparamResult}, this.showBusyIndicator);
        get.then((response: any) => {
            if (response && response.status === 200) {
                const data = response.data;
                this.onFormLoad(data,'load');
                this.$emit('load', data);
                this.$nextTick(() => {
                    this.formState.next({ type: 'load', data: data });
                });
            }
        }).catch((response: any) => {
            if (response && response.status) {
                this.$Notice.error({ title: '错误', desc: response.message });
                return;
            }
            if (!response || !response.status || !response.data) {
                this.$Notice.error({ title: '错误', desc: '系统异常' });
                return;
            }
        });
    }

    /**
     * 加载草稿
     *
     * @param {*} [opt={}]
     * @memberof Main3
     */
    protected loadDraft(opt: any = {}): void {
        if(!this.loaddraftAction){
            this.$Notice.error({ title: '错误', desc: 'IMMS_20_30EditView视图表单loaddraftAction参数未配置' });
            return;
        }
        const arg: any = { ...opt } ;
        let viewparamResult:any = Object.assign(arg,this.viewparams);
        let post: Promise<any> = this.service.loadDraft(this.loaddraftAction,JSON.parse(JSON.stringify(this.context)),{viewparams:viewparamResult}, this.showBusyIndicator);
        post.then((response: any) => {
            if (!response.status || response.status !== 200) {
                if (response.errorMessage) {
                    this.$Notice.error({ title: '错误', desc: response.errorMessage });
                }
                return;
            }

            const data = response.data;
            if(data.im){
                Object.assign(this.context,{im:data.im})
            }
            this.resetDraftFormStates();
            this.onFormLoad(data,'loadDraft');
            this.$emit('load', data);
            this.$nextTick(() => {
                this.formState.next({ type: 'load', data: data });
            });
            setTimeout(() => {
                const form: any = this.$refs.form;
                if (form) {
                    form.fields.forEach((field: any) => {
                        field.validateMessage = "";
                        field.validateState = "";
                        field.validateStatus = false;
                    });
                }
            });
        }).catch((response: any) => {
            if (response && response.status) {
                this.$Notice.error({ title: '错误', desc: response.message });
                return;
            }
            if (!response || !response.status || !response.data) {
                this.$Notice.error({ title: '错误', desc: '系统异常' });
                return;
            }
        });
    }

    /**
     * 自动保存
     *
     * @param {*} [opt={}]
     * @memberof Main3
     */
    protected autoSave(opt: any = {}): void {
        if (!this.formValidateStatus()) {
            return;
        }
        const arg: any = { ...opt };
        const data = this.getValues();
        Object.assign(arg, data);
        const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
        if(!action){
            let actionName:any = Object.is(data.srfuf, '1')?"updateAction":"createAction";
            this.$Notice.error({ title: '错误', desc: 'IMMS_20_30EditView视图表单'+actionName+'参数未配置' });
            return;
        }
        Object.assign(arg,{viewparams:this.viewparams});
        const post: Promise<any> = this.service.add(action, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator);
        post.then((response: any) => {
            if (!response.status || response.status !== 200) {
                if (response.errorMessage) {
                    this.$Notice.error({ title: '错误', desc: response.errorMessage });
                }
                return;
            }

            const data = response.data;
            this.onFormLoad(data,'autoSave');
            this.$emit('save', data);
            this.$store.dispatch('viewaction/datasaved', { viewtag: this.viewtag });
            this.$nextTick(() => {
                this.formState.next({ type: 'save', data: data });
            });
        }).catch((response: any) => {
            if (response && response.status) {
                this.$Notice.error({ title: '错误', desc: response.message });
                return;
            }
            if (!response || !response.status || !response.data) {
                this.$Notice.error({ title: '错误', desc: '系统异常' });
                return;
            }
        });
    }

    /**
     * 保存
     *
     * @param {*} [opt={}]
     * @param {boolean} [showResultInfo] 
     * @param {boolean} [ifStateNext] formState是否下发通知
     * @returns {Promise<any>}
     * @memberof Main3
     */
    protected async save(opt: any = {}, showResultInfo?: boolean, ifStateNext: boolean = true): Promise<any> {
        return new Promise((resolve: any, reject: any) => {
            showResultInfo = showResultInfo === undefined ? true : false;
            opt.saveEmit = opt.saveEmit === undefined ? true :false;
            if (!this.formValidateStatus()) {
                this.$Notice.error({ title: '错误', desc: '值规则校验异常' });
                return;
            }
            const arg: any = { ...opt };
            const data = this.getValues();
            Object.assign(arg, data);
            Object.assign(arg, this.context);
            if (ifStateNext) {
                this.drcounter = 2;
                if(this.drcounter !== 0){
                    this.formState.next({ type: 'beforesave', data: arg });//先通知关系界面保存
                    this.saveState = resolve;
                    return;
                }
            }
            const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
            if(!action){
                let actionName:any = Object.is(data.srfuf, '1')?"updateAction":"createAction";
                this.$Notice.error({ title: '错误', desc: 'IMMS_20_30EditView视图表单'+actionName+'参数未配置' });
                return;
            }
            Object.assign(arg,{viewparams:this.viewparams});
            const post: Promise<any> = Object.is(data.srfuf, '1')?this.service.update(action, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator):this.service.add(action,JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator);
            post.then((response: any) => {
                if (!response.status || response.status !== 200) {
                    if (response.errorMessage) {
                        this.$Notice.error({ title: '错误', desc: response.errorMessage });
                    }
                    return;
                }

                const data = response.data;
                this.onFormLoad(data,'save');
                if(!opt.saveEmit){
                    this.$emit('save', data);
                }                
                this.$store.dispatch('viewaction/datasaved', { viewtag: this.viewtag });
                this.$nextTick(() => {
                    this.formState.next({ type: 'save', data: data });
                });
                if (showResultInfo) {
                    this.$Notice.success({ title: '', desc: (data.srfmajortext ? data.srfmajortext : '') + '&nbsp;保存成功！' });
                }
                resolve(response);
            }).catch((response: any) => {
                if (response && response.status) {
                    this.$Notice.error({ title: '错误', desc: response.message });
                    reject(response);
                    return;
                }
                if (!response || !response.status || !response.data) {
                    this.$Notice.error({ title: '错误', desc: '系统异常' });
                    reject(response);
                    return;
                }
                reject(response);
            });
        })
    }

    /**
    * 删除
    *
    * @private
    * @param {*} [opt={}]
    * @memberof EditForm
    */
    private remove(opt:Array<any> = [],showResultInfo?: boolean): Promise<any> {
        return new Promise((resolve: any, reject: any) => {
            if(!this.removeAction){
                this.$Notice.error({ title: '错误', desc: 'IMMS_20_30EditView视图表单removeAction参数未配置' });
                return;
            }
            const arg: any = opt[0];
            const _this: any = this;
            Object.assign(arg,{viewparams:this.viewparams});
            this.service.delete(_this.removeAction, JSON.parse(JSON.stringify(this.context)),arg, showResultInfo).then((response: any) => {
                if (response) {
                    const data = response.data;
                    this.$emit('remove',data);
                    this.formState.next({ type: 'remove', data: data });
                    this.data.ismodify = false;
                    this.$Notice.success({ title: '', desc: (data.srfmajortext ? data.srfmajortext : '') + '&nbsp;删除成功！' });
                    resolve(response);
                }
            }).catch((error: any) => {
                const { data: _data } = error;
                this.$Notice.error({ title: _data.title, desc: _data.message });
                reject(error);
            });
        });
    }

    /**
     * 工作流启动
     *
     * @param {*} [data={}]
     * @returns {Promise<any>}
     * @memberof Main3
     */
    protected async wfstart(data: any): Promise<any> {
        return new Promise((resolve: any, reject: any) => {
            if(!this.WFStartAction){
                this.$Notice.error({ title: '错误', desc: 'WFCIDEditView视图表单WFStartAction参数未配置' });
                return;
            }
            const _this: any = this;
            const arg: any = data[0];
            Object.assign(arg,{viewparams:this.viewparams});
            const post: Promise<any> = Object.is(data.srfuf, '1')?this.service.update(this.updateAction, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator):this.service.add(this.createAction,JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator);
            post.then((response:any) =>{
                const arg:any = response.data;
                if(this.viewparams){
                    Object.assign(arg,{viewparams:this.viewparams});
                }
                const result: Promise<any> = this.service.wfstart(_this.WFStartAction, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator);
                result.then((response: any) => {
                    if (!response || response.status !== 200) {
                        this.$Notice.error({ title: '', desc: '工作流启动失败, ' + response.info });
                        return;
                    }
                    this.$Notice.info({ title: '', desc: '工作流启动成功' });
                    resolve(response);
            }).catch((response: any) => {
                if (response && response.status) {
                    this.$Notice.error({ title: '错误', desc: response.message });
                    reject(response);
                    return;
                }
                if (!response || !response.status || !response.data) {
                    this.$Notice.error({ title: '错误', desc: '系统异常' });
                    reject(response);
                    return;
                }
                reject(response);
            });
            }).catch((response: any) => {
                    if (response && response.status) {
                        this.$Notice.error({ title: '错误', desc: response.message });
                        reject(response);
                        return;
                    }
                    if (!response || !response.status || !response.data) {
                        this.$Notice.error({ title: '错误', desc: '系统异常' });
                        reject(response);
                        return;
                    }
                    reject(response);
            })
        });
    }

    /**
     * 工作流提交
     *
     * @param {*} [data={}]
     * @returns {Promise<any>}
     * @memberof Main3
     */
    protected async wfsubmit(data: any): Promise<any> {
        return new Promise((resolve: any, reject: any) => {
        if(!this.WFSubmitAction){
            this.$Notice.error({ title: '错误', desc: 'IMMS_20_30EditView视图表单WFSubmitAction参数未配置' });
            return;
        }
        const _this: any = this;
        const arg: any = data[0];
        Object.assign(arg,{viewparams:this.viewparams});
        if (!arg.im || Object.is(arg.im, '')) {
            return;
        }
        const post: Promise<any> = Object.is(arg.srfuf, '1')?this.service.update(this.updateAction, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator):this.service.add(this.createAction,JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator);
        post.then((response:any) =>{
                const arg:any = response.data;
                if(this.viewparams){
                    Object.assign(arg,{viewparams:this.viewparams});
                }
                const result: Promise<any> = this.service.wfsubmit(_this.WFSubmitAction, JSON.parse(JSON.stringify(this.context)),arg, this.showBusyIndicator);
                result.then((response: any) => {
                    if (!response || response.status !== 200) {
                        this.$Notice.error({ title: '', desc: '工作流提交失败, ' + response.info });
                        return;
                    }
                    this.$Notice.info({ title: '', desc: '工作流提交成功' });
                    resolve(response);
            }).catch((response: any) => {
                if (response && response.status) {
                    this.$Notice.error({ title: '错误', desc: response.message });
                    reject(response);
                    return;
                }
                if (!response || !response.status || !response.data) {
                    this.$Notice.error({ title: '错误', desc: '系统异常' });
                    reject(response);
                    return;
                }
                reject(response);
            });
            }).catch((response: any) => {
                    if (response && response.status) {
                        this.$Notice.error({ title: '错误', desc: response.message });
                        reject(response);
                        return;
                    }
                    if (!response || !response.status || !response.data) {
                        this.$Notice.error({ title: '错误', desc: '系统异常' });
                        reject(response);
                        return;
                    }
                    reject(response);
            })
        })
    }

    /**
     * 表单项更新
     *
     * @param {string} mode 界面行为名称
     * @param {*} [data={}] 请求数据
     * @param {string[]} updateDetails 更新项
     * @param {boolean} [showloading] 是否显示加载状态
     * @returns {void}
     * @memberof Main3
     */
    protected updateFormItems(mode: string, data: any = {}, updateDetails: string[], showloading?: boolean): void {
        if (!mode || (mode && Object.is(mode, ''))) {
            return;
        }
        const arg: any = { ...data };
        Object.assign(arg,this.viewparams);
        const post: Promise<any> = this.service.frontLogic(mode,JSON.parse(JSON.stringify(this.context)),arg, showloading);
        post.then((response: any) => {
            if (!response || response.status !== 200) {
                this.$Notice.error({ title: '错误', desc: '表单项更新失败' });
                return;
            }
            const data = response.data;
            const _data: any = {};
            updateDetails.forEach((name: string) => {
                if (!data.hasOwnProperty(name)) {
                    return;
                }
                Object.assign(_data, { [name]: data[name] });
            });
            this.setFormEnableCond(_data);
            this.fillForm(_data,'updateFormItem');
            this.formLogic({ name: '', newVal: null, oldVal: null });
            this.dataChang.next(JSON.stringify(this.data));
            this.$nextTick(() => {
                this.formState.next({ type: 'updateformitem', ufimode: arg.srfufimode, data: _data });
            });
        }).catch((response: any) => {
            if (response && response.status) {
                this.$Notice.error({ title: '错误', desc: response.message });
                return;
            }
            if (!response || !response.status || !response.data) {
                this.$Notice.error({ title: '错误', desc: '系统异常' });
                return;
            }
        });
    }

    /**
     * 回车事件
     *
     * @param {*} $event
     * @memberof Main3
     */
    protected onEnter($event: any): void {
    }

    /**
     * 保存并退出
     *
     * @param {any[]} args
     * @memberof Main3
     */
    protected saveAndExit(data:any[]):Promise<any>{
        let _this = this;
        return new Promise((resolve: any, reject: any) =>{
            let arg: any = {};
            if(data && data.length > 0){
                Object.assign(arg,data[0]);
            }
            _this.currentAction = "saveAndExit";
            _this.save([arg]).then((res) =>{
                if(res){
                    _this.closeView(res.data);
                }
                resolve(res);
            }).catch((error) =>{
                reject(error);
            })
        })
    }

    /**
     * 保存并新建
     *
     * @param {any[]} args
     * @memberof Main3
     */
    protected saveAndNew(data:any[]):Promise<any>{
        let _this = this;
        return new Promise((resolve: any, reject: any) =>{
            let arg: any = {};
            if(data && data.length > 0){
                Object.assign(arg,data[0]);
            }
            _this.currentAction = "saveAndNew";
            _this.save([arg]).then((res) =>{
                _this.ResetData(res);
                _this.loadDraft({});
            }).catch((error) =>{
                reject(error);
            })
        })
    }

    /**
     * 删除并退出
     *
     * @param {any[]} args
     * @memberof Main3
     */
    protected removeAndExit(data:any[]):Promise<any>{
        let _this = this;
        return new Promise((resolve: any, reject: any) =>{
            let arg: any = {};
            if(data && data.length > 0){
                Object.assign(arg,data[0]);
            }
            _this.remove([arg]).then((res) =>{
                if(res){
                  _this.closeView(res.data);
                }
                resolve(res);
            }).catch((error) =>{
                reject(error);
            })
        })
    }

    /**
    * 关系界面数据保存完成
    *
    * @param {any} $event
    * @memberof Main3
    */
    protected drdatasaved($event:any){
        let _this = this;
        this.drcounter--;
        if(this.drcounter > 0){
            return;
        }
        this.save({}, undefined, false).then((res) =>{
            this.saveState(res);
            if(Object.is(_this.currentAction, "saveAndNew")){
                _this.ResetData(res);
                _this.loadDraft({});
            }else if(Object.is(_this.currentAction, "saveAndExit")){
                if(res){
                    _this.closeView(res.data);
                }
            }
        });
    }

    /**
     * 新建默认值
     * @memberof Main3
     */
    public createDefault(){                    
        if (this.data.hasOwnProperty('hjcd')) {
            this.data['hjcd'] = '10';
        }
        if (this.data.hasOwnProperty('shfs')) {
            this.data['shfs'] = '20';
        }
        if (this.data.hasOwnProperty('sdfs')) {
            this.data['sdfs'] = '10';
        }
    }

    
}
</script>

<style lang='less'>
@import './main3-form.less';
</style>