Browse Source

2023-8-5

master
guoxing 2 years ago
parent
commit
5b2fbef1b7
  1. 64
      supervise-uniapp/App.vue
  2. 11
      supervise-uniapp/common/TextUtils.js
  3. 8
      supervise-uniapp/common/Toast.js
  4. 4
      supervise-uniapp/common/config.js
  5. 28
      supervise-uniapp/common/request.api.js
  6. 174
      supervise-uniapp/common/wxAuthLogin - 副本.js
  7. 106
      supervise-uniapp/common/wxAuthLogin.js
  8. 94
      supervise-uniapp/common/wxSilentLogin.js
  9. 132
      supervise-uniapp/components/SendCodeItem/SendCodeItem.vue
  10. 6
      supervise-uniapp/main.js
  11. 11
      supervise-uniapp/manifest.json
  12. 32
      supervise-uniapp/pages.json
  13. 30
      supervise-uniapp/pages/home/WorkFragment.vue
  14. 176
      supervise-uniapp/pages/index/BindPhone.vue
  15. 14
      supervise-uniapp/pages/index/WarehouseManagement.vue
  16. 4
      supervise-uniapp/pages/index/demoReportKc.vue
  17. 33
      supervise-uniapp/pages/login/login.vue
  18. BIN
      supervise-uniapp/static/baseIcon/code.png
  19. BIN
      supervise-uniapp/static/baseIcon/username.png
  20. 112
      yxt-portal-ui/src/api/system/userManage/index.js
  21. 653
      yxt-portal-ui/src/views/userManage/userManageList.vue

64
supervise-uniapp/App.vue

@ -1,16 +1,76 @@
<script>
import APPUpdate from "plugins/APPUpdate/index.js";
export default {
globalData: {
// wxSilentLoginURL: "https://supervise.yxtsoft.com/portal/v1/wxuser/wxSilentLogin",
wxSilentLoginURL: "http://192.168.1.193:8112/portal/v1/wxuser/wxSilentLogin",
wxAuthLoginURL: "http://192.168.1.193:8112/portal//v1/wxuser/wxAuthLogin",
token: "",
isLogin: false,
sysUserSid: "",
}, //
onLaunch: function() {
console.log("》》》》", 11111111);
/* #ifdef APP-PLUS */
APPUpdate();
/* #endif */
console.log("》》》》", 22222222222);
console.log("》》》》", 22222222222);
/* #ifdef MP-WEIXIN */
this.WxSilentLogin()
/* #endif */
// let sysUserSid = this.ReadPreference("sysUserSid")
// if (sysUserSid != null && sysUserSid.length != 0) {
// this.globalData.sysUserSid = sysUserSid
// }
// let isLogin = this.ReadPreference("isLogin")
// if (isLogin != null && isLogin == 1) {
// this.globalData.isLogin = isLogin
// }
// let token = this.ReadPreference("token")
// if (token != null && token.length != 0) {
// this.globalData.token = token
// }
// console.log('Sid', this.globalData.sysUserSid)
// console.log('', this.globalData.isLogin)
// console.log('App', 'onLaunch')
// //
// console.log('Webkey', '59970402d1c3f7dc1efff17d4dfcff21')
},
onShow: function() {},
onHide: function() {},
globalData: {} //
methods: {
//
handlerLogin() {
wx.login({
success: res => {
//code
const code = res.code
console.log(res);
//codetoken
// wx.request({
// url: 'http://xxxxxxx/login',
// data: {
// code
// },
// method: 'post',
// success: (res) => {
// const token = res.data.token
// //token
// wx.setStorageSync('token', token)
// console.log(res);
// }
// })
}
})
}
}
}
</script>

11
supervise-uniapp/common/TextUtils.js

@ -0,0 +1,11 @@
const isEmpty = (obj) => {
if (obj == undefined || obj == null || obj === "" || obj === "null") {
return true;
} else {
return false;
}
}
export {
isEmpty
}

8
supervise-uniapp/common/Toast.js

@ -0,0 +1,8 @@
const toast = (msg) => {
uni.showToast({
title: msg,
icon: 'none'
})
}
export default toast

4
supervise-uniapp/common/config.js

