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
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
54 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 {
margin-right
:
0
;
display
:
inline-flex
;
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
{
border-color
:
#E5E5E5
;
...
...
src/views/serviceConfig/addService.vue
View file @
6afd51a
...
...
@@ -26,7 +26,7 @@
<el-checkbox
v-for=
"(item,index) in conditionList"
:label=
"item.id"
:key=
"index"
>
<span
class=
"sign"
>
条件
{{
index
+
1
}}
</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>
</el-checkbox>
</el-checkbox-group>
...
...
@@ -43,7 +43,7 @@
<el-checkbox
v-for=
"(item,index) in responsibilityList"
:label=
"item.id"
:key=
"index"
>
<span
class=
"sign"
>
责任
{{
index
+
1
}}
</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>
</el-checkbox>
</el-checkbox-group>
...
...
@@ -95,6 +95,12 @@ import ServicesTable from './components/ServicesTable'
import
Editor
from
'@/components/Editor'
import
{
addGradeItem
,
handleGradeData
}
from
'@/util/gradeData'
import
NP
from
'number-precision'
const
TIP_OBJ
=
{
min_price
:
'最小值'
,
max_price
:
'最大值'
,
standardSalesCost
:
'上架成本'
,
standardShelfCost
:
'销售成本'
}
export
default
{
name
:
'addService'
,
components
:{
...
...
@@ -275,7 +281,9 @@ export default {
this
.
settingformData
.
forEach
(
item
=>
{
item
.
isDisabled
=
item
.
type
==
'input'
})
}
if
(
this
.
routeInfo
?.
id
)
{
this
.
getServiceDetail
()
}
this
.
getConfigList
()
},
...
...
@@ -300,35 +308,44 @@ export default {
},
getParams
(){
const
_gradeList
=
[]
this
.
gradeList
.
forEach
(
item
=>
{
const
{
id
,
serviceGrade
,
serviceOverview
,
serviceDetail
,
salePeriodData
,
gradeConfigList
}
=
item
let
_gradeConfigList
=
[]
gradeConfigList
.
forEach
(
ele
=>
{
let
{
priceGrade
,
priceCoefficient
,
minPrice
,
maxPrice
}
=
ele
salePeriodData
.
forEach
(
element
=>
{
let
{
id
,
servicePeriod
,
standardSalesCost
,
standardShelfCost
}
=
element
let
min_price
=
NP
.
times
(
minPrice
||
0
,
100
)
let
max_price
=
NP
.
times
(
maxPrice
||
0
,
100
)
standardSalesCost
=
NP
.
times
(
standardSalesCost
||
0
,
100
)
standardShelfCost
=
NP
.
times
(
standardShelfCost
||
0
,
100
)
_gradeConfigList
.
push
({
id
,
priceGrade
,
priceCoefficient
,
minPrice
:
min_price
,
maxPrice
:
max_price
,
servicePeriod
,
standardSalesCost
,
standardShelfCost
})
try
{
this
.
gradeList
.
forEach
(
item
=>
{
const
{
id
,
serviceGrade
,
serviceOverview
,
serviceDetail
,
salePeriodData
,
gradeConfigList
}
=
item
let
_gradeConfigList
=
[]
gradeConfigList
.
forEach
(
ele
=>
{
let
{
priceGrade
,
priceCoefficient
,
minPrice
,
maxPrice
}
=
ele
salePeriodData
.
forEach
(
element
=>
{
let
{
id
,
servicePeriod
,
standardSalesCost
,
standardShelfCost
}
=
element
let
min_price
=
NP
.
times
(
minPrice
||
0
,
100
)
let
max_price
=
NP
.
times
(
maxPrice
||
0
,
100
)
standardSalesCost
=
NP
.
times
(
standardSalesCost
||
0
,
100
)
standardShelfCost
=
NP
.
times
(
standardShelfCost
||
0
,
100
)
// 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
=
{
id
,
serviceGrade
,
serviceOverview
,
serviceDetail
,
gradeConfigList
:
_gradeConfigList
}
_gradeList
.
push
(
_gradeObj
)
})
let
_gradeObj
=
{
id
,
serviceGrade
,
serviceOverview
,
serviceDetail
,
gradeConfigList
:
_gradeConfigList
}
_gradeList
.
push
(
_gradeObj
)
})
}
catch
(
e
)
{
console
.
log
(
e
)
}
const
params
=
{
serviceCode
:
this
.
routeInfo
.
serviceCode
,
serviceName
:
this
.
routeInfo
.
serviceName
,
gradeList
:
_gradeList
,
monthlyInsuranceCost
:
NP
.
times
(
this
.
gradeFormObj
.
monthlyInsuranceCost
||
0
,
100
)
}
console
.
log
(
this
.
routeInfo
)
console
.
log
(
params
,
'params'
)
return
params
},
commit
()
{
...
...
@@ -342,13 +359,19 @@ export default {
})
},
handleAddGrade
(){
const
_gradeList
=
[
'A'
,
'B'
,
'C'
,
'D'
,
'E'
]
if
(
this
.
gradeList
.
length
==
_gradeList
.
length
)
return
;
const
_gradeList
=
[
'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
]
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
.
length
==
0
){
this
.
ininData
()
...
...
@@ -370,8 +393,6 @@ export default {
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
.
routeInfo
.
serviceCode
=
res
.
serviceCode
this
.
routeInfo
.
serviceName
=
res
.
serviceName
this
.
gradeFormObj
.
monthlyInsuranceCost
=
NP
.
divide
((
res
.
monthlyInsuranceCost
||
0
)
,
100
)
}
})
...
...
@@ -391,6 +412,8 @@ export default {
this
.
getSpecificaList
()
}
else
{
this
.
ininData
()
this
.
routeInfo
.
serviceCode
=
res
.
serviceCode
this
.
routeInfo
.
serviceName
=
res
.
serviceName
}
this
.
firstPage
=
false
}
...
...
@@ -411,17 +434,17 @@ export default {
if
(
!
res
)
return
;
this
.
conditionList
=
res
.
filter
(
item
=>
item
.
contentType
==
0
)
this
.
responsibilityList
=
res
.
filter
(
item
=>
item
.
contentType
==
1
)
if
(
this
.
routeInfo
?.
id
)
{
this
.
getServiceDetail
()
}
})
},
// 添加购买条件或者除外责任
createConfig
(
type
){
// 添加
编辑 =》
购买条件或者除外责任
createConfig
(
type
,
row
){
const
{
id
,
value
}
=
this
.
curEditCondition
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
?
'购买条件'
:
'除外责任'
}
不能为空`
)
return
}
...
...
@@ -431,11 +454,13 @@ export default {
}
if
(
id
)
params
.
id
=
id
this
.
$apis
.
serviceConfig
.
createCommonConfig
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
){
this
.
$message
.
success
(
'操作成功'
)
this
.
getConfigList
()
}
}).
finally
(
end
=>
{
row
.
newItem
=
false
this
.
clearData
()
})
},
clearData
(){
...
...
src/views/serviceConfig/components/ServicesTable/index.vue
View file @
6afd51a
...
...
@@ -40,7 +40,7 @@
</
template
>
</tr>
<tr
class=
"desc-wrap"
>
<td
:colspan=
"tableData.salePeriodData.length*2 + 3"
>
<td
class=
"desc-td"
:colspan=
"tableData.salePeriodData.length*2 + 3"
>
<div
class=
"desc"
>
<label
for=
""
>
服务条款概述:
</label>
<Editor
:disabled=
"disabled"
:editorOption=
"overviewOption"
v-model=
"tableData.serviceOverview"
></Editor>
...
...
@@ -48,7 +48,7 @@
</td>
</tr>
<tr
class=
"desc-wrap"
>
<td
:colspan=
"tableData.salePeriodData.length*2+3"
>
<td
class=
"desc-td"
:colspan=
"tableData.salePeriodData.length*2+3"
>
<div
class=
"desc"
>
<label
for=
""
>
规格详细描述:
</label>
<Editor
:disabled=
"disabled"
:editorOption=
"DetailOption"
v-model=
"tableData.serviceDetail"
></Editor>
...
...
@@ -166,25 +166,21 @@
}
.desc-wrap
{
height
:
88px
;
.desc-td{
padding
:
12px
16px
;
}
.desc
{
display
:
flex
;
height
:
100%
;
label{
white-space
:
nowrap
;
}
/
deep
/
.bar-content
{
height
:
64px
;
width
:
100%
;
.editor{
height
:
100%
;
width
:
100%
;
.quill-editor{
height
:
100%
;
.ql-container{
border-radius
:
4px
;
.ql-editor{
padding
:
8px
;
}
}
/
deep
/
.editor-ctnr
{
height
:
100%
;
.ql-container{
border-radius
:
4px
;
.ql-editor{
padding
:
8px
;
}
}
}
...
...
src/views/serviceConfig/index.vue
View file @
6afd51a
...
...
@@ -132,7 +132,7 @@
minWidth
:
280
,
prop
:
'salePeriod'
,
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