Browse Source

修复bug生产退料打印标签空白问题

master_hella_20240701
chenfang 7 months ago
parent
commit
e6593bf2a6
  1. 1
      src/views/wms/basicDataManage/itemManage/relegateRequest/relegateRequest.data.ts
  2. 75
      src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue
  3. 54
      src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts
  4. 12
      src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/index.vue

1
src/views/wms/basicDataManage/itemManage/relegateRequest/relegateRequest.data.ts

@ -20,6 +20,7 @@ export const RelegateRequest = useCrudSchemas(reactive<CrudSchema[]>([
field: 'number',
sort: 'custom',
isSearch: true,
isForm:false,
},
{
label: '物料代码',

75
src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue

@ -70,6 +70,7 @@
:apiDelete="ProductionreturnRequestDetailApi.deleteProductionreturnRequestDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
@detailOpenForm="detailOpenForm"
:detailValidate="detailValidate"
/>
<!-- 创建标签 -->
@ -90,13 +91,14 @@
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/productionreturn-request-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
<!-- 标签打印 -->
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccess1" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { ProductionreturnRequestMain,ProductionreturnRequestMainRules,ProductionreturnRequestDetail,ProductionreturnRequestDetailRules,ProductionreturnRequestDetailLabel,ProductionreturnRequestDetailLabelRules } from './productionreturnRequestMain.data'
import { ProductionreturnRequestMain,ProductionreturnRequestMainRules,ProductionreturnRequestDetail,ProductionreturnRequestDetailRules,ProductionreturnRequestDetailLabel,ProductionreturnRequestDetailLabelRules, SupplierdeliverRequestPackage } from './productionreturnRequestMain.data'
import * as ProductionreturnRequestMainApi from '@/api/wms/productionreturnRequestMain'
import * as ProductionreturnRequestDetailApi from '@/api/wms/productionreturnRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -130,6 +132,19 @@ const updataTableColumns = (val) => {
tableColumns.value = val
}
// /
const detailValidate = (data) => {
let tag = false;
if(data.qty <= 0){
message.warning('数量必须大于0')
tag = false;
return tag;
}else {
tag = true;
return tag;
}
}
//
const isItemType = async (itemCode, labelTypeParams) => {
let isType = false
@ -509,6 +524,34 @@ const openForm =async (type: string, row?: number) => {
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()
/** 详情操作 */
@ -657,18 +700,32 @@ const handlePoint = async (row) => {
})
//
if (isCreateLabel.value) {
if (labelType.value == 'cg') {
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
window.open(src.value+'&request_number='+row.number)
} else {
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
window.open(src.value+'&request_number='+row.number)
}
labelPrint(row)
} else {
message.warning('请先创建标签')
}
}
const searchTableRef = ref()
const labelPrint = async (row) => {
tableObject.loading = true
const defaultParams = {'moduleName':'productreceipt_predict','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
})
searchTableRef.value.openData("标签信息",tableObjectPrint,{tableColumns},true)
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {

54
src/views/wms/issueManage/productionreturn/productionreturnRequestMain/productionreturnRequestMain.data.ts

@ -1338,3 +1338,57 @@ export const ProductionreturnRequestDetailLabelRules = reactive({
]
})
export const SupplierdeliverRequestPackage = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '包装号',
field: 'number',
sort: 'custom',
isSearch: true,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
table: {
width: 150,
},
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
table: {
width: 150,
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150,
},
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
dictType: DICT_TYPE.UOM,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'SelectV2'
},
table: {
width: 150,
},
},
]))

12
src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/index.vue

@ -117,7 +117,7 @@ const { tableObject, tableMethods } = useTable({
}
fromInventoryStatus.value = 'OK'
toInventoryStatus.value = "HOLD"
businessType.value = 'OkToHoldRequest'
businessType.value = 'OkToHold'
importFileName.value = '合格转隔离申请'
} else if ( routeName.value == 'HoldtookRequestMain') {
tableObject.params = {
@ -126,7 +126,7 @@ const { tableObject, tableMethods } = useTable({
}
fromInventoryStatus.value = 'HOLD'
toInventoryStatus.value = "OK"
businessType.value = 'HoldToOkRequest'
businessType.value = 'HoldToOk'
importFileName.value = '隔离转合格申请'
} else if ( routeName.value == 'HoldtoscrapRequestMain') {
tableObject.params = {
@ -135,7 +135,7 @@ const { tableObject, tableMethods } = useTable({
}
fromInventoryStatus.value = 'HOLD'
toInventoryStatus.value = "SCRAP"
businessType.value = 'HoldToScrapRequest'
businessType.value = 'HoldToScrap'
importFileName.value = '隔离转报废申请'
} else if ( routeName.value == 'OktoscrapRequestMain') {
tableObject.params = {
@ -144,7 +144,7 @@ const { tableObject, tableMethods } = useTable({
}
fromInventoryStatus.value = 'OK'
toInventoryStatus.value = "SCRAP"
businessType.value = 'OkToScrapRequest'
businessType.value = 'OkToScrap'
importFileName.value = '合格转报废申请'
} else if ( routeName.value == 'ScraptoholdRequestMain') {
tableObject.params = {
@ -153,11 +153,11 @@ const { tableObject, tableMethods } = useTable({
}
fromInventoryStatus.value = 'SCRAP'
toInventoryStatus.value = "HOLD"
businessType.value = 'ScrapToHoldRequest'
businessType.value = 'ScrapToHold'
importFileName.value = '报废转隔离申请'
} else if( routeName.value == 'InventorymoveRequestMain'){
fromInventoryStatus.value = null
businessType.value = 'InventorymoveRequest'
businessType.value = 'Move'
importFileName.value = '库存移动申请'
}else {
tableObject.params = {

Loading…
Cancel
Save