-
-
+
-
+
-
+
- {{ CertificateObject.lastValidDate }}天
+ {{ CertificateObject.lastValidDate
+ }}天
最近到期时间
@@ -315,14 +351,24 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -322,40 +344,50 @@
-
+
删除行
-
+
添加行
-
+
-
-
-
-
-
-
-
-
-
- {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
-
-
-
-
+
+
+
+
+ *{{ item.text }}
+
+
+
+
+
+ 选择
+
+
+
+
+
+
+
+
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"
>
-
+
-
+
-
-
+
-
+
-
+
- {{ 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('无可打印内容')
+ }
+}
@@ -306,7 +317,7 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -322,40 +344,50 @@
-
+
删除行
-
+
添加行
-
+
-
-
-
-
-
-
-
-
-
- {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
-
-
-
-
+
+
+
+
+ *{{ item.text }}
+
+
+
+
+
+ 选择
+
+
+
+
+
+
+
+
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"
>
-
+
-
+
-
-
+
-
+
-
+
- {{ 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('无可打印内容')
+ }
+}
@@ -306,7 +317,7 @@
-
+
价格列表详情
', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割
preview: false, // 是否启动预览模式,默认是false
standard: '',
extarCss: '',
})
+
// 点击提交/导出按钮
const getAddList = async (formEl: FormInstance | undefined, type: string) => {
if (!formEl) { return }
@@ -158,172 +159,177 @@
-
- {{ 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 @@
>
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -322,40 +344,50 @@
-
+
删除行
-
+
添加行
-
+
-
-
-
-
-
-
-
-
-
- {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
-
-
-
-
+
+
+
+
+ *{{ item.text }}
+
+
+
+
+
+ 选择
+
+
+
+
+
+
+
+
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"
>
-
+
-
+
-
-
+
-
+
-
+
- {{ 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('无可打印内容')
+ }
+}
@@ -306,7 +317,7 @@
-
+
价格列表详情
', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割
preview: false, // 是否启动预览模式,默认是false
standard: '',
extarCss: '',
})
+
// 点击提交/导出按钮
const getAddList = async (formEl: FormInstance | undefined, type: string) => {
if (!formEl) { return }
@@ -158,172 +159,177 @@
-
- {{ pageType === 'detail' ? '打印' : '提交' }}
+
+ 提交
+
+
+ 打印
关闭
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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 @@
>
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -322,40 +344,50 @@
-
+
删除行
-
+
添加行
-
+
-
-
-
-
-
-
-
-
-
- {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
-
-
-
-
+
+
+
+
+ *{{ item.text }}
+
+
+
+
+
+ 选择
+
+
+
+
+
+
+
+
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"
>
-
+
-
+
-
-
+
-
+
-
+
- {{ 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('无可打印内容')
+ }
+}
@@ -306,7 +317,7 @@
-
+
价格列表详情
', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割
preview: false, // 是否启动预览模式,默认是false
standard: '',
extarCss: '',
})
+
// 点击提交/导出按钮
const getAddList = async (formEl: FormInstance | undefined, type: string) => {
if (!formEl) { return }
@@ -158,172 +159,177 @@
-
- {{ pageType === 'detail' ? '打印' : '提交' }}
+
+ 提交
+
+
+ 打印
关闭
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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/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 @@
>
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -322,40 +344,50 @@
-
+
删除行
-
+
添加行
-
+
-
-
-
-
-
-
-
-
-
- {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
-
-
-
-
+
+
+
+
+ *{{ item.text }}
+
+
+
+
+
+ 选择
+
+
+
+
+
+
+
+
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"
>
-
+
-
+
-
-
+
-
+
-
+
- {{ 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('无可打印内容')
+ }
+}
@@ -306,7 +317,7 @@
-
+
价格列表详情
', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割
preview: false, // 是否启动预览模式,默认是false
standard: '',
extarCss: '',
})
+
// 点击提交/导出按钮
const getAddList = async (formEl: FormInstance | undefined, type: string) => {
if (!formEl) { return }
@@ -158,172 +159,177 @@
-
- {{ pageType === 'detail' ? '打印' : '提交' }}
+
+ 提交
+
+
+ 打印
关闭
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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/train/planAdd.vue b/src/views/measure/train/planAdd.vue
index 6930e07..6321ed6 100644
--- a/src/views/measure/train/planAdd.vue
+++ b/src/views/measure/train/planAdd.vue
@@ -316,6 +316,7 @@
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 @@
>
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -322,40 +344,50 @@
-
+
删除行
-
+
添加行
-
+
-
-
-
-
-
-
-
-
-
- {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
-
-
-
-
+
+
+
+
+ *{{ item.text }}
+
+
+
+
+
+ 选择
+
+
+
+
+
+
+
+
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"
>
-
+
-
+
-
-
+
-
+
-
+
- {{ 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('无可打印内容')
+ }
+}
@@ -306,7 +317,7 @@
-
+
价格列表详情
', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割
preview: false, // 是否启动预览模式,默认是false
standard: '',
extarCss: '',
})
+
// 点击提交/导出按钮
const getAddList = async (formEl: FormInstance | undefined, type: string) => {
if (!formEl) { return }
@@ -158,172 +159,177 @@
-
- {{ pageType === 'detail' ? '打印' : '提交' }}
+
+ 提交
+
+
+ 打印
关闭
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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/train/planAdd.vue b/src/views/measure/train/planAdd.vue
index 6930e07..6321ed6 100644
--- a/src/views/measure/train/planAdd.vue
+++ b/src/views/measure/train/planAdd.vue
@@ -316,6 +316,7 @@
diff --git a/src/views/measure/train/plan_interface.ts b/src/views/measure/train/plan_interface.ts
index bde995f..a41a274 100644
--- a/src/views/measure/train/plan_interface.ts
+++ b/src/views/measure/train/plan_interface.ts
@@ -1,11 +1,14 @@
export interface IlistQuery {
- trainTime: string
- createTime: string
deptId: string
effectiveCompany: string
director: string
offset: number
limit: number
+ createEndTime: string
+ createStartTime: string
+ ids: []
+ trainEndTime: string
+ trainStartTime: string
}
export interface IlistType {
@@ -25,14 +28,47 @@
}
export interface IlistQuerys {
- trainTime: string
- createTime: string
+ createEndTime: string
+ createStartTime: string
+ ids: []
logNo: string
+ trainEndTime: string
trainName: string
+ trainStartTime: string
offset: number
limit: number
}
+export interface ISupplier {
+ createTime: string
+ deptId: number
+ deptName: string
+ director: string
+ effectiveCompany: string
+ id: string
+ planName: string
+ planNo: string
+ remark: string
+ trainAddress: string
+ trainContent: string
+ trainHour: string
+ trainNumber: number
+ trainPerson: string
+ trainStaffList: [
+ {
+ company: string
+ examResult: string
+ id: number
+ name: string
+ remark: string
+ signTime: string
+ staffId: number
+ technologyJob: string
+ },
+ ]
+ trainTime: string
+}
+
export interface IOptions {
id: string
name: string
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 @@
>
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -322,40 +344,50 @@
-
+
删除行
-
+
添加行
-
+
-
-
-
-
-
-
-
-
-
- {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }}
-
-
-
-
+
+
+
+
+ *{{ item.text }}
+
+
+
+
+
+ 选择
+
+
+
+
+
+
+
+
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"
>
-
+
-
+
-
-
+
-
+
-
+
- {{ 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('无可打印内容')
+ }
+}
@@ -306,7 +317,7 @@
-
+
价格列表详情
', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割
preview: false, // 是否启动预览模式,默认是false
standard: '',
extarCss: '',
})
+
// 点击提交/导出按钮
const getAddList = async (formEl: FormInstance | undefined, type: string) => {
if (!formEl) { return }
@@ -158,172 +159,177 @@
-
- {{ pageType === 'detail' ? '打印' : '提交' }}
+
+ 提交
+
+
+ 打印
关闭
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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/train/planAdd.vue b/src/views/measure/train/planAdd.vue
index 6930e07..6321ed6 100644
--- a/src/views/measure/train/planAdd.vue
+++ b/src/views/measure/train/planAdd.vue
@@ -316,6 +316,7 @@
diff --git a/src/views/measure/train/plan_interface.ts b/src/views/measure/train/plan_interface.ts
index bde995f..a41a274 100644
--- a/src/views/measure/train/plan_interface.ts
+++ b/src/views/measure/train/plan_interface.ts
@@ -1,11 +1,14 @@
export interface IlistQuery {
- trainTime: string
- createTime: string
deptId: string
effectiveCompany: string
director: string
offset: number
limit: number
+ createEndTime: string
+ createStartTime: string
+ ids: []
+ trainEndTime: string
+ trainStartTime: string
}
export interface IlistType {
@@ -25,14 +28,47 @@
}
export interface IlistQuerys {
- trainTime: string
- createTime: string
+ createEndTime: string
+ createStartTime: string
+ ids: []
logNo: string
+ trainEndTime: string
trainName: string
+ trainStartTime: string
offset: number
limit: number
}
+export interface ISupplier {
+ createTime: string
+ deptId: number
+ deptName: string
+ director: string
+ effectiveCompany: string
+ id: string
+ planName: string
+ planNo: string
+ remark: string
+ trainAddress: string
+ trainContent: string
+ trainHour: string
+ trainNumber: number
+ trainPerson: string
+ trainStaffList: [
+ {
+ company: string
+ examResult: string
+ id: number
+ name: string
+ remark: string
+ signTime: string
+ staffId: number
+ technologyJob: string
+ },
+ ]
+ trainTime: string
+}
+
export interface IOptions {
id: string
name: string
diff --git a/src/views/measure/train/trainLog.vue b/src/views/measure/train/trainLog.vue
index 1ba43aa..9bc1a68 100644
--- a/src/views/measure/train/trainLog.vue
+++ b/src/views/measure/train/trainLog.vue
@@ -3,18 +3,22 @@
import { getCurrentInstance, ref } from 'vue'
import { ElLoading, ElMessage } from 'element-plus'
import type { IlistQuerys, IlistTypes } from './plan_interface'
-import PlanAdd from './trainLogAdd.vue'
import { exportExcel } from '@/utils/exportXlsx'
-import { getDeptTree, getLogList } from '@/api/system/plan'
+import { exportLogList, getDeptTree, getLogList } from '@/api/system/plan'
+import { printJSON } from '@/utils/printUtils'
+import { exportFile } from '@/utils/exportUtils'
const listQuery: Ref = ref({
- trainTime: '',
- createTime: '',
+ createEndTime: '',
+ createStartTime: '',
+ ids: [],
logNo: '',
+ trainEndTime: '',
trainName: '',
+ trainStartTime: '',
offset: 1,
limit: 20,
})
-const checkoutList = ref([])
+const checkoutList = ref([])
const list = ref([])
const total = ref(0)
const show = ref(true)
@@ -22,16 +26,18 @@
const buttonType = ref('')
// 主管部门下拉框
const options = ref([])
+// 培训时间数组
+const trainTimeArr = ref([])
+// 创建时间数组
+const createTimeArr = ref([])
const loadingTable = ref(false)
// 初始化路由
const $router = useRouter()
const fetchData = (isNowPage: boolean) => {
- if (listQuery.value.trainTime === null) {
- listQuery.value.trainTime = ''
- }
- if (listQuery.value.createTime === null) {
- listQuery.value.createTime = ''
- }
+ listQuery.value.trainStartTime = trainTimeArr.value[0] || ''
+ listQuery.value.trainEndTime = trainTimeArr.value[1] || ''
+ listQuery.value.createStartTime = createTimeArr.value[0] || ''
+ listQuery.value.createEndTime = createTimeArr.value[0] || ''
loadingTable.value = true
if (!isNowPage) {
// 是否显示当前页,否则跳转第一页
@@ -95,6 +101,7 @@
align: 'center',
},
])
+
// 搜索
const searchList = () => {
fetchData(true)
@@ -102,10 +109,13 @@
// 重置
const clearList = () => {
listQuery.value = {
- trainTime: '',
- createTime: '',
+ createEndTime: '',
+ createStartTime: '',
+ ids: [],
logNo: '',
+ trainEndTime: '',
trainName: '',
+ trainStartTime: '',
offset: 1,
limit: 20,
}
@@ -114,27 +124,26 @@
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: IlistTypes, index: number) => ({ index: index + 1, logNo: item.logNo, trainName: item.trainName, trainTime: item.trainTime, trainAddress: item.trainAddress, trainHour: item.trainHour, trainPerson: item.trainPerson, trainNumber: item.trainNumber, createTime: item.createTime, remark: item.remark })),
- name: '培训记录',
- titleArr: ['序号', '记录编号', '培训名称', '培训时间', '培训地点', '培训学时', '培训时间', '培训人数', '创建时间', '备注'],
- sheetName: 'sheet1',
- })
- }
- else if (checkoutList.value.length > 0) {
- exportExcel({
- json: checkoutList.value.map((item: IlistTypes, index: number) => ({ index: index + 1, logNo: item.logNo, trainName: item.trainName, trainTime: item.trainTime, trainAddress: item.trainAddress, trainHour: item.trainHour, trainPerson: item.trainPerson, trainNumber: item.trainNumber, createTime: item.createTime, remark: item.remark })),
- name: '培训记录',
- titleArr: ['序号', '记录编号', '培训名称', '培训时间', '培训地点', '培训学时', '培训时间', '培训人数', '创建时间', '备注'],
- sheetName: 'sheet1',
+ if (list.value.length > 0) {
+ const params = {
+ createEndTime: '',
+ createStartTime: '',
+ logNo: '',
+ trainEndTime: '',
+ trainName: '',
+ trainStartTime: '',
+ ids: checkoutList.value,
+ }
+ exportLogList(params).then((res) => {
+ const blob = new Blob([res.data])
+ exportFile(blob, '培训计录列表.xlsx')
})
}
else {
- ElMessage.warning('暂无数据')
+ ElMessage.warning('无数据可导出数据')
}
loading.close()
}
@@ -149,7 +158,7 @@
}
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/trainLog/add')
@@ -179,15 +188,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: { id: string }) => checkoutList.value.includes(item.id))
+ printJSON(printList, properties, '培训计划列表')
+ }
+ else {
+ ElMessage.warning('无可打印内容')
+ }
+}
@@ -209,21 +229,32 @@
/>
- -->
+
@@ -233,7 +264,7 @@
-
+