schangxiang@126.com
2024-08-31 459a62207a0a8ee406c233f8edf9f7ee88a5bbe2
菜单优化
已添加10个文件
已修改6个文件
2194 ■■■■■ 文件已修改
yiqi_pda/api/api.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yiqi_pda/api/outBound/index.js 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yiqi_pda/config/index.js 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
yiqi_pda/config/modules/ajax.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yiqi_pda/pages.json 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yiqi_pda/pages/home/index.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
yiqi_pda/pages/outBoundNew/index.vue 384 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yiqi_pda/pages/outBoundNew/modules/ScanInputFormItem.vue 224 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yiqi_pda/pages/outBoundNew/modules/ScanInputFormItem_Car.vue 224 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yiqi_pda/pages/outBoundNew/modules/content.vue 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yiqi_pda/pages/outBoundNew/modules/modalPwd.vue 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yiqi_pda/pages/unLine/index.vue 391 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yiqi_pda/pages/unLine/modules/ScanInputFormItem.vue 224 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yiqi_pda/pages/unLine/modules/ScanInputFormItem_Car.vue 224 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yiqi_pda/pages/unLine/modules/content.vue 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yiqi_pda/pages/unLine/modules/modalPwd.vue 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
yiqi_pda/api/api.js
@@ -1,7 +1,7 @@
// åŒæ—¶å‘送异步请求的次数,防止一次点击有多次请求
let ajaxTime = 0;
//export const baseUrl = 'http://localhost:7788'
export const baseUrl = 'http://10.135.75.70:7788' //生产用
export const baseUrl = 'http://localhost:7788'
//export const baseUrl = 'http://10.135.75.70:7788' //生产用
//export const baseUrl = 'http://192.168.216.203:7788' //测试用
// å…¬å…±çš„request方法
yiqi_pda/api/outBound/index.js
@@ -18,6 +18,23 @@
  })
}
// ä¸‹çº¿æ‰§è¡Œ /api/pdaservice/unLineWorkPiece
export function unLineWorkPiece(data) {
  return request({
    url:  `/api/pdaservice/unLineWorkPiece`,
    method: 'post',
    data
  })
}
// å‡ºåº“执行 /api/pdaservice/outStoreWorkPiece
export function outStoreWorkPiece(data) {
  return request({
    url:  `/api/pdaservice/outStoreWorkPiece`,
    method: 'post',
    data
  })
}
// å‡ºåº“统计 /api/pdaservice/getOutBoundWorkPieceInfoCount
export function getOutBoundWorkPieceInfoCount(data) {
yiqi_pda/config/index.js
@@ -17,6 +17,8 @@
        retrospect: "/pages/retrospect/index",
        shift:"/pages/shift/index",
        production:"/pages/production/index",
        outBound:'/pages/outBound/index'
        outBound:'/pages/outBound/index',
        unLine:'/pages/unLine/index',
        outBoundNew:'/pages/outBoundNew/index'
    }
}
yiqi_pda/config/modules/ajax.js
@@ -1,9 +1,9 @@
export default {
    errMsg:'网络错误!',
    host:{  //接口调用的域名设置
         'default':'http://10.135.75.70:7788',//生产用
        //'default':'http://10.135.75.70:7788',//生产用
        //'default':'http://192.168.216.203:7788', //生产环境地址
        //'default':'http://localhost:7788',
        'default':'http://localhost:7788',
        'mock':'http://localhost:3012'
    },
    block:{
yiqi_pda/pages.json
@@ -80,6 +80,12 @@
        },
        {
            "path": "pages/outBound/index"
        },
        {
            "path": "pages/unLine/index"
        },
        {
            "path": "pages/outBoundNew/index"
        }
    ],
    "globalStyle": {
yiqi_pda/pages/home/index.vue
@@ -58,7 +58,9 @@
                        {name:'工件信息单个修改',icon:'icon-worker',pathName:'unbind',color:'#1e90ff'},
                        {name:'工件质量信息批量修改',icon:'icon-worker',pathName:'unbindAll',color:'#1e90ff'},
                        {name:'工件信息追溯',icon:'icon-notice',pathName:'retrospect',color:'#1e90ff'},
                        {name:'工件出库执行',icon:'icon-notice',pathName:'outBound',color:'#1e90ff'}
                        {name:'工件出库执行',icon:'icon-notice',pathName:'outBound',color:'#1e90ff'},
                        {name:'工件下线(新)',icon:'icon-notice',pathName:'unLine',color:'#1e90ff'},
                        {name:'工件出库(新)',icon:'icon-notice',pathName:'outBoundNew',color:'#1e90ff'}
                    ]
                },
                {
yiqi_pda/pages/outBoundNew/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,384 @@
<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 />
        <scan-input-form-item-car  v-model="CarNo" class="forma-item" :label="baseTitile_Car"
                :msg-type="msgType" />
            <view class="with-action-user-row-page-content">
                <Content @deleteData="deleteData" :workPieceData="workPieceData" />
            </view>
            <modalPwd @reflesh="reflesh" ref="pwdRef" />
        </view>
        <template v-slot:footer>
            <view class="bottom-btns-row">
                <view class="btn-frame right-btn-frame">
                    <u-button  type="primary" text="确认出库"
                        @click="outBoundConfirm"></u-button>
                </view>
            </view>
        </template>
    </default-header-page-layout>
</template>
<script>
    import DefaultHeaderPageLayout from '@/components/DefaultHeaderPageLayout.vue'
    import ActionUserRow from '@/components/ActionUserRow.vue'
    import ScanInputFormItem from './modules/ScanInputFormItem.vue'
        import ScanInputFormItemCar from './modules/ScanInputFormItem_Car.vue'
    import Content from './modules/content.vue'
    import modalPwd from './modules/modalPwd.vue'
    import Vue from 'vue'
    import {
        parseDic,
        $alert,
        $successInfo
    } from '@/static/js/utils/index.js'
    import {
        getWorkPieceByOP80NewCode,
        outBoundWorkPiece,
        getOutBoundWorkPieceInfoCount
    } from '@/api/outBound/index.js'
    import {
        listbycode
    } from '@/api/common/index.js'
    export default {
        name: 'baseInPage',
        components: {
            DefaultHeaderPageLayout,
            ActionUserRow,
            ScanInputFormItem,
            ScanInputFormItemCar,
            Content,
            modalPwd
        },
        data() {
            return {
                barHeight: '',
                ckNumToday: "0", //今天总出库数
                baseTitile_Car: '扫描小车码',
                title: '',
                CarNo:'',
                pageBodyHeight: 0,
                initInterVal: null,
                myInterval: null,
                msg: '',
                msgType: 'error',
                OP80NewCode: '',
                workPieceData: [],
                workPieceStatus: [],
                inputFocus: true,
                // codeLength:1
            }
        },
        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) {
                //debugger
                if (OP80NewCode.length==0) {
                    this.initFocus(100);
                    // uni.showToast({
                    //     title: '工件码或成品码长度不正确',
                    //     icon: 'error',
                    //     duration: 2000,
                    //     mask: true
                    // });
                    return;
                }
                this.inputFocus = false
                const param = {
                    OP80NewCode: OP80NewCode
                }
                try {
                    let data={};
                    data.addTime = new Date();
                    data.workPieceID=OP80NewCode;
                    data.oP80NewCode=OP80NewCode;
                    if (!this.workPieceData.some(item => item.workPieceID == data.workPieceID)) {
                        data.addTime = new Date();
                        this.workPieceData.push(data)
                    }
                    //顺序调转,排序
                    this.workPieceData.sort((a, b) => b.addTime - a.addTime);
                    //console.log(this.workPieceData,'dsts');
                    // setTimeout(()=>{
                    //     this.OP80NewCode = '' ;//每次刷完就清空输入框 ã€Editby shaocx,2024-06-12】
                    //     this.inputFocus=true
                    // },100)
                } catch (e) {
                    //debugger
                    //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(() => {
                    this.OP80NewCode = ''; //每次刷完就清空输入框 ã€Editby shaocx,2024-06-12】
                    this.inputFocus = true
                }, num)
            },
            // èŽ·å–æ‰«ç é•¿åº¦
            // async listbycode(){
            //     try{
            //         let {data}=await listbycode({code:'outbound_code_length'})
            //         this.codeLength=data.length>0?Number.parseInt(data[0].label):1
            //     }catch(e){
            //         //TODO handle the exception
            //         console.log(e);
            //     }
            // },
            onClearContainter() {
                this.OP80NewCode = ''
            },
            deleteData(opt) {
                this.workPieceData = this.workPieceData.filter(item => item.workPieceID != opt.workPieceID)
                this.setMsg();
            },
            reflesh() {
                this.OP80NewCode = ''
                this.workPieceData = []
                setTimeout(() => {
                    this._getOutBoundWorkPieceInfoCount();
                    this.setMsg();
                }, 1000)
            },
            outBoundConfirm() {
                this.$refs.pwdRef.showModal(this.workPieceData,this.CarNo)
                /*
                // å­˜åœ¨éžæˆå“
                const flag = this.workPieceData.some(item => item.workPieceState != 10)
                if (flag) {
                    uni.showModal({
                        title: '提示',
                        content: '当前工件存在非成品,确定强制出库吗?',
                        success: (value) => {
                            const {
                                confirm,
                                cancel
                            } = value
                            if (confirm) {
                                this.$refs.pwdRef.showModal(this.workPieceData)
                            }
                        }
                    })
                } else {
                    this.$refs.pwdRef.showModal(this.workPieceData)
                }
                //*/
            },
            /* é¡µé¢åˆå§‹åŒ–获取页面body高度的定时器 */
            startInitInterval(callback) {
                this.initInterVal = setInterval(() => {
                    //console.log('bbb')
                    if (this.pageBodyHeight) {
                        this.clearInitInterval()
                        callback && callback()
                    } else {
                        this.pageBodyHeight = this.$refs.page.getBodyHeight()
                    }
                }, 200)
            },
            /* æ¸…除定时器 */
            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>
