Browse Source

实验室/设备对接口

master
lucky 4 years ago
parent
commit
5d3aa0fce7
  1. 31
      src/components/Banner/BannerDate.vue
  2. 41
      src/components/Banner/BannerEdit.vue
  3. 221
      src/components/Challenge/ChallengeAdd.vue
  4. 192
      src/components/Challenge/ChallengeDate.vue
  5. 193
      src/components/Challenge/ChallengeEdit.vue
  6. 43
      src/components/Challenge/ChallengeSearch.vue
  7. 239
      src/components/Course/CourseAdd.vue
  8. 200
      src/components/Course/CourseDate.vue
  9. 213
      src/components/Course/CourseEdit.vue
  10. 43
      src/components/Course/CourseSearch.vue
  11. 168
      src/components/RD/RDDate.vue
  12. 60
      src/components/RD/RDSearch.vue
  13. 116
      src/components/SpinOff/SpinOffDate.vue
  14. 17
      src/components/SpinOff/SpinOffSearch.vue
  15. 222
      src/components/innovativeService/innovativeServiceAdd.vue
  16. 134
      src/components/innovativeService/innovativeServiceDate.vue
  17. 199
      src/components/innovativeService/innovativeServiceEdit.vue
  18. 46
      src/components/innovativeService/innovativeServiceSearch.vue
  19. 26
      src/config/api.js
  20. 2
      src/plugins/ant-design-vue.js
  21. 57
      src/views/CooperationIntention/CooperationIntention.vue
  22. 32
      src/views/DemandFilling/DemandFilling.vue
  23. 57
      src/views/IncubationServices/IncubationServices.vue
  24. 57
      src/views/IndustrialServices/IndustrialServices.vue
  25. 39
      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>

41
src/components/Banner/BannerEdit.vue

