14 changed files with 1084 additions and 367 deletions
@ -0,0 +1,179 @@ |
|||
<template> |
|||
<div class="main flex-1"> |
|||
<div style="width:100%" v-if="lists && lists.length > 0"> |
|||
<a-table |
|||
:columns="columns" |
|||
:data-source="lists" |
|||
:loading="loading" |
|||
:pagination="pagination" |
|||
:row-key="record => record.id" |
|||
:scroll="{ y: height }" |
|||
@change="handleTableChange" |
|||
bordered |
|||
class="white" |
|||
> |
|||
<template slot="id" slot-scope="text, record, index"> |
|||
<span>{{ index + 1 }}</span> |
|||
</template> |
|||
|
|||
<template slot="time" slot-scope="text, record"> |
|||
<span v-if="record.releaseTime">{{ record.releaseTime}}</span> |
|||
<span v-if="record.closeTime">-{{record.closeTime}}</span> |
|||
</template> |
|||
|
|||
<template slot="platforms" slot-scope="text, record"> |
|||
<a-tag |
|||
:color="record.platforms === 0 ? 'green' : 'blue'" |
|||
>{{ record.platforms === 0 ? '绿谷' : '创时代' }}</a-tag> |
|||
</template> |
|||
|
|||
<template slot="auditStatus" slot-scope="text, record"> |
|||
<a-tag |
|||
:color="record.auditStatus === 2 ? 'green' : record.auditStatus === 1 ? 'red' : 'blue'" |
|||
>{{ record.auditStatus === 2 ? '已通过' : record.auditStatus === 1 ? '未通过' : '审核中' }}</a-tag> |
|||
</template> |
|||
|
|||
<template slot="examine" slot-scope="text, record"> |
|||
<div class="d-flex flex-column align-center"> |
|||
<a-button |
|||
@click="handleApply(record, 2)" |
|||
size="small" |
|||
type="primary" |
|||
v-if="record.auditStatus !== 2" |
|||
>通过</a-button> |
|||
<a-button @click="handleApply(record, 1)" size="small" type="danger" v-else>不通过</a-button> |
|||
<a-textarea class="fill-width mt-3" placeholder="备注" v-model="record.applyRemark" /> |
|||
</div> |
|||
</template> |
|||
</a-table> |
|||
</div> |
|||
<a-empty v-else /> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { getAuditApply } from 'config/api'; |
|||
const columns = [ |
|||
{ |
|||
title: '序号', |
|||
align: 'center', |
|||
dataIndex: 'id', |
|||
key: 'id', |
|||
width: 80, |
|||
scopedSlots: { customRender: 'id' }, |
|||
}, |
|||
{ |
|||
title: '企业名', |
|||
align: 'center', |
|||
dataIndex: 'companyName', |
|||
key: 'companyName', |
|||
}, |
|||
{ |
|||
title: '申请人姓名', |
|||
align: 'center', |
|||
dataIndex: 'contactName', |
|||
key: 'contactName', |
|||
}, |
|||
{ |
|||
title: '联系方式', |
|||
align: 'center', |
|||
dataIndex: 'contactPhone', |
|||
key: 'contactPhone', |
|||
}, |
|||
{ |
|||
title: '申请时间', |
|||
align: 'center', |
|||
dataIndex: 'time', |
|||
key: 'time', |
|||
}, |
|||
{ |
|||
title: '申请平台', |
|||
align: 'center', |
|||
dataIndex: 'platforms', |
|||
key: 'platforms', |
|||
scopedSlots: { customRender: 'platforms' }, |
|||
}, |
|||
{ |
|||
title: '审核状态', |
|||
align: 'center', |
|||
dataIndex: 'auditStatus', |
|||
key: 'auditStatus', |
|||
scopedSlots: { customRender: 'auditStatus' }, |
|||
}, |
|||
{ |
|||
title: '备注', |
|||
align: 'center', |
|||
dataIndex: 'remark', |
|||
key: 'remark', |
|||
scopedSlots: { customRender: 'remark' }, |
|||
}, |
|||
{ |
|||
title: '审核', |
|||
align: 'center', |
|||
dataIndex: 'examine', |
|||
key: 'examine', |
|||
scopedSlots: { customRender: 'examine' }, |
|||
}, |
|||
]; |
|||
|
|||
export default { |
|||
name: 'ActivityDate', |
|||
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } }, |
|||
|
|||
data() { |
|||
return { |
|||
columns, |
|||
loading: false, |
|||
height: '', |
|||
editVisible: false, |
|||
editItem: null, // 修改的那条 |
|||
spinning: false, |
|||
}; |
|||
}, |
|||
|
|||
mounted() { |
|||
let th = 250; |
|||
let wh = window.innerHeight; |
|||
this.height = wh - th; |
|||
window.onresize = () => { |
|||
return (() => { |
|||
wh = window.innerHeight; |
|||
this.height = wh - th; |
|||
})(); |
|||
}; |
|||
}, |
|||
|
|||
methods: { |
|||
async closeModal() { |
|||
this.editVisible = false; |
|||
await this.$emit('getSelectTeam'); |
|||
}, |
|||
|
|||
// 换页 |
|||
handleTableChange(pagination) { |
|||
const { current, pageSize } = pagination; |
|||
const condition = { current, pageSize }; |
|||
this.$emit('getSelectTeam', condition); |
|||
}, |
|||
|
|||
// 审核 |
|||
async handleApply(record, auditStatus) { |
|||
try { |
|||
const params = { param: { applyId: record.applyActivityId, auditStatus, remark: record.applyRemark } }; |
|||
const res = await getAuditApply(params); |
|||
const { data, msg, code } = res.data; |
|||
if (code === 200) { |
|||
this.$message.success('审核成功'); |
|||
this.$emit('getSelectTeam'); |
|||
} else { |
|||
throw msg; |
|||
} |
|||
} catch (error) { |
|||
this.$message.error(error || '审核失败'); |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style scoped lang="stylus"></style> |
@ -0,0 +1,163 @@ |
|||
<template> |
|||
<div class="d-flex flex-wrap pb-3 align-center"> |
|||
<!-- 审核状态 --> |
|||
<div class="ml-3 mb-3"> |
|||
<a-select @change="getAuditStatus" placeholder="审核状态" style="width: 150px"> |
|||
<a-select-option |
|||
:key="index" |
|||
:value="state.id" |
|||
v-for="(state, index) in status" |
|||
>{{ state.value }}</a-select-option> |
|||
</a-select> |
|||
</div> |
|||
<!-- 发布平台 --> |
|||
<div class="ml-3 mb-3"> |
|||
<a-select @change="getPlatform" placeholder="发布平台" style="width: 150px"> |
|||
<a-select-option |
|||
:key="platform.id" |
|||
:value="platform.id" |
|||
v-for="platform in platforms" |
|||
>{{ platform.value }}</a-select-option> |
|||
</a-select> |
|||
</div> |
|||
<!-- 单位名称 --> |
|||
<a-input class="ml-3 mb-3" placeholder="单位名称" style="width: 150px" v-model="companyName" /> |
|||
<!-- 申请人姓名 --> |
|||
<a-input class="ml-3 mb-3" placeholder="申请人姓名" style="width: 150px" v-model="contactName" /> |
|||
<!-- 联系方式 --> |
|||
<a-input class="ml-3 mb-3" placeholder="联系方式" style="width: 150px" v-model="contactPhone" /> |
|||
|
|||
<a-button @click="handleTableChange" class="ml-3 mb-3" type="primary">搜索</a-button> |
|||
|
|||
<div class="flex-1"></div> |
|||
<!-- 导出 --> |
|||
<a-popover placement="bottom" trigger="click"> |
|||
<template slot="content"> |
|||
<div class="d-flex flex-column"> |
|||
<a-select |
|||
@change="exportAuditStatus" |
|||
class="mb-3" |
|||
placeholder="审核状态" |
|||
style="width: 150px" |
|||
> |
|||
<a-select-option value>全部</a-select-option> |
|||
<a-select-option |
|||
:key="index" |
|||
:value="state.id" |
|||
v-for="(state, index) in status" |
|||
>{{ state.value }}</a-select-option> |
|||
</a-select> |
|||
<a-select @change="exportPlatform" class="mb-3" placeholder="发布平台" style="width: 150px"> |
|||
<a-select-option value>全部</a-select-option> |
|||
<a-select-option |
|||
:key="platform.id" |
|||
:value="platform.id" |
|||
v-for="platform in platforms" |
|||
>{{ platform.value }}</a-select-option> |
|||
</a-select> |
|||
<a-button @click="handleExport" type="primary">导出</a-button> |
|||
</div> |
|||
</template> |
|||
<a-button type="primary">导出</a-button> |
|||
</a-popover> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { getExport } from 'config/api'; |
|||
|
|||
export default { |
|||
name: 'ActivitySearch', |
|||
data() { |
|||
return { |
|||
status: [ |
|||
{ |
|||
id: 0, |
|||
value: '待审核', |
|||
}, |
|||
{ |
|||
id: 1, |
|||
value: '未通过', |
|||
}, |
|||
{ |
|||
id: 2, |
|||
value: '已通过', |
|||
}, |
|||
], |
|||
auditStatus: '', // 审核状态 |
|||
exportStatus: '', // 导出审核状态 |
|||
platforms: [ |
|||
{ |
|||
id: 0, |
|||
value: '绿谷', |
|||
}, |
|||
{ |
|||
id: 1, |
|||
value: '创时代', |
|||
}, |
|||
], |
|||
publishPlatform: '', // 发布平台 |
|||
exportPublishPlatform: '', // 导出发布平台 |
|||
companyName: '', // 单位名称 |
|||
contactName: '', // 申请人姓名 |
|||
contactPhone: '', // 联系方式 |
|||
}; |
|||
}, |
|||
|
|||
methods: { |
|||
// 审核状态 |
|||
getAuditStatus(value) { |
|||
this.auditStatus = value; |
|||
}, |
|||
|
|||
// 导出的审核状态 |
|||
exportAuditStatus(value) { |
|||
this.exportStatus = value; |
|||
}, |
|||
|
|||
// 发布平台 |
|||
getPlatform(value) { |
|||
this.publishPlatform = value; |
|||
}, |
|||
|
|||
// 导出的发布平台 |
|||
exportPlatform(value) { |
|||
this.exportPublishPlatform = value; |
|||
}, |
|||
|
|||
// 查询 |
|||
async handleTableChange() { |
|||
const { auditStatus, publishPlatform, companyName, contactName, contactPhone } = this; |
|||
// 传参 |
|||
const condition = { |
|||
auditStatus, |
|||
publishPlatform, |
|||
companyName, |
|||
contactName, |
|||
contactPhone, |
|||
}; |
|||
await this.$emit('getSelectTeam', condition); |
|||
}, |
|||
|
|||
// 导出 |
|||
async handleExport() { |
|||
try { |
|||
const { query } = this.$route; |
|||
const params = { param: { activityId: query.activityId, auditStatus: this.exportStatus, platforms: this.exportPublishPlatform } }; |
|||
const res = await getExport(params); |
|||
const { data, msg, code } = res.data; |
|||
if (code === 200) { |
|||
this.$message.success('导出成功'); |
|||
window.location.href = data; |
|||
} else { |
|||
throw msg; |
|||
} |
|||
} catch (error) { |
|||
this.$message.error(error || '导出失败'); |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style scoped lang="stylus"></style> |
@ -0,0 +1,85 @@ |
|||
<template> |
|||
<div class="pa-3 white fill-height d-flex flex-column"> |
|||
<enroll-search @getSelectTeam="getSelectTeam" /> |
|||
<enroll-date :lists="lists" :pagination="pagination" @getSelectTeam="getSelectTeam" /> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import EnrollSearch from 'components/Enroll/EnrollSearch.vue'; |
|||
import EnrollDate from 'components/Enroll/EnrollDate.vue'; |
|||
import { getQueryApply } from 'config/api'; |
|||
|
|||
export default { |
|||
name: 'InnovationPolicy', |
|||
components: { |
|||
EnrollSearch, |
|||
EnrollDate, |
|||
}, |
|||
|
|||
data() { |
|||
return { |
|||
lists: [], |
|||
pagination: { current: 1, pageSize: 10 }, |
|||
}; |
|||
}, |
|||
|
|||
created() { |
|||
this.getSelectTeam(); |
|||
}, |
|||
|
|||
methods: { |
|||
/** |
|||
* 后台查看活动下所有申请的人员列表 |
|||
* @param { String } activityId 活动id |
|||
*/ |
|||
async getSelectTeam(condition) { |
|||
try { |
|||
const { query } = this.$route; |
|||
const params = { |
|||
param: { |
|||
activityId: query.activityId, |
|||
pageNum: (condition && condition.current) || 1, |
|||
pageSize: (condition && condition.pageSize) || 10, |
|||
}, |
|||
}; |
|||
if (condition) { |
|||
if (condition.auditStatus) { |
|||
params.param.auditStatus = condition.auditStatus; |
|||
} |
|||
if (condition.publishPlatform) { |
|||
params.param.publishPlatform = condition.publishPlatform; |
|||
} |
|||
if (condition.companyName) { |
|||
params.param.companyName = condition.companyName; |
|||
} |
|||
if (condition.contactName) { |
|||
params.param.contactName = condition.contactName; |
|||
} |
|||
if (condition.contactPhone) { |
|||
params.param.contactPhone = condition.contactPhone; |
|||
} |
|||
} |
|||
const res = await getQueryApply(params); |
|||
const { code, msg, data } = res.data; |
|||
if (code === 200) { |
|||
let arr = data.list; |
|||
arr.forEach(item => { |
|||
item.applyRemark = ''; |
|||
}); |
|||
this.lists = [...arr]; |
|||
const paper = { ...this.pagination }; |
|||
paper.current = data.pageNum; |
|||
paper.total = +data.total; |
|||
paper.pageSize = data.pageSize; |
|||
this.pagination = paper; |
|||
} else { |
|||
throw msg || '获取失败'; |
|||
} |
|||
} catch (error) { |
|||
this.$message.error(error); |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
Loading…
Reference in new issue