小小儁爺
2025-05-08 ebbe758df90e7049a859317c8055a7f81ca3422f
1.采购到货功能开发2.新增采购入库菜单、入库检验菜单
已添加22个文件
已修改5个文件
5704 ■■■■■ 文件已修改
config/api.js 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main.js 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/grzx/mmsz.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/blps.vue 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/cgdh.vue 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/cgdh2.vue 155 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/cgdh3.vue 1118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/cgrk.vue 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/cgrk2.vue 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/cgrk3.vue 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/fgll.vue 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/kcpd.vue 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/qtck.vue 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/qtll.vue 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/qtrk.vue 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/scck.vue 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/scll.vue 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/scrk.vue 1807 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/sctl.vue 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/wltb.vue 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/wlgl/zhrq.vue 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/xtsy/index.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/zlgl/rcjy.vue 515 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/zlgl/rcjy2.vue 499 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/zlgl/rcjy3.vue 338 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/lpapi-uniplugin.js 485 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/api.js
@@ -326,3 +326,61 @@
// å¯†ç é‡ç½®
export const ResettUserPassword = (data) => http.post('/Login/ResettUserPassword' +
    data)
// é‡‡è´­åˆ°è´§ï¼šèŽ·å–é‡‡è´­è®¢å•åˆ—è¡¨
export const MesAppPurchOrderSearch = (config = {}) => http.get(
    '/AppPurchManagement/MesAppPurchOrderSearch', config)
// é‡‡è´­åˆ°è´§ï¼šé€‰æ‹©é‡‡è´­è®¢å•获取物料信息
export const MesAppPurchOrderPartSearch = (data, config = {}) => http.get(
    '/AppPurchManagement/MesAppPurchOrderPartSearch?purchordercode=' + data, config)
// é‡‡è´­ä¾›æ–¹ä¿¡æ¯æŸ¥è¯¢
export const PurchSupplierSelect = (config = {}) => http.get(
    '/BaseDate/PurchSupplierSelect', config)
// å•位信息查询
export const UnitSerch = (config = {}) => http.get(
    '/BaseDate/UnitSerch', config)
// é‡‡è´­åˆ°è´§ï¼šç”Ÿæˆç³»ç»Ÿæ¡ç 
export const MesAppPurchOrderLabelBarCode = (data, config = {}) => http.get(
    '/AppPurchManagement/MesAppPurchOrderLabelBarCode' + data, config)
//采购到货:提交
export const MesAppPurchOrderSave = (data1, data2, config = {}) => http.post(
    '/AppPurchManagement/MesAppPurchOrderSave' + data1, data2, config)
//采购入库选择有到货采购订单
export const MesAppPurchInStorSelectCGOrder = (data, config = {}) => http.get(
    '/AppPurchManagement/MesAppPurchInStorSelectCGOrder',
    data, config)
// é€‰æ‹©é‡‡è´­è®¢å•带出订单下有到货的物料信息
export const MesAppPurchInStorSelectCGOrderPart = (data, config = {}) => http.get(
    '/AppPurchManagement/MesAppPurchInStorSelectCGOrderPart' +
    data, config)
// é‡‡è´­å…¥åº“扫描标签条码带出标签信息
export const MesAppPurchInStorScanLabCode = (data, config = {}) => http.get(
    '/AppPurchManagement/MesAppPurchInStorScanLabCode' +
    data, config)
// å…¥åŽ‚æ£€éªŒ,扫描采购到货生成标签
export const InFactoryCheckScanLabCode = (data, config = {}) => http.get(
    '/AppQualityManagement/InFactoryCheckScanLabCode' +
    data, config)
//入厂检验,根据选择的检验方案查找检验项目
export const InFactoryCheckItem = (data, config = {}) => http.get(
    '/AppQualityManagement/InFactoryCheckItem' +
    data, config)
