import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
    {
    title: '创建日期',
    align:"center",
    dataIndex: 'createTime'
   },
   {
    title: '头像',
    align:"center",
    dataIndex: 'image',
    customRender:render.renderAvatar,
   },
   {
    title: '姓名',
    align:"center",
    dataIndex: 'name'
   },
   {
    title: '电话',
    align:"center",
    dataIndex: 'phone'
   },
   {
    title: '支付时间',
    align:"center",
    dataIndex: 'payTime'
   },
   {
    title: '下单地址',
    align:"center",
    dataIndex: 'address'
   },
   {
    title: '地址标识',
    align:"center",
    dataIndex: 'addressId_dictText'
   },
   {
    title: '总计时间',
    align:"center",
    dataIndex: 'useTime'
   },
   {
    title: '技师名称',
    align:"center",
    dataIndex: 'terName'
   },
   {
    title: '订单状态',
    align:"center",
    dataIndex: 'state_dictText'
   },
   {
    title: '订单价格',
    align:"center",
    dataIndex: 'money'
   },
   {
    title: '用户标识',
    align:"center",
    dataIndex: 'userId_dictText'
   },
   {
    title: '关联技师',
    align:"center",
    dataIndex: 'technicianId_dictText'
   },
   {
    title: '项目标识',
    align:"center",
    dataIndex: 'projectId_dictText'
   },
   {
    title: '项目名称',
    align:"center",
    dataIndex: 'projectName'
   },
   {
    title: '支付方式',
    align:"center",
    dataIndex: 'payType_dictText'
   },
   {
    title: '订单备注',
    align:"center",
    dataIndex: 'remark'
   },
   {
    title: '优惠券标识',
    align:"center",
    dataIndex: 'couponId_dictText'
   },
   {
    title: '技师状态',
    align:"center",
    dataIndex: 'tenState_dictText'
   },
   {
    title: '技师是否接单',
    align:"center",
    dataIndex: 'tenOk',
    customRender:({text}) => {
       return  render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
     },
   },
   {
    title: '接单时间',
    align:"center",
    dataIndex: 'confirmTime'
   },
   {
    title: '出发时间',
    align:"center",
    dataIndex: 'startTime'
   },
   {
    title: '到达时间',
    align:"center",
    dataIndex: 'arriveTime'
   },
   {
    title: '到达照片',
    align:"center",
    dataIndex: 'arrivalPicture',
    customRender:render.renderAvatar,
   },
   {
    title: '服务时间',
    align:"center",
    dataIndex: 'startServiceTime'
   },
   {
    title: '结束服务时间',
    align:"center",
    dataIndex: 'endErviceTime'
   },
   {
    title: '结束服务照片',
    align:"center",
    dataIndex: 'endPicture',
    customRender:render.renderAvatar,
   },
   {
    title: '车费',
    align:"center",
    dataIndex: 'temp'
   },
   {
    title: '服务下单时间',
    align:"center",
    dataIndex: 'serviceTime'
   },
   {
    title: '用户评价',
    align:"center",
    dataIndex: 'evaluated'
   },
   {
    title: '技师评价',
    align:"center",
    dataIndex: 'jsEvaluated'
   },
   {
    title: '服务日期',
    align:"center",
    dataIndex: 'serviceDate',
    customRender:({text}) =>{
      return !text?"":(text.length>10?text.substr(0,10):text)
    },
   },
   {
    title: '分销商所得(一级)',
    align:"center",
    dataIndex: 'shopMoney'
   },
   {
    title: '技师所得（项目）',
    align:"center",
    dataIndex: 'tenMoney'
   },
   {
    title: '一级所得',
    align:"center",
    dataIndex: 'tenPrice'
   },
   {
    title: '二级所得',
    align:"center",
    dataIndex: 'tenMinPrice'
   },
   {
    title: '评价所得',
    align:"center",
    dataIndex: 'pinPrice'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "订单状态",
      field: "state",
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"order_state"
      },
      colProps: {span: 6},
 	},
	{
      label: "用户标识",
      field: "userId",
      component: 'JSearchSelect',
      componentProps:{
         dict:"han_hai_member,nick_name,id"
      },
      colProps: {span: 6},
 	},
	{
      label: "关联技师",
      field: "technicianId",
      component: 'JSearchSelect',
      componentProps:{
         dict:"msg_technician,title,id"
      },
      colProps: {span: 6},
 	},
	{
      label: "支付方式",
      field: "payType",
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"order_pay"
      },
      colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '头像',
    field: 'image',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '姓名',
    field: 'name',
    component: 'Input',
  },
  {
    label: '电话',
    field: 'phone',
    component: 'Input',
  },
  {
    label: '支付时间',
    field: 'payTime',
    component: 'Input',
  },
  {
    label: '下单地址',
    field: 'address',
    component: 'Input',
  },
  {
    label: '地址标识',
    field: 'addressId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"msg_address,address_detail,id"
    },
  },
  {
    label: '总计时间',
    field: 'useTime',
    component: 'InputNumber',
  },
  {
    label: '技师名称',
    field: 'terName',
    component: 'Input',
  },
  {
    label: '订单状态',
    field: 'state',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"order_state"
     },
  },
  {
    label: '订单价格',
    field: 'money',
    component: 'InputNumber',
  },
  {
    label: '用户标识',
    field: 'userId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"han_hai_member,nick_name,id"
    },
  },
  {
    label: '关联技师',
    field: 'technicianId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"msg_technician,title,id"
    },
  },
  {
    label: '项目标识',
    field: 'projectId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"msg_shop,title,id"
    },
  },
  {
    label: '项目名称',
    field: 'projectName',
    component: 'Input',
  },
  {
    label: '支付方式',
    field: 'payType',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"order_pay"
     },
  },
  {
    label: '订单备注',
    field: 'remark',
    component: 'Input',
  },
  {
    label: '优惠券标识',
    field: 'couponId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"msg_coupon,money,id"
    },
  },
  {
    label: '技师状态',
    field: 'tenState',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"ten_state"
     },
  },
  {
    label: '技师是否接单',
    field: 'tenOk',
     component: 'JSwitch',
     componentProps:{
     },
  },
  {
    label: '接单时间',
    field: 'confirmTime',
    component: 'Input',
  },
  {
    label: '出发时间',
    field: 'startTime',
    component: 'Input',
  },
  {
    label: '到达时间',
    field: 'arriveTime',
    component: 'Input',
  },
  {
    label: '到达照片',
    field: 'arrivalPicture',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '服务时间',
    field: 'startServiceTime',
    component: 'Input',
  },
  {
    label: '结束服务时间',
    field: 'endErviceTime',
    component: 'Input',
  },
  {
    label: '结束服务照片',
    field: 'endPicture',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '车费',
    field: 'temp',
    component: 'InputNumber',
  },
  {
    label: '服务下单时间',
    field: 'serviceTime',
    component: 'Input',
  },
  {
    label: '用户评价',
    field: 'evaluated',
    component: 'InputNumber',
  },
  {
    label: '技师评价',
    field: 'jsEvaluated',
    component: 'InputNumber',
  },
  {
    label: '服务日期',
    field: 'serviceDate',
    component: 'DatePicker',
  },
  {
    label: '分销商所得(一级)',
    field: 'shopMoney',
    component: 'InputNumber',
  },
  {
    label: '技师所得（项目）',
    field: 'tenMoney',
    component: 'InputNumber',
  },
  {
    label: '一级所得',
    field: 'tenPrice',
    component: 'InputNumber',
  },
  {
    label: '二级所得',
    field: 'tenMinPrice',
    component: 'InputNumber',
  },
  {
    label: '评价所得',
    field: 'pinPrice',
    component: 'InputNumber',
  },
];
