schangxiang@126.com
2024-06-19 f2d05ad289280fec72e58372723db68c6d72a866
PDA问题- 出库执行
已修改3个文件
111 ■■■■■ 文件已修改
yiqi_pda/api/outBound/index.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yiqi_pda/pages/outBound/index.vue 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yiqi_pda/pages/outBound/modules/content.vue 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yiqi_pda/api/outBound/index.js
@@ -18,3 +18,12 @@
  })
}
// 出库统计 /api/pdaservice/getOutBoundWorkPieceInfoCount
export function getOutBoundWorkPieceInfoCount(data) {
  return request({
    url:  `/api/pdaservice/getOutBoundWorkPieceInfoCount`,
    method: 'post',
    data
  })
}
yiqi_pda/pages/outBound/index.vue
@@ -1,10 +1,12 @@
<template>
    <default-header-page-layout ref="page" title="出库执行">
        <view class="page-frame with-action-user-row" :style="{height:pageBodyHeight+'px'}" v-if="pageBodyHeight">
            <action-user-row />
            <view class="with-action-user-row-page-content">
                <scan-input-form-item  :inputFocus="inputFocus" v-model="OP80NewCode" class="forma-item" label="OP80成品码/工件二维码"  :msg="msg" :msg-type="msgType"
            <scan-input-form-item  :inputFocus="inputFocus" v-model="OP80NewCode" class="forma-item" :label="baseTitile"  :msg="msg" :msg-type="msgType"
                    @search="onSearchContainter" @clear="onClearContainter" />
            <view class="with-action-user-row-page-content"  >
            
            <Content @deleteData="deleteData" :workPieceData="workPieceData" />
            </view>
