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