|
|
|
@ -6,8 +6,8 @@
|
|
|
|
|
<img src="../../../assets/images/detailsicon/1.png" alt="">
|
|
|
|
|
<span>建筑信息</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="topright">
|
|
|
|
|
<el-button type="primary" size="medium" plain v-if="action === 'fill' || !action"
|
|
|
|
|
<div class="topright" v-if="action === 'fill' || !action || action === 'okay'">
|
|
|
|
|
<el-button type="primary" size="medium" plain v-if="action === 'fill' || !action || action === 'okay'"
|
|
|
|
|
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="addBuildingTag">
|
|
|
|
|
<img src="../../../assets/images/detailsicon/icon-xz@2x.png" alt="新增"
|
|
|
|
|
style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">
|
|
|
|
@ -21,12 +21,12 @@
|
|
|
|
|
style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">
|
|
|
|
|
编辑
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button type="primary" size="medium" plain v-if="action === 'fill' || !action"
|
|
|
|
|
<el-button type="primary" size="medium" plain v-if="action === 'fill' || !action || action === 'okay'"
|
|
|
|
|
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="handleImport">
|
|
|
|
|
<i class="el-icon-download" style="width: 0.6rem; height: 0.6rem; margin-right: 4px;"></i>
|
|
|
|
|
导入
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button type="primary" size="medium" plain v-if="action === 'fill' || !action"
|
|
|
|
|
<el-button type="primary" size="medium" plain v-if="checkRole(['admin', 'common'])"
|
|
|
|
|
style="border: none;background-color: rgba(43,98,241,0.1);color: #2B62F1;" @click="handleExport">
|
|
|
|
|
<img src="../../../assets/images/detailsicon/icon-dc@2x.png" alt="导出"
|
|
|
|
|
style="width: 0.6rem; height: 0.6rem; margin-right: 4px;">
|
|
|
|
@ -214,7 +214,8 @@
|
|
|
|
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
|
|
|
|
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
|
|
|
|
|
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
|
|
|
|
|
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
|
|
|
|
:data="upload.data" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess"
|
|
|
|
|
:auto-upload="false" drag>
|
|
|
|
|
<i class="el-icon-upload"></i>
|
|
|
|
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
|
|
<div class="el-upload__tip text-center" slot="tip">
|
|
|
|
@ -234,6 +235,7 @@
|
|
|
|
|
<script>
|
|
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
|
|
import { getjzxxinformationByxmId, addjzxx, updatejzxx, deletejzxx } from '@/api/ManageApi/index';
|
|
|
|
|
import { checkPermi, checkRole } from "@/utils/permission";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
dicts: ['isno'],
|
|
|
|
@ -294,6 +296,9 @@ export default {
|
|
|
|
|
headers: { Authorization: "Bearer " + getToken() },
|
|
|
|
|
// 上传的地址
|
|
|
|
|
url: process.env.VUE_APP_BASE_API + "/gysl/buildingInformation/importProjectBuilding",
|
|
|
|
|
data: {
|
|
|
|
|
xmId: this.xmId
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
|
|
|
|
name: [
|
|
|
|
@ -327,13 +332,15 @@ export default {
|
|
|
|
|
this.fetchBuildings();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
checkPermi,
|
|
|
|
|
checkRole,
|
|
|
|
|
/** 导出 */
|
|
|
|
|
/** 导出 */
|
|
|
|
|
handleExport() {
|
|
|
|
|
this.download(
|
|
|
|
|
"/gysl/basicInformation/exportInfo",
|
|
|
|
|
"/gysl/buildingInformation/export",
|
|
|
|
|
{
|
|
|
|
|
idList: this.xmId
|
|
|
|
|
xmId: this.xmId
|
|
|
|
|
},
|
|
|
|
|
`建筑信息${new Date().getTime()}.xlsx`
|
|
|
|
|
);
|
|
|
|
@ -354,19 +361,19 @@ export default {
|
|
|
|
|
handleFileUploadProgress(event, file, fileList) {
|
|
|
|
|
this.upload.isUploading = true;
|
|
|
|
|
},
|
|
|
|
|
// 文件上传成功处理
|
|
|
|
|
handleFileSuccess(response, file, fileList) {
|
|
|
|
|
this.upload.open = false;
|
|
|
|
|
handleFileSuccess(response) {
|
|
|
|
|
this.upload.isUploading = false;
|
|
|
|
|
this.upload.open = false;
|
|
|
|
|
this.$refs.upload.clearFiles();
|
|
|
|
|
this.$alert(
|
|
|
|
|
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
|
|
|
|
response.msg +
|
|
|
|
|
"</div>",
|
|
|
|
|
"导入结果",
|
|
|
|
|
{ dangerouslyUseHTMLString: true }
|
|
|
|
|
);
|
|
|
|
|
this.getList();
|
|
|
|
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
this.$modal.msgSuccess(response.msg);
|
|
|
|
|
// 重新获取表格数据
|
|
|
|
|
this.fetchBuildings();
|
|
|
|
|
this.$emit("refresh-data"); // 通知父组件刷新
|
|
|
|
|
} else {
|
|
|
|
|
this.$modal.msgError(response.msg || "导入失败");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 提交上传文件
|
|
|
|
|
submitFileForm() {
|
|
|
|
|