@ -35,10 +35,10 @@
label="跳转类型" label="跳转类型"
> >
<a-select <a-select
:default-value="enable1[editItem.jumpType]"
@change="getUse($event, 'jumpType')" @change="getUse($event, 'jumpType')"
class="ml-3" class="ml-3"
style="width: 150px" placeholder="请选择想要修改的跳转类型"
style="width: 200px"
> >
<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>
@ -50,7 +50,7 @@
label="图片跳转路径" label="图片跳转路径"
v-if="editItem.jumpType === 1" v-if="editItem.jumpType === 1"
> >
<a-input class="ml-3" placeholder="图片跳转路径" v-model="editItem.jumpUrl" /> <a-input class="ml-3" placeholder="图片跳转路径" v-model="editData.jumpUrl" />
</a-form-item> </a-form-item>
<!-- 状态 --> <!-- 状态 -->
<a-form-item <a-form-item
@ -59,10 +59,10 @@
label="状态" label="状态"
> >
<a-select <a-select
:default-value="enable[editItem.recStatus]"
@change="getUse($event, 'recStatus')" @change="getUse($event, 'recStatus')"
class="ml-3" class="ml-3"
style="width: 150px" placeholder="请选择想要修改的状态"
style="width: 200px"
> >
<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>
@ -74,9 +74,9 @@
label="页面显示位置" label="页面显示位置"
> >
<a-select <a-select
:default-value="editItem.showPage"
@change="getUse($event, 'showPage')" @change="getUse($event, 'showPage')"
class="ml-3" class="ml-3"
placeholder="请选择想要修改的页面显示位置"
style="width: 100%" style="width: 100%"
> >
<a-select-option <a-select-option
@ -101,7 +101,7 @@
name="files" name="files"
> >
<a-button v-show="fileList.length - 0 === 0"> <a-button v-show="fileList.length - 0 === 0">
<a-icon type="upload" />选择图片 <a-icon type="upload" />更换图片
</a-button> </a-button>
</a-upload> </a-upload>
</a-form-item> </a-form-item>
@ -203,28 +203,21 @@ export default {
} }
return isJpgOrPng; return isJpgOrPng;
}, },
editData: {
jumpType: '',
jumpUrl: '',
recStatus: '',
showPage: '',
url: '',
},
}; };
}, },
watch: {
editItem(val) {
console.log(val);
},
},
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 '';
}
} }
}, },
// //
@ -238,7 +231,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) {

221
src/components/Challenge/ChallengeAdd.vue

@ -11,84 +11,118 @@
width="700px" width="700px"
> >
<a-form :form="form" @submit="handleSubmit"> <a-form :form="form" @submit="handleSubmit">
<!-- 来源 --> <!-- 服务名称 -->
<a-form-item <a-form-item
:label-col="formItemLayout.labelCol" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="来源" label="服务名称"
> >
<a-radio-group @change="getSource" v-model="source"> <a-input
<a-radio :value="1">平台</a-radio> @change="changeIpt($event, 'serviceName')"
<a-radio :value="2">用户</a-radio> class="ml-3"
</a-radio-group> placeholder="服务名称"
v-decorator="[
'serviceName',
{
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" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="标题" label="服务简介"
> >
<a-input <a-textarea
placeholder="标题" @change="changeIpt($event, 'intro')"
class="ml-3"
placeholder="服务简介"
v-decorator="[ v-decorator="[
'superiorType', '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" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="内容" label="服务内容"
> >
<a-textarea <a-textarea
placeholder="内容" @change="changeIpt($event, 'content')"
class="ml-3"
placeholder="服务内容"
v-decorator="[ v-decorator="[
'content', 'content',
]" {
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" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="发布时间" label="服务排序"
> >
<a-date-picker <a-input-number class="ml-3" v-model="orders" />
@change="onChange"
format="YYYY/MM/DD HH:mm:ss"
show-time
style="width:100%"
/>
</a-form-item> </a-form-item>
<!-- 发布人姓名 --> <!-- 图片 -->
<a-form-item <a-form-item
:label-col="formItemLayout.labelCol" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="发布人姓名" label="图片"
> >
<a-input <a-upload
placeholder="发布人姓名" :action="upload"
v-decorator="[ :before-upload="beforeUpload"
'publisher', @change="handleChange"
{ class="ml-3"
rules: [ list-type="picture"
{ required: true, message: '发布人姓名不能为空' }, name="files"
{ whitespace: true, message: '发布人姓名不能为空' }, >
{ max: 140, massage: '发布人姓名最多140个字符' }, <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>
<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>
@ -99,6 +133,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 },
@ -113,44 +149,79 @@ export default {
return { return {
formItemLayout, formItemLayout,
tailItemLayout, tailItemLayout,
form: this.$form.createForm(this, { name: 'challenge-add' }), form: this.$form.createForm(this, { name: 'r-d-member-add' }),
source: 1, upload: upload,
releaseTime: '', // 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: {
// //
getSource(value) { handleChange(info) {
this.source = value; // 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;
onChange(dates, dateStrings) { },
console.log('From: ', dates[0], ', to: ', dates[1]); getUse(e, str) {
console.log('From: ', dateStrings[0], ', to: ', dateStrings[1]); 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) {
try { if (this.fileList.length > 0) {
console.log('values: ', values); try {
// const params = this.generateParams(values); this.picId = this.fileList[0];
// const res = await createTask(params); const params = {
// const { data, msg, code } = res.data; param: {
// // name: this.serviceName,
// this.clearCreateTask(); content: this.content,
// this.$emit('closeDialog'); intro: this.intro,
// if (code === 200) { orders: this.orders,
// this.handleCreateSuccess(params.executorId); picId: this.picId,
// } else { recStatus: this.recStatus,
// throw msg; serviceType: 2,
// } },
} catch (error) { };
this.$message.error(error || '添加研发团队失败'); 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('请上传图片');
} }
} }
}); });

192
src/components/Challenge/ChallengeDate.vue

@ -1,11 +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"
:pagination="pagination"
:scroll="{ y: height }"
@change="handleTableChange"
bordered bordered
class="white" class="white"
> >
@ -13,38 +16,37 @@
<span>{{ index + 1 }}</span> <span>{{ index + 1 }}</span>
</template> </template>
<template slot="auditStatus" slot-scope="text, record"> <template slot="picUrl" slot-scope="text, record">
<a-tag :color="record.auditStatus === '通过' ? 'green' : 'red'">{{ record.auditStatus }}</a-tag> <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>
</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)" 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>
<div class="d-flex flex-nowrap justify-space-between" slot="expandedRowRender" slot-scope="record" style="margin: 0">
<template slot="examine" slot-scope="text, record"> {{ getselContent(record.id) }}
<a-button size="small" type="primary" v-if="record.auditStatus != '通过'">通过</a-button>
<a-button size="small" type="danger" v-else>不通过</a-button>
</template>
<div slot="expandedRowRender" slot-scope="record" style="margin: 0">
<div class="mb-2">内容{{ record.content }}</div>
<div>发布时间{{ record.content }}</div>
</div> </div>
</a-table> </a-table>
</div> </div>
<a-empty v-else /> <a-empty v-else />
<!-- 编辑 --> <!-- 编辑 -->
<challenge-edit :editVisible="editVisible" @closeModal="closeModal" /> <challenge-edit :edit-visible="editVisible" :edit-data="editData" @getData="getData" :contents="contents" @closeModal="closeModal" />
</div> </div>
</template> </template>
<script> <script>
import ChallengeEdit from "components/Challenge/ChallengeEdit.vue"; import ChallengeEdit from 'components/Challenge/ChallengeEdit.vue';
import { deleteService, selContent } from 'config/api';
const columns = [ const columns = [
{ {
title: '序号', title: '序号',
@ -55,42 +57,37 @@ const columns = [
scopedSlots: { customRender: 'id' }, scopedSlots: { customRender: 'id' },
}, },
{ {
title: '来源', title: '服务名称',
align: 'center', align: 'center',
dataIndex: 'source', dataIndex: 'name',
key: 'source', key: 'name',
}, },
{ {
title: '标题', title: '服务简介',
align: 'center', align: 'center',
dataIndex: 'title', dataIndex: 'intro',
key: 'title', key: 'intro',
}, },
// {
// title: '',
// align: 'center',
// dataIndex: 'releaseTime',
// key: 'releaseTime',
// scopedSlots: { customRender: 'releaseTime' },
// },
{ {
title: '发布人姓名', title: '服务图片',
align: 'center', align: 'center',
dataIndex: 'publisher', dataIndex: 'picUrl',
key: 'publisher', key: 'picUrl',
scopedSlots: { customRender: 'picUrl' },
}, },
{ {
title: '审核状态', title: '服务类型',
align: 'center', align: 'center',
dataIndex: 'auditStatus', dataIndex: 'serviceType',
key: 'auditStatus', key: 'serviceType',
scopedSlots: { customRender: 'auditStatus' }, scopedSlots: { customRender: 'serviceType' },
}, },
{ {
title: '审核人', title: '服务排序',
align: 'center', align: 'center',
dataIndex: 'checker', dataIndex: 'orders',
key: 'checker', key: 'orders',
scopedSlots: { customRender: 'orders' },
}, },
{ {
title: '编辑', title: '编辑',
@ -99,86 +96,95 @@ const columns = [
key: 'edit', key: 'edit',
scopedSlots: { customRender: 'edit' }, scopedSlots: { customRender: 'edit' },
}, },
{
title: '审核',
align: 'center',
dataIndex: 'examine',
key: 'examine',
scopedSlots: { customRender: 'examine' },
},
];
const lists = [
{
id:'001',
source:'平台',
title: '博士',
content: '内容内容内容内容内容',
releaseTime: '2020/11/18 15:00',
publisher: '张三',
auditStatus: '通过',
checker: '李四',
},
{
id:'002',
source:'用户',
title: '博士',
content: '内容内容内容内容内容',
releaseTime: '2020/11/18 15:00',
publisher: '张三',
auditStatus: '未通过',
checker: '李四',
}
]; ];
export default { export default {
name: "ChallengeDate", name: 'ChallengeDate',
components: { components: {
ChallengeEdit, ChallengeEdit,
}, },
// props: { lists: { type: Array, default: () => {} } },
props: { lists: { type: Object, default: () => {} }, pagination: { type: Object, default: () => {} } },
data() { data() {
this.cacheData = lists.map(item => ({ ...item }));
return { return {
columns, columns,
lists,
loading: false, loading: false,
editingKey: '', editingKey: '',
height: '', height: '',
editVisible: false editVisible: false,
} editData: null,
contents: '',
};
}, },
mounted() { mounted() {
this.height = document.getElementsByClassName('main')[0].offsetHeight - 150; let th = 250;
let wh = window.innerHeight;
this.height = wh - th;
window.onresize = () => {
return (() => {
wh = window.innerHeight;
this.height = wh - th;
})();
};
}, },
methods: { methods: {
showEditModal(){ showEditModal(data) {
this.editData = data;
this.contents = this.getselContent(data.id);
this.editVisible = true; this.editVisible = true;
}, },
closeModal(){ closeModal() {
this.editVisible = false; this.editVisible = false;
}, },
handleTableChange(pagination) {
const { current, pageSize } = pagination;
const condition = { current, pageSize };
this.$emit('getInnovativeServiceSearch', condition);
},
getData() {
this.$emit('getInnovativeServiceSearch');
},
// //
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 || '删除失败');
} }
}, },
//
getselContent(id) {
try {
const parmas = {
param: {
id: +id,
serviceType: 2,
},
};
const res = selContent(params);
const { code, msg, data } = res.data;
if (code === 200) {
// console.log(data);
return data.content;
} else {
return '暂无内容';
}
} catch (error) {
return '暂无内容';
}
},
}, },
}; };
</script> </script>

193
src/components/Challenge/ChallengeEdit.vue

