licp
2024-05-06 d271f2493796a557eac67b95b310df776abaf48b
src/views/quality/finishedProductInspection/index.vue
@@ -169,7 +169,7 @@
                    {
                        minWidth: '120',
                        prop: 'createTime',
                        label: '检验日期',
                        label: '报检日期',
                        sort: true,
                        isTrue: true,
                        isSearch: true,
@@ -205,6 +205,8 @@
            this.table.toolbar.push({
                text: '下载检验报告',
                type: 'primary',
                loading: false,
                disabled: false,
                fun: this.downloadProReport
            })
        }
@@ -229,6 +231,7 @@
    },
    methods: {
        downloadProReport(){
            const _than = this
            let selection = this.multipleSelection
            if(!selection || selection.length < 1){
                this.$message.error("请先选择检验数据")
@@ -245,11 +248,18 @@
                selection.forEach(ele=>{
                    ids.push(ele.id)
                })
                downloadReport({ids : ids}).then(res=>{
                    transformZip(res)
                }).catch(error=>{
                _than.table.toolbar.find((e) => e.text === '下载检验报告').loading = true
                _than.table.toolbar.find((e) => e.text === '下载检验报告').disabled = true
                try {
                    downloadReport({ids : ids}).then(res=>{
                        transformZip(res)
                    })
                } catch (error) {
                    console.log(error)
                })
                } finally{
                    _than.table.toolbar.find((e) => e.text === '下载检验报告').loading = false
                    _than.table.toolbar.find((e) => e.text === '下载检验报告').disabled = false
                }
            }
        },
        //打印按钮