diff --git a/src/router/index.js b/src/router/index.js index 6260d6b..39d6ddc 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -36,6 +36,11 @@ let router = new Router({ component: () => import( '../views/user/AddUser.vue'), // meta: { title: '新增用户' } }, + { + path: '/info', + component: () => import( '../views/user/Info.vue'), + // meta: { title: '新增用户' } + }, { path: '/order', component: () => import( '../views/order/Order.vue'), diff --git a/src/utils/http.js b/src/utils/http.js index 20c4416..6189e50 100644 --- a/src/utils/http.js +++ b/src/utils/http.js @@ -34,11 +34,21 @@ axios.interceptors.request.use(config => { axios.interceptors.response.use( response => { if (response.status === 200) { - if(response.data.status && response.data.status!==200){// 接口定义的非正常返回的时候,应当处于报错状态 + const { status } = response.data + if (status) { + // 接口定义的非正常返回的时候,应当处于报错状态 + if (status === 10020) { + // 该状态为用户列表启用用户的接口返回的状态,特殊处理 + return Promise.reject(response) + } else if (status !== 200) { Message.error(response.data.message) - return Promise.reject(response); + return Promise.reject(response) + } else { + return Promise.resolve(response) + } + } else { + return Promise.resolve(response) } - return Promise.resolve(response); } else { Message.error(response.message,'res'); return Promise.reject(response); diff --git a/src/views/order/AddOrder.vue b/src/views/order/AddOrder.vue index 09b5629..fce4f2a 100644 --- a/src/views/order/AddOrder.vue +++ b/src/views/order/AddOrder.vue @@ -832,9 +832,10 @@ export default { }); }, setStartDate(renewList, contract, form, orderOther) { - console.log(33, renewList, contract, form) + const { orderType } = form let list = orderOther.map(e => { - const item = renewList.find(n => n.dataOrCourseId === e.dataOrCourseId && n.authority === e.authority) + if (orderType === 2) e.finalPrice = 0 // 如果是试用的订单,则成交价显示为0 + const item = renewList.find(n => n.dataOrCourseId === e.dataOrCourseId && n.authority === e.authority) // 匹配renew接口返回的数据 if (item) { // 处于续费 if (this.renewDisabled) { @@ -895,7 +896,7 @@ export default { orderType: form.orderType, cityId: form.cityId, phone: form.phone, - orderAmount: form.orderAmount, + orderAmount: form.orderType === 2 ? 0 : form.orderAmount, // 如果是试用的订单,则订单金额显示为0 orderId: form.orderId, options: form.options, }; diff --git a/src/views/user/AddUser.vue b/src/views/user/AddUser.vue index d909601..2a9454d 100644 --- a/src/views/user/AddUser.vue +++ b/src/views/user/AddUser.vue @@ -132,7 +132,7 @@ class="table" stripe header-align="center" - row-key="platformId" + row-key="accountId" > @@ -162,7 +162,7 @@ export default { data() { return { userId: this.$route.query.userId, - isDetail: this.$route.query.show, // 是否是详情 + isDetail: this.$route.query.show === '1', // 是否是详情 form: { //个人信息 userId: '', @@ -191,41 +191,19 @@ export default { goback(){ this.$router.back() }, - switchUser(val,row,index) { - this.$get(this.api.updateAccountAllEnable,{ - id: row.userId, - isEnable: val - }).then(res => { - if(res.code == '200') { - this.$message.success(val ? '启用成功' : '禁用成功') - }else{ - this.$message.success(res.message) - } - }).catch(res => {}) + // 用户禁用启用 + switchUser(val,row) { + this.$get(this.api.updateAccountEnable, { + id: row.accountId, + isEnable: val + }).then(res => { + this.$message.success(val ? '启用成功' : '禁用成功') + }).catch(res => { + row.isEnable = 0 + }) }, - show(row,isShow){ - let obj = {} - Object.assign(obj,{ - regionName: row.platformName, - regionId: row.platformId, - }) - this.regionOption = [obj, ...[]] - this.region = row.platformId - this.dialogFormVisible = true - this.choosecusArr = '' - this.chooseCusList = [] - this.chooseList = [] - this.isShow = isShow - - 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]){ - list[i] = list[i][n] - } - } - this.chooseList = list - }).catch(res => {}) + show(row) { + this.$router.push(`/info?userId=${row.userId}&workNumber=${row.workNumber}&roleName=${row.roleName}&platformName=${row.platformName}`) } } }; diff --git a/src/views/user/Info.vue b/src/views/user/Info.vue new file mode 100644 index 0000000..0d576cb --- /dev/null +++ b/src/views/user/Info.vue @@ -0,0 +1,830 @@ + + + + + \ No newline at end of file diff --git a/src/views/user/User.vue b/src/views/user/User.vue index aa33ed6..940f3c6 100644 --- a/src/views/user/User.vue +++ b/src/views/user/User.vue @@ -103,7 +103,7 @@ 批量删除 - + @@ -116,7 +116,6 @@