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', key: 'businessType',
value: 'CustomerReject', value: 'CustomerReject',
isMainValue: false isMainValue: false
},
{
key: 'isIn',
value: 'in',
isMainValue: false
}] }]
}, },
}, },
@ -1097,7 +1102,9 @@ export const CustomerreturnRequestDetailRules = reactive({
remark: [ remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } { max: 50, message: '不得超过50个字符', trigger: 'blur' }
], ],
packQty: [
{ required: true, message: '请选择包装数量', trigger: 'blur' }
],
}) })
export const CustomerReturnRequestDetailLabel = useCrudSchemas(reactive<CrudSchema[]>([ 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['fromLocationCode'] = val[0]['locationCode']
row['itemCode'] = val[0]['itemCode'] row['itemCode'] = val[0]['itemCode']
row['uom'] = val[0]['uom'] row['uom'] = val[0]['uom']
}else if(formField == 'packQty'){
row['packUnit'] = val[0]['packUnit']
row['packQty'] = val[0]['packQty']
}else if(formField == 'toLocationCode') { }else if(formField == 'toLocationCode') {
// //
row['toLocationCode'] = val[0]['code'] row['toLocationCode'] = val[0]['code']
@ -422,7 +425,7 @@ const buttonTableClick = async (val, row) => {
formLabelRef.value.open('create', row, null,'createLabel')// createLabel formLabelRef.value.open('create', row, null,'createLabel')// createLabel
} else if (val == 'point') { } 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 labelType = ref('') //
// //
const showLabelRef = ref() const showLabelRef = ref()
const labelPrint = async (row) => { const handlePoint = async (row) => {
console.log(row.packingNumber,445555555555555); //
PackageApi.getBalanceToPackage(row.packingNumber).then(res => { await PackageApi.getPackagePage({
console.log(777,res); requestNumber: row.number
if (res.productionLineCode != null) { }).then((res) => {
if(res.list.length > 0) {
isCreateLabel.value = true
if (res.list[0].productionLineCode != null) {
labelType.value = 'zz' labelType.value = 'zz'
} else { } else {
labelType.value = 'cg' labelType.value = 'cg'
} }
PackageApi.batchPrintingLable((res.number)).then((resLable) =>{ } else {
console.log(159,resLable ) isCreateLabel.value = false
// }
if (labelType.value == 'cg') { }).catch(err => {
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) isCreateLabel.value = false
console.log(159,resLable ) console.log(err)
window.open(src.value+'&asn_number='+resLable) })
//
if (isCreateLabel.value) {
labelPrint(row)
} else { } else {
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()) message.warning('请先创建标签')
window.open(src.value+'&asn_number='+resLable)
} }
}) }
//
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 => { }).catch(err => {
console.log(err) console.log(err)
message.error('创建标签失败')
}) })
} }
@ -705,23 +757,6 @@ const searchFormClick = (searchData) => {
getList() // 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 () => { onMounted(async () => {
getList() getList()

Loading…
Cancel
Save