|
@@ -0,0 +1,310 @@
|
|
1
|
+<template>
|
|
2
|
+ <view class="container" @touchmove.stop.prevent v-if="pageData.pageRouter === 'default'">
|
|
3
|
+ <view class="container_form">
|
|
4
|
+ <view class="hospital">
|
|
5
|
+ <text class="name">标题</text>
|
|
6
|
+ <text class="value ellipsis">
|
|
7
|
+ <input class="uni-input" v-model="searchData.title" placeholder="请输入标题" />
|
|
8
|
+ </text>
|
|
9
|
+ </view>
|
|
10
|
+ <view class="category">
|
|
11
|
+ <text class="name">故障现象</text>
|
|
12
|
+ <text class="value">
|
|
13
|
+ <uni-data-picker @change="categoryChange" v-model="searchData.category" :localdata="pageData.categoryList" popup-title="请选择故障信息" :map="{text:'category',value:'id'}">
|
|
14
|
+
|
|
15
|
+ </uni-data-picker>
|
|
16
|
+ </text>
|
|
17
|
+ </view>
|
|
18
|
+ </view>
|
|
19
|
+ <view class="container_foot">
|
|
20
|
+ <view class="clear" @click="clear">清除选项</view>
|
|
21
|
+ <view class="foot_btns">
|
|
22
|
+ <view class="cancel" @click="cancel">取消</view>
|
|
23
|
+ <view class="confirm" @click="confirm">确认</view>
|
|
24
|
+ </view>
|
|
25
|
+ </view>
|
|
26
|
+ </view>
|
|
27
|
+ <view class="mask" @touchmove.stop.prevent></view>
|
|
28
|
+ <view class="line" @touchmove.stop.prevent></view>
|
|
29
|
+
|
|
30
|
+</template>
|
|
31
|
+
|
|
32
|
+<script setup>
|
|
33
|
+ import { defineEmits, ref, reactive, defineProps } from 'vue'
|
|
34
|
+ import { onLoad } from '@dcloudio/uni-app'
|
|
35
|
+ import { useLoginUserStore } from '@/stores/loginUser'
|
|
36
|
+ import { repositoryListSearchStore } from '@/stores/repositorySearch'
|
|
37
|
+ import { api_area, api_incidentcategory } from "@/http/api.js"
|
|
38
|
+ import { transform } from '@/utils/index.js'
|
|
39
|
+
|
|
40
|
+ const emit = defineEmits(['cancelEmit', 'confirmEmit']);
|
|
41
|
+ const loginUserStore = useLoginUserStore();
|
|
42
|
+ const repositorySearchStore = repositoryListSearchStore();
|
|
43
|
+
|
|
44
|
+ // 页面数据
|
|
45
|
+ const pageData = reactive({
|
|
46
|
+ pageRouter: 'default',
|
|
47
|
+ areaList: [],
|
|
48
|
+ categoryList: [],
|
|
49
|
+ });
|
|
50
|
+
|
|
51
|
+ const searchData = reactive({
|
|
52
|
+ title:'',
|
|
53
|
+ hospital: {},
|
|
54
|
+ selected: 'todoingAll',
|
|
55
|
+ area: {id: 0, area: '全部'},
|
|
56
|
+ category: {},
|
|
57
|
+ acceptDate: [],
|
|
58
|
+ categoryChangeData:[]
|
|
59
|
+ })
|
|
60
|
+
|
|
61
|
+ // 清空
|
|
62
|
+ function clear(){
|
|
63
|
+ searchData.category = {};
|
|
64
|
+ searchData.acceptDate = [];
|
|
65
|
+ searchData.title = '';
|
|
66
|
+ searchData.categoryChangeData = [];
|
|
67
|
+ repositorySearchStore.clearRepositoryListSearchData()
|
|
68
|
+ }
|
|
69
|
+
|
|
70
|
+ // 取消
|
|
71
|
+ function cancel(){
|
|
72
|
+ emit('cancelEmit')
|
|
73
|
+ }
|
|
74
|
+
|
|
75
|
+ // 确认
|
|
76
|
+ function confirm(){
|
|
77
|
+ repositorySearchStore.setRepositoryListSearchData(searchData)
|
|
78
|
+ emit('confirmEmit', searchData);
|
|
79
|
+ }
|
|
80
|
+
|
|
81
|
+ function categoryChange(val){
|
|
82
|
+ searchData.categoryChangeData = val.detail.value
|
|
83
|
+ }
|
|
84
|
+
|
|
85
|
+ // 获取故障现象列表
|
|
86
|
+ function getCategoryList(){
|
|
87
|
+ uni.showLoading({
|
|
88
|
+ title: "加载中",
|
|
89
|
+ mask: true,
|
|
90
|
+ });
|
|
91
|
+
|
|
92
|
+ let postData = {
|
|
93
|
+ idx: 0,
|
|
94
|
+ sum: 9999,
|
|
95
|
+ incidentcategory: {
|
|
96
|
+
|
|
97
|
+ },
|
|
98
|
+ }
|
|
99
|
+ if(loginUserStore.loginUser.user.duty){
|
|
100
|
+ postData.incidentcategory.duty = loginUserStore.loginUser.user.duty.id;
|
|
101
|
+ }else if(loginUserStore.loginUser.user.branch){
|
|
102
|
+ postData.incidentcategory.selectType = 'one';
|
|
103
|
+ }
|
|
104
|
+
|
|
105
|
+ api_incidentcategory(postData).then(res => {
|
|
106
|
+ uni.hideLoading();
|
|
107
|
+ if(res.status == 200){
|
|
108
|
+ let list = res.list || [];
|
|
109
|
+ list = list.map(i=> ({...i, parentid: i.parent?.id}))
|
|
110
|
+ pageData.categoryList = transform(list, 'id', 'parentid')
|
|
111
|
+ }else{
|
|
112
|
+ uni.showToast({
|
|
113
|
+ icon: 'none',
|
|
114
|
+ title: res.msg || '请求数据失败!'
|
|
115
|
+ });
|
|
116
|
+ }
|
|
117
|
+ })
|
|
118
|
+ }
|
|
119
|
+
|
|
120
|
+ // 页面路由跳转
|
|
121
|
+ function clickPageRouter(type){
|
|
122
|
+ pageData.pageRouter = type;
|
|
123
|
+ switch(type){
|
|
124
|
+ case 'category':
|
|
125
|
+ getCategoryList('one');
|
|
126
|
+ break;
|
|
127
|
+ }
|
|
128
|
+ }
|
|
129
|
+
|
|
130
|
+ onLoad((option) => {
|
|
131
|
+ getCategoryList()
|
|
132
|
+ let data = repositorySearchStore.repositorySearch.data
|
|
133
|
+ searchData.category = data && data.category;
|
|
134
|
+ searchData.title = data && data.title;
|
|
135
|
+ searchData.categoryChangeData = data && data.categoryChangeData
|
|
136
|
+ })
|
|
137
|
+</script>
|
|
138
|
+
|
|
139
|
+<style lang="scss" scoped>
|
|
140
|
+.mask{
|
|
141
|
+ position: fixed;
|
|
142
|
+ left: 0;
|
|
143
|
+ top: 0;
|
|
144
|
+ right: 0;
|
|
145
|
+ bottom: 0;
|
|
146
|
+ background-color: rgba(0, 0, 0, 0.4);
|
|
147
|
+ z-index: 999;
|
|
148
|
+}
|
|
149
|
+.line{
|
|
150
|
+ content: '';
|
|
151
|
+ position: fixed;
|
|
152
|
+ top: 0;
|
|
153
|
+ left: 0;
|
|
154
|
+ z-index: 9999;
|
|
155
|
+ height: 8rpx;
|
|
156
|
+ width: 100%;
|
|
157
|
+ background-color: #EBEBEB;
|
|
158
|
+}
|
|
159
|
+.container{
|
|
160
|
+ position: fixed;
|
|
161
|
+ left: 125rpx;
|
|
162
|
+ top: 0;
|
|
163
|
+ right: 0;
|
|
164
|
+ bottom: 0;
|
|
165
|
+ z-index: 9999;
|
|
166
|
+ background-color: #F7F7F7;
|
|
167
|
+ display: flex;
|
|
168
|
+ flex-direction: column;
|
|
169
|
+ justify-content: space-between;
|
|
170
|
+
|
|
171
|
+ .container_form{
|
|
172
|
+ height: 100%;
|
|
173
|
+ display: flex;
|
|
174
|
+ flex-direction: column;
|
|
175
|
+ flex: 1;
|
|
176
|
+ min-height: 0;
|
|
177
|
+ .item{
|
|
178
|
+ padding: 32rpx;
|
|
179
|
+ }
|
|
180
|
+ }
|
|
181
|
+
|
|
182
|
+ .hospital{
|
|
183
|
+ display: flex;
|
|
184
|
+ align-items: center;
|
|
185
|
+ padding: 32rpx 24rpx 24rpx;
|
|
186
|
+ background-color: #fff;
|
|
187
|
+ .name{
|
|
188
|
+ font-size: 28rpx;
|
|
189
|
+ flex-shrink: 0;
|
|
190
|
+ margin-right: 24rpx;
|
|
191
|
+ }
|
|
192
|
+ .value{
|
|
193
|
+ width: 100%;
|
|
194
|
+ font-size: 22rpx;
|
|
195
|
+ .uni-input{
|
|
196
|
+ font-size: 26rpx;
|
|
197
|
+ }
|
|
198
|
+ }
|
|
199
|
+ }
|
|
200
|
+
|
|
201
|
+ .areas{
|
|
202
|
+ flex: 1;
|
|
203
|
+ min-height: 0;
|
|
204
|
+ margin-top: 16rpx;
|
|
205
|
+ background-color: #fff;
|
|
206
|
+ .areas_item{
|
|
207
|
+ padding: 24rpx;
|
|
208
|
+ border-bottom: 1rpx solid #DEDEDE;
|
|
209
|
+ }
|
|
210
|
+ }
|
|
211
|
+
|
|
212
|
+ .categorys{
|
|
213
|
+ flex: 1;
|
|
214
|
+ min-height: 0;
|
|
215
|
+ margin-top: 16rpx;
|
|
216
|
+ background-color: #fff;
|
|
217
|
+ .categorys_item{
|
|
218
|
+ padding: 24rpx;
|
|
219
|
+ border-bottom: 1rpx solid #DEDEDE;
|
|
220
|
+ }
|
|
221
|
+ }
|
|
222
|
+
|
|
223
|
+ .tabs{
|
|
224
|
+ margin-top: 16rpx;
|
|
225
|
+ background-color: #FBFBFB;
|
|
226
|
+ display: flex;
|
|
227
|
+ flex-wrap: wrap;
|
|
228
|
+ justify-content: space-between;
|
|
229
|
+ gap: 16rpx 0;
|
|
230
|
+ padding: 24rpx 16rpx;
|
|
231
|
+ .tab{
|
|
232
|
+ width: 180rpx;
|
|
233
|
+ height: 60rpx;
|
|
234
|
+ display: flex;
|
|
235
|
+ justify-content: center;
|
|
236
|
+ align-items: center;
|
|
237
|
+ background-color: #F7F7F7;
|
|
238
|
+ font-size: 28rpx;
|
|
239
|
+ position: relative;
|
|
240
|
+ .newicon-xuanzejiaobiao{
|
|
241
|
+ opacity: 0;
|
|
242
|
+ position: absolute;
|
|
243
|
+ right: 0;
|
|
244
|
+ bottom: 0;
|
|
245
|
+ font-size: 38rpx;
|
|
246
|
+ color: #53B9BB;
|
|
247
|
+ }
|
|
248
|
+ &.active{
|
|
249
|
+ background-color: rgba(149, 220, 231, 0.30);
|
|
250
|
+ .newicon-xuanzejiaobiao{
|
|
251
|
+ opacity: 1;
|
|
252
|
+ }
|
|
253
|
+ }
|
|
254
|
+ }
|
|
255
|
+ }
|
|
256
|
+
|
|
257
|
+ .area,
|
|
258
|
+ .category,
|
|
259
|
+ .acceptDate{
|
|
260
|
+ display: flex;
|
|
261
|
+ justify-content: space-between;
|
|
262
|
+ align-items: center;
|
|
263
|
+ padding: 24rpx;
|
|
264
|
+ background-color: #fff;
|
|
265
|
+ margin-top: 24rpx;
|
|
266
|
+ .name{
|
|
267
|
+ font-size: 28rpx;
|
|
268
|
+ flex-shrink: 0;
|
|
269
|
+ margin-right: 24rpx;
|
|
270
|
+ }
|
|
271
|
+ .value{
|
|
272
|
+ flex:1;
|
|
273
|
+ }
|
|
274
|
+ }
|
|
275
|
+
|
|
276
|
+ .container_foot{
|
|
277
|
+ .clear{
|
|
278
|
+ padding: 24rpx;
|
|
279
|
+ font-size: 28rpx;
|
|
280
|
+ background-color: #fff;
|
|
281
|
+ margin: 0 16rpx;
|
|
282
|
+ display: flex;
|
|
283
|
+ align-items: center;
|
|
284
|
+ justify-content: center;
|
|
285
|
+ }
|
|
286
|
+ .foot_btns{
|
|
287
|
+ margin-top: 24rpx;
|
|
288
|
+ display: flex;
|
|
289
|
+ border-top: 1rpx solid #BFBFBF;
|
|
290
|
+ .cancel{
|
|
291
|
+ flex: 1;
|
|
292
|
+ background-color: #fff;
|
|
293
|
+ font-size: 32rpx;
|
|
294
|
+ padding: 24rpx;
|
|
295
|
+ display: flex;
|
|
296
|
+ justify-content: center;
|
|
297
|
+ }
|
|
298
|
+ .confirm{
|
|
299
|
+ flex: 1;
|
|
300
|
+ font-size: 32rpx;
|
|
301
|
+ padding: 24rpx;
|
|
302
|
+ background-color: $uni-primary;
|
|
303
|
+ display: flex;
|
|
304
|
+ justify-content: center;
|
|
305
|
+ color: #fff;
|
|
306
|
+ }
|
|
307
|
+ }
|
|
308
|
+ }
|
|
309
|
+}
|
|
310
|
+</style>
|