Commit 7fa690ac by Jianli Ou

Merge branch 'master' of https://gitee.com/gs1-office-web-sit/gs1

parents ce035151 be17bdbe
......@@ -15,7 +15,19 @@ const businessGetTop4 = (params = {}) => {
return POST(`${Prefix}/office/policy/api/getTop4`, params)
}
// 条码注册/注销公告
const businessGetEanUpcByCondition = (params = {}) => {
return POST(`${Prefix}/office/eanupc/api/getEanUpcByCondition`, params)
}
// 条码注册/注销公告详情
const businessGetDetailById = (params = {}) => {
return POST(`${Prefix}/office/eanupc/api/getDetailById`, params)
}
export default {
businessDownLoad,
businessGetTop4,
businessGetEanUpcByCondition,
businessGetDetailById,
}
......@@ -20,7 +20,7 @@
aria-selected="true"
@click="jump(i)"
>
{{tmp.name}}
{{ tmp.name }}
</button>
</li>
</ul>
......@@ -38,7 +38,7 @@
:aria-labelledby="tmp.type + '-tab'"
>
<list :list="tmp.data" />
<pages />
<pages :pages="pageParams" @toPagesFather="receivePagesChild" />
</div>
</div>
</div>
......@@ -68,14 +68,7 @@ export default {
link: "/Business/Notice",
active: "zhuce",
data: [
{
name: "武隆区陈氏面条加工坊",
time: "2021-09-30",
},
{
name: "重庆功存科技有限公司",
time: "2021-09-30",
},
],
},
{
......@@ -84,22 +77,70 @@ export default {
link: "/Business/Notice",
active: "zhuxiao",
data: [
{
name: "杭州瀚扬科技有限公司",
time: "2021-09-22",
},
{
name: "贵州国伟自由行智能科技有限公司",
time: "2021-09-07",
},
],
},
],
pageParams: {
currentPage: 1,
pageSize: 10,
pageCount: 5,
total: 100,
},
logoutFlag: "1",
};
},
created() {
this.init();
},
methods: {
init() {
this.setLogoutFlag(this.$route.query.id);
},
setLogoutFlag(currentTab) {
if (currentTab === "zhuce") {
this.logoutFlag = "1";
} else {
this.logoutFlag = "0";
}
this.businessGetEanUpcByCondition();
},
// 条码注册/注销公告
async businessGetEanUpcByCondition() {
const params = {
page: this.pageParams.currentPage,
limit: this.pageParams.pageSize,
logoutFlag: this.logoutFlag,
};
console.log(params, "params");
const businessGetEanUpcByConditionRes =
await this.$api.business.businessGetEanUpcByCondition(params);
const { returnCode, data } = businessGetEanUpcByConditionRes;
if (returnCode === "0") {
console.log(businessGetEanUpcByConditionRes, "条码注册/注销公告");
this.pageParams.total = data.totalCount;
let key;
if (this.logoutFlag === '1') {
key = 0;
} else {
key = 1;
}
data.list.forEach(el => {
el.name = el.firmName;
el.time = this.$moment(el.logDate).format('YYYY-MM-DD');
});
this.list[key].data = data.list
console.log(this.list, 'this.list');
}
},
// 接收分页子组件传过来的值
receivePagesChild(val) {
this.pageParams.currentPage = val;
this.businessGetEanUpcByCondition();
},
jump(i) {
// console.log(i);
this.setLogoutFlag(this.list[i].active);
this.$router.push({
path: this.list[i].link,
query: {
......
......@@ -38,12 +38,19 @@
<div class="result-box-title">查询 {{ searchCodeShow }} 结果</div>
<div class="result-box-body">
<template v-if="result">
<div class="title">商品信息</div>
<div class="product-info"></div>
<div class="title">企业信息</div>
<div class="company-info"></div>
<el-table
:data="result"
header-cell-class-name="search-table-hc"
style="width: 100%"
>
<el-table-column prop="gepirRequestedKey.requestedKeyValue" label="GLN" width="180"> </el-table-column>
<el-table-column prop="address.name" label="企业名称(含英文)" width="180">
</el-table-column>
<el-table-column prop="address.streetAddressOne" label="中文地址"></el-table-column>
<el-table-column prop="status" label="英文地址"> </el-table-column>
</el-table>
</template>
<span v-else>您输入的商品条码格式不正确,请确认后重试。</span>
<span style="color: rgb(255, 59, 48)" v-else>{{ errorMsg }}</span>
</div>
</div>
</div>
......@@ -78,10 +85,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,
};
},
......@@ -96,21 +110,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;
this.result = [data];
} else {
this.errorMsg =
searchGlnRes.returnMsg ||
"您输入的商品条码格式不正确,请确认后重试。";
this.result = null;
}
},
......
......@@ -18,14 +18,14 @@
<div class="pages-middle">
<button class="pages-btn" v-if="false">首页</button>
<el-pagination
:page-size="20"
:pager-count="5"
:current-page="pages.currentPage"
:page-size="pages.pageSize"
:pager-count="pages.pageCount"
layout="prev, pager, next"
:total="1000"
:total="pages.total"
background
@current-change="handleCurrentChange"
>
<span>1111</span>
</el-pagination>
<button class="pages-btn" v-if="false">尾页</button>
</div>
......@@ -40,14 +40,18 @@
</template>
<script>
export default {
props: ['pages'],
data() {
return {
sizeList: [10, 20],
pages: {
size: 10,
},
};
},
methods: {
// 当前页
handleCurrentChange(val) {
this.$emit('toPagesFather', val)
},
},
};
</script>
<style lang="scss">
......
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