Commit 92bdac58 authored by 旭艳's avatar 旭艳

问题申报附件上传

parent a17b65f7
......@@ -144,7 +144,7 @@
<script>
// import test from './test.vue'
let inputElement = null
// import axios from 'axios'
import axios from 'axios'
// import { downloadPdfHandle } from '@/api/inventory.js'
import { post } from '@/utils/http'
export default {
......@@ -194,11 +194,16 @@ export default {
imgFilesList: [],
imgUrlList: [],
userList: [],
loading: false
loading: false,
bucketId: null
}
},
watch: {},
created() {},
created() {
this.$api.getAppInfo('tf-mom').then(res => {
this.bucketId = res.bucketId
})
},
mounted() {},
methods: {
toGetImg() {
......@@ -236,6 +241,7 @@ export default {
reader.onload = function() {
const params = new FormData() // 创建一个form对象
params.append('file', el.target.files[0])
params.append('bucketId', that.bucketId)
params.append('domainName', 'tongfei')
// 文件读取完成后
// 读取完成后,将结果赋值给img的src
......@@ -249,6 +255,7 @@ export default {
reader.onload = function() {
const params = new FormData() // 创建一个form对象
params.append('file', el.target.files[0])
params.append('bucketId', that.bucketId)
params.append('domainName', 'tongfei')
// 文件读取完成后
// 读取完成后,将结果赋值给img的src
......@@ -265,32 +272,16 @@ export default {
uploadImg() {
return new Promise((resolve, reject) => {
const result = []
// this.imgFilesList.forEach((item, i) => {
// const baseURl = downloadPdfHandle()
// result[i] = new Promise((resolve, reject) => {
// axios({
// method: 'post',
// url: baseURl + `/dfs/fileManager/upload`,
// transformRequest: [
// function() {
// return item
// }
// ],
// headers: {
// token: `${localStorage.getItem('token')}`,
// 'Content-Type': 'multipart/form-data;charse=UTF-8',
// 'equipment_id': `${localStorage.getItem('uid')}`
// }
// })
// .then((res) => {
// resolve(res.data.items.fileId)
// })
// .catch((err) => {
// reject(err)
// })
// .finally(() => {})
// })
// })
this.imgFilesList.forEach((item, i) => {
const url = `/dfs/fileManager/feign/uploadFile`
result[i] = new Promise((resolve, reject) => {
post(url, item).then(res => {
resolve(res.items)
}).catch((err) => {
reject(err)
})
})
})
Promise.all(result).then(res => {
resolve(res)
}).catch((err) => {
......@@ -336,13 +327,12 @@ export default {
this.uploadImg().then(res => {
var result = []
res.forEach(item => {
result.push({ targetId: item })
result.push({ operator: 'ADD', target: item })
})
var receiver = ''
this.form.receiver.forEach((item, i) => {
receiver += (item + (this.form.receiver.length - 1 > i ? ',' : ''))
})
console.log(receiver)
const params = {
operator: 'ADD',
subTypeName: 'SpotProblem',
......@@ -359,8 +349,8 @@ export default {
airModel: this.form.airModel,
sorties: this.form.sorties,
standPosition: this.form.standPosition,
receiver: receiver
// 'objFileLinks': result,
receiver: receiver,
objFileLinks: result
}
post('/SpotProblem/recursion', params)
......@@ -424,7 +414,7 @@ export default {
.el-icon-circle-close{
position: absolute;
top: 10px;
right: 10px;
right: -16px;
color: red;
cursor: pointer;
z-index: 999;
......
......@@ -49,7 +49,7 @@
检验员:{{ item.inspector }}
</div>
<!-- <div>配套率:{{ item.ready | proporFilters }}</div> -->
<div>配套状态:{{ item.outStatus | outStatusFilters }}</div>
<div>配套状态:{{ item.outStatus }}</div>
<div v-show="!item.isOK" class="upgrade">
升版中
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment