yujialong 2 months ago
parent 756c2ff214
commit 301a77ac63
  1. 1
      src/api/index.js
  2. 57
      src/pages/allocationReview/list/index.vue
  3. 2
      src/pages/allocationReview/records/allocation.vue
  4. 108
      src/pages/allocationReview/records/index.vue
  5. 401
      src/pages/expert/list/index.vue
  6. 7
      src/pages/myReview/list/index.vue
  7. 9
      src/pages/myReview/records/index.vue
  8. 19
      src/router/modules/expert.js

@ -15,4 +15,5 @@ export default {
reviewSettingsList: `/competition/competition/readAndAppraise/reviewSettingsList`,
evaluationSave: `/nakadai/evaluation/saveOrUpdate`,
evaluationFind: `/nakadai/evaluation/findById`,
competitionUserReport: `/nakadai/evaluation/competitionUserReport`,
}

@ -40,7 +40,7 @@
</ul>
</div>
<el-table :data="list" class="table" ref="table" stripe header-align="center" row-key="stageId">
<el-table :data="list" :loading="loading" class="table" ref="table" stripe header-align="center" row-key="stageId">
<el-table-column type="index" width="50" label="序号" align="center"></el-table-column>
<el-table-column prop="competitionName" label="大赛名称" align="center" min-width="120"
show-overflow-tooltip></el-table-column>
@ -55,7 +55,7 @@
<el-table-column prop="reviewStatusName" label="任务分配情况" align="center" width="100"></el-table-column>
<el-table-column label="操作" align="center" width="220" fixed="right">
<template slot-scope="scope">
<template v-if="scope.row.evaluationId">
<template v-if="scope.row.evaluationId && (scope.row.hasManualScoreType || scope.row.allowManualGrading)">
<el-button type="text" @click="toProgress(scope.row)">评阅进度</el-button>
<el-button type="text" @click="toSetup(scope.row)">修改评阅设置</el-button>
<el-button type="text" @click="toTask(scope.row)">任务分配</el-button>
@ -66,7 +66,8 @@
</el-table>
<div class="pagination">
<el-pagination background :page-sizes="[10, 30, 50, 100, 200]" @current-change="currentChange"
:current-page="page" layout="total, prev, pager, next, sizes" :total="total"></el-pagination>
@size-change="sizeChange" :current-page="page" layout="total, prev, pager, next, sizes"
:total="total"></el-pagination>
</div>
<Setup :row.sync="curRow" :visible.sync="setupVisible" />
@ -86,8 +87,6 @@ export default {
components: { Setup, Progress },
data () {
return {
difficults: Const.difficults,
questionTypes: Const.questionTypes,
loading: false,
dateList: [
{
@ -159,7 +158,7 @@ export default {
timer: null,
list: [],
page: +this.$route.query.page || 1,
pageSize: 10,
pageSize: +this.$route.query.pageSize || 10,
total: 0,
setupVisible: false,
@ -199,32 +198,25 @@ export default {
const { query } = this.$route
if (query.page) {
const { questionTypes, correctRateEnd, correctRateStart, difficultys, specialtyIds, status, keyWord, questionTypeSort, givenYearSort, difficultySort, correctRateSort, updateTimeSort, referenceCountSort, givenYears, knowledgePointIds, questionBankId, questionBankName, questionBankCategory } = query
const { month, startTime, endTime, reviewStage, reviewStatus, taskAllocationStatus, keyWord } = query
this.filter = {
questionTypes: questionTypes ? questionTypes.split(',') : [],
correctRateEnd: correctRateEnd || '',
correctRateStart: correctRateStart || '',
difficultys: difficultys ? difficultys.split(',') : [],
specialtyIds: specialtyIds ? specialtyIds.split(',').map(e => +e) : [],
status: status ? +status : '',
month: !startTime && month ? +month : '',
reviewStage: reviewStage ? +reviewStage : '',
reviewStatus: reviewStatus ? +reviewStatus : '',
taskAllocationStatus: taskAllocationStatus ? +taskAllocationStatus : '',
keyWord: keyWord || '',
questionTypeSort: questionTypeSort || '',
givenYearSort: givenYearSort || '',
difficultySort: difficultySort || '',
correctRateSort: correctRateSort || '',
updateTimeSort: updateTimeSort || '',
referenceCountSort: referenceCountSort || '',
}
this.givenYears = givenYears || ''
this.knowledgePointIds = knowledgePointIds ? JSON.parse(knowledgePointIds) : []
if (startTime) this.date = [startTime, endTime]
this.$router.push(`/myReview?questionBankId=${questionBankId}&questionBankName=${questionBankName}&questionBankCategory=${questionBankCategory}`).catch(() => { })
this.$router.push(`/allocationReview`).catch(() => { })
}
this.initData()
this.getList()
},
methods: {
async getList () {
try {
this.loading = true
const { pageList } = await this.$post(this.api.reviewSettingsList, {
...this.filter,
pageNum: this.page,
@ -238,7 +230,7 @@ export default {
// if (e.reviewStatus !== null) e.reviewStatusName = this.reviewStatus.find(n => n.id === e.reviewStatus).name
// e.reviewStageName = this.reviewStage.find(n => n.id === e.reviewStage).name
e.stage = '-'
e.time = e.evaluationId ?
e.time = e.evaluationId && e.hasManualScoreType ?
e.isTimed ?
e.startTime + ' ~ ' + e.endTime :
'不限时' :
@ -248,12 +240,19 @@ export default {
this.getNow()
this.handleStage()
this.total = pageList.total
} finally {
this.loading = false
}
},
//
currentChange (val) {
this.page = val
this.getList()
},
sizeChange (val) {
this.pageSize = val
this.initData()
},
initData () {
this.$refs.table.clearSelection()
this.page = 1
@ -263,7 +262,7 @@ export default {
async handleStage () {
this.list.forEach(e => {
let stage = '-'
if (e.evaluationId) {
if (e.evaluationId && e.hasManualScoreType) {
if (e.isTimed) {
if (e.startTime && e.endTime) {
const startTime = new Date(e.startTime)
@ -280,7 +279,6 @@ export default {
}
e.stage = stage
})
console.log("🚀 ~ this.timer=setInterval ~ this.list:", this.list)
},
//
async getNow () {
@ -303,7 +301,12 @@ export default {
},
//
toTask (row) {
this.$router.push(`records`)
this.$store.commit('user/setReferrer', {
i: 1,
url: `${this.$route.path}?${Qs.stringify(this.filter)}&page=${this.page}&pageSize=${this.pageSize}`
})
localStorage.setItem('review_row', JSON.stringify(row))
this.$router.push(`records?competitionId=${row.id}&stageId=${row.stageId}`)
},
}
};

@ -86,7 +86,7 @@ export default {
watch: {
visible () {
this.allocationVisible = this.visible
this.visible && this.init()
// this.visible && this.init()
}
},
mounted () {

@ -15,13 +15,13 @@
<li>
<label>城市</label>
<el-select v-model="filter.cityId" clearable placeholder="请选择城市" :disabled="!filter.provinceId"
@clear="clearcity" @change="getSchool">
@clear="clearcity" @change="cityChange">
<el-option v-for="(item, i) in cities" :key="i" :label="item.cityName" :value="item.cityId"></el-option>
</el-select>
</li>
<li>
<label>学校</label>
<el-select v-model="filter.schoolId" clearable filterable placeholder="请选择学校" :disabled="!filter.cityId"
<el-select v-model="filter.realSchoolId" clearable filterable placeholder="请选择学校" :disabled="!filter.cityId"
@change="initData">
<el-option v-for="(item, i) in schools" :key="i" :label="item.schoolName"
:value="item.schoolId"></el-option>
@ -57,22 +57,24 @@
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="50" label="序号" align="center"></el-table-column>
<el-table-column prop="stem" label="省份" align="center" min-width="120"></el-table-column>
<el-table-column prop="professionalName" label="城市" align="center" min-width="100"></el-table-column>
<el-table-column prop="knowledgePointName" label="学生所在学校" align="center" min-width="100"></el-table-column>
<el-table-column prop="lastEditor" label="团队名称" align="center" width="90"></el-table-column>
<el-table-column prop="lastEditor" label="学生姓名" align="center" width="90"></el-table-column>
<el-table-column prop="lastEditor" label="学号" align="center" width="90"></el-table-column>
<el-table-column prop="lastEditor" label="答卷ID" align="center" width="90"></el-table-column>
<el-table-column prop="lastEditor" label="用时" align="center" width="90"></el-table-column>
<el-table-column prop="lastEditor" label="提交时间" align="center" width="90"></el-table-column>
<el-table-column prop="lastEditor" label="提交名称" align="center" width="90"></el-table-column>
<el-table-column prop="lastEditor" label="是否完成分配" align="center" width="90"></el-table-column>
<el-table-column prop="provinceName" label="省份" align="center" width="70"></el-table-column>
<el-table-column prop="cityName" label="城市" align="center" width="70"></el-table-column>
<el-table-column prop="realSchool" label="学生所在学校" align="center" width="100"></el-table-column>
<el-table-column prop="teamName" label="团队名称" align="center" width="90"></el-table-column>
<el-table-column prop="userName" label="学生姓名" align="center" width="80"></el-table-column>
<el-table-column prop="workNumber" label="学号" align="center" width="70"></el-table-column>
<el-table-column prop="reportId" label="答卷ID" align="center" width="60"></el-table-column>
<el-table-column prop="lastEditor" label="用时" align="center" width="60">
<template slot-scope="scope">{{ scope.row.timeSum }}min</template>
</el-table-column>
<el-table-column prop="submitTime" label="提交时间" align="center" width="150"></el-table-column>
<el-table-column prop="submitName" label="提交名称" align="center" width="120"></el-table-column>
<el-table-column prop="lastEditor" label="是否完成分配" align="center" width="100"></el-table-column>
<el-table-column prop="lastEditor" label="评阅人员" align="center" width="90"></el-table-column>
<el-table-column prop="lastEditor" label="评阅人数" align="center" width="90"></el-table-column>
<el-table-column prop="lastEditor" label="评阅状态" align="center" width="90"></el-table-column>
<el-table-column prop="lastEditor" label="成绩" align="center" width="90"></el-table-column>
<el-table-column prop="lastEditor" label="最新分配时间" align="center" width="90"></el-table-column>
<el-table-column prop="score" label="成绩" align="center" width="60"></el-table-column>
<el-table-column prop="lastEditor" label="最新分配时间" align="center" width="150"></el-table-column>
<el-table-column prop="lastEditor" label="最新分配人" align="center" width="90"></el-table-column>
<el-table-column label="操作" align="center" width="100" fixed="right">
<template slot-scope="scope">
@ -83,7 +85,8 @@
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next"
<el-pagination background :page-sizes="[10, 30, 50, 100, 200]" @current-change="currentChange"
@size-change="sizeChange" :current-page="page" layout="total, prev, pager, next, sizes"
:total="total"></el-pagination>
</div>
@ -106,9 +109,8 @@ export default {
data () {
return {
crumbs: [],
paperName: this.$route.query.paperName,
difficults: Const.difficults,
questionTypes: Const.questionTypes,
competitionId: this.$route.query.competitionId,
stageId: this.$route.query.stageId,
loading: false,
provinces: [],
@ -126,13 +128,13 @@ export default {
],
date: [],
filter: {
month: '',
startTime: null,
endTime: null,
cityId: '',
provinceId: '',
realSchoolId: '',
status: '',
keyword: '',
},
list: [{}],
list: [],
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
@ -145,34 +147,19 @@ export default {
};
},
watch: {
'filter.month': function (val) {
if (val) {
let unit = 24 * 60 * 60 * 1000
this.date = [dayjs(new Date(Date.now() - unit * 30 * val)).format('YYYY-MM-DD'), dayjs(new Date(Date.now() + unit)).format('YYYY-MM-DD')]
} else {
this.date = []
}
},
date: function (val) {
if (val) {
this.filter.startTime = val[0];
this.filter.endTime = val[1];
} else {
this.filter.startTime = ''
this.filter.endTime = ''
}
// this.initData();
},
'filter.keyword': function () {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(this.initData, 500)
},
},
mounted () {
const row = localStorage.getItem('review_row')
if (row) this.curRow = JSON.parse(row)
const { referrer1 } = this.$store.state.user
this.crumbs = [
{
name: '分配评阅任务',
route: '/allocationReview'
name: row.competitionContent || '分配评阅任务',
route: referrer1 || '/allocationReview'
},
{
name: '任务分配'
@ -205,38 +192,31 @@ export default {
}
this.getProvince()
// this.getProfessional()
this.getList()
// this.getKnowledge()
},
methods: {
async getList () {
let type = this.$refs.typeTree.getCurrentKey()
const k = this.knowledgePointIds
if (k.length) { //
type = k.map(e => {
return e[e.length - 1]
})
} else if (type) {
type = [type]
}
const { message } = await this.$post(this.api.listQuestion, {
const { page } = await this.$post(this.api.competitionUserReport, {
...this.filter,
givenYears: this.givenYears ? [this.givenYears] : [],
isNotJoin: this.isNotJoin || '',
pageNum: this.page,
pageSize: this.pageSize,
questionBankId: this.questionBankId,
knowledgePointIds: type || [],
competitionId: this.competitionId,
stageId: this.stageId,
})
this.list = Util.removeTag(message.records)
this.total = message.total
this.list = page.records
this.total = page.total
},
//
currentChange (val) {
this.page = val
this.getList()
},
handleSelectionChange (val) { //
sizeChange (val) {
this.pageSize = val
this.initData()
},
handleSelectionChange (val) {
this.multipleSelection = val
},
initData () {
@ -253,7 +233,7 @@ export default {
//
clearprovince () {
this.filter.cityId = '',
this.filter.schoolId = ''
this.filter.realSchoolId = ''
},
//
provinceChange () {
@ -270,11 +250,11 @@ export default {
},
//
clearcity () {
this.filter.schoolId = ''
this.filter.realSchoolId = ''
},
//
cityChange () {
this.filter.schoolId = ''
this.filter.realSchoolId = ''
this.getSchool()
this.initData()
},

@ -0,0 +1,401 @@
<template>
<div class="page">
<h6 class="page-name">筛选</h6>
<div class="tool">
<ul class="filter">
<li>
<el-input style="width: 300px;" placeholder="请输入姓名、手机号、现所在单位、职务" prefix-icon="el-icon-search"
v-model="keyWord" clearable></el-input>
</li>
</ul>
<div>
<el-button type="text" @click="add">复制专家登录链接</el-button>
<el-button type="primary" @click="add" v-auth="'/system:后台账号:新增员工'">新增专家</el-button>
<el-button type="primary" @click="batchDel" v-auth="'/system:后台账号:批量导入'">批量删除</el-button>
</div>
</div>
<el-table :data="list" class="table" ref="table" stripe header-align="center"
@selection-change="handleSelectionChange" row-key="accountId">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="userName" label="姓名" align="center" min-width="100"></el-table-column>
<el-table-column prop="phone" label="手机号" align="center" width="120"></el-table-column>
<el-table-column prop="staffArchitectureName" label="现所在单位" align="center" min-width="200"></el-table-column>
<el-table-column prop="roleName" label="职务" align="center" min-width="200"></el-table-column>
<el-table-column prop="lastLoginTime" label="登录次数" align="center" width="130"></el-table-column>
<el-table-column prop="lastLoginTime" label="上次登录时间" align="center" width="130"></el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button type="text" v-auth="'/system:后台账号:查看'" @click="queryStaff(scope.row, true)">查看</el-button>
<el-button type="text" v-auth="'/system:后台账号:编辑'" @click="queryStaff(scope.row, false)">编辑</el-button>
<el-button type="text" v-auth="'/system:后台账号:重置密码'" @click="resetPassword(scope.row)">重置密码</el-button>
<el-button type="text" v-auth="'/system:后台账号:删除'" @click="delStaff(scope.row)">删除</el-button>
<el-switch v-auth="'/match:启用'" v-model="scope.row.ztOpen" :active-value="0" :inactive-value="1"
style="margin: 0 10px 0 5px" :active-text="scope.row.ztOpen ? '关' : '开'"
@change="switchOff($event, scope.row, scope.$index)"></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next"
:total="total"></el-pagination>
</div>
<el-drawer :title="isDetail ? '查看' : (form.accountId ? '编辑' : '新增') + '专家'" :visible.sync="expertVisible"
size="580px" class="dialog" :close-on-click-modal="false" custom-class="expert-dia" @close="closeStaff">
<el-form class="overflow" ref="form" :model="form" :rules="rules" label-width="120px" :disabled="isDetail">
<el-form-item prop="userName" label="姓名">
<el-input v-model.trim="form.userName" placeholder="请输入姓名"></el-input>
</el-form-item>
<el-form-item prop="phone" label="手机号">
<el-input v-model.trim="form.phone" placeholder="请输入手机号" maxlength="11"></el-input>
</el-form-item>
<el-form-item prop="userName" label="登录密码">
<el-input type="password" v-model.trim="form.userName" placeholder="请输入密码" show-password></el-input>
</el-form-item>
<el-form-item prop="email" label="电子邮箱">
<el-input v-model.trim="form.email" placeholder="请输入电子邮箱"></el-input>
</el-form-item>
<el-form-item prop="email" label="性别">
<el-radio v-model="form.radio" label="1"></el-radio>
<el-radio v-model="form.radio" label="2"></el-radio>
</el-form-item>
<el-form-item prop="email" label="学历">
<el-select v-model="form.status" clearable placeholder="请选择学历">
<el-option v-for="(item, i) in edus" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="email" label="学位">
<el-input v-model.trim="form.email" placeholder="请输入学位"></el-input>
</el-form-item>
<el-form-item prop="email" label="职称">
<el-input v-model.trim="form.email" placeholder="请输入职称"></el-input>
</el-form-item>
<el-form-item prop="email" label="职务">
<el-input v-model.trim="form.email" placeholder="请输入职务"></el-input>
</el-form-item>
<el-form-item prop="email" label="毕业院校">
<el-input v-model.trim="form.email" placeholder="请输入毕业院校"></el-input>
</el-form-item>
<el-form-item prop="email" label="学术专长">
<el-input v-model.trim="form.email" placeholder="请输入学术专长"></el-input>
</el-form-item>
<el-form-item prop="email" label="现所在单位">
<el-input v-model.trim="form.email" placeholder="请输入现所在单位"></el-input>
</el-form-item>
</el-form>
<div class="btns">
<el-button @click="expertVisible = false">取消</el-button>
<el-button v-if="!isDetail" type="primary" @click="submitStaff">保存</el-button>
</div>
</el-drawer>
</div>
</template>
<script>
import Util from '@/libs/util'
import Setting from '@/setting'
export default {
data () {
const phonePass = (rule, value, callback) => {
if (value) {
const pattern = /^1[3456789]\d{9}$/
if (pattern.test(value)) {
// this.phoneChange()
callback()
} else {
callback(new Error('请输入正确手机号格式'))
}
} else {
callback()
}
}
const emailPass = (rule, value, callback) => {
if (value) {
const pattern = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/
if (pattern.test(value)) {
// this.emailChange()
callback()
} else {
callback(new Error('请输入正确邮箱格式'))
}
} else {
callback()
}
}
return {
isDetail: false,
keyWord: '',
edus: [],
form: {
accountId: '',
userName: '',
phone: '',
roleList: [],
uniqueIdentification: '',
workNumber: '',
email: '',
account: '',
staffArchitectureId: []
},
rules: {
phone: [
{ required: true, validator: phonePass, trigger: 'blur' }
],
email: [
{ validator: emailPass, trigger: 'blur' }
]
},
list: [],
page: 1,
pageSize: 10,
total: 0,
multipleSelection: [],
expertVisible: false,
phoneRepeat: false,
emailRepeat: false,
submiting: false //
};
},
watch: {
keyWord: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(this.getList, 500);
}
},
mounted () {
// this.getRole()
},
methods: {
getList () {
this.$post(this.api.staffList, {
type: this.studentType || 1,
staffArchitectureId: this.$refs.orgTree.getCurrentKey() || '',
keyWord: this.keyWord,
pageNum: this.page,
pageSize: this.pageSize
}).then(res => {
this.list = res.page.records
this.total = res.page.total
}).catch(err => { })
},
//
currentChange (val) {
this.page = val
this.getList()
},
handleSelectionChange (val) {
this.multipleSelection = val
},
initData () {
this.$refs.table.clearSelection()
this.page = 1
this.getList()
},
//
delStaff (row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.delStaff}?accountIds=${row.accountId}`).then(res => {
Util.successMsg("删除成功")
this.getList()
}).catch(res => { })
}).catch(() => { })
},
//
async resetPassword (row) {
const newPwd = Setting.initialPassword
await this.$confirm(`重置后的密码为:手机号码后六位,确定要重置吗?`, "提示", { type: "warning" })
await this.$get(`${this.api.resetPwd}?userId=${row.userId}&newPwd=${newPwd}`)
Util.successMsg('重置成功')
},
async switchOff (val, row) {
this.$post(this.api.disabledEventsCompetition, {
competitionId: row.id,
isOpen: val,
type: 0 // (01)
}).then(res => {
util.successMsg(val == 1 ? '禁用成功' : '启用成功')
}).catch(err => { })
await this.$post(`${this.api.refreshPageNotification}?content=1`)
},
//
add () {
this.expertVisible = true
this.$nextTick(() => {
this.$refs.form.clearValidate()
})
},
//
async batchDel () {
const list = this.multipleSelection
if (list.length) {
try {
await this.$confirm(`确定要删除已选定的${list.length}份试卷吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnClickModal: false,
})
await this.$post(this.api.paperDel, {
delete: false,
ids: list.map(e => e.paperId)
})
Util.successMsg('删除成功')
this.multipleSelection = []
this.$refs.table.clearSelection()
this.getList()
} catch (e) { }
} else {
Util.warningMsg('请选择数据')
}
},
// /
queryStaff (row, isDetail) {
const archId = []
// id
const handleArchId = (list, ids, parentId = []) => {
list.map(e => {
// id[[1, 2], [3, 4]]idid
if (ids.includes(e.id)) {
archId.push([...parentId, e.id])
} else {
e.children && handleArchId(e.children, ids, [...parentId, e.id])
}
})
}
this.isDetail = isDetail
this.expertVisible = true
this.$get(`${this.api.staffDetail}?accountId=${row.accountId}`).then(res => {
const { data } = res
const { staffArchitectureId, roleId } = data
if (roleId) {
const roleList = roleId.split(',').map(e => Number(e))
const list = this.roleList
if (roleList.length) {
let has = false //
for (const i in roleList) {
if (list.find(n => n.id === roleList[i])) {
has = true
break
}
}
if (!has) {
Util.warningMsg('角色被删请重新选择')
data.roleList = []
} else {
data.roleList = roleList
}
}
}
if (staffArchitectureId) {
handleArchId(this.orgList, staffArchitectureId.split(',').map(e => Number(e)))
data.staffArchitectureId = archId
}
this.form = data
this.originAccount = data.account
this.originWorkNumber = data.workNumber
}).catch(res => { })
},
//
phoneChange () {
const form = this.form
const { phone } = form
if (phone) {
const { accountId } = form
this.$post(`${this.api.checkEmailOrPhone}?phone=${phone}${accountId ? `&accountId=${accountId}` : ''}`).then(res => {
this.phoneRepeat = false
}).catch(err => {
this.phoneRepeat = true
})
}
},
//
emailChange () {
const form = this.form
const { email } = form
if (email) {
const { accountId } = form
this.$post(`${this.api.checkEmailOrPhone}?email=${email}${accountId ? `&accountId=${accountId}` : ''}`).then(res => {
this.emailRepeat = false
}).catch(err => {
this.emailRepeat = true
})
}
},
// /
submitStaff () {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.submiting) return false
if (this.accountReapeat) return Util.warningMsg("该账号已存在")
if (this.workNumberReapeat) return Util.warningMsg("该工号已存在")
if (this.phoneRepeat) return Util.warningMsg("该手机号已存在")
if (this.emailRepeat) return Util.warningMsg("该邮箱已存在")
this.submiting = true
const form = JSON.parse(JSON.stringify(this.form))
const ids = form.staffArchitectureId
if (ids) form.staffArchitectureId = ids.map(e => e[e.length - 1])
if (form.accountId) {
this.$post(this.api.modifyStaff, form).then(res => {
Util.successMsg("编辑成功!")
this.expertVisible = false
setTimeout(() => {
this.submiting = false
}, 2000)
}).catch(res => {
setTimeout(() => {
this.submiting = false
}, 2000)
})
} else {
form.uniqueIdentification = new Date().getTime()
this.$post(this.api.saveStaff, form).then(res => {
Util.successMsg("新增成功!")
this.expertVisible = false
setTimeout(() => {
this.submiting = false
}, 2000)
}).catch(res => {
setTimeout(() => {
this.submiting = false
}, 2000)
})
}
}
})
},
//
closeStaff () {
this.form = {
accountId: '',
userName: '',
account: '',
phone: '',
uniqueIdentification: '',
workNumber: '',
email: '',
staffArchitectureId: [],
roleList: []
}
this.isDetail = false
this.getList()
},
}
};
</script>
<style lang="scss" scoped>
/deep/.expert-dia {
.overflow {
max-height: calc(100vh - 100px);
padding-right: 40px;
overflow: auto;
}
}
</style>

@ -51,7 +51,8 @@
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next"
<el-pagination background :page-sizes="[10, 30, 50, 100, 200]" @current-change="currentChange"
@size-change="sizeChange" :current-page="page" layout="total, prev, pager, next, sizes"
:total="total"></el-pagination>
</div>
</div>
@ -196,6 +197,10 @@ export default {
this.page = val
this.getList()
},
sizeChange (val) {
this.pageSize = val
this.initData()
},
initData () {
this.$refs.table.clearSelection()
this.page = 1

@ -66,7 +66,8 @@
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next"
<el-pagination background :page-sizes="[10, 30, 50, 100, 200]" @current-change="currentChange"
@size-change="sizeChange" :current-page="page" layout="total, prev, pager, next, sizes"
:total="total"></el-pagination>
</div>
</div>
@ -209,7 +210,11 @@ export default {
this.page = val
this.getList()
},
handleSelectionChange (val) { //
sizeChange (val) {
this.pageSize = val
this.initData()
},
handleSelectionChange (val) {
this.multipleSelection = val
},
initData () {

@ -0,0 +1,19 @@
import BasicLayout from '@/layouts/home'
const meta = {}
export default {
path: '/expert',
redirect: {
path: `/expert/list`
},
meta,
component: BasicLayout,
children: [
{
path: 'list',
component: () => import('@/pages/expert/list'),
meta: { title: '专家管理' }
},
]
};
Loading…
Cancel
Save