| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374 |
- <template>
- <page-meta :root-font-size="getFontSizeValue"></page-meta>
- <view class="content">
- <view class="userInfo" @click="infoHandle">
- <view class="userInfoLeft">
- <image src="/static/person.png" mode=""></image>
- </view>
- <view class="userInfoRight">
- <view>{{userName}}--{{userCode}}</view>
- <view>{{deptName}}</view>
- </view>
- </view>
- <view class="userList">
- <view class="listCell" v-for="(item,index) in listCell" :key="index">
- <image :src="item.imgPath"></image>
- <text>{{item.itemText}}</text>
- <uni-icons class="fontIcon" type="arrowright" color="#d6d6d4" size="18"></uni-icons>
- </view>
- <view class="listCell" @click="trunFontSizeSettingPass">
- <image src="/static/Wd.png"></image>
- <text>修改密码</text>
- <text class="versionNum">********</text>
- </view>
- <view class="listCell" @click="trunFontSizeSetting">
- <image src="/static/Wd.png"></image>
- <text>设置字体大小</text>
- <text class="versionNum">{{fontSizeString}}</text>
- </view>
- <view class="listCell" @touchend="touchHandle">
- <image src="/static/Wd.png"></image>
- <text>版本</text>
- <text class="versionNum">{{version}}</text>
- </view>
- <view class="listCell" @touchend="btnChange" v-if="isAllowDept==1">
- <image src="/static/Wd.png"></image>
- <text>切换科室</text>
- <text class="versionNum">{{deptName}}</text>
- </view>
- </view>
- <!-- <view class="btnExit" v-if="isAllowDept==1">
- <button type="primary" @click="btnChange">切换科室</button>
- </view> -->
- <view class="btnExit">
- <button type="primary" @click="btnExit">退出登录</button>
- </view>
- <view>
- <uni-popup ref="inputDialogs" type="dialog">
- <uni-popup-dialog ref="inputClose" mode="input" :title="title" @confirm="dialogInputConfirm">
- <view style="height: 600rpx;overflow-y: auto;">
- <radio-group @change="radioChange" style="width: 100%;height: 600rpx;">
- <label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in allowData"
- :key="index">
- <view v-show="$mHelper.findParents(departList, item.deptid)" style="width:100%;line-height: 24px;color: #606266;margin-bottom: 10px;">
- <radio style="width: 30px;" :value="item.deptid" :checked="index === current"/>
- <text class="yydepttit">{{ $mHelper.findParents(departList, item.deptid) }}</text>
- </view>
- </label>
- </radio-group>
- <!-- <uni-table style="height: 600rpx;" ref="table" border stripe emptyText="暂无更多数据">
- <uni-tr>
- <uni-th align="center">请选择</uni-th>
- </uni-tr>
- <uni-tr>
- <uni-td align="center">
- <radio-group @change="radioChange" style="width: 100%;">
- <label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in allowData"
- :key="index">
- <view style="padding: 5px 0;position: relative;width: 100%;">
- <radio style="width: 30px;position: absolute;left: 0;"
- :value="item.deptid" :checked="index === current" />
- <text style="margin-left: 15px;display: inline-block;width: 80%;">{{ $mHelper.findParents(departList, item.deptid) }}</text>
- </view>
- </label>
- </radio-group>
- </uni-td>
- </uni-tr>
- </uni-table> -->
- </view>
- </uni-popup-dialog>
- </uni-popup>
- </view>
- </view>
- </template>
- <script>
- import { debuggerModule, installDebugger } from 'uni_modules/imengyu-IMDebuggerWindow/common/debuggerExtern.js'
- import {
- mapGetters
- } from 'vuex';
- import store from '@/store';
- export default {
- data() {
- return {
- isAllowDept:0,
- current:"",
- onchangedept:"",
- selectedIndexs:[],
- departList:[],
- allowData:[],
- title:'允用科室',
- getFontSizeValue:'1rem',
- version: '1.1.8',
- fontSizeString:'',
- touchHandleTime:0,
- listCell: [
- // {
- // imgPath:'../../static/Wa.png',
- // itemText:'服务守则'
- // },
- ]
- }
- },
- onLoad() {
- if(uni.getStorageSync('storageAllowUserDept').indexOf(",")>=0){
- this.isAllowDept = 1
- }
- this.departList = JSON.parse(uni.getStorageSync("deptTreeData"));
- this.getFontSizeValue = uni.getStorageSync('fontSizeValue')+'rem'
- if(uni.getStorageSync('fontSizeValue') === 1){
- this.fontSizeString = '小'
- }else if (uni.getStorageSync('fontSizeValue') === 1.2){
- this.fontSizeString = '中'
- }else if (uni.getStorageSync('fontSizeValue') === 1.4){
- this.fontSizeString = '大'
- }
- store.dispatch("GetInfo")
- // 页面
- this.updateList()
- // #ifdef APP-PLUS
- this.version = 'v' + plus.runtime.version
- // #endif
- },
- methods: {
- radioChange: function(evt) {
- this.onchangedept = evt.detail.value;
- console.log(evt.detail.value)
- for (let i = 0; i < this.allowData.length; i++) {
- if (this.allowData[i].deptid === evt.detail.value) {
- this.current = i;
- break;
- }
- }
- },
- selectionChange(e){
- this.selectedIndexs = e.detail.index
- this.onchangedept = this.allowData[e.detail.index].deptid
- console.log(this.allowData[e.detail.index])
- },
- dialogInputConfirm(){
- // if(this.selectedIndexs.length!=1){
- // this.$mHelper.toast("请选择一行数据");
- // return;
- // }
- const params={
- deptId:this.onchangedept||this.deptId,
- userid:uni.getStorageSync('userId')
- }
- this.$http.get('UserAccount/ChangeDeptId', params).then(res=>{
- if(res.state == "success"){
- this.$mHelper.toast(res.message);
- this.$refs.inputDialogs.close()
- this.$mStore.dispatch("GetInfo").then((e)=>{
- if(e.data.Dept){
- uni.setStorageSync('deptId', e.data.Dept.F_DeptId)
- uni.setStorageSync('deptName', e.data.Dept.F_DeptName)
- }
- })
- }
- })
- },
- updateList(){
- uni.$on("updateList", (res) => {
- store.dispatch("GetInfo")
- })
- },
- trunFontSizeSetting(){
- uni.navigateTo({
- url: "/pages/setting/fontSizeSetting/fontSizeSetting"
- })
- },
- trunFontSizeSettingPass(){
- uni.navigateTo({
- url: "/pages/setting/fontSizeSettingPass/fontSizeSettingPass"
- })
- },
- touchHandle(e) {
- this.touchHandleTime++
- console.log(this.touchHandleTime)
- if(this.touchHandleTime === 5){
- this.touchHandleTime = 0
- installDebugger({
- enableRequestInterceptor: true, //默认为false,指示是否拦截网络请求,参见下一条
- showGlobalFloatWindow: true //默认为true,指定是否添加一个全局的调试按钮,点击可跳转至窗口
- });
- }
-
- },
- btnChange(){
- var str = uni.getStorageSync('storageAllowUserDept')//获取允用科室ids
- console.log(str,'hhh',this.deptId)
- var arr = []
- if (str.indexOf(',') >= 0) {
- for (var i = 0; i < str.split(",").length; i++) {
- if(this.deptId == str.split(",")[i]){
- this.current = 0;
- arr.unshift({
- deptname: '',
- deptid: str.split(",")[i]
- })
- }else{
- arr.push({
- deptname: '',
- deptid: str.split(",")[i]
- })
- }
- }
- this.allowData = arr
- }
- this.$refs.inputDialogs.open()
- },
- btnExit() {
- uni.showModal({
- title: '确定退出吗?',
- content: '退出到登录页面',
- success: function(res) {
- if (res.confirm) {
- uni.setStorageSync('Username', '');
- uni.setStorageSync('Password', '');
- uni.setStorageSync('token', '');
- uni.reLaunch({
- url: '/pages/login/login'
- });
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- },
- infoHandle(){
- uni.navigateTo({
- url:"personDetail/personDetail?userCode="+this.userCode
- })
- }
- },
- computed: {
- ...mapGetters([
- "userCode", // 用户工号
- "userName", // 用户名称
- "deptId",
- "deptName", // 部门名称
- ])
- }
- }
- </script>
- <style lang="scss">
- /deep/.uni-dialog-content{
- margin: 0;
- padding: 0;
- }
- .yydepttit {
- display: inline-block;
- width: 85%;
- text-align: center;
- font-size: 14px;
- vertical-align: middle;
- // height: 24px;
- }
- .equipmentInfo {
- width: 100%;
- margin-top: 15px;
- border: 1px solid rgb(229, 229, 229);
- box-shadow: 0px 4px 16px 0px rgba(69, 91, 99, 0.05);
- margin-bottom: 20px;
- border-radius: 5px;
-
- .trCon {
- width: 100%;
- // font-size: 14px;
- .tdCon {
- display: inline-block;
- padding: 10px 0px;
- color: rgb(102, 102, 102);
- width: 48%;
- padding-right: 5px;
- text-align: center;
- }
- }
- }
- .userInfo {
- // background: url(/static/setting_banner.png) no-repeat;
- background-color: rgb(0, 122, 255);
- background-size: 100% 100%;
- width: 100%;
- height: 260rpx;
- display: flex;
- .userInfoLeft {
- width: 150rpx;
- height: 150rpx;
- border-radius: 75rpx;
- margin: 30rpx 30rpx 0rpx 30rpx;
- background: #FFFFFF;
- image {
- width: 100%;
- height: 100%;
- padding: 30rpx 20rpx 30rpx 35rpx;
- box-sizing: border-box;
- }
- }
- .userInfoRight {
- margin-top: 50rpx;
- view {
- color: #FFFFFF;
- }
- }
- }
- .userList {
- width: 100%;
- border-top: 1rpx solid #d6d6d4;
- border-bottom: 1rpx solid #d6d6d4;
- background: #FFFFFF;
- margin-top: 40rpx;
- overflow: hidden;
- .listCell {
- width: 720rpx;
- margin-left: 30rpx;
- height: 84rpx;
- line-height: 84rpx;
- border-bottom: 1rpx solid #d6d6d4;
- position: relative;
- display: flex;
- image {
- width: 40rpx;
- height: 40rpx;
- margin: 22rpx 22rpx 0 22rpx;
- box-sizing: border-box;
- }
- .fontIcon {
- position: absolute;
- right: 40rpx;
- }
- .versionNum {
- position: absolute;
- right: 80rpx;
- color: #999998;
- }
- }
- .listCell:last-child {
- border: none;
- }
- }
- .btnExit {
- width: 80%;
- margin: 30rpx auto;
- }
- </style>
|