浏览代码

日志列表重签修改

duy 10 月之前
父节点
当前提交
97ff61edf3
共有 3 个文件被更改,包括 595 次插入421 次删除
  1. 67 60
      src/api/modules/ledger/query.js
  2. 312 173
      src/views/ledger/components/table-list.vue
  3. 216 188
      src/views/uni-app/components/log-form.vue

+ 67 - 60
src/api/modules/ledger/query.js

@@ -1,46 +1,45 @@
-import { HcApi } from '../../request/index'
-
+import { HcApi } from "../../request/index";
 
 export default {
     //获取当前合同段下的日志类型
     async queryLogList(form) {
         return HcApi({
-            url: '/api/blade-business/contractLog/queryCurrentContractLogList',
-            method: 'get',
+            url: "/api/blade-business/contractLog/queryCurrentContractLogList",
+            method: "get",
             params: form,
-        })
+        });
     },
     //获取当前日志类型的填报人
     async queryFillUser(form) {
         return HcApi({
-            url: '/api/blade-business/contractLog/queryFillUser',
-            method: 'get',
+            url: "/api/blade-business/contractLog/queryFillUser",
+            method: "get",
             params: form,
-        })
+        });
     },
     //施工日志分页
     async constructionLogPage(form) {
         return HcApi({
-            url: '/api/blade-business/contractLog/constructionLogPage',
-            method: 'post',
+            url: "/api/blade-business/contractLog/constructionLogPage",
+            method: "post",
             data: form,
-        })
+        });
     },
     //批量废除
     async batchAbolish(form) {
         return HcApi({
-            url: '/api/blade-business/contractLog/batchAbolish',
-            method: 'post',
+            url: "/api/blade-business/contractLog/batchAbolish",
+            method: "post",
             params: form,
-        })
+        });
     },
     //获取合同段当前日志节点下的填报日期记录
     async getSubmitLogDateList(form) {
         return HcApi({
-            url: '/api/blade-business/contractLog/getSubmitLogDateList',
-            method: 'post',
+            url: "/api/blade-business/contractLog/getSubmitLogDateList",
+            method: "post",
             params: form,
-        })
+        });
     },
     //清表生成html
     // async getExcelHtml(form) {
@@ -52,114 +51,122 @@ export default {
     // },
     async getExcelHtml(form) {
         return HcApi({
-            url: '/api/blade-manager/exceltab/get-excel-html-two',
-            method: 'get',
+            url: "/api/blade-manager/exceltab/get-excel-html-two",
+            method: "get",
             params: form,
-        })
+        });
     },
     //获取表单数据
     async getBussDataInfo(form) {
         return HcApi({
-            url: '/api/blade-manager/exceltab/get-the-log-business-data',
-            method: 'get',
+            url: "/api/blade-manager/exceltab/get-the-log-business-data",
+            method: "get",
             params: form,
-        })
+        });
     },
     //获取表单数据
     async getTheLogBusinessData(form) {
         return HcApi({
-            url: '/api/blade-manager/exceltab/get-the-log-business-data',
-            method: 'get',
+            url: "/api/blade-manager/exceltab/get-the-log-business-data",
+            method: "get",
             params: form,
-        })
+        });
     },
     //填报页面数据保存
     async saveExcelBussData(form) {
         return HcApi({
-            url: '/api/blade-manager/exceltab/save_log_first_buss_data',
-            method: 'post',
+            url: "/api/blade-manager/exceltab/save_log_first_buss_data",
+            method: "post",
             data: form,
-        })
+        });
     },
     //单表pdf预览
     async getBussPdfInfo(form) {
         return HcApi({
-            url: '/api/blade-manager/exceltab/get-the-log-pdfInfo',
-            method: 'get',
+            url: "/api/blade-manager/exceltab/get-the-log-pdfInfo",
+            method: "get",
             params: form,
-        })
+        });
     },
     //获取当前日志资料关联的工序节点信息
     async queryCurrentLogSelectProcessList(form) {
         return HcApi({
-            url: '/api/blade-business/contractLog/queryCurrentLogSelectProcessList',
-            method: 'post',
+            url: "/api/blade-business/contractLog/queryCurrentLogSelectProcessList",
+            method: "post",
             params: form,
-        })
+        });
     },
     //获取当前资料的任务状态
     async checkTheLogTaskStatus(form) {
         return HcApi({
-            url: '/api/blade-business/contractLog/checkTheLogTaskStatus',
-            method: 'get',
+            url: "/api/blade-business/contractLog/checkTheLogTaskStatus",
+            method: "get",
             params: form,
-        })
+        });
     },
     //预览、打印
     async theLogPreviewAndPrint(form) {
         return HcApi({
-            url: '/api/blade-business/contractLog/theLogPreviewAndPrint',
-            method: 'post',
+            url: "/api/blade-business/contractLog/theLogPreviewAndPrint",
+            method: "post",
             data: form,
-        })
+        });
     },
     //废除
     async theLogOneAbolish(form) {
         return HcApi({
-            url: '/api/blade-business/contractLog/oneAbolish',
-            method: 'get',
+            url: "/api/blade-business/contractLog/oneAbolish",
+            method: "get",
             params: form,
-        })
+        });
     },
     //删除
     async theLogRemoveByIds(form) {
         return HcApi({
-            url: '/api/blade-business/contractLog/removeByIds',
-            method: 'post',
+            url: "/api/blade-business/contractLog/removeByIds",
+            method: "post",
             data: form,
-        })
+        });
     },
     //获取当前合同段下本日志节点的填报资料日期树
     async queryReportLogTimeTree(form) {
         return HcApi({
-            url: '/api/blade-business/contractLog/queryReportLogTimeTree',
-            method: 'get',
+            url: "/api/blade-business/contractLog/queryReportLogTimeTree",
+            method: "get",
             params: form,
-        })
+        });
     },
     //获取填报记录
     async queryLogTimeTreeList(form) {
         return HcApi({
-            url: '/api/blade-business/contractLog/queryLogList',
-            method: 'get',
+            url: "/api/blade-business/contractLog/queryLogList",
+            method: "get",
             params: form,
-        })
+        });
     },
     //复制任意时间
     async copyTheLogBusinessData(form) {
         return HcApi({
-            url: '/api/blade-manager/exceltab/copy-the-log-business-data',
-            method: 'get',
+            url: "/api/blade-manager/exceltab/copy-the-log-business-data",
+            method: "get",
             params: form,
-        })
+        });
     },
 
     //1、删除施工日志对应的表数据记录信息接口POST:/api/blade-manager/exceltab/removeLogTab
     async removeLogTab(form) {
         return HcApi({
-            url: '/api/blade-manager/exceltab/removeLogTab',
-            method: 'post',
+            url: "/api/blade-manager/exceltab/removeLogTab",
+            method: "post",
             params: form,
-        })
+        });
+    },
+    //日志列表一键重签
+    async logReSigningEVisa(form) {
+        return HcApi({
+            url: "/api/blade-business/task/logReSigningEVisa",
+            method: "post",
+            data: form,
+        });
     },
