From 0d1f118b3a0413a490f0c36e0841a14ec55b87b9 Mon Sep 17 00:00:00 2001
From: 南骏 池 <chiffly@163.com>
Date: 星期三, 28 五月 2025 08:47:54 +0800
Subject: [PATCH] 1.期初版本
---
H5/Js/LLJ/Add.js | 246 +++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 209 insertions(+), 37 deletions(-)
diff --git a/H5/Js/LLJ/Add.js b/H5/Js/LLJ/Add.js
index 0e60a53..e725a23 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.fngDesc;
that.AxiosHttp("post", 'LLJ/getJYItem', {
//id: that.formData.guid,
releaseNo: that.formData.releaseNo
@@ -243,6 +280,7 @@
}
});
that.tableData = tableData;
+ that.GetImageFileByGid();
//if (that.tableData.length === 0) {
// that.isShowTable = true;
//}
@@ -259,40 +297,15 @@
},
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
}, true, 1).then(function (res1) {
- if (res1.rtnCode == 1) {
+ if (res1.rtnData.outSum == 1) {
that.$notify({ type: 'success', message: '鎻愪氦鎴愬姛' });
that.init();
} else {
- that.$toast.fail(res1.rtnMsg);
+ that.$toast.fail(res1.rtnData.outMsg);
}
that.ttrre = false
}).catch(function (error) {
@@ -303,14 +316,13 @@
},
removeXJ() {
const that = this;
-
// 娣诲姞纭寮圭獥
that.$dialog.confirm({
- title: '鎿嶄綔纭',
message: '纭瑕侀噸鏂板姞杞芥楠岄」鐩悧锛�',
confirmButtonText: '纭',
cancelButtonText: '鍙栨秷'
}).then(() => { // 纭鍥炶皟
+ that.isLoading = true;
that.AxiosHttp("post", 'MesQaItemsDetect01Manager/ReloadModel5', {
guid: that.formData.guid
}, true, 1).then(res1 => {
@@ -320,9 +332,10 @@
} else {
that.$toast.fail(res1.rtnMsg);
}
+ that.isLoading = false;
}).catch(error => {
that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
- console.error('Reload error:', error);
+ that.isLoading = false;
});
}).catch(() => { // 鍙栨秷鍥炶皟
@@ -335,5 +348,164 @@
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 {
+ //alert(APIURL_IMAGE);
+ // 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();
+ }
+ },
+ //鑾峰彇鍥剧墖淇℃伅
+ GetImageFileByGid() {
+ const that = this;
+ that.AxiosHttp("post", 'MesImage/getImage', {
+ parentId: that.formData.guid,
+ }, true, 0).then(res1 => {
+ if (res1.status === 0) {
+ // 鍏抽敭杞崲锛氬皢鍚庣鏁版嵁杞崲涓� van-uploader 闇�瑕佺殑鏍煎紡
+ that.fileList = res1.data.tbBillList.map(item => ({
+ url: `${APIURL_IMAGE}/${item.urlPath}`, // 鎷兼帴瀹屾暣璁块棶璺緞
+ status: 'done', // 鏍囪涓哄凡涓婁紶鎴愬姛
+ name: item.fileTitle, // 鍙�夋樉绀烘枃浠跺悕
+ message: '宸蹭笂浼�', // 鍙�夌姸鎬佹枃瀛�
+ // 淇濈暀鍘熷鏁版嵁锛堟寜闇�锛�
+ id: item.guid
+ }));
+ } else {
+ that.$toast.fail(res1.rtnMsg);
+ }
+ }).catch(error => {
+ that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
+ });
+ },
+ handleDelete(file, { index }) {
+ var that = this;
+ that.$dialog.confirm({
+ title: '纭鍒犻櫎',
+ message: '纭畾瑕佸垹闄よ繖寮犲浘鐗囧悧锛�'
+ }).then(() => {
+ // 纭鍒犻櫎閫昏緫
+ console.log(file);
+ that.AxiosHttp("post", 'MesImage/deleteImage', {
+ id: file.id,
+ }, true, 0).then(res1 => {
+ if (res1.status === 0) {
+ that.$notify({ type: 'success', message: '鍒犻櫎鎴愬姛' });
+ } else {
+ that.$toast.fail(res1.rtnMsg);
+
+ }
+ that.init();//鍒锋柊妫�楠岄」鐩�
+ }).catch(error => {
+ that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
+ });
+
+ }).catch(() => {
+ // 鍙栨秷鎿嶄綔
+ that.init();//鍒锋柊妫�楠岄」鐩�
+ })
+ },
}
})
\ No newline at end of file
--
Gitblit v1.9.3