import BaseCurdEntry from './BaseCurdEntry' import DataTimeRange from '@/utils/DataTimeRange' import TagApplyState from './TagApplyState' import tagApplyApi from '@/api/tagApplyApi' export default class TagApply extends BaseCurdEntry { id dataTime get formatDataTime () { return new Date(this.dataTime).format('YYYY-MM-DD') } orderNo expectedReceiptDate get formatExpectedReceiptDate () { return new Date(this.expectedReceiptDate).format('YYYY-MM-DD') } providerName tagTypeName number amount tagApplyStateId get tagApplyStateName () { const config = TagApply.$$optionData.TagApplyState if (config) { const option = config.map[this.tagApplyStateId] if (option) { return option[TagApplyState.$$nameProp] } } return '' } operatorName applicantName unitPrice createTime get formatCreateTime () { return new Date(this.createTime).format('YYYY-MM-DD') } get subtotal () { return this.amount } static get $$api () { return tagApplyApi } static $$getQuery = () => ({ ...(new DataTimeRange({ unit: 'Date', diff: 7, offset: 0 })), providerName: '', tagApplyStateId: '', order: [['dataTime', 'DESC']] }) static $$optionTargetConfigGroup = [ [{ target: TagApplyState, getQuery: () => ({}) }] ] static $$optionData = {} }