-}
+};

+ 312 - 173
src/views/ledger/components/table-list.vue

@@ -3,11 +3,24 @@
         <HcNewCard>
             <template #header>
                 <div class="w-64">
-                    <HcDatePicker :dates="betweenTime" clearable @change="betweenTimeUpdate" />
+                    <HcDatePicker
+                        :dates="betweenTime"
+                        clearable
+                        @change="betweenTimeUpdate"
+                    />
                 </div>
                 <div class="w-40 ml-3">
-                    <el-select v-model="searchForm.createUser" block clearable placeholder="请选择记录人">
-                        <el-option v-for="item in recordData" :label="item.userName" :value="item.userId" />
+                    <el-select
+                        v-model="searchForm.createUser"
+                        block
+                        clearable
+                        placeholder="请选择记录人"
+                    >
+                        <el-option
+                            v-for="item in recordData"
+                            :label="item.userName"
+                            :value="item.userId"
+                        />
                     </el-select>
                 </div>
                 <div class="ml-2">
@@ -20,8 +33,12 @@
             <template #extra>
                 <HcTooltip keys="ledger_query_report">
                     <el-button
-                        :disabled="tableCheckedKeys.length <= 0" :loading="reportLoading" hc-btn
-                        color="#FF976A" style="color: white;" @click="reportModalClick"
+                        :disabled="tableCheckedKeys.length <= 0"
+                        :loading="reportLoading"
+                        hc-btn
+                        color="#FF976A"
+                        style="color: white"
+                        @click="reportModalClick"
                     >
                         <HcIcon name="send-plane-2" />
                         <span>批量上报</span>
@@ -29,8 +46,11 @@
                 </HcTooltip>
                 <HcTooltip keys="ledger_query_abolish">
                     <el-button
-                        :disabled="tableCheckedKeys.length <= 0" :loading="abolishLoading" hc-btn
-                        color="#A16222" @click="batchAbolishClick"
+                        :disabled="tableCheckedKeys.length <= 0"
+                        :loading="abolishLoading"
+                        hc-btn
+                        color="#A16222"
+                        @click="batchAbolishClick"
                     >
                         <HcIcon name="delete-bin-3" />
                         <span>批量废除</span>
@@ -38,8 +58,11 @@
                 </HcTooltip>
                 <HcTooltip keys="ledger_query_delete">
                     <el-button
-                        :disabled="tableCheckedKeys.length <= 0" :loading="deleteLoading" hc-btn
-                        color="#e03997" @click="batchDeleteClick"
+                        :disabled="tableCheckedKeys.length <= 0"
+                        :loading="deleteLoading"
+                        hc-btn
+                        color="#e03997"
+                        @click="batchDeleteClick"
                     >
                         <HcIcon name="delete-bin" />
                         <span>批量删除</span>
@@ -47,26 +70,52 @@
                 </HcTooltip>
                 <HcTooltip keys="ledger_query_print">
                     <el-button
-                        :disabled="tableCheckedKeys.length <= 0" :loading="previewPrintLoading" hc-btn
-                        color="#567722" @click="previewAndPrintClick"
+                        :disabled="tableCheckedKeys.length <= 0"
+                        :loading="previewPrintLoading"
+                        hc-btn
+                        color="#567722"
+                        @click="previewAndPrintClick"
                     >
                         <HcIcon name="printer" />
                         <span>批量预览/打印</span>
                     </el-button>
                 </HcTooltip>
+                <el-button
+                    :disabled="tableCheckedKeys.length <= 0"
+                    :loading="signLoading"
+                    hc-btn
+                    type="primary"
+                    @click="resignClick"
+                    >re-sign</el-button
+                >
             </template>
             <HcTable
-                ref="tableListRef" :column="tableListColumn" :datas="tableListData" :loading="tableLoading"
-                is-new :index-style="{ width: 60 }" is-check :check-style="{ width: 29 }"
+                ref="tableListRef"
+                :column="tableListColumn"
+                :datas="tableListData"
+                :loading="tableLoading"
+                is-new
+                :index-style="{ width: 60 }"
+                is-check
+                :check-style="{ width: 29 }"
                 @selection-change="tableSelectionChange"
             >
                 <template #action="{ row }">
                     <HcTooltip keys="ledger_query_table_query">
