Commit 22145abe by 王悦

fix校验流程

parent 955b9d82
...@@ -27,12 +27,13 @@ ...@@ -27,12 +27,13 @@
<el-form-item label="商标名称" style="width:450px;float:left" prop="tmName"> <el-form-item label="商标名称" style="width:450px;float:left" prop="tmName">
<el-input v-model="form.tmName"></el-input> <el-input v-model="form.tmName"></el-input>
</el-form-item> </el-form-item>
<div style="float:left;padding-left:10px">
<el-button @click="checkname">阿里验证</el-button>
</div>
<div style="float:left;padding-left:10px" v-if="form.tmFormType==3"> <div style="float:left;padding-left:10px" v-if="form.tmFormType==3">
<el-button @click="word2pic">文字商标在线生成</el-button> <el-button @click="word2pic">文字商标在线生成</el-button>
</div> </div>
<div style="float:left;padding-left:10px" v-if="form.tmFormType==3">
<el-button @click="checkname">阿里验证</el-button>
</div>
<div style="clear:both;"></div> <div style="clear:both;"></div>
<el-form-item style="width:350px;float:left" label="商标图样_黑白" prop="picUrl"> <el-form-item style="width:350px;float:left" label="商标图样_黑白" prop="picUrl">
<img width="120px" height="120px" style="border:2px dashed #e9e9e9" v-if="form.picUrl" <img width="120px" height="120px" style="border:2px dashed #e9e9e9" v-if="form.picUrl"
......
...@@ -811,23 +811,21 @@ ...@@ -811,23 +811,21 @@
}); });
}, },
checkname() async checkname()
{ {
if (!this.form.tmName) { if (!this.form.tmName) {
return this.$message.error('商标名称不能为空!'); return this.$message.error('商标名称不能为空!');
} }
this.$root.showMask(); let d = await this.$root.getReq("/web/calculatepriceCtl/checkname", { name: this.form.tmName });
this.$root.getReq("/web/calculatepriceCtl/checkname", { name: this.form.tmName }).then(d => {
console.log(d); console.log(d);
if (d.data.data.Result === "PASS") { if (d.data.data.Result === "PASS") {
this.$message.success(`名称可以使用`); this.$message.success(`名称可以使用`);
return true;
}else if (d.data.data.Result === "BLOCK") { }else if (d.data.data.Result === "BLOCK") {
this.form.tmName = ""; this.form.tmName = "";
this.$message.warning(d.data.data.Message) this.$message.warning(d.data.data.Message);
return false;
} }
}).finally(() => {
this.$root.hideMask();
});
}, },
updatePrice(){ updatePrice(){
this.form.totalSum = 0; this.form.totalSum = 0;
...@@ -924,8 +922,12 @@ ...@@ -924,8 +922,12 @@
} }
return { code: 1 }; return { code: 1 };
}, },
submitForm(formName) { async submitForm(formName) {
var that = this; var that = this;
if(formName == "form"){
let pass = await this.checkname();
if (!pass)return;
}
if (formName == "form" || formName == "apply") { if (formName == "form" || formName == "apply") {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
......
...@@ -26,12 +26,12 @@ ...@@ -26,12 +26,12 @@
<el-form-item label="商标名称" style="width:450px;float:left" prop="tmName"> <el-form-item label="商标名称" style="width:450px;float:left" prop="tmName">
<el-input v-model="form.tmName"></el-input> <el-input v-model="form.tmName"></el-input>
</el-form-item> </el-form-item>
<div style="float:left;padding-left:10px">
<el-button @click="checkname">阿里验证</el-button>
</div>
<div style="float:left;padding-left:10px" v-if="form.tmFormType==3"> <div style="float:left;padding-left:10px" v-if="form.tmFormType==3">
<el-button @click="word2pic">文字商标在线生成</el-button> <el-button @click="word2pic">文字商标在线生成</el-button>
</div> </div>
<div style="float:left;padding-left:10px" v-if="form.tmFormType==3">
<el-button @click="checkname">阿里验证</el-button>
</div>
<div style="clear:both;"></div> <div style="clear:both;"></div>
<el-form-item style="width:350px;float:left" label="商标图样_黑白" prop="picUrl"> <el-form-item style="width:350px;float:left" label="商标图样_黑白" prop="picUrl">
......
...@@ -739,23 +739,21 @@ ...@@ -739,23 +739,21 @@
}); });
}, },
checkname() async checkname()
{ {
if (!this.form.tmName) { if (!this.form.tmName) {
return this.$message.error('商标名称不能为空!'); return this.$message.error('商标名称不能为空!');
} }
this.$root.showMask(); let d = await this.$root.getReq("/web/calculatepriceCtl/checkname", { name: this.form.tmName });
this.$root.getReq("/web/calculatepriceCtl/checkname", { name: this.form.tmName }).then(d => { console.log(d);
console.log(d); if (d.data.data.Result === "PASS") {
if (d.data.data.Result === "PASS") { this.$message.success(`名称可以使用`);
this.$message.success(`名称可以使用`); return true;
}else if (d.data.data.Result === "BLOCK") { }else if (d.data.data.Result === "BLOCK") {
this.form.tmName = ""; this.form.tmName = "";
this.$message.warning(d.data.data.Message) this.$message.warning(d.data.data.Message);
} return false;
}).finally(() => { }
this.$root.hideMask();
});
}, },
updatePrice(){ updatePrice(){
this.form.totalSum = 0; this.form.totalSum = 0;
...@@ -791,12 +789,16 @@ ...@@ -791,12 +789,16 @@
selfclear(){ selfclear(){
this.nclOne = []; this.nclOne = [];
}, },
submitForm(formName) { async submitForm(formName) {
var that = this; var that = this;
if (that.orderErrorMsg && that.orderErrorMsg.code && that.orderErrorMsg.code != 1) { if (that.orderErrorMsg && that.orderErrorMsg.code && that.orderErrorMsg.code != 1) {
that.$message.warning(that.orderErrorMsg.msg); that.$message.warning(that.orderErrorMsg.msg);
return false; return false;
} }
if(formName == "form"){
let pass = await this.checkname();
if (!pass)return;
}
var channelCode = this.$store.state.channelCode; var channelCode = this.$store.state.channelCode;
if (formName == "form" || formName == "apply") { if (formName == "form" || formName == "apply") {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
......
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