data.js 4.14 KB
const commodityObj = {
  searchFormData: [
    {
      label: '商品名称',
      name: 'goodsName',
      type: 'input',
      isClear: true,
      maxlength: 50
    },
    {
      label: '商品编码',
      name: 'type',
      type: 'input',
      isClear: true,
      maxlength: 50
    },
    {
      label: '使用门店',
      name: 'merchantIdList',
      type: 'select',
      optionList: [],
      optionId: 'merchantId',
      optionLabel: 'merchantName',
      optionsName: 'merchantList'
    },
    {
      label: '所属系列',
      name: 'goodsCode',
      type: 'select',
      optionList: [],
      optionId: 'goodsCode',
      optionLabel: 'goodsName',
      optionsName: 'goodsSeriesList'
    },
    {
      label: '产品类型',
      name: 'goodsType',
      type: 'select',
      optionList: [],
      optionId: 'confId',
      optionLabel: 'confValue',
      optionsName: 'typeList'
    }
  ]
}
const editCommodityObj = {
  editRule: {
    goodsName: [{ required: true, message: '请输入商品名称', trigger: 'change' }],
    goodsCode: [{ 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' }],
    // warningValueMax: [{ required: true, message: '请输入库存预警上限', trigger: 'change' }],
    merchantList: [{ required: true, message: '请选择门店', trigger: 'change' }],
    warrantyPeriod: [{ required: true, message: '请输入质保年限', trigger: 'change' }]
  },
  editFormData: [
    {
      label: '商品名称',
      name: 'goodsName',
      type: 'input',
      maxlength: 50
    },
    {
      label: '商品编码',
      name: 'type',
      type: 'input',
      maxlength: 50
    },
    {
      label: '所属系列',
      name: 'goodsCode',
      type: 'select',
      optionList: [],
      optionId: 'goodsCode',
      optionLabel: 'goodsName',
      optionsName: 'goodsSeriesList',
      changeAttr: function(val, targetItem, that) {
        let labeList = ['产品类型','质保年限']
        let txt = targetItem.optionList.find(k => k.goodsCode == val)?.goodsName || ''
        that.changeFormAttr('editFormData', 'isHide', labeList, txt != '太阳膜')
        if (val != '1') {
          that.editForm.baseProductFlag = 'N'
          that.editForm.upgradeProductFlag = 'Y'
          that.handleCheckChange('Y', 'upgradeProductFlag')
          that.handleCheckChange('N', 'baseProductFlag')
        }
      }
    },
    {
      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'
    },
    {
      label: '库存上限预警/件',
      name: 'warningValueMax',
      type: 'input'
    },
    {
      label: '质保年限',
      name: 'warrantyPeriod',
      type: 'input',
      isHide: true
    }
  ],

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

export default {
  commodityObj,
  editCommodityObj
}