Browse Source

客户退货标签打印

master_hella_20240701
chenfang 6 months ago
parent
commit
95a06b6418
  1. 9
      src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/customerreturnRequestMain.data.ts
  2. 101
      src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue

9
src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/customerreturnRequestMain.data.ts

@ -928,6 +928,11 @@ export const CustomerreturnRequestDetail = useCrudSchemas(reactive<CrudSchema[]>
key: 'businessType',
value: 'CustomerReject',
isMainValue: false
},
{
key: 'isIn',
value: 'in',
isMainValue: false
}]
},
},
@ -1097,7 +1102,9 @@ export const CustomerreturnRequestDetailRules = reactive({
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
packQty: [
{ required: true, message: '请选择包装数量', trigger: 'blur' }
],
})
export const CustomerReturnRequestDetailLabel = useCrudSchemas(reactive<CrudSchema[]>([

101
src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue

@ -188,6 +188,9 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
row['fromLocationCode'] = val[0]['locationCode']
row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom']
}else if(formField == 'packQty'){
row['packUnit'] = val[0]['packUnit']
row['packQty'] = val[0]['packQty']
}else if(formField == 'toLocationCode') {
//
row['toLocationCode'] = val[0]['code']
@ -422,7 +425,7 @@ const buttonTableClick = async (val, row) => {
formLabelRef.value.open('create', row, null,'createLabel')// createLabel
} else if (val == 'point') {
//
labelPrint(row)
handlePoint(row)
}
}
//
@ -452,29 +455,78 @@ const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const labelType = ref('') //
//
const showLabelRef = ref()
const labelPrint = async (row) => {
console.log(row.packingNumber,445555555555555);
PackageApi.getBalanceToPackage(row.packingNumber).then(res => {
console.log(777,res);
if (res.productionLineCode != null) {
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'
}
PackageApi.batchPrintingLable((res.number)).then((resLable) =>{
console.log(159,resLable )
//
if (labelType.value == 'cg') {
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
console.log(159,resLable )
window.open(src.value+'&asn_number='+resLable)
} else {
isCreateLabel.value = false
}
}).catch(err => {
isCreateLabel.value = false
console.log(err)
})
//
if (isCreateLabel.value) {
labelPrint(row)
} else {
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
window.open(src.value+'&asn_number='+resLable)
message.warning('请先创建标签')
}
})
}
//
const labelPrint = async (row) => {
tableObject.loading = true
const defaultParams = {'moduleName':'customerreturn_request','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
})
showLabelRef.value.openData("标签信息",tableObjectPrint,{tableColumns},true)
}
// ---退
const showLabelSuccess = 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('创建标签失败')
})
}
@ -705,23 +757,6 @@ const searchFormClick = (searchData) => {
getList() //
}
// ---
const showLabelSuccess = 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)
window.open(src.value + '&asn_number=' + res)
}).catch(err => {
console.log(err)
message.error('创建标签失败')
})
}
/** 初始化 **/
onMounted(async () => {
getList()

Loading…
Cancel
Save