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 23554c1f
authored
May 23, 2023
by
zhangquan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
接口联调
1 parent
2c2615e0
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
365 additions
and
71 deletions
package-lock.json
package.json
src/api/modules/contractManager.js
src/components/Editor/index.vue
src/components/Upload/index.vue
src/util/gradeData.js
src/util/quillTool.js
src/views/ContractManager/addTmpl.vue
src/views/ContractManager/index.vue
src/views/serviceConfig/addService.vue
src/views/serviceConfig/components/ServicesTable/index.vue
package-lock.json
View file @
23554c1
...
@@ -8824,6 +8824,11 @@
...
@@ -8824,6 +8824,11 @@
"integrity"
:
"sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ=="
,
"integrity"
:
"sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ=="
,
"dev"
:
true
"dev"
:
true
},
},
"number-precision"
:
{
"version"
:
"1.6.0"
,
"resolved"
:
"https://registry.npmmirror.com/number-precision/-/number-precision-1.6.0.tgz"
,
"integrity"
:
"sha512-05OLPgbgmnixJw+VvEh18yNPUo3iyp4BEWJcrLu4X9W05KmMifN7Mu5exYvQXqxxeNWhvIF+j3Rij+HmddM/hQ=="
},
"oauth-sign"
:
{
"oauth-sign"
:
{
"version"
:
"0.9.0"
,
"version"
:
"0.9.0"
,
"resolved"
:
"https://registry.npmmirror.com/oauth-sign/-/oauth-sign-0.9.0.tgz"
,
"resolved"
:
"https://registry.npmmirror.com/oauth-sign/-/oauth-sign-0.9.0.tgz"
,
...
...
package.json
View file @
23554c1
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
"glsx-common"
:
"^1.4.6"
,
"glsx-common"
:
"^1.4.6"
,
"glsx-components"
:
"^1.5.2"
,
"glsx-components"
:
"^1.5.2"
,
"lodash"
:
"^4.17.21"
,
"lodash"
:
"^4.17.21"
,
"number-precision"
:
"^1.6.0"
,
"vue"
:
"^2.6.10"
,
"vue"
:
"^2.6.10"
,
"vue-quill-editor"
:
"^3.0.6"
,
"vue-quill-editor"
:
"^3.0.6"
,
"vue-router"
:
"^3.1.3"
,
"vue-router"
:
"^3.1.3"
,
...
...
src/api/modules/contractManager.js
0 → 100644
View file @
23554c1
import
{
http
}
from
'@/main'
const
CUR_BASE_URL
=
'rop-scrm-equity/router'
const
getContractListApi
=
params
=>
{
params
.
method
=
`scrm.api.equity.service.contract.template.list`
return
http
({
url
:
CUR_BASE_URL
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
const
saveContractTemplateApi
=
params
=>
{
params
.
method
=
`scrm.api.equity.service.contract.template.update`
return
http
({
url
:
CUR_BASE_URL
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
const
getContractDetailApi
=
params
=>
{
params
.
method
=
`scrm.api.equity.service.contract.template.detail`
return
http
({
url
:
CUR_BASE_URL
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
const
printContractApi
=
params
=>
{
params
.
method
=
`scrm.api.equity.service.contract.template.printTest`
return
http
({
url
:
CUR_BASE_URL
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
export
default
{
getContractListApi
,
saveContractTemplateApi
,
getContractDetailApi
,
printContractApi
}
\ No newline at end of file
\ No newline at end of file
src/components/Editor/index.vue
View file @
23554c1
<
template
>
<
template
>
<div
class=
"
bar-content
"
>
<div
class=
"
editor-ctnr
"
>
<label
v-if=
"label"
for=
""
class=
"content-label"
>
{{
label
}}
</label>
<label
v-if=
"label"
for=
""
class=
"content-label"
>
{{
label
}}
</label>
<div
class=
"editor"
>
<div
class=
"editor"
>
<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"
>
<i
class=
"el-icon-circle-plus extend-icon"
@
click=
"insertContent"
>
购买条件
</i>
<i
v-for=
"item in operateList"
:key=
"item.key"
class=
"el-icon-circle-plus extend-icon"
@
click=
"insertContent(item.name, item.key, -1)"
>
{{
item
.
name
}}
</i>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -16,6 +16,7 @@ import Label from '@/util/quillTool'
...
@@ -16,6 +16,7 @@ import Label from '@/util/quillTool'
Quill
.
register
(
Label
,
true
)
Quill
.
register
(
Label
,
true
)
import
'quill/dist/quill.core.css'
import
'quill/dist/quill.core.css'
import
'quill/dist/quill.snow.css'
import
'quill/dist/quill.snow.css'
import
{
cpSync
}
from
'fs'
export
default
{
export
default
{
name
:
'FoldFrame'
,
name
:
'FoldFrame'
,
components
:{
components
:{
...
@@ -75,17 +76,41 @@ export default {
...
@@ -75,17 +76,41 @@ export default {
if
(
this
.
disable
)
this
.
$refs
.
myQuillEditor
.
quill
.
enable
(
false
);
if
(
this
.
disable
)
this
.
$refs
.
myQuillEditor
.
quill
.
enable
(
false
);
},
},
methods
:
{
methods
:
{
insertContent
(){
insertContent
(
name
,
key
,
index
){
let
quill
=
this
.
$refs
.
myQuillEditor
.
quill
;
let
quill
=
this
.
$refs
.
myQuillEditor
.
quill
;
let
length
=
quill
.
selection
.
savedRange
.
index
;
let
length
=
index
>-
1
?
index
:
quill
.
selection
.
savedRange
.
index
quill
.
insertEmbed
(
length
,
'label'
,
132
);
quill
.
insertEmbed
(
length
,
'label'
,
{
name
,
key
}
);
quill
.
setSelection
(
length
+
1
);
quill
.
setSelection
(
length
+
1
);
}
},
replaceText
(){
let
quill
=
this
.
$refs
.
myQuillEditor
.
quill
;
if
(
!
quill
.
container
.
innerText
||
!
this
.
operateList
?.
length
)
return
let
num
=
0
this
.
operateList
.
forEach
(
item
=>
{
console
.
log
(
item
)
let
subStr
=
item
.
key
let
offset
=
0
;
do
{
offset
=
quill
.
getText
().
indexOf
(
subStr
,
offset
);
if
(
offset
!=
-
1
){
// console.log(quill.container.innerText,111)
// this.insertContent(item.name, subStr, offset)
quill
.
updateContents
([
{
retain
:
offset
+
num
},
{
delete
:
subStr
.
length
},
{
insert
:
{
label
:
{
name
:
item
.
name
,
key
:
subStr
}
}
}
]);
num
++
offset
+=
item
.
name
.
length
}
}
while
(
offset
!=
-
1
)
})
},
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.
bar-content
{
.
editor-ctnr
{
.content-label{
.content-label{
width
:
154px
;
width
:
154px
;
display
:
inline-block
;
display
:
inline-block
;
...
@@ -123,12 +148,13 @@ export default {
...
@@ -123,12 +148,13 @@ export default {
border-top
:
none
;
border-top
:
none
;
.extend-icon{
.extend-icon{
cursor
:
pointer
;
cursor
:
pointer
;
margin-right
:
10px
;
&::before{
&::before{
//
font-size
:
16px
;
//
font-size
:
16px
;
margin-right
:
5
px
;
margin-right
:
4
px
;
}
}
font-size
:
14px
;
font-size
:
14px
;
color
:
#
666
;
color
:
#
3f3b3b
;
}
}
}
}
}
}
...
...
src/components/Upload/index.vue
View file @
23554c1
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
},
},
url
:
{
url
:
{
type
:
String
,
type
:
String
,
default
:
'
https://img02.glsx.com.cn/weapp/resource/saas/scrm/assets/glsx/logo_menu.png
'
default
:
''
},
},
attr
:
{
attr
:
{
type
:
String
,
type
:
String
,
...
...
src/util/gradeData.js
View file @
23554c1
import
NP
from
'number-precision'
const
gradeObj
=
{
const
gradeObj
=
{
gradeConfigList
:
[
gradeConfigList
:
[
{
{
...
@@ -82,12 +83,14 @@ export const handleGradeData = (dataFromApi, salePeriodList=[])=>{
...
@@ -82,12 +83,14 @@ export const handleGradeData = (dataFromApi, salePeriodList=[])=>{
const
gradeList
=
[
'0'
,
'1'
,
'2'
]
//三个区间等级,后端定义的
const
gradeList
=
[
'0'
,
'1'
,
'2'
]
//三个区间等级,后端定义的
gradeList
.
forEach
(
item
=>
{
gradeList
.
forEach
(
item
=>
{
const
_target
=
gradeConfigList
.
find
(
o
=>
o
.
priceGrade
==
item
)
const
_target
=
gradeConfigList
.
find
(
o
=>
o
.
priceGrade
==
item
)
const
{
id
,
servicePeriod
,
maxPrice
,
minPrice
,
priceCoefficient
}
=
_target
||
{}
let
{
id
,
servicePeriod
,
maxPrice
,
minPrice
,
priceCoefficient
}
=
_target
||
{}
maxPrice
=
NP
.
divide
(
maxPrice
||
0
,
100
)
minPrice
=
NP
.
divide
(
minPrice
||
0
,
100
)
_gradeObj
.
gradeConfigList
.
push
({
servicePeriod
,
priceGrade
:
item
,
maxPrice
,
minPrice
,
priceCoefficient
,
id
})
_gradeObj
.
gradeConfigList
.
push
({
servicePeriod
,
priceGrade
:
item
,
maxPrice
,
minPrice
,
priceCoefficient
,
id
})
})
})
_gradeObj
.
salePeriodData
=
salePeriodList
.
map
(
item
=>
{
_gradeObj
.
salePeriodData
=
salePeriodList
.
map
(
item
=>
{
const
_target
=
element
.
gradeConfigList
.
find
(
o
=>
o
.
servicePeriod
==
item
)
const
_target
=
element
.
gradeConfigList
.
find
(
o
=>
o
.
servicePeriod
==
item
)
return
{
servicePeriod
:
item
,
standardShelfCost
:
_target
?.
standardShelfCost
,
standardSalesCost
:
_target
?.
standardSalesCost
}
return
{
servicePeriod
:
item
,
standardShelfCost
:
NP
.
divide
(
_target
?.
standardShelfCost
||
0
,
100
),
standardSalesCost
:
NP
.
divide
(
_target
?.
standardSalesCost
||
0
,
100
)
}
})
})
arr
.
push
(
_gradeObj
)
arr
.
push
(
_gradeObj
)
});
});
...
...
src/util/quillTool.js
View file @
23554c1
...
@@ -4,10 +4,11 @@ const Delta = Quill.imports.delta;
...
@@ -4,10 +4,11 @@ const Delta = Quill.imports.delta;
class
Label
extends
Parchment
.
Embed
{
class
Label
extends
Parchment
.
Embed
{
static
create
(
value
)
{
static
create
(
value
)
{
const
node
=
super
.
create
(
value
);
const
node
=
super
.
create
(
value
.
name
);
node
.
innerText
=
value
;
node
.
setAttribute
(
'keyName'
,
value
.
key
)
node
.
innerText
=
value
.
name
;
node
.
contentEditable
=
'false'
;
node
.
contentEditable
=
'false'
;
// this._addRemovalButton(node
);
// this._addRemovalButton(node
, value.key); //创建额外的标签,比如删除键
return
node
;
return
node
;
}
}
...
@@ -15,15 +16,16 @@ class Label extends Parchment.Embed {
...
@@ -15,15 +16,16 @@ class Label extends Parchment.Embed {
return
node
.
childNodes
[
0
].
textContent
;
return
node
.
childNodes
[
0
].
textContent
;
}
}
static
_addRemovalButton
(
node
)
{
static
_addRemovalButton
(
node
,
key
)
{
const
button
=
document
.
createElement
(
'button'
);
//
const button = document.createElement('button');
button
.
innerText
=
'x'
;
//
button.innerText = 'x';
button
.
onclick
=
()
=>
node
.
remove
();
//
button.onclick = () => node.remove();
button
.
contentEditable
=
'false'
;
//
button.contentEditable = 'false';
node
.
appendChild
(
button
);
//
node.appendChild(button);
// Extra span forces the cursor to the end of the label, otherwise it appears inside the removal button
// Extra span forces the cursor to the end of the label, otherwise it appears inside the removal button
const
span
=
document
.
createElement
(
'span'
);
const
span
=
document
.
createElement
(
'span'
);
span
.
setAttribute
(
'keyName'
,
key
)
span
.
innerText
=
''
;
span
.
innerText
=
''
;
node
.
appendChild
(
span
);
node
.
appendChild
(
span
);
}
}
...
...
src/views/ContractManager/addTmpl.vue
View file @
23554c1
...
@@ -3,20 +3,28 @@
...
@@ -3,20 +3,28 @@
<div
class=
"global-title"
>
编辑
</div>
<div
class=
"global-title"
>
编辑
</div>
<div
class=
"main"
>
<div
class=
"main"
>
<div
class=
"edit-bar"
>
<div
class=
"edit-bar"
>
<FoldFrame
name=
"Logo区域"
>
<FoldFrame
:name=
"item.title"
v-for=
"item in contentList"
:key=
"item.key"
>
<div
class=
"bar-content"
>
<div
v-if=
"item.type=='img'"
class=
"bar-content"
>
<Upload
class=
"upload"
name=
"Logo图:"
:defaultStyle=
"
{width:'208px'}">
</Upload>
<div
v-if=
"item.key=='electronicSealUrl'"
class=
"input-content"
>
<label
for=
""
>
服务主体:
</label>
<el-input
size=
"small"
type=
"text"
v-model=
"contentObj.serviceSubject"
></el-input>
</div>
<Upload
@
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>
</FoldFrame>
<div
v-if=
"item.type=='richText'"
class=
"bar-content"
>
<FoldFrame
name=
"合同介绍区域"
>
<div
v-if=
"item.key=='contractIntroduce'"
class=
"input-content"
>
<Editor
label=
"标题和介绍:"
v-model=
"obj.content"
></Editor>
<label
for=
""
>
合同标题:
</label>
<el-input
size=
"small"
type=
"text"
v-model=
"contentObj.contractTitle"
></el-input>
</div>
<Editor
:ref=
"item.key+'Ref'"
:operateList=
"item.key=='useConditions' ? placeholderList : []"
:label=
"item.label"
v-model=
"contentObj[item.key]"
></Editor>
</div>
</FoldFrame>
</FoldFrame>
</div>
</div>
<div
class=
"preview-area"
>
<div
class=
"footer-btn"
>
<div
v-html=
"obj.content"
></div>
<el-button
@
click=
"handelCancel"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"commitTemplate"
>
提交
</el-button>
</div>
</div>
<button
@
click=
"cons"
>
dasdasdas
</button>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -34,20 +42,130 @@ export default {
...
@@ -34,20 +42,130 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
obj
:
{
placeholderList
:
[],
content
:
''
contentObj
:
{
}
id
:
''
,
logoUrl
:
''
,
contractTitle
:
''
,
contractIntroduce
:
''
,
relevantDefinition
:
''
,
useConditions
:
''
,
serviceScope
:
''
,
exclusionLiability
:
''
,
serviceData
:
''
,
specialStatement
:
''
,
serviceSubject
:
''
,
electronicSealUrl
:
''
},
contentList
:
[
{
title
:
'Logo区域'
,
label
:
'Logo图'
,
key
:
'logoUrl'
,
type
:
'img'
},
// {
// label: '合同标题区域',
// label: '合同标题',
// key: 'contractTitle',
// type: 'input'
// },
{
title
:
'合同介绍区域'
,
label
:
'合同介绍:'
,
key
:
'contractIntroduce'
,
type
:
'richText'
},
{
title
:
'相关定义区域'
,
label
:
'相关定义:'
,
key
:
'relevantDefinition'
,
type
:
'richText'
},
{
title
:
'使用条件区域'
,
label
:
'使用条件:'
,
key
:
'useConditions'
,
type
:
'richText'
},
{
title
:
'服务范围区域'
,
label
:
'服务范围:'
,
key
:
'serviceScope'
,
type
:
'richText'
},
{
title
:
'除外责任区域'
,
label
:
'除外责任:'
,
key
:
'exclusionLiability'
,
type
:
'richText'
},
{
title
:
'服务所需资料区域'
,
label
:
'服务所需资料:'
,
key
:
'serviceData'
,
type
:
'richText'
},
{
title
:
'特别声明区域'
,
label
:
'特别声明:'
,
key
:
'specialStatement'
,
type
:
'richText'
},
{
title
:
'电子章图片区域'
,
label
:
'电子章图片'
,
key
:
'electronicSealUrl'
,
type
:
'img'
},
]
}
}
},
},
mounted
()
{
created
(){
},
mounted
()
{
this
.
getContractDetail
()
},
},
methods
:
{
methods
:
{
cons
(){
getContractDetail
()
{
console
.
log
(
this
.
obj
.
content
)
this
.
$apis
.
contractManager
.
getContractDetailApi
({
id
:
this
.
$route
.
params
.
id
}).
then
(
res
=>
{
if
(
res
&&
res
.
templateConfig
){
this
.
placeholderList
=
res
.
placeholderList
for
(
const
key
in
this
.
contentObj
){
this
.
contentObj
[
key
]
=
res
.
templateConfig
[
key
]
}
this
.
$nextTick
(()
=>
{
this
.
$refs
.
useConditionsRef
[
0
].
replaceText
()
})
}
})
},
handelCancel
(){
console
.
log
(
this
.
$refs
.
useConditionsRef
)
this
.
getParams
()
},
getParams
(){
const
params
=
this
.
$common
.
utils
.
deepClone
(
this
.
contentObj
)
params
.
useConditions
=
params
.
useConditions
.
replace
(
/<span.*
?
class.*
?
keyname
\=\"(
.*
?)\"
.*
?
<
\/
span>/g
,
'$1'
)
return
params
},
commitTemplate
(){
const
params
=
this
.
getParams
()
this
.
$apis
.
contractManager
.
saveContractTemplateApi
({...
params
}).
then
(
res
=>
{
if
(
res
){
this
.
$message
.
success
(
'操作成功'
)
}
}
})
},
uploadSuccess
(
e
){
this
.
contentObj
[
e
.
attr
]
=
e
.
url
},
delImage
(
e
){
this
.
contentObj
[
e
.
attr
]
=
''
},
}
}
}
}
</
script
>
</
script
>
...
@@ -55,6 +173,27 @@ export default {
...
@@ -55,6 +173,27 @@ export default {
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.container
{
.container
{
background-color
:
#fff
;
background-color
:
#fff
;
.footer-btn{
text-align
:
center
;
margin-top
:
16px
;
}
.input-content
{
display
:
flex
;
align-items
:
center
;
margin-bottom
:
24px
;
label{
flex-shrink
:
0
;
width
:
154px
;
white-space
:
nowrap
;
text-align
:
right
;
font-weight
:
400
;
font-size
:
14px
;
color
:
#333333
;
}
/
deep
/
.el-input__inner
{
width
:
342px
;
}
}
.main
{
.main
{
padding
:
10px
20px
32px
;
padding
:
10px
20px
32px
;
.edit-bar{
.edit-bar{
...
...
src/views/ContractManager/index.vue
View file @
23554c1
...
@@ -19,19 +19,23 @@
...
@@ -19,19 +19,23 @@
</span>
</span>
</GLTable>
</GLTable>
</div>
</div>
<pdf-dialog
:isVisible=
"isPdfVisible"
title=
"合同"
:pdfUrl=
"pdfUrl"
@
closeDialog=
"handlePdfClose"
></pdf-dialog>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
*
as
dayjs
from
'dayjs'
import
*
as
dayjs
from
'dayjs'
import
utils
from
'../../util/util'
import
utils
from
'../../util/util'
import
pdfDialog
from
'@/views/beforeSale/pdfDialog'
export
default
{
export
default
{
name
:
'equityList'
,
name
:
'equityList'
,
components
:{
components
:{
pdfDialog
},
},
data
()
{
data
()
{
return
{
return
{
size
:
'small'
,
size
:
'small'
,
isPdfVisible
:
false
,
buttonList
:
[
buttonList
:
[
{
{
type
:
'el-button'
,
type
:
'el-button'
,
...
@@ -42,7 +46,7 @@
...
@@ -42,7 +46,7 @@
type
:
'text'
type
:
'text'
},
},
listeners
:
{
listeners
:
{
click
:
row
=>
this
.
addClause
(
2
,
row
.
scope
)
click
:
row
=>
this
.
handlePdf
(
row
.
scope
)
}
}
},
},
{
{
...
@@ -59,7 +63,7 @@
...
@@ -59,7 +63,7 @@
}
}
],
],
searchForm
:
{
searchForm
:
{
service
Name
:
''
,
merchant
Name
:
''
,
createdDate
:
''
,
createdDate
:
''
,
updatedDate
:
''
updatedDate
:
''
},
},
...
@@ -67,7 +71,7 @@
...
@@ -67,7 +71,7 @@
searchFormData
:
[
searchFormData
:
[
{
{
label
:
'商户名称'
,
label
:
'商户名称'
,
name
:
'
serveice
Name'
,
name
:
'
merchant
Name'
,
type
:
'input'
,
type
:
'input'
,
isClear
:
true
,
isClear
:
true
,
},
},
...
@@ -89,39 +93,39 @@
...
@@ -89,39 +93,39 @@
}
}
],
],
// 表格
// 表格
getListApi
:
this
.
$apis
.
serviceConfig
.
getEquityList
,
getListApi
:
this
.
$apis
.
contractManager
.
getContractListApi
,
tableParams
:
{
tableParams
:
{
listName
:
'list'
,
listName
:
'list'
,
tableOption
:
true
,
tableOption
:
true
,
tableColumns
:
[
tableColumns
:
[
{
{
label
:
'合同编号'
,
label
:
'合同编号'
,
prop
:
'
sno
'
,
prop
:
'
id
'
,
width
:
200
width
:
200
},
},
{
{
label
:
'商户名称'
,
label
:
'商户名称'
,
prop
:
'
service
Name'
prop
:
'
merchant
Name'
},
},
{
{
label
:
'创建时间'
,
label
:
'创建时间'
,
prop
:
'createDate'
,
prop
:
'create
d
Date'
,
width
:
200
,
width
:
200
,
formatter
:
cellValue
=>
{
formatter
:
cellValue
=>
{
return
cellValue
.
create
Date
?
dayjs
(
cellValue
.
create
Date
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
'--'
return
cellValue
.
create
dDate
?
dayjs
(
cellValue
.
created
Date
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
'--'
}
}
},
},
{
{
label
:
'更新时间'
,
label
:
'更新时间'
,
prop
:
'updateDate'
,
prop
:
'update
d
Date'
,
width
:
200
,
width
:
200
,
formatter
:
cellValue
=>
{
formatter
:
cellValue
=>
{
return
cellValue
.
update
Date
?
dayjs
(
cellValue
.
update
Date
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
'--'
return
cellValue
.
update
dDate
?
dayjs
(
cellValue
.
updated
Date
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
:
'--'
}
}
},
},
{
{
label
:
'操作人'
,
label
:
'操作人'
,
prop
:
'updateBy'
,
prop
:
'update
d
By'
,
width
:
140
width
:
140
}
}
]
]
...
@@ -137,12 +141,12 @@
...
@@ -137,12 +141,12 @@
getParams
()
{
getParams
()
{
let
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
searchForm
))
let
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
searchForm
))
if
(
this
.
searchForm
?.
createdDate
?.
length
)
{
if
(
this
.
searchForm
?.
createdDate
?.
length
)
{
params
.
minCreateTim
e
=
new
Date
(
this
.
searchForm
.
createdDate
[
0
]).
toLocaleDateString
().
replace
(
/
\/
/g
,
'-'
)
+
' 00:00:00'
params
.
beginCreateDat
e
=
new
Date
(
this
.
searchForm
.
createdDate
[
0
]).
toLocaleDateString
().
replace
(
/
\/
/g
,
'-'
)
+
' 00:00:00'
params
.
maxCreateTim
e
=
new
Date
(
this
.
searchForm
.
createdDate
[
1
]).
toLocaleDateString
().
replace
(
/
\/
/g
,
'-'
)
+
' 23:59:59'
params
.
endCreateDat
e
=
new
Date
(
this
.
searchForm
.
createdDate
[
1
]).
toLocaleDateString
().
replace
(
/
\/
/g
,
'-'
)
+
' 23:59:59'
}
}
if
(
this
.
searchForm
?.
updatedDate
?.
length
)
{
if
(
this
.
searchForm
?.
updatedDate
?.
length
)
{
params
.
minUpdateTim
e
=
new
Date
(
this
.
searchForm
.
updatedDate
[
0
]).
toLocaleDateString
().
replace
(
/
\/
/g
,
'-'
)
+
' 00:00:00'
params
.
beginUpdateDat
e
=
new
Date
(
this
.
searchForm
.
updatedDate
[
0
]).
toLocaleDateString
().
replace
(
/
\/
/g
,
'-'
)
+
' 00:00:00'
params
.
maxUpdateTim
e
=
new
Date
(
this
.
searchForm
.
updatedDate
[
1
]).
toLocaleDateString
().
replace
(
/
\/
/g
,
'-'
)
+
' 23:59:59'
params
.
endUpdateDat
e
=
new
Date
(
this
.
searchForm
.
updatedDate
[
1
]).
toLocaleDateString
().
replace
(
/
\/
/g
,
'-'
)
+
' 23:59:59'
}
}
delete
params
.
createdDate
delete
params
.
createdDate
delete
params
.
updatedDate
delete
params
.
updatedDate
...
@@ -156,6 +160,25 @@
...
@@ -156,6 +160,25 @@
})
})
},
},
handlePdfClose
()
{
this
.
isPdfVisible
=
!
this
.
isPdfVisible
},
// 打印
handlePdf
(
row
)
{
const
loading
=
this
.
$loading
({
lock
:
true
,
text
:
'Loading'
,
spinner
:
'el-icon-loading'
,
background
:
'rgba(0, 0, 0, 0.3)'
})
this
.
$apis
.
contractManager
.
printContractApi
({
packageCode
:
row
.
packageCode
,
merchantId
:
row
.
merchantId
}).
then
(
res
=>
{
this
.
pdfUrl
=
res
this
.
handlePdfClose
()
loading
.
close
()
})
},
// 导出
// 导出
handleExport
()
{
handleExport
()
{
var
params
=
this
.
getParams
()
var
params
=
this
.
getParams
()
...
...
src/views/serviceConfig/addService.vue
View file @
23554c1
...
@@ -90,6 +90,7 @@ import Upload from '@/components/Upload'
...
@@ -90,6 +90,7 @@ import Upload from '@/components/Upload'
import
ServicesTable
from
'./components/ServicesTable'
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'
export
default
{
export
default
{
name
:
'addService'
,
name
:
'addService'
,
components
:{
components
:{
...
@@ -292,10 +293,14 @@ export default {
...
@@ -292,10 +293,14 @@ export default {
const
{
id
,
serviceGrade
,
serviceOverview
,
serviceDetail
,
salePeriodData
,
gradeConfigList
}
=
item
const
{
id
,
serviceGrade
,
serviceOverview
,
serviceDetail
,
salePeriodData
,
gradeConfigList
}
=
item
let
_gradeConfigList
=
[]
let
_gradeConfigList
=
[]
gradeConfigList
.
forEach
(
ele
=>
{
gradeConfigList
.
forEach
(
ele
=>
{
cons
t
{
priceGrade
,
priceCoefficient
,
minPrice
,
maxPrice
}
=
ele
le
t
{
priceGrade
,
priceCoefficient
,
minPrice
,
maxPrice
}
=
ele
salePeriodData
.
forEach
(
element
=>
{
salePeriodData
.
forEach
(
element
=>
{
const
{
id
,
servicePeriod
,
standardSalesCost
,
standardShelfCost
}
=
element
let
{
id
,
servicePeriod
,
standardSalesCost
,
standardShelfCost
}
=
element
_gradeConfigList
.
push
({
id
,
priceGrade
,
priceCoefficient
,
minPrice
,
maxPrice
,
servicePeriod
,
standardSalesCost
,
standardShelfCost
})
minPrice
=
NP
.
times
(
minPrice
||
0
,
100
)
maxPrice
=
NP
.
times
(
maxPrice
||
0
,
100
)
standardSalesCost
=
NP
.
times
(
standardSalesCost
||
0
,
100
)
standardShelfCost
=
NP
.
times
(
standardShelfCost
||
0
,
100
)
_gradeConfigList
.
push
({
id
,
priceGrade
,
priceCoefficient
,
minPrice
,
maxPrice
,
servicePeriod
,
standardSalesCost
,
standardShelfCost
})
})
})
})
})
let
_gradeObj
=
{
let
_gradeObj
=
{
...
@@ -311,7 +316,7 @@ export default {
...
@@ -311,7 +316,7 @@ export default {
serviceCode
:
this
.
routeInfo
.
serviceCode
,
serviceCode
:
this
.
routeInfo
.
serviceCode
,
serviceName
:
this
.
routeInfo
.
serviceName
,
serviceName
:
this
.
routeInfo
.
serviceName
,
gradeList
:
_gradeList
,
gradeList
:
_gradeList
,
monthlyInsuranceCost
:
this
.
gradeFormObj
.
monthlyInsuranceCost
monthlyInsuranceCost
:
NP
.
times
(
this
.
gradeFormObj
.
monthlyInsuranceCost
||
0
,
100
)
}
}
return
params
return
params
},
},
...
@@ -355,7 +360,7 @@ export default {
...
@@ -355,7 +360,7 @@ export default {
}
}
this
.
routeInfo
.
serviceCode
=
res
.
serviceCode
this
.
routeInfo
.
serviceCode
=
res
.
serviceCode
this
.
routeInfo
.
serviceName
=
res
.
serviceName
this
.
routeInfo
.
serviceName
=
res
.
serviceName
this
.
gradeFormObj
.
monthlyInsuranceCost
=
res
.
monthlyInsuranceCost
this
.
gradeFormObj
.
monthlyInsuranceCost
=
NP
.
divide
((
res
.
monthlyInsuranceCost
||
0
)
,
100
)
}
}
})
})
},
},
...
...
src/views/serviceConfig/components/ServicesTable/index.vue
View file @
23554c1
...
@@ -38,13 +38,7 @@
...
@@ -38,13 +38,7 @@
<td
:colspan=
"tableData.salePeriodData.length*2 + 3"
>
<td
:colspan=
"tableData.salePeriodData.length*2 + 3"
>
<div
class=
"desc"
>
<div
class=
"desc"
>
<label
for=
""
>
服务条款概述:
</label>
<label
for=
""
>
服务条款概述:
</label>
<el-input
<Editor
:disable=
"disable"
:editorOption=
"overviewOption"
v-model=
"tableData.serviceOverview"
></Editor>
:disabled=
"disable"
type=
"textarea"
:rows=
"3"
placeholder=
"请输入内容"
v-model=
"tableData.serviceOverview"
>
</el-input>
</div>
</div>
</td>
</td>
</tr>
</tr>
...
@@ -52,13 +46,7 @@
...
@@ -52,13 +46,7 @@
<td
:colspan=
"tableData.salePeriodData.length*2+3"
>
<td
:colspan=
"tableData.salePeriodData.length*2+3"
>
<div
class=
"desc"
>
<div
class=
"desc"
>
<label
for=
""
>
规格详细描述:
</label>
<label
for=
""
>
规格详细描述:
</label>
<el-input
<Editor
:disable=
"disable"
:editorOption=
"DetailOption"
v-model=
"tableData.serviceDetail"
></Editor>
:disabled=
"disable"
type=
"textarea"
:rows=
"3"
placeholder=
"请输入内容"
v-model=
"tableData.serviceDetail"
>
</el-input>
</div>
</div>
</td>
</td>
</tr>
</tr>
...
@@ -67,8 +55,12 @@
...
@@ -67,8 +55,12 @@
</template>
</template>
<
script
>
<
script
>
import
Editor
from
'@/components/Editor'
export
default
{
export
default
{
name
:
'ServicesTable'
,
name
:
'ServicesTable'
,
components
:{
Editor
,
},
props
:
{
props
:
{
name
:
{
name
:
{
type
:
String
,
type
:
String
,
...
@@ -95,10 +87,42 @@
...
@@ -95,10 +87,42 @@
},
},
data
()
{
data
()
{
return
{
return
{
overviewOption
:
{
placeholder
:
'请输入服务条款概述'
,
modules
:
{
toolbar
:
false
,
clipboard
:
{
// 粘贴版,处理粘贴时候的自带样式
matchers
:
[[
Node
.
ELEMENT_NODE
,
this
.
HandleCustomMatcher
]],
},
}
},
DetailOption
:
{
placeholder
:
'请输入规格详细描述'
,
modules
:
{
toolbar
:
false
,
clipboard
:
{
// 粘贴版,处理粘贴时候的自带样式
matchers
:
[[
Node
.
ELEMENT_NODE
,
this
.
HandleCustomMatcher
]],
},
}
}
}
}
},
},
methods
:
{
methods
:
{
HandleCustomMatcher
(
node
,
Delta
)
{
// 文字、图片等,从别处复制而来,清除自带样式,转为纯文本
let
ops
=
[]
Delta
.
ops
.
forEach
(
op
=>
{
if
(
op
.
insert
&&
typeof
op
.
insert
===
'string'
)
{
ops
.
push
({
insert
:
op
.
insert
,
})
}
})
Delta
.
ops
=
ops
return
Delta
},
}
}
}
}
</
script
>
</
script
>
...
@@ -142,6 +166,23 @@
...
@@ -142,6 +166,23 @@
label{
label{
white-space
:
nowrap
;
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
;
}
}
}
}
}
}
}
}
}
...
...
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