Răsfoiți Sursa

撤回提交接口调用

duy 1 an în urmă
părinte
comite
cb993515ae

+ 8 - 0
src/api/modules/transfer/write-conclusion.js

@@ -65,4 +65,12 @@ export default {
             data: form,
             }, msg)
     },
+    //编写结论-测回提交
+    async repealTable(form, msg = true) {
+        return httpApi({
+                url: '/api/blade-archive/archiveExpertConclusion/repealTable',
+                method: 'get',
+                params: form,
+                }, msg)
+        },
 }

+ 20 - 4
src/views/transfer/write-report.vue

@@ -14,9 +14,9 @@
             </template>
             <template #extra>
                 <el-button v-if="state === 2" type="success" round @click="onSubmitReportClick">查看验收意见</el-button>
-                <el-button v-if="state === 2" type="danger" round>撤回提交</el-button>
-                <el-button v-if="isShowSubmit && state !== 2" type="danger" round @click="submissionClick">确认提交</el-button>
-                <el-button color="#7729F5" round :loading="saveDraftLaod" @click="officeDraft">暂存草稿</el-button>
+                <el-button v-if="state === 2" type="danger" round :loading="cancelLoading" @click="cancleSubmit">撤回提交</el-button>
+                <el-button v-if="isShowSubmit && state !== 2" type="danger" round :loading="subLoading" @click="submissionClick">确认提交</el-button>
+                <el-button color="#7729F5" round :loading="saveDraftLaod" :disabled="state === 2" @click="officeDraft">暂存草稿</el-button>
                 <el-button round plain type="danger" @click="previousStep">上一步</el-button>
                 <el-button type="danger" round plain @click="toBackClick">返回主页</el-button>
             </template>
@@ -127,13 +127,16 @@ const getIsSubmit = async ()=>{
 //短信验证
 const SMSAuthLoading = ref(false)
 const SMSAuthShow = ref(false)
+const subLoading = ref(false)
 const SMSAuthConfirm = async () => {
     SMSAuthShow.value = false
 
     //确认提交调接口
+    subLoading.value = true
     const { error, code, msg } = await writeApi.submitTable({
       ...consolusionData.value,
     })
+    subLoading.value = false
     if (!error && code === 200) {
       window.$message.success(msg)
     //   state.value = 2
@@ -215,7 +218,6 @@ const getConclusion = async ()=>{
         projectId: projectId.value,
     })
     if (!error && code === 200) {
-        console.log(data, 'data')
         consolusionData.value = getObjValue(data)
         state.value = data['status']
     } else {
@@ -228,6 +230,20 @@ const getConclusion = async ()=>{
      
     }
 }
+//撤回提交
+const cancelLoading = ref(false)
+const cancleSubmit = async ()=>{
+    cancelLoading.value = true
+    const { error, code, data, msg } = await writeApi.repealTable({
+        id: consolusionData.value.id,
+    })
+    cancelLoading.value = false
+    if (!error && code === 200) {
+        window.$message.success(msg)
+        getConclusion()
+     
+    } 
+}
 </script>
 
 <style lang="scss" scoped>