add:载具zpl打印
This commit is contained in:
@@ -47,14 +47,14 @@
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-printer"
|
||||
size="mini"
|
||||
@click="printView"
|
||||
>
|
||||
打印
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-printer"
|
||||
size="mini"
|
||||
@click="handlePrint"
|
||||
>
|
||||
打印
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
@@ -438,6 +438,26 @@ export default {
|
||||
}
|
||||
this.printVisible = true
|
||||
},
|
||||
handlePrint() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
if (!_selectData || _selectData.length < 1) {
|
||||
this.crud.notify('请选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
const codes = _selectData.map(item => item.storagevehicle_code).join('\n')
|
||||
const ids = _selectData.map(item => item.storagevehicle_id)
|
||||
this.$confirm(`确认打印以下载具编码?\n${codes}`, '打印确认', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudStoragevehicleinfo.printLabel(ids).then(res=>{
|
||||
this.crud.notify('打印成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
|
||||
this.crud.toQuery()
|
||||
}).catch(() => {})
|
||||
},
|
||||
printClose() {
|
||||
this.printVisible = false
|
||||
this.printForm = {
|
||||
|
||||
@@ -39,4 +39,12 @@ export function getVehicle(code) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, changeActive, getVehicle }
|
||||
export function printLabel(ids){
|
||||
return request({
|
||||
url: '/api/storagevehicleinfo/printLabel',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, changeActive, getVehicle, printLabel }
|
||||
|
||||
Reference in New Issue
Block a user