123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878 |
- import { isSpecialSymbol, hasSpace } from '@/utils/validate'
- // 是否定制
- const options1 = [
- { id: '0', name: '否' },
- { id: '1', name: '是' }
- ]
- // 专属类型
- const options2 = [
- { id: '0', name: '非泰康' },
- { id: '1', name: '泰康' }
- ]
- // 销售权限
- const options3 = [
- { id: '0', name: '无销售权限' },
- { id: '1', name: '有销售权限' }
- ]
- // 是否库存品
- const options4 = [
- { id: '0', name: '非库存品' },
- { id: '1', name: '库存品' }
- ]
- // 是否启用实时金价
- const options5 = [
- { id: '0', name: '否' },
- { id: '1', name: '是' }
- ]
- // 供货区域
- const options6 = [
- { id: '1', name: '全国' },
- { id: '2', name: '全国除偏远' }
- ]
- // 是否启用阶梯
- const options7 = [
- { id: '0', name: '否' },
- { id: '1', name: '是' }
- ]
- // 有无工差
- const options8 = [
- { id: '0', name: '无工差' },
- { id: '1', name: '有工差' }
- ]
- // 配置要求
- const options9 = ['证书', '包装盒', '绒布袋', '标签', '其他']
- const listCol = [
- { type: 'selection', fixed: 'left', _noset_: true },
- {
- prop: 'spuCode',
- label: '编号',
- width: '160px'
- },
- {
- prop: 'good_thumb_img',
- label: '图片',
- _slot_: 'good_thumb_img',
- width: '45px'
- },
- {
- prop: 'good_name',
- label: '名称',
- 'min-width': '160px'
- },
- {
- prop: 'cat_name',
- label: '分类'
- },
- {
- prop: 'brand_name',
- label: '品牌'
- },
- {
- prop: "create_source",
- label: "来源",
- _slot_: "create_source",
- width: '110px'
- },
- {
- prop: 'is_stock',
- label: '库存类型',
- _slot_: 'is_stock',
- width: '85px'
- },
- {
- prop: 'is_combind',
- label: '组合类型',
- width: '95px',
- _slot_: 'is_combind'
- },
- {
- prop: 'isonline',
- label: '是否上线',
- _slot_: 'isonline',
- width: '70px'
- },
- {
- prop: 'status',
- label: '状态',
- _slot_: 'status',
- width: '118px'
- },
- {
- prop: 'supplierNo',
- label: '供应商编号',
- width: '110px'
- },
- {
- prop: 'supplier_name',
- label: '供应商名称',
- width: '110px'
- },
- {
- prop: 'companyNo',
- label: '业务公司编号',
- width: '110px'
- },
- {
- prop: 'company',
- label: '业务公司名称',
- width: '110px'
- },
- {
- prop: 'charger_company_name',
- label: '负责人部门',
- minWidth: '150px'
- },
- // {
- // prop: 'charger',
- // label: '负责人',
- // width: '70px'
- // },
- {
- prop: 'creater',
- label: '创建人',
- width: '70px'
- },
- {
- prop: 'addtime',
- label: '创建时间',
- width: '140px'
- },
- {
- prop: '',
- label: '操作',
- fixed: 'right',
- _noset_: true,
- width: '200px',
- _slot_: 'operation'
- }
- ]
- const validate_num = (rule, value, callback) => {
- const { required } = rule
- if (required && value === '') {
- callback(new Error('不能为空!'))
- } else {
- callback()
- }
- }
- const validate_num_0 = (rule, value, callback) => {
- const { required } = rule
- if (required && value === '') {
- callback(new Error('不能为空!'))
- } else if (
- required &&
- (value === '0' ||
- value === '0.' ||
- value === '0.0' ||
- value === '0.00' ||
- value === '0.000')
- ) {
- callback(new Error('不能为零!'))
- } else {
- callback()
- }
- }
- const validate_good_img = (rule, value, callback) => {
- const { required } = rule
- if (required && value.length == 0) {
- callback(new Error('请上传商品主图!'))
- } else if (required && (value.length < 3 || value.length > 10)) {
- callback(new Error('商品主图应为3~10张!'))
- } else {
- callback()
- }
- }
- const validate_desc = (rule, value, callback) => {
- const { required } = rule
- if (required && value.length == 0) {
- callback(new Error('不能为空!'))
- } else if (isSpecialSymbol(value)) {
- callback(new Error('不能使用英文特殊字符!'))
- } else {
- callback()
- }
- }
- const validate_good_name = (rule, value, callback) => {
- const { required } = rule
- if (required && value.length == 0) {
- callback(new Error('不能为空!'))
- } else if (hasSpace(value)) {
- callback(new Error('系统不允许输入转义字符,请检查后重新输入!'))
- } else if (isSpecialSymbol(value)) {
- callback(new Error('不能使用英文特殊字符!'))
- } else {
- callback()
- }
- }
- const rules = {
- cat_id: [
- {
- type: 'array',
- required: true,
- message: '请选择商品分类',
- trigger: 'change'
- }
- ],
- is_combind: [
- {
- required: true,
- message: '请选择组合类型',
- trigger: 'change'
- }
- ],
- brandid: [
- {
- type: 'array',
- required: true,
- message: '请选择商品品牌',
- trigger: 'change'
- }
- ],
- noble_weight: [
- {
- required: true,
- validator: validate_num_0,
- trigger: 'blur'
- }
- ],
- weight: [
- {
- required: true,
- validator: validate_num,
- trigger: 'blur'
- }
- ],
- good_type: [
- {
- required: true,
- message: '请选择是否定制',
- trigger: 'change'
- }
- ],
- is_stock: [
- {
- required: true,
- message: '请选择是否库存品',
- trigger: 'change'
- }
- ],
- company_id: [
- {
- required: true,
- message: '请选择业务公司',
- trigger: 'change'
- }
- ],
- supplierNo: [
- {
- type: 'array',
- required: true,
- message: '请选择供应商',
- trigger: 'change'
- }
- ],
- is_auth: [
- {
- required: true,
- message: '请选择是否有权限销售',
- trigger: 'change'
- }
- ],
- tax: [
- {
- required: true,
- message: '请选择税率',
- trigger: 'change'
- }
- ],
- good_name: [
- {
- required: true,
- validator: validate_good_name,
- trigger: 'blur'
- }
- ],
- unit: [
- {
- type: 'array',
- required: true,
- message: '请输入商品单位',
- trigger: 'blur'
- }
- ],
- is_exclusive: [
- {
- required: true,
- type: 'array',
- message: '请选择专属类型',
- trigger: 'change'
- }
- ],
- noble_metal: [
- {
- required: true,
- message: '请选择贵金属种类',
- trigger: 'change'
- }
- ],
- is_gold_price: [
- {
- required: true,
- message: '请选择是否启用实时金价',
- trigger: 'change'
- }
- ],
- moq: [
- {
- required: true,
- validator: validate_num,
- trigger: 'blur'
- }
- ],
- stock_moq: [
- {
- required: true,
- validator: validate_num_0,
- trigger: 'blur'
- }
- ],
- customized: [
- {
- required: true,
- validator: validate_num,
- trigger: 'blur'
- }
- ],
- after_sales: [
- {
- required: true,
- message: '售后说明不能为空',
- trigger: 'blur'
- },
- {
- required: true,
- validator: validate_desc,
- trigger: 'blur'
- }
- ],
- // isSpecialSymbol
- good_remark: [
- {
- required: true,
- message: '商品备注不能为空',
- trigger: 'blur'
- },
- {
- required: true,
- validator: validate_desc,
- trigger: 'blur'
- }
- ],
- // 包装/发货/图片
- packing_list: [
- {
- required: true,
- message: '请输入包装清单',
- trigger: 'blur'
- }
- ],
- packing_way: [
- {
- required: true,
- message: '请输入包装方式',
- trigger: 'blur'
- }
- ],
- packing_spec: [
- {
- required: true,
- message: '请输入装箱规格',
- trigger: 'blur'
- }
- ],
- packing_weight: [
- {
- required: true,
- message: '请输入装箱重量',
- trigger: 'blur'
- }
- ],
- packing_szie: [
- {
- required: true,
- message: '请输入装箱尺寸',
- trigger: 'blur'
- }
- ],
- supply_area: [
- {
- required: true,
- message: '请选择供货区域',
- trigger: 'change'
- }
- ],
- delivery_place: [
- {
- type: 'array',
- required: true,
- message: '请选择发货地',
- trigger: 'change'
- }
- ],
- origin_place: [
- {
- type: 'array',
- required: true,
- message: '请选择产地',
- trigger: 'change'
- }
- ],
- delivery_day: [
- {
- required: true,
- message: '请输入物流时间',
- trigger: 'blur'
- }
- ],
- lead_time: [
- {
- required: true,
- message: '请输入供货周期',
- trigger: 'blur'
- }
- ],
- sample_day: [
- {
- required: true,
- message: '请输入调样周期',
- trigger: 'blur'
- }
- ],
- packing_size: [
- {
- required: true,
- message: '请输入装箱尺寸',
- trigger: 'blur'
- }
- ],
- good_size: [
- {
- required: true,
- message: '请输入商品尺寸',
- trigger: 'blur'
- }
- ],
- good_thumb_img: [
- {
- required: true,
- message: '请上传商品缩略图',
- trigger: 'change'
- }
- ],
- good_img: [
- {
- type: 'array',
- required: true,
- validator: validate_good_img,
- trigger: 'change'
- }
- ],
- good_info_img: [
- {
- type: 'array',
- required: true,
- message: '至少上传一张商品详情介绍图',
- trigger: 'change'
- }
- ],
- demo_fee: [
- {
- required: true,
- validator: validate_num,
- trigger: 'blur'
- }
- ],
- is_diff: [
- {
- required: true,
- message: '请选择有无工差',
- trigger: 'change'
- }
- ],
- config: [
- {
- required: true,
- type: 'array',
- message: '请选择配置要求',
- trigger: 'change'
- }
- ],
- other_config: [
- {
- required: true,
- message: '其他要求不能为空',
- trigger: 'blur'
- }
- ],
- open_fee: [
- {
- required: true,
- validator: validate_num,
- trigger: 'blur'
- }
- ],
- sample_fee: [
- {
- required: true,
- validator: validate_num,
- trigger: 'blur'
- }
- ],
- market_price: [
- {
- required: true,
- validator: validate_num,
- trigger: 'blur'
- }
- ],
- cgd_gold_price: [
- {
- required: true,
- validator: validate_num,
- trigger: 'blur'
- }
- ],
- craft_desc: [
- {
- required: false,
- validator: validate_desc,
- trigger: 'blur'
- }
- ]
- }
- const basicColumns = [
- {
- prop: 'cat_info',
- label: '商品分类',
- span: 8,
- _slot_: 'cat_info'
- },
- {
- prop: 'good_img',
- label: '商品主图',
- _slot_: 'good_img',
- span: 8
- },
- {
- prop: 'good_info_img',
- _slot_: 'good_info_img',
- label: '详情介绍',
- span: 8
- },
- {
- prop: 'good_name',
- label: '商品名称',
- _slot_: 'good_name',
- span: 24
- },
- {
- prop: 'companyName',
- label: '业务公司',
- span: 12
- },
- {
- prop: 'supplierName',
- label: '供应商',
- span: 12
- },
- {
- prop: 'brand_name',
- label: '商品品牌',
- span: 6
- },
- {
- prop: 'is_auth',
- label: '销售权限',
- _slot_: 'is_auth',
- span: 6
- },
- {
- prop: 'unit',
- label: '单位',
- span: 6
- },
- {
- prop: 'tax',
- label: '税点',
- _slot_: 'tax',
- span: 6
- },
- {
- prop: 'is_exclusive',
- label: '专属类型',
- _slot_: 'is_exclusive',
- span: 6
- },
- {
- prop: 'weight',
- label: '商品总重量',
- _slot_: 'weight',
- span: 6
- },
- {
- prop: 'is_stock',
- label: '是否库存品',
- _slot_: 'is_stock',
- span: 6
- },
- {
- prop: 'is_combind',
- label: '组合类型',
- _slot_: 'is_combind',
- span: 6
- },
- {
- prop: 'noble',
- _slot_: 'noble',
- label: '贵金属信息',
- span: 18
- },
- {
- label: '来源',
- prop: 'create_source',
- _slot_: 'create_source',
- span: 6
- },
- {
- prop: 'after_sales',
- label: '售后说明',
- span: 24
- },
- {
- prop: 'good_remark',
- label: '商品备注',
- span: 24
- },
- {
- prop: 'craft_desc',
- label: '工艺说明',
- span: 24
- },
- {
- prop: 'packing_way',
- label: '包装方式',
- span: 6
- },
- {
- prop: 'packing_spec',
- label: '装箱规格',
- span: 6
- },
- {
- prop: 'packing_weight',
- label: '装箱重量',
- _slot_: 'packing_weight',
- span: 6
- },
- {
- prop: 'packing_size',
- label: '装箱尺寸',
- span: 6
- },
- {
- prop: 'good_size',
- label: '装箱尺寸',
- span: 6
- },
- {
- prop: 'good_bar',
- label: '商品条形码',
- span: 6
- },
- {
- prop: 'packing_list',
- label: '商品清单',
- span: 12
- },
- {
- prop: 'packing_spec',
- label: '供货区域',
- _slot_: 'packing_spec',
- span: 6
- },
- {
- prop: 'delivery_day',
- label: '物流天数',
- _slot_: 'delivery_day',
- span: 6
- },
- {
- prop: 'lead_time',
- label: '供货周期',
- _slot_: 'lead_time',
- span: 6
- },
- {
- prop: 'sample_day',
- label: '调样周期',
- _slot_: 'sample_day',
- span: 6
- },
- {
- prop: 'delivery_place',
- label: '发货地',
- span: 12,
- _slot_: 'delivery_place'
- },
- {
- prop: 'origin_place',
- label: '产地',
- span: 12,
- _slot_: 'origin_place'
- }
- ]
- const packingColumns = [
- {
- prop: 'packing_way',
- label: '包装方式',
- span: 6
- },
- {
- prop: 'packing_spec',
- label: '装箱规格',
- span: 6
- },
- {
- prop: 'packing_weight',
- label: '装箱重量',
- _slot_: 'packing_weight',
- span: 6
- },
- {
- prop: 'packing_size',
- label: '装箱尺寸',
- span: 6
- },
- {
- prop: 'good_size',
- label: '装箱尺寸',
- span: 6
- },
- {
- prop: 'good_bar',
- label: '商品条形码',
- span: 6
- },
- {
- prop: 'packing_list',
- label: '商品清单',
- span: 12
- }
- ]
- const sendColumns = [
- {
- prop: 'packing_spec',
- label: '供货区域',
- span: 6
- },
- {
- prop: 'delivery_day',
- label: '物流天数',
- _slot_: 'delivery_day',
- span: 6
- },
- {
- prop: 'lead_time',
- label: '供货周期',
- _slot_: 'lead_time',
- span: 6
- },
- {
- prop: 'sample_day',
- label: '调样周期',
- _slot_: 'sample_day',
- span: 6
- },
- {
- prop: 'delivery_place',
- label: '发货地',
- span: 12,
- _slot_: 'delivery_place'
- },
- {
- prop: 'origin_place',
- label: '产地',
- span: 12,
- _slot_: 'origin_place'
- }
- ]
- const imageColumns = [
- {
- prop: 'good_thumb_img',
- label: '图片缩略',
- _slot_: 'good_thumb_img',
- span: 6
- }
- ]
- const ladderColumns = [
- {
- prop: 'demo_fee',
- label: '打样费',
- _slot_: 'demo_fee',
- span: 6
- },
- {
- prop: 'open_fee',
- label: '开模费',
- _slot_: 'open_fee',
- span: 6
- },
- {
- prop: 'sample_fee',
- _slot_: 'sample_fee',
- label: '调样费',
- span: 6
- },
- {
- prop: 'market_price',
- _slot_: 'market_price',
- label: '市场价',
- span: 6
- },
- {
- prop: 'data_table',
- label: '阶梯成本',
- _slot_: 'data_table',
- span: 24
- }
- ]
- export {
- options1,
- options2,
- options3,
- options4,
- options5,
- options6,
- options7,
- options8,
- options9,
- listCol,
- rules,
- sendColumns,
- imageColumns,
- basicColumns,
- ladderColumns,
- packingColumns
- }
|