-                        <el-button plain size="small" type="primary" @click="handleTableQuery(row)">查询</el-button>
+                        <el-button
+                            plain
+                            size="small"
+                            type="primary"
+                            @click="handleTableQuery(row)"
+                            >查询</el-button
+                        >
                     </HcTooltip>
                     <HcTooltip keys="ledger_query_table_del">
                         <el-button
-                            :disabled="!row.operation || row.status !== 0" plain size="small" type="danger"
+                            :disabled="!row.operation || row.status !== 0"
+                            plain
+                            size="small"
+                            type="danger"
                             @click="handleTableDel(row)"
                         >
                             删除
@@ -96,323 +145,413 @@
             @hide="showReportModal = false"
             @tag-close="reportTaskTagClose"
         />
+        <!-- 一键重签弹窗 -->
+        <hc-new-dialog
+            v-model="resignModal"
+            title="一键重签"
+            widths="38rem"
+            :loading="signLoading"
+            @close="cancelresign"
+            @save="signClick"
+        >
+            <div>
+                是否重新生成pdf:
+                <el-radio-group v-model="resignModalRadio">
+                    <el-radio :value="0">否</el-radio>
+                    <el-radio :value="1">是</el-radio>
+                </el-radio-group>
+            </div>
+        </hc-new-dialog>
     </div>
 </template>
 
 <script setup>
-import { nextTick, ref, watch } from 'vue'
-import queryApi from '~api/ledger/query'
-import { eVisaTaskCheckApi } from '~api/other'
-import { arrToId, getArrValue, getObjValue, isString } from 'js-fast-way'
-import { toPdfPage } from '~uti/btn-auth'
+import { nextTick, ref, watch } from "vue";
+import queryApi from "~api/ledger/query";
+import { eVisaTaskCheckApi } from "~api/other";
+import {
+    arrToId,
+    getArrValue,
+    getObjValue,
+    isString,
+    arrToKey,
+} from "js-fast-way";
+import { toPdfPage } from "~uti/btn-auth";
 
 //参数
 const props = defineProps({
     projectId: {
         type: [String, Number],
-        default: '',
+        default: "",
     },
     contractId: {
         type: [String, Number],
-        default: '',
+        default: "",
     },
     items: {
         type: Object,
         default: () => ({}),
     },
-})
+});
 
 //变量
-const projectId = ref(props.projectId)
-const contractId = ref(props.contractId)
-const menuItem = ref(props.items)
+const projectId = ref(props.projectId);
+const contractId = ref(props.contractId);
+const menuItem = ref(props.items);
 
 //监听
-watch(() => [
-    props.projectId,
-    props.contractId,
-    props.items,
-], ([pid, cid, item]) => {
-    projectId.value = pid
-    contractId.value = cid
-    menuItem.value = item
-    getQueryData()
-})
+watch(
+    () => [props.projectId, props.contractId, props.items],
+    ([pid, cid, item]) => {
+        projectId.value = pid;
+        contractId.value = cid;
+        menuItem.value = item;
+        getQueryData();
+    }
+);
 
 //渲染完成
 nextTick(() => {
-    getQueryData()
-})
+    getQueryData();
+});
 
 //获取相关数据
 const getQueryData = () => {
-    searchClick()
-    queryFillUser()
-}
+    searchClick();
+    queryFillUser();
+};
 
 //获取记录人数据
-const recordData = ref([])
+const recordData = ref([]);
 const queryFillUser = async () => {
-    const { primaryKeyId } = menuItem.value
+    const { primaryKeyId } = menuItem.value;
     const { data } = await queryApi.queryFillUser({
         contractId: contractId.value,
         primaryKeyId: primaryKeyId,
-    })
-    recordData.value = getArrValue(data)
-}
+    });
+    recordData.value = getArrValue(data);
+};
 
 //搜索表单
-const searchForm = ref({ queryTime: '', createUser: null, current: 1, size: 20, total: 0 })
+const searchForm = ref({
+    queryTime: "",
+    createUser: null,
+    current: 1,
+    size: 20,
+    total: 0,
+});
 
 //日期时间被选择
-const betweenTime = ref(null)
+const betweenTime = ref(null);
 const betweenTimeUpdate = ({ arr, query }) => {
-    betweenTime.value = arr
-    searchForm.value.queryTime = query
-}
+    betweenTime.value = arr;
+    searchForm.value.queryTime = query;
+};
 
 //搜索
 const searchClick = () => {
-    searchForm.value.current = 1
-    getTableData()
-}
+    searchForm.value.current = 1;
+    getTableData();
+};
 
 //分页被点击
 const pageChange = ({ current, size }) => {
-    searchForm.value.current = current
-    searchForm.value.size = size
-    getTableData()
-}
+    searchForm.value.current = current;
+    searchForm.value.size = size;
+    getTableData();
+};
 
 //获取数据
-const tableLoading = ref(false)
+const tableLoading = ref(false);
 const tableListColumn = ref([
-    { key: 'recordTime', name: '记录日期' },
-    { key: 'statusValue', name: '流程状态' },
-    { key: 'createUserName', name: '记录人员' },
-    { key: 'action', name: '操作', width: 200 },
-])
-const tableListData = ref([])
+    { key: "recordTime", name: "记录日期" },
+    { key: "statusValue", name: "流程状态" },
+    { key: "createUserName", name: "记录人员" },
+    { key: "action", name: "操作", width: 200 },
+]);
+const tableListData = ref([]);
 const getTableData = async () => {
     //初始数据处理
-    tableLoading.value = true
-    const { primaryKeyId } = menuItem.value
-    tableListRef.value?.clearSelection()
-    tableCheckedKeys.value = []
+    tableLoading.value = true;
+    const { primaryKeyId } = menuItem.value;
+    tableListRef.value?.clearSelection();
+    tableCheckedKeys.value = [];
     //请求数据
     const { error, code, data } = await queryApi.constructionLogPage({
         ...searchForm.value,
         wbsNodeId: primaryKeyId,
         projectId: projectId.value,
         contractId: contractId.value,
-    })
-    console.log(data)
+    });
+    console.log(data);
     //处理数据
