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 9e023b16
authored
Nov 11, 2020
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
服务4s点
1 parent
b82f74ed
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
119 additions
and
31 deletions
src/api/serviceStore.js
src/api/sys.base.js
src/common/constants.js
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 @
9e023b1
import
request
from
'./request'
import
request
from
'./request'
import
RequestMethods
from
'./request.methods'
const
path
=
'dj.api.'
const
path
=
'dj.api.'
...
@@ -22,5 +23,5 @@ export function serviceGetMerchantList(data) {
...
@@ -22,5 +23,5 @@ export function serviceGetMerchantList(data) {
// 新增商户门店
// 新增商户门店
export
function
addServiceMerchant
(
data
)
{
export
function
addServiceMerchant
(
data
)
{
data
.
method
=
`
${
path
}
servicemerchantref.add`
data
.
method
=
`
${
path
}
servicemerchantref.add`
return
request
(
data
)
return
request
(
data
,
RequestMethods
.
POST
)
}
}
src/api/sys.base.js
View file @
9e023b1
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: limin
* @Author: limin
* @Date: 2019-08-26 18:02:55
* @Date: 2019-08-26 18:02:55
* @Last Modified by: chenwq
* @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'
import
request
from
'./request'
...
@@ -13,7 +13,7 @@ export const BASE_DATA_URL = 'fims.configuration.from.conftype'
...
@@ -13,7 +13,7 @@ export const BASE_DATA_URL = 'fims.configuration.from.conftype'
const
path
=
'dj.api.'
const
path
=
'dj.api.'
// 获取商品分类列表
// 获取商品分类列表
export
function
get
Goods
Type
(
data
)
{
export
function
get
Product
Type
(
data
)
{
data
.
method
=
`
${
path
}
goods.type.list`
data
.
method
=
`
${
path
}
goods.type.list`
return
request
(
data
)
return
request
(
data
)
}
}
...
...
src/common/constants.js
View file @
9e023b1
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: limin
* @Author: limin
* @Date: 2019-09-01 19:06:01
* @Date: 2019-09-01 19:06:01
* @Last Modified by: chenwq
* @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'
// import { LOGIN_URL, REG_URL, ROLE_LIST_URL } from '@/api/sys.account'
...
@@ -22,7 +22,8 @@ export const TYPE_NAME = 'confType'
...
@@ -22,7 +22,8 @@ export const TYPE_NAME = 'confType'
* 前端基础数据管理对应的接口名称的key
* 前端基础数据管理对应的接口名称的key
*/
*/
export
const
BaseData
=
{
export
const
BaseData
=
{
CHANNELTYPE
:
'channelType'
channelType
:
'channelType'
,
productType
:
'productType'
}
}
/**
/**
* 注册类型
* 注册类型
...
...
src/store/modules/d2admin/modules/base.js
View file @
9e023b1
...
@@ -2,23 +2,27 @@
...
@@ -2,23 +2,27 @@
* @Author: limin
* @Author: limin
* @Date: 2019-09-01 17:56:57
* @Date: 2019-09-01 17:56:57
* @Last Modified by: chenwq
* @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
{
import
{
getChannelType
getChannelType
,
getProductType
}
from
'@/api/sys.base'
}
from
'@/api/sys.base'
import
{
import
{
BaseData
BaseData
}
from
'@/common/constants'
}
from
'@/common/constants'
const
map
=
{
const
map
=
{
[
BaseData
.
CHANNELTYPE
]:
getChannelType
[
BaseData
.
channelType
]:
getChannelType
,
[
BaseData
.
productType
]:
getProductType
}
}
export
default
{
export
default
{
namespaced
:
true
,
namespaced
:
true
,
state
:
{
state
:
{
// 渠道类型
// 渠道类型
channelType
:
[]
channelType
:
[],
// 产品分类
productType
:
[]
},
},
actions
:
{
actions
:
{
/**
/**
...
@@ -33,9 +37,11 @@ export default {
...
@@ -33,9 +37,11 @@ export default {
})
{
})
{
return
new
Promise
(
async
resolve
=>
{
return
new
Promise
(
async
resolve
=>
{
Promise
.
all
([
Promise
.
all
([
getChannelType
({})
getChannelType
({}),
]).
then
(
async
([
channelType
])
=>
{
getProductType
({})
]).
then
(
async
([
channelType
,
productType
])
=>
{
state
.
channelType
=
channelType
state
.
channelType
=
channelType
state
.
productType
=
productType
await
dispatch
(
'save2db'
,
{
await
dispatch
(
'save2db'
,
{
name
:
''
,
name
:
''
,
value
:
state
value
:
state
...
@@ -51,6 +57,7 @@ export default {
...
@@ -51,6 +57,7 @@ export default {
})
{
})
{
return
new
Promise
(
async
resolve
=>
{
return
new
Promise
(
async
resolve
=>
{
state
.
channelType
=
[]
state
.
channelType
=
[]
state
.
productType
=
[]
await
dispatch
(
'save2db'
,
{
await
dispatch
(
'save2db'
,
{
name
:
''
,
name
:
''
,
value
:
state
value
:
state
...
@@ -112,8 +119,8 @@ export default {
...
@@ -112,8 +119,8 @@ export default {
if
(
state
.
channelType
.
length
===
0
)
{
if
(
state
.
channelType
.
length
===
0
)
{
state
=
await
dispatch
(
'getFromdb'
,
'base'
)
||
await
dispatch
(
'init'
)
state
=
await
dispatch
(
'getFromdb'
,
'base'
)
||
await
dispatch
(
'init'
)
}
}
const
{
channelType
}
=
state
const
{
channelType
,
productType
}
=
state
resolve
({
channelType
})
resolve
({
channelType
,
productType
})
})
})
},
},
/**
/**
...
...
src/views/goods/commodity.vue
View file @
9e023b1
...
@@ -107,7 +107,8 @@
...
@@ -107,7 +107,8 @@
<
script
>
<
script
>
import
{
getList
}
from
'@api/commodity'
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
_
from
'lodash'
import
storeDetail
from
'./storeDetail'
import
storeDetail
from
'./storeDetail'
export
default
{
export
default
{
...
@@ -187,17 +188,18 @@ export default {
...
@@ -187,17 +188,18 @@ export default {
},
},
mounted
()
{
mounted
()
{
getGoodsType
({}).
then
(
res
=>
{
this
.
getBaseData
()
// console.log(res)
this
.
baseData
.
goodsType
=
res
})
console
.
log
(
this
.
$route
.
params
)
console
.
log
(
this
.
$route
.
params
)
var
allOpt
=
{
confId
:
''
,
confKey
:
'全部'
}
//
var allOpt = { confId: '', confKey: '全部' }
this
.
baseData
.
goodsType
.
unshift
(
allOpt
)
//
this.baseData.goodsType.unshift(allOpt)
this
.
baseData
.
brandList
.
unshift
(
allOpt
)
//
this.baseData.brandList.unshift(allOpt)
},
},
methods
:
{
methods
:
{
...
mapActions
(
'd2admin/base'
,
[
'get'
]),
async
getBaseData
()
{
this
.
baseData
.
goodsType
=
await
this
.
get
(
BaseData
.
productType
)
},
beforeSearchFn
()
{
beforeSearchFn
()
{
return
new
Promise
(
resolve
=>
{
return
new
Promise
(
resolve
=>
{
console
.
log
(
'搜索前操作--'
)
console
.
log
(
'搜索前操作--'
)
...
...
src/views/goods/editProduct.vue
View file @
9e023b1
<!-- 产品编辑 -->
<!-- 产品编辑 -->
<
template
>
<
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
>
</
template
>
<
script
>
<
script
>
import
{
mapActions
}
from
'vuex'
import
{
BaseData
}
from
'@/common/constants.js'
export
default
{
export
default
{
name
:
'editProduct'
,
name
:
'editProduct'
,
data
()
{
data
()
{
return
{
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
:
{},
mounted
()
{
this
.
getBaseData
()
computed
:
{},
},
mounted
()
{},
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
>
</
script
>
...
...
src/views/goods/product.vue
View file @
9e023b1
...
@@ -176,6 +176,7 @@ export default {
...
@@ -176,6 +176,7 @@ export default {
},
},
handleAdd
(
form
)
{
handleAdd
(
form
)
{
console
.
log
(
form
)
console
.
log
(
form
)
this
.
$router
.
push
({
name
:
'editProduct'
})
},
},
handleExport
()
{
},
handleExport
()
{
},
handleEdit
(
row
)
{
handleEdit
(
row
)
{
...
...
src/views/systemConfig/serviceStore.vue
View file @
9e023b1
...
@@ -167,7 +167,7 @@ export default {
...
@@ -167,7 +167,7 @@ export default {
})
})
},
},
async
getBaseData
()
{
async
getBaseData
()
{
this
.
baseData
.
channelType
=
await
this
.
get
(
BaseData
.
CHANNELTYPE
)
this
.
baseData
.
channelType
=
await
this
.
get
(
BaseData
.
channelType
)
},
},
handleReset
()
{
handleReset
()
{
this
.
searchForm
=
{
this
.
searchForm
=
{
...
@@ -184,9 +184,12 @@ export default {
...
@@ -184,9 +184,12 @@ export default {
merchantIdName
:
''
merchantIdName
:
''
}
}
},
},
handleRelateStoreConfirm
()
{
handleRelateStoreConfirm
(
selectedData
)
{
addServiceMerchant
({}).
then
(
res
=>
{
console
.
log
(
selectedData
)
addServiceMerchant
({
list
:
selectedData
}).
then
(
res
=>
{
this
.
relateStoreVisible
=
false
this
.
relateStoreVisible
=
false
this
.
$refs
.
serviceStoreTable
.
refreshTable
()
this
.
notice
.
okTips
()
this
.
relateCloseReset
()
this
.
relateCloseReset
()
})
})
},
},
...
...
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