duy пре 2 година
родитељ
комит
b02a26c50d
1 измењених фајлова са 17 додато и 5 уклоњено
  1. 17 5
      src/views/other/first-item.vue

+ 17 - 5
src/views/other/first-item.vue

@@ -28,7 +28,7 @@
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="other-first-item-report-approval" v-if="tabTypeKey === 'query'">
-                        <el-button type="primary" hc-btn :disabled="tableSelectionKeys.length <= 0" @click="reportModalClick">
+                        <el-button type="primary" hc-btn :disabled="tableSelectionKeys.length <= 0" @click="reportModalClick(1)">
                             <HcIcon name="send-plane-2"/>
                             <span>上报审批</span>
                         </el-button>
@@ -141,7 +141,7 @@
                     <HcIcon name="eye"/>
                     <span>预览</span>
                 </el-button>
-                <el-button hc-btn :disabled="!contractId || !isTableForm || !tableFormId||NodeStatus === '3' || NodeStatus === '1'" :loading="reportLoading" @click="reportModalClick">
+                <el-button hc-btn :disabled="!contractId || !isTableForm || !tableFormId||NodeStatus === '3' || NodeStatus === '1'" :loading="reportLoading" @click="reportModalClick(2)">
                     <HcIcon name="send-plane-2"/>
                     <span>上报</span>
                 </el-button>
@@ -624,9 +624,21 @@ const reportLoading = ref(false)
 const reportTypeData = ref('')
 const reportDatas = ref([])
 const isReportModalDatas = ref(false)
-const reportModalClick = async () => {
-    console.log(isCanreport.value,'是否可以上报');
-    if(isCanreport.value){
+const iscanReport=ref(false)
+const reportModalClick = async (type) => {
+    if(type===2){
+         console.log('上报')
+        iscanReport.value=isCanreport.value
+    }else{
+        console.log('上报审批')
+         const rows = deepClone(tableSelectionKeys.value)
+        //判断是否满足条件
+        const result = rows.every(({isApprove})=> {
+            return isApprove === true
+        })
+         iscanReport.value=result
+    }
+    if(iscanReport.value){
         const { primaryKeyId, contractIdRelation } = treeItem.value
         let rows = [];
         //处理获取流程的条件