diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 6a6d694..4f0d99c 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -27,3 +27,31 @@ data, }) } + +// 详情信息 +export function getStandardListDetail(data: object) { + return request({ + url: `${prefix}/standard/detail`, + method: 'post', + data, + }) +} + +// 更新信息 +export function getStandardLisUpdate(data: object) { + return request({ + url: `${prefix}/standard/update`, + method: 'post', + data, + }) +} + +// 获取部门信息 +export function getUsersDept(data: object) { + return request({ + url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 6a6d694..4f0d99c 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -27,3 +27,31 @@ data, }) } + +// 详情信息 +export function getStandardListDetail(data: object) { + return request({ + url: `${prefix}/standard/detail`, + method: 'post', + data, + }) +} + +// 更新信息 +export function getStandardLisUpdate(data: object) { + return request({ + url: `${prefix}/standard/update`, + method: 'post', + data, + }) +} + +// 获取部门信息 +export function getUsersDept(data: object) { + return request({ + url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + diff --git a/src/components.d.ts b/src/components.d.ts index 0bb0edd..276ffec 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,6 +14,8 @@ 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'] Copyright: typeof import('./components/Copyright/index.vue')['default'] diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 6a6d694..4f0d99c 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -27,3 +27,31 @@ data, }) } + +// 详情信息 +export function getStandardListDetail(data: object) { + return request({ + url: `${prefix}/standard/detail`, + method: 'post', + data, + }) +} + +// 更新信息 +export function getStandardLisUpdate(data: object) { + return request({ + url: `${prefix}/standard/update`, + method: 'post', + data, + }) +} + +// 获取部门信息 +export function getUsersDept(data: object) { + return request({ + url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + diff --git a/src/components.d.ts b/src/components.d.ts index 0bb0edd..276ffec 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,6 +14,8 @@ 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'] Copyright: typeof import('./components/Copyright/index.vue')['default'] diff --git a/src/components/benchCol/index.vue b/src/components/benchCol/index.vue new file mode 100644 index 0000000..ddd000a --- /dev/null +++ b/src/components/benchCol/index.vue @@ -0,0 +1,51 @@ + + + + + + + {{ title }} + + 更多 > + + + + + + + diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 6a6d694..4f0d99c 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -27,3 +27,31 @@ data, }) } + +// 详情信息 +export function getStandardListDetail(data: object) { + return request({ + url: `${prefix}/standard/detail`, + method: 'post', + data, + }) +} + +// 更新信息 +export function getStandardLisUpdate(data: object) { + return request({ + url: `${prefix}/standard/update`, + method: 'post', + data, + }) +} + +// 获取部门信息 +export function getUsersDept(data: object) { + return request({ + url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + diff --git a/src/components.d.ts b/src/components.d.ts index 0bb0edd..276ffec 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,6 +14,8 @@ 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'] Copyright: typeof import('./components/Copyright/index.vue')['default'] diff --git a/src/components/benchCol/index.vue b/src/components/benchCol/index.vue new file mode 100644 index 0000000..ddd000a --- /dev/null +++ b/src/components/benchCol/index.vue @@ -0,0 +1,51 @@ + + + + + + + {{ title }} + + 更多 > + + + + + + + diff --git a/src/components/echarts/index.vue b/src/components/echarts/index.vue index 1f6f6aa..c385dae 100644 --- a/src/components/echarts/index.vue +++ b/src/components/echarts/index.vue @@ -107,7 +107,7 @@ symbolSize: 2, // 拐点大小 // 折线条的样式 lineStyle: { - color: '#58abf0', + color: '#3d7eff', }, // 折线拐点的样式 itemStyle: { @@ -158,6 +158,6 @@ diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 6a6d694..4f0d99c 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -27,3 +27,31 @@ data, }) } + +// 详情信息 +export function getStandardListDetail(data: object) { + return request({ + url: `${prefix}/standard/detail`, + method: 'post', + data, + }) +} + +// 更新信息 +export function getStandardLisUpdate(data: object) { + return request({ + url: `${prefix}/standard/update`, + method: 'post', + data, + }) +} + +// 获取部门信息 +export function getUsersDept(data: object) { + return request({ + url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + diff --git a/src/components.d.ts b/src/components.d.ts index 0bb0edd..276ffec 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,6 +14,8 @@ 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'] Copyright: typeof import('./components/Copyright/index.vue')['default'] diff --git a/src/components/benchCol/index.vue b/src/components/benchCol/index.vue new file mode 100644 index 0000000..ddd000a --- /dev/null +++ b/src/components/benchCol/index.vue @@ -0,0 +1,51 @@ + + + + + + + {{ title }} + + 更多 > + + + + + + + diff --git a/src/components/echarts/index.vue b/src/components/echarts/index.vue index 1f6f6aa..c385dae 100644 --- a/src/components/echarts/index.vue +++ b/src/components/echarts/index.vue @@ -107,7 +107,7 @@ symbolSize: 2, // 拐点大小 // 折线条的样式 lineStyle: { - color: '#58abf0', + color: '#3d7eff', }, // 折线拐点的样式 itemStyle: { @@ -158,6 +158,6 @@ diff --git a/src/components/echarts/pie.vue b/src/components/echarts/pie.vue index 3ad8db6..1bbfb93 100644 --- a/src/components/echarts/pie.vue +++ b/src/components/echarts/pie.vue @@ -25,12 +25,12 @@ tooltip: { trigger: 'item', }, - color: ['rgb(40, 184, 228)', '#ccc'], + color: ['#3d7eff', '#ccc'], legend: { orient: 'vertical', right: '0', - bottom: '50%', - itemGap: 20, + bottom: '40%', + itemGap: 10, }, graphic: { type: 'text', @@ -95,6 +95,6 @@ .bars_w { width: 100%; height: 90%; - transform: translateX(-25%); + transform: translate(-10%, -30%); } diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 6a6d694..4f0d99c 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -27,3 +27,31 @@ data, }) } + +// 详情信息 +export function getStandardListDetail(data: object) { + return request({ + url: `${prefix}/standard/detail`, + method: 'post', + data, + }) +} + +// 更新信息 +export function getStandardLisUpdate(data: object) { + return request({ + url: `${prefix}/standard/update`, + method: 'post', + data, + }) +} + +// 获取部门信息 +export function getUsersDept(data: object) { + return request({ + url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + diff --git a/src/components.d.ts b/src/components.d.ts index 0bb0edd..276ffec 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,6 +14,8 @@ 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'] Copyright: typeof import('./components/Copyright/index.vue')['default'] diff --git a/src/components/benchCol/index.vue b/src/components/benchCol/index.vue new file mode 100644 index 0000000..ddd000a --- /dev/null +++ b/src/components/benchCol/index.vue @@ -0,0 +1,51 @@ + + + + + + + {{ title }} + + 更多 > + + + + + + + diff --git a/src/components/echarts/index.vue b/src/components/echarts/index.vue index 1f6f6aa..c385dae 100644 --- a/src/components/echarts/index.vue +++ b/src/components/echarts/index.vue @@ -107,7 +107,7 @@ symbolSize: 2, // 拐点大小 // 折线条的样式 lineStyle: { - color: '#58abf0', + color: '#3d7eff', }, // 折线拐点的样式 itemStyle: { @@ -158,6 +158,6 @@ diff --git a/src/components/echarts/pie.vue b/src/components/echarts/pie.vue index 3ad8db6..1bbfb93 100644 --- a/src/components/echarts/pie.vue +++ b/src/components/echarts/pie.vue @@ -25,12 +25,12 @@ tooltip: { trigger: 'item', }, - color: ['rgb(40, 184, 228)', '#ccc'], + color: ['#3d7eff', '#ccc'], legend: { orient: 'vertical', right: '0', - bottom: '50%', - itemGap: 20, + bottom: '40%', + itemGap: 10, }, graphic: { type: 'text', @@ -95,6 +95,6 @@ .bars_w { width: 100%; height: 90%; - transform: translateX(-25%); + transform: translate(-10%, -30%); } diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index e7c5f86..483b6ad 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -4,7 +4,7 @@ import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { getStandardListAdd } from '@/api/device/standard' +import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' const props = defineProps({ infoId: { @@ -29,7 +29,7 @@ contactInfo: '', createTime: null, createUser: null, - id: null, + id: '', isDel: null, laboratoryOwner: null, laboratoryOwnerContact: null, @@ -61,12 +61,7 @@ updateTime: null, version: null, }) -const checkTypeOptions = ref([ - { name: '国家', id: 0, value: 0 }, - { name: '国防', id: 1, value: 1 }, - { name: '二级', id: 2, value: 2 }, - { name: '标准装置', id: 3, value: 3 }, -]) +const checkTypeOptions = ref([]) const transmitRangeOptions = ref([ { name: '国家级', id: 0, value: 0 }, { name: '省级', id: 1, value: 1 }, @@ -79,6 +74,8 @@ const standardManagerStateList = ref([]) // 管理状态下拉框 const standardLevelList = ref([]) // 标准等级下拉框 const transmitRangeList = ref([]) // 传递范围下拉框 +// 标准所在部门下拉框 +const standardUsersDeptList = ref([]) // 获取下拉框 const getSelectList = (code: string) => { getTypeSelect(code).then((res) => { @@ -94,12 +91,30 @@ else if (code === 'transmitRange') { transmitRangeList.value = res.data } + else if (code === 'standardCategory') { + checkTypeOptions.value = res.data + } }) } getSelectList('measureMajor') // 获取计量专业下拉框 getSelectList('standardManagerState') // 获取管理状态下拉框 getSelectList('standardLevel') // 获取标准等级下拉框 getSelectList('transmitRange') // 获取传递范围下拉框 +getSelectList('standardCategory') // 获取类别下拉框 +// 获取部门信息 +getUsersDept({ + createTime: '', + director: '', + meterMajor: '', + organizeName: '', + organizeNo: '', + organizeType: '2', + pdeptId: null, + offset: 1, + limit: 999999, +}).then((res) => { + standardUsersDeptList.value = res.data.rows +}) // 获取到标准负责人数组 const getStandardOwnerOptions = () => { const params = { @@ -193,9 +208,33 @@ ) } } +// 编辑获取详情的提交按钮 +const submitFormDetail = () => { + if (props.buttonType === '编辑') { + formInline.value.id = props.infoId + formInline.value.laboratoryOwner = null + getStandardLisUpdate(formInline.value).then((res) => { + if (res.code === 200) { + close() + } + }) + } + else { + // 打印 + const printObj = ref({ + id: 'print', // 需要打印元素的id + popTitle: '测量标准装置', // 打印配置页上方的标题 + extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 + preview: false, // 是否启动预览模式,默认是false + standard: '', + extarCss: '', + }) + } +} // 提交 const submitForm = async (formEl: FormInstance | undefined) => { if (!formEl) { return } + if (props.buttonType === '详情') { return submitFormDetail() } await formEl.validate((valid, fields) => { if (valid) { ElMessageBox.confirm( @@ -213,11 +252,30 @@ close() } }) - : '' + : submitFormDetail() }) } }) } +// 标准实验室发生改变 +const changeDeptList = (row: object) => { + formInline.value.laboratoryOwnerContact = row.phone + formInline.value.laboratoryOwnerName = row.director +} +// 标准实验室清空时 +const clearDeptList = () => { + formInline.value.laboratoryOwnerContact = null + formInline.value.laboratoryOwnerName = null +} +// 获取详情信息 +const getInfo = () => { + getStandardListDetail({ id: props.infoId }).then((res) => { + formInline.value = res.data + }) +} +if (props.buttonType !== '') { + getInfo() +} @@ -241,6 +299,7 @@ :inline="true" :model="formInline" label-position="left" + label-width="auto" :rules="rules" > @@ -414,32 +473,25 @@ placeholder="标准所在实验室" size="default" :disabled="buttonType === '详情'" + @clear="clearDeptList" > - - - + /> @@ -539,7 +591,7 @@ - + - + @@ -601,7 +650,6 @@ +// 逻辑代码 +const props = defineProps({ + title: { + type: String, + default: '', + }, + pathUrl: { + type: String, + default: '', + }, + width: { + type: String, + default: '', + }, + height: { + type: String, + default: '', + }, +}) + + + + + + + {{ title }} + + 更多 > + + + + + + + diff --git a/src/components/echarts/index.vue b/src/components/echarts/index.vue index 1f6f6aa..c385dae 100644 --- a/src/components/echarts/index.vue +++ b/src/components/echarts/index.vue @@ -107,7 +107,7 @@ symbolSize: 2, // 拐点大小 // 折线条的样式 lineStyle: { - color: '#58abf0', + color: '#3d7eff', }, // 折线拐点的样式 itemStyle: { @@ -158,6 +158,6 @@ diff --git a/src/components/echarts/pie.vue b/src/components/echarts/pie.vue index 3ad8db6..1bbfb93 100644 --- a/src/components/echarts/pie.vue +++ b/src/components/echarts/pie.vue @@ -25,12 +25,12 @@ tooltip: { trigger: 'item', }, - color: ['rgb(40, 184, 228)', '#ccc'], + color: ['#3d7eff', '#ccc'], legend: { orient: 'vertical', right: '0', - bottom: '50%', - itemGap: 20, + bottom: '40%', + itemGap: 10, }, graphic: { type: 'text', @@ -95,6 +95,6 @@ .bars_w { width: 100%; height: 90%; - transform: translateX(-25%); + transform: translate(-10%, -30%); } diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index e7c5f86..483b6ad 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -4,7 +4,7 @@ import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { getStandardListAdd } from '@/api/device/standard' +import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' const props = defineProps({ infoId: { @@ -29,7 +29,7 @@ contactInfo: '', createTime: null, createUser: null, - id: null, + id: '', isDel: null, laboratoryOwner: null, laboratoryOwnerContact: null, @@ -61,12 +61,7 @@ updateTime: null, version: null, }) -const checkTypeOptions = ref([ - { name: '国家', id: 0, value: 0 }, - { name: '国防', id: 1, value: 1 }, - { name: '二级', id: 2, value: 2 }, - { name: '标准装置', id: 3, value: 3 }, -]) +const checkTypeOptions = ref([]) const transmitRangeOptions = ref([ { name: '国家级', id: 0, value: 0 }, { name: '省级', id: 1, value: 1 }, @@ -79,6 +74,8 @@ const standardManagerStateList = ref([]) // 管理状态下拉框 const standardLevelList = ref([]) // 标准等级下拉框 const transmitRangeList = ref([]) // 传递范围下拉框 +// 标准所在部门下拉框 +const standardUsersDeptList = ref([]) // 获取下拉框 const getSelectList = (code: string) => { getTypeSelect(code).then((res) => { @@ -94,12 +91,30 @@ else if (code === 'transmitRange') { transmitRangeList.value = res.data } + else if (code === 'standardCategory') { + checkTypeOptions.value = res.data + } }) } getSelectList('measureMajor') // 获取计量专业下拉框 getSelectList('standardManagerState') // 获取管理状态下拉框 getSelectList('standardLevel') // 获取标准等级下拉框 getSelectList('transmitRange') // 获取传递范围下拉框 +getSelectList('standardCategory') // 获取类别下拉框 +// 获取部门信息 +getUsersDept({ + createTime: '', + director: '', + meterMajor: '', + organizeName: '', + organizeNo: '', + organizeType: '2', + pdeptId: null, + offset: 1, + limit: 999999, +}).then((res) => { + standardUsersDeptList.value = res.data.rows +}) // 获取到标准负责人数组 const getStandardOwnerOptions = () => { const params = { @@ -193,9 +208,33 @@ ) } } +// 编辑获取详情的提交按钮 +const submitFormDetail = () => { + if (props.buttonType === '编辑') { + formInline.value.id = props.infoId + formInline.value.laboratoryOwner = null + getStandardLisUpdate(formInline.value).then((res) => { + if (res.code === 200) { + close() + } + }) + } + else { + // 打印 + const printObj = ref({ + id: 'print', // 需要打印元素的id + popTitle: '测量标准装置', // 打印配置页上方的标题 + extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 + preview: false, // 是否启动预览模式,默认是false + standard: '', + extarCss: '', + }) + } +} // 提交 const submitForm = async (formEl: FormInstance | undefined) => { if (!formEl) { return } + if (props.buttonType === '详情') { return submitFormDetail() } await formEl.validate((valid, fields) => { if (valid) { ElMessageBox.confirm( @@ -213,11 +252,30 @@ close() } }) - : '' + : submitFormDetail() }) } }) } +// 标准实验室发生改变 +const changeDeptList = (row: object) => { + formInline.value.laboratoryOwnerContact = row.phone + formInline.value.laboratoryOwnerName = row.director +} +// 标准实验室清空时 +const clearDeptList = () => { + formInline.value.laboratoryOwnerContact = null + formInline.value.laboratoryOwnerName = null +} +// 获取详情信息 +const getInfo = () => { + getStandardListDetail({ id: props.infoId }).then((res) => { + formInline.value = res.data + }) +} +if (props.buttonType !== '') { + getInfo() +} @@ -241,6 +299,7 @@ :inline="true" :model="formInline" label-position="left" + label-width="auto" :rules="rules" > @@ -414,32 +473,25 @@ placeholder="标准所在实验室" size="default" :disabled="buttonType === '详情'" + @clear="clearDeptList" > - - - + /> @@ -539,7 +591,7 @@ - + - + @@ -601,7 +650,6 @@ { loadingTable.value = true if (!isNowPage) { @@ -92,6 +106,34 @@ const searchList = () => { fetchData(true) } +// 获取下拉框 +const getSelectList = (code: string) => { + getTypeSelect(code).then((res) => { + if (code === 'standardCategory') { + checkTypeOptions.value = res.data + } + else if (code === 'standardManagerState') { + standardManagerStateList.value = res.data + } + }) +} +getSelectList('standardCategory') // 获取类别下拉框 +getSelectList('standardManagerState') // 获取管理状态下拉框 + +// 获取部门信息 +getUsersDept({ + createTime: '', + director: '', + meterMajor: '', + organizeName: '', + organizeNo: '', + organizeType: '2', + pdeptId: null, + offset: 1, + limit: 999999, +}).then((res) => { + standardUsersDeptList.value = res.data.rows +}) // 点击重置 const clearList = () => { @@ -160,6 +202,7 @@ } // 新增 const addList = () => { + buttonType.value = '' isShow.value = false } // 关闭 @@ -194,6 +237,12 @@ }) }) } +// 点击编辑或详情 +const handleClick = (index: number, row: object, text: string) => { + infoId.value = row.id + buttonType.value = text + isShow.value = false +} @@ -217,25 +266,49 @@ /> - + size="default" + > + + - + placeholder="管理状态" + size="default" + > + + - + placeholder="标准所在部门" + size="default" + > + + 编辑 @@ -278,6 +352,7 @@ size="small" link type="primary" + @click="handleClick(row.$index, row, '详情')" > 详情 @@ -295,7 +370,10 @@ - + + diff --git a/src/components/echarts/index.vue b/src/components/echarts/index.vue index 1f6f6aa..c385dae 100644 --- a/src/components/echarts/index.vue +++ b/src/components/echarts/index.vue @@ -107,7 +107,7 @@ symbolSize: 2, // 拐点大小 // 折线条的样式 lineStyle: { - color: '#58abf0', + color: '#3d7eff', }, // 折线拐点的样式 itemStyle: { @@ -158,6 +158,6 @@ diff --git a/src/components/echarts/pie.vue b/src/components/echarts/pie.vue index 3ad8db6..1bbfb93 100644 --- a/src/components/echarts/pie.vue +++ b/src/components/echarts/pie.vue @@ -25,12 +25,12 @@ tooltip: { trigger: 'item', }, - color: ['rgb(40, 184, 228)', '#ccc'], + color: ['#3d7eff', '#ccc'], legend: { orient: 'vertical', right: '0', - bottom: '50%', - itemGap: 20, + bottom: '40%', + itemGap: 10, }, graphic: { type: 'text', @@ -95,6 +95,6 @@ .bars_w { width: 100%; height: 90%; - transform: translateX(-25%); + transform: translate(-10%, -30%); } diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index e7c5f86..483b6ad 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -4,7 +4,7 @@ import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { getStandardListAdd } from '@/api/device/standard' +import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' const props = defineProps({ infoId: { @@ -29,7 +29,7 @@ contactInfo: '', createTime: null, createUser: null, - id: null, + id: '', isDel: null, laboratoryOwner: null, laboratoryOwnerContact: null, @@ -61,12 +61,7 @@ updateTime: null, version: null, }) -const checkTypeOptions = ref([ - { name: '国家', id: 0, value: 0 }, - { name: '国防', id: 1, value: 1 }, - { name: '二级', id: 2, value: 2 }, - { name: '标准装置', id: 3, value: 3 }, -]) +const checkTypeOptions = ref([]) const transmitRangeOptions = ref([ { name: '国家级', id: 0, value: 0 }, { name: '省级', id: 1, value: 1 }, @@ -79,6 +74,8 @@ const standardManagerStateList = ref([]) // 管理状态下拉框 const standardLevelList = ref([]) // 标准等级下拉框 const transmitRangeList = ref([]) // 传递范围下拉框 +// 标准所在部门下拉框 +const standardUsersDeptList = ref([]) // 获取下拉框 const getSelectList = (code: string) => { getTypeSelect(code).then((res) => { @@ -94,12 +91,30 @@ else if (code === 'transmitRange') { transmitRangeList.value = res.data } + else if (code === 'standardCategory') { + checkTypeOptions.value = res.data + } }) } getSelectList('measureMajor') // 获取计量专业下拉框 getSelectList('standardManagerState') // 获取管理状态下拉框 getSelectList('standardLevel') // 获取标准等级下拉框 getSelectList('transmitRange') // 获取传递范围下拉框 +getSelectList('standardCategory') // 获取类别下拉框 +// 获取部门信息 +getUsersDept({ + createTime: '', + director: '', + meterMajor: '', + organizeName: '', + organizeNo: '', + organizeType: '2', + pdeptId: null, + offset: 1, + limit: 999999, +}).then((res) => { + standardUsersDeptList.value = res.data.rows +}) // 获取到标准负责人数组 const getStandardOwnerOptions = () => { const params = { @@ -193,9 +208,33 @@ ) } } +// 编辑获取详情的提交按钮 +const submitFormDetail = () => { + if (props.buttonType === '编辑') { + formInline.value.id = props.infoId + formInline.value.laboratoryOwner = null + getStandardLisUpdate(formInline.value).then((res) => { + if (res.code === 200) { + close() + } + }) + } + else { + // 打印 + const printObj = ref({ + id: 'print', // 需要打印元素的id + popTitle: '测量标准装置', // 打印配置页上方的标题 + extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 + preview: false, // 是否启动预览模式,默认是false + standard: '', + extarCss: '', + }) + } +} // 提交 const submitForm = async (formEl: FormInstance | undefined) => { if (!formEl) { return } + if (props.buttonType === '详情') { return submitFormDetail() } await formEl.validate((valid, fields) => { if (valid) { ElMessageBox.confirm( @@ -213,11 +252,30 @@ close() } }) - : '' + : submitFormDetail() }) } }) } +// 标准实验室发生改变 +const changeDeptList = (row: object) => { + formInline.value.laboratoryOwnerContact = row.phone + formInline.value.laboratoryOwnerName = row.director +} +// 标准实验室清空时 +const clearDeptList = () => { + formInline.value.laboratoryOwnerContact = null + formInline.value.laboratoryOwnerName = null +} +// 获取详情信息 +const getInfo = () => { + getStandardListDetail({ id: props.infoId }).then((res) => { + formInline.value = res.data + }) +} +if (props.buttonType !== '') { + getInfo() +} @@ -241,6 +299,7 @@ :inline="true" :model="formInline" label-position="left" + label-width="auto" :rules="rules" > @@ -414,32 +473,25 @@ placeholder="标准所在实验室" size="default" :disabled="buttonType === '详情'" + @clear="clearDeptList" > - - - + /> @@ -539,7 +591,7 @@ - + - + @@ -601,7 +650,6 @@ { loadingTable.value = true if (!isNowPage) { @@ -92,6 +106,34 @@ const searchList = () => { fetchData(true) } +// 获取下拉框 +const getSelectList = (code: string) => { + getTypeSelect(code).then((res) => { + if (code === 'standardCategory') { + checkTypeOptions.value = res.data + } + else if (code === 'standardManagerState') { + standardManagerStateList.value = res.data + } + }) +} +getSelectList('standardCategory') // 获取类别下拉框 +getSelectList('standardManagerState') // 获取管理状态下拉框 + +// 获取部门信息 +getUsersDept({ + createTime: '', + director: '', + meterMajor: '', + organizeName: '', + organizeNo: '', + organizeType: '2', + pdeptId: null, + offset: 1, + limit: 999999, +}).then((res) => { + standardUsersDeptList.value = res.data.rows +}) // 点击重置 const clearList = () => { @@ -160,6 +202,7 @@ } // 新增 const addList = () => { + buttonType.value = '' isShow.value = false } // 关闭 @@ -194,6 +237,12 @@ }) }) } +// 点击编辑或详情 +const handleClick = (index: number, row: object, text: string) => { + infoId.value = row.id + buttonType.value = text + isShow.value = false +} @@ -217,25 +266,49 @@ /> - + size="default" + > + + - + placeholder="管理状态" + size="default" + > + + - + placeholder="标准所在部门" + size="default" + > + + 编辑 @@ -278,6 +352,7 @@ size="small" link type="primary" + @click="handleClick(row.$index, row, '详情')" > 详情 @@ -295,7 +370,10 @@ - + diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 6a6d694..4f0d99c 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -27,3 +27,31 @@ data, }) } + +// 详情信息 +export function getStandardListDetail(data: object) { + return request({ + url: `${prefix}/standard/detail`, + method: 'post', + data, + }) +} + +// 更新信息 +export function getStandardLisUpdate(data: object) { + return request({ + url: `${prefix}/standard/update`, + method: 'post', + data, + }) +} + +// 获取部门信息 +export function getUsersDept(data: object) { + return request({ + url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + diff --git a/src/components.d.ts b/src/components.d.ts index 0bb0edd..276ffec 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,6 +14,8 @@ 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'] Copyright: typeof import('./components/Copyright/index.vue')['default'] diff --git a/src/components/benchCol/index.vue b/src/components/benchCol/index.vue new file mode 100644 index 0000000..ddd000a --- /dev/null +++ b/src/components/benchCol/index.vue @@ -0,0 +1,51 @@ + + + + + + + {{ title }} + + 更多 > + + + + + + + diff --git a/src/components/echarts/index.vue b/src/components/echarts/index.vue index 1f6f6aa..c385dae 100644 --- a/src/components/echarts/index.vue +++ b/src/components/echarts/index.vue @@ -107,7 +107,7 @@ symbolSize: 2, // 拐点大小 // 折线条的样式 lineStyle: { - color: '#58abf0', + color: '#3d7eff', }, // 折线拐点的样式 itemStyle: { @@ -158,6 +158,6 @@ diff --git a/src/components/echarts/pie.vue b/src/components/echarts/pie.vue index 3ad8db6..1bbfb93 100644 --- a/src/components/echarts/pie.vue +++ b/src/components/echarts/pie.vue @@ -25,12 +25,12 @@ tooltip: { trigger: 'item', }, - color: ['rgb(40, 184, 228)', '#ccc'], + color: ['#3d7eff', '#ccc'], legend: { orient: 'vertical', right: '0', - bottom: '50%', - itemGap: 20, + bottom: '40%', + itemGap: 10, }, graphic: { type: 'text', @@ -95,6 +95,6 @@ .bars_w { width: 100%; height: 90%; - transform: translateX(-25%); + transform: translate(-10%, -30%); } diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index e7c5f86..483b6ad 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -4,7 +4,7 @@ import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { getStandardListAdd } from '@/api/device/standard' +import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' const props = defineProps({ infoId: { @@ -29,7 +29,7 @@ contactInfo: '', createTime: null, createUser: null, - id: null, + id: '', isDel: null, laboratoryOwner: null, laboratoryOwnerContact: null, @@ -61,12 +61,7 @@ updateTime: null, version: null, }) -const checkTypeOptions = ref([ - { name: '国家', id: 0, value: 0 }, - { name: '国防', id: 1, value: 1 }, - { name: '二级', id: 2, value: 2 }, - { name: '标准装置', id: 3, value: 3 }, -]) +const checkTypeOptions = ref([]) const transmitRangeOptions = ref([ { name: '国家级', id: 0, value: 0 }, { name: '省级', id: 1, value: 1 }, @@ -79,6 +74,8 @@ const standardManagerStateList = ref([]) // 管理状态下拉框 const standardLevelList = ref([]) // 标准等级下拉框 const transmitRangeList = ref([]) // 传递范围下拉框 +// 标准所在部门下拉框 +const standardUsersDeptList = ref([]) // 获取下拉框 const getSelectList = (code: string) => { getTypeSelect(code).then((res) => { @@ -94,12 +91,30 @@ else if (code === 'transmitRange') { transmitRangeList.value = res.data } + else if (code === 'standardCategory') { + checkTypeOptions.value = res.data + } }) } getSelectList('measureMajor') // 获取计量专业下拉框 getSelectList('standardManagerState') // 获取管理状态下拉框 getSelectList('standardLevel') // 获取标准等级下拉框 getSelectList('transmitRange') // 获取传递范围下拉框 +getSelectList('standardCategory') // 获取类别下拉框 +// 获取部门信息 +getUsersDept({ + createTime: '', + director: '', + meterMajor: '', + organizeName: '', + organizeNo: '', + organizeType: '2', + pdeptId: null, + offset: 1, + limit: 999999, +}).then((res) => { + standardUsersDeptList.value = res.data.rows +}) // 获取到标准负责人数组 const getStandardOwnerOptions = () => { const params = { @@ -193,9 +208,33 @@ ) } } +// 编辑获取详情的提交按钮 +const submitFormDetail = () => { + if (props.buttonType === '编辑') { + formInline.value.id = props.infoId + formInline.value.laboratoryOwner = null + getStandardLisUpdate(formInline.value).then((res) => { + if (res.code === 200) { + close() + } + }) + } + else { + // 打印 + const printObj = ref({ + id: 'print', // 需要打印元素的id + popTitle: '测量标准装置', // 打印配置页上方的标题 + extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 + preview: false, // 是否启动预览模式,默认是false + standard: '', + extarCss: '', + }) + } +} // 提交 const submitForm = async (formEl: FormInstance | undefined) => { if (!formEl) { return } + if (props.buttonType === '详情') { return submitFormDetail() } await formEl.validate((valid, fields) => { if (valid) { ElMessageBox.confirm( @@ -213,11 +252,30 @@ close() } }) - : '' + : submitFormDetail() }) } }) } +// 标准实验室发生改变 +const changeDeptList = (row: object) => { + formInline.value.laboratoryOwnerContact = row.phone + formInline.value.laboratoryOwnerName = row.director +} +// 标准实验室清空时 +const clearDeptList = () => { + formInline.value.laboratoryOwnerContact = null + formInline.value.laboratoryOwnerName = null +} +// 获取详情信息 +const getInfo = () => { + getStandardListDetail({ id: props.infoId }).then((res) => { + formInline.value = res.data + }) +} +if (props.buttonType !== '') { + getInfo() +} @@ -241,6 +299,7 @@ :inline="true" :model="formInline" label-position="left" + label-width="auto" :rules="rules" > @@ -414,32 +473,25 @@ placeholder="标准所在实验室" size="default" :disabled="buttonType === '详情'" + @clear="clearDeptList" > - - - + /> @@ -539,7 +591,7 @@ - + - + @@ -601,7 +650,6 @@ { loadingTable.value = true if (!isNowPage) { @@ -92,6 +106,34 @@ const searchList = () => { fetchData(true) } +// 获取下拉框 +const getSelectList = (code: string) => { + getTypeSelect(code).then((res) => { + if (code === 'standardCategory') { + checkTypeOptions.value = res.data + } + else if (code === 'standardManagerState') { + standardManagerStateList.value = res.data + } + }) +} +getSelectList('standardCategory') // 获取类别下拉框 +getSelectList('standardManagerState') // 获取管理状态下拉框 + +// 获取部门信息 +getUsersDept({ + createTime: '', + director: '', + meterMajor: '', + organizeName: '', + organizeNo: '', + organizeType: '2', + pdeptId: null, + offset: 1, + limit: 999999, +}).then((res) => { + standardUsersDeptList.value = res.data.rows +}) // 点击重置 const clearList = () => { @@ -160,6 +202,7 @@ } // 新增 const addList = () => { + buttonType.value = '' isShow.value = false } // 关闭 @@ -194,6 +237,12 @@ }) }) } +// 点击编辑或详情 +const handleClick = (index: number, row: object, text: string) => { + infoId.value = row.id + buttonType.value = text + isShow.value = false +} @@ -217,25 +266,49 @@ /> - + size="default" + > + + - + placeholder="管理状态" + size="default" + > + + - + placeholder="标准所在部门" + size="default" + > + + 编辑 @@ -278,6 +352,7 @@ size="small" link type="primary" + @click="handleClick(row.$index, row, '详情')" > 详情 @@ -295,7 +370,10 @@ - + diff --git a/src/views/measure/price/list.vue b/src/views/measure/price/list.vue index fb82066..45a3806 100644 --- a/src/views/measure/price/list.vue +++ b/src/views/measure/price/list.vue @@ -4,7 +4,7 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import type { IlistQuery, IlistType } from './list_interface' import ListPriceAdd from './priceAdd.vue' -import { getDeletePrice, getPriceList, uploadPrice } from '@/api/system/price' +import { getDeletePrice, getPriceList, getTypeSelect, uploadPrice } from '@/api/system/price' import { exportExcel } from '@/utils/exportXlsx' // 查询条件 const listQuery: Ref = ref({ @@ -87,6 +87,12 @@ const deleteId = ref('') // 详情id const infoId = ref('0') +// 校验类型下拉框数组 +const checkTypeOptions = ref([]) +// 类别下拉框数组 +const priceTypeOptions = ref([]) +// 项目下拉框数组 +const priceItemOptions = ref([]) const isPopconfirmShow = ref(false) // 点击按钮 const buttonType = ref('') @@ -150,6 +156,23 @@ const cancelEvent = () => { console.log('cancel!') } +// 获取下拉框数据 +const getOptions = (code: string) => { + getTypeSelect(code).then((res) => { + if (code === 'checkType') { + checkTypeOptions.value = res.data + } + else if (code === 'priceType') { + priceTypeOptions.value = res.data + } + else if (code === 'priceItem') { + priceItemOptions.value = res.data + } + }) +} +getOptions('checkType') +getOptions('priceType') +getOptions('priceItem') // 点击重置 const clearList = () => { listQuery.value = { @@ -274,25 +297,52 @@ /> - + placeholder="检校类型" + size="default" + :disabled="buttonType === '详情'" + > + + - + placeholder="类别" + size="default" + :disabled="buttonType === '详情'" + > + + - + placeholder="项目" + size="default" + :disabled="buttonType === '详情'" + > + + diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 6a6d694..4f0d99c 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -27,3 +27,31 @@ data, }) } + +// 详情信息 +export function getStandardListDetail(data: object) { + return request({ + url: `${prefix}/standard/detail`, + method: 'post', + data, + }) +} + +// 更新信息 +export function getStandardLisUpdate(data: object) { + return request({ + url: `${prefix}/standard/update`, + method: 'post', + data, + }) +} + +// 获取部门信息 +export function getUsersDept(data: object) { + return request({ + url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + diff --git a/src/components.d.ts b/src/components.d.ts index 0bb0edd..276ffec 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,6 +14,8 @@ 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'] Copyright: typeof import('./components/Copyright/index.vue')['default'] diff --git a/src/components/benchCol/index.vue b/src/components/benchCol/index.vue new file mode 100644 index 0000000..ddd000a --- /dev/null +++ b/src/components/benchCol/index.vue @@ -0,0 +1,51 @@ + + + + + + + {{ title }} + + 更多 > + + + + + + + diff --git a/src/components/echarts/index.vue b/src/components/echarts/index.vue index 1f6f6aa..c385dae 100644 --- a/src/components/echarts/index.vue +++ b/src/components/echarts/index.vue @@ -107,7 +107,7 @@ symbolSize: 2, // 拐点大小 // 折线条的样式 lineStyle: { - color: '#58abf0', + color: '#3d7eff', }, // 折线拐点的样式 itemStyle: { @@ -158,6 +158,6 @@ diff --git a/src/components/echarts/pie.vue b/src/components/echarts/pie.vue index 3ad8db6..1bbfb93 100644 --- a/src/components/echarts/pie.vue +++ b/src/components/echarts/pie.vue @@ -25,12 +25,12 @@ tooltip: { trigger: 'item', }, - color: ['rgb(40, 184, 228)', '#ccc'], + color: ['#3d7eff', '#ccc'], legend: { orient: 'vertical', right: '0', - bottom: '50%', - itemGap: 20, + bottom: '40%', + itemGap: 10, }, graphic: { type: 'text', @@ -95,6 +95,6 @@ .bars_w { width: 100%; height: 90%; - transform: translateX(-25%); + transform: translate(-10%, -30%); } diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index e7c5f86..483b6ad 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -4,7 +4,7 @@ import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { getStandardListAdd } from '@/api/device/standard' +import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' const props = defineProps({ infoId: { @@ -29,7 +29,7 @@ contactInfo: '', createTime: null, createUser: null, - id: null, + id: '', isDel: null, laboratoryOwner: null, laboratoryOwnerContact: null, @@ -61,12 +61,7 @@ updateTime: null, version: null, }) -const checkTypeOptions = ref([ - { name: '国家', id: 0, value: 0 }, - { name: '国防', id: 1, value: 1 }, - { name: '二级', id: 2, value: 2 }, - { name: '标准装置', id: 3, value: 3 }, -]) +const checkTypeOptions = ref([]) const transmitRangeOptions = ref([ { name: '国家级', id: 0, value: 0 }, { name: '省级', id: 1, value: 1 }, @@ -79,6 +74,8 @@ const standardManagerStateList = ref([]) // 管理状态下拉框 const standardLevelList = ref([]) // 标准等级下拉框 const transmitRangeList = ref([]) // 传递范围下拉框 +// 标准所在部门下拉框 +const standardUsersDeptList = ref([]) // 获取下拉框 const getSelectList = (code: string) => { getTypeSelect(code).then((res) => { @@ -94,12 +91,30 @@ else if (code === 'transmitRange') { transmitRangeList.value = res.data } + else if (code === 'standardCategory') { + checkTypeOptions.value = res.data + } }) } getSelectList('measureMajor') // 获取计量专业下拉框 getSelectList('standardManagerState') // 获取管理状态下拉框 getSelectList('standardLevel') // 获取标准等级下拉框 getSelectList('transmitRange') // 获取传递范围下拉框 +getSelectList('standardCategory') // 获取类别下拉框 +// 获取部门信息 +getUsersDept({ + createTime: '', + director: '', + meterMajor: '', + organizeName: '', + organizeNo: '', + organizeType: '2', + pdeptId: null, + offset: 1, + limit: 999999, +}).then((res) => { + standardUsersDeptList.value = res.data.rows +}) // 获取到标准负责人数组 const getStandardOwnerOptions = () => { const params = { @@ -193,9 +208,33 @@ ) } } +// 编辑获取详情的提交按钮 +const submitFormDetail = () => { + if (props.buttonType === '编辑') { + formInline.value.id = props.infoId + formInline.value.laboratoryOwner = null + getStandardLisUpdate(formInline.value).then((res) => { + if (res.code === 200) { + close() + } + }) + } + else { + // 打印 + const printObj = ref({ + id: 'print', // 需要打印元素的id + popTitle: '测量标准装置', // 打印配置页上方的标题 + extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 + preview: false, // 是否启动预览模式,默认是false + standard: '', + extarCss: '', + }) + } +} // 提交 const submitForm = async (formEl: FormInstance | undefined) => { if (!formEl) { return } + if (props.buttonType === '详情') { return submitFormDetail() } await formEl.validate((valid, fields) => { if (valid) { ElMessageBox.confirm( @@ -213,11 +252,30 @@ close() } }) - : '' + : submitFormDetail() }) } }) } +// 标准实验室发生改变 +const changeDeptList = (row: object) => { + formInline.value.laboratoryOwnerContact = row.phone + formInline.value.laboratoryOwnerName = row.director +} +// 标准实验室清空时 +const clearDeptList = () => { + formInline.value.laboratoryOwnerContact = null + formInline.value.laboratoryOwnerName = null +} +// 获取详情信息 +const getInfo = () => { + getStandardListDetail({ id: props.infoId }).then((res) => { + formInline.value = res.data + }) +} +if (props.buttonType !== '') { + getInfo() +} @@ -241,6 +299,7 @@ :inline="true" :model="formInline" label-position="left" + label-width="auto" :rules="rules" > @@ -414,32 +473,25 @@ placeholder="标准所在实验室" size="default" :disabled="buttonType === '详情'" + @clear="clearDeptList" > - - - + /> @@ -539,7 +591,7 @@ - + - + @@ -601,7 +650,6 @@ { loadingTable.value = true if (!isNowPage) { @@ -92,6 +106,34 @@ const searchList = () => { fetchData(true) } +// 获取下拉框 +const getSelectList = (code: string) => { + getTypeSelect(code).then((res) => { + if (code === 'standardCategory') { + checkTypeOptions.value = res.data + } + else if (code === 'standardManagerState') { + standardManagerStateList.value = res.data + } + }) +} +getSelectList('standardCategory') // 获取类别下拉框 +getSelectList('standardManagerState') // 获取管理状态下拉框 + +// 获取部门信息 +getUsersDept({ + createTime: '', + director: '', + meterMajor: '', + organizeName: '', + organizeNo: '', + organizeType: '2', + pdeptId: null, + offset: 1, + limit: 999999, +}).then((res) => { + standardUsersDeptList.value = res.data.rows +}) // 点击重置 const clearList = () => { @@ -160,6 +202,7 @@ } // 新增 const addList = () => { + buttonType.value = '' isShow.value = false } // 关闭 @@ -194,6 +237,12 @@ }) }) } +// 点击编辑或详情 +const handleClick = (index: number, row: object, text: string) => { + infoId.value = row.id + buttonType.value = text + isShow.value = false +} @@ -217,25 +266,49 @@ /> - + size="default" + > + + - + placeholder="管理状态" + size="default" + > + + - + placeholder="标准所在部门" + size="default" + > + + 编辑 @@ -278,6 +352,7 @@ size="small" link type="primary" + @click="handleClick(row.$index, row, '详情')" > 详情 @@ -295,7 +370,10 @@ - + diff --git a/src/views/measure/price/list.vue b/src/views/measure/price/list.vue index fb82066..45a3806 100644 --- a/src/views/measure/price/list.vue +++ b/src/views/measure/price/list.vue @@ -4,7 +4,7 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import type { IlistQuery, IlistType } from './list_interface' import ListPriceAdd from './priceAdd.vue' -import { getDeletePrice, getPriceList, uploadPrice } from '@/api/system/price' +import { getDeletePrice, getPriceList, getTypeSelect, uploadPrice } from '@/api/system/price' import { exportExcel } from '@/utils/exportXlsx' // 查询条件 const listQuery: Ref = ref({ @@ -87,6 +87,12 @@ const deleteId = ref('') // 详情id const infoId = ref('0') +// 校验类型下拉框数组 +const checkTypeOptions = ref([]) +// 类别下拉框数组 +const priceTypeOptions = ref([]) +// 项目下拉框数组 +const priceItemOptions = ref([]) const isPopconfirmShow = ref(false) // 点击按钮 const buttonType = ref('') @@ -150,6 +156,23 @@ const cancelEvent = () => { console.log('cancel!') } +// 获取下拉框数据 +const getOptions = (code: string) => { + getTypeSelect(code).then((res) => { + if (code === 'checkType') { + checkTypeOptions.value = res.data + } + else if (code === 'priceType') { + priceTypeOptions.value = res.data + } + else if (code === 'priceItem') { + priceItemOptions.value = res.data + } + }) +} +getOptions('checkType') +getOptions('priceType') +getOptions('priceItem') // 点击重置 const clearList = () => { listQuery.value = { @@ -274,25 +297,52 @@ /> - + placeholder="检校类型" + size="default" + :disabled="buttonType === '详情'" + > + + - + placeholder="类别" + size="default" + :disabled="buttonType === '详情'" + > + + - + placeholder="项目" + size="default" + :disabled="buttonType === '详情'" + > + + diff --git a/src/views/measure/train/plan.vue b/src/views/measure/train/plan.vue index f0ed074..9707995 100644 --- a/src/views/measure/train/plan.vue +++ b/src/views/measure/train/plan.vue @@ -70,12 +70,11 @@ { text: '培训时间', value: 'trainTime', - width: '180', + width: '90', }, { text: '主管部门', value: 'deptName', - width: '90', }, { text: '实施单位', @@ -90,7 +89,7 @@ { text: '创建时间', value: 'createTime', - width: '180', + width: '90', }, { text: '备注', diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 6a6d694..4f0d99c 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -27,3 +27,31 @@ data, }) } + +// 详情信息 +export function getStandardListDetail(data: object) { + return request({ + url: `${prefix}/standard/detail`, + method: 'post', + data, + }) +} + +// 更新信息 +export function getStandardLisUpdate(data: object) { + return request({ + url: `${prefix}/standard/update`, + method: 'post', + data, + }) +} + +// 获取部门信息 +export function getUsersDept(data: object) { + return request({ + url: `/meter/organize/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + diff --git a/src/components.d.ts b/src/components.d.ts index 0bb0edd..276ffec 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -14,6 +14,8 @@ 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'] Copyright: typeof import('./components/Copyright/index.vue')['default'] diff --git a/src/components/benchCol/index.vue b/src/components/benchCol/index.vue new file mode 100644 index 0000000..ddd000a --- /dev/null +++ b/src/components/benchCol/index.vue @@ -0,0 +1,51 @@ + + + + + + + {{ title }} + + 更多 > + + + + + + + diff --git a/src/components/echarts/index.vue b/src/components/echarts/index.vue index 1f6f6aa..c385dae 100644 --- a/src/components/echarts/index.vue +++ b/src/components/echarts/index.vue @@ -107,7 +107,7 @@ symbolSize: 2, // 拐点大小 // 折线条的样式 lineStyle: { - color: '#58abf0', + color: '#3d7eff', }, // 折线拐点的样式 itemStyle: { @@ -158,6 +158,6 @@ diff --git a/src/components/echarts/pie.vue b/src/components/echarts/pie.vue index 3ad8db6..1bbfb93 100644 --- a/src/components/echarts/pie.vue +++ b/src/components/echarts/pie.vue @@ -25,12 +25,12 @@ tooltip: { trigger: 'item', }, - color: ['rgb(40, 184, 228)', '#ccc'], + color: ['#3d7eff', '#ccc'], legend: { orient: 'vertical', right: '0', - bottom: '50%', - itemGap: 20, + bottom: '40%', + itemGap: 10, }, graphic: { type: 'text', @@ -95,6 +95,6 @@ .bars_w { width: 100%; height: 90%; - transform: translateX(-25%); + transform: translate(-10%, -30%); } diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index e7c5f86..483b6ad 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -4,7 +4,7 @@ import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { getStandardListAdd } from '@/api/device/standard' +import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' const props = defineProps({ infoId: { @@ -29,7 +29,7 @@ contactInfo: '', createTime: null, createUser: null, - id: null, + id: '', isDel: null, laboratoryOwner: null, laboratoryOwnerContact: null, @@ -61,12 +61,7 @@ updateTime: null, version: null, }) -const checkTypeOptions = ref([ - { name: '国家', id: 0, value: 0 }, - { name: '国防', id: 1, value: 1 }, - { name: '二级', id: 2, value: 2 }, - { name: '标准装置', id: 3, value: 3 }, -]) +const checkTypeOptions = ref([]) const transmitRangeOptions = ref([ { name: '国家级', id: 0, value: 0 }, { name: '省级', id: 1, value: 1 }, @@ -79,6 +74,8 @@ const standardManagerStateList = ref([]) // 管理状态下拉框 const standardLevelList = ref([]) // 标准等级下拉框 const transmitRangeList = ref([]) // 传递范围下拉框 +// 标准所在部门下拉框 +const standardUsersDeptList = ref([]) // 获取下拉框 const getSelectList = (code: string) => { getTypeSelect(code).then((res) => { @@ -94,12 +91,30 @@ else if (code === 'transmitRange') { transmitRangeList.value = res.data } + else if (code === 'standardCategory') { + checkTypeOptions.value = res.data + } }) } getSelectList('measureMajor') // 获取计量专业下拉框 getSelectList('standardManagerState') // 获取管理状态下拉框 getSelectList('standardLevel') // 获取标准等级下拉框 getSelectList('transmitRange') // 获取传递范围下拉框 +getSelectList('standardCategory') // 获取类别下拉框 +// 获取部门信息 +getUsersDept({ + createTime: '', + director: '', + meterMajor: '', + organizeName: '', + organizeNo: '', + organizeType: '2', + pdeptId: null, + offset: 1, + limit: 999999, +}).then((res) => { + standardUsersDeptList.value = res.data.rows +}) // 获取到标准负责人数组 const getStandardOwnerOptions = () => { const params = { @@ -193,9 +208,33 @@ ) } } +// 编辑获取详情的提交按钮 +const submitFormDetail = () => { + if (props.buttonType === '编辑') { + formInline.value.id = props.infoId + formInline.value.laboratoryOwner = null + getStandardLisUpdate(formInline.value).then((res) => { + if (res.code === 200) { + close() + } + }) + } + else { + // 打印 + const printObj = ref({ + id: 'print', // 需要打印元素的id + popTitle: '测量标准装置', // 打印配置页上方的标题 + extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 + preview: false, // 是否启动预览模式,默认是false + standard: '', + extarCss: '', + }) + } +} // 提交 const submitForm = async (formEl: FormInstance | undefined) => { if (!formEl) { return } + if (props.buttonType === '详情') { return submitFormDetail() } await formEl.validate((valid, fields) => { if (valid) { ElMessageBox.confirm( @@ -213,11 +252,30 @@ close() } }) - : '' + : submitFormDetail() }) } }) } +// 标准实验室发生改变 +const changeDeptList = (row: object) => { + formInline.value.laboratoryOwnerContact = row.phone + formInline.value.laboratoryOwnerName = row.director +} +// 标准实验室清空时 +const clearDeptList = () => { + formInline.value.laboratoryOwnerContact = null + formInline.value.laboratoryOwnerName = null +} +// 获取详情信息 +const getInfo = () => { + getStandardListDetail({ id: props.infoId }).then((res) => { + formInline.value = res.data + }) +} +if (props.buttonType !== '') { + getInfo() +} @@ -241,6 +299,7 @@ :inline="true" :model="formInline" label-position="left" + label-width="auto" :rules="rules" > @@ -414,32 +473,25 @@ placeholder="标准所在实验室" size="default" :disabled="buttonType === '详情'" + @clear="clearDeptList" > - - - + /> @@ -539,7 +591,7 @@ - + - + @@ -601,7 +650,6 @@ { loadingTable.value = true if (!isNowPage) { @@ -92,6 +106,34 @@ const searchList = () => { fetchData(true) } +// 获取下拉框 +const getSelectList = (code: string) => { + getTypeSelect(code).then((res) => { + if (code === 'standardCategory') { + checkTypeOptions.value = res.data + } + else if (code === 'standardManagerState') { + standardManagerStateList.value = res.data + } + }) +} +getSelectList('standardCategory') // 获取类别下拉框 +getSelectList('standardManagerState') // 获取管理状态下拉框 + +// 获取部门信息 +getUsersDept({ + createTime: '', + director: '', + meterMajor: '', + organizeName: '', + organizeNo: '', + organizeType: '2', + pdeptId: null, + offset: 1, + limit: 999999, +}).then((res) => { + standardUsersDeptList.value = res.data.rows +}) // 点击重置 const clearList = () => { @@ -160,6 +202,7 @@ } // 新增 const addList = () => { + buttonType.value = '' isShow.value = false } // 关闭 @@ -194,6 +237,12 @@ }) }) } +// 点击编辑或详情 +const handleClick = (index: number, row: object, text: string) => { + infoId.value = row.id + buttonType.value = text + isShow.value = false +} @@ -217,25 +266,49 @@ /> - + size="default" + > + + - + placeholder="管理状态" + size="default" + > + + - + placeholder="标准所在部门" + size="default" + > + + 编辑 @@ -278,6 +352,7 @@ size="small" link type="primary" + @click="handleClick(row.$index, row, '详情')" > 详情 @@ -295,7 +370,10 @@ - + diff --git a/src/views/measure/price/list.vue b/src/views/measure/price/list.vue index fb82066..45a3806 100644 --- a/src/views/measure/price/list.vue +++ b/src/views/measure/price/list.vue @@ -4,7 +4,7 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import type { IlistQuery, IlistType } from './list_interface' import ListPriceAdd from './priceAdd.vue' -import { getDeletePrice, getPriceList, uploadPrice } from '@/api/system/price' +import { getDeletePrice, getPriceList, getTypeSelect, uploadPrice } from '@/api/system/price' import { exportExcel } from '@/utils/exportXlsx' // 查询条件 const listQuery: Ref = ref({ @@ -87,6 +87,12 @@ const deleteId = ref('') // 详情id const infoId = ref('0') +// 校验类型下拉框数组 +const checkTypeOptions = ref([]) +// 类别下拉框数组 +const priceTypeOptions = ref([]) +// 项目下拉框数组 +const priceItemOptions = ref([]) const isPopconfirmShow = ref(false) // 点击按钮 const buttonType = ref('') @@ -150,6 +156,23 @@ const cancelEvent = () => { console.log('cancel!') } +// 获取下拉框数据 +const getOptions = (code: string) => { + getTypeSelect(code).then((res) => { + if (code === 'checkType') { + checkTypeOptions.value = res.data + } + else if (code === 'priceType') { + priceTypeOptions.value = res.data + } + else if (code === 'priceItem') { + priceItemOptions.value = res.data + } + }) +} +getOptions('checkType') +getOptions('priceType') +getOptions('priceItem') // 点击重置 const clearList = () => { listQuery.value = { @@ -274,25 +297,52 @@ /> - + placeholder="检校类型" + size="default" + :disabled="buttonType === '详情'" + > + + - + placeholder="类别" + size="default" + :disabled="buttonType === '详情'" + > + + - + placeholder="项目" + size="default" + :disabled="buttonType === '详情'" + > + + diff --git a/src/views/measure/train/plan.vue b/src/views/measure/train/plan.vue index f0ed074..9707995 100644 --- a/src/views/measure/train/plan.vue +++ b/src/views/measure/train/plan.vue @@ -70,12 +70,11 @@ { text: '培训时间', value: 'trainTime', - width: '180', + width: '90', }, { text: '主管部门', value: 'deptName', - width: '90', }, { text: '实施单位', @@ -90,7 +89,7 @@ { text: '创建时间', value: 'createTime', - width: '180', + width: '90', }, { text: '备注', diff --git a/src/views/measure/train/trainLog.vue b/src/views/measure/train/trainLog.vue index a531fd1..dcea9ee 100644 --- a/src/views/measure/train/trainLog.vue +++ b/src/views/measure/train/trainLog.vue @@ -42,7 +42,6 @@ { text: '记录编号', value: 'logNo', - width: '180', }, { text: '培训名称', @@ -52,12 +51,12 @@ { text: '培训时间', value: 'trainTime', - width: '180', + width: '160', }, { text: '培训地点', value: 'trainAddress', - width: '120', + width: '100', }, { text: '培训学时', @@ -65,9 +64,9 @@ width: '100', }, { - text: '培训时间', + text: '培训对象', value: 'trainPerson', - width: '180', + width: '100', }, { text: '培训人数', @@ -77,7 +76,7 @@ { text: '创建时间', value: 'createTime', - width: '180', + width: '160', }, { text: '备注',