-    tableLoading.value = false
+    tableLoading.value = false;
     if (!error && code === 200) {
-        tableListData.value = getArrValue(data['records'])
-        searchForm.value.total = data.total || 0
+        tableListData.value = getArrValue(data["records"]);
+        searchForm.value.total = data.total || 0;
     } else {
-        tableListData.value = []
-        searchForm.value.total = 0
+        tableListData.value = [];
+        searchForm.value.total = 0;
     }
-}
+};
 
 //多选
-const tableListRef = ref(null)
-const tableCheckedKeys = ref([])
+const tableListRef = ref(null);
+const tableCheckedKeys = ref([]);
 const tableSelectionChange = (rows) => {
     tableCheckedKeys.value = rows.filter((item) => {
-        return (item ?? '') !== ''
-    })
-}
+        return (item ?? "") !== "";
+    });
+};
 
 //批量上报
-const reportIds = ref('')
-const reportTaskName = ref('')
-const reportDatas = ref([])
-const reportLoading = ref(false)
-const showReportModal = ref(false)
+const reportIds = ref("");
+const reportTaskName = ref("");
+const reportDatas = ref([]);
+const reportLoading = ref(false);
+const showReportModal = ref(false);
 const reportModalClick = async () => {
-    const rows = tableCheckedKeys.value
+    const rows = tableCheckedKeys.value;
     //判断是否满足条件
     const result = rows.every(({ status }) => {
-        return status !== 1 && status !== 2
-    })
+        return status !== 1 && status !== 2;
+    });
     //判断状态
     if (result) {
-        reportLoading.value = true
+        reportLoading.value = true;
         const taskCheck = await eVisaTaskCheckApi({
             projectId: projectId.value,
             contractId: contractId.value,
-        })
+        });
         if (taskCheck) {
             //初始ID
-            const row = getObjValue(rows[0])
-            reportIds.value = arrToId(rows)
+            const row = getObjValue(rows[0]);
+            reportIds.value = arrToId(rows);
             //设置任务数据
-            let reportDataArr = []
-            rows.forEach(item => {
+            let reportDataArr = [];
+            rows.forEach((item) => {
                 reportDataArr.push({
                     id: item?.id,
                     name: item?.fileName,
-                })
-            })
-            reportDatas.value = reportDataArr
+                });
+            });
+            reportDatas.value = reportDataArr;
             //设置任务名称
-            reportTaskName.value = rows.length > 1 ? `${row.fileName}等${rows.length}个文件` : row.fileName
-            reportLoading.value = false
-            showReportModal.value = true
+            reportTaskName.value =
+                rows.length > 1
+                    ? `${row.fileName}等${rows.length}个文件`
+                    : row.fileName;
+            reportLoading.value = false;
+            showReportModal.value = true;
         } else {
-            reportLoading.value = false
+            reportLoading.value = false;
         }
     } else {
-        window.$message?.warning('已上报的文件不能进行再次上报,若要重新上报,要先撤回之前的上报,再重新上报')
+        window.$message?.warning(
+            "已上报的文件不能进行再次上报,若要重新上报,要先撤回之前的上报,再重新上报"
+        );
     }
-}
+};
 
 //上报的审批内容移除
 const reportTaskTagClose = (index) => {
-    const row = tableCheckedKeys.value[index]
-    tableListRef.value?.toggleRowSelection(row, false)
-}
+    const row = tableCheckedKeys.value[index];
+    tableListRef.value?.toggleRowSelection(row, false);
+};
 
 //上报完成
 const showReportFinish = () => {
-    showReportModal.value = false
-    getTableData()
-}
+    showReportModal.value = false;
+    getTableData();
+};
 
 //批量废除
