便利店

This commit is contained in:
cun-nan 2023-10-27 10:49:09 +08:00
parent 98a517e02b
commit 57f5d5489c
3 changed files with 95 additions and 9 deletions

View File

@ -26,10 +26,11 @@ export function createGoodsNo() {
}
// 对接扫码枪
export function scanCode(goodNo) {
export function scanCode(data) {
return request({
url: '/business/convenience/goods/scanCode',
method: 'get'
method: 'put',
data: data
})
}

View File

@ -2,6 +2,10 @@
<div class="app-container">
<el-card >
<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-select
v-model="queryParams.cvsGoodId"
@ -120,7 +124,7 @@
<span>{{ parseTime(scope.row.updateTime) }}</span>
</template>
</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">
<el-button
size="mini"
@ -129,6 +133,24 @@
v-hasPermi="['member:add']"
@click="handleUpdate(scope.row)"
>修改</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
size="mini"
type="text"
@ -304,6 +326,7 @@ export default {
dicts: ['zhzt','yes_or_no'],
data(){
return {
activeName: 'goods',
//
stockType:'',
cvsGoodName:'',
@ -390,10 +413,46 @@ export default {
computed:{
},
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){
// console.log(form)
scanCode(form.goodsNo).then(response => {
// console.log(form){goodsNo:form.goodsNo}
scanCode({goodsNo:form.goodsNo}).then(response => {
console.log(response)
// this.form = response.data
})
},
// 13
@ -455,6 +514,28 @@ export default {
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() {
this.reset();

View File

@ -10,6 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* 商品信息 controller层
*/
@ -60,9 +62,11 @@ public class LJGoodsController extends BaseController {
* 扫码枪对接
* @return
*/
@GetMapping("/scanCode")
public ResponseObject scanCode(){
// String result = goodsService.scanCode(goodNo);
@PutMapping("/scanCode")
public ResponseObject scanCode(@Validated @RequestBody Map<String,String> map){
System.out.println(map.get("goodsNo"));
String goodsNo = map.get("goodsNo");
// String result = goodsService.scanCode(goodsNo);
return getSuccessResult(1);
}