liuzhihui лет назад: 2
Родитель
Сommit
1f35fecc45

+ 23 - 4
CallCenterWeb.UI/RMYY/src/views/faultRepairManagement/repairList/index.vue

@@ -444,7 +444,7 @@
444 444
     <el-dialog :visible.sync="dialogdept" title="转基建">
445 445
       <el-form ref="redeploydeptForm" :model="redeploydeptForm" :rules="rules" label-width="100px">
446 446
         <el-form-item label="科室" prop="ToDept">
447
-          <select-gzbx-dept-tree :deptparam="deptidArr1" v-model="redeploydeptForm.ToDept" @post-deptid="getDeptid1" />
447
+          <select-dept-tree :deptparam="deptidArr1" v-model="redeploydeptForm.ToDept" @post-deptid="getDeptid1" />
448 448
         </el-form-item>
449 449
         <el-form-item label="人员" prop="ToUserCode">
450 450
           <el-select v-model="redeploydeptForm.ToUserCode" clearable filterable placeholder="请选择人员"
@@ -1261,10 +1261,14 @@
1261 1261
       redeployDept(code,type,applyid) {
1262 1262
         this.dialogdept = true;
1263 1263
         this.redeploydeptForm.WorkOrderCode = code;
1264
-        //转基建默认当前登录人部门
1265
-        this.deptidArr1 = [window.localStorage.getItem('deptId')]
1266
-        this.redeploydeptForm.ToDept = window.localStorage.getItem('deptId')
1264
+        //转基建默认基建后勤保障部
1265
+        this.deptidArr1 = this.getdeptArrBycode(this.$store.getters.deptments,"HQBZ")
1266
+        this.redeploydeptForm.ToDept = this.deptidArr1[this.deptidArr1.length-1];
1267 1267
         this.getDeptman(this.redeploydeptForm.ToDept);
1268
+        //转基建默认当前登录人部门
1269
+        // this.deptidArr1 = [window.localStorage.getItem('deptId')]
1270
+        // this.redeploydeptForm.ToDept = window.localStorage.getItem('deptId')
1271
+        // this.getDeptman(this.redeploydeptForm.ToDept);
1268 1272
         //清空
1269 1273
         // this.deptidArr1 = []
1270 1274
         // this.redeploydeptForm.ToDept = ""
@@ -1306,6 +1310,21 @@
1306 1310
         //     }
1307 1311
         //   }
1308 1312
         // }
1313
+      },
1314
+      // 通过部门code获取id
1315
+      getdeptArrBycode(treeData,code){
1316
+      	for (let i = 0; i < treeData.length; i++) {
1317
+      		if (treeData[i].identification == code) {
1318
+      			return this.$store.getters.deptmap[parseInt(treeData[i].id)].ids;
1319
+      		}else{
1320
+            if (treeData[i].children) {
1321
+            	var res = this.getdeptArrBycode(treeData[i].children, code)
1322
+            	if (res !== undefined) {
1323
+            		return res
1324
+            	}
1325
+            }
1326
+          }
1327
+      	}
1309 1328
       },
