导入
This commit is contained in:
@@ -5,6 +5,7 @@ export interface TowerFall {
|
|||||||
code?: string;
|
code?: string;
|
||||||
model?: string;
|
model?: string;
|
||||||
companyId?: number;
|
companyId?: number;
|
||||||
|
companyName: string;
|
||||||
factory?: string;
|
factory?: string;
|
||||||
factoryDate?: string;
|
factoryDate?: string;
|
||||||
discardDate?: string;
|
discardDate?: string;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<PlusOutlined />
|
<PlusOutlined />
|
||||||
</template>
|
</template>
|
||||||
<span>添加防坠器</span>
|
<span>添加</span>
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button
|
<a-button
|
||||||
danger
|
danger
|
||||||
@@ -23,19 +23,17 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<UploadOutlined />
|
<UploadOutlined />
|
||||||
</template>
|
</template>
|
||||||
<span>导入设备</span>
|
<span>导入</span>
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button class="ele-btn-icon" @click="handleExport">
|
<a-button class="ele-btn-icon" @click="handleExport">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<DownloadOutlined />
|
<DownloadOutlined />
|
||||||
</template>
|
</template>
|
||||||
<span>导出设备</span>
|
<span>导出</span>
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-radio-group v-model:value="status" @change="handleStatus">
|
<a-radio-group v-model:value="status" @change="handleStatus">
|
||||||
<a-radio-button :value="1">报废</a-radio-button>
|
<a-radio-button :value="1">闲置</a-radio-button>
|
||||||
<a-radio-button :value="2">注销</a-radio-button>
|
<a-radio-button :value="2">在用</a-radio-button>
|
||||||
<a-radio-button :value="0">恢复</a-radio-button>
|
|
||||||
<a-radio-button :value="3">转卖</a-radio-button>
|
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
<a-input-search
|
<a-input-search
|
||||||
allow-clear
|
allow-clear
|
||||||
@@ -59,8 +57,8 @@
|
|||||||
import useSearch from '@/utils/use-search';
|
import useSearch from '@/utils/use-search';
|
||||||
import { ref, watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
import { utils, writeFile } from 'xlsx';
|
import { utils, writeFile } from 'xlsx';
|
||||||
import { TowerEquipment } from '@/api/tower/equipment/model';
|
import { TowerFall } from '@/api/tower/fall/model';
|
||||||
import { TowerEquipmentParam } from '@/api/tower/equipment/model';
|
import { TowerFallParam } from '@/api/tower/fall/model';
|
||||||
import Import from './import.vue';
|
import Import from './import.vue';
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
@@ -73,7 +71,7 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'search', where?: TowerEquipmentParam): void;
|
(e: 'search', where?: TowerFallParam): void;
|
||||||
(e: 'add'): void;
|
(e: 'add'): void;
|
||||||
(e: 'remove'): void;
|
(e: 'remove'): void;
|
||||||
(e: 'update', status?: number): void;
|
(e: 'update', status?: number): void;
|
||||||
@@ -81,8 +79,8 @@
|
|||||||
}>();
|
}>();
|
||||||
|
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const { where, resetFields } = useSearch<TowerEquipmentParam>({
|
const { where, resetFields } = useSearch<TowerFallParam>({
|
||||||
equipmentId: undefined,
|
id: undefined,
|
||||||
name: undefined,
|
name: undefined,
|
||||||
keywords: ''
|
keywords: ''
|
||||||
});
|
});
|
||||||
@@ -114,50 +112,29 @@
|
|||||||
}
|
}
|
||||||
const array: (string | number)[][] = [
|
const array: (string | number)[][] = [
|
||||||
[
|
[
|
||||||
'设备状态',
|
'防坠器状态',
|
||||||
'设备名称',
|
|
||||||
'出厂编号',
|
'出厂编号',
|
||||||
'设备型号',
|
'防坠器型号',
|
||||||
'制造厂商',
|
'制造厂商',
|
||||||
'采购日期',
|
|
||||||
'备案编号',
|
|
||||||
'出厂日期',
|
|
||||||
'产权单位',
|
'产权单位',
|
||||||
'设备来源',
|
'出厂日期',
|
||||||
'所属仓库',
|
'报废日期'
|
||||||
'所属人员',
|
|
||||||
'自编号',
|
|
||||||
'额定载重',
|
|
||||||
'最大起升高度(m)',
|
|
||||||
'臂长',
|
|
||||||
'当前位置',
|
|
||||||
'楼号'
|
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
props.selection?.forEach((d: TowerEquipment) => {
|
props.selection?.forEach((d: TowerFall) => {
|
||||||
array.push([
|
array.push([
|
||||||
`${['闲置', '报废', '注销', '转卖'][Number(d.status)]}`,
|
`${['闲置', '在用'][Number(d.status)]}`,
|
||||||
`${d.name}`,
|
`${d.code}`,
|
||||||
`${d.factoryNo}`,
|
|
||||||
`${d.model}`,
|
`${d.model}`,
|
||||||
`${d.manufactor}`,
|
`${d.factory}`,
|
||||||
`${d.buyDate ? d.buyDate : ''}`,
|
`${d.companyName}`,
|
||||||
`${d.filingNo}`,
|
`${d.factoryDate}`,
|
||||||
`${d.factoryDate ? d.factoryDate : ''}`,
|
`${d.discardDate}`
|
||||||
`${d.company}`,
|
|
||||||
`${d.source}`,
|
|
||||||
`${d.warehouse}`,
|
|
||||||
`${d.users}`,
|
|
||||||
`${d.equipmentNo}`,
|
|
||||||
`${d.ratedLoad}`,
|
|
||||||
`${d.maxLiftingHeight}`,
|
|
||||||
`${d.armLength}`,
|
|
||||||
`${d.currentLocation}`,
|
|
||||||
`${d.machineNo}`
|
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
const sheetName = '设备导出列表';
|
const sheetName = '防坠器导出列表';
|
||||||
const workbook = {
|
const workbook = {
|
||||||
SheetNames: [sheetName],
|
SheetNames: [sheetName],
|
||||||
Sheets: {}
|
Sheets: {}
|
||||||
@@ -174,7 +151,7 @@
|
|||||||
{ wch: 40 },
|
{ wch: 40 },
|
||||||
{ wch: 10 }
|
{ wch: 10 }
|
||||||
];
|
];
|
||||||
writeFile(workbook, '导出设备管理表.xlsx');
|
writeFile(workbook, '导出防坠器表.xlsx');
|
||||||
};
|
};
|
||||||
|
|
||||||
// 发布设备
|
// 发布设备
|
||||||
|
|||||||
Reference in New Issue
Block a user