|
@@ -53,7 +53,8 @@
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="申请状态" prop="approveStatus">
|
|
<el-form-item label="申请状态" prop="approveStatus">
|
|
- <el-select v-model="queryParams.approveStatus" placeholder="请选择申请状态" clearable size="small" @change="handleQuery">
|
|
|
|
|
|
+ <el-select v-model="queryParams.approveStatus" placeholder="请选择申请状态" clearable size="small"
|
|
|
|
+ @change="handleQuery">
|
|
<el-option
|
|
<el-option
|
|
v-for="item in approveStatusList"
|
|
v-for="item in approveStatusList"
|
|
:key="item.dictValue"
|
|
:key="item.dictValue"
|
|
@@ -79,48 +80,48 @@
|
|
>新增
|
|
>新增
|
|
</el-button>
|
|
</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
-<!-- <el-col :span="1.5">
|
|
|
|
- <el-button
|
|
|
|
- type="success"
|
|
|
|
- icon="el-icon-edit"
|
|
|
|
- size="mini"
|
|
|
|
- :disabled="single"
|
|
|
|
- @click="handleUpdate"
|
|
|
|
- v-hasPermi="['apply:offlinevalve:edit']"
|
|
|
|
- >修改
|
|
|
|
- </el-button>
|
|
|
|
- </el-col>-->
|
|
|
|
-<!-- <el-col :span="1.5">
|
|
|
|
- <el-button
|
|
|
|
- type="danger"
|
|
|
|
- icon="el-icon-delete"
|
|
|
|
- size="mini"
|
|
|
|
- :disabled="multiple"
|
|
|
|
- @click="handleDelete"
|
|
|
|
- v-hasPermi="['apply:offlinevalve:remove']"
|
|
|
|
- >删除
|
|
|
|
- </el-button>
|
|
|
|
- </el-col>-->
|
|
|
|
-<!-- <el-col :span="1.5">
|
|
|
|
- <el-button
|
|
|
|
- type="info"
|
|
|
|
- icon="el-icon-upload2"
|
|
|
|
- size="mini"
|
|
|
|
- @click="handleImport"
|
|
|
|
- v-hasPermi="['apply:offlinevalve:edit']"
|
|
|
|
- >导入
|
|
|
|
- </el-button>
|
|
|
|
- </el-col>-->
|
|
|
|
-<!-- <el-col :span="1.5">
|
|
|
|
- <el-button
|
|
|
|
- type="warning"
|
|
|
|
- icon="el-icon-download"
|
|
|
|
- size="mini"
|
|
|
|
- @click="handleExport"
|
|
|
|
- v-hasPermi="['apply:offlinevalve:export']"
|
|
|
|
- >导出
|
|
|
|
- </el-button>
|
|
|
|
- </el-col>-->
|
|
|
|
|
|
+ <!-- <el-col :span="1.5">
|
|
|
|
+ <el-button
|
|
|
|
+ type="success"
|
|
|
|
+ icon="el-icon-edit"
|
|
|
|
+ size="mini"
|
|
|
|
+ :disabled="single"
|
|
|
|
+ @click="handleUpdate"
|
|
|
|
+ v-hasPermi="['apply:offlinevalve:edit']"
|
|
|
|
+ >修改
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-col>-->
|
|
|
|
+ <!-- <el-col :span="1.5">
|
|
|
|
+ <el-button
|
|
|
|
+ type="danger"
|
|
|
|
+ icon="el-icon-delete"
|
|
|
|
+ size="mini"
|
|
|
|
+ :disabled="multiple"
|
|
|
|
+ @click="handleDelete"
|
|
|
|
+ v-hasPermi="['apply:offlinevalve:remove']"
|
|
|
|
+ >删除
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-col>-->
|
|
|
|
+ <!-- <el-col :span="1.5">
|
|
|
|
+ <el-button
|
|
|
|
+ type="info"
|
|
|
|
+ icon="el-icon-upload2"
|
|
|
|
+ size="mini"
|
|
|
|
+ @click="handleImport"
|
|
|
|
+ v-hasPermi="['apply:offlinevalve:edit']"
|
|
|
|
+ >导入
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-col>-->
|
|
|
|
+ <!-- <el-col :span="1.5">
|
|
|
|
+ <el-button
|
|
|
|
+ type="warning"
|
|
|
|
+ icon="el-icon-download"
|
|
|
|
+ size="mini"
|
|
|
|
+ @click="handleExport"
|
|
|
|
+ v-hasPermi="['apply:offlinevalve:export']"
|
|
|
|
+ >导出
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-col>-->
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
@@ -132,19 +133,23 @@
|
|
<el-table-column label="单元" align="center" prop="unit" :show-overflow-tooltip="true" width="85" fixed="left"/>
|
|
<el-table-column label="单元" align="center" prop="unit" :show-overflow-tooltip="true" width="85" fixed="left"/>
|
|
<el-table-column label="申请状态" align="center" prop="approveStatus" :show-overflow-tooltip="true" width="85"
|
|
<el-table-column label="申请状态" align="center" prop="approveStatus" :show-overflow-tooltip="true" width="85"
|
|
fixed="left" :formatter="approveStatusFormat"/>
|
|
fixed="left" :formatter="approveStatusFormat"/>
|
|
- <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true" width="90" fixed="left" :formatter="statusFormat"/>
|
|
|
|
|
|
+ <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true" width="90" fixed="left"
|
|
|
|
+ :formatter="statusFormat"/>
|
|
|
|
+ <el-table-column label="破锁编号" align="center" prop="lockNo" :show-overflow-tooltip="true" width="140"/>
|
|
<el-table-column label="离线原因" align="center" prop="offlineReason" :show-overflow-tooltip="true" width="185"/>
|
|
<el-table-column label="离线原因" align="center" prop="offlineReason" :show-overflow-tooltip="true" width="185"/>
|
|
<el-table-column label="安全阀锁开是否拆解" align="center" prop="disassembly" :show-overflow-tooltip="true"
|
|
<el-table-column label="安全阀锁开是否拆解" align="center" prop="disassembly" :show-overflow-tooltip="true"
|
|
width="185"/>
|
|
width="185"/>
|
|
- <el-table-column label="临时措施执行人(执行时间)" align="center" prop="executorName" :show-overflow-tooltip="true" width="270">
|
|
|
|
|
|
+ <el-table-column label="临时措施执行人(执行时间)" align="center" prop="executorName" :show-overflow-tooltip="true"
|
|
|
|
+ width="270">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <span>{{scope.row.executorName}} {{ parseTime(scope.row.executionTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
|
|
|
|
|
+ <span>{{ scope.row.executorName }} {{ parseTime(scope.row.executionTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="临时措施确认人(确认时间)" align="center" prop="confirmerName" :show-overflow-tooltip="true"
|
|
|
|
|
|
+ <el-table-column label="临时措施确认人(确认时间)" align="center" prop="confirmerName"
|
|
|
|
+ :show-overflow-tooltip="true"
|
|
width="270">
|
|
width="270">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <span>{{scope.row.confirmerName}} {{ parseTime(scope.row.temporaryTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
|
|
|
|
|
+ <span>{{ scope.row.confirmerName }} {{ parseTime(scope.row.temporaryTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="申请人" align="center" prop="applicantName" :show-overflow-tooltip="true" width="90"/>
|
|
<el-table-column label="申请人" align="center" prop="applicantName" :show-overflow-tooltip="true" width="90"/>
|
|
@@ -153,9 +158,10 @@
|
|
<span>{{ parseTime(scope.row.applicationTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
|
<span>{{ parseTime(scope.row.applicationTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="批准人(时间)" align="center" prop="approverName" :show-overflow-tooltip="true" width="190">
|
|
|
|
|
|
+ <el-table-column label="批准人(时间)" align="center" prop="approverName" :show-overflow-tooltip="true"
|
|
|
|
+ width="190">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <span>{{scope.row.approverName}} {{ parseTime(scope.row.approveTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
|
|
|
|
|
+ <span>{{ scope.row.approverName }} {{ parseTime(scope.row.approveTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
/>
|
|
/>
|
|
@@ -177,10 +183,10 @@
|
|
>流转详情
|
|
>流转详情
|
|
</el-button>
|
|
</el-button>
|
|
<el-button v-if="scope.row.approveStatus == 2"
|
|
<el-button v-if="scope.row.approveStatus == 2"
|
|
- size="mini"
|
|
|
|
- type="text"
|
|
|
|
- icon="el-icon-document"
|
|
|
|
- @click="wordView(scope.row)"
|
|
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-document"
|
|
|
|
+ @click="wordView(scope.row)"
|
|
>预览
|
|
>预览
|
|
</el-button>
|
|
</el-button>
|
|
</template>
|
|
</template>
|
|
@@ -210,7 +216,7 @@
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="单元" prop="unit">
|
|
<el-form-item label="单元" prop="unit">
|
|
- <el-select v-model="form.unit" placeholder="请选择单元" clearable size="small" filterable style="width: 100%">
|
|
|
|
|
|
+ <el-select v-model="form.unit" placeholder="请选择单元" clearable size="small" filterable style="width: 100%" @change="getLocks(form.unit)">
|
|
<el-option
|
|
<el-option
|
|
v-for="dict in unitOptions"
|
|
v-for="dict in unitOptions"
|
|
:key="dict.name"
|
|
:key="dict.name"
|
|
@@ -222,21 +228,30 @@
|
|
<el-form-item label="离线原因" prop="offlineReason">
|
|
<el-form-item label="离线原因" prop="offlineReason">
|
|
<el-input type="textarea" v-model="form.offlineReason" placeholder="请输入离线原因"/>
|
|
<el-input type="textarea" v-model="form.offlineReason" placeholder="请输入离线原因"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
-<!-- <el-form-item label="临时措施执行人" prop="executor">
|
|
|
|
- <el-select v-model="form.executor" placeholder="请选择临时措施执行人" clearable size="small" filterable style="width: 100%" @change="getExecutorName(form.executor)">
|
|
|
|
|
|
+ <!-- <el-form-item label="临时措施执行人" prop="executor">
|
|
|
|
+ <el-select v-model="form.executor" placeholder="请选择临时措施执行人" clearable size="small" filterable style="width: 100%" @change="getExecutorName(form.executor)">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in executorList"
|
|
|
|
+ :key="item.userId"
|
|
|
|
+ :label="item.nickName"
|
|
|
|
+ :value="item.userId"
|
|
|
|
+ ></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>-->
|
|
|
|
+ <el-form-item label="破锁编号" prop="lockNo">
|
|
|
|
+ <el-select v-model="form.lockNo" placeholder="请选择锁编号" clearable size="small" filterable
|
|
|
|
+ style="width: 100%">
|
|
<el-option
|
|
<el-option
|
|
- v-for="item in executorList"
|
|
|
|
- :key="item.userId"
|
|
|
|
- :label="item.nickName"
|
|
|
|
- :value="item.userId"
|
|
|
|
|
|
+ v-for="item in lockList"
|
|
|
|
+ :key="item.lockCode"
|
|
|
|
+ :label="item.lockCode"
|
|
|
|
+ :value="item.lockCode"
|
|
></el-option>
|
|
></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
- </el-form-item>-->
|
|
|
|
- <el-form-item label="破锁编号" prop="lockNo">
|
|
|
|
- <el-input v-model="form.lockNo" placeholder="请输入破锁编号"/>
|
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="临时措施确认人" prop="confirmer">
|
|
<el-form-item label="临时措施确认人" prop="confirmer">
|
|
- <el-select v-model="form.confirmer" placeholder="请选择临时措施确认人" clearable size="small" filterable style="width: 100%">
|
|
|
|
|
|
+ <el-select v-model="form.confirmer" placeholder="请选择临时措施确认人" clearable size="small" filterable
|
|
|
|
+ style="width: 100%">
|
|
<el-option
|
|
<el-option
|
|
v-for="item in confirmerList"
|
|
v-for="item in confirmerList"
|
|
:key="item.USERID"
|
|
:key="item.USERID"
|
|
@@ -301,9 +316,12 @@
|
|
<el-descriptions-item label="安全评估以及临时措施执行" :span="2" :label-style="labelStyle">
|
|
<el-descriptions-item label="安全评估以及临时措施执行" :span="2" :label-style="labelStyle">
|
|
{{ this.detail.data.safa }}
|
|
{{ this.detail.data.safa }}
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
- <el-descriptions-item label="安全阀锁开是否拆解" :span="2" :label-style="labelStyle">
|
|
|
|
|
|
+ <el-descriptions-item label="安全阀锁开是否拆解" :label-style="labelStyle">
|
|
{{ this.detail.data.disassembly }}
|
|
{{ this.detail.data.disassembly }}
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="破锁编号" :label-style="labelStyle">
|
|
|
|
+ {{ this.detail.data.lockNo }}
|
|
|
|
+ </el-descriptions-item>
|
|
<el-descriptions-item label="临时措施执行人" :label-style="labelStyle">
|
|
<el-descriptions-item label="临时措施执行人" :label-style="labelStyle">
|
|
{{ this.detail.data.executorName }}
|
|
{{ this.detail.data.executorName }}
|
|
</el-descriptions-item>
|
|
</el-descriptions-item>
|
|
@@ -405,15 +423,16 @@ import {listPostUser, listUserByMgrRegion, listUserPost} from "@/api/system/user
|
|
import OfflinevalveDetail from "@/views/approve/approveDetail/offlinevalve-detail";
|
|
import OfflinevalveDetail from "@/views/approve/approveDetail/offlinevalve-detail";
|
|
import {listRegionalHead} from "@/api/invoice/device";
|
|
import {listRegionalHead} from "@/api/invoice/device";
|
|
import {listSysPlantByParentId} from "@/api/system/plant";
|
|
import {listSysPlantByParentId} from "@/api/system/plant";
|
|
|
|
+import {listAllLock} from "@/api/apply/lock";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "Offlinevalve",
|
|
name: "Offlinevalve",
|
|
components: {OfflinevalveDetail, Treeselect},
|
|
components: {OfflinevalveDetail, Treeselect},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- offlinevalveDetailVisible:false,
|
|
|
|
- executorList:[],
|
|
|
|
- confirmerList:[],
|
|
|
|
|
|
+ offlinevalveDetailVisible: false,
|
|
|
|
+ executorList: [],
|
|
|
|
+ confirmerList: [],
|
|
status: {0: "未完成", 1: "已完成"},
|
|
status: {0: "未完成", 1: "已完成"},
|
|
approveStatus: {1: "申请中", 2: "已通过", 3: "已拒绝"},
|
|
approveStatus: {1: "申请中", 2: "已通过", 3: "已拒绝"},
|
|
statusFlag: '',
|
|
statusFlag: '',
|
|
@@ -437,6 +456,7 @@ export default {
|
|
total: 0,
|
|
total: 0,
|
|
// 安全阀离线切出申请表格数据
|
|
// 安全阀离线切出申请表格数据
|
|
offlinevalveList: [],
|
|
offlinevalveList: [],
|
|
|
|
+ lockList: [],
|
|
// 安全阀清单
|
|
// 安全阀清单
|
|
safetyvavleList: [],
|
|
safetyvavleList: [],
|
|
// 字典
|
|
// 字典
|
|
@@ -510,7 +530,7 @@ export default {
|
|
confirmerName: null,
|
|
confirmerName: null,
|
|
approverName: null,
|
|
approverName: null,
|
|
applicantName: null,
|
|
applicantName: null,
|
|
- lockNo:null
|
|
|
|
|
|
+ lockNo: null
|
|
},
|
|
},
|
|
pdf: {
|
|
pdf: {
|
|
title: '',
|
|
title: '',
|
|
@@ -540,6 +560,9 @@ export default {
|
|
confirmer: [
|
|
confirmer: [
|
|
{required: true, message: "请选择临时措施确认人", trigger: "blur"}
|
|
{required: true, message: "请选择临时措施确认人", trigger: "blur"}
|
|
],
|
|
],
|
|
|
|
+ lockNo: [
|
|
|
|
+ {required: true, message: "请选择锁编号", trigger: "blur"}
|
|
|
|
+ ],
|
|
}
|
|
}
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -551,8 +574,8 @@ export default {
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
listUserPost({
|
|
listUserPost({
|
|
- actualposts:"20,36,10,11,28,30,32,38,15,12,34",
|
|
|
|
- deptId:103
|
|
|
|
|
|
+ actualposts: "20,36,10,11,28,30,32,38,15,12,34",
|
|
|
|
+ deptId: 103
|
|
}).then(response => {
|
|
}).then(response => {
|
|
this.executorList = response;
|
|
this.executorList = response;
|
|
});
|
|
});
|
|
@@ -568,7 +591,7 @@ export default {
|
|
allSafetyvavle().then(res => {
|
|
allSafetyvavle().then(res => {
|
|
this.safetyvavleList = res.data
|
|
this.safetyvavleList = res.data
|
|
});
|
|
});
|
|
- listSysPlantByParentId({parentId:6}).then(response => {
|
|
|
|
|
|
+ listSysPlantByParentId({parentId: 6}).then(response => {
|
|
this.unitOptions = response.data;
|
|
this.unitOptions = response.data;
|
|
});
|
|
});
|
|
this.getDicts("apply_status").then(response => {
|
|
this.getDicts("apply_status").then(response => {
|
|
@@ -579,17 +602,23 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- getUnit(){
|
|
|
|
|
|
+ getLocks(unit) {
|
|
|
|
+ listAllLock({lockPost: unit,status:0}).then(res => {
|
|
|
|
+ this.lockList = res.data;
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ getUnit() {
|
|
for (const valve of this.safetyvavleList) {
|
|
for (const valve of this.safetyvavleList) {
|
|
- if (this.form.devNo==valve.tagno){
|
|
|
|
- this.form.unit=valve.unit;
|
|
|
|
|
|
+ if (this.form.devNo == valve.tagno) {
|
|
|
|
+ this.form.unit = valve.unit;
|
|
|
|
+ this.getLocks(this.form.unit);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
openApproveDetail(row) {
|
|
openApproveDetail(row) {
|
|
this.offlinevalveDetailVisible = true
|
|
this.offlinevalveDetailVisible = true
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
- this.$refs.offlinevalveDetail.init(row.id, '',row.processId,'','',true)
|
|
|
|
|
|
+ this.$refs.offlinevalveDetail.init(row.id, '', row.processId, '', '', true)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 字典翻译
|
|
// 字典翻译
|
|
@@ -614,19 +643,19 @@ export default {
|
|
}
|
|
}
|
|
return <el-tag type={type}>{s}</el-tag>;
|
|
return <el-tag type={type}>{s}</el-tag>;
|
|
},
|
|
},
|
|
- getExecutorName(userId){
|
|
|
|
|
|
+ getExecutorName(userId) {
|
|
for (let item of this.executorList) {
|
|
for (let item of this.executorList) {
|
|
- if (userId===item.userId){
|
|
|
|
- this.form.executorName=item.nickName;
|
|
|
|
|
|
+ if (userId === item.userId) {
|
|
|
|
+ this.form.executorName = item.nickName;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
console.log(this.form.executorName)
|
|
console.log(this.form.executorName)
|
|
},
|
|
},
|
|
- getConfirmerName(userId){
|
|
|
|
|
|
+ getConfirmerName(userId) {
|
|
for (const item of this.confirmerList) {
|
|
for (const item of this.confirmerList) {
|
|
- if (userId===item.userId){
|
|
|
|
- this.form.confirmerName=item.nickName;
|
|
|
|
|
|
+ if (userId === item.userId) {
|
|
|
|
+ this.form.confirmerName = item.nickName;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -708,7 +737,7 @@ export default {
|
|
executorName: null,
|
|
executorName: null,
|
|
confirmerName: null,
|
|
confirmerName: null,
|
|
approverName: null,
|
|
approverName: null,
|
|
- lockNo:null,
|
|
|
|
|
|
+ lockNo: null,
|
|
applicantName: null
|
|
applicantName: null
|
|
};
|
|
};
|
|
this.resetForm("form");
|
|
this.resetForm("form");
|
|
@@ -820,57 +849,56 @@ export default {
|
|
submitFileForm() {
|
|
submitFileForm() {
|
|
this.$refs.upload.submit();
|
|
this.$refs.upload.submit();
|
|
},
|
|
},
|
|
- wordView(row){
|
|
|
|
|
|
+ wordView(row) {
|
|
wordView(row.id).then(response => {
|
|
wordView(row.id).then(response => {
|
|
console.log(response.msg)
|
|
console.log(response.msg)
|
|
- this.handleSee("申请单",response.msg )
|
|
|
|
|
|
+ this.handleSee("申请单", response.msg)
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- handleSee (fileName , url){
|
|
|
|
|
|
+ handleSee(fileName, url) {
|
|
//office预览
|
|
//office预览
|
|
- this.loadingFlash=true
|
|
|
|
- this.pdf.open =true
|
|
|
|
|
|
+ this.loadingFlash = true
|
|
|
|
+ this.pdf.open = true
|
|
this.pdf.title = fileName
|
|
this.pdf.title = fileName
|
|
- this.pdf.pdfUrl =""
|
|
|
|
- this.pptView=false
|
|
|
|
- this.ppt=true
|
|
|
|
|
|
+ this.pdf.pdfUrl = ""
|
|
|
|
+ this.pptView = false
|
|
|
|
+ this.ppt = true
|
|
//如果是PDF等直接可以打开的就不调接口,否则调用接口
|
|
//如果是PDF等直接可以打开的就不调接口,否则调用接口
|
|
- if(fileName.endsWith('pdf')){
|
|
|
|
|
|
+ if (fileName.endsWith('pdf')) {
|
|
this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + url
|
|
this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + url
|
|
- this.loadingFlash=false
|
|
|
|
- }
|
|
|
|
- else{
|
|
|
|
- const formatDate =new FormData();
|
|
|
|
- formatDate.append("filepath",url)
|
|
|
|
|
|
+ this.loadingFlash = false
|
|
|
|
+ } else {
|
|
|
|
+ const formatDate = new FormData();
|
|
|
|
+ formatDate.append("filepath", url)
|
|
//调用文件预览api
|
|
//调用文件预览api
|
|
- let res= this.officeConvert.bookConvertCommon(formatDate)
|
|
|
|
|
|
+ let res = this.officeConvert.bookConvertCommon(formatDate)
|
|
//查看接受全局方法的返回结果 console.log(res)
|
|
//查看接受全局方法的返回结果 console.log(res)
|
|
//利用.then方法接受Promise对象
|
|
//利用.then方法接受Promise对象
|
|
- res.then((result)=>{
|
|
|
|
|
|
+ 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.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, });
|
|
// this.$message({message: result.msg, center: true,type:'warning', offset:400, });
|
|
- }else if(result.msg.includes("不存在")){
|
|
|
|
|
|
+ } else if (result.msg.includes("不存在")) {
|
|
//文件不存在时提示
|
|
//文件不存在时提示
|
|
- this.pdf.pdfUrl =""
|
|
|
|
- this.$alert(result.msg, this.$t('预览失败'), { dangerouslyUseHTMLString: true });
|
|
|
|
|
|
+ this.pdf.pdfUrl = ""
|
|
|
|
+ this.$alert(result.msg, this.$t('预览失败'), {dangerouslyUseHTMLString: true});
|
|
// this.$message({message: result.msg, center: true,type:'warning', offset:400, });
|
|
// 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.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.$message({message: result.msg, center: true,type:'warning', offset:400, });
|
|
- this.pdf.open =false
|
|
|
|
- } else{
|
|
|
|
|
|
+ this.pdf.open = false
|
|
|
|
+ } else {
|
|
//成功时直接给地址
|
|
//成功时直接给地址
|
|
- this.pdf.pdfUrl =process.env.VUE_APP_BASE_API+ result.data
|
|
|
|
|
|
+ this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + result.data
|
|
}
|
|
}
|
|
}).catch(result => {
|
|
}).catch(result => {
|
|
//请求失败,关闭loading,pdf地址直接为为空,不显示
|
|
//请求失败,关闭loading,pdf地址直接为为空,不显示
|
|
- this.pdf.pdfUrl =""
|
|
|
|
|
|
+ this.pdf.pdfUrl = ""
|
|
this.loadingFlash = false;
|
|
this.loadingFlash = false;
|
|
})
|
|
})
|
|
}
|
|
}
|