|
|
@ -102,6 +102,11 @@ |
|
|
<button class="action-btn primary" :disabled="saveLoading || pageBusy" @click="handleSave"> |
|
|
<button class="action-btn primary" :disabled="saveLoading || pageBusy" @click="handleSave"> |
|
|
{{ saveLoading ? '保存中...' : '保存' }} |
|
|
{{ saveLoading ? '保存中...' : '保存' }} |
|
|
</button> |
|
|
</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> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
@ -111,7 +116,7 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { scanPalletForSpecialEdit, savePalletSpecialEdit, listStationsForSpecialEdit } from '../../../api/haianAutoWarehouse/palletSpecialEdit' |
|
|
|
|
|
|
|
|
import { scanPalletForSpecialEdit, savePalletSpecialEdit, forceRemovePalletSpecialEdit, listStationsForSpecialEdit } from '../../../api/haianAutoWarehouse/palletSpecialEdit' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: 'haianPalletSpecialEdit', |
|
|
name: 'haianPalletSpecialEdit', |
|
|
@ -123,6 +128,9 @@ export default { |
|
|
scanned: false, |
|
|
scanned: false, |
|
|
scanLoading: false, |
|
|
scanLoading: false, |
|
|
saveLoading: false, |
|
|
saveLoading: false, |
|
|
|
|
|
// 移除中锁定重复操作;wcsOccupied保存扫描时的真实货架状态,不受表单选择影响 - rqrq |
|
|
|
|
|
removeLoading: false, |
|
|
|
|
|
wcsOccupied: false, |
|
|
stationLoading: false, |
|
|
stationLoading: false, |
|
|
stationRequestSeq: 0, |
|
|
stationRequestSeq: 0, |
|
|
areaOptions: [], |
|
|
areaOptions: [], |
|
|
@ -138,9 +146,9 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
// 只在扫描和保存时锁整页。拉站点不能锁整页,否则非立库区域一选中,任务标记和区域也会被禁用 - rqrq |
|
|
|
|
|
|
|
|
// 扫描、保存和强制移除时锁整页;拉站点不锁整页,避免禁用其它字段 - rqrq |
|
|
pageBusy() { |
|
|
pageBusy() { |
|
|
return this.scanLoading || this.saveLoading |
|
|
|
|
|
|
|
|
return this.scanLoading || this.saveLoading || this.removeLoading |
|
|
}, |
|
|
}, |
|
|
// 立库区域所在位置用手输,其它区域用站点下拉。标记来自扫描结果里的stockArea - rqrq |
|
|
// 立库区域所在位置用手输,其它区域用站点下拉。标记来自扫描结果里的stockArea - rqrq |
|
|
isStockArea() { |
|
|
isStockArea() { |
|
|
@ -221,6 +229,8 @@ export default { |
|
|
}, |
|
|
}, |
|
|
// 把扫描结果写进表单;区域列表为空时仍保留当前区域编码,避免下拉空白 - rqrq |
|
|
// 把扫描结果写进表单;区域列表为空时仍保留当前区域编码,避免下拉空白 - rqrq |
|
|
applyScanResult(row, scannedCode) { |
|
|
applyScanResult(row, scannedCode) { |
|
|
|
|
|
// 货架占用由后端根据wcs_location生成,独立保存以免用户修改表单后误开放移除按钮 - rqrq |
|
|
|
|
|
this.wcsOccupied = row.onShelfFlag === 'Y' |
|
|
this.form = { |
|
|
this.form = { |
|
|
palletId: row.palletId || scannedCode, |
|
|
palletId: row.palletId || scannedCode, |
|
|
callingFlag: row.callingFlag === 'Y' ? 'Y' : 'N', |
|
|
callingFlag: row.callingFlag === 'Y' ? 'Y' : 'N', |
|
|
@ -374,7 +384,41 @@ export default { |
|
|
this.saveLoading = false |
|
|
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 |
|
|
this.scanLoading = true |
|
|
scanPalletForSpecialEdit({ |
|
|
scanPalletForSpecialEdit({ |
|
|
site: this.site, |
|
|
site: this.site, |
|
|
@ -384,13 +428,14 @@ export default { |
|
|
this.applyScanResult(data.row, this.form.palletId) |
|
|
this.applyScanResult(data.row, this.form.palletId) |
|
|
} |
|
|
} |
|
|
}).catch(() => { |
|
|
}).catch(() => { |
|
|
this.$message.error('保存后刷新栈板失败') |
|
|
|
|
|
|
|
|
this.$message.error(operationName + '后刷新栈板失败') |
|
|
}).finally(() => { |
|
|
}).finally(() => { |
|
|
this.scanLoading = false |
|
|
this.scanLoading = false |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
clearScan() { |
|
|
clearScan() { |
|
|
this.scanned = false |
|
|
this.scanned = false |
|
|
|
|
|
this.wcsOccupied = false |
|
|
this.areaOptions = [] |
|
|
this.areaOptions = [] |
|
|
this.stationOptions = [] |
|
|
this.stationOptions = [] |
|
|
this.form = { |
|
|
this.form = { |
|
|
@ -475,6 +520,10 @@ export default { |
|
|
.bottom-actions { |
|
|
.bottom-actions { |
|
|
margin-top: 16px; |
|
|
margin-top: 16px; |
|
|
} |
|
|
} |
|
|
|
|
|
.bottom-actions .danger { |
|
|
|
|
|
margin-top: 12px; |
|
|
|
|
|
background: #F56C6C; |
|
|
|
|
|
} |
|
|
.action-btn { |
|
|
.action-btn { |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
padding: 12px; |
|
|
padding: 12px; |
|
|
|