|
|
@@ -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
|
}
|