Commit a50be0f1 authored by 徐俊's avatar 徐俊
parents 99b7475d ad743c5f
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</div> </div>
<div class="header_btn"> <div class="header_btn">
<div class="toolbar-items"> <div class="toolbar-items">
<a-dropdown style="margin-right: 5px;" :trigger="['click','hover']"> <a-dropdown style="margin-right: 2px;" :trigger="['click','hover']">
<a class="ant-dropdown-link"> <a class="ant-dropdown-link">
<a-avatar class="ava-img" src="https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png" /> <a-avatar class="ava-img" src="https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png" />
<span class="title_f" v-if="userInfo.unitName"> {{userInfo.unitName}}</span> <span class="title_f" v-if="userInfo.unitName"> {{userInfo.unitName}}</span>
...@@ -45,6 +45,16 @@ ...@@ -45,6 +45,16 @@
</a-menu> </a-menu>
</a-dropdown> </a-dropdown>
</div> </div>
<div class="toolbar-items">
<a href="javascript:;" @click="logout">
<div style="padding: 2px 30px 2px 6px;color: rgb(89 89 89);">
<span>
<a-icon type="poweroff" style="margin-right: 4px" />
</span>
<span>退出</span>
</div>
</a>
</div>
<div class="toolbar-items" v-if="false"> <div class="toolbar-items" v-if="false">
<a-dropdown style="margin-right: 5px;" :trigger="['click','hover']"> <a-dropdown style="margin-right: 5px;" :trigger="['click','hover']">
<a class="ant-dropdown-link"> <a class="ant-dropdown-link">
......
...@@ -89,6 +89,12 @@ export default { ...@@ -89,6 +89,12 @@ export default {
handleChange (value) { handleChange (value) {
this.selected = value; this.selected = value;
this.$emit("input", value); this.$emit("input", value);
var newArr = this.data.filter(x => x.key == value);
if (!!newArr && newArr.length > 0) {
var text = !!value ? newArr[0].title : ''
this.$emit('changeTitle', text)
}
this.$emit("change"); this.$emit("change");
}, },
loadSelected (value) { loadSelected (value) {
......
...@@ -23,18 +23,24 @@ ...@@ -23,18 +23,24 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row v-if="isShow">
<a-col :span="4" class="bg-gray">
<div>选择单位</div>
</a-col>
<a-col :span="20">
<a-form-model-item ref="treeCode" prop="treeCode">
<unit-tree-select v-model="formData.treeCode" :disable="false" :unitType="2" :width="200" /> <span style="color: green;margin-left: 6px;">※系统中单位选择此项</span>
</a-form-model-item>
</a-col>
</a-row>
<a-row> <a-row>
<a-col :span="4" class="bg-gray"> <a-col :span="4" class="bg-gray">
<div class="required">性别</div> <div>工作单位</div>
</a-col> </a-col>
<a-col :span="20"> <a-col :span="20">
<a-form-model-item ref="sex" prop="sex"> <a-form-model-item ref="workUnit" prop="workUnit">
<a-select v-model="formData.sex" style="width: 130px" :disabled="!!formData.id"> <a-input v-model="formData.workUnit" @blur="() => {$refs.workUnit.onFieldBlur(); }" style="width: 200px" /> <span style="color: green;margin-left: 6px;">※非系统中单位填写此项</span>
<a-select-option value="">--请选择性别--</a-select-option> </a-form-model-item>
<a-select-option value="男"></a-select-option>
<a-select-option value="女"></a-select-option>
</a-select>
</a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row> <a-row>
...@@ -68,16 +74,6 @@ ...@@ -68,16 +74,6 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row v-if="isShow">
<a-col :span="4" class="bg-gray">
<div class="required">工作单位</div>
</a-col>
<a-col :span="20">
<a-form-model-item ref="treeCode" prop="treeCode">
<unit-tree-select v-model="formData.treeCode" :disable="false" :unitType="2" :width="300" />
</a-form-model-item>
</a-col>
</a-row>
<a-row> <a-row>
<a-col :span="4" class="bg-gray" style="padding-left:16px"> <a-col :span="4" class="bg-gray" style="padding-left:16px">
<div> 邮箱</div> <div> 邮箱</div>
...@@ -161,6 +157,7 @@ export default { ...@@ -161,6 +157,7 @@ export default {
{ required: false, validator: checkEmail, trigger: 'blur' } { required: false, validator: checkEmail, trigger: 'blur' }
], ],
personName: [{ required: true, message: '请输入姓名', trigger: 'blur' }], personName: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
workUnit: [{ required: false, message: '请输入工作单位', trigger: 'blur' }],
sex: [{ required: true, message: '请选择性别', trigger: 'change' }], sex: [{ required: true, message: '请选择性别', trigger: 'change' }],
auditSpecList: [{ required: true, message: '请选择评审专业', trigger: 'change' }], auditSpecList: [{ required: true, message: '请选择评审专业', trigger: 'change' }],
title: [{ required: true, message: '请选择职称', trigger: 'change' }], title: [{ required: true, message: '请选择职称', trigger: 'change' }],
......
<template> <template>
<div class="app-content" style="height:75vh;overflow: auto;"> <div class="app-content" style="height:75vh;overflow: auto;">
<div class="submit-btn upload-header"> <a-spin :spinning="loading" style="width: 100%;height: 100%;">
<a :href="url.downloadUrl" download="ExpertInfo.xlsx"> <div style="width:100%; height: 40px;">
<a-icon type="download"></a-icon>&nbsp;<span style="color:green;text-decoration:underline;">模板下载</span> <up-load @beforeUpload="beforeUpload" :format="['xls', 'xlsx']" />
</a> </div>
<FileUpload @beforeUpload="beforeUpload" /> <div style="width:100%;height: calc(100% - 80px);overflow: auto;">
<a-divider style="height: 1px; background-color: #e8e8e8;" /> <a-table :dataSource="tableData" :columns="columns" rowKey="index" :pagination="false" :loading="loading">
</div> <template slot="msg" slot-scope="record">
<a-divider style="height: 1px; background-color: #e8e8e8;" /> <span v-if="!!record.msg " style="color: red;">
<div class="upload-table"> {{ record.msg }}
<a-table :dataSource="tableData" :columns="columns" rowKey="index" :pagination="false" :loading="loading"> </span>
<template slot="stateSwitch" slot-scope="record"> </template>
<a-switch checked-children="正常" un-checked-children="注销" :checked="checkedState(record)" @change="switchChange($event, record)" /> <template slot="stateSwitch" slot-scope="record">
</template> <a-switch checked-children="正常" un-checked-children="注销" :checked="checkedState(record)" @change="switchChange($event, record)" />
<template slot="option" slot-scope="record"> </template>
<a-button type="primary" size="small" @click="recordClick(record, 'view')">查看</a-button> <template slot="option" slot-scope="record">
<a-button type="primary" size="small" @click="recordClick(record, 'edit')">修改</a-button> <a-button type="primary" size="small" @click="recordClick(record, 'view')">查看</a-button>
<a-button type="primary" size="small" @click="recordClick(record, 'reset')">重置密码</a-button> <a-button type="primary" size="small" @click="recordClick(record, 'edit')">修改</a-button>
</template> <a-button type="primary" size="small" @click="recordClick(record, 'reset')">重置密码</a-button>
</a-table> </template>
</div> </a-table>
<div class="upload-bottom" style="text-align:center;padding:6px 0"> </div>
<a-button type="primary" @click="dataImport" :disabled="disabled">导入</a-button> <div style="text-align:center;width:100%; height: 36px;">
</div> <a :href="url" download="expertTemplate.xlsx" style="margin-right: 30px;">
<a-icon type="download"></a-icon>&nbsp;<span style="color:green;text-decoration:underline;">模板下载</span>
</a>
<a-button type="primary" @click="dataImport" :disabled="disabled">导入</a-button>
</div>
</a-spin>
</div> </div>
</template> </template>
<script> <script>
import { isEmptyParams, readExcelFile, personGender, personBirthday, checkIdentitytionId, checkEmail, checkPhone } from "@/views/utils/common" import { isEmptyParams, readExcelFile, personGender, personBirthday, checkIdentitytionId, checkEmail, checkPhone } from "@/views/utils/common"
import moment from "moment" import moment from "moment"
import { checkCertId } from "@/views/utils/validate"
export default { export default {
name: "expertImport", name: "expertImport",
...@@ -42,13 +48,15 @@ export default { ...@@ -42,13 +48,15 @@ export default {
{ title: "邮箱", dataIndex: "email", align: 'center' }, { title: "邮箱", dataIndex: "email", align: 'center' },
{ title: "职称", dataIndex: "titleName", align: 'center' }, { title: "职称", dataIndex: "titleName", align: 'center' },
{ title: "专业", dataIndex: "specName", align: 'center' }, { title: "专业", dataIndex: "specName", align: 'center' },
{ title: '单位', dataIndex: 'unitName', align: 'center' }, { title: '工作单位', dataIndex: 'unitName', align: 'center' },
{ title: '验证结果', scopedSlots: { customRender: 'msg' }, align: 'center' },
], ],
tableData: [], tableData: [],
disabled: true, disabled: true,
errorState: false,
loading: false, loading: false,
url: { url: {
downloadUrl: '/downloadFile/ExpertInfo.xlsx', downloadUrl: '/downloadFile/expertTemplate.xlsx',
} }
}; };
}, },
...@@ -57,6 +65,7 @@ export default { ...@@ -57,6 +65,7 @@ export default {
}, },
methods: { methods: {
beforeUpload (file) { beforeUpload (file) {
this.errorState = false
this.tableData = [] this.tableData = []
let list = readExcelFile(file, 0) let list = readExcelFile(file, 0)
let certList = [] let certList = []
...@@ -66,9 +75,42 @@ export default { ...@@ -66,9 +75,42 @@ export default {
list.then((d) => { list.then((d) => {
//读取文件数据 //读取文件数据
d.forEach(e => { d.forEach(e => {
let gender = personGender(e.证件号) let msg = ''
let birthday = personBirthday(e.证件号) + ' 00:00:00' let certId = e.证件号
let expert = { personName: e.姓名, certId: e.证件号, sex: gender, birthday: moment(birthday).format('YYYY-MM-DD HH:mm:ss'), mobile: e.手机号, email: e.邮箱, specName: e.专业, titleName: e.职称, unitName: e.单位 } let gender = null
let birthday = null
if (!!!e.姓名) {
msg = ';姓名不能为空!'
}
if (!!!e.证件号) {
msg += ';证件号不能为空!'
}
if (!!!e.手机号) {
msg += ';手机号不能为空!'
}
if (!!!e.邮箱) {
msg += ';邮箱不能为空!'
}
if (!!!e.专业) {
msg += ';专业不能为空!'
}
if (!!!e.职称) {
msg += ';职称不能为空!'
}
if (!!!e.工作单位) {
msg += ';工作单位不能为空!'
}
if (!!msg) {
this.errorState = true
}
if (checkCertId(certId)) {
gender = personGender(certId)
birthday = personBirthday(certId) + ' 00:00:00'
}
let expert = { personName: e.姓名, certId: certId, sex: gender, birthday: birthday, mobile: e.手机号, email: e.邮箱, specName: e.专业, titleName: e.职称, unitName: e.工作单位, msg: msg }
exportList.push(expert) exportList.push(expert)
certList.push(e.证件号) certList.push(e.证件号)
mobileList.push(e.手机号) mobileList.push(e.手机号)
...@@ -85,13 +127,12 @@ export default { ...@@ -85,13 +127,12 @@ export default {
this.$message.error('证件号出现重复!') this.$message.error('证件号出现重复!')
return false return false
} }
if (exportList.length > 0) { if (exportList.length > 0) {
this.tableData = exportList this.tableData = exportList
this.disabled = false this.disabled = this.errorState ? true : false
} }
}) })
return false return false
}, },
dataImport () { dataImport () {
...@@ -105,6 +146,7 @@ export default { ...@@ -105,6 +146,7 @@ export default {
if (data) { if (data) {
this.$message.info(data) this.$message.info(data)
this.tableData = [] this.tableData = []
this.$emit('save', true)
} }
}) })
} }
...@@ -112,16 +154,9 @@ export default { ...@@ -112,16 +154,9 @@ export default {
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.upload-header { ::v-deep .ant-spin-container {
height: 30px; width: 100%;
} height: 100%;
.upload-table {
min-height: 150px;
max-height: calc(100% - 75px);
overflow-y: auto;
}
.upload-bottom {
height: 42px;
} }
</style> </style>
...@@ -52,8 +52,8 @@ ...@@ -52,8 +52,8 @@
</template> </template>
<template slot="option" slot-scope="record"> <template slot="option" slot-scope="record">
<a-button type="link" size="small" @click="recordClick(record,'edit')">修改</a-button> <a-button type="link" size="small" @click="recordClick(record,'edit')">修改</a-button>
<a-button type="link" size="small" @click="recordClick(record,'reset')">重置密码</a-button> <!-- <a-button type="link" size="small" @click="recordClick(record,'reset')">重置密码</a-button> -->
<a-button type="link" size="small" @click="recordClick(record,'del')">删除</a-button> <!-- <a-button type="link" size="small" @click="recordClick(record,'del')">删除</a-button> -->
</template> </template>
</a-table> </a-table>
<a-pagination v-if="pagination.total > 0" :total="pagination.total" show-size-changer show-quick-jumper v-model="pagination.pageIndex" :page-size="pagination.pageSize" :page-size-options="pagination.pageSizeOptions" @showSizeChange="showSizeChange" @change="change" :showTotal="() => `共 ${pagination.total} 条`" /> <a-pagination v-if="pagination.total > 0" :total="pagination.total" show-size-changer show-quick-jumper v-model="pagination.pageIndex" :page-size="pagination.pageSize" :page-size-options="pagination.pageSizeOptions" @showSizeChange="showSizeChange" @change="change" :showTotal="() => `共 ${pagination.total} 条`" />
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<expert-edit v-model="id" @close="closeWindow"></expert-edit> <expert-edit v-model="id" @close="closeWindow"></expert-edit>
</a-modal> </a-modal>
<a-modal v-model="visibleImport" title="专家导入" width="80%" :dialog-style="{ top: '8%' }" :footer="null" destroyOnClose> <a-modal v-model="visibleImport" title="专家导入" width="80%" :dialog-style="{ top: '8%' }" :footer="null" destroyOnClose>
<expert-import /> <expert-import @save="importSave" />
</a-modal> </a-modal>
</div> </div>
</template> </template>
...@@ -92,6 +92,7 @@ export default { ...@@ -92,6 +92,7 @@ export default {
{ title: '评审专业', scopedSlots: { customRender: 'spec' }, width: '10%', }, { title: '评审专业', scopedSlots: { customRender: 'spec' }, width: '10%', },
{ title: '单位', dataIndex: 'unitName', align: 'center' }, { title: '单位', dataIndex: 'unitName', align: 'center' },
{ title: '用户名', dataIndex: 'username', align: 'center' }, { title: '用户名', dataIndex: 'username', align: 'center' },
{ title: '密码', dataIndex: 'password', align: 'center' },
{ title: '状态', scopedSlots: { customRender: 'stateSwitch' }, align: 'center' }, { title: '状态', scopedSlots: { customRender: 'stateSwitch' }, align: 'center' },
{ title: '操作', scopedSlots: { customRender: 'option' }, align: 'center', fixed: 'right', width: '180px', }, { title: '操作', scopedSlots: { customRender: 'option' }, align: 'center', fixed: 'right', width: '180px', },
], ],
...@@ -155,6 +156,9 @@ export default { ...@@ -155,6 +156,9 @@ export default {
this.pagination.pageSize = pageSize this.pagination.pageSize = pageSize
this.getListByPage() this.getListByPage()
}, },
importSave (value) {
this.visibleImport = false;
},
importExcel () { importExcel () {
this.visibleImport = true; this.visibleImport = true;
}, },
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</a-form-model> </a-form-model>
</div> </div>
<div class="from-bottom"> <div class="from-bottom">
<div class="bottom-block left"><a :href="url.downloadUrl">申报流程下载</a></div> <!-- <div class="bottom-block left"><a :href="url.downloadUrl">申报流程下载</a></div> -->
<div class="bottom-block right"> <div class="bottom-block right">
<a href="#" @click="clickRegister" style="margin-right: 32px;">注册</a> <a href="#" @click="clickRegister" style="margin-right: 32px;">注册</a>
<a href="#" @click="clickReset">忘记密码?</a> <a href="#" @click="clickReset">忘记密码?</a>
......
...@@ -23,20 +23,6 @@ ...@@ -23,20 +23,6 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row>
<a-col :span="4" class="bg-gray">
<div class="required">性别</div>
</a-col>
<a-col :span="20">
<a-form-model-item ref="sex" prop="sex">
<a-select v-model="formData.sex" style="width: 130px" :disabled="!!formData.id">
<a-select-option value="">--请选择性别--</a-select-option>
<a-select-option value="男"></a-select-option>
<a-select-option value="女"></a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
<a-row> <a-row>
<a-col :span="4" class="bg-gray"> <a-col :span="4" class="bg-gray">
<div class="required">手机号</div> <div class="required">手机号</div>
...@@ -68,16 +54,6 @@ ...@@ -68,16 +54,6 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row v-if="isShow">
<a-col :span="4" class="bg-gray">
<div class="required">工作单位</div>
</a-col>
<a-col :span="20">
<a-form-model-item ref="treeCode" prop="treeCode">
<unit-tree-select v-model="formData.treeCode" :disable="false" :unitType="2" :width="300" />
</a-form-model-item>
</a-col>
</a-row>
<a-row> <a-row>
<a-col :span="4" class="bg-gray" style="padding-left:16px"> <a-col :span="4" class="bg-gray" style="padding-left:16px">
<div> 邮箱</div> <div> 邮箱</div>
...@@ -161,10 +137,10 @@ export default { ...@@ -161,10 +137,10 @@ export default {
{ required: false, validator: checkEmail, trigger: 'blur' } { required: false, validator: checkEmail, trigger: 'blur' }
], ],
personName: [{ required: true, message: '请输入姓名', trigger: 'blur' }], personName: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
sex: [{ required: true, message: '请选择性别', trigger: 'change' }], // sex: [{ required: true, message: '请选择性别', trigger: 'change' }],
auditSpecList: [{ required: true, message: '请选择评审专业', trigger: 'change' }], auditSpecList: [{ required: true, message: '请选择评审专业', trigger: 'change' }],
title: [{ required: true, message: '请选择职称', trigger: 'change' }], title: [{ required: true, message: '请选择职称', trigger: 'change' }],
treeCode: [{ required: false, message: '请选择单位', trigger: 'change' }], // treeCode: [{ required: false, message: '请选择单位', trigger: 'change' }],
remark: [{ required: false, message: '请输入备注', trigger: 'blur' }], remark: [{ required: false, message: '请输入备注', trigger: 'blur' }],
}, },
} }
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<template slot="option" slot-scope="record"> <template slot="option" slot-scope="record">
<a-button v-if="record.reportState!==2" type="link" size="small" @click="recordClick(record,'report')">上报</a-button> <a-button v-if="record.reportState!==2" type="link" size="small" @click="recordClick(record,'report')">上报</a-button>
<a-button type="link" size="small" @click="recordClick(record,'edit')">修改</a-button> <a-button type="link" size="small" @click="recordClick(record,'edit')">修改</a-button>
<a-button type="link" size="small" @click="recordClick(record,'del')">删除</a-button> <!-- <a-button type="link" size="small" @click="recordClick(record,'del')">删除</a-button> -->
</template> </template>
</a-table> </a-table>
<a-pagination v-if="pagination.total > 0" :total="pagination.total" show-size-changer show-quick-jumper v-model="pagination.pageIndex" :page-size="pagination.pageSize" :page-size-options="pagination.pageSizeOptions" @showSizeChange="showSizeChange" @change="change" :showTotal="() => `共 ${pagination.total} 条`" /> <a-pagination v-if="pagination.total > 0" :total="pagination.total" show-size-changer show-quick-jumper v-model="pagination.pageIndex" :page-size="pagination.pageSize" :page-size-options="pagination.pageSizeOptions" @showSizeChange="showSizeChange" @change="change" :showTotal="() => `共 ${pagination.total} 条`" />
...@@ -104,6 +104,7 @@ export default { ...@@ -104,6 +104,7 @@ export default {
{ title: '评审专业', scopedSlots: { customRender: 'spec' }, width: '10%', }, { title: '评审专业', scopedSlots: { customRender: 'spec' }, width: '10%', },
{ title: '单位', dataIndex: 'unitName', align: 'center' }, { title: '单位', dataIndex: 'unitName', align: 'center' },
{ title: '用户名', dataIndex: 'username', align: 'center' }, { title: '用户名', dataIndex: 'username', align: 'center' },
{ title: '密码', dataIndex: 'password', align: 'center' },
{ title: '上报状态', scopedSlots: { customRender: 'reportState' }, align: 'center' }, { title: '上报状态', scopedSlots: { customRender: 'reportState' }, align: 'center' },
{ title: '状态', scopedSlots: { customRender: 'stateSwitch' }, align: 'center' }, { title: '状态', scopedSlots: { customRender: 'stateSwitch' }, align: 'center' },
{ title: '操作', scopedSlots: { customRender: 'option' }, align: 'center', fixed: 'right', width: '180px', }, { title: '操作', scopedSlots: { customRender: 'option' }, align: 'center', fixed: 'right', width: '180px', },
......
...@@ -109,10 +109,7 @@ export default { ...@@ -109,10 +109,7 @@ export default {
if (!!!e.每年工作) { if (!!!e.每年工作) {
msg += ';每年工作不能为空!' msg += ';每年工作不能为空!'
} }
// if (checkCertId(certId)) {
// gender = personGender(certId)
// birthday = personBirthday(certId) + ' 00:00:00'
// }
if (!!msg) { if (!!msg) {
this.errorState = true this.errorState = true
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment