南骏 池
2025-03-21 078c3e3d1fe34e1cc481f05495011b06a66f800a
1.删除特征值按钮
2.image
已修改2个文件
261 ■■■■ 文件已修改
H5/Js/LLJ/Add.js 194 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/LLJ/Add.aspx 67 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Js/LLJ/Add.js
@@ -27,18 +27,32 @@
            isShowTable: false,
            tableData: [],//返回的检验项目
            jymxData: [],//展示的检验项目
            remarks:'',//不合格描述
            okNum:'',//合格数
            ngNum: '',//不合格数
            ttrre: false,
            show: false,
            show: false,//明细面板
            tableMxData: [],
            tabActive: 0,
            inputValue: '',//特征值输入
            resultValue: '',//检验结果录入
            showButton: false,//右上角菜单触发
            okValue: '',//OK-数量
            ngValue: ''//NG-数量
            ngValue: '',//NG-数量
            showDialog: false,//不良表述输入框
            //图片上传框
            fileList: [
                //{
                //    url: 'https://img01.yzcdn.cn/vant/leaf.jpg',
                //    status: 'uploading',
                //    message: '上传中...',
                //},
                //{
                //    url: 'https://img01.yzcdn.cn/vant/tree.jpg',
                //    status: 'failed',
                //    message: '上传失败',
                //},
            ],
        }
    },
    mounted() {
@@ -108,6 +122,13 @@
        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;
@@ -122,6 +143,12 @@
        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;
@@ -139,7 +166,7 @@
            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', {
@@ -157,17 +184,26 @@
                } else {
                    that.$toast.fail(res1.rtnMsg);
                }
                that.isLoading = false;
            }).catch(function (error) {
                that.$toast.fail("网络错误,请重试!");
                console.log(error);
                that.isLoading = false;
            });
        },
        getInputTZZ() {
            // 切换指定索引的 popup 状态
            var that = this;
            if (!that.inputValue) {
                this.$toast.fail("特征值不能为空");
                that.isLoading = false;
                return;
            }
            var mxguid = that.tableData[that.tabActive].guid;//检验项目的guid
            var input = that.inputValue;
            that.isLoading = true;
            that.AxiosHttp("post", 'MesQaItemsDetect01Manager/EditYangLi', {
                dt05Guid: mxguid,
                fSeq : "pda",
@@ -186,9 +222,11 @@
                    that.$toast.fail(res1.rtnMsg);
                    that.inputValue = null;
                }
                that.isLoading = false;
            }).catch(function (error) {
                that.$toast.fail("网络错误,请重试!");
                that.inputValue = null;
                that.isLoading = false;
            });
        },
