ソースを参照

撤回上报按钮增加

duy 2 年 前
コミット
ec41c978d6
1 ファイル変更37 行追加1 行削除
  1. 37 1
      src/views/other/first-item.vue

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

@@ -141,10 +141,16 @@
                     <HcIcon name="eye"/>
                     <span>预览</span>
                 </el-button>
-                <el-button hc-btn :disabled="!contractId || !isTableForm || !tableFormId||NodeStatus === '3' || NodeStatus === '1'" :loading="reportLoading" @click="reportModalClick(2)">
+                <el-button v-if="NodeStatus !== '3'" hc-btn :disabled="!contractId || !isTableForm || !tableFormId||NodeStatus === '3' || NodeStatus === '1'" :loading="reportLoading" @click="reportModalClick(2)">
                     <HcIcon name="send-plane-2"/>
                     <span>上报</span>
                 </el-button>
+             
+                <el-button hc-btn @click="abolishOneClick"  v-if="NodeStatus === '3'">
+                    <HcIcon name="arrow-go-back"/>
+                    <span>撤回上报流程</span>
+                </el-button>
+    
                 <el-button hc-btn @click="FirstReportDrawerClose">
                     <HcIcon name="close"/>
                     <span>返回</span>
@@ -438,6 +444,35 @@ const firstReportClick = () => {
         tableFileData.value = rows
         getFirstExcelHtml()
 }
+//撤回上报流程
+const abolishOneClick = () => {
+    window?.$messageBox?.alert('请谨慎考虑后,是否确定撤回?', '撤回上报', {
+        showCancelButton: true,
+        confirmButtonText: '确定撤回',
+        cancelButtonText: '取消',
+        callback: (action) => {
+            if (action === 'confirm') {
+                abolishOneSave()
+            }
+        }
+    })
+}
+
+//撤回请求
+const abolishOneSave = async () => {
+    const info = treeItem.value;
+    const {error, code} = await wbsApi.abolishOne({
+        primaryKeyId:  info?.primaryKeyId || '',
+        classify: authBtnTabKey.value
+    })
+    if (!error && code === 200) {
+        window.$message?.success('撤回成功')
+        getTableDataAll()
+        window?.location?.reload()  //刷新页面
+
+    }
+}
+
 const FirstReportDrawerClose = () => {
     isFirstReportDrawer.value = false
 }
@@ -742,6 +777,7 @@ const reportTaskTagClose = (index) => {
 const getTableDataAll = () => {
     getTableData()
     firstTaskStatus()
+    queryNodeStatus()
 }
 //上报完成
 const showReportFinish = () => {