From d3429f26d341cd8047e79ada5f2f5468efe2947f Mon Sep 17 00:00:00 2001 From: liuwh <liuwh@hugeinfo.com.cn> Date: Thu, 05 Mar 2020 18:54:42 +0800 Subject: [PATCH] 1 --- SunshineIns/src/page/CareList.jsx | 17 ++++++++++------- SunshineIns/src/page/CareListEdit.jsx | 39 +++++++++++++++++++++++++++++++++++---- 2 files changed, 45 insertions(+), 11 deletions(-) diff --git a/SunshineIns/src/page/CareList.jsx b/SunshineIns/src/page/CareList.jsx index 2b2fa4e..96aa49c 100644 --- a/SunshineIns/src/page/CareList.jsx +++ b/SunshineIns/src/page/CareList.jsx @@ -169,7 +169,7 @@ key: 'status', render: text => ( text == 0 ? - <Badge style={{ backgroundColor: '#6C757C' }} count={'未开始'} /> : text == 1 ? <Badge count={'进行中'} style={{ backgroundColor: '#6C757C' }} /> : text == 2 ? <Badge count={'已结束'} style={{ backgroundColor: '#6C757C' }} /> : <Badge count={'结束'} style={{ backgroundColor: '#2ECC71' }} /> + <Badge style={{ backgroundColor: '#6C757C' }} count={'未开始'} /> : text == 1 ? <Badge count={'进行中'} style={{ backgroundColor: '#F1C40F' }} /> : text == 2 ? <Badge count={'已结束'} style={{ backgroundColor: '#2ECC71' }} /> : <Badge count={'结束'} style={{ backgroundColor: '#2ECC71' }} /> ) }, { title: '创建时间', @@ -192,11 +192,7 @@ render: (text, record) => ( <span> { - record.status == 1 ? - <React.Fragment> - <Divider type="vertical" /> - <a onClick={() => this.showModal(record.id)}>结束任务</a> - </React.Fragment> : + record.status == 0 ? <React.Fragment> <a onClick={() => this.showModal(record.id)}>编辑</a> <Divider type="vertical" /> @@ -209,7 +205,14 @@ > <a href="#">删除</a> </Popconfirm> - </React.Fragment> + </React.Fragment> : + record.status == 1 ? + <React.Fragment> + <a onClick={() => this.showModal(record.id)}>查看</a> + <Divider type="vertical" /> + <a onClick={() => this.showModal(record.id)}>结束任务</a> + </React.Fragment> : + <a onClick={() => this.showModal(record.id)}>查看</a> } </span> ), diff --git a/SunshineIns/src/page/CareListEdit.jsx b/SunshineIns/src/page/CareListEdit.jsx index 25c60e4..0be5abe 100644 --- a/SunshineIns/src/page/CareListEdit.jsx +++ b/SunshineIns/src/page/CareListEdit.jsx @@ -82,8 +82,9 @@ }, taskType: res.taskType || 1, // status: res.activityStatus || '', - socialTaskObject: res.socialTaskObject?{id:res.socialTaskObject.objectId,objectName:res.socialTaskObject.objectName}:{}, + socialTaskObject: res.socialTaskObject ? { id: res.socialTaskObject.objectId, objectName: res.socialTaskObject.objectName, taskReport:res.socialTaskObject.taskReport } : {}, disabled: res.status ? true : false, + fileList: res.attachments || [], loading: false, }); }) @@ -180,9 +181,9 @@ handleOk = e => { const { savedate } = this.state; console.log(savedate); - + this.setState({ - visible: false, + visible: false, }); Fetch.socialUpdate(savedate.id) .then(res => { @@ -193,7 +194,7 @@ message.error('保存失败,请联系管理员', 2) } }); - }; + }; getNum = (e) => { console.log(e.target.value) @@ -431,6 +432,36 @@ <Col span={12} pull={0}></Col> </Row> </div> + + { + savedate.status !== 0 ? + <div style={divStyle}> + <Row type="flex" align='middle' justify="space-around"> + <Col span={6} pull={0} style={{ textAlign: 'center' }}><span>任务汇报</span></Col> + <Col span={6} push={0} > + <TextArea disabled={disabled} rows={4} style={{ width: '92%' }} value={socialTaskObject.taskReport || ""} onChange={this.saveInputChange} name='taskReport' /> + </Col> + <Col span={12} pull={0}></Col> + </Row> + </div> : '' + } + + { + savedate.status !== 0 ? + <div style={divStyle}> + <div style={divStyle}> + <Row type="flex" align='top' justify="space-around"> + <Col span={6} pull={0} style={{ textAlign: 'center' }}><span>汇报附件</span></Col> + <Col span={18} push={0} > + <Upload disabled={disabled} listType="picture-card" onPreview={this.handlePreview} {...props}> + + </Upload> + </Col> + </Row> + </div> + </div> :'' + } + { savedate.status == 2 || savedate.status == 99 ? -- Gitblit v1.8.0