@ -11,84 +11,76 @@
width="700px" width="700px"
> >
<a-form :form="form" @submit="handleSubmit"> <a-form :form="form" @submit="handleSubmit">
<!-- 来源 --> <!-- 服务名称 -->
<a-form-item <a-form-item
:label-col="formItemLayout.labelCol" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="来源" label="服务名称"
> >
<a-radio-group @change="getSource" v-model="source"> <a-input class="ml-3" placeholder="服务名称" v-model="serviceName" />
<a-radio :value="1">平台</a-radio>
<a-radio :value="2">用户</a-radio>
</a-radio-group>
</a-form-item> </a-form-item>
<!-- 标题 --> <!-- 服务简介 -->
<a-form-item <a-form-item
:label-col="formItemLayout.labelCol" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="标题" label="服务简介"
> >
<a-input <a-textarea class="ml-3" placeholder="服务简介" v-model="intro" />
placeholder="标题"
v-decorator="[
'superiorType',
{
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" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="内容" label="服务内容"
> >
<a-textarea <a-textarea class="ml-3" placeholder="服务内容" v-model="content" />
placeholder="内容"
v-decorator="[
'content',
]"
/>
</a-form-item> </a-form-item>
<!-- 发布时间 --> <!-- 服务排序 -->
<a-form-item <a-form-item
:label-col="formItemLayout.labelCol" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="发布时间" label="服务排序"
> >
<a-date-picker <a-input-number class="ml-3" v-model="orders" />
@change="onChange"
format="YYYY/MM/DD HH:mm:ss"
show-time
style="width:100%"
/>
</a-form-item> </a-form-item>
<!-- 发布人姓名 --> <!-- 图片 -->
<a-form-item <a-form-item
:label-col="formItemLayout.labelCol" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="发布人姓名" label="图片"
> >
<a-input <a-upload
placeholder="发布人姓名" :action="upload"
v-decorator="[ :before-upload="beforeUpload"
'publisher', @change="handleChange"
{ class="ml-3"
rules: [ list-type="picture"
{ required: true, message: '发布人姓名不能为空' }, name="files"
{ whitespace: true, message: '发布人姓名不能为空' }, >
{ max: 140, massage: '发布人姓名最多140个字符' }, <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>
<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>
@ -99,6 +91,8 @@
</template> </template>
<script> <script>
import { upload, updateService } from 'config/api';
const formItemLayout = { const formItemLayout = {
labelCol: { span: 6 }, labelCol: { span: 6 },
wrapperCol: { span: 16 }, wrapperCol: { span: 16 },
@ -108,49 +102,88 @@ const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default { export default {
name: 'ChallengeEdit', name: 'ChallengeEdit',
props: { editVisible: { type: Boolean, default: false } }, props: {
editVisible: { type: Boolean, default: false },
editData: { type: Object, default: () => {} },
contents: { type: String, default: '' },
},
data() { data() {
return { return {
formItemLayout, formItemLayout,
tailItemLayout, tailItemLayout,
form: this.$form.createForm(this, { name: 'challeng-edit' }), form: this.$form.createForm(this, { name: 'r-d-member-add' }),
source: 1, upload: upload,
releaseTime: '', // 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,
}; };
}, },
watch: {
editData(val) {
console.log(val);
},
},
methods: { methods: {
// //
getSource(value) { handleChange(info) {
this.source = value; // 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;
onChange(dates, dateStrings) { },
console.log('From: ', dates[0], ', to: ', dates[1]); getUse(e, str) {
console.log('From: ', dateStrings[0], ', to: ', dateStrings[1]); 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) {
try { try {
console.log('values: ', values); const params = {
// const params = this.generateParams(values); param: {
// const res = await createTask(params); id: this.editData.id,
// const { data, msg, code } = res.data; name: this.serviceName ? this.serviceName : this.editData.name,
// // content: this.content ? this.content : this.contents === '暂无内容' ? '' : this.contents,
// this.clearCreateTask(); intro: this.intro ? this.intro : this.editData.intro,
// this.$emit('closeDialog'); orders: this.orders ? this.orders : this.editData.orders,
// if (code === 200) { picId: this.picId ? this.picId : this.editData.picId,
// this.handleCreateSuccess(params.executorId); recStatus: this.recStatus,
// } else { serviceType: 2,
// throw msg; },
// } };
const res = await updateService(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$emit('getData');
this.$emit('closeModal');
this.$message.success('修改成功');
} else {
this.$message.error('修改失败');
}
} catch (error) { } catch (error) {
this.$message.error(error || '添加研发团队失败'); this.$message.error(error);
} }
} }
}); });

43
src/components/Challenge/ChallengeSearch.vue

@ -1,18 +1,22 @@
<template> <template>
<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="name" allow-clear />
<a-input @change="handleChangeSource" placeholder="来源" style="width: 150px" v-model="source" /> <span class="ml-3"> 服务状态:</span>
<a-select @change="handleChangeSelect" class="ml-3" style="width: 150px" placeholder="状态" allow-clear>
<a-select-option :key="item" :value="index" v-for="(item, index) in statusList">{{ 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="openUnveilingList" class="editable-add-btn">揭榜</a-button> <a-button type="primary" @click="showModal" class="editable-add-btn">增加</a-button>
<a-button @click="showModal" class="ml-3 editable-add-btn" type="primary">增加</a-button>
<!-- 添加 --> <!-- 添加 -->
<challenge-add :visible="visible" @closeModal="closeModal" /> <challenge-add :visible="visible" @closeModal="closeModal" @handleTableChange="handleTableChange" />
</div> </div>
</template> </template>
@ -27,7 +31,14 @@ export default {
data() { data() {
return { return {
visible: false, visible: false,
source: '', name: '',
serviceTypes: [
{ id: 1, value: '创新平台' },
{ id: 2, value: '孵化平台' },
{ id: 3, value: '产业平台' },
],
statusList: ['正常', '禁用'],
status111: '',
}; };
}, },
methods: { methods: {
@ -39,19 +50,21 @@ export default {
this.visible = false; this.visible = false;
}, },
handleChangeSource(value) { handleChangeSelect(e) {
console.log('value: ', value); // this[type] = value;
this.source = value; this.status111 = e;
}, },
// handleChangeName(value) {
openUnveilingList() { console.log('value: ', value);
const { query } = this.$route; this.name = value;
this.$router.push({ path: '/unveiling-list', query });
}, },
handleTableChange() { async handleTableChange() {
console.log('搜索'); const { name, status111 } = this;
//
const condition = { name, status111 };
await this.$emit('getInnovativeServiceSearch', condition);
}, },
}, },
}; };

239
src/components/Course/CourseAdd.vue

@ -11,62 +11,118 @@
width="700px" width="700px"
> >
<a-form :form="form" @submit="handleSubmit"> <a-form :form="form" @submit="handleSubmit">
<!-- 课程名称 --> <!-- 服务名称 -->
<a-form-item <a-form-item
:label-col="formItemLayout.labelCol" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="课程名称" label="服务名称"
> >
<a-input <a-input
placeholder="课程名称" @change="changeIpt($event, 'serviceName')"
class="ml-3"
placeholder="服务名称"
v-decorator="[ v-decorator="[
'courseName', '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" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="课程简介" label="服务简介"
> >
<a-textarea <a-textarea
placeholder="课程简介" @change="changeIpt($event, 'intro')"
class="ml-3"
placeholder="服务简介"
v-decorator="[ v-decorator="[
'courseProfile', 'intro',
]" {
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" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="介绍图片" label="服务内容"
>
<a-textarea
@change="changeIpt($event, 'content')"
class="ml-3"
placeholder="服务内容"
v-decorator="[
'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-number class="ml-3" v-model="orders" />
</a-form-item>
<!-- 图片 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="图片"
> >
<a-upload <a-upload
:action="upload"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:show-upload-list="false"
@change="handleChange" @change="handleChange"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76" class="ml-3"
class="avatar-uploader" list-type="picture"
list-type="picture-card" name="files"
name="avatar"
> >
<img :src="imageUrl" alt="avatar" v-if="imageUrl" /> <a-button v-show="fileList.length - 0 === 0">
<div v-else> <a-icon type="upload" />选择图片
<a-icon :type="loading ? 'loading' : 'plus'" /> </a-button>
<div class="ant-upload-text">Upload</div>
</div>
</a-upload> </a-upload>
</a-form-item> </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-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>
@ -77,16 +133,14 @@
</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 },
}; };
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } }; 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 { export default {
name: 'CourseAdd', name: 'CourseAdd',
@ -95,59 +149,79 @@ export default {
return { return {
formItemLayout, formItemLayout,
tailItemLayout, tailItemLayout,
form: this.$form.createForm(this, { name: 'course-add' }), form: this.$form.createForm(this, { name: 'r-d-member-add' }),
loading: false, upload: upload,
imageUrl: '', 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) { handleChange(info) {
if (info.file.status === 'uploading') { // this.fileList = fileList;
this.loading = true; console.log(info);
return;
}
if (info.file.status === 'done') { if (info.file.status === 'done') {
// Get this url from response in real world. this.fileList.push(info.file.response.data[0].id);
getBase64(info.file.originFileObj, imageUrl => { } else if (info.file.status === 'removed') {
this.imageUrl = imageUrl; this.fileList = info.fileList;
this.loading = false;
});
} }
}, },
beforeUpload(file) { changeIpt(e, str) {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'; this[str] = e.target.value;
if (!isJpgOrPng) { },
this.$message.error('You can only upload JPG file!'); getUse(e, str) {
} this[str] = e;
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
this.$message.error('Image must smaller than 2MB!');
}
return isJpgOrPng && isLt2M;
}, },
// //
handleSubmit(e) { handleSubmit(e) {
e.preventDefault(); e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => { this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) { if (!err) {
try { if (this.fileList.length > 0) {
console.log('values: ', values); try {
// const params = this.generateParams(values); this.picId = this.fileList[0];
// const res = await createTask(params); const params = {
// const { data, msg, code } = res.data; param: {
// // name: this.serviceName,
// this.clearCreateTask(); content: this.content,
// this.$emit('closeDialog'); intro: this.intro,
// if (code === 200) { orders: this.orders,
// this.handleCreateSuccess(params.executorId); picId: this.picId,
// } else { recStatus: this.recStatus,
// throw msg; serviceType: 3,
// } },
} catch (error) { };
this.$message.error(error || '添加研发团队失败'); 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('请上传图片');
} }
} }
}); });
@ -156,19 +230,4 @@ export default {
}; };
</script> </script>
<style scoped lang="stylus"> <style scoped lang="stylus"></style>
.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>

200
src/components/Course/CourseDate.vue

@ -1,11 +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"
:pagination="pagination"
:row-key="record => record.id" :row-key="record => record.id"
:scroll="{ y: height }"
@change="handleTableChange"
bordered bordered
class="white" class="white"
> >
@ -13,57 +16,50 @@
<span>{{ index + 1 }}</span> <span>{{ index + 1 }}</span>
</template> </template>
<!-- 头像 --> <template slot="picUrl" slot-scope="text, record">
<template slot="introductionPicture" slot-scope="text, record"> <img :src="record.picUrl" height="50" width="50" />
<img :src="record.introductionPicture" class="img" />
<a-modal
:imgVisible="imgVisible"
:maskClosable="false"
@cancel="imgVisible = false"
destroyOnClose
footer
title="身份证明"
>
<img :src="record.idCardPromise" @click="imgVisible = true" style="width: 100%;" />
</a-modal>
</template> </template>
<template slot="auditStatus" slot-scope="text, record"> <template slot="serviceType" slot-scope="text, record">
<a-tag :color="record.auditStatus === '通过' ? 'green' : 'red'">{{ record.auditStatus }}</a-tag> <span v-if="record.serviceType === 1">创新平台</span>
<span v-if="record.serviceType === 2">孵化平台</span>
<span v-if="record.serviceType === 3">产业平台</span>
</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)" 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>
<template slot="examine" slot-scope="text, record">
<a-button size="small" type="primary" v-if="record.auditStatus != '通过'">通过</a-button>
<a-button size="small" type="danger" v-else>不通过</a-button>
</template>
<div <div
class="d-flex flex-nowrap justify-space-between" class="d-flex flex-nowrap justify-space-between"
slot="expandedRowRender" slot="expandedRowRender"
slot-scope="record" slot-scope="record"
style="margin: 0" style="margin: 0"
> >{{ getselContent(record.id) }}</div>
<div>课程简介{{ record.courseProfile }}</div>
</div>
</a-table> </a-table>
</div> </div>
<a-empty v-else /> <a-empty v-else />
<!-- 编辑 --> <!-- 编辑 -->
<course-edit :editVisible="editVisible" @closeModal="closeModal" /> <course-edit
:contents="contents"
:edit-data="editData"
:edit-visible="editVisible"
@closeModal="closeModal"
@getData="getData"
/>
</div> </div>
</template> </template>
<script> <script>
import CourseEdit from 'components/Course/CourseEdit.vue'; import CourseEdit from 'components/Course/CourseEdit.vue';
import { deleteService, selContent } from 'config/api';
const columns = [ const columns = [
{ {
title: '序号', title: '序号',
@ -74,55 +70,44 @@ const columns = [
scopedSlots: { customRender: 'id' }, scopedSlots: { customRender: 'id' },
}, },
{ {
title: '课程名称', title: '服务名称',
align: 'center', align: 'center',
dataIndex: 'courseName', dataIndex: 'name',
key: 'courseName', key: 'name',
}, },
{ {
title: '介绍图片', title: '服务简介',
align: 'center', align: 'center',
dataIndex: 'introductionPicture', dataIndex: 'intro',
key: 'introductionPicture', key: 'intro',
scopedSlots: { customRender: 'introductionPicture' },
}, },
{ {
title: '审核状态', title: '服务图片',
align: 'center', align: 'center',
dataIndex: 'auditStatus', dataIndex: 'picUrl',
key: 'auditStatus', key: 'picUrl',
scopedSlots: { customRender: 'auditStatus' }, scopedSlots: { customRender: 'picUrl' },
}, },
{ {
title: '编辑', title: '服务类型',
align: 'center', align: 'center',
dataIndex: 'edit', dataIndex: 'serviceType',
key: 'edit', key: 'serviceType',
scopedSlots: { customRender: 'edit' }, scopedSlots: { customRender: 'serviceType' },
}, },
{ {
title: '审核', title: '服务排序',
align: 'center', align: 'center',
dataIndex: 'examine', dataIndex: 'orders',
key: 'examine', key: 'orders',
scopedSlots: { customRender: 'examine' }, scopedSlots: { customRender: 'orders' },
}, },
];
const lists = [
{ {
id: '001', title: '编辑',
courseName: '传控科技', align: 'center',
courseProfile: '传控科技简介', dataIndex: 'edit',
introductionPicture: 'assets/logo.png', key: 'edit',
auditStatus: '通过', scopedSlots: { customRender: 'edit' },
},
{
id: '002',
courseName: '中绿环保',
courseProfile: '中绿环保简介',
introductionPicture: 'assets/logo.png',
auditStatus: '未通过',
}, },
]; ];
@ -131,59 +116,90 @@ export default {
components: { components: {
CourseEdit, CourseEdit,
}, },
// props: { lists: { type: Array, default: () => {} } },
props: { lists: { type: Object, default: () => {} }, pagination: { type: Object, default: () => {} } },
data() { data() {
this.cacheData = lists.map(item => ({ ...item }));
return { return {
columns, columns,
lists,
loading: false, loading: false,
editingKey: '',
height: '', height: '',
editVisible: false, editVisible: false,
imgVisible: false, editData: null,
contents: '',
}; };
}, },
mounted() { mounted() {
this.height = document.getElementsByClassName('main')[0].offsetHeight - 150; let th = 250;
let wh = window.innerHeight;
this.height = wh - th;
window.onresize = () => {
return (() => {
wh = window.innerHeight;
this.height = wh - th;
})();
};
}, },
methods: { methods: {
showEditModal() { showEditModal(data) {
this.editData = data;
this.contents = this.getselContent(data.id);
this.editVisible = true; this.editVisible = true;
}, },
closeModal() { closeModal() {
this.editVisible = false; this.editVisible = false;
}, },
handleTableChange(pagination) {
const { current, pageSize } = pagination;
const condition = { current, pageSize };
this.$emit('getInnovativeServiceSearch', condition);
},
getData() {
this.$emit('getInnovativeServiceSearch');
},
// //
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 || '删除失败');
} }
}, },
//
getselContent(id) {
try {
const parmas = {
param: {
id: +id,
serviceType: 3,
},
};
const res = selContent(params);
const { code, msg, data } = res.data;
if (code === 200) {
// console.log(data);
return data.content;
} else {
return '暂无内容';
}
} catch (error) {
return '暂无内容';
}
},
}, },
}; };
</script> </script>
<style lang="stylus" scoped> <style scoped lang="stylus"></style>
.main .img {
height: 65px;
}
.main .big_img {
width: 200px;
}
</style>

