Browse Source

部分修改

master
rose 4 years ago
parent
commit
8c460029a8
  1. 1
      src/components/BtnCom/BtnCon.vue
  2. 227
      src/components/Contact/ContactDate.vue
  3. 49
      src/components/Contact/ContactUsSearch.vue
  4. 6
      src/components/Transfer/TransferAdd.vue
  5. 3
      src/components/Transfer/TransferDate.vue
  6. 9
      src/components/Transfer/TransferEdit.vue
  7. 2
      src/components/Transfer/TransferSearch.vue
  8. 12
      src/config/api.js
  9. 9
      src/router/index.js
  10. 69
      src/views/ContactUs/ContactUs.vue

1
src/components/BtnCom/BtnCon.vue

@ -11,6 +11,7 @@
<div @click="jump('/talent-recruitment')" class="btn">人才招聘</div>
<div @click="jump('/cooperative-partner')" class="btn">合作伙伴</div>
<div @click="jump('/about-us-derivative-enterprise')" class="btn">衍生企业</div>
<div @click="jump('/contact-us-derivative-enterprise')" class="btn">联系我们</div>
<div class="font-bold-24">创新部</div>
<div @click="jump('/cooperation-intention')" class="btn">合作意向</div>

227
src/components/Contact/ContactDate.vue

@ -0,0 +1,227 @@
<template>
<div class="main flex-1">
<div>是否显示了</div>
<a-spin :spinning="showEdit">
<div style="width:100%" v-if="lists && lists.length > 0">
<a-table
:columns="columns"
:data-source="lists"
:loading="loading"
:pagination="pagination"
:row-key="record => record.id"
:scroll="{ y: height }"
@change="handleTableChange"
@expand="getDetail"
bordered
class="white"
>
<template slot="id" slot-scope="text, record, index">
<span>{{ index + 1 }}</span>
</template>
<!-- 图片 -->
<template slot="visitLocation" slot-scope="text, record">
<img :src="record.visitLocation" height="50" width="50" />
</template>
<template slot="edit" slot-scope="text, record">
<a-icon @click="showEditModal(record)" class="pointer" theme="twoTone" type="edit" />
<a-popconfirm
@confirm="() => onDelete(record.id)"
title="确定要删除这一条?"
v-if="lists.length"
>
<a-icon class="ml-4 pointer" theme="twoTone" two-tone-color="#ff0000" type="delete" />
</a-popconfirm>
</template>
</a-table>
</div>
<a-empty v-else />
<!-- <div>{{ editItem }}</div> -->
<!-- 编辑 -->
<transfer-edit
:editItem="editItem"
:editVisible="editVisible"
:typeLists="typeLists"
@closeModal="closeModal"
@selInstrumentSearch="selInstrumentSearch"
/>
</a-spin>
</div>
</template>
<script>
import TransferEdit from 'components/Transfer/TransferEdit.vue';
import { selInstrumentDelete, selInstrumentMes } from 'config/api';
const columns = [
{
title: '序号',
align: 'center',
dataIndex: 'id',
key: 'id',
width: '7%',
scopedSlots: { customRender: 'id' },
},
{
title: '现居住地',
align: 'center',
dataIndex: 'residence',
key: 'residence',
},
{
title: '出生年月',
align: 'center',
dataIndex: 'birth',
key: 'birth',
},
{
title: '户口所在地',
align: 'center',
dataIndex: 'account',
key: 'account',
},
{
title: '教育经历',
align: 'center',
dataIndex: 'eduExperience',
key: 'eduExperience',
scopedSlots: { customRender: 'eduExperienchukz' },
},
{
title: '电子邮件',
align: 'center',
dataIndex: 'email',
key: 'email',
scopedSlots: { customRender: 'email' },
},
{
title: '工作经历',
align: 'center',
dataIndex: 'workExperience',
key: 'workExperience',
scopedSlots: { customRender: 'workExperience' },
},
{
title: '求职意向',
align: 'center',
dataIndex: 'jobIntension',
key: 'jobIntension',
scopedSlots: { customRender: 'jobIntension' },
},
];
export default {
name: 'TransferDate',
components: {
TransferEdit,
},
props: {
lists: { type: Array, default: () => [] },
pagination: { type: Object, default: () => {} },
typeLists: { type: Array, default: () => [] },
},
data() {
return {
columns,
loading: false,
height: '',
editVisible: false,
imgVisible: false,
spinning: false,
editItem: null, //
showEdit: false,
};
},
mounted() {
let th = 250;
let wh = window.innerHeight;
this.height = wh - th;
window.onresize = () => {
return (() => {
wh = window.innerHeight;
this.height = wh - th;
})();
};
},
methods: {
async showEditModal(record) {
console.log(record)
this.showEdit = true;
await this.getDetail(true, record);
this.showEdit = false;
this.editVisible = true;
this.editItem = record;
console.log('==============>showEditModal结束')
},
closeModal() {
this.editVisible = false;
},
async selInstrumentSearch() {
await this.$emit('selInstrumentSearch');
},
handleTableChange(pagination) {
const { current, pageSize } = pagination;
const condition = { current, pageSize };
this.$emit('selInstrumentSearch', condition);
},
//
async getDetail(expanded, record) {
if (!expanded) return;
try {
this.spinning = true;
const params = { param: { id: record.id } };
const res = await selInstrumentMes(params);
const { data, msg, code } = res.data;
this.spinning = false;
if (code === 200) {
const item = this.lists.find(item => item.id === record.id);
item.info = data;
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '查询失败');
}
},
//
async onDelete(id) {
try {
const params = { param: { id } };
const res = await selInstrumentDelete(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('删除成功');
this.$emit('selInstrumentSearch');
} else {
throw msg;
}
} catch (error) {
this.$message.error(error || '删除失败');
}
},
},
};
</script>
<style lang="stylus" scoped>
.main .img {
height: 65px;
}
.main .big_img {
width: 200px;
}
</style>

