diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..28ca2ed --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,27 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..28ca2ed --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,27 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 1c14871..146448c 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -197,7 +197,6 @@ :page-size="props.query.limit" :total="props.total" layout="total, sizes, prev, pager, next" - hide-on-single-page @size-change="handleSizeChange" @current-change="handleCurrentChange" /> diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..28ca2ed --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,27 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 1c14871..146448c 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -197,7 +197,6 @@ :page-size="props.query.limit" :total="props.total" layout="total, sizes, prev, pager, next" - hide-on-single-page @size-change="handleSizeChange" @current-change="handleCurrentChange" /> diff --git a/src/router/modules/device.ts b/src/router/modules/device.ts index 7a93fa9..777ef0c 100644 --- a/src/router/modules/device.ts +++ b/src/router/modules/device.ts @@ -85,11 +85,31 @@ name: 'standingBookDetail', component: () => import('@/views/device/standingBook/components/templateAdd.vue'), meta: { - title: '设备台账', + title: '设备台账公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/measureDevice', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'measureDevice': + to.meta.activeMenu = '/standingBook/measureDevice' + break + case 'standardMatchDevice': + to.meta.activeMenu = '/standingBook/standardMatchDevice' + break + case 'adjustDevice': + to.meta.activeMenu = '/standingBook/adjustDevice' + break + case 'measureTool': + to.meta.activeMenu = '/standingBook/measureTool' + break + } + next() }, }, { @@ -111,7 +131,7 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/fixedAssets', }, }, ], @@ -289,11 +309,39 @@ name: 'stateManageDetail', component: () => import('@/views/device/stateManage/components/templateAdd.vue'), meta: { - title: '状态管理', + title: '状态管理公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/stateManage', + activeMenu: '/stateManage/unusedApply', + }, + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'unusedApply': + to.meta.activeMenu = '/stateManage/unusedApply' + break + case 'sealupApply': + to.meta.activeMenu = '/stateManage/sealupApply' + break + case 'openApply': + to.meta.activeMenu = '/stateManage/openApply' + break + case 'scrapApply': + to.meta.activeMenu = '/stateManage/scrapApply' + break + case 'handleApply': + to.meta.activeMenu = '/stateManage/handleApply' + break + case 'borrowapply': + to.meta.activeMenu = '/borrow/borrowapply' + break + case 'borrowhandle': + to.meta.activeMenu = '/borrow/borrowhandle' + break + } + next() }, }, ], diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..28ca2ed --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,27 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 1c14871..146448c 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -197,7 +197,6 @@ :page-size="props.query.limit" :total="props.total" layout="total, sizes, prev, pager, next" - hide-on-single-page @size-change="handleSizeChange" @current-change="handleCurrentChange" /> diff --git a/src/router/modules/device.ts b/src/router/modules/device.ts index 7a93fa9..777ef0c 100644 --- a/src/router/modules/device.ts +++ b/src/router/modules/device.ts @@ -85,11 +85,31 @@ name: 'standingBookDetail', component: () => import('@/views/device/standingBook/components/templateAdd.vue'), meta: { - title: '设备台账', + title: '设备台账公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/measureDevice', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'measureDevice': + to.meta.activeMenu = '/standingBook/measureDevice' + break + case 'standardMatchDevice': + to.meta.activeMenu = '/standingBook/standardMatchDevice' + break + case 'adjustDevice': + to.meta.activeMenu = '/standingBook/adjustDevice' + break + case 'measureTool': + to.meta.activeMenu = '/standingBook/measureTool' + break + } + next() }, }, { @@ -111,7 +131,7 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/fixedAssets', }, }, ], @@ -289,11 +309,39 @@ name: 'stateManageDetail', component: () => import('@/views/device/stateManage/components/templateAdd.vue'), meta: { - title: '状态管理', + title: '状态管理公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/stateManage', + activeMenu: '/stateManage/unusedApply', + }, + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'unusedApply': + to.meta.activeMenu = '/stateManage/unusedApply' + break + case 'sealupApply': + to.meta.activeMenu = '/stateManage/sealupApply' + break + case 'openApply': + to.meta.activeMenu = '/stateManage/openApply' + break + case 'scrapApply': + to.meta.activeMenu = '/stateManage/scrapApply' + break + case 'handleApply': + to.meta.activeMenu = '/stateManage/handleApply' + break + case 'borrowapply': + to.meta.activeMenu = '/borrow/borrowapply' + break + case 'borrowhandle': + to.meta.activeMenu = '/borrow/borrowhandle' + break + } + next() }, }, ], diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 5b0e1f4..973fa04 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -98,7 +98,33 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/file', + activeMenu: '/file/quality', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'quality': + to.meta.activeMenu = '/file/quality' + break + case 'rules': + to.meta.activeMenu = '/file/rules' + break + case 'remind': + to.meta.activeMenu = '/file/quality' + break + case 'manageMethod': + to.meta.activeMenu = '/file/manageMethod' + break + case 'testingMethod': + to.meta.activeMenu = '/file/testingMethod' + break + case 'measureRule': + to.meta.activeMenu = '/file/measureRule' + break + } + next() }, }, { @@ -143,7 +169,7 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/person', + activeMenu: '/person/list', }, }, { @@ -165,7 +191,21 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/person', + activeMenu: '/measure/person/certificateLog', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'certificateLog': + to.meta.activeMenu = '/person/certificateLog' + break + case 'remind': + to.meta.activeMenu = '/person/remind' + break + } + next() }, }, { @@ -309,7 +349,24 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/measureDept', + activeMenu: '/measureDept/bm', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + // 当不同页面中 使用了相同的 编辑/详情路由 + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + switch (type) { + case 'bm': + to.meta.activeMenu = '/measureDept/bm' + break + case 'ks': + to.meta.activeMenu = '/measureDept/ks' + break + case 'gcz': + to.meta.activeMenu = '/measureDept/gcz' + break + } + next() }, }, ], diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..28ca2ed --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,27 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 1c14871..146448c 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -197,7 +197,6 @@ :page-size="props.query.limit" :total="props.total" layout="total, sizes, prev, pager, next" - hide-on-single-page @size-change="handleSizeChange" @current-change="handleCurrentChange" /> diff --git a/src/router/modules/device.ts b/src/router/modules/device.ts index 7a93fa9..777ef0c 100644 --- a/src/router/modules/device.ts +++ b/src/router/modules/device.ts @@ -85,11 +85,31 @@ name: 'standingBookDetail', component: () => import('@/views/device/standingBook/components/templateAdd.vue'), meta: { - title: '设备台账', + title: '设备台账公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/measureDevice', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'measureDevice': + to.meta.activeMenu = '/standingBook/measureDevice' + break + case 'standardMatchDevice': + to.meta.activeMenu = '/standingBook/standardMatchDevice' + break + case 'adjustDevice': + to.meta.activeMenu = '/standingBook/adjustDevice' + break + case 'measureTool': + to.meta.activeMenu = '/standingBook/measureTool' + break + } + next() }, }, { @@ -111,7 +131,7 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/fixedAssets', }, }, ], @@ -289,11 +309,39 @@ name: 'stateManageDetail', component: () => import('@/views/device/stateManage/components/templateAdd.vue'), meta: { - title: '状态管理', + title: '状态管理公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/stateManage', + activeMenu: '/stateManage/unusedApply', + }, + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'unusedApply': + to.meta.activeMenu = '/stateManage/unusedApply' + break + case 'sealupApply': + to.meta.activeMenu = '/stateManage/sealupApply' + break + case 'openApply': + to.meta.activeMenu = '/stateManage/openApply' + break + case 'scrapApply': + to.meta.activeMenu = '/stateManage/scrapApply' + break + case 'handleApply': + to.meta.activeMenu = '/stateManage/handleApply' + break + case 'borrowapply': + to.meta.activeMenu = '/borrow/borrowapply' + break + case 'borrowhandle': + to.meta.activeMenu = '/borrow/borrowhandle' + break + } + next() }, }, ], diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 5b0e1f4..973fa04 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -98,7 +98,33 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/file', + activeMenu: '/file/quality', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'quality': + to.meta.activeMenu = '/file/quality' + break + case 'rules': + to.meta.activeMenu = '/file/rules' + break + case 'remind': + to.meta.activeMenu = '/file/quality' + break + case 'manageMethod': + to.meta.activeMenu = '/file/manageMethod' + break + case 'testingMethod': + to.meta.activeMenu = '/file/testingMethod' + break + case 'measureRule': + to.meta.activeMenu = '/file/measureRule' + break + } + next() }, }, { @@ -143,7 +169,7 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/person', + activeMenu: '/person/list', }, }, { @@ -165,7 +191,21 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/person', + activeMenu: '/measure/person/certificateLog', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'certificateLog': + to.meta.activeMenu = '/person/certificateLog' + break + case 'remind': + to.meta.activeMenu = '/person/remind' + break + } + next() }, }, { @@ -309,7 +349,24 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/measureDept', + activeMenu: '/measureDept/bm', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + // 当不同页面中 使用了相同的 编辑/详情路由 + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + switch (type) { + case 'bm': + to.meta.activeMenu = '/measureDept/bm' + break + case 'ks': + to.meta.activeMenu = '/measureDept/ks' + break + case 'gcz': + to.meta.activeMenu = '/measureDept/gcz' + break + } + next() }, }, ], diff --git a/src/views/device/bench/deviceBench.vue b/src/views/device/bench/deviceBench.vue index 9206576..8d74984 100644 --- a/src/views/device/bench/deviceBench.vue +++ b/src/views/device/bench/deviceBench.vue @@ -1,13 +1,397 @@ - 工作台 + + + + + + + + + + + + + + + + + + + + 测量设备 + {{ theMonthTotalData.testValue }} + + + + + + 在用设备 + + {{ theMonthTotalData.testIn }} + + + + + + 闲置设备 + {{ theMonthTotalData.testLeave }} + + + + + 封存设备 + {{ theMonthTotalData.testSeal }} + + + + + + + + 标准装置 + {{ theMonthTotalData.standardValue }} + + + + + + 在用装置 + {{ theMonthTotalData.standardIn }} + + + + + 暂停装置 + {{ theMonthTotalData.standardStop }} + + + + + 撤销装置 + {{ theMonthTotalData.standardAnnul }} + + + + + + + + + + + 本月设备领用 + {{ theMonthTotalData.receive }} + + + + + 本月设备借用 + {{ theMonthTotalData.borrow }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + 待检定设备数量 + {{ myEquipment.stay }} + + + 超期未检定设备数量 + {{ myEquipment.not }} + + + + + + + + diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..28ca2ed --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,27 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 1c14871..146448c 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -197,7 +197,6 @@ :page-size="props.query.limit" :total="props.total" layout="total, sizes, prev, pager, next" - hide-on-single-page @size-change="handleSizeChange" @current-change="handleCurrentChange" /> diff --git a/src/router/modules/device.ts b/src/router/modules/device.ts index 7a93fa9..777ef0c 100644 --- a/src/router/modules/device.ts +++ b/src/router/modules/device.ts @@ -85,11 +85,31 @@ name: 'standingBookDetail', component: () => import('@/views/device/standingBook/components/templateAdd.vue'), meta: { - title: '设备台账', + title: '设备台账公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/measureDevice', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'measureDevice': + to.meta.activeMenu = '/standingBook/measureDevice' + break + case 'standardMatchDevice': + to.meta.activeMenu = '/standingBook/standardMatchDevice' + break + case 'adjustDevice': + to.meta.activeMenu = '/standingBook/adjustDevice' + break + case 'measureTool': + to.meta.activeMenu = '/standingBook/measureTool' + break + } + next() }, }, { @@ -111,7 +131,7 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/fixedAssets', }, }, ], @@ -289,11 +309,39 @@ name: 'stateManageDetail', component: () => import('@/views/device/stateManage/components/templateAdd.vue'), meta: { - title: '状态管理', + title: '状态管理公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/stateManage', + activeMenu: '/stateManage/unusedApply', + }, + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'unusedApply': + to.meta.activeMenu = '/stateManage/unusedApply' + break + case 'sealupApply': + to.meta.activeMenu = '/stateManage/sealupApply' + break + case 'openApply': + to.meta.activeMenu = '/stateManage/openApply' + break + case 'scrapApply': + to.meta.activeMenu = '/stateManage/scrapApply' + break + case 'handleApply': + to.meta.activeMenu = '/stateManage/handleApply' + break + case 'borrowapply': + to.meta.activeMenu = '/borrow/borrowapply' + break + case 'borrowhandle': + to.meta.activeMenu = '/borrow/borrowhandle' + break + } + next() }, }, ], diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 5b0e1f4..973fa04 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -98,7 +98,33 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/file', + activeMenu: '/file/quality', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'quality': + to.meta.activeMenu = '/file/quality' + break + case 'rules': + to.meta.activeMenu = '/file/rules' + break + case 'remind': + to.meta.activeMenu = '/file/quality' + break + case 'manageMethod': + to.meta.activeMenu = '/file/manageMethod' + break + case 'testingMethod': + to.meta.activeMenu = '/file/testingMethod' + break + case 'measureRule': + to.meta.activeMenu = '/file/measureRule' + break + } + next() }, }, { @@ -143,7 +169,7 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/person', + activeMenu: '/person/list', }, }, { @@ -165,7 +191,21 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/person', + activeMenu: '/measure/person/certificateLog', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'certificateLog': + to.meta.activeMenu = '/person/certificateLog' + break + case 'remind': + to.meta.activeMenu = '/person/remind' + break + } + next() }, }, { @@ -309,7 +349,24 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/measureDept', + activeMenu: '/measureDept/bm', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + // 当不同页面中 使用了相同的 编辑/详情路由 + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + switch (type) { + case 'bm': + to.meta.activeMenu = '/measureDept/bm' + break + case 'ks': + to.meta.activeMenu = '/measureDept/ks' + break + case 'gcz': + to.meta.activeMenu = '/measureDept/gcz' + break + } + next() }, }, ], diff --git a/src/views/device/bench/deviceBench.vue b/src/views/device/bench/deviceBench.vue index 9206576..8d74984 100644 --- a/src/views/device/bench/deviceBench.vue +++ b/src/views/device/bench/deviceBench.vue @@ -1,13 +1,397 @@ - 工作台 + + + + + + + + + + + + + + + + + + + + 测量设备 + {{ theMonthTotalData.testValue }} + + + + + + 在用设备 + + {{ theMonthTotalData.testIn }} + + + + + + 闲置设备 + {{ theMonthTotalData.testLeave }} + + + + + 封存设备 + {{ theMonthTotalData.testSeal }} + + + + + + + + 标准装置 + {{ theMonthTotalData.standardValue }} + + + + + + 在用装置 + {{ theMonthTotalData.standardIn }} + + + + + 暂停装置 + {{ theMonthTotalData.standardStop }} + + + + + 撤销装置 + {{ theMonthTotalData.standardAnnul }} + + + + + + + + + + + 本月设备领用 + {{ theMonthTotalData.receive }} + + + + + 本月设备借用 + {{ theMonthTotalData.borrow }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + 待检定设备数量 + {{ myEquipment.stay }} + + + 超期未检定设备数量 + {{ myEquipment.not }} + + + + + + + + diff --git a/src/views/device/borrow/borrow-interface.ts b/src/views/device/borrow/borrow-interface.ts new file mode 100644 index 0000000..0cd02d3 --- /dev/null +++ b/src/views/device/borrow/borrow-interface.ts @@ -0,0 +1,26 @@ +// 设备借用申请查询参数类型 +export interface searchType { + applyName: string // 申请名称 + applyNo: string // 申请编号 + applyPerson: string // 申请人 + applyUnit: string // 申请单位 + approvalStatus?: string // 审批状态 + createUser: string // 创建人 + processResult: string // 处置结果 + time: string // 申请日期 + limit?: number + offset?: number +} +// 借用设备类型 +export interface borrowDeviceType { + createUser?: string // 当前用户id + equipmentId: string // 设备id + equipmentNo: string // 设备编号 + modelNo: string // 型号 + measureRange: string // 测量范围 + useDept: string // 使用部门 + usePerson: string // 使用人 + validDate: string // 有效日期 + edit?: boolean + equipmentName?: string +} diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..28ca2ed --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,27 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 1c14871..146448c 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -197,7 +197,6 @@ :page-size="props.query.limit" :total="props.total" layout="total, sizes, prev, pager, next" - hide-on-single-page @size-change="handleSizeChange" @current-change="handleCurrentChange" /> diff --git a/src/router/modules/device.ts b/src/router/modules/device.ts index 7a93fa9..777ef0c 100644 --- a/src/router/modules/device.ts +++ b/src/router/modules/device.ts @@ -85,11 +85,31 @@ name: 'standingBookDetail', component: () => import('@/views/device/standingBook/components/templateAdd.vue'), meta: { - title: '设备台账', + title: '设备台账公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/measureDevice', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'measureDevice': + to.meta.activeMenu = '/standingBook/measureDevice' + break + case 'standardMatchDevice': + to.meta.activeMenu = '/standingBook/standardMatchDevice' + break + case 'adjustDevice': + to.meta.activeMenu = '/standingBook/adjustDevice' + break + case 'measureTool': + to.meta.activeMenu = '/standingBook/measureTool' + break + } + next() }, }, { @@ -111,7 +131,7 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/fixedAssets', }, }, ], @@ -289,11 +309,39 @@ name: 'stateManageDetail', component: () => import('@/views/device/stateManage/components/templateAdd.vue'), meta: { - title: '状态管理', + title: '状态管理公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/stateManage', + activeMenu: '/stateManage/unusedApply', + }, + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'unusedApply': + to.meta.activeMenu = '/stateManage/unusedApply' + break + case 'sealupApply': + to.meta.activeMenu = '/stateManage/sealupApply' + break + case 'openApply': + to.meta.activeMenu = '/stateManage/openApply' + break + case 'scrapApply': + to.meta.activeMenu = '/stateManage/scrapApply' + break + case 'handleApply': + to.meta.activeMenu = '/stateManage/handleApply' + break + case 'borrowapply': + to.meta.activeMenu = '/borrow/borrowapply' + break + case 'borrowhandle': + to.meta.activeMenu = '/borrow/borrowhandle' + break + } + next() }, }, ], diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 5b0e1f4..973fa04 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -98,7 +98,33 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/file', + activeMenu: '/file/quality', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'quality': + to.meta.activeMenu = '/file/quality' + break + case 'rules': + to.meta.activeMenu = '/file/rules' + break + case 'remind': + to.meta.activeMenu = '/file/quality' + break + case 'manageMethod': + to.meta.activeMenu = '/file/manageMethod' + break + case 'testingMethod': + to.meta.activeMenu = '/file/testingMethod' + break + case 'measureRule': + to.meta.activeMenu = '/file/measureRule' + break + } + next() }, }, { @@ -143,7 +169,7 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/person', + activeMenu: '/person/list', }, }, { @@ -165,7 +191,21 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/person', + activeMenu: '/measure/person/certificateLog', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'certificateLog': + to.meta.activeMenu = '/person/certificateLog' + break + case 'remind': + to.meta.activeMenu = '/person/remind' + break + } + next() }, }, { @@ -309,7 +349,24 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/measureDept', + activeMenu: '/measureDept/bm', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + // 当不同页面中 使用了相同的 编辑/详情路由 + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + switch (type) { + case 'bm': + to.meta.activeMenu = '/measureDept/bm' + break + case 'ks': + to.meta.activeMenu = '/measureDept/ks' + break + case 'gcz': + to.meta.activeMenu = '/measureDept/gcz' + break + } + next() }, }, ], diff --git a/src/views/device/bench/deviceBench.vue b/src/views/device/bench/deviceBench.vue index 9206576..8d74984 100644 --- a/src/views/device/bench/deviceBench.vue +++ b/src/views/device/bench/deviceBench.vue @@ -1,13 +1,397 @@ - 工作台 + + + + + + + + + + + + + + + + + + + + 测量设备 + {{ theMonthTotalData.testValue }} + + + + + + 在用设备 + + {{ theMonthTotalData.testIn }} + + + + + + 闲置设备 + {{ theMonthTotalData.testLeave }} + + + + + 封存设备 + {{ theMonthTotalData.testSeal }} + + + + + + + + 标准装置 + {{ theMonthTotalData.standardValue }} + + + + + + 在用装置 + {{ theMonthTotalData.standardIn }} + + + + + 暂停装置 + {{ theMonthTotalData.standardStop }} + + + + + 撤销装置 + {{ theMonthTotalData.standardAnnul }} + + + + + + + + + + + 本月设备领用 + {{ theMonthTotalData.receive }} + + + + + 本月设备借用 + {{ theMonthTotalData.borrow }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + 待检定设备数量 + {{ myEquipment.stay }} + + + 超期未检定设备数量 + {{ myEquipment.not }} + + + + + + + + diff --git a/src/views/device/borrow/borrow-interface.ts b/src/views/device/borrow/borrow-interface.ts new file mode 100644 index 0000000..0cd02d3 --- /dev/null +++ b/src/views/device/borrow/borrow-interface.ts @@ -0,0 +1,26 @@ +// 设备借用申请查询参数类型 +export interface searchType { + applyName: string // 申请名称 + applyNo: string // 申请编号 + applyPerson: string // 申请人 + applyUnit: string // 申请单位 + approvalStatus?: string // 审批状态 + createUser: string // 创建人 + processResult: string // 处置结果 + time: string // 申请日期 + limit?: number + offset?: number +} +// 借用设备类型 +export interface borrowDeviceType { + createUser?: string // 当前用户id + equipmentId: string // 设备id + equipmentNo: string // 设备编号 + modelNo: string // 型号 + measureRange: string // 测量范围 + useDept: string // 使用部门 + usePerson: string // 使用人 + validDate: string // 有效日期 + edit?: boolean + equipmentName?: string +} diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..6667663 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +55,7 @@ - + diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..28ca2ed --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,27 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 1c14871..146448c 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -197,7 +197,6 @@ :page-size="props.query.limit" :total="props.total" layout="total, sizes, prev, pager, next" - hide-on-single-page @size-change="handleSizeChange" @current-change="handleCurrentChange" /> diff --git a/src/router/modules/device.ts b/src/router/modules/device.ts index 7a93fa9..777ef0c 100644 --- a/src/router/modules/device.ts +++ b/src/router/modules/device.ts @@ -85,11 +85,31 @@ name: 'standingBookDetail', component: () => import('@/views/device/standingBook/components/templateAdd.vue'), meta: { - title: '设备台账', + title: '设备台账公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/measureDevice', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'measureDevice': + to.meta.activeMenu = '/standingBook/measureDevice' + break + case 'standardMatchDevice': + to.meta.activeMenu = '/standingBook/standardMatchDevice' + break + case 'adjustDevice': + to.meta.activeMenu = '/standingBook/adjustDevice' + break + case 'measureTool': + to.meta.activeMenu = '/standingBook/measureTool' + break + } + next() }, }, { @@ -111,7 +131,7 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/fixedAssets', }, }, ], @@ -289,11 +309,39 @@ name: 'stateManageDetail', component: () => import('@/views/device/stateManage/components/templateAdd.vue'), meta: { - title: '状态管理', + title: '状态管理公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/stateManage', + activeMenu: '/stateManage/unusedApply', + }, + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'unusedApply': + to.meta.activeMenu = '/stateManage/unusedApply' + break + case 'sealupApply': + to.meta.activeMenu = '/stateManage/sealupApply' + break + case 'openApply': + to.meta.activeMenu = '/stateManage/openApply' + break + case 'scrapApply': + to.meta.activeMenu = '/stateManage/scrapApply' + break + case 'handleApply': + to.meta.activeMenu = '/stateManage/handleApply' + break + case 'borrowapply': + to.meta.activeMenu = '/borrow/borrowapply' + break + case 'borrowhandle': + to.meta.activeMenu = '/borrow/borrowhandle' + break + } + next() }, }, ], diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 5b0e1f4..973fa04 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -98,7 +98,33 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/file', + activeMenu: '/file/quality', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'quality': + to.meta.activeMenu = '/file/quality' + break + case 'rules': + to.meta.activeMenu = '/file/rules' + break + case 'remind': + to.meta.activeMenu = '/file/quality' + break + case 'manageMethod': + to.meta.activeMenu = '/file/manageMethod' + break + case 'testingMethod': + to.meta.activeMenu = '/file/testingMethod' + break + case 'measureRule': + to.meta.activeMenu = '/file/measureRule' + break + } + next() }, }, { @@ -143,7 +169,7 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/person', + activeMenu: '/person/list', }, }, { @@ -165,7 +191,21 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/person', + activeMenu: '/measure/person/certificateLog', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'certificateLog': + to.meta.activeMenu = '/person/certificateLog' + break + case 'remind': + to.meta.activeMenu = '/person/remind' + break + } + next() }, }, { @@ -309,7 +349,24 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/measureDept', + activeMenu: '/measureDept/bm', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + // 当不同页面中 使用了相同的 编辑/详情路由 + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + switch (type) { + case 'bm': + to.meta.activeMenu = '/measureDept/bm' + break + case 'ks': + to.meta.activeMenu = '/measureDept/ks' + break + case 'gcz': + to.meta.activeMenu = '/measureDept/gcz' + break + } + next() }, }, ], diff --git a/src/views/device/bench/deviceBench.vue b/src/views/device/bench/deviceBench.vue index 9206576..8d74984 100644 --- a/src/views/device/bench/deviceBench.vue +++ b/src/views/device/bench/deviceBench.vue @@ -1,13 +1,397 @@ - 工作台 + + + + + + + + + + + + + + + + + + + + 测量设备 + {{ theMonthTotalData.testValue }} + + + + + + 在用设备 + + {{ theMonthTotalData.testIn }} + + + + + + 闲置设备 + {{ theMonthTotalData.testLeave }} + + + + + 封存设备 + {{ theMonthTotalData.testSeal }} + + + + + + + + 标准装置 + {{ theMonthTotalData.standardValue }} + + + + + + 在用装置 + {{ theMonthTotalData.standardIn }} + + + + + 暂停装置 + {{ theMonthTotalData.standardStop }} + + + + + 撤销装置 + {{ theMonthTotalData.standardAnnul }} + + + + + + + + + + + 本月设备领用 + {{ theMonthTotalData.receive }} + + + + + 本月设备借用 + {{ theMonthTotalData.borrow }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + 待检定设备数量 + {{ myEquipment.stay }} + + + 超期未检定设备数量 + {{ myEquipment.not }} + + + + + + + + diff --git a/src/views/device/borrow/borrow-interface.ts b/src/views/device/borrow/borrow-interface.ts new file mode 100644 index 0000000..0cd02d3 --- /dev/null +++ b/src/views/device/borrow/borrow-interface.ts @@ -0,0 +1,26 @@ +// 设备借用申请查询参数类型 +export interface searchType { + applyName: string // 申请名称 + applyNo: string // 申请编号 + applyPerson: string // 申请人 + applyUnit: string // 申请单位 + approvalStatus?: string // 审批状态 + createUser: string // 创建人 + processResult: string // 处置结果 + time: string // 申请日期 + limit?: number + offset?: number +} +// 借用设备类型 +export interface borrowDeviceType { + createUser?: string // 当前用户id + equipmentId: string // 设备id + equipmentNo: string // 设备编号 + modelNo: string // 型号 + measureRange: string // 测量范围 + useDept: string // 使用部门 + usePerson: string // 使用人 + validDate: string // 有效日期 + edit?: boolean + equipmentName?: string +} diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..6667663 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +55,7 @@ - + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..d420d62 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,25 +1,41 @@ @@ -269,20 +324,20 @@ - + - + - + - + - + @@ -309,18 +364,19 @@ - + + 查看 - + 同意 - + 驳回 - + 拒绝 @@ -331,6 +387,31 @@ + + + + + 查看 + + + 编辑 + + + 提交 + + + 删除 + + + + + + + + 查看 + + + diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..28ca2ed --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,27 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 1c14871..146448c 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -197,7 +197,6 @@ :page-size="props.query.limit" :total="props.total" layout="total, sizes, prev, pager, next" - hide-on-single-page @size-change="handleSizeChange" @current-change="handleCurrentChange" /> diff --git a/src/router/modules/device.ts b/src/router/modules/device.ts index 7a93fa9..777ef0c 100644 --- a/src/router/modules/device.ts +++ b/src/router/modules/device.ts @@ -85,11 +85,31 @@ name: 'standingBookDetail', component: () => import('@/views/device/standingBook/components/templateAdd.vue'), meta: { - title: '设备台账', + title: '设备台账公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/measureDevice', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'measureDevice': + to.meta.activeMenu = '/standingBook/measureDevice' + break + case 'standardMatchDevice': + to.meta.activeMenu = '/standingBook/standardMatchDevice' + break + case 'adjustDevice': + to.meta.activeMenu = '/standingBook/adjustDevice' + break + case 'measureTool': + to.meta.activeMenu = '/standingBook/measureTool' + break + } + next() }, }, { @@ -111,7 +131,7 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/fixedAssets', }, }, ], @@ -289,11 +309,39 @@ name: 'stateManageDetail', component: () => import('@/views/device/stateManage/components/templateAdd.vue'), meta: { - title: '状态管理', + title: '状态管理公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/stateManage', + activeMenu: '/stateManage/unusedApply', + }, + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'unusedApply': + to.meta.activeMenu = '/stateManage/unusedApply' + break + case 'sealupApply': + to.meta.activeMenu = '/stateManage/sealupApply' + break + case 'openApply': + to.meta.activeMenu = '/stateManage/openApply' + break + case 'scrapApply': + to.meta.activeMenu = '/stateManage/scrapApply' + break + case 'handleApply': + to.meta.activeMenu = '/stateManage/handleApply' + break + case 'borrowapply': + to.meta.activeMenu = '/borrow/borrowapply' + break + case 'borrowhandle': + to.meta.activeMenu = '/borrow/borrowhandle' + break + } + next() }, }, ], diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 5b0e1f4..973fa04 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -98,7 +98,33 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/file', + activeMenu: '/file/quality', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'quality': + to.meta.activeMenu = '/file/quality' + break + case 'rules': + to.meta.activeMenu = '/file/rules' + break + case 'remind': + to.meta.activeMenu = '/file/quality' + break + case 'manageMethod': + to.meta.activeMenu = '/file/manageMethod' + break + case 'testingMethod': + to.meta.activeMenu = '/file/testingMethod' + break + case 'measureRule': + to.meta.activeMenu = '/file/measureRule' + break + } + next() }, }, { @@ -143,7 +169,7 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/person', + activeMenu: '/person/list', }, }, { @@ -165,7 +191,21 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/person', + activeMenu: '/measure/person/certificateLog', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'certificateLog': + to.meta.activeMenu = '/person/certificateLog' + break + case 'remind': + to.meta.activeMenu = '/person/remind' + break + } + next() }, }, { @@ -309,7 +349,24 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/measureDept', + activeMenu: '/measureDept/bm', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + // 当不同页面中 使用了相同的 编辑/详情路由 + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + switch (type) { + case 'bm': + to.meta.activeMenu = '/measureDept/bm' + break + case 'ks': + to.meta.activeMenu = '/measureDept/ks' + break + case 'gcz': + to.meta.activeMenu = '/measureDept/gcz' + break + } + next() }, }, ], diff --git a/src/views/device/bench/deviceBench.vue b/src/views/device/bench/deviceBench.vue index 9206576..8d74984 100644 --- a/src/views/device/bench/deviceBench.vue +++ b/src/views/device/bench/deviceBench.vue @@ -1,13 +1,397 @@ - 工作台 + + + + + + + + + + + + + + + + + + + + 测量设备 + {{ theMonthTotalData.testValue }} + + + + + + 在用设备 + + {{ theMonthTotalData.testIn }} + + + + + + 闲置设备 + {{ theMonthTotalData.testLeave }} + + + + + 封存设备 + {{ theMonthTotalData.testSeal }} + + + + + + + + 标准装置 + {{ theMonthTotalData.standardValue }} + + + + + + 在用装置 + {{ theMonthTotalData.standardIn }} + + + + + 暂停装置 + {{ theMonthTotalData.standardStop }} + + + + + 撤销装置 + {{ theMonthTotalData.standardAnnul }} + + + + + + + + + + + 本月设备领用 + {{ theMonthTotalData.receive }} + + + + + 本月设备借用 + {{ theMonthTotalData.borrow }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + 待检定设备数量 + {{ myEquipment.stay }} + + + 超期未检定设备数量 + {{ myEquipment.not }} + + + + + + + + diff --git a/src/views/device/borrow/borrow-interface.ts b/src/views/device/borrow/borrow-interface.ts new file mode 100644 index 0000000..0cd02d3 --- /dev/null +++ b/src/views/device/borrow/borrow-interface.ts @@ -0,0 +1,26 @@ +// 设备借用申请查询参数类型 +export interface searchType { + applyName: string // 申请名称 + applyNo: string // 申请编号 + applyPerson: string // 申请人 + applyUnit: string // 申请单位 + approvalStatus?: string // 审批状态 + createUser: string // 创建人 + processResult: string // 处置结果 + time: string // 申请日期 + limit?: number + offset?: number +} +// 借用设备类型 +export interface borrowDeviceType { + createUser?: string // 当前用户id + equipmentId: string // 设备id + equipmentNo: string // 设备编号 + modelNo: string // 型号 + measureRange: string // 测量范围 + useDept: string // 使用部门 + usePerson: string // 使用人 + validDate: string // 有效日期 + edit?: boolean + equipmentName?: string +} diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..6667663 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +55,7 @@ - + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..d420d62 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,25 +1,41 @@ @@ -269,20 +324,20 @@ - + - + - + - + - + @@ -309,18 +364,19 @@ - + + 查看 - + 同意 - + 驳回 - + 拒绝 @@ -331,6 +387,31 @@ + + + + + 查看 + + + 编辑 + + + 提交 + + + 删除 + + + + + + + + 查看 + + + diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 6ae1a30..856c2ff 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -12,13 +12,16 @@ import comTreeSelect from '@/views/system/user/selecTree.vue' import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' +import { addApply, detailApply } from '@/api/device/borrow' +import type { borrowDeviceType } from '@/views/device/borrow/borrow-interface' const $router = useRouter() const $route = useRoute() -const ruleFormRef = ref() // from组件 +const ruleFormRef1 = ref() // from组件 +const ruleFormRef2 = ref() // from组件 const title = ref('') const name = ref('') -const borrowList = ref([]) -const ruleForm = ref({ +const borrowList = ref([]) +const ruleForm1 = ref({ assetNo: '', // 资产编号 assetType: '', // 资产类型 assetSource: '', // 资产来源 @@ -71,7 +74,13 @@ isStandardSupportEquipment: '', // 是否标准配套设备 id: '', }) // 表单 -const rules = ref({ +const ruleForm2 = ref({ + applyUnit: '', // 申请单位 + applyPerson: '', // 申请人 + time: '', // 借用时间 + applyDesc: '', // 申请说明 +}) +const rules1 = ref({ assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }], equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }], manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }], @@ -84,6 +93,11 @@ mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }], validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }], }) // 表单验证规则 +const rules2 = ref({ + applyUnit: [{ required: true, message: '申请单位不能为空', trigger: 'blur' }], + applyPerson: [{ required: true, message: '申请人不能为空', trigger: 'blur' }], + time: [{ required: true, message: '借用时间不能为空', trigger: 'blur' }], +}) const assetTypeList = ref([]) // 资产类型 const ABCList = ref([]) // ABC const mesureTypeList = ref([]) // 检定方式 @@ -203,7 +217,7 @@ } // 重置 const resetDATA = () => { - ruleForm.value = { + ruleForm1.value = { assetNo: '', // 资产编号 assetType: '', // 资产类型 assetSource: '', // 资产来源 @@ -257,61 +271,86 @@ id: '', } } +// 判断是设备借用还是状态管理 +const isDevice = computed(() => { + if (name.value == '设备借用申请' || name.value == '设备借用处理') { + return true + } + else { + return false + } +}) // 弹窗初始化 const initDialog = (row: any) => { fetchData() - ruleFormRef.value?.resetFields() + // ruleFormRef.value?.resetFields() title.value = row.title name.value = row.name - // dialogVisible.value = true - // if (row.title !== '新建') { - // assetsDetailApi({ id: row.id }).then((res) => { - // for (const key in res.data) { - // if (typeof res.data[key] == 'number') { - // res.data[key] = String(res.data[key]) - // } - // } - // ruleForm.value = res.data - // }) - // } + if (isDevice) { + // 设备借用 + if (title.value !== '新建') { + detailApply({ id: row.id }).then((res) => { + ruleForm2.value = res.data + borrowList.value = res.data.equipmentList + }) + } + } + else { + // 状态管理 + } } onMounted(() => { initDialog($route.query) }) + // 关闭弹窗 const close = () => { resetDATA() $router.go(-1) } // 提交 -const submitForm = async (formEl: FormInstance | undefined, flag: string) => { - if (!formEl) { return } - await formEl.validate((valid, fields) => { - if (valid) { - ElMessageBox.confirm( - `确认${flag}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - // 提交 - if (title.value === '编辑' && ruleForm.value.fileList.length) { - ruleForm.value.fileList[0].id = undefined - } - (title.value === '新建' ? assetsAddApi : assetsUpdateApi) (ruleForm.value).then((res) => { - if (res.code == 200) { - formEl?.resetFields() - ElMessage.success('操作成功') - close() +const submitForm = async (formEl1: FormInstance | undefined, formEl2: FormInstance | undefined) => { + if (isDevice) { + // 设备借用 + if (!formEl2) { return } + await formEl2.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm( + '确认提交吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then(() => { + if (borrowList.value.length) { + // 新建/编辑 + if (title.value === '新建') { + // 整理数据 + const params = { + ...ruleForm2.value, + equipmentList: borrowList.value, + applyType: '1', + } + addApply(params).then((res) => { + console.log('设备借用申请新建', res) + }) + } + else { + // 编辑 + } + } + else { + ElMessage.warning('请先添加借用设备') } }) - // dialogVisible.value = false - }) - } - }) + } + }) + } + else { + // 状态管理 + } } // 取消 const resetForm = (formEl: FormInstance | undefined) => { @@ -330,14 +369,14 @@ if (res.code === 200) { console.log(res.data[0]) // 重置当前验证 - ruleForm.value.fileList = [] - ruleForm.value.fileList.push({ + ruleForm1.value.fileList = [] + ruleForm1.value.fileList.push({ assetId: '', fileName: res.data[0], minioFileName: res.data[0], // id: '', }) - ruleFormRef.value?.clearValidate('minioFileName') + ruleFormRef1.value?.clearValidate('minioFileName') ElMessage.success('文件上传成功') } else { @@ -349,54 +388,54 @@ const upload = () => { fileRef.value.click() } -// 展示鉴定内容 -const isShowCalibration = ref(false) -// 若固定资产为测量设备,还需填写检定内容 -watch(() => ruleForm.value.assetType, (newVal) => { - if (newVal === '1') { - isShowCalibration.value = true - } -}) const columns = ref([ { text: '设备名称', value: 'equipmentName', align: 'center', + required: true, }, { text: '设备编号', value: 'equipmentNo', align: 'center', + required: true, }, { text: '型号', value: 'modelNo', align: 'center', + required: false, }, { text: '测量范围', value: 'mesureRange', align: 'center', + required: true, }, { text: '使用部门', - value: 'useDeptName', + value: 'useDept', align: 'center', + required: true, }, { text: '使用人', - value: 'usePersonName', + value: 'usePerson', align: 'center', + required: true, }, { text: '管理状态', - value: 'managerLevelName', + value: 'managerStateName', align: 'center', + required: false, }, { text: '有效日期', value: 'validDate', align: 'center', + required: false, }, ]) const addRowRef = ref() @@ -404,6 +443,37 @@ const addRowBtn = () => { addRowRef.value.initDialog({ title: '添加' }) } + +// 检查证书列表 +function checkPersonList() { + for (let index = 0; index < currentShow.value.data.length; index++) { + const item = currentShow.value.data[index] + for (const prop of currentShow.value.column) { + // 检查必填 + if (prop.required && !item[prop.value]) { + ElMessage.warning(`请先完善第${index + 1}行中${prop.text}`) + return false + } + } + } + return true +} +// 将证书列表置为不可编辑状态 +function setAllRowReadable() { + // for (const item of borrowList.value) { + // item.editable = false + // } +} +const SelectionList = ref() +// 表格选中 +const handleSelectionChange = (e) => { + SelectionList.value = e +} +// 双击行显示输入框 +const dblclickRow = (row) => { + // setAllRowReadable() + // row.editable = true +} // 删除行 const removeRowBtn = () => { const removeArr = borrowList.value.filter(item => item.remove !== '') @@ -425,10 +495,27 @@ ElMessage.warning('请先选择需要删除的数据') } } +// 删除行 +// const removeRow = () => { +// currentShow.value.data = currentShow.value.data.filter((item) => { +// return !SelectionList.value.includes(item) +// }) +// } // 借用设备列表添加 const addRowMethods = (row) => { row.forEach((element) => { - borrowList.value.push({ ...element, remove: '' }) + borrowList.value.push({ + equipmentName: element.equipmentName, // 设备名称 + createUser: '', // 当前用户id 1 + equipmentId: element.id, // 设备id 1 + equipmentNo: element.equipmentNo, // 设备编号 + modelNo: element.modelNo, // 型号 + measureRange: '', // 测量范围 1 + useDept: '', // 使用部门 1 + usePerson: '', // 使用人 1 + validDate: element.validDate, // 有效日期 + edit: true, + }) }) } @@ -439,65 +526,65 @@ - - 保存 + + 提交 - + 关闭 - + - + - + - + - + - + - + - + - + @@ -505,7 +592,7 @@ @@ -513,19 +600,59 @@ - + - + - - {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }} + + {{ ruleForm1.fileList[0]?.minioFileName ? '更换' : '上传' }} - 暂无 + 暂无 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -541,7 +668,7 @@ 删除行 - @@ -556,9 +683,29 @@ - + --> + + + + + + *{{ item.text }} + + + {{ scope.row[item.value] }} + + + + + + + + + + + - + diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..28ca2ed --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,27 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 1c14871..146448c 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -197,7 +197,6 @@ :page-size="props.query.limit" :total="props.total" layout="total, sizes, prev, pager, next" - hide-on-single-page @size-change="handleSizeChange" @current-change="handleCurrentChange" /> diff --git a/src/router/modules/device.ts b/src/router/modules/device.ts index 7a93fa9..777ef0c 100644 --- a/src/router/modules/device.ts +++ b/src/router/modules/device.ts @@ -85,11 +85,31 @@ name: 'standingBookDetail', component: () => import('@/views/device/standingBook/components/templateAdd.vue'), meta: { - title: '设备台账', + title: '设备台账公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/measureDevice', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'measureDevice': + to.meta.activeMenu = '/standingBook/measureDevice' + break + case 'standardMatchDevice': + to.meta.activeMenu = '/standingBook/standardMatchDevice' + break + case 'adjustDevice': + to.meta.activeMenu = '/standingBook/adjustDevice' + break + case 'measureTool': + to.meta.activeMenu = '/standingBook/measureTool' + break + } + next() }, }, { @@ -111,7 +131,7 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/fixedAssets', }, }, ], @@ -289,11 +309,39 @@ name: 'stateManageDetail', component: () => import('@/views/device/stateManage/components/templateAdd.vue'), meta: { - title: '状态管理', + title: '状态管理公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/stateManage', + activeMenu: '/stateManage/unusedApply', + }, + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'unusedApply': + to.meta.activeMenu = '/stateManage/unusedApply' + break + case 'sealupApply': + to.meta.activeMenu = '/stateManage/sealupApply' + break + case 'openApply': + to.meta.activeMenu = '/stateManage/openApply' + break + case 'scrapApply': + to.meta.activeMenu = '/stateManage/scrapApply' + break + case 'handleApply': + to.meta.activeMenu = '/stateManage/handleApply' + break + case 'borrowapply': + to.meta.activeMenu = '/borrow/borrowapply' + break + case 'borrowhandle': + to.meta.activeMenu = '/borrow/borrowhandle' + break + } + next() }, }, ], diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 5b0e1f4..973fa04 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -98,7 +98,33 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/file', + activeMenu: '/file/quality', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'quality': + to.meta.activeMenu = '/file/quality' + break + case 'rules': + to.meta.activeMenu = '/file/rules' + break + case 'remind': + to.meta.activeMenu = '/file/quality' + break + case 'manageMethod': + to.meta.activeMenu = '/file/manageMethod' + break + case 'testingMethod': + to.meta.activeMenu = '/file/testingMethod' + break + case 'measureRule': + to.meta.activeMenu = '/file/measureRule' + break + } + next() }, }, { @@ -143,7 +169,7 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/person', + activeMenu: '/person/list', }, }, { @@ -165,7 +191,21 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/person', + activeMenu: '/measure/person/certificateLog', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'certificateLog': + to.meta.activeMenu = '/person/certificateLog' + break + case 'remind': + to.meta.activeMenu = '/person/remind' + break + } + next() }, }, { @@ -309,7 +349,24 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/measureDept', + activeMenu: '/measureDept/bm', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + // 当不同页面中 使用了相同的 编辑/详情路由 + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + switch (type) { + case 'bm': + to.meta.activeMenu = '/measureDept/bm' + break + case 'ks': + to.meta.activeMenu = '/measureDept/ks' + break + case 'gcz': + to.meta.activeMenu = '/measureDept/gcz' + break + } + next() }, }, ], diff --git a/src/views/device/bench/deviceBench.vue b/src/views/device/bench/deviceBench.vue index 9206576..8d74984 100644 --- a/src/views/device/bench/deviceBench.vue +++ b/src/views/device/bench/deviceBench.vue @@ -1,13 +1,397 @@ - 工作台 + + + + + + + + + + + + + + + + + + + + 测量设备 + {{ theMonthTotalData.testValue }} + + + + + + 在用设备 + + {{ theMonthTotalData.testIn }} + + + + + + 闲置设备 + {{ theMonthTotalData.testLeave }} + + + + + 封存设备 + {{ theMonthTotalData.testSeal }} + + + + + + + + 标准装置 + {{ theMonthTotalData.standardValue }} + + + + + + 在用装置 + {{ theMonthTotalData.standardIn }} + + + + + 暂停装置 + {{ theMonthTotalData.standardStop }} + + + + + 撤销装置 + {{ theMonthTotalData.standardAnnul }} + + + + + + + + + + + 本月设备领用 + {{ theMonthTotalData.receive }} + + + + + 本月设备借用 + {{ theMonthTotalData.borrow }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + 待检定设备数量 + {{ myEquipment.stay }} + + + 超期未检定设备数量 + {{ myEquipment.not }} + + + + + + + + diff --git a/src/views/device/borrow/borrow-interface.ts b/src/views/device/borrow/borrow-interface.ts new file mode 100644 index 0000000..0cd02d3 --- /dev/null +++ b/src/views/device/borrow/borrow-interface.ts @@ -0,0 +1,26 @@ +// 设备借用申请查询参数类型 +export interface searchType { + applyName: string // 申请名称 + applyNo: string // 申请编号 + applyPerson: string // 申请人 + applyUnit: string // 申请单位 + approvalStatus?: string // 审批状态 + createUser: string // 创建人 + processResult: string // 处置结果 + time: string // 申请日期 + limit?: number + offset?: number +} +// 借用设备类型 +export interface borrowDeviceType { + createUser?: string // 当前用户id + equipmentId: string // 设备id + equipmentNo: string // 设备编号 + modelNo: string // 型号 + measureRange: string // 测量范围 + useDept: string // 使用部门 + usePerson: string // 使用人 + validDate: string // 有效日期 + edit?: boolean + equipmentName?: string +} diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..6667663 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +55,7 @@ - + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..d420d62 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,25 +1,41 @@ @@ -269,20 +324,20 @@ - + - + - + - + - + @@ -309,18 +364,19 @@ - + + 查看 - + 同意 - + 驳回 - + 拒绝 @@ -331,6 +387,31 @@ + + + + + 查看 + + + 编辑 + + + 提交 + + + 删除 + + + + + + + + 查看 + + + diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 6ae1a30..856c2ff 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -12,13 +12,16 @@ import comTreeSelect from '@/views/system/user/selecTree.vue' import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' +import { addApply, detailApply } from '@/api/device/borrow' +import type { borrowDeviceType } from '@/views/device/borrow/borrow-interface' const $router = useRouter() const $route = useRoute() -const ruleFormRef = ref() // from组件 +const ruleFormRef1 = ref() // from组件 +const ruleFormRef2 = ref() // from组件 const title = ref('') const name = ref('') -const borrowList = ref([]) -const ruleForm = ref({ +const borrowList = ref([]) +const ruleForm1 = ref({ assetNo: '', // 资产编号 assetType: '', // 资产类型 assetSource: '', // 资产来源 @@ -71,7 +74,13 @@ isStandardSupportEquipment: '', // 是否标准配套设备 id: '', }) // 表单 -const rules = ref({ +const ruleForm2 = ref({ + applyUnit: '', // 申请单位 + applyPerson: '', // 申请人 + time: '', // 借用时间 + applyDesc: '', // 申请说明 +}) +const rules1 = ref({ assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }], equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }], manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }], @@ -84,6 +93,11 @@ mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }], validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }], }) // 表单验证规则 +const rules2 = ref({ + applyUnit: [{ required: true, message: '申请单位不能为空', trigger: 'blur' }], + applyPerson: [{ required: true, message: '申请人不能为空', trigger: 'blur' }], + time: [{ required: true, message: '借用时间不能为空', trigger: 'blur' }], +}) const assetTypeList = ref([]) // 资产类型 const ABCList = ref([]) // ABC const mesureTypeList = ref([]) // 检定方式 @@ -203,7 +217,7 @@ } // 重置 const resetDATA = () => { - ruleForm.value = { + ruleForm1.value = { assetNo: '', // 资产编号 assetType: '', // 资产类型 assetSource: '', // 资产来源 @@ -257,61 +271,86 @@ id: '', } } +// 判断是设备借用还是状态管理 +const isDevice = computed(() => { + if (name.value == '设备借用申请' || name.value == '设备借用处理') { + return true + } + else { + return false + } +}) // 弹窗初始化 const initDialog = (row: any) => { fetchData() - ruleFormRef.value?.resetFields() + // ruleFormRef.value?.resetFields() title.value = row.title name.value = row.name - // dialogVisible.value = true - // if (row.title !== '新建') { - // assetsDetailApi({ id: row.id }).then((res) => { - // for (const key in res.data) { - // if (typeof res.data[key] == 'number') { - // res.data[key] = String(res.data[key]) - // } - // } - // ruleForm.value = res.data - // }) - // } + if (isDevice) { + // 设备借用 + if (title.value !== '新建') { + detailApply({ id: row.id }).then((res) => { + ruleForm2.value = res.data + borrowList.value = res.data.equipmentList + }) + } + } + else { + // 状态管理 + } } onMounted(() => { initDialog($route.query) }) + // 关闭弹窗 const close = () => { resetDATA() $router.go(-1) } // 提交 -const submitForm = async (formEl: FormInstance | undefined, flag: string) => { - if (!formEl) { return } - await formEl.validate((valid, fields) => { - if (valid) { - ElMessageBox.confirm( - `确认${flag}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - // 提交 - if (title.value === '编辑' && ruleForm.value.fileList.length) { - ruleForm.value.fileList[0].id = undefined - } - (title.value === '新建' ? assetsAddApi : assetsUpdateApi) (ruleForm.value).then((res) => { - if (res.code == 200) { - formEl?.resetFields() - ElMessage.success('操作成功') - close() +const submitForm = async (formEl1: FormInstance | undefined, formEl2: FormInstance | undefined) => { + if (isDevice) { + // 设备借用 + if (!formEl2) { return } + await formEl2.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm( + '确认提交吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then(() => { + if (borrowList.value.length) { + // 新建/编辑 + if (title.value === '新建') { + // 整理数据 + const params = { + ...ruleForm2.value, + equipmentList: borrowList.value, + applyType: '1', + } + addApply(params).then((res) => { + console.log('设备借用申请新建', res) + }) + } + else { + // 编辑 + } + } + else { + ElMessage.warning('请先添加借用设备') } }) - // dialogVisible.value = false - }) - } - }) + } + }) + } + else { + // 状态管理 + } } // 取消 const resetForm = (formEl: FormInstance | undefined) => { @@ -330,14 +369,14 @@ if (res.code === 200) { console.log(res.data[0]) // 重置当前验证 - ruleForm.value.fileList = [] - ruleForm.value.fileList.push({ + ruleForm1.value.fileList = [] + ruleForm1.value.fileList.push({ assetId: '', fileName: res.data[0], minioFileName: res.data[0], // id: '', }) - ruleFormRef.value?.clearValidate('minioFileName') + ruleFormRef1.value?.clearValidate('minioFileName') ElMessage.success('文件上传成功') } else { @@ -349,54 +388,54 @@ const upload = () => { fileRef.value.click() } -// 展示鉴定内容 -const isShowCalibration = ref(false) -// 若固定资产为测量设备,还需填写检定内容 -watch(() => ruleForm.value.assetType, (newVal) => { - if (newVal === '1') { - isShowCalibration.value = true - } -}) const columns = ref([ { text: '设备名称', value: 'equipmentName', align: 'center', + required: true, }, { text: '设备编号', value: 'equipmentNo', align: 'center', + required: true, }, { text: '型号', value: 'modelNo', align: 'center', + required: false, }, { text: '测量范围', value: 'mesureRange', align: 'center', + required: true, }, { text: '使用部门', - value: 'useDeptName', + value: 'useDept', align: 'center', + required: true, }, { text: '使用人', - value: 'usePersonName', + value: 'usePerson', align: 'center', + required: true, }, { text: '管理状态', - value: 'managerLevelName', + value: 'managerStateName', align: 'center', + required: false, }, { text: '有效日期', value: 'validDate', align: 'center', + required: false, }, ]) const addRowRef = ref() @@ -404,6 +443,37 @@ const addRowBtn = () => { addRowRef.value.initDialog({ title: '添加' }) } + +// 检查证书列表 +function checkPersonList() { + for (let index = 0; index < currentShow.value.data.length; index++) { + const item = currentShow.value.data[index] + for (const prop of currentShow.value.column) { + // 检查必填 + if (prop.required && !item[prop.value]) { + ElMessage.warning(`请先完善第${index + 1}行中${prop.text}`) + return false + } + } + } + return true +} +// 将证书列表置为不可编辑状态 +function setAllRowReadable() { + // for (const item of borrowList.value) { + // item.editable = false + // } +} +const SelectionList = ref() +// 表格选中 +const handleSelectionChange = (e) => { + SelectionList.value = e +} +// 双击行显示输入框 +const dblclickRow = (row) => { + // setAllRowReadable() + // row.editable = true +} // 删除行 const removeRowBtn = () => { const removeArr = borrowList.value.filter(item => item.remove !== '') @@ -425,10 +495,27 @@ ElMessage.warning('请先选择需要删除的数据') } } +// 删除行 +// const removeRow = () => { +// currentShow.value.data = currentShow.value.data.filter((item) => { +// return !SelectionList.value.includes(item) +// }) +// } // 借用设备列表添加 const addRowMethods = (row) => { row.forEach((element) => { - borrowList.value.push({ ...element, remove: '' }) + borrowList.value.push({ + equipmentName: element.equipmentName, // 设备名称 + createUser: '', // 当前用户id 1 + equipmentId: element.id, // 设备id 1 + equipmentNo: element.equipmentNo, // 设备编号 + modelNo: element.modelNo, // 型号 + measureRange: '', // 测量范围 1 + useDept: '', // 使用部门 1 + usePerson: '', // 使用人 1 + validDate: element.validDate, // 有效日期 + edit: true, + }) }) } @@ -439,65 +526,65 @@ - - 保存 + + 提交 - + 关闭 - + - + - + - + - + - + - + - + - + @@ -505,7 +592,7 @@ @@ -513,19 +600,59 @@ - + - + - - {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }} + + {{ ruleForm1.fileList[0]?.minioFileName ? '更换' : '上传' }} - 暂无 + 暂无 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -541,7 +668,7 @@ 删除行 - @@ -556,9 +683,29 @@ - + --> + + + + + + *{{ item.text }} + + + {{ scope.row[item.value] }} + + + + + + + + + + + - + diff --git a/src/views/measure/file/approve.vue b/src/views/measure/file/approve.vue index a9d8827..d7e722c 100644 --- a/src/views/measure/file/approve.vue +++ b/src/views/measure/file/approve.vue @@ -23,8 +23,16 @@ const current = ref('全部') const currentComp = shallowRef(all) watch(current, (newValue) => { + console.log(newValue) currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) +onUnmounted(() => { + sessionStorage.setItem('approveFileMenu', current.value) +}) +onMounted(() => { + current.value = sessionStorage.getItem('approveFileMenu') || '全部' + sessionStorage.getItem('approveFileMenu') ? sessionStorage.removeItem('approveFileMenu') : '' +}) diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..28ca2ed --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,27 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 1c14871..146448c 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -197,7 +197,6 @@ :page-size="props.query.limit" :total="props.total" layout="total, sizes, prev, pager, next" - hide-on-single-page @size-change="handleSizeChange" @current-change="handleCurrentChange" /> diff --git a/src/router/modules/device.ts b/src/router/modules/device.ts index 7a93fa9..777ef0c 100644 --- a/src/router/modules/device.ts +++ b/src/router/modules/device.ts @@ -85,11 +85,31 @@ name: 'standingBookDetail', component: () => import('@/views/device/standingBook/components/templateAdd.vue'), meta: { - title: '设备台账', + title: '设备台账公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/measureDevice', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'measureDevice': + to.meta.activeMenu = '/standingBook/measureDevice' + break + case 'standardMatchDevice': + to.meta.activeMenu = '/standingBook/standardMatchDevice' + break + case 'adjustDevice': + to.meta.activeMenu = '/standingBook/adjustDevice' + break + case 'measureTool': + to.meta.activeMenu = '/standingBook/measureTool' + break + } + next() }, }, { @@ -111,7 +131,7 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/fixedAssets', }, }, ], @@ -289,11 +309,39 @@ name: 'stateManageDetail', component: () => import('@/views/device/stateManage/components/templateAdd.vue'), meta: { - title: '状态管理', + title: '状态管理公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/stateManage', + activeMenu: '/stateManage/unusedApply', + }, + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'unusedApply': + to.meta.activeMenu = '/stateManage/unusedApply' + break + case 'sealupApply': + to.meta.activeMenu = '/stateManage/sealupApply' + break + case 'openApply': + to.meta.activeMenu = '/stateManage/openApply' + break + case 'scrapApply': + to.meta.activeMenu = '/stateManage/scrapApply' + break + case 'handleApply': + to.meta.activeMenu = '/stateManage/handleApply' + break + case 'borrowapply': + to.meta.activeMenu = '/borrow/borrowapply' + break + case 'borrowhandle': + to.meta.activeMenu = '/borrow/borrowhandle' + break + } + next() }, }, ], diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 5b0e1f4..973fa04 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -98,7 +98,33 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/file', + activeMenu: '/file/quality', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'quality': + to.meta.activeMenu = '/file/quality' + break + case 'rules': + to.meta.activeMenu = '/file/rules' + break + case 'remind': + to.meta.activeMenu = '/file/quality' + break + case 'manageMethod': + to.meta.activeMenu = '/file/manageMethod' + break + case 'testingMethod': + to.meta.activeMenu = '/file/testingMethod' + break + case 'measureRule': + to.meta.activeMenu = '/file/measureRule' + break + } + next() }, }, { @@ -143,7 +169,7 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/person', + activeMenu: '/person/list', }, }, { @@ -165,7 +191,21 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/person', + activeMenu: '/measure/person/certificateLog', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'certificateLog': + to.meta.activeMenu = '/person/certificateLog' + break + case 'remind': + to.meta.activeMenu = '/person/remind' + break + } + next() }, }, { @@ -309,7 +349,24 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/measureDept', + activeMenu: '/measureDept/bm', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + // 当不同页面中 使用了相同的 编辑/详情路由 + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + switch (type) { + case 'bm': + to.meta.activeMenu = '/measureDept/bm' + break + case 'ks': + to.meta.activeMenu = '/measureDept/ks' + break + case 'gcz': + to.meta.activeMenu = '/measureDept/gcz' + break + } + next() }, }, ], diff --git a/src/views/device/bench/deviceBench.vue b/src/views/device/bench/deviceBench.vue index 9206576..8d74984 100644 --- a/src/views/device/bench/deviceBench.vue +++ b/src/views/device/bench/deviceBench.vue @@ -1,13 +1,397 @@ - 工作台 + + + + + + + + + + + + + + + + + + + + 测量设备 + {{ theMonthTotalData.testValue }} + + + + + + 在用设备 + + {{ theMonthTotalData.testIn }} + + + + + + 闲置设备 + {{ theMonthTotalData.testLeave }} + + + + + 封存设备 + {{ theMonthTotalData.testSeal }} + + + + + + + + 标准装置 + {{ theMonthTotalData.standardValue }} + + + + + + 在用装置 + {{ theMonthTotalData.standardIn }} + + + + + 暂停装置 + {{ theMonthTotalData.standardStop }} + + + + + 撤销装置 + {{ theMonthTotalData.standardAnnul }} + + + + + + + + + + + 本月设备领用 + {{ theMonthTotalData.receive }} + + + + + 本月设备借用 + {{ theMonthTotalData.borrow }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + 待检定设备数量 + {{ myEquipment.stay }} + + + 超期未检定设备数量 + {{ myEquipment.not }} + + + + + + + + diff --git a/src/views/device/borrow/borrow-interface.ts b/src/views/device/borrow/borrow-interface.ts new file mode 100644 index 0000000..0cd02d3 --- /dev/null +++ b/src/views/device/borrow/borrow-interface.ts @@ -0,0 +1,26 @@ +// 设备借用申请查询参数类型 +export interface searchType { + applyName: string // 申请名称 + applyNo: string // 申请编号 + applyPerson: string // 申请人 + applyUnit: string // 申请单位 + approvalStatus?: string // 审批状态 + createUser: string // 创建人 + processResult: string // 处置结果 + time: string // 申请日期 + limit?: number + offset?: number +} +// 借用设备类型 +export interface borrowDeviceType { + createUser?: string // 当前用户id + equipmentId: string // 设备id + equipmentNo: string // 设备编号 + modelNo: string // 型号 + measureRange: string // 测量范围 + useDept: string // 使用部门 + usePerson: string // 使用人 + validDate: string // 有效日期 + edit?: boolean + equipmentName?: string +} diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..6667663 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +55,7 @@ - + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..d420d62 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,25 +1,41 @@ @@ -269,20 +324,20 @@ - + - + - + - + - + @@ -309,18 +364,19 @@ - + + 查看 - + 同意 - + 驳回 - + 拒绝 @@ -331,6 +387,31 @@ + + + + + 查看 + + + 编辑 + + + 提交 + + + 删除 + + + + + + + + 查看 + + + diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 6ae1a30..856c2ff 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -12,13 +12,16 @@ import comTreeSelect from '@/views/system/user/selecTree.vue' import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' +import { addApply, detailApply } from '@/api/device/borrow' +import type { borrowDeviceType } from '@/views/device/borrow/borrow-interface' const $router = useRouter() const $route = useRoute() -const ruleFormRef = ref() // from组件 +const ruleFormRef1 = ref() // from组件 +const ruleFormRef2 = ref() // from组件 const title = ref('') const name = ref('') -const borrowList = ref([]) -const ruleForm = ref({ +const borrowList = ref([]) +const ruleForm1 = ref({ assetNo: '', // 资产编号 assetType: '', // 资产类型 assetSource: '', // 资产来源 @@ -71,7 +74,13 @@ isStandardSupportEquipment: '', // 是否标准配套设备 id: '', }) // 表单 -const rules = ref({ +const ruleForm2 = ref({ + applyUnit: '', // 申请单位 + applyPerson: '', // 申请人 + time: '', // 借用时间 + applyDesc: '', // 申请说明 +}) +const rules1 = ref({ assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }], equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }], manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }], @@ -84,6 +93,11 @@ mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }], validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }], }) // 表单验证规则 +const rules2 = ref({ + applyUnit: [{ required: true, message: '申请单位不能为空', trigger: 'blur' }], + applyPerson: [{ required: true, message: '申请人不能为空', trigger: 'blur' }], + time: [{ required: true, message: '借用时间不能为空', trigger: 'blur' }], +}) const assetTypeList = ref([]) // 资产类型 const ABCList = ref([]) // ABC const mesureTypeList = ref([]) // 检定方式 @@ -203,7 +217,7 @@ } // 重置 const resetDATA = () => { - ruleForm.value = { + ruleForm1.value = { assetNo: '', // 资产编号 assetType: '', // 资产类型 assetSource: '', // 资产来源 @@ -257,61 +271,86 @@ id: '', } } +// 判断是设备借用还是状态管理 +const isDevice = computed(() => { + if (name.value == '设备借用申请' || name.value == '设备借用处理') { + return true + } + else { + return false + } +}) // 弹窗初始化 const initDialog = (row: any) => { fetchData() - ruleFormRef.value?.resetFields() + // ruleFormRef.value?.resetFields() title.value = row.title name.value = row.name - // dialogVisible.value = true - // if (row.title !== '新建') { - // assetsDetailApi({ id: row.id }).then((res) => { - // for (const key in res.data) { - // if (typeof res.data[key] == 'number') { - // res.data[key] = String(res.data[key]) - // } - // } - // ruleForm.value = res.data - // }) - // } + if (isDevice) { + // 设备借用 + if (title.value !== '新建') { + detailApply({ id: row.id }).then((res) => { + ruleForm2.value = res.data + borrowList.value = res.data.equipmentList + }) + } + } + else { + // 状态管理 + } } onMounted(() => { initDialog($route.query) }) + // 关闭弹窗 const close = () => { resetDATA() $router.go(-1) } // 提交 -const submitForm = async (formEl: FormInstance | undefined, flag: string) => { - if (!formEl) { return } - await formEl.validate((valid, fields) => { - if (valid) { - ElMessageBox.confirm( - `确认${flag}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - // 提交 - if (title.value === '编辑' && ruleForm.value.fileList.length) { - ruleForm.value.fileList[0].id = undefined - } - (title.value === '新建' ? assetsAddApi : assetsUpdateApi) (ruleForm.value).then((res) => { - if (res.code == 200) { - formEl?.resetFields() - ElMessage.success('操作成功') - close() +const submitForm = async (formEl1: FormInstance | undefined, formEl2: FormInstance | undefined) => { + if (isDevice) { + // 设备借用 + if (!formEl2) { return } + await formEl2.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm( + '确认提交吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then(() => { + if (borrowList.value.length) { + // 新建/编辑 + if (title.value === '新建') { + // 整理数据 + const params = { + ...ruleForm2.value, + equipmentList: borrowList.value, + applyType: '1', + } + addApply(params).then((res) => { + console.log('设备借用申请新建', res) + }) + } + else { + // 编辑 + } + } + else { + ElMessage.warning('请先添加借用设备') } }) - // dialogVisible.value = false - }) - } - }) + } + }) + } + else { + // 状态管理 + } } // 取消 const resetForm = (formEl: FormInstance | undefined) => { @@ -330,14 +369,14 @@ if (res.code === 200) { console.log(res.data[0]) // 重置当前验证 - ruleForm.value.fileList = [] - ruleForm.value.fileList.push({ + ruleForm1.value.fileList = [] + ruleForm1.value.fileList.push({ assetId: '', fileName: res.data[0], minioFileName: res.data[0], // id: '', }) - ruleFormRef.value?.clearValidate('minioFileName') + ruleFormRef1.value?.clearValidate('minioFileName') ElMessage.success('文件上传成功') } else { @@ -349,54 +388,54 @@ const upload = () => { fileRef.value.click() } -// 展示鉴定内容 -const isShowCalibration = ref(false) -// 若固定资产为测量设备,还需填写检定内容 -watch(() => ruleForm.value.assetType, (newVal) => { - if (newVal === '1') { - isShowCalibration.value = true - } -}) const columns = ref([ { text: '设备名称', value: 'equipmentName', align: 'center', + required: true, }, { text: '设备编号', value: 'equipmentNo', align: 'center', + required: true, }, { text: '型号', value: 'modelNo', align: 'center', + required: false, }, { text: '测量范围', value: 'mesureRange', align: 'center', + required: true, }, { text: '使用部门', - value: 'useDeptName', + value: 'useDept', align: 'center', + required: true, }, { text: '使用人', - value: 'usePersonName', + value: 'usePerson', align: 'center', + required: true, }, { text: '管理状态', - value: 'managerLevelName', + value: 'managerStateName', align: 'center', + required: false, }, { text: '有效日期', value: 'validDate', align: 'center', + required: false, }, ]) const addRowRef = ref() @@ -404,6 +443,37 @@ const addRowBtn = () => { addRowRef.value.initDialog({ title: '添加' }) } + +// 检查证书列表 +function checkPersonList() { + for (let index = 0; index < currentShow.value.data.length; index++) { + const item = currentShow.value.data[index] + for (const prop of currentShow.value.column) { + // 检查必填 + if (prop.required && !item[prop.value]) { + ElMessage.warning(`请先完善第${index + 1}行中${prop.text}`) + return false + } + } + } + return true +} +// 将证书列表置为不可编辑状态 +function setAllRowReadable() { + // for (const item of borrowList.value) { + // item.editable = false + // } +} +const SelectionList = ref() +// 表格选中 +const handleSelectionChange = (e) => { + SelectionList.value = e +} +// 双击行显示输入框 +const dblclickRow = (row) => { + // setAllRowReadable() + // row.editable = true +} // 删除行 const removeRowBtn = () => { const removeArr = borrowList.value.filter(item => item.remove !== '') @@ -425,10 +495,27 @@ ElMessage.warning('请先选择需要删除的数据') } } +// 删除行 +// const removeRow = () => { +// currentShow.value.data = currentShow.value.data.filter((item) => { +// return !SelectionList.value.includes(item) +// }) +// } // 借用设备列表添加 const addRowMethods = (row) => { row.forEach((element) => { - borrowList.value.push({ ...element, remove: '' }) + borrowList.value.push({ + equipmentName: element.equipmentName, // 设备名称 + createUser: '', // 当前用户id 1 + equipmentId: element.id, // 设备id 1 + equipmentNo: element.equipmentNo, // 设备编号 + modelNo: element.modelNo, // 型号 + measureRange: '', // 测量范围 1 + useDept: '', // 使用部门 1 + usePerson: '', // 使用人 1 + validDate: element.validDate, // 有效日期 + edit: true, + }) }) } @@ -439,65 +526,65 @@ - - 保存 + + 提交 - + 关闭 - + - + - + - + - + - + - + - + - + @@ -505,7 +592,7 @@ @@ -513,19 +600,59 @@ - + - + - - {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }} + + {{ ruleForm1.fileList[0]?.minioFileName ? '更换' : '上传' }} - 暂无 + 暂无 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -541,7 +668,7 @@ 删除行 - @@ -556,9 +683,29 @@ - + --> + + + + + + *{{ item.text }} + + + {{ scope.row[item.value] }} + + + + + + + + + + + - + diff --git a/src/views/measure/file/approve.vue b/src/views/measure/file/approve.vue index a9d8827..d7e722c 100644 --- a/src/views/measure/file/approve.vue +++ b/src/views/measure/file/approve.vue @@ -23,8 +23,16 @@ const current = ref('全部') const currentComp = shallowRef(all) watch(current, (newValue) => { + console.log(newValue) currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) +onUnmounted(() => { + sessionStorage.setItem('approveFileMenu', current.value) +}) +onMounted(() => { + current.value = sessionStorage.getItem('approveFileMenu') || '全部' + sessionStorage.getItem('approveFileMenu') ? sessionStorage.removeItem('approveFileMenu') : '' +}) diff --git a/src/views/measure/file/quality.vue b/src/views/measure/file/quality.vue index 3fa57dc..f8f7528 100644 --- a/src/views/measure/file/quality.vue +++ b/src/views/measure/file/quality.vue @@ -20,8 +20,16 @@ const current = ref('计量法规') const currentComp = shallowRef(statute) watch(current, (newValue) => { + console.log(newValue, 'newValue') currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) +onUnmounted(() => { + sessionStorage.setItem('fileMenu', current.value) +}) +onMounted(() => { + current.value = sessionStorage.getItem('fileMenu') || '计量法规' + sessionStorage.getItem('fileMenu') ? sessionStorage.removeItem('fileMenu') : '' +}) diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..28ca2ed --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,27 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 1c14871..146448c 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -197,7 +197,6 @@ :page-size="props.query.limit" :total="props.total" layout="total, sizes, prev, pager, next" - hide-on-single-page @size-change="handleSizeChange" @current-change="handleCurrentChange" /> diff --git a/src/router/modules/device.ts b/src/router/modules/device.ts index 7a93fa9..777ef0c 100644 --- a/src/router/modules/device.ts +++ b/src/router/modules/device.ts @@ -85,11 +85,31 @@ name: 'standingBookDetail', component: () => import('@/views/device/standingBook/components/templateAdd.vue'), meta: { - title: '设备台账', + title: '设备台账公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/measureDevice', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'measureDevice': + to.meta.activeMenu = '/standingBook/measureDevice' + break + case 'standardMatchDevice': + to.meta.activeMenu = '/standingBook/standardMatchDevice' + break + case 'adjustDevice': + to.meta.activeMenu = '/standingBook/adjustDevice' + break + case 'measureTool': + to.meta.activeMenu = '/standingBook/measureTool' + break + } + next() }, }, { @@ -111,7 +131,7 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/fixedAssets', }, }, ], @@ -289,11 +309,39 @@ name: 'stateManageDetail', component: () => import('@/views/device/stateManage/components/templateAdd.vue'), meta: { - title: '状态管理', + title: '状态管理公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/stateManage', + activeMenu: '/stateManage/unusedApply', + }, + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'unusedApply': + to.meta.activeMenu = '/stateManage/unusedApply' + break + case 'sealupApply': + to.meta.activeMenu = '/stateManage/sealupApply' + break + case 'openApply': + to.meta.activeMenu = '/stateManage/openApply' + break + case 'scrapApply': + to.meta.activeMenu = '/stateManage/scrapApply' + break + case 'handleApply': + to.meta.activeMenu = '/stateManage/handleApply' + break + case 'borrowapply': + to.meta.activeMenu = '/borrow/borrowapply' + break + case 'borrowhandle': + to.meta.activeMenu = '/borrow/borrowhandle' + break + } + next() }, }, ], diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 5b0e1f4..973fa04 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -98,7 +98,33 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/file', + activeMenu: '/file/quality', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'quality': + to.meta.activeMenu = '/file/quality' + break + case 'rules': + to.meta.activeMenu = '/file/rules' + break + case 'remind': + to.meta.activeMenu = '/file/quality' + break + case 'manageMethod': + to.meta.activeMenu = '/file/manageMethod' + break + case 'testingMethod': + to.meta.activeMenu = '/file/testingMethod' + break + case 'measureRule': + to.meta.activeMenu = '/file/measureRule' + break + } + next() }, }, { @@ -143,7 +169,7 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/person', + activeMenu: '/person/list', }, }, { @@ -165,7 +191,21 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/person', + activeMenu: '/measure/person/certificateLog', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'certificateLog': + to.meta.activeMenu = '/person/certificateLog' + break + case 'remind': + to.meta.activeMenu = '/person/remind' + break + } + next() }, }, { @@ -309,7 +349,24 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/measureDept', + activeMenu: '/measureDept/bm', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + // 当不同页面中 使用了相同的 编辑/详情路由 + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + switch (type) { + case 'bm': + to.meta.activeMenu = '/measureDept/bm' + break + case 'ks': + to.meta.activeMenu = '/measureDept/ks' + break + case 'gcz': + to.meta.activeMenu = '/measureDept/gcz' + break + } + next() }, }, ], diff --git a/src/views/device/bench/deviceBench.vue b/src/views/device/bench/deviceBench.vue index 9206576..8d74984 100644 --- a/src/views/device/bench/deviceBench.vue +++ b/src/views/device/bench/deviceBench.vue @@ -1,13 +1,397 @@ - 工作台 + + + + + + + + + + + + + + + + + + + + 测量设备 + {{ theMonthTotalData.testValue }} + + + + + + 在用设备 + + {{ theMonthTotalData.testIn }} + + + + + + 闲置设备 + {{ theMonthTotalData.testLeave }} + + + + + 封存设备 + {{ theMonthTotalData.testSeal }} + + + + + + + + 标准装置 + {{ theMonthTotalData.standardValue }} + + + + + + 在用装置 + {{ theMonthTotalData.standardIn }} + + + + + 暂停装置 + {{ theMonthTotalData.standardStop }} + + + + + 撤销装置 + {{ theMonthTotalData.standardAnnul }} + + + + + + + + + + + 本月设备领用 + {{ theMonthTotalData.receive }} + + + + + 本月设备借用 + {{ theMonthTotalData.borrow }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + 待检定设备数量 + {{ myEquipment.stay }} + + + 超期未检定设备数量 + {{ myEquipment.not }} + + + + + + + + diff --git a/src/views/device/borrow/borrow-interface.ts b/src/views/device/borrow/borrow-interface.ts new file mode 100644 index 0000000..0cd02d3 --- /dev/null +++ b/src/views/device/borrow/borrow-interface.ts @@ -0,0 +1,26 @@ +// 设备借用申请查询参数类型 +export interface searchType { + applyName: string // 申请名称 + applyNo: string // 申请编号 + applyPerson: string // 申请人 + applyUnit: string // 申请单位 + approvalStatus?: string // 审批状态 + createUser: string // 创建人 + processResult: string // 处置结果 + time: string // 申请日期 + limit?: number + offset?: number +} +// 借用设备类型 +export interface borrowDeviceType { + createUser?: string // 当前用户id + equipmentId: string // 设备id + equipmentNo: string // 设备编号 + modelNo: string // 型号 + measureRange: string // 测量范围 + useDept: string // 使用部门 + usePerson: string // 使用人 + validDate: string // 有效日期 + edit?: boolean + equipmentName?: string +} diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..6667663 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +55,7 @@ - + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..d420d62 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,25 +1,41 @@ @@ -269,20 +324,20 @@ - + - + - + - + - + @@ -309,18 +364,19 @@ - + + 查看 - + 同意 - + 驳回 - + 拒绝 @@ -331,6 +387,31 @@ + + + + + 查看 + + + 编辑 + + + 提交 + + + 删除 + + + + + + + + 查看 + + + diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 6ae1a30..856c2ff 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -12,13 +12,16 @@ import comTreeSelect from '@/views/system/user/selecTree.vue' import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' +import { addApply, detailApply } from '@/api/device/borrow' +import type { borrowDeviceType } from '@/views/device/borrow/borrow-interface' const $router = useRouter() const $route = useRoute() -const ruleFormRef = ref() // from组件 +const ruleFormRef1 = ref() // from组件 +const ruleFormRef2 = ref() // from组件 const title = ref('') const name = ref('') -const borrowList = ref([]) -const ruleForm = ref({ +const borrowList = ref([]) +const ruleForm1 = ref({ assetNo: '', // 资产编号 assetType: '', // 资产类型 assetSource: '', // 资产来源 @@ -71,7 +74,13 @@ isStandardSupportEquipment: '', // 是否标准配套设备 id: '', }) // 表单 -const rules = ref({ +const ruleForm2 = ref({ + applyUnit: '', // 申请单位 + applyPerson: '', // 申请人 + time: '', // 借用时间 + applyDesc: '', // 申请说明 +}) +const rules1 = ref({ assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }], equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }], manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }], @@ -84,6 +93,11 @@ mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }], validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }], }) // 表单验证规则 +const rules2 = ref({ + applyUnit: [{ required: true, message: '申请单位不能为空', trigger: 'blur' }], + applyPerson: [{ required: true, message: '申请人不能为空', trigger: 'blur' }], + time: [{ required: true, message: '借用时间不能为空', trigger: 'blur' }], +}) const assetTypeList = ref([]) // 资产类型 const ABCList = ref([]) // ABC const mesureTypeList = ref([]) // 检定方式 @@ -203,7 +217,7 @@ } // 重置 const resetDATA = () => { - ruleForm.value = { + ruleForm1.value = { assetNo: '', // 资产编号 assetType: '', // 资产类型 assetSource: '', // 资产来源 @@ -257,61 +271,86 @@ id: '', } } +// 判断是设备借用还是状态管理 +const isDevice = computed(() => { + if (name.value == '设备借用申请' || name.value == '设备借用处理') { + return true + } + else { + return false + } +}) // 弹窗初始化 const initDialog = (row: any) => { fetchData() - ruleFormRef.value?.resetFields() + // ruleFormRef.value?.resetFields() title.value = row.title name.value = row.name - // dialogVisible.value = true - // if (row.title !== '新建') { - // assetsDetailApi({ id: row.id }).then((res) => { - // for (const key in res.data) { - // if (typeof res.data[key] == 'number') { - // res.data[key] = String(res.data[key]) - // } - // } - // ruleForm.value = res.data - // }) - // } + if (isDevice) { + // 设备借用 + if (title.value !== '新建') { + detailApply({ id: row.id }).then((res) => { + ruleForm2.value = res.data + borrowList.value = res.data.equipmentList + }) + } + } + else { + // 状态管理 + } } onMounted(() => { initDialog($route.query) }) + // 关闭弹窗 const close = () => { resetDATA() $router.go(-1) } // 提交 -const submitForm = async (formEl: FormInstance | undefined, flag: string) => { - if (!formEl) { return } - await formEl.validate((valid, fields) => { - if (valid) { - ElMessageBox.confirm( - `确认${flag}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - // 提交 - if (title.value === '编辑' && ruleForm.value.fileList.length) { - ruleForm.value.fileList[0].id = undefined - } - (title.value === '新建' ? assetsAddApi : assetsUpdateApi) (ruleForm.value).then((res) => { - if (res.code == 200) { - formEl?.resetFields() - ElMessage.success('操作成功') - close() +const submitForm = async (formEl1: FormInstance | undefined, formEl2: FormInstance | undefined) => { + if (isDevice) { + // 设备借用 + if (!formEl2) { return } + await formEl2.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm( + '确认提交吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then(() => { + if (borrowList.value.length) { + // 新建/编辑 + if (title.value === '新建') { + // 整理数据 + const params = { + ...ruleForm2.value, + equipmentList: borrowList.value, + applyType: '1', + } + addApply(params).then((res) => { + console.log('设备借用申请新建', res) + }) + } + else { + // 编辑 + } + } + else { + ElMessage.warning('请先添加借用设备') } }) - // dialogVisible.value = false - }) - } - }) + } + }) + } + else { + // 状态管理 + } } // 取消 const resetForm = (formEl: FormInstance | undefined) => { @@ -330,14 +369,14 @@ if (res.code === 200) { console.log(res.data[0]) // 重置当前验证 - ruleForm.value.fileList = [] - ruleForm.value.fileList.push({ + ruleForm1.value.fileList = [] + ruleForm1.value.fileList.push({ assetId: '', fileName: res.data[0], minioFileName: res.data[0], // id: '', }) - ruleFormRef.value?.clearValidate('minioFileName') + ruleFormRef1.value?.clearValidate('minioFileName') ElMessage.success('文件上传成功') } else { @@ -349,54 +388,54 @@ const upload = () => { fileRef.value.click() } -// 展示鉴定内容 -const isShowCalibration = ref(false) -// 若固定资产为测量设备,还需填写检定内容 -watch(() => ruleForm.value.assetType, (newVal) => { - if (newVal === '1') { - isShowCalibration.value = true - } -}) const columns = ref([ { text: '设备名称', value: 'equipmentName', align: 'center', + required: true, }, { text: '设备编号', value: 'equipmentNo', align: 'center', + required: true, }, { text: '型号', value: 'modelNo', align: 'center', + required: false, }, { text: '测量范围', value: 'mesureRange', align: 'center', + required: true, }, { text: '使用部门', - value: 'useDeptName', + value: 'useDept', align: 'center', + required: true, }, { text: '使用人', - value: 'usePersonName', + value: 'usePerson', align: 'center', + required: true, }, { text: '管理状态', - value: 'managerLevelName', + value: 'managerStateName', align: 'center', + required: false, }, { text: '有效日期', value: 'validDate', align: 'center', + required: false, }, ]) const addRowRef = ref() @@ -404,6 +443,37 @@ const addRowBtn = () => { addRowRef.value.initDialog({ title: '添加' }) } + +// 检查证书列表 +function checkPersonList() { + for (let index = 0; index < currentShow.value.data.length; index++) { + const item = currentShow.value.data[index] + for (const prop of currentShow.value.column) { + // 检查必填 + if (prop.required && !item[prop.value]) { + ElMessage.warning(`请先完善第${index + 1}行中${prop.text}`) + return false + } + } + } + return true +} +// 将证书列表置为不可编辑状态 +function setAllRowReadable() { + // for (const item of borrowList.value) { + // item.editable = false + // } +} +const SelectionList = ref() +// 表格选中 +const handleSelectionChange = (e) => { + SelectionList.value = e +} +// 双击行显示输入框 +const dblclickRow = (row) => { + // setAllRowReadable() + // row.editable = true +} // 删除行 const removeRowBtn = () => { const removeArr = borrowList.value.filter(item => item.remove !== '') @@ -425,10 +495,27 @@ ElMessage.warning('请先选择需要删除的数据') } } +// 删除行 +// const removeRow = () => { +// currentShow.value.data = currentShow.value.data.filter((item) => { +// return !SelectionList.value.includes(item) +// }) +// } // 借用设备列表添加 const addRowMethods = (row) => { row.forEach((element) => { - borrowList.value.push({ ...element, remove: '' }) + borrowList.value.push({ + equipmentName: element.equipmentName, // 设备名称 + createUser: '', // 当前用户id 1 + equipmentId: element.id, // 设备id 1 + equipmentNo: element.equipmentNo, // 设备编号 + modelNo: element.modelNo, // 型号 + measureRange: '', // 测量范围 1 + useDept: '', // 使用部门 1 + usePerson: '', // 使用人 1 + validDate: element.validDate, // 有效日期 + edit: true, + }) }) } @@ -439,65 +526,65 @@ - - 保存 + + 提交 - + 关闭 - + - + - + - + - + - + - + - + - + @@ -505,7 +592,7 @@ @@ -513,19 +600,59 @@ - + - + - - {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }} + + {{ ruleForm1.fileList[0]?.minioFileName ? '更换' : '上传' }} - 暂无 + 暂无 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -541,7 +668,7 @@ 删除行 - @@ -556,9 +683,29 @@ - + --> + + + + + + *{{ item.text }} + + + {{ scope.row[item.value] }} + + + + + + + + + + + - + diff --git a/src/views/measure/file/approve.vue b/src/views/measure/file/approve.vue index a9d8827..d7e722c 100644 --- a/src/views/measure/file/approve.vue +++ b/src/views/measure/file/approve.vue @@ -23,8 +23,16 @@ const current = ref('全部') const currentComp = shallowRef(all) watch(current, (newValue) => { + console.log(newValue) currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) +onUnmounted(() => { + sessionStorage.setItem('approveFileMenu', current.value) +}) +onMounted(() => { + current.value = sessionStorage.getItem('approveFileMenu') || '全部' + sessionStorage.getItem('approveFileMenu') ? sessionStorage.removeItem('approveFileMenu') : '' +}) diff --git a/src/views/measure/file/quality.vue b/src/views/measure/file/quality.vue index 3fa57dc..f8f7528 100644 --- a/src/views/measure/file/quality.vue +++ b/src/views/measure/file/quality.vue @@ -20,8 +20,16 @@ const current = ref('计量法规') const currentComp = shallowRef(statute) watch(current, (newValue) => { + console.log(newValue, 'newValue') currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) +onUnmounted(() => { + sessionStorage.setItem('fileMenu', current.value) +}) +onMounted(() => { + current.value = sessionStorage.getItem('fileMenu') || '计量法规' + sessionStorage.getItem('fileMenu') ? sessionStorage.removeItem('fileMenu') : '' +}) diff --git a/src/views/measure/person/certificateLog.vue b/src/views/measure/person/certificateLog.vue index 11eeb7b..16a8c9d 100644 --- a/src/views/measure/person/certificateLog.vue +++ b/src/views/measure/person/certificateLog.vue @@ -29,7 +29,8 @@ // major: '', // 计量专业 verifierCertificateNo: '', // 证书号 certificateStatus: '', // 证书状态 - limit: 10, + remindType: '', + limit: 20, offset: 1, }) // 查询参数 const loadingTable = ref(false) // 表格loading @@ -92,6 +93,9 @@ // 获取数据列表 const getList = () => { loadingTable.value = true + if (props.isRemind) { + searchQuery.remindType = 'remind' + } getCertificateList(searchQuery).then((res) => { if (res.code === 200) { res.data.records = res.data.records.map(item => ({ ...item, sex: item.sex == '1' ? '男' : '女', certificateStatus: item.certificateStatus == '0' ? '正常' : '已失效', validDate: item.validDate.split(' ')[0], certificateDate: item.certificateDate.split(' ')[0] })) diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..28ca2ed --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,27 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 1c14871..146448c 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -197,7 +197,6 @@ :page-size="props.query.limit" :total="props.total" layout="total, sizes, prev, pager, next" - hide-on-single-page @size-change="handleSizeChange" @current-change="handleCurrentChange" /> diff --git a/src/router/modules/device.ts b/src/router/modules/device.ts index 7a93fa9..777ef0c 100644 --- a/src/router/modules/device.ts +++ b/src/router/modules/device.ts @@ -85,11 +85,31 @@ name: 'standingBookDetail', component: () => import('@/views/device/standingBook/components/templateAdd.vue'), meta: { - title: '设备台账', + title: '设备台账公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/measureDevice', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'measureDevice': + to.meta.activeMenu = '/standingBook/measureDevice' + break + case 'standardMatchDevice': + to.meta.activeMenu = '/standingBook/standardMatchDevice' + break + case 'adjustDevice': + to.meta.activeMenu = '/standingBook/adjustDevice' + break + case 'measureTool': + to.meta.activeMenu = '/standingBook/measureTool' + break + } + next() }, }, { @@ -111,7 +131,7 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/standingBook', + activeMenu: '/standingBook/fixedAssets', }, }, ], @@ -289,11 +309,39 @@ name: 'stateManageDetail', component: () => import('@/views/device/stateManage/components/templateAdd.vue'), meta: { - title: '状态管理', + title: '状态管理公用详情/编辑/新建', icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/device/stateManage', + activeMenu: '/stateManage/unusedApply', + }, + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'unusedApply': + to.meta.activeMenu = '/stateManage/unusedApply' + break + case 'sealupApply': + to.meta.activeMenu = '/stateManage/sealupApply' + break + case 'openApply': + to.meta.activeMenu = '/stateManage/openApply' + break + case 'scrapApply': + to.meta.activeMenu = '/stateManage/scrapApply' + break + case 'handleApply': + to.meta.activeMenu = '/stateManage/handleApply' + break + case 'borrowapply': + to.meta.activeMenu = '/borrow/borrowapply' + break + case 'borrowhandle': + to.meta.activeMenu = '/borrow/borrowhandle' + break + } + next() }, }, ], diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 5b0e1f4..973fa04 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -98,7 +98,33 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/file', + activeMenu: '/file/quality', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'quality': + to.meta.activeMenu = '/file/quality' + break + case 'rules': + to.meta.activeMenu = '/file/rules' + break + case 'remind': + to.meta.activeMenu = '/file/quality' + break + case 'manageMethod': + to.meta.activeMenu = '/file/manageMethod' + break + case 'testingMethod': + to.meta.activeMenu = '/file/testingMethod' + break + case 'measureRule': + to.meta.activeMenu = '/file/measureRule' + break + } + next() }, }, { @@ -143,7 +169,7 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/person', + activeMenu: '/person/list', }, }, { @@ -165,7 +191,21 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/person', + activeMenu: '/measure/person/certificateLog', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + console.log(type) + switch (type) { + case 'certificateLog': + to.meta.activeMenu = '/person/certificateLog' + break + case 'remind': + to.meta.activeMenu = '/person/remind' + break + } + next() }, }, { @@ -309,7 +349,24 @@ icon: 'ep:key', sidebar: false, breadcrumb: true, - activeMenu: '/measure/measureDept', + activeMenu: '/measureDept/bm', + }, + // 独享守卫,根据form的路由动态修改meta中的activeMenu + // 当不同页面中 使用了相同的 编辑/详情路由 + beforeEnter: (to, from, next) => { + const type = from.path.split('/')[from.path.split('/').length - 1] + switch (type) { + case 'bm': + to.meta.activeMenu = '/measureDept/bm' + break + case 'ks': + to.meta.activeMenu = '/measureDept/ks' + break + case 'gcz': + to.meta.activeMenu = '/measureDept/gcz' + break + } + next() }, }, ], diff --git a/src/views/device/bench/deviceBench.vue b/src/views/device/bench/deviceBench.vue index 9206576..8d74984 100644 --- a/src/views/device/bench/deviceBench.vue +++ b/src/views/device/bench/deviceBench.vue @@ -1,13 +1,397 @@ - 工作台 + + + + + + + + + + + + + + + + + + + + 测量设备 + {{ theMonthTotalData.testValue }} + + + + + + 在用设备 + + {{ theMonthTotalData.testIn }} + + + + + + 闲置设备 + {{ theMonthTotalData.testLeave }} + + + + + 封存设备 + {{ theMonthTotalData.testSeal }} + + + + + + + + 标准装置 + {{ theMonthTotalData.standardValue }} + + + + + + 在用装置 + {{ theMonthTotalData.standardIn }} + + + + + 暂停装置 + {{ theMonthTotalData.standardStop }} + + + + + 撤销装置 + {{ theMonthTotalData.standardAnnul }} + + + + + + + + + + + 本月设备领用 + {{ theMonthTotalData.receive }} + + + + + 本月设备借用 + {{ theMonthTotalData.borrow }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + 待检定设备数量 + {{ myEquipment.stay }} + + + 超期未检定设备数量 + {{ myEquipment.not }} + + + + + + + + diff --git a/src/views/device/borrow/borrow-interface.ts b/src/views/device/borrow/borrow-interface.ts new file mode 100644 index 0000000..0cd02d3 --- /dev/null +++ b/src/views/device/borrow/borrow-interface.ts @@ -0,0 +1,26 @@ +// 设备借用申请查询参数类型 +export interface searchType { + applyName: string // 申请名称 + applyNo: string // 申请编号 + applyPerson: string // 申请人 + applyUnit: string // 申请单位 + approvalStatus?: string // 审批状态 + createUser: string // 创建人 + processResult: string // 处置结果 + time: string // 申请日期 + limit?: number + offset?: number +} +// 借用设备类型 +export interface borrowDeviceType { + createUser?: string // 当前用户id + equipmentId: string // 设备id + equipmentNo: string // 设备编号 + modelNo: string // 型号 + measureRange: string // 测量范围 + useDept: string // 使用部门 + usePerson: string // 使用人 + validDate: string // 有效日期 + edit?: boolean + equipmentName?: string +} diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..6667663 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +55,7 @@ - + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..d420d62 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,25 +1,41 @@ @@ -269,20 +324,20 @@ - + - + - + - + - + @@ -309,18 +364,19 @@ - + + 查看 - + 同意 - + 驳回 - + 拒绝 @@ -331,6 +387,31 @@ + + + + + 查看 + + + 编辑 + + + 提交 + + + 删除 + + + + + + + + 查看 + + + diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 6ae1a30..856c2ff 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -12,13 +12,16 @@ import comTreeSelect from '@/views/system/user/selecTree.vue' import { toTreeList } from '@/utils/structure' import type { userType } from '@/views/system/user/user-interface' +import { addApply, detailApply } from '@/api/device/borrow' +import type { borrowDeviceType } from '@/views/device/borrow/borrow-interface' const $router = useRouter() const $route = useRoute() -const ruleFormRef = ref() // from组件 +const ruleFormRef1 = ref() // from组件 +const ruleFormRef2 = ref() // from组件 const title = ref('') const name = ref('') -const borrowList = ref([]) -const ruleForm = ref({ +const borrowList = ref([]) +const ruleForm1 = ref({ assetNo: '', // 资产编号 assetType: '', // 资产类型 assetSource: '', // 资产来源 @@ -71,7 +74,13 @@ isStandardSupportEquipment: '', // 是否标准配套设备 id: '', }) // 表单 -const rules = ref({ +const ruleForm2 = ref({ + applyUnit: '', // 申请单位 + applyPerson: '', // 申请人 + time: '', // 借用时间 + applyDesc: '', // 申请说明 +}) +const rules1 = ref({ assetType: [{ required: true, message: '资产类型不能为空', trigger: 'blur' }], equipmentName: [{ required: true, message: '设备不能为空', trigger: 'blur' }], manufacturer: [{ required: true, message: '生产厂家不能为空', trigger: 'blur' }], @@ -84,6 +93,11 @@ mesureDate: [{ required: true, message: '检定日期不能为空', trigger: 'blur' }], validDate: [{ required: true, message: '有效日期不能为空', trigger: 'blur' }], }) // 表单验证规则 +const rules2 = ref({ + applyUnit: [{ required: true, message: '申请单位不能为空', trigger: 'blur' }], + applyPerson: [{ required: true, message: '申请人不能为空', trigger: 'blur' }], + time: [{ required: true, message: '借用时间不能为空', trigger: 'blur' }], +}) const assetTypeList = ref([]) // 资产类型 const ABCList = ref([]) // ABC const mesureTypeList = ref([]) // 检定方式 @@ -203,7 +217,7 @@ } // 重置 const resetDATA = () => { - ruleForm.value = { + ruleForm1.value = { assetNo: '', // 资产编号 assetType: '', // 资产类型 assetSource: '', // 资产来源 @@ -257,61 +271,86 @@ id: '', } } +// 判断是设备借用还是状态管理 +const isDevice = computed(() => { + if (name.value == '设备借用申请' || name.value == '设备借用处理') { + return true + } + else { + return false + } +}) // 弹窗初始化 const initDialog = (row: any) => { fetchData() - ruleFormRef.value?.resetFields() + // ruleFormRef.value?.resetFields() title.value = row.title name.value = row.name - // dialogVisible.value = true - // if (row.title !== '新建') { - // assetsDetailApi({ id: row.id }).then((res) => { - // for (const key in res.data) { - // if (typeof res.data[key] == 'number') { - // res.data[key] = String(res.data[key]) - // } - // } - // ruleForm.value = res.data - // }) - // } + if (isDevice) { + // 设备借用 + if (title.value !== '新建') { + detailApply({ id: row.id }).then((res) => { + ruleForm2.value = res.data + borrowList.value = res.data.equipmentList + }) + } + } + else { + // 状态管理 + } } onMounted(() => { initDialog($route.query) }) + // 关闭弹窗 const close = () => { resetDATA() $router.go(-1) } // 提交 -const submitForm = async (formEl: FormInstance | undefined, flag: string) => { - if (!formEl) { return } - await formEl.validate((valid, fields) => { - if (valid) { - ElMessageBox.confirm( - `确认${flag}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - // 提交 - if (title.value === '编辑' && ruleForm.value.fileList.length) { - ruleForm.value.fileList[0].id = undefined - } - (title.value === '新建' ? assetsAddApi : assetsUpdateApi) (ruleForm.value).then((res) => { - if (res.code == 200) { - formEl?.resetFields() - ElMessage.success('操作成功') - close() +const submitForm = async (formEl1: FormInstance | undefined, formEl2: FormInstance | undefined) => { + if (isDevice) { + // 设备借用 + if (!formEl2) { return } + await formEl2.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm( + '确认提交吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then(() => { + if (borrowList.value.length) { + // 新建/编辑 + if (title.value === '新建') { + // 整理数据 + const params = { + ...ruleForm2.value, + equipmentList: borrowList.value, + applyType: '1', + } + addApply(params).then((res) => { + console.log('设备借用申请新建', res) + }) + } + else { + // 编辑 + } + } + else { + ElMessage.warning('请先添加借用设备') } }) - // dialogVisible.value = false - }) - } - }) + } + }) + } + else { + // 状态管理 + } } // 取消 const resetForm = (formEl: FormInstance | undefined) => { @@ -330,14 +369,14 @@ if (res.code === 200) { console.log(res.data[0]) // 重置当前验证 - ruleForm.value.fileList = [] - ruleForm.value.fileList.push({ + ruleForm1.value.fileList = [] + ruleForm1.value.fileList.push({ assetId: '', fileName: res.data[0], minioFileName: res.data[0], // id: '', }) - ruleFormRef.value?.clearValidate('minioFileName') + ruleFormRef1.value?.clearValidate('minioFileName') ElMessage.success('文件上传成功') } else { @@ -349,54 +388,54 @@ const upload = () => { fileRef.value.click() } -// 展示鉴定内容 -const isShowCalibration = ref(false) -// 若固定资产为测量设备,还需填写检定内容 -watch(() => ruleForm.value.assetType, (newVal) => { - if (newVal === '1') { - isShowCalibration.value = true - } -}) const columns = ref([ { text: '设备名称', value: 'equipmentName', align: 'center', + required: true, }, { text: '设备编号', value: 'equipmentNo', align: 'center', + required: true, }, { text: '型号', value: 'modelNo', align: 'center', + required: false, }, { text: '测量范围', value: 'mesureRange', align: 'center', + required: true, }, { text: '使用部门', - value: 'useDeptName', + value: 'useDept', align: 'center', + required: true, }, { text: '使用人', - value: 'usePersonName', + value: 'usePerson', align: 'center', + required: true, }, { text: '管理状态', - value: 'managerLevelName', + value: 'managerStateName', align: 'center', + required: false, }, { text: '有效日期', value: 'validDate', align: 'center', + required: false, }, ]) const addRowRef = ref() @@ -404,6 +443,37 @@ const addRowBtn = () => { addRowRef.value.initDialog({ title: '添加' }) } + +// 检查证书列表 +function checkPersonList() { + for (let index = 0; index < currentShow.value.data.length; index++) { + const item = currentShow.value.data[index] + for (const prop of currentShow.value.column) { + // 检查必填 + if (prop.required && !item[prop.value]) { + ElMessage.warning(`请先完善第${index + 1}行中${prop.text}`) + return false + } + } + } + return true +} +// 将证书列表置为不可编辑状态 +function setAllRowReadable() { + // for (const item of borrowList.value) { + // item.editable = false + // } +} +const SelectionList = ref() +// 表格选中 +const handleSelectionChange = (e) => { + SelectionList.value = e +} +// 双击行显示输入框 +const dblclickRow = (row) => { + // setAllRowReadable() + // row.editable = true +} // 删除行 const removeRowBtn = () => { const removeArr = borrowList.value.filter(item => item.remove !== '') @@ -425,10 +495,27 @@ ElMessage.warning('请先选择需要删除的数据') } } +// 删除行 +// const removeRow = () => { +// currentShow.value.data = currentShow.value.data.filter((item) => { +// return !SelectionList.value.includes(item) +// }) +// } // 借用设备列表添加 const addRowMethods = (row) => { row.forEach((element) => { - borrowList.value.push({ ...element, remove: '' }) + borrowList.value.push({ + equipmentName: element.equipmentName, // 设备名称 + createUser: '', // 当前用户id 1 + equipmentId: element.id, // 设备id 1 + equipmentNo: element.equipmentNo, // 设备编号 + modelNo: element.modelNo, // 型号 + measureRange: '', // 测量范围 1 + useDept: '', // 使用部门 1 + usePerson: '', // 使用人 1 + validDate: element.validDate, // 有效日期 + edit: true, + }) }) } @@ -439,65 +526,65 @@ - - 保存 + + 提交 - + 关闭 - + - + - + - + - + - + - + - + - + @@ -505,7 +592,7 @@ @@ -513,19 +600,59 @@ - + - + - - {{ ruleForm.fileList[0]?.minioFileName ? '更换' : '上传' }} + + {{ ruleForm1.fileList[0]?.minioFileName ? '更换' : '上传' }} - 暂无 + 暂无 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -541,7 +668,7 @@ 删除行 - @@ -556,9 +683,29 @@ - + --> + + + + + + *{{ item.text }} + + + {{ scope.row[item.value] }} + + + + + + + + + + + - + diff --git a/src/views/measure/file/approve.vue b/src/views/measure/file/approve.vue index a9d8827..d7e722c 100644 --- a/src/views/measure/file/approve.vue +++ b/src/views/measure/file/approve.vue @@ -23,8 +23,16 @@ const current = ref('全部') const currentComp = shallowRef(all) watch(current, (newValue) => { + console.log(newValue) currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) +onUnmounted(() => { + sessionStorage.setItem('approveFileMenu', current.value) +}) +onMounted(() => { + current.value = sessionStorage.getItem('approveFileMenu') || '全部' + sessionStorage.getItem('approveFileMenu') ? sessionStorage.removeItem('approveFileMenu') : '' +}) diff --git a/src/views/measure/file/quality.vue b/src/views/measure/file/quality.vue index 3fa57dc..f8f7528 100644 --- a/src/views/measure/file/quality.vue +++ b/src/views/measure/file/quality.vue @@ -20,8 +20,16 @@ const current = ref('计量法规') const currentComp = shallowRef(statute) watch(current, (newValue) => { + console.log(newValue, 'newValue') currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) +onUnmounted(() => { + sessionStorage.setItem('fileMenu', current.value) +}) +onMounted(() => { + current.value = sessionStorage.getItem('fileMenu') || '计量法规' + sessionStorage.getItem('fileMenu') ? sessionStorage.removeItem('fileMenu') : '' +}) diff --git a/src/views/measure/person/certificateLog.vue b/src/views/measure/person/certificateLog.vue index 11eeb7b..16a8c9d 100644 --- a/src/views/measure/person/certificateLog.vue +++ b/src/views/measure/person/certificateLog.vue @@ -29,7 +29,8 @@ // major: '', // 计量专业 verifierCertificateNo: '', // 证书号 certificateStatus: '', // 证书状态 - limit: 10, + remindType: '', + limit: 20, offset: 1, }) // 查询参数 const loadingTable = ref(false) // 表格loading @@ -92,6 +93,9 @@ // 获取数据列表 const getList = () => { loadingTable.value = true + if (props.isRemind) { + searchQuery.remindType = 'remind' + } getCertificateList(searchQuery).then((res) => { if (res.code === 200) { res.data.records = res.data.records.map(item => ({ ...item, sex: item.sex == '1' ? '男' : '女', certificateStatus: item.certificateStatus == '0' ? '正常' : '已失效', validDate: item.validDate.split(' ')[0], certificateDate: item.certificateDate.split(' ')[0] })) diff --git a/src/views/measure/person/person-interface.ts b/src/views/measure/person/person-interface.ts index 9dd5d33..d116841 100644 --- a/src/views/measure/person/person-interface.ts +++ b/src/views/measure/person/person-interface.ts @@ -6,6 +6,7 @@ major?: string // 计量专业 verifierCertificateNo?: string // 证书号 certificateStatus?: string // 证书状态 + remindType?: string limit: number offset: number }