| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- <template>
- <div>
- <user-search @search="reload" ref="searchRef"> </user-search>
- <!-- 数据表格 -->
- <ele-pro-table
- ref="table"
- :columns="columns"
- :datasource="datasource"
- height="calc(100vh - 365px)"
- full-height="calc(100vh - 116px)"
- tool-class="ele-toolbar-form"
- cache-key="systemOrgUserTable"
- >
- <!-- 编码列 -->
- <template v-slot:name="{ row }">
- {{ row.qualityStandard && row.qualityStandard.name }}
- </template>
- <template v-slot:code="{ row }">
- <el-link
- @click="openDetail(row.qualityStandard)"
- type="primary"
- :underline="false"
- >
- {{ row.qualityStandard && row.qualityStandard.code }}
- </el-link>
- </template>
- <template v-slot:type="{ row }">
- {{ getDictValue('质检标准类型', row.qualityStandard && row.qualityStandard.type) }}
- </template>
- <template v-slot:standardCode="{ row }">
- {{ row.qualityStandard && row.qualityStandard.standardCode }}
- </template>
- <template v-slot:status="{ row }">
- {{ row.qualityStandard && row.qualityStandard.status == 1 ? '启用' : '停用' }}
- </template>
- <template v-slot:mode="{ row }">
- {{ getDictValue('质检方式', row.mode) }}
- </template>
- <template v-slot:version="{ row }">
- {{ row.qualityStandard && row.qualityStandard.version }}
- </template>
- </ele-pro-table>
- <Detail ref="detailRef"></Detail>
- </div>
- </template>
- <script>
- import userSearch from './user-search.vue';
- import { getList } from '@/api/material/inspectionClassify';
- import dictMixins from '@/mixins/dictMixins';
- import Detail from './edit.vue';
- export default {
- mixins: [dictMixins],
- components: { userSearch, Detail },
- props: {
- // 类别id
- rootId: [Number, String]
- },
- data() {
- return {
- // 当前编辑数据
- current: null,
- // 表格列配置
- columns: [
- {
- columnKey: 'index',
- type: 'index',
- label: '序号',
- width: 55,
- align: 'center'
- },
- {
- prop: 'code',
- label: '标准编码',
- showOverflowTooltip: true,
- minWidth: 110,
- slot: 'code'
- },
- {
- prop: 'name',
- label: '标准名称',
- showOverflowTooltip: true,
- minWidth: 110,
- slot: 'name'
- },
- {
- label: '标准类型',
- prop: 'type',
- slot: 'type'
- },
- {
- label: '标准代码',
- prop: 'standardCode'
- },
- {
- prop: 'status',
- label: '状态',
- align: 'center',
- minWidth: 110,
- slot: 'status'
- },
- {
- prop: 'version',
- label: '版本号',
- align: 'center',
- minWidth: 110,
- slot: 'version'
- }
- ]
- };
- },
- created() {
- this.requestDict('质检方式');
- this.requestDict('质检标准类型');
- },
- methods: {
- /* 表格数据源 */
- datasource({ page, limit, where }) {
- let _data = null;
- _data = getList({
- ...where,
- pageNum: page,
- size: limit,
- categoryLevelId: this.categoryLevelId || 12,
- rootCategoryLevelId: this.rootId
- });
-
- console.log(_data,555);
- return _data
- },
- /* 刷新表格 */
- reload(where) {
- this.$refs.table.reload({
- pageNum: 1,
- where: where,
- categoryLevelId: this.categoryLevelId,
- rootCategoryLevelId: this.rootId
- });
- },
- clickSearch(info) {
- this.categoryLevelId = info.id;
- this.rootCategoryLevelId = info.rootCategoryLevelId;
- this.reload();
- },
- openDetail(row) {
- this.$refs.detailRef.open('detail',row);
- }
- }
- };
- </script>
|