
const apiVersion = process.env.VUE_APP_API_VERSION.replace(/\./g, '_')
const baseUrl = process.env.VUE_APP_API_BASEURL + apiVersion + '/'

// 私有 - 按钮组 - 配置json
export const btns = [
  {name:'保存',type:'btn_save',style_self:'btn_n_drag',color:true},
  {name:'状态操作',type:'oper_status',style_self:'btn_y_drag',color:true,drag:[{ id: 1, name: '排期',type:'pq' }, { id: 2, name: '转派',type:'zp' }, { id: 3, name: '暂停',type:'zt' }]},
  {name:'提交',type:'oper_commit',style_self:'btn_y_drag',color:true,drag:[{ id: 1, name: '提交',type:'tj' }, { id: 2, name: '撤消',type:'cx' }]},
  {name:'审核',type:'oper_process',style_self:'btn_y_drag',color:true,drag:[{ id: 1, name: '通过',type:'tg' }, { id: 2, name: '驳回',type:'bh' }]},
  {name:'项目资料',type:'btn_info',style_self:'btn_n_drag',color:true,btn_type:'popup'},
  {name:'人员变更',type:'btn_person',style_self:'btn_n_drag',color:true,btn_type:'popup'}
]

// 私有 - 基础信息 - 配置json
export const baseInfos = [
  {label:'任务编码',type:'ipt_disable',value:'SCFX001',field:'sn'},
  {label:'任务名称',type:'ipt_disable',value:'SCFX001',field:'name'},
  {label:'任务负责人',type:'sel',value:null,field:'leader_user_id',list:[]},
  {label:'任务审核人',type:'sel',value:null,field:'reviewer_user_id',list:[]},
  {label:'业务状态',type:'ipt_disable',value:'SCFX001',field:'task_status_text'},
  {label:'任务审核状态',type:'ipt_disable',value:'SCFX001',field:'examine_status_text'},
  {label:'所属项目编号',type:'ipt_disable',value:'SCFX001',field:'project_id'},
  {label:'所属项目名称',type:'ipt_disable',value:'SCFX001',field:'project_name'},
  {label:'预计开始',type:'date',value:[],field:'plan_start_time_text'},
  {label:'预计完成',type:'date',value:[],field:'plan_end_time_text'},
  {label:'完成日期',type:'date_disable',value:[],field:'end_time_text'},
]

// 私有 表格 - 输出文件 - columns
export const tableColumns = [
  { type: 'checkbox', align: 'center', width: '50' },
  { type: 'index', field: 'index', title: '序号', width: '50', align: 'center' },
  { type: 'editable_ipt', field: 'name', title: '产品名称', width: '200', align: 'center' },
  { type: 'img_upload',field:'image',title:'产品图片',width:'100',align: 'center',upload_url:baseUrl + 'project/upload/file'},
  { type: 'editable_ipt', field: 'spu', title: '产品SPU', width: '200', align: 'center' },
  { type: 'editable_ipt', field: 'sku', title: '产品规格型号(SKU)', width: '200', align: 'center'},
  { type: 'router', field: 'links_qd_bom_text', title: '结构BOM清单', width: '120', align: 'center'},
  { type: 'router', field: 'links_bz_bom_text', title: '包装BOM清单', width: '120', align: 'center'},
  { type: 'editable_ipt', field: 'material', title: '产品材质', width: '100', align: 'center'},
  { type: 'editable_ipt', field: 'protocol', title: '协议', width: '100', align: 'center'},
  { type: 'editable_ipt', field: 'rate', title: '速率', width: '100', align: 'center'},
  { type: 'editable_sel', field: 'package', title: '包装', width: '100', align: 'center',beforeStr:'bz'},
  { type: 'editable_sel', field: 'safe', title: '安规', width: '100', align: 'center',beforeStr:'ag'},
  { type: 'editable_ipt', field: 'interface', title: '接口(输入)', width: '140', align: 'center'},
  { type: 'editable_ipt', field: 'other', title: '尺码/数量/长度', width: '160', align: 'center'},
  { type: 'editable_sel', field: 'color', title: '产品颜色', width: '100', align: 'center',beforeStr:'ys'},
  { type: 'editable_ipt', field: 'version', title: '功能/版本', width: '120', align: 'center'},
  { type: 'editable_ipt', field: 'output', title: '输出接口', width: '100', align: 'center'},
  { type: 'editable_ipt_integer', field: 'material_num', title: '备料数量', width: '100', align: 'center'},
  { type: 'editable_ipt_integer', field: 'order_num', title: '首批订单数量', width: '140', align: 'center'},
  { type: 'editable_ipt_float', field: 'mould_fare_sj', title: '模具费(塑胶)', width: '140', align: 'center'},
  { type: 'editable_ipt_float', field: 'mould_fare_wj', title: '模具费(五金)', width: '140', align: 'center'},
  { type: 'editable_ipt_float', field: 'electron_fare', title: '电子', width: '100', align: 'center'},
  { type: 'editable_ipt_float', field: 'structure_fare', title: '结构', width: '100', align: 'center'},
  { type: 'editable_ipt_float', field: 'line_fare', title: '线材', width: '100', align: 'center'},
  { type: 'editable_ipt_float', field: 'package_fare', title: '包材', width: '100', align: 'center'},
  { type: 'editable_ipt_float', field: 'parts_fare', title: '配件', width: '100', align: 'center'},
  { type: 'editable_ipt_float', field: 'process_fare', title: '加工费用', width: '100', align: 'center'},
  { type: 'editable_ipt_float', field: 'auth_test_fare', title: '认证/测试费用', width: '140', align: 'center'},
  { type: 'editable_ipt_float', field: 'total_cost', title: '总成本(未摊模具)', width: '160', align: 'center'},
  { type: 'editable_ipt_float', field: 'mould_cost', title: '含摊模具成本(工厂出厂成本)', width: '240', align: 'center'},
  { type: 'editable_ipt_float', field: 'tco_cost', title: 'TCO成本', width: '100', align: 'center'},
  { type: 'text_count', field: 'tco_rate', title: 'TCO毛利润率', width: '120', align: 'center',count:'tco_cost|-|mould_cost|/|tco_cost'},
  { type: 'editable_ipt_float', field: 'agent_price', title: '代理商价', width: '100', align: 'center'},
  { type: 'text_count', field: 'channel_rate', title: '渠道毛利润率', width: '120', align: 'center',count:'agent_price|-|tco_cost|/|agent_price'},
  { type: 'editable_ipt_float', field: 'distribution_price', title: '经销价', width: '100', align: 'center'},
  { type: 'text_count', field: 'distribution_rate', title: '经销商毛利率', width: '120', align: 'center',count:'min_retail_price|-|distribution_price|/|min_retail_price'},
  { type: 'editable_ipt_float', field: 'retail_price', title: '建议零售价', width: '120', align: 'center'},
  { type: 'editable_ipt_float', field: 'min_retail_price', title: '最低零售价', width: '120', align: 'center'},
  { type: 'text_count', field: 'b2c_rate', title: 'B2C毛利润率', width: '120', align: 'center',count:'min_retail_price|-|tco_cost|/|min_retail_price'}
]

