columns.js 8.55 KB
Newer Older
TZW's avatar
TZW committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
function getcolumns(setdrawer, bus) {
  let listOptions = [];
  if (bus !== '2') {
    listOptions = [
      {
        label: '待接单',
        value: '1',
      },
      {
        label: '外协中',
        value: '3',
      },
    ];
  } else {
    listOptions = [
      {
        label: '待派单',
        value: '2',
      },
      {
        label: '外协中',
        value: '3',
      },
    ];
  }
wuhao's avatar
wuhao committed
26 27
  return [
    {
TZW's avatar
TZW committed
28 29 30 31 32
      tab: '我的待办',
      key: '1',
      columns: [
        {
          title: '外协单号',
TZW's avatar
TZW committed
33 34
          dataIndex: 'otherUnitsOrderNo',
          key: 'otherUnitsOrderNo',
TZW's avatar
TZW committed
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
          render: (text, row, _, action) => {
            return (
              <a
                onClick={() => {
                  setdrawer((s) => ({
                    ...s,
                    open: true,
                    title: '详情',
                    val: 'only',
                    type: 'detail',
                    title: '详细信息',
                    item: row,
                  }));
                }}
              >
                {row?.otherUnitsOrderNo}
              </a>
            );
          },
TZW's avatar
TZW committed
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
        },
        {
          title: '设备编号',
          dataIndex: 'equipmentNo',
          key: 'equipmentNo',
        },
        {
          title: '设备名称',
          dataIndex: 'equipmentName',
          key: 'equipmentName',
        },
        {
          title: '故障描述',
          dataIndex: 'faultDescription',
          key: 'faultDescription',
          valueType: 'textarea',
        },
        {
          title: '创建时间',
TZW's avatar
TZW committed
73 74
          dataIndex: 'createTime',
          key: 'createTimeList',
TZW's avatar
TZW committed
75 76
          valueType: 'dateTimeRange',
          fieldProps: {
TZW's avatar
TZW committed
77 78 79 80 81
            showTime: {
              format: 'HH:mm',
            },
            format: 'YYYY-MM-DD HH:mm',
          },
TZW's avatar
TZW committed
82 83 84
        },
        {
          title: '创建人员',
TZW's avatar
TZW committed
85
          dataIndex: 'createUserName',
TZW's avatar
TZW committed
86 87 88 89 90 91 92 93
          key: 'createUserId',
          valueType: 'select',
          fieldProps: {
            showSearch: true,
          },
          options: {
            path: '/auth/sysUser/selection',
          },
TZW's avatar
TZW committed
94 95 96 97 98
        },
        {
          title: '最新外协人员',
          dataIndex: 'newRepairUserName',
          key: 'newRepairUserName',
TZW's avatar
TZW committed
99 100 101 102 103 104 105
          valueType: 'select',
          fieldProps: {
            showSearch: true,
          },
          options: {
            path: '/auth/sysUser/selection',
          },
TZW's avatar
TZW committed
106 107 108
        },
        {
          title: '来源单号',
TZW's avatar
TZW committed
109 110
          dataIndex: 'dataSourcesNo',
          key: 'dataSourcesNo',
TZW's avatar
TZW committed
111 112 113 114 115
        },
        {
          title: '工单状态',
          dataIndex: 'statusName',
          key: 'status',
TZW's avatar
TZW committed
116 117 118 119 120
          valueType: 'select',
          options: listOptions,
          fieldProps: {
            dropdownMatchSelectWidth: 150,
          },
TZW's avatar
TZW committed
121 122 123 124 125 126 127 128 129
        },
      ],
      pathconfig: {
        enableadd: true,
        enableedit: false,
        enabledelete: true,
        enabledetail: false,
        add: '',
        edit: '',
TZW's avatar
TZW committed
130
        list: '/repair/umOtherUnitsOrder/queryMyDealwithList',
TZW's avatar
TZW committed
131
        delete: '/repair/umOtherUnitsOrder/deleteById',
TZW's avatar
TZW committed
132
        detail: '',
wuhao's avatar
wuhao committed
133 134 135
      },
    },
    {
TZW's avatar
TZW committed
136 137
      tab: '未完成',
      key: '2',
TZW's avatar
TZW committed
138 139 140
      columns: [
        {
          title: '外协单号',
TZW's avatar
TZW committed
141 142
          dataIndex: 'otherUnitsOrderNo',
          key: 'otherUnitsOrderNo',
TZW's avatar
TZW committed
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
          render: (text, row, _, action) => {
            return (
              <a
                onClick={() => {
                  setdrawer((s) => ({
                    ...s,
                    open: true,
                    title: '详情',
                    val: 'only',
                    type: 'detail',
                    title: '详细信息',
                    item: row,
                  }));
                }}
              >
                {row?.otherUnitsOrderNo}
              </a>
            );
          },
TZW's avatar
TZW committed
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
        },
        {
          title: '设备编号',
          dataIndex: 'equipmentNo',
          key: 'equipmentNo',
        },
        {
          title: '设备名称',
          dataIndex: 'equipmentName',
          key: 'equipmentName',
        },
        {
          title: '故障描述',
          dataIndex: 'faultDescription',
          key: 'faultDescription',
          valueType: 'textarea',
        },
        {
          title: '创建时间',
TZW's avatar
TZW committed
181 182
          dataIndex: 'createTime',
          key: 'createTimeList',
TZW's avatar
TZW committed
183 184
          valueType: 'dateTimeRange',
          fieldProps: {
TZW's avatar
TZW committed
185 186 187 188 189
            showTime: {
              format: 'HH:mm',
            },
            format: 'YYYY-MM-DD HH:mm',
          },
TZW's avatar
TZW committed
190 191 192
        },
        {
          title: '创建人员',
TZW's avatar
TZW committed
193 194 195 196 197 198 199 200 201
          dataIndex: 'createUserName',
          key: 'createUserId',
          valueType: 'select',
          fieldProps: {
            showSearch: true,
          },
          options: {
            path: '/auth/sysUser/selection',
          },
TZW's avatar
TZW committed
202 203 204 205 206
        },
        {
          title: '最新外协人员',
          dataIndex: 'newRepairUserName',
          key: 'newRepairUserName',
TZW's avatar
TZW committed
207 208 209 210 211 212 213
          valueType: 'select',
          fieldProps: {
            showSearch: true,
          },
          options: {
            path: '/auth/sysUser/selection',
          },
TZW's avatar
TZW committed
214 215 216
        },
        {
          title: '来源单号',
TZW's avatar
TZW committed
217 218
          dataIndex: 'dataSourcesNo',
          key: 'dataSourcesNo',
TZW's avatar
TZW committed
219 220 221 222 223
        },
        {
          title: '工单状态',
          dataIndex: 'statusName',
          key: 'status',
TZW's avatar
TZW committed
224 225 226 227 228
          valueType: 'select',
          options: listOptions,
          fieldProps: {
            dropdownMatchSelectWidth: 150,
          },
TZW's avatar
TZW committed
229 230 231 232 233 234 235 236 237
        },
      ],
      pathconfig: {
        enableadd: true,
        enableedit: false,
        enabledelete: true,
        enabledetail: false,
        add: '',
        edit: '',
TZW's avatar
TZW committed
238
        list: '/repair/umOtherUnitsOrder/queryList',
TZW's avatar
TZW committed
239
        delete: '/repair/umOtherUnitsOrder/deleteById',
TZW's avatar
TZW committed
240
        detail: '',
wuhao's avatar
wuhao committed
241 242 243
      },
    },
    {
TZW's avatar
TZW committed
244 245
      tab: '已完成',
      key: '3',
TZW's avatar
TZW committed
246 247 248
      columns: [
        {
          title: '外协单号',
TZW's avatar
TZW committed
249 250
          dataIndex: 'otherUnitsOrderNo',
          key: 'otherUnitsOrderNo',
TZW's avatar
TZW committed
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269
          render: (text, row, _, action) => {
            return (
              <a
                onClick={() => {
                  setdrawer((s) => ({
                    ...s,
                    open: true,
                    title: '详情',
                    val: 'only',
                    type: 'detail',
                    title: '详细信息',
                    item: row,
                  }));
                }}
              >
                {row?.otherUnitsOrderNo}
              </a>
            );
          },
TZW's avatar
TZW committed
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288
        },
        {
          title: '设备编号',
          dataIndex: 'equipmentNo',
          key: 'equipmentNo',
        },
        {
          title: '设备名称',
          dataIndex: 'equipmentName',
          key: 'equipmentName',
        },
        {
          title: '故障描述',
          dataIndex: 'faultDescription',
          key: 'faultDescription',
          valueType: 'textarea',
        },
        {
          title: '创建时间',
TZW's avatar
TZW committed
289 290
          dataIndex: 'createTime',
          key: 'createTimeList',
TZW's avatar
TZW committed
291 292
          valueType: 'dateTimeRange',
          fieldProps: {
TZW's avatar
TZW committed
293 294 295 296 297
            showTime: {
              format: 'HH:mm',
            },
            format: 'YYYY-MM-DD HH:mm',
          },
TZW's avatar
TZW committed
298 299 300
        },
        {
          title: '创建人员',
TZW's avatar
TZW committed
301 302 303 304 305 306 307 308 309
          dataIndex: 'createUserName',
          key: 'createUserId',
          valueType: 'select',
          fieldProps: {
            showSearch: true,
          },
          options: {
            path: '/auth/sysUser/selection',
          },
TZW's avatar
TZW committed
310 311 312 313
        },
        {
          title: '最新外协人员',
          dataIndex: 'newRepairUserName',
TZW's avatar
TZW committed
314
          key: 'newRepairUserId',
TZW's avatar
TZW committed
315 316 317 318 319 320 321
          valueType: 'select',
          fieldProps: {
            showSearch: true,
          },
          options: {
            path: '/auth/sysUser/selection',
          },
TZW's avatar
TZW committed
322 323 324
        },
        {
          title: '来源单号',
TZW's avatar
TZW committed
325 326
          dataIndex: 'dataSourcesNo',
          key: 'dataSourcesNo',
TZW's avatar
TZW committed
327 328 329 330 331
        },
        {
          title: '工单状态',
          dataIndex: 'statusName',
          key: 'status',
TZW's avatar
TZW committed
332
          options: listOptions,
TZW's avatar
TZW committed
333
          search: false,
TZW's avatar
TZW committed
334 335 336
          fieldProps: {
            dropdownMatchSelectWidth: 150,
          },
TZW's avatar
TZW committed
337 338 339 340 341 342 343 344 345
        },
      ],
      pathconfig: {
        enableadd: true,
        enableedit: false,
        enabledelete: true,
        enabledetail: false,
        add: '',
        edit: '',
TZW's avatar
TZW committed
346
        list: '/repair/umOtherUnitsOrderHis/queryList',
TZW's avatar
TZW committed
347
        delete: '/repair/umOtherUnitsOrder/deleteById',
TZW's avatar
TZW committed
348
        detail: '',
wuhao's avatar
wuhao committed
349 350 351 352 353
      },
    },
  ];
}
export default getcolumns;