|
@@ -57,7 +57,55 @@
|
|
<el-input v-model="dataForm.description" placeholder="请输入问题描述" type="textarea" :rows="3"/>
|
|
<el-input v-model="dataForm.description" placeholder="请输入问题描述" type="textarea" :rows="3"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
- <el-descriptions-item label="附件" :span="3"></el-descriptions-item>
|
|
|
|
|
|
+ <el-descriptions-item label="附件" :span="3">
|
|
|
|
+ <el-table :data="doc.commonfileListApply" 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="createdate" :show-overflow-tooltip="true" width="120"/>
|
|
|
|
+ <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="scope.row.fileName.endsWith('pdf')||scope.row.fileName.endsWith('xlsx')||scope.row.fileName.endsWith('md')
|
|
|
|
+ ||scope.row.fileName.endsWith('docx')||scope.row.fileName.endsWith('doc')||scope.row.fileName.endsWith('txt')
|
|
|
|
+ ||scope.row.fileName.endsWith('jpg')||scope.row.fileName.endsWith('png')||scope.row.fileName.endsWith('csv')
|
|
|
|
+ ||scope.row.fileName.endsWith('mp4')||scope.row.fileName.endsWith('svg')||scope.row.fileName.endsWith('dwg')
|
|
|
|
+ ||scope.row.fileName.endsWith('flv')||scope.row.fileName.endsWith('swf')||scope.row.fileName.endsWith('gif')
|
|
|
|
+ ||scope.row.fileName.endsWith('3gp')||scope.row.fileName.endsWith('mkv')||scope.row.fileName.endsWith('tif')"
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-view"
|
|
|
|
+ @click="handleSee(scope.row)"
|
|
|
|
+ > {{ $t('预览') }}</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="scope.row.fileName.endsWith('ppt')||scope.row.fileName.endsWith('pptx') "
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-view"
|
|
|
|
+ @click="handleSeePPT(scope.row)"
|
|
|
|
+ > {{ $t('ppt预览') }}</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)"
|
|
|
|
+ >{{ $t('删除') }}</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </el-descriptions-item>
|
|
<el-descriptions-item label="隐患" :span="3">
|
|
<el-descriptions-item label="隐患" :span="3">
|
|
<el-radio v-model="unsafeChoice" label="1" style="margin-right: 10px;">不安全状态</el-radio>
|
|
<el-radio v-model="unsafeChoice" label="1" style="margin-right: 10px;">不安全状态</el-radio>
|
|
<el-form-item prop="unsafeStatus" style="display: inline-block;">
|
|
<el-form-item prop="unsafeStatus" style="display: inline-block;">
|
|
@@ -99,8 +147,8 @@
|
|
</div>
|
|
</div>
|
|
<div id="assess-div" v-if="showAssess">
|
|
<div id="assess-div" v-if="showAssess">
|
|
<h4>评估详情</h4>
|
|
<h4>评估详情</h4>
|
|
- <el-descriptions title="" :column="3" border>
|
|
|
|
- <el-descriptions-item label="预计完成时间" :span="3">
|
|
|
|
|
|
+ <el-descriptions title="" :column="2" border>
|
|
|
|
+ <el-descriptions-item label="预计完成时间" :span="2">
|
|
<el-form-item prop="estimateFinishDate">
|
|
<el-form-item prop="estimateFinishDate">
|
|
<el-date-picker
|
|
<el-date-picker
|
|
clearable
|
|
clearable
|
|
@@ -119,12 +167,12 @@
|
|
<el-radio v-model="dataForm.isRecorded" label="0" @change="handleIsRecordedChange">否</el-radio>
|
|
<el-radio v-model="dataForm.isRecorded" label="0" @change="handleIsRecordedChange">否</el-radio>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
- <el-descriptions-item label="开项编号" :span="2">
|
|
|
|
|
|
+ <el-descriptions-item label="开项编号">
|
|
<el-form-item prop="recordNo">
|
|
<el-form-item prop="recordNo">
|
|
<el-input v-model="dataForm.recordNo" placeholder="请输入开项编号" :disabled="recordNoDisabled" style="width: 200px;"/>
|
|
<el-input v-model="dataForm.recordNo" placeholder="请输入开项编号" :disabled="recordNoDisabled" style="width: 200px;"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
- <el-descriptions-item label="采取的措施" :span="3">
|
|
|
|
|
|
+ <el-descriptions-item label="采取的措施" :span="2">
|
|
<el-form-item prop="reaction">
|
|
<el-form-item prop="reaction">
|
|
<el-input v-model="dataForm.reaction" placeholder="请输入采取的措施" type="textarea" :rows="3"/>
|
|
<el-input v-model="dataForm.reaction" placeholder="请输入采取的措施" type="textarea" :rows="3"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -144,7 +192,7 @@
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
- <el-descriptions-item label="验证人" :span="2">
|
|
|
|
|
|
+ <el-descriptions-item label="验证人">
|
|
<el-form-item prop="inspector1" style="display: inline-block;">
|
|
<el-form-item prop="inspector1" style="display: inline-block;">
|
|
<el-select
|
|
<el-select
|
|
clearable
|
|
clearable
|
|
@@ -173,13 +221,13 @@
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
- <el-descriptions-item label="是否需要VE验证" :span="3">
|
|
|
|
|
|
+ <el-descriptions-item label="是否需要VE验证" :span="2">
|
|
<el-form-item prop="needVe">
|
|
<el-form-item prop="needVe">
|
|
<el-radio v-model="dataForm.needVe" label="1" @change="handleNeedVeChange">是</el-radio>
|
|
<el-radio v-model="dataForm.needVe" label="1" @change="handleNeedVeChange">是</el-radio>
|
|
<el-radio v-model="dataForm.needVe" label="0" @change="handleNeedVeChange">否</el-radio>
|
|
<el-radio v-model="dataForm.needVe" label="0" @change="handleNeedVeChange">否</el-radio>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
- <el-descriptions-item label="VE验证条款" :span="3">
|
|
|
|
|
|
+ <el-descriptions-item label="VE验证条款" :span="2">
|
|
<el-form-item prop="veItemsList">
|
|
<el-form-item prop="veItemsList">
|
|
<el-checkbox-group v-model="veItemsList" :disabled="veItemsDisabled">
|
|
<el-checkbox-group v-model="veItemsList" :disabled="veItemsDisabled">
|
|
<el-checkbox label="Level3、Level4的时间纠正措施"></el-checkbox>
|
|
<el-checkbox label="Level3、Level4的时间纠正措施"></el-checkbox>
|
|
@@ -198,8 +246,73 @@
|
|
</div>
|
|
</div>
|
|
<div id="execute-div" v-if="showExecute">
|
|
<div id="execute-div" v-if="showExecute">
|
|
<h4>执行详情</h4>
|
|
<h4>执行详情</h4>
|
|
- <el-descriptions title="" :column="3" border>
|
|
|
|
- <el-descriptions-item label="附件" :span="3"></el-descriptions-item>
|
|
|
|
|
|
+ <el-descriptions title="" border>
|
|
|
|
+ <el-descriptions-item label="附件">
|
|
|
|
+ <el-upload
|
|
|
|
+ ref="doc"
|
|
|
|
+ :limit="50"
|
|
|
|
+ :headers="doc.headers"
|
|
|
|
+ :action="doc.url + '?pType=saiExecute&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.commonfileListExecute" 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="createdate" :show-overflow-tooltip="true" width="120"/>
|
|
|
|
+ <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="scope.row.fileName.endsWith('pdf')||scope.row.fileName.endsWith('xlsx')||scope.row.fileName.endsWith('md')
|
|
|
|
+ ||scope.row.fileName.endsWith('docx')||scope.row.fileName.endsWith('doc')||scope.row.fileName.endsWith('txt')
|
|
|
|
+ ||scope.row.fileName.endsWith('jpg')||scope.row.fileName.endsWith('png')||scope.row.fileName.endsWith('csv')
|
|
|
|
+ ||scope.row.fileName.endsWith('mp4')||scope.row.fileName.endsWith('svg')||scope.row.fileName.endsWith('dwg')
|
|
|
|
+ ||scope.row.fileName.endsWith('flv')||scope.row.fileName.endsWith('swf')||scope.row.fileName.endsWith('gif')
|
|
|
|
+ ||scope.row.fileName.endsWith('3gp')||scope.row.fileName.endsWith('mkv')||scope.row.fileName.endsWith('tif')"
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-view"
|
|
|
|
+ @click="handleSee(scope.row)"
|
|
|
|
+ > {{ $t('预览') }}</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="scope.row.fileName.endsWith('ppt')||scope.row.fileName.endsWith('pptx') "
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-view"
|
|
|
|
+ @click="handleSeePPT(scope.row)"
|
|
|
|
+ > {{ $t('ppt预览') }}</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)"
|
|
|
|
+ >{{ $t('删除') }}</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </el-descriptions-item>
|
|
</el-descriptions>
|
|
</el-descriptions>
|
|
</div>
|
|
</div>
|
|
<div id="inspect-div" v-if="showInspect">
|
|
<div id="inspect-div" v-if="showInspect">
|
|
@@ -216,7 +329,72 @@
|
|
<el-input v-model="dataForm.remarks" placeholder="请输入备注" type="textarea" :rows="3"/>
|
|
<el-input v-model="dataForm.remarks" placeholder="请输入备注" type="textarea" :rows="3"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
- <el-descriptions-item label="附件" :span="3"></el-descriptions-item>
|
|
|
|
|
|
+ <el-descriptions-item label="附件" :span="3">
|
|
|
|
+ <el-upload
|
|
|
|
+ ref="doc"
|
|
|
|
+ :limit="50"
|
|
|
|
+ :headers="doc.headers"
|
|
|
|
+ :action="doc.url + '?pType=saiInspect&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.commonfileListInspect" 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="createdate" :show-overflow-tooltip="true" width="120"/>
|
|
|
|
+ <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="scope.row.fileName.endsWith('pdf')||scope.row.fileName.endsWith('xlsx')||scope.row.fileName.endsWith('md')
|
|
|
|
+ ||scope.row.fileName.endsWith('docx')||scope.row.fileName.endsWith('doc')||scope.row.fileName.endsWith('txt')
|
|
|
|
+ ||scope.row.fileName.endsWith('jpg')||scope.row.fileName.endsWith('png')||scope.row.fileName.endsWith('csv')
|
|
|
|
+ ||scope.row.fileName.endsWith('mp4')||scope.row.fileName.endsWith('svg')||scope.row.fileName.endsWith('dwg')
|
|
|
|
+ ||scope.row.fileName.endsWith('flv')||scope.row.fileName.endsWith('swf')||scope.row.fileName.endsWith('gif')
|
|
|
|
+ ||scope.row.fileName.endsWith('3gp')||scope.row.fileName.endsWith('mkv')||scope.row.fileName.endsWith('tif')"
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-view"
|
|
|
|
+ @click="handleSee(scope.row)"
|
|
|
|
+ > {{ $t('预览') }}</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="scope.row.fileName.endsWith('ppt')||scope.row.fileName.endsWith('pptx') "
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-view"
|
|
|
|
+ @click="handleSeePPT(scope.row)"
|
|
|
|
+ > {{ $t('ppt预览') }}</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)"
|
|
|
|
+ >{{ $t('删除') }}</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </el-descriptions-item>
|
|
</el-descriptions>
|
|
</el-descriptions>
|
|
</div>
|
|
</div>
|
|
</el-form>
|
|
</el-form>
|
|
@@ -247,11 +425,13 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import { getToken } from "@/utils/auth";
|
|
import { updateApply, getApply, handleApply } from "@/api/production/apply";
|
|
import { updateApply, getApply, handleApply } from "@/api/production/apply";
|
|
import { getHistorylist } from "@/api/ehs/approvedanger";
|
|
import { getHistorylist } from "@/api/ehs/approvedanger";
|
|
import { listUserPost } from "@/api/system/user";
|
|
import { listUserPost } from "@/api/system/user";
|
|
import { treeselect, listDept } from "@/api/system/dept";
|
|
import { treeselect, listDept } from "@/api/system/dept";
|
|
import { listSaiInspectors, listSaiExecutors, listStaffmgrByDeptAndTeam, getLoginStaffInfo } from "@/api/plant/staffmgr";
|
|
import { listSaiInspectors, listSaiExecutors, listStaffmgrByDeptAndTeam, getLoginStaffInfo } from "@/api/plant/staffmgr";
|
|
|
|
+import { allFileList, delCommonfile } from "@/api/common/commonfile";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "sai-apply-detail",
|
|
name: "sai-apply-detail",
|
|
@@ -293,6 +473,49 @@ export default {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
return {
|
|
return {
|
|
|
|
+ //图片集合 打开关闭按钮 等等
|
|
|
|
+ imgs:[],
|
|
|
|
+ jpgList:[],
|
|
|
|
+ ppt:false,
|
|
|
|
+ pptView:false,
|
|
|
|
+ loadingFlash:false,
|
|
|
|
+ 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,
|
|
|
|
+ commonfileListApply: null,
|
|
|
|
+ commonfileListExecute: null,
|
|
|
|
+ commonfileListInspect: null,
|
|
|
|
+ queryParams: {
|
|
|
|
+ pId: null,
|
|
|
|
+ pType: 'saiApply'
|
|
|
|
+ },
|
|
|
|
+ pType: 'saiApply',
|
|
|
|
+ pId: null
|
|
|
|
+ },
|
|
|
|
+ // pdf文件参数
|
|
|
|
+ pdf : {
|
|
|
|
+ title: '',
|
|
|
|
+ pdfUrl: '',
|
|
|
|
+ numPages: null,
|
|
|
|
+ open: false,
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageTotalNum: 1,
|
|
|
|
+ loadedRatio: 0,
|
|
|
|
+ },
|
|
visible: false,
|
|
visible: false,
|
|
//流转列表
|
|
//流转列表
|
|
historyList: [],
|
|
historyList: [],
|
|
@@ -414,6 +637,10 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
// 初始化
|
|
// 初始化
|
|
init(id, taskId, processId, taskName) {
|
|
init(id, taskId, processId, taskName) {
|
|
|
|
+ this.doc.id = id;
|
|
|
|
+ this.doc.queryParams.pId = id;
|
|
|
|
+ this.doc.pId = id;
|
|
|
|
+ this.getFileList()
|
|
// 表单重置
|
|
// 表单重置
|
|
this.reset();
|
|
this.reset();
|
|
this.inspector1 = null;
|
|
this.inspector1 = null;
|
|
@@ -512,6 +739,195 @@ export default {
|
|
this.getDicts("SAI_UNSAFE_ACTION").then(response => {
|
|
this.getDicts("SAI_UNSAFE_ACTION").then(response => {
|
|
this.unsafeActionOptions = response.data;
|
|
this.unsafeActionOptions = response.data;
|
|
});
|
|
});
|
|
|
|
+ },
|
|
|
|
+ /** 文件下载处理 */
|
|
|
|
+ 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()
|
|
|
|
+ },
|
|
|
|
+ /** 报告附件按钮操作 */
|
|
|
|
+ handleDoc(row) {
|
|
|
|
+ this.doc.id = row.saiApplyId;
|
|
|
|
+ this.doc.title = "附件";
|
|
|
|
+ this.doc.open = true;
|
|
|
|
+ this.doc.queryParams.pId = row.saiApplyId
|
|
|
|
+ this.doc.pId = row.saiApplyId
|
|
|
|
+ this.getFileList()
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.doc.clearFiles()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ getFileList() {
|
|
|
|
+ allFileList({
|
|
|
|
+ pId: this.doc.queryParams.pId,
|
|
|
|
+ pType: "saiApply"
|
|
|
|
+ }).then(response => {
|
|
|
|
+ this.doc.commonfileListApply = response;
|
|
|
|
+ });
|
|
|
|
+ allFileList({
|
|
|
|
+ pId: this.doc.queryParams.pId,
|
|
|
|
+ pType: "saiExecute"
|
|
|
|
+ }).then(response => {
|
|
|
|
+ this.doc.commonfileListExecute = response;
|
|
|
|
+ });
|
|
|
|
+ allFileList({
|
|
|
|
+ pId: this.doc.queryParams.pId,
|
|
|
|
+ pType: "saiInspect"
|
|
|
|
+ }).then(response => {
|
|
|
|
+ this.doc.commonfileListInspect = 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()
|
|
|
|
+ },
|
|
|
|
+ /** 删除按钮操作 */
|
|
|
|
+ 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('删除成功'));
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ //文件预览
|
|
|
|
+ openPdf(){
|
|
|
|
+ //ppt就跳路由预览,office就直接打开文件新页面
|
|
|
|
+ const didi={ imgs:this.imgs}
|
|
|
|
+ if( this.pptView==true&&this.ppt==false){
|
|
|
|
+ let routeUrl = this.$router.resolve({
|
|
|
|
+ path: "/cpms/index.html#/pptyulan",
|
|
|
|
+ query:didi
|
|
|
|
+ });
|
|
|
|
+ window.open("/cpms/index.html#/pptyulan?id=" + this.pdf.pdfUrl, '_blank')
|
|
|
|
+ }else {
|
|
|
|
+ window.open(this.pdf.pdfUrl)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleSeePPT (row){
|
|
|
|
+ //ppt预览
|
|
|
|
+ this.loadingFlash=true
|
|
|
|
+ this.pdf.open =true
|
|
|
|
+ this.pdf.title = row.fileName
|
|
|
|
+ this.pdf.pdfUrl = row.fileUrl
|
|
|
|
+ this.pptView=true
|
|
|
|
+ this.ppt=false
|
|
|
|
+ const formatDate =new FormData();
|
|
|
|
+ formatDate.append("filepath",row.fileUrl)
|
|
|
|
+
|
|
|
|
+ //调用文件预览api
|
|
|
|
+ let res= this.officeConvert.pptConvertCommon(formatDate)
|
|
|
|
+
|
|
|
|
+ //查看接受的全局方法的返回结果 console.log(res)
|
|
|
|
+ //利用.then方法接受Promise对象
|
|
|
|
+
|
|
|
|
+ res.then((result)=>{
|
|
|
|
+ //关闭加载中
|
|
|
|
+ this.loadingFlash=false
|
|
|
|
+
|
|
|
|
+ //成功时直接给地址
|
|
|
|
+ this.videoList = result.data.imagePathList
|
|
|
|
+ //将返回的地址集合遍历添加到绑定的数组中
|
|
|
|
+ this.imgs=[]
|
|
|
|
+ for (var key=0;key<this.videoList.length;key++) {
|
|
|
|
+ this.imgs.push( process.env.VUE_APP_BASE_API+ this.videoList[key] );
|
|
|
|
+ }
|
|
|
|
+ }).catch(result => {
|
|
|
|
+
|
|
|
|
+ //请求失败,关闭loading,pdf地址直接为为空,不显示
|
|
|
|
+ this.pdf.pdfUrl =""
|
|
|
|
+ this.loadingFlash = false;
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ handleSee (row){
|
|
|
|
+ //office预览
|
|
|
|
+ this.loadingFlash=true
|
|
|
|
+ this.pdf.open =true
|
|
|
|
+ this.pdf.title = row.fileName
|
|
|
|
+ this.pdf.pdfUrl =""
|
|
|
|
+
|
|
|
|
+ this.pptView=false
|
|
|
|
+ this.ppt=true
|
|
|
|
+ //如果是PDF等直接可以打开的就不调接口,否则调用接口
|
|
|
|
+ if(row.fileName.endsWith('pdf')){
|
|
|
|
+ this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
|
|
|
|
+ this.loadingFlash=false
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ const formatDate =new FormData();
|
|
|
|
+ formatDate.append("filepath",row.fileUrl)
|
|
|
|
+
|
|
|
|
+ //调用文件预览api
|
|
|
|
+ let res= this.officeConvert.officeConvertCommon(formatDate)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //查看接受的全局方法的返回结果 console.log(res)
|
|
|
|
+ //利用.then方法接受Promise对象
|
|
|
|
+ res.then((result)=>{
|
|
|
|
+ //关闭加载中
|
|
|
|
+ this.loadingFlash=false
|
|
|
|
+
|
|
|
|
+ if(result.msg.includes("csv")){
|
|
|
|
+ this.pdf.pdfUrl =process.env.VUE_APP_BASE_API+ result.data
|
|
|
|
+ this.$alert(result.msg, this.$t('检查乱码'), { dangerouslyUseHTMLString: true });
|
|
|
|
+ // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
|
|
|
|
+
|
|
|
|
+ }else if(result.msg.includes("不存在")){
|
|
|
|
+ //文件不存在时提示
|
|
|
|
+ this.pdf.pdfUrl =""
|
|
|
|
+ this.$alert(result.msg, this.$t('预览失败'), { dangerouslyUseHTMLString: true });
|
|
|
|
+ // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
|
|
|
|
+ this.pdf.open =false
|
|
|
|
+ }else if(result.msg.includes("不支持此格式")){
|
|
|
|
+
|
|
|
|
+ this.pdf.pdfUrl =""
|
|
|
|
+ this.$alert(result.msg, this.$t('预览失败'), { dangerouslyUseHTMLString: true });
|
|
|
|
+ // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
|
|
|
|
+ this.pdf.open =false
|
|
|
|
+ } else{
|
|
|
|
+ //成功时直接给地址
|
|
|
|
+ this.pdf.pdfUrl =process.env.VUE_APP_BASE_API+ result.data
|
|
|
|
+ }
|
|
|
|
+ // this.$nextTick(() => {
|
|
|
|
+ // const iframe = window.frames['iFrame']
|
|
|
|
+ // const handleLoad = () => {
|
|
|
|
+ // setTimeout(() => {
|
|
|
|
+ // const Do = (iframe.contentWindow || iframe.contentDocument)
|
|
|
|
+ // console.log(Do.document.getElementsByTagName('table')[0])
|
|
|
|
+ // Do.document.getElementsByTagName('table')[0].style.width = "100%"
|
|
|
|
+ // Do.document.getElementsByTagName('table')[0].setAttribute("class","table")
|
|
|
|
+ // }, 500)
|
|
|
|
+ // }
|
|
|
|
+ // iframe.addEventListener('load', handleLoad, true)
|
|
|
|
+ // })
|
|
|
|
+ }).catch(result => {
|
|
|
|
+
|
|
|
|
+ //请求失败,关闭loading,pdf地址直接为为空,不显示
|
|
|
|
+ this.pdf.pdfUrl =""
|
|
|
|
+ this.loadingFlash = false;
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
},
|
|
},
|
|
/** 不安全行为/状态单选按钮值改变事件 */
|
|
/** 不安全行为/状态单选按钮值改变事件 */
|
|
handleUnsafeChoiceChange() {
|
|
handleUnsafeChoiceChange() {
|