|
@@ -2,18 +2,21 @@ import BaseCurdEntry from './BaseCurdEntry'
|
|
|
import DataTimeRange from '@/utils/DataTimeRange'
|
|
|
import TagType from './TagType'
|
|
|
import TagPurchaseState from './TagPurchaseState'
|
|
|
+import Provider from './Provider'
|
|
|
|
|
|
import tagPurchaseApi from '@/api/TagPurchaseApi'
|
|
|
|
|
|
export default class TagPurchase extends BaseCurdEntry {
|
|
|
id
|
|
|
|
|
|
- dataTime
|
|
|
+ dataTime = new Date().format('YYYY/MM/DD')
|
|
|
get formatDataTime () {
|
|
|
return new Date(this.dataTime).format('YYYY-MM-DD')
|
|
|
}
|
|
|
|
|
|
- orderNo
|
|
|
+ orderNo = ''
|
|
|
+
|
|
|
+ providerId = ''
|
|
|
|
|
|
tagTypeId
|
|
|
get tagTypeName () {
|
|
@@ -28,15 +31,16 @@ export default class TagPurchase extends BaseCurdEntry {
|
|
|
return ''
|
|
|
}
|
|
|
|
|
|
- number
|
|
|
+ number = null
|
|
|
|
|
|
- amount
|
|
|
+ amount = null
|
|
|
|
|
|
buyerName
|
|
|
|
|
|
receiveDate
|
|
|
get formatReceiveDate () {
|
|
|
- return new Date(this.receiveDate).format('YYYY-MM-DD')
|
|
|
+ const { receiveDate } = this
|
|
|
+ return receiveDate ? new Date(receiveDate).format('YYYY-MM-DD') : ''
|
|
|
}
|
|
|
|
|
|
tagPurchaseStateId
|
|
@@ -52,6 +56,23 @@ export default class TagPurchase extends BaseCurdEntry {
|
|
|
return ''
|
|
|
}
|
|
|
|
|
|
+ constructor (editorInstance) {
|
|
|
+ super()
|
|
|
+ const { optionGroup } = editorInstance
|
|
|
+ const tagTypeConfig = optionGroup.TagType
|
|
|
+ const [ tagType ] = tagTypeConfig.list
|
|
|
+ if (tagType) {
|
|
|
+ this.tagTypeId = tagType[tagTypeConfig.Target.$$idProp]
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log(optionGroup)
|
|
|
+ const providerConfig = optionGroup.Provider
|
|
|
+ const [ provider ] = providerConfig.list
|
|
|
+ if (provider) {
|
|
|
+ this.providerId = provider[providerConfig.Target.$$idProp]
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
static get $$api () {
|
|
|
return tagPurchaseApi
|
|
|
}
|
|
@@ -68,15 +89,17 @@ export default class TagPurchase extends BaseCurdEntry {
|
|
|
|
|
|
static $$optionTargetConfigGroup = [
|
|
|
[{
|
|
|
- target: TagType
|
|
|
+ Target: TagType
|
|
|
}, {
|
|
|
- target: TagPurchaseState,
|
|
|
+ Target: TagPurchaseState,
|
|
|
setQuery: (options, query, Target) => {
|
|
|
const [ option ] = options
|
|
|
if (option) {
|
|
|
query.tagPurchaseStateId = option[Target.$$idProp]
|
|
|
}
|
|
|
}
|
|
|
+ }, {
|
|
|
+ Target: Provider
|
|
|
}]
|
|
|
]
|
|
|
|