|
|
@@ -724,6 +724,8 @@
|
|
|
>编制报告</el-button>
|
|
|
<el-button v-if="isCanSubmitRecheck" type="primary" @click="handleSelectVerfiyer" :disabled="checkerIsLoginUser" size="small"
|
|
|
>提交校核</el-button>
|
|
|
+ <el-button v-if="isCanCancelRecheck" type="warning" @click="handleCancelRecheck" size="small"
|
|
|
+ >撤销校核</el-button>
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
v-if="isCanEditTestRecord"
|
|
|
@@ -849,7 +851,7 @@ import SmartTable from '@/components/SmartTable/SmartTable'
|
|
|
import RectificationUpload from '@/views/pressure2/components/RectificationUpload.vue'
|
|
|
import RectificationMaterialsDialog from '@/views/pressure2/components/RectificationMaterialsDialog.vue'
|
|
|
import {computed, defineAsyncComponent, nextTick, reactive, ref, watch} from 'vue'
|
|
|
-import {useRoute} from 'vue-router'
|
|
|
+import {useRoute, useRouter} from 'vue-router'
|
|
|
import { InfoFilled, View, Back, Right, WarningFilled, VideoPlay } from '@element-plus/icons-vue'
|
|
|
import {dayjs, ElLoading, ElMessage, ElMessageBox, FormInstance, FormRules} from 'element-plus'
|
|
|
import * as UserApi from '@/api/system/user'
|
|
|
@@ -918,6 +920,7 @@ interface Emits {
|
|
|
const props = defineProps<Props>()
|
|
|
const emit = defineEmits<Emits>()
|
|
|
const route = useRoute()
|
|
|
+const router = useRouter()
|
|
|
const userStore = useUserStore()
|
|
|
const schemaFlag = ref<string | null>(null) //等于proofread = 校核 audit=审核
|
|
|
// 获取当前的路由Name
|
|
|
@@ -1470,6 +1473,36 @@ const isCanSubmitRecheck = computed(() => {
|
|
|
)
|
|
|
})
|
|
|
|
|
|
+// 判断“撤销校核”按钮是否显示:报告处于审核中(100)状态,且当前登录用户是提交人
|
|
|
+const isCanCancelRecheck = computed(() => {
|
|
|
+ const item = props.selectedItem
|
|
|
+ if (!item) return false
|
|
|
+ // 报告处于审核中状态
|
|
|
+ if (item.recheckStatus !== 100) return false
|
|
|
+ // 当前登录用户是提交人
|
|
|
+ return item.recheckSubmitId === userStore?.user?.id
|
|
|
+})
|
|
|
+
|
|
|
+// 撤销校核提交
|
|
|
+const handleCancelRecheck = async () => {
|
|
|
+ const item = props.selectedItem
|
|
|
+ if (!item) return
|
|
|
+ try {
|
|
|
+ await ElMessageBox.confirm('确定撤销该校核提交吗?撤销后报告将回退到记录录入状态。', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ await PipeTaskOrderApi.cancelRecheckReport(item.id)
|
|
|
+ ElMessage.success('撤销校核成功')
|
|
|
+ emit('refresh')
|
|
|
+ } catch (error) {
|
|
|
+ if (error !== 'cancel') {
|
|
|
+ ElMessage.error('撤销校核失败')
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// 判断“提交审核&提交审批”按钮是否显示
|
|
|
const isCanSubmitToAudit = computed(() => {
|
|
|
const { selectedItem } = props
|