@ -7,8 +7,8 @@
*/
module.exports = {
// baseUrl: 'https://jianguan.yyundong.com/api',
baseUrl: 'https://supervise.yxtsoft.com',
// baseUrl: 'http://192.168.1.193:8112',
// baseUrl: 'https://supervise.yxtsoft.com',
baseUrl: 'http://192.168.1.193:8112',
tokenName: "Authorization", // 请求头中token的名字,与服务器端对应
loginTimeoutCode: "5001", // 登录超时或失效的情况下,服务器端返回的错误码
loginTimeoutPage: "/pages/login/index", // 登录超时或失效的情况下,跳转到的登录页面

28
supervise-uniapp/common/request.api.js

@ -1,11 +1,17 @@
import request from '@/utils/requester.js'
export default {
login: (params = {}) => request.post("/api/portal/v1/sysuser/login", params),
login: (params = {}) => request.post("/portal/v1/sysuser/login", params),
sayhello: (params = {}) => request.get("/sayb", params),
getSalesReport: (params = {}) => request.get("/system/reportCenter/getSalesReport", params),
getGoodsOnWay: (params = {}) => request.get("/system/reportCenter/getGoodsOnWay", params),
getThresholdAnalysis: (params = {}) => request.get("/system/risk/getThresholdAnalysis", params),
// 获取 验证码
sendVerificationCode: (params = {}) => request.get("/portal/v1/wxuser/sendVerificationCode/" + params.phone + "/" +
params.type, params),
// 绑定手机号
wxBindMobile: (params = {}) => request.post("/portal/v1/wxuser/wxBindMobile",params),
// 查看预警信息
selectBusinessRiskInfo: (params = {}) => request.post("/wxmpapi/v1/businessData/selectBusinessRiskInfo", params),
@ -15,7 +21,7 @@ export default {
params),
// 获取今日回款明细
getCsmReportTodayByComSid: (params = {}) => request.post(
"/reportwxmpapi/reportwxmpapi/v1/csmcashreportsales/getCsmReportYesterdayByComSid",
"/reportwxmpapi/reportwxmpapi/v1/csmcashreportcashed/getCsmReportTodayByComSid",
params),
// 获取昨日销售报表
getCsmReportYesterdayByComSid: (params = {}) => request.post(
@ -35,36 +41,36 @@ export default {
// 质物库存汇总-表头
getDayGather: (params = {}) => request.get(
"/reportwxmpapi/reportstock/getDayGather/" + params.projectSid + "/" + params.orderDate, params),
// "/report/reportstock/getDayGather/" + params.projectSid + "/" + params.orderDate, params),
// "/report/reportstock/getDayGather/" + params.projectSid + "/" + params.orderDate, params),
// 质物库存汇总-仓库列表
getDayStore: (params = {}) => request.get(
"/reportwxmpapi/reportstock/getDayStore/" + params.projectSid + "/" + params.orderDate, params),
// "/report/reportstock/getDayStore/" + params.projectSid + "/" + params.orderDate, params),
// "/report/reportstock/getDayStore/" + params.projectSid + "/" + params.orderDate, params),
// 质物库存汇总-明细
getDayProduct: (params = {}) => request.get(
"/reportwxmpapi/reportstock/getDayProduct/" + params, params),
// "/report/reportstock/getDayProduct/" + params, params),
// "/report/reportstock/getDayProduct/" + params, params),
// 获取首页面数据
getWorkData: (params = {}) => request.get("/api/portal/v1/flow/task/" + params, params),
getWorkData: (params = {}) => request.get("/portal/v1/flow/task/" + params, params),
// 获取云仓列表
storeHouseListPage: (params = {}) => request.post("/api/portal/v1/flow/storeHouseListPage", params),
storeHouseListPage: (params = {}) => request.post("/portal/v1/flow/storeHouseListPage", params),
// 获取云仓详情
storeHouseDetail: (params = {}) => request.get("/api/portal/v1/flow/fetchDetailsBySid/" + params, params),
storeHouseDetail: (params = {}) => request.get("/portal/v1/flow/fetchDetailsBySid/" + params, params),
// 获取我的项目
getProjectByUserSid: (params = {}) => request.get("/api/crm/v1/projectinformation/getProjectByUserSid/" + params,
getProjectByUserSid: (params = {}) => request.get("/crm/v1/projectinformation/getProjectByUserSid/" + params,
params),
// 获取我的项目详情
getProjectBySid: (params = {}) => request.get("/api/crm/v1/projectinformation/getProjectBySid/" + params,
getProjectBySid: (params = {}) => request.get("/crm/v1/projectinformation/getProjectBySid/" + params,
params),
// 获取我的项目-仓库详情
getStorehouseBySid: (params = {}) => request.get("/api/crm/v1/projectinformation/getStorehouseBySid/" + params,
getStorehouseBySid: (params = {}) => request.get("/crm/v1/projectinformation/getStorehouseBySid/" + params,
params),
}

174
supervise-uniapp/common/wxAuthLogin - 副本.js

@ -0,0 +1,174 @@
import {
isEmpty
} from './TextUtils.js'
const wxAuthLogin = () => {
// 判断是否已经登陆
if (getApp().globalData.isLogin) {
return new Promise((resolve, reject) => {
resolve(getApp().globalData.sysUserSid)
})
}
return new Promise((resolve, reject) => {
// 授权登录
wx.login({
// 未配置 onlyAuthorize 的情况下调用此接口,code 值不返回,用以换取 authResult 。
// 配置 onlyAuthorize 会把未使用过的 code 值返回,
onlyAuthorize:true,
success: function(res) {
console.log('Http网络请求res',res)
if (res.code) {
if (getApp().globalData.isDebug) {
console.log('Http网络请求info', {
"wxCode": res.code
})
}
uni.showLoading({
title: '加载中...',
mask: true
});
uni.request({
// 组装请求地址
url: getApp().globalData.wxAuthLoginURL,
// 请求方式 GET POST
method: "GET",
header: {
// 传参方式
'content-type': "application/x-www-form-urlencoded"
},
// 具体参数
data: {
"wxCode": res.code
},
success: res => {
// 关闭显示框
uni.hideLoading();
console.log(res)
if (getApp().globalData.isDebug) {
console.log('Http网络路径', getApp().globalData.wxAuthLoginURL)
console.log('Http网络请求结果', JSON.parse(JSON.stringify(
res.data)))
}
if (res.statusCode == 200) {
// 下面是接口返回的数据
if (!res.data.success) {
if ("A01001" == res.data.code || "A01002" == res.data.code ) {
// 绑定手机号
uni.navigateTo({
url: '../index/BindPhone?sysUserWxAuthSid=' + res.data.data
})
// reject("绑定手机号")
}
else {
// 错误提示
if (isEmpty(res.data)) {
// 未成功获取到服务器返回的json
uni.showToast({
// 不能超过7个字
title: "服务器响应为空",
icon: "error"
})
reject("服务器响应为空")
} else {
let errorMsg = res.data.msg
if (isEmpty(errorMsg)) {
errorMsg = url+"服务器未返回错误信息"
}
uni.showToast({
title: errorMsg,
// 保证文字长度
icon: "none",
duration: 3000
})
}
reject(errorMsg)
}
return
}
// 保存
uni.setStorageSync("sysUserSid", res.data.data.sysUserSid);
uni.setStorageSync("isLogin", res.data.data.isLogin);
getApp().globalData.isLogin = res.data.data.isLogin
getApp().globalData.sysUserSid = res.data.data.sysUserSid
getApp().globalData.token = res.data.data.token
// 直接返回Response
resolve(getApp().globalData.sysUserSid)
} else {
uni.showToast({
title: res.statusCode + ":" + res
.errMsg,
// 保证文字长度
icon: "none",
duration: 3000
})
reject(res.errMsg)
}
},
fail: (err) => {
// 关闭显示框
uni.hideLoading();
if (getApp().globalData.isDebug) {
console.log("Http网络请求fail", err)
}
uni.showToast({
title: '请检查网络',
icon: 'error'
})
reject(err)
},
complete: () => {
}
});
} else {
uni.showToast({
title: "授权登录获取code失败:" + res.errMsg,
icon: 'none'
})
reject(res.errMsg)
}
},
fail: function(res) {
uni.showToast({
title: "授权登录失败:" + res.errMsg,
icon: 'none'
})
reject(res.errMsg)
}
});
})
}
export default wxAuthLogin

106
supervise-uniapp/common/wxAuthLogin.js

@ -0,0 +1,106 @@
import {
isEmpty
} from './TextUtils.js'
const wxAuthLogin = () => {
// 判断是否已经登陆
if (getApp().globalData.isLogin) {
return new Promise((resolve, reject) => {
resolve(getApp().globalData.sysUserSid)
})
}
return new Promise((resolve, reject) => {
// 获取信息
// 获取用户信息
uni.getUserProfile({
desc: '获取基本信息',
success: function(infoRes) {
_this.data.nickName = infoRes.userInfo.nickName;
_this.data.gender = infoRes.userInfo.gender == 1 ? "男" : "女";
_this.data.oauthHeadImg = infoRes.userInfo.avatarUrl;
_this.data.fromkey = "WeiXin";
uni.login({
provider: 'weixin',
success: function(loginRes) {
uni.request({
url: getApp().globalData.wxAuthLoginURL +
"?wxCode=" + loginRes
.code,
method: "GET",
header: {
// 传参方式
'content-type': "application/x-www-form-urlencoded"
},
// 具体参数
data: {
"wxCode": loginRes.code
},
}).then((res) => {
console.log(res)
_this.data.openid = res.data.openid;
_this.data.unionId = res.data.unionid;
// _this.HTTP({
// url: "oauth/afterlogin",
// data: {
// "openid": _this.data.openid,
// "unionId": _this.data.unionId,
// "nickName": _this.data.nickName,
// "gender": _this.data.gender,
// "oauthHeadImg": _this.data
// .oauthHeadImg,
// "fromkey": _this.data.fromkey
// },
// loading: true
// }).then((res) => {
// // 保存
// _this.WritePreference("memberSid",
// res.data
// .memberSid)
// getApp().globalData.isLogin = true
// getApp().globalData.memberSid = res
// .data
// .memberSid
// // $emit 触发事件 (主要返回给webviwew页面)
// uni.$emit('login', res.data
// .memberSid)
// _this.Back()
// }, (err) => {
// if (err.data != null) {
// err.data.cookie = _this
// .ReplaceAll(err.data.cookie,
// "=", "-")
// uni.redirectTo({
// url: "./BdtelephoneActivity?cookie=" +
// err.data.cookie
// })
// }
// })
}, (err) => {
// 错误提示
_this.Toast("出错了:" + err.data.errmsg)
})
},
fail: function(err) {
_this.Toast(err)
}
});
},
fail: function(err) {
// 用户拒绝
_this.Toast(err.errMsg)
}
});
})
}
export default wxAuthLogin

94
supervise-uniapp/common/wxSilentLogin.js

@ -0,0 +1,94 @@
// 静默登录
import {
isEmpty
} from './TextUtils.js'
const wxSilentLogin = () => {
return new Promise((resolve, reject) => {
wx.login({
success: function(res) {
if (res.code) {
if (getApp().globalData.isDebug) {
console.log('Http网络请求信息', {
"wxCode": res.code
})
}
uni.request({
// 组装请求地址
url: getApp().globalData.wxSilentLoginURL + "?wxCode=" + res
.code,
// 请求方式 GET POST
method: "GET",
header: {
// 传参方式
'content-type': "application/x-www-form-urlencoded"
},
// 具体参数
data: {
"wxCode": res.code
},
success: res => {
console.log(res)
// if (getApp().globalData.isDebug) {
// console.log('Http网络路径', getApp().globalData
// .wxSilentLoginURL)
// }
if (res.statusCode == 200) {
if (!res.data.success) {
if (res.data.code == 500) {
// 未关注小程序 首次登录 也无账号
uni.showToast({
title: "您的平台应用未被授权,请联系工作人员。",
icon: 'none',
duration: 3000,
})
wx.exitMiniProgram({
success: function() {},
fail: function() {}
})
return
}
if (res.data.code == 100) {
// 有账号 未绑定用户
uni.redirectTo({
url: '../index/BindPhone?sysUserWxAuthSid=' +
res.data.data
})
}
} else {
console.log("Http网络请求res", res)
console.log("Global-Auth-Token", res.data.data.token)
uni.setStorageSync("Global-Auth-Token", res.data.data.token)
getApp().globalData.username = res.data.data.userName
getApp().globalData.token = res.data.data.token
getApp().globalData.sid = res.data.data.sid
getApp().globalData.mobile = res.data.data.mobile
getApp().globalData.isLogin= true
}
} else {
getApp().globalData.isLogin = false
}
},
fail: (err) => {
if (getApp().globalData.isDebug) {
console.log("Http网络请求fail", err)
}
},
complete: () => {}
});
}
},
fail: function(res) {
uni.showToast({
title: "静默登录失败:" + res.errMsg,
icon: 'none'
})
reject(res.errMsg)
}
});
})
}
export default wxSilentLogin

132
supervise-uniapp/components/SendCodeItem/SendCodeItem.vue

@ -0,0 +1,132 @@
<template>
<view :style="{'border-radius': '5rpx','height': '65rpx','width': '160rpx','text-align': 'center','line-height': '65rpx','font-size': '26rpx',
'background-color': background,'color': 'white'}"
@click="click">
{{textDetail}}
</view>
</template>
<script>
export default {
data() {
return {
'background': '#2fa1f0',
"isCanClick": true,
"textDetail": "获取验证码",
"countdown": 60,
'cookie': '',
pageData:{
phone:"",
type:"4"
}
};
},
methods: {
getCookie() {
return this.cookie;
},
click() {
if (!this.isCanClick) {
return
}
if (this.phoneNum.length != 11 || !this.phoneNum.startsWith("1")) {
this.Toast("请输入合法的手机号")
} else {
//
this.background = "gray"
this.isCanClick = false
let timeOut = setInterval(() => {
if (this.countdown == 1) {
this.textDetail = "获取验证码"
this.countdown = 60
clearInterval(timeOut)
this.background = "#2fa1f0"
this.isCanClick = true
} else {
this.countdown = this.countdown - 1;
this.textDetail = this.countdown + "s"
}
}, 1000)
let _this = this
_this.pageData.phone = _this.phoneNum
// if (this.sendByCookie != null) {
// // cookie
// this.HttpCookie({
// 'url': this.url,
// 'data': {
// "mobile": this.phoneNum
// },
// cookie: this.sendByCookie,
// loading: true
// }).then((res) => {
// _this.cookie = res.data
// }, (err) => {
// clearInterval(timeOut)
// this.countdown = 60
// //
// this.background = "#2fa1f0"
// this.isCanClick = true
// this.textDetail = ""
// })
// } else {
_this.$api.sendVerificationCode(_this.pageData).then((resp) => {
// if (resp.success) {
console.log('1111', resp)
}).catch(e => {
console.log('eeeee', e)
clearInterval(timeOut)
_this.countdown = 60
//
_this.background = "#2fa1f0"
_this.isCanClick = true
_this.textDetail = "获取验证码"
})
// _this.HTTP({
// url: _this.url+"/"+_this.phoneNum+"/4",
// data: {},
// method: 'GET',
// paramsType: "FORM",
// loading: true
// }).then((res) => {
// _this.cookie = res.data
// console.log('=======', res)
// }, (err) => {
// clearInterval(timeOut)
// this.countdown = 60
// //
// this.background = "#2fa1f0"
// this.isCanClick = true
// this.textDetail = ""
// })
// }
}
}
},
props: ['phoneNum', 'url', 'data', 'sendByCookie'],
}
</script>
<style>
</style>

6
supervise-uniapp/main.js

@ -1,5 +1,8 @@
import Vue from 'vue'
import App from './App'
import toast from './common/Toast.js'
import wxAuthLogin from './common/wxAuthLogin.js'
import wxSilentLogin from './common/wxSilentLogin.js'
// vuex
import store from './store'
// 引入全局uView
@ -17,6 +20,9 @@ Vue.mixin(mixin)
import api from '@/common/request.api.js'
Vue.prototype.$api = api
Vue.prototype.WxSilentLogin = wxSilentLogin
Vue.prototype.WxAuthLogin = wxAuthLogin
Vue.prototype.Toast = toast
Vue.config.productionTip = false
App.mpType = 'app'

11
supervise-uniapp/manifest.json

@ -28,7 +28,8 @@
"Camera" : {},
"Barcode" : {},
"Contacts" : {},
"Push" : {}
"Push" : {},
"OAuth" : {}
},
"distribute" : {
"android" : {
@ -73,7 +74,13 @@
"appkey_android" : ""
}
},
"push" : {}
"push" : {},
"oauth" : {
"weixin" : {
"appid" : "__UNI__DD73AA7",
"UniversalLinks" : ""
}
}
},
"icons" : {
"android" : {

32
supervise-uniapp/pages.json

@ -10,7 +10,13 @@
"pages": [
//pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/InventorySummary",
"style": {
"navigationBarTitleText": "质物库存汇总"
}
},
/* #ifdef APP-PLUS */
{
"path": "pages/login/login",
"style": {
@ -19,11 +25,22 @@
"scrollIndicator": false //,
}
}
},{
"path": "pages/index/InventorySummary",
},
/* #endif */
{
"path": "pages/home/WorkFragment",
"style": {
"navigationBarTitleText": "质物库存汇总"
"navigationBarTitleText": "工作台"
}
},
{
"path": "pages/index/BindPhone",
"style": {
"navigationBarTitleText": "绑定手机号"
}
}, {
"path": "pages/index/WaitingProcessed",
"style": {
@ -38,7 +55,7 @@
"enablePullDownRefresh": true
}
},
},
{
"path": "pages/index/InventorySummaryDetail",
"style": {
@ -85,11 +102,6 @@
"navigationBarTitleText": "个人中心"
}
}, {
"path": "pages/home/WorkFragment",
"style": {
"navigationBarTitleText": "工作台"
}
}, {
"path": "pages/index/WarehouseManagement",
"style": {

30
supervise-uniapp/pages/home/WorkFragment.vue

@ -145,10 +145,10 @@
export default {
data() {
return {
dbNum: 1,
ybNum: 1,
dyNum: 1,
yyNum: 1,
dbNum: 0,
ybNum: 0,
dyNum: 0,
yyNum: 0,
animateUp: false,
timer: null,
textArr: [
@ -184,14 +184,17 @@
// },
onShow() {
var userSid = getApp().globalData.sid
console.log(">>>>>", userSid)
this.getData(userSid)
uni.setTabBarBadge({ //
index: 0, //tabbar
text: '100' //
})
setTimeout(() => {
if (getApp().globalData.isLogin) {
var userSid = getApp().globalData.sid
console.log(">>>>>", userSid)
this.getData(userSid)
uni.setTabBarBadge({ //
index: 0, //tabbar
text: '100' //
})
}
}, 1000)
// uni.removeTabBarBadge({ //
// index:2
// })
@ -217,6 +220,9 @@
},
getData(userSid) {
// let data = await axios.get('/api/portal/v1/flow/task/'+userSid)
// console.log('data', data)
var _this = this
console.log("getData>>>>>", userSid)
this.$api.getWorkData(userSid).then((resp) => {

176
supervise-uniapp/pages/index/BindPhone.vue

@ -0,0 +1,176 @@
<template>
<view>
<view style="margin-top: 30rpx;">
<view class="inputRow">
<image src="../../static/baseIcon/username.png" mode="aspectFill" class="drawableLeft"></image>
<input type="number" maxlength="11" @input="phoneText" placeholder="请输入手机号" class="input" />
<SendCodeItem :phoneNum="page.mobile" url="/v1/wxuser/sendVerificationCode" @click="send"
ref="wxCodeItem"></SendCodeItem>
</view>
</view>
<view class="inputRow">
<image src="../../static/baseIcon/code.png" mode="aspectFill" class="drawableLeft"></image>
<input type="number" @input="codeText" maxlength="6" placeholder="请输入验证码" class="input" />
</view>
<view class="btn" @click="next">
<text class="btnText">绑定手机</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
page: {
mobile: '',
openid: '',
code: ''
}
};
},
onShow() {
/* #ifdef MP-WEIXIN */
wx.hideHomeButton();
/* #endif */
},
onLoad(options) {
this.page.openid = options.sysUserWxAuthSid
console.log('=======', options)
console.log('=======', options.sysUserWxAuthSid)
},
methods: {
next() {
var mobileLength = this.page.mobile.length;
var codeLength = this.page.code.length;
if (mobileLength == 0) {
this.Toast("请输入手机号")
return;
}
if (codeLength == 0) {
this.Toast("验证码不能为空")
return;
}
let _this = this
console.log('1111', _this.page)
_this.$api.wxBindMobile(_this.page).then((resp) => {
// if (resp.success) {
console.log('1111', resp)
getApp().globalData.username = resp.userName
getApp().globalData.token = resp.token
getApp().globalData.sid = resp.sid
getApp().globalData.mobile = resp.mobile
getApp().globalData.isLogin = true
// _this.WritePreference("sysUserSid", res.data)
// _this.WritePreference("isLogin", true)
// getApp().globalData.isLogin = true
// getApp().globalData.sysUserSid = res.data
uni.switchTab({
url: '/pages/home/WorkFragment'
});
}).catch(e => {
console.log('eeeee', e)
})
// this.HTTP({
// url: 'aos/v1/aosUser/wxBindMobile',
// data: {
// mobile: this.page.phone,
// sysUserWxAuthSid: this.page.sysUserWxAuthSid,
// code: this.page.code
// },
// method: 'POST',
// paramsType: "JSON",
// loading: true
// }).then((res) => {
// console.log('=======', res)
// if (res.code == 200) {
// //
// _this.WritePreference("sysUserSid", res.data)
// _this.WritePreference("isLogin", true)
// getApp().globalData.isLogin = true
// getApp().globalData.sysUserSid = res.data
// console.log(
// '=======1111111111111111111111111111111sdfasdf;kjasdfjkasdklfkasdjf;asdddddddddddddd',
// res)
// // $emit webviwew
// // uni.$emit('login', res.data.memberSid)
// uni.navigateBack({
// delta: 10
// });
// }
// });
},
phoneText(e) {
//
this.page.mobile = e.detail.value;
},
send(e) { //
console.log(e);
},
codeText(e) {
//
this.page.code = e.detail.value;
}
}
};
</script>
<style lang="scss">
.inputRow {
display: flex;
margin-left: 30rpx;
margin-right: 30rpx;
margin-bottom: 10rpx;
margin-top: 10rpx;
padding-bottom: 10rpx;
border-bottom: 0.1px #F1F1F1 solid;
align-items: center;
.input {
margin-left: 20rpx;
height: 70rpx;
flex: 1;
font-size: 32rpx;
}
.drawableLeft {
width: 40rpx;
height: 40rpx;
margin: 20rpx;
}
}
.btn {
display: flex;
width: 90%;
height: 80rpx;
flex-direction: column;
background-color: #007AFF;
margin-top: 80rpx;
margin-left: auto;
margin-right: auto;
align-items: center;
justify-content: center;
border-radius: 10rpx;
.btnText {
color: #ffffff;
font-size: 33rpx;
}
}
</style>

14
supervise-uniapp/pages/index/WarehouseManagement.vue

@ -61,24 +61,10 @@
export default {
data() {
return {
// href: '',
// gv: {},
// resinfo: ''
}
},
onLoad() {
this.initData()
},
methods: {
initData() {
this.gv = getApp().globalData
console.log('hasLogin', this.$store.getters.hasLogin)
console.log('token', this.$store.getters.token)
console.log('uinfo', this.$store.getters.userinfo)
console.log('uinfo-id', this.$store.getters.userinfo.userid)
console.log('uinfo-name', this.$store.getters.userinfo.name)
getApp().globalData.uinfo = this.$store.getters.userinfo
},
// sayhello() {
// this.$api.sayhello({name:'mynameislll'}).then(res => {
// this.resinfo = res

4
supervise-uniapp/pages/index/demoReportKc.vue

@ -204,7 +204,7 @@
components: {},
data() {
return {
date: "2023-06-25",
date: "",
tableData1: [],
logInfo: {
title: "",
@ -227,7 +227,7 @@
},
onLoad(option) {
// this.date = option.orderDate
this.date = option.orderDate
this.getData()

33
supervise-uniapp/pages/login/login.vue

@ -98,11 +98,11 @@
<button class="btn" @click="dologin">登录</button>
<text style="font-size: 13px;color: #ababab;margin-top: 50px;"> 第三方登录方式 </text>
<!-- <text style="font-size: 13px;color: #ababab;margin-top: 50px;"> 第三方登录方式 </text>
<image style="width: 45px;height: 45px; margin-top: 20px;" src="../../static/loginIcon/wx.png" mode="aspectFill"
@click="weixin"></image>
<text style="font-size: 14px;color: #898989; margin-top: 5px;">微信授权登录</text>
<text style="font-size: 14px;color: #898989; margin-top: 5px;">微信授权登录</text> -->
<view style="display: flex;align-items: center;margin-top: 50px;">
@ -210,15 +210,17 @@
}
console.log('MMMM:', resp)
getApp().globalData = resp
// getApp().globalData.username = uinfo.name
// getApp().globalData.token = uinfo.token
// getApp().globalData.sid = uinfo.sid
// getApp().globalData.mobile = uinfo.mobile
// getApp().globalData.name = uinfo.name
// getApp().globalData.isAdmin = uinfo.isAdmin
// getApp().globalData.roleName = uinfo.roleName
// getApp().globalData.staffSid = uinfo.staffSid
// getApp().globalData = resp
uni.setStorageSync("Global-Auth-Token", uinfo.token)
getApp().globalData.username = uinfo.name
getApp().globalData.token = uinfo.token
getApp().globalData.sysUserSid = uinfo.sid
getApp().globalData.mobile = uinfo.mobile
getApp().globalData.name = uinfo.name
getApp().globalData.isAdmin = uinfo.isAdmin
getApp().globalData.roleName = uinfo.roleName
getApp().globalData.staffSid = uinfo.staffSid
getApp().globalData.isLogin= true
console.log('gd--:', getApp().globalData)
// uni.redirectTo({
// url: '/pages/index/index',
@ -314,6 +316,14 @@
icon: 'none',
title: '暂不支持'
});
// if(!this.selectType){
// uni.showToast({
// icon: 'none',
// title: '""""'
// });
// return false;
// }
// this.WxAuthLogin();
},
},
@ -430,6 +440,7 @@
}
.btn {
margin-bottom: 50px;
width: 70%;
margin-top: 35px;
border-radius: 5px;

BIN
supervise-uniapp/static/baseIcon/code.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
supervise-uniapp/static/baseIcon/username.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

112
yxt-portal-ui/src/api/system/userManage/index.js

@ -3,136 +3,162 @@ import qs from 'qs'
// 用户列表
//let tokens = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTm8iOiI2IiwiaXNzIjoiV0JLIiwiZXhwIjoxNjI5OTQxNjI1fQ.aOFOz0h7c8YQs-ti2GLpqeWu4AE9mifx_043hLJQf8g'
let tokens = window.sessionStorage.getItem('token');
export function userList(data){
// 修改用户 微信公众号OpenId
export function saveOpenId(data) {
return request({
url: '/portal/v1/sysuser/saveOpenId',
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json',
'token': tokens
}
})
}
export function userList(data) {
return request({
url: '/portal/v1/sysuser/listPage',
method: 'post',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
headers: {
'Content-Type': 'application/json',
'token': tokens
}
})
}
// 新增
export function userAdd(data){
export function userAdd(data) {
return request({
url: '/portal/v1/sysuser/save',
method: 'post',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
headers: {
'Content-Type': 'application/json',
'token': tokens
}
})
}
// 更新
export function userUpdata(data){
export function userUpdata(data) {
return request({
url: '/portal/v1/sysuser/update/' +data.sid,
url: '/portal/v1/sysuser/update/' + data.sid,
method: 'post',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
headers: {
'Content-Type': 'application/json',
'token': tokens
}
})
}
// 删除
export function delUser(data){
export function delUser(data) {
return request({
url: '/portal/v1/sysuser/delBySid/' +data.sid,
url: '/portal/v1/sysuser/delBySid/' + data.sid,
method: 'get',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
headers: {
'Content-Type': 'application/json',
'token': tokens
}
})
}
// 初始化密码
export function initPwd(data){
export function initPwd(data) {
return request({
url: '/portal/v1/sysuser/initPwd/' +data.sid,
url: '/portal/v1/sysuser/initPwd/' + data.sid,
method: 'post',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
headers: {
'Content-Type': 'application/json',
'token': tokens
}
})
}
// 根据sid查询一条信息
export function userSingle(data){
export function userSingle(data) {
return request({
url: '/portal/v1/sysuser/fetchBySid/' +data.sid,
url: '/portal/v1/sysuser/fetchBySid/' + data.sid,
method: 'get',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
headers: {
'Content-Type': 'application/json',
'token': tokens
}
})
}
// 单条用户的角色列表
export function setRole(data){
export function setRole(data) {
return request({
url: '/portal/v1/sysrole/listAllByUserSid/' +data.sid,
url: '/portal/v1/sysrole/listAllByUserSid/' + data.sid,
method: 'post',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
headers: {
'Content-Type': 'application/json',
'token': tokens
}
})
}
// 角色列表
export function saveOrgRole(data){
export function saveOrgRole(data) {
return request({
url: '/portal/v1/sysuserrole/update',
method: 'post',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
headers: {
'Content-Type': 'application/json',
'token': tokens
}
})
}
// 查询角色列表
export function roleList(data){
export function roleList(data) {
return request({
url: '/portal/v1/sysrole/listAll',
method: 'post',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
headers: {
'Content-Type': 'application/json',
'token': tokens
}
})
}
// 查询部门列表
export function orgList(data){
export function orgList(data) {
return request({
url: '/portal/v1/sysorganization/list',
method: 'get',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
headers: {
'Content-Type': 'application/json',
'token': tokens
}
})
}
// 查询岗位列表
export function postList(data){
export function postList(data) {
return request({
url: '/portal/v1/syspost/fetchByOrgSid/'+data.sid,
url: '/portal/v1/syspost/fetchByOrgSid/' + data.sid,
method: 'get',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
headers: {
'Content-Type': 'application/json',
'token': tokens
}
})
}
// 获取验证码
export function getCode(data){
export function getCode(data) {
return request({
url: '/portal/v1/sysuser/sendMessageCode/'+data.phone,
url: '/portal/v1/sysuser/sendMessageCode/' + data.phone,
method: 'get',
data: data,
headers: {'Content-Type': 'application/json',
'token':tokens
headers: {
'Content-Type': 'application/json',
'token': tokens
}
})
}

653
yxt-portal-ui/src/views/userManage/userManageList.vue

@ -15,12 +15,12 @@
<el-option v-for="item in roleListAll" :key="item.sid" :label="item.name" :value="item.sid"></el-option>
</el-select>
</el-form-item>
<el-form-item label="部门">
<el-input v-model="search.orgName" clearable></el-input>
<!-- <el-select v-model="search.roleSid" clearable placeholder="请选择">-->
<!-- <el-option v-for="(item,i) in roleListAll" :key="i" :label="item.name" :value="item.sid"></el-option>-->
<!-- </el-select>-->
</el-form-item>
<!-- <el-form-item label="部门">
<el-input v-model="search.orgName" clearable></el-input> -->
<!-- <el-select v-model="search.roleSid" clearable placeholder="请选择">-->
<!-- <el-option v-for="(item,i) in roleListAll" :key="i" :label="item.name" :value="item.sid"></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item> -->
<el-button @click="getOrgUserList(1)">查询</el-button>
</el-col>
</el-row>
@ -43,29 +43,24 @@
</el-button>-->
</template>
</el-table-column>
<el-table-column prop="userName" label="用户名" align="center">
<el-table-column prop="userName" label="用户名" width="180px" align="center">
<template slot-scope="scope">
<!-- <span class="tablerow-click" @click="userinfoChange(scope.row)">-->{{ scope.row.userName }}<!--</span>-->
</template>
</el-table-column>
<el-table-column prop="userType" label="用户类型" align="center"></el-table-column>
<el-table-column prop="name" label="姓名" width="120px" align="center"></el-table-column>
<el-table-column prop="departmentName" label="部门" align="center"></el-table-column>
<el-table-column prop="postName" label="岗位" align="center"></el-table-column>
<el-table-column prop="isEnable" label="是否可用" align="center">
<el-table-column prop="userTypeKey" label="用户类型" width="180px" align="center"></el-table-column>
<el-table-column prop="mobile" label="手机号" width="180px" align="center"></el-table-column>
<el-table-column prop="openid" label="公众号OpenID" align="center">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isEnable"
active-value='1'
inactive-value='0'
active-color="#13ce66"
inactive-color="#ff4949"
@change="enabledChange($event,scope.row)">
</el-switch>
<div style="display: flex; flex-direction: row;">
<el-input v-model="scope.row.openid" clearable style="margin-left: 20px; margin-right: 50px;"></el-input>
<el-button type="primary" size="mini" style="margin-right: 20px;"
@click="saveOpenId(scope.row)">保存</el-button>
</div>
</template>
</el-table-column>
</el-table>
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination"/>
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination" />
<!-- 角色设置 -->
<el-dialog title="设置角色" :visible.sync="roleDialog" width="30%">
<el-form :model="roleForm" :rules="rules" ref="roleForm">
@ -92,12 +87,9 @@
:value="item.departmentSid"
></el-option>
</el-select> -->
<el-cascader
v-model="bm_Form.departmentSid"
:options="treedata"
:props="props"></el-cascader>
<el-cascader v-model="bm_Form.departmentSid" :options="treedata" :props="props"></el-cascader>
<el-button type="primary" size='mini' @click="toNav('deptManage')" style="margin-left: 10px;" circle
icon="el-icon-plus"></el-button>
icon="el-icon-plus"></el-button>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -128,7 +120,9 @@
<td>
<el-select v-model="form.deptSid" placeholder="请选择" @change="$forceUpdate()" style="width:300px">
<el-option hidden :key="form.deptSid" :label="orgName" :value="form.deptSid"></el-option>
<el-tree :data="treedata" ref="Tree" show-checkbox accordion node-key="sid" :default-checked-keys="checkedId" :default-expand-all='true' :check-strictly='true' :props="defaultProps" @check-change="checkchange">
<el-tree :data="treedata" ref="Tree" show-checkbox accordion node-key="sid"
:default-checked-keys="checkedId" :default-expand-all='true' :check-strictly='true'
:props="defaultProps" @check-change="checkchange">
</el-tree>
</el-select>
</td>
@ -167,317 +161,350 @@
</template>
<script>
import {
userList,
delUser,
initPwd,
setRole,
orgList,
postList,
saveOrgRole,
roleList,
setRoleEnable,
userUpdata
} from '@/api/system/userManage/index.js'
import {
userList,
delUser,
initPwd,
setRole,
orgList,
postList,
saveOrgRole,
roleList,
setRoleEnable,
userUpdata,
saveOpenId
} from '@/api/system/userManage/index.js'
export default {
data() {
return {
editDialog: false,
form: {},
userTypeData: [{
value: '1',
name: '员工'
}, {
value: '2',
name: '客户'
}, {
value: '3',
name: '供应商'
}],
checkedId: [],
orgName: '',
defaultProps: {
children: 'children',
label: 'name'
},
showCode: true,
postSidData: [],
phoneCodeCount: '',
timer: null,
roleListAll: [],
search: {
name: '',
userName: '',
roleSid: ''
},
props: {
value: 'sid',
label: 'name',
children: 'orgDepartmentVoList'
},
treedata: null,
page: {
total: 0, //
current: 1, //
size: 10 //
},
userTable: [],
clientTable: [],
//
formLabelWidth: '100',
roleDialog: false,
roleList: [],
roleForm: {
roleSid: '',
userSid: ''
},
//
bm_Dialog: false,
postSid: '',
bm_Form: { departmentSid: '' },
bm_List: [],
rules: {
roleSid: [{ required: true, message: '请选择角色名称', trigger: 'blur' }],
departmentSid: [{ required: true, message: '请选择部门名称', trigger: 'blur' }]
}
}
},
props: ['dataObj'],
watch: {
dataObj: {
handler(val) {
this.getOrgUserList()
},
deep: true
}
},
mounted() {
this.getOrgUserList()
this.getRoleList()
this.getOrgTree()
this.getOrgList()
},
methods: {
// +
getOrgUserList(flag) {
if (flag === '1') {
this.page.current = 1
export default {
data() {
return {
editDialog: false,
form: {},
userTypeData: [{
value: '1',
name: '员工'
}, {
value: '2',
name: '客户'
}, {
value: '3',
name: '供应商'
}],
checkedId: [],
orgName: '',
defaultProps: {
children: 'children',
label: 'name'
},
showCode: true,
postSidData: [],
phoneCodeCount: '',
timer: null,
roleListAll: [],
search: {
name: '',
userName: '',
roleSid: ''
},
props: {
value: 'sid',
label: 'name',
children: 'orgDepartmentVoList'
},
treedata: null,
page: {
total: 0, //
current: 1, //
size: 10 //
},
userTable: [],
clientTable: [],
//
formLabelWidth: '100',
roleDialog: false,
roleList: [],
roleForm: {
roleSid: '',
userSid: ''
},
//
bm_Dialog: false,
postSid: '',
bm_Form: {
departmentSid: ''
},
bm_List: [],
rules: {
roleSid: [{
required: true,
message: '请选择角色名称',
trigger: 'blur'
}],
departmentSid: [{
required: true,
message: '请选择部门名称',
trigger: 'blur'
}]
}
}
let params = this.page
params.params = this.search
userList(params).then(res => {
this.page.total = res.data.total
this.userTable = res.data.records
})
},
getRoleList() {
var param = {}
roleList(param).then(res => {
if (res.code === '200') {
this.roleListAll = res.data
}
})
props: ['dataObj'],
watch: {
dataObj: {
handler(val) {
this.getOrgUserList()
},
deep: true
}
},
//
pagination(val) {
this.page.current = val.pageNum
this.page.size = val.pageSize
mounted() {
this.getOrgUserList()
this.getRoleList()
this.getOrgTree()
this.getOrgList()
},
getOrgTree() { //
function treeArr(data) {
if (data.length > 0) {
for (var i = 0; i < data.length; i++) {
if (data[i].orgDepartmentVoList.length > 0) {
treeArr(data[i].orgDepartmentVoList)
} else {
delete data[i].orgDepartmentVoList
}
}
methods: {
// +
getOrgUserList(flag) {
if (flag === '1') {
this.page.current = 1
}
}
// getOrgTree({organizationSid: this.$store.getters.userInfo.orgSid}).then(res => {
// let tree = res.data[0].orgDepartmentVoList
// treeArr(tree)
// this.treedata = tree
// })
},
// ID
setRole(row) {
this.roleForm.roleSid = []
this.roleDialog = true
this.roleForm.sid = row.sid
this.roleForm.userSid = row.sid
setRole(this.roleForm).then(res => {
this.roleList = res.data
for (let i = 0; i < res.data.length; i++) {
if (res.data[i].checked === '0') {
this.roleForm.roleSid.push(res.data[i].sid)
let params = this.page
params.params = this.search
userList(params).then(res => {
this.page.total = res.data.total
this.userTable = res.data.records
})
},
getRoleList() {
var param = {}
roleList(param).then(res => {
if (res.code === '200') {
this.roleListAll = res.data
}
}
// this.roleForm.roleSid = res.data.filter(item=> item.checked =='0')
})
},
//
saveRole(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.roleForm.roleSid = this.roleForm.roleSid.toString()
saveOrgRole(this.roleForm).then(res => {
if (res.code === '200') {
this.roleDialog = false
this.getOrgUserList()
this.$message({
message: res.msg,
type: 'success'
})
})
},
//
pagination(val) {
this.page.current = val.pageNum
this.page.size = val.pageSize
this.getOrgUserList()
},
getOrgTree() { //
function treeArr(data) {
if (data.length > 0) {
for (var i = 0; i < data.length; i++) {
if (data[i].orgDepartmentVoList.length > 0) {
treeArr(data[i].orgDepartmentVoList)
} else {
delete data[i].orgDepartmentVoList
}
}
})
} else {
return false
}
}
})
},
//
saveOrg(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
let params = { //
departmentSid: this.bm_Form.departmentSid[this.bm_Form.departmentSid.length - 1],
staffSid: this.bm_Form.staffSid
// getOrgTree({organizationSid: this.$store.getters.userInfo.orgSid}).then(res => {
// let tree = res.data[0].orgDepartmentVoList
// treeArr(tree)
// this.treedata = tree
// })
},
// ID
setRole(row) {
this.roleForm.roleSid = []
this.roleDialog = true
this.roleForm.sid = row.sid
this.roleForm.userSid = row.sid
setRole(this.roleForm).then(res => {
this.roleList = res.data
for (let i = 0; i < res.data.length; i++) {
if (res.data[i].checked === '0') {
this.roleForm.roleSid.push(res.data[i].sid)
}
}
saveDepartment(params).then(res => {
if (res.code === '200') {
this.getOrgUserList()
this.bm_Dialog = false
this.$message({
message: res.msg,
type: 'success'
})
// this.roleForm.roleSid = res.data.filter(item=> item.checked =='0')
})
},
//
saveRole(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.roleForm.roleSid = this.roleForm.roleSid.toString()
saveOrgRole(this.roleForm).then(res => {
if (res.code === '200') {
this.roleDialog = false
this.getOrgUserList()
this.$message({
message: res.msg,
type: 'success'
})
}
})
} else {
return false
}
})
},
//
saveOrg(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
let params = { //
departmentSid: this.bm_Form.departmentSid[this.bm_Form.departmentSid.length - 1],
staffSid: this.bm_Form.staffSid
}
saveDepartment(params).then(res => {
if (res.code === '200') {
this.getOrgUserList()
this.bm_Dialog = false
this.$message({
message: res.msg,
type: 'success'
})
}
})
} else {
return false
}
});
},
//
save(formName) {
this.form.userType = this.form.userTypeKey;
userUpdata(this.form).then(res => {
if (res.code === '200') {
this.getOrgUserList()
this.bm_Dialog = false
this.$message({
message: res.msg,
type: 'success'
})
this.editDialog = false
}
this.reset()
})
},
initPwd(row) {
this.$confirm('此操作将初始化该用户密码, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
initPwd({
sid: row.sid
}).then(res => {
this.$message({
type: 'success',
message: res.msg
})
})
} else {
return false
}
});
},
//
save(formName) {
this.form.userType = this.form.userTypeKey;
userUpdata(this.form).then(res => {
if (res.code === '200') {
this.getOrgUserList()
this.bm_Dialog = false
this.$message({
message: res.msg,
type: 'success'
})
},
saveOpenId(row) {
this.$confirm('此操作将修改用户微信公众号OpenId, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
saveOpenId({
sid:row.sid,
openid:row.openid
}).then(res => {
this.$message({
type: 'success',
message: res.msg
})
})
this.editDialog = false
}
this.reset()
})
},
initPwd(row) {
this.$confirm('此操作将初始化该用户密码, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
initPwd({sid: row.sid}).then(res => {
this.$message({
type: 'success',
message: res.msg
})
},
//
userinfoChange(row) {
var postSid = row.postSid
this.editDialog = true
this.form = Object.assign({}, row)
this.postSid = postSid
this.$nextTick(() => {
this.$refs.Tree.setChecked(this.form.departmentSid, true, true)
})
// this.$emit('status',true)
// this.$emit('item',row)
},
//
del(row) {
this.$confirm('此操作将删除该用户, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delUser({
sid: row.sid
}).then(res => {
this.$message({
type: 'success',
message: res.msg
});
this.getOrgUserList()
})
})
})
},
//
userinfoChange(row) {
var postSid = row.postSid
this.editDialog = true
this.form = Object.assign({}, row)
this.postSid = postSid
this.$nextTick(() => {
this.$refs.Tree.setChecked(this.form.departmentSid, true, true)
})
// this.$emit('status',true)
// this.$emit('item',row)
},
//
del(row) {
this.$confirm('此操作将删除该用户, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delUser({ sid: row.sid }).then(res => {
},
toNav(src) {
this.$router.push('/' + src)
},
//
getOrgList(row) {
// this.roleDialog = true
this.checkedId = []
this.Thisrow = row
this.loading = true
let params = {}
orgList(params).then(res => {
this.treedata = res.data
})
},
checkchange(data, checked, indeterminate) {
if (checked) {
this.form.deptSid = data.sid
this.orgName = data.name
let arr = []
arr = [data.sid]
this.$refs.Tree.setCheckedKeys(arr)
this.form.postSid = ''
this.getPost(data.sid)
return
}
},
getPost(orgSid) {
let params = {
sid: orgSid
}
postList(params).then(res => {
this.postSidData = res.data
})
this.form.postSid = this.postSid
},
reset() {
this.form = {}
},
enabledChange(value, row) {
setRoleEnable({
sid: row.sid,
isEnable: value
}).then(res => {
this.$message({
type: 'success',
message: res.msg
});
this.getOrgUserList()
})
})
},
toNav(src) {
this.$router.push('/' + src)
},
//
getOrgList(row) {
// this.roleDialog = true
this.checkedId = []
this.Thisrow = row
this.loading = true
let params = {}
orgList(params).then(res => {
this.treedata = res.data
})
},
checkchange(data, checked, indeterminate) {
if (checked) {
this.form.deptSid = data.sid
this.orgName = data.name
let arr = []
arr = [data.sid]
this.$refs.Tree.setCheckedKeys(arr)
this.form.postSid = ''
this.getPost(data.sid)
return
}
},
getPost(orgSid) {
let params = {
sid: orgSid
}
postList(params).then(res => {
this.postSidData = res.data
})
this.form.postSid = this.postSid
},
reset() {
this.form = {}
},
enabledChange(value, row) {
setRoleEnable({
sid: row.sid,
isEnable: value
}).then(res => {
this.$message({
type: 'success',
message: res.msg
});
})
}
}
}
</script>
<style scoped="scoped">
.el-select > .el-input {
display: block;
width: 300px;
}
.el-select>.el-input {
display: block;
width: 300px;
}
</style>

Loading…
Cancel
Save