Browse Source

重复代码

master
常熟吴彦祖 2 weeks ago
parent
commit
877e9eebe8
  1. 409
      src/views/modules/haianWarehouse/noOrderIssue/newNoOrderIssueNotify54.vue
  2. 499
      src/views/modules/haianWarehouse/poOrder/newPoIssueNotify54.vue
  3. 608
      src/views/modules/haianWarehouse/poOrder/searchPoIssureNotify54.vue
  4. 438
      src/views/modules/haianWarehouse/shipment/shipmentIssue54.vue
  5. 608
      src/views/modules/haianWarehouse/shipment/shipmentNotification54.vue
  6. 473
      src/views/modules/haianWarehouse/shopOrderIssueNotify/searchIssureNotify54.vue

409
src/views/modules/haianWarehouse/noOrderIssue/newNoOrderIssueNotify54.vue

@ -1490,44 +1490,6 @@ export default {
// 刷新当前标签页的表格数据
this.refreshCurrentTabTable()
},
refreshCurrentTabTable() {
if (this.notifyNo === '' || !this.notifyNo) {
return
}
if (this.activeName === 'sub') {
// 使用当前选中的行数据,如果没有则使用申请单基本信息
let queryData = {
site: this.notifyData.site || this.$store.state.user.site,
notifyNo: this.notifyNo,
orderType: 'shoporder',
}
// 如果当前行有数据,合并进去
if (
this.currentRow &&
this.currentRow !== '' &&
this.currentRow.notifyNo
) {
queryData = {
...this.currentRow,
orderType: 'shoporder',
}
}
this.dataListLoading = true
searchNotifyMaterialListNew(queryData)
.then(({ data }) => {
this.dataListLoading = false
if (data && data.code === 0) {
this.materialDetailList = data.rows
} else {
this.materialDetailList = []
}
})
.catch(() => {
this.dataListLoading = false
this.materialDetailList = []
})
}
},
materialDetailTableRowClassName({ row, rowIndex }) {
if (
row.qtyToIssueOriginal < row.qtyToIssue &&
@ -1608,119 +1570,6 @@ export default {
this.seqNoData.sWorkcenterno = val.work_center_no
}
},
getUserNotifyNo() {
let inData = {
site: this.$store.state.user.site,
username: this.$store.state.user.name,
}
this.getAllNotifyStatus()
getUserNoOrderNotifyNo(inData).then(({ data }) => {
if (data.code === 0) {
if (data.row != null) {
this.notifyNo = data.row.notifyNo
this.notifyData = data.row
this.getNotifyNoOrderDetail()
/* this.searchOtherPart('非BOM物料')
this.searchOtherPart('不管控物料') */
} else {
this.notifyNo = ''
this.notifyData = {
site: '',
bu: '',
notifyNo: '',
notifyDate: '',
enteredDate: '',
userName: '',
userDisplay: '',
remark: '',
planIssueDate: '',
}
this.dataList = []
}
} else {
this.notifyNo = ''
this.notifyData = {
site: '',
bu: '',
notifyNo: '',
notifyDate: '',
enteredDate: '',
userName: '',
userDisplay: '',
remark: '',
planIssueDate: '',
}
this.dataList = []
}
})
},
getNotifyNoOrderDetail() {
let inData = {
site: this.$store.state.user.site,
notifyNo: this.notifyNo,
}
getNotifyNoOrderDetail(inData).then(({ data }) => {
if (data.code === 0) {
this.dataList = data.rows
}
})
},
addNotify() {
//this.showAddNotifyTypeDialog = true
let inData = {
site: this.$store.state.user.site,
userName: this.$store.state.user.name,
orderType: 'otherOrder', // rqrq - 固定为shoporder类型
}
createNoOrderNotify(inData).then(({ data }) => {
if (data.code === 0) {
this.showAddNotifyTypeDialog = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {},
})
this.getUserNotifyNo()
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
},
confirmAddNotify() {
let outWorkOrderFlag = 'N'
if (this.selectedNotifyType === 'outsourced') {
outWorkOrderFlag = 'Y'
} else {
outWorkOrderFlag = 'N'
}
let inData = {
site: this.$store.state.user.site,
userName: this.$store.state.user.name,
outWorkOrderFlag: outWorkOrderFlag,
remark: this.selectedNotifyRemark,
orderType: 'otherOrder', // rqrq - 固定为shoporder类型
}
this.getAllNotifyStatus()
createNoOrderNotify(inData).then(({ data }) => {
if (data.code === 0) {
this.showAddNotifyTypeDialog = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {},
})
this.getUserNotifyNo()
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
},
chooseSOS(row) {
if (this.dataList.length > 0) {
//这边是有个判断的,判断派工单号不能重复
@ -1772,74 +1621,6 @@ export default {
this.chooseLoading = false
})
},
saveSOS() {
if (
this.notifyOrderData.needDate == null ||
this.notifyOrderData.needDate == ''
) {
this.$message.warning('请选择时间!')
return false
}
// if (
// this.notifyOrderData.issureQty == null ||
// this.notifyOrderData.issureQty == '' ||
// this.notifyOrderData.issureQty < 0
// ) {
// this.$message.warning('请填写领取数量!')
// return false
// }
let row = this.notifyOrderData
console.log('row', row, this.dataList)
if (this.dataList.length > 0) {
let stop = false
for (let i = 0; i < this.dataList.length; i++) {
if (
this.dataList[i].soorderNo == row.orderNo &&
this.dataList[i].releaseNo == row.releaseNo &&
this.dataList[i].sequenceNo == row.sequenceNo
) {
stop = true
}
}
if (stop) {
this.$alert('已经选择过此工单,请返回点击明细直接操作!!', '提示', {
confirmButtonText: '确定',
})
return false
}
}
this.$confirm('确定选择工单' + row.orderNo + '?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
let inData = {
site: this.$store.state.user.site,
notifyNo: this.notifyNo,
fgPartNo: row.partNo,
soorderNo: row.orderNo,
opsItemNo: row.itemNo,
sequenceNo: row.sequenceNo,
releaseNo: row.releaseNo,
needDate: row.needDate,
issureQty: row.issureQty,
}
saveSOIssueNotifyOrderList(inData).then(({ data }) => {
if (data.code === 0) {
this.saveSeqNoModalFlag = false
row.itemNo = data.itemNo
this.getNotifyNoOrderDetail()
this.enterSOS(row)
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
})
},
qtyAllForSeqNo() {
this.notifyOrderData.issureQty = this.notifyOrderData.qtyRequired
},
@ -1861,38 +1642,6 @@ export default {
//this.searchNotifyMaterialList(rows)
this.enterSOS(rows)
},
enterSOS(row) {
console.log('row', row)
this.seqNoModalFlag = false
this.materialModalFlag = true
this.sobomList = []
this.sobomData = {
orderNo: row.orderNo,
seqNo: row.seqNo,
partNo: row.partNo,
}
this.bomLoadFlag = true
let inData = {
site: this.$store.state.user.site,
notifyNo: this.notifyNo,
partNo: row.partNo,
itemNo: row.itemNo,
}
getNoOrderMaterialList(inData).then(({ data }) => {
this.bomLoadFlag = false
if (data.code === 0) {
this.sobomList = data.rows
for (let i = 0; i < this.sobomList.length; i++) {
this.sobomList[i].itemNo = inData.itemNo
/* if(!this.sobomList[i].qtyToIssue){
this.$set(this.sobomList[i], 'qtyToIssue', this.sobomList[i].qtyRequired)
} */
}
}
})
},
// 从申请明细弹框打开选择物料弹框
openSelectMaterialModalForDetail() {
this.isMaterialDetailModal = true
@ -2955,85 +2704,6 @@ export default {
this.$message.success('操作成功')
},
saveNoOrderMaterialDetail() {
for (let i = 0; i < this.sobomList.length; i++) {
if (
this.sobomList[i].qtyToIssue === '' ||
this.sobomList[i].qtyToIssue == null
) {
this.$message.warning('第'+(i+1)+'行数量为空,请填写申请数量!')
return false
}
this.sobomList[i].notifyNo = this.notifyNo
this.sobomList[i].site = this.$store.state.user.site
}
let materialList = this.sobomList.filter((item) => item.qtyToIssue > 0)
if (materialList.length == 0) {
this.$alert('没有需要保存的内容!', '提示', {
confirmButtonText: '确定',
})
return false
}
console.log('this.sobomList', materialList)
saveNoOrderMaterialDetail(materialList).then(({ data }) => {
if (data.code === 0) {
this.materialModalFlag = false
this.$message.success('操作成功')
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
},
saveNewSoIssueNotify() {
for (let i = 0; i < this.seqNoList.length; i++) {
if (
this.seqNoList[i].applyQty === '' ||
this.seqNoList[i].applyQty == null
) {
this.$message.warning('第'+(i+1)+'行数量为空,请填写申请数量!')
return false
}
this.seqNoList[i].notifyNo = this.notifyNo
this.seqNoList[i].site = this.$store.state.user.site
this.seqNoList[i].componentPartNo = this.seqNoList[i].partNo
}
let materialList = this.seqNoList.filter((item) => item.applyQty > 0)
if (materialList.length == 0) {
this.$alert('没有需要保存的内容!', '提示', {
confirmButtonText: '确定',
})
return false
}
console.log('this.sobomList', materialList)
var savaNotify = {
site: this.$store.state.user.site,
notifyNo: this.notifyNo,
userName: this.$store.state.user.name,
orderType:this.orderType,
materialList: materialList,
}
this.saveNewLoading = true
saveNoOrderNotify(savaNotify)
.then(({ data }) => {
if (data.code === 0) {
this.seqNoModalFlag = false
// 清空已添加订单记录 - rqrq
this.addedOrderNoList = []
this.remark = ''
this.getUserNotifyNo()
this.$message.success('操作成功')
} else {
this.$message.error(data.msg)
}
})
.finally(() => {
this.saveNewLoading = false
})
},
//导出excel
async createExportData() {
@ -3102,41 +2772,6 @@ export default {
// 打开弹框
this.showXiadaNotifyDialog = true
},
confirmXiadaNotify() {
if (this.dataList.length == 0) {
this.$alert('没有明细记录无法下达!!', '提示', {
confirmButtonText: '确定',
})
return false
}
// 验证要求发料时间
if (
!this.xiadaNotifyData.planIssueDate ||
this.xiadaNotifyData.planIssueDate === ''
) {
this.$message.warning('请选择要求发料时间!')
return false
}
// 准备下达数据
const notifyData = {
...this.notifyData,
planIssueDate: this.xiadaNotifyData.planIssueDate,
remark: this.xiadaNotifyData.remark,
}
// 执行下达操作
xiadaNotify(notifyData).then(({ data }) => {
if (data.code === 0) {
this.showXiadaNotifyDialog = false
this.xiadaModelFlag = false
this.getUserNotifyNo()
this.$message.success('操作成功')
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
},
saveOtherPart() {
// if (
// this.otherPartData.qtyToIssue == null ||
@ -3173,24 +2808,6 @@ export default {
})
})
},
deleteNotify() {
if (this.dataList.length > 0) {
this.$alert('请先删除已经申请的明细记录!!', '提示', {
confirmButtonText: '确定',
})
return false
}
deleteNotify(this.notifyData).then(({ data }) => {
if (data.code === 0) {
this.getUserNotifyNo()
this.$message.success(data.msg)
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
},
searchOtherPart(type) {
let inData = {
site: this.notifyData.site,
@ -3208,32 +2825,6 @@ export default {
}
})
},
// 删除
deleteNotifySOS(row) {
this.$confirm(`是否删除这个工单的申请信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
deleteNotifySOS(row).then(({ data }) => {
if (data && data.code === 0) {
this.getNotifyNoOrderDetail()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {},
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
})
.catch(() => {})
},
//获取按钮的权限数据
getButtonAuthData() {

499
src/views/modules/haianWarehouse/poOrder/newPoIssueNotify54.vue

@ -1378,44 +1378,6 @@ export default {
// 刷新当前标签页的表格数据
this.refreshCurrentTabTable()
},
refreshCurrentTabTable() {
if (this.notifyNo === '' || !this.notifyNo) {
return
}
if (this.activeName === 'sub') {
// 使用当前选中的行数据,如果没有则使用申请单基本信息
let queryData = {
site: this.notifyData.site || this.$store.state.user.site,
notifyNo: this.notifyNo,
orderType: 'shoporder',
}
// 如果当前行有数据,合并进去
if (
this.currentRow &&
this.currentRow !== '' &&
this.currentRow.notifyNo
) {
queryData = {
...this.currentRow,
orderType: 'shoporder',
}
}
this.dataListLoading = true
searchNotifyMaterialListNew(queryData)
.then(({ data }) => {
this.dataListLoading = false
if (data && data.code === 0) {
this.materialDetailList = data.rows
} else {
this.materialDetailList = []
}
})
.catch(() => {
this.dataListLoading = false
this.materialDetailList = []
})
}
},
materialDetailTableRowClassName({ row, rowIndex }) {
if (
row.qtyToIssueOriginal < row.qtyToIssue &&
@ -1483,119 +1445,6 @@ export default {
this.seqNoData.sWorkcenterno = val.work_center_no
}
},
getUserNotifyNo() {
let inData = {
site: this.$store.state.user.site,
username: this.$store.state.user.name,
orderType: 'poorder', // rqrq - 查询poorder类型的申请单
}
this.getAllNotifyStatus()
getUserNotifyNo(inData).then(({ data }) => {
if (data.code === 0) {
if (data.row != null) {
this.notifyNo = data.row.notifyNo
this.notifyData = data.row
this.getNotifyPoDetail()
} else {
this.notifyNo = ''
this.notifyData = {
site: '',
bu: '',
notifyNo: '',
notifyDate: '',
enteredDate: '',
userName: '',
userDisplay: '',
remark: '',
planIssueDate: '',
}
this.dataList = []
}
} else {
this.notifyNo = ''
this.notifyData = {
site: '',
bu: '',
notifyNo: '',
notifyDate: '',
enteredDate: '',
userName: '',
userDisplay: '',
remark: '',
planIssueDate: '',
}
this.dataList = []
}
})
},
getNotifyPoDetail() {
let inData = {
site: this.$store.state.user.site,
notifyNo: this.notifyNo,
orderType: 'poorder',
}
getNotifyPoDetail(inData).then(({ data }) => {
if (data.code === 0) {
this.dataList = data.rows
}
})
},
addNotify() {
//this.showAddNotifyTypeDialog = true
let inData = {
site: this.$store.state.user.site,
userName: this.$store.state.user.name,
orderType: 'poorder', // rqrq - 固定为shoporder类型
}
createNotify(inData).then(({ data }) => {
if (data.code === 0) {
this.showAddNotifyTypeDialog = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {},
})
this.getUserNotifyNo()
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
},
confirmAddNotify() {
let outWorkOrderFlag = 'N'
if (this.selectedNotifyType === 'outsourced') {
outWorkOrderFlag = 'Y'
} else {
outWorkOrderFlag = 'N'
}
let inData = {
site: this.$store.state.user.site,
userName: this.$store.state.user.name,
outWorkOrderFlag: outWorkOrderFlag,
remark: this.selectedNotifyRemark,
orderType: 'shoporder', // rqrq - 固定为shoporder类型
}
this.getAllNotifyStatus()
createNotify(inData).then(({ data }) => {
if (data.code === 0) {
this.showAddNotifyTypeDialog = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {},
})
this.getUserNotifyNo()
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
},
chooseSOS(row) {
if (this.dataList.length > 0) {
//这边是有个判断的,判断派工单号不能重复
@ -1647,130 +1496,12 @@ export default {
this.chooseLoading = false
})
},
saveSOS() {
if (
this.notifyOrderData.needDate == null ||
this.notifyOrderData.needDate == ''
) {
this.$message.warning('请选择时间!')
return false
}
// if (
// this.notifyOrderData.issureQty == null ||
// this.notifyOrderData.issureQty == '' ||
// this.notifyOrderData.issureQty < 0
// ) {
// this.$message.warning('请填写领取数量!')
// return false
// }
let row = this.notifyOrderData
console.log('row', row, this.dataList)
if (this.dataList.length > 0) {
let stop = false
for (let i = 0; i < this.dataList.length; i++) {
if (
this.dataList[i].soorderNo == row.orderNo &&
this.dataList[i].releaseNo == row.releaseNo &&
this.dataList[i].sequenceNo == row.sequenceNo
) {
stop = true
}
}
if (stop) {
this.$alert('已经选择过此工单,请返回点击明细直接操作!!', '提示', {
confirmButtonText: '确定',
})
return false
}
}
this.$confirm('确定选择工单' + row.orderNo + '?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
let inData = {
site: this.$store.state.user.site,
notifyNo: this.notifyNo,
fgPartNo: row.partNo,
soorderNo: row.orderNo,
opsItemNo: row.itemNo,
sequenceNo: row.sequenceNo,
releaseNo: row.releaseNo,
needDate: row.needDate,
issureQty: row.issureQty,
}
saveSOIssueNotifyOrderList(inData).then(({ data }) => {
if (data.code === 0) {
this.saveSeqNoModalFlag = false
row.itemNo = data.itemNo
this.getNotifyPoDetail()
this.enterSOS(row)
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
})
},
qtyAllForSeqNo() {
this.notifyOrderData.issureQty = this.notifyOrderData.qtyRequired
},
qtyAllForBom(row) {
row.qtyToIssue = row.qtyRequired
},
enterSOSDetail(row) {
let rows = {
site: this.$store.state.user.site,
notifyNo: this.notifyNo,
orderNo: row.soorderNo,
seqNo: row.seqNo,
partNo: row.fgPartNo,
itemNo: row.itemNo,
releaseNo: row.releaseNo,
sequenceNo: row.sequenceNo,
}
//this.searchNotifyMaterialList(rows)
this.enterSOS(rows)
},
enterSOS(row) {
console.log('row', row)
this.seqNoModalFlag = false
this.materialModalFlag = true
this.sobomList = []
this.sobomData = {
orderNo: row.orderNo,
seqNo: row.seqNo,
partNo: row.partNo,
}
this.bomLoadFlag = true
let inData = {
site: this.$store.state.user.site,
notifyNo: this.notifyNo,
orderNo: row.orderNo,
releaseNo: row.releaseNo,
sequenceNo: row.sequenceNo,
partNo: row.partNo,
itemNo: row.itemNo,
}
getSOSBOMForIssureNew(inData).then(({ data }) => {
this.bomLoadFlag = false
if (data.code === 0) {
this.sobomList = data.rows
for (let i = 0; i < this.sobomList.length; i++) {
this.sobomList[i].itemNo = inData.itemNo
/* if(!this.sobomList[i].qtyToIssue){
this.$set(this.sobomList[i], 'qtyToIssue', this.sobomList[i].qtyRequired)
} */
}
}
})
},
chooseSOSModal() {
this.seqNoData = {
@ -1789,74 +1520,6 @@ export default {
this.seqNoList = []
this.seqNoModalFlag = true
},
searchSOSRouting() {
if (this.seqNoData.orderNo == null || this.seqNoData.orderNo == '') {
this.$message.warning('请输入OrderNo!')
return false
}
// 初始化seqNoList如果不存在
if (!this.seqNoList) {
this.seqNoList = []
}
// 调用接口前判断this.seqNoList是否存在orderNo
const orderNoExists = this.seqNoList.some(
(row) => row.orderNo === this.seqNoData.orderNo
)
if (orderNoExists) {
this.$message.warning('该OrderNo的数据已存在,请先删除再添加!')
return false
}
const dataListExists = this.dataList.some(
(row) => row.soorderNo === this.seqNoData.orderNo
)
if (dataListExists) {
this.$message.warning('该OrderNo的数据已添加过,请先删除再添加!')
return false
}
if (this.seqNoModalLoading) {
console.log("正在加载中,防重复提交");
return;
}
this.seqNoModalLoading = true
let params = {
site: this.$store.state.user.site+'%',
outsourcingNo: this.seqNoData.orderNo,
}
console.log("params", params);
getShopOrderAndMaterialByShoporder(params)
.then(({ data }) => {
if (data.code === 0) {
if (!data.rows || data.rows.length === 0) {
this.$message.warning('未查询到数据!')
return
}
// 将返回的数据添加到this.seqNoList中,而不是替换
data.rows.forEach((newRow) => {
// 初始化每行的需求数量(需求数量 - 已发数量 - 预留数量)
const qtyRequired = parseFloat(newRow.qtyRequired) || 0
const qtyIssued = parseFloat(newRow.qtyIssued) || 0
const reservedQty = parseFloat(newRow.reservedQty) || 0
const applyQty = qtyRequired - qtyIssued - reservedQty
this.$set(newRow, 'applyQty', applyQty > 0 ? applyQty : 0)
// 添加到列表中
this.seqNoList.push(newRow)
})
this.$message.success(`成功添加 ${data.rows.length} 条数据`)
} else {
this.$message.error(data.msg)
}
})
.catch((e) => {
this.$message.error(e.msg || '查询失败')
return
})
.finally(() => {
this.seqNoModalLoading = false
})
},
deleteSeqNoByOrderNo() {
if (this.seqNoData.orderNo == null || this.seqNoData.orderNo == '') {
this.$message.warning('请输入OrderNo!')
@ -1894,78 +1557,6 @@ export default {
// 用户取消删除
})
},
saveMaterialDetail() {
for (let i = 0; i < this.sobomList.length; i++) {
if (
this.sobomList[i].applyQty === '' ||
this.sobomList[i].applyQty == null
) {
this.sobomList[i].applyQty = 0
}
this.sobomList[i].notifyNo = this.notifyNo
this.sobomList[i].site = this.$store.state.user.site
}
let materialList = this.sobomList.filter((item) => item.qtyToIssue > 0)
if (materialList.length == 0) {
this.$alert('没有需要保存的内容!', '提示', {
confirmButtonText: '确定',
})
return false
}
console.log('this.sobomList', materialList)
saveMaterialDetail(materialList).then(({ data }) => {
if (data.code === 0) {
this.materialModalFlag = false
this.$message.success('操作成功')
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
},
saveNewSoIssueNotify() {
for (let i = 0; i < this.seqNoList.length; i++) {
if (
this.seqNoList[i].applyQty === '' ||
this.seqNoList[i].applyQty == null
) {
this.seqNoList[i].applyQty = 0
}
this.seqNoList[i].notifyNo = this.notifyNo
this.seqNoList[i].site = this.$store.state.user.site
}
let materialList = this.seqNoList.filter((item) => item.applyQty > 0)
if (materialList.length == 0) {
this.$alert('没有需要保存的内容!', '提示', {
confirmButtonText: '确定',
})
return false
}
console.log('this.sobomList', materialList)
var savaNotify = {
site: this.$store.state.user.site,
notifyNo: this.notifyNo,
userName: this.$store.state.user.name,
materialList: materialList,
}
this.saveNewLoading = true
saveNewSoIssueNotify(savaNotify)
.then(({ data }) => {
if (data.code === 0) {
this.seqNoModalFlag = false
this.getUserNotifyNo()
this.$message.success('操作成功')
} else {
this.$message.error(data.msg)
}
})
.finally(() => {
this.saveNewLoading = false
})
},
//导出excel
async createExportData() {
@ -2034,41 +1625,6 @@ export default {
// 打开弹框
this.showXiadaNotifyDialog = true
},
confirmXiadaNotify() {
if (this.dataList.length == 0) {
this.$alert('没有明细记录无法下达!!', '提示', {
confirmButtonText: '确定',
})
return false
}
// 验证要求发料时间
if (
!this.xiadaNotifyData.planIssueDate ||
this.xiadaNotifyData.planIssueDate === ''
) {
this.$message.warning('请选择要求发料时间!')
return false
}
// 准备下达数据
const notifyData = {
...this.notifyData,
planIssueDate: this.xiadaNotifyData.planIssueDate,
remark: this.xiadaNotifyData.remark,
}
// 执行下达操作
xiadaNotify(notifyData).then(({ data }) => {
if (data.code === 0) {
this.showXiadaNotifyDialog = false
this.xiadaModelFlag = false
this.getUserNotifyNo()
this.$message.success('操作成功')
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
},
saveOtherPart() {
// if (
// this.otherPartData.qtyToIssue == null ||
@ -2105,24 +1661,6 @@ export default {
})
})
},
deleteNotify() {
if (this.dataList.length > 0) {
this.$alert('请先删除已经申请的明细记录!!', '提示', {
confirmButtonText: '确定',
})
return false
}
deleteNotify(this.notifyData).then(({ data }) => {
if (data.code === 0) {
this.getUserNotifyNo()
this.$message.success(data.msg)
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
},
searchOtherPart(type) {
let inData = {
site: this.notifyData.site,
@ -2155,32 +1693,6 @@ export default {
this.$refs.walUploadExcel.init(data)
})
},
// 删除
deleteNotifySOS(row) {
this.$confirm(`是否删除这个工单的申请信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
deleteNotifySOS(row).then(({ data }) => {
if (data && data.code === 0) {
this.getNotifyPoDetail()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {},
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
})
.catch(() => {})
},
//获取按钮的权限数据
getButtonAuthData() {
@ -2196,17 +1708,6 @@ export default {
},
searchTable() {},
getAllNotifyStatus() {
let inData = {
site: this.$store.state.user.site,
listName: 'ISSUENOTIFYHEADER_STATUS',
locale: this.$i18n.locale,
}
getAllNotifyStatus(inData).then(({ data }) => {
this.notifyStatusList = data
console.log('notifyStatusList', this.notifyStatusList)
})
},
async getTableUserColumn(tableId, columnId) {
let queryTableUser = {
userId: this.$store.state.user.name,

608
src/views/modules/haianWarehouse/poOrder/searchPoIssureNotify54.vue

@ -1690,337 +1690,12 @@ export default {
this.currentRow = JSON.parse(JSON.stringify(row));
this.refreshCurrentTabTable ();
},
refreshCurrentTabTable(){
if(this.currentRow===''||this.currentRow===null){
this.currentRow={site:'',notifyNo:'',orderType:'shoporder'}
}
// rqrq - 添加orderType参数
let queryData = {
...this.currentRow,
orderType: 'shoporder'
}
if(this.activeName==='detail'){
searchNotifyOrderListNew(queryData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code == 0) {
this.dataList2 = data.rows
} else {
this.dataList2 = [];
}
});
}else if(this.activeName==='sub'){
searchNotifyMaterialListNew(queryData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code == 0) {
this.dataList3 = data.rows
} else {
this.dataList3 = [];
}
});
}else if(this.activeName==='change'){
searchNotifyLogNew(queryData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code == 0) {
this.dataList5 = data.rows
} else {
this.dataList5 = [];
}
});
}else if(this.activeName==='close'){
searchNotifyLogCloseNew(queryData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code == 0) {
this.dataList6 = data.rows
} else {
this.dataList6 = [];
}
});
}else if(this.activeName==='labelDetail'){ // rqrq - 预定标签清单页签 - rqrq
searchMaterialListDetail(queryData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code == 0) {
this.dataList7 = data.rows
} else {
this.dataList7 = [];
}
});
}else {
searchSumNotifyMaterialListNew(queryData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code == 0) {
this.dataList4 = data.rows
} else {
this.dataList4 = [];
}
});
}
},
searchTable(){
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
searchNotifyHeaderNew(this.searchData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code == 0) {
this.dataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
} else {
this.dataList = [];
}
});
},
closeNotifyModel(row){
this.closeData.site=row.site
this.closeData.notifyNo=row.notifyNo
this.closeData.closeRemark=''
this.closeModalFlag=true
},
closeNotify(){
if(this.closeData.closeRemark==null||this.closeData.closeRemark===''){
this.$alert("必须输入关闭原因", '错误', {
confirmButtonText: '确定'
})
return false;
}
let inData={
site:this.closeData.site,
notifyNo:this.closeData.notifyNo,
closeRemark:this.closeData.closeRemark,
username:this.$store.state.user.name,
status:'CLOSED',
}
updateNotifyStatusNew(inData).then(({data}) => {
if (data && data.code === 0) {
this.closeModalFlag=false
this.searchTable()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
openNotify(row){
this.$confirm('确认打开?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let inData={
site:row.site,
notifyNo:row.notifyNo,
status:'ISSUE',
}
updateNotifyStatusNew(inData).then(({data}) => {
if (data && data.code === 0) {
this.searchTable()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
})
},
// 预览库存匹配情况
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
// )
//全部推送 后端判断
const validData = this.previewData
if (validData.length === 0) {
this.$message.warning('没有可推送的数据(只推送绿色和黄色状态的数据)')
return
}
this.$confirm(`确认推送 ${validData.length} 条数据至WCS?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// 显示加载状态 - rqrq
this.previewLoading = true
const inData = {
site: this.currentRow.site,
notifyNo: this.currentRow.notifyNo,
inventoryList: validData
}
pushInventoryToWcs(inData).then(({data}) => {
this.previewLoading = false
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((error) => {
this.previewLoading = false
this.$message.error(error.message || '推送WCS失败,请重试')
})
}).catch(() => {
// 用户取消操作 - rqrq
console.log('用户取消推送')
})
},
pushToWcs(row){
this.$confirm('确认推送到WCS?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let inData={
site: row.site,
notifyNo: row.notifyNo
}
pushNotifyToWcs(inData).then(({data}) => {
if (data && data.code === 0) {
this.searchTable()
this.$message({
message: '推送WCS成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
})
},
/**
* @Description 取消下达处理方法 - rqrq
* @param row 当前行数据
*/
cancelIssueNotifyHandle(row) {
// 先判断发起人是否有未下达的shoporder申请单 - rqrq
let checkData = {
site: row.site,
username: row.username
}
checkUserHasUnissueShopOrder(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
}
cancelIssueNotify(cancelData).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success('取消下达成功')
// 重新加载数据 - rqrq
this.searchTable()
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
}).catch(() => {
this.$message.error('取消下达失败')
})
}).catch(() => {
// 用户取消操作 - rqrq
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
}).catch(() => {
this.$message.error('检查用户申请单失败')
})
},
deleteNotifyMaterial(row){
this.$confirm('确认删除?', '提示', {
@ -2045,29 +1720,6 @@ export default {
})
})
},
deleteNotifySOSPlus(row){
this.$confirm('确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteNotifySOSPlus(row).then(({data}) => {
if (data && data.code === 0) {
this.refreshCurrentTabTable()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
})
},
// 进入工单物料明细
enterSOSDetail(row) {
let rows = {
@ -2082,78 +1734,10 @@ export default {
}
this.enterSOS(rows)
},
// 打开物料明细对话框
enterSOS(row) {
this.materialModalFlag = true
this.sobomList = []
this.sobomData = {
orderNo: row.orderNo,
seqNo: row.seqNo,
partNo: row.partNo,
}
this.bomLoadFlag = true
let inData = {
site: this.currentRow.site || this.$store.state.user.site,
notifyNo: this.currentRow.notifyNo,
orderNo: row.orderNo,
releaseNo: row.releaseNo,
sequenceNo: row.sequenceNo,
partNo: row.partNo,
itemNo: row.itemNo,
}
getSOSBOMForIssureNew(inData).then(({ data }) => {
this.bomLoadFlag = false
if (data.code === 0) {
this.sobomList = data.rows
for (let i = 0; i < this.sobomList.length; i++) {
this.sobomList[i].itemNo = inData.itemNo
}
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
}).catch(() => {
this.bomLoadFlag = false
this.$message.error('获取物料明细失败')
})
},
// 全数领料
qtyAllForBom(row) {
row.qtyToIssue = row.qtyRequired
},
// 保存物料明细
saveMaterialDetail() {
for (let i = 0; i < this.sobomList.length; i++) {
if (
this.sobomList[i].qtyToIssue === '' ||
this.sobomList[i].qtyToIssue == null
) {
this.sobomList[i].qtyToIssue = 0
}
this.sobomList[i].notifyNo = this.currentRow.notifyNo
this.sobomList[i].site = this.currentRow.site || this.$store.state.user.site
}
let materialList = this.sobomList.filter((item) => item.qtyToIssue > 0)
if (materialList.length == 0) {
this.$alert('没有需要保存的内容!', '提示', {
confirmButtonText: '确定',
})
return false
}
saveMaterialDetail(materialList).then(({ data }) => {
if (data.code === 0) {
this.materialModalFlag = false
this.refreshCurrentTabTable()
this.$message.success('操作成功')
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
},
// 处理材料明细行双击事件
handleMaterialRowDblClick(row) {
@ -2172,63 +1756,6 @@ export default {
}
this.editMaterialModalFlag = true
},
// 保存编辑的材料明细
saveEditMaterialDetail() {
if (this.editMaterialData.qtyToIssue === null || this.editMaterialData.qtyToIssue === '') {
this.$alert('申请数量不能为空!', '提示', {
confirmButtonText: '确定',
})
return false
}
if (this.editMaterialData.qtyToIssue < 0) {
this.$alert('申请数量不能小于0!', '提示', {
confirmButtonText: '确定',
})
return false
}
// 使用完整的行数据,只更新申请数量
let materialData = {
...this.editMaterialData,
}
// 确保申请数量不为空
if (materialData.qtyToIssue === '' || materialData.qtyToIssue == null) {
materialData.qtyToIssue = 0
}
updateMaterialDetail(materialData).then(({ data }) => {
if (data.code === 0) {
this.editMaterialModalFlag = false
this.refreshCurrentTabTable()
this.$message.success('保存成功')
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
}).catch(() => {
this.$message.error('保存失败')
})
},
//导出excel - rqrq
async createExportData() {
const queryParams = {
...this.searchData,
limit: 999999, // 设置一个很大的数字来获取全部数据 - rqrq
page: 1
}
const {data} = await searchNotifyHeaderNew(queryParams)
if (data && data.code === 0) {
return data.page.list || []
}
return []
},
startDownload() {
// this.exportData = this.dataList
@ -2259,17 +1786,6 @@ export default {
return ''
},
/**
* 统一构建海安查询入参,强制使用登录用户site避免跨站点串单 - rqrq
*/
haiAnBuildQueryData (row) {
const baseRow = row || {}
return {
...baseRow,
site: this.$store.state.user.site,
orderType: 'shoporder'
}
},
/**
* 海安标签页签补充追踪列,领料栈板固定放最后一列便于对账 - rqrq
*/
haiAnEnsureLabelColumns () {
@ -2366,25 +1882,6 @@ export default {
this.dataList4 = data && data.code === 0 ? (data.rows || []) : []
})
}
},
/**
* 海安主表查询改为海安接口,固定传登录站点并保留分页语义 - rqrq
*/
searchTable () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
this.searchData.site = this.$store.state.user.site
this.searchData.orderType = 'poorder'
haiAnSearchNotifyHeaderNew(this.searchData).then(({ data }) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
return
}
this.dataList = []
})
},
/**
* 海安关闭申请单,保持旧页面的必填关闭原因校验与提示语义 - rqrq
@ -2902,54 +2399,6 @@ export default {
this.noOrderAllocSaving = false
})
},
/**
* 海安取消下达流程:先检查未下达冲突,再执行取消并刷新列表 - rqrq
*/
cancelIssueNotifyHandle (row) {
const checkData = {
site: this.$store.state.user.site,
username: row.username
}
haiAnCheckUserHasUnissueShopOrder(checkData).then(({ data }) => {
if (data && data.code === 0) {
if (data.row != null) {
this.$alert('该用户有未下达的申请单,请先处理', '提示', {
confirmButtonText: '确定'
})
return
}
this.$confirm(`确定取消下达申请单【${row.notifyNo}】吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const cancelData = {
site: this.$store.state.user.site,
notifyNo: row.notifyNo
}
haiAnCancelIssueNotify(cancelData).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success('取消下达成功')
this.searchTable()
return
}
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}).catch(() => {
this.$message.error('取消下达失败')
})
})
return
}
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}).catch(() => {
this.$message.error('检查用户申请单失败')
})
},
/**
* 未推送领料单整单删除。确认后把订单、物料、标签明细和指定物料一起删掉 - rqrq
*/
@ -3017,46 +2466,6 @@ export default {
})
})
})
},
/**
* 海安查看页物料弹窗查询,按海安接口回显已保存数量并透传subsite - rqrq
*/
enterSOS (row) {
this.materialModalFlag = true
this.sobomList = []
this.sobomData = {
orderNo: row.orderNo,
seqNo: row.seqNo,
partNo: row.partNo,
subSite: row.subSite
}
this.bomLoadFlag = true
const inData = {
site: this.$store.state.user.site,
notifyNo: this.currentRow.notifyNo,
orderNo: row.orderNo,
releaseNo: row.releaseNo,
sequenceNo: row.sequenceNo,
partNo: row.partNo,
itemNo: row.itemNo
}
haiAnGetSOSBOMForIssureNew(inData).then(({ data }) => {
this.bomLoadFlag = false
if (data && data.code === 0) {
this.sobomList = data.rows || []
for (let i = 0; i < this.sobomList.length; i++) {
this.sobomList[i].itemNo = inData.itemNo
this.sobomList[i].subSite = row.subSite
}
return
}
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}).catch(() => {
this.bomLoadFlag = false
this.$message.error('获取物料明细失败')
})
},
/**
* 海安保存材料明细走海安先删后存链路,并透传subsite防止跨子站点串单 - rqrq
@ -3126,23 +2535,6 @@ export default {
}).catch(() => {
this.$message.error('保存失败')
})
},
/**
* 海安导出数据改为海安主查询接口,确保导出内容来自海安表链路 - rqrq
*/
async createExportData () {
const queryParams = {
...this.searchData,
site: this.$store.state.user.site,
orderType: 'poorder',
limit: 999999,
page: 1
}
const { data } = await haiAnSearchNotifyHeaderNew(queryParams)
if (data && data.code === 0) {
return data.page.list || []
}
return []
},
/**
* 委外发料查看页参数:固定orderType=poorder,保证主子表查询口径一致 - rqrq

438
src/views/modules/haianWarehouse/shipment/shipmentIssue54.vue

@ -1501,114 +1501,6 @@ export default {
this.seqNoData.sWorkcenterno = val.work_center_no
}
},
getUserNotifyNo() {
let inData = {
site: this.$store.state.user.site,
username: this.$store.state.user.name,
}
this.getAllNotifyStatus()
getUserNotifyNo(inData).then(({ data }) => {
if (data.code === 0) {
if (data.row != null) {
this.notifyNo = data.row.notifyNo
this.notifyData = data.row
this.getNotifyNoDetail()
} else {
this.notifyNo = ''
this.notifyData = {
site: '',
bu: '',
notifyNo: '',
notifyDate: '',
enteredDate: '',
userName: '',
userDisplay: '',
remark: '',
planIssueDate: '',
}
this.dataList = []
}
} else {
this.notifyNo = ''
this.notifyData = {
site: '',
bu: '',
notifyNo: '',
notifyDate: '',
enteredDate: '',
userName: '',
userDisplay: '',
remark: '',
planIssueDate: '',
}
this.dataList = []
}
})
},
getNotifyNoDetail() {
let inData = {
site: this.$store.state.user.site,
notifyNo: this.notifyNo,
}
getNotifyNoDetail(inData).then(({ data }) => {
if (data.code === 0) {
this.dataList = data.rows
}
})
},
addNotify() {
let inData = {
site: this.$store.state.user.site,
userName: this.$store.state.user.name,
}
createNotify(inData).then(({ data }) => {
if (data.code === 0) {
this.showAddNotifyTypeDialog = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {},
})
this.getUserNotifyNo()
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
},
confirmAddNotify() {
let outWorkOrderFlag = 'N'
if (this.selectedNotifyType === 'outsourced') {
outWorkOrderFlag = 'Y'
} else {
outWorkOrderFlag = 'N'
}
let inData = {
site: this.$store.state.user.site,
userName: this.$store.state.user.name,
outWorkOrderFlag: outWorkOrderFlag,
remark: this.selectedNotifyRemark,
}
this.getAllNotifyStatus()
createNotify(inData).then(({ data }) => {
if (data.code === 0) {
this.showAddNotifyTypeDialog = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {},
})
this.getUserNotifyNo()
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
},
chooseSOS(row) {
if (this.dataList.length > 0) {
//这边是有个判断的,判断shipmentId不能重复
@ -1654,178 +1546,12 @@ export default {
this.chooseLoading = false
})
},
saveNewSoIssueNotify() {
for (let i = 0; i < this.seqNoList.length; i++) {
if (
this.seqNoList[i].qtyToApply === '' ||
this.seqNoList[i].qtyToApply == null
) {
this.seqNoList[i].qtyToApply = 0
}
this.seqNoList[i].notifyNo = this.notifyNo
this.seqNoList[i].site = this.$store.state.user.site
}
let materialList = this.seqNoList.filter((item) => item.qtyToApply > 0)
if (materialList.length == 0) {
this.$alert('没有需要保存的内容!', '提示', {
confirmButtonText: '确定',
})
return false
}
console.log('this.sobomList', materialList)
var savaNotify = {
site: this.$store.state.user.site,
notifyNo: this.notifyNo,
userName: this.$store.state.user.name,
materialList: materialList,
}
this.saveNewLoading = true
saveNewShipmentAndLine(savaNotify).then(({ data }) => {
if (data.code === 0) {
this.seqNoModalFlag = false
this.getUserNotifyNo()
this.$message.success('操作成功')
} else {
this.$message.error(data.msg)
}
}).finally(() => {
this.saveNewLoading = false
})
},
saveSOS() {
if (
this.notifyOrderData.needDate == null ||
this.notifyOrderData.needDate == ''
) {
this.$message.warning('请选择时间!')
return false
}
let row = this.notifyOrderData
console.log('row', row)
if (this.dataList.length > 0) {
let stop = false
for (let i = 0; i < this.dataList.length; i++) {
if (this.dataList[i].soorderNo == row.orderNo) {
stop = true
}
}
if (stop) {
this.$alert(
'已经选择过此SHIPMENT,请返回点击明细直接操作!!',
'提示',
{
confirmButtonText: '确定',
}
)
return false
}
}
this.$confirm('确定选择SHIPMENT' + row.orderNo + '?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
let inData = {
site: this.$store.state.user.site,
notifyNo: this.notifyNo,
fgpartNo: row.partNo,
soorderNo: row.orderNo,
opsItemNo: row.itemNo,
seqNo: row.seqNo,
locationNo: row.locationNo,
needDate: row.needDate + ' 00:00',
unissureQty: row.unissureQty,
}
saveShipmentOrderList(inData).then(({ data }) => {
if (data.code === 0) {
this.saveSeqNoModalFlag = false
;(() => {
// 同步代码块:赋值操作在此完成
row.itemNo = data.itemNo
})()
this.getNotifyNoDetail()
this.enterSOS(row)
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
})
},
qtyAllForSeqNo() {
this.notifyOrderData.unissureQty = this.notifyOrderData.qtyRequired
},
qtyAllForBom(row) {
row.qtyToIssue = row.qtyRequired
},
enterSOSDetail(row) {
let rows = {
site: this.$store.state.user.site,
notifyNo: this.notifyNo,
soorderNo: row.soorderNo,
seqNo: row.seqNo,
partNo: row.fgpartNo,
itemNo: row.itemNo,
}
this.sobomData.orderNo = rows.soorderNo
this.searchUnissueNotifyMaterialList(rows)
//this.enterSOS(rows)
},
searchUnissueNotifyMaterialList(row) {
this.bomLoadFlag = true
this.materialModalFlag = true
searchUnissueNotifyMaterialList(row)
.then(({ data }) => {
if (data.code === 0) {
this.sobomList = data.rows
}
})
.finally(() => {
this.bomLoadFlag = false
})
},
enterSOS(row) {
console.log('row', row)
this.seqNoModalFlag = false
this.materialModalFlag = true
this.sobomList = []
this.sobomData = {
orderNo: row.orderNo,
seqNo: row.seqNo,
partNo: row.partNo,
}
this.bomLoadFlag = true
let inData = {
site: this.$store.state.user.site,
notifyNo: this.notifyNo,
soorderNo: row.orderNo,
seqNo: row.seqNo,
partNo: row.partNo,
itemNo: row.itemNo,
}
getSOSBOMForIssure(inData).then(({ data }) => {
this.bomLoadFlag = false
if (data.code === 0) {
this.sobomList = data.rows
for (let i = 0; i < this.sobomList.length; i++) {
this.sobomList[i].itemNo = inData.itemNo
if (!this.sobomList[i].qtyToIssue) {
this.$set(
this.sobomList[i],
'qtyToIssue',
this.sobomList[i].qtyOnHand
)
}
}
}
})
},
ToSOS() {
this.seqNoModalFlag = true
this.materialModalFlag = false
@ -1843,54 +1569,6 @@ export default {
this.seqNoList = []
this.seqNoModalFlag = true
},
searchSOSRouting() {
if (this.seqNoData.orderNo == null || this.seqNoData.orderNo == '') {
this.$message.warning('请输入shipmentid!')
return false
}
if (!this.seqNoList) {
this.seqNoList = []
}
// 调用接口前判断this.seqNoList是否存在orderNo
const orderNoExists = this.seqNoList.some(row => row.shipmentId === this.seqNoData.orderNo)
if (orderNoExists) {
this.$message.warning('该shipmentId的数据已存在,请先删除再添加!')
return false
}
const dataListExists = this.dataList.some(row => row.soorderNo === this.seqNoData.orderNo)
if (dataListExists) {
this.$message.warning('该shipmentId的数据已添加过,请先删除再添加!')
return false
}
this.seqNoModalLoading = true
getShipmentAndLineForIssure(this.seqNoData).then(({ data }) => {
if (data.code === 0) {
// 将返回的数据添加到this.seqNoList中,而不是替换
data.rows.forEach((newRow) => {
// 初始化每行的需求数量(需求数量 - 已发数量 - 预留数量)
const inventoryQty = parseFloat(newRow.inventoryQty) || 0
const qtyAssigned = parseFloat(newRow.qtyAssigned) || 0
const qtyToApply = inventoryQty - qtyAssigned
this.$set(
newRow,
'qtyToApply',
qtyToApply > 0 ? qtyToApply : 0
)
// 添加到列表中
this.seqNoList.push(newRow)
})
this.$message.success(`成功添加 ${data.rows.length} 条数据`)
}else {
this.$message.error(data.msg)
}
}).catch((e) => {
this.$message.error(e.msg || '查询失败')
return
}).finally(() => {
this.seqNoModalLoading = false
})
},
deleteFromSeqNoList() {
if (!this.seqNoData.orderNo || this.seqNoData.orderNo.trim() === '') {
this.$message.warning('请输入shipmentId')
@ -1909,33 +1587,6 @@ export default {
this.$message.warning('未找到匹配的数据')
}
},
saveMaterialDetail() {
for (let i = 0; i < this.sobomList.length; i++) {
this.sobomList[i].notifyNo = this.notifyNo
this.sobomList[i].site = this.$store.state.user.site
this.sobomList[i].bomItemNo =
this.sobomList[i].lineItemNo || this.sobomList[i].bomItemNo
}
let materialList = this.sobomList.filter((item) => item.qtyToIssue > 0)
if (materialList.length == 0) {
this.$alert('没有需要保存的内容!', '提示', {
confirmButtonText: '确定',
})
return false
}
console.log('this.sobomList', materialList)
saveShipmentMaterialDetail(materialList).then(({ data }) => {
if (data.code === 0) {
this.materialModalFlag = false
this.$message.success('操作成功')
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
},
//获取用户的bu
getSiteAndBuByUserName() {
let tempData = {
@ -2072,40 +1723,6 @@ export default {
// 打开弹框
this.showXiadaNotifyDialog = true
},
confirmXiadaNotify() {
if (
this.dataList.length == 0
) {
this.$alert('没有明细记录无法下达!!', '提示', {
confirmButtonText: '确定',
})
return false
}
// 验证要求发料时间
if (!this.xiadaNotifyData.planIssueDate || this.xiadaNotifyData.planIssueDate === '') {
this.$message.warning('请选择要求发料时间!')
return false
}
// 准备下达数据
const notifyData = {
...this.notifyData,
planIssueDate: this.xiadaNotifyData.planIssueDate,
remark: this.xiadaNotifyData.remark,
}
// 执行下达操作
updateNotifyStatus(notifyData).then(({ data }) => {
if (data.code === 0) {
this.showXiadaNotifyDialog = false
this.xiadaModelFlag = false
this.getUserNotifyNo()
this.$message.success('操作成功')
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
},
xiadaNotify() {
xiadaNotify(this.notifyData).then(({ data }) => {
if (data.code === 0) {
@ -2155,24 +1772,6 @@ export default {
})
})
},
deleteNotify() {
if (this.dataList.length > 0) {
this.$alert('请先删除已经申请的明细记录!!', '提示', {
confirmButtonText: '确定',
})
return false
}
deleteUnissueNotifyHeader(this.notifyData).then(({ data }) => {
if (data.code === 0) {
this.getUserNotifyNo()
this.$message.success(data.msg)
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
},
updateBuModel() {
if (this.dataList.length > 0) {
this.$alert('已经选择了工单,无法切换BU,请删除已选工单!', '错误', {
@ -2231,32 +1830,6 @@ export default {
}
})
},
// 删除
deleteNotifySOS(row) {
this.$confirm(`是否删除这个工单的申请信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
deleteNotifyUnissue(row).then(({ data }) => {
if (data && data.code === 0) {
this.getNotifyNoDetail()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {},
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
})
.catch(() => {})
},
// 动态列开始 获取 用户保存的 格式列
async getTableUserColumn(tableId, columnId) {
@ -2331,17 +1904,6 @@ export default {
this.authDelete = !deleteFlag
},
searchTable() {},
getAllNotifyStatus() {
let inData = {
site: this.$store.state.user.site,
listName: 'ISSUENOTIFYHEADER_STATUS',
locale: this.$i18n.locale,
}
getAllNotifyStatus(inData).then(({ data }) => {
this.notifyStatusList = data
console.log('notifyStatusList', this.notifyStatusList)
})
},
/**
* 海安销售发料初始化:只读取当前用户shipment未下达申请单 - rqrq
*/

