|
|
|
@ -88,10 +88,11 @@ |
|
|
|
</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"> |
|
|
|
<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 /> |
|
|
|
@ -102,8 +103,30 @@ |
|
|
|
<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 |
|
|
|
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"> |
|
|
|
@ -111,9 +134,34 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<div slot="footer" class="dialog-footer" style="padding-right: 20px;"> |
|
|
|
<el-button type="text" @click="crud.cancelCU">取消</el-button> |
|
|
|
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">保存</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> |
|
|
|
@ -204,6 +252,7 @@ |
|
|
|
<span>{{ scope.row.progress !== null ? scope.row.progress : '-' }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="progress" label="备注" min-width="140" :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> |
|
|
|
@ -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 }, |
|
|
|
@ -313,7 +362,14 @@ export default { |
|
|
|
stockGridNumName: [ |
|
|
|
{ required: true, message: '请输入目标数量', trigger: 'blur' } |
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
stockInfo: null, |
|
|
|
ipStatusList: [], |
|
|
|
ipStatusFalseNum: 0, |
|
|
|
unreachable: [], |
|
|
|
reachable: [], |
|
|
|
isBtnDisabled: true, |
|
|
|
stockInfoLoading: false |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -333,6 +389,8 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
[CRUD.HOOK.afterRefresh](crud) { |
|
|
|
this.isBtnDisabled = true |
|
|
|
this.stockInfoLoading = false |
|
|
|
}, |
|
|
|
// 新增前 |
|
|
|
[CRUD.HOOK.beforeToAdd]() { |
|
|
|
@ -345,19 +403,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]) => { |
|
|
|
] |
|
|
|
|
|
|
|
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 = [{ gridName: '111' }, { gridName: '222' }] |
|
|
|
this.reachable = stockInfo.reachable |
|
|
|
this.unreachable = 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 = 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) |
|
|
|
}) |
|
|
|
.catch(error => { |
|
|
|
console.error('整体请求失败:', error) |
|
|
|
this.isBtnDisabled = true |
|
|
|
}) |
|
|
|
}, |
|
|
|
[CRUD.HOOK.afterAddCancel]() { |
|
|
|
this.isBtnDisabled = true |
|
|
|
this.stockInfoLoading = false |
|
|
|
}, |
|
|
|
// 初始化编辑时 |
|
|
|
[CRUD.HOOK.beforeToEdit](crud, form) { |
|
|
|
}, |
|
|
|
@ -366,6 +470,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 +575,8 @@ export default { |
|
|
|
handleCloseDialog() { |
|
|
|
this.detailVisible = false |
|
|
|
this.tabIndex = 0 |
|
|
|
this.isBtnDisabled = true |
|
|
|
this.stockInfoLoading = false |
|
|
|
}, |
|
|
|
toDelete() { |
|
|
|
this.$confirm('此操作将删除当前盘点单任务<span>你是否还要继续?</span>', '提示', { |
|
|
|
@ -628,4 +736,5 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
</style> |