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. 93
      src/components/SpinOff/SpinOffDate.vue
  9. 182
      src/components/SpinOff/SpinOffEdit.vue
  10. 17
      src/components/SpinOff/SpinOffSearch.vue
  11. 190
      src/components/innovativeService/innovativeServiceAdd.vue
  12. 102
      src/components/innovativeService/innovativeServiceDate.vue
  13. 46
      src/components/innovativeService/innovativeServiceSearch.vue
  14. 20
      src/config/api.js
  15. 2
      src/plugins/ant-design-vue.js
  16. 21
      src/views/CooperationIntention/CooperationIntention.vue
  17. 32
      src/views/DemandFilling/DemandFilling.vue
  18. 22
      src/views/InnovativeService/InnovativeService.vue

31
src/components/Banner/BannerDate.vue

@ -44,7 +44,7 @@
<script> <script>
import BannerEdit from 'components/Banner/BannerEdit.vue'; import BannerEdit from 'components/Banner/BannerEdit.vue';
// import { delTeam } from 'config/api'; import { deleteCarousel } from 'config/api';
const columns = [ const columns = [
{ {
@ -144,6 +144,7 @@ export default {
methods: { methods: {
showEditModal(record) { showEditModal(record) {
console.log('record: ', record);
this.editItem = record; this.editItem = record;
this.editVisible = true; this.editVisible = true;
}, },
@ -157,29 +158,21 @@ export default {
this.$emit('getListData', condition); this.$emit('getListData', condition);
}, },
// //
async onDelete(teamId) { async onDelete(id) {
try { try {
// const params = { param: { teamId } }; const params = { param: { id } };
// const res = await delTeam(params); const res = await deleteCarousel(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('getListData');
// 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 || '删除失败');
} }
}, },
//
openSignUp() {
const { query } = this.$route;
this.$router.push({ path: '/sign-up', query });
},
}, },
}; };
</script> </script>

37
src/components/Banner/BannerEdit.vue

@ -21,7 +21,7 @@
</a-form-item> --> </a-form-item> -->
<!-- 跳转类型 --> <!-- 跳转类型 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="跳转类型"> <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-option :key="item" :value="index" v-for="(item, index) in enable1">{{ item }}</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
@ -32,24 +32,24 @@
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="图片跳转路径" 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>
<!-- 状态 --> <!-- 状态 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="状态"> <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-option :key="item" :value="index" v-for="(item, index) in enable">{{ item }}</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<!-- 页面显示位置 --> <!-- 页面显示位置 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="页面显示位置"> <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-option :key="item.page" :value="item.page" v-for="item in enable2">{{ item.name }}</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<!-- 图片 --> <!-- 图片 -->
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="图片"> <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-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-upload>
</a-form-item> </a-form-item>
<a-form-item class="d-flex flex-row-reverse"> <a-form-item class="d-flex flex-row-reverse">
@ -150,28 +150,21 @@ export default {
} }
return isJpgOrPng; return isJpgOrPng;
}, },
}; editData: {
}, jumpType: '',
watch: { jumpUrl: '',
editItem(val) { recStatus: '',
console.log(val); showPage: '',
url: '',
}, },
};
}, },
methods: { methods: {
// //
getUse(e, str) { getUse(e, str) {
this.editItem[str] = e; this.editData[str] = e;
if (str === 'jumpType' && e === 0) { if (str === 'jumpType' && e === 0) {
this.editItem.jumpUrl = ''; this.editData.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 '';
}
} }
}, },
// //
@ -185,7 +178,7 @@ export default {
}, },
// //
handleSubmit(e) { handleSubmit(e) {
console.log(this.editItem); console.log(this.editData);
e.preventDefault(); e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => { this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) { 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> <template>
<div class="main flex-1"> <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 <a-table
:columns="columns" :columns="columns"
:data-source="lists" :data-source="lists.list"
:pagination="pagination"
:loading="loading" :loading="loading"
:row-key="record => record.id" :row-key="record => record.id"
:scroll="{ y: height }" :scroll="{ y: height }"
@change="handleTableChange"
bordered bordered
class="white" class="white"
> >
@ -14,34 +16,34 @@
<span>{{ index + 1 }}</span> <span>{{ index + 1 }}</span>
</template> </template>
<template slot="teamNumber"> <template slot="status" slot-scope="text, record">
<a-button @click="openTeamMember" size="small" type="primary">团队成员</a-button> <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>
<template slot="edit" slot-scope="text, record"> <template slot="type" slot-scope="text, record">
<a-icon @click="showEditModal(record)" class="pointer" theme="twoTone" type="edit" /> <span v-if="record.type === 0">服务</span>
<a-popconfirm @confirm="() => onDelete(record.id)" title="确定要删除这一条?" v-if="lists.length"> <span v-else-if="record.type === 1">设备</span>
<a-icon class="ml-4 pointer" theme="twoTone" two-tone-color="#ff0000" type="delete" /> <span v-else-if="record.type === 2">成果</span>
</a-popconfirm>
</template> </template>
<p <template slot="edit" slot-scope="text, record">
slot="expandedRowRender" <a-icon @click="showEditModal(record.id, record.status)" class="pointer" theme="twoTone" type="edit" />
slot-scope="record" </template>
style="margin: 0"
>团队简介{{ record.shortDesc }}</p>
</a-table> </a-table>
</div> </div>
<a-empty v-else /> <a-empty v-else />
<a-modal title="修改审核状态" :visible="editVisible" :confirm-loading="confirmLoading" @ok="onDelete" @cancel="handleCancel">
<!-- 编辑 --> <a-select @change="getStatus" class="ml-3" style="width: 250px">
<r-d-edit :editItem="editItem" :editVisible="editVisible" @closeModal="closeModal" /> <a-select-option :key="item" :value="index" v-for="(item, index) in enable">{{ item }}</a-select-option>
</a-select>
</a-modal>
</div> </div>
</template> </template>
<script> <script>
import RDEdit from "components/RD/RDEdit.vue"; import { serviceApplyStatus } from 'config/api';
import { delTeam } from 'config/api';
const columns = [ const columns = [
{ {
@ -53,38 +55,51 @@ const columns = [
scopedSlots: { customRender: 'id' }, scopedSlots: { customRender: 'id' },
}, },
{ {
title: '团队名称', title: '公司名称',
align: 'center', align: 'center',
dataIndex: 'enterpriseName', dataIndex: 'companyName',
key: 'enterpriseName', key: 'companyName',
}, },
{ {
title: '团队带头人', title: '联系人',
align: 'center', align: 'center',
dataIndex: 'name', dataIndex: 'contactName',
key: 'name', key: 'contactName',
}, },
{ {
title: '依托单位', title: '联系电话',
align: 'center', align: 'center',
dataIndex: 'supportUnit', dataIndex: 'contactPhone',
key: 'supportUnit', key: 'contactPhone',
}, },
{ {
title: '研究方向', title: '合作信息简述',
align: 'center', align: 'center',
dataIndex: 'researchDirection', dataIndex: 'description',
key: 'researchDirection', key: 'description',
}, },
{ {
title: '团队成员', title: '服务名',
align: 'center', align: 'center',
dataIndex: 'teamNumber', dataIndex: 'name',
key: 'teamNumber', key: 'name',
scopedSlots: { customRender: 'teamNumber' },
}, },
{ {
title: '编辑', title: '申请状态',
align: 'center',
dataIndex: 'status',
key: 'status',
scopedSlots: { customRender: 'status' },
},
{
title: '申请类型',
align: 'center',
dataIndex: 'type',
key: 'type',
scopedSlots: { customRender: 'type' },
},
{
title: '修改处理状态',
align: 'center', align: 'center',
dataIndex: 'edit', dataIndex: 'edit',
key: 'edit', key: 'edit',
@ -93,13 +108,18 @@ const columns = [
]; ];
export default { export default {
name: "EnterpriseDate", name: 'EnterpriseDate',
components: { props: {
RDEdit, lists: {
type: Object,
default: () => {},
},
pagination: {
type: Object,
default: () => {},
},
}, },
props: { lists: { type: Array, default: () => [] } },
data() { data() {
this.cacheData = this.lists.map(item => ({ ...item }));
return { return {
columns, columns,
loading: false, loading: false,
@ -107,49 +127,67 @@ export default {
height: '', height: '',
fullHeight: '', fullHeight: '',
editVisible: false, editVisible: false,
editItem: null, // confirmLoading: false,
} delId: '',
dealStatus: '',
enable: ['未处理', '处理中', '已处理'],
};
}, },
mounted() { 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: { methods: {
showEditModal(record){ handleTableChange(pagination) {
console.log('record: ', record); const { current, pageSize } = pagination;
this.editItem = record; const condition = { current, pageSize };
this.editVisible = true; this.$emit('searchServiceApply', condition);
}, },
handleCancel() {
closeModal(){
this.editVisible = false; this.editVisible = false;
this.delId = '';
this.dealStatus = '';
}, },
showEditModal(id, status) {
// this.delId = id;
async onDelete(teamId) { this.dealStatus = status;
this.editVisible = true;
},
getStatus(e) {
this.dealStatus = e;
},
//
async onDelete() {
try { try {
const params = { param: { teamId } }; const params = {
const res = await delTeam(params); param: {
id: this.delId,
status: this.dealStatus,
},
};
const res = await serviceApplyStatus(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('searchServiceApply');
this.lists = arr.filter(item => item.id !== teamId); this.editVisible = false;
// TODO: // TODO:
} else { } else {
throw msg; throw msg;
} }
} catch (error) { } catch (error) {
this.$message.error(error || '删除失败'); this.$message.error(error || '修改失败');
} }
}, },
//
openTeamMember(){
const { query } = this.$route;
this.$router.push({ path: '/RD-team-member', query });
}
}, },
}; };
</script> </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 class="d-flex flex-wrap pb-3">
<!-- 团队名称 --> <!-- 团队名称 -->
<div> <div>
<a-input <a-input placeholder="公司名称" style="width: 150px" v-model="paramData.companyName" allow-clear />
@change="handleChangeName" <a-input placeholder="联系人" class="ml-3" style="width: 150px" v-model="paramData.contactName" allow-clear />
placeholder="团队名称" <a-input placeholder="联系电话" class="ml-3" style="width: 150px" v-model="paramData.contactPhone" allow-clear />
style="width: 150px" <!-- 跳转类型 -->
v-model="teamName" <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> <a-button @click="handleTableChange" class="mx-2" type="primary">搜索</a-button>
</div> </div>
<div class="flex-1"></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> </div>
</template> </template>
<script> <script>
import RDAdd from 'components/RD/RDAdd.vue';
import { selLikeTeam } from 'config/api'; import { selLikeTeam } from 'config/api';
export default { export default {
name: 'RDSearch', name: 'RDSearch',
components: {
RDAdd,
},
data() { data() {
return { return {
visible: false, visible: false,
teamName: '', paramData: {
companyName: '',
contactName: '',
contactPhone: '',
type: '',
},
typeList: ['服务', '设备', '成果'],
}; };
}, },
methods: { methods: {
showModal() { cahngeType(e) {
this.visible = true; console.log(e);
}, if (e === undefined) {
this.paramData.type = '';
closeModal() { } else {
this.visible = false; this.paramData.type = e;
}
}, },
handleChangeName(e) { handleChangeName(e) {
this.teamName = e.target.value; this.teamName = e.target.value;
}, },
async handleTableChange() { handleTableChange() {
try { this.$emit('searchServiceApply', this.paramData);
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);
}
}, },
}, },
}; };

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>

93
src/components/SpinOff/SpinOffDate.vue

@ -1,20 +1,12 @@
<template> <template>
<div class="main flex-1"> <div class="main flex-1">
<div style="width: 100%" v-if="lists && lists.length > 0"> <div style="width: 100%" v-if="lists && lists.length > 0">
<a-table <a-table :columns="columns" :data-source="lists" :loading="loading" :row-key="record => record.id" bordered class="white">
:columns="columns"
:data-source="lists"
:loading="loading"
:row-key="record => record.id"
bordered
class="white"
>
<template slot="id" slot-scope="text, record, index"> <template slot="id" slot-scope="text, record, index">
<span>{{ index + 1 }}</span> <span>{{ index + 1 }}</span>
</template> </template>
<template slot="position" slot-scope="text, record"> <template slot="position" slot-scope="text, record">
<span v-if="record.position === 0">功能食品协同创新中心</span> <span v-if="record.position === 0">功能食品协同创新中心</span>
<span v-if="record.position === 1">现代医药</span> <span v-if="record.position === 1">现代医药</span>
<span v-if="record.position === 2">生物医学工程</span> <span v-if="record.position === 2">生物医学工程</span>
@ -23,41 +15,27 @@
</template> </template>
<template slot="dealStatus" slot-scope="text, record"> <template slot="dealStatus" slot-scope="text, record">
<!-- <a-tag <a-tag color="red" v-if="record.dealStatus === 0">未处理</a-tag>
:color="record.dealStatus === 1 ? 'blue' : 'red'" <a-tag color="blue" v-if="record.dealStatus === 1">审核通过</a-tag>
>{{ record.dealStatus === 0 ? '未审核' : '不通过' }}</a-tag> --> <a-tag color="red" v-if="record.dealStatus === 2">审核未通过</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>
</template> </template>
<template slot="edit" slot-scope="text, record"> <template slot="edit" slot-scope="text, record">
<a-icon @click="showEditModal" class="pointer" theme="twoTone" type="edit" /> <a-icon @click="showEditModal(record.id, record.dealStatus)" 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> </template>
</a-table> </a-table>
</div> </div>
<a-empty v-else /> <a-empty v-else />
<a-modal title="修改审核状态" :visible="editVisible" :confirm-loading="confirmLoading" @ok="onDelete" @cancel="handleCancel">
<!-- 编辑 --> <a-select @change="getStatus" class="ml-3" style="width: 250px">
<spin-off-edit :editVisible="editVisible" @closeModal="closeModal" /> <a-select-option :key="item" :value="index" v-for="(item, index) in enable">{{ item }}</a-select-option>
</a-select>
</a-modal>
</div> </div>
</template> </template>
<script> <script>
import SpinOffEdit from "components/SpinOff/SpinOffEdit.vue"; import { getCreatingPlatformstatusUpdate } from 'config/api';
import {getCreatingPlatformDelete} from "config/api"
const columns = [ const columns = [
{ {
@ -125,7 +103,7 @@ const columns = [
scopedSlots: { customRender: 'dealStatus' }, scopedSlots: { customRender: 'dealStatus' },
}, },
{ {
title: '编辑', title: '修改审核状态',
align: 'center', align: 'center',
dataIndex: 'edit', dataIndex: 'edit',
key: 'edit', key: 'edit',
@ -145,14 +123,11 @@ const lists = [
logo: 'assets/logo.png', logo: 'assets/logo.png',
companyName: '中绿环保', companyName: '中绿环保',
englishName: 'zlhb', englishName: 'zlhb',
} },
]; ];
export default { export default {
name: "SpinOffDate", name: 'SpinOffDate',
components: {
SpinOffEdit,
},
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } }, props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } },
@ -162,9 +137,13 @@ export default {
columns, columns,
loading: false, loading: false,
height: '', height: '',
confirmLoading: false,
editVisible: false, editVisible: false,
imgVisible: false, imgVisible: false,
} delId: '',
dealStatus: '',
enable: ['未处理', '审核通过', '审核未通过'],
};
}, },
mounted() { mounted() {
@ -172,31 +151,39 @@ export default {
}, },
methods: { methods: {
showEditModal(){ showEditModal(id, dealStatus) {
this.editVisible = true; this.editVisible = true;
this.delId = id;
this.dealStatus = dealStatus;
}, },
handleCancel() {
closeModal(){
this.editVisible = false; this.editVisible = false;
this.delId = '';
this.dealStatus = '';
}, },
getStatus(e) {
// this.dealStatus = e;
async onDelete(id) { },
//
async onDelete() {
try { try {
const params = { param: { id } }; const params = {
const res = await getCreatingPlatformDelete(params); param: {
id: this.delId,
dealStatus: this.dealStatus,
},
};
const res = await getCreatingPlatformstatusUpdate(params);
const { data, msg, code } = res.data; const { data, msg, code } = res.data;
if (code === 200) { if (code === 200) {
this.$message.success('删除成功');
this.$emit('getCreatingPlatformSearch'); this.$emit('getCreatingPlatformSearch');
// const arr = [...this.lists]; this.editVisible = false;
// this.lists = arr.filter(item => item.id !== teamId); this.$message.success('修改成功');
// TODO:
} else { } else {
throw msg; throw msg;
} }
} catch (error) { } 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 class="d-flex flex-wrap pb-3">
<!-- 企业名称 --> <!-- 企业名称 -->
<div> <div>
<a-input placeholder="单位名称" style="width: 150px" v-model="companyName" /> <a-input placeholder="单位名称" style="width: 150px" v-model="companyName" allow-clear />
<a-input placeholder="单位性质" style="width: 150px" v-model="companyType" /> <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> <a-button @click="handleTableChange" class="ml-3" type="primary">搜索</a-button>
</div> </div>
<div class="flex-1"></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> </div>
</template> </template>
<script> <script>
import SpinOffAdd from 'components/SpinOff/SpinOffAdd.vue';
export default { export default {
name: 'SpinOffSearch', name: 'SpinOffSearch',
components: {
SpinOffAdd,
},
data() { data() {
return { return {
visible: false, visible: false,
@ -53,8 +43,7 @@ export default {
companyName, companyName,
companyType, companyType,
}; };
await this.$emit('getSelectTeam', condition); await this.$emit('getCreatingPlatformSearch', condition);
this.activityType = [];
}, },
}, },
}; };

190
src/components/innovativeService/innovativeServiceAdd.vue

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

102
src/components/innovativeService/innovativeServiceDate.vue

@ -1,12 +1,14 @@
<template> <template>
<div class="main flex-1"> <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 <a-table
:columns="columns" :columns="columns"
:data-source="lists" :data-source="lists.list"
:loading="loading" :loading="loading"
:row-key="record => record.id" :row-key="record => record.id"
:scroll="{ y: height }" :scroll="{ y: height }"
:pagination="pagination"
@change="handleTableChange"
bordered bordered
class="white" class="white"
> >
@ -15,7 +17,7 @@
</template> </template>
<template slot="picUrl" slot-scope="text, record"> <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>
<template slot="serviceType" slot-scope="text, record"> <template slot="serviceType" slot-scope="text, record">
@ -26,7 +28,7 @@
<template slot="edit" slot-scope="text, record"> <template slot="edit" slot-scope="text, record">
<a-icon @click="showEditModal" class="pointer" theme="twoTone" type="edit" /> <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-icon class="ml-4 pointer" theme="twoTone" two-tone-color="#ff0000" type="delete" />
</a-popconfirm> </a-popconfirm>
</template> </template>
@ -40,8 +42,8 @@
</template> </template>
<script> <script>
import RDMemberEdit from "components/innovativeService/innovativeServiceEdit.vue"; import RDMemberEdit from 'components/innovativeService/innovativeServiceEdit.vue';
import { deleteService } from 'config/api';
const columns = [ const columns = [
{ {
title: '序号', title: '序号',
@ -68,13 +70,7 @@ const columns = [
align: 'center', align: 'center',
dataIndex: 'picUrl', dataIndex: 'picUrl',
key: 'picUrl', key: 'picUrl',
    scopedSlots: { customRender: 'picUrl' }, scopedSlots: { customRender: 'picUrl' },
},
{
title: '服务状态',
align: 'center',
dataIndex: 'recStatus',
key: 'recStatus',
}, },
{ {
title: '服务类型', title: '服务类型',
@ -83,21 +79,13 @@ const columns = [
key: 'serviceType', key: 'serviceType',
scopedSlots: { customRender: 'serviceType' }, scopedSlots: { customRender: 'serviceType' },
}, },
{
// { title: '服务排序',
// title: '/', align: 'center',
// align: 'center', dataIndex: 'orders',
// dataIndex: 'jobTitle', key: 'orders',
// key: 'jobTitle', scopedSlots: { customRender: 'orders' },
// scopedSlots: { customRender: 'jobTitle' }, },
// },
// {
// title: '',
// align: 'center',
// dataIndex: 'researchDirection',
// key: 'researchDirection',
// scopedSlots: { customRender: 'researchDirection' },
// },
{ {
title: '编辑', title: '编辑',
align: 'center', 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 { export default {
name: "innovativeServiceDate", name: 'innovativeServiceDate',
components: { components: {
RDMemberEdit, RDMemberEdit,
}, },
@ -144,8 +109,8 @@ export default {
loading: false, loading: false,
editingKey: '', editingKey: '',
height: '', height: '',
editVisible: false editVisible: false,
} };
}, },
mounted() { mounted() {
@ -168,21 +133,24 @@ export default {
closeModal() { closeModal() {
this.editVisible = false; this.editVisible = false;
}, },
handleTableChange(pagination) {
const { current, pageSize } = pagination;
const condition = { current, pageSize };
this.$emit('getInnovativeServiceSearch', condition);
},
// //
async onDelete(teamId) { async onDelete(id) {
try { try {
const params = { param: { teamId } }; const params = { param: { id } };
// const res = await delTeam(params); const res = await deleteService(params);
// const { data, msg, code } = res.data; const { data, msg, code } = res.data;
// if (code === 200) { if (code === 200) {
// this.$message.success(''); this.$emit('getInnovativeServiceSearch');
// const arr = [...this.lists]; this.$message.success('删除成功');
// this.lists = arr.filter(item => item.id !== teamId); // TODO:
// // TODO: } else {
// } else { throw msg;
// throw msg; }
// }
} catch (error) { } catch (error) {
this.$message.error(error || '删除失败'); this.$message.error(error || '删除失败');
} }

46
src/components/innovativeService/innovativeServiceSearch.vue

@ -2,44 +2,31 @@
<div class="d-flex flex-wrap pb-3"> <div class="d-flex flex-wrap pb-3">
<!-- 团队名称 --> <!-- 团队名称 -->
<div> <div>
<a-input <a-input placeholder="服务名称" style="width: 150px" v-model="name" allow-clear />
<!-- <span class="ml-3"> 服务类型:</span>
placeholder="服务名称" <a-select @change="handleChangeSelect('serviceType', $event)" class="ml-3" style="width: 150px" placeholder="三大平台" allow-clear>
style="width: 150px" <a-select-option :key="serviceType.id" :value="serviceType.id" v-for="serviceType in serviceTypes">{{
v-model="name" 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> <a-button @click="handleTableChange" class="mx-2" type="primary">搜索</a-button>
</div> </div>
<div class="flex-1"></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> </div>
</template> </template>
<script> <script>
import RDMemberAdd from "components/innovativeService/innovativeServiceAdd.vue"; import RDMemberAdd from 'components/innovativeService/innovativeServiceAdd.vue';
export default { export default {
name: "innovativeServiceSearch", name: 'innovativeServiceSearch',
components: { components: {
RDMemberAdd, RDMemberAdd,
}, },
@ -52,7 +39,7 @@ export default {
{ id: 2, value: '孵化平台' }, { id: 2, value: '孵化平台' },
{ id: 3, value: '产业平台' }, { id: 3, value: '产业平台' },
], ],
} };
}, },
methods: { methods: {
showModal() { showModal() {
@ -75,12 +62,13 @@ export default {
async handleTableChange() { async handleTableChange() {
console.log('搜索'); console.log('搜索');
const { name, serviceType } = this; const { name, serviceType } = this;
console.log(name,serviceType) console.log(name, serviceType);
// //
const condition = { const condition = {
name,serviceType name,
} serviceType,
await this.$emit('getInnovativeServiceSearch',condition) };
await this.$emit('getInnovativeServiceSearch', condition);
this.activityType = []; this.activityType = [];
}, },
}, },

20
src/config/api.js

@ -20,6 +20,7 @@ const creatingPlatform = `${greenvalley}/creatingPlatform`; // 合作意向相
const serviceProject = `${greenvalley}/serviceProject`; // 创新部服务相关操作 const serviceProject = `${greenvalley}/serviceProject`; // 创新部服务相关操作
const institute = `${greenvalley}/institute`; // 实验室(研究院)相关操作 const institute = `${greenvalley}/institute`; // 实验室(研究院)相关操作
const achInstr = `${greenvalley}/achInstr`; // 创新部类型相关操作 const achInstr = `${greenvalley}/achInstr`; // 创新部类型相关操作
const service = `${greenvalley}/service`; // 三大平台相关接口
// websocket基础地址 // websocket基础地址
export const WS_BASE_URL = msgUrl; 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 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 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); 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 deletePage = params => axios.post(`${page}/delete`, params);
// 查询轮播图列表 // 查询轮播图列表
export const queryCarousel = params => axios.post(`${carousel}/queryCarousel`, params); export const queryCarousel = params => axios.post(`${carousel}/queryCarousel`, params);
// 查询轮播图列表 // 查询轮播图列表
export const addCarousel = params => axios.post(`${carousel}/addCarousel`, 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, Spin,
Tooltip, Tooltip,
Popover, Popover,
inputNumber,
} from 'ant-design-vue'; } from 'ant-design-vue';
import { ConfigProvider } from 'ant-design-vue'; import { ConfigProvider } from 'ant-design-vue';
Vue.component(ConfigProvider.name, ConfigProvider); Vue.component(ConfigProvider.name, ConfigProvider);
@ -49,6 +50,7 @@ Vue.use(Checkbox);
Vue.use(Spin); Vue.use(Spin);
Vue.use(Tooltip); Vue.use(Tooltip);
Vue.use(Popover); Vue.use(Popover);
Vue.use(inputNumber);
Vue.prototype.$message = message; Vue.prototype.$message = message;
Vue.prototype.$notification = notification; Vue.prototype.$notification = notification;

21
src/views/CooperationIntention/CooperationIntention.vue

@ -6,12 +6,12 @@
</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'; import { getCreatingPlatformSearch } from 'config/api';
export default { export default {
name: "DerivativeSpinOffs", name: 'DerivativeSpinOffs',
components: { components: {
SpinOffSearch, SpinOffSearch,
SpinOffDate, SpinOffDate,
@ -25,7 +25,7 @@ export default {
}, },
created() { created() {
this.getCreatingPlatformSearch() this.getCreatingPlatformSearch();
}, },
methods: { methods: {
@ -33,6 +33,8 @@ created() {
try { try {
const params = { const params = {
param: { param: {
companyName: condition && condition.companyName ? condition.companyName : '',
companyType: condition && condition.companyType ? condition.companyType : '',
pageNum: (condition && condition.current) || 1, pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10, pageSize: (condition && condition.pageSize) || 10,
}, },
@ -40,17 +42,17 @@ created() {
if (condition) { if (condition) {
if (condition.companyName) { if (condition.companyName) {
params.param.companyName = condition.companyName params.param.companyName = condition.companyName;
} }
if (condition.companyType) { if (condition.companyType) {
params.param.companyType = condition.companyType params.param.companyType = condition.companyType;
} }
} }
const res = await getCreatingPlatformSearch(params); const res = await getCreatingPlatformSearch(params);
const { code, msg, data } = res.data; const { code, msg, data } = res.data;
if (code === 200) { if (code === 200) {
console.log(data) console.log(data);
this.lists = data.list; this.lists = data.list;
const paper = { ...this.pagination }; const paper = { ...this.pagination };
paper.current = data.pageNum; paper.current = data.pageNum;
@ -63,8 +65,7 @@ created() {
} catch (error) { } catch (error) {
this.$message.error(error); this.$message.error(error);
} }
},
} },
}
}; };
</script> </script>

32
src/views/DemandFilling/DemandFilling.vue

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

22
src/views/InnovativeService/InnovativeService.vue

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

Loading…
Cancel
Save