Commit 6f2901c2 authored by 李驰骋's avatar 李驰骋

检测项添加输入类型字段添加导入功能

检测模版添加选择框值的录入
parent 233f9986
<template> <template>
<el-dialog title="物料产品选择" <el-dialog title="检测项选择"
v-if="showFlag" v-if="showFlag"
:visible.sync="showFlag" :visible.sync="showFlag"
:modal= false :modal= false
width="60%" width="60%"
center center
> >
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="检测项类型" prop="indexType"> <el-form-item label="检测项类型" prop="indexType">
<el-radio-group v-model="queryParams.indexType" @change="handleQuery"> <el-radio-group v-model="queryParams.indexType" @change="handleQuery">
<el-radio-button v-for="dict in dict.type.mes_index_type" <el-radio-button v-for="dict in dict.type.mes_index_type"
:key="dict.value" :key="dict.value"
:label="dict.value" :label="dict.value"
:value="dict.value" :value="dict.value"
>{{dict.label}}</el-radio-button> >{{dict.label}}</el-radio-button>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="检测项名称" prop="indexName"> <el-form-item label="检测项名称" prop="indexName">
<el-input <el-input
v-model="queryParams.indexName" v-model="queryParams.indexName"
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <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-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
...@@ -43,6 +43,12 @@ ...@@ -43,6 +43,12 @@
<dict-tag :options="dict.type.mes_index_type" :value="scope.row.indexType"/> <dict-tag :options="dict.type.mes_index_type" :value="scope.row.indexType"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="输入类型" align="center" prop="inputType">
<template slot-scope="scope">
<span v-if="scope.row.inputType==1">文本框</span>
<span v-if="scope.row.inputType==2">选择框</span>
</template>
</el-table-column>
<el-table-column label="检测工具" align="center" prop="qcTool" /> <el-table-column label="检测工具" align="center" prop="qcTool" />
</el-table> </el-table>
<pagination <pagination
...@@ -86,6 +92,7 @@ export default { ...@@ -86,6 +92,7 @@ export default {
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
inputTypeOptions: [{"label":"输入框","value":1},{"label":"选择框","value":2}],
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
......
This diff is collapsed.
...@@ -223,6 +223,7 @@ ...@@ -223,6 +223,7 @@
if (row != undefined && row != null) { if (row != undefined && row != null) {
this.form.indexCode = row.indexCode; this.form.indexCode = row.indexCode;
this.form.indexName = row.indexName; this.form.indexName = row.indexName;
this.form.indexType = row.indexType;
this.form.qcTool = row.qcTool; this.form.qcTool = row.qcTool;
this.form.qcindexId = row.indexId; this.form.qcindexId = row.indexId;
} }
......
...@@ -223,6 +223,7 @@ ...@@ -223,6 +223,7 @@
if (row != undefined && row != null) { if (row != undefined && row != null) {
this.form.indexCode = row.indexCode; this.form.indexCode = row.indexCode;
this.form.indexName = row.indexName; this.form.indexName = row.indexName;
this.form.indexType = row.indexType;
this.form.qcTool = row.qcTool; this.form.qcTool = row.qcTool;
this.form.qcindexId = row.indexId; this.form.qcindexId = row.indexId;
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
:value="dict.value" :value="dict.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <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-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
...@@ -76,6 +76,16 @@ ...@@ -76,6 +76,16 @@
v-hasPermi="['mes:qc:qcindex:export']" v-hasPermi="['mes:qc:qcindex:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['mes:qc:qcindex:import']"
>导入</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
...@@ -88,6 +98,12 @@ ...@@ -88,6 +98,12 @@
<dict-tag :options="dict.type.mes_index_type" :value="scope.row.indexType"/> <dict-tag :options="dict.type.mes_index_type" :value="scope.row.indexType"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="输入类型" align="center" prop="inputType">
<template slot-scope="scope">
<span v-if="scope.row.inputType==1">文本框</span>
<span v-if="scope.row.inputType==2">选择框</span>
</template>
</el-table-column>
<el-table-column label="检测工具" align="center" prop="qcTool" /> <el-table-column label="检测工具" align="center" prop="qcTool" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -108,7 +124,7 @@ ...@@ -108,7 +124,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
...@@ -131,7 +147,7 @@ ...@@ -131,7 +147,7 @@
<el-switch v-model="autoGenFlag" <el-switch v-model="autoGenFlag"
active-color="#13ce66" active-color="#13ce66"
active-text="自动生成" active-text="自动生成"
@change="handleAutoGenChange(autoGenFlag)" v-if="optType != 'view'"> @change="handleAutoGenChange(autoGenFlag)" v-if="optType != 'view'">
</el-switch> </el-switch>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -154,6 +170,16 @@ ...@@ -154,6 +170,16 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="输入类型" prop="inputType">
<el-select v-model="form.inputType" placeholder="请选择输入类型">
<el-option key="1" label="文本框" :value="1"></el-option>
<el-option key="2" label="选择框" :value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="检测工具" prop="qcTool"> <el-form-item label="检测工具" prop="qcTool">
<el-input v-model="form.qcTool" placeholder="请输入检测工具" /> <el-input v-model="form.qcTool" placeholder="请输入检测工具" />
...@@ -174,12 +200,43 @@ ...@@ -174,12 +200,43 @@
<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 { listQcindex, getQcindex, delQcindex, addQcindex, updateQcindex } from "@/api/mes/qc/qcindex"; import { listQcindex, getQcindex, delQcindex, addQcindex, updateQcindex } from "@/api/mes/qc/qcindex";
import {genCode} from "@/api/system/autocode/rule" import {genCode} from "@/api/system/autocode/rule";
import { getToken } from "@/utils/auth";
export default { export default {
name: "Qcindex", name: "Qcindex",
dicts: ['mes_index_type'], dicts: ['mes_index_type'],
...@@ -206,6 +263,20 @@ export default { ...@@ -206,6 +263,20 @@ export default {
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
upload: {
// 是否显示弹出层
open: false,
// 弹出层标题
title: "",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/mes/qc/qcindex/importData"
},
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
...@@ -228,6 +299,9 @@ export default { ...@@ -228,6 +299,9 @@ export default {
indexType: [ indexType: [
{ required: true, message: "检测项类型不能为空", trigger: "change" } { required: true, message: "检测项类型不能为空", trigger: "change" }
], ],
inputType: [
{ required: true, message: "输入类型不能为空", trigger: "change" }
],
} }
}; };
}, },
...@@ -256,6 +330,7 @@ export default { ...@@ -256,6 +330,7 @@ export default {
indexCode: null, indexCode: null,
indexName: null, indexName: null,
indexType: null, indexType: null,
inputType: null,
qcTool: null, qcTool: null,
remark: null, remark: null,
attr1: null, attr1: null,
...@@ -345,11 +420,37 @@ export default { ...@@ -345,11 +420,37 @@ export default {
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {});
}, },
// 文件上传中处理
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();
},
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('qc/qcindex/export', { this.download('mes/qc/qcindex/export', {
...this.queryParams ...this.queryParams
}, `qcindex_${new Date().getTime()}.xlsx`) }, `检测项_${new Date().getTime()}.xlsx`)
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "检测项";
this.upload.open = true;
},
/** 下载模板操作 */
importTemplate() {
this.download('mes/qc/qcindex/importTemplate', {
}, `检测项导入模版_${new Date().getTime()}.xlsx`)
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
}, },
//自动生成编码 //自动生成编码
handleAutoGenChange(autoGenFlag){ handleAutoGenChange(autoGenFlag){
......
...@@ -39,11 +39,17 @@ ...@@ -39,11 +39,17 @@
<el-table v-loading="loading" :data="templateindexList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="templateindexList" @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="检测项名称" align="center" prop="indexName" /> <el-table-column label="检测项名称" align="center" prop="indexName" />
<el-table-column label="检测项类型" align="center" prop="indexType"> <el-table-column label="检测项类型" align="center" prop="indexType" >
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.mes_index_type" :value="scope.row.indexType"/> <dict-tag :options="dict.type.mes_index_type" :value="scope.row.indexType"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="输入类型" align="center" prop="inputType">
<template slot-scope="scope">
<span v-if="scope.row.inputType==1">文本框</span>
<span v-if="scope.row.inputType==2">选择框</span>
</template>
</el-table-column>
<el-table-column label="检测工具" align="center" prop="qcTool" /> <el-table-column label="检测工具" align="center" prop="qcTool" />
<el-table-column label="检测方法" align="center" prop="checkMethod" :show-overflow-tooltip="true"/> <el-table-column label="检测方法" align="center" prop="checkMethod" :show-overflow-tooltip="true"/>
<el-table-column label="标准值" align="center" prop="standerVal" /> <el-table-column label="标准值" align="center" prop="standerVal" />
...@@ -69,7 +75,7 @@ ...@@ -69,7 +75,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
...@@ -103,6 +109,13 @@ ...@@ -103,6 +109,13 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row v-if="form.inputType == 2">
<el-col :span="24">
<el-form-item label="选择框值" prop="selectValues">
<el-input v-model="form.selectValues" type="textarea" placeholder="请输入下拉选择框内容,格式为:[{&quot;label&quot;:&quot;显式值&quot;,&quot;value&quot;:&quot;存储值&quot;}]" />
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="标准值" prop="standerVal"> <el-form-item label="标准值" prop="standerVal">
...@@ -193,6 +206,7 @@ export default { ...@@ -193,6 +206,7 @@ export default {
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
inputTypeOptions: [{"label":"输入框","value":1},{"label":"选择框","value":2}],
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
...@@ -202,6 +216,7 @@ export default { ...@@ -202,6 +216,7 @@ export default {
indexCode: null, indexCode: null,
indexName: null, indexName: null,
indexType: null, indexType: null,
selectValues: null,
qcTool: null, qcTool: null,
checkMethod: null, checkMethod: null,
standerVal: null, standerVal: null,
...@@ -344,7 +359,8 @@ export default { ...@@ -344,7 +359,8 @@ export default {
this.form.indexCode = obj.indexCode; this.form.indexCode = obj.indexCode;
this.form.indexName = obj.indexName; this.form.indexName = obj.indexName;
this.form.indexType = obj.indexType; this.form.indexType = obj.indexType;
this.form.qcTool = obj.qcTool; this.form.qcTool = obj.qcTool;
this.form.inputType = obj.inputType;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment