|
|
@@ -2,11 +2,7 @@
|
|
|
<div class="ele-body">
|
|
|
<el-card shadow="never">
|
|
|
<search ref="search" @search="search"></search>
|
|
|
- <ele-pro-table
|
|
|
- ref="table"
|
|
|
- :columns="columns"
|
|
|
- :datasource="datasource"
|
|
|
- >
|
|
|
+ <ele-pro-table ref="table" :columns="columns" :datasource="datasource">
|
|
|
<!-- 表头工具栏 -->
|
|
|
<template v-slot:toolbar>
|
|
|
<el-button
|
|
|
@@ -28,10 +24,8 @@
|
|
|
@click="downloadFile(link)"
|
|
|
>
|
|
|
{{ link.name }}
|
|
|
- </el-link
|
|
|
- >
|
|
|
-
|
|
|
- </template>
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
|
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="{ row }">
|
|
|
@@ -57,109 +51,120 @@
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
</el-card>
|
|
|
- <edit ref="edit" @done="done"></edit>
|
|
|
+ <newEdit
|
|
|
+ v-if="showEdit"
|
|
|
+ :type="editType"
|
|
|
+ :editObj="editObj"
|
|
|
+ @close="close"
|
|
|
+ ></newEdit>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import search from './components/search.vue';
|
|
|
-import edit from './components/edit.vue';
|
|
|
-import { getList, removeItem } from '@/api/inspectionPoint';
|
|
|
-import dictMixins from '@/mixins/dictMixins';
|
|
|
-import {getFile} from "@/api/system/file";
|
|
|
+ import search from './components/search.vue';
|
|
|
+ import newEdit from './components/newEdit.vue';
|
|
|
+ import { getList, removeItem } from '@/api/inspectionPoint';
|
|
|
+ import dictMixins from '@/mixins/dictMixins';
|
|
|
+ import { getFile } from '@/api/system/file';
|
|
|
|
|
|
-export default {
|
|
|
- mixins: [dictMixins],
|
|
|
- components: {
|
|
|
- search,
|
|
|
- edit
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- columns: [
|
|
|
- {
|
|
|
- width: 45,
|
|
|
- type: 'index',
|
|
|
- columnKey: 'index',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
+ export default {
|
|
|
+ mixins: [dictMixins],
|
|
|
+ components: {
|
|
|
+ search,
|
|
|
+ newEdit
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ width: 45,
|
|
|
+ type: 'index',
|
|
|
+ columnKey: 'index',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
|
|
|
- {
|
|
|
- prop: 'pointCode',
|
|
|
- label: '编码'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '名称',
|
|
|
- prop: 'pointName'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '区域',
|
|
|
- prop: 'areaName'
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- label: '附件',
|
|
|
- slot: 'files'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'createUserName',
|
|
|
- label: '创建人',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
+ {
|
|
|
+ prop: 'pointCode',
|
|
|
+ label: '编码'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '名称',
|
|
|
+ prop: 'pointName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '区域',
|
|
|
+ prop: 'areaName'
|
|
|
+ },
|
|
|
|
|
|
- {
|
|
|
- prop: 'createTime',
|
|
|
- label: '创建时间',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- columnKey: 'action',
|
|
|
- label: '操作',
|
|
|
- width: 220,
|
|
|
- align: 'center',
|
|
|
- resizable: false,
|
|
|
- slot: 'action',
|
|
|
- showOverflowTooltip: true
|
|
|
- }
|
|
|
- ]
|
|
|
- };
|
|
|
- },
|
|
|
- created() {
|
|
|
- // this.requestDict('质检标准类型');
|
|
|
- },
|
|
|
- methods: {
|
|
|
- datasource({ page, where, limit }) {
|
|
|
- return getList({
|
|
|
- ...where,
|
|
|
- pageNum: page,
|
|
|
- size: limit
|
|
|
- });
|
|
|
- },
|
|
|
- search(where) {
|
|
|
- this.$refs.table.reload({
|
|
|
- where: where,
|
|
|
- page: 1
|
|
|
- });
|
|
|
- },
|
|
|
- openEdit(type, row) {
|
|
|
- this.$refs.edit.open(type, row);
|
|
|
- },
|
|
|
- downloadFile(file) {
|
|
|
- getFile({objectName: file.storePath}, file.name);
|
|
|
+ {
|
|
|
+ label: '附件',
|
|
|
+ slot: 'files'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'createUserName',
|
|
|
+ label: '创建人',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'createTime',
|
|
|
+ label: '创建时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 220,
|
|
|
+ align: 'center',
|
|
|
+ resizable: false,
|
|
|
+ slot: 'action',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+
|
|
|
+ editType: null,
|
|
|
+ editObj: {},
|
|
|
+ showEdit: false
|
|
|
+ };
|
|
|
},
|
|
|
- remove(row) {
|
|
|
- removeItem([row.id])
|
|
|
- .then((message) => {
|
|
|
- this.$message.success(message);
|
|
|
- this.done();
|
|
|
- })
|
|
|
- .catch((e) => {});
|
|
|
+ created() {
|
|
|
+
|
|
|
},
|
|
|
- done() {
|
|
|
- this.$refs.search.search();
|
|
|
+ methods: {
|
|
|
+ datasource({ page, where, limit }) {
|
|
|
+ return getList({
|
|
|
+ ...where,
|
|
|
+ pageNum: page,
|
|
|
+ size: limit
|
|
|
+ });
|
|
|
+ },
|
|
|
+ search(where) {
|
|
|
+ this.$refs.table.reload({
|
|
|
+ where: where,
|
|
|
+ page: 1
|
|
|
+ });
|
|
|
+ },
|
|
|
+ openEdit(type, row) {
|
|
|
+ this.editType = type;
|
|
|
+ this.editObj = row || {};
|
|
|
+ this.showEdit = true;
|
|
|
+ },
|
|
|
+ close() {
|
|
|
+ this.showEdit = false;
|
|
|
+ },
|
|
|
+
|
|
|
+ downloadFile(file) {
|
|
|
+ getFile({ objectName: file.storePath }, file.name);
|
|
|
+ },
|
|
|
+ remove(row) {
|
|
|
+ removeItem([row.id])
|
|
|
+ .then((message) => {
|
|
|
+ this.$message.success(message);
|
|
|
+ this.done();
|
|
|
+ })
|
|
|
+ .catch((e) => {});
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-};
|
|
|
+ };
|
|
|
</script>
|
|
|
-
|