南骏 池
2025-06-02 2f1f5f0c98b8495127ec7b6823906d525bf19e4b
H5/Js/IPQC_SJ/Add.js
@@ -29,15 +29,20 @@
            ],//水温选项
            flowOptions: [
                { value: '50ml', text: '50ml' },
                { value: '100ml', text: '100ml' },
                { value: '120ml', text: '120ml' },
                { value: '150ml', text: '150ml' },
                { value: '160ml', text: '160ml' },
                { value: '200ml', text: '200ml' },
                { value: '250ml', text: '250ml' },
                { value: '260ml', text: '260ml' },
                { value: '300ml', text: '300ml' },
                { value: '350ml', text: '350ml' },
                { value: '360ml', text: '360ml' },
                { value: '450ml', text: '450ml' },
                { value: '500ml', text: '500ml' },
                { value: '550ml', text: '550ml' },
                { value: '600ml', text: '600ml' },
                { value: '750ml', text: '750ml' },
                { value: '999ml', text: '999ml' },
                { value: '一分钟流量', text: '一分钟流量' },
@@ -109,6 +114,8 @@
            //认证信息选择
            showRzxx: false,
            actions: [],
            selectedRzxx: [], // 存储多选值
            rzxxOptions: [], // 认证信息选项
        }
    },
    mounted() {
@@ -403,6 +410,30 @@
                pid: mxguid,
                inRzxxValue: that.rzxxValue,//输入的认证信息
            }, true, 0).then(function (res) {
                var json = res;
                if (json.status == 0) {
                    that.$notify({ type: 'success', message: '输入成功' });
                    //that.refreshJYItem();//刷新检验项目
                }
                else {
                    that.$toast.fail(json.message);
                }
                //that.$notify({ type: 'success', message: json.message });
                that.isLoading = false;
            }).catch(function (error) {
                that.$toast.fail("网络错误,请重试!");
                that.inRzxxValue = null;
                that.isLoading = false;
            });
        },
        // 修改原rzxxConfirm方法
        updateRzxxToServer(selectedValues) {
            var that = this;
            that.AxiosHttp("post", 'Ipqc/updateIpqcRzxx', {
            gid: that.formData.guid,
            pid: that.tableData[that.tabActive].guid,
            inRzxxValue: that.jymxData.ipqcrzxx  // 改为数组格式
            }).then(res => {
                var json = res;
                if (json.status == 0) {
                    that.$notify({ type: 'success', message: '输入成功' });
@@ -722,6 +753,7 @@
        //获取认证信息相关列表
        getRzxxList() {
            var that = this;
            that.rzxxOptions = [];
            that.isLoading = true;
            var mxguid = that.tableData[that.tabActive].guid;//检验项目的guid
            that.AxiosHttp("post", 'Ipqc/GetRzxxList', {
@@ -730,9 +762,13 @@
            }, false)
            .then(function (res) {
                if (res.status == 0) {
                    that.actions = res.data.tbBillList.map(item => {
                        return { name: item.defect_name } // 根据实际数据结构调整
                    });
                    // that.actions = res.data.tbBillList.map(item => {
                    //     return { name: item.defect_name } // 根据实际数据结构调整
                    // });
                    that.rzxxOptions = res.data.tbBillList.map(item => ({
                        value: item.defect_name, // 假设guid是唯一标识符
                        text: item.defect_name // 认证信息名称
                    }));
                } else {
                    that.$toast.fail(res.message);
                }
@@ -743,6 +779,20 @@
                that.$toast.fail("获取认证信息失败");
            });
        },
        // 新增确认多选方法
        confirmMultiRzxx() {
            const selectedTexts = this.rzxxOptions
            .filter(item => this.selectedRzxx.includes(item.value))
            .map(item => item.text);
            // 修改这里:用换行符替代逗号分隔
            this.jymxData.ipqcrzxx = selectedTexts.join('\n');
            this.showRzxx = false;
            // 更新多选值到后端
            this.updateRzxxToServer(selectedTexts);
        },
        //选择认证信息
        onRzxxSelect(item) {
            this.showRzxx = false;