From 580ec084547a80b2e5c79f5b009a3d5b907a0eba Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Mon, 26 Feb 2024 13:46:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E4=BF=AE=E6=B7=BB=E5=8A=A0=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=9B=BE=E7=89=87=20=20=E5=A4=87=E4=BB=B6=E7=BB=B4?= =?UTF-8?q?=E4=BF=AE=E5=B7=A5=E5=8D=95=E6=B7=BB=E5=8A=A0=E5=A4=87=E4=BB=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=9A=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/upload.js | 12 + config.js | 2 +- pages/deviceReport/addForm.vue | 7 +- pages/deviceReport/index.vue | 29 +- pages/repairOrder/detail.vue | 9 +- .../addForm.vue | 334 +++++++++++++----- static/images/photo.png | Bin 0 -> 9386 bytes 7 files changed, 299 insertions(+), 94 deletions(-) create mode 100644 api/upload.js create mode 100644 static/images/photo.png diff --git a/api/upload.js b/api/upload.js new file mode 100644 index 0000000..31891f5 --- /dev/null +++ b/api/upload.js @@ -0,0 +1,12 @@ +import upload from '@/utils/upload' +import request from '@/utils/request' +// 上传 +export function uploadFile(data) { + console.log(data) + return upload({ + url: '/infra/file/upload', + method: 'PUT', + filePath:data.filePath, + name: data.name + }) +} diff --git a/config.js b/config.js index b2655d2..c399f60 100644 --- a/config.js +++ b/config.js @@ -1,7 +1,7 @@ // 应用全局配置 module.exports = { // http://192.168.0.165:1208 - baseUrl: process.env.NODE_ENV === 'development' ? 'http://192.168.1.18:12080' : 'http://dev.ccwin-in.com:25200/api', + baseUrl: process.env.NODE_ENV === 'development' ? 'http://192.168.0.181:12080' : 'http://dev.ccwin-in.com:25200/api', baseApi:process.env.NODE_ENV === 'development' ? '/admin-api' : '/api/admin-api', // 应用信息 appInfo: { diff --git a/pages/deviceReport/addForm.vue b/pages/deviceReport/addForm.vue index 3c9b4c5..9521e44 100644 --- a/pages/deviceReport/addForm.vue +++ b/pages/deviceReport/addForm.vue @@ -142,11 +142,16 @@ this.$modal.showToast('请输入所属厂区') return; } + if (this.imgList.length == 0) { + this.$modal.showToast('请选择图片') + return; + } const data = { describes: this.form.describes, deviceNumber: this.form.deviceNumber, factoryAreaNumber: this.form.factoryAreaNumber, - type: this.type + type: this.type, + filePathList: this.imgList, } this.$modal.confirm('是否添加报修').then(() => { this.$modal.loading('加载中') diff --git a/pages/deviceReport/index.vue b/pages/deviceReport/index.vue index 2dac7c3..d8488f2 100644 --- a/pages/deviceReport/index.vue +++ b/pages/deviceReport/index.vue @@ -31,6 +31,9 @@ 所属厂区:{{item.factoryAreaName}} + + + 撤销 - @@ -104,6 +106,21 @@ }) }) + }, + previewImage(current,array){ + uni.previewImage({ + urls: array, + current:current, + longPressActions: { + itemList: ['发送给朋友', '保存图片', '收藏'], + success: function(data) { + console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片'); + }, + fail: function(err) { + console.log(err.errMsg); + } + } + }); } }, onLoad(option) { @@ -234,4 +251,14 @@ } } } + .images{ + display: flex; + width: 100%; + image{ + width: 30%; + margin-right: 20rpx; + height: 200rpx; + border-radius: 10rpx; + } + } \ No newline at end of file diff --git a/pages/repairOrder/detail.vue b/pages/repairOrder/detail.vue index ee19489..42e0c06 100644 --- a/pages/repairOrder/detail.vue +++ b/pages/repairOrder/detail.vue @@ -246,10 +246,13 @@ }, // APP维修工单接单、点击完成、验证 orderClick(type) { - if(!this.serviceList || this.serviceList&&this.serviceList.length == 0){ - this.$modal.showToast('请添加维修内容') - return; + if(this.data.status == 'PECEIVED'){ + if(!this.serviceList || this.serviceList&&this.serviceList.length == 0){ + this.$modal.showToast('请添加维修内容') + return; + } } + const data = { number: this.data.number, status: this.data.status, diff --git a/pages/sparePartsServiceWorkOrderList/addForm.vue b/pages/sparePartsServiceWorkOrderList/addForm.vue index 17d8dcd..108aef0 100644 --- a/pages/sparePartsServiceWorkOrderList/addForm.vue +++ b/pages/sparePartsServiceWorkOrderList/addForm.vue @@ -1,11 +1,68 @@