南骏 池
2025-04-26 e7a16c7b5f2dedcc25552275f746ce276be0aef0
H5/Js/LLJ/Add.js
@@ -263,7 +263,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
@@ -280,7 +280,7 @@
                                }
                            });
                            that.tableData = tableData;
                            that.GetImageFileByGid();
                            //if (that.tableData.length === 0) {
                            //    that.isShowTable = true;
                            //}
@@ -299,13 +299,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 +316,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 +340,6 @@
            }).catch(() => {  // 取消回调
                that.$toast('已取消操作');
                that.isLoading = false;
            });
        },
        GetBack1() {
@@ -405,6 +404,7 @@
        async afterRead(file) {
            try {
                //alert(APIURL_IMAGE);
                // 1. 显示上传中状态
                file.status = 'uploading';
                file.message = '上传中...';
@@ -456,6 +456,56 @@
                // 8. 强制更新视图(Vant 3+ 可能需要)
                this.$nextTick();
            }
        }
        },
        //获取图片信息
        GetImageFileByGid() {
            const that = this;
            that.AxiosHttp("post", 'MesImage/getImage', {
                parentId: that.formData.guid,
            }, true, 0).then(res1 => {
                if (res1.status === 0) {
                    // 关键转换:将后端数据转换为 van-uploader 需要的格式
                    that.fileList = res1.data.tbBillList.map(item => ({
                        url: `${APIURL_IMAGE}/${item.urlPath}`,  // 拼接完整访问路径
                        status: 'done',          // 标记为已上传成功
                        name: item.fileTitle,    // 可选显示文件名
                        message: '已上传',        // 可选状态文字
                        // 保留原始数据(按需)
                        id: item.guid
                    }));
                } else {
                    that.$toast.fail(res1.rtnMsg);
                }
            }).catch(error => {
                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();//刷新检验项目
            })
        },
    }
})