Przeglądaj źródła

场所检查修改排查合格、排查不合格功能,修改post请求参数是String的时候传参不成功 的问题

yin_yu820 1 rok temu
rodzic
commit
c66e209fa5

+ 11 - 0
src/api/siteInspection/siteInspectionService.js

@@ -7,6 +7,17 @@ export default class siteInspectionService {
             inputForm
         )
     }
+    keepOnRecord(ids) {
+       
+        return request.post(
+            '/csjcqk/siteInspection/keepOnRecord',{},{ids: ids}
+        )
+    }
+    keepOnRecordNO(ids) {
+        return request.post(
+            '/csjcqk/siteInspection/keepOnRecordNO',{},{ids: ids}
+        )
+    }
     queryById(id) {
         return request.get(
             '/csjcqk/siteInspection/queryById', { id: id }

+ 2 - 1
src/utils/request.js

@@ -116,7 +116,8 @@ var http = {
                 url: url,
                 method: 'post',
                 data: data,
-                params: qs.stringify(params),
+                params: params,
+                //params: qs.stringify(params),post请求时传String 时传不到后台就注销了
                 config: config
             }).then((response) => {
                 resolve(response);

+ 45 - 13
src/views/activityMan/siteInspection/siteInspectionInfo.vue

@@ -87,11 +87,18 @@
       </van-cell-group>  
     </div>
     <van-button
-      v-if="info.assessment == 0"
+      v-if="info.assessment == 1"
       type="primary"
       class="btn-sub"
-      @click="update"
-      >审核</van-button
+      @click="update(2)"
+      >排查合格</van-button
+    >
+    <van-button
+      v-if="info.assessment == 1"
+      type="primary"
+      class="btn-sub"
+      @click="update(3)"
+      >排查不合格</van-button
     >
   </div>    
   </template>
@@ -166,17 +173,42 @@
     };
       
       // 审核通过
-      const update = () => {
+      const update = (state) => {
         isLoading.value = true;
-        info.value.assessment = 1;
-        new siteInspectionService().save(info.value).then((res) => {
+        info.value.assessment = state;
+        // new siteInspectionService().save(info.value).then((res) => {
+
+        //   isLoading.value = false;
+        //   window.xm.showToast({
+        //      message:"排查成功!"+state
+        //   })
+        //   history.back();
+        // });
+
+
+        if(state==2){
+          new siteInspectionService().keepOnRecord(info.value.id).then((res) => {
+
+            isLoading.value = false;
+            window.xm.showToast({
+              message:"排查成功!"
+            })
+            history.back();
+          });
+        }else{
+          new siteInspectionService().keepOnRecordNO(info.value.id).then((res) => {
+
+            isLoading.value = false;
+            window.xm.showToast({
+              message:"排查成功!"
+            })
+            history.back();
+            });
+        }
+
+        
+
 
-          isLoading.value = false;
-          window.xm.showToast({
-             message:"审核成功!"
-          })
-          history.back();
-        });
       };
       return {
         // 导航栏颜色
@@ -197,7 +229,7 @@
     color: #36a7f3 !important;
   }
   .btn-sub {
-    width: 90%;
+    width: 42%;
     border-radius: 20px;
     margin-left: 5%;
     margin-bottom: 40px;

+ 39 - 4
src/views/activityMan/siteInspection/siteInspectionList.vue

@@ -43,7 +43,7 @@
       title-active-color="#36a7f3"
       @click-tab="onClickTab"
     >
-      <van-tab title="未审核" name="0">
+      <van-tab title="未排查" name="1">
         <van-list
           v-model:loading="loading"
           :finished="finished"
@@ -56,7 +56,7 @@
                 <p style="color: #c4c4c4">
                   {{ item.supervisionTime }}
                 </p>
-                <p style="color: red">待审核</p>
+                <p style="color: red">未排查</p>
               </div>
               <van-cell>
                 <template #title>
@@ -90,7 +90,7 @@
           </van-swipe-cell>
         </van-list>
       </van-tab>
-      <van-tab title="已审核" name="1">
+      <van-tab title="正常" name="2">
         <van-list
           v-model:loading="loading"
           :finished="finished"
@@ -103,7 +103,7 @@
                 <p  style="color: #c4c4c4">
                   {{ item.supervisionTime }}
                 </p>
-                <p style="color: gray">已审核</p>
+                <p style="color: gray">正常</p>
               </div>
               <van-cell>
                 <template #title>
@@ -121,6 +121,41 @@
           </van-swipe-cell>
         </van-list>
       </van-tab>
+
+      <!-- 不合格 -->
+      <van-tab title="不合格" name="3">
+        <van-list
+          v-model:loading="loading"
+          :finished="finished"
+          finished-text="没有更多了"
+          @load="onLoad"
+        >
+          <van-swipe-cell v-for="item in list" :key="item">
+            <div class="list_item" @click="goInfo(item.id)">
+              <div class="item-left">
+                <p  style="color: #c4c4c4">
+                  {{ item.supervisionTime }}
+                </p>
+                <p style="color: orange">不合格</p>
+              </div>
+              <van-cell>
+                <template #title>
+                  {{item.siteName.name}}({{ item.placeDel}})
+                    <!-- <van-text-ellipsis
+                      rows="2"
+                      :content="`${item.siteName.name}(${ item.placeDel})`"
+                    /> -->
+                </template>
+                <template #label>
+                  {{ item.supervisionContent }}
+                </template>
+              </van-cell>
+            </div>
+          </van-swipe-cell>
+        </van-list>
+      </van-tab>
+      <!-- 不合格 -->
+
     </van-tabs>
     <!-- 搜索结果 -->
     <van-list