data.js 4.83 KB
const commodityObj = {
  searchFormData: [
    {
      label: '商品名称',
      name: 'goodsName',
      type: 'input',
      isClear: true,
      maxlength: 50
    },
    {
      label: '商品编码',
      name: 'goodsType',
      type: 'input',
      isClear: true,
      maxlength: 50
    },
    {
      label: '使用门店',
      name: 'merchantIdList',
      type: 'select',
      optionList: [],
      optionId: 'categoryType',
      optionLabel: 'categoryName',
      optionsName: 'productTypeList'
    },
    {
      label: '所属系列',
      name: 'goodsSeries',
      type: 'select',
      optionList: [],
      optionId: 'categoryType',
      optionLabel: 'categoryName',
      optionsName: 'goodsSeriesList'
    },
    {
      label: '产品类型',
      name: 'status',
      type: 'select',
      optionList: [],
      optionId: 'confId',
      optionLabel: 'confValue',
      optionsName: 'statusList'
    }
  ],

  tableParams: {
    btnId: new Date().getTime() + parseInt(Math.random() * 1000),
    listName: 'list',
    tableOption: {
      width: '170'
    },
    tableColumns: [
      {
        label: '商品名称',
        prop: 'goodsName',
        width: '200'
      },
      {
        label: '商品编码',
        prop: 'goodsType',
        width: '110'
      },
      {
        label: '所属系列',
        prop: 'goodsSeries',
        width: '100'
      },
      {
        label: '产品类型',
        prop: ''
      },
      {
        label: '售价/元',
        prop: 'sellPrice'
      },
      {
        label: '最低售价/元',
        prop: 'minSellPrice'
      },
      {
        label: '赠送成本',
        prop: 'giftCost'
      },
      {
        label: '产品成本',
        prop: 'productCost'
      },
      {
        label: '使用门店',
        prop: ''
      },
      {
        label: '创建日期',
        prop: 'createDateStr',
        width: '155px'
      }
      // {
      //   label: '更新日期',
      //   prop: 'updatedDate',
      //   width: '155px'
      //   // formatter: cellValue => {
      //   //   return cellValue.updatedDate ? Util.dateFormate(cellValue.updatedDate, 'YYYY-MM-DD HH:mm:ss') : ''
      //   // }
      // }
    ]
  }
}
const editCommodityObj = {
  editRule: {
    goodsName: [{ required: true, message: '请输入商品名称', trigger: 'change' }],
    goodsSeries: [{ required: true, message: '请选择所属系列', trigger: 'change' }],
    sellPrice: [{ required: true, message: '请输入售价', trigger: 'change' }],
    minSellPrice: [{ required: true, message: '请输入最低售价', trigger: 'change' }],
    giftCost: [{ required: true, message: '请输入赠送成本', trigger: 'change' }],
    productCost: [{ required: true, message: '请输入产品成本', trigger: 'change' }],
    warningValue: [{ required: true, message: '请输入库存预警', trigger: 'change' }],
    merchantList: [{ required: true, message: '请选择门店', trigger: 'change' }]
  },
  editFormData: [
    {
      label: '商品名称',
      name: 'goodsName',
      type: 'input',
      maxlength: 50
    },
    {
      label: '商品编码',
      name: 'goodsType',
      type: 'input',
      maxlength: 50
    },
    {
      label: '所属系列',
      name: 'goodsSeries',
      type: 'select',
      optionList: [],
      optionId: 'confId',
      optionLabel: 'confName',
      optionsName: 'goodsSeriesList',
      changeAttr: function(val, targetItem, that) {
        let labeList = ['产品类型']
        that.changeFormAttr('editFormData', 'isHide', labeList, val != '1')
        if (val != '1') {
          that.editForm.baseProductFlag = 'N'
          that.editForm.upgradeProductFlag = 'Y'
          that.handleCheckChange('Y', 'upgradeProductFlag')
        }
      }
    },
    {
      label: '产品类型',
      name: '',
      type: 'slot',
      addHtml: 'productFlag',
      isHide: true,
      tips: '说明:基础产品应用于客户战败(不升级)订单中,升级产品应用于客户升级订单中'
    },
    {
      label: '售价/元',
      name: 'sellPrice',
      type: 'input',
      isHide: true
    },
    {
      label: '最低售价/元',
      name: 'minSellPrice',
      type: 'input',
      isHide: true
    },
    {
      label: '赠送成本/元',
      name: 'giftCost',
      type: 'input',
      isHide: true
    },
    {
      label: '产品成本/元',
      name: 'productCost',
      type: 'input',
      isHide: true
    },
    {
      label: '库存预警',
      name: 'warningValue',
      type: 'input'
    }
  ],

  merchantEditFormData: [
    // {
    //   label: '使用门店列表',
    //   name: 'merchantList',
    //   addHtml: 'selectMerchant',
    //   style: {
    //     'margin-bottom': '10px'
    //   }
    // },
    {
      // label: '',
      name: '',
      addHtml: 'merchantTable'
    }
  ]
}

export default {
  commodityObj,
  editCommodityObj
}