Browse Source

领料单查看

dev
常熟吴彦祖 4 weeks ago
parent
commit
d8ea0b9c37
  1. 23
      src/api/haianWarehouse/searchIssureNotify.js
  2. 464
      src/views/modules/haianWarehouse/shopOrderIssueNotify/searchIssureNotify54.vue
  3. 10322
      yarn.lock

23
src/api/haianWarehouse/searchIssureNotify.js

@ -0,0 +1,23 @@
import { createAPI } from '@/utils/httpRequest.js'
// 海安查看页主查询与页签查询接口,统一路由到海安查看专用控制器 - rqrq
export const haiAnSearchNotifyHeaderNew = (data) => createAPI('/autoWareHourceHaian/haiAnSearchIssureNotify/searchNotifyHeaderNew', 'post', data)
export const haiAnSearchNotifyOrderListNew = (data) => createAPI('/autoWareHourceHaian/haiAnSearchIssureNotify/searchNotifyOrderListNew', 'post', data)
export const haiAnSearchNotifyMaterialListNew = (data) => createAPI('/autoWareHourceHaian/haiAnSearchIssureNotify/searchNotifyMaterialListNew', 'post', data)
export const haiAnSearchSumNotifyMaterialListNew = (data) => createAPI('/autoWareHourceHaian/haiAnSearchIssureNotify/searchSumNotifyMaterialListNew', 'post', data)
export const haiAnSearchMaterialListDetail = (data) => createAPI('/autoWareHourceHaian/haiAnSearchIssureNotify/searchMaterialListDetail', 'post', data)
export const haiAnSearchNotifyLogNew = (data) => createAPI('/autoWareHourceHaian/haiAnSearchIssureNotify/searchNotifyLogNew', 'post', data)
export const haiAnSearchNotifyLogCloseNew = (data) => createAPI('/autoWareHourceHaian/haiAnSearchIssureNotify/searchNotifyLogCloseNew', 'post', data)
// 海安查看页非WCS操作接口(状态流转、取消下达、明细编辑)- rqrq
export const haiAnUpdateNotifyStatusNew = (data) => createAPI('/autoWareHourceHaian/haiAnSearchIssureNotify/updateNotifyStatusNew', 'post', data)
export const haiAnCheckUserHasUnissueShopOrder = (data) => createAPI('/autoWareHourceHaian/haiAnSearchIssureNotify/checkUserHasUnissueShopOrder', 'post', data)
export const haiAnCancelIssueNotify = (data) => createAPI('/autoWareHourceHaian/haiAnSearchIssureNotify/cancelIssueNotify', 'post', data)
export const haiAnDeleteNotifySOSPlus = (data) => createAPI('/autoWareHourceHaian/haiAnSearchIssureNotify/deleteNotifySOSPlus', 'post', data)
export const haiAnUpdateMaterialDetail = (data) => createAPI('/autoWareHourceHaian/haiAnSearchIssureNotify/updateMaterialDetail', 'post', data)
export const haiAnGetSOSBOMForIssureNew = (data) => createAPI('/autoWareHourceHaian/haiAnSearchIssureNotify/getSOSBOMForIssureNew', 'post', data)
export const haiAnSaveMaterialDetail = (data) => createAPI('/autoWareHourceHaian/haiAnSearchIssureNotify/saveMaterialDetail', 'post', data)
// 海安查看页WCS预览与推送占位接口,当前仅保留扩展入口 - rqrq
export const haiAnCheckIssueNotifyInventory = (data) => createAPI('/autoWareHourceHaian/haiAnSearchIssureNotify/checkIssueNotifyInventory', 'post', data)
export const haiAnPushInventoryToWcs = (data) => createAPI('/autoWareHourceHaian/haiAnSearchIssureNotify/pushInventoryToWcs', 'post', data)

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

