diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 8998561..84b23ea 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -524,18 +524,6 @@ }, }, { - path: '/dremindlist/:type', - name: 'DremindlistEdit', - component: () => import('@/views/tested/device/remind/components/edit.vue'), - meta: { - title: '到期提醒编辑', - auth: '/tested/device/remind', - sidebar: false, - breadcrumb: false, - activeMenu: '/dremindlist', - }, - }, - { path: '/dremindlist/detail', name: 'dremindlistDetail', component: () => import('@/views/tested/device/info/components/detail.vue'), diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 8998561..84b23ea 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -524,18 +524,6 @@ }, }, { - path: '/dremindlist/:type', - name: 'DremindlistEdit', - component: () => import('@/views/tested/device/remind/components/edit.vue'), - meta: { - title: '到期提醒编辑', - auth: '/tested/device/remind', - sidebar: false, - breadcrumb: false, - activeMenu: '/dremindlist', - }, - }, - { path: '/dremindlist/detail', name: 'dremindlistDetail', component: () => import('@/views/tested/device/info/components/detail.vue'), diff --git a/src/utils/applyBtns.ts b/src/utils/applyBtns.ts index e08ffe1..aca300d 100644 --- a/src/utils/applyBtns.ts +++ b/src/utils/applyBtns.ts @@ -34,7 +34,7 @@ export const delTextBtn = (applyStatus: string) => { switch (applyStatus) { case '全部': - return true + return false break case '已审批': return false @@ -65,7 +65,7 @@ // 编辑页面中编辑按钮 export const editBtn = (applyStatus: string, type: string) => { if (applyStatus === '审批' && type === 'detail') { - return true + return false } else if (applyStatus === '草稿箱' && type === 'detail') { return true diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 8998561..84b23ea 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -524,18 +524,6 @@ }, }, { - path: '/dremindlist/:type', - name: 'DremindlistEdit', - component: () => import('@/views/tested/device/remind/components/edit.vue'), - meta: { - title: '到期提醒编辑', - auth: '/tested/device/remind', - sidebar: false, - breadcrumb: false, - activeMenu: '/dremindlist', - }, - }, - { path: '/dremindlist/detail', name: 'dremindlistDetail', component: () => import('@/views/tested/device/info/components/detail.vue'), diff --git a/src/utils/applyBtns.ts b/src/utils/applyBtns.ts index e08ffe1..aca300d 100644 --- a/src/utils/applyBtns.ts +++ b/src/utils/applyBtns.ts @@ -34,7 +34,7 @@ export const delTextBtn = (applyStatus: string) => { switch (applyStatus) { case '全部': - return true + return false break case '已审批': return false @@ -65,7 +65,7 @@ // 编辑页面中编辑按钮 export const editBtn = (applyStatus: string, type: string) => { if (applyStatus === '审批' && type === 'detail') { - return true + return false } else if (applyStatus === '草稿箱' && type === 'detail') { return true diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index b6cd934..87ad108 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -9,8 +9,8 @@ SUBCONTRACTOR_APPROVAL = 'fbfmlgl', // 分包方名录管理 SUBCONTRACT_REVIEW_APPROVAL = 'fbfpsbgl', // 分包方评审表 EQUIPMENT_SEALED_APPROVAL = 'sbfcsq', // 设备封存申请 - EQUIPMENT_UNSEALED_APPROVAL = 'sbgfsq', // 设备启封由请 + EQUIPMENT_UNSEALED_APPROVAL = 'sbqfsq', // 设备启封由请 EQUIPMENT_DISABLE_APPROVAL = 'sbjysq', // 设备禁用申请 EQUIPMENT_SCRAP_APPROVAL = 'sbbfsq', // 设备报废申请 - EQUIPMENT_DELAY_APPROVAL = 'sbyysq"', // 设备延用申请 + EQUIPMENT_DELAY_APPROVAL = 'sbyysq', // 设备延用申请 } diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 8998561..84b23ea 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -524,18 +524,6 @@ }, }, { - path: '/dremindlist/:type', - name: 'DremindlistEdit', - component: () => import('@/views/tested/device/remind/components/edit.vue'), - meta: { - title: '到期提醒编辑', - auth: '/tested/device/remind', - sidebar: false, - breadcrumb: false, - activeMenu: '/dremindlist', - }, - }, - { path: '/dremindlist/detail', name: 'dremindlistDetail', component: () => import('@/views/tested/device/info/components/detail.vue'), diff --git a/src/utils/applyBtns.ts b/src/utils/applyBtns.ts index e08ffe1..aca300d 100644 --- a/src/utils/applyBtns.ts +++ b/src/utils/applyBtns.ts @@ -34,7 +34,7 @@ export const delTextBtn = (applyStatus: string) => { switch (applyStatus) { case '全部': - return true + return false break case '已审批': return false @@ -65,7 +65,7 @@ // 编辑页面中编辑按钮 export const editBtn = (applyStatus: string, type: string) => { if (applyStatus === '审批' && type === 'detail') { - return true + return false } else if (applyStatus === '草稿箱' && type === 'detail') { return true diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index b6cd934..87ad108 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -9,8 +9,8 @@ SUBCONTRACTOR_APPROVAL = 'fbfmlgl', // 分包方名录管理 SUBCONTRACT_REVIEW_APPROVAL = 'fbfpsbgl', // 分包方评审表 EQUIPMENT_SEALED_APPROVAL = 'sbfcsq', // 设备封存申请 - EQUIPMENT_UNSEALED_APPROVAL = 'sbgfsq', // 设备启封由请 + EQUIPMENT_UNSEALED_APPROVAL = 'sbqfsq', // 设备启封由请 EQUIPMENT_DISABLE_APPROVAL = 'sbjysq', // 设备禁用申请 EQUIPMENT_SCRAP_APPROVAL = 'sbbfsq', // 设备报废申请 - EQUIPMENT_DELAY_APPROVAL = 'sbyysq"', // 设备延用申请 + EQUIPMENT_DELAY_APPROVAL = 'sbyysq', // 设备延用申请 } diff --git a/src/views/system/label/list.vue b/src/views/system/label/list.vue index 2f617ae..9285675 100644 --- a/src/views/system/label/list.vue +++ b/src/views/system/label/list.vue @@ -103,7 +103,8 @@ ElMessage.error(res.message) loading.close() } - }).catch((_) => { + }).catch((err) => { + ElMessage.error(err.message) loading.close() }) } diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 8998561..84b23ea 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -524,18 +524,6 @@ }, }, { - path: '/dremindlist/:type', - name: 'DremindlistEdit', - component: () => import('@/views/tested/device/remind/components/edit.vue'), - meta: { - title: '到期提醒编辑', - auth: '/tested/device/remind', - sidebar: false, - breadcrumb: false, - activeMenu: '/dremindlist', - }, - }, - { path: '/dremindlist/detail', name: 'dremindlistDetail', component: () => import('@/views/tested/device/info/components/detail.vue'), diff --git a/src/utils/applyBtns.ts b/src/utils/applyBtns.ts index e08ffe1..aca300d 100644 --- a/src/utils/applyBtns.ts +++ b/src/utils/applyBtns.ts @@ -34,7 +34,7 @@ export const delTextBtn = (applyStatus: string) => { switch (applyStatus) { case '全部': - return true + return false break case '已审批': return false @@ -65,7 +65,7 @@ // 编辑页面中编辑按钮 export const editBtn = (applyStatus: string, type: string) => { if (applyStatus === '审批' && type === 'detail') { - return true + return false } else if (applyStatus === '草稿箱' && type === 'detail') { return true diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index b6cd934..87ad108 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -9,8 +9,8 @@ SUBCONTRACTOR_APPROVAL = 'fbfmlgl', // 分包方名录管理 SUBCONTRACT_REVIEW_APPROVAL = 'fbfpsbgl', // 分包方评审表 EQUIPMENT_SEALED_APPROVAL = 'sbfcsq', // 设备封存申请 - EQUIPMENT_UNSEALED_APPROVAL = 'sbgfsq', // 设备启封由请 + EQUIPMENT_UNSEALED_APPROVAL = 'sbqfsq', // 设备启封由请 EQUIPMENT_DISABLE_APPROVAL = 'sbjysq', // 设备禁用申请 EQUIPMENT_SCRAP_APPROVAL = 'sbbfsq', // 设备报废申请 - EQUIPMENT_DELAY_APPROVAL = 'sbyysq"', // 设备延用申请 + EQUIPMENT_DELAY_APPROVAL = 'sbyysq', // 设备延用申请 } diff --git a/src/views/system/label/list.vue b/src/views/system/label/list.vue index 2f617ae..9285675 100644 --- a/src/views/system/label/list.vue +++ b/src/views/system/label/list.vue @@ -103,7 +103,8 @@ ElMessage.error(res.message) loading.close() } - }).catch((_) => { + }).catch((err) => { + ElMessage.error(err.message) loading.close() }) } diff --git a/src/views/tested/MeasurementPlan/early/components/detail.vue b/src/views/tested/MeasurementPlan/early/components/detail.vue index 8eb6425..dac24d6 100644 --- a/src/views/tested/MeasurementPlan/early/components/detail.vue +++ b/src/views/tested/MeasurementPlan/early/components/detail.vue @@ -2,7 +2,7 @@ import { ElMessage, ElMessageBox } from 'element-plus' import baseInfo from './edit.vue' import ApprovalDialog from './ApprovalDialog.vue' -import { editBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn } from '@/utils/applyBtns' import { cancelApply, delApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const activeName = ref('基本信息') @@ -76,7 +76,7 @@ 编辑 - + 删除 diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 8998561..84b23ea 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -524,18 +524,6 @@ }, }, { - path: '/dremindlist/:type', - name: 'DremindlistEdit', - component: () => import('@/views/tested/device/remind/components/edit.vue'), - meta: { - title: '到期提醒编辑', - auth: '/tested/device/remind', - sidebar: false, - breadcrumb: false, - activeMenu: '/dremindlist', - }, - }, - { path: '/dremindlist/detail', name: 'dremindlistDetail', component: () => import('@/views/tested/device/info/components/detail.vue'), diff --git a/src/utils/applyBtns.ts b/src/utils/applyBtns.ts index e08ffe1..aca300d 100644 --- a/src/utils/applyBtns.ts +++ b/src/utils/applyBtns.ts @@ -34,7 +34,7 @@ export const delTextBtn = (applyStatus: string) => { switch (applyStatus) { case '全部': - return true + return false break case '已审批': return false @@ -65,7 +65,7 @@ // 编辑页面中编辑按钮 export const editBtn = (applyStatus: string, type: string) => { if (applyStatus === '审批' && type === 'detail') { - return true + return false } else if (applyStatus === '草稿箱' && type === 'detail') { return true diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index b6cd934..87ad108 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -9,8 +9,8 @@ SUBCONTRACTOR_APPROVAL = 'fbfmlgl', // 分包方名录管理 SUBCONTRACT_REVIEW_APPROVAL = 'fbfpsbgl', // 分包方评审表 EQUIPMENT_SEALED_APPROVAL = 'sbfcsq', // 设备封存申请 - EQUIPMENT_UNSEALED_APPROVAL = 'sbgfsq', // 设备启封由请 + EQUIPMENT_UNSEALED_APPROVAL = 'sbqfsq', // 设备启封由请 EQUIPMENT_DISABLE_APPROVAL = 'sbjysq', // 设备禁用申请 EQUIPMENT_SCRAP_APPROVAL = 'sbbfsq', // 设备报废申请 - EQUIPMENT_DELAY_APPROVAL = 'sbyysq"', // 设备延用申请 + EQUIPMENT_DELAY_APPROVAL = 'sbyysq', // 设备延用申请 } diff --git a/src/views/system/label/list.vue b/src/views/system/label/list.vue index 2f617ae..9285675 100644 --- a/src/views/system/label/list.vue +++ b/src/views/system/label/list.vue @@ -103,7 +103,8 @@ ElMessage.error(res.message) loading.close() } - }).catch((_) => { + }).catch((err) => { + ElMessage.error(err.message) loading.close() }) } diff --git a/src/views/tested/MeasurementPlan/early/components/detail.vue b/src/views/tested/MeasurementPlan/early/components/detail.vue index 8eb6425..dac24d6 100644 --- a/src/views/tested/MeasurementPlan/early/components/detail.vue +++ b/src/views/tested/MeasurementPlan/early/components/detail.vue @@ -2,7 +2,7 @@ import { ElMessage, ElMessageBox } from 'element-plus' import baseInfo from './edit.vue' import ApprovalDialog from './ApprovalDialog.vue' -import { editBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn } from '@/utils/applyBtns' import { cancelApply, delApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const activeName = ref('基本信息') @@ -76,7 +76,7 @@ 编辑 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/edit.vue b/src/views/tested/MeasurementPlan/early/components/edit.vue index 2fe4276..dc6109a 100644 --- a/src/views/tested/MeasurementPlan/early/components/edit.vue +++ b/src/views/tested/MeasurementPlan/early/components/edit.vue @@ -4,10 +4,11 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import dayjs from 'dayjs' import planList from './table.vue' +import approvalDialog from './ApprovalDialog.vue' import { getDictByCode } from '@/api/system/dict' import useUserStore from '@/store/modules/user' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { cancelApply, delApply, detailApply, editApply, submitApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const $router = useRouter() @@ -190,7 +191,7 @@ 取消 - + 删除 diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 8998561..84b23ea 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -524,18 +524,6 @@ }, }, { - path: '/dremindlist/:type', - name: 'DremindlistEdit', - component: () => import('@/views/tested/device/remind/components/edit.vue'), - meta: { - title: '到期提醒编辑', - auth: '/tested/device/remind', - sidebar: false, - breadcrumb: false, - activeMenu: '/dremindlist', - }, - }, - { path: '/dremindlist/detail', name: 'dremindlistDetail', component: () => import('@/views/tested/device/info/components/detail.vue'), diff --git a/src/utils/applyBtns.ts b/src/utils/applyBtns.ts index e08ffe1..aca300d 100644 --- a/src/utils/applyBtns.ts +++ b/src/utils/applyBtns.ts @@ -34,7 +34,7 @@ export const delTextBtn = (applyStatus: string) => { switch (applyStatus) { case '全部': - return true + return false break case '已审批': return false @@ -65,7 +65,7 @@ // 编辑页面中编辑按钮 export const editBtn = (applyStatus: string, type: string) => { if (applyStatus === '审批' && type === 'detail') { - return true + return false } else if (applyStatus === '草稿箱' && type === 'detail') { return true diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index b6cd934..87ad108 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -9,8 +9,8 @@ SUBCONTRACTOR_APPROVAL = 'fbfmlgl', // 分包方名录管理 SUBCONTRACT_REVIEW_APPROVAL = 'fbfpsbgl', // 分包方评审表 EQUIPMENT_SEALED_APPROVAL = 'sbfcsq', // 设备封存申请 - EQUIPMENT_UNSEALED_APPROVAL = 'sbgfsq', // 设备启封由请 + EQUIPMENT_UNSEALED_APPROVAL = 'sbqfsq', // 设备启封由请 EQUIPMENT_DISABLE_APPROVAL = 'sbjysq', // 设备禁用申请 EQUIPMENT_SCRAP_APPROVAL = 'sbbfsq', // 设备报废申请 - EQUIPMENT_DELAY_APPROVAL = 'sbyysq"', // 设备延用申请 + EQUIPMENT_DELAY_APPROVAL = 'sbyysq', // 设备延用申请 } diff --git a/src/views/system/label/list.vue b/src/views/system/label/list.vue index 2f617ae..9285675 100644 --- a/src/views/system/label/list.vue +++ b/src/views/system/label/list.vue @@ -103,7 +103,8 @@ ElMessage.error(res.message) loading.close() } - }).catch((_) => { + }).catch((err) => { + ElMessage.error(err.message) loading.close() }) } diff --git a/src/views/tested/MeasurementPlan/early/components/detail.vue b/src/views/tested/MeasurementPlan/early/components/detail.vue index 8eb6425..dac24d6 100644 --- a/src/views/tested/MeasurementPlan/early/components/detail.vue +++ b/src/views/tested/MeasurementPlan/early/components/detail.vue @@ -2,7 +2,7 @@ import { ElMessage, ElMessageBox } from 'element-plus' import baseInfo from './edit.vue' import ApprovalDialog from './ApprovalDialog.vue' -import { editBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn } from '@/utils/applyBtns' import { cancelApply, delApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const activeName = ref('基本信息') @@ -76,7 +76,7 @@ 编辑 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/edit.vue b/src/views/tested/MeasurementPlan/early/components/edit.vue index 2fe4276..dc6109a 100644 --- a/src/views/tested/MeasurementPlan/early/components/edit.vue +++ b/src/views/tested/MeasurementPlan/early/components/edit.vue @@ -4,10 +4,11 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import dayjs from 'dayjs' import planList from './table.vue' +import approvalDialog from './ApprovalDialog.vue' import { getDictByCode } from '@/api/system/dict' import useUserStore from '@/store/modules/user' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { cancelApply, delApply, detailApply, editApply, submitApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const $router = useRouter() @@ -190,7 +191,7 @@ 取消 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue index e2c0066..7108668 100644 --- a/src/views/tested/MeasurementPlan/early/components/list.vue +++ b/src/views/tested/MeasurementPlan/early/components/list.vue @@ -2,6 +2,7 @@ diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 8998561..84b23ea 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -524,18 +524,6 @@ }, }, { - path: '/dremindlist/:type', - name: 'DremindlistEdit', - component: () => import('@/views/tested/device/remind/components/edit.vue'), - meta: { - title: '到期提醒编辑', - auth: '/tested/device/remind', - sidebar: false, - breadcrumb: false, - activeMenu: '/dremindlist', - }, - }, - { path: '/dremindlist/detail', name: 'dremindlistDetail', component: () => import('@/views/tested/device/info/components/detail.vue'), diff --git a/src/utils/applyBtns.ts b/src/utils/applyBtns.ts index e08ffe1..aca300d 100644 --- a/src/utils/applyBtns.ts +++ b/src/utils/applyBtns.ts @@ -34,7 +34,7 @@ export const delTextBtn = (applyStatus: string) => { switch (applyStatus) { case '全部': - return true + return false break case '已审批': return false @@ -65,7 +65,7 @@ // 编辑页面中编辑按钮 export const editBtn = (applyStatus: string, type: string) => { if (applyStatus === '审批' && type === 'detail') { - return true + return false } else if (applyStatus === '草稿箱' && type === 'detail') { return true diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index b6cd934..87ad108 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -9,8 +9,8 @@ SUBCONTRACTOR_APPROVAL = 'fbfmlgl', // 分包方名录管理 SUBCONTRACT_REVIEW_APPROVAL = 'fbfpsbgl', // 分包方评审表 EQUIPMENT_SEALED_APPROVAL = 'sbfcsq', // 设备封存申请 - EQUIPMENT_UNSEALED_APPROVAL = 'sbgfsq', // 设备启封由请 + EQUIPMENT_UNSEALED_APPROVAL = 'sbqfsq', // 设备启封由请 EQUIPMENT_DISABLE_APPROVAL = 'sbjysq', // 设备禁用申请 EQUIPMENT_SCRAP_APPROVAL = 'sbbfsq', // 设备报废申请 - EQUIPMENT_DELAY_APPROVAL = 'sbyysq"', // 设备延用申请 + EQUIPMENT_DELAY_APPROVAL = 'sbyysq', // 设备延用申请 } diff --git a/src/views/system/label/list.vue b/src/views/system/label/list.vue index 2f617ae..9285675 100644 --- a/src/views/system/label/list.vue +++ b/src/views/system/label/list.vue @@ -103,7 +103,8 @@ ElMessage.error(res.message) loading.close() } - }).catch((_) => { + }).catch((err) => { + ElMessage.error(err.message) loading.close() }) } diff --git a/src/views/tested/MeasurementPlan/early/components/detail.vue b/src/views/tested/MeasurementPlan/early/components/detail.vue index 8eb6425..dac24d6 100644 --- a/src/views/tested/MeasurementPlan/early/components/detail.vue +++ b/src/views/tested/MeasurementPlan/early/components/detail.vue @@ -2,7 +2,7 @@ import { ElMessage, ElMessageBox } from 'element-plus' import baseInfo from './edit.vue' import ApprovalDialog from './ApprovalDialog.vue' -import { editBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn } from '@/utils/applyBtns' import { cancelApply, delApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const activeName = ref('基本信息') @@ -76,7 +76,7 @@ 编辑 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/edit.vue b/src/views/tested/MeasurementPlan/early/components/edit.vue index 2fe4276..dc6109a 100644 --- a/src/views/tested/MeasurementPlan/early/components/edit.vue +++ b/src/views/tested/MeasurementPlan/early/components/edit.vue @@ -4,10 +4,11 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import dayjs from 'dayjs' import planList from './table.vue' +import approvalDialog from './ApprovalDialog.vue' import { getDictByCode } from '@/api/system/dict' import useUserStore from '@/store/modules/user' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { cancelApply, delApply, detailApply, editApply, submitApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const $router = useRouter() @@ -190,7 +191,7 @@ 取消 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue index e2c0066..7108668 100644 --- a/src/views/tested/MeasurementPlan/early/components/list.vue +++ b/src/views/tested/MeasurementPlan/early/components/list.vue @@ -2,6 +2,7 @@ diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 5ac5e8c..41df464 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -7,7 +7,7 @@ import technology from './technology.vue' import showPhoto from './showPhoto.vue' import certificateTable from './certificateTable.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' @@ -400,9 +400,16 @@ }) } } +// 上传 const upload = () => { fileRef.value.click() } +// 删除上传的文件 +const deleteFile = (fileName: string) => { + const data = ruleForm.value.instructionsFile.split(',') + const filterData = data.filter(item => item !== fileName) + ruleForm.value.instructionsFile = filterData.length ? filterData.join(',') : '' +} const print = () => { } @@ -429,7 +436,7 @@ 保存 - + 删除 @@ -592,7 +599,7 @@ - + 上传 diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 8998561..84b23ea 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -524,18 +524,6 @@ }, }, { - path: '/dremindlist/:type', - name: 'DremindlistEdit', - component: () => import('@/views/tested/device/remind/components/edit.vue'), - meta: { - title: '到期提醒编辑', - auth: '/tested/device/remind', - sidebar: false, - breadcrumb: false, - activeMenu: '/dremindlist', - }, - }, - { path: '/dremindlist/detail', name: 'dremindlistDetail', component: () => import('@/views/tested/device/info/components/detail.vue'), diff --git a/src/utils/applyBtns.ts b/src/utils/applyBtns.ts index e08ffe1..aca300d 100644 --- a/src/utils/applyBtns.ts +++ b/src/utils/applyBtns.ts @@ -34,7 +34,7 @@ export const delTextBtn = (applyStatus: string) => { switch (applyStatus) { case '全部': - return true + return false break case '已审批': return false @@ -65,7 +65,7 @@ // 编辑页面中编辑按钮 export const editBtn = (applyStatus: string, type: string) => { if (applyStatus === '审批' && type === 'detail') { - return true + return false } else if (applyStatus === '草稿箱' && type === 'detail') { return true diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index b6cd934..87ad108 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -9,8 +9,8 @@ SUBCONTRACTOR_APPROVAL = 'fbfmlgl', // 分包方名录管理 SUBCONTRACT_REVIEW_APPROVAL = 'fbfpsbgl', // 分包方评审表 EQUIPMENT_SEALED_APPROVAL = 'sbfcsq', // 设备封存申请 - EQUIPMENT_UNSEALED_APPROVAL = 'sbgfsq', // 设备启封由请 + EQUIPMENT_UNSEALED_APPROVAL = 'sbqfsq', // 设备启封由请 EQUIPMENT_DISABLE_APPROVAL = 'sbjysq', // 设备禁用申请 EQUIPMENT_SCRAP_APPROVAL = 'sbbfsq', // 设备报废申请 - EQUIPMENT_DELAY_APPROVAL = 'sbyysq"', // 设备延用申请 + EQUIPMENT_DELAY_APPROVAL = 'sbyysq', // 设备延用申请 } diff --git a/src/views/system/label/list.vue b/src/views/system/label/list.vue index 2f617ae..9285675 100644 --- a/src/views/system/label/list.vue +++ b/src/views/system/label/list.vue @@ -103,7 +103,8 @@ ElMessage.error(res.message) loading.close() } - }).catch((_) => { + }).catch((err) => { + ElMessage.error(err.message) loading.close() }) } diff --git a/src/views/tested/MeasurementPlan/early/components/detail.vue b/src/views/tested/MeasurementPlan/early/components/detail.vue index 8eb6425..dac24d6 100644 --- a/src/views/tested/MeasurementPlan/early/components/detail.vue +++ b/src/views/tested/MeasurementPlan/early/components/detail.vue @@ -2,7 +2,7 @@ import { ElMessage, ElMessageBox } from 'element-plus' import baseInfo from './edit.vue' import ApprovalDialog from './ApprovalDialog.vue' -import { editBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn } from '@/utils/applyBtns' import { cancelApply, delApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const activeName = ref('基本信息') @@ -76,7 +76,7 @@ 编辑 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/edit.vue b/src/views/tested/MeasurementPlan/early/components/edit.vue index 2fe4276..dc6109a 100644 --- a/src/views/tested/MeasurementPlan/early/components/edit.vue +++ b/src/views/tested/MeasurementPlan/early/components/edit.vue @@ -4,10 +4,11 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import dayjs from 'dayjs' import planList from './table.vue' +import approvalDialog from './ApprovalDialog.vue' import { getDictByCode } from '@/api/system/dict' import useUserStore from '@/store/modules/user' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { cancelApply, delApply, detailApply, editApply, submitApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const $router = useRouter() @@ -190,7 +191,7 @@ 取消 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue index e2c0066..7108668 100644 --- a/src/views/tested/MeasurementPlan/early/components/list.vue +++ b/src/views/tested/MeasurementPlan/early/components/list.vue @@ -2,6 +2,7 @@ diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 5ac5e8c..41df464 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -7,7 +7,7 @@ import technology from './technology.vue' import showPhoto from './showPhoto.vue' import certificateTable from './certificateTable.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' @@ -400,9 +400,16 @@ }) } } +// 上传 const upload = () => { fileRef.value.click() } +// 删除上传的文件 +const deleteFile = (fileName: string) => { + const data = ruleForm.value.instructionsFile.split(',') + const filterData = data.filter(item => item !== fileName) + ruleForm.value.instructionsFile = filterData.length ? filterData.join(',') : '' +} const print = () => { } @@ -429,7 +436,7 @@ 保存 - + 删除 @@ -592,7 +599,7 @@ - + 上传 diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue index e2ff0c5..f65e207 100644 --- a/src/views/tested/device/info/components/list.vue +++ b/src/views/tested/device/info/components/list.vue @@ -5,7 +5,7 @@ import type { IlistObjType, IlistQueryType } from './interface' import { delTextBtn, editTextBtn } from '@/utils/applyBtns' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, submitInfo } from '@/api/eqpt/device/info' +import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' @@ -71,7 +71,7 @@ }, { text: '计量标识', - value: 'meterIdentify', + value: 'meterIdentifyName', align: 'center', }, { @@ -136,6 +136,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch((_) => { + listLoading.value = false }) } // 获取使用状态列表 @@ -269,6 +271,39 @@ ElMessage.warning('无可导出内容') } } +const fileRef = ref() // 文件上传input,获取input的引用 +const onFileChange = (event: any) => { + // 原生上传 + // console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('file', event.target.files[0]) + // fd.append('equipmentType', $props.equipmentType) + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + importDevice(fd, $props.equipmentType).then((res) => { + if (res.code === 200) { + ElMessage.success('上传成功') + loading.close() + fetchData(true) + } + else { + // ElMessage.error(res.message) + loading.close() + } + }).catch((err) => { + ElMessage.error(err.message) + loading.close() + }) + } +} +// 导入 +const importList = () => { + fileRef.value.click() +} // 详情 const detail = (row: IlistObjType) => { if ($props.statusName === '草稿箱' || $props.statusName === '未通过' || $props.statusName === '已取消') { @@ -399,13 +434,15 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() - tableFlage.value = true + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + tableFlage.value = true + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/device/info/edit', @@ -452,9 +489,10 @@ - + + 删除 - diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 8998561..84b23ea 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -524,18 +524,6 @@ }, }, { - path: '/dremindlist/:type', - name: 'DremindlistEdit', - component: () => import('@/views/tested/device/remind/components/edit.vue'), - meta: { - title: '到期提醒编辑', - auth: '/tested/device/remind', - sidebar: false, - breadcrumb: false, - activeMenu: '/dremindlist', - }, - }, - { path: '/dremindlist/detail', name: 'dremindlistDetail', component: () => import('@/views/tested/device/info/components/detail.vue'), diff --git a/src/utils/applyBtns.ts b/src/utils/applyBtns.ts index e08ffe1..aca300d 100644 --- a/src/utils/applyBtns.ts +++ b/src/utils/applyBtns.ts @@ -34,7 +34,7 @@ export const delTextBtn = (applyStatus: string) => { switch (applyStatus) { case '全部': - return true + return false break case '已审批': return false @@ -65,7 +65,7 @@ // 编辑页面中编辑按钮 export const editBtn = (applyStatus: string, type: string) => { if (applyStatus === '审批' && type === 'detail') { - return true + return false } else if (applyStatus === '草稿箱' && type === 'detail') { return true diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index b6cd934..87ad108 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -9,8 +9,8 @@ SUBCONTRACTOR_APPROVAL = 'fbfmlgl', // 分包方名录管理 SUBCONTRACT_REVIEW_APPROVAL = 'fbfpsbgl', // 分包方评审表 EQUIPMENT_SEALED_APPROVAL = 'sbfcsq', // 设备封存申请 - EQUIPMENT_UNSEALED_APPROVAL = 'sbgfsq', // 设备启封由请 + EQUIPMENT_UNSEALED_APPROVAL = 'sbqfsq', // 设备启封由请 EQUIPMENT_DISABLE_APPROVAL = 'sbjysq', // 设备禁用申请 EQUIPMENT_SCRAP_APPROVAL = 'sbbfsq', // 设备报废申请 - EQUIPMENT_DELAY_APPROVAL = 'sbyysq"', // 设备延用申请 + EQUIPMENT_DELAY_APPROVAL = 'sbyysq', // 设备延用申请 } diff --git a/src/views/system/label/list.vue b/src/views/system/label/list.vue index 2f617ae..9285675 100644 --- a/src/views/system/label/list.vue +++ b/src/views/system/label/list.vue @@ -103,7 +103,8 @@ ElMessage.error(res.message) loading.close() } - }).catch((_) => { + }).catch((err) => { + ElMessage.error(err.message) loading.close() }) } diff --git a/src/views/tested/MeasurementPlan/early/components/detail.vue b/src/views/tested/MeasurementPlan/early/components/detail.vue index 8eb6425..dac24d6 100644 --- a/src/views/tested/MeasurementPlan/early/components/detail.vue +++ b/src/views/tested/MeasurementPlan/early/components/detail.vue @@ -2,7 +2,7 @@ import { ElMessage, ElMessageBox } from 'element-plus' import baseInfo from './edit.vue' import ApprovalDialog from './ApprovalDialog.vue' -import { editBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn } from '@/utils/applyBtns' import { cancelApply, delApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const activeName = ref('基本信息') @@ -76,7 +76,7 @@ 编辑 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/edit.vue b/src/views/tested/MeasurementPlan/early/components/edit.vue index 2fe4276..dc6109a 100644 --- a/src/views/tested/MeasurementPlan/early/components/edit.vue +++ b/src/views/tested/MeasurementPlan/early/components/edit.vue @@ -4,10 +4,11 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import dayjs from 'dayjs' import planList from './table.vue' +import approvalDialog from './ApprovalDialog.vue' import { getDictByCode } from '@/api/system/dict' import useUserStore from '@/store/modules/user' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { cancelApply, delApply, detailApply, editApply, submitApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const $router = useRouter() @@ -190,7 +191,7 @@ 取消 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue index e2c0066..7108668 100644 --- a/src/views/tested/MeasurementPlan/early/components/list.vue +++ b/src/views/tested/MeasurementPlan/early/components/list.vue @@ -2,6 +2,7 @@ diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 5ac5e8c..41df464 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -7,7 +7,7 @@ import technology from './technology.vue' import showPhoto from './showPhoto.vue' import certificateTable from './certificateTable.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' @@ -400,9 +400,16 @@ }) } } +// 上传 const upload = () => { fileRef.value.click() } +// 删除上传的文件 +const deleteFile = (fileName: string) => { + const data = ruleForm.value.instructionsFile.split(',') + const filterData = data.filter(item => item !== fileName) + ruleForm.value.instructionsFile = filterData.length ? filterData.join(',') : '' +} const print = () => { } @@ -429,7 +436,7 @@ 保存 - + 删除 @@ -592,7 +599,7 @@ - + 上传 diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue index e2ff0c5..f65e207 100644 --- a/src/views/tested/device/info/components/list.vue +++ b/src/views/tested/device/info/components/list.vue @@ -5,7 +5,7 @@ import type { IlistObjType, IlistQueryType } from './interface' import { delTextBtn, editTextBtn } from '@/utils/applyBtns' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, submitInfo } from '@/api/eqpt/device/info' +import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' @@ -71,7 +71,7 @@ }, { text: '计量标识', - value: 'meterIdentify', + value: 'meterIdentifyName', align: 'center', }, { @@ -136,6 +136,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch((_) => { + listLoading.value = false }) } // 获取使用状态列表 @@ -269,6 +271,39 @@ ElMessage.warning('无可导出内容') } } +const fileRef = ref() // 文件上传input,获取input的引用 +const onFileChange = (event: any) => { + // 原生上传 + // console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('file', event.target.files[0]) + // fd.append('equipmentType', $props.equipmentType) + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + importDevice(fd, $props.equipmentType).then((res) => { + if (res.code === 200) { + ElMessage.success('上传成功') + loading.close() + fetchData(true) + } + else { + // ElMessage.error(res.message) + loading.close() + } + }).catch((err) => { + ElMessage.error(err.message) + loading.close() + }) + } +} +// 导入 +const importList = () => { + fileRef.value.click() +} // 详情 const detail = (row: IlistObjType) => { if ($props.statusName === '草稿箱' || $props.statusName === '未通过' || $props.statusName === '已取消') { @@ -399,13 +434,15 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() - tableFlage.value = true + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + tableFlage.value = true + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/device/info/edit', @@ -452,9 +489,10 @@ - + + 删除 - diff --git a/src/views/tested/device/info/components/showPhoto.vue b/src/views/tested/device/info/components/showPhoto.vue index 0d50813..3af1845 100644 --- a/src/views/tested/device/info/components/showPhoto.vue +++ b/src/views/tested/device/info/components/showPhoto.vue @@ -15,6 +15,8 @@ default: '100px', }, }) +const $emits = defineEmits(['delete']) +const $route = useRoute() const urlList = ref() const getPhoto = () => { if (props.minioFileName) { @@ -34,6 +36,9 @@ }) }) } + else { + urlList.value = [] + } } onMounted(() => { @@ -45,31 +50,87 @@ // onUpdated(() => { // }) +const close = (fileName: string) => { + $emits('delete', fileName) +} diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 8998561..84b23ea 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -524,18 +524,6 @@ }, }, { - path: '/dremindlist/:type', - name: 'DremindlistEdit', - component: () => import('@/views/tested/device/remind/components/edit.vue'), - meta: { - title: '到期提醒编辑', - auth: '/tested/device/remind', - sidebar: false, - breadcrumb: false, - activeMenu: '/dremindlist', - }, - }, - { path: '/dremindlist/detail', name: 'dremindlistDetail', component: () => import('@/views/tested/device/info/components/detail.vue'), diff --git a/src/utils/applyBtns.ts b/src/utils/applyBtns.ts index e08ffe1..aca300d 100644 --- a/src/utils/applyBtns.ts +++ b/src/utils/applyBtns.ts @@ -34,7 +34,7 @@ export const delTextBtn = (applyStatus: string) => { switch (applyStatus) { case '全部': - return true + return false break case '已审批': return false @@ -65,7 +65,7 @@ // 编辑页面中编辑按钮 export const editBtn = (applyStatus: string, type: string) => { if (applyStatus === '审批' && type === 'detail') { - return true + return false } else if (applyStatus === '草稿箱' && type === 'detail') { return true diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index b6cd934..87ad108 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -9,8 +9,8 @@ SUBCONTRACTOR_APPROVAL = 'fbfmlgl', // 分包方名录管理 SUBCONTRACT_REVIEW_APPROVAL = 'fbfpsbgl', // 分包方评审表 EQUIPMENT_SEALED_APPROVAL = 'sbfcsq', // 设备封存申请 - EQUIPMENT_UNSEALED_APPROVAL = 'sbgfsq', // 设备启封由请 + EQUIPMENT_UNSEALED_APPROVAL = 'sbqfsq', // 设备启封由请 EQUIPMENT_DISABLE_APPROVAL = 'sbjysq', // 设备禁用申请 EQUIPMENT_SCRAP_APPROVAL = 'sbbfsq', // 设备报废申请 - EQUIPMENT_DELAY_APPROVAL = 'sbyysq"', // 设备延用申请 + EQUIPMENT_DELAY_APPROVAL = 'sbyysq', // 设备延用申请 } diff --git a/src/views/system/label/list.vue b/src/views/system/label/list.vue index 2f617ae..9285675 100644 --- a/src/views/system/label/list.vue +++ b/src/views/system/label/list.vue @@ -103,7 +103,8 @@ ElMessage.error(res.message) loading.close() } - }).catch((_) => { + }).catch((err) => { + ElMessage.error(err.message) loading.close() }) } diff --git a/src/views/tested/MeasurementPlan/early/components/detail.vue b/src/views/tested/MeasurementPlan/early/components/detail.vue index 8eb6425..dac24d6 100644 --- a/src/views/tested/MeasurementPlan/early/components/detail.vue +++ b/src/views/tested/MeasurementPlan/early/components/detail.vue @@ -2,7 +2,7 @@ import { ElMessage, ElMessageBox } from 'element-plus' import baseInfo from './edit.vue' import ApprovalDialog from './ApprovalDialog.vue' -import { editBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn } from '@/utils/applyBtns' import { cancelApply, delApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const activeName = ref('基本信息') @@ -76,7 +76,7 @@ 编辑 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/edit.vue b/src/views/tested/MeasurementPlan/early/components/edit.vue index 2fe4276..dc6109a 100644 --- a/src/views/tested/MeasurementPlan/early/components/edit.vue +++ b/src/views/tested/MeasurementPlan/early/components/edit.vue @@ -4,10 +4,11 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import dayjs from 'dayjs' import planList from './table.vue' +import approvalDialog from './ApprovalDialog.vue' import { getDictByCode } from '@/api/system/dict' import useUserStore from '@/store/modules/user' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { cancelApply, delApply, detailApply, editApply, submitApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const $router = useRouter() @@ -190,7 +191,7 @@ 取消 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue index e2c0066..7108668 100644 --- a/src/views/tested/MeasurementPlan/early/components/list.vue +++ b/src/views/tested/MeasurementPlan/early/components/list.vue @@ -2,6 +2,7 @@ diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 5ac5e8c..41df464 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -7,7 +7,7 @@ import technology from './technology.vue' import showPhoto from './showPhoto.vue' import certificateTable from './certificateTable.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' @@ -400,9 +400,16 @@ }) } } +// 上传 const upload = () => { fileRef.value.click() } +// 删除上传的文件 +const deleteFile = (fileName: string) => { + const data = ruleForm.value.instructionsFile.split(',') + const filterData = data.filter(item => item !== fileName) + ruleForm.value.instructionsFile = filterData.length ? filterData.join(',') : '' +} const print = () => { } @@ -429,7 +436,7 @@ 保存 - + 删除 @@ -592,7 +599,7 @@ - + 上传 diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue index e2ff0c5..f65e207 100644 --- a/src/views/tested/device/info/components/list.vue +++ b/src/views/tested/device/info/components/list.vue @@ -5,7 +5,7 @@ import type { IlistObjType, IlistQueryType } from './interface' import { delTextBtn, editTextBtn } from '@/utils/applyBtns' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, submitInfo } from '@/api/eqpt/device/info' +import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' @@ -71,7 +71,7 @@ }, { text: '计量标识', - value: 'meterIdentify', + value: 'meterIdentifyName', align: 'center', }, { @@ -136,6 +136,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch((_) => { + listLoading.value = false }) } // 获取使用状态列表 @@ -269,6 +271,39 @@ ElMessage.warning('无可导出内容') } } +const fileRef = ref() // 文件上传input,获取input的引用 +const onFileChange = (event: any) => { + // 原生上传 + // console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('file', event.target.files[0]) + // fd.append('equipmentType', $props.equipmentType) + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + importDevice(fd, $props.equipmentType).then((res) => { + if (res.code === 200) { + ElMessage.success('上传成功') + loading.close() + fetchData(true) + } + else { + // ElMessage.error(res.message) + loading.close() + } + }).catch((err) => { + ElMessage.error(err.message) + loading.close() + }) + } +} +// 导入 +const importList = () => { + fileRef.value.click() +} // 详情 const detail = (row: IlistObjType) => { if ($props.statusName === '草稿箱' || $props.statusName === '未通过' || $props.statusName === '已取消') { @@ -399,13 +434,15 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() - tableFlage.value = true + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + tableFlage.value = true + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/device/info/edit', @@ -452,9 +489,10 @@ - + + 删除 - diff --git a/src/views/tested/device/info/components/showPhoto.vue b/src/views/tested/device/info/components/showPhoto.vue index 0d50813..3af1845 100644 --- a/src/views/tested/device/info/components/showPhoto.vue +++ b/src/views/tested/device/info/components/showPhoto.vue @@ -15,6 +15,8 @@ default: '100px', }, }) +const $emits = defineEmits(['delete']) +const $route = useRoute() const urlList = ref() const getPhoto = () => { if (props.minioFileName) { @@ -34,6 +36,9 @@ }) }) } + else { + urlList.value = [] + } } onMounted(() => { @@ -45,31 +50,87 @@ // onUpdated(() => { // }) +const close = (fileName: string) => { + $emits('delete', fileName) +} diff --git a/src/views/tested/device/info/index.vue b/src/views/tested/device/info/index.vue index 2c356f4..d2daff4 100644 --- a/src/views/tested/device/info/index.vue +++ b/src/views/tested/device/info/index.vue @@ -51,6 +51,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem(`deviceBaseInfoMenu-${$props.equipmentType}`) || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 8998561..84b23ea 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -524,18 +524,6 @@ }, }, { - path: '/dremindlist/:type', - name: 'DremindlistEdit', - component: () => import('@/views/tested/device/remind/components/edit.vue'), - meta: { - title: '到期提醒编辑', - auth: '/tested/device/remind', - sidebar: false, - breadcrumb: false, - activeMenu: '/dremindlist', - }, - }, - { path: '/dremindlist/detail', name: 'dremindlistDetail', component: () => import('@/views/tested/device/info/components/detail.vue'), diff --git a/src/utils/applyBtns.ts b/src/utils/applyBtns.ts index e08ffe1..aca300d 100644 --- a/src/utils/applyBtns.ts +++ b/src/utils/applyBtns.ts @@ -34,7 +34,7 @@ export const delTextBtn = (applyStatus: string) => { switch (applyStatus) { case '全部': - return true + return false break case '已审批': return false @@ -65,7 +65,7 @@ // 编辑页面中编辑按钮 export const editBtn = (applyStatus: string, type: string) => { if (applyStatus === '审批' && type === 'detail') { - return true + return false } else if (applyStatus === '草稿箱' && type === 'detail') { return true diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index b6cd934..87ad108 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -9,8 +9,8 @@ SUBCONTRACTOR_APPROVAL = 'fbfmlgl', // 分包方名录管理 SUBCONTRACT_REVIEW_APPROVAL = 'fbfpsbgl', // 分包方评审表 EQUIPMENT_SEALED_APPROVAL = 'sbfcsq', // 设备封存申请 - EQUIPMENT_UNSEALED_APPROVAL = 'sbgfsq', // 设备启封由请 + EQUIPMENT_UNSEALED_APPROVAL = 'sbqfsq', // 设备启封由请 EQUIPMENT_DISABLE_APPROVAL = 'sbjysq', // 设备禁用申请 EQUIPMENT_SCRAP_APPROVAL = 'sbbfsq', // 设备报废申请 - EQUIPMENT_DELAY_APPROVAL = 'sbyysq"', // 设备延用申请 + EQUIPMENT_DELAY_APPROVAL = 'sbyysq', // 设备延用申请 } diff --git a/src/views/system/label/list.vue b/src/views/system/label/list.vue index 2f617ae..9285675 100644 --- a/src/views/system/label/list.vue +++ b/src/views/system/label/list.vue @@ -103,7 +103,8 @@ ElMessage.error(res.message) loading.close() } - }).catch((_) => { + }).catch((err) => { + ElMessage.error(err.message) loading.close() }) } diff --git a/src/views/tested/MeasurementPlan/early/components/detail.vue b/src/views/tested/MeasurementPlan/early/components/detail.vue index 8eb6425..dac24d6 100644 --- a/src/views/tested/MeasurementPlan/early/components/detail.vue +++ b/src/views/tested/MeasurementPlan/early/components/detail.vue @@ -2,7 +2,7 @@ import { ElMessage, ElMessageBox } from 'element-plus' import baseInfo from './edit.vue' import ApprovalDialog from './ApprovalDialog.vue' -import { editBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn } from '@/utils/applyBtns' import { cancelApply, delApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const activeName = ref('基本信息') @@ -76,7 +76,7 @@ 编辑 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/edit.vue b/src/views/tested/MeasurementPlan/early/components/edit.vue index 2fe4276..dc6109a 100644 --- a/src/views/tested/MeasurementPlan/early/components/edit.vue +++ b/src/views/tested/MeasurementPlan/early/components/edit.vue @@ -4,10 +4,11 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import dayjs from 'dayjs' import planList from './table.vue' +import approvalDialog from './ApprovalDialog.vue' import { getDictByCode } from '@/api/system/dict' import useUserStore from '@/store/modules/user' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { cancelApply, delApply, detailApply, editApply, submitApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const $router = useRouter() @@ -190,7 +191,7 @@ 取消 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue index e2c0066..7108668 100644 --- a/src/views/tested/MeasurementPlan/early/components/list.vue +++ b/src/views/tested/MeasurementPlan/early/components/list.vue @@ -2,6 +2,7 @@ diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 5ac5e8c..41df464 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -7,7 +7,7 @@ import technology from './technology.vue' import showPhoto from './showPhoto.vue' import certificateTable from './certificateTable.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' @@ -400,9 +400,16 @@ }) } } +// 上传 const upload = () => { fileRef.value.click() } +// 删除上传的文件 +const deleteFile = (fileName: string) => { + const data = ruleForm.value.instructionsFile.split(',') + const filterData = data.filter(item => item !== fileName) + ruleForm.value.instructionsFile = filterData.length ? filterData.join(',') : '' +} const print = () => { } @@ -429,7 +436,7 @@ 保存 - + 删除 @@ -592,7 +599,7 @@ - + 上传 diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue index e2ff0c5..f65e207 100644 --- a/src/views/tested/device/info/components/list.vue +++ b/src/views/tested/device/info/components/list.vue @@ -5,7 +5,7 @@ import type { IlistObjType, IlistQueryType } from './interface' import { delTextBtn, editTextBtn } from '@/utils/applyBtns' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, submitInfo } from '@/api/eqpt/device/info' +import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' @@ -71,7 +71,7 @@ }, { text: '计量标识', - value: 'meterIdentify', + value: 'meterIdentifyName', align: 'center', }, { @@ -136,6 +136,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch((_) => { + listLoading.value = false }) } // 获取使用状态列表 @@ -269,6 +271,39 @@ ElMessage.warning('无可导出内容') } } +const fileRef = ref() // 文件上传input,获取input的引用 +const onFileChange = (event: any) => { + // 原生上传 + // console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('file', event.target.files[0]) + // fd.append('equipmentType', $props.equipmentType) + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + importDevice(fd, $props.equipmentType).then((res) => { + if (res.code === 200) { + ElMessage.success('上传成功') + loading.close() + fetchData(true) + } + else { + // ElMessage.error(res.message) + loading.close() + } + }).catch((err) => { + ElMessage.error(err.message) + loading.close() + }) + } +} +// 导入 +const importList = () => { + fileRef.value.click() +} // 详情 const detail = (row: IlistObjType) => { if ($props.statusName === '草稿箱' || $props.statusName === '未通过' || $props.statusName === '已取消') { @@ -399,13 +434,15 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() - tableFlage.value = true + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + tableFlage.value = true + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/device/info/edit', @@ -452,9 +489,10 @@ - + + 删除 - diff --git a/src/views/tested/device/info/components/showPhoto.vue b/src/views/tested/device/info/components/showPhoto.vue index 0d50813..3af1845 100644 --- a/src/views/tested/device/info/components/showPhoto.vue +++ b/src/views/tested/device/info/components/showPhoto.vue @@ -15,6 +15,8 @@ default: '100px', }, }) +const $emits = defineEmits(['delete']) +const $route = useRoute() const urlList = ref() const getPhoto = () => { if (props.minioFileName) { @@ -34,6 +36,9 @@ }) }) } + else { + urlList.value = [] + } } onMounted(() => { @@ -45,31 +50,87 @@ // onUpdated(() => { // }) +const close = (fileName: string) => { + $emits('delete', fileName) +} diff --git a/src/views/tested/device/info/index.vue b/src/views/tested/device/info/index.vue index 2c356f4..d2daff4 100644 --- a/src/views/tested/device/info/index.vue +++ b/src/views/tested/device/info/index.vue @@ -51,6 +51,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem(`deviceBaseInfoMenu-${$props.equipmentType}`) || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/views/tested/status/delay/components/edit.vue b/src/views/tested/status/delay/components/edit.vue index ca7d003..e4d5dde 100644 --- a/src/views/tested/status/delay/components/edit.vue +++ b/src/views/tested/status/delay/components/edit.vue @@ -9,7 +9,7 @@ import useUserStore from '@/store/modules/user' import { cancelStatus, deleteStatus, detailStatus, editStatus, submitStatus } from '@/api/eqpt/status/index' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getInfoDetail } from '@/api/eqpt/device/info' const $route = useRoute() const $router = useRouter() @@ -288,7 +288,7 @@ 保存 - + 删除 diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 8998561..84b23ea 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -524,18 +524,6 @@ }, }, { - path: '/dremindlist/:type', - name: 'DremindlistEdit', - component: () => import('@/views/tested/device/remind/components/edit.vue'), - meta: { - title: '到期提醒编辑', - auth: '/tested/device/remind', - sidebar: false, - breadcrumb: false, - activeMenu: '/dremindlist', - }, - }, - { path: '/dremindlist/detail', name: 'dremindlistDetail', component: () => import('@/views/tested/device/info/components/detail.vue'), diff --git a/src/utils/applyBtns.ts b/src/utils/applyBtns.ts index e08ffe1..aca300d 100644 --- a/src/utils/applyBtns.ts +++ b/src/utils/applyBtns.ts @@ -34,7 +34,7 @@ export const delTextBtn = (applyStatus: string) => { switch (applyStatus) { case '全部': - return true + return false break case '已审批': return false @@ -65,7 +65,7 @@ // 编辑页面中编辑按钮 export const editBtn = (applyStatus: string, type: string) => { if (applyStatus === '审批' && type === 'detail') { - return true + return false } else if (applyStatus === '草稿箱' && type === 'detail') { return true diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index b6cd934..87ad108 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -9,8 +9,8 @@ SUBCONTRACTOR_APPROVAL = 'fbfmlgl', // 分包方名录管理 SUBCONTRACT_REVIEW_APPROVAL = 'fbfpsbgl', // 分包方评审表 EQUIPMENT_SEALED_APPROVAL = 'sbfcsq', // 设备封存申请 - EQUIPMENT_UNSEALED_APPROVAL = 'sbgfsq', // 设备启封由请 + EQUIPMENT_UNSEALED_APPROVAL = 'sbqfsq', // 设备启封由请 EQUIPMENT_DISABLE_APPROVAL = 'sbjysq', // 设备禁用申请 EQUIPMENT_SCRAP_APPROVAL = 'sbbfsq', // 设备报废申请 - EQUIPMENT_DELAY_APPROVAL = 'sbyysq"', // 设备延用申请 + EQUIPMENT_DELAY_APPROVAL = 'sbyysq', // 设备延用申请 } diff --git a/src/views/system/label/list.vue b/src/views/system/label/list.vue index 2f617ae..9285675 100644 --- a/src/views/system/label/list.vue +++ b/src/views/system/label/list.vue @@ -103,7 +103,8 @@ ElMessage.error(res.message) loading.close() } - }).catch((_) => { + }).catch((err) => { + ElMessage.error(err.message) loading.close() }) } diff --git a/src/views/tested/MeasurementPlan/early/components/detail.vue b/src/views/tested/MeasurementPlan/early/components/detail.vue index 8eb6425..dac24d6 100644 --- a/src/views/tested/MeasurementPlan/early/components/detail.vue +++ b/src/views/tested/MeasurementPlan/early/components/detail.vue @@ -2,7 +2,7 @@ import { ElMessage, ElMessageBox } from 'element-plus' import baseInfo from './edit.vue' import ApprovalDialog from './ApprovalDialog.vue' -import { editBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn } from '@/utils/applyBtns' import { cancelApply, delApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const activeName = ref('基本信息') @@ -76,7 +76,7 @@ 编辑 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/edit.vue b/src/views/tested/MeasurementPlan/early/components/edit.vue index 2fe4276..dc6109a 100644 --- a/src/views/tested/MeasurementPlan/early/components/edit.vue +++ b/src/views/tested/MeasurementPlan/early/components/edit.vue @@ -4,10 +4,11 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import dayjs from 'dayjs' import planList from './table.vue' +import approvalDialog from './ApprovalDialog.vue' import { getDictByCode } from '@/api/system/dict' import useUserStore from '@/store/modules/user' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { cancelApply, delApply, detailApply, editApply, submitApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const $router = useRouter() @@ -190,7 +191,7 @@ 取消 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue index e2c0066..7108668 100644 --- a/src/views/tested/MeasurementPlan/early/components/list.vue +++ b/src/views/tested/MeasurementPlan/early/components/list.vue @@ -2,6 +2,7 @@ diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 5ac5e8c..41df464 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -7,7 +7,7 @@ import technology from './technology.vue' import showPhoto from './showPhoto.vue' import certificateTable from './certificateTable.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' @@ -400,9 +400,16 @@ }) } } +// 上传 const upload = () => { fileRef.value.click() } +// 删除上传的文件 +const deleteFile = (fileName: string) => { + const data = ruleForm.value.instructionsFile.split(',') + const filterData = data.filter(item => item !== fileName) + ruleForm.value.instructionsFile = filterData.length ? filterData.join(',') : '' +} const print = () => { } @@ -429,7 +436,7 @@ 保存 - + 删除 @@ -592,7 +599,7 @@ - + 上传 diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue index e2ff0c5..f65e207 100644 --- a/src/views/tested/device/info/components/list.vue +++ b/src/views/tested/device/info/components/list.vue @@ -5,7 +5,7 @@ import type { IlistObjType, IlistQueryType } from './interface' import { delTextBtn, editTextBtn } from '@/utils/applyBtns' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, submitInfo } from '@/api/eqpt/device/info' +import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' @@ -71,7 +71,7 @@ }, { text: '计量标识', - value: 'meterIdentify', + value: 'meterIdentifyName', align: 'center', }, { @@ -136,6 +136,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch((_) => { + listLoading.value = false }) } // 获取使用状态列表 @@ -269,6 +271,39 @@ ElMessage.warning('无可导出内容') } } +const fileRef = ref() // 文件上传input,获取input的引用 +const onFileChange = (event: any) => { + // 原生上传 + // console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('file', event.target.files[0]) + // fd.append('equipmentType', $props.equipmentType) + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + importDevice(fd, $props.equipmentType).then((res) => { + if (res.code === 200) { + ElMessage.success('上传成功') + loading.close() + fetchData(true) + } + else { + // ElMessage.error(res.message) + loading.close() + } + }).catch((err) => { + ElMessage.error(err.message) + loading.close() + }) + } +} +// 导入 +const importList = () => { + fileRef.value.click() +} // 详情 const detail = (row: IlistObjType) => { if ($props.statusName === '草稿箱' || $props.statusName === '未通过' || $props.statusName === '已取消') { @@ -399,13 +434,15 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() - tableFlage.value = true + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + tableFlage.value = true + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/device/info/edit', @@ -452,9 +489,10 @@ - + + 删除 - diff --git a/src/views/tested/device/info/components/showPhoto.vue b/src/views/tested/device/info/components/showPhoto.vue index 0d50813..3af1845 100644 --- a/src/views/tested/device/info/components/showPhoto.vue +++ b/src/views/tested/device/info/components/showPhoto.vue @@ -15,6 +15,8 @@ default: '100px', }, }) +const $emits = defineEmits(['delete']) +const $route = useRoute() const urlList = ref() const getPhoto = () => { if (props.minioFileName) { @@ -34,6 +36,9 @@ }) }) } + else { + urlList.value = [] + } } onMounted(() => { @@ -45,31 +50,87 @@ // onUpdated(() => { // }) +const close = (fileName: string) => { + $emits('delete', fileName) +} diff --git a/src/views/tested/device/info/index.vue b/src/views/tested/device/info/index.vue index 2c356f4..d2daff4 100644 --- a/src/views/tested/device/info/index.vue +++ b/src/views/tested/device/info/index.vue @@ -51,6 +51,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem(`deviceBaseInfoMenu-${$props.equipmentType}`) || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/views/tested/status/delay/components/edit.vue b/src/views/tested/status/delay/components/edit.vue index ca7d003..e4d5dde 100644 --- a/src/views/tested/status/delay/components/edit.vue +++ b/src/views/tested/status/delay/components/edit.vue @@ -9,7 +9,7 @@ import useUserStore from '@/store/modules/user' import { cancelStatus, deleteStatus, detailStatus, editStatus, submitStatus } from '@/api/eqpt/status/index' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getInfoDetail } from '@/api/eqpt/device/info' const $route = useRoute() const $router = useRouter() @@ -288,7 +288,7 @@ 保存 - + 删除 diff --git a/src/views/tested/status/delay/components/list.vue b/src/views/tested/status/delay/components/list.vue index 5603bf1..52dd76b 100644 --- a/src/views/tested/status/delay/components/list.vue +++ b/src/views/tested/status/delay/components/list.vue @@ -111,6 +111,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch(() => { + listLoading.value = false }) } // 查询数据 @@ -212,7 +214,7 @@ type: 'warning', }, ).then((res) => { - submitStatus({ id: row.id, formId: SCHEDULE.METERING_PLAN_APPROVAL }).then((res) => { + submitStatus({ id: row.id, formId: formIdDict.value[Number($props.statusType)] }).then((res) => { ElMessage.success('已提交') search() }) @@ -225,12 +227,14 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/pmetering/plan/edit', diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 8998561..84b23ea 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -524,18 +524,6 @@ }, }, { - path: '/dremindlist/:type', - name: 'DremindlistEdit', - component: () => import('@/views/tested/device/remind/components/edit.vue'), - meta: { - title: '到期提醒编辑', - auth: '/tested/device/remind', - sidebar: false, - breadcrumb: false, - activeMenu: '/dremindlist', - }, - }, - { path: '/dremindlist/detail', name: 'dremindlistDetail', component: () => import('@/views/tested/device/info/components/detail.vue'), diff --git a/src/utils/applyBtns.ts b/src/utils/applyBtns.ts index e08ffe1..aca300d 100644 --- a/src/utils/applyBtns.ts +++ b/src/utils/applyBtns.ts @@ -34,7 +34,7 @@ export const delTextBtn = (applyStatus: string) => { switch (applyStatus) { case '全部': - return true + return false break case '已审批': return false @@ -65,7 +65,7 @@ // 编辑页面中编辑按钮 export const editBtn = (applyStatus: string, type: string) => { if (applyStatus === '审批' && type === 'detail') { - return true + return false } else if (applyStatus === '草稿箱' && type === 'detail') { return true diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index b6cd934..87ad108 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -9,8 +9,8 @@ SUBCONTRACTOR_APPROVAL = 'fbfmlgl', // 分包方名录管理 SUBCONTRACT_REVIEW_APPROVAL = 'fbfpsbgl', // 分包方评审表 EQUIPMENT_SEALED_APPROVAL = 'sbfcsq', // 设备封存申请 - EQUIPMENT_UNSEALED_APPROVAL = 'sbgfsq', // 设备启封由请 + EQUIPMENT_UNSEALED_APPROVAL = 'sbqfsq', // 设备启封由请 EQUIPMENT_DISABLE_APPROVAL = 'sbjysq', // 设备禁用申请 EQUIPMENT_SCRAP_APPROVAL = 'sbbfsq', // 设备报废申请 - EQUIPMENT_DELAY_APPROVAL = 'sbyysq"', // 设备延用申请 + EQUIPMENT_DELAY_APPROVAL = 'sbyysq', // 设备延用申请 } diff --git a/src/views/system/label/list.vue b/src/views/system/label/list.vue index 2f617ae..9285675 100644 --- a/src/views/system/label/list.vue +++ b/src/views/system/label/list.vue @@ -103,7 +103,8 @@ ElMessage.error(res.message) loading.close() } - }).catch((_) => { + }).catch((err) => { + ElMessage.error(err.message) loading.close() }) } diff --git a/src/views/tested/MeasurementPlan/early/components/detail.vue b/src/views/tested/MeasurementPlan/early/components/detail.vue index 8eb6425..dac24d6 100644 --- a/src/views/tested/MeasurementPlan/early/components/detail.vue +++ b/src/views/tested/MeasurementPlan/early/components/detail.vue @@ -2,7 +2,7 @@ import { ElMessage, ElMessageBox } from 'element-plus' import baseInfo from './edit.vue' import ApprovalDialog from './ApprovalDialog.vue' -import { editBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn } from '@/utils/applyBtns' import { cancelApply, delApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const activeName = ref('基本信息') @@ -76,7 +76,7 @@ 编辑 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/edit.vue b/src/views/tested/MeasurementPlan/early/components/edit.vue index 2fe4276..dc6109a 100644 --- a/src/views/tested/MeasurementPlan/early/components/edit.vue +++ b/src/views/tested/MeasurementPlan/early/components/edit.vue @@ -4,10 +4,11 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import dayjs from 'dayjs' import planList from './table.vue' +import approvalDialog from './ApprovalDialog.vue' import { getDictByCode } from '@/api/system/dict' import useUserStore from '@/store/modules/user' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { cancelApply, delApply, detailApply, editApply, submitApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const $router = useRouter() @@ -190,7 +191,7 @@ 取消 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue index e2c0066..7108668 100644 --- a/src/views/tested/MeasurementPlan/early/components/list.vue +++ b/src/views/tested/MeasurementPlan/early/components/list.vue @@ -2,6 +2,7 @@ diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 5ac5e8c..41df464 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -7,7 +7,7 @@ import technology from './technology.vue' import showPhoto from './showPhoto.vue' import certificateTable from './certificateTable.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' @@ -400,9 +400,16 @@ }) } } +// 上传 const upload = () => { fileRef.value.click() } +// 删除上传的文件 +const deleteFile = (fileName: string) => { + const data = ruleForm.value.instructionsFile.split(',') + const filterData = data.filter(item => item !== fileName) + ruleForm.value.instructionsFile = filterData.length ? filterData.join(',') : '' +} const print = () => { } @@ -429,7 +436,7 @@ 保存 - + 删除 @@ -592,7 +599,7 @@ - + 上传 diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue index e2ff0c5..f65e207 100644 --- a/src/views/tested/device/info/components/list.vue +++ b/src/views/tested/device/info/components/list.vue @@ -5,7 +5,7 @@ import type { IlistObjType, IlistQueryType } from './interface' import { delTextBtn, editTextBtn } from '@/utils/applyBtns' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, submitInfo } from '@/api/eqpt/device/info' +import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' @@ -71,7 +71,7 @@ }, { text: '计量标识', - value: 'meterIdentify', + value: 'meterIdentifyName', align: 'center', }, { @@ -136,6 +136,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch((_) => { + listLoading.value = false }) } // 获取使用状态列表 @@ -269,6 +271,39 @@ ElMessage.warning('无可导出内容') } } +const fileRef = ref() // 文件上传input,获取input的引用 +const onFileChange = (event: any) => { + // 原生上传 + // console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('file', event.target.files[0]) + // fd.append('equipmentType', $props.equipmentType) + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + importDevice(fd, $props.equipmentType).then((res) => { + if (res.code === 200) { + ElMessage.success('上传成功') + loading.close() + fetchData(true) + } + else { + // ElMessage.error(res.message) + loading.close() + } + }).catch((err) => { + ElMessage.error(err.message) + loading.close() + }) + } +} +// 导入 +const importList = () => { + fileRef.value.click() +} // 详情 const detail = (row: IlistObjType) => { if ($props.statusName === '草稿箱' || $props.statusName === '未通过' || $props.statusName === '已取消') { @@ -399,13 +434,15 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() - tableFlage.value = true + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + tableFlage.value = true + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/device/info/edit', @@ -452,9 +489,10 @@ - + + 删除 - diff --git a/src/views/tested/device/info/components/showPhoto.vue b/src/views/tested/device/info/components/showPhoto.vue index 0d50813..3af1845 100644 --- a/src/views/tested/device/info/components/showPhoto.vue +++ b/src/views/tested/device/info/components/showPhoto.vue @@ -15,6 +15,8 @@ default: '100px', }, }) +const $emits = defineEmits(['delete']) +const $route = useRoute() const urlList = ref() const getPhoto = () => { if (props.minioFileName) { @@ -34,6 +36,9 @@ }) }) } + else { + urlList.value = [] + } } onMounted(() => { @@ -45,31 +50,87 @@ // onUpdated(() => { // }) +const close = (fileName: string) => { + $emits('delete', fileName) +} diff --git a/src/views/tested/device/info/index.vue b/src/views/tested/device/info/index.vue index 2c356f4..d2daff4 100644 --- a/src/views/tested/device/info/index.vue +++ b/src/views/tested/device/info/index.vue @@ -51,6 +51,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem(`deviceBaseInfoMenu-${$props.equipmentType}`) || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/views/tested/status/delay/components/edit.vue b/src/views/tested/status/delay/components/edit.vue index ca7d003..e4d5dde 100644 --- a/src/views/tested/status/delay/components/edit.vue +++ b/src/views/tested/status/delay/components/edit.vue @@ -9,7 +9,7 @@ import useUserStore from '@/store/modules/user' import { cancelStatus, deleteStatus, detailStatus, editStatus, submitStatus } from '@/api/eqpt/status/index' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getInfoDetail } from '@/api/eqpt/device/info' const $route = useRoute() const $router = useRouter() @@ -288,7 +288,7 @@ 保存 - + 删除 diff --git a/src/views/tested/status/delay/components/list.vue b/src/views/tested/status/delay/components/list.vue index 5603bf1..52dd76b 100644 --- a/src/views/tested/status/delay/components/list.vue +++ b/src/views/tested/status/delay/components/list.vue @@ -111,6 +111,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch(() => { + listLoading.value = false }) } // 查询数据 @@ -212,7 +214,7 @@ type: 'warning', }, ).then((res) => { - submitStatus({ id: row.id, formId: SCHEDULE.METERING_PLAN_APPROVAL }).then((res) => { + submitStatus({ id: row.id, formId: formIdDict.value[Number($props.statusType)] }).then((res) => { ElMessage.success('已提交') search() }) @@ -225,12 +227,14 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/pmetering/plan/edit', diff --git a/src/views/tested/status/delay/components/page.vue b/src/views/tested/status/delay/components/page.vue index dc880b9..ed76843 100644 --- a/src/views/tested/status/delay/components/page.vue +++ b/src/views/tested/status/delay/components/page.vue @@ -52,6 +52,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem(`deviceStatus-${$props.statusType}`) || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 8998561..84b23ea 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -524,18 +524,6 @@ }, }, { - path: '/dremindlist/:type', - name: 'DremindlistEdit', - component: () => import('@/views/tested/device/remind/components/edit.vue'), - meta: { - title: '到期提醒编辑', - auth: '/tested/device/remind', - sidebar: false, - breadcrumb: false, - activeMenu: '/dremindlist', - }, - }, - { path: '/dremindlist/detail', name: 'dremindlistDetail', component: () => import('@/views/tested/device/info/components/detail.vue'), diff --git a/src/utils/applyBtns.ts b/src/utils/applyBtns.ts index e08ffe1..aca300d 100644 --- a/src/utils/applyBtns.ts +++ b/src/utils/applyBtns.ts @@ -34,7 +34,7 @@ export const delTextBtn = (applyStatus: string) => { switch (applyStatus) { case '全部': - return true + return false break case '已审批': return false @@ -65,7 +65,7 @@ // 编辑页面中编辑按钮 export const editBtn = (applyStatus: string, type: string) => { if (applyStatus === '审批' && type === 'detail') { - return true + return false } else if (applyStatus === '草稿箱' && type === 'detail') { return true diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index b6cd934..87ad108 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -9,8 +9,8 @@ SUBCONTRACTOR_APPROVAL = 'fbfmlgl', // 分包方名录管理 SUBCONTRACT_REVIEW_APPROVAL = 'fbfpsbgl', // 分包方评审表 EQUIPMENT_SEALED_APPROVAL = 'sbfcsq', // 设备封存申请 - EQUIPMENT_UNSEALED_APPROVAL = 'sbgfsq', // 设备启封由请 + EQUIPMENT_UNSEALED_APPROVAL = 'sbqfsq', // 设备启封由请 EQUIPMENT_DISABLE_APPROVAL = 'sbjysq', // 设备禁用申请 EQUIPMENT_SCRAP_APPROVAL = 'sbbfsq', // 设备报废申请 - EQUIPMENT_DELAY_APPROVAL = 'sbyysq"', // 设备延用申请 + EQUIPMENT_DELAY_APPROVAL = 'sbyysq', // 设备延用申请 } diff --git a/src/views/system/label/list.vue b/src/views/system/label/list.vue index 2f617ae..9285675 100644 --- a/src/views/system/label/list.vue +++ b/src/views/system/label/list.vue @@ -103,7 +103,8 @@ ElMessage.error(res.message) loading.close() } - }).catch((_) => { + }).catch((err) => { + ElMessage.error(err.message) loading.close() }) } diff --git a/src/views/tested/MeasurementPlan/early/components/detail.vue b/src/views/tested/MeasurementPlan/early/components/detail.vue index 8eb6425..dac24d6 100644 --- a/src/views/tested/MeasurementPlan/early/components/detail.vue +++ b/src/views/tested/MeasurementPlan/early/components/detail.vue @@ -2,7 +2,7 @@ import { ElMessage, ElMessageBox } from 'element-plus' import baseInfo from './edit.vue' import ApprovalDialog from './ApprovalDialog.vue' -import { editBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn } from '@/utils/applyBtns' import { cancelApply, delApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const activeName = ref('基本信息') @@ -76,7 +76,7 @@ 编辑 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/edit.vue b/src/views/tested/MeasurementPlan/early/components/edit.vue index 2fe4276..dc6109a 100644 --- a/src/views/tested/MeasurementPlan/early/components/edit.vue +++ b/src/views/tested/MeasurementPlan/early/components/edit.vue @@ -4,10 +4,11 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import dayjs from 'dayjs' import planList from './table.vue' +import approvalDialog from './ApprovalDialog.vue' import { getDictByCode } from '@/api/system/dict' import useUserStore from '@/store/modules/user' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { cancelApply, delApply, detailApply, editApply, submitApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const $router = useRouter() @@ -190,7 +191,7 @@ 取消 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue index e2c0066..7108668 100644 --- a/src/views/tested/MeasurementPlan/early/components/list.vue +++ b/src/views/tested/MeasurementPlan/early/components/list.vue @@ -2,6 +2,7 @@ diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 5ac5e8c..41df464 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -7,7 +7,7 @@ import technology from './technology.vue' import showPhoto from './showPhoto.vue' import certificateTable from './certificateTable.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' @@ -400,9 +400,16 @@ }) } } +// 上传 const upload = () => { fileRef.value.click() } +// 删除上传的文件 +const deleteFile = (fileName: string) => { + const data = ruleForm.value.instructionsFile.split(',') + const filterData = data.filter(item => item !== fileName) + ruleForm.value.instructionsFile = filterData.length ? filterData.join(',') : '' +} const print = () => { } @@ -429,7 +436,7 @@ 保存 - + 删除 @@ -592,7 +599,7 @@ - + 上传 diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue index e2ff0c5..f65e207 100644 --- a/src/views/tested/device/info/components/list.vue +++ b/src/views/tested/device/info/components/list.vue @@ -5,7 +5,7 @@ import type { IlistObjType, IlistQueryType } from './interface' import { delTextBtn, editTextBtn } from '@/utils/applyBtns' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, submitInfo } from '@/api/eqpt/device/info' +import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' @@ -71,7 +71,7 @@ }, { text: '计量标识', - value: 'meterIdentify', + value: 'meterIdentifyName', align: 'center', }, { @@ -136,6 +136,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch((_) => { + listLoading.value = false }) } // 获取使用状态列表 @@ -269,6 +271,39 @@ ElMessage.warning('无可导出内容') } } +const fileRef = ref() // 文件上传input,获取input的引用 +const onFileChange = (event: any) => { + // 原生上传 + // console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('file', event.target.files[0]) + // fd.append('equipmentType', $props.equipmentType) + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + importDevice(fd, $props.equipmentType).then((res) => { + if (res.code === 200) { + ElMessage.success('上传成功') + loading.close() + fetchData(true) + } + else { + // ElMessage.error(res.message) + loading.close() + } + }).catch((err) => { + ElMessage.error(err.message) + loading.close() + }) + } +} +// 导入 +const importList = () => { + fileRef.value.click() +} // 详情 const detail = (row: IlistObjType) => { if ($props.statusName === '草稿箱' || $props.statusName === '未通过' || $props.statusName === '已取消') { @@ -399,13 +434,15 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() - tableFlage.value = true + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + tableFlage.value = true + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/device/info/edit', @@ -452,9 +489,10 @@ - + + 删除 - diff --git a/src/views/tested/device/info/components/showPhoto.vue b/src/views/tested/device/info/components/showPhoto.vue index 0d50813..3af1845 100644 --- a/src/views/tested/device/info/components/showPhoto.vue +++ b/src/views/tested/device/info/components/showPhoto.vue @@ -15,6 +15,8 @@ default: '100px', }, }) +const $emits = defineEmits(['delete']) +const $route = useRoute() const urlList = ref() const getPhoto = () => { if (props.minioFileName) { @@ -34,6 +36,9 @@ }) }) } + else { + urlList.value = [] + } } onMounted(() => { @@ -45,31 +50,87 @@ // onUpdated(() => { // }) +const close = (fileName: string) => { + $emits('delete', fileName) +} diff --git a/src/views/tested/device/info/index.vue b/src/views/tested/device/info/index.vue index 2c356f4..d2daff4 100644 --- a/src/views/tested/device/info/index.vue +++ b/src/views/tested/device/info/index.vue @@ -51,6 +51,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem(`deviceBaseInfoMenu-${$props.equipmentType}`) || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/views/tested/status/delay/components/edit.vue b/src/views/tested/status/delay/components/edit.vue index ca7d003..e4d5dde 100644 --- a/src/views/tested/status/delay/components/edit.vue +++ b/src/views/tested/status/delay/components/edit.vue @@ -9,7 +9,7 @@ import useUserStore from '@/store/modules/user' import { cancelStatus, deleteStatus, detailStatus, editStatus, submitStatus } from '@/api/eqpt/status/index' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getInfoDetail } from '@/api/eqpt/device/info' const $route = useRoute() const $router = useRouter() @@ -288,7 +288,7 @@ 保存 - + 删除 diff --git a/src/views/tested/status/delay/components/list.vue b/src/views/tested/status/delay/components/list.vue index 5603bf1..52dd76b 100644 --- a/src/views/tested/status/delay/components/list.vue +++ b/src/views/tested/status/delay/components/list.vue @@ -111,6 +111,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch(() => { + listLoading.value = false }) } // 查询数据 @@ -212,7 +214,7 @@ type: 'warning', }, ).then((res) => { - submitStatus({ id: row.id, formId: SCHEDULE.METERING_PLAN_APPROVAL }).then((res) => { + submitStatus({ id: row.id, formId: formIdDict.value[Number($props.statusType)] }).then((res) => { ElMessage.success('已提交') search() }) @@ -225,12 +227,14 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/pmetering/plan/edit', diff --git a/src/views/tested/status/delay/components/page.vue b/src/views/tested/status/delay/components/page.vue index dc880b9..ed76843 100644 --- a/src/views/tested/status/delay/components/page.vue +++ b/src/views/tested/status/delay/components/page.vue @@ -52,6 +52,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem(`deviceStatus-${$props.statusType}`) || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/views/tested/subpackage/certificate/components/edit.vue b/src/views/tested/subpackage/certificate/components/edit.vue index 6e1db7b..243fe69 100644 --- a/src/views/tested/subpackage/certificate/components/edit.vue +++ b/src/views/tested/subpackage/certificate/components/edit.vue @@ -293,7 +293,7 @@ - + @@ -305,7 +305,7 @@ - + diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 8998561..84b23ea 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -524,18 +524,6 @@ }, }, { - path: '/dremindlist/:type', - name: 'DremindlistEdit', - component: () => import('@/views/tested/device/remind/components/edit.vue'), - meta: { - title: '到期提醒编辑', - auth: '/tested/device/remind', - sidebar: false, - breadcrumb: false, - activeMenu: '/dremindlist', - }, - }, - { path: '/dremindlist/detail', name: 'dremindlistDetail', component: () => import('@/views/tested/device/info/components/detail.vue'), diff --git a/src/utils/applyBtns.ts b/src/utils/applyBtns.ts index e08ffe1..aca300d 100644 --- a/src/utils/applyBtns.ts +++ b/src/utils/applyBtns.ts @@ -34,7 +34,7 @@ export const delTextBtn = (applyStatus: string) => { switch (applyStatus) { case '全部': - return true + return false break case '已审批': return false @@ -65,7 +65,7 @@ // 编辑页面中编辑按钮 export const editBtn = (applyStatus: string, type: string) => { if (applyStatus === '审批' && type === 'detail') { - return true + return false } else if (applyStatus === '草稿箱' && type === 'detail') { return true diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index b6cd934..87ad108 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -9,8 +9,8 @@ SUBCONTRACTOR_APPROVAL = 'fbfmlgl', // 分包方名录管理 SUBCONTRACT_REVIEW_APPROVAL = 'fbfpsbgl', // 分包方评审表 EQUIPMENT_SEALED_APPROVAL = 'sbfcsq', // 设备封存申请 - EQUIPMENT_UNSEALED_APPROVAL = 'sbgfsq', // 设备启封由请 + EQUIPMENT_UNSEALED_APPROVAL = 'sbqfsq', // 设备启封由请 EQUIPMENT_DISABLE_APPROVAL = 'sbjysq', // 设备禁用申请 EQUIPMENT_SCRAP_APPROVAL = 'sbbfsq', // 设备报废申请 - EQUIPMENT_DELAY_APPROVAL = 'sbyysq"', // 设备延用申请 + EQUIPMENT_DELAY_APPROVAL = 'sbyysq', // 设备延用申请 } diff --git a/src/views/system/label/list.vue b/src/views/system/label/list.vue index 2f617ae..9285675 100644 --- a/src/views/system/label/list.vue +++ b/src/views/system/label/list.vue @@ -103,7 +103,8 @@ ElMessage.error(res.message) loading.close() } - }).catch((_) => { + }).catch((err) => { + ElMessage.error(err.message) loading.close() }) } diff --git a/src/views/tested/MeasurementPlan/early/components/detail.vue b/src/views/tested/MeasurementPlan/early/components/detail.vue index 8eb6425..dac24d6 100644 --- a/src/views/tested/MeasurementPlan/early/components/detail.vue +++ b/src/views/tested/MeasurementPlan/early/components/detail.vue @@ -2,7 +2,7 @@ import { ElMessage, ElMessageBox } from 'element-plus' import baseInfo from './edit.vue' import ApprovalDialog from './ApprovalDialog.vue' -import { editBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn } from '@/utils/applyBtns' import { cancelApply, delApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const activeName = ref('基本信息') @@ -76,7 +76,7 @@ 编辑 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/edit.vue b/src/views/tested/MeasurementPlan/early/components/edit.vue index 2fe4276..dc6109a 100644 --- a/src/views/tested/MeasurementPlan/early/components/edit.vue +++ b/src/views/tested/MeasurementPlan/early/components/edit.vue @@ -4,10 +4,11 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import dayjs from 'dayjs' import planList from './table.vue' +import approvalDialog from './ApprovalDialog.vue' import { getDictByCode } from '@/api/system/dict' import useUserStore from '@/store/modules/user' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { cancelApply, delApply, detailApply, editApply, submitApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const $router = useRouter() @@ -190,7 +191,7 @@ 取消 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue index e2c0066..7108668 100644 --- a/src/views/tested/MeasurementPlan/early/components/list.vue +++ b/src/views/tested/MeasurementPlan/early/components/list.vue @@ -2,6 +2,7 @@ diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 5ac5e8c..41df464 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -7,7 +7,7 @@ import technology from './technology.vue' import showPhoto from './showPhoto.vue' import certificateTable from './certificateTable.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' @@ -400,9 +400,16 @@ }) } } +// 上传 const upload = () => { fileRef.value.click() } +// 删除上传的文件 +const deleteFile = (fileName: string) => { + const data = ruleForm.value.instructionsFile.split(',') + const filterData = data.filter(item => item !== fileName) + ruleForm.value.instructionsFile = filterData.length ? filterData.join(',') : '' +} const print = () => { } @@ -429,7 +436,7 @@ 保存 - + 删除 @@ -592,7 +599,7 @@ - + 上传 diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue index e2ff0c5..f65e207 100644 --- a/src/views/tested/device/info/components/list.vue +++ b/src/views/tested/device/info/components/list.vue @@ -5,7 +5,7 @@ import type { IlistObjType, IlistQueryType } from './interface' import { delTextBtn, editTextBtn } from '@/utils/applyBtns' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, submitInfo } from '@/api/eqpt/device/info' +import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' @@ -71,7 +71,7 @@ }, { text: '计量标识', - value: 'meterIdentify', + value: 'meterIdentifyName', align: 'center', }, { @@ -136,6 +136,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch((_) => { + listLoading.value = false }) } // 获取使用状态列表 @@ -269,6 +271,39 @@ ElMessage.warning('无可导出内容') } } +const fileRef = ref() // 文件上传input,获取input的引用 +const onFileChange = (event: any) => { + // 原生上传 + // console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('file', event.target.files[0]) + // fd.append('equipmentType', $props.equipmentType) + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + importDevice(fd, $props.equipmentType).then((res) => { + if (res.code === 200) { + ElMessage.success('上传成功') + loading.close() + fetchData(true) + } + else { + // ElMessage.error(res.message) + loading.close() + } + }).catch((err) => { + ElMessage.error(err.message) + loading.close() + }) + } +} +// 导入 +const importList = () => { + fileRef.value.click() +} // 详情 const detail = (row: IlistObjType) => { if ($props.statusName === '草稿箱' || $props.statusName === '未通过' || $props.statusName === '已取消') { @@ -399,13 +434,15 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() - tableFlage.value = true + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + tableFlage.value = true + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/device/info/edit', @@ -452,9 +489,10 @@ - + + 删除 - diff --git a/src/views/tested/device/info/components/showPhoto.vue b/src/views/tested/device/info/components/showPhoto.vue index 0d50813..3af1845 100644 --- a/src/views/tested/device/info/components/showPhoto.vue +++ b/src/views/tested/device/info/components/showPhoto.vue @@ -15,6 +15,8 @@ default: '100px', }, }) +const $emits = defineEmits(['delete']) +const $route = useRoute() const urlList = ref() const getPhoto = () => { if (props.minioFileName) { @@ -34,6 +36,9 @@ }) }) } + else { + urlList.value = [] + } } onMounted(() => { @@ -45,31 +50,87 @@ // onUpdated(() => { // }) +const close = (fileName: string) => { + $emits('delete', fileName) +} diff --git a/src/views/tested/device/info/index.vue b/src/views/tested/device/info/index.vue index 2c356f4..d2daff4 100644 --- a/src/views/tested/device/info/index.vue +++ b/src/views/tested/device/info/index.vue @@ -51,6 +51,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem(`deviceBaseInfoMenu-${$props.equipmentType}`) || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/views/tested/status/delay/components/edit.vue b/src/views/tested/status/delay/components/edit.vue index ca7d003..e4d5dde 100644 --- a/src/views/tested/status/delay/components/edit.vue +++ b/src/views/tested/status/delay/components/edit.vue @@ -9,7 +9,7 @@ import useUserStore from '@/store/modules/user' import { cancelStatus, deleteStatus, detailStatus, editStatus, submitStatus } from '@/api/eqpt/status/index' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getInfoDetail } from '@/api/eqpt/device/info' const $route = useRoute() const $router = useRouter() @@ -288,7 +288,7 @@ 保存 - + 删除 diff --git a/src/views/tested/status/delay/components/list.vue b/src/views/tested/status/delay/components/list.vue index 5603bf1..52dd76b 100644 --- a/src/views/tested/status/delay/components/list.vue +++ b/src/views/tested/status/delay/components/list.vue @@ -111,6 +111,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch(() => { + listLoading.value = false }) } // 查询数据 @@ -212,7 +214,7 @@ type: 'warning', }, ).then((res) => { - submitStatus({ id: row.id, formId: SCHEDULE.METERING_PLAN_APPROVAL }).then((res) => { + submitStatus({ id: row.id, formId: formIdDict.value[Number($props.statusType)] }).then((res) => { ElMessage.success('已提交') search() }) @@ -225,12 +227,14 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/pmetering/plan/edit', diff --git a/src/views/tested/status/delay/components/page.vue b/src/views/tested/status/delay/components/page.vue index dc880b9..ed76843 100644 --- a/src/views/tested/status/delay/components/page.vue +++ b/src/views/tested/status/delay/components/page.vue @@ -52,6 +52,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem(`deviceStatus-${$props.statusType}`) || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/views/tested/subpackage/certificate/components/edit.vue b/src/views/tested/subpackage/certificate/components/edit.vue index 6e1db7b..243fe69 100644 --- a/src/views/tested/subpackage/certificate/components/edit.vue +++ b/src/views/tested/subpackage/certificate/components/edit.vue @@ -293,7 +293,7 @@ - + @@ -305,7 +305,7 @@ - + diff --git a/src/views/tested/subpackage/directory/components/edit.vue b/src/views/tested/subpackage/directory/components/edit.vue index db7fd5e..89c614f 100644 --- a/src/views/tested/subpackage/directory/components/edit.vue +++ b/src/views/tested/subpackage/directory/components/edit.vue @@ -8,7 +8,7 @@ import certificateTable from './certificateTable.vue' import ApprovalDialog from './ApprovalDialog.vue' import showPhoto from '@/views/tested/device/info/components/showPhoto.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { uploadApi } from '@/api/system/notice' @@ -351,9 +351,16 @@ }) } } +// 上传 const upload = () => { fileRef.value.click() } +// 删除上传的文件 +const deleteFile = (fileName: string) => { + const data = ruleForm.value.attachments.split(',') + const filterData = data.filter(item => item !== fileName) + ruleForm.value.attachments = filterData.length ? filterData.join(',') : '' +} const print = () => { } @@ -380,7 +387,7 @@ 保存 - + 删除 @@ -551,7 +558,7 @@ - + 上传 diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 8998561..84b23ea 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -524,18 +524,6 @@ }, }, { - path: '/dremindlist/:type', - name: 'DremindlistEdit', - component: () => import('@/views/tested/device/remind/components/edit.vue'), - meta: { - title: '到期提醒编辑', - auth: '/tested/device/remind', - sidebar: false, - breadcrumb: false, - activeMenu: '/dremindlist', - }, - }, - { path: '/dremindlist/detail', name: 'dremindlistDetail', component: () => import('@/views/tested/device/info/components/detail.vue'), diff --git a/src/utils/applyBtns.ts b/src/utils/applyBtns.ts index e08ffe1..aca300d 100644 --- a/src/utils/applyBtns.ts +++ b/src/utils/applyBtns.ts @@ -34,7 +34,7 @@ export const delTextBtn = (applyStatus: string) => { switch (applyStatus) { case '全部': - return true + return false break case '已审批': return false @@ -65,7 +65,7 @@ // 编辑页面中编辑按钮 export const editBtn = (applyStatus: string, type: string) => { if (applyStatus === '审批' && type === 'detail') { - return true + return false } else if (applyStatus === '草稿箱' && type === 'detail') { return true diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index b6cd934..87ad108 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -9,8 +9,8 @@ SUBCONTRACTOR_APPROVAL = 'fbfmlgl', // 分包方名录管理 SUBCONTRACT_REVIEW_APPROVAL = 'fbfpsbgl', // 分包方评审表 EQUIPMENT_SEALED_APPROVAL = 'sbfcsq', // 设备封存申请 - EQUIPMENT_UNSEALED_APPROVAL = 'sbgfsq', // 设备启封由请 + EQUIPMENT_UNSEALED_APPROVAL = 'sbqfsq', // 设备启封由请 EQUIPMENT_DISABLE_APPROVAL = 'sbjysq', // 设备禁用申请 EQUIPMENT_SCRAP_APPROVAL = 'sbbfsq', // 设备报废申请 - EQUIPMENT_DELAY_APPROVAL = 'sbyysq"', // 设备延用申请 + EQUIPMENT_DELAY_APPROVAL = 'sbyysq', // 设备延用申请 } diff --git a/src/views/system/label/list.vue b/src/views/system/label/list.vue index 2f617ae..9285675 100644 --- a/src/views/system/label/list.vue +++ b/src/views/system/label/list.vue @@ -103,7 +103,8 @@ ElMessage.error(res.message) loading.close() } - }).catch((_) => { + }).catch((err) => { + ElMessage.error(err.message) loading.close() }) } diff --git a/src/views/tested/MeasurementPlan/early/components/detail.vue b/src/views/tested/MeasurementPlan/early/components/detail.vue index 8eb6425..dac24d6 100644 --- a/src/views/tested/MeasurementPlan/early/components/detail.vue +++ b/src/views/tested/MeasurementPlan/early/components/detail.vue @@ -2,7 +2,7 @@ import { ElMessage, ElMessageBox } from 'element-plus' import baseInfo from './edit.vue' import ApprovalDialog from './ApprovalDialog.vue' -import { editBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn } from '@/utils/applyBtns' import { cancelApply, delApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const activeName = ref('基本信息') @@ -76,7 +76,7 @@ 编辑 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/edit.vue b/src/views/tested/MeasurementPlan/early/components/edit.vue index 2fe4276..dc6109a 100644 --- a/src/views/tested/MeasurementPlan/early/components/edit.vue +++ b/src/views/tested/MeasurementPlan/early/components/edit.vue @@ -4,10 +4,11 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import dayjs from 'dayjs' import planList from './table.vue' +import approvalDialog from './ApprovalDialog.vue' import { getDictByCode } from '@/api/system/dict' import useUserStore from '@/store/modules/user' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { cancelApply, delApply, detailApply, editApply, submitApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const $router = useRouter() @@ -190,7 +191,7 @@ 取消 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue index e2c0066..7108668 100644 --- a/src/views/tested/MeasurementPlan/early/components/list.vue +++ b/src/views/tested/MeasurementPlan/early/components/list.vue @@ -2,6 +2,7 @@ diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 5ac5e8c..41df464 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -7,7 +7,7 @@ import technology from './technology.vue' import showPhoto from './showPhoto.vue' import certificateTable from './certificateTable.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' @@ -400,9 +400,16 @@ }) } } +// 上传 const upload = () => { fileRef.value.click() } +// 删除上传的文件 +const deleteFile = (fileName: string) => { + const data = ruleForm.value.instructionsFile.split(',') + const filterData = data.filter(item => item !== fileName) + ruleForm.value.instructionsFile = filterData.length ? filterData.join(',') : '' +} const print = () => { } @@ -429,7 +436,7 @@ 保存 - + 删除 @@ -592,7 +599,7 @@ - + 上传 diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue index e2ff0c5..f65e207 100644 --- a/src/views/tested/device/info/components/list.vue +++ b/src/views/tested/device/info/components/list.vue @@ -5,7 +5,7 @@ import type { IlistObjType, IlistQueryType } from './interface' import { delTextBtn, editTextBtn } from '@/utils/applyBtns' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, submitInfo } from '@/api/eqpt/device/info' +import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' @@ -71,7 +71,7 @@ }, { text: '计量标识', - value: 'meterIdentify', + value: 'meterIdentifyName', align: 'center', }, { @@ -136,6 +136,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch((_) => { + listLoading.value = false }) } // 获取使用状态列表 @@ -269,6 +271,39 @@ ElMessage.warning('无可导出内容') } } +const fileRef = ref() // 文件上传input,获取input的引用 +const onFileChange = (event: any) => { + // 原生上传 + // console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('file', event.target.files[0]) + // fd.append('equipmentType', $props.equipmentType) + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + importDevice(fd, $props.equipmentType).then((res) => { + if (res.code === 200) { + ElMessage.success('上传成功') + loading.close() + fetchData(true) + } + else { + // ElMessage.error(res.message) + loading.close() + } + }).catch((err) => { + ElMessage.error(err.message) + loading.close() + }) + } +} +// 导入 +const importList = () => { + fileRef.value.click() +} // 详情 const detail = (row: IlistObjType) => { if ($props.statusName === '草稿箱' || $props.statusName === '未通过' || $props.statusName === '已取消') { @@ -399,13 +434,15 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() - tableFlage.value = true + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + tableFlage.value = true + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/device/info/edit', @@ -452,9 +489,10 @@ - + + 删除 - diff --git a/src/views/tested/device/info/components/showPhoto.vue b/src/views/tested/device/info/components/showPhoto.vue index 0d50813..3af1845 100644 --- a/src/views/tested/device/info/components/showPhoto.vue +++ b/src/views/tested/device/info/components/showPhoto.vue @@ -15,6 +15,8 @@ default: '100px', }, }) +const $emits = defineEmits(['delete']) +const $route = useRoute() const urlList = ref() const getPhoto = () => { if (props.minioFileName) { @@ -34,6 +36,9 @@ }) }) } + else { + urlList.value = [] + } } onMounted(() => { @@ -45,31 +50,87 @@ // onUpdated(() => { // }) +const close = (fileName: string) => { + $emits('delete', fileName) +} diff --git a/src/views/tested/device/info/index.vue b/src/views/tested/device/info/index.vue index 2c356f4..d2daff4 100644 --- a/src/views/tested/device/info/index.vue +++ b/src/views/tested/device/info/index.vue @@ -51,6 +51,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem(`deviceBaseInfoMenu-${$props.equipmentType}`) || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/views/tested/status/delay/components/edit.vue b/src/views/tested/status/delay/components/edit.vue index ca7d003..e4d5dde 100644 --- a/src/views/tested/status/delay/components/edit.vue +++ b/src/views/tested/status/delay/components/edit.vue @@ -9,7 +9,7 @@ import useUserStore from '@/store/modules/user' import { cancelStatus, deleteStatus, detailStatus, editStatus, submitStatus } from '@/api/eqpt/status/index' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getInfoDetail } from '@/api/eqpt/device/info' const $route = useRoute() const $router = useRouter() @@ -288,7 +288,7 @@ 保存 - + 删除 diff --git a/src/views/tested/status/delay/components/list.vue b/src/views/tested/status/delay/components/list.vue index 5603bf1..52dd76b 100644 --- a/src/views/tested/status/delay/components/list.vue +++ b/src/views/tested/status/delay/components/list.vue @@ -111,6 +111,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch(() => { + listLoading.value = false }) } // 查询数据 @@ -212,7 +214,7 @@ type: 'warning', }, ).then((res) => { - submitStatus({ id: row.id, formId: SCHEDULE.METERING_PLAN_APPROVAL }).then((res) => { + submitStatus({ id: row.id, formId: formIdDict.value[Number($props.statusType)] }).then((res) => { ElMessage.success('已提交') search() }) @@ -225,12 +227,14 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/pmetering/plan/edit', diff --git a/src/views/tested/status/delay/components/page.vue b/src/views/tested/status/delay/components/page.vue index dc880b9..ed76843 100644 --- a/src/views/tested/status/delay/components/page.vue +++ b/src/views/tested/status/delay/components/page.vue @@ -52,6 +52,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem(`deviceStatus-${$props.statusType}`) || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/views/tested/subpackage/certificate/components/edit.vue b/src/views/tested/subpackage/certificate/components/edit.vue index 6e1db7b..243fe69 100644 --- a/src/views/tested/subpackage/certificate/components/edit.vue +++ b/src/views/tested/subpackage/certificate/components/edit.vue @@ -293,7 +293,7 @@ - + @@ -305,7 +305,7 @@ - + diff --git a/src/views/tested/subpackage/directory/components/edit.vue b/src/views/tested/subpackage/directory/components/edit.vue index db7fd5e..89c614f 100644 --- a/src/views/tested/subpackage/directory/components/edit.vue +++ b/src/views/tested/subpackage/directory/components/edit.vue @@ -8,7 +8,7 @@ import certificateTable from './certificateTable.vue' import ApprovalDialog from './ApprovalDialog.vue' import showPhoto from '@/views/tested/device/info/components/showPhoto.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { uploadApi } from '@/api/system/notice' @@ -351,9 +351,16 @@ }) } } +// 上传 const upload = () => { fileRef.value.click() } +// 删除上传的文件 +const deleteFile = (fileName: string) => { + const data = ruleForm.value.attachments.split(',') + const filterData = data.filter(item => item !== fileName) + ruleForm.value.attachments = filterData.length ? filterData.join(',') : '' +} const print = () => { } @@ -380,7 +387,7 @@ 保存 - + 删除 @@ -551,7 +558,7 @@ - + 上传 diff --git a/src/views/tested/subpackage/directory/components/list.vue b/src/views/tested/subpackage/directory/components/list.vue index 6585931..18c7523 100644 --- a/src/views/tested/subpackage/directory/components/list.vue +++ b/src/views/tested/subpackage/directory/components/list.vue @@ -87,6 +87,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch(() => { + listLoading.value = false }) } // 查询数据 @@ -228,7 +230,7 @@ type: 'warning', }, ).then((res) => { - submitDirectory({ id: row.id, formId: SCHEDULE.DEVICE_INFO_APPROVAL }).then((res) => { + submitDirectory({ id: row.id, formId: SCHEDULE.SUBCONTRACTOR_APPROVAL }).then((res) => { ElMessage.success('已提交') search() }) @@ -242,12 +244,14 @@ // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/device/info/edit', diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 8998561..84b23ea 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -524,18 +524,6 @@ }, }, { - path: '/dremindlist/:type', - name: 'DremindlistEdit', - component: () => import('@/views/tested/device/remind/components/edit.vue'), - meta: { - title: '到期提醒编辑', - auth: '/tested/device/remind', - sidebar: false, - breadcrumb: false, - activeMenu: '/dremindlist', - }, - }, - { path: '/dremindlist/detail', name: 'dremindlistDetail', component: () => import('@/views/tested/device/info/components/detail.vue'), diff --git a/src/utils/applyBtns.ts b/src/utils/applyBtns.ts index e08ffe1..aca300d 100644 --- a/src/utils/applyBtns.ts +++ b/src/utils/applyBtns.ts @@ -34,7 +34,7 @@ export const delTextBtn = (applyStatus: string) => { switch (applyStatus) { case '全部': - return true + return false break case '已审批': return false @@ -65,7 +65,7 @@ // 编辑页面中编辑按钮 export const editBtn = (applyStatus: string, type: string) => { if (applyStatus === '审批' && type === 'detail') { - return true + return false } else if (applyStatus === '草稿箱' && type === 'detail') { return true diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index b6cd934..87ad108 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -9,8 +9,8 @@ SUBCONTRACTOR_APPROVAL = 'fbfmlgl', // 分包方名录管理 SUBCONTRACT_REVIEW_APPROVAL = 'fbfpsbgl', // 分包方评审表 EQUIPMENT_SEALED_APPROVAL = 'sbfcsq', // 设备封存申请 - EQUIPMENT_UNSEALED_APPROVAL = 'sbgfsq', // 设备启封由请 + EQUIPMENT_UNSEALED_APPROVAL = 'sbqfsq', // 设备启封由请 EQUIPMENT_DISABLE_APPROVAL = 'sbjysq', // 设备禁用申请 EQUIPMENT_SCRAP_APPROVAL = 'sbbfsq', // 设备报废申请 - EQUIPMENT_DELAY_APPROVAL = 'sbyysq"', // 设备延用申请 + EQUIPMENT_DELAY_APPROVAL = 'sbyysq', // 设备延用申请 } diff --git a/src/views/system/label/list.vue b/src/views/system/label/list.vue index 2f617ae..9285675 100644 --- a/src/views/system/label/list.vue +++ b/src/views/system/label/list.vue @@ -103,7 +103,8 @@ ElMessage.error(res.message) loading.close() } - }).catch((_) => { + }).catch((err) => { + ElMessage.error(err.message) loading.close() }) } diff --git a/src/views/tested/MeasurementPlan/early/components/detail.vue b/src/views/tested/MeasurementPlan/early/components/detail.vue index 8eb6425..dac24d6 100644 --- a/src/views/tested/MeasurementPlan/early/components/detail.vue +++ b/src/views/tested/MeasurementPlan/early/components/detail.vue @@ -2,7 +2,7 @@ import { ElMessage, ElMessageBox } from 'element-plus' import baseInfo from './edit.vue' import ApprovalDialog from './ApprovalDialog.vue' -import { editBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn } from '@/utils/applyBtns' import { cancelApply, delApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const activeName = ref('基本信息') @@ -76,7 +76,7 @@ 编辑 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/edit.vue b/src/views/tested/MeasurementPlan/early/components/edit.vue index 2fe4276..dc6109a 100644 --- a/src/views/tested/MeasurementPlan/early/components/edit.vue +++ b/src/views/tested/MeasurementPlan/early/components/edit.vue @@ -4,10 +4,11 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import dayjs from 'dayjs' import planList from './table.vue' +import approvalDialog from './ApprovalDialog.vue' import { getDictByCode } from '@/api/system/dict' import useUserStore from '@/store/modules/user' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { cancelApply, delApply, detailApply, editApply, submitApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const $router = useRouter() @@ -190,7 +191,7 @@ 取消 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue index e2c0066..7108668 100644 --- a/src/views/tested/MeasurementPlan/early/components/list.vue +++ b/src/views/tested/MeasurementPlan/early/components/list.vue @@ -2,6 +2,7 @@ diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 5ac5e8c..41df464 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -7,7 +7,7 @@ import technology from './technology.vue' import showPhoto from './showPhoto.vue' import certificateTable from './certificateTable.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' @@ -400,9 +400,16 @@ }) } } +// 上传 const upload = () => { fileRef.value.click() } +// 删除上传的文件 +const deleteFile = (fileName: string) => { + const data = ruleForm.value.instructionsFile.split(',') + const filterData = data.filter(item => item !== fileName) + ruleForm.value.instructionsFile = filterData.length ? filterData.join(',') : '' +} const print = () => { } @@ -429,7 +436,7 @@ 保存 - + 删除 @@ -592,7 +599,7 @@ - + 上传 diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue index e2ff0c5..f65e207 100644 --- a/src/views/tested/device/info/components/list.vue +++ b/src/views/tested/device/info/components/list.vue @@ -5,7 +5,7 @@ import type { IlistObjType, IlistQueryType } from './interface' import { delTextBtn, editTextBtn } from '@/utils/applyBtns' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, submitInfo } from '@/api/eqpt/device/info' +import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' @@ -71,7 +71,7 @@ }, { text: '计量标识', - value: 'meterIdentify', + value: 'meterIdentifyName', align: 'center', }, { @@ -136,6 +136,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch((_) => { + listLoading.value = false }) } // 获取使用状态列表 @@ -269,6 +271,39 @@ ElMessage.warning('无可导出内容') } } +const fileRef = ref() // 文件上传input,获取input的引用 +const onFileChange = (event: any) => { + // 原生上传 + // console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('file', event.target.files[0]) + // fd.append('equipmentType', $props.equipmentType) + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + importDevice(fd, $props.equipmentType).then((res) => { + if (res.code === 200) { + ElMessage.success('上传成功') + loading.close() + fetchData(true) + } + else { + // ElMessage.error(res.message) + loading.close() + } + }).catch((err) => { + ElMessage.error(err.message) + loading.close() + }) + } +} +// 导入 +const importList = () => { + fileRef.value.click() +} // 详情 const detail = (row: IlistObjType) => { if ($props.statusName === '草稿箱' || $props.statusName === '未通过' || $props.statusName === '已取消') { @@ -399,13 +434,15 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() - tableFlage.value = true + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + tableFlage.value = true + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/device/info/edit', @@ -452,9 +489,10 @@ - + + 删除 - diff --git a/src/views/tested/device/info/components/showPhoto.vue b/src/views/tested/device/info/components/showPhoto.vue index 0d50813..3af1845 100644 --- a/src/views/tested/device/info/components/showPhoto.vue +++ b/src/views/tested/device/info/components/showPhoto.vue @@ -15,6 +15,8 @@ default: '100px', }, }) +const $emits = defineEmits(['delete']) +const $route = useRoute() const urlList = ref() const getPhoto = () => { if (props.minioFileName) { @@ -34,6 +36,9 @@ }) }) } + else { + urlList.value = [] + } } onMounted(() => { @@ -45,31 +50,87 @@ // onUpdated(() => { // }) +const close = (fileName: string) => { + $emits('delete', fileName) +} diff --git a/src/views/tested/device/info/index.vue b/src/views/tested/device/info/index.vue index 2c356f4..d2daff4 100644 --- a/src/views/tested/device/info/index.vue +++ b/src/views/tested/device/info/index.vue @@ -51,6 +51,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem(`deviceBaseInfoMenu-${$props.equipmentType}`) || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/views/tested/status/delay/components/edit.vue b/src/views/tested/status/delay/components/edit.vue index ca7d003..e4d5dde 100644 --- a/src/views/tested/status/delay/components/edit.vue +++ b/src/views/tested/status/delay/components/edit.vue @@ -9,7 +9,7 @@ import useUserStore from '@/store/modules/user' import { cancelStatus, deleteStatus, detailStatus, editStatus, submitStatus } from '@/api/eqpt/status/index' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getInfoDetail } from '@/api/eqpt/device/info' const $route = useRoute() const $router = useRouter() @@ -288,7 +288,7 @@ 保存 - + 删除 diff --git a/src/views/tested/status/delay/components/list.vue b/src/views/tested/status/delay/components/list.vue index 5603bf1..52dd76b 100644 --- a/src/views/tested/status/delay/components/list.vue +++ b/src/views/tested/status/delay/components/list.vue @@ -111,6 +111,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch(() => { + listLoading.value = false }) } // 查询数据 @@ -212,7 +214,7 @@ type: 'warning', }, ).then((res) => { - submitStatus({ id: row.id, formId: SCHEDULE.METERING_PLAN_APPROVAL }).then((res) => { + submitStatus({ id: row.id, formId: formIdDict.value[Number($props.statusType)] }).then((res) => { ElMessage.success('已提交') search() }) @@ -225,12 +227,14 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/pmetering/plan/edit', diff --git a/src/views/tested/status/delay/components/page.vue b/src/views/tested/status/delay/components/page.vue index dc880b9..ed76843 100644 --- a/src/views/tested/status/delay/components/page.vue +++ b/src/views/tested/status/delay/components/page.vue @@ -52,6 +52,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem(`deviceStatus-${$props.statusType}`) || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/views/tested/subpackage/certificate/components/edit.vue b/src/views/tested/subpackage/certificate/components/edit.vue index 6e1db7b..243fe69 100644 --- a/src/views/tested/subpackage/certificate/components/edit.vue +++ b/src/views/tested/subpackage/certificate/components/edit.vue @@ -293,7 +293,7 @@ - + @@ -305,7 +305,7 @@ - + diff --git a/src/views/tested/subpackage/directory/components/edit.vue b/src/views/tested/subpackage/directory/components/edit.vue index db7fd5e..89c614f 100644 --- a/src/views/tested/subpackage/directory/components/edit.vue +++ b/src/views/tested/subpackage/directory/components/edit.vue @@ -8,7 +8,7 @@ import certificateTable from './certificateTable.vue' import ApprovalDialog from './ApprovalDialog.vue' import showPhoto from '@/views/tested/device/info/components/showPhoto.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { uploadApi } from '@/api/system/notice' @@ -351,9 +351,16 @@ }) } } +// 上传 const upload = () => { fileRef.value.click() } +// 删除上传的文件 +const deleteFile = (fileName: string) => { + const data = ruleForm.value.attachments.split(',') + const filterData = data.filter(item => item !== fileName) + ruleForm.value.attachments = filterData.length ? filterData.join(',') : '' +} const print = () => { } @@ -380,7 +387,7 @@ 保存 - + 删除 @@ -551,7 +558,7 @@ - + 上传 diff --git a/src/views/tested/subpackage/directory/components/list.vue b/src/views/tested/subpackage/directory/components/list.vue index 6585931..18c7523 100644 --- a/src/views/tested/subpackage/directory/components/list.vue +++ b/src/views/tested/subpackage/directory/components/list.vue @@ -87,6 +87,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch(() => { + listLoading.value = false }) } // 查询数据 @@ -228,7 +230,7 @@ type: 'warning', }, ).then((res) => { - submitDirectory({ id: row.id, formId: SCHEDULE.DEVICE_INFO_APPROVAL }).then((res) => { + submitDirectory({ id: row.id, formId: SCHEDULE.SUBCONTRACTOR_APPROVAL }).then((res) => { ElMessage.success('已提交') search() }) @@ -242,12 +244,14 @@ // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/device/info/edit', diff --git a/src/views/tested/subpackage/directory/index.vue b/src/views/tested/subpackage/directory/index.vue index 093738e..792fcb9 100644 --- a/src/views/tested/subpackage/directory/index.vue +++ b/src/views/tested/subpackage/directory/index.vue @@ -44,6 +44,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem('subpackge-directory') || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 8998561..84b23ea 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -524,18 +524,6 @@ }, }, { - path: '/dremindlist/:type', - name: 'DremindlistEdit', - component: () => import('@/views/tested/device/remind/components/edit.vue'), - meta: { - title: '到期提醒编辑', - auth: '/tested/device/remind', - sidebar: false, - breadcrumb: false, - activeMenu: '/dremindlist', - }, - }, - { path: '/dremindlist/detail', name: 'dremindlistDetail', component: () => import('@/views/tested/device/info/components/detail.vue'), diff --git a/src/utils/applyBtns.ts b/src/utils/applyBtns.ts index e08ffe1..aca300d 100644 --- a/src/utils/applyBtns.ts +++ b/src/utils/applyBtns.ts @@ -34,7 +34,7 @@ export const delTextBtn = (applyStatus: string) => { switch (applyStatus) { case '全部': - return true + return false break case '已审批': return false @@ -65,7 +65,7 @@ // 编辑页面中编辑按钮 export const editBtn = (applyStatus: string, type: string) => { if (applyStatus === '审批' && type === 'detail') { - return true + return false } else if (applyStatus === '草稿箱' && type === 'detail') { return true diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index b6cd934..87ad108 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -9,8 +9,8 @@ SUBCONTRACTOR_APPROVAL = 'fbfmlgl', // 分包方名录管理 SUBCONTRACT_REVIEW_APPROVAL = 'fbfpsbgl', // 分包方评审表 EQUIPMENT_SEALED_APPROVAL = 'sbfcsq', // 设备封存申请 - EQUIPMENT_UNSEALED_APPROVAL = 'sbgfsq', // 设备启封由请 + EQUIPMENT_UNSEALED_APPROVAL = 'sbqfsq', // 设备启封由请 EQUIPMENT_DISABLE_APPROVAL = 'sbjysq', // 设备禁用申请 EQUIPMENT_SCRAP_APPROVAL = 'sbbfsq', // 设备报废申请 - EQUIPMENT_DELAY_APPROVAL = 'sbyysq"', // 设备延用申请 + EQUIPMENT_DELAY_APPROVAL = 'sbyysq', // 设备延用申请 } diff --git a/src/views/system/label/list.vue b/src/views/system/label/list.vue index 2f617ae..9285675 100644 --- a/src/views/system/label/list.vue +++ b/src/views/system/label/list.vue @@ -103,7 +103,8 @@ ElMessage.error(res.message) loading.close() } - }).catch((_) => { + }).catch((err) => { + ElMessage.error(err.message) loading.close() }) } diff --git a/src/views/tested/MeasurementPlan/early/components/detail.vue b/src/views/tested/MeasurementPlan/early/components/detail.vue index 8eb6425..dac24d6 100644 --- a/src/views/tested/MeasurementPlan/early/components/detail.vue +++ b/src/views/tested/MeasurementPlan/early/components/detail.vue @@ -2,7 +2,7 @@ import { ElMessage, ElMessageBox } from 'element-plus' import baseInfo from './edit.vue' import ApprovalDialog from './ApprovalDialog.vue' -import { editBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn } from '@/utils/applyBtns' import { cancelApply, delApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const activeName = ref('基本信息') @@ -76,7 +76,7 @@ 编辑 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/edit.vue b/src/views/tested/MeasurementPlan/early/components/edit.vue index 2fe4276..dc6109a 100644 --- a/src/views/tested/MeasurementPlan/early/components/edit.vue +++ b/src/views/tested/MeasurementPlan/early/components/edit.vue @@ -4,10 +4,11 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import dayjs from 'dayjs' import planList from './table.vue' +import approvalDialog from './ApprovalDialog.vue' import { getDictByCode } from '@/api/system/dict' import useUserStore from '@/store/modules/user' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { cancelApply, delApply, detailApply, editApply, submitApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const $router = useRouter() @@ -190,7 +191,7 @@ 取消 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue index e2c0066..7108668 100644 --- a/src/views/tested/MeasurementPlan/early/components/list.vue +++ b/src/views/tested/MeasurementPlan/early/components/list.vue @@ -2,6 +2,7 @@ diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 5ac5e8c..41df464 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -7,7 +7,7 @@ import technology from './technology.vue' import showPhoto from './showPhoto.vue' import certificateTable from './certificateTable.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' @@ -400,9 +400,16 @@ }) } } +// 上传 const upload = () => { fileRef.value.click() } +// 删除上传的文件 +const deleteFile = (fileName: string) => { + const data = ruleForm.value.instructionsFile.split(',') + const filterData = data.filter(item => item !== fileName) + ruleForm.value.instructionsFile = filterData.length ? filterData.join(',') : '' +} const print = () => { } @@ -429,7 +436,7 @@ 保存 - + 删除 @@ -592,7 +599,7 @@ - + 上传 diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue index e2ff0c5..f65e207 100644 --- a/src/views/tested/device/info/components/list.vue +++ b/src/views/tested/device/info/components/list.vue @@ -5,7 +5,7 @@ import type { IlistObjType, IlistQueryType } from './interface' import { delTextBtn, editTextBtn } from '@/utils/applyBtns' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, submitInfo } from '@/api/eqpt/device/info' +import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' @@ -71,7 +71,7 @@ }, { text: '计量标识', - value: 'meterIdentify', + value: 'meterIdentifyName', align: 'center', }, { @@ -136,6 +136,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch((_) => { + listLoading.value = false }) } // 获取使用状态列表 @@ -269,6 +271,39 @@ ElMessage.warning('无可导出内容') } } +const fileRef = ref() // 文件上传input,获取input的引用 +const onFileChange = (event: any) => { + // 原生上传 + // console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('file', event.target.files[0]) + // fd.append('equipmentType', $props.equipmentType) + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + importDevice(fd, $props.equipmentType).then((res) => { + if (res.code === 200) { + ElMessage.success('上传成功') + loading.close() + fetchData(true) + } + else { + // ElMessage.error(res.message) + loading.close() + } + }).catch((err) => { + ElMessage.error(err.message) + loading.close() + }) + } +} +// 导入 +const importList = () => { + fileRef.value.click() +} // 详情 const detail = (row: IlistObjType) => { if ($props.statusName === '草稿箱' || $props.statusName === '未通过' || $props.statusName === '已取消') { @@ -399,13 +434,15 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() - tableFlage.value = true + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + tableFlage.value = true + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/device/info/edit', @@ -452,9 +489,10 @@ - + + 删除 - diff --git a/src/views/tested/device/info/components/showPhoto.vue b/src/views/tested/device/info/components/showPhoto.vue index 0d50813..3af1845 100644 --- a/src/views/tested/device/info/components/showPhoto.vue +++ b/src/views/tested/device/info/components/showPhoto.vue @@ -15,6 +15,8 @@ default: '100px', }, }) +const $emits = defineEmits(['delete']) +const $route = useRoute() const urlList = ref() const getPhoto = () => { if (props.minioFileName) { @@ -34,6 +36,9 @@ }) }) } + else { + urlList.value = [] + } } onMounted(() => { @@ -45,31 +50,87 @@ // onUpdated(() => { // }) +const close = (fileName: string) => { + $emits('delete', fileName) +} diff --git a/src/views/tested/device/info/index.vue b/src/views/tested/device/info/index.vue index 2c356f4..d2daff4 100644 --- a/src/views/tested/device/info/index.vue +++ b/src/views/tested/device/info/index.vue @@ -51,6 +51,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem(`deviceBaseInfoMenu-${$props.equipmentType}`) || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/views/tested/status/delay/components/edit.vue b/src/views/tested/status/delay/components/edit.vue index ca7d003..e4d5dde 100644 --- a/src/views/tested/status/delay/components/edit.vue +++ b/src/views/tested/status/delay/components/edit.vue @@ -9,7 +9,7 @@ import useUserStore from '@/store/modules/user' import { cancelStatus, deleteStatus, detailStatus, editStatus, submitStatus } from '@/api/eqpt/status/index' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getInfoDetail } from '@/api/eqpt/device/info' const $route = useRoute() const $router = useRouter() @@ -288,7 +288,7 @@ 保存 - + 删除 diff --git a/src/views/tested/status/delay/components/list.vue b/src/views/tested/status/delay/components/list.vue index 5603bf1..52dd76b 100644 --- a/src/views/tested/status/delay/components/list.vue +++ b/src/views/tested/status/delay/components/list.vue @@ -111,6 +111,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch(() => { + listLoading.value = false }) } // 查询数据 @@ -212,7 +214,7 @@ type: 'warning', }, ).then((res) => { - submitStatus({ id: row.id, formId: SCHEDULE.METERING_PLAN_APPROVAL }).then((res) => { + submitStatus({ id: row.id, formId: formIdDict.value[Number($props.statusType)] }).then((res) => { ElMessage.success('已提交') search() }) @@ -225,12 +227,14 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/pmetering/plan/edit', diff --git a/src/views/tested/status/delay/components/page.vue b/src/views/tested/status/delay/components/page.vue index dc880b9..ed76843 100644 --- a/src/views/tested/status/delay/components/page.vue +++ b/src/views/tested/status/delay/components/page.vue @@ -52,6 +52,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem(`deviceStatus-${$props.statusType}`) || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/views/tested/subpackage/certificate/components/edit.vue b/src/views/tested/subpackage/certificate/components/edit.vue index 6e1db7b..243fe69 100644 --- a/src/views/tested/subpackage/certificate/components/edit.vue +++ b/src/views/tested/subpackage/certificate/components/edit.vue @@ -293,7 +293,7 @@ - + @@ -305,7 +305,7 @@ - + diff --git a/src/views/tested/subpackage/directory/components/edit.vue b/src/views/tested/subpackage/directory/components/edit.vue index db7fd5e..89c614f 100644 --- a/src/views/tested/subpackage/directory/components/edit.vue +++ b/src/views/tested/subpackage/directory/components/edit.vue @@ -8,7 +8,7 @@ import certificateTable from './certificateTable.vue' import ApprovalDialog from './ApprovalDialog.vue' import showPhoto from '@/views/tested/device/info/components/showPhoto.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { uploadApi } from '@/api/system/notice' @@ -351,9 +351,16 @@ }) } } +// 上传 const upload = () => { fileRef.value.click() } +// 删除上传的文件 +const deleteFile = (fileName: string) => { + const data = ruleForm.value.attachments.split(',') + const filterData = data.filter(item => item !== fileName) + ruleForm.value.attachments = filterData.length ? filterData.join(',') : '' +} const print = () => { } @@ -380,7 +387,7 @@ 保存 - + 删除 @@ -551,7 +558,7 @@ - + 上传 diff --git a/src/views/tested/subpackage/directory/components/list.vue b/src/views/tested/subpackage/directory/components/list.vue index 6585931..18c7523 100644 --- a/src/views/tested/subpackage/directory/components/list.vue +++ b/src/views/tested/subpackage/directory/components/list.vue @@ -87,6 +87,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch(() => { + listLoading.value = false }) } // 查询数据 @@ -228,7 +230,7 @@ type: 'warning', }, ).then((res) => { - submitDirectory({ id: row.id, formId: SCHEDULE.DEVICE_INFO_APPROVAL }).then((res) => { + submitDirectory({ id: row.id, formId: SCHEDULE.SUBCONTRACTOR_APPROVAL }).then((res) => { ElMessage.success('已提交') search() }) @@ -242,12 +244,14 @@ // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/device/info/edit', diff --git a/src/views/tested/subpackage/directory/index.vue b/src/views/tested/subpackage/directory/index.vue index 093738e..792fcb9 100644 --- a/src/views/tested/subpackage/directory/index.vue +++ b/src/views/tested/subpackage/directory/index.vue @@ -44,6 +44,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem('subpackge-directory') || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/views/tested/subpackage/review/components/edit.vue b/src/views/tested/subpackage/review/components/edit.vue index b9e3e5f..499a4ec 100644 --- a/src/views/tested/subpackage/review/components/edit.vue +++ b/src/views/tested/subpackage/review/components/edit.vue @@ -7,7 +7,7 @@ import ApprovalDialog from './ApprovalDialog.vue' import subpackageDialog from './subpackageDialog.vue' import showPhoto from '@/views/tested/device/info/components/showPhotoSinge.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { uploadApi } from '@/api/system/notice' @@ -294,7 +294,7 @@ 保存 - + 删除 diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 8998561..84b23ea 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -524,18 +524,6 @@ }, }, { - path: '/dremindlist/:type', - name: 'DremindlistEdit', - component: () => import('@/views/tested/device/remind/components/edit.vue'), - meta: { - title: '到期提醒编辑', - auth: '/tested/device/remind', - sidebar: false, - breadcrumb: false, - activeMenu: '/dremindlist', - }, - }, - { path: '/dremindlist/detail', name: 'dremindlistDetail', component: () => import('@/views/tested/device/info/components/detail.vue'), diff --git a/src/utils/applyBtns.ts b/src/utils/applyBtns.ts index e08ffe1..aca300d 100644 --- a/src/utils/applyBtns.ts +++ b/src/utils/applyBtns.ts @@ -34,7 +34,7 @@ export const delTextBtn = (applyStatus: string) => { switch (applyStatus) { case '全部': - return true + return false break case '已审批': return false @@ -65,7 +65,7 @@ // 编辑页面中编辑按钮 export const editBtn = (applyStatus: string, type: string) => { if (applyStatus === '审批' && type === 'detail') { - return true + return false } else if (applyStatus === '草稿箱' && type === 'detail') { return true diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index b6cd934..87ad108 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -9,8 +9,8 @@ SUBCONTRACTOR_APPROVAL = 'fbfmlgl', // 分包方名录管理 SUBCONTRACT_REVIEW_APPROVAL = 'fbfpsbgl', // 分包方评审表 EQUIPMENT_SEALED_APPROVAL = 'sbfcsq', // 设备封存申请 - EQUIPMENT_UNSEALED_APPROVAL = 'sbgfsq', // 设备启封由请 + EQUIPMENT_UNSEALED_APPROVAL = 'sbqfsq', // 设备启封由请 EQUIPMENT_DISABLE_APPROVAL = 'sbjysq', // 设备禁用申请 EQUIPMENT_SCRAP_APPROVAL = 'sbbfsq', // 设备报废申请 - EQUIPMENT_DELAY_APPROVAL = 'sbyysq"', // 设备延用申请 + EQUIPMENT_DELAY_APPROVAL = 'sbyysq', // 设备延用申请 } diff --git a/src/views/system/label/list.vue b/src/views/system/label/list.vue index 2f617ae..9285675 100644 --- a/src/views/system/label/list.vue +++ b/src/views/system/label/list.vue @@ -103,7 +103,8 @@ ElMessage.error(res.message) loading.close() } - }).catch((_) => { + }).catch((err) => { + ElMessage.error(err.message) loading.close() }) } diff --git a/src/views/tested/MeasurementPlan/early/components/detail.vue b/src/views/tested/MeasurementPlan/early/components/detail.vue index 8eb6425..dac24d6 100644 --- a/src/views/tested/MeasurementPlan/early/components/detail.vue +++ b/src/views/tested/MeasurementPlan/early/components/detail.vue @@ -2,7 +2,7 @@ import { ElMessage, ElMessageBox } from 'element-plus' import baseInfo from './edit.vue' import ApprovalDialog from './ApprovalDialog.vue' -import { editBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn } from '@/utils/applyBtns' import { cancelApply, delApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const activeName = ref('基本信息') @@ -76,7 +76,7 @@ 编辑 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/edit.vue b/src/views/tested/MeasurementPlan/early/components/edit.vue index 2fe4276..dc6109a 100644 --- a/src/views/tested/MeasurementPlan/early/components/edit.vue +++ b/src/views/tested/MeasurementPlan/early/components/edit.vue @@ -4,10 +4,11 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import dayjs from 'dayjs' import planList from './table.vue' +import approvalDialog from './ApprovalDialog.vue' import { getDictByCode } from '@/api/system/dict' import useUserStore from '@/store/modules/user' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { cancelApply, delApply, detailApply, editApply, submitApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const $router = useRouter() @@ -190,7 +191,7 @@ 取消 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue index e2c0066..7108668 100644 --- a/src/views/tested/MeasurementPlan/early/components/list.vue +++ b/src/views/tested/MeasurementPlan/early/components/list.vue @@ -2,6 +2,7 @@ diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 5ac5e8c..41df464 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -7,7 +7,7 @@ import technology from './technology.vue' import showPhoto from './showPhoto.vue' import certificateTable from './certificateTable.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' @@ -400,9 +400,16 @@ }) } } +// 上传 const upload = () => { fileRef.value.click() } +// 删除上传的文件 +const deleteFile = (fileName: string) => { + const data = ruleForm.value.instructionsFile.split(',') + const filterData = data.filter(item => item !== fileName) + ruleForm.value.instructionsFile = filterData.length ? filterData.join(',') : '' +} const print = () => { } @@ -429,7 +436,7 @@ 保存 - + 删除 @@ -592,7 +599,7 @@ - + 上传 diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue index e2ff0c5..f65e207 100644 --- a/src/views/tested/device/info/components/list.vue +++ b/src/views/tested/device/info/components/list.vue @@ -5,7 +5,7 @@ import type { IlistObjType, IlistQueryType } from './interface' import { delTextBtn, editTextBtn } from '@/utils/applyBtns' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, submitInfo } from '@/api/eqpt/device/info' +import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' @@ -71,7 +71,7 @@ }, { text: '计量标识', - value: 'meterIdentify', + value: 'meterIdentifyName', align: 'center', }, { @@ -136,6 +136,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch((_) => { + listLoading.value = false }) } // 获取使用状态列表 @@ -269,6 +271,39 @@ ElMessage.warning('无可导出内容') } } +const fileRef = ref() // 文件上传input,获取input的引用 +const onFileChange = (event: any) => { + // 原生上传 + // console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('file', event.target.files[0]) + // fd.append('equipmentType', $props.equipmentType) + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + importDevice(fd, $props.equipmentType).then((res) => { + if (res.code === 200) { + ElMessage.success('上传成功') + loading.close() + fetchData(true) + } + else { + // ElMessage.error(res.message) + loading.close() + } + }).catch((err) => { + ElMessage.error(err.message) + loading.close() + }) + } +} +// 导入 +const importList = () => { + fileRef.value.click() +} // 详情 const detail = (row: IlistObjType) => { if ($props.statusName === '草稿箱' || $props.statusName === '未通过' || $props.statusName === '已取消') { @@ -399,13 +434,15 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() - tableFlage.value = true + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + tableFlage.value = true + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/device/info/edit', @@ -452,9 +489,10 @@ - + + 删除 - diff --git a/src/views/tested/device/info/components/showPhoto.vue b/src/views/tested/device/info/components/showPhoto.vue index 0d50813..3af1845 100644 --- a/src/views/tested/device/info/components/showPhoto.vue +++ b/src/views/tested/device/info/components/showPhoto.vue @@ -15,6 +15,8 @@ default: '100px', }, }) +const $emits = defineEmits(['delete']) +const $route = useRoute() const urlList = ref() const getPhoto = () => { if (props.minioFileName) { @@ -34,6 +36,9 @@ }) }) } + else { + urlList.value = [] + } } onMounted(() => { @@ -45,31 +50,87 @@ // onUpdated(() => { // }) +const close = (fileName: string) => { + $emits('delete', fileName) +} diff --git a/src/views/tested/device/info/index.vue b/src/views/tested/device/info/index.vue index 2c356f4..d2daff4 100644 --- a/src/views/tested/device/info/index.vue +++ b/src/views/tested/device/info/index.vue @@ -51,6 +51,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem(`deviceBaseInfoMenu-${$props.equipmentType}`) || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/views/tested/status/delay/components/edit.vue b/src/views/tested/status/delay/components/edit.vue index ca7d003..e4d5dde 100644 --- a/src/views/tested/status/delay/components/edit.vue +++ b/src/views/tested/status/delay/components/edit.vue @@ -9,7 +9,7 @@ import useUserStore from '@/store/modules/user' import { cancelStatus, deleteStatus, detailStatus, editStatus, submitStatus } from '@/api/eqpt/status/index' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getInfoDetail } from '@/api/eqpt/device/info' const $route = useRoute() const $router = useRouter() @@ -288,7 +288,7 @@ 保存 - + 删除 diff --git a/src/views/tested/status/delay/components/list.vue b/src/views/tested/status/delay/components/list.vue index 5603bf1..52dd76b 100644 --- a/src/views/tested/status/delay/components/list.vue +++ b/src/views/tested/status/delay/components/list.vue @@ -111,6 +111,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch(() => { + listLoading.value = false }) } // 查询数据 @@ -212,7 +214,7 @@ type: 'warning', }, ).then((res) => { - submitStatus({ id: row.id, formId: SCHEDULE.METERING_PLAN_APPROVAL }).then((res) => { + submitStatus({ id: row.id, formId: formIdDict.value[Number($props.statusType)] }).then((res) => { ElMessage.success('已提交') search() }) @@ -225,12 +227,14 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/pmetering/plan/edit', diff --git a/src/views/tested/status/delay/components/page.vue b/src/views/tested/status/delay/components/page.vue index dc880b9..ed76843 100644 --- a/src/views/tested/status/delay/components/page.vue +++ b/src/views/tested/status/delay/components/page.vue @@ -52,6 +52,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem(`deviceStatus-${$props.statusType}`) || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/views/tested/subpackage/certificate/components/edit.vue b/src/views/tested/subpackage/certificate/components/edit.vue index 6e1db7b..243fe69 100644 --- a/src/views/tested/subpackage/certificate/components/edit.vue +++ b/src/views/tested/subpackage/certificate/components/edit.vue @@ -293,7 +293,7 @@ - + @@ -305,7 +305,7 @@ - + diff --git a/src/views/tested/subpackage/directory/components/edit.vue b/src/views/tested/subpackage/directory/components/edit.vue index db7fd5e..89c614f 100644 --- a/src/views/tested/subpackage/directory/components/edit.vue +++ b/src/views/tested/subpackage/directory/components/edit.vue @@ -8,7 +8,7 @@ import certificateTable from './certificateTable.vue' import ApprovalDialog from './ApprovalDialog.vue' import showPhoto from '@/views/tested/device/info/components/showPhoto.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { uploadApi } from '@/api/system/notice' @@ -351,9 +351,16 @@ }) } } +// 上传 const upload = () => { fileRef.value.click() } +// 删除上传的文件 +const deleteFile = (fileName: string) => { + const data = ruleForm.value.attachments.split(',') + const filterData = data.filter(item => item !== fileName) + ruleForm.value.attachments = filterData.length ? filterData.join(',') : '' +} const print = () => { } @@ -380,7 +387,7 @@ 保存 - + 删除 @@ -551,7 +558,7 @@ - + 上传 diff --git a/src/views/tested/subpackage/directory/components/list.vue b/src/views/tested/subpackage/directory/components/list.vue index 6585931..18c7523 100644 --- a/src/views/tested/subpackage/directory/components/list.vue +++ b/src/views/tested/subpackage/directory/components/list.vue @@ -87,6 +87,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch(() => { + listLoading.value = false }) } // 查询数据 @@ -228,7 +230,7 @@ type: 'warning', }, ).then((res) => { - submitDirectory({ id: row.id, formId: SCHEDULE.DEVICE_INFO_APPROVAL }).then((res) => { + submitDirectory({ id: row.id, formId: SCHEDULE.SUBCONTRACTOR_APPROVAL }).then((res) => { ElMessage.success('已提交') search() }) @@ -242,12 +244,14 @@ // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/device/info/edit', diff --git a/src/views/tested/subpackage/directory/index.vue b/src/views/tested/subpackage/directory/index.vue index 093738e..792fcb9 100644 --- a/src/views/tested/subpackage/directory/index.vue +++ b/src/views/tested/subpackage/directory/index.vue @@ -44,6 +44,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem('subpackge-directory') || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/views/tested/subpackage/review/components/edit.vue b/src/views/tested/subpackage/review/components/edit.vue index b9e3e5f..499a4ec 100644 --- a/src/views/tested/subpackage/review/components/edit.vue +++ b/src/views/tested/subpackage/review/components/edit.vue @@ -7,7 +7,7 @@ import ApprovalDialog from './ApprovalDialog.vue' import subpackageDialog from './subpackageDialog.vue' import showPhoto from '@/views/tested/device/info/components/showPhotoSinge.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { uploadApi } from '@/api/system/notice' @@ -294,7 +294,7 @@ 保存 - + 删除 diff --git a/src/views/tested/subpackage/review/components/list.vue b/src/views/tested/subpackage/review/components/list.vue index 03185f9..e2ed430 100644 --- a/src/views/tested/subpackage/review/components/list.vue +++ b/src/views/tested/subpackage/review/components/list.vue @@ -81,6 +81,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch(() => { + listLoading.value = false }) } // 查询数据 @@ -236,12 +238,14 @@ // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/device/info/edit', diff --git a/src/api/eqpt/device/info.ts b/src/api/eqpt/device/info.ts index 32906e2..d2c71be 100644 --- a/src/api/eqpt/device/info.ts +++ b/src/api/eqpt/device/info.ts @@ -51,6 +51,15 @@ data: params, }) } +// 导入 +export function importDevice(data: object, deviceType: string) { + return request({ + url: `/equipment/info/import?equipmentType=${deviceType}`, + method: 'post', + data, + responseType: 'blob', + }) +} // 获取设备详情 export function getInfoDetail(params: object) { return request({ diff --git a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue index 8e2887a..b9a088c 100644 --- a/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue +++ b/src/components/ApprovalRecord/ApprovalRecordTableDevice.vue @@ -8,7 +8,7 @@ import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' -import { fetchApproval } from '@/api/approval' +import { fetchApprovalDevice } from '@/api/approval' const props = defineProps({ // processId: { // type: String, @@ -58,7 +58,7 @@ // 是否显示当前页,否则跳转第一页 // listQuery.value.offset = 1 // } - fetchApproval({ equipmentId: props.id }).then((response) => { + fetchApprovalDevice({ equipmentId: props.id }).then((response) => { const data = response.data.filter((item: any) => item.approvalLogs) data.forEach((item: any, cindex: number) => { const approvalLogsList = [] as any[] diff --git a/src/layouts/components/Breadcrumb/index.vue b/src/layouts/components/Breadcrumb/index.vue index 702d138..5ad9ab3 100644 --- a/src/layouts/components/Breadcrumb/index.vue +++ b/src/layouts/components/Breadcrumb/index.vue @@ -75,7 +75,8 @@ // position: absolute; // z-index: 999; // top: 0; - background-color: #fff; + // background-color: #fff; + background-color: transparent; display: flex; align-items: center; justify-content: space-between; @@ -85,8 +86,10 @@ // background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + position: fixed; + background-color: #fff; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); // background-color: #f1f2f6; display: flex; diff --git a/src/layouts/components/Topbar/index.vue b/src/layouts/components/Topbar/index.vue index 2f8f39c..7e830dc 100644 --- a/src/layouts/components/Topbar/index.vue +++ b/src/layouts/components/Topbar/index.vue @@ -86,10 +86,11 @@ background-image: linear-gradient(90deg, #71b5ff 30%, #3d7eff); .topbar-container-inner { + // position: fixed; width: 100%; - border-radius: 15px 10px 0 0; + // border-radius: 15px 10px 0 0; // background-color: var(--g-toolbar-bg); - // background-color: #f1f2f6; + // background-color: #fff; display: flex; justify-content: space-between; } diff --git a/src/router/modules/tested.ts b/src/router/modules/tested.ts index 8998561..84b23ea 100644 --- a/src/router/modules/tested.ts +++ b/src/router/modules/tested.ts @@ -524,18 +524,6 @@ }, }, { - path: '/dremindlist/:type', - name: 'DremindlistEdit', - component: () => import('@/views/tested/device/remind/components/edit.vue'), - meta: { - title: '到期提醒编辑', - auth: '/tested/device/remind', - sidebar: false, - breadcrumb: false, - activeMenu: '/dremindlist', - }, - }, - { path: '/dremindlist/detail', name: 'dremindlistDetail', component: () => import('@/views/tested/device/info/components/detail.vue'), diff --git a/src/utils/applyBtns.ts b/src/utils/applyBtns.ts index e08ffe1..aca300d 100644 --- a/src/utils/applyBtns.ts +++ b/src/utils/applyBtns.ts @@ -34,7 +34,7 @@ export const delTextBtn = (applyStatus: string) => { switch (applyStatus) { case '全部': - return true + return false break case '已审批': return false @@ -65,7 +65,7 @@ // 编辑页面中编辑按钮 export const editBtn = (applyStatus: string, type: string) => { if (applyStatus === '审批' && type === 'detail') { - return true + return false } else if (applyStatus === '草稿箱' && type === 'detail') { return true diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index b6cd934..87ad108 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -9,8 +9,8 @@ SUBCONTRACTOR_APPROVAL = 'fbfmlgl', // 分包方名录管理 SUBCONTRACT_REVIEW_APPROVAL = 'fbfpsbgl', // 分包方评审表 EQUIPMENT_SEALED_APPROVAL = 'sbfcsq', // 设备封存申请 - EQUIPMENT_UNSEALED_APPROVAL = 'sbgfsq', // 设备启封由请 + EQUIPMENT_UNSEALED_APPROVAL = 'sbqfsq', // 设备启封由请 EQUIPMENT_DISABLE_APPROVAL = 'sbjysq', // 设备禁用申请 EQUIPMENT_SCRAP_APPROVAL = 'sbbfsq', // 设备报废申请 - EQUIPMENT_DELAY_APPROVAL = 'sbyysq"', // 设备延用申请 + EQUIPMENT_DELAY_APPROVAL = 'sbyysq', // 设备延用申请 } diff --git a/src/views/system/label/list.vue b/src/views/system/label/list.vue index 2f617ae..9285675 100644 --- a/src/views/system/label/list.vue +++ b/src/views/system/label/list.vue @@ -103,7 +103,8 @@ ElMessage.error(res.message) loading.close() } - }).catch((_) => { + }).catch((err) => { + ElMessage.error(err.message) loading.close() }) } diff --git a/src/views/tested/MeasurementPlan/early/components/detail.vue b/src/views/tested/MeasurementPlan/early/components/detail.vue index 8eb6425..dac24d6 100644 --- a/src/views/tested/MeasurementPlan/early/components/detail.vue +++ b/src/views/tested/MeasurementPlan/early/components/detail.vue @@ -2,7 +2,7 @@ import { ElMessage, ElMessageBox } from 'element-plus' import baseInfo from './edit.vue' import ApprovalDialog from './ApprovalDialog.vue' -import { editBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn } from '@/utils/applyBtns' import { cancelApply, delApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const activeName = ref('基本信息') @@ -76,7 +76,7 @@ 编辑 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/edit.vue b/src/views/tested/MeasurementPlan/early/components/edit.vue index 2fe4276..dc6109a 100644 --- a/src/views/tested/MeasurementPlan/early/components/edit.vue +++ b/src/views/tested/MeasurementPlan/early/components/edit.vue @@ -4,10 +4,11 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import dayjs from 'dayjs' import planList from './table.vue' +import approvalDialog from './ApprovalDialog.vue' import { getDictByCode } from '@/api/system/dict' import useUserStore from '@/store/modules/user' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { cancelApply, delApply, detailApply, editApply, submitApply } from '@/api/eqpt/measurementPlan/early' const $route = useRoute() const $router = useRouter() @@ -190,7 +191,7 @@ 取消 - + 删除 diff --git a/src/views/tested/MeasurementPlan/early/components/list.vue b/src/views/tested/MeasurementPlan/early/components/list.vue index e2c0066..7108668 100644 --- a/src/views/tested/MeasurementPlan/early/components/list.vue +++ b/src/views/tested/MeasurementPlan/early/components/list.vue @@ -2,6 +2,7 @@ diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 5ac5e8c..41df464 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -7,7 +7,7 @@ import technology from './technology.vue' import showPhoto from './showPhoto.vue' import certificateTable from './certificateTable.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' @@ -400,9 +400,16 @@ }) } } +// 上传 const upload = () => { fileRef.value.click() } +// 删除上传的文件 +const deleteFile = (fileName: string) => { + const data = ruleForm.value.instructionsFile.split(',') + const filterData = data.filter(item => item !== fileName) + ruleForm.value.instructionsFile = filterData.length ? filterData.join(',') : '' +} const print = () => { } @@ -429,7 +436,7 @@ 保存 - + 删除 @@ -592,7 +599,7 @@ - + 上传 diff --git a/src/views/tested/device/info/components/list.vue b/src/views/tested/device/info/components/list.vue index e2ff0c5..f65e207 100644 --- a/src/views/tested/device/info/components/list.vue +++ b/src/views/tested/device/info/components/list.vue @@ -5,7 +5,7 @@ import type { IlistObjType, IlistQueryType } from './interface' import { delTextBtn, editTextBtn } from '@/utils/applyBtns' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, submitInfo } from '@/api/eqpt/device/info' +import { cancelInfo, deleteInfo, editInfo, exportDevice, getInfoList, getInfoListPage, getInfoListTogether, importDevice, submitInfo } from '@/api/eqpt/device/info' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { exportFile } from '@/utils/exportUtils' @@ -71,7 +71,7 @@ }, { text: '计量标识', - value: 'meterIdentify', + value: 'meterIdentifyName', align: 'center', }, { @@ -136,6 +136,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch((_) => { + listLoading.value = false }) } // 获取使用状态列表 @@ -269,6 +271,39 @@ ElMessage.warning('无可导出内容') } } +const fileRef = ref() // 文件上传input,获取input的引用 +const onFileChange = (event: any) => { + // 原生上传 + // console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('file', event.target.files[0]) + // fd.append('equipmentType', $props.equipmentType) + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + importDevice(fd, $props.equipmentType).then((res) => { + if (res.code === 200) { + ElMessage.success('上传成功') + loading.close() + fetchData(true) + } + else { + // ElMessage.error(res.message) + loading.close() + } + }).catch((err) => { + ElMessage.error(err.message) + loading.close() + }) + } +} +// 导入 +const importList = () => { + fileRef.value.click() +} // 详情 const detail = (row: IlistObjType) => { if ($props.statusName === '草稿箱' || $props.statusName === '未通过' || $props.statusName === '已取消') { @@ -399,13 +434,15 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() - tableFlage.value = true + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + tableFlage.value = true + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/device/info/edit', @@ -452,9 +489,10 @@ - + + 删除 - diff --git a/src/views/tested/device/info/components/showPhoto.vue b/src/views/tested/device/info/components/showPhoto.vue index 0d50813..3af1845 100644 --- a/src/views/tested/device/info/components/showPhoto.vue +++ b/src/views/tested/device/info/components/showPhoto.vue @@ -15,6 +15,8 @@ default: '100px', }, }) +const $emits = defineEmits(['delete']) +const $route = useRoute() const urlList = ref() const getPhoto = () => { if (props.minioFileName) { @@ -34,6 +36,9 @@ }) }) } + else { + urlList.value = [] + } } onMounted(() => { @@ -45,31 +50,87 @@ // onUpdated(() => { // }) +const close = (fileName: string) => { + $emits('delete', fileName) +} diff --git a/src/views/tested/device/info/index.vue b/src/views/tested/device/info/index.vue index 2c356f4..d2daff4 100644 --- a/src/views/tested/device/info/index.vue +++ b/src/views/tested/device/info/index.vue @@ -51,6 +51,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem(`deviceBaseInfoMenu-${$props.equipmentType}`) || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/views/tested/status/delay/components/edit.vue b/src/views/tested/status/delay/components/edit.vue index ca7d003..e4d5dde 100644 --- a/src/views/tested/status/delay/components/edit.vue +++ b/src/views/tested/status/delay/components/edit.vue @@ -9,7 +9,7 @@ import useUserStore from '@/store/modules/user' import { cancelStatus, deleteStatus, detailStatus, editStatus, submitStatus } from '@/api/eqpt/status/index' import { SCHEDULE } from '@/utils/scheduleDict' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getInfoDetail } from '@/api/eqpt/device/info' const $route = useRoute() const $router = useRouter() @@ -288,7 +288,7 @@ 保存 - + 删除 diff --git a/src/views/tested/status/delay/components/list.vue b/src/views/tested/status/delay/components/list.vue index 5603bf1..52dd76b 100644 --- a/src/views/tested/status/delay/components/list.vue +++ b/src/views/tested/status/delay/components/list.vue @@ -111,6 +111,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch(() => { + listLoading.value = false }) } // 查询数据 @@ -212,7 +214,7 @@ type: 'warning', }, ).then((res) => { - submitStatus({ id: row.id, formId: SCHEDULE.METERING_PLAN_APPROVAL }).then((res) => { + submitStatus({ id: row.id, formId: formIdDict.value[Number($props.statusType)] }).then((res) => { ElMessage.success('已提交') search() }) @@ -225,12 +227,14 @@ } // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/pmetering/plan/edit', diff --git a/src/views/tested/status/delay/components/page.vue b/src/views/tested/status/delay/components/page.vue index dc880b9..ed76843 100644 --- a/src/views/tested/status/delay/components/page.vue +++ b/src/views/tested/status/delay/components/page.vue @@ -52,6 +52,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem(`deviceStatus-${$props.statusType}`) || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/views/tested/subpackage/certificate/components/edit.vue b/src/views/tested/subpackage/certificate/components/edit.vue index 6e1db7b..243fe69 100644 --- a/src/views/tested/subpackage/certificate/components/edit.vue +++ b/src/views/tested/subpackage/certificate/components/edit.vue @@ -293,7 +293,7 @@ - + @@ -305,7 +305,7 @@ - + diff --git a/src/views/tested/subpackage/directory/components/edit.vue b/src/views/tested/subpackage/directory/components/edit.vue index db7fd5e..89c614f 100644 --- a/src/views/tested/subpackage/directory/components/edit.vue +++ b/src/views/tested/subpackage/directory/components/edit.vue @@ -8,7 +8,7 @@ import certificateTable from './certificateTable.vue' import ApprovalDialog from './ApprovalDialog.vue' import showPhoto from '@/views/tested/device/info/components/showPhoto.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { uploadApi } from '@/api/system/notice' @@ -351,9 +351,16 @@ }) } } +// 上传 const upload = () => { fileRef.value.click() } +// 删除上传的文件 +const deleteFile = (fileName: string) => { + const data = ruleForm.value.attachments.split(',') + const filterData = data.filter(item => item !== fileName) + ruleForm.value.attachments = filterData.length ? filterData.join(',') : '' +} const print = () => { } @@ -380,7 +387,7 @@ 保存 - + 删除 @@ -551,7 +558,7 @@ - + 上传 diff --git a/src/views/tested/subpackage/directory/components/list.vue b/src/views/tested/subpackage/directory/components/list.vue index 6585931..18c7523 100644 --- a/src/views/tested/subpackage/directory/components/list.vue +++ b/src/views/tested/subpackage/directory/components/list.vue @@ -87,6 +87,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch(() => { + listLoading.value = false }) } // 查询数据 @@ -228,7 +230,7 @@ type: 'warning', }, ).then((res) => { - submitDirectory({ id: row.id, formId: SCHEDULE.DEVICE_INFO_APPROVAL }).then((res) => { + submitDirectory({ id: row.id, formId: SCHEDULE.SUBCONTRACTOR_APPROVAL }).then((res) => { ElMessage.success('已提交') search() }) @@ -242,12 +244,14 @@ // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/device/info/edit', diff --git a/src/views/tested/subpackage/directory/index.vue b/src/views/tested/subpackage/directory/index.vue index 093738e..792fcb9 100644 --- a/src/views/tested/subpackage/directory/index.vue +++ b/src/views/tested/subpackage/directory/index.vue @@ -44,6 +44,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem('subpackge-directory') || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com }) diff --git a/src/views/tested/subpackage/review/components/edit.vue b/src/views/tested/subpackage/review/components/edit.vue index b9e3e5f..499a4ec 100644 --- a/src/views/tested/subpackage/review/components/edit.vue +++ b/src/views/tested/subpackage/review/components/edit.vue @@ -7,7 +7,7 @@ import ApprovalDialog from './ApprovalDialog.vue' import subpackageDialog from './subpackageDialog.vue' import showPhoto from '@/views/tested/device/info/components/showPhotoSinge.vue' -import { editBtn, submitBtn } from '@/utils/applyBtns' +import { delTextBtn, editBtn, submitBtn } from '@/utils/applyBtns' import { getDictByCode } from '@/api/system/dict' import { SCHEDULE } from '@/utils/scheduleDict' import { uploadApi } from '@/api/system/notice' @@ -294,7 +294,7 @@ 保存 - + 删除 diff --git a/src/views/tested/subpackage/review/components/list.vue b/src/views/tested/subpackage/review/components/list.vue index 03185f9..e2ed430 100644 --- a/src/views/tested/subpackage/review/components/list.vue +++ b/src/views/tested/subpackage/review/components/list.vue @@ -81,6 +81,8 @@ list.value = response.data.rows total.value = parseInt(response.data.total) listLoading.value = false + }).catch(() => { + listLoading.value = false }) } // 查询数据 @@ -236,12 +238,14 @@ // 审批状态发生变化 watch(() => $props.statusName, (newVal) => { - listQuery.approvalStatus = applyDict.value[newVal] as string - fetchData() + if (newVal) { + listQuery.approvalStatus = applyDict.value[newVal] as string + fetchData() + } }, { deep: true, - // immediate: true, + immediate: true, }) const permUrl = ref({ edit: '/tested/device/info/edit', diff --git a/src/views/tested/subpackage/review/index.vue b/src/views/tested/subpackage/review/index.vue index 3d83c5c..2903dd5 100644 --- a/src/views/tested/subpackage/review/index.vue +++ b/src/views/tested/subpackage/review/index.vue @@ -44,6 +44,7 @@ onMounted(async () => { await getMenuStatus() + current.value = '' current.value = window.sessionStorage.getItem('subpackge-review') || '全部' com.value = menu.value.filter(item => item.name === current.value)[0].com })