Commit c593ed75 by tang

feat: 境内码商品信息查询

parent d8b8e4f1
...@@ -21,7 +21,7 @@ const searchInternal = (params = {}) => { ...@@ -21,7 +21,7 @@ const searchInternal = (params = {}) => {
// 条码查询-境内码商品信息 // 条码查询-境内码商品信息
const searchInternalProduct = (params = {}) => { const searchInternalProduct = (params = {}) => {
return POST(`${Prefix}/office/production/api/search`, params) return POST(`${Prefix}/office/codeSearch/api/domesticCodeProductionNews`, params)
} }
// 条码查询—查询商品变更记录 // 条码查询—查询商品变更记录
......
...@@ -365,11 +365,12 @@ export default { ...@@ -365,11 +365,12 @@ export default {
this.detailDialogVisible = true this.detailDialogVisible = true
} }
}, },
// 查看变更详情 // 查看变更详情
async handleCheckChange(row) { async handleCheckChange(row) {
console.log(row); console.log(row);
const searchGlnRes = await this.$api.search.searchCompanyChange({code: row.code}); const searchGlnRes = await this.$api.search.searchCompanyChange({code: row.code});
console.log(searchGlnRes) console.log(searchGlnRes);
const {data} = searchGlnRes; const {data} = searchGlnRes;
if (searchGlnRes.success) { if (searchGlnRes.success) {
console.log(data) console.log(data)
...@@ -383,6 +384,7 @@ export default { ...@@ -383,6 +384,7 @@ export default {
alert(searchGlnRes.returnMsg || '网络错误,请稍后再试') alert(searchGlnRes.returnMsg || '网络错误,请稍后再试')
} }
}, },
async handleSearchCompany() { async handleSearchCompany() {
this.showResult = true; this.showResult = true;
this.resultType = 'company' this.resultType = 'company'
...@@ -412,13 +414,36 @@ export default { ...@@ -412,13 +414,36 @@ export default {
}, },
async handleSearchProduct() { async handleSearchProduct() {
if (!this.isVerificationPass) {
return this.$message.error('请先进行验证');
}
if (!this.productSearch.code) {
return this.$message.error('请输入商品条码');
}
this.showResult = true;
this.resultType = 'product';
const params = {code: this.productSearch.code};
const searchGlnRes = await this.$api.search.searchInternalProduct(params);
if (searchGlnRes.returnCode === "0") {
const a = document.createElement('a') const a = document.createElement('a')
a.setAttribute('href', `/internal_code_search/searchResult2.aspx?keyword=${this.productSearch.code}`) a.setAttribute('href', searchGlnRes.data)
// a.setAttribute('target', '_blank') // a.setAttribute('target', '_blank')
a.setAttribute('id', 'cow-link-temp') a.setAttribute('id', 'cow-link-temp')
document.body.appendChild(a) document.body.appendChild(a)
a.click() a.click()
document.body.removeChild(document.getElementById('cow-link-temp')) } else {
this.errorMsg =
searchGlnRes.returnMsg ||
"没有符合条件的记录!";
this.result = null;
}
// const a = document.createElement('a')
// a.setAttribute('href', `/internal_code_search/searchResult2.aspx?keyword=${this.productSearch.code}`)
// // a.setAttribute('target', '_blank')
// a.setAttribute('id', 'cow-link-temp')
// document.body.appendChild(a)
// a.click()
// document.body.removeChild(document.getElementById('cow-link-temp'))
// window.open(`http://search.anccnet.com/searchResult2.aspx?keyword=${this.productSearch.code}`, '_blank') // window.open(`http://search.anccnet.com/searchResult2.aspx?keyword=${this.productSearch.code}`, '_blank')
} }
......
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