代码更新

This commit is contained in:
2022-10-14 15:45:42 +08:00
parent 89f4859034
commit b277cc4b3b
5 changed files with 164 additions and 6 deletions

View File

@@ -98,6 +98,8 @@
type="warning"
icon="el-icon-check"
size="mini"
:disabled="crud.selections.length !== 1"
@click="printExcel"
>
打印
</el-button>
@@ -147,6 +149,8 @@ import pagination from '@crud/Pagination'
import AddDialog from '@/views/wms/pf/acceptformula/AddDialog'
import ViewDialog from '@/views/wms/pf/acceptformula/ViewDialog'
import Date from '@/utils/datetime'
import {download} from "@/api/data";
import {downloadFile} from "@/utils";
export default {
name: 'Acceptformula',
@@ -229,6 +233,17 @@ export default {
},
querytable() {
this.crud.toQuery()
},
printExcel() {
const _selectData = this.$refs.table.selection
const data = _selectData[0]
download('/api/acceptformula/print', { 'formula_id': data.formula_id }).then(result => {
const name = data.material_code + data.accept_pcsn
downloadFile(result, name, 'xlsx')
crud.downloadLoading = false
}).catch(() => {
crud.downloadLoading = false
})
}
}
}