liuzhihui 2 年之前
父节点
当前提交
efff2badd4

+ 2 - 2
CallCenterWeb.UI/RMYY/src/views/login/changeDept.vue

@@ -3,7 +3,7 @@
3 3
     <el-table v-loading="loading" :data="allowData" border stripe>
4 4
       <el-table-column align="center" label="请选择" width="100">
5 5
         <template slot-scope="scope">
6
-          <input :value="scope.row.deptid" name="tabVal" type="radio" @change="handleSelectionChange" />
6
+          <input :value="scope.row.deptid" :checked="scope.row.deptid==onchangedept" name="tabVal" type="radio" @change="handleSelectionChange" />
7 7
         </template>
8 8
       </el-table-column>
9 9
       <el-table-column prop="deptname" label="科室" align="center"></el-table-column>
@@ -29,7 +29,7 @@
29 29
        return{
30 30
          loading:false,
31 31
          allowData: [],
32
-         onchangedept:""
32
+         onchangedept: window.localStorage.getItem('deptId')
33 33
        }
34 34
      },
35 35
      computed: {

+ 2 - 5
CallCenterWeb.UI/RMYY/src/views/login/index.vue

@@ -135,10 +135,6 @@
135 135
         window.location.href.indexOf("loginid") >= 0 ||
136 136
         window.location.href.indexOf("oploginid") >= 0
137 137
       ) {
138
-        console.log(
139
-          window.location.href.indexOf("loginid"),
140
-          window.location.href.indexOf("oploginid")
141
-        );
142 138
         this.handleOAlogin();
143 139
       }
144 140
     },
@@ -184,6 +180,8 @@
184 180
         console.log(obj);
185 181
         if(obj.dept){
186 182
           window.localStorage.setItem('oadept', obj.dept)
183
+        }else{
184
+          window.localStorage.setItem('oadept', '0')
187 185
         }
188 186
         this.$store
189 187
           .dispatch("OAlogin", {
@@ -193,7 +191,6 @@
193 191
             dept: obj.dept
194 192
           })
195 193
           .then((res) => {
196
-            console.log(res);
197 194
             if (res.state == "success") {
198 195
               this.$message.success("登录成功");
199 196
               window.localStorage.setItem('loginway', decodeURI(obj.loginway))

+ 84 - 37
CallCenterWeb.UI/RMYYAPP/pages/myTask/myTask.vue

@@ -44,7 +44,7 @@
44 44
 			<uni-popup ref="inputDialogs" type="dialog">
45 45
 				<uni-popup-dialog ref="inputClose" mode="input" :title="title" @confirm="dialogInputConfirm">
46 46
 					<view>
47
-						<uni-table style="height: 600rpx;" ref="table" border stripe type="selection" emptyText="暂无更多数据"
47
+						<!-- <uni-table style="height: 600rpx;" ref="table" border stripe type="selection" emptyText="暂无更多数据"
48 48
 							@selection-change="selectionChange">
49 49
 							<uni-tr>
50 50
 								<uni-th align="center">科室</uni-th>
@@ -52,6 +52,25 @@
52 52
 							<uni-tr v-for="(item, index) in allowData" :key="index">
53 53
 								<uni-td align="center">{{ $mHelper.findParents(departList, item.deptid) }}</uni-td>
54 54
 							</uni-tr>
55
+						</uni-table> -->
56
+						<uni-table style="height: 600rpx;" ref="table" border stripe emptyText="暂无更多数据">
57
+							<uni-tr>
58
+								<uni-th align="center">请选择</uni-th>
59
+							</uni-tr>
60
+							<uni-tr>
61
+								<uni-td align="center">
62
+									<radio-group @change="radioChange">
63
+										<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in allowData"
64
+											:key="index">
65
+											<view style="padding: 5px 0;width: 100%;">
66
+												<radio style="width: 30px;margin-right: 10px;"
67
+													:value="item.deptid" :checked="index === current" />
68
+												<text>{{ $mHelper.findParents(departList, item.deptid) }}</text>
69
+											</view>
70
+										</label>
71
+									</radio-group>
72
+								</uni-td>
73
+							</uni-tr>
55 74
 						</uni-table>
56 75
 					</view>
57 76
 				</uni-popup-dialog>
@@ -67,7 +86,7 @@
67 86
 	import {
68 87
 		getToken
69 88
 	} from '@/utils/auth'
70
-	import listUrl  from '@/utils/listUrl.js'
89
+	import listUrl from '@/utils/listUrl.js'
71 90
 	import pageData from '../myTask/repairList/addRepair/pageData.js'
72 91
 	export default {
73 92
 		data() {
@@ -84,14 +103,19 @@
84 103
 				departList: [],
85 104
 				allowData: [],
86 105
 				title: "允用科室",
87
-				selectedIndexs:[],
106
+				selectedIndexs: [],
107
+				current:"",
88 108
 				onchangedept: ''
89 109
 			}
90 110
 		},
91 111
 		computed: {
92
-			...mapGetters(["State"]),
112
+			...mapGetters([
113
+				"State",
114
+				"deptId"
115
+			])
93 116
 		},
94 117
 		onLoad() {
118
+			// this.getStodept()
95 119
 			this.init()
96 120
 			this.saveDept()
97 121
 			this.getFontSizeValue = uni.getStorageSync('fontSizeValue') + 'rem'
@@ -108,6 +132,9 @@
108 132
 							deptname: "",
109 133
 							deptid: str.split(",")[i]
110 134
 						})
135
+						if(uni.getStorageSync('deptId') == str.split(",")[i]){
136
+							this.current = i;
137
+						}
111 138
 					}
112 139
 					this.allowData = arr
113 140
 				}
