Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-presale
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6afd51a1
authored
May 29, 2023
by
zhangquan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
样式优化
1 parent
4b3ef2e2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
29 deletions
src/components/Editor/index.vue
src/views/serviceConfig/addService.vue
src/views/serviceConfig/components/ServicesTable/index.vue
src/views/serviceConfig/index.vue
src/components/Editor/index.vue
View file @
6afd51a
...
@@ -177,6 +177,16 @@ export default {
...
@@ -177,6 +177,16 @@ export default {
margin-right
:
0
;
margin-right
:
0
;
display
:
inline-flex
;
display
:
inline-flex
;
align-items
:
center
;
align-items
:
center
;
&:nth-child(2){
margin-bottom
:
6px
;
}
&
:nth-child
(
4
)
{
.ql-picker-label{
display
:
flex
;
align-items
:
center
;
width
:
80px
;
}
}
}
}
/
deep
/
.ql-toolbar.ql-snow
,
/
deep
/
.ql-container.ql-snow
{
/
deep
/
.ql-toolbar.ql-snow
,
/
deep
/
.ql-container.ql-snow
{
border-color
:
#E5E5E5
;
border-color
:
#E5E5E5
;
...
...
src/views/serviceConfig/addService.vue
View file @
6afd51a
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
<el-checkbox
v-for=
"(item,index) in conditionList"
:label=
"item.id"
:key=
"index"
>
<el-checkbox
v-for=
"(item,index) in conditionList"
:label=
"item.id"
:key=
"index"
>
<span
class=
"sign"
>
条件
{{
index
+
1
}}
</span>
<span
class=
"sign"
>
条件
{{
index
+
1
}}
</span>
<span
v-if=
"!item.newItem"
class=
"condition"
>
{{
item
.
contractContent
}}
</span>
<span
v-if=
"!item.newItem"
class=
"condition"
>
{{
item
.
contractContent
}}
</span>
<el-input
v-focus
v-else
type=
"text"
v-model=
"curEditCondition.value"
@
blur
.
stop=
"createConfig(0)"
></el-input>
<el-input
v-focus
v-else
type=
"text"
v-model=
"curEditCondition.value"
@
blur
.
stop=
"createConfig(0
, item
)"
></el-input>
<i
v-if=
"!item.newItem && !disabled"
class=
"el-icon-edit-outline edit"
@
click
.
prevent=
"editConditionFn(item, 'conditionList')"
></i>
<i
v-if=
"!item.newItem && !disabled"
class=
"el-icon-edit-outline edit"
@
click
.
prevent=
"editConditionFn(item, 'conditionList')"
></i>
</el-checkbox>
</el-checkbox>
</el-checkbox-group>
</el-checkbox-group>
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
<el-checkbox
v-for=
"(item,index) in responsibilityList"
:label=
"item.id"
:key=
"index"
>
<el-checkbox
v-for=
"(item,index) in responsibilityList"
:label=
"item.id"
:key=
"index"
>
<span
class=
"sign"
>
责任
{{
index
+
1
}}
</span>
<span
class=
"sign"
>
责任
{{
index
+
1
}}
</span>
<span
v-if=
"!item.newItem"
class=
"condition"
>
{{
item
.
contractContent
}}
</span>
<span
v-if=
"!item.newItem"
class=
"condition"
>
{{
item
.
contractContent
}}
</span>
<el-input
v-focus
v-else
type=
"text"
v-model=
"curEditCondition.value"
@
blur
.
stop=
"createConfig(1)"
></el-input>
<el-input
v-focus
v-else
type=
"text"
v-model=
"curEditCondition.value"
@
blur
.
stop=
"createConfig(1
, item
)"
></el-input>
<i
v-if=
"!item.newItem && !disabled"
class=
"el-icon-edit-outline edit"
@
click
.
prevent=
"editConditionFn(item, 'responsibilityList')"
></i>
<i
v-if=
"!item.newItem && !disabled"
class=
"el-icon-edit-outline edit"
@
click
.
prevent=
"editConditionFn(item, 'responsibilityList')"
></i>
</el-checkbox>
</el-checkbox>
</el-checkbox-group>
</el-checkbox-group>
...
@@ -95,6 +95,12 @@ import ServicesTable from './components/ServicesTable'
...
@@ -95,6 +95,12 @@ import ServicesTable from './components/ServicesTable'
import
Editor
from
'@/components/Editor'
import
Editor
from
'@/components/Editor'
import
{
addGradeItem
,
handleGradeData
}
from
'@/util/gradeData'
import
{
addGradeItem
,
handleGradeData
}
from
'@/util/gradeData'
import
NP
from
'number-precision'
import
NP
from
'number-precision'
const
TIP_OBJ
=
{
min_price
:
'最小值'
,
max_price
:
'最大值'
,
standardSalesCost
:
'上架成本'
,
standardShelfCost
:
'销售成本'
}
export
default
{
export
default
{
name
:
'addService'
,
name
:
'addService'
,
components
:{
components
:{
...
@@ -275,7 +281,9 @@ export default {
...
@@ -275,7 +281,9 @@ export default {
this
.
settingformData
.
forEach
(
item
=>
{
this
.
settingformData
.
forEach
(
item
=>
{
item
.
isDisabled
=
item
.
type
==
'input'
item
.
isDisabled
=
item
.
type
==
'input'
})
})
}
if
(
this
.
routeInfo
?.
id
)
{
this
.
getServiceDetail
()
}
}
this
.
getConfigList
()
this
.
getConfigList
()
},
},
...
@@ -300,6 +308,7 @@ export default {
...
@@ -300,6 +308,7 @@ export default {
},
},
getParams
(){
getParams
(){
const
_gradeList
=
[]
const
_gradeList
=
[]
try
{
this
.
gradeList
.
forEach
(
item
=>
{
this
.
gradeList
.
forEach
(
item
=>
{
const
{
id
,
serviceGrade
,
serviceOverview
,
serviceDetail
,
salePeriodData
,
gradeConfigList
}
=
item
const
{
id
,
serviceGrade
,
serviceOverview
,
serviceDetail
,
salePeriodData
,
gradeConfigList
}
=
item
let
_gradeConfigList
=
[]
let
_gradeConfigList
=
[]
...
@@ -311,7 +320,10 @@ export default {
...
@@ -311,7 +320,10 @@ export default {
let
max_price
=
NP
.
times
(
maxPrice
||
0
,
100
)
let
max_price
=
NP
.
times
(
maxPrice
||
0
,
100
)
standardSalesCost
=
NP
.
times
(
standardSalesCost
||
0
,
100
)
standardSalesCost
=
NP
.
times
(
standardSalesCost
||
0
,
100
)
standardShelfCost
=
NP
.
times
(
standardShelfCost
||
0
,
100
)
standardShelfCost
=
NP
.
times
(
standardShelfCost
||
0
,
100
)
_gradeConfigList
.
push
({
id
,
priceGrade
,
priceCoefficient
,
minPrice
:
min_price
,
maxPrice
:
max_price
,
servicePeriod
,
standardSalesCost
,
standardShelfCost
})
// throw new Error('LoopInterrupt')
let
gradeConfigObj
=
{
id
,
priceGrade
,
priceCoefficient
,
minPrice
:
min_price
,
maxPrice
:
max_price
,
servicePeriod
,
standardSalesCost
,
standardShelfCost
}
// TIP_OBJ
_gradeConfigList
.
push
(
gradeConfigObj
)
})
})
})
})
let
_gradeObj
=
{
let
_gradeObj
=
{
...
@@ -323,12 +335,17 @@ export default {
...
@@ -323,12 +335,17 @@ export default {
}
}
_gradeList
.
push
(
_gradeObj
)
_gradeList
.
push
(
_gradeObj
)
})
})
}
catch
(
e
)
{
console
.
log
(
e
)
}
const
params
=
{
const
params
=
{
serviceCode
:
this
.
routeInfo
.
serviceCode
,
serviceCode
:
this
.
routeInfo
.
serviceCode
,
serviceName
:
this
.
routeInfo
.
serviceName
,
serviceName
:
this
.
routeInfo
.
serviceName
,
gradeList
:
_gradeList
,
gradeList
:
_gradeList
,
monthlyInsuranceCost
:
NP
.
times
(
this
.
gradeFormObj
.
monthlyInsuranceCost
||
0
,
100
)
monthlyInsuranceCost
:
NP
.
times
(
this
.
gradeFormObj
.
monthlyInsuranceCost
||
0
,
100
)
}
}
console
.
log
(
this
.
routeInfo
)
console
.
log
(
params
,
'params'
)
return
params
return
params
},
},
commit
()
{
commit
()
{
...
@@ -342,13 +359,19 @@ export default {
...
@@ -342,13 +359,19 @@ export default {
})
})
},
},
handleAddGrade
(){
handleAddGrade
(){
const
_gradeList
=
[
'A'
,
'B'
,
'C'
,
'D'
,
'E'
]
const
_gradeList
=
[
if
(
this
.
gradeList
.
length
==
_gradeList
.
length
)
return
;
'A'
,
'B'
,
'C'
,
'D'
,
'E'
,
'F'
,
'G'
,
'H'
,
'I'
,
'J'
,
'K'
,
'L'
,
'M'
,
'N'
,
'O'
,
'P'
,
'Q'
,
'R'
,
'S'
,
'T'
,
'U'
,
'V'
,
'W'
,
'X'
,
'Y'
,
'Z'
]
if
(
this
.
gradeList
.
length
==
_gradeList
.
length
)
return
this
.
$message
.
error
(
'最多添加26个规格'
);
const
_grade
=
_gradeList
[
this
.
gradeList
.
length
]
const
_grade
=
_gradeList
[
this
.
gradeList
.
length
]
this
.
gradeList
.
push
(
addGradeItem
(
_grade
,
this
.
formObj
.
salePeriod
))
this
.
gradeList
.
push
(
addGradeItem
(
_grade
,
this
.
formObj
.
salePeriod
))
},
},
getSpecificaList
(){
// 编辑的时候获取规格数据
this
.
$apis
.
serviceConfig
.
getSpecificaListApi
({
serviceCode
:
this
.
routeInfo
.
serviceCode
}).
then
(
res
=>
{
getSpecificaList
(
serviceCode
){
this
.
$apis
.
serviceConfig
.
getSpecificaListApi
({
serviceCode
:
this
.
routeInfo
.
serviceCode
}).
then
(
res
=>
{
if
(
res
){
if
(
res
){
if
(
res
.
length
==
0
){
if
(
res
.
length
==
0
){
this
.
ininData
()
this
.
ininData
()
...
@@ -370,8 +393,6 @@ export default {
...
@@ -370,8 +393,6 @@ export default {
for
(
const
key
in
this
.
formObj
){
for
(
const
key
in
this
.
formObj
){
this
.
formObj
[
key
]
=
transKeyList
.
includes
(
key
)
&&
res
[
key
].
split
?
res
[
key
].
split
(
','
).
map
(
item
=>
parseInt
(
item
))
:
res
[
key
]
this
.
formObj
[
key
]
=
transKeyList
.
includes
(
key
)
&&
res
[
key
].
split
?
res
[
key
].
split
(
','
).
map
(
item
=>
parseInt
(
item
))
:
res
[
key
]
}
}
this
.
routeInfo
.
serviceCode
=
res
.
serviceCode
this
.
routeInfo
.
serviceName
=
res
.
serviceName
this
.
gradeFormObj
.
monthlyInsuranceCost
=
NP
.
divide
((
res
.
monthlyInsuranceCost
||
0
)
,
100
)
this
.
gradeFormObj
.
monthlyInsuranceCost
=
NP
.
divide
((
res
.
monthlyInsuranceCost
||
0
)
,
100
)
}
}
})
})
...
@@ -391,6 +412,8 @@ export default {
...
@@ -391,6 +412,8 @@ export default {
this
.
getSpecificaList
()
this
.
getSpecificaList
()
}
else
{
}
else
{
this
.
ininData
()
this
.
ininData
()
this
.
routeInfo
.
serviceCode
=
res
.
serviceCode
this
.
routeInfo
.
serviceName
=
res
.
serviceName
}
}
this
.
firstPage
=
false
this
.
firstPage
=
false
}
}
...
@@ -411,17 +434,17 @@ export default {
...
@@ -411,17 +434,17 @@ export default {
if
(
!
res
)
return
;
if
(
!
res
)
return
;
this
.
conditionList
=
res
.
filter
(
item
=>
item
.
contentType
==
0
)
this
.
conditionList
=
res
.
filter
(
item
=>
item
.
contentType
==
0
)
this
.
responsibilityList
=
res
.
filter
(
item
=>
item
.
contentType
==
1
)
this
.
responsibilityList
=
res
.
filter
(
item
=>
item
.
contentType
==
1
)
if
(
this
.
routeInfo
?.
id
)
{
this
.
getServiceDetail
()
}
})
})
},
},
// 添加购买条件或者除外责任
// 添加
编辑 =》
购买条件或者除外责任
createConfig
(
type
){
createConfig
(
type
,
row
){
const
{
id
,
value
}
=
this
.
curEditCondition
const
{
id
,
value
}
=
this
.
curEditCondition
if
(
!
value
)
{
if
(
!
value
)
{
this
.
conditionList
=
this
.
conditionList
.
filter
(
item
=>
item
.
contractContent
)
row
.
newItem
=
false
let
key
=
type
==
0
?
'conditionList'
:
'responsibilityList'
this
[
key
]
=
this
[
key
].
filter
(
item
=>
!!
item
.
contractContent
)
this
.
clearData
()
this
.
$message
.
error
(
`
${
type
==
0
?
'购买条件'
:
'除外责任'
}
不能为空`
)
this
.
$message
.
error
(
`
${
type
==
0
?
'购买条件'
:
'除外责任'
}
不能为空`
)
return
return
}
}
...
@@ -431,11 +454,13 @@ export default {
...
@@ -431,11 +454,13 @@ export default {
}
}
if
(
id
)
params
.
id
=
id
if
(
id
)
params
.
id
=
id
this
.
$apis
.
serviceConfig
.
createCommonConfig
(
params
).
then
(
res
=>
{
this
.
$apis
.
serviceConfig
.
createCommonConfig
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
){
if
(
res
){
this
.
$message
.
success
(
'操作成功'
)
this
.
$message
.
success
(
'操作成功'
)
this
.
getConfigList
()
this
.
getConfigList
()
}
}
}).
finally
(
end
=>
{
row
.
newItem
=
false
this
.
clearData
()
})
})
},
},
clearData
(){
clearData
(){
...
...
src/views/serviceConfig/components/ServicesTable/index.vue
View file @
6afd51a
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
</
template
>
</
template
>
</tr>
</tr>
<tr
class=
"desc-wrap"
>
<tr
class=
"desc-wrap"
>
<td
:colspan=
"tableData.salePeriodData.length*2 + 3"
>
<td
class=
"desc-td"
:colspan=
"tableData.salePeriodData.length*2 + 3"
>
<div
class=
"desc"
>
<div
class=
"desc"
>
<label
for=
""
>
服务条款概述:
</label>
<label
for=
""
>
服务条款概述:
</label>
<Editor
:disabled=
"disabled"
:editorOption=
"overviewOption"
v-model=
"tableData.serviceOverview"
></Editor>
<Editor
:disabled=
"disabled"
:editorOption=
"overviewOption"
v-model=
"tableData.serviceOverview"
></Editor>
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
</td>
</td>
</tr>
</tr>
<tr
class=
"desc-wrap"
>
<tr
class=
"desc-wrap"
>
<td
:colspan=
"tableData.salePeriodData.length*2+3"
>
<td
class=
"desc-td"
:colspan=
"tableData.salePeriodData.length*2+3"
>
<div
class=
"desc"
>
<div
class=
"desc"
>
<label
for=
""
>
规格详细描述:
</label>
<label
for=
""
>
规格详细描述:
</label>
<Editor
:disabled=
"disabled"
:editorOption=
"DetailOption"
v-model=
"tableData.serviceDetail"
></Editor>
<Editor
:disabled=
"disabled"
:editorOption=
"DetailOption"
v-model=
"tableData.serviceDetail"
></Editor>
...
@@ -166,18 +166,16 @@
...
@@ -166,18 +166,16 @@
}
}
.desc-wrap
{
.desc-wrap
{
height
:
88px
;
height
:
88px
;
.desc-td{
padding
:
12px
16px
;
}
.desc
{
.desc
{
display
:
flex
;
display
:
flex
;
height
:
100%
;
label{
label{
white-space
:
nowrap
;
white-space
:
nowrap
;
}
}
/
deep
/
.bar-content
{
/
deep
/
.editor-ctnr
{
height
:
64px
;
width
:
100%
;
.editor{
height
:
100%
;
width
:
100%
;
.quill-editor{
height
:
100%
;
height
:
100%
;
.ql-container{
.ql-container{
border-radius
:
4px
;
border-radius
:
4px
;
...
@@ -187,8 +185,6 @@
...
@@ -187,8 +185,6 @@
}
}
}
}
}
}
}
}
}
}
}
}
...
...
src/views/serviceConfig/index.vue
View file @
6afd51a
...
@@ -132,7 +132,7 @@
...
@@ -132,7 +132,7 @@
minWidth
:
280
,
minWidth
:
280
,
prop
:
'salePeriod'
,
prop
:
'salePeriod'
,
formatter
:
cellValue
=>
{
formatter
:
cellValue
=>
{
return
cellValue
.
salePeriod
?.
length
?
cellValue
.
salePeriod
.
split
(
','
).
join
(
'、'
)
:
'--'
return
cellValue
.
salePeriod
?.
length
?
cellValue
.
salePeriod
.
split
(
','
).
map
(
item
=>
item
=
item
+
'年'
).
join
(
'、'
)
:
'--'
}
}
},
},
{
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment