TagApply.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import BaseCurdEntry from './BaseCurdEntry'
  2. import DataTimeRange from '@/utils/DataTimeRange'
  3. import TagApplyState from './TagApplyState'
  4. import tagApplyApi from '@/api/tagApplyApi'
  5. export default class TagApply extends BaseCurdEntry {
  6. id
  7. dataTime
  8. get formatDataTime () {
  9. return new Date(this.dataTime).format('YYYY-MM-DD')
  10. }
  11. orderNo
  12. expectedReceiptDate
  13. get formatExpectedReceiptDate () {
  14. return new Date(this.expectedReceiptDate).format('YYYY-MM-DD')
  15. }
  16. providerName
  17. tagTypeName
  18. number
  19. amount
  20. tagApplyStateId
  21. get tagApplyStateName () {
  22. const config = TagApply.$$optionData.TagApplyState
  23. if (config) {
  24. const option = config.map[this.tagApplyStateId]
  25. if (option) {
  26. return option[TagApplyState.$$nameProp]
  27. }
  28. }
  29. return ''
  30. }
  31. operatorName
  32. applicantName
  33. unitPrice
  34. createTime
  35. get formatCreateTime () {
  36. return new Date(this.createTime).format('YYYY-MM-DD')
  37. }
  38. get subtotal () {
  39. return this.amount
  40. }
  41. static get $$api () {
  42. return tagApplyApi
  43. }
  44. static $$getQuery = () => ({
  45. ...(new DataTimeRange({
  46. unit: 'Date',
  47. diff: 7,
  48. offset: 0
  49. })),
  50. providerName: '',
  51. tagApplyStateId: '',
  52. order: [['dataTime', 'DESC']]
  53. })
  54. static $$optionTargetConfigGroup = [
  55. [{
  56. target: TagApplyState,
  57. getQuery: () => ({})
  58. }]
  59. ]
  60. static $$optionData = {}
  61. }