|
|
@ -1,144 +1,333 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="app-container">
|
|
|
|
<div class="app-container">
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
|
|
|
|
<el-row :gutter="20">
|
|
|
|
<el-form-item label="检测项方案编号" prop="projectTypeCode">
|
|
|
|
<el-col :span="6" :xs="24">
|
|
|
|
<el-input
|
|
|
|
<ProjectTypeTree ref="ProjectTypeTree" @onNodeClick="onNodeClick" ></ProjectTypeTree>
|
|
|
|
v-model="queryParams.projectTypeCode"
|
|
|
|
</el-col>
|
|
|
|
placeholder="请输入检测项方案编号"
|
|
|
|
<el-col :span="18" :xs="24">
|
|
|
|
clearable
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
<el-form-item label="检验规则名称" prop="ruleName">
|
|
|
|
/>
|
|
|
|
<el-input
|
|
|
|
</el-form-item>
|
|
|
|
v-model="queryParams.ruleName"
|
|
|
|
<el-form-item label="检测项方案名称" prop="projectTypeName">
|
|
|
|
placeholder="请输入检验规则名称"
|
|
|
|
<el-input
|
|
|
|
clearable
|
|
|
|
v-model="queryParams.projectTypeName"
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
placeholder="请输入检测项方案名称"
|
|
|
|
/>
|
|
|
|
clearable
|
|
|
|
</el-form-item>
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
<el-form-item label="检验规则属性" prop="propertyCode">
|
|
|
|
/>
|
|
|
|
<el-select
|
|
|
|
</el-form-item>
|
|
|
|
v-model="queryParams.propertyCode"
|
|
|
|
<el-form-item>
|
|
|
|
placeholder="请选择检验规则属性"
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
clearable >
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
<el-option
|
|
|
|
</el-form-item>
|
|
|
|
v-for="dict in dict.type.qc_rule_prop"
|
|
|
|
</el-form>
|
|
|
|
:key="dict.value"
|
|
|
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
|
|
|
></el-option>
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="检验方式" prop="checkMode">
|
|
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
|
|
v-model="queryParams.checkMode"
|
|
|
|
|
|
|
|
placeholder="请输入检验方式"
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="检验工具" prop="checkTool">
|
|
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
|
|
v-model="queryParams.checkTool"
|
|
|
|
|
|
|
|
placeholder="请输入检验工具"
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item>
|
|
|
|
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
type="primary"
|
|
|
|
type="primary"
|
|
|
|
plain
|
|
|
|
plain
|
|
|
|
icon="el-icon-plus"
|
|
|
|
icon="el-icon-plus"
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
@click="handleAdd"
|
|
|
|
@click="handleAdd"
|
|
|
|
v-hasPermi="['quality:qcProjectType:add']"
|
|
|
|
v-hasPermi="['quality:project:add']"
|
|
|
|
>新增</el-button>
|
|
|
|
>新增</el-button>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
type="success"
|
|
|
|
type="success"
|
|
|
|
plain
|
|
|
|
plain
|
|
|
|
icon="el-icon-edit"
|
|
|
|
icon="el-icon-edit"
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
:disabled="single"
|
|
|
|
:disabled="single"
|
|
|
|
@click="handleUpdate"
|
|
|
|
@click="handleUpdate"
|
|
|
|
v-hasPermi="['quality:qcProjectType:edit']"
|
|
|
|
v-hasPermi="['quality:project:edit']"
|
|
|
|
>修改</el-button>
|
|
|
|
>修改</el-button>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
type="danger"
|
|
|
|
type="danger"
|
|
|
|
plain
|
|
|
|
plain
|
|
|
|
icon="el-icon-delete"
|
|
|
|
icon="el-icon-delete"
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
:disabled="multiple"
|
|
|
|
:disabled="multiple"
|
|
|
|
@click="handleDelete"
|
|
|
|
@click="handleDelete"
|
|
|
|
v-hasPermi="['quality:qcProjectType:remove']"
|
|
|
|
v-hasPermi="['quality:project:remove']"
|
|
|
|
>删除</el-button>
|
|
|
|
>删除</el-button>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-col :span="1.5">
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
type="warning"
|
|
|
|
type="info"
|
|
|
|
plain
|
|
|
|
plain
|
|
|
|
icon="el-icon-download"
|
|
|
|
icon="el-icon-upload2"
|
|
|
|
size="mini"
|
|
|
|
size="mini"
|
|
|
|
@click="handleExport"
|
|
|
|
@click="handleImport"
|
|
|
|
v-hasPermi="['quality:qcProjectType:export']"
|
|
|
|
v-hasPermi="['quality:project:import']"
|
|
|
|
>导出</el-button>
|
|
|
|
>导入</el-button>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
<el-col :span="1.5">
|
|
|
|
</el-row>
|
|
|
|
<el-button
|
|
|
|
|
|
|
|
type="warning"
|
|
|
|
|
|
|
|
plain
|
|
|
|
|
|
|
|
icon="el-icon-download"
|
|
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
|
|
@click="handleExport"
|
|
|
|
|
|
|
|
v-hasPermi="['quality:project:export']"
|
|
|
|
|
|
|
|
>导出</el-button>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
|
|
plain
|
|
|
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
|
|
@click="handleUpProjectType"
|
|
|
|
|
|
|
|
>编辑方案</el-button>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="qcProjectTypeList" @selection-change="handleSelectionChange">
|
|
|
|
<el-table v-loading="loading" :data="projectList" @selection-change="handleSelectionChange">
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
<el-table-column label="id" align="center" prop="id" />
|
|
|
|
<el-table-column label="检验规则编号" align="center" prop="orderNum" width="110"/>
|
|
|
|
<el-table-column label="检测项方案编号" align="center" prop="projectTypeCode" />
|
|
|
|
<el-table-column label="检验规则名称" align="center" prop="ruleName" width="200" :show-overflow-tooltip="true"/>
|
|
|
|
<el-table-column label="检测项方案名称" align="center" :show-overflow-tooltip="true">
|
|
|
|
<el-table-column label="检验规则属性" align="center" prop="propertyCode" width="100">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<router-link :to="'/qua/quality/qcProject-data/index/' + scope.row.projectTypeCode" class="link-type">
|
|
|
|
<dict-tag
|
|
|
|
<span>{{ scope.row.projectTypeName }}</span>
|
|
|
|
:options="dict.type.qc_rule_prop"
|
|
|
|
</router-link>
|
|
|
|
:value="scope.row.propertyCode"
|
|
|
|
</template>
|
|
|
|
/>
|
|
|
|
</el-table-column>
|
|
|
|
</template>
|
|
|
|
<el-table-column label="检验标准编码" align="center" prop="standardNo" />
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="版本" align="center" prop="version" />
|
|
|
|
<el-table-column label="检验方式" align="center" prop="checkMode" :show-overflow-tooltip="true" width="200"/>
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
<el-table-column label="检验工具" align="center" prop="checkTool" />
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<el-table-column label="检验标准" align="center" prop="checkStandard" :show-overflow-tooltip="true" width="200"/>
|
|
|
|
<el-button
|
|
|
|
<el-table-column label="单位" align="center" prop="unitCode" >
|
|
|
|
size="mini"
|
|
|
|
<template slot-scope="scope"><dict-tag :options="dict.type.unit" :value="scope.row.unitCode"/></template>
|
|
|
|
type="text"
|
|
|
|
</el-table-column>
|
|
|
|
icon="el-icon-edit"
|
|
|
|
<el-table-column label="抽样方案" align="center" prop="samplePlan" :show-overflow-tooltip="true" width="200"/>
|
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
|
<el-table-column label="合格判定" align="center" prop="judge" :show-overflow-tooltip="true" width="200"/>
|
|
|
|
v-hasPermi="['quality:qcProjectType:edit']"
|
|
|
|
<el-table-column label="检测项分类" align="center" prop="itemType" width="100" :formatter="itemTypeFormat" />
|
|
|
|
>修改</el-button>
|
|
|
|
<el-table-column label="合格判定比例" align="center" prop="judgeRate" width="150"/>
|
|
|
|
<el-button
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100">
|
|
|
|
size="mini"
|
|
|
|
<template slot-scope="scope">
|
|
|
|
type="text"
|
|
|
|
<el-button
|
|
|
|
icon="el-icon-delete"
|
|
|
|
size="mini"
|
|
|
|
@click="handleDelete(scope.row)"
|
|
|
|
type="text"
|
|
|
|
v-hasPermi="['quality:qcProjectType:remove']"
|
|
|
|
icon="el-icon-edit"
|
|
|
|
>删除</el-button>
|
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
|
</template>
|
|
|
|
v-hasPermi="['quality:project:edit']"
|
|
|
|
</el-table-column>
|
|
|
|
>修改</el-button>
|
|
|
|
</el-table>
|
|
|
|
<el-button
|
|
|
|
|
|
|
|
size="mini"
|
|
|
|
<pagination
|
|
|
|
type="text"
|
|
|
|
v-show="total>0"
|
|
|
|
icon="el-icon-delete"
|
|
|
|
:total="total"
|
|
|
|
@click="handleDelete(scope.row)"
|
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
|
v-hasPermi="['quality:project:remove']"
|
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
|
>删除</el-button>
|
|
|
|
@pagination="getList"
|
|
|
|
</template>
|
|
|
|
/>
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<pagination
|
|
|
|
|
|
|
|
v-show="total>0"
|
|
|
|
|
|
|
|
:total="total"
|
|
|
|
|
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
|
|
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
|
|
|
|
|
@pagination="getList"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改检验方案维护对话框 -->
|
|
|
|
<!-- 添加或修改检验项目维护对话框 -->
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px" >
|
|
|
|
<el-form-item label="检测项方案编号" prop="projectTypeCode">
|
|
|
|
<el-row>
|
|
|
|
<el-input v-model="form.projectTypeCode" placeholder="请输入检测项方案编号" />
|
|
|
|
<el-col>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="检验方案" prop="projectType">
|
|
|
|
<el-form-item label="检测项方案名称" prop="projectTypeName">
|
|
|
|
<el-select v-model="form.projectType" placeholder="请选择检验方案" style="width:100%" disabled>
|
|
|
|
<el-input v-model="form.projectTypeName" placeholder="请输入检测项方案名称" />
|
|
|
|
<el-option
|
|
|
|
</el-form-item>
|
|
|
|
v-for="item in ProjectTypeList"
|
|
|
|
<el-form-item label="检测标准编号" prop="standardNo">
|
|
|
|
:key="item.projectTypeCode"
|
|
|
|
<el-input v-model="form.standardNo" placeholder="请输入检测标准编号" />
|
|
|
|
:label="item.projectTypeName"
|
|
|
|
</el-form-item>
|
|
|
|
:value="item.projectTypeCode"
|
|
|
|
<el-form-item label="版本" prop="version">
|
|
|
|
></el-option>
|
|
|
|
<el-input v-model="form.version" placeholder="请输入版本" />
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
<el-col>
|
|
|
|
|
|
|
|
<el-form-item label="检验规则名称" prop="ruleName">
|
|
|
|
|
|
|
|
<el-input v-model="form.ruleName" placeholder="请输入检验规则名称" />
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
<el-col>
|
|
|
|
|
|
|
|
<el-form-item label="检验规则属性" prop="propertyCode">
|
|
|
|
|
|
|
|
<el-select v-model="form.propertyCode" placeholder="请选择检验规则属性" style="width:100%">
|
|
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
|
|
v-for="dict in dict.type.qc_rule_prop"
|
|
|
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
|
|
|
></el-option>
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
<el-col>
|
|
|
|
|
|
|
|
<el-form-item label="检验标准" prop="checkStandard">
|
|
|
|
|
|
|
|
<el-input type='textarea' v-model="form.checkStandard" placeholder="请输入检验标准" />
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
<el-col>
|
|
|
|
|
|
|
|
<el-form-item label="检验方式" prop="checkMode">
|
|
|
|
|
|
|
|
<el-input type='textarea' v-model="form.checkMode" placeholder="请输入检验方式" />
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<template v-if="form.propertyCode === '1'">
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
<el-col>
|
|
|
|
|
|
|
|
<el-form-item label="检验工具" prop="checkTool">
|
|
|
|
|
|
|
|
<el-input type='textarea' v-model="form.checkTool" placeholder="请输入检验工具" />
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
<el-col>
|
|
|
|
|
|
|
|
<el-form-item label="单位" prop="unitCode">
|
|
|
|
|
|
|
|
<el-select v-model="form.unitCode" placeholder="请选择单位" >
|
|
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
|
|
v-for="dict in dict.type.unit"
|
|
|
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
|
|
|
></el-option>
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
<el-col>
|
|
|
|
|
|
|
|
<el-form-item label="抽样方案" prop="samplePlan">
|
|
|
|
|
|
|
|
<el-input type='textarea' v-model="form.samplePlan" placeholder="抽样方案" />
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
<el-col>
|
|
|
|
|
|
|
|
<el-form-item label="缺陷等级" prop="defectLevel">
|
|
|
|
|
|
|
|
<el-input type='textarea' v-model="form.defectLevel" placeholder="请输入检验标准" />
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
<el-col>
|
|
|
|
|
|
|
|
<el-form-item label="合格判定" prop="judge">
|
|
|
|
|
|
|
|
<el-input type='textarea' v-model="form.judge" placeholder="合格判定" />
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
<el-col>
|
|
|
|
|
|
|
|
<el-form-item label="检测项分类" prop="itemType">
|
|
|
|
|
|
|
|
<el-radio v-model="form.itemType" label="1">包装</el-radio>
|
|
|
|
|
|
|
|
<el-radio v-model="form.itemType" label="0">内容物</el-radio>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
<el-col>
|
|
|
|
|
|
|
|
<el-form-item label="合格判定比例" prop="judgeRate">
|
|
|
|
|
|
|
|
<el-input type='number' v-model="form.judgeRate" placeholder="合格判定比例" />
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 检测项目导入对话框 -->
|
|
|
|
|
|
|
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
|
|
|
|
|
|
|
<el-upload
|
|
|
|
|
|
|
|
ref="upload"
|
|
|
|
|
|
|
|
:limit="1"
|
|
|
|
|
|
|
|
accept=".xlsx, .xls"
|
|
|
|
|
|
|
|
:headers="upload.headers"
|
|
|
|
|
|
|
|
:action="upload.url + '?updateSupport=' + upload.updateSupport"
|
|
|
|
|
|
|
|
:disabled="upload.isUploading"
|
|
|
|
|
|
|
|
:on-progress="handleFileUploadProgress"
|
|
|
|
|
|
|
|
:on-success="handleFileSuccess"
|
|
|
|
|
|
|
|
:auto-upload="false"
|
|
|
|
|
|
|
|
drag
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<i class="el-icon-upload"></i>
|
|
|
|
|
|
|
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
|
|
|
|
|
<div class="el-upload__tip text-center" slot="tip">
|
|
|
|
|
|
|
|
<div class="el-upload__tip" slot="tip">
|
|
|
|
|
|
|
|
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<span>仅允许导入xls、xlsx格式文件。</span>
|
|
|
|
|
|
|
|
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</el-upload>
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
|
|
|
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
|
|
|
|
|
|
|
<el-button @click="upload.open = false">取 消</el-button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import { listQcProjectType, getQcProjectType, delQcProjectType, addQcProjectType, updateQcProjectType } from "@/api/quality/qcProjectType";
|
|
|
|
import { listQcProjectType, delQcProjectType, addQcProjectType, updateQcProjectType } from "@/api/quality/qcProjectType";
|
|
|
|
|
|
|
|
import ProjectTypeTree from "./projectTypeTree.vue";
|
|
|
|
|
|
|
|
import { listProject, getProject, delProject, addProject, updateProject } from "@/api/quality/project";
|
|
|
|
|
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: "QcProjectType",
|
|
|
|
name: "QcProjectType",
|
|
|
|
|
|
|
|
dicts: ["qc_rule_prop","unit"],
|
|
|
|
|
|
|
|
components:{ProjectTypeTree,},
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
// 遮罩层
|
|
|
|
// 遮罩层
|
|
|
@ -154,19 +343,44 @@ export default {
|
|
|
|
// 总条数
|
|
|
|
// 总条数
|
|
|
|
total: 0,
|
|
|
|
total: 0,
|
|
|
|
// 检验方案维护表格数据
|
|
|
|
// 检验方案维护表格数据
|
|
|
|
qcProjectTypeList: [],
|
|
|
|
projectList: [],
|
|
|
|
// 弹出层标题
|
|
|
|
// 弹出层标题
|
|
|
|
title: "",
|
|
|
|
title: "",
|
|
|
|
// 是否显示弹出层
|
|
|
|
// 是否显示弹出层
|
|
|
|
open: false,
|
|
|
|
open: false,
|
|
|
|
|
|
|
|
// 检验方案列表
|
|
|
|
|
|
|
|
ProjectTypeList: {},
|
|
|
|
// 查询参数
|
|
|
|
// 查询参数
|
|
|
|
queryParams: {
|
|
|
|
queryParams: {
|
|
|
|
pageNum: 1,
|
|
|
|
pageNum: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
pageSize: 10,
|
|
|
|
projectTypeCode: null,
|
|
|
|
orderNum: null,
|
|
|
|
projectTypeName: null,
|
|
|
|
ruleName: null,
|
|
|
|
|
|
|
|
propertyCode: null,
|
|
|
|
|
|
|
|
checkMode: null,
|
|
|
|
|
|
|
|
checkTool: null,
|
|
|
|
|
|
|
|
unitCode: null,
|
|
|
|
|
|
|
|
checkStandard: null,
|
|
|
|
attr1: null,
|
|
|
|
attr1: null,
|
|
|
|
factoryCode: null,
|
|
|
|
factoryCode: null,
|
|
|
|
|
|
|
|
projectType: null,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
upload: {
|
|
|
|
|
|
|
|
// 是否显示弹出层(检测项目导入)
|
|
|
|
|
|
|
|
open: false,
|
|
|
|
|
|
|
|
// 弹出层标题(检测项目导入)
|
|
|
|
|
|
|
|
title: "",
|
|
|
|
|
|
|
|
// 是否禁用上传
|
|
|
|
|
|
|
|
isUploading: false,
|
|
|
|
|
|
|
|
// 是否更新已经存在的检测项目数据
|
|
|
|
|
|
|
|
updateSupport: 0,
|
|
|
|
|
|
|
|
// 设置上传的请求头部
|
|
|
|
|
|
|
|
headers: {
|
|
|
|
|
|
|
|
Authorization: "Bearer " + getToken(),
|
|
|
|
|
|
|
|
poolName: localStorage.getItem('USER_POOL_NAME_CURRENT'),
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 上传的地址
|
|
|
|
|
|
|
|
url: process.env.VUE_APP_BASE_API + "/quality/project/importData"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 表单参数
|
|
|
|
// 表单参数
|
|
|
|
form: {},
|
|
|
|
form: {},
|
|
|
@ -180,17 +394,33 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
this.getList();
|
|
|
|
this.getList();
|
|
|
|
|
|
|
|
this.getProjectTypeList();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
/** 查询检验方案维护列表 */
|
|
|
|
/** 查询检验项目维护列表 */
|
|
|
|
getList() {
|
|
|
|
getList() {
|
|
|
|
this.loading = true;
|
|
|
|
this.loading = true;
|
|
|
|
listQcProjectType(this.queryParams).then(response => {
|
|
|
|
listProject(this.queryParams).then(response => {
|
|
|
|
this.qcProjectTypeList = response.rows;
|
|
|
|
this.projectList = response.rows;
|
|
|
|
this.total = response.total;
|
|
|
|
this.total = response.total;
|
|
|
|
this.loading = false;
|
|
|
|
this.loading = false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
getProjectTypeList() {
|
|
|
|
|
|
|
|
listQcProjectType().then(response => {
|
|
|
|
|
|
|
|
this.ProjectTypeList = response.rows;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
//检测项类型格式化
|
|
|
|
|
|
|
|
itemTypeFormat(row, column, cellValue) {
|
|
|
|
|
|
|
|
if (cellValue != null) {
|
|
|
|
|
|
|
|
if(cellValue=='1'){
|
|
|
|
|
|
|
|
return '包装';
|
|
|
|
|
|
|
|
}else if(cellValue=='0'){
|
|
|
|
|
|
|
|
return '内容物';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
// 取消按钮
|
|
|
|
// 取消按钮
|
|
|
|
cancel() {
|
|
|
|
cancel() {
|
|
|
|
this.open = false;
|
|
|
|
this.open = false;
|
|
|
@ -200,15 +430,21 @@ export default {
|
|
|
|
reset() {
|
|
|
|
reset() {
|
|
|
|
this.form = {
|
|
|
|
this.form = {
|
|
|
|
id: null,
|
|
|
|
id: null,
|
|
|
|
projectTypeCode: null,
|
|
|
|
orderNum: null,
|
|
|
|
projectTypeName: null,
|
|
|
|
ruleName: null,
|
|
|
|
|
|
|
|
propertyCode: null,
|
|
|
|
|
|
|
|
checkMode: null,
|
|
|
|
|
|
|
|
checkTool: null,
|
|
|
|
|
|
|
|
unitCode: null,
|
|
|
|
|
|
|
|
checkStandard: null,
|
|
|
|
attr1: null,
|
|
|
|
attr1: null,
|
|
|
|
createBy: null,
|
|
|
|
createBy: null,
|
|
|
|
createTime: null,
|
|
|
|
createTime: null,
|
|
|
|
updateBy: null,
|
|
|
|
updateBy: null,
|
|
|
|
updateTime: null,
|
|
|
|
updateTime: null,
|
|
|
|
factoryCode: null,
|
|
|
|
factoryCode: null,
|
|
|
|
delFlag: null
|
|
|
|
delFlag: null,
|
|
|
|
|
|
|
|
projectType: null,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
this.resetForm("form");
|
|
|
|
this.resetForm("form");
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -231,17 +467,18 @@ export default {
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
handleAdd() {
|
|
|
|
handleAdd() {
|
|
|
|
this.reset();
|
|
|
|
this.reset();
|
|
|
|
|
|
|
|
this.form.projectType = this.projectType
|
|
|
|
this.open = true;
|
|
|
|
this.open = true;
|
|
|
|
this.title = "添加检验方案维护";
|
|
|
|
this.title = "添加检验项目维护";
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
handleUpdate(row) {
|
|
|
|
handleUpdate(row) {
|
|
|
|
this.reset();
|
|
|
|
this.reset();
|
|
|
|
const id = row.id || this.ids
|
|
|
|
const id = row.id || this.ids
|
|
|
|
getQcProjectType(id).then(response => {
|
|
|
|
getProject(id).then(response => {
|
|
|
|
this.form = response.data;
|
|
|
|
this.form = response.data;
|
|
|
|
this.open = true;
|
|
|
|
this.open = true;
|
|
|
|
this.title = "修改检验方案维护";
|
|
|
|
this.title = "修改检验项目维护";
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 提交按钮 */
|
|
|
|
/** 提交按钮 */
|
|
|
@ -249,13 +486,13 @@ export default {
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
if (valid) {
|
|
|
|
if (valid) {
|
|
|
|
if (this.form.id != null) {
|
|
|
|
if (this.form.id != null) {
|
|
|
|
updateQcProjectType(this.form).then(response => {
|
|
|
|
updateProject(this.form).then(response => {
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
this.open = false;
|
|
|
|
this.open = false;
|
|
|
|
this.getList();
|
|
|
|
this.getList();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
addQcProjectType(this.form).then(response => {
|
|
|
|
addProject(this.form).then(response => {
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
this.open = false;
|
|
|
|
this.open = false;
|
|
|
|
this.getList();
|
|
|
|
this.getList();
|
|
|
@ -267,8 +504,8 @@ export default {
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
handleDelete(row) {
|
|
|
|
handleDelete(row) {
|
|
|
|
const ids = row.id || this.ids;
|
|
|
|
const ids = row.id || this.ids;
|
|
|
|
this.$modal.confirm('是否确认删除检验方案维护编号为"' + ids + '"的数据项?').then(function() {
|
|
|
|
this.$modal.confirm('是否确认删除检验项目维护编号为"' + ids + '"的数据项?').then(function() {
|
|
|
|
return delQcProjectType(ids);
|
|
|
|
return delProject(ids);
|
|
|
|
}).then(() => {
|
|
|
|
}).then(() => {
|
|
|
|
this.getList();
|
|
|
|
this.getList();
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
@ -276,10 +513,56 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
handleExport() {
|
|
|
|
handleExport() {
|
|
|
|
this.download('quality/qcProjectType/export', {
|
|
|
|
this.download('quality/project/export', {
|
|
|
|
...this.queryParams
|
|
|
|
...this.queryParams
|
|
|
|
}, `qcProjectType_${new Date().getTime()}.xlsx`)
|
|
|
|
}, `project_${new Date().getTime()}.xlsx`)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
/** 导入按钮操作 */
|
|
|
|
|
|
|
|
handleImport() {
|
|
|
|
|
|
|
|
this.upload.title = "检测项目导入";
|
|
|
|
|
|
|
|
this.upload.open = true;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/** 下载模板操作 */
|
|
|
|
|
|
|
|
importTemplate() {
|
|
|
|
|
|
|
|
this.download('quality/project/importTemplate', {
|
|
|
|
|
|
|
|
}, `check_project_template_${new Date().getTime()}.xlsx`)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 文件上传中处理
|
|
|
|
|
|
|
|
handleFileUploadProgress(event, file, fileList) {
|
|
|
|
|
|
|
|
this.upload.isUploading = true;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 文件上传成功处理
|
|
|
|
|
|
|
|
handleFileSuccess(response, file, fileList) {
|
|
|
|
|
|
|
|
this.upload.open = false;
|
|
|
|
|
|
|
|
this.upload.isUploading = false;
|
|
|
|
|
|
|
|
this.$refs.upload.clearFiles();
|
|
|
|
|
|
|
|
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
|
|
|
|
|
|
|
|
this.getList();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 提交上传文件
|
|
|
|
|
|
|
|
submitFileForm() {
|
|
|
|
|
|
|
|
this.$refs.upload.submit();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onNodeClick(obj) {
|
|
|
|
|
|
|
|
if(obj.id == 'projectType0') {
|
|
|
|
|
|
|
|
this.queryParams.projectType = '';
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.queryParams.projectType = obj.id;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.projectType = obj.id;
|
|
|
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handleUpProjectType() {
|
|
|
|
|
|
|
|
if( !this.projectType || this.projectType.trim() === ''){
|
|
|
|
|
|
|
|
return this.$modal.msgWarning("请先选择左侧方案!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(this.projectType != 'projectType0') {
|
|
|
|
|
|
|
|
this.$refs.ProjectTypeTree.handleUpdate(this.projectType);
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.$modal.msgError("此方案不允许修改");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|