| | |
| | | import { createHashHistory } from 'history'; |
| | | import fetch from '../../../../api/request'; |
| | | import './index.scss'; |
| | | import moment from 'moment'; |
| | | |
| | | const history = createHashHistory(); |
| | | |
| | |
| | | __key: Date.now(), |
| | | page: 1, |
| | | size: 10, |
| | | keyWord: '' |
| | | countMonth: moment().month(moment().month() - 1).format('YYYY-MM') |
| | | }, |
| | | queryTerms: null |
| | | }; |
| | | } |
| | | |
| | | componentDidMount() { |
| | | this.loadqueryTerms() |
| | | } |
| | | |
| | | |
| | | loadqueryTerms = () => { |
| | | fetch({ |
| | | url: `api/merits/assess/queryTerms`, |
| | | }).then(res => { |
| | | if (res) { |
| | | console.log('res', res); |
| | | this.setState({ queryTerms: res }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | setFormData = data => { |
| | |
| | | |
| | | linkDetail = (item) => { |
| | | let { userId, countMonth } = item; |
| | | history.push(`/merits/meritsOverview/meritsDetail/${userId}/${countMonth}`) |
| | | history.push(`/merits/meritsOverview/meritsDetail/${userId}/true/${countMonth}`) |
| | | } |
| | | |
| | | renderColumns = () => { |
| | |
| | | { title: '部门', dataIndex: 'userDeptName' }, |
| | | { title: '岗位', dataIndex: 'meritsPostName' }, |
| | | { title: '考评月份', dataIndex: 'countMonth' }, |
| | | { title: '总任务数', dataIndex: 'taskNumber' }, |
| | | { title: '总缺陷数', dataIndex: 'defectNumber' }, |
| | | // { title: '总任务数', dataIndex: 'taskNumber' }, |
| | | // { title: '总缺陷数', dataIndex: 'defectNumber' }, |
| | | { title: '考评得分(分)', dataIndex: 'meritsGrade' }, |
| | | { |
| | | title: '操作', dataIndex: 'operation', render: (cur, item) => { |
| | |
| | | |
| | | |
| | | render() { |
| | | const { formData } = this.state; |
| | | const { formData, queryTerms } = this.state; |
| | | |
| | | let tableParams = { |
| | | url: `api/merits/assess/queryMerits`, |
| | |
| | | extraFromData: {}, |
| | | setFormData: this.setFormData |
| | | } |
| | | |
| | | function disabledDate(current) { |
| | | return current && current >= moment().endOf('day'); |
| | | } |
| | | |
| | | return ( |
| | | <div className="merits-overview-main"> |
| | | <SearchFormView |
| | | formData={formData} |
| | | setFormData={this.setFormData} |
| | | data={[ |
| | | { type: 'select', name: '部门', label: '部门', key: 'bumen', list: [{ name: '1', value: '部门1' }, { name: '2', value: '部门2' }], }, |
| | | { type: 'select', name: '岗位', label: '岗位', key: 'gangwei', list: [{ name: '1', value: '岗位1' }, { name: '2', value: '岗位2' }], }, |
| | | { type: 'input', name: '姓名', label: '姓名', key: 'name' }, |
| | | { |
| | | type: 'monthPicker', |
| | | label: '考评月份', |
| | | name: '考评月份', |
| | | key: 'kpyf', |
| | | }, |
| | | ]} /> |
| | | { |
| | | queryTerms && |
| | | <SearchFormView |
| | | formData={formData} |
| | | setFormData={this.setFormData} |
| | | data={[ |
| | | { type: 'select', name: '部门', label: '部门', key: 'userDeptId', list: queryTerms.dept ? queryTerms.dept.map(({ name, id }) => ({ name, value: id })) : [], }, |
| | | { type: 'select', name: '岗位', label: '岗位', key: 'meritsPostId', list: queryTerms.post ? queryTerms.post.map(({ name, id }) => ({ name, value: id })) : [], }, |
| | | { type: 'input', name: '姓名', label: '姓名', key: 'userName' }, |
| | | { |
| | | type: 'monthPicker', |
| | | label: '考评月份', |
| | | name: '考评月份', |
| | | key: 'countMonth', |
| | | disabledDate |
| | | }, |
| | | ]} /> |
| | | } |
| | | <TableView {...tableParams} /> |
| | | </div> |
| | | ) |