diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 5bbaa24..9049282 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -66,6 +66,7 @@ return request({ url: '/meter/stateManage/exportStateManageList', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 5bbaa24..9049282 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -66,6 +66,7 @@ return request({ url: '/meter/stateManage/exportStateManageList', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index 3748056..2e8e4a7 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -233,7 +233,7 @@ // 调导出接口 exportApply(params).then((res) => { const blob = new Blob([res.data]) - exportFile(blob, '设备处理申请列表.xlsx') + exportFile(blob, '设备借用处理列表.xlsx') }) } else { diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 5bbaa24..9049282 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -66,6 +66,7 @@ return request({ url: '/meter/stateManage/exportStateManageList', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index 3748056..2e8e4a7 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -233,7 +233,7 @@ // 调导出接口 exportApply(params).then((res) => { const blob = new Blob([res.data]) - exportFile(blob, '设备处理申请列表.xlsx') + exportFile(blob, '设备借用处理列表.xlsx') }) } else { diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index eac27b0..0c22c33 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -15,6 +15,7 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { SCHEDULE } from '@/utils/scheduleDict' import type { dictType } from '@/views/device/receive/receive' +import { exportFile } from '@/utils/exportUtils' // 选中的按钮 const props = defineProps({ @@ -356,23 +357,34 @@ } // 导出 const exportExcelBtn = () => { - const postData = { - applyType: searchQuery.applyType, - approvalStatus: searchQuery.approvalStatus, - createUser: searchQuery.createUser, - ids: [] as number[], - } - postData.ids = selectList.value.map((item) => { - return item.id - }) - exportStatus(postData).then((res) => { - - }) const loading = ElLoading.service({ lock: true, - text: 'Loading', + text: '下载中请稍后', background: 'rgba(255, 255, 255, 0.8)', }) + if (list.value.length > 0) { + const selectIds = selectList.value.map(item => item.id) + const params = { + applyNo: searchQuery.applyNo, // 申请编号 + applyStatus: searchQuery.applyStatus, // 申请状态 + applyUnit: searchQuery.applyUnit, // 申请部门 + approvalStatus: searchQuery.approvalStatus, // 申请人 + createUser: searchQuery.createUser, // 创建人 + equipmentName: searchQuery.equipmentName, // 设备名称 + equipmentNo: searchQuery.equipmentNo, // 设备编号 + applyType: searchQuery.applyType, // 申请类型 + formId: SCHEDULE[props.formCode as keyof typeof SCHEDULE], + ids: selectIds, + } + // 调导出接口 + exportStatus(params).then((res) => { + const blob = new Blob([res.data]) + exportFile(blob, `${props.name}.xlsx`) + }) + } + else { + ElMessage.warning('无数据可导出数据') + } loading.close() } const fileRef = ref() // 文件上传input diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 5bbaa24..9049282 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -66,6 +66,7 @@ return request({ url: '/meter/stateManage/exportStateManageList', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index 3748056..2e8e4a7 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -233,7 +233,7 @@ // 调导出接口 exportApply(params).then((res) => { const blob = new Blob([res.data]) - exportFile(blob, '设备处理申请列表.xlsx') + exportFile(blob, '设备借用处理列表.xlsx') }) } else { diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index eac27b0..0c22c33 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -15,6 +15,7 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { SCHEDULE } from '@/utils/scheduleDict' import type { dictType } from '@/views/device/receive/receive' +import { exportFile } from '@/utils/exportUtils' // 选中的按钮 const props = defineProps({ @@ -356,23 +357,34 @@ } // 导出 const exportExcelBtn = () => { - const postData = { - applyType: searchQuery.applyType, - approvalStatus: searchQuery.approvalStatus, - createUser: searchQuery.createUser, - ids: [] as number[], - } - postData.ids = selectList.value.map((item) => { - return item.id - }) - exportStatus(postData).then((res) => { - - }) const loading = ElLoading.service({ lock: true, - text: 'Loading', + text: '下载中请稍后', background: 'rgba(255, 255, 255, 0.8)', }) + if (list.value.length > 0) { + const selectIds = selectList.value.map(item => item.id) + const params = { + applyNo: searchQuery.applyNo, // 申请编号 + applyStatus: searchQuery.applyStatus, // 申请状态 + applyUnit: searchQuery.applyUnit, // 申请部门 + approvalStatus: searchQuery.approvalStatus, // 申请人 + createUser: searchQuery.createUser, // 创建人 + equipmentName: searchQuery.equipmentName, // 设备名称 + equipmentNo: searchQuery.equipmentNo, // 设备编号 + applyType: searchQuery.applyType, // 申请类型 + formId: SCHEDULE[props.formCode as keyof typeof SCHEDULE], + ids: selectIds, + } + // 调导出接口 + exportStatus(params).then((res) => { + const blob = new Blob([res.data]) + exportFile(blob, `${props.name}.xlsx`) + }) + } + else { + ElMessage.warning('无数据可导出数据') + } loading.close() } const fileRef = ref() // 文件上传input diff --git a/src/views/measure/person/certificateLog.vue b/src/views/measure/person/certificateLog.vue index 7b58ee8..3c20c77 100644 --- a/src/views/measure/person/certificateLog.vue +++ b/src/views/measure/person/certificateLog.vue @@ -9,6 +9,8 @@ import { exportFile } from '@/utils/exportUtils' // import type { DeptTreeNode } from '@/views/system/dept/dept-interface' import { toTreeList } from '@/utils/structure' +import type { TableColumn } from '@/components/NormalTable/table_interface' + const props = defineProps({ isRemind: { type: Boolean, @@ -36,7 +38,7 @@ }) // 查询参数 const loadingTable = ref(false) // 表格loading const total = ref(0) // 数据总条数 -const columns = ref([ +const columns = ref([ { text: '人员编号', value: 'staffNo', align: 'center' }, { text: '姓名', value: 'name', align: 'center', width: 90 }, { text: '性别', value: 'sex', align: 'center', width: 90 }, @@ -358,7 +360,7 @@ { const blob = new Blob([res.data]) - exportFile(blob, '设备处理申请列表.xlsx') + exportFile(blob, '设备借用处理列表.xlsx') }) } else { diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index eac27b0..0c22c33 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -15,6 +15,7 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { SCHEDULE } from '@/utils/scheduleDict' import type { dictType } from '@/views/device/receive/receive' +import { exportFile } from '@/utils/exportUtils' // 选中的按钮 const props = defineProps({ @@ -356,23 +357,34 @@ } // 导出 const exportExcelBtn = () => { - const postData = { - applyType: searchQuery.applyType, - approvalStatus: searchQuery.approvalStatus, - createUser: searchQuery.createUser, - ids: [] as number[], - } - postData.ids = selectList.value.map((item) => { - return item.id - }) - exportStatus(postData).then((res) => { - - }) const loading = ElLoading.service({ lock: true, - text: 'Loading', + text: '下载中请稍后', background: 'rgba(255, 255, 255, 0.8)', }) + if (list.value.length > 0) { + const selectIds = selectList.value.map(item => item.id) + const params = { + applyNo: searchQuery.applyNo, // 申请编号 + applyStatus: searchQuery.applyStatus, // 申请状态 + applyUnit: searchQuery.applyUnit, // 申请部门 + approvalStatus: searchQuery.approvalStatus, // 申请人 + createUser: searchQuery.createUser, // 创建人 + equipmentName: searchQuery.equipmentName, // 设备名称 + equipmentNo: searchQuery.equipmentNo, // 设备编号 + applyType: searchQuery.applyType, // 申请类型 + formId: SCHEDULE[props.formCode as keyof typeof SCHEDULE], + ids: selectIds, + } + // 调导出接口 + exportStatus(params).then((res) => { + const blob = new Blob([res.data]) + exportFile(blob, `${props.name}.xlsx`) + }) + } + else { + ElMessage.warning('无数据可导出数据') + } loading.close() } const fileRef = ref() // 文件上传input diff --git a/src/views/measure/person/certificateLog.vue b/src/views/measure/person/certificateLog.vue index 7b58ee8..3c20c77 100644 --- a/src/views/measure/person/certificateLog.vue +++ b/src/views/measure/person/certificateLog.vue @@ -9,6 +9,8 @@ import { exportFile } from '@/utils/exportUtils' // import type { DeptTreeNode } from '@/views/system/dept/dept-interface' import { toTreeList } from '@/utils/structure' +import type { TableColumn } from '@/components/NormalTable/table_interface' + const props = defineProps({ isRemind: { type: Boolean, @@ -36,7 +38,7 @@ }) // 查询参数 const loadingTable = ref(false) // 表格loading const total = ref(0) // 数据总条数 -const columns = ref([ +const columns = ref([ { text: '人员编号', value: 'staffNo', align: 'center' }, { text: '姓名', value: 'name', align: 'center', width: 90 }, { text: '性别', value: 'sex', align: 'center', width: 90 }, @@ -358,7 +360,7 @@ { if (!formEl) { return } + console.log(changeList) + // 当前选中的证书基本信息列表 + const currentData = currentShow.value.data await formEl.validate((valid, fields) => { if (valid) { ElMessageBox.confirm( @@ -495,9 +498,11 @@ ruleForm.value[key] = null } } + // changeList.value[0].data + // handleRecord(changeList.value[0].deepData (title.value === '新建' ? getStaffAdd({ ...ruleForm.value, certificateList: changeList.value[0].data, birthday: `${ruleForm.value.idCard.substring(6, 10)}-${ruleForm.value.idCard.substring(10, 12)}-${ruleForm.value.idCard.substring(12, 14)}` }) - : getStaffupdate({ ...ruleForm.value, certificateList: handleRecord(changeList.value[0].deepData, changeList.value[0].data), birthday: `${ruleForm.value.idCard.substring(6, 10)}-${ruleForm.value.idCard.substring(10, 12)}-${ruleForm.value.idCard.substring(12, 14)}` })).then((res) => { + : getStaffupdate({ ...ruleForm.value, certificateList: changeList.value[0].data, birthday: `${ruleForm.value.idCard.substring(6, 10)}-${ruleForm.value.idCard.substring(10, 12)}-${ruleForm.value.idCard.substring(12, 14)}` })).then((res) => { if (res.code == 200) { formEl?.resetFields() ElMessage.success('提交成功') diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 5bbaa24..9049282 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -66,6 +66,7 @@ return request({ url: '/meter/stateManage/exportStateManageList', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index 3748056..2e8e4a7 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -233,7 +233,7 @@ // 调导出接口 exportApply(params).then((res) => { const blob = new Blob([res.data]) - exportFile(blob, '设备处理申请列表.xlsx') + exportFile(blob, '设备借用处理列表.xlsx') }) } else { diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index eac27b0..0c22c33 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -15,6 +15,7 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { SCHEDULE } from '@/utils/scheduleDict' import type { dictType } from '@/views/device/receive/receive' +import { exportFile } from '@/utils/exportUtils' // 选中的按钮 const props = defineProps({ @@ -356,23 +357,34 @@ } // 导出 const exportExcelBtn = () => { - const postData = { - applyType: searchQuery.applyType, - approvalStatus: searchQuery.approvalStatus, - createUser: searchQuery.createUser, - ids: [] as number[], - } - postData.ids = selectList.value.map((item) => { - return item.id - }) - exportStatus(postData).then((res) => { - - }) const loading = ElLoading.service({ lock: true, - text: 'Loading', + text: '下载中请稍后', background: 'rgba(255, 255, 255, 0.8)', }) + if (list.value.length > 0) { + const selectIds = selectList.value.map(item => item.id) + const params = { + applyNo: searchQuery.applyNo, // 申请编号 + applyStatus: searchQuery.applyStatus, // 申请状态 + applyUnit: searchQuery.applyUnit, // 申请部门 + approvalStatus: searchQuery.approvalStatus, // 申请人 + createUser: searchQuery.createUser, // 创建人 + equipmentName: searchQuery.equipmentName, // 设备名称 + equipmentNo: searchQuery.equipmentNo, // 设备编号 + applyType: searchQuery.applyType, // 申请类型 + formId: SCHEDULE[props.formCode as keyof typeof SCHEDULE], + ids: selectIds, + } + // 调导出接口 + exportStatus(params).then((res) => { + const blob = new Blob([res.data]) + exportFile(blob, `${props.name}.xlsx`) + }) + } + else { + ElMessage.warning('无数据可导出数据') + } loading.close() } const fileRef = ref() // 文件上传input diff --git a/src/views/measure/person/certificateLog.vue b/src/views/measure/person/certificateLog.vue index 7b58ee8..3c20c77 100644 --- a/src/views/measure/person/certificateLog.vue +++ b/src/views/measure/person/certificateLog.vue @@ -9,6 +9,8 @@ import { exportFile } from '@/utils/exportUtils' // import type { DeptTreeNode } from '@/views/system/dept/dept-interface' import { toTreeList } from '@/utils/structure' +import type { TableColumn } from '@/components/NormalTable/table_interface' + const props = defineProps({ isRemind: { type: Boolean, @@ -36,7 +38,7 @@ }) // 查询参数 const loadingTable = ref(false) // 表格loading const total = ref(0) // 数据总条数 -const columns = ref([ +const columns = ref([ { text: '人员编号', value: 'staffNo', align: 'center' }, { text: '姓名', value: 'name', align: 'center', width: 90 }, { text: '性别', value: 'sex', align: 'center', width: 90 }, @@ -358,7 +360,7 @@ { if (!formEl) { return } + console.log(changeList) + // 当前选中的证书基本信息列表 + const currentData = currentShow.value.data await formEl.validate((valid, fields) => { if (valid) { ElMessageBox.confirm( @@ -495,9 +498,11 @@ ruleForm.value[key] = null } } + // changeList.value[0].data + // handleRecord(changeList.value[0].deepData (title.value === '新建' ? getStaffAdd({ ...ruleForm.value, certificateList: changeList.value[0].data, birthday: `${ruleForm.value.idCard.substring(6, 10)}-${ruleForm.value.idCard.substring(10, 12)}-${ruleForm.value.idCard.substring(12, 14)}` }) - : getStaffupdate({ ...ruleForm.value, certificateList: handleRecord(changeList.value[0].deepData, changeList.value[0].data), birthday: `${ruleForm.value.idCard.substring(6, 10)}-${ruleForm.value.idCard.substring(10, 12)}-${ruleForm.value.idCard.substring(12, 14)}` })).then((res) => { + : getStaffupdate({ ...ruleForm.value, certificateList: changeList.value[0].data, birthday: `${ruleForm.value.idCard.substring(6, 10)}-${ruleForm.value.idCard.substring(10, 12)}-${ruleForm.value.idCard.substring(12, 14)}` })).then((res) => { if (res.code == 200) { formEl?.resetFields() ElMessage.success('提交成功') diff --git a/src/views/measure/person/components/addRecord.vue b/src/views/measure/person/components/addRecord.vue index 8959b08..5c915a2 100644 --- a/src/views/measure/person/components/addRecord.vue +++ b/src/views/measure/person/components/addRecord.vue @@ -330,17 +330,17 @@ - + - + - + diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 5bbaa24..9049282 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -66,6 +66,7 @@ return request({ url: '/meter/stateManage/exportStateManageList', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index 3748056..2e8e4a7 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -233,7 +233,7 @@ // 调导出接口 exportApply(params).then((res) => { const blob = new Blob([res.data]) - exportFile(blob, '设备处理申请列表.xlsx') + exportFile(blob, '设备借用处理列表.xlsx') }) } else { diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index eac27b0..0c22c33 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -15,6 +15,7 @@ import type { TableColumn } from '@/components/NormalTable/table_interface' import { SCHEDULE } from '@/utils/scheduleDict' import type { dictType } from '@/views/device/receive/receive' +import { exportFile } from '@/utils/exportUtils' // 选中的按钮 const props = defineProps({ @@ -356,23 +357,34 @@ } // 导出 const exportExcelBtn = () => { - const postData = { - applyType: searchQuery.applyType, - approvalStatus: searchQuery.approvalStatus, - createUser: searchQuery.createUser, - ids: [] as number[], - } - postData.ids = selectList.value.map((item) => { - return item.id - }) - exportStatus(postData).then((res) => { - - }) const loading = ElLoading.service({ lock: true, - text: 'Loading', + text: '下载中请稍后', background: 'rgba(255, 255, 255, 0.8)', }) + if (list.value.length > 0) { + const selectIds = selectList.value.map(item => item.id) + const params = { + applyNo: searchQuery.applyNo, // 申请编号 + applyStatus: searchQuery.applyStatus, // 申请状态 + applyUnit: searchQuery.applyUnit, // 申请部门 + approvalStatus: searchQuery.approvalStatus, // 申请人 + createUser: searchQuery.createUser, // 创建人 + equipmentName: searchQuery.equipmentName, // 设备名称 + equipmentNo: searchQuery.equipmentNo, // 设备编号 + applyType: searchQuery.applyType, // 申请类型 + formId: SCHEDULE[props.formCode as keyof typeof SCHEDULE], + ids: selectIds, + } + // 调导出接口 + exportStatus(params).then((res) => { + const blob = new Blob([res.data]) + exportFile(blob, `${props.name}.xlsx`) + }) + } + else { + ElMessage.warning('无数据可导出数据') + } loading.close() } const fileRef = ref() // 文件上传input diff --git a/src/views/measure/person/certificateLog.vue b/src/views/measure/person/certificateLog.vue index 7b58ee8..3c20c77 100644 --- a/src/views/measure/person/certificateLog.vue +++ b/src/views/measure/person/certificateLog.vue @@ -9,6 +9,8 @@ import { exportFile } from '@/utils/exportUtils' // import type { DeptTreeNode } from '@/views/system/dept/dept-interface' import { toTreeList } from '@/utils/structure' +import type { TableColumn } from '@/components/NormalTable/table_interface' + const props = defineProps({ isRemind: { type: Boolean, @@ -36,7 +38,7 @@ }) // 查询参数 const loadingTable = ref(false) // 表格loading const total = ref(0) // 数据总条数 -const columns = ref([ +const columns = ref([ { text: '人员编号', value: 'staffNo', align: 'center' }, { text: '姓名', value: 'name', align: 'center', width: 90 }, { text: '性别', value: 'sex', align: 'center', width: 90 }, @@ -358,7 +360,7 @@ { if (!formEl) { return } + console.log(changeList) + // 当前选中的证书基本信息列表 + const currentData = currentShow.value.data await formEl.validate((valid, fields) => { if (valid) { ElMessageBox.confirm( @@ -495,9 +498,11 @@ ruleForm.value[key] = null } } + // changeList.value[0].data + // handleRecord(changeList.value[0].deepData (title.value === '新建' ? getStaffAdd({ ...ruleForm.value, certificateList: changeList.value[0].data, birthday: `${ruleForm.value.idCard.substring(6, 10)}-${ruleForm.value.idCard.substring(10, 12)}-${ruleForm.value.idCard.substring(12, 14)}` }) - : getStaffupdate({ ...ruleForm.value, certificateList: handleRecord(changeList.value[0].deepData, changeList.value[0].data), birthday: `${ruleForm.value.idCard.substring(6, 10)}-${ruleForm.value.idCard.substring(10, 12)}-${ruleForm.value.idCard.substring(12, 14)}` })).then((res) => { + : getStaffupdate({ ...ruleForm.value, certificateList: changeList.value[0].data, birthday: `${ruleForm.value.idCard.substring(6, 10)}-${ruleForm.value.idCard.substring(10, 12)}-${ruleForm.value.idCard.substring(12, 14)}` })).then((res) => { if (res.code == 200) { formEl?.resetFields() ElMessage.success('提交成功') diff --git a/src/views/measure/person/components/addRecord.vue b/src/views/measure/person/components/addRecord.vue index 8959b08..5c915a2 100644 --- a/src/views/measure/person/components/addRecord.vue +++ b/src/views/measure/person/components/addRecord.vue @@ -330,17 +330,17 @@ - + - + - + diff --git a/src/views/measure/person/components/personListDialog.vue b/src/views/measure/person/components/personListDialog.vue index 90c6daf..a53f015 100644 --- a/src/views/measure/person/components/personListDialog.vue +++ b/src/views/measure/person/components/personListDialog.vue @@ -6,6 +6,8 @@ // import type { TreeStructure } from '@/views/system/user/user-interface' import comTreeSelect from '@/views/system/user/selecTree.vue' import { toTreeList } from '@/utils/structure' +import type { TableColumn } from '@/components/NormalTable/table_interface' + const emits = defineEmits(['add']) const dialogFormVisible = ref(false) // 查询条件 @@ -20,7 +22,7 @@ const list = ref([]) // 表格数据 const total = ref(0) const select = ref() -const columns = ref([ +const columns = ref([ { text: '人员编号', value: 'staffNo', width: '160', fixed: true }, { text: '姓名', value: 'name', fixed: true }, { text: '所在部门', value: 'deptId' }, @@ -138,16 +140,16 @@ :list-loading="loadingTable" @change="changePage" >