#
zhou zhou
5 天以前 32fe3499b4c2d896819ad03b6dbf776bf4d6baed
pages/inbound/buffStore.vue
@@ -1,62 +1,64 @@
<template>
   <view class="has-foot">
      <form>
         <view class="flex solid-bottom padding-sm justify-between">
            <view class="text-grey margin-left">已选物料信息:{{container}}</view>
         </view>
         <view class="cu-form-group margin-top">
            <view class="title">空桶接驳站点</view>
            <input placeholder="请扫描空桶接驳站点条码" v-model="barcode" ></input>
            <!-- <text class='cuIcon-search text-blue' @click="search"></text> -->
            <input
               placeholder="请扫描空桶接驳站点条码"
               v-model="sta1"
            />
         </view>   
         
         <view class="cu-bar btn-group top margin-top">
            <button class="cu-btn text-blue line-blue shadow" @click="clear">1.呼叫空桶</button>
            <!-- <button class="cu-btn bg-blue shadow-blur" :disabled="repeatClick" @click="confirm">2.呼叫袋装新料</button> -->
<!--             <button class="ccu-btn bg-blue shadow-blur shadow-blur" @click="clear">呼叫袋装新料</button>
            <button class="ccu-btn bg-blue shadow-blur shadow-blur" @click="clear">呼叫空桶</button> -->
            <!-- <button class="cu-btn bg-blue shadow-blur" :disabled="repeatClick" @click="confirm">入库</button> -->
            <button
               class="cu-btn text-blue line-blue shadow"
               @click="sta1Click()"
            >
               1.呼叫空桶
            </button>
         </view>
         
         <view class="cu-form-group margin-top">
                     <view class="title">袋装新料接驳站点</view>
                     <input placeholder="请扫描袋装新料接驳站点条码" v-model="barcode" ></input>
                     <!-- <text class='cuIcon-search text-blue' @click="search"></text> -->
            <input
               placeholder="请扫描袋装新料接驳站点条码"
               v-model="sta2"
            />
                  </view>   
                  
                  <view class="cu-bar btn-group top margin-top">
                     <!-- <button class="cu-btn text-blue line-blue shadow" @click="clear">1.呼叫空桶</button> -->
                     <button class="cu-btn bg-blue shadow-blur" :disabled="repeatClick" @click="confirm">2.呼叫袋装新料</button>
         <!--             <button class="ccu-btn bg-blue shadow-blur shadow-blur" @click="clear">呼叫袋装新料</button>
                     <button class="ccu-btn bg-blue shadow-blur shadow-blur" @click="clear">呼叫空桶</button> -->
                     <!-- <button class="cu-btn bg-blue shadow-blur" :disabled="repeatClick" @click="confirm">入库</button> -->
            <button
               class="cu-btn bg-blue shadow-blur"
               :disabled="repeatClick"
               @click="sta2Click()"
            >
               2.呼叫袋装新料
            </button>
                  </view>
         <view class="cu-form-group margin-top">
            <view class="title">容器号</view>
            <input placeholder="请扫需要入库容器条码" v-model="container"></input>
            <text class='cuIcon-search text-blue' @click="search"></text>
         </view>
<!--          <view class="cu-form-group">
            <view class="title">目标库区</view>
            <view style="width: 75%;">
               <uni-data-select style="min-width: 50%; max-width: 100%;" v-model="whAreaId" :localdata="range"
                  placement="bottom" @change="selChange"></uni-data-select>
            </view>
         </view> -->
         
         <view class="cu-bar btn-group top margin-top">
            <button class="cu-btn bg-green shadow-blur" @click="clear">3.桶装新料入库</button>
            <button
               class="cu-btn bg-green shadow-blur"
               @click="toComb"
            >
               3.去组托
            </button>
         </view>
         <view class="cu-bar btn-group top margin-top">
            <button
               class="cu-btn bg-green shadow-blur"
               @click="toIn"
            >
               4.去入库
            </button>
         </view>
      </form>
      <view class="cu-list det menu sm-border  padding">
         <block v-for="(item, index) in list" :key="index">
         <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">