213
src/components/Course/CourseEdit.vue

@ -11,62 +11,76 @@
width="700px" width="700px"
> >
<a-form :form="form" @submit="handleSubmit"> <a-form :form="form" @submit="handleSubmit">
<!-- 课程名称 --> <!-- 服务名称 -->
<a-form-item <a-form-item
:label-col="formItemLayout.labelCol" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="课程名称" label="服务名称"
> >
<a-input <a-input class="ml-3" placeholder="服务名称" v-model="serviceName" />
placeholder="课程名称"
v-decorator="[
'courseName',
{
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" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="课程简介" label="服务简介"
> >
<a-textarea <a-textarea class="ml-3" placeholder="服务简介" v-model="intro" />
placeholder="课程简介"
v-decorator="[
'courseProfile',
]"
/>
</a-form-item> </a-form-item>
<!-- 介绍图片 --> <!-- 服务内容 -->
<a-form-item <a-form-item
:label-col="formItemLayout.labelCol" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="介绍图片" label="服务内容"
>
<a-textarea class="ml-3" placeholder="服务内容" v-model="content" />
</a-form-item>
<!-- 服务排序 -->
<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-upload <a-upload
:action="upload"
:before-upload="beforeUpload" :before-upload="beforeUpload"
:show-upload-list="false"
@change="handleChange" @change="handleChange"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76" class="ml-3"
class="avatar-uploader" list-type="picture"
list-type="picture-card" name="files"
name="avatar"
> >
<img :src="imageUrl" alt="avatar" v-if="imageUrl" /> <a-button v-show="fileList.length - 0 === 0">
<div v-else> <a-icon type="upload" />选择图片
<a-icon :type="loading ? 'loading' : 'plus'" /> </a-button>
<div class="ant-upload-text">Upload</div>
</div>
</a-upload> </a-upload>
</a-form-item> </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-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>
@ -77,77 +91,99 @@
</template> </template>
<script> <script>
import { upload, updateService } from 'config/api';
const formItemLayout = { const formItemLayout = {
labelCol: { span: 6 }, labelCol: { span: 6 },
wrapperCol: { span: 16 }, wrapperCol: { span: 16 },
}; };
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } }; 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 { export default {
name: 'CourseEdit', name: 'CourseEdit',
props: { editVisible: { type: Boolean, default: false } }, props: {
editVisible: { type: Boolean, default: false },
editData: { type: Object, default: () => {} },
contents: { type: String, default: '' },
},
data() { data() {
return { return {
formItemLayout, formItemLayout,
tailItemLayout, tailItemLayout,
form: this.$form.createForm(this, { name: 'course-edit' }), form: this.$form.createForm(this, { name: 'r-d-member-add' }),
loading: false, upload: upload,
imageUrl: '', 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,
}; };
}, },
watch: {
editData(val) {
console.log(val);
},
},
methods: { methods: {
// //
handleChange(info) { handleChange(info) {
if (info.file.status === 'uploading') { // this.fileList = fileList;
this.loading = true; console.log(info);
return;
}
if (info.file.status === 'done') { if (info.file.status === 'done') {
// Get this url from response in real world. this.fileList.push(info.file.response.data[0].id);
getBase64(info.file.originFileObj, imageUrl => { } else if (info.file.status === 'removed') {
this.imageUrl = imageUrl; this.fileList = info.fileList;
this.loading = false;
});
} }
}, },
beforeUpload(file) { changeIpt(e, str) {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'; this[str] = e.target.value;
if (!isJpgOrPng) { },
this.$message.error('You can only upload JPG file!'); getUse(e, str) {
} this[str] = e;
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
this.$message.error('Image must smaller than 2MB!');
}
return isJpgOrPng && isLt2M;
}, },
// //
handleSubmit(e) { handleSubmit(e) {
e.preventDefault(); e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => { this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) { if (!err) {
try { try {
console.log('values: ', values); const params = {
// const params = this.generateParams(values); param: {
// const res = await createTask(params); id: this.editData.id,
// const { data, msg, code } = res.data; name: this.serviceName ? this.serviceName : this.editData.name,
// // content: this.content ? this.content : this.contents === '暂无内容' ? '' : this.contents,
// this.clearCreateTask(); intro: this.intro ? this.intro : this.editData.intro,
// this.$emit('closeDialog'); orders: this.orders ? this.orders : this.editData.orders,
// if (code === 200) { picId: this.picId ? this.picId : this.editData.picId,
// this.handleCreateSuccess(params.executorId); recStatus: this.recStatus,
// } else { serviceType: 3,
// throw msg; },
// } };
const res = await updateService(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$emit('getData');
this.$emit('closeModal');
this.$message.success('修改成功');
} else {
this.$message.error('修改失败');
}
} catch (error) { } catch (error) {
this.$message.error(error || '添加研发团队失败'); this.$message.error(error);
} }
} }
}); });
@ -156,19 +192,4 @@ export default {
}; };
</script> </script>
<style scoped lang="stylus"> <style scoped lang="stylus"></style>
.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>

43
src/components/Course/CourseSearch.vue

@ -1,22 +1,22 @@
<template> <template>
<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 />
@change="handleChangeName" <span class="ml-3"> 服务状态:</span>
placeholder="课程名称" <a-select @change="handleChangeSelect" class="ml-3" style="width: 150px" placeholder="状态" allow-clear>
style="width: 150px" <a-select-option :key="item" :value="index" v-for="(item, index) in statusList">{{ item }}</a-select-option>
v-model="courseName" </a-select>
/>
<a-button @click="handleTableChange" class="ml-3" 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> <a-button type="primary" @click="showModal" class="editable-add-btn">增加</a-button>
<!-- 添加 --> <!-- 添加 -->
<course-add :visible="visible" @closeModal="closeModal" /> <course-add :visible="visible" @closeModal="closeModal" @handleTableChange="handleTableChange" />
</div> </div>
</template> </template>
@ -31,7 +31,14 @@ export default {
data() { data() {
return { return {
visible: false, visible: false,
courseName: '', name: '',
serviceTypes: [
{ id: 1, value: '创新平台' },
{ id: 2, value: '孵化平台' },
{ id: 3, value: '产业平台' },
],
statusList: ['正常', '禁用'],
status111: '',
}; };
}, },
methods: { methods: {
@ -43,13 +50,21 @@ export default {
this.visible = false; this.visible = false;
}, },
handleChangeSelect(e) {
// this[type] = value;
this.status111 = e;
},
handleChangeName(value) { handleChangeName(value) {
console.log('value: ', value); console.log('value: ', value);
this.courseName = value; this.name = value;
}, },
handleTableChange() { async handleTableChange() {
console.log('搜索'); const { name, status111 } = this;
//
const condition = { name, status111 };
await this.$emit('getInnovativeServiceSearch', condition);
}, },
}, },
}; };

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: '申请状态',
align: 'center',
dataIndex: 'status',
key: 'status',
scopedSlots: { customRender: 'status' },
}, },
{ {
title: '编辑', 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>

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);
}
}, },
}, },
}; };

