|
|
@@ -1,21 +1,17 @@
|
|
|
<!-- 用户编辑弹窗 -->
|
|
|
<template>
|
|
|
- <el-dialog class="ele-dialog-form" :title="title" :visible.sync="visible" :before-close="handleClose"
|
|
|
+ <el-dialog class="ele-dialog-form" title="编辑" v-if="visible" :visible.sync="visible" :before-close="handleClose"
|
|
|
:close-on-click-modal="false" :close-on-press-escape="false" width="1000px">
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
|
|
<el-row>
|
|
|
|
|
|
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="质检名称:" prop="name">
|
|
|
- <el-input clearable v-model="form.name" placeholder="请输入" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="版本号:" prop="version">
|
|
|
<el-input v-model="form.version"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="状态:" prop="status">
|
|
|
<el-select v-model="form.status" placeholder="请选择" style="width: 100%">
|
|
|
@@ -26,16 +22,12 @@
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="标准类型:" prop="type">
|
|
|
- <DictSelection dictName="质检标准类型" v-model="form.type"></DictSelection>
|
|
|
+ <el-form-item label="标准类型:" prop="mode">
|
|
|
+ <DictSelection dictName="质检方式" v-model="form.mode"></DictSelection>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="标准代码:" prop="standardCode">
|
|
|
- <el-input v-model="form.standardCode"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
@@ -125,7 +117,7 @@
|
|
|
|
|
|
<script>
|
|
|
|
|
|
-import { save, update, getById } from '@/api/inspectionStandard';
|
|
|
+import { update, getById } from '@/api/inspectionClassify';
|
|
|
import ProductModal from './ProductModal.vue'
|
|
|
export default {
|
|
|
components: {
|
|
|
@@ -172,7 +164,7 @@ export default {
|
|
|
|
|
|
},
|
|
|
visible: false,
|
|
|
- type: null,
|
|
|
+
|
|
|
title: null,
|
|
|
loading: false,
|
|
|
|
|
|
@@ -183,13 +175,9 @@ export default {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
- open(type, row) {
|
|
|
- this.title = type == 'add' ? '新增' : '编辑'
|
|
|
- this.type = type;
|
|
|
- if (this.type == 'edit') {
|
|
|
+ open(row) {
|
|
|
|
|
|
- this.getDetail(row.id)
|
|
|
- }
|
|
|
+ this.getDetail(row.id)
|
|
|
this.visible = true;
|
|
|
|
|
|
|
|
|
@@ -198,8 +186,8 @@ export default {
|
|
|
getDetail(id) {
|
|
|
getById(id).then(res => {
|
|
|
this.form = res.data
|
|
|
- this.form.postscriptRemoveIds = []
|
|
|
- this.form.toolRemoveIds = []
|
|
|
+ this.form['postscriptRemoveIds'] = []
|
|
|
+ this.form['toolRemoveIds'] = []
|
|
|
})
|
|
|
},
|
|
|
|
|
|
@@ -210,11 +198,9 @@ export default {
|
|
|
return false;
|
|
|
}
|
|
|
this.loading = true;
|
|
|
- if (this.type == 'add') {
|
|
|
- delete this.form.id;
|
|
|
- }
|
|
|
- let URL = this.type == 'add' ? save : update
|
|
|
- URL(this.form)
|
|
|
+
|
|
|
+
|
|
|
+ update(this.form)
|
|
|
.then((msg) => {
|
|
|
this.loading = false;
|
|
|
this.$message.success(msg);
|
|
|
@@ -228,9 +214,7 @@ export default {
|
|
|
},
|
|
|
restForm() {
|
|
|
this.form = { ...this.defaultForm() };
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.form.clearValidate();
|
|
|
- });
|
|
|
+
|
|
|
},
|
|
|
handleClose() {
|
|
|
this.restForm();
|
|
|
@@ -271,7 +255,6 @@ export default {
|
|
|
this.$confirm(`是否删除这个事项?`).then(async () => {
|
|
|
this.form.postscriptList.splice(idx, 1)
|
|
|
|
|
|
-
|
|
|
this.form.postscriptRemoveIds.push(row.id)
|
|
|
|
|
|
})
|