便利店
This commit is contained in:
parent
98a517e02b
commit
57f5d5489c
@ -26,10 +26,11 @@ export function createGoodsNo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 对接扫码枪
|
// 对接扫码枪
|
||||||
export function scanCode(goodNo) {
|
export function scanCode(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/business/convenience/goods/scanCode' ,
|
url: '/business/convenience/goods/scanCode',
|
||||||
method: 'get'
|
method: 'put',
|
||||||
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,10 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card >
|
<el-card >
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||||
|
<el-tab-pane label="商品档案" name="goods"></el-tab-pane>
|
||||||
|
<el-tab-pane label="商品回收站" name="recovery"></el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
<el-form-item label="商品分类" prop="cvsGoodId">
|
<el-form-item label="商品分类" prop="cvsGoodId">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.cvsGoodId"
|
v-model="queryParams.cvsGoodId"
|
||||||
@ -120,7 +124,7 @@
|
|||||||
<span>{{ parseTime(scope.row.updateTime) }}</span>
|
<span>{{ parseTime(scope.row.updateTime) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" width="120" fixed='right'>
|
<el-table-column label="操作" v-if="activeName=='goods'" align="center" width="200" fixed='right'>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -129,6 +133,24 @@
|
|||||||
v-hasPermi="['member:add']"
|
v-hasPermi="['member:add']"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
v-hasPermi="['member:add']"
|
||||||
|
@click="isRecoveryBin(scope.row,1)"
|
||||||
|
>移至回收站</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" v-if="activeName=='recovery'" align="center" width="200" fixed='right'>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-shopping-cart-full"
|
||||||
|
v-hasPermi="['member:add']"
|
||||||
|
@click="isRecoveryBin(scope.row,0)"
|
||||||
|
>移出至商品档案</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@ -304,6 +326,7 @@ export default {
|
|||||||
dicts: ['zhzt','yes_or_no'],
|
dicts: ['zhzt','yes_or_no'],
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
|
activeName: 'goods',
|
||||||
// 关联库存类型
|
// 关联库存类型
|
||||||
stockType:'',
|
stockType:'',
|
||||||
cvsGoodName:'',
|
cvsGoodName:'',
|
||||||
@ -390,10 +413,46 @@ export default {
|
|||||||
computed:{
|
computed:{
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
|
// 点击标签页
|
||||||
|
handleClick(tab, event) {
|
||||||
|
if (this.activeName == 'goods'){
|
||||||
|
this.queryParams = {
|
||||||
|
page: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
id: '',
|
||||||
|
cvsGoodId: '',
|
||||||
|
supplierId: '',
|
||||||
|
name: '',
|
||||||
|
pinyinCode: '',
|
||||||
|
goodsNo: '',
|
||||||
|
shelfNumber: '',
|
||||||
|
status: '',
|
||||||
|
isRecovery:0,
|
||||||
|
};
|
||||||
|
this.getList();
|
||||||
|
}else {
|
||||||
|
this.queryParams = {
|
||||||
|
page: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
id: '',
|
||||||
|
cvsGoodId: '',
|
||||||
|
supplierId: '',
|
||||||
|
name: '',
|
||||||
|
pinyinCode: '',
|
||||||
|
goodsNo: '',
|
||||||
|
shelfNumber: '',
|
||||||
|
status: '',
|
||||||
|
isRecovery:1,
|
||||||
|
};
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 扫描识别商品信息
|
||||||
getGoods(form){
|
getGoods(form){
|
||||||
// console.log(form)
|
// console.log(form){goodsNo:form.goodsNo}
|
||||||
scanCode(form.goodsNo).then(response => {
|
scanCode({goodsNo:form.goodsNo}).then(response => {
|
||||||
console.log(response)
|
console.log(response)
|
||||||
|
// this.form = response.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 生成13位数字条码信息
|
// 生成13位数字条码信息
|
||||||
@ -455,6 +514,28 @@ export default {
|
|||||||
unit:'',shelfNumber:'',canUsePoint:'no',stock:0,supplierId:'',sort:0,status:'qy'
|
unit:'',shelfNumber:'',canUsePoint:'no',stock:0,supplierId:'',sort:0,status:'qy'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 是否移至回收站
|
||||||
|
isRecoveryBin(form,recovery){
|
||||||
|
let name = ""
|
||||||
|
let prompt = ''
|
||||||
|
if (recovery==1){
|
||||||
|
name = "确定要将此商品移至回收站吗?移出后将无法售卖当前商品!"
|
||||||
|
prompt = "商品已移至回收站,收银台商品信息页面刷新后实时生效!"
|
||||||
|
}else {
|
||||||
|
name = "确定要将此商品从回收站移至商品档案里吗?移出后将可售卖当前商品!"
|
||||||
|
prompt = "商品已移至商品档案,收银台商品信息页面刷新后实时生效!"
|
||||||
|
}
|
||||||
|
this.$modal.confirm(name).then(function() {
|
||||||
|
form.isRecovery = recovery;
|
||||||
|
updateLJGoods(form).then(response => {
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess(prompt);
|
||||||
|
}).catch(() => {});
|
||||||
|
|
||||||
|
},
|
||||||
// 新增按钮操作
|
// 新增按钮操作
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
|
@ -10,6 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品信息 controller层
|
* 商品信息 controller层
|
||||||
*/
|
*/
|
||||||
@ -60,9 +62,11 @@ public class LJGoodsController extends BaseController {
|
|||||||
* 扫码枪对接
|
* 扫码枪对接
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/scanCode")
|
@PutMapping("/scanCode")
|
||||||
public ResponseObject scanCode(){
|
public ResponseObject scanCode(@Validated @RequestBody Map<String,String> map){
|
||||||
// String result = goodsService.scanCode(goodNo);
|
System.out.println(map.get("goodsNo"));
|
||||||
|
String goodsNo = map.get("goodsNo");
|
||||||
|
// String result = goodsService.scanCode(goodsNo);
|
||||||
return getSuccessResult(1);
|
return getSuccessResult(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user