main.js
@@ -18,12 +18,21 @@
    ...App
})
Vue.prototype.$appVersion = 'v1.0.3' //APP当前版本
// Vue.prototype.$appVersion = 'v1.0.3' //APP当前版本   //圣沣版本
Vue.prototype.$appVersion = 'v1.0.1' //APP当前版本   //大岛版本
// Vue.prototype.$baseUrl = 'http://121.196.36.24:8021/api' //本地产品   å·¨åŠ›çš„æ•°æ®åº“
// Vue.prototype.$baseUrl = 'http://122.227.18.22:8000/api' //本地产品   å·¨ç«‹é˜²æŠ¤ï¼ˆå®¢æˆ·åœ°å€ï¼‰
// Vue.prototype.$baseUrl = 'http://121.196.36.24:8019/api' //
Vue.prototype.$baseUrl = 'http://121.196.36.24:8032/api' //圣沣项目
// Vue.prototype.$baseUrl = 'http://121.196.36.24:8032/api' //圣沣项目
// Vue.prototype.$baseUrl = 'http://192.168.2.254:8000/api' //圣沣项目      å®¢æˆ·çŽ°åœºå®žé™…æœåŠ¡å™¨ip
// Vue.prototype.$baseUrl = 'http://121.196.36.24:8039/api' //大岛项目(2.0)
// Vue.prototype.$baseUrl = 'http://192.168.2.138:8080/api' //大岛项目(2.0) å®¢æˆ·çŽ°åœºå®žé™…æœåŠ¡å™¨ip
Vue.prototype.$baseUrl = 'http://121.196.36.24:9090/api' //最新产品 2025/5/8
Vue.prototype.$companyType = 'B' //企业类型(项目类型) A:巨力,B:圣沣,、B: äº§å“
// A:  http://121.196.36.24:8021/api  http://122.227.18.22:8000/api
@@ -32,6 +41,15 @@
import global from '@/static/js/global.js'; //引入自定义全局 js方法
Vue.prototype.global = global;
setTimeout(() => {
    uni.getSystemInfo({
        success: (res) => {
            console.log(res, 9999)
            Vue.prototype.$DeviceInformation = res
        }
    })
}, 1000)
// å¼•入请求封装,将app参数传递到配置中
require('./config/request')(app)
pages.json
@@ -382,6 +382,73 @@
                "navigationStyle": "custom",
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/wlgl/cgrk",
            "style": {
                "navigationBarTitleText": "采购入库",
                "navigationStyle": "custom",
                "enablePullDownRefresh": false
            }
        }, {
            "path": "pages/wlgl/cgrk2",
            "style": {
                "navigationBarTitleText": "采购入库",
                "navigationStyle": "custom",
                "enablePullDownRefresh": false
            }
        }, {
            "path": "pages/wlgl/cgrk3",
            "style": {
                "navigationBarTitleText": "采购入库",
                "navigationStyle": "custom",
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/wlgl/cgdh",
            "style": {
                "navigationBarTitleText": "采购到货",
                "navigationStyle": "custom",
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/wlgl/cgdh2",
            "style": {
                "navigationBarTitleText": "采购到货",
                "navigationStyle": "custom",
                "enablePullDownRefresh": false
            }
        },
        {
            "path": "pages/wlgl/cgdh3",
            "style": {
                "navigationBarTitleText": "采购到货",
                "navigationStyle": "custom",
                "enablePullDownRefresh": false
            }
        }, {
            "path": "pages/zlgl/rcjy",
            "style": {
                "navigationBarTitleText": "入厂检验",
                "navigationStyle": "custom",
                "enablePullDownRefresh": false
            }
        }, {
            "path": "pages/zlgl/rcjy2",
            "style": {
                "navigationBarTitleText": "入厂检验",
                "navigationStyle": "custom",
                "enablePullDownRefresh": false
            }
        }, {
            "path": "pages/zlgl/rcjy3",
            "style": {
                "navigationBarTitleText": "入厂检验",
                "navigationStyle": "custom",
                "enablePullDownRefresh": false
            }
        }
    ],
    "globalStyle": {
pages/grzx/mmsz.vue
@@ -25,13 +25,13 @@
        </view>
        <view class="footer">
        <view class="footer" style="display: flex;flex-direction: row;">
            <u-button :loading="isDisabledSubmitButtonReset" loadingText="重置中..."
                style='width: 50%;border-radius: 10rpx 0 0 10rpx;' type="success" @click="resetPassword" text="重置密码"
                style='width: 49%;border-radius: 10rpx 0 0 10rpx;' type="success" @click="resetPassword" text="重置密码"
                size="large">
            </u-button>
            <u-button :loading="isDisabledSubmitButtonEdit" loadingText="修改中..."
                style='width: 50%;border-radius:0 10rpx 10rpx 0' @click="editPassword" type="primary" text="修改密码"
                style='width: 49%;border-radius:0 10rpx 10rpx 0' @click="editPassword" type="primary" text="修改密码"
                size="large"></u-button>
        </view>
pages/wlgl/blps.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,49 @@
<template>
    <view>
        <page-nav title="备料配送"></page-nav>
    </view>
</template>
<script>
    // import {
    // } from '../../config/api.js';
    export default {
        onLoad(option) {
        },
        onPullDownRefresh() {
            setTimeout(() => {
                this.init(() => {
                    uni.stopPullDownRefresh();
                })
            }, 1000);
        },
        data() {
            return {
            }
        },
        created() {
        },
        mounted() {
            this.init()
        },
        methods: {
            init() {
                uni.stopPullDownRefresh();
            },
        }
    }
</script>
<style lang="scss" scoped>
    ::v-deep .uicon-arrow-left>span {
        display: block;
    }
</style>
pages/wlgl/cgdh.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,81 @@
<template>
    <view>
        <page-nav title="采购到货"></page-nav>
        <view class="body">
            <u-button type="primary" icon='plus-circle' size='large' style="width: 96%;margin-left: 2%;" :plain="true"
                :hairline="true" @click="navigateTo" text="选择采购订单"></u-button>
        </view>
    </view>
</template>
<script>
    // import {
    // } from '../../config/api.js';
    const App = getApp()
    export default {
        onLoad(option) {
        },
        onPullDownRefresh() {
            setTimeout(() => {
                this.init(() => {
                    uni.stopPullDownRefresh();
                })
            }, 1000);
        },
        data() {
            return {
            }
        },
        created() {
        },
        mounted() {
            this.init()
        },
        methods: {
            navigateTo() {
                uni.navigateTo({
                    url: './cgdh2'
                });
            },
            init() {
                uni.stopPullDownRefresh();
            },
        }
    }
</script>
<style lang="scss" scoped>
    @import url('@/style/global.css');
    ::v-deep .uicon-arrow-left>span {
        display: block;
    }
    .body {
        background-color: #f6f7fb !important;
        width: 100%;
        height: 1400rpx;
        display: flex;
        align-items: center;
    }
    .u-button--large {
        position: relative;
    }
    ::v-deep .uicon-plus-circle {
        font-size: 32rpx !important;
    }
</style>
pages/wlgl/cgdh2.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,155 @@
<template>
    <view>
        <page-nav title="采购到货"></page-nav>
        <view v-if="purchorderArrAll.length>0">
            <!-- <view class="mainContent" :style="{maxHeight: '1340rpx',overflow: 'scroll',padding:0}"> -->
            <u--input prefixIcon="search" prefixIconStyle="font-size: 22px;color: #909399" placeholder="输入采购订单号"
                clearable border="surround" @clear='inputBoxValueClear' v-model="inputBoxValue"
                @change="changeInputBoxValue"></u--input>
            <u-alert :title="'采购订单数(共'+title+'个)'" type="primary"></u-alert>
            <u-radio-group v-model="radioValue" iconPlacement="right" @change="radioValueClick" class="radioGroupClass">
                <view v-for="(item,index) in purchorderArr" :key="item.ordercode">
                    <!-- @click="radioValueClick(item.code)" -->
                    <view>
                        <u-radio activeColor="red" size="18" labelSize='18' :name='item.ordercode'
                            :label="item.ordercode"></u-radio>
                    </view>
                    <u-line v-if="index!==purchorderArr.length-1" color="#2979ff"></u-line>
                </view>
            </u-radio-group>
            <view class="footer" style="min-height:62rpx;">
                <u-button type="primary" size='large' :hairline="true" @click="navigateTo" text="下一步"></u-button>
            </view>
            <!-- </view> -->
        </view>
        <view v-if="purchorderArrAll.length===0">
            <div class="sacnBody">
                <div class="boxImg"></div>
                <div class="scanText">暂无采购到货</div>
            </div>
        </view>
    </view>
</template>
<script>
    import {
        MesAppPurchOrderSearch
    } from '../../config/api.js';
    const App = getApp()
    export default {
        onLoad(option) {},
        onPullDownRefresh() {
            setTimeout(() => {
                this.init(() => {
                    uni.stopPullDownRefresh();
                })
            }, 1000);
        },
        data() {
            return {
                inputBoxValue: '', //输入框值
                title: 0,
                radioValue: '',
                purchorderArr: [],
                purchorderArrAll: []
            }
        },
        created() {
        },
        mounted() {
            this.init()
            this.getMesAppPurchOrderSearch()
        },
        methods: {
            init() {
                uni.stopPullDownRefresh();
            },
            changeInputBoxValue(val) {
                this.purchorderArr = this.purchorderArrAll.filter((p) => {
                    return p.ordercode.indexOf(val) !== -1
                })
            },
            inputBoxValueClear() {
                this.inputBoxValue = ''
            },
            radioValueClick(val) {
                console.log(val)
                this.radioValue = val
            },
            navigateTo() {
                uni.navigateTo({
                    url: './cgdh3?ordercode=' + this.radioValue
                });
            },
            async getMesAppPurchOrderSearch() {
                const res = await MesAppPurchOrderSearch()
                this.purchorderArrAll = res.data
                this.purchorderArr = res.data
                this.title = res.data.length
                this.radioValue = res.data[0].ordercode
            }
        }
    }
</script>
<style lang="scss" scoped>
    @import url('@/style/global.css');
    ::v-deep .uicon-arrow-left>span {
        display: block;
    }
    .u-input--square {
        margin: 20rpx 10rpx;
        border-radius: 40rpx;
        background-color: #fff;
        border: 1px solid #c8c8c8;
    }
    ::v-deep .u-alert__text--primary--light {
        margin-bottom: 0;
        font-size: 32rpx !important;
    }
    .radioGroupClass {
        display: flex;
        flex-direction: column;
        background-color: #fff;
        overflow-y: auto;
        max-height: 1140rpx;
        margin-top: 20rpx;
    }
    ::v-deep .u-radio-label--right {
        height: 90rpx;
        line-height: 90rpx;
        width: 92%;
        margin-left: 4%;
        // padding: 0 50rpx;
    }
</style>
pages/wlgl/cgdh3.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,1118 @@
<template>
    <view>
        <page-nav title="采购到货"></page-nav>
        <view class="mainContent" :style="{maxHeight: '1340rpx',overflow: 'scroll'}">
            <view>
                <view class="head_block">
                    <view class="head_left">
                        <view class="head_bar"></view>
                        <view class="head_title" style="font-weight: bold;">
                            ç‰©æ–™ä¿¡æ¯
                        </view>
                    </view>
                    <!-- <view style="margin-right: 10rpx;font-weight: bold;">
                        {{cgdh}}
                    </view> -->
                </view>
                <u-gap height="10" bgColor="#eff0f1"></u-gap>
                <view class="head">
                    <!-- <view class="head_block">
                        <view class="head_left">
                            <view class="head_bar"></view>
                            <view class="head_title">
                                ç‰©æ–™ä¿¡æ¯
                            </view>
                        </view>
                    </view> -->
                    <view style="padding:20rpx 20rpx 20rpx 30rpx;">
                        <u-radio-group v-model="radioValue" class="flex_column">
                            <view class="marginBottom20 flex_column" style="width: 100%;"
                                @click="radioValueClick(item.partcode)" v-for="(item,index) in purchorderArr"
                                :key="item.partcode">
                                <view class="orderNumber" :key="item.partcode">
                                    {{(index+1).toString().padStart(2,0)}}
                                </view>
                                <view class="trash" @click="trashClick(index)" v-show="purchorderArr.length>1">
                                    <u-icon name="trash" size='20'></u-icon>
                                </view>
                                <view v-show="purchorderArr.length===1" style="width: 48rpx;height: 48rpx;">
                                </view>
                                <view class="flex_between marginBottom20">
                                    <view style="display: flex;">
                                        <view class="flex_column titleFont">
                                            <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>{{item.partspec?item.partspec:'/'}}</view>
                                            <!-- <view>{{item.quantity+"/"+item.countarrivalquantity}}</view> -->
                                            <view>{{cgdh}}</view>
                                        </view>
                                    </view>
                                    <u-radio size='20' :key="item.partcode" :name="item.partcode"
                                        activeColor="red"></u-radio>
                                </view>
                                <!--     <u-gap height="20" v-show="!item.arrowType" bgColor="#eff0f1"
                                    style='width: 100%;'></u-gap> -->
                                <view class="" v-show="!item.arrowType">
                                    <view class="head_block" style="margin-left: -20rpx;">
                                        <view class="head_left">
                                            <view class="head_bar"></view>
                                            <view class="head_title" style="font-weight: bold;">
                                                åˆ°è´§ä¿¡æ¯
                                            </view>
                                        </view>
                                    </view>
                                    <view class="" style="display: flex;flex-direction: column;">
                                        <view class="f_c_c">
                                            <view class="titleFont">供方信息:</view>
                                            <view class="ellipsis contentFont"
                                                style="width: 490rpx;padding-right: 15rpx;">
                                                {{item.customername}}
                                            </view>
                                            <!--         <view @click='gfxxClick' class="custominputClass">
                                                <view v-show='item.customername===""'
                                                    style="color: rgb(192, 196, 204);">请选择</view>
                                                <view v-show='item.customername!==""' class="ellipsis"
                                                    style="width: 390rpx;">
                                                    {{item.customername}}
                                                </view>
                                                <u-icon
                                                    :name="!gfxxSheetShow?'arrow-down-fill':'arrow-up-fill'"></u-icon>
                                            </view> -->
                                        </view>
                                        <view v-if="item.is_batchno==='Y'" class="f_c_c">
                                            <view class="titleFont">采购批次:</view>
                                            <u--input placeholder="请输入" border="bottom" v-model="item.cgpc"
                                                class="contentFont"
                                                style="border-bottom: 3rpx #eff0f1 solid;margin-left: 20rpx;"></u--input>
                                        </view>
                                        <view class="f_c_c">
                                            <view class="titleFont">单位:</view>
                                            <view class="ellipsis contentFont"
                                                style="width: 490rpx;padding-right: 15rpx;">
                                                {{item.uomname}}
                                            </view>
                                            <!--     <view @click='dwClick' class="custominputClass">
                                                <view v-show='item.uomname===""' style="color: rgb(192, 196, 204);">请选择
                                                </view>
                                                <view v-show='item.uomname!==""' class="ellipsis"
                                                    style="width: 390rpx;">
                                                    {{item.uomname}}
                                                </view>
                                                <u-icon :name="!dwSheetShow?'arrow-down-fill':'arrow-up-fill'"></u-icon>
                                            </view> -->
                                        </view>
                                    </view>
                                </view>
                                <!--
                                <view class="f_c_c" style="margin-top: 10rpx;">
                                    <view class="">采购单号:</view>
                                    <u--input placeholder="请输入" border="bottom" v-model="cgdh" disabled
                                        style="border-bottom: 3rpx #eff0f1 solid;margin-left: 20rpx;"></u--input>
                                </view> -->
                                <view v-show="!item.arrowType" class="f_c_c"
                                    style="padding-bottom: 12rpx;margin-top:10rpx;">
                                    <view class="titleFont">采购/已到货:</view>
                                    <view style="display: flex;" class="contentFont">
                                        <view>{{item.quantity}} / </view>
                                        <view style="color: rgb(41, 121, 255);margin-left: 10rpx;padding-right: 15rpx;">
                                            {{item.countarrivalquantity}}
                                        </view>
                                    </view>
                                    <!-- <u--input placeholder="请输入" border="bottom" disabled
                                        :value='item.quantity+"/"+item.countarrivalquantity'
                                        style="border-bottom: 3rpx #eff0f1 solid;margin-left: 20rpx;"></u--input> -->
                                </view>
                                <view v-show="!item.arrowType" class="f_c_c numberBox"
                                    style="margin-top: 20rpx;border: 0;">
                                    <view class="titleFont">到货数量:</view>
                                    <u-number-box inputWidth='110' v-model="item.dhsl" min='0'
                                        :max='item.quantity-item.countarrivalquantity' class="contentFont"
                                        @change="dhslChange"></u-number-box>
                                </view>
                                <view v-show="!item.arrowType" class="head_block"
                                    style="margin-left: -20rpx; margin-top:40rpx; ">
                                    <view class="head_left">
                                        <view class="head_bar"></view>
                                        <view class="head_title" style="font-weight: bold;">
                                            æ ‡ç­¾äº§å‡º
                                        </view>
                                    </view>
                                    <view style="display: flex;align-items:center;position: relative;">
                                        <view
                                            style="position: absolute;top: -6rpx;z-index: 2;right:174rpx;font-size: 26rpx;"
                                            :style="{color:bqcc?'#eff0f1':'#2979FF'}" @click=" bqcc=!bqcc">
                                            ç³»ç»Ÿç”Ÿæˆ
                                            <!-- {{bqcc?'系统生成':'扫描标签'}} -->
                                        </view>
                                        <view
                                            style="position: absolute;top: -6rpx;z-index: 2;right:26rpx;font-size: 26rpx;"
                                            :style="{color:!bqcc?'#eff0f1':'#2979FF'}" @click="bqcc=!bqcc">
                                            <!-- {{!bqcc?'系统生成':'扫描标签'}} -->
                                            æ‰«ææ ‡ç­¾
                                        </view>
                                        <u-switch v-model="bqcc" @change="bqccChange"></u-switch>
                                    </view>
                                </view>
                                <u-gap v-show="!item.arrowType" height="5" bgColor="#eff0f1"
                                    style='width: 100%;border-radius: 10rpx;'></u-gap>
                                <view v-show="!item.arrowType"
                                    style="display: flex;font-size: 28rpx;height: 46rpx;align-items: center;">
                                    <view style="color: rgb(41, 121, 255);margin-left: 10rpx;">
                                        {{purchorderArr[index].labelCount?purchorderArr[index].labelCount:0 }}
                                    </view>
                                    <vuew style="margin: 0 10rpx;"> / </vuew>
                                    <view> {{item.dhsl}} pcs</view>
                                </view>
                                <u-gap v-show="!item.arrowType" height="5" bgColor="#eff0f1"
                                    style='width: 100%;border-radius: 10rpx;'></u-gap>
                                <u-button v-show="!item.arrowType" type="primary" icon='plus-circle' plain
                                    style="height: 80rpx;width: 98%;margin-top: 10rpx;" @click="addLabel"
                                    class='addClass' text="添加">
                                </u-button>
                                <view v-show="!item.arrowType" class="flex_between titleFont"
                                    style="margin: 20rpx 30rpx 30rpx;">
                                    <view style="width: 60rpx;">序号</view>
                                    <view style="width: 170rpx;">物料标签</view>
                                    <view style="width: 170rpx;">单标签数量</view>
                                    <view>操作</view>
                                </view>
                                <view v-show="!item.arrowType"
                                    class="flex_column marginLeft20 marginRight20 contentFont" :key="it.labcode"
                                    v-for="(it,ind) in item.labelArr">
                                    <view class="flex_between marginLeft20 marginRight20">
                                        <view style="width: 60rpx;text-align: center;">{{(ind+1)}}</view>
                                        <view style="width: 200rpx;text-align: center;">{{it.labcode}}</view>
                                        <view style="width: 200rpx;text-align: center;">{{it.labqty}}</view>
                                        <u-icon @click="deleteLabel(index,it)" style="width: 50rpx;text-align: center;"
                                            name="trash" min='0' max='100' color="#2979ff" size="20">
                                        </u-icon>
                                    </view>
                                    <u-divider v-if="ind!==item.labelArr.length-1"></u-divider>
                                </view>
                                <view style="display: flex;justify-content: center;margin : 10rpx; 0">
                                    <view class="arrowClass"
                                        @click="item.arrowType?arrowDownClick(item):arrowUpClick(item)">
                                        <u-icon :name="item.arrowType?'arrow-down':'arrow-up'" color="#c8c8c8"
                                            size="25"></u-icon>
                                    </view>
                                </view>
                                <u-gap height="16" v-if="index!==purchorderArr.length-1" bgColor="#eff0f1"
                                    style='width: 110%;margin: 0rpx -5%;'></u-gap>
                            </view>
                        </u-radio-group>
                    </view>
                </view>
            </view>
        </view>
        <u-button size="large" :loading="isDisabledSubmitButton"
            :disabled="purchorderArr.map(i => i.labelArr).flat().length === 0" loadingText="正在提交,请稍等..." type="primary"
            @click="submit" text="确认提交">
        </u-button>
        <!-- é‡‡è´­ä¾›æ–¹ -->
        <!--         <u-picker :show="gfxxSheetShow" :columns="gfxxColumns" :itemHeight='55' :closeOnClickOverlay='true'
            @close='gfxxSheetShow=false' @confirm='gfxxPickerConfirm' @cancel='gfxxSheetShow=false'>
        </u-picker> -->
        <!-- å•位 -->
        <!--         <u-picker :show="dwSheetShow" :columns="dwColumns" :itemHeight='55' :closeOnClickOverlay='true'
            @close='dwSheetShow=false' @confirm='dwPickerConfirm' @cancel='dwSheetShow=false'>
        </u-picker> -->
        <!-- æ·»åŠ çš„å¼¹çª—äº‹ä»¶ -->
        <u-modal :show="modalShow" :showCancelButton='true' cancelText='取消' @close="modalShow=false"
            :closeOnClickOverlay="true" @cancel="modalCancel" @confirm="modalConfirm">
            <view class="" style="display: flex;justify-content: flex-start;flex-direction: column;">
                <view>物料编码:{{modalContent.code}}</view>
                <view>物料名称:{{modalContent.name}}</view>
                <view>到货数量:{{modalContent.dhsl}}</view>
                <view style="margin-top: 20rpx;display: flex;">
                    <view>单标签数量:</view>
                    <u-number-box class="modelNumber" inputWidth='110' v-model="modalContent.numberBox" min='0'
                        :max='modalContent.dhsl' @change="modelNumberChange"></u-number-box>
                </view>
            </view>
        </u-modal>
    </view>
</template>
<script>
    const modal = uni.requireNativePlugin("modal");
    import api from "../../static/js/lpapi-uniplugin";
    import {
        MesAppPurchOrderPartSearch,
        PurchSupplierSelect,
        UnitSerch,
        MesAppPurchOrderLabelBarCode,
        MesAppPurchOrderSave
    } from '../../config/api.js';
    import Vue from 'vue'
    const App = getApp()
    export default {
        onLoad(option) {
        },
        onPullDownRefresh() {
            setTimeout(() => {
                this.init(() => {
                    uni.stopPullDownRefresh();
                })
            }, 1000);
        },
        data() {
            return {
                isDisabledSubmitButton: false,
                radioValue: '',
                purchorderArr: [
                    // {
                    //     partcode: 'MO-001',
                    //     partname: '物料名称1',
                    //     partspec: '#001',
                    //     arrowType: false
                    // },
                    // {
                    //     partcode: 'MO-002',
                    //     partname: '物料名称1',
                    //     partspec: '#001',
                    //     arrowType: true
                    // },
                    // {
                    //     partcode: 'MO-003',
                    //     partname: '物料名称1',
                    //     partspec: '#001',
                    //     arrowType: true
                    // },
                    // {
                    //     partcode: 'MO-004',
                    //     partname: '物料名称1',
                    //     partspec: '#001',
                    //     arrowType: true
                    // },
                ],
                gfxxSheetShow: false,
                gfxxArr: [], //供方信息
                gfxxColumns: [
                    ['测试1', '测试2']
                ],
                cgpc: '', //采购批次
                dwSheetShow: false,
                dwArr: [], //单位
                dwColumns: [
                    ['测试1', '测试2']
                ],
                cgdh: '', //采购单号
                bqcc: true,
                labelArr: [],
                modalShow: false,
                modalContent: {},
                labelCount: 0, //标签产出数量值
                printerList: [],
                index: 0,
                printerName: "",
            }
        },
        created() {
        },
        mounted() {
            this.init()
            // this.getPurchSupplierSelect()
            // this.getUnitSerch()
        },
        async onLoad(option) {
            // this.openBluetoothAdapter()
            // console.log("onLoad");
            // this.printerList.splice(0);
            // const list = await api.getPrinters();
            // console.log(list, 8)
            // if (list.length > 0) {
            //     for (let item of list) {
            //         console.log(item);
            //         this.printerList.push(item.name);
            //     }
            // } else {
            //     this.printerList.push("未检测到打印机");
            // }
            // // è‡ªåŠ¨è¿žæŽ¥æ‰“å°æœº
            // this.onPrinterChanged();
            // this.openPrinter()
            this.cgdh = option.ordercode
            this.getMesAppPurchOrderPartSearch()
        },
        methods: {
            // èŽ·å–æ ‡ç­¾
            async getMesAppPurchOrderLabelBarCode(partcode, arrivalqty, onelableqty) {
                const data = {
                    partcode,
                    arrivalqty,
                    onelableqty
                }
                const res = await MesAppPurchOrderLabelBarCode(this.global.formatData(data))
                // this.labelArr = res.data
                // this.labelCount = 0
                // this.labelArr.map(i => i.labqty).forEach(i => {
                //     this.labelCount += parseFloat(i)
                // })
                this.purchorderArr.forEach(it => {
                    if (it.partcode === partcode) {
                        it.labelArr = res.data
                        it.labelCount = 0
                        res.data.map(i => i.labqty).forEach(i => {
                            it.labelCount += parseFloat(i)
                        })
                    }
                    // else {
                    //     it.labelArr = []
                    //     it.labelCount = 0
                    // }
                })
                console.log(this.purchorderArr, 88)
                this.$forceUpdate()
            },
            async getMesAppPurchOrderPartSearch() {
                const res = await MesAppPurchOrderPartSearch(this.cgdh)
                this.purchorderArr = res.data
                this.purchorderArr.forEach((item, index) => {
                    item.cgpc = ''
                    item.dhsl = item.quantity - item.countarrivalquantity
                    item.arrowType = index !== 0
                    // item.arrowType = true
                    item.labelArr = []
                    if (index === 0) {
                        this.radioValue = item.partcode
                    }
                })
                // const that = this
                // that.$nextTick(() => {
                //     console.log('11111')
                //     // setTimeout(() => {ss
                //     that.$forceUpdate()
                //     console.log('22222')
                //     // }, 1000)
                // })
            },
            // èŽ·å–ä¾›æ–¹ä¿¡æ¯ä¸‹æ‹‰
            async getPurchSupplierSelect() {
                const res = await PurchSupplierSelect()
                this.gfxxArr = res.data
                this.gfxxColumns = [res.data.map(i => i.name)]
            },
            // èŽ·å–å•ä½ä¸‹æ‹‰
            async getUnitSerch() {
                const res = await UnitSerch()
                this.dwArr = res.data
                this.dwColumns = [res.data.map(i => i.name)]
            },
            init() {
                uni.stopPullDownRefresh();
            },
            radioValueClick(partcode) {
                this.radioValue = partcode
            },
            // ç®­å¤´ç”±å‘下变为向上时触发
            arrowDownClick(val) {
                console.log('执行了111', val)
                // val.arrowType = !val.arrowType
                this.purchorderArr.forEach(i => {
                    if (i.partcode === val.partcode) {
                        i.arrowType = false
                    } else {
                        i.arrowType = true
                    }
                })
                // val.arrowType = false
                this.$forceUpdate()
            },
            // ç®­å¤´ç”±å‘上变为向下时触发
            arrowUpClick(val) {
                console.log('执行了222', val)
                val.arrowType = true
                this.$forceUpdate()
            },
            gfxxClick() {
                // this.gfxxSheetShow = true  //暂时注释
            },
            gfxxPickerConfirm(val) {
                this.purchorderArr.forEach(i => {
                    if (i.partcode === this.radioValue) {
                        i.customername = val.value[0]
                        i.customercode = this.gfxxArr.find(it => it.name === val.value[0]).code
                    }
                })
                this.gfxxSheetShow = false
            },
            dwClick() {
                // this.dwSheetShow = true //暂时注释
            },
            dwPickerConfirm(val) {
                this.purchorderArr.forEach(i => {
                    if (i.partcode === this.radioValue) {
                        i.uomname = val.value[0]
                        i.uomcode = this.dwArr.find(it => it.name === val.value[0]).code
                    }
                })
                this.dwSheetShow = false
            },
            // åˆ°è´§æ•°é‡
            dhslChange(val) {
                this.$forceUpdate()
            },
            // æ ‡ç­¾äº§å‡º
            bqccChange(val) {
                // this.$forceUpdate()
            },
            // æ·»åŠ 
            addLabel() {
                let temp = this.purchorderArr.find(i => i.partcode === this.radioValue)
                this.modalContent.code = temp.partcode
                this.modalContent.name = temp.partname
                this.modalContent.dhsl = temp.dhsl
                this.modalContent.numberBox = 0
                this.modalShow = true
            },
            // åˆ é™¤
            deleteLabel(number, val) {
                // VAL çˆ¶ item  val子it
                // this.labelArr = this.labelArr.filter(i => i.labcode !== val.labcode)
                // this.labelCount = 0
                // this.labelArr.map(i => i.labqty).forEach(i => {
                //     this.labelCount += parseFloat(i)
                // })
                console.log(number, val)
                this.purchorderArr[number].labelArr = this.purchorderArr[number].labelArr.filter(i => i.labcode !== val
                    .labcode)
                this.purchorderArr[number].labelCount = 0
                this.purchorderArr[number].labelArr.map(i => i.labqty).forEach(i => {
                    this.purchorderArr[number].labelCount += parseFloat(i)
                })
                this.$forceUpdate()
            },
            // æäº¤
            async submit() {
                const data1 = {
                    purordercode: this.cgdh,
                    // orderstaus: this.labelCount + this.purchorderArr.find(i => i.partcode === this
                    //     .radioValue).countarrivalquantity === this.purchorderArr.find(i => i.partcode === this
                    //     .radioValue).quantity ? 'INARIVE' : 'BINARIVE', //单据状态:BINARIVE(部分到货)、INARIVE(已到货)
                    username: uni.getStorageSync("username")
                }
                let submitData = JSON.parse(JSON.stringify(this.purchorderArr))
                // submitData = submitData.filter(i => parseFloat(i.labelCount))
                let data2 = []
                // [{
                //     "Inventory": {
                //         "Code": "81000241"
                //     },
                //     "Unit": {
                //         "Name": "ç®±"
                //     },
                //     "Quantity": 5,
                //     "OrigTaxAmount": 400,
                //     "OrigDiscountAmount": 400,
                //     "idsourcevouchertype": 27,
                //     "sourceVoucherCode": "PO-2021-09-0001",
                //     "sourceVoucherDetailId": 25
                // }]
                // let VoucherDetails = []
                submitData.forEach(i => {
                    if (i.labelArr.length > 0) {
                        console.log(i.is_batchno)
                        data2.push({
                            hacceptdate: i.acceptdate ? i.acceptdate : '',
                            hdepartmentcode: i.departmentcode ? i.departmentcode : '',
                            hcustomercode: i.customercode,
                            hbatchno: i.cgpc,
                            hsourcebillno: this.cgdh,
                            rownumber: i.rownumber,
                            hpartcode: i.partcode,
                            hplanqty: i.quantity,
                            hqty: i.labelCount,
                            hischeck: i.is_incheck, //暂时写死
                            children: i.labelArr
                        })
                        // VoucherDetails.push({
                        //     "Inventory": {
                        //         "Code": i.partcode
                        //     },
                        //     "Unit": {
                        //         "Name": i.uomname
                        //     },
                        //     "Quantity": i.dhsl,
                        //     "OrigTaxPrice": 0,
                        //     "OrigTaxAmount": 0,
                        //     "idsourcevouchertype": 27,
                        //     "sourceVoucherCode": i.ordercode,
                        //     "sourceVoucherDetailId": i.sbid
                        // })
                    }
                })
                // console.log('我是最先执行!')
                // this.isDisabledSubmitButton = true
                // const openToken = await this.global.getTPlusToken()
                // console.log(openToken)
                // console.log('我是最后执行!')
                // const headers = {
                //     'openToken': openToken,
                //     'appKey': Vue.prototype.$AppKey,
                //     'appSecret': Vue.prototype.$AppSecret,
                //     'Content-Type': 'application/json'
                // }
                // let DATA = {
                //     "dto": {
                //         "Code": this.cgdh,
                //         "IsModifiedCode": true,
                //         "VoucherDate": this.global.handleDatetime(new Date().getTime()),
                //         "ExternalCode": this.cgdh,
                //         "BusinessType": {
                //             "Code": "01"
                //         },
                //         "Partner": {
                //             "Code": this.purchorderArr[0].customercode
                //         },
                //         "Warehouse": {
                //             "Code": "03" //仓库目前传空
                //         },
                //         "VoucherDetails": VoucherDetails
                //     }
                // }
                this.isDisabledSubmitButton = true
                MesAppPurchOrderSave(this.global.formatData(
                    data1), data2).then(res => {
                    if (res.code === '200') {
                        submitData.forEach(i => {
                            if (i.labelArr.length > 0) {
                                i.labelArr.forEach(it => {
                                    this.printWL(it
                                        .labcode, res
                                        .data,
                                        i.partcode, i
                                        .partname, i
                                        .partspec ? i
                                        .partspec :
                                        '/', it
                                        .labqty)
                                })
                            }
                        })
                        let prevPage = getCurrentPages()[getCurrentPages()
                            .length -
                            2]; // ä¸Šä¸€é¡µé¢å®žä¾‹
                        prevPage.$vm
                            .getMesAppPurchOrderSearch() // è°ƒç”¨ä¸Šä¸€é¡µ å®šä¹‰çš„æ–¹æ³•
                        uni.navigateBack({
                            delta: 1, //返回层数,2则上上页
                        })
                    }
                    this.isDisabledSubmitButton = false
                    this.$u.toast(res.Message)
                })
                // console.log(headers, DATA, 18)
                // await new Promise((resolve, reject) => {
                //     uni.request({
                //         url: Vue.prototype.$chanjetBaseUrl +
                //             '/tplus/api/v2/PurchaseArrivalOpenApi/Create',
                //         data: DATA,
                //         method: 'POST',
                //         header: headers,
                //         success: (r2) => {
                //             console.log(r2)
                //             if (r2.data.code === 0) {
                //                 MesAppPurchOrderSave(this.global.formatData(
                //                     data1), data2).then(res => {
                //                     if (res.code === '200') {
                //                         submitData.forEach(i => {
                //                             if (i.labelArr.length > 0) {
                //                                 i.labelArr.forEach(it => {
                //                                     this.printWL(it
                //                                         .labcode, res
                //                                         .data,
                //                                         i.partcode, i
                //                                         .partname, i
                //                                         .partspec ? i
                //                                         .partspec :
                //                                         '/', it
                //                                         .labqty)
                //                                 })
                //                             }
                //                         })
                //                         let prevPage = getCurrentPages()[getCurrentPages()
                //                             .length -
                //                             2]; // ä¸Šä¸€é¡µé¢å®žä¾‹
                //                         prevPage.$vm
                //                             .getMesAppPurchOrderSearch() // è°ƒç”¨ä¸Šä¸€é¡µ å®šä¹‰çš„æ–¹æ³•
                //                         uni.navigateBack({
                //                             delta: 1, //返回层数,2则上上页
                //                         })
                //                     }
                //                     this.$u.toast(res.Message)
                //                     this.isDisabledSubmitButton = false
                //                 })
                //             } else {
                //                 this.$u.toast('接口报错,请联系开发人员!')
                //                 this.isDisabledSubmitButton = false
                //             }
                //         },
                //         fail: (e) => {
                //             console.log(e, 7)
                //         }
                //     })
                // })
            },
            // æ¨¡æ€æ¡†å–消
            modalCancel() {
                this.modalShow = false
            },
            // æ¨¡æ€æ¡†ç¡®è®¤
            modalConfirm() {
                this.getMesAppPurchOrderLabelBarCode(this.modalContent.code, this.modalContent.dhsl, this
                    .modalContent
                    .numberBox)
                this.modalShow = false
            },
            // æ¨¡æ€æ¡†æ•°å€¼æ”¹å˜
            modelNumberChange() {
            },
            // åˆ é™¤äº‹ä»¶ç‚¹å‡»
            trashClick(val) {
                this.purchorderArr.splice(val, 1)
            },
            // æ‰“印物料
            async printWL(t2, t4, t5, t6, t7, t8) {
                // å½“前时间
                const time = new Date();
                const strTime =
                    `${time.getFullYear()}-${(time.getMonth() + 1).toString().padStart(2,'0')}-${(time.getDate()).toString().padStart(2,'0')} ${(time.getHours()).toString().padStart(2,'0')}:${time.getMinutes().toString().padStart(2,'0')}:${(time.getSeconds()).toString().padStart(2,'0')}`;
                const text1 = '物料标签'
                const text2 = t2
                const text3 = '采购订单:' + this.cgdh
                const text4 = '到货单号:' + t4
                const text5 = '物料编码:' + t5
                const text6 = '物料名称:' + t6
                const text7 = '规格型号:' + t7
                const text8 = '标签数量:' + t8
                const text9 = '操作人员:' + uni.getStorageSync('username')
                const text10 = '操作时间:' + strTime
                // ç¬¬ä¸€æ­¥ï¼Œå…ˆåˆ¤æ–­æ‰“印机是否已经打开
                // å½“测试纸为竖向时,横向对应宽,竖向对应高
                if (api.isPrinterOpened()) {
                    api.startJob({
                        width: 78,
                        height: 80
                    });
                    //标题
                    // æ ‡é¢˜éƒ¨åˆ†åž‚直居中,水平居中,字体大小5mm,加粗显示
                    api.setItemHorizontalAlignment(1);
                    api.setItemVerticalAlignment(1);
                    api.drawText({
                        text: text1,
                        x: 52,
                        y: 9,
                        // width: 50,
                        // height: 20,
                        fontHeight: 7,
                        fontStyle: 1
                    });
                    api.draw2DQRCode({
                        text: text2,
                        x: 41,
                        y: 14,
                        width: 22,
                        eccLevel: 2,
                        horizontalAlignment: 1,
                        verticalAlignment: 1
                    });
                    api.drawText({
                        text: text3,
                        x: 30,
                        y: 40,
                        fontHeight: 3.1,
                        fontStyle: 0,
                        horizontalAlignment: 0,
                    });
                    api.drawText({
                        text: text4,
                        x: 30,
                        y: 45,
                        fontHeight: 3.1,
                        fontStyle: 0,
                        horizontalAlignment: 0,
                    });
                    api.drawText({
                        text: text5,
                        x: 30,
                        y: 50,
                        fontHeight: 3.1,
                        fontStyle: 0,
                        horizontalAlignment: 0,
                    });
                    api.drawText({
                        text: text6,
                        x: 30,
                        y: 55,
                        fontHeight: 3.1,
                        horizontalAlignment: 0,
                        fontStyle: 0
                    });
                    api.drawText({
                        text: text7,
                        x: 30,
                        y: 60,
                        fontHeight: 3.1,
                        horizontalAlignment: 0,
                        fontStyle: 0
                    });
                    api.drawText({
                        text: text8,
                        x: 30,
                        y: 65,
                        fontHeight: 3.1,
                        horizontalAlignment: 0,
                        fontStyle: 0
                    });
                    api.drawText({
                        text: text9,
                        x: 30,
                        y: 70,
                        fontHeight: 3.1,
                        horizontalAlignment: 0,
                        fontStyle: 0
                    });
                    api.drawText({
                        text: text10,
                        x: 30,
                        y: 75,
                        fontHeight: 3.1,
                        horizontalAlignment: 0,
                        fontStyle: 0
                    });
                    // ç»˜åˆ¶ç»“束,开始提交打印
                    api.commitJob();
                }
            },
            //  åˆå§‹åŒ–蓝牙设备
            openBluetoothAdapter() {
                uni.openBluetoothAdapter({
                    success: e => {
                        console.log('初始化蓝牙成功:' + e.errMsg);
                        console.log(JSON.stringify(e));
                        this.getBluetoothAdapterState();
                    },
                    fail: e => {
                        console.log(e)
                        console.log('初始化蓝牙失败,错误码:' + (e.errCode || e.errMsg));
                        uni.showModal({
                            title: '提示!',
                            content: '初始化蓝牙失败,请打开本机蓝牙!',
                            confirmText: "确定",
                            cancelText: "取消",
                            success: (res) => {
                                if (res.confirm) {
                                    this.bluetoothSettings()
                                }
                            }
                        });
                        if (e.errCode !== 0) {
                            //initTypes(e.errCode, e.errMsg);
                        }
                    }
                });
            },
            //  è‡ªåŠ¨è¿žæŽ¥æ‰“å°æœº
            onPrinterChanged(e) {
                console.log(e);
                this.index = e ? e.target.value : 0;
                this.printerName = this.printerList[this.index];
            },
            // è¿žæŽ¥æ‰“印机
            async openPrinter() {
                this.isSuccess = false
                console.log('执行了1')
                if (this.printerName) {
                    console.log('执行了2')
                    this.isSuccess = true
                    this.keyGetTime = new Date().getTime()
                    // è¿žæŽ¥æ–°çš„æ‰“印机
                    api.openPrinter(this.printerName, (value) => {
                        if (value) {
                            modal.toast({
                                message: "打印机连接成功",
                                duration: 1.5,
                            });
                        }
                    });
                }
                // this.openPrinter()
            },
            // è“ç‰™è®¾ç½®
            bluetoothSettings() {
                var main = plus.android.runtimeMainActivity();
                var Intent = plus.android.importClass("android.content.Intent");
                var mIntent = new Intent('android.settings.BLUETOOTH_SETTINGS');
                main.startActivity(mIntent);
            },
        }
    }
</script>
<style lang="scss" scoped>
    @import url('@/style/global.css');
    ::v-deep .uicon-arrow-left>span {
        display: block;
    }
    .arrowClass {
        display: flex;
        justify-content: center;
        // background-color: #efefef;
        width: 100rpx;
        // border-radius: 10rpx;
        height: 56rpx;
    }
    .custominputClass {
        width: 450rpx;
        // height: 50rpx;
        display: flex;
        justify-content: space-between;
        border: 3rpx #eff0f1 solid;
        border-radius: 10rpx;
        padding: 4rpx 16rpx;
    }
    .ellipsis {
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
        padding: 12rpx 2rpx;
    }
    .f_c_c {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        margin-top: 10rpx;
        border-bottom: 1px solid #eff0f1;
        // line-height: 80rpx;
        // height:70rpx;
    }
    ::v-deep .uni-input-wrapper {
        text-align: right;
    }
    .numberBox {
        ::v-deep .uni-input-wrapper {
            text-align: center;
        }
    }
    ::v-deep .u-number-box__minus {
        height: 50rpx !important;
    }
    ::v-deep .u-number-box__input {
        height: 50rpx !important;
    }
    ::v-deep .u-number-box__plus {
        height: 50rpx !important;
    }
    ::v-deep .addClass .uicon-plus-circle {
        font-size: 40rpx !important;
        margin-right: 20rpx !important;
    }
    ::v-deep .addClass .u-button__text {
        font-size: 36rpx !important;
    }
    ::v-deep .u-modal__content {
        justify-content: flex-start;
    }
    .modelNumber {
        ::v-deep .uni-input-input {
            text-align: center;
        }
    }
    ::v-deep .u-input--no-radius {
        padding-bottom: 0 !important;
    }
    .orderNumber {
        width: 60rpx;
        height: 40rpx;
        margin: -22rpx 0 0 -30rpx;
        background-color: #d3daf9;
        color: #2979FF;
        font-size: 26rpx;
        padding: 4rpx 0 0 10rpx;
        border-radius: 0 0 90% 0;
    }
    .trash {
        width: 48rpx;
        height: 48rpx;
        margin: -22rpx 0 0 610rpx;
        background-color: #d3daf9;
        font-size: 26rpx;
        padding: 6rpx 0 0 10rpx;
        border-radius: 100%;
    }
    ::v-deep .u-switch {
        width: 300rpx !important;
        height: 46rpx !important;
        // margin-bottom: 8rpx !important;
        line-height: 46rpx !important;
        background-color: #EFF0F1 !important;
    }
    // ::v-deep .u-switch__bg{
    //     height: 46rpx !important;
    //     line-height: 46rpx !important;
    //     width: 100% !important;
    // }
    ::v-deep .u-switch__node {
        width: 150rpx !important;
        // margin-bottom: 8rpx !important;
        height: 46rpx !important;
        line-height: 46rpx !important;
        background-color: rgba(41, 121, 255, 0.8);
        transform: translateX(0) !important;
    }
    ::v-deep .u-switch__node--on {
        // width: 100rpx !important;
        // width: 20px;
        height: 46rpx !important;
        line-height: 46rpx !important;
        // margin-bottom: 8rpx !important;
        // height: 20px;
        transform: translateX(-150rpx) !important;
    }
</style>
pages/wlgl/cgrk.vue
pages/wlgl/cgrk2.vue
pages/wlgl/cgrk3.vue
pages/wlgl/fgll.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,49 @@
<template>
    <view>
        <page-nav title="返工领料"></page-nav>
    </view>
</template>
<script>
    // import {
    // } from '../../config/api.js';
    export default {
        onLoad(option) {
        },
        onPullDownRefresh() {
            setTimeout(() => {
                this.init(() => {
                    uni.stopPullDownRefresh();
                })
            }, 1000);
        },
        data() {
            return {
            }
        },
        created() {
        },
        mounted() {
            this.init()
        },
        methods: {
            init() {
                uni.stopPullDownRefresh();
            },
        }
    }
</script>
<style lang="scss" scoped>
    ::v-deep .uicon-arrow-left>span {
        display: block;
    }
</style>
pages/wlgl/kcpd.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,49 @@
<template>
    <view>
        <page-nav title="库存盘点"></page-nav>
    </view>
</template>
<script>
    // import {
    // } from '../../config/api.js';
    export default {
        onLoad(option) {
        },
        onPullDownRefresh() {
            setTimeout(() => {
                this.init(() => {
                    uni.stopPullDownRefresh();
                })
            }, 1000);
        },
        data() {
            return {
            }
        },
        created() {
        },
        mounted() {
            this.init()
        },
        methods: {
            init() {
                uni.stopPullDownRefresh();
            },
        }
    }
</script>
<style lang="scss" scoped>
    ::v-deep .uicon-arrow-left>span {
        display: block;
    }
</style>
pages/wlgl/qtck.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,49 @@
<template>
    <view>
        <page-nav title="其它出库"></page-nav>
    </view>
</template>
<script>
    // import {
    // } from '../../config/api.js';
    export default {
        onLoad(option) {
        },
        onPullDownRefresh() {
            setTimeout(() => {
                this.init(() => {
                    uni.stopPullDownRefresh();
                })
            }, 1000);
        },
        data() {
            return {
            }
        },
        created() {
        },
        mounted() {
            this.init()
        },
        methods: {
            init() {
                uni.stopPullDownRefresh();
            },
        }
    }
</script>
<style lang="scss" scoped>
    ::v-deep .uicon-arrow-left>span {
        display: block;
    }
</style>
pages/wlgl/qtll.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,49 @@
<template>
    <view>
        <page-nav title="其它领料"></page-nav>
    </view>
</template>
<script>
    // import {
    // } from '../../config/api.js';
    export default {
        onLoad(option) {
        },
        onPullDownRefresh() {
            setTimeout(() => {
                this.init(() => {
                    uni.stopPullDownRefresh();
                })
            }, 1000);
        },
        data() {
            return {
            }
        },
        created() {
        },
        mounted() {
            this.init()
        },
        methods: {
            init() {
                uni.stopPullDownRefresh();
            },
        }
    }
</script>
<style lang="scss" scoped>
    ::v-deep .uicon-arrow-left>span {
        display: block;
    }
</style>
pages/wlgl/qtrk.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,49 @@
<template>
    <view>
        <page-nav title="其它入库"></page-nav>
    </view>
</template>
<script>
    // import {
    // } from '../../config/api.js';
    export default {
        onLoad(option) {
        },
        onPullDownRefresh() {
            setTimeout(() => {
                this.init(() => {
                    uni.stopPullDownRefresh();
                })
            }, 1000);
        },
        data() {
            return {
            }
        },
        created() {
        },
        mounted() {
            this.init()
        },
        methods: {
            init() {
                uni.stopPullDownRefresh();
            },
        }
    }
</script>
<style lang="scss" scoped>
    ::v-deep .uicon-arrow-left>span {
        display: block;
    }
</style>
pages/wlgl/scck.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,49 @@
<template>
    <view>
        <page-nav title="生产出库"></page-nav>
    </view>
</template>
<script>
    // import {
    // } from '../../config/api.js';
    export default {
        onLoad(option) {
        },
        onPullDownRefresh() {
            setTimeout(() => {
                this.init(() => {
                    uni.stopPullDownRefresh();
                })
            }, 1000);
        },
        data() {
            return {
            }
        },
        created() {
        },
        mounted() {
            this.init()
        },
        methods: {
            init() {
                uni.stopPullDownRefresh();
            },
        }
    }
</script>
<style lang="scss" scoped>
    ::v-deep .uicon-arrow-left>span {
        display: block;
    }
</style>
pages/wlgl/scll.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,49 @@
<template>
    <view>
        <page-nav title="生产领料"></page-nav>
    </view>
</template>
<script>
    // import {
    // } from '../../config/api.js';
    export default {
        onLoad(option) {
        },
        onPullDownRefresh() {
            setTimeout(() => {
                this.init(() => {
                    uni.stopPullDownRefresh();
                })
            }, 1000);
        },
        data() {
            return {
            }
        },
        created() {
        },
        mounted() {
            this.init()
        },
        methods: {
            init() {
                uni.stopPullDownRefresh();
            },
        }
    }
</script>
<style lang="scss" scoped>
    ::v-deep .uicon-arrow-left>span {
        display: block;
    }
</style>
pages/wlgl/scrk.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,1807 @@
<template>
    <view>
        <page-nav title="生产入库" :topRightMessageCount="topRightMessageCount"></page-nav>
        <div class="sacnBody" v-if="contentArr.length===0">
            <div class="scanImg" @click="topScanClick"></div>
            <div class="scanText">扫描单据条码</div>
        </div>
        <view v-if="contentArr.length!==0" class="mainContent" :style="{maxHeight: '1340rpx',overflow: 'scroll'}">
            <view class="head">
                <view style="padding:20rpx 20rpx 20rpx 30rpx;">
                    <view class="marginBottom20 flex_column" style="width: 100%;"
                        @click="radioValueClick(item.inbarcode)" v-for="(item,index) in contentArr"
                        :key="item.inbarcode">
                        <view class="orderNumber" :key="item.inbarcode">
                            {{(index+1).toString().padStart(2,0)}}
                        </view>
                        <view class="trash" @click="trashClick(index)" v-show="contentArr.length>1">
                            <u-icon name="trash" size='40'></u-icon>
                        </view>
                        <!--
                        <view v-show="contentArr.length===1" style="width: 48rpx;height: 48rpx;">
                        </view> -->
                        <view class="flex_between marginBottom20">
                            <view style="display: flex;">
                                <view class="flex_column titleFont">
                                    <view style="font-weight: bold;margin-left: -20rpx;">
                                        <view class="head_block">
                                            <view class="head_left">
                                                <view class="head_bar"></view>
                                                <view class="head_title" style="color: rgba(0, 0, 0, 0.9);">
                                                    æ¡ç ä¿¡æ¯
                                                </view>
                                            </view>
                                        </view>
                                    </view>
                                    <view>条码编号:</view>
                                    <view>物料编码:</view>
                                    <view>物料名称:</view>
                                    <view>物料规格:</view>
                                    <view>物料数量:</view>
                                    <view>{{item.mpoid?'源单单号':'工单编号'}}</view>
                                    <view>操作时间:</view>
                                </view>
                                <view class="flex_column contentFont">
                                    <view style="opacity: 0;">
                                        <view class="head_block">
                                            <view class="head_left">
                                                <view class="head_bar"></view>
                                                <view class="head_title">
                                                    æ¡ç ä¿¡æ¯
                                                </view>
                                            </view>
                                        </view>
                                    </view>
                                    <view>{{item.inbarcode}}</view>
                                    <view>{{item.partcode}}</view>
                                    <view>{{item.partname}}</view>
                                    <view>{{item.partspec?item.partspec:'/'}}</view>
                                    <view>{{item.good_qty}}</view>
                                    <view>{{item.wo_code}}</view>
                                    <view>{{item.lm_date}}</view>
                                </view>
                            </view>
                            <!-- <u-radio size='40' :key="item.partcode" :name="item.partcode" activeColor="red"></u-radio> -->
                        </view>
                        <u-gap v-if="index!==contentArr.length-1" height="10" style="width: 110%;margin-left: -5%;"
                            bgColor="#eff0f1"></u-gap>
                    </view>
                </view>
            </view>
            <u-gap height="20" bgColor="#eff0f1"></u-gap>
            <view class="head">
                <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="marginRight20">
                        <u-icon name="scan" @click="stockCodeScanClick" color="red" size="56"></u-icon>
                    </view>
                </view>
                <view style="display:flex;justify-content: space-between; margin: 20rpx;">
                    <view class="titleFont">
                        ä»“库信息
                    </view>
                    <view class="contentFont">
                        {{stockcode===''?'待扫描':stockcodeArr.find(i=>i.code===stockcode).name}}
                    </view>
                </view>
            </view>
        </view>
        <u-button v-if="contentArr.length!==0" size="large" :disabled="stockcode===''" :loading="isDisabledSubmitButton"
            loadingText="正在提交,请稍等..." type="primary" @click="submit" text="确认提交">
        </u-button>
        <!-- æ‚¬æµ®çƒ -->
        <view v-if="contentArr.length!==0" @click="topScanClick">
            <drag-ball :x='$DeviceInformation.screenWidth*0.8' :y="$DeviceInformation.screenHeight*0.7"></drag-ball>
        </view>
    </view>
</template>
<script>
    import {
        NewOrderCodeSearch,
        ErpWarehouseSelect,
        ErpUserSelect,
        ErpWkshopDepartmentSelect,
        MesAppProductInHouseOrderBarCodeSearch,
        MesAppProductInHouseOrderBarCodeSave
    } from '../../config/api.js';
    import Vue from 'vue'
    const App = getApp()
    export default {
        onLoad(option) {
            App.watch(this.getTopRightMessageCountIsChange, 'topRightMessageCountIsChange')
        },
        onPullDownRefresh() {
            setTimeout(() => {
                this.init(() => {
                    uni.stopPullDownRefresh();
                })
            }, 1000);
        },
        data() {
            return {
                topRightMessageCount: '',
                isDisabledSubmitButton: false,
                contentArr: [{
                        "inbarcode": "IN23061286",
                        "saleOrderid": 1,
                        "saleOrderCode": "SO-2023-06-0001",
                        "saleOrderDetailId": 2,
                        "mpoid": 1,
                        "m_po": "MO-2023-06-0001",
                        "sbid": 2,
                        "wo_id": 1034,
                        "wo_code": "MO-2023-06-0001_1",
                        "materiel_id": 11,
                        "partcode": "301",
                        "partname": "电脑",
                        "partspec": "",
                        "unitid": 6,
                        "unitcode": "6",
                        "unitname": "台",
                        "step_code": "Step08",
                        "wkshp_id": 9,
                        "wkshp_code": "CJ001",
                        "stck_id": null,
                        "stockcode": null,
                        "stockname": null,
                        "saleOrderqty": 300,
                        "qty": 300,
                        "plan_qty": 300,
                        "good_qty": 297,
                        "inhouseqty": 0,
                        "stinhouseqty": 297,
                        "lm_date": "2023-06-12 16:51:02",
                        "style": "S"
                    }, {
                        "inbarcode": "IN23061285",
                        "saleOrderid": null,
                        "saleOrderCode": "",
                        "saleOrderDetailId": null,
                        "mpoid": null,
                        "m_po": "",
                        "sbid": null,
                        "wo_id": 1037,
                        "wo_code": "SGPO20230609_2",
                        "materiel_id": null,
                        "partcode": "03001",
                        "partname": "桌子",
                        "partspec": "",
                        "unitid": null,
                        "unitcode": null,
                        "unitname": null,
                        "step_code": "Step03",
                        "wkshp_id": null,
                        "wkshp_code": "CJ001",
                        "stck_id": null,
                        "stockcode": null,
                        "stockname": null,
                        "saleOrderqty": null,
                        "qty": null,
                        "plan_qty": 900,
                        "good_qty": 15,
                        "inhouseqty": 0,
                        "stinhouseqty": 15,
                        "lm_date": "2023-06-12 16:50:37",
                        "style": "B"
                    },
                    {
                        "inbarcode": "IN23061284",
                        "saleOrderid": null,
                        "saleOrderCode": "",
                        "saleOrderDetailId": null,
                        "mpoid": null,
                        "m_po": "",
                        "sbid": null,
                        "wo_id": 1037,
                        "wo_code": "SGPO20230609_2",
                        "materiel_id": null,
                        "partcode": "03001",
                        "partname": "桌子",
                        "partspec": "",
                        "unitid": null,
                        "unitcode": null,
                        "unitname": null,
                        "step_code": "Step03",
                        "wkshp_id": null,
                        "wkshp_code": "CJ001",
                        "stck_id": null,
                        "stockcode": null,
                        "stockname": null,
                        "saleOrderqty": null,
                        "qty": null,
                        "plan_qty": 900,
                        "good_qty": 10,
                        "inhouseqty": 0,
                        "stinhouseqty": 10,
                        "lm_date": "2023-06-12 16:50:23",
                        "style": "B"
                    }, {
                        "inbarcode": "IN23060969",
                        "saleOrderid": 1,
                        "saleOrderCode": "SO-2023-06-0001",
                        "saleOrderDetailId": 1,
                        "mpoid": 1,
                        "m_po": "MO-2023-06-0001",
                        "sbid": 1,
                        "wo_id": 1035,
                        "wo_code": "MO-2023-06-0001_2",
                        "materiel_id": 32,
                        "partcode": "03001",
                        "partname": "桌子",
                        "partspec": "",
                        "unitid": 1,
                        "unitcode": "1",
                        "unitname": "PCS",
                        "step_code": "Step03",
                        "wkshp_id": 9,
                        "wkshp_code": "CJ001",
                        "stck_id": null,
                        "stockcode": null,
                        "stockname": null,
                        "saleOrderqty": 100,
                        "qty": 100,
                        "plan_qty": 100,
                        "good_qty": 1,
                        "inhouseqty": 0,
                        "stinhouseqty": 1,
                        "lm_date": "2023-06-09 08:27:09",
                        "style": "B"
                    },
                    {
                        "inbarcode": "IN23061388",
                        "saleOrderid": null,
                        "saleOrderCode": "",
                        "saleOrderDetailId": null,
                        "mpoid": null,
                        "m_po": "",
                        "sbid": null,
                        "wo_id": 1039,
                        "wo_code": "SGPO20230613_3",
                        "materiel_id": null,
                        "partcode": "303",
                        "partname": "8703无刷无绳电锯",
                        "partspec": "",
                        "unitid": null,
                        "unitcode": null,
                        "unitname": null,
                        "step_code": "Step03",
                        "wkshp_id": null,
                        "wkshp_code": "CJ001",
                        "stck_id": null,
                        "stockcode": null,
                        "stockname": null,
                        "saleOrderqty": null,
                        "qty": null,
                        "plan_qty": 500,
                        "good_qty": 1,
                        "inhouseqty": 0,
                        "stinhouseqty": 1,
                        "lm_date": "2023-06-13 09:00:08",
                        "style": "B"
                    },
                    {
                        "inbarcode": "IN23061389",
                        "saleOrderid": null,
                        "saleOrderCode": "",
                        "saleOrderDetailId": null,
                        "mpoid": null,
                        "m_po": "",
                        "sbid": null,
                        "wo_id": 1039,
                        "wo_code": "SGPO20230613_3",
                        "materiel_id": null,
                        "partcode": "303",
                        "partname": "8703无刷无绳电锯",
                        "partspec": "",
                        "unitid": null,
                        "unitcode": null,
                        "unitname": null,
                        "step_code": "Step03",
                        "wkshp_id": null,
                        "wkshp_code": "CJ001",
                        "stck_id": null,
                        "stockcode": null,
                        "stockname": null,
                        "saleOrderqty": null,
                        "qty": null,
                        "plan_qty": 500,
                        "good_qty": 2,
                        "inhouseqty": 0,
                        "stinhouseqty": 2,
                        "lm_date": "2023-06-13 09:01:15",
                        "style": "B"
                    },
                    {
                        "inbarcode": "IN23061390",
                        "saleOrderid": null,
                        "saleOrderCode": "",
                        "saleOrderDetailId": null,
                        "mpoid": 3,
                        "m_po": "MO-2023-06-0003",
                        "sbid": 4,
                        "wo_id": 1044,
                        "wo_code": "MO-2023-06-0003_1",
                        "materiel_id": 11,
                        "partcode": "301",
                        "partname": "电脑",
                        "partspec": "",
                        "unitid": 6,
                        "unitcode": "6",
                        "unitname": "台",
                        "step_code": "Step08",
                        "wkshp_id": 9,
                        "wkshp_code": "CJ001",
                        "stck_id": null,
                        "stockcode": null,
                        "stockname": null,
                        "saleOrderqty": null,
                        "qty": 10,
                        "plan_qty": 10,
                        "good_qty": 5,
                        "inhouseqty": 0,
                        "stinhouseqty": 5,
                        "lm_date": "2023-06-13 09:14:09",
                        "style": "S"
                    },
                    {
                        "inbarcode": "IN23061391",
                        "saleOrderid": null,
                        "saleOrderCode": "",
                        "saleOrderDetailId": null,
                        "mpoid": 3,
                        "m_po": "MO-2023-06-0003",
                        "sbid": 4,
                        "wo_id": 1044,
                        "wo_code": "MO-2023-06-0003_1",
                        "materiel_id": 11,
                        "partcode": "301",
                        "partname": "电脑",
                        "partspec": "",
                        "unitid": 6,
                        "unitcode": "6",
                        "unitname": "台",
                        "step_code": "Step08",
                        "wkshp_id": 9,
                        "wkshp_code": "CJ001",
                        "stck_id": null,
                        "stockcode": null,
                        "stockname": null,
                        "saleOrderqty": null,
                        "qty": 10,
                        "plan_qty": 10,
                        "good_qty": 2,
                        "inhouseqty": 0,
                        "stinhouseqty": 2,
                        "lm_date": "2023-06-13 09:14:19",
                        "style": "S"
                    },
                    {
                        "inbarcode": "IN23061392",
                        "saleOrderid": 5,
                        "saleOrderCode": "SO-2023-06-0004",
                        "saleOrderDetailId": 7,
                        "mpoid": 5,
                        "m_po": "MO-2023-06-0005",
                        "sbid": 9,
                        "wo_id": 1042,
                        "wo_code": "MO-2023-06-0005_3",
                        "materiel_id": 32,
                        "partcode": "03001",
                        "partname": "桌子",
                        "partspec": "",
                        "unitid": 1,
                        "unitcode": "1",
                        "unitname": "PCS",
                        "step_code": "Step03",
                        "wkshp_id": 9,
                        "wkshp_code": "CJ001",
                        "stck_id": null,
                        "stockcode": null,
                        "stockname": null,
                        "saleOrderqty": 130,
                        "qty": 130,
                        "plan_qty": 65,
                        "good_qty": 6,
                        "inhouseqty": 0,
                        "stinhouseqty": 6,
                        "lm_date": "2023-06-13 09:15:37",
                        "style": "B"
                    },
                    {
                        "inbarcode": "IN23061393",
                        "saleOrderid": 5,
                        "saleOrderCode": "SO-2023-06-0004",
                        "saleOrderDetailId": 7,
                        "mpoid": 5,
                        "m_po": "MO-2023-06-0005",
                        "sbid": 9,
                        "wo_id": 1042,
                        "wo_code": "MO-2023-06-0005_3",
                        "materiel_id": 32,
                        "partcode": "03001",
                        "partname": "桌子",
                        "partspec": "",
                        "unitid": 1,
                        "unitcode": "1",
                        "unitname": "PCS",
                        "step_code": "Step03",
                        "wkshp_id": 9,
                        "wkshp_code": "CJ001",
                        "stck_id": null,
                        "stockcode": null,
                        "stockname": null,
                        "saleOrderqty": 130,
                        "qty": 130,
                        "plan_qty": 65,
                        "good_qty": 7,
                        "inhouseqty": 0,
                        "stinhouseqty": 7,
                        "lm_date": "2023-06-13 09:15:49",
                        "style": "B"
                    }
                ], //内容数组
                stockcode: '03', //仓库信息
                stockcodeArr: [], //仓库信息数组
                userArr: [], //用户数组
                departmentArr: [], //部门数组
            }
        },
        created() {
            // this.getMesAppProductInHouseOrderBarCodeSearch('IN23060981')
            // this.global.getTPlusToken()
        },
        mounted() {
            this.init()
            this.topRightMessageCount = uni.getStorageSync('topRightMessageCount')
            this.getErpWarehouseSelect() //获取生产仓库信息数组
            // this.getErpUserSelect() //获取人员
            // this.getErpWkshopDepartmentSelect() //获取部门信息
        },
        methods: {
            init() {
                uni.stopPullDownRefresh();
            },
            // èŽ·å–å®‰ç¯æ¶ˆæ¯åˆ—è¡¨é•¿åº¦
            getTopRightMessageCountIsChange(val) {
                this.topRightMessageCount = val
            },
            async getErpWkshopDepartmentSelect() {
                const res = await ErpWkshopDepartmentSelect()
                this.departmentArr = res.data
            },
            async getErpUserSelect() {
                const res = await ErpUserSelect()
                this.userArr = res.data
            },
            async getErpWarehouseSelect() {
                const res = await ErpWarehouseSelect()
                this.stockcodeArr = res.data
            },
            async getMesAppProductInHouseOrderBarCodeSearch(labcode) {
                const data = {
                    labcode
                }
                const res = await MesAppProductInHouseOrderBarCodeSearch(this.global.formatData(data))
                // this.contentArr = res.data ? res.data : []
                this.contentArr.push(res.data[0])
            },
            // æ‰«å•据条码
            topScanClick() {
                let that = this;
                uni.scanCode({
                    onlyFromCamera: true,
                    // scanType: ['barCode', 'qrCode'],
                    scanType: ['qrCode'],
                    success: function(res) {
                        console.log('条码类型:' + res.scanType);
                        console.log('条码内容:' + res.result);
                        // that.getMesAppProductInHouseOrderBarCodeSearch(res.result)
                        if (that.contentArr.find(i => i.inbarcode === res.result)) {
                            that.$u.toast('此条码已扫描,已在列表中!')
                        } else {
                            //处理扫码事件
                            that.getMesAppProductInHouseOrderBarCodeSearch(res.result);
                        }
                    },
                    complete: function(res) {
                    },
                    fail: function(res) {
                        console.log('条码类型:' + res.scanType);
                        console.log('条码内容:' + res.result);
                    }
                });
            },
            // ä»“库信息扫描
            stockCodeScanClick() {
                let that = this;
                uni.scanCode({
                    onlyFromCamera: true,
                    // scanType: ['barCode', 'qrCode'],
                    scanType: ['qrCode'],
                    success: function(res) {
                        console.log('条码类型:' + res.scanType);
                        console.log('条码内容:' + res.result);
                        that.stockcode = res.result
                        if (!that.stockcodeArr.find(i => i.code === res.result)) {
                            that.$u.toast('无效仓库码!')
                        }
                    },
                    complete: function(res) {
                    },
                    fail: function(res) {
                        console.log('条码类型:' + res.scanType);
                        console.log('条码内容:' + res.result);
                    }
                });
            },
            // åˆ é™¤äº‹ä»¶ç‚¹å‡»
            trashClick(val) {
                this.contentArr.splice(val, 1)
            },
            async submit() {
                console.log(this.contentArr)
                console.log(JSON.parse(JSON.stringify(this.contentArr)))
                // å…ˆåˆ†æœ‰æºå•、无源单
                //有源单的通过源单号、产品合并
                //无源单的通过工单号、产品合并
                // æœ‰æºå•
                let temp1 = this.contentArr.filter(i => i.m_po)
                // æ— æºå•
                let temp2 = this.contentArr.filter(i => !i.m_po)
                console.log(temp1, temp2, 1)
                let m_poArr = [...new Set(temp1.map(i => i.m_po))]
                console.log(m_poArr, 2)
                let array1 = []
                m_poArr.forEach(i => {
                    let array2 = []
                    const t1 = temp1.filter(m => m.m_po === i)
                    // å…ˆæ‰¾åˆ°è¿™ä¸ªæºå•下的产品    è‹¥äº§å“ç›¸åŒåˆ™è¿›è¡Œåˆå¹¶
                    t1.forEach(m => {
                        let array3 = []
                        const partcodeArr = [...new Set(t1.map(j => j.partcode))]
                        partcodeArr.forEach(k => {
                            const t = t1.find(j => j.partcode === k)
                            let sum = 0
                            const good_qty = t1.filter(j => j.partcode === k).map(j =>
                                parseFloat(j.good_qty)).reduce((pre, curr) => {
                                sum = pre + curr
                                return sum
                            })
                            sum = 0
                            const inhouseqty = t1.filter(j => j.partcode === k).map(j =>
                                parseFloat(j.inhouseqty)).reduce((pre, curr) => {
                                sum = pre + curr
                                return sum
                            })
                            sum = 0
                            const stinhouseqty = t1.filter(j => j.partcode === k).map(j =>
                                parseFloat(j.stinhouseqty)).reduce((pre, curr) => {
                                sum = pre + curr
                                return sum
                            })
                            array3.push({
                                stockcode: this.stockcode,
                                partcode: t.partcode,
                                partname: t.partname,
                                partspec: t.partspec,
                                qty: t.qty,
                                good_qty,
                                inhouseqty,
                                stinhouseqty,
                                unitid: t.unitid,
                                unitname: t.unitname,
                                sourceVoucherDetailId: t.sbid,
                                saleOrderDetailId: t.saleOrderDetailId,
                                ManufactureOrderDetailId: t.sbid,
                                stck_id: '',
                                SourceVoucherDetailIdByMergedFlow: t.sbid,
                                materiel_code: t.partcode,
                                warehouse: t.stockcode,
                                materiel_id: t.materiel_id
                            })
                        })
                        array2.push(array3)
                    })
                    array1.push(array2)
                })
                console.log(array1, 12)
                console.log(array1.flat(3), 13)
                //再写逻辑
                // let partcode2 = temp2.map(i => i.)
            },
            async submit2() {
                console.log('我是最先执行!')
                this.isDisabledSubmitButton = true
                const openToken = await this.global.getTPlusToken()
                console.log(openToken)
                console.log('我是最后执行!')
                const {
                    data: r1
                } = await NewOrderCodeSearch(this.global.formatData({
                    rightcode: '2064'
                }))
                const headers = {
                    'openToken': openToken,
                    'appKey': Vue.prototype.$AppKey,
                    'appSecret': Vue.prototype.$AppSecret,
                    'Content-Type': 'application/json'
                }
                const partcodeArr = [...new Set(this.contentArr.map(i => i.partcode))] // æ•°ç»„去重
                let tableDataSummary = []
                partcodeArr.forEach(i => {
                    const t = this.contentArr.find(j => j.partcode === i)
                    let sum = 0
                    const good_qty = this.contentArr.filter(j => j.partcode === i).map(j =>
                        parseFloat(
                            j
                            .good_qty)).reduce((pre, curr) => {
                        sum = pre + curr
                        return sum
                    })
                    sum = 0
                    const inhouseqty = this.contentArr.filter(j => j.partcode === i).map(
                        j =>
                        parseFloat(j
                            .inhouseqty)).reduce((pre, curr) => {
                        sum = pre + curr
                        return sum
                    })
                    sum = 0
                    const stinhouseqty = this.contentArr.filter(j => j.partcode === i).map(
                        j =>
                        parseFloat(j
                            .stinhouseqty)).reduce((pre, curr) => {
                        sum = pre + curr
                        return sum
                    })
                    tableDataSummary.push({
                        stockcode: this.stockcode,
                        partcode: t.partcode,
                        partname: t.partname,
                        partspec: t.partspec,
                        qty: t.qty,
                        good_qty,
                        inhouseqty,
                        stinhouseqty,
                        unitid: t.unitid,
                        unitname: t.unitname,
                        sourceVoucherDetailId: t.sbid,
                        saleOrderDetailId: t.saleOrderDetailId,
                        ManufactureOrderDetailId: t.sbid,
                        stck_id: this.stockcode ? this.stockcodeArr.find(i => i
                            .code === this.stockcode).id : '',
                        SourceVoucherDetailIdByMergedFlow: t.sbid,
                        materiel_code: t.partcode,
                        warehouse: this.stockcode,
                        materiel_id: t.materiel_id
                    })
                })
                // å½“flag为null时 ä¸ºæ— æºå•      åä¹‹ ä¸ºæœ‰æºå•
                let flag = this.contentArr[0].mpoid === null
                // æ— æºå•
                if (flag) {
                    const RDRecordDetails = []
                    tableDataSummary.forEach((i, index) => {
                        RDRecordDetails.push({
                            Code: index + 1, // è¡Œå·ï¼Œä»Ž1开始自增长
                            Inventory: {
                                Code: i.materiel_code // å­˜è´§ç¼–码
                            },
                            BaseQuantity: i.stinhouseqty, // ä¸»è®¡é‡å•位数量
                            SNObject: {
                                SnAccountDetails: [{
                                    SNCode: index.toString().padStart(4,
                                        '0')
                                }]
                            }
                        })
                    })
                    const data = {
                        'dto': {
                            'IsModifiedCode': true,
                            'ExternalCode': r1[0],
                            'Code': r1[0],
                            'VoucherType': {
                                'Code': 'ST1002'
                            },
                            'VoucherDate': this.global.handleDatetime(new Date().getTime()),
                            'BusiType': {
                                'Code': '03'
                            },
                            'Warehouse': {
                                'Code': this.stockcode
                            },
                            'Department': {
                                'Code': this.contentArr[0].wkshp_code,
                                // 'Name': this.stockcodeArr.find(i => i.code === this.stockcode)
                                //     .name
                            },
                            'RDRecordDetails': RDRecordDetails
                        }
                    }
                    await new Promise((resolve, reject) => {
                        uni.request({
                            url: Vue.prototype.$chanjetBaseUrl +
                                '/tplus/api/v2/productReceive/Create',
                            data: data,
                            method: 'POST',
                            header: headers,
                            success: (r2) => {
                                if (r2.data === null) {
                                    // this.contentArr.forEach(i => {
                                    //     i.stockcode = this.stockcode
                                    //     i.stockname = this.stockcodeArr.find(j => j.code ===
                                    //         this.stockcode).name
                                    //     i.id = this.stockcodeArr.find(j => j
                                    //         .code === this.stockcode).id
                                    // })
                                    const head = {
                                        rightcode: '2064',
                                        hbillno: r1[0],
                                        incbit: r1[1],
                                        wkshpcode: this.contentArr[0]
                                            .wkshp_code,
                                        sourceVoucherId: !flag ? this
                                            .contentArr[0]
                                            .mpoid : this
                                            .contentArr[0].wo_id,
                                        sourceVoucherCode: !flag ? this
                                            .contentArr[0]
                                            .m_po : this
                                            .contentArr[0].wo_code,
                                        saleOrderId: this.contentArr[0]
                                            .saleOrderid,
                                        saleOrderCode: this.contentArr[0]
                                            .saleOrderCode,
                                        rdDirectionFlag: 1,
                                        // makerid: this.userArr.find(i => i.name === uni
                                        //     .getStorageSync(
                                        //         'username')).id,
                                        makerid: '',
                                        maker: uni.getStorageSync(
                                            'username'),
                                        accountingyear: new Date()
                                            .getFullYear(),
                                        VoucherYear: new Date()
                                            .getFullYear(),
                                        VoucherPeriod: new Date()
                                            .getMonth() + 1,
                                        ManufactureOrderCode: !flag ? this
                                            .contentArr[
                                                0].m_po : this
                                            .contentArr[0].wo_code,
                                        idbusitype: '03',
                                        iddepartment: '',
                                        idrdstyle: 21,
                                        idwarehouse: '',
                                        voucherState: 181,
                                        idvouchertype: 15,
                                        voucherdate: this.global
                                            .handleDatetime(
                                                new Date()
                                                .getTime()),
                                        madedate: this.global
                                            .handleDatetime(new Date()
                                                .getTime()),
                                        createdtime: this.global
                                            .handleDatetime2(
                                                new Date()
                                                .getTime()),
                                        DataSource: '56133',
                                        idsourcevouchertype: 69
                                    }
                                    const subsum = []
                                    tableDataSummary.forEach((i, index) => {
                                        subsum.push({
                                            code: index
                                                .toString()
                                                .padStart(4,
                                                    '0'),
                                            rownumber: index +
                                                1,
                                            arrivalQuantity: i
                                                .qty,
                                            quantity: i
                                                .stinhouseqty,
                                            compositionQuantity: i
                                                .stinhouseqty +
                                                i
                                                .unitname,
                                            baseQuantity: i
                                                .stinhouseqty,
                                            sourceVoucherId: !
                                                flag ? this
                                                .contentArr[
                                                    0].mpoid : '',
                                            sourceVoucherCode: '',
                                            sourceVoucherDetailId: i
                                                .sourceVoucherDetailId,
                                            idsourcevouchertype: 69,
                                            saleOrderId: this
                                                .contentArr[0]
                                                .saleOrderid,
                                            saleOrderCode: this
                                                .contentArr[
                                                    0]
                                                .saleOrderCode,
                                            saleOrderDetailId: i
                                                .saleOrderDetailId,
                                            ManufactureOrderId:
                                                !flag ?
                                                this
                                                .contentArr[0]
                                                .mpoid : '',
                                            ManufactureOrderCode:
                                                !flag ?
                                                this
                                                .contentArr[0]
                                                .m_po : this
                                                .contentArr[
                                                    0]
                                                .wo_code,
                                            ManufactureOrderDetailId: i
                                                .ManufactureOrderDetailId,
                                            idbusiTypeByMergedFlow: 3,
                                            idinventory: i
                                                .materiel_id,
                                            idbaseunit: i
                                                .unitid,
                                            idunit: i.unitid,
                                            idwarehouse: i
                                                .stck_id,
                                            SourceVoucherIdByMergedFlow: this
                                                .contentArr[0]
                                                .mpoid,
                                            SourceVoucherCodeByMergedFlow: this
                                                .contentArr[0]
                                                .m_po,
                                            SourceVoucherDetailIdByMergedFlow: i
                                                .SourceVoucherDetailIdByMergedFlow,
                                            idsourceVoucherTypeByMergedFlow: 69,
                                            createdtime: this
                                                .global
                                                .handleDatetime2(
                                                    new Date()
                                                    .getTime()
                                                ),
                                            DataSource: '56133',
                                            materiel_code: i
                                                .materiel_code,
                                            warehouse: i
                                                .warehouse
                                        })
                                    })
                                    const data = {
                                        head,
                                        sub: this.contentArr,
                                        subsum
                                    }
                                    MesAppProductInHouseOrderBarCodeSave(this
                                        .global.formatData({
                                            username: uni.getStorageSync('username')
                                        }), data).then(r3 => {
                                        if (r3.code === '200') {
                                            this.$u.toast('入库成功!')
                                            this.stockcode = ''
                                            this.contentArr = []
                                            this.isDisabledSubmitButton = false
                                        } else {
                                            this.$u.toast('入库失败!')
                                            this.isDisabledSubmitButton = false
                                        }
                                    })
                                }
                            }
                        })
                    })
                }
                // æœ‰æºå•
                if (!flag) {
                    const RDRecordDetails = []
                    tableDataSummary.forEach((i, index) => {
                        RDRecordDetails.push({
                            Code: index + 1, // è¡Œå·ï¼Œä»Ž1开始自增长
                            SourceVoucherId: this.contentArr[0].mpoid, // æ¥æºå•据的单据ID
                            BaseQuantity: i.stinhouseqty, // ä¸»è®¡é‡å•位数量
                            SourceVoucherDetailId: i
                                .sourceVoucherDetailId, // æ¥æºå•据的对应明细ID
                            Inventory: {
                                Code: i.materiel_code // å­˜è´§ç¼–码
                            },
                            IdSourceVoucherType: 69
                        })
                    })
                    const data = {
                        'dto': {
                            'Warehouse': {
                                'Code': this.stockcode // ä»“库编码
                            },
                            'Code': r1[0], // å•据编码
                            'IsModifiedCode': true,
                            'BusiType': {
                                'Code': '03' // ä¸šåŠ¡ç±»åž‹ç¼–ç 
                            },
                            'Department': {
                                'Code': this.contentArr[0].wkshp_code // éƒ¨é—¨ç¼–码
                            },
                            'VoucherDate': this.global.handleDatetime(new Date()
                                .getTime()), // å•据日期
                            'RdStyle': {
                                'Code': '21' // å‡ºåº“类别编码
                            },
                            'RDRecordDetails': RDRecordDetails,
                            'ExternalCode': r1[0],
                            'VoucherType': {
                                'Code': 'ST1002'
                            }
                        }
                    }
                    await new Promise((resolve, reject) => {
                        uni.request({
                            url: Vue.prototype.$chanjetBaseUrl +
                                '/tplus/api/v2/ProductReceiveOpenApi/Create',
                            data: data,
                            method: 'POST',
                            header: headers,
                            success: (r2) => {
                                if (r2.data.code === 0) {
                                    this.contentArr.forEach(i => {
                                        i.stockcode = this.stockcode
                                        i.stockname = this.stockcodeArr.find(j => j
                                            .code ===
                                            this.stockcode).name
                                        i.id = this.stockcodeArr.find(j => j
                                            .code === this
                                            .stockcode).id
                                    })
                                    const head = {
                                        rightcode: '2064',
                                        hbillno: r1[0],
                                        incbit: r1[1],
                                        wkshpcode: this.contentArr[0].wkshp_code,
                                        sourceVoucherId: !flag ? this.contentArr[0]
                                            .mpoid : this
                                            .contentArr[0].wo_id,
                                        sourceVoucherCode: !flag ? this.contentArr[0]
                                            .m_po : this
                                            .contentArr[0].wo_code,
                                        saleOrderId: this.contentArr[0].saleOrderid,
                                        saleOrderCode: this.contentArr[0]
                                            .saleOrderCode,
                                        rdDirectionFlag: 1,
                                        // makerid: this.userArr.find(i => i.name === uni
                                        //     .getStorageSync('username')).id,
                                        makerid: '',
                                        maker: uni.getStorageSync('username'),
                                        accountingyear: new Date().getFullYear(),
                                        VoucherYear: new Date().getFullYear(),
                                        VoucherPeriod: new Date().getMonth() + 1,
                                        ManufactureOrderCode: !flag ? this.contentArr[
                                                0].m_po : this.contentArr[0]
                                            .wo_code,
                                        idbusitype: '03',
                                        iddepartment: '',
                                        idrdstyle: 21,
                                        idwarehouse: '',
                                        voucherState: 181,
                                        idvouchertype: 15,
                                        voucherdate: this.global.handleDatetime(
                                            new Date()
                                            .getTime()),
                                        madedate: this.global.handleDatetime(new Date()
                                            .getTime()),
                                        createdtime: this.global.handleDatetime2(
                                            new Date()
                                            .getTime()),
                                        DataSource: '56133',
                                        idsourcevouchertype: 69
                                    }
                                    const subsum = []
                                    tableDataSummary.forEach((i, index) => {
                                        subsum.push({
                                            code: index.toString()
                                                .padStart(4, '0'),
                                            rownumber: index + 1,
                                            arrivalQuantity: i.qty,
                                            quantity: i.stinhouseqty,
                                            compositionQuantity: i
                                                .stinhouseqty + i
                                                .unitname,
                                            baseQuantity: i.stinhouseqty,
                                            sourceVoucherId: !flag ? this
                                                .contentArr[
                                                    0].mpoid : '',
                                            sourceVoucherCode: !flag ? this
                                                .contentArr[
                                                    0].m_po : this
                                                .contentArr[0].wo_code,
                                            sourceVoucherDetailId: i
                                                .sourceVoucherDetailId,
                                            idsourcevouchertype: 69,
                                            saleOrderId: this.contentArr[0]
                                                .saleOrderid,
                                            saleOrderCode: this.contentArr[
                                                    0]
                                                .saleOrderCode,
                                            saleOrderDetailId: i
                                                .saleOrderDetailId,
                                            ManufactureOrderId: !flag ?
                                                this
                                                .contentArr[0].mpoid : '',
                                            ManufactureOrderCode: !flag ?
                                                this
                                                .contentArr[0].m_po : this
                                                .contentArr[
                                                    0].wo_code,
                                            ManufactureOrderDetailId: i
                                                .ManufactureOrderDetailId,
                                            idbusiTypeByMergedFlow: 3,
                                            idinventory: i.materiel_id,
                                            idbaseunit: i.unitid,
                                            idunit: i.unitid,
                                            idwarehouse: i.stck_id,
                                            SourceVoucherIdByMergedFlow: this
                                                .contentArr[0].mpoid,
                                            SourceVoucherCodeByMergedFlow: this
                                                .contentArr[0].m_po,
                                            SourceVoucherDetailIdByMergedFlow: i
                                                .SourceVoucherDetailIdByMergedFlow,
                                            idsourceVoucherTypeByMergedFlow: 69,
                                            createdtime: this.global
                                                .handleDatetime2(
                                                    new Date().getTime()),
                                            DataSource: '56133',
                                            materiel_code: i.materiel_code,
                                            warehouse: i.warehouse
                                        })
                                    })
                                    const data = {
                                        head,
                                        sub: this.contentArr,
                                        subsum
                                    }
                                    MesAppProductInHouseOrderBarCodeSave(this.global
                                        .formatData({
                                            username: uni.getStorageSync(
                                                'username')
                                        }), data).then(r3 => {
                                        if (r3.code === '200') {
                                            this.$u.toast('入库成功!')
                                            this.stockcode = ''
                                            this.contentArr = []
                                            this.isDisabledSubmitButton = false
                                        } else {
                                            this.$u.toast('入库失败!')
                                            this.isDisabledSubmitButton = false
                                        }
                                    })
                                }
                            },
                        })
                    })
                }
            },
            // æäº¤
            submit3() {
                this.isDisabledSubmitButton = true
                NewOrderCodeSearch(this.global.formatData({
                    rightcode: '2064'
                })).then(r => {
                    let r1 = r.data
                    console.log(r1, '执行了')
                    const headers = {
                        'openToken': uni.getStorageSync('openToken'),
                        'appKey': Vue.prototype.$AppKey,
                        'appSecret': Vue.prototype.$AppSecret,
                        'Content-Type': 'application/json'
                    }
                    const partcodeArr = [...new Set(this.contentArr.map(i => i.partcode))] // æ•°ç»„去重
                    let tableDataSummary = []
                    partcodeArr.forEach(i => {
                        const t = this.contentArr.find(j => j.partcode === i)
                        let sum = 0
                        const good_qty = this.contentArr.filter(j => j.partcode === i).map(j =>
                            parseFloat(
                                j
                                .good_qty)).reduce((pre, curr) => {
                            sum = pre + curr
                            return sum
                        })
                        sum = 0
                        const inhouseqty = this.contentArr.filter(j => j.partcode === i).map(
                            j =>
                            parseFloat(j
                                .inhouseqty)).reduce((pre, curr) => {
                            sum = pre + curr
                            return sum
                        })
                        sum = 0
                        const stinhouseqty = this.contentArr.filter(j => j.partcode === i).map(
                            j =>
                            parseFloat(j
                                .stinhouseqty)).reduce((pre, curr) => {
                            sum = pre + curr
                            return sum
                        })
                        tableDataSummary.push({
                            stockcode: this.stockcode,
                            partcode: t.partcode,
                            partname: t.partname,
                            partspec: t.partspec,
                            qty: t.qty,
                            good_qty,
                            inhouseqty,
                            stinhouseqty,
                            unitid: t.unitid,
                            unitname: t.unitname,
                            sourceVoucherDetailId: t.sbid,
                            saleOrderDetailId: t.saleOrderDetailId,
                            ManufactureOrderDetailId: t.sbid,
                            stck_id: this.stockcode ? this.stockcodeArr.find(i => i
                                .code === this.stockcode).id : '',
                            SourceVoucherDetailIdByMergedFlow: t.sbid,
                            materiel_code: t.partcode,
                            warehouse: this.stockcode,
                            materiel_id: t.materiel_id
                        })
                    })
                    // å½“flag为null时 ä¸ºæ— æºå•      åä¹‹ ä¸ºæœ‰æºå•
                    let flag = this.contentArr[0].mpoid === null
                    // æ— æºå•
                    if (flag) {
                        const RDRecordDetails = []
                        tableDataSummary.forEach((i, index) => {
                            RDRecordDetails.push({
                                Code: index + 1, // è¡Œå·ï¼Œä»Ž1开始自增长
                                Inventory: {
                                    Code: i.materiel_code // å­˜è´§ç¼–码
                                },
                                BaseQuantity: i.stinhouseqty, // ä¸»è®¡é‡å•位数量
                                SNObject: {
                                    SnAccountDetails: [{
                                        SNCode: index.toString().padStart(4,
                                            '0')
                                    }]
                                }
                            })
                        })
                        const data = {
                            'dto': {
                                'IsModifiedCode': true,
                                'ExternalCode': r1[0],
                                'Code': r1[0],
                                'VoucherType': {
                                    'Code': 'ST1002'
                                },
                                'VoucherDate': this.global.handleDatetime(new Date().getTime()),
                                'BusiType': {
                                    'Code': '03'
                                },
                                'Warehouse': {
                                    'Code': this.stockcode
                                },
                                'Department': {
                                    'Code': this.contentArr[0].wkshp_code,
                                    // 'Name': this.stockcodeArr.find(i => i.code === this.stockcode)
                                    //     .name
                                },
                                'RDRecordDetails': RDRecordDetails
                            }
                        }
                        console.log('执行了')
                        console.log(data)
                        new Promise((resolve, reject) => {
                            uni.request({
                                url: Vue.prototype.$chanjetBaseUrl +
                                    '/tplus/api/v2/productReceive/Create',
                                data: data,
                                method: 'POST',
                                header: headers,
                                success: (r2) => {
                                    console.log(r2, '王老吉')
                                    if (r2.data === null) {
                                        // this.contentArr.forEach(i => {
                                        //     i.stockcode = this.stockcode
                                        //     i.stockname = this.stockcodeArr.find(j => j.code ===
                                        //         this.stockcode).name
                                        //     i.id = this.stockcodeArr.find(j => j
                                        //         .code === this.stockcode).id
                                        // })
                                        console.log(this.contentArr, 6)
                                        const head = {
                                            rightcode: '2064',
                                            hbillno: r1[0],
                                            incbit: r1[1],
                                            wkshpcode: this.contentArr[0]
                                                .wkshp_code,
                                            sourceVoucherId: !flag ? this
                                                .contentArr[0]
                                                .mpoid : this
                                                .contentArr[0].wo_id,
                                            sourceVoucherCode: !flag ? this
                                                .contentArr[0]
                                                .m_po : this
                                                .contentArr[0].wo_code,
                                            saleOrderId: this.contentArr[0]
                                                .saleOrderid,
                                            saleOrderCode: this.contentArr[0]
                                                .saleOrderCode,
                                            rdDirectionFlag: 1,
                                            // makerid: this.userArr.find(i => i.name === uni
                                            //     .getStorageSync(
                                            //         'username')).id,
                                            makerid: '',
                                            maker: uni.getStorageSync(
                                                'username'),
                                            accountingyear: new Date()
                                                .getFullYear(),
                                            VoucherYear: new Date()
                                                .getFullYear(),
                                            VoucherPeriod: new Date()
                                                .getMonth() + 1,
                                            ManufactureOrderCode: !flag ? this
                                                .contentArr[
                                                    0].m_po : this
                                                .contentArr[0].wo_code,
                                            idbusitype: '03',
                                            iddepartment: '',
                                            idrdstyle: 21,
                                            idwarehouse: '',
                                            voucherState: 181,
                                            idvouchertype: 15,
                                            voucherdate: this.global
                                                .handleDatetime(
                                                    new Date()
                                                    .getTime()),
                                            madedate: this.global
                                                .handleDatetime(new Date()
                                                    .getTime()),
                                            createdtime: this.global
                                                .handleDatetime2(
                                                    new Date()
                                                    .getTime()),
                                            DataSource: '56133',
                                            idsourcevouchertype: 69
                                        }
                                        console.log(head, 'head')
                                        const subsum = []
                                        tableDataSummary.forEach((i, index) => {
                                            subsum.push({
                                                code: index
                                                    .toString()
                                                    .padStart(4,
                                                        '0'),
                                                rownumber: index +
                                                    1,
                                                arrivalQuantity: i
                                                    .qty,
                                                quantity: i
                                                    .stinhouseqty,
                                                compositionQuantity: i
                                                    .stinhouseqty +
                                                    i
                                                    .unitname,
                                                baseQuantity: i
                                                    .stinhouseqty,
                                                sourceVoucherId: !
                                                    flag ? this
                                                    .contentArr[
                                                        0].mpoid : '',
                                                sourceVoucherCode: '',
                                                sourceVoucherDetailId: i
                                                    .sourceVoucherDetailId,
                                                idsourcevouchertype: 69,
                                                saleOrderId: this
                                                    .contentArr[0]
                                                    .saleOrderid,
                                                saleOrderCode: this
                                                    .contentArr[
                                                        0]
                                                    .saleOrderCode,
                                                saleOrderDetailId: i
                                                    .saleOrderDetailId,
                                                ManufactureOrderId:
                                                    !flag ?
                                                    this
                                                    .contentArr[0]
                                                    .mpoid : '',
                                                ManufactureOrderCode:
                                                    !flag ?
                                                    this
                                                    .contentArr[0]
                                                    .m_po : this
                                                    .contentArr[
                                                        0]
                                                    .wo_code,
                                                ManufactureOrderDetailId: i
                                                    .ManufactureOrderDetailId,
                                                idbusiTypeByMergedFlow: 3,
                                                idinventory: i
                                                    .materiel_id,
                                                idbaseunit: i
                                                    .unitid,
                                                idunit: i.unitid,
                                                idwarehouse: i
                                                    .stck_id,
                                                SourceVoucherIdByMergedFlow: this
                                                    .contentArr[0]
                                                    .mpoid,
                                                SourceVoucherCodeByMergedFlow: this
                                                    .contentArr[0]
                                                    .m_po,
                                                SourceVoucherDetailIdByMergedFlow: i
                                                    .SourceVoucherDetailIdByMergedFlow,
                                                idsourceVoucherTypeByMergedFlow: 69,
                                                createdtime: this
                                                    .global
                                                    .handleDatetime2(
                                                        new Date()
                                                        .getTime()
                                                    ),
                                                DataSource: '56133',
                                                materiel_code: i
                                                    .materiel_code,
                                                warehouse: i
                                                    .warehouse
                                            })
                                        })
                                        const data = {
                                            head,
                                            sub: this.contentArr,
                                            subsum
                                        }
                                        console.log(data, '累了困了', 2)
                                        MesAppProductInHouseOrderBarCodeSave(this
                                            .global
                                            .formatData({
                                                username: uni
                                                    .getStorageSync(
                                                        'username')
                                            }), data).then(r3 => {
                                            if (r3.code === '200') {
                                                this.$u.toast('入库成功!')
                                                this.stockcode = ''
                                                this.contentArr = []
                                                this.isDisabledSubmitButton =
                                                    false
                                            } else {
                                                this.$u.toast('入库失败!')
                                                this.isDisabledSubmitButton =
                                                    false
                                            }
                                        })
                                    }
                                    resolve('success')
                                },
                                fail: (e) => {
                                    console.log(e)
                                    reject('e')
                                }
                            });
                        })
                        console.log('jiaduobao ')
                    }
                    // æœ‰æºå•
                    if (!flag) {
                        const RDRecordDetails = []
                        tableDataSummary.forEach((i, index) => {
                            RDRecordDetails.push({
                                Code: index + 1, // è¡Œå·ï¼Œä»Ž1开始自增长
                                SourceVoucherId: this.contentArr[0].mpoid, // æ¥æºå•据的单据ID
                                BaseQuantity: i.stinhouseqty, // ä¸»è®¡é‡å•位数量
                                SourceVoucherDetailId: i
                                    .sourceVoucherDetailId, // æ¥æºå•据的对应明细ID
                                Inventory: {
                                    Code: i.materiel_code // å­˜è´§ç¼–码
                                },
                                IdSourceVoucherType: 69
                            })
                        })
                        const data = {
                            'dto': {
                                'Warehouse': {
                                    'Code': this.stockcode // ä»“库编码
                                },
                                'Code': r1[0], // å•据编码
                                'IsModifiedCode': true,
                                'BusiType': {
                                    'Code': '03' // ä¸šåŠ¡ç±»åž‹ç¼–ç 
                                },
                                'Department': {
                                    'Code': this.contentArr[0].wkshp_code // éƒ¨é—¨ç¼–码
                                },
                                'VoucherDate': this.global.handleDatetime(new Date()
                                    .getTime()), // å•据日期
                                'RdStyle': {
                                    'Code': '21' // å‡ºåº“类别编码
                                },
                                'RDRecordDetails': RDRecordDetails,
                                'ExternalCode': r1[0],
                                'VoucherType': {
                                    'Code': 'ST1002'
                                }
                            }
                        }
                        console.log('执行了')
                        console.log(data)
                        uni.request({
                            url: Vue.prototype.$chanjetBaseUrl +
                                '/tplus/api/v2/ProductReceiveOpenApi/Create',
                            data: data,
                            method: 'POST',
                            header: headers,
                            success: (r2) => {
                                console.log(r2.data.code === 0, 34)
                                if (r2.data.code === 0) {
                                    this.contentArr.forEach(i => {
                                        i.stockcode = this.stockcode
                                        i.stockname = this.stockcodeArr.find(j => j
                                            .code ===
                                            this.stockcode).name
                                        i.id = this.stockcodeArr.find(j => j
                                            .code === this
                                            .stockcode).id
                                    })
                                    const head = {
                                        rightcode: '2064',
                                        hbillno: r1[0],
                                        incbit: r1[1],
                                        wkshpcode: this.contentArr[0].wkshp_code,
                                        sourceVoucherId: !flag ? this.contentArr[0]
                                            .mpoid : this
                                            .contentArr[0].wo_id,
                                        sourceVoucherCode: !flag ? this.contentArr[0]
                                            .m_po : this
                                            .contentArr[0].wo_code,
                                        saleOrderId: this.contentArr[0].saleOrderid,
                                        saleOrderCode: this.contentArr[0]
                                            .saleOrderCode,
                                        rdDirectionFlag: 1,
                                        // makerid: this.userArr.find(i => i.name === uni
                                        //     .getStorageSync('username')).id,
                                        makerid: '',
                                        maker: uni.getStorageSync('username'),
                                        accountingyear: new Date().getFullYear(),
                                        VoucherYear: new Date().getFullYear(),
                                        VoucherPeriod: new Date().getMonth() + 1,
                                        ManufactureOrderCode: !flag ? this.contentArr[
                                                0].m_po : this.contentArr[0]
                                            .wo_code,
                                        idbusitype: '03',
                                        iddepartment: '',
                                        idrdstyle: 21,
                                        idwarehouse: '',
                                        voucherState: 181,
                                        idvouchertype: 15,
                                        voucherdate: this.global.handleDatetime(
                                            new Date()
                                            .getTime()),
                                        madedate: this.global.handleDatetime(new Date()
                                            .getTime()),
                                        createdtime: this.global.handleDatetime2(
                                            new Date()
                                            .getTime()),
                                        DataSource: '56133',
                                        idsourcevouchertype: 69
                                    }
                                    const subsum = []
                                    tableDataSummary.forEach((i, index) => {
                                        subsum.push({
                                            code: index.toString()
                                                .padStart(4, '0'),
                                            rownumber: index + 1,
                                            arrivalQuantity: i.qty,
                                            quantity: i.stinhouseqty,
                                            compositionQuantity: i
                                                .stinhouseqty + i
                                                .unitname,
                                            baseQuantity: i.stinhouseqty,
                                            sourceVoucherId: !flag ? this
                                                .contentArr[
                                                    0].mpoid : '',
                                            sourceVoucherCode: !flag ? this
                                                .contentArr[
                                                    0].m_po : this
                                                .contentArr[0].wo_code,
                                            sourceVoucherDetailId: i
                                                .sourceVoucherDetailId,
                                            idsourcevouchertype: 69,
                                            saleOrderId: this.contentArr[0]
                                                .saleOrderid,
                                            saleOrderCode: this.contentArr[
                                                    0]
                                                .saleOrderCode,
                                            saleOrderDetailId: i
                                                .saleOrderDetailId,
                                            ManufactureOrderId: !flag ?
                                                this
                                                .contentArr[0].mpoid : '',
                                            ManufactureOrderCode: !flag ?
                                                this
                                                .contentArr[0].m_po : this
                                                .contentArr[
                                                    0].wo_code,
                                            ManufactureOrderDetailId: i
                                                .ManufactureOrderDetailId,
                                            idbusiTypeByMergedFlow: 3,
                                            idinventory: i.materiel_id,
                                            idbaseunit: i.unitid,
                                            idunit: i.unitid,
                                            idwarehouse: i.stck_id,
                                            SourceVoucherIdByMergedFlow: this
                                                .contentArr[0].mpoid,
                                            SourceVoucherCodeByMergedFlow: this
                                                .contentArr[0].m_po,
                                            SourceVoucherDetailIdByMergedFlow: i
                                                .SourceVoucherDetailIdByMergedFlow,
                                            idsourceVoucherTypeByMergedFlow: 69,
                                            createdtime: this.global
                                                .handleDatetime2(
                                                    new Date().getTime()),
                                            DataSource: '56133',
                                            materiel_code: i.materiel_code,
                                            warehouse: i.warehouse
                                        })
                                    })
                                    const data = {
                                        head,
                                        sub: this.contentArr,
                                        subsum
                                    }
                                    console.log(data, 35)
                                    MesAppProductInHouseOrderBarCodeSave(this.global
                                        .formatData({
                                            username: uni.getStorageSync(
                                                'username')
                                        }), data).then(r3 => {
                                        console.log(r3, 36)
                                        if (r3.code === '200') {
                                            this.$u.toast('入库成功!')
                                            this.stockcode = ''
                                            this.contentArr = []
                                            this.isDisabledSubmitButton = false
                                        } else {
                                            this.$u.toast('入库失败!')
                                            this.isDisabledSubmitButton = false
                                        }
                                    })
                                }
                            },
                        })
                    }
                })
            }
        }
    }
</script>
<style lang="scss" scoped>
    @import url('@/style/global.css');
    ::v-deep .uicon-arrow-left>span {
        display: block;
    }
    .orderNumber {
        width: 60rpx;
        height: 40rpx;
        margin: -20rpx 0 0 -30rpx;
        background-color: #d3daf9;
        color: #2979FF;
        font-size: 26rpx;
        padding: 4rpx 0 0 10rpx;
        border-radius: 0 0 90% 0;
    }
    .trash {
        width: 48rpx;
        height: 48rpx;
        margin: -22rpx 0 0 610rpx;
        background-color: #d3daf9;
        font-size: 26rpx;
        padding: 6rpx 0 0 10rpx;
        border-radius: 100%;
    }
</style>
pages/wlgl/sctl.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,49 @@
<template>
    <view>
        <page-nav title="生产退料"></page-nav>
    </view>
</template>
<script>
    // import {
    // } from '../../config/api.js';
    export default {
        onLoad(option) {
        },
        onPullDownRefresh() {
            setTimeout(() => {
                this.init(() => {
                    uni.stopPullDownRefresh();
                })
            }, 1000);
        },
        data() {
            return {
            }
        },
        created() {
        },
        mounted() {
            this.init()
        },
        methods: {
            init() {
                uni.stopPullDownRefresh();
            },
        }
    }
</script>
<style lang="scss" scoped>
    ::v-deep .uicon-arrow-left>span {
        display: block;
    }
</style>
pages/wlgl/wltb.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,49 @@
<template>
    <view>
        <page-nav title="物料调拨"></page-nav>
    </view>
</template>
<script>
    // import {
    // } from '../../config/api.js';
    export default {
        onLoad(option) {
        },
        onPullDownRefresh() {
            setTimeout(() => {
                this.init(() => {
                    uni.stopPullDownRefresh();
                })
            }, 1000);
        },
        data() {
            return {
            }
        },
        created() {
        },
        mounted() {
            this.init()
        },
        methods: {
            init() {
                uni.stopPullDownRefresh();
            },
        }
    }
</script>
<style lang="scss" scoped>
    ::v-deep .uicon-arrow-left>span {
        display: block;
    }
</style>
pages/wlgl/zhrq.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,49 @@
<template>
    <view>
        <page-nav title="转换容器"></page-nav>
    </view>
</template>
<script>
    // import {
    // } from '../../config/api.js';
    export default {
        onLoad(option) {
        },
        onPullDownRefresh() {
            setTimeout(() => {
                this.init(() => {
                    uni.stopPullDownRefresh();
                })
            }, 1000);
        },
        data() {
            return {
            }
        },
        created() {
        },
        mounted() {
            this.init()
        },
        methods: {
            init() {
                uni.stopPullDownRefresh();
            },
        }
    }
</script>
<style lang="scss" scoped>
    ::v-deep .uicon-arrow-left>span {
        display: block;
    }
</style>
pages/xtsy/index.vue
@@ -203,6 +203,9 @@
                        // è´¨é‡ç®¡ç†
                    case '2701':
                        url = 'zlgl/rcjy' //入厂检验
                        break;
                    case '2702':
                        url = 'zlgl/sjjy' //首检检验
                        break;
@@ -212,6 +215,7 @@
                    case '2704':
                        url = 'zlgl/wgjy' //完工检验
                        break;
                        // è®¾å¤‡ç®¡ç†
@@ -405,6 +409,16 @@
                    case '2104':
                        url = 'znfx/scjd' //生产进度
                        break;
                        // ç‰©æ–™ç®¡ç†
                    case '2600':
                        url = 'wlgl/cgdh' //采购到货
                        break;
                    case '2601':
                        url = 'wlgl/cgrk' //采购入库
                        break;
                }
                this.popupShow = false //二级菜单的显隐控制
                console.log(url)
pages/zlgl/rcjy.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,515 @@
<template>
    <view>
        <page-nav title="入厂检验"></page-nav>
        <view v-if="purchorderArr.length===0">
            <div class="sacnBody">
                <div class="scanImg" @click="topScanClick"></div>
                <div class="scanText">扫描物料标签</div>
            </div>
        </view>
        <view v-if='purchorderArr.length!==0' class="mainContent" style="">
            <view>
                <u-gap height="10" bgColor="#eff0f1"></u-gap>
                <view class="head">
                    <view class="head_block">
                        <view class="head_left">
                            <view class="head_bar"></view>
                            <view class="head_title" style="font-weight: bolder;">
                                ç‰©æ–™ä¿¡æ¯
                            </view>
                        </view>
                    </view>
                    <view class="marginLeft20 marginRight20" style="height: 210rpx;">
                        <view class="marginBottom20" style="display: flex;">
                            <!--  v-for="item in purchorderArr"  -->
                            <view class="flex_column titleFont">
                                <view>单据编号:</view>
                                <view>物料编码:</view>
                                <view>物料名称:</view>
                                <view>物料规格:</view>
                            </view>
                            <view class="flex_column contentFont">
                                <view>{{purchorderObj.hbillno}}</view>
                                <view>{{purchorderObj.partcode}}</view>
                                <view>{{purchorderObj.partname}}</view>
                                <view>{{purchorderObj.partspec?purchorderObj.partspec:'/'}}</view>
                            </view>
                        </view>
                    </view>
                    <u-gap height="20" bgColor="#eff0f1"></u-gap>
                    <view style="max-height: 940rpx;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">
                                    <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>
                                    <view class="orderNumber" :key="item.hbarcode">
                                        {{(index+1).toString().padStart(2,0)}}
                                    </view>
                                    <view class="trash" v-show="purchorderDetailArr.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>
                                    <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 class="flex_column contentFont">
                                                <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 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;">
                                                        å¾…检
                                                    </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>
                                </view>
                            </u-radio-group>
                        </view>
                    </view>
                </view>
            </view>
        </view>
        <view v-if='purchorderArr.length!==0' class="footer">
            <view class="head_block" style="align-items: center;padding: 0 23rpx;">
                <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>
                </view>
            </view>
        </view>
        <u-picker :show="sheetShow" :columns="columns" :itemHeight='55' :closeOnClickOverlay='true'
            @close='sheetShow=false' @confirm='pickerConfirm' @cancel='sheetShow=false'></u-picker>
        <u-button :disabled="!sheetValue" v-if='purchorderArr.length!==0' type="primary" size='large' :hairline="true"
            @click="navigateTo" text="下一步"></u-button>
        <!--         <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 {
        InFactoryCheckScanLabCode,
        QualityScheme
    } 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()
            // }
        },
        onPullDownRefresh() {
            setTimeout(() => {
                this.init(() => {
                    uni.stopPullDownRefresh();
                })
            }, 1000);
        },
        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: '',
                sheetShow: false, //上拉列表是否展开
                sheetValue: '',
                sheetList: [],
                columns: []
            }
        },
        created() {
        },
        mounted() {
            this.init()
            this.getQualityScheme()
            // this.getInFactoryCheckScanLabCode('DH2304041467')
        },
        methods: {
            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() {
                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;
                        let flag = false
                        that.purchorderDetailArr.forEach(item => {
                            if (item.hbarcode === res.result) {
                                flag = true
                            }
                        })
                        if (flag) {
                            that.$u.toast('此条码已扫描,已在列表中!')
                        } else {
                            //处理扫码事件
                            that.getInFactoryCheckScanLabCode(that.scanContent);
                        }
                    },
                    complete: function(res) {
                    },
                    fail: function(res) {
                        console.log('条码类型:' + res.scanType);
                        console.log('条码内容:' + res.result);
                    }
                });
            },
            // èŽ·å–æ ‡ç­¾ä¿¡æ¯
            async getInFactoryCheckScanLabCode(labcode) {
                const data = {
                    labcode
                }
                const res = await InFactoryCheckScanLabCode(this.global.formatData(data))
                if (res.code === '200') {
                    console.log(res)
                    this.purchorderArr.unshift({
                        hbillno: res.data.labcont[0].hbillno,
                        partcode: res.data.labcont[0].partcode,
                        partname: res.data.labcont[0].partname,
                        partspec: res.data.labcont[0].partspec,
                        hbarcode: res.data.labcont[0].hbarcode,
                        hbatchno: res.data.labcont[0].hbatchno ? res.data.labcont[0].hbatchno : '/',
                    })
                    this.purchorderDetailArr.unshift({
                        hbillno: res.data.labcont[0].hbillno,
                        partcode: res.data.labcont[0].partcode,
                        hbarcode: res.data.labcont[0].hbarcode,
                        hqty: res.data.labcont[0].hqty,
                        hcustomername: res.data.labcont[0].hcustomername,
                        hcustomercode: res.data.labcont[0].hcustomercode,
                        hbatchno: res.data.labcont[0].hbatchno ? res.data.labcont[0].hbatchno : '/',
                        qualitystatus: res.data.labcont[0].qualitystatus,
                    })
                    this.purchorderObj = this.purchorderArr[0]
                    this.radioValue = res.data.labcont[0].hbarcode
                }
            },
            // èŽ·å–æ£€éªŒæ–¹æ¡ˆ
            async getQualityScheme() {
                const res = await QualityScheme()
                this.sheetList = res.data
                this.columns = [res.data.map(r => r.name)]
            },
            // picker确认按钮
            pickerConfirm(val) {
                this.sheetValue = val.value[0]
                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)
            },
        }
    }
