Browse Source

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

master_hella_20240701
chenfang 7 months ago
parent
commit
0abee12359
  1. 50
      src/api/wms/printLabelCorrelation/index.ts
  2. 21
      src/views/wms/inventoryManage/balance/index.vue
  3. 18
      src/views/wms/inventoryjobManage/packageManage/packageoverMain/packageoverRecordMain/index.vue
  4. 61
      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' })
}

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

@ -178,21 +178,32 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
} }
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const labelType = ref('') //
// //
const handlePoint = async (row) => { const handlePoint = async (row) => {
console.log(row.packingNumber,445555555555555); console.log(row.packingNumber,445555555555555);
PackageApi.getBalanceToPackage(row.packingNumber).then(res => { PackageApi.getBalanceToPackage(row.packingNumber).then(res => {
console.log(res,66666666666); 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 (res.asnNumber !== null && res.asnNumber !== '') { if (labelType.value == 'cg') {
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) 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 { } else {
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()) 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)
})
} }
/** 删除按钮操作 */ /** 删除按钮操作 */

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

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

@ -74,8 +74,6 @@
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/packageover-request-main/import" :importTemplateData="importTemplateData" @success="importSuccess" <ImportForm ref="importFormRef" url="/wms/packageover-request-main/import" :importTemplateData="importTemplateData" @success="importSuccess"
:updateIsDisable="true" :coverIsDisable="true" :mode="2"/> :updateIsDisable="true" :coverIsDisable="true" :mode="2"/>
<!-- 标签打印 -->
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -85,8 +83,6 @@ import { PackageoverRequestMain,PackageoverRequestMainRules, PackageoverRequestD
import * as PackageoverRequestMainApi from '@/api/wms/packageoverRequestMain' import * as PackageoverRequestMainApi from '@/api/wms/packageoverRequestMain'
import * as PackageoverRequestDetailApi from '@/api/wms/packageoverRequestDetail' import * as PackageoverRequestDetailApi from '@/api/wms/packageoverRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as PackageApi from '@/api/wms/package'
import { getAccessToken } from '@/utils/auth'
defineOptions({ name: 'PackageoverRequestMain' }) defineOptions({ name: 'PackageoverRequestMain' })
@ -329,34 +325,6 @@ const openForm =async (type: string, row?: number) => {
formRef.value.open(type, row) 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() 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 searchTableRef = ref()
const labelPrint = async (row) => { const labelPrint = async (row) => {
tableObject.loading = true tableObject.loading = true

Loading…
Cancel
Save