Browse Source

合作意向查询列表,删除

master
ma 4 years ago
parent
commit
a46a6f042a
  1. 2
      src/components/Page/PageDate.vue
  2. 106
      src/components/SpinOff/SpinOffDate.vue
  3. 18
      src/components/SpinOff/SpinOffSearch.vue
  4. 7
      src/config/api.js
  5. 55
      src/views/CooperationIntention/CooperationIntention.vue

2
src/components/Page/PageDate.vue

@ -16,7 +16,7 @@
<span>{{ index + 1 }}</span> <span>{{ index + 1 }}</span>
</template> </template>
<template slot="content" slot-scope="text, record, index"> <template slot="content" slot-scope="text">
<span v-dompurify-html="text"></span> <span v-dompurify-html="text"></span>
</template> </template>

106
src/components/SpinOff/SpinOffDate.vue

@ -13,6 +13,25 @@
<span>{{ index + 1 }}</span> <span>{{ index + 1 }}</span>
</template> </template>
<template slot="position" slot-scope="text, record">
<span v-if=" record.position === 0">功能食品协同创新中心</span>
<span v-if=" record.position === 1">现代医药</span>
<span v-if=" record.position === 2">生物医学工程</span>
<span v-if=" record.position === 3">数字健康开发</span>
<span v-if=" record.position === 4">其他</span>
</template>
<template slot="dealStatus" slot-scope="text, record">
<!-- <a-tag
:color="record.dealStatus === 1 ? 'blue' : 'red'"
>{{ record.dealStatus === 0 ? '未审核' : '不通过' }}</a-tag> -->
<a-tag :color="record.dealStatus === 1 ? 'blue' : 'red'" v-if=" record.dealStatus === 0">未审核</a-tag>
<a-tag :color="record.dealStatus === 1 ? 'blue' : 'red'" v-if=" record.dealStatus === 1">通过</a-tag>
<a-tag :color="record.dealStatus === 1 ? 'blue' : 'red'" v-if=" record.dealStatus === 2">未通过</a-tag>
</template>
<!-- 说明图片 --> <!-- 说明图片 -->
<template slot="logo" slot-scope="text, record"> <template slot="logo" slot-scope="text, record">
<img :src="record.logo" class="img" /> <img :src="record.logo" class="img" />
@ -38,6 +57,7 @@
<script> <script>
import SpinOffEdit from "components/SpinOff/SpinOffEdit.vue"; import SpinOffEdit from "components/SpinOff/SpinOffEdit.vue";
import {getCreatingPlatformDelete} from "config/api"
const columns = [ const columns = [
{ {
@ -49,23 +69,60 @@ const columns = [
scopedSlots: { customRender: 'id' }, scopedSlots: { customRender: 'id' },
}, },
{ {
title: 'logo', title: '单位名称',
align: 'center', align: 'center',
dataIndex: 'logo', dataIndex: 'companyName',
key: 'logo', key: 'companyName',
scopedSlots: { customRender: 'logo' },
}, },
{ {
title: '企业名', title: '单位性质',
align: 'center', align: 'center',
dataIndex: 'companyName', dataIndex: 'companyType',
key: 'companyName', key: 'companyType',
},
{
title: '组织机构代码',
align: 'center',
dataIndex: 'code',
key: 'code',
},
{
title: '研究方向',
align: 'center',
dataIndex: 'position',
key: 'position',
scopedSlots: { customRender: 'position' },
},
{
title: '单位负责人',
align: 'center',
dataIndex: 'ower',
key: 'ower',
}, },
{ {
title: '英文名', title: '单位邮箱',
align: 'center', align: 'center',
dataIndex: 'englishName', dataIndex: 'email',
key: 'englishName', key: 'email',
},
{
title: '联系人',
align: 'center',
dataIndex: 'contact',
key: 'contact',
},
{
title: '联系电话',
align: 'center',
dataIndex: 'phone',
key: 'phone',
},
{
title: '处理状态',
align: 'center',
dataIndex: 'dealStatus',
key: 'dealStatus',
scopedSlots: { customRender: 'dealStatus' },
}, },
{ {
title: '编辑', title: '编辑',
@ -96,11 +153,13 @@ export default {
components: { components: {
SpinOffEdit, SpinOffEdit,
}, },
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } },
data() { data() {
this.cacheData = lists.map(item => ({ ...item })); this.cacheData = lists.map(item => ({ ...item }));
return { return {
columns, columns,
lists,
loading: false, loading: false,
height: '', height: '',
editVisible: false, editVisible: false,
@ -122,19 +181,20 @@ export default {
}, },
// //
async onDelete(teamId) { async onDelete(id) {
try { try {
const params = { param: { teamId } }; const params = { param: { id } };
// const res = await delTeam(params); const res = await getCreatingPlatformDelete(params);
// const { data, msg, code } = res.data; const { data, msg, code } = res.data;
// if (code === 200) { if (code === 200) {
// this.$message.success(''); this.$message.success('删除成功');
// const arr = [...this.lists]; this.$emit('getCreatingPlatformSearch');
// this.lists = arr.filter(item => item.id !== teamId); // const arr = [...this.lists];
// // TODO: // this.lists = arr.filter(item => item.id !== teamId);
// } else { // TODO:
// throw msg; } else {
// } throw msg;
}
} catch (error) { } catch (error) {
this.$message.error(error || '删除失败'); this.$message.error(error || '删除失败');
} }

18
src/components/SpinOff/SpinOffSearch.vue

@ -3,11 +3,15 @@
<!-- 企业名称 --> <!-- 企业名称 -->
<div> <div>
<a-input <a-input
@change="handleChangeName" placeholder="单位名称"
placeholder="企业名称"
style="width: 150px" style="width: 150px"
v-model="companyName" v-model="companyName"
/> />
<a-input
placeholder="单位性质"
style="width: 150px"
v-model="companyType"
/>
<a-button @click="handleTableChange" class="ml-3" type="primary">搜索</a-button> <a-button @click="handleTableChange" class="ml-3" type="primary">搜索</a-button>
</div> </div>
@ -32,6 +36,7 @@ export default {
return { return {
visible: false, visible: false,
companyName: '', companyName: '',
companyType: '',
} }
}, },
methods: { methods: {
@ -48,8 +53,15 @@ export default {
this.companyName = value; this.companyName = value;
}, },
handleTableChange() { async handleTableChange() {
console.log('搜索'); console.log('搜索');
const { companyName,companyType} = this;
//
const condition = {
companyName,companyType
}
await this.$emit('getSelectTeam',condition)
this.activityType = [];
}, },
}, },
}; };

7
src/config/api.js

@ -11,6 +11,7 @@ const researchTeam = `${greenvalley}/researchTeam`; // 创新平台相关操作
const page = `${greenvalley}/page`; // 页面管理相关操作 const page = `${greenvalley}/page`; // 页面管理相关操作
const industryInfo = `${greenvalley}/industryInfo`; // 行业资讯相关操作 const industryInfo = `${greenvalley}/industryInfo`; // 行业资讯相关操作
const activity = `${greenvalley}/activity`; // 活动公告相关操作 const activity = `${greenvalley}/activity`; // 活动公告相关操作
const creatingPlatform = `${greenvalley}/creatingPlatform`; // 合作意向相关操作
// websocket基础地址 // websocket基础地址
@ -40,6 +41,12 @@ export const getQueryBack = params => axios.post(`${activity}/query/back`, param
// // 活动公告列表删除 // // 活动公告列表删除
// export const deleteIndustryInfo = params => axios.post(`${activity}/delete`, params); // export const deleteIndustryInfo = params => axios.post(`${activity}/delete`, params);
// 合作意向列表查询
export const getCreatingPlatformSearch = params => axios.post(`${creatingPlatform}/search`, params);
// 合作意向删除
export const getCreatingPlatformDelete = params => axios.post(`${creatingPlatform}/delete`, params);
// 查询所有的研发团队相关信息 // 查询所有的研发团队相关信息
export const getAllTeam = () => axios.post(`${researchTeam}/selectAllTeam`); export const getAllTeam = () => axios.post(`${researchTeam}/selectAllTeam`);

55
src/views/CooperationIntention/CooperationIntention.vue

@ -1,19 +1,70 @@
<template> <template>
<div class="pa-3 white fill-height d-flex flex-column"> <div class="pa-3 white fill-height d-flex flex-column">
<spin-off-search /> <spin-off-search @getCreatingPlatformSearch="getCreatingPlatformSearch" />
<spin-off-date /> <spin-off-date :pagination="pagination" :lists="lists" @getCreatingPlatformSearch="getCreatingPlatformSearch"/>
</div> </div>
</template> </template>
<script> <script>
import SpinOffSearch from "components/SpinOff/SpinOffSearch.vue"; import SpinOffSearch from "components/SpinOff/SpinOffSearch.vue";
import SpinOffDate from "components/SpinOff/SpinOffDate.vue"; import SpinOffDate from "components/SpinOff/SpinOffDate.vue";
import { getCreatingPlatformSearch } from 'config/api';
export default { export default {
name: "DerivativeSpinOffs", name: "DerivativeSpinOffs",
components: { components: {
SpinOffSearch, SpinOffSearch,
SpinOffDate, SpinOffDate,
},
data() {
return {
lists: [],
pagination: { current: 1, pageSize: 10 },
};
},
created() {
this.getCreatingPlatformSearch()
},
methods: {
async getCreatingPlatformSearch(condition){
try {
const params = {
param: {
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
if(condition){
if(condition.companyName){
params.param.companyName = condition.companyName
}
if(condition.companyType){
params.param.companyType = condition.companyType
}
}
const res = await getCreatingPlatformSearch(params);
const { code, msg, data } = res.data;
if (code === 200) {
console.log(data)
this.lists = data.list;
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> </script>

Loading…
Cancel
Save