-const abolishLoading = ref(false)
+const abolishLoading = ref(false);
 const batchAbolishClick = () => {
-    const rows = tableCheckedKeys.value
+    const rows = tableCheckedKeys.value;
     //判断是否满足条件
     const result = rows.every(({ status, operation }) => {
-        return status !== 0 && status !== 3 && operation
-    })
+        return status !== 0 && status !== 3 && operation;
+    });
     //判断状态
     if (result) {
         //拼接ID
-        const ids = arrToId(rows)
-        window?.$messageBox?.alert('是否废除勾选的已上报文件?', '废除文件', {
+        const ids = arrToId(rows);
+        window?.$messageBox?.alert("是否废除勾选的已上报文件?", "废除文件", {
             showCancelButton: true,
-            confirmButtonText: '确定废除',
-            cancelButtonText: '取消',
+            confirmButtonText: "确定废除",
+            cancelButtonText: "取消",
             callback: (action) => {
-                if (action === 'confirm') {
-                    batchAbolishSave(ids)
+                if (action === "confirm") {
+                    batchAbolishSave(ids);
                 }
             },
-        })
+        });
     } else {
-        window.$message?.warning('未上报的文件,和不是自己的文件,不能废除')
+        window.$message?.warning("未上报的文件,和不是自己的文件,不能废除");
     }
-}
+};
 
 //废除勾选的已上报文件
 const batchAbolishSave = async (ids) => {
-    abolishLoading.value = true
-    const { error, code } = await queryApi.batchAbolish({ ids: ids, projectId:projectId.value, contractId:contractId.value })
+    abolishLoading.value = true;
+    const { error, code } = await queryApi.batchAbolish({
+        ids: ids,
+        projectId: projectId.value,
+        contractId: contractId.value,
+    });
     //处理数据
-    abolishLoading.value = false
+    abolishLoading.value = false;
     if (!error && code === 200) {
-        window.$message?.success('批量废除成功')
-        tableCheckedKeys.value = []
-        getTableData()
+        window.$message?.success("批量废除成功");
+        tableCheckedKeys.value = [];
+        getTableData();
     }
-}
+};
 
 //批量删除
 const batchDeleteClick = () => {
-    const rows = tableCheckedKeys.value
+    const rows = tableCheckedKeys.value;
     //判断是否满足条件
     const result = rows.every(({ status, operation }) => {
-        return status === 0 && operation
-    })
+        return status === 0 && operation;
+    });
     //判断状态
     if (result) {
-        const ids = arrToId(rows)
-        window?.$messageBox?.alert('是否删除勾选的日志文件?', '删除文件', {
+        const ids = arrToId(rows);
+        window?.$messageBox?.alert("是否删除勾选的日志文件?", "删除文件", {
             showCancelButton: true,
-            confirmButtonText: '确定删除',
-            cancelButtonText: '取消',
+            confirmButtonText: "确定删除",
+            cancelButtonText: "取消",
             callback: (action) => {
-                if (action === 'confirm') {
-                    theLogRemoveByIds(ids)
+                if (action === "confirm") {
+                    theLogRemoveByIds(ids);
                 }
             },
-        })
+        });
     } else {
-        window.$message?.warning('只能删除自己的未上报日志文件')
+        window.$message?.warning("只能删除自己的未上报日志文件");
     }
-}
+};
 
 //预览、打印
-const previewPrintLoading = ref(false)
+const previewPrintLoading = ref(false);
 const previewAndPrintClick = async () => {
-    previewPrintLoading.value = true
-    const rows = tableCheckedKeys.value
-    const rowsIds = arrToId(rows)
-    const ids = rowsIds.split(',')
+    previewPrintLoading.value = true;
+    const rows = tableCheckedKeys.value;
+    const rowsIds = arrToId(rows);
+    const ids = rowsIds.split(",");
     const { error, code, data } = await queryApi.theLogPreviewAndPrint({
         ids: ids,
-    })
+    });
     //处理数据
-    previewPrintLoading.value = false
-    const res = isString(data) ? data || '' : ''
+    previewPrintLoading.value = false;
+    const res = isString(data) ? data || "" : "";
     if (!error && code === 200 && res) {
-        toPdfPage(res)
+        toPdfPage(res);
         //window.open(res, '_blank')
     }
-}
+};
 
 //查询
 const handleTableQuery = ({ evisaPdfUrl, pdfUrl }) => {
     if (evisaPdfUrl) {
-        toPdfPage(evisaPdfUrl)
+        toPdfPage(evisaPdfUrl);
         //window.open(evisaPdfUrl, '_blank')
     } else if (pdfUrl) {
-        toPdfPage(pdfUrl)
+        toPdfPage(pdfUrl);
         //window.open(pdfUrl, '_blank')
     } else {
-        window.$message?.warning('该数据暂无PDF')
+        window.$message?.warning("该数据暂无PDF");
     }
-}
+};
 
 //删除
 const handleTableDel = ({ id, status, operation }) => {
     //判断是否满足条件
     if (status === 0 && operation) {
-        window?.$messageBox?.alert('是否删除勾选的日志文件?', '删除文件', {
+        window?.$messageBox?.alert("是否删除勾选的日志文件?", "删除文件", {
             showCancelButton: true,
-            confirmButtonText: '确定删除',
-            cancelButtonText: '取消',
+            confirmButtonText: "确定删除",
+            cancelButtonText: "取消",
             callback: (action) => {
-                if (action === 'confirm') {
-                    theLogRemoveByIds([id])
+                if (action === "confirm") {
+                    theLogRemoveByIds([id]);
                 }
             },
-        })
+        });
     } else {
-        window.$message?.warning('只能删除自己的未上报日志文件')
+        window.$message?.warning("只能删除自己的未上报日志文件");
     }
-}
+};
 
 //删除
-const deleteLoading = ref(false)
+const deleteLoading = ref(false);
 const theLogRemoveByIds = async (ids) => {
-    deleteLoading.value = true
+    deleteLoading.value = true;
     const { error, code } = await queryApi.theLogRemoveByIds({
         ids: ids,
-    })
-    deleteLoading.value = false
+    });
+    deleteLoading.value = false;
     if (!error && code === 200) {
-        window.$message?.success('删除成功')
-        tableCheckedKeys.value = []
-        getTableData()
+        window.$message?.success("删除成功");
+        tableCheckedKeys.value = [];
+        getTableData();
     }
-}
+};
+
+//一键重签
+const signLoading = ref(false);
+const resignModal = ref(false);
+const resignModalRadio = ref(0);
+const resignClick = async () => {
+    const rows = tableCheckedKeys.value;
+    if (rows.length <= 0) {
+        window.$message?.warning("请先勾选已审批的数据");
+        return;
+    }
+    resignModal.value = true;
+};
+const excelIdVal = ref("");
+const signClick = async () => {
+    const rows = tableCheckedKeys.value;
+    //获取任务id
+    const taskIds = arrToKey(rows, "id");
+    const idsArr = taskIds.split(",");
+    let isCan = idsArr.some((ele) => ele === "" || ele == -1);
+    console.log(isCan, "isCan");
+    if (isCan) {
+        window.$message?.warning("参数异常,暂不支持该操作");
+        return;
+    }
+    //发起请求
+    signLoading.value = true;
+    const { primaryKeyId } = menuItem.value;
+    const { excelId } = menuItem.value;
+    excelIdVal.value = excelId > 0 ? excelId + "" : "";
+    const { error, code, msg } = await queryApi.logReSigningEVisa({
+        nodePrimaryKeyId: primaryKeyId,
+        logPkeyId: excelIdVal.value,
+        type: resignModalRadio.value,
+        taskIds: taskIds,
+    });
+    //处理数据
+    signLoading.value = false;
+
+    if (!error && code === 200) {
+        window.$message?.success(
+            msg ?? "提交成功,请请耐心等待重签,可继续操作其它的功能。"
+        );
+        getTableData().then();
+    } else {
+        window.$message?.error(msg ?? "操作失败");
+    }
+    resignModal.value = false;
+};
+const cancelresign = () => {
+    resignModalRadio.value = 0;
+    resignModal.value = false;
+};
 </script>
 
 <style lang="scss" scoped>

