#
zhou zhou
5 天以前 1c6a21c92ce324333e15944cc581c57e3637b1cf
#
1个文件已修改
260 ■■■■■ 已修改文件
pages/inbound/buffStore.vue 260 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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>
                <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>
            <view class="cu-form-group">
                <view class="title">&nbsp;&nbsp;&nbsp;待入库桶号:</view>
                <input placeholder="" v-model="palletBarcode"></input>
                <text class='cuIcon-search text-blue' @click="search"></text>
                <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" >&nbsp;待入库物料数量:1桶</view>
                <view class="text-grey margin-left">
                    &nbsp;待入库物料数量:1桶
                </view>
            </view>
            <view class="flex solid-bottom padding-sm justify-between">
                <view class="text-grey margin-left" >&nbsp;待入库库区:2#-1F 桶装新料储位</view>
                <view class="text-grey margin-left">
                    &nbsp;待入库库区: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,20 +199,12 @@
            </block>
        </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 {
@@ -154,11 +226,11 @@
                palletStaBarcode: '',
                matNr: '',
                makTx: '',
                transferStationNo: '',
            transferStationNo: ''
            }
        },
        computed: {
            ...mapState('user', ['dynamicFields']),
        ...mapState('user', ['dynamicFields'])
        },
        mounted() {
            this.getRece()
@@ -166,16 +238,17 @@
            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', {
            const { code, data, msg } = await request('/staBind/list', {
                    sta: this.barcode
                })
                if (code === 200) {    
@@ -183,21 +256,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 = []                
@@ -224,16 +297,19 @@
            async queryBagLocItem() {
                if(this.bagStaBarcode === '' || this.bagStaBarcode === null){
                    uni.showToast({
                        title: "新料 (袋装) 接驳站点不能为空!!!",
                        icon: "none",
                    title: '新料 (袋装) 接驳站点不能为空!!!',
                    icon: 'none'
                    })
                    return ;
                return
                }
                this.repeatClick = true
                try{
                    const { code, data, msg } = await request('/inventory/details', {
                const { code, data, msg } = await request(
                    '/inventory/details',
                    {
                        wareHouseAreaId: '2--1-5'    // TODO:固定待后续替换
                    })
                    }
                )
                    if (code === 200) {
                        if(data && data.length > 0){
                            // 展示查询到的数据
@@ -249,7 +325,7 @@
                    } else {
                        uni.showToast({
                            title: msg,
                            icon: 'none',
                        icon: 'none'
                        })
                    }
                } catch (error) {
@@ -273,15 +349,16 @@
                console.log('AGV上料:新料(袋装), 数据:', item)
                if(this.item === '' || this.item === null){
                    uni.showToast({
                        title: "请先选择库位出库",
                        icon: "none",
                    title: '请先选择库位出库',
                    icon: 'none'
                    })
                    return ;
                return
                }
                this.repeatClick = true
                try{
                    const { code, data, msg } = await request('/check/non/order', {
                        transferStationNo: this.transferStationNo || this.bagStaBarcode,
                    transferStationNo:
                        this.transferStationNo || this.bagStaBarcode,
                        locNo: item.locId
                    })
                    if (code === 200) {
@@ -290,8 +367,8 @@
                            icon: 'success'
                        })
                        // 更新物料编码、物料名称
                        this.matNr = item.matNr || '',
                        this.makTx = '待入库物料名称:' + (item.makTx || '')
                    ;(this.matNr = item.matNr || ''),
                        (this.makTx = '待入库物料名称:' + (item.makTx || ''))
                        this.closeModal()
                        // // 从列表中移除该项
                        // const index = this.bagList.findIndex(i => i.palletId === item.palletId)
@@ -324,10 +401,10 @@
                // 使用袋装接驳站点信息调用空托出库接口
                if(this.palletTypeId === '' || this.palletTypeId === null){
                    uni.showToast({
                        title: "请先选择容器类型",
                        icon: "none",
                    title: '请先选择容器类型',
                    icon: 'none'
                    })
                    return ;
                return
                }
                this.repeatClick = true
                try{
@@ -360,10 +437,10 @@
                console.log('满桶入库:新料(袋装), 数据:', item)
                if(this.item === '' || this.item === null){
                    uni.showToast({
                        title: "请先选择库位出库",
                        icon: "none",
                    title: '请先选择库位出库',
                    icon: 'none'
                    })
                    return ;
                return
                }
                this.repeatClick = true
                try{
@@ -381,7 +458,9 @@
                        this.makTx = '&nbsp;待入库物料名称:' + (item.makTx || '')
                                    
                        // 从列表中移除该项
                        const index = this.bagList.findIndex(i => i.palletId === item.palletId)
                    const index = this.bagList.findIndex(
                        (i) => i.palletId === item.palletId
                    )
                        if (index > -1) {
                            this.bagList.splice(index, 1)
                        }
@@ -409,17 +488,10 @@
            async callEmptyPallet() {
                if(this.staBarcode === '' || this.palletBarcode === null){
                    uni.showToast({
                        title: "接驳站点不能为空",
                        icon: "none",
                    title: '接驳站点不能为空',
                    icon: 'none'
                    })
                    return ;
                }
                if(this.palletTypeId === '' || this.palletTypeId === null){
                    uni.showToast({
                        title: "请选择容器类型",
                        icon: "none",
                    })
                    return ;
                return
                }
                this.repeatClick = true
                try{
@@ -427,7 +499,7 @@
                        '/callForEmptyContainers',
                        {
                            staNo: this.palletBarcode,
                            type: this.palletTypeId
                        type: '102'
                        }
                    )
                    if (code === 200) {
@@ -471,28 +543,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: '启动成功'
@@ -501,25 +568,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>
@@ -540,7 +607,6 @@
    .text-blue {
        color: #0081ff !important;
    }
    .item {