update 权限申请流程
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<div class="table-operator">
|
||||
<!-- 新增 -->
|
||||
<a-button icon="plus" type="primary" @click="handleAdd" v-has="'enterpriseStandard:add'">{{ $t('newlyAdded') }}</a-button>
|
||||
<a-button icon="plus" type="primary" @click="handleAdd">{{ $t('newlyAdded') }}</a-button>
|
||||
</div>
|
||||
<div>
|
||||
<j-table
|
||||
@@ -11,75 +11,35 @@
|
||||
:dataSource="dataSource"
|
||||
:can-drag="true"
|
||||
rowKey="id"
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||
:pagination="ipagination"
|
||||
:row-selection="null"
|
||||
:pagination="false"
|
||||
:scroll="{x: '100%'}"
|
||||
@change="tableOnChange">
|
||||
|
||||
<!-- 企标号、企标名称 -->
|
||||
<template v-slot:standard="{text, record}">
|
||||
<a-tooltip overlay-class-name="tooltip-style">
|
||||
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
|
||||
<a class="table-text can-click-table-text" @click="detailClick(record)" v-if="(text || text === 0) && record.detailFlag">{{ text }}</a>
|
||||
<div class="table-text" v-else-if="(text || text === 0) && !record.detailFlag">{{ text }}</div>
|
||||
<div class="table-text" v-else>{{ global.emptyLine }}</div>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
|
||||
<!-- 操作 -->
|
||||
<template slot="action" slot-scope="{text, record, index}">
|
||||
<a @click="handleDelete(record, index)" >{{ $t('delete') }}</a>
|
||||
<a @click="handleDelete(index)" >{{ $t('delete') }}</a>
|
||||
</template>
|
||||
|
||||
</j-table>
|
||||
</div>
|
||||
<standard-selection v-show="false" ref="standardSelection" @change="changeStandardSelect"/>
|
||||
<standard-selection v-show="false" :source="StandardSource.ENTERPRISE.value" disabledSourceSearch ref="standardSelection" :excludeStandardNumbers="excludeStandardNumbers" @listChange="changeStandardSelect"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { JeroListMixin } from '@/mixins/JeroListMixin'
|
||||
import JTable from '@comp/jero/JTable'
|
||||
import StandardSelection from '@comp/selection/StandardSelection'
|
||||
import { StandardSource } from '@/enums/commonEnums'
|
||||
|
||||
export default {
|
||||
name: 'BaseInfoTable',
|
||||
components: { StandardSelection, JTable },
|
||||
mixins: [JeroListMixin],
|
||||
data () {
|
||||
return {
|
||||
url: {
|
||||
list: ''
|
||||
},
|
||||
StandardSource,
|
||||
model: {},
|
||||
dataSource: [
|
||||
{
|
||||
id: 1,
|
||||
inspectionBasisStandardName: '123',
|
||||
inspectionBasisStandardNumber: '123',
|
||||
detailFlag: true,
|
||||
departOpinion: '123',
|
||||
mainDutyStandardizationGroup: '1699358097292472322'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
inspectionBasisStandardName: 'qaaa',
|
||||
inspectionBasisStandardNumber: '12asdasdas3',
|
||||
detailFlag: true,
|
||||
departOpinion: '123',
|
||||
opinion: [],
|
||||
mainDutyStandardizationGroup: '1699358097292472322'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
inspectionBasisStandardName: '123',
|
||||
inspectionBasisStandardNumber: '123',
|
||||
detailFlag: true,
|
||||
departOpinion: '123',
|
||||
userId: 'e9ca23d68d884d4ebb19d07889727dae'
|
||||
// mainDutyStandardizationGroup: '1699358097292472322'
|
||||
}
|
||||
],
|
||||
dataSource: [],
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('serialNumber'),
|
||||
@@ -95,21 +55,20 @@ export default {
|
||||
title: this.$t('workCenter.esInspectionPlan.inspectionBasisStandardNumber'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'inspectionBasisStandardNumber',
|
||||
scopedSlots: { customRender: 'standard' }
|
||||
dataIndex: 'standardName',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{ // 企标名称
|
||||
title: this.$t('workCenter.esInspectionPlan.inspectionBasisStandardName'),
|
||||
align: 'center',
|
||||
width: 180,
|
||||
dataIndex: 'inspectionBasisStandardName',
|
||||
scopedSlots: { customRender: 'standard' }
|
||||
dataIndex: 'standardNumber',
|
||||
scopedSlots: { customRender: 'text' }
|
||||
},
|
||||
{
|
||||
// 操作
|
||||
fixed: 'right',
|
||||
title: this.$t('operation'),
|
||||
// dataIndex: 'action',
|
||||
dataIndex: 'action',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
scopedSlots: { customRender: 'action' }
|
||||
@@ -117,13 +76,34 @@ export default {
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 已选的标准编号
|
||||
excludeStandardNumbers () {
|
||||
return this.dataSource.map(item => item.standardNumber).join(',')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 回显表格数据
|
||||
setData (data) {
|
||||
this.dataSource = data
|
||||
},
|
||||
// 新增
|
||||
handleAdd () {
|
||||
this.$refs.standardSelection.standardClick()
|
||||
},
|
||||
// 删除
|
||||
handleDelete (index) {
|
||||
this.$confirm({
|
||||
title: this.$t('confirmDeletion'),
|
||||
content: this.$t('areYouSure'),
|
||||
onOk: () => {
|
||||
this.dataSource.splice(index, 1)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 添加标准回调
|
||||
changeStandardSelect (val) {
|
||||
console.log(val)
|
||||
this.dataSource = [...this.dataSource, ...val]
|
||||
},
|
||||
// 跳转详情
|
||||
detailClick (record) {
|
||||
@@ -140,8 +120,9 @@ export default {
|
||||
this.ipagination = pagination
|
||||
this.getTableList()
|
||||
},
|
||||
getIds () {
|
||||
return this.dataSource.map(item => item.id).join(',')
|
||||
// 获取所有标准号
|
||||
getStandardNumbers () {
|
||||
return this.dataSource.map(item => item.standardNumber).join(',')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user