This commit is contained in:
2022-07-21 20:09:05 +08:00
9 changed files with 133 additions and 87 deletions

View File

@@ -345,13 +345,17 @@ export default {
openReceive() {
const _selectData = this.$refs.table.selection
const data = _selectData[0]
crudDevicerepairmst.getDtl(data).then(res => {
this.openParam = {
'form3': data,
'itemData': res
}
this.receiveDialog = true
})
if (data.invstatus === '03' || data.invstatus === '04' || data.invstatus === '05') {
crudDevicerepairmst.getDtl(data).then(res => {
this.openParam = {
'form3': data,
'itemData': res
}
this.receiveDialog = true
})
} else {
this.crud.notify('状态不正确', CRUD.NOTIFICATION_TYPE.INFO)
}
}
}
}

View File

@@ -123,7 +123,7 @@
:disabled="crud.selections.length !== 1"
@click="downloadWord"
>
下载Word
生成鉴定申请表
</el-button>
</crudOperation>
<!--表格渲染-->
@@ -282,12 +282,19 @@ export default {
}
},
downloadWord() {
const _selectData = this.$refs.table.selection
const data = _selectData[0]
download('/api/devicescrap/downloadWord', { 'devicerecord_id': data.devicerecord_id }).then(result => {
const name = data.device_name + '报废档案'
this.crud.toQuery()
downloadFile(result, name, 'docx')
const msg = '是否继续'
this.$confirm(msg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const _selectData = this.$refs.table.selection
const data = _selectData[0]
download('/api/devicescrap/downloadWord', { 'devicerecord_id': data.devicerecord_id }).then(result => {
const name = data.device_name + '报废档案'
this.crud.toQuery()
downloadFile(result, name, 'docx')
})
})
}
}

View File

@@ -91,6 +91,7 @@ import pagination from '@crud/Pagination'
import crudSectattr from '@/api/wms/basedata/st/sectattr'
import { download } from '@/api/data'
import { downloadFile } from '@/utils'
import {getLodop} from "@/assets/js/lodop/LodopFuncs";
const defaultForm = { stockrecord_id: null, sparepart_only_id: null, material_id: null, pcsn: null, stor_id: null, stor_name: null, struct_id: null, struct_code: null, struct_name: null, ivt_qty: null, qty_unit_id: null, qty_unit_name: null, instorage_time: null }
export default {
@@ -155,6 +156,35 @@ export default {
crud.downloadLoading = false
})
}
},
print() {
let rows = this.$refs.table.selection
if (rows.length === 0) {
this.crud.notify('请至少勾选一条记录!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
for (var i = 0; i < rows.length; i++) {
let row = rows[i]
debugger
if (row.sparepart_only_id === undefined) {
return this.crud.notify('备件码为空!', CRUD.NOTIFICATION_TYPE.INFO)
}
const LODOP = getLodop()
LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
// 打印纸张大小设置https://www.it610.com/article/2094844.html
LODOP.PRINT_INIT('')
LODOP.SET_PRINT_PAGESIZE(1, '80mm', '60mm', '')
LODOP.ADD_PRINT_RECT('1mm', '3mm', '74mm', '54mm', 0, 1)
LODOP.SET_PRINT_STYLE('FontSize', 9)
LODOP.SET_PRINT_STYLE('Bold', 1)
LODOP.ADD_PRINT_BARCODE('10mm', '15mm', '60mm', '20mm', '128A', row.sparepart_only_id)
LODOP.ADD_PRINT_TEXT('35mm', '15mm', '80mm', '15mm', '备件名称:' + row.material_name + '')
LODOP.ADD_PRINT_TEXT('45mm', '15mm', '80mm', '15mm', '型号:' + row.material_spec + '')
LODOP.PRINT()// 打印
}
this.crud.notify('打印成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
}
}
}

View File

@@ -12,7 +12,7 @@
label-suffix=":"
>
<el-form-item label="统计日期">
<date-range-picker v-model="query.createTime" class="date-item" />
<date-range-picker v-model="query.createTime" class="date-item" value-format="yyyy-MM-dd"/>
</el-form-item>
<el-form-item label="设备类别">
<treeselect