Commit 55b312cb by v_vjyjiang

d

parent 29727f70
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,//假的删除
......
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
}
}, {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment