From 078c3e3d1fe34e1cc481f05495011b06a66f800a Mon Sep 17 00:00:00 2001 From: 南骏 池 <chiffly@163.com> Date: 星期五, 21 三月 2025 15:59:39 +0800 Subject: [PATCH] 1.删除特征值按钮 2.image --- H5/Js/LLJ/Add.js | 194 +++++++++++++++++++++++++++++++------- H5/LLJ/Add.aspx | 67 +++++++++--- 2 files changed, 207 insertions(+), 54 deletions(-) diff --git a/H5/Js/LLJ/Add.js b/H5/Js/LLJ/Add.js index 0e60a53..1c4521f 100644 --- a/H5/Js/LLJ/Add.js +++ b/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; // 淇濆瓨杩斿洖鐨勬枃浠秈d + + // 鍙�夛細涓婁紶鎴愬姛鍚庡埛鏂版枃浠跺垪琛� + // 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. 寮哄埗鏇存柊瑙嗗浘锛圴ant 3+ 鍙兘闇�瑕侊級 + this.$nextTick(); + } + } } }) \ No newline at end of file diff --git a/H5/LLJ/Add.aspx b/H5/LLJ/Add.aspx index cd791d6..5c8b4d8 100644 --- a/H5/LLJ/Add.aspx +++ b/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="璇疯緭鍏K鏁伴噺" + 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="璇疯緭鍏G鏁伴噺" + 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> -- Gitblit v1.9.3