+ 216 - 188
src/views/uni-app/components/log-form.vue

@@ -1,89 +1,98 @@
 <template>
     <div class="hc-uni-app-table-form" :class="[editType]">
-        <hc-table-form ref="tableFormRef" :form="tableFormInfo" :html="excelHtml" :scroll="false" :pkey="appItem.excelId" @render="tableFormRender" />
+        <hc-table-form
+            ref="tableFormRef"
+            :form="tableFormInfo"
+            :html="excelHtml"
+            :scroll="false"
+            :pkey="appItem.excelId"
+            @render="tableFormRender"
+        />
     </div>
 </template>
 
 <script setup>
-import { onMounted, ref, watch } from 'vue'
-import { useAppStore } from '~src/store'
-import queryApi from '~api/ledger/query'
-import { getArrValue, getObjVal, getObjValue, isString } from 'js-fast-way'
+import { onMounted, ref, watch } from "vue";
+import { useAppStore } from "~src/store";
+import queryApi from "~api/ledger/query";
+import { getArrValue, getObjVal, getObjValue, isString } from "js-fast-way";
 
 const props = defineProps({
     option: {
         type: Object,
         default: () => ({}),
     },
-})
+});
 
 //初始变量
-const useAppState = useAppStore()
+const useAppState = useAppStore();
 
 //基础变量
-const appItem = ref(props.option)
-const tableFormRef = ref(null)
-const editType = ref('form')
+const appItem = ref(props.option);
+const tableFormRef = ref(null);
+const editType = ref("form");
 
 //深度监听
-watch(() => [
-    props.option,
-], ([option]) => {
-    appItem.value = getObjValue(option)
-    getDataApi()
-}, { deep: true })
+watch(
+    () => [props.option],
+    ([option]) => {
+        appItem.value = getObjValue(option);
+        getDataApi();
+    },
+    { deep: true }
+);
 
 //渲染完成
 onMounted(() => {
     //设置主题
-    useAppState.setTheme('light')
-    useAppState.setThemeVal('light')
+    useAppState.setTheme("light");
+    useAppState.setThemeVal("light");
     if (getObjVal(appItem.value)) {
-        getDataApi()
+        getDataApi();
     }
-    editTypeClick('form')
+    editTypeClick("form");
     //接受app传递过来的消息
-    window.addEventListener('message', (event) => {
-        if (event.data.source === 'app') {
-            setMessage(event.data)
+    window.addEventListener("message", (event) => {
+        if (event.data.source === "app") {
+            setMessage(event.data);
         }
-    })
-})
+    });
+});
 
 //设置消息
 const setMessage = ({ data, type }) => {
-    if (type === 'editTypeClick') {
-        editTypeClick(data)
-    } else if (type === 'formSave') {
-        toSaveClick()
-    } else if (type === 'pageTap') {
-        console.log('pageTap', data)
-        getBussDataInfo(Number(data))
-    } else if (type === 'addForm') {
-        addTableFormClick()
-    } else if (type === 'delForm') {
-        delTableFormClick()
-    } else if (type === 'linkIds') {
-        let ids = data ? JSON.parse(data) : []
-        linkTableFormClick(ids)
-    } else if (type === 'copyFormData') {
-        copyTableFormClick()
-    } else if (type === 'getPdfUrl') {
-        getBussPdfInfo()
+    if (type === "editTypeClick") {
+        editTypeClick(data);
+    } else if (type === "formSave") {
+        toSaveClick();
+    } else if (type === "pageTap") {
+        console.log("pageTap", data);
+        getBussDataInfo(Number(data));
+    } else if (type === "addForm") {
+        addTableFormClick();
+    } else if (type === "delForm") {
+        delTableFormClick();
+    } else if (type === "linkIds") {
+        let ids = data ? JSON.parse(data) : [];
+        linkTableFormClick(ids);
+    } else if (type === "copyFormData") {
+        copyTableFormClick();
+    } else if (type === "getPdfUrl") {
+        getBussPdfInfo();
     }
-}
+};
 
 const getDataApi = async () => {
-    const { excelId } = appItem.value
+    const { excelId } = appItem.value;
     if (excelId) {
-        await getTableFormInfo()
-        await getExcelHtml()
+        await getTableFormInfo();
+        await getExcelHtml();
     }
-}
+};
 
 //获取表单初始数据
 const getFormDataInit = (data = {}) => {
-    const { projectId, contractId, excelId, date } = appItem.value
+    const { projectId, contractId, excelId, date } = appItem.value;
     return {
         linkTabIds: [],
         ...data,
@@ -91,246 +100,265 @@ const getFormDataInit = (data = {}) => {
         contractId: contractId,
         recordTime: date,
         pkeyId: excelId,
-        isTheLog: '1',
-        theLogId: '',
+        isTheLog: "1",
+        theLogId: "",
         classify: 1,
-    }
-}
+    };
+};
 
 //获取已填写的数据
