<template>
|
<a-card
|
:bordered="false"
|
title="点检项目"
|
>
|
<!-- 查询区域 -->
|
<div class="table-page-search-wrapper">
|
<a-form
|
layout="inline"
|
@keyup.enter.native="searchQuery"
|
>
|
<a-row :gutter="24">
|
<a-col
|
:md="8"
|
:sm="8"
|
>
|
<a-form-item label="点检项目编码">
|
<j-input
|
placeholder="请输入点检项目编码"
|
v-model="queryParam.num"
|
></j-input>
|
</a-form-item>
|
</a-col>
|
<a-col
|
:md="8"
|
:sm="8"
|
>
|
<a-form-item label="点检项目名称">
|
<j-input
|
placeholder="请输入点检项目名称"
|
v-model="queryParam.name"
|
></j-input>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
</a-form>
|
</div>
|
|
<!-- 操作按钮区域 -->
|
<div
|
class="table-operator"
|
style="margin-top: 5px"
|
>
|
<a-button
|
type="primary"
|
@click="searchQuery"
|
icon="search"
|
>查询</a-button>
|
<a-button
|
@click="searchReset"
|
icon="reload"
|
>重置</a-button>
|
<a-button
|
@click="handleAdd"
|
type="primary"
|
icon="plus"
|
:hidden="disabled"
|
>新增</a-button>
|
<a-button
|
type="primary"
|
icon="download"
|
@click="handleExportXls('原因')"
|
>导出</a-button>
|
<a-dropdown v-if="selectedRowKeys.length > 0">
|
<a-button style="margin-left: 8px">
|
批量操作
|
<a-icon type="down" />
|
</a-button>
|
<a-menu slot="overlay">
|
<a-menu-item @click="batchDel">
|
<a-icon type="delete" />删除
|
</a-menu-item>
|
</a-menu>
|
</a-dropdown>
|
</div>
|
|
<!-- table区域-begin -->
|
<div>
|
<a-table
|
ref="table"
|
bordered
|
size="middle"
|
rowKey="id"
|
:columns="columns"
|
:rowClassName="tableRowClass"
|
:dataSource="dataSource"
|
:pagination="ipagination"
|
:loading="loading"
|
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
@change="handleTableChange"
|
:scroll="{ x: 'calc(1400px + 50%)', y: 900 }"
|
>
|
<!--字符串超长截取省略号显示-->
|
<span
|
slot="num"
|
slot-scope="text"
|
style="font-weight: bold"
|
>
|
<j-ellipsis
|
:value="text"
|
:length="15"
|
/>
|
</span>
|
<span
|
slot="name"
|
slot-scope="text"
|
style="font-weight: bold"
|
>
|
<j-ellipsis
|
:value="text"
|
:length="15"
|
/>
|
</span>
|
<span
|
slot="model"
|
slot-scope="text"
|
>
|
<j-ellipsis
|
:value="text"
|
:length="15"
|
/>
|
</span>
|
<!-- <span
|
slot="status"
|
slot-scope="text,record"
|
>
|
<a-badge
|
v-if="record.status==1"
|
status="success"
|
/>
|
<span
|
v-if="record.status==1"
|
class="success"
|
>启用</span>
|
<a-badge
|
v-if="record.status==0"
|
status="error"
|
/>
|
<span
|
v-if="record.status==0"
|
class="error"
|
>禁用</span>
|
</span> -->
|
|
<span
|
slot="action"
|
slot-scope="text, record"
|
>
|
<a @click="handleEdit(record)">编辑</a>
|
<a-divider type="vertical" />
|
<a-dropdown>
|
<a class="ant-dropdown-link">
|
更多
|
<a-icon type="down" />
|
</a>
|
<a-menu slot="overlay">
|
<a-menu-item>
|
<a
|
href="javascript:;"
|
@click="handleDetail(record)"
|
>详情</a>
|
</a-menu-item>
|
|
<a-menu-item>
|
<a-popconfirm
|
title="确定删除吗?"
|
@confirm="() => handleDelete(record.id)"
|
>
|
<a>删除</a>
|
</a-popconfirm>
|
</a-menu-item>
|
<!-- <a-menu-item v-else>
|
<a-popconfirm title="当前信息已被引用,请先删除关联信息后再执行删除操作">
|
<a class="frozenRowClass">删除</a>
|
</a-popconfirm>
|
</a-menu-item> -->
|
|
<!-- <a-menu-item v-if="record.status==1">
|
<a-popconfirm
|
title="确定禁用吗?"
|
@confirm="() => handleActive(record.id)"
|
>
|
<a>禁用</a>
|
</a-popconfirm>
|
</a-menu-item> -->
|
<!-- <a-menu-item v-if="record.status==0">
|
<a-popconfirm
|
title="确定启用吗?"
|
@confirm="() => handleActive(record.id)"
|
>
|
<a>启用</a>
|
</a-popconfirm>
|
</a-menu-item> -->
|
</a-menu>
|
</a-dropdown>
|
</span>
|
|
</a-table>
|
</div>
|
<!-- table区域-end -->
|
|
<inspection-project-model
|
ref="modalForm"
|
@ok="modalFormOk"
|
:nodeSelected="nodeSelected"
|
></inspection-project-model>
|
</a-card>
|
</template>
|
|
<script>
|
|
import JDictSelectTag from '@/components/dict/JDictSelectTag'
|
import { requestPut } from '@/api/manage'
|
import InspectionProjectModel from './InspectionProjectModel'
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import JInput from '@/components/jeecg/JInput'
|
import JEllipsis from "@/components/jeecg/JEllipsis";
|
import Tooltip from 'ant-design-vue/es/tooltip'
|
export default {
|
name: 'InspectionProjcetRight',
|
mixins: [JeecgListMixin],
|
components: {
|
Tooltip,
|
InspectionProjectModel,
|
JDictSelectTag,
|
JInput,
|
JEllipsis,
|
},
|
props: {
|
recordSelect: {},
|
},
|
data() {
|
return {
|
disabled: true,
|
nodeSelected: {},
|
columns: [
|
{
|
title: '#',
|
dataIndex: '',
|
key: 'rowIndex',
|
align: 'center',
|
customRender: function (t, r, index) {
|
return parseInt(index) + 1
|
},
|
width: 50,
|
},
|
{
|
title: '项目编码',
|
align: 'center',
|
dataIndex: 'num',
|
scopedSlots: {
|
customRender: 'num'
|
},
|
},
|
{
|
title: '项目名称',
|
align: 'center',
|
dataIndex: 'name',
|
scopedSlots: {
|
customRender: 'name'
|
},
|
},
|
{
|
title: '计量单位',
|
align: 'center',
|
dataIndex: 'unitId_dictText',
|
},
|
{
|
title: '分析方法',
|
align: 'center',
|
dataIndex: 'analysisMethod_dictText',
|
},
|
{
|
title: '检验值类型',
|
align: "center",
|
dataIndex: 'testValueType_dictText',
|
},
|
{
|
title: '检测标准',
|
align: "center",
|
dataIndex: 'detectionStandard',
|
},
|
{
|
title: '合格范围 ',
|
align: "center",
|
dataIndex: 'acceptabilityLimit',
|
},
|
{
|
title: '点检方法',
|
align: "center",
|
dataIndex: 'inspectionMethod_dictText',
|
},
|
{
|
title: '点检工具',
|
align: "center",
|
dataIndex: 'inspectionTool',
|
},
|
{
|
title: '创建人',
|
align: "center",
|
dataIndex: 'createBy',
|
},
|
{
|
title: '创建时间',
|
align: "center",
|
dataIndex: 'createTime',
|
},
|
{
|
|
title: '操作',
|
dataIndex: 'action',
|
align: 'center',
|
scopedSlots: {
|
customRender: 'action'
|
},
|
width: 150,
|
fixed: 'right',
|
},
|
],
|
url: {
|
list: '/eam/inspectionProject/list',
|
delete: "/eam/inspectionProject/delete",
|
deleteBatch: "/eam/inspectionProject/deleteBatch",
|
exportXlsUrl: "/eam/inspectionProject/exportXls",
|
importExcelUrl: "eam/inspectionProject/importExcel",
|
},
|
}
|
},
|
|
|
methods: {
|
handleAdd: function () {
|
this.$refs.modalForm.add({ inspectionProjectCategoryNumName: this.inspectionProjectCategoryNumName });
|
this.$refs.modalForm.title = "新增";
|
this.$refs.modalForm.disableSubmit = false;
|
this.$refs.modalForm.inspectionProjectCategoryId = this.nodeSelected.key;
|
},
|
//禁用状态样式
|
tableRowClass(record, index) {
|
if (record.status != "1") {
|
return "frozenRowClass";
|
}
|
return "";
|
},
|
searchReset() {
|
if ('-1' != this.nodeSelected.key) {
|
this.disabled = false;
|
this.queryParam = [];
|
this.queryParam.inspectionProjectCategoryId = this.nodeSelected.key;
|
} else {
|
this.disabled = true;
|
this.queryParam = [];
|
}
|
this.loadData(1);
|
},
|
},
|
watch: {
|
recordSelect(val) {
|
this.nodeSelected = val;
|
this.inspectionProjectCategoryNumName = this.nodeSelected.rfield1 + "/" + this.nodeSelected.rfield2;
|
if ('-1' != this.nodeSelected.key) {
|
this.disabled = false;
|
this.queryParam = [];
|
this.queryParam.inspectionProjectCategoryId = this.nodeSelected.key;
|
} else {
|
this.disabled = true;
|
this.queryParam = [];
|
}
|
this.loadData(1);
|
}
|
},
|
|
}
|
</script>
|
|
<style lang="less" scoped>
|
@import '~@assets/less/common.less';
|
/deep/ .frozenRowClass {
|
color: #c9c9c9;
|
}
|
/deep/ .success {
|
color: green;
|
}
|
/deep/ .error {
|
color: red;
|
}
|
/deep/ .notShow {
|
display: none;
|
}
|
.fontweight {
|
font-weight: bold;
|
}
|
</style>
|