This commit is contained in:
sjl
2024-12-04 20:00:15 +08:00
15 changed files with 118 additions and 84 deletions

View File

@@ -10,7 +10,7 @@
<template #tableHeader='scope'>
<el-button v-auth.device="'add'" type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
<el-button v-auth.device="'export'" type='primary' :icon='Upload' plain @click='downloadFile()'>导出</el-button>
<el-button v-auth.device="'import'" type='primary' :icon='Download' plain @click='importFile()'>导入</el-button>
<el-button v-auth.device="'import'" type='primary' :icon='Download' plain @click='importFile()' v-if='modeStore.currentMode === "比对式"'>导入</el-button>
<el-button v-auth.device="'delete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
@click='batchDelete(scope.selectedListIds)'>
删除
@@ -69,19 +69,19 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
prop: 'name',
label: '设备名称',
search: { el: 'input' },
minWidth: 200,
minWidth: 180,
},
{
prop: 'devType',
label: '设备类型',
minWidth: 200,
minWidth: 180,
enum: dictStore.getDictData('Dev_Type'),
fieldNames: { label: 'name', value: 'id' },
},
{
prop: 'createDate',
label: '生产日期',
minWidth: 200,
minWidth: 180,
search: {
span: 2,
render: () => {
@@ -120,7 +120,7 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
enum: dictStore.getDictData('Dev_Manufacturers'),
search: { el: 'select', props: { filterable: true }, order: 1 },
fieldNames: { label: 'name', value: 'id' },
minWidth: 200,
minWidth: 190,
},
{ prop: 'operation', label: '操作', fixed: 'right', width: 200 },
])
@@ -162,10 +162,10 @@ const downloadFile = async () => {
searchParam.searchBeginTime = startDate.value;
searchParam.searchEndTime = endDate.value;
ElMessageBox.confirm('确认导出被检设备?', '温馨提示', { type: 'warning' }).then(() =>
useDownload(exportPqDev,'被检设备导出数据', proTable.value?.searchParam, false,'.xlsx'),
)
ElMessageBox.confirm('确认导出被检设备?', '温馨提示', { type: 'warning' }).then(() =>{
const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== modeStore.currentMode)?.id//获取数据字典中对应的id
useDownload(exportPqDev,'被检设备导出数据', {...proTable.value?.searchParam,pattern:patternId}, false,'.xlsx')
})
}
//导入设备