Browse Source

盘点架位

master
xuhuajiao 5 days ago
parent
commit
f34b0eceed
  1. 10
      src/api/stockTaskLog/index.js
  2. 12
      src/views/deviceManage/bookshelf/index.vue
  3. 42
      src/views/deviceManage/shelfManage/shelf3dPosition.vue
  4. 245
      src/views/visualCheck/checkManage/checkLog/index.vue
  5. 17
      src/views/visualCheck/checkManage/dataScreening/girdList.vue
  6. 218
      src/views/visualCheck/checkManage/dataScreening/module/form.vue
  7. 38
      src/views/visualCheck/checkManage/dataScreening/shelfList.vue

10
src/api/stockTaskLog/index.js

@ -100,4 +100,12 @@ export function add(data) {
})
}
export default { del, FetchStopStockBill, FetchInitStockLogList, FetchInitStockLogDetails, FetchProgressByStockBillAndGridCode, FetchInitStockTaskDetails, FetchNewBillNo, FetchStockGirdNum, FetchTotalGirdNum, add }
// 获取目标可盘层架信息
export function FetchStockGirdSuccess(params) {
return request({
url: 'api/stocktask-task/getStockGirdSuccess' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
export default { del, FetchStopStockBill, FetchInitStockLogList, FetchInitStockLogDetails, FetchProgressByStockBillAndGridCode, FetchInitStockTaskDetails, FetchNewBillNo, FetchStockGirdNum, FetchTotalGirdNum, add, FetchStockGirdSuccess }

12
src/views/deviceManage/bookshelf/index.vue

@ -59,14 +59,14 @@
<span :class="['row-state', scope.row.signPoint ? 'end-state' : 'cancel-state' ]">{{ scope.row.signPoint ? '参与': '不参与' }}</span>
</template>
</el-table-column>
<el-table-column prop="regionName" label="3D定位" width="80" align="center">
<el-table-column v-if="selectRegionVal && selectRegionVal.mapType===2" prop="regionName" label="3D定位" width="80" align="center">
<template slot-scope="scope">
<el-button size="mini" @click="handleShelf3D(scope.row)">
操作
</el-button>
</template>
</el-table-column>
<el-table-column prop="signPoint" label="2D标注">
<el-table-column v-if="selectRegionVal && selectRegionVal.mapType===1" prop="signPoint" label="2D标注">
<template slot-scope="scope">
<span :class="['row-state', scope.row.signPoint ? 'end-state' : 'cancel-state' ]">{{ scope.row.signPoint ? '已标注': '未标注' }}</span>
</template>
@ -133,21 +133,21 @@
</el-row>
<el-row>
<el-form-item label="书架排号" prop="shelfRow">
<el-input v-model="form.shelfRow" @blur="formatShelfRow" />
<el-input v-model="form.shelfRow" :disabled=" crud.status.edit===1" @blur="formatShelfRow" />
</el-form-item>
<el-form-item label="书架名称" prop="shelfName">
<el-input v-model="computedShelfName" disabled />
</el-form-item>
</el-row>
<el-form-item label="书架规格" prop="rackSpecs">
<el-input-number v-model.number="form.shelfFloor" :min="1" :max="999" controls-position="right" style="width:80px;" />
<el-input-number v-model.number="form.shelfFloor" :min="1" :max="999" controls-position="right" style="width:80px;" :disabled=" crud.status.edit===1" />
<span style="font-size: 12px;"></span>
<span style="padding:0 2px;"></span>
<el-input-number v-model.number="form.shelfShelf" :min="1" :max="999" controls-position="right" style="width: 80px;" />
<el-input-number v-model.number="form.shelfShelf" :min="1" :max="999" controls-position="right" style="width: 80px;" :disabled=" crud.status.edit===1" />
<span style="font-size: 12px;"></span>
</el-form-item>
<el-form-item label="架起始标" prop="startShelf">
<el-input-number v-model.number="form.startShelf" :min="1" :max="999" controls-position="right" />
<el-input-number v-model.number="form.startShelf" :min="1" :max="999" controls-position="right" :disabled=" crud.status.edit===1" />
</el-form-item>
<el-row>
<el-form-item label="架号顺序" prop="shelfType">

42
src/views/deviceManage/shelfManage/shelf3dPosition.vue

@ -55,7 +55,7 @@
<el-card class="box-card">
<el-form ref="form" :model="form" label-width="100px">
<el-form-item label="架位筛选" prop="name">
<el-select v-model="form.code1" style="width: 190px;">
<el-select v-model="form.code1" style="width: 190px;" @change="changeShelfToModel">
<el-option
v-for="(item,index) in options1"
:key="index"
@ -63,13 +63,9 @@
:value="item.value"
/>
</el-select>
<el-select v-model="form.code2">
<el-option
v-for="(item,index) in selectList"
:key="index"
:label="item.label"
:value="item.value"
/>
<!-- @change="changeShelfGetGrid" -->
<el-select v-model="form.layerVal" size="small" placeholder="书架排列表" class="filter-item" style="width: 140px;" value-key="id">
<el-option v-for="item in layerOptions" :key="item.id" :label="item.name" :value="item" />
</el-select>
<el-select v-model="form.toward" style="width: 80px;">
<el-option
@ -134,6 +130,7 @@
<script>
import { FetchRegionTree } from '@/api/deviceVI/index'
import { FetchInitBookShelfList } from '@/api/shelf/index'
import PreviewMap from '../map3d/map'
export default {
name: 'Shelf3dPosition',
@ -146,8 +143,8 @@ export default {
regionTreeData: [],
treeProps: { label: 'label', children: 'children' },
form: {
code1: null,
code2: null,
code1: 0,
layerVal: null,
toward: 0,
code4: null
},
@ -158,6 +155,7 @@ export default {
{ value: 2, label: '按 “排-单面” 筛选' },
{ value: 3, label: '按 “排-双面” 筛选' }
],
layerOptions: [],
abOptions: [
{ value: 0, name: '双面' },
{ value: 1, name: 'A面' },
@ -174,6 +172,9 @@ export default {
})
},
mounted() {
// if(this.selectedValue){
// }
this.mapData = {
'id': 1,
'libcode': '1201',
@ -209,7 +210,6 @@ export default {
},
handleTreeNodeClick(nodeData) {
const currentNode = this.$refs.treeRef.getNode(nodeData)
console.log(currentNode)
if (currentNode.level === 1) {
return
@ -224,9 +224,29 @@ export default {
? `${parentLabel} - ${nodeData.label}`
: nodeData.label
this.$refs.selectRef.blur()
this.getInitBookShelfList(currentNode.data)
},
handleVisibleChange(visible) {
//
},
changeShelfToModel(val) {
console.log(val)
},
getInitBookShelfList(data) {
const params = { 'floorId': data.parentFloorId, 'regionId': data.regionId }
FetchInitBookShelfList(params).then(res => {
this.layerOptions = res.content.map(item => {
return {
name: item.shelfName,
id: item.shelfId,
toward: item.toward,
rowType: item.rowType
}
})
this.layerVal = data
}).catch(() => {
})
}
}
}

245
src/views/visualCheck/checkManage/checkLog/index.vue

@ -88,32 +88,80 @@
</div>
<!-- form -->
<el-dialog append-to-body :close-on-click-modal="false" :modal-append-to-body="false" :before-close="crud.cancelCU" :visible="crud.status.cu > 0" :title="crud.status.title">
<el-dialog :class="unreachable.length !== 0 ? 'stock-dialog':''" append-to-body :close-on-click-modal="false" :modal-append-to-body="false" :before-close="crud.cancelCU" :visible="crud.status.cu > 0" :title="crud.status.title">
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="盘点单号" prop="stockBill">
<el-input v-model="form.stockBill" disabled />
</el-form-item>
<el-form-item label="盘点类型" prop="stockTypeName">
<el-input v-model="form.stockTypeName" disabled />
</el-form-item>
<el-form-item label="目标位置" prop="stockRegion">
<el-input v-model="form.stockRegion" disabled />
</el-form-item>
<el-form-item label="目标数量" prop="stockGridNumName">
<el-input v-model="form.stockGridNumName" disabled />
</el-form-item>
<el-row>
<el-form-item label="备注" prop="stockRemarks">
<el-input v-model="form.stockRemarks" type="textarea" style="width: 572px;" :rows="4" />
<div class="setting-dialog" style="display: flex; justify-content: flex-start;">
<div :style=" {'width': unreachable.length !== 0 ? '670px':''}">
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="盘点单号" prop="stockBill">
<el-input v-model="form.stockBill" disabled />
</el-form-item>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
<el-form-item label="盘点类型" prop="stockTypeName">
<el-input v-model="form.stockTypeName" disabled />
</el-form-item>
<el-form-item label="目标位置" prop="stockRegion">
<el-input v-model="form.stockRegion" disabled />
</el-form-item>
<el-form-item
class="stockGridNumName-style"
label="目标数量"
prop="stockGridNumName"
>
<span v-if="stockInfoLoading" class="el-icon-loading" />
<!-- <el-input v-else disabled v-html="form.stockGridNumName" /> -->
<div v-else style="display: flex; justify-content: flex-start;">
<el-input disabled v-html="form.stockGridNumName" />
<el-popover
class="stock-popover"
placement="top-start"
width="250"
trigger="hover"
>
<div>
<span style="display:block; font-weight: bold; margin-bottom: 10px;">A / B / C 层位 </span>
A开启盘点功能 当前可盘点 层位数量<br>
B开启盘点功能 当前不可盘点 层为数量<br>
C具备盘点功能的 层位数量
</div>
<i slot="reference" class="iconfont icon-zhuyi-lan" />
</el-popover>
</div>
</el-form-item>
<el-row>
<el-form-item label="备注" prop="stockRemarks">
<el-input v-model="form.stockRemarks" type="textarea" style="width: 572px;" :rows="4" />
</el-form-item>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer" style="padding-right: 20px;">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :disabled="isBtnDisabled" :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
</div>
</div>
<div v-if="unreachable.length !== 0" style="width: 500px; margin-left: 10px;">
<div class="stock-info-tips">
<p>注意系统检查到有参与本次盘点的摄像头无法连接<i>{{ reachable.length }}</i>/个层架位可盘点</p>
<span>不可盘点具体情况如下</span>
</div>
<div style="display: flex; justify-content: space-between;">
<el-card class="box-card">
<div slot="header">
<span>无法连接的摄像头 <i style="color: #f53f3f; font-weight: bold; font-style: normal;">{{ ipStatusFalseNum }}</i> /)</span>
</div>
<div v-for="(item,index) in ipStatusFalse" :key="index" class="stock-info-item">
<span> {{ item.ip }} </span>
</div>
</el-card>
<el-card class="box-card">
<div slot="header">
<span>无法盘点的层架位 <i style="color: #f53f3f; font-weight: bold; font-style: normal;">{{ unreachable.length }}</i> /</span>
</div>
<div v-for="(item,index) in unreachable" :key="index" class="stock-info-item">
<span> {{ item.gridName }} </span>
</div>
</el-card>
</div>
</div>
</div>
</el-dialog>
@ -199,11 +247,12 @@
</ul>
</template>
</el-table-column>
<el-table-column prop="progress" label="进度" min-width="140">
<el-table-column prop="progress" label="进度" min-width="120" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.progress !== null ? scope.row.progress : '-' }}</span>
</template>
</el-table-column>
<el-table-column prop="detailsRemarks" label="备注" min-width="100" :show-overflow-tooltip="true" />
<el-table-column prop="state" label="状态" width="80">
<template slot-scope="scope">
<span v-if="scope.row.state === 0" class="row-state row-lending state-active">已终止</span>
@ -229,7 +278,7 @@
<div slot="footer" class="dialog-footer">
<!-- 排队中会多一个删除盘点 进行中的多一个终止盘点 -->
<el-button v-if="detailInfo.state === 1" :loading="crud.delAllLoading" type="primary" class="end-btn" @click="toDelete"><i class="iconfont icon-stop" />删除盘点</el-button>
<el-button v-if="detailInfo.state === 2" type="primary" class="end-btn" @click="toStopStockBill"><i class="iconfont icon-stop" />终止盘点</el-button>
<el-button v-if="detailInfo.state === 2" :loading="stopLoading" type="primary" class="end-btn" @click="toStopStockBill"><i class="iconfont icon-stop" />终止盘点</el-button>
<el-button :loading="crud.status.cu === 2" type="primary" @click="detailVisible=false">确定</el-button>
</div>
</div>
@ -250,7 +299,7 @@ import { mapGetters } from 'vuex'
import { parseTime, saveAs, getBlob } from '@/utils/index'
import qs from 'qs'
const defaultForm = { stockTypeName: '全量盘点', stockType: 1, stockBill: null, stockRegion: '全部区域', stockGridNum: null, stockGridNumName: null, totalGridNum: null, stockRemarks: null, regionId: null, shelfId: null, gridShelf: null, gridId: null }
const defaultForm = { stockTypeName: '全量盘点', stockType: 1, stockBill: null, stockRegion: '全部区域', stockGridNum: null, stockGridNumName: null, totalGridNum: null, stockRemarks: null, regionId: null, shelfId: null, gridShelf: null, gridId: null, reableGridIds: [], unReableGridIds: [] }
export default {
name: 'CheckLog',
components: { crudOperation, rrOperation, pagination, taskStockLogEcharts, DateRangePicker },
@ -285,6 +334,7 @@ export default {
blurryTime: null,
tabIndex: 0,
detailVisible: false,
stopLoading: false,
dbRowData: {},
detailInfo: {},
taskStockLogData: [],
@ -313,7 +363,14 @@ export default {
stockGridNumName: [
{ required: true, message: '请输入目标数量', trigger: 'blur' }
]
}
},
stockInfo: null,
ipStatusList: [],
ipStatusFalseNum: 0,
unreachable: [],
reachable: [],
isBtnDisabled: true,
stockInfoLoading: false
}
},
computed: {
@ -333,6 +390,8 @@ export default {
}
},
[CRUD.HOOK.afterRefresh](crud) {
this.isBtnDisabled = true
this.stockInfoLoading = false
},
//
[CRUD.HOOK.beforeToAdd]() {
@ -345,18 +404,65 @@ export default {
'shelfId': null
}
}
Promise.all([
this.stockInfoLoading = true
const stockInfoPromise = crudStockTaskLog.FetchStockGirdSuccess()
.then(stockInfo => {
this.stockInfoLoading = false
return stockInfo
})
.catch(error => {
this.stockInfoLoading = false
console.error('stockInfo 接口失败:', error)
throw error
})
const otherPromises = [
crudStockTaskLog.FetchNewBillNo(),
crudStockTaskLog.FetchStockGirdNum(),
crudStockTaskLog.FetchTotalGirdNum(params)
]).then(([newBillNoRes, stockGridNumRes, totalGirdNumRes]) => {
this.crud.form.stockBill = newBillNoRes
this.crud.form.stockGridNumName = stockGridNumRes + ' / ' + totalGirdNumRes + ' 层位'
this.crud.form.stockGridNum = stockGridNumRes
this.crud.form.totalGridNum = totalGirdNumRes
}).catch(error => {
console.error(error)
})
]
Promise.all([stockInfoPromise, ...otherPromises])
.then(([stockInfo, newBillNoRes, stockGridNumRes, totalGirdNumRes]) => {
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.crud.form.stockBill = newBillNoRes
this.crud.form.stockGridNumName = stockInfo
? `<span style="color: #00b42a;">${this.reachable.length}</span> /
<span style="color: #f53f3f;">${this.unreachable.length}</span> /
${totalGirdNumRes} 层位`
: '数据加载失败'
this.crud.form.stockGridNum = stockGridNumRes
this.crud.form.totalGridNum = totalGirdNumRes
})
.catch(error => {
console.error('整体请求失败:', error)
this.isBtnDisabled = true
})
},
[CRUD.HOOK.afterAddCancel]() {
this.isBtnDisabled = true
this.stockInfoLoading = false
},
//
[CRUD.HOOK.beforeToEdit](crud, form) {
@ -366,6 +472,8 @@ 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
@ -469,6 +577,8 @@ export default {
handleCloseDialog() {
this.detailVisible = false
this.tabIndex = 0
this.isBtnDisabled = true
this.stockInfoLoading = false
},
toDelete() {
this.$confirm('此操作将删除当前盘点单任务<span>你是否还要继续?</span>', '提示', {
@ -490,6 +600,7 @@ export default {
} else {
this.$message({ message: res.message, type: 'error', offset: 8 })
}
this.handleCloseDialog()
this.crud.delAllLoading = false
}).catch(err => {
this.crud.delAllLoading = false
@ -506,6 +617,7 @@ export default {
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
this.stopLoading = true
const params = {
'id': this.dbRowData.billId
}
@ -517,10 +629,14 @@ export default {
} else {
this.$message({ message: res.message, type: 'error', offset: 8 })
}
this.handleCloseDialog()
this.stopLoading = false
}).catch(err => {
console.log(err)
this.stopLoading = false
})
}).catch(() => {
this.stopLoading = false
})
}
}
@ -628,4 +744,61 @@ export default {
}
}
}
.stock-dialog{
::v-deep .el-dialog{
width: 1220px !important;
}
}
.stockGridNumName-style{
::v-deep .el-form-item__content{
width: auto !important;
padding: 0 10px;
.stock-popover{
display: inline-block;
margin-left: 6px;
color: #0348f3;
}
}
}
.stock-info-tips{
line-height: 24px;
margin-bottom: 20px;
p{
color: #0c0e1e;
i{
display: inline-block;
padding: 0 4px;
font-weight: bold;
font-style: normal;
color: #00b42a;
}
}
span{
display: block;
}
}
::v-deep .el-card {
flex: 1;
margin-right: 15px;
.el-card__header{
color: #0c0e1e;
// font-size: 16px;
background-color: #fff !important;
border-bottom: 1px solid #ebeef5 !important;
}
.el-card__body{
height: 180px;
overflow: hidden;
overflow-y: scroll;
}
.stock-info-item{
display: flex; justify-content: space-between; padding: 4px 20px;
span{
display: block;
height: 26px;
line-height: 26px;
}
}
}
</style>

