diff --git a/src/components.d.ts b/src/components.d.ts index f202da8..b9d5f3c 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,6 +14,7 @@ Auth: typeof import('./components/Auth/index.vue')['default'] AuthAll: typeof import('./components/AuthAll/index.vue')['default'] BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default'] + Benchcol: typeof import('./components/benchcol/index.vue')['default'] BenchCol: typeof import('./components/benchCol/index.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] diff --git a/src/components.d.ts b/src/components.d.ts index f202da8..b9d5f3c 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,6 +14,7 @@ Auth: typeof import('./components/Auth/index.vue')['default'] AuthAll: typeof import('./components/AuthAll/index.vue')['default'] BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default'] + Benchcol: typeof import('./components/benchcol/index.vue')['default'] BenchCol: typeof import('./components/benchCol/index.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] diff --git a/src/components/benchCol/index.vue b/src/components/benchCol/index.vue index ddd000a..8bc659d 100644 --- a/src/components/benchCol/index.vue +++ b/src/components/benchCol/index.vue @@ -44,7 +44,6 @@ .bench-left-top { border-radius: 10px; margin-top: 1%; - overflow: hidden; background-color: #fff; } diff --git a/src/components.d.ts b/src/components.d.ts index f202da8..b9d5f3c 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,6 +14,7 @@ Auth: typeof import('./components/Auth/index.vue')['default'] AuthAll: typeof import('./components/AuthAll/index.vue')['default'] BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default'] + Benchcol: typeof import('./components/benchcol/index.vue')['default'] BenchCol: typeof import('./components/benchCol/index.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] diff --git a/src/components/benchCol/index.vue b/src/components/benchCol/index.vue index ddd000a..8bc659d 100644 --- a/src/components/benchCol/index.vue +++ b/src/components/benchCol/index.vue @@ -44,7 +44,6 @@ .bench-left-top { border-radius: 10px; margin-top: 1%; - overflow: hidden; background-color: #fff; } diff --git a/src/components/echarts/index.vue b/src/components/echarts/index.vue deleted file mode 100644 index c385dae..0000000 --- a/src/components/echarts/index.vue +++ /dev/null @@ -1,163 +0,0 @@ - - - - - diff --git a/src/components.d.ts b/src/components.d.ts index f202da8..b9d5f3c 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,6 +14,7 @@ Auth: typeof import('./components/Auth/index.vue')['default'] AuthAll: typeof import('./components/AuthAll/index.vue')['default'] BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default'] + Benchcol: typeof import('./components/benchcol/index.vue')['default'] BenchCol: typeof import('./components/benchCol/index.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] diff --git a/src/components/benchCol/index.vue b/src/components/benchCol/index.vue index ddd000a..8bc659d 100644 --- a/src/components/benchCol/index.vue +++ b/src/components/benchCol/index.vue @@ -44,7 +44,6 @@ .bench-left-top { border-radius: 10px; margin-top: 1%; - overflow: hidden; background-color: #fff; } diff --git a/src/components/echarts/index.vue b/src/components/echarts/index.vue deleted file mode 100644 index c385dae..0000000 --- a/src/components/echarts/index.vue +++ /dev/null @@ -1,163 +0,0 @@ - - - - - diff --git a/src/components/echarts/pie.vue b/src/components/echarts/pie.vue deleted file mode 100644 index 1bbfb93..0000000 --- a/src/components/echarts/pie.vue +++ /dev/null @@ -1,100 +0,0 @@ - - - - - diff --git a/src/components.d.ts b/src/components.d.ts index f202da8..b9d5f3c 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,6 +14,7 @@ Auth: typeof import('./components/Auth/index.vue')['default'] AuthAll: typeof import('./components/AuthAll/index.vue')['default'] BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default'] + Benchcol: typeof import('./components/benchcol/index.vue')['default'] BenchCol: typeof import('./components/benchCol/index.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] diff --git a/src/components/benchCol/index.vue b/src/components/benchCol/index.vue index ddd000a..8bc659d 100644 --- a/src/components/benchCol/index.vue +++ b/src/components/benchCol/index.vue @@ -44,7 +44,6 @@ .bench-left-top { border-radius: 10px; margin-top: 1%; - overflow: hidden; background-color: #fff; } diff --git a/src/components/echarts/index.vue b/src/components/echarts/index.vue deleted file mode 100644 index c385dae..0000000 --- a/src/components/echarts/index.vue +++ /dev/null @@ -1,163 +0,0 @@ - - - - - diff --git a/src/components/echarts/pie.vue b/src/components/echarts/pie.vue deleted file mode 100644 index 1bbfb93..0000000 --- a/src/components/echarts/pie.vue +++ /dev/null @@ -1,100 +0,0 @@ - - - - - diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 483b6ad..ea13629 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -2,6 +2,7 @@ import { ref } from 'vue' import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' +import type { IOptions } from '../standard_interface' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -61,21 +62,16 @@ updateTime: null, version: null, }) -const checkTypeOptions = ref([]) -const transmitRangeOptions = ref([ - { name: '国家级', id: 0, value: 0 }, - { name: '省级', id: 1, value: 1 }, - { name: '本所', id: 2, value: 2 }, -]) +const checkTypeOptions = ref([]) -const standardOwnerOptions = ref([]) // 标准负责人 +const standardOwnerOptions = ref([]) // 标准负责人 const fileList = ref([]) // 文件对象数组 -const measureMajorList = ref([]) // 计量专业下拉框 -const standardManagerStateList = ref([]) // 管理状态下拉框 -const standardLevelList = ref([]) // 标准等级下拉框 -const transmitRangeList = ref([]) // 传递范围下拉框 +const measureMajorList = ref([]) // 计量专业下拉框 +const standardManagerStateList = ref([]) // 管理状态下拉框 +const standardLevelList = ref([]) // 标准等级下拉框 +const transmitRangeList = ref([]) // 传递范围下拉框 // 标准所在部门下拉框 -const standardUsersDeptList = ref([]) +const standardUsersDeptList = ref([]) // 获取下拉框 const getSelectList = (code: string) => { getTypeSelect(code).then((res) => { @@ -154,22 +150,18 @@ assessDate: [{ required: true, message: '考核日期不能为空', trigger: 'blur' }], uncertainty: [{ required: true, message: '不确定度不能为空', trigger: 'blur' }], mesureRange: [{ required: true, message: '测量范围不能为空', trigger: 'blur' }], - standardTemperature: [{ required: true, message: '标准温度不能为空', trigger: 'blur' }], - standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }], - abc: [{ required: true, message: '证书编号不能为空', trigger: 'blur' }], - // standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }], - + standardTemperature: [{ required: true, message: '标准温度不能为空', trigger: 'blur' }, + { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准温度只能为数字', trigger: 'blur' }], + standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }, + { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准湿度只能为数字', trigger: 'blur' }], }) // 表单验证规则 // 上传请求 const uploadQuarterlyEvaluateFile = (file: File) => { - UploadFile(file).then((res) => { + const fd = new FormData() + fd.append('multipartFile', file.file) + UploadFile(fd).then((res) => { if (res.code === 200) { - formInline.value.minioFileName = res.data.fileName - // fileList.value.push({ - // name: res.data.fileName, - // url: res.data.fileId, - // // type: file.file.type, - // }) + formInline.value.fileList = res.data // 重置当前验证 ElMessage.success('文件上传成功') } @@ -201,18 +193,17 @@ testForm.value.fileList = fileList const reader = new FileReader() reader.readAsText(files.raw) - reader.onload = (e) => { - testForm.value.fileContent = e.target!.result?.replace( - /\n|\r\n/g, - '
', - ) - } + // reader.onload = (e) => { + // testForm.value.fileContent = e.target!.result?.replace( + // /\n|\r\n/g, + // '
', + // ) + // } } // 编辑获取详情的提交按钮 const submitFormDetail = () => { if (props.buttonType === '编辑') { formInline.value.id = props.infoId - formInline.value.laboratoryOwner = null getStandardLisUpdate(formInline.value).then((res) => { if (res.code === 200) { close() @@ -232,10 +223,10 @@ } } // 提交 -const submitForm = async (formEl: FormInstance | undefined) => { +const submitForm = (formEl: FormInstance | undefined) => { if (!formEl) { return } if (props.buttonType === '详情') { return submitFormDetail() } - await formEl.validate((valid, fields) => { + formEl.validate((valid, fields) => { if (valid) { ElMessageBox.confirm( '确认提交吗?', @@ -257,19 +248,29 @@ } }) } +// 标准实验室发生改变row类型 +interface rowReturn { + phone: string + director: string +} // 标准实验室发生改变 const changeDeptList = (row: object) => { formInline.value.laboratoryOwnerContact = row.phone - formInline.value.laboratoryOwnerName = row.director + formInline.value.laboratoryOwner = row.director } // 标准实验室清空时 const clearDeptList = () => { formInline.value.laboratoryOwnerContact = null - formInline.value.laboratoryOwnerName = null + formInline.value.laboratoryOwner = null } // 获取详情信息 const getInfo = () => { getStandardListDetail({ id: props.infoId }).then((res) => { + Object.keys(res.data).map((item) => { + if (typeof (res.data[item]) === 'number') { + res.data[item] = res.data[item].toString() + } + }) formInline.value = res.data }) } @@ -285,7 +286,11 @@ 测量标准装置
- + {{ buttonType === '详情' ? '打印' : '提交' }} @@ -351,7 +356,10 @@ - + @@ -488,7 +496,7 @@ @@ -641,10 +649,7 @@ - + diff --git a/src/components.d.ts b/src/components.d.ts index f202da8..b9d5f3c 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,6 +14,7 @@ Auth: typeof import('./components/Auth/index.vue')['default'] AuthAll: typeof import('./components/AuthAll/index.vue')['default'] BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default'] + Benchcol: typeof import('./components/benchcol/index.vue')['default'] BenchCol: typeof import('./components/benchCol/index.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] diff --git a/src/components/benchCol/index.vue b/src/components/benchCol/index.vue index ddd000a..8bc659d 100644 --- a/src/components/benchCol/index.vue +++ b/src/components/benchCol/index.vue @@ -44,7 +44,6 @@ .bench-left-top { border-radius: 10px; margin-top: 1%; - overflow: hidden; background-color: #fff; } diff --git a/src/components/echarts/index.vue b/src/components/echarts/index.vue deleted file mode 100644 index c385dae..0000000 --- a/src/components/echarts/index.vue +++ /dev/null @@ -1,163 +0,0 @@ - - - - - diff --git a/src/components/echarts/pie.vue b/src/components/echarts/pie.vue deleted file mode 100644 index 1bbfb93..0000000 --- a/src/components/echarts/pie.vue +++ /dev/null @@ -1,100 +0,0 @@ - - - - - diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 483b6ad..ea13629 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -2,6 +2,7 @@ import { ref } from 'vue' import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' +import type { IOptions } from '../standard_interface' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -61,21 +62,16 @@ updateTime: null, version: null, }) -const checkTypeOptions = ref([]) -const transmitRangeOptions = ref([ - { name: '国家级', id: 0, value: 0 }, - { name: '省级', id: 1, value: 1 }, - { name: '本所', id: 2, value: 2 }, -]) +const checkTypeOptions = ref([]) -const standardOwnerOptions = ref([]) // 标准负责人 +const standardOwnerOptions = ref([]) // 标准负责人 const fileList = ref([]) // 文件对象数组 -const measureMajorList = ref([]) // 计量专业下拉框 -const standardManagerStateList = ref([]) // 管理状态下拉框 -const standardLevelList = ref([]) // 标准等级下拉框 -const transmitRangeList = ref([]) // 传递范围下拉框 +const measureMajorList = ref([]) // 计量专业下拉框 +const standardManagerStateList = ref([]) // 管理状态下拉框 +const standardLevelList = ref([]) // 标准等级下拉框 +const transmitRangeList = ref([]) // 传递范围下拉框 // 标准所在部门下拉框 -const standardUsersDeptList = ref([]) +const standardUsersDeptList = ref([]) // 获取下拉框 const getSelectList = (code: string) => { getTypeSelect(code).then((res) => { @@ -154,22 +150,18 @@ assessDate: [{ required: true, message: '考核日期不能为空', trigger: 'blur' }], uncertainty: [{ required: true, message: '不确定度不能为空', trigger: 'blur' }], mesureRange: [{ required: true, message: '测量范围不能为空', trigger: 'blur' }], - standardTemperature: [{ required: true, message: '标准温度不能为空', trigger: 'blur' }], - standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }], - abc: [{ required: true, message: '证书编号不能为空', trigger: 'blur' }], - // standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }], - + standardTemperature: [{ required: true, message: '标准温度不能为空', trigger: 'blur' }, + { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准温度只能为数字', trigger: 'blur' }], + standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }, + { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准湿度只能为数字', trigger: 'blur' }], }) // 表单验证规则 // 上传请求 const uploadQuarterlyEvaluateFile = (file: File) => { - UploadFile(file).then((res) => { + const fd = new FormData() + fd.append('multipartFile', file.file) + UploadFile(fd).then((res) => { if (res.code === 200) { - formInline.value.minioFileName = res.data.fileName - // fileList.value.push({ - // name: res.data.fileName, - // url: res.data.fileId, - // // type: file.file.type, - // }) + formInline.value.fileList = res.data // 重置当前验证 ElMessage.success('文件上传成功') } @@ -201,18 +193,17 @@ testForm.value.fileList = fileList const reader = new FileReader() reader.readAsText(files.raw) - reader.onload = (e) => { - testForm.value.fileContent = e.target!.result?.replace( - /\n|\r\n/g, - '
', - ) - } + // reader.onload = (e) => { + // testForm.value.fileContent = e.target!.result?.replace( + // /\n|\r\n/g, + // '
', + // ) + // } } // 编辑获取详情的提交按钮 const submitFormDetail = () => { if (props.buttonType === '编辑') { formInline.value.id = props.infoId - formInline.value.laboratoryOwner = null getStandardLisUpdate(formInline.value).then((res) => { if (res.code === 200) { close() @@ -232,10 +223,10 @@ } } // 提交 -const submitForm = async (formEl: FormInstance | undefined) => { +const submitForm = (formEl: FormInstance | undefined) => { if (!formEl) { return } if (props.buttonType === '详情') { return submitFormDetail() } - await formEl.validate((valid, fields) => { + formEl.validate((valid, fields) => { if (valid) { ElMessageBox.confirm( '确认提交吗?', @@ -257,19 +248,29 @@ } }) } +// 标准实验室发生改变row类型 +interface rowReturn { + phone: string + director: string +} // 标准实验室发生改变 const changeDeptList = (row: object) => { formInline.value.laboratoryOwnerContact = row.phone - formInline.value.laboratoryOwnerName = row.director + formInline.value.laboratoryOwner = row.director } // 标准实验室清空时 const clearDeptList = () => { formInline.value.laboratoryOwnerContact = null - formInline.value.laboratoryOwnerName = null + formInline.value.laboratoryOwner = null } // 获取详情信息 const getInfo = () => { getStandardListDetail({ id: props.infoId }).then((res) => { + Object.keys(res.data).map((item) => { + if (typeof (res.data[item]) === 'number') { + res.data[item] = res.data[item].toString() + } + }) formInline.value = res.data }) } @@ -285,7 +286,11 @@ 测量标准装置
- + {{ buttonType === '详情' ? '打印' : '提交' }} @@ -351,7 +356,10 @@ - + @@ -488,7 +496,7 @@ @@ -641,10 +649,7 @@ - + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index e3ec8d3..35786b2 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -1,11 +1,379 @@ - diff --git a/src/components/echarts/index.vue b/src/components/echarts/index.vue deleted file mode 100644 index c385dae..0000000 --- a/src/components/echarts/index.vue +++ /dev/null @@ -1,163 +0,0 @@ - - - - - diff --git a/src/components/echarts/pie.vue b/src/components/echarts/pie.vue deleted file mode 100644 index 1bbfb93..0000000 --- a/src/components/echarts/pie.vue +++ /dev/null @@ -1,100 +0,0 @@ - - - - - diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 483b6ad..ea13629 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -2,6 +2,7 @@ import { ref } from 'vue' import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' +import type { IOptions } from '../standard_interface' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -61,21 +62,16 @@ updateTime: null, version: null, }) -const checkTypeOptions = ref([]) -const transmitRangeOptions = ref([ - { name: '国家级', id: 0, value: 0 }, - { name: '省级', id: 1, value: 1 }, - { name: '本所', id: 2, value: 2 }, -]) +const checkTypeOptions = ref([]) -const standardOwnerOptions = ref([]) // 标准负责人 +const standardOwnerOptions = ref([]) // 标准负责人 const fileList = ref([]) // 文件对象数组 -const measureMajorList = ref([]) // 计量专业下拉框 -const standardManagerStateList = ref([]) // 管理状态下拉框 -const standardLevelList = ref([]) // 标准等级下拉框 -const transmitRangeList = ref([]) // 传递范围下拉框 +const measureMajorList = ref([]) // 计量专业下拉框 +const standardManagerStateList = ref([]) // 管理状态下拉框 +const standardLevelList = ref([]) // 标准等级下拉框 +const transmitRangeList = ref([]) // 传递范围下拉框 // 标准所在部门下拉框 -const standardUsersDeptList = ref([]) +const standardUsersDeptList = ref([]) // 获取下拉框 const getSelectList = (code: string) => { getTypeSelect(code).then((res) => { @@ -154,22 +150,18 @@ assessDate: [{ required: true, message: '考核日期不能为空', trigger: 'blur' }], uncertainty: [{ required: true, message: '不确定度不能为空', trigger: 'blur' }], mesureRange: [{ required: true, message: '测量范围不能为空', trigger: 'blur' }], - standardTemperature: [{ required: true, message: '标准温度不能为空', trigger: 'blur' }], - standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }], - abc: [{ required: true, message: '证书编号不能为空', trigger: 'blur' }], - // standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }], - + standardTemperature: [{ required: true, message: '标准温度不能为空', trigger: 'blur' }, + { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准温度只能为数字', trigger: 'blur' }], + standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }, + { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准湿度只能为数字', trigger: 'blur' }], }) // 表单验证规则 // 上传请求 const uploadQuarterlyEvaluateFile = (file: File) => { - UploadFile(file).then((res) => { + const fd = new FormData() + fd.append('multipartFile', file.file) + UploadFile(fd).then((res) => { if (res.code === 200) { - formInline.value.minioFileName = res.data.fileName - // fileList.value.push({ - // name: res.data.fileName, - // url: res.data.fileId, - // // type: file.file.type, - // }) + formInline.value.fileList = res.data // 重置当前验证 ElMessage.success('文件上传成功') } @@ -201,18 +193,17 @@ testForm.value.fileList = fileList const reader = new FileReader() reader.readAsText(files.raw) - reader.onload = (e) => { - testForm.value.fileContent = e.target!.result?.replace( - /\n|\r\n/g, - '
', - ) - } + // reader.onload = (e) => { + // testForm.value.fileContent = e.target!.result?.replace( + // /\n|\r\n/g, + // '
', + // ) + // } } // 编辑获取详情的提交按钮 const submitFormDetail = () => { if (props.buttonType === '编辑') { formInline.value.id = props.infoId - formInline.value.laboratoryOwner = null getStandardLisUpdate(formInline.value).then((res) => { if (res.code === 200) { close() @@ -232,10 +223,10 @@ } } // 提交 -const submitForm = async (formEl: FormInstance | undefined) => { +const submitForm = (formEl: FormInstance | undefined) => { if (!formEl) { return } if (props.buttonType === '详情') { return submitFormDetail() } - await formEl.validate((valid, fields) => { + formEl.validate((valid, fields) => { if (valid) { ElMessageBox.confirm( '确认提交吗?', @@ -257,19 +248,29 @@ } }) } +// 标准实验室发生改变row类型 +interface rowReturn { + phone: string + director: string +} // 标准实验室发生改变 const changeDeptList = (row: object) => { formInline.value.laboratoryOwnerContact = row.phone - formInline.value.laboratoryOwnerName = row.director + formInline.value.laboratoryOwner = row.director } // 标准实验室清空时 const clearDeptList = () => { formInline.value.laboratoryOwnerContact = null - formInline.value.laboratoryOwnerName = null + formInline.value.laboratoryOwner = null } // 获取详情信息 const getInfo = () => { getStandardListDetail({ id: props.infoId }).then((res) => { + Object.keys(res.data).map((item) => { + if (typeof (res.data[item]) === 'number') { + res.data[item] = res.data[item].toString() + } + }) formInline.value = res.data }) } @@ -285,7 +286,11 @@ 测量标准装置
- + {{ buttonType === '详情' ? '打印' : '提交' }} @@ -351,7 +356,10 @@ - + @@ -488,7 +496,7 @@ @@ -641,10 +649,7 @@ - + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index e3ec8d3..35786b2 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -1,11 +1,379 @@ - diff --git a/src/components/echarts/index.vue b/src/components/echarts/index.vue deleted file mode 100644 index c385dae..0000000 --- a/src/components/echarts/index.vue +++ /dev/null @@ -1,163 +0,0 @@ - - - - - diff --git a/src/components/echarts/pie.vue b/src/components/echarts/pie.vue deleted file mode 100644 index 1bbfb93..0000000 --- a/src/components/echarts/pie.vue +++ /dev/null @@ -1,100 +0,0 @@ - - - - - diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 483b6ad..ea13629 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -2,6 +2,7 @@ import { ref } from 'vue' import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' +import type { IOptions } from '../standard_interface' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -61,21 +62,16 @@ updateTime: null, version: null, }) -const checkTypeOptions = ref([]) -const transmitRangeOptions = ref([ - { name: '国家级', id: 0, value: 0 }, - { name: '省级', id: 1, value: 1 }, - { name: '本所', id: 2, value: 2 }, -]) +const checkTypeOptions = ref([]) -const standardOwnerOptions = ref([]) // 标准负责人 +const standardOwnerOptions = ref([]) // 标准负责人 const fileList = ref([]) // 文件对象数组 -const measureMajorList = ref([]) // 计量专业下拉框 -const standardManagerStateList = ref([]) // 管理状态下拉框 -const standardLevelList = ref([]) // 标准等级下拉框 -const transmitRangeList = ref([]) // 传递范围下拉框 +const measureMajorList = ref([]) // 计量专业下拉框 +const standardManagerStateList = ref([]) // 管理状态下拉框 +const standardLevelList = ref([]) // 标准等级下拉框 +const transmitRangeList = ref([]) // 传递范围下拉框 // 标准所在部门下拉框 -const standardUsersDeptList = ref([]) +const standardUsersDeptList = ref([]) // 获取下拉框 const getSelectList = (code: string) => { getTypeSelect(code).then((res) => { @@ -154,22 +150,18 @@ assessDate: [{ required: true, message: '考核日期不能为空', trigger: 'blur' }], uncertainty: [{ required: true, message: '不确定度不能为空', trigger: 'blur' }], mesureRange: [{ required: true, message: '测量范围不能为空', trigger: 'blur' }], - standardTemperature: [{ required: true, message: '标准温度不能为空', trigger: 'blur' }], - standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }], - abc: [{ required: true, message: '证书编号不能为空', trigger: 'blur' }], - // standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }], - + standardTemperature: [{ required: true, message: '标准温度不能为空', trigger: 'blur' }, + { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准温度只能为数字', trigger: 'blur' }], + standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }, + { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准湿度只能为数字', trigger: 'blur' }], }) // 表单验证规则 // 上传请求 const uploadQuarterlyEvaluateFile = (file: File) => { - UploadFile(file).then((res) => { + const fd = new FormData() + fd.append('multipartFile', file.file) + UploadFile(fd).then((res) => { if (res.code === 200) { - formInline.value.minioFileName = res.data.fileName - // fileList.value.push({ - // name: res.data.fileName, - // url: res.data.fileId, - // // type: file.file.type, - // }) + formInline.value.fileList = res.data // 重置当前验证 ElMessage.success('文件上传成功') } @@ -201,18 +193,17 @@ testForm.value.fileList = fileList const reader = new FileReader() reader.readAsText(files.raw) - reader.onload = (e) => { - testForm.value.fileContent = e.target!.result?.replace( - /\n|\r\n/g, - '
', - ) - } + // reader.onload = (e) => { + // testForm.value.fileContent = e.target!.result?.replace( + // /\n|\r\n/g, + // '
', + // ) + // } } // 编辑获取详情的提交按钮 const submitFormDetail = () => { if (props.buttonType === '编辑') { formInline.value.id = props.infoId - formInline.value.laboratoryOwner = null getStandardLisUpdate(formInline.value).then((res) => { if (res.code === 200) { close() @@ -232,10 +223,10 @@ } } // 提交 -const submitForm = async (formEl: FormInstance | undefined) => { +const submitForm = (formEl: FormInstance | undefined) => { if (!formEl) { return } if (props.buttonType === '详情') { return submitFormDetail() } - await formEl.validate((valid, fields) => { + formEl.validate((valid, fields) => { if (valid) { ElMessageBox.confirm( '确认提交吗?', @@ -257,19 +248,29 @@ } }) } +// 标准实验室发生改变row类型 +interface rowReturn { + phone: string + director: string +} // 标准实验室发生改变 const changeDeptList = (row: object) => { formInline.value.laboratoryOwnerContact = row.phone - formInline.value.laboratoryOwnerName = row.director + formInline.value.laboratoryOwner = row.director } // 标准实验室清空时 const clearDeptList = () => { formInline.value.laboratoryOwnerContact = null - formInline.value.laboratoryOwnerName = null + formInline.value.laboratoryOwner = null } // 获取详情信息 const getInfo = () => { getStandardListDetail({ id: props.infoId }).then((res) => { + Object.keys(res.data).map((item) => { + if (typeof (res.data[item]) === 'number') { + res.data[item] = res.data[item].toString() + } + }) formInline.value = res.data }) } @@ -285,7 +286,11 @@ 测量标准装置
- + {{ buttonType === '详情' ? '打印' : '提交' }} @@ -351,7 +356,10 @@ - + @@ -488,7 +496,7 @@ @@ -641,10 +649,7 @@ - + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index e3ec8d3..35786b2 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -1,11 +1,379 @@ - diff --git a/src/components/echarts/index.vue b/src/components/echarts/index.vue deleted file mode 100644 index c385dae..0000000 --- a/src/components/echarts/index.vue +++ /dev/null @@ -1,163 +0,0 @@ - - - - - diff --git a/src/components/echarts/pie.vue b/src/components/echarts/pie.vue deleted file mode 100644 index 1bbfb93..0000000 --- a/src/components/echarts/pie.vue +++ /dev/null @@ -1,100 +0,0 @@ - - - - - diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 483b6ad..ea13629 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -2,6 +2,7 @@ import { ref } from 'vue' import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' +import type { IOptions } from '../standard_interface' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -61,21 +62,16 @@ updateTime: null, version: null, }) -const checkTypeOptions = ref([]) -const transmitRangeOptions = ref([ - { name: '国家级', id: 0, value: 0 }, - { name: '省级', id: 1, value: 1 }, - { name: '本所', id: 2, value: 2 }, -]) +const checkTypeOptions = ref([]) -const standardOwnerOptions = ref([]) // 标准负责人 +const standardOwnerOptions = ref([]) // 标准负责人 const fileList = ref([]) // 文件对象数组 -const measureMajorList = ref([]) // 计量专业下拉框 -const standardManagerStateList = ref([]) // 管理状态下拉框 -const standardLevelList = ref([]) // 标准等级下拉框 -const transmitRangeList = ref([]) // 传递范围下拉框 +const measureMajorList = ref([]) // 计量专业下拉框 +const standardManagerStateList = ref([]) // 管理状态下拉框 +const standardLevelList = ref([]) // 标准等级下拉框 +const transmitRangeList = ref([]) // 传递范围下拉框 // 标准所在部门下拉框 -const standardUsersDeptList = ref([]) +const standardUsersDeptList = ref([]) // 获取下拉框 const getSelectList = (code: string) => { getTypeSelect(code).then((res) => { @@ -154,22 +150,18 @@ assessDate: [{ required: true, message: '考核日期不能为空', trigger: 'blur' }], uncertainty: [{ required: true, message: '不确定度不能为空', trigger: 'blur' }], mesureRange: [{ required: true, message: '测量范围不能为空', trigger: 'blur' }], - standardTemperature: [{ required: true, message: '标准温度不能为空', trigger: 'blur' }], - standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }], - abc: [{ required: true, message: '证书编号不能为空', trigger: 'blur' }], - // standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }], - + standardTemperature: [{ required: true, message: '标准温度不能为空', trigger: 'blur' }, + { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准温度只能为数字', trigger: 'blur' }], + standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }, + { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准湿度只能为数字', trigger: 'blur' }], }) // 表单验证规则 // 上传请求 const uploadQuarterlyEvaluateFile = (file: File) => { - UploadFile(file).then((res) => { + const fd = new FormData() + fd.append('multipartFile', file.file) + UploadFile(fd).then((res) => { if (res.code === 200) { - formInline.value.minioFileName = res.data.fileName - // fileList.value.push({ - // name: res.data.fileName, - // url: res.data.fileId, - // // type: file.file.type, - // }) + formInline.value.fileList = res.data // 重置当前验证 ElMessage.success('文件上传成功') } @@ -201,18 +193,17 @@ testForm.value.fileList = fileList const reader = new FileReader() reader.readAsText(files.raw) - reader.onload = (e) => { - testForm.value.fileContent = e.target!.result?.replace( - /\n|\r\n/g, - '
', - ) - } + // reader.onload = (e) => { + // testForm.value.fileContent = e.target!.result?.replace( + // /\n|\r\n/g, + // '
', + // ) + // } } // 编辑获取详情的提交按钮 const submitFormDetail = () => { if (props.buttonType === '编辑') { formInline.value.id = props.infoId - formInline.value.laboratoryOwner = null getStandardLisUpdate(formInline.value).then((res) => { if (res.code === 200) { close() @@ -232,10 +223,10 @@ } } // 提交 -const submitForm = async (formEl: FormInstance | undefined) => { +const submitForm = (formEl: FormInstance | undefined) => { if (!formEl) { return } if (props.buttonType === '详情') { return submitFormDetail() } - await formEl.validate((valid, fields) => { + formEl.validate((valid, fields) => { if (valid) { ElMessageBox.confirm( '确认提交吗?', @@ -257,19 +248,29 @@ } }) } +// 标准实验室发生改变row类型 +interface rowReturn { + phone: string + director: string +} // 标准实验室发生改变 const changeDeptList = (row: object) => { formInline.value.laboratoryOwnerContact = row.phone - formInline.value.laboratoryOwnerName = row.director + formInline.value.laboratoryOwner = row.director } // 标准实验室清空时 const clearDeptList = () => { formInline.value.laboratoryOwnerContact = null - formInline.value.laboratoryOwnerName = null + formInline.value.laboratoryOwner = null } // 获取详情信息 const getInfo = () => { getStandardListDetail({ id: props.infoId }).then((res) => { + Object.keys(res.data).map((item) => { + if (typeof (res.data[item]) === 'number') { + res.data[item] = res.data[item].toString() + } + }) formInline.value = res.data }) } @@ -285,7 +286,11 @@ 测量标准装置
- + {{ buttonType === '详情' ? '打印' : '提交' }} @@ -351,7 +356,10 @@ - + @@ -488,7 +496,7 @@ @@ -641,10 +649,7 @@ - + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index e3ec8d3..35786b2 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -1,11 +1,379 @@ - diff --git a/src/components.d.ts b/src/components.d.ts index f202da8..b9d5f3c 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,6 +14,7 @@ Auth: typeof import('./components/Auth/index.vue')['default'] AuthAll: typeof import('./components/AuthAll/index.vue')['default'] BatchActionBar: typeof import('./components/BatchActionBar/index.vue')['default'] + Benchcol: typeof import('./components/benchcol/index.vue')['default'] BenchCol: typeof import('./components/benchCol/index.vue')['default'] ConditionDrawer: typeof import('./components/drawer/conditionDrawer.vue')['default'] CopyerDrawer: typeof import('./components/drawer/copyerDrawer.vue')['default'] diff --git a/src/components/benchCol/index.vue b/src/components/benchCol/index.vue index ddd000a..8bc659d 100644 --- a/src/components/benchCol/index.vue +++ b/src/components/benchCol/index.vue @@ -44,7 +44,6 @@ .bench-left-top { border-radius: 10px; margin-top: 1%; - overflow: hidden; background-color: #fff; } diff --git a/src/components/echarts/index.vue b/src/components/echarts/index.vue deleted file mode 100644 index c385dae..0000000 --- a/src/components/echarts/index.vue +++ /dev/null @@ -1,163 +0,0 @@ - - - - - diff --git a/src/components/echarts/pie.vue b/src/components/echarts/pie.vue deleted file mode 100644 index 1bbfb93..0000000 --- a/src/components/echarts/pie.vue +++ /dev/null @@ -1,100 +0,0 @@ - - - - - diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 483b6ad..ea13629 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -2,6 +2,7 @@ import { ref } from 'vue' import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' +import type { IOptions } from '../standard_interface' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' @@ -61,21 +62,16 @@ updateTime: null, version: null, }) -const checkTypeOptions = ref([]) -const transmitRangeOptions = ref([ - { name: '国家级', id: 0, value: 0 }, - { name: '省级', id: 1, value: 1 }, - { name: '本所', id: 2, value: 2 }, -]) +const checkTypeOptions = ref([]) -const standardOwnerOptions = ref([]) // 标准负责人 +const standardOwnerOptions = ref([]) // 标准负责人 const fileList = ref([]) // 文件对象数组 -const measureMajorList = ref([]) // 计量专业下拉框 -const standardManagerStateList = ref([]) // 管理状态下拉框 -const standardLevelList = ref([]) // 标准等级下拉框 -const transmitRangeList = ref([]) // 传递范围下拉框 +const measureMajorList = ref([]) // 计量专业下拉框 +const standardManagerStateList = ref([]) // 管理状态下拉框 +const standardLevelList = ref([]) // 标准等级下拉框 +const transmitRangeList = ref([]) // 传递范围下拉框 // 标准所在部门下拉框 -const standardUsersDeptList = ref([]) +const standardUsersDeptList = ref([]) // 获取下拉框 const getSelectList = (code: string) => { getTypeSelect(code).then((res) => { @@ -154,22 +150,18 @@ assessDate: [{ required: true, message: '考核日期不能为空', trigger: 'blur' }], uncertainty: [{ required: true, message: '不确定度不能为空', trigger: 'blur' }], mesureRange: [{ required: true, message: '测量范围不能为空', trigger: 'blur' }], - standardTemperature: [{ required: true, message: '标准温度不能为空', trigger: 'blur' }], - standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }], - abc: [{ required: true, message: '证书编号不能为空', trigger: 'blur' }], - // standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }], - + standardTemperature: [{ required: true, message: '标准温度不能为空', trigger: 'blur' }, + { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准温度只能为数字', trigger: 'blur' }], + standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }, + { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准湿度只能为数字', trigger: 'blur' }], }) // 表单验证规则 // 上传请求 const uploadQuarterlyEvaluateFile = (file: File) => { - UploadFile(file).then((res) => { + const fd = new FormData() + fd.append('multipartFile', file.file) + UploadFile(fd).then((res) => { if (res.code === 200) { - formInline.value.minioFileName = res.data.fileName - // fileList.value.push({ - // name: res.data.fileName, - // url: res.data.fileId, - // // type: file.file.type, - // }) + formInline.value.fileList = res.data // 重置当前验证 ElMessage.success('文件上传成功') } @@ -201,18 +193,17 @@ testForm.value.fileList = fileList const reader = new FileReader() reader.readAsText(files.raw) - reader.onload = (e) => { - testForm.value.fileContent = e.target!.result?.replace( - /\n|\r\n/g, - '
', - ) - } + // reader.onload = (e) => { + // testForm.value.fileContent = e.target!.result?.replace( + // /\n|\r\n/g, + // '
', + // ) + // } } // 编辑获取详情的提交按钮 const submitFormDetail = () => { if (props.buttonType === '编辑') { formInline.value.id = props.infoId - formInline.value.laboratoryOwner = null getStandardLisUpdate(formInline.value).then((res) => { if (res.code === 200) { close() @@ -232,10 +223,10 @@ } } // 提交 -const submitForm = async (formEl: FormInstance | undefined) => { +const submitForm = (formEl: FormInstance | undefined) => { if (!formEl) { return } if (props.buttonType === '详情') { return submitFormDetail() } - await formEl.validate((valid, fields) => { + formEl.validate((valid, fields) => { if (valid) { ElMessageBox.confirm( '确认提交吗?', @@ -257,19 +248,29 @@ } }) } +// 标准实验室发生改变row类型 +interface rowReturn { + phone: string + director: string +} // 标准实验室发生改变 const changeDeptList = (row: object) => { formInline.value.laboratoryOwnerContact = row.phone - formInline.value.laboratoryOwnerName = row.director + formInline.value.laboratoryOwner = row.director } // 标准实验室清空时 const clearDeptList = () => { formInline.value.laboratoryOwnerContact = null - formInline.value.laboratoryOwnerName = null + formInline.value.laboratoryOwner = null } // 获取详情信息 const getInfo = () => { getStandardListDetail({ id: props.infoId }).then((res) => { + Object.keys(res.data).map((item) => { + if (typeof (res.data[item]) === 'number') { + res.data[item] = res.data[item].toString() + } + }) formInline.value = res.data }) } @@ -285,7 +286,11 @@ 测量标准装置
- + {{ buttonType === '详情' ? '打印' : '提交' }} @@ -351,7 +356,10 @@ - + @@ -488,7 +496,7 @@ @@ -641,10 +649,7 @@ - + diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index e3ec8d3..35786b2 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -1,11 +1,379 @@ - diff --git a/src/views/measure/price/list.vue b/src/views/measure/price/list.vue index 45a3806..5ddc014 100644 --- a/src/views/measure/price/list.vue +++ b/src/views/measure/price/list.vue @@ -2,7 +2,7 @@ import { getCurrentInstance, ref } from 'vue' import type { Ref } from 'vue' import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' -import type { IlistQuery, IlistType } from './list_interface' +import type { IlistQuery, IlistType, optionsType } from './list_interface' import ListPriceAdd from './priceAdd.vue' import { getDeletePrice, getPriceList, getTypeSelect, uploadPrice } from '@/api/system/price' import { exportExcel } from '@/utils/exportXlsx' @@ -88,11 +88,11 @@ // 详情id const infoId = ref('0') // 校验类型下拉框数组 -const checkTypeOptions = ref([]) +const checkTypeOptions = ref([]) // 类别下拉框数组 -const priceTypeOptions = ref([]) +const priceTypeOptions = ref([]) // 项目下拉框数组 -const priceItemOptions = ref([]) +const priceItemOptions = ref([]) const isPopconfirmShow = ref(false) // 点击按钮 const buttonType = ref('') @@ -110,14 +110,19 @@ const handleSelectionChange = (e: any) => { checkoutList.value = e } +// 点击编辑id和删除row类型 +interface rowReturn { + id: string + priceName: string +} // 点击编辑/详情 -const handleEdit = (index: string, row: object, value: string) => { +const handleEdit = (index: string, row: rowReturn, value: string) => { buttonType.value = value infoId.value = row.id show.value = false } // 点击删除 -const handleDelete = (index: string, row: object) => { +const handleDelete = (index: string, row: rowReturn) => { console.log(row) ElMessageBox.confirm( `确认删除${row.priceName}吗?`, @@ -347,10 +352,10 @@