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

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

@ -55,6 +55,8 @@
<template v-if="!authClose">
<el-link style="cursor: pointer" @click="closeModal(scope.row)">关闭</el-link>
</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>
</el-table-column>
</el-table>
@ -160,6 +162,96 @@
</el-tab-pane>
</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">
<div style="font-size: 12px">
@ -458,7 +550,7 @@
<el-form-item label=" ">
<el-button type="primary" @click="openSelectMaterialModalForDetail()"
class="">添加</el-button>
</el-form-item>
</el-form-item>
</el-col>
</el-row>
</el-form>
@ -561,40 +653,6 @@
</el-footer>
</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>
</div>
@ -608,14 +666,17 @@ import {
saveNoOrderMaterialDetail,
getNoOrderMaterialList
} from '@/api/orderIssure/noOrderIssueNotify.js'
// rqrq - WCSAPI使API
import {
checkIssueNotifyInventory,
pushInventoryToWcs
} from '@/api/orderIssure/soIssueNotify.js'
import {
getSiteAndBuByUserName,
createNotify,
closeInboundNotification,
checkUserHasUnissueShipment,
cancelIssueShipment,
checkShipmentInventory,
pushShipmentInventoryToWcs,
deleteNotifyUnissue,
} from '@/api/shipment/shipmentIssue.js'
import Chooselist from '@/views/modules/common/Chooselist_eam'
@ -870,6 +931,26 @@ export default {
fixed: '',
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,
functionId: 610,
@ -1375,12 +1456,11 @@ export default {
//
isMaterialDetailModal: false, //
clickrow: {},
// rqrq -
// rqrq - WCS
previewDialogVisible: false,
previewLoading: false,
pushLoading: false,
previewData: [],
currentNotifyRow: null,
currentNotifyRow: null, // WCS - rqrq
}
},
@ -2275,7 +2355,7 @@ export default {
const selectedPartNos = this.selectedMaterialList.map(
(item) => item.partNo || item.componentPartNo
)
// sobomList
if (this.isMaterialDetailModal && this.sobomList && this.sobomList.length > 0) {
const sobomPartNos = this.sobomList.map(
@ -2398,7 +2478,7 @@ export default {
//
confirmSelectMaterial() {
if (this.isMaterialDetailModal) {
// ""sobomList
const selectedItems = JSON.parse(JSON.stringify(this.selectedMaterialList))
// sobomList
@ -2417,7 +2497,7 @@ export default {
})
// ""sobomList
this.sobomList = selectedItems
this.isMaterialDetailModal = false
}
@ -2568,107 +2648,99 @@ export default {
},
/**
* @Description 预览库存发货通知单只考虑立库 - rqrq
* @Description 预览库存匹配情况 - rqrq
* @param row 当前申请单行数据
*/
previewInventory(row) {
this.currentNotifyRow = row
this.currentNotifyRow = row // - rqrq
this.previewDialogVisible = true
this.previewLoading = true
this.previewData = []
let inData = {
site: row.site,
notifyNo: row.notifyNo,
notifyNo: row.notifyNo
}
checkShipmentInventory(inData)
.then(({ data }) => {
this.previewLoading = false
if (data && data.code === 0) {
this.previewData = data.rows || []
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
.catch(() => {
this.previewLoading = false
this.$message.error('获取库存预览失败')
})
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('获取库存预览失败')
})
},
/**
* @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) {
this.$message.warning('没有满足库存要求的订单,无法推送')
this.$message.warning('没有可推送的数据')
return
}
this.$confirm('确认推送至WCS?', '提示', {
this.$confirm(`确认推送 ${validData.length} 条数据至WCS?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
this.pushLoading = true
type: 'warning'
}).then(() => {
// - rqrq
this.previewLoading = true
let pushData = {
site: this.currentNotifyRow.site,
notifyNo: this.currentNotifyRow.notifyNo,
shipmentInventoryList: this.previewData,
}
const inData = {
site: this.currentNotifyRow.site,
notifyNo: this.currentNotifyRow.notifyNo,
inventoryList: validData
}
pushShipmentInventoryToWcs(pushData)
.then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '推送WCS成功',
type: 'success',
duration: 1500,
})
this.previewDialogVisible = false
this.getDataList() //
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
.catch(() => {
this.$message.error('推送WCS失败')
pushInventoryToWcs(inData).then(({data}) => {
this.previewLoading = false
if (data && data.code === 0) {
this.$message({
message: '推送WCS成功',
type: 'success',
duration: 1500
})
.finally(() => {
this.pushLoading = false
this.previewDialogVisible = false
this.getDataList() //
} else {
this.$alert(data.msg || '推送失败', '错误', {
confirmButtonText: '确定'
})
}
}).catch((error) => {
this.previewLoading = false
this.$message.error(error.message || '推送WCS失败,请重试')
})
.catch(() => {
// - rqrq
})
},
/**
* @Description 表格行样式发货通知单绿色=满足红色=不满足 - rqrq
*/
getRowStyle({ row }) {
if (row.orderSatisfactionStatus === 1) {
return { backgroundColor: '#67C23A20' } // 绿
} else if (row.orderSatisfactionStatus === 3) {
return { backgroundColor: '#F56C6C20' } //
}
return {}
}).catch(() => {
// - rqrq
console.log('用户取消推送')
})
},
},
}
@ -2683,10 +2755,37 @@ export default {
line-height: 1.5;
}
/* rqrq - 匹配条码列自动换行显示 */
/deep/ .wrap-text-column .cell {
white-space: normal !important;
word-break: break-all !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>
Loading…
Cancel
Save