|
|
@ -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 = { |
|
|
|