-const formLogDataList = ref([])
+const formLogDataList = ref([]);
 const getTableFormInfo = async () => {
-    const { contractId, excelId, pkeyId, date } = appItem.value
-    const { data } = await queryApi.getTheLogBusinessData({
-        contractId: contractId,
-        pkeyId: excelId,
-        nodePrimaryKeyId: pkeyId,
-        recordTime: date,
-        theLogId: '',
-    }, false)
-    let res = getArrValue(data), formArrData = []
+    const { contractId, excelId, pkeyId, date } = appItem.value;
+    const { data } = await queryApi.getTheLogBusinessData(
+        {
+            contractId: contractId,
+            pkeyId: excelId,
+            nodePrimaryKeyId: pkeyId,
+            recordTime: date,
+            theLogId: "",
+        },
+        false
+    );
+    let res = getArrValue(data),
+        formArrData = [];
     if (res.length > 0) {
         for (let i = 0; i < res.length; i++) {
-            formArrData.push(getFormDataInit(res[i]))
+            formArrData.push(getFormDataInit(res[i]));
         }
     } else {
-        formArrData.push(getFormDataInit())
+        formArrData.push(getFormDataInit());
     }
-    formLogDataList.value = formArrData
-    setFormLength()
-    getBussDataInfo()
-}
+    formLogDataList.value = formArrData;
+    setFormLength();
+    getBussDataInfo();
+};
 
 //获取表单初始数据
-const formLogIndex = ref(0)
-const tableFormInfo = ref({})
+const formLogIndex = ref(0);
+const tableFormInfo = ref({});
 const getBussDataInfo = (index = 0) => {
-    const formLog = formLogDataList.value
-    const info = getObjValue(formLog[index])
-    formLogIndex.value = index
+    const formLog = formLogDataList.value;
+    const info = getObjValue(formLog[index]);
+    formLogIndex.value = index;
     if (getObjVal(info)) {
-        tableFormInfo.value = info
+        tableFormInfo.value = info;
     } else {
-        tableFormInfo.value = {}
+        tableFormInfo.value = {};
     }
     postMessage({
-        type: 'formIndex',
+        type: "formIndex",
         data: {
-            id: info?.id ?? '',
+            id: info?.id ?? "",
             page: Number(index) + 1,
         },
-    })
-}
+    });
+};
 
 //获取模板标签数据
-const excelHtml = ref('')
-const isTableForm = ref(false)
+const excelHtml = ref("");
+const isTableForm = ref(false);
 const getExcelHtml = async () => {
-    const { contractId, excelId } = appItem.value
+    const { contractId, excelId } = appItem.value;
     if (excelId) {
         //获取数据
-        const { error, code, data } = await queryApi.getExcelHtml({
-            contractId: contractId,
-            pkeyId: excelId,
-        }, false)
+        const { error, code, data } = await queryApi.getExcelHtml(
+            {
+                contractId: contractId,
+                pkeyId: excelId,
+            },
+            false
+        );
         //处理数据
-        const resData = isString(data) ? data || '' : ''
+        const resData = isString(data) ? data || "" : "";
         if (!error && code === 200 && resData) {
-            excelHtml.value = resData
-            isTableForm.value = true
+            excelHtml.value = resData;
+            isTableForm.value = true;
         } else {
-            excelHtml.value = ''
-            isTableForm.value = false
-            postMsg('暂无表单', 'error')
+            excelHtml.value = "";
+            isTableForm.value = false;
+            postMsg("暂无表单", "error");
         }
     } else {
-        isTableForm.value = false
-        postMsg('参数异常', 'error')
+        isTableForm.value = false;
+        postMsg("参数异常", "error");
     }
-}
+};
 
 //渲染完成
 const tableFormRender = (form) => {
-    tableFormInfo.value = form
-    postMessage({ type: 'formRender' })
-}
+    tableFormInfo.value = form;
+    postMessage({ type: "formRender" });
+};
 
 //新增表格
 const addTableFormClick = () => {
-    const defaultData = getFormDataInit()
-    formLogDataList.value.push(defaultData)
-    const index = formLogDataList.value.length - 1
-    setFormLength()
-    getBussDataInfo(index)
-    postMsg('新增成功', 'success')
-}
+    const defaultData = getFormDataInit();
+    formLogDataList.value.push(defaultData);
+    const index = formLogDataList.value.length - 1;
+    setFormLength();
+    getBussDataInfo(index);
+    postMsg("新增成功", "success");
+};
 
 //删除当前页
 const delTableFormClick = () => {
-    const index = formLogIndex.value
-    formLogDataList.value.splice(index, 1)
-    const logIndex = index <= 0 ? 0 : index - 1
-    formLogIndex.value = logIndex
-    setFormLength()
-    getBussDataInfo(logIndex)
-    postMsg('删除成功', 'success')
-}
+    const index = formLogIndex.value;
+    formLogDataList.value.splice(index, 1);
+    const logIndex = index <= 0 ? 0 : index - 1;
+    formLogIndex.value = logIndex;
+    setFormLength();
+    getBussDataInfo(logIndex);
+    postMsg("删除成功", "success");
+};
 
 //复制当前表格及内容
 const copyTableFormClick = () => {
-    const index = formLogIndex.value
-    const formLog = formLogDataList.value
-    const info = getObjValue(formLog[index])
-    const defaultData = getFormDataInit(info)
+    const index = formLogIndex.value;
+    const formLog = formLogDataList.value;
+    const info = getObjValue(formLog[index]);
+    const defaultData = getFormDataInit(info);
     formLogDataList.value.push({
         ...defaultData,
-        id: '',
-    })
-    setFormLength()
-    getBussDataInfo(formLogDataList.value.length - 1)
-    postMsg('复制成功', 'success')
-}
+        id: "",
+    });
+    setFormLength();
+    getBussDataInfo(formLogDataList.value.length - 1);
+    postMsg("复制成功", "success");
+};
 
 //更新表单数量
 const setFormLength = () => {
     postMessage({
-        type: 'formLength',
+        type: "formLength",
         data: formLogDataList.value.length,
-    })
-}
+    });
+};
 
 //更新关联工序
 const linkTableFormClick = (data) => {
-    const index = formLogIndex.value
-    const formLog = formLogDataList.value
-    const info = getObjValue(formLog[index])
-    info.linkTabIds = data
-    formLogDataList.value[index] = info
-    tableFormInfo.value.linkTabIds = data
-}
+    const index = formLogIndex.value;
+    const formLog = formLogDataList.value;
+    const info = getObjValue(formLog[index]);
+    info.linkTabIds = data;
+    formLogDataList.value[index] = info;
+    tableFormInfo.value.linkTabIds = data;
+};
 
 //预览PDF
 const getBussPdfInfo = async () => {
-    const { contractId, excelId, pkeyId, date } = appItem.value
-    const { data } = await queryApi.getBussPdfInfo({
-        contractId: contractId,
-        pkeyId: excelId,
-        nodePrimaryKeyId: pkeyId,
-        recordTime: date,
-        theLogId: '',
-    }, false)
+    const { contractId, excelId, pkeyId, date } = appItem.value;
+    const { data } = await queryApi.getBussPdfInfo(
+        {
+            contractId: contractId,
+            pkeyId: excelId,
+            nodePrimaryKeyId: pkeyId,
+            recordTime: date,
+            theLogId: "",
+        },
+        false
+    );
     //处理数据
-    const resData = isString(data) ? data ?? '' : ''
+    const resData = isString(data) ? data ?? "" : "";
     postMessage({
-        type: 'formPdfUrl',
+        type: "formPdfUrl",
         data: resData,
-    })
-}
+    });
+};
 
 //切换显示模式