</script>
<style lang="scss" scoped>
    @import url('@/style/global.css');
    ::v-deep .uicon-arrow-left>span {
        display: block;
    }
    .orderNumber {
        width: 60rpx;
        height: 40rpx;
        // margin: -22rpx 0 0 -30rpx;
        background-color: #d3daf9;
        color: #2979FF;
        font-size: 26rpx;
        padding: 4rpx 0 0 10rpx;
        border-radius: 0 0 90% 0;
    }
    .trash {
        width: 48rpx;
        height: 48rpx;
        margin: -26rpx 0 0 646rpx;
        background-color: #d3daf9;
        font-size: 26rpx;
        padding: 6rpx 0 0 10rpx;
        border-radius: 100%;
    }
    .custominputClass {
        width: 424rpx;
        display: flex;
        justify-content: space-between;
        border: 3rpx #eff0f1 solid;
        border-radius: 10rpx;
        padding: 0 10rpx;
    }
</style>
pages/zlgl/rcjy2.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,499 @@
<template>
    <view>
        <page-nav title="入厂检验"></page-nav>
        <view class="mainContent">
            <view>
                <u-gap height="10" bgColor="#eff0f1"></u-gap>
                <view class="head" style="height: 300rpx;overflow: auto;">
                    <view class="head_block">
                        <view class="head_left">
                            <view class="head_bar"></view>
                            <view class="head_title" style="font-weight: bolder;">
                                è´¨æ£€æ–¹æ¡ˆ
                            </view>
                        </view>
                    </view>
                    <view class="marginLeft20 marginRight20">
                        <view class="marginBottom20" style="display: flex;">
                            <view class="flex_column titleFont">
                                <view>方案名称:</view>
                                <view>抽样方式:</view>
                                <view>总数量:</view>
                                <view>样本数量:</view>
                            </view>
                            <view class="flex_column contentFont">
                                <view>{{purchorderObj.checkstandname}}</view>
                                <view>{{purchorderObj.sampmethod==='FIXED'?'固时抽检':'比例抽检'}}</view>
                                <view>{{purchorderObj.hqty}}</view>
                                <!-- <view>{{purchorderObj.sampscare}}</view> -->
                                <u-number-box inputWidth='110' v-model="purchorderObj.sampscare" min='1'
                                    :max='purchorderObj.hqty' class="contentFont" @change="hqtyChange"></u-number-box>
                            </view>
                        </view>
                    </view>
                </view>
                <u-gap height="20" bgColor="#eff0f1"></u-gap>
                <view class="head" style="max-height: 1020rpx;overflow: scroll;">
                    <view class="head_block">
                        <view class="head_left">
                            <view class="head_bar"></view>
                            <view class="head_title" style="font-weight: bolder;">
                                æ£€éªŒé¡¹ç›®
                            </view>
                        </view>
                    </view>
                    <view class="marginBottom20 marginTop10"
                        style="display: flex;justify-content: center;align-items: center;">
                        <u-button type="primary" :disabled="checkNumber===1" @click="preTo"
                            style="width: 200rpx;margin-left: 0%; " plain text="上一件"></u-button>
                        <view style="margin-left: 5%;">{{checkNumber}}/{{purchorderObj.sampscare}}</view>
                        <u-button type="primary"
                            :disabled="checkNumber===purchorderObj.sampscare||purchorderDetailArr%purchorderDetailArr.filter(i=>i.isPlain!=='').length===0"
                            @click="nextTo" style="width: 200rpx;margin-left: 7%; " plain text="下一件"></u-button>
                    </view>
                    <u-gap height="6" style="width: 96%;margin-left: 2%;" bgColor="#eff0f1"></u-gap>
                    <view class="marginLeft20 marginRight20 marginTop20">
                        <view class="marginBottom20 flex_column" v-for="(item,index) in purchorderDetailArr"
                            v-if="item.checkNumber===checkNumber" :key="item.name+index+checkNumber">
                            <!-- {{item.name+index+checkNumber}} -->
                            <view class="flex_between marginLeft20 marginRight20">
                                <view class="contentFont">{{item.name}}({{item.unit}})</view>
                                <view class="titleFont" style="display: flex;">
                                    <view>
                                        {{item.standvalue}}
                                    </view>
                                    <view v-if="item.lowervalue&&item.uppervalue">
                                        ({{item.lowervalue}}~{{item.uppervalue}})
                                    </view>
                                    <view v-if="!item.lowervalue&&item.uppervalue">
                                        (~{{item.uppervalue}})
                                    </view>
                                    <view v-if="item.lowervalue&&!item.uppervalue">
                                        ({{item.lowervalue}}~)
                                    </view>
                                </view>
                            </view>
                            <view class="flex_between marginLeft20  marginTop10">
                                <view class="contentFont  " style="display: flex;align-items: center;">
                                    <view class="contentFont">
                                        å®žæµ‹å€¼ï¼š
                                    </view>
                                    <view class="inputClass " style="width: 40%;">
                                        <!-- padding: 6rpx 18rpx; -->
                                        <u--input style="" placeholder="请输入" border="surround" v-model="item.real_value"
                                            @change='val=>realValueBlur(val,item)'></u--input>
                                    </view>
                                    <view style="display: flex;">
                                        <u-button type="success" style="width: 130rpx;margin-left: 10%;height: 56rpx;"
                                            shape="circle" @click="item.isPlain=true;$forceUpdate()"
                                            :disabled="item.required==='Y'&&!item.real_value" :plain='!item.isPlain'
                                            text="合格"></u-button>
                                        <u-button type="warning" style="width: 130rpx;margin-left: 4%;height: 56rpx;"
                                            shape="circle" :plain='item.isPlain'
                                            :disabled="item.required==='Y'&&!item.real_value"
                                            @click="item.isPlain=false;$forceUpdate()" text="不合格"></u-button>
                                    </view>
                                </view>
                            </view>
                            <view class=" marginLeft20 marginRight20 marginTop10">
                                <view class="titleFont"> æè¿°ï¼š{{item.stepcheckitem_desc}}</view>
                            </view>
                            <view class=" marginLeft20 marginRight20 marginTop10 marginBottom20"
                                style="display: flex;align-items: center;">
                                <view class="contentFont"> å¤‡æ³¨ï¼š</view>
                                <view class="inputClass " style="">
                                    <u--input style="" placeholder="请输入" border="surround"
                                        v-model="item.stepcheckitem_remark"></u--input>
                                </view>
                            </view>
                            <u-gap height="6"
                                v-if="(index+1)%purchorderDetailArr.map(i=>i.checkNumber===1).filter(i=>i).length!==0"
                                style="width: 96%;margin-left: 2%;" bgColor="#eff0f1"></u-gap>
                        </view>
                    </view>
                </view>
            </view>
        </view>
        <!-- {{purchorderDetailArr.length}} -->
        <view class="footer" style="min-height:62rpx;">
            <u-button type="primary" :disabled="!(purchorderDetailArr.filter(i=>i.isPlain==='').length===0)"
                size='large' :hairline="true" @click="navigateTo" text="下一步"></u-button>
        </view>
    </view>
