Browse Source

库存余额打印标签与翻包打印标签

master_hella_20240701
chenfang 6 months ago
parent
commit
0abee12359
  1. 50
      src/api/wms/printLabelCorrelation/index.ts
  2. 23
      src/views/wms/inventoryManage/balance/index.vue
  3. 22
      src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRecordMain/index.vue
  4. 63
      src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRequestMain/index.vue

50
src/api/wms/printLabelCorrelation/index.ts

@ -0,0 +1,50 @@
import request from '@/config/axios'
export interface PrintCorrelationVO {
id: number
number: string
labelId: string
labelType: string
available: string
}
// 查询打印标签关联列表
export const getPrintCorrelationPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/print-correlation/senior', data })
} else {
return await request.get({ url: `/wms/print-correlation/page`, params })
}
}
// 查询打印标签关联详情
export const getPrintCorrelation = async (id: number) => {
return await request.get({ url: `/wms/print-correlation/get?id=` + id })
}
// 新增打印标签关联
export const createPrintCorrelation = async (data: PrintCorrelationVO) => {
return await request.post({ url: `/wms/print-correlation/create`, data })
}
// 修改打印标签关联
export const updatePrintCorrelation = async (data: PrintCorrelationVO) => {
return await request.put({ url: `/wms/print-correlation/update`, data })
}
// 删除打印标签关联
export const deletePrintCorrelation = async (id: number) => {
return await request.delete({ url: `/wms/print-correlation/delete?id=` + id })
}
// 导出打印标签关联 Excel
export const exportPrintCorrelation = async (params) => {
return await request.download({ url: `/wms/print-correlation/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/print-correlation/get-import-template' })
}

23
src/views/wms/inventoryManage/balance/index.vue

@ -178,20 +178,31 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
}
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const labelType = ref('') //
//
const handlePoint = async (row) => {
console.log(row.packingNumber,445555555555555);
PackageApi.getBalanceToPackage(row.packingNumber).then(res => {
console.log(res,66666666666);
//
if (res.asnNumber !== null && res.asnNumber !== '') {
console.log(777,res);
if (res.productionLineCode != null) {
labelType.value = 'zz'
} else {
labelType.value = 'cg'
}
PackageApi.batchPrintingLable((res.number)).then((resLable) =>{
console.log(159,resLable )
//
if (labelType.value == 'cg') {
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res.id)
console.log(159,resLable )
window.open(src.value+'&asn_number='+resLable)
} else {
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res.id)
window.open(src.value+'&asn_number='+resLable)
}
})
}).catch(err => {
console.log(err)
})
}

22
src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRecordMain/index.vue

@ -66,6 +66,7 @@ import download from '@/utils/download'
import { PackageoverMain,PackageoverMainRules, PackageoverDetail, PackageoverDetailRules } from './packageoverRecordMain.data'
import * as PackageoverRecordMainApi from '@/api/wms/packageoverRecordMain'
import * as PackageoverRecordDetailApi from '@/api/wms/packageoverRecordDetail'
import * as printLabelCorrelationApi from '@/api/wms/printLabelCorrelation'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as PackageApi from '@/api/wms/package'
import { getAccessToken } from '@/utils/auth'
@ -149,19 +150,22 @@ const handlePoint = async (row) => {
} else {
labelType.value = 'cg'
}
}
}).catch(err => {
console.log(err)
})
//
if (labelType.value == 'cg') {
PackageApi.batchPrintingLable(res.list.map(item1=>item1.number).join(',')).then((resLable) =>{
console.log(159,resLable )
//
if (labelType.value == 'cg') {
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
console.log(159,row.number )
window.open(src.value+'&asn_number='+row.number)
window.open(src.value+'&asn_number='+resLable)
} else {
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
window.open(src.value+'&asn_number='+row.number)
window.open(src.value+'&asn_number='+resLable)
}
})
}
}).catch(err => {
console.log(err)
})
}
/** 详情操作 */

63
src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRequestMain/index.vue

@ -74,9 +74,7 @@
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/packageover-request-main/import" :importTemplateData="importTemplateData" @success="importSuccess"
:updateIsDisable="true" :coverIsDisable="true" :mode="2"/>
<!-- 标签打印 -->
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" />
</template>
</template>
<script setup lang="ts">
import download from '@/utils/download'
@ -85,8 +83,6 @@ import { PackageoverRequestMain,PackageoverRequestMainRules, PackageoverRequestD
import * as PackageoverRequestMainApi from '@/api/wms/packageoverRequestMain'
import * as PackageoverRequestDetailApi from '@/api/wms/packageoverRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as PackageApi from '@/api/wms/package'
import { getAccessToken } from '@/utils/auth'
defineOptions({ name: 'PackageoverRequestMain' })
@ -329,34 +325,6 @@ const openForm =async (type: string, row?: number) => {
formRef.value.open(type, row)
}
// --退
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/922729953438072832?token=' + getAccessToken())
window.open(src.value+'&asn_number='+res)
}
}).catch(err => {
console.log(err)
message.error('创建标签失败')
})
}
//
const { wsCache } = useCache()
/** 详情操作 */
@ -446,35 +414,6 @@ const submitForm = async (formType, data) => {
}
}
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
//
const handlePoint = async (row) => {
//
await PackageApi.getPackagePage({
requestNumber: row.number
}).then((res) => {
if(res.list.length > 0) {
isCreateLabel.value = true
if (res.list[0].productionLineCode != null) {
labelType.value = 'zz'
} else {
labelType.value = 'cg'
}
} else {
isCreateLabel.value = false
}
}).catch(err => {
isCreateLabel.value = false
console.log(err)
})
//
if (isCreateLabel.value) {
labelPrint(row)
} else {
message.warning('请先创建标签')
}
}
const searchTableRef = ref()
const labelPrint = async (row) => {
tableObject.loading = true

Loading…
Cancel
Save