小小儁爺
2025-05-14 3afe42dec5534422f2a99292542fbba86883b527
1.采购入库扫条码实现
已修改7个文件
已删除1个文件
1056 ■■■■ 文件已修改
config/api.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/sbgl/rcdj.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/cgdh3.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/cgrk.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/cgrk2.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/cgrk3.vue 556 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/cgrk4.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/cgrk4_back.vue 460 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/api.js
@@ -393,8 +393,11 @@
    })
//采购入库提交
//采购入库提交-按采购订单
export const MesAppPurchInStorSave = (data1, data2, config = {}) => http.post(
    '/AppPurchManagement/MesAppPurchInStorSave' + data1, data2, config)
//采购入库提交-按到货标签
export const MesAppPurchInStorLabSave = (data1, data2, config = {}) => http.post(
    '/AppPurchManagement/MesAppPurchInStorLabSave' + data1, data2, config)
pages/sbgl/rcdj.vue
@@ -182,6 +182,7 @@
                console.log("扫描到的内容为:", content)
                _this.getCheckScanDeviceQrCodeData(content)
            })
        },
        onPullDownRefresh() {
            setTimeout(() => {
@@ -211,7 +212,7 @@
        mounted() {
            this.init()
            this.getCheckScanDeviceQrCodeData('111')
            // this.getCheckScanDeviceQrCodeData('111')
        },
        methods: {
pages/wlgl/cgdh3.vue
@@ -614,6 +614,8 @@
                            hpartcode: i.partcode,
                            hplanqty: i.quantity,
                            hqty: i.labelCount,
                            hsourceid: i.orderid,
                            hsourcesbid: i.sbid,
                            hischeck: i.is_incheck, //暂时写死
                            children: i.labelArr
                        })
pages/wlgl/cgrk.vue
@@ -1,6 +1,6 @@
<template>
    <view>
        <page-nav title="采购入库1"></page-nav>
        <page-nav title="采购入库"></page-nav>
        <view class="body" style="flex-direction: column;">
            <u-button type="primary" icon='plus-circle' size='large' style="width: 96%;margin-left: 2%;margin-top: 70%;"
                :plain="true" :hairline="true" @click="navigateTo" text="选择采购订单"></u-button>
pages/wlgl/cgrk2.vue
@@ -1,6 +1,6 @@
<template>
    <view>
        <page-nav title="采购入库2"></page-nav>
        <page-nav title="采购入库"></page-nav>
        <view v-if="purchorderArrAll.length===0">
pages/wlgl/cgrk3.vue
@@ -1,35 +1,25 @@
<template>
    <view>
        <page-nav title="采购入库3"></page-nav>
        <view v-if="purchorderArr.length===0">
            <div class="sacnBody">
                <div class="scanImg" @click="topScanClick"></div>
                <div class="scanText">扫描物料标签</div>
            </div>
        </view>
        <page-nav title="采购入库"></page-nav>
        <view v-if='purchorderArr.length!==0' class="mainContent" style="">
            <view>
                <u-gap height="10" bgColor="#eff0f1"></u-gap>
                <view class="head">
                    <view style="max-height: 940rpx;overflow: auto;">
                    <!-- max-height: 1340rpx;overflow: auto; -->
                    <view style="max-height: 1020rpx;overflow: auto;">
                        <view class="head" style="position: relative;">
                            <u-radio-group v-model="radioValue" class="flex_column">
                                <view class=" flex_column" style="width: 100%;" @click="radioValueClick(item.hbarcode)"
                                    v-for="(item,index) in purchorderDetailArr" :key="item.hbarcode">
                            <u-radio-group class="flex_column">
                                <view class=" flex_column" style="width: 100%;" v-for="(item,index) in purchorderArr"
                                    :key="item.hbarcode">
                                    <view class="head_block" style="position: absolute;margin: 38rpx 0 0 0;">
                                        <view class="head_left">
                                            <view class="head_bar"></view>
                                            <view class="head_title" style="font-weight: bold;">
                                                æ ‡ç­¾ä¿¡æ¯
                                                ç‰©æ–™ä¿¡æ¯
                                            </view>
                                        </view>
                                    </view>
@@ -39,12 +29,11 @@
                                        {{(index+1).toString().padStart(2,0)}}
                                    </view>
                                    <view class="trash" v-show="purchorderDetailArr.length>1"
                                        @click="trashClick(index)">
                                    <view class="trash" v-show="purchorderArr.length>1" @click="trashClick(index)">
                                        <u-icon name="trash" size='20'></u-icon>
                                    </view>
                                    <view v-show="purchorderDetailArr.length===1" style="width: 48rpx;height: 48rpx;">
                                    <view v-show="purchorderArr.length===1" style="width: 48rpx;height: 48rpx;">
                                    </view>
@@ -52,43 +41,62 @@
                                    <view class="flex_between marginBottom20 marginLeft20 marginTop20">
                                        <view style="display: flex;">
                                            <view class="flex_column titleFont">
                                                <view>物料编码:</view>
                                                <view>物料名称:</view>
                                                <view>物料规格:</view>
                                                <view>到货单号:</view>
                                                <view>物料标签:</view>
                                                <view>标签数量:</view>
                                                <view>物料数量:</view>
                                                <view>供方信息:</view>
                                                <view>采购批次:</view>
                                                <view>质量状态:</view>
                                            </view>
                                            <view class="flex_column contentFont">
                                                <view>{{item.partcode}}</view>
                                                <view>{{item.partname}}</view>
                                                <view class="ellipsis" style="width: 460rpx;">
                                                    {{item.partspec?item.partspec:'/'}}
                                                </view>
                                                <view>{{item.hbillno}}</view>
                                                <view>{{item.hbarcode}}</view>
                                                <view>{{item.hqty}}</view>
                                                <view class="ellipsis" style="width: 460rpx;">{{item.hcustomername}}
                                                </view>
                                                <view>{{item.hbatchno}}</view>
                                                <!-- <view>{{item.qualitystatus?item.qualitystatus:'/'}}</view> -->
                                                <view v-if="item.qualitystatus===null">/</view>
                                                <view>{{item.hcustomername}}</view>
                                                <view>/</view>
                                                <view>
                                                    <view v-if="!item.qualitystatus">/</view>
                                                <view v-else style="display: flex;align-items: center;">
                                                    <!--     <u-icon
                                                        :name="item.qualitystatus==='OK'?'checkmark-circle-fill':'close-circle-fill'"
                                                        :color="item.qualitystatus==='OK'?'#55ff00':'#FF0000'"
                                                        size="40"></u-icon>
                                                    <view style="margin-left: 10rpx;">
                                                        {{item.qualitystatus==='OK'?'合格':'不合格'}}
                                                    </view> -->
                                                    <u-icon name="more-circle-fill" color="#55aaff" size="20"></u-icon>
                                                    <view style="margin-left: 10rpx;">
                                                        å¾…检
                                                        <u-icon name="tags-fill" color="green" size="20"
                                                            v-if="item.qualitystatus==='CS'"></u-icon>
                                                        <view style="margin-left: 10rpx;"
                                                            v-if="item.qualitystatus==='CS'">免检</view>
                                                        <u-icon name="checkmark-circle-fill" color="#55ff00" size="20"
                                                            v-if="item.qualitystatus==='OK'"></u-icon>
                                                        <view style="margin-left: 10rpx;"
                                                            v-if="item.qualitystatus==='OK'">合格</view>
                                                        <u-icon name="close-circle-fill" color="#FF0000" size="20"
                                                            v-if="item.qualitystatus==='NG'"></u-icon>
                                                        <view style="margin-left: 10rpx;"
                                                            v-if="item.qualitystatus==='NG'">不合格</view>
                                                        <u-icon name="more-circle-fill" color="#55aaff" size="20"
                                                            v-if="item.qualitystatus==='TS'"></u-icon>
                                                        <view style="margin-left: 10rpx;"
                                                            v-if="item.qualitystatus==='TS'">待检</view>
                                                    </view>
                                                    </view>
                                                </view>
                                            </view>
                                        </view>
                                        <u-radio size='20' class="marginRight20" :key="item.hbarcode"
                                            :name="item.hbarcode" activeColor="red"></u-radio>
                                    </view>
                                    <u-gap height="10" v-if="index!==purchorderDetailArr.length-1"
                                        bgColor="#eff0f1"></u-gap>
                                    <u-gap height="10" v-if="index!==purchorderArr.length-1" bgColor="#eff0f1"></u-gap>
                                </view>
                            </u-radio-group>
@@ -97,104 +105,83 @@
                    </view>
                </view>
            </view>
        </view>
        <!--         <view v-if='purchorderArr.length!==0' class="footer">
            <view class="head_block" style="align-items: center;padding: 0 23rpx;">
        </view>
        <view class="footer" v-if='purchorderArr.length!==0'>
            <view class="head_block">
                <view class="head_left">
                    <view class="head_bar"></view>
                    <view class="head_title" style="font-weight: bold;">
                        é€‰æ‹©è´¨æ£€æ–¹æ¡ˆ
                        æ‰«æåº“位
                    </view>
                </view>
                <view class="flex_center" style="margin-right: 20rpx;">
                    <view @click='sheetClick' class="custominputClass">
                        <view v-show='sheetValue===""' style="color: rgb(192, 196, 204);">请选择</view>
                        <view v-show='sheetValue!==""' class="ellipsis" style="width: 390rpx;">
                            {{sheetValue}}
                        </view>
                        <u-icon :name="!sheetShow?'arrow-down-fill':'arrow-up-fill'"></u-icon>
                <view class="marginRight20">
                    <u-icon name="scan" @click="topScanClick" color="red" size="28"></u-icon>
                    </view>
                </view>
            <view class="flex_between marginBottom20 marginLeft20 marginTop20">
                <view style="display: flex;">
                    <view class="flex_column titleFont">
                        <view>库位信息:</view>
                        <view>所属仓库:</view>
            </view>
        </view> -->
                    <view class="flex_column contentFont" @click="sheetShow=true">
                        <view v-if="purchorderObj.lcationcode">{{purchorderObj.lcationcode}}</view>
                        <view v-else style="color: #ccc;">点击选择或扫库位码</view>
                        <view v-if="purchorderObj.stockcode">{{purchorderObj.stockcode}}</view>
                        <view v-else style="color: #ccc;">点击选择或扫库位码</view>
                    </view>
                </view>
            </view>
            <u-button size="large" :loading="isDisabledSubmitButton" :disabled="isDisabledSubmitButton"
                loadingText="正在提交,请稍等..." type="primary" @click="submit" text="确认提交">
            </u-button>
        </view>
        <view v-if='purchorderArr.length===0'>
            <div class="sacnBody">
                <div class="scanImg" @click="topScanClick2"></div>
                <div class="scanText">扫描物料条码</div>
            </div>
        </view>
        <u-picker :show="sheetShow" :columns="columns" :itemHeight='55' :closeOnClickOverlay='true'
            @close='sheetShow=false' @confirm='pickerConfirm' @cancel='sheetShow=false'></u-picker>
            @close='sheetShow=false' @change="changeHandler" @confirm='pickerConfirm'
            @cancel='sheetShow=false'></u-picker>
        <view class="footer">
            <u-button :disabled="!sheetValue" v-if='purchorderArr.length!==0' type="primary" size='large'
                :hairline="true" @click="navigateTo" text="下一步"></u-button>
        <!-- æ‚¬æµ®çƒ -->
        <view v-if='purchorderArr.length!==0' @click="topScanClick2">
            <drag-ball :x='$DeviceInformation.screenWidth*0.8' :y="$DeviceInformation.screenHeight*0.7"></drag-ball>
        </view>
        <!--         <scan-code></scan-code> -->
        <!-- æ‚¬æµ®çƒ -->
        <!-- <view v-show="purchorderArr.length!==0&&!sheetShow" @click="topScanClick">
            <drag-ball :x='$DeviceInformation.screenWidth*0.8' :y="$DeviceInformation.screenHeight*0.7"></drag-ball>
        </view> -->
        <!-- <navigator :url="'./rcjy2?item='+ encodeURIComponent(JSON.stringify(item))"> -->
        <!--     <navigator :url="'./rcjy2?item='+encodeURIComponent(1)">
        </navigator>
 -->
    </view>
</template>
<script>
    import {
        MesAppPurchInStorScanLabCode
        MesAppPurchInStorScanLabCode,
        WarehouseLocationSearchStoreHouse,
        MesAppPurchInStorLabSave,
        WareHouseLocation
    } from '../../config/api.js';
    // import scanCode from '@/components/scan-code/scan-code.vue'
    const App = getApp()
    export default {
        // components: {
        //     scanCode
        // },
        onLoad(option) {
            // if (option.length !== undefined) {
            //     let t1 = JSON.parse(uni.getStorageSync('purchorderArr'))
            //     let t2 = JSON.parse(uni.getStorageSync('purchorderDetailArr'))
            //     // æ˜¯å¦åŒæ­¥æ‰¹æ¬¡
            //     if (option.issyncbatch === 'true') { //是
            //         console.log('执行1')
            //         this.purchorderArr = t1.filter(i => {
            //             return !(i.hbillno === option.hbillno && i.partcode === option.partcode && i.hbatchno ===
            //                 option.hbatchno)
            //         })
            //         this.purchorderDetailArr = t2.filter(i => {
            //             console.log(!(i.hbillno === option.hbillno && i.partcode === option.partcode && i
            //                 .hbatchno ===
            //                 option.hbatchno))
            //             return !(i.hbillno === option.hbillno && i.partcode === option.partcode && i.hbatchno ===
            //                 option.hbatchno)
            //         })
            //     } else if (option.issyncbatch === 'false') { //否
            //         console.log('执行2')
            //         this.purchorderDetailArr = t2.filter(i => i.hbarcode !== option.labcode)
            //         this.purchorderArr = t1.filter(i => i.hbarcode !== option.labcode)
            //     }
            //     console.log('执行3')
            //     this.radioValue = this.purchorderDetailArr[0].hbarcode
            //     const t = this.purchorderDetailArr.find(i => i.hbarcode === this.radioValue).hbillno
            //     this.purchorderObj = this.purchorderArr.find(i => i.hbillno === t)
            //     this.$forceUpdate()
            // }
        },
@@ -208,74 +195,14 @@
        data() {
            return {
                // "hbillno": "DH2303311361", //单据编号
                // "partcode": "102", //产品编码
                // "partname": "内存", //产品名称
                // "partspec": "", //产品规格
                // "hbarcode": "DH2303311360", //物料标签
                // "stocktype_code": "1", //存货类型编码
                // "hqty": 300.00, //标签数量
                // "hcustomercode": "0010002", //供应商编码
                // "hcustomername": "蒂森克虏伯发动机系统(常州)有限公司", //供应商名称
                // "hbatchno": "2", //采购批次
                // "qualitystatus": null //质量状态
                purchorderObj: {},
                purchorderArr: [
                    // {
                    //     hbillno: 'DH2304041465',
                    //     partcode: 'ZG-Y-001',
                    //     partname: 'ZG原材料001',
                    //     partspec: '#001'
                    // },
                    // {
                    //     hbillno: 'DH2304041463',
                    //     partcode: 'ZG-Y-002',
                    //     partname: 'ZG原材料002',
                    //     partspec: '#002'
                    // }
                ],
                purchorderDetailArr: [
                    // {
                    //     hbillno: 'DH2304041465',
                    //     hbarcode: 'DH2304041464',
                    //     hqty: 100,
                    //     hcustomername: 'ZG外购供应商',
                    //     hbatchno: '#101',
                    //     qualitystatus: 'NG'
                    // },
                    // {
                    //     hbillno: 'DH2304041463',
                    //     hbarcode: 'DH2304041462',
                    //     hqty: 400,
                    //     hcustomername: 'ZG外购供应商',
                    //     hbatchno: '#101',
                    //     qualitystatus: 'OK'
                    // },
                    // {
                    //     hbillno: 'DH2304041463',
                    //     hbarcode: 'DH2304041461',
                    //     hqty: 300,
                    //     hcustomername: 'ZG外购供应商',
                    //     hbatchno: '#101',
                    //     qualitystatus: 'NG'
                    // }, {
                    //     hbillno: 'DH2304041463',
                    //     hbarcode: 'DH2304041460',
                    //     hqty: 200,
                    //     hcustomername: 'ZG外购供应商',
                    //     hbatchno: '#101',
                    //     qualitystatus: 'OK'
                    // },
                ],
                radioValue: '',
                purchorderArr: [],
                sheetShow: false, //上拉列表是否展开
                sheetValue: '',
                sheetList: [],
                columns: []
                columns: [],
                columnsData: [],
                wareHouseLocationArr: [], //仓库库位数组
                isDisabledSubmitButton: false,
                purchorderObj: {}, //存储仓库库位信息
            }
        },
        created() {
@@ -283,46 +210,48 @@
        },
        mounted() {
            this.init()
            this.getWareHouseLocation()
            this.getMesAppPurchInStorScanLabCode('DH25050900016')
            // this.getMesAppPurchInStorScanLabCode('DH25051400099')
            // this.getWarehouseLocationSearchStoreHouse('0011')
            // setTimeout(() => {
            //     this.getMesAppPurchInStorScanLabCode('DH25051400096')
            // }, 2000)
        },
        methods: {
            // èŽ·å–å¼¹å‡ºå±‚ä»“åº“åº“ä½ä¿¡æ¯
            async getWareHouseLocation() {
                const {
                    data: res
                } = await WareHouseLocation()
                this.wareHouseLocationArr = res.filter(i => i.children.length > 0)
                this.columns = [
                    this.wareHouseLocationArr.map(i => i.text),
                    this.wareHouseLocationArr[0].children.map(i => i.text)
                ]
                this.wareHouseLocationArr.forEach(i => {
                    this.columnsData.push(i.children.map(j => j.text))
                })
            },
            changeHandler(e) {
                const {
                    columnIndex,
                    value,
                    values, // values为当前变化列的数组内容
                    index,
                    // å¾®ä¿¡å°ç¨‹åºæ— æ³•å°†picker实例传出来,只能通过ref操作
                    picker = this.$refs.uPicker
                } = e
                // å½“第一列值发生变化时,变化第二列(后一列)对应的选项
                if (columnIndex === 0) {
                    // picker为选择器this实例,变化第二列对应的选项
                    picker.setColumnValues(1, this.columnsData[index])
                }
            },
            init() {
                uni.stopPullDownRefresh();
            },
            //来自于页面3的值  è¿›è¡Œæ•°æ®å¤„理
            fromSubmitData(option) {
                let t1 = JSON.parse(uni.getStorageSync('purchorderArr'))
                let t2 = JSON.parse(uni.getStorageSync('purchorderDetailArr'))
                // æ˜¯å¦åŒæ­¥æ‰¹æ¬¡
                if (option.issyncbatch === 'Y') { //是
                    console.log('执行1')
                    this.purchorderArr = t1.filter(i => {
                        return !(i.hbillno === option.hbillno && i.partcode === option.partcode && i.hbatchno ===
                            option.hbatchno)
                    })
                    this.purchorderDetailArr = t2.filter(i => {
                        return !(i.hbillno === option.hbillno && i.partcode === option.partcode && i.hbatchno ===
                            option.hbatchno)
                    })
                } else if (option.issyncbatch === 'N') { //否
                    console.log('执行2')
                    this.purchorderDetailArr = t2.filter(i => i.hbarcode !== option.labcode)
                    this.purchorderArr = t1.filter(i => i.hbarcode !== option.labcode)
                }
                console.log('执行3')
                if (this.purchorderDetailArr.length > 0) {
                    this.radioValue = this.purchorderDetailArr[0].hbarcode
                    const t = this.purchorderDetailArr.find(i => i.hbarcode === this.radioValue).hbillno
                    this.purchorderObj = this.purchorderArr.find(i => i.hbillno === t)
                }
                this.$forceUpdate()
            },
            // æ‰«æ
            topScanClick() {
@@ -336,18 +265,7 @@
                        console.log('条码类型:' + res.scanType);
                        console.log('条码内容:' + res.result);
                        that.scanContent = res.result;
                        let flag = false
                        that.purchorderDetailArr.forEach(item => {
                            if (item.hbarcode === res.result) {
                                flag = true
                            }
                        })
                        if (flag) {
                            that.$u.toast('此条码已扫描,已在列表中!')
                        } else {
                            //处理扫码事件
                            that.getMesAppPurchInStorScanLabCode(that.scanContent);
                        }
                        that.getWarehouseLocationSearchStoreHouse(that.scanContent)
                    },
                    complete: function(res) {
@@ -359,85 +277,144 @@
                });
            },
            // æ‰«æç‰©æ–™ä¿¡æ¯ç 
            topScanClick2() {
                let that = this;
                uni.scanCode({
                    onlyFromCamera: true,
                    // scanType: ['barCode', 'qrCode'],
                    scanType: ['qrCode'],
                    success: function(res) {
                        console.log('条码类型:' + res.scanType);
                        console.log('条码内容:' + res.result);
                        that.scanContent = res.result;
                        if (that.purchorderArr.findIndex(i => i.hbarcode === that.scanContent) > -1) {
                            that.$u.toast('此条码已在列表中')
                        } else {
                            that.getMesAppPurchInStorScanLabCode(that.scanContent)
                        }
                    },
                    complete: function(res) {
                    },
                    fail: function(res) {
                        console.log('条码类型:' + res.scanType);
                        console.log('条码内容:' + res.result);
                    }
                });
            },
            async getWarehouseLocationSearchStoreHouse(locationcode) {
                const data = {
                    locationcode
                }
                const res = await WarehouseLocationSearchStoreHouse(data)
                if (res.code === '200') {
                    this.purchorderObj.lcationcode = res.data[0].locationname
                    this.purchorderObj.stockcode = res.data[0].warehousename
                    this.purchorderObj.lcationname2 = res.data[0].locationcode
                    this.purchorderObj.stockname2 = res.data[0].warehousecode
                    this.$forceUpdate()
                } else {
                    this.$u.toast(res.message)
                }
            },
            // èŽ·å–æ ‡ç­¾ä¿¡æ¯
            async getMesAppPurchInStorScanLabCode(labcode) {
                const data = {
                    labcode
                }
                const res = await MesAppPurchInStorScanLabCode(this.global.formatData(data))
                if (res.code === '200') {
                    console.log(res)
                    this.purchorderArr.unshift({
                        hbillno: res.data[0].hbillno,
                        partcode: res.data[0].partcode,
                        partname: res.data[0].partname,
                        partspec: res.data[0].partspec,
                        hbarcode: res.data[0].hbarcode,
                        hbatchno: res.data[0].hbatchno ? res.data[0].hbatchno : '/',
                    })
                    this.purchorderDetailArr.unshift({
                        hbillno: res.data[0].hbillno,
                        partcode: res.data[0].partcode,
                        hbarcode: res.data[0].hbarcode,
                        hqty: res.data[0].hqty,
                        hcustomername: res.data[0].hcustomername,
                        hcustomercode: res.data[0].hcustomercode,
                        hbatchno: res.data[0].hbatchno ? res.data[0].hbatchno : '/',
                        qualitystatus: res.data[0].qualitystatus,
                    })
                    this.purchorderObj = this.purchorderArr[0]
                    this.radioValue = res.data.labcont[0].hbarcode
                    this.purchorderArr.unshift(res.data[0])
                }
            },
            // picker确认按钮
            pickerConfirm(val) {
                this.sheetValue = val.value[0]
                this.purchorderObj.lcationcode = val.value[1]
                this.purchorderObj.stockcode = val.value[0]
                this.purchorderObj.stockname2 = this.wareHouseLocationArr.find(i => i.text === this.purchorderObj
                    .stockcode).value
                this.purchorderObj.lcationname2 = this.wareHouseLocationArr.find(i => i.value === this.purchorderObj
                    .stockname2).children.find(i => i.text === this.purchorderObj
                    .lcationcode).value
                this.sheetShow = false
            },
            // é€‰æ‹©è´¨æ£€æ–¹æ¡ˆ
            sheetClick(val) {
                this.sheetShow = true
            },
            // é¡µé¢è·³è½¬
            navigateTo() {
                uni.setStorageSync('purchorderArr', JSON.stringify(this.purchorderArr))
                uni.setStorageSync('purchorderDetailArr', JSON.stringify(this.purchorderDetailArr))
                // uni.navigateTo({
                //  url:'./rcjy2?purchorderObj=' + JSON.stringify(this.purchorderObj)+
                // })
                uni.navigateTo({
                    url: './rcjy2?checkstandcode=' + this.sheetList.find(i => i.name === this.sheetValue).code +
                        '&checkstandname=' + this.sheetValue + '&sampmethod=' + this.sheetList.find(i => i.name ===
                            this.sheetValue).sampmethod + '&sampscare=' + this.sheetList.find(i => i.name === this
                            .sheetValue).sampscare + '&purchorderObj=' + JSON.stringify(this
                            .purchorderObj) + '&radioSelectValue=' + JSON.stringify(this.purchorderDetailArr.find(
                            i => i.hbarcode === this.radioValue))
                });
            },
            // å•选按钮点击事件
            radioValueClick(val) {
                this.radioValue = val
                const t = this.purchorderDetailArr.find(i => i.hbarcode === val).hbillno
                this.purchorderObj = this.purchorderArr.find(i => i.hbillno === t)
            },
            // åˆ é™¤äº‹ä»¶ç‚¹å‡»
            trashClick(val) {
                this.purchorderDetailArr.splice(val, 1)
                this.purchorderArr.splice(val, 1)
            },
            async submit() {
                const data1 = {
                    username: uni.getStorageSync("username")
                }
                let data2 = []
                if (!this.purchorderObj.lcationcode) { //说明有未填写的库位信息
                    return this.$u.toast('库位信息未选择或未扫码!')
                }
                this.purchorderArr.forEach(i => {
                    data2.push({
                        "sbid": i.hsourcesbid,
                        "hbarcode": i.hbarcode,
                        "hbillno": i.hbillno,
                        "hsourceid": i.hsourceid,
                        "hsourcebillno": i.hsourcebillno,
                        "partcode": i.partcode,
                        "partname": i.partname,
                        "partspec": i.partspec,
                        "unitcode": i.unitcode,
                        "unitname": i.unitname,
                        "hqty": i.hqty,
                        "quantity": i.quantity,
                        "countarrivalquantity": i.countarrivalquantity,
                        "countInquantity": i.countInquantity,
                        "countreturnquantity": i.countreturnquantity,
                        "harcodelocation": i.harcodelocation,
                        "lactioncode": this.purchorderObj.lcationname2,
                        "lactionname": this.purchorderObj.lcationcode,
                        "housecode": this.purchorderObj.stockname2,
                        "housename": this.purchorderObj.stockcode,
                        "hcustomercode": i.hcustomercode,
                        "hcustomername": i.hcustomername,
                        "deptcode": i.deptcode,
                        "deptname": i.deptname,
                        "batchcode": "",
                        "qstatus": i.qualitystatus
                    })
                })
                // console.log(JSON.stringify(data2))
                const res = await MesAppPurchInStorLabSave(this.global.formatData(
                    data1), data2)
                if (res.code === '200') {
                    this.$u.toast('提交成功!')
                    setTimeout(() => {
                        uni.navigateBack({
                            delta: 1, //返回层数,2则上上页
                        })
                    }, 1000)
                } else {
                    this.$u.toast(res.message)
                }
            }
        }
    }