</template>
<script>
    import {
        InFactoryCheckItem
    } from '../../config/api.js';
    const App = getApp()
    export default {
        onLoad(option) {
            console.log(option)
            this.passPurchorderObj = option.purchorderObj
            const t1 = JSON.parse(option.radioSelectValue)
            this.passToNext = option.radioSelectValue
            this.purchorderObj.checkstandname = option.checkstandname
            this.purchorderObj.checkstandcode = option.checkstandcode
            this.purchorderObj.sampmethod = option.sampmethod
            this.purchorderObj.hqty = JSON.parse(option.radioSelectValue).hqty
            this.purchorderObj.sampscare = option.sampmethod === 'FIXED' ? option.sampscare : Math.ceil(parseFloat(
                JSON.parse(option.radioSelectValue).hqty) * parseFloat(option.sampscare) / 100)
            this.purchorderObj.sampscare = this.purchorderObj.sampscare <= this.purchorderObj.hqty ? this.purchorderObj
                .sampscare : this.purchorderObj.hqty
        },
        onPullDownRefresh() {
            setTimeout(() => {
                this.init(() => {
                    uni.stopPullDownRefresh();
                })
            }, 1000);
        },
        data() {
            return {
                passPurchorderObj: {}, //页面1传过来的对象
                passToNext: {}, //传给页面3的参数
                purchorderObj: {
                    checkstandcode: 'BZ01', //方案编码
                    checkstandname: '标准01', //方案名称
                    sampmethod: 'FIXED', //抽样方式
                    hqty: 30, //总数量
                    sampscare: 3, //样本数量
                },
                checkNumber: 1, //检验项目中的检验数量  çŽ°åœ¨å¤„äºŽç¬¬å‡ ä¸ª
                purchorderDetailArr: [
                    // {
                    //     stepcheckitem_seq: '1',
                    //     name: '质检1S(KG)',
                    //     code: '',
                    //     standvalue: '6.5',
                    //     lowervalue: '6.0',
                    //     uppervalue: '7.0',
                    //     real_value: '', //实测值
                    //     unit: '', //单位
                    //     required: '', //是否必填
                    //     numberjudge: '', //数值判断
                    //     stepcheckitem_desc: '检测外观内径.需用专业仪器',
                    //     stepcheckitem_remark: '', //备注
                    //     isPlain: false
                    // }, {
                    //     stepcheckitem_seq: '2',
                    //     name: '质检1S(KG)',
                    //     code: '',
                    //     standvalue: '6.5',
                    //     lowervalue: '6.0',
                    //     uppervalue: '7.0',
                    //     real_value: '', //实测值
                    //     unit: '',
                    //     required: '', //是否必填
                    //     numberjudge: '', //数值判断
                    //     stepcheckitem_desc: '检测外观内径.需用专业仪器',
                    //     stepcheckitem_remark: '', //备注
                    //     isPlain: true
                    // },
                    // {
                    //     stepcheckitem_seq: '3',
                    //     name: '质检1S(KG)',
                    //     code: '',
                    //     standvalue: '6.5',
                    //     lowervalue: '6.0',
                    //     uppervalue: '7.0',
                    //     real_value: '',
                    //     unit: '',
                    //     required: '', //是否必填
                    //     numberjudge: '', //数值判断
                    //     stepcheckitem_desc: '检测外观内径.需用专业仪器',
                    //     stepcheckitem_remark: '',
                    //     isPlain: false
                    // },
                    // {
                    //     stepcheckitem_seq: '4',
                    //     name: '质检1S(KG)',
                    //     code: '',
                    //     standvalue: '6.5',
                    //     lowervalue: '6.0',
                    //     uppervalue: '7.0',
                    //     real_value: '',
                    //     unit: '',
                    //     required: '', //是否必填
                    //     numberjudge: '', //数值判断
                    //     stepcheckitem_desc: '检测外观内径.需用专业仪器',
                    //     stepcheckitem_remark: '',
                    //     isPlain: false
                    // },
                ],
            }
        },
        created() {
        },
        mounted() {
            this.init()
            this.getInFactoryCheckItem()
        },
        methods: {
            init() {
                uni.stopPullDownRefresh();
            },
            async getInFactoryCheckItem() {
                const data = {
                    checkstandcode: this.purchorderObj.checkstandcode
                }
                const res = await InFactoryCheckItem(this.global.formatData(data))
                for (var i = 0; i < this.purchorderObj.sampscare; i++) {
                    res.data.forEach(j => {
                        this.purchorderDetailArr.push({
                            checkNumber: i + 1,
                            stepcheckitem_seq: j.stepcheckitem_seq,
                            name: j.name,
                            code: j.code,
                            standvalue: j.standvalue,
                            lowervalue: j.lowervalue,
                            uppervalue: j.uppervalue,
                            real_value: j.real_value,
                            unit: j.unit,
                            stepcheckitem_desc: j.stepcheckitem_desc,
                            stepcheckitem_remark: '',
                            isPlain: '',
                            required: j.required, //是否必填
                            numberjudge: j.numberjudge, //数值判断
                        })
                    })
                }
                console.log(JSON.parse(JSON.stringify(this.purchorderDetailArr)), 999)
            },
            //样本数量值改变
            hqtyChange(val) {
                console.log(val.value)
                const t = this.purchorderDetailArr.filter(i => i.checkNumber === 1)
                let len = this.purchorderDetailArr.length / t.length
                // ä»¶æ•°å‡å°‘æ—¶
                if (val.value < this.purchorderDetailArr.length / t.length) {
                    this.purchorderDetailArr.reverse()
                    const a = this.purchorderDetailArr.splice(0, t.length * (len - val.value))
                    this.purchorderDetailArr.reverse()
                    if (this.checkNumber > val.value) {
                        this.checkNumber = val.value
                    }
                }
                // ä»¶æ•°å˜å¤šæ—¶
                if (val.value > this.purchorderDetailArr.length / t.length) {
                    for (var i = val.value; i > len; i--) {
                        t.forEach(j => {
                            this.purchorderDetailArr.push({
                                checkNumber: i,
                                stepcheckitem_seq: j.stepcheckitem_seq,
                                name: j.name,
                                code: j.code,
                                standvalue: j.standvalue,
                                lowervalue: j.lowervalue,
                                uppervalue: j.uppervalue,
                                real_value: '',
                                unit: j.unit,
                                stepcheckitem_desc: j.stepcheckitem_desc,
                                stepcheckitem_remark: '',
                                isPlain: '',
                                required: j.required, //是否必填
                                numberjudge: j.numberjudge, //数值判断
                            })
                        })
                    }
                    this.purchorderDetailArr.sort((a, b) => a.checkNumber - b.checkNumber)
                }
                // console.log(this.purchorderDetailArr, 1)
                // console.log(this.purchorderDetailArr.length, 1)
                this.$forceUpdate()
            },
            navigateTo() {
                // console.log(this.passPurchorderObj)
                // console.log(JSON.parse(JSON.stringify(this.purchorderDetailArr)))
                // let t =
                // è®¡ç®—OK值
                let goodqty = 0;
                for (var i = 0; i < this.purchorderObj.sampscare; i++) {
                    let flag = this.purchorderDetailArr.filter(j => j.checkNumber === i + 1).every(j => j.isPlain)
                    if (flag) {
                        goodqty++
                    }
                }
                uni.navigateTo({
                    url: './rcjy3?passPurchorderObj=' + JSON.stringify(this.passPurchorderObj) +
                        '&purchorderDetailArr=' + JSON
                        .stringify(this.purchorderDetailArr) + '&passToNext=' + this.passToNext +
                        '&purchorderObj=' + JSON.stringify(this.purchorderObj) + '&sampleqty=' + this.purchorderObj
                        .sampscare + '&goodqty=' + goodqty
                });
            },
            // ä¸Šä¸€ä»¶
            preTo() {
                if (this.checkNumber > 1) {
                    this.checkNumber--
                }
            },
            //下一件
            nextTo() {
                if (this.checkNumber < this.purchorderObj.sampscare) {
                    this.checkNumber++
                }
                this.$forceUpdate()
                console.log(JSON.parse(JSON.stringify(this.purchorderDetailArr)))
                // let t = JSON.parse(JSON.stringify(this.purchorderDetailArr))
                // t.forEach(i=>{
                //     i.isPlain=''
                // })
            },
            // å®žæµ‹å€¼è¾“入时失焦状态
            realValueBlur(val, item) {
                console.log(val === '', item)
                if (val.value !== '') {
                    if (item.numberjudge === 'Y') { //如果需要进行数值判断
                        if (item.uppervalue === '' && item.lowervalue === '') { //上限值为空,下限值为空
                            if (parseFloat(val) === parseFloat(item.standvalue)) {
                                item.isPlain = true
                            } else {
                                item.isPlain = false
                            }
                        }
                        if (item.uppervalue !== '' && item.lowervalue !== '') { //上限值不为空,下限值不为空
                            if (parseFloat(val) >= parseFloat(item.lowervalue) && parseFloat(val) <=
                                parseFloat(item.uppervalue)) {
                                item.isPlain = true
                            } else {
                                item.isPlain = false
                            }
                        }
                        if (item.uppervalue !== '' && item.lowervalue === '') { //上限值不为空,下限值为空
                            if (parseFloat(val) <= parseFloat(item.uppervalue)) {
                                item.isPlain = true
                            } else {
                                item.isPlain = false
                            }
                        }
                        if (item.uppervalue === '' && item.lowervalue !== '') { //上限值为空,下限值不为空
                            if (parseFloat(val) >= parseFloat(item.lowervalue)) {
                                item.isPlain = true
                            } else {
                                item.isPlain = false
                            }
                        }
                    }
                }
                if (val === '') {
                    item.isPlain = ''
                }
                // this.$forceUpdate()
            }
        }
    }
