yujialong 10 months ago
parent 57f0f4ce83
commit 8ee53be060
  1. 2
      public/index.html
  2. 2
      src/pages/achievement/info/course.vue
  3. 6
      src/pages/achievement/info/project.vue
  4. 5
      src/pages/achievement/list/course.vue
  5. 3
      src/pages/achievement/list/project.vue
  6. 2
      src/pages/activity/details/index.vue
  7. 1
      src/pages/assessment/list/index.vue
  8. 165
      src/pages/course/list/courseManagement/index.vue
  9. 2
      src/pages/match/add/step1.vue
  10. 11
      src/pages/match/add/step2.vue
  11. 1
      src/pages/match/manage/matchInfo.vue
  12. 1
      src/pages/product/show/index.vue
  13. 5
      src/pages/screen/index.vue
  14. 20
      src/pages/system/list/index.vue
  15. 304
      src/pages/system/list/staff.vue
  16. 119
      src/pages/system/list/staffSide.vue

@ -10,7 +10,7 @@
var _hmt = _hmt || []; var _hmt = _hmt || [];
(function() { (function() {
var hm = document.createElement('script'); var hm = document.createElement('script');
hm.src = 'https://hm.baidu.com/hm.js?72fbad6ebf1d6c705117fe8fe0686a0e'; hm.src = 'https://hm.baidu.com/hm.js?e4d7deeca2d6ea71d2bd5fa2365bc654';
var s = document.getElementsByTagName('script')[0]; var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(hm, s); s.parentNode.insertBefore(hm, s);
})(); })();

@ -3,7 +3,7 @@
<el-card shadow="hover" <el-card shadow="hover"
class="m-b-20 head-card"> class="m-b-20 head-card">
<div class="flex-between m-b-20"> <div class="flex-between m-b-20">
<el-page-header @back="$router.push('list?tab=tab1')" <el-page-header @back="$router.back()"
:content="goodsName"></el-page-header> :content="goodsName"></el-page-header>
</div> </div>
</el-card> </el-card>

