<template>
    <!-- 弹出框表单 -->
    <el-dialog :title="title" :visible.sync="open" width="90%" append-to-body>
        <el-form ref="form" :model="form" :rules="rules" label-width="120px">
            <el-row>
                                            <Field label="从政务系统来的事项id" prop="tid" v-model="form.tid" placeholder="请输入从政务系统来的事项id"/>
                            <Field label="从政务系统来的事项code" prop="tcode" v-model="form.tcode" placeholder="请输入从政务系统来的事项code"/>
                            <Field label="从政务系统来的事项name" prop="tname" v-model="form.tname" type="textarea" placeholder="请输入从政务系统来的事项name"/>
                            <Field label="事项名称" prop="matterName" v-model="form.matterName" placeholder="请输入事项名称"/>
                            <Field label="英语事项名" prop="englishName" v-model="form.englishName" type="textarea" placeholder="请输入英语事项名"/>
                            <Field label="事项编号" prop="matterNo" v-model="form.matterNo" placeholder="请输入事项编号"/>
                            <Field label="所属部门" prop="belongDept" v-model="form.belongDept" placeholder="请输入所属部门"/>
                            <Field label="服务对象 " prop="appoveObjectShow" v-model="form.appoveObjectShow" type="select" :enumData="dict.appoveObjectShow" placeholder="请选择服务对象 "/>
                            <Field label="通办范围 " prop="operatScopeShow" v-model="form.operatScopeShow" type="select" :enumData="dict.operatScopeShow" placeholder="请选择通办范围 "/>
                            <Field label="办件类型" prop="appoveTimeLimitShow" v-model="form.appoveTimeLimitShow" type="select" :enumData="dict.appoveTimeLimitShow" placeholder="请选择办件类型"/>
                            <Field label="办理形式" prop="handleType" v-model="form.handleType" type="select" :enumData="dict.handleType" placeholder="请选择办理形式"/>
                            <Field label="法定办结时限" prop="legalTimeLimitShow" v-model="form.legalTimeLimitShow" placeholder="请输入法定办结时限"/>
                            <Field label="法定时限办结说明" prop="legalEndExplain" v-model="form.legalEndExplain" type="textarea" placeholder="请输入法定时限办结说明"/>
                            <Field label="承诺办结时限" prop="promiseTimeLimitShow" v-model="form.promiseTimeLimitShow" placeholder="请输入承诺办结时限"/>
                            <Field label="承诺时限办结说明" prop="promiseEndExplain" v-model="form.promiseEndExplain" type="textarea" placeholder="请输入承诺时限办结说明"/>
                            <Field label="是否收费" prop="isChargesShow" v-model="form.isChargesShow" type="radio" :enumData="dict.isChargesShow" />
                            <Field label="认证等级需求" prop="certificationLevelsShow" v-model="form.certificationLevelsShow" type="select" :enumData="dict.certificationLevelsShow" placeholder="请选择认证等级需求"/>
                            <Field label="计划生效日期" prop="planTakeTime" v-model="form.planTakeTime" type="date" />
                            <Field label="承诺生效日期" prop="promiseTakeTime" v-model="form.promiseTakeTime" type="date" />
                            <Field label="特别程序" prop="specialProcedure" v-model="form.specialProcedure" placeholder="请输入特别程序"/>
                            <Field label="窗口到现场次数" prop="windowToTheSceneNum" v-model="form.windowToTheSceneNum" type="select" :enumData="dict.windowToTheSceneNum" placeholder="请选择窗口到现场次数"/>
                            <Field label="是否网上预约,窗口办理选" prop="isOnlineSubscribeShow" v-model="form.isOnlineSubscribeShow" type="radio" :enumData="dict.isOnlineSubscribeShow" />
                            <Field label="物流快递,窗口办理选" prop="isExpressTakeShow" v-model="form.isExpressTakeShow" type="radio" :enumData="dict.isExpressTakeShow" />
                            <Field label="是否支持全省范围就近取件" prop="isProvinceAcquisitionShow" v-model="form.isProvinceAcquisitionShow" type="radio" :enumData="dict.isProvinceAcquisitionShow" />
                            <Field label="是否支持全省范围就近办理" prop="isApplyProvinceShow" v-model="form.isApplyProvinceShow" type="radio" :enumData="dict.isApplyProvinceShow" />
                            <Field label="必须到现场原因" prop="mustSceneExplain" v-model="form.mustSceneExplain" type="textarea" placeholder="请输入必须到现场原因"/>
                            <Field label="网办类型" prop="onlineType" v-model="form.onlineType" type="select" :enumData="dict.onlineType" placeholder="请选择网办类型"/>
                            <Field label="网办到现场次数" prop="onlineToTheSceneNum" v-model="form.onlineToTheSceneNum" type="select" :enumData="dict.onlineToTheSceneNum" placeholder="请选择网办到现场次数"/>
                            <Field label="网络办理深度" prop="onlineOperatDeep" v-model="form.onlineOperatDeep" type="select" :enumData="dict.onlineOperatDeep" placeholder="请选择网络办理深度"/>
                            <Field label="物流快递，网上办理选" prop="isExpressTakeOnlineShow" v-model="form.isExpressTakeOnlineShow" type="radio" :enumData="dict.isExpressTakeOnlineShow" />
                            <Field label="是否支持上门收取申请" prop="isDoorTakeShow" v-model="form.isDoorTakeShow" type="radio" :enumData="dict.isDoorTakeShow" />
                            <Field label="网上必须到现场原因" prop="onlineMustSceneExplain" v-model="form.onlineMustSceneExplain" type="textarea" placeholder="请输入网上必须到现场原因"/>
                            <Field label="实施主体" prop="performDeptType" v-model="form.performDeptType" type="select" :enumData="dict.performDeptType" placeholder="请选择实施主体"/>
                            <Field label="事项版本" prop="matterEdition" v-model="form.matterEdition" placeholder="请输入事项版本"/>
                            <Field label="事项类型名称" prop="eventTypeShow" v-model="form.eventTypeShow" type="select" :enumData="dict.eventTypeShow" placeholder="请选择事项类型名称"/>
                            <Field label="行使层级名称" prop="performHierarchyShow" v-model="form.performHierarchyShow" type="select" :enumData="dict.performHierarchyShow" placeholder="请选择行使层级名称"/>
                            <Field label="权力来源" prop="powerSourceShow" v-model="form.powerSourceShow" type="select" :enumData="dict.powerSourceShow" placeholder="请选择权力来源"/>
                            <Field label="实施主体性质" prop="performDeptTypeShow" v-model="form.performDeptTypeShow" type="select" :enumData="dict.performDeptTypeShow" placeholder="请选择实施主体性质"/>
                            <Field label="是否进驻中心" prop="goveServiceCenterShow" v-model="form.goveServiceCenterShow" type="radio" :enumData="dict.goveServiceCenterShow" />
                            <Field label="是否纳入便民服务中心" prop="isConvenientCenterShow" v-model="form.isConvenientCenterShow" type="radio" :enumData="dict.isConvenientCenterShow" />
                            <Field label="自助终端办理 " prop="terminalHandle" v-model="form.terminalHandle" type="radio" :enumData="dict.terminalHandle" />
                            <Field label="是否网办 " prop="isOnline" v-model="form.isOnline" type="radio" :enumData="dict.isOnline" />
                            <Field label="支持网上支付" prop="isOnlinePayShow" v-model="form.isOnlinePayShow" type="radio" :enumData="dict.isOnlinePayShow" />
                            <Field label="委托部门" prop="entrustmentDepartmen" v-model="form.entrustmentDepartmen" type="radio" :enumData="dict.entrustmentDepartmen" />
                            <Field label="联办机构" prop="jointInfoShow" v-model="form.jointInfoShow" placeholder="请输入联办机构"/>
                            <Field label="事项状态" prop="matterStatus" v-model="form.matterStatus" type="radio" :enumData="dict.matterStatus" />
                            <Field label="数量限制" prop="numberLimit" v-model="form.numberLimit" placeholder="请输入数量限制"/>
                            <Field label="主题类型" prop="type" v-model="form.type" placeholder="请输入主题类型"/>
                            <Field label="基本编码" prop="baseCode" v-model="form.baseCode" placeholder="请输入基本编码"/>
                            <Field label="实施编码" prop="implementCode" v-model="form.implementCode" placeholder="请输入实施编码"/>
                            <Field label="实施主体编码" prop="implementBodyCode" v-model="form.implementBodyCode" placeholder="请输入实施主体编码"/>
                            <Field label="办理项编码" prop="operateItemCode" v-model="form.operateItemCode" placeholder="请输入办理项编码"/>
                            <Field label="乡镇街道名称" prop="townshipName" v-model="form.townshipName" placeholder="请输入乡镇街道名称"/>
                            <Field label="乡镇街道代码" prop="townshipCode" v-model="form.townshipCode" placeholder="请输入乡镇街道代码"/>
                            <Field label="村居社区名称" prop="villageName" v-model="form.villageName" placeholder="请输入村居社区名称"/>
                            <Field label="村居社区代码" prop="villageCode" v-model="form.villageCode" placeholder="请输入村居社区代码"/>
                            <Field label="办理时间" prop="operateTime" v-model="form.operateTime" placeholder="请输入办理时间"/>
                            <Field label="办理地点" prop="operateSite" v-model="form.operateSite" type="textarea" placeholder="请输入办理地点"/>
                            <Field label="咨询方式" prop="cousultingShow" v-model="form.cousultingShow" type="textarea" placeholder="请输入咨询方式"/>
                            <Field label="咨询电话" prop="cousultingTelephoneShow" v-model="form.cousultingTelephoneShow" placeholder="请输入咨询电话"/>
                            <Field label="监督方式" prop="superviseShow" v-model="form.superviseShow" type="textarea" placeholder="请输入监督方式"/>
                            <Field label="排序" prop="sort" v-model="form.sort" placeholder="请输入排序"/>

            </el-row>

        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button type="primary" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
            <el-button @click="cancel">取 消</el-button>
        </div>
    </el-dialog>