</script>
<style lang="scss" scoped>
    @import url('@/style/global.css');
    ::v-deep .uicon-arrow-left>span {
        display: block;
    }
    ::v-deep .u-input {
        padding: 6rpx 18rpx !important;
    }
    ::v-deep .u-number-box__minus {
        height: 50rpx !important;
    }
    ::v-deep .u-number-box__input {
        height: 50rpx !important;
    }
    ::v-deep .u-number-box__plus {
        height: 50rpx !important;
    }
</style>
pages/zlgl/rcjy3.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,338 @@
<template>
    <view>
        <page-nav title="入厂检验"></page-nav>
        <view class="mainContent">
            <view>
                <u-gap height="10" bgColor="#eff0f1"></u-gap>
                <view class="head">
                    <view class="head_block">
                        <view class="head_left">
                            <view class="head_bar"></view>
                            <view class="head_title" style="font-weight: bolder;">
                                ç‰©æ–™ä¿¡æ¯
                            </view>
                        </view>
                    </view>
                    <view class="marginLeft20 marginRight20">
                        <view class="marginBottom20" 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 class="flex_column contentFont">
                                <view>{{purchorderArr.hbillno}}</view>
                                <view>{{purchorderArr.labcode}}</view>
                                <view>{{purchorderArr.partcode}}</view>
                                <view>{{purchorderArr.partname}}</view>
                                <view>{{purchorderArr.partspec}}</view>
                                <view class="ellipsis" style="width: 460rpx;">{{purchorderArr.customername}}</view>
                                <view>{{purchorderArr.hbatchno}}</view>
                                <view style="display: flex;align-items: center;">
                                    <u-icon :name="isPlain?'checkmark-circle-fill':'close-circle-fill'"
                                        :color="isPlain?'#55ff00':'#FF0000'" size="20"></u-icon>
                                    <view style="margin-left: 10rpx;">
                                        {{isPlain?'合格':'不合格'}}
                                    </view>
                                </view>
                                <view>{{purchorderArr.hqty}}</view>
                            </view>
                        </view>
                    </view>
                </view>
                <u-gap height="20" bgColor="#eff0f1"></u-gap>
                <view class="head">
                    <view class="head_block">
                        <view class="head_left">
                            <view class="head_bar"></view>
                            <view class="head_title" style="font-weight: bolder;">
                                æ£€éªŒç»“æžœ
                            </view>
                        </view>
                    </view>
                    <view class="marginLeft20 marginRight20 marginBottom20">
                        <view class="" style="display: flex;">
                            <view class="flex_column titleFont">
                                <view>样本数量:</view>
                                <view>合格数量:</view>
                                <view>不合格数量:</view>
                            </view>
                            <view class="flex_column contentFont">
                                <view>{{purchorderArr.sampleqty}} ä¸ª</view>
                                <view>{{purchorderArr.goodqty}} ä¸ª</view>
                                <view>{{purchorderArr.sampleqty-purchorderArr.goodqty}} ä¸ª</view>
                            </view>
                        </view>
                        <view style="display: flex;margin-top: 30rpx;">
                            <u-button type="primary" @click="isPlain=true" style="width: 200rpx;margin-left: 0%; "
                                :plain="!isPlain" text="合格"></u-button>
                            <u-button type="warning" @click="isPlain=false" style="width: 200rpx;margin-left: 10%; "
                                :plain="isPlain" text="不合格"></u-button>
                        </view>
                    </view>
                </view>
                <u-gap height="20" bgColor="#eff0f1"></u-gap>
                <view class="head">
                    <view class="head_block marginBottom10">
                        <view class="head_left">
                            <view class="head_bar"></view>
                            <view class="head_title" style="font-weight: bolder;">
                                åŒæ­¥è‡³ç›¸åŒæ‰¹æ¬¡
                            </view>
                        </view>
                        <view class="marginRight20">
                            <u-switch v-model="switchValue" size="23"></u-switch>
                        </view>
                    </view>
                </view>
            </view>
        </view>
        <u-button type="primary" size='large' :hairline="true" :loading="isDisabledSubmitButton" @click="submit"
            loadingText="正在提交,请稍等..." text="确认提交"></u-button>
    </view>
