Kaynağa Gözat

试验填报,删除

ZaiZai 1 yıl önce
ebeveyn
işleme
b0160018b2

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20240920160659"
+  "value": "20240920161644"
 }

+ 16 - 0
src/api/modules/tentative/detect/test.js

@@ -138,6 +138,22 @@ export default {
             params: form,
         })
     },
+    //删除前的检查
+    async removeBussTabCheck(form) {
+        return HcApi({
+            url: '/api/blade-business/detection/self/remove-buss-tab-check',
+            method: 'post',
+            params: form,
+        })
+    },
+    //自检删除复制的表
+    async removeBussTabForce(form) {
+        return HcApi({
+            url: '/api/blade-business/detection/self/remove-buss-tab-force',
+            method: 'post',
+            params: form,
+        })
+    },
     //自检删除复制的表
     async removeBussTabInfo(form) {
         return HcApi({

+ 2 - 1
src/config/index.json

@@ -1,9 +1,10 @@
 {
     "version": "20230607160059",
     "target1": "http://127.0.0.1:8090",
-    "target": "http://39.108.216.210:8090",
+    "target2": "http://39.108.216.210:8090",
     "target3": "http://192.168.0.125:8090",
     "target4": "http://183.247.216.148:28090",
+    "target": "http://192.168.0.196:8090",
     "socket": "wss://measure.hczcxx.cn/websocket",
     "socket2": "ws://192.168.0.125:9527/websocket",
     "localModel": false,

+ 38 - 8
src/views/tentative/detect/components/ListItem.vue

@@ -256,7 +256,7 @@ import {
     setPosRange,
 } from 'js-fast-way'
 import ossApi from '~api/oss'
-import { HcUploadFileApi } from 'hc-vue3-ui'
+import { HcDelMsg, HcUploadFileApi } from 'hc-vue3-ui'
 import { toPdfPage } from '~uti/btn-auth'
 
 //初始
@@ -853,24 +853,54 @@ const delClick = async ({ pKeyId }, index) => {
     const pkeyIds = getValString(pKeyId)
     if (pkeyIds) {
         delClickLoading.value = true
-        const { error, code, msg } = await dataApi.removeBussTabInfo({
+        const { error, code, msg, data } = await dataApi.removeBussTabCheck({
             pKeyId: pkeyIds,
         })
-        if (!error && code === 200) {
-            window?.$message?.success('操作成功')
-            listDatas.value.splice(index, 1)
-            formData.value.splice(index, 1)
-            chageOrinData()
+        if (error || code !== 200) {
+            window.$message.error(msg)
             delClickLoading.value = false
+            return
+        }
+        const res = getObjValue(data)
+        if (isNullES(res.pkeyId)) {
+            window?.$message?.warning('pkeyId为空')
+            return
+        }
+        if (res.isForceDelete) {
+            //isForceDelete 为ture直接调  为false就提示
+            await removeBussTabForceApi(res.pkeyId, index)
         } else {
-             window.$message.error(msg)
             delClickLoading.value = false
+            HcDelMsg({
+                text: res.msg ?? '确认要删除吗?',
+            }, async (resolve) => {
+                await removeBussTabForceApi(res.pkeyId, index)
+                resolve() //关闭弹窗的回调
+            })
         }
     } else {
         window?.$message?.warning('pkeyId为空')
         delClickLoading.value = false
     }
 }
+
+//确定删除
+const removeBussTabForceApi = async (pkeyIds, index) => {
+    const { error, code, msg } = await dataApi.removeBussTabForce({
+        pKeyId: pkeyIds,
+    })
+    if (!error && code === 200) {
+        window?.$message?.success('操作成功')
+        listDatas.value.splice(index, 1)
+        formData.value.splice(index, 1)
+        chageOrinData()
+        delClickLoading.value = false
+    } else {
+        window.$message.error(msg)
+        delClickLoading.value = false
+    }
+}
+
 const copyClickLoading = ref(false)
 //复制本表
 const copyClick = async (item, index) => {