瀏覽代碼

bug修复

iZaiZaiA 2 年之前
父節點
當前提交
1412420f69

+ 8 - 0
src/api/modules/ledger/query.js

@@ -121,4 +121,12 @@ export default {
             params: form
         }, msg);
     },
+    //删除
+    async theLogRemoveByIds(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-business/contractLog/removeByIds',
+            method: 'post',
+            data: form
+        }, msg);
+    },
 }

+ 62 - 10
src/views/ledger/components/table-list.vue

@@ -25,13 +25,13 @@
                     </el-button>
                 </HcTooltip>
                 <HcTooltip keys="ledger_query_abolish">
-                    <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" @click="batchAbolishClick">
+                    <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" :loading="abolishLoading" @click="batchAbolishClick">
                         <HcIcon name="delete-bin-3"/>
                         <span>批量废除</span>
                     </el-button>
                 </HcTooltip>
                 <HcTooltip keys="ledger_query_delete">
-                    <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" @click="batchDeleteClick">
+                    <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" :loading="deleteLoading" @click="batchDeleteClick">
                         <HcIcon name="delete-bin"/>
                         <span>批量删除</span>
                     </el-button>
@@ -49,7 +49,7 @@
                         <el-button type="primary" size="small" plain @click="handleTableQuery(row)">查询</el-button>
                     </HcTooltip>
                     <HcTooltip keys="ledger_query_table_del">
-                        <el-button type="danger" size="small" plain @click="handleTableDel(row)">删除</el-button>
+                        <el-button type="danger" size="small" plain :disabled="!row.operation" @click="handleTableDel(row)">删除</el-button>
                     </HcTooltip>
                 </template>
             </HcTable>
@@ -217,11 +217,12 @@ const showReportFinish = () => {
 }
 
 //批量废除