</template>
<script>
    // import {
    // } from '../../config/api.js';
    const App = getApp()
    export default {
        onLoad(option) {
            let t1 = JSON.parse(JSON.parse(option.passPurchorderObj))
            let t2 = JSON.parse(option.purchorderDetailArr)
            let t3 = JSON.parse(option.purchorderObj)
            let t4 = JSON.parse(option.passToNext)
            console.log(t1, 1)
            console.log(t2, 2)
            console.log(t3, 3)
            console.log(t4, 4)
            this.purchorderArr.hbillno = t1.hbillno
            this.purchorderArr.partcode = t1.partcode
            this.purchorderArr.partname = t1.partname
            this.purchorderArr.partspec = t1.partspec ? t1.partspec : '/'
            this.purchorderArr.customercode = t4.hcustomercode
            this.purchorderArr.customername = t4.hcustomername
            this.purchorderArr.hqty = t4.hqty
            this.purchorderArr.sampmethod = t4.sampmethod
            this.purchorderArr.labcode = t4.hbarcode
            this.purchorderArr.hbatchno = t4.hbatchno ? t4.hbatchno : '/'
            this.purchorderArr.sampleqty = option.sampleqty
            this.purchorderArr.goodqty = option.goodqty
            this.passPurchorderDetailArr = t2
            this.passPurchorderBZObj = t3
        },
        onPullDownRefresh() {
            setTimeout(() => {
                this.init(() => {
                    uni.stopPullDownRefresh();
                })
            }, 1000);
        },
        data() {
            return {
                isDisabledSubmitButton: false,
                purchorderArr: {
                    hbillno: 'CG20221018000001', //单据编号
                    labcode: 'ZG20221018000001', //物料标签
                    partcode: 'ZG-Y-001', //物料编码
                    partname: 'ZG原材料001', //物料名称
                    partspec: 'ZG#30*50', //物料规格
                    customername: 'ZG外协供应商', //供方信息
                    customercode: '0101101', //供方编码
                    hbatchno: '/', //采购批次
                    qualitystatus: '/', //质量状态
                    hqty: 0, //物料数量
                    sampleqty: 0, //抽样数量
                    goodqty: 0, //合格数量
                    ngqty: 0, //不合格数量
                },
                passPurchorderDetailArr: [], //页面二传过来的值   æ¯ä¸ªå­é¡¹çš„值
                passPurchorderBZObj: [], //页面二传过来的值   æ¯ä¸ªå­é¡¹çš„值
                isPlain: true,
                switchValue: true,
            }
        },
        created() {
        },
        mounted() {
            this.init()
            this.isPlain = this.purchorderArr.sampleqty === this.purchorderArr.goodqty
        },
        methods: {
            init() {
                uni.stopPullDownRefresh();
            },
            submit() {
                const header = {
                    // 'Content-Type': 'multipart/form-data',
                    'Content-Type': 'application/x-www-form-urlencoded',
                    'rediskey': uni.getStorageSync('rediskey'),
                    'admin': uni.getStorageSync('usercode'),
                    'username': encodeURIComponent(uni.getStorageSync('username')),
                    'navTabId': uni.getStorageSync('usercode'),
                    'userid': uni.getStorageSync('userid'),
                    'guid': uni.getStorageSync('guid'),
                    'usertype': 'APP'
                }
                let checkitemcont = []
                this.passPurchorderDetailArr.forEach((i, index) => {
                    checkitemcont.push({
                        checknum: i.checkNumber + '/' + this.passPurchorderDetailArr.length / this
                            .passPurchorderDetailArr.filter(j => j.checkNumber === 1).length,
                        checkiem_seq: i.stepcheckitem_seq,
                        checkitem_code: i.code,
                        checkitem_name: i.name,
                        check_value: i.real_value ? i.real_value : '',
                        check_result: i.isPlain ? 'OK' : 'NG',
                        checkitem_descr: i.stepcheckitem_remark
                    })
                })
                let formData = {
                    hbillno: this.purchorderArr.hbillno,
                    labcode: this.purchorderArr.labcode,
                    checkstandcode: this.passPurchorderBZObj.checkstandcode,
                    check_type: 'InCheck',
                    sampmethod: this.passPurchorderBZObj.sampmethod,
                    partcode: this.purchorderArr.partcode,
                    customercode: this.purchorderArr.customercode,
                    batchno: this.purchorderArr.hbatchno === '/' ? '' : this.purchorderArr.hbatchno, //批次
                    qualitystatus: this.isPlain ? 'OK' : 'NG',
                    labqty: parseFloat(this.purchorderArr.hqty),
                    sampleqty: parseFloat(this.purchorderArr.sampleqty),
                    goodqty: parseFloat(this.purchorderArr.goodqty),
                    ngqty: parseFloat(this.purchorderArr.sampleqty) - parseFloat(this.purchorderArr.goodqty),
                    issyncbatch: this.switchValue ? 'Y' : 'N', //是否同批次
                    admin: uni.getStorageSync('usercode'),
                    checkitemcont: JSON.stringify(checkitemcont)
                }
                console.log(formData, 888)
                this.isDisabledSubmitButton = true
                uni.uploadFile({
                    url: this.$baseUrl + '/AppQualityManagement/InFactoryCheckSave',
                    files: [{
                        "uri": "/"
                    }],
                    header: header,
                    formData: formData,
                    success: (res) => {
                        console.log(res, 999)
                        let result = JSON.parse(res.data)
                        if (res.statusCode == 200 && result.code == '200') {
                            uni.$u.toast('提交成功!')
                            // uni.navigateTo({
                            //     url: './rcjy?partcode=' + this.purchorderArr.partcode + '&hbatchno=' +
                            //         this.purchorderArr.hbatchno + '&issyncbatch=' + this.switchValue +
                            //         '&labcode=' + this.purchorderArr.labcode + '&hbillno=' + this
                            //         .purchorderArr.hbillno
                            // })
                            let prevPage = getCurrentPages()[getCurrentPages().length - 3]; // ä¸Šä¸Šä¸€é¡µé¢å®žä¾‹
                            const data = {
                                issyncbatch: this.switchValue ? 'Y' : 'N',
                                partcode: this.purchorderArr.partcode,
                                hbatchno: this.purchorderArr.hbatchno,
                                labcode: this.purchorderArr.labcode,
                                hbillno: this.purchorderArr.hbillno
                            }
                            prevPage.$vm.fromSubmitData(data) // è°ƒç”¨ä¸Šä¸Šä¸€é¡µ å®šä¹‰çš„æ–¹æ³•
                            uni.navigateBack({
                                delta: 2, //返回层数,2则上上页    ä½¿ç”¨è¿™ç§æ–¹æ³•以免感觉页面跳动的感觉
                            })
                        } else {
                            uni.$u.toast(result.Message)
                        }
                        this.isDisabledSubmitButton = false
                    },
                    fail(res) {
                        console.log(res, 1000)
                        uni.$u.toast('提交失败!')
                        this.isDisabledSubmitButton = false
                    },
                })
            }
        }
    }
