Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-sfa-ui
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-sfa-ui
Commits
c211ce90
提交
c211ce90
authored
9月 03, 2025
作者:
lidongxu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(categoryinformation): 新增:勤策移动端_售点稽查品类信息完成接口对接
上级
ea401052
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
78 行增加
和
30 行删除
+78
-30
categoryInfomation.vue
...ection/examine/inspectionTask/tabs/categoryInfomation.vue
+78
-30
没有找到文件。
src/views/mobile/pages/audit_activity/sales_point_inspection/examine/inspectionTask/tabs/categoryInfomation.vue
浏览文件 @
c211ce90
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<div
class=
"mobile-page-container"
>
<div
class=
"mobile-page-container"
>
<!-- 类型选择 -->
<!-- 类型选择 -->
<div
class=
"category-select"
>
<div
class=
"category-select"
>
<van-field
label-width=
"
4rem
"
<van-field
label-width=
"
150px
"
label-position=
"left"
label-position=
"left"
label=
"品类选择:"
label=
"品类选择:"
:model-value=
"selectedTypeObj.label"
:model-value=
"selectedTypeObj.label"
...
@@ -20,10 +20,11 @@
...
@@ -20,10 +20,11 @@
<van-field
v-model=
"selectedTypeObj.price"
<van-field
v-model=
"selectedTypeObj.price"
type=
"number"
type=
"number"
:label=
"selectedTypeObj.label + ' 价格:'"
:label=
"selectedTypeObj.label + ' 价格:'"
label-width=
"
4rem
"
label-width=
"
150px
"
placeholder=
"请输入价格"
placeholder=
"请输入价格"
clearable
clearable
class=
"search-input"
/>
class=
"search-input"
@
change=
"handlePriceChange"
/>
</div>
</div>
<!-- 品类信息 -->
<!-- 品类信息 -->
<div
class=
"table-container"
>
<div
class=
"table-container"
>
...
@@ -47,7 +48,9 @@
...
@@ -47,7 +48,9 @@
<
template
#
input
>
<
template
#
input
>
<el-date-picker
v-model=
"obj.value"
<el-date-picker
v-model=
"obj.value"
type=
"month"
type=
"month"
placeholder=
"选择月份"
/>
value-format=
"YYYY-MM"
placeholder=
"选择月份"
@
change=
"handleTasteChange(index)"
/>
</
template
>
</
template
>
</van-field>
</van-field>
</div>
</div>
...
@@ -58,13 +61,22 @@
...
@@ -58,13 +61,22 @@
</template>
</template>
<
script
setup
>
<
script
setup
>
import
{
createInspectionTaskDetailAPI
}
from
'@/api'
const
props
=
defineProps
({
const
props
=
defineProps
({
form
:
{
form
:
{
type
:
Object
,
type
:
Object
,
default
:
()
=>
{
}
default
:
()
=>
{
}
}
}
})
})
const
nowRstdId
=
ref
(
''
)
// 当前品类任务部分 ID
// 品类型
// 品类型
// 后台用的英文字段,和我们的 label 名字做映射
const
typeMap
=
{
' 虎皮凤爪 210g'
:
{
priceKey
:
'priceHp210'
,
tasteDateKey
:
'kwYmHp210Map'
}
}
const
typeOptions
=
ref
([
const
typeOptions
=
ref
([
{
{
label
:
' 虎皮凤爪 210g'
,
value
:
' 虎皮凤爪 210g'
,
price
:
''
,
taste
:
[
label
:
' 虎皮凤爪 210g'
,
value
:
' 虎皮凤爪 210g'
,
price
:
''
,
taste
:
[
...
@@ -258,27 +270,63 @@ const typeOptions = ref([
...
@@ -258,27 +270,63 @@ const typeOptions = ref([
const
selectedTypeObj
=
ref
(
typeOptions
.
value
[
0
])
const
selectedTypeObj
=
ref
(
typeOptions
.
value
[
0
])
// 创建任务
// 创建任务
const
createTask
=
()
=>
{
const
createTask
=
async
()
=>
{
displayGroup
.
value
.
push
({
const
{
data
}
=
await
createInspectionTaskDetailAPI
({
type
:
selectedTypeObj
.
value
.
value
,
taskDetail
:
{
taste
:
selectedTypeObj
.
value
.
taste
.
map
(
item
=>
({
rstId
:
props
.
form
.
rstId
,
name
:
item
.
name
,
detailName
:
'品类信息'
value
:
''
}
}))
})
displayGroup
.
value
.
push
(
data
)
}
// 价格改变
const
handlePriceChange
=
async
()
=>
{
const
res
=
await
createInspectionTaskDetailAPI
({
taskDetail
:
{
rstId
:
props
.
form
.
rstId
,
rstdId
:
nowRstdId
.
value
,
detailName
:
'品类信息'
,
priceHp210
:
selectedTypeObj
.
value
.
price
*
1
}
})
showNotify
({
type
:
'success'
,
message
:
'价格,保存成功'
})
}
// 口味生产日期设置
const
handleTasteChange
=
async
(
index
)
=>
{
console
.
log
(
selectedTypeObj
.
value
)
const
prop
=
typeMap
[
selectedTypeObj
.
value
.
label
].
tasteDateKey
await
createInspectionTaskDetailAPI
({
taskDetail
:
{
rstId
:
props
.
form
.
rstId
,
rstdId
:
nowRstdId
.
value
,
detailName
:
'品类信息'
,
[
prop
]:
selectedTypeObj
.
value
.
taste
.
reduce
((
acc
,
item
)
=>
{
acc
[
item
.
name
]
=
item
.
value
;
return
acc
;
},
{})
}
})
})
}
}
const
init
=
()
=>
{
const
init
=
()
=>
{
if
(
props
.
form
.
detailMap
)
{
if
(
props
.
form
.
detailMap
)
{
if
(
props
.
form
.
detailMap
[
'品类信息'
])
{
if
(
props
.
form
.
detailMap
[
'品类信息'
])
{
checkProperty
(
props
.
form
.
detailMap
[
'品类信息'
])
// 回显
displayGroup
.
value
=
props
.
form
.
detailMap
[
'品类信息'
]
||
[]
nowRstdId
.
value
=
props
.
form
.
detailMap
[
'品类信息'
][
0
].
rstdId
// 详情ID
const
priceProp
=
typeMap
[
selectedTypeObj
.
value
.
label
].
priceKey
// 设置价格
selectedTypeObj
.
value
.
price
=
props
.
form
.
detailMap
[
'品类信息'
][
0
][
priceProp
]
const
tasteProp
=
typeMap
[
selectedTypeObj
.
value
.
label
].
tasteDateKey
// 设置口味日期
const
targetTasteObj
=
props
.
form
.
detailMap
[
'品类信息'
][
0
][
tasteProp
]
if
(
targetTasteObj
)
{
selectedTypeObj
.
value
.
taste
.
forEach
(
item
=>
{
item
.
value
=
targetTasteObj
[
item
.
name
]
// 取出日期
})
}
return
return
}
}
}
}
// 没传递则自己至少新建 1 个
if
(
displayGroup
.
value
.
length
===
0
)
{
createTask
()
}
}
}
defineExpose
({
defineExpose
({
init
init
...
@@ -288,7 +336,7 @@ defineExpose({
...
@@ -288,7 +336,7 @@ defineExpose({
<
style
lang=
"scss"
<
style
lang=
"scss"
scoped
>
scoped
>
.mobile-page-container
{
.mobile-page-container
{
padding
:
10px
;
padding
:
.2667rem
;
background-color
:
#fff
;
background-color
:
#fff
;
// 类型选择
// 类型选择
...
@@ -298,35 +346,35 @@ defineExpose({
...
@@ -298,35 +346,35 @@ defineExpose({
.van-cell
{
.van-cell
{
padding
:
0
;
padding
:
0
;
align-items
:
center
;
align-items
:
center
;
// font-size:
14px
;
// font-size:
.3733rem
;
// font-weight: 900;
// font-weight: 900;
.el-select
{
.el-select
{
width
:
150px
;
width
:
4rem
;
}
}
}
}
.search-input
{
.search-input
{
margin-top
:
10px
;
margin-top
:
.2667rem
;
}
}
}
}
// 表格容器
// 表格容器
.table-container
{
.table-container
{
margin-top
:
10px
;
margin-top
:
.2667rem
;
}
}
.custom-table
{
.custom-table
{
width
:
100%
;
width
:
100%
;
border
:
1px
solid
#ccc
;
border
:
.0267rem
solid
#ccc
;
border-collapse
:
collapse
;
// 模拟表格边框合并
border-collapse
:
collapse
;
// 模拟表格边框合并
.table-row
{
.table-row
{
display
:
flex
;
display
:
flex
;
width
:
100%
;
width
:
100%
;
height
:
44px
;
height
:
1
.1733rem
;
&
.header-row
{
&
.header-row
{
background-color
:
#e5e5e5
;
background-color
:
#e5e5e5
;
...
@@ -349,9 +397,9 @@ defineExpose({
...
@@ -349,9 +397,9 @@ defineExpose({
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
center
;
border-right
:
1px
solid
#ccc
;
border-right
:
.0267rem
solid
#ccc
;
border-bottom
:
1px
solid
#ccc
;
border-bottom
:
.0267rem
solid
#ccc
;
font-size
:
14px
;
font-size
:
.3733rem
;
color
:
#333
;
color
:
#333
;
&
:last-child
{
&
:last-child
{
...
@@ -359,14 +407,14 @@ defineExpose({
...
@@ -359,14 +407,14 @@ defineExpose({
}
}
&
.first-column
{
&
.first-column
{
width
:
120px
;
width
:
3
.2rem
;
font-weight
:
500
;
font-weight
:
500
;
}
}
&
.second-column
{
&
.second-column
{
background
:
white
;
background
:
white
;
flex
:
1
;
flex
:
1
;
padding
:
0
8px
;
padding
:
0
.2133rem
;
}
}
}
}
...
@@ -375,7 +423,7 @@ defineExpose({
...
@@ -375,7 +423,7 @@ defineExpose({
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
text-align
:
center
;
text-align
:
center
;
font-size
:
14px
;
font-size
:
.3733rem
;
padding
:
0
;
padding
:
0
;
::v-deep
(
.van-cell__value
)
{
::v-deep
(
.van-cell__value
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论