|
@@ -5,7 +5,7 @@
|
|
|
<a-row :gutter="48">
|
|
|
<a-col :md="8" :sm="24">
|
|
|
<a-form-item label="关键字">
|
|
|
- <a-input v-model.trim="queryParam.name" placeholder="请输建筑物名称"/>
|
|
|
+ <a-input v-model.trim="queryParam.name" placeholder="请输入建筑物"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="8 || 24" :sm="24">
|
|
@@ -19,9 +19,9 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="table-operator" style="margin-bottom: 8px;">
|
|
|
- <a-button type="primary" icon="plus" @click="$refs.buildingBaseModal.base()">建筑物</a-button>
|
|
|
-<!-- <a-button style="margin-left: 8px" v-if="$auth('firm-producers-export')" type="primary" icon="download" @click="doExport">导出</a-button>-->
|
|
|
-<!-- <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('firm-producers-del')">
|
|
|
+ <a-button type="primary" icon="plus" @click="addBaseForm()">建筑物</a-button>
|
|
|
+<!-- <a-button style="margin-left: 8px" type="primary" icon="download" @click="doExport">导出</a-button>
|
|
|
+ <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('sb-positions-del')">
|
|
|
<a-menu slot="overlay">
|
|
|
<a-popconfirm title="是否要删除所选数据?" @confirm="batchDelete()">
|
|
|
<a-menu-item key="1"><a-icon type="delete" /><a>删除</a></a-menu-item>
|
|
@@ -47,11 +47,15 @@
|
|
|
<template>
|
|
|
<!-- <a @click="handleView(record)">查看</a>
|
|
|
<a-divider type="vertical" />-->
|
|
|
- <a @click="handleEdit(record)">修改</a>
|
|
|
+ <a v-if="$auth('sb-positions-edit')" @click="handleEdit(record)">修改</a>
|
|
|
<a-divider type="vertical" />
|
|
|
<a-popconfirm title="是否要删除该条数据?" @confirm="batchDelete(record.id)">
|
|
|
<a>删除</a>
|
|
|
</a-popconfirm>
|
|
|
+<!-- <a-divider type="vertical" />
|
|
|
+ <a @click="handleCopy(record)">复制</a>
|
|
|
+ <a-divider type="vertical" />
|
|
|
+ <a @click="handleSetting(record)">删除</a>-->
|
|
|
</template>
|
|
|
</span>
|
|
|
</s-table>
|
|
@@ -62,7 +66,7 @@
|
|
|
<script>
|
|
|
import { STable, Ellipsis } from '@/components'
|
|
|
import BuildingBaseForm from './modules/BuildingBaseForm'
|
|
|
-import { getFirmProducerPage, deleteFirmProducers, fetchFirmProducer, exportFirmProducer } from '@/api/firm/producer'
|
|
|
+import { getBuildingPage, queryBuilding, deleteBuildings, fetchBuilding } from '@/api/preparation/building'
|
|
|
|
|
|
export default {
|
|
|
name: 'Building',
|
|
@@ -74,9 +78,10 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
// 查询参数
|
|
|
+ companyMap: [],
|
|
|
queryParam: {
|
|
|
- parentType: 2
|
|
|
},
|
|
|
+ treeData: [],
|
|
|
// 表头
|
|
|
columns: [
|
|
|
{
|
|
@@ -91,13 +96,24 @@ export default {
|
|
|
dataIndex: 'name'
|
|
|
},
|
|
|
{
|
|
|
- title: '添加人',
|
|
|
+ title: '上层建筑物',
|
|
|
+ dataIndex: 'parentId',
|
|
|
+ customRender: (text, record, index) => {
|
|
|
+ return record.parentName
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '创建人',
|
|
|
dataIndex: 'createdUserName'
|
|
|
},
|
|
|
{
|
|
|
- title: '添加时间',
|
|
|
+ title: '创建日期',
|
|
|
dataIndex: 'createdTime'
|
|
|
},
|
|
|
+ {
|
|
|
+ title: '排序',
|
|
|
+ dataIndex: 'sort'
|
|
|
+ },
|
|
|
{
|
|
|
title: '备注',
|
|
|
dataIndex: 'remark'
|
|
@@ -116,11 +132,11 @@ export default {
|
|
|
...parameter,
|
|
|
...this.queryParam,
|
|
|
dataScope: {
|
|
|
- sortBy: 'desc',
|
|
|
- sortName: 'created_time'
|
|
|
+ sortBy: 'asc',
|
|
|
+ sortName: 'sort'
|
|
|
}
|
|
|
}
|
|
|
- return getFirmProducerPage(Object.assign(parameter, this.queryParam))
|
|
|
+ return getBuildingPage(Object.assign(parameter, this.queryParam))
|
|
|
.then(res => {
|
|
|
return res.data
|
|
|
})
|
|
@@ -140,8 +156,19 @@ export default {
|
|
|
},
|
|
|
created () {
|
|
|
this.tableOption()
|
|
|
+ this.getData('')
|
|
|
},
|
|
|
methods: {
|
|
|
+ getData (parentId) {
|
|
|
+ const params = { parentId: parentId }
|
|
|
+ queryBuilding(params).then(res => {
|
|
|
+ this.companyMap = res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ addBaseForm () {
|
|
|
+ const modal = this.$refs.buildingBaseModal
|
|
|
+ modal.base(null, this.companyMap)
|
|
|
+ },
|
|
|
tableOption () {
|
|
|
if (!this.optionAlertShow) {
|
|
|
this.options = {
|
|
@@ -178,16 +205,16 @@ export default {
|
|
|
} else {
|
|
|
ids = [id]
|
|
|
}
|
|
|
- deleteFirmProducers(ids).then(res => {
|
|
|
+ deleteBuildings(ids).then(res => {
|
|
|
this.$message.info('删除成功')
|
|
|
this.handleOk()
|
|
|
this.$refs.table.clearSelected()
|
|
|
})
|
|
|
},
|
|
|
handleEdit (record) {
|
|
|
- fetchFirmProducer({ id: record.id }).then(res => {
|
|
|
+ fetchBuilding({ id: record.id }).then(res => {
|
|
|
const modal = this.$refs.buildingBaseModal
|
|
|
- modal.base(res.data)
|
|
|
+ modal.base(res.data, this.companyMap)
|
|
|
})
|
|
|
},
|
|
|
handleOk () {
|
|
@@ -199,16 +226,10 @@ export default {
|
|
|
},
|
|
|
resetSearchForm () {
|
|
|
this.queryParam = {
|
|
|
+ opcFlag: this.opcFlag,
|
|
|
+ lightFlag: this.lightFlag
|
|
|
}
|
|
|
this.$refs.table.refresh(true)
|
|
|
- },
|
|
|
- doExport () {
|
|
|
- const parameter = {
|
|
|
- ...this.queryParam
|
|
|
- }
|
|
|
- exportFirmProducer(parameter).then(file => {
|
|
|
- this.BaseTool.UPLOAD.downLoadExportExcel(file)
|
|
|
- })
|
|
|
}
|
|
|
}
|
|
|
}
|