Browse Source

小修改

dev
常熟吴彦祖 1 month ago
parent
commit
95f84ae3f3
  1. 3
      src/api/haianAutoWarehouse/palletSpecialEdit.js
  2. 59
      src/views/modules/haianAutoWarehouse/haianPalletSpecialEdit.vue

3
src/api/haianAutoWarehouse/palletSpecialEdit.js

@ -6,5 +6,8 @@ export const scanPalletForSpecialEdit = data => createAPI(`/haiAnWcsIntegration/
// 海安栈板特殊修改:在货架为是时位置同时写入location_code和wcs_location,为否时清空wcs_location - rqrq
export const savePalletSpecialEdit = data => createAPI(`/haiAnWcsIntegration/savePalletSpecialEdit`, 'post', data)
// 海安栈板特殊修改:强制移除非立库栈板,只清空区域和位置,货架点位有值时后端拒绝 - rqrq
export const forceRemovePalletSpecialEdit = data => createAPI(`/haiAnWcsIntegration/forceRemovePalletSpecialEdit`, 'post', data)
// 海安栈板特殊修改:非立库区域查询全部地面站点,供所在位置下拉 - rqrq
export const listStationsForSpecialEdit = data => createAPI(`/haiAnWcsIntegration/listStationsForSpecialEdit`, 'post', data)

59
src/views/modules/haianAutoWarehouse/haianPalletSpecialEdit.vue

@ -102,6 +102,11 @@
<button class="action-btn primary" :disabled="saveLoading || pageBusy" @click="handleSave">
{{ saveLoading ? '保存中...' : '保存' }}
</button>
<!-- 强制移除只清空所在区域与位置;扫描发现wcs_location有值时禁用,提交时后端再次校验 - rqrq -->
<button class="action-btn danger" :disabled="pageBusy || wcsOccupied" @click="handleForceRemove">
{{ removeLoading ? '移除中...' : '强制移除托盘' }}
</button>
<div v-if="wcsOccupied" class="hint">托盘在立库货架内,不能强制移除。</div>
</div>
</div>
</div>
@ -111,7 +116,7 @@
</template>
<script>
import { scanPalletForSpecialEdit, savePalletSpecialEdit, listStationsForSpecialEdit } from '../../../api/haianAutoWarehouse/palletSpecialEdit'
import { scanPalletForSpecialEdit, savePalletSpecialEdit, forceRemovePalletSpecialEdit, listStationsForSpecialEdit } from '../../../api/haianAutoWarehouse/palletSpecialEdit'
export default {
name: 'haianPalletSpecialEdit',
@ -123,6 +128,9 @@ export default {
scanned: false,
scanLoading: false,
saveLoading: false,
// 移除中锁定重复操作;wcsOccupied保存扫描时的真实货架状态,不受表单选择影响 - rqrq
removeLoading: false,
wcsOccupied: false,
stationLoading: false,
stationRequestSeq: 0,
areaOptions: [],
@ -138,9 +146,9 @@ export default {
}
},
computed: {
// 只在扫描和保存时锁整页。拉站点不能锁整页,否则非立库区域一选中,任务标记和区域也会被禁用 - rqrq
// 扫描、保存和强制移除时锁整页;拉站点不锁整页,避免禁用其它字段 - rqrq
pageBusy() {
return this.scanLoading || this.saveLoading
return this.scanLoading || this.saveLoading || this.removeLoading
},
// 立库区域所在位置用手输,其它区域用站点下拉。标记来自扫描结果里的stockArea - rqrq
isStockArea() {
@ -221,6 +229,8 @@ export default {
},
// 把扫描结果写进表单;区域列表为空时仍保留当前区域编码,避免下拉空白 - rqrq
applyScanResult(row, scannedCode) {
// 货架占用由后端根据wcs_location生成,独立保存以免用户修改表单后误开放移除按钮 - rqrq
this.wcsOccupied = row.onShelfFlag === 'Y'
this.form = {
palletId: row.palletId || scannedCode,
callingFlag: row.callingFlag === 'Y' ? 'Y' : 'N',
@ -374,7 +384,41 @@ export default {
this.saveLoading = false
})
},
reloadAfterSave() {
// 强制移除前确认托盘编号;请求只传site和palletId,货架占用由服务端实时判断 - rqrq
async handleForceRemove () {
if (this.pageBusy || !this.scanned || !this.form.palletId || this.wcsOccupied) {
return
}
this.removeLoading = true
try {
await this.$confirm('确认强制移除托盘【' + this.form.palletId + '】?此操作会清空所在区域和位置。', '强制移除托盘', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnClickModal: false
})
// 显式传登录工厂与扫码托盘;接口失败不刷新页面,避免误示操作已成功 - rqrq
this.site = this.$store.state.user.site
const { data } = await forceRemovePalletSpecialEdit({
site: this.site,
palletId: this.form.palletId
})
if (data && data.code === 0) {
this.$message.success(data.msg || '强制移除托盘成功')
this.reloadAfterSave('移除')
} else {
this.$alert((data && data.msg) || '强制移除托盘失败', '错误', { confirmButtonText: '确定' })
}
} catch (error) {
if (error !== 'cancel' && error !== 'close') {
this.$message.error((error && error.message) || '强制移除托盘失败')
}
} finally {
this.removeLoading = false
}
},
// 保存或移除后重查同一托盘,页面回显数据库最新区域与位置;刷新失败提示当前操作名称 - rqrq
reloadAfterSave (operationName = '保存') {
this.scanLoading = true
scanPalletForSpecialEdit({
site: this.site,
@ -384,13 +428,14 @@ export default {
this.applyScanResult(data.row, this.form.palletId)
}
}).catch(() => {
this.$message.error('保存后刷新栈板失败')
this.$message.error(operationName + '后刷新栈板失败')
}).finally(() => {
this.scanLoading = false
})
},
clearScan() {
this.scanned = false
this.wcsOccupied = false
this.areaOptions = []
this.stationOptions = []
this.form = {
@ -475,6 +520,10 @@ export default {
.bottom-actions {
margin-top: 16px;
}
.bottom-actions .danger {
margin-top: 12px;
background: #F56C6C;
}
.action-btn {
width: 100%;
padding: 12px;

Loading…
Cancel
Save