<style scoped lang="scss">
    .bottom-btns-row {
        display: flex;
        padding: 10rpx 0;
        background-color: #fff;
        .btn-frame {
            box-sizing: border-box;
        }
        .left-btn-frame {
            width: 30%;
            padding-left: 20rpx;
            padding-right: 8rpx;
        }
        .right-btn-frame {
            flex: 1;
            padding-right: 20rpx;
            padding-left: 8rpx;
        }
        .u-button {
            border: 2px solid #F08202;
        }
    }
    .forma-item {
        margin-bottom: 24rpx;
    }
    .material-item-group {
        background-color: $uni-bg-color;
        padding-top: 10rpx;
        .material-list-item {
            border-bottom: 2rpx solid $uni-border-color;
            padding-bottom: 10rpx;
            padding-left: 60rpx;
            margin-bottom: 10rpx;
            position: relative;
            &:last-child {
                border-bottom: 0;
            }
            .item-row {
                display: flex;
                &>.label {
                    flex-shrink: 0;
                    color: $u-tips-color;
                    width: 144rpx;
                }
                &>.content {
                    flex-grow: 1;
                    color: $u-content-color;
                    uni-input {
                        font: inherit;
                        color: $u-primary;
                        text-decoration: underline;
                    }
                }
            }
            .badge-box {
                position: absolute;
                top: 8rpx;
                left: 8rpx;
                z-index: 1;
            }
            .close-btn {
                $closeBtnSize: 70rpx;
                width: $closeBtnSize;
                height: $closeBtnSize;
                z-index: 1;
                position: absolute;
                top: 0rpx;
                right: 8rpx;
                background-color: $u-error;
                opacity: 0.6;
                border-radius: 25rpx;
                .icon-layer {
                    position: absolute;
                    width: 100%;
                    height: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    z-index: 2;
                }
            }
        }
    }