116
src/components/SpinOff/SpinOffDate.vue

@ -1,6 +1,6 @@
<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" :columns="columns"
:data-source="lists" :data-source="lists"
@ -14,65 +14,46 @@
</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>
<span v-if=" record.position === 3">数字健康开发</span> <span v-if="record.position === 3">数字健康开发</span>
<span v-if=" record.position === 4">其他</span> <span v-if="record.position === 4">其他</span>
</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"
:maskClosable="false"
@cancel="imgVisible = false"
destroyOnClose
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
<a-popconfirm @confirm="() => onDelete(record.id)" title="确定要删除这一条?" v-if="lists.length"> @click="showEditModal(record.id, record.dealStatus)"
<a-icon class="ml-4 pointer" theme="twoTone" two-tone-color="#ff0000" type="delete" /> class="pointer"
</a-popconfirm> theme="twoTone"
type="edit"
/>
</template> </template>
</a-table> </a-table>
</div> </div>
<a-empty v-else /> <a-empty v-else />
<a-modal
<!-- 编辑 --> :confirm-loading="confirmLoading"
<spin-off-edit :editVisible="editVisible" @closeModal="closeModal" /> :visible="editVisible"
@cancel="handleCancel"
@ok="onDelete"
title="修改审核状态"
>
<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> </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 = [
{ {
@ -140,7 +121,7 @@ const columns = [
scopedSlots: { customRender: 'dealStatus' }, scopedSlots: { customRender: 'dealStatus' },
}, },
{ {
title: '编辑', title: '修改审核状态',
align: 'center', align: 'center',
dataIndex: 'edit', dataIndex: 'edit',
key: 'edit', key: 'edit',
@ -165,9 +146,6 @@ const lists = [
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: () => {} } },
@ -177,8 +155,12 @@ export default {
columns, columns,
loading: false, loading: false,
height: '', height: '',
confirmLoading: false,
editVisible: false, editVisible: false,
imgVisible: false, imgVisible: false,
delId: '',
dealStatus: '',
enable: ['未处理', '审核通过', '审核未通过'],
}; };
}, },
@ -187,31 +169,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 || '修改失败');
} }
}, },
}, },

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 = [];
}, },
}, },
}; };

