<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" @row-del="rowDel">
        </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,
                rowKey: 'twlId',
                tip: false,
                size: 'medium',
                simplePage: true,
                searchShow: true,
                searchMenuSpan: 18,
                searchIcon: true,
                searchIndex: 3,
                tree: false,
                border: true,
                index: true,
                selection: false,
                viewBtn: false,
                delBtn: true,
                addBtn: true,
                editBtn: true,
                editBtnText: '修改',
                addBtnIcon:' ',
                viewBtnIcon:' ',
                delBtnIcon:' ',
                editBtnIcon:' ',
                viewBtnText: '详情',
                labelWidth: 120,
                searchLabelWidth: 120,
                menu: true,
                menuWidth: 140,
                dialogWidth: 1200,
                dialogClickModal: false,
                searchEnter: true,
                excelBtn: false,
                filterBtn: true,
                searchShowBtn: false,
                columnSort: true,
                excelBtn: true,
                columnSort: true,
                showOverflowTooltip: true,
                menuAlign: 'left',
                gridBtn:false,
                searchLabelPosition: 'left',
                searchGutter: 24,
                searchSpan: 6,
                searchMenuPosition:'right',
                align: 'center',
                
                column: [
                    {
                        label: '作业中心',
                        prop: 'wcName',
                        type: 'select',
                        bind: 'bsWorkCenter.wcId',
                        search: true,
                        sortable: true,
                        overHidden: true,
                         headerAlign: 'center',
                        align: 'left',
                        searchLabelWidth: 80,
                        rules: [
                            {
                                required: true,
                                message: '请输入作业中心',
                                trigger: 'blur',
                            },
                        ],
                        props: {
                            label: 'wcName',
                            value: 'wcId'
                        },
                        dicData: [
                            {
                                "area": 13000.0,
                                "batchNo": null,
                                "bigBatch": false,
                                "bsJfCenter": {
                                    "createMan": {
                                        "accountId": null,
                                        "card": null,
                                        "createTime": "2022-08-31",
                                        "curStatus": 1,
                                        "deleted": false,
                                        "deptName": null,
                                        "dimissionTime": null,
                                        "factoryId": 41,
                                        "head": 0,
                                        "jobName": "总工",
                                        "keyValue": 1,
                                        "ldapName": "admin",
                                        "mail": "13699999999@136.com",
                                        "mobile": "13699999999",
                                        "pfDepartment": {
                                            "appLink": null,
                                            "createTime": "2022-08-31",
                                            "deleted": false,
                                            "deptCode": "001",
                                            "deptId": 1,
                                            "deptName": "MES开发部",
                                            "deptType": 1,
                                            "deptTypeTitle": "厂",
                                            "keyValue": 1,
                                            "memo": null,
                                            "orders": "00",
                                            "parentDeptId": null,
                                            "parentPath": null,
                                            "ucDeptId": null,
                                            "updateTime": "2022-08-31 16:32:46"
                                        },
                                        "pinyinIndex": "ADMIN,ADMIN",
                                        "ucUserId": null,
                                        "updateTime": "2022-08-31 16:32:46",
                                        "userCode": "00",
                                        "userId": 1,
                                        "userName": "admin",
                                        "userSex": 1,
                                        "userSources": "admin",
                                        "userString": "1:A:admin",
                                        "userType": "A"
                                    },
                                    "createTime": "2024-12-09 00:00:00",
                                    "deleted": false,
                                    "jcCode": "RBZX",
                                    "jcId": 1,
                                    "jcName": "热表中心",
                                    "keyValue": 1,
                                    "updateTime": "2024-12-09 00:00:00"
                                },
                                "checkout": false,
                                "craftAbility": "化学镀镍",
                                "createMan": {
                                    "accountId": null,
                                    "card": null,
                                    "createTime": "2022-08-31",
                                    "curStatus": 1,
                                    "deleted": false,
                                    "deptName": null,
                                    "dimissionTime": null,
                                    "factoryId": 41,
                                    "head": 0,
                                    "jobName": "总工",
                                    "keyValue": 1,
                                    "ldapName": "admin",
                                    "mail": "13699999999@136.com",
                                    "mobile": "13699999999",
                                    "pfDepartment": {
                                        "appLink": null,
                                        "createTime": "2022-08-31",
                                        "deleted": false,
                                        "deptCode": "001",
                                        "deptId": 1,
                                        "deptName": "MES开发部",
                                        "deptType": 1,
                                        "deptTypeTitle": "厂",
                                        "keyValue": 1,
                                        "memo": null,
                                        "orders": "00",
                                        "parentDeptId": null,
                                        "parentPath": null,
                                        "ucDeptId": null,
                                        "updateTime": "2022-08-31 16:32:46"
                                    },
                                    "pinyinIndex": "ADMIN,ADMIN",
                                    "ucUserId": null,
                                    "updateTime": "2022-08-31 16:32:46",
                                    "userCode": "00",
                                    "userId": 1,
                                    "userName": "admin",
                                    "userSex": 1,
                                    "userSources": "admin",
                                    "userString": "1:A:admin",
                                    "userType": "A"
                                },
                                "createTime": "2023-02-06 12:31:36",
                                "deleted": false,
                                "describe": null,
                                "endPoint": null,
                                "keyValue": 81,
                                "leaderUser": {
                                    "accountId": 541,
                                    "card": null,
                                    "createTime": "2023-05-04",
                                    "curStatus": 1,
                                    "deleted": false,
                                    "deptName": null,
                                    "dimissionTime": null,
                                    "factoryId": 102,
                                    "head": 0,
                                    "jobName": "MES开发",
                                    "keyValue": 541,
                                    "ldapName": "cdl",
                                    "mail": null,
                                    "mobile": null,
                                    "pfDepartment": {
                                        "appLink": null,
                                        "createTime": "2022-08-31",
                                        "deleted": false,
                                        "deptCode": "001",
                                        "deptId": 1,
                                        "deptName": "MES开发部",
                                        "deptType": 1,
                                        "deptTypeTitle": "厂",
                                        "keyValue": 1,
                                        "memo": null,
                                        "orders": "00",
                                        "parentDeptId": null,
                                        "parentPath": null,
                                        "ucDeptId": null,
                                        "updateTime": "2022-08-31 16:32:46"
                                    },
                                    "pinyinIndex": "CUIDIANLONG,CDL",
                                    "ucUserId": null,
                                    "updateTime": "2023-05-04 09:16:54",
                                    "userCode": "cdl",
                                    "userId": 541,
                                    "userName": "崔殿龙",
                                    "userSex": 1,
                                    "userSources": "崔殿龙",
                                    "userString": "541:A:崔殿龙",
                                    "userType": "A"
                                },
                                "limitType": 0,
                                "processes": "上挂、下挂、交检、化学镀镍、喷砂",
                                "quantity": null,
                                "roundCycle": null,
                                "saturation": 85.0,
                                "sign": "4",
                                "startPoint": null,
                                "team": "化学镀镍一班崔胜伟、化学镀镍一班郭家梁",
                                "updateTime": "2023-03-06 18:42:47",
                                "wcCode": "001",
                                "wcId": 81,
                                "wcName": "化学镀镍作业中心",
                                "whetherPlate": false
                            },
                            {
                                "area": 0.0,
                                "batchNo": null,
                                "bigBatch": false,
                                "bsJfCenter": {
                                    "createMan": {
                                        "accountId": null,
                                        "card": null,
                                        "createTime": "2022-08-31",
                                        "curStatus": 1,
                                        "deleted": false,
                                        "deptName": null,
                                        "dimissionTime": null,
                                        "factoryId": 41,
                                        "head": 0,
                                        "jobName": "总工",
                                        "keyValue": 1,
                                        "ldapName": "admin",
                                        "mail": "13699999999@136.com",
                                        "mobile": "13699999999",
                                        "pfDepartment": {
                                            "appLink": null,
                                            "createTime": "2022-08-31",
                                            "deleted": false,
                                            "deptCode": "001",
                                            "deptId": 1,
                                            "deptName": "MES开发部",
                                            "deptType": 1,
                                            "deptTypeTitle": "厂",
                                            "keyValue": 1,
                                            "memo": null,
                                            "orders": "00",
                                            "parentDeptId": null,
                                            "parentPath": null,
                                            "ucDeptId": null,
                                            "updateTime": "2022-08-31 16:32:46"
                                        },
                                        "pinyinIndex": "ADMIN,ADMIN",
                                        "ucUserId": null,
                                        "updateTime": "2022-08-31 16:32:46",
                                        "userCode": "00",
                                        "userId": 1,
                                        "userName": "admin",
                                        "userSex": 1,
                                        "userSources": "admin",
                                        "userString": "1:A:admin",
                                        "userType": "A"
                                    },
                                    "createTime": "2024-12-09 00:00:00",
                                    "deleted": false,
                                    "jcCode": "RBZX",
                                    "jcId": 1,
                                    "jcName": "热表中心",
                                    "keyValue": 1,
                                    "updateTime": "2024-12-09 00:00:00"
                                },
                                "checkout": false,
                                "craftAbility": "镀后接收",
                                "createMan": {
                                    "accountId": null,
                                    "card": null,
                                    "createTime": "2022-08-31",
                                    "curStatus": 1,
                                    "deleted": false,
                                    "deptName": null,
                                    "dimissionTime": null,
                                    "factoryId": 41,
                                    "head": 0,
                                    "jobName": "总工",
                                    "keyValue": 1,
                                    "ldapName": "admin",
                                    "mail": "13699999999@136.com",
                                    "mobile": "13699999999",
                                    "pfDepartment": {
                                        "appLink": null,
                                        "createTime": "2022-08-31",
                                        "deleted": false,
                                        "deptCode": "001",
                                        "deptId": 1,
                                        "deptName": "MES开发部",
                                        "deptType": 1,
                                        "deptTypeTitle": "厂",
                                        "keyValue": 1,
                                        "memo": null,
                                        "orders": "00",
                                        "parentDeptId": null,
                                        "parentPath": null,
                                        "ucDeptId": null,
                                        "updateTime": "2022-08-31 16:32:46"
                                    },
                                    "pinyinIndex": "ADMIN,ADMIN",
                                    "ucUserId": null,
                                    "updateTime": "2022-08-31 16:32:46",
                                    "userCode": "00",
                                    "userId": 1,
                                    "userName": "admin",
                                    "userSex": 1,
                                    "userSources": "admin",
                                    "userString": "1:A:admin",
                                    "userType": "A"
                                },
                                "createTime": "2023-02-06 12:48:41",
                                "deleted": false,
                                "describe": null,
                                "endPoint": null,
                                "keyValue": 85,
                                "leaderUser": {
                                    "accountId": 541,
                                    "card": null,
                                    "createTime": "2023-05-04",
                                    "curStatus": 1,
                                    "deleted": false,
                                    "deptName": null,
                                    "dimissionTime": null,
                                    "factoryId": 102,
                                    "head": 0,
                                    "jobName": "MES开发",
                                    "keyValue": 541,
                                    "ldapName": "cdl",
                                    "mail": null,
                                    "mobile": null,
                                    "pfDepartment": {
                                        "appLink": null,
                                        "createTime": "2022-08-31",
                                        "deleted": false,
                                        "deptCode": "001",
                                        "deptId": 1,
                                        "deptName": "MES开发部",
                                        "deptType": 1,
                                        "deptTypeTitle": "厂",
                                        "keyValue": 1,
                                        "memo": null,
                                        "orders": "00",
                                        "parentDeptId": null,
                                        "parentPath": null,
                                        "ucDeptId": null,
                                        "updateTime": "2022-08-31 16:32:46"
                                    },
                                    "pinyinIndex": "CUIDIANLONG,CDL",
                                    "ucUserId": null,
                                    "updateTime": "2023-05-04 09:16:54",
                                    "userCode": "cdl",
                                    "userId": 541,
                                    "userName": "崔殿龙",
                                    "userSex": 1,
                                    "userSources": "崔殿龙",
                                    "userString": "541:A:崔殿龙",
                                    "userType": "A"
                                },
                                "limitType": 0,
                                "processes": "镀后接收",
                                "quantity": null,
                                "roundCycle": null,
                                "saturation": null,
                                "sign": "4",
                                "startPoint": null,
                                "team": "零件管理班",
                                "updateTime": "2023-03-06 18:23:20",
                                "wcCode": "004",
                                "wcId": 85,
                                "wcName": "镀后库作业中心",
                                "whetherPlate": true
                            },
                            {
                                "area": 0.0,
                                "batchNo": null,
                                "bigBatch": false,
                                "bsJfCenter": {
                                    "createMan": {
                                        "accountId": null,
                                        "card": null,
                                        "createTime": "2022-08-31",
                                        "curStatus": 1,
                                        "deleted": false,
                                        "deptName": null,
                                        "dimissionTime": null,
                                        "factoryId": 41,
                                        "head": 0,
                                        "jobName": "总工",
                                        "keyValue": 1,
                                        "ldapName": "admin",
                                        "mail": "13699999999@136.com",
                                        "mobile": "13699999999",
                                        "pfDepartment": {
                                            "appLink": null,
                                            "createTime": "2022-08-31",
                                            "deleted": false,
                                            "deptCode": "001",
                                            "deptId": 1,
                                            "deptName": "MES开发部",
                                            "deptType": 1,
                                            "deptTypeTitle": "厂",
                                            "keyValue": 1,
                                            "memo": null,
                                            "orders": "00",
                                            "parentDeptId": null,
                                            "parentPath": null,
                                            "ucDeptId": null,
                                            "updateTime": "2022-08-31 16:32:46"
                                        },
                                        "pinyinIndex": "ADMIN,ADMIN",
                                        "ucUserId": null,
                                        "updateTime": "2022-08-31 16:32:46",
                                        "userCode": "00",
                                        "userId": 1,
                                        "userName": "admin",
                                        "userSex": 1,
                                        "userSources": "admin",
                                        "userString": "1:A:admin",
                                        "userType": "A"
                                    },
                                    "createTime": "2024-12-09 00:00:00",
                                    "deleted": false,
                                    "jcCode": "RBZX",
                                    "jcId": 1,
                                    "jcName": "热表中心",
                                    "keyValue": 1,
                                    "updateTime": "2024-12-09 00:00:00"
                                },
                                "checkout": true,
                                "craftAbility": "镀后检验",
                                "createMan": {
                                    "accountId": null,
                                    "card": null,
                                    "createTime": "2022-08-31",
                                    "curStatus": 1,
                                    "deleted": false,
                                    "deptName": null,
                                    "dimissionTime": null,
                                    "factoryId": 41,
                                    "head": 0,
                                    "jobName": "总工",
                                    "keyValue": 1,
                                    "ldapName": "admin",
                                    "mail": "13699999999@136.com",
                                    "mobile": "13699999999",
                                    "pfDepartment": {
                                        "appLink": null,
                                        "createTime": "2022-08-31",
                                        "deleted": false,
                                        "deptCode": "001",
                                        "deptId": 1,
                                        "deptName": "MES开发部",
                                        "deptType": 1,
                                        "deptTypeTitle": "厂",
                                        "keyValue": 1,
                                        "memo": null,
                                        "orders": "00",
                                        "parentDeptId": null,
                                        "parentPath": null,
                                        "ucDeptId": null,
                                        "updateTime": "2022-08-31 16:32:46"
                                    },
                                    "pinyinIndex": "ADMIN,ADMIN",
                                    "ucUserId": null,
                                    "updateTime": "2022-08-31 16:32:46",
                                    "userCode": "00",
                                    "userId": 1,
                                    "userName": "admin",
                                    "userSex": 1,
                                    "userSources": "admin",
                                    "userString": "1:A:admin",
                                    "userType": "A"
                                },
                                "createTime": "2023-02-06 12:49:33",
                                "deleted": false,
                                "describe": null,
                                "endPoint": null,
                                "keyValue": 86,
                                "leaderUser": {
                                    "accountId": 541,
                                    "card": null,
                                    "createTime": "2023-05-04",
                                    "curStatus": 1,
                                    "deleted": false,
                                    "deptName": null,
                                    "dimissionTime": null,
                                    "factoryId": 102,
                                    "head": 0,
                                    "jobName": "MES开发",
                                    "keyValue": 541,
                                    "ldapName": "cdl",
                                    "mail": null,
                                    "mobile": null,
                                    "pfDepartment": {
                                        "appLink": null,
                                        "createTime": "2022-08-31",
                                        "deleted": false,
                                        "deptCode": "001",
                                        "deptId": 1,
                                        "deptName": "MES开发部",
                                        "deptType": 1,
                                        "deptTypeTitle": "厂",
                                        "keyValue": 1,
                                        "memo": null,
                                        "orders": "00",
                                        "parentDeptId": null,
                                        "parentPath": null,
                                        "ucDeptId": null,
                                        "updateTime": "2022-08-31 16:32:46"
                                    },
                                    "pinyinIndex": "CUIDIANLONG,CDL",
                                    "ucUserId": null,
                                    "updateTime": "2023-05-04 09:16:54",
                                    "userCode": "cdl",
                                    "userId": 541,
                                    "userName": "崔殿龙",
                                    "userSex": 1,
                                    "userSources": "崔殿龙",
                                    "userString": "541:A:崔殿龙",
                                    "userType": "A"
                                },
                                "limitType": 0,
                                "processes": "镀后检验、性能检测、镀后自检外观检验、镀后自检尺寸检验",
                                "quantity": null,
                                "roundCycle": null,
                                "saturation": null,
                                "sign": "4",
                                "startPoint": null,
                                "team": "检验班",
                                "updateTime": "2023-06-06 15:07:27",
                                "wcCode": "005",
                                "wcId": 86,
                                "wcName": "检验作业中心",
                                "whetherPlate": false
                            },
                        ]
                    },
                    // {
                    //     label: '槽号槽名',
                    //     prop: 'deviceCode',
                    //     bind: 'deEquipmentCard.deviceCode',
                    //     type: 'select',
                    //     search: true,
                    //     sortable: true,
                    //     overHidden: true,
                    //     rules: [
                    //         {
                    //             required: true,
                    //             message: '请输入设备编号',
                    //             trigger: 'blur',
                    //         },
                    //     ],
                    //     props: {
                    //         label: 'deviceName',
                    //         value: 'deviceCode'
                    //     },
                    //     dicData: [
                    //         {
                    //             "bindQty": 4,
                    //             "categorys": "产线设备",
                    //             "deviceCode": "9652247",
                    //             "deviceIp": null,
                    //             "deviceName": "化学镀镍",
                    //             "docking": true,
                    //             "ecId": 1,
                    //             "keyValue": 1,
                    //             "macCode": "9652247",
                    //             "macSpec": null,
                    //             "memo": null,
                    //             "rfId": "SYM-HCP-L4",
                    //             "status": true,
                    //             "typeName": "9652247",
                    //             "updateTime": null,
                    //             "used": 1,
                    //             "usedText": "正常服役",
                    //             "virtualMac": false
                    //         },
                    //         {
                    //             "bindQty": 0,
                    //             "categorys": "产线设备",
                    //             "deviceCode": "9565251",
                    //             "deviceIp": null,
                    //             "deviceName": "9565251",
                    //             "docking": true,
                    //             "ecId": 21,
                    //             "keyValue": 21,
                    //             "macCode": "9565251",
                    //             "macSpec": null,
                    //             "memo": null,
                    //             "rfId": "111",
                    //             "status": false,
                    //             "typeName": "9565251",
                    //             "updateTime": null,
                    //             "used": 3,
                    //             "usedText": "暂停服役",
                    //             "virtualMac": false
                    //         },
                    //         {
                    //             "bindQty": 0,
                    //             "categorys": "产线设备",
                    //             "deviceCode": "9651041_1",
                    //             "deviceIp": null,
                    //             "deviceName": "9651041_1",
                    //             "docking": true,
                    //             "ecId": 22,
                    //             "keyValue": 22,
                    //             "macCode": "9651041_1",
                    //             "macSpec": null,
                    //             "memo": null,
                    //             "rfId": null,
                    //             "status": false,
                    //             "typeName": "9651041_1",
                    //             "updateTime": null,
                    //             "used": 3,
                    //             "usedText": "暂停服役",
                    //             "virtualMac": false
                    //         },
                    //         {
                    //             "bindQty": 0,
                    //             "categorys": "产线设备",
                    //             "deviceCode": "9651041_2",
                    //             "deviceIp": "127.0.0.1",
                    //             "deviceName": "9651041_2",
                    //             "docking": true,
                    //             "ecId": 23,
                    //             "keyValue": 23,
                    //             "macCode": "9651041_2",
                    //             "macSpec": null,
                    //             "memo": "12345",
                    //             "rfId": "11111",
                    //             "status": false,
                    //             "typeName": "9651041_2",
                    //             "updateTime": null,
                    //             "used": 3,
                    //             "usedText": "暂停服役",
                    //             "virtualMac": false
                    //         },
                    //     ]
                    // },
                    {
                        label: '工艺员',
                        prop: 'craftName',
                        type: 'select',
                        multiple: true,
                        search: false,
                        sortable: true,
                        overHidden: true,
                         headerAlign: 'center',
                        align: 'center',
                        rules: [
                            {
                                required: true,
                                message: '请输入工艺员',
                                trigger: 'blur',
                            },
                        ],
                        props:{
                            label:'userName',
                            value:'userId'
                        },
                        dicData: [
                            {
                                "jobName": "生产调度员",
                                "deptName": "外协业务交付管理室",
                                "ldapName": "00188",
                                "userSex": 0,
                                "deptId": 65,
                                "mobile": null,
                                "userName": "00188",
                                "userId": 441,
                                "userCode": "00188"
                            }, {
                                "jobName": "表面处理工",
                                "deptName": "复合镍班",
                                "ldapName": "00460",
                                "userSex": 1,
                                "deptId": 69,
                                "mobile": null,
                                "userName": "00460",
                                "userId": 224,
                                "userCode": "00460"
                            }, {
                                "jobName": "保管员",
                                "deptName": "零件管理班",
                                "ldapName": "00660",
                                "userSex": 0,
                                "deptId": 46,
                                "mobile": null,
                                "userName": "00660",
                                "userId": 322,
                                "userCode": "00660"
                            },
                        ]
                    },
                ]
            }
        }
    },
    mounted() {

    },
    methods: {
        rowDel(row) {
            this.$confirm('确定将选择数据删除?', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning',
            }).then(res =>{

            })
        },
        rowSave(row, done, loading) {
            done()
        },
        rowUpdate(row, index, done, loading) {
            done()
        },
        searchReset() {
            this.query = {};
            this.onLoad(this.page);
        },
        searchChange(params, done) {
            // this.query = params;
            // this.page.currentPage = 1;
            // this.onLoad(this.page, params);
            done();
        },
        currentChange(currentPage) {
            this.page.currentPage = currentPage;
        },
        sizeChange(pageSize) {
            this.page.pageSize = pageSize;
        },
        refreshChange() {
            this.onLoad(this.page, this.query);
        },
        onLoad() {
            this.data = [
                {
                    "bsWorkCenter": {
                        "wcId": 81,
                        "wcName": "化学镀镍作业中心"
                    },
                    "bscsId": 4,
                    "craftManId": "[1,541]",
                    "craftManName": "[\"admin\",\"崔殿龙\"]",
                    "craftName": "admin,崔殿龙",
                    "deEquipmentCard": {
                        "bindQty": 4,
                        "categorys": "产线设备",
                        "deviceCode": "9652247",
                        "deviceIp": null,
                        "deviceName": "化学镀镍",
                        "docking": true,
                        "ecId": 1,
                        "keyValue": 1,
                        "macCode": "9652247",
                        "macSpec": null,
                        "memo": null,
                        "rfId": "SYM-HCP-L4",
                        "status": true,
                        "typeName": "9652247",
                        "updateTime": null,
                        "used": 1,
                        "usedText": "正常服役",
                        "virtualMac": false
                    },
                    "keepMan": {
                        "userId": 541,
                        "userName": "崔殿龙"
                    },
                    "keepTime": "2024-04-08 17:00:37",
                    "keyValue": 4
                }
            ]
            this.page.total = this.data.length
        }
    }
}
</script>