</style>
yiqi_pda/pages/outBoundNew/modules/ScanInputFormItem.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,224 @@
<template>
    <view class="scan-input-form-item-compontent">
        <view class="p-form-label" v-if="label">{{label}}:</view>
        <view class="input-row">
            <view class="mask" @tap.stop="" v-if="disabled"></view>
            <view class="input-view">
                <u-input ref="uinput" :focus="inputFocus" :clearable="clearable" border="none" :type="type"
                    :placeholder="placeholder" v-model.trim="innerValue" @clear="onClear" @blur="onBlur"
                    @change="onChange"
                    @confirm="onConfirm" />
            </view>
            <!-- <view class="scan-view">
                <view @tap.stop="onScan"><u-icon name="scan" color="#F18201" :size="32"></u-icon></view>
            </view>
            <view class="btn-view" v-if="hasSearch">
                <view class="search-btn" @tap.stop="onSearch">搜</view>
            </view> -->
        </view>
        <view class="msg-row" v-if="msg" :class="[msgType==='info'?'info-type':'']">{{msg}}</view>
    </view>
</template>
<script>
    export default {
        name: 'ScanInputFormItemCompontent',
        // emits: ['input', 'search', 'clear', 'blur', 'confirm'],
        props: {
            type: {
                type: String,
                default: 'text'
            },
            label: {
                type: String,
                default: ''
            },
            placeholder: {
                type: String,
                default: '请输入...'
            },
            msg: {
                type: String,
                default: ''
            },
            msgType: {
                type: String,
                default: 'error'
            },
            value: {
                type: [String, Number, null],
                default: ''
            },
            hasSearch: {
                type: Boolean,
                default: true
            },
            disabled: {
                type: Boolean,
                default: false
            },
            clearable: {
                type: Boolean,
                default: true
            },
            inputFocus: {
                type: Boolean,
                default: true
            },
            // codeLength:{
            //     type: Number,
            //     default: 1
            // }
        },
        data() {
            return {
                innerValue: '',
                confirmType:'handle'
            }
        },
        watch: {
            value(newVal, oldVal) {
                if (newVal !== this.innerValue) {
                    this.innerValue = newVal
                }
            },
            innerValue(newVal, oldVal) {
                if (newVal !== this.value) {
                    this.$emit('input', newVal)
                }
                if(newVal&&this.confirmType=='auto') {
                    this.$emit('search', newVal)
                    this.confirmType='handle'
                }
            }
        },
        methods: {
            onScan() {
                uni.scanCode({
                    success: function(res) {
                        this.innerValue = res.result;
                    },
                    fail: function() {
                        console.log('scanCode fail')
                    }
                })
            },
            onSearch() {
                this.$emit('search', this.innerValue)
            },
            onClear() {
                this.innerValue = null;
                this.$emit('clear')
            },
            onBlur() {
                this.$emit('blur', this.innerValue)
            },
            onChange(val) {
                //debugger
                //alert(val);
                this.$emit('search', val)
            },
            onConfirm(val) {
                //debugger
                /*
                if(val!=this.innerValue) {
                    this.confirmType='auto'
                }
                if(val) {
                    this.$emit('search', val)
                }
                //*/
            },
        },
        created() {
            this.innerValue = this.value
        },
    }
</script>
<style scoped lang="scss">
    .scan-input-form-item-compontent {
        width: 100%;
        .p-form-label {
            font-size: 32rpx;
            color: $u-tips-color;
            padding-bottom: 12rpx;
            padding-left: 20rpx;
        }
        .input-row {
            width: 100%;
            height: 90rpx;
            overflow: hidden;
            background-color: $uni-bg-color;
            display: flex;
            align-items: center;
            position: relative;
            .scan-view,
            .btn-view {
                flex-shrink: 0;
            }
            .scan-view {
                display: flex;
                align-items: center;
                justify-content: center;
                padding-right: 10rpx;
            }
            .input-view {
                flex-grow: 1;
                padding-left: 20rpx;
            }
            .btn-view {
                width: 70rpx;
                height: 100%;
                padding: 20rpx;
                padding-left: 0rpx;
                box-sizing: border-box;
                .search-btn {
                    height: 100%;
                    width: 100%;
                    border-radius: 8rpx;
                    background: linear-gradient(157.342820970935deg, rgba(194, 128, 255, 1) -20%, rgba(194, 128, 255, 1) -19%, rgba(132, 0, 255, 1) 119%);
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    color: $uni-bg-color;
                    font-size: 26rpx;
                }
            }
            &>.mask {
                position: absolute;
                left: 0;
                top: 0;
                width: 100%;
                height: 100%;
                z-index: 100;
                background-color: #000;
                opacity: 0.25;
            }
        }
        .msg-row {
            padding: 6rpx 20rpx 0 20rpx;
            line-height: 1.3;
            font-size: 24rpx;
            color: $u-error;
            &.info-type {
                color: $color-blue;
            }
        }
    }
</style>
yiqi_pda/pages/outBoundNew/modules/ScanInputFormItem_Car.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,224 @@
<template>
    <view class="scan-input-form-item-compontent">
        <view class="p-form-label" v-if="label">{{label}}:</view>
        <view class="input-row">
            <view class="mask" @tap.stop="" v-if="disabled"></view>
            <view class="input-view">
                <u-input ref="uinput" :focus="inputFocus" :clearable="clearable" border="none" :type="type"
                    :placeholder="placeholder" v-model.trim="innerValue" @clear="onClear" @blur="onBlur"
                    @change="onChange"
                    @confirm="onConfirm" />
            </view>
            <!-- <view class="scan-view">
                <view @tap.stop="onScan"><u-icon name="scan" color="#F18201" :size="32"></u-icon></view>
            </view>
            <view class="btn-view" v-if="hasSearch">
                <view class="search-btn" @tap.stop="onSearch">搜</view>
            </view> -->
        </view>
        <view class="msg-row" v-if="msg" :class="[msgType==='info'?'info-type':'']">{{msg}}</view>
    </view>