608
src/views/modules/haianWarehouse/shipment/shipmentNotification54.vue

@ -1690,337 +1690,12 @@ export default {
this.currentRow = JSON.parse(JSON.stringify(row));
this.refreshCurrentTabTable ();
},
refreshCurrentTabTable(){
if(this.currentRow===''||this.currentRow===null){
this.currentRow={site:'',notifyNo:'',orderType:'shoporder'}
}
// rqrq - 添加orderType参数
let queryData = {
...this.currentRow,
orderType: 'shoporder'
}
if(this.activeName==='detail'){
searchNotifyOrderListNew(queryData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code == 0) {
this.dataList2 = data.rows
} else {
this.dataList2 = [];
}
});
}else if(this.activeName==='sub'){
searchNotifyMaterialListNew(queryData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code == 0) {
this.dataList3 = data.rows
} else {
this.dataList3 = [];
}
});
}else if(this.activeName==='change'){
searchNotifyLogNew(queryData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code == 0) {
this.dataList5 = data.rows
} else {
this.dataList5 = [];
}
});
}else if(this.activeName==='close'){
searchNotifyLogCloseNew(queryData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code == 0) {
this.dataList6 = data.rows
} else {
this.dataList6 = [];
}
});
}else if(this.activeName==='labelDetail'){ // rqrq - 预定标签清单页签 - rqrq
searchMaterialListDetail(queryData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code == 0) {
this.dataList7 = data.rows
} else {
this.dataList7 = [];
}
});
}else {
searchSumNotifyMaterialListNew(queryData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code == 0) {
this.dataList4 = data.rows
} else {
this.dataList4 = [];
}
});
}
},
searchTable(){
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
searchNotifyHeaderNew(this.searchData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code == 0) {
this.dataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
} else {
this.dataList = [];
}
});
},
closeNotifyModel(row){
this.closeData.site=row.site
this.closeData.notifyNo=row.notifyNo
this.closeData.closeRemark=''
this.closeModalFlag=true
},
closeNotify(){
if(this.closeData.closeRemark==null||this.closeData.closeRemark===''){
this.$alert("必须输入关闭原因", '错误', {
confirmButtonText: '确定'
})
return false;
}
let inData={
site:this.closeData.site,
notifyNo:this.closeData.notifyNo,
closeRemark:this.closeData.closeRemark,
username:this.$store.state.user.name,
status:'CLOSED',
}
updateNotifyStatusNew(inData).then(({data}) => {
if (data && data.code === 0) {
this.closeModalFlag=false
this.searchTable()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
openNotify(row){
this.$confirm('确认打开?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let inData={
site:row.site,
notifyNo:row.notifyNo,
status:'ISSUE',
}
updateNotifyStatusNew(inData).then(({data}) => {
if (data && data.code === 0) {
this.searchTable()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
})
},
// 预览库存匹配情况
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
// )
//全部推送 后端判断
const validData = this.previewData
if (validData.length === 0) {
this.$message.warning('没有可推送的数据(只推送绿色和黄色状态的数据)')
return
}
this.$confirm(`确认推送 ${validData.length} 条数据至WCS?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// 显示加载状态 - rqrq
this.previewLoading = true
const inData = {
site: this.currentRow.site,
notifyNo: this.currentRow.notifyNo,
inventoryList: validData
}
pushInventoryToWcs(inData).then(({data}) => {
this.previewLoading = false
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((error) => {
this.previewLoading = false
this.$message.error(error.message || '推送WCS失败,请重试')
})
}).catch(() => {
// 用户取消操作 - rqrq
console.log('用户取消推送')
})
},
pushToWcs(row){
this.$confirm('确认推送到WCS?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let inData={
site: row.site,
notifyNo: row.notifyNo
}
pushNotifyToWcs(inData).then(({data}) => {
if (data && data.code === 0) {
this.searchTable()
this.$message({
message: '推送WCS成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
})
},
/**
* @Description 取消下达处理方法 - rqrq
* @param row 当前行数据
*/
cancelIssueNotifyHandle(row) {
// 先判断发起人是否有未下达的shoporder申请单 - rqrq
let checkData = {
site: row.site,
username: row.username
}
checkUserHasUnissueShopOrder(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
}
cancelIssueNotify(cancelData).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success('取消下达成功')
// 重新加载数据 - rqrq
this.searchTable()
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
}).catch(() => {
this.$message.error('取消下达失败')
})
}).catch(() => {
// 用户取消操作 - rqrq
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
}).catch(() => {
this.$message.error('检查用户申请单失败')
})
},
deleteNotifyMaterial(row){
this.$confirm('确认删除?', '提示', {
@ -2045,29 +1720,6 @@ export default {
})
})
},
deleteNotifySOSPlus(row){
this.$confirm('确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteNotifySOSPlus(row).then(({data}) => {
if (data && data.code === 0) {
this.refreshCurrentTabTable()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
})
},
// 进入工单物料明细
enterSOSDetail(row) {
let rows = {
@ -2082,78 +1734,10 @@ export default {
}
this.enterSOS(rows)
},
// 打开物料明细对话框
enterSOS(row) {
this.materialModalFlag = true
this.sobomList = []
this.sobomData = {
orderNo: row.orderNo,
seqNo: row.seqNo,
partNo: row.partNo,
}
this.bomLoadFlag = true
let inData = {
site: this.currentRow.site || this.$store.state.user.site,
notifyNo: this.currentRow.notifyNo,
orderNo: row.orderNo,
releaseNo: row.releaseNo,
sequenceNo: row.sequenceNo,
partNo: row.partNo,
itemNo: row.itemNo,
}
getSOSBOMForIssureNew(inData).then(({ data }) => {
this.bomLoadFlag = false
if (data.code === 0) {
this.sobomList = data.rows
for (let i = 0; i < this.sobomList.length; i++) {
this.sobomList[i].itemNo = inData.itemNo
}
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
}).catch(() => {
this.bomLoadFlag = false
this.$message.error('获取物料明细失败')
})
},
// 全数领料
qtyAllForBom(row) {
row.qtyToIssue = row.qtyRequired
},
// 保存物料明细
saveMaterialDetail() {
for (let i = 0; i < this.sobomList.length; i++) {
if (
this.sobomList[i].qtyToIssue === '' ||
this.sobomList[i].qtyToIssue == null
) {
this.sobomList[i].qtyToIssue = 0
}
this.sobomList[i].notifyNo = this.currentRow.notifyNo
this.sobomList[i].site = this.currentRow.site || this.$store.state.user.site
}
let materialList = this.sobomList.filter((item) => item.qtyToIssue > 0)
if (materialList.length == 0) {
this.$alert('没有需要保存的内容!', '提示', {
confirmButtonText: '确定',
})
return false
}
saveMaterialDetail(materialList).then(({ data }) => {
if (data.code === 0) {
this.materialModalFlag = false
this.refreshCurrentTabTable()
this.$message.success('操作成功')
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
},
// 处理材料明细行双击事件
handleMaterialRowDblClick(row) {
@ -2172,63 +1756,6 @@ export default {
}
this.editMaterialModalFlag = true
},
// 保存编辑的材料明细
saveEditMaterialDetail() {
if (this.editMaterialData.qtyToIssue === null || this.editMaterialData.qtyToIssue === '') {
this.$alert('申请数量不能为空!', '提示', {
confirmButtonText: '确定',
})
return false
}
if (this.editMaterialData.qtyToIssue < 0) {
this.$alert('申请数量不能小于0!', '提示', {
confirmButtonText: '确定',
})
return false
}
// 使用完整的行数据,只更新申请数量
let materialData = {
...this.editMaterialData,
}
// 确保申请数量不为空
if (materialData.qtyToIssue === '' || materialData.qtyToIssue == null) {
materialData.qtyToIssue = 0
}
updateMaterialDetail(materialData).then(({ data }) => {
if (data.code === 0) {
this.editMaterialModalFlag = false
this.refreshCurrentTabTable()
this.$message.success('保存成功')
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
}).catch(() => {
this.$message.error('保存失败')
})
},
//导出excel - rqrq
async createExportData() {
const queryParams = {
...this.searchData,
limit: 999999, // 设置一个很大的数字来获取全部数据 - rqrq
page: 1
}
const {data} = await searchNotifyHeaderNew(queryParams)
if (data && data.code === 0) {
return data.page.list || []
}
return []
},
startDownload() {
// this.exportData = this.dataList
@ -2259,17 +1786,6 @@ export default {
return ''
},
/**
* 统一构建海安查询入参,强制使用登录用户site避免跨站点串单 - rqrq
*/
haiAnBuildQueryData (row) {
const baseRow = row || {}
return {
...baseRow,
site: this.$store.state.user.site,
orderType: 'shoporder'
}
},
/**
* 海安标签页签补充追踪列,领料栈板固定放最后一列便于对账 - rqrq
*/
haiAnEnsureLabelColumns () {
@ -2366,25 +1882,6 @@ export default {
this.dataList4 = data && data.code === 0 ? (data.rows || []) : []
})
}
},
/**
* 海安主表查询改为海安接口,固定传登录站点并保留分页语义 - rqrq
*/
searchTable () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
this.searchData.site = this.$store.state.user.site
this.searchData.orderType = 'shipment'
haiAnSearchNotifyHeaderNew(this.searchData).then(({ data }) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
return
}
this.dataList = []
})
},
/**
* 海安关闭申请单,保持旧页面的必填关闭原因校验与提示语义 - rqrq
@ -2902,54 +2399,6 @@ export default {
this.noOrderAllocSaving = false
})
},
/**
* 海安取消下达流程:先检查未下达冲突,再执行取消并刷新列表 - rqrq
*/
cancelIssueNotifyHandle (row) {
const checkData = {
site: this.$store.state.user.site,
username: row.username
}
haiAnCheckUserHasUnissueShopOrder(checkData).then(({ data }) => {
if (data && data.code === 0) {
if (data.row != null) {
this.$alert('该用户有未下达的申请单,请先处理', '提示', {
confirmButtonText: '确定'
})
return
}
this.$confirm(`确定取消下达申请单【${row.notifyNo}】吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const cancelData = {
site: this.$store.state.user.site,
notifyNo: row.notifyNo
}
haiAnCancelIssueNotify(cancelData).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success('取消下达成功')
this.searchTable()
return
}
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}).catch(() => {
this.$message.error('取消下达失败')
})
})
return
}
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}).catch(() => {
this.$message.error('检查用户申请单失败')
})
},
/**
* 未推送领料单整单删除。确认后把订单、物料、标签明细和指定物料一起删掉 - rqrq
*/
@ -3017,46 +2466,6 @@ export default {
})
})
})
},
/**
* 海安查看页物料弹窗查询,按海安接口回显已保存数量并透传subsite - rqrq
*/
enterSOS (row) {
this.materialModalFlag = true
this.sobomList = []
this.sobomData = {
orderNo: row.orderNo,
seqNo: row.seqNo,
partNo: row.partNo,
subSite: row.subSite
}
this.bomLoadFlag = true
const inData = {
site: this.$store.state.user.site,
notifyNo: this.currentRow.notifyNo,
orderNo: row.orderNo,
releaseNo: row.releaseNo,
sequenceNo: row.sequenceNo,
partNo: row.partNo,
itemNo: row.itemNo
}
haiAnGetSOSBOMForIssureNew(inData).then(({ data }) => {
this.bomLoadFlag = false
if (data && data.code === 0) {
this.sobomList = data.rows || []
for (let i = 0; i < this.sobomList.length; i++) {
this.sobomList[i].itemNo = inData.itemNo
this.sobomList[i].subSite = row.subSite
}
return
}
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}).catch(() => {
this.bomLoadFlag = false
this.$message.error('获取物料明细失败')
})
},
/**
* 海安保存材料明细走海安先删后存链路,并透传subsite防止跨子站点串单 - rqrq
@ -3126,23 +2535,6 @@ export default {
}).catch(() => {
this.$message.error('保存失败')
})
},
/**
* 海安导出数据改为海安主查询接口,确保导出内容来自海安表链路 - rqrq
*/
async createExportData () {
const queryParams = {
...this.searchData,
site: this.$store.state.user.site,
orderType: 'shipment',
limit: 999999,
page: 1
}
const { data } = await haiAnSearchNotifyHeaderNew(queryParams)
if (data && data.code === 0) {
return data.page.list || []
}
return []
},
/**
* 销售发料查看页查询参数:固定orderType=shipment,避免与shoporder串单 - rqrq

473
src/views/modules/haianWarehouse/shopOrderIssueNotify/searchIssureNotify54.vue

@ -1690,337 +1690,12 @@ export default {
this.currentRow = JSON.parse(JSON.stringify(row));
this.refreshCurrentTabTable ();
},
refreshCurrentTabTable(){
if(this.currentRow===''||this.currentRow===null){
this.currentRow={site:'',notifyNo:'',orderType:'shoporder'}
}
// rqrq - 添加orderType参数
let queryData = {
...this.currentRow,
orderType: 'shoporder'
}
if(this.activeName==='detail'){
searchNotifyOrderListNew(queryData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code == 0) {
this.dataList2 = data.rows
} else {
this.dataList2 = [];
}
});
}else if(this.activeName==='sub'){
searchNotifyMaterialListNew(queryData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code == 0) {
this.dataList3 = data.rows
} else {
this.dataList3 = [];
}
});
}else if(this.activeName==='change'){
searchNotifyLogNew(queryData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code == 0) {
this.dataList5 = data.rows
} else {
this.dataList5 = [];
}
});
}else if(this.activeName==='close'){
searchNotifyLogCloseNew(queryData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code == 0) {
this.dataList6 = data.rows
} else {
this.dataList6 = [];
}
});
}else if(this.activeName==='labelDetail'){ // rqrq - 预定标签清单页签 - rqrq
searchMaterialListDetail(queryData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code == 0) {
this.dataList7 = data.rows
} else {
this.dataList7 = [];
}
});
}else {
searchSumNotifyMaterialListNew(queryData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code == 0) {
this.dataList4 = data.rows
} else {
this.dataList4 = [];
}
});
}
},
searchTable(){
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
searchNotifyHeaderNew(this.searchData).then(({data}) => {
//区分请求成功和失败的状况
if (data && data.code == 0) {
this.dataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
} else {
this.dataList = [];
}
});
},
closeNotifyModel(row){
this.closeData.site=row.site
this.closeData.notifyNo=row.notifyNo
this.closeData.closeRemark=''
this.closeModalFlag=true
},
closeNotify(){
if(this.closeData.closeRemark==null||this.closeData.closeRemark===''){
this.$alert("必须输入关闭原因", '错误', {
confirmButtonText: '确定'
})
return false;
}
let inData={
site:this.closeData.site,
notifyNo:this.closeData.notifyNo,
closeRemark:this.closeData.closeRemark,
username:this.$store.state.user.name,
status:'CLOSED',
}
updateNotifyStatusNew(inData).then(({data}) => {
if (data && data.code === 0) {
this.closeModalFlag=false
this.searchTable()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
openNotify(row){
this.$confirm('确认打开?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let inData={
site:row.site,
notifyNo:row.notifyNo,
status:'ISSUE',
}
updateNotifyStatusNew(inData).then(({data}) => {
if (data && data.code === 0) {
this.searchTable()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
})
},
// 预览库存匹配情况
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
// )
//全部推送 后端判断
const validData = this.previewData
if (validData.length === 0) {
this.$message.warning('没有可推送的数据(只推送绿色和黄色状态的数据)')
return
}
this.$confirm(`确认推送 ${validData.length} 条数据至WCS?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// 显示加载状态 - rqrq
this.previewLoading = true
const inData = {
site: this.currentRow.site,
notifyNo: this.currentRow.notifyNo,
inventoryList: validData
}
pushInventoryToWcs(inData).then(({data}) => {
this.previewLoading = false
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((error) => {
this.previewLoading = false
this.$message.error(error.message || '推送WCS失败,请重试')
})
}).catch(() => {
// 用户取消操作 - rqrq
console.log('用户取消推送')
})
},
pushToWcs(row){
this.$confirm('确认推送到WCS?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let inData={
site: row.site,
notifyNo: row.notifyNo
}
pushNotifyToWcs(inData).then(({data}) => {
if (data && data.code === 0) {
this.searchTable()
this.$message({
message: '推送WCS成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
})
},
/**
* @Description 取消下达处理方法 - rqrq
* @param row 当前行数据
*/
cancelIssueNotifyHandle(row) {
// 先判断发起人是否有未下达的shoporder申请单 - rqrq
let checkData = {
site: row.site,
username: row.username
}
checkUserHasUnissueShopOrder(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
}
cancelIssueNotify(cancelData).then(({ data }) => {
if (data && data.code === 0) {
this.$message.success('取消下达成功')
// 重新加载数据 - rqrq
this.searchTable()
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
}).catch(() => {
this.$message.error('取消下达失败')
})
}).catch(() => {
// 用户取消操作 - rqrq
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
}).catch(() => {
this.$message.error('检查用户申请单失败')
})
},
deleteNotifyMaterial(row){
this.$confirm('确认删除?', '提示', {
@ -2045,29 +1720,6 @@ export default {
})
})
},
deleteNotifySOSPlus(row){
this.$confirm('确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteNotifySOSPlus(row).then(({data}) => {
if (data && data.code === 0) {
this.refreshCurrentTabTable()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
})
},
// 进入工单物料明细
enterSOSDetail(row) {
let rows = {
@ -2082,78 +1734,10 @@ export default {
}
this.enterSOS(rows)
},
// 打开物料明细对话框
enterSOS(row) {
this.materialModalFlag = true
this.sobomList = []
this.sobomData = {
orderNo: row.orderNo,
seqNo: row.seqNo,
partNo: row.partNo,
}
this.bomLoadFlag = true
let inData = {
site: this.currentRow.site || this.$store.state.user.site,
notifyNo: this.currentRow.notifyNo,
orderNo: row.orderNo,
releaseNo: row.releaseNo,
sequenceNo: row.sequenceNo,
partNo: row.partNo,
itemNo: row.itemNo,
}
getSOSBOMForIssureNew(inData).then(({ data }) => {
this.bomLoadFlag = false
if (data.code === 0) {
this.sobomList = data.rows
for (let i = 0; i < this.sobomList.length; i++) {
this.sobomList[i].itemNo = inData.itemNo
}
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
}).catch(() => {
this.bomLoadFlag = false
this.$message.error('获取物料明细失败')
})
},
// 全数领料
qtyAllForBom(row) {
row.qtyToIssue = row.qtyRequired
},
// 保存物料明细
saveMaterialDetail() {
for (let i = 0; i < this.sobomList.length; i++) {
if (
this.sobomList[i].qtyToIssue === '' ||
this.sobomList[i].qtyToIssue == null
) {
this.sobomList[i].qtyToIssue = 0
}
this.sobomList[i].notifyNo = this.currentRow.notifyNo
this.sobomList[i].site = this.currentRow.site || this.$store.state.user.site
}
let materialList = this.sobomList.filter((item) => item.qtyToIssue > 0)
if (materialList.length == 0) {
this.$alert('没有需要保存的内容!', '提示', {
confirmButtonText: '确定',
})
return false
}
saveMaterialDetail(materialList).then(({ data }) => {
if (data.code === 0) {
this.materialModalFlag = false
this.refreshCurrentTabTable()
this.$message.success('操作成功')
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
})
},
// 处理材料明细行双击事件
handleMaterialRowDblClick(row) {
@ -2172,63 +1756,6 @@ export default {
}
this.editMaterialModalFlag = true
},
// 保存编辑的材料明细
saveEditMaterialDetail() {
if (this.editMaterialData.qtyToIssue === null || this.editMaterialData.qtyToIssue === '') {
this.$alert('申请数量不能为空!', '提示', {
confirmButtonText: '确定',
})
return false
}
if (this.editMaterialData.qtyToIssue < 0) {
this.$alert('申请数量不能小于0!', '提示', {
confirmButtonText: '确定',
})
return false
}
// 使用完整的行数据,只更新申请数量
let materialData = {
...this.editMaterialData,
}
// 确保申请数量不为空
if (materialData.qtyToIssue === '' || materialData.qtyToIssue == null) {
materialData.qtyToIssue = 0
}
updateMaterialDetail(materialData).then(({ data }) => {
if (data.code === 0) {
this.editMaterialModalFlag = false
this.refreshCurrentTabTable()
this.$message.success('保存成功')
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定',
})
}
}).catch(() => {
this.$message.error('保存失败')
})
},
//导出excel - rqrq
async createExportData() {
const queryParams = {
...this.searchData,
limit: 999999, // 设置一个很大的数字来获取全部数据 - rqrq
page: 1
}
const {data} = await searchNotifyHeaderNew(queryParams)
if (data && data.code === 0) {
return data.page.list || []
}
return []
},
startDownload() {
// this.exportData = this.dataList

Loading…
Cancel
Save