Commit 61f42fdf by 王勇飞

tmimage

parent 45f1f338
...@@ -53,6 +53,42 @@ class calculatepriceCtl extends CtlBase { ...@@ -53,6 +53,42 @@ class calculatepriceCtl extends CtlBase {
return System.getResult2(null, null); return System.getResult2(null, null);
} }
} }
//商标图样上传接口
async tmimage(o, req) {
let obj = {
"img_url": o.fileUrl
};
let url = settings.apiconfig.tmImage;
let rc = System.getObject("util.execClient");
let rtn = null;
try {
rtn = await rc.execPost(obj, url);
let j = JSON.parse(rtn.stdout);
return j;
} catch (e) {
console.log(e);
return System.getResult2(null, null);
}
}
//商标委托书模板下载
async tmtrust(o, req) {
let obj = {
"assignor": o.assignor,
"tm_name": o.tm_name,
"address": o.address
};
let url = settings.apiconfig.tmTrust;
let rc = System.getObject("util.execClient");
let rtn = null;
try {
rtn = await rc.execPost(obj, url);
let j = JSON.parse(rtn.stdout);
return j;
} catch (e) {
console.log(e);
return System.getResult2(null, null);
}
}
async toblack(o, req) { async toblack(o, req) {
var app = req.session.app; var app = req.session.app;
var obj = { var obj = {
......
...@@ -191,6 +191,9 @@ var settings = { ...@@ -191,6 +191,9 @@ var settings = {
LbsAddressUrl: "http://43.247.184.92:8880/lbs/api/addresssearch",//地址查询 LbsAddressUrl: "http://43.247.184.92:8880/lbs/api/addresssearch",//地址查询
LbsLalUrl: "http://43.247.184.92:8889/lbs/api/lalsearch",//坐标查询 LbsLalUrl: "http://43.247.184.92:8889/lbs/api/lalsearch",//坐标查询
LbsCityUrl: "http://43.247.184.92:8886/lbs/api/cityseicsoftwareCopyrightSearchUrlarch",//城市查询 LbsCityUrl: "http://43.247.184.92:8886/lbs/api/cityseicsoftwareCopyrightSearchUrlarch",//城市查询
tmImage: "http://43.247.184.92:15503/gsb/tmimage",//商标图样上传接口
tmTrust: "http://43.247.184.92:15503/gsb/tmtrust",//商标委托书模板下载
pdf2wordUrl: function () { pdf2wordUrl: function () {
if (settings.env == "dev") { if (settings.env == "dev") {
return "http://59.110.125.77:3000/api/pdf2word/pdf2word"; return "http://59.110.125.77:3000/api/pdf2word/pdf2word";
......
...@@ -23,7 +23,7 @@ module.exports= ...@@ -23,7 +23,7 @@ module.exports=
prop: 'value', prop: 'value',
event: 'uploadsuccess' event: 'uploadsuccess'
}, },
props:["d","action","listtype","filetype","ifshowlist","value","flag","dataSouce"], props:["d","action","listtype","filetype","ifshowlist","value","flag","dataSouce","isLt200K"],
data:function(){ data:function(){
return { return {
data:this.d, data:this.d,
...@@ -65,9 +65,17 @@ module.exports= ...@@ -65,9 +65,17 @@ module.exports=
this.$message.warning('文件格式错误,请上传'+this.accept+'格式文件'); this.$message.warning('文件格式错误,请上传'+this.accept+'格式文件');
return false; return false;
} }
const isLt2M = file.size / 1024 / 1024 < 2; let isLtMeg = "";
let isLt2M = file.size / 1024 < 200;
if(this.isLt200K) {
isLt2M = file.size / 1024 < 200;
isLtMeg = "200KB";
} else {
isLt2M = file.size / 1024 / 1024 < 2;
isLtMeg = "2MB";
}
if (!isLt2M) { if (!isLt2M) {
this.$message.warning('上传失败,上传内容大小不能超过 2MB!'); this.$message.warning('上传失败,上传内容大小不能超过' + isLtMeg + '!');
return false; return false;
} }
this.result=""; this.result="";
......
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
<img width="120px" height="120px" style="border:2px dashed #e9e9e9" v-else <img width="120px" height="120px" style="border:2px dashed #e9e9e9" v-else
src="http://gsb-zc.oss-cn-beijing.aliyuncs.com/empty2018082212365411225525855.jpg" /> src="http://gsb-zc.oss-cn-beijing.aliyuncs.com/empty2018082212365411225525855.jpg" />
<br /> <br />
<gsb-upload flag="picUrl" :d="d" ref="picUrl" @setKey="setKey" :action="action" filetype="image/jpeg" <gsb-upload flag="picUrl" :d="d" ref="picUrl" @setKey="setKey" :action="action" filetype="image/jpg, image/png, image/jpeg"
:ifshowlist="false" @uploadsuccess="uploadsuccess" @error="error"> :ifshowlist="false" @uploadsuccess="uploadsuccess" @error="error" isLt200K="true">
<el-button type="primary">黑白商标上传</el-button> <el-button type="primary">黑白商标上传</el-button>
</gsb-upload> </gsb-upload>
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
src="http://gsb-zc.oss-cn-beijing.aliyuncs.com/empty2018082212365411225525855.jpg" /> src="http://gsb-zc.oss-cn-beijing.aliyuncs.com/empty2018082212365411225525855.jpg" />
<br /> <br />
<gsb-upload :d="d" :action="action" flag="colorizedPicUrl" ref="colorizedPicUrl" @setKey="setKey" <gsb-upload :d="d" :action="action" flag="colorizedPicUrl" ref="colorizedPicUrl" @setKey="setKey"
filetype="image/jpeg" :ifshowlist="false" @uploadsuccess="uploadsuccess" @error="error"> filetype="image/jpg, image/png, image/jpeg" :ifshowlist="false" @uploadsuccess="uploadsuccess" @error="error" isLt200K="true">
<el-button type="primary">彩色商标上传</el-button> <el-button type="primary">彩色商标上传</el-button>
</gsb-upload> </gsb-upload>
</el-form-item> </el-form-item>
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
src="http://gsb-zc.oss-cn-beijing.aliyuncs.com/empty2018082212365411225525855.jpg" /> src="http://gsb-zc.oss-cn-beijing.aliyuncs.com/empty2018082212365411225525855.jpg" />
<br /> <br />
<gsb-upload :d="d" ref="colorizedPicUrl" :action="action" flag="colorizedPicUrl" @setKey="setKey" <gsb-upload :d="d" ref="colorizedPicUrl" :action="action" flag="colorizedPicUrl" @setKey="setKey"
filetype="image/jpeg" :ifshowlist="false" @uploadsuccess="uploadsuccess" @error="error"> filetype="image/jpg, image/png, image/jpeg" :ifshowlist="false" @uploadsuccess="uploadsuccess" @error="error" isLt200K="true">
<el-button type="primary">彩色商标上传</el-button> <el-button type="primary">彩色商标上传</el-button>
</gsb-upload> </gsb-upload>
</el-form-item> </el-form-item>
......
...@@ -379,10 +379,10 @@ ...@@ -379,10 +379,10 @@
console.log(params); console.log(params);
var url = window.location.href.split("/autosubmitinside")[0] + "/mobile2?" + "params=" + params + "#/createwts2"; var url = window.location.href.split("/autosubmitinside")[0] + "/mobile2?" + "params=" + params + "#/createwts2";
console.log(url); console.log(url);
this.$root.getReq("/web/calculatepriceCtl/createWTS2", { "url": url }).then(function (d) { this.$root.getReq("/web/calculatepriceCtl/tmtrust", { assignor: this.apply.applyName, tm_name: this.form.tmName, address: this.apply.applyAddr}).then(function (d) {
if (d.data.url != "" && d.data.url != null) { if (d.data.tm_trust_url != "" && d.data.tm_trust_url != null) {
window.open(d.data.url); window.open(d.data.tm_trust_url);
} else { } else {
that.$message.warning(`操作失败`); that.$message.warning(`操作失败`);
} }
...@@ -530,13 +530,16 @@ ...@@ -530,13 +530,16 @@
var that = this; var that = this;
if (obj.flag == "picUrl") { if (obj.flag == "picUrl") {
that.$root.showMask(); that.$root.showMask();
this.$root.getReq("/web/calculatepriceCtl/toblack", { "key": obj.key }).then(function (d) { console.log("====" + JSON.stringify(obj));
this.$root.getReq("/web/calculatepriceCtl/tmimage", { "fileUrl": obj.result }).then(function (d) {
that.$root.hideMask(); that.$root.hideMask();
if (d.status == 0) { console.log(JSON.stringify(d));
that.form.picUrl = d.data.url; if (d.status == 1) {
that.form.picUrl = d.data.gray_url;
} else { } else {
that.form.picUrl = ""; that.form.picUrl = "";
that.$message.warning(`上传失败请重新上传`); that.$message.warning(`上传失败请重新上传`+ d.msg);
return false; return false;
} }
}).catch(function () { }).catch(function () {
...@@ -548,13 +551,13 @@ ...@@ -548,13 +551,13 @@
} }
if (obj.flag == "colorizedPicUrl") { if (obj.flag == "colorizedPicUrl") {
that.$root.showMask(); that.$root.showMask();
this.$root.getReq("/web/calculatepriceCtl/adjustTMSize", { "key": obj.key }).then(function (d) { this.$root.getReq("/web/calculatepriceCtl/tmimage", { "fileUrl": obj.result }).then(function (d) {
that.$root.hideMask(); that.$root.hideMask();
if (d.status == 0) { if (d.status == 1) {
that.form.colorizedPicUrl = d.data.url; that.form.colorizedPicUrl = d.data.original_url;
} else { } else {
that.form.colorizedPicUrl = ""; that.form.colorizedPicUrl = "";
that.$message.warning(`上传失败请重新上传`); that.$message.warning(`上传失败请重新上传`+ d.msg);
return false; return false;
} }
}).catch(function () { }).catch(function () {
......
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
<img width="120px" height="120px" style="border:2px dashed #e9e9e9" v-else <img width="120px" height="120px" style="border:2px dashed #e9e9e9" v-else
src="http://gsb-zc.oss-cn-beijing.aliyuncs.com/empty2018082212365411225525855.jpg" /> src="http://gsb-zc.oss-cn-beijing.aliyuncs.com/empty2018082212365411225525855.jpg" />
<br /> <br />
<gsb-upload flag="picUrl" :d="d" ref="picUrl" @setKey="setKey" :action="action" filetype="image/jpeg" <gsb-upload flag="picUrl" :d="d" ref="picUrl" @setKey="setKey" :action="action" filetype="image/jpg, image/png, image/jpeg"
:ifshowlist="false" @uploadsuccess="uploadsuccess" @error="error"> :ifshowlist="false" @uploadsuccess="uploadsuccess" @error="error" isLt200K="true">
<el-button type="primary">黑白商标上传</el-button> <el-button type="primary">黑白商标上传</el-button>
</gsb-upload> </gsb-upload>
...@@ -51,8 +51,8 @@ ...@@ -51,8 +51,8 @@
src="http://gsb-zc.oss-cn-beijing.aliyuncs.com/empty2018082212365411225525855.jpg" /> src="http://gsb-zc.oss-cn-beijing.aliyuncs.com/empty2018082212365411225525855.jpg" />
<br /> <br />
<gsb-upload :d="d" ref="colorizedPicUrl" flag="colorizedPicUrl" @setKey="setKey" :action="action" <gsb-upload :d="d" ref="colorizedPicUrl" flag="colorizedPicUrl" @setKey="setKey" :action="action"
flag="colorizedPicUrl" filetype="image/jpeg" :ifshowlist="false" @uploadsuccess="uploadsuccess" flag="colorizedPicUrl" filetype="image/jpg, image/png, image/jpeg" :ifshowlist="false" @uploadsuccess="uploadsuccess"
@error="error"> @error="error" isLt200K="true">
<el-button type="primary">彩色商标上传</el-button> <el-button type="primary">彩色商标上传</el-button>
</gsb-upload> </gsb-upload>
</el-form-item> </el-form-item>
......
...@@ -472,14 +472,14 @@ ...@@ -472,14 +472,14 @@
} }
if (obj.flag == "picUrl") { if (obj.flag == "picUrl") {
that.$root.showMask(); that.$root.showMask();
this.$root.getReq("/web/calculatepriceCtl/toblack", { "key": obj.key }).then(function (d) { this.$root.getReq("/web/calculatepriceCtl/tmimage", { "fileUrl": obj.result }).then(function (d) {
if (d.status == 0) { if (d.status == 1) {
that.form.picUrl = d.data.url; that.form.picUrl = d.data.gray_url;
that.$root.hideMask(); that.$root.hideMask();
} else { } else {
that.form.picUrl = ""; that.form.picUrl = "";
that.$root.hideMask(); that.$root.hideMask();
that.$message.warning(`上传失败请重新上传`); that.$message.warning(`上传失败请重新上传`+ d.msg);
return false; return false;
} }
...@@ -492,15 +492,15 @@ ...@@ -492,15 +492,15 @@
} }
if (obj.flag == "colorizedPicUrl") { if (obj.flag == "colorizedPicUrl") {
that.$root.showMask(); that.$root.showMask();
this.$root.getReq("/web/calculatepriceCtl/adjustTMSize", { "key": obj.key }).then(function (d) { this.$root.getReq("/web/calculatepriceCtl/tmimage", { "fileUrl": obj.result }).then(function (d) {
if (d.status == 0) { if (d.status == 1) {
that.form.colorizedPicUrl = d.data.url; that.form.colorizedPicUrl = d.data.original_url;
that.$root.hideMask(); that.$root.hideMask();
} else { } else {
that.form.colorizedPicUrl = ""; that.form.colorizedPicUrl = "";
that.$root.hideMask(); that.$root.hideMask();
that.$message.warning(`上传失败请重新上传`); that.$message.warning(`上传失败请重新上传`+ d.msg);
return false; return false;
} }
}).catch(function () { }).catch(function () {
...@@ -1050,10 +1050,10 @@ ...@@ -1050,10 +1050,10 @@
console.log(params); console.log(params);
var url = window.location.href.split("/autosubmitinside")[0] + "/mobile2?" + "params=" + params + "#/createwts2"; var url = window.location.href.split("/autosubmitinside")[0] + "/mobile2?" + "params=" + params + "#/createwts2";
console.log(url); console.log(url);
this.$root.getReq("/web/calculatepriceCtl/createWTS2", { "url": url }).then(function (d) { this.$root.getReq("/web/calculatepriceCtl/tmtrust", { assignor: this.apply.applyName, tm_name: this.form.tmName, address: this.apply.applyAddr}).then(function (d) {
if (d.data.url != "" && d.data.url != null) { if (d.data.tm_trust_url != "" && d.data.tm_trust_url != null) {
window.open(d.data.url); window.open(d.data.tm_trust_url);
} else { } else {
that.$message.warning(`操作失败`); that.$message.warning(`操作失败`);
} }
......
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