// 私有 表格 - 输出文件 - 默认值
export const tableDefaultVal = []

// 私有 表格 - 输出文件 - 表头按钮 
export const tableHeaderBtns = [
  {name:'选择显示字段',type:'popup',style_self:'btn'},
  {name:'导入SKU',type:'import_sku',style_self:'btn'},
  {name:'导出SKU',type:'export_sku',style_self:'btn'},
  {name:'导入结构BOM表',type:'import_bom',style_self:'btn'},
  {name:'导出结构BOM表',type:'import_bom',style_self:'btn'},
  {name:'新增行',type:'add',style_self:'btn'},
  {name:'删除行',type:'del',style_self:'btn'}
]

// 私有 表格 - 发布会PPT - columns
export const tableColumns_c = [
  { type: 'text', field: 'title', title: '文件名称', width: '412', align: 'center' },
  { type: 'text', field: 'create_time', title: '上传时间', width: '412', align: 'center' },
  { type: 'operation',field:'operation',title:'操作',width:'412',align: 'center' },
  {type: 'editable_ipt',field: 'remark',title: '备注',width: '412',align: 'center'},
]

// 私有 表格 - 发布会PPT - 默认值
export const tableDefaultVal_c = []

// 私有 表格 - 发布会PPT - 表头按钮
export const tableHeaderBtns_c = [
  // {name:'下载模板',type:'download',style_self:'btn'},
  {name:'文件上传',type:'upload_file',style_self:'btn_upload',upload_url:baseUrl + 'project/upload/file'},
  {name:'填写共享盘链接',type:'write_links',style_self:'btn'}
]

export const _data = {
  // 按钮组
  topBtns:[],
  isShowDialog:false,
  isShowDialogIndex:1,
  title:'项目输出资料表',
  // 基础信息
  baseInfoList:[],
  // 表格 - 发布会PPT
  loading_c:false,
  isShowTitleIcon:true,
  table_title:'输出文件',
  table_title_ppt:'发布会PPT',
  listHeader_c:[],
  defaultRow_c:[],
  tableHeader_c:[],
  notShowCol_c:[],
  staticList_c:{},
  beforeStrList_c:[],
  tableHeigth_c:400,
  // 表格 - 规格定义表
  table_title_default:'规格定义表',
  listHeader:[],
  defaultRow:[],
  tableHeader:[],
  notShowCol:[],
  staticList:{},
  beforeStrList:['bz','ag','ys'],
  tableHeigth:400,
  // 共享盘链接
  writeLinksCode:'',
  linksTitle: '填写共享盘链接',
  isShowLinksDialog: false,
  isShowLinksDialogIndex: 1,
  // 公共弹窗
  LcSingleIndex: 1,
  isShowDialogBtns: false,
  dia_type: null,
  dia_label: '',
  dia_title: '',
  dia_list: [],
  btnTamplteList:[],
  // 备注
  remarks_title:'备注',
  remarks_vale:''
}