Commit e8f7ca36 by Tang

feat: 境内码查询接口

parent 7fa690ac
......@@ -5,7 +5,7 @@ import {
const Prefix = process.env.NODE_ENV === 'development' ? '/gs1' : '';
// 条码查询—GLN查询/境外码查询
// 条码查询—GLN查询/境外码查询
const searchGln = (params = {}) => {
return POST(`${Prefix}/office/codeSearch/api/gln`, params)
}
......@@ -15,8 +15,14 @@ const searchGetList = (params = {}) => {
return POST(`${Prefix}/office/shortcode/api/getList`, params)
}
// 条码查询—境内码查询
const searchInternal = (params = {}) => {
return POST(`${Prefix}/office/codeSearch/api/domesticCode`, params)
}
export default {
searchGln,
searchGetList,
searchInternal
}
......@@ -12,55 +12,55 @@
</el-radio-group>
<el-form
label-position="left"
label-width="180px"
style="margin-top: 40px"
:model="companySearch"
label-position="left"
label-width="180px"
style="margin-top: 40px"
:model="companySearch"
>
<el-form-item label="境内商品条码信息查询:">
<el-input
v-show="company === CODE"
v-model="companySearch.code"
placeholder="请输入正确的厂商识别代码!"
class="w240"
v-show="company === CODE"
v-model="companySearch.code"
placeholder="请输入正确的厂商识别代码!"
class="w240"
></el-input>
<el-input
v-show="company === NAME"
v-model="companySearch.name"
placeholder="请输入正确的商品条码!"
class="w240"
v-show="company === NAME"
v-model="companySearch.name"
placeholder="请输入正确的商品条码!"
class="w240"
></el-input>
<el-input
v-show="company === ADDRESS"
v-model="companySearch.address"
placeholder="请输入正确的厂商名称!"
class="w240"
v-show="company === ADDRESS"
v-model="companySearch.address"
placeholder="请输入正确的厂商名称!"
class="w240"
></el-input>
</el-form-item>
<el-form-item label="验证码:">
<el-button
type="primary"
class="w240"
icon="gs-guard-icon"
@click="handleVerification"
v-if="!isVerificationPass"
type="primary"
class="w240"
icon="gs-guard-icon"
@click="handleVerification"
v-if="!isVerificationPass"
>
点击此处进行验证
</el-button>
<el-button
type="success"
class="w240"
icon="el-icon-circle-check"
v-else
type="success"
class="w240"
icon="el-icon-circle-check"
v-else
>
验证通过
</el-button>
<el-button
style="margin-left: 40px"
type="primary"
@click="handleSearchCompany"
>查询
style="margin-left: 40px"
type="primary"
@click="handleSearchCompany"
>查询
</el-button>
</el-form-item>
</el-form>
......@@ -69,31 +69,31 @@
<el-tab-pane label="查询产品信息" name="second">
<el-form
label-position="left"
label-width="180px"
style="margin-top: 20px"
:model="productSearch"
label-position="left"
label-width="180px"
style="margin-top: 20px"
:model="productSearch"
>
<el-form-item label="境内商品条码信息查询:">
<el-input
v-model="productSearch.code"
placeholder="请输入13位或14位的商品条码"
class="w240"
v-model="productSearch.code"
placeholder="请输入13位或14位的商品条码"
class="w240"
></el-input>
</el-form-item>
<el-form-item label="验证码:">
<el-button type="primary" class="w240">
<div style="diplay: flex; align-item: center">
<img style="height: 14px" src="./img/guard.png" alt="" />
<img style="height: 14px" src="./img/guard.png" alt=""/>
点击此处进行验证
</div>
</el-button>
<el-button
style="margin-left: 40px"
type="primary"
@click="handleSearchProduct"
>查询
style="margin-left: 40px"
type="primary"
@click="handleSearchProduct"
>查询
</el-button>
</el-form-item>
</el-form>
......@@ -107,39 +107,39 @@
<template v-if="result">
<!--结果表格-->
<el-table
:data="result"
header-cell-class-name="search-table-hc"
style="width: 100%"
:data="result"
header-cell-class-name="search-table-hc"
style="width: 100%"
>
<el-table-column prop="id" label="厂商识别代码" width="180">
<template slot-scope="scope">
<span type="text" class="hover" size="small">{{
scope.row.id
}}</span>
scope.row.id
}}</span>
</template>
</el-table-column>
<el-table-column prop="name" label="厂商名称" width="180">
</el-table-column>
<el-table-column prop="status" label="状态"> </el-table-column>
<el-table-column prop="status" label="状态"></el-table-column>
<el-table-column label="详细">
<template>
<span
type="text"
class="hover pointer"
@click="handleCheck()"
size="small"
>详情</span
type="text"
class="hover pointer"
@click="handleCheck()"
size="small"
>详情</span
>
</template>
</el-table-column>
<el-table-column label="查看">
<template>
<span
type="text"
class="hover pointer"
@click="handleCheck()"
size="small"
>查看</span
type="text"
class="hover pointer"
@click="handleCheck()"
size="small"
>查看</span
>
</template>
</el-table-column>
......@@ -153,20 +153,20 @@
<div class="notice">
<div class="title">友情提示</div>
<div class="content-wrapper">
<img src="./img/pic_ex_jl.png" align="right" alt="" />
<img src="./img/pic_ex_jl.png" align="right" alt=""/>
<p>
1、<a
href="http://www.ancc.org.cn/Knowledge/goodsGln.aspx"
target="_blank"
style="color: #5ac8fa"
>商品条码</a
>
>商品条码</a
>
(又称全球贸易项目代码GTIN)是指包含厂商识别代码在内的对零售商品、非零售商品、物流单元、位置、资产及服务进行全球惟一标识的一种代码(或称数据结构)。对贸易项目进行编码和符号表示(前缀码为690-699是境内条码),能够实现商品零售(POS)、进货、存货管理、自动补货、销售分析及其它业务运作的自动化。
<a
href="http://www.ancc.org.cn/Knowledge/goodsGln.aspx"
target="_blank"
style="color: #5ac8fa"
>了解更多 >></a
href="http://www.ancc.org.cn/Knowledge/goodsGln.aspx"
target="_blank"
style="color: #5ac8fa"
>了解更多 >></a
>
</p>
<p style="color: #ff3b30">
......@@ -178,12 +178,12 @@
</div>
</div>
<Vcode :show="isShowVcode" @success="onSuccess" @close="onClose" />
<Vcode :show="isShowVcode" @success="onSuccess" @close="onClose"/>
</div>
</template>
<script>
import { getUUID } from "@/utils/utils";
import {getUUID} from "@/utils/utils";
import Vcode from "vue-puzzle-vcode";
const CODE = '1';
......@@ -210,6 +210,7 @@ export default {
},
result: null,
searchCodeShow: "",
errorMsg: "",
showResult: false,
};
},
......@@ -244,26 +245,26 @@ export default {
this.showResult = true;
if (this.company === CODE) {
this.searchCodeShow = this.companySearch.code;
if (this.companySearch.code === "1") {
this.result = [
{ id: "6912614", name: "北京阿里巴巴食品有限公司", 状态: "已注销" },
{ id: "6912614", name: "北京阿里巴巴食品有限公司", 状态: "已注销" },
{ id: "6912614", name: "北京阿里巴巴食品有限公司", 状态: "已注销" },
{ id: "6912614", name: "北京阿里巴巴食品有限公司", 状态: "已注销" },
{ id: "6912614", name: "北京阿里巴巴食品有限公司", 状态: "已注销" },
{ id: "6912614", name: "北京阿里巴巴食品有限公司", 状态: "已注销" },
{ id: "6912614", name: "北京阿里巴巴食品有限公司", 状态: "已注销" },
{ id: "6912614", name: "北京阿里巴巴食品有限公司", 状态: "已注销" },
];
}
// if (this.companySearch.code === "1") {
// this.result = [
// { id: "6912614", name: "北京阿里巴巴食品有限公司", 状态: "已注销" },
// { id: "6912614", name: "北京阿里巴巴食品有限公司", 状态: "已注销" },
// { id: "6912614", name: "北京阿里巴巴食品有限公司", 状态: "已注销" },
// { id: "6912614", name: "北京阿里巴巴食品有限公司", 状态: "已注销" },
// { id: "6912614", name: "北京阿里巴巴食品有限公司", 状态: "已注销" },
// { id: "6912614", name: "北京阿里巴巴食品有限公司", 状态: "已注销" },
// { id: "6912614", name: "北京阿里巴巴食品有限公司", 状态: "已注销" },
// { id: "6912614", name: "北京阿里巴巴食品有限公司", 状态: "已注销" },
// ];
// }
} else if (this.company === NAME) {
this.searchCodeShow = this.companySearch.name;
} else {
this.searchCodeShow = this.companySearch.address;
}
const params = { type:this.company,uuid: getUUID() };
const searchGlnRes = await this.$api.search.searchGln(params);
const { returnCode, data } = searchGlnRes;
const params = {type: this.company, uuid: getUUID(), code: this.searchCodeShow, captcha: "7n8df",};
const searchGlnRes = await this.$api.search.searchInternal(params);
const {returnCode, data} = searchGlnRes;
if (returnCode === "0") {
this.result = [data];
} else {
......@@ -276,7 +277,7 @@ export default {
handleSearchProduct() {
window.open(
`http://search.anccnet.com/searchResult2.aspx?keyword=${this.productSearch.code}`
`http://search.anccnet.com/searchResult2.aspx?keyword=${this.productSearch.code}`
);
},
},
......
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