Commit 8bd9ebf1 authored by 张锡奇's avatar 张锡奇

upload

parent 226fcad4
...@@ -153,6 +153,7 @@ export default { ...@@ -153,6 +153,7 @@ export default {
}, },
async activated(){ async activated(){
window.d = this; window.d = this;
this.global.$off('searchData'); this.global.$off('searchData');
this.global.$off('scrollTable'); this.global.$off('scrollTable');
this.global.$off('clickTd'); this.global.$off('clickTd');
...@@ -172,7 +173,6 @@ export default { ...@@ -172,7 +173,6 @@ export default {
this.routerToDetail(); this.routerToDetail();
}) })
// let result = await this.request('get_ticket',{ // let result = await this.request('get_ticket',{
// data:{ // data:{
// url:window.location.href // url:window.location.href
......
...@@ -134,9 +134,6 @@ ...@@ -134,9 +134,6 @@
mode="during" mode="during"
:defaultDate="calendarValue" :defaultDate="calendarValue"
@change="Change"/> @change="Change"/>
<button @click="scan">ddddddd</button>
</div> </div>
</template> </template>
<script> <script>
...@@ -231,11 +228,6 @@ export default { ...@@ -231,11 +228,6 @@ export default {
} }
return new Date(date.getTime()); return new Date(date.getTime());
}, },
scan(){
wx.miniProgram.scanQRCode(function(res) {
console.log(111,res.miniprogram) // true
})
}
}, },
computed:{ computed:{
startDate(val){ startDate(val){
......
...@@ -137,6 +137,20 @@ export default { ...@@ -137,6 +137,20 @@ export default {
async mounted(){ async mounted(){
var that = window.d = this; var that = window.d = this;
this.query = this.$route.query; this.query = this.$route.query;
let url = `${this.query.sWebServiceURL}/projectpic/HS/${this.query.uGUID}.jpg`.replace(/\w+\.asmx\//,'');
Axios({
method: 'GET',
url: url
}).then(res=>{
this.fileList.push(
{
src:url
}
)
}).catch(err=>{
console.log(err)
})
this.$refs['upload'].addEventListener('change', function() { this.$refs['upload'].addEventListener('change', function() {
var t_files = this.files; var t_files = this.files;
var str = ''; var str = '';
...@@ -177,6 +191,9 @@ export default { ...@@ -177,6 +191,9 @@ export default {
}else if(_base64.indexOf('data:image/jpeg;base64,') != -1){ }else if(_base64.indexOf('data:image/jpeg;base64,') != -1){
_base64 = _base64.split('data:image/jpeg;base64,') _base64 = _base64.split('data:image/jpeg;base64,')
} }
this.$vux.loading.show({
text: '上传中'
})
var datacopy = `<?xml version="1.0" encoding="utf-8"?><soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"><soap12:Body><SavePic xmlns="http://tempuri.org/"><sToken>F563EBDF-0FC1-4777-96B8-033C3E89D6F8</sToken><sProjectNo>${this.query.sProjectNo}</sProjectNo><sGuid>${this.query.uGUID}</sGuid><sBase64>${_base64}</sBase64></SavePic></soap12:Body></soap12:Envelope>` var datacopy = `<?xml version="1.0" encoding="utf-8"?><soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"><soap12:Body><SavePic xmlns="http://tempuri.org/"><sToken>F563EBDF-0FC1-4777-96B8-033C3E89D6F8</sToken><sProjectNo>${this.query.sProjectNo}</sProjectNo><sGuid>${this.query.uGUID}</sGuid><sBase64>${_base64}</sBase64></SavePic></soap12:Body></soap12:Envelope>`
...@@ -192,10 +209,12 @@ export default { ...@@ -192,10 +209,12 @@ export default {
//设置回调函数 //设置回调函数
xhr.onreadystatechange = ()=>{ xhr.onreadystatechange = ()=>{
if(xhr.readyState == 4){ if(xhr.readyState == 4){
let doc = new DOMParser().parseFromString(xhr.response); let doc = new DOMParser().parseFromString(xhr.response);
if(xhr.status == 200){ if(xhr.status == 200){
let data = doc.getElementsByTagName('SavePicResult')[0].firstChild.nodeValue; let data = doc.getElementsByTagName('SavePicResult')[0].firstChild.nodeValue;
if(data == 'Success'){ if(data == 'Success'){
this.$vux.loading.hide();
this.$vux.confirm.show({ this.$vux.confirm.show({
title:"提示", title:"提示",
content:data, content:data,
...@@ -204,19 +223,32 @@ export default { ...@@ -204,19 +223,32 @@ export default {
this.fileList = [{src:base64}] this.fileList = [{src:base64}]
} }
}else if(xhr.status == 500){ }else if(xhr.status == 500){
let data = doc.getElementsByTagName('soap:Text')[0].firstChild.nodeValue;
this.$vux.confirm.show({ this.$vux.confirm.show({
title:"提示", title:"提示",
content:data, content:xhr.response,
showCancelButton:false, showCancelButton:false,
}) })
// let data = doc.getElementsByTagName('soap:Text')[0].firstChild.nodeValue;
this.$vux.loading.hide();
// this.$vux.confirm.show({
// title:"提示",
// content:data,
// showCancelButton:false,
// })
}else if(xhr.status == 0){ }else if(xhr.status == 0){
this.$vux.loading.hide();
this.$vux.confirm.show({ this.$vux.confirm.show({
title:"提示", title:"提示",
content:'存在跨域问题!', content:'存在跨域问题!',
showCancelButton:false, showCancelButton:false,
}) })
}else if(xhr.status == 404){
this.$vux.loading.hide();
this.$vux.confirm.show({
title:"提示",
content:'请求接口不存在!',
showCancelButton:false,
})
} }
} }
}; };
......
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