Mr.Zhang
2023-09-22 42853882a59754b918ed6414b990146514b9b189
小程序
已修改22个文件
18073 ■■■■ 文件已修改
minipro_standard/common/config.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/components/SelectTraMultipleMaterial.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/components/workOrderInfo.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages/selectWorkOrder/selectWorkOrder.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_adjust/components/multipleMaterial.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_adjust/pages/OrderDetail/OrderDetail.vue 80 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_adjust/pages/addReceipt/addReceipt.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_adjust/pages/newTransfer/newTransfer.vue 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_adjust/pages/reportingForWork/reportingForWork.vue 2642 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_adjust/pages/workOrder/workOrder.vue 233 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_adjust/pages/workOrderReporting/workOrderReporting.vue 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_inspect/pages/InOperation/InOperation.vue 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/pages_inspect/pages/OutOperation/OutOperation.vue 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/store/index.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/util/request/responseInterceptors.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/.env.development 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/src/stores/counter.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/src/views/index.vue 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen_standard/src/views/process.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/.env.development 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/src/components/ext/OperaWrollOutStore.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web_standard/yarn.lock 14716 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
minipro_standard/common/config.js
@@ -1,6 +1,4 @@
module.exports = {
    // baseUrl: 'http://106.14.20.42/test_hfznzz/',
    // baseUrl: 'https://hefei.dtkey.cn/test_hfznzz/',
    // baseUrl: '/doumeeplant_api',
    baseUrl: 'https://dmtest.ahapp.net/doumeeplant_api',
    // baseUrl: 'http://192.168.0.15:10021',
minipro_standard/components/SelectTraMultipleMaterial.vue
@@ -1,12 +1,12 @@
<template>
    <u-popup :show="show" :round="10" closeable @close="show=false">
    <u-popup :show="show" :round="10" closeable @close="close()">
        <view class="material-content bbox p30 rp">
            <view class="tc b f24 c2 mb20">选择物料</view>
            <view class="tc b f32 c2 mb20">选择物料</view>
            <!-- <v-Search ref="V" @searchInput="searchInput" @submit="submit" :isShow="false" placeholder="搜索物料名称/编码">
            </v-Search> -->
            <div class="content_total">共{{pages.total}}条数据</div>
            <view class="scroll-content">
                <scroll-view scroll-y="true" refresher-enabled="true" :refresher-triggered="refreshing" @scrolltolower="loadMore"
                <scroll-view style="height: 100%;" scroll-y="true" refresher-enabled="true" :refresher-triggered="refreshing" @scrolltolower="loadMore"
                    @refresherrefresh="onRefresh">
                    <view v-for="(item1, index) in list" :key="index" class="flex mb20" @click="selectMaterialAction(index)">
                        <view class="img36 mr20 pt10">
@@ -162,7 +162,11 @@
            },
            selectAll() {
                this.selectIndex = []
                this.selectIndex = [...new Array(this.list.length).keys()]
                this.isAll = !this.isAll
                if (this.isAll) {
                    this.selectIndex = [...new Array(this.list.length).keys()]
                }
            },
            submitAction () {
                this.show = false
@@ -171,6 +175,10 @@
                    selectValue.push(this.list[item])
                })
                this.$emit('selectes', { materials: selectValue })
            },
            close() {
                this.show = false
                this.$emit('close')
            }
        }
    }
@@ -241,15 +249,10 @@
        display: flex;
        flex-direction: column;
        margin-bottom: 10rpx;
    }
    .bottom {
        height: 98rpx;
        // bottom: calc(env(safe-area-inset-bottom) + 20rpx);
        .submit {
            width: 272rpx;
            height: 98rpx;
minipro_standard/components/workOrderInfo.vue
@@ -118,7 +118,7 @@
        border: 8rpx;
    }
    // .order-info {
    //     border-bottom: 20rpx #f7f7f7 solid;
    // }
    .order-info {
        border-bottom: 20rpx #f7f7f7 solid;
    }
</style>
minipro_standard/pages/selectWorkOrder/selectWorkOrder.vue
@@ -380,7 +380,7 @@
                        width: 80%;
                        span {
                            font-size: 24rpx;
                            font-size: 32rpx;
                            font-weight: 500;
                            color: #333333;
                            overflow: hidden;
minipro_standard/pages_adjust/components/multipleMaterial.vue
@@ -1,7 +1,7 @@
<template>
    <u-popup :show="show" :round="10" closeable @close="show = false">
        <view class="material-content bbox p30 rp">
            <view class="tc b f24 c2 mb20">选择物料</view>
            <view class="tc b f32 c2 mb20">选择物料</view>
            <v-Search @searchInput="searchInput" @submit="submit" :isShow="false" placeholder="搜索物料名称/编码" />
            <div class="content_total">共{{form.total}}条数据</div>
            <view class="scroll-content">
minipro_standard/pages_adjust/pages/OrderDetail/OrderDetail.vue
@@ -15,7 +15,7 @@
                </div>
                <template v-if="feedingData && feedingData.length > 0">
                    <view class="plr30">
                    <view class="plr30 bg_w">
                        <view >
                            <div v-for="(item, index) in feedingData" :key="index" class="bg_list_item_h">
                                <div class="bg_list_item_num">
@@ -24,11 +24,11 @@
                                            <span> {{ item.materialName || '墙体砖' }}{{ item.procedureName ? `&nbsp;|&nbsp;${item.procedureName}` : ''
                                        }}</span>
                                            <div class="bg_list_item_num_item_wl_lx">
                                                <span class="green" v-if="item.qualityType == 0">合格&nbsp;/&nbsp;</span>
                                                <span class="orange" v-if="item.qualityType == 1">不良&nbsp;/&nbsp;</span>
                                                <span class="red" v-if="item.qualityType == 2">报废&nbsp;/&nbsp;</span>
                                                <span class="green" v-if="item.qualityType == 0">合格<text class="c6" decode>{{ split }}</text></span>
                                                <span class="orange" v-if="item.qualityType == 1">不良<text class="c6" decode>{{ split }}</text></span>
                                                <span class="red" v-if="item.qualityType == 2">报废<text class="c6" decode>{{ split }}</text></span>
                                                <span>{{ item.locationName }}</span>
                                                <span>{{ item.batch ? `&nbsp;/&nbsp;${item.batch}` : '' }}</span>
                                                <span v-if="item.batch"><text class="c6" decode>{{ split }}</text>{{ item.batch }}</span>
                                            </div>
                                        </div>
                                        <div class="bg_list_item_num_item_sr">
@@ -102,47 +102,13 @@
                            {{ performance.salaryType == 0 ? '计件' : '计时' }} |
                            {{ (performance.salaryPrice / 10 / 10).toFixed(2) }}元/{{ performance.salaryType ==
                                  0 ? 'ä»¶' : '时' }} | 
                            {{ complianceRate }}%
                            è¾¾æ ‡çŽ‡ï¼š{{ complianceRate }}%
                        </div>
                    </div>
                    <!-- <div class="bg_list_item_num">
                        <div class="bg_list_item_num_item">
                            <span>计件方式</span>
                            <div class="bg_list_item_num_item_list">
                                {{ performance.salaryType == 0 ? '计件' : '计时' }}
                            </div>
                        </div>
                    </div> -->
                    <!-- <div class="bg_list_item_num">
                        <div class="bg_list_item_num_item">
                            <span>工资单价</span>
                            <div class="bg_list_item_num_item_sr">
                                <span class="color1">{{ (performance.salaryPrice / 10 / 10).toFixed(2) }}元/{{ performance.salaryType ==
                            0 ? 'ä»¶' : '时' }}</span>
                            </div>
                        </div>
                    </div>
                    <div class="bg_list_item_num">
                        <div class="bg_list_item_num_item">
                            <span>达标率</span>
                            <div class="bg_list_item_num_item_sr">
                                <span class="color1">{{ complianceRate }}%</span>
                            </div>
                        </div>
                    </div> -->
                </div>
            </div>
        </div>
        <div v-else class="bg_list">
            <!-- <div  class="bg_list_item">
                <div class="bg_list_item_top">
                    <div class="bg_list_item_top_left">
                        <div class="bg_list_item_top_left_x bg_m"></div>
                        <span>生产点检</span>
                    </div>
                </div> -->
                <template v-if="djData && djData.length > 0">
                    <div class="details_dj">
                        <div class="details_dj_list">
@@ -208,7 +174,8 @@
                    {
                        name: '点检'
                    }
                ],
                ],
                split: '&nbsp;/&nbsp;',
                workorderId: '',
                form: {
                    time: '',
@@ -264,25 +231,23 @@
            })
        },
        computed: {
            complianceRate() {
            complianceRate() {
                if (!this.performance) return 0;
                if (!this.performance.duration) return 0;
                if (!this.performance.salaryNum || this.performance.salaryTimes) return 0
                let {duration, salaryNum, salaryTimes, qualifiedNum, unqualifiedNum, salaryUnqualified} = this.performance
                // æŠ¥å·¥æ—¶é•¿
                if (!duration) return 0;
                // æŠ¥å·¥æ•°é‡
                if (!qualifiedNum && !unqualifiedNum) return 0;
                // æ ‡å‡†æ•°é‡ã€æ—¶é•¿
                if (!salaryNum || !salaryTimes) return 0
                
                if (!this.performance.qualifiedNum && !this.performance.unqualifiedNum) return 0;
                if (this.performance.salaryUnqualified == 1) { // æ˜¯å¦è®¡å…¥ä¸è‰¯å“
                    let a = ((Number(this.performance.qualifiedNum) + Number(this.performance.unqualifiedNum)) / (this.performance
                        .duration / 3600)).toFixed(2)
                    let b = (this.performance.salaryNum / (this.performance.salaryTimes / 3600)).toFixed(2)
                    debugger
                if (salaryUnqualified == 1) { // æ˜¯å¦è®¡å…¥ä¸è‰¯å“
                    let a = ((Number(qualifiedNum) + Number(unqualifiedNum)) / (duration / 3600)).toFixed(2)
                    let b = (salaryNum / (salaryTimes / 3600)).toFixed(2)
                    return ((Number(a) / Number(b)) * 100).toFixed(2)
                    // let total = (Number(from.qualified) + Number(from.undesirable)) / ((from.duration * 60 * 60) * infoBox.value.num / )
                    // return total * infoBox.value.salary;
                } else {
                    let a = (this.performance.qualifiedNum / (this.performance.duration / 3600)).toFixed(2)
                    // let b = (this.arrType[this.form.index].num / (this.arrType[this.form.index].times / 3600)).toFixed(2)
                    let b = (this.performance.salaryNum / (this.performance.salaryTimes / 3600)).toFixed(2)
                    debugger
                    let a = (qualifiedNum / (duration / 3600)).toFixed(2)
                    let b = (salaryNum / (salaryTimes / 3600)).toFixed(2)
                    return ((Number(a) / Number(b)) * 100).toFixed(2)
                }
            }
@@ -506,6 +471,7 @@
                getWorkorderRecordListStandard({
                    workorderId: this.workorderId
                }).then(res => {
                    debugger
                    // console.log(res.data[0]);
                    if (res.data.length > 0) {
                        this.produceFrom.qualified = res.data[0].qualifiedNum
@@ -535,7 +501,7 @@
        background: #FFFFFF;
        display: flex;
        align-items: center;
        border-top: 20rpx solid #f7f7f7;
        // border-top: 20rpx solid #f7f7f7;
        .active {
            box-sizing: border-box;
            color: #305ED5 !important;
minipro_standard/pages_adjust/pages/addReceipt/addReceipt.vue
@@ -179,6 +179,7 @@
                    if (!this.list[i].locationId) return uni.showToast({ title: `第${i+1}项入库货位不能为空`, icon: 'none', duration: 2000 });
                    if (!this.list[i].materialId) return uni.showToast({ title: `第${i+1}项入库物料不能为空`, icon: 'none', duration: 2000 });
                    if (!this.list[i].qualityType) return uni.showToast({ title: `第${i+1}项质量属性不能为空`, icon: 'none', duration: 2000 });
                    if (!this.list[i].batch) return uni.showToast({ title: `第${i+1}项批次号不能为空`, icon: 'none', duration: 2000 });
                    if (this.list[i].num <= 0) {
                        return uni.showToast({ title: `第${i + 1}项入库数量必须大于0`, icon: 'none', duration: 2000 });
                    }
minipro_standard/pages_adjust/pages/newTransfer/newTransfer.vue
@@ -31,8 +31,8 @@
            <template v-if="view.MaterialList.length > 0">
                <view class="zk_wl_item" v-for="(item, i) in view.MaterialList" :key="i">
                    <image class="shanchu" src="@/static/chuku_ic_delete@2x.png" mode="widthFix" @click="dele(i)"></image>
                    <text>{{item.materialName}}|{{item.materialCode}}</text>
                    <text>
                    <text class="material-title">{{item.materialName}}|{{item.materialCode}}</text>
                    <text class="material-att">
                        <text class="green" v-if="item.qualityType === '0'" decode>合格<text class="c6" decode>{{ division }}</text></text>
                        <text class="yellow" v-if="item.qualityType === '1'" decode>不良<text class="c6" decode>{{ division }}</text></text>
                        <text class="red" v-if="item.qualityType === '2'" decode>报废<text class="c6" decode>{{ division }}</text></text>
@@ -272,13 +272,11 @@
                &:last-child {
                    border: none !important;
                }
                text {
                    font-size: 24rpx;
                    font-size: 30rpx;
                    font-weight: 400;
                    color: #222222;
                }
                .zk_list_item_n {
                    display: flex;
                    align-items: center;
@@ -346,7 +344,7 @@
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    margin-top: 30rpx;
                    margin-top: 10rpx;
                    
                    .zk_wl_item_input {
                        display: flex;
@@ -360,7 +358,8 @@
                    }
                    text {
                        font-size: 26rpx;
                        height: 42rpx;
                        font-size: 30rpx;
                        font-family: PingFangSC-Regular, PingFang SC;
                        font-weight: 400;
                        color: #333333;
@@ -383,30 +382,24 @@
                        color: #999999;
                    }
                }
                .material-title {
                    height: 42rpx;
                    font-size: 30rpx;
                    font-weight: 500;
                    color: #222222;
                    margin-bottom: 10rpx;
                }
                .material-att {
                    font-size: 28rpx;
                    font-weight: 400;
                    color: #333333;
                }
                text {
                    &:nth-child(1) {
                        font-size: 24rpx;
                        font-weight: 500;
                        color: #222222;
                        margin-bottom: 24rpx;
                    }
                    &:nth-child(2) {
                        font-size: 24rpx;
                        font-weight: 400;
                        color: #666666;
                        margin-bottom: 30rpx;
                        text {
                            font-size: 24rpx;
                        }
                    }
                    &:nth-child(3) {
                        font-size: 28rpx;
                        font-weight: 400;
                        color: #333333;
                    }
                }
            }
minipro_standard/pages_adjust/pages/reportingForWork/reportingForWork.vue
@@ -1,1232 +1,1424 @@
<template>
    <view class="bg">
        <view class="bg_plan" @click="selectPlan">
            <view class="bg_plan_label" v-if="!from.processPlan">
                <text><text>*</text>工序生产计划</text>
            </view>
            <view class="bg_plan_nr" v-else>
                <text>{{ from.processPlan.materialName }} | {{ from.processPlan.materialCode }} | {{ from.processPlan.produceName }}</text>
                <text>{{ from.processPlan.batch }}{{ from.processPlan.salesOrder ? ` / ${from.processPlan.salesOrder}` : '' }}</text>
                <text>计划时间:{{ from.processPlan.workPlanStartDate }} ~ {{ from.processPlan.workPlanEndDate }}</text>
                <text>计划进度:{{from.processPlan.num}}/{{from.processPlan.workorderDistributNum}}{{ from.processPlan.unitName }}</text>
            </view>
            <view class="bg_plan_label_val">
                <text v-if="!from.processPlan">请选择</text>
                <image src="@/static/ic_ar@2x.png" alt="" />
            </view>
        </view>
        <template v-if="plansId">
            <view class="bg_list">
                <view class="bg_list_item">
                    <view class="bg_list_item_top">
                        <view class="bg_list_item_top_left">
                            <view class="bg_list_item_top_left_x"></view>
                            <text>生产信息</text>
                        </view>
                    </view>
                    <view class="bg_list_item_h">
                        <view class="bg_list_item_num" @click="openDev">
                            <view class="bg_list_item_num_item">
                                <text>生产设备</text>
<template>
    <view class="bg">
        <view class="bg_plan" @click="selectPlan">
            <view class="bg_plan_label" v-if="!from.processPlan">
                <text><text>*</text>工序生产计划</text>
            </view>
            <view class="bg_plan_nr" v-else>
                <text>{{ from.processPlan.materialName }} | {{ from.processPlan.materialCode }} |
                    {{ from.processPlan.produceName }}</text>
                <text>{{ from.processPlan.batch }}{{ from.processPlan.salesOrder ? ` / ${from.processPlan.salesOrder}` : '' }}</text>
                <text>计划时间:{{ from.processPlan.workPlanStartDate }} ~ {{ from.processPlan.workPlanEndDate }}</text>
                <text>计划进度:{{from.processPlan.num}}/{{from.processPlan.workorderDistributNum}}{{ from.processPlan.unitName }}</text>
            </view>
            <view class="bg_plan_label_val">
                <text v-if="!from.processPlan">请选择</text>
                <image src="@/static/ic_ar@2x.png" alt="" />
            </view>
        </view>
        <!-- v-if="plansId" -->
        <template>
            <view class="bg_list">
                <view class="bg_list_item">
                    <view class="bg_list_item_top">
                        <view class="bg_list_item_top_left">
                            <view class="bg_list_item_top_left_x"></view>
                            <text>生产信息</text>
                        </view>
                    </view>
                    <view class="bg_list_item_h">
                        <view class="bg_list_item_num" @click="openDev">
                            <view class="bg_list_item_num_item">
                                <text>生产设备</text>
                                <view class="bg_list_item_num_item_sr">
                                    <text
                                        :style="{color: from.deviceName ? '#333' : ''}">{{from.deviceName ? from.deviceName : '请选择'}}</text>
                                    <image src="@/static/ic_ar@2x.png" alt="" />
                                </view>
                            </view>
                        </view>
                        <view class="bg_list_item_num" @click="userShow = true">
                            <view class="bg_list_item_num_item">
                                <text>生产人员</text>
                                <view class="bg_list_item_num_item_sr">
                                    <text
                                        :style="{color: from.userName ? '#333' : ''}">{{from.userName ? from.userName : '请选择'}}</text>
                                    <image src="@/static/ic_ar@2x.png" alt="" />
                                </view>
                            </view>
                        </view>
                    </view>
                </view>
                <view class="bg_list_item">
                    <view class="bg_list_item_top">
                        <view class="bg_list_item_top_left">
                            <view class="bg_list_item_top_left_x"></view>
                            <text>生产投料</text>
                        </view>
                        <view class="bg_list_item_top_right" @click="openMaterial"
                            v-if="(hasBom == 1 && bomType != 1) || hasBom == 0">
                            <image src="@/static/gongdan_ic_shoudong@2x.png" alt="" />
                            <text>新增投料</text>
                        </view>
                    </view>
                    <template v-if="wuList.length > 0 && !(hasBom == 1 && bomType == 1)">
                        <van-swipe-cell v-for="(item, index) in wuList" :key="index">
                            <view class="bg_list_item_h">
                                <view class="bg_list_item_num">
                                    <view class="bg_list_item_num_item">
                                        <view class="bg_list_item_num_item_wl">
                                            <text>{{ item.materialName }}{{ item.procedureName ? ` | ${item.procedureName}` : '' }}</text>
                                            <view class="bg_list_item_num_item_wl_lx">
                                                <text class="green" v-if="item.qualityType == 0">合格&nbsp;/&nbsp;</text>
                                                <text class="yellow" v-if="item.qualityType == 1">不良&nbsp;/&nbsp;</text>
                                                <text class="red" v-if="item.qualityType == 2">报废&nbsp;/&nbsp;</text>
                                                <text>{{ item.locationName || '-' }}&nbsp;/&nbsp;</text>
                                                <text>{{ item.batch || '-' }}</text>
                                            </view>
                                        </view>
                                        <view class="bg_list_item_num_item_sr">
                                            <u--input placeholder="请输入" border="surround" type="number"
                                                :customStyle="{width: '100%'}" v-model="item.num"
                                                @input="inputwl(index)"></u--input>
                                            <!-- <input type="number" v-model="item.num" @input="inputwl(index)" /> -->
                                            <text>{{ item.unitName }}</text>
                                        </view>
                                    </view>
                                </view>
                            </view>
                            <template #right>
                                <van-button style="height: 100%;" @click="deleItem(index)" square text="删除"
                                    type="danger" />
                            </template>
                        </van-swipe-cell>
                    </template>
                    <template v-else-if="wuList.length == 0 && !(hasBom == 1 && bomType == 1)">
                        <view class="kong">
                            <text>暂无数据</text>
                        </view>
                    </template>
                    <view class="kong" v-if="hasBom == 1 && bomType == 1">
                        <text>当前工序无需投料</text>
                    </view>
                </view>
                <view class="bg_list_item bottomval">
                    <view class="bg_list_item_top">
                        <view class="bg_list_item_top_left">
                            <view class="bg_list_item_top_left_x"></view>
                            <text>产出明细</text>
                        </view>
                    </view>
                    <view class="bg_list_item_h">
                        <view class="bg_list_item_num">
                            <view class="bg_list_item_num_item">
                                <text><text>*</text>良品数</text>
                                <view class="bg_list_item_num_item_sr">
                                    <!-- <u--input placeholder="请输入" border="surround" type="number"
                                        :customStyle="{width: '180rpx'}" v-model="from.qualified" @input="changeNum(1)">
                                    </u--input> -->
                                    <input type="number" v-model="from.qualified" @input="changeNum(1)" placeholder="请输入" />
                                    <text v-if="from.processPlan">{{from.processPlan.unitName}}</text>
                                </view>
                            </view>
                        </view>
                        <view class="bg_list_item_num">
                            <view class="bg_list_item_num_item">
                                <text>不良数</text>
                                <view class="bg_list_item_num_item_sr">
                                    <text :style="{color: from.deviceName ? '#333' : ''}">{{from.deviceName ? from.deviceName : '请选择'}}</text>
                                    <image src="@/static/ic_ar@2x.png" alt="" />
                                </view>
                            </view>
                        </view>
                        <view class="bg_list_item_num" @click="userShow = true">
                            <view class="bg_list_item_num_item">
                                <text>生产人员</text>
                                <view class="bg_list_item_num_item_sr">
                                    <text :style="{color: from.userName ? '#333' : ''}">{{from.userName ? from.userName : '请选择'}}</text>
                                    <image src="@/static/ic_ar@2x.png" alt="" />
                                </view>
                            </view>
                        </view>
                    </view>
                </view>
                <view class="bg_list_item">
                    <view class="bg_list_item_top">
                        <view class="bg_list_item_top_left">
                            <view class="bg_list_item_top_left_x"></view>
                            <text>生产投料</text>
                        </view>
                        <view class="bg_list_item_top_right" @click="openMaterial" v-if="(hasBom == 1 && bomType != 1) || hasBom == 0">
                            <image src="@/static/gongdan_ic_shoudong@2x.png" alt="" />
                            <text>新增投料</text>
                        </view>
                    </view>
                    <template v-if="wuList.length > 0 && !(hasBom == 1 && bomType == 1)">
                        <van-swipe-cell v-for="(item, index) in wuList" :key="index">
                            <view class="bg_list_item_h">
                                <view class="bg_list_item_num">
                                    <view class="bg_list_item_num_item">
                                        <view class="bg_list_item_num_item_wl">
                                            <text>{{ item.materialName }}{{ item.procedureName ? ` | ${item.procedureName}` : '' }}</text>
                                            <view class="bg_list_item_num_item_wl_lx">
                                                <text class="green" v-if="item.qualityType == 0">合格&nbsp;/&nbsp;</text>
                                                <text class="yellow" v-if="item.qualityType == 1">不良&nbsp;/&nbsp;</text>
                                                <text class="red" v-if="item.qualityType == 2">报废&nbsp;/&nbsp;</text>
                                                <text>{{ item.locationName || '-' }}&nbsp;/&nbsp;</text>
                                                <text>{{ item.batch || '-' }}</text>
                                            </view>
                                        </view>
                                        <view class="bg_list_item_num_item_sr">
                                            <u--input
                                                placeholder="请输入"
                                                border="surround"
                                                type="number"
                                                :customStyle="{width: '100%'}"
                                                v-model="item.num"
                                                @input="inputwl(index)"
                                              ></u--input>
                                            <!-- <input type="number" v-model="item.num" @input="inputwl(index)" /> -->
                                            <text>{{ item.unitName }}</text>
                                        </view>
                                    </view>
                                </view>
                            </view>
                            <template #right>
                                <van-button style="height: 100%;" @click="deleItem(index)" square text="删除" type="danger" />
                            </template>
                        </van-swipe-cell>
                    </template>
                    <template v-else-if="wuList.length == 0 && !(hasBom == 1 && bomType == 1)">
                        <view class="kong">
                            <text>暂无数据</text>
                        </view>
                    </template>
                    <view class="kong" v-if="hasBom == 1 && bomType == 1">
                        <text>当前工序无需投料</text>
                    </view>
                </view>
                <view class="bg_list_item bottomval">
                    <view class="bg_list_item_top">
                        <view class="bg_list_item_top_left">
                            <view class="bg_list_item_top_left_x"></view>
                            <text>产出明细</text>
                        </view>
                    </view>
                    <view class="bg_list_item_h">
                        <view class="bg_list_item_num">
                            <view class="bg_list_item_num_item">
                                <text><text>*</text>良品数</text>
                                <view class="bg_list_item_num_item_sr">
                                    <u--input
                                        placeholder="请输入"
                                        border="surround"
                                        type="number"
                                        :customStyle="{width: '180rpx'}"
                                        v-model="from.qualified"
                                        @input="changeNum(1)"
                                      ></u--input>
                                    <!-- <input type="number" v-model="from.qualified" @input="changeNum(1)" placeholder="请输入" /> -->
                                    <text v-if="from.processPlan">{{from.processPlan.unitName}}</text>
                                </view>
                            </view>
                        </view>
                        <view class="bg_list_item_num">
                            <view class="bg_list_item_num_item">
                                <text>不良数</text>
                                <view class="bg_list_item_num_item_sr">
                                    <u--input
                                        placeholder="请输入"
                                        border="surround"
                                        type="number"
                                        :customStyle="{width: '180rpx'}"
                                        v-model="from.undesirable"
                                        @input="changeNum(2)"
                                      ></u--input>
                                    <!-- <input type="number" v-model="from.undesirable" @input="changeNum(2)" placeholder="请输入" /> -->
                                    <text v-if="from.processPlan">{{from.processPlan.unitName}}</text>
                                </view>
                            </view>
                        </view>
                        <view class="bg_list_item_num" v-if="from.undesirable > 0">
                            <view class="bg_list_item_num_item" @click="openBL">
                                <!-- <text>*</text> -->
                                <text>不良项</text>
                                <view class="bg_list_item_num_item_sr">
                                    <text class="wulll" :style="{color: from.defectiveName ? '#305ED5' : ''}">{{from.defectiveName ? from.defectiveName : '设置'}}</text>
                                    <image src="@/static/ic_ar@2x.png" alt="" />
                                </view>
                            </view>
                        </view>
                    </view>
                </view>
                <view class="bg_plan" @click="TimeShow = true">
                    <view class="bg_plan_label">
                        <text>报工时长</text>
                    </view>
                    <view class="bg_plan_label_val">
                        <text :style="{color: from.durationName ? '#333' : ''}">{{from.durationName ? from.durationName : '请选择'}}</text>
                        <image src="@/static/ic_ar@2x.png" alt="" />
                    </view>
                </view>
                <view class="bg_list_item" v-if="arrType && arrType.length > 0 && from.duration > 0">
                    <view class="bg_list_item_top">
                        <view class="bg_list_item_top_left">
                            <view class="bg_list_item_top_left_x"></view>
                            <text>工资绩效</text>
                        </view>
                    </view>
                    <view class="bg_list_item_h">
                        <view class="bg_list_item_num">
                            <view class="bg_list_item_num_item">
                                <text>计件方式</text>
                                <view class="bg_list_item_num_item_list">
                                    <view :class="item.active ? 'bg_list_item_num_item_list_item active' : 'bg_list_item_num_item_list_item'" v-for="(item, index) in arrType" :key="index" @click="clickPerformanceType(index)">{{ item.name }}</view>
                                </view>
                            </view>
                        </view>
                        <view class="bg_list_item_num">
                            <view class="bg_list_item_num_item">
                                <text>工资单价</text>
                                <view class="bg_list_item_num_item_sr">
                                    <text class="color1">{{(arrType[from.index].salary / 10 / 10).toFixed(2)}}元/{{arrType[from.index].type == 0 ? 'ä»¶' : '时'}}</text>
                                </view>
                            </view>
                        </view>
                        <view class="bg_list_item_num">
                            <view class="bg_list_item_num_item">
                                <text>预计工资</text>
                                <view class="bg_list_item_num_item_sr">
                                    <text class="color1">{{expectedSalary}}元</text>
                                </view>
                            </view>
                        </view>
                        <view class="bg_list_item_num">
                            <view class="bg_list_item_num_item">
                                <text>达标率</text>
                                <view class="bg_list_item_num_item_sr">
                                    <text class="color1">{{complianceRate}}%</text>
                                </view>
                            </view>
                        </view>
                    </view>
                </view>
            </view>
            <!--  æŠ¥å·¥æŒ‰é’®  -->
            <view class="bh_zw"></view>
            <view class="bg_footer">
                <view class="bg_footer_submit1" @click="continueSubmit">继续报工</view>
                <view class="bg_footer_submit" @click="submit">提交</view>
            </view>
        </template>
        <!-- ç”Ÿäº§äººå‘˜ -->
        <user :show="userShow" @close="userShow = false" @value="onConfirm1" />
        <!-- ç”Ÿäº§è®¾å¤‡ -->
        <u-picker :show="deviceShow" :columns="deviceList" keyName="name" @confirm="onConfirm" @cancel="deviceShow = false"></u-picker>
        <!-- æ—¶é—´ -->
        <u-picker :show="TimeShow" :columns="columns" @confirm="onConfirm2" @cancel="TimeShow = false"></u-picker>
        <!-- ç‰©æ–™ -->
        <MaterialSelect ref="MaterialSelect" :plansId="String(plansId)" :selected="ids" :deviceId="String(deviceId)" @value="getValue" />
        <!-- ä¸è‰¯é¡¹ -->
        <u-popup :show="show" @close="show = false" :round="8" closeable zIndex="20000">
            <view class="rp p40 contanir">
                <view class="c2 b tc">不良项</view>
                <view class="content bl_list">
                    <div class="bl_list_item" v-for="(item, i) in cateList" :key="i" @click="changeChecked(i)">
                        <div class="bl_list_item_left">
                            <u-checkbox-group @change="poorSelection(item.active, i)">
                                <u-checkbox :checked="item.active" :label="item.name" :name="item.name"></u-checkbox>
                            </u-checkbox-group>
                        </div>
                        <div class="bl_list_item_right">
                            <input type="number" @click.stop v-model="item.num" placeholder="0" />
                        </div>
                    </div>
                </view>
                <view class="flex ap tc bottom-view">
                    <view class="fx1 ml20 ptb20 sbtn_green" @click="onConfirm3">确定</view>
                </view>
            </view>
        </u-popup>
    </view>
</template>
<script>
    import user from '../../components/user.vue'
    import MaterialSelect from '../../components/MaterialSelect.vue'
    import { mapState } from 'vuex'
    import { getDeviceByCondition, getFindAll, queryOne, queryList, autoWorkReport, getIdPlansExt, categoryExtList } from '@/util/api/PlanningAPI'
    export default {
        components: {
            user,
            MaterialSelect
        },
        data() {
            return {
                from: {
                    processPlan: null,
                    deviceId: '',
                    deviceName: '',
                    // userId: userInfo.id,
                    userId: '',
                    // userName: userInfo.companyUser.name,
                    userName: '',
                    qualified: '',  // è‰¯å“æ•°
                    undesirable: '', // ä¸è‰¯æ•°
                    duration: '',
                    durationName: '0小时0分钟',
                    time: '',
                    defective: [],
                    defectiveName: '',
                    type: '',    // ç»©æ•ˆç±»åž‹
                    index: 0
                },
                columns: [],
                arrType: [],
                bomType: '',
                hasBom : '',
                deviceShow: false,
                userShow: false,
                wuList: [],
                deviceList: [],
                cateList: [
                    {
                        active: false,
                        num: '',
                        name: '有瑕疵'
                    }
                ],
                total: 0,    // å¯æŠ•数量
                ids: '',
                plansId: '',
                deviceId: '',
                TimeShow: '',
                show1: '',
                show: false
            };
        },
        computed: {
            ...mapState(['userInfo']),
            // é¢„计工资
            expectedSalary() {
                if (this.arrType.length === 0) return 0;
                let { index, qualified, undesirable, duration } = this.from
                let temp = this.arrType[index]
                if (temp.type == 0) {
                    if (!qualified) return 0
                    if (temp.unqualified == 1) {   // æ˜¯å¦è®¡å…¥ä¸è‰¯å“
                        let total = Number(qualified) + Number(undesirable)
                        return (total * (temp.salary / 10 / 10)).toFixed(2)
                    } else {
                        return (Number(qualified) * (temp.salary / 10 / 10)).toFixed(2)
                    }
                } else {
                    if (!duration) return 0;
                    let h = (duration / 60 / 60).toFixed(2)
                    return (Number(h) * (temp.salary / 10 / 10)).toFixed(2)
                }
            },
            // è¾¾æ ‡çއ
            complianceRate() {
                if (this.arrType.length === 0) return 0;
                let { index, qualified, undesirable, duration } = this.from
                let temp = this.arrType[index]
                if (!qualified && !undesirable) return 0;
                if (!duration) return 0;
                if (!temp.num) return 0;
                if (temp.unqualified == 1) {   // æ˜¯å¦è®¡å…¥ä¸è‰¯å“
                    let a = ((Number(qualified) + Number(undesirable)) / (duration / 3600)).toFixed(2)
                    let b = (temp.num / (temp.times / 3600)).toFixed(2)
                    return ((Number(a) / Number(b)) * 100).toFixed(2)
                } else {
                    let a = (qualified / (duration / 3600)).toFixed(2)
                    let b = (temp.num / (temp.times / 3600)).toFixed(2)
                    return ((Number(a) / Number(b)) * 100).toFixed(2)
                }
            }
        },
        onReady() {
            let timer = setInterval(() => {
                if (this.userInfo) {
                    this.from.userId = this.userInfo.id
                    this.from.userName = this.userInfo.realname
                    clearInterval(timer)
                }
            }, 500)
        },
        onLoad() {
            let arr = []
            for(let i = 0; i < 60; i++) {
                arr.push(i)
            }
            this.getData()
            this.columns = [arr, arr]
            // æŽ¥æ”¶è®¡åˆ’
            uni.$on('update', (data) => {
                this.from.processPlan = data.obj
                this.plansId = data.obj.id
                this.from.deviceId = ''
                this.from.deviceName = ''
                this.deviceId = ''
                this.total = data.obj.num - data.obj.workorderDistributNum
                this.wuList = []
                this.from.defective = []
                this.from.defectiveName = ''
                // this.from.userName = ''
                // this.from.userId = ''
                // èŽ·å–è®¾å¤‡
                getDeviceByCondition({ procedureId: data.obj.procedureId })
                    .then(res1 => {
                        if (res1.code === 200) {
                            if (res1.data && res1.data.length > 0) {
                                this.deviceId = res1.data[0].id
                                this.from.deviceId = res1.data[0].id
                                this.from.deviceName = res1.data[0].name
                                this.deviceList = [res1.data]
                            }
                        }
                    })
                // èŽ·å–ç±»åž‹
                getIdPlansExt(data.obj.id)
                    .then(res2 => {
                        if (res2.code === 200) {
                            this.bomType = res2.data.bomType
                            this.hasBom = res2.data.hasBom
                        }
                    })
                // èŽ·å–å·¥èµ„ç»©æ•ˆæ•°æ®
                queryList({
                    deleted: 0,
                    departId: data.obj.factoryId,
                    materialId: data.obj.materialId,
                    procedureId: data.obj.procedureId
                }).then(result => {
                    if (result.code === 200) {
                        if (result.data && result.data.length > 0) {
                            result.data.forEach((item, index) => {
                                item.name = item.type == 0 ? '计件' : '计时'
                                item.id = item.type
                                item.active = index == 0
                            })
                            this.arrType = result.data
                            console.log(this.arrType)
                        } else {
                            this.arrType = []
                        }
                    }
                })
            })
        },
        methods: {
            poorSelection(val, i) {
                this.cateList.forEach((item, index) => {
                    if (i === index) {
                        item.active = !item.active
                    }
                })
            },
            // åˆ‡æ¢ç»©æ•ˆç±»åž‹
            clickPerformanceType(i) {
                this.from.index = i
                this.arrType.forEach((item, index) => {
                    if (i === index) {
                        this.from.type = item.id
                    }
                    item.active = index === i
                })
            },
            // é€‰æ‹©ç‰©æ–™
            getValue(val) {
                let obj = JSON.parse(JSON.stringify(val))
                obj.total = val.num
                this.wuList.unshift(obj)
                let arr = this.wuList.map(item => item.id)
                this.ids = arr
            },
            // èŽ·å–ä¸è‰¯é¡¹ç›®
            getData() {
                categoryExtList({
                    cateType: "3"
                }).then(res => {
                    if (res.code === 200) {
                        res.data.forEach(item => {
                            item.active = false
                            item.num = ''
                        })
                        this.cateList = res.data
                    }
                })
            },
            // é€‰æ‹©è®¾å¤‡
            onConfirm(e) {
                this.from.deviceId = e.value[0].id
                this.from.deviceName = e.value[0].name
                this.deviceId = e.value[0].id
                this.from.userId = ''
                this.from.userName = ''
                // getFindAll({
                //     deviceId: e.id,
                //     planId: from.processPlan.id
                // }).then(res => {
                //     if (res.code === 200) {
                //         res.data.forEach((item: any) => {
                //             item.name = item.umodel.name + '-' + item.tmodel.name
                //         })
                //         userList.value = res.data
                //     }
                // })
                this.deviceShow = false
            },
            // é€‰æ‹©ä¸è‰¯é¡¹
            onConfirm3() {
                let isOpen = false
                this.cateList.forEach((item, index) => {
                    if (item.active) {
                        isOpen = true
                    }
                })
                if (!isOpen) return uni.showToast({ title: '请选择不良项', icon: 'none', duration: 2000 });
                let arr = []
                let total = 0
                let name = ''
                for (let i = 0; i < this.cateList.length; i++) {
                    if (this.cateList[i].active) {
                        if (Number(this.cateList[i].num) <= 0) {
                            return uni.showToast({ title: '不良数量必须大于0', icon: 'none', duration: 2000 });
                        }
                        total = total += Number(this.cateList[i].num)
                        arr.push(this.cateList[i])
                        name += this.cateList[i].name + this.cateList[i].num + ';'
                    }
                }
                if (total !== Number(this.from.undesirable)) return uni.showToast({ title: '不良数必须等于产出不良数', icon: 'none', duration: 2000 });
                this.from.defective = arr
                this.from.defectiveName = name
                this.show = false
            },
            changeChecked(i) {
                this.cateList[i].active = !this.cateList[i].active
            },
            onConfirm2(e) {
                let h = e.value[0]
                let m = e.value[1]
                let s = 0
                if (h > 0) {
                    s += h * 60 * 60
                }
                if (m > 0) {
                    s += m * 60
                }
                this.from.duration = s
                this.from.durationName = `${h}小时${m}分钟`
                this.TimeShow = false
            },
            onConfirm1(e) {
                this.from.userId = e.userId
                this.from.userName = e.name
                this.userShow = false
            },
            selectPlan() {
                uni.navigateTo({
                    url: '/pages_adjust/pages/processPlan/processPlan'
                });
            },
            openDev() {
                if (!this.from.processPlan) return uni.showToast({ title: '请先选择工序生产计划', icon: 'none', duration: 2000 });
                this.deviceShow = true
            },
            openMaterial() {
                if (!this.plansId) return uni.showToast({ title: '请先选择工序生产计划', icon: 'none', duration: 2000 });
                if (!this.deviceId) return uni.showToast({ title: '请先选择生产设备', icon: 'none', duration: 2000 });
                this.$refs.MaterialSelect.open()
            },
            inputwl(i) {
                if (this.wuList[i].num > this.wuList[i].total) {
                    this.wuList[i].num = ''
                    uni.showToast({ title: '投料数量不能大于库存数量', icon: 'none', duration: 2000 });
                }
            },
            deleItem(index) {
                if (this.wuList.length === 1) return uni.showToast({ title: '至少保留一项内容', icon: 'none', duration: 2000 });
                this.wuList.splice(index, 1)
            },
            // äº§å‡ºæ•°é‡éªŒè¯
                                    <!-- <u--input placeholder="请输入" border="surround" type="number"
                                        :customStyle="{width: '180rpx'}" v-model="from.undesirable"
                                        @input="changeNum(2)"></u--input> -->
                                    <input type="number" v-model="from.undesirable" @input="$event => changeNum( 2)" placeholder="请输入" />
                                    <text v-if="from.processPlan">{{from.processPlan.unitName}}</text>
                                </view>
                            </view>
                        </view>
                        <view class="bg_list_item_num" v-if="from.undesirable > 0">
                            <view class="bg_list_item_num_item" @click="openBL">
                                <!-- <text>*</text> -->
                                <text>不良项</text>
                                <view class="bg_list_item_num_item_sr">
                                    <text class="wulll"
                                        :style="{color: from.defectiveName ? '#305ED5' : ''}">{{from.defectiveName ? from.defectiveName : '设置'}}</text>
                                    <image src="@/static/ic_ar@2x.png" alt="" />
                                </view>
                            </view>
                        </view>
                    </view>
                </view>
                <view class="bg_plan" @click="TimeShow = true">
                    <view class="bg_plan_label">
                        <text>报工时长</text>
                    </view>
                    <view class="bg_plan_label_val">
                        <text
                            :style="{color: from.durationName ? '#333' : ''}">{{from.durationName ? from.durationName : '请选择'}}</text>
                        <image src="@/static/ic_ar@2x.png" alt="" />
                    </view>
                </view>
                <view class="bg_list_item" v-if="arrType && arrType.length > 0 && from.duration > 0">
                    <view class="bg_list_item_top">
                        <view class="bg_list_item_top_left">
                            <view class="bg_list_item_top_left_x"></view>
                            <text>工资绩效</text>
                        </view>
                    </view>
                    <view class="bg_list_item_h">
                        <view class="bg_list_item_num">
                            <view class="bg_list_item_num_item">
                                <text>计件方式</text>
                                <view class="bg_list_item_num_item_list">
                                    <view
                                        :class="item.active ? 'bg_list_item_num_item_list_item active' : 'bg_list_item_num_item_list_item'"
                                        v-for="(item, index) in arrType" :key="index"
                                        @click="clickPerformanceType(index)">{{ item.name }}</view>
                                </view>
                            </view>
                        </view>
                        <view class="bg_list_item_num">
                            <view class="bg_list_item_num_item">
                                <text>工资单价</text>
                                <view class="bg_list_item_num_item_sr">
                                    <text
                                        class="color1">{{(arrType[from.index].salary / 10 / 10).toFixed(2)}}元/{{arrType[from.index].type == 0 ? 'ä»¶' : '时'}}</text>
                                </view>
                            </view>
                        </view>
                        <view class="bg_list_item_num">
                            <view class="bg_list_item_num_item">
                                <text>预计工资</text>
                                <view class="bg_list_item_num_item_sr">
                                    <text class="color1">{{expectedSalary}}元</text>
                                </view>
                            </view>
                        </view>
                        <view class="bg_list_item_num">
                            <view class="bg_list_item_num_item">
                                <text>达标率</text>
                                <view class="bg_list_item_num_item_sr">
                                    <text class="color1">{{complianceRate}}%</text>
                                </view>
                            </view>
                        </view>
                    </view>
                </view>
            </view>
            <!--  æŠ¥å·¥æŒ‰é’®  -->
            <view class="bh_zw"></view>
            <view class="bg_footer">
                <view class="bg_footer_submit1" @click="continueSubmit">继续报工</view>
                <view class="bg_footer_submit" @click="submit">提交</view>
            </view>
        </template>
        <!-- ç”Ÿäº§äººå‘˜ -->
        <user :show="userShow" @close="userShow = false" @value="onConfirm1" />
        <!-- ç”Ÿäº§è®¾å¤‡ -->
        <u-picker :show="deviceShow" :columns="deviceList" keyName="name" @confirm="onConfirm"
            @cancel="deviceShow = false"></u-picker>
        <!-- æ—¶é—´ -->
        <u-picker :show="TimeShow" :columns="columns" @confirm="onConfirm2" @cancel="TimeShow = false"></u-picker>
        <!-- ç‰©æ–™ -->
        <MaterialSelect ref="MaterialSelect" :plansId="String(plansId)" :selected="ids" :deviceId="String(deviceId)"
            @value="getValue" />
        <!-- ä¸è‰¯é¡¹ -->
        <u-popup :show="show" @close="show = false" :round="8" closeable zIndex="20000">
            <view class="rp p40 contanir">
                <view class="c2 b tc">不良项</view>
                <view class="content bl_list">
                    <div class="bl_list_item" v-for="(item, i) in cateList" :key="i" @click="changeChecked(i)">
                        <div class="bl_list_item_left">
                            <u-checkbox-group @change="poorSelection(item.active, i)">
                                <u-checkbox :checked="item.active" :label="item.name" :name="item.name"></u-checkbox>
                            </u-checkbox-group>
                        </div>
                        <div class="bl_list_item_right">
                            <input type="number" @click.stop v-model="item.num" placeholder="0" />
                        </div>
                    </div>
                </view>
                <view class="flex ap tc bottom-view">
                    <view class="fx1 ml20 ptb20 sbtn_green" @click="onConfirm3">确定</view>
                </view>
            </view>
        </u-popup>
    </view>
</template>
<script>
    import user from '../../components/user.vue'
    import MaterialSelect from '../../components/MaterialSelect.vue'
    import {
        mapState
    } from 'vuex'
    import {
        getDeviceByCondition,
        getFindAll,
        queryOne,
        queryList,
        autoWorkReport,
        getIdPlansExt,
        categoryExtList
    } from '@/util/api/PlanningAPI'
    export default {
        components: {
            user,
            MaterialSelect
        },
        data() {
            return {
                from: {
                    processPlan: null,
                    deviceId: '',
                    deviceName: '',
                    // userId: userInfo.id,
                    userId: '',
                    // userName: userInfo.companyUser.name,
                    userName: '',
                    qualified: '', // è‰¯å“æ•°
                    undesirable: '', // ä¸è‰¯æ•°
                    duration: '',
                    durationName: '0小时0分钟',
                    time: '',
                    defective: [],
                    defectiveName: '',
                    type: '', // ç»©æ•ˆç±»åž‹
                    index: 0
                },
                columns: [],
                arrType: [],
                bomType: '',
                hasBom: '',
                deviceShow: false,
                userShow: false,
                wuList: [],
                deviceList: [],
                cateList: [{
                    active: false,
                    num: '',
                    name: '有瑕疵'
                }],
                total: 0, // å¯æŠ•数量
                ids: '',
                plansId: '',
                deviceId: '',
                TimeShow: '',
                show1: '',
                show: false
            };
        },
        computed: {
            ...mapState(['userInfo']),
            // é¢„计工资
            expectedSalary() {
                if (this.arrType.length === 0) return 0;
                let {
                    index,
                    qualified,
                    undesirable,
                    duration
                } = this.from
                let temp = this.arrType[index]
                if (temp.type == 0) {
                    if (!qualified) return 0
                    if (temp.unqualified == 1) { // æ˜¯å¦è®¡å…¥ä¸è‰¯å“
                        let total = Number(qualified) + Number(undesirable)
                        return (total * (temp.salary / 10 / 10)).toFixed(2)
                    } else {
                        return (Number(qualified) * (temp.salary / 10 / 10)).toFixed(2)
                    }
                } else {
                    if (!duration) return 0;
                    let h = (duration / 60 / 60).toFixed(2)
                    return (Number(h) * (temp.salary / 10 / 10)).toFixed(2)
                }
            },
            // è¾¾æ ‡çއ
            complianceRate() {
                if (this.arrType.length === 0) return 0;
                let {
                    index,
                    qualified,
                    undesirable,
                    duration
                } = this.from
                let temp = this.arrType[index]
                if (!qualified && !undesirable) return 0;
                if (!duration) return 0;
                if (!temp.num) return 0;
                if (temp.unqualified == 1) { // æ˜¯å¦è®¡å…¥ä¸è‰¯å“
                    let a = ((Number(qualified) + Number(undesirable)) / (duration / 3600)).toFixed(2)
                    let b = (temp.num / (temp.times / 3600)).toFixed(2)
                    return ((Number(a) / Number(b)) * 100).toFixed(2)
                } else {
                    let a = (qualified / (duration / 3600)).toFixed(2)
                    let b = (temp.num / (temp.times / 3600)).toFixed(2)
                    return ((Number(a) / Number(b)) * 100).toFixed(2)
                }
            }
        },
        onReady() {
            let timer = setInterval(() => {
                if (this.userInfo) {
                    this.from.userId = this.userInfo.id
                    this.from.userName = this.userInfo.realname
                    clearInterval(timer)
                }
            }, 500)
        },
        onLoad() {
            let arr = []
            for (let i = 0; i < 60; i++) {
                arr.push(i)
            }
            this.getData()
            this.columns = [arr, arr]
            // æŽ¥æ”¶è®¡åˆ’
            uni.$on('update', (data) => {
                this.from.processPlan = data.obj
                this.plansId = data.obj.id
                this.from.deviceId = ''
                this.from.deviceName = ''
                this.deviceId = ''
                this.total = data.obj.num - data.obj.workorderDistributNum
                this.wuList = []
                this.from.defective = []
                this.from.defectiveName = ''
                // this.from.userName = ''
                // this.from.userId = ''
                // èŽ·å–è®¾å¤‡
                getDeviceByCondition({
                        procedureId: data.obj.procedureId
                    })
                    .then(res1 => {
                        if (res1.code === 200) {
                            if (res1.data && res1.data.length > 0) {
                                this.deviceId = res1.data[0].id
                                this.from.deviceId = res1.data[0].id
                                this.from.deviceName = res1.data[0].name
                                this.deviceList = [res1.data]
                            }
                        }
                    })
                // èŽ·å–ç±»åž‹
                getIdPlansExt(data.obj.id)
                    .then(res2 => {
                        if (res2.code === 200) {
                            this.bomType = res2.data.bomType
                            this.hasBom = res2.data.hasBom
                        }
                    })
                // èŽ·å–å·¥èµ„ç»©æ•ˆæ•°æ®
                queryList({
                    deleted: 0,
                    departId: data.obj.factoryId,
                    materialId: data.obj.materialId,
                    procedureId: data.obj.procedureId
                }).then(result => {
                    if (result.code === 200) {
                        if (result.data && result.data.length > 0) {
                            result.data.forEach((item, index) => {
                                item.name = item.type == 0 ? '计件' : '计时'
                                item.id = item.type
                                item.active = index == 0
                            })
                            this.arrType = result.data
                            console.log(this.arrType)
                        } else {
                            this.arrType = []
                        }
                    }
                })
            })
        },
        methods: {
            poorSelection(val, i) {
                this.cateList.forEach((item, index) => {
                    if (i === index) {
                        item.active = !item.active
                    }
                })
            },
            // åˆ‡æ¢ç»©æ•ˆç±»åž‹
            clickPerformanceType(i) {
                this.from.index = i
                this.arrType.forEach((item, index) => {
                    if (i === index) {
                        this.from.type = item.id
                    }
                    item.active = index === i
                })
            },
            // é€‰æ‹©ç‰©æ–™
            getValue(val) {
                let obj = JSON.parse(JSON.stringify(val))
                obj.total = val.num
                this.wuList.unshift(obj)
                let arr = this.wuList.map(item => item.id)
                this.ids = arr
            },
            // èŽ·å–ä¸è‰¯é¡¹ç›®
            getData() {
                categoryExtList({
                    cateType: "3"
                }).then(res => {
                    if (res.code === 200) {
                        res.data.forEach(item => {
                            item.active = false
                            item.num = ''
                        })
                        this.cateList = res.data
                    }
                })
            },
            // é€‰æ‹©è®¾å¤‡
            onConfirm(e) {
                this.from.deviceId = e.value[0].id
                this.from.deviceName = e.value[0].name
                this.deviceId = e.value[0].id
                this.from.userId = ''
                this.from.userName = ''
                // getFindAll({
                //     deviceId: e.id,
                //     planId: from.processPlan.id
                // }).then(res => {
                //     if (res.code === 200) {
                //         res.data.forEach((item: any) => {
                //             item.name = item.umodel.name + '-' + item.tmodel.name
                //         })
                //         userList.value = res.data
                //     }
                // })
                this.deviceShow = false
            },
            // é€‰æ‹©ä¸è‰¯é¡¹
            onConfirm3() {
                let isOpen = false
                this.cateList.forEach((item, index) => {
                    if (item.active) {
                        isOpen = true
                    }
                })
                if (!isOpen) return uni.showToast({
                    title: '请选择不良项',
                    icon: 'none',
                    duration: 2000
                });
                let arr = []
                let total = 0
                let name = ''
                for (let i = 0; i < this.cateList.length; i++) {
                    if (this.cateList[i].active) {
                        if (Number(this.cateList[i].num) <= 0) {
                            return uni.showToast({
                                title: '不良数量必须大于0',
                                icon: 'none',
                                duration: 2000
                            });
                        }
                        total = total += Number(this.cateList[i].num)
                        arr.push(this.cateList[i])
                        name += this.cateList[i].name + this.cateList[i].num + ';'
                    }
                }
                if (total !== Number(this.from.undesirable)) return uni.showToast({
                    title: '不良数必须等于产出不良数',
                    icon: 'none',
                    duration: 2000
                });
                this.from.defective = arr
                this.from.defectiveName = name
                this.show = false
            },
            changeChecked(i) {
                this.cateList[i].active = !this.cateList[i].active
            },
            onConfirm2(e) {
                let h = e.value[0]
                let m = e.value[1]
                let s = 0
                if (h > 0) {
                    s += h * 60 * 60
                }
                if (m > 0) {
                    s += m * 60
                }
                this.from.duration = s
                this.from.durationName = `${h}小时${m}分钟`
                this.TimeShow = false
            },
            onConfirm1(e) {
                this.from.userId = e.userId
                this.from.userName = e.name
                this.userShow = false
            },
            selectPlan() {
                uni.navigateTo({
                    url: '/pages_adjust/pages/processPlan/processPlan'
                });
            },
            openDev() {
                if (!this.from.processPlan) return uni.showToast({
                    title: '请先选择工序生产计划',
                    icon: 'none',
                    duration: 2000
                });
                this.deviceShow = true
            },
            openMaterial() {
                if (!this.plansId) return uni.showToast({
                    title: '请先选择工序生产计划',
                    icon: 'none',
                    duration: 2000
                });
                if (!this.deviceId) return uni.showToast({
                    title: '请先选择生产设备',
                    icon: 'none',
                    duration: 2000
                });
                this.$refs.MaterialSelect.open()
            },
            inputwl(i) {
                if (this.wuList[i].num > this.wuList[i].total) {
                    this.wuList[i].num = ''
                    uni.showToast({
                        title: '投料数量不能大于库存数量',
                        icon: 'none',
                        duration: 2000
                    });
                }
            },
            deleItem(index) {
                if (this.wuList.length === 1) return uni.showToast({
                    title: '至少保留一项内容',
                    icon: 'none',
                    duration: 2000
                });
                this.wuList.splice(index, 1)
            },
            // äº§å‡ºæ•°é‡éªŒè¯
            changeNum(type) {
                let num = this.total - (Number(this.from.qualified) + Number(this.from.undesirable))
                if (type == 2) {
                    this.from.defective = []
                    this.from.defectiveName = ''
                }
                } else {
                    this.from.qualified = event
                }
                let num = this.total - (Number(this.from.qualified) + Number(this.from.undesirable))
                if (num < 0) {
                    uni.showToast({ title: '产出数量不能大于可产出数量!', icon: 'none', duration: 2000 });
                    if (type == 1) {
                        this.from.qualified = ''
                    } else {
                        this.from.undesirable = ''
                    }
                }
            },
            openBL() {
                this.cateList.forEach(item => {
                    if (!item.active) {
                        item.num = ''
                    }
                    if (item.active && item.num <= 0) {
                        item.active = false
                    }
                })
                this.show = true
            },
            // ç»§ç»­æŠ¥å·¥
            continueSubmit() {
                if (!this.from.processPlan) return uni.showToast({ title: '计划不能为空', icon: 'none', duration: 2000 });
                if (!this.from.deviceId) return uni.showToast({ title: '设备不能为空', icon: 'none', duration: 2000 });
                if (!this.from.userId) return uni.showToast({ title: '生产人员不能为空', icon: 'none', duration: 2000 });
                if (this.hasBom == 1 && this.bomType == 1) {
                    console.log('不需要投料')
                } else {
                    if (!this.wuList.length === 0) return uni.showToast({ title: '投料不能为空', icon: 'none', duration: 2000 });
                }
                if (!this.from.qualified && !this.from.undesirable) {
                    return uni.showToast({ title: '良品数与不良数不能同时为空', icon: 'none', duration: 2000 });
                }
                if (this.from.qualified && this.from.qualified <= 0) {
                    return uni.showToast({ title: '良品数必须大于0', icon: 'none', duration: 2000 });
                }
                if (this.from.undesirable && this.from.undesirable <= 0) {
                    return uni.showToast({ title: '不良品数必须大于0', icon: 'none', duration: 2000 });
                }
                // æœ‰ä¸è‰¯æ•°
                if (this.from.undesirable > 0) {
                    if (this.from.defective.length === 0) return uni.showToast({ title: '不良项不能为空', icon: 'none', duration: 2000 });
                }
                let type = ''
                this.arrType.forEach(item => {
                    if (item.active) {
                        type = item.id
                    }
                })
                autoWorkReport({
                    createWorkorderRecordDTO: {
                        type,
                        duration: this.from.duration,
                        qualifiedNum: this.from.qualified ? this.from.qualified : 0,
                        unQualifiedNum: this.from.undesirable ? this.from.undesirable : 0
                    },
                    plansId: this.from.processPlan.id,
                    proGroupId: this.deviceId,
                    proUserList: [this.from.userId],
                    recordList: this.wuList.map(item => {
                        return {
                            wstockId: item.id,
                            num: item.num
                        }
                    }),
                    createUnqualifiedDTOList: this.from.defective.map(item => {
                        return {
                            categoryId: item.id,
                            unQualifiedNum: item.num
                        }
                    })
                }).then(res => {
                    if (res.code === 200) {
                        uni.showToast({ title: '报工成功!', icon: 'success', duration: 2000 });
                        this.arrType = []
                        this.from.processPlan = null
                        this.from.deviceId = ''
                        this.from.deviceName = ''
                        this.from.userId = ''
                        this.from.userName = ''
                        this.from.qualified = ''
                        this.from.undesirable = ''
                        this.from.duration = ''
                        this.from.durationName = '0小时0分钟'
                        this.from.time = ''
                        this.from.defective = []
                        this.from.defectiveName = ''
                        this.wuList = []
                        this.deviceId = ''
                        this.plansId = ''
                        this.ids = ''
                        this.total = ''
                    }
                })
            },
            // æŠ¥å·¥
            submit() {
                if (!this.from.processPlan) return uni.showToast({ title: '计划不能为空', icon: 'none', duration: 2000 });
                if (!this.from.deviceId) return uni.showToast({ title: '设备不能为空', icon: 'none', duration: 2000 });
                if (!this.from.userId) return uni.showToast({ title: '生产人员不能为空', icon: 'none', duration: 2000 });
                if (this.hasBom == 1 && this.bomType == 1) {
                    console.log('不需要投料')
                } else {
                    if (!this.wuList.length === 0) return uni.showToast({ title: '投料不能为空', icon: 'none', duration: 2000 });
                }
                if (!this.from.qualified && !this.from.undesirable) {
                    return uni.showToast({ title: '良品数与不良数不能同时为空', icon: 'none', duration: 2000 });
                }
                // æœ‰ä¸è‰¯æ•°
                if (this.from.undesirable > 0) {
                    if (this.from.defective.length === 0) return uni.showToast({ title: '不良项不能为空', icon: 'none', duration: 2000 });
                }
                let type = ''
                this.arrType.forEach(item => {
                    if (item.active) {
                        type = item.id
                    }
                })
                autoWorkReport({
                    createWorkorderRecordDTO: {
                        type,
                        duration: this.from.duration,
                        qualifiedNum: this.from.qualified ? this.from.qualified : 0,
                        unQualifiedNum: this.from.undesirable ? this.from.undesirable : 0
                    },
                    plansId: this.from.processPlan.id,
                    proGroupId: this.deviceId,
                    proUserList: [this.from.userId],
                    recordList: this.wuList.map(item => {
                        return {
                            wstockId: item.id,
                            num: item.num
                        }
                    }),
                    createUnqualifiedDTOList: this.from.defective.map(item => {
                        return {
                            categoryId: item.id,
                            unQualifiedNum: item.num
                        }
                    })
                }).then(res => {
                    if (res.code === 200) {
                        uni.showToast({ title: '报工成功!', icon: 'success', duration: 2000 });
                        setTimeout(() => {
                            uni.navigateBack({ delta: 1 });
                        }, 2000);
                    }
                })
            }
        }
    }
</script>
<style lang="scss" scoped>
    .bg {
        width: 100%;
        position: absolute;
        background: #F7F7F7;
        .contanir {
            height: calc(env(safe-area-inset-bottom) + 720rpx);
            .content {
                margin-top: 20rpx;
                .type-style {
                    width: 325rpx;
                    margin-bottom: 20rpx;
                }
            }
        }
        .bg_plan {
            width: 100%;
            // height: 98rpx;
            padding: 30rpx;
            box-sizing: border-box;
            background: #FFFFFF;
            margin-bottom: 40rpx;
            display: flex;
            align-items: center;
            justify-content: space-between;
            text {
                font-size: 30rpx;
                font-family: PingFangSC-Regular, PingFang SC;
                font-weight: 400;
                color: #222222;
                text {
                    color: red;
                }
            }
            .bg_plan_nr {
                display: flex;
                flex-direction: column;
                text {
                    font-size: 24rpx;
                    font-family: PingFangSC-Regular, PingFang SC;
                    font-weight: 400;
                    color: #666666;
                    margin-top: 20rpx;
                    &:first-child {
                        font-size: 32rpx;
                        font-family: PingFangSC-Medium, PingFang SC;
                        font-weight: 500;
                        color: #333333;
                        margin-top: 0 !important;
                    }
                }
            }
            .bg_plan_label_val {
                display: flex;
                align-items: center;
                text {
                    font-size: 28rpx;
                    font-family: PingFangSC-Regular, PingFang SC;
                    font-weight: 400;
                    color: #999999;
                }
                image {
                    width: 12rpx;
                    height: 24rpx;
                    margin-left: 20rpx;
                }
            }
        }
        .bg_list {
            width: 100%;
            display: flex;
            flex-direction: column;
            .bottomval {
                margin-bottom: 20rpx !important;
            }
            .bg_list_item {
                display: flex;
                flex-direction: column;
                margin-bottom: 40rpx;
                .kong {
                    text-align: center;
                    padding: 30rpx 0;
                    background: #ffffff;
                    font-size: 25rpx;
                    text {
                        color: #474747;
                    }
                }
                .bg_list_item_top {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    padding-left: 30rpx;
                    padding-right: 30rpx;
                    margin-bottom: 30rpx;
                    .bg_list_item_top_left {
                        display: flex;
                        align-items: center;
                        .left {
                            margin-left: 12rpx;
                            font-size: 28rpx;
                        }
                        .warning {
                            width: 8rpx;
                            height: 30rpx;
                            border-radius: 2rpx;
                            margin-right: 12rpx;
                            background: $nav-stateColor5 !important;
                        }
                        .error {
                            width: 8rpx;
                            height: 30rpx;
                            border-radius: 2rpx;
                            margin-right: 12rpx;
                            background: $nav-stateColor4 !important;
                        }
                        .bg_list_item_top_left_x {
                            width: 8rpx;
                            height: 30rpx;
                            background: $nav-color;
                            border-radius: 2rpx;
                            margin-right: 12rpx;
                        }
                        text {
                            font-size: 32rpx;
                            font-weight: 500;
                            color: #222222;
                            display: flex;
                            align-items: center;
                        }
                    }
                    .bg_list_item_top_right {
                        display: flex;
                        align-items: center;
                        image {
                            width: 28rpx;
                            height: 28rpx;
                            margin-right: 12rpx;
                        }
                        text {
                            font-size: 28rpx;
                            font-weight: 400;
                            color: $nav-color;
                        }
                    }
                }
                .top {
                    margin-top: 20rpx !important;
                }
                .bg_list_item_h {
                    width: 100%;
                    padding: 0 30rpx;
                    box-sizing: border-box;
                    background: white;
                    .bg_list_item_num {
                        width: 100%;
                        min-height: 98rpx;
                        background: white;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        border-bottom: 1rpx solid #E5E5E5;
                        &:last-child {
                            border: none !important;
                        }
                        .kong {
                            text-align: center;
                            font-size: 25rpx;
                            padding: 30rpx 0;
                            background: #ffffff;
                        }
                        .bg_list_item_num_item {
                            width: 100%;
                            height: 100%;
                            display: flex;
                            align-items: center;
                            // height: 118rpx;
                            padding: 15rpx 0;
                            box-sizing: border-box;
                            justify-content: space-between;
                            border-bottom: 1rpx solid #E5E5E5;
                            &:last-child {
                                border: none;
                            }
                            .bg_list_item_num_item_list {
                                display: flex;
                                align-items: center;
                                .active {
                                    background: #305ED5 !important;
                                    color: #FFFFFF !important;
                                }
                                .bg_list_item_num_item_list_item {
                                    width: 116rpx;
                                    height: 62rpx;
                                    line-height: 62rpx;
                                    text-align: center;
                                    background: #F2F2F2;
                                    border-radius: 8rpx;
                                    font-size: 26rpx;
                                    font-family: PingFangSC-Regular, PingFang SC;
                                    font-weight: 400;
                                    color: #333333;
                                    margin-right: 20rpx;
                                    &:last-child {
                                        margin: 0 !important;
                                    }
                                }
                            }
                            .bg_list_item_num_item_wl {
                                flex: 1;
                                display: flex;
                                flex-direction: column;
                                text {
                                    font-size: 34rpx;
                                    color: #222222;
                                }
                                .bg_list_item_num_item_wl_lx {
                                    margin-top: 10rpx;
                                    text {
                                        color: #222222;
                                        font-size: 28rpx;
                                    }
                                }
                            }
                            .warning {
                                color: $nav-stateColor5 !important;
                            }
                            .err {
                                color: $nav-stateColor4 !important;
                            }
                            image {
                                width: 12rpx;
                                height: 24rpx;
                                margin-left: 20rpx;
                            }
                            text {
                                flex-shrink: 0;
                                overflow: hidden;
                                text-overflow: ellipsis;
                                white-space: nowrap;
                                text {
                                    font-size: 30rpx;
                                    color: red !important;
                                    margin-right: 5rpx;
                                }
                                .warning {
                                    color: $nav-stateColor5 !important;
                                    margin-right: 5rpx;
                                }
                                .err {
                                    color: $nav-stateColor4 !important;
                                    margin-right: 5rpx;
                                }
                                &:nth-child(1) {
                                    font-size: 30rpx;
                                    font-weight: 400;
                                    color: #222222;
                                }
                                &:nth-child(2) {
                                    font-size: 28rpx;
                                    font-weight: 400;
                                    color: #333333;
                                    flex-shrink: 0;
                                }
                            }
                            .bg_list_item_num_item_sr {
                                // flex: 1;
                                flex-shrink: 0;
                                width: 230rpx;
                                display: flex;
                                align-items: center;
                                justify-content: flex-end;
                                .color1 {
                                    font-size: 28rpx;
                                    font-family: PingFangSC-Regular, PingFang SC;
                                    font-weight: 400;
                                    color: #333333;
                                }
                                input::-webkit-input-placeholder {
                                    font-size: 28rpx;
                                }
                                input {
                                    text-align: right;
                                    width: 180rpx;
                                    height: 60rpx;
                                    border-radius: 8rpx;
                                    border: 1rpx solid #E5E5E5;
                                    margin-right: 20rpx;
                                    font-size: 28rpx;
                                    font-weight: 400;
                                    color: #333333;
                                    padding: 0 30rpx;
                                    margin-right: 20rpx;
                                }
                                .wulll {
                                    width: 400rpx;
                                    text-align: right;
                                    overflow: hidden;
                                    white-space: nowrap;
                                    text-overflow: ellipsis;
                                }
                                text {
                                    font-size: 28rpx;
                                    font-family: PingFangSC-Regular, PingFang SC;
                                    font-weight: 400;
                                    color: #999999;
                                }
                            }
                        }
                    }
                }
            }
        }
        .bh_zw {
            height: 160rpx;
        }
        .bg_footer {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            z-index: 9;
            padding: 0 30rpx 60rpx 30rpx;
            box-sizing: border-box;
            display: flex;
            align-items: center;
            justify-content: space-between;
            .bg_footer_submit1 {
                width: 334rpx;
                height: 88rpx;
                line-height: 88rpx;
                text-align: center;
                background: #FFFFFF;
                box-shadow: 0rpx 0rpx 12rpx 0rpx rgba(0,0,0,0.08);
                border-radius: 8rpx;
                font-size: 30rpx;
                font-family: PingFangSC-Medium, PingFang SC;
                font-weight: 500;
                color: #305ED5;
            }
            .bg_footer_submit {
                width: 334rpx;
                height: 88rpx;
                background: $nav-color;
                box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.08);
                border-radius: 8rpx;
                font-size: 30rpx;
                font-weight: 500;
                color: #FFFFFF;
                display: flex;
                align-items: center;
                justify-content: center;
            }
        }
        .bl {
            width: 100%;
            height: 800rpx;
            padding: 30rpx;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
            .bl_head {
                width: 100%;
                height: 50rpx;
                display: flex;
                align-items: center;
                justify-content: space-between;
                text {
                    font-size: 28rpx;
                    color: #222222;
                    &:nth-child(2) {
                        font-size: 32rpx !important;
                    }
                }
                image {
                    width: 28rpx;
                    height: 28rpx;
                }
            }
            .bl_footer {
                width: 100%;
                height: 88rpx;
                line-height: 88rpx;
                text-align: center;
                background: #305ED5;
                border-radius: 8rpx;
                font-size: 32rpx;
                font-family: PingFangSC-Medium, PingFang SC;
                font-weight: 500;
                color: #FFFFFF;
                margin-top: 30rpx;
            }
            .bl_list {
                width: 100%;
                height: calc(100% - 168rpx);
                overflow-y: scroll;
                margin-top: 30rpx;
                .bl_list_item {
                    width: 100%;
                    height: 96rpx;
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    border-bottom: 1rpx solid #E5E5E5;
                    &:last-child {
                        border: none !important;
                    }
                    .bl_list_item_left {
                        flex: 1;
                        display: flex;
                        align-items: center;
                        input {
                            width: 30rpx;
                            height: 30rpx;
                            border: 1rpx solid #CCCCCC;
                            margin: 0 !important;
                        }
                        text {
                            font-size: 30rpx;
                            color: #222222;
                            margin-left: 10rpx;
                        }
                    }
                    .bl_list_item_right {
                        width: 200rpx;
                        flex-shrink: 0;
                        height: 50rpx;
                        text-align: right;
                        input {
                            padding-left: 5rpx;
                            width: 160rpx;
                            height: 100%;
                            padding: 0 30rpx;
                            box-sizing: border-box;
                            text-align: right;
                            font-size: 28rpx;
                            color: #333333;
                            border-radius: 10rpx;
                            border: 1rpx solid #CCCCCC;
                            &::-webkit-input-placeholder {
                                font-size: 28rpx;
                                font-family: PingFangSC-Regular, PingFang SC;
                                font-weight: 400;
                                color: #999999;
                            }
                        }
                    }
                }
            }
        }
        .bl_list {
            width: 100%;
            height: calc(100% - 168rpx);
            overflow-y: scroll;
            margin-top: 30rpx;
            .bl_list_item {
                width: 100%;
                height: 96rpx;
                display: flex;
                align-items: center;
                justify-content: space-between;
                border-bottom: 1rPX solid #E5E5E5;
                &:last-child {
                    border: none !important;
                }
                .bl_list_item_left {
                    flex: 1;
                    display: flex;
                    align-items: center;
                    input {
                        width: 30rpx;
                        height: 30rpx;
                        border: 1rpX solid #CCCCCC;
                        margin: 0 !important;
                    }
                    span {
                        font-size: 30rpx;
                        color: #222222;
                        margin-left: 10rpx;
                    }
                }
                .bl_list_item_right {
                    width: 200rpx;
                    flex-shrink: 0;
                    height: 50rpx;
                    text-align: right;
                    input {
                        padding-left: 5rpx;
                        width: 180rpx;
                        height: 60rpx;
                        border-radius: 8rpx;
                        border: 1rpx solid #CCCCCC;
                        padding: 0 30rpx;
                        box-sizing: border-box;
                        text-align: right;
                        font-size: 28rpx;
                        color: #333333;
                        border-radius: 10rpx;
                        border: 1rPX solid #CCCCCC;
                        &::-webkit-input-placeholder {
                            font-size: 28rpx;
                            font-family: PingFangSC-Regular, PingFang SC;
                            font-weight: 400;
                            color: #999999;
                        }
                    }
                }
            }
        }
        .bottom-view {
            left: 40rpx;
            right: 40rpx;
            bottom: 20rpx
        }
    }
                    uni.$u.toast('产出数量不能大于可产出数量!')
                }
            },
            openBL() {
                this.cateList.forEach(item => {
                    if (!item.active) {
                        item.num = ''
                    }
                    if (item.active && item.num <= 0) {
                        item.active = false
                    }
                })
                this.show = true
            },
            // ç»§ç»­æŠ¥å·¥
            continueSubmit() {
                if (!this.from.processPlan) return uni.showToast({
                    title: '计划不能为空',
                    icon: 'none',
                    duration: 2000
                });
                if (!this.from.deviceId) return uni.showToast({
                    title: '设备不能为空',
                    icon: 'none',
                    duration: 2000
                });
                if (!this.from.userId) return uni.showToast({
                    title: '生产人员不能为空',
                    icon: 'none',
                    duration: 2000
                });
                if (this.hasBom == 1 && this.bomType == 1) {
                    console.log('不需要投料')
                } else {
                    if (!this.wuList.length === 0) return uni.showToast({
                        title: '投料不能为空',
                        icon: 'none',
                        duration: 2000
                    });
                }
                if (!this.from.qualified && !this.from.undesirable) {
                    return uni.showToast({
                        title: '良品数与不良数不能同时为空',
                        icon: 'none',
                        duration: 2000
                    });
                }
                if (this.from.qualified && this.from.qualified <= 0) {
                    return uni.showToast({
                        title: '良品数必须大于0',
                        icon: 'none',
                        duration: 2000
                    });
                }
                if (this.from.undesirable && this.from.undesirable <= 0) {
                    return uni.showToast({
                        title: '不良品数必须大于0',
                        icon: 'none',
                        duration: 2000
                    });
                }
                // æœ‰ä¸è‰¯æ•°
                if (this.from.undesirable > 0) {
                    if (this.from.defective.length === 0) return uni.showToast({
                        title: '不良项不能为空',
                        icon: 'none',
                        duration: 2000
                    });
                }
                let type = ''
                this.arrType.forEach(item => {
                    if (item.active) {
                        type = item.id
                    }
                })
                autoWorkReport({
                    createWorkorderRecordDTO: {
                        type,
                        duration: this.from.duration,
                        qualifiedNum: this.from.qualified ? this.from.qualified : 0,
                        unQualifiedNum: this.from.undesirable ? this.from.undesirable : 0
                    },
                    plansId: this.from.processPlan.id,
                    proGroupId: this.deviceId,
                    proUserList: [this.from.userId],
                    recordList: this.wuList.map(item => {
                        return {
                            wstockId: item.id,
                            num: item.num
                        }
                    }),
                    createUnqualifiedDTOList: this.from.defective.map(item => {
                        return {
                            categoryId: item.id,
                            unQualifiedNum: item.num
                        }
                    })
                }).then(res => {
                    if (res.code === 200) {
                        uni.showToast({
                            title: '报工成功!',
                            icon: 'success',
                            duration: 2000
                        });
                        this.arrType = []
                        this.from.processPlan = null
                        this.from.deviceId = ''
                        this.from.deviceName = ''
                        this.from.userId = ''
                        this.from.userName = ''
                        this.from.qualified = ''
                        this.from.undesirable = ''
                        this.from.duration = ''
                        this.from.durationName = '0小时0分钟'
                        this.from.time = ''
                        this.from.defective = []
                        this.from.defectiveName = ''
                        this.wuList = []
                        this.deviceId = ''
                        this.plansId = ''
                        this.ids = ''
                        this.total = 0
                    }
                })
            },
            // æŠ¥å·¥
            submit() {
                if (!this.from.processPlan) return uni.showToast({
                    title: '计划不能为空',
                    icon: 'none',
                    duration: 2000
                });
                if (!this.from.deviceId) return uni.showToast({
                    title: '设备不能为空',
                    icon: 'none',
                    duration: 2000
                });
                if (!this.from.userId) return uni.showToast({
                    title: '生产人员不能为空',
                    icon: 'none',
                    duration: 2000
                });
                if (this.hasBom == 1 && this.bomType == 1) {
                    console.log('不需要投料')
                } else {
                    if (!this.wuList.length === 0) return uni.showToast({
                        title: '投料不能为空',
                        icon: 'none',
                        duration: 2000
                    });
                }
                if (!this.from.qualified && !this.from.undesirable) {
                    return uni.showToast({
                        title: '良品数与不良数不能同时为空',
                        icon: 'none',
                        duration: 2000
                    });
                }
                // æœ‰ä¸è‰¯æ•°
                if (this.from.undesirable > 0) {
                    if (this.from.defective.length === 0) return uni.showToast({
                        title: '不良项不能为空',
                        icon: 'none',
                        duration: 2000
                    });
                }
                let type = ''
                this.arrType.forEach(item => {
                    if (item.active) {
                        type = item.id
                    }
                })
                autoWorkReport({
                    createWorkorderRecordDTO: {
                        type,
                        duration: this.from.duration,
                        qualifiedNum: this.from.qualified ? this.from.qualified : 0,
                        unQualifiedNum: this.from.undesirable ? this.from.undesirable : 0
                    },
                    plansId: this.from.processPlan.id,
                    proGroupId: this.deviceId,
                    proUserList: [this.from.userId],
                    recordList: this.wuList.map(item => {
                        return {
                            wstockId: item.id,
                            num: item.num
                        }
                    }),
                    createUnqualifiedDTOList: this.from.defective.map(item => {
                        return {
                            categoryId: item.id,
                            unQualifiedNum: item.num
                        }
                    })
                }).then(res => {
                    if (res.code === 200) {
                        uni.showToast({
                            title: '报工成功!',
                            icon: 'success',
                            duration: 2000
                        });
                        setTimeout(() => {
                            uni.navigateBack({
                                delta: 1
                            });
                        }, 2000);
                    }
                })
            }
        }
    }
</script>
<style lang="scss" scoped>
    .bg {
        width: 100%;
        position: absolute;
        background: #F7F7F7;
        .contanir {
            height: calc(env(safe-area-inset-bottom) + 720rpx);
            .content {
                margin-top: 20rpx;
                .type-style {
                    width: 325rpx;
                    margin-bottom: 20rpx;
                }
            }
        }
        .bg_plan {
            width: 100%;
            // height: 98rpx;
            padding: 30rpx;
            box-sizing: border-box;
            background: #FFFFFF;
            margin-bottom: 40rpx;
            display: flex;
            align-items: center;
            justify-content: space-between;
            text {
                font-size: 30rpx;
                font-family: PingFangSC-Regular, PingFang SC;
                font-weight: 400;
                color: #222222;
                text {
                    color: red;
                }
            }
            .bg_plan_nr {
                display: flex;
                flex-direction: column;
                text {
                    font-size: 24rpx;
                    font-family: PingFangSC-Regular, PingFang SC;
                    font-weight: 400;
                    color: #666666;
                    margin-top: 20rpx;
                    &:first-child {
                        font-size: 32rpx;
                        font-family: PingFangSC-Medium, PingFang SC;
                        font-weight: 500;
                        color: #333333;
                        margin-top: 0 !important;
                    }
                }
            }
            .bg_plan_label_val {
                display: flex;
                align-items: center;
                text {
                    font-size: 28rpx;
                    font-family: PingFangSC-Regular, PingFang SC;
                    font-weight: 400;
                    color: #999999;
                }
                image {
                    width: 12rpx;
                    height: 24rpx;
                    margin-left: 20rpx;
                }
            }
        }
        .bg_list {
            width: 100%;
            display: flex;
            flex-direction: column;
            .bottomval {
                margin-bottom: 20rpx !important;
            }
            .bg_list_item {
                display: flex;
                flex-direction: column;
                margin-bottom: 40rpx;
                .kong {
                    text-align: center;
                    padding: 30rpx 0;
                    background: #ffffff;
                    font-size: 25rpx;
                    text {
                        color: #474747;
                    }
                }
                .bg_list_item_top {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    padding-left: 30rpx;
                    padding-right: 30rpx;
                    margin-bottom: 30rpx;
                    .bg_list_item_top_left {
                        display: flex;
                        align-items: center;
                        .left {
                            margin-left: 12rpx;
                            font-size: 28rpx;
                        }
                        .warning {
                            width: 8rpx;
                            height: 30rpx;
                            border-radius: 2rpx;
                            margin-right: 12rpx;
                            background: $nav-stateColor5 !important;
                        }
                        .error {
                            width: 8rpx;
                            height: 30rpx;
                            border-radius: 2rpx;
                            margin-right: 12rpx;
                            background: $nav-stateColor4 !important;
                        }
                        .bg_list_item_top_left_x {
                            width: 8rpx;
                            height: 30rpx;
                            background: $nav-color;
                            border-radius: 2rpx;
                            margin-right: 12rpx;
                        }
                        text {
                            font-size: 32rpx;
                            font-weight: 500;
                            color: #222222;
                            display: flex;
                            align-items: center;
                        }
                    }
                    .bg_list_item_top_right {
                        display: flex;
                        align-items: center;
                        image {
                            width: 28rpx;
                            height: 28rpx;
                            margin-right: 12rpx;
                        }
                        text {
                            font-size: 28rpx;
                            font-weight: 400;
                            color: $nav-color;
                        }
                    }
                }
                .top {
                    margin-top: 20rpx !important;
                }
                .bg_list_item_h {
                    width: 100%;
                    padding: 0 30rpx;
                    box-sizing: border-box;
                    background: white;
                    .bg_list_item_num {
                        width: 100%;
                        min-height: 98rpx;
                        background: white;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        border-bottom: 1rpx solid #E5E5E5;
                        &:last-child {
                            border: none !important;
                        }
                        .kong {
                            text-align: center;
                            font-size: 25rpx;
                            padding: 30rpx 0;
                            background: #ffffff;
                        }
                        .bg_list_item_num_item {
                            width: 100%;
                            height: 100%;
                            display: flex;
                            align-items: center;
                            // height: 118rpx;
                            padding: 15rpx 0;
                            box-sizing: border-box;
                            justify-content: space-between;
                            border-bottom: 1rpx solid #E5E5E5;
                            &:last-child {
                                border: none;
                            }
                            .bg_list_item_num_item_list {
                                display: flex;
                                align-items: center;
                                .active {
                                    background: #305ED5 !important;
                                    color: #FFFFFF !important;
                                }
                                .bg_list_item_num_item_list_item {
                                    width: 116rpx;
                                    height: 62rpx;
                                    line-height: 62rpx;
                                    text-align: center;
                                    background: #F2F2F2;
                                    border-radius: 8rpx;
                                    font-size: 26rpx;
                                    font-family: PingFangSC-Regular, PingFang SC;
                                    font-weight: 400;
                                    color: #333333;
                                    margin-right: 20rpx;
                                    &:last-child {
                                        margin: 0 !important;
                                    }
                                }
                            }
                            .bg_list_item_num_item_wl {
                                flex: 1;
                                display: flex;
                                flex-direction: column;
                                text {
                                    font-size: 34rpx;
                                    color: #222222;
                                }
                                .bg_list_item_num_item_wl_lx {
                                    margin-top: 10rpx;
                                    text {
                                        color: #222222;
                                        font-size: 28rpx;
                                    }
                                }
                            }
                            .warning {
                                color: $nav-stateColor5 !important;
                            }
                            .err {
                                color: $nav-stateColor4 !important;
                            }
                            image {
                                width: 12rpx;
                                height: 24rpx;
                                margin-left: 20rpx;
                            }
                            text {
                                flex-shrink: 0;
                                overflow: hidden;
                                text-overflow: ellipsis;
                                white-space: nowrap;
                                text {
                                    font-size: 30rpx;
                                    color: red !important;
                                    margin-right: 5rpx;
                                }
                                .warning {
                                    color: $nav-stateColor5 !important;
                                    margin-right: 5rpx;
                                }
                                .err {
                                    color: $nav-stateColor4 !important;
                                    margin-right: 5rpx;
                                }
                                &:nth-child(1) {
                                    font-size: 30rpx;
                                    font-weight: 400;
                                    color: #222222;
                                }
                                &:nth-child(2) {
                                    font-size: 28rpx;
                                    font-weight: 400;
                                    color: #333333;
                                    flex-shrink: 0;
                                }
                            }
                            .bg_list_item_num_item_sr {
                                // flex: 1;
                                flex-shrink: 0;
                                width: 230rpx;
                                display: flex;
                                align-items: center;
                                justify-content: flex-end;
                                .color1 {
                                    font-size: 28rpx;
                                    font-family: PingFangSC-Regular, PingFang SC;
                                    font-weight: 400;
                                    color: #333333;
                                }
                                input::-webkit-input-placeholder {
                                    font-size: 28rpx;
                                }
                                input {
                                    text-align: right;
                                    width: 180rpx;
                                    height: 60rpx;
                                    border-radius: 8rpx;
                                    border: 1rpx solid #E5E5E5;
                                    margin-right: 20rpx;
                                    font-size: 28rpx;
                                    font-weight: 400;
                                    color: #333333;
                                    padding: 0 30rpx;
                                    margin-right: 20rpx;
                                }
                                .wulll {
                                    width: 400rpx;
                                    text-align: right;
                                    overflow: hidden;
                                    white-space: nowrap;
                                    text-overflow: ellipsis;
                                }
                                text {
                                    font-size: 28rpx;
                                    font-family: PingFangSC-Regular, PingFang SC;
                                    font-weight: 400;
                                    color: #999999;
                                }
                            }
                        }
                    }
                }
            }
        }
        .bh_zw {
            height: 160rpx;
        }
        .bg_footer {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            z-index: 9;
            padding: 0 30rpx 60rpx 30rpx;
            box-sizing: border-box;
            display: flex;
            align-items: center;
            justify-content: space-between;
            .bg_footer_submit1 {
                width: 334rpx;
                height: 88rpx;
                line-height: 88rpx;
                text-align: center;
                background: #FFFFFF;
                box-shadow: 0rpx 0rpx 12rpx 0rpx rgba(0, 0, 0, 0.08);
                border-radius: 8rpx;
                font-size: 30rpx;
                font-family: PingFangSC-Medium, PingFang SC;
                font-weight: 500;
                color: #305ED5;
            }
            .bg_footer_submit {
                width: 334rpx;
                height: 88rpx;
                background: $nav-color;
                box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.08);
                border-radius: 8rpx;
                font-size: 30rpx;
                font-weight: 500;
                color: #FFFFFF;
                display: flex;
                align-items: center;
                justify-content: center;
            }
        }
        .bl {
            width: 100%;
            height: 800rpx;
            padding: 30rpx;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
            .bl_head {
                width: 100%;
                height: 50rpx;
                display: flex;
                align-items: center;
                justify-content: space-between;
                text {
                    font-size: 28rpx;
                    color: #222222;
                    &:nth-child(2) {
                        font-size: 32rpx !important;
                    }
                }
                image {
                    width: 28rpx;
                    height: 28rpx;
                }
            }
            .bl_footer {
                width: 100%;
                height: 88rpx;
                line-height: 88rpx;
                text-align: center;
                background: #305ED5;
                border-radius: 8rpx;
                font-size: 32rpx;
                font-family: PingFangSC-Medium, PingFang SC;
                font-weight: 500;
                color: #FFFFFF;
                margin-top: 30rpx;
            }
            .bl_list {
                width: 100%;
                height: calc(100% - 168rpx);
                overflow-y: scroll;
                margin-top: 30rpx;
                .bl_list_item {
                    width: 100%;
                    height: 96rpx;
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    border-bottom: 1rpx solid #E5E5E5;
                    &:last-child {
                        border: none !important;
                    }
                    .bl_list_item_left {
                        flex: 1;
                        display: flex;
                        align-items: center;
                        input {
                            width: 30rpx;
                            height: 30rpx;
                            border: 1rpx solid #CCCCCC;
                            margin: 0 !important;
                        }
                        text {
                            font-size: 30rpx;
                            color: #222222;
                            margin-left: 10rpx;
                        }
                    }
                    .bl_list_item_right {
                        width: 200rpx;
                        flex-shrink: 0;
                        height: 50rpx;
                        text-align: right;
                        input {
                            padding-left: 5rpx;
                            width: 160rpx;
                            height: 100%;
                            padding: 0 30rpx;
                            box-sizing: border-box;
                            text-align: right;
                            font-size: 28rpx;
                            color: #333333;
                            border-radius: 10rpx;
                            border: 1rpx solid #CCCCCC;
                            &::-webkit-input-placeholder {
                                font-size: 28rpx;
                                font-family: PingFangSC-Regular, PingFang SC;
                                font-weight: 400;
                                color: #999999;
                            }
                        }
                    }
                }
            }
        }
        .bl_list {
            width: 100%;
            height: calc(100% - 168rpx);
            overflow-y: scroll;
            margin-top: 30rpx;
            .bl_list_item {
                width: 100%;
                height: 96rpx;
                display: flex;
                align-items: center;
                justify-content: space-between;
                border-bottom: 1rPX solid #E5E5E5;
                &:last-child {
                    border: none !important;
                }
                .bl_list_item_left {
                    flex: 1;
                    display: flex;
                    align-items: center;
                    input {
                        width: 30rpx;
                        height: 30rpx;
                        border: 1rpX solid #CCCCCC;
                        margin: 0 !important;
                    }
                    span {
                        font-size: 30rpx;
                        color: #222222;
                        margin-left: 10rpx;
                    }
                }
                .bl_list_item_right {
                    width: 200rpx;
                    flex-shrink: 0;
                    height: 50rpx;
                    text-align: right;
                    input {
                        padding-left: 5rpx;
                        width: 180rpx;
                        height: 60rpx;
                        border-radius: 8rpx;
                        border: 1rpx solid #CCCCCC;
                        padding: 0 30rpx;
                        box-sizing: border-box;
                        text-align: right;
                        font-size: 28rpx;
                        color: #333333;
                        border-radius: 10rpx;
                        border: 1rPX solid #CCCCCC;
                        &::-webkit-input-placeholder {
                            font-size: 28rpx;
                            font-family: PingFangSC-Regular, PingFang SC;
                            font-weight: 400;
                            color: #999999;
                        }
                    }
                }
            }
        }
        .bottom-view {
            left: 40rpx;
            right: 40rpx;
            bottom: 20rpx
        }
    }
</style>
minipro_standard/pages_adjust/pages/workOrder/workOrder.vue
@@ -21,70 +21,72 @@
            <div class="content_search_x"></div>
            <v-LableSelection :TagList="tagList" :isShow="true" @change="clickTag"></v-LableSelection>
        </div>
        <div class="content_total mt20">共{{page.total}}条数据</div>
        <scroll-view scroll-y="true" :style="{height:height}" refresher-enabled="true" :refresher-triggered="triggered" @scrolltolower="getLists"
            @refresherrefresh="onRefresh">
            <div class="content_list">
                <div class="content_list_item" v-for="(item, i) in list" :key="i" @click="jump(item)">
                    <div class="content_list_item_top">
                        <div class="content_list_item_top_left">
                            <span class="f32" v-if="item.mmodel">{{item.mmodel.name}} | {{item.procedureName}}</span>
                            <div class="content_list_item_top_left_tag" v-if="item.urgent">优先{{item.urgent}}</div>
                            <div class="content_list_item_top_left_tag backgreen" v-if="item.type === 0">正常</div>
                            <div class="content_list_item_top_left_tag backyellow" v-if="item.type === 2">返工返修</div>
                            <div class="content_list_item_top_left_tagW" v-if="item.paused === 1">停</div>
                        </div>
                        <div class="content_list_item_top_right">
                            <span class="yellow" v-if="item.status === 0">已创建</span>
                            <span class="green" v-if="item.status === 1">已备料</span>
                            <span v-if="item.status === 2">已完工检</span>
                            <span class="purple" v-if="item.status === 3">已检验</span>
                            <span v-if="item.status === 4">已报工</span>
                            <span v-if="item.status === 5">已入库</span>
                            <span v-if="item.status === 6">已取消</span>
                            <span class="green" v-if="item.status === 7">生产中</span>
                        </div>
                    </div>
                    <span class="f24">工单编号: {{item.code}}</span>
                    <div class="content_list_item_content">
                        <div class="content_list_item_content_item">
                            <div class="content_list_item_content_item_label">物料编码:</div>
                            <div class="content_list_item_content_item_nr" v-if="item.mmodel">{{item.mmodel.code}}</div>
                        </div>
                        <div class="content_list_item_content_item">
                            <div class="content_list_item_content_item_label">计划开工:</div>
                            <div class="content_list_item_content_item_nr">{{item.planDate}}</div>
                        </div>
                        <div class="content_list_item_content_item">
                            <div class="content_list_item_content_item_label">生产批次:</div>
                            <div class="content_list_item_content_item_nr">{{item.batch}}</div>
                        </div>
                        <div class="content_list_item_content_item">
                            <div class="content_list_item_content_item_label">计划数量:</div>
                            <div class="content_list_item_content_item_nr" v-if="item.umodel">
                                {{item.planNum}}{{item.umodel.name}}
                            </div>
                        </div>
                        <div class="content_list_item_content_item">
                            <div class="content_list_item_content_item_label">生产设备:</div>
                            <div class="content_list_item_content_item_nr" v-if="item.pgmodel">{{item.pgmodel.code}}
                            </div>
                        </div>
                        <div class="content_list_item_content_item" v-if="item.status === 5">
                            <div class="content_list_item_content_item_label">完工数量:</div>
                            <div class="content_list_item_content_item_nr">{{item.proNum}}</div>
                        </div>
                    </div>
                </div>
            </div>
        </scroll-view>
        <view class="fx1">
        <div class="content_total mt20">共{{page.total}}条数据</div>
        <div class="content_list">
            <scroll-view scroll-y="true" :style="{height:height}" refresher-enabled="true"
                :refresher-triggered="triggered" @scrolltolower="getLists" @refresherrefresh="onRefresh">
                <div class="content_list_item" v-for="(item, i) in list" :key="i" @click="jump(item)">
                    <div class="content_list_item_top">
                        <div class="content_list_item_top_left">
                            <span class="f32" v-if="item.mmodel">{{item.mmodel.name}} | {{item.procedureName}}</span>
                            <div class="content_list_item_top_left_tag" v-if="item.urgent">优先{{item.urgent}}</div>
                            <div class="content_list_item_top_left_tag backgreen" v-if="item.type === 0">正常</div>
                            <div class="content_list_item_top_left_tag backyellow" v-if="item.type === 2">返工返修</div>
                            <div class="content_list_item_top_left_tagW" v-if="item.paused === 1">停</div>
                        </div>
                        <div class="content_list_item_top_right">
                            <span class="yellow" v-if="item.status === 0">已创建</span>
                            <span class="green" v-if="item.status === 1">已备料</span>
                            <span v-if="item.status === 2">已完工检</span>
                            <span class="purple" v-if="item.status === 3">已检验</span>
                            <span v-if="item.status === 4">已报工</span>
                            <span v-if="item.status === 5">已入库</span>
                            <span v-if="item.status === 6">已取消</span>
                            <span class="green" v-if="item.status === 7">生产中</span>
                        </div>
                    </div>
                    <span class="f24">工单编号: {{item.code}}</span>
                    <div class="content_list_item_content">
                        <div class="content_list_item_content_item">
                            <div class="content_list_item_content_item_label">物料编码:</div>
                            <div class="content_list_item_content_item_nr" v-if="item.mmodel">{{item.mmodel.code}}</div>
                        </div>
                        <div class="content_list_item_content_item">
                            <div class="content_list_item_content_item_label">计划开工:</div>
                            <div class="content_list_item_content_item_nr">{{item.planDate}}</div>
                        </div>
                        <div class="content_list_item_content_item">
                            <div class="content_list_item_content_item_label">生产批次:</div>
                            <div class="content_list_item_content_item_nr">{{item.batch}}</div>
                        </div>
                        <div class="content_list_item_content_item">
                            <div class="content_list_item_content_item_label">计划数量:</div>
                            <div class="content_list_item_content_item_nr" v-if="item.umodel">
                                {{item.planNum}}{{item.umodel.name}}
                            </div>
                        </div>
                        <div class="content_list_item_content_item">
                            <div class="content_list_item_content_item_label">生产设备:</div>
                            <div class="content_list_item_content_item_nr" v-if="item.pgmodel">{{item.pgmodel.code}}
                            </div>
                        </div>
                        <div class="content_list_item_content_item" v-if="item.status === 5">
                            <div class="content_list_item_content_item_label">完工数量:</div>
                            <div class="content_list_item_content_item_nr">{{item.proNum}}</div>
                        </div>
                    </div>
                </div>
            </scroll-view>
        </div>
        <view class="fx1">
        </view>
        <!-- <u-calendar :show="isOpenDate" mode="range" @confirm="dateConfirm"></u-calendar> -->
        <l-calendar :lunar="false" v-model="isOpenDate" @change="dateConfirm" :isRange="true" activeBgColor="#305ED5"
        <!-- <u-calendar :show="isOpenDate" mode="range" @confirm="dateConfirm"></u-calendar> -->
        <l-calendar :lunar="false" v-model="isOpenDate" @change="dateConfirm" :isRange="true" activeBgColor="#305ED5"
            rangeColor="#305ED5" rangeBgColor="rgba(48, 80, 213, 0.1)"></l-calendar>
    </view>
</template>
@@ -95,8 +97,10 @@
    import {
        getList,
        pageCount
    } from '@/util/api/WorkOrderAPI.js'
    import { gsdate } from '@/util/utils.js'
    } from '@/util/api/WorkOrderAPI.js'
    import {
        gsdate
    } from '@/util/utils.js'
    export default {
        components: {
            vSearch,
@@ -120,7 +124,7 @@
                        name: '已完成',
                        num: '0'
                    }
                ],
                ],
                height: '',
                triggered: false,
                _freshing: false,
