cqf
2022-05-21 9bfc581627fc8475fda5bac423a5b76ea4f00df5
文件下载
已修改8个文件
已添加1个文件
266 ■■■■ 文件已修改
src/api/sgyhpczl/fileUtils.js 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sgyhpczl/troubleshooting.js 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Issuedbysuperiors/superiorsSend.vue 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/careabout/index.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dangerDetails/dnagerDetails.vue 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/delayHiddenDangerRectification/rectificationDelayHiddenDanger.vue 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hiddenDangerRectification/sendHiddenDangerList.vue 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hiddenDangerReview/recheckHiddenDangerList.vue 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/troubleshooting/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sgyhpczl/fileUtils.js
对比新文件
@@ -0,0 +1,17 @@
import request from '@/utils/request';
import {getTokenAndVerify} from "@/api/sgyhpczl/auth";
//下载文件
export function downloadFile(params) {
    return request({
        headers: {
            'token': getTokenAndVerify().token,
            'verify': getTokenAndVerify().verify
        },
        url: '/taboi/file/dowloand_do',
        method: 'GET',
        contentType: "multipart/form-data",
        responseType:'blob',
        params:params?params:{}
    });
}
src/api/sgyhpczl/troubleshooting.js
@@ -32,20 +32,6 @@
        data
    });
}
//下载文件
export function dowloand_do(params) {
    return request({
        headers: {
            'token': getTokenAndVerify().token,
            'verify': getTokenAndVerify().verify
        },
        url: '/taboi/file/dowloand_do',
        method: 'GET',
        contentType: "multipart/form-data",
        responseType:'blob',
        params:params?params:{}
    });
}
//新增/编辑
export function addOrEdit(data) {
    return request({
src/views/Issuedbysuperiors/superiorsSend.vue
@@ -296,10 +296,11 @@
                                        >
                                        <template slot-scope="scope">
                                            <span size="medium">{{ scope.row.content }}</span>
                                            <a v-for="item in scope.row.realFileName"
                                               :href="scope.row.url+'/'+item">
                                                {{ item.split("fileName=")[1] }}
                                            </a>
                                            <span v-for="item in scope.row.realFileName">
                                                <el-link  type="primary" @click="downloadFile(subFile(item))">
                                                    {{subFile(item)}}
                                                </el-link>
                                            </span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column
@@ -387,7 +388,7 @@
import {getDangerDetails, getWfRecordList} from "@/api/sgyhpczl/recheckCancellationNumber";
import {company_next_step_do} from "@/api/sgyhpczl/Issuedbysuperiors";
import {getUserInfo} from "@/api/sgyhpczl/hiddenDangerManagement";
import {downloadFile} from "@/api/sgyhpczl/fileUtils";
export default {
    components: {Titlename},
@@ -497,7 +498,40 @@
            this.$router.push({
                path: "/recheckCancellationNumber"
            })
        },
        subFile(fileName){
            return  fileName.substring(fileName.indexOf("fileName=")+9)
        },
        downloadFile(path){
            let params = {
                type: 0,
                fileName: path,
            };
            downloadFile(params).then((res) => {
                if(res.data.type=='text/json'){
                    const reader  = new FileReader();
                    reader.readAsText(res.data, 'utf-8');
                    reader.onload = e => {
                        this.$message({
                            type: "error",
                            message: JSON.parse(reader.result).msg,
                            duration: 3000,
                        });
        }
                } else {
                    let blob = new Blob([res.data], {type: 'application/octet-stream'})
                    console.log(blob)
                    let blobUrl = window.URL.createObjectURL(blob)
                    let downloadElement = document.createElement('a')
                    downloadElement.href = blobUrl
                    downloadElement.download = path
                    document.body.appendChild(downloadElement)
                    downloadElement.click()
                    document.body.removeChild(downloadElement)
                    window.URL.revokeObjectURL(blobUrl)
                }
            });
        },
    }
}
</script>
src/views/careabout/index.vue
@@ -156,7 +156,11 @@
        </el-row>
       <el-table :data="tableData" style="width: 100%"  @selection-change="handleSelectionChange" v-loading="listLoading">
            <el-table-column type="selection" width="55" align="center"></el-table-column>
            <el-table-column prop="number" label="编号" align="center" width="120"></el-table-column>
            <el-table-column prop="number" label="编号" align="center" width="120">
                <template slot-scope="scope">
                    <div class="blue-font-color" @click="showDetails(scope.row)">{{ scope.row.number }}</div>
                </template>
            </el-table-column>
            <el-table-column prop="check_branch" label="检查部门" align="center" width="120"></el-table-column>
            <el-table-column prop="check_man" label="检查人" align="center" width="120"></el-table-column>
            <el-table-column prop="checktype" label="检查类别" align="center"></el-table-column>
@@ -426,6 +430,12 @@
                    }
                })
            },
            showDetails(row){
                this.$router.push({
                    path: "/dangerDetails",
                    query:{"id":row.id}
                })
            },
            typeChange(val){
                this.listQuery.type = val;
                if (val == 1){
src/views/dangerDetails/dnagerDetails.vue
@@ -295,10 +295,11 @@
                                        >
                                        <template slot-scope="scope">
                                            <span size="medium">{{ scope.row.content }}</span>
                                            <a v-for="item in scope.row.realFileName"
                                               :href="scope.row.url+'/'+item">
                                                {{ item.split("fileName=")[1] }}
                                            </a>
                                            <span v-for="item in scope.row.realFileName">
                                                <el-link  type="primary" @click="downloadFile(subFile(item))">
                                                    {{subFile(item)}}
                                                </el-link>
                                            </span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column
@@ -331,6 +332,7 @@
<script>
    import Titlename from "../../components/Titlename/index.vue";
    import {sendDangerNext, getDangerDetails, getWfRecordList} from "@/api/sgyhpczl/recheckCancellationNumber";
    import {downloadFile} from "@/api/sgyhpczl/fileUtils";
    export default {
        components: {Titlename},
@@ -465,7 +467,40 @@
                        path:"/hiddenDangerRectification"
                    })
                }
            },
            subFile(fileName){
                return  fileName.substring(fileName.indexOf("fileName=")+9)
            },
            downloadFile(path){
                let params = {
                    type: 0,
                    fileName: path,
                };
                downloadFile(params).then((res) => {
                    if(res.data.type=='text/json'){
                        const reader  = new FileReader();
                        reader.readAsText(res.data, 'utf-8');
                        reader.onload = e => {
                            this.$message({
                                type: "error",
                                message: JSON.parse(reader.result).msg,
                                duration: 3000,
                            });
            }
                    } else {
                        let blob = new Blob([res.data], {type: 'application/octet-stream'})
                        console.log(blob)
                        let blobUrl = window.URL.createObjectURL(blob)
                        let downloadElement = document.createElement('a')
                        downloadElement.href = blobUrl
                        downloadElement.download = path
                        document.body.appendChild(downloadElement)
                        downloadElement.click()
                        document.body.removeChild(downloadElement)
                        window.URL.revokeObjectURL(blobUrl)
                    }
                });
            },
        }
    }