1310 1329
       redeployZuzhang(code) {
1311 1330
         this.getReason("ZUZHANG");

+ 2 - 1
CallCenterWeb.UI/RMYY/src/views/orderManage/orderList/index.vue

@@ -270,7 +270,8 @@
270 270
     created() {
271 271
       this.getSource();
272 272
       this.getList();
273
-      window.setInterval(() => {
273
+      clearInterval(interval);
274
+      var interval = window.setInterval(() => {
274 275
         setTimeout(() => {
275 276
           this.isloading = 1
276 277
           this.getList();

+ 132 - 85
CallCenterWeb.UI/RMYYAPP/pages/myTask/repairList/repairDetail/tranferDetail/tranferDetail.vue

@@ -3,19 +3,22 @@
3 3
 	<view class="wrapper">
4 4
 		<view class="form">
5 5
 			<!-- 基础表单校验 -->
6
-			<uni-forms ref="valiForm" :rules="rules" >
6
+			<uni-forms ref="valiForm" :rules="rules">
7 7
 				<uni-forms-item label="部门" required name="departRepair">
8
-					<uni-data-picker :showSearch= "showSearch" :localdata="tranformDepartList" v-model="tranformDepart" @nodeclick="tranformDepartChange" @popupclosed="popupclosedDept" @searchTrue="departSearchTrue"></uni-data-picker>
8
+					<uni-data-picker :showSearch="showSearch" :localdata="tranformDepartList" v-model="tranformDepart"
9
+						@nodeclick="tranformDepartChange" @popupclosed="popupclosedDept"
10
+						@searchTrue="departSearchTrue"></uni-data-picker>
9 11
 				</uni-forms-item>
10
-				<uni-forms-item label="人员" required  name="tranforPeople">
11
-					<uni-combox :candidates="candidates" placeholder="输入选择报修人"  @input="tranforPeopleChange" v-model="tranforPeopleName"></uni-combox>
12
+				<uni-forms-item label="人员" required name="tranforPeople">
13
+					<uni-combox :candidates="candidates" placeholder="输入选择报修人" @input="tranforPeopleChange"
14
+						v-model="tranforPeopleName"></uni-combox>
12 15
 					<!-- <uni-data-select v-model="tranforPeople" :localdata="tranforPeopleList" @change="tranforPeopleChange"/> -->
13 16
 				</uni-forms-item>
14 17
 			</uni-forms>
15 18
 			<view class="btnClass">
16 19
 				<button type="primary" :disabled="disabledButton" @click="submit('valiForm')">提交</button>
17 20
 			</view>
18
-			
21
+
19 22
 		</view>
20 23
 	</view>
21 24
 </template>
@@ -27,12 +30,12 @@
27 30
 			return {
28 31
 				typeid: '3000',
29 32
 				showSearch: true,
30
-				getFontSizeValue:'1rem',
33
+				getFontSizeValue: '1rem',
31 34
 				state: '',
32
-				disabledButton:false,
35
+				disabledButton: false,
33 36
 				workorderid: '',
34 37
 				departRepair: '',
35
-				detpid:0,
38
+				detpid: 0,
36 39
 				tranformDepartList: [], // 指派部门
37 40
 				tranformDepart: '', // 指派部门
38 41
 				tranforPeopleList: [], // 指派人
@@ -46,87 +49,126 @@
46 49
 		},
47 50
 		onLoad(option) {
48 51
 			this.getHosptallist() // 院区
49
-			this.getFontSizeValue = uni.getStorageSync('fontSizeValue')+'rem'
52
+			this.getFontSizeValue = uni.getStorageSync('fontSizeValue') + 'rem'
50 53
 			this.state = option.state
51 54
 			this.workorderid = option.wid
52 55
 			console.log(option.state)
53
-			if(option.state == 'trunWork'){
54
-				pageData.getDetRepair((res,list) => {
55
-					this.tranformDepartList = res
56
-					//转基建默认当前登录人部门
57
-					this.tranformDepart = "1_"+ uni.getStorageSync('deptId')
58
-					pageData.getApplicant(uni.getStorageSync('deptId'), (res,data,candidates) => {
59
-						this.tranforPeopleList = res
60
-						this.candidates = candidates
61
-						//转基建默认第一个
62
-						if(this.state == 'trunWork'){
63
-							console.log(this.tranforPeopleList,'this.tranforPeopleList')
64
-							this.tranforPeopleName = this.getTextByCode(this.tranforPeopleList[0].value)
65
-							this.tranforPeople = this.tranforPeopleList[0].value
66
-						}
67
-					})
68
-				})
69
-				return
70
-			}
71
-			pageData.getDet((res,list) => {
56
+			// if (option.state == 'trunWork') {
57
+			// 	pageData.getDetRepair((res,list) => {
58
+			// 		this.tranformDepartList = res
59
+			// 		//转基建默认当前登录人部门
60
+			// 		this.tranformDepart = "1_"+ uni.getStorageSync('deptId')
61
+			// 		pageData.getApplicant(uni.getStorageSync('deptId'), (res,data,candidates) => {
62
+			// 			this.tranforPeopleList = res
63
+			// 			this.candidates = candidates
64
+			// 			//转基建默认第一个
65
+			// 			if(this.state == 'trunWork'){
66
+			// 				console.log(this.tranforPeopleList,'this.tranforPeopleList')
67
+			// 				this.tranforPeopleName = this.getTextByCode(this.tranforPeopleList[0].value)
68
+			// 				this.tranforPeople = this.tranforPeopleList[0].value
69
+			// 			}
70
+			// 		})
71
+			// 	})
72
+			// 	return
73
+			// }
74
+			pageData.getDet((res, list) => {
72 75
 				this.tranformDepartList = res
73 76
 				//默认-清空
74 77
 				this.tranforPeopleList = []
75 78
 				this.candidates = []
76 79
 				this.tranforPeople = ''
77 80
 				this.tranforPeopleName = ''
81
+				//转基建默认
82
+				if (option.state == 'trunWork') {
83
+					this.tranformDepart = this.getdeptArrBycode(list, 'HQBZ')
84
+					console.log(this.tranformDepart)
85
+					pageData.getApplicant(this.tranformDepart.split('_')[1], (res, data, candidates) => {
86
+						this.tranforPeopleList = res
87
+						this.candidates = candidates
88
+						//转基建人员默认第一个
89
+						if (this.state == 'trunWork') {
90
+							console.log(this.tranforPeopleList, 'this.tranforPeopleList')
91
+							this.tranforPeopleName = this.getTextByCode(this.tranforPeopleList[0].value)
92
+							this.tranforPeople = this.tranforPeopleList[0].value
93
+						}
94
+					})
95
+					return
96
+				}
78 97
 				//院区
79
-				const applyHos = this.getHosptalId(this.$mHelper.findParents(this.tranformDepartList,option.departid).split('/')[0])
80
-				console.log(applyHos,'院区')
81
-				if(applyHos == 0){
98
+				const applyHos = this.getHosptalId(this.$mHelper.findParents(this.tranformDepartList, option
99
+					.departid).split('/')[0])
100
+				console.log(applyHos, '院区')
101
+				if (applyHos == 0) {
82 102
 					return
83 103
 				}
84 104
 				var autoData = []
85 105
 				//获取配置
86
-				this.$http.get("GongDanType/GetModule", {mId:option.orderType}).then((response) => {
106
+				this.$http.get("GongDanType/GetModule", {
107
+					mId: option.orderType
108
+				}).then((response) => {
87 109
 					if (response.state.toLowerCase() === "success") {
88
-						if(response.data.autodept!=''){
110
+						if (response.data.autodept != '') {
89 111
 							autoData = JSON.parse(response.data.autodept)
90
-							if(!autoData.length || autoData[0] == null){
112
+							if (!autoData.length || autoData[0] == null) {
91 113
 								return
92 114
 							}
93 115
 							//遍历
94 116
 							var hosall = []
95
-							for(var i = 0;i<autoData.length;i++){
96
-							  hosall.push(autoData[i].autoyq)
117
+							for (var i = 0; i < autoData.length; i++) {
118
+								hosall.push(autoData[i].autoyq)
97 119
 							}
98 120
 							for (var i = 0; i < autoData.length; i++) {
99 121
 								if (autoData[i].autoyq == applyHos) {
100 122
 									var aotocode = autoData[i].autousercode
101
-									this.tranformDepart = this.$mHelper.findParents(this.tranformDepartList, autoData[i].autodept)
123
+									this.tranformDepart = this.$mHelper.findParents(this
124
+											.tranformDepartList, autoData[i].autodept)
102 125
 										.split('/').length + '_' + autoData[i].autodept
103
-									pageData.getApplicant(autoData[i].autodept, (res, data, candidates) => {
126
+									pageData.getApplicant(autoData[i].autodept, (res, data,
127
+									candidates) => {
104 128
 										this.tranforPeopleList = res
105 129
 										this.candidates = candidates
106
-									    this.tranforPeopleName = this.getTextByCode(aotocode)
107
-									    this.tranforPeople = aotocode
108
-									})				
109
-								} else if (autoData[i].autoyq == '0' && hosall.indexOf(applyHos)<0) {
130
+										this.tranforPeopleName = this.getTextByCode(aotocode)
131
+										this.tranforPeople = aotocode
132
+									})
133
+								} else if (autoData[i].autoyq == '0' && hosall.indexOf(applyHos) < 0) {
110 134
 									var aotocode = autoData[i].autousercode
111
-									this.tranformDepart = this.$mHelper.findParents(this.tranformDepartList, autoData[i].autodept)
135
+									this.tranformDepart = this.$mHelper.findParents(this
136
+											.tranformDepartList, autoData[i].autodept)
112 137
 										.split('/').length + '_' + autoData[i].autodept
113
-									pageData.getApplicant(autoData[i].autodept, (res, data, candidates) => {
138
+									pageData.getApplicant(autoData[i].autodept, (res, data,
139
+									candidates) => {
114 140
 										this.tranforPeopleList = res
115 141
 										this.candidates = candidates
116 142
 										this.tranforPeopleName = this.getTextByCode(aotocode)
117 143
 										this.tranforPeople = aotocode
118
-									})							
144
+									})
119 145
 								}
120 146
 							}
121 147
 						}
122 148
 					}
123 149
 				})
124
-			})						
150
+			})
125 151
 		},
126 152
 		methods: {
127
-			getTextByCode(code){
128
-				for(var i = 0;i<this.tranforPeopleList.length;i++){
129
-					if(this.tranforPeopleList[i].value == code){
153
+			// 通过部门code获取id
154
+			getdeptArrBycode(treeData, code) {
155
+				for (let i = 0; i < treeData.length; i++) {
156
+					if (treeData[i].identification == code) {
157
+						return this.$mHelper.findParents(this.tranformDepartList, treeData[i].id)
158
+							.split('/').length + '_' + treeData[i].id
159
+					} else {
160
+						if (treeData[i].children) {
161
+							var res = this.getdeptArrBycode(treeData[i].children, code)
162
+							if (res !== undefined) {
163
+								return res
164
+							}
165
+						}
166
+					}
167
+				}
168
+			},
169
+			getTextByCode(code) {
170
+				for (var i = 0; i < this.tranforPeopleList.length; i++) {
171
+					if (this.tranforPeopleList[i].value == code) {
130 172
 						return this.tranforPeopleList[i].text
131 173
 					}
132 174
 				}
@@ -137,8 +179,8 @@
137 179
 					pageindex: 1,
138 180
 					pagesise: 10000
139 181
 				}
140
-				this.$http.get("Worepair/GetListyqRepairlist",params).then((res)=>{
141
-					if(res.state.toLowerCase() ==="success"){
182
+				this.$http.get("Worepair/GetListyqRepairlist", params).then((res) => {
183
+					if (res.state.toLowerCase() === "success") {
142 184
 						this.hosptalList = res.rows
143 185
 					}
144 186
 				})
@@ -147,7 +189,7 @@
147 189
 			getHosptalId(name) {
148 190
 				let id = 0;
149 191
 				this.hosptalList.forEach(v => {
150
-					if(v.T_Woname == name){
192
+					if (v.T_Woname == name) {
151 193
 						id = v.T_Woid
152 194
 					}
153 195
 				})
@@ -158,55 +200,57 @@
158 200
 				this.candidates = []
159 201
 				this.tranforPeople = ''
160 202
 				this.tranforPeopleName = ''
161
-				if(e) {
203
+				if (e) {
162 204
 					this.detpid = e.value
163
-					pageData.getApplicant(e.value.split('_')[1], (res,data,candidates) => {
205
+					pageData.getApplicant(e.value.split('_')[1], (res, data, candidates) => {
164 206
 						this.tranforPeopleList = res
165 207
 						this.candidates = candidates
166 208
 						//转基建默认第一个
167
-						if(this.state == 'trunWork'){
168
-							console.log(this.tranforPeopleList,'this.tranforPeopleList')
209
+						if (this.state == 'trunWork') {
210
+							console.log(this.tranforPeopleList, 'this.tranforPeopleList')
169 211
 							this.tranforPeopleName = this.getTextByCode(this.tranforPeopleList[0].value)
170 212
 							this.tranforPeople = this.tranforPeopleList[0].value
171 213
 						}
172 214
 					})
173 215
 				}
174
-			    
216
+
175 217
 			},
176
-			departSearchTrue(e){
218
+			departSearchTrue(e) {
177 219
 				this.tranformDepart = e.value
178 220
 			},
179 221
 			popupclosedDept(e) {
180 222
 				this.tranformDepart = this.detpid
181 223
 			},
182 224
 			tranforPeopleChange(res) {
183
-				let e = this.$mHelper.getValueByText(res,this.tranforPeopleList)
225
+				let e = this.$mHelper.getValueByText(res, this.tranforPeopleList)
184 226
 				this.tranforPeople = e
185 227
 			},
186
-			submit(ref,state) {
228
+			submit(ref, state) {
187 229
 				// console.log(this.tranformDepart,this.tranforPeople)
188 230
 				// return
189
-				if(!this.tranformDepart) {
231
+				if (!this.tranformDepart) {
190 232
 					this.$mHelper.toast('请选择指派部门')
191 233
 					return
192 234
 				}
193
-				if(!this.tranforPeople) {
235
+				if (!this.tranforPeople) {
194 236
 					this.$mHelper.toast('请选择指派人员')
195 237
 					return
196 238
 				}
197 239
 				this.disabledButton = true
198 240
 				this.$refs[ref].validate().then(res => {
199 241
 					const params = {
200
-					  WorkOrderCode: this.workorderid,
201
-					  ToDept: this.tranformDepart.split('_')[1],
202
-					  ToUserCode: this.tranforPeople
242
+						WorkOrderCode: this.workorderid,
243
+						ToDept: this.tranformDepart.split('_')[1],
244
+						ToUserCode: this.tranforPeople
203 245
 					}
204
-					if(this.state == 'trunWork') {
205
-						this.$mHelper.httpPost("FaultRepair/DealManTransfer",params,2,res=>this.disabledButton=res)	
206
-					}else{
207
-						this.$mHelper.httpPost("FaultRepair/DDZXTransfer",params,2,res=>this.disabledButton=res)
246
+					if (this.state == 'trunWork') {
247
+						this.$mHelper.httpPost("FaultRepair/DealManTransfer", params, 2, res => this
248
+							.disabledButton = res)
249
+					} else {
250
+						this.$mHelper.httpPost("FaultRepair/DDZXTransfer", params, 2, res => this.disabledButton =
251
+							res)
208 252
 					}
209
-					
253
+
210 254
 				}).catch(err => {
211 255
 					this.disabledButton = false
212 256
 					console.log('err', err);
@@ -219,22 +263,25 @@
219 263
 
220 264
 <style lang="scss">
221 265
 	@import '@/common/addFormDeep.scss';
222
-	/deep/ .uni-data-checklist[data-v-84d5d996]{
266
+
267
+	/deep/ .uni-data-checklist[data-v-84d5d996] {
223 268
 		margin-top: 7px !important;
224 269
 	}
225
-.wrapper {
226
-  padding: 10px 15px;
227
-  background-color: #fff;
228
-  .form {
229
-		.uni-stat__select{
230
-		    display: block;
231
-		    align-items: center;
232
-		    padding: 0px;
233
-		    cursor: pointer;
234
-			width: 80%;
270
+
271
+	.wrapper {
272
+		padding: 10px 15px;
273
+		background-color: #fff;
274
+
275
+		.form {
276
+			.uni-stat__select {
277
+				display: block;
278
+				align-items: center;
279
+				padding: 0px;
280
+				cursor: pointer;
281
+				width: 80%;
282
+			}
283
+
235 284
 		}
236
-		
237
-  }
238 285
 
239
-}
240
-</style>
286
+	}
287
+</style>