49
src/components/Contact/ContactUsSearch.vue

@ -0,0 +1,49 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 中文名称 -->
<div>
<a-input placeholder="设备名称" style="width: 150px" v-model="content" />
<a-checkbox-group @change="onChange" class="ml-3">
<a-checkbox :key="item.id" :value="item.id" v-for="item in typeLists.list">{{ item.name }}</a-checkbox>
</a-checkbox-group>
<a-button @click="handleTableChange" class="ml-3" type="primary">搜索</a-button>
</div>
<div class="flex-1">121231233</div>
</div>
</template>
<script>
export default {
name: 'ContactUsSearch',
props: { typeLists: { type: Array, default: () => [] } },
data() {
return {
content: '',
modelIds: [],
};
},
methods: {
onChange(checkedValues) {
this.modelIds = checkedValues;
},
async handleTableChange() {
const { content, modelIds } = this;
//
const condition = {
content,
modelIds,
};
await this.$emit('selInstrumentSearch', condition);
},
},
};
</script>
<style scoped lang="stylus"></style>

6
src/components/Transfer/TransferAdd.vue

@ -125,7 +125,7 @@
},
]"
>
<a-checkbox :key="item.id" :value="item.id" v-for="item in typeLists">{{ item.name }}</a-checkbox>
<a-checkbox :key="item.id" :value="item.id" v-for="item in typeLists.list">{{ item.name }}</a-checkbox>
</a-checkbox-group>
</a-form-item>
<!-- 价格 -->
@ -209,7 +209,7 @@
<a-select-option
:key="index"
:value="type.id"
v-for="(type, index) in types"
v-for="(type, index) in types.list"
>{{ type.name }}</a-select-option>
</a-select>
</a-form-item>
@ -250,7 +250,7 @@ const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default {
name: 'TransferAdd',
props: { visible: { type: Boolean, default: false }, typeLists: { type: Array, default: () => [] } },
props: { visible: { type: Boolean, default: false }, typeLists: { type: Object, default: () => {} } },
data() {
return {
formItemLayout,

3
src/components/Transfer/TransferDate.vue

@ -97,6 +97,7 @@
</a-table>
</div>
<a-empty v-else />
<!-- <div>{{ editItem }}</div> -->
<!-- 编辑 -->
<transfer-edit
@ -196,11 +197,13 @@ export default {
methods: {
async showEditModal(record) {
console.log(record)
this.showEdit = true;
await this.getDetail(true, record);
this.showEdit = false;
this.editVisible = true;
this.editItem = record;
console.log('==============>showEditModal结束')
},
closeModal() {

9
src/components/Transfer/TransferEdit.vue

@ -116,6 +116,7 @@
:wrapper-col="formItemLayout.wrapperCol"
label="类型"
>
<!-- <div>{{ typeLists}}</div> -->
<a-checkbox-group
v-decorator="[
'modelIds',
@ -127,7 +128,7 @@
},
]"
>
<a-checkbox :key="item.id" :value="item.id" v-for="item in typeLists">{{ item.name }}</a-checkbox>
<a-checkbox :key="item.id" :value="item.id" v-for="item in typeLists.list">{{ item.name }}</a-checkbox>
</a-checkbox-group>
</a-form-item>
<!-- 价格 -->
@ -194,6 +195,7 @@
:wrapper-col="formItemLayout.wrapperCol"
label="所属单位"
>
<!-- <div>{{ types}}</div> -->
<a-select
placeholder="所属单位"
style="width:100%"
@ -204,7 +206,7 @@
<a-select-option
:key="index"
:value="type.id"
v-for="(type, index) in types"
v-for="(type, index) in types.list"
>{{ type.name }}</a-select-option>
</a-select>
</a-form-item>
@ -250,7 +252,7 @@ export default {
name: 'TransferEdit',
props: {
editVisible: { type: Boolean, default: false },
typeLists: { type: Array, default: () => [] },
typeLists: { type: Object, default: () => {} },
editItem: { type: Object, default: () => {} },
},
data() {
@ -297,6 +299,7 @@ export default {
},
};
this.types = await this.getSelModelSearch(params);
console.log("==========>走到了created",this.type)
},
methods: {

2
src/components/Transfer/TransferSearch.vue

@ -4,7 +4,7 @@
<div>
<a-input placeholder="设备名称" style="width: 150px" v-model="content" />
<a-checkbox-group @change="onChange" class="ml-3">
<a-checkbox :key="item.id" :value="item.id" v-for="item in typeLists">{{ item.name }}</a-checkbox>
<a-checkbox :key="item.id" :value="item.id" v-for="item in typeLists.list">{{ item.name }}</a-checkbox>
</a-checkbox-group>
<a-button @click="handleTableChange" class="ml-3" type="primary">搜索</a-button>
</div>

12
src/config/api.js

@ -21,6 +21,8 @@ const service = `${greenvalley}/service`; // 三大平台相关接口
const comment = `${greenvalley}/comment`; // 交流社区相关操作
const place = `${greenvalley}/place`; // 孵化部入驻实体申请相关操作
const business = `${greenvalley}/business`; // 交流社区相关操作
const personApply = `${greenvalley}/PersonApply`; // 加入我们相关操作
export const upload = `${greenvalley}/file/upload`;
// websocket基础地址
@ -247,3 +249,13 @@ export const applyBackend = params => axios.post(`${greenvalley}/place/applyBack
// 添加/修改发布部门时的发布部门
export const getAreaBranch = params => axios.post(`${policy}/policy/area`, params);
// 加入我们的相关接口
export const contactUs = params => axios.post(`${personApply}/joinUs`, params);
// 申请修改
export const contactUsStatus = params => axios.post(`${personApply}/joinUsStatus`, params);
// 后台查询修改
export const contactUsSearch = params => axios.post(`${personApply}/SearchJoinUs`, params);

9
src/router/index.js

@ -77,7 +77,14 @@ const routes = [
name: 'CooperativePartner',
component: () => import(/* webpackChunkName: "cooperative-partner" */ 'views/CooperativePartner/CooperativePartner.vue'),
},
// 衍生企业
// 联系我们
{
path: '/contact-us-derivative-enterprise',
name: 'ContactUs',
component: () =>
import(/* webpackChunkName: "ContactUs" */ 'views/ContactUs/ContactUs.vue'),
},
// 衍生企业
{
path: '/about-us-derivative-enterprise',
name: 'AboutUsDerivativeEnterprise',

69
src/views/ContactUs/ContactUs.vue

@ -0,0 +1,69 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<contact-us-search :type-lists="typeLists" @contactUsSearch="contactUsSearch" />
<contact-us-date :lists="lists" :pagination="pagination" @contactUsSearch="contactUsSearch" />
</div>
</template>
<script>
import ContactUsSearch from 'components/Contact/ContactUsSearch.vue';
import ContactUsDate from 'components/Contact/ContactDate.vue';
import { contactUsSearch } from 'config/api';
import { mapActions } from 'vuex';
export default {
name: 'Contact',
components: {
ContactUsSearch,
ContactUsDate,
},
data() {
return {
lists: [],
pagination: { current: 1, pageSize: 10 },
typeLists: [],
};
},
async created() {
await this.contactUsSearch();
},
methods: {
...mapActions(['getSelModelSearch']),
/**
* 后台查询修改
*
*/
async contactUsSearch(condition) {
try {
const params = {
param: {
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
const res = await contactUsSearch(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.lists = data.list;
console.log("========>是否获取到数据")
const paper = { ...this.pagination };
paper.current = data.pageNum;
paper.total = +data.total;
paper.pageSize = data.pageSize;
this.pagination = paper;
} else {
throw msg || '获取失败';
}
} catch (error) {
this.$message.error(error);
}
},
},
};
</script>
Loading…
Cancel
Save