zouyu
2023-12-25 0c46dca0eaf58a1e73cc36682cce3ae4f066874d
src/views/quality/rawMaterial/index.vue
@@ -27,7 +27,7 @@
            @queryParam="getQueryParam($event)"
            ref="rawMaterialTable">
            <template #toolbar>
                <el-button @click="exportRawMaterial" type="primary" >导出</el-button>
                <!-- <el-button @click="exportRawMaterial" type="primary" >导出</el-button> -->
            </template>
            </ttable>
        </basic-container>
@@ -214,38 +214,8 @@
                            }
                    },
                ],
                toolbar: [
                    {
                        text: '新增',
                        type: 'primary',
                        fun: this.addOrUpdateHandle
                    },
                    {
                        text: '下载检验报告',
                        type: 'primary',
                        fun: this.downloadReport
                    }
                ],
                operator: [
                //     {
                //     text: '打印',
                //     type: 'text',
                //     size: 'small',
                //     fun: this.previewFun,
                //     show: {
                //         val: [
                //             '1',
                //             '0'
                //         ],
                //         key: 'judgeState'
                //     }
                // },
                {
                    text: '作废',
                    type: 'text',
                    size: 'small',
                    fun: this.deleteHandle
                }],
                toolbar: [],
                operator: null,
                operatorConfig: {
                fixed: 'right',
                label: '操作',
@@ -262,7 +232,30 @@
        RawMaterialForm,
        printTemplate,
    },
    created() { },
    created() {
        if(this.permissions.quality_rawMaterial_add){
            this.table.toolbar.push({
                text: '新增',
                type: 'primary',
                fun: this.addOrUpdateHandle
            })
        }
        if(this.permissions.quality_rawMaterial_download){
            this.table.toolbar.push({
                text: '下载检验报告',
                type: 'primary',
                fun: this.downloadReport
            })
        }
        if(this.permissions.quality_rawMaterial_del){
            this.table.operator = [{
                    text: '作废',
                    type: 'text',
                    size: 'small',
                    fun: this.deleteHandle
                }]
        }
     },
    computed: {
        ...mapGetters(['permissions'])
    },
@@ -287,8 +280,11 @@
                    this.$message.error("只能选择已检测的数据")
                    return
                }
                console.log(selection)
                downloadReport().then(res=>{
                let ids = []
                selection.forEach(ele=>{
                    ids.push(ele.id)
                })
                downloadReport({ids : ids}).then(res=>{
                    transformZip(res)
                }).catch(error=>{
                    console.log(error)
@@ -329,7 +325,6 @@
        },
        exportRawMaterial(){
            exportRawMaterial(this.queryParam).then(res=>{
                console.log(res)
                this.downloadFun(res)
            }).catch(error=>{
                console.log(error);
@@ -373,6 +368,10 @@
        },
        // 新增 / 修改
        addOrUpdateHandle(row) {
            if(!this.permissions.quality_rawMaterial_edit && row.id!=null){
                this.$message.error("该角色没有操作权限")
                return
            }
            this.$router.push({
                name: 'rawMaterialForm',
                query: {