Browse Source

联系我们

master
rose 4 years ago
parent
commit
8111d67849
  1. 14
      src/App.vue
  2. 326
      src/components/Contact/ContactAdd.vue
  3. 136
      src/components/Contact/ContactDate.vue
  4. 193
      src/components/Contact/ContactEdit.vue
  5. 6
      src/components/Contact/ContactUsSearch.vue
  6. 9
      src/config/api.js

14
src/App.vue

@ -1,7 +1,7 @@
<template>
<a-config-provider :locale="zh_CN">
<div class="d-flex flex-row flex-nowrap" id="app">
<btn-con />
<!-- <btn-con /> -->
<router-view class="flex-1 bg pa-3"></router-view>
</div>
</a-config-provider>
@ -10,11 +10,11 @@
<script>
import { mapState, mapActions, mapMutations } from 'vuex';
import zh_CN from 'ant-design-vue/lib/locale-provider/zh_CN';
import BtnCon from 'components/BtnCom/BtnCon.vue';
// import BtnCon from 'components/BtnCom/BtnCon.vue';
//
export default {
name: 'App',
components: { BtnCon },
// components: { BtnCon },
data() {
return {zh_CN,};
},
@ -33,9 +33,9 @@ export default {
created() {
//
const userId = '1218763410024566784';
const params = { userId };
this.getUserId(params);
// const userId = '1218763410024566784';
// const params = { userId };
// this.getUserId(params);
const that = this;
window.plugin = window.TallPlugin.init();

326
src/components/Contact/ContactAdd.vue

@ -0,0 +1,326 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 添加 -->
<a-modal
:mask-closable="false"
@cancel="$emit('closeModal')"
destroy-on-close
footer
title="添加仪器"
v-model="visible"
width="700px"
>
<a-form :form="form" @submit="handleSubmit">
<!-- 仪器中文名 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="仪器中文名"
>
<a-input
placeholder="仪器中文名"
v-decorator="[
'name',
{
rules: [
{ required: true, message: '仪器中文名不能为空' },
{ whitespace: true, message: '仪器中文名不能为空' },
{ max: 140, massage: '仪器中文名最多140个字符' },
],
},
]"
/>
</a-form-item>
<!-- 仪器英文名 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="仪器英文名"
>
<a-input
placeholder="仪器英文名"
v-decorator="[
'englishname'
]"
/>
</a-form-item>
<!-- 国别 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="国别"
>
<a-input
placeholder="国别"
v-decorator="[
'countries'
]"
/>
</a-form-item>
<!-- 设备所属 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="设备所属"
>
<a-input
placeholder="设备所属"
v-decorator="[
'belonging'
]"
/>
</a-form-item>
<!-- 编号 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="编号"
>
<a-input
placeholder="编号"
v-decorator="[
'identifier'
]"
/>
</a-form-item>
<!-- 制造商 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="制造商"
>
<a-input
placeholder="制造商"
v-decorator="[
'manufactor'
]"
/>
</a-form-item>
<!-- 型号 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="型号"
>
<a-input
placeholder="型号"
v-decorator="[
'model'
]"
/>
</a-form-item>
<!-- 类型 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="类型"
>
<a-checkbox-group
v-decorator="[
'modelIds',
{
rules: [
{ required: true, message: '类型不能为空' },
],
},
]"
>
<a-checkbox :key="item.id" :value="item.id" v-for="item in typeLists">{{ item.name }}</a-checkbox>
</a-checkbox-group>
</a-form-item>
<!-- 价格 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="价格(万元)"
>
<a-input
placeholder="价格(万元)"
v-decorator="[
'money'
]"
/>
</a-form-item>
<!-- 性能指标 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="性能指标"
>
<a-input
placeholder="性能指标"
v-decorator="[
'performance'
]"
/>
</a-form-item>
<!-- 图片 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="图片"
>
<a-upload
:action="upload"
:before-upload="beforeUpload"
@change="handleChange"
list-type="picture"
name="files"
v-decorator="[
'picId',
{
rules: [
{ required: true, message: '图片不能为空' },
],
},
]"
>
<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-input
placeholder="规格"
v-decorator="[
'specifications'
]"
/>
</a-form-item>
<!-- 所属单位 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="所属单位"
>
<a-select
placeholder="所属单位"
style="width:100%"
v-decorator="[
'research'
]"
>
<a-select-option
:key="index"
:value="type.id"
v-for="(type, index) in types"
>{{ type.name }}</a-select-option>
</a-select>
</a-form-item>
<!-- 用途 -->
<a-form-item
:label-col="formItemLayout.labelCol"
:wrapper-col="formItemLayout.wrapperCol"
label="用途"
>
<a-textarea
placeholder="用途"
v-decorator="['purpose',{
rules: [
{ required: true, message: '用途不能为空' },
],
},]"
/>
</a-form-item>
<a-form-item class="d-flex flex-row-reverse">
<a-button @click="$emit('closeModal')" class="mr-3">取消</a-button>
<a-button class="white--text" html-type="submit" type="primary">保存</a-button>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import { upload, selInstrumentAdd } from 'config/api';
import { mapActions } from 'vuex';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
};
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default {
name: 'ContactAdd',
props: { visible: { type: Boolean, default: false }, typeLists: { type: Array, default: () => [] } },
data() {
return {
formItemLayout,
tailItemLayout,
form: this.$form.createForm(this, { name: 'contact-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;
},
types: [],
};
},
async created() {
const params = {
param: {
pageNum: 1,
pageSize: 10,
model: 2,
},
};
this.types = await this.getSelModelSearch(params);
},
methods: {
...mapActions(['getSelModelSearch']),
//
handleChange(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;
}
},
//
handleSubmit(e) {
e.preventDefault();
this.form.validateFieldsAndScroll(async (err, values) => {
if (!err) {
try {
const { fileList } = this;
const params = { param: values };
params.param.picId = fileList[0];
const res = await selInstrumentAdd(params);
const { data, msg, code } = res.data;
//
if (code === 200) {
this.$message.success('添加成功');
this.$emit('handleTableChange');
} else {
throw msg;
}
this.$emit('closeModal');
} catch (error) {
this.$emit('closeModal');
this.$message.error(error || '添加仪器失败');
}
}
});
},
},
};
</script>
<style scoped lang="stylus"></style>

