Browse Source

2026-07-22

优化
master
fengyuan_yang 1 week ago
parent
commit
e91c36d832
  1. 28
      src/views/modules/shopOrder/workOrderAlloc/searchWorkOrderDetailsAlloc.vue

28
src/views/modules/shopOrder/workOrderAlloc/searchWorkOrderDetailsAlloc.vue

@ -400,7 +400,6 @@ export default {
this.getButtonAuthData() this.getButtonAuthData()
this.setDefaultDateRange() this.setDefaultDateRange()
this.getSiteList() this.getSiteList()
this.getData()
}, },
methods: { methods: {
// //
@ -414,6 +413,15 @@ export default {
getSiteList().then(({ data }) => { getSiteList().then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.siteList = data.siteList || [] this.siteList = data.siteList || []
if (this.siteList.length > 0) {
//
if (!this.searchData.site || !this.siteList.includes(this.searchData.site)) {
this.searchData.site = this.siteList[0]
}
this.getData()
} else {
this.searchData.site = ''
}
} }
}) })
}, },
@ -447,7 +455,7 @@ export default {
}, },
resetSearch () { resetSearch () {
this.searchData = { this.searchData = {
site: '',
site: this.siteList.length > 0 ? this.siteList[0] : '',
orderNo: '', orderNo: '',
orderStatus: '', orderStatus: '',
partNo: '', partNo: '',
@ -464,6 +472,13 @@ export default {
this.allocList = [] this.allocList = []
this.setDefaultDateRange() this.setDefaultDateRange()
}, },
ensureSiteSelected (actionName) {
if (!this.searchData.site) {
this.$message.warning(`请选择工厂编码后再${actionName}`)
return false
}
return true
},
buildAllocQueryParams () { buildAllocQueryParams () {
return { return {
site: this.searchData.site || '', site: this.searchData.site || '',
@ -482,6 +497,9 @@ export default {
} }
}, },
getData () { getData () {
if (!this.ensureSiteSelected('查询')) {
return
}
this.searchLoading = true this.searchLoading = true
this.orderListLoading = true this.orderListLoading = true
const queryData = { const queryData = {
@ -568,6 +586,9 @@ export default {
this.getAllocData() this.getAllocData()
}, },
executeAlloc () { executeAlloc () {
if (!this.ensureSiteSelected('执行工单明细数据汇总')) {
return
}
this.$confirm('将按当前查询条件执行工单明细数据汇总,是否继续?', '提示', { this.$confirm('将按当前查询条件执行工单明细数据汇总,是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -579,6 +600,9 @@ export default {
}) })
}, },
doExecuteAlloc () { doExecuteAlloc () {
if (!this.ensureSiteSelected('执行工单明细数据汇总')) {
return
}
this.allocLoading = true this.allocLoading = true
const requestData = { const requestData = {
...this.buildAllocQueryParams(), ...this.buildAllocQueryParams(),

Loading…
Cancel
Save