From bd22cf1b35738f1556c9a45a8b3a55fe2959581c Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期一, 19 八月 2024 11:04:05 +0800
Subject: [PATCH] #
---
pages/phyz/stationManage/stationManage.vue | 413 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 391 insertions(+), 22 deletions(-)
diff --git a/pages/phyz/stationManage/stationManage.vue b/pages/phyz/stationManage/stationManage.vue
index dc5cc8d..592f50d 100644
--- a/pages/phyz/stationManage/stationManage.vue
+++ b/pages/phyz/stationManage/stationManage.vue
@@ -1,23 +1,33 @@
<template>
- <view>
+ <view style="font-size: 14px;">
<view class="code">
<uni-search-bar :focus="searchValueFocus" v-model="searchValue" @input="searchValueInput()"
- maxlength="500" ancel="cancel" @clear="clear" placeholder="杈撳叆 / 鎵弿 璁㈠崟鍙�">
+ maxlength="500" ancel="cancel" @clear="clear" placeholder="杈撳叆 / 鎵弿 绔欑偣鍙�">
</uni-search-bar>
</view>
- <view class="list" v-if="station">
+ <view class="list" :class="item.style" v-if="stations" v-for="item in stations">
<view class="list-left">
- <view>绔欑偣缂栧彿锛歿{station.stationCode}}</view>
- <view>宸ヤ綅缂栧彿锛歿{station.devNo}}</view>
- <view>宸ヤ綅鐘舵�侊細{{station.locSts$}}</view>
- <view>鏉″舰鐮侊細{{station.barcode}}</view>
+ <view>宸ヤ綅缂栧彿锛歿{item.devNo}}</view>
+ <view>绔欑偣鐘舵�侊細{{item.locSts$}}</view>
+ <view>璐ф灦鐮侊細{{item.barcode}}</view>
+ <view>绔欑偣绫诲瀷锛歿{item.locType1$}}</view>
<!-- <view class="card-id">{{i + 1}}</view> -->
</view>
<view class="list-right" @click="getOrderDetl(item)">
- <uni-icons type="right" color="#c1c1c1"></uni-icons>
+ <uni-icons type="right" color="#fff"></uni-icons>
</view>
</view>
- <view class="list" v-if="wrkMast">
+ <!-- <view class="list" style="background-color: #3eb689;color: #fff;" v-if="station">
+ <view class="list-left">
+ <view>宸ヤ綅缂栧彿锛歿{station.devNo}}</view>
+ <view>绔欑偣鐘舵�侊細{{station.locSts$}}</view>
+ <view>鏉″舰鐮侊細{{station.barcode}}</view>
+ </view>
+ <view class="list-right" @click="getOrderDetl(item)">
+ <uni-icons type="right" color="#fff"></uni-icons>
+ </view>
+ </view> -->
+ <view class="list" style="background-color: #019fe8;color: #fff;" v-if="wrkMast">
<view class="list-left">
<view>宸ヤ綔鍙凤細{{wrkMast.wrkNo}}</view>
<view>宸ヤ綔鐘舵�侊細{{wrkMast.wrkSts$}}</view>
@@ -27,9 +37,65 @@
<view>鏂欑鐮侊細{{wrkMast.barcode}}</view>
<!-- <view class="card-id">{{i + 1}}</view> -->
</view>
- <view class="list-right" @click="getOrderDetl(item)">
- <uni-icons type="right" color="#c1c1c1"></uni-icons>
+ <!-- <view class="list-right" @click="getOrderDetl(item)">
+ <uni-icons type="right" color="#fff"></uni-icons>
+ </view> -->
+ </view>
+
+ <view class="list" style="background-color: #fda800;color: #fff;" v-for="wrkMast in wrkDetls">
+ <view class="list-left">
+ <view>鐗╂枡鍙凤細{{wrkMast.matnr}}</view>
+ <view>鐗╂枡鍚嶇О锛歿{wrkMast.maktx}}</view>
+ <view>鎵瑰彿锛歿{wrkMast.batch}}</view>
+ <view>瑙勬牸锛歿{wrkMast.specs}}</view>
+ <view>鏁伴噺锛歿{wrkMast.anfme}}</view>
</view>
+ </view>
+
+ <view class="list" style="background-color: #fda800;color: #fff;" v-if="!wrkDetls" v-for="wrkMast in waitPakins">
+ <view class="list-left">
+ <view>鐗╂枡鍙凤細{{wrkMast.matnr}}</view>
+ <view>鐗╂枡鍚嶇О锛歿{wrkMast.maktx}}</view>
+ <view>鎵瑰彿锛歿{wrkMast.batch}}</view>
+ <view>瑙勬牸锛歿{wrkMast.specs}}</view>
+ <view>鏁伴噺锛歿{wrkMast.anfme}}</view>
+ </view>
+ </view>
+
+ <view style="height: 100rpx;"></view>
+
+ <!-- 绌烘澘鍏ュ簱寮圭獥 -->
+ <view>
+ <uni-popup ref="revise" type="dialog">
+ <view class="popup">
+ <!-- 鏍囬 -->
+ <view class="title">璇峰綍鍏ヨ揣鏋剁爜</view>
+ <view class="popup-item">
+ <view class="popup-item-left">璐ф灦鐮�:</view>
+ <view class="popup-item-right"><input type="text" v-model="barcode"></view>
+ </view>
+ <view class="btn">
+ <view class="btn-left" @click="reviseClose">鍙栨秷</view>
+ <view class="btn-right" @click="reviseConfirm()">鍏ュ簱</view>
+ </view>
+ </view>
+ </uni-popup>
+ </view>
+
+ <!-- 搴曢儴鎿嶄綔鎸夐挳 -->
+ <view class="buttom" v-if="waitPakins.length > 0">
+ <button size="mini" type="primary" @click="startPakin(searchValue)" v-if="waitPakins">鍚姩鍏ュ簱</button>
+ </view>
+
+ <!-- 搴曢儴鎿嶄綔鎸夐挳 -->
+ <view class="buttom" v-if="station.locSts == 'O'">
+ <button size="mini" type="primary" @click="emptyPakin()">绌烘澘鍏ュ簱</button>
+ </view>
+
+ <!-- 搴曢儴鎿嶄綔鎸夐挳 -->
+ <view class="buttom" v-if="wrkMast">
+ <button size="mini" type="primary" @click="containerMoveOut(searchValue)" v-if="wrkMast.ioType == 101">纭鍑哄簱</button>
+ <button size="mini" type="primary" @click="pickIn(searchValue)" v-if="wrkMast.ioType == 103">宸叉嫞鏂欏洖搴�</button>
</view>
</view>
</template>
@@ -43,23 +109,37 @@
searchValueFocus: true,
searchValue: '',
station: '',
- wrkMast: ''
-
+ stations: [],
+ wrkMast: '',
+ wrkDetls: [],
+ waitPakins: [],
+ barcode: '',
+ option: 'pick'
}
},
- onLoad() {
+ onShow() {
this.baseUrl = uni.getStorageSync('baseUrl');
this.token = uni.getStorageSync('token');
- },
- onShow() {
-
+ this.getBasDevp('all')
+ this.searchValueFocus = true
},
methods: {
searchValueInput() {
- this.getBasDevp()
+ if (this.searchValue == '') {
+ this.station = ''
+ this.stations = []
+ this.wrkMast = ''
+ this.wrkDetls = []
+ } else if (this.searchValue.length == 7) {
+ this.getBasDevp('one')
+ }
+ },
+ clear() {
+ this.waitPakins = []
+ this.wrkDetls = []
},
// 鑾峰彇鏆傚瓨浣�
- getBasDevp() {
+ getBasDevp(type) {
let _this = this
uni.request({
url: `${_this.baseUrl}/agv/basDevp/list/auth`,
@@ -73,10 +153,59 @@
success(res) {
res = res.data
if (res.code === 200) {
- for (let item of res.data.records) {
- _this.station = item
- _this.getWrkMast(item.barcode)
+ if (type == 'all') {
+ for (let k of res.data.records) {
+ if (k.locSts != 'O') {
+ k['style'] = 'station-wrk'
+ } else {
+ k['style'] = 'station-nowrk'
+ }
+ }
+ _this.stations = res.data.records
+ } else {
+ res.data.records
+ for (let item of res.data.records) {
+ if (item.locSts != 'O') {
+ item['style'] = 'station-wrk'
+ } else {
+ item['style'] = 'station-nowrk'
+ }
+ }
+ _this.getOrderDetl(res.data.records[0])
}
+ } else if (res.code == 403) {
+ uni.showToast({ title: res.msg, icon: "error", position: 'top' })
+ setTimeout(() => { uni.reLaunch({ url: '../../login/login' }); }, 1000);
+ } else {
+ uni.showToast({ title: res.msg, icon: "error", position: 'top' })
+ }
+ }
+ })
+ },
+ // 鑾峰彇缁勬墭妗�
+ getWaitPakin(barcode) {
+ let _this = this
+ uni.request({
+ url: `${_this.baseUrl}/agv/waitPakin/list/auth`,
+ header: {'token': uni.getStorageSync('token')},
+ data: {
+ curr: 1,
+ limit: 1000,
+ supp_code: barcode
+ },
+ method: 'GET',
+ success(res) {
+ res = res.data
+ if (res.code === 200) {
+ for (let item of res.data.records) {
+ _this.waitPakins = res.data.records
+ // _this.getWrkDetl(item.wrkNo)
+ }
+ } else if (res.code == 403) {
+ uni.showToast({ title: res.msg, icon: "error", position: 'top' })
+ setTimeout(() => { uni.reLaunch({ url: '../../login/login' }); }, 1000);
+ } else {
+ uni.showToast({ title: res.msg, icon: "error", position: 'top' })
}
}
})
@@ -98,10 +227,178 @@
if (res.code === 200) {
for (let item of res.data.records) {
_this.wrkMast = item
+ _this.getWrkDetl(item.wrkNo)
}
+ } else if (res.code == 403) {
+ uni.showToast({ title: res.msg, icon: "error", position: 'top' })
+ setTimeout(() => { uni.reLaunch({ url: '../../login/login' }); }, 1000);
+ } else {
+ uni.showToast({ title: res.msg, icon: "error", position: 'top' })
}
}
})
+ },
+ // 鑾峰彇宸ヤ綔鏄庣粏
+ getWrkDetl(wrkNo) {
+ let _this = this
+ uni.request({
+ url: `${_this.baseUrl}/agv/wrkDetl/list/auth`,
+ header: {'token': uni.getStorageSync('token')},
+ data: {
+ curr: 1,
+ limit: 1000,
+ wrk_no: wrkNo
+ },
+ method: 'GET',
+ success(res) {
+ res = res.data
+ if (res.code === 200) {
+ _this.wrkDetls = res.data.records
+ } else if (res.code == 403) {
+ uni.showToast({ title: res.msg, icon: "error", position: 'top' })
+ setTimeout(() => { uni.reLaunch({ url: '../../login/login' }); }, 1000);
+ } else {
+ uni.showToast({ title: res.msg, icon: "error", position: 'top' })
+ }
+ }
+ })
+ },
+ // 鎷f枡鍥炲簱
+ pickIn(e) {
+ let _this = this
+ uni.request({
+ url: `${_this.baseUrl}/agv/basDevp/visualized/container/pickIn`,
+ data: {devNo: e},
+ method: 'POST',
+ success(res) {
+ res = res.data
+ if (res.code === 200) {
+ _this.searchValue = ''
+ setTimeout(()=> {
+ _this.searchValue = ''
+ _this.station = ''
+ _this.wrkMast = ''
+ _this.wrkDetls = []
+ _this.waitPakins = []
+ },100)
+ } else if (res.code == 403) {
+ uni.showToast({ title: res.msg, icon: "error", position: 'top' })
+ setTimeout(() => { uni.reLaunch({ url: '../../login/login' }); }, 1000);
+ } else {
+ uni.showToast({ title: res.msg, icon: "error", position: 'top' })
+ }
+ }
+ })
+ },
+ // 瀹瑰櫒绂诲満
+ containerMoveOut(e) {
+ let _this = this
+ let devNo = {devNo:[e]}
+ // console.log(JSON.stringify(devNo));
+ uni.request({
+ url: `${_this.baseUrl}/agv/basDevp/visualized/container/moveOut`,
+ data: JSON.stringify(devNo),
+ method: 'POST',
+ success(res) {
+ res = res.data
+ if (res.code === 200) {
+ _this.searchValue = ''
+ setTimeout(()=> {
+ _this.searchValue = ''
+ _this.station = ''
+ _this.wrkMast = ''
+ _this.wrkDetls = []
+ _this.waitPakins = []
+ },100)
+ } else if (res.code == 403) {
+ uni.showToast({ title: res.msg, icon: "error", position: 'top' })
+ setTimeout(() => { uni.reLaunch({ url: '../../login/login' }); }, 1000);
+ } else {
+ uni.showToast({ title: res.msg, icon: "error", position: 'top' })
+ }
+ }
+ })
+ },
+ // 鍚姩鍏ュ簱
+ startPakin(type) {
+ let that = this
+ let params = []
+ let param = {}
+ if (type == 'empty') {
+ param = {
+ devNo: this.searchValue,
+ containerCode: this.barcode,
+ }
+ } else {
+ param = {
+ devNo: this.searchValue,
+ containerCode: this.station.barcode,
+ }
+ }
+ params.push(param)
+ uni.request({
+ url: that.baseUrl + '/agvMobile/pakin/empty/auth',
+ data: {pad: params},
+ method: 'POST',
+ header: {'token': uni.getStorageSync('token')},
+ success(result) {
+ var res = result.data
+ if (res.code === 200) {
+ setTimeout(()=> {
+ that.searchValue = ''
+ that.station = ''
+ that.wrkMast = ''
+ that.wrkDetls = []
+ that.waitPakins = []
+ },300)
+ uni.showToast({
+ title: res.msg,
+ icon: "none",
+ position: 'top'
+ })
+ } else if (res.code == 403) {
+ uni.showToast({ title: res.msg, icon: "error", position: 'top' })
+ setTimeout(() => { uni.reLaunch({ url: '../../login/login' }); }, 1000);
+ } else {
+ uni.showToast({ title: res.msg, icon: "error", position: 'top' })
+ }
+ }
+ });
+ },
+
+ // 绌烘澘鍏ュ簱
+ emptyPakin() {
+ let _this = this
+ this.$refs.revise.open()
+ },
+ // 鍙栨秷绌烘澘鍏ュ簱
+ reviseClose() {
+ this.$refs.revise.close()
+ },
+ // 纭绌烘澘鍏ュ簱
+ reviseConfirm() {
+ this.startPakin('empty')
+ this.$refs.revise.close()
+ },
+ // 鍓嶅線绔欑偣鏄庣粏椤甸潰
+ getOrderDetl(e) {
+ let _this = this
+ uni.navigateTo({
+ url: "./stationDetl",
+ success: function(res) {
+ // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� 鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑
+ res.eventChannel.emit('item', {
+ item: e
+ })
+ _this.searchValue = ''
+ },
+ events: {
+ // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� 鍙﹀涓�涓〉闈紶杩囨潵鐨�
+ acceptDataFromOpenedPage: function(data) {
+ _this.searchValueFocus = true
+ }
+ },
+ });
}
}
}
@@ -121,4 +418,76 @@
color: #e2231a;
font-weight: bold;
}
+
+ .popup {
+ width: 80vw;
+ min-height: 100rpx;
+ background-color: #FFF;
+ border-radius: 25rpx;
+ }
+ .title {
+ height: 100rpx;
+ line-height: 100rpx;
+ width: 100%;
+ color: #606266;
+ text-align: center;
+ font-size: 16px;
+ }
+ .popup-item {
+ height: 80rpx;
+ line-height: 80rpx;
+ display: flex;
+ align-items: center;
+ font-size: 14px;
+ }
+ .popup-item-left {
+ width: 16vw;
+ padding-right: 20rpx;
+ text-align: right;
+ color: #606266;
+ }
+ .popup-item-right {
+ display: flex;
+ align-items: center;
+ width: 50vw;
+ height: 50rpx;
+ padding: 2px 5px;
+ border: 1px solid #E4E7ED;
+ border-radius: 5rpx;
+ }
+ .popup-item-right input{
+ color: #606266;
+ }
+ .btn {
+ display: flex;
+ height: 90rpx;
+ margin-top: 20rpx;
+ border-top: 1px solid #DCDFE6;
+ justify-content: center;
+ align-items: center;
+ }
+ .btn-left {
+ display: flex;
+ flex: 1;
+ height: 100%;
+ justify-content: center;
+ align-items: center;
+ color: #606266;
+ border-right: 1px solid #DCDFE6;
+ }
+ .btn-right {
+ display: flex;
+ flex: 1;
+ justify-content: center;
+ align-items: center;
+ color: #409EFF;
+ }
+ .station-wrk {
+ background-color: #ff7356;
+ color: #fff;
+ }
+ .station-nowrk {
+ background-color: #3eb689;
+ color: #fff;
+ }
</style>
\ No newline at end of file
--
Gitblit v1.9.1