|
|
@@ -30,6 +30,14 @@
|
|
|
<u-cell title="附件" arrow-direction="down">
|
|
|
<fileMain slot="value" v-model="form.files"></fileMain>
|
|
|
</u-cell>
|
|
|
+ <u-cell title="现场照片" arrow-direction="down">
|
|
|
+ <view slot="value" style="display: flex;align-items: center;width: 100%;">
|
|
|
+ <u-button :plain="true" :hairline="true" style="width: 100rpx;" size='mini' text="拍照上传" @click="chooseImage"></u-button>
|
|
|
+ </view>
|
|
|
+ </u-cell>
|
|
|
+ <view class="imgList">
|
|
|
+ <u-album :urls="imgs" :multipleSize="160" :rowCount="4"></u-album>
|
|
|
+ </view>
|
|
|
|
|
|
|
|
|
<view class="footerButton">
|
|
|
@@ -69,10 +77,11 @@
|
|
|
opportunityId: '',
|
|
|
stageCode: '',
|
|
|
fileId: [],
|
|
|
- stageName: ''
|
|
|
+ stageName: '',
|
|
|
},
|
|
|
type: '',
|
|
|
- linkList:[]
|
|
|
+ linkList:[],
|
|
|
+ imgs: []
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -80,6 +89,7 @@
|
|
|
this.type = data.type
|
|
|
if (data.data) {
|
|
|
this.form = JSON.parse(data.data)
|
|
|
+ this.imgs = this.form.imgs;
|
|
|
}
|
|
|
this.linkList=JSON.parse(data.linkList).map(item=>{
|
|
|
return {
|
|
|
@@ -131,12 +141,66 @@
|
|
|
if(this.form.stageCode){
|
|
|
this.form.stageName=this.business_stage_code.find(item=>item.value==this.form.stageCode)?.text
|
|
|
}
|
|
|
+ this.form.imgs = this.imgs;
|
|
|
uni.$emit('updateFollowList', {
|
|
|
data: this.form,
|
|
|
type: this.type
|
|
|
})
|
|
|
this.back()
|
|
|
},
|
|
|
+ // 上传照片
|
|
|
+ chooseImage() {
|
|
|
+ const _this = this
|
|
|
+ uni.chooseImage({
|
|
|
+ count: 9, //默认9
|
|
|
+ sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
|
|
+ sourceType: ['camera'], //现场拍照
|
|
|
+ success: function(res) {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ })
|
|
|
+
|
|
|
+ _this.uploadFile(res.tempFilePaths).then(res => {
|
|
|
+ res.forEach(item => {
|
|
|
+ let fileNames = item.storePath.split('/')
|
|
|
+ let url = _this.apiUrl +
|
|
|
+ '/main/file/getFile?objectName=' + item.storePath+
|
|
|
+ '&fullfilename=' + fileNames[fileNames.length -
|
|
|
+ 1]
|
|
|
+ _this.imgs.push(url)
|
|
|
+ })
|
|
|
+ uni.hideLoading()
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ uploadFile(list) {
|
|
|
+ let PromiseAll = []
|
|
|
+ const apiUrl = this.apiUrl
|
|
|
+ const token = uni.getStorageSync("token"); //取存本地的token
|
|
|
+ list.forEach(item => {
|
|
|
+ PromiseAll.push(
|
|
|
+ new Promise((resolve, reject) => {
|
|
|
+ uni.uploadFile({
|
|
|
+ url: apiUrl + '/main/file/upload',
|
|
|
+ filePath: item,
|
|
|
+ name: 'multiPartFile',
|
|
|
+ header: {
|
|
|
+ authorization: token
|
|
|
+ },
|
|
|
+ success: (uploadFileRes) => {
|
|
|
+ let data = JSON.parse(uploadFileRes.data)
|
|
|
+ resolve(data.data)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }),
|
|
|
+ )
|
|
|
+ })
|
|
|
+
|
|
|
+ return Promise.all(PromiseAll)
|
|
|
+
|
|
|
+ },
|
|
|
|
|
|
}
|
|
|
}
|
|
|
@@ -152,6 +216,10 @@
|
|
|
padding-bottom: 84rpx;
|
|
|
}
|
|
|
|
|
|
+ .imgList {
|
|
|
+ padding: 20rpx;
|
|
|
+ }
|
|
|
+
|
|
|
.footerButton {
|
|
|
width: 100%;
|
|
|
height: 84rpx;
|
|
|
@@ -168,6 +236,16 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ uni-button {
|
|
|
+ width: 100rpx;
|
|
|
+ // height: 50rpx;
|
|
|
+ margin-left: 10rpx;
|
|
|
+ margin-right: 0;
|
|
|
+ color: #fff !important;
|
|
|
+ border: none;
|
|
|
+ background: #157a2c !important;
|
|
|
+
|
|
|
+ }
|
|
|
// /deep/.u-button {
|
|
|
// height: 100%;
|
|
|
// }
|