H5/IPQC_SJ/Add.aspx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
H5/Js/IPQC_SJ/Add.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
H5/IPQC_SJ/Add.aspx
@@ -105,6 +105,62 @@ font-size: 0.16rem !important; color: blue !important; } /* 步进器样式 */ .van-stepper__input { width: .5rem; height: .4rem; } .van-stepper__minus,.van-stepper__plus { width: .5rem; height: .4rem; } /* 单选框大小 */ .van-radio__icon { -webkit-box-flex: 0; -webkit-flex: none; flex: none; height: 1em; font-size: .3333rem } /* 认证信息多选样式 */ .rzxx-action-sheet { height: 70%; } .rzxx-action-sheet .checkbox-group-wrapper { padding: 16px; max-height: calc(100% - 60px); overflow-y: auto; } .action-sheet-footer { position: sticky; bottom: 0; background: white; padding: 8px 16px; box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1); } .confirm-btn { border-radius: 20px; } /* 认证信息专用样式 */ .rzxx-checkbox-group .rzxx-checkbox { font-size: 0.5rem !important; } .rzxx-checkbox .van-checkbox__label { font-size: 0.5rem !important; line-height: 1.2; } .rzxx-checkbox .van-checkbox__icon { font-size: 0.5rem !important; } /* 认证信息多选样式 */ </style> </asp:Content> @@ -285,35 +341,127 @@ <van-field label="项目名称" colon="true" v-model="jymxData.fcheckItem" readonly ></van-field> <van-field label="规格要求" colon="true" v-model="jymxData.fspecRequ" readonly ></van-field> <van-field label="检验工具" colon="true" v-model="jymxData.fcheckTool" readonly ></van-field> <van-field label="检验数" colon="true" v-model="jymxData.checkQyt" readonly ></van-field> <!-- <van-field label="检验数" colon="true" v-model="jymxData.checkQyt" readonly ></van-field> --> <van-field label="下限" colon="true" v-model="jymxData.fdownAllow" readonly ></van-field> <van-field label="标准值" colon="true" v-model="jymxData.fstand" readonly ></van-field> <van-field label="上限" colon="true" v-model="jymxData.fupAllow" readonly ></van-field> <%--<van-field label="AC数" colon="true" v-model="jymxData.facQty" readonly ></van-field>--%> <van-field label="RE数" colon="true" v-model="jymxData.freQty" readonly ></van-field> <van-field label="样本数" colon="true" v-model="jymxData.ybsl" readonly ></van-field> <!-- <van-field label="RE数" colon="true" v-model="jymxData.freQty" readonly ></van-field> --> <!-- <van-field label="样本数" colon="true" v-model="jymxData.ybsl" readonly ></van-field> --> <%--<van-field label="预览结果" colon="true" v-model="jymxData.result" readonly ></van-field>--%> <%--<van-field label="结果录入" colon="true" v-model="resultValue" placeholder="请输入OK-数字或NG-数字"></van-field>--%> <van-field label="检测结果" colon="true" readonly > <template #input> <div style="text-align: center;"> <van-tag round plain v-if="jymxData.fcheckResu === 'Y:合格'" type="success">合格</van-tag> <van-tag round plain v-else-if="jymxData.fcheckResu === 'N:不合格'" type="danger">不合格</van-tag> <van-tag round plain v-else type="warning">进行中</van-tag> </div> </template> </van-field> <van-field label="生产日期" v-if="jymxData.fcheckType === '关键部件一致性'" colon readonly class="wrap-field"> <template #input> <div class="wrap-content" @click="showScDatePicker = true">{{ jymxData.ipqcrzxxDate || '请选择日期' }}</div> </template> <!-- <template #button> <van-tag type="primary" style="font-size:15px" @click="showScDatePicker = true">选择</van-tag> </template> --> </van-field> <!-- 只有当 jymxData.fcheckType 等于 "品水测试" 时才显示该字段 --> <van-field v-if="jymxData.fcheckType === '品水测试'" label="是否有异味" colon="true" readonly> <template #input> <van-radio-group v-model="jymxData.ipqCpscs" direction="horizontal" class="custom-radio-group" @change="updateCpscs"> <van-radio name="Y" shape="square">有</van-radio> <van-radio name="N" shape="square">无</van-radio> </van-radio-group> </template> </van-field> <van-field label="认证信息" v-if='jymxData.isrzxx == 1' colon v-model="rzxxValue" placeholder="请输入认证信息" readonly class="wrap-field"> <template #input> <div class="wrap-content">{{ rzxxValue }}</div> </template> <template #button> <van-tag type="primary" style="font-size:15px" @click="updateRzxx()">输入</van-tag> </template> </van-field> <van-dialog v-model="showDialogRzxx" title="认证信息" :show-cancel-button="false" @confirm="rzxxConfirm"> <van-field label="使用数量" colon="true" v-if="jymxData.fcheckType === '关键部件一致性'"> <template #input> <van-stepper v-model="jymxData.ipqcrzxxNum" integer @change="updateRzxxNum(jymxData.ipqcrzxxNum)" /> </template> </van-field> <van-field label="认证信息" v-if="jymxData.fcheckType === '关键部件一致性'" colon readonly class="multi-line-field"> <template #input> <div class="flex-container"> <div class="wrap-content scrollable-text" style="white-space: pre-line;"> {{ jymxData.ipqcrzxx }} </div> </div> </template> </van-field> <van-button block type="info" @click="selectRzxx" :loading="ttrre" loading-text="加载中..." v-if="jymxData.fcheckType === '关键部件一致性'" >认证信息选择</van-button> <!-- <van-tag type="primary" style="font-size:15px; flex-shrink:0" @click="selectRzxx"> 选择 </van-tag> --> <van-action-sheet v-model="showRzxx" title="请选择认证信息" class="rzxx-action-sheet"> <div class="checkbox-group-wrapper"> <van-checkbox-group v-model="selectedRzxx" ref="checkboxGroup" :max="5" class="rzxx-checkbox-group"> <van-checkbox v-for="(item, index) in rzxxOptions" :key="index" :name="item.value" class="rzxx-checkbox"> {{ item.text }} </van-checkbox> </van-checkbox-group> </div> <div class="action-sheet-footer"> <van-button block type="primary" @click="confirmMultiRzxx" class="confirm-btn">确认选择</van-button> </div> </van-action-sheet> <van-popup v-model="showScDatePicker" position="bottom"> <van-datetime-picker v-model="currentDate" type="date" title="选择生产日期" :min-date="minDate" :max-date="maxDate" @confirm="confirmScDate" @cancel="showScDatePicker = false" /> </van-popup> <template #input> <div class="wrap-content">{{ rzxxValue }}</div> </template> <template #button> <van-tag type="primary" style="font-size:15px" @click="selectRzxx()">选择</van-tag> </template> </van-field> <!-- <van-dialog v-model="showDialogRzxx" title="认证信息" :show-cancel-button="false" @confirm="rzxxConfirm"> <van-field v-model="rzxxValue" rows="5" @@ -323,15 +471,25 @@ placeholder="请输入认证信息" show-word-limit /> </van-dialog> </van-dialog> --> <van-button block type="info" @click="openZrPopup" :loading="ttrre" loading-text="加载中..." v-if="jymxData.fcheckItem === '制热性能'" v-if="jymxData.fcheckType === '制热性能'" >制热性能录入</van-button> <van-field label="检测结果" colon="true" readonly > <template #input> <div style="text-align: center;"> <van-tag round plain v-if="jymxData.fcheckResu === 'Y:合格'" type="success">合格</van-tag> <van-tag round plain v-else-if="jymxData.fcheckResu === 'N:不合格'" type="danger">不合格</van-tag> <van-tag round plain v-else type="warning">进行中</van-tag> </div> </template> </van-field> </template> <template> @@ -556,7 +714,7 @@ <%--<comback ></comback>--%> </asp:Content> <asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder4" Runat="Server"> <script src="../Js/IPQC_SJ/Add.js?<%=111112111148 %>"></script> <script src="../Js/IPQC_SJ/Add.js?<%=111112111156 %>"></script> </asp:Content> 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: '一分钟流量' }, @@ -98,6 +103,19 @@ // message: '上传失败', //}, ], //时间选择参数 showScDatePicker: false, minDate: new Date(new Date().getFullYear() - 1, 0, 1), // 过去一年 maxDate: new Date(new Date().getFullYear() + 1, 11, 31), // 未来一年 currentDate: new Date(), scDate: '', // 存储格式化后的日期 //认证信息选择 showRzxx: false, actions: [], selectedRzxx: [], // 存储多选值 rzxxOptions: [], // 认证信息选项 } }, mounted() { @@ -342,9 +360,10 @@ this.showDialog= true }, updateRzxx() { this.showDialogRzxx = true }, // updateRzxx() { // this.showDialogRzxx = true // }, //删除检验明细记录 deleteDetail13(guid12) { const that = this; var guid1 = that.formData.guid;//主表id @@ -380,6 +399,7 @@ that.isLoading = false; }); }, //更新认证信息 rzxxConfirm() { var that = this; var guid1 = that.formData.guid;//主表id @@ -393,7 +413,7 @@ var json = res; if (json.status == 0) { that.$notify({ type: 'success', message: '输入成功' }); that.refreshJYItem();//刷新检验项目 //that.refreshJYItem();//刷新检验项目 } else { that.$toast.fail(json.message); @@ -406,6 +426,31 @@ 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: '输入成功' }); //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; }); }, //更新不合格表述 remarksConfirm() { const that = this; that.isLoading = true; @@ -666,5 +711,144 @@ }, 100); console.log(that.formTbData.temperatureData); }, //保存生产日期 confirmScDate(value) { const date = new Date(value); this.scDate = `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}`; //this.rzxxValue = this.scDate; // 同时更新认证信息字段 console.log(this.scDate); var that = this; var guid1 = that.formData.guid;//主表id var mxguid = that.tableData[that.tabActive].guid;//检验项目的guid that.isLoading = true; that.AxiosHttp("post", 'Ipqc/updateScDate', { gid: guid1, mxguid: mxguid, scDateValue: that.scDate,//输入的认证信息 }, 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; }); this.showScDatePicker = false; }, selectRzxx() { this.showRzxx = true; this.getRzxxList(); }, //获取认证信息相关列表 getRzxxList() { var that = this; that.rzxxOptions = []; that.isLoading = true; var mxguid = that.tableData[that.tabActive].guid;//检验项目的guid that.AxiosHttp("post", 'Ipqc/GetRzxxList', { // 根据实际接口需要传递参数 mxguid: mxguid, }, false) .then(function (res) { if (res.status == 0) { // 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); } that.isLoading = false; }) .catch(function (error) { that.isLoading = false; 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; this.rzxxValue = item.name; this.rzxxConfirm(); //this.refreshJYItem();//刷新检验项目 // 如果需要获取详细信息可在此处调用其他方法 }, //更新认证信息使用数量 updateRzxxNum(value, index) { // 添加防抖判断 if (this.isLoading) { return; } const that = this; that.isLoading = true; that.AxiosHttp("post", 'Ipqc/saveIpqcrzxxNum', { guid: that.tableData[that.tabActive].guid, ipqcrzxxNum: value }, true, 0).then(res => { if (res.status == 0) { //that.$notify({ type: 'success', message: '数量更新成功' }); //that.refreshJYItem();//刷新检验项目 } else { that.$toast.fail(res.rtnMsg); } that.isLoading = false; }).catch(error => { that.isLoading = false; that.$toast.fail("网络错误,请重试!"); }); }, //更新是否有无异味 updateCpscs(value) { // 添加防抖判断 if (this.isLoading) { return; } const that = this; that.isLoading = true; if (!value) return; that.AxiosHttp("post", 'Ipqc/saveIpqCpscs', { guid: that.tableData[that.tabActive].guid, ipqCpscs: value }, true, 0).then(res => { if (res.status == 0) { //that.refreshJYItem(); } else { that.$toast.fail(res.rtnMsg); } that.isLoading = false; }).catch(error => { that.isLoading = false; that.$toast.fail("网络错误,请重试!"); }); }, } })