+
+
+
+
-
-
-
+
+
+
注意:系统检查到,有参与本次盘点的摄像头无法连接!仅{{ reachable.length }}/个层架位可盘点。
+
不可盘点具体情况如下:
+
+
+
+
+ 无法连接的摄像头( {{ ipStatusFalseNum }} /个)
+
+
+ {{ item.ip }}
+
+
+
+
+ 无法盘点的层架位( {{ unreachable.length }} /个)
+
+
+ {{ item.gridName }}
+
+
+
@@ -34,7 +82,7 @@
import crudStockTaskLog from '@/api/stockTaskLog/index'
import CRUD, { form } from '@crud/crud'
-const defaultForm = { stockTypeName: '', stockType: null, stockBill: null, stockRegion: '', stockGridNum: null, stockGridNumName: null, totalGridNum: null, stockRemarks: null, regionId: null, shelfId: null, gridShelf: null, gridId: null, toward: null }
+const defaultForm = { stockTypeName: '', stockType: null, stockBill: null, stockRegion: '', stockGridNum: null, stockGridNumName: null, totalGridNum: null, stockRemarks: null, regionId: null, shelfId: null, gridShelf: null, gridId: null, toward: null, reableGridIds: [], unReableGridIds: [] }
export default {
name: 'DataForm',
mixins: [
@@ -60,7 +108,14 @@ export default {
stockGridNumName: [
{ required: true, message: '请输入目标数量', trigger: 'blur' }
]
- }
+ },
+ stockInfo: null,
+ ipStatusList: [],
+ ipStatusFalseNum: 0,
+ unreachable: [],
+ reachable: [],
+ isBtnDisabled: true,
+ stockInfoLoading: false
}
},
methods: {
@@ -111,11 +166,26 @@ export default {
const { regionId, shelfId, gridShelf, gridId, toward, stockTypeName } = typeMap[type] || {}
const params = { regionId, shelfId, gridShelf, gridId, toward }
this.form.stockTypeName = stockTypeName
- Promise.all([
+
+ this.stockInfoLoading = true
+ const stockInfoPromise = crudStockTaskLog.FetchStockGirdSuccess(params)
+ .then(stockInfo => {
+ this.stockInfoLoading = false
+ return stockInfo
+ })
+ .catch(error => {
+ this.stockInfoLoading = false
+ console.error('stockInfo 接口失败:', error)
+ throw error
+ })
+
+ const otherPromises = [
crudStockTaskLog.FetchNewBillNo(),
crudStockTaskLog.FetchStockGirdNum(params),
crudStockTaskLog.FetchTotalGirdNum(params)
- ]).then(([newBillNoRes, stockGridNumRes, totalGirdNumRes]) => {
+ ]
+
+ Promise.all([stockInfoPromise, ...otherPromises]).then(([stockInfo, newBillNoRes, stockGridNumRes, totalGirdNumRes]) => {
if (stockGridNumRes === 0) {
if (this.form.stockType === 6) {
this.$message({ message: '当前层位不可盘点', type: 'error', offset: 8 })
@@ -129,12 +199,40 @@ export default {
this.formVisible = true
}
}
+
+ console.log('stockInfo', stockInfo)
+ this.stockInfo = stockInfo
+
+ const ipStatusList = stockInfo
+ ? Object.entries(stockInfo.ipReachableCache).map(([ip, status]) => ({ ip, status }))
+ : []
+ this.ipStatusList = ipStatusList
+ this.ipStatusFalse = this.ipStatusList.filter(item => !item.status)
+ this.ipStatusFalseNum = this.ipStatusList.filter(item => !item.status).length
+ this.reachable = stockInfo.reachable
+ this.unreachable = stockInfo.unreachable
+ // 测试
+ // this.reachable = stockInfo.unreachable
+ // this.unreachable = []
+
+ if (stockInfo && this.reachable.length !== 0) {
+ this.isBtnDisabled = false
+ } else {
+ this.isBtnDisabled = true
+ }
+
this.form.stockBill = newBillNoRes
- this.crud.form.stockGridNumName = stockGridNumRes + ' / ' + totalGirdNumRes + ' 层位'
+ // this.crud.form.stockGridNumName = stockGridNumRes + ' / ' + totalGirdNumRes + ' 层位'
+ this.crud.form.stockGridNumName = stockInfo
+ ? `
${this.reachable.length} /
+
${this.unreachable.length} /
+ ${totalGirdNumRes} 层位`
+ : '数据加载失败'
this.crud.form.stockGridNum = stockGridNumRes
this.crud.form.totalGridNum = totalGirdNumRes
}).catch(error => {
console.error(error)
+ this.isBtnDisabled = true
})
},
handleCloseForm() {
@@ -150,6 +248,8 @@ export default {
if (this.form.stockType === 6 && this.gridStockRegion !== '') {
this.form.stockRegion = this.gridStockRegion
}
+ this.form.reableGridIds = this.reachable.map(item => item.gridId)
+ this.form.unReableGridIds = this.unreachable.map(item => item.gridId)
delete this.form.stockGridNumName
delete this.form.stockTypeName
crudStockTaskLog.add(this.form).then((res) => {
@@ -172,13 +272,75 @@ export default {
// 提交前的验证
[CRUD.HOOK.afterValidateCU](crud) {
console.log(crud.form)
+ crud.form.reableGridIds = this.reachable.map(item => item.gridId)
+ crud.form.unReableGridIds = this.unreachable.map(item => item.gridId)
delete crud.form.stockGridNumName
delete crud.form.stockTypeName
return true
+ },
+ [CRUD.HOOK.afterAddCancel]() {
+ this.isBtnDisabled = true
+ this.stockInfoLoading = false
}
}
}
diff --git a/src/views/visualCheck/checkManage/dataScreening/shelfList.vue b/src/views/visualCheck/checkManage/dataScreening/shelfList.vue
index abbbbe6..ac815d6 100644
--- a/src/views/visualCheck/checkManage/dataScreening/shelfList.vue
+++ b/src/views/visualCheck/checkManage/dataScreening/shelfList.vue
@@ -176,6 +176,7 @@ export default {
callNumVisible: false,
layerNum: 0,
rackNum: 0,
+ startShelf: 1,
swiperActiveIndex: 0,
cellIndex: null,
columnIndex: null,
@@ -223,12 +224,41 @@ export default {
const w = 146 * this.rackNum + 'px'
return { width: `calc(${w})` }
},
+ // reversedRackNum() {
+ // console.log('startShelf', this.startShelf)
+ // console.log('booShelfGrid', this.booShelfGrid)
+ // if (this.booShelfGrid && this.booShelfGrid.length > 0) {
+ // if (parseInt(this.booShelfGrid[0].gridShelf) === this.rackNum) {
+ // return Array.from({ length: this.rackNum }, (_, i) => this.rackNum - i).map(x => x.toString())
+ // } else {
+ // return Array.from({ length: this.rackNum }, (_, i) => i + 1).map(x => x.toString())
+ // }
+ // } else {
+ // return []
+ // }
+ // }
reversedRackNum() {
+ console.log('startShelf', this.startShelf)
+ console.log('booShelfGrid', this.booShelfGrid)
+ const start = parseInt(this.startShelf) || 1
+ // 计算理论上的最后一个架号
+ const end = start + this.rackNum - 1
+ console.log('起始架号:', start, '总数量:', this.rackNum, '理论最后架号:', end)
+
if (this.booShelfGrid && this.booShelfGrid.length > 0) {
- if (parseInt(this.booShelfGrid[0].gridShelf) === this.rackNum) {
- return Array.from({ length: this.rackNum }, (_, i) => this.rackNum - i).map(x => x.toString())
+ const firstGridShelf = parseInt(this.booShelfGrid[0].gridShelf)
+ console.log('实际第一个架号:', firstGridShelf)
+
+ if (firstGridShelf === end) {
+ console.log('书架倒置:从', end, '递减到', start)
+ return Array.from({ length: this.rackNum }, (_, i) => {
+ return (end - i).toString()
+ })
} else {
- return Array.from({ length: this.rackNum }, (_, i) => i + 1).map(x => x.toString())
+ console.log('书架正序:从', start, '递增到', end)
+ return Array.from({ length: this.rackNum }, (_, i) => {
+ return (start + i).toString()
+ })
}
} else {
return []
@@ -279,6 +309,8 @@ export default {
FetchBookShelfDetails({ 'shelfId': data.id }).then(res => {
this.layerNum = res.shelfFloor
this.rackNum = res.shelfShelf
+ this.startShelf = res.startShelf
+ // this.startShelf = 3
this.bookShelfDetails = res
if (this.$route.query.tabIndex) {