</template>

<script>
    import form from "@/assets/mixins/formdialog";
    import dialogShow from "./dialogshow";
    export default {
        mixins: [form],
        components: {
            dialogShow ,
        },
        data() {
            return {
                // 遮罩层
                loading: true,
                // 弹出层标题
                title: "基础事项",
                // 是否显示弹出层
                open: false,
                toString:[
                    "windowToTheSceneNum",
                    "onlineToTheSceneNum",
                    "parson",
                    "lengal",
                ],
                // 表单校验
                rules: {
                }
            };
        },

        methods: {
            /** 编辑 */
            edit(row) {
                this.reset()
                this.query = { id: row.id };
                this.urls.currUrl =this.pageInfo.editUrl;;
                this.getData();
                this.pageInfo.type="edit"
                this.title = "修改基础事项";
            },
            /** 新增 */
            add(row) {
                this.reset()
                this.query = { id: row.id };
                this.urls.currUrl = this.pageInfo.addUrl;
                this.getData();
                this.pageInfo.type="add"
                this.title = "新增基础事项";
            },
            /** 查看*/
            view(row) {
                this.reset()
                this.query = { id: row.id };
                this.urls.currUrl =this.pageInfo.viewUrl;;
                this.getData();
                this.pageInfo.type="view"
                this.title = "基础事项详细";
            },
            /**取消按钮 */
            cancel() {
                this.open = false;
            },
            /**获取数据后弹框 */
            afterRender(data) {
                this.open = true;
            },

            afterSubmit(data) {
                this.open = false;
                this.$emit("ok");
            },

            // 表单重置
            reset() {
                this.form = {
                    siteId : null,
                    tid : null,
                    tcode : null,
                    tname : null,
                    matterName : null,
                    englishName : "",
                    matterNo : null,
                    belongDept : null,
                    appoveObjectShow : "事业法人",
                    operatScopeShow : "无",
                    appoveTimeLimitShow : "网络办件",
                    handleType : "窗口办理",
                    legalTimeLimitShow : null,
                    legalEndExplain : null,
                    promiseTimeLimitShow : null,
                    promiseEndExplain : null,
                    isChargesShow : "否",
                    certificationLevelsShow : "实名认证",
                    planTakeTime : null,
                    promiseTakeTime : null,
                    specialProcedure : null,
                    windowToTheSceneNum : null,
                    isOnlineSubscribeShow : "否",
                    isExpressTakeShow : "否",
                    isProvinceAcquisitionShow : "否",
                    isApplyProvinceShow : "否",
                    mustSceneExplain : null,
                    onlineType : "原件预审",
                    onlineToTheSceneNum : 0,
                    onlineOperatDeep : "互联网咨询",
                    isExpressTakeOnlineShow : null,
                    isDoorTakeShow : "否",
                    onlineMustSceneExplain : null,
                    performDeptType : null,
                    matterEdition : null,
                    eventTypeShow : "行政许可",
                    performHierarchyShow : null,
                    powerSourceShow : null,
                    performDeptTypeShow : null,
                    goveServiceCenterShow : "否",
                    isConvenientCenterShow : "否",
                    terminalHandle : "是",
                    isOnline : "是",
                    isOnlinePayShow : "是",
                    entrustmentDepartmen : "是",
                    jointInfoShow : null,
                    matterStatus : "在用",
                    numberLimit : null,
                    type : "",
                    baseCode : null,
                    implementCode : null,
                    implementBodyCode : null,
                    operateItemCode : null,
                    townshipName : null,
                    townshipCode : null,
                    villageName : null,
                    villageCode : null,
                    operateTime : null,
                    operateSite : null,
                    cousultingShow : null,
                    cousultingTelephoneShow : null,
                    superviseShow : null,
                    mattertype : "否",
                    deptCode : null,
                    dirListCode : null,
                    runSystemShow : null,
                    jointReviewInfoShow : null,
                    doThingTypeShow : null,
                    pubTimeShow : null,
                    supervisoryTelephoneShow : null,
                    handleTimeShow : null,
                    handlePlaceShow : null,
                    daysTypeShow : null,
                    tradeShow : null,
                    eventSourceShow : null,
                    applyresultTypeShow : null,
                    typeOfReview : null,
                    enforcement : null,
                    serviceClassification : null,
                    licenseNumber : null,
                    number : null,
                    inquire : null,
                    handlingresultNames : null,
                    sampleApprovalResults : null,
                    performDeptName : null,
                    html : null,
                    eventType : null,
                    shardKey : null,
                    parson : null,
                    lengal : null,
                    materialRemark : null,
                    codeurl : "",
                    applyObject : "",
                    isUniteAccept : "",
                    sort : null,
                };
                this.resetForm("form");
            },
            resetForm(refName) {
                if (this.$refs[refName]) {
                    this.$refs[refName].resetFields();
                }
            },
        },
    };
</script>
