Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-business
/
develop-platform
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 a98c8277
authored
Nov 11, 2020
by
wangql
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of
http://192.168.3.233:8090/glsx-business/dj-car-life-system
2 parents
bac2fab6
9e023b16
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
192 additions
and
35 deletions
src/api/serviceStore.js
src/api/sys.base.js
src/common/constants.js
src/components/d2-form/relateStoreDialog.vue
src/store/modules/d2admin/modules/base.js
src/views/goods/commodity.vue
src/views/goods/editProduct.vue
src/views/goods/product.vue
src/views/systemConfig/serviceStore.vue
src/api/serviceStore.js
View file @
a98c827
import
request
from
'./request'
import
RequestMethods
from
'./request.methods'
const
path
=
'dj.api.'
...
...
@@ -18,3 +19,9 @@ export function serviceGetMerchantList(data) {
data
.
method
=
`
${
path
}
merchant.page`
return
request
(
data
)
}
// 新增商户门店
export
function
addServiceMerchant
(
data
)
{
data
.
method
=
`
${
path
}
servicemerchantref.add`
return
request
(
data
,
RequestMethods
.
POST
)
}
src/api/sys.base.js
View file @
a98c827
...
...
@@ -2,7 +2,7 @@
* @Author: limin
* @Date: 2019-08-26 18:02:55
* @Last Modified by: chenwq
* @Last Modified time: 2020-11-11 1
4:16:27
* @Last Modified time: 2020-11-11 1
7:42:10
*/
import
request
from
'./request'
...
...
@@ -13,7 +13,7 @@ export const BASE_DATA_URL = 'fims.configuration.from.conftype'
const
path
=
'dj.api.'
// 获取商品分类列表
export
function
get
Goods
Type
(
data
)
{
export
function
get
Product
Type
(
data
)
{
data
.
method
=
`
${
path
}
goods.type.list`
return
request
(
data
)
}
...
...
src/common/constants.js
View file @
a98c827
...
...
@@ -2,7 +2,7 @@
* @Author: limin
* @Date: 2019-09-01 19:06:01
* @Last Modified by: chenwq
* @Last Modified time: 2020-11-11 1
4:29:52
* @Last Modified time: 2020-11-11 1
7:38:18
*/
// import { LOGIN_URL, REG_URL, ROLE_LIST_URL } from '@/api/sys.account'
...
...
@@ -22,7 +22,8 @@ export const TYPE_NAME = 'confType'
* 前端基础数据管理对应的接口名称的key
*/
export
const
BaseData
=
{
CHANNELTYPE
:
'channelType'
channelType
:
'channelType'
,
productType
:
'productType'
}
/**
* 注册类型
...
...
src/components/d2-form/relateStoreDialog.vue
View file @
a98c827
...
...
@@ -9,6 +9,7 @@
@
closeDialog=
"handleRelateStoreClose"
class=
"relateStore"
>
<slot></slot>
<el-row>
<el-col
:span=
"12"
>
<el-table
...
...
@@ -24,7 +25,11 @@
type=
"selection"
width=
"55"
align=
"center"
:selectable=
"selectable"
></el-table-column>
<!--
<el-table-column>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
beServed
}}
</
template
>
</el-table-column>
-->
<el-table-column
prop=
"merchantName"
label=
"门店名称"
...
...
@@ -85,6 +90,10 @@ export default {
storeSelected
:
{
type
:
Array
,
default
:
()
=>
[]
},
storeSearchForm
:
{
type
:
Object
,
default
:
()
=>
{
}
}
},
...
...
@@ -94,6 +103,9 @@ export default {
},
methods
:
{
selectable
(
row
,
index
)
{
return
row
.
hasOwnProperty
(
'beServed'
)
?
!
row
.
beServed
:
true
},
recoverySelection
()
{
var
exitIds
=
this
.
selectedData
.
map
(
item
=>
item
.
merchantId
)
this
.
selectingData
.
forEach
(
item
=>
{
...
...
@@ -102,9 +114,11 @@ export default {
},
getSelectingList
()
{
this
.
storeApi
({
...
this
.
storeSearchForm
,
currentPage
:
this
.
currentPage
,
pageSize
:
this
.
pageSize
}).
then
(
res
=>
{
console
.
log
(
res
)
this
.
selectingData
=
res
.
list
this
.
total
=
res
.
total
this
.
$nextTick
(()
=>
{
...
...
src/store/modules/d2admin/modules/base.js
View file @
a98c827
...
...
@@ -2,23 +2,27 @@
* @Author: limin
* @Date: 2019-09-01 17:56:57
* @Last Modified by: chenwq
* @Last Modified time: 2020-11-11 1
4:28:37
* @Last Modified time: 2020-11-11 1
7:42:11
*/
import
{
getChannelType
getChannelType
,
getProductType
}
from
'@/api/sys.base'
import
{
BaseData
}
from
'@/common/constants'
const
map
=
{
[
BaseData
.
CHANNELTYPE
]:
getChannelType
[
BaseData
.
channelType
]:
getChannelType
,
[
BaseData
.
productType
]:
getProductType
}
export
default
{
namespaced
:
true
,
state
:
{
// 渠道类型
channelType
:
[]
channelType
:
[],
// 产品分类
productType
:
[]
},
actions
:
{
/**
...
...
@@ -33,9 +37,11 @@ export default {
})
{
return
new
Promise
(
async
resolve
=>
{
Promise
.
all
([
getChannelType
({})
]).
then
(
async
([
channelType
])
=>
{
getChannelType
({}),
getProductType
({})
]).
then
(
async
([
channelType
,
productType
])
=>
{
state
.
channelType
=
channelType
state
.
productType
=
productType
await
dispatch
(
'save2db'
,
{
name
:
''
,
value
:
state
...
...
@@ -51,6 +57,7 @@ export default {
})
{
return
new
Promise
(
async
resolve
=>
{
state
.
channelType
=
[]
state
.
productType
=
[]
await
dispatch
(
'save2db'
,
{
name
:
''
,
value
:
state
...
...
@@ -112,8 +119,8 @@ export default {
if
(
state
.
channelType
.
length
===
0
)
{
state
=
await
dispatch
(
'getFromdb'
,
'base'
)
||
await
dispatch
(
'init'
)
}
const
{
channelType
}
=
state
resolve
({
channelType
})
const
{
channelType
,
productType
}
=
state
resolve
({
channelType
,
productType
})
})
},
/**
...
...
src/views/goods/commodity.vue
View file @
a98c827
...
...
@@ -107,7 +107,8 @@
<
script
>
import
{
getList
}
from
'@api/commodity'
import
{
getGoodsType
}
from
'@api/sys.base.js'
import
{
BaseData
}
from
'@/common/constants.js'
import
{
mapActions
}
from
'vuex'
import
_
from
'lodash'
import
storeDetail
from
'./storeDetail'
export
default
{
...
...
@@ -187,17 +188,18 @@ export default {
},
mounted
()
{
getGoodsType
({}).
then
(
res
=>
{
// console.log(res)
this
.
baseData
.
goodsType
=
res
})
this
.
getBaseData
()
console
.
log
(
this
.
$route
.
params
)
var
allOpt
=
{
confId
:
''
,
confKey
:
'全部'
}
this
.
baseData
.
goodsType
.
unshift
(
allOpt
)
this
.
baseData
.
brandList
.
unshift
(
allOpt
)
//
var allOpt = { confId: '', confKey: '全部' }
//
this.baseData.goodsType.unshift(allOpt)
//
this.baseData.brandList.unshift(allOpt)
},
methods
:
{
...
mapActions
(
'd2admin/base'
,
[
'get'
]),
async
getBaseData
()
{
this
.
baseData
.
goodsType
=
await
this
.
get
(
BaseData
.
productType
)
},
beforeSearchFn
()
{
return
new
Promise
(
resolve
=>
{
console
.
log
(
'搜索前操作--'
)
...
...
src/views/goods/editProduct.vue
View file @
a98c827
<!-- 产品编辑 -->
<
template
>
<div></div>
<div
class=
"edit-product"
>
<d2-form
ref=
"d2ProductForm"
:formItemWidth=
"formItemWidth"
:rules=
"rules"
:addOrEdit=
"addOrEdit"
:originData=
"editData"
:formList=
"editForm"
@
handleAddConfirm=
"handleAddConfirm"
@
handleClose=
"handleAddClose"
></d2-form>
</div>
</
template
>
<
script
>
import
{
mapActions
}
from
'vuex'
import
{
BaseData
}
from
'@/common/constants.js'
export
default
{
name
:
'editProduct'
,
data
()
{
return
{
show
:
false
,
addOrEdit
:
'add'
,
rules
:
{
goodsName
:
[{
required
:
true
,
message
:
'请输入产品名称'
,
trigger
:
'blur'
}],
goodsType
:
[{
required
:
true
,
message
:
'请选择分类'
,
trigger
:
'change'
}]
},
editData
:
{
goodsName
:
''
,
goodsType
:
''
,
goodsTypeName
:
''
,
sapCode
:
''
,
brandMerchantCode
:
''
,
brandMerchantName
:
''
,
thumbUrl
:
''
,
goodsImgList
:
[],
goodsDescList
:
[]
},
editForm
:
[{
title
:
'产品基本信息'
,
formBlock
:
[{
name
:
'goodsName'
,
label
:
'产品名称'
,
type
:
'input'
},
{
name
:
'goodsType'
,
label
:
'分类'
,
isRequired
:
true
,
type
:
'select'
,
tips
:
'选择产品分类'
,
isClear
:
false
,
optionList
:
[],
optionId
:
'goodsType'
,
optionLabel
:
'goodsTypeName'
},
{
name
:
'sapCode'
,
label
:
'SAP编码'
,
type
:
'input'
},
{
name
:
'brandMerchantCode'
,
label
:
'品牌商'
,
isRequired
:
true
,
type
:
'select'
,
tips
:
'选择品牌商'
,
isClear
:
true
,
optionList
:
[],
optionId
:
'goodsType'
,
optionLabel
:
'goodsTypeName'
}]
}],
baseData
:
{
productType
:
[]
}
}
},
components
:
{},
computed
:
{},
mounted
()
{},
mounted
()
{
this
.
getBaseData
()
},
methods
:
{}
methods
:
{
...
mapActions
({
get
:
'd2admin/base/get'
}),
async
getBaseData
()
{
const
temp
=
await
this
.
get
(
BaseData
.
productType
)
this
.
baseData
.
productType
=
temp
this
.
editForm
[
0
].
formBlock
[
1
].
optionList
=
temp
console
.
log
(
this
.
baseData
.
productType
)
}
}
}
</
script
>
...
...
src/views/goods/product.vue
View file @
a98c827
...
...
@@ -158,6 +158,7 @@ export default {
},
handleAdd
(
form
)
{
console
.
log
(
form
)
this
.
$router
.
push
({
name
:
'editProduct'
})
},
handleExport
()
{
},
handleEdit
(
row
)
{
...
...
src/views/systemConfig/serviceStore.vue
View file @
a98c827
<!-- 服务4S店 -->
<
template
>
<d2-container
class=
"
commodity
"
>
<d2-container
class=
"
service-store
"
>
<el-form
:inline=
"true"
v-model=
"searchForm"
...
...
@@ -40,17 +40,46 @@
</d2-table>
<relate-store-dialog
v-if=
"relateStoreVisible"
ref=
"relateStore"
:relateStoreVisible=
"relateStoreVisible"
:storeApi=
"storeApi"
:storeSearchForm=
"storeSearchForm"
:storeSelected=
"storeSelected"
@
handleRelateStoreConfirm=
"handleRelateStoreConfirm"
@
handleRelateStoreClose=
"handleRelateStoreClose"
></relate-store-dialog>
>
<el-row
slot
>
<el-col
class=
"service-search"
:span=
"6"
>
<el-select
v-model=
"storeSearchForm.channelType"
>
<el-option
v-for=
"item in baseData.channelType"
:key=
"item.value"
:label=
"item.name"
:value=
"item.value"
></el-option>
</el-select>
</el-col>
<el-col
:span=
"8"
>
<el-input
v-model=
"storeSearchForm.merchantIdName"
placeholder=
"支持按门店、商户号搜索"
clearable
></el-input>
</el-col>
<el-button
type=
"primary"
@
click=
"handleSearchStore"
>
搜索
</el-button>
</el-row>
</relate-store-dialog>
</d2-container>
</
template
>
<
script
>
import
{
getList
,
deleteMerchant
,
serviceGetMerchantList
}
from
'@api/serviceStore'
import
{
getList
,
deleteMerchant
,
serviceGetMerchantList
,
addServiceMerchant
}
from
'@api/serviceStore'
import
{
mapActions
}
from
'vuex'
import
{
BaseData
,
userType
,
ghUserType
}
from
'@/common/constants.js'
export
default
{
...
...
@@ -107,6 +136,10 @@ export default {
}]
},
// 关联门店
storeSearchForm
:
{
channelType
:
1
,
merchantIdName
:
''
},
relateStoreVisible
:
false
,
storeApi
:
serviceGetMerchantList
,
storeSelected
:
[],
...
...
@@ -134,7 +167,7 @@ export default {
})
},
async
getBaseData
()
{
this
.
baseData
.
channelType
=
await
this
.
get
(
BaseData
.
CHANNELTYPE
)
this
.
baseData
.
channelType
=
await
this
.
get
(
BaseData
.
channelType
)
},
handleReset
()
{
this
.
searchForm
=
{
...
...
@@ -145,14 +178,30 @@ export default {
// console.log(form)
this
.
relateStoreVisible
=
true
},
handleRelateStoreConfirm
()
{
this
.
relateStoreVisible
=
false
relateCloseReset
()
{
this
.
storeSearchForm
=
{
channelType
:
1
,
merchantIdName
:
''
}
},
handleRelateStoreConfirm
(
selectedData
)
{
console
.
log
(
selectedData
)
addServiceMerchant
({
list
:
selectedData
}).
then
(
res
=>
{
this
.
relateStoreVisible
=
false
this
.
$refs
.
serviceStoreTable
.
refreshTable
()
this
.
notice
.
okTips
()
this
.
relateCloseReset
()
})
},
handleRelateStoreClose
()
{
this
.
relateStoreVisible
=
false
this
.
relateCloseReset
()
},
handleSearchStore
()
{
this
.
$refs
.
relateStore
.
getSelectingList
()
},
handleDelete
(
row
)
{
console
.
log
(
row
)
//
console.log(row)
this
.
$confirm
(
'是否要进行删除操作?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
...
...
@@ -170,5 +219,8 @@ export default {
}
</
script
>
<
style
scoped
>
<
style
>
.service-store
.service-search
{
margin-bottom
:
10px
;
}
</
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