diff --git a/pc/.env.development b/pc/.env.development index d718c09..2754fd2 100644 --- a/pc/.env.development +++ b/pc/.env.development @@ -1,4 +1,4 @@ NODE_ENV = 'development' # 开发环境API地址 -VUE_APP_BASE_API = http://localhost:8082/api \ No newline at end of file +VUE_APP_BASE_API = http://192.168.137.45:8080 \ No newline at end of file diff --git a/pc/src/api/building.js b/pc/src/api/building.js index 1a84d68..872224a 100644 --- a/pc/src/api/building.js +++ b/pc/src/api/building.js @@ -69,7 +69,7 @@ export function updateBuilding(data) { export function deleteBuilding(ids) { return request({ url: `/room/building/remove/${ids}`, - method: 'post' + method: 'get' }) } @@ -119,7 +119,7 @@ export function updateFloor(data) { export function deleteFloor(ids) { return request({ url: `/room/floor/remove/${ids}`, - method: 'post' + method: 'get' }) } diff --git a/pc/src/main.js b/pc/src/main.js index 2750dc4..0794d55 100644 --- a/pc/src/main.js +++ b/pc/src/main.js @@ -12,7 +12,7 @@ Vue.config.productionTip = false // 添加下载方法 Vue.prototype.download = function(res, fileName) { // 创建blob链接 - const blob = new Blob([res.data]) + const blob = new Blob([res]) const link = document.createElement('a') link.href = URL.createObjectURL(blob) link.download = fileName diff --git a/pc/src/views/asset/classification/index.vue b/pc/src/views/asset/classification/index.vue index f8c6ac6..aea1b3e 100644 --- a/pc/src/views/asset/classification/index.vue +++ b/pc/src/views/asset/classification/index.vue @@ -211,11 +211,11 @@ export default { rules: { classificationCode: [ { required: true, message: '请输入分类编码', trigger: 'blur' }, - { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' } + { min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' } ], classificationName: [ { required: true, message: '请输入分类名称', trigger: 'blur' }, - { min: 2, max: 50, message: '长度在 2 到 50 个字符', trigger: 'blur' } + { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' } ], parentId: [ { required: false, message: '请选择上级分类', trigger: 'change' } diff --git a/pc/src/views/asset/inventory/index.vue b/pc/src/views/asset/inventory/index.vue index 77ab15d..5f7795d 100644 --- a/pc/src/views/asset/inventory/index.vue +++ b/pc/src/views/asset/inventory/index.vue @@ -12,44 +12,15 @@ - - - - - - - - - {{ advanced ? '收起' : '展开' }} - - - - - - - 全部 - - {{ item.label }} - - 列显示 - - - - - - + - + - + - + - + - + - 搜索 - 重置 + 搜索 + 重置 + + + 全部 + + {{ item.label }} + + 列显示 + @@ -197,7 +182,7 @@ - + @@ -281,16 +265,16 @@ export default { printOpen: false, // 遮罩层 loading: false, + // 资产清单列表 + assetList: [], // 选中数组 ids: [], + // 非单个禁用 + single: true, // 非多个禁用 multiple: true, - // 显示搜索条件 - advanced: false, // 总条数 total: 0, - // 资产表格数据 - assetList: [], // 要打印的资产数据 assetsToPrint: [], // 弹出层标题 @@ -325,7 +309,6 @@ export default { queryParams: { pageNum: 1, pageSize: 10, - keyword: '', assetStatus: '', classificationId: undefined, assetName: '', @@ -339,8 +322,7 @@ export default { upload: { // 是否显示弹出层 open: false, - // 弹出层标题 - title: '', + // 是否禁用上传 isUploading: false, // 设置上传的请求头部 headers: {}, @@ -578,17 +560,32 @@ export default { return typeMap[assetStatus] || 'info' }, - /** 切换高级搜索 */ - toggleAdvanced() { - this.advanced = !this.advanced + /** 搜索按钮操作 */ + handleQuery() { + this.queryParams.pageNum = 1 + this.getList() }, - /** 处理列显示设置 */ - handleColumnDisplay(index) { - // 资产编码列是必须显示的,不能取消 - if (index !== 0) { - this.columns[index].visible = !this.columns[index].visible + /** 重置按钮操作 */ + resetQuery() { + // 使用Element UI表单的resetFields方法重置表单 + if (this.$refs.queryForm) { + this.$refs.queryForm.resetFields() } + + this.queryParams = { + pageNum: 1, + pageSize: 10, + assetStatus: '', + classificationId: undefined, + assetName: '', + locationId: undefined, + assetCode: '', + serialNumber: '', + adminUserId: undefined, + maintenanceExpired: '' + } + this.handleQuery() }, /** 全选/取消全选处理 */ @@ -607,34 +604,6 @@ export default { } }, - /** 搜索按钮操作 */ - handleQuery() { - this.queryParams.pageNum = 1 - this.getList() - }, - - /** 重置按钮操作 */ - resetQuery() { - this.resetForm('queryForm') - if (this.advanced) { - this.resetForm('advancedQueryForm') - } - this.queryParams = { - pageNum: 1, - pageSize: 10, - keyword: '', - assetStatus: '', - classificationId: undefined, - assetName: '', - locationId: undefined, - assetCode: '', - serialNumber: '', - adminUserId: undefined, - maintenanceExpired: '' - } - this.handleQuery() - }, - /** 多选框选中数据 */ handleSelectionChange(selection) { this.ids = selection.map(item => item.id) @@ -733,11 +702,11 @@ export default { /** 导入按钮操作 */ handleImport() { this.upload.open = true - this.upload.title = '导入资产数据' + this.importTitle = '导入资产数据' }, /** 处理文件上传中 */ - handleFileUpload() { + handleFileUploadProgress() { this.upload.isUploading = true }, @@ -747,17 +716,15 @@ export default { this.$refs.upload.clearFiles() this.upload.open = false if (response.code === API_SUCCESS_CODE) { - this.$message.success('导入成功' + (response.data && response.data.successCount ? response.data.successCount : 0) + '条数据') + this.$alert(`成功导入${response.data && response.data.successCount ? response.data.successCount : 0}条数据`, { type: 'success' }) this.getList() + } else { + // 如果是文件流,则下载错误文件 + this.$alert(response.msg || '导入失败,正在下载错误文件', '导入结果', { type: 'error' }) + this.download(response, `资产导入错误文件_${new Date().getTime()}.xlsx`) } }, - /** 文件上传失败处理 */ - handleFileError() { - this.upload.isUploading = false - this.$message.error('导入失败') - }, - /** 提交上传文件 */ submitFileForm() { this.$refs.upload.submit() diff --git a/pc/src/views/asset/location/index.vue b/pc/src/views/asset/location/index.vue index c89cfb2..eb36953 100644 --- a/pc/src/views/asset/location/index.vue +++ b/pc/src/views/asset/location/index.vue @@ -216,12 +216,12 @@ export default { rules: { locationCode: [ { required: true, message: '请输入位置编码', trigger: 'blur' }, - { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }, + { min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' }, { validator: this.validateLocationCode, trigger: 'blur' } ], locationName: [ { required: true, message: '请输入位置名称', trigger: 'blur' }, - { min: 2, max: 50, message: '长度在 2 到 50 个字符', trigger: 'blur' } + { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' } ], parentId: [ { required: false, message: '请选择上级位置', trigger: 'change' } diff --git a/pc/src/views/project/building/index.vue b/pc/src/views/project/building/index.vue index 88fd531..56cf8c6 100644 --- a/pc/src/views/project/building/index.vue +++ b/pc/src/views/project/building/index.vue @@ -11,7 +11,7 @@
管理面积
-
{{ statistics.managementArea }} m²
+
{{ statistics.manageArea }} m²
@@ -23,13 +23,13 @@
在租合同数
-
{{ statistics.contractCount }} 份
+
{{ statistics.rentedContracts }} 份
待租面积
-
{{ statistics.availableArea }} m²
+
{{ statistics.rentableArea }} m²
@@ -98,18 +98,18 @@ 标准层高(m) 建筑面积(m²) 产权面积(m²) - 可租面积(m²) + 可租面积(m²) 自用面积(m²) 配套面积(m²) 车位面积(m²) - 管理面积(m²) - 房间总数(间) - 出租率(%) + 管理面积(m²) + 房间总数(间) + 出租率(%) 在租面积(m²) - 在租合同数 - 本年营收目标(万元) + 在租合同数 + 待租面积(m²) - 待租房间数 + 待租房间数 列显示 @@ -132,8 +132,34 @@ :label="col.label" :prop="col.prop" :min-width="col.width" - align="center" - /> + align="center"> + +