136
src/components/Contact/ContactDate.vue

@ -1,6 +1,5 @@
<template>
<div class="main flex-1">
<div>是否显示了</div>
<a-spin :spinning="showEdit">
<div style="width:100%" v-if="lists && lists.length > 0">
<a-table
@ -11,27 +10,57 @@
: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="name" slot-scope="text, record">
<div>{{ record.name }}</div>
</template>
<template slot="residence" slot-scope="text, record">
<div>{{ record.address }}</div>
</template>
<template slot="birth" slot-scope="text, record">
<div>{{ record.birthday }}</div>
</template>
<template slot="account" slot-scope="text, record">
<div>{{ record.birthdayPlace }}</div>
</template>
<template slot="eduExperience" slot-scope="text, record">
<div>{{ record.eduExperience }}</div>
</template>
<template slot="workExperience" slot-scope="text, record">
<div>{{ record.jobExpirence }}</div>
</template>
<!-- 图片 -->
<template slot="visitLocation" slot-scope="text, record">
<img :src="record.visitLocation" height="50" width="50" />
<template slot="phone" slot-scope="text, record">
<div>{{ record.phone }}</div>
</template>
<template slot="jobIntension" slot-scope="text, record">
<div>{{ record.jobWilling }}</div>
</template>
<template slot="edit" slot-scope="text, record">
<a-icon @click="showEditModal(record)" class="pointer" theme="twoTone" type="edit" />
<!-- <a-icon @click="showEditModal(record)" class="pointer" theme="twoTone" type="edit" /> -->
<a-switch
style="padding:0px"
@change="joinUsStatus($event,record.id)" checked-children="已审核"
default-un-checked un-checked-children="未审核"
/>
<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-icon class="ml-2 pointer" theme="twoTone" two-tone-color="#ff0000" type="delete" />
</a-popconfirm>
</template>
@ -42,20 +71,20 @@
<!-- <div>{{ editItem }}</div> -->
<!-- 编辑 -->
<!-- <transfer-edit
<contact-edit
:edit-item="editItem"
:edit-visible="editVisible"
:type-lists="typeLists"
@closeModal="closeModal"
@selInstrumentSearch="selInstrumentSearch"
/> -->
/>
</a-spin>
</div>
</template>
<script>
// import TransferEdit from 'components/Transfer/TransferEdit.vue';
import { selInstrumentDelete, selInstrumentMes } from 'config/api';
import ContactEdit from 'components/Contact/ContactEdit.vue';
import { deleteJoinUs, joinUsStatus } from 'config/api';
const columns = [
{
@ -65,31 +94,42 @@ const columns = [
key: 'id',
width: '7%',
scopedSlots: { customRender: 'id' },
},
{
title: '名字',
align: 'center',
dataIndex: 'name',
key: 'name',
width: '7%',
scopedSlots: { customRender: 'name' },
},
{
title: '现居住地',
align: 'center',
dataIndex: 'residence',
key: 'residence',
scopedSlots: { customRender: 'residence' },
},
{
title: '出生年月',
align: 'center',
dataIndex: 'birth',
key: 'birth',
scopedSlots: { customRender: 'birth' }
},
{
title: '户口所在地',
align: 'center',
dataIndex: 'account',
key: 'account',
scopedSlots: { customRender: 'account' }
},
{
title: '教育经历',
align: 'center',
dataIndex: 'eduExperience',
key: 'eduExperience',
scopedSlots: { customRender: 'eduExperienchukz' },
scopedSlots: { customRender: 'eduExperience' },
},
{
title: '电子邮件',
@ -105,20 +145,40 @@ const columns = [
key: 'workExperience',
scopedSlots: { customRender: 'workExperience' },
},
{
{
title: '手机号',
align: 'center',
dataIndex: 'phone',
key: 'phone',
scopedSlots: { customRender: 'phone' },
},
{
title: '求职意向',
align: 'center',
dataIndex: 'jobIntension',
key: 'jobIntension',
scopedSlots: { customRender: 'jobIntension' },
},
// {
// title: '',
// align: 'center',
// dataIndex: 'shenhe',
// key: 'shenhe',
// scopedSlots: { customRender: 'shenhe' },
// },
{
title: '编辑',
align: 'center',
dataIndex: 'edit',
width: '130px',
key: 'edit',
scopedSlots: { customRender: 'edit' },
},
];
export default {
name: 'ContactDate',
// components: {
// TransferEdit,
// },
name: 'TransferDate',
components: {ContactEdit,},
props: {
lists: { type: Array, default: () => [] },
@ -152,13 +212,25 @@ export default {
},
methods: {
async joinUsStatus(e,id){
if(e === true){
const params = { param: { id, dealStatus: 1 } };
await joinUsStatus(params);
}else if(e === false){
const params2 = { param: { id, dealStatus: 0 } };
await joinUsStatus(params2);
}
//
},
async showEditModal(record) {
console.log(record)
this.showEdit = true;
await this.getDetail(true, record);
this.showEdit = false;
this.editVisible = true;
this.editItem = record;
// this.editItem = record;
console.log('==============>showEditModal结束')
},
@ -167,13 +239,13 @@ export default {
},
async selInstrumentSearch() {
await this.$emit('selInstrumentSearch');
await this.$emit('contactUsSearch');
},
handleTableChange(pagination) {
const { current, pageSize } = pagination;
const condition = { current, pageSize };
this.$emit('selInstrumentSearch', condition);
this.$emit('contactUsSearch', condition);
},
//
@ -181,16 +253,16 @@ export default {
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;
}
// const params = { param: { id: record.id } };
// const { data, msg, code } = res.data;
// this.spinning = false;
// if (code === 200) {
const item = this.lists.find(item => item.id === record.id);
this.editItem = item
// } else {
// throw msg;
// }
} catch (error) {
this.$message.error(error || '查询失败');
}
@ -200,11 +272,11 @@ export default {
async onDelete(id) {
try {
const params = { param: { id } };
const res = await selInstrumentDelete(params);
const res = await deleteJoinUs(params);
const { data, msg, code } = res.data;
if (code === 200) {
this.$message.success('删除成功');
this.$emit('selInstrumentSearch');
this.$emit('contactUsSearch');
} else {
throw msg;
}

193
src/components/Contact/ContactEdit.vue

@ -0,0 +1,193 @@
<template>
<div class="d-flex flex-wrap pb-3">
<!-- 编辑 -->
<a-modal
:mask-closable="false"
@cancel="$emit('closeModal')"
destroy-on-close
footer
title="修改"
v-model="editVisible"
width="700px"
>
<div>测试能不能进的来</div>
<div>{{ editItem }}</div>
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-form-model-item label="Activity name">
<a-input v-model="form.name" />
</a-form-model-item>
<a-form-model-item label="Activity zone">
<a-select v-model="form.region" placeholder="please select your zone">
<a-select-option value="shanghai">
Zone one
</a-select-option>
<a-select-option value="beijing">
Zone two
</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="Activity time">
<a-date-picker
v-model="form.date1"
show-time
type="date"
placeholder="Pick a date"
style="width: 100%;"
/>
</a-form-model-item>
<a-form-model-item label="Instant delivery">
<a-switch v-model="form.delivery" />
</a-form-model-item>
<a-form-model-item label="Activity type">
<a-checkbox-group v-model="form.type">
<a-checkbox value="1" name="type">
Online
</a-checkbox>
<a-checkbox value="2" name="type">
Promotion
</a-checkbox>
<a-checkbox value="3" name="type">
Offline
</a-checkbox>
</a-checkbox-group>
</a-form-model-item>
<a-form-model-item label="Resources">
<a-radio-group v-model="form.resource">
<a-radio value="1">
Sponsor
</a-radio>
<a-radio value="2">
Venue
</a-radio>
</a-radio-group>
</a-form-model-item>
<a-form-model-item label="Activity form">
<a-input v-model="form.desc" type="textarea" />
</a-form-model-item>
<a-form-model-item :wrapper-col="{ span: 14, offset: 4 }">
<a-button type="primary" @click="onSubmit">
Create
</a-button>
<a-button style="margin-left: 10px;">
Cancel
</a-button>
</a-form-model-item>
</a-form-model>
</a-modal>
</div>
</template>
<script>
import { upload, selInstrumentUpdate } from 'config/api';
import { mapActions } from 'vuex';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 16 },
};
const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };
export default {
name: 'ContactEdit',
props: {
editVisible: { type: Boolean, default: false },
typeLists: { type: Array, default: () => [] },
editItem: { type: Object, default: () => {} },
},
data() {
return {
formItemLayout,
tailItemLayout,
types: [],
labelCol: { span: 4 },
wrapperCol: { span: 14 },
form: {
name: '',
region: undefined,
date1: undefined,
delivery: false,
type: [],
resource: '',
desc: '',
},
};
},
computed: {
oldTypes() {
const { typeLists, editItem } = this;
let arr = [];
for (let i = 0; i < typeLists.length; i++) {
const item = typeLists[i];
const a = editItem.info.names.findIndex(a => a === item.name);
const index = arr.findIndex(c => c === a);
if (a !== -1 && index === -1) {
arr.push(item.id);
}
}
return arr;
},
},
async created() {
const params = {
param: {
pageNum: 1,
pageSize: 10,
model: 2,
},
};
this.types = await this.getSelModelSearch(params);
},
methods: {
...mapActions(['getSelModelSearch']),
//
handleChange(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;
}
},
//
// handleSubmit(e) {
// e.preventDefault();
// this.form.validateFieldsAndScroll(async (err, values) => {
// if (!err) {
// try {
// const { fileList, editItem } = this;
// const params = { param: values };
// params.param.id = editItem.id;
// params.param.picId = fileList[0];
// const res = await selInstrumentUpdate(params);
// const { data, msg, code } = res.data;
// //
// if (code === 200) {
// this.$message.success('');
// this.$emit('selInstrumentSearch');
// } else {
// this.$message.error('');
// throw msg;
// }
// this.$emit('closeModal');
// } catch (error) {
// this.$emit('closeModal');
// this.$message.error(error || '');
// }
// }
// });
// },
onSubmit() {
console.log('submit!', this.form);
},
},
};
</script>
<style scoped lang="stylus"></style>

6
src/components/Contact/ContactUsSearch.vue

@ -2,17 +2,13 @@
<div class="d-flex flex-wrap pb-3">
<!-- 中文名称 -->
<div>
<a-input placeholder="设备名称" style="width: 150px" v-model="content" />
<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>

9
src/config/api.js

@ -256,9 +256,14 @@ export const getAreaBranch = params => axios.post(`${policy}/policy/area`, param
// 加入我们的相关接口
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);
// 后台查询删除
export const deleteJoinUs = params => axios.post(`${personApply}/DeleteJoinUs`, params);
// 后台申请修改状态
export const joinUsStatus = params => axios.post(`${personApply}/JoinUsStatus`, params);
Loading…
Cancel
Save