ソースを参照

首件上报预览及状态修改

duy 2 年 前
コミット
28a7f6a17b
2 ファイル変更24 行追加6 行削除
  1. 1 0
      src/views/data-fill/wbs.vue
  2. 23 6
      src/views/other/first-item.vue

+ 1 - 0
src/views/data-fill/wbs.vue

@@ -1230,6 +1230,7 @@ const searchNodeAllTable = async () => {
 const NodeStatus = ref('1')
 const queryNodeStatus = async () => {
     const info = nodeDataInfo.value;
+    console.log(info,'info')
     const {error, code, data} = await wbsApi.queryNodeStatus({
         // primaryKeyId: info['contractIdRelation'] ? info['id'] : info['primaryKeyId'],
           primaryKeyId: authBtnTabKey.value==1 ? info['id'] : info['primaryKeyId'],

+ 23 - 6
src/views/other/first-item.vue

@@ -193,6 +193,7 @@ const useAppState = useAppStore()
 const projectId = ref(useAppState.getProjectId);
 const contractId = ref(useAppState.getContractId);
 const projectInfo = ref(useAppState.getProjectInfo);
+const contractInfo = ref(useAppState.getContractInfo);
 const isCollapse = ref(useAppState.getCollapse)
 
 //路由参数
@@ -261,11 +262,17 @@ const firstTaskStatus = async () => {
 }
 //查询状态
 const NodeStatus = ref('1')
+ const { contractType } = contractInfo.value;
+const authBtnTabKey = ref(contractType===2?'2':'1')
 const queryNodeStatus = async () => {
     const info = treeItem.value;
+    console.log(info,'info')
     const {error, code, data} = await wbsApi.queryNodeStatus({
-        primaryKeyId: info['contractIdRelation'] ? info['id'] : info['primaryKeyId'],
-        classify: 1
+        // primaryKeyId: info['contractIdRelation'] ? info['id'] : info['primaryKeyId'],
+        // classify: 1
+       primaryKeyId: authBtnTabKey.value==1 ? info['id'] : info['primaryKeyId'],
+        classify: authBtnTabKey.value
+        
     })
     //1 未填报,2待上报,3已上报
     if (!error && code === 200) {
@@ -630,13 +637,23 @@ const reportModalClick = async (type) => {
          console.log('上报')
         iscanReport.value=isCanreport.value
     }else{
-        console.log('上报审批')
+     
          const rows = deepClone(tableSelectionKeys.value)
-        //判断是否满足条件
-        const result = rows.every(({isApprove})=> {
-            return isApprove === true
+         const result=false
+            console.log('上报',rows)
+        //判断自身是否满足条件
+         const result1 = rows.every(({taskStatusStr})=> {
+            return taskStatusStr === '未上报'||taskStatusStr === '已废除'
         })
+        if(result1){
+             //判断工序节点是否满足条件
+             result = rows.every(({isApprove})=> {
+                return isApprove === true
+            })
+        }
+       
          iscanReport.value=result
+         
     }
     if(iscanReport.value){
         const { primaryKeyId, contractIdRelation } = treeItem.value