瀏覽代碼

拉取代码

maotao 2 月之前
父節點
當前提交
ccb20d4f58
共有 4 個文件被更改,包括 40 次插入7 次删除
  1. 6 0
      http/api.js
  2. 2 2
      manifest.json
  3. 26 2
      pages/consumableList/consumableList.vue
  4. 6 3
      pages/handler/handler.vue

+ 6 - 0
http/api.js

@@ -370,3 +370,9 @@ export function api_inspectionFormValues(data){
370
   return post("/simple/data/fetchDataList/inspectionFormValues", data);
370
   return post("/simple/data/fetchDataList/inspectionFormValues", data);
371
 }
371
 }
372
 
372
 
373
+/**
374
+ * 常用耗材
375
+ */
376
+export function api_in_consumables(id){
377
+  return post(`/incident/commonlyUse/consumables/${id}`, {});
378
+}

+ 2 - 2
manifest.json

@@ -62,8 +62,8 @@
62
         "devServer" : {
62
         "devServer" : {
63
             "proxy" : {
63
             "proxy" : {
64
                 "/service" : {
64
                 "/service" : {
65
-                    "target" : "http://192.168.3.108", //请求的目标域名
66
-                    // "target" : "http://192.168.4.163", //宋程玉本地
65
+                    // "target" : "http://192.168.3.108", //请求的目标域名
66
+                    "target" : "http://192.168.4.163", //宋程玉本地
67
                     // "target" : "http://192.168.4.105", //程肖本地
67
                     // "target" : "http://192.168.4.105", //程肖本地
68
                     "changeOrigin" : true, //是否跨域
68
                     "changeOrigin" : true, //是否跨域
69
                     "secure" : false
69
                     "secure" : false

+ 26 - 2
pages/consumableList/consumableList.vue

@@ -26,7 +26,8 @@
26
   import { ref, reactive} from 'vue'
26
   import { ref, reactive} from 'vue'
27
   import NumberModal from '@/components/NumberModal.vue';
27
   import NumberModal from '@/components/NumberModal.vue';
28
   import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
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
   import { defaultColor } from '@/static/js/theme.js'
31
   import { defaultColor } from '@/static/js/theme.js'
31
   import { useSetTitle } from '@/share/useSetTitle.js'
32
   import { useSetTitle } from '@/share/useSetTitle.js'
32
   import { useLoginUserStore } from '@/stores/loginUser'
33
   import { useLoginUserStore } from '@/stores/loginUser'
@@ -46,6 +47,7 @@
46
     hasMore: true,//是否有更多数据
47
     hasMore: true,//是否有更多数据
47
     incidentId: undefined,//事件ID
48
     incidentId: undefined,//事件ID
48
     summaryId: undefined,//汇总单ID
49
     summaryId: undefined,//汇总单ID
50
+		categoryId: undefined,//故障现象ID
49
     incidentData: {},//事件对象
51
     incidentData: {},//事件对象
50
     keyWord: '',//搜索的关键词
52
     keyWord: '',//搜索的关键词
51
     isNumber: false,//修改数量弹窗
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
   const search = debounce(getList.bind(null, 0), 500);
164
   const search = debounce(getList.bind(null, 0), 500);
144
   
165
   
@@ -193,6 +214,7 @@
193
     if(dataInfo.keyWord.trim() === ''){
214
     if(dataInfo.keyWord.trim() === ''){
194
       dataInfo.list = [];
215
       dataInfo.list = [];
195
       uni.stopPullDownRefresh();
216
       uni.stopPullDownRefresh();
217
+			getInConsumables();
196
       return;
218
       return;
197
     }
219
     }
198
     
220
     
@@ -236,6 +258,7 @@
236
 						}
258
 						}
237
 					}else{
259
 					}else{
238
 				    dataInfo.hasMore = false;
260
 				    dataInfo.hasMore = false;
261
+						getInConsumables();
239
 				  }
262
 				  }
240
 				}else{
263
 				}else{
241
 				  uni.showToast({
264
 				  uni.showToast({
@@ -260,13 +283,14 @@
260
 		  .then((res) => {
283
 		  .then((res) => {
261
 				dataInfo.itsmZeroStock = res.list.find(i=>i.key=='itsmZeroStock')
284
 				dataInfo.itsmZeroStock = res.list.find(i=>i.key=='itsmZeroStock')
262
 				dataInfo.itsmParentConsumable = res.list.find(i=>i.key=='itsmParentConsumable')
285
 				dataInfo.itsmParentConsumable = res.list.find(i=>i.key=='itsmParentConsumable')
263
-				getList(0);
286
+				getInConsumables();
264
 		  });
287
 		  });
265
 	}
288
 	}
266
 	
289
 	
267
   onLoad((option) => {
290
   onLoad((option) => {
268
     dataInfo.incidentId = option.incidentId;
291
     dataInfo.incidentId = option.incidentId;
269
     dataInfo.summaryId = option.summaryId;
292
     dataInfo.summaryId = option.summaryId;
293
+		dataInfo.categoryId = option.categoryId;
270
     getIncidentDetail();
294
     getIncidentDetail();
271
   })
295
   })
272
   
296
   

+ 6 - 3
pages/handler/handler.vue

@@ -75,7 +75,7 @@
75
 
75
 
76
       <!-- 故障处理 -->
76
       <!-- 故障处理 -->
77
       <template v-if="dataInfo.tabActiveValue === 'doing' && !isInSummaryOrder">
77
       <template v-if="dataInfo.tabActiveValue === 'doing' && !isInSummaryOrder">
78
-        <view class="form_item column" v-if="HandleData.simpleness != 1">
78
+        <view class="form_item column" v-if="HandleData.simpleness != 1 || (HandleData.simpleness==1 && HandleData.isSolution==1)">
79
           <view class="title title-width">
79
           <view class="title title-width">
80
 						<text class="required newicon newicon-bitian"></text>
80
 						<text class="required newicon newicon-bitian"></text>
81
 						<view class="title-fl-sb">
81
 						<view class="title-fl-sb">
@@ -257,7 +257,8 @@
257
 
257
 
258
 	// 是否简单处理
258
 	// 是否简单处理
259
 	const HandleData = reactive({
259
 	const HandleData = reactive({
260
-		simpleness:null
260
+		simpleness:null,
261
+		isSolution:null,
261
 	})
262
 	})
262
   // 处理图片
263
   // 处理图片
263
   const handlerImgRef = ref(null)
264
   const handlerImgRef = ref(null)
@@ -728,7 +729,7 @@
728
   // 添加耗材
729
   // 添加耗材
729
   function addConsumable(){
730
   function addConsumable(){
730
     uni.navigateTo({
731
     uni.navigateTo({
731
-      url: `/pages/consumableList/consumableList?incidentId=${dataInfo.incidentId}&summaryId=${dataInfo.summaryId}`
732
+      url: `/pages/consumableList/consumableList?incidentId=${dataInfo.incidentId}&summaryId=${dataInfo.summaryId}&categoryId=${dataInfo.category.id}`
732
     })
733
     })
733
   }
734
   }
734
 
735
 
@@ -978,6 +979,8 @@
978
 					SummaryData.value = res.list.find(i=>i.key=='itsmSummarySheet')
979
 					SummaryData.value = res.list.find(i=>i.key=='itsmSummarySheet')
979
 				}
980
 				}
980
 				HandleData.simpleness = res.list.find(i=>i.key=='itsmSimpleHandle').value
981
 				HandleData.simpleness = res.list.find(i=>i.key=='itsmSimpleHandle').value
982
+				
983
+				HandleData.isSolution = res.list.find(i=>i.key=='itsmWriteSolution').value
981
 			});
984
 			});
982
 	}
985
 	}
983
 
986