Commit 55b312cb by v_vjyjiang

d

parent 29727f70
const system = require("../../../system"); const system = require("../../../system");
const settings = require("../../../../config/settings"); const settings = require("../../../../config/settings");
const appconfig=system.getSysConfig(); const appconfig = system.getSysConfig();
module.exports = (db, DataTypes) => { module.exports = (db, DataTypes) => {
//定价类型 //定价类型
return db.define("productcost", { return db.define("productcost", {
costdesc:{//成本描述 costdesc: {//成本描述
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
}, },
expensetype:{//费用类型 expensetype: {//费用类型
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
}, },
costratio:{ costratio: {
type: DataTypes.DECIMAL(10, 2) , type: DataTypes.DECIMAL(10, 2),
allowNull: true, allowNull: true,
}, },
costamount:{ costamount: {
type: DataTypes.DECIMAL(10, 2) , type: DataTypes.DECIMAL(10, 2),
allowNull: true allowNull: true,
set (value) {
this.setDataValue('costamount', value * 100);
},
get () {
const resValue = this.getDataValue('costamount');
return resValue / 100;
}
}, },
}, { }, {
paranoid: true,//假的删除 paranoid: true,//假的删除
......
const system = require("../../../system"); const system = require("../../../system");
const settings = require("../../../../config/settings"); const settings = require("../../../../config/settings");
const appconfig=system.getSysConfig(); const appconfig = system.getSysConfig();
module.exports = (db, DataTypes) => { module.exports = (db, DataTypes) => {
//定价类型 //定价类型
return db.define("productprice", { return db.define("productprice", {
sptags:{//交付商标签 sptags: {//交付商标签
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
}, },
channeltags:{//渠道标签 channeltags: {//渠道标签
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
}, },
skucode:{//自定义简码 skucode: {//自定义简码
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
}, },
skuname:{//自定义名称 skuname: {//自定义名称
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
}, },
pname:{//产品名称 pname: {//产品名称
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
}, },
strategyitems:{//定价策略 strategyitems: {//定价策略
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: true, allowNull: true,
}, },
lowpriceref:{ lowpriceref: {
type: DataTypes.DECIMAL(10, 2) , type: DataTypes.DECIMAL(10, 2),
allowNull: true, allowNull: true,
defaultValue:0 defaultValue: 0,
set (value) {
this.setDataValue('lowpriceref', value * 100);
},
get () {
const resValue = this.getDataValue('lowpriceref');
return resValue / 100;
}
}, },
hignpriceref:{ hignpriceref: {
type: DataTypes.DECIMAL(10, 2) , type: DataTypes.DECIMAL(10, 2),
allowNull: true, 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, type: DataTypes.STRING,
allowNull: false, allowNull: false,
defaultValue:'' defaultValue: ''
}, },
extrafile: { extrafile: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false, allowNull: false,
defaultValue:'' defaultValue: ''
},//和user的from相同,在注册user时,去创建 },//和user的from相同,在注册user时,去创建
desc: { desc: {
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false, allowNull: false,
defaultValue:'' defaultValue: ''
},//和user的from },//和user的from
isEnabled:{ isEnabled: {
type:DataTypes.BOOLEAN, type: DataTypes.BOOLEAN,
defaultValue: false 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