Browse Source

fix:测试信息调整

master
wangqi 2 months ago
parent
commit
6506e3f568
  1. 1
      src/pages/deviceInfo/components/BasicInfo.vue
  2. 17
      src/pages/deviceInfo/components/TestInfo.vue
  3. 2
      src/pages/deviceInfo/index.vue

1
src/pages/deviceInfo/components/BasicInfo.vue

@ -179,6 +179,7 @@ async function onSave() { @@ -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

17
src/pages/deviceInfo/components/TestInfo.vue

@ -93,14 +93,18 @@ const isShowSaveButton = computed(() => { @@ -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() { @@ -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<any>([])

2
src/pages/deviceInfo/index.vue

@ -80,7 +80,7 @@ @@ -80,7 +80,7 @@
<el-dropdown-item command="delivery" v-if="scope.row.status === 2">
<Icon icon="solar:inbox-out-outline" />出库
</el-dropdown-item>
<el-dropdown-item command="maintain" v-if="scope.row.status === 3">
<el-dropdown-item command="maintain" v-if="scope.row.status >= 3">
<Icon icon="solar:minimalistic-magnifer-bug-outline" />设备报修
</el-dropdown-item>
</el-dropdown-menu>

Loading…
Cancel
Save