常熟吴彦祖 2 months ago
parent
commit
d14c0a07a2
  1. 281
      src/views/modules/noOrderIssue/noOrderNotification.vue

281
src/views/modules/noOrderIssue/noOrderNotification.vue

@ -55,6 +55,8 @@
<template v-if="!authClose"> <template v-if="!authClose">
<el-link style="cursor: pointer" @click="closeModal(scope.row)">关闭</el-link> <el-link style="cursor: pointer" @click="closeModal(scope.row)">关闭</el-link>
</template> </template>
<!-- rqrq - 添加推送WCS按钮 -->
<a type="text" size="small" v-if="scope.row.pushWcsFlag!=='推送完成'&&scope.row.status==='ISSUE'" @click="previewInventory(scope.row)" style="margin-left: 10px;">推送WCS</a>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -160,6 +162,96 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<!-- rqrq - 推送WCS预览弹窗 -->
<el-dialog
title="库存匹配情况预览"
:visible.sync="previewDialogVisible"
:close-on-click-modal="false"
v-drag
width="95%">
<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="100"
sortable
align="center">
</el-table-column>
<el-table-column
prop="bomLineNo"
label="BOM行号"
width="100"
sortable
align="center">
</el-table-column>
<el-table-column
prop="partNo"
label="物料编码"
width="100"
sortable
align="center">
</el-table-column>
<el-table-column
prop="requiredQty"
label="需求数量"
width="80"
align="center">
</el-table-column>
<el-table-column
prop="isWarehouseSatisfied"
label="立库是否满足"
width="100"
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="120"
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="300"
align="left"
class-name="wrap-text-column">
<template slot-scope="scope">
<div style="white-space: normal; word-break: break-all; line-height: 1.5;">
{{ scope.row.matchedBarcodes }}
</div>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button type="primary" class="yzzButtonAn" @click="pushToWCS" :disabled="previewLoading">
{{ previewLoading ? '推送中...' : '推送至WCS' }}
</el-button>
<el-button @click="previewDialogVisible = false" :disabled="previewLoading">关闭</el-button>
</span>
</el-dialog>
<!-- 收获入库单明细新增 --> <!-- 收获入库单明细新增 -->
<el-dialog title="收货入库单明细" :close-on-click-modal="false" v-drag :visible.sync="detailModal" width="900px"> <el-dialog title="收货入库单明细" :close-on-click-modal="false" v-drag :visible.sync="detailModal" width="900px">
<div style="font-size: 12px"> <div style="font-size: 12px">
@ -561,40 +653,6 @@
</el-footer> </el-footer>
</el-dialog> </el-dialog>
<!-- rqrq - 库存预览弹窗发货通知单只有绿色和红色 -->
<el-dialog title="库存预览" :close-on-click-modal="false" v-drag :visible.sync="previewDialogVisible" width="90%">
<div v-loading="previewLoading">
<el-table :data="previewData" height="400" border :row-style="getRowStyle" highlight-current-row
style="width: 100%">
<el-table-column prop="partNo" label="物料编号" sortable min-width="80"></el-table-column>
<el-table-column prop="requiredQty" label="需求数量" min-width="80" align="right"></el-table-column>
<el-table-column prop="productionOrderNo" label="发货单" sortable min-width="100"></el-table-column>
<el-table-column prop="bomLineNo" label="行号" min-width="60"></el-table-column>
<el-table-column label="是否满足" sortable min-width="80" 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="matchedBarcodes" label="匹配条码" min-width="500" align="left"
class-name="wrap-text-column">
<template slot-scope="scope">
<div style="white-space: normal; word-break: break-all; line-height: 1.5;">
{{ scope.row.matchedBarcodes }}
</div>
</template>
</el-table-column>
</el-table>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="pushToWcs" :disabled="pushLoading">
{{ pushLoading ? '推送中...' : '推送至WCS' }}
</el-button>
<el-button @click="previewDialogVisible = false" :disabled="pushLoading">关闭</el-button>
</div>
</el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div> </div>
@ -608,14 +666,17 @@ import {
saveNoOrderMaterialDetail, saveNoOrderMaterialDetail,
getNoOrderMaterialList getNoOrderMaterialList
} from '@/api/orderIssure/noOrderIssueNotify.js' } from '@/api/orderIssure/noOrderIssueNotify.js'
// rqrq - WCSAPI使API
import {
checkIssueNotifyInventory,
pushInventoryToWcs
} from '@/api/orderIssure/soIssueNotify.js'
import { import {
getSiteAndBuByUserName, getSiteAndBuByUserName,
createNotify, createNotify,
closeInboundNotification, closeInboundNotification,
checkUserHasUnissueShipment, checkUserHasUnissueShipment,
cancelIssueShipment, cancelIssueShipment,
checkShipmentInventory,
pushShipmentInventoryToWcs,
deleteNotifyUnissue, deleteNotifyUnissue,
} from '@/api/shipment/shipmentIssue.js' } from '@/api/shipment/shipmentIssue.js'
import Chooselist from '@/views/modules/common/Chooselist_eam' import Chooselist from '@/views/modules/common/Chooselist_eam'
@ -870,6 +931,26 @@ export default {
fixed: '', fixed: '',
columnWidth: 100, columnWidth: 100,
}, },
// rqrq - WCS
{
userId: this.$store.state.user.name,
functionId: 610,
serialNumber: '610Table1PushWcsFlag',
tableId: '610Table1',
tableName: '收货入库任务表',
columnProp: 'pushWcsFlag',
headerAlign: 'center',
align: 'center',
columnLabel: '推送WCS',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},
/* { /* {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 610, functionId: 610,
@ -1375,12 +1456,11 @@ export default {
// //
isMaterialDetailModal: false, // isMaterialDetailModal: false, //
clickrow: {}, clickrow: {},
// rqrq -
// rqrq - WCS
previewDialogVisible: false, previewDialogVisible: false,
previewLoading: false, previewLoading: false,
pushLoading: false,
previewData: [], previewData: [],
currentNotifyRow: null,
currentNotifyRow: null, // WCS - rqrq
} }
}, },
@ -2568,108 +2648,100 @@ export default {
}, },
/** /**
* @Description 预览库存发货通知单只考虑立库 - rqrq
* @Description 预览库存匹配情况 - rqrq
* @param row 当前申请单行数据 * @param row 当前申请单行数据
*/ */
previewInventory(row) { previewInventory(row) {
this.currentNotifyRow = row
this.currentNotifyRow = row // - rqrq
this.previewDialogVisible = true this.previewDialogVisible = true
this.previewLoading = true this.previewLoading = true
this.previewData = [] this.previewData = []
let inData = { let inData = {
site: row.site, site: row.site,
notifyNo: row.notifyNo,
notifyNo: row.notifyNo
} }
checkShipmentInventory(inData)
.then(({ data }) => {
checkIssueNotifyInventory(inData).then(({data}) => {
this.previewLoading = false this.previewLoading = false
if (data && data.code === 0) { if (data && data.code === 0) {
this.previewData = data.rows || [] this.previewData = data.rows || []
console.log('库存预览数据:', this.previewData)
} else { } else {
this.$alert(data.msg, '错误', { this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
confirmButtonText: '确定'
}) })
} }
})
.catch(() => {
}).catch(() => {
this.previewLoading = false this.previewLoading = false
this.$message.error('获取库存预览失败') this.$message.error('获取库存预览失败')
}) })
}, },
/** /**
* @Description 推送至WCS发货通知单 - rqrq
* @Description 根据订单满足状态设置行样式 - rqrq
*/ */
pushToWcs() {
if (!this.previewData || this.previewData.length === 0) {
this.$message.warning('没有可推送的数据')
return
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 ''
},
/**
* @Description 从预览对话框推送至WCS - rqrq
*/
pushToWCS() {
// - rqrq
const validData = this.previewData
// orderSatisfactionStatus === 1绿 - rqrq
const validData = this.previewData.filter(
(item) => item.orderSatisfactionStatus === 1
)
if (validData.length === 0) { if (validData.length === 0) {
this.$message.warning('没有满足库存要求的订单,无法推送')
this.$message.warning('没有可推送的数据')
return return
} }
this.$confirm('确认推送至WCS?', '提示', {
this.$confirm(`确认推送 ${validData.length} 条数据至WCS?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
this.pushLoading = true
type: 'warning'
}).then(() => {
// - rqrq
this.previewLoading = true
let pushData = {
const inData = {
site: this.currentNotifyRow.site, site: this.currentNotifyRow.site,
notifyNo: this.currentNotifyRow.notifyNo, notifyNo: this.currentNotifyRow.notifyNo,
shipmentInventoryList: this.previewData,
inventoryList: validData
} }
pushShipmentInventoryToWcs(pushData)
.then(({ data }) => {
pushInventoryToWcs(inData).then(({data}) => {
this.previewLoading = false
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '推送WCS成功', message: '推送WCS成功',
type: 'success', type: 'success',
duration: 1500,
duration: 1500
}) })
this.previewDialogVisible = false this.previewDialogVisible = false
this.getDataList() // this.getDataList() //
} else { } else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
this.$alert(data.msg || '推送失败', '错误', {
confirmButtonText: '确定'
}) })
} }
}).catch((error) => {
this.previewLoading = false
this.$message.error(error.message || '推送WCS失败,请重试')
}) })
.catch(() => {
this.$message.error('推送WCS失败')
})
.finally(() => {
this.pushLoading = false
})
})
.catch(() => {
// - rqrq
}).catch(() => {
// - rqrq
console.log('用户取消推送')
}) })
}, },
/**
* @Description 表格行样式发货通知单绿色=满足红色=不满足 - rqrq
*/
getRowStyle({ row }) {
if (row.orderSatisfactionStatus === 1) {
return { backgroundColor: '#67C23A20' } // 绿
} else if (row.orderSatisfactionStatus === 3) {
return { backgroundColor: '#F56C6C20' } //
}
return {}
},
}, },
} }
</script> </script>
@ -2683,10 +2755,37 @@ export default {
line-height: 1.5; line-height: 1.5;
} }
/* rqrq - 匹配条码列自动换行显示 */
/deep/ .wrap-text-column .cell { /deep/ .wrap-text-column .cell {
white-space: normal !important; white-space: normal !important;
word-break: break-all !important; word-break: break-all !important;
line-height: 1.5 !important; line-height: 1.5 !important;
} }
/* rqrq - 表格行样式:根据满足状态显示不同背景色 */
/deep/ .el-table .success-row {
background-color: #f0f9ff !important;
border-left: 3px solid #67C23A;
}
/deep/ .el-table .warning-row {
background-color: #fdf6ec !important;
border-left: 3px solid #E6A23C;
}
/deep/ .el-table .danger-row {
background-color: #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> </style>
Loading…
Cancel
Save