yyb
11 小时以前 25508db9e43fe793d7a34fa2d8ca1d7244d887a6
PDA核磅录入除提交外其余地方联调结果
已修改7个文件
已添加1个文件
4409 ■■■■■ 文件已修改
common/http.api.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wareHouse/inventory/index.vue 710 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wareHouse/nuclearScale/createwriteoffform.vue 563 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wareHouse/nuclearScale/index.scss 243 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wareHouse/nuclearScale/index.vue 452 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wareHouse/nuclearScale/nuclearScaleList.vue 798 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wareHouse/nuclearScale/nuclearscalerecord.vue 1261 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wareHouse/nuclearScale/saveForm.vue 378 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common/http.api.js
@@ -547,6 +547,10 @@
        NuclearScaleEntry: {
            // èŽ·å–å®¢æˆ·åç§°
            selClient: (params = {}) => vm.$u.get('/mes/weighingVerification/selClient'),
            // åˆ›å»ºæ ¸ç£…单提交
            createMain: (params = {}) => vm.$u.post('/mes/weighingVerification/createMain', params),
            // æ ¸ç£…单号
            getWeighingOrder: (params = {}) => vm.$u.get('/mes/weighingVerification/pageVerificationMain', params),
        }
    };
pages/wareHouse/inventory/index.vue
@@ -32,7 +32,8 @@
                        <view class="item-one item-two" @click="openPN()">
                            <text>{{ registerInfo.value6 == '' ? "点击输入" : registerInfo.value6 }}</text>
                        </view>
                        <u-icon name="arrow-right" color="#687792" size="28" v-show="registerInfo.value6 == ''"></u-icon>
                        <u-icon name="arrow-right" color="#687792" size="28"
                            v-show="registerInfo.value6 == ''"></u-icon>
                    </view>
                </view>
                <view class="packing-registration-param-item param-extra">
@@ -40,8 +41,10 @@
                        <text class="item-one">批次号</text>
                    </view>
                    <view class="packing-registration-param-item-right" @click="openBatch()">
                        <text class="item-one item-two">{{ registerInfo.value3 == '' ? "点击输入" : registerInfo.value3 }}</text>
                        <u-icon name="arrow-right" color="#687792" size="28" v-show="registerInfo.value3 == ''"></u-icon>
                        <text
                            class="item-one item-two">{{ registerInfo.value3 == '' ? "点击输入" : registerInfo.value3 }}</text>
                        <u-icon name="arrow-right" color="#687792" size="28"
                            v-show="registerInfo.value3 == ''"></u-icon>
                    </view>
                </view>
                <view class="packing-registration-param-item param-extra">
@@ -52,7 +55,8 @@
                        <view class="item-one item-two">
                            <text>{{ registerInfo.value4 == '' ? "点击输入" : registerInfo.value4 }}</text>
                        </view>
                        <u-icon name="arrow-right" color="#687792" size="28" v-show="registerInfo.value4 == ''"></u-icon>
                        <u-icon name="arrow-right" color="#687792" size="28"
                            v-show="registerInfo.value4 == ''"></u-icon>
                    </view>
                </view>
                <view class="packing-registration-param-item param-extra">
@@ -63,7 +67,8 @@
                        <view class="item-one item-two">
                            <text>{{ registerInfo.value5 == '' ? "点击输入" : registerInfo.value5 }}</text>
                        </view>
                        <u-icon name="arrow-right" color="#687792" size="28" v-show="registerInfo.value4 == ''"></u-icon>
                        <u-icon name="arrow-right" color="#687792" size="28"
                            v-show="registerInfo.value4 == ''"></u-icon>
                    </view>
                </view>
                <view class="packing-registration-param-item param-extra">
@@ -139,414 +144,415 @@
            </modalBg>
            <!-- ç›˜ç‚¹æ•°é‡ -->
            <modalBg ref="openPhysicalInventory" :confirm="confirmPhysicalInventory">
                <u-field v-model="registerInfo.value5" label="盘点数量:" label-width="140" placeholder="请输入" :border-bottom="false">
                <u-field v-model="registerInfo.value5" label="盘点数量:" label-width="140" placeholder="请输入"
                    :border-bottom="false">
                </u-field>
            </modalBg>
        </view>
    </view>