@@ -213,7 +251,6 @@
        //主页面加载
        init() {
            //alert(this.Request("id"));
            var that = this;
            that.showButton = false;
@@ -226,7 +263,7 @@
                    let data = res.data.tbBillList[0];
                    if (data) {
                        that.formData = data;
                        that.remarks = that.formData.remarks;
                        that.AxiosHttp("post", 'LLJ/getJYItem', {
                            //id: that.formData.guid,
                            releaseNo: that.formData.releaseNo
@@ -243,6 +280,7 @@
                                }
                            });
                            that.tableData = tableData;
                            //if (that.tableData.length === 0) {
                            //    that.isShowTable = true;
                            //}
@@ -259,34 +297,9 @@
        },
        submit() {
            var that = this;
            //if (that.formdata.remarks == undefined && that.formdata.fcheckresu == "不合格") {
            //    that.$toast.fail("检验结果为不合格时,需要填写不合格描述!");
            //    return;
            //}
            that.ttrre = true;
            //that.AxiosHttp("post", 'LLJ/IqcQaSubmit', {
            //    userNo: this.userInfo.loginAccount,
            //    releaseNo: this.formData.releaseNo
            //}, false).then(function (res1) {
            //    if (res1.status == 1) {
            //        that.$toast.fail(res1.message);
            //    } else {
            //        that.$notify({ type: 'success', message: '提交成功' });
            //        that.init();
            //    }
            //    that.ttrre = false
            //}).catch(function (error) {
            //    that.$toast.fail("网络错误,请重试!");
            //    that.ttrre = false
            //    console.log(error);
            //});
            that.AxiosHttp("post", 'MesQaItemsDetect01Manager/EditModelSubmit', {
                guid: that.formData.guid
                id13: that.formData.guid
            }, true, 1).then(function (res1) {
                if (res1.rtnCode == 1) {
                    that.$notify({ type: 'success', message: '提交成功' });
@@ -303,10 +316,9 @@
        },
        removeXJ() {
            const that = this;
            that.isLoading = true;
            // 添加确认弹窗
            that.$dialog.confirm({
                title: '操作确认',
                message: '确认要重新加载检验项目吗?',
                confirmButtonText: '确认',
                cancelButtonText: '取消'
@@ -320,13 +332,15 @@
                    } else {
                        that.$toast.fail(res1.rtnMsg);
                    }
                    that.isLoading = false;
                }).catch(error => {
                    that.$toast.fail("网络错误,请重试!");
                    console.error('Reload error:', error);
                    that.isLoading = false;
                });
            }).catch(() => {  // 取消回调
                that.$toast('已取消操作');
                that.isLoading = false;
            });
        },
        GetBack1() {
@@ -335,5 +349,113 @@
        onClickRight() {
            
        },
        updateRemarks(guid) {
            this.showDialog= true
        },
        deleteDetail13(guid13) {
            const that = this;
            // 添加确认弹窗
            that.$dialog.confirm({
                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.refreshJYItem();//刷新检验项目
                    } else {
                        that.$toast.fail(res1.rtnMsg);
                    }
                    that.isLoading = false;
                }).catch(error => {
                    that.$toast.fail("网络错误,请重试!");
                    that.isLoading = false;
                });
            }).catch(() => {  // 取消回调
                that.$toast('已取消操作');
                that.isLoading = false;
            });
        },
        remarksConfirm() {
            const that = this;
            that.isLoading = true;
            var guid = that.formData.guid;
            that.AxiosHttp("post", 'Llj/updateRemarks', {
                gid: guid,
                Remarks: that.remarks
            }, true, 0).then(res1 => {
                if (res1.status == 0) {
                    that.$notify({ type: 'success', message: '输入成功' });
                    that.init();//刷新检验项目
                } else {
                    that.$toast.fail(res1.rtnMsg);
                }
                that.isLoading = false;
            }).catch(error => {
                that.$toast.fail("网络错误,请重试!");
                that.isLoading = false;
            });
        },
        async afterRead(file) {
            try {
                // 1. 显示上传中状态
                file.status = 'uploading';
                file.message = '上传中...';
                // 2. 创建 FormData(关键:字段名必须和后端参数名一致)
                const formData = new FormData();
                // 3. 构造文件名(根据后端要求用 ~ 分割)
                // 假设需要 parentGuid,这里从组件数据获取
                const parentGuid = this.formData.guid; // 根据你的实际数据源调整
                const customFileName = `${parentGuid}~${file.file.name}`;
                // 4. 添加文件(第二个参数必须使用 new File 包装)
                formData.append('file', new File([file.file], customFileName, {
                    type: file.file.type
                }));
                // 5. 调用统一封装的 Axios 方法
                const res = await this.AxiosHttp(
                    'post',
                    'MesFile/UploadFile', // 根据实际接口路径调整
                    formData,
                    true,     // 显示加载状态
                    1     // 超时时间
                );
                // 6. 处理响应
                if (res.rtnCode === 1) {
                    file.status = 'done';
                    file.message = '上传成功';
                    file.urlPath = res.rtnData.urlPath; // 保存返回的文件路径
                    file.id = res.rtnData.id; // 保存返回的文件id
                    // 可选:上传成功后刷新文件列表
                    // await this.loadFileList();
                } else {
                    file.status = 'failed';
                    file.message = res.rtnMsg || '上传失败';
                    this.$toast.fail(res.rtnMsg);
                }
            } catch (error) {
                // 7. 异常处理
                file.status = 'failed';
                file.message = '上传异常';
                this.$toast.fail('网络错误,请重试');
                console.error('上传错误:', error);
            } finally {
                // 8. 强制更新视图(Vant 3+ 可能需要)
                this.$nextTick();
            }
        }
    }
})
H5/LLJ/Add.aspx
@@ -296,17 +296,40 @@
                  </template>
                </van-field>
              <van-field label="数量" colon="true" v-model="formData.fcovertQty" readonly ></van-field>
              <van-field label="不合格描述" v-if='formData.fcheckResu == "不合格"' colon="true" v-model="formData.remarks" ></van-field>
<%--              <van-field label="检测结果" colon="true" v-model="formData.fcheckResu" readonly ></van-field>--%>
<%--                <van-field label="检测结果" colon="true" readonly >
                   <template #input>
                       <van-tag round v-if="formData.fcheckResu === '不合格'" type="danger">不合格</van-tag>
                       <van-tag round v-else-if="formData.fcheckResu === '检验中'" type="warning">检验中</van-tag>
                       <van-tag round v-else type="success">合格</van-tag>
                   </template>
                </van-field>--%>
              <van-field label="不合格描述"   v-if='formData.fcheckResu == "不合格"' colon v-model="remarks" readonly class="wrap-field">
                  <template #input>
                      <div class="wrap-content">{{ remarks }}</div>
                    </template>
                  <template #button>
                    <van-tag type="primary" style="font-size:15px" @click="updateRemarks(formData.guid)">输入</van-tag>
                  </template>
              </van-field>
