Browse Source

发货单下达

master
常熟吴彦祖 2 months ago
parent
commit
130569d7a1
  1. 16
      src/api/shipment/shipmentIssue.js
  2. 32
      src/views/modules/orderIssure/searchIssureNotify.vue
  3. 249
      src/views/modules/shipment/shipmentNotification.vue

16
src/api/shipment/shipmentIssue.js

@ -50,4 +50,18 @@ export const getIFSShopOrderByOrderNo = data => createAPI(`/shipmentIssue/getIFS
export const searchNotifyMaterialList = data => createAPI(`/shipmentIssue/searchNotifyMaterialList`,'post',data)
export const closeInboundNotification = data => createAPI(`/shipmentIssue/closeInboundNotification`,'post',data)
export const closeInboundNotification = data => createAPI(`/shipmentIssue/closeInboundNotification`,'post',data)
// ================== rqrq - 发货通知单取消下达功能接口 ==================
// 检查用户是否有未下达的shipment申请单 - rqrq
export const checkUserHasUnissueShipment = data => createAPI(`/shipmentIssue/checkUserHasUnissueShipment`,'post',data)
// 取消下达发货申请单 - rqrq
export const cancelIssueShipment = data => createAPI(`/shipmentIssue/cancelIssueShipment`,'post',data)
// 检查发货通知单物料库存匹配情况(只考虑立库) - rqrq
export const checkShipmentInventory = data => createAPI(`/shipmentIssue/checkShipmentInventory`,'post',data)
// 推送发货通知单库存预览数据至WCS - rqrq
export const pushShipmentInventoryToWcs = data => createAPI(`/shipmentIssue/pushShipmentInventoryToWcs`,'post',data)

32
src/views/modules/orderIssure/searchIssureNotify.vue

@ -295,7 +295,7 @@
<el-table-column
prop="productionOrderNo"
label="生产订单号"
width="140"
width="100"
align="center">
</el-table-column>
<el-table-column
@ -307,19 +307,19 @@
<el-table-column
prop="partNo"
label="物料编码"
width="120"
width="100"
align="center">
</el-table-column>
<el-table-column
prop="requiredQty"
label="需求数量"
width="100"
width="80"
align="center">
</el-table-column>
<el-table-column
prop="isWarehouseSatisfied"
label="立库是否满足"
width="120"
width="100"
align="center">
<template slot-scope="scope">
<span :style="{color: scope.row.isWarehouseSatisfied === 'Y' ? '#67C23A' : '#F56C6C'}">
@ -330,7 +330,7 @@
<el-table-column
prop="isOtherWarehouseSatisfied"
label="分切仓库是否满足"
width="140"
width="120"
align="center">
<template slot-scope="scope">
<span v-if="scope.row.isOtherWarehouseSatisfied" :style="{color: scope.row.isOtherWarehouseSatisfied === 'Y' ? '#67C23A' : '#F56C6C'}">
@ -341,9 +341,14 @@
<el-table-column
prop="matchedBarcodes"
label="匹配条码"
min-width="200"
min-width="300"
align="left"
show-overflow-tooltip>
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">
@ -1343,7 +1348,7 @@
site: row.site,
username: row.username
}
checkUserHasUnissueShopOrder(checkData).then(({ data }) => {
if (data && data.code === 0) {
// - rqrq
@ -1353,7 +1358,7 @@
})
return
}
// - rqrq
this.$confirm(`确定取消下达申请单【${row.notifyNo}】吗?`, '提示', {
confirmButtonText: '确定',
@ -1364,7 +1369,7 @@
site: row.site,
notifyNo: row.notifyNo
}
cancelIssueNotify(cancelData).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success('取消下达成功')
@ -1535,6 +1540,13 @@
border-left: 3px solid #67C23A;
}
/* rqrq - 匹配条码列自动换行显示 */
/deep/ .wrap-text-column .cell {
white-space: normal !important;
word-break: break-all !important;
line-height: 1.5 !important;
}
/deep/ .el-table .warning-row {
background: #fdf6ec !important;
border-left: 3px solid #E6A23C;

249
src/views/modules/shipment/shipmentNotification.vue

@ -48,7 +48,7 @@
style="width: 100px; height: 80px" /></span>
</template>
</el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="120" label="操作">
<el-table-column fixed="right" header-align="center" align="center" width="250" label="操作">
<template slot-scope="scope">
<!-- <template v-if="!authUpdate">
<el-link
@ -59,6 +59,14 @@
<el-link style="cursor: pointer"
@click="closeModal(scope.row)">关闭</el-link>
</template>
<!-- rqrq - 推送WCS按钮只在状态为ISSUE且未推送完成时显示 -->
<el-link v-if="scope.row.status==='ISSUE' && scope.row.pushWcsFlag!=='推送完成'"
style="cursor: pointer; margin-left: 10px;"
@click="previewInventory(scope.row)">推送WCS</el-link>
<!-- rqrq - 取消下达按钮只在状态为ISSUE且未推送WCS时显示 -->
<el-link v-if="scope.row.status==='ISSUE'&&scope.row.pushWcsFlag==='未推送'"
style="cursor: pointer; margin-left: 10px;"
@click="cancelIssueShipmentHandle(scope.row)">取消下达</el-link>
<!-- <template v-if="!authIssue">
<el-link v-if="scope.row.orderStatus === '草稿' || scope.row.orderStatus === '编辑中'" style="cursor: pointer"
@click="issueModal(scope.row)">下达</el-link>
@ -460,7 +468,7 @@
<el-form-item :label="'生产订单号'">
<el-input v-model="sobomData.orderNo" disabled></el-input>
</el-form-item>
</el-col>
</el-col>
<el-col :span="6">
<el-form-item :label="'产品编码'">
<el-input v-model="sobomData.partNo" disabled></el-input>
@ -496,6 +504,49 @@
</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="物料编号" 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="发货单" min-width="100"></el-table-column>
<el-table-column prop="bomLineNo" label="行号" min-width="60"></el-table-column>
<el-table-column label="是否满足" 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>
@ -508,7 +559,11 @@ import {
createNotify,
getNotifyNoDetail,
searchNotifyMaterialList,
closeInboundNotification
closeInboundNotification,
checkUserHasUnissueShipment,
cancelIssueShipment,
checkShipmentInventory,
pushShipmentInventoryToWcs
} from '@/api/shipment/shipmentIssue.js'
import Chooselist from '@/views/modules/common/Chooselist_eam'
import { getChooselist } from '@/api/chooselist/chooselist.js'
@ -538,7 +593,7 @@ export default {
orderNo: '',
orderType: '',
orderStatus: '',
orderStatusList: ['UNISSUE'],
orderStatusList: [],
startDate: '',
endDate: '',
page: 1,
@ -1272,7 +1327,7 @@ export default {
status: true,
fixed: '',
columnWidth: 60,
},
},
{
userId: this.$store.state.user.name,
functionId: 701001,
@ -1421,6 +1476,12 @@ export default {
materialModalFlag: false,
sobomData:{},
notifyNo:'',
// rqrq -
previewDialogVisible: false,
previewLoading: false,
pushLoading: false,
previewData: [],
currentNotifyRow: null,
}
},
@ -1465,7 +1526,7 @@ export default {
this.searchData.page = this.pageIndex
this.searchData.orderStatus = this.searchData.orderStatusList.join(',')
console.log("this.",this.searchData);
this.searchLoading = true
searchNotifyHeader(this.searchData)
.then(({ data }) => {
@ -1475,7 +1536,7 @@ export default {
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
console.log("this.dataList",this.dataList);
//
if (this.dataList.length > 0) {
//
@ -1528,7 +1589,7 @@ export default {
site: '',
orderNo: '',
orderType: '',
orderStatus: '草稿',
orderStatus: '',
requiredInboundDate: '',
supplierId: '',
supplierName: '',
@ -1666,7 +1727,7 @@ export default {
}
})
})
},
//
@ -1720,7 +1781,7 @@ export default {
//
inboundClickRow(row, column) {
console.log("row",row);
this.currentRow = JSON.parse(JSON.stringify(row))
//
this.getNotifyNoDetail()
@ -1845,7 +1906,7 @@ export default {
return false
}
}
this.notifyOrderData.partNo = row.partNo
this.notifyOrderData.orderNo = row.orderNo
this.notifyOrderData.itemNo = row.itemNo
@ -1929,12 +1990,12 @@ export default {
this.detailList = []
return
}
let inData = {
site: this.currentRow.site || localStorage.getItem('site'),
notifyNo: this.currentRow.notifyNo,
}
getNotifyNoDetail(inData).then(({ data }) => {
if (data.code === 0) {
this.detailList = data.rows || []
@ -2221,7 +2282,7 @@ export default {
this.materialModalFlag = true
searchNotifyMaterialList(row).then(({ data }) => {
if (data.code === 0) {
this.sobomList = data.rows
this.sobomList = data.rows
}
}).finally(() => {
this.bomLoadFlag = false
@ -2267,6 +2328,159 @@ export default {
this.authClose = !closeFlag
this.authIssue = !issueFlag
},
/**
* @Description 取消下达处理方法 - rqrq
* @param row 当前行数据
*/
cancelIssueShipmentHandle(row) {
// shipment - rqrq
let checkData = {
site: row.site,
username: row.username
}
checkUserHasUnissueShipment(checkData).then(({ data }) => {
if (data && data.code === 0) {
// - rqrq
if (data.row != null) {
this.$alert('该用户有未下达的申请单,请先处理', '提示', {
confirmButtonText: '确定'
})
return
}
// - rqrq
this.$confirm(`确定取消下达发货申请单【${row.notifyNo}】吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let cancelData = {
site: row.site,
notifyNo: row.notifyNo
}
cancelIssueShipment(cancelData).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success('取消下达成功')
// - rqrq
this.getDataList()
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
}).catch(() => {
this.$message.error('取消下达失败')
})
}).catch(() => {
// - rqrq
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
}).catch(() => {
this.$message.error('检查用户申请单失败')
})
},
/**
* @Description 预览库存发货通知单只考虑立库 - rqrq
* @param row 当前申请单行数据
*/
previewInventory(row) {
this.currentNotifyRow = row
this.previewDialogVisible = true
this.previewLoading = true
this.previewData = []
let inData = {
site: row.site,
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('获取库存预览失败')
})
},
/**
* @Description 推送至WCS发货通知单 - rqrq
*/
pushToWcs() {
if (!this.previewData || this.previewData.length === 0) {
this.$message.warning('没有可推送的数据')
return
}
// orderSatisfactionStatus === 1绿 - rqrq
const validData = this.previewData.filter(item => item.orderSatisfactionStatus === 1)
if (validData.length === 0) {
this.$message.warning('没有满足库存要求的订单,无法推送')
return
}
this.$confirm('确认推送至WCS?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.pushLoading = true
let pushData = {
site: this.currentNotifyRow.site,
notifyNo: this.currentNotifyRow.notifyNo,
shipmentInventoryList: this.previewData
}
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失败')
}).finally(() => {
this.pushLoading = false
})
}).catch(() => {
// - rqrq
})
},
/**
* @Description 表格行样式发货通知单绿色=满足红色=不满足 - rqrq
*/
getRowStyle({ row }) {
if (row.orderSatisfactionStatus === 1) {
return { backgroundColor: '#67C23A20' } // 绿
} else if (row.orderSatisfactionStatus === 3) {
return { backgroundColor: '#F56C6C20' } //
}
return {}
},
},
}
</script>
@ -2279,4 +2493,11 @@ export default {
height: auto;
line-height: 1.5;
}
/* rqrq - 匹配条码列自动换行显示 */
/deep/ .wrap-text-column .cell {
white-space: normal !important;
word-break: break-all !important;
line-height: 1.5 !important;
}
</style>
Loading…
Cancel
Save