|
|
@@ -42,71 +42,10 @@
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
|
|
|
- <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="操作" 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="220">
|
|
|
- <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">
|
|
|
- <template slot-scope="{ $index, row }">
|
|
|
- <el-button type="text" @click="removePostscript($index, row)">删除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
-
|
|
|
- </el-table>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -118,7 +57,7 @@
|
|
|
</template>
|
|
|
|
|
|
|
|
|
- <ProductModal ref="productRefs" @chooseModal="chooseModal" />
|
|
|
+
|
|
|
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
@@ -126,10 +65,10 @@
|
|
|
<script>
|
|
|
|
|
|
import { save, update, getById } from '@/api/inspectionStandard';
|
|
|
-import ProductModal from './ProductModal.vue'
|
|
|
+
|
|
|
export default {
|
|
|
components: {
|
|
|
- ProductModal
|
|
|
+
|
|
|
},
|
|
|
|
|
|
|
|
|
@@ -143,10 +82,7 @@ export default {
|
|
|
type: '',
|
|
|
version: '',
|
|
|
standardCode: '',
|
|
|
- toolList: [],
|
|
|
- postscriptList: [],
|
|
|
- toolRemoveIds: [],
|
|
|
- postscriptRemoveIds: []
|
|
|
+
|
|
|
};
|
|
|
};
|
|
|
return {
|
|
|
@@ -198,8 +134,7 @@ export default {
|
|
|
getDetail(id) {
|
|
|
getById(id).then(res => {
|
|
|
this.form = res.data
|
|
|
- this.form.postscriptRemoveIds = []
|
|
|
- this.form.toolRemoveIds = []
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
|
|
|
@@ -237,60 +172,17 @@ export default {
|
|
|
this.visible = false;
|
|
|
},
|
|
|
|
|
|
- handleAdd() {
|
|
|
- this.$refs.productRefs.open(this.form.toolList)
|
|
|
- },
|
|
|
|
|
|
- chooseModal(data) {
|
|
|
- this.form.toolList = data
|
|
|
- console.log(data)
|
|
|
- },
|
|
|
|
|
|
- removeItem(idx, row) {
|
|
|
- if (this.form.toolList.length == 1) {
|
|
|
- return this.$message.error('至少保留一个设备!');
|
|
|
- }
|
|
|
|
|
|
- this.$confirm(`是否删除这个设备?`).then(async () => {
|
|
|
- this.form.toolList.splice(idx, 1)
|
|
|
|
|
|
|
|
|
- this.form.toolRemoveIds.push(row.id)
|
|
|
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- addPostscript() {
|
|
|
- this.form.postscriptList.push({ sort: null, content: '' })
|
|
|
- },
|
|
|
- removePostscript(idx, row) {
|
|
|
- if (this.form.postscriptList.length == 1) {
|
|
|
- return this.$message.error('至少保留一个事项!');
|
|
|
- }
|
|
|
-
|
|
|
- this.$confirm(`是否删除这个事项?`).then(async () => {
|
|
|
- this.form.postscriptList.splice(idx, 1)
|
|
|
-
|
|
|
-
|
|
|
- this.form.postscriptRemoveIds.push(row.id)
|
|
|
-
|
|
|
- })
|
|
|
- },
|
|
|
|
|
|
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
-.location-warp {
|
|
|
- display: flex;
|
|
|
-
|
|
|
- .detail {
|
|
|
- margin-left: 10px;
|
|
|
- }
|
|
|
-}
|
|
|
|
|
|
-:deep(.el-dialog:not(.ele-dialog-form) .el-dialog__body .el-form .el-form-item:last-child) {
|
|
|
- margin-bottom: 22px;
|
|
|
-}
|
|
|
</style>
|