columns.js 12 KB
Newer Older
左玲玲's avatar
左玲玲 committed
1
import { Tooltip, Image } from 'antd';
左玲玲's avatar
左玲玲 committed
2
import Filedetail from "@/components/Filedetail";
左玲玲's avatar
左玲玲 committed
3 4 5
function getcolumns(setdrawer) {
    return {
        columns: [
左玲玲's avatar
左玲玲 committed
6 7 8 9
            {
                title: '设备信息',
                valueType: 'split'
            },
左玲玲's avatar
左玲玲 committed
10 11
            {
                title: '设备编号',
左玲玲's avatar
左玲玲 committed
12 13
                dataIndex: 'equipmentNo',
                key: 'equipmentNo',
左玲玲's avatar
左玲玲 committed
14 15 16 17
                formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
                colProps: { span: 8 },
                render: (_, row) => {
                    return (
左玲玲's avatar
左玲玲 committed
18
                        <Tooltip title={row.equipmentNo}>
左玲玲's avatar
左玲玲 committed
19 20 21 22 23
                            <a
                                className="table-cell"
                                onClick={() => {
                                    setdrawer && setdrawer((s) => ({
                                        ...s,
左玲玲's avatar
左玲玲 committed
24
                                        open: true,
左玲玲's avatar
左玲玲 committed
25 26
                                        item: row,
                                        val: 'only',
左玲玲's avatar
左玲玲 committed
27 28
                                        title: '设备详情',
                                        type: ''
左玲玲's avatar
左玲玲 committed
29 30 31
                                    }));
                                }}
                            >
左玲玲's avatar
左玲玲 committed
32
                                {row.equipmentNo}
左玲玲's avatar
左玲玲 committed
33 34 35 36 37
                            </a>
                        </Tooltip>
                    );
                }
            },
左玲玲's avatar
左玲玲 committed
38 39 40 41 42 43 44
            {
                title: '设备名称',
                dataIndex: 'equipmentName',
                key: 'equipmentName',
                formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
                colProps: { span: 8 }
            },
左玲玲's avatar
左玲玲 committed
45 46
            {
                title: '资产编号',
左玲玲's avatar
左玲玲 committed
47 48
                dataIndex: 'assetNumber',
                key: 'assetNumber',
左玲玲's avatar
左玲玲 committed
49 50 51 52
                colProps: { span: 8 }
            },
            {
                title: '关联设备',
左玲玲's avatar
左玲玲 committed
53 54
                dataIndex: 'ledgerEquipmentNo',
                key: 'ledgerEquipmentNo',
左玲玲's avatar
左玲玲 committed
55 56 57 58 59
                hideInForm: true,
                colProps: { span: 8 }
            },
            {
                title: '设备品牌',
左玲玲's avatar
左玲玲 committed
60 61
                dataIndex: 'brand',
                key: 'brand',
左玲玲's avatar
左玲玲 committed
62 63 64 65
                colProps: { span: 8 }
            },
            {
                title: '设备型号',
左玲玲's avatar
左玲玲 committed
66 67 68 69 70
                dataIndex: 'equipmentModelName',
                key: 'equipmentModelId',
                formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
                valueType: 'select',
                options: { path: '/asset/equipmentModel/query/selection', params: {} },
71 72 73 74 75
                colProps: { span: 8 },
                fieldProps: {
                    placeholder: '请选择',
                    showSearch: true,
                },
左玲玲's avatar
左玲玲 committed
76 77 78 79 80
            },
            {
                title: '设备类型',
                dataIndex: 'equipmentTypeName',
                key: 'equipmentType',
左玲玲's avatar
左玲玲 committed
81
                formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
左玲玲's avatar
左玲玲 committed
82
                hideInSearch: false,
左玲玲's avatar
左玲玲 committed
83
                valueType: 'select',
左玲玲's avatar
左玲玲 committed
84
                options: [
85 86
                    { label: '设备', value: 1 },
                    { label: '智能单元', value: 2 },
左玲玲's avatar
左玲玲 committed
87
                ],
左玲玲's avatar
左玲玲 committed
88 89
                colProps: { span: 8 }
            },
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
            {
                title: '经营状态',
                dataIndex: 'statusName',
                key: 'status',
                hideInForm: true,
                valueType: 'select',
                options: [
                    { label: '报废', value: '0' },
                    { label: '预占', value: '1' },
                    { label: '租赁', value: '2' },
                    { label: '销售', value: '3' },
                    { label: '闲置', value: '4' },
                    { label: '待复检', value: '5' },
                    { label: '未绑定', value: '6' },
                    { label: '绑定', value: '7' },
左玲玲's avatar
左玲玲 committed
105
                    { label: '待确认', value: '8' }
106
                ],
左玲玲's avatar
左玲玲 committed
107
                fixed: 'left',
108
                width: 80
109
            },
左玲玲's avatar
左玲玲 committed
110 111 112 113
            {
                title: '所属信息',
                valueType: 'split'
            },
左玲玲's avatar
左玲玲 committed
114 115
            {
                title: '公司名称',
116
                dataIndex: 'companyName',
左玲玲's avatar
左玲玲 committed
117
                key: 'organizationId',
左玲玲's avatar
左玲玲 committed
118 119 120
                hideInSearch: true,
                hideInTable: true,
                valueType: 'select',
左玲玲's avatar
左玲玲 committed
121
                options: { path: '/auth/sysDepartment/query/organization/selectbox', params: {} },
左玲玲's avatar
左玲玲 committed
122 123 124 125
                colProps: { span: 8 }
            },
            {
                title: '部门名称',
左玲玲's avatar
左玲玲 committed
126 127
                dataIndex: 'departmentName',
                key: 'departmentId',
左玲玲's avatar
左玲玲 committed
128 129 130
                formItemProps: { rules: [{ required: false, message: '此项为必填项' }] },
                hideInSearch: true,
                hideInTable: true,
左玲玲's avatar
左玲玲 committed
131
                valueType: 'treeSelect',
132
                options: { path: '/auth/sysDepartment/query/children/tree', linkParams: { organizationId: 'parentId' } },
左玲玲's avatar
左玲玲 committed
133 134 135 136 137
                colProps: { span: 8 }
            },
            {
                title: '工厂名称',
                dataIndex: 'factoryName',
138 139
                key: 'factoryId',
                valueType: 'select',
左玲玲's avatar
左玲玲 committed
140 141 142 143
                hideInSearch: true,
                hideInTable: true,
                hideInDescriptions: true,
                colProps: { span: 8 },
左玲玲's avatar
左玲玲 committed
144
                options: { path: '/auth/sysFactory/getFactorySelectBox', params: {} },
145
                formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
左玲玲's avatar
左玲玲 committed
146 147
                fieldProps: {
                    disabled: true
148
                },
左玲玲's avatar
左玲玲 committed
149 150 151 152 153 154
            },
            {
                title: '工厂名称',
                dataIndex: 'factoryName',
                key: 'factoryId',
                valueType: 'select',
左玲玲's avatar
左玲玲 committed
155
                options: { path: '/auth/sysFactory/getFactorySelectBox', params: {} },
左玲玲's avatar
左玲玲 committed
156
                hideInForm: true,
157 158 159 160 161
                colProps: { span: 8 },
                fieldProps: {
                    placeholder: '请选择',
                    showSearch: true,
                },
左玲玲's avatar
左玲玲 committed
162 163 164 165 166 167 168
            },
            {
                title: '车间名称',
                dataIndex: 'shopName',
                key: 'shopId',
                hideInSearch: true,
                hideInTable: true,
左玲玲's avatar
左玲玲 committed
169
                hideInDescriptions:true,
左玲玲's avatar
左玲玲 committed
170
                valueType: 'select',
左玲玲's avatar
左玲玲 committed
171
                options: { path: '/auth/sysShop/getShopSelectBox', linkParams: { factoryId: '' } },
172 173
                colProps: { span: 8 },
                fieldProps: {
左玲玲's avatar
左玲玲 committed
174 175 176 177 178 179 180 181 182 183 184 185 186
                    placeholder: '请选择',
                    showSearch: true,
                },
            },
            {
                title: '车间名称',
                dataIndex: 'shopName',
                key: 'shopId',
                hideInForm: true,
                valueType: 'select',
                options: { path: '/auth/sysShop/getShopSelectBox',params:{} },
                colProps: { span: 8 },
                fieldProps: {
187 188 189
                    placeholder: '请选择',
                    showSearch: true,
                },
左玲玲's avatar
左玲玲 committed
190 191 192 193 194 195 196 197 198
            },
            {
                title: '工段名称',
                dataIndex: 'sectionName',
                key: 'sectionId',
                hideInSearch: true,
                hideInTable: true,
                valueType: 'select',
                options: {
左玲玲's avatar
左玲玲 committed
199
                    path: '/auth/sysSection/getSectionSelectBox',
左玲玲's avatar
左玲玲 committed
200 201 202 203 204 205 206 207 208 209 210 211
                    linkParams: { shopId: '' },
                },
                colProps: { span: 8 }
            },
            {
                title: '产线名称',
                dataIndex: 'productionLineName',
                key: 'productionLineId',
                valueType: 'select',
                hideInSearch: true,
                hideInTable: true,
                options: {
左玲玲's avatar
左玲玲 committed
212
                    path: '/auth/sysProductionLine/getProductLineSelectBox',
左玲玲's avatar
左玲玲 committed
213 214 215 216 217 218
                    linkParams: { shopId: '' },
                },
                colProps: { span: 8 }
            },
            {
                title: '关联客户',
左玲玲's avatar
左玲玲 committed
219 220
                dataIndex: 'ledgerCustomer',
                key: 'ledgerCustomer',
左玲玲's avatar
左玲玲 committed
221 222 223 224
                hideInSearch: false,
                hideInTable: false,
                hideInForm: true,
                valueType: 'select',
左玲玲's avatar
左玲玲 committed
225 226
                options: { path: '/lease/umLeaseCustomer/getSelection', params: {} },
                colProps: { span: 8 },
227 228 229 230 231
                span: 3,
                fieldProps: {
                    placeholder: '请选择',
                    showSearch: true,
                },
左玲玲's avatar
左玲玲 committed
232 233 234 235
            },
            {
                title: '其他信息',
                valueType: 'split'
左玲玲's avatar
左玲玲 committed
236 237 238
            },
            {
                title: '供应商',
左玲玲's avatar
左玲玲 committed
239 240
                dataIndex: 'supplierName',
                key: 'supplierId',
左玲玲's avatar
左玲玲 committed
241
                valueType: 'select',
左玲玲's avatar
左玲玲 committed
242
                options: { path: '/lease/umEquipmentSupplier/getSelection', params: {} },
243 244 245 246 247 248
                colProps: { span: 8 },
                fieldProps: {
                    placeholder: '请选择',
                    showSearch: true,
                },
                span: 1
左玲玲's avatar
左玲玲 committed
249 250 251
            },
            {
                title: '保管单位',
左玲玲's avatar
左玲玲 committed
252 253
                dataIndex: 'custodyUnit',
                key: 'custodyUnit',
左玲玲's avatar
左玲玲 committed
254 255 256 257
                colProps: { span: 8 }
            },
            {
                title: '产权单位',
左玲玲's avatar
左玲玲 committed
258 259
                dataIndex: 'propertyUnit',
                key: 'propertyUnit',
左玲玲's avatar
左玲玲 committed
260 261
                colProps: { span: 8 }
            },
左玲玲's avatar
左玲玲 committed
262 263 264 265 266 267 268 269 270 271 272 273
            {
                title: '制造商',
                dataIndex: 'manufacturer',
                key: 'manufacturer',
                colProps: { span: 8 }
            },
            {
                title: '采购合同编号',
                dataIndex: 'procurementContractNo',
                key: 'procurementContractNo',
                colProps: { span: 8 }
            },
左玲玲's avatar
左玲玲 committed
274 275
            {
                title: '上传图片',
左玲玲's avatar
左玲玲 committed
276 277
                dataIndex: 'picList',
                key: 'picList',
左玲玲's avatar
左玲玲 committed
278 279 280 281 282 283
                hideInSearch: true,
                hideInTable: true,
                hideInDescriptions: true,
                valueType: 'uploadImage',
                fieldProps: {
                    limit: 1,
左玲玲's avatar
左玲玲 committed
284 285
                },
                colProps: { span: 24 }
左玲玲's avatar
左玲玲 committed
286 287 288
            },
            {
                title: '图片',
左玲玲's avatar
左玲玲 committed
289 290
                dataIndex: 'imageUrl',
                key: 'imageUrl',
左玲玲's avatar
左玲玲 committed
291
                hideInSearch: true,
左玲玲's avatar
左玲玲 committed
292
                hideInForm: true,
左玲玲's avatar
左玲玲 committed
293
                render: (_, row) => {
294
                    return row?.imageUrl ? <Image style={{ width: 40, height: 40, objectFit: 'contain', objectPosition: 'center' }} src={row?.imageUrl} /> : '-'
左玲玲's avatar
左玲玲 committed
295 296 297 298
                }
            },
            {
                title: '二维码',
左玲玲's avatar
左玲玲 committed
299 300
                dataIndex: 'qrCodeUrl',
                key: 'qrCodeUrl',
左玲玲's avatar
左玲玲 committed
301
                hideInSearch: true,
左玲玲's avatar
左玲玲 committed
302
                hideInForm: true,
左玲玲's avatar
左玲玲 committed
303
                render: (_, row) => {
304
                    return row?.qrCodeUrl ? <Image style={{ width: 40, height: 40, objectFit: 'contain', objectPosition: 'center' }} src={row?.qrCodeUrl} /> : '-'
左玲玲's avatar
左玲玲 committed
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323
                },
                span: 3
            },
            {
                title: '基本配置',
                dataIndex: 'baseFileList',
                key: 'baseFileList',
                hideInSearch: true,
                hideInTable: true,
                valueType: 'uploadBtn',
                fieldProps: {
                    limit: 5,
                },
                render: (_, row) => {
                    return <Filedetail files={row?.['baseFileList']} />
                },
                span: 3,
                colProps: { span: 24 }
            },
左玲玲's avatar
左玲玲 committed
324 325
        ],
        pathconfig: {
左玲玲's avatar
左玲玲 committed
326 327 328 329
            add: '/lease/umLeaseLedger/save',
            edit: '/lease/umLeaseLedger/save',
            list: '/lease/umLeaseLedger/queryList',
            delete: '/lease/umLeaseLedger/deleteById',
330
            detail: '/lease/umLeaseLedger/detail'
左玲玲's avatar
左玲玲 committed
331 332 333 334
        },
    };
}
export default getcolumns;