<commit_before>// 客户管理 - 客户报修
import React, {Component} from 'react'
import {Table, Button, Spin, Popconfirm, Input, DatePicker } from 'antd'
import { apiPost } from '../../../api'
// 引入组件
import CancelRepairComponent from './common/CancelRepair'
import DistributeLeafletsComponent from './common/DistributeLeaflets'
import TableAddUpComponent from './common/TableAddUp'
import App from './Details/MaintenanceProject'
const { RangePicker } = DatePicker
// React component
class RepairList extends Component {
    constructor (props) {
        super(props)
        this.state = {
            loading: false,
            openinvalid: false,
            opendispatch: false,
            openTableAddUp: false,
            openUpdate: false,
            openMaintenanceProject: false,
            columns: [],
            dataSource: [],
            id: 0
        }
    }
    distributeLeaflets = (id) => {
        this.setState({
            opendispatch: true,
            openinvalid: false,
            openTableAddUp: false,
            openMaintenanceProject: false,
            openUpdate: false,
            id: id
        })
    }
    handleUpdate = (id) => {
        this.setState({
            openinvalid: true,
            opendispatch: false,
            openMaintenanceProject: false,
            openTableAddUp: false,
            openUpdate: false,
            id: id
        })
    }
    handleUpdateRepair = (id) => {
        this.setState({
            openinvalid: false,
            opendispatch: false,
            openTableAddUp: false,
            openMaintenanceProject: false,
            openUpdate: true,
            id: id
        })
    }
    maintenanceProject = (id) => {
        this.setState({
            openinvalid: false,
            opendispatch: false,
            openTableAddUp: false,
            openUpdate: false,
            openMaintenanceProject: true,
            id: id
        })
    }
    async initialRemarks () {
        this.setState({loading: true})
        let result = await apiPost(
            'upkeep/repairList',
            {repairStatus: 0}
        )
        let repairList = result.data
        const distributeLeaflets = this.distributeLeaflets
        const handleUpdate = this.handleUpdate
        const handleUpdateRepair = this.handleUpdateRepair
        const maintenanceProject = this.maintenanceProject
        this.setState({loading: false,
            columns: [{
                title: '序号',
                width: 100,
                dataIndex: 'id',
                key: 'id',
                render: function (text, record, index) {
                    index++
                    return (
                        <span>{index}</span>
                    )
                }
            }, {
                title: '报修日期',
                width: 200,
                dataIndex: 'repairDate',
                key: 'repairDate',
                sorter: true
            }, {
                title: '公司名称',
                width: 200,
                dataIndex: 'clientName',
                key: 'clientName'
            }, {
                title: '报修内容',
                width: 200,
                dataIndex: 'repairContent',
                key: 'repairContent',
                render: function (text, record, index) {
                    text = text.substring(0, 30)
                    let url = '/upkeep/repai/' + record.id
                    return (
                        <a href={url}>{text}</a>
                    )
                }
            }, {
                title: '派工状态',
                width: 200,
                dataIndex: 'pieStatus',
                key: 'pieStatus',
                render: function (text, record, index) {
                    let pieStatus = '未派单'
                    if (record.pieStatus === 1) {
                        pieStatus = '已派单'
                    }
                    return (
                        <span>{pieStatus}</span>
                    )
                }
            }, {
                title: '维修人',
                width: 200,
                dataIndex: 'repairedMan',
                key: 'repairedMan'
            }, {
                title: '维修状态',
                width: 200,
                dataIndex: 'repairStatus',
                key: 'repairStatus',
                render: function (text, record, index) {
                    let repairStatus = '未完成'
                    if (record.isCancel === 1) {
                        repairStatus = '已取消'
                    } else if (record.repairStatus === 1) {
                        repairStatus = '已完成'
                    }
                    return (
                        <span>{repairStatus}</span>
                    )
                }
            }, {
                title: '维修项目',
                width: 200,
                dataIndex: 'maintenanceProject',
                key: 'maintenanceProject',
                render: function (text, record, index) {
                    if (record.startDate !== null) {
                        return (<a onClick={() => maintenanceProject(record.id)}>查看明细</a>)
                    }
                }
            }, {
                title: '维修明细',
                dataIndex: 'MaintenanceDetails',
                key: 'MaintenanceDetails',
                render: function (text, record, index) {<commit_msg>合同 转租 终止<commit_after>// 客户管理 - 客户报修
import React, {Component} from 'react'
import {Table, Button, Spin, Popconfirm, Input, DatePicker } from 'antd'
import { apiPost } from '../../../api'
// 引入组件
import CancelRepairComponent from './common/CancelRepair'
import DistributeLeafletsComponent from './common/DistributeLeaflets'
import TableAddUpComponent from './common/TableAddUp'
import App from './Details/MaintenanceProject'
const { RangePicker } = DatePicker
// React component
class RepairList extends Component {
    constructor (props) {
        super(props)
        this.state = {
            loading: false,
            openinvalid: false,
            opendispatch: false,
            openTableAddUp: false,
            openUpdate: false,
            openMaintenanceProject: false,
            columns: [],
            dataSource: [],
            id: 0
        }
    }
    distributeLeaflets = (id) => {
        this.setState({
            opendispatch: true,
            openinvalid: false,
            openTableAddUp: false,
            openMaintenanceProject: false,
            openUpdate: false,
            id: id
        })
    }
    handleUpdate = (id) => {
        this.setState({
            openinvalid: true,
            opendispatch: false,
            openMaintenanceProject: false,
            openTableAddUp: false,
            openUpdate: false,
            id: id
        })
    }
    handleUpdateRepair = (id) => {
        this.setState({
            openinvalid: false,
            opendispatch: false,
            openTableAddUp: false,
            openMaintenanceProject: false,
            openUpdate: true,
            id: id
        })
    }
    maintenanceProject = (id) => {
        this.setState({
            openinvalid: false,
            opendispatch: false,
            openTableAddUp: false,
            openUpdate: false,
            openMaintenanceProject: true,
            id: id
        })
    }
    async initialRemarks () {
        this.setState({loading: true})
        let result = await apiPost(
            'upkeep/repairList',
            {repairStatus: 0}
        )
        let repairList = result.data
        const distributeLeaflets = this.distributeLeaflets
        const handleUpdate = this.handleUpdate
        const handleUpdateRepair = this.handleUpdateRepair
        const maintenanceProject = this.maintenanceProject
        this.setState({loading: false,
            columns: [{
                title: '序号',
                width: 100,
                dataIndex: 'id',
                key: 'id',
                render: function (text, record, index) {
                    index++
                    return (
                        <span>{index}</span>
                    )
                }
            }, {
                title: '报修日期',
                width: 200,
                dataIndex: 'repairDate',
                key: 'repairDate',
                sorter: true
            }, {
                title: '公司名称',
                width: 200,
                dataIndex: 'clientName',
                key: 'clientName'
            }, {
                title: '报修内容',
                width: 200,
                dataIndex: 'repairContent',
                key: 'repairContent',
                render: function (text, record, index) {
                    text = text.substring(0, 30)
                    let url = '/upkeep/repai/' + record.id
                    return (
                        <a href={url}>{text}</a>
                    )
                }
            }, {
                title: '派工状态',
                width: 200,
                dataIndex: 'pieStatus',
                key: 'pieStatus',
                render: function (text, record, index) {
                    let pieStatus = '未派单'
                    if (record.pieStatus === 1) {
                        pieStatus = '已派单'
                    }
                    return (
                        <span>{pieStatus}</span>
                    )
                }
            }, {
                title: '维修人',
                width: 200,
                dataIndex: 'repairedMan',
                key: 'repairedMan'
            }, {
                title: '维修状态',
                width: 200,
                dataIndex: 'repairStatus',
                key: 'repairStatus',
                render: function (text, record, index) {
                    let repairStatus = '未完成'
                    if (record.isCancel === 1) {
                        repairStatus = '已取消'
                    } else if (record.repairStatus === 1) {
                        repairStatus = '已完成'
                    }
                    return (
                        <span>{repairStatus}</span>
                    )
                }
            }, {
                title: '维修项目',
                width: 200,
                dataIndex: 'maintenanceProject',
                key: 'maintenanceProject',
                render: function (text, record, index) {
                    if (record.startDate !== null) {
                        return (<a onClick={() => maintenanceProject(record.id)}>查看明细</a>)
                    }
                }
            }, {
                title: '维修明细',
                width: 200,
                dataIndex: 'MaintenanceDetails',
                key: 'MaintenanceDetails',
                render: function (text, record, index) {
{'fraction_non_alphanumeric': 0.09802283486494012, 'fraction_numerical': 0.006219251833286921, 'mean_word_length': 1.1137924269177948, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7542222', 'n_tokens_mistral': 2850, 'n_tokens_neox': 2709, 'n_words': 612}