</script>
src/views/delayHiddenDangerRectification/rectificationDelayHiddenDanger.vue
@@ -297,10 +297,15 @@
                                        >
                                        <template slot-scope="scope">
                                            <span size="medium">{{ scope.row.content }}</span>
                                            <a v-for="item in scope.row.realFileName"
                                               :href="scope.row.url+'/'+item">
                                                {{ item.split("fileName=")[1] }}
                                            </a>
                                            <span v-for="item in scope.row.realFileName">
                                                <el-link  type="primary" @click="downloadFile(subFile(item))">
                                                    {{subFile(item)}}
                                                </el-link>
                                            </span>
<!--                                            <a v-for="item in scope.row.realFileName"-->
<!--                                               :href="scope.row.url+'/'+item">-->
<!--                                                {{ item.split("fileName=")[1] }}-->
<!--                                            </a>-->
                                        </template>
                                    </el-table-column>
                                    <el-table-column
@@ -316,7 +321,7 @@
                </el-form>
                <el-form :model="sendData" :rules="rules" ref="sendData" label-width="150px" class="demo-ruleForm"
                         style="margin: 0 14% 0 16%;">
                    >
                    <el-row>
                        <el-col :span="22">
                            <el-form-item label="发送流程" prop="name">
@@ -397,6 +402,7 @@
<script>
import Titlename from "../../components/Titlename/index.vue";
import {sendDangerNext, getDangerDetails, getWfRecordList} from "@/api/sgyhpczl/recheckCancellationNumber";
import {downloadFile} from "@/api/sgyhpczl/fileUtils";
export default {
    components: {Titlename},
@@ -517,7 +523,40 @@
            this.$router.push({
                path: "/delayHiddenDangerRectification"
            })
        },
        subFile(fileName){
            return  fileName.substring(fileName.indexOf("fileName=")+9)
        },
        downloadFile(path){
            let params = {
                type: 0,
                fileName: path,
            };
            downloadFile(params).then((res) => {
                if(res.data.type=='text/json'){
                    const reader  = new FileReader();
                    reader.readAsText(res.data, 'utf-8');
                    reader.onload = e => {
                        this.$message({
                            type: "error",
                            message: JSON.parse(reader.result).msg,
                            duration: 3000,
                        });
        }
                } else {
                    let blob = new Blob([res.data], {type: 'application/octet-stream'})
                    console.log(blob)
                    let blobUrl = window.URL.createObjectURL(blob)
                    let downloadElement = document.createElement('a')
                    downloadElement.href = blobUrl
                    downloadElement.download = path
                    document.body.appendChild(downloadElement)
                    downloadElement.click()
                    document.body.removeChild(downloadElement)
                    window.URL.revokeObjectURL(blobUrl)
                }
            });
        },
    }
}
</script>
src/views/hiddenDangerRectification/sendHiddenDangerList.vue
@@ -292,10 +292,11 @@
                                        width="260">
                                        <template slot-scope="scope">
                                            <span size="medium">{{ scope.row.content }}</span>
                                            <a v-for="item in scope.row.realFileName"
                                               :href="scope.row.url+'/'+item">
                                                {{ item.split("fileName=")[1] }}
                                            </a>
                                            <span v-for="item in scope.row.realFileName">
                                                <el-link  type="primary" @click="downloadFile(subFile(item))">
                                                    {{subFile(item)}}
                                                </el-link>
                                            </span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column