@@ -66,9 +68,6 @@
                     {{`${item.maktx}`}}
                  </view>
               </view>
               <!--    <view class="action" >
                  <text @click="remove(index)" class="cuIcon-close text-red" style="font-size: 24px;"></text>
               </view> -->
            </view>
            <view class="cu-item">
@@ -88,7 +87,6 @@
               </view>
            </view>
            <view class="cu-item">
               <view class="content">
                  <text class="text-black">收货数量:</text>
@@ -97,31 +95,14 @@
                  <text class="text-grey ">{{item.anfme}}</text>
               </view>
            </view>
         </block>
      </view>
<!--       <view class="cu-bar btn-group foot">
         <button class="cu-btn text-blue line-blue shadow" @click="clear">清空</button>
         <button class="cu-btn bg-blue shadow-blur" :disabled="repeatClick" @click="confirm">入库</button>
      </view> -->
   </view>
</template>
<script>
   import {
      request
   } from '../../common/request.js'
   import {
      mapState,
      mapMutations,
      mapActions,
      mapGetters
   } from 'vuex';
import { request } from '../../common/request.js'
import { mapState, mapMutations, mapActions, mapGetters } from 'vuex'
   export default {
      data() {
         return {
@@ -134,27 +115,71 @@
            curCode: '',
            whAreaId:'',
            repeatClick: false,
         sta1: '',
         sta2: ''
         }
      },
      computed: {
         ...mapState('user', ['dynamicFields']),
      ...mapState('user', ['dynamicFields'])
      },
      mounted() {
         this.getRece()
         this.whAreaId = uni.getStorageSync('whAreaId')
      },
   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'
            })
         }
      },
      async sta2Click() {
         let that = this
         const { code, data, msg } = await request(
            '/orderOut/buffStore/callNewMat',
            {
               sta1: this.sta1
            },
            'POST'
         )
         if (code === 200) {
            uni.showToast({
               title: '呼叫成功'
            })
         } 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', {
         const { code, data, msg } = await request('/staBind/list', {
               sta: this.barcode
            })
            if (code === 200) {   
@@ -162,21 +187,21 @@
                  that.container = data.barcode                  
                  that.list = data.list
               }
               that.range = data.warehouseAreasList.map(item => ({
            that.range = data.warehouseAreasList.map((item) => ({
                  value: item.id,
                  text: item.name
               }));
            }))
               that.whAreaId = data.area
            } else {
               uni.showToast({
                  title: msg,
                  icon: "none",
               icon: 'none'
               })
            }
         },
         remove(index) {
            this.list.splice(index, 1);
         this.list.splice(index, 1)
         },
         clear() {
            this.list = []
@@ -203,28 +228,23 @@
         async confirm() {            
            if(this.barcode === '' || this.barcode ===null){
               uni.showToast({
                  title: "接驳站点不能为空",
                  icon: "none",
               title: '接驳站点不能为空',
               icon: 'none'
               })
               return ;
            return
            }
            if(this.whAreaId === '' || this.whAreaId ===null){
               uni.showToast({
                  title: "目标库区不能为空",
                  icon: "none",
               title: '目标库区不能为空',
               icon: 'none'
               })
               return ;
            return
            } 
            this.repeatClick = true
            const {
               code,
               data,
               msg
            } = await request('/AGV/task/start',{
         const { code, data, msg } = await request('/AGV/task/start', {
                  sta: this.barcode,
                  area: this.whAreaId
               }
            )
         })
            if (code === 200) {
               uni.showToast({
                  title: '启动成功'
@@ -233,25 +253,25 @@
            } else {
               uni.showToast({
                  title: msg,
                  icon: "none",
               icon: 'none'
               })
            }
            this.repeatClick = false
         },
         
         async getRece() {            
            const {
               code,
               data,
               msg
            } = await request('/areas/receipt', {}, 'get')
         const { code, data, msg } = await request(
            '/areas/receipt',
            {},
            'get'
         )
            if (code === 200) {
               this.range = data.map(item => ({
            this.range = data.map((item) => ({
                  value: item.id,
                  text: item.warehouseId$ + "-- " + item.name
               }));
               text: item.warehouseId$ + '-- ' + item.name
            }))
            }
         },
      }
      }
   }
</script>
@@ -272,7 +292,6 @@
   .text-blue {
      color: #0081ff !important;
   }
   .item {