feat: 工单列表和详情添加编号字段

This commit is contained in:
“怀磊”
2022-01-12 14:12:56 +08:00
committed by Jiangjie.Bai
parent f13bc4fccb
commit aa94c1792c
5 changed files with 55 additions and 34 deletions

View File

@@ -302,6 +302,7 @@
"Close": "关闭",
"Command filter": "命令过滤器",
"Comment": "备注",
"Number": "编号",
"Confirm": "确认",
"Create": "创建",
"CreatedBy": "创建者",

View File

@@ -289,6 +289,7 @@
"Close": "Close",
"Command filter": "Command filter",
"Comment": "Comment",
"Number": "Number",
"Confirm": "Confirm",
"Create": "Create",
"CreatedBy": "Created by",

View File

@@ -40,66 +40,73 @@ export default {
},
computed: {
detailCardItems() {
const obj = this.object || {}
return [
{
key: this.$t('common.Number'),
value: obj.serial_num
},
{
key: this.$t('tickets.status'),
value: this.object.status,
value: obj.status,
formatter: (item, val) => {
return <el-tag type={this.statusMap.type} size='mini'> { this.statusMap.title }</el-tag>
}
},
{
key: this.$t('tickets.type'),
value: this.object.type_display
value: obj.type_display
},
{
key: this.$t('tickets.user'),
value: this.object['applicant_display']
value: obj['applicant_display']
},
{
key: this.$t('tickets.OrgName'),
value: this.object['org_name']
value: obj['org_name']
},
{
key: this.$t('common.dateCreated'),
value: toSafeLocalDateStr(this.object.date_created)
value: toSafeLocalDateStr(obj.date_created)
},
{
key: this.$t('common.Comment'),
value: this.object.comment
value: obj.comment
}
]
},
specialCardItems() {
const meta = this.object.meta || {}
return [
{
key: this.$t('applications.appType'),
value: `${this.object.meta['apply_category_display']} / ${this.object.meta['apply_type_display']} `
value: `${meta['apply_category_display']} / ${meta['apply_type_display']} `
},
{
key: this.$t('applications.appName'),
value: this.object.meta.apply_applications_display.join(', ')
value: meta?.apply_applications_display?.join(', ') || ''
},
{
key: this.$t('tickets.SystemUser'),
value: this.object.meta.apply_system_users_display.join(', ')
value: meta?.apply_system_users_display?.join(', ') || ''
},
{
key: this.$t('common.dateStart'),
value: toSafeLocalDateStr(this.object.meta.apply_date_start)
value: toSafeLocalDateStr(meta.apply_date_start)
},
{
key: this.$t('common.dateExpired'),
value: toSafeLocalDateStr(this.object.meta.apply_date_expired)
value: toSafeLocalDateStr(meta.apply_date_expired)
}
]
},
assignedCardItems() {
const vm = this
const meta = this.object.meta || {}
return [
{
key: this.$t('tickets.PermissionName'),
value: this.object.meta.apply_permission_name,
value: meta.apply_permission_name,
formatter: function(item, value) {
const to = { name: 'ApplicationPermissionDetail', params: { id: vm.object.id }, query: { oid: vm.object.org_id }}
if (vm.object.status === 'closed' && vm.object.state === 'approved') {
@@ -111,19 +118,19 @@ export default {
},
{
key: this.$t('applications.appName'),
value: this.object.meta.apply_applications_display.join(', ')
value: meta?.apply_applications_display?.join(', ') || ''
},
{
key: this.$t('tickets.SystemUser'),
value: this.object.meta.apply_system_users_display.join(', ')
value: meta?.apply_system_users_display?.join(', ') || ''
},
{
key: this.$t('common.dateStart'),
value: toSafeLocalDateStr(this.object.meta.apply_date_start)
value: toSafeLocalDateStr(meta.apply_date_start)
},
{
key: this.$t('common.dateExpired'),
value: toSafeLocalDateStr(this.object.meta.apply_date_expired)
value: toSafeLocalDateStr(meta.apply_date_expired)
}
]
},

View File

@@ -38,66 +38,73 @@ export default {
},
computed: {
detailCardItems() {
const obj = this.object || {}
return [
{
key: this.$t('common.Number'),
value: obj.serial_num
},
{
key: this.$t('tickets.status'),
value: this.object.state,
value: obj.state,
formatter: (item, val) => {
return <el-tag type={this.statusMap.type} size='mini'> { this.statusMap.title }</el-tag>
}
},
{
key: this.$t('tickets.type'),
value: this.object.type_display
value: obj.type_display
},
{
key: this.$t('tickets.user'),
value: this.object['applicant_display']
value: obj['applicant_display']
},
{
key: this.$t('tickets.OrgName'),
value: this.object.org_name
value: obj.org_name
},
{
key: this.$t('common.dateCreated'),
value: toSafeLocalDateStr(this.object.date_created)
value: toSafeLocalDateStr(obj.date_created)
},
{
key: this.$t('common.Comment'),
value: this.object.comment
value: obj.comment
}
]
},
specialCardItems() {
const meta = this.object.meta || {}
return [
{
key: this.$t('perms.Node'),
value: this.object.meta.apply_nodes_display.join(', ')
value: meta?.apply_nodes_display?.join(', ') || ''
},
{
key: this.$t('tickets.Asset'),
value: this.object.meta.apply_assets_display.join(', ')
value: meta?.apply_assets_display?.join(', ') || ''
},
{
key: this.$t('tickets.SystemUser'),
value: this.object.meta.apply_system_users_display.join(', ')
value: meta?.apply_system_users_display?.join(', ') || ''
},
{
key: this.$t('assets.Action'),
value: forMatAction(this, this.object.meta['apply_actions_display'])
value: forMatAction(this, meta['apply_actions_display'])
},
{
key: this.$t('common.dateStart'),
value: toSafeLocalDateStr(this.object.meta.apply_date_start)
value: toSafeLocalDateStr(meta.apply_date_start)
},
{
key: this.$t('common.dateExpired'),
value: toSafeLocalDateStr(this.object.meta.apply_date_expired)
value: toSafeLocalDateStr(meta.apply_date_expired)
}
]
},
assignedCardItems() {
const vm = this
const meta = this.object.meta || {}
return [
{
key: this.$t('tickets.PermissionName'),
@@ -113,27 +120,27 @@ export default {
},
{
key: this.$t('perms.Node'),
value: this.object.meta.apply_nodes_display.join(', ')
value: meta?.apply_nodes_display?.join(', ') || ''
},
{
key: this.$t('assets.Asset'),
value: this.object.meta.apply_assets_display.join(', ')
value: meta?.apply_assets_display?.join(', ') || ''
},
{
key: this.$t('tickets.SystemUser'),
value: this.object.meta.apply_system_users_display.join(', ')
value: meta?.apply_system_users_display?.join(', ') || ''
},
{
key: this.$t('assets.Action'),
value: forMatAction(this, this.object.meta['apply_actions_display'])
value: forMatAction(this, meta['apply_actions_display'])
},
{
key: this.$t('common.dateStart'),
value: toSafeLocalDateStr(this.object.meta.apply_date_start)
value: toSafeLocalDateStr(meta?.apply_date_start)
},
{
key: this.$t('common.dateExpired'),
value: toSafeLocalDateStr(this.object.meta.apply_date_expired)
value: toSafeLocalDateStr(meta?.apply_date_expired)
}
]
},

View File

@@ -26,6 +26,11 @@ export default {
ticketTableConfig: {
url: this.url,
columns: [
{
prop: 'serial_num',
label: this.$t('common.Number'),
sortable: 'custom'
},
{
prop: 'title',
label: this.$t('tickets.title'),