@@ -137,40 +141,40 @@
                },
                list: [],
            }
        },
        onReady() {
            var that = this
            this.$nextTick(() => {
                uni.createSelectorQuery()
                    .in(this)
                    .select('.content_search')
                    .boundingClientRect((rect) => {
                        console.log('-----',rect);
                        that.height = `calc(100vh - ${rect.height + 80}px)`
                        that.top = `${rect.height}px`
                    })
                    .exec()
            })
        },
        onReady() {
            var that = this
            this.$nextTick(() => {
                uni.createSelectorQuery()
                    .in(this)
                    .select('.content_search')
                    .boundingClientRect((rect) => {
                        console.log('-----', rect);
                        that.height = `calc(100vh - ${rect.height + 80}px)`
                        that.top = `${rect.height}px`
                    })
                    .exec()
            })
        },
        onLoad() {
            this.pageCounts()
            this.loadData()
        },
        methods: {
            reset() {
                this.searchForm = {
                    mixParam: '',
                    startDate: '',
                    // endDate: gsdate(new Date()),
                    endDate: '',
                    statusList: []
                }
                this.search()
            },
            searchInput(data) {
                this.searchForm.mixParam = data
                this.search()
        methods: {
            reset() {
                this.searchForm = {
                    mixParam: '',
                    startDate: '',
                    // endDate: gsdate(new Date()),
                    endDate: '',
                    statusList: []
                }
                this.search()
            },
            searchInput(data) {
                this.searchForm.mixParam = data
                this.search()
            },
            loadData() {
                getList({
@@ -202,7 +206,7 @@
                    endDate: this.searchForm.endDate || null,
                    statusList: this.searchForm.statusList.length === 0 ? this.tagList[0].id : this.searchForm
                        .statusList
                }).then(res => {
                }).then(res => {
                    if (res.code === 200) {
                        this.tagList[0].num = String(res.data.startNum)
                        this.tagList[1].num = String(res.data.ingNum)
@@ -215,7 +219,7 @@
                this.page.page = 1
                this.loadData()
            },
            dateConfirm(v) {
            dateConfirm(v) {
                console.log(v);
                this.isOpenDate = false
                this.searchForm.startDate = v.startDate
@@ -228,24 +232,24 @@
            onRefresh() {
                if (this.triggered) return
                this.triggered = true;
                this.search()
            },
            search() {
                this.page.page = 1
                this.loadData()
                this.pageCounts()
                this.search()
            },
            jump(item) {
                // uni.navigateTo({
                //     url: `/pages_adjust/pages/OrderDetail/OrderDetail?id=${item.id}`
            search() {
                this.page.page = 1
                this.loadData()
                this.pageCounts()
            },
            jump(item) {
                // uni.navigateTo({
                //     url: `/pages_adjust/pages/OrderDetail/OrderDetail?id=${item.id}`
                // })
                if (item.status === 4 || item.status === 6 || item.paused === 1) {
                    uni.navigateTo({
                        url: `/pages_adjust/pages/OrderDetail/OrderDetail?id=${item.id}`
                    uni.navigateTo({
                        url: `/pages_adjust/pages/OrderDetail/OrderDetail?id=${item.id}`
                    })
                } else {
                    uni.navigateTo({
                        url: `/pages_adjust/pages/workOrderReporting/workOrderReporting?id=${item.id}`
                } else {
                    uni.navigateTo({
                        url: `/pages_adjust/pages/workOrderReporting/workOrderReporting?id=${item.id}`
                    })
                }
            }
@@ -255,9 +259,10 @@
<style lang="scss" scoped>
    .content {
        display: flex;
        flex-direction: column;
        display: flex;
        flex-direction: column;
        height: 100vh;
        .content_search {
            background: white;
            z-index: 9;
@@ -372,7 +377,7 @@
                        width: 80%;
                        span {
                            font-size: 24rpx;
                            font-size: 32rpx;
                            font-weight: 500;
                            color: #333333;
                            overflow: hidden;
minipro_standard/pages_adjust/pages/workOrderReporting/workOrderReporting.vue
@@ -1,6 +1,6 @@
<template>
    <page-meta :page-style="(badShow||statistics) ?'overflow: hidden;': ''"/>
    <view>
    <view class="content">
        <view class="tips-label">当前任务需要质检;产出后,请耐心等待质检员检验,并根据检验结果调整产出数据后再报工。</view>
        <workOrderInfo :orederMessage="info" />
        <!-- <u-tabs :list="tab" lineColor="#305ED5" :activeStyle="{color:'#305ED5'}" lineWidth="50%" :itemStyle="{width: '50%', boxSizing: 'border-box', height: '88rpx'}" @click="click"></u-tabs> -->
@@ -22,7 +22,7 @@
                        <!-- <img src="@/assets/icon/gongdan_ic_shoudong@2x.png" alt="" /> -->
                        <!-- <img src="@/static/gongdan_ic_shoudong@2x.ong" alt="" /> -->
                        <image src="../../static/gongdan_ic_shoudong@2x.png" class="img28" mode=""></image>
                        <span class="cm">手动录入</span>
                        <span class="cm">手动投料</span>
                    </div>
                </div>
@@ -38,11 +38,11 @@
                                            <span> {{ item.materialName || '墙体砖' }}{{ item.procedureName ? `&nbsp;|&nbsp;${item.procedureName}` : ''
                                        }}</span>
                                            <div class="bg_list_item_num_item_wl_lx">
                                                <span class="green" v-if="item.qualityType == 0">合格&nbsp;/&nbsp;</span>
                                                <span class="orange" v-if="item.qualityType == 1">不良&nbsp;/&nbsp;</span>
                                                <span class="red" v-if="item.qualityType == 2">报废&nbsp;/&nbsp;</span>
                                                <span class="green" v-if="item.qualityType == 0">合格<text class="c6" decode>{{split}}</text></span>
                                                <span class="orange" v-if="item.qualityType == 1">不良<text class="c6" decode>{{split}}</text></span>
                                                <span class="red" v-if="item.qualityType == 2">报废<text class="c6" decode>{{split}}</text></span>
                                                <span>{{ item.locationName }}</span>
                                                <span>{{ item.batch ? `&nbsp;/&nbsp;${item.batch}` : '' }}</span>
                                                <span v-if="item.batch"><text class="c6" decode>{{split}}</text>{{ item.batch }}</span>
                                            </div>
                                        </div>
                                        <div class="bg_list_item_num_item_sr">
@@ -305,7 +305,8 @@
                    {
                        name: '点检'
                    }
                ],
                ],
                split: '&nbsp;/&nbsp;',
                form: {
                    time: '',
                    defective: [],
@@ -366,42 +367,45 @@
            })
        },
        computed: {
            expectedSalary() {
                if (this.arrType.length === 0) return 0;
            expectedSalary() {
                let { qualified, undesirable } = this.produceFrom
                if (this.arrType.length === 0) return 0;
                let temp = this.arrType[this.form.index]
                // æŒ‰ä»¶è®¡ç®—
                if (this.arrType[this.form.index].type == 0) {
                    if (!this.produceFrom.qualified) return 0
                    if (this.arrType[this.form.index].unqualified == 1) { // æ˜¯å¦è®¡å…¥ä¸è‰¯å“
                        let total = Number(this.produceFrom.qualified) + Number(this.produceFrom.undesirable)
                        return (total * (this.arrType[this.form.index].salary / 100)).toFixed(2) || 0
                if (temp.type == 0) {
                    if (!qualified) return 0
                    if (temp.unqualified == 1) { // æ˜¯å¦è®¡å…¥ä¸è‰¯å“
                        let total = Number(qualified) + Number(undesirable)
                        return (total * (temp.salary / 100)).toFixed(2) || 0
                    } else {
                        return (Number(this.produceFrom.qualified) * (this.arrType[this.form.index].salary / 100)).toFixed(
                        return (Number(qualified) * (temp.salary / 100)).toFixed(
                            2) || 0
                    }
                } else {
                    if (!this.form.duration) return 0;
                    let h = (this.form.duration / 60 / 60).toFixed(2)
                    return (Number(h) * (this.arrType[this.form.index].salary / 10 / 10)).toFixed(2) || 0
                    return (Number(h) * (temp.salary / 10 / 10)).toFixed(2) || 0
                }
            },
            complianceRate() {
                let { index, duration } = this.form
                let { qualified, undesirable } = this.produceFrom
                if (this.arrType.length === 0) return 0;
                if (!qualified && !undesirable) return 0;
                if (this.arrType.length === 0) return 0;
                let temp = this.arrType[index]
                if (!qualified && !undesirable) return 0;
                if (!duration) return 0;
                if (!this.arrType[index].num) return 0;
                if (!temp.num || !temp.times) return 0;
                // æŒ‰ä»¶è®¡ç®—
                // if (infoBox.value.type == 0) {
                if (this.arrType[index].unqualified == 1) { // æ˜¯å¦è®¡å…¥ä¸è‰¯å“
                    let a = ((Number(qualified) + Number(undesirable)) / (duration / 3600)).toFixed(2)
                    let b = (this.arrType[index].num / (this.arrType[index].times / 3600)).toFixed(2)
                if (temp.unqualified == 1) { // æ˜¯å¦è®¡å…¥ä¸è‰¯å“
                    let a = ((Number(qualified) + Number(undesirable)) / (Number(duration) / 3600)).toFixed(2)
                    let b = (temp.num / (temp.times / 3600)).toFixed(2)
                    return ((Number(a) / Number(b)) * 100).toFixed(2)
                    // let total = (Number(from.qualified) + Number(from.undesirable)) / ((from.duration * 60 * 60) * infoBox.value.num / )
                    // return total * infoBox.value.salary;
                } else {
                    let a = (qualified / (duration / 3600)).toFixed(2)
                    let b = (this.arrType[index].num / (this.arrType[index].times / 3600)).toFixed(2)
                    let a = (Number(qualified) / (Number(duration) / 3600)).toFixed(2)
                    let b = (temp.num / (temp.times / 3600)).toFixed(2)
                    return ((Number(a) / Number(b)) * 100).toFixed(2)
                    // return Number(from.qualified) * infoBox.value.salary;
                }
@@ -653,8 +657,6 @@
                        })
                        this.isSubmit = Number(this.produceFrom.qualified) + Number(this.produceFrom.undesirable) <= this
                            .info.planNum;
                        console.log(this.isSubmit);
                        debugger
                    }
                    
                } else {
@@ -779,36 +781,6 @@
                    }
                })
            },
            // => {
            //   // if (!from.duration || from.duration <= 0) {
            //   //     return Toast('报工时长不能为空')
            //   // }
            //   let createUnqualifiedDTOList = from.defective.map(item => {
            //     return {
            //       categoryId: item.id,
            //       unQualifiedNum: item.num
            //     }
            //   })
            //   let createWorkorderRecordDTO = {
            //     workorderId: route.query.id,
            //     duration: from.duration ? from.duration : 0,
            //     qualifiedNum: produceFrom.qualified ? produceFrom.qualified : 0,
            //     unQualifiedNum: produceFrom.undesirable ? produceFrom.undesirable : 0
            //   }
            //   // id: route.query.id
            //   comfirmDoneStandard({
            //     createUnqualifiedDTOList,
            //     createWorkorderRecordDTO
            //   }).then(res => {
            //     if (res.code === 200) {
            //       Toast.success({ message: '报工成功', forbidClick: true, duration: 2000 })
            //       setTimeout(() => {
            //         router.go(-2)
            //       }, 2000)
            //     }
            //   })
            // }
            jumpdj() {
                uni.navigateTo({
                    url: `/pages_adjust/pages/spotCheck/spotCheck?id=${this.workorderId}`
@@ -1068,7 +1040,7 @@
                    background: white;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    align-items: center;
                    border-bottom: 1rpx solid #E5E5E5;
                    .kong {
                        text-align: center;
@@ -1076,7 +1048,6 @@
                        padding: 30rpx 0;
                        background: #ffffff;
                    }
                    .bg_list_item_num_item {
                        width: 100%;
                        height: 100%;
@@ -1086,11 +1057,7 @@
                        padding: 15rpx 0;
                        box-sizing: border-box;
                        justify-content: space-between;
                        border-bottom: 1rpx solid #E5E5E5;
                        &:last-child {
                            border: none;
                        }
                        .bg_list_item_num_item_list {
                            display: flex;
@@ -1604,5 +1571,9 @@
            font-weight: 500;
            color: #FFFFFF;
        }
    }
    .content {
        height: 100vh;
        background-color: #f7f7f7;
    }
</style>
minipro_standard/pages_inspect/pages/InOperation/InOperation.vue
@@ -25,14 +25,11 @@
                                <span>{{item.outActnum}}{{item.unitName}}</span>
                            </div>
                            <div class="page_content_title_bottom">
                                <span class="green" v-if="item.qualityType === 0">合格&nbsp;<span
                                        class="black">/</span>&nbsp;</span>
                                <span class="warning" v-else-if="item.qualityType === 1">不良&nbsp;<span
                                        class="black">/</span>&nbsp;</span>
                                <span class="error" v-else-if="item.qualityType === 2">报废&nbsp;<span
                                        class="black">/</span>&nbsp;</span>
                                <span v-else>-&nbsp;/&nbsp;</span>
                                <span>{{item.procedureName ? item.procedureName : '-'}}&nbsp;/&nbsp;</span>
                                <span class="green" v-if="item.qualityType === 0">合格<text class="c6" decode>{{ split}}</text></span>
                                <span class="warning" v-else-if="item.qualityType === 1">不良<text class="c6" decode>{{ split}}</text></span>
                                <span class="error" v-else-if="item.qualityType === 2">报废<text class="c6" decode>{{ split}}</text></span>
                                <span v-else>-<text class="c6" decode>{{ split}}</text></span>
                                <span>{{item.procedureName ? item.procedureName : '-'}}<text class="c6" decode>{{ split}}</text></span>
                                <span>{{item.batch ? item.batch : '-'}}</span>
                            </div>
                        </div>
@@ -72,10 +69,10 @@
                            </div>
                        </div>
                        <div class="page_yxwl_list_item_sx">
                            <span class="green" v-if="item.qualityType === 0">合格&nbsp;<span>/</span>&nbsp;</span>
                            <span class="warning" v-else-if="item.qualityType === 1">不良&nbsp;<span>/</span>&nbsp;</span>
                            <span class="red" v-else-if="item.qualityType === 2">报废&nbsp;<span>/</span>&nbsp;</span>
                            <span>{{item.procedureName ? item.procedureName : '-'}}&nbsp;<span>/</span>&nbsp;</span>
                            <span class="green" v-if="item.qualityType === 0">合格<text class="c6" decode>{{ split}}</text></span>
                            <span class="warning" v-else-if="item.qualityType === 1">不良<text class="c6" decode>{{ split}}</text></span>
                            <span class="red" v-else-if="item.qualityType === 2">报废<text class="c6" decode>{{ split}}</text></span>
                            <span>{{item.procedureName ? item.procedureName : '-'}}<text class="c6" decode>{{ split}}</text></span>
                            <span>{{item.batch ? item.batch : '-'}}</span>
                        </div>
                        <div class="page_yxwl_list_item_num">
@@ -115,10 +112,10 @@
                            </div>
                        </div>
                        <div class="page_yxwl_list_item_sx">
                            <span class="green" v-if="item1.qualityType === 0">合格&nbsp;<span>/</span>&nbsp;</span>
                            <span class="yellow" v-else-if="item1.qualityType === 1">不良&nbsp;<span>/</span>&nbsp;</span>
                            <span class="red" v-else-if="item1.qualityType === 2">报废&nbsp;<span>/</span>&nbsp;</span>
                            <span>{{item1.procedureName ? item1.procedureName : '-'}}&nbsp;<span>/</span>&nbsp;</span>
                            <span class="green" v-if="item1.qualityType === 0">合格<text class="c6" decode>{{ split}}</text></span>
                            <span class="yellow" v-else-if="item1.qualityType === 1">不良<text class="c6" decode>{{ split}}</text></span>
                            <span class="red" v-else-if="item1.qualityType === 2">报废<text class="c6" decode>{{ split}}</text></span>
                            <span>{{item1.procedureName ? item1.procedureName : '-'}}<text class="c6" decode>{{ split}}</text></span>
                            <span>{{item1.batch ? item1.batch : '-'}}</span>
                        </div>
                        <div class="page_yxwl_list_item_num">
@@ -200,6 +197,7 @@
        },
        data() {
            return {
                split: '&nbsp;/&nbsp;',
                type: '',
                id: '',
                wareHouseId: '',
@@ -301,17 +299,42 @@
            },
            selectMaterial(val) {
                let material = JSON.parse(JSON.stringify(val))
                let tempMaterial = this.seleMateriaList.find(item => item.locationId == this.location)
                if (tempMaterial) {
                    if (tempMaterial.qualityType == material.qualityType && tempMaterial.procedureId == material
                        .procedureId &&
                        tempMaterial.batch == material.batch && tempMaterial.materialId == material.materialId) {
                        uni.$u.toast('相同货位,同一个物料只能有一个')
                        return
                let repetition = false
                this.seleMateriaList.forEach(item => {
                    if (item.locationId == this.location) {
                        if (item.id == material.id) {
                            repetition = true
                            return
                        }
                    }
                })
                if (repetition) {
                    uni.$u.toast('相同货位,同一个物料只能有一个')
                    return
                }
                // let tempMaterial = this.seleMateriaList.find(item => item.locationId == this.location)
                // debugger
                // if (tempMaterial) {
                //     /*
                //     tempMaterial.qualityType == material.qualityType
                //         && tempMaterial.procedureId == material.procedureId
                //         &&tempMaterial.batch == material.batch
                //         &&tempMaterial.oldLocationId == material.locationId
                //         && tempMaterial.materialId == material.materialId
                //     */
                //     if (tempMaterial.id == material.id) {
                //         uni.$u.toast('相同货位,同一个物料只能有一个')
                //         return
                //     }
                // }
                // if (tempMaterial && tempMaterial.id == material.id) {
                //     uni.$u.toast('相同货位,同一个物料只能有一个')
                //     return
                // }
                let materialNum = 0
                let num = 0
                // let selectedM = this.seleMateriaList.find(item => item.id == material.id)
                // let waitMaterial = this.MateriaList.find(item => item.id === material.id)
                this.seleMateriaList.forEach(item => {
                    if (item.id === material.id) {
                        materialNum += Number(item.outActnum)
@@ -322,9 +345,11 @@
                        num = item.outActnum - materialNum
                    }
                })
                material.outActnum = num
                this.seleMateriaList.push({
                    ...material,
                    oldLocationId: material.locationId,
                    locationId: this.location,
                    locationName: this.locationName
                })
minipro_standard/pages_inspect/pages/OutOperation/OutOperation.vue
@@ -1,4 +1,5 @@
<template>
<template>
    <page-meta :page-style="ban ?'overflow: hidden;': ''"/>
    <view>
        <InOutInfo :info="info" />
        <uni-collapse @change="change" @close="close" @open="open">
@@ -23,14 +24,11 @@
                                <span>待出<span>{{ item.outPlannum }}</span> {{ item.unitName }}</span>
                            </div>
                            <div class="page_content_title_bottom">
                                <span class="green" v-if="item.qualityType === 0">合格&nbsp;<span
                                        class="black">/</span>&nbsp;</span>
                                <span class="warning" v-else-if="item.qualityType === 1">不良&nbsp;<span
                                        class="black">/</span>&nbsp;</span>
                                <span class="error" v-else-if="item.qualityType === 2">报废&nbsp;<span
                                        class="black">/</span>&nbsp;</span>
                                <span v-else>-&nbsp;/&nbsp;</span>
                                <span>{{item.procedureName ? item.procedureName : '-'}}&nbsp;/&nbsp;</span>
                                <span class="green" v-if="item.qualityType === 0">合格<text class="c6" decode>{{ split}}</text></span>
                                <span class="warning" v-else-if="item.qualityType === 1">不良<text class="c6" decode>{{ split}}</text></span>
                                <span class="error" v-else-if="item.qualityType === 2">报废<text class="c6" decode>{{ split}}</text></span>
                                <span v-else>-<text class="c6" decode>{{ split}}</text></span>
                                <span>{{item.procedureName || '-'}}<text class="c6" decode>{{ split}}</text></span>
                                <span>{{item.batch ? item.batch : '-'}}</span>
                            </div>
                        </div>
@@ -80,7 +78,7 @@
                        </div>
                        <div class="page_content_list" v-for="(items, ind) in item.wstockExtListVOList" :key="ind">
                            <div class="page_content_list_item">
                                <div class="page_content_list_item_label">批次号1:</div>
                                <div class="page_content_list_item_label">批次号:</div>
                                <div class="page_content_list_item_nr">{{ items.batch ? items.batch : '-' }}</div>
                            </div>
                            <div class="page_content_list_items">
@@ -118,7 +116,7 @@
                    </div>
                    <div class="page_yxwl_list_item_sx">
                        <span class="green" v-if="item.qualityType == 0">合格t<text class="c6" decode>{{ split}}</text></span>
                        <span class="green" v-if="item.qualityType == 0">合格<text class="c6" decode>{{ split}}</text></span>
                        <span class="yellow" v-else-if="item.qualityType == 1">不良<text class="c6" decode>{{ split}}</text></span>
                        <span class="red" v-else-if="item.qualityType == 2">报废<text class="c6" decode>{{ split}}</text></span>
                        <span v-else>-<text class="c6" decode>{{ split}}</text></span>
@@ -156,7 +154,7 @@
                <span>确认出库</span>
            </div>
        </div>
        <SelectTraMultipleMaterial ref="selectTraMultipleMaterial" @selectes="selectMaterail" />
        <SelectTraMultipleMaterial ref="selectTraMultipleMaterial" @close="ban = false" @selectes="selectMaterail" />
    </view>
</template>
@@ -182,8 +180,10 @@
            InOutInfo,
            SelectTraMultipleMaterial
        },
        data() {
            return {
        data() {
            return {
                ban: false,
                type: '',
                id: '',
                dbid: '',
@@ -261,13 +261,15 @@
            change() {},
            close() {},
            open() {},
            openxz() {
            openxz() {
                this.ban = true
                this.$refs.selectTraMultipleMaterial.open({
                    transferId: this.id,
                    warehouseId: this.warehouseId
                })
            },
            selectMaterail(v) {
            selectMaterail(v) {
                this.ban = false
                let tempList = this.warehouseList[0].wtransferDetailList
                let materials = JSON.parse(JSON.stringify(v.materials))
                tempList.forEach(item => {
@@ -279,29 +281,44 @@
                        }
                    })
                    if (!isOutList) {
                        materials.forEach((materail, index) => {
                            if (item.batch) {
                                // ç²¾ç¡®åŒ¹é…
                                if (materail.materialId == item.materialId &&
                                        materail.procedureId == item.procedureId &&
                                        materail.qualityType == item.qualityType &&
                                        materail.batch == item.batch
                        item.wstockExtListVOList.forEach(hw => {
                            materials.forEach((materail, index) => {
                                if (hw.materialId == materail.materialId &&
                                        hw.procedureId == materail.procedureId &&
                                        hw.qualityType == materail.qualityType &&
                                        hw.locationId == materail.locationId &&
                                        hw.batch == materail.batch
                                    ) {
                                        this.addToOutList(materail, item)
                                        materials.splice(index, 1)
                                        return
                                }
                            } else {
                                if (materail.materialId == item.materialId &&
                                        materail.procedureId == item.procedureId &&
                                        materail.qualityType == item.qualityType
                                    ) {
                                    this.addToOutList(materail, item)
                                    materials.splice(index, 1)
                                    return
                                }
                            }
                            })
                        })
                            // if (item.batch) {
                            //     // ç²¾ç¡®åŒ¹é…
                            //     if (materail.materialId == item.materialId &&
                            //             materail.procedureId == item.procedureId &&
                            //             materail.qualityType == item.qualityType &&
                            //             materail.batch == item.batch
                            //         ) {
                            //             this.addToOutList(materail, item)
                            //             materials.splice(index, 1)
                            //             return
                            //     }
                            // } else {
                            //     if (materail.materialId == item.materialId &&
                            //             materail.procedureId == item.procedureId &&
                            //             materail.qualityType == item.qualityType
                            //         ) {
                            //         this.addToOutList(materail, item)
                            //         materials.splice(index, 1)
                            //         return
                            //     }
                            // }
                    } 
                })
            },
minipro_standard/store/index.js
@@ -81,7 +81,7 @@
            let res = await getTreeList({
                type: type
            })
            if (res.code === 200) {
            if (res && res.code === 200) {
                content.commit('SETMENU', res.data)
            }
        },
@@ -104,8 +104,9 @@
            
        },
        async getUpcomingNum(context) {
            let res = await pageCount({})
            if (res.code === 200) {
            let res = await pageCount({})
            if (res && res.code === 200) {
                context.commit('SETNUM', {
                    d: res.data.startNum,
                    y: res.data.endNum
@@ -115,7 +116,7 @@
        // å‘后端获取个人信息
        async getUserInfos(content) {
            let res = await getUserInfo()
            if (res.code === 200) {
            if (res && res.code === 200) {
                content.commit('SETUSERINFO', res.data)
                return true;
            }
minipro_standard/util/request/responseInterceptors.js
@@ -6,15 +6,15 @@
    uni.$u.http.interceptors.response.use((response) => {
        uni.hideLoading();
        const data = response.data
        if (response.data.code === 401) {     // å¤„理登录过期
        if (data.code === 401) {     // å¤„理登录过期
            uni.showToast({ title: '登录过期,准备自动重新登录', icon: 'none', duration: 2000, mask: true });
            setTimeout(() => {
                uni.reLaunch({ url: '/pages/login/login' });
            }, 2000)
            return
        }
        if (response.data.code !== 200) {     // è¯·æ±‚报错
            uni.showToast({ title: response.data.message, icon: 'none', duration: 2000 });
        if (data.code !== 200) {     // è¯·æ±‚报错
            uni.showToast({ title: data.message, icon: 'none', duration: 2000 });
        }
        return data || {}
    }, (error) => {
screen_standard/.env.development
@@ -6,11 +6,9 @@
#VITE_BASE_URL='http://192.168.0.35:10021'
# VITE_BASE_PATH='/doumeeplant_api'
<<<<<<< HEAD
# VITE_BASE_URL='https://dmtest.ahapp.net/doumeeplant_api/'
VITE_BASE_URL = 'https://www.mes.red/doumeeplant'
=======
VITE_BASE_URL='https://dmtest.ahapp.net/doumeeplant_api'
# VITE_BASE_URL = 'https://www.mes.red/doumeeplant'
>>>>>>> 7550fb636fec7a84dbdea55196d97ed635d7ab10
VITE_BASE_URL='https://dmtest.ahapp.net/doumeeplant_api'
VITE_BASE_URL = 'https://www.mes.red/doumeeplant'
screen_standard/src/stores/counter.js
@@ -1,4 +1,3 @@
import { computed } from 'vue';
import { defineStore } from 'pinia';
export const useCounterStore = defineStore('enterprise', {
screen_standard/src/views/index.vue
@@ -714,14 +714,17 @@
    scrollDom = scrollContainer1.value
  } else {
    // å¦‚果列表数量过少不进行滚动
    if (scrollDom.children.length < 6) {
    if (scrollDom.children.length <= 6) {
      clearTimeout(timer1.value)
      return
    }
    // console.log(data.plannedProgress);
    // ç»„件进行滚动
    scrollDom.scrollTop += 2
    // scrollDom.scrollTo(0, scrollDom.scrollTop + 3)
    // console.log('2-----',scrollDom.scrollTop, scrollDom.scrollHeight, scrollDom.clientHeight );
    // åˆ¤æ–­æ˜¯å¦æ»šåŠ¨åˆ°åº•éƒ¨
    if (scrollDom.scrollTop+2 >= (scrollDom.scrollHeight - scrollDom.clientHeight)) {
    if (scrollDom.scrollTop && scrollDom.scrollTop >= (scrollDom.scrollHeight - scrollDom.clientHeight)) {
      // èŽ·å–ç»„ä»¶ç¬¬ä¸€ä¸ªèŠ‚ç‚¹
      let first = scrollDom.children[0]
      // åˆ é™¤èŠ‚ç‚¹
@@ -739,16 +742,17 @@
    scrollDom = scrollContainer2.value
  } else {
    // å¦‚果列表数量过少不进行滚动
    if (scrollDom.children.length < 10) {
    if (scrollDom.children.length <= 10) {
      clearTimeout(timer2.value)
      return
    }
    // ç»„件进行滚动
    scrollDom.scrollTop += 1
    scrollDom.scrollTo(0, scrollDom.scrollTop + 1) // += 1
    // scrollDom.scrollTop(scrollDom.scrollTop + 1)
    // console.log('scrollDom.scrollTop', scrollDom.scrollTop);
    // console.log('scrollDom.scrollHeight - scrollDom.clientHeight', scrollDom.scrollHeight - scrollDom.clientHeight);
    // åˆ¤æ–­æ˜¯å¦æ»šåŠ¨åˆ°åº•éƒ¨
    if (scrollDom.scrollTop >= (scrollDom.scrollHeight - scrollDom.clientHeight)) {
    if (scrollDom.scrollTop &&scrollDom.scrollTop >= (scrollDom.scrollHeight - scrollDom.clientHeight)) {
      // èŽ·å–ç»„ä»¶ç¬¬ä¸€ä¸ªèŠ‚ç‚¹
      let first = scrollDom.children[0]
      // åˆ é™¤èŠ‚ç‚¹
@@ -776,7 +780,7 @@
    // ç»„件进行滚动
    scrollDom.scrollTop = scrollDom.scrollTop+2
    // åˆ¤æ–­æ˜¯å¦æ»šåŠ¨åˆ°åº•éƒ¨
    if (scrollDom.scrollTop >= (scrollDom.scrollHeight - scrollDom.clientHeight)) {
    if (scrollDom.scrollTop && scrollDom.scrollTop >= (scrollDom.scrollHeight - scrollDom.clientHeight)) {
      // èŽ·å–ç»„ä»¶ç¬¬ä¸€ä¸ªèŠ‚ç‚¹
      let first = scrollDom.children[0]
      // åˆ é™¤èŠ‚ç‚¹
@@ -790,18 +794,12 @@
  let scrollDom = scrollContainer4.value
  if (!scrollDom) return
  // åˆ¤è¯»ç»„件是否渲染完成
  if (scrollDom.offsetHeight == 0) {
  if (scrollDom.scrollTop && scrollDom.offsetHeight == 0) {
    scrollDom = scrollContainer4.value
  } else {
    // console.log(scrollDom.offsetHeight);
    let num = scrollDom.offsetHeight / 35;
    num = num + (scrollDom.offsetHeight % 35  > 0 ? 1 : 0)
    // console.log('----------');
    // console.log('scrollDom.children.length', scrollDom.children.length)
    // console.log('scrollDom.offsetHeight % 35', scrollDom.offsetHeight % 35)
    // console.log('num', num)
    // console.log('----------');
    // // å¦‚果列表数量过少不进行滚动
    if (scrollDom.children.length <= num) {
      clearTimeout(timer4.value)
      return
@@ -810,10 +808,7 @@
    scrollDom.scrollTop += 1
    
    // åˆ¤æ–­æ˜¯å¦æ»šåŠ¨åˆ°åº•éƒ¨
    if (scrollDom.scrollTop >= (scrollDom.scrollHeight - scrollDom.clientHeight)) {
      console.log('scrollDom.scrollTop', scrollDom.scrollTop);
      console.log('scrollDom.scrollHeight', scrollDom.scrollHeight);
      console.log('scrollDom.clientHeight', scrollDom.clientHeight );
    if (scrollDom.scrollTop && scrollDom.scrollTop >= (scrollDom.scrollHeight - scrollDom.clientHeight)) {
    // if (scrollDom.scrollTop >= 35) {
      
      // èŽ·å–ç»„ä»¶ç¬¬ä¸€ä¸ªèŠ‚ç‚¹
@@ -835,7 +830,7 @@
    console.log('onMounted');
    init()
    timer5.value = setInterval(init, 60000)
    timer.value = setInterval(scrillAction, 100)
    // timer.value = setInterval(scrillAction, 100)
  }
  window.addEventListener('resize', () => {
    setTypeChart()
screen_standard/src/views/process.vue
@@ -251,8 +251,12 @@
      data.planScroll = false
      return
    }
    // scrollTop指的是“元素中的内容”超出“元素上边界”的那部分的高度
    // scrollHeight指整个元素的高度,与元素本身有关,是元素本身的高度与你所设置的style属性相加的结果,但与overflow:hidden等属性无关,与是否在可视范围内无关
    // clientHeight含义:元素的像素高度,包含元素的高度+内边距,不包含水平滚动条,边框和外边距
    // ç»„件进行滚动
    scrollDom.scrollTop += 2 
    console.log(scrollDom.scrollTop);
    // åˆ¤æ–­æ˜¯å¦æ»šåŠ¨åˆ°åº•éƒ¨
    if (scrollDom.scrollTop >= (scrollDom.scrollHeight - scrollDom.clientHeight - 2)) {
      // èŽ·å–ç»„ä»¶ç¬¬ä¸€ä¸ªèŠ‚ç‚¹
@@ -276,14 +280,15 @@
    scrollDom = reportLogContainer.value
  } else {
    // å¦‚果列表数量过少不进行滚动
    if (scrollDom.children.length < 10) {
    if (scrollDom.children.length <= 10) {
      data.reportScroll = false
      return
    }
    // ç»„件进行滚动
    scrollDom.scrollTop += 2
    scrollDom.scrollTop += 1
    console.log(scrollDom.scrollTop);
    // åˆ¤æ–­æ˜¯å¦æ»šåŠ¨åˆ°åº•éƒ¨
    if (scrollDom.scrollTop >= (scrollDom.scrollHeight - scrollDom.clientHeight - 2)) {
    if (scrollDom.scrollTop && scrollDom.scrollTop >= (scrollDom.scrollHeight - scrollDom.clientHeight)) {
      // èŽ·å–ç»„ä»¶ç¬¬ä¸€ä¸ªèŠ‚ç‚¹
      let first = scrollDom.children[0]
      // åˆ é™¤èŠ‚ç‚¹
@@ -412,7 +417,6 @@
 */
function setTypeChart() {
  let dayChartDom = document.getElementById('type-distribution');
  console.log(dayChartDom);
  let myChart = echarts.init(dayChartDom);
  let legendData = []
  let seriesData = []
web_standard/.env.development
@@ -24,5 +24,5 @@
# VUE_APP_BASE_URL = 'http://192.168.0.35:10021/'
# æµ‹è¯•服务器
VUE_APP_BASE_URL = 'https://dmtest.ahapp.net/doumeeplant_api/'
# VUE_APP_BASE_URL = 'https://dmtest.ahapp.net/doumeeplant_api/'
web_standard/src/components/ext/OperaWrollOutStore.vue
@@ -617,6 +617,7 @@
            stockNum: item.num,
            unitName: item.unitName,
            locationName: item.locationName,
            locationId: item.locationId,
            procedureName: item.procedureName,
            id: item.id,
            // éœ€ä¼ å‚æ•°
@@ -631,7 +632,7 @@
          })
        }
      }
      // console.log('确定', this.form.woutBoundDetailBeans)
      // console.log('确定', this.form.wtransferDetailBeanList)
      this.isSelectMaterial = false
      this.pagination.pageIndex = 1
    },
web_standard/yarn.lock
ÎļþÌ«´ó