Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jwhx
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sugar
jwhx
Commits
4e57d152
Commit
4e57d152
authored
Jan 15, 2025
by
xieyishang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~~~
parent
030cd585
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
158 additions
and
68 deletions
+158
-68
resources/admin/src/components/scSku/index.vue
resources/admin/src/components/scSku/index.vue
+2
-1
resources/admin/src/config/table.js
resources/admin/src/config/table.js
+1
-1
resources/admin/src/pages/cashierhome/cashierhome.vue
resources/admin/src/pages/cashierhome/cashierhome.vue
+151
-62
resources/admin/src/pages/goods/lists/save.vue
resources/admin/src/pages/goods/lists/save.vue
+1
-1
resources/admin/src/pages/member/score/save.vue
resources/admin/src/pages/member/score/save.vue
+2
-2
resources/admin/src/pages/ucenter/score/save.vue
resources/admin/src/pages/ucenter/score/save.vue
+1
-1
No files found.
resources/admin/src/components/scSku/index.vue
View file @
4e57d152
...
...
@@ -52,7 +52,8 @@ export default {
{
name
:
'
price
'
,
type
:
'
input
'
,
label
:
'
价格
'
},
{
name
:
'
integral
'
,
type
:
'
input
'
,
label
:
'
积分
'
},
{
name
:
'
sales
'
,
type
:
'
input
'
,
label
:
'
销量
'
},
{
name
:
'
stock
'
,
type
:
'
input
'
,
label
:
'
库存
'
}
{
name
:
'
stock
'
,
type
:
'
input
'
,
label
:
'
库存
'
},
{
name
:
'
goods_sn
'
,
type
:
'
input
'
,
label
:
'
产品编号
'
},
]
},
// sku 字段分隔符
...
...
resources/admin/src/config/table.js
View file @
4e57d152
...
...
@@ -5,7 +5,7 @@ import tool from '@/utils/tool'
export
default
{
successCode
:
1
,
//请求完成代码
pageSize
:
30
,
//表格每一页条数
pageSizes
:
[
30
,
100
,
200
,
500
],
//表格可设置的一页条数
pageSizes
:
[
10
,
30
,
100
,
200
,
500
],
//表格可设置的一页条数
paginationLayout
:
"
total, sizes, prev, pager, next, jumper
"
,
//表格分页布局,可设置"total, sizes, prev, pager, next, jumper"
parseData
:
function
(
res
)
{
//数据分析
return
{
...
...
resources/admin/src/pages/cashierhome/cashierhome.vue
View file @
4e57d152
...
...
@@ -2,64 +2,87 @@
<el-container>
<el-main
class=
"nopadding"
>
<!--
<input
class=
"input"
id=
"inputsmq"
ref=
"inputRef"
type=
"password"
/>
-->
<input
class=
"input"
id=
"inputsmq"
ref=
"scannerInput"
type=
"text"
@
input=
"handleScannerInput"
@
focus=
"onFocus"
@
blur=
"blurfun"
/>
<input
class=
"input"
id=
"inputsmq"
value=
""
ref=
"scannerInput"
type=
"text"
@
focus=
"onFocus"
@
blur=
"blurfun"
@
input=
"handleScannerInput"
/>
<!-- -->
<div
class=
"pos"
>
<el-row>
<el-col
:span=
'9'
class=
"pos_order"
id=
"order_list"
>
<el-tabs
style=
"padding-left:10px;"
>
<el-tab-pane
label=
"购物单"
>
<el-scrollbar
:height=
"scrollbarheight"
>
<div
class=
"card"
v-for=
"(item, index) in listdata"
:key=
"index"
>
<div
class=
"top"
>
<div
class=
"shop_name"
>
{{
item
.
title
}}
</div>
</div>
<div
class=
"main"
>
<div
class=
"card_wrap"
v-for=
"(cc, inner) in item.content"
:key=
"inner"
>
<div
class=
"card_item"
right-width=
"65"
>
<div
class=
"card_item_wrap"
>
<div
class=
"select_box"
@
click=
"goodsSelectedHandle(cc.goods_id, cc.goods_sku_id)"
>
</div>
<div
class=
"img_wrap"
>
<img
:src=
"cc.goods.cover"
mode=
"aspectFill"
/>
</div>
<div
class=
"info"
>
<div
class=
"it"
>
<div
class=
"goods_title"
>
{{
cc
.
goods
.
title
}}
</div>
<div
class=
"card"
v-for=
"(item, index) in listdata"
:key=
"index"
>
<div
class=
"top"
>
<div
class=
"shop_name"
>
{{
item
.
title
}}
</div>
</div>
<div
class=
"main"
>
<div
class=
"card_wrap"
v-for=
"(cc, inner) in item.content"
:key=
"inner"
>
<div
class=
"card_item"
right-width=
"65"
>
<div
class=
"card_item_wrap"
>
<div
class=
"select_box"
@
click=
"goodsSelectedHandle(cc.goods_id, cc.goods_sku_id)"
>
</div>
<div
class=
"img_wrap"
>
<img
:src=
"cc.goods.cover"
mode=
"aspectFill"
/>
</div>
<div
class=
"info"
>
<div
class=
"it"
>
<div
class=
"goods_title"
>
{{
cc
.
goods
.
title
}}
</div>
<div
class=
"deleteicon"
>
<div
class=
"delete"
@
click=
"goodsDeleteHandle(cc.goods_id, cc.goods_sku_id)"
>
删除
</div>
</div>
<div
class=
"deleteicon"
>
<div
class=
"delete"
@
click=
"goodsDeleteHandle(cc.goods_id, cc.goods_sku_id)"
>
删除
</div>
</div>
<!-- @click="skuChangeHandle(cc)" -->
<div
class=
"sku"
v-if=
"cc.sku"
>
<div
class=
"text"
>
{{
cc
.
sku
.
sku
}}
</div>
<!-- @click="skuChangeHandle(cc)" -->
<div
class=
"sku"
v-if=
"cc.sku"
>
<div
class=
"text"
>
{{
cc
.
sku
.
sku
}}
</div>
</div>
</div>
</div>
<div
class=
"ib"
>
<div
class=
"pricebox"
>
<div
class=
"price"
>
<div
class=
"price_icon"
>
¥
</div>
<div
class=
"price_main din"
>
{{
cc
.
formatBig
}}
<text
class=
"mini"
>
{{
cc
.
formatMini
}}
</text>
<div
class=
"ib"
>
<!-- 会员 -->
<div
class=
"pricebox"
>
<div
class=
"price"
>
<div
class=
"price_icon"
>
会员 ¥
</div>
<div
class=
"price_main din"
>
{{
cc
.
formatBig
}}
<text
class=
"mini"
>
{{
cc
.
formatMini
}}
</text>
</div>
</div>
</div>
<div
class=
"price jfprice"
>
<div
class=
"price_icon"
>
积分:
</div
>
<div
class=
"price_main din"
>
{{
cc
.
goods
.
integral
}}
<div
class=
"price jfprice"
>
<div
class=
"price_icon"
>
+积分:
</div
>
<div
class=
"price_main din"
>
{{
cc
.
goods
.
integral
}}
</div>
</div>
</div>
<div
class=
"num"
>
<el-input-number
:data-gid=
"cc.goods_id"
:data-sid=
"cc.goods_sku_id"
:data-cid=
"cc.cart_id"
:min=
"1"
@
change=
"(e)=>stepMinusHandle(e, cc)"
size=
"small"
v-model=
"cc.num"
></el-input-number>
</div>
</div>
<div
class=
"num"
>
<el-input-number
:data-gid=
"cc.goods_id"
:data-sid=
"cc.goods_sku_id"
:data-cid=
"cc.cart_id"
:min=
"1"
@
change=
"(e)=>stepMinusHandle(e, cc)"
size=
"small"
v-model=
"cc.num"
></el-input-number>
<div
class=
"ib"
>
<!-- 会员 -->
<div
class=
"pricebox"
>
<div
class=
"price"
>
<div
class=
"price_icon"
>
不用使用积分 ¥
</div>
<div
class=
"price_main din"
>
{{
parseFloat
(
parseFloat
(
cc
.
goods
.
price
)
+
parseFloat
(
cc
.
goods
.
integral
)).
toFixed
(
2
)
}}
</div>
</div>
</div>
</div>
</div>
</div>
...
...
@@ -67,7 +90,7 @@
</div>
</div>
</div>
</
div
>
</
el-scrollbar
>
<div
class=
"total"
>
...
...
@@ -76,16 +99,19 @@
</div>
<div
class=
"total"
>
<small>
需付:
</small>
¥
{{
Userprice
}}
<small>
不使用积分
需付:
</small>
¥
{{
Userprice
}}
</div>
<div
class=
"pos_btn"
>
<!--
<el-button
size=
"large"
type=
"primary"
@
click=
"chooseSerial"
>
连接扫码枪
</el-button>
-->
<el-button
size=
"large"
type=
"primary"
@
click=
"focusfun"
>
监听扫码枪识别
</el-button>
<el-button
size=
"large"
type=
"primary"
@
click=
"focusfun
(1)
"
>
监听扫码枪识别
</el-button>
<el-button
size=
"large"
type=
"danger"
@
click=
"delAllGoods()"
>
清空购物单
</el-button>
<el-button
size=
"large"
type=
"success"
@
click=
"checkOut()"
>
结算
</el-button>
<el-button
size=
"large"
type=
"success"
@
click=
"focusfun(2)"
>
会员扣积分
</el-button>
<el-button
size=
"large"
type=
"success"
@
click=
"checkOut()"
>
会员结算
</el-button>
<!-- addjf 会员扣积分 -->
</div>
</el-tab-pane>
</el-tabs>
...
...
@@ -106,7 +132,7 @@
</div>
</el-header>
<scTable
tableName=
"member"
ref=
"table"
:apiObj=
"list.apiObj"
:column=
"list.column"
row-key=
"id"
@
selection-change=
"selectionChange"
border
stripe
>
<scTable
tableName=
"member"
ref=
"table"
:
pageSize=
"11"
:
apiObj=
"list.apiObj"
:column=
"list.column"
row-key=
"id"
@
selection-change=
"selectionChange"
border
stripe
>
<el-table-column
type=
"selection"
width=
"50"
></el-table-column>
<template
#cover
="
scope
"
>
<img
:src=
"scope.row.cover"
width=
"40"
height=
"40"
v-if=
"scope.row.cover"
/>
...
...
@@ -185,6 +211,12 @@
<save
v-if=
"dialog.save"
ref=
"saveBox"
@
success=
"upsearch"
@
closed=
"dialog.save=false"
/>
<!-- 修改产品 -->
<jfsave
v-if=
"dialog.save1"
ref=
"saveBox1"
@
success=
"upsearch1"
@
closed=
"dialog.save1=false"
/>
<!-- 修改积分 -->
</el-main>
</el-container>
</template>
...
...
@@ -194,18 +226,20 @@ import { ElLoading, ElMessage } from "element-plus";
import
{
ElMessageBox
}
from
'
element-plus
'
import
qrcode
from
"
@/components/qrcode/qrcode.vue
"
;
import
save
from
'
../goods/lists/save.vue
'
;
import
jfsave
from
"
../member/score/save.vue
"
;
export
default
{
name
:
"
ucenter.cashierhome
"
,
components
:
{
qrcode
,
save
save
,
jfsave
,
},
data
()
{
return
{
childgoods
:{
spec_list
:[]},
dialogVisible
:
false
,
scrollbarheight
:
0
,
dialogVisibletwo
:
false
,
dialog
:
{
search
:
false
,
import
:
false
,
print
:
false
},
...
...
@@ -245,12 +279,15 @@ export default {
Userprice
:
0
,
//不使用积分的价格
qrcodeurl
:
""
,
listeningtype
:
1
,
//1 扫产品 2扫会员码
};
},
mounted
(){
var
orderHeight
=
document
.
body
.
clientHeight
;
document
.
getElementById
(
"
order_list
"
).
style
.
height
=
orderHeight
+
"
px
"
;
// document.getElementById("order_list").style.height = (orderHeight - 100) + "px";
this
.
scrollbarheight
=
orderHeight
-
320
;
},
created
:
function
()
{
...
...
@@ -286,6 +323,7 @@ export default {
}
},
methods
:
{
add
(){
this
.
dialog
.
save
=
true
this
.
$nextTick
(()
=>
{
...
...
@@ -603,8 +641,15 @@ export default {
})
},
focusfun
(){
focusfun
(
types
){
// 自动聚焦到输入框,方便直接扫描
if
(
types
==
2
&&
this
.
totaljifen
==
0
){
this
.
$message
.
error
(
"
店员,没有东西,怎么扣积分呀~
"
);
return
false
;
}
this
.
listeningtype
=
types
;
this
.
loading
=
ElLoading
.
service
({
lock
:
true
,
text
:
"
请开始扫码识别
"
,
...
...
@@ -616,9 +661,13 @@ export default {
// this.loading.close();
},
handleScannerInput
(
event
)
{
// return false;
const
input
=
event
.
target
;
clearTimeout
(
this
.
typingTimeout
);
console
.
log
(
'
input.value00:
'
,
input
.
value
);
// 如果用户手动输入,则设置一个短暂的延迟
if
(
this
.
isTyping
)
{
this
.
typingTimeout
=
setTimeout
(()
=>
{
...
...
@@ -631,12 +680,24 @@ export default {
console
.
log
(
'
input.value:
'
,
input
.
value
);
if
(
this
.
listeningtype
==
1
){
//扫产品
if
(
input
.
value
&&
input
.
value
.
length
>
5
){
this
.
childgoods
.
goods_sn
=
input
.
value
;
this
.
childgoods
.
store_id
=
0
;
this
.
addCart
(
"
single
"
,
""
,
1
);
}
}
else
if
(
this
.
listeningtype
==
2
){
//扫会员码
console
.
info
(
"
input.value 扫会员码
"
,
input
.
value
);
var
idPattern
=
/^
\d
+$/
;
if
(
input
.
value
&&
idPattern
.
test
(
input
.
value
)
&&
input
.
value
.
length
<
8
){
this
.
addjf
(
input
.
value
);
}
if
(
input
.
value
&&
input
.
value
.
length
>
5
){
this
.
childgoods
.
goods_sn
=
input
.
value
;
this
.
childgoods
.
store_id
=
0
;
this
.
addCart
(
"
single
"
,
""
,
1
);
}
// 清空输入框以便下一次扫描
input
.
value
=
''
;
...
...
@@ -644,19 +705,31 @@ export default {
this
.
blurfun
();
},
5
00
);
// 假设用户不会连续输入超过500ms
},
7
00
);
// 假设用户不会连续输入超过500ms
}
else
{
clearTimeout
(
this
.
typingTimeout
);
// 扫描完成后的处理逻辑
this
.
scannedCode
=
input
.
value
;
console
.
log
(
'
Scanned code:
'
,
this
.
scannedCode
);
if
(
input
.
value
&&
input
.
value
.
length
>
5
){
this
.
childgoods
.
goods_sn
=
input
.
value
;
this
.
childgoods
.
store_id
=
0
;
this
.
addCart
(
"
single
"
,
""
,
1
);
if
(
this
.
listeningtype
==
1
){
//扫产品
if
(
input
.
value
&&
input
.
value
.
length
>
5
){
this
.
childgoods
.
goods_sn
=
input
.
value
;
this
.
childgoods
.
store_id
=
0
;
this
.
addCart
(
"
single
"
,
""
,
1
);
}
}
else
if
(
this
.
listeningtype
==
2
){
//扫会员码
console
.
info
(
"
input.value 扫会员码
"
,
input
.
value
);
var
idPattern
=
/^
\d
+$/
;
if
(
input
.
value
&&
idPattern
.
test
(
input
.
value
)
&&
input
.
value
.
length
<
8
){
this
.
addjf
(
input
.
value
);
}
}
console
.
log
(
'
input.value:
'
,
input
.
value
);
// 清空输入框以便下一次扫描
input
.
value
=
''
;
...
...
@@ -664,12 +737,25 @@ export default {
// 处理扫码后的业务逻辑...
}
},
addjf
(
user_id
){
console
.
info
(
"
addjf
"
);
this
.
dialog
.
save1
=
true
this
.
$nextTick
(()
=>
{
this
.
$refs
.
saveBox1
.
open
().
setData
({
amount
:
this
.
totaljifen
,
//积分额度
member_id
:
user_id
,
//用户
type
:
'
pay
'
,
//积分类型
remark
:
"
到店消费
"
,
//积分描述
})
})
},
onFocus
()
{
// 当输入框获得焦点时,认为用户可能开始手动输入
this
.
isTyping
=
true
;
},
//失去焦点
blurfun
(){
console
.
info
(
'
blurfun
'
);
this
.
isTyping
=
false
;
this
.
loading
.
close
();
},
...
...
@@ -769,6 +855,9 @@ export default {
upsearch
(){
this
.
$refs
.
table
.
reload
(
this
.
search
);
},
upsearch1
(){
},
moreUpsearch
(
search
){
this
.
search
=
search
;
this
.
upsearch
();
...
...
resources/admin/src/pages/goods/lists/save.vue
View file @
4e57d152
...
...
@@ -20,7 +20,7 @@
<sc-tag-input
v-model=
"form.tags"
placeholder=
"请输入标签"
/>
</el-form-item>
<el-form-item
label=
"产品编码"
prop=
"goods_sn"
>
<el-input
type=
"textarea"
v-model=
"form.goods_sn"
placeholder=
"请输入产品编码"
clearable
/>
<el-input
v-model=
"form.goods_sn"
placeholder=
"请输入产品编码"
clearable
/>
</el-form-item>
<el-form-item
label=
"简述"
prop=
"description"
>
<el-input
type=
"textarea"
v-model=
"form.description"
placeholder=
"请输入简述"
clearable
/>
...
...
resources/admin/src/pages/member/score/save.vue
View file @
4e57d152
...
...
@@ -19,7 +19,7 @@
</el-form>
<template
#footer
>
<el-button
@
click=
"visible=false"
>
取 消
</el-button>
<el-button
v-if=
"mode!='show'"
type=
"primary"
:loading=
"isSaveing"
@
click=
"submit()"
>
保 存
</el-button>
<el-button
v-if=
"mode!='show'"
type=
"primary"
:loading=
"isSaveing"
@
click=
"submit()"
>
提 交
</el-button>
</
template
>
</el-dialog>
</template>
...
...
@@ -31,7 +31,7 @@ export default {
return
{
mode
:
"
add
"
,
titleMap
:
{
add
:
'
新增等级
'
,
add
:
'
积分
'
,
edit
:
'
编辑等级
'
,
show
:
'
查看
'
},
...
...
resources/admin/src/pages/ucenter/score/save.vue
View file @
4e57d152
...
...
@@ -31,7 +31,7 @@ export default {
return
{
mode
:
"
add
"
,
titleMap
:
{
add
:
'
新增等级
'
,
add
:
'
积分
'
,
edit
:
'
编辑等级
'
,
show
:
'
查看
'
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment