|
|
@@ -0,0 +1,224 @@
|
|
|
+<!-- 用户编辑弹窗 -->
|
|
|
+<template>
|
|
|
+ <el-dialog
|
|
|
+ class="ele-dialog-form"
|
|
|
+ :title="title"
|
|
|
+ :visible.sync="visible"
|
|
|
+ :before-close="handleClose"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ width="1000px"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-tabs v-model="activeName" type="card">
|
|
|
+ <el-tab-pane
|
|
|
+ :label="item.name"
|
|
|
+ :name="item.name"
|
|
|
+ v-for="item in activeList"
|
|
|
+ :key="item.name"
|
|
|
+ >
|
|
|
+ <el-table
|
|
|
+ v-show="activeName == '质检项' "
|
|
|
+ style="margin-top: 15px"
|
|
|
+ :data="form.parameterStandards"
|
|
|
+ border
|
|
|
+ height="40vh"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ :label="form.singleWeightDivision"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ label="参数上限"
|
|
|
+ align="center"
|
|
|
+ v-if="form.parameterType == 3"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-form-item label-width="0" prop="finalValue">
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ :disabled="type == 'detail'"
|
|
|
+ v-model="scope.row.finalValue"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="参数下限"
|
|
|
+ align="center"
|
|
|
+ v-if="form.parameterType == 3"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-form-item label-width="0" prop="initialValue">
|
|
|
+ <el-input
|
|
|
+ :disabled="type == 'detail'"
|
|
|
+ clearable
|
|
|
+ v-model="scope.row.initialValue"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="默认值"
|
|
|
+ align="center"
|
|
|
+ v-if="form.parameterType != 3"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-form-item label-width="0" prop="defaultValue">
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ :disabled="type == 'detail'"
|
|
|
+ v-model="scope.row.defaultValue"
|
|
|
+ placeholder="请输入"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :label="form.tolerance" align="center">
|
|
|
+ <el-table-column label="质检标准" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-form-item label-width="0" prop="inspectionStandard">
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="scope.row.toleranceValue"
|
|
|
+ placeholder="请输入"
|
|
|
+ :disabled="type == 'detail'"
|
|
|
+ >
|
|
|
+ <DictSelection
|
|
|
+ style="width: 100px"
|
|
|
+ slot="prepend"
|
|
|
+ clearable
|
|
|
+ :disabled="type == 'detail'"
|
|
|
+ dictName="数学字符"
|
|
|
+ v-model="scope.row.symbol"
|
|
|
+ ></DictSelection>
|
|
|
+ </el-input>
|
|
|
+ <!-- </el-form-item> -->
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ </el-tab-pane></el-tabs
|
|
|
+ >
|
|
|
+
|
|
|
+
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <template v-slot:footer>
|
|
|
+ <el-button @click="handleClose">取消</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :loading="loading"
|
|
|
+ @click="save"
|
|
|
+ v-if="type != 'detail'"
|
|
|
+ >
|
|
|
+ 保存
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ export default {
|
|
|
+ components: {},
|
|
|
+
|
|
|
+ data() {
|
|
|
+ const defaultForm = function () {
|
|
|
+ return {
|
|
|
+ parameterStandards: [],
|
|
|
+ linePoints: []
|
|
|
+ };
|
|
|
+ };
|
|
|
+ return {
|
|
|
+ defaultForm,
|
|
|
+ // 表单数据
|
|
|
+ form: { ...defaultForm() },
|
|
|
+ activeName: '质检项',
|
|
|
+ activeList: [{ name: '质检项' }],
|
|
|
+ // 表单验证规则
|
|
|
+ rules: {
|
|
|
+
|
|
|
+ },
|
|
|
+ visible: false,
|
|
|
+
|
|
|
+ title: null,
|
|
|
+ loading: false
|
|
|
+ };
|
|
|
+ },
|
|
|
+
|
|
|
+ created() {},
|
|
|
+ methods: {
|
|
|
+ open(row) {
|
|
|
+ this.form = JSON.parse(JSON.stringify(row));
|
|
|
+ this.visible = true;
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ handleDeleteItem(index, list) {
|
|
|
+ this.form[list].splice(index, 1);
|
|
|
+ },
|
|
|
+ /* 保存编辑 */
|
|
|
+ save() {},
|
|
|
+ restForm() {
|
|
|
+ this.form = { ...this.defaultForm() };
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.form.clearValidate();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleClose() {
|
|
|
+ this.restForm();
|
|
|
+ this.visible = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+</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;
|
|
|
+ }
|
|
|
+ :deep(
|
|
|
+ .el-dialog:not(.ele-dialog-form)
|
|
|
+ .el-dialog__body
|
|
|
+ .el-form
|
|
|
+ .el-table__body
|
|
|
+ .el-table__row
|
|
|
+ .el-form-item:last-child
|
|
|
+ ) {
|
|
|
+ margin-bottom: 0 !important;
|
|
|
+ }
|
|
|
+ .add-product {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-end;
|
|
|
+ font-size: 30px;
|
|
|
+ color: #1890ff;
|
|
|
+ margin: 10px 0;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+</style>
|