|
@@ -57,7 +57,7 @@
|
|
|
<el-button
|
|
|
type="danger"
|
|
|
size="mini"
|
|
|
- @click="exportData"
|
|
|
+ @click="syncData"
|
|
|
>{{ $t('同步数据') }}
|
|
|
</el-button>
|
|
|
</el-col>
|
|
@@ -76,7 +76,7 @@
|
|
|
size="mini"
|
|
|
@click="handleImport"
|
|
|
v-hasPermi="['sems:reportYlrq:edit']"
|
|
|
- >导入更新数据
|
|
|
+ >{{ $t('导入更新数据') }}
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
@@ -86,7 +86,24 @@
|
|
|
size="mini"
|
|
|
@click="handleExport"
|
|
|
v-hasPermi="['sems:reportYlrq:export']"
|
|
|
- >{{ $t('导出') }}</el-button>
|
|
|
+ >{{ $t('导出') }}
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ size="mini"
|
|
|
+ @click="importThirdParty"
|
|
|
+ >{{ $t('上传第三方数据') }}
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ size="mini"
|
|
|
+ @click="thirdPartyList"
|
|
|
+ >{{ $t('第三方数据列表') }}
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
@@ -799,6 +816,75 @@
|
|
|
<el-button @click="upload.open = false">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <!-- 第三方导入对话框 -->
|
|
|
+ <el-dialog :title="thirdUpload.title" :visible.sync="thirdUpload.open" width="400px" append-to-body>
|
|
|
+ <div>{{ $t('装置') }}:
|
|
|
+ <el-select v-model="plantCodeThird" :placeholder="$t('请选择') + $t('导入装置')" clearable size="small">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in plantOptions"
|
|
|
+ :key="dict.name"
|
|
|
+ :label="dict.name"
|
|
|
+ :value="dict.name"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div>{{ $t('年份') }}:
|
|
|
+ <el-date-picker
|
|
|
+ v-model="importThirdYear"
|
|
|
+ type="year"
|
|
|
+ placeholder="选择导入的第三方数据年份">
|
|
|
+ </el-date-picker>
|
|
|
+ </div>
|
|
|
+ <el-upload
|
|
|
+ ref="thirdUpload"
|
|
|
+ :limit="1"
|
|
|
+ accept=".xlsx, .xls"
|
|
|
+ :data="submitData"
|
|
|
+ :headers="thirdUpload.headers"
|
|
|
+ :action="thirdUpload.url + '?updateSupport=' + thirdUpload.updateSupport"
|
|
|
+ :disabled="thirdUpload.isUploading"
|
|
|
+ :on-progress="handleFileUploadProgressThird"
|
|
|
+ :on-success="handleFileSuccessThird"
|
|
|
+ :auto-upload="false"
|
|
|
+ drag
|
|
|
+ >
|
|
|
+ <i class="el-icon-upload"></i>
|
|
|
+ <div class="el-upload__text">
|
|
|
+ 将文件拖到此处,或
|
|
|
+ <em>点击上传</em>
|
|
|
+ </div>
|
|
|
+ <!-- <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>-->
|
|
|
+ </el-upload>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="thirdSubmitFileForm">确 定</el-button>
|
|
|
+ <el-button @click="thirdUpload.open = false">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 第三方数据列表对话框 -->
|
|
|
+ <el-dialog :title="thirdList.title" :visible.sync="thirdList.open" width="540px" append-to-body>
|
|
|
+ <el-table
|
|
|
+ :data="reportYlrqThirdList"
|
|
|
+ style="width: 100%">
|
|
|
+ <el-table-column
|
|
|
+ prop="plantCode"
|
|
|
+ :label="$t('装置名称')"
|
|
|
+ width="100"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ align="center"/>
|
|
|
+ <el-table-column
|
|
|
+ prop="year"
|
|
|
+ :label="$t('年份')"
|
|
|
+ width="100"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ align="center"/>
|
|
|
+ <el-table-column
|
|
|
+ prop="fileName"
|
|
|
+ :label="$t('文件名称')"
|
|
|
+ width="300"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ align="center"/>
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
<form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
|
|
|
<input name="type" :value="upload.type" hidden/>
|
|
|
</form>
|
|
@@ -808,12 +894,9 @@
|
|
|
<script>
|
|
|
import {
|
|
|
listReportYlrq,
|
|
|
- getReportYlrq,
|
|
|
delReportYlrq,
|
|
|
- addReportYlrq,
|
|
|
updateReportYlrq,
|
|
|
exportReportYlrq,
|
|
|
- importTemplate,
|
|
|
syncReportYlrq
|
|
|
} from "@/api/sems/reportYlrq";
|
|
|
import {listHistoryYlrq} from "@/api/sems/historyYlrq";
|
|
@@ -822,13 +905,25 @@ import Treeselect from "@riophae/vue-treeselect";
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
import YearApprove from './yearapprove'
|
|
|
import {getToken} from "@/utils/auth";
|
|
|
-import {exportReportYlgd} from "@/api/sems/reportYlgd";
|
|
|
+import {mylistPlant} from "@/api/system/plant";
|
|
|
+import {listTReportThird} from "@/api/sems/tReportThird";
|
|
|
|
|
|
export default {
|
|
|
name: "ReportYlrq",
|
|
|
components: {Treeselect, YearApprove},
|
|
|
data() {
|
|
|
return {
|
|
|
+ submitData: {
|
|
|
+ plantCode: null,
|
|
|
+ year: null,
|
|
|
+ },
|
|
|
+ thirdListQuery: {
|
|
|
+ type: 1,
|
|
|
+ },
|
|
|
+ reportYlrqThirdList: [],
|
|
|
+ plantOptions: [],
|
|
|
+ plantCodeThird: null,
|
|
|
+ importThirdYear: null,
|
|
|
exportCheckYear: null,
|
|
|
dialogVisible: false,
|
|
|
// 遮罩层
|
|
@@ -972,6 +1067,28 @@ export default {
|
|
|
// 上传的地址
|
|
|
url: process.env.VUE_APP_BASE_API + "/sems/reportYlrq/importForUpdate"
|
|
|
},
|
|
|
+ // 第三方导入参数
|
|
|
+ thirdUpload: {
|
|
|
+ // 是否显示弹出层(用户导入)
|
|
|
+ open: false,
|
|
|
+ // 弹出层标题(用户导入)
|
|
|
+ title: "",
|
|
|
+ // 是否禁用上传
|
|
|
+ isUploading: false,
|
|
|
+ // 是否更新已经存在的用户数据
|
|
|
+ updateSupport: 0,
|
|
|
+ // 设置上传的请求头部
|
|
|
+ headers: {Authorization: "Bearer " + getToken()},
|
|
|
+ // 上传的地址
|
|
|
+ url: process.env.VUE_APP_BASE_API + "/sems/reportYlrq/importForThird"
|
|
|
+ },
|
|
|
+ // 第三方数据列表
|
|
|
+ thirdList: {
|
|
|
+ // 是否显示弹出层(用户导入)
|
|
|
+ open: false,
|
|
|
+ // 弹出层标题(用户导入)
|
|
|
+ title: "",
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -1089,6 +1206,15 @@ export default {
|
|
|
this.getDicts("REPORT_CON").then(response => {
|
|
|
this.conOptions = response.data;
|
|
|
});
|
|
|
+ this.getDicts("PLANT_DIVIDE").then(response => {
|
|
|
+ this.plantCodeOptions = response.data;
|
|
|
+ });
|
|
|
+ let plantParams = {
|
|
|
+ pType: 1
|
|
|
+ }
|
|
|
+ mylistPlant(plantParams).then(response => {
|
|
|
+ this.plantOptions = response.data;
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
/** 查询压力容器年检报告列表 */
|
|
@@ -1555,12 +1681,46 @@ export default {
|
|
|
confirmButtonText: this.$t('确定'),
|
|
|
cancelButtonText: this.$t('取消'),
|
|
|
type: "warning"
|
|
|
- }).then(function() {
|
|
|
+ }).then(function () {
|
|
|
return exportReportYlrq(queryParams);
|
|
|
}).then(response => {
|
|
|
this.download(response.msg);
|
|
|
})
|
|
|
},
|
|
|
+ //导入第三方数据
|
|
|
+ importThirdParty() {
|
|
|
+ this.thirdUpload.title = "第三方数据导入";
|
|
|
+ this.thirdUpload.open = true;
|
|
|
+ },
|
|
|
+ thirdSubmitFileForm() {
|
|
|
+ this.submitData.plantCode = this.plantCodeThird;
|
|
|
+ this.submitData.year = new Date(this.importThirdYear).getFullYear();
|
|
|
+ this.$refs.thirdUpload.submit();
|
|
|
+ },
|
|
|
+ //第三方数据列表
|
|
|
+ thirdPartyList() {
|
|
|
+ listTReportThird(this.thirdListQuery).then(response => {
|
|
|
+ this.reportYlrqThirdList = response.data;
|
|
|
+ });
|
|
|
+ this.thirdList.title = "第三方数据列表";
|
|
|
+ this.thirdList.open = true;
|
|
|
+ },
|
|
|
+ // 第三方文件上传中处理
|
|
|
+ handleFileUploadProgressThird(event, file, fileList) {
|
|
|
+ this.thirdUpload.isUploading = true;
|
|
|
+ },
|
|
|
+ // 第三方文件上传成功处理
|
|
|
+ handleFileSuccessThird(response, file, fileList) {
|
|
|
+ this.thirdUpload.open = false;
|
|
|
+ this.thirdUpload.isUploading = false;
|
|
|
+ this.$refs.thirdUpload.clearFiles();
|
|
|
+ if (response.data.length > 0) {
|
|
|
+ this.$alert(this.$t('导入成功'));
|
|
|
+ } else {
|
|
|
+ this.$alert(this.$t('导入成功'));
|
|
|
+ }
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
|
|
|
}
|
|
|
};
|