|
@@ -182,7 +182,7 @@
|
|
|
type="info"
|
|
|
icon="el-icon-upload2"
|
|
|
size="mini"
|
|
|
- @click="handleImport"
|
|
|
+ @click="handleImportFile"
|
|
|
v-hasPermi="['sems:specYlrq:edit']"
|
|
|
>文件上传
|
|
|
</el-button>
|
|
@@ -192,8 +192,8 @@
|
|
|
type="warning"
|
|
|
icon="el-icon-download"
|
|
|
size="mini"
|
|
|
- @click="handleExport"
|
|
|
- v-hasPermi="['sems:specYlrq:export']"
|
|
|
+ :disabled="multiple"
|
|
|
+ @click="handleDownloadZip"
|
|
|
>文件下载
|
|
|
</el-button>
|
|
|
</el-col>
|
|
@@ -280,7 +280,40 @@
|
|
|
<!-- <u-table-column :label="$t('部门编号')" align="center" prop="deptId" :show-overflow-tooltip="true"/>-->
|
|
|
<u-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true"/>
|
|
|
<u-table-column :label="$t('备注2')" align="center" prop="remarks2" :render-header="remarksHeader" :show-overflow-tooltip="true"/>
|
|
|
+ <u-table-column label="注册登记资料" align="center" prop="tnNew-score" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-badge
|
|
|
+ :value="scope.row.infoNum"
|
|
|
+ :hidden="scope.row.infoNum == 0"
|
|
|
+ :type="'primary'"
|
|
|
+ :offset="[-5, 5]"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-folder"
|
|
|
+ style="color:#6e96fa;"
|
|
|
+ @click="handleDoc(scope.row , 'sems-ylrq-info')"
|
|
|
+ circle>
|
|
|
+ </el-button>
|
|
|
+
|
|
|
+ </el-badge>
|
|
|
+ </template>
|
|
|
+ </u-table-column>
|
|
|
+ <u-table-column label="全面检验报告" align="center" prop="tnNew-score" width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-badge
|
|
|
+ :value="scope.row.reportNum"
|
|
|
+ :hidden="scope.row.reportNum == 0"
|
|
|
+ :type="'primary'"
|
|
|
+ :offset="[-5, 5]"
|
|
|
+ >
|
|
|
+ <el-button icon="el-icon-folder"
|
|
|
+ size="small"
|
|
|
+ style="color:#6e96fa;" @click="handleDoc(scope.row , 'sems-ylrq-report')" circle></el-button>
|
|
|
|
|
|
+ </el-badge>
|
|
|
+ </template>
|
|
|
+ </u-table-column>
|
|
|
|
|
|
<u-table-column :label="$t('操作')" align="center" fixed="right" width="170"
|
|
|
class-name="small-padding">
|
|
@@ -708,6 +741,9 @@
|
|
|
<input name="ids" v-model="ids" hidden/>
|
|
|
<input name="downloadType" v-model="downloadType" hidden/>
|
|
|
</form>
|
|
|
+ <form ref="downloadForm" :action="downloadZipAction" target="FORMSUBMIT">
|
|
|
+ <input name="id" v-model="downloadForm.id" hidden/>
|
|
|
+ </form>
|
|
|
<el-dialog :close-on-click-modal="false" :title="$t('检验更新')" width="30%" :visible.sync="inspectionInformation">
|
|
|
<el-form ref="dateform" label-width="120px">
|
|
|
<el-form-item>
|
|
@@ -754,55 +790,141 @@
|
|
|
<el-button type="primary" @click="submitModofyForm">{{ $t('提交') }}</el-button>
|
|
|
</el-dialog>
|
|
|
<!-- 文件导入对话框 -->
|
|
|
- <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
|
|
+ <el-dialog :close-on-click-modal="false" v-dialogDrag :title="uploadFile.title" :visible.sync="uploadFile.open" width="400px" append-to-body>
|
|
|
+ <div style="margin-bottom: 20px;">
|
|
|
+ 装 置
|
|
|
+ <el-select v-model="uploadFile.plantCode" :placeholder="$t('请选择')+ $t('装置')" filterable clearable size="small">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in plantOptions"
|
|
|
+ :key="dict.name"
|
|
|
+ :label="dict.name"
|
|
|
+ :value="dict.name"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
<div style="margin-bottom: 20px;">
|
|
|
文件类型
|
|
|
- <el-select v-model="upload.submitData.wxjl" :placeholder="$t('请选择')+ $t('装置维修经理')" filterable clearable
|
|
|
+ <el-select v-model="uploadFile.fileType" :placeholder="$t('请选择')+ $t('文件类型')" filterable clearable
|
|
|
size="small">
|
|
|
<el-option
|
|
|
- v-for="dict in wxjlList"
|
|
|
- :key="dict.userId"
|
|
|
- :label="dict.nickName"
|
|
|
- :value="dict.userId"
|
|
|
+ key="info"
|
|
|
+ label="注册登记资料"
|
|
|
+ value="info"
|
|
|
+ />
|
|
|
+ <el-option
|
|
|
+ key="report"
|
|
|
+ label="全面检验报告"
|
|
|
+ value="report"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<el-upload
|
|
|
- ref="upload"
|
|
|
- :limit="1"
|
|
|
- accept=".xlsx, .xls"
|
|
|
- :data="upload.submitData"
|
|
|
- :headers="upload.headers"
|
|
|
- :action="upload.url + '?updateSupport=' + upload.updateSupport"
|
|
|
- :disabled="upload.isUploading"
|
|
|
- :on-progress="handleFileUploadProgress"
|
|
|
- :on-success="handleFileSuccess"
|
|
|
+ :limit="100"
|
|
|
+ :headers="uploadFile.headers"
|
|
|
+ :action="uploadFile.url"
|
|
|
+ :on-success="handleFileSuccess2"
|
|
|
+ :on-change="handleFileChange"
|
|
|
:auto-upload="false"
|
|
|
drag
|
|
|
+ multiple
|
|
|
>
|
|
|
<i class="el-icon-upload"></i>
|
|
|
<div class="el-upload__text">
|
|
|
{{ $t('将文件拖到此处,或') }}
|
|
|
<em>{{ $t('点击上传') }}</em>
|
|
|
</div>
|
|
|
- <div class="el-upload__tip" slot="tip">
|
|
|
- <!-- <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
|
|
|
- <el-link type="info" style="font-size:12px" @click="importTemplate">{{ $t('下载模板') }}</el-link>
|
|
|
- </div>
|
|
|
- <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
|
|
|
- <input name="type" :value="upload.type" hidden/>
|
|
|
- </form>
|
|
|
<div class="el-upload__tip" style="color:red" slot="tip">{{ $t('提示:仅允许导入“xls”或“xlsx”格式文件!') }}</div>
|
|
|
- <div class="el-upload__tip" style="color:red" slot="tip"> Excel单元格式为文本格式 </div>
|
|
|
|
|
|
</el-upload>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<a v-if="waitSubmit" style="margin-right: 300px">{{ $t('正在导入...') }}</a>
|
|
|
- <el-button type="primary" @click="submitFileForm" v-loading.fullscreen.lock="fullscreenLoading">{{
|
|
|
+ <el-button type="primary" @click="submitFileForm2" v-loading.fullscreen.lock="fullscreenLoading">{{
|
|
|
$t('确定')
|
|
|
}}
|
|
|
</el-button>
|
|
|
- <el-button @click="upload.open = false">{{ $t('取消') }}</el-button>
|
|
|
+ <el-button @click="uploadFile.open = false">{{ $t('取消') }}</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 报告附件对话框 -->
|
|
|
+ <el-dialog :close-on-click-modal="false" v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="1000px" append-to-body >
|
|
|
+ <el-upload v-hasPermi="['training:trainingrecords:file']"
|
|
|
+ ref="doc"
|
|
|
+ :limit="50"
|
|
|
+ :headers="doc.headers"
|
|
|
+ :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
|
|
|
+ :disabled="doc.isUploading"
|
|
|
+ :on-progress="handleFileDocProgress"
|
|
|
+ :on-success="handleFileDocSuccess"
|
|
|
+ :auto-upload="true"
|
|
|
+ drag
|
|
|
+ >
|
|
|
+ <i class="el-icon-upload"></i>
|
|
|
+ <div class="el-upload__text">
|
|
|
+ {{ $t('将文件拖到此处,或') }}
|
|
|
+ <em>{{ $t('点击上传') }}</em>
|
|
|
+ </div>
|
|
|
+ </el-upload>
|
|
|
+ <el-table :data="doc.commonfileList" border>
|
|
|
+ <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <a class="link-type" @click="handleDownload(scope.row)">
|
|
|
+ <span>{{ scope.row.fileName }}</span>
|
|
|
+ </a>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
|
|
|
+ <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
|
|
|
+ <!-- <el-table-column :label="$t('培训日期')" align="center" prop="pDate" width="150">-->
|
|
|
+ <!-- <template slot-scope="scope">-->
|
|
|
+ <!-- <el-date-picker-->
|
|
|
+ <!-- v-if="scope.row.isEdit"-->
|
|
|
+ <!-- v-model="scope.row.pDate"-->
|
|
|
+ <!-- type="date"-->
|
|
|
+ <!-- value-format="yyyy-MM-dd"-->
|
|
|
+ <!-- placeholder="日期">-->
|
|
|
+ <!-- </el-date-picker>-->
|
|
|
+ <!-- <span v-else>{{ parseTime(scope.row.pDate, '{y}-{m}-{d}') }}</span>-->
|
|
|
+ <!-- </template>-->
|
|
|
+ <!-- </el-table-column>-->
|
|
|
+ <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.fileName.endsWith('pdf')"
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-view"
|
|
|
+ @click="handleSee(scope.row)"
|
|
|
+ >{{ $t('预览') }}</el-button>
|
|
|
+ <el-button v-hasPermi="['training:trainingrecords:file']" type="text" size="small" v-if="scope.row.isEdit" @click="save(scope.row)">保存</el-button>
|
|
|
+ <el-button type="text" size="small" v-if="scope.row.isEdit" @click="cancelFile(scope.row, scope.$index)">取消</el-button>
|
|
|
+ <!-- <el-button v-hasPermi="['training:trainingrecords:file']" v-if="!scope.row.isEdit" @click="edit(scope.row)" icon="el-icon-edit" type="text" size="mini">编辑</el-button>-->
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-download"
|
|
|
+ @click="handleDownload(scope.row)"
|
|
|
+ >{{ $t('下载') }}</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="handleDeleteDoc(scope.row)"
|
|
|
+ v-hasPermi="['training:trainingrecords:file']"
|
|
|
+ >{{ $t('删除') }}</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-dialog :close-on-click-modal="false" v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px" append-to-body>
|
|
|
+ <div style="margin-top: -60px;float: right;margin-right: 40px;">
|
|
|
+ <el-button size="mini" type="text" @click="openPdf">{{$t('新页面打开PDF')}}</el-button></div>
|
|
|
+ <div style="margin-top: -30px">
|
|
|
+ <iframe :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"></iframe>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <!-- <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>-->
|
|
|
+ <el-button @click="doc.open = false">{{ $t('返 回') }}</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<add-approve v-if="addAprroveVisible" ref="addApprove" @refreshDataList="getList"></add-approve>
|
|
@@ -818,10 +940,12 @@ import {
|
|
|
exportSpecYlrq,
|
|
|
getSpecYlrq,
|
|
|
listSpecYlrq,
|
|
|
+ downloadFileZip,
|
|
|
updateSpecYlrqPre,
|
|
|
updateSpecYlrq,
|
|
|
exportSpecList,
|
|
|
duplicate,
|
|
|
+ importFiles,
|
|
|
updateSpecYlrqBatch
|
|
|
} from "@/api/sems/specYlrq";
|
|
|
import {treeselect} from "@/api/system/dept";
|
|
@@ -835,6 +959,7 @@ import HisApprove from "../approve/tapprove-his"
|
|
|
import HisCheck from "../check/check"
|
|
|
import {addModify} from "@/api/sems/his/modify";
|
|
|
import HisReform from "./specYlrq-hisReform";
|
|
|
+import {allFileList, delCommonfile} from "@/api/common/commonfile";
|
|
|
|
|
|
export default {
|
|
|
name: "SpecYlrq",
|
|
@@ -904,6 +1029,66 @@ export default {
|
|
|
url: process.env.VUE_APP_BASE_API + "/sems/specYlrq/importData",
|
|
|
submitData: {wxjl: null}
|
|
|
},
|
|
|
+ // 报告附件参数
|
|
|
+ doc: {
|
|
|
+ file: "",
|
|
|
+ // 是否显示弹出层(报告附件)
|
|
|
+ open: false,
|
|
|
+ // 弹出层标题(报告附件)
|
|
|
+ title: "附件",
|
|
|
+ // 是否禁用上传
|
|
|
+ isUploading: false,
|
|
|
+ // 是否更新已经存在的用户数据
|
|
|
+ updateSupport: 0,
|
|
|
+ // 报告附件上传位置编号
|
|
|
+ ids: 0,
|
|
|
+ // 设置上传的请求头部
|
|
|
+ headers: { Authorization: "Bearer " + getToken() },
|
|
|
+ // 上传的地址
|
|
|
+ url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
|
|
|
+ commonfileList: null,
|
|
|
+ queryParams: {
|
|
|
+ pId: null,
|
|
|
+ pType: 'traning'
|
|
|
+ },
|
|
|
+ pType: 'traning',
|
|
|
+ pId: null,
|
|
|
+ form: {}
|
|
|
+ },
|
|
|
+ // 用户导入参数
|
|
|
+ uploadFile: {
|
|
|
+ downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
|
|
|
+ // 是否显示弹出层(用户导入)
|
|
|
+ open: false,
|
|
|
+ type: "specYlrq",
|
|
|
+ // 弹出层标题(用户导入)
|
|
|
+ title: "",
|
|
|
+ // 是否禁用上传
|
|
|
+ isUploading: false,
|
|
|
+ fileList: [],
|
|
|
+ // 是否更新已经存在的用户数据
|
|
|
+ updateSupport: 0,
|
|
|
+ // 设置上传的请求头部
|
|
|
+ headers: {Authorization: "Bearer " + getToken(),"Content-Type": "multipart/form-data"},
|
|
|
+ // 上传的地址
|
|
|
+ url: process.env.VUE_APP_BASE_API + "/sems/specYlrq/importFiles",
|
|
|
+ fileType: null,
|
|
|
+ plantCode: null,
|
|
|
+ },
|
|
|
+ pdf : {
|
|
|
+ title: '',
|
|
|
+ pdfUrl: '',
|
|
|
+ numPages: null,
|
|
|
+ open: false,
|
|
|
+ pageNum: 1,
|
|
|
+ pageTotalNum: 1,
|
|
|
+ loadedRatio: 0,
|
|
|
+ },
|
|
|
+ downloadForm: {
|
|
|
+ id: '',
|
|
|
+ },
|
|
|
+ downloadZipAction: process.env.VUE_APP_BASE_API + '/sems/specYlrq/downloadFileZip',
|
|
|
+ fileList: [],
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
searchValue: null,
|
|
@@ -1244,6 +1429,108 @@ export default {
|
|
|
handleImport() {
|
|
|
this.upload.title = this.$t('用户导入');
|
|
|
this.upload.open = true;
|
|
|
+ },
|
|
|
+ /** 导入按钮操作 */
|
|
|
+ handleImportFile() {
|
|
|
+ this.uploadFile.title = "文件导入";
|
|
|
+ this.uploadFile.open = true;
|
|
|
+ },
|
|
|
+ /** 报告附件按钮操作 */
|
|
|
+ handleDoc(row , fileType) {
|
|
|
+ var workType = "";
|
|
|
+ if (fileType === "byxworklicense-boiler"){
|
|
|
+ workType = this.$t('裂解(裂化)');
|
|
|
+ }else if (fileType === "byxworklicense-compression"){
|
|
|
+ workType = this.$t('压力容器');
|
|
|
+ }else if (fileType === "byxworklicense-separation"){
|
|
|
+ workType = this.$t('压力管道');
|
|
|
+ }else if (fileType === "byxworklicense-pguaeu"){
|
|
|
+ workType = '';
|
|
|
+ }
|
|
|
+ this.doc.pType = fileType
|
|
|
+ this.doc.queryParams.pType = fileType
|
|
|
+ this.doc.id = row.id;
|
|
|
+ this.doc.title = this.$t('附件') ;
|
|
|
+ this.doc.open = true;
|
|
|
+ this.doc.queryParams.pId = row.id
|
|
|
+ this.doc.pId = row.id
|
|
|
+ this.getFileList()
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.doc.clearFiles()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getFileList (){
|
|
|
+ allFileList(this.doc.queryParams).then(response => {
|
|
|
+ response.forEach(element => {
|
|
|
+ element["isEdit"] = false
|
|
|
+ });
|
|
|
+ response.forEach(element => {
|
|
|
+ element["isAdd"] = false
|
|
|
+ });
|
|
|
+ this.doc.commonfileList = response;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //附件上传中处理
|
|
|
+ handleFileDocProgress(event, file, fileList) {
|
|
|
+ this.doc.file = file;
|
|
|
+ this.doc.isUploading = true;
|
|
|
+ },
|
|
|
+ //附件上传成功处理
|
|
|
+ handleFileDocSuccess(response, file, fileList) {
|
|
|
+ this.doc.isUploading = false;
|
|
|
+ this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
|
|
|
+ this.getFileList()
|
|
|
+ },
|
|
|
+ // 文件下载处理
|
|
|
+ handleDownload(row) {
|
|
|
+ var name = row.fileName;
|
|
|
+ var url = row.fileUrl;
|
|
|
+ var suffix = url.substring(url.lastIndexOf("."), url.length);
|
|
|
+ const a = document.createElement('a')
|
|
|
+ a.setAttribute('download', name)
|
|
|
+ a.setAttribute('target', '_blank')
|
|
|
+ a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
|
|
|
+ a.click()
|
|
|
+ },
|
|
|
+ openPdf(){
|
|
|
+ window.open(this.pdf.pdfUrl);//path是文件的全路径地址
|
|
|
+ },
|
|
|
+ handleSee (row){
|
|
|
+ // window.open(process.env.VUE_APP_BASE_API +'/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl);//path是文件的全路径地址
|
|
|
+ this.pdf.open =true
|
|
|
+ this.pdf.title = row.fileName
|
|
|
+ this.pdf.pdfUrl = process.env.VUE_APP_BASE_API +'/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
|
|
|
+ },
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDeleteDoc(row) {
|
|
|
+ const ids = row.id || this.ids;
|
|
|
+ this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
|
|
|
+ confirmButtonText: this.$t('确定'),
|
|
|
+ cancelButtonText: this.$t('取消'),
|
|
|
+ type: "warning"
|
|
|
+ }).then(function() {
|
|
|
+ return delCommonfile(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getFileList()
|
|
|
+ this.msgSuccess(this.$t('删除成功'));
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleDownloadZip() {
|
|
|
+ const ids = this.ids;
|
|
|
+ this.downloadForm.id = ids.join(',')
|
|
|
+ downloadFileZip(this.downloadForm).then(response => {
|
|
|
+ // 创建临时链接
|
|
|
+ const url = window.URL.createObjectURL(new Blob([response]));
|
|
|
+ const link = document.createElement('a');
|
|
|
+ link.href = url;
|
|
|
+ link.setAttribute('download', '文件.zip'); // 和后端返回的文件名一致
|
|
|
+ document.body.appendChild(link);
|
|
|
+
|
|
|
+ // 模拟点击下载
|
|
|
+ link.click();
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
/** 下载模板操作 */
|
|
|
importTemplate() {
|
|
@@ -1253,6 +1540,15 @@ export default {
|
|
|
handleFileUploadProgress(event, file, fileList) {
|
|
|
this.upload.isUploading = true;
|
|
|
this.waitSubmit = true;
|
|
|
+ },
|
|
|
+ // 文件上传中处理
|
|
|
+ handleFileUploadProgress2(event, file, fileList) {
|
|
|
+ this.uploadFile.fileList = fileList;
|
|
|
+ this.uploadFile.isUploading = true;
|
|
|
+ },
|
|
|
+ // 文件上传成功处理
|
|
|
+ handleFileSuccess2(response, file, fileList) {
|
|
|
+
|
|
|
},
|
|
|
// 文件上传成功处理
|
|
|
handleFileSuccess(response, file, fileList) {
|
|
@@ -1283,6 +1579,29 @@ export default {
|
|
|
this.$refs.upload.submit();
|
|
|
this.fullscreenLoading = true
|
|
|
},
|
|
|
+ handleFileChange(file, fileList) {
|
|
|
+ console.log('文件变动:', file);
|
|
|
+ console.log(fileList)
|
|
|
+ this.fileList = fileList; // 更新文件列表
|
|
|
+ console.log(this.fileList)
|
|
|
+ },
|
|
|
+ // 提交上传文件
|
|
|
+ submitFileForm2() { // 导入
|
|
|
+ let formData = new FormData(); // 用FormData存放上传文件
|
|
|
+ console.log(this.fileList)
|
|
|
+ this.fileList.forEach(file => {
|
|
|
+ formData.append('file', file.raw)
|
|
|
+ })
|
|
|
+ formData.append("plantCode", this.uploadFile.plantCode)
|
|
|
+ formData.append("fileType", this.uploadFile.fileType)
|
|
|
+ // importCase是上传接口
|
|
|
+ importFiles(formData).then((res) => {
|
|
|
+ //手动上传无法触发成功或失败的钩子函数,因此这里手动调用
|
|
|
+
|
|
|
+ }, (err) => {
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
addAprrove(row, type) {
|
|
|
var rows = row ? [row] : this.dataListSelections.map(item => {
|
|
|
return item
|