222
src/components/innovativeService/innovativeServiceAdd.vue

@ -11,100 +11,118 @@
width="700px" width="700px"
> >
<a-form :form="form" @submit="handleSubmit"> <a-form :form="form" @submit="handleSubmit">
<!-- 团队名称 --> <!-- 服务名称 -->
<a-form-item <a-form-item
:label-col="formItemLayout.labelCol" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="团队名称" label="服务名称"
> >
<a-input <a-input
placeholder="团队名称" @change="changeIpt($event, 'serviceName')"
class="ml-3"
placeholder="服务名称"
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" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="团队带头人" label="服务简介"
> >
<a-input <a-textarea
placeholder="团队带头人" @change="changeIpt($event, 'intro')"
class="ml-3"
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" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="依托单位" label="服务内容"
> >
<a-input <a-textarea
placeholder="依托单位" @change="changeIpt($event, 'content')"
class="ml-3"
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" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="研究方向" label="服务排序"
> >
<a-input <a-input-number class="ml-3" v-model="orders" />
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" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="团队简介" label="图片"
> >
<a-textarea <a-upload
placeholder="团队简介" :action="upload"
v-decorator="[ :before-upload="beforeUpload"
'teamIntroduce', @change="handleChange"
]" class="ml-3"
/> list-type="picture"
name="files"
>
<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>
<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>
@ -115,6 +133,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 },
@ -130,30 +150,78 @@ export default {
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) {
try { if (this.fileList.length > 0) {
console.log('values: ', values); try {
// const params = this.generateParams(values); this.picId = this.fileList[0];
// const res = await createTask(params); const params = {
// const { data, msg, code } = res.data; param: {
// // name: this.serviceName,
// this.clearCreateTask(); content: this.content,
// this.$emit('closeDialog'); intro: this.intro,
// if (code === 200) { orders: this.orders,
// this.handleCreateSuccess(params.executorId); picId: this.picId,
// } else { recStatus: this.recStatus,
// throw msg; serviceType: 1,
// } },
} catch (error) { };
this.$message.error(error || '添加研发团队失败'); 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('请上传图片');
} }
} }
}); });

134
src/components/innovativeService/innovativeServiceDate.vue