</template>
<script>
    export default {
        name: 'ScanInputFormItemCompontent',
        // emits: ['input', 'search', 'clear', 'blur', 'confirm'],
        props: {
            type: {
                type: String,
                default: 'text'
            },
            label: {
                type: String,
                default: ''
            },
            placeholder: {
                type: String,
                default: '请输入...'
            },
            msg: {
                type: String,
                default: ''
            },
            msgType: {
                type: String,
                default: 'error'
            },
            value: {
                type: [String, Number, null],
                default: ''
            },
            hasSearch: {
                type: Boolean,
                default: true
            },
            disabled: {
                type: Boolean,
                default: false
            },
            clearable: {
                type: Boolean,
                default: true
            },
            inputFocus: {
                type: Boolean,
                default: true
            },
            // codeLength:{
            //     type: Number,
            //     default: 1
            // }
        },
        data() {
            return {
                innerValue: '',
                confirmType:'handle'
            }
        },
        watch: {
            value(newVal, oldVal) {
                if (newVal !== this.innerValue) {
                    this.innerValue = newVal
                }
            },
            innerValue(newVal, oldVal) {
                if (newVal !== this.value) {
                    this.$emit('input', newVal)
                }
                if(newVal&&this.confirmType=='auto') {
                    this.$emit('search', newVal)
                    this.confirmType='handle'
                }
            }
        },
        methods: {
            onScan() {
                uni.scanCode({
                    success: function(res) {
                        this.innerValue = res.result;
                    },
                    fail: function() {
                        console.log('scanCode fail')
                    }
                })
            },
            onSearch() {
                this.$emit('search', this.innerValue)
            },
            onClear() {
                this.innerValue = null;
                this.$emit('clear')
            },
            onBlur() {
                this.$emit('blur', this.innerValue)
            },
            onChange(val) {
                //debugger
                //alert(val);
                this.$emit('search', val)
            },
            onConfirm(val) {
                //debugger
                /*
                if(val!=this.innerValue) {
                    this.confirmType='auto'
                }
                if(val) {
                    this.$emit('search', val)
                }
                //*/
            },
        },
        created() {
            this.innerValue = this.value
        },
    }
</script>
<style scoped lang="scss">
    .scan-input-form-item-compontent {
        width: 100%;
        .p-form-label {
            font-size: 32rpx;
            color: $u-tips-color;
            padding-bottom: 12rpx;
            padding-left: 20rpx;
        }
        .input-row {
            width: 100%;
            height: 90rpx;
            overflow: hidden;
            background-color: $uni-bg-color;
            display: flex;
            align-items: center;
            position: relative;
            .scan-view,
            .btn-view {
                flex-shrink: 0;
            }
            .scan-view {
                display: flex;
                align-items: center;
                justify-content: center;
                padding-right: 10rpx;
            }
            .input-view {
                flex-grow: 1;
                padding-left: 20rpx;
            }
            .btn-view {
                width: 70rpx;
                height: 100%;
                padding: 20rpx;
                padding-left: 0rpx;
                box-sizing: border-box;
                .search-btn {
                    height: 100%;
                    width: 100%;
                    border-radius: 8rpx;
                    background: linear-gradient(157.342820970935deg, rgba(194, 128, 255, 1) -20%, rgba(194, 128, 255, 1) -19%, rgba(132, 0, 255, 1) 119%);
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    color: $uni-bg-color;
                    font-size: 26rpx;
                }
            }
            &>.mask {
                position: absolute;
                left: 0;
                top: 0;
                width: 100%;
                height: 100%;
                z-index: 100;
                background-color: #000;
                opacity: 0.25;
            }
        }
        .msg-row {
            padding: 6rpx 20rpx 0 20rpx;
            line-height: 1.3;
            font-size: 24rpx;
            color: $u-error;
            &.info-type {
                color: $color-blue;
            }
        }
    }
</style>
yiqi_pda/pages/outBoundNew/modules/content.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,128 @@
<template>
    <u-swipe-action>
        <u-swipe-action-item v-for="(item,index) in workPieceData" :key="index" :options="options"
            :name="index" @click="actionClick" style="margin-bottom: 10rpx;background-color: #fff;">
        <view class="content" >
            <view class="content_flex">
                <view class="flex_index">{{workPieceData.length-index}}</view>
                <view class="flex_code">成品码: {{item.oP80NewCode}}</view>
                <!-- <view class="flex_status">{{item.qualityStateName}}</view> -->
            </view>
            <!-- <view class="content_flex">
                <view class="flex_color" style="width: 100%;">工件号: {{item.workPieceID}}</view>
            </view>
            <view class="content_flex">
                <view class="flex_color" style="width: 100%;">工件状态: {{item.workPieceStateName}}</view>
            </view>
            <view class="content_flex">
                <view class="flex_color" style="width: 100%;">当前工序: {{item.workingProcedureCurrent}}</view>
            </view>
            <view class="content_flex">
                <view class="flex_color" style="width: 100%;">设备编号: {{item.equipmentID}}</view>
            </view> -->
        </view>
    </u-swipe-action-item>
    </u-swipe-action>
</template>
<script>
    export default {
        props: {
            workPieceData: {
                type: Array,
                default: () => []
            }
        },
        data() {
            return {
                options: [{
                    text: "移除",
                    style: {
                        background: '#F08202'
                    }
                }],
            }
        },
        methods:{
            actionClick(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) {
                        }
                    })
                });
            }
        }
    }
</script>
<style lang="scss" scoped>
    .content {
        background-color: #fff;
        width: 100%;
        box-sizing: border-box;
        border: 1px solid #fff;
        padding: 15rpx;
        margin-bottom: 10rpx;
        .content_flex {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            margin-bottom: 5rpx;
            .flex_index {
                width: 50rpx;
                height: 50rpx;
                background: $color-common;
                color: #fff;
                font-size: 30rpx;
                line-height: 50rpx;
                text-align: center;
                border-radius: 50%;
                margin-right: 15rpx;
            }
            .flex_code {
                font-size: 32rpx;
                color: $color-common;
                width: 75%;
            }
            .flex_status {
                width: 90rpx;
                text-align: center;
                padding: 10rpx;
                background: $color-common;
                color: #fff;
                font-weight: 550;
                align-self: flex-end;
            }
            .flex_color {
                font-size: 32rpx;
                color: #000;
                width: 75%;
            }
            .card-action {
                width: 100%;
                display: flex;
                justify-content: flex-end;
                align-items: center;
            }
        }
    }
</style>
yiqi_pda/pages/outBoundNew/modules/modalPwd.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,114 @@
<template>
    <u-modal :show="show" title="出库确认" :closeOnClickOverlay="true" :showCancelButton="true" @cancel="handlerCancel"
        @confirm="handlerConfirm" @close="handlerCancel">
        <u-form labelPosition="left" labelWidth="100rpx" :model="form" :rules="rules" ref="uForm">
            <u-form-item required label="密码" prop="pwd">
                <u-input v-model="form.pwd" type="password" placeholder="请输入密码" style="width: 450rpx;"></u-input>
            </u-form-item>
        </u-form>
        <!-- <view class="status_flex">
            <u-input v-model="pwd" type="password" placeholder="请输入密码" style="width: 450rpx;"></u-input>
        </view> -->
    </u-modal>
