Commit fa1a7d8e by Tang

feat: 条码查询

parent 44792de5
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<div class="title">企业信息</div> <div class="title">企业信息</div>
<div class="company-info"></div> <div class="company-info"></div>
</template> </template>
<span v-else>您输入的商品条码格式不正确,请确认后重试。</span> <span v-else>{{ errorMsg }}</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -76,10 +76,17 @@ import { getUUID } from "@/utils/utils"; ...@@ -76,10 +76,17 @@ import { getUUID } from "@/utils/utils";
export default { export default {
data() { data() {
return { return {
captchaPath: '', captchaPath: "",
search: { code: "", captcha: "", type: "GLN", requestedLanguage: "en", uuid: ''}, search: {
code: "",
captcha: "",
type: "GLN",
requestedLanguage: "en",
uuid: "",
},
searchCodeShow: "", searchCodeShow: "",
showResult: false, showResult: false,
errorMsg: "",
result: null, result: null,
}; };
}, },
...@@ -94,21 +101,22 @@ export default { ...@@ -94,21 +101,22 @@ export default {
uuid: this.search.uuid, uuid: this.search.uuid,
}; };
this.$api.getCaptcha(query).then((res) => { this.$api.getCaptcha(query).then((res) => {
console.log(res, 'res'); console.log(res, "res");
this.captchaPath = window.URL.createObjectURL(res.body); this.captchaPath = window.URL.createObjectURL(res.body);
}); });
}, },
async handleSearch() { async handleSearch() {
this.searchCodeShow = this.search.code; this.searchCodeShow = this.search.code;
this.showResult = true; this.showResult = true;
const params = {...this.search}; const params = { ...this.search };
const searchGlnRes = const searchGlnRes = await this.$api.search.searchGln(params);
await this.$api.search.searchGln(params);
const { returnCode, data } = searchGlnRes; const { returnCode, data } = searchGlnRes;
console.log(searchGlnRes, 'searchGlnRes');
if (returnCode === "0") { if (returnCode === "0") {
this.result = data; this.result = data;
} else { } else {
this.errorMsg =
searchGlnRes.returnMsg ||
"您输入的商品条码格式不正确,请确认后重试。";
this.result = null; this.result = null;
} }
}, },
......
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