diff --git a/public/table.json b/public/table.json deleted file mode 100644 index ddd2e32..0000000 --- a/public/table.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "list": [{ - "id": 1, - "name": "张三", - "money": 123, - "address": "广东省东莞市长安镇", - "state": "成功", - "date": "2019-11-1", - "thumb": "https://lin-xin.gitee.io/images/post/wms.png" - }, - { - "id": 2, - "name": "李四", - "money": 456, - "address": "广东省广州市白云区", - "state": "成功", - "date": "2019-10-11", - "thumb": "https://lin-xin.gitee.io/images/post/node3.png" - }, - { - "id": 3, - "name": "王五", - "money": 789, - "address": "湖南省长沙市", - "state": "失败", - "date": "2019-11-11", - "thumb": "https://lin-xin.gitee.io/images/post/parcel.png" - }, - { - "id": 4, - "name": "赵六", - "money": 1011, - "address": "福建省厦门市鼓浪屿", - "state": "成功", - "date": "2019-10-20", - "thumb": "https://lin-xin.gitee.io/images/post/notice.png" - } - ], - "pageTotal": 4 -} \ No newline at end of file diff --git a/src/assets/img/person/bg.png b/src/assets/img/person/bg.png new file mode 100644 index 0000000..3cd9a55 Binary files /dev/null and b/src/assets/img/person/bg.png differ diff --git a/src/assets/img/person/bind.png b/src/assets/img/person/bind.png new file mode 100644 index 0000000..84626d5 Binary files /dev/null and b/src/assets/img/person/bind.png differ diff --git a/src/assets/img/person/date.png b/src/assets/img/person/date.png new file mode 100644 index 0000000..0844163 Binary files /dev/null and b/src/assets/img/person/date.png differ diff --git a/src/assets/img/person/edit.png b/src/assets/img/person/edit.png new file mode 100644 index 0000000..8aab22d Binary files /dev/null and b/src/assets/img/person/edit.png differ diff --git a/src/assets/img/person/idcard.png b/src/assets/img/person/idcard.png new file mode 100644 index 0000000..0b71982 Binary files /dev/null and b/src/assets/img/person/idcard.png differ diff --git a/src/assets/img/person/manag.png b/src/assets/img/person/manag.png new file mode 100644 index 0000000..5cb92fd Binary files /dev/null and b/src/assets/img/person/manag.png differ diff --git a/src/assets/img/person/open.png b/src/assets/img/person/open.png new file mode 100644 index 0000000..caba915 Binary files /dev/null and b/src/assets/img/person/open.png differ diff --git a/src/assets/img/person/school.png b/src/assets/img/person/school.png new file mode 100644 index 0000000..53d8523 Binary files /dev/null and b/src/assets/img/person/school.png differ diff --git a/src/assets/img/person/select.png b/src/assets/img/person/select.png new file mode 100644 index 0000000..1099f6f Binary files /dev/null and b/src/assets/img/person/select.png differ diff --git a/src/assets/img/person/user.png b/src/assets/img/person/user.png new file mode 100644 index 0000000..6a2cafc Binary files /dev/null and b/src/assets/img/person/user.png differ diff --git a/src/components/Header.vue b/src/components/Header.vue index c97fc85..93e4191 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -5,12 +5,10 @@
- -
+
+ {{username}}
- {{username}} 退出
@@ -35,6 +33,9 @@ export default { } }, methods: { + toPerson(){ + this.$router.push('/person') + }, loginout() { localStorage.removeItem('ms_username'); this.$router.push('/login'); @@ -75,6 +76,11 @@ export default { height: 70px; align-items: center; } +.header-user-con .user{ + display: inline-flex; + align-items: center; + cursor: pointer; +} .user-avator { cursor: pointer; margin-left: 10px; diff --git a/src/config/index.js b/src/config/index.js index f6acf70..17241d2 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -17,6 +17,10 @@ export default { * @description 默认密码 */ initialPassword: '111aaa', + /** + * 所属平台:1->职站 2->数据平台 + */ + platformId: 1, /** * @description 系统列表 */ diff --git a/src/router/index.js b/src/router/index.js index 1b750d4..58fe9a4 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -77,11 +77,15 @@ let router = new Router({ meta: { title: '数据管理' } }, { - // 权限页面 path: '/permission', - component: () => import(/* webpackChunkName: "permission" */ '../views/customer/Permission.vue'), + component: () => import('../views/customer/Permission.vue'), meta: { title: '应用权限', permission: true } }, + { + path: '/person', + component: () => import('../views/setting/Person.vue'), + meta: { title: '个人中心' } + }, { path: '/404', component: () => import(/* webpackChunkName: "404" */ '../views/404.vue'), diff --git a/src/store/index.js b/src/store/index.js index 3f87e58..327cada 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -3,7 +3,6 @@ import Vuex from 'vuex'; Vue.use(Vuex); const store = new Vuex.Store({ state: { - customerId:'', courseId:'', userId: '', roleId: '', @@ -13,15 +12,14 @@ const store = new Vuex.Store({ systemId: '', orderId: '', userLoginId: '', + userName: '', + roleId: '', loginToken: '' }, mutations:{ userData (state, payload) { state.userId = payload.user_id }, - customerData (state, payload) { - state.customerId = payload.customer_id - }, courseData (state, payload) { state.courseId = payload.course_id }, @@ -40,6 +38,8 @@ const store = new Vuex.Store({ }, userLoginData (state, payload) { state.userLoginId = payload.userLogin_id + state.userName = payload.userName + state.roleId = payload.roleId }, tokenData (state, payload) { state.loginToken = payload.loginToken diff --git a/src/utils/api.js b/src/utils/api.js index c05972f..4ae60d5 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -1,20 +1,15 @@ -// let host = 'http://192.168.31.117:8080' -// let host = 'http://www.huorantech.cn/liuwanr' let host = 'http://39.108.250.202' -let host1 = 'http://192.168.31.216:8888' +let host1 = 'http://192.168.31.151:9000' +let host2 = 'http://192.168.31.125:9000' +let host3 = 'http://192.168.31.140:9000' export default { logins: `${host}/liuwanr/userInfo/adminLogins`, //登录 - // addUser: `${host}/liuwanr/user/addUser`, //增加用户 addUser: `${host}/liuwanr/userInfo/addUser`, //增加用户新版 - // queryUser: `${host}/liuwanr/user/queryUser`, //查询用户 queryUser: `${host}/liuwanr/userInfo/queryUserInfo`, //查询用户新版 - // deleteUser: `${host}/liuwanr/user/deleteUser`, //删除用户 deleteUser: `${host}/liuwanr/userInfo/deleteUserInfo`, //删除用户新版 updateUser: `${host}/liuwanr/user/updateUser`, //编辑用户 - // queryUserDetails: `${host}/liuwanr/user/queryUserDetails`, //查询用户详情 - queryUserInfoDetails: `${host}/liuwanr/userInfo/queryUserInfoDetails`, //查询用户详情新版 queryAccountIsExist: `${host}/liuwanr/userInfo/queryServerAccountIsExist`, //查询账号是否存在 queryUserOR: `${host}/liuwanr/userInfo/queryUserOR`, //查询系统列表详情 queryWorkNumberIsExist:`${host}/liuwanr/userInfo/queryWorkNumberIsExist`,//查询学号、工号是否存在 @@ -30,20 +25,38 @@ export default { updateOR: `${host}/liuwanr/userInfo/updateOR`, //更新用户组织架构 deletePlatform: `${host}/liuwanr/userInfo/deletePlatform`, //更新用户组织架构 updateUserRoleId: `${host}/liuwanr/userInfo/updateUserRoleId`, //更新用户角色id接口 - resetPwd:`${host}/evaluation/tms/system/resetPwd`, - deleteCustomer: `${host}/liuwanr/customer/deleteCustomer`, //删除客户 - updateCustomer: `${host}/liuwanr/customer/updateCustomer`, //更新客户 - addCustomer: `${host}/liuwanr/customer/addCustomer`, //添加客户 - queryCustomer: `${host}/liuwanr/customer/queryCustomer`, //查询客户 - queryCustomerIsExists: `${host}/liuwanr/customer/queryCustomerIsExists`, //查询客户是否存在 - queryCustomerDetails: `${host}/liuwanr/customer/queryCustomerDetails`, //查询客户详情 - queryCustomerIndustryClass: `${host}/liuwanr/customer/queryCustomerIndustryClass`, //查询行业类 - queryCustomerIndustry: `${host}/liuwanr/customer/queryCustomerIndustry`, //查询行业 - queryPhone: `${host}/liuwanr/user/queryPhone`, //查询电话 - querySchoolData: `${host}/liuwanr/customer/querySchool`, //根据学校名称查询学校信息 - queryPlatform: `${host}/liuwanr/userInfo/queryPlatform`, //查询系统列表 + // 客户管理 + deleteCustomer: `${host3}/nakadai/customer/delCustomer`, + updateCustomer: `${host3}/nakadai/customer/updateCustomer`, + addCustomer: `${host3}/nakadai/customer/addCustomer`, + queryCustomer: `${host3}/nakadai/customer/queryCustomer`, + queryCustomerDetails: `${host3}/nakadai/customer/queryCustomerDetails`, + resetPwdCustomer: `${host3}/nakadai/customer/resetPwd`, + queryCustomerIsExists: `${host3}/nakadai/customer/queryCustomerIsExists`, + updateEnabled: `${host3}/nakadai/customer/updateEnabled`, + queryCustomerIndustryClass: `${host}/liuwanr/customer/queryCustomerIndustryClass`, + queryCustomerIndustry: `${host}/liuwanr/customer/queryCustomerIndustry`, + queryPhone: `${host}/liuwanr/user/queryPhone`, + querySchoolData: `${host3}/nakadai/school/querySchool`, + queryPlatform: `${host}/liuwanr/userInfo/queryPlatform`, + // 用户管理 + delUserAccount: `${host3}/users/userAccount/delUserAccount`, + queryUserInfoDetails: `${host3}/users/userAccount/queryUserInfoDetails`, + queryUserInfoList: `${host3}/users/userAccount/queryUserInfoList`, + resetPwd: `${host3}/users/userAccount/resetPwd`, + selectAccountDetail: `${host3}/users/userAccount/selectAccountDetail`, + selectUserSysBind: `${host3}/users/userAccount/selectUserSysBind`, + updatePersonCenter: `${host3}/users/userAccount/updatePersonCenter`, + updateUserAvatars: `${host3}/users/userAccount/updateUserAvatars`, + userInfo: `${host3}/users/userAccount/userInfo`, + checkCode: `${host3}/users/userAccount/checkCode`, + findPasswordByEmail: `${host3}/users/userAccount/findPasswordByEmail`, + findPasswordByPhone: `${host3}/users/userAccount/findPasswordByPhone`, + updateAccountEnable: `${host3}/users/userAccount/updateAccountEnable`, + updateAccountAllEnable: `${host3}/users/userAccount/updateAccountAllEnable`, + queryOrder: `${host}/liuwanr/order/queryOrder`, //查询订单 queryOrderDetails: `${host}/liuwanr/order/queryOrderDetails`, //查询订单详情 queryOrderCustomer: `${host}/liuwanr/order/queryOrderCustomer`, //查询订单客户 @@ -96,15 +109,23 @@ export default { downloadFiles: `${host}/liuwanr/aliyun/downloadFiles`, //下载文件 // 数据管理 - getIdQueryTable:`${host1}/data/huoran/data/table/getIdQueryTable`, - getTableByClassification:`${host1}/data/huoran/data/table/getTableByClassification`, - getTableByCondition:`${host1}/data/huoran/data/table/getTableByCondition`, - originalList:`${host1}/data/huoran/data/table/originalList`, - originalListById:`${host1}/data/huoran/data/table/originalListById`, - saveCategory:`${host1}/data/huoran/data/table/saveCategory`, - saveTable:`${host1}/data/huoran/data/table/saveTable`, - updateCategory:`${host1}/data/huoran/data/table/updateCategory`, - deleteCategory:`${host1}/data/huoran/data/table/deleteCategory`, - deleteTable:`${host1}/data/huoran/data/table/deleteTable`, - previewData:`${host1}/data/data/preview`, + getIdQueryTable:`${host1}/data/table/getIdQueryTable`, + getTableByClassification:`${host1}/data/table/getTableByClassification`, + getTableByCondition:`${host1}/data/table/getTableByCondition`, + originalList:`${host1}/data/table/originalList`, + originalListById:`${host1}/data/table/originalListById`, + saveCategory:`${host1}/data/table/saveCategory`, + saveTable:`${host1}/data/table/saveTable`, + updateCategory:`${host1}/data/table/updateCategory`, + deleteCategory:`${host1}/data/table/deleteCategory`, + deleteTable:`${host1}/data/table/deleteTable`, + previewData:`${host2}/data/preview`, + + // 产品管理 + deleteProduct:`${host1}/data/product/delete`, + findById:`${host1}/data/product/findById`, + listByEntity:`${host1}/data/product/listByEntity`, + saveProduct:`${host1}/data/product/save`, + updateProduct:`${host1}/data/product/update`, + saveRecord:`${host1}/data/dataRecord/saveRecord`, } \ No newline at end of file diff --git a/src/utils/http.js b/src/utils/http.js index e819b5a..b282a32 100644 --- a/src/utils/http.js +++ b/src/utils/http.js @@ -133,10 +133,8 @@ export function get(url, params){ resolve(res.data); break; case 500: - this.$message.error( - res.data.errmessage - ); - break; + reject(res.data) + break case 300: this.$message.error( res.data.errmessage @@ -229,6 +227,11 @@ export function post(url, params) { res.data.errmessage ); break; + case 10001: + this.$message.error( + res.data.message + ); + break; } }else{ resolve(res.data) diff --git a/src/views/Home.vue b/src/views/Home.vue index 7b38572..e043743 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -5,9 +5,9 @@
- + - +
diff --git a/src/views/Login.vue b/src/views/Login.vue index 89b28e7..ce9e518 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -63,9 +63,10 @@ export default { } this.$post(this.api.logins,data).then(res => { if(res.message.retvalue.roleId == 1){ + let user = res.message.retvalue this.$message.success('登录成功'); localStorage.setItem('ms_username', this.param.username); - this.$store.commit("userLoginData", { userLogin_id : res.message.retvalue.userId}); + this.$store.commit("userLoginData", { userLogin_id : user.userId,userName: user.userName,roleId: user.roleId}); this.$store.commit("tokenData", {loginToken: res.message.retvalue.loginToken}) this.$router.push('/customer'); }else{ diff --git a/src/views/customer/AddCustomer.vue b/src/views/customer/AddCustomer.vue index 31dce13..b60a2c5 100644 --- a/src/views/customer/AddCustomer.vue +++ b/src/views/customer/AddCustomer.vue @@ -7,7 +7,7 @@
返回 - +
确定
@@ -21,73 +21,74 @@
- + - + - - - - - - - - + + - - + + - - + + + + + + + + + + - - + + - - - - - - - - + + - - + + + + - - + + - - + + + + + + @@ -98,33 +99,68 @@

- 应用权限 + 课程权限
- + - + - + - + - + + + + + + +
+
+ + +
+

+ 数据平台权限 +
+
+ + + + + + + + - + @@ -142,19 +178,21 @@ + + - + - + - + - +
@@ -216,31 +254,48 @@ - diff --git a/src/views/customer/customer.vue b/src/views/customer/customer.vue index e977b95..7ee06c7 100644 --- a/src/views/customer/customer.vue +++ b/src/views/customer/customer.vue @@ -12,28 +12,28 @@ - + - + - + - + @@ -54,31 +54,34 @@ 批量删除
- + - - - + + + - + + + - + - + @@ -114,11 +144,16 @@ export default { data() { return { + schoolId: 1001, + userId: this.$store.state.userLoginId, + userName: this.$store.state.userName, keyword: '', searchTimer: null, date: [], + startTime: '', + endTime: '', status: '', - orderData:[], + listData:[], multipleSelection: [], statusList: [{ name: '不限', @@ -129,26 +164,63 @@ export default { }, { name: '已下架', - value: 2 + value: 0 }], - pageNo: 1, + page: 1, pageSize: 10, totals: 1, productVisible: false, + id: '', + productName: '', + market: '', typeList: [], defaultProps: { children: 'children', label: 'label' }, - defaultActive: [], + checkedIds: [], + isDetail: false, + typeIndex: 1000, + + configVisible: false, + configChecked: [], + configCheckedTableId: [], + categoryId: '', + configIds: [], + updateTime: '', + keywordConfig: '', + typeConfigList: [], + pageConfig: 1, + pageSizeConfig: 10, + totalConfig: 0, + listConfigData: [], + previewVisible: false, + previewHead: [], + previewData: [] }; }, watch: { + date: function(val){ + if(val){ + this.startTime = val[0] + this.endTime = val[1] + }else{ + this.startTime = '' + this.endTime = '' + } + this.initData() + }, keyword: function(val) { clearTimeout(this.searchTimer) this.searchTimer = setTimeout(() => { this.initData() },500) + }, + keywordConfig: function(val) { + clearTimeout(this.searchTimer) + this.searchTimer = setTimeout(() => { + this.initConfigData() + },500) } }, mounted() { @@ -156,64 +228,132 @@ export default { }, methods: { getData() { - // this.$get(this.api.queryOrder,data).then(res => { - // res.message.rows.forEach(e => { - // e.orderType = this.orderTypeFn(e.orderType) - // e.orderStatus = this.orderStatusFn(e.orderStatus) - // e.orderNature = this.orderNatureFn(e.orderNature) - // }) - // this.orderData = res.message.rows - // this.totals = res.message.total - // }).catch(res => {}); + this.$post(this.api.listByEntity,{ + createTime: this.startTime, + endTime: this.endTime, + pageNum: this.page, + pageSize: this.pageSize, + productName: this.keyword, + status: this.status, + }).then(res => { + this.listData = res.pageList.records + this.totals = res.pageList.total + }).catch(res => {}) }, initData(){ - this.pageNo = 1 + this.page = 1 this.getData() }, + getTable(n,i){ + this.$post(`${this.api.getIdQueryTable}?categoryId=${n.originId}&showName=&pageNum=1&pageSize=10000&updateTime=`).then(res => { + res.list.map(n => { + n.label = n.showName + n.id = String(n.id) + }) + n.children = res.list + }).catch(res => {}) + }, getType(){ + this.productVisible = true this.$post(this.api.getTableByClassification).then(res => { res.map(n => { - n.id = String(n.id) + n.originId = n.id + n.id = String(++this.typeIndex) n.label = n.categoryName n.children.map(n => { - n.id = String(n.id) + n.originId = n.id + n.id = String(++this.typeIndex) n.label = n.categoryName n.children.map(n => { - n.id = String(n.id) + n.originId = n.id + n.id = String(++this.typeIndex) n.label = n.categoryName n.isThird = true }) }) }) - this.typeList = res - this.productVisible = true + res.map((n,i) => { + if(n.children.length){ + n.children.map(n => { + if(n.children.length){ + n.children.map(n => this.getTable(n,i)) + }else{ + this.getTable(n,i) + } + }) + }else{ + this.getTable(n,i) + } + }) + setTimeout(() => { + this.typeList = res + },500) + this.importVisible = true + }).catch(res => {}) + }, + handleType(data,typeList){ + let result = data + if(typeList.length){ + typeList.map(e => { + if(result.includes(e.id) && e.children.length){ + e.children.every(n => result.includes(n)) || result.splice(result.indexOf(e.id),1) + } + e.children.length && this.handleType(data,e.children) + }) + } + return result + }, + getDetail(){ + this.$post(`${this.api.findById}?id=${this.id}`).then(res => { + let data = res.product + this.productName = data.productName + this.market = data.market + this.checkedIds = this.handleType(data.tableId.split(','),this.typeList) + this.$refs.type.setCheckedNodes(this.checkedIds) }).catch(res => {}) }, add(){ this.getType() + this.id = '' + this.checkedIds = [] }, edit(row){ this.getType() + this.id = row.id + this.getDetail() + }, + switchOff(val,row,index) { + this.$post(this.api.updateProduct,{ + id: row.id, + productName: row.productName, + market: row.market, + tableId: row.tableId, + userId: row.userId, + userName: row.userName, + createTime: '', + orderNum: '', + status: val, + tableNum: row.tableNum, + updateTime: '', + }).then(res => { + this.$message.success(val ? '上架成功' : '下架成功') + }).catch(err => {}) }, preview(row){ this.isDetail = true this.getType() + this.id = row.id + this.getDetail() }, handleDelete(row) { this.$confirm('确定要删除吗?', '提示', { type: 'warning' - }) - .then(() => { - let result = row.orderId - var arr = [] - arr.push(result) - let data = arr - this.$post(this.api.deleteOrder,data).then(res => { + }).then(() => { + this.$post(`${this.api.deleteProduct}?ids=${row.id}`).then(res => { this.$message.success('删除成功') this.getData() - }).catch(res => {}); - }) - .catch(() => {}); + }).catch(res => {}) + }).catch(() => {}) }, handleSelectionChange(val) { this.multipleSelection = val @@ -221,33 +361,183 @@ export default { delAllSelection() { if(this.multipleSelection.length != ''){ let arr = this.multipleSelection - let result = arr.map(e => e.orderId) + let result = arr.map(e => e.id) this.$confirm('确定要删除吗?', '提示', { type: 'warning' - }) - .then(() => { - let data = result - this.$post(this.api.deleteOrder,data).then(res => { - this.multipleSelection = [] + }).then(() => { + this.$post(`${this.api.deleteProduct}?ids=${result.join(',')}`).then(res => { + this.$refs.table.clearSelection() this.$message.success('删除成功') this.getData() }).catch(res => {}) }).catch(() => {}) }else{ - this.$message.error('请先选择订单 !') + this.$message.error('请先选择数据') } }, handleCurrentChange(val) { - this.pageNo = val + this.page = val this.getData() }, closeProduct(){ + this.productName = '' + this.market = '' this.isDetail = false + this.typeIndex = 1000 + this.typeList = [] + }, + confirm(){ + if(!this.productName) return this.$message.warning('请输入数据产品名称') + if(!this.market) return this.$message.warning('请输入市场价格') + if(isNaN(this.market)) return this.$message.warning('市场价格请输入数字') + let list = this.$refs.type.getCheckedNodes() + let tableId = [] + list.map(n => { + if(n.name) tableId.push(n.id) + }) + if(!tableId.length) return this.$message.warning('请选择数据') + let data = { + id: this.id, + productName: this.productName, + market: this.market, + tableId: tableId.join(), + userId: this.userId, + userName: this.userName, + createTime: '', + orderNum: '', + status: '', + tableNum: tableId.length, + updateTime: '', + } + if(this.id){ + this.$post(this.api.updateProduct,data).then(res => { + this.$message.success('新增成功') + this.productVisible = false + this.getData() + }).catch(res => {}) + }else{ + this.$post(this.api.saveProduct,data).then(res => { + this.$message.success('新增成功') + this.productVisible = false + this.getData() + }).catch(res => {}) + } + }, + + configData(){ + this.configVisible = true + this.getConfigType() + + let list = this.$refs.type.getCheckedNodes() + let configIds = [] + list.map(n => { + if(!n.name) configIds.push(n.originId) + }) + this.configIds = configIds + }, + typeConfigClick(data,node){ + this.categoryId = data.id + this.getConfigTable() + }, + closeConfig(){ + this.$refs.typeConfig.setCheckedNodes([]) + }, + getConfigType(){ + this.$post(this.api.getTableByClassification).then(res => { + res.map(n => { + n.id = String(n.id) + n.label = n.categoryName + n.children.map(n => { + n.id = String(n.id) + n.label = n.categoryName + n.children.map(n => { + n.id = String(n.id) + n.label = n.categoryName + n.isThird = true + }) + }) + }) + this.typeConfigList = res + if(res[0].children.length){ + this.categoryId = res[0].children[0].id + }else{ + this.categoryId = res[0].id + } + this.getConfigTable() + }).catch(res => {}) + }, + getConfigTable(){ + this.$post(`${this.api.getIdQueryTable}?categoryId=${this.categoryId}&showName=${this.keywordConfig}&pageNum=${this.pageConfig}&pageSize=${this.pageSizeConfig}&updateTime=${this.updateTime ? this.updateTime : ''}`).then(res => { + this.listConfigData = res.list + this.totalConfig = res.totalCount + }).catch(res => {}) + }, + initConfigData(){ + this.pageConfig = 1 + this.getConfigTable() + }, + handleCurrentConfigChange(){ + this.pageConfig = val + this.getConfigTable() + }, + previewConfig(row){ + this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => { + this.$post(this.api.saveRecord,{ + platformUserId: 4, + tableId: row.id, + type: 2, + schoolId: this.schoolId, + }).then(res => {}).catch(res => {}) + + let comment = res.comment + let previewHead = [] + comment.map(n => { + n.field != 'id' && n.field != 'operation_time' && previewHead.push(n) + }) + this.previewHead = previewHead + + let data = res.data + data.map(n => { + for(let i in n){ + if(typeof n[i] == 'string' && n[i].endsWith('+0000')) n[i] = this.formatDate('yyyy-MM-dd hh:mm:ss',new Date(n[i])) + } + }) + this.previewData = data + this.previewVisible = true + }).catch(res => {}) + }, + getTableId(list){ + let checked = this.configChecked + list.map(n => { + if(n.children && n.children.length){ + this.getTableId(n.children) + if(checked.includes(n.originId) && n.children[0].name){ + this.configCheckedTableId = [...this.configCheckedTableId,...n.children.map(n => n.id)] + }else{ + this.getTableId(n.children) + } + } + }) + }, + confirmConfig(){ + this.configChecked = this.$refs.typeConfig.getCheckedKeys().map(n => Number(n)) + this.getTableId(this.typeList) + this.checkedIds = Array.from(new Set(this.configCheckedTableId)) + this.configVisible = false + this.$refs.type.setCheckedNodes(this.checkedIds) } } }; \ No newline at end of file diff --git a/src/views/setting/Person.vue b/src/views/setting/Person.vue new file mode 100644 index 0000000..1035602 --- /dev/null +++ b/src/views/setting/Person.vue @@ -0,0 +1,1322 @@ + + + + + \ No newline at end of file diff --git a/src/views/user/AddUser.vue b/src/views/user/AddUser.vue index 7a60574..c6cb161 100644 --- a/src/views/user/AddUser.vue +++ b/src/views/user/AddUser.vue @@ -7,17 +7,8 @@
返回 - + 查看用户信息
- 确定 @@ -29,7 +20,6 @@

用户信息 - 更新用户信息
@@ -40,14 +30,13 @@ :model="form" :rules="rules" label-width="120px" + :disabled="isDetail" > - - - - - - - + @@ -121,26 +106,22 @@ - - - - - - - - - - - - - - - - - - - - - + + + -
@@ -245,55 +206,47 @@

个人档案 -
- 更新个人档案 - 添加档案 -
- -
+
- +
- - - - + - @@ -305,37 +258,35 @@
- - @@ -344,103 +295,7 @@
-
- - -
- - - -
- - - - - - - - - - - - - - - - - - - - -
- -
- - -
-
- - - - - - - - - - - - -
-
-
-
-
- - 删除档案 -
+
@@ -453,17 +308,8 @@ 已绑定系统
- 新增系统 - - - + + -
+
组织关系 绑定组织关系 不绑定组织关系
-
- 新增院校 -
- -

{{item.customerName}}

-
- 角色选择 - - {{item1.label}} - -
- + +

{{index}}

- - -
- 管理员 -
- 工号 - -
-
- -
-
- 一级部门 - - - -
-
- 二级部门 - - - -
-
-
- - -
- 教师 -
- 工号 - -
-
-
-
- 一级部门 - - - -
-
- 二级部门 - - - -
-
-
- - -
- 学生 -
- 学号 - -
-
-
-
- 专业 - - - -
-
- 年级 - - - -
-
- 班级 - - - -
-
-
-
-
-
- - -
-
-

- 院校列表 +
+

{{typeList.find(n => n.id == item1.type).label}}

+ +
    +
    +
  • + 工号: +

    {{item1.workNumber}}

    +
  • +
  • + 账号: +

    {{item1.account}}

    +
  • +
  • + +
  • +
    +
    +
  • + 该工号所绑定角色: +

    管理员

    +
  • +
    +
+
-
- -
-
- - - - - - - - - - - - - - -
@@ -735,24 +372,15 @@ class="table" stripe header-align="center" - @selection-change="handleSelectionChange" - :row-key="getRowKeys" + row-key="platformId" > - @@ -767,19 +395,17 @@ export default { name: 'baseform', data() { return { - //管理员 - jobNumber: '', //工号 - primaryDepartment: '', //一级部门 - secondaryDepartments: '', //二级部门 - // 教师 - jobNumber_T: '', //工号 - primaryDepartment_T: '', //一级部门 - secondaryDepartments_T: '', //二级部门 - //学生 - stuNumber: '', //学号 - major: '', //专业 - year: '', //年级 - class: '', //班级 + isDetail: true, + + typeList: [ + { + id: 0, + label: '教师端' + },{ + id: 1, + label: '学生端' + } + ], region: '', // 系统选择 checkList: [{ label: '管理员', @@ -800,7 +426,7 @@ export default { //个人信息 userId: this.$store.state.userId, userName: '', //用户姓名 - uniqueIdentificationAccount: '', //唯一识别码 + uniqueIdentification: '', //唯一识别码 documentType: 1, //证件类型 IDNumber: '', //证件号码 cityId: '', //省份 @@ -815,7 +441,6 @@ export default { phone: '', //手机号码 WeChatID: '', //微信 email: '', //邮箱 - account: '' //账号 }, occupationList: [{ value: 1, @@ -842,17 +467,9 @@ export default { archivesList: [], rules: { userName: [{ required: true, message: '请输入用户姓名', trigger: 'blur' }], - schoolId: [{ required: true, message: '请选择所在院校', trigger: 'change' }], - account: [ - { required: true, message: '请输入账号', trigger: 'blur' }, - // { - // pattern: /^[0-9]*$/, - // message: '账号必须为数字', - // trigger: 'blur' - // } - ], + schoolId: [{ required: true, message: '请选择当前院校', trigger: 'change' }], phone: [ - // { required: true, message: '请输入手机号', trigger: 'blur' }, + { required: true, message: '请输入手机号', trigger: 'blur' }, { pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号', @@ -930,7 +547,7 @@ export default { userId: this.$store.state.userId, IDdisabled: false, regionOption: [{ - regionName: '教学平台', + regionName: '职站', regionId: 1 }, { @@ -964,81 +581,55 @@ export default { }, mounted() { this.getSchoolData() - this.getSubject() if(this.userId){ this.$get(this.api.queryUserInfoDetails,{ userId: this.userId }).then(res => { - this.form.userName = res.message.userInfo.userName, - this.form.uniqueIdentificationAccount = res.message.userInfo.uniqueIdentificationAccount, - this.form.documentType = res.message.userInfo.documentType, - this.form.IDNumber = res.message.userInfo.iDNumber, - this.form.cityId = res.message.userInfo.cityId, - this.form.countries = res.message.userInfo.countries, - this.form.provinceId = res.message.userInfo.provinceId, - this.form.dateBirth = res.message.userInfo.dateBirth, - this.form.educationDegree = res.message.userInfo.educationDegree, - this.form.sex = res.message.userInfo.sex, - this.form.schoolId = res.message.userInfo.schoolId, - this.form.phone = res.message.userInfo.phone, - this.form.WeChatID = res.message.userInfo.weChatID, - this.form.email = res.message.userInfo.email, - this.form.account = res.message.userInfo.account - if(res.message.userInfo.provinceId){ - this.getCityData() - } - // 个人档案 - if(res.message.userProfilesList[0]){ - this.archivesForm = res.message.userProfilesList[0] - if(res.message.userProfilesList[0].disciplineId){ - this.getProfessionalClassData(res.message.userProfilesList[0].disciplineId) - } - if(res.message.userProfilesList[0].professionalClassId){ - this.getProfessionalData(res.message.userProfilesList[0].professionalClassId) - } - }else{ - this.archivesForm = {} + let userInfo = res.result.hrUserInfo + let personalFileList = res.result.personalFileList + let platformList = res.result.platformList + let userAccount = res.result.userAccountList + + this.form.userName = userInfo.userName + this.form.uniqueIdentification = userInfo.uniqueIdentification + this.form.IDNumber = userInfo.iDNumber + this.form.cityId = userInfo.cityId + this.form.provinceId = userInfo.provinceId + this.form.dateBirth = userInfo.dateBirth + this.form.educationDegree = userInfo.educationDegree + this.form.sex = userInfo.sex + this.form.schoolId = userInfo.schoolId + this.form.phone = userInfo.phone + this.form.WeChatID = userAccount[0].wechatId + if(userInfo.provinceId){ + this.getCityData() + } + // 个人档案 + if(personalFileList.length != 0){ + personalFileList.map(e =>{ + this.$set(e, 'subjectList', this.subjectList); + if(e.disciplineId){ + this.$get(this.api.queryCourseProfessionalClass,{ disciplineId: e.disciplineId }).then(res => { + this.$set(e, 'ProfessionalClassList', res.message); + }).catch(res => {}); } - // 循环档案 - this.archivesList = res.message.userProfilesList.splice(1, 2) - if(this.archivesList.length != 0){ - this.archivesList.map(e =>{ - this.$set(e, 'subjectList', this.subjectList); - if(e.disciplineId){ - this.$get(this.api.queryCourseProfessionalClass,{ disciplineId: e.disciplineId }).then(res => { - this.$set(e, 'ProfessionalClassList', res.message); - }).catch(res => {}); - } - if(e.professionalClassId){ - this.$get(this.api.queryCourseProfessional,{ professionalClassId: e.professionalClassId }).then(res => { - this.$set(e, 'ProfessionalList', res.message); - }).catch(res => {}); - } - }) + if(e.professionalClassId){ + this.$get(this.api.queryCourseProfessional,{ professionalClassId: e.professionalClassId }).then(res => { + this.$set(e, 'ProfessionalList', res.message); + }).catch(res => {}); } + }) + } + this.archivesList = personalFileList - // 平台系统 edit - // this.platformList = res.message.platformList - let staffPlatformList = res.message.staffPlatformList - let studentPlatformList = res.message.studentPlatformList - this.platformList = staffPlatformList - if(this.platformList.length == 1){ - studentPlatformList.forEach((n,k) => { - if(n.platformId != this.platformList[0].platformId){ - this.platformList.push(n) - } - }) - }else if(!this.platformList.length){ - this.platformList = studentPlatformList + // 平台系统 + platformList.map(e =>{ + this.regionOption.map((r,index) =>{ + if(r.regionId == e.platformId){ + this.regionOption.splice(index,1) } - this.platformList.map(e =>{ - this.regionOption.map((r,index) =>{ - if(r.regionId == e.platformId){ - this.regionOption.splice(index,1) - } - }) - }) - - }).catch((res) => { - }) + }) + }) + this.platformList = platformList + }).catch((res) => {}) } }, methods: { @@ -1057,16 +648,6 @@ export default { this.cityList = res.message }).catch(res => {}); }, - // 获取学校名称 - schoolChange(val){ - if(val){ - let obj = {}; - obj = this.schoolList.find(r =>{ - return r.schoolId === val; - }); - this.archivesForm.schoolName = obj.schoolName - } - }, // 获取列表学校名称 schoolitemChange(item){ if(item){ @@ -1081,6 +662,19 @@ export default { }) } }, + // 获取学校名称 + getSchoolData(){ + this.$get(this.api.querySchoolData,{ + schoolName: '', + provinceId: '', + cityId: '' + }).then(res => { + this.schoolList = res.list + }).catch(res => {}); + }, + goback(){ + this.$router.back() + }, // 获取学科类别 getSubject(){ this.$get(this.api.queryCourseDiscipline).then(res => { @@ -1211,701 +805,9 @@ export default { }) } }, - // 获取学校名称 - getSchoolData(){ - this.$get(this.api.querySchoolData,{ - schoolName: '', - provinceId: '', - cityId: '' - }).then(res => { - this.schoolList = res.message - }).catch(res => {}); - }, - // 清除一级部门 - clearStaffPro(item){ - this.chooseList.map(e =>{ - if(e.staffProfessionalArchitectureId == item){ - e.staffGradeId = '', - e.staffGradeName = '' - } - }) - }, - // 清除教师一级部门 - clearteacherStaffPro(item){ - this.chooseList.map(e =>{ - if(e.staffProfessionalArchitectureId == item){ - e.teacherstaffGradeId = '' - e.teacherstaffProName = '' - } - }) - }, - // 获取二级部门 - getStaffGradeList(item){ - this.clearStaffPro(item) - if(item){ - this.$get(this.api.queryStaffGrade,{ staffProfessionalArchitectureId: item }).then(res => { - this.chooseList.map(e =>{ - if(e.staffProfessionalArchitectureId == item){ - let obj = {}; - obj = e.firstClassList.find(r =>{ - return r.staffProfessionalArchitectureId === item; - }); - e.twoClassList = res.message - e.staffProfessionalArchitectureName = obj.staffProfessionalArchitectureName - } - }) - }).catch(res => {}); - } - }, - // 获取教师二级部门 - teacherStaffGradeList(item){ - this.clearteacherStaffPro(item) - if(item){ - this.$get(this.api.queryStaffGrade,{ staffProfessionalArchitectureId: item }).then(res => { - this.chooseList.map(e =>{ - if(e.teacherstaffProId == item){ - let obj = {}; - obj = e.firstClassList.find(r =>{ - return r.staffProfessionalArchitectureId === item; - }); - e.teachertwoClassList = res.message - e.teacherstaffProName = obj.staffProfessionalArchitectureName - } - }) - }).catch(res => {}); - } - }, - // 获取二级部门名称 - StaffGradeChange(item){ - if(item){ - this.chooseList.map(e =>{ - if(e.staffGradeId == item){ - let obj = {}; - obj = e.twoClassList.find((r)=>{ - return r.staffGradeId === item; - }); - e.staffGradeName = obj.staffGradeName - } - }) - } - }, - // 获取教师二级部门名称 - teacherStaffGradeChange(item){ - if(item){ - this.chooseList.map(e =>{ - if(e.teacherstaffGradeId == item){ - let obj = {}; - obj = e.teachertwoClassList.find((r)=>{ - return r.staffGradeId === item; - }); - e.teacherstaffGradeName = obj.staffGradeName - } - }) - } - }, - // 清除学生专业 - clearstuPro(item){ - this.chooseList.map(e =>{ - if(e.stuprofessionalId == item){ - e.stugradeId = '', - e.stugradeName = '', - e.stuclassId = '', - e.stuclassName = '' - } - }) - }, - // 获取学生年级 - getStuPro(item){ - this.clearstuPro(item) - if(item){ - this.$get(this.api.queryStuGrade,{ stuProfessionalArchitectureId: item }).then(res => { - this.chooseList.map(e =>{ - if(e.stuprofessionalId == item){ - let obj = {}; - obj = e.studentFirstList.find(r =>{ - return r.stuProfessionalArchitectureId === item; - }); - e.studentTwoList = res.message - e.stuprofessionalName = obj.stuProfessionalArchitectureName - } - }) - }).catch(res => {}); - } - }, - // 清除学生年级 - clearStuGrade(item){ - this.chooseList.map(e =>{ - if(e.stugradeId == item){ - e.stuclassId = '', - e.stuclassName = '' - } - }) - }, - // 获取学生班级 - getStuClass(item){ - this.clearStuGrade(item) - if(item){ - this.$get(this.api.queryStuClass,{ gradeId: item }).then(res => { - this.chooseList.map(e =>{ - if(e.stugradeId == item){ - let obj = {}; - obj = e.studentTwoList.find(r =>{ - return r.gradeId === item; - }); - e.studentThreeClass = res.message - e.stugradeName = obj.gradeName - } - }) - }).catch(res => {}); - } - }, - // 获取学生班级名称 - StuClassChange(item){ - if(item){ - this.chooseList.map(e =>{ - if(e.stuclassId == item){ - let obj = {}; - obj = e.studentThreeClass.find(r =>{ - return r.classId === item; - }); - e.stuclassName = obj.className - } - }) - } - }, - // 新增系统 - addArchives(){ - let isEmpty = true; - let object = this.archivesForm - Object.keys(object).forEach(function(x) { - if(object[x] != null && object[x] != ""){ - isEmpty = false; - } - }); - if(isEmpty){//值全为空 - this.$message.warning('请先填写个人档案其中一项信息!'); - return true; - } - this.archivesList = this.archivesList.concat({ - personalCareerId: '', //职业 - schoolId: '', //院校 - schoolName: '', //院校名称 - subjectList: this.subjectList, //专业学科 - disciplineId: '', //专业学科 - disciplineName: '', //专业学科名称 - ProfessionalClassList: [], //专业类 - professionalClassId: '', //专业类 - professionalClassName: '', //专业类名称 - ProfessionalList: [], //专业 - professionalId: '', //专业 - professionalName: '', //专业名称 - userId: this.userId - }) - return false; - }, - saveAdd(formName){ - this.$refs[formName].validate((valid) => { - if (valid) { - if(!this.form.userName) return this.$message.warning('请填写用户姓名'); - if(!this.form.schoolId) return this.$message.warning('请选择所在院校'); - if(!this.form.account) return this.$message.warning('请填写账号'); - if(!this.NoAdd) return this.$message.warning('该手机号已存在'); - if(!this.AccountNoAdd) return this.$message.warning('该账号已存在'); - if(!this.NumberNoAdd) return this.$message.warning('该员工工号已存在'); - if(!this.teaNumberNoAdd) return this.$message.warning('该教师工号已存在'); - if(!this.stuNumberNoAdd) return this.$message.warning('该学生学号已存在'); - if(!this.saveList.length) return this.$message.warning('请绑定系统'); - if(this.form.uniqueIdentificationAccount == ''){ - let timestamp = Date.parse(new Date()); - this.form.uniqueIdentificationAccount = timestamp - } - let staffLIst = [] - let student = {} - this.saveList.forEach( e =>{ - // 管理员数据 - if(e.roleIds.indexOf(13) > -1){ - staffLIst.push({ - platformId: e.platformId, - workNumber: e.staworkNumber, - roleId: 13, - schoolId: e.schoolId, - customerId: e.customerId, - schoolName: e.customerName, - staffProfessionalArchitectureId: e.staffProfessionalArchitectureId, - staffProfessionalArchitectureName: e.staffProfessionalArchitectureName, - staffGradeId: e.staffGradeId, - staffGradeName: e.staffGradeName - }) - } - // 教师数据 - if(e.roleIds.indexOf(14) > -1){ - staffLIst.push({ - platformId: e.platformId, - workNumber: e.teaworkNumber, - roleId: 14, - schoolId: e.schoolId, - customerId: e.customerId, - schoolName: e.customerName, - staffProfessionalArchitectureId: e.teacherstaffProId, - staffProfessionalArchitectureName: e.teacherstaffProName, - staffGradeId: e.teacherstaffGradeId, - staffGradeName: e.teacherstaffGradeName - }) - } - // 学生数据 - if(e.roleIds.indexOf(4) > -1){ - student = { - platformId: e.platformId, - workNumber: e.stuworkNumber, - roleId: 4, - schoolId: e.schoolId, - customerId: e.customerId, - schoolName: e.customerName, - professionalId: e.stuprofessionalId, - professionalName: e.stuprofessionalName, - gradeId: e.stugradeId, - gradeName: e.stugradeName, - classId: e.stuclassId, - className: e.stuclassName - } - } - - }) - let userProfilesList = [] - let newarchivesList = [this.archivesForm, ...this.archivesList] - newarchivesList.forEach(e =>{ - userProfilesList.push({ - personalCareerId: e.personalCareerId, - schoolId: e.schoolId, - schoolName: e.schoolName, - disciplineId: e.disciplineId, - disciplineName: e.disciplineName, - professionalClassId: e.professionalClassId, - professionalClassName: e.professionalClassName, - professionalId: e.professionalId, - professionalName: e.professionalName, - userId: this.userId - }) - }) - this.form.roleId = this.saveList[0].roleIds.join(',') - let params = { - UserInfo : this.form, - userProfilesList, - staffLIst, - student - } - this.$post(this.api.addUser,params).then((res) => { - this.$message.success('添加成功'); - this.$router.go(-1) - }).catch((res) => { - }) - } - }) - }, - goback(){ - if(this.clickFlag){ - let msg = '' - if(this.userId){ - msg = '请确定信息是否进行更新完毕,再返回用户首页。' - - }else{ - msg = '确定返回?未更新的信息将不会保存。' - } - this.$confirm(msg, '提示', { - type: 'warning' - }) - .then(() => { - this.clickFlag = false - this.$router.go(-1) - }) - .catch(() => {}); - } - }, - async phoneChange(){ - let res = await this.$get(this.api.queryPhone, { phone: this.form.phone }); - if(res.message.length != 0){ - this.$message.warning('该手机号已存在'); - this.NoAdd = false - }else{ - this.NoAdd = true - } - }, - async accountChange(){ - let res = await this.$get(this.api.queryAccountIsExist, { account: this.form.account }); - if(res.message.length != 0){ - this.$message.warning('该账号已存在'); - this.AccountNoAdd = false - }else{ - this.AccountNoAdd = true - } - }, - async worknumberChange(item){ - let res = await this.$get(this.api.queryWorkNumberIsExist, { - workNumber: item.staworkNumber, - roleId: 13, - schoolId: item.schoolId - }); - if(JSON.stringify(res.message) != '{}'){ - this.$message.warning('该员工工号已存在'); - this.NumberNoAdd = false - }else{ - this.NumberNoAdd = true - } - }, - async teaworknumberChange(item){ - let res = await this.$get(this.api.queryWorkNumberIsExist, { - workNumber: item.teaworkNumber, - roleId: 14, - schoolId: item.schoolId - }); - if(JSON.stringify(res.message) != '{}'){ - this.$message.warning('该教师工号已存在'); - this.teaNumberNoAdd = false - }else{ - this.teaNumberNoAdd = true - } - }, - async stuworknumberChange(item){ - let res = await this.$get(this.api.queryWorkNumberIsExist, { - workNumber: item.stuworkNumber, - roleId: 4, - schoolId: item.schoolId - }); - if(JSON.stringify(res.message) != '{}'){ - this.$message.warning('该学生学号已存在'); - this.stuNumberNoAdd = false - }else{ - this.stuNumberNoAdd = true - } - }, - numberChange(){ - let reg = /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/ - if(reg.test(this.form.IDNumber)){ - let idCard = this.form.IDNumber - let birthday = ""; - if(idCard != null && idCard != ""){ - if(idCard.length == 15){ - birthday = "19"+idCard.slice(6,12); - } else if(idCard.length == 18){ - birthday = idCard.slice(6,14); - } - birthday = birthday.replace(/(.{4})(.{2})/,"$1-$2-"); - } - this.form.dateBirth = birthday - - let sexStr = ''; - if (parseInt(idCard.slice(-2, -1)) % 2 == 1) { - sexStr = 1; - } - else { - sexStr = 2; - } - this.form.sex = sexStr - this.IDdisabled = true - }else{ - this.IDdisabled = false - this.form.dateBirth = '' - this.form.sex = '' - } - }, - getRowKeys(row) { - return row.id; - }, - // 新增用户 - addUser(){ - this.dialogFormVisible = true - this.region = '' - this.choosecusArr = '' - this.chooseCusList = [] - this.chooseList = [] - }, - // 多选操作 - handleSelectionChange(val) { - this.multipleSelection = val; - }, - // 客户列表 - addCustomer(){ - clearTimeout(this.searchTimer) - if(this.region == '') return this.$message.warning('请选择系统'); - this.innerVisible = true - this.searchTimer = setTimeout(() => { - let res = this.$get(this.api.userQueryCustomer, { - customerIds: this.choosecusArr, - searchContent: this.cusSearch - }).then(res => { - this.customerList = res.message - }) - },100) - }, - // 选择客户 - SelectionCus(val){ - this.chooseCusList = val; - }, - // 选择客户确定 - cusSure(){ - this.innerVisible = false - if(this.chooseCusList){ - let arr = this.chooseCusList - let result = arr.map(e => e.customerId).join() - this.choosecusArr = this.choosecusArr.concat(`,${result}`) - if (this.choosecusArr.substr(0,1)==','){ - this.choosecusArr = this.choosecusArr.substr(1); - } - // 新增学校列表数据 - arr.map(e =>{ - this.$set(e, 'checkList', this.checkList); - this.$set(e, 'roleIds', []); - this.$set(e, 'platformId', this.region); - this.$set(e, 'staworkNumber', ''); - this.$set(e, 'teaworkNumber', ''); - this.$set(e, 'stuworkNumber', ''); - // 获取学生专业 - this.$get(this.api.queryStuPro,{ schoolId: e.schoolId }).then(res => { - // 专业 - this.$set(e, 'studentFirstList', res.message); - this.$set(e, 'stuprofessionalId', ''); - this.$set(e, 'stuprofessionalName', ''); - // 年级 - this.$set(e, 'studentTwoList', []); - this.$set(e, 'stugradeId', ''); - this.$set(e, 'stugradeName', ''); - // 班级 - this.$set(e, 'studentThreeClass', []); - this.$set(e, 'stuclassId', ''); - this.$set(e, 'stuclassName', ''); - }).catch(res => {}); - // 获取一级部门 - this.$get(this.api.queryStaffPro,{ schoolId: e.schoolId }).then(res => { - // 一级部门 - this.$set(e, 'firstClassList', res.message); - this.$set(e, 'staffProfessionalArchitectureId', ''); - this.$set(e, 'staffProfessionalArchitectureName', ''); - // 二级部门 - this.$set(e, 'twoClassList', []); - this.$set(e, 'staffGradeId', ''); - this.$set(e, 'staffGradeName', ''); - // 教师一级部门 - this.$set(e, 'teacherstaffProId', ''); - this.$set(e, 'teacherstaffProName', ''); - // 教师二级部门 - this.$set(e, 'teachertwoClassList', []); - this.$set(e, 'teacherstaffGradeId', ''); - this.$set(e, 'teacherstaffGradeName', ''); - }).catch(res => {}); - }) - this.saveList = this.saveList.concat(arr) - this.chooseList = this.chooseList.concat(arr) - } - }, - async updateUserRoleId() { - let res = await this.$post(this.api.updateUserRoleId, { - userId: this.userId, - roleId: this.chooseList[0].roleIds.join(',') - }); - }, - removeSchool(customerId) { - this.saveList.map((n,k) => { - if(n.customerId == customerId) this.saveList.splice(k,1) - }) - this.chooseList.map((n,k) => { - if(n.customerId == customerId) { - this.chooseList.splice(k,1) - this.chooseCusList.splice(k,1) - } - }) - let choosecusArr = this.choosecusArr.split(',') - choosecusArr.splice(choosecusArr.findIndex(val => val == customerId),1) - this.choosecusArr = choosecusArr.join() - }, - // 选择完信息之后确定 - async ChooseListSure(){ - if(this.region == '') return this.$message.warning('请选择系统'); - if(this.chooseList.length != 0){ - let isroleIdEmpty = false; - this.chooseList.map(e =>{ - if(!e.roleIds.length){ - isroleIdEmpty = true; - } - }) - if(isroleIdEmpty){ - this.$message.warning('请选择角色'); - return true - } - }else return this.$message.warning('请选择学校'); - - if(this.userId){ - let stuStaffList = { - staffList: [], - studentList: [] - } - let isEmpty = false - this.chooseList.forEach(e =>{ - // 管理员数据 - if(e.roleIds.indexOf(13) > -1){ - for(let i in e) { - if(i.startsWith('sta') && e[i] == ''){ - isEmpty = true - break - } - } - stuStaffList.staffList.push({ - platformId: e.platformId, - workNumber: e.staworkNumber, - roleId: 13, - schoolId: e.schoolId, - customerId: e.customerId, - schoolName: e.customerName, - staffProfessionalArchitectureId: e.staffProfessionalArchitectureId, - staffProfessionalArchitectureName: e.staffProfessionalArchitectureName, - staffGradeId: e.staffGradeId, - staffGradeName: e.staffGradeName, - userId: this.userId - }) - } - // 教师数据 - if(e.roleIds.indexOf(14) > -1){ - for(let i in e) { - if(i.startsWith('tea') && e[i] == ''){ - isEmpty = true - break - } - } - stuStaffList.staffList.push({ - platformId: e.platformId, - workNumber: e.teaworkNumber, - roleId: 14, - schoolId: e.schoolId, - customerId: e.customerId, - schoolName: e.customerName, - staffProfessionalArchitectureId: e.teacherstaffProId, - staffProfessionalArchitectureName: e.teacherstaffProName, - staffGradeId: e.teacherstaffGradeId, - staffGradeName: e.teacherstaffGradeName, - userId: this.userId - }) - } - // 学生数据 - if(e.roleIds.indexOf(4) > -1){ - for(let i in e) { - if(i.startsWith('stu') && e[i] == ''){ - isEmpty = true - break - } - } - stuStaffList.studentList.push({ - platformId: e.platformId, - workNumber: e.stuworkNumber, - roleId: 4, - schoolId: e.schoolId, - customerId: e.customerId, - schoolName: e.customerName, - professionalId: e.stuprofessionalId, - professionalName: e.stuprofessionalName, - gradeId: e.stugradeId, - gradeName: e.stugradeName, - classId: e.stuclassId, - className: e.stuclassName, - userId: this.userId - }) - } - }) - if(isEmpty) return this.$message.warning('请填写必填项'); - await this.$post(this.api.updateOR, stuStaffList); - this.getplatformList() - this.updateUserRoleId() - this.dialogFormVisible = false - }else{ - if(!this.NumberNoAdd) return this.$message.warning('该员工工号已存在'); - if(!this.teaNumberNoAdd) return this.$message.warning('该教师工号已存在'); - if(!this.stuNumberNoAdd) return this.$message.warning('该学生学号已存在'); - let list = this.saveList - let isEmpty = false - for(let e of list){ - if(e.roleIds.includes(13)){ - for(let i in e) { - if(i.startsWith('sta') && e[i] == ''){ - isEmpty = true - break - } - } - } - if(e.roleIds.includes(14)){ - for(let i in e) { - if(i.startsWith('tea') && e[i] == ''){ - isEmpty = true - break - } - } - } - if(e.roleIds.includes(4)){ - for(let i in e) { - if(i.startsWith('stu') && e[i] == ''){ - isEmpty = true - break - } - } - } - } - if(isEmpty) return this.$message.warning('请填写必填项'); - let result = this.saveList.map(e => e.platformId).join() - let res = await this.$get(this.api.queryPlatform, { platformId: result }); - this.platformList = res.message - this.dialogFormVisible = false - - if(this.platformList.length != 0){ - this.platformList.map(e =>{ - this.regionOption.map((r,index) =>{ - if(r.regionId == e.platformId){ - this.regionOption.splice(index,1) - } - }) - }) - } - } - }, - getplatformList(){ - this.regionOption = [{ - regionName: '教学平台', - regionId: 1 - }, - { - regionName: '数据平台', - regionId: 2 - }], //系统选择 - this.$get(this.api.queryUserInfoDetails,{ userId: this.userId }).then(res => { - // this.platformList = res.message.platformList - let staffPlatformList = res.message.staffPlatformList - let studentPlatformList = res.message.studentPlatformList - this.platformList = staffPlatformList - if(this.platformList.length == 1){ - studentPlatformList.forEach((n,k) => { - if(n.platformId != this.platformList[0].platformId){ - this.platformList.push(n) - } - }) - }else if(!this.platformList.length){ - this.platformList = studentPlatformList - } - this.platformList.map(e =>{ - this.regionOption.map((r,index) =>{ - if(r.regionId == e.platformId){ - this.regionOption.splice(index,1) - } - }) - }) - }).catch((res) => {}) - }, - // 关闭弹框 - regionclose(){ - if(this.userId){ - this.getplatformList() - } - }, - //编辑平台 - async edit(row){ + show(row){ let obj = {} - Object.assign(obj, - { + Object.assign(obj,{ regionName: row.platformName, regionId: row.platformId, }) @@ -1916,221 +818,26 @@ export default { this.chooseCusList = [] this.chooseList = [] - let res = await this.$get(this.api.queryUserOR, { userId: this.userId, platformId: row.platformId}); - res.message = [...res.message.staff,...res.message.student] - res.message.map(e =>{ - this.$set(e, 'checkList', this.checkList) - this.$set(e, 'customerName', e.schoolName) - // 专业 - this.$set(e, 'studentFirstList', []); - this.$set(e, 'stuprofessionalId', ''); - this.$set(e, 'stuprofessionalName', ''); - this.$set(e, 'stuclassId', ''); - this.$set(e, 'stuclassName', ''); - // 年级 - this.$set(e, 'studentTwoList', []); - this.$set(e, 'stugradeId', ''); - this.$set(e, 'stugradeName', ''); - // 班级 - this.$set(e, 'studentThreeClass', []); - this.$set(e, 'stuworkNumber', ''); - // 一级部门 - this.$set(e, 'firstClassList', []); - this.$set(e, 'staworkNumber', ''); - e.staffProfessionalArchitectureId || this.$set(e, 'staffProfessionalArchitectureId', ''); - e.staffProfessionalArchitectureName || this.$set(e, 'staffProfessionalArchitectureName', ''); - e.staffGradeId || this.$set(e, 'staffGradeId', ''); - e.staffGradeName || this.$set(e, 'staffGradeName', ''); - // 二级部门 - this.$set(e, 'twoClassList', []); - // 教师二级部门 - this.$set(e, 'teachertwoClassList', []); - this.$set(e, 'teaworkNumber', ''); - this.$set(e, 'teacherstaffProId', ''); - this.$set(e, 'teacherstaffProName', ''); - this.$set(e, 'teacherstaffGradeId', ''); - this.$set(e, 'teacherstaffGradeName', ''); - if (e.roleId) { - switch (e.roleId) { - case 13: - e.staworkNumber = e.workNumber - break; - case 14: - e.teaworkNumber = e.workNumber, - e.teacherstaffProId = e.staffProfessionalArchitectureId, - e.teacherstaffProName = e.staffProfessionalArchitectureName, - e.teacherstaffGradeId = e.staffGradeId, - e.teacherstaffGradeName = e.staffGradeName - break; - case 4: - e.stuworkNumber = e.workNumber - e.stuprofessionalId = e.professionalId - e.stuprofessionalName = e.professionalName - e.stugradeId = e.gradeId - e.stugradeName = e.gradeName - e.stuclassId = e.classId - e.stuclassName = e.className - break; - } - } - }) - let arr1 = res.message; - function f(arr) { - let mp= {} - let ret = [] - arr.forEach(item => { - if (typeof mp[item.schoolId] === 'number') { - ret[mp[item.schoolId]].push(item) - } else { - mp[item.schoolId] = ret.length - ret.push([item]) + this.$get(this.api.selectUserSysBind, { userId: this.userId, platformId: row.platformId}).then(res => { + let list = res.result.map + for(let i in list){ + for(let n in list[i]){ + console.log(11,list[i][n]) + list[i] = list[i][n] } - }) - return ret - } - let setArr = f(arr1) - setArr.map(e =>{ - e.map(c => { - this.$set(c, 'roleIds', e.map(c => c.roleId)) - }) - }) - // this.chooseList = setArr.map(a => Object.assign.apply(null,a)); - let arr2 = setArr - -         function deepMerge(data) { -             let result = [] -             data.forEach((item,index) => { -                 result[index] = {} -                 item.forEach((k,i) => { -                     for(let j in k){ -                         if(!result[index][j] || (result[index][j] && k[j])){ -                             result[index][j] = k[j] -                         } -                     } -                 }) -             }) - return result -         } -         this.chooseList = deepMerge(arr2) - - this.chooseList.map(e =>{ - e.roleIds = Array.from(new Set(e.roleIds)) - // 获取一级部门 - this.$get(this.api.queryStaffPro,{ schoolId: e.schoolId }).then(res => { - // this.$set(e, 'firstClassList', res.message); - e.firstClassList = res.message - }).catch(res => {}); - // 获取管理员二级部门 - if(e.staffProfessionalArchitectureId){ - this.$get(this.api.queryStaffGrade,{ staffProfessionalArchitectureId: e.staffProfessionalArchitectureId }).then(res => { - // this.$set(e, 'twoClassList', res.message); - e.twoClassList = res.message - }).catch(res => {}); - } - // 获取教师二级部门 - if(e.teacherstaffProId){ - this.$get(this.api.queryStaffGrade,{ staffProfessionalArchitectureId: e.teacherstaffProId }).then(res => { - // this.$set(e, 'teachertwoClassList', res.message); - e.teachertwoClassList = res.message - }).catch(res => {}); - } - // 获取学生专业 - this.$get(this.api.queryStuPro,{ schoolId: e.schoolId }).then(res => { - // this.$set(e, 'studentFirstList', res.message); - e.studentFirstList = res.message - }).catch(res => {}); - // 获取学生年级 - if(e.stuprofessionalId){ - this.$get(this.api.queryStuGrade,{ stuProfessionalArchitectureId: e.stuprofessionalId }).then(res => { - // this.$set(e, 'studentTwoList', res.message); - e.studentTwoList = res.message - }).catch(res => {}); - } - // 获取学生班级 - if(e.stugradeId){ - this.$get(this.api.queryStuClass,{ gradeId: e.stugradeId }).then(res => { - // this.$set(e, 'studentThreeClass', res.message); - e.studentThreeClass = res.message - }).catch(res => {}); } - }) - - let nwarr = this.chooseList - let result = nwarr.map(e => e.schoolId).join() - this.choosecusArr = this.choosecusArr.concat(`,${result}`) - if (this.choosecusArr.substr(0,1)==','){ - this.choosecusArr = this.choosecusArr.substr(1); - } - - }, - // 删除平台 - handleDelete(row,index){ - this.$confirm('确定要删除吗?', '提示', { - type: 'warning' - }) - .then(() => { - // 系统列表 - let obj = {} - Object.assign(obj, - { - regionName: row.platformName, - regionId: row.platformId, - }) - this.regionOption = [obj, ...this.regionOption] - - this.saveList = this.saveList.filter(function(obj){ - return row.platformId !== obj.platformId; - }); - this.chooseList = this.chooseList.filter(function(obj){ - return row.platformId !== obj.platformId; - }); - this.platformList.splice(index, 1); - this.$message.success('删除成功'); - if(this.userId){ - this.$post(this.api.deletePlatform,{ platformId: row.platformId, userId: this.userId }).then(res => { - }).catch(res => {}); - } - }) - .catch(() => {}); - }, - // 更新用户信息 - async editUserInfo(){ - await this.$post(this.api.updateUserInfo, this.form ); - this.$message.success('更新用户成功'); - this.$router.go(-1) - }, - //删除个人档案 - delItemArchives(index){ - this.$confirm('确定要删除该档案吗?', '提示', { - type: 'warning' - }) - .then(() => { - this.archivesList.splice(index, 1); - this.$message.success('删除成功'); - }) - .catch(() => {}); - }, - // 更新个人档案 - async editUserProfiles(){ - let userProfilesList = [] - let newarchivesList = [this.archivesForm, ...this.archivesList] - newarchivesList.forEach(e =>{ - userProfilesList.push({ - personalCareerId: e.personalCareerId, - schoolId: e.schoolId, - schoolName: e.schoolName, - disciplineId: e.disciplineId, - disciplineName: e.disciplineName, - professionalClassId: e.professionalClassId, - professionalClassName: e.professionalClassName, - professionalId: e.professionalId, - professionalName: e.professionalName, - userId: this.userId - }) - }) - await this.$post(this.api.updateUserProfiles, userProfilesList ); - this.$message.success('更新个人档案成功'); - }, + this.chooseList = list + console.log(11,list) + }).catch(res => {}) + }, + switchOff(val,row){ + this.$get(this.api.updateAccountEnable,{ + id: row.id, + isEnable: val + }).then(res => { + this.$message.success(val ? '启用成功' : '禁用成功') + }).catch(res => {}) + } } }; @@ -2179,17 +886,20 @@ export default { .icon_btn { margin: 5px 5px 15px 0; } -.secondaryDepartments { - margin-left: 90px; -} + .flex_start { display: flex; justify-content: flex-start; align-items: center; } -.flex { +.flex_end { display: flex; justify-content: flex-end; + align-items: center; +} +.flex { + display: flex; + align-items: center; } .from_card { margin-bottom: 20px; @@ -2208,14 +918,37 @@ export default { color: rgb(155, 179, 245); font-size: 14px; } -.school_card:first-child{ - margin-top: 0; -} -.school_card{ - margin-top: 20px; -} -.checkboxItem{ - margin-left: 20px; +.school-item{ + margin-bottom: 20px; + .school-name{ + font-size: 16px; + font-weight: bold; + } + .port{ + .port-name{ + margin: 10px 0; + font-size: 15px; + color: #9076FF; + } + .fields{ + .line{ + display: flex; + margin-bottom: 10px; + li{ + display: flex; + align-items: center; + margin-right: 80px; + .name{ + font-size: 14px; + } + .val{ + font-size: 14px; + font-weight: bold; + } + } + } + } + } } // 滚动条的宽度 @@ -2238,8 +971,4 @@ export default { /deep/.el-input__inner{ height: 40px !important; } -.remove-school{ - cursor: pointer; - font-size: 20px; -} \ No newline at end of file diff --git a/src/views/user/User.vue b/src/views/user/User.vue index edde785..fea6089 100644 --- a/src/views/user/User.vue +++ b/src/views/user/User.vue @@ -52,7 +52,7 @@ - + {{item.name}} @@ -60,12 +60,12 @@ + start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable> - + @@ -83,43 +83,39 @@ 用户列表
- 新增用户 批量删除
- + - - - - + - + - + - + - + - + - + @@ -133,6 +129,8 @@ export default { name: 'user', data() { return { + platformId: this.$config.platformId, + searchTimer: null, form: { name: '', countries: '中国', @@ -189,12 +187,38 @@ export default { id: 12, name: '1年内' }], - pageNo: 1, + page: 1, pageSize: 10, totals: 1, multipleSelection: [] }; }, + watch: { + 'form.keyword': function(val) { + clearTimeout(this.searchTimer) + this.searchTimer = setTimeout(() => { + this.initData() + },500) + }, + 'form.month': function(val){ + if(val){ + let unit = 24 * 60 * 60 * 1000 + this.form.date = [this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))] + }else{ + this.form.date = [] + } + }, + 'form.date': function(val){ + if(val.length){ + this.form.startTime = val[0] + this.form.endTime = val[1] + }else{ + this.form.startTime = '' + this.form.endTime = '' + } + this.initData() + } + }, mounted() { this.getData() }, @@ -210,27 +234,19 @@ export default { endTime: this.form.endTime, roleId: this.form.accountRole, searchContent: this.form.keyword, - pageNo: this.pageNo, - pageSize: this.pageSize + platformId: this.platformId, + page: this.page, + size: this.pageSize } - this.$get(this.api.queryUser,data).then(res => { - res.message.rows.forEach(e => { - if(e.roleId.length > 1) { - let NewaccountRole = [] - let roleIds = e.roleId.split(',') - roleIds.forEach((n,k) => { - NewaccountRole.push(this.roleStatus(n)) - }) - e.NewaccountRole = NewaccountRole.join(',') - }else{ - e.NewaccountRole = this.roleStatus(e.roleId) - } - - }) - this.userData = res.message.rows - this.totals = res.message.total + this.$get(this.api.queryUserInfoList,data).then(res => { + this.userData = res.message.list + this.totals = res.message.totalCount }).catch(res => {}); }, + initData(){ + this.page = 1 + this.getData() + }, // 清除省份 clearprovince(){ this.form.city = '', @@ -240,7 +256,7 @@ export default { getCity(){ this.clearprovince() this.getCityData() - this.pageNo = 1 + this.page = 1 this.getData() }, getCityData(){ @@ -249,7 +265,7 @@ export default { } this.$get(this.api.queryCity,data).then(res => { this.cityList = res.message - }).catch(res => {}); + }).catch(res => {}) }, // 清除城市 clearcity(){ @@ -259,7 +275,7 @@ export default { getSchool(){ this.clearcity() this.getSchoolData() - this.pageNo = 1 + this.page = 1 this.getData() }, getSchoolData(){ @@ -269,108 +285,91 @@ export default { } this.$get(this.api.querySchool,data).then(res => { this.schoolList = res.message - }).catch(res => {}); - }, - onSearch(){ - this.pageNo = 1 - this.getData() - }, - itemRadio(val){ - this.form.month = val - this.form.date = '' - this.form.startTime = '' - this.form.endTime = '' - this.getData() - }, - selectTime(val){ - if(val){ - this.form.startTime = val[0] - this.form.endTime = val[1] - }else{ - this.form.startTime = '' - this.form.endTime = '' - } - this.form.month = '' - this.getData() + }).catch(res => {}) }, currentChange(val) { - this.pageNo = val; - this.getData(); + this.page = val + this.getData() }, permission(){ this.$router.push('/permission') }, adduser(){ - this.$store.commit("userData", { user_id : ''}); - this.$router.push('/adduser'); + this.$store.commit("userData", { user_id : ''}) + this.$router.push('/adduser') }, edit(row){ - this.$store.commit("userData", { user_id : row.userId}); - this.$router.push('/adduser'); + this.$store.commit("userData", { user_id : row.userId}) + this.$router.push('/adduser') + }, + show(row){ + this.$store.commit("userData", { user_id : row.userId}) + this.$router.push('/adduser') }, handleDelete(row) { this.$confirm('确定要删除吗?', '提示', { type: 'warning' - }) - .then(() => { - let arr = [] - arr.push(row.userId) - this.$post(this.api.deleteUser,arr).then(res => { - this.$message.success('删除成功'); + }).then(() => { + this.$get(this.api.delUserAccount,{ + userId: row.userId, + isdel: 1 + }).then(res => { + this.$message.success('删除成功') this.getData() - }).catch(res => {}); - }) - .catch(() => {}); + }).catch(res => {}) + }).catch(() => {}) }, resetPassword(row){ this.$confirm(`重置后的密码为:${this.$config.initialPassword},确定重置?`, '提示', { }).then(() => { - let data = { - newPwd: this.$config.initialPassword, - userId: row.userId, + let data = { + newPwd: this.$config.initialPassword, + userId: row.userId, + } + this.$get(this.api.resetPwd,data).then(res => { + if(res.message == 'success'){ + this.$message.success('重置成功') + }else{ + this.$message.error('重置失败') } - this.$get(this.api.resetPwd,data).then(res => { - if(res.errmessage == 'success'){ - this.$message.success('重置成功') - }else{ - this.$message.error('重置失败') - } - }).catch(res => {}); - }).catch(() => { - }); + }).catch(res => {}) + }).catch(() => {}) }, - getRowKeys(row) { - return row.userId; + switchOff(val,row,index) { + this.$get(this.api.updateAccountAllEnable,{ + id: row.userId, + isEnable: val + }).then(res => { + this.$message.success(val ? '启用成功' : '禁用成功') + }).catch(res => {}) }, handleSelectionChange(val) { - this.multipleSelection = val; + this.multipleSelection = val }, delAllSelection() { if(this.multipleSelection.length != ''){ let newArr = this.multipleSelection let delList = newArr.map(e => e.userId) - // 批量删除 this.$confirm('确定要删除选中用户吗?', '提示', { type: 'warning' - }) - .then(() => { + }).then(() => { this.$post(this.api.deleteUser,delList).then(res => { this.multipleSelection = []; - this.$message.success('删除成功'); + this.$message.success('删除成功') this.getData() - }).catch(res => {}); - }).catch(() => {}); + }).catch(res => {}) + }).catch(() => {}) }else{ - this.$message.error('请先选择客户 !'); + this.$message.error('请先选择客户 !') } }, } }; -