</template>
<script>
    import {
        $alert
    } from '@/static/js/utils/index.js'
    import {
        outStoreWorkPiece
    } from '@/api/outBound/index.js'
    export default {
        emits: ['update'],
        data() {
            return {
                show: false,
                CarNo:'',
                workPieceData:[],
                form: {
                    pwd: ''
                },
                rules: {
                    pwd: {
                        type: 'string',
                        required: true,
                        message: '请输入密码',
                        trigger: ['blur', 'change']
                    }
                }
            }
        },
        onReady() {
            this.$refs.uForm.setRules(this.rules)
        },
        methods: {
            showModal(workPieceData,CarNo){
                this.show=true
                this.CarNo=CarNo
                this.workPieceData=workPieceData
            },
            handlerCancel() {
                this.form =  {
                    pwd: '',
                }
                this.show = false
            },
            // é€‰ä¸­çš„状态传递给父组件
            handlerConfirm() {
                console.log(111);
                this.$refs.uForm.validate().then(res => {
                    const params = {
                        password: this.form.pwd,
                        CarNo:this.CarNo,
                        workPieceInfoLst:this.workPieceData
                    }
                    console.log(params,'params');
                    outStoreWorkPiece(params).then(res => {
                        uni.showToast({
                            title: '出库成功'
                        })
                        this.$emit('reflesh')
                        this.handlerCancel()
                    })
                }).catch(errors => {
                    console.log(errors,'22');
                })
            }
        }
    }
</script>
<style lang="scss" scoped>
    .status_flex {
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        .flex_item {
            width: 450rpx;
            height: 70rpx;
            text-align: center;
            line-height: 70rpx;
            border: 1px solid $color-common;
            color: $color-common;
            font-size: 32rpx;
            font-weight: 550;
            background: #fff;
            margin-bottom: 30rpx;
        }
        .active_item {
            background: $color-common;
            color: #fff;
        }
    }
    ::v-deep .u-transition {
      z-index: 99 !important;
    }
</style>
yiqi_pda/pages/unLine/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,391 @@
<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 />
            <scan-input-form-item-car  v-model="CarNo" class="forma-item" :label="baseTitile_Car"
                    :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>
            <modalPwd @reflesh="reflesh" ref="pwdRef" />
        </view>
        <template v-slot:footer>
            <view class="bottom-btns-row">
                <view class="btn-frame right-btn-frame">
                    <u-button :disabled="workPieceData.length<1" type="primary" text="确认下线"
                        @click="outBoundConfirm"></u-button>
                </view>
            </view>
        </template>
    </default-header-page-layout>
</template>
<script>
    import DefaultHeaderPageLayout from '@/components/DefaultHeaderPageLayout.vue'
    import ActionUserRow from '@/components/ActionUserRow.vue'
    import ScanInputFormItem from './modules/ScanInputFormItem.vue'
    import ScanInputFormItemCar from './modules/ScanInputFormItem_Car.vue'
    import Content from './modules/content.vue'
    import modalPwd from './modules/modalPwd.vue'
    import Vue from 'vue'
    import {
        parseDic,
        $alert,
        $successInfo
    } from '@/static/js/utils/index.js'
    import {
        getWorkPieceByOP80NewCode,
        outBoundWorkPiece,
        getOutBoundWorkPieceInfoCount
    } from '@/api/outBound/index.js'
    import {
        listbycode
    } from '@/api/common/index.js'
    export default {
        name: 'baseInPage',
        components: {
            DefaultHeaderPageLayout,
            ActionUserRow,
            ScanInputFormItem,
            ScanInputFormItemCar,
            Content,
            modalPwd
        },
        data() {
            return {
                barHeight: '',
                ckNumToday: "0", //今天总出库数
                baseTitile: '扫描成品码',
                baseTitile_Car: '扫描小车码',
                title: '',
                pageBodyHeight: 0,
                initInterVal: null,
                myInterval: null,
                msg: '',
                msgType: 'error',
                OP80NewCode: '',
                CarNo:'',
                workPieceData: [],
                workPieceStatus: [],
                inputFocus: true,
                // codeLength:1
            }
        },
        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) {
                //debugger
                if (OP80NewCode.length != 21) {
                    this.initFocus(100);
                    // uni.showToast({
                    //     title: '工件码或成品码长度不正确',
                    //     icon: 'error',
                    //     duration: 2000,
                    //     mask: true
                    // });
                    return;
                }
                this.inputFocus = false
                const param = {
                    OP80NewCode: OP80NewCode
                }
                try {
                    let data={};
                    data.addTime = new Date();
                    data.workPieceID=OP80NewCode;
                    data.oP80NewCode=OP80NewCode;
                    if (!this.workPieceData.some(item => item.workPieceID == data.workPieceID)) {
                        data.addTime = new Date();
                        this.workPieceData.push(data)
                    }
                    //顺序调转,排序
                    this.workPieceData.sort((a, b) => b.addTime - a.addTime);
                    this.OP80NewCode = ''; //每次刷完就清空输入框 ã€Editby shaocx,2024-06-12】
                    this.initFocus(100);
                    //console.log(this.workPieceData,'dsts');
                    // setTimeout(()=>{
                    //     this.OP80NewCode = '' ;//每次刷完就清空输入框 ã€Editby shaocx,2024-06-12】
                    //     this.inputFocus=true
                    // },100)
                } catch (e) {
                    //debugger
                    this.initFocus(100);
                    //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(() => {
                    this.OP80NewCode = ''; //每次刷完就清空输入框 ã€Editby shaocx,2024-06-12】
                    this.inputFocus = true
                }, num)
            },
            // èŽ·å–æ‰«ç é•¿åº¦
            // async listbycode(){
            //     try{
            //         let {data}=await listbycode({code:'outbound_code_length'})
            //         this.codeLength=data.length>0?Number.parseInt(data[0].label):1
            //     }catch(e){
            //         //TODO handle the exception
            //         console.log(e);
            //     }
            // },
            onClearContainter() {
                this.OP80NewCode = ''
            },
            deleteData(opt) {
                this.workPieceData = this.workPieceData.filter(item => item.workPieceID != opt.workPieceID)
                this.setMsg();
            },
            reflesh() {
                this.OP80NewCode = ''
                this.workPieceData = []
                setTimeout(() => {
                    this._getOutBoundWorkPieceInfoCount();
                    this.setMsg();
                }, 1000)
            },
            outBoundConfirm() {
                this.$refs.pwdRef.showModal(this.workPieceData,this.CarNo)
                /*
                // å­˜åœ¨éžæˆå“
                const flag = this.workPieceData.some(item => item.workPieceState != 10)
                if (flag) {
                    uni.showModal({
                        title: '提示',
                        content: '当前工件存在非成品,确定强制出库吗?',
                        success: (value) => {
                            const {
                                confirm,
                                cancel
                            } = value
                            if (confirm) {
                                this.$refs.pwdRef.showModal(this.workPieceData)
                            }
                        }
                    })
                } else {
                    this.$refs.pwdRef.showModal(this.workPieceData)
                }
                //*/
            },
            /* é¡µé¢åˆå§‹åŒ–获取页面body高度的定时器 */
            startInitInterval(callback) {
                this.initInterVal = setInterval(() => {
                    //console.log('bbb')
                    if (this.pageBodyHeight) {
                        this.clearInitInterval()
                        callback && callback()
                    } else {
                        this.pageBodyHeight = this.$refs.page.getBodyHeight()
                    }
                }, 200)
            },
            /* æ¸…除定时器 */
            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>
