Răsfoiți Sursa

首件上报修改

duy 2 ani în urmă
părinte
comite
c84996f81c
1 a modificat fișierele cu 35 adăugiri și 7 ștergeri
  1. 35 7
      src/views/other/first-item.vue

+ 35 - 7
src/views/other/first-item.vue

@@ -133,15 +133,15 @@
                 </div>
             </div>
             <div class="node-action">
-                <el-button type="primary" hc-btn :disabled="!contractId || !isTableForm" :loading="tableFormSaveLoading" @click="saveBussData">
+                <el-button type="primary" hc-btn :disabled="!contractId || !isTableForm||NodeStatus === '3'" :loading="tableFormSaveLoading" @click="saveBussData">
                     <HcIcon name="save"/>
                     <span>保存</span>
                 </el-button>
-                <el-button hc-btn :disabled="!contractId || !isTableForm || !tableFormId" @click="bussPdfInfo">
+                <el-button hc-btn :disabled="!contractId || !isTableForm || !tableFormId||NodeStatus === '1'" @click="bussPdfInfo">
                     <HcIcon name="eye"/>
                     <span>预览</span>
                 </el-button>
-                <el-button hc-btn :disabled="!contractId || !isTableForm || !tableFormId" :loading="reportLoading" @click="reportModalClick">
+                <el-button hc-btn :disabled="!contractId || !isTableForm || !tableFormId||NodeStatus === '3' || NodeStatus === '1'" :loading="reportLoading" @click="reportModalClick">
                     <HcIcon name="send-plane-2"/>
                     <span>上报</span>
                 </el-button>
@@ -185,7 +185,7 @@ import tasksApi from '~api/tasks/data';
 import {getStoreData, setStoreData} from '~src/utils/storage'
 import {getArrValue, isString, getObjValue, getObjNullValue,deepClone} from "vue-utils-plus"
 import queryApi from "~api/data-fill/query";
-
+import wbsApi from "~api/data-fill/wbs";
 //变量
 const router = useRouter()
 const useRoutes = useRoute()
@@ -259,7 +259,21 @@ const firstTaskStatus = async () => {
     //处理数据
     processStatus.value = getArrValue(data)
 }
-
+//查询状态
+const NodeStatus = ref('1')
+const queryNodeStatus = async () => {
+    const info = treeItem.value;
+    const {error, code, data} = await wbsApi.queryNodeStatus({
+        primaryKeyId: info['contractIdRelation'] ? info['id'] : info['primaryKeyId'],
+        classify: 1
+    })
+    //1 未填报,2待上报,3已上报
+    if (!error && code === 200) {
+        NodeStatus.value = data ?? '1'
+    } else {
+        NodeStatus.value = '1'
+    }
+}
 //获取上报批次
 const reportBatch = ref([])
 const getReportNumberByContractId = async (cid) => {
@@ -399,6 +413,7 @@ const firstReportClick = () => {
     //判断状态
     if (result) {
         isFirstReportDrawer.value = true
+        queryNodeStatus()
         tableFileData.value = rows
         getFirstExcelHtml()
     } else {
@@ -524,11 +539,18 @@ const tableDelButton = (index) => {
 }
 
 //填报数据保存
+const pdfId=ref('')
 const saveBussData = async () => {
     const { id } = treeItem.value
     const res = await saveExcelBussData(id + '')
+    //刷新页面
+    //  window?.location?.reload()  //刷新页面
     if (res) {
+        pdfId.value=res
         await getBussPdfInfo(res)
+          queryNodeStatus()
+          
+       
     }
 }
 
@@ -567,7 +589,9 @@ const saveExcelBussData = async (pkeyId) => {
 //pdf预览
 const bussPdfInfo = () => {
     const { id } = treeItem.value
-    getBussPdfInfo(id + '')
+    // getBussPdfInfo(id + '')
+     getBussPdfInfo(pdfId.value)
+      
 }
 
 //预览PDF请求
@@ -655,10 +679,14 @@ const reportTaskTagClose = (index) => {
     const row = tableSelectionKeys.value[index];
     tableListRef.value?.toggleRowSelection(row,false)
 }
-
+const getTableDataAll = () => {
+    getTableData()
+    firstTaskStatus()
+}
 //上报完成
 const showReportFinish = () => {
     showReportModal.value = false
+    getTableDataAll()
 }
 
 //打印