8 changed files with 1536 additions and 16 deletions
-
35src/api/haianWarehouse/poOrderIssueNotify.js
-
35src/api/haianWarehouse/shipmentIssue.js
-
80src/views/modules/haianWarehouse/check/currentPhysicalInventory54.vue
-
31src/views/modules/haianWarehouse/check/searchPhysicalInventory54.vue
-
515src/views/modules/haianWarehouse/poOrder/newPoIssueNotify54.vue
-
175src/views/modules/haianWarehouse/poOrder/searchPoIssureNotify54.vue
-
507src/views/modules/haianWarehouse/shipment/shipmentIssue54.vue
-
174src/views/modules/haianWarehouse/shipment/shipmentNotification54.vue
@ -0,0 +1,35 @@ |
|||||
|
import { createAPI } from '@/utils/httpRequest.js' |
||||
|
|
||||
|
// 海安委外发料主流程:主单/父行/子行全部走海安独立链路,orderType固定poorder - rqrq
|
||||
|
export const haiAnGetUserNotifyNo = (data) => createAPI('/autoWareHourceHaian/haiAnIssureNotify/getUserNotifyNo', 'post', data) |
||||
|
export const haiAnCreateNotify = (data) => createAPI('/autoWareHourceHaian/haiAnIssureNotify/createNotify', 'post', data) |
||||
|
export const haiAnGetNotifyNoDetail = (data) => createAPI('/autoWareHourceHaian/haiAnIssureNotify/getNotifyNoDetail', 'post', data) |
||||
|
export const haiAnSaveSOIssueNotifyOrderList = (data) => createAPI('/autoWareHourceHaian/haiAnIssureNotify/saveSOIssueNotifyOrderList', 'post', data) |
||||
|
export const haiAnSaveMaterialDetail = (data) => createAPI('/autoWareHourceHaian/haiAnIssureNotify/saveMaterialDetail', 'post', data) |
||||
|
export const haiAnSaveNewSoIssueNotify = (data) => createAPI('/autoWareHourceHaian/haiAnIssureNotify/saveNewSoIssueNotify', 'post', data) |
||||
|
export const haiAnDeleteNotify = (data) => createAPI('/autoWareHourceHaian/haiAnIssureNotify/deleteNotify', 'post', data) |
||||
|
export const haiAnDeleteNotifySOS = (data) => createAPI('/autoWareHourceHaian/haiAnIssureNotify/deleteNotifySOS', 'post', data) |
||||
|
export const haiAnXiadaNotify = (data) => createAPI('/autoWareHourceHaian/haiAnIssureNotify/xiadaNotify', 'post', data) |
||||
|
|
||||
|
// 海安委外单据拉取:IFS沿用老接口能力,但通过海安控制器完成subsite透传 - rqrq
|
||||
|
export const haiAnGetPoOrderAndMaterialByOrderNo = (data) => createAPI('/autoWareHourceHaian/haiAnNewIssure/getPoOrderAndMaterialByOrderNo', 'post', data) |
||||
|
export const haiAnGetPoOrderMaterialForIssure = (data) => createAPI('/autoWareHourceHaian/haiAnNewIssure/getPoOrderMaterialForIssure', 'post', data) |
||||
|
|
||||
|
// 海安查看页公共接口:统一走海安Search控制器,避免读取旧表 - 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) |
||||
|
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 haiAnCheckIssueNotifyInventory = (data) => createAPI('/autoWareHourceHaian/haiAnSearchIssureNotify/checkIssueNotifyInventory', 'post', data) |
||||
|
export const haiAnPushInventoryToWcs = (data) => createAPI('/autoWareHourceHaian/haiAnSearchIssureNotify/pushInventoryToWcs', 'post', data) |
||||
|
|
||||
|
// 公共枚举接口 - rqrq
|
||||
|
export const getAllNotifyStatus = (data) => createAPI('/sys/enum/list', 'get', data) |
||||
@ -0,0 +1,35 @@ |
|||||
|
import { createAPI } from '@/utils/httpRequest.js' |
||||
|
|
||||
|
// 海安销售发料主流程:主单/父行/子行全部落海安表,orderType固定shipment - rqrq
|
||||
|
export const haiAnGetUserNotifyNo = (data) => createAPI('/autoWareHourceHaian/haiAnIssureNotify/getUserNotifyNo', 'post', data) |
||||
|
export const haiAnCreateNotify = (data) => createAPI('/autoWareHourceHaian/haiAnIssureNotify/createNotify', 'post', data) |
||||
|
export const haiAnGetNotifyNoDetail = (data) => createAPI('/autoWareHourceHaian/haiAnIssureNotify/getNotifyNoDetail', 'post', data) |
||||
|
export const haiAnSaveSOIssueNotifyOrderList = (data) => createAPI('/autoWareHourceHaian/haiAnIssureNotify/saveSOIssueNotifyOrderList', 'post', data) |
||||
|
export const haiAnSaveMaterialDetail = (data) => createAPI('/autoWareHourceHaian/haiAnIssureNotify/saveMaterialDetail', 'post', data) |
||||
|
export const haiAnSaveNewSoIssueNotify = (data) => createAPI('/autoWareHourceHaian/haiAnIssureNotify/saveNewSoIssueNotify', 'post', data) |
||||
|
export const haiAnDeleteNotify = (data) => createAPI('/autoWareHourceHaian/haiAnIssureNotify/deleteNotify', 'post', data) |
||||
|
export const haiAnDeleteNotifySOS = (data) => createAPI('/autoWareHourceHaian/haiAnIssureNotify/deleteNotifySOS', 'post', data) |
||||
|
export const haiAnXiadaNotify = (data) => createAPI('/autoWareHourceHaian/haiAnIssureNotify/xiadaNotify', 'post', data) |
||||
|
|
||||
|
// 海安销售发料查询:IFS接口继续复用老来源,但入口切到海安控制器以注入subsite语义 - rqrq
|
||||
|
export const haiAnGetShipmentAndLineForIssure = (data) => createAPI('/autoWareHourceHaian/haiAnNewIssure/getShipmentAndLineForIssure', 'post', data) |
||||
|
export const haiAnGetShipmentMaterialForIssure = (data) => createAPI('/autoWareHourceHaian/haiAnNewIssure/getShipmentMaterialForIssure', 'post', data) |
||||
|
|
||||
|
// 海安销售发料查看页:统一走海安Search控制器,WCS仅保留占位接口 - 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) |
||||
|
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 haiAnCheckIssueNotifyInventory = (data) => createAPI('/autoWareHourceHaian/haiAnSearchIssureNotify/checkIssueNotifyInventory', 'post', data) |
||||
|
export const haiAnPushInventoryToWcs = (data) => createAPI('/autoWareHourceHaian/haiAnSearchIssureNotify/pushInventoryToWcs', 'post', data) |
||||
|
|
||||
|
// 枚举字典继续复用公共接口,避免重复维护 - rqrq
|
||||
|
export const getAllNotifyStatus = (data) => createAPI('/sys/enum/list', 'get', data) |
||||
@ -0,0 +1,515 @@ |
|||||
|
<script> |
||||
|
import BaseNewPoIssueNotify from '@/views/modules/poOrder/newPoIssueNotify.vue' |
||||
|
import { |
||||
|
haiAnGetUserNotifyNo, |
||||
|
haiAnCreateNotify, |
||||
|
haiAnGetNotifyNoDetail, |
||||
|
haiAnGetPoOrderAndMaterialByOrderNo, |
||||
|
haiAnGetPoOrderMaterialForIssure, |
||||
|
haiAnSaveSOIssueNotifyOrderList, |
||||
|
haiAnSaveMaterialDetail, |
||||
|
haiAnSaveNewSoIssueNotify, |
||||
|
haiAnDeleteNotifySOS, |
||||
|
haiAnDeleteNotify, |
||||
|
haiAnXiadaNotify, |
||||
|
haiAnSearchNotifyMaterialListNew, |
||||
|
getAllNotifyStatus |
||||
|
} from '@/api/haianWarehouse/poOrderIssueNotify.js' |
||||
|
|
||||
|
export default { |
||||
|
name: 'newPoIssueNotify54', |
||||
|
extends: BaseNewPoIssueNotify, |
||||
|
methods: { |
||||
|
/** |
||||
|
* 海安委外页签刷新:材料明细固定按poorder查询,避免落回shoporder链路 - rqrq |
||||
|
*/ |
||||
|
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: 'poorder' |
||||
|
} |
||||
|
if (this.currentRow && this.currentRow !== '' && this.currentRow.notifyNo) { |
||||
|
queryData = { |
||||
|
...this.currentRow, |
||||
|
site: this.notifyData.site || this.$store.state.user.site, |
||||
|
orderType: 'poorder' |
||||
|
} |
||||
|
} |
||||
|
this.dataListLoading = true |
||||
|
haiAnSearchNotifyMaterialListNew(queryData).then(({ data }) => { |
||||
|
this.dataListLoading = false |
||||
|
if (data && data.code === 0) { |
||||
|
this.materialDetailList = data.rows || [] |
||||
|
} else { |
||||
|
this.materialDetailList = [] |
||||
|
} |
||||
|
}).catch(() => { |
||||
|
this.dataListLoading = false |
||||
|
this.materialDetailList = [] |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 海安委外初始化:只查询当前用户poorder未下达主单 - rqrq |
||||
|
*/ |
||||
|
getUserNotifyNo () { |
||||
|
const inData = { |
||||
|
site: this.$store.state.user.site, |
||||
|
username: this.$store.state.user.name, |
||||
|
orderType: 'poorder' |
||||
|
} |
||||
|
this.getAllNotifyStatus() |
||||
|
haiAnGetUserNotifyNo(inData).then(({ data }) => { |
||||
|
if (data && 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 = [] |
||||
|
this.materialDetailList = [] |
||||
|
} |
||||
|
return |
||||
|
} |
||||
|
this.notifyNo = '' |
||||
|
this.dataList = [] |
||||
|
this.materialDetailList = [] |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 海安委外父行查询:固定orderType=poorder读取haian_SOIssueNotifyOrderList - rqrq |
||||
|
*/ |
||||
|
getNotifyPoDetail () { |
||||
|
const inData = { |
||||
|
site: this.$store.state.user.site, |
||||
|
notifyNo: this.notifyNo, |
||||
|
orderType: 'poorder' |
||||
|
} |
||||
|
haiAnGetNotifyNoDetail(inData).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.dataList = data.rows || [] |
||||
|
} else { |
||||
|
this.dataList = [] |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 海安委外新建主单:主记录site使用当前登录大site,orderType固定poorder - rqrq |
||||
|
*/ |
||||
|
addNotify () { |
||||
|
const inData = { |
||||
|
site: this.$store.state.user.site, |
||||
|
userName: this.$store.state.user.name, |
||||
|
orderType: 'poorder' |
||||
|
} |
||||
|
haiAnCreateNotify(inData).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.showAddNotifyTypeDialog = false |
||||
|
this.$message.success('操作成功') |
||||
|
this.getUserNotifyNo() |
||||
|
} else if (data) { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 海安委外新建主单(带备注):沿用老交互并固定orderType=poorder - rqrq |
||||
|
*/ |
||||
|
confirmAddNotify () { |
||||
|
const outWorkOrderFlag = this.selectedNotifyType === 'outsourced' ? 'Y' : 'N' |
||||
|
const inData = { |
||||
|
site: this.$store.state.user.site, |
||||
|
userName: this.$store.state.user.name, |
||||
|
outWorkOrderFlag, |
||||
|
remark: this.selectedNotifyRemark, |
||||
|
orderType: 'poorder' |
||||
|
} |
||||
|
this.getAllNotifyStatus() |
||||
|
haiAnCreateNotify(inData).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.showAddNotifyTypeDialog = false |
||||
|
this.$message.success('操作成功') |
||||
|
this.getUserNotifyNo() |
||||
|
} else if (data) { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 委外单查询:IFS仍使用大site,回传contract/site映射为subSite供后续落库 - rqrq |
||||
|
*/ |
||||
|
searchSOSRouting () { |
||||
|
if (this.seqNoData.orderNo == null || this.seqNoData.orderNo === '') { |
||||
|
this.$message.warning('请输入OrderNo!') |
||||
|
return false |
||||
|
} |
||||
|
if (!this.seqNoList) { |
||||
|
this.seqNoList = [] |
||||
|
} |
||||
|
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) { |
||||
|
return |
||||
|
} |
||||
|
this.seqNoModalLoading = true |
||||
|
const params = { |
||||
|
site: this.$store.state.user.site, |
||||
|
outsourcingNo: this.seqNoData.orderNo |
||||
|
} |
||||
|
haiAnGetPoOrderAndMaterialByOrderNo(params).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
if (!data.rows || data.rows.length === 0) { |
||||
|
this.$message.warning('未查询到数据!') |
||||
|
return |
||||
|
} |
||||
|
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) |
||||
|
// 委外IFS返回lineItemNo作为海安sequenceNo保存,contract/site作为subsite保存 - rqrq |
||||
|
newRow.sequenceNo = newRow.sequenceNo || newRow.lineItemNo || '*' |
||||
|
newRow.releaseNo = newRow.releaseNo || '*' |
||||
|
newRow.subSite = newRow.subSite || newRow.contract || newRow.site || this.$store.state.user.site |
||||
|
this.seqNoList.push(newRow) |
||||
|
}) |
||||
|
this.$message.success(`成功添加 ${data.rows.length} 条数据`) |
||||
|
} else if (data) { |
||||
|
this.$message.error(data.msg) |
||||
|
} |
||||
|
}).catch((e) => { |
||||
|
this.$message.error((e && e.msg) || '查询失败') |
||||
|
}).finally(() => { |
||||
|
this.seqNoModalLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 海安委外批量保存:主单site=大site,明细subsite取IFS回传工厂编码 - rqrq |
||||
|
*/ |
||||
|
saveNewSoIssueNotify () { |
||||
|
this.seqNoList.forEach((item) => { |
||||
|
if (item.applyQty === '' || item.applyQty == null) { |
||||
|
item.applyQty = 0 |
||||
|
} |
||||
|
item.notifyNo = this.notifyNo |
||||
|
item.site = this.$store.state.user.site |
||||
|
item.subSite = item.subSite || item.contract || item.site || this.$store.state.user.site |
||||
|
item.releaseNo = item.releaseNo || '*' |
||||
|
item.sequenceNo = item.sequenceNo || item.lineItemNo || '*' |
||||
|
}) |
||||
|
const materialList = this.seqNoList.filter((item) => item.applyQty > 0) |
||||
|
if (materialList.length === 0) { |
||||
|
this.$alert('没有需要保存的内容!', '提示', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
const saveNotify = { |
||||
|
site: this.$store.state.user.site, |
||||
|
notifyNo: this.notifyNo, |
||||
|
userName: this.$store.state.user.name, |
||||
|
orderType: 'poorder', |
||||
|
materialList |
||||
|
} |
||||
|
this.saveNewLoading = true |
||||
|
haiAnSaveNewSoIssueNotify(saveNotify).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.seqNoModalFlag = false |
||||
|
this.getUserNotifyNo() |
||||
|
this.$message.success('操作成功') |
||||
|
} else if (data) { |
||||
|
this.$message.error(data.msg) |
||||
|
} |
||||
|
}).finally(() => { |
||||
|
this.saveNewLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 委外明细入口:直接走海安poorder物料查询并回填itemNo/subsite - rqrq |
||||
|
*/ |
||||
|
enterSOSDetail (row) { |
||||
|
const rows = { |
||||
|
site: this.$store.state.user.site, |
||||
|
notifyNo: this.notifyNo, |
||||
|
orderNo: row.soorderNo || row.orderNo, |
||||
|
seqNo: row.seqNo, |
||||
|
partNo: row.fgPartNo || row.partNo, |
||||
|
itemNo: row.itemNo, |
||||
|
releaseNo: row.releaseNo, |
||||
|
sequenceNo: row.sequenceNo || row.seqNo, |
||||
|
subSite: row.subSite |
||||
|
} |
||||
|
this.enterSOS(rows) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 委外物料弹窗:查询参数使用大site,IFS回传站点映射subsite后回显 - rqrq |
||||
|
*/ |
||||
|
enterSOS (row) { |
||||
|
this.seqNoModalFlag = false |
||||
|
this.materialModalFlag = true |
||||
|
this.sobomList = [] |
||||
|
this.sobomData = { |
||||
|
orderNo: row.orderNo, |
||||
|
seqNo: row.sequenceNo || row.seqNo, |
||||
|
partNo: row.partNo, |
||||
|
subSite: row.subSite |
||||
|
} |
||||
|
this.bomLoadFlag = true |
||||
|
const inData = { |
||||
|
site: this.$store.state.user.site, |
||||
|
notifyNo: this.notifyNo, |
||||
|
orderNo: row.orderNo, |
||||
|
releaseNo: row.releaseNo, |
||||
|
sequenceNo: row.sequenceNo || row.seqNo, |
||||
|
partNo: row.partNo, |
||||
|
itemNo: row.itemNo |
||||
|
} |
||||
|
haiAnGetPoOrderMaterialForIssure(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 = this.sobomList[i].subSite || row.subSite || this.$store.state.user.site |
||||
|
} |
||||
|
} |
||||
|
}).catch(() => { |
||||
|
this.bomLoadFlag = false |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 海安委外明细保存:统一补齐notifyNo/site/subsite并写入haian_明细表 - 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.notifyNo |
||||
|
this.sobomList[i].site = this.$store.state.user.site |
||||
|
this.sobomList[i].subSite = this.sobomList[i].subSite || this.sobomData.subSite || this.$store.state.user.site |
||||
|
} |
||||
|
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.$message.success('操作成功') |
||||
|
} else if (data) { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 兼容老“单行保存父行”入口:补齐poorder+subsite后走海安父行保存接口 - rqrq |
||||
|
*/ |
||||
|
saveSOS () { |
||||
|
if (this.notifyOrderData.needDate == null || this.notifyOrderData.needDate === '') { |
||||
|
this.$message.warning('请选择时间!') |
||||
|
return false |
||||
|
} |
||||
|
const row = this.notifyOrderData |
||||
|
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 |
||||
|
break |
||||
|
} |
||||
|
} |
||||
|
if (stop) { |
||||
|
this.$alert('已经选择过此工单,请返回点击明细直接操作!!', '提示', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
} |
||||
|
this.$confirm('确定选择工单' + row.orderNo + '?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
const inData = { |
||||
|
site: this.$store.state.user.site, |
||||
|
notifyNo: this.notifyNo, |
||||
|
fgPartNo: row.partNo, |
||||
|
soorderNo: row.orderNo, |
||||
|
opsItemNo: row.itemNo, |
||||
|
sequenceNo: row.sequenceNo || row.lineItemNo || '*', |
||||
|
releaseNo: row.releaseNo || '*', |
||||
|
needDate: row.needDate, |
||||
|
issureQty: row.issureQty, |
||||
|
subSite: row.subSite || row.contract || row.site || this.$store.state.user.site, |
||||
|
orderType: 'poorder' |
||||
|
} |
||||
|
haiAnSaveSOIssueNotifyOrderList(inData).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.saveSeqNoModalFlag = false |
||||
|
row.itemNo = data.itemNo |
||||
|
row.subSite = inData.subSite |
||||
|
this.getNotifyPoDetail() |
||||
|
this.enterSOS(row) |
||||
|
} else if (data) { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 海安委外下达:调用海安下达接口,WCS推送由后续链路接管 - rqrq |
||||
|
*/ |
||||
|
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, |
||||
|
site: this.$store.state.user.site, |
||||
|
planIssueDate: this.xiadaNotifyData.planIssueDate, |
||||
|
remark: this.xiadaNotifyData.remark, |
||||
|
orderType: 'poorder' |
||||
|
} |
||||
|
haiAnXiadaNotify(notifyData).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.showXiadaNotifyDialog = false |
||||
|
this.xiadaModelFlag = false |
||||
|
this.getUserNotifyNo() |
||||
|
this.$message.success('操作成功') |
||||
|
} else if (data) { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 海安委外删除主单:仅允许未下达且无明细时删除,落海安主表删除链路 - rqrq |
||||
|
*/ |
||||
|
deleteNotify () { |
||||
|
if (this.dataList.length > 0) { |
||||
|
this.$alert('请先删除已经申请的明细记录!!', '提示', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
const data = { |
||||
|
...this.notifyData, |
||||
|
site: this.$store.state.user.site, |
||||
|
orderType: 'poorder' |
||||
|
} |
||||
|
haiAnDeleteNotify(data).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getUserNotifyNo() |
||||
|
this.$message.success(data.msg || '操作成功') |
||||
|
} else if (data) { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 海安委外删除父行:按notifyNo+itemNo+orderType删除对应父子明细 - rqrq |
||||
|
*/ |
||||
|
deleteNotifySOS (row) { |
||||
|
this.$confirm('是否删除这个工单的申请信息?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
const inData = { |
||||
|
...row, |
||||
|
site: this.$store.state.user.site, |
||||
|
notifyNo: this.notifyNo, |
||||
|
orderType: 'poorder' |
||||
|
} |
||||
|
haiAnDeleteNotifySOS(inData).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getNotifyPoDetail() |
||||
|
this.$message.success('操作成功') |
||||
|
} else if (data) { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}).catch(() => {}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 海安委外状态字典:沿用公共枚举接口,避免前端硬编码状态值 - rqrq |
||||
|
*/ |
||||
|
getAllNotifyStatus () { |
||||
|
const inData = { |
||||
|
site: this.$store.state.user.site, |
||||
|
listName: 'ISSUENOTIFYHEADER_STATUS', |
||||
|
locale: this.$i18n.locale |
||||
|
} |
||||
|
getAllNotifyStatus(inData).then(({ data }) => { |
||||
|
this.notifyStatusList = data |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
@ -0,0 +1,175 @@ |
|||||
|
<script> |
||||
|
import BaseSearchIssureNotify54 from '@/views/modules/haianWarehouse/shopOrderIssueNotify/searchIssureNotify54.vue' |
||||
|
import { |
||||
|
haiAnGetPoOrderMaterialForIssure, |
||||
|
haiAnSearchNotifyHeaderNew, |
||||
|
haiAnCheckUserHasUnissueShopOrder, |
||||
|
haiAnCancelIssueNotify |
||||
|
} from '@/api/haianWarehouse/poOrderIssueNotify.js' |
||||
|
|
||||
|
export default { |
||||
|
name: 'searchPoIssureNotify54', |
||||
|
extends: BaseSearchIssureNotify54, |
||||
|
methods: { |
||||
|
/** |
||||
|
* 委外发料查看页参数:固定orderType=poorder,保证主子表查询口径一致 - rqrq |
||||
|
*/ |
||||
|
haiAnBuildQueryData (row) { |
||||
|
const baseRow = row || {} |
||||
|
return { |
||||
|
...baseRow, |
||||
|
site: this.$store.state.user.site, |
||||
|
orderType: 'poorder' |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 委外发料主列表查询:仅查询poorder类型海安申请单 - 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 = [] |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 委外发料物料弹窗:调用海安poorder专用IFS聚合接口并透传subsite - rqrq |
||||
|
*/ |
||||
|
enterSOS (row) { |
||||
|
this.materialModalFlag = true |
||||
|
this.sobomList = [] |
||||
|
this.sobomData = { |
||||
|
orderNo: row.orderNo || row.soorderNo, |
||||
|
seqNo: row.sequenceNo || row.seqNo, |
||||
|
partNo: row.partNo || row.fgpartNo, |
||||
|
subSite: row.subSite |
||||
|
} |
||||
|
this.bomLoadFlag = true |
||||
|
const inData = { |
||||
|
site: this.$store.state.user.site, |
||||
|
notifyNo: this.currentRow.notifyNo, |
||||
|
orderNo: row.orderNo || row.soorderNo, |
||||
|
releaseNo: row.releaseNo, |
||||
|
sequenceNo: row.sequenceNo || row.seqNo, |
||||
|
itemNo: row.itemNo |
||||
|
} |
||||
|
haiAnGetPoOrderMaterialForIssure(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 = this.sobomList[i].subSite || row.subSite |
||||
|
} |
||||
|
return |
||||
|
} |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
}).catch(() => { |
||||
|
this.bomLoadFlag = false |
||||
|
this.$message.error('获取委外发料明细失败') |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 委外发料取消下达:按poorder口径检查未下达单据后再执行取消 - rqrq |
||||
|
*/ |
||||
|
cancelIssueNotifyHandle (row) { |
||||
|
const checkData = { |
||||
|
site: this.$store.state.user.site, |
||||
|
username: row.username, |
||||
|
orderType: 'poorder' |
||||
|
} |
||||
|
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('检查用户申请单失败') |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 委外发料WCS预览:按海安复刻约束保持关闭,避免触发真实推送链路 - rqrq |
||||
|
*/ |
||||
|
previewInventory () { |
||||
|
this.$message.warning('海安委外发料WCS推送功能暂不启用') |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 委外发料WCS推送:按复刻要求注掉推送,仅保留提示 - rqrq |
||||
|
*/ |
||||
|
pushToWCS () { |
||||
|
this.$message.warning('海安委外发料WCS推送功能暂不启用') |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 兼容旧按钮入口:统一提示关闭,不触发后端推送接口 - rqrq |
||||
|
*/ |
||||
|
pushToWcs () { |
||||
|
this.$message.warning('海安委外发料WCS推送功能暂不启用') |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 委外发料导出:固定按poorder维度导出海安主单数据 - 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 [] |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
@ -0,0 +1,507 @@ |
|||||
|
<script> |
||||
|
import BaseShipmentIssue from '@/views/modules/shipment/shipmentIssue.vue' |
||||
|
import { |
||||
|
haiAnGetUserNotifyNo, |
||||
|
haiAnCreateNotify, |
||||
|
haiAnGetNotifyNoDetail, |
||||
|
haiAnGetShipmentAndLineForIssure, |
||||
|
haiAnGetShipmentMaterialForIssure, |
||||
|
haiAnSaveSOIssueNotifyOrderList, |
||||
|
haiAnSaveMaterialDetail, |
||||
|
haiAnSaveNewSoIssueNotify, |
||||
|
haiAnDeleteNotifySOS, |
||||
|
haiAnDeleteNotify, |
||||
|
haiAnXiadaNotify, |
||||
|
haiAnSearchNotifyMaterialListNew, |
||||
|
getAllNotifyStatus |
||||
|
} from '@/api/haianWarehouse/shipmentIssue.js' |
||||
|
|
||||
|
export default { |
||||
|
name: 'shipmentIssue54', |
||||
|
extends: BaseShipmentIssue, |
||||
|
methods: { |
||||
|
/** |
||||
|
* 海安销售发料初始化:只读取当前用户shipment未下达申请单 - rqrq |
||||
|
*/ |
||||
|
getUserNotifyNo () { |
||||
|
const inData = { |
||||
|
site: this.$store.state.user.site, |
||||
|
username: this.$store.state.user.name, |
||||
|
orderType: 'shipment' |
||||
|
} |
||||
|
this.getAllNotifyStatus() |
||||
|
haiAnGetUserNotifyNo(inData).then(({ data }) => { |
||||
|
if (data && 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 = [] |
||||
|
this.sobomList = [] |
||||
|
} |
||||
|
return |
||||
|
} |
||||
|
this.notifyNo = '' |
||||
|
this.dataList = [] |
||||
|
this.sobomList = [] |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 海安销售发料父行查询:固定orderType=shipment,避免误读shoporder数据 - rqrq |
||||
|
*/ |
||||
|
getNotifyNoDetail () { |
||||
|
const inData = { |
||||
|
site: this.$store.state.user.site, |
||||
|
notifyNo: this.notifyNo, |
||||
|
orderType: 'shipment' |
||||
|
} |
||||
|
haiAnGetNotifyNoDetail(inData).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.dataList = data.rows || [] |
||||
|
} else { |
||||
|
this.dataList = [] |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 海安新建销售发料主单:主记录site使用当前登录大site - rqrq |
||||
|
*/ |
||||
|
addNotify () { |
||||
|
const inData = { |
||||
|
site: this.$store.state.user.site, |
||||
|
userName: this.$store.state.user.name, |
||||
|
orderType: 'shipment' |
||||
|
} |
||||
|
haiAnCreateNotify(inData).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.showAddNotifyTypeDialog = false |
||||
|
this.$message.success('操作成功') |
||||
|
this.getUserNotifyNo() |
||||
|
} else if (data) { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 海安新建销售发料主单(带备注):沿用原交互并固定orderType=shipment - rqrq |
||||
|
*/ |
||||
|
confirmAddNotify () { |
||||
|
const outWorkOrderFlag = this.selectedNotifyType === 'outsourced' ? 'Y' : 'N' |
||||
|
const inData = { |
||||
|
site: this.$store.state.user.site, |
||||
|
userName: this.$store.state.user.name, |
||||
|
outWorkOrderFlag, |
||||
|
remark: this.selectedNotifyRemark, |
||||
|
orderType: 'shipment' |
||||
|
} |
||||
|
this.getAllNotifyStatus() |
||||
|
haiAnCreateNotify(inData).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.showAddNotifyTypeDialog = false |
||||
|
this.$message.success('操作成功') |
||||
|
this.getUserNotifyNo() |
||||
|
} else if (data) { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 销售发货单查询:IFS入参仍用大site,回传contract/site映射为subsite保存 - rqrq |
||||
|
*/ |
||||
|
searchSOSRouting () { |
||||
|
if (this.seqNoData.orderNo == null || this.seqNoData.orderNo === '') { |
||||
|
this.$message.warning('请输入shipmentid!') |
||||
|
return false |
||||
|
} |
||||
|
if (!this.seqNoList) { |
||||
|
this.seqNoList = [] |
||||
|
} |
||||
|
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 |
||||
|
haiAnGetShipmentAndLineForIssure(this.seqNoData).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
;(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) |
||||
|
newRow.orderNo = newRow.orderNo || newRow.shipmentId |
||||
|
newRow.partNo = newRow.partNo || newRow.inventoryPartNo |
||||
|
newRow.subSite = newRow.subSite || newRow.contract || newRow.site || this.$store.state.user.site |
||||
|
// shipment父行按单号汇总,release/sequence固定占位,避免同单多行拆成多父记录 - rqrq |
||||
|
newRow.releaseNo = '*' |
||||
|
newRow.sequenceNo = '*' |
||||
|
this.seqNoList.push(newRow) |
||||
|
}) |
||||
|
this.$message.success(`成功添加 ${(data.rows || []).length} 条数据`) |
||||
|
} else if (data) { |
||||
|
this.$message.error(data.msg) |
||||
|
} |
||||
|
}).catch((e) => { |
||||
|
this.$message.error((e && e.msg) || '查询失败') |
||||
|
}).finally(() => { |
||||
|
this.seqNoModalLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 海安销售发料批量保存:主单site=大site,明细subsite取IFS工厂编码 - rqrq |
||||
|
*/ |
||||
|
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 |
||||
|
this.seqNoList[i].orderNo = this.seqNoList[i].orderNo || this.seqNoList[i].shipmentId |
||||
|
this.seqNoList[i].partNo = this.seqNoList[i].partNo || this.seqNoList[i].inventoryPartNo |
||||
|
this.seqNoList[i].subSite = this.seqNoList[i].subSite || this.seqNoList[i].contract || this.seqNoList[i].site || this.$store.state.user.site |
||||
|
this.seqNoList[i].releaseNo = this.seqNoList[i].releaseNo || '*' |
||||
|
this.seqNoList[i].sequenceNo = this.seqNoList[i].sequenceNo || '*' |
||||
|
} |
||||
|
const materialList = this.seqNoList.filter((item) => item.qtyToApply > 0) |
||||
|
if (materialList.length === 0) { |
||||
|
this.$alert('没有需要保存的内容!', '提示', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
const saveNotify = { |
||||
|
site: this.$store.state.user.site, |
||||
|
notifyNo: this.notifyNo, |
||||
|
userName: this.$store.state.user.name, |
||||
|
orderType: 'shipment', |
||||
|
materialList |
||||
|
} |
||||
|
this.saveNewLoading = true |
||||
|
haiAnSaveNewSoIssueNotify(saveNotify).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.seqNoModalFlag = false |
||||
|
this.getUserNotifyNo() |
||||
|
this.$message.success('操作成功') |
||||
|
} else if (data) { |
||||
|
this.$message.error(data.msg) |
||||
|
} |
||||
|
}).finally(() => { |
||||
|
this.saveNewLoading = false |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 销售发料物料入口:按父行itemNo+shipmentId查询海安明细并回显subsite - rqrq |
||||
|
*/ |
||||
|
enterSOSDetail (row) { |
||||
|
const rows = { |
||||
|
site: this.$store.state.user.site, |
||||
|
notifyNo: this.notifyNo, |
||||
|
soorderNo: row.soorderNo || row.orderNo, |
||||
|
partNo: row.fgpartNo || row.partNo, |
||||
|
itemNo: row.itemNo, |
||||
|
subSite: row.subSite |
||||
|
} |
||||
|
this.sobomData.orderNo = rows.soorderNo |
||||
|
this.searchUnissueNotifyMaterialList(rows) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 销售发料明细查询:仍按大site调接口,回传工厂编码映射subsite保存到行数据 - rqrq |
||||
|
*/ |
||||
|
searchUnissueNotifyMaterialList (row) { |
||||
|
this.bomLoadFlag = true |
||||
|
this.materialModalFlag = true |
||||
|
const inData = { |
||||
|
site: this.$store.state.user.site, |
||||
|
notifyNo: this.notifyNo, |
||||
|
soorderNo: row.soorderNo || row.orderNo, |
||||
|
itemNo: row.itemNo, |
||||
|
subSite: row.subSite |
||||
|
} |
||||
|
haiAnGetShipmentMaterialForIssure(inData).then(({ data }) => { |
||||
|
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 = this.sobomList[i].subSite || row.subSite || this.$store.state.user.site |
||||
|
} |
||||
|
} else { |
||||
|
this.sobomList = [] |
||||
|
} |
||||
|
}).finally(() => { |
||||
|
this.bomLoadFlag = false |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 新增后立即进入明细:统一复用海安shipment物料查询,避免回调老接口 - rqrq |
||||
|
*/ |
||||
|
enterSOS (row) { |
||||
|
this.seqNoModalFlag = false |
||||
|
this.sobomData = { |
||||
|
orderNo: row.orderNo || row.shipmentId, |
||||
|
seqNo: row.seqNo, |
||||
|
partNo: row.partNo || row.inventoryPartNo, |
||||
|
subSite: row.subSite |
||||
|
} |
||||
|
this.searchUnissueNotifyMaterialList({ |
||||
|
soorderNo: row.orderNo || row.shipmentId, |
||||
|
orderNo: row.orderNo || row.shipmentId, |
||||
|
itemNo: row.itemNo, |
||||
|
subSite: row.subSite |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 海安销售发料明细保存:统一补齐notifyNo/site/subsite后写入haian_子表 - 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.notifyNo |
||||
|
this.sobomList[i].site = this.$store.state.user.site |
||||
|
this.sobomList[i].bomItemNo = this.sobomList[i].lineItemNo || this.sobomList[i].bomItemNo |
||||
|
this.sobomList[i].subSite = this.sobomList[i].subSite || this.sobomData.subSite || this.$store.state.user.site |
||||
|
} |
||||
|
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.$message.success('操作成功') |
||||
|
} else if (data) { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 兼容单行父行保存入口:按shipment固定orderType+subsite写海安父行 - rqrq |
||||
|
*/ |
||||
|
saveSOS () { |
||||
|
if (this.notifyOrderData.needDate == null || this.notifyOrderData.needDate === '') { |
||||
|
this.$message.warning('请选择时间!') |
||||
|
return false |
||||
|
} |
||||
|
const row = this.notifyOrderData |
||||
|
if (this.dataList.length > 0) { |
||||
|
const stop = this.dataList.some(item => item.soorderNo === row.orderNo) |
||||
|
if (stop) { |
||||
|
this.$alert('已经选择过此SHIPMENT,请返回点击明细直接操作!!', '提示', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
} |
||||
|
this.$confirm('确定选择SHIPMENT' + row.orderNo + '?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
const inData = { |
||||
|
site: this.$store.state.user.site, |
||||
|
notifyNo: this.notifyNo, |
||||
|
fgPartNo: row.partNo, |
||||
|
soorderNo: row.orderNo, |
||||
|
opsItemNo: row.itemNo, |
||||
|
sequenceNo: '*', |
||||
|
releaseNo: '*', |
||||
|
needDate: row.needDate, |
||||
|
subSite: row.subSite || row.contract || row.site || this.$store.state.user.site, |
||||
|
orderType: 'shipment' |
||||
|
} |
||||
|
haiAnSaveSOIssueNotifyOrderList(inData).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.saveSeqNoModalFlag = false |
||||
|
row.itemNo = data.itemNo |
||||
|
row.subSite = inData.subSite |
||||
|
this.getNotifyNoDetail() |
||||
|
this.enterSOS(row) |
||||
|
} else if (data) { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 海安销售发料下达:调用海安下达接口,WCS推送保持占位不在本页触发 - rqrq |
||||
|
*/ |
||||
|
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, |
||||
|
site: this.$store.state.user.site, |
||||
|
planIssueDate: this.xiadaNotifyData.planIssueDate, |
||||
|
remark: this.xiadaNotifyData.remark, |
||||
|
orderType: 'shipment' |
||||
|
} |
||||
|
haiAnXiadaNotify(notifyData).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.showXiadaNotifyDialog = false |
||||
|
this.xiadaModelFlag = false |
||||
|
this.getUserNotifyNo() |
||||
|
this.$message.success('操作成功') |
||||
|
} else if (data) { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 海安销售发料删除主单:仅允许未下达无明细时删除 - rqrq |
||||
|
*/ |
||||
|
deleteNotify () { |
||||
|
if (this.dataList.length > 0) { |
||||
|
this.$alert('请先删除已经申请的明细记录!!', '提示', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
return false |
||||
|
} |
||||
|
const inData = { |
||||
|
...this.notifyData, |
||||
|
site: this.$store.state.user.site, |
||||
|
orderType: 'shipment' |
||||
|
} |
||||
|
haiAnDeleteNotify(inData).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getUserNotifyNo() |
||||
|
this.$message.success(data.msg || '操作成功') |
||||
|
} else if (data) { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 海安销售发料删除父行:按notifyNo+itemNo+orderType删除对应父子记录 - rqrq |
||||
|
*/ |
||||
|
deleteNotifySOS (row) { |
||||
|
this.$confirm('是否删除这个工单的申请信息?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
const inData = { |
||||
|
...row, |
||||
|
site: this.$store.state.user.site, |
||||
|
notifyNo: this.notifyNo, |
||||
|
orderType: 'shipment' |
||||
|
} |
||||
|
haiAnDeleteNotifySOS(inData).then(({ data }) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getNotifyNoDetail() |
||||
|
this.$message.success('操作成功') |
||||
|
} else if (data) { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}).catch(() => {}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 销售发料材料页签刷新:按shipment维度从海安明细表回显最新保存结果 - rqrq |
||||
|
*/ |
||||
|
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: 'shipment' |
||||
|
} |
||||
|
if (this.currentRow && this.currentRow !== '' && this.currentRow.notifyNo) { |
||||
|
queryData = { |
||||
|
...this.currentRow, |
||||
|
site: this.notifyData.site || this.$store.state.user.site, |
||||
|
orderType: 'shipment' |
||||
|
} |
||||
|
} |
||||
|
this.dataListLoading = true |
||||
|
haiAnSearchNotifyMaterialListNew(queryData).then(({ data }) => { |
||||
|
this.dataListLoading = false |
||||
|
if (data && data.code === 0) { |
||||
|
this.materialDetailList = data.rows || [] |
||||
|
} else { |
||||
|
this.materialDetailList = [] |
||||
|
} |
||||
|
}).catch(() => { |
||||
|
this.dataListLoading = false |
||||
|
this.materialDetailList = [] |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 销售发料状态枚举查询:沿用公共字典接口 - rqrq |
||||
|
*/ |
||||
|
getAllNotifyStatus () { |
||||
|
const inData = { |
||||
|
site: this.$store.state.user.site, |
||||
|
listName: 'ISSUENOTIFYHEADER_STATUS', |
||||
|
locale: this.$i18n.locale |
||||
|
} |
||||
|
getAllNotifyStatus(inData).then(({ data }) => { |
||||
|
this.notifyStatusList = data |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
@ -0,0 +1,174 @@ |
|||||
|
<script> |
||||
|
import BaseSearchIssureNotify54 from '@/views/modules/haianWarehouse/shopOrderIssueNotify/searchIssureNotify54.vue' |
||||
|
import { |
||||
|
haiAnGetShipmentMaterialForIssure, |
||||
|
haiAnSearchNotifyHeaderNew, |
||||
|
haiAnCheckUserHasUnissueShopOrder, |
||||
|
haiAnCancelIssueNotify |
||||
|
} from '@/api/haianWarehouse/shipmentIssue.js' |
||||
|
|
||||
|
export default { |
||||
|
name: 'shipmentNotification54', |
||||
|
extends: BaseSearchIssureNotify54, |
||||
|
methods: { |
||||
|
/** |
||||
|
* 销售发料查看页查询参数:固定orderType=shipment,避免与shoporder串单 - rqrq |
||||
|
*/ |
||||
|
haiAnBuildQueryData (row) { |
||||
|
const baseRow = row || {} |
||||
|
return { |
||||
|
...baseRow, |
||||
|
site: this.$store.state.user.site, |
||||
|
orderType: 'shipment' |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 销售发料主列表查询:按shipment业务类型过滤海安主单 - 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 = [] |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 销售发料物料弹窗:调用海安shipment专用IFS聚合接口并回填subsite - rqrq |
||||
|
*/ |
||||
|
enterSOS (row) { |
||||
|
this.materialModalFlag = true |
||||
|
this.sobomList = [] |
||||
|
this.sobomData = { |
||||
|
orderNo: row.orderNo || row.soorderNo, |
||||
|
seqNo: row.seqNo, |
||||
|
partNo: row.partNo || row.fgpartNo, |
||||
|
subSite: row.subSite |
||||
|
} |
||||
|
this.bomLoadFlag = true |
||||
|
const inData = { |
||||
|
site: this.$store.state.user.site, |
||||
|
notifyNo: this.currentRow.notifyNo, |
||||
|
soorderNo: row.orderNo || row.soorderNo, |
||||
|
itemNo: row.itemNo, |
||||
|
subSite: row.subSite |
||||
|
} |
||||
|
haiAnGetShipmentMaterialForIssure(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 = this.sobomList[i].subSite || row.subSite |
||||
|
} |
||||
|
return |
||||
|
} |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
}).catch(() => { |
||||
|
this.bomLoadFlag = false |
||||
|
this.$message.error('获取销售发料明细失败') |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 销售发料取消下达:检查同用户shipment未下达单据后再执行取消 - rqrq |
||||
|
*/ |
||||
|
cancelIssueNotifyHandle (row) { |
||||
|
const checkData = { |
||||
|
site: this.$store.state.user.site, |
||||
|
username: row.username, |
||||
|
orderType: 'shipment' |
||||
|
} |
||||
|
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('检查用户申请单失败') |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 销售发料WCS预览:按海安复刻约束保持关闭,避免触发真实推送链路 - rqrq |
||||
|
*/ |
||||
|
previewInventory () { |
||||
|
this.$message.warning('海安销售发料WCS推送功能暂不启用') |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 销售发料WCS推送:按复刻要求注掉推送,仅保留提示 - rqrq |
||||
|
*/ |
||||
|
pushToWCS () { |
||||
|
this.$message.warning('海安销售发料WCS推送功能暂不启用') |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 兼容旧按钮入口:统一走关闭提示,不触发任何后端推送接口 - rqrq |
||||
|
*/ |
||||
|
pushToWcs () { |
||||
|
this.$message.warning('海安销售发料WCS推送功能暂不启用') |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 销售发料导出:固定按shipment维度导出海安主单数据 - 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 [] |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue