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 1d781d8f
authored
May 30, 2023
by
zhangquan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
检验规则添加
1 parent
6afd51a1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
104 additions
and
48 deletions
src/assets/css/public.scss
src/components/Editor/index.vue
src/components/Upload/index.vue
src/views/ContractManager/addTmpl.vue
src/views/config/addConfig.vue
src/views/serviceConfig/addService.vue
src/assets/css/public.scss
View file @
1d781d8
...
@@ -551,4 +551,10 @@
...
@@ -551,4 +551,10 @@
line-height
:
60px
;
line-height
:
60px
;
border-bottom
:
1px
solid
#d8d8d8
;
border-bottom
:
1px
solid
#d8d8d8
;
color
:
#333
;
color
:
#333
;
}
.
required-field
:
:
before
{
content
:
"*"
;
color
:
#f56c6c
;
margin-right
:
4px
;
}
}
\ No newline at end of file
\ No newline at end of file
src/components/Editor/index.vue
View file @
1d781d8
<
template
>
<
template
>
<div
class=
"editor-ctnr"
>
<div
class=
"editor-ctnr"
>
<label
v-if=
"label"
for=
""
class=
"content-label
"
>
{{
label
}}
</label>
<label
v-if=
"label"
for=
""
:class=
"['content-label',
{'required-field': required}]
">
{{
label
}}
</label>
<div
:class=
"['editor',
{'disabled-editor': disabled}]">
<div
:class=
"['editor',
{'disabled-editor': disabled}]">
<quill-editor
placeholder=
"请输入"
ref=
"myQuillEditor"
class=
"quill"
v-model=
"value"
:options=
"editorOption"
@
change=
"$emit('change', $event.html)"
></quill-editor>
<quill-editor
placeholder=
"请输入"
ref=
"myQuillEditor"
class=
"quill"
v-model=
"value"
:options=
"editorOption"
@
change=
"$emit('change', $event.html)"
></quill-editor>
<div
class=
"extend-bar"
v-if=
"operateList && operateList.length"
>
<div
class=
"extend-bar"
v-if=
"operateList && operateList.length"
>
...
@@ -27,6 +27,10 @@ export default {
...
@@ -27,6 +27,10 @@ export default {
event
:
'change'
event
:
'change'
},
},
props
:
{
props
:
{
required
:
{
type
:
Boolean
,
default
:
false
},
value
:
{
value
:
{
type
:
Object
type
:
Object
},
},
...
...
src/components/Upload/index.vue
View file @
1d781d8
<
template
>
<
template
>
<div
class=
"upload-ctnr"
>
<div
class=
"upload-ctnr"
>
<label
v-if=
"name"
class=
"label
"
for=
""
>
{{
name
}}
</label>
<label
v-if=
"name"
:class=
"['label',
{'required-field': required}]
" for="">
{{
name
}}
</label>
<div
class=
"upload-wrap"
:style=
"defaultStyle"
>
<div
class=
"upload-wrap"
:style=
"defaultStyle"
>
<img
v-if=
"url"
class=
"image"
:src=
"url"
alt=
""
/>
<img
v-if=
"url"
class=
"image"
:src=
"url"
alt=
""
/>
<div
v-else
class=
"add-img"
>
<div
v-else
class=
"add-img"
>
...
@@ -29,6 +29,10 @@
...
@@ -29,6 +29,10 @@
bigView
bigView
},
},
props
:
{
props
:
{
required
:
{
type
:
Boolean
,
default
:
false
},
name
:
{
name
:
{
type
:
String
,
type
:
String
,
default
:
''
default
:
''
...
...
src/views/ContractManager/addTmpl.vue
View file @
1d781d8
...
@@ -6,18 +6,18 @@
...
@@ -6,18 +6,18 @@
<FoldFrame
:name=
"item.title"
v-for=
"item in contentList"
:key=
"item.key"
>
<FoldFrame
:name=
"item.title"
v-for=
"item in contentList"
:key=
"item.key"
>
<div
v-if=
"item.type=='img'"
class=
"bar-content"
>
<div
v-if=
"item.type=='img'"
class=
"bar-content"
>
<div
v-if=
"item.key=='electronicSealUrl'"
class=
"input-content"
>
<div
v-if=
"item.key=='electronicSealUrl'"
class=
"input-content"
>
<label
for=
""
>
服务主体:
</label>
<label
class=
"required-field"
for=
""
>
服务主体:
</label>
<el-input
size=
"small"
type=
"text"
v-model=
"contentObj.serviceSubject"
></el-input>
<el-input
size=
"small"
type=
"text"
v-model=
"contentObj.serviceSubject"
></el-input>
</div>
</div>
<Upload
@
uploadSuccess=
"uploadSuccess"
@
delImage=
"delImage"
class=
"upload"
:name=
"item.label+':'"
:attr=
"item.key"
:url=
"contentObj[item.key]"
:defaultStyle=
"
{width:'208px'}">
</Upload>
<Upload
:required=
"true"
@
uploadSuccess=
"uploadSuccess"
@
delImage=
"delImage"
class=
"upload"
:name=
"item.label+':'"
:attr=
"item.key"
:url=
"contentObj[item.key]"
:defaultStyle=
"
{width:'208px'}">
</Upload>
<span
class=
"upload-tip"
>
建议高度:48px
</span>
<span
class=
"upload-tip"
>
建议高度:48px
</span>
</div>
</div>
<div
v-if=
"item.type=='richText'"
class=
"bar-content"
>
<div
v-if=
"item.type=='richText'"
class=
"bar-content"
>
<div
v-if=
"item.key=='contractIntroduce'"
class=
"input-content"
>
<div
v-if=
"item.key=='contractIntroduce'"
class=
"input-content"
>
<label
for=
""
>
合同标题:
</label>
<label
class=
"required-field"
for=
""
>
合同标题:
</label>
<el-input
size=
"small"
type=
"text"
v-model=
"contentObj.contractTitle"
></el-input>
<el-input
size=
"small"
type=
"text"
v-model=
"contentObj.contractTitle"
></el-input>
</div>
</div>
<Editor
:ref=
"item.key+'Ref'"
:operateList=
"item.key=='useConditions' ? placeholderList : []"
:label=
"item.label"
v-model=
"contentObj[item.key]"
></Editor>
<Editor
:re
quired=
"true"
:re
f=
"item.key+'Ref'"
:operateList=
"item.key=='useConditions' ? placeholderList : []"
:label=
"item.label"
v-model=
"contentObj[item.key]"
></Editor>
</div>
</div>
</FoldFrame>
</FoldFrame>
</div>
</div>
...
@@ -30,6 +30,17 @@
...
@@ -30,6 +30,17 @@
</
template
>
</
template
>
<
script
>
<
script
>
const
errorTipObj
=
{
contractTitle
:
'合同标题'
,
contractIntroduce
:
'合同介绍'
,
relevantDefinition
:
'相关定义'
,
useConditions
:
'使用条件'
,
serviceScope
:
'服务范围'
,
exclusionLiability
:
'除外责任'
,
serviceData
:
'服务所需资料'
,
specialStatement
:
'特别声明'
,
serviceSubject
:
'服务主体'
}
import
FoldFrame
from
'./components/FoldFrame'
import
FoldFrame
from
'./components/FoldFrame'
import
Upload
from
'@/components/Upload'
import
Upload
from
'@/components/Upload'
import
Editor
from
'@/components/Editor'
import
Editor
from
'@/components/Editor'
...
@@ -148,21 +159,30 @@ export default {
...
@@ -148,21 +159,30 @@ export default {
})
})
},
},
handelCancel
(){
handelCancel
(){
console
.
log
(
this
.
$refs
.
useConditionsRef
)
this
.
$router
.
push
(
'/ContractManager/index'
)
this
.
getParams
()
},
},
getParams
(){
getParams
(){
const
params
=
this
.
$common
.
utils
.
deepClone
(
this
.
contentObj
)
const
params
=
this
.
$common
.
utils
.
deepClone
(
this
.
contentObj
)
let
errorTip
=
''
;
params
.
useConditions
=
params
.
useConditions
?.
replace
(
/<span.*
?
class.*
?
keyname="
(
.*
?)
".*
?
<
\/
span>/g
,
'$1'
)
params
.
useConditions
=
params
.
useConditions
?.
replace
(
/<span.*
?
class.*
?
keyname="
(
.*
?)
".*
?
<
\/
span>/g
,
'$1'
)
for
(
const
key
in
params
){
for
(
const
key
in
params
){
if
(
replaceArr
.
includes
(
key
)){
if
(
replaceArr
.
includes
(
key
)){
params
[
key
]
=
params
[
key
]?.
replace
(
'<br>'
,
''
)
params
[
key
]
=
params
[
key
]?.
replace
(
'<br>'
,
''
)
}
}
if
(
key
!=
'id'
&&
!
params
[
key
]){
if
(
key
==
'electronicSealUrl'
||
key
==
'logoUrl'
){
errorTip
=
`请上传
${
key
==
'logoUrl'
?
'Logo图'
:
'电子章图片'
}
`
}
else
{
errorTip
=
`
${
errorTipObj
[
key
]}
不能为空`
}
}
}
}
if
(
errorTip
)
return
{
status
:
-
1
,
errorTip
}
return
params
return
params
},
},
commitTemplate
(){
commitTemplate
(){
const
params
=
this
.
getParams
()
const
params
=
this
.
getParams
()
if
(
params
.
status
==
-
1
)
return
this
.
$message
.
error
(
params
.
errorTip
)
this
.
$apis
.
contractManager
.
saveContractTemplateApi
({...
params
}).
then
(
res
=>
{
this
.
$apis
.
contractManager
.
saveContractTemplateApi
({...
params
}).
then
(
res
=>
{
if
(
res
){
if
(
res
){
this
.
$message
.
success
(
'编辑成功'
)
this
.
$message
.
success
(
'编辑成功'
)
...
...
src/views/config/addConfig.vue
View file @
1d781d8
...
@@ -92,6 +92,9 @@
...
@@ -92,6 +92,9 @@
</el-form-item>
</el-form-item>
<el-form-item
v-for=
"item in newPackageList"
:key=
"item.packageCode"
>
<el-form-item
v-for=
"item in newPackageList"
:key=
"item.packageCode"
>
<el-checkbox
v-model=
"item.isChecked"
>
{{
item
.
packageName
}}
</el-checkbox>
<el-checkbox
v-model=
"item.isChecked"
>
{{
item
.
packageName
}}
</el-checkbox>
<div>
<el-checkbox
v-model=
"item.cardName"
true-label=
"card"
false-label=
""
>
卡输入
</el-checkbox>
</div>
</el-form-item>
</el-form-item>
</
template
>
</
template
>
</el-form>
</el-form>
...
@@ -437,8 +440,8 @@ export default {
...
@@ -437,8 +440,8 @@ export default {
}
}
this
.
newPackageList
.
forEach
(
item
=>
{
this
.
newPackageList
.
forEach
(
item
=>
{
if
(
item
.
isChecked
){
if
(
item
.
isChecked
){
let
{
packageCode
,
packageServicePeriod
}
=
item
let
{
packageCode
,
packageServicePeriod
,
cardName
}
=
item
params
.
push
({
packageCode
,
servicePeriod
:
packageServicePeriod
})
params
.
push
({
packageCode
,
servicePeriod
:
packageServicePeriod
,
cardName
})
}
}
})
})
let
targetParams
=
{
let
targetParams
=
{
...
...
src/views/serviceConfig/addService.vue
View file @
1d781d8
...
@@ -96,10 +96,11 @@ import Editor from '@/components/Editor'
...
@@ -96,10 +96,11 @@ 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
=
{
const
TIP_OBJ
=
{
min
_p
rice
:
'最小值'
,
min
P
rice
:
'最小值'
,
max
_p
rice
:
'最大值'
,
max
P
rice
:
'最大值'
,
standardSalesCost
:
'上架成本'
,
standardSalesCost
:
'上架成本'
,
standardShelfCost
:
'销售成本'
standardShelfCost
:
'销售成本'
,
priceCoefficient
:
'价格系数'
}
}
export
default
{
export
default
{
name
:
'addService'
,
name
:
'addService'
,
...
@@ -306,50 +307,58 @@ export default {
...
@@ -306,50 +307,58 @@ export default {
ininData
(){
ininData
(){
this
.
gradeList
=
[
addGradeItem
(
'A'
,
this
.
formObj
.
salePeriod
)]
this
.
gradeList
=
[
addGradeItem
(
'A'
,
this
.
formObj
.
salePeriod
)]
},
},
getParams
(){
commit
(){
const
_gradeList
=
[]
const
_gradeList
=
[]
try
{
// let tip = ''
this
.
gradeList
.
forEach
(
item
=>
{
// try {
const
{
id
,
serviceGrade
,
serviceOverview
,
serviceDetail
,
salePeriodData
,
gradeConfigList
}
=
item
this
.
gradeList
.
forEach
(
item
=>
{
let
_gradeConfigList
=
[]
const
{
id
,
serviceGrade
,
serviceOverview
,
serviceDetail
,
salePeriodData
,
gradeConfigList
}
=
item
gradeConfigList
.
forEach
(
ele
=>
{
let
_gradeConfigList
=
[]
let
{
priceGrade
,
priceCoefficient
,
minPrice
,
maxPrice
}
=
ele
gradeConfigList
.
forEach
(
ele
=>
{
salePeriodData
.
forEach
(
element
=>
{
let
{
priceGrade
,
priceCoefficient
,
minPrice
,
maxPrice
}
=
ele
let
{
id
,
servicePeriod
,
standardSalesCost
,
standardShelfCost
}
=
element
salePeriodData
.
forEach
(
element
=>
{
let
min_price
=
NP
.
times
(
minPrice
||
0
,
100
)
let
{
id
,
servicePeriod
,
standardSalesCost
,
standardShelfCost
}
=
element
let
max_price
=
NP
.
times
(
maxPrice
||
0
,
100
)
let
min_price
=
NP
.
times
(
minPrice
||
0
,
100
)
standardSalesCost
=
NP
.
times
(
standardSalesCost
||
0
,
100
)
let
max_price
=
NP
.
times
(
maxPrice
||
0
,
100
)
standardShelfCost
=
NP
.
times
(
standardShelfCost
||
0
,
100
)
standardSalesCost
=
NP
.
times
(
standardSalesCost
||
0
,
100
)
// throw new Error('LoopInterrupt')
standardShelfCost
=
NP
.
times
(
standardShelfCost
||
0
,
100
)
let
gradeConfigObj
=
{
id
,
priceGrade
,
priceCoefficient
,
minPrice
:
min_price
,
maxPrice
:
max_price
,
servicePeriod
,
standardSalesCost
,
standardShelfCost
}
let
gradeConfigObj
=
{
id
,
priceGrade
,
priceCoefficient
,
minPrice
:
min_price
,
maxPrice
:
max_price
,
servicePeriod
,
standardSalesCost
,
standardShelfCost
}
// TIP_OBJ
// for(const tipKey in TIP_OBJ){
_gradeConfigList
.
push
(
gradeConfigObj
)
// if(!gradeConfigObj[tipKey]){
})
// if(tipKey=='minPrice' || tipKey=='maxPrice'){
// tip = `请输入${serviceGrade}规格的第${priceGrade+1}价格区间${TIP_OBJ[tipKey]}`
// }else if(tipKey == 'priceCoefficient'){
// tip = `请输入${serviceGrade}规格的第${priceGrade+1}价格区间${TIP_OBJ[tipKey]}`
// }else{
// tip = `请输入${serviceGrade}规格${servicePeriod}年版的${TIP_OBJ[tipKey]}`
// }
// throw new Error('errorTip')
// }
// }
_gradeConfigList
.
push
(
gradeConfigObj
)
})
})
let
_gradeObj
=
{
id
,
serviceGrade
,
serviceOverview
,
serviceDetail
,
gradeConfigList
:
_gradeConfigList
}
_gradeList
.
push
(
_gradeObj
)
})
})
}
catch
(
e
)
{
let
_gradeObj
=
{
console
.
log
(
e
)
id
,
}
serviceGrade
,
serviceOverview
,
serviceDetail
,
gradeConfigList
:
_gradeConfigList
}
_gradeList
.
push
(
_gradeObj
)
})
// } catch (e) {
// console.log(e, e.Error)
// if(e == 'errorTip' && tip){
// return this.$message.error(tip)
// }
// }
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
},
commit
()
{
const
params
=
this
.
getParams
()
this
.
$apis
.
serviceConfig
.
addGradeApi
(
params
).
then
(
res
=>
{
this
.
$apis
.
serviceConfig
.
addGradeApi
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
console
.
log
(
res
)
if
(
res
){
if
(
res
){
...
@@ -358,6 +367,16 @@ export default {
...
@@ -358,6 +367,16 @@ export default {
}
}
})
})
},
},
// commit() {
// const params = this.getParams()
// this.$apis.serviceConfig.addGradeApi(params).then(res => {
// console.log(res)
// if(res){
// this.$message.success('提交成功')
// this.jumpListPage()
// }
// })
// },
handleAddGrade
(){
handleAddGrade
(){
const
_gradeList
=
[
const
_gradeList
=
[
'A'
,
'B'
,
'C'
,
'D'
,
'E'
,
'F'
,
'A'
,
'B'
,
'C'
,
'D'
,
'E'
,
'F'
,
...
...
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