|
@ -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 |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
isCreateLabel.value = false |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}) |
|
|
// 判断是采购还是制造 |
|
|
// 判断是采购还是制造 |
|
|
|
|
|
if (isCreateLabel.value) { |
|
|
|
|
|
labelPrint(row) |
|
|
|
|
|
} else { |
|
|
|
|
|
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') { |
|
|
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,resLable ) |
|
|
window.open(src.value+'&asn_number='+res) |
|
|
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='+resLable) |
|
|
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() |
|
|