From 1c6a21c92ce324333e15944cc581c57e3637b1cf Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期三, 11 三月 2026 16:10:47 +0800
Subject: [PATCH] #
---
pages/inbound/buffStore.vue | 948 +++++++++++++++++++++++++++++++---------------------------
1 files changed, 507 insertions(+), 441 deletions(-)
diff --git a/pages/inbound/buffStore.vue b/pages/inbound/buffStore.vue
index d74c98e..a287ea1 100644
--- a/pages/inbound/buffStore.vue
+++ b/pages/inbound/buffStore.vue
@@ -2,70 +2,150 @@
<view class="has-foot">
<form>
<view class="flex padding-sm justify-center">
- <view class="text-orange text-center">璇锋寜涓嬪垪姝ラ杩涜 鈥滃鏂欑矑瀛愮亴妗跺叆搴撯�� </view>
+ <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>
+ <input
+ placeholder="璇锋壂鎻忔帴椹崇珯鐐规潯鐮�"
+ v-model="bagStaBarcode"
+ />
</view>
<view class="cu-bar btn-group top margin-top">
- <button class="cu-btn bg-blue shadow-blur" :disabled="repeatClick" @click="queryBagLocItem">1.鍛煎彨鏂版枡锛堣瑁�)</button>
+ <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">2.绌烘《鎺ラ┏绔欑偣锛�</view>
- <input placeholder="璇锋壂鎻忔帴椹崇珯鐐规潯鐮�" v-model="palletStaBarcode"></input>
- </view>
+ <input
+ placeholder="璇锋壂鎻忔帴椹崇珯鐐规潯鐮�"
+ v-model="palletStaBarcode"
+ />
+ </view>
<view class="cu-bar btn-group top margin-top">
- <button class="cu-btn text-blue line-blue shadow" :disabled="repeatClick" @click="callEmptyPallet">2.鍛煎彨绌烘《</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">3.寰呭叆搴撶墿鏂欑紪鐮侊細</view>
- <input placeholder="" v-model="matNr"></input>
- <text class='cuIcon-search text-blue' @click="search"></text>
+ <input
+ placeholder=""
+ v-model="matNr"
+ />
+ <text
+ class="cuIcon-search text-blue"
+ @click="search"
+ ></text>
</view>
- <view class="flex solid-bottom padding-sm justify-between">
- <text class="text-grey margin-left">{{ makTx }}</text>
+ <view class="flex solid-bottom padding-sm justify-between">
+ <text class="text-grey margin-left">{{ makTx }}</text>
</view>
<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>
+ <input
+ placeholder=""
+ v-model="palletBarcode"
+ />
+ <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" > 寰呭叆搴撳簱鍖猴細2#-1F 妗惰鏂版枡鍌ㄤ綅</view>
+ <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" :disabled="repeatClick" @click="fullInStock">3.瑁呮《瀹屾垚锛岀偣鍑诲叆搴�</button>
+ <button
+ class="cu-btn bg-green shadow-blur"
+ :disabled="repeatClick"
+ @click="fullInStock"
+ >
+ 3.瑁呮《瀹屾垚锛岀偣鍑诲叆搴�
+ </button>
+ </view>
+ <view class="cu-bar btn-group top margin-top">
+ <button
+ class="cu-btn bg-brown shadow-blur"
+ :disabled="repeatClick"
+ @click="toEmptyIn"
+ >
+ 4.绌烘墭鍏ュ簱
+ </button>
</view>
</form>
<!-- 鏂版枡搴撳瓨淇℃伅寮圭獥 -->
- <view class="cu-modal" :class="modalName=='bagModal'?'show':''" @click="closeModal">
- <view class="cu-dialog" @click.stop>
+ <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">
+ <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="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>
+ <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>
+ <button
+ class="cu-btn bg-blue shadow-blur sm"
+ @click.stop="callBagByAGV(item)"
+ >
+ 涓婃枡
+ </button>
</view>
</view>
</view>
@@ -119,459 +199,445 @@
</block>
</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: [],
- bagList: [],
- range: [],
- curCode: '',
- whAreaId:'',
- repeatClick: false,
- palletBarcode: '',
- palletTypeId: '',
- palletTypeRange: [],
- bagStaBarcode: '',
- modalName: '',
- palletStaBarcode: '',
- matNr: '',
- makTx: '',
- transferStationNo: '',
+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: ''
+ }
+ },
+ computed: {
+ ...mapState('user', ['dynamicFields'])
+ },
+ mounted() {
+ this.getRece()
+ this.getPalletType()
+ this.whAreaId = uni.getStorageSync('whAreaId')
+ },
+ methods: {
+ toEmptyIn() {
+ uni.navigateTo({
+ url: '/pages/emptyTray/inBound'
+ })
+ },
+ 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
+ }
+ that.range = data.warehouseAreasList.map((item) => ({
+ value: item.id,
+ text: item.name
+ }))
+ that.whAreaId = data.area
+ } else {
+ uni.showToast({
+ title: msg,
+ icon: 'none'
+ })
}
},
- computed: {
- ...mapState('user', ['dynamicFields']),
+
+ remove(index) {
+ this.list.splice(index, 1)
},
- mounted() {
- this.getRece()
- this.getPalletType()
- this.whAreaId = uni.getStorageSync('whAreaId')
+ clear() {
+ this.list = []
+ this.container = ''
+ this.barcode = ''
},
- methods: {
- selChange(val) {
- uni.setStorageSync('whAreaId', val)
- },
- async search() {
- let that = this
- const {
- code,
- data,
- msg
- } = await request('/staBind/list', {
- sta: this.barcode
+
+ open() {
+ this.$refs.popup.open()
+ },
+
+ 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'
})
- 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",
- })
- }
- },
-
- remove(index) {
- this.list.splice(index, 1);
- },
- clear() {
- this.list = []
- this.container = ''
- this.barcode = ''
- },
-
- open() {
- this.$refs.popup.open()
- },
-
- 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() {
+ return
+ }
+ this.repeatClick = true
+ try {
const { code, data, msg } = await request(
- '/info/palletType/list',
- {},
- 'get'
+ '/inventory/details',
+ {
+ wareHouseAreaId: '2--1-5' // TODO:鍥哄畾寰呭悗缁浛鎹�
+ }
)
if (code === 200) {
- this.palletTypeRange = data.map((item) => ({
- value: item.value,
- text:
- item.group === null
- ? item.label
- : item.group + '-- ' + item.label
- }))
+ if (data && data.length > 0) {
+ // 灞曠ず鏌ヨ鍒扮殑鏁版嵁
+ this.bagList = data
+ // 鎵撳紑寮圭獥
+ this.modalName = 'bagModal'
+ } else {
+ uni.showToast({
+ title: '鏈煡鍒版柊鏂欙紙琚嬭)搴撳瓨',
+ icon: 'none'
+ })
+ }
+ } else {
+ uni.showToast({
+ title: msg,
+ icon: 'none'
+ })
}
- },
-
- palletTypeChange(val) {
- uni.setStorageSync('palletTypeId', val.value)
- },
+ } catch (error) {
+ console.error('璇锋眰閿欒:', error)
+ uni.showToast({
+ title: '鏌ヨ澶辫触锛�' + (error.message || '鏈煡閿欒'),
+ icon: 'none'
+ })
+ } finally {
+ this.repeatClick = false
+ }
+ },
- async confirm() {
- if(this.barcode === '' || this.barcode ===null){
+ // 鍏抽棴寮圭獥
+ 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: "none",
+ title: '鏂版枡锛堣瑁咃級涓婃枡涓�',
+ icon: 'success'
})
- return ;
+ // 鏇存柊鐗╂枡缂栫爜銆佺墿鏂欏悕绉�
+ ;(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'
+ })
}
- 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
+ } 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: '鍚姩鎴愬姛'
+ title: '鍛煎彨绌烘墭鐩樹腑锛岃绋嶄綔绛夊緟'
})
- this.clear()
+ this.bagBarcode = ''
} else {
uni.showToast({
title: msg,
- icon: "none",
+ icon: 'none',
+ position: 'top'
})
}
+ } finally {
this.repeatClick = false
- },
-
- async getRece() {
- const {
- code,
- data,
- msg
- } = await request('/areas/receipt', {}, 'get')
+ }
+ },
+
+ // 婊℃《鍏ュ簱
+ 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) {
- this.range = data.map(item => ({
- value: item.id,
- text: item.warehouseId$ + "-- " + item.name
- }));
+ 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
+ }
+ this.repeatClick = true
+ try {
+ const { code, data, msg } = await request(
+ '/callForEmptyContainers',
+ {
+ staNo: this.palletBarcode,
+ type: '102'
+ }
+ )
+ 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)
+ },
+
+ 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;
+}
- .item {
- position: relative;
- display: flex;
- min-height: 80upx;
- align-items: center;
- }
+.uni-file-picker {
+ width: 100%;
+ margin-bottom: 10px;
+}
- .uni-file-picker {
- width: 100%;
- margin-bottom: 10px;
- }
+.uni-select__selector {
+ z-index: 999;
+}
- .uni-select__selector {
- z-index: 999;
- }
+.tj {
+ height: auto;
+ padding: 6px 8px;
+ display: inline-block;
+ border-radius: 6px;
+}
- .tj {
- height: auto;
- padding: 6px 8px;
- display: inline-block;
- border-radius: 6px;
- }
+.item {
+ display: flex;
+ justify-content: center;
+}
- .item {
- display: flex;
- justify-content: center;
- }
-
- .item .cu-btn {
- font-size: 26upx;
- }
-</style>
\ No newline at end of file
+.item .cu-btn {
+ font-size: 26upx;
+}
+</style>
--
Gitblit v1.9.1