|
@@ -26,7 +26,8 @@
|
26
|
26
|
import { ref, reactive} from 'vue'
|
27
|
27
|
import NumberModal from '@/components/NumberModal.vue';
|
28
|
28
|
import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
|
29
|
|
- import { api_consumable, getFetchDataList, api_incidentDetail, api_addSummaryDoc, api_incidentCategoryConsumable } from "@/http/api.js"
|
|
29
|
+ import { api_consumable, getFetchDataList, api_incidentDetail,
|
|
30
|
+ api_addSummaryDoc, api_incidentCategoryConsumable, api_in_consumables } from "@/http/api.js"
|
30
|
31
|
import { defaultColor } from '@/static/js/theme.js'
|
31
|
32
|
import { useSetTitle } from '@/share/useSetTitle.js'
|
32
|
33
|
import { useLoginUserStore } from '@/stores/loginUser'
|
|
@@ -46,6 +47,7 @@
|
46
|
47
|
hasMore: true,//是否有更多数据
|
47
|
48
|
incidentId: undefined,//事件ID
|
48
|
49
|
summaryId: undefined,//汇总单ID
|
|
50
|
+ categoryId: undefined,//故障现象ID
|
49
|
51
|
incidentData: {},//事件对象
|
50
|
52
|
keyWord: '',//搜索的关键词
|
51
|
53
|
isNumber: false,//修改数量弹窗
|
|
@@ -139,6 +141,25 @@
|
139
|
141
|
})
|
140
|
142
|
}
|
141
|
143
|
|
|
144
|
+ // 获取常用耗材
|
|
145
|
+ function getInConsumables(){
|
|
146
|
+ uni.showLoading({
|
|
147
|
+ title: "加载中",
|
|
148
|
+ mask: true,
|
|
149
|
+ });
|
|
150
|
+ api_in_consumables(dataInfo.categoryId).then(res => {
|
|
151
|
+ uni.hideLoading();
|
|
152
|
+ if(res.status == 200){
|
|
153
|
+ dataInfo.list = res.data || {};
|
|
154
|
+ }else{
|
|
155
|
+ uni.showToast({
|
|
156
|
+ icon: 'none',
|
|
157
|
+ title: res.msg || '请求数据失败!'
|
|
158
|
+ });
|
|
159
|
+ }
|
|
160
|
+ })
|
|
161
|
+ }
|
|
162
|
+
|
142
|
163
|
// 搜索
|
143
|
164
|
const search = debounce(getList.bind(null, 0), 500);
|
144
|
165
|
|
|
@@ -193,6 +214,7 @@
|
193
|
214
|
if(dataInfo.keyWord.trim() === ''){
|
194
|
215
|
dataInfo.list = [];
|
195
|
216
|
uni.stopPullDownRefresh();
|
|
217
|
+ getInConsumables();
|
196
|
218
|
return;
|
197
|
219
|
}
|
198
|
220
|
|
|
@@ -236,6 +258,7 @@
|
236
|
258
|
}
|
237
|
259
|
}else{
|
238
|
260
|
dataInfo.hasMore = false;
|
|
261
|
+ getInConsumables();
|
239
|
262
|
}
|
240
|
263
|
}else{
|
241
|
264
|
uni.showToast({
|
|
@@ -260,13 +283,14 @@
|
260
|
283
|
.then((res) => {
|
261
|
284
|
dataInfo.itsmZeroStock = res.list.find(i=>i.key=='itsmZeroStock')
|
262
|
285
|
dataInfo.itsmParentConsumable = res.list.find(i=>i.key=='itsmParentConsumable')
|
263
|
|
- getList(0);
|
|
286
|
+ getInConsumables();
|
264
|
287
|
});
|
265
|
288
|
}
|
266
|
289
|
|
267
|
290
|
onLoad((option) => {
|
268
|
291
|
dataInfo.incidentId = option.incidentId;
|
269
|
292
|
dataInfo.summaryId = option.summaryId;
|
|
293
|
+ dataInfo.categoryId = option.categoryId;
|
270
|
294
|
getIncidentDetail();
|
271
|
295
|
})
|
272
|
296
|
|