<template>
    <basic-container>
        <!-- 量具使用记录 -->
        <avue-crud :option="option" :table-loading="loading" :data="data" v-model="form" v-model:page="page" ref="crud"
            @row-update="rowUpdate" @row-save="rowSave" @search-change="searchChange" @search-reset="searchReset"
            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad"></avue-crud>
    </basic-container>
</template>

<script>
export default {
    data() {
        return {
            loading: false,
            data: [],
            form: {},
            page: {
                pageSize: 10,
                currentPage: 1,
                total: 0,
            },
            option: {
                height: 'auto',
                calcHeight: 32,
                tip: false,
                size: 'medium',
                simplePage: true,
                searchShow: true,
                searchMenuSpan: 6,
                searchIcon: true,
                searchIndex: 3,
                tree: false,
                border: true,
                index: true,
                selection: true,
                viewBtn: false,
                delBtn: false,
                addBtn: false,
                editBtn: true,
                editBtnText: '修改',
                viewBtnIcon: ' ',
                delBtnIcon: ' ',
                editBtnIcon: ' ',
                viewBtnText: '详情',
                labelWidth: 120,
                searchLabelWidth: 120,
                menu:false,
                menuWidth: 220,
                dialogWidth: 1200,
                dialogClickModal: false,
                searchEnter: true,
                excelBtn: false,
                filterBtn: true,
                searchShowBtn: false,
                columnSort: true,
                excelBtn: true,
                columnSort: true,
                index: false,
                showOverflowTooltip: true,
                searchLabelPosition:'left',
searchLabelPosition:'left',
 searchGutter:24,
  searchSpan:6,
menuAlign: 'left',
gridBtn:false,
searchMenuPosition:'right',

                column: [
                    {
                        label: '材料名称',
                        prop: 'toolName',
                        search: true,
                        sortable: true,
                        overHidden: true,
                        width: 200,
                        rules: [
                            {
                                required: true,
                                message: '请输入材料名称',
                                trigger: 'blur',
                            },
                        ],
                    },
                    {
                        label: '工具编号1',
                        prop: 'toolCodeOne',
                        search: false,
                        sortable: true,
                        overHidden: true,
                        width: 200,
                        rules: [
                            {
                                required: true,
                                message: '请输入工具编号1',
                                trigger: 'blur',
                            },
                        ],
                    },
                    {
                        label: '工具编号2',
                        prop: 'toolCodeTwo',
                        search: false,
                        sortable: true,
                        overHidden: true,
                        width: 200,
                        rules: [
                            {
                                required: true,
                                message: '请输入工具编号2',
                                trigger: 'blur',
                            },
                        ],
                    },
                    {
                        label: '材料编号',
                        prop: 'toolCodeOne',
                        search: false,
                        sortable: true,
                        overHidden: true,
                        width: 200,
                        rules: [
                            {
                                required: true,
                                message: '请输入材料编号',
                                trigger: 'blur',
                            },
                        ],
                    },
                    {
                        label: '原编码',
                        prop: 'originalCode',
                        search: false,
                        sortable: true,
                        overHidden: true,
                        width: 200,
                        rules: [
                            {
                                required: true,
                                message: '请输入原编码',
                                trigger: 'blur',
                            },
                        ],
                    },
                    {
                        label: '库房号',
                        prop: 'equiAddress',
                        search: false,
                        sortable: true,
                        overHidden: true,
                        width: 200,
                        rules: [
                            {
                                required: true,
                                message: '请输入库房号',
                                trigger: 'blur',
                            },
                        ],
                    },
                    {
                        label: '库位号',
                        prop: 'boxNumber',
                        search: false,
                        sortable: true,
                        overHidden: true,
                        width: 200,
                        rules: [
                            {
                                required: true,
                                message: '请输入库位号',
                                trigger: 'blur',
                            },
                        ],
                    },
                    {
                        label: '部门',
                        prop: 'deptName',
                        search: false,
                        sortable: true,
                        overHidden: true,
                        width: 200,
                        rules: [
                            {
                                required: true,
                                message: '请输入部门',
                                trigger: 'blur',
                            },
                        ],
                    },
                    {
                        label: '工具图片',
                        prop: 'toolImg',
                        search: false,
                        sortable: true,
                        overHidden: true,
                        width: 200,
                        rules: [
                            {
                                required: true,
                                message: '请输入工具图片',
                                trigger: 'blur',
                            },
                        ],
                    },
                    {
                        label: '提请时间',
                        prop: 'createTime',
                        search: false,
                        sortable: true,
                        overHidden: true,
                        width: 200,
                        rules: [
                            {
                                required: true,
                                message: '请输入提请时间',
                                trigger: 'blur',
                            },
                        ],
                    },
                    {
                        label: '标记状态',
                        prop: 'toolStatus',
                        type: 'select',
                        search: true,
                        sortable: true,
                        overHidden: true,
                        width: 200,
                        rules: [
                            {
                                required: true,
                                message: '请输入标记状态',
                                trigger: 'blur',
                            },
                        ],
                        dicData: [
                            {
                                value: '0',
                                label: '待分配'
                            }, {
                                value: '1',
                                label: '待入库'
                            }, {
                                value: '2',
                                label: '正常'
                            }, {
                                value: '3',
                                label: '借用中'
                            }, {
                                value: '4',
                                label: '待检修'
                            }, {
                                value: '5',
                                label: '检修逾期'
                            }, {
                                value: '6',
                                label: '检修中'
                            }, {
                                value: '7',
                                label: '报废'
                            }
                        ]
                    },
                    {
                        label: '工具规格',
                        prop: 'toolSpec',
                        search: true,
                        hide:true,
                        sortable: true,
                        overHidden: true,
                        width: 200,
                        rules: [
                            {
                                required: true,
                                message: '请输入工具规格',
                                trigger: 'blur',
                            },
                        ],
                    },
                    {
                        label: '类型',
                        prop: 'typeName',
                        search: true,
                        sortable: true,
                        overHidden: true,
                        width: 200,
                        rules: [
                            {
                                required: true,
                                message: '请输入类型',
                                trigger: 'blur',
                            },
                        ],
                    },
                    {
                        label: '工具条码',
                        prop: 'toolId',
                        search: true,
                        hide:true,
                        sortable: true,
                        overHidden: true,
                        width: 200,
                        rules: [
                            {
                                required: true,
                                message: '请输入工具条码',
                                trigger: 'blur',
                            },
                        ],
                    },
                    {
                        label: '设备编号',
                        prop: 'equiCode',
                        search: true,
                        hide:true,
                        sortable: true,
                        overHidden: true,
                        width: 200,
                        rules: [
                            {
                                required: true,
                                message: '请输入设备编号',
                                trigger: 'blur',
                            },
                        ],
                    },
                    {
                        label: '寿命',
                        prop: 'useNumber',
                        search: false,
                        sortable: true,
                        overHidden: true,
                        width: 200,
                        rules: [
                            {
                                required: true,
                                message: '请输入寿命',
                                trigger: 'blur',
                            },
                        ],
                    },
                    {
                        label: '历史累计次数',
                        prop: 'countUse',
                        search: false,
                        sortable: true,
                        overHidden: true,
                        width: 200,
                        rules: [
                            {
                                required: true,
                                message: '请输入历史累计次数',
                                trigger: 'blur',
                            },
                        ],
                    },
                    {
                        label: '检修天数',
                        prop: 'checkDate',
                        search: false,
                        sortable: true,
                        overHidden: true,
                        width: 200,
                        rules: [
                            {
                                required: true,
                                message: '请输入检修天数',
                                trigger: 'blur',
                            },
                        ],
                    },
                    {
                        label: '预警天数',
                        prop: 'warningDay',
                        search: false,
                        sortable: true,
                        overHidden: true,
                        width: 200,
                        rules: [
                            {
                                required: true,
                                message: '请输入预警天数',
                                trigger: 'blur',
                            },
                        ],
                    },
                    {
                        label: '借用时间',
                        prop: 'borrowHours',
                        search: false,
                        sortable: true,
                        overHidden: true,
                        width: 200,
                        rules: [
                            {
                                required: true,
                                message: '请输入借用时间',
                                trigger: 'blur',
                            },
                        ],
                    },
                ]

            }
        }
    }
}
</script>

<style></style>