From bd09ddbe5eae5e780393d37b72b4da6d4e92fdb8 Mon Sep 17 00:00:00 2001 From: LiuWenHaoU <964324856@qq.com> Date: Mon, 18 May 2020 00:15:17 +0800 Subject: [PATCH] 部分修改及新增功能 --- SunshineIns/src/page/CareList.jsx | 36 ++++++++++++++++++++++++++++++++---- 1 files changed, 32 insertions(+), 4 deletions(-) diff --git a/SunshineIns/src/page/CareList.jsx b/SunshineIns/src/page/CareList.jsx index 5432a72..4cb2b8d 100644 --- a/SunshineIns/src/page/CareList.jsx +++ b/SunshineIns/src/page/CareList.jsx @@ -18,6 +18,8 @@ return "社会调查"; case 4: return "心理疏导"; + case 5: + return "法律援助"; } } @@ -26,19 +28,21 @@ 2: '合适成年人', 3: '社会调查', 4: '心理疏导', + 5: '法律援助', } const activityTypeList = [ 1, 2, 3, - 4 + 4, + 5 ] const activityStatusIds = { 0: '未开始', 1: '进行中', 2: '已结束', - 99: '结束', + 99: '暂停', } const activityStatusList = [ @@ -138,6 +142,22 @@ }, this.getData); } + reboot = (e,status) => { + this.setState({ loading: true }) + Fetch.socialUpdate(e, status).then(res => { + if (res.code == 0) { + console.log(res) + this.setState({ loading: false }) + message.success(status==0?'重启任务成功':'暂停任务成功'); + this.getData(); + } else { + this.setState({ loading: false }) + message.error('删除失败,请联系管理员', 2) + } + } + ) + } + confirm = (e) => { console.log(e); this.setState({ loading: true }) @@ -170,7 +190,7 @@ key: 'status', render: text => ( text == 0 ? - <Badge style={{ backgroundColor: '#6C757C' }} count={'未开始'} /> : text == 1 ? <Badge count={'进行中'} style={{ backgroundColor: '#F1C40F' }} /> : text == 2 ? <Badge count={'已结束'} style={{ backgroundColor: '#2ECC71' }} /> : <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: '创建时间', @@ -205,15 +225,23 @@ cancelText="取消" > <a href="#">删除</a> + <Divider type="vertical" /> </Popconfirm> + <a onClick={() => this.reboot(record.id, 99)}>暂停</a> </React.Fragment> : record.status == 1 ? <React.Fragment> <a onClick={() => this.showModal(record.id)}>查看</a> <Divider type="vertical" /> <a onClick={() => this.showModal(record.id)}>结束任务</a> + <Divider type="vertical" /> + <a onClick={() => this.reboot(record.id, 99)}>暂停</a> </React.Fragment> : - <a onClick={() => this.showModal(record.id)}>查看</a> + <React.Fragment> + <a onClick={() => this.showModal(record.id)}>查看</a> + <Divider type="vertical" /> + <a onClick={() => this.reboot(record.id, 0)}>重启</a> + </React.Fragment> } </span> ), -- Gitblit v1.8.0