1.下一个盘点

2.全部盘点
3.历史数据巷道查询
4.增加需盘点情况
merge-requests/5/head
LAPTOP-S9HJSOEB\昊天 3 years ago
parent 2b6e527233
commit f6bb715188

@ -198,6 +198,16 @@ export default {
name: '导出单个巷道',
method: 'GET'
},
nextOne: {
url: '/stock/nextOne',
name: '下一个盘点',
method: 'POST'
},
allStockCheck: {
url: '/stock/allStockCheck',
name: '全部盘点',
method: 'POST'
},
exportAllStock: {
url: '/stock/exportAll',
name: '导出所有巷道',

@ -15,6 +15,7 @@ import {
Breadcrumb,
Icon,
Tree,
Timeline,
message,
result,
Modal,
@ -50,6 +51,7 @@ Vue.use(Button);
Vue.use(Breadcrumb);
Vue.use(Icon);
Vue.use(Tree);
Vue.use(Timeline);
try {
Vue.use(result);
}catch (e){

@ -3,8 +3,11 @@
<div class="ant-advanced-search-form">
<a-form layout="inline" :form="queryParam">
<a-row :gutter="24">
<a-col :span="4" style="text-align: left">
<a-select :default-value="0" style="width: 180px" @change="handleChange">
<a-col :span="4" >
<a-form-item label="巷道">
<a-select :default-value="0" style="width: 100px" @change="handleChange">
巷道
<a-select-option :value="0">
全部
</a-select-option>
@ -12,6 +15,7 @@
{{item.name}}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="10">
<a-form-item class="ageInput" label="告警时间">

@ -10,8 +10,9 @@
>
<span slot="tab" >
{{ getRandom(latticeRow + 1 -index, latticeRow, nums.row, total.row) }}
<a-icon type="close-circle" v-if="status.row[index] === 1" style="color: #d81e06"/>
<a-icon type="check-circle" v-else-if="status.row[index] === 2" style="color: #1afa29" />
<a-icon type="info-circle" v-if="status.row[index] === 1" style="color: #FFD700"/>
<a-icon type="close-circle" v-else-if="status.row[index] === 2" style="color: #d81e06"/>
<a-icon type="check-circle" v-else-if="status.row[index] === 3" style="color: #1afa29" />
<a-icon type="exclamation-circle" v-else style="color: #909399" />
</span>
</a-tab-pane>
@ -30,7 +31,7 @@
class="default"
:id="`${direction}-${side}-${random.row[0] + random.row[1] - rowIndex - 1}-${column}`"
@click="tocheckPage(random.row[0] + random.row[1] - rowIndex - 1,column)">
{{ random.row[0] + random.row[1] - rowIndex - 1}}-{{column}}
{{column}}-{{ random.row[0] + random.row[1] - rowIndex - 1}}
</span>
</div>
</div>
@ -48,8 +49,10 @@
<span slot="tab">
{{ getRandom(index, latticeColumn, nums.column, total.column) }}
<!-- <a-icon :id="`${shelveId}-row-${getRandom(index,latticeRow,nums.row,total.row)}`"/> -->
<a-icon type="close-circle" v-if="status.column[index] === 1" style="color: #d81e06" />
<a-icon type="check-circle" v-else-if="status.column[index] === 2" style="color: #1afa29" />
<a-icon type="info-circle" v-if="status.column[index] === 1" style="color: #FFD700"/>
<a-icon type="close-circle" v-else-if="status.column[index] === 2" style="color: #d81e06"/>
<a-icon type="check-circle" v-else-if="status.column[index] === 3" style="color: #1afa29" />
<a-icon type="exclamation-circle" v-else style="color: #909399" />
</span>
</a-tab-pane>
@ -86,7 +89,7 @@ export default {
default: () => {
return {
row: 10,
column: 15
column: 30
}
}
},
@ -217,10 +220,18 @@ export default {
getStatusBg(row,column,status) {
var dom = document.getElementById(this.direction+"-"+this.side+"-"+row+'-'+column);
var color = status == 1 ?'#d81e06': (status == 2|| status == 3) ? '#1afa29': '#bfbfbf';
var color;
if(status == -1){
color = '#f2ed48'
}else if(status == 2|| status == 3){
color = '#1afa29'
}else if(status == 1){
color = '#d81e06'
}else{
color = '#bfbfbf'
}
dom.style.background = color
},
getStatus(){
var columnTab = []
@ -246,10 +257,12 @@ export default {
columnTabs: columnTab
}
}).then(res => {
console.log(this.status.column)
console.log(this.status.row)
if(res.code == 200){
if(res.data.stocks){
for(let a of res.data.stocks){
this.getStatusBg(a.row,a.column,a.status)
this.getStatusBg(a.row,a.column,a.viewStatus)
}
}

@ -7,8 +7,11 @@
<div class="img-box">
<ul>
<li>
<span >
{{streetName}}-{{this.direction == 1?"左":"右"}}-{{this.side == 1?"浅":"深"}}-{{row}}-{{column}}
<span class="img-box-title">
位置:
</span>
<span class="img-box-value">
{{checkObj.streetName}}-{{checkObj.direction == 1?"左":"右"}}-{{checkObj.side == 1?"浅":"深"}}-{{checkObj.row}}-{{checkObj.column}}
</span>
</li>
<li>
@ -90,6 +93,12 @@
@click="checkfalse(checkObj.row,checkObj.column,checkObj.shelveId,index)"
>核对错误
</a-button>
<a-button class="btn"
type="primary"
style="background:#29c12b;border-color:#29c12b;"
@click="nextOne(checkObj.id)">
下一个盘点
</a-button>
</div>
</div>
@ -107,6 +116,7 @@
<script>
import Model from "./model.vue"
import {imgUrl} from "@/api/importExcel";
import { message } from 'ant-design-vue';
export default {
data() {
return {
@ -271,7 +281,31 @@ export default {
this.visible = visible
this.modelData = data
},
nextOne(id){
console.log(1111);
this.$api.httpApi.nextOne({
data: {
id:Number(id)
}
}).then(res => {
if (res.data && res.data != null) {
console.log(res.data)
this.checkObj = res.data;
this.id = res.data.id
this.row = res.data.row
this.column = res.data.column
this.direction = res.data.direction
this.side = res.data.side
this.streetId = res.data.streetId
this.streetName = res.data.streetName
}else{
message.info('全部盘点已完成')
}
}).catch(err => {
console.log(err)
});
}
}
}

@ -1,187 +1,294 @@
<template>
<div class="check-page">
<div class="button-box">
<a-button type="primary" @click="exportStock" class="export-all">
导出巷道盘点数据
</a-button>
<a-button type="primary" @click="exportAllStock" class="export-all">
导出全部巷道盘点数据
</a-button>
</div>
<div class="button-box">
<a-popconfirm
title="是否确定要全部盘点"
ok-text="是"
cancel-text="否"
@confirm="allStockCheck"
>
<a-button type="primary" class="export-all">
全部盘点
</a-button>
</a-popconfirm>
<a-button type="primary" @click="exportStock" class="export-all">
导出巷道盘点数据
</a-button>
<a-button type="primary" @click="exportAllStock" class="export-all">
导出全部巷道盘点数据
</a-button>
</div>
<div class="title-info">
<span class="explain">颜色说明</span>
<span class="info-text">
<a-tag color="#d81e06" style="width:30px;height:20px;margin-right:6px"></a-tag>
盘点错误
</span>
<a-tag
color="#d81e06"
style="width: 30px; height: 20px; margin-right: 6px"
></a-tag>
盘点错误
</span>
<span class="info-text">
<a-tag color="#1afa29" style="width:30px;height:20px;margin-right:6px"></a-tag>
盘点正确
</span>
<a-tag
color="#1afa29"
style="width: 30px; height: 20px; margin-right: 6px"
></a-tag>
盘点正确
</span>
<span class="info-text">
<a-tag
color="#f2ed48"
style="width: 30px; height: 20px; margin-right: 6px"
></a-tag>
需盘点
</span>
<span class="info-text">
<a-tag color="#bfbfbf" style="width:30px;height:20px;margin-right:6px"></a-tag>
未盘点
</span>
<a-tag
color="#bfbfbf"
style="width: 30px; height: 20px; margin-right: 6px"
></a-tag>
未盘点
</span>
</div>
<div style="margin-top: 10px">
<a-select @change="handleChange" style="width:200px" v-model="select">
<div style="margin: 10px">
<a-select
@change="handleChange"
style="width: 200px"
v-model="select"
>
<a-select-option v-for="i in data" :key="i.name" :value="i.id">
{{i.name}}
{{ i.name }}
</a-select-option>
</a-select>
</div>
<a-col :span="24">
<!--左货架DOM-->
<div class="center-box">
<span class="shelf-number"> 左侧货架 </span>
<!--左货架DOM-->
<div class="center-box">
<span class="shelf-number">
左侧货架
</span>
<a-radio-group v-model="leftSide" style="margin:10px 0"
v-if="streetDetail.leftType == 1">
<a-radio-button :value=1>
浅侧货架
</a-radio-button>
<a-radio-button :value=2>
深侧货架
</a-radio-button>
</a-radio-group>
</div>
<div class="check-content" v-for="item in data" :key="item.id">
<subsection v-if="item.id == select" :total="{row: item.leftRow, column: item.leftColumn}" :side="leftSide" :direction=1 :streetId="item.id" :streetName="item.name">
</subsection>
</div>
<!--单伸类型右货架DOM-->
<div class="center-box">
<span class="shelf-number">
右侧货架
</span>
<a-radio-group
v-model="leftSide"
style="margin: 10px 0"
v-if="streetDetail.leftType == 1"
>
<a-radio-button :value="1"> 浅侧货架 </a-radio-button>
<a-radio-button :value="2"> 深侧货架 </a-radio-button>
</a-radio-group>
</div>
<a-radio-group v-model="rightSide" style="margin:10px 0"
v-if="streetDetail.rightType == 1">
<a-radio-button :value=1>
浅侧货架
</a-radio-button>
<a-radio-button :value=2>
深测货架
</a-radio-button>
</a-radio-group>
<div class="check-content" v-for="item in data" :key="item.id">
<subsection
v-if="item.id == select"
:total="{ row: item.leftRow, column: item.leftColumn }"
:side="leftSide"
:direction="1"
:streetId="item.id"
:streetName="item.name"
>
</subsection>
</div>
<!--单伸类型右货架DOM-->
<div class="center-box">
<span class="shelf-number"> 右侧货架 </span>
</div>
<a-radio-group
v-model="rightSide"
style="margin: 10px 0"
v-if="streetDetail.rightType == 1"
>
<a-radio-button :value="1"> 浅侧货架 </a-radio-button>
<a-radio-button :value="2"> 深测货架 </a-radio-button>
</a-radio-group>
</div>
<div class="check-content" v-for="item in data" :key="item.name">
<subsection v-if="item.id == select" :total="{row:item.rightRow, column: item.rightColumn}" :side="rightSide" :direction=2 :streetId="item.id" :streetName="item.name">
</subsection>
</div>
<div class="check-content" v-for="item in data" :key="item.name">
<subsection
v-if="item.id == select"
:total="{ row: item.rightRow, column: item.rightColumn }"
:side="rightSide"
:direction="2"
:streetId="item.id"
:streetName="item.name"
>
</subsection>
</div>
</a-col>
<!-- websocket推送信息 -->
<!-- <a-col :span="6" style="height: 80vh; overflow-y: scroll">
<a-timeline style="margin: 20px">
<a-timeline-item v-for="i in wsData" :key="i.id">{{
getWsData(i)}}</a-timeline-item>
</a-timeline></a-col
> -->
</div>
</template>
<script>
import Subsection from "./Subsection";
import message from "ant-design-vue";
export default {
name:'checkManage',
name: "checkManage",
data() {
return {
timer: "",
leftSide: 1,
rightSide: 1,
data: [],
select: '',
wsData: [],
select: "",
streetId: 0,
streetDetail: {},
}
};
},
computed: {
},
computed: {},
mounted() {
this.request();
},
created(){
},
created() {},
activated() {
if(!this.$route.meta.isUseCache){
console.log("$route.meta.isUseCache false")
if (!this.$route.meta.isUseCache) {
console.log("$route.meta.isUseCache false");
//
this.request();//
}else{
console.log("$route.meta.isUseCache true")
//this.request();
this.request(); //
} else {
console.log("$route.meta.isUseCache true");
//this.request();
}
},
created() {
this.initWebSocket();
//, created beforeDestroy
this.timer = window.setInterval(() => {
setTimeout(this.pollingFunc(), 0);
}, 1000);
},
destroyed() {
this.websock.close(); //websocket
},
methods: {
//
request() {
this.$api.httpApi.getAllStreet({
}).then(res => {
console.log("update data")
for(let i = 0;i<res.data.length;i++){
this.$set(this.data,i,res.data[i])
}
this.select = res.data[0].id
this.selectName = res.data[0].name
//this.$set(this.select,res.data.list[0].id,0)
this.getStreetDetail(this.select);
}).catch(err => {
});
this.$api.httpApi
.getAllStreet({})
.then((res) => {
console.log("update data");
for (let i = 0; i < res.data.length; i++) {
this.$set(this.data, i, res.data[i]);
}
this.select = res.data[0].id;
this.selectName = res.data[0].name;
//this.$set(this.select,res.data.list[0].id,0)
this.getStreetDetail(this.select);
})
.catch((err) => {});
},
//
getWsData(e) {
console.log(e)
console.log(this.wsData)
console.log( e.message.streetName + (e.message.fromDirection == 1 ?"左侧":"右侧") + e.message.fromRow +"行" +e.message.fromColumn + "列" + (e.message.separation1 == 2 ?"外侧货架":"内侧货架")+"发生盘点")
return ( e.message.streetName + (e.message.fromDirection == 1 ?"左侧":"右侧") + e.message.fromRow +"行" +e.message.fromColumn + "列" + (e.message.separation1 == 2 ?"外侧货架":"内侧货架")+"发生盘点")
},
//
getStreetDetail(id) {
this.$axios.get('/street/' + id, {
data: {}
}).then(res => {
this.streetDetail = res.data
//this.getStockRowColumn()
}).catch(err => {
})
this.$axios
.get("/street/" + id, {
data: {},
})
.then((res) => {
this.streetDetail = res.data;
//this.getStockRowColumn()
})
.catch((err) => {});
},
handleChange(value) {
this.select = value
this.getStreetDetail(value)
this.select = value;
this.getStreetDetail(value);
},
exportStock() {
this.$api.httpApi.exportStock({
params: {
streetId: this.select,
}
}).then(res => {
let blob = new Blob([res], {type: "application/vnd.ms-excel"})
this.$utils.downloadFile(this.streetDetail.name+'-盘点列表.xls', blob)
}).catch(err => {
});
exportStock() {
this.$api.httpApi
.exportStock({
params: {
streetId: this.select,
},
})
.then((res) => {
let blob = new Blob([res], {
type: "application/vnd.ms-excel",
});
this.$utils.downloadFile(
this.streetDetail.name + "-盘点列表.xls",
blob
);
})
.catch((err) => {});
},
exportAllStock() {
this.$utils.downloadFileUrl('盘点列表.xls', '/api/stock/exportAll');
this.$utils.downloadFileUrl("盘点列表.xls", "/api/stock/exportAll");
},
allStockCheck() {
console.log("全部盘点");
this.$api.httpApi
.allStockCheck({})
.then((res) => {
message.success("全部盘点完成", 10);
})
.catch((err) => {});
},
initWebSocket() {
//weosocket
const wsuri = "ws://127.0.0.1:8099/ws/111";
this.websock = new WebSocket(wsuri);
this.websock.onmessage = this.websocketonmessage;
this.websock.onopen = this.websocketonopen;
this.websock.onerror = this.websocketonerror;
this.websock.onclose = this.websocketclose;
},
websocketonopen() {
//send
this.websocketsend(JSON.stringify(actions));
},
websocketonerror() {
//
this.initWebSocket();
},
websocketonmessage(e) {
console.log("aaaa");
var el = JSON.parse(e.data)
console.log(el.type);
if (el.type == "InventoryPush") {
this.wsData.push(el);
}
//
const redata = JSON.parse(e.data);
},
websocketsend(Data) {
//
this.websock.send(Data);
},
websocketclose(e) {
//
console.log("断开连接", e);
},
},
components: {
Subsection,
},
components: {Subsection}
};
</script>
<style lang="scss" scoped>
.check-page {
position: relative;
.title-info {
display: flex;
align-items: center;
@ -207,7 +314,8 @@ export default {
cursor: pointer;
}
.roadway-top, roadway-buttom {
.roadway-top,
roadway-buttom {
padding: 5px 0;
width: 100%;
}
@ -217,7 +325,9 @@ export default {
padding: 10px 10px 0 0;
.line {
display: flex;
transform: rotateX(180deg); //div
transform: rotateX(
180deg
); //div
.el {
width: 46px;
@ -249,21 +359,18 @@ export default {
width: 200px;
}
}
}
.button-box{
position: absolute;
top:20px;
right: 40px;
display: flex;
align-items: center;
justify-content: center;
.export-all {
.button-box {
position: absolute;
top: 20px;
right: 40px;
display: flex;
align-items: center;
justify-content: center;
.export-all {
margin-right: 20px;
}
}
}
</style>

@ -3,7 +3,20 @@
<div class="ant-advanced-search-form">
<a-form layout="inline" :form="queryParam">
<a-row :gutter="24">
<a-col :span="6" style="text-align: left">
<a-col :span="4" style="text-align: left">
<a-form-item label="巷道">
<a-select @change="handleChange" :value="select" style="width:100px">
<a-select-option :value="0">
全部
</a-select-option>
<a-select-option v-for="i in listData" :key="i.name" :value="i.id">
{{i.name}}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="6" >
<a-form-item label="工单号">
<a-input v-model="queryParam.orderNum" placeholder="请输入" style="width:270px;"/>
</a-form-item>
@ -23,7 +36,7 @@
</a-range-picker>
</a-form-item>
</a-col>
<a-col :span="10" style="text-align: right">
<a-col :span="6" style="text-align: right">
<a-button type="primary" @click="handleSearch"></a-button>
<a-button style="margin-left: 15px" @click="reset"></a-button>
</a-col>
@ -95,12 +108,15 @@ export default {
data() {
return {
queryParam: {
orderNum: ''
orderNum: '',
streetId: ''
},
listData:[],
time:[],
pageNum: 1,
pageSize: 10,
data: [],
select: '',
pagination:{
total: 0,
defaultPageSize: 10, //
@ -163,6 +179,8 @@ export default {
}
},
mounted() {
this.getStreetList();
this.handleGetHistoryList()
console.log(this.imgUrl)
if (this.$route.params.orderNum) {
@ -172,6 +190,30 @@ export default {
},
methods: {
moment,
handleChange(value) {
console.log(value);
if(value === 0){
this.select = "全部";
this.queryParam.streetId = value
} else {
for (let item of this.listData) {
if (item.id == value){
this.select = item.name
this.queryParam.streetId = value
}
}
}
},
//
getStreetList() {
this.$api.httpApi.getAllStreet({
}).then(res => {
this.listData = res.data;
}).catch(err => {
console.error(err);
});
},
range(start, end) {
const result = [];
for (let i = start; i < end; i++) {
@ -244,6 +286,8 @@ export default {
this.queryParam.startTimestamp = ""
this.queryParam.endTimestamp = ""
this.queryParam.orderNum = ""
this.queryParam.streetId = ""
this.select = ""
this.time = []
this.pageNum = 1
this.pageSize = 10

Loading…
Cancel
Save