|
|
@@ -1,19 +1,19 @@
|
|
|
<!-- 用户编辑弹窗 -->
|
|
|
<template>
|
|
|
<ele-modal
|
|
|
- width="960px"
|
|
|
+ width="1000px"
|
|
|
:visible="visible"
|
|
|
:append-to-body="true"
|
|
|
:close-on-click-modal="false"
|
|
|
custom-class="ele-dialog-form"
|
|
|
- :title="isUpdate ? '修改参数' : '添加参数'"
|
|
|
+ :title="isUpdate ? '修改质检项' : '新建质检项'"
|
|
|
@update:visible="updateVisible"
|
|
|
>
|
|
|
<header-title title="基本信息"></header-title>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="质检标准:" prop="qualityStandardId">
|
|
|
+ <el-form-item label="标准名称:" prop="qualityStandardId">
|
|
|
<el-select
|
|
|
v-model="form.qualityStandardId"
|
|
|
placeholder="请选择"
|
|
|
@@ -182,6 +182,97 @@
|
|
|
<el-form-item label="附件:" prop="imgUrl"> </el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+
|
|
|
+ <headerTitle title="质检工具">
|
|
|
+ <el-button type="primary" size="small" @click="handleAdd"
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
+ </headerTitle>
|
|
|
+
|
|
|
+ <el-table
|
|
|
+ ref="multipleTable"
|
|
|
+ :data="form.toolList"
|
|
|
+ tooltip-effect="dark"
|
|
|
+ style="width: 100%"
|
|
|
+ stripe
|
|
|
+ :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
|
|
|
+ >
|
|
|
+ <el-table-column label="设备名称" prop="code" min-width="120">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ {{ row.name }}
|
|
|
+ </template></el-table-column
|
|
|
+ >
|
|
|
+
|
|
|
+ <el-table-column label="设备编码" prop="code" min-width="120">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ {{ row.code }}
|
|
|
+ </template></el-table-column
|
|
|
+ >
|
|
|
+
|
|
|
+ <el-table-column label="牌号" prop="brandNum" min-width="120">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ {{ row.brandNum }}
|
|
|
+ </template></el-table-column
|
|
|
+ >
|
|
|
+
|
|
|
+ <el-table-column label="型号" prop="modelType" min-width="120">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ {{ row.modelType }}
|
|
|
+ </template></el-table-column
|
|
|
+ >
|
|
|
+
|
|
|
+ <el-table-column label="操作" fixed="right">
|
|
|
+ <template slot-scope="{ $index, row }">
|
|
|
+ <el-button type="text" @click="removeItem($index, row)"
|
|
|
+ >删除设备</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <headerTitle title="注意事项">
|
|
|
+ <el-button type="primary" size="small" @click="addPostscript"
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
+ </headerTitle>
|
|
|
+
|
|
|
+ <el-table
|
|
|
+ ref="multipleTable"
|
|
|
+ :data="form.postscriptList"
|
|
|
+ tooltip-effect="dark"
|
|
|
+ style="width: 100%"
|
|
|
+ stripe
|
|
|
+ :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
|
|
|
+ >
|
|
|
+ <el-table-column label="排序" prop="" width="100">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入"
|
|
|
+ type="number"
|
|
|
+ v-model.number="row.sort"
|
|
|
+ clearable
|
|
|
+ ></el-input> </template
|
|
|
+ ></el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="注意事项" prop="" min-width="120">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入"
|
|
|
+ type="textarea"
|
|
|
+ :rows="1"
|
|
|
+ v-model="row.content"
|
|
|
+ clearable
|
|
|
+ ></el-input> </template
|
|
|
+ ></el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="操作" fixed="right" width="100">
|
|
|
+ <template slot-scope="{ $index, row }">
|
|
|
+ <el-button type="text" @click="removePostscript($index, row)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
</el-form>
|
|
|
|
|
|
<template v-slot:footer>
|
|
|
@@ -190,6 +281,8 @@
|
|
|
保存
|
|
|
</el-button>
|
|
|
</template>
|
|
|
+
|
|
|
+ <ProductModal ref="productRefs" @chooseModal="chooseModal" />
|
|
|
</ele-modal>
|
|
|
</template>
|
|
|
|
|
|
@@ -197,8 +290,13 @@
|
|
|
import { save, update, getById } from '@/api/inspectionProject';
|
|
|
|
|
|
import { getList } from '@/api/inspectionStandard';
|
|
|
+ import ProductModal from './ProductModal.vue';
|
|
|
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ ProductModal
|
|
|
+ },
|
|
|
+
|
|
|
props: {
|
|
|
// 弹窗是否打开
|
|
|
visible: Boolean,
|
|
|
@@ -223,7 +321,12 @@
|
|
|
unit: '',
|
|
|
symbol: '',
|
|
|
inspectionRemark: '',
|
|
|
- imgUrl: []
|
|
|
+ imgUrl: [],
|
|
|
+
|
|
|
+ toolList: [],
|
|
|
+ postscriptList: [],
|
|
|
+ toolRemoveIds: [],
|
|
|
+ postscriptRemoveIds: []
|
|
|
};
|
|
|
return {
|
|
|
defaultForm,
|
|
|
@@ -364,6 +467,36 @@
|
|
|
getList(param).then((res) => {
|
|
|
this.qualityStandardList = res.list;
|
|
|
});
|
|
|
+ },
|
|
|
+
|
|
|
+ handleAdd() {
|
|
|
+ this.$refs.productRefs.open(this.form.toolList);
|
|
|
+ },
|
|
|
+
|
|
|
+ chooseModal(data) {
|
|
|
+ this.form.toolList = [...this.form.toolList, ...data];
|
|
|
+ },
|
|
|
+
|
|
|
+ removeItem(idx, row) {
|
|
|
+ this.$confirm(`是否删除这个设备?`).then(async () => {
|
|
|
+ this.form.toolList.splice(idx, 1);
|
|
|
+
|
|
|
+ if (row.id) {
|
|
|
+ this.form.toolRemoveIds.push(row.id);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ addPostscript() {
|
|
|
+ this.form.postscriptList.push({ sort: null, content: '' });
|
|
|
+ },
|
|
|
+ removePostscript(idx, row) {
|
|
|
+ this.$confirm(`是否删除这个事项?`).then(async () => {
|
|
|
+ this.form.postscriptList.splice(idx, 1);
|
|
|
+ if (row.id) {
|
|
|
+ this.form.postscriptRemoveIds.push(row.id);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
|