iZaiZaiA 2 жил өмнө
parent
commit
e3baa5b367

+ 7 - 0
src/api/modules/other.js

@@ -82,3 +82,10 @@ export const checkFlowUserIsExistPfxFile = (form, msg = true) => httpApi({
     params: form
 }, msg);
 
+
+//获取符合条件的预设流程(三大填报页、日志列表的批量上报、首件列表的批量上报)
+export const queryFixedFlow = (form, msg = true) => httpApi({
+    url: '/api/blade-business/eVisaTaskCheck/queryFixedFlow',
+    method: 'post',
+    data: form
+}, msg);

+ 57 - 5
src/global/components/hc-report-modal/index.vue

@@ -37,9 +37,8 @@
 <script setup>
 import {ref,watch,onMounted} from "vue";
 import tasksFlowApi from '~api/tasks/flow';
-import {ApprovalApi} from '~api/other';
+import {ApprovalApi,queryFixedFlow} from '~api/other';
 import {getArrValue,getIndex,formValidate} from "vue-utils-plus"
-
 const props = defineProps({
     show: {
         type: Boolean,
@@ -73,6 +72,14 @@ const props = defineProps({
         type: Object,
         default: () => ({})
     },
+    type: { //first,log,wbs
+        type: [String,Number],
+        default: ''
+    },
+    typeData: {
+        type: [String, Number, Array, Object],
+        default: ''
+    },
 })
 
 //变量
@@ -80,6 +87,8 @@ const isShow = ref(props.show)
 const projectId = ref(props.projectId)
 const contractId = ref(props.contractId)
 const ApiUrl = ref(props.url)
+const isTypes = ref(props.type)
+const typeDatas = ref(props.typeData)
 
 //表单
 const formRef = ref(null)
@@ -115,8 +124,10 @@ watch(() => [
     props.taskName,
     props.ids,
     props.url,
-    props.addition
-], ([val,pid,cid,name,ids,url,addition]) => {
+    props.addition,
+    props.type,
+    props.typeData
+], ([val,pid,cid,name,ids,url,addition, type, typeData]) => {
     isShow.value = val
     projectId.value = pid
     contractId.value = cid
@@ -127,13 +138,29 @@ watch(() => [
         taskContent: '', fixedFlowId: '', batch: 1, restrictDay: 1,
         ...addition
     }
+    typeDatas.value = typeData
+    if (type !== isTypes.value) {
+        isTypes.value = type
+        getProcessDatasApi()
+    }
 })
 
 //渲染完成
 onMounted(() => {
-    getProcessData()
+    getProcessDatasApi()
 })
 
+const getProcessDatasApi = () => {
+    if (isShow.value) {
+        const type = isTypes.value
+        if (type === 'first' || type === 'log' || type === 'wbs') {
+            queryFixedFlowApi(type, typeDatas.value)
+        } else {
+            getProcessData()
+        }
+    }
+}
+
 //获取流程数据
 const linkUserJoinString = ref('')
 const getProcessData = async () => {
@@ -150,6 +177,31 @@ const getProcessData = async () => {
     }
 }
 
+//获取符合条件的预设流程(三大填报页、日志列表的批量上报、首件列表的批量上报)
+const queryFixedFlowApi = async (type, datas) => {
+    let flowJson = {}
+    if (type === 'first') {
+        flowJson['firstId'] = datas
+    } else if (type === 'log') {
+        flowJson['theLogPrimaryKeyId'] = datas
+    } else if (type === 'wbs') {
+        flowJson['privatePKeyId'] = datas
+    }
+    //请求数据
+    linkUserJoinString.value = ''
+    const { error, code, data } = await queryFixedFlow({
+        projectId: projectId.value,
+        contractId: contractId.value,
+        ...flowJson
+    })
+    if (!error && code === 200) {
+        processData.value = getArrValue(data['records'])
+    } else {
+        processData.value = []
+    }
+}
+
+
 //流程数据切换
 const handleProcessValue = (val) => {
     const list = processData.value

+ 1 - 1
src/views/ledger/components/table-form.vue

@@ -102,7 +102,7 @@
         </HcDialog>
 
         <!--批量上报审批-->
-        <HcReportModal  title="日志填报上报" url="contractLog/startTaskTheLog" :show="showReportModal" :projectId="projectId" :contractId="contractId"
+        <HcReportModal  title="日志填报上报" url="contractLog/startTaskTheLog" :show="showReportModal" :projectId="projectId" :contractId="contractId" type="log" :typeData="menuItem.primaryKeyId"
                         :taskName="reportTaskName" :addition="reportAddition" @hide="showReportModal = false" @finish="showReportFinish"/>
     </div>
 </template>

+ 1 - 1
src/views/ledger/components/table-list.vue

@@ -59,7 +59,7 @@
         </HcCard>
 
         <!--批量上报审批-->
-        <HcReportModal  title="批量上报审批" url="contractLog/batchTask" :show="showReportModal" :projectId="projectId" :contractId="contractId"
+        <HcReportModal  title="批量上报审批" url="contractLog/batchTask" :show="showReportModal" :projectId="projectId" :contractId="contractId" type="log" :typeData="menuItem.primaryKeyId"
                         :taskName="reportTaskName" :ids="reportIds" @hide="showReportModal = false" @finish="showReportFinish"/>
     </div>
 </template>

+ 3 - 1
src/views/other/first-item.vue

@@ -153,7 +153,7 @@
         </HcDrawer>
 
         <!--上报审批-->
-        <HcReportModal title="上报审批" url="informationWriteQuery/taskOne" :show="showReportModal" :projectId="projectId" :contractId="contractId"
+        <HcReportModal title="上报审批" url="informationWriteQuery/taskOne" :show="showReportModal" :projectId="projectId" :contractId="contractId" type="first" :typeData="reportTypeData"
                        :taskName="reportTaskName" :ids="reportIds" @hide="showReportModal = false" @finish="showReportFinish"/>
     </div>
 </template>
@@ -549,6 +549,7 @@ const showReportModal = ref(false)
 const reportTaskName = ref('')
 const reportAddition = ref({})
 const reportLoading = ref(false)
+const reportTypeData = ref('')
 const reportModalClick = async () => {
     const { primaryKeyId, contractIdRelation } = treeItem.value
     const rows = tableFileData.value
@@ -558,6 +559,7 @@ const reportModalClick = async () => {
             projectId: projectId.value,
             contractId: contractId.value
         })
+        reportTypeData.value = rows[0]['id']
         reportLoading.value = false
         if (taskCheck) {
             reportIds.value = rowsToId(rows)