|
|
|
@ -1,144 +1,333 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
|
|
|
|
|
<el-form-item label="检测项方案编号" prop="projectTypeCode">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.projectTypeCode"
|
|
|
|
|
placeholder="请输入检测项方案编号"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="检测项方案名称" prop="projectTypeName">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.projectTypeName"
|
|
|
|
|
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="20">
|
|
|
|
|
<el-col :span="6" :xs="24">
|
|
|
|
|
<ProjectTypeTree ref="ProjectTypeTree" @onNodeClick="onNodeClick" ></ProjectTypeTree>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="18" :xs="24">
|
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
|
|
|
|
<el-form-item label="检验规则名称" prop="ruleName">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.ruleName"
|
|
|
|
|
placeholder="请输入检验规则名称"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="检验规则属性" prop="propertyCode">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="queryParams.propertyCode"
|
|
|
|
|
placeholder="请选择检验规则属性"
|
|
|
|
|
clearable >
|
|
|
|
|
<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-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-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-plus"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleAdd"
|
|
|
|
|
v-hasPermi="['quality:qcProjectType:add']"
|
|
|
|
|
>新增</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="success"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
size="mini"
|
|
|
|
|
:disabled="single"
|
|
|
|
|
@click="handleUpdate"
|
|
|
|
|
v-hasPermi="['quality:qcProjectType:edit']"
|
|
|
|
|
>修改</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="danger"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-delete"
|
|
|
|
|
size="mini"
|
|
|
|
|
:disabled="multiple"
|
|
|
|
|
@click="handleDelete"
|
|
|
|
|
v-hasPermi="['quality:qcProjectType:remove']"
|
|
|
|
|
>删除</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="warning"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-download"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleExport"
|
|
|
|
|
v-hasPermi="['quality:qcProjectType:export']"
|
|
|
|
|
>导出</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-plus"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleAdd"
|
|
|
|
|
v-hasPermi="['quality:project:add']"
|
|
|
|
|
>新增</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="success"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
size="mini"
|
|
|
|
|
:disabled="single"
|
|
|
|
|
@click="handleUpdate"
|
|
|
|
|
v-hasPermi="['quality:project:edit']"
|
|
|
|
|
>修改</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="danger"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-delete"
|
|
|
|
|
size="mini"
|
|
|
|
|
:disabled="multiple"
|
|
|
|
|
@click="handleDelete"
|
|
|
|
|
v-hasPermi="['quality:project:remove']"
|
|
|
|
|
>删除</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="info"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-upload2"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleImport"
|
|
|
|
|
v-hasPermi="['quality:project:import']"
|
|
|
|
|
>导入</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<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-column type="selection" width="55" align="center" />
|
|
|
|
|
<el-table-column label="id" align="center" prop="id" />
|
|
|
|
|
<el-table-column label="检测项方案编号" align="center" prop="projectTypeCode" />
|
|
|
|
|
<el-table-column label="检测项方案名称" align="center" :show-overflow-tooltip="true">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<router-link :to="'/qua/quality/qcProject-data/index/' + scope.row.projectTypeCode" class="link-type">
|
|
|
|
|
<span>{{ scope.row.projectTypeName }}</span>
|
|
|
|
|
</router-link>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="检验标准编码" align="center" prop="standardNo" />
|
|
|
|
|
<el-table-column label="版本" align="center" prop="version" />
|
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
|
|
v-hasPermi="['quality:qcProjectType:edit']"
|
|
|
|
|
>修改</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="el-icon-delete"
|
|
|
|
|
@click="handleDelete(scope.row)"
|
|
|
|
|
v-hasPermi="['quality:qcProjectType:remove']"
|
|
|
|
|
>删除</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<pagination
|
|
|
|
|
v-show="total>0"
|
|
|
|
|
:total="total"
|
|
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
|
|
@pagination="getList"
|
|
|
|
|
/>
|
|
|
|
|
<el-table v-loading="loading" :data="projectList" @selection-change="handleSelectionChange">
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
<el-table-column label="检验规则编号" align="center" prop="orderNum" width="110"/>
|
|
|
|
|
<el-table-column label="检验规则名称" align="center" prop="ruleName" width="200" :show-overflow-tooltip="true"/>
|
|
|
|
|
<el-table-column label="检验规则属性" align="center" prop="propertyCode" width="100">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<dict-tag
|
|
|
|
|
:options="dict.type.qc_rule_prop"
|
|
|
|
|
:value="scope.row.propertyCode"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="检验方式" align="center" prop="checkMode" :show-overflow-tooltip="true" width="200"/>
|
|
|
|
|
<el-table-column label="检验工具" align="center" prop="checkTool" />
|
|
|
|
|
<el-table-column label="检验标准" align="center" prop="checkStandard" :show-overflow-tooltip="true" width="200"/>
|
|
|
|
|
<el-table-column label="单位" align="center" prop="unitCode" >
|
|
|
|
|
<template slot-scope="scope"><dict-tag :options="dict.type.unit" :value="scope.row.unitCode"/></template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="抽样方案" align="center" prop="samplePlan" :show-overflow-tooltip="true" width="200"/>
|
|
|
|
|
<el-table-column label="合格判定" align="center" prop="judge" :show-overflow-tooltip="true" width="200"/>
|
|
|
|
|
<el-table-column label="检测项分类" align="center" prop="itemType" width="100" :formatter="itemTypeFormat" />
|
|
|
|
|
<el-table-column label="合格判定比例" align="center" prop="judgeRate" width="150"/>
|
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
|
|
v-hasPermi="['quality:project:edit']"
|
|
|
|
|
>修改</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="el-icon-delete"
|
|
|
|
|
@click="handleDelete(scope.row)"
|
|
|
|
|
v-hasPermi="['quality:project:remove']"
|
|
|
|
|
>删除</el-button>
|
|
|
|
|
</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-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
|
|
<el-form-item label="检测项方案编号" prop="projectTypeCode">
|
|
|
|
|
<el-input v-model="form.projectTypeCode" placeholder="请输入检测项方案编号" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="检测项方案名称" prop="projectTypeName">
|
|
|
|
|
<el-input v-model="form.projectTypeName" placeholder="请输入检测项方案名称" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="检测标准编号" prop="standardNo">
|
|
|
|
|
<el-input v-model="form.standardNo" placeholder="请输入检测标准编号" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="版本" prop="version">
|
|
|
|
|
<el-input v-model="form.version" placeholder="请输入版本" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px" >
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col>
|
|
|
|
|
<el-form-item label="检验方案" prop="projectType">
|
|
|
|
|
<el-select v-model="form.projectType" placeholder="请选择检验方案" style="width:100%" disabled>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in ProjectTypeList"
|
|
|
|
|
:key="item.projectTypeCode"
|
|
|
|
|
:label="item.projectTypeName"
|
|
|
|
|
:value="item.projectTypeCode"
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</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>
|
|
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</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>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<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 {
|
|
|
|
|
name: "QcProjectType",
|
|
|
|
|
dicts: ["qc_rule_prop","unit"],
|
|
|
|
|
components:{ProjectTypeTree,},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// 遮罩层
|
|
|
|
@ -154,19 +343,44 @@ export default {
|
|
|
|
|
// 总条数
|
|
|
|
|
total: 0,
|
|
|
|
|
// 检验方案维护表格数据
|
|
|
|
|
qcProjectTypeList: [],
|
|
|
|
|
projectList: [],
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
open: false,
|
|
|
|
|
// 检验方案列表
|
|
|
|
|
ProjectTypeList: {},
|
|
|
|
|
// 查询参数
|
|
|
|
|
queryParams: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
projectTypeCode: null,
|
|
|
|
|
projectTypeName: null,
|
|
|
|
|
orderNum: null,
|
|
|
|
|
ruleName: null,
|
|
|
|
|
propertyCode: null,
|
|
|
|
|
checkMode: null,
|
|
|
|
|
checkTool: null,
|
|
|
|
|
unitCode: null,
|
|
|
|
|
checkStandard: null,
|
|
|
|
|
attr1: 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: {},
|
|
|
|
@ -180,17 +394,33 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.getProjectTypeList();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
/** 查询检验方案维护列表 */
|
|
|
|
|
/** 查询检验项目维护列表 */
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
listQcProjectType(this.queryParams).then(response => {
|
|
|
|
|
this.qcProjectTypeList = response.rows;
|
|
|
|
|
listProject(this.queryParams).then(response => {
|
|
|
|
|
this.projectList = response.rows;
|
|
|
|
|
this.total = response.total;
|
|
|
|
|
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() {
|
|
|
|
|
this.open = false;
|
|
|
|
@ -200,15 +430,21 @@ export default {
|
|
|
|
|
reset() {
|
|
|
|
|
this.form = {
|
|
|
|
|
id: null,
|
|
|
|
|
projectTypeCode: null,
|
|
|
|
|
projectTypeName: null,
|
|
|
|
|
orderNum: null,
|
|
|
|
|
ruleName: null,
|
|
|
|
|
propertyCode: null,
|
|
|
|
|
checkMode: null,
|
|
|
|
|
checkTool: null,
|
|
|
|
|
unitCode: null,
|
|
|
|
|
checkStandard: null,
|
|
|
|
|
attr1: null,
|
|
|
|
|
createBy: null,
|
|
|
|
|
createTime: null,
|
|
|
|
|
updateBy: null,
|
|
|
|
|
updateTime: null,
|
|
|
|
|
factoryCode: null,
|
|
|
|
|
delFlag: null
|
|
|
|
|
delFlag: null,
|
|
|
|
|
projectType: null,
|
|
|
|
|
};
|
|
|
|
|
this.resetForm("form");
|
|
|
|
|
},
|
|
|
|
@ -231,17 +467,18 @@ export default {
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
|
handleAdd() {
|
|
|
|
|
this.reset();
|
|
|
|
|
this.form.projectType = this.projectType
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "添加检验方案维护";
|
|
|
|
|
this.title = "添加检验项目维护";
|
|
|
|
|
},
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
this.reset();
|
|
|
|
|
const id = row.id || this.ids
|
|
|
|
|
getQcProjectType(id).then(response => {
|
|
|
|
|
getProject(id).then(response => {
|
|
|
|
|
this.form = response.data;
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "修改检验方案维护";
|
|
|
|
|
this.title = "修改检验项目维护";
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
@ -249,13 +486,13 @@ export default {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.form.id != null) {
|
|
|
|
|
updateQcProjectType(this.form).then(response => {
|
|
|
|
|
updateProject(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
addQcProjectType(this.form).then(response => {
|
|
|
|
|
addProject(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
@ -267,8 +504,8 @@ export default {
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
const ids = row.id || this.ids;
|
|
|
|
|
this.$modal.confirm('是否确认删除检验方案维护编号为"' + ids + '"的数据项?').then(function() {
|
|
|
|
|
return delQcProjectType(ids);
|
|
|
|
|
this.$modal.confirm('是否确认删除检验项目维护编号为"' + ids + '"的数据项?').then(function() {
|
|
|
|
|
return delProject(ids);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
@ -276,10 +513,56 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
handleExport() {
|
|
|
|
|
this.download('quality/qcProjectType/export', {
|
|
|
|
|
this.download('quality/project/export', {
|
|
|
|
|
...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>
|
|
|
|
|