import useSelectStore from '@/store/commonSelect/common'
import { getPageListData } from '@/api/main/system/system'
let ly = useSelectStore().dictSourceList
let xm = useSelectStore().dictProjectList
let gdlx = useSelectStore().dictOrderTypeList
let slr = useSelectStore().workorderUserList
import moment from "moment";


export const searchFormConfig = {
    labelWidth: '120px',
    itemStyle: {
        padding: '0px'
    },
    colLayout: {
        span: 6
    },
    formItems: [{
            field: 'workordercode',
            type: 'input',
            label: '工单编号',
            clearable: true,
        },
        // {
        //   field: 'firsttype',
        //   type: 'select',
        //   clearable: true,
        //   label: '工单类别',
        //   options: [
        //     {
        //       value: '1000',
        //       title: '咨询',
        //     },
        //     {
        //       value: '2000',
        //       title: '建议',
        //     },
        //     {
        //       value: '3000',
        //       title: '投诉',
        //     },
        //     {
        //       value: '4000',
        //       title: '客户转运',
        //     }]
        // },
        {
            field: 'workordercate',
            type: 'elCascader',
            label: '工单类型',
            clearable: true,
            options: gdlx,
            props: {
                checkStrictly: true,
                value: 'id',
                children: 'children',
            }
        },
        {
            field: 'caller',
            type: 'input',
            label: '来电人',
            clearable: true,
        },
        {
            field: 'callnum',
            type: 'input',
            label: '手机号',
            clearable: true,
        },
        {
            field: 'createuser',
            type: 'select',
            clearable: true,
            label: '受理人',
            options: slr
        },
        {
            field: 'timeRange',
            type: 'datepicker',
            label: '创建时间',
            placeholder: '请选择时间',
            otherOptions: {
                'range-separator': '至',
                type: 'datetimerange',
                'value-format': 'YYYY-MM-DD HH:mm:ss',
            },
            fieldArray: ['createtime', 'endtime'],
            resFormat: (time) => {
                return moment(time).format('YYYY-MM-DD HH:mm:ss');
            },
        },
        {
            field: 'sex',
            type: 'select',
            clearable: true,
            label: '性别',
            options: [{
                    value: '1',
                    title: '男',
                },
                {
                    value: '2',
                    title: '女',
                },
                {
                    value: '0',
                    title: '未知',
                }
            ]
        },
        {
            field: 'sage',
            type: 'inputNumber',
            label: '最小年龄',
            clearable: true,
        },
        {
            field: 'eage',
            type: 'inputNumber',
            label: '最大年龄',
            clearable: true,
        },
        {
            field: 'visitUser',
            type: 'select',
            clearable: true,
            label: '回访人',
            options: slr
        },
        {
            field: 'visitTimeRange',
            type: 'datepicker',
            label: '回访时间',
            placeholder: '请选择时间',
            otherOptions: {
                'range-separator': '至',
                type: 'datetimerange',
                'value-format': 'YYYY-MM-DD HH:mm:ss',
            },
            fieldArray: ['visitstarttime', 'visitendtime'],
            resFormat: (time) => {
                return moment(time).format('YYYY-MM-DD HH:mm:ss');
            },
        },
    ]
}