<template>
  <div class="template-wrap" :style="{ height: bodyHeight}">
    <div class="template-contain">
      <!-- 模板body -->
      <div class="template-body">
        <!-- 中间 -->
        <div class="template-cell template-cell-m">
          <div class="phone-view">
            <div class="phone-show-content">
              <!-- 拖拽展示区域 -->
              <div class="drag-show-content">
                <div class="view-container">
                  <ul class="view-content" id="showPhoneView">
                   <!--  <template v-if="tempaletDataList.length == 0">
                      <img class="templet-null-img" src="../../assets/templet_null_img.png"/>
                    </template> -->
                    <div
                        :options="{group:{name:'people', pull:false, put:false },sort: false}"
                        v-model="tempaletDataList"
                        class="drag-wrap"
                        >
                        <li
                          :class="['filed-item',currentIndex == index? 'active-item': '','li-block']"
                          v-for="(item,index) in tempaletDataList"
                          >
                          <!-- 删除 -->
                          <!-- <span
                            v-if= "item.fieldCode != 'baseInfo'"
                            class="item-close p-item-close"
                            >
                            <i class="el-icon-close"></i>
                          </span> -->

                          <template>
                            <div class="block">
                              <div class="block-head">
                                <div :class="['opencard-item-title',item.fieldName.length>6? 'block-pre-wrap': '']">{{item.fieldName}}</div>
                              </div>
                              <ul class="view-content">
                                <div
                                  :options="{group:{name:'people', pull:false, put:false },sort: false}"
                                  v-model="item.children" :class="['drag-wrap','block-wrap',item.fieldCode]"
                                  >

                                  <li
                                    :class="['filed-item','child-filed-item',(currentChildKey == childItem.fieldCode && currentChildIndex == ind)? 'active-item': '']"
                                    v-for="(childItem,ind) in item.children"
                                    >
                                    <!-- 删除 -->
                                    <!-- <span
                                      class="item-close child-item-close"
                                      v-if="childItem.fieldCode!='clerkPhone'">
                                      <i class="el-icon-close"></i>
                                    </span> -->
                                    <!-- item -->
                                    <!-- 单择/多选/日期 -->
                                    <div v-if="(childItem.fieldType == 2 || childItem.fieldType == 3 || childItem.fieldType == 4)">
                                      <div :class="['opencard-item-title',childItem.fieldName.length>6? 'title-pre-wrap': '']">{{childItem.fieldName}}</div>
                                      <div class="draged-item-show">
                                        <span class="show-warm-text show-warm-text-flag select-flag">{{childItem.fieldDescription}} <i class="el-icon-arrow-right"></i></span>
                                      </div>
                                    </div>
                                    <!-- 日期区间 -->
                                    <div v-if="(childItem.fieldType == 5)">
                                      <div>
                                        <div :class="['opencard-item-title',childItem.fieldOperations.startName.length>6? 'title-pre-wrap': '']">{{childItem.fieldOperations.startName}}</div>
                                        <div class="draged-item-show">
                                          <span class="show-warm-text show-warm-text-flag select-flag">{{childItem.fieldOperations.startDescription}}<i class="el-icon-arrow-right"></i></span>
                                        </div>
                                      </div>
                                      <div class="b-t-1">
                                        <div :class="['opencard-item-title',childItem.fieldOperations.endName.length>6? 'title-pre-wrap': '']">{{childItem.fieldOperations.endName}}</div>
                                        <div class="draged-item-show">
                                          <span class="show-warm-text show-warm-text-flag select-flag">{{childItem.fieldOperations.endDescription}}<i class="el-icon-arrow-right"></i></span>
                                        </div>
                                      </div>
                                    </div>
                                    <!-- 图片 -->
                                    <div v-if="(childItem.fieldType == 7)">
                                      <div :class="['opencard-item-title',childItem.fieldName.length>6? 'title-pre-wrap': '']">{{childItem.fieldName}}</div>
                                      <div class="draged-item-show">
                                        <span class="show-warm-text show-warm-text-flag select-flag"><i class="iconfont icon-icon"></i></span>
                                      </div>
                                    </div>
                                    <!-- 单行/多行/数字输入框 -->
                                    <div v-if="(childItem.fieldType == 0 || childItem.fieldType == 1 || childItem.fieldType == 6)">
                                      <div :class="['opencard-item-title',childItem.fieldName.length>6? 'title-pre-wrap': '']" >{{childItem.fieldName}}</div>
                                      <div class="draged-item-show">
                                        <span class="show-warm-text show-warm-text-flag">{{childItem.fieldDescription}}</span>
                                      </div>
                                    </div>
                                  </li>
                                </div>
                              </ul>
                            </div>
                          </template>

                        </li>
                    </div>
                  </ul>
                </div>

              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import showMsg from '@/common/js/showmsg';
import errMsg  from '@/common/js/error';
import { getRequest, postRequest, postJson, postForm } from '@/api/api';

