From 14b1756e21ba4401ce5916f035576804f4be5878 Mon Sep 17 00:00:00 2001 From: 南骏 池 <chiffly@163.com> Date: 星期四, 20 三月 2025 17:25:34 +0800 Subject: [PATCH] 1.样式更新 --- H5/Js/LLJ/Add.js | 255 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 239 insertions(+), 16 deletions(-) diff --git a/H5/Js/LLJ/Add.js b/H5/Js/LLJ/Add.js index 193e949..0e60a53 100644 --- a/H5/Js/LLJ/Add.js +++ b/H5/Js/LLJ/Add.js @@ -25,9 +25,20 @@ boardStyle: "" }, isShowTable: false, - tableData: [], + tableData: [],//杩斿洖鐨勬楠岄」鐩� + jymxData: [],//灞曠ず鐨勬楠岄」鐩� - ttrre: false + okNum:'',//鍚堟牸鏁� + ngNum: '',//涓嶅悎鏍兼暟 + ttrre: false, + show: false, + tableMxData: [], + tabActive: 0, + inputValue: '',//鐗瑰緛鍊艰緭鍏� + resultValue: '',//妫�楠岀粨鏋滃綍鍏� + showButton: false,//鍙充笂瑙掕彍鍗曡Е鍙� + okValue: '',//OK-鏁伴噺 + ngValue: ''//NG-鏁伴噺 } }, mounted() { @@ -42,10 +53,172 @@ this.init(); }, methods: { - init() { + // 杈撳叆杩囨护 + handleNumberInput1(value) { + // 鍘婚櫎闈炴暟瀛楀苟纭繚棣栦綅涓嶄负0锛堥櫎闈炴槸鍗曠嫭鐨�0锛� + this.okValue = value.replace(/[^\d]/g, '') // 鍘婚櫎闈炴暟瀛楀瓧绗� + .replace(/^0+(?!$)/, ''); // 鍘婚櫎寮�澶寸殑0锛岄櫎闈炴暣涓瓧绗︿覆鏄�0 + }, + handleNumberInput2(value) { + // 鍘婚櫎闈炴暟瀛楀苟纭繚棣栦綅涓嶄负0锛堥櫎闈炴槸鍗曠嫭鐨�0锛� + this.ngValue = value.replace(/[^\d]/g, '') // 鍘婚櫎闈炴暟瀛楀瓧绗� + .replace(/^0+(?!$)/, ''); // 鍘婚櫎寮�澶寸殑0锛岄櫎闈炴暣涓瓧绗︿覆鏄�0 + }, + handleNumberInput3(value) { + this.inputValue = value.replace(/[^\d.]/g, '') // 1. 鍘婚櫎闈炴暟瀛楀拰灏忔暟鐐� + .replace(/(\..*)\./g, '$1') // 2. 绂佹澶氫釜灏忔暟鐐� + .replace(/^\./g, ''); + }, + + togglePopup(index) { + // 鍒囨崲鎸囧畾绱㈠紩鐨� popup 鐘舵�� var that = this; + this.show = true; + console.log(index); + console.log(that.tableData[index].guid); + var mxguid = that.tableData[index].guid; + that.jymxData = that.tableData[index]; + that.tabActive = index; + that.AxiosHttp("post", 'MesQaItemsDetect01Manager/GetModel12', { + parentGuid : "", + guid : mxguid , + }, true, 1).then(function (res1) { + if (res1.rtnCode == 1) { + that.tableMxData = res1.rtnData; + // 缁熻鍚堟牸鏁板拰涓嶅悎鏍兼暟 + const list = res1.rtnData?.list || []; // 纭繚 list 鏄暟缁勶紝閬垮厤 undefined 閿欒 + const okNum = list.filter(item => item.fstand === '鈭�').length; + const ngNum = list.length - okNum; + + // 灏嗙粨鏋滀繚瀛樺埌鎸囧畾鍙橀噺锛堝 that 鐨勬垚鍛樺睘鎬э級 + that.okNum = okNum; + that.ngNum = ngNum; + + } else { + that.$toast.fail(res1.rtnMsg); + } + }).catch(function (error) { + that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�"); + console.log(error); + }); + + + }, + + getInputOK() { + var that = this; + var jys = that.tableData[that.tabActive].checkQyt;//妫�楠岄」鐩殑妫�楠屾暟 + if (jys < that.okValue) { + that.$toast.fail("褰曞叆鏁伴噺涓嶈兘澶т簬妫�楠屾暟锛�"); + that.okValue = null; + //that.$refs.okValue.focus(); + return; + } + // 鍒囨崲鎸囧畾绱㈠紩鐨� popup 鐘舵�� + var resultValue = "OK-" + this.okValue; + this.getInput(resultValue); + that.okValue = null; + }, + getInputNG() { + var that = this; + var jys = that.tableData[that.tabActive].checkQyt;//妫�楠岄」鐩殑妫�楠屾暟 + if (jys < that.ngValue) { + that.$toast.fail("褰曞叆鏁伴噺涓嶈兘澶т簬妫�楠屾暟锛�"); + that.ngValue = null; + //that.$refs.ngValue.focus(); + return; + } + // 鍒囨崲鎸囧畾绱㈠紩鐨� popup 鐘舵�� + var resultValue = "NG-" + this.ngValue; + this.getInput(resultValue); + that.ngValue = null; + }, + + getInput(resultValue) { + // 鍒囨崲鎸囧畾绱㈠紩鐨� popup 鐘舵�� + var that = this; + var guid1 = that.formData.guid;//涓昏〃id + var mxguid = that.tableData[that.tabActive].guid;//妫�楠岄」鐩殑guid + + console.log(that.formData); + var input = resultValue;//鎷兼帴妫�楠屽�� + that.AxiosHttp("post", 'MesQaItemsDetect01Manager/EdtModel12', { + inOrderGuid1: guid1, + inOrderGuid5: mxguid, + inP1: input,//鎴栬��0k-19,鎴栬�卬g-19 + }, true, 1).then(function (res1) { + if (res1.rtnCode == 1) { + that.$notify({ + type: 'success', message: res1.rtnMsg + }); + that.refreshJYItem();//鍒锋柊妫�楠岄」鐩� + //that.tableData = null; + //that.$refs.inputValue.focus(); + } else { + that.$toast.fail(res1.rtnMsg); + } + }).catch(function (error) { + that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�"); + console.log(error); + }); + }, + + getInputTZZ() { + // 鍒囨崲鎸囧畾绱㈠紩鐨� popup 鐘舵�� + var that = this; + var mxguid = that.tableData[that.tabActive].guid;//妫�楠岄」鐩殑guid + var input = that.inputValue; + that.AxiosHttp("post", 'MesQaItemsDetect01Manager/EditYangLi', { + dt05Guid: mxguid, + fSeq : "pda", + fVal : input, + }, true, 1).then(function (res1) { + if (res1.rtnData.outSum == 1) { + that.$notify({ + type: 'success', message: res1.rtnMsg + }); + that.okValue = null; + that.refreshJYItem();//鍒锋柊妫�楠岄」鐩� + //that.handleTabClick();//鍒锋柊妫�楠屾槑缁嗛潰鏉� + //that.$refs.inputValue.focus(); + that.inputValue = null; + } else { + that.$toast.fail(res1.rtnMsg); + that.inputValue = null; + } + }).catch(function (error) { + that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�"); + that.inputValue = null; + }); + }, + + handleTabClick() { + console.log(this.tabActive) + this.togglePopup(this.tabActive); + }, + //妫�楠屾槑缁嗗埛鏂� + refreshJYItem() { + const that = this; + return that.AxiosHttp("post", 'LLJ/getJYItem', { + releaseNo: that.formData.releaseNo + }, false).then(res1 => { + const tableData = res1.data.tbBillList || []; + that.tableData = tableData; + that.handleTabClick();//鍒锋柊妫�楠屾槑缁嗛潰鏉� + }).catch(error => { + that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�"); + console.error('Refresh error:', error); + }); + }, + + //涓婚〉闈㈠姞杞� + init() { + + //alert(this.Request("id")); + var that = this; + that.showButton = false; that.AxiosHttp("post", 'LLJ/getPage', { - id: this.formData.id, + id: that.Request("id"), pageIndex: 1, limit: 1, }, false) @@ -55,7 +228,7 @@ that.formData = data; that.AxiosHttp("post", 'LLJ/getJYItem', { - id: that.formData.id, + //id: that.formData.guid, releaseNo: that.formData.releaseNo }, false).then(function (res1) { let tableData = res1.data.tbBillList @@ -70,9 +243,9 @@ } }); that.tableData = tableData; - if (that.tableData.length === 0) { - that.isShowTable = true; - } + //if (that.tableData.length === 0) { + // that.isShowTable = true; + //} }).catch(function (error) { that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�"); console.log(error); @@ -87,17 +260,39 @@ 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.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 + }, true, 1).then(function (res1) { + if (res1.rtnCode == 1) { that.$notify({ type: 'success', message: '鎻愪氦鎴愬姛' }); that.init(); + } else { + that.$toast.fail(res1.rtnMsg); } that.ttrre = false }).catch(function (error) { @@ -107,10 +302,38 @@ }); }, removeXJ() { + const that = this; + // 娣诲姞纭寮圭獥 + that.$dialog.confirm({ + title: '鎿嶄綔纭', + message: '纭瑕侀噸鏂板姞杞芥楠岄」鐩悧锛�', + confirmButtonText: '纭', + cancelButtonText: '鍙栨秷' + }).then(() => { // 纭鍥炶皟 + that.AxiosHttp("post", 'MesQaItemsDetect01Manager/ReloadModel5', { + guid: that.formData.guid + }, true, 1).then(res1 => { + if (res1.rtnCode == 1) { + that.$notify({ type: 'success', message: '閲嶆柊鍔犺浇鎴愬姛' }); + that.init(); + } else { + that.$toast.fail(res1.rtnMsg); + } + }).catch(error => { + that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�"); + console.error('Reload error:', error); + }); + + }).catch(() => { // 鍙栨秷鍥炶皟 + that.$toast('宸插彇娑堟搷浣�'); + }); }, GetBack1() { window.history.back(); - } + }, + onClickRight() { + + }, } }) \ No newline at end of file -- Gitblit v1.9.3