@ -0,0 +1,464 @@
<script>
import BaseSearchIssureNotify from '@/views/modules/orderIssure/searchIssureNotify.vue'
import {
haiAnSearchNotifyHeaderNew,
haiAnSearchNotifyOrderListNew,
haiAnSearchNotifyMaterialListNew,
haiAnSearchSumNotifyMaterialListNew,
haiAnSearchMaterialListDetail,
haiAnSearchNotifyLogNew,
haiAnSearchNotifyLogCloseNew,
haiAnUpdateNotifyStatusNew,
haiAnCheckUserHasUnissueShopOrder,
haiAnCancelIssueNotify,
haiAnDeleteNotifySOSPlus,
haiAnUpdateMaterialDetail,
haiAnGetSOSBOMForIssureNew,
haiAnSaveMaterialDetail,
haiAnCheckIssueNotifyInventory,
haiAnPushInventoryToWcs
} from '@/api/haianWarehouse/searchIssureNotify.js'
export default {
name: 'searchIssureNotify54',
extends: BaseSearchIssureNotify,
created () {
// - rqrq
this.haiAnEnsureLabelColumns()
},
methods: {
/**
* 统一构建海安查询入参强制使用登录用户site避免跨站点串单 - rqrq
*/
haiAnBuildQueryData (row) {
const baseRow = row || {}
return {
...baseRow,
site: this.$store.state.user.site,
orderType: 'shoporder'
}
},
/**
* 海安标签页签增加subsite/allocSeq/palletId/taskSeq列便于追踪标签流向 - rqrq
*/
haiAnEnsureLabelColumns () {
if (!Array.isArray(this.columnList6)) {
return
}
const appendColumn = (columnProp, columnLabel, columnWidth = 100, align = 'left') => {
if (this.columnList6.some(col => col.columnProp === columnProp)) {
return
}
this.columnList6.push({
userId: this.$store.state.user.name,
functionId: 701002,
serialNumber: `701002Table6${columnProp}`,
tableId: '701002Table6',
tableName: '海安预留标签清单表',
columnProp,
headerAlign: 'center',
align,
columnLabel,
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth
})
}
appendColumn('taskSeq', '立库任务序号', 110, 'right')
appendColumn('subSite', '子站点', 110, 'left')
appendColumn('allocSeq', '分配序号', 100, 'right')
appendColumn('palletId', '栈板号', 120, 'left')
},
/**
* 海安页签刷新逻辑四个页签均改为海安接口并保留原交互语义 - rqrq
*/
refreshCurrentTabTable () {
if (this.currentRow === '' || this.currentRow === null) {
this.currentRow = { site: this.$store.state.user.site, notifyNo: '', orderType: 'shoporder' }
}
const queryData = this.haiAnBuildQueryData(this.currentRow)
if (this.activeName === 'detail') {
haiAnSearchNotifyOrderListNew(queryData).then(({ data }) => {
this.dataList2 = data && data.code === 0 ? (data.rows || []) : []
})
} else if (this.activeName === 'sub') {
haiAnSearchNotifyMaterialListNew(queryData).then(({ data }) => {
this.dataList3 = data && data.code === 0 ? (data.rows || []) : []
})
} else if (this.activeName === 'change') {
haiAnSearchNotifyLogNew(queryData).then(({ data }) => {
this.dataList5 = data && data.code === 0 ? (data.rows || []) : []
})
} else if (this.activeName === 'close') {
haiAnSearchNotifyLogCloseNew(queryData).then(({ data }) => {
this.dataList6 = data && data.code === 0 ? (data.rows || []) : []
})
} else if (this.activeName === 'labelDetail') {
haiAnSearchMaterialListDetail(queryData).then(({ data }) => {
this.dataList7 = data && data.code === 0 ? (data.rows || []) : []
})
} else {
haiAnSearchSumNotifyMaterialListNew(queryData).then(({ data }) => {
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 = 'shoporder'
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
*/
closeNotify () {
if (this.closeData.closeRemark == null || this.closeData.closeRemark === '') {
this.$alert('必须输入关闭原因', '错误', {
confirmButtonText: '确定'
})
return false
}
const inData = {
site: this.$store.state.user.site,
notifyNo: this.closeData.notifyNo,
closeRemark: this.closeData.closeRemark,
username: this.$store.state.user.name,
status: 'CLOSED'
}
haiAnUpdateNotifyStatusNew(inData).then(({ data }) => {
if (data && data.code === 0) {
this.closeModalFlag = false
this.searchTable()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500
})
return
}
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
})
},
/**
* 海安开启申请单状态回写改走海安接口并保持原确认交互 - rqrq
*/
openNotify (row) {
this.$confirm('确认打开?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const inData = {
site: this.$store.state.user.site,
notifyNo: row.notifyNo,
status: 'ISSUE'
}
haiAnUpdateNotifyStatusNew(inData).then(({ data }) => {
if (data && data.code === 0) {
this.searchTable()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500
})
return
}
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
})
})
},
/**
* 海安库存预览当前为占位实现保留入口并给出待开发提示 - rqrq
*/
previewInventory (row) {
this.currentRow = row
this.previewDialogVisible = true
this.previewLoading = true
this.previewData = []
const inData = {
site: this.$store.state.user.site,
notifyNo: row.notifyNo
}
haiAnCheckIssueNotifyInventory(inData).then(({ data }) => {
this.previewLoading = false
if (data && data.code === 0) {
this.previewData = data.rows || []
if (data.placeholder) {
this.$message.warning(data.msg || '海安库存预览待开发')
}
return
}
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}).catch(() => {
this.previewLoading = false
this.$message.error('获取库存预览失败')
})
},
/**
* 海安推送WCS当前为占位实现仅提示待开发并不触发真实推送 - rqrq
*/
pushToWCS () {
const validData = this.previewData || []
this.$confirm(`确认推送 ${validData.length} 条数据至WCS?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.previewLoading = true
const inData = {
site: this.$store.state.user.site,
notifyNo: this.currentRow.notifyNo,
inventoryList: validData
}
haiAnPushInventoryToWcs(inData).then(({ data }) => {
this.previewLoading = false
if (data && data.code === 0) {
this.$message.warning(data.msg || '海安推送WCS待开发')
this.previewDialogVisible = false
return
}
this.$alert(data.msg || '推送失败', '错误', {
confirmButtonText: '确定'
})
}).catch((error) => {
this.previewLoading = false
this.$message.error(error.message || '推送WCS失败,请重试')
})
})
},
/**
* 兼容旧入口的海安推送占位方法避免历史按钮调用空指针 - rqrq
*/
pushToWcs (row) {
this.previewInventory(row)
},
/**
* 海安取消下达流程先检查未下达冲突再执行取消并刷新列表 - 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
*/
deleteNotifySOSPlus (row) {
this.$confirm('确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const inData = {
...row,
site: this.$store.state.user.site,
notifyNo: this.currentRow.notifyNo
}
haiAnDeleteNotifySOSPlus(inData).then(({ data }) => {
if (data && data.code === 0) {
this.refreshCurrentTabTable()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500
})
return
}
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
})
})
},
/**
* 海安查看页物料弹窗查询按海安接口回显已保存数量并透传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
*/
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.$store.state.user.site
this.sobomList[i].subSite = this.sobomList[i].subSite || this.sobomData.subSite || this.currentRow.subSite
}
const materialList = this.sobomList.filter((item) => item.qtyToIssue > 0)
if (materialList.length === 0) {
this.$alert('没有需要保存的内容!', '提示', {
confirmButtonText: '确定'
})
return false
}
haiAnSaveMaterialDetail(materialList).then(({ data }) => {
if (data && data.code === 0) {
this.materialModalFlag = false
this.refreshCurrentTabTable()
this.$message.success('操作成功')
return
}
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
})
},
/**
* 海安编辑材料数量沿用未推送限制并改为海安更新接口 - rqrq
*/
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
}
const materialData = {
...this.editMaterialData,
site: this.$store.state.user.site,
notifyNo: this.currentRow.notifyNo
}
if (materialData.qtyToIssue === '' || materialData.qtyToIssue == null) {
materialData.qtyToIssue = 0
}
haiAnUpdateMaterialDetail(materialData).then(({ data }) => {
if (data && data.code === 0) {
this.editMaterialModalFlag = false
this.refreshCurrentTabTable()
this.$message.success('保存成功')
return
}
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}).catch(() => {
this.$message.error('保存失败')
})
},
/**
* 海安导出数据改为海安主查询接口确保导出内容来自海安表链路 - rqrq
*/
async createExportData () {
const queryParams = {
...this.searchData,
site: this.$store.state.user.site,
orderType: 'shoporder',
limit: 999999,
page: 1
}
const { data } = await haiAnSearchNotifyHeaderNew(queryParams)
if (data && data.code === 0) {
return data.page.list || []
}
return []
}
}
}
</script>

10322
yarn.lock
File diff suppressed because it is too large
View File

Loading…
Cancel
Save