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 ff3c0131
authored
Aug 10, 2023
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
需求功能代码提交
1 parent
47ab436e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
166 additions
and
21 deletions
src/api/serviceManage.js
src/views/orderManage/order.vue
src/views/systemConfig/serviceManage/editService.vue
src/api/serviceManage.js
View file @
ff3c013
...
...
@@ -89,24 +89,33 @@ export function settingYqMerchantSceneAPI(data) {
// 获取服务商数据
export
function
getServiceListAPI
(
data
)
{
data
.
method
=
'dj.api.smarcarlife.yqMerchantConfig.partnerMerchantDetail'
data
.
method
=
"dj.api.smarcarlife.yqMerchantConfig.partnerMerchantDetail"
return
request
(
data
,
"post"
)
}
// 获取服务商配置
export
function
getProviderProcurementInfo
(
data
)
{
data
.
method
=
'dj.smartcarlife.api.yqPartnerMerchant.selectProviderProcurementInfo'
data
.
method
=
"dj.smartcarlife.api.yqPartnerMerchant.selectProviderProcurementInfo"
return
request
(
data
,
"post"
)
}
// 配置服务商
export
function
updateProviderProcurementInfo
(
data
)
{
data
.
method
=
'dj.smartcarlife.api.yqPartnerMerchant.updateProviderProcurementInfo'
data
.
method
=
"dj.smartcarlife.api.yqPartnerMerchant.updateProviderProcurementInfo"
return
request
(
data
,
"post"
)
}
// 获取发货主体
export
function
getShippingEntityInfoAll
(
data
)
{
data
.
method
=
'dj.smartcarlife.api.yqPartnerMerchant.selectShippingEntityInfoAll'
data
.
method
=
"dj.smartcarlife.api.yqPartnerMerchant.selectShippingEntityInfoAll"
return
request
(
data
,
"post"
)
}
// 获取下级商户
export
function
searchServiceMerchant
(
data
)
{
data
.
method
=
"dj.api.serviceMerchant.page.search"
return
request
(
data
,
"post"
)
}
src/views/orderManage/order.vue
View file @
ff3c013
This diff is collapsed.
Click to expand it.
src/views/systemConfig/serviceManage/editService.vue
View file @
ff3c013
<
template
>
<d2-container
class=
"edit_service"
>
<div
class=
"d2-container-content form_class"
>
<el-form
label-width=
"120px"
:model=
"detailInfo"
ref=
"editServiceForm"
:rules=
"rules"
>
<el-form-item
label=
"采购模式:"
prop=
"procurementType"
>
<el-radio-group
size=
"mini"
v-model=
"detailInfo.procurementType"
>
<el-radio
v-for=
"(subItem, subIdx) in procureModeList"
:key=
"subIdx"
:label=
"subItem.confId"
>
{{
<el-form
label-width=
"120px"
:model=
"detailInfo"
ref=
"editServiceForm"
:rules=
"rules"
>
<el-form-item
label=
"采购模式:"
prop=
"procurementType"
>
<el-radio-group
size=
"mini"
v-model=
"detailInfo.procurementType"
>
<el-radio
v-for=
"(subItem, subIdx) in procureModeList"
:key=
"subIdx"
:label=
"subItem.confId"
>
{{
subItem
.
confName
}}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"发货主体:"
prop=
"shippingEntityId"
>
<el-select
v-model=
"detailInfo.shippingEntityId"
class=
"select_class"
placeholder=
"请选择发货主体"
>
<el-option
v-for=
"(subItem, subIndex) in shippingEntityList"
:key=
"subIndex"
:label=
"subItem.shippingEntity"
:value=
"subItem.shippingEntityId"
/>
<el-form-item
label=
"发货主体:"
prop=
"shippingEntityId"
>
<el-select
v-model=
"detailInfo.shippingEntityId"
class=
"select_class"
placeholder=
"请选择发货主体"
>
<el-option
v-for=
"(subItem, subIndex) in shippingEntityList"
:key=
"subIndex"
:label=
"subItem.shippingEntity"
:value=
"subItem.shippingEntityId"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"下级商户:"
>
<div
v-for=
"(item, index) in detailInfo.subMerchantList"
:key=
"index"
>
<div
class=
"inputCol"
>
<el-form-item>
<el-select
v-model=
"item.merchantId"
filterable
remote
reserve-keyword
placeholder=
"请输入关键字"
style=
"width: 432px"
:remote-method=
"remoteMethod"
@
change=
"changeOpt"
:loading=
"loading"
>
<el-option
v-for=
"(opt, optIndex) in options"
:key=
"optIndex"
:label=
"opt.merchantName"
:value=
"opt.merchantId"
:disabled=
"setDisabled(opt.merchantId)"
>
</el-option>
</el-select>
<el-button
type=
"text"
style=
"color: red;paddingLeft:10px"
@
click=
"handleDelMerchant(index)"
>
删除
</el-button>
</el-form-item>
</div>
</div>
<div>
<el-button
type=
"primary"
size=
"small"
plain
@
click=
"handleAddMerchant"
>
添加一行
</el-button>
</div>
</el-form-item>
</el-form>
</div>
<div
style=
"margin-top: 40px;text-align: center;"
>
<el-button
class=
"width_100 cancel-btn"
@
click=
"handleClose"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"handleUp"
:disabled=
"$store.state.d2admin.loading.value"
class=
"width_100"
>
提交
</el-button>
<el-button
class=
"width_100 cancel-btn"
@
click=
"handleClose"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"handleUp"
:disabled=
"$store.state.d2admin.loading.value"
class=
"width_100"
>
提交
</el-button>
</div>
</d2-container>
</
template
>
<
script
>
import
{
deepClone
}
from
'@/common/util'
import
{
procureModeList
}
from
"@/common/constants"
import
{
mapActions
}
from
'vuex'
import
{
getProviderProcurementInfo
,
updateProviderProcurementInfo
,
getShippingEntityInfoAll
}
from
"@api/serviceManage"
import
{
getProviderProcurementInfo
,
updateProviderProcurementInfo
,
getShippingEntityInfoAll
,
searchServiceMerchant
}
from
"@api/serviceManage"
export
default
{
name
:
"EditService"
,
data
()
{
...
...
@@ -38,10 +88,13 @@ export default {
},
detailInfo
:
{
procurementType
:
''
,
shippingEntityId
:
''
shippingEntityId
:
''
,
subMerchantList
:
[]
},
shippingEntityList
:
[],
serviceMerchantId
:
''
serviceMerchantId
:
''
,
loading
:
false
,
options
:
[],
}
},
mounted
()
{
...
...
@@ -60,7 +113,18 @@ export default {
}),
getInfo
()
{
getProviderProcurementInfo
({
merchantId
:
this
.
serviceMerchantId
}).
then
(
res
=>
{
this
.
detailInfo
=
res
||
{}
this
.
detailInfo
=
deepClone
(
res
)
||
{}
if
(
this
.
detailInfo
.
subMerchantList
&&
this
.
detailInfo
.
subMerchantList
.
length
>
0
)
{
this
.
detailInfo
.
subMerchantList
=
this
.
detailInfo
.
subMerchantList
.
map
(
item
=>
{
const
item_new
=
{
id
:
item
.
id
,
merchantName
:
item
.
subMerchantName
,
merchantId
:
item
.
subMerchantId
}
this
.
options
.
push
(
item_new
)
return
item_new
})
}
this
.
$nextTick
(()
=>
{
this
.
$refs
.
editServiceForm
.
clearValidate
()
})
...
...
@@ -95,6 +159,21 @@ export default {
shippingEntity
:
this
.
shippingEntityList
.
filter
(
val
=>
val
.
shippingEntityId
==
this
.
detailInfo
.
shippingEntityId
)[
0
]?.
shippingEntity
||
''
,
shippingEntityId
:
this
.
detailInfo
.
shippingEntityId
}
if
(
this
.
detailInfo
.
subMerchantList
&&
this
.
detailInfo
.
subMerchantList
.
length
>
0
)
{
let
_subMerchantList
=
deepClone
(
this
.
detailInfo
.
subMerchantList
)
const
list
=
[]
let
info
_subMerchantList
.
forEach
(
item
=>
{
info
=
{}
info
.
subMerchantId
=
item
.
merchantId
info
.
subMerchantName
=
item
.
merchantName
list
.
push
(
info
)
})
console
.
log
(
list
);
params
.
subMerchantList
=
list
}
updateProviderProcurementInfo
(
params
).
then
(
res
=>
{
this
.
notice
.
okTips
()
this
.
handleClose
(
true
)
...
...
@@ -103,14 +182,63 @@ export default {
return
true
}
})
}
},
handleAddMerchant
()
{
this
.
options
=
[]
this
.
detailInfo
.
subMerchantList
.
push
({
// merchantName: '',
merchantId
:
''
})
},
handleDelMerchant
(
index
)
{
this
.
detailInfo
.
subMerchantList
.
splice
(
index
,
1
)
},
remoteMethod
(
queryString
)
{
if
(
queryString
)
{
this
.
loading
=
true
setTimeout
(()
=>
{
this
.
loading
=
false
var
params
=
{
currentPage
:
1
,
pageSize
:
1000
,
merchantName
:
queryString
,
merchantType
:
[
7
]
}
searchServiceMerchant
(
params
).
then
(
res
=>
{
this
.
options
=
res
.
list
||
[]
})
},
200
)
}
else
{
this
.
options
=
[]
}
},
changeOpt
(
val
)
{
const
info
=
this
.
options
.
find
(
item
=>
item
.
merchantId
==
val
)
this
.
detailInfo
.
subMerchantList
=
this
.
detailInfo
.
subMerchantList
.
map
(
item
=>
{
if
(
item
.
merchantId
==
info
.
merchantId
)
{
const
id
=
deepClone
(
item
.
id
)
delete
info
.
id
item
=
deepClone
(
info
)
if
(
id
)
{
item
.
id
=
id
// return item = Object.assign(info, { id: item.id })
}
}
return
item
})
},
setDisabled
(
val
)
{
const
info
=
this
.
detailInfo
.
subMerchantList
.
find
(
item
=>
item
.
merchantId
==
val
)
if
(
info
)
{
return
true
}
else
{
return
false
}
},
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.edit_service
{
.form_class
{
height
:
calc
(
100vh
-
300px
);
//
height
:
calc
(
100vh
-
300px
);
}
.select_class
{
...
...
@@ -120,5 +248,13 @@ export default {
.width_100
{
width
:
100px
;
}
.inputCol
{
box-sizing
:
border-box
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
padding
:
0
0
20px
;
}
}
</
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