@@ -391,6 +392,7 @@
<script>
    import Titlename from "../../components/Titlename/index.vue";
    import {sendDangerNext, getDangerDetails, getWfRecordList} from "@/api/sgyhpczl/recheckCancellationNumber";
    import {downloadFile} from "@/api/sgyhpczl/fileUtils";
    export default {
        components: {Titlename},
@@ -518,7 +520,40 @@
                this.$router.push({
                    path:"/hiddenDangerRectification"
                })
            },
            subFile(fileName){
                return  fileName.substring(fileName.indexOf("fileName=")+9)
            },
            downloadFile(path){
                let params = {
                    type: 0,
                    fileName: path,
                };
                downloadFile(params).then((res) => {
                    if(res.data.type=='text/json'){
                        const reader  = new FileReader();
                        reader.readAsText(res.data, 'utf-8');
                        reader.onload = e => {
                            this.$message({
                                type: "error",
                                message: JSON.parse(reader.result).msg,
                                duration: 3000,
                            });
            }
                    } else {
                        let blob = new Blob([res.data], {type: 'application/octet-stream'})
                        console.log(blob)
                        let blobUrl = window.URL.createObjectURL(blob)
                        let downloadElement = document.createElement('a')
                        downloadElement.href = blobUrl
                        downloadElement.download = path
                        document.body.appendChild(downloadElement)
                        downloadElement.click()
                        document.body.removeChild(downloadElement)
                        window.URL.revokeObjectURL(blobUrl)
                    }
                });
            },
        }
    }
</script>
src/views/hiddenDangerReview/recheckHiddenDangerList.vue
@@ -296,10 +296,11 @@
                                        width="260">
                                        <template slot-scope="scope">
                                            <span size="medium">{{ scope.row.content }}</span>
                                            <a v-for="item in scope.row.realFileName"
                                               :href="scope.row.url+'/'+item">
                                                {{ item.split("fileName=")[1] }}
                                            </a>
                                            <span v-for="item in scope.row.realFileName">
                                                <el-link  type="primary" @click="downloadFile(subFile(item))">
                                                    {{subFile(item)}}
                                                </el-link>
                                            </span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column
@@ -431,6 +432,7 @@
<script>
import Titlename from "../../components/Titlename/index.vue";
import {sendDangerNext, getDangerDetails, getWfRecordList} from "@/api/sgyhpczl/recheckCancellationNumber";
import {downloadFile} from "@/api/sgyhpczl/fileUtils";
export default {
    components: {Titlename},
@@ -533,7 +535,40 @@
            this.$router.push({
                path: "/recheckCancellationNumber"
            })
        },
        subFile(fileName){
            return  fileName.substring(fileName.indexOf("fileName=")+9)
        },
        downloadFile(path){
            let params = {
                type: 0,
                fileName: path,
            };
            downloadFile(params).then((res) => {
                if(res.data.type=='text/json'){
                    const reader  = new FileReader();
                    reader.readAsText(res.data, 'utf-8');
                    reader.onload = e => {
                        this.$message({
                            type: "error",
                            message: JSON.parse(reader.result).msg,
                            duration: 3000,
                        });
        }
                } else {
                    let blob = new Blob([res.data], {type: 'application/octet-stream'})
                    console.log(blob)
                    let blobUrl = window.URL.createObjectURL(blob)
                    let downloadElement = document.createElement('a')
                    downloadElement.href = blobUrl
                    downloadElement.download = path
                    document.body.appendChild(downloadElement)
                    downloadElement.click()
                    document.body.removeChild(downloadElement)
                    window.URL.revokeObjectURL(blobUrl)
                }
            });
        },
    }
}
</script>
src/views/troubleshooting/index.vue
@@ -213,6 +213,7 @@
import {getPageList, dowloand_do, addOrEdit, del, revoke, put} from "@/api/sgyhpczl/troubleshooting";
import {uploadFile} from "@/api/sgyhpczl/hiddenDangerRectification";
import {deepClone} from '@/utils'
import {downloadFile} from "@/api/sgyhpczl/fileUtils";
import {
  initYHLX,