@ -320,7 +320,8 @@ export default {
pageActivation: 1, pageActivation: 1,
pageSizeActivation: 10, pageSizeActivation: 10,
totalActivation: 0, totalActivation: 0,
loadIns: null loadIns: null,
scores: {}
}; };
}, },
components: { components: {
@ -378,6 +379,7 @@ export default {
this.errorAnalysis = res.errorAnalysis || {} this.errorAnalysis = res.errorAnalysis || {}
this.max = res.highestErrorRate || {} this.max = res.highestErrorRate || {}
this.min = res.minimumErrorRate || {} this.min = res.minimumErrorRate || {}
this.scores = res.getFractionalSegmentNum
this.getChart() this.getChart()
this.errorChart() this.errorChart()
} catch (e) { } catch (e) {
@ -531,7 +533,7 @@ export default {
getChart () { // 线 getChart () { // 线
const xData = Array.from({ length: 101 }, (v, k) => k) const xData = Array.from({ length: 101 }, (v, k) => k)
const yData = Array.from({ length: 101 }, (v, k) => 0) const yData = Array.from({ length: 101 }, (v, k) => 0)
const list = this.listDataAll const list = this.listData
list.map(n => { list.map(n => {
yData[n.score]++ yData[n.score]++
}) })

@ -166,7 +166,8 @@ export default {
path: 'list', path: 'list',
query: { query: {
...this.$route.query, ...this.$route.query,
keyword: val keyword: val,
page: 1
} }
}) })
this.initData(); this.initData();
@ -182,7 +183,7 @@ export default {
async getCourse () { async getCourse () {
const { data } = await this.$get(this.api.getSchoolEffectiveCourse) const { data } = await this.$get(this.api.getSchoolEffectiveCourse)
this.curs = data this.curs = data
this.initData(); this.getData();
}, },
// //
curChange (id) { curChange (id) {

@ -232,7 +232,8 @@ export default {
path: 'list', path: 'list',
query: { query: {
...this.$route.query, ...this.$route.query,
keyword: val keyword: val,
page: 1
} }
}) })
this.initData(); this.initData();

@ -447,7 +447,7 @@ export default {
.tool { .tool {
z-index: 100; z-index: 100;
position: sticky; position: sticky;
top: 64px; top: 0;
margin-bottom: 20px; margin-bottom: 20px;
background-color: #fff; background-color: #fff;
} }

@ -291,6 +291,7 @@ export default {
month: "", month: "",
}, },
mallId: '',
pageNum: +this.$route.query.page || 1, // pageNum: +this.$route.query.page || 1, //
pageSize: 10, // 10 pageSize: 10, // 10
total: 0, // total: 0, //

@ -2,74 +2,131 @@
<!-- 课程管理 --> <!-- 课程管理 -->
<div style="padding-top: 24px"> <div style="padding-top: 24px">
<div class="tool"> <div class="tool">
<ul class="filter" style="align-items: flex-start"> <ul class="filter"
style="align-items: flex-start">
<li> <li>
<label>课程分类</label> <label>课程分类</label>
<el-select v-model="categoryId" clearable placeholder="请选择课程分类" @change="initData"> <el-select v-model="categoryId"
<el-option label="不限" value=""></el-option> clearable
<el-option v-for="(item,index) in classificationList" :key="index" :label="item.classificationName" :value="item.id"></el-option> placeholder="请选择课程分类"
@change="initData">
<el-option label="不限"
value=""></el-option>
<el-option v-for="(item,index) in classificationList"
:key="index"
:label="item.classificationName"
:value="item.id"></el-option>
</el-select> </el-select>
</li> </li>
<li> <li>
<label>搜索</label> <label>搜索</label>
<el-input placeholder="请输入课程名称/创建人" suffix-icon="el-icon-search" v-model="keyword" clearable size="small"></el-input> <el-input placeholder="请输入课程名称/创建人"
suffix-icon="el-icon-search"
v-model="keyword"
clearable
size="small"></el-input>
</li> </li>
</ul> </ul>
<div> <div>
<el-button v-auth="'课程管理:新增'" type="info" round @click="addCourse">新增</el-button> <el-button v-auth="'课程管理:新增'"
<el-button v-auth="'课程管理:批量删除'" type="primary" round @click="delAllData">批量删除</el-button> type="info"
round
@click="addCourse">新增</el-button>
<el-button v-auth="'课程管理:批量删除'"
type="primary"
round
@click="delAllData">批量删除</el-button>
</div> </div>
</div> </div>
<el-table :data="list" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> <el-table :data="list"
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column> class="table"
<el-table-column type="index" width="100" label="序号" align="center"> ref="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="id">
<el-table-column type="selection"
width="80"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="100"
label="序号"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }} {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="courseName" label="课程名称" align="center"> <el-table-column prop="courseName"
label="课程名称"
align="center">
</el-table-column> </el-table-column>
<el-table-column prop="courseClassification" label="课程分类" align="center" show-overflow-tooltip> <el-table-column prop="courseClassification"
label="课程分类"
align="center"
show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column label="可见范围" align="center"> <el-table-column label="可见范围"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ regionName[scope.row.visibleRange] }} {{ regionName[scope.row.visibleRange] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="createTime" label="创建时间" align="center"> <el-table-column prop="createTime"
label="创建时间"
align="center">
</el-table-column> </el-table-column>
<el-table-column prop="founder" label="创建人" align="center"> <el-table-column prop="founder"
label="创建人"
align="center">
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="250"> <el-table-column label="操作"
align="center"
width="250">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-auth="'课程管理:编辑信息'" type="text" @click="editCourse(scope.row)">编辑信息</el-button> <el-button v-auth="'课程管理:编辑信息'"
<el-divider v-auth="'课程管理:编辑信息'" direction="vertical"></el-divider> type="text"
<el-button v-auth="'课程管理:内容设置'" type="text" @click="config(scope.row)">内容设置</el-button> @click="editCourse(scope.row)">编辑信息</el-button>
<el-divider v-auth="'课程管理:内容设置'" direction="vertical"></el-divider> <el-divider v-auth="'课程管理:编辑信息'"
<el-button v-auth="'课程管理:预览'" type="text" @click="preview(scope.row)">预览</el-button> direction="vertical"></el-divider>
<el-divider v-auth="'课程管理:预览'" direction="vertical"></el-divider> <el-button v-auth="'课程管理:内容设置'"
<el-button v-auth="'课程管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button> type="text"
@click="config(scope.row)">内容设置</el-button>
<el-divider v-auth="'课程管理:内容设置'"
direction="vertical"></el-divider>
<el-button v-auth="'课程管理:预览'"
type="text"
@click="preview(scope.row)">预览</el-button>
<el-divider v-auth="'课程管理:预览'"
direction="vertical"></el-divider>
<el-button v-auth="'课程管理:删除'"
type="text"
@click="handleDelete(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="可授权状态" align="center" width="120"> <el-table-column label="可授权状态"
align="center"
width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 列表展示中台的禁启用依据zt_open展示职站的禁启用依据is_open展示 --> <!-- 列表展示中台的禁启用依据zt_open展示职站的禁启用依据is_open展示 -->
<!-- 中台禁用了这个学校发布的学校这边还能看到但是学校这边不能启用 --> <!-- 中台禁用了这个学校发布的学校这边还能看到但是学校这边不能启用 -->
<el-switch <el-switch v-auth="'课程管理:禁用'"
v-auth="'课程管理:禁用'"
v-model="scope.row.isOpen" v-model="scope.row.isOpen"
:active-value="0" :active-value="0"
:inactive-value="1" :inactive-value="1"
style="margin: 0 10px 0 5px" style="margin: 0 10px 0 5px"
:active-text="scope.row.isOpen ? '关' : '开'" :active-text="scope.row.isOpen ? '关' : '开'"
@change="switchOff($event,scope.row,scope.$index)" @change="switchOff($event,scope.row,scope.$index)"></el-switch>
></el-switch>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"> <el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page">
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
@ -80,7 +137,7 @@ import util from "@/libs/util";
import Setting from '@/setting' import Setting from '@/setting'
export default { export default {
name: "courseManagement", name: "courseManagement",
data() { data () {
return { return {
regionName: ['本校内', '全平台可见', '指定院校区域'], regionName: ['本校内', '全平台可见', '指定院校区域'],
timer: null, timer: null,
@ -95,22 +152,22 @@ export default {
}; };
}, },
watch: { watch: {
keyword: function(val) { keyword: function (val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData(); this.initData();
}, 500); }, 500);
} }
}, },
mounted() { mounted () {
this.getClassification(); this.getClassification();
this.getData(); this.getData();
this.$once('hook:beforeDestroy', function() { this.$once('hook:beforeDestroy', function () {
clearInterval(this.timer) clearInterval(this.timer)
}) })
}, },
methods: { methods: {
getList() { getList () {
this.$post(this.api.listTheoreticalCourse, { this.$post(this.api.listTheoreticalCourse, {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
@ -136,44 +193,44 @@ export default {
}); });
}, },
// redis // redis
getRedis() { getRedis () {
this.$post(this.api.getRedisCache).then(({ data }) => { this.$post(this.api.getRedisCache).then(({ data }) => {
data && this.getList() data && this.getList()
}).catch(res => {}) }).catch(res => { })
}, },
getData() { getData () {
this.getList() this.getList()
if (!Setting.isDev) { // if (!Setting.isDev) {
clearInterval(this.timer) // clearInterval(this.timer)
this.timer = setInterval(this.getRedis, 1000) // this.timer = setInterval(this.getRedis, 1000)
} // }
}, },
initData() { initData () {
this.page = 1; this.page = 1;
this.getData(); this.getData();
}, },
getClassification() { getClassification () {
this.$post(this.api.listClassification, { this.$post(this.api.listClassification, {
pageNum: 1, pageNum: 1,
pageSize: 1000, pageSize: 1000,
platformSource: Setting.platformSource platformSource: Setting.platformSource
}).then(({ page }) => { }).then(({ page }) => {
this.classificationList = page.records this.classificationList = page.records
}).catch(res => {}) }).catch(res => { })
}, },
preview(row) { preview (row) {
this.$router.push(`/course/preview?id=${row.id}`); this.$router.push(`/course/preview?id=${row.id}`);
}, },
config(row) { config (row) {
this.$router.push(`/course/contentSettings?id=${row.id}`); this.$router.push(`/course/contentSettings?id=${row.id}`);
}, },
addCourse() { addCourse () {
this.$router.push("/course/add"); this.$router.push("/course/add");
}, },
editCourse(row) { editCourse (row) {
this.$router.push(`/course/add?id=${row.id}`); this.$router.push(`/course/add?id=${row.id}`);
}, },
handleDelete(row) { handleDelete (row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning" type: "warning"
}) })
@ -187,10 +244,10 @@ export default {
.catch(() => { .catch(() => {
}); });
}, },
handleSelectionChange(val) { handleSelectionChange (val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
delAllData() { delAllData () {
const list = this.multipleSelection const list = this.multipleSelection
if (list.length != "") { if (list.length != "") {
this.$confirm(`确定要删除吗?`, "提示", { this.$confirm(`确定要删除吗?`, "提示", {
@ -213,19 +270,19 @@ export default {
util.errorMsg("请先选择数据 !"); util.errorMsg("请先选择数据 !");
} }
}, },
handleCurrentChange(val) { handleCurrentChange (val) {
this.page = val; this.page = val;
this.$router.push(`list?page=${val}`) this.$router.push(`list?page=${val}`)
this.getData(); this.getData();
}, },
switchOff(val, row) { switchOff (val, row) {
this.$post(this.api.disabledTheoreticalCourse, { this.$post(this.api.disabledTheoreticalCourse, {
courseId: row.id, courseId: row.id,
isOpen: val, isOpen: val,
type: 1 // (01) type: 1 // (01)
}).then(res => { }).then(res => {
val == 1 ? util.warningMsg('禁用成功') : util.successMsg('启用成功') val == 1 ? util.warningMsg('禁用成功') : util.successMsg('启用成功')
}).catch(err => {}) }).catch(err => { })
} }
} }
}; };

@ -696,7 +696,7 @@ export default {
this.$parent.showLoad() this.$parent.showLoad()
delete form.publishStatus delete form.publishStatus
if (status === 1) form.publishStatus = 1 if (status === 1) form.publishStatus = 1
form.isOpen = status ? 0 : 1 // form.ztOpen = status ? 0 : 1 //
form.releaseType = releaseType form.releaseType = releaseType
form.id = this.$route.query.id form.id = this.$route.query.id

@ -80,8 +80,7 @@
<span class="req">*</span> <span class="req">*</span>
团队参赛人数限制 团队参赛人数限制
<el-radio v-model="item.teamNumLimitOpt" <el-radio v-model="item.teamNumLimitOpt"
:label="0" :label="0">不限制</el-radio>
@change="item.teamNumLimit = 0">不限制</el-radio>
<el-radio v-model="item.teamNumLimitOpt" <el-radio v-model="item.teamNumLimitOpt"
:label="1">自定义</el-radio> :label="1">自定义</el-radio>
<el-input v-model.number="item.teamNumLimit" <el-input v-model.number="item.teamNumLimit"
@ -449,7 +448,7 @@ export default {
} }
e.resultAnnouncementTime = +e.resultAnnouncementTime e.resultAnnouncementTime = +e.resultAnnouncementTime
} }
if (e.teamNumLimit) teamNumLimit += e.teamNumLimit // if (e.teamNumLimitOpt && e.teamNumLimit) teamNumLimit += e.teamNumLimit //
} }
if (invalid) return if (invalid) return
if (form.teamLimit && competitionType) { if (form.teamLimit && competitionType) {
@ -461,9 +460,9 @@ export default {
} else { // 稿 } else { // 稿
form.competitionStageList = form.competitionStageList.filter(e => e.stageName) form.competitionStageList = form.competitionStageList.filter(e => e.stageName)
} }
for (const e of form.competitionStageList) { // for (const e of form.competitionStageList) {
if (!e.teamNumLimitOpt) e.teamNumLimit = 0 // if (!e.teamNumLimitOpt) e.teamNumLimit = 0
} // }
this.$parent.showLoad() this.$parent.showLoad()
this.pass = 1 this.pass = 1
if (form.ruleId) { if (form.ruleId) {

@ -435,7 +435,6 @@ export default {
status = 5; status = 5;
} }
this.status = status this.status = status
console.log("🚀 ~ file: matchInfo.vue:350 ~ handleStatus ~ status", status)
}, },
// //
edit (showMsg) { edit (showMsg) {

@ -533,6 +533,7 @@ export default {
margin-bottom: 15px; margin-bottom: 15px;
color: #333; color: #333;
font-size: 14px; font-size: 14px;
font-weight: 600;
} }
.sectionName { .sectionName {
position: relative; position: relative;

@ -772,7 +772,7 @@ export default {
sort: 0, sort: 0,
isShelves: 0, isShelves: 0,
hotTag: 1, hotTag: 1,
purchaseStatus: 1 purchaseStatus: this.token ? 1 : ''
}) })
if (cousrseRes) { if (cousrseRes) {
const courseList = cousrseRes.page.records const courseList = cousrseRes.page.records
@ -1063,6 +1063,8 @@ export default {
}], }],
yAxis: [{ yAxis: [{
type: 'value', type: 'value',
minInterval: 1,
min: 0,
axisTick: { axisTick: {
show: false show: false
}, },
@ -1072,6 +1074,7 @@ export default {
} }
}, },
axisLabel: { axisLabel: {
// interval: 5,
margin: 10, margin: 10,
textStyle: { textStyle: {
fontSize: 12, fontSize: 12,

@ -1,7 +1,12 @@
<template> <template>
<div class="page" style="padding: 0"> <div class="page"
style="padding: 0">
<div class="tabs"> <div class="tabs">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{ item }}</a> <a class="item"
v-for="(item,index) in tabs"
:key="index"
:class="{active: index == active}"
@click="tabChange(index)">{{ item }}</a>
</div> </div>
<staff v-if="active == 'staff'"></staff> <staff v-if="active == 'staff'"></staff>
@ -17,11 +22,11 @@ import staff from "./staff";
import role from "./role"; import role from "./role";
import logo from "./logo"; import logo from "./logo";
export default { export default {
data() { data () {
return { return {
active: "staff", active: "staff",
tabs: { tabs: {
staff: "员工管理", staff: "教师管理",
role: "角色权限", role: "角色权限",
logo: "系统logo设置", logo: "系统logo设置",
} }
@ -37,14 +42,14 @@ export default {
role, role,
logo logo
}, },
created() { created () {
Setting.dynamicRoute && this.initTabs() Setting.dynamicRoute && this.initTabs()
}, },
methods: { methods: {
tabChange(index) { tabChange (index) {
this.active = index this.active = index
}, },
initTabs() { initTabs () {
const { btns } = this const { btns } = this
const tab1 = btns.includes('/system/list:员工管理') const tab1 = btns.includes('/system/list:员工管理')
const tab2 = btns.includes('/system/list:角色权限') const tab2 = btns.includes('/system/list:角色权限')
@ -58,5 +63,4 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
</style> </style>

@ -1,7 +1,9 @@
<template> <template>
<div class="wrap"> <div class="wrap">
<div class="side"> <div class="side">
<org ref="org" @getSingle="getSingle" @getCheck="getCheck"></org> <org ref="org"
@getSingle="getSingle"
@getCheck="getCheck"></org>
</div> </div>
<div class="right"> <div class="right">
@ -9,91 +11,171 @@
<div class="tool"> <div class="tool">
<ul class="filter"> <ul class="filter">
<li> <li>
<el-input placeholder="请输入员工姓名/工号" prefix-icon="el-icon-search" v-model.trim="keyword" clearable></el-input> <el-input placeholder="请输入教师姓名/工号"
prefix-icon="el-icon-search"
v-model.trim="keyword"
clearable></el-input>
</li> </li>
</ul> </ul>
<div> <div>
<el-button v-auth="'员工管理:新增员工'" type="info" round @click="addTeacher">新增员工</el-button> <el-button v-auth="'员工管理:新增员工'"
<el-button v-auth="'员工管理:批量导入'" type="primary" round @click="batchImport">批量导入</el-button> type="info"
<el-button v-auth="'员工管理:批量删除'" type="primary" round @click="delAllSelection">批量删除</el-button> round
@click="addTeacher">新增教师</el-button>
<el-button v-auth="'员工管理:批量导入'"
type="primary"
round
@click="batchImport">批量导入</el-button>
<el-button v-auth="'员工管理:批量删除'"
type="primary"
round
@click="delAllSelection">批量删除</el-button>
</div> </div>
</div> </div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange"> <el-table :data="listData"
<el-table-column type="selection" width="55" align="center"></el-table-column> class="table"
<el-table-column type="index" label="序号" width="55" align="center"></el-table-column> ref="table"
<el-table-column prop="userName" label="职工姓名" align="center"></el-table-column> stripe
<el-table-column prop="workNumber" label="职工工号" align="center"></el-table-column> header-align="center"
<el-table-column prop="dept" label="部门" align="center"></el-table-column> @selection-change="handleSelectionChange">
<el-table-column prop="roleName" label="账号角色" align="center"></el-table-column> <el-table-column type="selection"
<el-table-column prop="logInNumber" label="登录次数" align="center"></el-table-column> width="55"
<el-table-column prop="lastLoginTime" label="上次登录时间" align="center"></el-table-column> align="center"></el-table-column>
<el-table-column label="操作" width="200" align="center"> <el-table-column type="index"
label="序号"
width="55"
align="center"></el-table-column>
<el-table-column prop="userName"
label="教师姓名"
align="center"></el-table-column>
<el-table-column prop="workNumber"
label="教师工号"
align="center"></el-table-column>
<el-table-column prop="dept"
label="部门"
align="center"></el-table-column>
<el-table-column prop="roleName"
label="账号角色"
align="center"></el-table-column>
<el-table-column prop="logInNumber"
label="登录次数"
align="center"></el-table-column>
<el-table-column prop="lastLoginTime"
label="上次登录时间"
align="center"></el-table-column>
<el-table-column label="操作"
width="200"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-auth="'员工管理:员工查看'" type="text" @click="showTeacher(scope.row)">查看</el-button> <el-button v-auth="'员工管理:员工查看'"
<el-button v-auth="'员工管理:员工编辑'" type="text" @click="editTeacher(scope.row)">编辑</el-button> type="text"
<el-button v-auth="'员工管理:重置密码'" type="text" @click="resetPassword(scope.row)">重置密码</el-button> @click="showTeacher(scope.row)">查看</el-button>
<el-button v-auth="'员工管理:员工删除'" type="text" @click="delTeacher(scope.row)">删除</el-button> <el-button v-auth="'员工管理:员工编辑'"
type="text"
@click="editTeacher(scope.row)">编辑</el-button>
<el-button v-auth="'员工管理:重置密码'"
type="text"
@click="resetPassword(scope.row)">重置密码</el-button>
<el-button v-auth="'员工管理:员工删除'"
type="text"
@click="delTeacher(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background layout="total, prev, pager, next" :current-page="page" @current-change="handleCurrentChange" :total="total"></el-pagination> <el-pagination background
layout="total, prev, pager, next"
:current-page="page"
@current-change="handleCurrentChange"
:total="total"></el-pagination>
</div> </div>
</div> </div>
<el-dialog :title="isDetail ? '查看员工' : (isAdd ? '新增员工' : '编辑员工')" :visible.sync="teacherVisible" <el-dialog :title="isDetail ? '查看教师' : (isAdd ? '新增教师' : '编辑教师')"
width="30%" @close="closeTeacher" class="dialog" :close-on-click-modal="false"> :visible.sync="teacherVisible"
<el-form ref="form" :model="form" :rules="rules" label-width="150px" :disabled="isDetail" style='margin-right: 80px;'> width="30%"
<el-form-item prop="workNumber" label="工号"> @close="closeTeacher"
<el-input v-model.trim="form.workNumber" placeholder="请输入职工工号" @blur="workNumberChange"></el-input> class="dialog"
:close-on-click-modal="false">
<el-form ref="form"
:model="form"
:rules="rules"
label-width="150px"
:disabled="isDetail"
style='margin-right: 80px;'>
<el-form-item prop="workNumber"
label="工号">
<el-input v-model.trim="form.workNumber"
placeholder="请输入教师工号"
@blur="workNumberChange"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="userName" label="用户姓名"> <el-form-item prop="userName"
<el-input v-model.trim="form.userName" placeholder="请输入员工姓名"></el-input> label="用户姓名">
<el-input v-model.trim="form.userName"
placeholder="请输入教师姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="roleValue" label="账号角色"> <el-form-item prop="roleValue"
<el-select v-model="form.roleValue" @change="roleChange" @remove-tag="roleRemove" multiple style="width: 100%;height: 32px"> label="账号角色">
<el-option <el-select v-model="form.roleValue"
v-for="item in roleList" @change="roleChange"
@remove-tag="roleRemove"
multiple
style="width: 100%;height: 32px">
<el-option v-for="item in roleList"
:key="item.id" :key="item.id"
:label="item.roleName" :label="item.roleName"
:value="item.id"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="uniqueIdentification" label="唯一标识"> <el-form-item prop="uniqueIdentification"
<el-input disabled v-model.trim="form.uniqueIdentification" placeholder="请输入职工工号获取唯一标识"></el-input> label="唯一标识">
<el-input disabled
v-model.trim="form.uniqueIdentification"
placeholder="请输入教师工号获取唯一标识"></el-input>
</el-form-item> </el-form-item>
<el-form-item v-for="item in form.roleAndDeptList" :label="`${item.roleName}所属部门`" :rules="{ <el-form-item v-for="item in form.roleAndDeptList"
:label="`${item.roleName}所属部门`"
:rules="{
required: true, message: '请选择', trigger: 'change' required: true, message: '请选择', trigger: 'change'
}"> }">
<el-cascader <el-cascader v-model="item.cascaderValue"
v-model="item.cascaderValue"
:options="orgList" :options="orgList"
:props="casProps" :props="casProps"
style="width: 100%" style="width: 100%"></el-cascader>
></el-cascader>
</el-form-item> </el-form-item>
<el-form-item prop="phone" label="手机号"> <el-form-item prop="phone"
<el-input v-model.trim="form.phone" placeholder="请输入手机号" maxlength="11"></el-input> label="手机号">
<el-input v-model.trim="form.phone"
placeholder="请输入手机号"
maxlength="11"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="email" label="邮箱"> <el-form-item prop="email"
<el-input v-model.trim="form.email" placeholder="请输入邮箱"></el-input> label="邮箱">
<el-input v-model.trim="form.email"
placeholder="请输入邮箱"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail"> <span slot="footer"
class="dialog-footer"
v-if="!isDetail">
<el-button @click="closeTeacher"> </el-button> <el-button @click="closeTeacher"> </el-button>
<el-button type="primary" @click="saveSure('form')"> </el-button> <el-button type="primary"
@click="saveSure('form')"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false"> <el-dialog title="批量导入"
:visible.sync="importVisible"
width="24%"
:close-on-click-modal="false">
<div style="text-align: center"> <div style="text-align: center">
<div style="margin-bottom: 10px;"> <div style="margin-bottom: 10px;">
<el-button type="primary" @click="downLoad">模板下载<i class="el-icon-download el-icon--right"></i></el-button> <el-button type="primary"
@click="downLoad">模板下载<i class="el-icon-download el-icon--right"></i></el-button>
</div> </div>
<el-upload <el-upload name="file"
name="file"
accept=".xls,.xlsx" accept=".xls,.xlsx"
:on-remove="handleRemove" :on-remove="handleRemove"
:on-error="uploadError" :on-error="uploadError"
@ -103,15 +185,19 @@
:on-exceed="handleExceed" :on-exceed="handleExceed"
:action="this.api.importStaff" :action="this.api.importStaff"
:file-list="uploadList" :file-list="uploadList"
:headers="headers" :headers="headers">
> <el-button type="primary"
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button> class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
</el-upload> </el-upload>
<el-link v-if="uploadFaild" type="primary" @click="showFaild">部分数据导入失败查看失败原因</el-link> <el-link v-if="uploadFaild"
type="primary"
@click="showFaild">部分数据导入失败查看失败原因</el-link>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer"
class="dialog-footer">
<el-button @click="importVisible = false"> </el-button> <el-button @click="importVisible = false"> </el-button>
<el-button type="primary" @click="uploadSure"> </el-button> <el-button type="primary"
@click="uploadSure"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
@ -122,7 +208,7 @@ import util from "@/libs/util";
import org from "./staffSide" import org from "./staffSide"
import { mapState } from "vuex"; import { mapState } from "vuex";
export default { export default {
data() { data () {
return { return {
exportCode: "", exportCode: "",
headers: { headers: {
@ -159,7 +245,7 @@ export default {
{ required: true, message: "请输入工号", trigger: 'blur' }, { required: true, message: "请输入工号", trigger: 'blur' },
{ {
pattern: /^[A-Za-z0-9]*$/, pattern: /^[A-Za-z0-9]*$/,
message: "职工工号必须为数字或英文", message: "教师工号必须为数字或英文",
trigger: "blur" trigger: "blur"
} }
], ],
@ -167,7 +253,7 @@ export default {
// { required: true, message: '', trigger: 'blur' }, // { required: true, message: '', trigger: 'blur' },
], ],
phone: [ phone: [
{ pattern: /^1[3456789]\d{9}$/, message: "请输入正确的手机号", trigger: "blur"} { pattern: /^1[3456789]\d{9}$/, message: "请输入正确的手机号", trigger: "blur" }
], ],
email: [ email: [
{ {
@ -206,25 +292,25 @@ export default {
]) ])
}, },
watch: { watch: {
keyword: function(val) { keyword: function (val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData(); this.initData();
}, 500); }, 500);
} }
}, },
mounted() { mounted () {
this.originForm = JSON.parse(JSON.stringify(this.form)) this.originForm = JSON.parse(JSON.stringify(this.form))
this.getRoleData() this.getRoleData()
this.getData() this.getData()
}, },
methods: { methods: {
getSingle(data) { getSingle (data) {
this.staffArchitectureId = data.gradeId ? '' : data.staffArchitectureId this.staffArchitectureId = data.gradeId ? '' : data.staffArchitectureId
this.gradeId = data.gradeId || '' this.gradeId = data.gradeId || ''
this.initData() this.initData()
}, },
getCheck(data) { getCheck (data) {
const marjorIds = [] const marjorIds = []
const depIds = [] const depIds = []
data.forEach(e => { data.forEach(e => {
@ -234,12 +320,12 @@ export default {
this.gradeId = depIds.toString() this.gradeId = depIds.toString()
this.initData() this.initData()
}, },
initData() { initData () {
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.page = 1 this.page = 1
this.getData() this.getData()
}, },
getData() { // getData () { //
let data = { let data = {
keyWord: this.keyword, keyWord: this.keyword,
pageNum: this.page, pageNum: this.page,
@ -250,22 +336,22 @@ export default {
this.$post(this.api.staffList, data).then(res => { this.$post(this.api.staffList, data).then(res => {
this.listData = res.page.records; this.listData = res.page.records;
this.total = res.page.total; this.total = res.page.total;
}).catch(res => {}); }).catch(res => { });
}, },
getRoleData() { // getRoleData () { //
this.roleList =[]; this.roleList = [];
this.$get(`${this.api.roleList}?page=1&size=100&name=&platformId=1&port=0`).then(res => { this.$get(`${this.api.roleList}?page=1&size=100&name=&platformId=1&port=0`).then(res => {
for(var i=0;i<res.rolePage.records.length;i++){ for (var i = 0; i < res.rolePage.records.length; i++) {
if (res.rolePage.records[i].roleName == '超级管理员'){ if (res.rolePage.records[i].roleName == '超级管理员') {
}else{ } else {
this.roleList.push(res.rolePage.records[i]) this.roleList.push(res.rolePage.records[i])
} }
} }
// this.roleList = res.rolePage.records; // this.roleList = res.rolePage.records;
}).catch(res => {}); }).catch(res => { });
}, },
closeTeacher() { // / closeTeacher () { // /
this.form = { this.form = {
accountId: "", accountId: "",
account: "", account: "",
@ -280,13 +366,13 @@ export default {
this.$refs.form.clearValidate(); this.$refs.form.clearValidate();
this.teacherVisible = false; this.teacherVisible = false;
}, },
addTeacher() { // addTeacher () { //
this.isDetail = false; this.isDetail = false;
this.isAdd = true; this.isAdd = true;
this.teacherVisible = true; this.teacherVisible = true;
this.orgList = this.$refs.org.orgList; this.orgList = this.$refs.org.orgList;
}, },
getStaffDetail(accountId) { // getStaffDetail (accountId) { //
this.$get(`${this.api.staffDetail}?accountId=${accountId}`).then(res => { this.$get(`${this.api.staffDetail}?accountId=${accountId}`).then(res => {
let { data } = res; let { data } = res;
this.form = data; this.form = data;
@ -296,9 +382,9 @@ export default {
return i; return i;
}); });
console.log(22, this.form) console.log(22, this.form)
}).catch(res => {}); }).catch(res => { });
}, },
resetPassword(row) { // resetPassword (row) { //
this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, "提示", { type: "warning" }).then(() => { this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, "提示", { type: "warning" }).then(() => {
this.$get(`${this.api.resetPassword}?userId=${row.userId}&newPwd=1122aa`).then(res => { this.$get(`${this.api.resetPassword}?userId=${row.userId}&newPwd=1122aa`).then(res => {
util.successMsg("重置成功"); util.successMsg("重置成功");
@ -307,14 +393,14 @@ export default {
}).catch(() => { }).catch(() => {
}); });
}, },
editTeacher(row) { // editTeacher (row) { //
this.isDetail = false; this.isDetail = false;
this.isAdd = false; this.isAdd = false;
this.teacherVisible = true; this.teacherVisible = true;
this.orgList = this.$refs.org.orgList; this.orgList = this.$refs.org.orgList;
this.getStaffDetail(row.accountId); this.getStaffDetail(row.accountId);
}, },
showTeacher(row) { // showTeacher (row) { //
this.isDetail = true; this.isDetail = true;
this.isAdd = false; this.isAdd = false;
this.teacherVisible = true; this.teacherVisible = true;
@ -322,12 +408,12 @@ export default {
this.getStaffDetail(row.accountId); this.getStaffDetail(row.accountId);
}, },
// //
renderAccount() { renderAccount () {
const form = this.form const form = this.form
// id-id-schoolId-workNumber // id-id-schoolId-workNumber
form.account = `${Setting.platformId}-0-${this.schoolId}-${form.workNumber}` form.account = `${Setting.platformId}-0-${this.schoolId}-${form.workNumber}`
}, },
workNumberChange() { // workNumberChange () { //
const form = this.form const form = this.form
const { workNumber, accountId } = form const { workNumber, accountId } = form
if (workNumber) { if (workNumber) {
@ -336,14 +422,14 @@ export default {
this.workNumberReapeat = false this.workNumberReapeat = false
this.renderAccount() this.renderAccount()
} }
}).catch( err => { }).catch(err => {
this.workNumberReapeat = true this.workNumberReapeat = true
}) })
} else { } else {
this.renderAccount() this.renderAccount()
} }
}, },
phoneChange() { // phoneChange () { //
let regex = /^1[3456789]\d{9}$/; let regex = /^1[3456789]\d{9}$/;
if (regex.test(this.form.phone)) { if (regex.test(this.form.phone)) {
let url = ""; let url = "";
@ -356,12 +442,12 @@ export default {
if (res.status === 200) { if (res.status === 200) {
this.phoneRepeat = false; this.phoneRepeat = false;
} }
}).catch( err => { }).catch(err => {
this.phoneRepeat = true; this.phoneRepeat = true;
}); });
} }
}, },
emailChange() { // emailChange () { //
let regex = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/; let regex = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
if (regex.test(this.form.email)) { if (regex.test(this.form.email)) {
let url = ""; let url = "";
@ -374,12 +460,12 @@ export default {
if (res.status === 200) { if (res.status === 200) {
this.emailRepeat = false; this.emailRepeat = false;
} }
}).catch( err => { }).catch(err => {
this.emailRepeat = true; this.emailRepeat = true;
}); });
} }
}, },
roleChange(value) { // roleChange (value) { //
console.log(this.form.roleValue) console.log(this.form.roleValue)
if (value.length) { if (value.length) {
let ids = this.form.roleAndDeptList.map(e => e.roleId); let ids = this.form.roleAndDeptList.map(e => e.roleId);
@ -400,18 +486,18 @@ export default {
this.form.roleAndDeptList.splice(0); this.form.roleAndDeptList.splice(0);
} }
}, },
roleRemove(value) { // roleRemove (value) { //
let list = []; let list = [];
for(var i=0;i<this.form.roleAndDeptList.length;i++){ for (var i = 0; i < this.form.roleAndDeptList.length; i++) {
if (this.form.roleAndDeptList[i].roleId == value){ if (this.form.roleAndDeptList[i].roleId == value) {
}else{ } else {
list.push(this.form.roleAndDeptList[i]) list.push(this.form.roleAndDeptList[i])
} }
} }
this.form.roleAndDeptList = list this.form.roleAndDeptList = list
}, },
async saveSure(form) { async saveSure (form) {
this.$refs[form].validate((valid) => { this.$refs[form].validate((valid) => {
if (valid) { if (valid) {
if (this.submiting) return false if (this.submiting) return false
@ -428,7 +514,7 @@ export default {
phone: this.form.phone, phone: this.form.phone,
email: this.form.email email: this.form.email
}; };
if (this.form.roleAndDeptList.length){ if (this.form.roleAndDeptList.length) {
for (let i = 0; i < this.form.roleAndDeptList.length; i++) { for (let i = 0; i < this.form.roleAndDeptList.length; i++) {
if (this.form.roleAndDeptList[i].cascaderValue.length < 2) { if (this.form.roleAndDeptList[i].cascaderValue.length < 2) {
util.warningMsg(`请选择${this.form.roleAndDeptList[i].roleName}所属部门`) util.warningMsg(`请选择${this.form.roleAndDeptList[i].roleName}所属部门`)
@ -468,20 +554,20 @@ export default {
} }
}); });
}, },
delTeacher(row) { delTeacher (row) {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
this.$post(`${this.api.delStaff}?accountIds=${row.accountId}`).then(res => { this.$post(`${this.api.delStaff}?accountIds=${row.accountId}`).then(res => {
util.successMsg("删除成功"); util.successMsg("删除成功");
this.getData(); this.getData();
}).catch(res => {}); }).catch(res => { });
}).catch(() => {}); }).catch(() => { });
}, },
handleSelectionChange(val) { handleSelectionChange (val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
delAllSelection() { delAllSelection () {
if (this.multipleSelection.length) { if (this.multipleSelection.length) {
// //
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
@ -500,35 +586,35 @@ export default {
}).catch(() => { }).catch(() => {
}); });
} else { } else {
util.errorMsg("请先选择员工 !"); util.errorMsg("请先选择教师 !");
} }
}, },
batchImport() { batchImport () {
this.importVisible = true; this.importVisible = true;
this.uploadList = []; this.uploadList = [];
this.uploadFaild = false; this.uploadFaild = false;
}, },
searchTeacher() { searchTeacher () {
this.page = 1; this.page = 1;
this.getData(); this.getData();
}, },
handleCurrentChange(val) { handleCurrentChange (val) {
this.page = val; this.page = val;
this.getData(); this.getData();
}, },
downLoad() { downLoad () {
location.href = this.api.staffTemplate; location.href = this.api.staffTemplate;
}, },
showFaild() { showFaild () {
location.href = `${this.api.exportFailureStaff}?exportCode=${this.exportCode}`; location.href = `${this.api.exportFailureStaff}?exportCode=${this.exportCode}`;
}, },
// //
handleExceed(files, fileList) { handleExceed (files, fileList) {
util.warningMsg( util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` `当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
); );
}, },
uploadSuccess(res, file, fileList) { uploadSuccess (res, file, fileList) {
console.log(res); console.log(res);
this.uploadFaild = false; this.uploadFaild = false;
if (res.status === 200) { if (res.status === 200) {
@ -541,21 +627,21 @@ export default {
res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据"); res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据");
} }
}, },
uploadError(err, file, fileList) { uploadError (err, file, fileList) {
this.$message({ this.$message({
message: "上传出错,请重试!", message: "上传出错,请重试!",
type: "error", type: "error",
center: true center: true
}); });
}, },
beforeRemove(file, fileList) { beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
}, },
handleRemove(file, fileList) { handleRemove (file, fileList) {
this.uploadList = fileList; this.uploadList = fileList;
this.uploadFaild = false; this.uploadFaild = false;
}, },
uploadSure() { uploadSure () {
this.importVisible = false; this.importVisible = false;
this.page = 1; this.page = 1;
this.keyword = ""; this.keyword = "";
@ -579,7 +665,7 @@ export default {
padding: 24px; padding: 24px;
} }
} }
.el-input__inner{ .el-input__inner {
height: 32px; height: 32px;
} }
</style> </style>

@ -2,11 +2,13 @@
<div> <div>
<div> <div>
<div class="flex-between m-b-20"> <div class="flex-between m-b-20">
<h6 class="p-title" style="margin-bottom: 0">员工组织架构</h6> <h6 class="p-title"
<el-button type="text" @click="addMajor" v-auth="'员工管理:新增专业'">添加</el-button> style="margin-bottom: 0">教师组织架构</h6>
<el-button type="text"
@click="addMajor"
v-auth="'员工管理:新增专业'">添加</el-button>
</div> </div>
<org-tree <org-tree :data="orgList"
:data="orgList"
show-checkbox show-checkbox
default-expand-all default-expand-all
ref="orgTree" ref="orgTree"
@ -15,26 +17,23 @@
:expand-on-click-node="false" :expand-on-click-node="false"
@node-click="getSingle" @node-click="getSingle"
@check="getCheck" @check="getCheck"
:props="{children: 'children', label: 'label', isLeaf: 'leaf'}" :props="{children: 'children', label: 'label', isLeaf: 'leaf'}">
> <span class="custom-tree-node"
<span class="custom-tree-node" slot-scope="{ node, data }"> slot-scope="{ node, data }">
<span style="display: inline-block; margin-right: 20px">{{ node.label }}</span> <span style="display: inline-block; margin-right: 20px">{{ node.label }}</span>
<span> <span>
<el-button <el-button v-auth="'员工管理:新增专业'"
v-auth="'员工管理:新增专业'"
type="text" type="text"
icon="el-icon-edit-outline" icon="el-icon-edit-outline"
@click="() => handleEdit(node, data)"> @click="() => handleEdit(node, data)">
</el-button> </el-button>
<el-button <el-button v-auth="'员工管理:编辑专业'"
v-auth="'员工管理:编辑专业'"
v-if="node.level === 1" v-if="node.level === 1"
type="text" type="text"
icon="el-icon-circle-plus-outline" icon="el-icon-circle-plus-outline"
@click="() => handleAdd(node, data)"> @click="() => handleAdd(node, data)">
</el-button> </el-button>
<el-button <el-button v-auth="'员工管理:删除专业'"
v-auth="'员工管理:删除专业'"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="() => handleDel(node, data)"> @click="() => handleDel(node, data)">
@ -44,27 +43,47 @@
</org-tree> </org-tree>
</div> </div>
<el-dialog :title="Form.staffArchitectureId ? '编辑部门' : '新增部门'" :visible.sync="majorVisible" width="24%" center @close="closeAdd" :close-on-click-modal="false"> <el-dialog :title="Form.staffArchitectureId ? '编辑部门' : '新增部门'"
<el-form ref="Form" :model="Form" :rules="rules"> :visible.sync="majorVisible"
width="24%"
center
@close="closeAdd"
:close-on-click-modal="false">
<el-form ref="Form"
:model="Form"
:rules="rules">
<el-form-item prop="staffArchitectureName"> <el-form-item prop="staffArchitectureName">
<el-input placeholder="请输入部门名称" v-model="Form.staffArchitectureName"></el-input> <el-input placeholder="请输入部门名称"
v-model="Form.staffArchitectureName"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer"
class="dialog-footer">
<el-button @click="majorVisible = false"> </el-button> <el-button @click="majorVisible = false"> </el-button>
<el-button type="primary" @click="sure('Form')"> </el-button> <el-button type="primary"
@click="sure('Form')"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog :title="Form.gradeId ? '编辑部门' : '新增部门'" :visible.sync="depVisible" width="24%" center @close="closeAdd" :close-on-click-modal="false"> <el-dialog :title="Form.gradeId ? '编辑部门' : '新增部门'"
<el-form ref="Form1" :model="Form" :rules="rules"> :visible.sync="depVisible"
width="24%"
center
@close="closeAdd"
:close-on-click-modal="false">
<el-form ref="Form1"
:model="Form"
:rules="rules">
<el-form-item prop="gradeName"> <el-form-item prop="gradeName">
<el-input placeholder="请输入部门名称" v-model="Form.gradeName"></el-input> <el-input placeholder="请输入部门名称"
v-model="Form.gradeName"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer"
class="dialog-footer">
<el-button @click="depVisible = false"> </el-button> <el-button @click="depVisible = false"> </el-button>
<el-button type="primary" @click="sureDepartment('Form1')"> </el-button> <el-button type="primary"
@click="sureDepartment('Form1')"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
@ -74,7 +93,7 @@ import util from "@/libs/util";
import OrgTree from "@/components/org-tree/src/tree"; import OrgTree from "@/components/org-tree/src/tree";
export default { export default {
props: ["Data"], props: ["Data"],
data() { data () {
return { return {
orgList: [], orgList: [],
firactive: 0, firactive: 0,
@ -102,11 +121,11 @@ export default {
components: { components: {
OrgTree OrgTree
}, },
mounted() { mounted () {
this.getStaff() this.getStaff()
}, },
methods: { methods: {
getStaff() { getStaff () {
this.$get(this.api.professionalList).then(res => { this.$get(this.api.professionalList).then(res => {
if (res.data && res.data.length) { if (res.data && res.data.length) {
res.data.map(e => { res.data.map(e => {
@ -119,30 +138,30 @@ export default {
(e.ischeck = false), (e.label = e.gradeName), (e.id = e.gradeId) (e.ischeck = false), (e.label = e.gradeName), (e.id = e.gradeId)
}) })
e.children = res.data e.children = res.data
}).catch(res => {}) }).catch(res => { })
}); });
} }
setTimeout(() => { setTimeout(() => {
this.orgList = res.data; this.orgList = res.data;
}, 500) }, 500)
}).catch(res => {}) }).catch(res => { })
}, },
closeAdd() { closeAdd () {
this.$refs.Form.resetFields() this.$refs.Form.resetFields()
}, },
getSingle(data) { getSingle (data) {
this.$emit('getSingle', data) this.$emit('getSingle', data)
}, },
getCheck(data, checked) { getCheck (data, checked) {
this.$emit('getCheck', checked.checkedNodes) this.$emit('getCheck', checked.checkedNodes)
}, },
// //
addMajor() { addMajor () {
this.Form.staffArchitectureId = '' this.Form.staffArchitectureId = ''
this.Form.staffArchitectureName = '' this.Form.staffArchitectureName = ''
this.majorVisible = true this.majorVisible = true
}, },
sure(Form) { // / sure (Form) { // /
this.$refs[Form].validate((valid) => { this.$refs[Form].validate((valid) => {
if (valid) { if (valid) {
let data = { let data = {
@ -186,13 +205,13 @@ export default {
} }
}); });
}, },
handleAdd(node, data) { // handleAdd (node, data) { //
this.Form.gradeId = '' this.Form.gradeId = ''
this.Form.gradeName = '' this.Form.gradeName = ''
this.depVisible = true this.depVisible = true
this.Form.staffArchitectureId = data.staffArchitectureId this.Form.staffArchitectureId = data.staffArchitectureId
}, },
handleEdit(node, data) { // handleEdit (node, data) { //
if (node.level === 1) { if (node.level === 1) {
this.Form.staffArchitectureId = data.staffArchitectureId this.Form.staffArchitectureId = data.staffArchitectureId
this.Form.staffArchitectureName = data.staffArchitectureName this.Form.staffArchitectureName = data.staffArchitectureName
@ -210,7 +229,7 @@ export default {
} }
} }
}, },
sureDepartment(Form) { // sureDepartment (Form) { //
this.$refs[Form].validate((valid) => { this.$refs[Form].validate((valid) => {
if (valid) { if (valid) {
let data = { let data = {
@ -259,10 +278,10 @@ export default {
} }
}); });
}, },
handleDel(node, data) { handleDel (node, data) {
node.level === 1 ? this.delMajor(data) : this.delDepartment(data) node.level === 1 ? this.delMajor(data) : this.delDepartment(data)
}, },
delMajor(item) { delMajor (item) {
this.$confirm("确定要删除该专业吗?该操作将会删除该组织下的用户账号。", "提示", { this.$confirm("确定要删除该专业吗?该操作将会删除该组织下的用户账号。", "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
@ -270,10 +289,10 @@ export default {
util.successMsg("删除成功") util.successMsg("删除成功")
this.$emit("getData") this.$emit("getData")
this.getStaff() this.getStaff()
}).catch(res => {}) }).catch(res => { })
}).catch(() => {}) }).catch(() => { })
}, },
delDepartment(item) { delDepartment (item) {
this.$confirm("确定要删除该部门吗?该操作将会删除该组织下的用户账号。", "提示", { this.$confirm("确定要删除该部门吗?该操作将会删除该组织下的用户账号。", "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
@ -282,8 +301,8 @@ export default {
this.getStaff() this.getStaff()
this.$emit("delDep", item, this.orgList) this.$emit("delDep", item, this.orgList)
this.$emit("getData") this.$emit("getData")
}).catch(res => {}) }).catch(res => { })
}).catch(() => {}) }).catch(() => { })
} }
} }
}; };
@ -302,7 +321,7 @@ export default {
.side_icon i { .side_icon i {
cursor: pointer; cursor: pointer;
font-size: 20px; font-size: 20px;
color: #9278FF; color: #9278ff;
} }
.side_tree { .side_tree {
@ -312,7 +331,7 @@ export default {
} }
.side_tree i { .side_tree i {
color: #9278FF; color: #9278ff;
margin-left: 10px; margin-left: 10px;
} }
@ -339,7 +358,7 @@ export default {
} }
.two_active { .two_active {
color: #9278FF; color: #9278ff;
} }
/* .two_active:hover{ /* .two_active:hover{
@ -348,7 +367,7 @@ export default {
} */ } */
.two_back:hover { .two_back:hover {
cursor: pointer; cursor: pointer;
color: #9278FF; color: #9278ff;
} }
.mar_top { .mar_top {
@ -382,11 +401,13 @@ export default {
transform: rotate(180deg); transform: rotate(180deg);
} }
.list-enter-active, .list-leave-active { .list-enter-active,
.list-leave-active {
transition: all 1s; transition: all 1s;
} }
.list-enter, .list-leave-to { .list-enter,
.list-leave-to {
opacity: 0; opacity: 0;
transform: translateY(-30px); transform: translateY(-30px);
} }

Loading…
Cancel
Save