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 b2c21aff
authored
May 26, 2023
by
zhangquan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交format价格
1 parent
94c1f9a6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
58 deletions
src/components/Editor/index.vue
src/views/serviceConfig/addService.vue
src/views/serviceConfig/components/ServicesTable/index.vue
src/components/Editor/index.vue
View file @
b2c21af
...
@@ -86,6 +86,7 @@ export default {
...
@@ -86,6 +86,7 @@ export default {
let
quill
=
this
.
$refs
.
myQuillEditor
.
quill
;
let
quill
=
this
.
$refs
.
myQuillEditor
.
quill
;
if
(
!
quill
.
container
.
innerText
||
!
this
.
operateList
?.
length
)
return
if
(
!
quill
.
container
.
innerText
||
!
this
.
operateList
?.
length
)
return
let
num
=
0
let
num
=
0
const
offsetArr
=
[]
this
.
operateList
.
forEach
(
item
=>
{
this
.
operateList
.
forEach
(
item
=>
{
console
.
log
(
item
)
console
.
log
(
item
)
let
subStr
=
item
.
key
let
subStr
=
item
.
key
...
@@ -93,14 +94,19 @@ export default {
...
@@ -93,14 +94,19 @@ export default {
do
{
do
{
offset
=
quill
.
getText
().
indexOf
(
subStr
,
offset
);
offset
=
quill
.
getText
().
indexOf
(
subStr
,
offset
);
if
(
offset
!=
-
1
){
if
(
offset
!=
-
1
){
// console.log(quill.container.innerText
,111
)
// console.log(quill.container.innerText)
// this.insertContent(item.name, subStr, offset)
// this.insertContent(item.name, subStr, offset)
quill
.
updateContents
([
num
=
offsetArr
.
filter
((
item
)
=>
{
return
item
<
offset
}).
length
/*** 为什么加num? 我也不知道,大概是插入一个自定义节点的话,就要加1,
所以在offset为100要插入节点时,就要判断(位置100)前面插入了多少自定义节点 ***/
quill
.
updateContents
([
//相当于replace内容
{
retain
:
offset
+
num
},
{
retain
:
offset
+
num
},
{
delete
:
subStr
.
length
},
{
delete
:
subStr
.
length
},
{
insert
:
{
label
:
{
name
:
item
.
name
,
key
:
subStr
}
}
}
{
insert
:
{
label
:
{
name
:
item
.
name
,
key
:
subStr
}
}
}
]);
]);
num
++
offsetArr
.
push
(
offset
)
offset
+=
item
.
name
.
length
offset
+=
item
.
name
.
length
}
}
}
while
(
offset
!=
-
1
)
}
while
(
offset
!=
-
1
)
...
@@ -111,53 +117,59 @@ export default {
...
@@ -111,53 +117,59 @@ export default {
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.editor-ctnr
{
.editor-ctnr
{
.content-label{
width
:
100%
;
width
:
154px
;
height
:
100%
;
display
:
inline-block
;
.content-label{
vertical-align
:
top
;
width
:
154px
;
height
:
20px
;
display
:
inline-block
;
font-weight
:
400
;
vertical-align
:
top
;
font-size
:
14px
;
height
:
20px
;
color
:
#333333
;
font-weight
:
400
;
text-align
:
right
;
font-size
:
14px
;
line-height
:
20px
;
color
:
#333333
;
text-align
:
right
;
line-height
:
20px
;
}
.editor
{
display
:
inline-block
;
background-color
:
#fff
;
width
:
100%
;
height
:
100%
;
.quill{
width
:
100%
;
height
:
100%
;
background-color
:
#fff
;
border-color
:
#E5E5E5
;
/deep/
.ql-toolbar.ql-snow,
/deep/
.ql-container.ql-snow{
border-color
:
#E5E5E5
;
}
}
.editor
{
/
deep
/
.ql-label
{
display
:
inline-block
;
color
:
#26a2ff
;
background-color
:
#fff
;
}
.quill{
}
background-color
:
#fff
;
.extend-bar
{
border-color
:
#E5E5E5
;
width
:
100%
;
/deep/
.ql-toolbar.ql-snow,
/deep/
.ql-container.ql-snow{
height
:
40px
;
border-color
:
#E5E5E5
;
padding
:
0
20px
;
}
line-height
:
40px
;
/
deep
/
.ql-label
{
margin-top
:
-1px
;
color
:
#26a2ff
;
background
:
#FAFBFE
;
}
border
:
1px
solid
#E5E5E5
;
}
box-sizing
:
border-box
;
.extend-bar
{
border-radius
:
0
0
4px
4px
;
width
:
100%
;
border-top
:
none
;
height
:
40px
;
.extend-icon{
padding
:
0
20px
;
cursor
:
pointer
;
line-height
:
40px
;
margin-right
:
10px
;
margin-top
:
-1px
;
&::before{
background
:
#FAFBFE
;
//
font-size
:
16px
;
border
:
1px
solid
#E5E5E5
;
margin-right
:
4px
;
box-sizing
:
border-box
;
border-radius
:
0
0
4px
4px
;
border-top
:
none
;
.extend-icon{
cursor
:
pointer
;
margin-right
:
10px
;
&::before{
//
font-size
:
16px
;
margin-right
:
4px
;
}
font-size
:
14px
;
color
:
#3f3b3b
;
}
}
}
font-size
:
14px
;
color
:
#3f3b3b
;
}
}
}
}
}
}
</
style
>
</
style
>
\ No newline at end of file
\ No newline at end of file
src/views/serviceConfig/addService.vue
View file @
b2c21af
...
@@ -26,8 +26,8 @@
...
@@ -26,8 +26,8 @@
<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-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)"
></el-input>
<i
v-if=
"!item.newItem && !disable"
class=
"el-icon-edit-outline edit"
@
click
.
prevent=
"editCondition
(item
)"
></i>
<i
v-if=
"!item.newItem && !disable"
class=
"el-icon-edit-outline edit"
@
click
.
prevent=
"editCondition
Fn(item, 'conditionList'
)"
></i>
</el-checkbox>
</el-checkbox>
</el-checkbox-group>
</el-checkbox-group>
<div
v-if=
"!disable"
class=
"add-btn"
@
click=
"addCondition('conditionList')"
>
<div
v-if=
"!disable"
class=
"add-btn"
@
click=
"addCondition('conditionList')"
>
...
@@ -43,8 +43,8 @@
...
@@ -43,8 +43,8 @@
<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-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)"
></el-input>
<i
v-if=
"!item.newItem && !disable"
class=
"el-icon-edit-outline edit"
@
click
.
prevent=
"editCondition
(item
)"
></i>
<i
v-if=
"!item.newItem && !disable"
class=
"el-icon-edit-outline edit"
@
click
.
prevent=
"editCondition
Fn(item, 'responsibilityList'
)"
></i>
</el-checkbox>
</el-checkbox>
</el-checkbox-group>
</el-checkbox-group>
<div
v-if=
"!disable"
class=
"add-btn"
@
click=
"addCondition('responsibilityList')"
>
<div
v-if=
"!disable"
class=
"add-btn"
@
click=
"addCondition('responsibilityList')"
>
...
@@ -257,6 +257,13 @@ export default {
...
@@ -257,6 +257,13 @@ export default {
gradeList
:
[]
gradeList
:
[]
}
}
},
},
directives
:
{
focus
:
{
inserted
(
el
)
{
el
.
querySelector
(
'input'
).
focus
()
},
},
},
created
()
{
created
()
{
const
urlParam
=
this
.
$route
.
params
const
urlParam
=
this
.
$route
.
params
this
.
routeInfo
=
JSON
.
parse
(
decodeURIComponent
(
urlParam
.
id
))
this
.
routeInfo
=
JSON
.
parse
(
decodeURIComponent
(
urlParam
.
id
))
...
@@ -277,12 +284,12 @@ export default {
...
@@ -277,12 +284,12 @@ export default {
},
},
methods
:
{
methods
:
{
editCondition
(
row
){
editCondition
Fn
(
row
,
key
){
this
.
curEditCondition
=
{
this
.
curEditCondition
=
{
id
:
row
.
id
,
id
:
row
.
id
,
value
:
row
.
contractContent
value
:
row
.
contractContent
}
}
const
target
=
this
.
conditionList
.
find
(
item
=>
item
.
id
==
row
.
id
)
const
target
=
this
[
key
]
.
find
(
item
=>
item
.
id
==
row
.
id
)
this
.
$set
(
target
,
'newItem'
,
true
)
this
.
$set
(
target
,
'newItem'
,
true
)
},
},
addCondition
(
key
){
addCondition
(
key
){
...
@@ -430,6 +437,12 @@ export default {
...
@@ -430,6 +437,12 @@ export default {
this
.
getConfigList
()
this
.
getConfigList
()
}
}
})
})
},
clearData
(){
this
.
curEditCondition
=
{
id
:
''
,
value
:
''
}
}
}
}
}
}
}
...
...
src/views/serviceConfig/components/ServicesTable/index.vue
View file @
b2c21af
...
@@ -18,17 +18,22 @@
...
@@ -18,17 +18,22 @@
<td>
标准
</td>
<td>
标准
</td>
<td>
-
</td>
<td>
-
</td>
<
template
v-for=
"(item, index) in tableData.salePeriodData"
>
<
template
v-for=
"(item, index) in tableData.salePeriodData"
>
<td
:key=
"index"
><el-input
:disabled=
"disable"
v-model=
"item.standardShelfCost"
></el-input></td>
<td
:key=
"index"
><el-input
onkeyup=
"value = value ? value.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(/^\d
{6}\d+(\.\d+)?/g, value.substr(0,6)).replace(/\.{2,}/g, '').replace('.', '$#$')
<td
:key=
"index"
>
<el-input
:disabled=
"disable"
v-model=
"item.standardSalesCost"
></el-input></td>
.replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value" :disabled="disable" v-model="item.standardShelfCost">
</el-input></td>
<td
:key=
"index"
>
<el-input
onkeyup=
"value = value ? value.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(/^\d
{6}\d+(\.\d+)?/g, value.substr(0,6)).replace(/\.{2,}/g, '').replace('.', '$#$')
.replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value" :disabled="disable" v-model="item.standardSalesCost">
</el-input></td>
</
template
>
</
template
>
</tr>
</tr>
<tr
v-for=
"(item, index) in tableData.gradeConfigList"
:key=
"index"
>
<tr
v-for=
"(item, index) in tableData.gradeConfigList"
:key=
"index"
>
<td
class=
"price"
>
<td
class=
"price"
>
<el-input
:disabled=
"disable"
v-model=
"item.minPrice"
></el-input>
<el-input
onkeyup=
"value = value ? value.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(/^\d{6}\d+(\.\d+)?/g, value.substr(0,6)).replace(/\.{2,}/g, '').replace('.', '$#$')
.replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value"
:disabled=
"disable"
v-model=
"item.minPrice"
></el-input>
<span
class=
"sign"
>
-
</span>
<span
class=
"sign"
>
-
</span>
<el-input
:disabled=
"disable"
v-model=
"item.maxPrice"
></el-input>
<el-input
onkeyup=
"value = value ? value.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(/^\d{6}\d+(\.\d+)?/g, value.substr(0,6)).replace(/\.{2,}/g, '').replace('.', '$#$')
.replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value"
:disabled=
"disable"
v-model=
"item.maxPrice"
></el-input>
</td>
</td>
<td><el-input
:disabled=
"disable"
v-model=
"item.priceCoefficient"
></el-input></td>
<td><el-input
onkeyup=
"value = value ? value.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(/^\d{6}\d+(\.\d+)?/g, value.substr(0,6)).replace(/\.{2,}/g, '').replace('.', '$#$')
.replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value"
:disabled=
"disable"
v-model=
"item.priceCoefficient"
></el-input></td>
<
template
v-for=
"(ele, eIdx) in tableData.salePeriodData"
>
<
template
v-for=
"(ele, eIdx) in tableData.salePeriodData"
>
<td
:key=
"eIdx"
>
{{
Number
((
ele
.
standardShelfCost
*
item
.
priceCoefficient
).
toFixed
(
2
))
}}
</td>
<td
:key=
"eIdx"
>
{{
Number
((
ele
.
standardShelfCost
*
item
.
priceCoefficient
).
toFixed
(
2
))
}}
</td>
<td
:key=
"eIdx"
>
{{
Number
((
ele
.
standardSalesCost
*
item
.
priceCoefficient
).
toFixed
(
2
))
}}
</td>
<td
:key=
"eIdx"
>
{{
Number
((
ele
.
standardSalesCost
*
item
.
priceCoefficient
).
toFixed
(
2
))
}}
</td>
...
...
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