/*
 *    Copyright (c) 2018-2025, cyweb All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 */
export const idType={
  value:''
}

export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  editBtn: false,
  delBtn: false,
  addBtn: false,
  dialogHeight:700,
  selection:true,

  column: [
    {
      label: '微信账单号',
      prop: 'orderOutTradeNo',
      disabled: true,
      search:true,
      hide:true
    },
    {
      label: '订单号',
      prop: 'everOrderNum',
      editDisabled: true,
      search:true,
    },
    {
      label: '人员信息',
      prop: 'personInfo',
      editDisabled: true,
      hide:true,
      search:true,
      display:false
    },
	  {
      label: '人员姓名',
      prop: 'personName',
    },
    {
      label: '人员类型',
      prop: 'personType',
      type: 'select',
      dicUrl: '/admin/dict/item/type/person_type',
      props:{
        label:'label',
        value:'value'
      },
      editDisabled: true,
    },
	  {
      label: '证件类型',
      prop: 'personidType',
      type: 'select',
      dicUrl: '/admin/dict/item/type/id_type',
      props:{
        label:'label',
        value:'value'
      },
      rules:[
        { validator: function (rule, value, callback) {
            idType['value']=value
            callback()
          },
          trigger: 'change' }
      ]
    },

	  {
      label: '证件号码',
      prop: 'personId',
      rules:[
        { validator: function (rule, value, callback) {
          if(idType['value']=='0'){
            if (value && (!(/\d{17}[\d|x]|\d{15}/).test(value) || (value.length !== 15 && value.length !== 18))) {
              callback(new Error('身份证号码不规范'))
            } else {
              callback()
            }
          }else{
            callback()
          }

          }, trigger: 'blur' }
      ]
    },
	  {
      label: '性别',
      prop: 'sex',
      type: 'radio',
      dicUrl: '/admin/dict/item/type/sexy',
      props:{
        label:'label',
        value:'value'
      },
    },
	  {
      label: '电话号码',
      prop: 'personPhone',
      rules:[
          { validator: function (rule, value, callback) {
              var reg=/^1[3456789]\d{9}$/;
              if(!reg.test(value)){
                  callback(new Error('请输入有效的手机号码'));
              }else{
                  callback()
              }
              }, trigger: 'blur' }
      ]
    },
	  {
      label: '培训班级名',
      prop: 'className',
      editDisabled: true,
      search:true,
      width:200
    },
	  {
      label: '单位信息',
      prop: 'companyName',
      editDisabled: true,
      width:200,
      search:true,
      formslot:true,
    },
	  {
      label: '单位子类型',
      prop: 'secCompanyType',
      type: 'select',
      dicUrl: '/aj/scjajcompanytypesec/getAllSecTypeList',
      props:{
        label:'typeName',
        value:'id'
      },
    },
	  {
      label: '报名时间',
      prop: 'createTime',
      editDisabled: true,
      type:'date',
      format:'yyyy-MM-dd HH:mm:ss'
    },
    {
      label: '职称',
      prop: 'proName',
      type: 'select',
      dicUrl: '/admin/dict/item/type/proname_type',
      props:{
        label:'label',
        value:'label'
      },
    },
    {
      label: '学历',
      prop: 'education',
      type: 'select',
      dicUrl: '/admin/dict/item/type/education_type',
      props:{
        label:'label',
        value:'label'
      },
    },
    {
      label: '付款时间',
      prop: 'payTime',
      editDisabled: true,
      type:'date',
      format:'yyyy-MM-dd'
    },
    {
      label: '付款截止时间',
      prop: 'closeDate',
      editDisabled: true,
      type:'date',
      format:'yyyy-MM-dd HH:mm:ss'
    },
    {
      label: '状态',
      prop: 'orderStatus',
      editDisabled: true,
      search:true,
      type: 'select',
      dicUrl: '/admin/dict/item/type/order_status',
      props:{
        label:'label',
        value:'value'
      },
    },
    // {
    //   label: '延迟付款时间(秒)',
    //   prop: 'closeTime',
    //   type:'number',
    //   hide:true
    // },
    // {
    //   label: '关闭时间',
    //   prop: 'closeDate',
    //   type:'datetime',
    //   value:'yyyy-MM-dd HH:mm',
    //   valueFormat:'yyyy-MM-dd HH:mm:ss',
    //   slot:true
    // },
    {
      label: '是否同步',
      prop: 'pushStatus',
      editDisabled: true,
      type: 'select',
      search:true,
      dicUrl: '/admin/dict/item/type/yes_no',
      props:{
        label:'label',
        value:'value'
      },
    },
    {
      label: '推送失败原因',
      prop: 'info',
      editDisabled: true,
    }
  ]
}
