Browse Source

托盘明细

master
常熟吴彦祖 1 week ago
parent
commit
d9c1880598
  1. 6
      src/api/haianWarehouse/warehousePallet.js
  2. 4
      src/views/modules/haianWarehouse/automatedWarehouse/agvTask54.vue
  3. 151
      src/views/modules/haianWarehouse/warehousePallet/warehousePallet54.vue

6
src/api/haianWarehouse/warehousePallet.js

@ -35,3 +35,9 @@ export const haiAnGetMaxPalletNoByFamily = data => createAPI('/autoWareHourceHai
// 海安托盘批量生成 - rqrq
export const haiAnBatchGeneratePallet = data => createAPI('/autoWareHourceHaian/haiAnPallet/batchGeneratePallet', 'post', data)
// 海安托盘标签明细,弹窗展示位置、层数、标签、物料、批次、数量、WDR - rqrq
export const haiAnListPalletLabelDetails = data => createAPI('/autoWareHourceHaian/haiAnPallet/listLabelDetails', 'post', data)
// 货架托盘同步当前标签明细到立库,不在货架时后端拒绝 - rqrq
export const haiAnSyncPalletDetailToWcs = data => createAPI('/autoWareHourceHaian/haiAnPallet/syncPalletDetailToWcs', 'post', data)

4
src/views/modules/haianWarehouse/automatedWarehouse/agvTask54.vue

@ -131,8 +131,8 @@
</el-table-column>
<el-table-column prop="sourceBillNo" label="来源单号" width="120" align="center"></el-table-column>
<el-table-column prop="status" label="状态" width="80" align="center"></el-table-column>
<el-table-column prop="fromLocation" label="起始站点" width="140" align="center"></el-table-column>
<el-table-column prop="toLocation" label="目标站点" width="140" align="center"></el-table-column>
<el-table-column prop="fromLocation" label="起始站点" width="120" align="center"></el-table-column>
<el-table-column prop="toLocation" label="目标站点" width="120" align="center"></el-table-column>
<el-table-column prop="toAreaName" label="目标区域" width="100" align="center"></el-table-column>
<el-table-column prop="palletId" label="托盘ID" width="80" align="center"></el-table-column>
<el-table-column prop="palletTypeName" label="托盘类型" width="100" align="center"></el-table-column>

151
src/views/modules/haianWarehouse/warehousePallet/warehousePallet54.vue

@ -97,6 +97,25 @@
@selection-change="selectionChangeHandle"
style="width: 100%;"
>
<!-- 左侧操作沿用角色管理的绿色文字链接;不在货架时同步链接置灰 - rqrq -->
<el-table-column fixed="left" header-align="center" align="center" width="120" label="操作">
<template slot-scope="scope">
<a type="text" @click="openDetailDialog(scope.row)">查看明细</a>
<a
v-if="hasWcsLocation(scope.row)"
type="text"
style="margin-left: 5px;"
@click="syncWcs(scope.row)"
>{{ syncingPalletId === scope.row.palletId ? '同步中...' : '同步WCS' }}</a>
<a
v-else
type="text"
style="margin-left: 5px; color: #c0c4cc; cursor: not-allowed;"
title="托盘不在货架上"
@click.prevent
>同步WCS</a>
</template>
</el-table-column>
<el-table-column type="selection" width="55" align="center" header-align="center" />
<el-table-column
v-for="(item, index) in columnList"
@ -130,6 +149,38 @@
layout="total, sizes, prev, pager, next, jumper"
/>
<!-- 查看托盘标签明细:只展示,不改数据 - rqrq -->
<el-dialog
:title="'托盘明细' + (detailDialog.palletId ? ' - ' + detailDialog.palletId : '')"
:visible.sync="detailDialog.visible"
:close-on-click-modal="false"
v-drag
append-to-body
width="980px"
>
<el-table
:data="detailDialog.rows"
border
stripe
height="420"
v-loading="detailDialog.loading"
style="width: 100%;"
>
<el-table-column prop="position" label="位置" min-width="80" align="center" header-align="center" show-overflow-tooltip />
<el-table-column prop="layer" label="层数" min-width="70" align="center" header-align="center" />
<el-table-column prop="serialNo" label="标签号" min-width="160" align="center" header-align="center" show-overflow-tooltip />
<el-table-column prop="partNo" label="物料" min-width="140" align="center" header-align="center" show-overflow-tooltip />
<el-table-column prop="batchNo" label="批次" min-width="120" align="center" header-align="center" show-overflow-tooltip />
<el-table-column label="数量" min-width="90" align="right" header-align="center">
<template slot-scope="scope">{{ formatQty(scope.row.qty) }}</template>
</el-table-column>
<el-table-column prop="wdr" label="WDR" min-width="140" align="center" header-align="center" show-overflow-tooltip />
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="detailDialog.visible = false">关闭</el-button>
</div>
</el-dialog>
<!-- 托盘编辑弹窗:统一维护主表字段并防重复提交 - rqrq -->
<el-dialog
:title="editDialog.title"
@ -335,7 +386,9 @@ import {
haiAnGetPalletStatusOptions,
haiAnGetPalletTypeList,
haiAnGetUserAuthorizedSites,
haiAnListPalletLabelDetails,
haiAnSavePallet,
haiAnSyncPalletDetailToWcs,
haiAnUpdatePallet
} from '@/api/haianWarehouse/warehousePallet.js'
@ -381,16 +434,16 @@ export default {
exportFooter: [],
columnList: [
// { columnProp: 'site', columnLabel: '工厂', columnWidth: 90, align: 'center', headerAlign: 'center' },
{ columnProp: 'palletId', columnLabel: '托盘ID', columnWidth: 120, align: 'center', headerAlign: 'center' },
{ columnProp: 'palletFamilyDesc', columnLabel: '托盘大分类', columnWidth: 120, align: 'center', headerAlign: 'center' },
{ columnProp: 'typeDesc', columnLabel: '托盘类型', columnWidth: 160, align: 'center', headerAlign: 'center' },
{ columnProp: 'height', columnLabel: '高度', columnWidth: 120, align: 'center', headerAlign: 'center', formatter: 'height' },
{ columnProp: 'palletId', columnLabel: '托盘ID', columnWidth: 60, align: 'center', headerAlign: 'center' },
{ columnProp: 'palletFamilyDesc', columnLabel: '托盘大分类', columnWidth: 70, align: 'center', headerAlign: 'center' },
{ columnProp: 'typeDesc', columnLabel: '托盘类型', columnWidth: 100, align: 'center', headerAlign: 'center' },
// { columnProp: 'height', columnLabel: '高度', columnWidth: 120, align: 'center', headerAlign: 'center', formatter: 'height' },
// { columnProp: 'status', columnLabel: '托盘状态', columnWidth: 100, align: 'center', headerAlign: 'center', formatter: 'status' },
{ columnProp: 'areaDesc', columnLabel: '区域', columnWidth: 120, align: 'center', headerAlign: 'center' },
{ columnProp: 'locationCode', columnLabel: '所在位置', columnWidth: 120, align: 'center', headerAlign: 'center' },
{ columnProp: 'wcsLocation', columnLabel: '立库货架', columnWidth: 120, align: 'center', headerAlign: 'center' },
{ columnProp: 'emptyFlag', columnLabel: '空托盘', columnWidth: 90, align: 'center', headerAlign: 'center', formatter: 'yn' },
{ columnProp: 'callingFlag', columnLabel: '调用标记', columnWidth: 90, align: 'center', headerAlign: 'center', formatter: 'yn' },
{ columnProp: 'areaDesc', columnLabel: '区域', columnWidth: 80, align: 'center', headerAlign: 'center' },
{ columnProp: 'locationCode', columnLabel: '所在位置', columnWidth: 110, align: 'center', headerAlign: 'center' },
{ columnProp: 'wcsLocation', columnLabel: '立库货架', columnWidth: 110, align: 'center', headerAlign: 'center' },
{ columnProp: 'emptyFlag', columnLabel: '空托盘', columnWidth: 70, align: 'center', headerAlign: 'center', formatter: 'yn' },
{ columnProp: 'callingFlag', columnLabel: '调用标记', columnWidth: 60, align: 'center', headerAlign: 'center', formatter: 'yn' },
{ columnProp: 'remark', columnLabel: '备注', columnWidth: 220, align: 'left', headerAlign: 'center' },
{ columnProp: 'manualRemark', columnLabel: '手工备注', columnWidth: 220, align: 'left', headerAlign: 'center' },
{ columnProp: 'createdBy', columnLabel: '创建人', columnWidth: 100, align: 'center', headerAlign: 'center' },
@ -419,7 +472,17 @@ export default {
saving: false,
site: '',
palletNoList: []
}
},
// 明细弹窗只展示当前托盘标签;请求序号用来丢掉切换托盘后返回的旧结果 - rqrq
detailDialog: {
visible: false,
loading: false,
palletId: '',
rows: []
},
detailRequestSeq: 0,
// 正在同步的托盘号,用来锁定按钮,避免同一行重复下发 - rqrq
syncingPalletId: ''
}
},
computed: {
@ -991,6 +1054,74 @@ export default {
return map[value] || value || ''
}
return value == null ? '' : value
},
// 数量去尾零,空值显示0 - rqrq
formatQty(value) {
if (value === null || value === undefined || value === '') {
return '0'
}
const num = Number(value)
return Number.isNaN(num) ? '0' : String(num)
},
// 立库货架有值才允许同步,空白和null都视为不在货架 - rqrq
hasWcsLocation(row) {
return !!(row && String(row.wcsLocation || '').trim())
},
// 打开明细弹窗并按当前工厂查询标签,失败弹框确认后关闭提示 - rqrq
openDetailDialog(row) {
if (!row || !row.palletId || this.detailDialog.loading) {
return
}
const palletId = row.palletId
this.detailRequestSeq += 1
const requestSeq = this.detailRequestSeq
this.detailDialog.visible = true
this.detailDialog.palletId = palletId
this.detailDialog.rows = []
this.detailDialog.loading = true
haiAnListPalletLabelDetails({
site: this.currentSite,
palletId: palletId
}).then(({ data }) => {
if (requestSeq !== this.detailRequestSeq) {
return
}
if (data && data.code === 0) {
this.detailDialog.rows = data.rows || []
} else {
this.$alert((data && data.msg) || '查询托盘明细失败', '提示', { confirmButtonText: '确定' })
}
}).catch(() => {
if (requestSeq !== this.detailRequestSeq) {
return
}
this.$message.error('查询托盘明细失败')
}).finally(() => {
if (requestSeq === this.detailRequestSeq) {
this.detailDialog.loading = false
}
})
},
// 货架托盘把当前标签明细推给立库;失败弹框,点确认后提示消失 - rqrq
syncWcs(row) {
if (!this.hasWcsLocation(row) || this.syncingPalletId) {
return
}
this.syncingPalletId = row.palletId
haiAnSyncPalletDetailToWcs({
site: this.currentSite,
palletId: row.palletId
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success((data && data.msg) || '同步WCS成功')
} else {
this.$alert((data && data.msg) || '同步WCS失败', '提示', { confirmButtonText: '确定' })
}
}).catch(() => {
this.$message.error('同步WCS失败')
}).finally(() => {
this.syncingPalletId = ''
})
}
}
}

Loading…
Cancel
Save