@ -1,9 +1,9 @@
<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"
:pagination="pagination" :pagination="pagination"
:row-key="record => record.id" :row-key="record => record.id"
@ -21,29 +21,45 @@
</template> </template>
<template slot="serviceType" slot-scope="text, record"> <template slot="serviceType" slot-scope="text, record">
<span v-if=" record.serviceType === 1">创新平台</span> <span v-if="record.serviceType === 1">创新平台</span>
<span v-if=" record.serviceType === 2">孵化平台</span> <span v-if="record.serviceType === 2">孵化平台</span>
<span v-if=" record.serviceType === 3">产业平台</span> <span v-if="record.serviceType === 3">产业平台</span>
</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)" 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>
<div
class="d-flex flex-nowrap justify-space-between"
slot="expandedRowRender"
slot-scope="record"
style="margin: 0"
>{{ getselContent(record.id) }}</div>
</a-table> </a-table>
</div> </div>
<a-empty v-else /> <a-empty v-else />
<!-- 编辑 --> <!-- 编辑 -->
<r-d-member-edit :edit-visible="editVisible" @closeModal="closeModal" /> <r-d-member-edit
:contents="contents"
:edit-data="editData"
:edit-visible="editVisible"
@closeModal="closeModal"
@getData="getData"
/>
</div> </div>
</template> </template>
<script> <script>
import RDMemberEdit from 'components/innovativeService/innovativeServiceEdit.vue'; import RDMemberEdit from 'components/innovativeService/innovativeServiceEdit.vue';
import { deleteService, selContent } from 'config/api';
const columns = [ const columns = [
{ {
title: '序号', title: '序号',
@ -62,8 +78,8 @@ const columns = [
{ {
title: '服务简介', title: '服务简介',
align: 'center', align: 'center',
dataIndex: 'orders', dataIndex: 'intro',
key: 'orders', key: 'intro',
}, },
{ {
title: '服务图片', title: '服务图片',
@ -72,12 +88,6 @@ const columns = [
key: 'picUrl', key: 'picUrl',
scopedSlots: { customRender: 'picUrl' }, scopedSlots: { customRender: 'picUrl' },
}, },
{
title: '服务状态',
align: 'center',
dataIndex: 'recStatus',
key: 'recStatus',
},
{ {
title: '服务类型', title: '服务类型',
align: 'center', align: 'center',
@ -85,21 +95,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',
@ -110,9 +112,12 @@ const columns = [
]; ];
export default { export default {
name: 'InnovativeServiceDate', name: 'innovativeServiceDate',
components: { RDMemberEdit }, components: {
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } }, RDMemberEdit,
},
// props: { lists: { type: Array, default: () => {} } },
props: { lists: { type: Object, default: () => {} }, pagination: { type: Object, default: () => {} } },
data() { data() {
return { return {
@ -121,6 +126,8 @@ export default {
editingKey: '', editingKey: '',
height: '', height: '',
editVisible: false, editVisible: false,
editData: null,
contents: '',
}; };
}, },
@ -135,41 +142,62 @@ export default {
})(); })();
}; };
}, },
methods: { methods: {
showEditModal() { showEditModal(data) {
this.editData = data;
this.contents = this.getselContent(data.id);
this.editVisible = true; this.editVisible = true;
}, },
closeModal() { closeModal() {
this.editVisible = false; this.editVisible = false;
}, },
//
handleTableChange(pagination) { handleTableChange(pagination) {
const { current, pageSize } = pagination; const { current, pageSize } = pagination;
const condition = { current, pageSize }; const condition = { current, pageSize };
this.$emit('getSelectTeam', condition); this.$emit('getInnovativeServiceSearch', condition);
},
getData() {
this.$emit('getInnovativeServiceSearch');
}, },
// //
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 || '删除失败');
} }
}, },
//
getselContent(id) {
try {
const parmas = {
param: {
id: +id,
serviceType: 1,
},
};
const res = selContent(params);
const { code, msg, data } = res.data;
if (code === 200) {
// console.log(data);
return data.content;
} else {
return '暂无内容';
}
} catch (error) {
return '暂无内容';
}
},
}, },
}; };
</script> </script>

199
src/components/innovativeService/innovativeServiceEdit.vue

@ -11,101 +11,76 @@
width="700px" width="700px"
> >
<a-form :form="form" @submit="handleSubmit"> <a-form :form="form" @submit="handleSubmit">
<!-- 团队名称 --> <!-- 服务名称 -->
<a-form-item <a-form-item
:label-col="formItemLayout.labelCol" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="团队名称" label="服务名称"
> >
<!-- initialValue: editTask.name, --> <a-input class="ml-3" placeholder="服务名称" v-model="serviceName" />
<a-input
placeholder="团队名称"
v-decorator="[
'name',
{
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" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="团队带头人" label="服务简介"
> >
<a-input <a-textarea class="ml-3" placeholder="服务简介" v-model="intro" />
placeholder="团队带头人"
v-decorator="[
'contacts',
{
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" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="依托单位" label="服务内容"
> >
<a-input <a-textarea class="ml-3" placeholder="服务内容" v-model="content" />
placeholder="依托单位"
v-decorator="[
'company',
{
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" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="研究方向" label="服务排序"
> >
<a-input <a-input-number class="ml-3" v-model="orders" />
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" :label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol" :wrapper-col="formItemLayout.wrapperCol"
label="团队简介" label="图片"
> >
<a-textarea <a-upload
placeholder="团队简介" :action="upload"
v-decorator="[ :before-upload="beforeUpload"
'teamIntroduce', @change="handleChange"
]" class="ml-3"
/> list-type="picture"
name="files"
>
<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>
<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>
@ -116,6 +91,8 @@
</template> </template>
<script> <script>
import { upload, updateService } from 'config/api';
const formItemLayout = { const formItemLayout = {
labelCol: { span: 6 }, labelCol: { span: 6 },
wrapperCol: { span: 16 }, wrapperCol: { span: 16 },
@ -125,36 +102,88 @@ const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default { export default {
name: 'RDMemberEdit', name: 'RDMemberEdit',
props: { editVisible: { type: Boolean, default: false } }, props: {
editVisible: { type: Boolean, default: false },
editData: { type: Object, default: () => {} },
contents: { type: String, default: '' },
},
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,
}; };
}, },
watch: {
editData(val) {
console.log(val);
},
},
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) {
try { try {
console.log('values: ', values); const params = {
// const params = this.generateParams(values); param: {
// const res = await createTask(params); id: this.editData.id,
// const { data, msg, code } = res.data; name: this.serviceName ? this.serviceName : this.editData.name,
// // content: this.content ? this.content : this.contents === '暂无内容' ? '' : this.contents,
// this.clearCreateTask(); intro: this.intro ? this.intro : this.editData.intro,
// this.$emit('closeDialog'); orders: this.orders ? this.orders : this.editData.orders,
// if (code === 200) { picId: this.picId ? this.picId : this.editData.picId,
// this.handleCreateSuccess(params.executorId); recStatus: this.recStatus,
// } else { serviceType: 1,
// throw msg; },
// } };
const res = await updateService(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$emit('getData');
this.$emit('closeModal');
this.$message.success('修改成功');
} else {
this.$message.error('修改失败');
}
} catch (error) { } catch (error) {
this.$message.error(error || '添加研发团队失败'); this.$message.error(error);
} }
} }
}); });

46
src/components/innovativeService/innovativeServiceSearch.vue

