南骏 池
2025-04-11 0bb1834b9755eaf7c67d25cd9012be2ca14a7efe
H5/Js/IPQC_SJ/Add.js
@@ -85,15 +85,17 @@
        },
        //针对没有上下限值的数据,只需选择合格或不合格.按钮触发
        handleQualified(isQualified) {
            if (isQualified) {
                console.log('合格操作');
            var input = "";
            if (isQualified) {
                // 执行合格相关逻辑
                 input = "OK-1";
                this.addJyzIpqc(input);
            } else {
                console.log('不合格操作');
                // 执行不合格相关逻辑
                 input = "NG-1";
                this.addJyzIpqc(input);
            }
        },
        togglePopup(index) {
            // 切换指定索引的 popup 状态
            var that = this;
@@ -109,14 +111,6 @@
            }, true, 1).then(function (res1) {
                if (res1.rtnCode == 1) {
                    that.tableMxData = res1.rtnData;
                    // 统计合格数和不合格数
                    const list = res1.rtnData?.list || []; // 确保 list 是数组,避免 undefined 错误
                    const okNum = list.filter(item => item.fstand === '√').length;
                    const ngNum = list.length - okNum;
                    // 将结果保存到指定变量(如 that 的成员属性)
                    that.okNum = okNum;
                    that.ngNum = ngNum;
                } else {
                    that.$toast.fail(res1.rtnMsg);
@@ -125,105 +119,34 @@
                that.$toast.fail("网络错误,请重试!");
                console.log(error);
            });
        },
        getInputOK() {
            var that = this;
            var jys = that.tableData[that.tabActive].checkQyt;//检验项目的检验数
            if (!that.okValue) {
                this.$toast.fail("OK数不能为空");
                that.isLoading = false;
                return;
            }
            if (jys < that.okValue) {
                that.$toast.fail("录入数量不能大于检验数!");
                that.okValue = null;
                //that.$refs.okValue.focus();
                return;
            }
            // 切换指定索引的 popup 状态
            var resultValue = "OK-" + this.okValue;
            this.getInput(resultValue);
            that.okValue = null;
        },
        getInputNG() {
            var that = this;
            var jys = that.tableData[that.tabActive].checkQyt;//检验项目的检验数
            if (!that.ngValue) {
                this.$toast.fail("NG数不能为空");
                that.isLoading = false;
                return;
            }
            if (jys < that.ngValue) {
                that.$toast.fail("录入数量不能大于检验数!");
                that.ngValue = null;
                //that.$refs.ngValue.focus();
                return;
            }
            // 切换指定索引的 popup 状态
            var resultValue = "NG-" + this.ngValue;
            this.getInput(resultValue);
            that.ngValue = null;
        },
        getInput(resultValue) {
            // 切换指定索引的 popup 状态
            var that = this;
            var guid1 = that.formData.guid;//主表id
            var mxguid = that.tableData[that.tabActive].guid;//检验项目的guid
            that.isLoading = true;
            console.log(that.formData);
            var input = resultValue;//拼接检验值
            that.AxiosHttp("post", 'MesQaItemsDetect01Manager/EdtModel12', {
                inOrderGuid1: guid1,
                inOrderGuid5: mxguid,
                inP1: input,//或者0k-19,或者ng-19
            }, true, 1).then(function (res1) {
                if (res1.rtnCode == 1) {
                    that.$notify({
                        type: 'success', message: res1.rtnMsg
                    });
                    that.refreshJYItem();//刷新检验项目
                    //that.tableData = null;
                    //that.$refs.inputValue.focus();
                } else {
                    that.$toast.fail(res1.rtnMsg);
                }
                that.isLoading = false;
            }).catch(function (error) {
                that.$toast.fail("网络错误,请重试!");
                that.isLoading = false;
            });
        },
        getInputTZZ() {
        getInputJYZ() {
            // 切换指定索引的 popup 状态
            var that = this;
            if (!that.inputValue) {
                this.$toast.fail("特征值不能为空");
                this.$toast.fail("检验值不能为空");
                that.isLoading = false;
                return;
            }
            that.addJyzIpqc(that.inputValue);
        },
        addJyzIpqc(input) {
            var that = this;
            var guid1 = that.formData.guid;//主表id
            var mxguid = that.tableData[that.tabActive].guid;//检验项目的guid
            var input = that.inputValue;
            that.isLoading = true;
            that.AxiosHttp("post", 'MesQaItemsDetect01Manager/EditYangLi', {
                dt05Guid: mxguid,
                fSeq : "pda",
                fVal : input,
            that.AxiosHttp("post", 'PqcManager/AddIpqcJyz', {
                inOrderGuid1: guid1,
                inOrderGuid5: mxguid,
                inP1: input,//或者0k-19,或者ng-19,或实际检验值
            }, true, 1).then(function (res1) {
                if (res1.rtnData.outSum == 1) {
                if (res1.rtnCode > 0) {
                    that.$notify({
                        type: 'success', message: res1.rtnMsg
                    });
                    that.okValue = null;
                    that.refreshJYItem();//刷新检验项目
                    //that.handleTabClick();//刷新检验明细面板
                    //that.$refs.inputValue.focus();
@@ -361,21 +284,26 @@
        updateRemarks(guid) {
            this.showDialog= true
        },
        deleteDetail13(guid13) {
        deleteDetail13(guid12) {
            const that = this;
            var guid1 = that.formData.guid;//主表id
            var mxguid = that.tableData[that.tabActive].guid;//检验项目的guid
            // 添加确认弹窗
            that.$dialog.confirm({
                message: '确认要删除该样本值记录吗?',
                message: '确认要删除该检验值记录吗?',
                confirmButtonText: '确认',
                cancelButtonText: '取消'
            }).then(() => {  // 确认回调
                that.isLoading = true;
                that.AxiosHttp("post", 'Llj/deleteDetail13', {
                    id13: guid13
                }, true, 0).then(res1 => {
                    if (res1.status == 0) {
                        that.$notify({ type: 'success', message: '删除成功' });
                that.AxiosHttp("post", 'PqcManager/DeleteIpqcJyz', {
                    inOrderGuid1: guid1,
                    inOrderGuid5: mxguid,
                    inOrderGuid12: guid12
                }, true, 1).then(res1 => {
                    if (res1.rtnCode > 0) {
                        that.$notify({
                            type: 'success', message: res1.rtnMsg
                        });
                        that.refreshJYItem();//刷新检验项目
                    } else {
                        that.$toast.fail(res1.rtnMsg);