</script>
<style lang="scss" scoped>
    @import url('@/style/global.css');
    ::v-deep .uicon-arrow-left>span {
        display: block;
    }
</style>
static/js/lpapi-uniplugin.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,485 @@
const api = uni.requireNativePlugin("DothanTech-LPAPI");
function request(action, data, callback) {
    console.log(`### Request: action = ${action}`);
    console.log(data ? JSON.stringify(data) : data);
    return new Promise((resolve) => {
        if (api && api[action]) {
            api[action](data || {}, (result) => {
                console.log(`### Response:`);
                console.log(JSON.stringify(data));
                if (result && result.code === 0) {
                    resolve(result.data || true);
                } else {
                    resolve(undefined);
                    console.log(result.data);
                }
                if (typeof callback === "function") {
                    callback(result.code === 0 ? result.data : null);
                }
            });
        } else {
            if (api) {
                resolve(undefined);
                console.log("LPAPI插件加载失败");
            } else {
                resolve(undefined);
                console.log("未检测到该方法:" + action);
            }
        }
    });
}
const lpapi = {
    /**
     * èŽ·å–æŒ‡å®šåž‹å·çš„æ‰€æœ‰æ‰“å°æœºï¼›
     * @param { string | {name?: string} } data å‚æ•°ï¼›
     * @returns { {name: string, macAddress?: string}[] } èŽ·å–æ‰“å°æœºåˆ—è¡¨ï¼›
     */
    getPrinters(data) {
        if (typeof data === "string") {
            data = {
                name: data
            };
        }
        return request("getPrinters", data);
    },
    /**
     * èŽ·å–æŒ‡å®šåž‹å·çš„ä¸€å°æ‰“å°æœºï¼›
     * @param { string | {name?: string} } data å‚æ•°ï¼›
     * @returns { {name: string, macAddress?: string} } èŽ·å–æ£€æµ‹åˆ°çš„ç¬¬ä¸€å°æ‰“å°æœºï¼›
     */
    getFirstPrinter(data) {
        if (typeof data === "string") {
            data = {
                name: data
            };
        }
        return request("getFirstPrinter", data);
    },
    /**
     *
     * @param { string | {name?: string}} data å‚æ•°ï¼›
     */
    openPrinter(data, callback) {
        if (typeof data === "string") {
            data = {
                name: data
            };
        }
        return request("openPrinter", typeof data === "object" ? data : {}, callback);
    },
    /**
     * èŽ·å–å½“å‰å·²è¿žæŽ¥æ‰“å°æœºåç§°ï¼›
     */
    getPrinterName() {
        return request("getPrinterName", {});
    },
    /**
     * èŽ·å–å½“å‰å·²è¿žæŽ¥æ‰“å°æœºä¿¡æ¯ï¼›
     * è°ƒç”¨è¯¥æŽ¥å£å‰è¦ç¡®ä¿æ‰“印机已连接;
     */
    getPrinterInfo() {
        return request("getPrinterInfo", {});
    },
    // /**
    //  * èŽ·å–å½“å‰æ‰“å°æœºçš„è¿žæŽ¥çŠ¶æ€ï¼›
    //  */
    // getPrinterState() {
    //     return request('getPrinterState', {});
    // },
    /**
     * å½“前打印机是否已经打开;
     */
    isPrinterOpened() {
        return request("isPrinterOpened", {});
    },
    /**
     *
     * @param { string | {}} data å‚æ•°ï¼›
     * @param {string} data.name
     * @param {string} data.model
     * @returns
     */
    isPrinterSupported(data) {
        data =
            typeof data === "object" ?
            data :
            {
                name: arguments[0],
                model: arguments[1],
            };
        return request("isPrinterSupported", data || {});
    },
    // /**
    //  * å–消当前打印任务;
    //  */
    // cancel() {
    //     return request('cancel', {});
    // },
    /**
     * å…³é—­æ‰“印机;
     */
    closePrinter() {
        return request("closePrinter", {});
    },
    /**
     * æ‰“印BASE64图片;
     * @param {{}} data
     * @param {string} data.image
     * @param {number} data.PRINT_DENSITY
     * @param {number} data.PRINT_SPEED
     * @param {number} data.PRINT_COPIES
     */
    printImage(data) {
        return request("printImage", data);
    },
    /**
     * å¼€å§‹æ‰“印任务;
     * @param {{}} data å‚æ•°ï¼›
     * @param {number} data.width
     * @param {number} data.height
     * @param {number} data.orientation
     */
    startJob(data) {
        return request("startJob", data);
    },
    // /**
    //  * ç»ˆæ­¢æ‰“印任务;
    //  */
    // abortJob() {
    //     return request('abortJob', {});
    // },
    /**
     * æäº¤æ‰“印任务;
     * @param {{}} data å‚æ•°ï¼›
     * @param {number} data.PRINT_DENSITY
     * @param {number} data.PRINT_SPEED
     * @param {number} data.PRINT_COPIES
     */
    commitJob(data) {
        return request("commitJob", data);
    },
    // /**
    //  * å¼€å§‹æ‰“印页面;
    //  */
    // startPage() {
    //     return request('startPage', {});
    // },
    // /**
    //  * ç»“束打印页面;
    //  */
    // endPage() {
    //     return request('endPage', {});
    // },
    /**
     * ç»“束打印任务;
     */
    endJob() {
        return request("endJob", {});
    },
    /**
     * èŽ·å–å½“å‰çš„æ‰“å°ä»»åŠ¡ï¼›
     */
    getJobPages() {
        return request("getJobPages", {});
    },
    //
    /**
     * è®¾ç½®åŽç»­ç»˜åˆ¶å‚数,譬如字体名称,二维码纠错级别等等;
     * @param {{}} data å‚æ•°
     * @param {string} name
     * @param value
     */
    setDrawParam(data) {
        return request("setDrawParam", data);
    },
    // /**
    //  * èŽ·å–å½“å‰å†…å®¹çš„æ—‹è½¬è§’åº¦ï¼›
    //  */
    // getItemOrientation() {
    //     return request('getItemOrientation', {});
    // },
    /**
     * è®¾ç½®åŽç»­å†…容的旋转方向;
     * @param { number | { orientation: [0, 90, 180, 270]}} data å‚æ•°ï¼›
     */
    setItemOrientation(data) {
        data = typeof data === "object" ? data : {
            orientation: data
        };
        return request("setItemOrientation", data);
    },
    // /**
    //  * èŽ·å–å½“å‰çš„æ°´å¹³å¯¹é½æ–¹å¼ï¼›
    //  */
    // getItemHorizontalAlignment() {
    //     return request('getItemHorizontalAlignment', {});
    // },
    /**
     * è®¾ç½®æ°´å¹³å¯¹é½æ–¹å¼ï¼›
     * @param { number | { alignment: [0, 1, 2]}} data å‚æ•°ï¼›
     */
    setItemHorizontalAlignment(data) {
        data = typeof data === "object" ? data : {
            alignment: data
        };
        return request("setItemHorizontalAlignment", data);
    },
    // /**
    //  * èŽ·å–å½“å‰çš„åž‚ç›´å¯¹é½æ–¹å¼ï¼›
    //  */
    // getItemVerticalAlignment() {
    //     return request('getItemVerticalAlignment', {});
    // },
    /**
     * è®¾ç½®åž‚直对齐方式;
     * @param { number | { alignment: [0, 1, 2]}} data å‚æ•°ï¼›
     */
    setItemVerticalAlignment(data) {
        data = typeof data === "object" ? data : {
            alignment: data
        };
        return request("setItemVerticalAlignment", data);
    },
    /**
     * è®¾ç½®èƒŒæ™¯è‰²ï¼›
     * é»˜è®¤ç™½è‰²åº•色:0xFFFFFFFF;
     * å¦‚需透明色,可设置:0x00000000;
     * @param { number | {color: number} } data å‚æ•°ï¼›
     */
    setBackground(data) {
        data = typeof data === "object" ? data : {
            color: data
        };
        return request("setBackground", data);
    },
    // ***************************************************
    // * æ‰“印相关图形对象。
    // ***************************************************
    /**
     * ç»˜åˆ¶å­—符串;
     *
     * @param {{}} data                          å­—符串绘制参数;
     * @param {string} data.text                 å¾…打印的字符串名称;
     * @param {number} data.x                     å­—符串显示的X轴坐标位置(单位毫米);
     * @param {number} data.y                     å­—符串显示的Y轴坐标位置(单位毫米);
     * @param {number} data.width                 å­—符串显示区域宽度(单位毫米);
     * @param {number} data.height                 å­—符串显示区域高度(单位毫米);
     * @param {number} data.fontHeight             å­—体大小(单位毫米);
     * @param {number} data.fontStyle             å­—体样式,默认位0;(0:常规,1:黑体,2:斜体,3:粗斜体)
     * @param {string} data.fontName             å­—体名称,默认位"黑体";
     * @param {boolean} data.autoReturn             å­—符串长度超过width之后,是否自动换行?默认位true;
     * @param {0|90|180|270} data.orientation    å­—符串旋转方向?默认以setItemOrientation为准;如果未调用该函数,则为0;
     * @param {0|1|2} data.horizontalAlignment    å­—符串在指定的宽高范围内的水平对齐方式,默认以setItemHorizontalAlignment为准,未设置则为0,表示居上对齐,值可为:0、1、2,分别表示左、中、右对齐;
     * @param {0|1|2} data.verticalAlignment    å­—符串在指定的宽高范围内的垂直对齐方式,默认以setItemVerticalAlignment为准,未设置则为0,表示居上对齐,值可为:0、1、2,分别表示上、中、下对齐;
     *
     */
    drawText(data) {
        return request("drawText", data);
    },
    /**
     * ç»˜åˆ¶ä¸€ç»´ç ï¼›
     * @param {{}} data ä¸€ç»´ç ç»˜åˆ¶å‚æ•°ï¼›
     * @param {string} data.text,                ä¸€ç»´ç å†…容
     * @param {number} data.x,                    ä¸€ç»´ç åœ¨åæ ‡ç³»X轴上的位置;
     * @param {number} data.y,                    ä¸€ç»´ç åœ¨åæ ‡ç³»ä¸­Y轴上的位置;
     * @param {number} data.width,                ä¸€ç»´ç åœ¨åæ ‡ç³»ä¸­çš„宽度;
     * @param {number} data.height,                ä¸€ç»´ç é«˜åº¦ï¼›
     * @param {number} data.textHeight,            ä¸€ç»´ç ä¸‹é¢æ˜¾ç¤ºçš„字符串高度,不需要的话可以设置位0;
     * @param {number} data.type                ä¸€ç»´ç ç±»åž‹ï¼š{@link BarcodeType}
     * @param {0|90|180|270} data.orientation    å­—符串旋转方向?默认以setItemOrientation为准;如果未调用该函数,则为0;
     * @param {0|1|2} data.horizontalAlignment    å­—符串在指定的宽高范围内的水平对齐方式,默认以setItemHorizontalAlignment为准,未设置则为0,表示居上对齐,值可为:0、1、2,分别表示左、中、右对齐;
     * @param {0|1|2} data.verticalAlignment    å­—符串在指定的宽高范围内的垂直对齐方式,默认以setItemVerticalAlignment为准,未设置则为0,表示居上对齐,值可为:0、1、2,分别表示上、中、下对齐;
     *
     * @typedef{{
     *    UPC_A: 20,
     *    UPC_E: 21,
     *    EAN13: 22,
     *    EAN8: 23,
     *    CODE39: 24,
     *    ITF25: 25,
     *    CODABAR: 26,
     *    CODE93: 27,
     *    CODE128: 28,
     *    ISBN: 29,
     *    ECODE39: 30,
     *    AUTO: 60,
     * }} BarcodeType ä¸€ç»´ç ç±»åž‹
     */
    draw1DBarcode(data) {
        return request("draw1DBarcode", data);
    },
    /**
     * ç»˜åˆ¶äºŒç»´ç ï¼›
     * @param {{}} data
     * @param {string} data.text                äºŒç»´ç å†…容
     * @param {number} data.x                    X轴坐标位置(单位毫米)
     * @param {number} data.y                    Y轴坐标位置
     * @param {number} data.width                äºŒç»´ç å¤§å°(单位毫米)
     * @param {0|1|2|3} data.eccLevel            äºŒç»´ç çº é”™çº§åˆ«ï¼Œ0|1|2|3分别表示: L(低)|M(中)|Q(强)|H(高),默认为0,表示最低纠错级别
     * @param {0|90|180|270} data.orientation    å­—符串旋转方向?默认以setItemOrientation为准;如果未调用该函数,则为0,表示不进行任何旋转;
     * @param {0|1|2} data.horizontalAlignment    å­—符串在指定的宽高范围内的水平对齐方式,默认以setItemHorizontalAlignment为准,未设置则为0,表示居上对齐,值可为:0、1、2,分别表示左、中、右对齐;
     * @param {0|1|2} data.verticalAlignment    å­—符串在指定的宽高范围内的垂直对齐方式,默认以setItemVerticalAlignment为准,未设置则为0,表示居上对齐,值可为:0、1、2,分别表示上、中、下对齐;
     */
    draw2DQRCode(data) {
        return request("draw2DQRCode", data);
    },
    /**
     * ç»˜åˆ¶PDF417码;
     * @param {{}} data PDF417打印参数;
     * @param {string} data.text             æ‰“印内容
     * @param {number} data.x                X轴坐标位置(单位毫米)
     * @param {number} data.y                Y轴坐标位置(单位毫米)
     * @param {number} data.width            ç»˜åˆ¶æ•°æ®å†…容的宽度(单位毫米)
     * @param {number} data.height            ç»˜åˆ¶æ•°æ®å†…容的高度(单位毫米)
     */
    // draw2DPdf417(data) {
    //     return request("draw2DPdf417", data);
    // },
    /**
     * ç»˜åˆ¶çŸ©å½¢æ¡†ï¼›
     * @param {{}} data
     * @param {number} data.x                    X轴坐标位置(单位毫米)
     * @param {number} data.y                    Y轴坐标位置(单位毫米)
     * @param {number} data.width                ç»˜åˆ¶æ•°æ®å†…容的宽度(单位毫米)
     * @param {number} data.height                ç»˜åˆ¶æ•°æ®å†…容的高度(单位毫米)
     * @param {number} data.lineWidth            è¾¹æ¡†å®½åº¦(单位毫米),默认为0.4mm
     * @param {0|90|180|270} data.orientation    å­—符串旋转方向?默认以setItemOrientation为准;如果未调用该函数,则为0,表示不进行任何旋转;
     */
    drawRectangle(data) {
        return request("drawRectangle", data);
    },
    /**
     * ç»˜åˆ¶å¡«å……矩形;
     * @param {{}} data
     * @param {number} data.x                    X轴坐标位置(单位毫米)
     * @param {number} data.y                    Y轴坐标位置(单位毫米)
     * @param {number} data.width                ç»˜åˆ¶æ•°æ®å†…容的宽度(单位毫米)
     * @param {number} data.height                ç»˜åˆ¶æ•°æ®å†…容的高度(单位毫米)
     * @param {0|90|180|270} data.orientation    å­—符串旋转方向?默认以setItemOrientation为准;如果未调用该函数,则为0,表示不进行任何旋转;
     */
    fillRectangle(data) {
        return request("fillRectangle", data);
    },
    /**
     * ç»˜åˆ¶åœ†è§’矩形框;
     * @param {{}} data
     * @param {number} data.x                    X轴坐标位置(单位毫米)
     * @param {number} data.y                    Y轴坐标位置(单位毫米)
     * @param {number} data.width                ç»˜åˆ¶æ•°æ®å†…容的宽度(单位毫米)
     * @param {number} data.height                ç»˜åˆ¶æ•°æ®å†…容的高度(单位毫米)
     * @param {number} data.cornerWidth            åœ†è§’半径(单位毫米)
     * @param {number} data.cornerHeight        åœ†è§’半径(单位毫米)
     * @param {number} data.lineWidth            è¾¹æ¡†å®½åº¦(单位毫米)
     * @param {0|90|180|270} data.orientation    å­—符串旋转方向?默认以setItemOrientation为准;如果未调用该函数,则为0,表示不进行任何旋转;
     */
    drawRoundRectangle(data) {
        return request("drawRoundRectangle", data);
    },
    /**
     * å¡«å……圆角矩形;
     * @param {{}} data
     * @param {number} data.x                    X轴坐标位置(单位毫米)
     * @param {number} data.y                    Y轴坐标位置(单位毫米)
     * @param {number} data.width                ç»˜åˆ¶æ•°æ®å†…容的宽度(单位毫米)
     * @param {number} data.height                ç»˜åˆ¶æ•°æ®å†…容的高度(单位毫米)
     * @param {number} data.cornerWidth            åœ†è§’半径(单位毫米)
     * @param {number} data.cornerHeight        åœ†è§’半径(单位毫米)
     * @param {0|90|180|270} data.orientation    å­—符串旋转方向?默认以setItemOrientation为准;如果未调用该函数,则为0,表示不进行任何旋转;
     */
    fillRoundRectangle(data) {
        return request("fillRoundRectangle", data);
    },
    /**
     * ç»˜åˆ¶æ¤­åœ†ï¼›
     * @param {{}} data
     * @param {number} data.x                    X轴坐标位置(单位毫米)
     * @param {number} data.y                    Y轴坐标位置(单位毫米)
     * @param {number} data.width                ç»˜åˆ¶æ•°æ®å†…容的宽度(单位毫米)
     * @param {number} data.height                ç»˜åˆ¶æ•°æ®å†…容的高度(单位毫米)
     * @param {number} data.lineWidth            è¾¹æ¡†å®½åº¦(单位毫米)
     * @param {0|90|180|270} data.orientation    å­—符串旋转方向?默认以setItemOrientation为准;如果未调用该函数,则为0,表示不进行任何旋转;
     */
    drawEllipse(data) {
        return request("drawEllipse", data);
    },
    /**
     * å¡«å……椭圆;
     * @param {{}} data
     * @param {number} data.x                    X轴坐标位置(单位毫米)
     * @param {number} data.y                    Y轴坐标位置(单位毫米)
     * @param {number} data.width                ç»˜åˆ¶æ•°æ®å†…容的宽度(单位毫米)
     * @param {number} data.height                ç»˜åˆ¶æ•°æ®å†…容的高度(单位毫米)
     * @param {0|90|180|270} data.orientation    å­—符串旋转方向?默认以setItemOrientation为准;如果未调用该函数,则为0,表示不进行任何旋转;
     */
    fillEllipse(data) {
        return request("fillEllipse", data);
    },
    /**
     * ç»˜åˆ¶åœ†å½¢ï¼›
     * @param {{}} data
     * @param {number} data.x                åœ†å¿ƒX轴坐标位置(单位毫米)
     * @param {number} data.y                åœ†å¿ƒY轴坐标位置(单位毫米)
     * @param {number} data.radius            åœ†åŠå¾„(单位毫米)
     * @param {number} data.lineWidth        è¾¹æ¡†å®½åº¦(单位毫米)
     */
    drawCircle(data) {
        return request("drawCircle", data);
    },
    /**
     * å¡«å……圆;
     * @param {{}} data
     * @param {number} data.x                åœ†å¿ƒX轴坐标位置(单位毫米)
     * @param {number} data.y                åœ†å¿ƒY轴坐标位置(单位毫米)
     * @param {number} data.radius            åœ†åŠå¾„(单位毫米)
     */
    fillCircle(data) {
        return request("fillCircle", data);
    },
    /**
     * ç»˜åˆ¶ç›´çº¿ï¼›
     * @param {{}} data
     * @param {number} data.x1                    èµ·ç‚¹X轴坐标位置(单位毫米)
     * @param {number} data.y1                    èµ·ç‚¹Y轴坐标位置(单位毫米)
     * @param {number} data.x2                    ç»ˆç‚¹X轴坐标位置(单位毫米)
     * @param {number} data.y2                    ç»ˆç‚¹Y轴坐标位置(单位毫米)
     * @param {number} data.lineWidth            çº¿æ¡å®½åº¦(单位毫米)
     * @param {0|90|180|270} data.orientation    å­—符串旋转方向?默认以setItemOrientation为准;如果未调用该函数,则为0,表示不进行任何旋转;
     */
    drawLine(data) {
        return request("drawLine", data);
    },
    /**
     * ç»˜åˆ¶è™šçº¿ï¼›
     * @param {{}} data
     * @param {number} data.x1                    èµ·ç‚¹X轴坐标位置(单位毫米)
     * @param {number} data.y1                    èµ·ç‚¹Y轴坐标位置(单位毫米)
     * @param {number} data.x2                    ç»ˆç‚¹X轴坐标位置(单位毫米)
     * @param {number} data.y2                    ç»ˆç‚¹Y轴坐标位置(单位毫米)
     * @param {number} data.dashLen[],            ç”µè¯çº¿çº¿æ®µé•¿åº¦æ•°ç»„(单位毫米)
     * @param {number} data.lineWidth            çº¿æ¡å®½åº¦(单位毫米)
     * @param {0|90|180|270} data.orientation    å­—符串旋转方向?默认以setItemOrientation为准;如果未调用该函数,则为0,表示不进行任何旋转;
     */
    drawDashLine(data) {
        return request("drawDashLine", data);
    },
    /**
     * ç»˜åˆ¶å›¾ç‰‡ï¼›
     * @param {{}} data
     * @param {string} data.image
     * @param {number} data.x                    X轴坐标位置(单位毫米)
     * @param {number} data.y                    Y轴坐标位置(单位毫米)
     * @param {number} data.width                ç»˜åˆ¶æ•°æ®å†…容的宽度(单位毫米)
     * @param {number} data.height                ç»˜åˆ¶æ•°æ®å†…容的高度(单位毫米)
     * @param {number} data.threshold            é»‘白转换阈值,默认是192
     * @param {0|90|180|270} data.orientation    å­—符串旋转方向?默认以setItemOrientation为准;如果未调用该函数,则为0,表示不进行任何旋转;
     */
    drawImage(data) {
        return request("drawImage", data);
    },
};
export default lpapi;