maotao vor 2 Monaten
Ursprung
Commit
ccb20d4f58
4 geänderte Dateien mit 40 neuen und 7 gelöschten Zeilen
  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 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 62
         "devServer" : {
63 63
             "proxy" : {
64 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 67
                     // "target" : "http://192.168.4.105", //程肖本地
68 68
                     "changeOrigin" : true, //是否跨域
69 69
                     "secure" : false

+ 26 - 2
pages/consumableList/consumableList.vue

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

+ 6 - 3
pages/handler/handler.vue

@@ -75,7 +75,7 @@
75 75
 
76 76
       <!-- 故障处理 -->
77 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 79
           <view class="title title-width">
80 80
 						<text class="required newicon newicon-bitian"></text>
81 81
 						<view class="title-fl-sb">
@@ -257,7 +257,8 @@
257 257
 
258 258
 	// 是否简单处理
259 259
 	const HandleData = reactive({
260
-		simpleness:null
260
+		simpleness:null,
261
+		isSolution:null,
261 262
 	})
262 263
   // 处理图片
263 264
   const handlerImgRef = ref(null)
@@ -728,7 +729,7 @@
728 729
   // 添加耗材
729 730
   function addConsumable(){
730 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 979
 					SummaryData.value = res.list.find(i=>i.key=='itsmSummarySheet')
979 980
 				}
980 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