kun 19/10/14 11:20
This commit is contained in:
@@ -113,7 +113,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<label>传真电话:</label>
|
||||
<input type="text" placeholder="非必填" name="fax_tel" v-model="fax_tel" value required />
|
||||
<input type="text" placeholder="非必填" name="fax_tel" v-model="fax_tel" value />
|
||||
</div>
|
||||
</aside>
|
||||
<!-- end -->
|
||||
@@ -200,7 +200,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<label>传真电话:</label>
|
||||
<input type="text" placeholder="非必填" name="respophone" v-model="respophone" value required />
|
||||
<input type="text" placeholder="非必填" name="respophone" v-model="respophone" value />
|
||||
</div>
|
||||
</aside>
|
||||
<!-- end -->
|
||||
@@ -348,12 +348,13 @@
|
||||
<input type="file" @change="getFile($event)" v-show="false" name="file" />
|
||||
</label>
|
||||
</div>
|
||||
<span for>只能上传一张图片</span>
|
||||
<span for>只能上传一张不同的图片</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="file">
|
||||
<img class="img-img" :src="file" alt />
|
||||
<!-- <iframe class="img-img" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" :src="src"></iframe> -->
|
||||
</template>
|
||||
<div class="ll">
|
||||
<button type="button" @click="btn(0)">上一页</button>
|
||||
@@ -442,7 +443,8 @@ export default {
|
||||
funds: '',
|
||||
proimages: '',
|
||||
file: '',
|
||||
subStatus: 0
|
||||
subStatus: 0,
|
||||
src: ''
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
@@ -465,7 +467,7 @@ export default {
|
||||
this.sub = s
|
||||
}
|
||||
|
||||
this.sub = s
|
||||
// this.sub = s
|
||||
|
||||
if (s == 1) {
|
||||
if (this.name == '' || this.company == '' || this.tid == '' ||
|
||||
@@ -486,7 +488,16 @@ export default {
|
||||
},
|
||||
/** 上传文件 */
|
||||
getFile(event) {
|
||||
let _this = this
|
||||
let file = event.target.files[0];
|
||||
/*
|
||||
let reader = new FileReader()
|
||||
reader.readAsDataURL(file) // 这里是最关键的一步,转换就在这里
|
||||
reader.onloadend = function () {
|
||||
_this.src = this.result
|
||||
}
|
||||
*/
|
||||
|
||||
let param = new FormData(); //创建form对象
|
||||
param.append('file', file);//通过append向form对象添加数据
|
||||
// console.log(param.get('file')); //FormData私有类对象,访问不到,可以通过get判断值是否传进去
|
||||
@@ -498,6 +509,7 @@ export default {
|
||||
let url = response.data.data.url
|
||||
this.file = url
|
||||
})
|
||||
console.log(this.file)
|
||||
},
|
||||
/** 保存和提交 */
|
||||
submit(index) {
|
||||
@@ -529,8 +541,8 @@ export default {
|
||||
s = index;
|
||||
this.subStatus = s
|
||||
this.proimages = this.file
|
||||
if(this.proimages === ''){
|
||||
alert('文件未上传!')
|
||||
if (this.proimages === '') {
|
||||
alert('文件还未上传!')
|
||||
return
|
||||
}
|
||||
let _this = this
|
||||
@@ -591,7 +603,7 @@ export default {
|
||||
}).then(res => {
|
||||
if (res.data.code === 200) {
|
||||
alert(res.data.data.msg)
|
||||
_this.file = ''
|
||||
_this.proimages = ''
|
||||
} else {
|
||||
alert(res.data.message)
|
||||
}
|
||||
@@ -669,7 +681,13 @@ export default {
|
||||
margin-top: 25px;
|
||||
width: 150px;
|
||||
height: 250px;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 0px;
|
||||
height: 00x;
|
||||
}
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
min-width: 1280px;
|
||||
box-sizing: border-box;
|
||||
|
||||
Reference in New Issue
Block a user