-const tableWidth = ref(0)
+const tableWidth = ref(0);
 const editTypeClick = (type) => {
-    let metaEle = document.getElementsByName('viewport')[0]
-    if (type === 'form') {
-        metaEle.setAttribute('content', 'width=device-width,user-scalable=no,initial-scale=1.0')
-        tableWidth.value = 0
-    } else if (type === 'table') {
-        metaEle.setAttribute('content', 'width=1080, initial-scale=0.5,user-scalable=yes')
-        tableWidth.value = document.body.offsetWidth
+    let metaEle = document.getElementsByName("viewport")[0];
+    if (type === "form") {
+        metaEle.setAttribute(
+            "content",
+            "width=device-width,user-scalable=no,initial-scale=1.0"
+        );
+        tableWidth.value = 0;
+    } else if (type === "table") {
+        metaEle.setAttribute(
+            "content",
+            "width=1080, initial-scale=0.5,user-scalable=yes"
+        );
+        tableWidth.value = document.body.offsetWidth;
     }
-    editType.value = type
-}
+    editType.value = type;
+};
 
 //保存表单
 const toSaveClick = async () => {
-    const formLog = formLogDataList.value
-    let isLink = await isLinkTabIds(formLog)
+    const formLog = formLogDataList.value;
+    let isLink = await isLinkTabIds(formLog);
     if (!isLink) {
         postMessage({
-            type: 'saveRes',
+            type: "saveRes",
             data: false,
-        })
-        return
+        });
+        return;
     }
     //发起请求
-    const { error, code } = await queryApi.saveExcelBussData({
-        dataInfo: { orderList: formLog },
-    }, false)
+    const { error, code } = await queryApi.saveExcelBussData(
+        {
+            dataInfo: { orderList: formLog },
+        },
+        false
+    );
     if (!error && code === 200) {
         postMessage({
-            type: 'saveRes',
+            type: "saveRes",
             data: true,
-        })
-        postMsg('保存成功', 'success')
-        getBussPdfInfo().then()
+        });
+        postMsg("保存成功", "success");
+        getBussPdfInfo().then();
     } else {
         postMessage({
-            type: 'saveRes',
+            type: "saveRes",
             data: false,
-        })
-        postMsg('保存失败', 'error')
+        });
+        postMsg("保存失败", "error");
     }
-}
+};
 
 //判断工序节点
 const isLinkTabIds = async (data) => {
-    const { nodeType } = appItem.value
+    const { nodeType } = appItem.value;
     if (nodeType === 7 || nodeType === 11) {
         const isLink = data.some(({ linkTabIds }) => {
-            const linkIds = getArrValue(linkTabIds)
-            return linkIds.length > 0
-        })
+            const linkIds = getArrValue(linkTabIds);
+            return linkIds.length > 0;
+        });
         if (isLink) {
-            return true
+            return true;
         } else {
-            postMsg('请先关联工序', 'error')
-            return false
+            postMsg("请先关联工序", "error");
+            return false;
         }
     } else {
-        return true
+        return true;
     }
-}
+};
 
 //发送消息
 const postMessage = ({ type, data = {} }) => {
     window?.postMessage({
         type: type,
-        source: 'web',
+        source: "web",
         data: data,
-    })
-}
+    });
+};
 
 //弹出提示
 const postMsg = (title, icon) => {
     window?.postMessage({
-        type: 'msg',
-        source: 'web',
+        type: "msg",
+        source: "web",
         data: {
             title: title,
             icon: icon,
         },
-    })
-}
+    });
+};
 </script>
 
 <style lang="scss">