<style scoped lang="scss">
    .bottom-btns-row {
        display: flex;
        padding: 10rpx 0;
        background-color: #fff;
        .btn-frame {
            box-sizing: border-box;
        }
        .left-btn-frame {
            width: 30%;
            padding-left: 20rpx;
            padding-right: 8rpx;
        }
        .right-btn-frame {
            flex: 1;
            padding-right: 20rpx;
            padding-left: 8rpx;
        }
        .u-button {
            border: 2px solid #F08202;
        }
    }
    .forma-item {
        margin-bottom: 24rpx;
    }
    .material-item-group {
        background-color: $uni-bg-color;
        padding-top: 10rpx;
        .material-list-item {
            border-bottom: 2rpx solid $uni-border-color;
            padding-bottom: 10rpx;
            padding-left: 60rpx;
            margin-bottom: 10rpx;
            position: relative;
            &:last-child {
                border-bottom: 0;
            }
            .item-row {
                display: flex;
                &>.label {
                    flex-shrink: 0;
                    color: $u-tips-color;
                    width: 144rpx;
                }
                &>.content {
                    flex-grow: 1;
                    color: $u-content-color;
                    uni-input {
                        font: inherit;
                        color: $u-primary;
                        text-decoration: underline;
                    }
                }
            }
            .badge-box {
                position: absolute;
                top: 8rpx;
                left: 8rpx;
                z-index: 1;
            }
            .close-btn {
                $closeBtnSize: 70rpx;
                width: $closeBtnSize;
                height: $closeBtnSize;
                z-index: 1;
                position: absolute;
                top: 0rpx;
                right: 8rpx;
                background-color: $u-error;
                opacity: 0.6;
                border-radius: 25rpx;
                .icon-layer {
                    position: absolute;
                    width: 100%;
                    height: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    z-index: 2;
                }
            }
        }
    }
</style>
yiqi_pda/pages/unLine/modules/ScanInputFormItem.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,224 @@
<template>
    <view class="scan-input-form-item-compontent">
        <view class="p-form-label" v-if="label">{{label}}:</view>
        <view class="input-row">
            <view class="mask" @tap.stop="" v-if="disabled"></view>
            <view class="input-view">
                <u-input ref="uinput" :focus="inputFocus" :clearable="clearable" border="none" :type="type"
                    :placeholder="placeholder" v-model.trim="innerValue" @clear="onClear" @blur="onBlur"
                    @change="onChange"
                    @confirm="onConfirm" />
            </view>
            <!-- <view class="scan-view">
                <view @tap.stop="onScan"><u-icon name="scan" color="#F18201" :size="32"></u-icon></view>
            </view>
            <view class="btn-view" v-if="hasSearch">
                <view class="search-btn" @tap.stop="onSearch">搜</view>
            </view> -->
        </view>
        <view class="msg-row" v-if="msg" :class="[msgType==='info'?'info-type':'']">{{msg}}</view>
    </view>
</template>
<script>
    export default {
        name: 'ScanInputFormItemCompontent',
        // emits: ['input', 'search', 'clear', 'blur', 'confirm'],
        props: {
            type: {
                type: String,
                default: 'text'
            },
            label: {
                type: String,
                default: ''
            },
            placeholder: {
                type: String,
                default: '请输入...'
            },
            msg: {
                type: String,
                default: ''
            },
            msgType: {
                type: String,
                default: 'error'
            },
            value: {
                type: [String, Number, null],
                default: ''
            },
            hasSearch: {
                type: Boolean,
                default: true
            },
            disabled: {
                type: Boolean,
                default: false
            },
            clearable: {
                type: Boolean,
                default: true
            },
            inputFocus: {
                type: Boolean,
                default: true
            },
            // codeLength:{
            //     type: Number,
            //     default: 1
            // }
        },
        data() {
            return {
                innerValue: '',
                confirmType:'handle'
            }
        },
        watch: {
            value(newVal, oldVal) {
                if (newVal !== this.innerValue) {
                    this.innerValue = newVal
                }
            },
            innerValue(newVal, oldVal) {
                if (newVal !== this.value) {
                    this.$emit('input', newVal)
                }
                if(newVal&&this.confirmType=='auto') {
                    this.$emit('search', newVal)
                    this.confirmType='handle'
                }
            }
        },
        methods: {
            onScan() {
                uni.scanCode({
                    success: function(res) {
                        this.innerValue = res.result;
                    },
                    fail: function() {
                        console.log('scanCode fail')
                    }
                })
            },
            onSearch() {
                this.$emit('search', this.innerValue)
            },
            onClear() {
                this.innerValue = null;
                this.$emit('clear')
            },
            onBlur() {
                this.$emit('blur', this.innerValue)
            },
            onChange(val) {
                //debugger
                //alert(val);
                this.$emit('search', val)
            },
            onConfirm(val) {
                //debugger
                /*
                if(val!=this.innerValue) {
                    this.confirmType='auto'
                }
                if(val) {
                    this.$emit('search', val)
                }
                //*/
            },
        },
        created() {
            this.innerValue = this.value
        },
    }