@ -2,30 +2,21 @@
<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="name" /> <a-input placeholder="服务名称" style="width: 150px" v-model="name" allow-clear />
<a-select <span class="ml-3"> 服务状态:</span>
@change="handleChangeSelect('serviceType',$event)" <a-select @change="handleChangeSelect" class="ml-3" style="width: 150px" placeholder="状态" allow-clear>
allow-clear <a-select-option :key="item" :value="index" v-for="(item, index) in statusList">{{ item }}</a-select-option>
class="ml-3"
placeholder="服务类型"
style="width: 150px"
>
<a-select-option
:key="serviceType.id"
:value="serviceType.id"
v-for="serviceType in serviceTypes"
>{{ serviceType.value }}</a-select-option>
</a-select> </a-select>
<a-button @click="handleTableChange" class="ml-3" 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>
@ -33,8 +24,10 @@
import RDMemberAdd from 'components/innovativeService/innovativeServiceAdd.vue'; import RDMemberAdd from 'components/innovativeService/innovativeServiceAdd.vue';
export default { export default {
name: 'InnovativeServiceSearch', name: 'innovativeServiceSearch',
components: { RDMemberAdd }, components: {
RDMemberAdd,
},
data() { data() {
return { return {
visible: false, visible: false,
@ -44,6 +37,8 @@ export default {
{ id: 2, value: '孵化平台' }, { id: 2, value: '孵化平台' },
{ id: 3, value: '产业平台' }, { id: 3, value: '产业平台' },
], ],
statusList: ['正常', '禁用'],
status111: '',
}; };
}, },
methods: { methods: {
@ -55,8 +50,9 @@ export default {
this.visible = false; this.visible = false;
}, },
handleChangeSelect(type, value) { handleChangeSelect(e) {
this[type] = value; // this[type] = value;
this.status111 = e;
}, },
handleChangeName(value) { handleChangeName(value) {
@ -65,16 +61,10 @@ export default {
}, },
async handleTableChange() { async handleTableChange() {
console.log('搜索'); const { name, status111 } = this;
const { name, serviceType } = this;
console.log(name, serviceType);
// //
const condition = { const condition = { name, status111 };
name,
serviceType,
};
await this.$emit('getInnovativeServiceSearch', condition); await this.$emit('getInnovativeServiceSearch', condition);
this.activityType = [];
}, },
}, },
}; };

26
src/config/api.js

@ -17,6 +17,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`; // 三大平台相关接口
const comment = `${greenvalley}/comment`; // 交流社区相关操作 const comment = `${greenvalley}/comment`; // 交流社区相关操作
const place = `${greenvalley}/place`; // 孵化部入驻实体申请相关操作 const place = `${greenvalley}/place`; // 孵化部入驻实体申请相关操作
const business = `${greenvalley}/business`; // 交流社区相关操作 const business = `${greenvalley}/business`; // 交流社区相关操作
@ -113,11 +114,23 @@ export const backendUpdate = params => axios.post(`${business}/backendUpdate`, p
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 updateService = params => axios.post(`${serviceProject}/updateService`, params);
// 查询服务内容
export const selContent = params => axios.post(`${serviceProject}/selContent`, 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);
@ -207,7 +220,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,
Avatar, Avatar,
} from 'ant-design-vue'; } from 'ant-design-vue';
import { ConfigProvider } from 'ant-design-vue'; import { ConfigProvider } from 'ant-design-vue';
@ -50,6 +51,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.use(Avatar); Vue.use(Avatar);
Vue.prototype.$message = message; Vue.prototype.$message = message;

57
src/views/CooperationIntention/CooperationIntention.vue

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

57
src/views/IncubationServices/IncubationServices.vue

@ -1,19 +1,64 @@
<template> <template>
<div class="pa-3 white fill-height d-flex flex-column"> <div class="pa-3 white fill-height d-flex flex-column">
<challenge-search /> <challenge-search @getInnovativeServiceSearch="getInnovativeServiceSearch" />
<challenge-date /> <challenge-date :pagination="pagination" :lists="lists" @getInnovativeServiceSearch="getInnovativeServiceSearch" />
</div> </div>
</template> </template>
<script> <script>
import ChallengeSearch from "components/Challenge/ChallengeSearch.vue"; import ChallengeSearch from 'components/Challenge/ChallengeSearch.vue';
import ChallengeDate from "components/Challenge/ChallengeDate.vue"; import ChallengeDate from 'components/Challenge/ChallengeDate.vue';
import { getInnovativeServiceSearch } from 'config/api';
export default { export default {
name: "InnovationChallenge", name: 'InnovationChallenge',
components: { components: {
ChallengeSearch, ChallengeSearch,
ChallengeDate, ChallengeDate,
} },
data() {
return {
lists: {},
pagination: { current: 1, pageSize: 10 },
};
},
created() {
this.getInnovativeServiceSearch();
},
methods: {
async getInnovativeServiceSearch(condition) {
try {
const params = {
param: {
name: condition && condition.name ? condition.name : '',
recStatus: condition && condition.status111 !== '' ? condition.status111 : '',
serviceType: 2,
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
console.log('params', params);
const res = await getInnovativeServiceSearch(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.lists = data;
console.log(this.lists);
const paper = { ...this.pagination };
paper.current = data.pageNum;
paper.total = +data.total;
paper.pageSize = data.pageSize;
this.pagination = paper;
} else {
throw msg || '获取失败';
}
} catch (error) {
this.$message.error(error);
}
},
},
}; };
</script> </script>

57
src/views/IndustrialServices/IndustrialServices.vue

@ -1,19 +1,64 @@
<template> <template>
<div class="pa-3 white fill-height d-flex flex-column"> <div class="pa-3 white fill-height d-flex flex-column">
<course-search /> <course-search @getInnovativeServiceSearch="getInnovativeServiceSearch" />
<course-date /> <course-date :pagination="pagination" :lists="lists" @getInnovativeServiceSearch="getInnovativeServiceSearch" />
</div> </div>
</template> </template>
<script> <script>
import CourseSearch from "components/Course/CourseSearch.vue"; import CourseSearch from 'components/Course/CourseSearch.vue';
import CourseDate from "components/Course/CourseDate.vue"; import CourseDate from 'components/Course/CourseDate.vue';
import { getInnovativeServiceSearch } from 'config/api';
export default { export default {
name: "Course", name: 'Course',
components: { components: {
CourseSearch, CourseSearch,
CourseDate, CourseDate,
} },
data() {
return {
lists: {},
pagination: { current: 1, pageSize: 10 },
};
},
created() {
this.getInnovativeServiceSearch();
},
methods: {
async getInnovativeServiceSearch(condition) {
try {
const params = {
param: {
name: condition && condition.name ? condition.name : '',
recStatus: condition && condition.status111 !== '' ? condition.status111 : '',
serviceType: 3,
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
console.log('params', params);
const res = await getInnovativeServiceSearch(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.lists = data;
console.log(this.lists);
const paper = { ...this.pagination };
paper.current = data.pageNum;
paper.total = +data.total;
paper.pageSize = data.pageSize;
this.pagination = paper;
} else {
throw msg || '获取失败';
}
} catch (error) {
this.$message.error(error);
}
},
},
}; };
</script> </script>

39
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,26 +7,26 @@
<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,
}, },
data(){ data() {
return{ return {
lists: [], lists: {},
pagination:{ current: 1,pageSize: 10}, pagination: { current: 1, pageSize: 10 },
}; };
}, },
created() { created() {
this.getInnovativeServiceSearch() this.getInnovativeServiceSearch();
}, },
methods: { methods: {
@ -36,25 +34,14 @@ export default {
try { try {
const params = { const params = {
param: { param: {
name: condition && condition.name ? condition.name : '',
recStatus: condition && condition.status111 !== '' ? condition.status111 : '',
serviceType: 1,
pageNum: (condition && condition.current) || 1, pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10, pageSize: (condition && condition.pageSize) || 10,
}, },
}; };
if(condition){ console.log('params', params);
if(condition.id){
params.param.id = condition.id
}
if(condition.name){
params.param.name = condition.name
}
if(condition.recStatus){
params.param.recStatus = condition.recStatus
}
if(condition.serviceType){
params.param.serviceType = condition.serviceType
}
}
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 +60,6 @@ export default {
this.$message.error(error); this.$message.error(error);
} }
}, },
} },
}; };
</script> </script>

Loading…
Cancel
Save