llj
2025-11-21 0bb1b148858dc68b1c498bfe36bc20c06f228497
出厂校验单
3个文件已修改
1个文件已添加
2345 ■■■■■ 已修改文件
components/ZLGL/InspectValueTemplate.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/JIAOYAN/chuchangjiaoyandan/QC_OutCompCheckBill.vue 2328 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/index/tab2.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/ZLGL/InspectValueTemplate.vue
@@ -265,6 +265,10 @@
                            setUrl: '/QC_LastPieceCheckBill/set_SaveValue',
                            getUrl: '/QC_LastPieceCheckBill_ValueTable/getValueList'
                        }
                        case 4:return{
                            setUrl: '/QC_OutCompCheckBill/set_SaveValue',
                            getUrl: '/QC_OutCompCheckBill_ValueTable/getValueList'
                        }
                    }
                } 
            }
pages.json
@@ -1267,6 +1267,12 @@
            "style": {
                "navigationBarTitleText": "生产入库校验"
            }
        },
        {
            "path": "pages/JIAOYAN/chuchangjiaoyandan/QC_OutCompCheckBill",
            "style": {
                "navigationBarTitleText": "出厂校验"
            }
        }
        
    ],
pages/JIAOYAN/chuchangjiaoyandan/QC_OutCompCheckBill.vue
New file
@@ -0,0 +1,2328 @@
<template>
    <view>
        <!-- 主表区域 -->
        <view class="bill-main-area">
            <!-- 主表页签 -->
            <view class="bill-main-tabs">
                <view :class="mainTabSelected == 1 ? 'selected' : ''" @tap="mainTabSelected = 1">基本信息</view>
                <view :class="mainTabSelected == 2 ? 'selected' : ''" @tap="mainTabSelected = 2">其他信息</view>
                <view :class="mainTabSelected == 3 ? 'selected' : ''" @tap="mainTabSelected = 3">制单信息</view>
            </view>
            <!-- 主表内容 -->
            <view class="bill-main-contents">
                <!-- 基本信息 -->
                <view class="bill-main-content" v-if="mainTabSelected == 1">
                    <view class="form-item">
                        <view class="left">单据号</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HBillNo" disabled />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">日期</view>
                        <view class="right">
                            <uni-datetime-picker type="date" :clear-icon="false" v-model="hform.HDate">
                                <view>{{ hform.HDate }}</view>
                            </uni-datetime-picker>
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">源单单号</view>
                        <view class="right" :class="!hasSourceBill?'':'disabled'">
                            <input type="text" :disabled="hasSourceBill" placeholder="请输入或扫描源单号"
                                v-model="hform.HSourceBillNo" @confirm="getSourceBillInfo(hform.HSourceBillNo)" />
                        </view>
                        <view class="icon-wrapper-big">
                            <uni-icons class="right-icon" type="scan" style="
                  background-color: #3a78ff;
                  padding: 6rpx;
                  color: #fff;
                  border-radius: 100%;
                " size="20" @click="toScanCode"></uni-icons>
                        </view>
                    </view>
                    <view class="form-item" v-if="false">
                        <view class="left">生产资源</view>
                        <view class="right">
                            <uni-combox :candidates="GySourceNameList" placeholder="请选择生产资源" v-model="hform.HSourceName"
                                @update:modelValue="HSourceChange"></uni-combox>
                        </view>
                    </view>
                    <view class="form-item" v-if="false">
                        <view class="left">生产班次</view>
                        <view class="right">
                            <uni-combox :candidates="GyWorkShiftNameList" placeholder="请选择生产班次"
                                v-model="hform.HShiftsName" @update:modelValue="HWorkShiftChange"></uni-combox>
                        </view>
                    </view>
                    <view class="form-item" v-if="false">
                        <view class="left">任务单号</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HICMOBillNo" disabled />
                        </view>
                        <view class="icon-wrapper-big"><uni-icons type="search" size="20"
                                @click="showSelectorModule(hform, 5)"></uni-icons></view>
                    </view>
                    <view class="form-item" v-if="false">
                        <view class="left">流转卡号</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HProcExchBillNo" disabled />
                        </view>
                        <view class="icon-wrapper-big"><uni-icons type="search" size="20"
                                @click="showSelectorModule(hform, 6)"></uni-icons></view>
                    </view>
                    <view class="form-item">
                        <view class="left">产品代码</view>
                        <view class="right disabled">
                            <input type="text" disabled :value="hform.HMaterNumber" />
                        </view>
                        <view class="icon-wrapper-big">
                            <uni-icons type="search" size="20" @click="showSelectorModule(hform, 4)"></uni-icons>
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">产品名称</view>
                        <view class="right disabled">
                            <input type="text" disabled :value="hform.HMaterName" />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">检验员</view>
                        <view class="right">
                            <uni-combox :candidates="GyFirstCheckEmpNameList" placeholder="请选择检验员"
                                :v-model="hform.HFirstCheckEmpName"
                                @update:modelValue="HFirstCheckEmpChange"></uni-combox>
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">检验方案</view>
                        <view class="right disabled">
                            <input type="text" disabled :value="this.hform.HQCSchemeName" />
                        </view>
                        <view class="icon-wrapper-big"><uni-icons type="search" size="20"
                                @click="showSelectorModule(hform, 7)"></uni-icons></view>
                    </view>
                    <view class="form-item">
                        <view class="left">判断结论</view>
                        <view class="right none-border">
                            <radio-group @changer="checkResultChange">
                                <label>
                                    <radio value="0" :checked="hform.HLastResult" /><text></text>
                                    合格
                                </label>
                                <view style="width: 20rpx; display: inline-block"></view>
                                <label>
                                    <radio value="1" :checked="!hform.HLastResult" /><text></text>
                                    不合格
                                </label>
                            </radio-group>
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">工序</view>
                        <view class="right disabled">
                            <input type="text" disabled :value="hform.HProcName" />
                        </view>
                        <view class="icon-wrapper-big"><uni-icons type="search" size="20"
                                @click="showSelectorModule(hform, 8)"></uni-icons></view>
                    </view>
                </view>
                <!-- 其他信息 -->
                <view class="bill-main-content" v-if="mainTabSelected == 2">
                    <view class="form-item">
                        <view class="left">源单类型</view>
                        <view class="right" style="position: relative" :class="!hasSourceBill?'':'disabled'">
                            <picker mode="selector" :range="HSourceBillTypeNameList" :disabled="hasSourceBill"
                                @change="HSourceBillTypeNameChange">
                                <input type="text" placeholder="请选择源单类型" v-model="HSourceBillType" disabled/>
                                <view class="picker-overlay"></view>
                            </picker>
                        </view>
                    </view>
                    <view class="form-item" v-if="false">
                        <view class="left">生产班次</view>
                        <view class="right">
                            <uni-combox :candidates="GyWorkShiftNameList" placeholder="请选择生产班次"
                                v-model="hform.HShiftsName" @update:modelValue="HWorkShiftChange"></uni-combox>
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">异常临时处理方案</view>
                        <view class="right">
                            <input type="text" v-model="hform.HErrTreatment" value="" />
                        </view>
                    </view>
                    <view class="form-item" v-if="false">
                        <view class="left">任务单数量</view>
                        <view class="right">
                            <input type="number" v-model="hform.HICMOQty" />
                        </view>
                    </view>
                    <view class="form-item" v-if="false">
                        <view class="left">流转卡数量</view>
                        <view class="right">
                            <input type="number" v-model="hform.HProcExchQty" />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">批号</view>
                        <view class="right">
                            <input type="text" value="" />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">备注</view>
                        <view class="right">
                            <input type="text" v-model="hform.HRemark" value="" />
                        </view>
                    </view>
                </view>
                <!-- 制单信息 -->
                <view class="bill-main-content" v-if="mainTabSelected == 3">
                    <view class="form-item">
                        <view class="left">制单人</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HMaker" disabled />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">制单日期</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HMakeDate" disabled />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">审核人</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HChecker" disabled />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">审核日期</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HCheckDate" disabled />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">关闭人</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HCloseMan" disabled />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">关闭日期</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HCloseDate" disabled />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">修改人</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HUpDater" disabled />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">修改日期</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HUpDateDate" disabled />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">作废人</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HDeleteMan" disabled />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">作废日期</view>
                        <view class="right disabled">
                            <input type="text" :value="hform.HDeleteDate" disabled />
                        </view>
                    </view>
                </view>
            </view>
        </view>
        <!-- 子表区域 -->
        <view class="bill-sub-area">
            <!-- 子表页签 -->
            <view class="bill-sub-tabs">
                <view v-for="subTab in subTabs" :key="subTab.id" :class="subTab.id == subTabSelected ? 'selected' : ''"
                    @tap="subTabSelected = subTab.id">{{ subTab.name }}</view>
            </view>
            <!-- 子表内容 -->
            <view class="bill-main-contents">
                <!-- 检验项目 呈现 -->
                <view v-if="subTabSelected == 1">
                    <!-- 需通过显式调用忽略$event参数 -->
                    <view class="buttons" @tap="addCheckItem()">
                        <uni-icons type="plus" style="margin-right: 10rpx" size="22"></uni-icons>新增
                    </view>
                    <view class="over" v-if="!checkItems || getObjLength(checkItems) == 0">暂无数据</view>
                    <view class="list" v-else>
                        <uni-card v-for="checkItem in checkItems" :key="checkItem.num">
                            <view class="card-detail">
                                <view class="detail"> <text>序号:</text>{{ checkItem.num }} </view>
                                <view class="detail editable">
                                    <view style="flex-shrink: 0"><text>检验项目:</text></view>
                                    <input type="text" :value="checkItem.HQCCheckItemName" disabled="" />
                                    <view class="icon-wrapper"><uni-icons type="search" size="16"
                                            @click="showSelectorModule(checkItem, 2)"></uni-icons></view>
                                </view>
                                <view class="detail editable">
                                    <view style="flex-shrink: 0"><text>检验仪器:</text></view>
                                    <input type="text" :value="checkItem.HInspectInstruMentName" disabled="" />
                                    <view class="icon-wrapper"><uni-icons type="search" size="16"
                                            @click="showSelectorModule(checkItem, 3)"></uni-icons></view>
                                </view>
                                <view class="detail editable">
                                    <view><text>结论:</text></view>
                                    <view style="width: 4em">
                                        {{ checkItem.HResult == 1 ? "合格" : "不合格" }}
                                    </view>
                                    <view>
                                        <switch style="width: 2em; transform: scale(0.7)"
                                            :checked="checkItem.HResult == 1"
                                            @change="HResultChange(checkItem.num, $event)" />
                                    </view>
                                </view>
                                <view class="detail editable" style="position: relative">
                                    <view style="flex-shrink: 0"><text>分析方法:</text></view>
                                    <picker :range="arrayAnalysisMethod" range-key="name"
                                        @change="HAnalysisMethodChange(checkItem.num, $event)">
                                        <input disabled :value="getAnalysisMethodDisplay(checkItem.HAnalysisMethod)"
                                            placeholder="请选择" />
                                        <view class="picker-overlay"></view>
                                    </picker>
                                </view>
                                <view class="detail editable">
                                    <view style="flex-shrink: 0"><text>重点检查:</text></view>
                                    <view>
                                        <switch type="checkbox" style="transform: scale(0.7)"
                                            :checked="checkItem.HKeyInspect"
                                            @change="HKeyInspectChange(checkItem, $event)" />
                                    </view>
                                </view>
                                <view class="detail" v-if="checkItem.HQCStd">
                                    <text>检验标准:</text>{{ checkItem.HQCStd }}
                                </view>
                                <view class="detail" v-if="checkItem.HUnit">
                                    <text>单位:</text>{{ checkItem.HUnit }}
                                </view>
                                 <!-- 只有定量分析才启用检验值 -->
                                <view class="detail editable" v-show="checkItem.HAnalysisMethod == 2">
                                <text>检验值:</text>
                                <input type="text" class="editable-input" @blur="calcHResult(checkItem)" v-model="checkItem.HInspectValQ" />
                                </view>
                                <view class="detail" v-if="checkItem.HQCNote">
                                    <text>检验记录:</text>{{ checkItem.HQCNote }}
                                </view>
                                <view class="detail" v-if="checkItem.HTargetVal">
                                    <text>目标值:</text>{{ checkItem.HTargetVal }}
                                </view>
                                <view class="detail" v-if="checkItem.HUpLimit">
                                    <text>上限值:</text>{{ checkItem.HUpLimit }}
                                </view>
                                <view class="detail" v-if="checkItem.HDownLimit">
                                    <text>下限值:</text>{{ checkItem.HDownLimit }}
                                </view>
                                <view class="detail" v-if="checkItem.HMax">
                                    <text>最大值:</text>{{ checkItem.HMax }}
                                </view>
                                <view class="detail" v-if="checkItem.HMin">
                                    <text>最小值:</text>{{ checkItem.HMin }}
                                </view>
                                <view class="detail" v-if="checkItem.HAvg">
                                    <text>平均值:</text>{{ checkItem.HAvg }}
                                </view>
                            </view>
                            <view style="height: 20rpx"></view>
                            <view class="more">
                                <view class="part" style="color: #da0000" @tap.stop="removeCheckItem(checkItem)">
                                    <uni-icons type="trash" style="color: #da0000; margin-right: 10rpx"
                                        size="18"></uni-icons>删除
                                </view>
                            </view>
                        </uni-card>
                    </view>
                </view>
                <!-- 抽样检验 呈现 -->
                <view v-if="subTabSelected == 2">
                    <view class="over" v-if="!checkItems || getObjLength(checkItems) == 0">暂无数据</view>
                    <view class="list" v-else>
                        <uni-card v-for="SamplingItem in checkItems" :key="SamplingItem.num">
                            <view class="card-detail">
                                <view class="detail"> <text>序号:</text>{{ SamplingItem.num }} </view>
                                <view class="detail editable">
                                    <text>检验项目:</text>{{ SamplingItem.HQCCheckItemName }}
                                </view>
                                <view style="width: 100%; height: 1px; border-bottom: 1px solid #e3e3e3"></view>
                                <view class="detail editable" style="width: 100%">
                                    <view style="flex-shrink: 0"><text>抽样方案:</text></view>
                                    <input type="text" :value="SamplingItem.HSampleSchemeName" disabled />
                                    <view class="icon-wrapper"><uni-icons type="search" size="16"
                                            @click="showSelectorModule(SamplingItem, 1)"></uni-icons></view>
                                </view>
                                <view class="detail editable">
                                    <text>抽样类型:</text>{{ SamplingItem.HSamplingType }}
                                </view>
                                <view class="detail editable">
                                    <text>检验水平:</text>{{ SamplingItem.HInspectionLevel }}
                                </view>
                                <view class="detail editable">
                                    <text>严格度:</text>{{ SamplingItem.HStrictness }}
                                </view>
                                <view class="detail editable">
                                    <text>AQL:</text>{{ SamplingItem.HAQL }}
                                </view>
                                <view style="width: 100%; height: 1px; border-bottom: 1px solid #e3e3e3"></view>
                                <view class="detail editable">
                                    <text>样本量:</text>{{ SamplingItem.HSampleQty }}
                                </view>
                                <view class="detail editable">
                                    <text>允许数:</text>{{ SamplingItem.HAcceptQty }}
                                </view>
                                <view class="detail editable">
                                    <text>拒绝数:</text>{{ SamplingItem.HRejectQty }}
                                </view>
                                <view class="detail editable">
                                    <text>样本不合格数:</text>{{ SamplingItem.HSampleUnRightQty }}
                                </view>
                                <view class="detail editable">
                                    <text>样本破坏数:</text>
                                    <view class="editable-input">
                                        <input type="number" v-model="SamplingItem.HSampleDamageQty" />
                                    </view>
                                </view>
                                <view class="detail editable">
                                    <text>检验结果:</text>
                                    <view style="border-radius: 15%; padding: 0 10rpx" :class="
                                        SamplingItem.HInspectResultToSee == '合格'
                                        ? 'pass-background'
                                        : SamplingItem.HInspectResultToSee == '不合格'
                                        ? 'unpass-background'
                                        : ''
                                    ">
                                        {{ SamplingItem.HInspectResultToSee }}
                                    </view>
                                </view>
                            </view>
                        </uni-card>
                    </view>
                </view>
                <!-- 检测值 呈现 -->
                <view v-else v-for="item in InspectModules" :key="item.id">
                    <view v-if="subTabSelected == item.id">
                        <InspectValueTemplateVue ref="InspectValueModules" :bind-key="item.id"
                            @syncCheckData="InspectValueComplete" :bind-data="{
                data: checkItems[item.checkItemId],
                list: InspectValues[item.checkItemId],
                mode: 4 // 检测值模块
              }">
                        </InspectValueTemplateVue>
                    </view>
                </view>
            </view>
        </view>
        <view style="height: 120rpx"></view>
        <view class="bottom-btn">
            <button class="btn-a" size="mini" @tap="submit">提交</button>
            <view style="flex: 1"></view>
            <button class="btn-a" size="mini" @tap="addNew">新增</button>
            <button class="btn-c" size="mini" @tap="goBack">退出</button>
        </view>
        <SampleSchemePopupVue v-if="enablePopupModule == PopupModuleNameList[1]" ref="listPopup"
            @update="SampleSchemeComplete" :bindKey="currentChechItemIDCache">
        </SampleSchemePopupVue>
        <CheckItemPopupVue v-if="enablePopupModule == PopupModuleNameList[2]" ref="listPopup"
            @update="CheckItemComplete" :bindKey="currentChechItemIDCache">
        </CheckItemPopupVue>
        <InspectMentPopupVue v-if="enablePopupModule == PopupModuleNameList[3]" ref="listPopup"
            @update="InspectMentComplete" :bindKey="currentChechItemIDCache">
        </InspectMentPopupVue>
        <MaterialPopupVue v-if="enablePopupModule == PopupModuleNameList[4]" ref="listPopup" @update="MaterComplete"
            :bindKey="0">
        </MaterialPopupVue>
        <ICMOBillPopupVue v-if="enablePopupModule == PopupModuleNameList[5]" ref="listPopup" @update="ICMOBillComplete"
            :bindKey="0"></ICMOBillPopupVue>
        <ProcExchBillPopupVue v-if="enablePopupModule == PopupModuleNameList[6]" ref="listPopup"
            @update="ProcExchBillComplete" :bindKey="0"></ProcExchBillPopupVue>
        <ProcessPopupVue v-if="enablePopupModule == PopupModuleNameList[8]" ref="listPopup" @update="HProcComplete"
            :bindKey="0"></ProcessPopupVue>
        <CheckProjectPopupVue v-if="enablePopupModule == PopupModuleNameList[7]" ref="listPopup"
            @update="HQCSchemeComplete" :bindKey="0"></CheckProjectPopupVue>
    </view>
