Hua 5 hours ago
parent
commit
dc58c274bf
2 changed files with 88 additions and 11 deletions
  1. 15 6
      src/views/InspectDC/Object/Problem/index.vue
  2. 73 5
      src/views/InspectDC/Object/index.vue

+ 15 - 6
src/views/InspectDC/Object/Problem/index.vue

@@ -70,6 +70,7 @@ import card01 from '@/components/card01.vue';
 import { onMounted, ref ,computed  } from "vue";
 import { useRoute, useRouter } from "vue-router";
 import { jumpPage } from "@/utils/page";
+import { showConfirmDialog } from 'vant';
 import request from "@/utils/request";
 import { showSuccessToast,showFailToast  } from 'vant';
 const router = useRoute();
@@ -185,12 +186,20 @@ function save128(){
     rgstrId: formObj.value.rgstrId,
     state: '2',
   }
-  request.post('/bis/insp/genrl/update', data).then((res) => {
-    if (res.success) {
-      showSuccessToast('保存成功!');
-      router1.go(-1)
-    }
-  });
+  showConfirmDialog({
+        title: '提交任务',
+        message:
+            '是否确认问题添加完成,提交任务?',
+        })
+        .then(() => {
+          request.post('/bis/insp/genrl/update', data).then((res) => {
+            if (res.success) {
+              showSuccessToast('保存成功!');
+              router1.go(-1)
+            }
+          });
+        })
+  
 }
 
 function deletePblm(pblmId) {

+ 73 - 5
src/views/InspectDC/Object/index.vue

@@ -16,6 +16,19 @@
           v-model="loading"
           @refresh="getData()"
         >
+        <div class="search-bar" style="padding: 8px;">
+            <van-search
+              v-model="rsvrName"
+              placeholder="请输入对象名称搜索"
+              show-action
+              style="border-radius: 8px; height: 50px;"
+              @clear="handleClear"
+            >
+              <template #action>
+                <van-button size="small" type="primary" @click="handleSearch('0')">搜索</van-button>
+              </template>
+            </van-search>
+          </div>
           <card02
             v-for="item in list1"
             :key="item"
@@ -36,6 +49,19 @@
           /> </van-pull-refresh
       ></van-tab>
       <van-tab :title="titleDC.name2 + '(' + titleDC.num2 + ')'">
+        <div class="search-bar" style="padding: 8px;">
+            <van-search
+              v-model="rsvrName"
+              placeholder="请输入对象名称搜索"
+              show-action
+              style="border-radius: 8px; height: 50px;"
+              @clear="handleClear"
+            >
+              <template #action>
+                <van-button size="small" type="primary" @click="handleSearch('1')">搜索</van-button>
+              </template>
+            </van-search>
+          </div>
         <card02
           v-for="item in list2"
           :key="item"
@@ -52,7 +78,20 @@
           "
       /></van-tab>
       <van-tab :title="titleDC.name3 + '(' + titleDC.num3 + ')'"
-        ><card02
+        >
+        <div class="search-bar" style="padding: 8px;">
+            <van-search
+              v-model="rsvrName"
+              placeholder="请输入对象名称搜索"
+              show-action
+              style="border-radius: 8px; height: 50px;"
+              @clear="handleClear"
+            >
+              <template #action>
+                <van-button size="small" type="primary" @click="handleSearch('2')">搜索</van-button>
+              </template>
+            </van-search>
+          </div><card02
           v-for="item in list3"
           :key="item"
           :id="item.id"
@@ -71,7 +110,7 @@
   </div>
 </template>
 <script setup>
-import { onMounted, ref ,computed  } from "vue";
+import { onMounted, ref ,computed, watch  } from "vue";
 import { useRoute } from "vue-router";
 import card01 from "@/components/card01.vue";
 import card02 from "@/components/card02.vue";
@@ -79,7 +118,8 @@ import { getObjectListDu } from "@/api/inspect";
 import { getBaseByInspectType } from "@/assets/js/base";
 import { renderData } from "@/utils/template";
 import { jumpPage } from "@/utils/page";
-
+import request from "@/utils/request";
+import { showSuccessToast,showFailToast  } from 'vant';
 const route = useRoute();
 const list = ref([]);
 const list1 = ref([]);
@@ -96,9 +136,34 @@ const titleDC = ref({
 const loading = ref(false);
 const inspectType = route.query.inspectType;
 const objectConfig = ref(getBaseByInspectType(inspectType));
+const rsvrName = ref('');
+const active = ref(null);
 function wdcFn() {
   jumpPage("/InspectDC/WDCproblems");
 }
+function handleSearch(state) {
+  if(rsvrName.value === ''){
+    showFailToast('请输入对象名称!');
+    return;
+  }
+  var data = {
+    rsName: rsvrName.value,
+    state:state,
+    pType: "128",
+    presId: localStorage.getItem("userid"),
+  };
+  request.post('/bis/insp/genrl/findPage', data).then((res) => {
+    if(state === '0'){
+      list1.value = res.data.list;
+    }
+    if(state === '1'){
+      list2.value = res.data.list;
+    }
+    if(state === '2'){
+      list3.value = res.data.list;
+    }
+  });
+}
 function countStates(arr) {
   return arr.reduce((counts, item) => {
     const state = item.state;
@@ -119,7 +184,6 @@ function getData() {
     list2.value = list.value.filter(item => item.state === '1');
     list3.value = list.value.filter(item => item.state === '2');
     loading.value = false;
-    console.log(list1.value, list2.value, list3.value);
   });
 
   // list.value = [
@@ -137,7 +201,11 @@ function getData() {
   //   },
   // ];
 }
-
+watch(active, (newVal, oldVal) => {
+  if(newVal !== oldVal){
+    rsvrName.value = '';
+  }
+})
 onMounted(() => {
   getData();
 });