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

问题申报附件上传

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