Commit fa1a7d8e by Tang

feat: 条码查询

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