</template>
<script>
import modalBg from '@/components/modal/modal-bg.vue'
import scan from "@/components/scan/scan.vue";
import content_bg from '@/static/custom/packing/backBg.png'
export default {
    components: {
        scan,
        modalBg
    },
    data() {
        return {
            background: {
                backgroundImage: `url(${content_bg})`,
                backgroundAttachment: 'fixed',
                backgroundSize: '100% auto',
                backgroundRepeat: 'no-repeat',
            },
            labelStyle: {
                fontSize: '32rpx',
                whiteSpace: 'nowrap'
            },
            registerInfo: {
                value1: '',
                value2: '',
                value3: '',
                value4: '',
                value5: '',
                value6: ''
            },
            hasScanSnList: [{
                value0: '11111111111111111111111',
                value1: '111',
                value2: '111',
                value3: '111',
            },
            {
                value0: '111',
                value1: '111',
                value2: '111',
                value3: '111',
            },
            {
                value0: '111',
                value1: '111',
                value2: '111',
                value3: '111',
            },
            {
                value0: '111',
                value1: '111',
                value2: '111',
                value3: '111',
            },
            ],
            delContent: null,
            staffList: [],
        };
    },
    onLoad(option) { },
    onShow() {
    import modalBg from '@/components/modal/modal-bg.vue'
    import scan from "@/components/scan/scan.vue";
    import content_bg from '@/static/custom/packing/backBg.png'
    export default {
        components: {
            scan,
            modalBg
        },
        data() {
            return {
                background: {
                    backgroundImage: `url(${content_bg})`,
                    backgroundAttachment: 'fixed',
                    backgroundSize: '100% auto',
                    backgroundRepeat: 'no-repeat',
                },
                labelStyle: {
                    fontSize: '32rpx',
                    whiteSpace: 'nowrap'
                },
                registerInfo: {
                    value1: '',
                    value2: '',
                    value3: '',
                    value4: '',
                    value5: '',
                    value6: ''
                },
                hasScanSnList: [{
                        value0: '11111111111111111111111',
                        value1: '111',
                        value2: '111',
                        value3: '111',
                    },
                    {
                        value0: '111',
                        value1: '111',
                        value2: '111',
                        value3: '111',
                    },
                    {
                        value0: '111',
                        value1: '111',
                        value2: '111',
                        value3: '111',
                    },
                    {
                        value0: '111',
                        value1: '111',
                        value2: '111',
                        value3: '111',
                    },
                ],
                delContent: null,
                staffList: [],
            };
        },
        onLoad(option) {},
        onShow() {
        let that = this
            let that = this
        uni.$off('scan') // æ¯æ¬¡è¿›æ¥å…ˆ ç§»é™¤å…¨å±€è‡ªå®šä¹‰äº‹ä»¶ç›‘听器
        uni.$on('scan', function (data) {
            console.log('onscan');
            //扫码成功后的回调,你可以写自己的逻辑代码在这里
            console.log('扫码结果:', data.code);
            that.scanHandle(data.code)
            that.$forceUpdate();
            uni.$off('scan') // æ¯æ¬¡è¿›æ¥å…ˆ ç§»é™¤å…¨å±€è‡ªå®šä¹‰äº‹ä»¶ç›‘听器
            uni.$on('scan', function(data) {
                console.log('onscan');
                //扫码成功后的回调,你可以写自己的逻辑代码在这里
                console.log('扫码结果:', data.code);
                that.scanHandle(data.code)
                that.$forceUpdate();
        })
    },
    onNavigationBarButtonTap() {
        this.goScan()
    },
    onReady() { },
    methods: {
        //零件号
        openPN() {
            this.$refs.openPN.open();
        },
        // å¼¹æ¡†ä¿å­˜
        confirmPN() {
            console.log('保存', this.registerInfo.value6);
            // è¯·æ±‚接口,根据工单号查询其他信息并赋值
        },
        //批次号
        openBatch() {
            this.$refs.openBatch.open();
        },
        // å¼¹æ¡†ä¿å­˜
        confirmBatch() {
            console.log('保存', this.registerInfo.value3);
            // è¯·æ±‚接口,根据工单号查询其他信息并赋值
        },
        //库位号
        openLocation() {
            this.$refs.openLocation.open();
        },
        // å¼¹æ¡†ä¿å­˜
        confirmLocation() {
            console.log('保存', this.registerInfo.value4);
            // è¯·æ±‚接口,根据工单号查询其他信息并赋值
        },
        //盘点数量
        openPhysicalInventory() {
            this.$refs.openPhysicalInventory.open();
        },
        // å¼¹æ¡†ä¿å­˜
        confirmPhysicalInventory() {
            console.log('保存', this.registerInfo.value5);
            // è¯·æ±‚接口,根据工单号查询其他信息并赋值
        },
        setNo(val) {
            console.log('11111', val)
            this.registerInfo.value1 = val.value1
            this.registerInfo.value2 = val.value2
        },
        //盘点报告号
        seachPersonnelNo() {
            console.log('11111')
            uni.navigateTo({
                url: '/pages/wareHouse/inventory/orderList'
            })
        },
        goScan() {
            uni.scanCode({
                scanType: ['qrCode'],
                success: res => {
                    try {
                        console.log('扫码结果:', res);
                        this.scanHandle(res.result)
                    } catch (e) { }
                }
            });
        onNavigationBarButtonTap() {
            this.goScan()
        },
        scanHandle(scanresult) {
            scanresult = scanresult.replace(/[\r\n]/g, "")
            if (scanresult.indexOf('{') > -1) {
                //二维码
                const result = JSON.parse(scanresult)
                //增加SN校验
                if (result.sn_no && result.sn_no != null && result.sn_no != '') {
                    if (this.hasScanSnList.length > 0) {
                        let hasScanSnIndex = this.hasScanSnList.indexOf(result.sn_no)
                        if (hasScanSnIndex < 0) {
        onReady() {},
        methods: {
            //零件号
            openPN() {
                this.$refs.openPN.open();
            },
            // å¼¹æ¡†ä¿å­˜
            confirmPN() {
                console.log('保存', this.registerInfo.value6);
                // è¯·æ±‚接口,根据工单号查询其他信息并赋值
            },
            //批次号
            openBatch() {
                this.$refs.openBatch.open();
            },
            // å¼¹æ¡†ä¿å­˜
            confirmBatch() {
                console.log('保存', this.registerInfo.value3);
                // è¯·æ±‚接口,根据工单号查询其他信息并赋值
            },
            //库位号
            openLocation() {
                this.$refs.openLocation.open();
            },
            // å¼¹æ¡†ä¿å­˜
            confirmLocation() {
                console.log('保存', this.registerInfo.value4);
                // è¯·æ±‚接口,根据工单号查询其他信息并赋值
            },
            //盘点数量
            openPhysicalInventory() {
                this.$refs.openPhysicalInventory.open();
            },
            // å¼¹æ¡†ä¿å­˜
            confirmPhysicalInventory() {
                console.log('保存', this.registerInfo.value5);
                // è¯·æ±‚接口,根据工单号查询其他信息并赋值
            },
            setNo(val) {
                console.log('11111', val)
                this.registerInfo.value1 = val.value1
                this.registerInfo.value2 = val.value2
            },
            //盘点报告号
            seachPersonnelNo() {
                console.log('11111')
                uni.navigateTo({
                    url: '/pages/wareHouse/inventory/orderList'
                })
            },
            goScan() {
                uni.scanCode({
                    scanType: ['qrCode'],
                    success: res => {
                        try {
                            console.log('扫码结果:', res);
                            this.scanHandle(res.result)
                        } catch (e) {}
                    }
                });
            },
            scanHandle(scanresult) {
                scanresult = scanresult.replace(/[\r\n]/g, "")
                if (scanresult.indexOf('{') > -1) {
                    //二维码
                    const result = JSON.parse(scanresult)
                    //增加SN校验
                    if (result.sn_no && result.sn_no != null && result.sn_no != '') {
                        if (this.hasScanSnList.length > 0) {
                            let hasScanSnIndex = this.hasScanSnList.indexOf(result.sn_no)
                            if (hasScanSnIndex < 0) {
                                this.hasScanSnList.push(result.sn_no)
                            } else {
                                this.$u.toast('请勿重复扫描')
                            }
                        } else {
                            this.hasScanSnList.push(result.sn_no)
                        }
                    }
                } else {
                    //增加SN校验
                    if (this.hasScanSnList.length > 0) {
                        let hasScanSnIndex = this.hasScanSnList.indexOf(scanresult)
                        if (hasScanSnIndex < 0) {
                            this.hasScanSnList.push(scanresult)
                        } else {
                            this.$u.toast('请勿重复扫描')
                        }
                    } else {
                        this.hasScanSnList.push(result.sn_no)
                    }
                }
            } else {
                //增加SN校验
                if (this.hasScanSnList.length > 0) {
                    let hasScanSnIndex = this.hasScanSnList.indexOf(scanresult)
                    if (hasScanSnIndex < 0) {
                        this.hasScanSnList.push(scanresult)
                    } else {
                        this.$u.toast('请勿重复扫描')
                    }
                } else {
                    this.hasScanSnList.push(scanresult)
                }
            }
        },
        goSubmit() {
            // if (this.registerInfo.shiftId == null || this.registerInfo.shiftId == '') {
            //     this.$u.toast('请选择班次')
            //     return
            // }
            // if (this.registerInfo.value3 == null || this.registerInfo.value3 == '') {
            //     this.$u.toast('请选择日期')
            //     return
            // }
            // if (this.registerInfo.locNo == null || this.registerInfo.locNo == '') {
            //     this.$u.toast('请选择包装库位')
            //     return
            // }
            // if (this.hasScanSnList.length == 0) {
            //     this.$u.toast('无待提交的SN号明细')
            //     return
            // }
            // let registrList = []
            // this.staffList = []
            // this.staffNameList.forEach((item) => {
            //     this.staffList.push({
            //         staffId: item.id
            //     })
            // })
            // this.hasScanSnList.forEach((item) => {
            //     registrList.push({
            //         shiftId: this.registerInfo.shiftId,
            //         value3: this.registerInfo.value3,
            //         locNo: this.registerInfo.locNo,
            //         partBatchNo: item,
            //         staffList: this.staffList
            //     })
            // })
            // this.$u.api.pigxPacking.addPackageRegister(registrList).then(res => {
            //     let resData = res.data
            //     this.hasScanSnList = []
            //     this.$u.toast('提交成功')
            // }).catch((e) => {
            // })
            },
            goSubmit() {
                // if (this.registerInfo.shiftId == null || this.registerInfo.shiftId == '') {
                //     this.$u.toast('请选择班次')
                //     return
                // }
                // if (this.registerInfo.value3 == null || this.registerInfo.value3 == '') {
                //     this.$u.toast('请选择日期')
                //     return
                // }
                // if (this.registerInfo.locNo == null || this.registerInfo.locNo == '') {
                //     this.$u.toast('请选择包装库位')
                //     return
                // }
                // if (this.hasScanSnList.length == 0) {
                //     this.$u.toast('无待提交的SN号明细')
                //     return
                // }
                // let registrList = []
                // this.staffList = []
                // this.staffNameList.forEach((item) => {
                //     this.staffList.push({
                //         staffId: item.id
                //     })
                // })
                // this.hasScanSnList.forEach((item) => {
                //     registrList.push({
                //         shiftId: this.registerInfo.shiftId,
                //         value3: this.registerInfo.value3,
                //         locNo: this.registerInfo.locNo,
                //         partBatchNo: item,
                //         staffList: this.staffList
                //     })
                // })
                // this.$u.api.pigxPacking.addPackageRegister(registrList).then(res => {
                //     let resData = res.data
                //     this.hasScanSnList = []
                //     this.$u.toast('提交成功')
                // }).catch((e) => {
                // })
        },
    }
};
            },
        }
    };
</script>
<style lang="scss" scoped>
.packing-registration-bg {
    background-color: #F6F9FF;
    background-image: url('~@/static/custom/packing/backBg.png');
    padding: 0 20rpx;
    background-attachment: fixed;
    background-size: 100% auto;
    background-repeat: no-repeat;
    position: fixed;
    top: 0;
    bottom: 0;
    width: 100%;
    z-index: -1;
}
.packing-registration-param {
    padding: 40rpx 30rpx 10rpx 30rpx;
    .packing-registration-param-title {
        display: flex;
        flex-direction: row;
        align-items: center;
        margin-bottom: 30rpx;
        .title-label {
            margin-left: 14rpx;
            font-size: 34rpx;
            font-weight: bold;
            color: #283E65;
        }
    .packing-registration-bg {
        background-color: #F6F9FF;
        background-image: url('~@/static/custom/packing/backBg.png');
        padding: 0 20rpx;
        background-attachment: fixed;
        background-size: 100% auto;
        background-repeat: no-repeat;
        position: fixed;
        top: 0;
        bottom: 0;
        width: 100%;
        z-index: -1;
    }
    .packing-registration-param-view {
        height: 615rpx;
        background-color: #fff;
        border-radius: 10rpx;
        padding: 0rpx 23rpx;
        margin-bottom: 30rpx;
    .packing-registration-param {
        padding: 40rpx 30rpx 10rpx 30rpx;
        .packing-registration-param-item {
            height: 90rpx;
            border: 1px solid #ADC8E4;
            line-height: 90rpx;
        .packing-registration-param-title {
            display: flex;
            justify-content: space-between;
            border: none;
            flex-direction: row;
            align-items: center;
            margin-bottom: 30rpx;
            .packing-registration-param-item-left {
                .item-one {
                    font-size: 30rpx;
                    color: #666666;
                }
            .title-label {
                margin-left: 14rpx;
                font-size: 34rpx;
                font-weight: bold;
                color: #283E65;
            }
        }
            .packing-registration-param-item-right {
        .packing-registration-param-view {
            height: 615rpx;
            background-color: #fff;
            border-radius: 10rpx;
            padding: 0rpx 23rpx;
            margin-bottom: 30rpx;
            .packing-registration-param-item {
                height: 90rpx;
                border: 1px solid #ADC8E4;
                line-height: 90rpx;
                display: flex;
                justify-content: space-between;
                border: none;
                .item-one {
                    font-size: 30rpx;
                    color: #333333;
                    margin-right: 6rpx;
                .packing-registration-param-item-left {
                    .item-one {
                        font-size: 30rpx;
                        color: #666666;
                    }
                }
                .item-two {
                    font-size: 30rpx;
                    color: #A6B4CC;
                    margin-right: 6rpx;
                }
                .packing-registration-param-item-right {
                    display: flex;
                    justify-content: space-between;
                .item-three {
                    font-size: 30rpx;
                    color: #214DED;
                    margin-right: 6rpx;
                    .item-one {
                        font-size: 30rpx;
                        color: #333333;
                        margin-right: 6rpx;
                    }
                    .item-two {
                        font-size: 30rpx;
                        color: #A6B4CC;
                        margin-right: 6rpx;
                    }
                    .item-three {
                        font-size: 30rpx;
                        color: #214DED;
                        margin-right: 6rpx;
                    }
                }
            }
        }
        .param-extra {
            border-bottom: 1px solid #EDEDED;
            .param-extra {
                border-bottom: 1px solid #EDEDED;
            }
        }
    }
}
.wrap .packing-registration-scroll-list {
    height: calc(100vh - var(--window-top) - var(--window-bottom) - 930rpx);
    width: 100%;
}
.packing-registration-scroll-list-group {
    ::v-deep .u-cell-item-box {
        background-color: rgba(250, 252, 255, 0.36) !important;
        padding: 0rpx 30rpx;
    .wrap .packing-registration-scroll-list {
        height: calc(100vh - var(--window-top) - var(--window-bottom) - 930rpx);
        width: 100%;
    }
    .content {
        font-size: 12px;
        background-color: #ffffff;
        box-sizing: border-box;
        border-radius: 10rpx;
        margin: 0rpx 0rpx 16rpx;
        padding: 20rpx 8rpx;
        box-shadow: none;
        display: flex;
        align-items: center;
    .packing-registration-scroll-list-group {
        ::v-deep .u-cell-item-box {
            background-color: rgba(250, 252, 255, 0.36) !important;
            padding: 0rpx 30rpx;
        }
        .content-header {
            width: 40rpx;
            height: 90rpx;
        .content {
            font-size: 12px;
            background-color: #ffffff;
            box-sizing: border-box;
            border-radius: 10rpx;
            margin: 0rpx 0rpx 16rpx;
            padding: 20rpx 8rpx;
            box-shadow: none;
            display: flex;
            align-items: center;
            .content-header-icon {
                background-image: url("~@/static/custom/moveWareHouse/header_icon.png");
                background-size: 100% auto;
                background-repeat: no-repeat;
                height: 28rpx;
                width: 28rpx;
            }
            .content-header-title {
                margin-left: 11rpx;
                font-size: 26rpx;
                font-weight: bold;
                color: #626369;
            }
        }
        .content-body {
            flex: 1;
            background-color: #ffffff;
            border-radius: 10rpx;
            padding: 0rpx 23rpx;
            .row-list {
                height: 60rpx;
            .content-header {
                width: 40rpx;
                height: 90rpx;
                display: flex;
                flex-direction: row;
                padding: 0px;
                align-items: center;
            }
            .row-list ._label {
                display: flex;
                flex: 0.8;
                color: #909399;
                align-items: center;
                ._label-name {
                .content-header-icon {
                    background-image: url("~@/static/custom/moveWareHouse/header_icon.png");
                    background-size: 100% auto;
                    background-repeat: no-repeat;
                    height: 28rpx;
                    width: 28rpx;
                }
                .content-header-title {
                    margin-left: 11rpx;
                    font-size: 26rpx;
                    font-weight: 500;
                    color: #666666;
                    font-weight: bold;
                    color: #626369;
                }
            }
            .row-list ._content {
                flex: 1.5;
                text-align: right;
                color: #909399;
                font-size: 24rpx;
            }
            .content-body {
                flex: 1;
                background-color: #ffffff;
                border-radius: 10rpx;
                padding: 0rpx 23rpx;
            .row-list .s1 {
                color: #d35651;
                .row-list {
                    height: 60rpx;
                    display: flex;
                    flex-direction: row;
                    padding: 0px;
                    align-items: center;
                }
                .row-list ._label {
                    display: flex;
                    flex: 0.8;
                    color: #909399;
                    align-items: center;
                    ._label-name {
                        margin-left: 11rpx;
                        font-size: 26rpx;
                        font-weight: 500;
                        color: #666666;
                    }
                }
                .row-list ._content {
                    flex: 1.5;
                    text-align: right;
                    color: #909399;
                    font-size: 24rpx;
                }
                .row-list .s1 {
                    color: #d35651;
                }
            }
        }
    }
}
.registration-form-footer {
    display: flex;
    margin-top: 10rpx;
    margin-bottom: 10rpx;
    margin-left: 20rpx;
    margin-right: 20rpx;
    padding-bottom: 14rpx;
    .registration-form-footer {
        display: flex;
        margin-top: 10rpx;
        margin-bottom: 10rpx;
        margin-left: 20rpx;
        margin-right: 20rpx;
        padding-bottom: 14rpx;
    .btn {
        flex: 1;
        margin: 10rpx;
        background: #214DED;
        box-shadow: 0rpx 6rpx 8rpx 0rpx rgba(4, 49, 212, 0.3);
        font-weight: bold;
        color: #FEFEFE;
        font-family: PingFang SC;
        .btn {
            flex: 1;
            margin: 10rpx;
            background: #214DED;
            box-shadow: 0rpx 6rpx 8rpx 0rpx rgba(4, 49, 212, 0.3);
            font-weight: bold;
            color: #FEFEFE;
            font-family: PingFang SC;
        }
    }
}
</style>
pages/wareHouse/nuclearScale/createwriteoffform.vue
@@ -4,77 +4,100 @@
        <view class="packing-registration-bg" />
        <u-navbar title="核磅录入" :background="background" :border-bottom="false" :title-bold="true" title-color="#000"
            back-icon-color="#000" />
        <u-form :model="form" ref="uForm" :label-width="200" :rules="rules" :error-type="['toast']" class="uForm">
            <u-form-item label="产品类型" :border-bottom="false" prop="value0">
                <u-radio-group v-model="form.value0">
                    <u-radio name="导体">导体</u-radio>
                    <u-radio name="铜杆">铜杆</u-radio>
                    <u-radio name="导体2.6">导体2.6</u-radio>
        <u-form :model="form" ref="uForm" :label-width="210" labelAlign="left" :rules="rules" :error-type="['toast']"
            class="uForm">
            <u-form-item label="产品类型:" :border-bottom="false" prop="productType">
                <u-radio-group v-model="form.productType" @change="handleProductTypeChange">
                    <u-radio name="1">导体</u-radio>
                    <u-radio name="2">铜杆</u-radio>
                    <u-radio name="3">导体2.6</u-radio>
                </u-radio-group>
            </u-form-item>
            <u-form-item label="替换二维码" :border-bottom="false" prop="value1">
                <u-radio-group v-model="form.value1">
            <u-form-item label="替换二维码:" :border-bottom="false" prop="replace">
                <u-radio-group v-model="form.replace">
                    <u-radio name="1">是</u-radio>
                    <u-radio name="0">否</u-radio>
                </u-radio-group>
            </u-form-item>
            <u-form-item label="车牌号" :border-bottom="false" prop="value2">
                <u-input v-model="form.value2" type="select" placeholder="请输入车牌号" @click="lpn" />
            <u-form-item label="车牌号:" :border-bottom="false" prop="licensePlate">
                <u-input v-model="form.licensePlate" type="select" placeholder="请输入车牌号" @click="lpn" />
            </u-form-item>
            <u-form-item label="客户名称" :border-bottom="false" prop="value3">
            <u-form-item label="客户名称1:" :border-bottom="false" prop="customerName1">
                <picker class="item-one item-two" style="width: 100%; text-align: right"
                    @change="locNoNumBindChange($event, locNoList)" :value="locNoNumIndex" :range="locNoList"
                    range-key="label">
                    @change="selClientChange($event, selClientList, 'customerName1')" :value="selClientIndex1"
                    :range="selClientList" range-key="label">
                    <view>
                        <text :style="{ color: locNoNumIndex == null ? '#a5abb4' : '#0c0c0c' }">{{
                locNoNumIndex == null
                        <text :style="{
                color: selClientIndex1 == null ? '#a5abb4' : '#0c0c0c',
              }">{{
                selClientIndex1 == null
                  ? "请选择"
                  : locNoList[locNoNumIndex].label
                  : selClientList[selClientIndex1].label
              }}</text>
                    </view>
                </picker>
                <u-icon v-if="locNoNumIndex == null" name="arrow-right" color="#687792" size="28"></u-icon>
                <u-icon v-if="selClientIndex1 == null" name="arrow-right" color="#687792" size="28"></u-icon>
            </u-form-item>
            <u-form-item label="发货通知单号" :border-bottom="false" prop="value4">
                <u-input v-model="form.value4" placeholder="" disabled />
            <u-form-item label="发货通知单号1:" :border-bottom="false" prop="shippingNoticeNo1">
                <u-input v-model="form.shippingNoticeNo1" placeholder="" disabled />
            </u-form-item>
            <u-form-item label="生产车间" :border-bottom="false" prop="value5">
            <u-form-item label="客户名称2:" :border-bottom="false" prop="customerName2">
                <picker class="item-one item-two" style="width: 100%; text-align: right"
                    @change="locNoNumBindChange($event, locNoList)" :value="locNoNumIndex" :range="locNoList"
                    range-key="label">
                    @change="selClientChange($event, selClientList, 'customerName2')" :value="selClientIndex2"
                    :range="selClientList" range-key="label">
                    <view>
                        <text :style="{ color: locNoNumIndex == null ? '#a5abb4' : '#0c0c0c' }">{{
                locNoNumIndex == null
                        <text :style="{
                color: selClientIndex2 == null ? '#a5abb4' : '#0c0c0c',
              }">{{
                selClientIndex2 == null
                  ? "请选择"
                  : locNoList[locNoNumIndex].label
                  : selClientList[selClientIndex2].label
              }}</text>
                    </view>
                </picker>
                <u-icon v-if="locNoNumIndex == null" name="arrow-right" color="#687792" size="28"></u-icon>
                <u-icon v-if="selClientIndex2 == null" name="arrow-right" color="#687792" size="28"></u-icon>
            </u-form-item>
            <u-form-item label="司磅员" :border-bottom="false" prop="value6">
            <u-form-item label="发货通知单号2:" :border-bottom="false" prop="shippingNoticeNo2">
                <u-input v-model="form.shippingNoticeNo2" placeholder="" disabled />
            </u-form-item>
            <u-form-item label="生产车间:" :border-bottom="false" prop="workshop">
                <picker class="item-one item-two" style="width: 100%; text-align: right"
                    @change="locNoNumBindChange($event, locNoList)" :value="locNoNumIndex" :range="locNoList"
                    range-key="label">
                    @change="workshopChange($event, workshopList)" :value="workshopIndex" :range="workshopList"
                    range-key="label" :disabled="!form.productType">
                    <view>
                        <text :style="{ color: locNoNumIndex == null ? '#a5abb4' : '#0c0c0c' }">{{
                locNoNumIndex == null
                        <text :style="{ color: workshopIndex == null ? '#a5abb4' : '#0c0c0c' }">{{
                workshopIndex == null
                  ? "请选择"
                  : locNoList[locNoNumIndex].label
                  : workshopList[workshopIndex].label
              }}</text>
                    </view>
                </picker>
                <u-icon v-if="locNoNumIndex == null" name="arrow-right" color="#687792" size="28"></u-icon>
                <u-icon v-if="workshopIndex == null" name="arrow-right" color="#687792" size="28"></u-icon>
            </u-form-item>
            <u-form-item label="叉车工" :border-bottom="false" prop="value7">
                <u-input v-model="form.value7" type="select" placeholder="请选择" @click="openForkliftDriverList" />
            <u-form-item label="司磅员:" :border-bottom="false" prop="weighingOperator">
                <picker class="item-one item-two" style="width: 100%; text-align: right"
                    @change="weighmanChange($event, weighmanList)" :value="weighmanIndex" :range="weighmanList"
                    range-key="label">
                    <view>
                        <text :style="{ color: weighmanIndex == null ? '#a5abb4' : '#0c0c0c' }">{{
                weighmanIndex == null
                  ? "请选择"
                  : weighmanList[weighmanIndex].label
              }}</text>
                    </view>
                </picker>
                <u-icon v-if="weighmanIndex == null" name="arrow-right" color="#687792" size="28"></u-icon>
            </u-form-item>
            <u-form-item label="叉车工:" :border-bottom="false" prop="forkliftOperator">
                <u-input v-model="form.forkliftOperator" type="select" placeholder="请选择"
                    @click="openForkliftDriverList" />
            </u-form-item>
        </u-form>
        <u-button type="primary" class="bottom-button1" @click="submit">创建</u-button>
        <!--车牌号 -->
        <modalBg ref="modalBg" :confirm="confirm">
            <u-field v-model="form.value2" label="车牌号:" placeholder="请输入" :border-bottom="false">
            <u-field v-model="form.licensePlate" label="车牌号:" placeholder="请输入" :border-bottom="false">
            </u-field>
        </modalBg>
        <!-- å‰è½¦å·¥ -->
@@ -103,32 +126,7 @@
        },
        data() {
            return {
                checkboxList: [{
                        label: "工人1",
                        value: "a",
                        checked: false,
                    },
                    {
                        label: "工人2",
                        value: "2",
                        checked: false,
                    },
                    {
                        label: "工人3",
                        value: "3",
                        checked: false,
                    },
                    {
                        label: "工人4",
                        value: "4",
                        checked: false,
                    },
                    {
                        label: "工人",
                        value: "5",
                        checked: false,
                    },
                ],
                checkboxList: [],
                background: {
                    backgroundImage: `url(${content_bg})`,
                    backgroundAttachment: "fixed",
@@ -138,96 +136,228 @@
                show: false,
                num: 1,
                form: {
                    value0: "",
                    value1: "",
                    value2: "",
                    value3: "",
                    value4: "111",
                    value5: "",
                    value6: "",
                    value7: "",
                    value8: "",
                    replace: '0',
                    productType: '',
                    licensePlate: '',
                    customerName1: '',
                    shippingNoticeNo1: '',
                    customerName2: '',
                    shippingNoticeNo2: '',
                    workshop: '',
                    weighingOperator: '',
                    forkliftOperator: '',
                },
                rules: {
                    value0: [{
                    productType: [{
                        required: true,
                        message: "请选择产品类型",
                        trigger: ["change"],
                    }, ],
                    value1: [{
                    replace: [{
                        required: true,
                        message: "请选择是否替换二维码",
                        trigger: ["change", "blur"],
                    }, ],
                    value2: [{
                    licensePlate: [{
                        required: true,
                        message: "请输入车牌号",
                        trigger: ["change", "blur"],
                    }, ],
                    // value3: [
                    //   {
                    //     required: true,
                    //     message: "请选择客户名称",
                    //     trigger: ["change", "blur"],
                    //   },
                    // ],
                    value4: [{
                        required: true,
                        message: "请输入发货通知单号",
                        trigger: ["change"],
                    }, ],
                    value5: [{
                    workshop: [{
                        required: true,
                        message: "请选择生产车间",
                        trigger: ["change"],
                    }, ],
                    value6: [{
                    weighingOperator: [{
                        required: true,
                        message: "请选择司磅员",
                        trigger: ["change"],
                    }, ],
                    value7: [{
                        type: "array",
                    forkliftOperator: [{
                        type: "string",
                        required: true,
                        message: "请至少选择一个叉车工",
                        trigger: ["change"],
                    }, ],
                },
                locNoList: [{
                        value: "0",
                        label: "公司1",
                    },
                    {
                        value: "1",
                        label: "公司2",
                    },
                    {
                        value: "2",
                        label: "公司3",
                    },
                    {
                        value: "3",
                        label: "公司4",
                    },
                    {
                        value: "4",
                        label: "公司5",
                    },
                    {
                        value: "5",
                        label: "公司6",
                    },
                ],
                locNoNumIndex: null,
                // å®¢æˆ·åç§°
                selClientList: [],
                selClientIndex1: null,
                selClientIndex2: null,
                // ç”Ÿäº§è½¦é—´
                workshopList: [],
                workshopIndex: null,
                // å¸ç£…员
                weighmanList: [],
                weighmanIndex: null,
                showModal: false,
                selectedItems: [],
                id1: '',
                id2: '',
                isSubmitting: false
            };
        },
        onReady() {
            this.$refs.uForm.setRules(this.rules);
            // ä»…在组件初次加载时获取数据
            if (this.selClientList.length === 0) {
                this.fetchClients();
            }
            if (this.workshopList.length === 0) {
                this.fetchWorkshops();
            }
            if (this.checkboxList.length === 0) {
                this.fetchForkliftOperators();
            }
            if (this.weighmanList.length === 0) {
                this.fetchWeighmen();
            }
        },
        onShow() {},
        onShow() {
            // é‡ç½®è¡¨å•数据
            this.form = {
                replace: '0',
                productType: '',
                licensePlate: '',
                customerName1: '',
                shippingNoticeNo1: '',
                customerName2: '',
                shippingNoticeNo2: '',
                workshop: '',
                weighingOperator: '',
                forkliftOperator: '',
            };
            this.selClientIndex1 = null;
            this.selClientIndex2 = null;
            this.workshopIndex = null;
            this.weighmanIndex = null;
            this.checkboxList = this.checkboxList.map(item => ({
                ...item,
                checked: false
            }));
            this.$refs.uForm && this.$refs.uForm.resetValidation();
        },
        methods: {
            /**
             * èŽ·å–å®¢æˆ·åˆ—è¡¨
             */
            fetchClients() {
                this.$u.api.NuclearScaleEntry.selClient().then((res) => {
                    console.log('客户名称', res)
                    if (res.code === 0) {
                        res.data.forEach((i) => {
                            const obj = Object.assign({
                                label: i.customerName,
                                value: i.customerName,
                                shippingNoticeNo: i.shippingNoticeNo,
                                id: i.id
                            });
                            this.selClientList.push(obj);
                        });
                    } else {
                        uni.showToast({
                            title: res.msg || '获取客户名称失败',
                            icon: 'none'
                        });
                    }
                }).catch(err => {
                    uni.showToast({
                        title: '网络错误,获取客户名称失败',
                        icon: 'none'
                    });
                    console.error('获取客户名称错误:', err);
                });
            },
            /**
             * èŽ·å–è½¦é—´åˆ—è¡¨
             */
            fetchWorkshops() {
                this.$u.api.dictData({
                    dictType: 'workshop'
                }).then(res => {
                    if (res.code === 0 && res.data.length > 0) {
                        res.data.forEach(i => {
                            const obj = Object.assign({
                                label: i.label,
                                value: i.value,
                            })
                            this.workshopList.push(obj)
                        })
                    } else {
                        uni.showToast({
                            title: res.msg || '获取车间列表失败',
                            icon: 'none'
                        });
                    }
                }).catch(err => {
                    uni.showToast({
                        title: '网络错误,获取车间列表失败',
                        icon: 'none'
                    });
                    console.error('获取车间列表错误:', err);
                });
            },
            /**
             * èŽ·å–å‰è½¦å·¥åˆ—è¡¨
             */
            fetchForkliftOperators() {
                this.$u.api.dictData({
                    dictType: 'forklift'
                }).then(res => {
                    if (res.code === 0 && res.data.length > 0) {
                        res.data.forEach(i => {
                            const obj = Object.assign({
                                label: i.label,
                                value: i.label,
                            })
                            this.checkboxList.push(obj)
                        })
                    } else {
                        uni.showToast({
                            title: res.msg || '获取叉车工列表失败',
                            icon: 'none'
                        });
                    }
                }).catch(err => {
                    uni.showToast({
                        title: '网络错误,获取叉车工列表失败',
                        icon: 'none'
                    });
                    console.error('获取叉车工列表错误:', err);
                });
            },
            /**
             * èŽ·å–å¸ç£…å‘˜åˆ—è¡¨
             */
            fetchWeighmen() {
                this.$u.api.dictData({
                    dictType: 'weighing'
                }).then(res => {
                    if (res.code === 0 && res.data.length > 0) {
                        res.data.forEach(i => {
                            const obj = Object.assign({
                                label: i.label,
                                value: i.label,
                            })
                            this.weighmanList.push(obj)
                        })
                    } else {
                        uni.showToast({
                            title: res.msg || '获取司磅员列表失败',
                            icon: 'none'
                        });
                    }
                }).catch(err => {
                    uni.showToast({
                        title: '网络错误,获取司磅员列表失败',
                        icon: 'none'
                    });
                    console.error('获取司磅员列表错误:', err);
                });
            },
            // å¤é€‰æ¡†å˜åŒ–事件
            checkboxChange(e) {
                const values = e.detail.value;
@@ -241,43 +371,196 @@
            // ç¡®è®¤é€‰æ‹©
            confirmSelection() {
                this.form.value7 = this.checkboxList
                // å°†é€‰ä¸­çš„叉车工标签数组转为以逗号分隔的字符串
                this.form.forkliftOperator = this.checkboxList
                    .filter((item) => item.checked)
                    .map((item) => item.label);
                    .map((item) => item.label)
                    .join(',');
            },
            cancel() {},
            openForkliftDriverList() {
                this.showModal = true;
            },
            locNoNumBindChange(e, storage) {
            // å®¢æˆ·åç§°
            selClientChange(e, storage, code) {
                if (storage.length <= 0) {
                    this.locNoNumIndex = null;
                    this.selClientIndex1 = null;
                    this.selClientIndex2 = null;
                    return;
                }
                this.locNoNumIndex = e.target.value;
                this.form.value3 = storage[this.locNoNumIndex].label;
                const selectedIndex = e.target.value;
                const selectedCustomer = storage[selectedIndex];
                // æ£€æŸ¥æ˜¯å¦é€‰æ‹©äº†ç›¸åŒçš„客户
                if (code === "customerName1" && this.selClientIndex2 === selectedIndex) {
                    uni.showToast({
                        title: '不能选择相同的客户',
                        icon: 'none'
                    });
                    return;
                }
                if (code === "customerName2" && this.selClientIndex1 === selectedIndex) {
                    uni.showToast({
                        title: '不能选择相同的客户',
                        icon: 'none'
                    });
                    return;
                }
                if (code === "customerName2") {
                    this.selClientIndex2 = selectedIndex;
                    this.form.customerName2 = selectedCustomer.label;
                    this.form.shippingNoticeNo2 = selectedCustomer.shippingNoticeNo;
                    this.id2 = selectedCustomer.id;
                }
                if (code === "customerName1") {
                    this.selClientIndex1 = selectedIndex;
                    this.form.customerName1 = selectedCustomer.label;
                    this.form.shippingNoticeNo1 = selectedCustomer.shippingNoticeNo;
                    this.id1 = selectedCustomer.id
                }
            },
            // æ‰“开弹框--后面还需要监听扫码枪扫码结果,赋值给报工单号字段,然后打开弹框选择订单号等操作
            // ç”Ÿäº§è½¦é—´
            workshopChange(e, storage) {
                if (storage.length <= 0) {
                    this.workshopIndex = null;
                    return;
                }
                const productType = this.form.productType;
                const selectedWorkshop = storage[e.target.value];
                // æ£€æŸ¥äº§å“ç±»åž‹æ˜¯å¦ä¸ºé“œæ†(值为2)
                if (productType === '2') {
                    // é“œæ†åªèƒ½é€‰æ‹©é“œæ†ç›¸å…³è½¦é—´
                    if (!selectedWorkshop.label.includes('铜杆')) {
                        uni.showModal({
                            title: "提示",
                            content: "铜杆产品只能选择铜杆相关车间",
                            showCancel: false
                        });
                        return;
                    }
                } else {
                    // å¯¼ä½“产品不能选择铜杆车间
                    if (selectedWorkshop.label.includes('铜杆')) {
                        uni.showModal({
                            title: "提示",
                            content: "导体产品不能选择铜杆车间",
                            showCancel: false
                        });
                        return;
                    }
                }
                this.workshopIndex = e.target.value;
                this.form.workshop = selectedWorkshop.label;
            },
            // å¸ç£…员
            weighmanChange(e, storage) {
                if (storage.length <= 0) {
                    this.weighmanIndex = null;
                    return;
                }
                this.weighmanIndex = e.target.value;
                this.form.weighingOperator = storage[this.weighmanIndex].label;
            },
            lpn() {
                this.$refs.modalBg.open();
            },
            // å¼¹æ¡†ä¿å­˜
            confirm() {
                console.log("保存", this.form.value1);
                // è¯·æ±‚接口,根据工单号查询其他信息并赋值
            confirm() {},
            /**
             * äº§å“ç±»åž‹å˜åŒ–时清空车间选择
             */
            handleProductTypeChange() {
                this.workshopIndex = null;
                this.form.workshop = '';
            },
            // æäº¤æŒ‰é’®
            submit() {
                if (!this.$refs.uForm.validate()) {
                    console.log("1111");
                    return;
            async submit() {
                if (this.isSubmitting) return;
                try {
                    // ç»Ÿä¸€è¡¨å•验证
                    if (!await this.validateForm()) return;
                    // æž„建提交数据
                    const submitData = this.buildSubmitData().customerList;
                    console.log('提交的数据',submitData)
                    this.isSubmitting = true;
                    const res = await this.$u.api.NuclearScaleEntry.createMain(submitData);
                    if (res.code === 0) {
                        this.$u.toast("提交成功");
                        uni.navigateBack();
                    } else {
                        uni.showToast({
                            title: res.msg || '提交失败:业务处理错误',
                            icon: 'none'
                        });
                        console.error('业务错误:', res);
                    }
                } catch (err) {
                    if (err.type === 'validation') {
                        uni.showToast({
                            title: err.message,
                            icon: 'none'
                        });
                    } else if (err.message.includes('Network Error')) {
                        uni.showToast({
                            title: '网络连接错误,请检查网络后重试',
                            icon: 'none'
                        });
                    } else {
                        uni.showToast({
                            title: '系统错误,请稍后重试',
                            icon: 'none'
                        });
                    }
                    console.error('提交表单错误:', err);
                } finally {
                    this.isSubmitting = false;
                }
                if (this.form.value3 === "") {
                    uni.showToast({
                        title: "请先选择客户名称",
                        icon: "none",
                    });
                    return;
            },
            // ç»Ÿä¸€è¡¨å•验证
            async validateForm() {
                // ä½¿ç”¨uView表单验证
                if (!await this.$refs.uForm.validate()) {
                    return false;
                }
                // å®¢æˆ·åç§°éªŒè¯
                if (!this.form.customerName1 || !this.form.customerName2) {
                    throw { type: 'validation', message: '请先选择客户名称' };
                }
                return true;
            },
            // æž„建提交数据
            buildSubmitData() {
                // åˆ›å»ºå®¢æˆ·æ•°æ®çš„辅助函数
                const createCustomerItem = (customerIndex) => ({
                    customerName: this.form[`customerName${customerIndex}`],
                    shippingNoticeNo: this.form[`shippingNoticeNo${customerIndex}`],
                    shippingNoticeId: this[`id${customerIndex}`],
                    replace: this.form.replace,
                    productType: this.form.productType,
                    licensePlate: this.form.licensePlate,
                    workshop: this.form.workshop,
                    weighingOperator: this.form.weighingOperator,
                    forkliftOperator: this.form.forkliftOperator,
                });
                // æž„建客户列表
                const customerList = [1, 2].map(createCustomerItem);
                return {
                    customerList
                };
            },
        },
    };
@@ -314,12 +597,14 @@
    /* å¤é€‰æ¡†æ ·å¼ */
    .checkbox-item {
        width: 200px;
        width: 230px;
        display: flex;
        align-items: center;
        padding: 20rpx 0;
        border-bottom: 1rpx solid #f5f5f5;
        .label{
        background-color: #f8f9fa;
        .label {
            position: relative;
            left: 130px;
        }
pages/wareHouse/nuclearScale/index.scss
@@ -50,7 +50,7 @@
  text-align: right !important;
}
.bottom-button {
  position: fixed;
  position: absolute;
  bottom: 40rpx;
  left: 45%;
  width: calc(100% - 80rpx);
@@ -64,3 +64,244 @@
  transform: translateX(-50%);
}
.wrap .packing-registration-scroll-list {
  height: calc(100vh - var(--window-top) - var(--window-bottom) - 800rpx);
  width: 100%;
}
.packing-registration-scroll-list-group {
  ::v-deep .u-cell-item-box {
    background-color: rgba(250, 252, 255, 0.36) !important;
    padding: 0rpx 30rpx;
  }
  .content {
    font-size: 12px;
    background-color: #ffffff;
    box-sizing: border-box;
    border-radius: 10rpx;
    margin: 0rpx 0rpx 16rpx;
    padding: 20rpx 8rpx;
    box-shadow: none;
    display: flex;
    align-items: center;
    .content-header {
      width: 40rpx;
      height: 90rpx;
      display: flex;
      align-items: center;
      .content-header-icon {
        background-image: url("~@/static/custom/moveWareHouse/header_icon.png");
        background-size: 100% auto;
        background-repeat: no-repeat;
        height: 28rpx;
        width: 28rpx;
      }
      .content-header-title {
        margin-left: 11rpx;
        font-size: 26rpx;
        font-weight: bold;
        color: #626369;
      }
    }
    .content-body {
      flex: 1;
      background-color: #ffffff;
      border-radius: 10rpx;
      padding: 0rpx 23rpx;
      .row-list {
        height: 60rpx;
        display: flex;
        flex-direction: row;
        padding: 0px;
        align-items: center;
      }
      .row-list ._label {
        display: flex;
        flex: 0.8;
        color: #909399;
        align-items: center;
        ._label-name {
          margin-left: 11rpx;
          font-size: 26rpx;
          font-weight: 500;
          color: #666666;
        }
      }
      .row-list ._content {
        flex: 1.5;
        text-align: right;
        color: #909399;
        font-size: 24rpx;
      }
      .row-list .s1 {
        color: #d35651;
      }
    }
  }
  .packing-registration-param {
    padding: 40rpx 30rpx 10rpx 30rpx;
    height: 350px;
    overflow: hidden;
    .packing-registration-param-title {
      display: flex;
      flex-direction: row;
      align-items: center;
      margin-bottom: 30rpx;
      .title-label {
        margin-left: 14rpx;
        font-size: 34rpx;
        font-weight: bold;
        color: #283e65;
      }
    }
    .packing-registration-param-view {
      height: 177rpx;
      background-color: #fff;
      border-radius: 10rpx;
      padding: 0rpx 23rpx;
      margin-bottom: 30rpx;
      .packing-registration-param-item {
        height: 90rpx;
        border: 1px solid #adc8e4;
        line-height: 90rpx;
        display: flex;
        justify-content: space-between;
        border: none;
        .packing-registration-param-item-left {
          .item-one {
            font-size: 30rpx;
            color: #666666;
          }
        }
        .packing-registration-param-item-right {
          display: flex;
          justify-content: space-between;
          .item-one {
            font-size: 15rpx;
            color: #060505;
            margin-right: 6rpx;
          }
          .item-two {
            font-size: 15rpx;
            color: #a6b4cc;
            margin-right: 6rpx;
          }
          .item-three {
            font-size: 30rpx;
            color: #214ded;
            margin-right: 6rpx;
          }
        }
      }
      .param-extra {
        border-bottom: 1px solid #ededed;
      }
    }
  }
  ::v-deep .u-model__title {
    padding-top: 0 !important;
  }
  ::v-deep .u-input__input {
    text-align: right !important;
  }
}
.popup-content {
  width: 600rpx;
  height: 350rpx;
  background-color: #fff;
  border-radius: 8px;
  z-index: 10;
  /* ç¡®ä¿å†…容在蒙版之上 */
}
.packing-registration-param {
  padding: 40rpx 30rpx 10rpx 30rpx;
  .packing-registration-param-title {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-bottom: 30rpx;
    .title-label {
      margin-left: 14rpx;
      font-size: 34rpx;
      font-weight: bold;
      color: #283e65;
    }
  }
  .packing-registration-param-view {
    height: 550rpx;
    background-color: #fff;
    border-radius: 10rpx;
    padding: 0rpx 23rpx;
    margin-bottom: 30rpx;
    .packing-registration-param-item {
      height: 90rpx;
      border: 1px solid #adc8e4;
      line-height: 90rpx;
      display: flex;
      justify-content: space-between;
      border: none;
      .packing-registration-param-item-left {
        .item-one {
          font-size: 30rpx;
          color: #666666;
        }
      }
      .packing-registration-param-item-right {
        display: flex;
        justify-content: space-between;
        .item-one {
          font-size: 30rpx;
          color: #060505;
          margin-right: 6rpx;
        }
        .item-two {
          font-size: 30rpx;
          color: #a6b4cc;
          margin-right: 6rpx;
        }
        .item-three {
          font-size: 30rpx;
          color: #214ded;
          margin-right: 6rpx;
        }
      }
    }
    .param-extra {
      border-bottom: 1px solid #ededed;
    }
  }
}
pages/wareHouse/nuclearScale/index.vue
@@ -1,145 +1,325 @@
<template>
  <!-- æ ¸ç£…录入 -->
  <div class="page">
    <view class="packing-registration-bg" />
    <u-navbar title="核磅录入" :background="background" :border-bottom="false" :title-bold="true" title-color="#000"
      back-icon-color="#000" />
    <u-form :model="form" ref="uForm" :label-width="200" :rules="rules" :error-type="['toast']" class="uForm">
      <u-form-item label="核磅单号" :border-bottom="false" prop="value1">
        <u-input v-model="form.value1" type="select" placeholder="请选择核磅单号" @click="openList" />
      </u-form-item>
      <u-form-item label="产品类型" :border-bottom="false" prop="value2">
        <u-input v-model="form.value2" placeholder="" disabled />
      </u-form-item>
      <u-form-item label="车牌号" :border-bottom="false" prop="value3">
        <u-input v-model="form.value3" placeholder="" disabled />
      </u-form-item>
      <u-form-item label="发货通知单1" :border-bottom="false" prop="value4">
        <u-input v-model="form.value4" placeholder="" disabled />
      </u-form-item>
      <u-form-item label="客户名称1" :border-bottom="false" prop="value5">
        <u-input v-model="form.value5" placeholder="" disabled />
      </u-form-item>
      <u-form-item label="发货通知单2" :border-bottom="false" prop="value4">
        <u-input v-model="form.value9" placeholder="" disabled />
      </u-form-item>
      <u-form-item label="客户名称2" :border-bottom="false" prop="value5">
        <u-input v-model="form.value10" placeholder="" disabled />
      </u-form-item>
      <u-form-item label="司磅员" :border-bottom="false" prop="value6">
        <u-input v-model="form.value6" placeholder="" disabled />
      </u-form-item>
      <u-form-item label="叉车司机" :border-bottom="false" prop="value7">
        <u-input v-model="form.value7" placeholder="" disabled />
      </u-form-item>
      <u-form-item label="核磅记录" :border-bottom="false" prop="value8">
        <u-input v-model="form.value8" type="select" placeholder="" @click="openNuclearScaleRecord" />
      </u-form-item>
      <u-form-item :label="`扫码记录(${num}条):`" :border-bottom="false" prop="value4" :label-width="260">
        <!-- <u-input v-model="form.value4" placeholder="" disabled /> -->
      </u-form-item>
    </u-form>
    <u-button type="primary" class="bottom-button" @click="submit">提交</u-button>
    <!-- æ ¸ç£…录入 -->
    <div class="page">
        <view class="packing-registration-bg" />
        <u-navbar title="核磅录入" :background="background" :border-bottom="false" :title-bold="true" title-color="#000"
            back-icon-color="#000" />
        <u-form :model="form" ref="uForm" :label-width="200" :rules="rules" :error-type="['toast']" class="uForm">
            <u-form-item label="核磅单号" :border-bottom="false" prop="verificationNo">
                <u-input v-model="form.verificationNo" type="select" placeholder="请选择核磅单号" @click="openList" />
            </u-form-item>
            <u-form-item label="产品类型" :border-bottom="false" prop="productType">
                <u-input v-model="productTypeMap[form.productType] || form.productType" placeholder="" disabled />
            </u-form-item>
            <u-form-item label="车牌号" :border-bottom="false" prop="licensePlate">
                <u-input v-model="form.licensePlate" placeholder="" disabled />
            </u-form-item>
            <u-form-item label="发货通知单1" :border-bottom="false" prop="shippingNoticeNo1">
                <u-input v-model="form.shippingNoticeNo1" placeholder="" disabled />
            </u-form-item>
            <u-form-item label="客户名称1" :border-bottom="false" prop="customerName1">
                <u-input v-model="form.customerName1" placeholder="" disabled />
            </u-form-item>
            <u-form-item label="发货通知单2" :border-bottom="false" prop="shippingNoticeNo2">
                <u-input v-model="form.shippingNoticeNo2" placeholder="" disabled />
            </u-form-item>
            <u-form-item label="客户名称2" :border-bottom="false" prop="customerName2">
                <u-input v-model="form.customerName2" placeholder="" disabled />
            </u-form-item>
            <u-form-item label="司磅员" :border-bottom="false" prop="weighingOperator">
                <u-input v-model="form.weighingOperator" placeholder="" disabled />
            </u-form-item>
            <u-form-item label="叉车司机" :border-bottom="false" prop="forkliftOperator">
                <u-input v-model="form.forkliftOperator" placeholder="" disabled />
            </u-form-item>
            <u-form-item label="核磅记录" :border-bottom="false" prop="value8">
                <u-input type="select" placeholder="" @click="openNuclearScaleRecord" />
            </u-form-item>
            <u-form-item :label="`扫码记录(${ScanCodeRecord.length}条):`" :border-bottom="false" prop="shippingNoticeNo1"
                :label-width="260">
            </u-form-item>
        </u-form>
        <view class="wrap">
            <scroll-view class="packing-registration-scroll-list" scroll-y="true">
                <u-cell-group class="packing-registration-scroll-list-group" :border="false">
                    <view class="content" v-for="(item, index) in ScanCodeRecord" :key="index" :index="index"
                        @click="cancelReport(item)">
                        <view class="content-header">
                            <view class="content-header-title">{{ index + 1 }}</view>
                        </view>
                        <view class="content-body">
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-name">批号:</view>
                                </view>
                                <view class="_content">
                                    {{ item.outBatchNo }}
                                </view>
                            </view>
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-name">零件描述:</view>
                                </view>
                                <view class="_content">
                                    {{ item.netWeight }}
                                </view>
                            </view>
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-name">零件号:</view>
                                </view>
                                <view class="_content">
                                    {{ item.partNo }}
                                </view>
                            </view>
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-name">毛重:</view>
                                </view>
                                <view class="_content">
                                    {{ item.grossWeight }}
                                </view>
                            </view>
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-name">盘重:</view>
                                </view>
                                <view class="_content">
                                    {{ item.trayWeight }}
                                </view>
                            </view>
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-name">净重:</view>
                                </view>
                                <view class="_content">
                                    {{ item.netWeight }}
                                </view>
                            </view>
                        </view>
                    </view>
                </u-cell-group>
            </scroll-view>
        </view>
        <!-- å¯¼ä½“ -->
        <u-modal v-model="showModal" title="" :show-cancel-button="true" :show-confirm-button="true"
            @confirm="confirmDt" @cancel="cancelDt">
            <view class="popup-content">
                <view class="packing-registration-param">
                    <view class="packing-registration-param-view">
                        <view class="packing-registration-param-item param-extra">
                            <view class="packing-registration-param-item-left">
                                <text class="item-one">核磅重量:</text>
                            </view>
                            <view class="packing-registration-param-item-right">
                                <u-input class="item-one item-two" v-model="modalList.suppliedQuantity" />
                            </view>
                        </view>
                        <view class="packing-registration-param-item param-extra">
                            <view class="packing-registration-param-item-left">
                                <text class="item-one">叉车盘重:</text>
                            </view>
                            <view class="packing-registration-param-item-right">
                                <u-input class="item-one item-two" v-model="modalList.suppliedQuantity" />
                            </view>
                        </view>
                    </view>
                </view>
            </view>
        </u-modal>
        <u-button type="primary" class="bottom-button" @click="submit">提交</u-button>
        <u-modal v-model="show" @confirm="confirm" content="是否确认提交" show-cancel-button></u-modal>
    <scan></scan>
  </div>
        <saveForm ref="saveForm" :operationTaskList="this.form" @update="handleUpdate" />
        <scan></scan>
    </div>
</template>
<script>
import scan from "@/components/scan/scan.vue";
import content_bg from '@/static/custom/packing/backBg.png'
export default {
  components: { scan },
  data() {
    return {
      background: {
        backgroundImage: `url(${content_bg})`,
        backgroundAttachment: 'fixed',
        backgroundSize: '100% auto',
        backgroundRepeat: 'no-repeat',
      },
      show:false,
      num:1,
      form: {
        value0: '',
        value1: '',
        value2: '',
        value3: '',
        value4: '',
        value5: '',
        value6: '',
        value7: '',
        value8: '',
        value9: '',
        value10:'',
      },
      rules: {
        value1: [
          {
            required: true,
            message: '请选择核磅单号',
            trigger: ['change', 'blur'],
          },
        ],
      },
    }
  },
  onReady() {
    this.$refs.uForm.setRules(this.rules);
  },
  onShow() {
    let that = this
    uni.$off('scan') // æ¯æ¬¡è¿›æ¥å…ˆ ç§»é™¤å…¨å±€è‡ªå®šä¹‰äº‹ä»¶ç›‘听器
    uni.$on('scan', function (data) {
      console.log('onscan');
      //扫码成功后的回调,你可以写自己的逻辑代码在这里
      console.log('页面扫码结果:', data.code);
      if (data.code) {
        let codeInfo = JSON.parse(data.code)
        if (codeInfo.WorkNo) {
          // æ‰«ææŠ¥å·¥å•二维码
          that.saveForm(codeInfo);
        }
      }
    })
  },
  methods: {
    // æäº¤æŒ‰é’®
    submit() {
      this.show = true
    },
    // å¼¹æ¡†ä¿å­˜
    confirm() {
      console.log('保存', this.form.value1);
      // è¯·æ±‚接口,根据工单号查询其他信息并赋值
    },
    // é€‰æ‹©è®¢å•号
    openList() {
      uni.navigateTo({
        url: '/pages/wareHouse/nuclearScale/nuclearScaleList'
      })
    },
    //核磅记录
    openNuclearScaleRecord() {
      uni.navigateTo({
        url: '/pages/wareHouse/nuclearScale/nuclearscalerecord'
      })
    },
    // å­˜è®¢å•号
    setNo(val) {
      this.form.value3 = val
    },
    // å›žæ˜¾æ‰«ç çš„信息-报工单
    saveForm(val) {
      let { WorkNo, ProcessName, ORDER_NO } = val
      this.form.value1 = WorkNo
      this.form.value2 = ProcessName
      this.form.value3 = ORDER_NO
    }
  }
}
    import scan from "@/components/scan/scan.vue";
    import content_bg from "@/static/custom/packing/backBg.png";
    import saveForm from "./saveForm.vue";
    export default {
        components: {
            scan,
            saveForm,
        },
        data() {
            return {
                modalList: {},
                showModal: false,
                productTypeMap: {
                    1: "导体",
                    2: "铜杆",
                    3: "导体2.6",
                },
                ScanCodeRecord: [],
                background: {
                    backgroundImage: `url(${content_bg})`,
                    backgroundAttachment: "fixed",
                    backgroundSize: "100% auto",
                    backgroundRepeat: "no-repeat",
                },
                show: false,
                form: {
                    value0: "",
                    verificationNo: "",
                    productType: "",
                    licensePlate: "",
                    shippingNoticeNo1: "",
                    customerName1: "",
                    weighingOperator: "",
                    forkliftOperator: "",
                    value8: "",
                    shippingNoticeNo2: "",
                    customerName2: "",
                },
                rules: {
                    verificationNo: [{
                        required: true,
                        message: "请选择核磅单号",
                        trigger: ["change", "blur"],
                    }, ],
                },
            };
        },
        onReady() {
            this.$refs.uForm.setRules(this.rules);
        },
        onShow() {
            let that = this;
            uni.$off("scan"); // æ¯æ¬¡è¿›æ¥å…ˆ ç§»é™¤å…¨å±€è‡ªå®šä¹‰äº‹ä»¶ç›‘听器
            uni.$on("scan", function(data) {
                console.log("onscan");
                if (that.form.verificationNo == "") {
                    uni.showToast({
                        icon: "none",
                        title: "请先选择核磅单号!",
                        duration: 2 * 1000,
                    });
                    return;
                }
                //扫码成功后的回调,你可以写自己的逻辑代码在这里
                console.log("页面扫码结果:", data.code);
                if (data.code) {
                    try {
                        let codeInfo = JSON.parse(data.code);
                    } catch (e) {
                        uni.showToast({
                            icon: "none",
                            title: "扫码数据解析失败,请重试!",
                            duration: 2 * 1000,
                        });
                        return;
                    }
                    if (codeInfo.CN != that.form.customerName1) {
                        // æ‰«ææŠ¥å·¥å•二维码
                        uni.showModal({
                            title: "提示",
                            content: "客户不一致:" +
                                codeInfo.CN +
                                "||" +
                                that.form.customerName1,
                            showCancel: true,
                            success: function() {
                                if (that.form.productType == "2") {
                                    that.$refs.saveForm.open(codeInfo);
                                } else {
                                    that.ScanCodeRecord.push(codeInfo);
                                }
                            },
                        });
                    } else {
                        if (that.form.productType == "2") {
                            that.$refs.saveForm.open(codeInfo);
                        } else {
                            that.ScanCodeRecord.push(codeInfo);
                        }
                    }
                }
            });
        },
        methods: {
            // å–消扫码记录
            cancelReport(item) {
                this.ScanCodeRecord = this.ScanCodeRecord.filter(a => a.outBatchNo !== item.outBatchNo);
            },
            // å¯¼ä½“提交
            confirmDt() {
                      const magnetic =
        Number(this.form.h) - Number(this.form.children) - Number(this.form.m);
                console.log("保存", this.form.verificationNo);
                switch (this.form.productType) {
                    case "导体":
                        if (magnetic > 0 && magnetic < 3) {
                            this.ScanCodeRecord.push(this.form);
                        } else {
                            this.$u.toast("生产核查");
                        }
                        break;
                    case "导体2.6":
                        if (magnetic > -0.5 && magnetic < 0.5) {
                            this.ScanCodeRecord.push(this.form);
                        } else {
                            this.$u.toast("生产核查");
                        }
                        break;
                }
            },
            // å–消
            cancelDt() {
                this.showModal = false;
            },
            handleUpdate(Obj) {
                this.ScanCodeRecord.push(Obj);
            },
            // æäº¤æŒ‰é’®
            submit() {
                this.showModal = true;
            },
            // å¼¹æ¡†ä¿å­˜
            confirm() {
                console.log("保存", this.form.verificationNo);
                // è¯·æ±‚接口,根据工单号查询其他信息并赋值
            },
            // é€‰æ‹©è®¢å•号
            openList() {
                uni.navigateTo({
                    url: "/pages/wareHouse/nuclearScale/nuclearScaleList",
                });
            },
            //核磅记录
            openNuclearScaleRecord() {
                if (this.form.verificationNo == "") {
                    uni.showToast({
                        icon: "none",
                        title: "请先选择核磅单号!",
                        duration: 2 * 1000,
                    });
                    return;
                }
                uni.navigateTo({
                    url: "/pages/wareHouse/nuclearScale/nuclearscalerecord",
                });
            },
            // å­˜è®¢å•号
            setNo(val) {
                this.form = val;
            },
            // å›žæ˜¾æ‰«ç çš„信息-报工单
            // saveForm(val) {
            //     let {
            //         WorkNo,
            //         ProcessName,
            //         ORDER_NO
            //     } = val;
            //     this.form.verificationNo = WorkNo;
            //     this.form.productType = ProcessName;
            //     this.form.licensePlate = ORDER_NO;
            // },
        },
    };
</script>
<style lang="scss">
@import 'index.scss';
    @import "index.scss";
</style>
pages/wareHouse/nuclearScale/nuclearScaleList.vue
@@ -1,399 +1,453 @@
<template>
  <view class="page">
    <view class="finishProductIn-locno-bg" />
    <u-navbar
      title="核磅单号"
      :background="background"
      :border-bottom="false"
      :title-bold="true"
      title-color="#000"
      back-icon-color="#000"
    />
    <view class="finishProductIn-locno-search">
      <u-search
        v-model="keywords"
        shape="square"
        bg-color="rgba(250,252,255,0.36)"
        :show-action="false"
        placeholder="请输入核磅单号"
        @clear="search"
        @custom="search"
        @search="search"
      >
      </u-search>
    </view>
    <view class="wrap">
      <scroll-view
        class="finishProductIn-locno-scroll-list"
        scroll-y="true"
        @scrolltolower="loadMore"
      >
        <u-cell-group
          class="finishProductIn-locno-scroll-list-group"
          :border="false"
        >
          <view
            class="content"
            v-for="(item, index) in list"
            :key="item.locNo"
            :index="index"
            @click="selectNo(item.index)"
          >
            <view class="content-header">
              <view class="content-header-title">{{ index + 1 }}</view>
            </view>
            <view class="content-body">
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-1"> </view>
                  <view class="_label-name">核榜单号:</view>
                </view>
                <view class="_content">
                  {{ item.value0 }}
                </view>
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-2"> </view>
                  <view class="_label-name">产品类型:</view>
                </view>
                <view class="_content">
                  {{ item.value1 }}
                </view>
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-3"> </view>
                  <view class="_label-name">车牌号:</view>
                </view>
                <view class="_content">
                  {{ item.value2 }}
                </view>
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-1"> </view>
                  <view class="_label-name">发货通知:</view>
                </view>
                <view class="_content">
                  {{ item.value3 }}
                </view>
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-2"> </view>
                  <view class="_label-name">客户名称:</view>
                </view>
                <view class="_content">
                  {{ item.value4 }}
                </view>
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-3"> </view>
                  <view class="_label-name">生产车间:</view>
                </view>
                <view class="_content">
                  {{ item.value5 }}
                </view>
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-1"> </view>
                  <view class="_label-name">司磅员:</view>
                </view>
                <view class="_content">
                  {{ item.value6 }}
                </view>
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-2"> </view>
                  <view class="_label-name">叉车司机:</view>
                </view>
                <view class="_content">
                  {{ item.value7 }}
                </view>
              </view>
            </view>
          </view>
        </u-cell-group>
        <view class="loadmore" @click="loadMore">
          <u-loadmore :status="loadStatus"></u-loadmore>
        </view>
      </scroll-view>
    </view>
    <view class="plus-button" @click="openCreateWriteOffForm">
      <text class="plus-sign">+</text>
    </view>
  </view>
    <view class="page">
        <view class="finishProductIn-locno-bg" />
        <u-navbar title="核磅单号" :background="background" :border-bottom="false" :title-bold="true" title-color="#000"
            back-icon-color="#000" />
        <view class="finishProductIn-locno-search">
            <u-search v-model="keywords" shape="square" bg-color="rgba(250,252,255,0.36)" :show-action="false"
                placeholder="请输入核磅单号" @clear="search" @custom="search" @search="search">
            </u-search>
        </view>
        <view class="wrap">
            <scroll-view class="finishProductIn-locno-scroll-list" scroll-y="true" @scrolltolower="getmoreList()">
                <u-skeleton v-if="isLoading && list.length === 0" type="list" :row="5" :loading="isLoading" />
                <u-cell-group class="finishProductIn-locno-scroll-list-group" :border="false">
                    <view v-if="list.length === 0 && !isLoading" class="empty-tips">
                        <text>暂无数据</text>
                    </view>
                    <view class="content" v-for="(item, index) in list" :key="item.verificationNo" :index="index"
                        @click="selectNo(item)">
                        <view class="content-header">
                            <view class="content-header-title">{{ index + 1 }}</view>
                        </view>
                        <view class="content-body">
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-icon-1"> </view>
                                    <view class="_label-name">核榜单号:</view>
                                </view>
                                <view class="_content">
                                    {{ item.verificationNo }}
                                </view>
                            </view>
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-icon-2"> </view>
                                    <view class="_label-name">产品类型:</view>
                                </view>
                                <view class="_content">
                                    {{ formatProductType(item.productType) }}
                                </view>
                            </view>
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-icon-3"> </view>
                                    <view class="_label-name">车牌号:</view>
                                </view>
                                <view class="_content">
                                    {{ item.licensePlate }}
                                </view>
                            </view>
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-icon-1"> </view>
                                    <view class="_label-name">发货通知1:</view>
                                </view>
                                <view class="_content">
                                    {{ item.shippingNoticeNo1 }}
                                </view>
                            </view>
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-icon-2"> </view>
                                    <view class="_label-name">客户名称1:</view>
                                </view>
                                <view class="_content">
                                    {{ item.customerName1 }}
                                </view>
                            </view>
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-icon-1"> </view>
                                    <view class="_label-name">发货通知2:</view>
                                </view>
                                <view class="_content">
                                    {{ item.shippingNoticeNo2 }}
                                </view>
                            </view>
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-icon-2"> </view>
                                    <view class="_label-name">客户名称2:</view>
                                </view>
                                <view class="_content">
                                    {{ item.customerName2 }}
                                </view>
                            </view>
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-icon-3"> </view>
                                    <view class="_label-name">生产车间:</view>
                                </view>
                                <view class="_content">
                                    {{ item.workshop }}
                                </view>
                            </view>
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-icon-1"> </view>
                                    <view class="_label-name">司磅员:</view>
                                </view>
                                <view class="_content">
                                    {{ item.weighingOperator }}
                                </view>
                            </view>
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-icon-2"> </view>
                                    <view class="_label-name">叉车司机:</view>
                                </view>
                                <view class="_content">
                                    {{ item.forkliftOperator }}
                                </view>
                            </view>
                        </view>
                    </view>
                </u-cell-group>
                <view class="loadmore" @click="getmoreList()">
                    <u-loadmore :status="status" :load-text="loadText" @loadmore="getmoreList()" />
                </view>
            </scroll-view>
        </view>
        <view class="plus-button" @click="openCreateWriteOffForm">
            <text class="plus-sign">+</text>
        </view>
    </view>
</template>
<script>
import content_bg from "@/static/custom/finishProductIn/locNoBg.png";
export default {
  data() {
    return {
      background: {
        backgroundImage: `url(${content_bg})`,
        backgroundAttachment: "fixed",
        backgroundSize: "100% auto",
        backgroundRepeat: "no-repeat",
      },
      keywords: "",
      alllist: [],
      originList: [],
      query: {
        current: 1,
        size: 10,
      },
      list: [
        {
          value0: "123456789",
          value1: "123456789",
          value2: "123456789",
          value3: "123456789",
          value4: "123456789",
          value5: "123456789",
          value6: "123456789",
          value7: "123456789",
        },
        {
          value0: "123456789",
          value1: "123456789",
          value2: "123456789",
          value3: "123456789",
          value4: "123456789",
          value5: "123456789",
          value6: "123456789",
          value7: "123456789",
        },
      ],
      count: 0,
      loadStatus: "loading",
    };
    import content_bg from "@/static/custom/finishProductIn/locNoBg.png";
    export default {
        data() {
            return {
                background: {
                    backgroundImage: `url(${content_bg})`,
                    backgroundAttachment: "fixed",
                    backgroundSize: "100% auto",
                    backgroundRepeat: "no-repeat",
                },
                keywords: "",
                list: [],
                total: 0,
                pageNum: 1,
                pageSize: 10,
                status: 'loading',
            isLoading: false,
                loadText: {
                    loadmore: "加载更多...",
                    loading: "努力加载中...",
                    nomore: "没有更多了",
                },
            };
        },
        onLoad() {
            this.getlist();
  },
  onLoad() {
    this.$u.api.finishProductIn.fetchList().then((res) => {
      this.alllist = res.data;
      this.originList = res.data;
      this.loadList();
    });
  },
  methods: {
    //创建核销单
    openCreateWriteOffForm() {
      uni.navigateTo({
        url: '/pages/wareHouse/nuclearScale/createwriteoffform'
      })
    },
    loadMore() {
      if (this.loadStatus == "nomore" || this.loadStatus == "loading") {
        return;
      }
      this.loadStatus = "loading";
      setTimeout(() => {
        this.query.current += 1;
        this.loadList();
      }, 100);
    },
    loadList() {
      const data = this.originList.slice(
        (this.query.current - 1) * this.query.size,
        this.query.current * this.query.size
      );
      this.list = this.list.concat(data);
      this.loadStatus = "loadmore";
      if (!data || data.length < this.query.size) {
        this.loadStatus = "nomore";
      }
    },
    search(value) {
      this.list = [];
      this.query.current = 1;
      if (value) {
        this.originList = this.alllist.filter((item) =>
          item.locNo.includes(value)
        );
      } else {
        this.originList = this.alllist;
      }
      this.loadList();
    },
    selectNo(no) {
      this.refreshLastPage(no);
    },
    onShow() {
            this.getlist();
        },
        methods: {
            //创建核销单
            openCreateWriteOffForm() {
                uni.navigateTo({
                    url: '/pages/wareHouse/nuclearScale/createwriteoffform'
                })
            },
            getmoreList() {
                if (this.pageSize >= this.total) {
                    this.status = "nomore";
                    return;
                }
                this.isLoading = true;
            this.status = "loading";
                setTimeout(() => {
                    this.pageSize += this.pageSize;
                    this.getlist();
                }, 1000);
            },
            getlist() {
                this.isLoading = true;
                this.$u.api.NuclearScaleEntry
                    .getWeighingOrder({
                        current: this.pageNum,
                        size: this.pageSize
                    })
                    .then((res) => {
                        this.handleListResponse(res);
                    })
                    .catch((err) => {
                        this.handleApiError(err);
                    })
                    .finally(() => {
                        this.isLoading = false;
                    });
            },
    //刷新上一个页面
    refreshLastPage(no) {
      // å‘ŠçŸ¥ A.vue æ›´æ–°æ•°æ®
      // èŽ·å–é¡µé¢æ ˆ
      let pages = getCurrentPages();
            getmoreList() {
                if (this.isLoading || this.pageSize >= this.total) {
                    return;
                }
                this.isLoading = true;
                this.status = "loading";
                setTimeout(() => {
                    this.pageSize += this.pageSize;
                    this.getlist();
                }, 500);
            },
      // èŽ·å–ä¸Šä¸€é¡µæ ˆ
      let prevPage = pages[pages.length - 2];
            // æœç´¢ç›¸å…³æ–¹æ³•
            search(value) {
                if (value) {
                    this.list = [];
                    this.pageSize = 10;
                    this.isLoading = true;
                    this.$u.api.NuclearScaleEntry
                        .getWeighingOrder({
                            current: this.pageNum,
                            size: this.pageSize,
                            verificationNo: value,
                        })
                        .then((res) => {
                            this.handleListResponse(res);
                        })
                        .catch((err) => {
                            this.handleApiError(err);
                        })
                        .finally(() => {
                            this.isLoading = false;
                        });
                } else {
                    this.getlist();
                }
            },
      // è§¦å‘上一页 upData å‡½æ•°(并携带参数)
      prevPage.$vm.setNo(no);
            // å·¥å…·æ–¹æ³•
            handleListResponse(res) {
                console.log('API Response:', res);
                console.log('Response Code:', res.code);
                console.log('Response Data:', res.data);
                console.log('Response Records:', res.data ? res.data.records : 'res.data is undefined');
      // è¿”回上一页
      uni.navigateBack({
        delta: 1,
      });
    },
    // æ–°å¢žæŒ‰é’®
    handleClick() {
      console.log("按钮被点击");
    },
  },
};
                if (res.code != 0) {
                    uni.showToast({
                        title: res.msg || '获取数据失败',
                        icon: 'none'
                    });
                    return;
                }
                if (!res.data) {
                    console.error('res.data is undefined');
                    uni.showToast({
                        title: '数据格式错误',
                        icon: 'none'
                    });
                    return;
                }
                this.list = res.data.records || [];
                this.total = res.data.total || 0;
                this.status = this.pageSize >= this.total ? "nomore" : "loadmore";
            },
            handleApiError(err) {
                console.error('API请求失败:', err);
                uni.showToast({
                    title: '网络异常,请稍后重试',
                    icon: 'none'
                });
            },
            formatProductType(type) {
                const productTypeMap = {
                    1: '导体',
                    2: '铜杆',
                    3: '导体2.6'
                };
                return productTypeMap[type] || type;
            },
            selectNo(no) {
                this.refreshLastPage(no);
            },
            //刷新上一个页面
            refreshLastPage(no) {
                // å‘ŠçŸ¥ A.vue æ›´æ–°æ•°æ®
                // èŽ·å–é¡µé¢æ ˆ
                let pages = getCurrentPages();
                // èŽ·å–ä¸Šä¸€é¡µæ ˆ
                let prevPage = pages[pages.length - 2];
                // è§¦å‘上一页 upData å‡½æ•°(并携带参数)
                prevPage.$vm.setNo(no);
                // è¿”回上一页
                uni.navigateBack({
                    delta: 1,
                });
            },
        },
    };
</script>
<style lang="scss" scoped>
.plus-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #007aff;
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  bottom: 40px;
  right: 10px;
  z-index: 100;
}
.plus-sign {
  color: white;
  font-size: 50px;
  position: relative;
  bottom: 4px;
    .plus-button {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background-color: #007aff;
        display: flex;
        justify-content: center;
        align-items: center;
        position: fixed;
        bottom: 40px;
        right: 10px;
        z-index: 100;
    }
}
.finishProductIn-locno-bg {
  background-color: #f6f9ff;
  background-image: url("~@/static/custom/finishProductIn/locNoBg.png");
  // background: linear-gradient(180deg,rgba(206,227,254,1),rgba(206,227,254,1) 20%,rgba(206,227,254,0.5) 40%,rgba(206,227,254,0.25) 60%,rgba(206,227,254,0.08) 80%,rgba(206,227,254,0));
  padding: 0 20rpx;
  background-attachment: fixed;
  background-size: 100% auto;
  background-repeat: no-repeat;
  position: fixed;
  top: 0;
  bottom: 0;
  width: 100%;
  z-index: -1;
}
    .plus-sign {
        color: white;
        font-size: 50px;
        position: relative;
        bottom: 4px;
.finishProductIn-locno-search {
  padding: 40rpx 30rpx 20rpx 30rpx;
}
    }
.wrap .finishProductIn-locno-scroll-list {
  height: calc(100vh - var(--window-top) - var(--window-bottom) - 242rpx);
  width: 100%;
}
    .finishProductIn-locno-bg {
        background-color: #f6f9ff;
        background-image: url("~@/static/custom/finishProductIn/locNoBg.png");
        // background: linear-gradient(180deg,rgba(206,227,254,1),rgba(206,227,254,1) 20%,rgba(206,227,254,0.5) 40%,rgba(206,227,254,0.25) 60%,rgba(206,227,254,0.08) 80%,rgba(206,227,254,0));
        padding: 0 20rpx;
        background-attachment: fixed;
        background-size: 100% auto;
        background-repeat: no-repeat;
        position: fixed;
        top: 0;
        bottom: 0;
        width: 100%;
        z-index: -1;
    }
.finishProductIn-locno-scroll-list-group {
  ::v-deep .u-cell-item-box {
    background-color: rgba(250, 252, 255, 0.36) !important;
    padding: 0rpx 30rpx;
  }
    .finishProductIn-locno-search {
        padding: 40rpx 30rpx 20rpx 30rpx;
    }
  .content {
    font-size: 12px;
    background-color: #ffffff;
    box-sizing: border-box;
    border-radius: 10rpx;
    margin: 0rpx 0rpx 16rpx;
    padding: 20rpx 8rpx;
    box-shadow: none;
    display: flex;
    align-items: center;
    .wrap .finishProductIn-locno-scroll-list {
        height: calc(100vh - var(--window-top, 0) - var(--window-bottom, 0) - 242rpx);
        width: 100%;
        min-height: 300rpx; /* æ·»åŠ æœ€å°é«˜åº¦ç¡®ä¿å…ƒç´ å§‹ç»ˆå¯è§ */
    }
    .content-header {
      width: 40rpx;
      height: 90rpx;
      display: flex;
      align-items: center;
    .finishProductIn-locno-scroll-list-group {
        ::v-deep .u-cell-item-box {
            background-color: rgba(250, 252, 255, 0.36) !important;
            padding: 0rpx 30rpx;
        }
      .content-header-icon {
        background-image: url("~@/static/custom/moveWareHouse/header_icon.png");
        background-size: 100% auto;
        background-repeat: no-repeat;
        height: 28rpx;
        width: 28rpx;
      }
        .content {
            font-size: 12px;
            background-color: #ffffff;
            box-sizing: border-box;
            border-radius: 10rpx;
            margin: 0rpx 0rpx 16rpx;
            padding: 20rpx 8rpx;
            box-shadow: none;
            display: flex;
            align-items: center;
      .content-header-title {
        margin-left: 11rpx;
        font-size: 26rpx;
        font-weight: bold;
        color: #3d52f5;
      }
    }
            .content-header {
                width: 40rpx;
                height: 90rpx;
                display: flex;
                align-items: center;
    .content-body {
      flex: 1;
      background: #f5f9ff;
      border-radius: 10rpx;
      padding: 0rpx 23rpx;
                .content-header-icon {
                    background-image: url("~@/static/custom/moveWareHouse/header_icon.png");
                    background-size: 100% auto;
                    background-repeat: no-repeat;
                    height: 28rpx;
                    width: 28rpx;
                }
      .row-list {
        height: 60rpx;
        display: flex;
        flex-direction: row;
        padding: 0px;
        align-items: center;
      }
                .content-header-title {
                    margin-left: 11rpx;
                    font-size: 26rpx;
                    font-weight: bold;
                    color: #3d52f5;
                }
            }
      .row-list ._label {
        display: flex;
        flex: 0.8;
        color: #909399;
        align-items: center;
            .content-body {
                flex: 1;
                background: #f5f9ff;
                border-radius: 10rpx;
                padding: 0rpx 23rpx;
        ._label-icon-1 {
          background-image: url("~@/static/custom/moveWareHouse/label-icon-1.png");
          background-size: 100% auto;
          background-repeat: no-repeat;
          height: 26rpx;
          width: 26rpx;
        }
                .row-list {
                    height: 60rpx;
                    display: flex;
                    flex-direction: row;
                    padding: 0px;
                    align-items: center;
                }
        ._label-icon-2 {
          background-image: url("~@/static/custom/moveWareHouse/label-icon-2.png");
          background-size: 100% auto;
          background-repeat: no-repeat;
          height: 26rpx;
          width: 26rpx;
        }
                .row-list ._label {
                    display: flex;
                    flex: 0.8;
                    color: #909399;
                    align-items: center;
        ._label-icon-3 {
          background-image: url("~@/static/custom/moveWareHouse/label-icon-3.png");
          background-size: 100% auto;
          background-repeat: no-repeat;
          height: 26rpx;
          width: 26rpx;
        }
                    ._label-icon-1 {
                        background-image: url("~@/static/custom/moveWareHouse/label-icon-1.png");
                        background-size: 100% auto;
                        background-repeat: no-repeat;
                        height: 26rpx;
                        width: 26rpx;
                    }
        ._label-name {
          margin-left: 11rpx;
          font-size: 26rpx;
          font-weight: 500;
          color: #666666;
        }
      }
                    ._label-icon-2 {
                        background-image: url("~@/static/custom/moveWareHouse/label-icon-2.png");
                        background-size: 100% auto;
                        background-repeat: no-repeat;
                        height: 26rpx;
                        width: 26rpx;
                    }
      .row-list ._content {
        flex: 1.5;
        text-align: right;
        color: #909399;
        font-size: 24rpx;
      }
                    ._label-icon-3 {
                        background-image: url("~@/static/custom/moveWareHouse/label-icon-3.png");
                        background-size: 100% auto;
                        background-repeat: no-repeat;
                        height: 26rpx;
                        width: 26rpx;
                    }
      .row-list .s1 {
        color: #d35651;
      }
    }
  }
}
</style>
                    ._label-name {
                        margin-left: 11rpx;
                        font-size: 26rpx;
                        font-weight: 500;
                        color: #666666;
                    }
                }
                .row-list ._content {
                    flex: 1.5;
                    text-align: right;
                    color: #909399;
                    font-size: 24rpx;
                }
                .row-list .s1 {
                    color: #d35651;
                }
            }
        }
    }
</style>
pages/wareHouse/nuclearScale/nuclearscalerecord.vue
@@ -1,600 +1,731 @@
<template>
  <view class="page">
    <view class="finishProductIn-locno-bg" />
    <u-navbar title="核磅记录" :background="background" :border-bottom="false" :title-bold="true" title-color="#000"
      back-icon-color="#000">
      <view class="navbar-right" slot="right" @click="goPrintAll">
        å…¨éƒ¨æ‰“印
      </view>
    </u-navbar>
    <view class="wrap">
      <scroll-view class="finishProductIn-locno-scroll-list" scroll-y="true" @scrolltolower="loadMore">
        <u-cell-group class="finishProductIn-locno-scroll-list-group" :border="false">
          <view class="content" v-for="(item, index) in list" :key="item.locNo" :index="index" @click="selectNo(item)">
            <view class="content-header">
              <view class="content-header-title">{{ index + 1 }}</view>
            </view>
            <view class="content-body">
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-1"> </view>
                  <view class="_label-name">批次号:</view>
                </view>
                <view class="_content">
                  {{ item.value0 }}
                </view>
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-2"> </view>
                  <view class="_label-name">产品描述:</view>
                </view>
                <view class="_content">
                  {{ item.value1 }}
                </view>
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-3"> </view>
                  <view class="_label-name">零件号:</view>
                </view>
                <view class="_content">
                  {{ item.value2 }}
                </view>
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-1"> </view>
                  <view class="_label-name">毛重:</view>
                </view>
                <view class="_content">
                  {{ item.value3 }}
                </view>
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-2"> </view>
                  <view class="_label-name">盘重:</view>
                </view>
                <view class="_content">
                  {{ item.value4 }}
                </view>
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-3"> </view>
                  <view class="_label-name">净重:</view>
                </view>
                <view class="_content">
                  {{ item.value5 }}
                </view>
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-1"> </view>
                  <view class="_label-name">核磅重量:</view>
                </view>
                <view class="_content">
                  {{ item.value6 }}
                </view>
              </view>
              <view class="row-list">
                <view class="_label">
                  <view class="_label-icon-2"> </view>
                  <view class="_label-name">叉车盘重:</view>
                </view>
                <view class="_content">
                  {{ item.value7 }}
                </view>
              </view>
            </view>
          </view>
        </u-cell-group>
        <view class="loadmore" @click="loadMore">
          <u-loadmore :status="loadStatus"></u-loadmore>
        </view>
      </scroll-view>
    </view>
    <u-toast ref="uToast" />
    <view v-if="maskShow" class="uni-mask" @touchmove.stop.prevent="moveHandle" @click="maskclose">
      <scroll-view class="uni-scroll_box" scroll-y @touchmove.stop.prevent="moveHandle" @click.stop="moveHandle">
        <view class="uni-list-box" v-for="(item, index) in listDevice" :key="index" @click="tapQuery(item)">
          <view>
            <view class="uni-list_name">名称:{{ item.name }}</view>
            <view class="uni-list_item">UUID:{{ item.address }}</view>
          </view>
        </view>
      </scroll-view>
    </view>
  </view>
    <view class="page">
        <view class="finishProductIn-locno-bg" />
        <u-navbar title="核磅记录" :background="background" :border-bottom="false" :title-bold="true" title-color="#000"
            back-icon-color="#000">
            <view class="navbar-right" slot="right" @click="goPrintAll">
                å…¨éƒ¨æ‰“印
            </view>
        </u-navbar>
        <view class="wrap">
            <scroll-view class="finishProductIn-locno-scroll-list" scroll-y="true" @scrolltolower="getmoreList()">
                <u-cell-group class="finishProductIn-locno-scroll-list-group" :border="false">
                    <view class="content" v-for="(item, index) in list" :key="item.locNo" :index="index"
                        @click="selectNo(item)">
                        <view class="content-header">
                            <view class="content-header-title">{{ index + 1 }}</view>
                        </view>
                        <view class="content-body">
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-icon-1"> </view>
                                    <view class="_label-name">批次号:</view>
                                </view>
                                <view class="_content">
                                    {{ item.outBatchNo }}
                                </view>
                            </view>
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-icon-2"> </view>
                                    <view class="_label-name">产品描述:</view>
                                </view>
                                <view class="_content">
                                    {{ item.netWeight }}
                                </view>
                            </view>
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-icon-3"> </view>
                                    <view class="_label-name">零件号:</view>
                                </view>
                                <view class="_content">
                                    {{ item.partNo }}
                                </view>
                            </view>
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-icon-1"> </view>
                                    <view class="_label-name">毛重:</view>
                                </view>
                                <view class="_content">
                                    {{ item.grossWeight }}
                                </view>
                            </view>
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-icon-2"> </view>
                                    <view class="_label-name">盘重:</view>
                                </view>
                                <view class="_content">
                                    {{ item.trayWeight }}
                                </view>
                            </view>
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-icon-3"> </view>
                                    <view class="_label-name">净重:</view>
                                </view>
                                <view class="_content">
                                    {{ item.value5 }}
                                </view>
                            </view>
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-icon-1"> </view>
                                    <view class="_label-name">核磅重量:</view>
                                </view>
                                <view class="_content">
                                    {{ item.netWeight }}
                                </view>
                            </view>
                            <view class="row-list">
                                <view class="_label">
                                    <view class="_label-icon-2"> </view>
                                    <view class="_label-name">叉车盘重:</view>
                                </view>
                                <view class="_content">
                                    {{ item.value7 }}
                                </view>
                            </view>
                        </view>
                    </view>
                </u-cell-group>
                <view class="loadmore" @click="getmoreList()">
                    <u-loadmore :status="status" :load-text="loadText" @loadmore="getmoreList()" />
                </view>
            </scroll-view>
        </view>
        <u-toast ref="uToast" />
        <u-modal v-model="maskShow" title="" v-for="(item, index) in listDevice" :key="index"
            :show-confirm-button="true" @confirm="tapQuery(item)">
            <view class="packing-registration-param-view" @touchmove.stop.prevent="moveHandle" @click="maskclose">
                <scroll-view class="uni-scroll_box" scroll-y @touchmove.stop.prevent="moveHandle"
                    @click.stop="moveHandle">
                    <view class="packing-registration-param-item param-extra">
                        <view class="packing-registration-param-item-left">
                            <text class="item-one">名称:</text>
                        </view>
                        <view class="packing-registration-param-item-right">
                            <text class="item-one">{{ item.name }}</text>
                        </view>
                    </view>
                    <view class="packing-registration-param-item param-extra">
                        <view class="packing-registration-param-item-left">
                            <text class="item-one">UUID:</text>
                        </view>
                        <view class="packing-registration-param-item-right">
                            <text class="item-one">{{ item.address }}</text>
                        </view>
                    </view>
                </scroll-view>
            </view>
        </u-modal>
    </view>
</template>
<script>
import content_bg from '@/static/custom/finishProductIn/locNoBg.png'
const jcapi = uni.requireNativePlugin("JCSDK-JCApiModule");
    import content_bg from '@/static/custom/finishProductIn/locNoBg.png'
    const jcapi = uni.requireNativePlugin("JCSDK-JCApiModule");
// äºŒç»´ç ç±»åž‹
const QrCodeType = {
  QrCode: 31,
  PDF417: 32,
  DataMatrix: 33,
  AZTEC: 34
}
// çº¿æ¡ç±»åž‹
const LineType = {
  Solid: 1, // å®žçº¿
  Dotted: 2, // è™šçº¿ï¼ˆé»˜è®¤è™šå®ž1:1相间)
}
// æ¢è¡Œæ–¹å¼
const LineModeType = {
  Justified: 1, // å®½é«˜å›ºå®šï¼Œå†…容自适应(字号/字间距/行间距按比例缩放)
  AutoHeight: 2, // å®½åº¦å›ºå®šï¼Œé«˜åº¦è‡ªé€‚应
  Fixed: 4, // å®½é«˜å›ºå®šï¼Œè¶…出部分裁剪
  Adapt: 6, // å®½é«˜å›ºå®šï¼Œå†…容超过时预设宽高自动缩小
}
export default {
  data() {
    return {
      background: {
        backgroundImage: `url(${content_bg})`,
        backgroundAttachment: 'fixed',
        backgroundSize: '100% auto',
        backgroundRepeat: 'no-repeat',
      },
      keywords: '',
      alllist: [],
      originList: [],
      query: {
        current: 1,
        size: 10
      },
      list: [
        {
          value0: '123456789',
          value1: '123456789',
          value2: '123456789',
          value3: '123456789',
          value4: '123456789',
          value5: '123456789',
          value6: '123456789',
          value7: '123456789'
        },
        {
          value0: '123456789',
          value1: '123456789',
          value2: '123456789',
          value3: '123456789',
          value4: '123456789',
          value5: '123456789',
          value6: '123456789',
          value7: '123456789'
        }
      ],
      count: 0,
      loadStatus: 'loading',
      maskShow: false,
      listDevice: [], //蓝牙设备数据
      pritList: []
    };
  },
  onLoad() {
    this.$u.api.finishProductIn.fetchList().then(res => {
      this.alllist = res.data
      this.originList = res.data
      this.loadList()
    })
    // åˆå§‹åŒ–SDK
    jcapi.initSDK()
    // ç›‘听页码回调
    jcapi.didReadPrintCountInfo(function (r) {
      console.log(r)
    })
    // äºŒç»´ç ç±»åž‹
    const QrCodeType = {
        QrCode: 31,
        PDF417: 32,
        DataMatrix: 33,
        AZTEC: 34
    }
    // çº¿æ¡ç±»åž‹
    const LineType = {
        Solid: 1, // å®žçº¿
        Dotted: 2, // è™šçº¿ï¼ˆé»˜è®¤è™šå®ž1:1相间)
    }
    // æ¢è¡Œæ–¹å¼
    const LineModeType = {
        Justified: 1, // å®½é«˜å›ºå®šï¼Œå†…容自适应(字号/字间距/行间距按比例缩放)
        AutoHeight: 2, // å®½åº¦å›ºå®šï¼Œé«˜åº¦è‡ªé€‚应
        Fixed: 4, // å®½é«˜å›ºå®šï¼Œè¶…出部分裁剪
        Adapt: 6, // å®½é«˜å›ºå®šï¼Œå†…容超过时预设宽高自动缩小
    }
    export default {
        data() {
            return {
                background: {
                    backgroundImage: `url(${content_bg})`,
                    backgroundAttachment: 'fixed',
                    backgroundSize: '100% auto',
                    backgroundRepeat: 'no-repeat',
                },
                keywords: '',
                list: [],
                total: 0,
                pageNum: 1,
                pageSize: 10,
                status: 'loading',
                loadText: {
                    loadmore: "加载更多...",
                    loading: "努力加载中...",
                    nomore: "没有更多了",
                },
                maskShow: false,
                listDevice: [], //蓝牙设备数据
                pritList: [],
                printDensity: 3, // é»˜è®¤æ‰“印浓度
                labelType: 1, // é»˜è®¤æ ‡ç­¾ç±»åž‹ *
                // 1:间隙纸
                // 2:黑标纸
                // 3:连续纸
                // 4:定孔纸
                // 5:透明纸
                printMode: 2, // é»˜è®¤æ‰“印模式
                //    1:热敏
                //     2:热转印
                connectedDevice: null // å·²è¿žæŽ¥çš„æ‰“印机
            };
        },
        onLoad() {
            this.getlist()
            // åˆå§‹åŒ–SDK
            jcapi.initSDK()
            // ç›‘听页码回调
            jcapi.didReadPrintCountInfo(function(r) {
                console.log(r)
            })
    // ç›‘听错误回调
    jcapi.didReadPrintErrorInfo(function (r) {
      console.log(r)
      if (r.code == 23) {
        // æ‰“印机断开连接
        _this.connectedDevice = null
      }
      uni.showToast({
        icon: 'none',
        title: JSON.stringify(r),
        duration: 2 * 1000
      })
    })
  },
  methods: {
    loadMore() {
      if (this.loadStatus == "nomore" || this.loadStatus == "loading") {
        return
      }
      this.loadStatus = "loading";
      setTimeout(() => {
        this.query.current += 1;
        this.loadList();
      }, 100);
    },
    loadList() {
      const data = this.originList.slice((this.query.current - 1) * this.query.size, this.query.current * this.query.size)
      this.list = this.list.concat(data);
      this.loadStatus = "loadmore";
      if (!data || data.length < this.query.size) {
        this.loadStatus = "nomore";
      }
    },
    search(value) {
      this.list = [];
      this.query.current = 1;
      if (value) {
        this.originList = this.alllist.filter(item => item.locNo.includes(value))
      } else {
        this.originList = this.alllist
      }
      this.loadList()
    },
    // æ‰“印单个信息
    selectNo(item) {
      let that = this
      uni.showModal({
        title: '提示',
        content: '是否打印装箱单?',
        showCancel: true,
        success: function (res) {
          if (res.confirm) {
            that.searchDevice()
            that.pritList = [item]
          }
        }
      });
    },
    // æ‰“印全部信息
    goPrintAll() {
      let that = this
      uni.showModal({
        title: '提示',
        content: '是否打印装箱单?',
        showCancel: true,
        success: function (res) {
          if (res.confirm) {
            that.searchDevice()
            that.pritList = this.list
          }
        }
      });
    },
    moveHandle() {
            // ç›‘听错误回调
            jcapi.didReadPrintErrorInfo((r) => {
                console.log(r)
                if (r.code == 23) {
                    // æ‰“印机断开连接
                    this.connectedDevice = null
                    uni.showToast({
                        icon: 'none',
                        title: '打印机连接已断开,请重新连接',
                        duration: 2 * 1000
                    })
                } else {
                    uni.showToast({
                        icon: 'none',
                        title: JSON.stringify(r),
                        duration: 2 * 1000
                    })
                }
            })
        },
        methods: {
            getmoreList() {
                if (this.pageSize >= this.total) {
                    this.status = "nomore";
                    return;
                }
                this.status = "loading";
                setTimeout(() => {
                    this.pageSize += this.pageSize;
                    this.getlist();
                }, 1000);
            },
            getlist() {
                this.$u.api.workReporting
                    .getWorkshopOrder({
                        current: this.pageNum,
                        size: this.pageSize
                    })
                    .then((res) => {
                        this.list = res.data.records;
                        this.total = res.data.total;
                        if (this.pageSize >= this.total) {
                            this.status = "nomore";
                        } else {
                            this.status = "loadmore";
                        }
                    });
            },
            search(value) {
                if (value) {
                    this.list = [];
                    this.pageSize = 10;
                    this.$u.api.workReporting
                        .getWorkshopOrder({
                            current: this.pageNum,
                            size: this.pageSize,
                            moNo: value,
                        })
                        .then((res) => {
                            this.list = res.data.records;
                            this.total = res.data.total;
                            if (this.pageSize >= this.total) {
                                this.status = "nomore";
                            } else {
                                this.status = "loadmore";
                            }
                        });
                } else {
                    this.getlist();
                }
            },
            // æ‰“印单个信息
            // æ£€æŸ¥è“ç‰™è¿žæŽ¥çŠ¶æ€
            async checkBluetoothConnection() {
                if (!this.connectedDevice) return false;
                // å°è¯•发送一个简单命令检查连接状态
                return new Promise(resolve => {
                    jcapi.checkPrinterStatus(this.connectedDevice.address, r => {
                        if (r && r.code === 0) {
                            resolve(true);
                        } else {
                            // è¿žæŽ¥å·²æ–­å¼€
                            this.connectedDevice = null;
                            resolve(false);
                        }
                    });
                });
            },
    },
    maskclose() {
            selectNo(item) {
                let that = this
                uni.showModal({
                    title: '提示',
                    content: '是否打印装箱单?',
                    showCancel: true,
                    success: async function(res) {
                        if (res.confirm) {
                            // æ£€æŸ¥è“ç‰™è¿žæŽ¥çŠ¶æ€
                            const isConnected = await that.checkBluetoothConnection();
                            if (isConnected) {
                                // å·²è¿žæŽ¥ï¼Œç›´æŽ¥æ‰“印
                                that.pritList = [item]
                                that.pritList.forEach(async item => {
                                    await that.printQrCode(item)
                                })
                            } else {
                                // æœªè¿žæŽ¥æˆ–连接已断开,搜索设备
                                that.searchDevice()
                                that.pritList = [item]
                            }
                        }
                    }
                });
            },
            // æ‰“印全部信息
            goPrintAll() {
                let that = this
                uni.showModal({
                    title: '提示',
                    content: '是否打印装箱单?',
                    showCancel: true,
                    success: async function(res) {
                        if (res.confirm) {
                            // æ£€æŸ¥è“ç‰™è¿žæŽ¥çŠ¶æ€
                            const isConnected = await that.checkBluetoothConnection();
                            if (isConnected) {
                                // å·²è¿žæŽ¥ï¼Œç›´æŽ¥æ‰“印
                                that.pritList = that.list
                                that.pritList.forEach(async item => {
                                    await that.printQrCode(item)
                                })
                            } else {
                                // æœªè¿žæŽ¥æˆ–连接已断开,搜索设备
                                that.searchDevice()
                                that.pritList = that.list
                            }
                        }
                    }
                });
            },
            moveHandle() {
    },
    //打印二维码
    async printQrCode(item) {
      const params = {
        rwMatlBindId: item.id
      }
      let res = await this.$u.api.dailyPaper.zongjianLabelInfo(params)
      if (!res.data) {
        this.$refs.uToast.show({
          title: '未查询到该标签信息!',
          type: 'warning '
        })
        return
      }
      // åˆå§‹åŒ–画板
      jcapi.initDrawingBoard({
        width: 50,
        height: 100,
        rotate: 0
      });
            },
            maskclose() {
      // // ç»˜åˆ¶äºŒç»´ç 
      jcapi.drawLabelQrCode({
        x: 14.5,
        y: 74,
        width: 20,
        height: 20,
        value: jsonString,
        rotate: 0,
        codeType: QrCodeType.QrCode,
      });
      // ç»˜åˆ¶æ¨ªçº¿ å®žçº¿8条
      let sum = 4;
      for (let i = 1; i < 13; i++) {
        this.getDrawLabelLine(4, sum, 46, 0.5, 0, LineType.Solid) // å®žçº¿
        sum = (i * 6) + 4
      }
      // äºŒç»´ç å¤§æ¡†
      this.getDrawLabelLine(4, 97, 46, 0.5, 0, LineType.Solid) // å®žçº¿9
            },
            //打印二维码
            async printQrCode(item) {
                console.log('item de shuju ', item)
                const params = {
                    rwMatlBindId: item.id
                };
                try {
                let res = await this.$u.api.dailyPaper.zongjianLabelInfo(params)
                if (!res.data) {
                    this.$refs.uToast.show({
                        title: '未查询到该标签信息!',
                        type: 'warning '
                    })
                    return
                }
                // const res = {
                //     ht: 'HT20250717995352665',
                //     lj: '88.118.1/A0611091',
                //     ljms: '铜单线 è£¸é“œ-TY-圆形-3.0',
                //     fh: '1083.6',
                //     scdt: '2025-07-14 13:46:55.0',
                //     scph: '2025071273-3',
                //     fhdw: '江东合金技术有限公司',
                //     shdw: '昆山泰德通铜业有限公司',
                // }
                // ä»ŽAPI响应中提取所需数据
                const {
                    ht,
                    lj,
                    ljms,
                    fh,
                    scdt,
                    scph,
                    fhdw,
                    shdw
                } = res.data
                // const jsonString = JSON.stringify(res.data)
      //绘制竖线
      this.getDrawLabelLine(4, 4, 0.5, 97, 0, LineType.Solid) // ç«–线1
      this.getDrawLabelLine(20, 4, 0.5, 66, 0, LineType.Solid) // ç«–线2
      this.getDrawLabelLine(44.5, 4, 0.5, 97, 0, LineType.Solid) // ç«–线2
                // åˆå§‹åŒ–画板
                jcapi.initDrawingBoard({
                    width: 70,
                    height: 49,
                    rotate: 90
                });
      // å¡«å†²æ–‡å­—标题
      this.getDrawLabelText(5, 5, 20, 20, '编 å·:', 3.6, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
      this.getDrawLabelText(5, 11, 20, 20, '工单号:', 3.6, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
      this.getDrawLabelText(5, 17, 20, 20, '牌 å·:', 3.6, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
      this.getDrawLabelText(5, 23, 20, 20, '片宽(mm):', 3.6, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
      this.getDrawLabelText(5, 29, 20, 20, '厚度(mm):', 3.6, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
      this.getDrawLabelText(5, 35, 20, 20, '重量(KG):', 3.6, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
      this.getDrawLabelText(5, 41, 20, 20, '长度(m):', 3.6, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
      this.getDrawLabelText(5, 47, 20, 20, '生产人:', 3.6, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
      this.getDrawLabelText(5, 53, 20, 20, '生产时间:', 3.4, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
      this.getDrawLabelText(5, 59, 20, 20, '厂家:', 3.4, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
      this.getDrawLabelText(5, 65, 20, 20, '铁损:', 3.4, 0, LineModeType.AutoHeight, 0, 0, 0, 1)
                // ç»˜åˆ¶äºŒç»´ç 
                const qrContent =
                    `ht:${ht}\nlj:${lj}\nljms:${ljms}\nfh:${fh}\nscdt:${scdt}\nscph:${scph}\nfhdw:${fhdw}\nshdw:${shdw}`;
                jcapi.drawLabelQrCode({
                    x: 43.5,
                    y: 2,
                    width: 24,
                    height: 24,
                    value: qrContent,
                    rotate: 0,
                    codeType: QrCodeType.QrCode,
                });
                // getDrawLabelLine    ï¼ˆx坐标,y坐标,线条宽度,线条高度,旋转角度,线条类型)
                // ç»˜åˆ¶æ¨ªçº¿ å®žçº¿8条
                this.getDrawLabelLine(1, 1, 67, 0.5, 0, LineType.Solid)
                this.getDrawLabelLine(1, 6, 42, 0.3, 0, LineType.Solid)
                this.getDrawLabelLine(1, 11, 42, 0.3, 0, LineType.Solid)
                this.getDrawLabelLine(1, 16, 42, 0.3, 0, LineType.Solid)
                this.getDrawLabelLine(1, 21, 42, 0.3, 0, LineType.Solid)
                this.getDrawLabelLine(1, 27, 67, 0.3, 0, LineType.Solid)
                this.getDrawLabelLine(1, 32, 67,0.3, 0, LineType.Solid)
                this.getDrawLabelLine(1, 37, 67, 0.3, 0, LineType.Solid)
                this.getDrawLabelLine(1, 42, 67, 0.3, 0, LineType.Solid)
                this.getDrawLabelLine(1, 47, 67, 0.5, 0, LineType.Solid)
                //绘制竖线
                this.getDrawLabelLine(1, 1, 0.5, 46, 0, LineType.Solid) // ç«–线1
                this.getDrawLabelLine(43, 1, 0.3, 26, 0, LineType.Solid) // ç«–线2
                this.getDrawLabelLine(68, 1, 0.5, 46, 0, LineType.Solid) // ç«–线2
                // getDrawLabelText    ï¼ˆ1.x坐标,2.y坐标,3.文本框宽度,4.文本框高度,5.绘制文字内容,6.字体大小(默认高度4mm),7.旋转角度,8.换行方式,9.⾏间隔,10.字间隔,11.文字水平布局,12文字垂直布局)
                // æ ‡é¢˜
                this.getDrawLabelText(3, 2.5, 40, 8, '中天科技装箱清单', 2.5, 0, LineModeType.AutoHeight, 0, 0, 1, 1,1)
                // å¡«å†²æ–‡å­—标题
                this.getDrawLabelText(2, 7, 25, 8, '合同号:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
                this.getDrawLabelText(2, 12, 25, 8, '零件号:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
                this.getDrawLabelText(2, 17, 25, 8, '零件描述:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
                this.getDrawLabelText(2, 22.5, 25, 8, '发货/装箱数:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
                this.getDrawLabelText(2, 27.5, 25, 8, '生产日期:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
                this.getDrawLabelText(2, 32.5, 25, 8, '生产批号:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
                this.getDrawLabelText(2, 37.5, 25, 8, '发货单位:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
                this.getDrawLabelText(2, 42.5, 25, 8, '收货单位:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
                // å¡«å†²å‚数值
                this.getDrawLabelText(11, 7, 30, 8, ht, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
                this.getDrawLabelText(11, 12, 32, 8, lj, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
                this.getDrawLabelText(14, 17, 30, 8, ljms, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
                this.getDrawLabelText(17, 22.5, 27, 8, fh, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
                this.getDrawLabelText(14, 27.5, 55, 8, scdt, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
                this.getDrawLabelText(14, 32.5, 55, 8, scph, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
                this.getDrawLabelText(14, 37.5,55, 8, fhdw, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
                this.getDrawLabelText(14, 42.5, 55, 8, shdw, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
      // // å¡«å†²å‚数值
      this.getDrawLabelText(22, 5, 35, 12, labelNo, 3, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
      this.getDrawLabelText(22, 11, 35, 12, optaskNo, 3, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
      this.getDrawLabelText(22, 17, 35, 12, grade, 3, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
      this.getDrawLabelText(22, 23, 35, 12, sliceWidth, 3, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
      this.getDrawLabelText(22, 29, 35, 12, thickness, 3, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
      this.getDrawLabelText(22, 35, 35, 12, wweight, 3, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
      this.getDrawLabelText(22, 41, 35, 12, llength, 3, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
      this.getDrawLabelText(22, 47, 35, 12, reportName, 2, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
      this.getDrawLabelText(22, 53, 35, 12, reportTime, 3, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
      this.getDrawLabelText(22, 59, 35, 12, supplierVenderName, 3, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
      this.getDrawLabelText(22, 65, 35, 12, ironLoss, 3, 0, LineModeType.AutoHeight, 0, 0, 0, 0)
                // ç”Ÿæˆæ‰“印数据
                let imageJsonObj = jcapi.generateLabelJson()
                let imageJsonObj111 = jcapi.generatePrintPreviewImage(imageJsonObj)
                console.log('预览', imageJsonObj111)
                // // è®¾ç½®æ‰“印任务
                jcapi.startJob({
                    totalCount: 1,
                    density: this.printDensity,
                    labelType: this.labelType,
                    printMode: this.printMode,
                }, function(r) {
                    console.log('打印', r)
                    if (r.code == 0) {
                        // æ‰“印数据
                        jcapi.printData(imageJsonObj, {
                            "printQuantity": 1,
                        }, function(r) {
                            if (r.code == 0) {
                                console.log("打印成功")
                                uni.showToast({
                                    title: '打印成功',
                                    icon: 'success'
                                })
                            } else {
                                console.log("打印失败")
                                uni.showToast({
                                    title: '打印失败: ' + (r.msg || '未知错误'),
                                    icon: 'none'
                                })
                            }
                        })
                    } else {
                        console.log("设置打印任务失败")
                    }
      // ç”Ÿæˆæ‰“印数据
      let imageJsonObj = jcapi.generateLabelJson()
      // è®¾ç½®æ‰“印任务
      jcapi.startJob({
        totalCount: 1,
        density: this.printDensity,
        labelType: this.labelType,
        printMode: this.printMode,
      }, function (r) {
        if (r.code == 0) {
          // æ‰“印数据
          jcapi.printData(imageJsonObj, {
            "printQuantity": 1,
          }, function (r) {
            if (r.code == 0) {
              console.log("打印成功")
            } else {
              console.log("打印失败")
            }
          })
        } else {
          console.log("设置打印任务失败")
        }
      })
    },
    tapQuery(item) {
      this.maskShow = false
      // è¿žæŽ¥æ‰“印机
      let _this = this;
      console.log(item)
      jcapi.openPrinterByDevice({
        address: item.address,
        name: item.name,
        deviceType: item.deviceType // è®¾å¤‡ç±»åž‹ï¼š0-蓝牙,1-网络
      }, function (r) {
        uni.showToast({
          title: (r.code == 0) ? "连接成功" : "连接失败",
          duration: 2 * 1000
        })
        if (r.code == 0) {
          _this.connectedDevice = item
          // ç»˜æ ‡ç­¾è¿›è¡Œæ‰“印
          _this.pritList.forEac(async item => {
            await _this.printQrCode(item)
          })
        }
      })
    },
    //打印相关
    searchDevice() {
      let _this = this
      uni.openBluetoothAdapter({ // ç¡®è®¤è“ç‰™æ˜¯å¦æ‰“å¼€
        success(r) {
          uni.showLoading({
            title: "搜索中..."
          })
          // æœªæŽˆäºˆè“ç‰™ç›¸å…³æƒé™å’Œæœªæ‰“开手机定位会搜索不到设备
          jcapi.getBluetoothDevices(function (r) {
            console.log("device:" + JSON.stringify(r))
            // æœç´¢åˆ°è®¾å¤‡å›žè°ƒ
            uni.hideLoading()
            _this.listDevice = r;
            _this.maskShow = true
          })
        },
        fail(e) {
          uni.showModal({
            confirmText: "打开蓝牙失败"
          })
          console.log("开启蓝牙设备失败" + e)
        }
      })
    },
    // ç»˜åˆ¶æ¨ªçº¿ å®žçº¿
    getDrawLabelLine(x, y, width, height, rotate, lineType) {
      jcapi.drawLabelLine({
        x: x,
        y: y,
        width: width,
        height: height,
        rotate: rotate,
        lineType: lineType
      });
    },
    // å¡«å†²æ–‡å­—标题
    getDrawLabelText(x, y, width, height, value, fontSize, rotate, lineMode, lineSpace, letterSpace, textAlignHorizontal, textAlignVertical) {
      jcapi.drawLabelText({
        x: x,
        y: y,
        width: width,
        height: height,
        value: value,
        fontSize: fontSize,
        rotate: rotate,
        lineMode: lineMode,
        lineSpace: lineSpace,
        letterSpace: letterSpace,
        textAlignHorizontal: textAlignHorizontal,
        textAlignVertical: textAlignVertical
      })
    },
                })
    //刷新上一个页面
    refreshLastPage(no) {
      // å‘ŠçŸ¥ A.vue æ›´æ–°æ•°æ®
      // èŽ·å–é¡µé¢æ ˆ
      let pages = getCurrentPages()
            },
            tapQuery(item) {
                this.maskShow = false
                // è¿žæŽ¥æ‰“印机
                let _this = this;
                console.log(item)
                jcapi.openPrinterByDevice({
                    address: item.address,
                    name: item.name,
                    deviceType: 0 // è®¾å¤‡ç±»åž‹ï¼š0-蓝牙,1-网络
                }, function(r) {
                    uni.showToast({
                        title: (r.code == 0) ? "连接成功" : "连接失败",
                        duration: 2 * 1000
                    })
                    if (r.code == 0) {
                        _this.connectedDevice = item
                        // æ·»åŠ æ‰“å°åˆ—è¡¨ç©ºå€¼æ£€æŸ¥
                        if (!_this.pritList || _this.pritList.length === 0) {
                            uni.showToast({
                                title: '没有可打印的数据',
                                icon: 'none'
                            })
                            return
                        }
                        // ç»˜æ ‡ç­¾è¿›è¡Œæ‰“印
                        _this.pritList.forEach(async item => {
                            await _this.printQrCode(item)
                        })
                    }
                })
            },
            //打印相关
            searchDevice() {
                let _this = this
                uni.openBluetoothAdapter({ // ç¡®è®¤è“ç‰™æ˜¯å¦æ‰“å¼€
                    success(r) {
                        uni.showLoading({
                            title: "搜索中..."
                        })
                        // æœªæŽˆäºˆè“ç‰™ç›¸å…³æƒé™å’Œæœªæ‰“开手机定位会搜索不到设备
                        jcapi.getBluetoothDevices(function(r) {
                            console.log("device:" + JSON.stringify(r))
                            // æœç´¢åˆ°è®¾å¤‡å›žè°ƒ
                            uni.hideLoading()
                            // å¦‚果之前有连接的设备但不在搜索结果中,说明设备已更换
                            if (_this.connectedDevice && !r.some(dev => dev.address === _this.connectedDevice.address)) {
                                _this.connectedDevice = null;
                                uni.showToast({
                                    icon: 'none',
                                    title: '已连接的蓝牙设备已更换,请重新选择',
                                    duration: 2000
                                });
                            }
                            _this.listDevice = r;
                            _this.maskShow = true
                        })
                    },
                    fail(e) {
                        uni.showModal({
                            title: '提示',
                            content: '打开蓝牙失败,请检查蓝牙是否开启',
                            showCancel: false
                        })
                        console.log("开启蓝牙设备失败" + e)
                    }
                })
            },
            // ç»˜åˆ¶æ¨ªçº¿ å®žçº¿
            getDrawLabelLine(x, y, width, height, rotate, lineType) {
                jcapi.drawLabelLine({
                    x: x,
                    y: y,
                    width: width,
                    height: height,
                    rotate: rotate,
                    lineType: lineType
                });
            },
            // å¡«å†²æ–‡å­—标题
            getDrawLabelText(x, y, width, height, value, fontSize, rotate, lineMode, lineSpace, letterSpace,
                textAlignHorizontal, textAlignVertical,bold) {
      // èŽ·å–ä¸Šä¸€é¡µæ ˆ
      let prevPage = pages[pages.length - 2]
                jcapi.drawLabelText({
                    x: x,
                    y: y,
                    width: width,
                    height: height,
                    value: value,
                    fontSize: fontSize,
                    rotate: rotate,
                    lineMode: lineMode,
                    lineSpace: lineSpace,
                    letterSpace: letterSpace,
                    textAlignHorizontal: textAlignHorizontal,
                    textAlignVertical: textAlignVertical,
                    bold:bold
                })
            },
      // è§¦å‘上一页 upData å‡½æ•°(并携带参数)
      prevPage.$vm.setNo(no)
            //刷新上一个页面
            refreshLastPage(no) {
                // å‘ŠçŸ¥ A.vue æ›´æ–°æ•°æ®
                // èŽ·å–é¡µé¢æ ˆ
                let pages = getCurrentPages()
      // è¿”回上一页
      uni.navigateBack({
        delta: 1
      })
    },
  }
};
                // èŽ·å–ä¸Šä¸€é¡µæ ˆ
                let prevPage = pages[pages.length - 2]
                // è§¦å‘上一页 upData å‡½æ•°(并携带参数)
                prevPage.$vm.setNo(no)
                // è¿”回上一页
                uni.navigateBack({
                    delta: 1
                })
            },
        }
    };
</script>
<style lang="scss">
.finishProductIn-locno-bg {
  background-color: #F6F9FF;
  background-image: url('~@/static/custom/finishProductIn/locNoBg.png');
  // background: linear-gradient(180deg,rgba(206,227,254,1),rgba(206,227,254,1) 20%,rgba(206,227,254,0.5) 40%,rgba(206,227,254,0.25) 60%,rgba(206,227,254,0.08) 80%,rgba(206,227,254,0));
  padding: 0 20rpx;
  background-attachment: fixed;
  background-size: 100% auto;
  background-repeat: no-repeat;
  position: fixed;
  top: 0;
  bottom: 0;
  width: 100%;
  z-index: -1;
}
    .finishProductIn-locno-bg {
        background-color: #F6F9FF;
        background-image: url('~@/static/custom/finishProductIn/locNoBg.png');
        // background: linear-gradient(180deg,rgba(206,227,254,1),rgba(206,227,254,1) 20%,rgba(206,227,254,0.5) 40%,rgba(206,227,254,0.25) 60%,rgba(206,227,254,0.08) 80%,rgba(206,227,254,0));
        padding: 0 20rpx;
        background-attachment: fixed;
        background-size: 100% auto;
        background-repeat: no-repeat;
        position: fixed;
        top: 0;
        bottom: 0;
        width: 100%;
        z-index: -1;
    }
.finishProductIn-locno-search {
  padding: 40rpx 30rpx 20rpx 30rpx;
}
    .finishProductIn-locno-search {
        padding: 40rpx 30rpx 20rpx 30rpx;
    }
.wrap .finishProductIn-locno-scroll-list {
  height: calc(100vh - var(--window-top) - var(--window-bottom) - 242rpx);
  width: 100%;
}
    .wrap .finishProductIn-locno-scroll-list {
        height: calc(100vh - var(--window-top) - var(--window-bottom) - 242rpx);
        width: 100%;
    }
.finishProductIn-locno-scroll-list-group {
  ::v-deep .u-cell-item-box {
    background-color: rgba(250, 252, 255, 0.36) !important;
    padding: 0rpx 30rpx;
  }
    .finishProductIn-locno-scroll-list-group {
        ::v-deep .u-cell-item-box {
            background-color: rgba(250, 252, 255, 0.36) !important;
            padding: 0rpx 30rpx;
        }
  .content {
    font-size: 12px;
    background-color: #ffffff;
    box-sizing: border-box;
    border-radius: 10rpx;
    margin: 0rpx 0rpx 16rpx;
    padding: 20rpx 8rpx;
    box-shadow: none;
    display: flex;
    align-items: center;
        .content {
            font-size: 12px;
            background-color: #ffffff;
            box-sizing: border-box;
            border-radius: 10rpx;
            margin: 0rpx 0rpx 16rpx;
            padding: 20rpx 8rpx;
            box-shadow: none;
            display: flex;
            align-items: center;
    .content-header {
      width: 40rpx;
      height: 90rpx;
      display: flex;
      align-items: center;
            .content-header {
                width: 40rpx;
                height: 90rpx;
                display: flex;
                align-items: center;
      .content-header-icon {
        background-image: url("~@/static/custom/moveWareHouse/header_icon.png");
        background-size: 100% auto;
        background-repeat: no-repeat;
        height: 28rpx;
        width: 28rpx;
      }
                .content-header-icon {
                    background-image: url("~@/static/custom/moveWareHouse/header_icon.png");
                    background-size: 100% auto;
                    background-repeat: no-repeat;
                    height: 28rpx;
                    width: 28rpx;
                }
      .content-header-title {
        margin-left: 11rpx;
        font-size: 26rpx;
        font-weight: bold;
        color: #3d52f5;
      }
    }
                .content-header-title {
                    margin-left: 11rpx;
                    font-size: 26rpx;
                    font-weight: bold;
                    color: #3d52f5;
                }
            }
    .content-body {
      flex: 1;
      background: #f5f9ff;
      border-radius: 10rpx;
      padding: 0rpx 23rpx;
            .content-body {
                flex: 1;
                background: #f5f9ff;
                border-radius: 10rpx;
                padding: 0rpx 23rpx;
      .row-list {
        height: 60rpx;
        display: flex;
        flex-direction: row;
        padding: 0px;
        align-items: center;
      }
                .row-list {
                    height: 60rpx;
                    display: flex;
                    flex-direction: row;
                    padding: 0px;
                    align-items: center;
                }
      .row-list ._label {
        display: flex;
        flex: 0.8;
        color: #909399;
        align-items: center;
                .row-list ._label {
                    display: flex;
                    flex: 0.8;
                    color: #909399;
                    align-items: center;
        ._label-icon-1 {
          background-image: url("~@/static/custom/moveWareHouse/label-icon-1.png");
          background-size: 100% auto;
          background-repeat: no-repeat;
          height: 26rpx;
          width: 26rpx;
        }
                    ._label-icon-1 {
                        background-image: url("~@/static/custom/moveWareHouse/label-icon-1.png");
                        background-size: 100% auto;
                        background-repeat: no-repeat;
                        height: 26rpx;
                        width: 26rpx;
                    }
        ._label-icon-2 {
          background-image: url("~@/static/custom/moveWareHouse/label-icon-2.png");
          background-size: 100% auto;
          background-repeat: no-repeat;
          height: 26rpx;
          width: 26rpx;
        }
                    ._label-icon-2 {
                        background-image: url("~@/static/custom/moveWareHouse/label-icon-2.png");
                        background-size: 100% auto;
                        background-repeat: no-repeat;
                        height: 26rpx;
                        width: 26rpx;
                    }
        ._label-icon-3 {
          background-image: url("~@/static/custom/moveWareHouse/label-icon-3.png");
          background-size: 100% auto;
          background-repeat: no-repeat;
          height: 26rpx;
          width: 26rpx;
        }
                    ._label-icon-3 {
                        background-image: url("~@/static/custom/moveWareHouse/label-icon-3.png");
                        background-size: 100% auto;
                        background-repeat: no-repeat;
                        height: 26rpx;
                        width: 26rpx;
                    }
        ._label-name {
          margin-left: 11rpx;
          font-size: 26rpx;
          font-weight: 500;
          color: #666666;
        }
      }
                    ._label-name {
                        margin-left: 11rpx;
                        font-size: 26rpx;
                        font-weight: 500;
                        color: #666666;
                    }
                }
      .row-list ._content {
        flex: 1.5;
        text-align: right;
        color: #909399;
        font-size: 24rpx;
      }
                .row-list ._content {
                    flex: 1.5;
                    text-align: right;
                    color: #909399;
                    font-size: 24rpx;
                }
      .row-list .s1 {
        color: #d35651;
      }
    }
  }
}
                .row-list .s1 {
                    color: #d35651;
                }
            }
        }
    }
.navbar-right {
  font-weight: 500;
  font-size: 13px;
  color: #0b0b0b;
  line-height: 36rpx;
  margin-right: 32rpx;
}
</style>
    .navbar-right {
        font-weight: 500;
        font-size: 13px;
        color: #0b0b0b;
        line-height: 36rpx;
        margin-right: 32rpx;
    }
</style>
pages/wareHouse/nuclearScale/saveForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,378 @@
<template>
  <u-modal
    v-model="show"
    ref="uModal"
    title=""
    :show-cancel-button="true"
    @confirm="confirm"
    @cancel="cancel"
    :async-close="true"
  >
    <view class="packing-registration-param">
      <scroll-view scroll-y="true" style="height: 100%">
        <view class="packing-registration-param-view">
          <view class="packing-registration-param-item param-extra">
            <view class="packing-registration-param-item-left">
              <text class="item-one">批次号</text>
            </view>
            <view class="packing-registration-param-item-right">
              <u-input
                class="item-one item-two"
                v-model="form.overallLength"
                disabled
              />
            </view>
          </view>
          <view class="packing-registration-param-item param-extra">
            <view class="packing-registration-param-item-left">
              <text class="item-one">产品描述</text>
            </view>
            <view class="packing-registration-param-item-right">
              <u-input
                class="item-one item-two"
                v-model="form.proposedLocation"
                disabled
              />
            </view>
          </view>
          <view class="packing-registration-param-item param-extra">
            <view class="packing-registration-param-item-left">
              <text class="item-one">零件位</text>
            </view>
            <view class="packing-registration-param-item-right">
              <u-input
                class="item-one item-two"
                v-model="form.reelNumber"
                disabled
              />
            </view>
          </view>
          <view class="packing-registration-param-item param-extra">
            <view class="packing-registration-param-item-left">
              <text class="item-one">毛重</text>
            </view>
            <view class="packing-registration-param-item-right">
              <u-input
                class="item-one item-two"
                v-model="form.reelWeight"
                disabled
              />
            </view>
          </view>
          <view class="packing-registration-param-item param-extra">
            <view class="packing-registration-param-item-left">
              <text class="item-one">盘重</text>
            </view>
            <view class="packing-registration-param-item-right">
              <u-input
                class="item-one item-two"
                v-model="form.grossWeight"
                disabled
              />
            </view>
          </view>
          <view class="packing-registration-param-item param-extra">
            <view class="packing-registration-param-item-left">
              <text class="item-one">净重</text>
            </view>
            <view class="packing-registration-param-item-right">
              <u-input
                class="item-one item-two"
                v-model="form.netWeight"
                disabled
              />
            </view>
          </view>
          <view class="packing-registration-param-item param-extra">
            <view class="packing-registration-param-item-left">
              <text class="item-one">核磅重量</text>
            </view>
            <view class="packing-registration-param-item-right">
              <u-input class="item-one item-two" v-model="form.name" />
            </view>
          </view>
          <view class="packing-registration-param-item param-extra">
            <view class="packing-registration-param-item-left">
              <text class="item-one">叉车重量</text>
            </view>
            <view class="packing-registration-param-item-right">
              <u-input class="item-one item-two" v-model="form.outerDiameter" />
            </view>
          </view>
          <view class="packing-registration-param-item param-extra">
            <view class="packing-registration-param-item-left">
              <text class="item-one">长度</text>
            </view>
            <view class="packing-registration-param-item-right">
              <u-input class="item-one item-two" v-model="form.voltage" />
            </view>
          </view>
          <view class="packing-registration-param-item param-extra">
            <view class="packing-registration-param-item-left">
              <text class="item-one">盘号</text>
            </view>
            <view class="packing-registration-param-item-right">
              <u-input class="item-one item-two" v-model="form.speed" />
            </view>
          </view>
        </view>
      </scroll-view>
    </view>
  </u-modal>
</template>
<script>
export default {
  props: {
    operationTaskList: {
      type: Object,
      required: true,
      default: () => ({}),
    },
  },
  data() {
    return {
      show: false,
      form: {},
    };
  },
  methods: {
    confirm() {
      if (!this.form.outerDiameter) {
        this.$u.toast("请输入核磅重量");
        this.$refs.uModal.clearLoading(); // æ¸…除加载状态
        return;
      }
      if (!this.form.voltage) {
        this.$u.toast("请输入叉车重量");
        this.$refs.uModal.clearLoading(); // æ¸…除加载状态
        return;
      }
      // PDA æ‰«ç æ ¸ç£…规则:
      // (1).铜杆
      //    æ­£ç£…å·®:0-3kg å¯ç›´æŽ¥æäº¤
      //          4-10kg çš®é‡ä¸å˜
      //    å¦‚果为 4kg å‡€é‡åŠ  2kg、毛重加 2kg
      //    å¦‚果为 5kg å‡€é‡åŠ  3kg、毛重加 4kg
      //    å¦‚果为 6kg å‡€é‡åŠ  4kg、毛重加 4kg
      //    ä»¥æ­¤ç±»æŽ¨
      //    æ·»åŠ å¼¹çª—æç¤º:更改合格证毛重为..(改后的值)、净重为..(改后的净重)
      //    è¶…过 10kg提示生产核查(不能提交)
      //    è´Ÿç£…å·®(要加负号):净重不变
      //    -10kg ä»¥å†…
      //    æ ¸ç£…重量-2(新的毛重)皮重(新的毛重-净重)超过 10kg提示生产核查(不能提交)
      // (2).导体
      //    æ­£ç£…å·®:0-3kg可直接提交
      //    è¶…过 3kg及 è´Ÿç£…差提示生产核查(不能提交)
      // (3).导体2.6
      //     å£«0.5kg éƒ½å¯ç›´æŽ¥æäº¤
      //      è¶…过0.5 æç¤ºç”Ÿäº§æ ¸æŸ¥
      //磅差计算:核榜-叉车盘-毛重
      Number(this.form.h);
      const magnetic =
        Number(this.form.h) - Number(this.form.children) - Number(this.form.m);
      uni.showModal({
        title: "提示",
        content: "磅差为:" + magnetic,
        showCancel: false,
        success: function () {
          switch (this.operationTaskList.productType) {
            case "铜杆":
              if (magnetic > 0 && magnetic < 3) {
                this.verifySubmission(this.form);
              }
              if (magnetic == 4) {
                this.form.grossWeight = Number(this.form.grossWeight) + 2;
                this.form.netWeight = Number(this.form.netWeight) + 2;
                this.$u.toast(
                  "更改合格证毛重为:" +
                    this.form.grossWeight +
                    "净重为:" +
                    this.form.netWeight
                );
                this.verifySubmission(this.form);
              }
              if (magnetic == 5) {
                this.form.grossWeight = Number(this.form.grossWeight) + 3;
                this.form.netWeight = Number(this.form.netWeight) + 3;
                this.$u.toast(
                  "更改合格证毛重为:" +
                    this.form.grossWeight +
                    "净重为:" +
                    this.form.netWeight
                );
                this.verifySubmission(this.form);
              }
              if (magnetic == 6) {
                this.form.grossWeight = Number(this.form.grossWeight) + 4;
                this.form.netWeight = Number(this.form.netWeight) + 4;
                this.$u.toast(
                  "更改合格证毛重为:" +
                    this.form.grossWeight +
                    "净重为:" +
                    this.form.netWeight
                );
                this.verifySubmission(this.form);
              }
              if (magnetic == 7) {
                this.form.grossWeight = Number(this.form.grossWeight) + 5;
                this.form.netWeight = Number(this.form.netWeight) + 5;
                this.$u.toast(
                  "更改合格证毛重为:" +
                    this.form.grossWeight +
                    "净重为:" +
                    this.form.netWeight
                );
                this.verifySubmission(this.form);
              }
              if (magnetic == 8) {
                this.form.grossWeight = Number(this.form.grossWeight) + 6;
                this.form.netWeight = Number(this.form.netWeight) + 6;
                this.$u.toast(
                  "更改合格证毛重为:" +
                    this.form.grossWeight +
                    "净重为:" +
                    this.form.netWeight
                );
                this.verifySubmission(this.form);
              }
              if (magnetic == 9) {
                this.form.grossWeight = Number(this.form.grossWeight) + 7;
                this.form.netWeight = Number(this.form.netWeight) + 7;
                this.$u.toast(
                  "更改合格证毛重为:" +
                    this.form.grossWeight +
                    "净重为:" +
                    this.form.netWeight
                );
                this.verifySubmission(this.form);
              }
              if (magnetic == 10) {
                this.form.grossWeight = Number(this.form.grossWeight) + 8;
                this.form.netWeight = Number(this.form.netWeight) + 8;
                this.$u.toast(
                  "更改合格证毛重为:" +
                    this.form.grossWeight +
                    "净重为:" +
                    this.form.netWeight
                );
                this.verifySubmission(this.form);
              }
              if (magnetic > 10) {
                this.$u.toast("生产核查");
              }
              break;
            // case "导体":
            //   if (magnetic > 0 && magnetic < 3) {
            //     this.verifySubmission(this.form);
            //   } else {
            //     this.$u.toast("生产核查");
            //   }
            //   break;
            // case "导体2.6":
            //   if (magnetic > -0.5 && magnetic < 0.5) {
            //     this.verifySubmission(this.form);
            //   } else {
            //     this.$u.toast("生产核查");
            //   }
            //   break;
          }
        },
      });
    },
    // æ ¡éªŒåŽæäº¤
    verifySubmission(Obj) {
      this.$emit("update", Obj);
    },
    cancel() {
      this.show = false;
      this.form = {};
    },
    open(val) {
      this.show = true;
      this.form = val;
    },
  },
};
</script>
<style lang="scss" scoped>
::v-deep .u-model__title {
  padding-top: 0 !important;
}
::v-deep .u-input__input {
  text-align: right !important;
}
.packing-registration-param {
  padding: 40rpx 30rpx 10rpx 30rpx;
  height: 350px;
  overflow: hidden;
  .packing-registration-param-title {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-bottom: 30rpx;
    .title-label {
      margin-left: 14rpx;
      font-size: 34rpx;
      font-weight: bold;
      color: #283e65;
    }
  }
  .packing-registration-param-view {
    height: 177rpx;
    background-color: #fff;
    border-radius: 10rpx;
    padding: 0rpx 23rpx;
    margin-bottom: 30rpx;
    .packing-registration-param-item {
      height: 90rpx;
      border: 1px solid #adc8e4;
      line-height: 90rpx;
      display: flex;
      justify-content: space-between;
      border: none;
      .packing-registration-param-item-left {
        .item-one {
          font-size: 30rpx;
          color: #666666;
        }
      }
      .packing-registration-param-item-right {
        display: flex;
        justify-content: space-between;
        .item-one {
          font-size: 15rpx;
          color: #060505;
          margin-right: 6rpx;
        }
        .item-two {
          font-size: 15rpx;
          color: #a6b4cc;
          margin-right: 6rpx;
        }
        .item-three {
          font-size: 30rpx;
          color: #214ded;
          margin-right: 6rpx;
        }
      }
    }
    .param-extra {
      border-bottom: 1px solid #ededed;
    }
  }
}
</style>