Commit 3be3014e authored by zhuli's avatar zhuli

# 检验项目调整

parent 9f9169dc
......@@ -85,6 +85,7 @@
<el-table v-loading="loading" :data="qctemplateList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="检测模板编号" align="center" prop="templateCode" >
<template slot-scope="scope">
<el-button
......
......@@ -27,12 +27,12 @@
</el-form-item>
<el-form-item label="是否质检确认" prop="isConfirm">
<el-select v-model="queryParams.isConfirm" placeholder="请选择是否质检确认" clearable>
<el-option label="请选择字典生成" value="" />
<el-option label="请选择字典生成" value=""/>
</el-select>
</el-form-item>
<el-form-item label="是否新品" prop="isNewProduct">
<el-select v-model="queryParams.isNewProduct" placeholder="请选择是否新品" clearable>
<el-option label="请选择字典生成" value="" />
<el-option label="请选择字典生成" value=""/>
</el-select>
</el-form-item>
<el-form-item>
......@@ -50,7 +50,8 @@
size="mini"
@click="handleAdd"
v-hasPermi="['qc:templateProcess:add']"
>新增</el-button>
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
......@@ -61,7 +62,8 @@
:disabled="single"
@click="handleUpdate"
v-hasPermi="['qc:templateProcess:edit']"
>修改</el-button>
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
......@@ -72,7 +74,8 @@
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['qc:templateProcess:remove']"
>删除</el-button>
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
......@@ -82,7 +85,8 @@
size="mini"
@click="handleExport"
v-hasPermi="['qc:templateProcess:export']"
>导出</el-button>
>导出
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
......@@ -92,20 +96,21 @@
size="mini"
@click="handleImport"
v-hasPermi="['mes:qc:templateProcess:import']"
>导入</el-button>
>导入
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="templateProcessList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="检测模板" align="center" prop="templateName" />
<el-table-column label="物料类型名称" align="center" prop="itemTypeName" />
<el-table-column label="工序名称" align="center" prop="processName" />
<el-table-column label="最大数量" align="center" prop="maxNum" />
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="检测模板" align="center" prop="templateName"/>
<el-table-column label="物料类型名称" align="center" prop="itemTypeName"/>
<el-table-column label="工序名称" align="center" prop="processName"/>
<el-table-column label="最大数量" align="center" prop="maxNum"/>
<el-table-column label="是否质检确认" align="center" prop="isConfirm" :formatter="yesNoFmt"/>
<el-table-column label="是否新品" align="center" prop="isNewProduct" :formatter="yesNoFmt"/>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="备注" align="center" prop="remark"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
......@@ -114,14 +119,16 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['qc:templateProcess:edit']"
>修改</el-button>
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['qc:templateProcess:remove']"
>删除</el-button>
>删除
</el-button>
</template>
</el-table-column>
</el-table>
......@@ -138,21 +145,22 @@
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="检测模板" prop="templateId">
<el-input v-model="form.templateName" placeholder="请选择检测模板" >
<el-input v-model="form.templateName" placeholder="请选择检测模板">
<el-button slot="append" @click="handleSelectTemplate" icon="el-icon-search"></el-button>
</el-input>
<TemplateSelect ref="templateSelect" @onSelected="onTemplateSelected" ></TemplateSelect>
<TemplateSelect ref="templateSelect" @onSelected="onTemplateSelected"></TemplateSelect>
</el-form-item>
<el-form-item label="物料类型" prop="itemTypeId">
<treeselect v-model="form.itemTypeId" :options="itemTypeOptions" :show-count="true" @select="onItemTypeSelected" placeholder="请选择所属分类" />
<treeselect v-model="form.itemTypeId" :options="itemTypeOptions" :show-count="true"
@select="onItemTypeSelected" placeholder="请选择所属分类"/>
</el-form-item>
<el-form-item label="工序名称" prop="processName">
<el-input v-model="form.processName" placeholder="请输入工序名称" >
<el-input v-model="form.processName" placeholder="请输入工序名称">
<el-button slot="append" @click="visible = true" icon="el-icon-search"></el-button>
</el-input>
</el-form-item>
<el-form-item label="最大数量" prop="maxNum">
<el-input v-model="form.maxNum" placeholder="请输入最大数量" />
<el-input v-model="form.maxNum" placeholder="请输入最大数量"/>
</el-form-item>
<el-form-item label="是否质检确认" prop="isConfirm">
<el-select style="width:100%;" v-model="form.isConfirm" placeholder="请选择是否质检确认">
......@@ -167,7 +175,7 @@
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
......@@ -192,10 +200,13 @@
<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" /> 是否更新已经存在的用户数据
<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>
<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">
......@@ -217,13 +228,19 @@
</template>
<script>
import { listTemplateProcess, getTemplateProcess, delTemplateProcess, addTemplateProcess, updateTemplateProcess } from "@/api/mes/qc/templateProcess";
import { treeselect } from "@/api/mes/md/itemtype";
import {
listTemplateProcess,
getTemplateProcess,
delTemplateProcess,
addTemplateProcess,
updateTemplateProcess
} from "@/api/mes/qc/templateProcess";
import {treeselect} from "@/api/mes/md/itemtype";
import TemplateSelect from "@/components/qctemplateSelect/single.vue";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import processList from '@/views/mes/pro/process/index'
import { getToken } from "@/utils/auth";
import {getToken} from "@/utils/auth";
export default {
name: "TemplateProcess",
......@@ -257,14 +274,26 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
templateId: null, itemTypeId: null, itemTypeName: null, processName: null, maxNum: null, isConfirm: null, isNewProduct: null, attr1: null, attr2: null, attr3: null, attr4: null, },
templateId: null,
itemTypeId: null,
itemTypeName: null,
processName: null,
maxNum: null,
isConfirm: null,
isNewProduct: null,
attr1: null,
attr2: null,
attr3: null,
attr4: null,
},
// 表单参数
form: {
recordId: null,
id: null,
templateId: null,
templateName: null,
itemTypeId: null,
itemTypeName: null,
processId:null,
processName: null,
maxNum: null,
isConfirm: 0,
......@@ -281,16 +310,16 @@ export default {
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
headers: {Authorization: "Bearer " + getToken()},
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/mes/qc/templateProcess/importData"
},
// 表单校验
rules: {
templateId: [
{ required: true, message: "检测模板不能为空", trigger: "blur" }
{required: true, message: "检测模板不能为空", trigger: "blur"}
], processName: [
{ required: true, message: "工序名称不能为空", trigger: "blur" }
{required: true, message: "工序名称不能为空", trigger: "blur"}
],
},
visible: false
......@@ -311,11 +340,13 @@ export default {
});
},
handleSubmitProcess() {
if (!this.$refs.processListRef.selectedItemId) {
this.$message.warning('请选择工序')
return
}
this.form.processName = this.$refs.processListRef.currentData.processName
this.form.processId = this.$refs.processListRef.currentData.processId
this.visible = false
},
// 取消按钮
......@@ -326,11 +357,12 @@ export default {
// 表单重置
reset() {
this.form = {
recordId: null,
id: null,
templateId: null,
templateName: null,
itemTypeId: null,
itemTypeName: null,
processId:null,
processName: null,
maxNum: null,
isConfirm: 0,
......@@ -357,8 +389,8 @@ export default {
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.recordId)
this.single = selection.length!==1
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
......@@ -370,8 +402,8 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const recordId = row.recordId || this.ids
getTemplateProcess(recordId).then(response => {
const id = row.id || this.ids
getTemplateProcess(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改工序检测模板";
......@@ -381,7 +413,7 @@ export default {
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.recordId != null) {
if (this.form.id != null) {
updateTemplateProcess(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
......@@ -399,13 +431,14 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
const recordIds = row.recordId || this.ids;
this.$modal.confirm('是否确认删除工序检测模板编号为"' + recordIds + '"的数据项?').then(function() {
const recordIds = row.id || this.ids;
this.$modal.confirm('是否确认删除工序检测模板编号为"' + recordIds + '"的数据项?').then(function () {
return delTemplateProcess(recordIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
......@@ -414,7 +447,7 @@ export default {
}, `工序检测模板_${new Date().getTime()}.xlsx`)
},
//选择检测项弹出框
handleSelectTemplate(){
handleSelectTemplate() {
this.$refs.templateSelect.showFlag = true;
},
yesNoFmt(row, column, cellValue) {
......@@ -425,13 +458,13 @@ export default {
}
},
//弹框返回值
onTemplateSelected(obj){
if(obj != undefined && obj != null){
this.form.templateId = obj.templateId;
onTemplateSelected(obj) {
if (obj != undefined && obj != null) {
this.form.templateId = obj.id;
this.form.templateName = obj.templateName;
}
},
onItemTypeSelected(obj){
onItemTypeSelected(obj) {
this.form.itemTypeName = obj.label;
},
// 文件上传中处理
......@@ -443,7 +476,7 @@ export default {
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.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", {dangerouslyUseHTMLString: true});
this.getList();
},
/** 导入按钮操作 */
......@@ -453,8 +486,7 @@ export default {
},
/** 下载模板操作 */
importTemplate() {
this.download('mes/qc/templateProcess/importTemplate', {
}, `工序检测模版导入模版_${new Date().getTime()}.xlsx`)
this.download('mes/qc/templateProcess/importTemplate', {}, `工序检测模版导入模版_${new Date().getTime()}.xlsx`)
},
// 提交上传文件
submitFileForm() {
......
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