diff --git a/src/pages/deviceInfo/components/BasicInfo.vue b/src/pages/deviceInfo/components/BasicInfo.vue index 6ce4b14..633ae81 100644 --- a/src/pages/deviceInfo/components/BasicInfo.vue +++ b/src/pages/deviceInfo/components/BasicInfo.vue @@ -179,6 +179,7 @@ async function onSave() { const type = !!params.value.serialNo ? 'update' : 'create' const options = cloneDeep(params.value) + options.templateId = 0 if (type === 'update') options.id = props.info?.id const res = await operantDevice(type, options) if (isResError(res)) return diff --git a/src/pages/deviceInfo/components/TestInfo.vue b/src/pages/deviceInfo/components/TestInfo.vue index 7377165..cc7015a 100644 --- a/src/pages/deviceInfo/components/TestInfo.vue +++ b/src/pages/deviceInfo/components/TestInfo.vue @@ -93,14 +93,18 @@ const isShowSaveButton = computed(() => { return props.info?.status === undefined ? true : props.info.status < 2 }) -async function onChangeRadio(row: any) { - const res = await updateSheetStatus(row.id, row.actualResult) - if (isResError(res)) return - massage.success('更新成功') -} - async function onSave() { if (!props.info) return + if (list.value.length === 0) { + massage.error('请先添加测试单') + return + } + const findErrorSheet = list.value.find((item: any) => item.status !== 1) + if (!!findErrorSheet) { + massage.error(`${findErrorSheet.name}测试单测试结果失败,成功后才能入库`) + return + } + const res = await updateTestSheetStatus({ // id: props.info.testSheetId, deviceId: props.info.id, @@ -116,6 +120,7 @@ async function loadDeviceTestSheet() { }) if (isResError(res)) return list.value = res.data + console.log(list.value) } const isShowDetail = ref(false) const sheetDetail = ref([]) diff --git a/src/pages/deviceInfo/index.vue b/src/pages/deviceInfo/index.vue index 73264e4..e36a788 100644 --- a/src/pages/deviceInfo/index.vue +++ b/src/pages/deviceInfo/index.vue @@ -80,7 +80,7 @@ 出库 - + 设备报修