|
|
@@ -139,6 +139,22 @@
|
|
|
<el-button @click="handleAuditSelectCancel">取 消</el-button>
|
|
|
</template>
|
|
|
</Dialog>
|
|
|
+ <!-- 选择通过报告弹窗 -->
|
|
|
+ <Dialog v-model="showPassDialog" width="450" title="选择通过报告">
|
|
|
+ <el-select
|
|
|
+ v-model="selectedPassIds"
|
|
|
+ placeholder="请选择通过报告"
|
|
|
+ style="width: 100%"
|
|
|
+ multiple
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option v-for="item in getRecheckList" :key="item.reportId" :value="item.reportId" :label="item.reportName"/>
|
|
|
+ </el-select>
|
|
|
+ <template #footer>
|
|
|
+ <el-button type="primary" @click="handlePassConfirm">确 定</el-button>
|
|
|
+ <el-button @click="showPassDialog = false">取 消</el-button>
|
|
|
+ </template>
|
|
|
+ </Dialog>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 设备档案弹窗 -->
|
|
|
@@ -197,7 +213,7 @@ import ReportListUploadModal from '@/views/pressure2/pipechecker/components/repo
|
|
|
import EquipPipeForm from '@/components/EquipPipeForm/index.vue'
|
|
|
import * as GC from "@grapecity-software/spread-sheets";
|
|
|
import {DynamicTbValApi} from "@/api/pressure2/dynamictbval";
|
|
|
- import {ref, watch} from "vue";
|
|
|
+ import {ref, watch, nextTick} from "vue";
|
|
|
import {getPDF, getStandardTemplateInfo} from "@/api/laboratory/standard/template";
|
|
|
import {buildFileUrl} from "@/utils";
|
|
|
import axios from "axios";
|
|
|
@@ -407,6 +423,20 @@ import ReportListUploadModal from '@/views/pressure2/pipechecker/components/repo
|
|
|
currentSelectedReport.value = report
|
|
|
}
|
|
|
|
|
|
+ // 切换报告时重新加载 SpreadViewer
|
|
|
+ watch(currentSelectedReport, async (report) => {
|
|
|
+ if (!report?.reportId) return
|
|
|
+ try {
|
|
|
+ const res = await PipeTaskOrderApi.getTaskOrderItemReportRecord(report.reportId)
|
|
|
+ initData.value.templateId = res.templateId
|
|
|
+ initData.value.refId = report.reportId
|
|
|
+ await nextTick()
|
|
|
+ spreadRef.value?.reloadView()
|
|
|
+ } catch (e) {
|
|
|
+ console.error('切换报告失败:', e)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
const spreadRef=ref();
|
|
|
const initData=ref<InitParams>(
|
|
|
{
|
|
|
@@ -483,8 +513,10 @@ import ReportListUploadModal from '@/views/pressure2/pipechecker/components/repo
|
|
|
// TODO: 批量通过
|
|
|
let params = {}
|
|
|
if(getRecheckList.value && getRecheckList.value?.length) {
|
|
|
+ // 多于1个时用 selectedPassIds,只有1个时自动选中
|
|
|
+ const passIds = getRecheckList.value.length > 1 ? selectedPassIds.value : [getRecheckList.value[0].reportId]
|
|
|
params = {
|
|
|
- ids: getRecheckList.value.map(item => item.reportId)
|
|
|
+ ids: passIds
|
|
|
}
|
|
|
} else {
|
|
|
params = props.apiParams
|
|
|
@@ -555,10 +587,26 @@ import ReportListUploadModal from '@/views/pressure2/pipechecker/components/repo
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ // 批量校核 >1 时弹窗选择通过报告
|
|
|
+ if (isBatch.value && getRecheckList.value?.length > 1) {
|
|
|
+ selectedPassIds.value = []
|
|
|
+ showPassDialog.value = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
handlePassFn()
|
|
|
|
|
|
}
|
|
|
|
|
|
+ // 通过报告弹窗确认
|
|
|
+ const handlePassConfirm = () => {
|
|
|
+ if (selectedPassIds.value.length === 0) {
|
|
|
+ return ElMessage.error('请选择通过报告')
|
|
|
+ }
|
|
|
+ showPassDialog.value = false
|
|
|
+ handlePassFn()
|
|
|
+ }
|
|
|
+
|
|
|
// 主报告提交至报告审核环节
|
|
|
const handleSubmitToApproval = (title) => {
|
|
|
ElMessageBox.confirm(title, '提示', {
|
|
|
@@ -671,6 +719,8 @@ const canSubmitMainReportType = ()=>{
|
|
|
// 回退
|
|
|
const selectedRollbackStatus = ref(500)
|
|
|
const selectedRollBackIds = ref([])
|
|
|
+ const selectedPassIds = ref([])
|
|
|
+ const showPassDialog = ref(false)
|
|
|
const returnForm = ref({
|
|
|
reason: ''
|
|
|
})
|
|
|
@@ -680,6 +730,10 @@ const canSubmitMainReportType = ()=>{
|
|
|
const returnFormRef = ref()
|
|
|
|
|
|
const handleRevert = () => {
|
|
|
+ // 批量退回时,必须选择退回报告
|
|
|
+ if (isBatch.value && getRecheckList.value?.length > 1 && selectedRollBackIds.value.length === 0) {
|
|
|
+ return ElMessage.error('请选择退回报告')
|
|
|
+ }
|
|
|
returnFormRef.value.validate(async (valid) => {
|
|
|
if(!valid) return ElMessage.error('请填写回退原因')
|
|
|
const params = {
|