Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
55b312cb
Commit
55b312cb
authored
Aug 14, 2020
by
v_vjyjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
29727f70
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
27 deletions
+48
-27
center-manage/app/base/db/models/product/productcost.js
+15
-8
center-manage/app/base/db/models/product/productprice.js
+33
-19
No files found.
center-manage/app/base/db/models/product/productcost.js
View file @
55b312cb
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
appconfig
=
system
.
getSysConfig
();
const
appconfig
=
system
.
getSysConfig
();
module
.
exports
=
(
db
,
DataTypes
)
=>
{
//定价类型
return
db
.
define
(
"productcost"
,
{
costdesc
:{
//成本描述
costdesc
:
{
//成本描述
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
},
expensetype
:{
//费用类型
expensetype
:
{
//费用类型
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
},
costratio
:{
type
:
DataTypes
.
DECIMAL
(
10
,
2
)
,
costratio
:
{
type
:
DataTypes
.
DECIMAL
(
10
,
2
),
allowNull
:
true
,
},
costamount
:{
type
:
DataTypes
.
DECIMAL
(
10
,
2
)
,
allowNull
:
true
costamount
:
{
type
:
DataTypes
.
DECIMAL
(
10
,
2
),
allowNull
:
true
,
set
(
value
)
{
this
.
setDataValue
(
'costamount'
,
value
*
100
);
},
get
()
{
const
resValue
=
this
.
getDataValue
(
'costamount'
);
return
resValue
/
100
;
}
},
},
{
paranoid
:
true
,
//假的删除
...
...
center-manage/app/base/db/models/product/productprice.js
View file @
55b312cb
const
system
=
require
(
"../../../system"
);
const
settings
=
require
(
"../../../../config/settings"
);
const
appconfig
=
system
.
getSysConfig
();
const
appconfig
=
system
.
getSysConfig
();
module
.
exports
=
(
db
,
DataTypes
)
=>
{
//定价类型
return
db
.
define
(
"productprice"
,
{
sptags
:{
//交付商标签
sptags
:
{
//交付商标签
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
},
channeltags
:{
//渠道标签
channeltags
:
{
//渠道标签
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
},
skucode
:{
//自定义简码
skucode
:
{
//自定义简码
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
},
skuname
:{
//自定义名称
skuname
:
{
//自定义名称
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
},
pname
:{
//产品名称
pname
:
{
//产品名称
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
},
strategyitems
:{
//定价策略
strategyitems
:
{
//定价策略
type
:
DataTypes
.
STRING
,
allowNull
:
true
,
},
lowpriceref
:{
type
:
DataTypes
.
DECIMAL
(
10
,
2
)
,
lowpriceref
:
{
type
:
DataTypes
.
DECIMAL
(
10
,
2
),
allowNull
:
true
,
defaultValue
:
0
defaultValue
:
0
,
set
(
value
)
{
this
.
setDataValue
(
'lowpriceref'
,
value
*
100
);
},
get
()
{
const
resValue
=
this
.
getDataValue
(
'lowpriceref'
);
return
resValue
/
100
;
}
},
hignpriceref
:{
type
:
DataTypes
.
DECIMAL
(
10
,
2
)
,
hignpriceref
:
{
type
:
DataTypes
.
DECIMAL
(
10
,
2
),
allowNull
:
true
,
defaultValue
:
0
defaultValue
:
0
,
set
(
value
)
{
this
.
setDataValue
(
'hignpriceref'
,
value
*
100
);
},
get
()
{
const
resValue
=
this
.
getDataValue
(
'hignpriceref'
);
return
resValue
/
100
;
}
},
deliverfile
:{
deliverfile
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
false
,
defaultValue
:
''
defaultValue
:
''
},
extrafile
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
false
,
defaultValue
:
''
defaultValue
:
''
},
//和user的from相同,在注册user时,去创建
desc
:
{
type
:
DataTypes
.
STRING
,
allowNull
:
false
,
defaultValue
:
''
defaultValue
:
''
},
//和user的from
isEnabled
:{
type
:
DataTypes
.
BOOLEAN
,
isEnabled
:
{
type
:
DataTypes
.
BOOLEAN
,
defaultValue
:
false
}
},
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment