Browse Source

服务相关

master
aBin 4 years ago
parent
commit
c2d3ee929d
  1. 31
      src/components/Banner/BannerDate.vue
  2. 37
      src/components/Banner/BannerEdit.vue
  3. 155
      src/components/RD/RDAdd.vue
  4. 168
      src/components/RD/RDDate.vue
  5. 163
      src/components/RD/RDEdit.vue
  6. 60
      src/components/RD/RDSearch.vue
  7. 182
      src/components/SpinOff/SpinOffAdd.vue
  8. 125
      src/components/SpinOff/SpinOffDate.vue
  9. 182
      src/components/SpinOff/SpinOffEdit.vue
  10. 17
      src/components/SpinOff/SpinOffSearch.vue
  11. 226
      src/components/innovativeService/innovativeServiceAdd.vue
  12. 112
      src/components/innovativeService/innovativeServiceDate.vue
  13. 62
      src/components/innovativeService/innovativeServiceSearch.vue
  14. 20
      src/config/api.js
  15. 2
      src/plugins/ant-design-vue.js
  16. 57
      src/views/CooperationIntention/CooperationIntention.vue
  17. 32
      src/views/DemandFilling/DemandFilling.vue
  18. 38
      src/views/InnovativeService/InnovativeService.vue

31
src/components/Banner/BannerDate.vue

@ -44,7 +44,7 @@
<script>
import BannerEdit from 'components/Banner/BannerEdit.vue';
// import { delTeam } from 'config/api';
import { deleteCarousel } from 'config/api';
const columns = [
{
@ -144,6 +144,7 @@ export default {
methods: {
showEditModal(record) {
console.log('record: ', record);
this.editItem = record;
this.editVisible = true;
},
@ -157,29 +158,21 @@ export default {
this.$emit('getListData', condition);
},
//
async onDelete(teamId) {
async onDelete(id) {
try {
// const params = { param: { teamId } };
// const res = await delTeam(params);
// const { data, msg, code } = res.data;
// if (code === 200) {
// this.$message.success('');
// const arr = [...this.lists];
// this.lists = arr.filter(item => item.id !== teamId);
// // TODO:
// } else {
// throw msg;
// }
const params = { param: { id } };
const res = await deleteCarousel(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('删除成功');
this.$emit('getListData');
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '删除失败');
}
},
//
openSignUp() {
const { query } = this.$route;
this.$router.push({ path: '/sign-up', query });
},
},
};
</script>

37
src/components/Banner/BannerEdit.vue

@ -21,7 +21,7 @@
</a-form-item> -->
<!-- 跳转类型 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="跳转类型">
<a-select @change="getUse($event, 'jumpType')" class="ml-3" :default-value="enable1[editItem.jumpType]" style="width: 150px">
<a-select @change="getUse($event, 'jumpType')" class="ml-3" style="width: 200px" placeholder="请选择想要修改的跳转类型">
<a-select-option :key="item" :value="index" v-for="(item, index) in enable1">{{ item }}</a-select-option>
</a-select>
</a-form-item>
@ -32,24 +32,24 @@
:wrapper-col="formItemLayout.wrapperCol"
label="图片跳转路径"
>
<a-input v-model="editItem.jumpUrl" placeholder="图片跳转路径" class="ml-3" />
<a-input v-model="editData.jumpUrl" placeholder="图片跳转路径" class="ml-3" />
</a-form-item>
<!-- 状态 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="状态">
<a-select @change="getUse($event, 'recStatus')" class="ml-3" :default-value="enable[editItem.recStatus]" style="width: 150px">
<a-select @change="getUse($event, 'recStatus')" class="ml-3" style="width: 200px" placeholder="请选择想要修改的状态">
<a-select-option :key="item" :value="index" v-for="(item, index) in enable">{{ item }}</a-select-option>
</a-select>
</a-form-item>
<!-- 页面显示位置 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="页面显示位置">
<a-select @change="getUse($event, 'showPage')" class="ml-3" :default-value="editItem.showPage" style="width: 100%">
<a-select @change="getUse($event, 'showPage')" class="ml-3" style="width: 100%" placeholder="请选择想要修改的页面显示位置">
<a-select-option :key="item.page" :value="item.page" v-for="item in enable2">{{ item.name }}</a-select-option>
</a-select>
</a-form-item>
<!-- 图片 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="图片">
<a-upload :before-upload="beforeUpload" class="ml-3" :action="upload" list-type="picture" name="files" @change="handleChange">
<a-button v-show="fileList.length - 0 === 0"> <a-icon type="upload" /> 选择图片 </a-button>
<a-button v-show="fileList.length - 0 === 0"> <a-icon type="upload" /> 更换图片 </a-button>
</a-upload>
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
@ -150,28 +150,21 @@ export default {
}
return isJpgOrPng;
},
editData: {
jumpType: '',
jumpUrl: '',
recStatus: '',
showPage: '',
url: '',
},
};
},
watch: {
editItem(val) {
console.log(val);
},
},
methods: {
//
getUse(e, str) {
this.editItem[str] = e;
this.editData[str] = e;
if (str === 'jumpType' && e === 0) {
this.editItem.jumpUrl = '';
}
},
showPageNums(nums) {
for (let i = 0; i < this.enable2.length; i++) {
if (nums - 0 === this.enable2[i].page - 0) {
return this.enable2[i].name;
} else if (i === this.enable2.length - 1) {
return '';
}
this.editData.jumpUrl = '';
}
},
//
@ -185,7 +178,7 @@ export default {
},
//
handleSubmit(e) {
console.log(this.editItem);
console.log(this.editData);
e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {

155
src/components/RD/RDAdd.vue

@ -1,155 +0,0 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 添加 -->
<a-modal :closable="false" footer title="添加研发团队" v-model="visible" width="700px">
<a-form :form="form" @submit="handleSubmit">
<!-- 团队名称 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="团队名称"
>
<a-input
placeholder="团队名称"
v-decorator="[
'enterpriseName',
{
rules: [
{ required: true, message: '团队名称不能为空' },
{ whitespace: true, message: '团队名称不能为空' },
{ max: 140, massage: '团队名称最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 团队带头人 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="团队带头人"
>
<a-input
placeholder="团队带头人"
v-decorator="[
'name',
{
rules: [
{ required: true, message: '团队带头人不能为空' },
{ whitespace: true, message: '团队带头人不能为空' },
{ max: 140, massage: '团队带头人最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 依托单位 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="依托单位"
>
<a-input
placeholder="依托单位"
v-decorator="[
'supportUnit',
{
rules: [
{ required: true, message: '依托单位不能为空' },
{ whitespace: true, message: '依托单位不能为空' },
{ max: 140, massage: '依托单位最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 研究方向 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="研究方向"
>
<a-input
placeholder="研究方向"
v-decorator="[
'researchDirection',
{
rules: [
{ required: true, message: '研究方向不能为空' },
{ whitespace: true, message: '研究方向不能为空' },
{ max: 140, massage: '研究方向最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 团队简介 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="团队简介"
>
<a-textarea
placeholder="团队简介"
v-decorator="[
'shortDesc',
]"
/>
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
<a-button @click="$emit('closeModal')" class="mr-3">取消</a-button>
<a-button class="white--text" html-type="submit" type="primary">保存</a-button>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import { addTeam } from 'config/api'
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
};
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default {
name: "RDAdd",
props: { visible: { type: Boolean, default: false } },
data() {
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'r-d-add' }),
}
},
methods: {
//
handleSubmit(e) {
e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
const params = { param: values };
const res = await addTeam(params);
const { data, msg, code } = res.data;
this.$emit('closeModal');
if (code === 200) {
this.$message.success('添加成功')
// TODO:
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '添加失败');
}
}
});
},
},
};
</script>
<style scoped lang="stylus"></style>

168
src/components/RD/RDDate.vue

@ -1,12 +1,14 @@
<template>
<div class="main flex-1">
<div style="width:100%" v-if="lists && lists.length > 0">
<div style="width: 100%" v-if="lists.list && lists.list.length > 0">
<a-table
:columns="columns"
:data-source="lists"
:data-source="lists.list"
:pagination="pagination"
:loading="loading"
:row-key="record => record.id"
:scroll="{ y: height }"
@change="handleTableChange"
bordered
class="white"
>
@ -14,34 +16,34 @@
<span>{{ index + 1 }}</span>
</template>
<template slot="teamNumber">
<a-button @click="openTeamMember" size="small" type="primary">团队成员</a-button>
<template slot="status" slot-scope="text, record">
<a-tag color="red" v-if="record.status === 0">未处理</a-tag>
<a-tag color="blue" v-if="record.status === 1">处理中</a-tag>
<a-tag color="green" v-if="record.status === 2">已处理</a-tag>
</template>
<template slot="edit" slot-scope="text, record">
<a-icon @click="showEditModal(record)" class="pointer" theme="twoTone" type="edit" />
<a-popconfirm @confirm="() => onDelete(record.id)" title="确定要删除这一条?" v-if="lists.length">
<a-icon class="ml-4 pointer" theme="twoTone" two-tone-color="#ff0000" type="delete" />
</a-popconfirm>
<template slot="type" slot-scope="text, record">
<span v-if="record.type === 0">服务</span>
<span v-else-if="record.type === 1">设备</span>
<span v-else-if="record.type === 2">成果</span>
</template>
<p
slot="expandedRowRender"
slot-scope="record"
style="margin: 0"
>团队简介{{ record.shortDesc }}</p>
<template slot="edit" slot-scope="text, record">
<a-icon @click="showEditModal(record.id, record.status)" class="pointer" theme="twoTone" type="edit" />
</template>
</a-table>
</div>
<a-empty v-else />
<!-- 编辑 -->
<r-d-edit :editItem="editItem" :editVisible="editVisible" @closeModal="closeModal" />
<a-modal title="修改审核状态" :visible="editVisible" :confirm-loading="confirmLoading" @ok="onDelete" @cancel="handleCancel">
<a-select @change="getStatus" class="ml-3" style="width: 250px">
<a-select-option :key="item" :value="index" v-for="(item, index) in enable">{{ item }}</a-select-option>
</a-select>
</a-modal>
</div>
</template>
<script>
import RDEdit from "components/RD/RDEdit.vue";
import { delTeam } from 'config/api';
import { serviceApplyStatus } from 'config/api';
const columns = [
{
@ -53,38 +55,51 @@ const columns = [
scopedSlots: { customRender: 'id' },
},
{
title: '团队名称',
title: '公司名称',
align: 'center',
dataIndex: 'enterpriseName',
key: 'enterpriseName',
dataIndex: 'companyName',
key: 'companyName',
},
{
title: '团队带头人',
title: '联系人',
align: 'center',
dataIndex: 'name',
key: 'name',
dataIndex: 'contactName',
key: 'contactName',
},
{
title: '依托单位',
title: '联系电话',
align: 'center',
dataIndex: 'supportUnit',
key: 'supportUnit',
dataIndex: 'contactPhone',
key: 'contactPhone',
},
{
title: '研究方向',
title: '合作信息简述',
align: 'center',
dataIndex: 'researchDirection',
key: 'researchDirection',
dataIndex: 'description',
key: 'description',
},
{
title: '团队成员',
title: '服务名',
align: 'center',
dataIndex: 'teamNumber',
key: 'teamNumber',
scopedSlots: { customRender: 'teamNumber' },
dataIndex: 'name',
key: 'name',
},
{
title: '申请状态',
align: 'center',
dataIndex: 'status',
key: 'status',
scopedSlots: { customRender: 'status' },
},
{
title: '编辑',
title: '申请类型',
align: 'center',
dataIndex: 'type',
key: 'type',
scopedSlots: { customRender: 'type' },
},
{
title: '修改处理状态',
align: 'center',
dataIndex: 'edit',
key: 'edit',
@ -93,13 +108,18 @@ const columns = [
];
export default {
name: "EnterpriseDate",
components: {
RDEdit,
name: 'EnterpriseDate',
props: {
lists: {
type: Object,
default: () => {},
},
pagination: {
type: Object,
default: () => {},
},
},
props: { lists: { type: Array, default: () => [] } },
data() {
this.cacheData = this.lists.map(item => ({ ...item }));
return {
columns,
loading: false,
@ -107,49 +127,67 @@ export default {
height: '',
fullHeight: '',
editVisible: false,
editItem: null, //
}
confirmLoading: false,
delId: '',
dealStatus: '',
enable: ['未处理', '处理中', '已处理'],
};
},
mounted() {
this.height = document.getElementsByClassName('main')[0].offsetHeight - 100;
let th = 200;
let wh = window.innerHeight;
this.height = wh - th;
window.onresize = () => {
return (() => {
wh = window.innerHeight;
this.height = wh - th;
})();
};
},
methods: {
showEditModal(record){
console.log('record: ', record);
this.editItem = record;
this.editVisible = true;
handleTableChange(pagination) {
const { current, pageSize } = pagination;
const condition = { current, pageSize };
this.$emit('searchServiceApply', condition);
},
closeModal(){
handleCancel() {
this.editVisible = false;
this.delId = '';
this.dealStatus = '';
},
//
async onDelete(teamId) {
showEditModal(id, status) {
this.delId = id;
this.dealStatus = status;
this.editVisible = true;
},
getStatus(e) {
this.dealStatus = e;
},
//
async onDelete() {
try {
const params = { param: { teamId } };
const res = await delTeam(params);
const params = {
param: {
id: this.delId,
status: this.dealStatus,
},
};
const res = await serviceApplyStatus(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('删除成功');
const arr = [...this.lists];
this.lists = arr.filter(item => item.id !== teamId);
this.$message.success('修改成功');
this.$emit('searchServiceApply');
this.editVisible = false;
// TODO:
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '删除失败');
this.$message.error(error || '修改失败');
}
},
//
openTeamMember(){
const { query } = this.$route;
this.$router.push({ path: '/RD-team-member', query });
}
},
};
</script>

163
src/components/RD/RDEdit.vue

@ -1,163 +0,0 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 编辑 -->
<a-modal :closable="false" footer title="修改研发团队" v-model="editVisible" width="700px">
<a-form :form="form" @submit="handleSubmit">
<!-- 团队名称 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="团队名称"
>
<!-- initialValue: editTask.name, -->
<a-input
placeholder="团队名称"
v-decorator="[
'enterpriseName',
{
initialValue: editItem ? editItem.enterpriseName : '',
rules: [
{ required: true, message: '团队名称不能为空' },
{ whitespace: true, message: '团队名称不能为空' },
{ max: 140, massage: '团队名称最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 团队带头人 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="团队带头人"
>
<a-input
placeholder="团队带头人"
v-decorator="[
'name',
{
initialValue: editItem ? editItem.name : '',
rules: [
{ required: true, message: '团队带头人不能为空' },
{ whitespace: true, message: '团队带头人不能为空' },
{ max: 140, massage: '团队带头人最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 依托单位 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="依托单位"
>
<a-input
placeholder="依托单位"
v-decorator="[
'supportUnit',
{
initialValue: editItem ? editItem.supportUnit : '',
rules: [
{ required: true, message: '依托单位不能为空' },
{ whitespace: true, message: '依托单位不能为空' },
{ max: 140, massage: '依托单位最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 研究方向 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="研究方向"
>
<a-input
placeholder="研究方向"
v-decorator="[
'researchDirection',
{
initialValue: editItem ? editItem.researchDirection : '',
rules: [
{ required: true, message: '研究方向不能为空' },
{ whitespace: true, message: '研究方向不能为空' },
{ max: 140, massage: '研究方向最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 团队简介 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="团队简介"
>
<a-textarea
placeholder="团队简介"
v-decorator="[
'shortDesc',
{initialValue: editItem ? editItem.shortDesc : '',}
]"
/>
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
<a-button @click="$emit('closeModal')" class="mr-3">取消</a-button>
<a-button class="white--text" html-type="submit" type="primary">保存</a-button>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import { upTeam } from 'config/api';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
};
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default {
name: "RDEdit",
props: { editVisible: { type: Boolean, default: false },editItem: { type: Object, default: null } },
data() {
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'r-d-add' }),
}
},
methods: {
//
handleSubmit(e) {
e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
const params = { param: values };
const res = await upTeam(params);
const { data, msg, code } = res.data;
this.$emit('closeModal');
// if (code === 200) {
// this.$message.success('')
// // TODO:
// } else {
// throw msg;
// }
} catch (error) {
this.$message.error(error || '修改失败');
}
}
});
},
},
};
</script>
<style scoped lang="stylus"></style>

60
src/components/RD/RDSearch.vue

@ -2,66 +2,54 @@
<div class="d-flex flex-wrap pb-3">
<!-- 团队名称 -->
<div>
<a-input
@change="handleChangeName"
placeholder="团队名称"
style="width: 150px"
v-model="teamName"
/>
<a-input placeholder="公司名称" style="width: 150px" v-model="paramData.companyName" allow-clear />
<a-input placeholder="联系人" class="ml-3" style="width: 150px" v-model="paramData.contactName" allow-clear />
<a-input placeholder="联系电话" class="ml-3" style="width: 150px" v-model="paramData.contactPhone" allow-clear />
<!-- 跳转类型 -->
<a-select @change="cahngeType" class="ml-3" style="width: 150px" placeholder="全部类型" allow-clear>
<a-select-option :key="item" :value="index" v-for="(item, index) in typeList">{{ item }}</a-select-option>
</a-select>
<a-button @click="handleTableChange" class="mx-2" type="primary">搜索</a-button>
</div>
<div class="flex-1"></div>
<a-button @click="showModal" class="editable-add-btn" type="primary">增加</a-button>
<!-- 添加 -->
<r-d-add :visible="visible" @closeModal="closeModal" />
</div>
</template>
<script>
import RDAdd from 'components/RD/RDAdd.vue';
import { selLikeTeam } from 'config/api';
export default {
name: 'RDSearch',
components: {
RDAdd,
},
data() {
return {
visible: false,
teamName: '',
paramData: {
companyName: '',
contactName: '',
contactPhone: '',
type: '',
},
typeList: ['服务', '设备', '成果'],
};
},
methods: {
showModal() {
this.visible = true;
},
closeModal() {
this.visible = false;
cahngeType(e) {
console.log(e);
if (e === undefined) {
this.paramData.type = '';
} else {
this.paramData.type = e;
}
},
handleChangeName(e) {
this.teamName = e.target.value;
},
async handleTableChange() {
try {
const params = { param: { teamName: this.teamName } };
const res = await selLikeTeam(params);
const { data, msg, code } = res.data;
if (code === 200) {
console.log('搜索结果', data);
// TODO:
} else {
throw msg;
}
} catch (error) {
this.$message.error(error);
}
handleTableChange() {
this.$emit('searchServiceApply', this.paramData);
},
},
};

182
src/components/SpinOff/SpinOffAdd.vue

@ -1,182 +0,0 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 添加 -->
<a-modal :closable="false" footer title="添加衍生企业" v-model="visible" width="700px">
<a-form :form="form" @submit="handleSubmit">
<!-- logo -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="logo"
>
<a-upload
:before-upload="beforeUpload"
:show-upload-list="false"
@change="handleChange"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
class="avatar-uploader"
list-type="picture-card"
name="avatar"
v-decorator="[
'avatar',
{
rules: [
{ required: true, message: 'logo不能为空' },
{ whitespace: true, message: 'logo不能为空' },
],
},
]"
>
<img :src="imageUrl" alt="avatar" v-if="imageUrl" />
<div v-else>
<a-icon :type="loading ? 'loading' : 'plus'" />
<div class="ant-upload-text">Upload</div>
</div>
</a-upload>
</a-form-item>
<!-- 企业名 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="企业名"
>
<a-input
placeholder="企业名"
v-decorator="[
'companyName',
{
rules: [
{ required: true, message: '企业名不能为空' },
{ whitespace: true, message: '企业名不能为空' },
{ max: 140, massage: '企业名最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 英文名 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="英文名"
>
<a-input
placeholder="英文名"
v-decorator="[
'englishName',
{
rules: [
{ required: true, message: '英文名不能为空' },
{ whitespace: true, message: '英文名不能为空' },
{ max: 140, massage: '英文名最多140个字符' },
],
},
]"
/>
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
<a-button @click="$emit('closeModal')" class="mr-3">取消</a-button>
<a-button class="white--text" html-type="submit" type="primary">保存</a-button>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
};
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
function getBase64(img, callback) {
const reader = new FileReader();
reader.addEventListener('load', () => callback(reader.result));
reader.readAsDataURL(img);
}
export default {
name: "SpinOffAdd",
props: { visible: { type: Boolean, default: false } },
data() {
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'r-d-add' }),
loading: false,
imageUrl: '',
}
},
methods: {
//
handleChange(info) {
if (info.file.status === 'uploading') {
this.loading = true;
return;
}
if (info.file.status === 'done') {
// Get this url from response in real world.
getBase64(info.file.originFileObj, imageUrl => {
this.imageUrl = imageUrl;
this.loading = false;
});
}
},
beforeUpload(file) {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
this.$message.error('You can only upload JPG file!');
}
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
this.$message.error('Image must smaller than 2MB!');
}
return isJpgOrPng && isLt2M;
},
//
handleSubmit(e) {
e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
console.log('values: ', values);
// const params = this.generateParams(values);
// const res = await createTask(params);
// const { data, msg, code } = res.data;
// //
// this.clearCreateTask();
// this.$emit('closeDialog');
// if (code === 200) {
// this.handleCreateSuccess(params.executorId);
// } else {
// throw msg;
// }
} catch (error) {
this.$message.error(error || '添加研发团队失败');
}
}
});
},
},
};
</script>
<style scoped lang="stylus">
.avatar-uploader > .ant-upload {
width: 128px;
height: 128px;
}
.ant-upload-select-picture-card i {
font-size: 32px;
color: #999;
}
.ant-upload-select-picture-card .ant-upload-text {
margin-top: 8px;
color: #666;
}
</style>

125
src/components/SpinOff/SpinOffDate.vue

@ -1,63 +1,41 @@
<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"
:row-key="record => record.id"
bordered
class="white"
>
<div style="width: 100%" v-if="lists && lists.length > 0">
<a-table :columns="columns" :data-source="lists" :loading="loading" :row-key="record => record.id" bordered class="white">
<template slot="id" slot-scope="text, record, index">
<span>{{ index + 1 }}</span>
</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>
<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">
<img :src="record.logo" class="img" />
<a-modal :imgVisible="imgVisible" @cancel="imgVisible = false" footer title="身份证明">
<img :src="record.idCardPromise" @click="imgVisible = true" style="width: 100%;" />
</a-modal>
<a-tag color="red" v-if="record.dealStatus === 0">未处理</a-tag>
<a-tag color="blue" v-if="record.dealStatus === 1">审核通过</a-tag>
<a-tag color="red" v-if="record.dealStatus === 2">审核未通过</a-tag>
</template>
<template slot="edit" slot-scope="text, record">
<a-icon @click="showEditModal" class="pointer" theme="twoTone" type="edit" />
<a-popconfirm @confirm="() => onDelete(record.id)" title="确定要删除这一条?" v-if="lists.length">
<a-icon class="ml-4 pointer" theme="twoTone" two-tone-color="#ff0000" type="delete" />
</a-popconfirm>
<a-icon @click="showEditModal(record.id, record.dealStatus)" class="pointer" theme="twoTone" type="edit" />
</template>
</a-table>
</div>
<a-empty v-else />
<!-- 编辑 -->
<spin-off-edit :editVisible="editVisible" @closeModal="closeModal" />
<a-modal title="修改审核状态" :visible="editVisible" :confirm-loading="confirmLoading" @ok="onDelete" @cancel="handleCancel">
<a-select @change="getStatus" class="ml-3" style="width: 250px">
<a-select-option :key="item" :value="index" v-for="(item, index) in enable">{{ item }}</a-select-option>
</a-select>
</a-modal>
</div>
</template>
<script>
import SpinOffEdit from "components/SpinOff/SpinOffEdit.vue";
import {getCreatingPlatformDelete} from "config/api"
import { getCreatingPlatformstatusUpdate } from 'config/api';
const columns = [
{
@ -122,10 +100,10 @@ const columns = [
align: 'center',
dataIndex: 'dealStatus',
key: 'dealStatus',
scopedSlots: { customRender: 'dealStatus' },
scopedSlots: { customRender: 'dealStatus' },
},
{
title: '编辑',
title: '修改审核状态',
align: 'center',
dataIndex: 'edit',
key: 'edit',
@ -135,26 +113,23 @@ const columns = [
const lists = [
{
id:'001',
logo:'assets/logo.png',
companyName:'传控科技',
englishName:'ckkj',
id: '001',
logo: 'assets/logo.png',
companyName: '传控科技',
englishName: 'ckkj',
},
{
id:'002',
logo:'assets/logo.png',
companyName:'中绿环保',
englishName:'zlhb',
}
id: '002',
logo: 'assets/logo.png',
companyName: '中绿环保',
englishName: 'zlhb',
},
];
export default {
name: "SpinOffDate",
components: {
SpinOffEdit,
},
name: 'SpinOffDate',
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } },
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } },
data() {
this.cacheData = lists.map(item => ({ ...item }));
@ -162,9 +137,13 @@ export default {
columns,
loading: false,
height: '',
confirmLoading: false,
editVisible: false,
imgVisible: false,
}
delId: '',
dealStatus: '',
enable: ['未处理', '审核通过', '审核未通过'],
};
},
mounted() {
@ -172,31 +151,39 @@ export default {
},
methods: {
showEditModal(){
showEditModal(id, dealStatus) {
this.editVisible = true;
this.delId = id;
this.dealStatus = dealStatus;
},
closeModal(){
handleCancel() {
this.editVisible = false;
this.delId = '';
this.dealStatus = '';
},
//
async onDelete(id) {
getStatus(e) {
this.dealStatus = e;
},
//
async onDelete() {
try {
const params = { param: { id } };
const res = await getCreatingPlatformDelete(params);
const params = {
param: {
id: this.delId,
dealStatus: this.dealStatus,
},
};
const res = await getCreatingPlatformstatusUpdate(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('删除成功');
this.$emit('getCreatingPlatformSearch');
// const arr = [...this.lists];
// this.lists = arr.filter(item => item.id !== teamId);
// TODO:
this.editVisible = false;
this.$message.success('修改成功');
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '删除失败');
this.$message.error(error || '修改失败');
}
},
},

182
src/components/SpinOff/SpinOffEdit.vue

@ -1,182 +0,0 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 编辑 -->
<a-modal :closable="false" footer title="修改衍生企业" v-model="editVisible" width="700px">
<a-form :form="form" @submit="handleSubmit">
<!-- logo -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="logo"
>
<a-upload
:before-upload="beforeUpload"
:show-upload-list="false"
@change="handleChange"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
class="avatar-uploader"
list-type="picture-card"
name="avatar"
v-decorator="[
'avatar',
{
rules: [
{ required: true, message: 'logo不能为空' },
{ whitespace: true, message: 'logo不能为空' },
],
},
]"
>
<img :src="imageUrl" alt="avatar" v-if="imageUrl" />
<div v-else>
<a-icon :type="loading ? 'loading' : 'plus'" />
<div class="ant-upload-text">Upload</div>
</div>
</a-upload>
</a-form-item>
<!-- 企业名 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="企业名"
>
<a-input
placeholder="企业名"
v-decorator="[
'companyName',
{
rules: [
{ required: true, message: '企业名不能为空' },
{ whitespace: true, message: '企业名不能为空' },
{ max: 140, massage: '企业名最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 英文名 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="英文名"
>
<a-input
placeholder="英文名"
v-decorator="[
'englishName',
{
rules: [
{ required: true, message: '英文名不能为空' },
{ whitespace: true, message: '英文名不能为空' },
{ max: 140, massage: '英文名最多140个字符' },
],
},
]"
/>
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
<a-button @click="$emit('closeModal')" class="mr-3">取消</a-button>
<a-button class="white--text" html-type="submit" type="primary">保存</a-button>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
};
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
function getBase64(img, callback) {
const reader = new FileReader();
reader.addEventListener('load', () => callback(reader.result));
reader.readAsDataURL(img);
}
export default {
name: "SpinOffEdit",
props: { editVisible: { type: Boolean, default: false } },
data() {
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'r-d-add' }),
loading: false,
imageUrl: '',
}
},
methods: {
//
handleChange(info) {
if (info.file.status === 'uploading') {
this.loading = true;
return;
}
if (info.file.status === 'done') {
// Get this url from response in real world.
getBase64(info.file.originFileObj, imageUrl => {
this.imageUrl = imageUrl;
this.loading = false;
});
}
},
beforeUpload(file) {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
this.$message.error('You can only upload JPG file!');
}
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
this.$message.error('Image must smaller than 2MB!');
}
return isJpgOrPng && isLt2M;
},
//
handleSubmit(e) {
e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
console.log('values: ', values);
// const params = this.generateParams(values);
// const res = await createTask(params);
// const { data, msg, code } = res.data;
// //
// this.clearCreateTask();
// this.$emit('closeDialog');
// if (code === 200) {
// this.handleCreateSuccess(params.executorId);
// } else {
// throw msg;
// }
} catch (error) {
this.$message.error(error || '添加研发团队失败');
}
}
});
},
},
};
</script>
<style scoped lang="stylus">
.avatar-uploader > .ant-upload {
width: 128px;
height: 128px;
}
.ant-upload-select-picture-card i {
font-size: 32px;
color: #999;
}
.ant-upload-select-picture-card .ant-upload-text {
margin-top: 8px;
color: #666;
}
</style>

17
src/components/SpinOff/SpinOffSearch.vue

@ -2,28 +2,18 @@
<div class="d-flex flex-wrap pb-3">
<!-- 企业名称 -->
<div>
<a-input placeholder="单位名称" style="width: 150px" v-model="companyName" />
<a-input placeholder="单位性质" style="width: 150px" v-model="companyType" />
<a-input placeholder="单位名称" style="width: 150px" v-model="companyName" allow-clear />
<a-input placeholder="单位性质" style="width: 150px" class="ml-3" v-model="companyType" allow-clear />
<a-button @click="handleTableChange" class="ml-3" type="primary">搜索</a-button>
</div>
<div class="flex-1"></div>
<a-button @click="showModal" class="editable-add-btn" type="primary">增加</a-button>
<!-- 添加 -->
<spin-off-add :visible="visible" @closeModal="closeModal" />
</div>
</template>
<script>
import SpinOffAdd from 'components/SpinOff/SpinOffAdd.vue';
export default {
name: 'SpinOffSearch',
components: {
SpinOffAdd,
},
data() {
return {
visible: false,
@ -53,8 +43,7 @@ export default {
companyName,
companyType,
};
await this.$emit('getSelectTeam', condition);
this.activityType = [];
await this.$emit('getCreatingPlatformSearch', condition);
},
},
};

226
src/components/innovativeService/innovativeServiceAdd.vue

@ -2,101 +2,77 @@
<div class="d-flex flex-wrap pb-3">
<!-- 添加 -->
<a-modal :closable="false" footer title="添加研发团队" v-model="visible" width="700px">
<a-form :form="form" @submit="handleSubmit">
<!-- 团队名称 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="团队名称"
>
<a-form :form="form" @submit="handleSubmit" @cancel="$emit('closeModal')">
<!-- 服务名称 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务名称">
<a-input
placeholder="团队名称"
class="ml-3"
placeholder="服务名称"
@change="changeIpt($event, 'serviceName')"
v-decorator="[
'name',
{
rules: [
{ required: true, message: '团队名称不能为空' },
{ whitespace: true, message: '团队名称不能为空' },
{ max: 140, massage: '团队名称最多140个字符' },
],
},
]"
'serviceName',
{
rules: [
{ required: true, message: '服务名称不能为空' },
{ whitespace: true, message: '服务名称不能为空' },
{ max: 140, massage: '服务名称最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 团队带头人 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="团队带头人"
>
<a-input
placeholder="团队带头人"
<!-- 服务简介 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务简介">
<a-textarea
class="ml-3"
placeholder="服务简介"
@change="changeIpt($event, 'intro')"
v-decorator="[
'contacts',
{
rules: [
{ required: true, message: '团队带头人不能为空' },
{ whitespace: true, message: '团队带头人不能为空' },
{ max: 140, massage: '团队带头人最多140个字符' },
],
},
]"
'intro',
{
rules: [
{ required: true, message: '服务简介不能为空' },
{ whitespace: true, message: '服务简介不能为空' },
{ max: 140, massage: '服务简介最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 依托单位 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="依托单位"
>
<a-input
placeholder="依托单位"
<!-- 服务内容 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务内容">
<a-textarea
class="ml-3"
placeholder="服务内容"
@change="changeIpt($event, 'content')"
v-decorator="[
'company',
{
rules: [
{ required: true, message: '依托单位不能为空' },
{ whitespace: true, message: '依托单位不能为空' },
{ max: 140, massage: '依托单位最多140个字符' },
],
},
]"
'content',
{
rules: [
{ required: true, message: '服务内容不能为空' },
{ whitespace: true, message: '服务内容不能为空' },
{ max: 140, massage: '服务内容最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 研究方向 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="研究方向"
>
<a-input
placeholder="研究方向"
v-decorator="[
'researchDirection',
{
rules: [
{ required: true, message: '研究方向不能为空' },
{ whitespace: true, message: '研究方向不能为空' },
{ max: 140, massage: '研究方向最多140个字符' },
],
},
]"
/>
<!-- 服务排序 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务排序">
<a-input-number class="ml-3" v-model="orders" />
</a-form-item>
<!-- 团队简介 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="团队简介"
>
<a-textarea
placeholder="团队简介"
v-decorator="[
'teamIntroduce',
]"
/>
<!-- 图片 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="图片">
<a-upload :before-upload="beforeUpload" class="ml-3" :action="upload" list-type="picture" name="files" @change="handleChange">
<a-button v-show="fileList.length - 0 === 0"> <a-icon type="upload" /> 选择图片 </a-button>
</a-upload>
</a-form-item>
<!-- 服务状态 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="服务状态">
<a-select @change="getUse($event, 'recStatus')" class="ml-3" default-value="正常" style="width: 100%">
<a-select-option :key="index" :value="index" v-for="(item, index) in recStatusList">{{ item }}</a-select-option>
</a-select>
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
<a-button @click="$emit('closeModal')" class="mr-3">取消</a-button>
<a-button class="white--text" html-type="submit" type="primary">保存</a-button>
@ -107,6 +83,8 @@
</template>
<script>
import { upload, saveService } from 'config/api';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
@ -115,37 +93,85 @@ const formItemLayout = {
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default {
name: "RDMemberAdd",
name: 'RDMemberAdd',
props: { visible: { type: Boolean, default: false } },
data() {
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'r-d-member-add' }),
}
upload: upload,
fileList: [],
//
beforeUpload: file => {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
this.$message.error('仅支持 JPG/PNG 格式的图片!');
}
return isJpgOrPng;
},
recStatusList: ['正常', '禁用'],
serviceTypeList: ['创新平台', '孵化平台', '产业平台'],
serviceName: '',
content: '',
intro: '',
orders: '',
picId: '',
recStatus: 0,
serviceType: 0,
};
},
methods: {
//
handleChange(info) {
// this.fileList = fileList;
console.log(info);
if (info.file.status === 'done') {
this.fileList.push(info.file.response.data[0].id);
} else if (info.file.status === 'removed') {
this.fileList = info.fileList;
}
},
changeIpt(e, str) {
this[str] = e.target.value;
},
getUse(e, str) {
this[str] = e;
},
//
handleSubmit(e) {
e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
console.log('values: ', values);
// const params = this.generateParams(values);
// const res = await createTask(params);
// const { data, msg, code } = res.data;
// //
// this.clearCreateTask();
// this.$emit('closeDialog');
// if (code === 200) {
// this.handleCreateSuccess(params.executorId);
// } else {
// throw msg;
// }
} catch (error) {
this.$message.error(error || '添加研发团队失败');
if (this.fileList.length > 0) {
try {
this.picId = this.fileList[0];
const params = {
param: {
name: this.serviceName,
content: this.content,
intro: this.intro,
orders: this.orders,
picId: this.picId,
recStatus: this.recStatus,
serviceType: 0,
},
};
const res = await saveService(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$emit('handleTableChange');
this.$emit('closeModal');
this.$message.success('添加成功');
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '添加失败');
}
} else {
this.$message.error('请上传图片');
}
}
});

112
src/components/innovativeService/innovativeServiceDate.vue

@ -1,12 +1,14 @@
<template>
<div class="main flex-1">
<div style="width:100%" v-if="lists && lists.length > 0">
<div style="width: 100%" v-if="lists.list && lists.list.length > 0">
<a-table
:columns="columns"
:data-source="lists"
:data-source="lists.list"
:loading="loading"
:row-key="record => record.id"
:scroll="{ y: height }"
:pagination="pagination"
@change="handleTableChange"
bordered
class="white"
>
@ -15,18 +17,18 @@
</template>
<template slot="picUrl" slot-scope="text, record">
<img :src="record.picUrl" width="50" height="50">
<img :src="record.picUrl" width="50" height="50" />
</template>
<template slot="serviceType" slot-scope="text, record">
<span v-if=" record.serviceType === 1">创新平台</span>
<span v-if=" record.serviceType === 2">孵化平台</span>
<span v-if=" record.serviceType === 3">产业平台</span>
<span v-if="record.serviceType === 1">创新平台</span>
<span v-if="record.serviceType === 2">孵化平台</span>
<span v-if="record.serviceType === 3">产业平台</span>
</template>
<template slot="edit" slot-scope="text, record">
<a-icon @click="showEditModal" class="pointer" theme="twoTone" type="edit" />
<a-popconfirm @confirm="() => onDelete(record.id)" title="确定要删除这一条?" v-if="lists.length">
<a-popconfirm @confirm="() => onDelete(record.id)" title="确定要删除这一条?" v-if="lists.list.length">
<a-icon class="ml-4 pointer" theme="twoTone" two-tone-color="#ff0000" type="delete" />
</a-popconfirm>
</template>
@ -40,8 +42,8 @@
</template>
<script>
import RDMemberEdit from "components/innovativeService/innovativeServiceEdit.vue";
import RDMemberEdit from 'components/innovativeService/innovativeServiceEdit.vue';
import { deleteService } from 'config/api';
const columns = [
{
title: '序号',
@ -68,13 +70,7 @@ const columns = [
align: 'center',
dataIndex: 'picUrl',
key: 'picUrl',
    scopedSlots: { customRender: 'picUrl' },
},
{
title: '服务状态',
align: 'center',
dataIndex: 'recStatus',
key: 'recStatus',
scopedSlots: { customRender: 'picUrl' },
},
{
title: '服务类型',
@ -83,21 +79,13 @@ const columns = [
key: 'serviceType',
scopedSlots: { customRender: 'serviceType' },
},
// {
// title: '/',
// align: 'center',
// dataIndex: 'jobTitle',
// key: 'jobTitle',
// scopedSlots: { customRender: 'jobTitle' },
// },
// {
// title: '',
// align: 'center',
// dataIndex: 'researchDirection',
// key: 'researchDirection',
// scopedSlots: { customRender: 'researchDirection' },
// },
{
title: '服务排序',
align: 'center',
dataIndex: 'orders',
key: 'orders',
scopedSlots: { customRender: 'orders' },
},
{
title: '编辑',
align: 'center',
@ -107,31 +95,8 @@ const columns = [
},
];
// const columns = [
// {
// id:'001',
// name:'',
// sex: '',
// supportUnit:'',
// birth:'1990-01-01',
// education: '',
// jobTitle: '',
// researchDirection: '',
// },
// {
// id:'002',
// name:'',
// sex: '',
// supportUnit:'绿',
// birth:'1995-01-01',
// education: '',
// jobTitle: '',
// researchDirection: '',
// }
// ];
export default {
name: "innovativeServiceDate",
name: 'innovativeServiceDate',
components: {
RDMemberEdit,
},
@ -144,8 +109,8 @@ export default {
loading: false,
editingKey: '',
height: '',
editVisible: false
}
editVisible: false,
};
},
mounted() {
@ -161,28 +126,31 @@ export default {
},
methods: {
showEditModal(){
showEditModal() {
this.editVisible = true;
},
closeModal(){
closeModal() {
this.editVisible = false;
},
handleTableChange(pagination) {
const { current, pageSize } = pagination;
const condition = { current, pageSize };
this.$emit('getInnovativeServiceSearch', condition);
},
//
async onDelete(teamId) {
async onDelete(id) {
try {
const params = { param: { teamId } };
// const res = await delTeam(params);
// const { data, msg, code } = res.data;
// if (code === 200) {
// this.$message.success('');
// const arr = [...this.lists];
// this.lists = arr.filter(item => item.id !== teamId);
// // TODO:
// } else {
// throw msg;
// }
const params = { param: { id } };
const res = await deleteService(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$emit('getInnovativeServiceSearch');
this.$message.success('删除成功');
// TODO:
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '删除失败');
}

62
src/components/innovativeService/innovativeServiceSearch.vue

@ -2,44 +2,31 @@
<div class="d-flex flex-wrap pb-3">
<!-- 团队名称 -->
<div>
<a-input
placeholder="服务名称"
style="width: 150px"
v-model="name"
/>
<a-input placeholder="服务名称" style="width: 150px" v-model="name" allow-clear />
<!-- <span class="ml-3"> 服务类型:</span>
<a-select @change="handleChangeSelect('serviceType', $event)" class="ml-3" style="width: 150px" placeholder="三大平台" allow-clear>
<a-select-option :key="serviceType.id" :value="serviceType.id" v-for="serviceType in serviceTypes">{{
serviceType.value
}}</a-select-option>
</a-select> -->
服务类型:
<a-select
@change="handleChangeSelect('serviceType',$event)"
class="ml-3"
style="width: 150px"
allow-clear
>
<a-select-option
:key="serviceType.id"
:value="serviceType.id"
v-for="serviceType in serviceTypes"
>{{ serviceType.value }}</a-select-option>
</a-select>
<a-button @click="handleTableChange" class="mx-2" type="primary">搜索</a-button>
</div>
<div class="flex-1"></div>
<a-button @click="showModal" class="editable-add-btn">增加</a-button>
<a-button type="primary" @click="showModal" class="editable-add-btn">增加</a-button>
<!-- 添加 -->
<r-d-member-add :visible="visible" @closeModal="closeModal" />
<r-d-member-add :visible="visible" @closeModal="closeModal" @handleTableChange="handleTableChange" />
</div>
</template>
<script>
import RDMemberAdd from "components/innovativeService/innovativeServiceAdd.vue";
import RDMemberAdd from 'components/innovativeService/innovativeServiceAdd.vue';
export default {
name: "innovativeServiceSearch",
name: 'innovativeServiceSearch',
components: {
RDMemberAdd,
},
@ -48,25 +35,25 @@ export default {
visible: false,
name: '',
serviceTypes: [
{ id:1, value:'创新平台' },
{ id:2, value:'孵化平台' },
{ id:3, value:'产业平台' },
{ id: 1, value: '创新平台' },
{ id: 2, value: '孵化平台' },
{ id: 3, value: '产业平台' },
],
}
};
},
methods: {
showModal(){
showModal() {
this.visible = true;
},
closeModal(){
closeModal() {
this.visible = false;
},
handleChangeSelect(type, value) {
this[type] = value;
},
handleChangeName(value) {
console.log('value: ', value);
this.name = value;
@ -74,13 +61,14 @@ export default {
async handleTableChange() {
console.log('搜索');
const { name,serviceType} = this;
console.log(name,serviceType)
//
const { name, serviceType } = this;
console.log(name, serviceType);
//
const condition = {
name,serviceType
}
await this.$emit('getInnovativeServiceSearch',condition)
name,
serviceType,
};
await this.$emit('getInnovativeServiceSearch', condition);
this.activityType = [];
},
},

20
src/config/api.js

@ -20,6 +20,7 @@ const creatingPlatform = `${greenvalley}/creatingPlatform`; // 合作意向相
const serviceProject = `${greenvalley}/serviceProject`; // 创新部服务相关操作
const institute = `${greenvalley}/institute`; // 实验室(研究院)相关操作
const achInstr = `${greenvalley}/achInstr`; // 创新部类型相关操作
const service = `${greenvalley}/service`; // 三大平台相关接口
// websocket基础地址
export const WS_BASE_URL = msgUrl;
@ -85,11 +86,17 @@ export const upPolicy = params => axios.post(`${policy}/policy/upPolicy`, params
export const getCreatingPlatformSearch = params => axios.post(`${creatingPlatform}/search`, params);
// 合作意向删除
export const getCreatingPlatformDelete = params => axios.post(`${creatingPlatform}/delete`, params);
export const getCreatingPlatformstatusUpdate = params => axios.post(`${creatingPlatform}/statusUpdate`, params);
// 创新部服务列表查询
export const getInnovativeServiceSearch = params => axios.post(`${serviceProject}/selServiceH`, params);
// 创新部服务添加
export const saveService = params => axios.post(`${serviceProject}/saveService`, params);
// 创新部服务删除
export const deleteService = params => axios.post(`${serviceProject}/deleteService`, params);
// 实验室[研究院]列表查询
export const getInstituteSearchBack = params => axios.post(`${institute}/searchBack`, params);
@ -128,7 +135,18 @@ export const selLikeTeam = params => axios.post(`${researchTeam}/selLikeTeam`, p
// // 页面配置删除
// export const deletePage = params => axios.post(`${page}/delete`, params);
// 查询轮播图列表
export const queryCarousel = params => axios.post(`${carousel}/queryCarousel`, params);
// 查询轮播图列表
export const addCarousel = params => axios.post(`${carousel}/addCarousel`, params);
// 删除轮播图
export const deleteCarousel = params => axios.post(`${carousel}/deleteCarousel`, params);
// 三大平台需求填报查询
export const searchServiceApply = params => axios.post(`${service}/searchServiceApply`, params);
// 三大平台需求填报状态修改
export const serviceApplyStatus = params => axios.post(`${service}/ServiceApplyStatus`, params);

2
src/plugins/ant-design-vue.js

@ -24,6 +24,7 @@ import {
Spin,
Tooltip,
Popover,
inputNumber,
} from 'ant-design-vue';
import { ConfigProvider } from 'ant-design-vue';
Vue.component(ConfigProvider.name, ConfigProvider);
@ -49,6 +50,7 @@ Vue.use(Checkbox);
Vue.use(Spin);
Vue.use(Tooltip);
Vue.use(Popover);
Vue.use(inputNumber);
Vue.prototype.$message = message;
Vue.prototype.$notification = notification;

57
src/views/CooperationIntention/CooperationIntention.vue

@ -1,17 +1,17 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<spin-off-search @getCreatingPlatformSearch="getCreatingPlatformSearch" />
<spin-off-date :pagination="pagination" :lists="lists" @getCreatingPlatformSearch="getCreatingPlatformSearch"/>
<spin-off-date :pagination="pagination" :lists="lists" @getCreatingPlatformSearch="getCreatingPlatformSearch" />
</div>
</template>
<script>
import SpinOffSearch from "components/SpinOff/SpinOffSearch.vue";
import SpinOffDate from "components/SpinOff/SpinOffDate.vue";
import SpinOffSearch from 'components/SpinOff/SpinOffSearch.vue';
import SpinOffDate from 'components/SpinOff/SpinOffDate.vue';
import { getCreatingPlatformSearch } from 'config/api';
export default {
name: "DerivativeSpinOffs",
name: 'DerivativeSpinOffs',
components: {
SpinOffSearch,
SpinOffDate,
@ -24,33 +24,35 @@ export default {
};
},
created() {
this.getCreatingPlatformSearch()
created() {
this.getCreatingPlatformSearch();
},
methods: {
async getCreatingPlatformSearch(condition){
try {
const params = {
param: {
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
async getCreatingPlatformSearch(condition) {
try {
const params = {
param: {
companyName: condition && condition.companyName ? condition.companyName : '',
companyType: condition && condition.companyType ? condition.companyType : '',
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
if(condition){
if(condition.companyName){
params.param.companyName = condition.companyName
if (condition) {
if (condition.companyName) {
params.param.companyName = condition.companyName;
}
if (condition.companyType) {
params.param.companyType = condition.companyType;
}
}
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)
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;
@ -63,8 +65,7 @@ created() {
} catch (error) {
this.$message.error(error);
}
}
}
},
},
};
</script>

32
src/views/DemandFilling/DemandFilling.vue

@ -1,7 +1,7 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<r-d-search />
<r-d-date :lists="lists" />
<r-d-search @searchServiceApply="searchServiceApply" />
<r-d-date :lists="lists" :pagination="pagination" @searchServiceApply="searchServiceApply" />
</div>
</template>
@ -9,7 +9,7 @@
// @ is an alias to /src
import RDSearch from 'components/RD/RDSearch.vue';
import RDDate from 'components/RD/RDDate.vue';
import { getAllTeam } from 'config/api';
import { searchServiceApply } from 'config/api';
export default {
name: 'RDTeam',
@ -19,11 +19,13 @@ export default {
},
data() {
return {
lists: [],
str: '需求填报界面',
pagination: { current: 1, pageSize: 10 },
lists: {},
};
},
created() {
// this.getAllTeam()
this.searchServiceApply();
},
methods: {
@ -31,13 +33,27 @@ export default {
* 根据团队id查看研发团队相关信息
* @param { String } competeTimeId 第几届信息的id
*/
async getAllTeam() {
async searchServiceApply(paramData) {
try {
const res = await getAllTeam();
const params = {
param: {
companyName: paramData && paramData.companyName !== '' ? paramData.companyName : '',
contactName: paramData && paramData.contactName !== '' ? paramData.contactName : '',
contactPhone: paramData && paramData.contactPhone !== '' ? paramData.contactPhone : '',
type: paramData && paramData.type !== '' ? paramData.type : '',
pageNum: paramData && paramData.current ? paramData.current : 1,
pageSize: paramData && paramData.pageSize ? paramData.pageSize : 10,
},
};
const res = await searchServiceApply(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.lists = data;
console.log('this.lists: ', this.lists);
const paper = { ...this.pagination };
paper.current = data.pageNum;
paper.total = +data.total;
paper.pageSize = data.pageSize;
this.pagination = paper;
} else {
throw msg || '获取失败';
}

38
src/views/InnovativeService/InnovativeService.vue

@ -1,7 +1,5 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<!-- <r-d-member-search />
<r-d-member-date /> -->
<innovative-service-search @getInnovativeServiceSearch="getInnovativeServiceSearch" />
<innovative-service-date :pagination="pagination" :lists="lists" @getInnovativeServiceSearch="getInnovativeServiceSearch" />
</div>
@ -9,26 +7,26 @@
<script>
// @ is an alias to /src
import innovativeServiceSearch from "components/innovativeService/innovativeServiceSearch.vue";
import innovativeServiceDate from "components/innovativeService/innovativeServiceDate.vue";
import innovativeServiceSearch from 'components/innovativeService/innovativeServiceSearch.vue';
import innovativeServiceDate from 'components/innovativeService/innovativeServiceDate.vue';
import { getInnovativeServiceSearch } from 'config/api';
export default {
name: "RDTeamMember",
name: 'RDTeamMember',
components: {
innovativeServiceSearch,
innovativeServiceDate,
},
data(){
return{
data() {
return {
lists: [],
pagination:{ current: 1,pageSize: 10},
pagination: { current: 1, pageSize: 10 },
};
},
created() {
this.getInnovativeServiceSearch()
this.getInnovativeServiceSearch();
},
methods: {
@ -40,21 +38,21 @@ export default {
pageSize: (condition && condition.pageSize) || 10,
},
};
if(condition){
if(condition.id){
params.param.id = condition.id
if (condition) {
if (condition.id) {
params.param.id = condition.id;
}
if(condition.name){
params.param.name = condition.name
if (condition.name) {
params.param.name = condition.name;
}
if(condition.recStatus){
params.param.recStatus = condition.recStatus
if (condition.recStatus) {
params.param.recStatus = condition.recStatus;
}
if(condition.serviceType){
params.param.serviceType = condition.serviceType
if (condition.serviceType) {
params.param.serviceType = condition.serviceType;
}
}
console.log('params',params)
console.log('params', params);
const res = await getInnovativeServiceSearch(params);
const { code, msg, data } = res.data;
if (code === 200) {
@ -73,6 +71,6 @@ export default {
this.$message.error(error);
}
},
}
},
};
</script>

Loading…
Cancel
Save