不合格项复检
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
import http from "@/api";
|
||||
import {CheckData} from "@/api/check/interface";
|
||||
|
||||
export const getBigTestItem = (planId: string) => {
|
||||
return http.get(`/adPlan/getBigTestItem?planId=${planId}`);
|
||||
export const getBigTestItem = (params: {
|
||||
reCheckType:number,
|
||||
planId: string,
|
||||
devId: string,
|
||||
}) => {
|
||||
return http.post(`/adPlan/getBigTestItem`, params, {loading: false});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,7 +11,8 @@ export const useCheckStore = defineStore("check", {
|
||||
devices: Array<CheckData.Device>(),
|
||||
plan: Object<Plan.ResPlan>(),
|
||||
selectTestItems: Object<CheckData.SelectTestItem>({preTest: true, timeTest: true, channelsTest: false, test: true}),
|
||||
checkType:1
|
||||
checkType:1, // 0:手动检测 1:自动检测
|
||||
reCheckType: 1 // 0:不合格项复检 1:全部复检
|
||||
}),
|
||||
|
||||
getters: {},
|
||||
@@ -36,6 +37,9 @@ export const useCheckStore = defineStore("check", {
|
||||
},
|
||||
setCheckType(checkType: number) {
|
||||
this.checkType = checkType
|
||||
},
|
||||
setReCheckType(reCheckType: number) {
|
||||
this.reCheckType = reCheckType
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -954,10 +954,12 @@ const handleTest = async (val: string) => {
|
||||
})
|
||||
.then(() => {
|
||||
ElMessage.success('不合格项复检')
|
||||
checkStore.setReCheckType(0)
|
||||
selectTestItemPopupRef.value?.open()
|
||||
})
|
||||
.catch((action: Action) => {
|
||||
ElMessage.success('全部复检')
|
||||
checkStore.setReCheckType(1)
|
||||
selectTestItemPopupRef.value?.open()
|
||||
})
|
||||
} else {
|
||||
@@ -987,10 +989,30 @@ const handleTest = async (val: string) => {
|
||||
channelsTest.value?.open(channelsSelection.value, props.plan)
|
||||
return
|
||||
} else {
|
||||
// 一键检测
|
||||
checkStore.setCheckType(1)
|
||||
checkStore.initSelectTestItems()
|
||||
openTestDialog()
|
||||
// 一键检测
|
||||
if (testType === 'reTest') {
|
||||
ElMessageBox.confirm('请选择复检检测方式', '设备复检',
|
||||
{
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: '不合格项复检',
|
||||
cancelButtonText: '全部复检',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
ElMessage.success('不合格项复检')
|
||||
checkStore.setReCheckType(0)
|
||||
openTestDialog()
|
||||
})
|
||||
.catch((action: Action) => {
|
||||
ElMessage.success('全部复检')
|
||||
checkStore.setReCheckType(1)
|
||||
openTestDialog()
|
||||
})
|
||||
} else {
|
||||
openTestDialog()
|
||||
}
|
||||
}
|
||||
}
|
||||
if (val === '批量下载') {
|
||||
|
||||
@@ -160,8 +160,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="tsx" setup name="test">
|
||||
import {Check, Failed, InfoFilled, Loading, Timer, Refresh, RefreshLeft, VideoPause, VideoPlay} from '@element-plus/icons-vue'
|
||||
import resultPopup from './resultPopup.vue'
|
||||
import {Check, InfoFilled, Loading, Refresh, VideoPause, VideoPlay} from '@element-plus/icons-vue'
|
||||
import dataCheckSingleChannelSingleTestPopup from './dataCheckSingleChannelSingleTestPopup.vue'
|
||||
import {computed, reactive, ref, toRef, watch} from "vue";
|
||||
import {dialogBig} from "@/utils/elementBind";
|
||||
@@ -727,7 +726,7 @@ const showTestLog = () => {
|
||||
// 初始化检测脚本数据
|
||||
const initScriptData = async () => {
|
||||
|
||||
let response: any = await getBigTestItem(checkStore.plan.id)
|
||||
let response: any = await getBigTestItem({reCheckType:checkStore.reCheckType, planId:checkStore.plan.id,devId:checkStore.devices[0].deviceId})
|
||||
|
||||
let temp = response.data.map(item => {
|
||||
return {
|
||||
|
||||
@@ -190,7 +190,7 @@ const handleSubmit = () => {
|
||||
userPageId: "cdf",
|
||||
devIds: deviceIds,
|
||||
planId: planId,
|
||||
operateType: '1' // '1'为预检测、‘2‘为正式检测
|
||||
operateType: '1' // '1'为预检测、‘2‘为正式检测、'8'为不合格项复检
|
||||
}).then(res => {
|
||||
if (res.code === 'A001014') {
|
||||
ElMessageBox.alert('装置配置异常', '检测失败', {
|
||||
@@ -218,7 +218,7 @@ const handleSubmit = () => {
|
||||
userPageId: "cdf",
|
||||
devIds: deviceIds,
|
||||
planId: planId,
|
||||
operateType: '2' // '1'为预检测、‘2‘为正式检测
|
||||
operateType: checkStore.reCheckType ==1 ?'2':'8' // '1'为预检测、‘2‘为正式检测、'8'为不合格项复检
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if (res.code === 'A001014') {
|
||||
@@ -326,7 +326,7 @@ const sendResume = () => {
|
||||
userPageId: "cdf",
|
||||
devIds: checkStore.devices.map((item) => item.deviceId),
|
||||
planId: checkStore.plan.id,
|
||||
operateType: '2' // 0:'系数校验','1'为预检测、‘2‘为正式检测
|
||||
operateType: '2' // 0:'系数校验','1'为预检测、‘2‘为正式检测、'8'为不合格项复检
|
||||
})
|
||||
Object.assign(webMsgSend.value, {
|
||||
requestId: 'Resume_Success'
|
||||
@@ -339,7 +339,7 @@ const sendReCheck = () => {
|
||||
userPageId: "cdf",
|
||||
devIds: checkStore.devices.map((item) => item.deviceId),
|
||||
planId: checkStore.plan.id,
|
||||
operateType: '2' // 0:'系数校验','1'为预检测、‘2‘为正式检测
|
||||
operateType: '2' // 0:'系数校验','1'为预检测、‘2‘为正式检测、'8'为不合格项复检
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if (res.code === 'A001014') {
|
||||
|
||||
Reference in New Issue
Block a user