</template>
<script>
    import dayjs from "dayjs";
    import {
        CommonUtils
    } from "../../../utils/common";
    import InspectValueTemplateVue from "@/components/ZLGL/InspectValueTemplate.vue";
    import SampleSchemePopupVue from "@/components/ZLGL/SampleSchemePopup.vue";
    import CheckItemPopupVue from "@/components/ZLGL/CheckItemPopup.vue";
    import InspectMentPopupVue from "../../../components/ZLGL/InspectMentPopup.vue";
    import MaterialPopupVue from "../../../components/ZLGL/MaterialPopup.vue";
    import ICMOBillPopupVue from "../../../components/ZLGL/ICMOBillPopup.vue";
    import ProcExchBillPopupVue from "../../../components/ZLGL/ProcExchBillPopup.vue";
    import ProcessPopupVue from "../../../components/ZLGL/ProcessPopup.vue";
    import CheckProjectPopupVue from "../../../components/ZLGL/CheckProjectPopup.vue";
    import {
        getUserInfo
    } from "../../../utils/auth";
    import {
        MpaasScan
    } from "../../../utils/mpaasScan";
    export default {
        components: {
            InspectValueTemplateVue,
            SampleSchemePopupVue,
            CheckItemPopupVue,
            InspectMentPopupVue,
            MaterialPopupVue,
            ICMOBillPopupVue,
            ProcExchBillPopupVue,
            ProcessPopupVue,
            CheckProjectPopupVue,
        },
        computed: {
            judgeConclusion: {
                get() {
                    return true;
                },
            },
        },
        data() {
            return {
                operationType: 1,
                mainTabSelected: 1,
                subTabSelected: 1,
                // 源单状态控制
                hasSourceBill: false,
                // 控制当前显示的弹窗模块
                enablePopupModule: "",
                PopupModuleNameList: [
                    "",
                    "SampleScheme",
                    "CheckItem",
                    "InspectMent",
                    "Material",
                    "ICMOBill",
                    "ProcExchBill",
                    "QCScheme",
                    "Process",
                ],
                // 当前操作的检验单ID缓存
                currentChechItemIDCache: -1,
                // uni-combox 选择器使用
                // 生产资源
                GySourceList: [],
                GySourceNameList: [],
                // 班次
                GyWorkShiftList: [],
                GyWorkShiftNameList: [],
                // 检验员
                GyFirstCheckEmpList: [],
                GyFirstCheckEmpNameList: [],
                // 检验方案
                arrayAnalysisMethod: [{
                        value: 1,
                        name: "定性分析",
                    },
                    {
                        value: 2,
                        name: "定量分析",
                    },
                    {
                        value: 3,
                        name: "其他分析",
                    },
                ],
                ArrayAnalysisMethodValue: [1, 2, 3],
                // 子表 页签信息
                subTabs: {
                    1: {
                        id: "1",
                        name: "检验项目",
                    },
                    2: {
                        id: "2",
                        name: "抽样检验",
                    },
                },
                // 源单类型
                HSourceBillType: "销售订单",
                HSourceBillTypeValueList: ['1401','1402'],
                HSourceBillTypeNameList: [
                    "销售订单","发货通知单"
                ],
                // 主表属性
                hform: {
                    HSourceBillType: "1401",
                    HSourceBillNo: "",
                    HBillNo: "",
                    HInterID: "0",
                    HDate: dayjs(new Date()).format("YYYY-MM-DD"),
                    HSourceName: "",
                    HSourceID: "0",
                    HShiftsName: "",
                    HShiftsID: "0",
                    HICMOBillNo: "",
                    HICMOInterID: "0",
                    HICMOEntryID: "1",
                    HICMOQty: "0",
                    HProcExchBillNo: "",
                    HProcExchInterID: "0",
                    HProcExchEntryID: "0",
                    HProcExchQty: "0",
                    HMaterNumber: "",
                    HMaterID: "0",
                    HMaterName: "",
                    HFirstCheckEmpName: "",
                    HFirstCheckEmp: 0,
                    HQCSchemeName: "",
                    HQCSchemeID: "0",
                    HBatchNo: "",
                    HLastResult: true, // 默认合格
                    HProcName: "",
                    HProcID: "0",
                    HTakeSampleCheckBillNo: "", // 取样单
                    HTakeSampleCheckBillID: "0",
                    HRemark: "",
                    HErrTreatment: "", // 异常临时处理方案
                    HMaker: getUserInfo()["Czymc"] || "",
                    HChecker: "",
                    HCloseMan: "",
                    HMakeDate: dayjs(new Date()).format("YYYY-MM-DDTHH:mm:ss"),
                    HCheckDate: "",
                    HCloseDate: "",
                    HUpDater: "",
                    HDeleteMan: "",
                    HUpDateDate: "",
                    HDeleteDate: "",
                    HResult: 1,
                    HAnalysisMethod: "",
                    HResDec: "",
                    HStatus: 1,
                    HMainSourceBillType: "",
                    HMainSourceInterID: "0",
                    HMainSourceEntryID: "1",
                    HMainSourceBillNo: "",
                },
                // 检验项目和抽样检验 值
                checkItems: {},
                // 检测值模块
                InspectModules: {},
                // 检测值
                InspectValues: {},
            };
        },
        methods: {
            // 检验值 计算是否合格
            calcHResult(item){
                // 非抽检条件下判断结论
                console.log('item: ',item);
                if(item.HSampleSchemeID) {
                    return
                }
                if(item.HInspectValQ >= item.HDownLimit && item.HInspectValQ <= item.HUpLimit){
                 this.checkItems[item.num].HResult = true
                 return
             }
             this.checkItems[item.num].HResult = false
            },
            // 源单类型选择
            HSourceBillTypeNameChange(e) {
                this.HSourceBillType = this.HSourceBillTypeNameList[e.detail.value];
                this.hform.HSourceBillType = this.HSourceBillTypeValueList[e.detail.value];
            },
            toScanCode() {
                MpaasScan.scanCode((res) => {
                    if (res) {
                        this.getSourceBillInfo(HBarCode);
                    }
                });
            },
            async getSourceBillInfo(HBarCode) {
                console.log('HBarCode: ', HBarCode);
                // 根据单据类型,调用不同的下推函数
                if (this.hform.HSourceBillType == 1401) {
                    // 销售订单
                    await this.LoadingInformation_SeOrder(HBarCode);
                    if (
                        (uni.getStorageSync("OrganizationID") == "7667152" &&
                            uni.getStorageSync("Organization") == "CMR Technology Mexico S.A. de C.V.") ||
                        (uni.getStorageSync("OrganizationID") == "100199" &&
                            uni.getStorageSync("Organization") == "杭州斯莫尔磁性材料有限公司")
                    ) {
                        await this.GetCheckItemID(); // 客户为斯莫尔,进入按照质检方案表头上的物料绑定带出默认方案
                    }
                    return;
                }
                if (this.hform.HSourceBillType == 1402) {
                    // 发货通知单LoadingInformation_SeOutStock
                    await this.LoadingInformation_SeOutStock(HBarCode);
                    if (
                        (uni.getStorageSync("OrganizationID") == "7667152" &&
                            uni.getStorageSync("Organization") == "CMR Technology Mexico S.A. de C.V.") ||
                        (uni.getStorageSync("OrganizationID") == "100199" &&
                            uni.getStorageSync("Organization") == "杭州斯莫尔磁性材料有限公司")
                    ) {
                        await this.GetCheckItemID(); // 客户为斯莫尔,进入按照质检方案表头上的物料绑定带出默认方案
                    }
                    return;
                }
                if (this.hform.HSourceBillType == 3710) {
                    // 生产订单列表首检
                    await this.LoadingInformation_ICMO(HBarCode);
                    if (
                        (uni.getStorageSync("OrganizationID") == "7667152" &&
                            uni.getStorageSync("Organization") == "CMR Technology Mexico S.A. de C.V.") ||
                        (uni.getStorageSync("OrganizationID") == "100199" &&
                            uni.getStorageSync("Organization") == "杭州斯莫尔磁性材料有限公司")
                    ) {
                        await this.GetCheckItemID(); // 客户为斯莫尔,进入按照质检方案表头上的物料绑定带出默认方案
                    }
                    return;
                }
                if (this.hform.HSourceBillType == 3772) {
                    // 工序流转卡列表首检
                    await this.LoadingInformation_ProcExchange(HBarCode);
                    if (
                        (uni.getStorageSync("OrganizationID") == "7667152" &&
                            uni.getStorageSync("Organization") == "CMR Technology Mexico S.A. de C.V.") ||
                        (uni.getStorageSync("OrganizationID") == "100199" &&
                            uni.getStorageSync("Organization") == "杭州斯莫尔磁性材料有限公司")
                    ) {
                        await this.GetCheckItemID(); // 客户为斯莫尔,进入按照质检方案表头上的物料绑定带出默认方案
                    }
                    return;
                }
            },
            async GetCheckItemID() {
                if (!this.hform.HMaterName && !this.hform.HProcName) {
                    try {
                        let res = await CommonUtils.doRequest2Async({
                            url: "/Web/GetCheckItemID",
                            data: {
                                HName: this.hform.HMaterName,
                                HProName: this.hform.HProcName,
                                HSourceID: this.hform.HSourceID,
                            },
                        });
                        let {
                            count,
                            Message,
                            data
                        } = res.data;
                        if (count != 1) {
                            CommonUtils.showTips({
                                title: "温馨提示",
                                message: `获取检验方案 错误: ${Message}`,
                            });
                            return;
                        }
                        this.hform.HQCSchemeName = data[0].检验方案名称;
                        this.hform.HQCSchemeID = data[0].hmainid;
                        this.get_CheckItem();
                    } catch (err) {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `获取检验方案 错误: ${err}`,
                        });
                    }
                }
            },
            //#region 一致
            async LoadingInformation_ProcExchange(HBarCode) {
                // 工序流转卡
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/CheckBill/get_ProcessExchangeBill_ByBillNo",
                        data: {
                            HBillNo: HBarCode,
                            user: getUserInfo()["Czymc"],
                        },
                    });
                    let {
                        count,
                        Message,
                        data
                    } = res.data;
                    if (count != 1) {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `获取工序流转卡 错误: ${Message}`,
                        });
                        return;
                    }
                    this.hform.HProcExchBillNo = data[0].流转卡号;
                    this.hform.HProcExchInterID = data[0].HProcExchInterID;
                    this.hform.HProcExchEntryID = data[0].HProcExchEntryID || 0;
                    this.hform.HProcExchQty = data[0].流转卡数量 || 0;
                    this.hform.HICMOBillNo = data[0].任务单;
                    this.hform.HICMOInterID = data[0].HICMOInterID;
                    this.hform.HICMOQty = data[0].HICMOQty || 0;
                    this.hform.HSourceName = data[0].生产资源;
                    this.hform.HSourceID = data[0].HSourceID || 0;
                    this.hform.HMaterID = data[0].HMaterID;
                    this.hform.HMaterName = data[0].产品名称;
                    this.hform.HMainSourceBillNo = data[0].单据号;
                    this.hform.HMainSourceBillType = data[0].HBillType;
                    this.hform.HMainSourceInterID = data[0].HInterID;
                    this.hform.HICMOEntryID = data[0].HICMOEntryID || 1;
                    this.hform.HQCSchemeName = data[0].检验方案名称;
                    this.hform.HQCSchemeID = data[0].检验方案ID;
                    this.hform.HProcName = data[0].当前工序;
                    this.hform.HBatchNo = data[0].批号;
                    this.hasSourceBill = true
                    this.get_CheckItem();
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `获取工序流转卡 错误: ${err}`,
                    });
                }
            },
            //#endregion
            //#region 修改
            async LoadingInformation_ICMO(HBarCode) {
                // 生产订单
                try {
                    let sWhere="and 单据号='"+HBarCode+"'"
                    console.log(sWhere)
                    let res = await CommonUtils.doRequest2Async({
                        url: "/LEMS/MES_IF_ICMOBillList_Json",
                        data: {
                            sWhere: sWhere,
                            user: getUserInfo()["Czymc"],
                        },
                    });
                    let {
                        count,
                        Message,
                        data
                    } = res.data;
                    if (count != 1) {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `获取生产订单 错误: ${Message}`,
                        });
                        return;
                    }
                    //生产改
                    //this.hform.HProcExchBillNo = data[0].流转卡号;
                    //this.hform.HProcExchInterID = data[0].HProcExchInterID;
                    //this.hform.HProcExchEntryID = data[0].HProcExchEntryID;
                    //this.hform.HProcExchQty = data[0].流转卡数量 || 0;
                    this.hform.HICMOBillNo = data[0].单据号;
                    this.hform.HICMOInterID = data[0].hmainid;
                    this.hform.HICMOQty = data[0].生产任务单数量;
                    this.hform.HSourceName = data[0].生产资源;
                    this.hform.HSourceID = data[0].HSourceID;
                    this.hform.HMaterID = data[0].HMaterID;
                    this.hform.HMaterNumber=data[0].产品代码
                    this.hform.HMaterName = data[0].产品名称;
                    this.hform.HMainSourceBillNo = data[0].单据号;
                    this.hform.HMainSourceBillType = data[0].单据类型;
                    this.hform.HMainSourceInterID = data[0].HInterID;
                    this.hform.HICMOEntryID = data[0].HEntryID || 1;
                    this.hform.HQCSchemeName = data[0].检验方案名称;
                    this.hform.HQCSchemeID = data[0].检验方案ID;
                    this.hform.HProcName = data[0].当前工序;
                    this.hasSourceBill = true
                    this.get_CheckItem();
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `获取生产订单 错误: ${err}`,
                    });
                }
            },
            //#endregion
            //#region 一致
            async LoadingInformation_StationEntrustOutBill(HBarCode) {
                // 工序委外接收单
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Cj_StationEntrustOutBill/list",
                        data: {
                            sWhere: ` and HBillNo = '${HBarCode}'`,
                        },
                    });
                    let {
                        count,
                        Message,
                        data
                    } = res.data;
                    if (count != 1) {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `获取工序委外接收单 错误: ${Message}`,
                        });
                        return;
                    }
                    HProcExchBillNo = data[0].流转卡号;
                    HProcExchInterID = data[0].HProcExchInterID;
                    HProcExchEntryID = data[0].HProcExchEntryID;
                    HProcExchQty = data[0].流转卡数量 || 0;
                    HICMOBillNo = data[0].生产订单号;
                    HICMOInterID = data[0].HICMOInterID;
                    HICMOQty = data[0].HICMOQty;
                    HSourceName = data[0].生产资源;
                    HSourceID = data[0].HSourceID;
                    HMaterID = data[0].HMaterID;
                    HMaterName = data[0].产品名称;
                    HMainSourceBillNo = data[0].单据号;
                    HMainSourceBillType = data[0].HBillType;
                    HMainSourceInterID = data[0].hmainid;
                    HICMOEntryID = data[0].HICMOEntryID || 1;
                    this.hasSourceBill = true
                    this.get_CheckItem();
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `获取工序委外接收单 错误: ${err}`,
                    });
                }
            },
            //#endregion
            //LoadingInformation_SeOutStock
            async LoadingInformation_SeOrder(HBarCode) {
                // 源单为销售订单
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/QC_OutCompCheckBill/get_SeOrderBill_Tmp_ByBiilNo",
                        data: {
                            HBillNo: HBarCode,
                            user: getUserInfo()["Czymc"],
                        },
                    });
                    let {
                        count,
                        Message,
                        data
                    } = res.data;
                    if (count != 1) {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `获取销售订单 错误: ${Message}`,
                        });
                        return;
                    }
                    //change_inlife
                        this.hform.HMaterNumber=data[0].HMaterNumber;
                        this.hform.HMaterID = data[0].HMaterID;
                        this.hform.HMaterName = data[0].HMaterName;
                        this.hform.HMainSourceBillNo = data[0].HBillNo;
                        this.hform.HMainSourceInterID = data[0].HInterID;
                        this.hform.HMainSourceEntryID=data[0].HEntryID
                        this.hform.HQCSchemeName = data[0].检验方案名称;
                        this.hform.HQCSchemeID = data[0].检验方案ID;
                    for (let i = 0; i < data.length; i++) {
                        this.addCheckItem(data[i])
                    }
                    this.hasSourceBill = true
                    this.get_CheckItem();
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `获取销售订单 错误: ${err}`,
                    });
                }
            },
            //LoadingInformation_SeOutStock
            async LoadingInformation_SeOutStock(HBarCode) {
                // 源单为发货通知订单
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/QC_OutCompCheckBill/get_SeOutStockBill_Tmp_ByBillNo",
                        data: {
                            HBillNo: HBarCode,
                            user: getUserInfo()["Czymc"],
                        },
                    });
                    let {
                        count,
                        Message,
                        data
                    } = res.data;
                    if (count != 1) {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `获取发货通知单 错误: ${Message}`,
                        });
                        return;
                    }
                    //change_inlife
                        this.hform.HMaterNumber=data[0].HMaterNumber;
                        this.hform.HMaterID = data[0].HMaterID;
                        this.hform.HMaterName = data[0].HMaterName;
                        this.hform.HMainSourceBillNo = data[0].HBillNo;
                        this.hform.HMainSourceInterID = data[0].HInterID;
                        this.hform.HMainSourceEntryID=data[0].HEntryID
                        this.hform.HQCSchemeName = data[0].检验方案名称;
                        this.hform.HQCSchemeID = data[0].检验方案ID;
                    for (let i = 0; i < data.length; i++) {
                        this.addCheckItem(data[i])
                    }
                    this.hasSourceBill = true
                    this.get_CheckItem();
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `获取发货通知单 错误: ${err}`,
                    });
                }
            },
            // 检验员初始化
            async InitHEmp() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Gy_Employee/list",
                        data: {
                            sWhere: `  and 组织名称 = '${uni.getStorageSync(
              "Organization"
            )}' and 禁用标记 = ''and 审核人 !='' order by 部门代码`,
                            user: getUserInfo()["Czymc"],
                            Organization: uni.getStorageSync("Organization"),
                        },
                    });
                    let {
                        data,
                        Message,
                        count
                    } = res.data;
                    if (count == 1) {
                        console.log("data: ", data);
                        this.GyFirstCheckEmpList = data;
                        this.GyFirstCheckEmpNameList = Array.from(data).map((e) => e["职员名称"]);
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `初始化检验员失败: ${Message}`,
                        });
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `初始化检验员失败: ${err}`,
                    });
                }
            },
            async HFirstCheckEmpChange(e) {
                console.log("选中检验员: ", e);
                let index = this.GyFirstCheckEmpList.findIndex((elem) => elem["职员名称"] == e);
                if (index == -1) {
                    this.hform.HFirstCheckEmp = 0;
                    this.hform.HFirstCheckEmpName = "";
                    return;
                }
                this.hform.HFirstCheckEmp = this.GyFirstCheckEmpList[index]["HItemID"];
                this.hform.HFirstCheckEmpName = this.GyFirstCheckEmpList[index]["职员名称"];
            },
            // 生产班次初始化
            async InitHWorkShift() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Gy_ShiftsController/Get_Gy_WorkShiftList",
                        data: {
                            sWhere: ` and 禁用标记 = '' and ISNULL(审核人,'')  != '' and 使用组织名称 = '${uni.getStorageSync(
              "Organization"
            )}'`,
                            HMaker: getUserInfo()["Czymc"],
                        },
                    });
                    let {
                        data,
                        Message,
                        count
                    } = res.data;
                    if (count == 1) {
                        console.log("data: ", data);
                        this.GyWorkShiftList = data;
                        this.GyWorkShiftNameList = Array.from(data).map((e) => e["班次名称"]);
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `初始化班次失败: ${Message}`,
                        });
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `初始化班次失败: ${err}`,
                    });
                }
            },
            async HWorkShiftChange(e) {
                console.log("选中班次: ", e);
                let index = this.GyWorkShiftList.findIndex((elem) => elem["班次名称"] == e);
                if (index == -1) {
                    this.hform.HWorkShiftID = 0;
                    this.hform.HWorkShiftName = "";
                    return;
                }
                this.hform.HWorkShiftID = this.GySourceList[index]["HInterID"];
                this.hform.HWorkShiftName = this.GySourceList[index]["班次名称"];
            },
            // 生产资源更新
            // 生产资源初始化
            async InitHSource() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Gy_Source/list",
                        data: {
                            sWhere: `and 禁用标记 != 'Y' and ISNULL(审核人,'')  != '' and HUSEORGID = '100038'`,
                            user: getUserInfo()["Czymc"],
                        },
                    });
                    let {
                        data,
                        Message,
                        count
                    } = res.data;
                    if (count == 1) {
                        this.GySourceList = data;
                        this.GySourceNameList = Array.from(data).map((e) => e["生产资源名称"]);
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `初始化生产资源失败: ${Message}`,
                        });
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `初始化生产资源失败: ${err}`,
                    });
                }
            },
            // 生产资源更新
            async HSourceChange(e) {
                console.log("选中生产资源: ", e);
                let index = this.GySourceList.findIndex((elem) => elem["生产资源名称"] == e);
                if (index == -1) {
                    this.hform.HSourceID = 0;
                    this.hform.HSourceName = "";
                    return;
                }
                this.hform.HSourceID = this.GySourceList[index]["HItemID"];
                this.hform.HSourceName = this.GySourceList[index]["生产资源名称"];
                this.get_ICMOBillStatusList();
                this.get_QC_TakeSampleCheckBillList();
                this.GetCheckItemID();
            },
            // 显示弹窗
            async showSelectorModule(item, index) {
                this.currentChechItemIDCache = item.num || 0; // 0 表示没有任何子表被选中
                this.enablePopupModule = this.PopupModuleNameList[index];
                console.log("this.$refs: ", this.$refs);
                await this.$nextTick();
                if (index == 7) {
                    // 检验方案需要额外传递工序和物料名称两个参数
                    this.$refs.listPopup.setRequiredInfo(item.HMaterName, item.HProcName);
                }
                this.$refs.listPopup.showPopup();
            },
            getAnalysisMethodDisplay(val) {
                console.log("AnalysisMethodVal: ", val);
                if (val) {
                    return this.arrayAnalysisMethod.find((e) => e.value == val).name;
                }
                return "";
            },
            checkResultChange(event) {
                console.log("event: ", event);
            },
            // 检验项目新增行
            addCheckItem(resource) {
                let ordinal = this.getObjLength(this.checkItems) + 1;
                let checkItem = {
                    num: ordinal,
                    HInterID: this.hform.HInterID,
                    HQCCheckItemID: "",
                    HQCCheckItemNumber: "",
                    HQCCheckItemName: "",
                    HInspectInstruMentID: "0",
                    HInspectInstruMentNumber: "",
                    HInspectInstruMentName: "",
                    HQCStd: "",
                    HUnit: "",
                    HQCNote: "",
                    HAnalysisMethod: "",
                    HResult: 1,
                    HMax: "",
                    HMin: "",
                    HAvg: "",
                    HRemark: "",
                    HKeyInspect: false,
                    HStatus: 1,
                    HSampleSchemeID: "",
                    HUnitID: 0,
                    HInspectVal: "",
                    HTargetVal: "",
                    HUpLimit: "",
                    HDownLimit: "",
                    HUpOffSet: "",
                    HDownOffSet: "",
                    HSampleDamageQty: 0,
                    HSampleSchemeName: "",
                    HSampleQty: 0,
                    HAcceptQty: 0,
                    HInspectionLevel: "",
                    HRejectQty: 0,
                    HStrictness: "",
                    HSampleUnRightQty: 0,
                    HAQL: "",
                    HSamplingType: "",
                    HInspectResultToSee: "",
                };
                if (resource) {
                    // 通过主表检验方案带出的检验项目
                    Object.assign(checkItem, resource);
                }
                this.$set(this.checkItems, ordinal, checkItem);
                this.$nextTick(() => {
                    // 检查是否可以新增检验值项
                    this.setInspectValModule(this.checkItems[ordinal]);
                });
            },
            // 检验项目删除行
            removeCheckItem(item) {
                uni.showModal({
                    title: "温馨提示",
                    content: `确认要删除第${item.num}行吗?删除后不能恢复`,
                    success: (res) => {
                        if (res.confirm) {
                            this.$delete(this.checkItems, item.num);
                            this.$delete(this.subTabs, `_${item.num}`);
                            this.$forceUpdate();
                            this.refreshCheckItemNum();
                        }
                    },
                });
            },
            async refreshCheckItemNum() {
                await this.$nextTick();
                // 重排序号
                let num = 1;
                let checkItemsCache = {};
                for (let s in this.checkItems) {
                    checkItemsCache[num] = this.checkItems[s];
                    checkItemsCache[num].num = num;
                    num++;
                }
                this.checkItems = checkItemsCache;
            },
            getObjLength(obj) {
                return Object.keys(obj).length;
            },
            // 结论修改
            HResultChange(id, e) {
                console.log("e: ", e);
                this.checkItems[id]["HResult"] = e.detail.value ? 1 : 2;
                this.HCheckLastResult();
            },
            // 每次检验项目的结论更新,都要判断最终结论
            HCheckLastResult() {
                let unPassNum = 0;
                for (var key in this.checkItems) {
                    if (!(this.checkItems[key]["HResult"] == 1)) {
                        unPassNum++;
                    }
                }
                if (unPassNum > 0) {
                    this.hform.HLastResult = false;
                    return;
                }
                this.hform.HLastResult = true;
            },
            // 检验方案修改
            HAnalysisMethodChange(id, e) {
                console.log("e: ", e);
                this.checkItems[id]["HAnalysisMethod"] = this.arrayAnalysisMethod[e.detail.value][
                    "value"
                ];
                // 检查是否可以新增检验值项
                this.setInspectValModule(this.checkItems[id]);
            },
            // 重点检查修改
            HKeyInspectChange(id, e) {
                console.log("e: ", e);
                this.checkItems[id]["HKeyInspect"] = e.detail.value;
            },
            // 检验项目返回
            async CheckItemComplete(e) {
                console.log("CheckItemRet: ", e);
                for (var key in e["retVal"]) {
                    let data = e["retVal"][key];
                    Object.assign(this.checkItems[key], {
                        HQCCheckItemID: data["HItemID"],
                        HQCCheckItemNumber: data["代码"],
                        HQCCheckItemName: data["名称"],
                    });
                    await this.$nextTick();
                    this.$refs.listPopup.exit();
                    // 确保在弹窗结束后,再将页面上挂在的组件置空
                    await this.$nextTick();
                    this.enablePopupModule = this.PopupModuleNameList[0];
                }
            },
            // 检验方案返回
            async SampleSchemeComplete(e) {
                console.log("SampleSchemeRet: ", e);
                for (var key in e["retVal"]) {
                    let data = e["retVal"][key];
                    Object.assign(this.checkItems[key], {
                        HSampleSchemeID: data["hmainid"],
                        HSampleSchemeNumber: data["抽样方案代码"],
                        HSampleSchemeName: data["抽样方案名称"],
                        HSampleQty: data["样本量"] || 0,
                        HAcceptQty: data["允许数"] || 0,
                        HInspectionLevel: data["检验水平"],
                        HRejectQty: data["拒绝数"] || 0,
                        HStrictness: data["严格度"],
                        HSampleUnRightQty: data["样本不合格数"] || 0,
                        HAQL: data["AQL"],
                        HSamplingType: data["抽样类型"],
                        HInspectResultToSee: data["检验结果"],
                        HUpLimit: data["上限值"] || 0,
                        HDownLimit: data["下限值"] || 0,
                        HSampleDamageQty: data["样本破坏数"] || 0,
                    });
                    await this.$nextTick();
                    this.$refs.listPopup.exit();
                    this.setInspectValModule(this.checkItems[key]);
                    await this.$nextTick();
                    this.enablePopupModule = this.PopupModuleNameList[0];
                }
            },
            // 检验仪器返回
            async InspectMentComplete(e) {
                console.log("InspectInstruMentRet: ", e);
                for (var key in e["retVal"]) {
                    let data = e["retVal"][key];
                    Object.assign(this.checkItems[key], {
                        HInspectInstruMentID: data["HItemID"],
                        HInspectInstruMentNumber: data["检验仪器代码"],
                        HInspectInstruMentName: data["检验仪器名称"],
                    });
                    await this.$nextTick();
                    this.$refs.listPopup.exit();
                    // 确保在弹窗结束后,再将页面上挂在的组件置空
                    await this.$nextTick();
                    this.enablePopupModule = this.PopupModuleNameList[0];
                }
            },
            // 产品代码返回
            async MaterComplete(e) {
                console.log("MaterRet: ", e);
                for (var key in e["retVal"]) {
                    let data = e["retVal"][key];
                    Object.assign(this.hform, {
                        HMaterNumber: data["物料代码"],
                        HMaterName: data["物料名称"],
                        HMaterID: data["HItemID"],
                    });
                    await this.$nextTick();
                    this.$refs.listPopup.exit();
                    // 确保在弹窗结束后,再将页面上挂在的组件置空
                    await this.$nextTick();
                    this.enablePopupModule = this.PopupModuleNameList[0];
                    this.GetCheckItemID();
                }
            },
            // 任务单返回
            async ICMOBillComplete(e) {
                console.log("ICMOBillRet: ", e);
                for (var key in e["retVal"]) {
                    let data = e["retVal"][key];
                    Object.assign(this.hform, {
                        HICMOInterID: data.hmainid,
                        HICMOEntryID: data.HEntryID || 1,
                        HICMOBillNo: data.单据号,
                        HMaterNumber: data.产品代码,
                        HMaterName: data.产品名称,
                        HMaterID: data.HMaterID,
                        HICMOQty: data.生产任务单数量,
                    });
                    await this.$nextTick();
                    this.$refs.listPopup.exit();
                    // 确保在弹窗结束后,再将页面上挂在的组件置空
                    await this.$nextTick();
                    this.enablePopupModule = this.PopupModuleNameList[0];
                }
            },
            // 流转卡返回
            async ProcExchBillComplete(e) {
                console.log("ProcExchBillRet: ", e);
                for (var key in e["retVal"]) {
                    let data = e["retVal"][key];
                    Object.assign(this.hform, {
                        HProcExchInterID: data.hmainid,
                        HProcExchEntryID: data.hsubid,
                        HProcExchBillNo: data.单据号,
                    });
                    await this.$nextTick();
                    this.$refs.listPopup.exit();
                    // 确保在弹窗结束后,再将页面上挂在的组件置空
                    await this.$nextTick();
                    this.enablePopupModule = this.PopupModuleNameList[0];
                }
            },
            // 检验方案(主表)返回
            async HQCSchemeComplete(e) {
                console.log("HQCSchemeRet: ", e);
                for (var key in e["retVal"]) {
                    let data = e["retVal"][key];
                    Object.assign(this.hform, {
                        HQCSchemeID: data.hmainid,
                        HQCSchemeName: data.检验方案名称,
                    });
                    await this.get_CheckItem();
                    await this.$nextTick();
                    this.$refs.listPopup.exit();
                    // 确保在弹窗结束后,再将页面上挂在的组件置空
                    await this.$nextTick();
                    this.enablePopupModule = this.PopupModuleNameList[0];
                }
            },
            // 工序返回
            async HProcComplete(e) {
                console.log(" HProcRet: ", e);
                for (var key in e["retVal"]) {
                    let data = e["retVal"][key];
                    Object.assign(this.hform, {
                        HProcName: data["工序名称"],
                        HProcID: data["HItemID"],
                    });
                    await this.$nextTick();
                    this.$refs.listPopup.exit();
                    // 确保在弹窗结束后,再将页面上挂在的组件置空
                    await this.$nextTick();
                    this.enablePopupModule = this.PopupModuleNameList[0];
                    await this.GetCheckItemID();
                    await this.get_ICMOBillStatusList();
                    await this.get_QC_TakeSampleCheckBillList();
                }
            },
            //
            async get_QC_TakeSampleCheckBillList() {
                // 取样单查询
                let HProcID = this.hform.HProcID;
                let HProcExchInterId = this.hform.HProcExchInterID;
                let sWhere = "";
                if (HProcID == "0" || HProcID == "") {
                    CommonUtils.showTips({
                        message: "请选择工序",
                    });
                    return;
                }
                sWhere = " and 工序流转卡主内码='" + HProcExchInterID + "' and HProcID=" + HProcID;
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "//QC_TakeSampleCheckBill/QC_TakeSampleCheckBillMainList",
                        data: {
                            sWhere: sWhere,
                            user: getUserInfo()["Czymc"],
                        },
                    });
                    let {
                        data,
                        count,
                        Message
                    } = res.data;
                    if (count != 1) {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `获取取样单信息失败: ${Message}`,
                        });
                    }
                    this.hform.HTakeSampleCheckBillID = data[0]["hmainid"];
                    this.hform.HTakeSampleCheckBillNo = data[0]["单据号"];
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `获取取样单信息失败: ${err}`,
                    });
                }
            },
            async get_ICMOBillStatusList() {
                let sWhere = "";
                let HProcID = this.hform.HProcID;
                let HSourceID = this.hform.HSourceID;
                let HProcExchInterId = this.hform.HProcExchInterID;
                if (HProcID != "0") {
                    sWhere += " and HProcID=" + HProcID;
                }
                if (HSourceID != "0") {
                    sWhere += " and HSourceID=" + HSourceID;
                }
                sWhere += " and HSourceInterID=" + HProcExchInterID;
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/CheckBill/GetICMOBillStatusList",
                        data: {
                            sWhere: sWhere,
                            user: getUserInfo()["Czymc"],
                        },
                    });
                    let {
                        data,
                        count,
                        Message
                    } = res.data;
                    if (count != 1) {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `获取生产工单信息失败: ${Message}`,
                        });
                    }
                    this.hform.HProcID = data[0]["HProcID"];
                    this.hform.HProcName = data[0]["工序"];
                    this.hform.HSourceID = data[0]["HSourceID"];
                    this.hform.HSourceName = data[0]["生产资源"];
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `获取生产工单信息失败: ${err}`,
                    });
                }
            },
            setInspectValModule(checkItem) {
                console.log("checkItem: ", checkItem);
                if (!checkItem || !checkItem.HAnalysisMethod || !checkItem.HSampleSchemeID) {
                    return;
                }
                // 区分检验值页签和静态页签,检验值页签的id以_开头
                this.$set(this.InspectModules, `_${checkItem.num}`, {
                    id: `_${checkItem.num}`,
                    checkItemId: checkItem.num,
                });
                console.log(" this.arrayAnalysisMethod: ", checkItem.HAnalysisMethod);
                let analysisMethodName = this.arrayAnalysisMethod.find(
                    (e) => e.value == checkItem.HAnalysisMethod
                ).name;
                this.$set(this.subTabs, `_${checkItem.num}`, {
                    id: `_${checkItem.num}`,
                    name: `${analysisMethodName}-${checkItem.HQCCheckItemName}`,
                });
            },
            InspectValueUpdate(e) {
                console.log("e: ", e);
                let {
                    data,
                    list
                } = e;
                this.checkItems[data.num] = Object.assign(this.checkItems[data.num], data);
                this.$set(this.InspectValues, `${data.num}`, list);
            },
            // 带出检验项目
            async get_CheckItem() {
                // 首先清空检验项目 和 检验值
                this.checkItems = {}
                for (let key in this.subTabs) {
                    if (key.substring(1) == "_") {
                        this.$delete(this.subTabs, key)
                    }
                }
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Web/GetCheckItemByCheckProjectID",
                        data: {
                            CheckProjectID: this.hform.HQCSchemeID || 0,
                            HBatchQty: this.hform.HProcExchQty || 0,
                        },
                    });
                    let {
                        data,
                        count,
                        Message
                    } = res.data;
                    if (count == 1) {
                        for (var i = 0; i < data.length; i++) {
                            let checkItem = {
                                HQCCheckItemID: data[i]["HQCCheckItemID"],
                                HQCCheckItemNumber: data[i]["检验项目代码"],
                                HQCCheckItemName: data[i]["检验项目"],
                                HInspectInstruMentID: data[i]["HInspectInstruMentID"],
                                HInspectInstruMentNumber: data[i]["检验仪器代码"],
                                HInspectInstruMentName: data[i]["检验仪器"],
                                HQCStd: data[i]["HQCStd"],
                                HUnit: data[i]["单位名称"],
                                HQCNote: "",
                                HAnalysisMethod: data[i]["分析方法"],
                                HResult: data[i]["默认结论"],
                                HMax: "",
                                HMin: "",
                                HAvg: "",
                                HRemark: "",
                                HKeyInspect: data[i]["重点检查"] == 1 ? true : false,
                                HStatus: 0,
                                HSampleSchemeID: data[i]["HSampleSchemeID"],
                                HUnitID: data[i]["HUnitID"],
                                HInspectVal: "",
                                HTargetVal: "",
                                HUpLimit: data[i].上限值,
                                HDownLimit: data[i].下限值,
                                HUpOffSet: "",
                                HDownOffSet: "",
                                HSampleDamageQty: "0",
                                HSampleSchemeName: data[i].抽样方案名称,
                                HSampleQty: data[i].样本量,
                                HAcceptQty: data[i].允许数,
                                HInspectionLevel: data[i].检验水平,
                                HRejectQty: data[i].拒绝数,
                                HStrictness: data[i].严格度,
                                HSampleUnRightQty: 0,
                                HAQL: data[i].AQL,
                                HSamplingType: data[i].抽样类型,
                                HCompareSymbol: data[i].比较符,
                                HTargetVal: data[i].目标值 || 0,
                            };
                            this.addCheckItem(checkItem);
                        }
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `获取检验项目信息失败: ${Message} `,
                        });
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `获取检验项目信息失败: ${err} `,
                    });
                }
            },
            async getMaxBillNo() {
                try {
                    let res = await CommonUtils.doRequest2Sync({
                        url: "/Web/GetMAXNum",
                        data: {
                            HBillType: "7504",
                        },
                    });
                    if (!res) {
                        return;
                    }
                    let {
                        data,
                        Message,
                        count
                    } = res.data;
                    if (count == 1) {
                        this.hform.HInterID = data[0].HInterID;
                        this.hform.HBillNo = data[0].HBillNo;
                    } else {
                        throw Message;
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: "获取单据号异常: " + err,
                    });
                }
            },
            // 检验值返回值
            InspectValueComplete(e) {
                console.log("e: ", e);
                let key = e.num;
                e.HStatus = e.HStatus ? 1 : 0
                if (e.HResult2 == '') {
                    e.HResult2 = this.checkItems[key].HResult
                }
                Object.assign(this.checkItems[key], e);
                this.checkItems[key].HInspectResultToSee = this.checkItems[key].HResult2;
                this.checkItems[key].HResult = this.checkItems[key].HResult2 == '合格' ? 1 : 2;
                this.HCheckLastResult();
            },
            checkSubmitValidate() {
                // if (this.hform.HICMOQty == "" || this.hform.HICMOQty <= 0) {
                //     CommonUtils.showTips({
                //         message: "任务单数量不能为空且不能小于等于0!",
                //     });
                //     return false;
                // }
                if (this.hform.HFirstCheckEmp == 0) {
                    CommonUtils.showTips({
                        message: "检验员未选择!",
                    });
                    return false;
                }
                for (let key in this.checkItems) {
                    if (!this.checkItems[key].HQCCheckItemID) {
                        CommonUtils.showTips({
                            message: `第${this.checkItems[key].num}行检验项目不能为空!`,
                        });
                        return false;
                    }
                    if (
                        this.checkItems[key].HSampleSchemeID == "" ||
                        this.checkItems[key].HSampleSchemeID == null
                    ) {
                        this.checkItems[key].HSampleSchemeID = 0;
                    }
                    if (
                        this.checkItems[key].HSampleQty == "" ||
                        this.checkItems[key].HSampleQty == null
                    ) {
                        this.checkItems[key].HSampleQty = 0;
                    }
                    if (
                        this.checkItems[key].HSampleDamageQty == "" ||
                        this.checkItems[key].HSampleDamageQty == null
                    ) {
                        this.checkItems[key].HSampleDamageQty = 0;
                    }
                    if (
                        this.checkItems[key].HAcceptQty == "" ||
                        this.checkItems[key].HAcceptQty == null
                    ) {
                        this.checkItems[key].HAcceptQty = 0;
                    }
                    if (
                        this.checkItems[key].HRejectQty == "" ||
                        this.checkItems[key].HRejectQty == null
                    ) {
                        this.checkItems[key].HRejectQty = 0;
                    }
                    if (
                        this.checkItems[key].HSampleUnRightQty == "" ||
                        this.checkItems[key].HSampleUnRightQty == 0
                    ) {
                        this.checkItems[key].HSampleUnRightQty = 0;
                    }
                    if (this.checkItems[key].HUnitID == "") {
                        this.checkItems[key].HUnitID = 0;
                    }
                }
                return true;
            },
            async submit() {
                if (!this.checkSubmitValidate()) {
                    return;
                }
                try {
                    console.log('this.$refs: ', this.$refs);
                    // 检查是否有未切换的检验值模块(是否包含set_SaveValue方法),如果有,则运行一次保存检验值的方法,根据检验值是否保存成功再执行下一步
                    if (typeof this.$refs.InspectValueModules != "undefined" && this.$refs.InspectValueModules.length >
                        0) {
                        // 加载有检验值模块
                        await this.$refs.InspectValueModules[0].set_SaveValue();
                        this.InspectValues[0] = this.$refs.InspectValueModules[0].InSpectValues;
                        await this.InspectValueComplete(this.$refs.InspectValueModules[0].checkData)
                    }
                    let InspectValuesTrans = [];
                    let HInterID = this.hform.HInterID;
                    for (let key in this.InspectValues) {
                        let HEntryID = key;
                        InspectValuesTrans.push(
                            `${JSON.stringify(this.InspectValues[key])}`
                        );
                    }
                    let checkItemsArray = [];
                    for (var key in this.checkItems) {
                        let checkItem = JSON.parse(JSON.stringify(this.checkItems[key]))
                        delete checkItem.data
                        checkItemsArray.push(checkItem);
                    }
                    console.log('checkItemsArray: ', checkItemsArray);
                    let sMainSub = `${JSON.stringify(this.hform)};${JSON.stringify(
          checkItemsArray
        )};${this.operationType};${getUserInfo()["Czymc"]};${InspectValuesTrans[0]}`;
                    console.log("this.checkItems: ", this.checkItems);
                    let res = await CommonUtils.doRequest2Sync({
                        url: "/QC_OutCompCheckBill/AddBill",
                        data: {
                            sMainSub: sMainSub,
                        },
                        method: "POST",
                    });
                    if (!res) {
                        return;
                    }
                    let {
                        count,
                        Message,
                        data
                    } = res.data;
                    if (count == 1) {
                        uni.showModal({
                            title: "提示",
                            content: res.data.Message + "。是否继续新增?",
                            success: (res) => {
                                if (res.confirm) {
                                    console.log("用户点击确定");
                                    uni.redirectTo({
                                        url: "/pages/JIAOYAN/shengchanrukujiaoyan/QC_LastPieceCheckBill_v2?operationType=1",
                                    });
                                } else if (res.cancel) {
                                    console.log("用户点击取消");
                                    // setTimeout(() => {
                                    //     uni.navigateBack();
                                    // }, 50)
                                }
                            },
                        });
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `生产入库校验单保存错误: ${Message}`,
                        });
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `生产入库校验单保存错误: ${err}`,
                    });
                }
            },
            addNew() {
                uni.redirectTo({
                    url: "/pages/ZLGL/shoujianjianyan/firstCheckBillList?operationType=1",
                });
            },
            goBack() {
                uni.navigateBack();
            },
            async RoadBillMain() {
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/QC_FirstPieceCheckBill/QC_FirstPieceCheckBill_Edit",
                        data: {
                            sWhere: ` and hmainid=${this.hform.HInterID}`,
                            user: getUserInfo()["Czymc"],
                        },
                    });
                    let {
                        data,
                        count,
                        Message
                    } = res.data;
                    if (count == 1) {
                        console.log("RoadBillMain: : ", data);
                        Object.assign(this.hform, {
                            HInterID: data[0].hmainid,
                            HBillNo: data[0].单据号,
                            HDate: dayjs(data[0].日期).format("YYYY-MM-DD"),
                            HSourceID: data[0].HSourceID,
                            HSourceName: data[0].生产资源名称,
                            HICMOBillNo: data[0].任务单号,
                            HICMOQty: data[0].任务单数量,
                            HICMOInterID: data[0].HICMOInterID,
                            HICMOEntryID: data[0].HICMOEntryID || 1,
                            HMaterID: data[0].HMaterID,
                            HMaterName: data[0].物料名称,
                            HMaterNumber: data[0].物料代码,
                            HProcID: data[0].HProcID,
                            HProcName: data[0].HProcName,
                            HProcExchQty: data[0].HProcExchQty || 0,
                            HProcExchBillNo: data[0].HProcExchBillNo,
                            HProcExchInterID: data[0].HProcExchInterID,
                            HProcExchEntryID: data[0].HProcExchEntryID || 0,
                            HFirstCheckEmp: data[0].HFirstCheckEmp,
                            HFirstCheckEmpName: data[0].质检员名称,
                            HQCSchemeID: data[0].检验方案ID,
                            HQCSchemeName: data[0].检验方案名称,
                            HRemark: data[0].表头备注,
                            HMaker: data[0].制单人,
                            HMakeDate: data[0].制单日期,
                            HChecker: data[0].审核人,
                            HCheckDate: data[0].审核日期,
                            HCloseMan: data[0].关闭人,
                            HCloseDate: data[0].关闭日期,
                            HUpDateDate: data[0].修改日期,
                            HDeleteDate: data[0].作废日期,
                            HSampleSchemeID: data[0].HSampleSchemeID,
                            HSampleSchemeName: data[0].抽样方案名称,
                            HSampleQty: data[0].样本量,
                            HSampleQty2: data[0].样本量,
                            HSampleDamageQty: data[0].样本破坏数,
                            HSamplingType: data[0].抽样类型,
                            HAcceptQty: data[0].允许数,
                            HInspectionLevel: data[0].检验水平,
                            HRejectQty: data[0].拒绝数,
                            HStrictness: data[0].严格度,
                            HSampleUnRightQty: data[0].样本不合格数 || 0,
                            HSampleUnRightQty2: data[0].样本不合格数,
                            HAQL: data[0].AQL,
                            HUnitID: data[0].HUnitID,
                            HUnit: data[0].单位,
                            HInspectValB: data[0].检测值基础资料,
                            HInspectVal: data[0].检测值,
                            HTargetValB: data[0].目标值基础资料,
                            HTargetVal: data[0].目标值,
                            HUpLimit: data[0].上限值,
                            HDownLimit: data[0].下限值,
                            HUpOffSet: data[0].上偏差,
                            HDownOffSet: data[0].下偏差,
                            HEntryID: data[0].hsubid,
                            HQCCheckItemName: data[0].检验项目名称,
                            HQCCheckItemID: data[0].HQCCheckItemID,
                            HShiftsID: data[0].HShiftsID,
                            HShiftsName: data[0].班次名称,
                            HErrTreatment: data[0].异常临时处理方案,
                            HBatchNo: data[0].批号,
                            HLastResult: data[0].判定结论 == "合格" ? true : false,
                            HTakeSampleCheckBillID: data[0].HTakeSampleCheckBillID,
                            HTakeSampleCheckBillNo: data[0].HTakeSampleCheckBillNo,
                            HAnalysisMethod: function() {
                                if (data[0].HAnalysisMethod == 1) {
                                    return '定性检验'
                                } else if (data[0].HAnalysisMethod == 2) {
                                    return '定量检验'
                                } else {
                                    return '其他检验'
                                }
                            }(),
                        });
                        for (let i = 0; i < data.length; i++) {
                            this.addCheckItem({
                                HQCCheckItemID: data[i].HQCCheckItemID,
                                HQCCheckItemNumber: data[i].检验项目代码,
                                HQCCheckItemName: data[i].检验项目名称,
                                HInspectInstruMentID: data[i].HInspectInstruMentID,
                                HInspectInstruMentNumber: data[i].检验仪器代码,
                                HInspectInstruMentName: data[i].检验仪器名称,
                                HQCStd: data[i].检验标准,
                                HUnit: data[i].单位名称,
                                HQCNote: data[i].检验记录,
                                HResult: data[i].结论 == "合格" ? 1 : 0,
                                HMax: data[i].最大值,
                                HMin: data[i].最小值,
                                HAvg: data[i].平均值,
                                HRemark: data[i].表体备注,
                                HAnalysisMethod: data[i].分析方法 == "定性分析" ?
                                    1 : data[i].分析方法 == "定量分析" ?
                                    2 : 3,
                                HKeyInspect: data[i].重点检查 == "否" ? false : true,
                                HSampleSchemeID: data[i].HSampleSchemeID,
                                HUnitID: data[i].HUnitID,
                                HInspectVal: data[i].检测值,
                                HTargetVal: data[i].目标值,
                                HUpLimit: data[i].上限值,
                                HDownLimit: data[i].下限值,
                                HUpOffSet: data[i].上偏差,
                                HDownOffSet: data[i].下偏差,
                                HSampleDamageQty: data[i].样本破坏数,
                                HSampleSchemeName: data[i].抽样方案名称,
                                HSampleQty: data[i].样本量,
                                HSampleDamageQty: data[i].样本破坏数,
                                HAcceptQty: data[i].允许数,
                                HInspectionLevel: 0,
                                HRejectQty: data[i].拒绝数,
                                HStrictness: 0,
                                HSampleUnRightQty: data[i].样本不合格数,
                                HAQL: data[i].AQL,
                                HSamplingType: 0,
                                HSamplingType: data[i].抽样类型,
                                HStrictness: data[i].严格度,
                                HInspectResultToSee: data[i].检验结果
                            });
                        }
                        this.hasSourceBill = true
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `加载单据失败: ${Message}`,
                        });
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `加载单据失败: ${err}`,
                    });
                }
            },
        },
        async onLoad(e) {
            this.operationType = e.operationType || 1;
            this.hform.HInterID = e.linterid || 0;
            if (this.operationType == 1) {
                await this.getMaxBillNo();
            } else if (this.operationType == 2) {
            } else if (this.operationType == 3) {
                await this.RoadBillMain();
            }
            await this.InitHSource();
            await this.InitHWorkShift();
            await this.InitHEmp();
        },
    };
