diff --git a/src/api/system/plan.ts b/src/api/system/plan.ts index 33b384f..511befd 100644 --- a/src/api/system/plan.ts +++ b/src/api/system/plan.ts @@ -4,8 +4,28 @@ import request from '../index' const prefix = '/meter' +// 导出培训计录列表 +export function exportLogList(data: object) { + return request({ + url: `${prefix}/train/log/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 导出培训计划列表 +export function exportPlanList(data: object) { + return request({ + url: `${prefix}/train/plan/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} + // 列表查询 -export function getPlanList(data: object) { +export function getPlanList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/train/plan/listPage?offset=${data.offset}&limit=${data.limit} `, method: 'post', @@ -56,7 +76,7 @@ } // 培训记录列表 -export function getLogList(data: object) { +export function getLogList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/train/log/listPage?offset=${data.offset}&limit=${data.limit} `, method: 'post', diff --git a/src/api/system/plan.ts b/src/api/system/plan.ts index 33b384f..511befd 100644 --- a/src/api/system/plan.ts +++ b/src/api/system/plan.ts @@ -4,8 +4,28 @@ import request from '../index' const prefix = '/meter' +// 导出培训计录列表 +export function exportLogList(data: object) { + return request({ + url: `${prefix}/train/log/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 导出培训计划列表 +export function exportPlanList(data: object) { + return request({ + url: `${prefix}/train/plan/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} + // 列表查询 -export function getPlanList(data: object) { +export function getPlanList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/train/plan/listPage?offset=${data.offset}&limit=${data.limit} `, method: 'post', @@ -56,7 +76,7 @@ } // 培训记录列表 -export function getLogList(data: object) { +export function getLogList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/train/log/listPage?offset=${data.offset}&limit=${data.limit} `, method: 'post', diff --git a/src/api/system/price.ts b/src/api/system/price.ts index ddee1a1..e4fdb53 100644 --- a/src/api/system/price.ts +++ b/src/api/system/price.ts @@ -1,8 +1,18 @@ import request from '../index' const prefix = '/price' +// 导出列表 +export function exportPriceList(data: object) { + return request({ + url: `${prefix}/exportPriceList`, + method: 'post', + responseType: 'blob', + data, + }) +} + // 价格列表查询 -export function getPriceList(data: object) { +export function getPriceList(data: { offset: number; limit: string }) { return request({ url: `${prefix}/queryPriceList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/api/system/plan.ts b/src/api/system/plan.ts index 33b384f..511befd 100644 --- a/src/api/system/plan.ts +++ b/src/api/system/plan.ts @@ -4,8 +4,28 @@ import request from '../index' const prefix = '/meter' +// 导出培训计录列表 +export function exportLogList(data: object) { + return request({ + url: `${prefix}/train/log/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 导出培训计划列表 +export function exportPlanList(data: object) { + return request({ + url: `${prefix}/train/plan/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} + // 列表查询 -export function getPlanList(data: object) { +export function getPlanList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/train/plan/listPage?offset=${data.offset}&limit=${data.limit} `, method: 'post', @@ -56,7 +76,7 @@ } // 培训记录列表 -export function getLogList(data: object) { +export function getLogList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/train/log/listPage?offset=${data.offset}&limit=${data.limit} `, method: 'post', diff --git a/src/api/system/price.ts b/src/api/system/price.ts index ddee1a1..e4fdb53 100644 --- a/src/api/system/price.ts +++ b/src/api/system/price.ts @@ -1,8 +1,18 @@ import request from '../index' const prefix = '/price' +// 导出列表 +export function exportPriceList(data: object) { + return request({ + url: `${prefix}/exportPriceList`, + method: 'post', + responseType: 'blob', + data, + }) +} + // 价格列表查询 -export function getPriceList(data: object) { +export function getPriceList(data: { offset: number; limit: string }) { return request({ url: `${prefix}/queryPriceList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/views/device/deviceMaintenance/components/listApply/listPageAdd.vue b/src/views/device/deviceMaintenance/components/listApply/listPageAdd.vue index 6527f2e..5b4b6c7 100644 --- a/src/views/device/deviceMaintenance/components/listApply/listPageAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApply/listPageAdd.vue @@ -331,7 +331,34 @@ > - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/src/api/system/plan.ts b/src/api/system/plan.ts index 33b384f..511befd 100644 --- a/src/api/system/plan.ts +++ b/src/api/system/plan.ts @@ -4,8 +4,28 @@ import request from '../index' const prefix = '/meter' +// 导出培训计录列表 +export function exportLogList(data: object) { + return request({ + url: `${prefix}/train/log/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 导出培训计划列表 +export function exportPlanList(data: object) { + return request({ + url: `${prefix}/train/plan/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} + // 列表查询 -export function getPlanList(data: object) { +export function getPlanList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/train/plan/listPage?offset=${data.offset}&limit=${data.limit} `, method: 'post', @@ -56,7 +76,7 @@ } // 培训记录列表 -export function getLogList(data: object) { +export function getLogList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/train/log/listPage?offset=${data.offset}&limit=${data.limit} `, method: 'post', diff --git a/src/api/system/price.ts b/src/api/system/price.ts index ddee1a1..e4fdb53 100644 --- a/src/api/system/price.ts +++ b/src/api/system/price.ts @@ -1,8 +1,18 @@ import request from '../index' const prefix = '/price' +// 导出列表 +export function exportPriceList(data: object) { + return request({ + url: `${prefix}/exportPriceList`, + method: 'post', + responseType: 'blob', + data, + }) +} + // 价格列表查询 -export function getPriceList(data: object) { +export function getPriceList(data: { offset: number; limit: string }) { return request({ url: `${prefix}/queryPriceList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/views/device/deviceMaintenance/components/listApply/listPageAdd.vue b/src/views/device/deviceMaintenance/components/listApply/listPageAdd.vue index 6527f2e..5b4b6c7 100644 --- a/src/views/device/deviceMaintenance/components/listApply/listPageAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApply/listPageAdd.vue @@ -331,7 +331,34 @@ > - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 1263b6c..29dfbae 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -119,7 +119,7 @@ > {{ pageType === 'detail' ? '打印' : '提交' }} - + 关闭 diff --git a/src/api/system/plan.ts b/src/api/system/plan.ts index 33b384f..511befd 100644 --- a/src/api/system/plan.ts +++ b/src/api/system/plan.ts @@ -4,8 +4,28 @@ import request from '../index' const prefix = '/meter' +// 导出培训计录列表 +export function exportLogList(data: object) { + return request({ + url: `${prefix}/train/log/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 导出培训计划列表 +export function exportPlanList(data: object) { + return request({ + url: `${prefix}/train/plan/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} + // 列表查询 -export function getPlanList(data: object) { +export function getPlanList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/train/plan/listPage?offset=${data.offset}&limit=${data.limit} `, method: 'post', @@ -56,7 +76,7 @@ } // 培训记录列表 -export function getLogList(data: object) { +export function getLogList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/train/log/listPage?offset=${data.offset}&limit=${data.limit} `, method: 'post', diff --git a/src/api/system/price.ts b/src/api/system/price.ts index ddee1a1..e4fdb53 100644 --- a/src/api/system/price.ts +++ b/src/api/system/price.ts @@ -1,8 +1,18 @@ import request from '../index' const prefix = '/price' +// 导出列表 +export function exportPriceList(data: object) { + return request({ + url: `${prefix}/exportPriceList`, + method: 'post', + responseType: 'blob', + data, + }) +} + // 价格列表查询 -export function getPriceList(data: object) { +export function getPriceList(data: { offset: number; limit: string }) { return request({ url: `${prefix}/queryPriceList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/views/device/deviceMaintenance/components/listApply/listPageAdd.vue b/src/views/device/deviceMaintenance/components/listApply/listPageAdd.vue index 6527f2e..5b4b6c7 100644 --- a/src/views/device/deviceMaintenance/components/listApply/listPageAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApply/listPageAdd.vue @@ -331,7 +331,34 @@ > - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 1263b6c..29dfbae 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -119,7 +119,7 @@ > {{ pageType === 'detail' ? '打印' : '提交' }} - + 关闭 diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index d588b8d..eeb8e78 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -81,11 +81,14 @@ const { proxy } = getCurrentInstance() as any const getStatisticList = () => { const params = { - createTime: '', + createEndTime: '', + createStartTime: '', deptId: 0, director: '', effectiveCompany: '', - trainTime: '', + ids: [], + trainEndTime: '', + trainStartTime: '', offset: 1, limit: 10000, } @@ -153,15 +156,18 @@ } const getmeterageList = () => { const params = { - fileNo: '', // 编号 - fileName: '', // 名称 - publishTime: '', // 发布时间 - fileCode: '', // 文件号 - effectiveTime: '', // 实施时间 - effectiveStatus: '', // 实施状态 + effectiveEndTime: '', + effectiveStartTime: '', + effectiveStatus: '', + fileCode: '', + fileName: '', + fileNo: '', + fileType: '', + ids: [], + publishEndTime: '', + publishStartTime: '', limit: 10, offset: 1, - fileType: '', // 类型 } listPageApi(params).then((res) => { meterageTableData.value = res.data.rows @@ -200,7 +206,14 @@ :style="{ height: blockHeight }" :height="blockHeight" > - + -
+
-
+
{{ item.text }}
-
+
- +
- +
- {{ CertificateObject.lastValidDate }} + {{ CertificateObject.lastValidDate + }}
最近到期时间
@@ -315,14 +351,24 @@
- + - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 1263b6c..29dfbae 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -119,7 +119,7 @@ > {{ pageType === 'detail' ? '打印' : '提交' }} - + 关闭
diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index d588b8d..eeb8e78 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -81,11 +81,14 @@ const { proxy } = getCurrentInstance() as any const getStatisticList = () => { const params = { - createTime: '', + createEndTime: '', + createStartTime: '', deptId: 0, director: '', effectiveCompany: '', - trainTime: '', + ids: [], + trainEndTime: '', + trainStartTime: '', offset: 1, limit: 10000, } @@ -153,15 +156,18 @@ } const getmeterageList = () => { const params = { - fileNo: '', // 编号 - fileName: '', // 名称 - publishTime: '', // 发布时间 - fileCode: '', // 文件号 - effectiveTime: '', // 实施时间 - effectiveStatus: '', // 实施状态 + effectiveEndTime: '', + effectiveStartTime: '', + effectiveStatus: '', + fileCode: '', + fileName: '', + fileNo: '', + fileType: '', + ids: [], + publishEndTime: '', + publishStartTime: '', limit: 10, offset: 1, - fileType: '', // 类型 } listPageApi(params).then((res) => { meterageTableData.value = res.data.rows @@ -200,7 +206,14 @@ :style="{ height: blockHeight }" :height="blockHeight" > - + -
+
-
+
{{ item.text }}
-
+
- +
- +
- {{ CertificateObject.lastValidDate }} + {{ CertificateObject.lastValidDate + }}
最近到期时间
@@ -315,14 +351,24 @@
- + = ref({ checkType: '', // 检校类型 @@ -40,7 +42,7 @@ ] // 选中的内容 -const checkoutList = ref([]) +const checkoutList = ref([]) // 文件上传input const fileRef = ref() // 删除id @@ -71,7 +73,7 @@ fetchData(true) // 多选发生改变时 const handleSelectionChange = (e: any) => { - checkoutList.value = e + checkoutList.value = e.map((item: { id: string }) => item.id) } const $router = useRouter() @@ -153,27 +155,25 @@ const exportExcelBtn = () => { const loading = ElLoading.service({ lock: true, - text: 'Loading', + text: '下载中请稍后', background: 'rgba(255, 255, 255, 0.8)', }) - if (checkoutList.value.length <= 0 && list.value.length > 0) { - exportExcel({ - json: list.value.map((item: IlistType, index: number) => ({ index: index + 1, priceNo: item.priceNo, priceName: item.priceName, checkType: item.checkType, priceType: item.priceType, priceItem: item.priceItem, price: item.price, operatorDiscountPermission: item.operatorDiscountPermission, directorDiscountPermission: item.directorDiscountPermission, priceStandard: item.priceStandard, createTime: item.createTime })), - name: '价格列表', - titleArr: ['序号', '价格编号', '价格名称', '检校类型', '类别', '项目', '标准价格(元)', '业务员折扣权限', '负责人折扣权限', '依据标准', '创建时间'], - sheetName: 'sheet1', - }) - } - else if (checkoutList.value.length > 0) { - exportExcel({ - json: checkoutList.value.map((item: IlistType, index: number) => ({ index: index + 1, priceNo: item.priceNo, priceName: item.priceName, checkType: item.checkType, priceType: item.priceType, priceItem: item.priceItem, price: item.price, operatorDiscountPermission: item.operatorDiscountPermission, directorDiscountPermission: item.directorDiscountPermission, priceStandard: item.priceStandard, createTime: item.createTime })), - name: '价格列表', - titleArr: ['序号', '价格编号', '价格名称', '检校类型', '类别', '项目', '标准价格(元)', '业务员折扣权限', '负责人折扣权限', '依据标准', '创建时间'], - sheetName: 'sheet1', + if (list.value.length > 0) { + const params = { + checkType: '', + model: '', + priceItem: '', + priceName: '', + priceNo: '', + priceType: '', + } + exportPriceList(params).then((res) => { + const blob = new Blob([res.data]) + exportFile(blob, '价格列表.xlsx') }) } else { - ElMessage.warning('暂无数据') + ElMessage.warning('无数据可导出数据') } loading.close() } @@ -222,15 +222,26 @@ const exportAll = () => { exportExcelBtn() } -// 打印 -const printObj = ref({ - id: 'print', // 需要打印元素的id - popTitle: '价格列表', // 打印配置页上方的标题 - extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 - preview: false, // 是否启动预览模式,默认是false - standard: '', - extarCss: '', -}) +// 打印列表 +function printList() { + // 打印列 + const properties = columns.value.map((item) => { + return { + field: item.value, + displayName: item.text, + } + }) + if (checkoutList.value.length <= 0 && list.value.length > 0) { + printJSON(list.value, properties, '培训计划列表') + } + else if (checkoutList.value.length > 0) { + const printList = list.value.filter((item: { id: string }) => checkoutList.value.includes(item.id)) + printJSON(printList, properties, '培训计划列表') + } + else { + ElMessage.warning('无可打印内容') + } +} - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 1263b6c..29dfbae 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -119,7 +119,7 @@ > {{ pageType === 'detail' ? '打印' : '提交' }} - + 关闭
diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index d588b8d..eeb8e78 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -81,11 +81,14 @@ const { proxy } = getCurrentInstance() as any const getStatisticList = () => { const params = { - createTime: '', + createEndTime: '', + createStartTime: '', deptId: 0, director: '', effectiveCompany: '', - trainTime: '', + ids: [], + trainEndTime: '', + trainStartTime: '', offset: 1, limit: 10000, } @@ -153,15 +156,18 @@ } const getmeterageList = () => { const params = { - fileNo: '', // 编号 - fileName: '', // 名称 - publishTime: '', // 发布时间 - fileCode: '', // 文件号 - effectiveTime: '', // 实施时间 - effectiveStatus: '', // 实施状态 + effectiveEndTime: '', + effectiveStartTime: '', + effectiveStatus: '', + fileCode: '', + fileName: '', + fileNo: '', + fileType: '', + ids: [], + publishEndTime: '', + publishStartTime: '', limit: 10, offset: 1, - fileType: '', // 类型 } listPageApi(params).then((res) => { meterageTableData.value = res.data.rows @@ -200,7 +206,14 @@ :style="{ height: blockHeight }" :height="blockHeight" > - + -
+
-
+
{{ item.text }}
-
+
- +
- +
- {{ CertificateObject.lastValidDate }} + {{ CertificateObject.lastValidDate + }}
最近到期时间
@@ -315,14 +351,24 @@
- + = ref({ checkType: '', // 检校类型 @@ -40,7 +42,7 @@ ] // 选中的内容 -const checkoutList = ref([]) +const checkoutList = ref([]) // 文件上传input const fileRef = ref() // 删除id @@ -71,7 +73,7 @@ fetchData(true) // 多选发生改变时 const handleSelectionChange = (e: any) => { - checkoutList.value = e + checkoutList.value = e.map((item: { id: string }) => item.id) } const $router = useRouter() @@ -153,27 +155,25 @@ const exportExcelBtn = () => { const loading = ElLoading.service({ lock: true, - text: 'Loading', + text: '下载中请稍后', background: 'rgba(255, 255, 255, 0.8)', }) - if (checkoutList.value.length <= 0 && list.value.length > 0) { - exportExcel({ - json: list.value.map((item: IlistType, index: number) => ({ index: index + 1, priceNo: item.priceNo, priceName: item.priceName, checkType: item.checkType, priceType: item.priceType, priceItem: item.priceItem, price: item.price, operatorDiscountPermission: item.operatorDiscountPermission, directorDiscountPermission: item.directorDiscountPermission, priceStandard: item.priceStandard, createTime: item.createTime })), - name: '价格列表', - titleArr: ['序号', '价格编号', '价格名称', '检校类型', '类别', '项目', '标准价格(元)', '业务员折扣权限', '负责人折扣权限', '依据标准', '创建时间'], - sheetName: 'sheet1', - }) - } - else if (checkoutList.value.length > 0) { - exportExcel({ - json: checkoutList.value.map((item: IlistType, index: number) => ({ index: index + 1, priceNo: item.priceNo, priceName: item.priceName, checkType: item.checkType, priceType: item.priceType, priceItem: item.priceItem, price: item.price, operatorDiscountPermission: item.operatorDiscountPermission, directorDiscountPermission: item.directorDiscountPermission, priceStandard: item.priceStandard, createTime: item.createTime })), - name: '价格列表', - titleArr: ['序号', '价格编号', '价格名称', '检校类型', '类别', '项目', '标准价格(元)', '业务员折扣权限', '负责人折扣权限', '依据标准', '创建时间'], - sheetName: 'sheet1', + if (list.value.length > 0) { + const params = { + checkType: '', + model: '', + priceItem: '', + priceName: '', + priceNo: '', + priceType: '', + } + exportPriceList(params).then((res) => { + const blob = new Blob([res.data]) + exportFile(blob, '价格列表.xlsx') }) } else { - ElMessage.warning('暂无数据') + ElMessage.warning('无数据可导出数据') } loading.close() } @@ -222,15 +222,26 @@ const exportAll = () => { exportExcelBtn() } -// 打印 -const printObj = ref({ - id: 'print', // 需要打印元素的id - popTitle: '价格列表', // 打印配置页上方的标题 - extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 - preview: false, // 是否启动预览模式,默认是false - standard: '', - extarCss: '', -}) +// 打印列表 +function printList() { + // 打印列 + const properties = columns.value.map((item) => { + return { + field: item.value, + displayName: item.text, + } + }) + if (checkoutList.value.length <= 0 && list.value.length > 0) { + printJSON(list.value, properties, '培训计划列表') + } + else if (checkoutList.value.length > 0) { + const printList = list.value.filter((item: { id: string }) => checkoutList.value.includes(item.id)) + printJSON(printList, properties, '培训计划列表') + } + else { + ElMessage.warning('无可打印内容') + } +}

价格列表详情

', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 preview: false, // 是否启动预览模式,默认是false standard: '', extarCss: '', }) + // 点击提交/导出按钮 const getAddList = async (formEl: FormInstance | undefined, type: string) => { if (!formEl) { return } @@ -158,172 +159,177 @@ - - - - - - - - - - - + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/api/system/plan.ts b/src/api/system/plan.ts index 33b384f..511befd 100644 --- a/src/api/system/plan.ts +++ b/src/api/system/plan.ts @@ -4,8 +4,28 @@ import request from '../index' const prefix = '/meter' +// 导出培训计录列表 +export function exportLogList(data: object) { + return request({ + url: `${prefix}/train/log/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 导出培训计划列表 +export function exportPlanList(data: object) { + return request({ + url: `${prefix}/train/plan/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} + // 列表查询 -export function getPlanList(data: object) { +export function getPlanList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/train/plan/listPage?offset=${data.offset}&limit=${data.limit} `, method: 'post', @@ -56,7 +76,7 @@ } // 培训记录列表 -export function getLogList(data: object) { +export function getLogList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/train/log/listPage?offset=${data.offset}&limit=${data.limit} `, method: 'post', diff --git a/src/api/system/price.ts b/src/api/system/price.ts index ddee1a1..e4fdb53 100644 --- a/src/api/system/price.ts +++ b/src/api/system/price.ts @@ -1,8 +1,18 @@ import request from '../index' const prefix = '/price' +// 导出列表 +export function exportPriceList(data: object) { + return request({ + url: `${prefix}/exportPriceList`, + method: 'post', + responseType: 'blob', + data, + }) +} + // 价格列表查询 -export function getPriceList(data: object) { +export function getPriceList(data: { offset: number; limit: string }) { return request({ url: `${prefix}/queryPriceList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/views/device/deviceMaintenance/components/listApply/listPageAdd.vue b/src/views/device/deviceMaintenance/components/listApply/listPageAdd.vue index 6527f2e..5b4b6c7 100644 --- a/src/views/device/deviceMaintenance/components/listApply/listPageAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApply/listPageAdd.vue @@ -331,7 +331,34 @@ > - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 1263b6c..29dfbae 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -119,7 +119,7 @@ > {{ pageType === 'detail' ? '打印' : '提交' }} - + 关闭
diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index d588b8d..eeb8e78 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -81,11 +81,14 @@ const { proxy } = getCurrentInstance() as any const getStatisticList = () => { const params = { - createTime: '', + createEndTime: '', + createStartTime: '', deptId: 0, director: '', effectiveCompany: '', - trainTime: '', + ids: [], + trainEndTime: '', + trainStartTime: '', offset: 1, limit: 10000, } @@ -153,15 +156,18 @@ } const getmeterageList = () => { const params = { - fileNo: '', // 编号 - fileName: '', // 名称 - publishTime: '', // 发布时间 - fileCode: '', // 文件号 - effectiveTime: '', // 实施时间 - effectiveStatus: '', // 实施状态 + effectiveEndTime: '', + effectiveStartTime: '', + effectiveStatus: '', + fileCode: '', + fileName: '', + fileNo: '', + fileType: '', + ids: [], + publishEndTime: '', + publishStartTime: '', limit: 10, offset: 1, - fileType: '', // 类型 } listPageApi(params).then((res) => { meterageTableData.value = res.data.rows @@ -200,7 +206,14 @@ :style="{ height: blockHeight }" :height="blockHeight" > - + -
+
-
+
{{ item.text }}
-
+
- +
- +
- {{ CertificateObject.lastValidDate }} + {{ CertificateObject.lastValidDate + }}
最近到期时间
@@ -315,14 +351,24 @@
- + = ref({ checkType: '', // 检校类型 @@ -40,7 +42,7 @@ ] // 选中的内容 -const checkoutList = ref([]) +const checkoutList = ref([]) // 文件上传input const fileRef = ref() // 删除id @@ -71,7 +73,7 @@ fetchData(true) // 多选发生改变时 const handleSelectionChange = (e: any) => { - checkoutList.value = e + checkoutList.value = e.map((item: { id: string }) => item.id) } const $router = useRouter() @@ -153,27 +155,25 @@ const exportExcelBtn = () => { const loading = ElLoading.service({ lock: true, - text: 'Loading', + text: '下载中请稍后', background: 'rgba(255, 255, 255, 0.8)', }) - if (checkoutList.value.length <= 0 && list.value.length > 0) { - exportExcel({ - json: list.value.map((item: IlistType, index: number) => ({ index: index + 1, priceNo: item.priceNo, priceName: item.priceName, checkType: item.checkType, priceType: item.priceType, priceItem: item.priceItem, price: item.price, operatorDiscountPermission: item.operatorDiscountPermission, directorDiscountPermission: item.directorDiscountPermission, priceStandard: item.priceStandard, createTime: item.createTime })), - name: '价格列表', - titleArr: ['序号', '价格编号', '价格名称', '检校类型', '类别', '项目', '标准价格(元)', '业务员折扣权限', '负责人折扣权限', '依据标准', '创建时间'], - sheetName: 'sheet1', - }) - } - else if (checkoutList.value.length > 0) { - exportExcel({ - json: checkoutList.value.map((item: IlistType, index: number) => ({ index: index + 1, priceNo: item.priceNo, priceName: item.priceName, checkType: item.checkType, priceType: item.priceType, priceItem: item.priceItem, price: item.price, operatorDiscountPermission: item.operatorDiscountPermission, directorDiscountPermission: item.directorDiscountPermission, priceStandard: item.priceStandard, createTime: item.createTime })), - name: '价格列表', - titleArr: ['序号', '价格编号', '价格名称', '检校类型', '类别', '项目', '标准价格(元)', '业务员折扣权限', '负责人折扣权限', '依据标准', '创建时间'], - sheetName: 'sheet1', + if (list.value.length > 0) { + const params = { + checkType: '', + model: '', + priceItem: '', + priceName: '', + priceNo: '', + priceType: '', + } + exportPriceList(params).then((res) => { + const blob = new Blob([res.data]) + exportFile(blob, '价格列表.xlsx') }) } else { - ElMessage.warning('暂无数据') + ElMessage.warning('无数据可导出数据') } loading.close() } @@ -222,15 +222,26 @@ const exportAll = () => { exportExcelBtn() } -// 打印 -const printObj = ref({ - id: 'print', // 需要打印元素的id - popTitle: '价格列表', // 打印配置页上方的标题 - extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 - preview: false, // 是否启动预览模式,默认是false - standard: '', - extarCss: '', -}) +// 打印列表 +function printList() { + // 打印列 + const properties = columns.value.map((item) => { + return { + field: item.value, + displayName: item.text, + } + }) + if (checkoutList.value.length <= 0 && list.value.length > 0) { + printJSON(list.value, properties, '培训计划列表') + } + else if (checkoutList.value.length > 0) { + const printList = list.value.filter((item: { id: string }) => checkoutList.value.includes(item.id)) + printJSON(printList, properties, '培训计划列表') + } + else { + ElMessage.warning('无可打印内容') + } +}

价格列表详情

', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 preview: false, // 是否启动预览模式,默认是false standard: '', extarCss: '', }) + // 点击提交/导出按钮 const getAddList = async (formEl: FormInstance | undefined, type: string) => { if (!formEl) { return } @@ -158,172 +159,177 @@ - - - - - - - - - - - + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/views/measure/source/list.vue b/src/views/measure/source/list.vue index 846a74c..7315432 100644 --- a/src/views/measure/source/list.vue +++ b/src/views/measure/source/list.vue @@ -245,7 +245,7 @@ printJSON(printList, properties, '溯源供方列表') } else { - ElMessage('无可打印内容') + ElMessage.warning('无可打印内容') } } diff --git a/src/api/system/plan.ts b/src/api/system/plan.ts index 33b384f..511befd 100644 --- a/src/api/system/plan.ts +++ b/src/api/system/plan.ts @@ -4,8 +4,28 @@ import request from '../index' const prefix = '/meter' +// 导出培训计录列表 +export function exportLogList(data: object) { + return request({ + url: `${prefix}/train/log/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} + +// 导出培训计划列表 +export function exportPlanList(data: object) { + return request({ + url: `${prefix}/train/plan/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} + // 列表查询 -export function getPlanList(data: object) { +export function getPlanList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/train/plan/listPage?offset=${data.offset}&limit=${data.limit} `, method: 'post', @@ -56,7 +76,7 @@ } // 培训记录列表 -export function getLogList(data: object) { +export function getLogList(data: { offset: number; limit: number }) { return request({ url: `${prefix}/train/log/listPage?offset=${data.offset}&limit=${data.limit} `, method: 'post', diff --git a/src/api/system/price.ts b/src/api/system/price.ts index ddee1a1..e4fdb53 100644 --- a/src/api/system/price.ts +++ b/src/api/system/price.ts @@ -1,8 +1,18 @@ import request from '../index' const prefix = '/price' +// 导出列表 +export function exportPriceList(data: object) { + return request({ + url: `${prefix}/exportPriceList`, + method: 'post', + responseType: 'blob', + data, + }) +} + // 价格列表查询 -export function getPriceList(data: object) { +export function getPriceList(data: { offset: number; limit: string }) { return request({ url: `${prefix}/queryPriceList?offset=${data.offset}&limit=${data.limit}`, method: 'post', diff --git a/src/views/device/deviceMaintenance/components/listApply/listPageAdd.vue b/src/views/device/deviceMaintenance/components/listApply/listPageAdd.vue index 6527f2e..5b4b6c7 100644 --- a/src/views/device/deviceMaintenance/components/listApply/listPageAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApply/listPageAdd.vue @@ -331,7 +331,34 @@ > - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 1263b6c..29dfbae 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -119,7 +119,7 @@ > {{ pageType === 'detail' ? '打印' : '提交' }} - + 关闭
diff --git a/src/views/measure/bench/bench.vue b/src/views/measure/bench/bench.vue index d588b8d..eeb8e78 100644 --- a/src/views/measure/bench/bench.vue +++ b/src/views/measure/bench/bench.vue @@ -81,11 +81,14 @@ const { proxy } = getCurrentInstance() as any const getStatisticList = () => { const params = { - createTime: '', + createEndTime: '', + createStartTime: '', deptId: 0, director: '', effectiveCompany: '', - trainTime: '', + ids: [], + trainEndTime: '', + trainStartTime: '', offset: 1, limit: 10000, } @@ -153,15 +156,18 @@ } const getmeterageList = () => { const params = { - fileNo: '', // 编号 - fileName: '', // 名称 - publishTime: '', // 发布时间 - fileCode: '', // 文件号 - effectiveTime: '', // 实施时间 - effectiveStatus: '', // 实施状态 + effectiveEndTime: '', + effectiveStartTime: '', + effectiveStatus: '', + fileCode: '', + fileName: '', + fileNo: '', + fileType: '', + ids: [], + publishEndTime: '', + publishStartTime: '', limit: 10, offset: 1, - fileType: '', // 类型 } listPageApi(params).then((res) => { meterageTableData.value = res.data.rows @@ -200,7 +206,14 @@ :style="{ height: blockHeight }" :height="blockHeight" > - + -
+
-
+
{{ item.text }}
-
+
- +
- +
- {{ CertificateObject.lastValidDate }} + {{ CertificateObject.lastValidDate + }}
最近到期时间
@@ -315,14 +351,24 @@
- + = ref({ checkType: '', // 检校类型 @@ -40,7 +42,7 @@ ] // 选中的内容 -const checkoutList = ref([]) +const checkoutList = ref([]) // 文件上传input const fileRef = ref() // 删除id @@ -71,7 +73,7 @@ fetchData(true) // 多选发生改变时 const handleSelectionChange = (e: any) => { - checkoutList.value = e + checkoutList.value = e.map((item: { id: string }) => item.id) } const $router = useRouter() @@ -153,27 +155,25 @@ const exportExcelBtn = () => { const loading = ElLoading.service({ lock: true, - text: 'Loading', + text: '下载中请稍后', background: 'rgba(255, 255, 255, 0.8)', }) - if (checkoutList.value.length <= 0 && list.value.length > 0) { - exportExcel({ - json: list.value.map((item: IlistType, index: number) => ({ index: index + 1, priceNo: item.priceNo, priceName: item.priceName, checkType: item.checkType, priceType: item.priceType, priceItem: item.priceItem, price: item.price, operatorDiscountPermission: item.operatorDiscountPermission, directorDiscountPermission: item.directorDiscountPermission, priceStandard: item.priceStandard, createTime: item.createTime })), - name: '价格列表', - titleArr: ['序号', '价格编号', '价格名称', '检校类型', '类别', '项目', '标准价格(元)', '业务员折扣权限', '负责人折扣权限', '依据标准', '创建时间'], - sheetName: 'sheet1', - }) - } - else if (checkoutList.value.length > 0) { - exportExcel({ - json: checkoutList.value.map((item: IlistType, index: number) => ({ index: index + 1, priceNo: item.priceNo, priceName: item.priceName, checkType: item.checkType, priceType: item.priceType, priceItem: item.priceItem, price: item.price, operatorDiscountPermission: item.operatorDiscountPermission, directorDiscountPermission: item.directorDiscountPermission, priceStandard: item.priceStandard, createTime: item.createTime })), - name: '价格列表', - titleArr: ['序号', '价格编号', '价格名称', '检校类型', '类别', '项目', '标准价格(元)', '业务员折扣权限', '负责人折扣权限', '依据标准', '创建时间'], - sheetName: 'sheet1', + if (list.value.length > 0) { + const params = { + checkType: '', + model: '', + priceItem: '', + priceName: '', + priceNo: '', + priceType: '', + } + exportPriceList(params).then((res) => { + const blob = new Blob([res.data]) + exportFile(blob, '价格列表.xlsx') }) } else { - ElMessage.warning('暂无数据') + ElMessage.warning('无数据可导出数据') } loading.close() } @@ -222,15 +222,26 @@ const exportAll = () => { exportExcelBtn() } -// 打印 -const printObj = ref({ - id: 'print', // 需要打印元素的id - popTitle: '价格列表', // 打印配置页上方的标题 - extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 - preview: false, // 是否启动预览模式,默认是false - standard: '', - extarCss: '', -}) +// 打印列表 +function printList() { + // 打印列 + const properties = columns.value.map((item) => { + return { + field: item.value, + displayName: item.text, + } + }) + if (checkoutList.value.length <= 0 && list.value.length > 0) { + printJSON(list.value, properties, '培训计划列表') + } + else if (checkoutList.value.length > 0) { + const printList = list.value.filter((item: { id: string }) => checkoutList.value.includes(item.id)) + printJSON(printList, properties, '培训计划列表') + } + else { + ElMessage.warning('无可打印内容') + } +}

价格列表详情

', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 preview: false, // 是否启动预览模式,默认是false standard: '', extarCss: '', }) + // 点击提交/导出按钮 const getAddList = async (formEl: FormInstance | undefined, type: string) => { if (!formEl) { return } @@ -158,172 +159,177 @@ - - - - - - - - - - - + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/views/measure/source/list.vue b/src/views/measure/source/list.vue index 846a74c..7315432 100644 --- a/src/views/measure/source/list.vue +++ b/src/views/measure/source/list.vue @@ -245,7 +245,7 @@ printJSON(printList, properties, '溯源供方列表') } else { - ElMessage('无可打印内容') + ElMessage.warning('无可打印内容') } } diff --git a/src/views/measure/train/plan.vue b/src/views/measure/train/plan.vue index 5f4180b..876d6e3 100644 --- a/src/views/measure/train/plan.vue +++ b/src/views/measure/train/plan.vue @@ -2,20 +2,25 @@ import type { Ref } from 'vue' import { getCurrentInstance, reactive, ref } from 'vue' import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' -import type { IOptions, IlistQuery, IlistType } from './plan_interface' +import type { IOptions, ISupplier, IlistQuery, IlistType } from './plan_interface' import { exportExcel } from '@/utils/exportXlsx' -import { getDeptTree, getListDelete, getPlanList } from '@/api/system/plan' +import { exportPlanList, getDeptTree, getListDelete, getPlanList } from '@/api/system/plan' +import { printJSON } from '@/utils/printUtils' +import { exportFile } from '@/utils/exportUtils' const listQuery: Ref = ref({ - trainTime: '', - createTime: '', + createEndTime: '', + createStartTime: '', deptId: '', - effectiveCompany: '', director: '', + effectiveCompany: '', + ids: [], + trainEndTime: '', + trainStartTime: '', offset: 1, limit: 20, }) -const checkoutList = ref([]) -const list = ref([]) +const checkoutList = ref([]) +const list = ref([]) // 删除id const deleteId = ref('') const total = ref(0) @@ -28,12 +33,6 @@ // 初始化路由 const $router = useRouter() const fetchData = (isNowPage: boolean) => { - if (listQuery.value.trainTime === null) { - listQuery.value.trainTime = '' - } - if (listQuery.value.createTime === null) { - listQuery.value.createTime = '' - } loadingTable.value = true if (!isNowPage) { // 是否显示当前页,否则跳转第一页 @@ -111,14 +110,27 @@ const searchList = () => { fetchData(true) } +// 培训时间数组 +const trainTimeArr = ref([ + listQuery.value.trainStartTime, + listQuery.value.trainEndTime, +]) +// 创建时间数组 +const createTimeArr = ref([ + listQuery.value.createStartTime, + listQuery.value.createEndTime, +]) // 重置 const clearList = () => { listQuery.value = { - trainTime: '', - createTime: '', + createEndTime: '', + createStartTime: '', deptId: '', - effectiveCompany: '', director: '', + effectiveCompany: '', + ids: [], + trainEndTime: '', + trainStartTime: '', offset: 1, limit: 20, } @@ -127,27 +139,27 @@ const exportExcelBtn = () => { const loading = ElLoading.service({ lock: true, - text: 'Loading', + text: '下载中请稍后', background: 'rgba(255, 255, 255, 0.8)', }) - if (checkoutList.value.length <= 0 && list.value.length > 0) { - exportExcel({ - json: list.value.map((item: IlistType, index: number) => ({ index: index + 1, planNo: item.planNo, planName: item.planName, trainPerson: item.trainPerson, trainNumber: item.trainNumber, trainHour: item.trainHour, trainTime: item.trainTime, deptName: item.deptName, effectiveCompany: item.effectiveCompany, director: item.director, trainContent: item.trainContent, createTime: item.createTime, remark: item.remark })), - name: '培训记录', - titleArr: ['序号', '培训计划编号', '培训名称', '培训对象', '培训人数', '培训学时', '培训时间', '主管部门', '实施单位', '负责人', '培训内容', '创建时间', '备注'], - sheetName: 'sheet1', - }) - } - else if (checkoutList.value.length > 0) { - exportExcel({ - json: checkoutList.value.map((item: IlistType, index: number) => ({ index: index + 1, planNo: item.planNo, planName: item.planName, trainPerson: item.trainPerson, trainNumber: item.trainNumber, trainHour: item.trainHour, trainTime: item.trainTime, deptName: item.deptName, effectiveCompany: item.effectiveCompany, director: item.director, trainContent: item.trainContent, createTime: item.createTime, remark: item.remark })), - name: '培训记录', - titleArr: ['序号', '培训计划编号', '培训名称', '培训对象', '培训人数', '培训学时', '培训时间', '主管部门', '实施单位', '负责人', '培训内容', '创建时间', '备注'], - sheetName: 'sheet1', + if (list.value.length > 0) { + const params = { + createEndTime: '', + createStartTime: '', + deptId: 0, + director: '', + effectiveCompany: '', + trainEndTime: '', + trainStartTime: '', + ids: checkoutList.value, + } + exportPlanList(params).then((res) => { + const blob = new Blob([res.data]) + exportFile(blob, '培训计划列表.xlsx') }) } else { - ElMessage.warning('暂无数据') + ElMessage.warning('无数据可导出数据') } loading.close() } @@ -188,9 +200,10 @@ }) }) } + const handelClick = (text: string) => {} const handleSelectionChange = (e: any) => { - checkoutList.value = e + checkoutList.value = e.map((item: { id: string }) => item.id) } const add = () => { $router.push('/train/add') @@ -220,15 +233,26 @@ } fetchData(true) } -// 打印 -const printObj = ref({ - id: 'print', // 需要打印元素的id - popTitle: '证书报告模板', // 打印配置页上方的标题 - extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 - preview: false, // 是否启动预览模式,默认是false - standard: '', - extarCss: '', -}) +// 打印列表 +function printList() { + // 打印列 + const properties = columns.value.map((item) => { + return { + field: item.value, + displayName: item.text, + } + }) + if (checkoutList.value.length <= 0 && list.value.length > 0) { + printJSON(list.value, properties, '培训计划列表') + } + else if (checkoutList.value.length > 0) { + const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) + printJSON(printList, properties, '培训计划列表') + } + else { + ElMessage.warning('无可打印内容') + } +} const qrDialog = ref() // 点击二维码 const qrDialogShow = (row: rowReturn) => { @@ -242,20 +266,24 @@ @@ -290,13 +318,37 @@ diff --git a/src/views/measure/source/list.vue b/src/views/measure/source/list.vue index 846a74c..7315432 100644 --- a/src/views/measure/source/list.vue +++ b/src/views/measure/source/list.vue @@ -245,7 +245,7 @@ printJSON(printList, properties, '溯源供方列表') } else { - ElMessage('无可打印内容') + ElMessage.warning('无可打印内容') } } diff --git a/src/views/measure/train/plan.vue b/src/views/measure/train/plan.vue index 5f4180b..876d6e3 100644 --- a/src/views/measure/train/plan.vue +++ b/src/views/measure/train/plan.vue @@ -2,20 +2,25 @@ import type { Ref } from 'vue' import { getCurrentInstance, reactive, ref } from 'vue' import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' -import type { IOptions, IlistQuery, IlistType } from './plan_interface' +import type { IOptions, ISupplier, IlistQuery, IlistType } from './plan_interface' import { exportExcel } from '@/utils/exportXlsx' -import { getDeptTree, getListDelete, getPlanList } from '@/api/system/plan' +import { exportPlanList, getDeptTree, getListDelete, getPlanList } from '@/api/system/plan' +import { printJSON } from '@/utils/printUtils' +import { exportFile } from '@/utils/exportUtils' const listQuery: Ref = ref({ - trainTime: '', - createTime: '', + createEndTime: '', + createStartTime: '', deptId: '', - effectiveCompany: '', director: '', + effectiveCompany: '', + ids: [], + trainEndTime: '', + trainStartTime: '', offset: 1, limit: 20, }) -const checkoutList = ref([]) -const list = ref([]) +const checkoutList = ref([]) +const list = ref([]) // 删除id const deleteId = ref('') const total = ref(0) @@ -28,12 +33,6 @@ // 初始化路由 const $router = useRouter() const fetchData = (isNowPage: boolean) => { - if (listQuery.value.trainTime === null) { - listQuery.value.trainTime = '' - } - if (listQuery.value.createTime === null) { - listQuery.value.createTime = '' - } loadingTable.value = true if (!isNowPage) { // 是否显示当前页,否则跳转第一页 @@ -111,14 +110,27 @@ const searchList = () => { fetchData(true) } +// 培训时间数组 +const trainTimeArr = ref([ + listQuery.value.trainStartTime, + listQuery.value.trainEndTime, +]) +// 创建时间数组 +const createTimeArr = ref([ + listQuery.value.createStartTime, + listQuery.value.createEndTime, +]) // 重置 const clearList = () => { listQuery.value = { - trainTime: '', - createTime: '', + createEndTime: '', + createStartTime: '', deptId: '', - effectiveCompany: '', director: '', + effectiveCompany: '', + ids: [], + trainEndTime: '', + trainStartTime: '', offset: 1, limit: 20, } @@ -127,27 +139,27 @@ const exportExcelBtn = () => { const loading = ElLoading.service({ lock: true, - text: 'Loading', + text: '下载中请稍后', background: 'rgba(255, 255, 255, 0.8)', }) - if (checkoutList.value.length <= 0 && list.value.length > 0) { - exportExcel({ - json: list.value.map((item: IlistType, index: number) => ({ index: index + 1, planNo: item.planNo, planName: item.planName, trainPerson: item.trainPerson, trainNumber: item.trainNumber, trainHour: item.trainHour, trainTime: item.trainTime, deptName: item.deptName, effectiveCompany: item.effectiveCompany, director: item.director, trainContent: item.trainContent, createTime: item.createTime, remark: item.remark })), - name: '培训记录', - titleArr: ['序号', '培训计划编号', '培训名称', '培训对象', '培训人数', '培训学时', '培训时间', '主管部门', '实施单位', '负责人', '培训内容', '创建时间', '备注'], - sheetName: 'sheet1', - }) - } - else if (checkoutList.value.length > 0) { - exportExcel({ - json: checkoutList.value.map((item: IlistType, index: number) => ({ index: index + 1, planNo: item.planNo, planName: item.planName, trainPerson: item.trainPerson, trainNumber: item.trainNumber, trainHour: item.trainHour, trainTime: item.trainTime, deptName: item.deptName, effectiveCompany: item.effectiveCompany, director: item.director, trainContent: item.trainContent, createTime: item.createTime, remark: item.remark })), - name: '培训记录', - titleArr: ['序号', '培训计划编号', '培训名称', '培训对象', '培训人数', '培训学时', '培训时间', '主管部门', '实施单位', '负责人', '培训内容', '创建时间', '备注'], - sheetName: 'sheet1', + if (list.value.length > 0) { + const params = { + createEndTime: '', + createStartTime: '', + deptId: 0, + director: '', + effectiveCompany: '', + trainEndTime: '', + trainStartTime: '', + ids: checkoutList.value, + } + exportPlanList(params).then((res) => { + const blob = new Blob([res.data]) + exportFile(blob, '培训计划列表.xlsx') }) } else { - ElMessage.warning('暂无数据') + ElMessage.warning('无数据可导出数据') } loading.close() } @@ -188,9 +200,10 @@ }) }) } + const handelClick = (text: string) => {} const handleSelectionChange = (e: any) => { - checkoutList.value = e + checkoutList.value = e.map((item: { id: string }) => item.id) } const add = () => { $router.push('/train/add') @@ -220,15 +233,26 @@ } fetchData(true) } -// 打印 -const printObj = ref({ - id: 'print', // 需要打印元素的id - popTitle: '证书报告模板', // 打印配置页上方的标题 - extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 - preview: false, // 是否启动预览模式,默认是false - standard: '', - extarCss: '', -}) +// 打印列表 +function printList() { + // 打印列 + const properties = columns.value.map((item) => { + return { + field: item.value, + displayName: item.text, + } + }) + if (checkoutList.value.length <= 0 && list.value.length > 0) { + printJSON(list.value, properties, '培训计划列表') + } + else if (checkoutList.value.length > 0) { + const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) + printJSON(printList, properties, '培训计划列表') + } + else { + ElMessage.warning('无可打印内容') + } +} const qrDialog = ref() // 点击二维码 const qrDialogShow = (row: rowReturn) => { @@ -242,20 +266,24 @@ @@ -290,13 +318,37 @@ diff --git a/src/views/measure/source/list.vue b/src/views/measure/source/list.vue index 846a74c..7315432 100644 --- a/src/views/measure/source/list.vue +++ b/src/views/measure/source/list.vue @@ -245,7 +245,7 @@ printJSON(printList, properties, '溯源供方列表') } else { - ElMessage('无可打印内容') + ElMessage.warning('无可打印内容') } } diff --git a/src/views/measure/train/plan.vue b/src/views/measure/train/plan.vue index 5f4180b..876d6e3 100644 --- a/src/views/measure/train/plan.vue +++ b/src/views/measure/train/plan.vue @@ -2,20 +2,25 @@ import type { Ref } from 'vue' import { getCurrentInstance, reactive, ref } from 'vue' import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' -import type { IOptions, IlistQuery, IlistType } from './plan_interface' +import type { IOptions, ISupplier, IlistQuery, IlistType } from './plan_interface' import { exportExcel } from '@/utils/exportXlsx' -import { getDeptTree, getListDelete, getPlanList } from '@/api/system/plan' +import { exportPlanList, getDeptTree, getListDelete, getPlanList } from '@/api/system/plan' +import { printJSON } from '@/utils/printUtils' +import { exportFile } from '@/utils/exportUtils' const listQuery: Ref = ref({ - trainTime: '', - createTime: '', + createEndTime: '', + createStartTime: '', deptId: '', - effectiveCompany: '', director: '', + effectiveCompany: '', + ids: [], + trainEndTime: '', + trainStartTime: '', offset: 1, limit: 20, }) -const checkoutList = ref([]) -const list = ref([]) +const checkoutList = ref([]) +const list = ref([]) // 删除id const deleteId = ref('') const total = ref(0) @@ -28,12 +33,6 @@ // 初始化路由 const $router = useRouter() const fetchData = (isNowPage: boolean) => { - if (listQuery.value.trainTime === null) { - listQuery.value.trainTime = '' - } - if (listQuery.value.createTime === null) { - listQuery.value.createTime = '' - } loadingTable.value = true if (!isNowPage) { // 是否显示当前页,否则跳转第一页 @@ -111,14 +110,27 @@ const searchList = () => { fetchData(true) } +// 培训时间数组 +const trainTimeArr = ref([ + listQuery.value.trainStartTime, + listQuery.value.trainEndTime, +]) +// 创建时间数组 +const createTimeArr = ref([ + listQuery.value.createStartTime, + listQuery.value.createEndTime, +]) // 重置 const clearList = () => { listQuery.value = { - trainTime: '', - createTime: '', + createEndTime: '', + createStartTime: '', deptId: '', - effectiveCompany: '', director: '', + effectiveCompany: '', + ids: [], + trainEndTime: '', + trainStartTime: '', offset: 1, limit: 20, } @@ -127,27 +139,27 @@ const exportExcelBtn = () => { const loading = ElLoading.service({ lock: true, - text: 'Loading', + text: '下载中请稍后', background: 'rgba(255, 255, 255, 0.8)', }) - if (checkoutList.value.length <= 0 && list.value.length > 0) { - exportExcel({ - json: list.value.map((item: IlistType, index: number) => ({ index: index + 1, planNo: item.planNo, planName: item.planName, trainPerson: item.trainPerson, trainNumber: item.trainNumber, trainHour: item.trainHour, trainTime: item.trainTime, deptName: item.deptName, effectiveCompany: item.effectiveCompany, director: item.director, trainContent: item.trainContent, createTime: item.createTime, remark: item.remark })), - name: '培训记录', - titleArr: ['序号', '培训计划编号', '培训名称', '培训对象', '培训人数', '培训学时', '培训时间', '主管部门', '实施单位', '负责人', '培训内容', '创建时间', '备注'], - sheetName: 'sheet1', - }) - } - else if (checkoutList.value.length > 0) { - exportExcel({ - json: checkoutList.value.map((item: IlistType, index: number) => ({ index: index + 1, planNo: item.planNo, planName: item.planName, trainPerson: item.trainPerson, trainNumber: item.trainNumber, trainHour: item.trainHour, trainTime: item.trainTime, deptName: item.deptName, effectiveCompany: item.effectiveCompany, director: item.director, trainContent: item.trainContent, createTime: item.createTime, remark: item.remark })), - name: '培训记录', - titleArr: ['序号', '培训计划编号', '培训名称', '培训对象', '培训人数', '培训学时', '培训时间', '主管部门', '实施单位', '负责人', '培训内容', '创建时间', '备注'], - sheetName: 'sheet1', + if (list.value.length > 0) { + const params = { + createEndTime: '', + createStartTime: '', + deptId: 0, + director: '', + effectiveCompany: '', + trainEndTime: '', + trainStartTime: '', + ids: checkoutList.value, + } + exportPlanList(params).then((res) => { + const blob = new Blob([res.data]) + exportFile(blob, '培训计划列表.xlsx') }) } else { - ElMessage.warning('暂无数据') + ElMessage.warning('无数据可导出数据') } loading.close() } @@ -188,9 +200,10 @@ }) }) } + const handelClick = (text: string) => {} const handleSelectionChange = (e: any) => { - checkoutList.value = e + checkoutList.value = e.map((item: { id: string }) => item.id) } const add = () => { $router.push('/train/add') @@ -220,15 +233,26 @@ } fetchData(true) } -// 打印 -const printObj = ref({ - id: 'print', // 需要打印元素的id - popTitle: '证书报告模板', // 打印配置页上方的标题 - extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 - preview: false, // 是否启动预览模式,默认是false - standard: '', - extarCss: '', -}) +// 打印列表 +function printList() { + // 打印列 + const properties = columns.value.map((item) => { + return { + field: item.value, + displayName: item.text, + } + }) + if (checkoutList.value.length <= 0 && list.value.length > 0) { + printJSON(list.value, properties, '培训计划列表') + } + else if (checkoutList.value.length > 0) { + const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) + printJSON(printList, properties, '培训计划列表') + } + else { + ElMessage.warning('无可打印内容') + } +} const qrDialog = ref() // 点击二维码 const qrDialogShow = (row: rowReturn) => { @@ -242,20 +266,24 @@ @@ -290,13 +318,37 @@ diff --git a/src/views/measure/source/list.vue b/src/views/measure/source/list.vue index 846a74c..7315432 100644 --- a/src/views/measure/source/list.vue +++ b/src/views/measure/source/list.vue @@ -245,7 +245,7 @@ printJSON(printList, properties, '溯源供方列表') } else { - ElMessage('无可打印内容') + ElMessage.warning('无可打印内容') } } diff --git a/src/views/measure/train/plan.vue b/src/views/measure/train/plan.vue index 5f4180b..876d6e3 100644 --- a/src/views/measure/train/plan.vue +++ b/src/views/measure/train/plan.vue @@ -2,20 +2,25 @@ import type { Ref } from 'vue' import { getCurrentInstance, reactive, ref } from 'vue' import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' -import type { IOptions, IlistQuery, IlistType } from './plan_interface' +import type { IOptions, ISupplier, IlistQuery, IlistType } from './plan_interface' import { exportExcel } from '@/utils/exportXlsx' -import { getDeptTree, getListDelete, getPlanList } from '@/api/system/plan' +import { exportPlanList, getDeptTree, getListDelete, getPlanList } from '@/api/system/plan' +import { printJSON } from '@/utils/printUtils' +import { exportFile } from '@/utils/exportUtils' const listQuery: Ref = ref({ - trainTime: '', - createTime: '', + createEndTime: '', + createStartTime: '', deptId: '', - effectiveCompany: '', director: '', + effectiveCompany: '', + ids: [], + trainEndTime: '', + trainStartTime: '', offset: 1, limit: 20, }) -const checkoutList = ref([]) -const list = ref([]) +const checkoutList = ref([]) +const list = ref([]) // 删除id const deleteId = ref('') const total = ref(0) @@ -28,12 +33,6 @@ // 初始化路由 const $router = useRouter() const fetchData = (isNowPage: boolean) => { - if (listQuery.value.trainTime === null) { - listQuery.value.trainTime = '' - } - if (listQuery.value.createTime === null) { - listQuery.value.createTime = '' - } loadingTable.value = true if (!isNowPage) { // 是否显示当前页,否则跳转第一页 @@ -111,14 +110,27 @@ const searchList = () => { fetchData(true) } +// 培训时间数组 +const trainTimeArr = ref([ + listQuery.value.trainStartTime, + listQuery.value.trainEndTime, +]) +// 创建时间数组 +const createTimeArr = ref([ + listQuery.value.createStartTime, + listQuery.value.createEndTime, +]) // 重置 const clearList = () => { listQuery.value = { - trainTime: '', - createTime: '', + createEndTime: '', + createStartTime: '', deptId: '', - effectiveCompany: '', director: '', + effectiveCompany: '', + ids: [], + trainEndTime: '', + trainStartTime: '', offset: 1, limit: 20, } @@ -127,27 +139,27 @@ const exportExcelBtn = () => { const loading = ElLoading.service({ lock: true, - text: 'Loading', + text: '下载中请稍后', background: 'rgba(255, 255, 255, 0.8)', }) - if (checkoutList.value.length <= 0 && list.value.length > 0) { - exportExcel({ - json: list.value.map((item: IlistType, index: number) => ({ index: index + 1, planNo: item.planNo, planName: item.planName, trainPerson: item.trainPerson, trainNumber: item.trainNumber, trainHour: item.trainHour, trainTime: item.trainTime, deptName: item.deptName, effectiveCompany: item.effectiveCompany, director: item.director, trainContent: item.trainContent, createTime: item.createTime, remark: item.remark })), - name: '培训记录', - titleArr: ['序号', '培训计划编号', '培训名称', '培训对象', '培训人数', '培训学时', '培训时间', '主管部门', '实施单位', '负责人', '培训内容', '创建时间', '备注'], - sheetName: 'sheet1', - }) - } - else if (checkoutList.value.length > 0) { - exportExcel({ - json: checkoutList.value.map((item: IlistType, index: number) => ({ index: index + 1, planNo: item.planNo, planName: item.planName, trainPerson: item.trainPerson, trainNumber: item.trainNumber, trainHour: item.trainHour, trainTime: item.trainTime, deptName: item.deptName, effectiveCompany: item.effectiveCompany, director: item.director, trainContent: item.trainContent, createTime: item.createTime, remark: item.remark })), - name: '培训记录', - titleArr: ['序号', '培训计划编号', '培训名称', '培训对象', '培训人数', '培训学时', '培训时间', '主管部门', '实施单位', '负责人', '培训内容', '创建时间', '备注'], - sheetName: 'sheet1', + if (list.value.length > 0) { + const params = { + createEndTime: '', + createStartTime: '', + deptId: 0, + director: '', + effectiveCompany: '', + trainEndTime: '', + trainStartTime: '', + ids: checkoutList.value, + } + exportPlanList(params).then((res) => { + const blob = new Blob([res.data]) + exportFile(blob, '培训计划列表.xlsx') }) } else { - ElMessage.warning('暂无数据') + ElMessage.warning('无数据可导出数据') } loading.close() } @@ -188,9 +200,10 @@ }) }) } + const handelClick = (text: string) => {} const handleSelectionChange = (e: any) => { - checkoutList.value = e + checkoutList.value = e.map((item: { id: string }) => item.id) } const add = () => { $router.push('/train/add') @@ -220,15 +233,26 @@ } fetchData(true) } -// 打印 -const printObj = ref({ - id: 'print', // 需要打印元素的id - popTitle: '证书报告模板', // 打印配置页上方的标题 - extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 - preview: false, // 是否启动预览模式,默认是false - standard: '', - extarCss: '', -}) +// 打印列表 +function printList() { + // 打印列 + const properties = columns.value.map((item) => { + return { + field: item.value, + displayName: item.text, + } + }) + if (checkoutList.value.length <= 0 && list.value.length > 0) { + printJSON(list.value, properties, '培训计划列表') + } + else if (checkoutList.value.length > 0) { + const printList = list.value.filter((item: ISupplier) => checkoutList.value.includes(item.id)) + printJSON(printList, properties, '培训计划列表') + } + else { + ElMessage.warning('无可打印内容') + } +} const qrDialog = ref() // 点击二维码 const qrDialogShow = (row: rowReturn) => { @@ -242,20 +266,24 @@ @@ -290,13 +318,37 @@