便利店
This commit is contained in:
parent
2b6850b251
commit
f697d2bba8
@ -17,6 +17,22 @@ export function getLJGoods(id) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 生成13位二维码
|
||||||
|
export function createGoodsNo() {
|
||||||
|
return request({
|
||||||
|
url: '/business/convenience/goods/createGoodsNo',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 对接扫码枪
|
||||||
|
export function scanCode(goodNo) {
|
||||||
|
return request({
|
||||||
|
url: '/business/convenience/goods/scanCode' ,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 新增商品
|
// 新增商品
|
||||||
export function addLJGoods(data) {
|
export function addLJGoods(data) {
|
||||||
return request({
|
return request({
|
||||||
|
@ -155,11 +155,13 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="商品条码" prop="goodsNo">
|
<el-form-item label="商品条码" prop="goodsNo">
|
||||||
<el-input v-model="form.goodsNo" placeholder="商品的条码信息">
|
<el-input v-model="form.goodsNo"
|
||||||
|
@keydown.enter.native="getGoods(form)"
|
||||||
|
placeholder="商品的条码信息">
|
||||||
<el-button slot="append">查询</el-button>
|
<el-button slot="append">查询</el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
<div style="text-align: right;color: grey;font-size: 12px">
|
<div style="text-align: right;color: grey;font-size: 12px">
|
||||||
商品无条码?您可以<span style="color: #00afff">生成条码</span>
|
商品无条码?您可以<span style="color: #00afff" @click="createGoodNo">生成条码</span>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -287,7 +289,14 @@
|
|||||||
|
|
||||||
import {selectTree} from "@/api/convenienceStore/goods";
|
import {selectTree} from "@/api/convenienceStore/goods";
|
||||||
import {listSupplier} from "@/api/convenienceStore/supplier";
|
import {listSupplier} from "@/api/convenienceStore/supplier";
|
||||||
import {addLJGoods, delLJGoods, getLJGoods, listLJGoods, updateLJGoods} from "@/api/convenienceStore/ljgoods";
|
import {
|
||||||
|
addLJGoods,
|
||||||
|
createGoodsNo,
|
||||||
|
delLJGoods,
|
||||||
|
getLJGoods,
|
||||||
|
listLJGoods, scanCode,
|
||||||
|
updateLJGoods
|
||||||
|
} from "@/api/convenienceStore/ljgoods";
|
||||||
import {getSysConfig} from "@/api/staff/user/sysconfig";
|
import {getSysConfig} from "@/api/staff/user/sysconfig";
|
||||||
import pinyin from "js-pinyin";
|
import pinyin from "js-pinyin";
|
||||||
|
|
||||||
@ -381,6 +390,19 @@ export default {
|
|||||||
computed:{
|
computed:{
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
|
getGoods(form){
|
||||||
|
// console.log(form)
|
||||||
|
scanCode(form.goodsNo).then(response => {
|
||||||
|
console.log(response)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 生成13位数字条码信息
|
||||||
|
createGoodNo(){
|
||||||
|
createGoodsNo().then(response => {
|
||||||
|
this.form.goodsNo = response.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取中文首字母拼音
|
||||||
pinyin(){
|
pinyin(){
|
||||||
let pinyin = require("js-pinyin");
|
let pinyin = require("js-pinyin");
|
||||||
pinyin.setOptions({ checkPolyphone: false, charCase: 1 });
|
pinyin.setOptions({ checkPolyphone: false, charCase: 1 });
|
||||||
|
@ -56,6 +56,16 @@ public class LJGoodsController extends BaseController {
|
|||||||
return getSuccessResult(goodNo);
|
return getSuccessResult(goodNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫码枪对接
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/scanCode")
|
||||||
|
public ResponseObject scanCode(){
|
||||||
|
// String result = goodsService.scanCode(goodNo);
|
||||||
|
return getSuccessResult(1);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除商品信息
|
* 删除商品信息
|
||||||
* @return
|
* @return
|
||||||
|
@ -28,6 +28,12 @@ public interface LJGoodsService {
|
|||||||
*/
|
*/
|
||||||
public String createGoodNo();
|
public String createGoodNo();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫码枪对接
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String scanCode(String goodNo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id删除商品信息
|
* 根据id删除商品信息
|
||||||
* @param id
|
* @param id
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.fuint.business.convenienceSore.service.impl;
|
package com.fuint.business.convenienceSore.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.http.HttpUtil;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@ -69,6 +70,17 @@ public class LJGoodsServiceImpl extends ServiceImpl<LJGoodsMapper, LJGoods> impl
|
|||||||
return number;
|
return number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扫码枪对接
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String scanCode(String goodNo) {
|
||||||
|
String result = HttpUtil.get("https://www.mxnzp.com/api/barcode/goods/details?barcode="
|
||||||
|
+goodNo+"&app_id=oudmngsxohrpsngw&app_secret=FoKv7iOPbT9LmdZpy0kg8CW75Hcc1BJc");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id删除商品信息
|
* 根据id删除商品信息
|
||||||
* @param id
|
* @param id
|
||||||
|
Loading…
Reference in New Issue
Block a user