<%--            <van-field
                v-if='formData.fcheckResu == "不合格"' colon="true"
                v-model="formData.remarks"
                rows="2"
                autosize
                label="不合格描述"
                type="textarea"
                maxlength="50"
                placeholder="请输入不合格描述"
                show-word-limit
            />--%>
                            <!-- 不合格表述输入 -->
            <van-dialog v-model="showDialog" title="不合格描述" :show-cancel-button="false"  @confirm="remarksConfirm">
              <van-field
                v-model="remarks"
                rows="5"
                autosize
                type="textarea"
                maxlength="500"
                placeholder="请输入不合格描述"
                show-word-limit
            />
           </van-dialog>
            </van-cell-group>
        </div>
             <div><van-uploader v-model="fileList" :after-read="afterRead" /></div>
<%--            <van-button :loading="ttrre" type="info" loading-text="加载中..." v-if="!isShowTable && formData.fsubmit == 0" @click="submit">检验提交</van-button>
            <van-button type="danger" v-if="!isShowTable && formData.fsubmit == 0" @click="removeXJ">重新加载项目</van-button>--%>
<%--            <van-button :loading="ttrre"  type="info" loading-text="加载中..."  @click="submit">检验提交</van-button>
@@ -364,6 +387,7 @@
              height: '100%' ,
              boxShadow: '-2px 0 12px rgba(0, 0, 0, 0.1)'
              }"
         @click-close-icon ="init"
        >
          <!-- 弹出内容 -->
          <div  class="content-wrapper-jymx">
@@ -414,7 +438,7 @@
                                           :ref="'okValue_' + tabActive"
                                          v-model="okValue"
                                          class="si-input-field"
                                          placeholder="请输入OK数量"
                                          placeholder="输入OK数"
                                          :border="false"
                                          @keyup.enter.native="getInputOK"
                                            @input="handleNumberInput1"
@@ -434,7 +458,7 @@
                                            :ref="'ngValue_' + tabActive"
                                          v-model="ngValue"
                                          class="si-input-field"
                                          placeholder="请输入NG数量"
                                          placeholder="输入NG数"
                                          :border="false"
                                         @keyup.enter.native="getInputNG"
                                            @input="handleNumberInput2"
@@ -477,7 +501,7 @@
                                  <van-field
                                      :ref="'inputValue' + tabActive"
                                    v-model="inputValue"
                                    placeholder="请输入"
                                    placeholder="请输入特征值"
                                    :border="false"
                                    class="si-input-field"
                                    @input="handleNumberInput3"
@@ -487,21 +511,22 @@
                              </div>
                    </template>
                            <van-row type="flex" justify="center">
                                 <van-col span="10" center class="text-left padding-left">检验项目</van-col>
                                 <van-col span="6">样本集</van-col>
                                <van-col span="6">样本值</van-col>
                                <van-col span="8">判定标志</van-col>
                                <van-col span="6">判定标志</van-col>
                                <van-col span="6">操作</van-col>
                            </van-row>
                            <van-row  v-for="(item,index) in tableMxData.list2" :key="index"  type="flex" justify="left">
        
                                 <van-col span="10" center class="text-left padding-left" >
                                 <van-col span="6"  >
                                     <van-cell center
                                      center :title="item.fcheckItemd5" @click="togglePopup(index)"></van-cell>
                                      center :title="item.fcheckItem" @click="togglePopup(index)"></van-cell>
                                </van-col>
                                <van-col span="6" >
                                    <van-cell center 
                                        center :title="item.fcheckResu"></van-cell>
                                </van-col>
                                <van-col center span="8" >
                                <van-col center span="6" >
                                    <van-cell center
                                      center v-if="item.fstand === '√'">
                                      <van-tag round plain type="success" style="font-size:15px">合格</van-tag>   
@@ -514,6 +539,9 @@
                                        center v-else >
                                        <van-tag round plain type="warning" style="font-size:15px">检验中</van-tag>   
                                      </van-cell>
                                </van-col>
                                <van-col center span="6" >
                                    <van-tag type="danger" style="font-size:15px" @click="deleteDetail13(item.guid)">删除</van-tag>
                                </van-col>
                          </van-row>
                    
@@ -547,11 +575,14 @@
              >刷新重做</van-button>
            </div>
          </van-popup>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder3" Runat="Server">
    <comloading  v-if="isLoading"></comloading>
  <%--<comback ></comback>--%>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder4" Runat="Server">
 <script src="../Js/LLJ/Add.js?<%=11993 %>"></script>
 <script src="../Js/LLJ/Add.js?<%=119993 %>"></script>
</asp:Content>