</script>
<style scoped lang="scss">
    .scan-input-form-item-compontent {
        width: 100%;
        .p-form-label {
            font-size: 32rpx;
            color: $u-tips-color;
            padding-bottom: 12rpx;
            padding-left: 20rpx;
        }
        .input-row {
            width: 100%;
            height: 90rpx;
            overflow: hidden;
            background-color: $uni-bg-color;
            display: flex;
            align-items: center;
            position: relative;
            .scan-view,
            .btn-view {
                flex-shrink: 0;
            }
            .scan-view {
                display: flex;
                align-items: center;
                justify-content: center;
                padding-right: 10rpx;
            }
            .input-view {
                flex-grow: 1;
                padding-left: 20rpx;
            }
            .btn-view {
                width: 70rpx;
                height: 100%;
                padding: 20rpx;
                padding-left: 0rpx;
                box-sizing: border-box;
                .search-btn {
                    height: 100%;
                    width: 100%;
                    border-radius: 8rpx;
                    background: linear-gradient(157.342820970935deg, rgba(194, 128, 255, 1) -20%, rgba(194, 128, 255, 1) -19%, rgba(132, 0, 255, 1) 119%);
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    color: $uni-bg-color;
                    font-size: 26rpx;
                }
            }
            &>.mask {
                position: absolute;
                left: 0;
                top: 0;
                width: 100%;
                height: 100%;
                z-index: 100;
                background-color: #000;
                opacity: 0.25;
            }
        }
        .msg-row {
            padding: 6rpx 20rpx 0 20rpx;
            line-height: 1.3;
            font-size: 24rpx;
            color: $u-error;
            &.info-type {
                color: $color-blue;
            }
        }
    }
</style>
yiqi_pda/pages/unLine/modules/ScanInputFormItem_Car.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,224 @@
<template>
    <view class="scan-input-form-item-compontent">
        <view class="p-form-label" v-if="label">{{label}}:</view>
        <view class="input-row">
            <view class="mask" @tap.stop="" v-if="disabled"></view>
            <view class="input-view">
                <u-input ref="uinput" :focus="inputFocus" :clearable="clearable" border="none" :type="type"
                    :placeholder="placeholder" v-model.trim="innerValue" @clear="onClear" @blur="onBlur"
                    @change="onChange"
                    @confirm="onConfirm" />
            </view>
            <!-- <view class="scan-view">
                <view @tap.stop="onScan"><u-icon name="scan" color="#F18201" :size="32"></u-icon></view>
            </view>
            <view class="btn-view" v-if="hasSearch">
                <view class="search-btn" @tap.stop="onSearch">搜</view>
            </view> -->
        </view>
        <view class="msg-row" v-if="msg" :class="[msgType==='info'?'info-type':'']">{{msg}}</view>
    </view>
</template>
<script>
    export default {
        name: 'ScanInputFormItemCompontent',
        // emits: ['input', 'search', 'clear', 'blur', 'confirm'],
        props: {
            type: {
                type: String,
                default: 'text'
            },
            label: {
                type: String,
                default: ''
            },
            placeholder: {
                type: String,
                default: '请输入...'
            },
            msg: {
                type: String,
                default: ''
            },
            msgType: {
                type: String,
                default: 'error'
            },
            value: {
                type: [String, Number, null],
                default: ''
            },
            hasSearch: {
                type: Boolean,
                default: true
            },
            disabled: {
                type: Boolean,
                default: false
            },
            clearable: {
                type: Boolean,
                default: true
            },
            inputFocus: {
                type: Boolean,
                default: true
            },
            // codeLength:{
            //     type: Number,
            //     default: 1
            // }
        },
        data() {
            return {
                innerValue: '',
                confirmType:'handle'
            }
        },
        watch: {
            value(newVal, oldVal) {
                if (newVal !== this.innerValue) {
                    this.innerValue = newVal
                }
            },
            innerValue(newVal, oldVal) {
                if (newVal !== this.value) {
                    this.$emit('input', newVal)
                }
                if(newVal&&this.confirmType=='auto') {
                    this.$emit('search', newVal)
                    this.confirmType='handle'
                }
            }
        },
        methods: {
            onScan() {
                uni.scanCode({
                    success: function(res) {
                        this.innerValue = res.result;
                    },
                    fail: function() {
                        console.log('scanCode fail')
                    }
                })
            },
            onSearch() {
                this.$emit('search', this.innerValue)
            },
            onClear() {
                this.innerValue = null;
                this.$emit('clear')
            },
            onBlur() {
                this.$emit('blur', this.innerValue)
            },
            onChange(val) {
                //debugger
                //alert(val);
                this.$emit('search', val)
            },
            onConfirm(val) {
                //debugger
                /*
                if(val!=this.innerValue) {
                    this.confirmType='auto'
                }
                if(val) {
                    this.$emit('search', val)
                }
                //*/
            },
        },
        created() {
            this.innerValue = this.value
        },
    }
</script>
<style scoped lang="scss">
    .scan-input-form-item-compontent {
        width: 100%;
        .p-form-label {
            font-size: 32rpx;
            color: $u-tips-color;
            padding-bottom: 12rpx;
            padding-left: 20rpx;
        }
        .input-row {
            width: 100%;
            height: 90rpx;
            overflow: hidden;
            background-color: $uni-bg-color;
            display: flex;
            align-items: center;
            position: relative;
            .scan-view,
            .btn-view {
                flex-shrink: 0;
            }
            .scan-view {
                display: flex;
                align-items: center;
                justify-content: center;
                padding-right: 10rpx;
            }
            .input-view {
                flex-grow: 1;
                padding-left: 20rpx;
            }
            .btn-view {
                width: 70rpx;
                height: 100%;
                padding: 20rpx;
                padding-left: 0rpx;
                box-sizing: border-box;
                .search-btn {
                    height: 100%;
                    width: 100%;
                    border-radius: 8rpx;
                    background: linear-gradient(157.342820970935deg, rgba(194, 128, 255, 1) -20%, rgba(194, 128, 255, 1) -19%, rgba(132, 0, 255, 1) 119%);
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    color: $uni-bg-color;
                    font-size: 26rpx;
                }
            }
            &>.mask {
                position: absolute;
                left: 0;
                top: 0;
                width: 100%;
                height: 100%;
                z-index: 100;
                background-color: #000;
                opacity: 0.25;
            }
        }
        .msg-row {
            padding: 6rpx 20rpx 0 20rpx;
            line-height: 1.3;
            font-size: 24rpx;
            color: $u-error;
            &.info-type {
                color: $color-blue;
            }
        }
    }
