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

upload

parent dcdbe7f8
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="Content gradient" v-if="typeList.input || typeList.select"> <div class="Content gradient" v-if="typeList.input || typeList.select">
<div class="selector" v-if="typeList.select"> <div class="selector" v-if="typeList.select">
<select :multiple="multiple" v-model="selectValue" @change="changeSelect($event)"> <select :multiple="multiple" v-model="selectValue" @change="changeSelect($event)">
<option v-for="(item,index) in status" :key="index" :value="item.sStatus">{{item.sStatus || '全部'}}</option> <option v-for="(item,index) in status" :key="index" :value="item.sStatus">{{item.sStatus}}</option>
</select> </select>
</div> </div>
<div class="_input" v-if="typeList.input"> <div class="_input" v-if="typeList.input">
......
...@@ -163,8 +163,6 @@ export default { ...@@ -163,8 +163,6 @@ export default {
name: 'profitAnalysisTrack', name: 'profitAnalysisTrack',
data () { data () {
return { return {
host:'https://weixin.huansi.net/apiproxy/huansi/service/proxy/',
// host:'http://192.168.4.40:5001',
columns:[ columns:[
{ {
width:'20vw', width:'20vw',
......
...@@ -175,9 +175,10 @@ export default { ...@@ -175,9 +175,10 @@ export default {
async getStatus(){ async getStatus(){
let res = await this.apiGet(`${urlFun('default')}/fabricorder/status/`,{},true); let res = await this.apiGet(`${urlFun('default')}/fabricorder/status/`,{},true);
this.status = res; this.status = res;
this.status.map(x=>{ this.status.unshift({
x.sStatus = x.sStatus || '全部'; sStatus:'全部'
}) })
console.log(this.status)
}, },
async getHdr(flag){ async getHdr(flag){
if(this.search.per_page < 30){ if(this.search.per_page < 30){
......
...@@ -162,8 +162,6 @@ export default { ...@@ -162,8 +162,6 @@ export default {
name: 'searchOrderTrack', name: 'searchOrderTrack',
data () { data () {
return { return {
host:'https://weixin.huansi.net/apiproxy/huansi/service/proxy/',
// host:'http://192.168.4.40:5001',
columns:[ columns:[
{ {
width:'20vw', width:'20vw',
......
...@@ -84,7 +84,6 @@ export default { ...@@ -84,7 +84,6 @@ export default {
uGuid:'', uGuid:'',
hdr:{}, hdr:{},
dtl:[], dtl:[],
host:'https://weixin.huansi.net/apiproxy/huansi/service/proxy/',
options: { options: {
getThumbBoundsFn (index) { getThumbBoundsFn (index) {
// find thumbnail element // find thumbnail element
......
...@@ -182,7 +182,6 @@ export default { ...@@ -182,7 +182,6 @@ export default {
hdr:{}, hdr:{},
dtl:[], dtl:[],
uGuid:'', uGuid:'',
host:'https://weixin.huansi.net/apiproxy/huansi/service/proxy/'
} }
}, },
async mounted(){ async mounted(){
......
...@@ -141,6 +141,19 @@ export default { ...@@ -141,6 +141,19 @@ export default {
var str = ''; var str = '';
var reader=new FileReader(); var reader=new FileReader();
reader.onload = function(e){ reader.onload = function(e){
e.preventDefault();
var file = that.$refs['upload'];
var filePath = file.value; //js中无法获取文件的真是路径
var fileName = filePath.substring(filePath.lastIndexOf('\\')+1); //文件名
var extName = fileName.substring(fileName.lastIndexOf('.')+1); //后缀名
if(extName != 'png' && extName != 'jpg' && extName != 'jpeg'){
that.$vux.confirm.show({
title:"提示",
content:`不允许上传${extName}格式图片!`,
showCancelButton:false,
})
return false;
}
that.upload(reader.result); //或者 e.target.result都是一样的,都是base64码 that.upload(reader.result); //或者 e.target.result都是一样的,都是base64码
} }
reader.readAsDataURL(this.files[0]); reader.readAsDataURL(this.files[0]);
...@@ -154,7 +167,17 @@ export default { ...@@ -154,7 +167,17 @@ export default {
}, },
upload(base64,callback){ upload(base64,callback){
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.split('data:image/png;base64,')[1]}</sBase64></SavePic></soap12:Body></soap12:Envelope>` let _base64 = Util.deepClone(base64);
if(_base64.indexOf('data:image/png;base64,') != -1){
_base64 = _base64.split('data:image/png;base64,')
}else if(_base64.indexOf('data:image/jpg;base64,') != -1){
_base64 = _base64.split('data:image/jpg;base64,')
}else if(_base64.indexOf('data:image/jpeg;base64,') != -1){
_base64 = _base64.split('data:image/jpeg;base64,')
}
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 xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
//打开连接 //打开连接
...@@ -235,7 +258,7 @@ export default { ...@@ -235,7 +258,7 @@ export default {
}, },
deactivated(){ deactivated(){
// 移除监听 // 移除监听
this.$refs['upload'].removeEventListener("change") // this.$refs['upload'].removeEventListener("change")
} }
} }
</script> </script>
\ No newline at end of file
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