You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

48 lines
1.3 KiB

/**
* 客户联系信息子表模型
*/
const CustomerContact = {
/**
* 模型字段定义
*/
fields: {
contact_id: 'number',
customer_id: 'number',
wechat_id: 'string',
contact_name: 'string',
phone: 'string',
account: 'string',
account_number: 'string',
bank: 'string',
address: 'string',
company_name: 'string',
created_at: 'date',
updated_at: 'date'
},
/**
* 创建客户联系信息实例
* @param {Object} data - 数据对象
* @returns {Object} - 客户联系信息实例
*/
create: function(data) {
return {
contact_id: data.contact_id || null,
customer_id: data.customer_id || 0,
wechat_id: data.wechat_id || null,
contact_name: data.contact_name || null,
phone: data.phone || null,
account: data.account || null,
account_number: data.account_number || null,
bank: data.bank || null,
address: data.address || '',
company_name: data.company_name || null,
created_at: data.created_at || new Date(),
updated_at: data.updated_at || new Date()
};
}
};
// 导出为全局变量
window.CustomerContact = CustomerContact;