Browse Source

打印标签

linshi20240813
wangyufei 3 months ago
parent
commit
3690b237dd
  1. 72
      src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/index.vue
  2. 10
      src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/inventorymoveRecordMain.data.ts

72
src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/index.vue

@ -71,6 +71,8 @@
:detailAllSchemasRules="InventorymoveRecordDetailRules" :detailAllSchemasRules="InventorymoveRecordDetailRules"
:apiPage="InventorymoveRecordDetailApi.getInventorymoveRecordDetailPage" :apiPage="InventorymoveRecordDetailApi.getInventorymoveRecordDetailPage"
/> />
<!-- 标签打印 -->
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccessLabel" />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/inventorymove-record-main/importMove" :importTemplateData="importTemplateData" <ImportForm ref="importFormRef" url="/wms/inventorymove-record-main/importMove" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" :fromInventoryStatus= "fromInventoryStatus" :toInventoryStatus="toInventoryStatus" /> @success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" :fromInventoryStatus= "fromInventoryStatus" :toInventoryStatus="toInventoryStatus" />
@ -80,6 +82,14 @@
import download from '@/utils/download' import download from '@/utils/download'
import { InventorymoveRecordMain,InventorymoveRecordMainRules,InventorymoveRecordDetail,InventorymoveRecordDetailRules } from './inventorymoveRecordMain.data' import { InventorymoveRecordMain,InventorymoveRecordMainRules,InventorymoveRecordDetail,InventorymoveRecordDetailRules } from './inventorymoveRecordMain.data'
import { InventorymoveRequestMain,InventorymoveRequestMainRules,InventorymoveRequestDetail,InventorymoveRequestDetailRules } from './inventorymoveRecordRequestMain.data' import { InventorymoveRequestMain,InventorymoveRequestMainRules,InventorymoveRequestDetail,InventorymoveRequestDetailRules } from './inventorymoveRecordRequestMain.data'
import {
SupplierdeliverRequestPackage
} from '@/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data'
import { getAccessToken } from '@/utils/auth'
import * as PackageApi from '@/api/wms/package'
import { getJmreportBaseUrl } from '@/utils/systemParam'
import * as InventorymoveRequestMainApi from '@/api/wms/inventorymoveRequestMain' import * as InventorymoveRequestMainApi from '@/api/wms/inventorymoveRequestMain'
import * as InventorymoveRecordMainApi from '@/api/wms/inventorymoveRecordMain' import * as InventorymoveRecordMainApi from '@/api/wms/inventorymoveRecordMain'
import * as InventorymoveRecordDetailApi from '@/api/wms/inventorymoveRecordDetail' import * as InventorymoveRecordDetailApi from '@/api/wms/inventorymoveRecordDetail'
@ -165,17 +175,77 @@ const openForm =async (type: string, row?: number) => {
formRef.value.open(type, row) formRef.value.open(type, row)
} }
// -
// - // -
const butttondata = (row,$index) => { const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>-1&&findIndex<$index){ if(findIndex>-1&&findIndex<$index){
return [] return []
} }
return [] return [
defaultButtons.mainListPointBtn(null), //
]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'point') { //
labelPrint(row)
}
}
const BASE_URL = getJmreportBaseUrl()
//
const searchTableRef = ref()
const labelType = ref('') //
const labelPrint = async (row) => {
tableObject.loading = true
//
let resType = await PackageApi.getPackagePage({
requestNumber: row.number
})
if(resType.list.length > 0){
if (resType.list[0].productionLineCode != null) {
labelType.value = 'zz'
} else {
labelType.value = 'cg'
}
}
const defaultParams = {'moduleName':'productreceipt_predict','tableName':'record_productreceipt_main','recordNumber':row.number}
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() const { wsCache } = useCache()

10
src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/inventorymoveRecordMain.data.ts

@ -338,6 +338,16 @@ export const InventorymoveRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
// } // }
// } // }
// }, // },
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 120,
fixed: 'right'
},
}
])) ]))
//表单校验 //表单校验

Loading…
Cancel
Save