Browse Source

预生产收货记录,装配收货记录打印功能

master_hella_20240701
wangyufei 5 months ago
parent
commit
4498ffc018
  1. 73
      src/views/wms/productionManage/productreceipt/productreceiptRecordMain/index.vue
  2. 81
      src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRecordMain/index.vue

73
src/views/wms/productionManage/productreceipt/productreceiptRecordMain/index.vue

@ -82,6 +82,8 @@
v-model:sort="detatableDataBom.sort"
/>
</Dialog>
<!-- 标签打印 -->
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccessLabel" />
</template>
<script setup lang="ts">
@ -92,6 +94,12 @@ import * as ProductreceiptRecordDetailApi from '@/api/wms/productreceiptRecordDe
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as BackflushRecordDetailbApi from '@/api/wms/backflushRecordDetailb'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import * as PackageApi from '@/api/wms/package'
import {
SupplierdeliverRequestPackage
} from '../../../purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts'
import * as ProductreceiptRequestDetailApi from '@/api/wms/productreceiptRequestDetail'
import { getAccessToken } from '@/utils/auth'
//
//
@ -169,6 +177,14 @@ const buttonBaseClick = (val, item) => {
console.log('其他按钮', item)
}
}
//
const isShowMainButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row,$index) => {
@ -179,6 +195,7 @@ const butttondata = (row,$index) => {
return [
// defaultButtons.mainInspectRequestBtn({hasPermi:'wms:productreceipt-record-main:createInspectRequest',hide:row.inspectRequestFlag == "FALSE" }),//
defaultButtons.mainInspectRequestBtn({hide:row.inspectRequestFlag == "FALSE" }),//
defaultButtons.mainListPointBtn(null), //
]
}
@ -186,7 +203,63 @@ const butttondata = (row,$index) => {
const buttonTableClick = async (val, row) => {
if(val == 'inspectRequest'){//
handleCreateInspectRequest(row.number)
} else if (val == 'point') { //
labelPrint(row)
}
}
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
//
const searchTableRef = ref()
const labelType = ref('') //
const labelPrint = async (row) => {
tableObject.loading = true
//
let resType = await PackageApi.getPackagePage({
requestNumber: row.requestNumber
})
if(resType.list.length > 0){
if (resType.list[0].productionLineCode != null) {
labelType.value = 'zz'
} else {
labelType.value = 'cg'
}
}
const defaultParams = {'moduleName':'productreceipt_predict','recordNumber':row.requestNumber}
const {tableObject:tableObjectPrint ,tableMethods} = useTable({
defaultParams,
getListApi: PackageApi.getLabelDetailPage //
})
//
const { getList:getListPrint } = tableMethods
getListPrint()
tableObject.loading = false
const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns
tableColumns.forEach((item) => {
item.width = item.table?.width || 150
})
searchTableRef.value.openData("标签信息",tableObjectPrint,{tableColumns},true)
}
// --
const searchTableSuccessLabel = async (formField, searchField, val, formRef, type, row) => {
console.log('批量打印',val)
if(val.length == 0){
message.warning("请先选择要打印的数据!")
return
}
await PackageApi.batchPrintingLable(val.map(item1=>item1.number).join(',')).then(res => {
console.log(res)
if (labelType.value == 'cg') {
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res)
} else {
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res)
}
}).catch(err => {
console.log(err)
message.error('创建标签失败')
})
}
//
const { wsCache } = useCache()

81
src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRecordMain/index.vue

@ -103,6 +103,8 @@
v-model:sort="detatableDataBom.sort"
/>
</Dialog>
<!-- 标签打印 -->
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" />
</template>
<script setup lang="ts">
@ -114,6 +116,11 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as ProductreceiptDetailbApi from '@/api/wms/productreceiptDetailb'
import * as BackflushRecordDetailbApi from '@/api/wms/backflushRecordDetailb'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import * as PackageApi from '@/api/wms/package'
import { getAccessToken } from '@/utils/auth'
import {
SupplierdeliverRequestPackage
} from '../../../purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts'
//
defineOptions({ name: 'ProductreceiptRecordMainA' })
@ -209,6 +216,14 @@ const buttonBaseClick = (val, item) => {
}
}
//
const isShowMainButton = (row,val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
return true
}
}
// -
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
@ -217,12 +232,78 @@ const butttondata = (row,$index) => {
}
return [
defaultButtons.mainInspectRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createInspectRequest',hide:row.inspectRequestFlag == "FALSE" }),//
defaultButtons.mainListPointBtn(null), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'point') { //
labelPrint(row)
}
}
const searchTableRef = ref()
const labelType = ref('') //
const labelPrint = async (row) => {
tableObject.loading = true
//
let resType = await PackageApi.getPackagePage({
requestNumber: row.requestNumber
})
if(resType.list.length > 0) {
if (resType.list[0].productionLineCode != null) {
labelType.value = 'zz'
} else {
labelType.value = 'cg'
}
}
const defaultParams = {'moduleName':'productreceipt_assemble','recordNumber':row.requestNumber}
const {tableObject:tableObjectPrint ,tableMethods} = useTable({
defaultParams,
getListApi: PackageApi.getLabelDetailPage //
})
//
const { getList:getListPrint } = tableMethods
getListPrint()
tableObject.loading = false
const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns
tableColumns.forEach((item) => {
item.width = item.table?.width || 150
})
searchTableRef.value.openData("标签信息",tableObjectPrint,{tableColumns},true)
}
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
// --
const searchTableSuccess1 = async (formField, searchField, val, formRef, type, row) => {
console.log('批量打印',val)
// let rows:any = []
// val.forEach(item=>{
// rows = [...rows,...item.selectionRows.map(item1=>item1.number)]
// })
if(val.length == 0){
message.warning("请先选择要打印的数据!")
return
}
// window.open(src.value + '&asn_number=' + val.map(item1=>item1.number).join(','))
await PackageApi.batchPrintingLable(val.map(item1=>item1.number).join(',')).then(res => {
console.log(res)
if (labelType.value == 'cg') {
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res)
} else {
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res)
}
}).catch(err => {
console.log(err)
message.error('创建标签失败')
})
}
//
const { wsCache } = useCache()
/** 详情操作 */

Loading…
Cancel
Save