zouyu
2024-01-30 d267d7082d3a708e4b2b9f569250a3a588cb54ca
src/views/quality/rawMaterial/index.vue
@@ -105,6 +105,17 @@
                    },
                    {
                        minWidth: '120',
                        prop: 'type',
                        label: '检验类型',
                        isTrue: true,
                        isSearch: true,
                        searchInfoType: 'select',
                        optList: () => {
                            return this.typeList
                        }
                    },
                    {
                        minWidth: '120',
                        prop: 'code',
                        label: '原材料编码',
                        isTrue: true,
@@ -225,6 +236,7 @@
            },
            insStateList: [{label:'全部',value:''},{label:'已检测',value:'1'},{label:'未检测',value:'0'}],
            StateList: [{label:'全部',value:''},{label:'已合格',value:'1'},{label:'不合格',value:'0'}],
            typeList: [{label:'全部',value:''},{label:'首检',value:'首检'},{label:'返检',value:'返检'}],
        }
    },
    components: {
@@ -244,7 +256,10 @@
            this.table.toolbar.push({
                text: '下载检验报告',
                type: 'primary',
                fun: this.downloadReport
                loading: false,
                disabled: false,
                fun: this.downloadReport,
            })
        }
        if(this.permissions.quality_rawMaterial_del){
@@ -284,11 +299,18 @@
                selection.forEach(ele=>{
                    ids.push(ele.id)
                })
                downloadReport({ids : ids}).then(res=>{
                    transformZip(res)
                }).catch(error=>{
                this.table.toolbar.find((e) => e.text === '下载检验报告').loading = true
                this.table.toolbar.find((e) => e.text === '下载检验报告').disabled = true
                try{
                    downloadReport({ids : ids}).then(res=>{
                        transformZip(res)
                    })
                }catch(error){
                    console.log(error)
                })
                } finally{
                    this.table.toolbar.find((e) => e.text === '下载检验报告').loading = false
                    this.table.toolbar.find((e) => e.text === '下载检验报告').disabled = false
                }
            }
        },
        //查看报告按钮
@@ -375,7 +397,9 @@
            this.$router.push({
                name: 'rawMaterialForm',
                query: {
                    id: row == null ? null : row.id,
                    id: row == null ? null : row.id
                 },
                 params: {
                    resultVal: row == null ? null : row.judgeState
                 }
            })
@@ -391,7 +415,6 @@
        formatJudgeState(row, column, cellValue){
            if(cellValue != undefined && cellValue != null && cellValue != ''){
                if(cellValue == 0){
                    console.log(cellValue);
                    return "<span style='color:#E84738;'>不合格</span>"
                }
                return "<span style='color:#34BD66;'>合格</span>"