feat(wms): 新增APS排产相关页面及产需单跳转排产功能
1. 新增/aps/requirement和/aps/schedule路由页面 2. 实现产需单列表跳转排产单功能 3. 为排产页面添加参数接收与自动查询逻辑 4. 新增弹窗组件间传递APS页面参数的能力 5. 优化产需单列表UI布局与绑定状态展示
This commit is contained in:
@@ -653,6 +653,13 @@ import ProcessSelect from '@/components/KLPService/ProcessSelect/index.vue'
|
||||
export default {
|
||||
name: 'ApsSchedule',
|
||||
components: { ProcessSelect },
|
||||
props: {
|
||||
// 由 flow.vue 通过 switchApsPage 传入的参数
|
||||
apsParams: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const today = new Date()
|
||||
const y = today.getFullYear()
|
||||
@@ -726,8 +733,49 @@ export default {
|
||||
)
|
||||
}
|
||||
},
|
||||
watch: {},
|
||||
watch: {
|
||||
// 接收 flow.vue 传入的参数:设置日期并自动查询
|
||||
apsParams: {
|
||||
handler(val) {
|
||||
if (val && val.prodDate) {
|
||||
this.queryDate = val.prodDate
|
||||
}
|
||||
if (val && val.scheduleStatus !== undefined) {
|
||||
// 根据产需单状态自动切换 Tab
|
||||
// 1=待审核 2=已接收 4=已排产
|
||||
const statusToTab = { 1: 'pending', 2: 'accepted', 4: 'scheduled' }
|
||||
const tab = statusToTab[val.scheduleStatus] || 'pending'
|
||||
this.activeTab = tab
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.handleQuery()
|
||||
})
|
||||
},
|
||||
immediate: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 优先从路由参数获取(产需单点击"跳转排产"通过 $router.push 传参)
|
||||
const query = this.$route.query
|
||||
// 其次从 apsParams prop 获取(弹窗内由 flow.vue 切换组件传入)
|
||||
const params = this.apsParams
|
||||
|
||||
let hasExternal = false
|
||||
if (query && query.prodDate) {
|
||||
this.queryDate = query.prodDate
|
||||
hasExternal = true
|
||||
if (query.scheduleStatus !== undefined) {
|
||||
const statusToTab = { 1: 'pending', 2: 'accepted', 4: 'scheduled' }
|
||||
this.activeTab = statusToTab[Number(query.scheduleStatus)] || 'pending'
|
||||
}
|
||||
} else if (params && params.prodDate) {
|
||||
this.queryDate = params.prodDate
|
||||
hasExternal = true
|
||||
if (params.scheduleStatus !== undefined) {
|
||||
const statusToTab = { 1: 'pending', 2: 'accepted', 4: 'scheduled' }
|
||||
this.activeTab = statusToTab[params.scheduleStatus] || 'pending'
|
||||
}
|
||||
}
|
||||
this.handleQuery()
|
||||
},
|
||||
methods: {
|
||||
|
||||
Reference in New Issue
Block a user