Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
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 3a00a5de
authored
Jul 10, 2026
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
格式化代码
1 parent
a30999f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
844 additions
and
830 deletions
src/views/systemConfig/ShopConfig/deliveryQuantity/components/editDialog.vue
src/views/systemConfig/ShopConfig/deliveryQuantity/index.vue
src/views/systemConfig/ShopConfig/deliveryQuantity/components/editDialog.vue
View file @
3a00a5d
<!-- 新增交付数&修改交付数&交付数详情 -->
<!-- 新增交付数&修改交付数&交付数详情 -->
<
template
>
<
template
>
<baseDialog
:dialog-config=
"dialogConfig"
<baseDialog
class=
"accountDailog"
:is-show
.
sync=
"dialogShow"
:config=
"config"
:config=
"config"
class=
"accountDailog"
:dialog-config=
"dialogConfig"
:is-show
.
sync=
"dialogShow"
@
handleClick=
"handleAddConfirm"
>
@
handleClick=
"handleAddConfirm"
>
<div
class=
"add-dialog"
>
<div
class=
"add-dialog"
>
<el-form
ref=
"infoForm"
<el-form
ref=
"infoForm"
class=
"infoForm d2-container-content"
class=
"infoForm d2-container-content"
label-width=
"130px"
:model=
"formData"
:model=
"formData"
:rules=
"formRules"
:rules=
"formRules"
>
label-width=
"130px"
>
<el-row>
<el-row>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"4S门店:"
<el-form-item
label=
"4S门店:"
:prop=
"operationType ==
'add'?'merchantId':
''"
>
:prop=
"operationType ==
'add' ? 'merchantId' :
''"
>
<div
v-if=
"operationType =='add'"
>
<div
v-if=
"operationType ==
'add'"
>
<el-select
v-model=
"formData.merchantId"
<el-select
v-model=
"formData.merchantId"
v-el-select-loadmore=
"interestsLoadmore"
class=
"sortInput"
placeholder=
"请选择"
placeholder=
"请选择"
filterable
remote
remote
reserve-keyword
reserve-keyword
@
visible-change=
"visibleChange"
@
change=
"choose4S"
:remote-method=
"remoteMethod"
:remote-method=
"remoteMethod"
v-el-select-loadmore=
"interestsLoadmore"
@
change=
"choose4S"
filterable
@
visible-change=
"visibleChange"
>
class=
"sortInput"
>
<el-option
v-for=
"subItem in baseData.merchantList"
<el-option
v-for=
"subItem in baseData.merchantList"
:key=
"subItem.merchantId"
:key=
"subItem.merchantId"
:label=
"`$
{subItem.merchantName}(${subItem.merchantId})`"
:label=
"`$
{subItem.merchantName}(${subItem.merchantId})`"
...
@@ -34,23 +34,23 @@
...
@@ -34,23 +34,23 @@
</el-select>
</el-select>
</div>
</div>
<div
v-else
>
<div
v-else
>
{{
formData
.
merchantName
+
'('
+
formData
.
merchantId
+
')'
}}
{{
`${formData.merchantName
}
(${formData.merchantId
}
)`
}}
<
/div
>
<
/div
>
<
/el-form-item
>
<
/el-form-item
>
<
/el-col
>
<
/el-col
>
<
el
-
col
:
span
=
"12"
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"品牌:"
<
el
-
form
-
item
label
=
"品牌:"
:prop=
"operationType ==
'add'?'brand':
''"
>
:
prop
=
"operationType ==
'add' ? 'brand' :
''"
>
<div
v-if=
"operationType =='add'"
>
<
div
v
-
if
=
"operationType ==
'add'"
>
<
el
-
cascader
ref
=
"cascader"
<
el
-
cascader
ref
=
"cascader"
:options=
"carBrands"
v
-
model
=
"formData.brand"
v
-
model
=
"formData.brand"
class
=
"sortInput"
placeholder
=
"请先选择4S门店"
placeholder
=
"请先选择4S门店"
filterable
@
change=
"chooseBrand"
clearable
clearable
:props=
"
{ label: 'name', value: 'id', children:'subList' }"
filterable
class="sortInput">
:
options
=
"carBrands"
:
props
=
"
{
label
:
'name'
,
value
:
'id'
,
children
:
'subList'
}
"
@change="
chooseBrand
"
>
<
/el-cascader
>
<
/el-cascader
>
<
/div
>
<
/div
>
<
div
v
-
else
>
<
div
v
-
else
>
...
@@ -62,15 +62,15 @@
...
@@ -62,15 +62,15 @@
<
el
-
row
>
<
el
-
row
>
<
el
-
col
:
span
=
"12"
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"交付目标月份:"
<
el
-
form
-
item
label
=
"交付目标月份:"
:prop=
"operationType ==
'add'?'targetMonth':
''"
>
:
prop
=
"operationType ==
'add' ? 'targetMonth' :
''"
>
<div
v-if=
"operationType =='add'"
>
<
div
v
-
if
=
"operationType ==
'add'"
>
<
el
-
date
-
picker
v
-
model
=
"formData.targetMonth"
<
el
-
date
-
picker
v
-
model
=
"formData.targetMonth"
type=
"month"
class
=
"sortInput"
value-format=
"yyyy-MM"
format
=
"yyyy-MM"
format
=
"yyyy-MM"
placeholder
=
"选择月"
placeholder
=
"选择月"
type
=
"month"
value
-
format
=
"yyyy-MM"
:
picker
-
options
=
"pickerOption"
:
picker
-
options
=
"pickerOption"
class=
"sortInput"
@
change
=
"handleTargetMonthChange"
>
@
change
=
"handleTargetMonthChange"
>
<
/el-date-picker
>
<
/el-date-picker
>
<
/div
>
<
/div
>
...
@@ -81,10 +81,10 @@
...
@@ -81,10 +81,10 @@
<
/el-col
>
<
/el-col
>
<
el
-
col
:
span
=
"12"
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"归属周期:"
<
el
-
form
-
item
label
=
"归属周期:"
:prop=
"operationType !=
'detail'?'periodRange':
''"
>
:
prop
=
"operationType !=
'detail' ? 'periodRange' :
''"
>
<div
v-if=
"operationType !='detail'"
>
<
div
v
-
if
=
"operationType !=
'detail'"
>
<
period-date-r
ange
v-model=
"formData.periodRange"
<
PeriodDateR
ange
v
-
model
=
"formData.periodRange"
:target-month=
"formData.targetMonth"
/>
:
target
-
month
=
"formData.targetMonth"
/>
<
/div
>
<
/div
>
<
div
v
-
else
>
<
div
v
-
else
>
{{
formData
.
periodDateStr
||
'-'
}}
{{
formData
.
periodDateStr
||
'-'
}}
...
@@ -95,12 +95,12 @@
...
@@ -95,12 +95,12 @@
<
el
-
row
>
<
el
-
row
>
<
el
-
col
:
span
=
"12"
>
<
el
-
col
:
span
=
"12"
>
<
el
-
form
-
item
label
=
"交付数:"
<
el
-
form
-
item
label
=
"交付数:"
:prop=
"operationType !=
'detail'?'targetValue':
''"
>
:
prop
=
"operationType !=
'detail' ? 'targetValue' :
''"
>
<div
v-if=
"operationType !='detail'"
>
<
div
v
-
if
=
"operationType !=
'detail'"
>
<
el
-
input
v
-
model
=
"formData.targetValue"
<
el
-
input
v
-
model
=
"formData.targetValue"
@
input=
"targetValue_handle
Input"
class
=
"sort
Input"
placeholder
=
"请输入"
placeholder
=
"请输入"
class=
"sort
Input"
/>
@
input
=
"targetValue_handle
Input"
/>
<
/div
>
<
/div
>
<
div
v
-
else
>
<
div
v
-
else
>
{{
formData
.
targetValue
}}
{{
formData
.
targetValue
}}
...
@@ -108,21 +108,23 @@
...
@@ -108,21 +108,23 @@
<
/el-form-item
>
<
/el-form-item
>
<
/el-col
>
<
/el-col
>
<
el
-
col
:
span
=
"12"
>
<
el
-
col
:
span
=
"12"
>
<el-form-item
label=
"录入时间:
"
<
el
-
form
-
item
v
-
if
=
"operationType != 'add'
"
v-if=
"operationType!='add'
"
>
label
=
"录入时间:
"
>
{{
formData
.
createdDateShow
}}
{{
formData
.
createdDateShow
}}
<
/el-form-item
>
<
/el-form-item
>
<
/el-col
>
<
/el-col
>
<
/el-row
>
<
/el-row
>
<
/el-form
>
<
/el-form
>
<div
v-if=
"operationType!='add'"
>
<
div
v
-
if
=
"operationType != 'add'"
>
<div
class=
"div-title"
>
操作记录
</div>
<
div
class
=
"div-title"
>
操作记录
<
/div
>
<
div
class
=
"d2-container-content"
>
<
div
class
=
"d2-container-content"
>
<
d2
-
table
ref
=
"recordTable"
<
d2
-
table
ref
=
"recordTable"
:has-page=
"false"
:
has
-
num
=
"false"
:
has
-
num
=
"false"
:
table-data=
"tableData
"
:
has
-
page
=
"false
"
:
search
-
form
=
"searchFormSearch"
:
search
-
form
=
"searchFormSearch"
:
table
-
data
=
"tableData"
:
table
-
params
=
"tableParams"
>
:
table
-
params
=
"tableParams"
>
<
/d2-table
>
<
/d2-table
>
<
/div
>
<
/div
>
...
@@ -132,366 +134,371 @@
...
@@ -132,366 +134,371 @@
<
/template
>
<
/template
>
<
script
>
<
script
>
import
{
Util
,
deepClone
}
from
'@/common/util'
import
{
getList
}
from
"@api/merchant"
;
import
{
limitPrice
,
rangePickerOptions_deliveryQuantity
,
getMonthDateRange
,
parsePeriodDateStr
}
from
'@/common/format'
import
{
getById_deliver
,
getCarBrand
,
insertDeliverTargeConfig
,
updateDeliverTargeConfig
}
from
"@api/shopConfig"
;
import
{
getList
}
from
"@api/merchant"
import
{
outputValue_operTypeOpt
}
from
"@/common/constants.js"
;
import
{
outputValue_operTypeOpt
}
from
"@/common/constants.js"
import
{
getMonthDateRange
,
limitPrice
,
parsePeriodDateStr
,
rangePickerOptions_deliveryQuantity
}
from
"@/common/format"
;
import
{
insertDeliverTargeConfig
,
updateDeliverTargeConfig
,
getById_deliver
,
getCarBrand
}
from
'@api/shopConfig'
import
{
deepClone
,
Util
}
from
"@/common/util"
;
import
periodDateRange
from
'./periodDateRange'
import
periodDateRange
from
"./periodDateRange"
;
// import reportTrackFunMixin from '@/mixins/reportTrackFunMixin'
// import reportTrackFunMixin from '@/mixins/reportTrackFunMixin'
export
default
{
export
default
{
name
:
'EditDialog'
,
name
:
"EditDialog"
,
components
:
{
components
:
{
periodDateRange
PeriodDateRange
:
periodDateRange
,
},
}
,
// mixins: [reportTrackFunMixin],
// mixins: [reportTrackFunMixin],
directives
:
{
directives
:
{
'el-select-loadmore'
:
{
"el-select-loadmore"
:
{
bind
(
el
,
binding
)
{
bind
(
el
,
binding
)
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
const
SELECTWRAP_DOM
=
el
.
querySelector
(
const
SELECTWRAP_DOM
=
el
.
querySelector
(
'.el-select-dropdown .el-select-dropdown__wrap'
".el-select-dropdown .el-select-dropdown__wrap"
,
)
);
SELECTWRAP_DOM
.
addEventListener
(
'scroll'
,
function
()
{
SELECTWRAP_DOM
.
addEventListener
(
"scroll"
,
function
()
{
const
condition
=
const
condition
this
.
scrollHeight
-
this
.
scrollTop
<=
this
.
clientHeight
=
this
.
scrollHeight
-
this
.
scrollTop
<=
this
.
clientHeight
;
if
(
condition
)
{
if
(
condition
)
{
binding
.
value
()
binding
.
value
();
}
}
})
}
);
},
100
)
}
,
100
);
}
}
,
}
}
,
},
}
,
data
()
{
return
{
config
:
{
appendToBody
:
true
,
isShowFooter
:
true
,
confirm_name
:
'确定'
,
cancel_name
:
'取消'
},
pickerOption
:
rangePickerOptions_deliveryQuantity
,
userInfo
:
this
.
$store
.
state
.
d2admin
.
user
.
info
,
formData
:
{
merchantId
:
''
,
merchantName
:
''
,
brand
:
[],
brandId
:
''
,
brandName
:
''
,
childId
:
''
,
childName
:
''
,
targetValue
:
''
,
targetMonth
:
''
,
periodRange
:
[],
periodDateStr
:
''
},
oldVal
:
{
targetValue
:
''
},
dialogConfig
:
{
title
:
'新增交付数'
,
// width: '700px'
width
:
'1080px'
},
formRules
:
{
merchantId
:
[{
required
:
true
,
message
:
'请选择4S门店'
,
trigger
:
'change'
}],
brand
:
[{
required
:
true
,
message
:
'请选择品牌'
,
trigger
:
'change'
}],
targetMonth
:
[{
required
:
true
,
message
:
'请选择交付目标月份'
,
trigger
:
'change'
}],
periodRange
:
[{
required
:
true
,
trigger
:
'change'
,
validator
:
(
rule
,
value
,
callback
)
=>
{
if
(
!
value
||
value
.
length
!==
2
||
!
value
[
0
]
||
!
value
[
1
])
{
callback
(
new
Error
(
'请选择归属周期'
))
return
}
const
monthRange
=
getMonthDateRange
(
this
.
formData
.
targetMonth
)
if
(
!
monthRange
)
{
callback
(
new
Error
(
'请先选择交付目标月份'
))
return
}
if
(
value
[
0
]
!==
monthRange
.
startDate
)
{
callback
(
new
Error
(
'归属周期开始日期必须为当月1号'
))
return
}
if
(
value
[
1
]
<
value
[
0
]
||
value
[
1
]
>
monthRange
.
endDate
)
{
callback
(
new
Error
(
'归属周期结束日期无效'
))
return
}
callback
()
}
}],
targetValue
:
[{
required
:
true
,
message
:
'请输入交付数'
,
trigger
:
'blur'
}]
},
searchForm
:
{
id
:
''
},
searchFormSearch
:
{},
// getListApi: findByMsgId,
tableData
:
[],
tableParams
:
{
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
listName
:
'list'
,
tableOption
:
false
,
tableColumns
:
[{
label
:
'操作项'
,
prop
:
'operType'
,
formatter
:
(
cellValue
)
=>
{
return
this
.
operTypeOpt
.
find
(
item
=>
item
.
confId
===
cellValue
.
operType
)?.
confValue
+
'交付数数据'
}
},
{
label
:
'操作时间'
,
prop
:
'createdDate'
,
formatter
:
(
cellValue
)
=>
{
return
Util
.
dateFormate
(
cellValue
.
createdDate
,
'YYYY-MM-DD HH:mm:ss'
)
}
},
{
label
:
'操作人'
,
prop
:
'createdBy'
}]
},
baseData
:
{
merchantList
:
[]
},
carBrands
:
[],
operTypeOpt
:
deepClone
(
outputValue_operTypeOpt
),
currentPage
:
1
,
pageSize
:
20
// track_event_code: 'shopConfig_merchantDeliverTargeConfig_add',
// track_businessParam_key: 'searchForm'
}
},
props
:
{
props
:
{
visible
:
{
visible
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
,
},
}
,
paramsObj
:
{
paramsObj
:
{
type
:
Object
,
type
:
Object
,
default
:
null
default
:
null
,
},
}
,
operationType
:
{
operationType
:
{
type
:
String
,
type
:
String
,
default
:
""
default
:
""
,
}
}
,
},
}
,
watch
:
{
data
()
{
},
return
{
computed
:
{
config
:
{
dialogShow
:
{
appendToBody
:
true
,
get
()
{
isShowFooter
:
true
,
// this.setCode()
confirm_name
:
"确定"
,
// this.onPageShow()
cancel_name
:
"取消"
,
return
this
.
visible
}
,
},
pickerOption
:
rangePickerOptions_deliveryQuantity
,
set
(
newVal
)
{
userInfo
:
this
.
$store
.
state
.
d2admin
.
user
.
info
,
// this.onPageHide()
formData
:
{
this
.
$emit
(
'dialogClose'
,
{
flag
:
newVal
})
merchantId
:
""
,
}
merchantName
:
""
,
}
brand
:
[],
},
brandId
:
""
,
brandName
:
""
,
childId
:
""
,
childName
:
""
,
targetValue
:
""
,
targetMonth
:
""
,
periodRange
:
[],
periodDateStr
:
""
,
}
,
oldVal
:
{
targetValue
:
""
,
}
,
dialogConfig
:
{
title
:
"新增交付数"
,
// width: '700px'
width
:
"1080px"
,
}
,
formRules
:
{
merchantId
:
[{
required
:
true
,
message
:
"请选择4S门店"
,
trigger
:
"change"
}
],
brand
:
[{
required
:
true
,
message
:
"请选择品牌"
,
trigger
:
"change"
}
],
targetMonth
:
[{
required
:
true
,
message
:
"请选择交付目标月份"
,
trigger
:
"change"
}
],
periodRange
:
[{
required
:
true
,
trigger
:
"change"
,
validator
:
(
rule
,
value
,
callback
)
=>
{
if
(
!
value
||
value
.
length
!==
2
||
!
value
[
0
]
||
!
value
[
1
])
{
callback
(
new
Error
(
"请选择归属周期"
));
return
;
}
const
monthRange
=
getMonthDateRange
(
this
.
formData
.
targetMonth
);
if
(
!
monthRange
)
{
callback
(
new
Error
(
"请先选择交付目标月份"
));
return
;
}
if
(
value
[
0
]
!==
monthRange
.
startDate
)
{
callback
(
new
Error
(
"归属周期开始日期必须为当月1号"
));
return
;
}
if
(
value
[
1
]
<
value
[
0
]
||
value
[
1
]
>
monthRange
.
endDate
)
{
callback
(
new
Error
(
"归属周期结束日期无效"
));
return
;
}
callback
();
}
,
}
],
targetValue
:
[{
required
:
true
,
message
:
"请输入交付数"
,
trigger
:
"blur"
}
],
}
,
searchForm
:
{
id
:
""
,
}
,
searchFormSearch
:
{
}
,
// getListApi: findByMsgId,
tableData
:
[],
tableParams
:
{
btnId
:
new
Date
().
getTime
()
+
Number
.
parseInt
(
Math
.
random
()
*
1000
),
listName
:
"list"
,
tableOption
:
false
,
tableColumns
:
[{
label
:
"操作项"
,
prop
:
"operType"
,
formatter
:
(
cellValue
)
=>
{
return
this
.
operTypeOpt
.
find
(
item
=>
item
.
confId
===
cellValue
.
operType
)?.
confValue
+
"交付数数据"
;
}
,
}
,
{
label
:
"操作时间"
,
prop
:
"createdDate"
,
formatter
:
(
cellValue
)
=>
{
return
Util
.
dateFormate
(
cellValue
.
createdDate
,
"YYYY-MM-DD HH:mm:ss"
);
}
,
}
,
{
label
:
"操作人"
,
prop
:
"createdBy"
,
}
],
}
,
baseData
:
{
merchantList
:
[],
}
,
carBrands
:
[],
operTypeOpt
:
deepClone
(
outputValue_operTypeOpt
),
currentPage
:
1
,
pageSize
:
20
,
// track_event_code: 'shopConfig_merchantDeliverTargeConfig_add',
// track_businessParam_key: 'searchForm'
}
;
}
,
computed
:
{
dialogShow
:
{
get
()
{
// this.setCode()
// this.onPageShow()
return
this
.
visible
;
}
,
set
(
newVal
)
{
// this.onPageHide()
this
.
$emit
(
"dialogClose"
,
{
flag
:
newVal
}
);
}
,
}
,
}
,
watch
:
{
}
,
mounted
()
{
mounted
()
{
if
(
this
.
paramsObj
)
{
if
(
this
.
paramsObj
)
{
this
.
getInfo
(
this
.
paramsObj
.
id
)
this
.
getInfo
(
this
.
paramsObj
.
id
);
if
(
this
.
operationType
==
'edit'
)
{
if
(
this
.
operationType
==
"edit"
)
{
this
.
dialogConfig
.
title
=
'修改交付数'
this
.
dialogConfig
.
title
=
"修改交付数"
;
}
else
{
}
else
{
this
.
dialogConfig
.
title
=
'查看交付数详情'
this
.
dialogConfig
.
title
=
"查看交付数详情"
;
this
.
config
.
isShowFooter
=
false
this
.
config
.
isShowFooter
=
false
;
}
}
}
else
{
}
else
{
this
.
dialogConfig
.
title
=
'新增交付数'
this
.
dialogConfig
.
title
=
"新增交付数"
;
this
.
getSelectingList
()
this
.
getSelectingList
();
}
}
},
}
,
methods
:
{
methods
:
{
// setCode() {
// setCode()
{
// if (this.paramsObj) {
// if (this.paramsObj)
{
// if (this.operationType == 'edit') {
// if (this.operationType == 'edit')
{
// this.track_event_code = 'shopConfig_merchantDeliverTargeConfig_edit'
// this.track_event_code = 'shopConfig_merchantDeliverTargeConfig_edit'
// } else {
//
}
else
{
// this.track_event_code = 'shopConfig_merchantDeliverTargeConfig_detail'
// this.track_event_code = 'shopConfig_merchantDeliverTargeConfig_detail'
// }
//
}
// } else {
//
}
else
{
// this.track_event_code = 'shopConfig_merchantDeliverTargeConfig_add'
// this.track_event_code = 'shopConfig_merchantDeliverTargeConfig_add'
// }
//
}
// },
//
}
,
// 获取4S门店数据
// 获取4S门店数据
remoteMethod
(
query
)
{
remoteMethod
(
query
)
{
this
.
merchantName
=
query
this
.
merchantName
=
query
;
this
.
currentPage
=
1
this
.
currentPage
=
1
;
this
.
baseData
.
merchantList
=
[]
this
.
baseData
.
merchantList
=
[];
this
.
getSelectingList
()
// 请求接口
this
.
getSelectingList
();
// 请求接口
},
}
,
getSelectingList
(
defaultSelect
)
{
getSelectingList
(
defaultSelect
)
{
getList
({
getList
({
merchantName
:
this
.
merchantName
,
merchantName
:
this
.
merchantName
,
currentPage
:
this
.
currentPage
,
currentPage
:
this
.
currentPage
,
pageSize
:
this
.
pageSize
pageSize
:
this
.
pageSize
,
}).
then
(
res
=>
{
}
).
then
((
res
)
=>
{
this
.
allPages
=
res
.
pages
this
.
allPages
=
res
.
pages
;
const
resArr
=
[...
res
.
list
]
const
resArr
=
[...
res
.
list
];
let
arr
=
this
.
baseData
.
merchantList
.
concat
(
resArr
)
let
arr
=
this
.
baseData
.
merchantList
.
concat
(
resArr
);
if
(
defaultSelect
?.
length
)
arr
=
arr
.
concat
(
defaultSelect
)
if
(
defaultSelect
?.
length
)
{
this
.
baseData
.
merchantList
=
arr
arr
=
arr
.
concat
(
defaultSelect
);
}).
catch
(()
=>
{
}
})
this
.
baseData
.
merchantList
=
arr
;
},
}
).
catch
(()
=>
{
visibleChange
(
data
)
{
}
);
// 获取焦点重新渲染下拉框数据
}
,
if
(
data
)
{
visibleChange
(
data
)
{
if
(
this
.
merchantName
)
{
// 获取焦点重新渲染下拉框数据
this
.
merchantName
=
''
if
(
data
)
{
this
.
currentPage
=
1
if
(
this
.
merchantName
)
{
this
.
baseData
.
merchantList
=
[]
this
.
merchantName
=
""
;
this
.
getSelectingList
()
this
.
currentPage
=
1
;
}
this
.
baseData
.
merchantList
=
[];
}
this
.
getSelectingList
();
},
}
// 获取更多4S店
}
interestsLoadmore
()
{
}
,
setTimeout
(()
=>
{
// 获取更多4S店
this
.
currentPage
=
this
.
currentPage
+
1
interestsLoadmore
()
{
if
(
this
.
allPages
<
this
.
currentPage
)
{
setTimeout
(()
=>
{
this
.
currentPage
=
this
.
allPages
this
.
currentPage
=
this
.
currentPage
+
1
;
return
if
(
this
.
allPages
<
this
.
currentPage
)
{
}
this
.
currentPage
=
this
.
allPages
;
this
.
getSelectingList
()
return
;
},
10
)
}
},
this
.
getSelectingList
();
}
,
10
);
}
,
getInfo
(
id
)
{
getInfo
(
id
)
{
getById_deliver
({
getById_deliver
({
id
:
id
id
,
}).
then
(
res
=>
{
}
).
then
((
res
)
=>
{
this
.
formData
=
deepClone
(
res
)
this
.
formData
=
deepClone
(
res
);
this
.
tableData
=
deepClone
(
res
.
logList
)
this
.
tableData
=
deepClone
(
res
.
logList
);
// this.formData.brand = [this.formData.brandId, this.formData.childId]
// this.formData.brand = [this.formData.brandId, this.formData.childId]
// const obj = { merchantId: this.formData.merchantId, merchantName: this.formData.merchantName }
// const obj =
{
merchantId
:
this
.
formData
.
merchantId
,
merchantName
:
this
.
formData
.
merchantName
}
// this.getSelectingList(obj)
// this.getSelectingList(obj)
// this.getCarBrand(this.formData.merchantId)
// this.getCarBrand(this.formData.merchantId)
this
.
formData
.
createdDateShow
=
this
.
formData
.
createdDate
this
.
formData
.
createdDateShow
=
this
.
formData
.
createdDate
?
Util
.
dateFormate
(
this
.
formData
.
createdDate
,
'YYYY-MM-DD HH:mm:ss'
)
?
Util
.
dateFormate
(
this
.
formData
.
createdDate
,
"YYYY-MM-DD HH:mm:ss"
)
:
""
:
""
;
this
.
fillPeriodRange
()
this
.
fillPeriodRange
();
}).
catch
(()
=>
{
}
).
catch
(()
=>
{
})
}
);
},
}
,
fillPeriodRange
()
{
fillPeriodRange
()
{
if
(
this
.
operationType
===
'detail'
)
return
if
(
this
.
operationType
===
"detail"
)
{
let
start
=
''
return
;
let
end
=
''
}
if
(
this
.
formData
.
periodStartDate
&&
this
.
formData
.
periodEndDate
)
{
let
start
=
""
;
start
=
Util
.
dateFormate
(
this
.
formData
.
periodStartDate
,
'YYYY-MM-DD'
)
let
end
=
""
;
end
=
Util
.
dateFormate
(
this
.
formData
.
periodEndDate
,
'YYYY-MM-DD'
)
if
(
this
.
formData
.
periodStartDate
&&
this
.
formData
.
periodEndDate
)
{
}
else
if
(
this
.
formData
.
periodDateStr
)
{
start
=
Util
.
dateFormate
(
this
.
formData
.
periodStartDate
,
"YYYY-MM-DD"
);
const
parsed
=
parsePeriodDateStr
(
this
.
formData
.
periodDateStr
)
end
=
Util
.
dateFormate
(
this
.
formData
.
periodEndDate
,
"YYYY-MM-DD"
);
if
(
parsed
)
{
}
else
if
(
this
.
formData
.
periodDateStr
)
{
start
=
parsed
[
0
]
const
parsed
=
parsePeriodDateStr
(
this
.
formData
.
periodDateStr
);
end
=
parsed
[
1
]
if
(
parsed
)
{
}
start
=
parsed
[
0
];
}
end
=
parsed
[
1
];
if
(
start
&&
end
)
{
}
this
.
$set
(
this
.
formData
,
'periodRange'
,
[
start
,
end
])
}
}
if
(
start
&&
end
)
{
},
this
.
$set
(
this
.
formData
,
"periodRange"
,
[
start
,
end
]);
}
}
,
handleTargetMonthChange
()
{
handleTargetMonthChange
()
{
this
.
formData
.
periodRange
=
[]
this
.
formData
.
periodRange
=
[];
},
}
,
choose4S
(
merchantId
)
{
choose4S
(
merchantId
)
{
this
.
formData
.
brand
=
[]
this
.
formData
.
brand
=
[];
this
.
formData
.
brandId
=
''
this
.
formData
.
brandId
=
""
;
this
.
formData
.
brandName
=
''
this
.
formData
.
brandName
=
""
;
this
.
formData
.
childId
=
''
this
.
formData
.
childId
=
""
;
this
.
formData
.
childName
=
''
this
.
formData
.
childName
=
""
;
if
(
merchantId
)
{
if
(
merchantId
)
{
this
.
getCarBrand
(
merchantId
)
this
.
getCarBrand
(
merchantId
);
}
}
},
}
,
getCarBrand
(
merchantId
)
{
getCarBrand
(
merchantId
)
{
getCarBrand
({
getCarBrand
({
merchantId
:
merchantId
merchantId
,
}).
then
(
res
=>
{
}
).
then
((
res
)
=>
{
this
.
carBrands
=
deepClone
(
res
)
this
.
carBrands
=
deepClone
(
res
);
}).
catch
(()
=>
{
}
).
catch
(()
=>
{
})
}
);
},
}
,
chooseBrand
(
value
)
{
chooseBrand
(
value
)
{
const
checkedNode
=
this
.
$refs
.
cascader
.
getCheckedNodes
()[
0
]
const
checkedNode
=
this
.
$refs
.
cascader
.
getCheckedNodes
()[
0
];
const
brandNode
=
checkedNode
.
pathNodes
[
0
]
const
brandNode
=
checkedNode
.
pathNodes
[
0
];
const
childNode
=
checkedNode
.
pathNodes
[
1
]
const
childNode
=
checkedNode
.
pathNodes
[
1
];
this
.
formData
.
brandId
=
brandNode
.
value
this
.
formData
.
brandId
=
brandNode
.
value
;
this
.
formData
.
brandName
=
brandNode
.
label
this
.
formData
.
brandName
=
brandNode
.
label
;
this
.
formData
.
childId
=
childNode
.
value
this
.
formData
.
childId
=
childNode
.
value
;
this
.
formData
.
childName
=
childNode
.
label
this
.
formData
.
childName
=
childNode
.
label
;
},
}
,
targetValue_handleInput
(
newVal
)
{
targetValue_handleInput
(
newVal
)
{
this
.
formData
.
targetValue
=
limitPrice
(
this
.
formData
.
targetValue
=
limitPrice
(
newVal
,
newVal
,
this
.
oldVal
.
targetValue
,
this
.
oldVal
.
targetValue
,
11
,
11
,
0
,
0
,
0
,
0
,
99999999999
99999999999
,
)
);
this
.
oldVal
.
targetValue
=
this
.
formData
.
targetValue
this
.
oldVal
.
targetValue
=
this
.
formData
.
targetValue
;
},
}
,
handleAddConfirm
()
{
handleAddConfirm
()
{
if
(
this
.
operationType
==
'detail'
)
{
if
(
this
.
operationType
==
"detail"
)
{
this
.
dialogShow
=
false
this
.
dialogShow
=
false
;
return
return
;
}
}
this
.
$refs
.
infoForm
.
validate
(
valid
=>
{
this
.
$refs
.
infoForm
.
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
var
params
=
deepClone
(
this
.
formData
)
let
params
=
deepClone
(
this
.
formData
);
params
.
periodStartDate
=
params
.
periodRange
[
0
]
params
.
periodStartDate
=
params
.
periodRange
[
0
];
params
.
periodEndDate
=
params
.
periodRange
[
1
]
params
.
periodEndDate
=
params
.
periodRange
[
1
];
delete
params
.
periodRange
delete
params
.
periodRange
;
if
(
params
.
id
)
{
if
(
params
.
id
)
{
updateDeliverTargeConfig
(
params
).
then
(
res
=>
{
updateDeliverTargeConfig
(
params
).
then
((
res
)
=>
{
this
.
notice
.
okTips
(
'操作成功'
)
this
.
notice
.
okTips
(
"操作成功"
);
this
.
dialogShow
=
true
this
.
dialogShow
=
true
;
})
}
);
}
else
{
}
else
{
params
.
merchantName
=
this
.
baseData
.
merchantList
.
find
(
item
=>
item
.
merchantId
==
params
.
merchantId
).
merchantName
params
.
merchantName
=
this
.
baseData
.
merchantList
.
find
(
item
=>
item
.
merchantId
==
params
.
merchantId
).
merchantName
;
insertDeliverTargeConfig
(
params
).
then
(
res
=>
{
insertDeliverTargeConfig
(
params
).
then
((
res
)
=>
{
this
.
notice
.
okTips
(
'操作成功'
)
this
.
notice
.
okTips
(
"操作成功"
);
this
.
dialogShow
=
true
this
.
dialogShow
=
true
;
})
}
);
}
}
}
}
})
}
);
}
}
,
}
}
,
}
}
;
<
/script
>
<
/script
>
<
style
lang
=
"scss"
scoped
>
<
style
lang
=
"scss"
scoped
>
.
add
-
dialog
{
.
add
-
dialog
{
margin
:
20px
0
;
margin
:
20
px
0
;
.div-title
{
.
div
-
title
{
width
:
1040px
;
width
:
1040
px
;
height
:
30px
;
height
:
30
px
;
border-bottom
:
1px
solid
#e5e5e5
;
border
-
bottom
:
1
px
solid
#
e5e5e5
;
font-size
:
16px
;
font
-
size
:
16
px
;
font-weight
:
600
;
font
-
weight
:
600
;
color
:
#333333
;
color
:
#
333333
;
margin
:
10px
0
20px
0
;
margin
:
10
px
0
20
px
0
;
}
}
.sortInput
{
.
sortInput
{
width
:
90%
;
width
:
90
%
;
}
}
}
}
<
/style
>
<
/style
>
src/views/systemConfig/ShopConfig/deliveryQuantity/index.vue
View file @
3a00a5d
<!-- 主机厂交付数 -->
<!-- 主机厂交付数 -->
<
template
>
<
template
>
<d2-container
class=
"m-t-40"
>
<d2-container
class=
"m-t-40"
>
<div
class
=
"header"
<div
slot
=
"header"
slot
=
"header"
class
=
"header"
style=
"padding-bottom: 20px;"
>
style=
"padding-bottom: 20px;"
>
<d2-search
ref=
"showSearch"
<d2-search
ref=
"showSearch"
class=
"show-search"
class=
"show-search"
:search-form=
"searchForm
"
label-width=
"120px
"
:form-data=
"showFormData"
:form-data=
"showFormData"
label-width=
"120px
"
>
:search-form=
"searchForm
"
>
<div
slot=
"4sHtml"
>
<div
slot=
"4sHtml"
>
<el-select
v-model=
"searchForm.merchantIdList"
<el-select
v-model=
"searchForm.merchantIdList"
multiple
v-el-select-loadmore=
"interestsLoadmore"
placeholder=
"请选择4S店"
style=
"width: 100%;"
collapse-tags
collapse-tags
filterable
multiple
remote
remote
reserve-keyword
reserve-keyword
placeholder=
"请选择4S店"
@
visible-change=
"visibleChange"
:remote-method=
"remoteMethod"
:remote-method=
"remoteMethod"
v-el-select-loadmore=
"interestsLoadmore"
@
visible-change=
"visibleChange"
>
style=
"width: 100%;"
filterable
>
<el-option
v-for=
"subItem in baseData.merchantList"
<el-option
v-for=
"subItem in baseData.merchantList"
:key=
"subItem.merchantId"
:key=
"subItem.merchantId"
:label=
"`$
{subItem.merchantName}(${subItem.merchantId})`"
:label=
"`$
{subItem.merchantName}(${subItem.merchantId})`"
...
@@ -30,17 +30,18 @@
...
@@ -30,17 +30,18 @@
</div>
</div>
<div
slot=
"targetMonthHtml"
>
<div
slot=
"targetMonthHtml"
>
<el-date-picker
v-model=
"searchForm.targetMonth"
<el-date-picker
v-model=
"searchForm.targetMonth"
type=
"month"
value-format=
"yyyy-MM"
format=
"yyyy-MM"
format=
"yyyy-MM"
placeholder=
"选择月"
placeholder=
"选择月"
style=
"width: 100%;"
>
style=
"width: 100%;"
type=
"month"
value-format=
"yyyy-MM"
>
</el-date-picker>
</el-date-picker>
</div>
</div>
<div
slot=
"targetValueHtml"
>
<div
slot=
"targetValueHtml"
>
<input-range
start-placeholder=
"最小交付数"
<InputRange
end-placeholder=
"最大交付数"
end-placeholder=
"最大交付数"
start-placeholder=
"最小交付数"
:display-value=
"searchForm.targetValue"
></input-range>
:display-value=
"searchForm.targetValue"
>
</InputRange>
</div>
</div>
</d2-search>
</d2-search>
<div
class=
"up-btns"
>
<div
class=
"up-btns"
>
...
@@ -50,7 +51,9 @@
...
@@ -50,7 +51,9 @@
查询
查询
</el-button>
</el-button>
<el-button
size=
"small"
<el-button
size=
"small"
@
click=
"handleReset"
>
重置
</el-button>
@
click=
"handleReset"
>
重置
</el-button>
</div>
</div>
</div>
</div>
<!--
</div>
-->
<!--
</div>
-->
...
@@ -58,13 +61,14 @@
...
@@ -58,13 +61,14 @@
<d2-table-header>
<d2-table-header>
<span>
<span>
<auth-button
category=
"Button"
<auth-button
category=
"Button"
:show-btn-ids=
"['9061921','9061922','9061923']"
/></span>
:show-btn-ids=
"['9061921', '9061922', '9061923']"
/>
</span>
</d2-table-header>
</d2-table-header>
<d2-table
ref=
"recordTable"
<d2-table
ref=
"recordTable"
:search-form=
"searchFormSearch"
:before-search-fn=
"beforeSearchFn"
:table-params=
"tableParams"
:get-list-api=
"getListApi"
:get-list-api=
"getListApi"
:before-search-fn=
"beforeSearchFn"
>
:search-form=
"searchFormSearch"
:table-params=
"tableParams"
>
<div
slot=
"auth-button"
<div
slot=
"auth-button"
slot-scope=
"scope"
>
slot-scope=
"scope"
>
<!-- 详情 -->
<!-- 详情 -->
...
@@ -73,22 +77,22 @@
...
@@ -73,22 +77,22 @@
:show-btn-ids=
"['9061924']"
/>
:show-btn-ids=
"['9061924']"
/>
</span>
</span>
<!-- 修改 -->
<!-- 修改 -->
<span
style=
"margin-right: 10px
"
<span
v-if=
"scope.scope.allowUpdate == true
"
v-if=
"scope.scope.allowUpdate == true
"
>
style=
"margin-right: 10px
"
>
<auth-button
:data=
"scope.scope"
<auth-button
:data=
"scope.scope"
:show-btn-ids=
"['9061925']"
/>
:show-btn-ids=
"['9061925']"
/>
</span>
</span>
<!-- 删除 -->
<!-- 删除 -->
<span
style=
"margin-right: 10px
"
<span
v-if=
"scope.scope.allowUpdate == true
"
v-if=
"scope.scope.allowUpdate == true
"
>
style=
"margin-right: 10px
"
>
<auth-button
:data=
"scope.scope"
<auth-button
:data=
"scope.scope"
:show-btn-ids=
"['9061926']"
/>
:show-btn-ids=
"['9061926']"
/>
</span>
</span>
</div>
</div>
</d2-table>
</d2-table>
</div>
</div>
<d2-file-import-dialog
:is-visible=
"fileVisible
"
<d2-file-import-dialog
title=
"交付数导入
"
title=
"交付数导入
"
:is-visible=
"fileVisible
"
@
closeDialog=
"handleImport"
@
closeDialog=
"handleImport"
@
confirmDialog=
"handleConfirmImport"
@
confirmDialog=
"handleConfirmImport"
@
downloadTemplate=
"exportTemplate"
>
@
downloadTemplate=
"exportTemplate"
>
...
@@ -96,462 +100,465 @@
...
@@ -96,462 +100,465 @@
<el-form-item
label=
"交付目标月份:"
<el-form-item
label=
"交付目标月份:"
required
>
required
>
<el-date-picker
v-model=
"importForm.targetMonth"
<el-date-picker
v-model=
"importForm.targetMonth"
type=
"month"
value-format=
"yyyy-MM"
format=
"yyyy-MM"
format=
"yyyy-MM"
placeholder=
"选择月"
placeholder=
"选择月"
:picker-options=
"importMonthPickerOption"
style=
"width: 100%;"
style=
"width: 100%;"
type=
"month"
value-format=
"yyyy-MM"
:picker-options=
"importMonthPickerOption"
@
change=
"handleImportTargetMonthChange"
/>
@
change=
"handleImportTargetMonthChange"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"归属周期:"
<el-form-item
label=
"归属周期:"
required
>
required
>
<
period-date-r
ange
v-model=
"importForm.periodRange"
<
PeriodDateR
ange
v-model=
"importForm.periodRange"
:target-month=
"importForm.targetMonth"
/>
:target-month=
"importForm.targetMonth"
/>
</el-form-item>
</el-form-item>
</
template
>
</
template
>
</d2-file-import-dialog>
</d2-file-import-dialog>
<!-- 新增&修改&详情 -->
<!-- 新增&修改&详情 -->
<
edit-dialog
:visible
.
sync
=
"editVisible"
<
EditDialog
v-if
=
"editVisible"
v-if=
"editVisibl
e"
:operation-type=
"operationTyp
e"
:params-obj=
"recordInfo"
:params-obj=
"recordInfo"
:operation-type=
"operationTyp
e"
:visible
.
sync=
"editVisibl
e"
@
dialogClose=
"closeEditDialog"
/>
@
dialogClose=
"closeEditDialog"
/>
</d2-container>
</d2-container>
</template>
</template>
<
script
>
<
script
>
import
{
mapActions
,
mapState
}
from
"vuex"
import
{
getList
}
from
"@api/merchant"
;
import
{
Util
,
deepClone
}
from
"@/common/util"
import
{
deleteById_deliver
,
deliverTargeConfigImport
,
distinctAllBrand
,
listWithPage_deliver
}
from
"@api/shopConfig"
;
import
inputRange
from
'./components/inputRange'
import
{
mapActions
,
mapState
}
from
"vuex"
;
import
editDialog
from
"./components/editDialog"
import
{
rangePickerOptions_deliveryQuantity_import
}
from
"@/common/format"
;
import
periodDateRange
from
'./components/periodDateRange'
import
{
deepClone
,
Util
}
from
"@/common/util"
;
import
{
listWithPage_deliver
,
deliverTargeConfigImport
,
deleteById_deliver
,
distinctAllBrand
}
from
'@api/shopConfig'
import
reportTrackFunMixin
from
"@/mixins/reportTrackFunMixin"
;
import
{
getList
}
from
"@api/merchant"
import
editDialog
from
"./components/editDialog"
;
import
reportTrackFunMixin
from
'@/mixins/reportTrackFunMixin'
import
inputRange
from
"./components/inputRange"
;
import
{
rangePickerOptions_deliveryQuantity_import
}
from
'@/common/format'
import
periodDateRange
from
"./components/periodDateRange"
;
export
default
{
export
default
{
name
:
"DeliveryQuantity"
,
name
:
"DeliveryQuantity"
,
// 导入混入
mixins
:
[
reportTrackFunMixin
],
// 导入混入
directives
:
{
directives
:
{
"el-select-loadmore"
:
{
'el-select-loadmore'
:
{
bind
(
el
,
binding
)
{
bind
(
el
,
binding
)
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
const
SELECTWRAP_DOM
=
el
.
querySelector
(
const
SELECTWRAP_DOM
=
el
.
querySelector
(
".el-select-dropdown .el-select-dropdown__wrap"
,
'.el-select-dropdown .el-select-dropdown__wrap'
);
)
SELECTWRAP_DOM
.
addEventListener
(
"scroll"
,
function
()
{
SELECTWRAP_DOM
.
addEventListener
(
'scroll'
,
function
()
{
const
condition
const
condition
=
=
this
.
scrollHeight
-
this
.
scrollTop
<=
this
.
clientHeight
;
this
.
scrollHeight
-
this
.
scrollTop
<=
this
.
clientHeight
if
(
condition
)
{
if
(
condition
)
{
binding
.
value
();
binding
.
value
()
}
}
});
})
},
100
);
},
100
)
},
}
},
}
},
},
data
()
{
return
{
searchForm
:
{
merchantIdList
:
[],
brandChildIdList
:
[],
targetMonth
:
""
,
targetValue
:
[],
createTime
:
""
},
searchFormSearch
:
{},
showFormData
:
[
{
label
:
"4S门店"
,
name
:
"merchantIdList"
,
addHtml
:
"4sHtml"
},
{
label
:
"品牌"
,
name
:
"brandId"
,
type
:
"select"
,
isClear
:
true
,
optionList
:
[],
optionId
:
"childId"
,
optionLabel
:
"childName"
,
optionsName
:
"brandList"
},
{
label
:
'交付目标月份'
,
name
:
'targetMonth'
,
addHtml
:
"targetMonthHtml"
},
{
label
:
'交付数'
,
name
:
'targetValue'
,
addHtml
:
"targetValueHtml"
},
{
label
:
'导入时间'
,
name
:
'createTime'
,
type
:
'datePicker'
,
isClear
:
true
,
pickerOptions
:
'rangePickerOptions'
}
],
getListApi
:
listWithPage_deliver
,
// 表格参数
tableParams
:
{
btnId
:
new
Date
().
getTime
()
+
parseInt
(
Math
.
random
()
*
1000
),
listName
:
"list"
,
tableOption
:
{
width
:
"150px"
},
tableColumns
:
[
{
label
:
"4S门店"
,
prop
:
"merchantId"
,
formatter
:
(
cellValue
)
=>
{
return
cellValue
.
merchantName
+
"("
+
cellValue
.
merchantId
+
")"
}
},
{
label
:
"品牌"
,
prop
:
"childName"
,
width
:
"300"
},
{
label
:
"交付目标月份"
,
prop
:
"targetMonth"
,
width
:
"150"
},
{
label
:
"归属周期"
,
prop
:
"periodDateStr"
,
width
:
"200"
,
formatter
:
(
cellValue
)
=>
{
return
cellValue
.
periodDateStr
||
"-"
}
},
{
label
:
"交付数"
,
prop
:
"targetValue"
,
width
:
"200"
,
formatter
:
(
cellValue
)
=>
{
return
(
cellValue
.
targetValue
||
cellValue
.
targetValue
==
0
)
?
cellValue
.
targetValue
:
"-"
}
},
{
label
:
"导入时间"
,
prop
:
"createdDate"
,
width
:
"180"
,
formatter
:
(
cellValue
)
=>
{
return
Util
.
dateFormate
(
cellValue
.
createdDate
,
"YYYY-MM-DD HH:mm:ss"
)
}
}
]
},
baseData
:
{
merchantList
:
[],
brandList
:
[]
},
recordInfo
:
null
,
operationType
:
"add"
,
currentPage
:
1
,
pageSize
:
20
,
fileVisible
:
false
,
editVisible
:
false
,
importMonthPickerOption
:
rangePickerOptions_deliveryQuantity_import
,
importForm
:
{
targetMonth
:
''
,
periodRange
:
[]
},
track_event_code
:
'shopConfig_deliver_list'
,
track_businessParam_key
:
'searchForm'
}
},
components
:
{
components
:
{
inputRange
,
InputRange
:
inputRange
,
editDialog
,
EditDialog
:
editDialog
,
periodDateRange
PeriodDateRange
:
periodDateRange
,
},
},
computed
:
{
mixins
:
[
reportTrackFunMixin
],
...
mapState
({
data
()
{
dowloadList
:
(
state
)
=>
state
.
d2admin
.
user
.
dowloadList
,
return
{
updateList
:
(
state
)
=>
state
.
d2admin
.
user
.
updateList
searchForm
:
{
})
merchantIdList
:
[],
},
brandChildIdList
:
[],
mounted
()
{
targetMonth
:
""
,
this
.
onPageShow
()
targetValue
:
[],
this
.
getBaseData
()
createTime
:
""
,
},
},
searchFormSearch
:
{},
showFormData
:
[
{
label
:
"4S门店"
,
name
:
"merchantIdList"
,
addHtml
:
"4sHtml"
,
},
{
label
:
"品牌"
,
name
:
"brandId"
,
type
:
"select"
,
isClear
:
true
,
optionList
:
[],
optionId
:
"childId"
,
optionLabel
:
"childName"
,
optionsName
:
"brandList"
,
},
{
label
:
"交付目标月份"
,
name
:
"targetMonth"
,
addHtml
:
"targetMonthHtml"
,
},
{
label
:
"交付数"
,
name
:
"targetValue"
,
addHtml
:
"targetValueHtml"
,
},
{
label
:
"导入时间"
,
name
:
"createTime"
,
type
:
"datePicker"
,
isClear
:
true
,
pickerOptions
:
"rangePickerOptions"
,
},
],
getListApi
:
listWithPage_deliver
,
// 表格参数
tableParams
:
{
btnId
:
new
Date
().
getTime
()
+
Number
.
parseInt
(
Math
.
random
()
*
1000
),
listName
:
"list"
,
tableOption
:
{
width
:
"150px"
},
tableColumns
:
[
{
label
:
"4S门店"
,
prop
:
"merchantId"
,
formatter
:
(
cellValue
)
=>
{
return
cellValue
.
merchantName
+
"("
+
cellValue
.
merchantId
+
")"
;
},
},
{
label
:
"品牌"
,
prop
:
"childName"
,
width
:
"300"
,
},
{
label
:
"交付目标月份"
,
prop
:
"targetMonth"
,
width
:
"150"
,
},
{
label
:
"归属周期"
,
prop
:
"periodDateStr"
,
width
:
"200"
,
formatter
:
(
cellValue
)
=>
{
return
cellValue
.
periodDateStr
||
"-"
;
},
},
{
label
:
"交付数"
,
prop
:
"targetValue"
,
width
:
"200"
,
formatter
:
(
cellValue
)
=>
{
return
(
cellValue
.
targetValue
||
cellValue
.
targetValue
==
0
)
?
cellValue
.
targetValue
:
"-"
;
},
},
{
label
:
"导入时间"
,
prop
:
"createdDate"
,
width
:
"180"
,
formatter
:
(
cellValue
)
=>
{
return
Util
.
dateFormate
(
cellValue
.
createdDate
,
"YYYY-MM-DD HH:mm:ss"
);
},
},
],
},
baseData
:
{
merchantList
:
[],
brandList
:
[],
},
recordInfo
:
null
,
operationType
:
"add"
,
currentPage
:
1
,
pageSize
:
20
,
fileVisible
:
false
,
editVisible
:
false
,
importMonthPickerOption
:
rangePickerOptions_deliveryQuantity_import
,
importForm
:
{
targetMonth
:
""
,
periodRange
:
[],
},
track_event_code
:
"shopConfig_deliver_list"
,
track_businessParam_key
:
"searchForm"
,
};
},
computed
:
{
...
mapState
({
dowloadList
:
state
=>
state
.
d2admin
.
user
.
dowloadList
,
updateList
:
state
=>
state
.
d2admin
.
user
.
updateList
,
}),
},
mounted
()
{
this
.
onPageShow
();
this
.
getBaseData
();
},
methods
:
{
methods
:
{
...
mapActions
({
...
mapActions
({
get
:
"d2admin/base/get"
,
get
:
"d2admin/base/get"
,
close
:
"d2admin/page/close"
close
:
"d2admin/page/close"
,
}),
}),
...
mapActions
(
"d2admin/user"
,
[
"actionSetDownloadList"
]),
...
mapActions
(
"d2admin/user"
,
[
"actionSetDownloadList"
]),
async
getBaseData
()
{
async
getBaseData
()
{
this
.
getOptionsList
()
this
.
getOptionsList
();
this
.
getSelectingList
()
this
.
getSelectingList
();
this
.
getBrands
()
this
.
getBrands
();
},
},
beforeSearchFn
()
{
beforeSearchFn
()
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
this
.
searchFormSearch
=
deepClone
(
this
.
searchForm
)
this
.
searchFormSearch
=
deepClone
(
this
.
searchForm
);
if
(
this
.
searchFormSearch
.
createTime
)
{
if
(
this
.
searchFormSearch
.
createTime
)
{
this
.
searchFormSearch
.
startCreatedDate
=
Util
.
dateFormate
(
this
.
searchFormSearch
.
createTime
[
0
],
'YYYY-MM-DD HH:mm:ss'
)
this
.
searchFormSearch
.
startCreatedDate
=
Util
.
dateFormate
(
this
.
searchFormSearch
.
createTime
[
0
],
"YYYY-MM-DD HH:mm:ss"
);
this
.
searchFormSearch
.
endCreatedDate
=
Util
.
dateFormate
(
this
.
searchFormSearch
.
createTime
[
1
],
'YYYY-MM-DD'
)
+
' 23:59:59'
this
.
searchFormSearch
.
endCreatedDate
=
Util
.
dateFormate
(
this
.
searchFormSearch
.
createTime
[
1
],
"YYYY-MM-DD"
)
+
" 23:59:59"
;
}
else
{
}
else
{
delete
this
.
searchFormSearch
.
startCreatedDate
delete
this
.
searchFormSearch
.
startCreatedDate
;
delete
this
.
searchFormSearch
.
endCreatedDate
delete
this
.
searchFormSearch
.
endCreatedDate
;
}
}
if
(
this
.
searchFormSearch
.
targetValue
&&
this
.
searchFormSearch
.
targetValue
.
length
>
0
)
{
if
(
this
.
searchFormSearch
.
targetValue
&&
this
.
searchFormSearch
.
targetValue
.
length
>
0
)
{
this
.
searchFormSearch
.
minTargetValue
=
this
.
searchFormSearch
.
targetValue
[
0
]
this
.
searchFormSearch
.
minTargetValue
=
this
.
searchFormSearch
.
targetValue
[
0
];
this
.
searchFormSearch
.
maxTargetValue
=
this
.
searchFormSearch
.
targetValue
[
1
]
this
.
searchFormSearch
.
maxTargetValue
=
this
.
searchFormSearch
.
targetValue
[
1
];
}
else
{
}
else
{
delete
this
.
searchFormSearch
.
minTargetValue
delete
this
.
searchFormSearch
.
minTargetValue
;
delete
this
.
searchFormSearch
.
maxTargetValue
delete
this
.
searchFormSearch
.
maxTargetValue
;
}
}
if
(
this
.
searchFormSearch
.
brandId
)
{
if
(
this
.
searchFormSearch
.
brandId
)
{
this
.
searchFormSearch
.
brandChildIdList
.
push
(
this
.
searchFormSearch
.
brandId
)
this
.
searchFormSearch
.
brandChildIdList
.
push
(
this
.
searchFormSearch
.
brandId
);
delete
this
.
searchFormSearch
.
brandId
delete
this
.
searchFormSearch
.
brandId
;
}
else
{
}
else
{
this
.
searchFormSearch
.
brandChildIdList
=
[]
this
.
searchFormSearch
.
brandChildIdList
=
[];
}
}
resolve
()
resolve
();
})
});
},
},
// 获取商品数据
// 获取商品数据
remoteMethod
(
query
)
{
remoteMethod
(
query
)
{
this
.
merchantName
=
query
this
.
merchantName
=
query
;
this
.
currentPage
=
1
this
.
currentPage
=
1
;
this
.
baseData
.
merchantList
=
[]
this
.
baseData
.
merchantList
=
[];
this
.
getSelectingList
()
// 请求接口
this
.
getSelectingList
();
// 请求接口
},
},
getSelectingList
(
defaultSelect
)
{
getSelectingList
(
defaultSelect
)
{
getList
({
getList
({
merchantName
:
this
.
merchantName
,
merchantName
:
this
.
merchantName
,
currentPage
:
this
.
currentPage
,
currentPage
:
this
.
currentPage
,
pageSize
:
this
.
pageSize
pageSize
:
this
.
pageSize
,
}).
then
(
res
=>
{
}).
then
((
res
)
=>
{
this
.
allPages
=
res
.
pages
this
.
allPages
=
res
.
pages
;
const
resArr
=
[...
res
.
list
]
const
resArr
=
[...
res
.
list
];
const
arr
=
this
.
baseData
.
merchantList
.
concat
(
resArr
)
const
arr
=
this
.
baseData
.
merchantList
.
concat
(
resArr
);
this
.
baseData
.
merchantList
=
arr
this
.
baseData
.
merchantList
=
arr
;
this
.
getOptionsList
()
this
.
getOptionsList
();
}).
catch
(()
=>
{
}).
catch
(()
=>
{
})
});
},
},
visibleChange
(
data
)
{
visibleChange
(
data
)
{
// 获取焦点重新渲染下拉框数据
// 获取焦点重新渲染下拉框数据
if
(
data
)
{
if
(
data
)
{
if
(
this
.
merchantName
)
{
if
(
this
.
merchantName
)
{
this
.
merchantName
=
''
this
.
merchantName
=
""
;
this
.
currentPage
=
1
this
.
currentPage
=
1
;
this
.
baseData
.
merchantList
=
[]
this
.
baseData
.
merchantList
=
[];
this
.
getSelectingList
()
this
.
getSelectingList
();
}
}
}
}
},
},
// 获取更多4S店
// 获取更多4S店
interestsLoadmore
()
{
interestsLoadmore
()
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
currentPage
=
this
.
currentPage
+
1
this
.
currentPage
=
this
.
currentPage
+
1
;
if
(
this
.
allPages
<
this
.
currentPage
)
{
if
(
this
.
allPages
<
this
.
currentPage
)
{
this
.
currentPage
=
this
.
allPages
this
.
currentPage
=
this
.
allPages
;
return
return
;
}
}
this
.
getSelectingList
()
this
.
getSelectingList
();
},
10
)
},
10
);
},
},
getBrands
()
{
getBrands
()
{
distinctAllBrand
({}).
then
(
res
=>
{
distinctAllBrand
({}).
then
((
res
)
=>
{
this
.
baseData
.
brandList
=
res
this
.
baseData
.
brandList
=
res
;
this
.
getOptionsList
()
this
.
getOptionsList
();
}).
catch
(()
=>
{
}).
catch
(()
=>
{
})
});
},
},
handleReset
()
{
handleReset
()
{
this
.
searchForm
=
{
this
.
searchForm
=
{
merchantIdList
:
[],
merchantIdList
:
[],
brandChildIdList
:
[],
brandChildIdList
:
[],
targetMonth
:
""
,
targetMonth
:
""
,
targetValue
:
[],
targetValue
:
[],
createTime
:
""
createTime
:
""
,
}
};
this
.
$refs
.
recordTable
.
refreshTable
()
this
.
$refs
.
recordTable
.
refreshTable
();
},
},
getOptionsList
()
{
getOptionsList
()
{
this
.
showFormData
.
forEach
((
item
,
index
)
=>
{
this
.
showFormData
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
type
===
'select'
)
{
if
(
item
.
type
===
"select"
)
{
if
(
this
.
baseData
[
item
.
optionsName
].
length
&&
this
.
baseData
[
item
.
optionsName
][
0
][
this
.
showFormData
[
index
].
optionLabel
]
!==
'全部'
)
{
if
(
this
.
baseData
[
item
.
optionsName
].
length
&&
this
.
baseData
[
item
.
optionsName
][
0
][
this
.
showFormData
[
index
].
optionLabel
]
!==
"全部"
)
{
const
temp
=
{}
const
temp
=
{};
temp
[
this
.
showFormData
[
index
].
optionId
]
=
''
temp
[
this
.
showFormData
[
index
].
optionId
]
=
""
;
temp
[
this
.
showFormData
[
index
].
optionLabel
]
=
'全部'
temp
[
this
.
showFormData
[
index
].
optionLabel
]
=
"全部"
;
this
.
baseData
[
item
.
optionsName
].
unshift
(
temp
)
this
.
baseData
[
item
.
optionsName
].
unshift
(
temp
);
}
}
this
.
$set
(
this
.
showFormData
[
index
],
'optionList'
,
this
.
baseData
[
item
.
optionsName
])
this
.
$set
(
this
.
showFormData
[
index
],
"optionList"
,
this
.
baseData
[
item
.
optionsName
]);
}
}
})
});
},
},
handleAdd
()
{
handleAdd
()
{
this
.
recordInfo
=
null
this
.
recordInfo
=
null
;
this
.
operationType
=
'add'
this
.
operationType
=
"add"
;
this
.
editVisible
=
true
this
.
editVisible
=
true
;
},
},
handleDetail
(
row
)
{
handleDetail
(
row
)
{
this
.
recordInfo
=
row
this
.
recordInfo
=
row
;
this
.
operationType
=
'detail'
this
.
operationType
=
"detail"
;
this
.
editVisible
=
true
this
.
editVisible
=
true
;
},
},
handleEdit
(
row
)
{
handleEdit
(
row
)
{
this
.
recordInfo
=
row
this
.
recordInfo
=
row
;
this
.
operationType
=
'edit'
this
.
operationType
=
"edit"
;
this
.
editVisible
=
true
this
.
editVisible
=
true
;
},
},
closeEditDialog
(
obj
)
{
closeEditDialog
(
obj
)
{
this
.
editVisible
=
!
this
.
editVisible
this
.
editVisible
=
!
this
.
editVisible
;
if
(
obj
.
flag
)
{
if
(
obj
.
flag
)
{
this
.
$refs
.
recordTable
.
refreshTable
(
false
,
true
)
this
.
$refs
.
recordTable
.
refreshTable
(
false
,
true
);
}
}
},
},
handleExport
()
{
handleExport
()
{
var
params
=
this
.
searchFormSearch
let
params
=
this
.
searchFormSearch
;
if
(
params
.
merchantIdList
.
length
>
0
)
{
if
(
params
.
merchantIdList
.
length
>
0
)
{
params
.
merchantIdList
.
forEach
((
item
,
index
)
=>
{
params
.
merchantIdList
.
forEach
((
item
,
index
)
=>
{
const
merchantId
=
`merchantIdList[
${
index
}
]`
const
merchantId
=
`merchantIdList[
${
index
}
]`
;
params
[
merchantId
]
=
item
params
[
merchantId
]
=
item
;
})
});
delete
params
.
merchantIdList
delete
params
.
merchantIdList
;
}
}
if
(
params
.
brandChildIdList
.
length
>
0
)
{
if
(
params
.
brandChildIdList
.
length
>
0
)
{
params
.
brandChildIdList
.
forEach
((
item
,
index
)
=>
{
params
.
brandChildIdList
.
forEach
((
item
,
index
)
=>
{
const
brandChildId
=
`brandChildIdList[
${
index
}
]`
const
brandChildId
=
`brandChildIdList[
${
index
}
]`
;
params
[
brandChildId
]
=
item
params
[
brandChildId
]
=
item
;
})
});
delete
params
.
brandChildIdList
delete
params
.
brandChildIdList
;
}
}
// 去除为null的值
// 去除为null的值
for
(
const
key
in
params
)
{
for
(
const
key
in
params
)
{
if
(
params
[
key
]
===
null
||
params
[
key
]
===
''
||
params
[
key
].
length
==
0
)
{
if
(
params
[
key
]
===
null
||
params
[
key
]
===
""
||
params
[
key
].
length
==
0
)
{
delete
params
[
key
]
delete
params
[
key
];
}
}
}
}
params
.
method
=
'dj.api.smartcarlife.merchantDeliverTargeConfig.export.async'
params
.
method
=
"dj.api.smartcarlife.merchantDeliverTargeConfig.export.async"
;
const
list
=
[
const
list
=
[
...
this
.
dowloadList
,
...
this
.
dowloadList
,
{
{
name
:
'门店主机厂交付数'
,
name
:
"门店主机厂交付数"
,
exportParam
:
JSON
.
stringify
(
params
),
exportParam
:
JSON
.
stringify
(
params
),
status
:
'waiting'
,
status
:
"waiting"
,
timeid
:
new
Date
().
getTime
()
timeid
:
new
Date
().
getTime
(),
}
},
]
];
this
.
actionSetDownloadList
({
list
,
type
:
'dowloadList'
})
this
.
actionSetDownloadList
({
list
,
type
:
"dowloadList"
});
},
},
// 门店主机厂交付数导入模版下载
// 门店主机厂交付数导入模版下载
exportTemplate
()
{
exportTemplate
()
{
var
params
=
{}
let
params
=
{};
params
.
method
=
'dj.api.smartcarlife.merchantDeliverTargeConfig.template.export'
params
.
method
=
"dj.api.smartcarlife.merchantDeliverTargeConfig.template.export"
;
const
list
=
[
const
list
=
[
...
this
.
dowloadList
,
...
this
.
dowloadList
,
{
{
name
:
'门店主机厂交付数导入模版'
,
name
:
"门店主机厂交付数导入模版"
,
exportParam
:
JSON
.
stringify
(
params
),
exportParam
:
JSON
.
stringify
(
params
),
status
:
'waiting'
,
status
:
"waiting"
,
timeid
:
new
Date
().
getTime
()
timeid
:
new
Date
().
getTime
(),
}
},
]
];
this
.
actionSetDownloadList
({
list
,
type
:
'dowloadList'
})
this
.
actionSetDownloadList
({
list
,
type
:
"dowloadList"
});
},
},
handleImport
()
{
handleImport
()
{
if
(
this
.
fileVisible
)
{
if
(
this
.
fileVisible
)
{
this
.
resetImportForm
()
this
.
resetImportForm
();
}
}
this
.
fileVisible
=
!
this
.
fileVisible
this
.
fileVisible
=
!
this
.
fileVisible
;
},
},
resetImportForm
()
{
resetImportForm
()
{
this
.
importForm
=
{
this
.
importForm
=
{
targetMonth
:
''
,
targetMonth
:
""
,
periodRange
:
[]
periodRange
:
[],
}
};
},
},
handleImportTargetMonthChange
()
{
handleImportTargetMonthChange
()
{
this
.
importForm
.
periodRange
=
[]
this
.
importForm
.
periodRange
=
[];
},
},
validateImportForm
()
{
validateImportForm
()
{
if
(
!
this
.
importForm
.
targetMonth
)
{
if
(
!
this
.
importForm
.
targetMonth
)
{
this
.
notice
.
warningTips
(
'请选择交付目标月份'
)
this
.
notice
.
warningTips
(
"请选择交付目标月份"
);
return
false
return
false
;
}
}
const
{
periodRange
}
=
this
.
importForm
const
{
periodRange
}
=
this
.
importForm
;
if
(
!
periodRange
||
periodRange
.
length
!==
2
||
!
periodRange
[
0
]
||
!
periodRange
[
1
])
{
if
(
!
periodRange
||
periodRange
.
length
!==
2
||
!
periodRange
[
0
]
||
!
periodRange
[
1
])
{
this
.
notice
.
warningTips
(
'请选择归属周期'
)
this
.
notice
.
warningTips
(
"请选择归属周期"
);
return
false
return
false
;
}
}
return
true
return
true
;
},
},
handleConfirmImport
({
fileName
,
fileData
})
{
handleConfirmImport
({
fileName
,
fileData
})
{
if
(
!
this
.
validateImportForm
())
return
if
(
!
this
.
validateImportForm
())
{
var
params
=
{
return
;
file
:
fileData
,
}
targetMonth
:
this
.
importForm
.
targetMonth
,
let
params
=
{
periodStartDate
:
this
.
importForm
.
periodRange
[
0
],
file
:
fileData
,
periodEndDate
:
this
.
importForm
.
periodRange
[
1
]
targetMonth
:
this
.
importForm
.
targetMonth
,
}
periodStartDate
:
this
.
importForm
.
periodRange
[
0
],
deliverTargeConfigImport
(
params
).
then
(
res
=>
{
periodEndDate
:
this
.
importForm
.
periodRange
[
1
],
if
(
res
)
{
};
const
list
=
[...
this
.
updateList
,
{
deliverTargeConfigImport
(
params
).
then
((
res
)
=>
{
name
:
fileName
,
if
(
res
)
{
ifSuccess
:
false
,
const
list
=
[...
this
.
updateList
,
{
uuid
:
res
,
name
:
fileName
,
type
:
'upload'
ifSuccess
:
false
,
}]
uuid
:
res
,
type
:
"upload"
,
}];
this
.
actionSetDownloadList
({
list
,
type
:
'updateList'
})
this
.
actionSetDownloadList
({
list
,
type
:
"updateList"
});
this
.
notice
.
okTips
(
'上传成功'
)
this
.
notice
.
okTips
(
"上传成功"
);
this
.
$refs
.
recordTable
.
refreshTable
(
false
,
true
)
this
.
$refs
.
recordTable
.
refreshTable
(
false
,
true
);
this
.
resetImportForm
()
this
.
resetImportForm
();
this
.
handleImport
()
this
.
handleImport
();
}
}
})
});
},
},
// 删除
// 删除
handleDelete
(
row
)
{
handleDelete
(
row
)
{
this
.
$confirm
(
'请确认是否要执行当前操作?'
,
'提示'
,
{
this
.
$confirm
(
"请确认是否要执行当前操作?"
,
"提示"
,
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
"确定"
,
cancelButtonText
:
'取消'
,
cancelButtonText
:
"取消"
,
type
:
'warning'
,
type
:
"warning"
,
closeOnClickModal
:
false
closeOnClickModal
:
false
,
}).
then
(()
=>
{
}).
then
(()
=>
{
deleteById_deliver
({
id
:
row
.
id
}).
then
(
res
=>
{
deleteById_deliver
({
id
:
row
.
id
}).
then
((
res
)
=>
{
this
.
notice
.
okTips
()
this
.
notice
.
okTips
();
this
.
$refs
.
recordTable
.
refreshTable
()
this
.
$refs
.
recordTable
.
refreshTable
();
})
});
}).
catch
(
err
=>
{
}).
catch
((
err
)
=>
{
console
.
log
(
err
)
console
.
log
(
err
);
})
});
}
},
},
},
beforeDestroy
()
{
beforeDestroy
()
{
this
.
onPageHide
()
this
.
onPageHide
();
}
},
}
}
;
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.m-t-40
{
.m-t-40
{
margin-top
:
40px
;
margin-top
:
40px
;
}
}
</
style
>
</
style
>
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