From d23733743dc6bec1801c2d72ef4ae007a4235dde Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Tue, 23 Jan 2024 15:58:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E8=B5=84=E4=BA=A7=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E9=97=AE=E9=A2=98=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/eam/fixedAssets/index.ts | 8 +- src/views/eam/fixedAssets/fixedAssets.data.ts | 230 ++++++++++-------- src/views/eam/fixedAssets/index.vue | 13 +- 3 files changed, 139 insertions(+), 112 deletions(-) diff --git a/src/api/eam/fixedAssets/index.ts b/src/api/eam/fixedAssets/index.ts index b1688d6..8564b5a 100644 --- a/src/api/eam/fixedAssets/index.ts +++ b/src/api/eam/fixedAssets/index.ts @@ -3,7 +3,6 @@ import request from '@/config/axios' export interface FixedAssetsVO { number: string name: string - unit: string specifications: string locationNumber: string purchaseDept: string @@ -15,6 +14,9 @@ export interface FixedAssetsVO { siteId: string available: string concurrencyStamp: number + purchaseDate: Date + unit: string + accountingUnit: string } // 查询固定资产列表 @@ -53,3 +55,7 @@ export const exportFixedAssets = async (params) => { return await request.download({ url: `/eam/fixed-assets/export-excel`, params }) } +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/fixed-assets/get-import-template' }) +} \ No newline at end of file diff --git a/src/views/eam/fixedAssets/fixedAssets.data.ts b/src/views/eam/fixedAssets/fixedAssets.data.ts index 723b3be..17c8c49 100644 --- a/src/views/eam/fixedAssets/fixedAssets.data.ts +++ b/src/views/eam/fixedAssets/fixedAssets.data.ts @@ -9,124 +9,142 @@ export const FixedAssetsRules = reactive({ supplierNumber: [required], purchasePrice: [required], qty: [required], - concurrencyStamp: [required], + concurrencyStamp: [required] }) export const FixedAssets = useCrudSchemas(reactive([ { - label: '资产编号', + label: '编号唯一标识', field: 'number', sort: 'custom', - isSearch: true, + isSearch: true }, { label: '资产名称', field: 'name', sort: 'custom', - isSearch: true, + isSearch: true }, - { - label: '会计单位', - field: 'unit', - sort: 'custom', - isSearch: true, - }, - { - label: '规格型号', - field: 'specifications', - sort: 'custom', - isSearch: true, - }, - { - label: '库位编号', - field: 'locationNumber', - sort: 'custom', - isSearch: true, - }, - { - label: '采购部门', - field: 'purchaseDept', - sort: 'custom', - isSearch: true, - }, - { - label: '供应商编号', - field: 'supplierNumber', - sort: 'custom', - isSearch: true, - }, - { - label: '出厂日期', - field: 'productionDate', - sort: 'custom', - formatter: dateFormatter, - isSearch: true, - search: { - component: 'DatePicker', - componentProps: { - valueFormat: 'YYYY-MM-DD HH:mm:ss', - type: 'daterange', - defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] - } - }, - form: { - component: 'DatePicker', - componentProps: { - type: 'datetime', - valueFormat: 'x' - } - }, - }, - { - label: '购买价格', - field: 'purchasePrice', - sort: 'custom', - isSearch: true, - }, - { - label: '管理部门', - field: 'manageDept', - sort: 'custom', - isSearch: true, - }, - { - label: '数量', - field: 'qty', - sort: 'custom', - isSearch: true, - }, - { - label: '地点ID', - field: 'siteId', - sort: 'custom', - isSearch: true, - }, - { - label: '是否可用', - field: 'available', - dictType: DICT_TYPE.TRUE_FALSE, - dictClass: 'string', - isSearch: true, - isTable: true, - sort: 'custom', - table: { - width: 150 - }, - tableForm: { - type: 'Select', - inactiveValue: 'FALSE', - disabled: true - }, - form: { - component: 'Switch', - value: 'TRUE', - componentProps: { - inactiveValue: 'FALSE', - activeValue: 'TRUE' - } - } - }, - + // { + // label: '规格型号', + // field: 'specifications', + // sort: 'custom', + // isSearch: true + // }, + // { + // label: '库位编号', + // field: 'locationNumber', + // sort: 'custom', + // isSearch: true + // }, + // { + // label: '采购部门', + // field: 'purchaseDept', + // sort: 'custom', + // isSearch: true + // }, + // { + // label: '供应商编号', + // field: 'supplierNumber', + // sort: 'custom', + // isSearch: true + // }, + // { + // label: '出厂日期', + // field: 'productionDate', + // sort: 'custom', + // formatter: dateFormatter, + // isSearch: true, + // search: { + // component: 'DatePicker', + // componentProps: { + // valueFormat: 'YYYY-MM-DD HH:mm:ss', + // type: 'daterange', + // defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + // } + // }, + // form: { + // component: 'DatePicker', + // componentProps: { + // type: 'datetime', + // valueFormat: 'x' + // } + // } + // }, + // { + // label: '购买价格', + // field: 'purchasePrice', + // sort: 'custom', + // isSearch: true + // }, + // { + // label: '管理部门', + // field: 'manageDept', + // sort: 'custom', + // isSearch: true + // }, + // { + // label: '数量', + // field: 'qty', + // sort: 'custom', + // isSearch: true + // }, + // { + // label: '地点ID', + // field: 'siteId', + // sort: 'custom', + // isSearch: true + // }, + // { + // label: '是否可用', + // field: 'available', + // sort: 'custom', + // isSearch: true + // }, + // { + // label: '并发乐观锁', + // field: 'concurrencyStamp', + // sort: 'custom', + // isSearch: true, + // form: { + // component: 'InputNumber', + // value: 0 + // } + // }, + // { + // label: '购买时间', + // field: 'purchaseDate', + // sort: 'custom', + // formatter: dateFormatter, + // isSearch: true, + // search: { + // component: 'DatePicker', + // componentProps: { + // valueFormat: 'YYYY-MM-DD HH:mm:ss', + // type: 'daterange', + // defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + // } + // }, + // form: { + // component: 'DatePicker', + // componentProps: { + // type: 'datetime', + // valueFormat: 'x' + // } + // } + // }, + // { + // label: '单位', + // field: 'unit', + // sort: 'custom', + // isSearch: true + // }, + // { + // label: '会计单位', + // field: 'accountingUnit', + // sort: 'custom', + // isSearch: true + // }, { label: '操作', field: 'action', diff --git a/src/views/eam/fixedAssets/index.vue b/src/views/eam/fixedAssets/index.vue index 3219fd5..e79f16b 100644 --- a/src/views/eam/fixedAssets/index.vue +++ b/src/views/eam/fixedAssets/index.vue @@ -99,8 +99,9 @@ const { getList, setSearchParams } = tableMethods // 列表头部按钮 const HeadButttondata = [ - defaultButtons.defaultAddBtn(null), // 新增 - defaultButtons.defaultExportBtn(null), // 导出 + defaultButtons.defaultAddBtn({hasPermi:'eam:fixedAssets:create'}), // 新增 + defaultButtons.defaultImportBtn({hasPermi:'eam:fixedAssets:import'}), // 导入 + defaultButtons.defaultExportBtn({hasPermi:'eam:fixedAssets:export'}), // 导出 defaultButtons.defaultFreshBtn(null), // 刷新 defaultButtons.defaultFilterBtn(null), // 筛选 defaultButtons.defaultSetBtn(null), // 设置 @@ -118,7 +119,9 @@ const HeadButttondata = [ const buttonBaseClick = (val, item) => { if (val == 'add') { // 新增 openForm('create') - } else if (val == 'export') { // 导出 + } else if (val == 'import') { // 导入 + handleImport() + } else if (val == 'export') { // 导出 handleExport() } else if (val == 'refresh') { // 刷新 getList() @@ -130,8 +133,8 @@ const buttonBaseClick = (val, item) => { // 列表-操作按钮 const butttondata = [ - defaultButtons.mainListEditBtn(null), // 编辑 - defaultButtons.mainListDeleteBtn(null), // 删除 + defaultButtons.mainListEditBtn({hasPermi:'eam:fixedAssets:update'}), // 编辑 + defaultButtons.mainListDeleteBtn({hasPermi:'eam:fixedAssets:delete'}), // 删除 ] // 列表-操作按钮事件