南骏 池
2025-07-16 171e6dc39bb085184c0e0989b7b37b129c59e6ac
H5/Js/LLJ/Add.js
@@ -40,6 +40,8 @@
            okValue: '',//OK-数量
            ngValue: '',//NG-数量
            showDialog: false,//不良表述输入框
            ybsDialog: false,//样本值输入框
            ybsValue: '',//样本数量
            //图片上传框
            fileList: [
                //{
@@ -82,6 +84,11 @@
            this.inputValue = value.replace(/[^\d.]/g, '')  // 1. 去除非数字和小数点
                .replace(/(\..*)\./g, '$1')               // 2. 禁止多个小数点
                .replace(/^\./g, '');    
        },
        handleNumberInput4(value) {
            // 去除非数字并确保首位不为0(除非是单独的0)
            this.jymxData.ybsl = value.replace(/[^\d]/g, '') // 去除非数字字符
                .replace(/^0+(?!$)/, ''); // 去除开头的0,除非整个字符串是0
        },
        togglePopup(index) {
@@ -263,7 +270,7 @@
                    let data = res.data.tbBillList[0];
                    if (data) {
                        that.formData = data;
                        that.remarks = that.formData.remarks;
                        that.remarks = that.formData.fngDesc;
                        that.AxiosHttp("post", 'LLJ/getJYItem', {
                            //id: that.formData.guid,
                            releaseNo: that.formData.releaseNo
@@ -299,13 +306,13 @@
            var that = this;
            that.ttrre = true;
            that.AxiosHttp("post", 'MesQaItemsDetect01Manager/EditModelSubmit', {
                id13: that.formData.guid
                guid: that.formData.guid
            }, true, 1).then(function (res1) {
                if (res1.rtnCode == 1) {
                if (res1.rtnData.outSum == 1) {
                    that.$notify({ type: 'success', message: '提交成功' });
                    that.init();
                } else {
                    that.$toast.fail(res1.rtnMsg);
                    that.$toast.fail(res1.rtnData.outMsg);
                }
                that.ttrre = false
            }).catch(function (error) {
@@ -316,13 +323,13 @@
        },
        removeXJ() {
            const that = this;
            that.isLoading = true;
            // 添加确认弹窗
            that.$dialog.confirm({
                message: '确认要重新加载检验项目吗?',
                confirmButtonText: '确认',
                cancelButtonText: '取消'
            }).then(() => {  // 确认回调
                that.isLoading = true;
                that.AxiosHttp("post", 'MesQaItemsDetect01Manager/ReloadModel5', {
                    guid: that.formData.guid
                }, true, 1).then(res1 => {
@@ -340,7 +347,6 @@
            }).catch(() => {  // 取消回调
                that.$toast('已取消操作');
                that.isLoading = false;
            });
        },
        GetBack1() {
@@ -352,6 +358,40 @@
        updateRemarks(guid) {
            this.showDialog= true
        },
        EditYangLi(GUID) {
            // 切换指定索引的 popup 状态
            var that = this;
            if (!that.jymxData.ybsl) {
                this.$toast.fail("样本数不能为空");
                that.isLoading = false;
                return;
            }
            var mxguid = that.tableData[that.tabActive].guid;//检验项目的guid
            var input = that.jymxData.ybsl;
            that.isLoading = true;
            that.AxiosHttp("post", 'MesQaItemsDetect01Manager/EditYangLi', {
                dt05Guid: mxguid,
                fSeq: "样本数",
                fVal: input,
            }, true, 1).then(function (res1) {
                if (res1.rtnData.outSum == 1) {
                    that.$notify({
                        type: 'success', message: res1.rtnMsg
                    });
                    that.okValue = null;
                    that.refreshJYItem();//刷新检验项目
                } else {
                    that.$toast.fail(res1.rtnMsg);
                }
                that.isLoading = false;
            }).catch(function (error) {
                that.$toast.fail("网络错误,请重试!");
                that.isLoading = false;
            });
        },
        deleteDetail13(guid13) {
            const that = this;
            
@@ -461,9 +501,8 @@
        //获取图片信息
        GetImageFileByGid() {
            const that = this;
            that.AxiosHttp("post", 'Llj/getImage', {
                gid: that.formData.guid,
                Remarks: that.remarks
            that.AxiosHttp("post", 'MesImage/getImage', {
                parentId: that.formData.guid,
            }, true, 0).then(res1 => {
                if (res1.status === 0) {
                    // 关键转换:将后端数据转换为 van-uploader 需要的格式
@@ -482,5 +521,32 @@
                that.$toast.fail("网络错误,请重试!");
            });
        },
        handleDelete(file, { index }) {
            var that = this;
            that.$dialog.confirm({
                title: '确认删除',
                message: '确定要删除这张图片吗?'
            }).then(() => {
                // 确认删除逻辑
                console.log(file);
                that.AxiosHttp("post", 'MesImage/deleteImage', {
                    id: file.id,
                }, true, 0).then(res1 => {
                    if (res1.status === 0) {
                        that.$notify({ type: 'success', message: '删除成功' });
                    } else {
                        that.$toast.fail(res1.rtnMsg);
                    }
                    that.init();//刷新检验项目
                }).catch(error => {
                    that.$toast.fail("网络错误,请重试!");
                });
            }).catch(() => {
                // 取消操作
                that.init();//刷新检验项目
            })
        },
    }
})