</script>
<style lang="scss" scoped>
    input {
        width: inherit;
        font-size: 26rpx;
    }
    .uni-input {
        padding: 0;
    }
    .bill-main-tabs,
    .bill-sub-tabs {
        box-sizing: border-box;
        width: 730rpx;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 20rpx;
        flex-shrink: 0;
        overflow-x: auto;
        border-bottom: 1px solid #ddd;
        padding: 20rpx 10rpx;
        white-space: nowrap;
        view {
            width: auto;
            font-size: 26rpx;
            color: #555;
            text-align: center;
            padding: 16rpx 0;
        }
        .selected {
            color: #3a78ff;
            font-weight: bold;
            border-bottom: 3px solid #3a78ff;
        }
    }
    .bill-main-content,
    .bill-sub-content {
        box-sizing: border-box;
        padding: 0 30rpx 0 30rpx;
        display: flex;
        flex-direction: column;
        .form-item {
            width: 100%;
            display: flex;
            align-items: center;
            font-size: 26rpx;
            padding: 6rpx 0;
            .left {
                width: 208rpx;
                text {
                    color: red;
                    font-weight: bold;
                }
            }
            .right {
                // width: 450rpx;
                padding: 8rpx 20rpx;
                font-size: 26rpx;
                flex: 1;
                border-radius: 22rpx;
                border: 1px solid #acacac;
                .uni-combox {
                    padding: 0;
                    height: auto;
                    .uni-input-placeholder,
                    .uni-input-input {
                        font-size: 26rpx;
                    }
                }
                .uni-combox::v-deep input {
                    height: inherit;
                    font-size: 26rpx;
                }
            }
            .disabled {
                border: 1px solid #e4e4e4;
                background-color: #e4e4e4;
            }
            .none-border {
                border: none;
            }
        }
    }
    .bottom-btn {
        box-sizing: border-box;
        width: 100%;
        height: 120rpx;
        position: fixed;
        bottom: 0;
        left: 0;
        background-color: #fff;
        box-shadow: 0 2rpx 10rpx 2rpx rgba(0, 0, 0, 0.4);
        padding: 30rpx 40rpx 40rpx 40rpx;
        display: flex;
        flex-direction: row;
        gap: 10rpx;
        button {
            border-radius: 50rpx;
            width: 180rpx;
            height: 66rpx;
            line-height: 66rpx;
            font-size: 28rpx;
        }
        .btn-a {
            background-color: #3a78ff;
            color: #fff;
        }
        .btn-b {
            background-color: #41a863;
            color: #fff;
        }
        .btn-c {
            background-color: #acacac;
            color: #fff;
            // position: absolute;
            // right: 120rpx;
        }
        .btn-d {
            background-color: #ff8901;
            color: #fff;
        }
    }
    .buttons {
        box-sizing: border-box;
        width: 100%;
        display: flex;
        justify-content: center;
        padding: 10rpx 0;
        button {
            border-radius: 50rpx;
            width: 180rpx;
            height: 66rpx;
            line-height: 66rpx;
            font-size: 26rpx;
        }
        .btn-a {
            background-color: #acacac;
            color: #fff;
        }
        .btn-b {
            background-color: #41a863;
            color: #fff;
        }
        .btn-c {
            background-color: #3a78ff;
            color: #fff;
        }
    }
    .list {
        width: 100%;
        .card-detail {
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            line-height: 120%;
            gap: 10rpx 0;
            input {
                font-size: 26rpx;
            }
            .detail {
                // width: 50%;
                box-sizing: border-box;
                font-size: 26rpx;
                color: #555;
                padding-right: 20rpx;
                text {
                    color: #999;
                    font-size: 26rpx;
                }
            }
            .editable {
                width: 50%;
                display: inline-flex;
                flex-direction: row;
                align-items: center;
                text {
                    flex-shrink: 0;
                }
                .editable-input {
                    border: 1px solid #acacac;
                    border-radius: 5rpx;
                    padding: 0 12rpx;
                }
            }
        }
    }
    .icon-wrapper {
        background-color: #3a78ff;
        border-radius: 100%;
        width: 40rpx;
        height: 40rpx;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
        .uni-icons {
            color: #fff !important;
        }
    }
    .icon-wrapper-big {
        background-color: #3a78ff;
        border-radius: 100%;
        width: 50rpx;
        height: 50rpx;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
        margin-left: 20rpx;
        .uni-icons {
            color: #fff !important;
        }
    }
    .more {
        color: #888;
        font-size: 22rpx;
        display: flex;
        border-top: 1px solid #eee;
        padding-top: 10rpx;
        .part {
            width: 100%;
            text-align: center;
        }
    }
    .pass-background {
        background-color: #cee3f2;
        border: none;
    }
    .unpass-background {
        background-color: #f0d6e3;
        border: none;
    }
</style>
pages/index/tab2.vue
@@ -437,6 +437,13 @@
                        "url": "/pages/JIAOYAN/shengchanrukujiaoyan/QC_LastPieceCheckBill_v2",
                        "id": 53,
                        "hidden": false
                    },
                    {
                        "img": "../../static/icon/icon8.png",
                        "text": "出厂校验单",
                        "url": "/pages/JIAOYAN/chuchangjiaoyandan/QC_OutCompCheckBill",
                        "id": 54,
                        "hidden": false
                    }
                    
                ]