17
src/views/visualCheck/checkManage/dataScreening/girdList.vue

@ -324,6 +324,7 @@ export default {
shelfAllGridData: [],
layerNum: 0,
rackNum: 0,
startShelf: 1,
bookNum: 46,
layerVal: null,
rackOptions: [],
@ -458,14 +459,26 @@ export default {
FetchBookShelfDetails({ 'shelfId': dataScreenShelf.shelfId }).then(res => {
this.layerNum = res.shelfFloor
this.rackNum = res.shelfShelf
this.startShelf = res.startShelf
this.floorId = res.floorId
this.regionId = res.regionId
this.bookShelfDetails = res
// this.rackOptions = []
// for (let i = 1; i <= this.rackNum; i++) {
// this.rackOptions.push({ id: i, name: `0${i}` })
// }
this.rackOptions = []
for (let i = 1; i <= this.rackNum; i++) {
this.rackOptions.push({ id: i, name: `0${i}` })
const start = parseInt(this.startShelf) || 1
const end = start + this.rackNum - 1
for (let i = start; i <= end; i++) {
this.rackOptions.push({
id: i,
name: `${i.toString().padStart(2, '0')}`
})
}
this.layerVal = parseInt(this.gridShelf) || ''
this.getInitStockInfo(this.shelfAllGridData)

218
src/views/visualCheck/checkManage/dataScreening/module/form.vue

@ -1,30 +1,78 @@
<template>
<el-dialog append-to-body :close-on-click-modal="false" :modal-append-to-body="false" :before-close="handleCloseForm" :visible="formVisible" title="新增盘点">
<el-dialog :class="unreachable.length !== 0 ? 'stock-dialog':''" append-to-body :close-on-click-modal="false" :modal-append-to-body="false" :before-close="handleCloseForm" :visible="formVisible" title="新增盘点">
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="盘点单号" prop="stockBill">
<el-input v-model="form.stockBill" disabled style="width: 240px;" />
</el-form-item>
<el-form-item label="盘点类型" prop="stockTypeName">
<el-input v-model="form.stockTypeName" disabled style="width: 240px;" />
</el-form-item>
<el-form-item label="目标位置" prop="stockRegion">
<el-input v-model="form.stockRegion" disabled style="width: 240px;" />
</el-form-item>
<el-form-item label="目标数量" prop="stockGridNumName">
<el-input v-model="form.stockGridNumName" disabled style="width: 240px;" />
</el-form-item>
<el-row>
<el-form-item label="备注" prop="stockRemarks">
<el-input v-model="form.stockRemarks" type="textarea" style="width: 590px;" :rows="4" />
<div class="setting-dialog" style="display: flex; justify-content: flex-start;">
<div :style=" {'width': unreachable.length !== 0 ? '670px':''}">
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="盘点单号" prop="stockBill">
<el-input v-model="form.stockBill" disabled style="width: 240px;" />
</el-form-item>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="handleCloseForm">取消</el-button>
<el-button :loading="saveLoading" type="primary" @click="handleComfiredEditing">保存</el-button>
<el-form-item label="盘点类型" prop="stockTypeName">
<el-input v-model="form.stockTypeName" disabled style="width: 240px;" />
</el-form-item>
<el-form-item label="目标位置" prop="stockRegion">
<el-input v-model="form.stockRegion" disabled style="width: 240px;" />
</el-form-item>
<el-form-item
class="stockGridNumName-style"
label="目标数量"
prop="stockGridNumName"
>
<span v-if="stockInfoLoading" class="el-icon-loading" />
<!-- <el-input v-else disabled v-html="form.stockGridNumName" /> -->
<div v-else style="display: flex; justify-content: flex-start;">
<el-input disabled v-html="form.stockGridNumName" />
<el-popover
class="stock-popover"
placement="top-start"
width="250"
trigger="hover"
>
<div>
<span style="display:block; font-weight: bold; margin-bottom: 10px;">A / B / C 层位 </span>
A开启盘点功能 当前可盘点 层位数量<br>
B开启盘点功能 当前不可盘点 层为数量<br>
C具备盘点功能的 层位数量
</div>
<i slot="reference" class="iconfont icon-zhuyi-lan" />
</el-popover>
</div>
</el-form-item>
<el-row>
<el-form-item label="备注" prop="stockRemarks">
<el-input v-model="form.stockRemarks" type="textarea" style="width: 590px;" :rows="4" />
</el-form-item>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="handleCloseForm">取消</el-button>
<el-button :disabled="isBtnDisabled" :loading="saveLoading" type="primary" @click="handleComfiredEditing">保存</el-button>
</div>
</div>
<div v-if="unreachable.length !== 0" style="width: 500px; margin-left: 10px;">
<div class="stock-info-tips">
<p>注意系统检查到有参与本次盘点的摄像头无法连接<i>{{ reachable.length }}</i>/个层架位可盘点</p>
<span>不可盘点具体情况如下</span>
</div>
<div style="display: flex; justify-content: space-between;">
<el-card class="box-card">
<div slot="header">
<span>无法连接的摄像头 <i style="color: #f53f3f; font-weight: bold; font-style: normal;">{{ ipStatusFalseNum }}</i> /)</span>
</div>
<div v-for="(item,index) in ipStatusFalse" :key="index" class="stock-info-item">
<span> {{ item.ip }} </span>
</div>
</el-card>
<el-card class="box-card">
<div slot="header">
<span>无法盘点的层架位 <i style="color: #f53f3f; font-weight: bold; font-style: normal;">{{ unreachable.length }}</i> /</span>
</div>
<div v-for="(item,index) in unreachable" :key="index" class="stock-info-item">
<span> {{ item.gridName }} </span>
</div>
</el-card>
</div>
</div>
</div>
</el-dialog>
@ -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
? `<span style="color: #00b42a;">${this.reachable.length}</span> /
<span style="color: #f53f3f;">${this.unreachable.length}</span> /
${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
}
}
}
</script>
<style lang="scss" scoped>
.stock-dialog{
::v-deep .el-dialog{
width: 1220px !important;
}
}
.stockGridNumName-style{
::v-deep .el-form-item__content{
width: auto !important;
padding: 0 10px;
.stock-popover{
display: inline-block;
margin-left: 6px;
color: #0348f3;
}
}
}
.stock-info-tips{
line-height: 24px;
margin-bottom: 20px;
p{
color: #0c0e1e;
i{
display: inline-block;
padding: 0 4px;
font-weight: bold;
font-style: normal;
color: #00b42a;
}
}
span{
display: block;
}
}
::v-deep .el-card {
flex: 1;
margin-right: 15px;
.el-card__header{
color: #0c0e1e;
// font-size: 16px;
background-color: #fff !important;
border-bottom: 1px solid #ebeef5 !important;
}
.el-card__body{
height: 180px;
overflow: hidden;
overflow-y: scroll;
}
.stock-info-item{
display: flex; justify-content: space-between; padding: 4px 20px;
span{
display: block;
height: 26px;
line-height: 26px;
}
}
}
</style>

38
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) {

Loading…
Cancel
Save