+const abolishLoading = ref(false)
 const batchAbolishClick = () => {
     const rows = tableCheckedKeys.value;
     //判断是否满足条件
-    const result = rows.every(({status})=> {
-        return status !== 0 && status !== 3
+    const result = rows.every(({status, operation})=> {
+        return status !== 0 && status !== 3 && operation
     })
     //判断状态
     if (result) {
@@ -238,14 +239,16 @@ const batchAbolishClick = () => {
             }
         })
     } else {
-        window.$message?.warning('未上报的文件不能废除')
+        window.$message?.warning('未上报的文件,和不是自己的文件,不能废除')
     }
 }
 
 //废除勾选的已上报文件
 const batchAbolishSave = async (ids) => {
+    abolishLoading.value = true
     const { error, code } = await queryApi.batchAbolish({ids: ids})
     //处理数据
+    abolishLoading.value = false
     if (!error && code === 200) {
         window.$message?.success('批量废除成功')
         tableCheckedKeys.value = []
@@ -255,7 +258,26 @@ const batchAbolishSave = async (ids) => {
 
 //批量删除
 const batchDeleteClick = () => {
-    window.$message?.warning('暂无接口')
+    const rows = tableCheckedKeys.value;
+    const result = rows.every(({operation})=> {
+        return operation
+    })
+    //判断状态
+    if (result) {
+        const ids = rowsToId(rows)
+        window?.$messageBox?.alert('是否删除勾选的日志文件?', '删除文件', {
+            showCancelButton: true,
+            confirmButtonText: '确定删除',
+            cancelButtonText: '取消',
+            callback: (action) => {
+                if (action === 'confirm') {
+                    theLogRemoveByIds(ids)
+                }
+            }
+        })
+    } else {
+        window.$message?.warning('只能删除自己上报的日志文件')
+    }
 }
 
 //预览、打印
@@ -277,13 +299,43 @@ const previewAndPrintClick = async () => {
 }
 
 //查询
-const handleTableQuery = (row) => {
-    window.$message?.warning('暂无接口')
+const handleTableQuery = ({evisaPdfUrl, pdfUrl}) => {
+    if (evisaPdfUrl) {
+        window.open(evisaPdfUrl,'_blank')
+    } else if (pdfUrl) {
+        window.open(pdfUrl,'_blank')
+    } else {
+        window.$message?.warning('该数据暂无PDF')
+    }
 }
 
 //删除
 const handleTableDel = (row) => {
-    window.$message?.warning('暂无接口')
+    window?.$messageBox?.alert('是否删除勾选的日志文件?', '删除文件', {
+        showCancelButton: true,
+        confirmButtonText: '确定删除',
+        cancelButtonText: '取消',
+        callback: (action) => {
+            if (action === 'confirm') {
+                theLogRemoveByIds([row.id])
+            }
+        }
+    })
+}
+
+//删除
+const deleteLoading = ref(false)
+const theLogRemoveByIds = async (ids) => {
+    deleteLoading.value = true
+    const { error, code } = await queryApi.theLogRemoveByIds({
+        ids: ids
+    })
+    deleteLoading.value = false
+    if (!error && code === 200) {
+        window.$message?.success('删除成功')
+        tableCheckedKeys.value = []
+        getTableData()
+    }
 }
 
 

+ 1 - 1
src/views/tentative/collect/monthly.vue

@@ -13,7 +13,7 @@ import {useAppStore} from "~src/store";
 const router = useRouter()
 const useRoutes = useRoute()
 const useAppState = useAppStore()
-const {getObjValue, getArrValue} = isType()
+//const {getObjValue, getArrValue} = isType()
 
 //全局变量
 const projectId = ref(useAppState.getProjectId);

+ 1 - 1
src/views/tentative/collect/test.vue

@@ -13,7 +13,7 @@ import {useAppStore} from "~src/store";
 const router = useRouter()
 const useRoutes = useRoute()
 const useAppState = useAppStore()
-const {getObjValue, getArrValue} = isType()
+//const {getObjValue, getArrValue} = isType()
 
 //全局变量
 const projectId = ref(useAppState.getProjectId);

+ 1 - 1
src/views/tentative/detect/outside.vue

@@ -13,7 +13,7 @@ import {useAppStore} from "~src/store";
 const router = useRouter()
 const useRoutes = useRoute()
 const useAppState = useAppStore()
-const {getObjValue, getArrValue} = isType()
+//const {getObjValue, getArrValue} = isType()
 
 //全局变量
 const projectId = ref(useAppState.getProjectId);

+ 1 - 1
src/views/tentative/detect/test.vue

@@ -13,7 +13,7 @@ import {useAppStore} from "~src/store";
 const router = useRouter()
 const useRoutes = useRoute()
 const useAppState = useAppStore()
-const {getObjValue, getArrValue} = isType()
+//const {getObjValue, getArrValue} = isType()
 
 //全局变量
 const projectId = ref(useAppState.getProjectId);

+ 1 - 1
src/views/tentative/detect/third.vue

@@ -13,7 +13,7 @@ import {useAppStore} from "~src/store";
 const router = useRouter()
 const useRoutes = useRoute()
 const useAppState = useAppStore()
-const {getObjValue, getArrValue} = isType()
+//const {getObjValue, getArrValue} = isType()
 
 //全局变量
 const projectId = ref(useAppState.getProjectId);

+ 1 - 1
src/views/tentative/device/approach.vue

@@ -13,7 +13,7 @@ import {useAppStore} from "~src/store";
 const router = useRouter()
 const useRoutes = useRoute()
 const useAppState = useAppStore()
-const {getObjValue, getArrValue} = isType()
+//const {getObjValue, getArrValue} = isType()
 
 //全局变量
 const projectId = ref(useAppState.getProjectId);

+ 1 - 1
src/views/tentative/device/employ.vue

@@ -13,7 +13,7 @@ import {useAppStore} from "~src/store";
 const router = useRouter()
 const useRoutes = useRoute()
 const useAppState = useAppStore()
-const {getObjValue, getArrValue} = isType()
+//const {getObjValue, getArrValue} = isType()
 
 //全局变量
 const projectId = ref(useAppState.getProjectId);

+ 1 - 1
src/views/tentative/device/overhaul.vue

@@ -13,7 +13,7 @@ import {useAppStore} from "~src/store";
 const router = useRouter()
 const useRoutes = useRoute()
 const useAppState = useAppStore()
-const {getObjValue, getArrValue} = isType()
+//const {getObjValue, getArrValue} = isType()
 
 //全局变量
 const projectId = ref(useAppState.getProjectId);

+ 1 - 1
src/views/tentative/laboratory/print.vue

@@ -13,7 +13,7 @@ import {useAppStore} from "~src/store";
 const router = useRouter()
 const useRoutes = useRoute()
 const useAppState = useAppStore()
-const {getObjValue, getArrValue} = isType()
+//const {getObjValue, getArrValue} = isType()
 
 //全局变量
 const projectId = ref(useAppState.getProjectId);

+ 1 - 1
src/views/tentative/laboratory/user.vue

@@ -13,7 +13,7 @@ import {useAppStore} from "~src/store";
 const router = useRouter()
 const useRoutes = useRoute()
 const useAppState = useAppStore()
-const {getObjValue, getArrValue} = isType()
+//const {getObjValue, getArrValue} = isType()
 
 //全局变量
 const projectId = ref(useAppState.getProjectId);

+ 1 - 1
src/views/tentative/material/approach.vue

@@ -13,7 +13,7 @@ import {useAppStore} from "~src/store";
 const router = useRouter()
 const useRoutes = useRoute()
 const useAppState = useAppStore()
-const {getObjValue, getArrValue} = isType()
+//const {getObjValue, getArrValue} = isType()
 
 //全局变量
 const projectId = ref(useAppState.getProjectId);

+ 1 - 1
src/views/tentative/material/sampling.vue

@@ -13,7 +13,7 @@ import {useAppStore} from "~src/store";
 const router = useRouter()
 const useRoutes = useRoute()
 const useAppState = useAppStore()
-const {getObjValue, getArrValue} = isType()
+//const {getObjValue, getArrValue} = isType()
 
 //全局变量
 const projectId = ref(useAppState.getProjectId);

+ 1 - 1
src/views/tentative/parameter/compactness.vue

@@ -13,7 +13,7 @@ import {useAppStore} from "~src/store";
 const router = useRouter()
 const useRoutes = useRoute()
 const useAppState = useAppStore()
-const {getObjValue, getArrValue} = isType()
+//const {getObjValue, getArrValue} = isType()
 
 //全局变量
 const projectId = ref(useAppState.getProjectId);

+ 1 - 1
src/views/tentative/parameter/container.vue

@@ -13,7 +13,7 @@ import {useAppStore} from "~src/store";
 const router = useRouter()
 const useRoutes = useRoute()
 const useAppState = useAppStore()
-const {getObjValue, getArrValue} = isType()
+//const {getObjValue, getArrValue} = isType()
 
 //全局变量
 const projectId = ref(useAppState.getProjectId);

+ 1 - 1
src/views/tentative/parameter/density.vue

@@ -13,7 +13,7 @@ import {useAppStore} from "~src/store";
 const router = useRouter()
 const useRoutes = useRoute()
 const useAppState = useAppStore()
-const {getObjValue, getArrValue} = isType()
+//const {getObjValue, getArrValue} = isType()
 
 //全局变量
 const projectId = ref(useAppState.getProjectId);

+ 1 - 1
src/views/tentative/parameter/sieve.vue

@@ -13,7 +13,7 @@ import {useAppStore} from "~src/store";
 const router = useRouter()
 const useRoutes = useRoute()
 const useAppState = useAppStore()
-const {getObjValue, getArrValue} = isType()
+//const {getObjValue, getArrValue} = isType()
 
 //全局变量
 const projectId = ref(useAppState.getProjectId);