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> <template>
<ContentWrap> <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> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead <TableHead
:HeadButttondata="HeadButttondata" :HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick" @button-base-click="buttonBaseClick"
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="ProductreceiptRecordMain.allSchemas" :allSchemas="ProductreceiptRecordMain.allSchemas"
:detailAllSchemas="ProductreceiptRecordDetail.allSchemas" :detailAllSchemas="ProductreceiptRecordDetail.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table
v-clientTable
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -28,16 +36,19 @@
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #recoveryRequestFlag="{row}"> <template #recoveryRequestFlag="{ row }">
<el-tag>{{ row.recoveryRequestFlag=='TRUE'?'是':'否' }}</el-tag> <el-tag>{{ row.recoveryRequestFlag == 'TRUE' ? '是' : '否' }}</el-tag>
</template> </template>
<template #number="{row}"> <template #number="{ row }">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> <el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span> <span>{{ row.number }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row,$index }"> <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> </template>
</Table> </Table>
</ContentWrap> </ContentWrap>
@ -67,40 +78,48 @@
<!-- bom列表 --> <!-- bom列表 -->
<Dialog <Dialog
:title="DialogTitle" :title="DialogTitle"
v-model="bomModelVisible" v-model="bomModelVisible"
width="80%" width="80%"
:scroll="true" :scroll="true"
max-height="450px" max-height="450px"
> >
<Table <Table
:columns="BackflushRecordDetailb.allSchemas.tableColumns" :columns="BackflushRecordDetailb.allSchemas.tableColumns"
:data="detatableDataBom.tableList" :data="detatableDataBom.tableList"
:loading="detatableDataBom.loading" :loading="detatableDataBom.loading"
:pagination="{ :pagination="{
total: detatableDataBom.total total: detatableDataBom.total
}" }"
v-model:pageSize="detatableDataBom.pageSize" v-model:pageSize="detatableDataBom.pageSize"
v-model:currentPage="detatableDataBom.currentPage" v-model:currentPage="detatableDataBom.currentPage"
v-model:sort="detatableDataBom.sort" v-model:sort="detatableDataBom.sort"
/> />
</Dialog> </Dialog>
<!-- 标签打印 --> <!-- 标签打印 -->
<SearchTable style="width:905px" ref="searchTableRef" @searchTableSuccess="searchTableSuccessLabel" /> <SearchTable
style="width: 905px"
ref="searchTableRef"
@searchTableSuccess="searchTableSuccessLabel"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' 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 ProductreceiptRecordMainApi from '@/api/wms/productreceiptRecordMain'
import * as ProductreceiptRecordDetailApi from '@/api/wms/productreceiptRecordDetail' import * as ProductreceiptRecordDetailApi from '@/api/wms/productreceiptRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as BackflushRecordDetailbApi from '@/api/wms/backflushRecordDetailb' import * as BackflushRecordDetailbApi from '@/api/wms/backflushRecordDetailb'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import * as PackageApi from '@/api/wms/package' import * as PackageApi from '@/api/wms/package'
import { import { SupplierdeliverRequestPackage } from '../../../purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts'
SupplierdeliverRequestPackage
} from '../../../purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts'
import * as ProductreceiptRequestDetailApi from '@/api/wms/productreceiptRequestDetail' import * as ProductreceiptRequestDetailApi from '@/api/wms/productreceiptRequestDetail'
import { getAccessToken } from '@/utils/auth' import { getAccessToken } from '@/utils/auth'
import { getJmreportBaseUrl } from '@/utils/systemParam' import { getJmreportBaseUrl } from '@/utils/systemParam'
@ -118,9 +137,13 @@ const { t } = useI18n() // 国际化
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const tableColumns = ref([...ProductreceiptRecordMain.allSchemas.tableColumns,...ProductreceiptRecordDetail.allSchemas.tableMainColumns]) const tableColumns = ref([
...ProductreceiptRecordMain.allSchemas.tableColumns,
...ProductreceiptRecordDetail.allSchemas.tableMainColumns
])
// table // table
const buttondataTable = ref([{ const buttondataTable = ref([
{
label: 'Bom', label: 'Bom',
name: 'bom', name: 'bom',
hide: false, hide: false,
@ -128,16 +151,17 @@ const buttondataTable = ref([{
icon: '', icon: '',
color: '', color: '',
hasPermi: '', hasPermi: '',
link: true, // link: true //
}]) }
])
// Bom // Bom
const DialogTitle = ref('Bom信息') const DialogTitle = ref('Bom信息')
const bomModelVisible = ref(false) const bomModelVisible = ref(false)
const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } =useTable({ const { tableObject: detatableDataBom, tableMethods: detatableMethodsBom } = useTable({
getListApi: BackflushRecordDetailbApi.getBackflushRecordDetailbPage getListApi: BackflushRecordDetailbApi.getBackflushRecordDetailbPage
}) })
const { getList:getDetailListBom } = detatableMethodsBom const { getList: getDetailListBom } = detatableMethodsBom
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
@ -153,10 +177,10 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultExportBtn({hasPermi:'wms:productreceipt-record-main:export'}), // defaultButtons.defaultExportBtn({ hasPermi: 'wms:productreceipt-record-main:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null) //
// { // {
// label: '', // label: '',
// name: 'zdy', // name: 'zdy',
@ -169,23 +193,27 @@ const HeadButttondata = [
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'export') { // if (val == 'export') {
//
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') {
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) { //
if (tableObject.params.filters && tableObject.params.filters.length > 0) {
searchFormClick({ searchFormClick({
filters: tableObject.params.filters filters: tableObject.params.filters
}) })
} else { } else {
getList() getList()
} }
} else if (val == 'filtrate') { // } else if (val == 'filtrate') {
} else { // //
} else {
//
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
// //
const isShowMainButton = (row,val) => { const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) { if (val.indexOf(row.status) > -1) {
return false return false
} else { } else {
@ -194,42 +222,52 @@ const isShowMainButton = (row,val) => {
} }
// - // -
const butttondata = (row,$index) => { const butttondata = (row, $index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 const findIndex = row['masterId']
if(findIndex>-1&&findIndex<$index){ ? tableObject.tableList.findIndex((item) => item['masterId'] == row['masterId'])
: -1
if (findIndex > -1 && findIndex < $index) {
return [] return []
} }
return [ return [
// defaultButtons.mainInspectRequestBtn({hasPermi:'wms:productreceipt-record-main:createInspectRequest',hide:row.inspectRequestFlag == "FALSE" }),// // defaultButtons.mainInspectRequestBtn({hasPermi:'wms:productreceipt-record-main:createInspectRequest',hide:row.inspectRequestFlag == "FALSE" }),//
defaultButtons.mainInspectRequestBtn({hide:row.inspectRequestFlag == "FALSE" }),// defaultButtons.mainInspectRequestBtn({ hide: row.inspectRequestFlag == 'FALSE' }), //
defaultButtons.mainPutawayRequestCpBtn({hasPermi:'wms:purchasereceipt-record-main:createPutawayRequest',hide:row.putawayRequestFlag == "FALSE" }),// defaultButtons.mainPutawayRequestCpBtn({
defaultButtons.mainListPointBtn(null), // hasPermi: 'wms:purchasereceipt-record-main:createPutawayRequest',
defaultButtons.mainListRecoveryBtn({hide:row.recoveryRequestFlag == "TRUE" }), // //recoveryRequestFlag==TRUE hide: row.putawayRequestFlag == 'FALSE'
] }), //
defaultButtons.mainListPointBtn(null), //
defaultButtons.mainListRecoveryBtn({ hide: row.recoveryRequestFlag == 'TRUE' }) // 制品回收 //recoveryRequestFlag==TRUE不展示
]
} }
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if(val == 'inspectRequest'){// if (val == 'inspectRequest') {
//
handleCreateInspectRequest(row.number) handleCreateInspectRequest(row.number)
}else if (val == 'putawayRequest') { // } else if (val == 'putawayRequest') {
//
handleCreatePutawayRequest(row.number) handleCreatePutawayRequest(row.number)
} else if (val == 'point') { // } else if (val == 'point') {
//
labelPrint(row) labelPrint(row)
} else if (val == 'recovery') { // } else if (val == 'recovery') {
//
labelRecovery(row) labelRecovery(row)
} }
} }
/** 生成采购上架申请按钮操作 */ /** 生成采购上架申请按钮操作 */
const handleCreatePutawayRequest = async (number:string) => { const handleCreatePutawayRequest = async (number: string) => {
try{ try {
await message.confirm(t('ts.确认生成上架申请吗?')) await message.confirm(t('ts.确认生成上架申请吗?'))
tableObject.loading = true tableObject.loading = true
await ProductreceiptRecordMainApi.createPutawayRequest(number) await ProductreceiptRecordMainApi.createPutawayRequest(number)
message.success(t('ts.上架申请生成成功')) message.success(t('ts.上架申请生成成功'))
buttonBaseClick('refresh',null) buttonBaseClick('refresh', null)
}catch{}finally{ } catch {
} finally {
tableObject.loading = false tableObject.loading = false
} }
} }
@ -243,27 +281,33 @@ const labelPrint = async (row) => {
let resType = await PackageApi.getPackagePage({ let resType = await PackageApi.getPackagePage({
requestNumber: row.requestNumber requestNumber: row.requestNumber
}) })
if(resType.list.length > 0){ if (resType.list.length > 0) {
if (resType.list[0].productionLineCode != null) { if (resType.list[0].productionLineCode != null) {
labelType.value = 'zz' labelType.value = 'zz'
} else { } else {
labelType.value = 'cg' labelType.value = 'cg'
} }
} }
const defaultParams = {'moduleName':'productreceipt_predict','tableName':'record_productreceipt_main','recordNumber':row.number} const defaultParams = {
const {tableObject:tableObjectPrint ,tableMethods} = useTable({ moduleName: 'productreceipt_predict',
tableName: 'record_productreceipt_main',
recordNumber: row.number,
itemCode: row.itemCode,
batch: row.batch
}
const { tableObject: tableObjectPrint, tableMethods } = useTable({
defaultParams, defaultParams,
getListApi: PackageApi.getLabelDetailPageByRecordId // getListApi: PackageApi.getLabelDetailPageByRecordId //
}) })
// //
const { getList:getListPrint } = tableMethods const { getList: getListPrint } = tableMethods
getListPrint() getListPrint()
tableObject.loading = false tableObject.loading = false
const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns const tableColumns = SupplierdeliverRequestPackage.allSchemas.tableFormColumns
tableColumns.forEach((item) => { tableColumns.forEach((item) => {
item.width = item.table?.width || 150 item.width = item.table?.width || 150
}) })
searchTableRef.value.openData("标签信息",tableObjectPrint,{tableColumns},true) searchTableRef.value.openData('标签信息', tableObjectPrint, { tableColumns }, true)
} }
// //
const labelRecovery = async (row) => { const labelRecovery = async (row) => {
@ -272,15 +316,14 @@ const labelRecovery = async (row) => {
tableObject.loading = true tableObject.loading = true
const params = ref({ const params = ref({
number: '', number: '',
inventoryStatus: '', inventoryStatus: ''
}) })
params.number= row.number; params.number = row.number
params.inventoryStatus= row.inventoryStatus; params.inventoryStatus = row.inventoryStatus
let resType = await ProductreceiptRecordMainApi.handleRecoveryProductreceiptRecord(params); let resType = await ProductreceiptRecordMainApi.handleRecoveryProductreceiptRecord(params)
message.success(t('ts.撤销报工成功')) message.success(t('ts.撤销报工成功'))
buttonBaseClick('refresh',null) buttonBaseClick('refresh', null)
} catch { } catch {
} finally { } finally {
tableObject.loading = false tableObject.loading = false
@ -288,45 +331,50 @@ const labelRecovery = async (row) => {
} }
// -- // --
const searchTableSuccessLabel = async (formField, searchField, val, formRef, type, row) => { const searchTableSuccessLabel = async (formField, searchField, val, formRef, type, row) => {
console.log('批量打印',val) console.log('批量打印', val)
if(val.length == 0){ if (val.length == 0) {
message.warning("请先选择要打印的数据!") message.warning('请先选择要打印的数据!')
return 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) console.log(res)
if (labelType.value == 'cg') { if (labelType.value == 'cg') {
const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken()) 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 { } else {
const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken()) 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) .catch((err) => {
message.error('创建标签失败') console.log(err)
}) message.error('创建标签失败')
})
} }
// //
const { wsCache } = useCache() const { wsCache } = useCache()
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { 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)) 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) => { const handleCreateInspectRequest = async (number: string) => {
try{ try {
await message.confirm(t('ts.确认生成到货检验申请吗?')) await message.confirm(t('ts.确认生成到货检验申请吗?'))
tableObject.loading = true tableObject.loading = true
await ProductreceiptRecordMainApi.createInspectRequest(number) await ProductreceiptRecordMainApi.createInspectRequest(number)
message.success(t('ts.到货检验申请生成成功')) message.success(t('ts.到货检验申请生成成功'))
buttonBaseClick('refresh',null) buttonBaseClick('refresh', null)
}catch{}finally{ } catch {
} finally {
tableObject.loading = false tableObject.loading = false
} }
} }
@ -340,18 +388,20 @@ const handleExport = async () => {
loadStart() loadStart()
const excelTitle = ref(route.meta.title) const excelTitle = ref(route.meta.title)
tableObject.params.type = 'predict' tableObject.params.type = 'predict'
if (tableObject.params.isSearch){ if (tableObject.params.isSearch) {
const cmd = { const cmd = {
'column':'type', column: 'type',
'action':'==', action: '==',
'value':'predict' value: 'predict'
} }
if (!Array.isArray(tableObject.params.filters)) { if (!Array.isArray(tableObject.params.filters)) {
tableObject.params.filters = []; tableObject.params.filters = []
} }
tableObject.params.filters.push(cmd) 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`) download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
} catch { } catch {
} finally { } finally {
@ -362,12 +412,12 @@ const handleExport = async () => {
// //
const searchFormClick = (searchData) => { const searchFormClick = (searchData) => {
const cmd = { const cmd = {
'column':'type', column: 'type',
'action':'==', action: '==',
'value':'predict' value: 'predict'
} }
if (!Array.isArray(searchData.filters)) { if (!Array.isArray(searchData.filters)) {
searchData.filters = []; searchData.filters = []
} }
searchData.filters.push(cmd) searchData.filters.push(cmd)
tableObject.params = { tableObject.params = {
@ -378,8 +428,9 @@ const searchFormClick = (searchData) => {
} }
// Bom // Bom
const tableFormButton = async (val , row) => { const tableFormButton = async (val, row) => {
if (val == 'bom') { // bom if (val == 'bom') {
// bom
bomModelVisible.value = true bomModelVisible.value = true
DialogTitle.value = '物料代码【' + row.itemCode + '】——Bom信息' DialogTitle.value = '物料代码【' + row.itemCode + '】——Bom信息'
detatableDataBom.params = { detatableDataBom.params = {

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

@ -317,7 +317,14 @@ const labelPrint = async (row) => {
labelType.value = 'cg' 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({ const {tableObject:tableObjectPrint ,tableMethods} = useTable({
defaultParams, defaultParams,
// getListApi: PackageApi.getProductreceiptLabelDetailPage // // getListApi: PackageApi.getProductreceiptLabelDetailPage //

Loading…
Cancel
Save