Browse Source

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

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

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

@ -1,23 +1,31 @@
<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>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ProductreceiptRecordMain.allSchemas"
:detailAllSchemas="ProductreceiptRecordDetail.allSchemas"
/>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ProductreceiptRecordMain.allSchemas"
:detailAllSchemas="ProductreceiptRecordDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table
v-clientTable
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -28,16 +36,19 @@
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #recoveryRequestFlag="{row}">
<el-tag>{{ row.recoveryRequestFlag=='TRUE'?'是':'否' }}</el-tag>
<template #recoveryRequestFlag="{ row }">
<el-tag>{{ row.recoveryRequestFlag == 'TRUE' ? '是' : '否' }}</el-tag>
</template>
<template #number="{row}">
<template #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
<template #action="{ row, $index }">
<ButtonBase
:Butttondata="butttondata(row, $index)"
@button-base-click="buttonTableClick($event, row)"
/>
</template>
</Table>
</ContentWrap>
@ -67,40 +78,48 @@
<!-- bom列表 -->
<Dialog
:title="DialogTitle"
v-model="bomModelVisible"
width="80%"
:scroll="true"
max-height="450px"
>
<Table
:columns="BackflushRecordDetailb.allSchemas.tableColumns"
:data="detatableDataBom.tableList"
:loading="detatableDataBom.loading"
:pagination="{
total: detatableDataBom.total
}"
v-model:pageSize="detatableDataBom.pageSize"
v-model:currentPage="detatableDataBom.currentPage"
v-model:sort="detatableDataBom.sort"
/>
</Dialog>
<!-- 标签打印 -->
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccessLabel" />
:title="DialogTitle"
v-model="bomModelVisible"
width="80%"
:scroll="true"
max-height="450px"
>
<Table
:columns="BackflushRecordDetailb.allSchemas.tableColumns"
:data="detatableDataBom.tableList"
:loading="detatableDataBom.loading"
:pagination="{
total: detatableDataBom.total
}"
v-model:pageSize="detatableDataBom.pageSize"
v-model:currentPage="detatableDataBom.currentPage"
v-model:sort="detatableDataBom.sort"
/>
</Dialog>
<!-- 标签打印 -->
<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,16 +151,17 @@ const buttondataTable = ref([{
icon: '',
color: '',
hasPermi: '',
link: true, //
}])
link: true //
}
])
// Bom
const DialogTitle = ref('Bom信息')
const bomModelVisible = ref(false)
const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } =useTable({
const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } = useTable({
getListApi: BackflushRecordDetailbApi.getBackflushRecordDetailbPage
})
const { getList:getDetailListBom } = detatableMethodsBom
const { getList: getDetailListBom } = detatableMethodsBom
//
const updataTableColumns = (val) => {
@ -153,10 +177,10 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultExportBtn({hasPermi:'wms:productreceipt-record-main:export'}), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:productreceipt-record-main:export' }), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
defaultButtons.defaultSetBtn(null) //
// {
// label: '',
// name: 'zdy',
@ -169,23 +193,27 @@ const HeadButttondata = [
//
const buttonBaseClick = (val, item) => {
if (val == 'export') { //
if (val == 'export') {
//
handleExport()
} else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
} else if (val == 'refresh') {
//
if (tableObject.params.filters && tableObject.params.filters.length > 0) {
searchFormClick({
filters: tableObject.params.filters
})
} else {
getList()
}
} else if (val == 'filtrate') { //
} else { //
} else if (val == 'filtrate') {
//
} else {
//
console.log('其他按钮', item)
}
}
//
const isShowMainButton = (row,val) => {
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
return false
} else {
@ -194,42 +222,52 @@ const isShowMainButton = (row,val) => {
}
// -
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>-1&&findIndex<$index){
const butttondata = (row, $index) => {
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.mainListPointBtn(null), //
defaultButtons.mainListRecoveryBtn({hide:row.recoveryRequestFlag == "TRUE" }), // //recoveryRequestFlag==TRUE
]
// 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.mainListPointBtn(null), //
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)
}
}
/** 生成采购上架申请按钮操作 */
const handleCreatePutawayRequest = async (number:string) => {
try{
const handleCreatePutawayRequest = async (number: string) => {
try {
await message.confirm(t('ts.确认生成上架申请吗?'))
tableObject.loading = true
await ProductreceiptRecordMainApi.createPutawayRequest(number)
message.success(t('ts.上架申请生成成功'))
buttonBaseClick('refresh',null)
}catch{}finally{
buttonBaseClick('refresh', null)
} catch {
} finally {
tableObject.loading = false
}
}
@ -243,27 +281,33 @@ const labelPrint = async (row) => {
let resType = await PackageApi.getPackagePage({
requestNumber: row.requestNumber
})
if(resType.list.length > 0){
if (resType.list.length > 0) {
if (resType.list[0].productionLineCode != null) {
labelType.value = 'zz'
} else {
labelType.value = 'cg'
}
}
const defaultParams = {'moduleName':'productreceipt_predict','tableName':'record_productreceipt_main','recordNumber':row.number}
const {tableObject:tableObjectPrint ,tableMethods} = useTable({
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 //
getListApi: PackageApi.getLabelDetailPageByRecordId //
})
//
const { getList:getListPrint } = tableMethods
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)
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)
buttonBaseClick('refresh', null)
} catch {
} finally {
tableObject.loading = false
@ -288,45 +331,50 @@ const labelRecovery = async (row) => {
}
// --
const searchTableSuccessLabel = async (formField, searchField, val, formRef, type, row) => {
console.log('批量打印',val)
console.log('批量打印', val)
if(val.length == 0){
message.warning("请先选择要打印的数据!")
if (val.length == 0) {
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())
window.open(src.value+'&asn_number='+res)
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)
window.open(src.value + '&asn_number=' + res)
}
}).catch(err => {
console.log(err)
message.error('创建标签失败')
})
})
.catch((err) => {
console.log(err)
message.error('创建标签失败')
})
}
//
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')
detailRef.value.openDetail(row, titleName, titleValue, 'recordProductreceiptMain')
}
/** 生成到货检验申请按钮操作 */
const handleCreateInspectRequest = async (number:string) => {
try{
const handleCreateInspectRequest = async (number: string) => {
try {
await message.confirm(t('ts.确认生成到货检验申请吗?'))
tableObject.loading = true
await ProductreceiptRecordMainApi.createInspectRequest(number)
message.success(t('ts.到货检验申请生成成功'))
buttonBaseClick('refresh',null)
}catch{}finally{
buttonBaseClick('refresh', null)
} catch {
} finally {
tableObject.loading = false
}
}
@ -340,18 +388,20 @@ const handleExport = async () => {
loadStart()
const excelTitle = ref(route.meta.title)
tableObject.params.type = 'predict'
if (tableObject.params.isSearch){
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 = {
@ -378,8 +428,9 @@ const searchFormClick = (searchData) => {
}
// Bom
const tableFormButton = async (val , row) => {
if (val == 'bom') { // bom
const tableFormButton = async (val, row) => {
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