diff --git a/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/customerreturnRequestMain.data.ts b/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/customerreturnRequestMain.data.ts index 0163db4ff..4931bfa92 100644 --- a/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/customerreturnRequestMain.data.ts +++ b/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/customerreturnRequestMain.data.ts @@ -928,6 +928,11 @@ export const CustomerreturnRequestDetail = useCrudSchemas(reactive 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([ diff --git a/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue b/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue index 0f31f34ef..e138e2dce 100644 --- a/src/views/wms/deliversettlementManage/customerreturn/customerreturnRequestMain/index.vue +++ b/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()