From d536a0a83467e64b2c2d8e4a68fdae61412157ba Mon Sep 17 00:00:00 2001 From: wangyan Date: Thu, 16 Oct 2025 16:32:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=AC=E8=BF=90=E9=BE=99=E9=92=A2=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/hidden_add/index.vue | 73 ++++++----- .../hidden-danger-check-detail.vue | 120 +++++++++--------- .../hidden-danger-edit-detail.vue | 74 ++++++----- .../hidden-danger-finish.vue | 3 +- .../hidden-danger-no-change-detail.vue | 97 +++++++------- .../hidden-trouble-app/exclude-form.vue | 21 +-- .../hidden-trouble-app/other-hidden-add.vue | 91 +++++++------ .../highwork-apply/highwork-apply-detail.vue | 32 ++--- .../highwork/highwork-detail/index.vue | 4 +- .../highwork/highwork-list/index.vue | 4 +- .../highwork-safety-detail.vue | 6 +- pages/application/highwork/home.vue | 4 +- .../hoisting-apply/hoisting-apply-detail.vue | 8 +- .../hoisting/hoisting-detail/index.vue | 4 +- .../hoisting/hoisting-list/index.vue | 2 +- pages/application/hoisting/home.vue | 2 +- 16 files changed, 277 insertions(+), 268 deletions(-) diff --git a/components/hidden_add/index.vue b/components/hidden_add/index.vue index f9a0873..36b79f5 100644 --- a/components/hidden_add/index.vue +++ b/components/hidden_add/index.vue @@ -1185,7 +1185,7 @@ export default { goSubmitQdList(){ }, - goSubmit() { + async goSubmit() { var _this = this; if (_this.imgList.length <= 0) { uni.showToast({ @@ -1318,53 +1318,50 @@ export default { } } } - new Promise((resolve, reject) => { - _this.submit().then(() => { - resolve(); - }) - }).then(() => { - var i = 0; - _this.uploadImg(fileList, i).then(() => { - resolve(); - }) - }).then(() => { - this.buttonloading = false - uni.$emit('submitByHiddenSource', { - info: "success", - initflag: true, - }); + uni.showLoading({ + title: '数据提交中' }) + this.buttonloading = true + const FILE_IDS = [] + await _this.uploadPromise(fileList, FILE_IDS) + await _this.submit(FILE_IDS) + uni.$emit('submitByHiddenSource', { + info: "success", + initflag: true, + }); }, - uploadImg(tempFilePaths, i) { + async uploadPromise(tempFilePaths,FILE_IDS){ + if (tempFilePaths.length == 0) { + uni.hideLoading(); + this.buttonloading = false + return + } + for (let i = 0; i < tempFilePaths.length; i++) { + await this.uploadImg(tempFilePaths[i],FILE_IDS) + } + }, + uploadImg(file,FILE_IDS) { return new Promise((resolve, reject) => { var _this = this; - if (tempFilePaths.length == 0) { - resolve(); - } - uni.showLoading({ - title: '上传中' - }) uni.uploadFile({ - url: basePath + '/app/imgfiles/add', - filePath: tempFilePaths[i].filePath, + url: basePath+'/app/imgfiles/add', + filePath: file.filePath, name: 'FFILE', formData: { - 'TYPE': tempFilePaths[i].type, - 'FOREIGN_KEY': _this.pd.HIDDEN_ID, + 'TYPE': file.type, + // 'FOREIGN_KEY': _this.pd.HIDDEN_ID, + 'FOREIGN_KEY': '', CORPINFO_ID: loginUser.CORPINFO_ID, USER_ID: loginUser.USER_ID, }, success: (res) => { - i++; - if (tempFilePaths.length > i) { - _this.uploadImg(tempFilePaths, i); - } else { - uni.hideLoading(); - resolve(); - } + res.data = JSON.parse(res.data) + FILE_IDS.push(res.data.pd.IMGFILES_ID) + resolve(); }, fail: (err) => { uni.hideLoading(); + this.buttonloading = false uni.showModal({ content: err.errMsg, showCancel: false @@ -1373,9 +1370,8 @@ export default { }) }) }, - submit() { + submit(FILE_IDS) { return new Promise((resolve, reject) => { - this.buttonloading = true var _this = this; // var pages = getCurrentPages(); // 获取当前页面栈 // var prePage = pages[pages.length - 2]; // 上一个页面 @@ -1430,9 +1426,9 @@ export default { HIDDENTYPE3: _this.pd.HIDDENTYPE[2] || '', CORPINFO_ID: loginUser.CORPINFO_ID, USER_ID: loginUser.USER_ID, + FILE_IDS:FILE_IDS.join(',') }, success: (res) => { - this.buttonloading = false if ("success" == res.data.result) { _this.pd.HIDDEN_ID = res.data.pd.HIDDEN_ID; resolve(); @@ -1442,11 +1438,14 @@ export default { duration: 2000 }); } + uni.hideLoading(); + this.buttonloading = false } }); }, fail: function (res) { uni.hideLoading(); + this.buttonloading = false uni.showToast({ title: "获取位置失败", duration: 2000 diff --git a/pages/application/hidden-danger-management/hidden-danger-check/hidden-danger-check-detail.vue b/pages/application/hidden-danger-management/hidden-danger-check/hidden-danger-check-detail.vue index 51f4c2b..0f406e9 100644 --- a/pages/application/hidden-danger-management/hidden-danger-check/hidden-danger-check-detail.vue +++ b/pages/application/hidden-danger-management/hidden-danger-check/hidden-danger-check-detail.vue @@ -233,7 +233,7 @@ textareaAInputREPULSE_CAUSE(e) { this.REPULSE_CAUSE = e.detail.value }, - goSubmit() { + async goSubmit() { var _this = this; if (_this.ISQUALIFIED == '1') { if (!_this.CHECKDESCR) { @@ -272,21 +272,26 @@ } } - new Promise((resolve, reject) => { - _this.submit().then(() => { - resolve(); - }) - }).then(() => { - var i = 0; - _this.uploadImg(_this.imgList, i).then(() => { - resolve(); - }) - }).then(() => { - uni.showToast({ - icon: 'none', - title: '提交成功', - duration: 1500 - }); + var fileList = []; + for (var i = 0; i < _this.imgList.length; i++) { + var file = {}; + file.type = 5; + file.filePath = _this.imgList[i]; + file.FOREIGN_KEY = _this.id; + fileList.push(file); + } + uni.showLoading({ + title: '数据提交中' + }) + this.buttonloading = true + const FILE_IDS = [] + await _this.uploadPromise(fileList,FILE_IDS) + await _this.submit(FILE_IDS) + uni.showToast({ + icon: 'none', + title: '提交成功', + duration: 1500 + }); setTimeout(function() { var pages = getCurrentPages(); // 获取当前页面栈 var prePage = pages[pages.length - 2]; // 上一个页面 @@ -294,53 +299,49 @@ uni.navigateBack({}); uni.hideLoading(); }, 1500); - }) - }, - uploadImg(tempFilePaths, i) { - return new Promise((resolve, reject) => { - var _this = this; - if (tempFilePaths.length == 0) { - resolve(); - } - uni.showLoading({ - title: '上传中' - }) - uni.uploadFile({ - url: basePath + '/app/imgfiles/add', - filePath: tempFilePaths[i], - name: 'FFILE', - - formData: { - 'FOREIGN_KEY': _this.check.HIDDENCHECK_ID, - 'TYPE': '5', + async uploadPromise(tempFilePaths,FILE_IDS) { + if (tempFilePaths.length == 0) { + uni.hideLoading(); + this.buttonloading = false + return + } + for (let i = 0; i < tempFilePaths.length; i++) { + await this.uploadImg(tempFilePaths[i],FILE_IDS) + } + }, + uploadImg(file,FILE_IDS) { + return new Promise((resolve, reject) => { + var _this = this; + uni.uploadFile({ + url: basePath + '/app/imgfiles/add', + filePath: file.filePath, + name: 'FFILE', + formData: { + 'TYPE': file.type, + 'FOREIGN_KEY':'', CORPINFO_ID: loginUser.CORPINFO_ID, USER_ID: loginUser.USER_ID, - }, - success: (res) => { - i++; - if (tempFilePaths.length > i) { - _this.uploadImg(tempFilePaths, i); - } else { - uni.hideLoading(); - resolve(); - } - }, - fail: (err) => { - uni.hideLoading(); - console.log('uploadImage fail', err); - uni.showModal({ - content: err.errMsg, - showCancel: false - }); - } - }) - }) + }, + success: (res) => { + res.data = JSON.parse(res.data) + FILE_IDS.push(res.data.pd.IMGFILES_ID) + resolve(); + }, + fail: (err) => { + uni.hideLoading(); + this.buttonloading = false + uni.showModal({ + content: err.errMsg, + showCancel: false + }); + } + }) + }) }, - submit() { + submit(FILE_IDS) { return new Promise((resolve, reject) => { var _this = this; - this.buttonloading = true uni.request({ url: basePath + "/app/hidden/check", //提交接口 method: 'POST', @@ -357,10 +358,9 @@ CHECKOR: loginUserId, CORPINFO_ID:loginUser.CORPINFO_ID, USER_ID:loginUser.USER_ID, + FILE_IDS:FILE_IDS.join(',') }, success: (res) => { - uni.hideLoading(); - this.buttonloading = false if ("success" == res.data.result) { _this.check = res.data.check; resolve(); @@ -370,6 +370,8 @@ duration: 2000 }); } + uni.hideLoading(); + this.buttonloading = false } }); diff --git a/pages/application/hidden-danger-management/hidden-danger-edit/hidden-danger-edit-detail.vue b/pages/application/hidden-danger-management/hidden-danger-edit/hidden-danger-edit-detail.vue index 83a29bb..7bca3ba 100644 --- a/pages/application/hidden-danger-management/hidden-danger-edit/hidden-danger-edit-detail.vue +++ b/pages/application/hidden-danger-management/hidden-danger-edit/hidden-danger-edit-detail.vue @@ -1170,7 +1170,7 @@ export default { textareaCInput(e){ this.pd.RECTIFYDESCR= e.detail.value }, - goSubmit() { + async goSubmit() { var _this = this; if (_this.imgList.length <= 0) { uni.showToast({ @@ -1319,51 +1319,53 @@ export default { } } } - new Promise((resolve, reject) => { - _this.submit().then(() => {resolve();}) - }).then(() => { - var i=0; - _this.uploadImg(fileList,i).then(() => {resolve();}) - }).then(() => { - setTimeout(function () { - var pages = getCurrentPages(); // 获取当前页面栈 - var prePage = pages[pages.length - 2]; // 上一个页面 - prePage.$vm.initflag = true; // A 页面 init方法 为true - uni.navigateBack({}); - uni.hideLoading(); - }, 1500); + uni.showLoading({ + title: '数据提交中' }) + this.buttonloading = true + const FILE_IDS = [] + await _this.uploadPromise(fileList, FILE_IDS) + await _this.submit(FILE_IDS) + setTimeout(function () { + var pages = getCurrentPages(); // 获取当前页面栈 + var prePage = pages[pages.length - 2]; // 上一个页面 + prePage.$vm.initflag = true; // A 页面 init方法 为true + uni.navigateBack({}); + uni.hideLoading(); + }, 1500); }, - uploadImg(tempFilePaths,i){ + async uploadPromise(tempFilePaths,FILE_IDS){ + if (tempFilePaths.length == 0) { + uni.hideLoading(); + this.buttonloading = false + return + } + for (let i = 0; i < tempFilePaths.length; i++) { + await this.uploadImg(tempFilePaths[i],FILE_IDS) + } + }, + uploadImg(file,FILE_IDS){ return new Promise((resolve, reject) => { var _this = this; - if(tempFilePaths.length==0){ - resolve(); - } - uni.showLoading({ - title: '上传中' - }) uni.uploadFile({ url: basePath+'/app/imgfiles/add', - filePath: tempFilePaths[i].filePath, + filePath: file.filePath, name: 'FFILE', formData: { - 'TYPE': tempFilePaths[i].type, - 'FOREIGN_KEY': _this.pd.HIDDEN_ID, + 'TYPE': file.type, + // 'FOREIGN_KEY': _this.pd.HIDDEN_ID, + 'FOREIGN_KEY': '', CORPINFO_ID: loginUser.CORPINFO_ID, USER_ID: loginUser.USER_ID, }, success: (res) => { - i++; - if (tempFilePaths.length > i) { - _this.uploadImg(tempFilePaths, i); - } else { - uni.hideLoading(); - resolve(); - } + res.data = JSON.parse(res.data) + FILE_IDS.push(res.data.pd.IMGFILES_ID) + resolve(); }, fail: (err) => { uni.hideLoading(); + this.buttonloading = false uni.showModal({ content: err.errMsg, showCancel: false @@ -1372,7 +1374,7 @@ export default { }) }) }, - submit(){ + submit(FILE_IDS){ return new Promise((resolve, reject) => { var _this = this; // var pages = getCurrentPages(); // 获取当前页面栈 @@ -1393,7 +1395,7 @@ export default { longitude = result[0]; latitude = result[1]; //发送 post 请求提交保存 - this.buttonloading = true + // this.buttonloading = true uni.request({ url: basePath+'/app/hidden/editHidden', method: 'POST', @@ -1433,9 +1435,10 @@ export default { USER_ID:loginUser.USER_ID, // RECORDITEM_ID:_this.itemId, // RISKITEM_ID:_this.riskId, + FILE_IDS:FILE_IDS.join(','), }, success: (res) => { - this.buttonloading = false + // this.buttonloading = false if ("success" == res.data.result) { _this.pd.HIDDEN_ID= res.data.pd.HIDDEN_ID; resolve(); @@ -1450,11 +1453,14 @@ export default { duration: 2000 }); } + uni.hideLoading(); + this.buttonloading = false } }); }, fail: function(res){ uni.hideLoading(); + this.buttonloading = false uni.showToast({ title: "获取位置失败", duration: 2000 diff --git a/pages/application/hidden-danger-management/hidden-danger-finish/hidden-danger-finish.vue b/pages/application/hidden-danger-management/hidden-danger-finish/hidden-danger-finish.vue index 1641f4e..221f776 100644 --- a/pages/application/hidden-danger-management/hidden-danger-finish/hidden-danger-finish.vue +++ b/pages/application/hidden-danger-management/hidden-danger-finish/hidden-danger-finish.vue @@ -217,6 +217,7 @@ }, //跳转事件 gotRectify(e) { + console.log(e) if (e.SOURCE === '4' || e.SOURCE === '5' || e.SOURCE === '1') { uni.navigateTo({ url: '/pages/application/hidden-danger-management/hidden-danger-record/hidden-danger-record-detail?id='+e.HIDDEN_ID, @@ -225,7 +226,7 @@ uni.navigateTo({ url: '/pages/application/hidden-danger-management/hidden-danger-record/hidden-danger-record-risk-detail?id='+e.HIDDEN_ID, }); - } else if (e.SOURCE === '2') { + } else if (e.SOURCE === '2' || e.SOURCE === '3') { uni.navigateTo({ url: '/pages/application/hidden-danger-management/hidden-danger-record/hidden-danger-record-risk-detail?id='+e.HIDDEN_ID, }); diff --git a/pages/application/hidden-danger-management/hidden-danger-no-change/hidden-danger-no-change-detail.vue b/pages/application/hidden-danger-management/hidden-danger-no-change/hidden-danger-no-change-detail.vue index a7d2781..62c1e10 100644 --- a/pages/application/hidden-danger-management/hidden-danger-no-change/hidden-danger-no-change-detail.vue +++ b/pages/application/hidden-danger-management/hidden-danger-no-change/hidden-danger-no-change-detail.vue @@ -715,11 +715,6 @@ export default { return; } } - new Promise((resolve, reject) => { - _this.submit().then(() => { - resolve(); - }) - }).then(() => { var fileList = []; for (var i = 0; i < _this.imgList.length; i++) { var file = {}; @@ -747,25 +742,25 @@ export default { fileList.push(file); } } - var m = 0; - _this.uploadImg(fileList, m).then(() => { - resolve(); - }) - }).then(() => { - uni.showToast({ - icon: 'none', - title: '提交成功', - duration: 1500 - }); - setTimeout(function () { - var pages = getCurrentPages(); // 获取当前页面栈 - var prePage = pages[pages.length - 2]; // 上一个页面 - prePage.$vm.initflag = true; // A 页面 init方法 为true - uni.navigateBack({}); - uni.hideLoading(); - }, 1500); + uni.showLoading({ + title: '数据提交中' }) - + this.buttonloading = true + const RFILE_IDS = [],PFILE_IDS = [],SFILE_IDS = []; + await _this.uploadPromise(fileList,RFILE_IDS,PFILE_IDS,SFILE_IDS) + await _this.submit(RFILE_IDS,PFILE_IDS,SFILE_IDS) + uni.showToast({ + icon: 'none', + title: '提交成功', + duration: 1500 + }); + setTimeout(function () { + var pages = getCurrentPages(); // 获取当前页面栈 + var prePage = pages[pages.length - 2]; // 上一个页面 + prePage.$vm.initflag = true; // A 页面 init方法 为true + uni.navigateBack({}); + uni.hideLoading(); + }, 1500); } else { if (!_this.pd.REPULSE_CAUSE) { uni.showToast({ @@ -831,39 +826,43 @@ export default { }); } }, - uploadImg(tempFilePaths, i) { + async uploadPromise(tempFilePaths,RFILE_IDS,PFILE_IDS,SFILE_IDS) { + if (tempFilePaths.length == 0) { + uni.hideLoading(); + this.buttonloading = false + return + } + for (let i = 0; i < tempFilePaths.length; i++) { + if (tempFilePaths[i].type == 22){ + await this.uploadImg(tempFilePaths[i],PFILE_IDS) + }else if (tempFilePaths[i].type == 4){ + await this.uploadImg(tempFilePaths[i],RFILE_IDS) + }else if (tempFilePaths[i].type == 8){ + await this.uploadImg(tempFilePaths[i],SFILE_IDS) + } + } + }, + uploadImg(file,FILE_IDS) { return new Promise((resolve, reject) => { var _this = this; - if (tempFilePaths.length == 0) { - resolve(); - } - uni.showLoading({ - title: '上传中' - }) uni.uploadFile({ url: basePath + '/app/imgfiles/add', - filePath: tempFilePaths[i].filePath, + filePath: file.filePath, name: 'FFILE', - formData: { - 'FOREIGN_KEY': tempFilePaths[i].FOREIGN_KEY, - 'TYPE': tempFilePaths[i].type, + 'TYPE': file.type, + 'FOREIGN_KEY':'', CORPINFO_ID: loginUser.CORPINFO_ID, USER_ID: loginUser.USER_ID, }, success: (res) => { - i++; - if (tempFilePaths.length > i) { - _this.uploadImg(tempFilePaths, i); - } else { - console.info("提交成功") - uni.hideLoading(); - console.info("提交成功123") - resolve(); - } + res.data = JSON.parse(res.data) + FILE_IDS.push(res.data.pd.IMGFILES_ID) + resolve(); }, fail: (err) => { uni.hideLoading(); + this.buttonloading = false uni.showModal({ content: err.errMsg, showCancel: false @@ -924,10 +923,9 @@ export default { } }) }, - submit() { + submit(RFILE_IDS,PFILE_IDS,SFILE_IDS) { return new Promise((resolve, reject) => { var _this = this; - this.buttonloading = true uni.request({ url: basePath + "/app/hidden/rectify", //提交接口 method: 'POST', @@ -953,10 +951,11 @@ export default { // OTHER: JSON.stringify(_this.other), CORPINFO_ID: loginUser.CORPINFO_ID, USER_ID: loginUser.USER_ID, + RFILE_IDS:RFILE_IDS.join(','), + PFILE_IDS:PFILE_IDS.join(','), + SFILE_IDS:SFILE_IDS.join(','), }, success: (res) => { - uni.hideLoading(); - this.buttonloading = false if ("success" == res.data.result) { _this.HIDDENSCHEME_ID = res.data.HIDDENSCHEME_ID resolve(); @@ -965,9 +964,9 @@ export default { title: '错误', duration: 2000 }); - reject(); } - + uni.hideLoading(); + this.buttonloading = false } }); }) diff --git a/pages/application/hidden-trouble-investigation/hidden-trouble-app/exclude-form.vue b/pages/application/hidden-trouble-investigation/hidden-trouble-app/exclude-form.vue index 5d9b4b9..b580de5 100644 --- a/pages/application/hidden-trouble-investigation/hidden-trouble-app/exclude-form.vue +++ b/pages/application/hidden-trouble-investigation/hidden-trouble-app/exclude-form.vue @@ -1397,9 +1397,9 @@ export default { } } } - await _this.submit() - var i = 0; - await _this.uploadPromise(fileList) + const FILE_IDS = [] + await _this.uploadPromise(fileList,FILE_IDS) + await _this.submit(FILE_IDS) var pages = getCurrentPages(); // 获取当前页面栈 var prePage = pages[pages.length - 2]; // 上一个页面 // var task = prePage.$vm.list[_this.index]; @@ -1411,7 +1411,7 @@ export default { uni.navigateBack({}); uni.hideLoading(); }, - async uploadPromise(tempFilePaths) { + async uploadPromise(tempFilePaths,FILE_IDS) { if (tempFilePaths.length == 0) { return } @@ -1419,10 +1419,10 @@ export default { title: '上传中' }) for (let i = 0; i < tempFilePaths.length; i++) { - await this.uploadImg(tempFilePaths[i]) + await this.uploadImg(tempFilePaths[i],FILE_IDS) } }, - uploadImg(file) { + uploadImg(file,FILE_IDS) { return new Promise((resolve, reject) => { var _this = this; uni.uploadFile({ @@ -1431,11 +1431,13 @@ export default { name: 'FFILE', formData: { 'TYPE': file.type, - 'FOREIGN_KEY': _this.pd.HIDDEN_ID, + 'FOREIGN_KEY':'', CORPINFO_ID: loginUser.CORPINFO_ID, USER_ID: loginUser.USER_ID, }, success: (res) => { + res.data = JSON.parse(res.data) + FILE_IDS.push(res.data.pd.IMGFILES_ID) resolve(); }, fail: (err) => { @@ -1448,7 +1450,7 @@ export default { }) }) }, - submit() { + submit(FILE_IDS) { return new Promise((resolve, reject) => { var _this = this; let longitude; @@ -1509,7 +1511,8 @@ export default { HIDDENTYPE3: _this.pd.HIDDENTYPE[2] || '', CORPINFO_ID: loginUser.CORPINFO_ID, USER_ID: loginUser.USER_ID, - HIDDEN_CATEGORY: _this.pd.HIDDEN_CATEGORY ? _this.pd.HIDDEN_CATEGORY : '' + HIDDEN_CATEGORY: _this.pd.HIDDEN_CATEGORY ? _this.pd.HIDDEN_CATEGORY : '', + FILE_IDS:FILE_IDS.join(',') }, success: (res) => { this.buttonloading = false diff --git a/pages/application/hidden-trouble-investigation/hidden-trouble-app/other-hidden-add.vue b/pages/application/hidden-trouble-investigation/hidden-trouble-app/other-hidden-add.vue index 6a8dd6f..72afcad 100644 --- a/pages/application/hidden-trouble-investigation/hidden-trouble-app/other-hidden-add.vue +++ b/pages/application/hidden-trouble-investigation/hidden-trouble-app/other-hidden-add.vue @@ -965,8 +965,9 @@ //图片上传 ChooseImage(e) { var _this = this; + var ss=4-this.imgList.length; uni.chooseImage({ - count: e==0 ? 4-this.imgList.length : 4-this.imgList1.length, //默认9 + count: ss, //默认9 sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 sourceType: ['camera','album'], //从相册选择 success: (res) => { @@ -1182,7 +1183,7 @@ textareaCInput(e){ this.pd.RECTIFYDESCR= e.detail.value }, - goSubmit() { + async goSubmit() { var _this = this; if (_this.imgList.length <= 0) { uni.showToast({ @@ -1331,12 +1332,9 @@ } } } - new Promise((resolve, reject) => { - _this.submit().then(() => {resolve();}) - }).then(() => { - var i=0; - _this.uploadImg(fileList,i).then(() => {resolve();}) - }).then(() => { + const FILE_IDS = [] + await _this.uploadPromise(fileList,FILE_IDS) + await _this.submit(FILE_IDS) var pages = getCurrentPages(); // 获取当前页面栈 var prePage = pages[pages.length - 2]; // 上一个页面 // var task = prePage.$vm.list[_this.index]; @@ -1347,47 +1345,47 @@ } uni.navigateBack({}); uni.hideLoading(); - }) }, - uploadImg(tempFilePaths,i){ - return new Promise((resolve, reject) => { - var _this = this; - if(tempFilePaths.length==0){ - resolve(); - } - uni.showLoading({ - title: '上传中' - }) - uni.uploadFile({ - url: basePath+'/app/imgfiles/add', - filePath: tempFilePaths[i].filePath, - name: 'FFILE', - formData: { - 'TYPE': tempFilePaths[i].type, - 'FOREIGN_KEY': _this.pd.HIDDEN_ID, + async uploadPromise(tempFilePaths,FILE_IDS) { + if (tempFilePaths.length == 0) { + return + } + uni.showLoading({ + title: '上传中' + }) + for (let i = 0; i < tempFilePaths.length; i++) { + await this.uploadImg(tempFilePaths[i],FILE_IDS) + } + }, + uploadImg(file,FILE_IDS) { + return new Promise((resolve, reject) => { + var _this = this; + uni.uploadFile({ + url: basePath + '/app/imgfiles/add', + filePath: file.filePath, + name: 'FFILE', + formData: { + 'TYPE': file.type, + 'FOREIGN_KEY':'', CORPINFO_ID: loginUser.CORPINFO_ID, USER_ID: loginUser.USER_ID, - }, - success: (res) => { - i++; - if (tempFilePaths.length > i) { - _this.uploadImg(tempFilePaths, i); - } else { - uni.hideLoading(); - resolve(); - } - }, - fail: (err) => { - uni.hideLoading(); - uni.showModal({ - content: err.errMsg, - showCancel: false - }); - } - }) - }) - }, - submit(){ + }, + success: (res) => { + res.data = JSON.parse(res.data) + FILE_IDS.push(res.data.pd.IMGFILES_ID) + resolve(); + }, + fail: (err) => { + uni.hideLoading(); + uni.showModal({ + content: err.errMsg, + showCancel: false + }); + } + }) + }) + }, + submit(FILE_IDS) { return new Promise((resolve, reject) => { var _this = this; // var pages = getCurrentPages(); // 获取当前页面栈 @@ -1451,6 +1449,7 @@ USER_ID:loginUser.USER_ID, // RECORDITEM_ID:_this.itemId, // RISKITEM_ID:_this.riskId, + FILE_IDS:FILE_IDS.join(',') }, success: (res) => { this.buttonloading = false diff --git a/pages/application/highwork/highwork-apply/highwork-apply-detail.vue b/pages/application/highwork/highwork-apply/highwork-apply-detail.vue index 6e0b140..1dcf191 100644 --- a/pages/application/highwork/highwork-apply/highwork-apply-detail.vue +++ b/pages/application/highwork/highwork-apply/highwork-apply-detail.vue @@ -88,7 +88,7 @@ - + 作业内容: - 安全部负责人 + 生产部负责人 {{ pd.SAFETY_USER_NAME }} - 安全部负责人意见 + 生产部负责人意见 - 安全部负责人 + 生产部负责人 {{ pd.SAFETY_USER_NAME }} 安全处负责人:{{ item.APPROVE_USER_NAME }} - 安全部负责人:{{ item.SAFETY_USER_NAME }} + 生产部负责人:{{ item.SAFETY_USER_NAME }} 验收部门负责人:{{ item.ACCEPT_USER_NAME }} @@ -267,7 +267,7 @@ export default { uni.navigateTo({ url: '/pages/application/highwork/highwork-approve/highwork-approve-detail?HIGHWORK_ID=' + e }); - }else if (this.flow === '安全部签字') { + }else if (this.flow === '生产部签字') { uni.navigateTo({ url: '/pages/application/highwork/highwork-safety/highwork-safety-detail?HIGHWORK_ID=' + e }); diff --git a/pages/application/highwork/highwork-safety/highwork-safety-detail.vue b/pages/application/highwork/highwork-safety/highwork-safety-detail.vue index 177d8d3..da1eade 100644 --- a/pages/application/highwork/highwork-safety/highwork-safety-detail.vue +++ b/pages/application/highwork/highwork-safety/highwork-safety-detail.vue @@ -2,18 +2,18 @@ 返回 - 安全部意见 + 生产部意见 - 安全部负责人意见 + 生产部负责人意见 - 安全部负责人 + 生产部负责人 diff --git a/pages/application/highwork/home.vue b/pages/application/highwork/home.vue index 26e73c6..e40c16e 100644 --- a/pages/application/highwork/home.vue +++ b/pages/application/highwork/home.vue @@ -136,13 +136,13 @@ + url="/pages/application/highwork/highwork-list/index?flow=生产部签字"> {{ count.SAFETY }} - 安全部意见 + 生产部意见 - 安全部 + 生产部 - 安全部负责人 + 生产部负责人 @@ -1041,12 +1041,12 @@ - 安全部负责人意见 + 生产部负责人意见 - 安全部负责人 + 生产部负责人 {{ pd.SAFETY_USER_NAME }} - 安全部负责人意见 + 生产部负责人意见 - 安全部负责人 + 生产部负责人 {{ pd.SAFETY_USER_NAME }} 安全处负责人:{{ item.APPROVE_USER_NAME }} - 安全部负责人:{{ item.SAFETY_USER_NAME }} + 生产部负责人:{{ item.SAFETY_USER_NAME }} 验收部门负责人:{{ item.ACCEPT_USER_NAME }} diff --git a/pages/application/hoisting/home.vue b/pages/application/hoisting/home.vue index 0152317..6af011d 100644 --- a/pages/application/hoisting/home.vue +++ b/pages/application/hoisting/home.vue @@ -130,7 +130,7 @@ {{ count.SAFETY }} - 安全部意见 + 生产部意见