From f23814fcf6199cfb2d8bbc121fdccab834b374a4 Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期三, 11 三月 2026 10:53:00 +0800
Subject: [PATCH] #
---
pages/inbound/buffStore.vue | 763 ++++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 506 insertions(+), 257 deletions(-)
diff --git a/pages/inbound/buffStore.vue b/pages/inbound/buffStore.vue
index 257d021..d74c98e 100644
--- a/pages/inbound/buffStore.vue
+++ b/pages/inbound/buffStore.vue
@@ -1,72 +1,92 @@
<template>
<view class="has-foot">
<form>
+ <view class="flex padding-sm justify-center">
+ <view class="text-orange text-center">璇锋寜涓嬪垪姝ラ杩涜 鈥滃鏂欑矑瀛愮亴妗跺叆搴撯�� </view>
+ </view>
+ <!-- step1锛氫笂鏂版枡 -->
+ <view class="cu-form-group">
+ <view class="title">1.鏂版枡锛堣瑁咃級鎺ラ┏绔欑偣锛�</view>
+ <input placeholder="璇锋壂鎻忔帴椹崇珯鐐规潯鐮�" v-model="bagStaBarcode" ></input>
+ </view>
+ <view class="cu-bar btn-group top margin-top">
+ <button class="cu-btn bg-blue shadow-blur" :disabled="repeatClick" @click="queryBagLocItem">1.鍛煎彨鏂版枡锛堣瑁�)</button>
+ </view>
+ <!-- step2锛氫笂绌烘《 -->
<view class="cu-form-group margin-top">
- <view class="title">绌烘《鎺ラ┏绔欑偣</view>
- <input
- placeholder="璇锋壂鎻忕┖妗舵帴椹崇珯鐐规潯鐮�"
- v-model="sta1"
- />
- </view>
-
+ <view class="title">2.绌烘《鎺ラ┏绔欑偣锛�</view>
+ <input placeholder="璇锋壂鎻忔帴椹崇珯鐐规潯鐮�" v-model="palletStaBarcode"></input>
+ </view>
<view class="cu-bar btn-group top margin-top">
- <button
- class="cu-btn text-blue line-blue shadow"
- @click="sta1Click()"
- >
- 1.鍛煎彨绌烘《
- </button>
+ <button class="cu-btn text-blue line-blue shadow" :disabled="repeatClick" @click="callEmptyPallet">2.鍛煎彨绌烘《</button>
</view>
-
+ <!-- step3锛氬叆搴� -->
<view class="cu-form-group margin-top">
- <view class="title">琚嬭鏂版枡鎺ラ┏绔欑偣</view>
- <input
- placeholder="璇锋壂鎻忚瑁呮柊鏂欐帴椹崇珯鐐规潯鐮�"
- v-model="sta2"
- />
+ <view class="title">3.寰呭叆搴撶墿鏂欑紪鐮侊細</view>
+ <input placeholder="" v-model="matNr"></input>
+ <text class='cuIcon-search text-blue' @click="search"></text>
</view>
-
- <view class="cu-bar btn-group top margin-top">
- <button
- class="cu-btn bg-blue shadow-blur"
- :disabled="repeatClick"
- @click="sta2Click()"
- >
- 2.鍛煎彨琚嬭鏂版枡
- </button>
+ <view class="flex solid-bottom padding-sm justify-between">
+ <text class="text-grey margin-left">{{ makTx }}</text>
</view>
-
- <view class="cu-bar btn-group top margin-top">
- <button
- class="cu-btn bg-green shadow-blur"
- @click="toComb"
- >
- 3.鍘荤粍鎵�
- </button>
+ <view class="cu-form-group">
+ <view class="title"> 寰呭叆搴撴《鍙凤細</view>
+ <input placeholder="" v-model="palletBarcode"></input>
+ <text class='cuIcon-search text-blue' @click="search"></text>
+ </view>
+ <view class="flex solid-bottom padding-sm justify-between">
+ <view class="text-grey margin-left" > 寰呭叆搴撶墿鏂欐暟閲忥細1妗�</view>
+ </view>
+ <view class="flex solid-bottom padding-sm justify-between">
+ <view class="text-grey margin-left" > 寰呭叆搴撳簱鍖猴細2#-1F 妗惰鏂版枡鍌ㄤ綅</view>
</view>
<view class="cu-bar btn-group top margin-top">
- <button
- class="cu-btn bg-green shadow-blur"
- @click="toIn"
- >
- 4.鍘诲叆搴�
- </button>
+ <button class="cu-btn bg-green shadow-blur" :disabled="repeatClick" @click="fullInStock">3.瑁呮《瀹屾垚锛岀偣鍑诲叆搴�</button>
</view>
</form>
- <view class="cu-list det menu sm-border padding">
- <block
- v-for="(item, index) in list"
- :key="index"
- >
+ <!-- 鏂版枡搴撳瓨淇℃伅寮圭獥 -->
+ <view class="cu-modal" :class="modalName=='bagModal'?'show':''" @click="closeModal">
+ <view class="cu-dialog" @click.stop>
+ <view class="cu-bar bg-white justify-between">
+ <view class="title text-bold">鏂版枡锛堣瑁咃級搴撳瓨淇℃伅</view>
+ <view class="content" @click="closeModal">
+ <text class="cuIcon-close text-grey"></text>
+ </view>
+ </view>
+ <view class="padding-lr" style="max-height: 70vh; overflow-y: auto;">
+ <block v-for="(item, index) in bagList" :key="index">
+ <view class="cu-list menu-avatar margin-bottom-sm">
+ <view class="cu-item flex align-start">
+ <view class="content flex-1 text-left">
+ <text class="text-grey padding-right-xs">搴撲綅锛歿{item.locId}} </text>
+ <text class="text-grey padding-right-xs">鐗╂枡锛歿{item.makTx}} </text>
+ <text class="text-grey padding-right-xs">鎵樼洏鍙凤細{{item.palletId}} </text>
+ <text class="text-orange">鏁伴噺锛歿{item.anfme}} </text>
+ </view>
+ <view class="action">
+ <button class="cu-btn bg-blue shadow-blur sm" @click.stop="callBagByAGV(item)">涓婃枡</button>
+ </view>
+ </view>
+ </view>
+ </block>
+ </view>
+ </view>
+ </view>
+
+ <!-- <view class="cu-list det menu sm-border padding">
+ <block v-for="(item, index) in list" :key="index">
<view class="cu-bar bg-white solid-bottom margin-top-sm">
<view class="action">
<view class="index">
- {{ index + 1 }}
+ {{index+1}}
</view>
<view class="text-blue">
- {{ `${item.maktx}` }}
+ {{`${item.maktx}`}}
</view>
+ </view>
+ <view class="action" >
+ <text @click="remove(index)" class="cuIcon-close text-red" style="font-size: 24px;"></text>
</view>
</view>
@@ -75,7 +95,7 @@
<text class="text-black">ASN:</text>
</view>
<view class="action">
- <text class="text-grey">{{ item.asnCode }}</text>
+ <text class="text-grey ">{{item.asnCode}}</text>
</view>
</view>
<view class="cu-item">
@@ -83,246 +103,475 @@
<text class="text-black">鎵规:</text>
</view>
<view class="action">
- <text class="text-grey">{{ item.batch }}</text>
+ <text class="text-grey ">{{item.batch}}</text>
</view>
</view>
+
<view class="cu-item">
<view class="content">
<text class="text-black">鏀惰揣鏁伴噺:</text>
</view>
<view class="action">
- <text class="text-grey">{{ item.anfme }}</text>
+ <text class="text-grey ">{{item.anfme}}</text>
</view>
</view>
+
</block>
- </view>
+ </view> -->
+
</view>
</template>
<script>
-import { request } from '../../common/request.js'
-import { mapState, mapMutations, mapActions, mapGetters } from 'vuex'
-export default {
- data() {
- return {
- barcode: '',
- areaName: '',
- locCode: '',
- container: '',
- list: [],
- range: [],
- curCode: '',
- whAreaId: '',
- repeatClick: false,
- sta1: '',
- sta2: ''
- }
- },
- computed: {
- ...mapState('user', ['dynamicFields'])
- },
- mounted() {},
- methods: {
- async sta1Click() {
- let that = this
- const { code, data, msg } = await request(
- '/orderOut/buffStore/callEmpty',
- {
- sta1: this.sta1
- },
- 'POST'
- )
- if (code === 200) {
- uni.showToast({
- title: '鍛煎彨鎴愬姛'
- })
- } else {
- uni.showToast({
- title: msg,
- icon: 'none'
- })
+ import {
+ request
+ } from '../../common/request.js'
+ import {
+ mapState,
+ mapMutations,
+ mapActions,
+ mapGetters
+ } from 'vuex';
+ export default {
+ data() {
+ return {
+ // barcode: '',
+ areaName: '',
+ locCode: '',
+ container: '',
+ list: [],
+ bagList: [],
+ range: [],
+ curCode: '',
+ whAreaId:'',
+ repeatClick: false,
+ palletBarcode: '',
+ palletTypeId: '',
+ palletTypeRange: [],
+ bagStaBarcode: '',
+ modalName: '',
+ palletStaBarcode: '',
+ matNr: '',
+ makTx: '',
+ transferStationNo: '',
}
},
- async sta2Click() {
- let that = this
- const { code, data, msg } = await request(
- '/orderOut/buffStore/callNewMat',
- {
- sta1: this.sta1
- },
- 'POST'
- )
- if (code === 200) {
- uni.showToast({
- title: '鍛煎彨鎴愬姛'
+ computed: {
+ ...mapState('user', ['dynamicFields']),
+ },
+ mounted() {
+ this.getRece()
+ this.getPalletType()
+ this.whAreaId = uni.getStorageSync('whAreaId')
+ },
+ methods: {
+ selChange(val) {
+ uni.setStorageSync('whAreaId', val)
+ },
+ async search() {
+ let that = this
+ const {
+ code,
+ data,
+ msg
+ } = await request('/staBind/list', {
+ sta: this.barcode
})
- } else {
- uni.showToast({
- title: msg,
- icon: 'none'
- })
- }
- },
- toComb() {
- uni.navigateTo({
- url: '/pages/listing/matnrPalletising'
- })
- },
- toIn() {
- uni.navigateTo({
- url: '/pages/AGV/StartInTask'
- })
- },
- selChange(val) {
- uni.setStorageSync('whAreaId', val)
- },
- async search() {
- let that = this
- const { code, data, msg } = await request('/staBind/list', {
- sta: this.barcode
- })
- if (code === 200) {
- if (data.list.length > 0) {
- that.container = data.barcode
- that.list = data.list
+ if (code === 200) {
+ if(data.list.length >0){
+ that.container = data.barcode
+ that.list = data.list
+ }
+ that.range = data.warehouseAreasList.map(item => ({
+ value: item.id,
+ text: item.name
+ }));
+ that.whAreaId = data.area
+ } else {
+ uni.showToast({
+ title: msg,
+ icon: "none",
+ })
}
- that.range = data.warehouseAreasList.map((item) => ({
- value: item.id,
- text: item.name
- }))
- that.whAreaId = data.area
- } else {
- uni.showToast({
- title: msg,
- icon: 'none'
- })
- }
- },
+ },
- remove(index) {
- this.list.splice(index, 1)
- },
- clear() {
- this.list = []
+ remove(index) {
+ this.list.splice(index, 1);
+ },
+ clear() {
+ this.list = []
+ this.container = ''
+ this.barcode = ''
+ },
- this.container = ''
- this.barcode = ''
- },
+ open() {
+ this.$refs.popup.open()
+ },
- open() {
- this.$refs.popup.open()
- },
+ close() {
+ this.$refs.popup.close()
+ },
- close() {
- this.$refs.popup.close()
- },
+ popupSubmit() {
+ this.$refs.popup.close()
+ },
+ itemChange(el) {
+ this.curCode = el
+ },
+
+ // 閫夋嫨鏂版枡锛堣瑁�)搴撳瓨锛岄�佽嚦鐏屾《绔欑偣
+ async queryBagLocItem() {
+ if(this.bagStaBarcode === '' || this.bagStaBarcode === null){
+ uni.showToast({
+ title: "鏂版枡 (琚嬭) 鎺ラ┏绔欑偣涓嶈兘涓虹┖!!!",
+ icon: "none",
+ })
+ return ;
+ }
+ this.repeatClick = true
+ try{
+ const { code, data, msg } = await request('/inventory/details', {
+ wareHouseAreaId: '2--1-5' // TODO:鍥哄畾寰呭悗缁浛鎹�
+ })
+ if (code === 200) {
+ if(data && data.length > 0){
+ // 灞曠ず鏌ヨ鍒扮殑鏁版嵁
+ this.bagList = data
+ // 鎵撳紑寮圭獥
+ this.modalName = 'bagModal'
+ } else {
+ uni.showToast({
+ title: '鏈煡鍒版柊鏂欙紙琚嬭)搴撳瓨',
+ icon: 'none'
+ })
+ }
+ } else {
+ uni.showToast({
+ title: msg,
+ icon: 'none',
+ })
+ }
+ } catch (error) {
+ console.error('璇锋眰閿欒:', error)
+ uni.showToast({
+ title: '鏌ヨ澶辫触锛�' + (error.message || '鏈煡閿欒'),
+ icon: 'none'
+ })
+ }finally{
+ this.repeatClick = false
+ }
+ },
+
+ // 鍏抽棴寮圭獥
+ closeModal() {
+ this.modalName = null
+ },
+
+ // 涓烘柊鏂欙紙琚嬭锛変笂鏂欏懠鍙� AGV
+ async callBagByAGV(item) {
+ console.log('AGV涓婃枡锛氭柊鏂欙紙琚嬭锛�, 鏁版嵁:', item)
+ if(this.item === '' || this.item === null){
+ uni.showToast({
+ title: "璇峰厛閫夋嫨搴撲綅鍑哄簱",
+ icon: "none",
+ })
+ return ;
+ }
+ this.repeatClick = true
+ try{
+ const { code, data, msg } = await request('/check/non/order', {
+ transferStationNo: this.transferStationNo || this.bagStaBarcode,
+ locNo: item.locId
+ })
+ if (code === 200) {
+ uni.showToast({
+ title: '鏂版枡锛堣瑁咃級涓婃枡涓�',
+ icon: 'success'
+ })
+ // 鏇存柊鐗╂枡缂栫爜銆佺墿鏂欏悕绉�
+ this.matNr = item.matNr || '',
+ this.makTx = '寰呭叆搴撶墿鏂欏悕绉帮細' + (item.makTx || '')
+ this.closeModal()
+ // // 浠庡垪琛ㄤ腑绉婚櫎璇ラ」
+ // const index = this.bagList.findIndex(i => i.palletId === item.palletId)
+ // if (index > -1) {
+ // this.bagList.splice(index, 1)
+ // }
+ // // 濡傛灉鍒楄〃涓虹┖锛屽叧闂脊绐�
+ // if (this.bagList.length === 0) {
+ // this.closeModal()
+ // }
+ } else {
+ uni.showToast({
+ title: msg,
+ icon: 'none'
+ })
+ }
+ } catch (error) {
+ console.error('AGV 鍛煎彨澶辫触:', error)
+ uni.showToast({
+ title: 'AGV 鍛煎彨澶辫触',
+ icon: 'none'
+ })
+ } finally {
+ this.repeatClick = false
+ }
+ },
+
+ // 鍛煎彨绌烘《
+ async callEmptyPalletFromBag() {
+ // 浣跨敤琚嬭鎺ラ┏绔欑偣淇℃伅璋冪敤绌烘墭鍑哄簱鎺ュ彛
+ if(this.palletTypeId === '' || this.palletTypeId === null){
+ uni.showToast({
+ title: "璇峰厛閫夋嫨瀹瑰櫒绫诲瀷",
+ icon: "none",
+ })
+ return ;
+ }
+ this.repeatClick = true
+ try{
+ const { code, data, msg } = await request(
+ '/callForEmptyContainers',
+ {
+ staNo: this.bagBarcode,
+ type: this.palletTypeId
+ }
+ )
+ if (code === 200) {
+ uni.showToast({
+ title: '鍛煎彨绌烘墭鐩樹腑锛岃绋嶄綔绛夊緟'
+ })
+ this.bagBarcode = ''
+ } else {
+ uni.showToast({
+ title: msg,
+ icon: 'none',
+ position: 'top'
+ })
+ }
+ }finally{
+ this.repeatClick = false
+ }
+ },
+
+ // 婊℃《鍏ュ簱
+ async fullInStock() {
+ console.log('婊℃《鍏ュ簱锛氭柊鏂欙紙琚嬭锛�, 鏁版嵁:', item)
+ if(this.item === '' || this.item === null){
+ uni.showToast({
+ title: "璇峰厛閫夋嫨搴撲綅鍑哄簱",
+ icon: "none",
+ })
+ return ;
+ }
+ this.repeatClick = true
+ try{
+ const { code, data, msg } = await request('/AGV/task/start', {
+ staNo: this.bagBarcode,
+ palletBarcode: item.palletId
+ })
+ if (code === 200) {
+ uni.showToast({
+ title: '鏂版枡锛堣瑁咃級涓婃枡涓�',
+ icon: 'success'
+ })
+ // 鏇存柊鐗╂枡缂栫爜銆佺墿鏂欏悕绉�
+ this.matNr = item.matnrCode || ''
+ this.makTx = ' 寰呭叆搴撶墿鏂欏悕绉帮細' + (item.makTx || '')
+
+ // 浠庡垪琛ㄤ腑绉婚櫎璇ラ」
+ const index = this.bagList.findIndex(i => i.palletId === item.palletId)
+ if (index > -1) {
+ this.bagList.splice(index, 1)
+ }
+ // 濡傛灉鍒楄〃涓虹┖锛屽叧闂脊绐�
+ if (this.bagList.length === 0) {
+ this.closeModal()
+ }
+ } else {
+ uni.showToast({
+ title: msg,
+ icon: 'none'
+ })
+ }
+ } catch (error) {
+ console.error('AGV 鍛煎彨澶辫触:', error)
+ uni.showToast({
+ title: 'AGV 鍛煎彨澶辫触',
+ icon: 'none'
+ })
+ } finally {
+ this.repeatClick = false
+ }
+ },
+
+ async callEmptyPallet() {
+ if(this.staBarcode === '' || this.palletBarcode === null){
+ uni.showToast({
+ title: "鎺ラ┏绔欑偣涓嶈兘涓虹┖",
+ icon: "none",
+ })
+ return ;
+ }
+ if(this.palletTypeId === '' || this.palletTypeId === null){
+ uni.showToast({
+ title: "璇烽�夋嫨瀹瑰櫒绫诲瀷",
+ icon: "none",
+ })
+ return ;
+ }
+ this.repeatClick = true
+ try{
+ const { code, data, msg } = await request(
+ '/callForEmptyContainers',
+ {
+ staNo: this.palletBarcode,
+ type: this.palletTypeId
+ }
+ )
+ if (code === 200) {
+ uni.showToast({
+ title: '鍛煎彨绌烘墭鐩樹腑锛岃绋嶄綔绛夊緟'
+ })
+ this.palletBarcode = ''
+ } else {
+ uni.showToast({
+ title: msg,
+ icon: 'none',
+ position: 'top'
+ })
+ }
+ }finally{
+ this.repeatClick = false
+ }
+ },
+
+ async getPalletType() {
+ const { code, data, msg } = await request(
+ '/info/palletType/list',
+ {},
+ 'get'
+ )
+ if (code === 200) {
+ this.palletTypeRange = data.map((item) => ({
+ value: item.value,
+ text:
+ item.group === null
+ ? item.label
+ : item.group + '-- ' + item.label
+ }))
+ }
+ },
+
+ palletTypeChange(val) {
+ uni.setStorageSync('palletTypeId', val.value)
+ },
- popupSubmit() {
- this.$refs.popup.close()
- },
- itemChange(el) {
- this.curCode = el
- },
-
- async confirm() {
- if (this.barcode === '' || this.barcode === null) {
- uni.showToast({
- title: '鎺ラ┏绔欑偣涓嶈兘涓虹┖',
- icon: 'none'
- })
- return
- }
- if (this.whAreaId === '' || this.whAreaId === null) {
- uni.showToast({
- title: '鐩爣搴撳尯涓嶈兘涓虹┖',
- icon: 'none'
- })
- return
- }
- this.repeatClick = true
- const { code, data, msg } = await request('/AGV/task/start', {
- sta: this.barcode,
- area: this.whAreaId
- })
- if (code === 200) {
- uni.showToast({
- title: '鍚姩鎴愬姛'
- })
- this.clear()
- } else {
- uni.showToast({
- title: msg,
- icon: 'none'
- })
- }
- this.repeatClick = false
- },
-
- async getRece() {
- const { code, data, msg } = await request(
- '/areas/receipt',
- {},
- 'get'
- )
- if (code === 200) {
- this.range = data.map((item) => ({
- value: item.id,
- text: item.warehouseId$ + '-- ' + item.name
- }))
- }
+ async confirm() {
+ if(this.barcode === '' || this.barcode ===null){
+ uni.showToast({
+ title: "鎺ラ┏绔欑偣涓嶈兘涓虹┖",
+ icon: "none",
+ })
+ return ;
+ }
+ if(this.whAreaId === '' || this.whAreaId ===null){
+ uni.showToast({
+ title: "鐩爣搴撳尯涓嶈兘涓虹┖",
+ icon: "none",
+ })
+ return ;
+ }
+ this.repeatClick = true
+ const {
+ code,
+ data,
+ msg
+ } = await request('/AGV/task/start',{
+ sta: this.barcode,
+ area: this.whAreaId
+ }
+ )
+ if (code === 200) {
+ uni.showToast({
+ title: '鍚姩鎴愬姛'
+ })
+ this.clear()
+ } else {
+ uni.showToast({
+ title: msg,
+ icon: "none",
+ })
+ }
+ this.repeatClick = false
+ },
+
+ async getRece() {
+ const {
+ code,
+ data,
+ msg
+ } = await request('/areas/receipt', {}, 'get')
+ if (code === 200) {
+ this.range = data.map(item => ({
+ value: item.id,
+ text: item.warehouseId$ + "-- " + item.name
+ }));
+ }
+ },
}
}
-}
</script>
<style>
-.index {
- border: 1px solid #e54d42;
- color: #e54d42;
- border-radius: 50%;
- display: block;
- width: 50rpx;
- height: 50rpx;
- line-height: 48rpx;
- text-align: center;
- margin-right: 20rpx;
- font-size: 30rpx;
-}
+ .index {
+ border: 1px solid #e54d42;
+ color: #e54d42;
+ border-radius: 50%;
+ display: block;
+ width: 50rpx;
+ height: 50rpx;
+ line-height: 48rpx;
+ text-align: center;
+ margin-right: 20rpx;
+ font-size: 30rpx;
+ }
-.text-blue {
- color: #0081ff !important;
-}
+ .text-blue {
+ color: #0081ff !important;
-.item {
- position: relative;
- display: flex;
- min-height: 80upx;
- align-items: center;
-}
+ }
-.uni-file-picker {
- width: 100%;
- margin-bottom: 10px;
-}
+ .item {
+ position: relative;
+ display: flex;
+ min-height: 80upx;
+ align-items: center;
+ }
-.uni-select__selector {
- z-index: 999;
-}
+ .uni-file-picker {
+ width: 100%;
+ margin-bottom: 10px;
+ }
-.tj {
- height: auto;
- padding: 6px 8px;
- display: inline-block;
- border-radius: 6px;
-}
+ .uni-select__selector {
+ z-index: 999;
+ }
-.item {
- display: flex;
- justify-content: center;
-}
+ .tj {
+ height: auto;
+ padding: 6px 8px;
+ display: inline-block;
+ border-radius: 6px;
+ }
-.item .cu-btn {
- font-size: 26upx;
-}
-</style>
+ .item {
+ display: flex;
+ justify-content: center;
+ }
+
+ .item .cu-btn {
+ font-size: 26upx;
+ }
+</style>
\ No newline at end of file
--
Gitblit v1.9.1