export default {
  name: "staffRecordsTemplate",
  data() {
    return {
      bodyHeight: (document.documentElement.clientHeight || document.body.clientHeight) + 'px',
      selectKey: '',

      // 基本信息
      baseInfo: [],
      // 工作信息
      jobInfo: [],
      // 个人信息
      selfInfo: [],
      // 学历信息
      eduInfo: [],
      // 合同信息
      contractInfo: [],
      // 紧急联系人
      contactInfo: [],
      // 个人材料
      personalInfo: [],
      // 自定义
      defineInfo: [],

      // 中间数据集合
      currentIndex: 0, //当前选择的 item
      // children
      currentChildKey: null,
      currentChildIndex: null,
      childIndex: 0,

      tempaletDataList: [
{
    "fieldTemplateId": "a7beaa6649e84cecb9518cc0ed041118",
    "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
    "fieldName": "基本信息",
    "fieldEdited": false,
    "isMust": false,
    "fieldDescription": "",
    "fieldCode": "baseInfo",
    "parentCode": "0",
    "parentFieldTemplateId": "-1",
    "fieldType": 0,
    "fieldOperations":
    {},
    "fixed": false,
    "minCount": null,
    "maxCount": null,
    "staffRecordsIds": [],
    "status": 1,
    "sort": 0,
    "systemFlag": true,
    "createTime": 1545017321000,
    "updateTime": 1545017321000,
    "children": [
    {
        "fieldTemplateId": "5f4d25e1acc140059cdd864f8227957b",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "姓名",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "clerkName",
        "parentCode": "baseInfo",
        "parentFieldTemplateId": "a7beaa6649e84cecb9518cc0ed041118",
        "fieldType": 0,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 0,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "836f80b74a9248f780f213ed932f7d1c",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "部门",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "groupName",
        "parentCode": "baseInfo",
        "parentFieldTemplateId": "a7beaa6649e84cecb9518cc0ed041118",
        "fieldType": 0,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 1,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "414cda6513d04e8590e8b6b585636b0a",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "手机号",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "clerkPhone",
        "parentCode": "baseInfo",
        "parentFieldTemplateId": "a7beaa6649e84cecb9518cc0ed041118",
        "fieldType": 6,
        "fieldOperations":
        {
            "ruleContent": [],
            "unit": "",
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 2,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "0cfc5f3696e243e096963de8fe59052c",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "code",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "clerkCode",
        "parentCode": "baseInfo",
        "parentFieldTemplateId": "a7beaa6649e84cecb9518cc0ed041118",
        "fieldType": 0,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 3,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "e0c35a5ad0a84419a9092cf2a3468b4b",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "邮箱",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "clerkEmail",
        "parentCode": "baseInfo",
        "parentFieldTemplateId": "a7beaa6649e84cecb9518cc0ed041118",
        "fieldType": 0,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 4,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "5aec9e2620194af5926d006ef65ddc42",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "职位",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "positionName",
        "parentCode": "baseInfo",
        "parentFieldTemplateId": "a7beaa6649e84cecb9518cc0ed041118",
        "fieldType": 0,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 5,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "1b84bdcab430480d8ad4ae01b4085bc1",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "入职时间",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请选择",
        "fieldCode": "hireDate",
        "parentCode": "baseInfo",
        "parentFieldTemplateId": "a7beaa6649e84cecb9518cc0ed041118",
        "fieldType": 4,
        "fieldOperations":
        {
            "ruleContent": [
            {
                "isEdit": 1,
                "name": "年-月-日",
                "type": "radio",
                "key": 1
            },
            {
                "isEdit": 1,
                "name": "年-月",
                "type": "radio",
                "key": 2
            }],
            "typeValue": 1,
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 6,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    }]
},
{
    "fieldTemplateId": "de84a38f7e7143d2849c4992b312e1fe",
    "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
    "fieldName": "工作信息",
    "fieldEdited": false,
    "isMust": false,
    "fieldDescription": "",
    "fieldCode": "jobInfo",
    "parentCode": "0",
    "parentFieldTemplateId": "-1",
    "fieldType": 0,
    "fieldOperations":
    {},
    "fixed": false,
    "minCount": null,
    "maxCount": null,
    "staffRecordsIds": [],
    "status": 1,
    "sort": 1,
    "systemFlag": true,
    "createTime": 1545017321000,
    "updateTime": 1545017321000,
    "children": [
    {
        "fieldTemplateId": "d42b66f653b148cfa4aff9e86340cd1c",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "员工类型",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请选择",
        "fieldCode": "clerkType",
        "parentCode": "jobInfo",
        "parentFieldTemplateId": "de84a38f7e7143d2849c4992b312e1fe",
        "fieldType": 2,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": [
            {
                "name": "全职",
                "type": "radio",
                "key": 1
            },
            {
                "name": "兼职",
                "type": "radio",
                "key": 2
            },
            {
                "name": "外包",
                "type": "radio",
                "key": 3
            },
            {
                "name": "实习",
                "type": "radio",
                "key": 4
            },
            {
                "name": "无类型",
                "type": "radio",
                "key": 5
            }]
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 0,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "0531a13dba6b49b483a8258e4248f16f",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "员工状态",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请选择",
        "fieldCode": "clerkStatus",
        "parentCode": "jobInfo",
        "parentFieldTemplateId": "de84a38f7e7143d2849c4992b312e1fe",
        "fieldType": 2,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": [
            {
                "name": "正式",
                "type": "radio",
                "key": "1"
            },
            {
                "name": "试用",
                "type": "radio",
                "key": "2"
            }]
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 1,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "a672c6d6729f44d4b81f45b7e6eb72c9",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "转正日期",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请选择",
        "fieldCode": "correctionDate",
        "parentCode": "jobInfo",
        "parentFieldTemplateId": "de84a38f7e7143d2849c4992b312e1fe",
        "fieldType": 4,
        "fieldOperations":
        {
            "ruleContent": [
            {
                "isEdit": 1,
                "name": "年-月-日",
                "type": "radio",
                "key": 1
            },
            {
                "isEdit": 1,
                "name": "年-月",
                "type": "radio",
                "key": 2
            }],
            "typeValue": 1,
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 2,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "14c35b3baed345ada6b67026ad4cf17a",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "岗位职级",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "positionRank",
        "parentCode": "jobInfo",
        "parentFieldTemplateId": "de84a38f7e7143d2849c4992b312e1fe",
        "fieldType": 0,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 3,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    }]
},
{
    "fieldTemplateId": "8b4020cd81e34fc5af1fbe9cc515aba5",
    "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
    "fieldName": "个人信息",
    "fieldEdited": false,
    "isMust": false,
    "fieldDescription": "",
    "fieldCode": "selfInfo",
    "parentCode": "0",
    "parentFieldTemplateId": "-1",
    "fieldType": 0,
    "fieldOperations":
    {},
    "fixed": false,
    "minCount": null,
    "maxCount": null,
    "staffRecordsIds": [],
    "status": 1,
    "sort": 2,
    "systemFlag": true,
    "createTime": 1545017321000,
    "updateTime": 1545017321000,
    "children": [
    {
        "fieldTemplateId": "4696c0358dc04979ba09f6000ab2432a",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "身份证姓名",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "identifyName",
        "parentCode": "selfInfo",
        "parentFieldTemplateId": "8b4020cd81e34fc5af1fbe9cc515aba5",
        "fieldType": 0,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 0,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "7a15bcb5cfee49b996335b241adefab4",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "证件号码",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "identifyNo",
        "parentCode": "selfInfo",
        "parentFieldTemplateId": "8b4020cd81e34fc5af1fbe9cc515aba5",
        "fieldType": 6,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 1,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "b61e0e5f97d84d77b5875b42fd0e63d1",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "出生日期",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请选择",
        "fieldCode": "birthDay",
        "parentCode": "selfInfo",
        "parentFieldTemplateId": "8b4020cd81e34fc5af1fbe9cc515aba5",
        "fieldType": 4,
        "fieldOperations":
        {
            "ruleContent": [
            {
                "isEdit": 1,
                "name": "年-月-日",
                "type": "radio",
                "key": 1
            },
            {
                "isEdit": 1,
                "name": "年-月",
                "type": "radio",
                "key": 2
            }],
            "typeValue": 1,
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 2,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "586e6fb3ee35470ea950f4db06fba85c",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "性别",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "sex",
        "parentCode": "selfInfo",
        "parentFieldTemplateId": "8b4020cd81e34fc5af1fbe9cc515aba5",
        "fieldType": 2,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": [
            {
                "name": "男",
                "type": "radio",
                "key": 1
            },
            {
                "name": "女",
                "type": "radio",
                "key": 2
            }]
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 3,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "ff24331b1a2e4f2ebb2e270dcf52c97a",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "民族",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "nation",
        "parentCode": "selfInfo",
        "parentFieldTemplateId": "8b4020cd81e34fc5af1fbe9cc515aba5",
        "fieldType": 2,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": [
            {
                "name": "汉族",
                "type": "radio",
                "key": 1
            },
            {
                "name": "蒙古族",
                "type": "radio",
                "key": 2
            },
            {
                "name": "藏族",
                "type": "radio",
                "key": 3
            },
            {
                "name": "苗族",
                "type": "radio",
                "key": 4
            },
            {
                "name": "壮族",
                "type": "radio",
                "key": 5
            },
            {
                "name": "回族",
                "type": "radio",
                "key": 6
            },
            {
                "name": "维吾尔族",
                "type": "radio",
                "key": 7
            },
            {
                "name": "彝族",
                "type": "radio",
                "key": 8
            },
            {
                "name": "布依族",
                "type": "radio",
                "key": 9
            },
            {
                "name": "朝鲜族",
                "type": "radio",
                "key": 10
            },
            {
                "name": "侗族",
                "type": "radio",
                "key": 11
            },
            {
                "name": "白族",
                "type": "radio",
                "key": 12
            },
            {
                "name": "哈尼族",
                "type": "radio",
                "key": 13
            },
            {
                "name": "傣族",
                "type": "radio",
                "key": 14
            },
            {
                "name": "僳僳族",
                "type": "radio",
                "key": 15
            },
            {
                "name": "畲族",
                "type": "radio",
                "key": 16
            },
            {
                "name": "拉祜族",
                "type": "radio",
                "key": 17
            },
            {
                "name": "满族",
                "type": "radio",
                "key": 18
            },
            {
                "name": "瑶族",
                "type": "radio",
                "key": 19
            },
            {
                "name": "土家族",
                "type": "radio",
                "key": 20
            },
            {
                "name": "哈萨克族",
                "type": "radio",
                "key": 21
            },
            {
                "name": "黎族",
                "type": "radio",
                "key": 22
            },
            {
                "name": "佤族",
                "type": "radio",
                "key": 23
            },
            {
                "name": "台湾少数民族",
                "type": "radio",
                "key": 24
            },
            {
                "name": "水族",
                "type": "radio",
                "key": 25
            },
            {
                "name": "东乡族",
                "type": "radio",
                "key": 26
            },
            {
                "name": "景颇族",
                "type": "radio",
                "key": 27
            },
            {
                "name": "土族",
                "type": "radio",
                "key": 28
            },
            {
                "name": "仫佬族",
                "type": "radio",
                "key": 29
            },
            {
                "name": "布朗族",
                "type": "radio",
                "key": 30
            },
            {
                "name": "毛南族",
                "type": "radio",
                "key": 31
            },
            {
                "name": "锡伯族",
                "type": "radio",
                "key": 32
            },
            {
                "name": "普米族",
                "type": "radio",
                "key": 33
            },
            {
                "name": "纳西族",
                "type": "radio",
                "key": 34
            },
            {
                "name": "柯尔克孜族",
                "type": "radio",
                "key": 35
            },
            {
                "name": "达斡尔族",
                "type": "radio",
                "key": 36
            },
            {
                "name": "羌族",
                "type": "radio",
                "key": 37
            },
            {
                "name": "撒拉族",
                "type": "radio",
                "key": 38
            },
            {
                "name": "仡佬族",
                "type": "radio",
                "key": 39
            },
            {
                "name": "阿昌族",
                "type": "radio",
                "key": 40
            },
            {
                "name": "塔吉克族",
                "type": "radio",
                "key": 41
            },
            {
                "name": "怒族",
                "type": "radio",
                "key": 42
            },
            {
                "name": "俄罗斯族",
                "type": "radio",
                "key": 43
            },
            {
                "name": "德昂族",
                "type": "radio",
                "key": 44
            },
            {
                "name": "裕固族",
                "type": "radio",
                "key": 45
            },
            {
                "name": "塔塔尔族",
                "type": "radio",
                "key": 46
            },
            {
                "name": "鄂伦春族",
                "type": "radio",
                "key": 47
            },
            {
                "name": "门巴族",
                "type": "radio",
                "key": 48
            },
            {
                "name": "基诺族",
                "type": "radio",
                "key": 49
            },
            {
                "name": "乌孜别克族",
                "type": "radio",
                "key": 50
            },
            {
                "name": "鄂温克族",
                "type": "radio",
                "key": 51
            },
            {
                "name": "保安族",
                "type": "radio",
                "key": 52
            },
            {
                "name": "京族",
                "type": "radio",
                "key": 53
            },
            {
                "name": "独龙族",
                "type": "radio",
                "key": 54
            },
            {
                "name": "赫哲族",
                "type": "radio",
                "key": 55
            },
            {
                "name": "珞巴族",
                "type": "radio",
                "key": 56
            }]
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 4,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "ba90ca33d87144b3b1b0df1753ebb5f0",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "身份证地址",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "identifyAddr",
        "parentCode": "selfInfo",
        "parentFieldTemplateId": "8b4020cd81e34fc5af1fbe9cc515aba5",
        "fieldType": 1,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 5,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "dea144ea166449569af9e1c91af08185",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "证件有效期",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "identifyEffectiveDate",
        "parentCode": "selfInfo",
        "parentFieldTemplateId": "8b4020cd81e34fc5af1fbe9cc515aba5",
        "fieldType": 4,
        "fieldOperations":
        {
            "ruleContent": [
            {
                "isEdit": 1,
                "name": "年-月-日",
                "type": "radio",
                "key": 1
            },
            {
                "isEdit": 1,
                "name": "年-月",
                "type": "radio",
                "key": 2
            }],
            "typeValue": 1,
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 6,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "313d944620b94d8b983d08a14129bbd7",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "户籍类型",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请选择",
        "fieldCode": "birthPlaceType",
        "parentCode": "selfInfo",
        "parentFieldTemplateId": "8b4020cd81e34fc5af1fbe9cc515aba5",
        "fieldType": 2,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": [
            {
                "name": "本地城镇",
                "type": "radio",
                "key": 1
            },
            {
                "name": "本地农村",
                "type": "radio",
                "key": 2
            },
            {
                "name": "外地城镇(省内)",
                "type": "radio",
                "key": 3
            },
            {
                "name": "外地农村(省内)",
                "type": "radio",
                "key": 4
            },
            {
                "name": "外地城镇(省外)",
                "type": "radio",
                "key": 5
            },
            {
                "name": "外地农村(省外)",
                "type": "radio",
                "key": 6
            }]
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 7,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "ac3aca9000a84191861beb7964ede9ca",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "地址",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "address",
        "parentCode": "selfInfo",
        "parentFieldTemplateId": "8b4020cd81e34fc5af1fbe9cc515aba5",
        "fieldType": 1,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 8,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "35850d9913fa475a8c7f4459a9d7dcbd",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "政治面貌",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请选择",
        "fieldCode": "politicalStatus",
        "parentCode": "selfInfo",
        "parentFieldTemplateId": "8b4020cd81e34fc5af1fbe9cc515aba5",
        "fieldType": 2,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": [
            {
                "name": "团员",
                "type": "radio",
                "key": 1
            },
            {
                "name": "党员",
                "type": "radio",
                "key": 2
            },
            {
                "name": "群众",
                "type": "radio",
                "key": 3
            },
            {
                "name": "其他",
                "type": "radio",
                "key": 4
            }]
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 9,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "c1c7bc4e55b9407a830193377e54530e",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "婚姻状况",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请选择",
        "fieldCode": "maritalStatus",
        "parentCode": "selfInfo",
        "parentFieldTemplateId": "8b4020cd81e34fc5af1fbe9cc515aba5",
        "fieldType": 2,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": [
            {
                "name": "已婚",
                "type": "radio",
                "key": 1
            },
            {
                "name": "未婚",
                "type": "radio",
                "key": 2
            }]
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 10,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "18d515db26dd42b78cfbfe4d604ec67a",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "首次参加工作时间",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "firstWorkDate",
        "parentCode": "selfInfo",
        "parentFieldTemplateId": "8b4020cd81e34fc5af1fbe9cc515aba5",
        "fieldType": 4,
        "fieldOperations":
        {
            "ruleContent": [
            {
                "isEdit": 1,
                "name": "年-月-日",
                "type": "radio",
                "key": 1
            },
            {
                "isEdit": 1,
                "name": "年-月",
                "type": "radio",
                "key": 2
            }],
            "typeValue": 1,
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 11,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "cef54dd2fcb7427db0bb29001e3ac2db",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "银行卡号",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "bankNo",
        "parentCode": "selfInfo",
        "parentFieldTemplateId": "8b4020cd81e34fc5af1fbe9cc515aba5",
        "fieldType": 6,
        "fieldOperations":
        {
            "ruleContent": [],
            "unit": "元",
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 12,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "9d6a3f07af414e4d9f6021ad594296f7",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "开户行",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "bankName",
        "parentCode": "selfInfo",
        "parentFieldTemplateId": "8b4020cd81e34fc5af1fbe9cc515aba5",
        "fieldType": 0,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 13,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    }]
},
{
    "fieldTemplateId": "e305fdb748d2408298e0c04018bcb808",
    "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
    "fieldName": "学历信息",
    "fieldEdited": false,
    "isMust": false,
    "fieldDescription": "",
    "fieldCode": "eduInfo",
    "parentCode": "0",
    "parentFieldTemplateId": "-1",
    "fieldType": 0,
    "fieldOperations":
    {},
    "fixed": false,
    "minCount": null,
    "maxCount": null,
    "staffRecordsIds": [],
    "status": 1,
    "sort": 3,
    "systemFlag": true,
    "createTime": 1545017321000,
    "updateTime": 1545017321000,
    "children": [
    {
        "fieldTemplateId": "811d56bcd40d4e85b4c6574fe07fd052",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "毕业院校",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "graduateInstitutions",
        "parentCode": "eduInfo",
        "parentFieldTemplateId": "e305fdb748d2408298e0c04018bcb808",
        "fieldType": 0,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 0,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "706173b6891148f9973721c408a6017c",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "毕业时间",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请选择",
        "fieldCode": "graduateDate",
        "parentCode": "eduInfo",
        "parentFieldTemplateId": "e305fdb748d2408298e0c04018bcb808",
        "fieldType": 4,
        "fieldOperations":
        {
            "ruleContent": [
            {
                "isEdit": 1,
                "name": "年-月-日",
                "type": "radio",
                "key": 1
            },
            {
                "isEdit": 1,
                "name": "年-月",
                "type": "radio",
                "key": 2
            }],
            "typeValue": 1,
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 1,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "d2df0cb6ed2f456c838b38d27b448304",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "所学专业",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "majorCourse",
        "parentCode": "eduInfo",
        "parentFieldTemplateId": "e305fdb748d2408298e0c04018bcb808",
        "fieldType": 0,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 2,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "fa8dab05e2f941db94d2509f884f05e9",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "最高学历",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请选择",
        "fieldCode": "highestEducation",
        "parentCode": "eduInfo",
        "parentFieldTemplateId": "e305fdb748d2408298e0c04018bcb808",
        "fieldType": 2,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": [
            {
                "name": "初中",
                "type": "radio",
                "key": 1
            },
            {
                "name": "高中",
                "type": "radio",
                "key": 2
            },
            {
                "name": "中专",
                "type": "radio",
                "key": 3
            },
            {
                "name": "大专",
                "type": "radio",
                "key": 4
            },
            {
                "name": "本科",
                "type": "radio",
                "key": 5
            },
            {
                "name": "硕士",
                "type": "radio",
                "key": 6
            },
            {
                "name": "博士",
                "type": "radio",
                "key": 7
            },
            {
                "name": "其他",
                "type": "radio",
                "key": 8
            }]
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 3,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    }]
},
{
    "fieldTemplateId": "f17eebbff23844fe9756a97b30524aff",
    "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
    "fieldName": "合同信息",
    "fieldEdited": false,
    "isMust": false,
    "fieldDescription": "",
    "fieldCode": "contractInfo",
    "parentCode": "0",
    "parentFieldTemplateId": "-1",
    "fieldType": 0,
    "fieldOperations":
    {},
    "fixed": false,
    "minCount": null,
    "maxCount": null,
    "staffRecordsIds": [],
    "status": 1,
    "sort": 4,
    "systemFlag": true,
    "createTime": 1545017321000,
    "updateTime": 1545017321000,
    "children": [
    {
        "fieldTemplateId": "0f196f7c71834c11b604c8308ff35fa4",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "合同公司",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "contractCompany",
        "parentCode": "contractInfo",
        "parentFieldTemplateId": "f17eebbff23844fe9756a97b30524aff",
        "fieldType": 0,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 0,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "2ca8f628b2254258a82bd09d25f6b752",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "合同类型",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请选择",
        "fieldCode": "contractType",
        "parentCode": "contractInfo",
        "parentFieldTemplateId": "f17eebbff23844fe9756a97b30524aff",
        "fieldType": 2,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": [
            {
                "name": "固定曲线劳动合同",
                "type": "radio",
                "key": 1
            },
            {
                "name": "无固定期限劳动合同",
                "type": "radio",
                "key": 2
            },
            {
                "name": "实习协议",
                "type": "radio",
                "key": 3
            },
            {
                "name": "劳务协议",
                "type": "radio",
                "key": 4
            },
            {
                "name": "劳务派遣合同",
                "type": "radio",
                "key": 5
            },
            {
                "name": "返聘协议",
                "type": "radio",
                "key": 6
            },
            {
                "name": "短期劳动合同",
                "type": "radio",
                "key": 7
            },
            {
                "name": "其他",
                "type": "radio",
                "key": 8
            }]
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 1,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "47248ab49c0441b799a1e3f362883fe0",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "首次合同起始日",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请选择",
        "fieldCode": "firstContractBeginDate",
        "parentCode": "contractInfo",
        "parentFieldTemplateId": "f17eebbff23844fe9756a97b30524aff",
        "fieldType": 4,
        "fieldOperations":
        {
            "ruleContent": [
            {
                "isEdit": 1,
                "name": "年-月-日",
                "type": "radio",
                "key": 1
            },
            {
                "isEdit": 1,
                "name": "年-月",
                "type": "radio",
                "key": 2
            }],
            "typeValue": 1,
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 2,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "a122d840e2d04971a319e87d4da28e99",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "首次合同到期日",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请选择",
        "fieldCode": "firstContractEndDate",
        "parentCode": "contractInfo",
        "parentFieldTemplateId": "f17eebbff23844fe9756a97b30524aff",
        "fieldType": 4,
        "fieldOperations":
        {
            "ruleContent": [
            {
                "isEdit": 1,
                "name": "年-月-日",
                "type": "radio",
                "key": 1
            },
            {
                "isEdit": 1,
                "name": "年-月",
                "type": "radio",
                "key": 2
            }],
            "typeValue": 1,
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 3,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "e7ed206f4c4644a9be90a8c912359a04",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "现合同起始日",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请选择",
        "fieldCode": "currentContractBeginDate",
        "parentCode": "contractInfo",
        "parentFieldTemplateId": "f17eebbff23844fe9756a97b30524aff",
        "fieldType": 4,
        "fieldOperations":
        {
            "ruleContent": [
            {
                "isEdit": 1,
                "name": "年-月-日",
                "type": "radio",
                "key": 1
            },
            {
                "isEdit": 1,
                "name": "年-月",
                "type": "radio",
                "key": 2
            }],
            "typeValue": 1,
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 4,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "150dcd1d9e124cf089456becdc8c1dc9",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "现合同到期日",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请选择",
        "fieldCode": "currentContractEndDate",
        "parentCode": "contractInfo",
        "parentFieldTemplateId": "f17eebbff23844fe9756a97b30524aff",
        "fieldType": 4,
        "fieldOperations":
        {
            "ruleContent": [
            {
                "isEdit": 1,
                "name": "年-月-日",
                "type": "radio",
                "key": 1
            },
            {
                "isEdit": 1,
                "name": "年-月",
                "type": "radio",
                "key": 2
            }],
            "typeValue": 1,
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 5,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "ad8f649241ce4344b28bd1c7544b167d",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "合同期限",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请选择",
        "fieldCode": "contractDateType",
        "parentCode": "contractInfo",
        "parentFieldTemplateId": "f17eebbff23844fe9756a97b30524aff",
        "fieldType": 2,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": [
            {
                "name": "无",
                "type": "radio",
                "key": 1
            },
            {
                "name": "6个月",
                "type": "radio",
                "key": 2
            },
            {
                "name": "12个月",
                "type": "radio",
                "key": 3
            },
            {
                "name": "24个月",
                "type": "radio",
                "key": 4
            },
            {
                "name": "36个月或以上",
                "type": "radio",
                "key": 5
            }]
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 6,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "7b31b0ed75fe44beb2746553299a1bf5",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "续签次数",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "contractRenewNum",
        "parentCode": "contractInfo",
        "parentFieldTemplateId": "f17eebbff23844fe9756a97b30524aff",
        "fieldType": 0,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 7,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    }]
},
{
    "fieldTemplateId": "96a1a9368b6f4f95b06a22fc57eb7c10",
    "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
    "fieldName": "紧急联系人",
    "fieldEdited": false,
    "isMust": false,
    "fieldDescription": "",
    "fieldCode": "contactInfo",
    "parentCode": "0",
    "parentFieldTemplateId": "-1",
    "fieldType": 0,
    "fieldOperations":
    {},
    "fixed": false,
    "minCount": null,
    "maxCount": null,
    "staffRecordsIds": [],
    "status": 1,
    "sort": 5,
    "systemFlag": true,
    "createTime": 1545017321000,
    "updateTime": 1545017321000,
    "children": [
    {
        "fieldTemplateId": "633fd1cc60454feb8e1759dabfd26c5c",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "紧急联系人姓名",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "emergencyContact",
        "parentCode": "contactInfo",
        "parentFieldTemplateId": "96a1a9368b6f4f95b06a22fc57eb7c10",
        "fieldType": 0,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 0,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "5b97363f13b84b43b2d0312bef76d3cd",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "紧急联系人手机号",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "emergencyContactPhone",
        "parentCode": "contactInfo",
        "parentFieldTemplateId": "96a1a9368b6f4f95b06a22fc57eb7c10",
        "fieldType": 6,
        "fieldOperations":
        {
            "ruleContent": [],
            "unit": "",
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 1,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "6a417a83ce414a4183bc839ef555a642",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "紧急联系人关系",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "请输入",
        "fieldCode": "emergencyContactRelationship",
        "parentCode": "contactInfo",
        "parentFieldTemplateId": "96a1a9368b6f4f95b06a22fc57eb7c10",
        "fieldType": 0,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 2,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    }]
},
{
    "fieldTemplateId": "2c9c1544c4c64a38a49ecfec988073a2",
    "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
    "fieldName": "个人资料",
    "fieldEdited": false,
    "isMust": false,
    "fieldDescription": "",
    "fieldCode": "personalInfo",
    "parentCode": "0",
    "parentFieldTemplateId": "-1",
    "fieldType": 0,
    "fieldOperations":
    {},
    "fixed": false,
    "minCount": null,
    "maxCount": null,
    "staffRecordsIds": [],
    "status": 1,
    "sort": 6,
    "systemFlag": true,
    "createTime": 1545017321000,
    "updateTime": 1545017321000,
    "children": [
    {
        "fieldTemplateId": "ef722eb5d17c481d844d647239a58887",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "身份证（人像面）",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "最多上传9张图片",
        "fieldCode": "identifyFrontImageUrl",
        "parentCode": "personalInfo",
        "parentFieldTemplateId": "2c9c1544c4c64a38a49ecfec988073a2",
        "fieldType": 7,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 0,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "b0784ab6046a4066a066164b16d91c4a",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "身份证（国徽面）",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "最多上传9张图片",
        "fieldCode": "identifyBackImageUrl",
        "parentCode": "personalInfo",
        "parentFieldTemplateId": "2c9c1544c4c64a38a49ecfec988073a2",
        "fieldType": 7,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 1,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "1d7276d4a5a741e2a6b3786bedab3972",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "学历证书",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "最多上传9张图片",
        "fieldCode": "qualificationImageUrl",
        "parentCode": "personalInfo",
        "parentFieldTemplateId": "2c9c1544c4c64a38a49ecfec988073a2",
        "fieldType": 7,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 2,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "bd8611f6077d4935975d1f718883f802",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "学位证书",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "最多上传9张图片",
        "fieldCode": "diplomaImageUrl",
        "parentCode": "personalInfo",
        "parentFieldTemplateId": "2c9c1544c4c64a38a49ecfec988073a2",
        "fieldType": 7,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 3,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "c703cf790fa74914b48eb0869fd58403",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "上家公司离职证明",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "最多上传9张图片",
        "fieldCode": "fireEvidenceImageUrl",
        "parentCode": "personalInfo",
        "parentFieldTemplateId": "2c9c1544c4c64a38a49ecfec988073a2",
        "fieldType": 7,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 4,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    },
    {
        "fieldTemplateId": "6660eeee38a7467bb848c008729cc933",
        "enterpriseId": "5cfbf45fe35d475ca9a59c41b70b114e",
        "fieldName": "员工照片",
        "fieldEdited": false,
        "isMust": false,
        "fieldDescription": "最多上传9张图片",
        "fieldCode": "clerkImageUrl",
        "parentCode": "personalInfo",
        "parentFieldTemplateId": "2c9c1544c4c64a38a49ecfec988073a2",
        "fieldType": 7,
        "fieldOperations":
        {
            "ruleContent": [],
            "fieldContent": []
        },
        "fixed": false,
        "minCount": 0,
        "maxCount": 100,
        "staffRecordsIds": [],
        "status": 1,
        "sort": 5,
        "systemFlag": true,
        "createTime": 1545017321000,
        "updateTime": 1545017321000
    }]
}],


      // 已经选择的字段集合
      setList: [],
    }
  },
  created() {
    // this.selectReplayStyle()
  },
  methods: {

    /**
     *  路由跳转
     */
    changeRoute(route) {
      this.$router.push(route);
    },

    /**
     *  获取已经保存模板信息---api
     */
    getInfo() {
      const that = this
      postRequest('/haoban-manage-web/record/employee-find-template.json',{})
      .then((res) => {
        // console.log( res.data)
        var resData = res.data
        if (resData.errorCode == 1) {
          that.setList = [];
          if (!!resData.result && !!Object.keys(resData.result).length) {
            that.handleGetInfo(resData.result)
          }
          return;
        }
        errMsg.errorMsg(resData)

      })
      .catch(function (error) {
        console.log(error);
        that.$message.error({
          duration: 1000,
          message: error.message
        })
      });
    },

    /**
     * 简单数组-->父子数组对象
     */
    treeData(data){
      let tree = data.filter((father)=>{                  //循环所有项
        let branchArr = data.filter((child)=>{
          return father.fieldCode == child.parentCode;    //返回每一项的子级数组
        });
        if(branchArr.length>0){
          father.children = branchArr;    //如果存在子级，则给父级添加一个children属性，并赋值
        }
        return father.parentCode == 0;        //返回第一层
      });
      // 排序
      tree.sort(function(a,b){
        return a.sort - b.sort;
      })

      tree.forEach(function(ele,index){
        ele.children.sort(function(a,b){
          return a.sort - b.sort;
        })
      })
      return tree;
    },

    /**
     * 处理已存配置信息
     */
    handleGetInfo(result) {
      const that = this
      let data = JSON.parse(JSON.stringify(result))
      that.setParent = [];
      data.forEach(function(ele,index){
        ele.fixed = parseInt(ele.fixed) === 1? true : false;
        ele.isMust = parseInt(ele.isMust) === 1? true : false;
        ele.fieldEdited = parseInt(ele.fieldEdited) === 1? true : false;
        ele.systemFlag = true;
        ele.fieldOperations = !!ele.fieldOperations? JSON.parse(ele.fieldOperations): {};
        ele.staffRecordsIds = !!ele.staffRecordsIds? JSON.parse(ele.staffRecordsIds): [];
        // 设置禁止拖拽
        if (!!ele.systemFlag && ele.parentCode == 0) {
          that.setParent.push(ele.fieldCode)
        }
        if (!!ele.systemFlag && ele.parentCode != 0) {
          that.setList.push(ele.fieldCode)
        }
      })

      that.tempaletDataList = that.treeData(data)
      that.setFixed();
    },

    /**
     * 设置禁止拖拽
     */
    setFixed() {
      const that = this
      // console.log(that.setParent)
      that.setParent.forEach(function(ele,index){
        that[ele].forEach(function(obj,key){
          if (that.setList.includes(obj.fieldCode)) {
            obj.fixed = true
          }
        })
      })
    },

  },
  watch: {

  },
  components: {

  },
  mounted() {
    const that = this;
    // 获取已经配置的数据
    // that.getInfo()
    // Promise.all([that.getInfo()])
  }
}

</script>
<style lang="less" scoped>
.template-wrap {
  width: 100%;
  /*height: 100%;*/
  /*min-height: 860px;*/
  padding: 0;
  margin: 0;
  /*background: url('../../assets/template-bg.jpg') no-repeat center center;*/
  background-size: 100% 100%;

  .b-t-1 {
    border-top: 1px solid #E4E7ED;
  }

  .template-contain {
    width: 100%;
    margin: 0 auto;
  }

  .template-head {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    justify-content: space-between;
    height: 80px;
    align-items: center;

    .flex-1 {
      -webkit-flex: 1;
      -moz-flex: 1;
      -ms-flex: 1;
      -o-flex: 1;
      flex: 1;
      display: -webkit-box;
      display: -webkit-flex;
      display: flex;
      align-items: center;
    }

    .flex-r {
      justify-content: flex-end;
    }

    .template-title-span {
      color: #fff;
      font-size: 30px;
      padding-left: 18px;
    }

    .el-button--default.is-plain {
      background: rgba(255,255,255, 0);
      color: #fff;
      &:hover{
        color: #1890ff;
      }
    }
  }

  .template-body {
    width: 100%;
    position: relative;
    overflow: hidden;

    .template-cell {

    }

    /* 中间 */
    /* 模板 */
    .template-cell-m {
      width: 100%;
      /*height: 740px;*/
      position: relative;

      .view-content {
        position: relative;
      }

    }

    .drag-wrap {
      /*min-height: 530px;*/
      overflow-x: hidden;
      overflow-y: auto;
    }
    .phone-container{
      margin-top:40px;
    }
    .phone-view{
      /*background: url(../../assets/iphone.png) no-repeat;*/
      background-size: 100%;
      background-color: #f0eff4;
      width: 100%;
      /*height: 740px;*/
      /*margin: 0 20px;*/
      position: relative;
    }

    .phone-show-content{
      width: 100%;
      /*height: 537px;*/
      position:relative;
      overflow-y: auto;
    }

    .opend-card-item {
      height: 46px;
      line-height: 46px;
      background: #fff;
      border-bottom: 1px solid #e7e7eb;
      font-size: 14px;
      position: relative;

      &.sex::after {
        content: '';
        width: 100%;
        height: 100%;
        z-index: 2;
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
      }
    }

    .opend-card-group-title {
      height: 40px;
      line-height: 40px;
      padding-left: 10px;
    }

    .opend-card-item {
      height: 46px;
      line-height: 46px;
      background: #fff;
      border-bottom: 1px solid #e7e7eb;
    }

    .phone-list-item{
      height:44px;
      line-height:44px;
      background: #fff;
      margin-bottom:5px;
    }

    .item-title {
      width: 100px;
      float: left;
      padding-left: 10px;
    }

    .filed-item {
      background: #fff;
      height: 46px;
      width: 100%;
      height: auto;
      background: #fff;
      position: relative;
      cursor: move;
      padding: 0px;
      margin: 0;
      font-size: 12px;
      color: #292929;

      -webkit-box-sizing: border-box;
      -moz-box-sizing: border-box;
      box-sizing: border-box;
      &.active-item {
        /*border: 1px solid #1890ff;*/
      }

      &+.filed-item {
        margin-top: 5px;

        &.li-block {
          margin-top: 15px
        }
      }
      /*删除*/
      .item-close {
        position: absolute;
        top: 0;
        right: 0;
        width: 18px;
        height: 18px;
        line-height: 18px;
        text-align: center;
        background: #1890ff;
        color: #fff;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        display: none;
        z-index: 2;
      }
      &:hover{
        /*border: 1px dashed #1890ff;*/
        .p-item-close {
          display: block;
        }
      }

      &.child-filed-item {
        &:hover {
          .child-item-close {
            display: block;
          }
        }
      }


    }
    /* 组块 */
    .block {
      /*min-height: 308px;*/
      background: #f0eff4;

      .block-head {
        width: 100%;
        background: #f5f5f8;
        padding: 0;
        height: 35px;

        .opencard-item-title {
          height: 35px;
          line-height: 35px;
         /* &.block-pre-wrap{
            line-height: 12px;
            word-break: break-all;
            white-space: pre-wrap;
            padding-top: 7px;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
          }*/
        }
      }
      .drag-wrap {
        min-height: 25px;
      }
    }

    .opencard-drag {
      background: #fff;
      height: 46px;
    }

    .draged-item-show {
      display: inline-block;
      vertical-align: top;
      width: calc(100% - 100px);
    }

    .opencard-item-title{
      width: 90px;
      height: 46px;
      line-height: 46px;
      text-align: left;
      float: left;
      padding-left: 10px;
      overflow: hidden;
      white-space: nowrap;
      -webkit-box-sizing: border-box;
      -moz-box-sizing: border-box;
      box-sizing: border-box;
      &.title-pre-wrap {
        line-height: 15px;
        word-break: break-all;
        white-space: pre-wrap;
        padding-top: 9px;
      }
      /*&.block-pre-wrap{
        line-height: 12px;
        word-break: break-all;
        white-space: pre-wrap;
        padding-top: 9px;
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
      }*/
    }

    .show-warm-text{
      color:#C8C8CD;
      width:185px;
      text-align: left;
      display:inline-block;
      white-space: nowrap;
      height:46px;
      line-height:46px;

      &.select-flag {
        width: 100%;
        text-align: right;
      }
    }


    .limit-w-340 {
      /deep/ .el-input__inner {
        font-size: 12px;
        color: #fff;
        background-color: rgba(255,255,255,.1);
      }

      .tip {
        color: rgba(255,255,255,0.7);
      }
    }


  }
}

</style>
