Forráskód Böngészése

批量上报按钮增加

duy 2 éve
szülő
commit
23abdb57d1
1 módosított fájl, 72 hozzáadás és 0 törlés
  1. 72 0
      src/views/tentative/detect/test.vue

+ 72 - 0
src/views/tentative/detect/test.vue

@@ -51,6 +51,12 @@
                             <span>批量打印</span>
                         </el-button>
                     </HcTooltip>
+                    <HcTooltip keys="tentative_detect_test_print">
+                        <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" :loading="reportPdfLoading" @click="reportPdfClick">
+                            <HcIcon name="printer"/>
+                            <span>批量上报</span>
+                        </el-button>
+                    </HcTooltip>
                     <HcTooltip keys="tentative_detect_test_quit">
                         <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" :loading="quitPdfLoading" @click="quitPdfClick">
                             <HcIcon name="printer"/>
@@ -172,6 +178,9 @@
         <HcDialog :show="samplingRecordModal" title="查看样品信息" widths="60%" :footer="false" isTable @close="samplingRecordModalClose">
             <HcTable :column="samplingTableColumn" :datas="samplingTableData" :loading="samplingTableLoading" :isIndex="false"></HcTable>
         </HcDialog>
+        <!--批量上报审批-->
+        <HcReportModal  title="批量上报审批" url="informationWriteQuery/batchTask" :show="showReportModal" :projectId="projectId" :contractId="contractId" type="wbs" :typeData="reportTypeData"
+        :taskName="reportTaskName" :ids="reportIds" :addition="reportAddition" :trialSelfInspectionRecordId="1"  @hide="showReportModal = false" @finish="showReportFinish"/>
 
     </div>
 </template>
@@ -187,6 +196,8 @@ import HcDragUpload from "./components/HcDragUpload.vue"
 import dataApi from "~api/tentative/detect/test";
 import {delMessage, rowsToId} from "~uti/tools";
 import {getDictionary} from "~api/other";
+import { eVisaTaskCheckApi} from "~api/other"
+import wbsApi from "~api/data-fill/wbs"
 
 //变量
 const router = useRouter()
@@ -520,6 +531,67 @@ const quitPdfClick = async () => {
         window.$message?.warning('请先勾选需要批量打印的记录')
     }
 }
+
+//批量上报
+const reportPdfLoading = ref(false)
+//批量上报
+const reportIds = ref('')
+const reportTaskName = ref('')
+const reportAddition = ref({})
+const showReportModal = ref(false)
+const reportLoading = ref(false)
+const reportTypeData = ref([])
+const reportPdfClick = async () => {
+    const rows = tableCheckedKeys.value;
+    if (rows.length > 0) {
+            const info = getStoreData('prenodeDataInfo') || {}
+            console.log(info,'info');
+             const rows = tableCheckedKeys.value;
+            if (rows.length > 0) {
+                reportLoading.value = true
+                const taskCheck = await eVisaTaskCheckApi({
+                    projectId: projectId.value,
+                    contractId: contractId.value
+                })
+                //处理数据
+                let newArr = [];
+                console.log(rows,'rows');
+                for (let i = 0; i < rows.length; i++) {
+                    newArr.push(rows[i]['tableIds'])
+                }
+                reportTypeData.value = [...newArr];
+                console.log( reportTypeData.value,' reportTypeData.value');
+                reportLoading.value = false
+                if (taskCheck) {
+                    //初始弹出弹窗,防呆
+                    reportIds.value = info['primaryKeyId'] 
+                    reportAddition.value = {
+                        classify: authBtnTabKey.value,
+                        contractIdRelation: info['contractIdRelation'],
+                    }
+                    showReportModal.value = true
+                    //请求文件题名
+                    const {data} = await wbsApi.queryDocumentTitle({
+                        // primaryKeyId: info['primaryKeyId'],
+                        primaryKeyId:info['primaryKeyId'],
+                        classify: authBtnTabKey.value
+                    })
+                    reportTaskName.value = isString(data)? data : ''
+        }
+    } else {
+        window.$message?.warning('暂无相关数据')
+    }
+
+    } else {
+        window.$message?.warning('请先勾选需要批量打印的记录')
+    }
+}
+//上报完成
+const showReportFinish = () => {
+    showReportModal.value = false
+    getTableData()
+}
+
 //打印空表
 const printNullPdfLoading = ref(false)
 const printNullPdfClick = async () => {