</style>
yiqi_pda/pages/unLine/modules/content.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,128 @@
<template>
    <u-swipe-action>
        <u-swipe-action-item v-for="(item,index) in workPieceData" :key="index" :options="options"
            :name="index" @click="actionClick" style="margin-bottom: 10rpx;background-color: #fff;">
        <view class="content" >
            <view class="content_flex">
                <view class="flex_index">{{workPieceData.length-index}}</view>
                <view class="flex_code">成品码: {{item.oP80NewCode}}</view>
                <!-- <view class="flex_status">{{item.qualityStateName}}</view> -->
            </view>
            <!-- <view class="content_flex">
                <view class="flex_color" style="width: 100%;">工件号: {{item.workPieceID}}</view>
            </view>
            <view class="content_flex">
                <view class="flex_color" style="width: 100%;">工件状态: {{item.workPieceStateName}}</view>
            </view>
            <view class="content_flex">
                <view class="flex_color" style="width: 100%;">当前工序: {{item.workingProcedureCurrent}}</view>
            </view>
            <view class="content_flex">
                <view class="flex_color" style="width: 100%;">设备编号: {{item.equipmentID}}</view>
            </view> -->
        </view>
    </u-swipe-action-item>
    </u-swipe-action>
</template>
<script>
    export default {
        props: {
            workPieceData: {
                type: Array,
                default: () => []
            }
        },
        data() {
            return {
                options: [{
                    text: "移除",
                    style: {
                        background: '#F08202'
                    }
                }],
            }
        },
        methods:{
            actionClick(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) {
                        }
                    })
                });
            }
        }
    }
</script>
<style lang="scss" scoped>
    .content {
        background-color: #fff;
        width: 100%;
        box-sizing: border-box;
        border: 1px solid #fff;
        padding: 15rpx;
        margin-bottom: 10rpx;
        .content_flex {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            margin-bottom: 5rpx;
            .flex_index {
                width: 50rpx;
                height: 50rpx;
                background: $color-common;
                color: #fff;
                font-size: 30rpx;
                line-height: 50rpx;
                text-align: center;
                border-radius: 50%;
                margin-right: 15rpx;
            }
            .flex_code {
                font-size: 32rpx;
                color: $color-common;
                width: 75%;
            }
            .flex_status {
                width: 90rpx;
                text-align: center;
                padding: 10rpx;
                background: $color-common;
                color: #fff;
                font-weight: 550;
                align-self: flex-end;
            }
            .flex_color {
                font-size: 32rpx;
                color: #000;
                width: 75%;
            }
            .card-action {
                width: 100%;
                display: flex;
                justify-content: flex-end;
                align-items: center;
            }
        }
    }
</style>
yiqi_pda/pages/unLine/modules/modalPwd.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,114 @@
<template>
    <u-modal :show="show" title="出库确认" :closeOnClickOverlay="true" :showCancelButton="true" @cancel="handlerCancel"
        @confirm="handlerConfirm" @close="handlerCancel">
        <u-form labelPosition="left" labelWidth="100rpx" :model="form" :rules="rules" ref="uForm">
            <u-form-item required label="密码" prop="pwd">
                <u-input v-model="form.pwd" type="password" placeholder="请输入密码" style="width: 450rpx;"></u-input>
            </u-form-item>
        </u-form>
        <!-- <view class="status_flex">
            <u-input v-model="pwd" type="password" placeholder="请输入密码" style="width: 450rpx;"></u-input>
        </view> -->
    </u-modal>
</template>
<script>
    import {
        $alert
    } from '@/static/js/utils/index.js'
    import {
        unLineWorkPiece
    } from '@/api/outBound/index.js'
    export default {
        emits: ['update'],
        data() {
            return {
                show: false,
                workPieceData:[],
                CarNo:'',
                form: {
                    pwd: ''
                },
                rules: {
                    pwd: {
                        type: 'string',
                        required: true,
                        message: '请输入密码',
                        trigger: ['blur', 'change']
                    }
                }
            }
        },
        onReady() {
            this.$refs.uForm.setRules(this.rules)
        },
        methods: {
            showModal(workPieceData,CarNo){
                this.show=true
                this.workPieceData=workPieceData
                this.CarNo=CarNo
            },
            handlerCancel() {
                this.form =  {
                    pwd: '',
                }
                this.show = false
            },
            // é€‰ä¸­çš„状态传递给父组件
            handlerConfirm() {
                console.log(111);
                this.$refs.uForm.validate().then(res => {
                    const params = {
                        password: this.form.pwd,
                        CarNo:this.CarNo,
                        workPieceInfoLst:this.workPieceData
                    }
                    console.log(params,'params');
                    unLineWorkPiece(params).then(res => {
                        uni.showToast({
                            title: '下线成功'
                        })
                        this.$emit('reflesh')
                        this.handlerCancel()
                    })
                }).catch(errors => {
                    console.log(errors,'22');
                })
            }
        }
    }
</script>
<style lang="scss" scoped>
    .status_flex {
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        .flex_item {
            width: 450rpx;
            height: 70rpx;
            text-align: center;
            line-height: 70rpx;
            border: 1px solid $color-common;
            color: $color-common;
            font-size: 32rpx;
            font-weight: 550;
            background: #fff;
            margin-bottom: 30rpx;
        }
        .active_item {
            background: $color-common;
            color: #fff;
        }
    }
    ::v-deep .u-transition {
      z-index: 99 !important;
    }
</style>