columns.js 7.68 KB
Newer Older
TZW's avatar
TZW committed
1 2
function getcolumns(setdrawer, bus) {
  let listOptions = [];
TZW's avatar
TZW committed
3 4
  let listOptions_zzgd = [];

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