@@ -26,6 +28,7 @@
    import ScanInputFormItem from './modules/ScanInputFormItem.vue'
    import Content from './modules/content.vue'
    import modalPwd from './modules/modalPwd.vue'
    import Vue from 'vue'
    import {
        parseDic,
        $alert,
@@ -33,7 +36,8 @@
    } from '@/static/js/utils/index.js'
    import {
        getWorkPieceByOP80NewCode,
        outBoundWorkPiece
        outBoundWorkPiece,
        getOutBoundWorkPieceInfoCount
    } from '@/api/outBound/index.js'
    import {listbycode} from '@/api/common/index.js'
    export default {
@@ -47,8 +51,13 @@
        },
        data() {
            return {
                barHeight: '',
                ckNumToday:"0",//今天总出库数
                baseTitile:'扫描成品码/工件二维码',//扫描成品码/工件二维码
                title:'',
                pageBodyHeight: 0,
                initInterVal: null,
                myInterval: null,
                msg: '',
                msgType: 'error',
                OP80NewCode: '',
@@ -59,8 +68,21 @@
            }
        },
        onLoad() {
            var _this=this;
            _this._getOutBoundWorkPieceInfoCount();
            this.myInterval=setInterval(function(){ _this._getOutBoundWorkPieceInfoCount();}, 1000*10);
            //this.myInterval=setInterval(this.myFun(), 3000);
        },
        methods: {
            // 获取工件信息
            async _getOutBoundWorkPieceInfoCount(OP80NewCode) {
                try{
                    let {data}=await getOutBoundWorkPieceInfoCount(null)
                    this.ckNumToday =data;
                }catch(e){
                }
                this.setMsg();
            },
            // 获取工件信息
            async onSearchContainter(OP80NewCode) {
                this.inputFocus=false
@@ -84,6 +106,11 @@
                    //TODO handle the exception
                    console.log(e);
                }
                //this.msg = " 扫码数:"+this.workPieceData.length+"    今日出库数:";
                this.setMsg();
            },
            setMsg(){
                this.msg = " 扫码数:"+this.workPieceData.length+"    今日出库数:"+this.ckNumToday;
            },
            initFocus(num){
                setTimeout(()=>{
@@ -107,6 +134,7 @@
            },
            deleteData(opt){
                this.workPieceData=this.workPieceData.filter(item=>item.workPieceID!=opt.workPieceID)
                this.setMsg();
            },
            reflesh(){
                this.OP80NewCode = ''
@@ -134,6 +162,7 @@
            /* 页面初始化获取页面body高度的定时器 */
            startInitInterval(callback) {
                this.initInterVal = setInterval(() => {
                    //console.log('bbb')
                    if (this.pageBodyHeight) {
                        this.clearInitInterval()
                        callback && callback()
@@ -145,25 +174,71 @@
            /* 清除定时器 */
            clearInitInterval() {
                try {
                    //alert('执行');
                    clearInterval(this.initInterVal)
                    this.initInterVal = null
                } catch (e) {
                    //TODO handle the exception
                }
            },
            clearInitInterval2() {
                try {
                    clearInterval(this.myInterval)
                    this.myInterval = null
                } catch (e) {
                    //TODO handle the exception
                }
            },
            comfirmUpdate() {
                this.$refs.pwdRef.showModal(this.barDetail);
            },
            myFun(){
                console.log('aaaa')
            }
        },
        onReady() {
            this.setMsg();
            this.startInitInterval(() => {
                /* 页面初始化后需要执行的代码在这边调用 */
                // this.listbycode()
            })
        },
        mounted() {
            // 设置fixed定位
            //this.barHeight = Vue.prototype.CustomBar || 45
            this.barHeight =  Vue.prototype.CustomBar
        },
        onUnload() {
            //alert(11); 页面离开时
            this.clearInitInterval()
            this.clearInitInterval2();
        },
        //监听原生返回键
        onBackPress(e) {
            // 此处一定要return为true,否则页面不会返回到指定路径
            if(1!=1){
                return false //可返回
            }else{
                uni.showModal({
                title: '提示',
                content: '是否确认返回?',
                showCancel: true,
                cancelColor: '#333333',
                success: (res => {
                        if (res.confirm) {
                            uni.redirectTo({
                                url: '/pages/home/index'
                            })
                        } else if (res.cancel) {
        }
                    })
                });
                return true
            }
        },
    }
</script>
yiqi_pda/pages/outBound/modules/content.vue
@@ -9,7 +9,7 @@
                <view class="flex_status">{{item.qualityStateName}}</view>
            </view>
            <view class="content_flex">
                <view class="flex_color" style="width: 100%;">工件Id: {{item.workPieceID}}</view>
                <view class="flex_color" style="width: 100%;">工件号: {{item.workPieceID}}</view>
                <!-- <view class="flex_color" style="text-align: right;">当前工序: {{item.workingProcedureCurrent}}</view> -->
            </view>
            <view class="content_flex">
@@ -19,7 +19,7 @@
                <view class="flex_color" style="width: 100%;">当前工序: {{item.workingProcedureCurrent}}</view>
            </view>
            <view class="content_flex">
                <view class="flex_color" style="width: 100%;">设备Id: {{item.equipmentID}}</view>
                <view class="flex_color" style="width: 100%;">设备编号: {{item.equipmentID}}</view>
            </view>
        </view>
    </u-swipe-action-item>
@@ -37,7 +37,7 @@
        data() {
            return {
                options: [{
                    text: "删除",
                    text: "移除",
                    style: {
                        background: '#F08202'
                    }
@@ -46,8 +46,21 @@
        },
        methods:{
            actionClick(opt){
                console.log('删除',opt);
                uni.showModal({
                title: '提示',
                content: '是否确认移除工件号"'+this.workPieceData[opt.name].workPieceID+'"?',
                showCancel: true,
                cancelColor: '#333333',
                success: (res => {
                        if (res.confirm) {
                            console.log('移除',opt);
                this.$emit('deleteData',this.workPieceData[opt.name])
                        } else if (res.cancel) {
                        }
                    })
                });
            }
        }
    }