</script>
@@ -480,4 +457,13 @@
        border-radius: 10rpx;
        padding: 0 10rpx;
    }
    .arrowClass {
        display: flex;
        justify-content: center;
        // background-color: #efefef;
        width: 100rpx;
        // border-radius: 10rpx;
        height: 56rpx;
    }
</style>
pages/wlgl/cgrk4.vue
@@ -1,6 +1,6 @@
<template>
    <view>
        <page-nav title="采购入库4"></page-nav>
        <page-nav title="采购入库"></page-nav>
        <view v-if='purchorderArr.length!==0' class="mainContent" style="">
            <view>
@@ -393,8 +393,6 @@
                        i.stockcode = '' //仓库
                        i.countInquantity2 = parseFloat(i.quantity) - parseFloat(i.countInquantity) +
                            parseFloat(i.countreturnquantity)
                        console.log(i.countInquantity)
                    })
                    this.purchorderArr = res.data
                    this.purchorderObj = this.purchorderArr[0]
@@ -504,19 +502,6 @@
                        "deptcode": i.deptcode,
                        "deptname": i.deptname,
                        children: i.children
                        // "hbarcode": "",
                        // "hbillno": "",
                        // "hqty": i.hqty,
                        // "hcustomercode": i.customercode,
                        // "hdeptcode": i.departmentcode,
                        // "partcode": i.partcode,
                        // "unitcode": i.unitcode,
                        // "hsourceid": i.orderid,
                        // "hsourcebillno": i.ordercode,
                        // "stockcode": this.purchorderObj.stockname2,
                        // "lcationcode": this.purchorderObj.lcationname2
                    })
                })
@@ -524,12 +509,14 @@
                    return this.$u.toast('第' + count + '个物料的入库数量错误!')
                }
                console.log(JSON.stringify(data2))
                // console.log(JSON.stringify(data2))
                const res = await MesAppPurchInStorSave(this.global.formatData(
                    data1), data2)
                if (res.code === '200') {
                    this.$u.toast('提交成功!')
                    setTimeout(() => {
                    let prevPage = getCurrentPages()[getCurrentPages()
                        .length -
                        2]; // ä¸Šä¸€é¡µé¢å®žä¾‹
@@ -538,6 +525,7 @@
                    uni.navigateBack({
                        delta: 1, //返回层数,2则上上页
                    })
                    }, 1000)
                } else {
                    this.$u.toast(res.message)
                }
pages/wlgl/cgrk4_back.vue
ÎļþÒÑɾ³ý