chenhaozhe
2026-03-02 9ead1a3be09510484dc9bf77a89da81087bb80f7
pages/ZLGL/mojianjianyan/ProcessCheckBill.vue
@@ -642,6 +642,7 @@
                    HMainSourceEntryID: "1",
                    HMainSourceBillNo: "",
                    HStockOrgID: uni.getStorageSync('OrganizationID'),
                    HRemarkSN: '' // SN码记录
                },
                // 检验项目和抽样检验 值
                checkItems: {},
@@ -689,6 +690,7 @@
                });
            },
            async getSourceBillInfo(HBarCode) {
                let HBarCodeOld = HBarCode
                console.log('HBarCode: ', HBarCode);
                let res = await CommonUtils.doRequest2Async({
                    url: "/WEBSController/get_CheckBillBarCode_Json_CheckItem",
@@ -707,7 +709,8 @@
                let {
                    data,
                    Message,
                    count
                    count,
                    code
                } = res.data
                if (count == 1) {
                    if (data[0]['HBack'] == 1) {
@@ -717,57 +720,126 @@
                        })
                        return;
                    }
                    if (this.hform.HSourceBillType == "3791") { //出站单
                        this.hform.HMaterID = data[0]['HMaterID']
                        this.hform.HMaterName = data[0]['产品名称']
                        this.hform.HMaterNumber = data[0]['产品代码']
                        this.hform.HMainSourceBillNo = data[0]['单据号']
                        this.hform.HSourceBillNo = data[0]['单据号']
                        this.hform.HMainSourceInterID = data[0].HInterID
                        this.hform.HMainSourceEntryID = data[0].HEntryID
                        this.hform.HQCSchemeName = data[0].检验方案名称
                        this.hform.HQCSchemeID = data[0].检验方案ID
                        this.hform.HSourceBillQty = data[0].HSourceBillQty
                        this.hasSourceBill = true
                        this.hform.HICMOBillNo = data[0].任务单号
                        this.hform.HICMOInterID = data[0].HICMOInterID
                        this.hform.HICMOEntryID = data[0].HICMOEntryID
                        this.hform.HICMOQty = data[0].生产数量
                        this.hform.HProcExchBillNo = data[0].HProcExchBillNo
                        this.hform.HProcExchInterID = data[0].HProcExchInterID
                        this.hform.HProcExchEntryID = data[0].HProcExchEntryID
                        this.hform.HProcExchQty = data[0].流转卡数量
                        this.hform.HSourceName = data[0].生产资源
                        this.hform.HSourceID = data[0].HSourceID
                        this.hform.HProcID = data[0].HProcID
                        this.hform.HProcName = data[0].工序名称
                        this.hform.HCheckQty = data[0].出站数量
                    } else {
                        this.hform.HMaterID = data[0]['HMaterID']
                        this.hform.HMaterName = data[0]['产品名称']
                        this.hform.HMaterNumber = data[0]['产品代码']
                        this.hform.HMainSourceBillNo = data[0]['HBillNo']
                        this.hform.HSourceBillNo = data[0]['单据号']
                        this.hform.HMainSourceInterID = data[0].HInterID
                        this.hform.HMainSourceEntryID = data[0].HEntryID
                        this.hform.HQCSchemeName = data[0].检验方案名称
                        this.hform.HQCSchemeID = data[0].检验方案ID
                        this.hform.HSourceBillQty = data[0].HSourceBillQty
                        this.hasSourceBill = true
                        this.hform.HICMOBillNo = data[0].任务单号
                        this.hform.HICMOInterID = data[0].HICMOInterID
                        this.hform.HICMOEntryID = data[0].HICMOEntryID
                        this.hform.HICMOQty = data[0].生产数量
                        this.hform.HProcExchBillNo = data[0].单据号
                        this.hform.HProcExchInterID = data[0].HInterID
                        this.hform.HProcExchEntryID = data[0].HEntryID
                        this.hform.HProcExchQty = data[0].流转卡数量
                        this.hform.HSourceName = data[0].生产资源
                        this.hform.HSourceID = data[0].HSourceID
                        this.hform.HProcID = data[0].HProcID
                        this.hform.HProcName = data[0].当前工序
                    if (code == 2) {
                        // 存在已有的单据,提示是否需要继续新增
                        uni.showModal({
                            title: '温馨提示',
                            content: "此单据已生成末件检验单,是否需要继续新增",
                            confirmText: "是",
                            cancelText: "否",
                            success: (res) => {
                                if (res.confirm) {
                                    if (this.hform.HSourceBillType == "3791") { //出站单
                                        this.hform.HMaterID = data[0]['HMaterID']
                                        this.hform.HMaterName = data[0]['产品名称']
                                        this.hform.HMaterNumber = data[0]['产品代码']
                                        this.hform.HMainSourceBillNo = data[0]['单据号']
                                        this.hform.HSourceBillNo = data[0]['单据号']
                                        this.hform.HMainSourceInterID = data[0].HInterID
                                        this.hform.HMainSourceEntryID = data[0].HEntryID
                                        this.hform.HQCSchemeName = data[0].检验方案名称
                                        this.hform.HQCSchemeID = data[0].检验方案ID
                                        this.hform.HSourceBillQty = data[0].HSourceBillQty
                                        this.hasSourceBill = true
                                        this.hform.HICMOBillNo = data[0].任务单号
                                        this.hform.HICMOInterID = data[0].HICMOInterID
                                        this.hform.HICMOEntryID = data[0].HICMOEntryID
                                        this.hform.HICMOQty = data[0].生产数量
                                        this.hform.HProcExchBillNo = data[0].HProcExchBillNo
                                        this.hform.HProcExchInterID = data[0].HProcExchInterID
                                        this.hform.HProcExchEntryID = data[0].HProcExchEntryID
                                        this.hform.HProcExchQty = data[0].流转卡数量
                                        this.hform.HSourceName = data[0].生产资源
                                        this.hform.HSourceID = data[0].HSourceID
                                        this.hform.HProcID = data[0].HProcID
                                        this.hform.HProcName = data[0].工序名称
                                        this.hform.HCheckQty = data[0].出站数量
                                    } else {
                                        this.hform.HMaterID = data[0]['HMaterID']
                                        this.hform.HMaterName = data[0]['产品名称']
                                        this.hform.HMaterNumber = data[0]['产品代码']
                                        this.hform.HMainSourceBillNo = data[0]['HBillNo']
                                        this.hform.HSourceBillNo = data[0]['单据号']
                                        this.hform.HMainSourceInterID = data[0].HInterID
                                        this.hform.HMainSourceEntryID = data[0].HEntryID
                                        this.hform.HQCSchemeName = data[0].检验方案名称
                                        this.hform.HQCSchemeID = data[0].检验方案ID
                                        this.hform.HSourceBillQty = data[0].HSourceBillQty
                                        this.hasSourceBill = true
                                        this.hform.HICMOBillNo = data[0].任务单号
                                        this.hform.HICMOInterID = data[0].HICMOInterID
                                        this.hform.HICMOEntryID = data[0].HICMOEntryID
                                        this.hform.HICMOQty = data[0].生产数量
                                        this.hform.HProcExchBillNo = data[0].单据号
                                        this.hform.HProcExchInterID = data[0].HInterID
                                        this.hform.HProcExchEntryID = data[0].HEntryID
                                        this.hform.HProcExchQty = data[0].流转卡数量
                                        this.hform.HSourceName = data[0].生产资源
                                        this.hform.HSourceID = data[0].HSourceID
                                        this.hform.HProcID = data[0].HProcID
                                        this.hform.HProcName = data[0].当前工序
                                    }
                                    this.hform.HRemarkSN = HBarCodeOld // 所扫描的条码存SN字段
                                    this.get_CheckItem();
                                } else if (res.cancel) {}
                            },
                        })
                    }else {
                        if (this.hform.HSourceBillType == "3791") { //出站单
                            this.hform.HMaterID = data[0]['HMaterID']
                            this.hform.HMaterName = data[0]['产品名称']
                            this.hform.HMaterNumber = data[0]['产品代码']
                            this.hform.HMainSourceBillNo = data[0]['单据号']
                            this.hform.HSourceBillNo = data[0]['单据号']
                            this.hform.HMainSourceInterID = data[0].HInterID
                            this.hform.HMainSourceEntryID = data[0].HEntryID
                            this.hform.HQCSchemeName = data[0].检验方案名称
                            this.hform.HQCSchemeID = data[0].检验方案ID
                            this.hform.HSourceBillQty = data[0].HSourceBillQty
                            this.hasSourceBill = true
                            this.hform.HICMOBillNo = data[0].任务单号
                            this.hform.HICMOInterID = data[0].HICMOInterID
                            this.hform.HICMOEntryID = data[0].HICMOEntryID
                            this.hform.HICMOQty = data[0].生产数量
                            this.hform.HProcExchBillNo = data[0].HProcExchBillNo
                            this.hform.HProcExchInterID = data[0].HProcExchInterID
                            this.hform.HProcExchEntryID = data[0].HProcExchEntryID
                            this.hform.HProcExchQty = data[0].流转卡数量
                            this.hform.HSourceName = data[0].生产资源
                            this.hform.HSourceID = data[0].HSourceID
                            this.hform.HProcID = data[0].HProcID
                            this.hform.HProcName = data[0].工序名称
                            this.hform.HCheckQty = data[0].出站数量
                        } else {
                            this.hform.HMaterID = data[0]['HMaterID']
                            this.hform.HMaterName = data[0]['产品名称']
                            this.hform.HMaterNumber = data[0]['产品代码']
                            this.hform.HMainSourceBillNo = data[0]['HBillNo']
                            this.hform.HSourceBillNo = data[0]['单据号']
                            this.hform.HMainSourceInterID = data[0].HInterID
                            this.hform.HMainSourceEntryID = data[0].HEntryID
                            this.hform.HQCSchemeName = data[0].检验方案名称
                            this.hform.HQCSchemeID = data[0].检验方案ID
                            this.hform.HSourceBillQty = data[0].HSourceBillQty
                            this.hasSourceBill = true
                            this.hform.HICMOBillNo = data[0].任务单号
                            this.hform.HICMOInterID = data[0].HICMOInterID
                            this.hform.HICMOEntryID = data[0].HICMOEntryID
                            this.hform.HICMOQty = data[0].生产数量
                            this.hform.HProcExchBillNo = data[0].单据号
                            this.hform.HProcExchInterID = data[0].HInterID
                            this.hform.HProcExchEntryID = data[0].HEntryID
                            this.hform.HProcExchQty = data[0].流转卡数量
                            this.hform.HSourceName = data[0].生产资源
                            this.hform.HSourceID = data[0].HSourceID
                            this.hform.HProcID = data[0].HProcID
                            this.hform.HProcName = data[0].当前工序
                        }
                        this.hform.HRemarkSN = HBarCodeOld // 所扫描的条码存SN字段
                        this.get_CheckItem();
                    }
                    this.get_CheckItem();
                } else {
                    CommonUtils.showTips({
                        title: '温馨提示',
@@ -1177,7 +1249,7 @@
                    let res = await CommonUtils.doRequest2Async({
                        url: "/Gy_Employee/list",
                        data: {
                            sWhere: ` and 组织名称 = '${uni.getStorageSync("Organization")}' and 禁用标记 = ''and 审核人 !='' `,
                            sWhere: ` and 组织名称 = '${uni.getStorageSync("Organization")}' and 禁用标记 = ''and 审核人 !=''  and HDeptID = ${uni.getStorageSync("HDeptID")}`,
                            user: getUserInfo()["Czymc"],
                            Organization: uni.getStorageSync("Organization"),
                        },
@@ -1951,6 +2023,22 @@
                return true;
            },
            async auditBill() {
                let res = await CommonUtils.doRequest2Async({
                    url: "/QC_ProcessCheckBill/QC_ProcessCheckBillMainValue",
                    data: {
                        HInterID: this.hform.HInterID,
                        IsAudit: 0,
                        CurUserName: getUserInfo()['Czymc']
                    }
                })
                if (res.data.count == 1) {
                    return true
                } else {
                    return false
                }
            },
            async submit() {
                if (!this.checkSubmitValidate()) {
                    return;
@@ -1982,7 +2070,8 @@
                        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({
@@ -2000,26 +2089,58 @@
                    let {
                        count,
                        Message,
                        data
                        data,
                        Verify = 'N'
                    } = res.data;
                    if (count == 1) {
                        uni.showModal({
                            title: "提示",
                            content: res.data.Message + "。是否继续新增?",
                            success: (res) => {
                                if (res.confirm) {
                                    console.log("用户点击确定");
                                    uni.redirectTo({
                                        url: "/pages/ZLGL/mojianjianyan/ProcessCheckBill?operationType=1",
                                    });
                                } else if (res.cancel) {
                                    console.log("用户点击取消");
                                    setTimeout(() => {
                                        uni.navigateBack();
                                    }, 50)
                                }
                            },
                        });
                        // 判断是否自动审核
                        if (Verify == 'Y') {
                            let AuditSuccess = await this.auditBill()
                            if (AuditSuccess) {
                                console.log("审核成功");
                                uni.showModal({
                                    title: "提示",
                                    content: res.data.Message + "。是否继续新增?",
                                    success: (res) => {
                                        if (res.confirm) {
                                            console.log("用户点击确定");
                                            uni.redirectTo({
                                                url: "/pages/ZLGL/mojianjianyan/ProcessCheckBill?operationType=1",
                                            });
                                        } else if (res.cancel) {
                                            console.log("用户点击取消");
                                            setTimeout(() => {
                                                uni.navigateBack();
                                            }, 50)
                                        }
                                    },
                                });
                            } else {
                                uni.showToast({
                                    icon: 'none',
                                    title: '审核失败'
                                })
                            }
                        } else {
                            uni.showModal({
                                title: "提示",
                                content: res.data.Message + "。是否继续新增?",
                                success: (res) => {
                                    if (res.confirm) {
                                        console.log("用户点击确定");
                                        uni.redirectTo({
                                            url: "/pages/ZLGL/mojianjianyan/ProcessCheckBill?operationType=1",
                                        });
                                    } else if (res.cancel) {
                                        console.log("用户点击取消");
                                        setTimeout(() => {
                                            uni.navigateBack();
                                        }, 50)
                                    }
                                },
                            });
                        }
                    } else {
                        CommonUtils.showTips({
                            title: "温馨提示",
@@ -2250,13 +2371,28 @@
                    });
                }
            },
            // 设置为自动
            setAuto() {
                if (uni.getSystemInfoSync().platform === 'android' ||
                    uni.getSystemInfoSync().platform === 'ios') {
                    plus.screen.unlockOrientation();
                }
            },
            // 设置为竖屏
            setPortrait() {
                if (uni.getSystemInfoSync().platform === 'android' ||
                    uni.getSystemInfoSync().platform === 'ios') {
                    plus.screen.lockOrientation('portrait');
                }
            },
        },
        async onLoad(e) {
            // this.setAuto();
            this.operationType = e.operationType || 1;
            this.hform.HInterID = e.linterid || 0;
            if (this.operationType == 1) {
                await this.getMaxBillNo();
                if (uni.getStorageSync('Organization') == "宁波市华舟包装有限公司") {
                    this.HSourceBillType = "工序出站汇报单"; // 显示名称
                    this.hform.HSourceBillType = "3791"; // 对应的值
@@ -2285,13 +2421,16 @@
            await this.InitHEmp();
            await this.loadCache();
        },
        onUnload() {
            this.setPortrait();
        }
    };
</script>
<style lang="scss" scoped>
    input {
        width: inherit;
        font-size: 26rpx;
        font-size: 30rpx;
    }
    .uni-input {
@@ -2314,7 +2453,7 @@
        view {
            width: auto;
            font-size: 26rpx;
            font-size: 30rpx;
            color: #555;
            text-align: center;
            padding: 16rpx 0;
@@ -2327,19 +2466,24 @@
        }
    }
    .bill-main-content,
    .bill-sub-content {
    .bill-main-content {
        box-sizing: border-box;
        padding: 0 30rpx 0 30rpx;
        display: flex;
        flex-direction: column;
        flex-direction: row;
        flex-wrap: wrap;
        /* 超出自动换行 */
        /* 可选:设置换行后的对齐方式 */
        align-content: flex-start;
        /* 多行对齐方式 */
        .form-item {
            width: 100%;
            width: 650rpx;
            display: flex;
            align-items: center;
            font-size: 26rpx;
            font-size: 30rpx;
            padding: 6rpx 0;
            margin-right: 20rpx;
            .left {
                width: 208rpx;
@@ -2353,7 +2497,7 @@
            .right {
                // width: 450rpx;
                padding: 8rpx 20rpx;
                font-size: 26rpx;
                font-size: 30rpx;
                flex: 1;
                border-radius: 22rpx;
                border: 1px solid #acacac;
@@ -2364,14 +2508,21 @@
                    .uni-input-placeholder,
                    .uni-input-input {
                        font-size: 26rpx;
                        font-size: 30rpx;
                    }
                }
                .uni-combox::v-deep input {
                    height: inherit;
                    font-size: 26rpx;
                    font-size: 30rpx;
                }
            }
            .right-select {
                //padding: 8rpx 20rpx;
                font-size: 30rpx;
                flex: 1;
            }
            .disabled {
@@ -2442,7 +2593,7 @@
            width: 180rpx;
            height: 66rpx;
            line-height: 66rpx;
            font-size: 26rpx;
            font-size: 30rpx;
        }
        .btn-a {
@@ -2461,32 +2612,43 @@
        }
    }
    ::v-deep .uni-card {
        flex: 500rpx;
    }
    .list {
        width: 100%;
        display: flex;
        /* 添加flex布局 */
        flex-wrap: wrap;
        /* 允许换行 */
        gap: 20rpx;
        /* 设置卡片间距 */
        .card-detail {
            width: 100%;
            width: 500rpx;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            line-height: 120%;
            padding: 20rpx 10rpx;
            gap: 10rpx 0;
            input {
                font-size: 26rpx;
                font-size: 30rpx;
            }
            .detail {
                // width: 50%;
                box-sizing: border-box;
                font-size: 26rpx;
                font-size: 30rpx;
                color: #555;
                padding-right: 20rpx;
                text {
                    color: #999;
                    font-size: 26rpx;
                    font-size: 30rpx;
                }
            }
@@ -2498,12 +2660,6 @@
                text {
                    flex-shrink: 0;
                }
                .sampleDestory {
                    border: 1px solid #acacac;
                    border-radius: 10%;
                    padding: 0 12rpx;
                }
                .editable-input {