|
|
|
@ -100,11 +100,12 @@ |
|
|
|
<el-table-column |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
width="120" |
|
|
|
width="160" |
|
|
|
label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a type="text" size="small" v-if="scope.row.status==='ISSUE'" @click="closeNotifyModel(scope.row)">关闭</a> |
|
|
|
<a type="text" size="small" v-if="scope.row.status==='CLOSED'" @click="openNotify(scope.row)">开启</a> |
|
|
|
<a type="text" size="small" v-if="scope.row.pushWcsFlag!=='Y'" @click="previewInventory(scope.row)" style="margin-left: 10px;">预览</a> |
|
|
|
<a type="text" size="small" v-if="scope.row.pushWcsFlag!=='Y'" @click="pushToWcs(scope.row)" style="margin-left: 10px;">推送WCS</a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
@ -254,8 +255,84 @@ |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 库存预览模态框 --> |
|
|
|
<el-dialog |
|
|
|
title="库存匹配预览" |
|
|
|
:visible.sync="previewDialogVisible" |
|
|
|
width="80%" |
|
|
|
:close-on-click-modal="false"> |
|
|
|
<el-table |
|
|
|
:data="previewData" |
|
|
|
border |
|
|
|
v-loading="previewLoading" |
|
|
|
style="width: 100%;" |
|
|
|
height="300" |
|
|
|
:row-class-name="getRowClassName"> |
|
|
|
<el-table-column |
|
|
|
prop="rowNo" |
|
|
|
label="行号" |
|
|
|
width="80" |
|
|
|
align="center"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="productionOrderNo" |
|
|
|
label="生产订单号" |
|
|
|
width="140" |
|
|
|
align="center"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="bomLineNo" |
|
|
|
label="BOM行号" |
|
|
|
width="100" |
|
|
|
align="center"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="partNo" |
|
|
|
label="物料编码" |
|
|
|
width="120" |
|
|
|
align="center"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="requiredQty" |
|
|
|
label="需求数量" |
|
|
|
width="100" |
|
|
|
align="center"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="isWarehouseSatisfied" |
|
|
|
label="立库是否满足" |
|
|
|
width="120" |
|
|
|
align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span :style="{color: scope.row.isWarehouseSatisfied === 'Y' ? '#67C23A' : '#F56C6C'}"> |
|
|
|
{{ scope.row.isWarehouseSatisfied === 'Y' ? '是' : '否' }} |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="isOtherWarehouseSatisfied" |
|
|
|
label="分切仓库是否满足" |
|
|
|
width="140" |
|
|
|
align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.isOtherWarehouseSatisfied" :style="{color: scope.row.isOtherWarehouseSatisfied === 'Y' ? '#67C23A' : '#F56C6C'}"> |
|
|
|
{{ scope.row.isOtherWarehouseSatisfied === 'Y' ? '是' : '否' }} |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="matchedBarcodes" |
|
|
|
label="匹配条码" |
|
|
|
min-width="200" |
|
|
|
align="left" |
|
|
|
show-overflow-tooltip> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" class="yzzButtonAn" @click="pushToWCS">推送至WCS</el-button> |
|
|
|
<el-button @click="previewDialogVisible = false">关闭</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
@ -272,6 +349,8 @@ |
|
|
|
, searchNotifyLogNew |
|
|
|
, searchNotifyLogCloseNew |
|
|
|
, pushNotifyToWcs |
|
|
|
, checkIssueNotifyInventory |
|
|
|
, pushInventoryToWcs |
|
|
|
|
|
|
|
} from "@/api/orderIssure/soIssueNotify.js" |
|
|
|
|
|
|
|
@ -928,6 +1007,11 @@ |
|
|
|
spec: '', |
|
|
|
}, |
|
|
|
choosePartList: [], |
|
|
|
// 预览相关数据 |
|
|
|
previewDialogVisible: false, |
|
|
|
previewLoading: false, |
|
|
|
previewData: [], |
|
|
|
currentRow: {} // 当前查看的申请单行数据 |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
@ -1098,6 +1182,89 @@ |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 预览库存匹配情况 |
|
|
|
previewInventory(row) { |
|
|
|
this.currentRow = row // 保存当前行数据 |
|
|
|
this.previewDialogVisible = true |
|
|
|
this.previewLoading = true |
|
|
|
this.previewData = [] |
|
|
|
|
|
|
|
let inData = { |
|
|
|
site: row.site, |
|
|
|
notifyNo: row.notifyNo |
|
|
|
} |
|
|
|
|
|
|
|
checkIssueNotifyInventory(inData).then(({data}) => { |
|
|
|
this.previewLoading = false |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.previewData = data.rows || [] |
|
|
|
console.log('库存预览数据:', this.previewData) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.previewLoading = false |
|
|
|
this.$message.error('获取库存预览失败') |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 根据订单满足状态设置行样式 |
|
|
|
getRowClassName({row}) { |
|
|
|
if (row.orderSatisfactionStatus === 1) { |
|
|
|
return 'success-row' // 绿色:完全立库满足 |
|
|
|
} else if (row.orderSatisfactionStatus === 2) { |
|
|
|
return 'warning-row' // 黄色:立库+分切区满足 |
|
|
|
} else if (row.orderSatisfactionStatus === 3) { |
|
|
|
return 'danger-row' // 红色:存在不满足 |
|
|
|
} |
|
|
|
return '' |
|
|
|
}, |
|
|
|
|
|
|
|
// 从预览对话框推送至WCS |
|
|
|
pushToWCS() { |
|
|
|
// 筛选绿色和黄色的数据(orderSatisfactionStatus = 1 或 2) |
|
|
|
const validData = this.previewData.filter(item => |
|
|
|
item.orderSatisfactionStatus === 1 || item.orderSatisfactionStatus === 2 |
|
|
|
) |
|
|
|
|
|
|
|
if (validData.length === 0) { |
|
|
|
this.$message.warning('没有可推送的数据(只推送绿色和黄色状态的数据)') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.$confirm(`确认推送 ${validData.length} 条数据至WCS?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
const inData = { |
|
|
|
site: this.currentRow.site, |
|
|
|
notifyNo: this.currentRow.notifyNo, |
|
|
|
inventoryList: validData |
|
|
|
} |
|
|
|
|
|
|
|
pushInventoryToWcs(inData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message({ |
|
|
|
message: '推送WCS成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500 |
|
|
|
}) |
|
|
|
this.previewDialogVisible = false |
|
|
|
this.searchTable() |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.$message.error('推送WCS失败') |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
pushToWcs(row){ |
|
|
|
this.$confirm('确认推送到WCS?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
@ -1256,4 +1423,32 @@ |
|
|
|
flex-shrink: 0; |
|
|
|
min-width: 30px; |
|
|
|
} |
|
|
|
|
|
|
|
/* 库存预览表格行颜色 */ |
|
|
|
/deep/ .el-table .success-row { |
|
|
|
background: #f0f9ff !important; |
|
|
|
border-left: 3px solid #67C23A; |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .el-table .warning-row { |
|
|
|
background: #fdf6ec !important; |
|
|
|
border-left: 3px solid #E6A23C; |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .el-table .danger-row { |
|
|
|
background: #fef0f0 !important; |
|
|
|
border-left: 3px solid #F56C6C; |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .el-table .success-row:hover > td { |
|
|
|
background-color: #ecf5ff !important; |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .el-table .warning-row:hover > td { |
|
|
|
background-color: #faecd8 !important; |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .el-table .danger-row:hover > td { |
|
|
|
background-color: #fde2e2 !important; |
|
|
|
} |
|
|
|
</style> |