Browse Source

装配收货记录,点击打印标签报异常 YT-370

intex_online20241111
YEJIAXING-PC\lenovo 2 months ago
parent
commit
e1ec71b869
  1. 147
      src/views/wms/productionManage/productreceipt/productreceiptRecordMain/index.vue
  2. 9
      src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRecordMain/index.vue

147
src/views/wms/productionManage/productreceipt/productreceiptRecordMain/index.vue

@ -1,7 +1,14 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="[...ProductreceiptRecordMain.allSchemas.searchSchema,...ProductreceiptRecordDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" />
<Search
:schema="[
...ProductreceiptRecordMain.allSchemas.searchSchema,
...ProductreceiptRecordDetail.allSchemas.searchSchema
]"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap>
<!-- 列表头部 -->
@ -17,7 +24,8 @@
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -37,7 +45,10 @@
</el-button>
</template>
<template #action="{ row, $index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
<ButtonBase
:Butttondata="butttondata(row, $index)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
@ -86,21 +97,29 @@
/>
</Dialog>
<!-- 标签打印 -->
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccessLabel" />
<SearchTable
style="width: 905px"
ref="searchTableRef"
@searchTableSuccess="searchTableSuccessLabel"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ProductreceiptRecordMain,ProductreceiptRecordMainRules,ProductreceiptRecordDetail,ProductreceiptRecordDetailRules, BackflushRecordDetailb } from './productreceiptRecordMain.data'
import {
ProductreceiptRecordMain,
ProductreceiptRecordMainRules,
ProductreceiptRecordDetail,
ProductreceiptRecordDetailRules,
BackflushRecordDetailb
} from './productreceiptRecordMain.data'
import * as ProductreceiptRecordMainApi from '@/api/wms/productreceiptRecordMain'
import * as ProductreceiptRecordDetailApi from '@/api/wms/productreceiptRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as BackflushRecordDetailbApi from '@/api/wms/backflushRecordDetailb'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import * as PackageApi from '@/api/wms/package'
import {
SupplierdeliverRequestPackage
} from '../../../purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts'
import { SupplierdeliverRequestPackage } from '../../../purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts'
import * as ProductreceiptRequestDetailApi from '@/api/wms/productreceiptRequestDetail'
import { getAccessToken } from '@/utils/auth'
import { getJmreportBaseUrl } from '@/utils/systemParam'
@ -118,9 +137,13 @@ const { t } = useI18n() // 国际化
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([...ProductreceiptRecordMain.allSchemas.tableColumns,...ProductreceiptRecordDetail.allSchemas.tableMainColumns])
const tableColumns = ref([
...ProductreceiptRecordMain.allSchemas.tableColumns,
...ProductreceiptRecordDetail.allSchemas.tableMainColumns
])
// table
const buttondataTable = ref([{
const buttondataTable = ref([
{
label: 'Bom',
name: 'bom',
hide: false,
@ -128,8 +151,9 @@ const buttondataTable = ref([{
icon: '',
color: '',
hasPermi: '',
link: true, //
}])
link: true //
}
])
// Bom
const DialogTitle = ref('Bom信息')
@ -156,7 +180,7 @@ const HeadButttondata = [
defaultButtons.defaultExportBtn({ hasPermi: 'wms:productreceipt-record-main:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -169,9 +193,11 @@ const HeadButttondata = [
//
const buttonBaseClick = (val, item) => {
if (val == 'export') { //
if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
} else if (val == 'refresh') {
//
if (tableObject.params.filters && tableObject.params.filters.length > 0) {
searchFormClick({
filters: tableObject.params.filters
@ -179,8 +205,10 @@ const buttonBaseClick = (val, item) => {
} else {
getList()
}
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
@ -195,28 +223,37 @@ const isShowMainButton = (row,val) => {
// -
const butttondata = (row, $index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
const findIndex = row['masterId']
? tableObject.tableList.findIndex((item) => item['masterId'] == row['masterId'])
: -1
if (findIndex > -1 && findIndex < $index) {
return []
}
return [
// defaultButtons.mainInspectRequestBtn({hasPermi:'wms:productreceipt-record-main:createInspectRequest',hide:row.inspectRequestFlag == "FALSE" }),//
defaultButtons.mainInspectRequestBtn({hide:row.inspectRequestFlag == "FALSE" }),//
defaultButtons.mainPutawayRequestCpBtn({hasPermi:'wms:purchasereceipt-record-main:createPutawayRequest',hide:row.putawayRequestFlag == "FALSE" }),//
defaultButtons.mainInspectRequestBtn({ hide: row.inspectRequestFlag == 'FALSE' }), //
defaultButtons.mainPutawayRequestCpBtn({
hasPermi: 'wms:purchasereceipt-record-main:createPutawayRequest',
hide: row.putawayRequestFlag == 'FALSE'
}), //
defaultButtons.mainListPointBtn(null), //
defaultButtons.mainListRecoveryBtn({hide:row.recoveryRequestFlag == "TRUE" }), // //recoveryRequestFlag==TRUE
defaultButtons.mainListRecoveryBtn({ hide: row.recoveryRequestFlag == 'TRUE' }) // 制品回收 //recoveryRequestFlag==TRUE不展
]
}
// -
const buttonTableClick = async (val, row) => {
if(val == 'inspectRequest'){//
if (val == 'inspectRequest') {
//
handleCreateInspectRequest(row.number)
}else if (val == 'putawayRequest') { //
} else if (val == 'putawayRequest') {
//
handleCreatePutawayRequest(row.number)
} else if (val == 'point') { //
} else if (val == 'point') {
//
labelPrint(row)
} else if (val == 'recovery') { //
} else if (val == 'recovery') {
//
labelRecovery(row)
}
}
@ -229,7 +266,8 @@ const handleCreatePutawayRequest = async (number:string) => {
await ProductreceiptRecordMainApi.createPutawayRequest(number)
message.success(t('ts.上架申请生成成功'))
buttonBaseClick('refresh', null)
}catch{}finally{
} catch {
} finally {
tableObject.loading = false
}
}
@ -250,7 +288,13 @@ const labelPrint = async (row) => {
labelType.value = 'cg'
}
}
const defaultParams = {'moduleName':'productreceipt_predict','tableName':'record_productreceipt_main','recordNumber':row.number}
const defaultParams = {
moduleName: 'productreceipt_predict',
tableName: 'record_productreceipt_main',
recordNumber: row.number,
itemCode: row.itemCode,
batch: row.batch
}
const { tableObject: tableObjectPrint, tableMethods } = useTable({
defaultParams,
getListApi: PackageApi.getLabelDetailPageByRecordId //
@ -263,7 +307,7 @@ const labelPrint = async (row) => {
tableColumns.forEach((item) => {
item.width = item.table?.width || 150
})
searchTableRef.value.openData("标签信息",tableObjectPrint,{tableColumns},true)
searchTableRef.value.openData('标签信息', tableObjectPrint, { tableColumns }, true)
}
//
const labelRecovery = async (row) => {
@ -272,15 +316,14 @@ const labelRecovery = async (row) => {
tableObject.loading = true
const params = ref({
number: '',
inventoryStatus: '',
inventoryStatus: ''
})
params.number= row.number;
params.inventoryStatus= row.inventoryStatus;
params.number = row.number
params.inventoryStatus = row.inventoryStatus
let resType = await ProductreceiptRecordMainApi.handleRecoveryProductreceiptRecord(params);
let resType = await ProductreceiptRecordMainApi.handleRecoveryProductreceiptRecord(params)
message.success(t('ts.撤销报工成功'))
buttonBaseClick('refresh', null)
} catch {
} finally {
tableObject.loading = false
@ -291,10 +334,11 @@ const searchTableSuccessLabel = async (formField, searchField, val, formRef, typ
console.log('批量打印', val)
if (val.length == 0) {
message.warning("请先选择要打印的数据!")
message.warning('请先选择要打印的数据!')
return
}
await PackageApi.batchPrintingLable(val.map(item1=>item1.number).join(',')).then(res => {
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())
@ -303,7 +347,8 @@ const searchTableSuccessLabel = async (formField, searchField, val, formRef, typ
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
window.open(src.value + '&asn_number=' + res)
}
}).catch(err => {
})
.catch((err) => {
console.log(err)
message.error('创建标签失败')
})
@ -313,7 +358,9 @@ const { wsCache } = useCache()
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name
const departmentCode = wsCache
.get(CACHE_KEY.DEPT)
.find((account) => account.id == row.departmentCode)?.name
if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode))
detailRef.value.openDetail(row, titleName, titleValue, 'recordProductreceiptMain')
}
@ -326,7 +373,8 @@ const handleCreateInspectRequest = async (number:string) => {
await ProductreceiptRecordMainApi.createInspectRequest(number)
message.success(t('ts.到货检验申请生成成功'))
buttonBaseClick('refresh', null)
}catch{}finally{
} catch {
} finally {
tableObject.loading = false
}
}
@ -342,16 +390,18 @@ const handleExport = async () => {
tableObject.params.type = 'predict'
if (tableObject.params.isSearch) {
const cmd = {
'column':'type',
'action':'==',
'value':'predict'
column: 'type',
action: '==',
value: 'predict'
}
if (!Array.isArray(tableObject.params.filters)) {
tableObject.params.filters = [];
tableObject.params.filters = []
}
tableObject.params.filters.push(cmd)
}
const data = await ProductreceiptRecordMainApi.exportProductreceiptRecordMain(tableObject.params)
const data = await ProductreceiptRecordMainApi.exportProductreceiptRecordMain(
tableObject.params
)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch {
} finally {
@ -362,12 +412,12 @@ const handleExport = async () => {
//
const searchFormClick = (searchData) => {
const cmd = {
'column':'type',
'action':'==',
'value':'predict'
column: 'type',
action: '==',
value: 'predict'
}
if (!Array.isArray(searchData.filters)) {
searchData.filters = [];
searchData.filters = []
}
searchData.filters.push(cmd)
tableObject.params = {
@ -379,7 +429,8 @@ const searchFormClick = (searchData) => {
// Bom
const tableFormButton = async (val, row) => {
if (val == 'bom') { // bom
if (val == 'bom') {
// bom
bomModelVisible.value = true
DialogTitle.value = '物料代码【' + row.itemCode + '】——Bom信息'
detatableDataBom.params = {

9
src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRecordMain/index.vue

@ -317,7 +317,14 @@ const labelPrint = async (row) => {
labelType.value = 'cg'
}
}
const defaultParams = {'moduleName':'productreceipt_assemble','tableName':'record_productreceipt_main','recordNumber':row.number,'number':row.number==null?row.number:row.packingNumber }
const defaultParams = {
    moduleName: 'productreceipt_assemble',
    tableName: 'record_productreceipt_main',
    recordNumber: row.number,
    number: row.number == null ? row.number : row.packingNumber,
    itemCode: row.itemCode,
    batch: row.batch
  }
const {tableObject:tableObjectPrint ,tableMethods} = useTable({
defaultParams,
// getListApi: PackageApi.getProductreceiptLabelDetailPage //

Loading…
Cancel
Save