|
@@ -39,6 +39,29 @@
|
|
|
>{{ "保存数据库" }}</q-tooltip
|
|
>{{ "保存数据库" }}</q-tooltip
|
|
|
></q-btn
|
|
></q-btn
|
|
|
>
|
|
>
|
|
|
|
|
+ <q-btn
|
|
|
|
|
+ flat
|
|
|
|
|
+ @click="showLocationErrorsDialog = true"
|
|
|
|
|
+ round
|
|
|
|
|
+ dense
|
|
|
|
|
+ icon="mail"
|
|
|
|
|
+ style="position: relative"
|
|
|
|
|
+ >
|
|
|
|
|
+ <q-badge
|
|
|
|
|
+ v-if="locationErrorsCount > 0"
|
|
|
|
|
+ color="red"
|
|
|
|
|
+ floating
|
|
|
|
|
+ rounded
|
|
|
|
|
+ :label="locationErrorsCount > 99 ? '99+' : locationErrorsCount"
|
|
|
|
|
+ />
|
|
|
|
|
+ <q-tooltip
|
|
|
|
|
+ content-class="bg-amber text-black shadow-4"
|
|
|
|
|
+ :offset="[15, 15]"
|
|
|
|
|
+ content-style="font-size: 12px"
|
|
|
|
|
+ >
|
|
|
|
|
+ 位置异常通知 ({{ locationErrorsCount }})
|
|
|
|
|
+ </q-tooltip>
|
|
|
|
|
+ </q-btn>
|
|
|
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
|
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
|
|
<transition appear enter-active-class="animated zoomIn">
|
|
<transition appear enter-active-class="animated zoomIn">
|
|
|
<q-btn
|
|
<q-btn
|
|
@@ -690,6 +713,174 @@
|
|
|
</q-card-section>
|
|
</q-card-section>
|
|
|
</q-card>
|
|
</q-card>
|
|
|
</q-dialog>
|
|
</q-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 位置错误通知对话框 -->
|
|
|
|
|
+ <q-dialog v-model="showLocationErrorsDialog" maximized>
|
|
|
|
|
+ <q-card>
|
|
|
|
|
+ <q-card-section class="row items-center q-pb-none">
|
|
|
|
|
+ <div class="text-h6">位置异常通知</div>
|
|
|
|
|
+ <q-space />
|
|
|
|
|
+ <q-btn icon="close" flat round dense v-close-popup />
|
|
|
|
|
+ </q-card-section>
|
|
|
|
|
+
|
|
|
|
|
+ <q-card-section>
|
|
|
|
|
+ <q-list v-if="locationErrors.length > 0" separator>
|
|
|
|
|
+ <q-expansion-item
|
|
|
|
|
+ v-for="(error, index) in locationErrors"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ :label="`${error.location_code} - ${error.error_type_display}`"
|
|
|
|
|
+ :caption="`检测时间: ${formatErrorDateTime(error.detected_at)}`"
|
|
|
|
|
+ header-class="text-primary"
|
|
|
|
|
+ >
|
|
|
|
|
+ <q-card>
|
|
|
|
|
+ <q-card-section>
|
|
|
|
|
+ <div class="row q-mb-md">
|
|
|
|
|
+ <div class="col-6">
|
|
|
|
|
+ <div class="text-caption text-grey">位置编码</div>
|
|
|
|
|
+ <div class="text-body1">{{ error.location_code }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-3">
|
|
|
|
|
+ <div class="text-caption text-grey">层/行/列</div>
|
|
|
|
|
+ <div class="text-body1">{{ error.layer }}/{{ error.row }}/{{ error.col }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-3">
|
|
|
|
|
+ <div class="text-caption text-grey">当前状态</div>
|
|
|
|
|
+ <div class="text-body1">{{ error.current_status }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <q-separator class="q-my-md" />
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 错误类型1: 库位占用但没有绑定托盘 -->
|
|
|
|
|
+ <div v-if="error.error_type === 'occupied_no_container'">
|
|
|
|
|
+ <div class="text-subtitle2 q-mb-sm">
|
|
|
|
|
+ <q-icon name="warning" color="orange" class="q-mr-xs" />
|
|
|
|
|
+ 库位状态为占用,但未绑定托盘
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="q-mb-md">
|
|
|
|
|
+ <q-radio
|
|
|
|
|
+ v-model="error.userAction"
|
|
|
|
|
+ val="has_container"
|
|
|
|
|
+ label="确认该库位有托盘"
|
|
|
|
|
+ />
|
|
|
|
|
+ <q-radio
|
|
|
|
|
+ v-model="error.userAction"
|
|
|
|
|
+ val="no_container"
|
|
|
|
|
+ label="确认该库位没有托盘"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div v-if="error.userAction === 'has_container'" class="q-mb-md">
|
|
|
|
|
+ <q-input
|
|
|
|
|
+ v-model="error.container_code"
|
|
|
|
|
+ label="请输入托盘码"
|
|
|
|
|
+ outlined
|
|
|
|
|
+ dense
|
|
|
|
|
+ class="q-mb-sm"
|
|
|
|
|
+ />
|
|
|
|
|
+ <q-btn
|
|
|
|
|
+ color="primary"
|
|
|
|
|
+ label="重新绑定托盘"
|
|
|
|
|
+ @click="rebindContainer(error)"
|
|
|
|
|
+ :loading="error.processing"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div v-if="error.userAction === 'no_container'" class="q-mb-md">
|
|
|
|
|
+ <q-btn
|
|
|
|
|
+ color="primary"
|
|
|
|
|
+ label="修改库位状态为可用"
|
|
|
|
|
+ @click="updateLocationStatus(error, 'available')"
|
|
|
|
|
+ :loading="error.processing"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 错误类型2: 库位可用但有托盘绑定 -->
|
|
|
|
|
+ <div v-if="error.error_type === 'available_with_container'">
|
|
|
|
|
+ <div class="text-subtitle2 q-mb-sm">
|
|
|
|
|
+ <q-icon name="warning" color="orange" class="q-mr-xs" />
|
|
|
|
|
+ 库位状态为可用,但有托盘绑定
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="q-mb-md">
|
|
|
|
|
+ <q-radio
|
|
|
|
|
+ v-model="error.userAction"
|
|
|
|
|
+ val="has_container"
|
|
|
|
|
+ label="确认该库位有托盘"
|
|
|
|
|
+ />
|
|
|
|
|
+ <q-radio
|
|
|
|
|
+ v-model="error.userAction"
|
|
|
|
|
+ val="no_container"
|
|
|
|
|
+ label="确认该库位没有托盘"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div v-if="error.userAction === 'has_container'" class="q-mb-md">
|
|
|
|
|
+ <q-btn
|
|
|
|
|
+ color="primary"
|
|
|
|
|
+ label="修改库位状态为占用"
|
|
|
|
|
+ @click="updateLocationStatus(error, 'occupied')"
|
|
|
|
|
+ :loading="error.processing"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div v-if="error.userAction === 'no_container'" class="q-mb-md">
|
|
|
|
|
+ <q-btn
|
|
|
|
|
+ color="primary"
|
|
|
|
|
+ label="解除托盘绑定关系"
|
|
|
|
|
+ @click="unbindContainer(error)"
|
|
|
|
|
+ :loading="error.processing"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 辅助查询信息 -->
|
|
|
|
|
+ <q-separator class="q-my-md" />
|
|
|
|
|
+ <div class="text-subtitle2 q-mb-sm">
|
|
|
|
|
+ <q-icon name="search" color="primary" class="q-mr-xs" />
|
|
|
|
|
+ 辅助查询 - 该位置的托盘信息
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <q-btn
|
|
|
|
|
+ color="secondary"
|
|
|
|
|
+ label="查询该位置的托盘"
|
|
|
|
|
+ @click="queryContainersByLocation(error)"
|
|
|
|
|
+ :loading="error.querying"
|
|
|
|
|
+ class="q-mb-sm"
|
|
|
|
|
+ />
|
|
|
|
|
+ <q-table
|
|
|
|
|
+ v-if="error.containers && error.containers.length > 0"
|
|
|
|
|
+ :data="error.containers"
|
|
|
|
|
+ :columns="containerColumns"
|
|
|
|
|
+ row-key="id"
|
|
|
|
|
+ flat
|
|
|
|
|
+ bordered
|
|
|
|
|
+ dense
|
|
|
|
|
+ class="q-mt-sm"
|
|
|
|
|
+ />
|
|
|
|
|
+ <div v-else-if="error.containers && error.containers.length === 0" class="text-caption text-grey q-mt-sm">
|
|
|
|
|
+ 未找到该位置的托盘
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </q-card-section>
|
|
|
|
|
+ </q-card>
|
|
|
|
|
+ </q-expansion-item>
|
|
|
|
|
+ </q-list>
|
|
|
|
|
+ <div v-else class="text-center q-pa-lg text-grey">
|
|
|
|
|
+ 暂无位置异常
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </q-card-section>
|
|
|
|
|
+
|
|
|
|
|
+ <q-card-actions align="right">
|
|
|
|
|
+ <q-btn flat label="关闭" v-close-popup />
|
|
|
|
|
+ <q-btn
|
|
|
|
|
+ flat
|
|
|
|
|
+ label="刷新"
|
|
|
|
|
+ color="primary"
|
|
|
|
|
+ @click="refreshLocationErrors"
|
|
|
|
|
+ :loading="loadingLocationErrors"
|
|
|
|
|
+ />
|
|
|
|
|
+ </q-card-actions>
|
|
|
|
|
+ </q-card>
|
|
|
|
|
+ </q-dialog>
|
|
|
</q-layout>
|
|
</q-layout>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
@@ -750,7 +941,32 @@ export default {
|
|
|
pollInterval: null,
|
|
pollInterval: null,
|
|
|
timer: null,
|
|
timer: null,
|
|
|
selectedRole: '',
|
|
selectedRole: '',
|
|
|
- permissions: [] // 存储权限数据
|
|
|
|
|
|
|
+ permissions: [], // 存储权限数据
|
|
|
|
|
+ showLocationErrorsDialog: false,
|
|
|
|
|
+ locationErrors: [],
|
|
|
|
|
+ locationErrorsCount: 0,
|
|
|
|
|
+ loadingLocationErrors: false,
|
|
|
|
|
+ containerColumns: [
|
|
|
|
|
+ {
|
|
|
|
|
+ name: 'container_code',
|
|
|
|
|
+ label: '托盘码',
|
|
|
|
|
+ field: 'container_code',
|
|
|
|
|
+ align: 'left'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: 'current_location',
|
|
|
|
|
+ label: '当前位置',
|
|
|
|
|
+ field: 'current_location',
|
|
|
|
|
+ align: 'left'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: 'target_location',
|
|
|
|
|
+ label: '目标位置',
|
|
|
|
|
+ field: 'target_location',
|
|
|
|
|
+ align: 'left'
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ]
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -1029,6 +1245,238 @@ export default {
|
|
|
getauth('/wms/outboundBills/?bound_status=0').then((res) => {
|
|
getauth('/wms/outboundBills/?bound_status=0').then((res) => {
|
|
|
this.ERPOutTasks = res.count
|
|
this.ERPOutTasks = res.count
|
|
|
})
|
|
})
|
|
|
|
|
+ // 检查位置错误
|
|
|
|
|
+ // this.checkLocationErrors()
|
|
|
|
|
+ },
|
|
|
|
|
+ // 检查位置错误
|
|
|
|
|
+ checkLocationErrors () {
|
|
|
|
|
+ // const layer = 1 // 默认检查第一层,可以根据需要调整
|
|
|
|
|
+ const url = `/location_statistics/CheckView/`
|
|
|
|
|
+ const payload = {}
|
|
|
|
|
+ if (localStorage.getItem('warehouse_code')) {
|
|
|
|
|
+ payload.warehouse_code = localStorage.getItem('warehouse_code')
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ postauth(url, payload)
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ if (res && res.data) {
|
|
|
|
|
+ if (res.data.success === false) {
|
|
|
|
|
+ this.locationErrors = []
|
|
|
|
|
+ this.locationErrorsCount = 0
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ const checkResult = res.data.data || res.data
|
|
|
|
|
+ if (checkResult && checkResult.details && checkResult.details.location_errors) {
|
|
|
|
|
+ this.locationErrors = checkResult.details.location_errors.map(err => ({
|
|
|
|
|
+ ...err,
|
|
|
|
|
+ userAction: null,
|
|
|
|
|
+ container_code: '',
|
|
|
|
|
+ processing: false,
|
|
|
|
|
+ querying: false,
|
|
|
|
|
+ containers: null,
|
|
|
|
|
+ error_type_display: this.getErrorTypeDisplay(err),
|
|
|
|
|
+ error_type: this.determineErrorType(err)
|
|
|
|
|
+ }))
|
|
|
|
|
+ this.locationErrorsCount = this.locationErrors.length
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.locationErrors = []
|
|
|
|
|
+ this.locationErrorsCount = 0
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.locationErrors = []
|
|
|
|
|
+ this.locationErrorsCount = 0
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => {
|
|
|
|
|
+ console.error('检查位置错误失败', err)
|
|
|
|
|
+ this.locationErrors = []
|
|
|
|
|
+ this.locationErrorsCount = 0
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ // 确定错误类型
|
|
|
|
|
+ determineErrorType (error) {
|
|
|
|
|
+ // 根据当前状态和期望状态判断错误类型
|
|
|
|
|
+ // 类型1: 库位占用但没有绑定托盘
|
|
|
|
|
+ // current_status 为 occupied/reserved,但 expected_status 为 available(表示应该没有托盘)
|
|
|
|
|
+ if ((error.current_status === 'occupied' || error.current_status === 'reserved') &&
|
|
|
|
|
+ (error.expected_status === 'available' || !error.expected_status)) {
|
|
|
|
|
+ return 'occupied_no_container'
|
|
|
|
|
+ }
|
|
|
|
|
+ // 类型2: 库位可用但有托盘绑定
|
|
|
|
|
+ // current_status 为 available,但 expected_status 为 occupied(表示应该有托盘)
|
|
|
|
|
+ if (error.current_status === 'available' &&
|
|
|
|
|
+ (error.expected_status === 'occupied' || error.expected_status === 'reserved')) {
|
|
|
|
|
+ return 'available_with_container'
|
|
|
|
|
+ }
|
|
|
|
|
+ // 如果没有明确的状态,根据当前状态判断
|
|
|
|
|
+ if (error.current_status === 'occupied' || error.current_status === 'reserved') {
|
|
|
|
|
+ return 'occupied_no_container'
|
|
|
|
|
+ }
|
|
|
|
|
+ return 'available_with_container'
|
|
|
|
|
+ },
|
|
|
|
|
+ // 刷新位置错误
|
|
|
|
|
+ refreshLocationErrors () {
|
|
|
|
|
+ this.loadingLocationErrors = true
|
|
|
|
|
+ this.checkLocationErrors()
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.loadingLocationErrors = false
|
|
|
|
|
+ }, 1000)
|
|
|
|
|
+ },
|
|
|
|
|
+ // 获取错误类型显示文本
|
|
|
|
|
+ getErrorTypeDisplay (error) {
|
|
|
|
|
+ const errorType = this.determineErrorType(error)
|
|
|
|
|
+ if (errorType === 'occupied_no_container') {
|
|
|
|
|
+ return '库位占用但未绑定托盘'
|
|
|
|
|
+ } else if (errorType === 'available_with_container') {
|
|
|
|
|
+ return '库位可用但有托盘绑定'
|
|
|
|
|
+ }
|
|
|
|
|
+ return error.error_type || '未知错误'
|
|
|
|
|
+ },
|
|
|
|
|
+ // 格式化错误时间
|
|
|
|
|
+ formatErrorDateTime (dateStr) {
|
|
|
|
|
+ if (!dateStr) return '-'
|
|
|
|
|
+ if (typeof dateStr === 'string' && dateStr.includes('T')) {
|
|
|
|
|
+ return dateStr.replace('T', ' ').substring(0, 19)
|
|
|
|
|
+ }
|
|
|
|
|
+ return dateStr
|
|
|
|
|
+ },
|
|
|
|
|
+ // 重新绑定托盘
|
|
|
|
|
+ rebindContainer (error) {
|
|
|
|
|
+ if (!error.container_code || !error.container_code.trim()) {
|
|
|
|
|
+ this.$q.notify({
|
|
|
|
|
+ type: 'negative',
|
|
|
|
|
+ message: '请输入托盘码'
|
|
|
|
|
+ })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ error.processing = true
|
|
|
|
|
+ const url = '/location_statistics/bind-container/'
|
|
|
|
|
+ const payload = {
|
|
|
|
|
+ location_code: error.location_code,
|
|
|
|
|
+ container_code: error.container_code.trim()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ postauth(url, payload)
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ if (res && (res.code === '200' || res.success)) {
|
|
|
|
|
+ this.$q.notify({
|
|
|
|
|
+ type: 'positive',
|
|
|
|
|
+ message: '重新绑定托盘成功'
|
|
|
|
|
+ })
|
|
|
|
|
+ // 从列表中移除该错误并刷新
|
|
|
|
|
+ this.checkLocationErrors()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$q.notify({
|
|
|
|
|
+ type: 'negative',
|
|
|
|
|
+ message: res?.msg || res?.message || '重新绑定托盘失败'
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => {
|
|
|
|
|
+ this.$q.notify({
|
|
|
|
|
+ type: 'negative',
|
|
|
|
|
+ message: '重新绑定托盘失败: ' + (err?.message || err?.detail || '未知错误')
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ error.processing = false
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ // 更新库位状态
|
|
|
|
|
+ updateLocationStatus (error, status) {
|
|
|
|
|
+ error.processing = true
|
|
|
|
|
+ const url = '/location_statistics/update-location-status/'
|
|
|
|
|
+ const payload = {
|
|
|
|
|
+ location_code: error.location_code,
|
|
|
|
|
+ status: status
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ postauth(url, payload)
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ if (res && (res.code === '200' || res.success)) {
|
|
|
|
|
+ this.$q.notify({
|
|
|
|
|
+ type: 'positive',
|
|
|
|
|
+ message: '更新库位状态成功'
|
|
|
|
|
+ })
|
|
|
|
|
+ // 刷新错误列表
|
|
|
|
|
+ this.checkLocationErrors()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$q.notify({
|
|
|
|
|
+ type: 'negative',
|
|
|
|
|
+ message: res?.msg || res?.message || '更新库位状态失败'
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => {
|
|
|
|
|
+ this.$q.notify({
|
|
|
|
|
+ type: 'negative',
|
|
|
|
|
+ message: '更新库位状态失败: ' + (err?.message || err?.detail || '未知错误')
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ error.processing = false
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ // 解除托盘绑定
|
|
|
|
|
+ unbindContainer (error) {
|
|
|
|
|
+ error.processing = true
|
|
|
|
|
+ const url = '/location_statistics/unbind-container/'
|
|
|
|
|
+ const payload = {
|
|
|
|
|
+ location_code: error.location_code
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ postauth(url, payload)
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ if (res && (res.code === '200' || res.success)) {
|
|
|
|
|
+ this.$q.notify({
|
|
|
|
|
+ type: 'positive',
|
|
|
|
|
+ message: '解除托盘绑定成功'
|
|
|
|
|
+ })
|
|
|
|
|
+ // 刷新错误列表
|
|
|
|
|
+ this.checkLocationErrors()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$q.notify({
|
|
|
|
|
+ type: 'negative',
|
|
|
|
|
+ message: res?.msg || res?.message || '解除托盘绑定失败'
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => {
|
|
|
|
|
+ this.$q.notify({
|
|
|
|
|
+ type: 'negative',
|
|
|
|
|
+ message: '解除托盘绑定失败: ' + (err?.message || err?.detail || '未知错误')
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ error.processing = false
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ // 查询该位置的托盘
|
|
|
|
|
+ queryContainersByLocation (error) {
|
|
|
|
|
+ error.querying = true
|
|
|
|
|
+ // 拼接当前位置的库位码 W01-row(两位数字)-col(两位数字)-layer(一位数字)
|
|
|
|
|
+ const current_location_code = `W01-${error.row.toString().padStart(2, '0')}-${error.col.toString().padStart(2, '0')}-${error.layer.toString().padStart(2, '0')}`
|
|
|
|
|
+ const url = `/container/list/?current_location__icontains=${current_location_code}`
|
|
|
|
|
+ getauth(url)
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ if (res && res.results) {
|
|
|
|
|
+ error.containers = res.results
|
|
|
|
|
+ } else {
|
|
|
|
|
+ error.containers = []
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => {
|
|
|
|
|
+ console.error('查询托盘失败', err)
|
|
|
|
|
+ error.containers = []
|
|
|
|
|
+ this.$q.notify({
|
|
|
|
|
+ type: 'negative',
|
|
|
|
|
+ message: '查询托盘失败: ' + (err?.message || '未知错误')
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ error.querying = false
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created () {
|
|
created () {
|
|
@@ -1066,6 +1514,8 @@ export default {
|
|
|
_this.isLoggedIn()
|
|
_this.isLoggedIn()
|
|
|
})
|
|
})
|
|
|
_this.loadRolePermissions()
|
|
_this.loadRolePermissions()
|
|
|
|
|
+ // 初始检查位置错误
|
|
|
|
|
+ _this.checkLocationErrors()
|
|
|
|
|
|
|
|
_this.timer = setInterval(() => {
|
|
_this.timer = setInterval(() => {
|
|
|
_this.handleTimer()
|
|
_this.handleTimer()
|