@@ -120,26 +147,36 @@
120 147
 			// uni.hideTabBar()
121 148
 		},
122 149
 		methods: {
123
-			selectionChange(e){
150
+			radioChange: function(evt) {
151
+				this.onchangedept = evt.detail.value;
152
+				console.log(evt.detail.value)
153
+				for (let i = 0; i < this.allowData.length; i++) {
154
+					if (this.allowData[i].deptid === evt.detail.value) {
155
+						this.current = i;					
156
+						break;
157
+					}
158
+				}
159
+			},
160
+			selectionChange(e) {
124 161
 				this.selectedIndexs = e.detail.index
125 162
 				this.onchangedept = this.allowData[e.detail.index].deptid
126 163
 				console.log(this.allowData[e.detail.index])
127 164
 			},
128
-			dialogInputConfirm(){
129
-				if(this.selectedIndexs.length!=1){
130
-					this.$mHelper.toast("请选择一行数据");
131
-					return;
132
-				}
133
-				const params={
134
-					deptId:this.onchangedept,
135
-					userid:uni.getStorageSync('userId')
165
+			dialogInputConfirm() {
166
+				// if (this.selectedIndexs.length != 1) {
167
+				// 	this.$mHelper.toast("请选择一行数据");
168
+				// 	return;
169
+				// }
170
+				const params = {
171
+					deptId: this.onchangedept,
172
+					userid: uni.getStorageSync('userId')
136 173
 				}
137
-				this.$http.get('UserAccount/ChangeDeptId', params).then(res=>{
138
-					if(res.state == "success"){
174
+				this.$http.get('UserAccount/ChangeDeptId', params).then(res => {
175
+					if (res.state == "success") {
139 176
 						this.$mHelper.toast(res.message);
140 177
 						this.$refs.inputDialogs.close()
141
-						this.$mStore.dispatch("GetInfo").then((e)=>{
142
-							if(e.data.Dept){
178
+						this.$mStore.dispatch("GetInfo").then((e) => {
179
+							if (e.data.Dept) {
143 180
 								uni.setStorageSync('deptId', e.data.Dept.F_DeptId)
144 181
 								uni.setStorageSync('deptName', e.data.Dept.F_DeptName)
145 182
 							}
@@ -165,6 +202,15 @@
165 202
 				this.bannnerData = this.$mConstDataConfig.bannnerData
166 203
 				this.getMenuPermissions() //获取用户权限
167 204
 			},
205
+			//重新存储部门数据
206
+			// getStodept(){
207
+			// 	this.$mStore.dispatch("GetInfo").then((e)=>{
208
+			// 		if(e.data.Dept){
209
+			// 			uni.setStorageSync('deptId', e.data.Dept.F_DeptId)
210
+			// 			uni.setStorageSync('deptName', e.data.Dept.F_DeptName)
211
+			// 		}
212
+			// 	})
213
+			// },
168 214
 			saveDept() {
169 215
 				pageData.getDet((res, data) => {
170 216
 					this.departList = data
@@ -228,15 +274,16 @@
228 274
 						console.log(nowVersionCode + "---" + serveVersionCode)
229 275
 						if (nowVersionCode !== serveVersionCode) {
230 276
 							if (typeUp === 0) {
231
-								
277
+
232 278
 								uni.showModal({
233 279
 									title: '更新',
234 280
 									content: '是否更新',
235
-									showCancel:false,
236
-									success: function (res) {
237
-										if (res.confirm) { 
281
+									showCancel: false,
282
+									success: function(res) {
283
+										if (res.confirm) {
238 284
 											plus.runtime.openURL(data.FileUrl[0].F_FileUrl, err => {
239
-												plus.runtime.openURL(data.FileUrl[0].F_FileUrl);
285
+												plus.runtime.openURL(data.FileUrl[0]
286
+												.F_FileUrl);
240 287
 											}, 'com.android.browser');
241 288
 										} else if (res.cancel) {
242 289
 											this.$mHelper.toast("取消更新");
@@ -247,8 +294,8 @@
247 294
 								uni.showModal({
248 295
 									title: '更新',
249 296
 									content: '是否更新',
250
-									showCancel:false,
251
-									success: function (res) {
297
+									showCancel: false,
298
+									success: function(res) {
252 299
 										if (res.confirm) {
253 300
 											plus.runtime.openURL(data.F_Url);
254 301
 										} else if (res.cancel) {
@@ -283,22 +330,22 @@
283 330
 							}
284 331
 						}
285 332
 
286
-				})
287
-				.catch((e) => {
288
-					console.log(e)
289
-				})
333
+					})
334
+					.catch((e) => {
335
+						console.log(e)
336
+					})
290 337
 				this.$http.get("Index/GetMenu").then((response) => {
291
-					if (response.state.toLowerCase() === "success") {
292
-						if (response.data.length>0) {
338
+						if (response.state.toLowerCase() === "success") {
339
+							if (response.data.length > 0) {
293 340
 
294
-							this.orderListData = listUrl.getMenuData(response.data,code)
295
-							// console.log(this.orderListData)
341
+								this.orderListData = listUrl.getMenuData(response.data, code)
342
+								// console.log(this.orderListData)
343
+							}
296 344
 						}
297
-					}
298
-				})
299
-				.catch((e) => {
300
-					console.log(e)
301
-				})
345
+					})
346
+					.catch((e) => {
347
+						console.log(e)
348
+					})
302 349
 			},
303 350
 		},
304 351
 	}

+ 34 - 9
CallCenterWeb.UI/RMYYAPP/pages/setting/setting.vue

@@ -42,13 +42,23 @@
42 42
 			<uni-popup ref="inputDialogs" type="dialog">
43 43
 				<uni-popup-dialog ref="inputClose" mode="input" :title="title" @confirm="dialogInputConfirm">
44 44
 					<view>
45
-						<uni-table style="height: 600rpx;" ref="table" border stripe type="selection" emptyText="暂无更多数据"
46
-							@selection-change="selectionChange">
45
+						<uni-table style="height: 600rpx;" ref="table" border stripe emptyText="暂无更多数据">
47 46
 							<uni-tr>
48
-								<uni-th align="center">科室</uni-th>
47
+								<uni-th align="center">请选择</uni-th>
49 48
 							</uni-tr>
50
-							<uni-tr v-for="(item, index) in allowData" :key="index">
51
-								<uni-td align="center">{{ $mHelper.findParents(departList, item.deptid) }}</uni-td>
49
+							<uni-tr>
50
+								<uni-td align="center">
51
+									<radio-group @change="radioChange">
52
+										<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in allowData"
53
+											:key="index">
54
+											<view style="padding: 5px 0;">
55
+												<radio style="width: 30px;margin-right: 10px;"
56
+													:value="item.deptid" :checked="index === current" />
57
+												<text>{{ $mHelper.findParents(departList, item.deptid) }}</text>
58
+											</view>
59
+										</label>
60
+									</radio-group>
61
+								</uni-td>
52 62
 							</uni-tr>
53 63
 						</uni-table>
54 64
 					</view>
@@ -69,6 +79,7 @@
69 79
 		data() {
70 80
 			return {
71 81
 				isAllowDept:0,
82
+				current:"",
72 83
 				onchangedept:"",
73 84
 				selectedIndexs:[],
74 85
 				departList:[],
@@ -107,16 +118,26 @@
107 118
 			// #endif
108 119
 		},
109 120
 		methods: {
121
+			radioChange: function(evt) {
122
+				this.onchangedept = evt.detail.value;
123
+				console.log(evt.detail.value)
124
+				for (let i = 0; i < this.allowData.length; i++) {
125
+					if (this.allowData[i].deptid === evt.detail.value) {
126
+						this.current = i;					
127
+						break;
128
+					}
129
+				}
130
+			},
110 131
 			selectionChange(e){
111 132
 				this.selectedIndexs = e.detail.index
112 133
 				this.onchangedept = this.allowData[e.detail.index].deptid
113 134
 				console.log(this.allowData[e.detail.index])
114 135
 			},
115 136
 			dialogInputConfirm(){
116
-				if(this.selectedIndexs.length!=1){
117
-					this.$mHelper.toast("请选择一行数据");
118
-					return;
119
-				}
137
+				// if(this.selectedIndexs.length!=1){
138
+				// 	this.$mHelper.toast("请选择一行数据");
139
+				// 	return;
140
+				// }
120 141
 				const params={
121 142
 					deptId:this.onchangedept,
122 143
 					userid:uni.getStorageSync('userId')
@@ -165,6 +186,9 @@
165 186
 				        deptname: '',
166 187
 				        deptid: str.split(",")[i]
167 188
 				      })
189
+					  if(this.deptId == str.split(",")[i]){
190
+					  	this.current = i;
191
+					  }
168 192
 				  }
169 193
 				  this.allowData = arr
170 194
 				  console.log(arr)
@@ -199,6 +223,7 @@
199 223
 			...mapGetters([
200 224
 				"userCode", // 用户工号
201 225
 				"userName", // 用户名称
226
+				"deptId",
202 227
 				"deptName",	// 部门名称
203 228
 			])
204 229
 		}

+ 1 - 0
CallCenterWeb.UI/RMYYAPP/store/getters.js

@@ -4,6 +4,7 @@ const getters = {
4 4
 	token:	state => state.user.token,
5 5
 	userName: state => state.user.userName, // 用户名称
6 6
 	userCode: state => state.user.userCode, // 用户工号
7
+	deptId: state => state.user.deptId,	//部门名称
7 8
 	deptName: state => state.user.deptName	//部门名称
8 9
 }
9 10
 export default getters

+ 5 - 0
CallCenterWeb.UI/RMYYAPP/store/modules/user.js

@@ -13,6 +13,7 @@ const user = {
13 13
 		token: getToken(),
14 14
 		userName: "",
15 15
 		userCode: "",
16
+		deptId: "",
16 17
 		deptName: ''
17 18
 	},
18 19
 
@@ -26,6 +27,9 @@ const user = {
26 27
 		SET_USERNAME(state, userName) {
27 28
 			state.userName = userName
28 29
 		},
30
+		SET_DEPTID(state, deptId) {
31
+			state.deptId = deptId
32
+		},
29 33
 		SET_DEPTNAME(state, deptName) {
30 34
 			state.deptName = deptName
31 35
 		}
@@ -76,6 +80,7 @@ const user = {
76 80
 							commit('SET_USERNAME', data.User.F_UserName)
77 81
 							// 部门信息
78 82
 							if(data.Dept){
83
+								commit('SET_DEPTID', data.Dept.F_DeptId)
79 84
 								commit('SET_DEPTNAME', data.Dept.F_DeptName)
80 85
 							}
81 86