|
|
@@ -62,18 +62,23 @@
|
|
|
</view>
|
|
|
|
|
|
<uni-section title="投诉内容" type="line" padding>
|
|
|
- <textarea maxlength="-1" v-model="form.content" placeholder="投诉内容" :disabled="id != '' ? true : false"></textarea>
|
|
|
+ <textarea maxlength="-1" auto-height v-model="form.content" placeholder="投诉内容" :disabled="id != '' ? true : false"></textarea>
|
|
|
</uni-section>
|
|
|
|
|
|
<uni-section title="上传附件" type="line">
|
|
|
<view class="example-body" v-if="id == ''">
|
|
|
<uni-file-picker limit="5" file-mediatype="all" @select="select" @progress="progress" @success="success" @fail="fail" @delete="deleteMe" :auto-upload="false" ref="uploadMe"></uni-file-picker>
|
|
|
</view>
|
|
|
- <view v-else>
|
|
|
+ <view class="u-p-b-15">
|
|
|
<view v-for="(item,index) in fuJianShangChuanArray" :key="index" style="margin: 0 10rpx;">
|
|
|
- <view style="line-height: 50rpx;color: #888888" @click="uploadClick(item.id,item.fileName,item.ext)">
|
|
|
- <u-icon size="30" name="file-text-fill"></u-icon>
|
|
|
- {{item.fileName + '.' + item.ext}}
|
|
|
+ <view class="fileBox">
|
|
|
+ <view @click="uploadClick(item.id,item.name)">
|
|
|
+ <u-icon size="30" name="file-text-fill"></u-icon>
|
|
|
+ {{item.name}}
|
|
|
+ </view>
|
|
|
+ <view style="width: 50rpx;" @click="deleteMe(item.id)" v-if="(type != 1 && type != 2)">
|
|
|
+ <u-icon size="26" name="close"></u-icon>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -398,76 +403,21 @@
|
|
|
})
|
|
|
},
|
|
|
getFileList(ids) {
|
|
|
- let lists = ids.split(",")
|
|
|
- let params = {}
|
|
|
- params.ids = lists
|
|
|
- this.$http.post("/ibps/platform/v3/file/attachment/transfer", params).then(res => {
|
|
|
- if (res.data.state == 200) {
|
|
|
- const data = res.data.data
|
|
|
- lists.forEach(item => {
|
|
|
- let obj = {
|
|
|
- id: item,
|
|
|
- fileName: data[item].fileName,
|
|
|
- ext: data[item].ext
|
|
|
- }
|
|
|
- this.fuJianShangChuanArray.push(obj)
|
|
|
- })
|
|
|
- }
|
|
|
+ this.$uploades.getFilesList(ids, this).then(res => {
|
|
|
+ this.fuJianShangChuanArray = res
|
|
|
})
|
|
|
},
|
|
|
// 获取上传状态
|
|
|
select(file) {
|
|
|
- //读取文件大小
|
|
|
- var fileSize = file.size;
|
|
|
- let token = uni.getStorageSync(ACCESS_TOKEN)
|
|
|
- if (fileSize > 1048576) {
|
|
|
- that.$message({
|
|
|
- type: 'error',
|
|
|
- showClose: true,
|
|
|
- duration: 3000,
|
|
|
- message: '文件大于1M!'
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
- let that = this
|
|
|
- uni.showToast({
|
|
|
- title: '上传中',
|
|
|
- mask: true
|
|
|
+ this.$uploades.selectUpload(file).then(res => {
|
|
|
+ res.forEach(item => {
|
|
|
+ this.fuJianShangChuanArray.push(item)
|
|
|
+ })
|
|
|
})
|
|
|
- for (let e in file.tempFilePaths) {
|
|
|
- var extName = file.tempFiles[e].file.name.substring(file.tempFiles[e].file.name.lastIndexOf(
|
|
|
- '.'));
|
|
|
- const path = file.tempFilePaths[e];
|
|
|
- uni.uploadFile({
|
|
|
- // url: http.apiHosp + 'ibps/platform/v3/file/upload/mobile', //仅为示例,非真实的接口地址
|
|
|
- url: http.apiHosp + '/ibps/platform/v3/file/upload', //仅为示例,非真实的接口地址
|
|
|
- filePath: path,
|
|
|
- name: 'file',
|
|
|
- formData: {
|
|
|
- 'ext': '.jpg'
|
|
|
- },
|
|
|
- header: {
|
|
|
- 'X-Authorization-access_token': token,
|
|
|
- 'X-Authorization-systemid': ''
|
|
|
- },
|
|
|
- success: (uploadFileRes) => {
|
|
|
- let data = JSON.parse(uploadFileRes.data)
|
|
|
- that.fuJianShangChuanArray.push({
|
|
|
- fileid: file.tempFiles[e].file.uuid,
|
|
|
- uploadid: data.data.id
|
|
|
- })
|
|
|
- uni.hideLoading()
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
},
|
|
|
// 删除
|
|
|
- deleteMe(file) {
|
|
|
- for (let e in this.fuJianShangChuanArray) {
|
|
|
- if (this.fuJianShangChuanArray[e].fileid == file.tempFile.uuid) {
|
|
|
- this.fuJianShangChuanArray.splice(e, 1)
|
|
|
- }
|
|
|
- }
|
|
|
+ deleteMe(id) {
|
|
|
+ this.fuJianShangChuanArray = this.fuJianShangChuanArray.filter(item => item.id !== id)
|
|
|
},
|
|
|
// 获取上传进度
|
|
|
progress(e) {},
|
|
|
@@ -476,13 +426,13 @@
|
|
|
// 上传失败
|
|
|
fail(e) {},
|
|
|
onSubmit() {
|
|
|
- if (this.form.guanLianYangPin) {
|
|
|
+ if (!this.form.guanLianYangPin) {
|
|
|
return this.$methCommon.getPrompt('请选择样品')
|
|
|
}
|
|
|
let tmpArray = []
|
|
|
- for (let e in this.fuJianShangChuanArray) {
|
|
|
- tmpArray.push(this.fuJianShangChuanArray[e].uploadid)
|
|
|
- }
|
|
|
+ this.fuJianShangChuanArray.forEach((item) => {
|
|
|
+ tmpArray.push(item.id)
|
|
|
+ })
|
|
|
|
|
|
let info = uni.getStorageSync(USER_INFO);
|
|
|
let useId = info.user.id
|
|
|
@@ -800,4 +750,16 @@
|
|
|
font-size: 14px;
|
|
|
color: #333;
|
|
|
}
|
|
|
+
|
|
|
+ .fileBox {
|
|
|
+ line-height: 50rpx;
|
|
|
+ color: #888888;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ border: 1rpx solid #DDDDDD;
|
|
|
+ border-radius: 8rpx;
|
|
|
+ padding: 5rpx;
|
|
|
+ margin-top: 10rpx;
|
|
|
+ }
|
|
|
</style>
|