llj
2025-11-20 2129f5b77f552a55f448fbc076ffa2a4c31ef537
生产入库校验单
2个文件已修改
216 ■■■■■ 已修改文件
components/ZLGL/InspectValueTemplate.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/JIAOYAN/shengchanrukujiaoyan/QC_LastPieceCheckBill_v2.vue 211 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/ZLGL/InspectValueTemplate.vue
@@ -45,7 +45,7 @@
                        {{ checkData.HStatus?"合格":"不合格" }}
                    </view>
                    <view>
                        <switch style="width: 2em; transform:scale(0.7);" :checked="checkData.HStatus"
                        <switch style="width: 2em; transform:scale(0.7);" :checked="!!checkData.HStatus"
                            @change="HStatusChange" />
                    </view>
                </view>
@@ -399,6 +399,7 @@
            },
            async set_SaveValue() {
                await this.$nextTick();
                console.log("InSpect Values: ", this.InSpectValues)
                try {
                    let res = await CommonUtils.doRequest2Sync({
@@ -409,7 +410,7 @@
                        method: "POST"
                    })
                    if (res) {
                    if (!res) {
                        return
                    }
                    let {
pages/JIAOYAN/shengchanrukujiaoyan/QC_LastPieceCheckBill_v2.vue
@@ -27,16 +27,7 @@
                            </uni-datetime-picker>
                        </view>
                    </view>
                    <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">
                        <view class="left">源单单号</view>
                        <view class="right" :class="!hasSourceBill?'':'disabled'">
@@ -113,12 +104,7 @@
                        <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">
                            <input type="text" value="" />
                        </view>
                    </view>
                    <view class="form-item">
                        <view class="left">判断结论</view>
                        <view class="right none-border">
@@ -143,15 +129,20 @@
                        <view class="icon-wrapper-big"><uni-icons type="search" size="20"
                                @click="showSelectorModule(hform, 8)"></uni-icons></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 == 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">
@@ -177,6 +168,18 @@
                            <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">
@@ -309,9 +312,12 @@
                                <view class="detail" v-if="checkItem.HUnit">
                                    <text>单位:</text>{{ checkItem.HUnit }}
                                </view>
                                <view class="detail" v-if="checkItem.HQCStd">
                                    <text>检验值:</text>{{ checkItem.HQCStd }}
                                 <!-- 只有定量分析才启用检验值 -->
                                <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>
@@ -388,7 +394,7 @@
                                </view>
                                <view class="detail editable">
                                    <text>样本破坏数:</text>
                                    <view class="sampleDestory">
                                    <view class="editable-input">
                                        <input type="number" v-model="SamplingItem.HSampleDamageQty" />
                                    </view>
                                </view>
@@ -563,7 +569,7 @@
                ],
                // 主表属性
                hform: {
                    HSourceBillType: "3790",
                    HSourceBillType: "3711",
                    HSourceBillNo: "",
                    HBillNo: "",
                    HInterID: "0",
@@ -625,6 +631,21 @@
            };
        },
        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];
@@ -640,9 +661,9 @@
            async getSourceBillInfo(HBarCode) {
                console.log('HBarCode: ', HBarCode);
                // 根据单据类型,调用不同的下推函数
                if (this.hform.HSourceBillType == 3790) {
                if (this.hform.HSourceBillType == 3711) {
                    // 工序进站接收单列表首检
                    await this.LoadingInformation_StationInBill(HBarCode);
                    await this.LoadingInformation_ICMOReportBill(HBarCode);
                    if (
                        (uni.getStorageSync("OrganizationID") == "7667152" &&
                            uni.getStorageSync("Organization") == "CMR Technology Mexico S.A. de C.V.") ||
@@ -653,6 +674,19 @@
                    }
                    return;
                }
                // if (this.hform.HSourceBillType == 3790) {
                //     // 工序进站接收单列表首检
                //     await this.LoadingInformation_StationInBill(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 == 3793) {
                    // 工序委外接收单列表首检
                    await this.LoadingInformation_StationEntrustOutBill(HBarCode);
@@ -792,6 +826,7 @@
                // 生产订单
                try {
                    let sWhere="and 单据号='"+HBarCode+"'"
                    console.log(sWhere)
                    let res = await CommonUtils.doRequest2Async({
                        url: "/LEMS/MES_IF_ICMOBillList_Json",
                        data: {
@@ -824,6 +859,7 @@
                    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].单据类型;
@@ -832,8 +868,8 @@
                    this.hform.HQCSchemeName = data[0].检验方案名称;
                    this.hform.HQCSchemeID = data[0].检验方案ID;
                    this.hform.HProcName = data[0].当前工序;
                    //this.hasSourceBill = true
                    //this.get_CheckItem();
                    this.hasSourceBill = true
                    this.get_CheckItem();
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
@@ -894,62 +930,61 @@
            },
            //#endregion
            
            // async LoadingInformation_StationInBill(HBarCode) {
            //     // 进站接收单
            //     try {
            //         let res = await CommonUtils.doRequest2Async({
            //             url: "/QC_FirstPieceCheckBill/get_StationInBill_ByHBillNo",
            //             data: {
            //                 HBillNo: HBarCode,
            //                 user: getUserInfo()["Czymc"],
            //             },
            //         });
            async LoadingInformation_ICMOReportBill(HBarCode) {
                // 生产汇报单
                try {
                    let res = await CommonUtils.doRequest2Async({
                        url: "/QC_LastPieceCheckBill/get_ICMOReportBill_Tmp_getByBillNo",
                        data: {
                            HBillNo: HBarCode,
                            user: getUserInfo()["Czymc"],
                        },
                    });
            //         let {
            //             count,
            //             Message,
            //             data
            //         } = res.data;
                    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].HICMOInterID;
            //         this.hform.HICMOQty = data[0].HICMOQty;
            //         this.hform.HSourceName = data[0].生产资源;
            //         this.hform.HSourceID = data[0].HSourceID;
            //         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].当前工序;
                    if (count != 1) {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `获取生产汇报单 错误: ${Message}`,
                        });
                        return;
                    }
                    //change_inlife
                    this.hform.HMainSourceEntryID=data[0].HEntryID||1;
                    this.hform.HMaterNumber=data[0].HMaterNumber;
                    this.hform.HICMOBillNo = data[0].HICMOBillNo;
                    this.hform.HICMOInterID = data[0].HICMOInterID;
                    this.hform.HICMOQty = data[0].HICMOQty;
                    this.hform.HSourceName = data[0].HSourceName;
                    this.hform.HSourceID = data[0].HSourceID;
                    this.hform.HMaterID = data[0].HMaterID;
                    this.hform.HMaterName = data[0].HMaterName;
                    this.hform.HMainSourceBillNo = data[0].HBillNo;
                    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;
            //         for (let i = 0; i < data.length; i++) {
            //             this.addCheckItem(data[i])
            //         }
                    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}`,
            //         });
            //     }
            // },
                    this.hasSourceBill = true
                    this.get_CheckItem();
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `获取生产汇报单 错误: ${err}`,
                    });
                }
            },
            // 检验员初始化
            async InitHEmp() {
                try {
@@ -1493,7 +1528,7 @@
            },
            setInspectValModule(checkItem) {
                console.log("checkItem: ", checkItem);
                if (!checkItem.HAnalysisMethod || !checkItem.HSampleSchemeID) {
                if (!checkItem || !checkItem.HAnalysisMethod || !checkItem.HSampleSchemeID) {
                    return;
                }
                // 区分检验值页签和静态页签,检验值页签的id以_开头
@@ -1748,7 +1783,7 @@
                    console.log("this.checkItems: ", this.checkItems);
                    let res = await CommonUtils.doRequest2Sync({
                        url: "/QC_FirstPieceCheckBill/set_SaveBill",
                        url: "/QC_LastPieceCheckBill/set_SaveBill",
                        data: {
                            sMainSub: sMainSub,
                        },
@@ -1772,7 +1807,7 @@
                                if (res.confirm) {
                                    console.log("用户点击确定");
                                    uni.redirectTo({
                                        url: "/pages/ZLGL/shoujianjianyan/form?operationType=1",
                                        url: "/pages/JIAOYAN/shengchanrukujiaoyan/QC_LastPieceCheckBill_v2?operationType=1",
                                    });
                                } else if (res.cancel) {
                                    console.log("用户点击取消");
@@ -1785,13 +1820,13 @@
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
                            message: `首件检验单保存错误: ${Message}`,
                            message: `生产入库校验单保存错误: ${Message}`,
                        });
                    }
                } catch (err) {
                    CommonUtils.showTips({
                        title: "温馨提示",
                        message: `首件检验单保存错误: ${err}`,
                        message: `生产入库校验单保存错误: ${err}`,
                    });
                }
            },
@@ -2192,7 +2227,7 @@
                    flex-shrink: 0;
                }
                .sampleDestory {
                .editable-input {
                    border: 1px solid #acacac;
                    border-radius: 5rpx;
                    padding: 0 12rpx;