Procházet zdrojové kódy

Merge remote-tracking branch 'origin/dev' into dev

Z před 1 rokem
rodič
revize
5dbfba9f8d

+ 11 - 0
src/api/material/inspectionClassify.js

@@ -15,6 +15,17 @@ export async function getList (data) {
 }
 
 
+export async function pageByBom (data) {
+  let par = new URLSearchParams(data);
+  const res = await request.get(`/qms/qualitylevel/pageByBom?` + par, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+
   
 
   export async function getById(id) {

+ 6 - 0
src/styles/transition/common.scss

@@ -168,3 +168,9 @@ table th .is-required::before{
     display: none !important;
   }
 }
+
+
+
+.el-dialog {
+  margin-top: 5vh !important;
+}

+ 1 - 1
src/views/factoryModel/station/components/edit.vue

@@ -97,7 +97,7 @@
               v-if="form.extInfo.type == 3"
             >
               <el-select
-                            style="width: 100%"
+                style="width: 100%"
                 v-model="form.extInfo.teamId"
                 clearable
                 :filterable="true"

+ 0 - 238
src/views/material/BOMmanage/qualityTesting/inspectionClassify/components/edit.vue

@@ -1,238 +0,0 @@
-<!-- 用户编辑弹窗 -->
-<template>
-  <el-dialog
-    class="ele-dialog-form"
-    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-table
-        style="margin-top: 15px"
-        :data="form.parameterStandards"
-        border
-        height="40vh"
-        @selection-change="handleSelectionChange"
-      >
-        <el-table-column type="selection" align="center" width="55">
-        </el-table-column>
-
-        <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-form>
-
-    <template v-slot:footer>
-      <el-button @click="handleClose">取消</el-button>
-      <el-button type="primary" :loading="loading" @click="save">
-        保存
-      </el-button>
-    </template>
-  </el-dialog>
-</template>
-
-<script>
-  import { EventBus } from '@/utils/eventBus';
-  export default {
-    components: {},
-
-    data() {
-      const defaultForm = function () {
-        return {
-          parameterStandards: [],
-          linePoints: []
-        };
-      };
-      return {
-        defaultForm,
-        // 表单数据
-        form: { ...defaultForm() },
-
-        // 表单验证规则
-        rules: {},
-        visible: false,
-
-        type: '',
-        loading: false,
-
-        multipleSelection: [],
-        rowObj: {}
-      };
-    },
-
-    created() {},
-    methods: {
-      open(type, rowItem) {
-        this.rowObj = rowItem;
-        let row = rowItem.qualityStandard || {};
-        this.type = type;
-        if (this.type != 'add') {
-          row.linePoints = row.linePoints || [];
-          if (!row.parameterStandards) {
-            row.parameterStandards = [];
-          } else {
-            row.singleWeightDivision =
-              row.parameterStandards[0]?.singleWeightDivision;
-            row.tolerance = row.parameterStandards[0]?.tolerance;
-            row.parameterType = row.parameterStandards[0]?.parameterType;
-          }
-          this.form = JSON.parse(JSON.stringify(row));
-  
-        }
-        this.visible = true;
-      },
-
-      handleSelectionChange(val) {
-        this.multipleSelection = val;
-      },
-
-      /* 保存编辑 */
-      save() {
-        let _row = JSON.parse(JSON.stringify(this.rowObj));
-        let row = _row.qualityStandard || {};
-
-        if (!row.parameterStandards) {
-          row.parameterStandards = [];
-        } else {
-          row.singleWeightDivision =
-            row.parameterStandards[0]?.singleWeightDivision;
-          row.tolerance = row.parameterStandards[0]?.tolerance;
-          row.parameterType = row.parameterStandards[0]?.parameterType;
-        }
-
-
-        row.parameterStandards = this.multipleSelection;
-        _row.qualityStandard = row;
-        EventBus.$emit('inspectionSelection', { message: _row });
-
-        this.handleClose();
-      },
-      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>

+ 0 - 170
src/views/material/BOMmanage/qualityTesting/inspectionClassify/components/user-list.vue

@@ -1,170 +0,0 @@
-<template>
-  <div>
-    <user-search @search="reload" ref="searchRef"> </user-search>
-    <!-- 数据表格 -->
-
-    <ele-pro-table
-      ref="table"
-      :columns="columns"
-      :datasource="datasource"
-      height="calc(100vh - 365px)"
-      full-height="calc(100vh - 116px)"
-      tool-class="ele-toolbar-form"
-      cache-key="systemOrgUserTable"
-    >
-      <!-- 编码列 -->
-
-      <template v-slot:name="{ row }">
-        {{  row.qualityStandard && row.qualityStandard.name }}
-      </template>
-
-      <template v-slot:code="{ row }">
-        <el-link
-          @click="openDetail(row)"
-          type="primary"
-          :underline="false"
-        >
-          {{  row.qualityStandard && row.qualityStandard.code }}
-        </el-link>
-      </template>
-
-      <template v-slot:type="{ row }">
-        {{ getDictValue('质检标准类型',  row.qualityStandard && row.qualityStandard.type) }}
-      </template>
-
-      <template v-slot:standardCode="{ row }">
-        {{  row.qualityStandard && row.qualityStandard.standardCode }}
-      </template>
-
-      <template v-slot:status="{ row }">
-        {{  row.qualityStandard && row.qualityStandard.status == 1 ? '启用' : '停用' }}
-      </template>
-
-      <template v-slot:mode="{ row }">
-        {{ getDictValue('质检方式', row.mode) }}
-      </template>
-
-      <template v-slot:version="{ row }">
-        {{  row.qualityStandard && row.qualityStandard.version }}
-      </template>
-    </ele-pro-table>
-
-    <Detail ref="detailRef" ></Detail>
-  </div>
-</template>
-
-<script>
-  import userSearch from './user-search.vue';
-  import { getList } from '@/api/material/inspectionClassify';
-  import dictMixins from '@/mixins/dictMixins';
-  import Detail from './edit.vue';
-
-  export default {
-    mixins: [dictMixins],
-    components: { userSearch, Detail },
-    props: {
-      // 类别id
-
-      rootId: [Number, String]
-    },
-    data() {
-      return {
-        // 当前编辑数据
-        current: null,
-
-        // 表格列配置
-        columns: [
-          {
-            columnKey: 'index',
-            type: 'index',
-            label: '序号',
-            width: 55,
-            align: 'center'
-          },
-
-          {
-            prop: 'code',
-            label: '标准编码',
-            showOverflowTooltip: true,
-            minWidth: 110,
-            slot: 'code'
-          },
-
-          {
-            prop: 'name',
-            label: '标准名称',
-            showOverflowTooltip: true,
-            minWidth: 110,
-            slot: 'name'
-          },
-
-          {
-            label: '标准类型',
-            prop: 'type',
-            slot: 'type'
-          },
-
-          {
-            label: '标准代码',
-            prop: 'standardCode'
-          },
-
-          {
-            prop: 'status',
-            label: '状态',
-            align: 'center',
-            minWidth: 110,
-            slot: 'status'
-          },
-
-          {
-            prop: 'version',
-            label: '版本号',
-            align: 'center',
-            minWidth: 110,
-            slot: 'version'
-          }
-        ]
-      };
-    },
-    created() {
-      this.requestDict('质检方式');
-      this.requestDict('质检标准类型');
-    },
-    methods: {
-      /* 表格数据源 */
-      datasource({ page, limit, where }) {
-      let _data = null;
-      _data = getList({
-          ...where,
-          pageNum: page,
-          size: limit,
-          categoryLevelId: this.categoryLevelId || 12,
-          rootCategoryLevelId: this.rootId
-        });
-
-   
-        return _data
-      },
-      /* 刷新表格 */
-      reload(where) {
-        this.$refs.table.reload({
-          pageNum: 1,
-          where: where,
-          categoryLevelId: this.categoryLevelId,
-          rootCategoryLevelId: this.rootId
-        });
-      },
-
-      clickSearch(info) {
-        this.categoryLevelId = info.id;
-        this.rootCategoryLevelId = info.rootCategoryLevelId;
-        this.reload();
-      },
-
-      openDetail(row) {
-        this.$refs.detailRef.open('detail',row);
-      }
-    }
-  };
-</script>

+ 54 - 56
src/views/material/BOMmanage/qualityTesting/inspectionClassify/components/user-search.vue

@@ -1,8 +1,12 @@
 <!-- 搜索表单 -->
 <template>
-  <el-form label-width="77px" class="ele-form-search" @keyup.enter.native="search" @submit.native.prevent>
+  <el-form
+    label-width="77px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
     <el-row :gutter="15">
-
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="质检名称:">
           <el-input clearable v-model="where.name" placeholder="请输入" />
@@ -10,26 +14,32 @@
       </el-col>
 
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="状态:">
-
-          <el-select clearable  v-model="where.status" placeholder="请选择状态">
-            <el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value">
-            </el-option>
-          </el-select>
-
-        </el-form-item>
-      </el-col>
-      <el-col v-bind="styleResponsive ?{ lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="组织机构:">
-          <auth-selection data-type="Array" v-model="where.deptIds" style="width: 100%"></auth-selection>
+          <auth-selection
+            data-type="Array"
+            v-model="where.deptIds"
+            style="width: 100%"
+          ></auth-selection>
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label-width="50px">
-          <el-button type="primary" icon="el-icon-search" class="ele-btn-icon" @click="search" size="small">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+            size="small"
+          >
             查询
           </el-button>
-          <el-button @click="reset" icon="el-icon-refresh-left" size="small" type="primary">重置</el-button>
+          <el-button
+            @click="reset"
+            icon="el-icon-refresh-left"
+            size="small"
+            type="primary"
+            >重置</el-button
+          >
         </el-form-item>
       </el-col>
     </el-row>
@@ -37,48 +47,36 @@
 </template>
 
 <script>
-export default {
-  data() {
-    // 默认表单数据
-    const defaultWhere = {
-      name: '',
-      status: ''
-    };
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        name: '',
+        status: 1
+      };
 
-
-    return {
-      // 表单数据
-      where: { ...defaultWhere },
-
-      statusList: [
-        {
-          value: 0,
-          label: '停用'
-        },
-        {
-          value: 1,
-          label: '启用'
-        }
-      ]
-    };
-  },
-  computed: {
-    // 是否开启响应式布局
-    styleResponsive() {
-      return this.$store.state.theme.styleResponsive;
-    }
-  },
-  methods: {
-    /* 搜索 */
-    search() {
-      console.log(this.where);
-      this.$emit('search', this.where);
+      return {
+        // 表单数据
+        where: { ...defaultWhere }
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
     },
-    /*  重置 */
-    reset() {
-      this.where = { ...this.defaultWhere };
-      this.search();
+    methods: {
+      /* 搜索 */
+      search() {
+        console.log(this.where);
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      }
     }
-  }
-};
+  };
 </script>

+ 222 - 15
src/views/material/BOMmanage/qualityTesting/inspectionClassify/index.vue

@@ -2,6 +2,7 @@
   <el-dialog
     title="质检"
     :visible.sync="visible"
+      v-if="visible"
     :before-close="handleClose"
     :close-on-click-modal="false"
     :close-on-press-escape="false"
@@ -26,28 +27,95 @@
             </div>
           </div>
           <template v-slot:content>
-            <user-list
-              v-if="current"
-              :category-id="current.id"
-              :root-id="rootId"
-              ref="searchRef"
-            />
+            <user-search @search="reload" ref="searchRef"> </user-search>
+            <!-- 数据表格 -->
+            <ele-pro-table
+              ref="table"
+              :columns="columns"
+              :datasource="datasource"
+              height="calc(100vh - 405px)"
+              full-height="calc(100vh - 116px)"
+              tool-class="ele-toolbar-form"
+              cache-key="inspectionClassify"
+              row-key="qualityLevelId"
+              :selection.sync="selection"
+            >
+              <!-- 表头工具栏 -->
+
+              <template v-slot:textType="{ row }">
+                {{
+                  row.textType == 1
+                    ? '数值'
+                    : row.textType == 2
+                    ? '选择'
+                    : row.textType == 3
+                    ? '上下限'
+                    : row.textType == 4
+                    ? '规格'
+                    : row.textType == 5
+                    ? '时间'
+                    : row.textType == 6
+                    ? '范围'
+                    : ''
+                }}
+              </template>
+
+              <template v-slot:type="{ row }">
+                {{
+                  getDictValue('质检标准类型', row.qualityStandardType)
+                }}
+              </template>
+
+              <template v-slot:defaultValue="{ row }">
+                <div>
+                  <span v-if="row.textType == 3">
+                    [ {{ row.minValue }}-{{ row.maxValue }}]
+                  </span>
+                  <span v-else>{{ row.defaultValue }}</span>
+
+                  <span> {{ row.unit }}</span>
+                </div>
+              </template>
+
+              <template v-slot:toolList="{ row }">
+                <div
+                  style="display: inline-block"
+                  v-for="(item, idx) in row.toolList"
+                  :key="idx"
+                  >{{ item.name }}
+                  <span
+                    v-if="
+                      row.toolList &&
+                      idx != row.toolList.length - 1
+                    "
+                    >,
+                  </span></div
+                >
+              </template>
+            </ele-pro-table>
           </template>
         </ele-split-layout>
       </el-card>
     </div>
+
+    <div slot="footer">
+      <el-button type="primary" @click="handleSave"> 选择 </el-button>
+      <el-button @click="handleClose"> 取消 </el-button>
+    </div>
   </el-dialog>
 </template>
 
 <script>
   import AssetTree from '@/components/AssetTree';
-  import userList from './components/user-list.vue';
-  import { EventBus } from '@/utils/eventBus';
+  import userSearch from './components/user-search.vue';
+  import { pageByBom } from '@/api/material/inspectionClassify';
+  import dictMixins from '@/mixins/dictMixins';
 
   export default {
+    mixins: [dictMixins],
     components: {
       AssetTree,
-      userList
+      userSearch
     },
     data() {
       return {
@@ -57,23 +125,145 @@
         selection: [],
         current: null,
         rootId: '12',
-        visible: false
+        visible: false,
+
+        columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center',
+            reserveSelection: true
+          },
+
+          {
+            prop: 'categoryLevelName',
+            label: '质检类型',
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            prop: 'inspectionCode',
+            label: '参数编码',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'inspectionName',
+            label: '参数名称',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            prop: 'textType',
+            label: '参数类型',
+            showOverflowTooltip: true,
+            align: 'center',
+            slot: 'textType',
+            minWidth: 110
+          },
+
+          {
+            prop: 'defaultValue',
+            slot: 'defaultValue',
+            label: '工艺参数',
+            align: 'center',
+            minWidth: 150
+          },
+
+          {
+            label: '工艺要求',
+            prop: 'inspectionStandard',
+            formatter: (row, column, cellValue) => {
+              return (
+                row.symbol + ' ' + cellValue + ' ' + row.unit
+              );
+            },
+            minWidth: 150
+          },
+          {
+            label: '标准类型',
+            prop: 'type',
+            slot: 'type'
+          },
+
+          {
+            prop: 'qualityStandardName',
+            label: '标准名称',
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            label: '状态',
+            prop: 'status',
+            formatter: (row, column, cellValue) => {
+              return cellValue == 1 ? '启用' : cellValue === 0 ? '停用' : '';
+            }
+          },
+
+          {
+            prop: 'toolList',
+            slot: 'toolList',
+            label: '工具名称',
+            align: 'center',
+            minWidth: 150
+          },
+
+          {
+            label: '备注',
+            prop: 'inspectionRemark'
+          }
+        ]
       };
     },
 
     created() {
-      EventBus.$on('inspectionSelection', (data) => {
-        this.handleClose();
-      });
+      this.requestDict('质检方式');
+      this.requestDict('质检标准类型');
     },
     methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where }) {
+        let _data = null;
+        _data = pageByBom({
+          ...where,
+          pageNum: page,
+          size: limit,
+          categoryLevelId: this.categoryLevelId || 12,
+          rootCategoryLevelId: this.rootId
+        });
+
+        return _data;
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({
+          pageNum: 1,
+          where: where,
+          categoryLevelId: this.categoryLevelId,
+          rootCategoryLevelId: this.rootId
+        });
+      },
+
       handleNodeClick(info) {
         this.current = info;
         this.$nextTick(() => {
           console.log(info);
-          this.$refs.searchRef.clickSearch(info);
+          this.clickSearch(info);
         });
       },
+
+      clickSearch(info) {
+        this.categoryLevelId = info.id;
+        this.rootCategoryLevelId = info.rootCategoryLevelId;
+        this.reload();
+      },
+
       // 获取根节点id
       setRootId(id) {
         if (id) {
@@ -81,12 +271,29 @@
         }
       },
 
-      open() {
+      open(list) {
         this.visible = true;
+        this.$nextTick(() => {
+          list.forEach((item) => {
+            this.$refs.table && this.$refs.table.toggleRowSelection(item, true);
+          });
+        });
       },
 
       handleClose() {
+        this.$refs.table && this.$refs.table.clearSelection();
         this.visible = false;
+      },
+
+      handleSave() {
+        let _arr = [];
+        _arr = this.selection.map((m) => {
+          return {
+            ...m
+          };
+        });
+        this.$emit('selectChange', _arr);
+        this.handleClose();
       }
     }
   };

+ 138 - 234
src/views/material/BOMmanage/qualityTesting/term.vue

@@ -1,199 +1,98 @@
 <template>
   <div>
-    <el-button
-      @click="() => this.$refs.termRef.open()"
-      size="small"
-      type="primary"
-      >新增</el-button
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="list"
+      height="calc(100vh - 605px)"
+      tool-class="ele-toolbar-form"
+      cache-key="inspectionClassify"
+      row-key="qualityLevelId"
+      :selection.sync="selection"
     >
-
-    <div class="content_box" v-if="list.length > 0">
-      <div class="content_box_list" v-for="(item, idx) in list" :key="idx">
-        <div class="content_ll">
-          <div class="name">质检类型</div>
-          <div>
-            {{
-            item.categoryLevelName
-            }}
+      <template v-slot:toolbar>
+        <el-button @click="handAdd" size="mini" type="primary"
+          >新增质检项</el-button
+        >
+      </template>
+
+      <template v-slot:textType="{ row }">
+        {{
+          row.textType == 1
+            ? '数值'
+            : row.textType == 2
+            ? '选择'
+            : row.textType == 3
+            ? '上下限'
+            : row.textType == 4
+            ? '规格'
+            : row.textType == 5
+            ? '时间'
+            : row.textType == 6
+            ? '范围'
+            : ''
+        }}
+      </template>
+
+      <template v-slot:type="{ row }">
+        {{ getDictValue('质检标准类型', row.qualityStandardType) }}
+      </template>
+
+      <template v-slot:defaultValue="{ row }">
+        <div style="display: flex">
+          <div
+            v-if="row.textType == 3"
+            style="display: flex; align-items: center"
+          >
+            <el-input
+              style="width: 132px"
+              v-model="row.minValue"
+            ></el-input>
+            <span>&nbsp;&nbsp;-</span>
+            <el-input
+              style="width: 132px; margin-left: 10px"
+              v-model="row.maxValue"
+            ></el-input>
           </div>
-        </div>
-
 
-        <div class="content_ll">
-
-          <div class="name">标准类型</div>
-          <div>
-            {{
-              getDictValue(
-                '质检标准类型',
-                item.qualityStandard && item.qualityStandard.type
-              )
-            }}
+          <div v-else style="width: 290px">
+            <el-input
+              v-model="row.defaultValue"
+              placeholder="请输入"
+            ></el-input>
           </div>
-        </div>
 
-
-        <div class="content_ll">
-          <div class="name">标准编码</div>
-          <div class="">{{
-            item.qualityStandard && item.qualityStandard.code
-          }}</div>
-        </div>
-
-        <div class="content_ll">
-          <div class="name">标准名称</div>
-          <div class="">{{
-            item.qualityStandard && item.qualityStandard.name
-          }}</div>
+          <el-input
+            style="margin-left: 10px; width: 80px"
+            v-model="row.unit"
+            disabled
+          >
+          </el-input>
         </div>
+      </template>
 
-        <el-link
-          type="danger"
-          :underline="false"
-          icon="el-icon-delete"
-          @click="handDel(idx)"
+      <template v-slot:action="{ row, $index }">
+        <el-popconfirm
+          class="ele-action"
+          title="确定要删除当前质检项吗?"
+          @confirm="handDel($index)"
         >
-          删除
-        </el-link>
-
-        <el-form ref="form" style="width: 100%">
-          <el-table
-            style="margin-top: 15px"
-            :data="
-              item.qualityStandard && item.qualityStandard.parameterStandards
-            "
-            border
-          >
-            <el-table-column
-              :label="
-                item.qualityStandard &&
-                item.qualityStandard.singleWeightDivision
-              "
-              align="center"
-            >
-              <el-table-column
-                label="参数上限"
-                align="center"
-                v-if="
-                  item.qualityStandard &&
-                  item.qualityStandard.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="
-                  item.qualityStandard &&
-                  item.qualityStandard.parameterType == 3
-                "
-              >
-                <template slot-scope="scope">
-                  <el-form-item label-width="0" prop="initialValue">
-                    <el-input
-                      clearable
-                      v-model="scope.row.initialValue"
-                      placeholder="请输入"
-                    />
-                  </el-form-item>
-                </template>
-              </el-table-column>
-              <el-table-column
-                label="默认值"
-                align="center"
-                v-if="
-                  item.qualityStandard &&
-                  item.qualityStandard.parameterType != 3
-                "
-              >
-                <template slot-scope="scope">
-                  <el-form-item label-width="0" prop="defaultValue">
-                    <el-input
-                      clearable
-                      v-model="scope.row.defaultValue"
-                      placeholder="请输入"
-                    />
-                  </el-form-item>
-                </template>
-              </el-table-column>
-            </el-table-column>
-
-            <el-table-column
-              :label="item.qualityStandard && item.qualityStandard.tolerance"
-              align="center"
-            >
-              <el-table-column label="质检标准" align="center">
-                <template slot-scope="scope">
-                  <el-form-item label-width="0" prop="inspectionStandard">
-
-                    <!-- <el-select
-                      v-model="scope.row.symbol"
-                      style="width: 100px"
-                      clearable
-                    >
-                      <el-option
-                        v-for="item in dictList"
-                        :key="item.value"
-                        :value="item.value"
-                        :label="item.label"
-                      ></el-option>
-                    </el-select>
-                  -->
-                  
-                    <el-input
-                      clearable
-                      v-model="scope.row.toleranceValue"
-                      placeholder="请输入"
-                    >
-
-                    <DictSelection
-                        style="width: 100px"
-                        slot="prepend"
-                        clearable
-                        dictName="数学字符"
-                        v-model="scope.row.symbol"
-                      ></DictSelection>
-
-                    </el-input>
-                  </el-form-item>
-                </template>
-              </el-table-column>
-            </el-table-column>
-
-            <el-table-column label="操作" align="center" width="70">
-              <template slot-scope="scope">
-                <el-link
-                  type="danger"
-                  :underline="false"
-                  icon="el-icon-delete"
-                  @click="handDel2(idx, scope.$index)"
-                >
-                  删除
-                </el-link>
-              </template>
-            </el-table-column>
-          </el-table>
-        </el-form>
-      </div>
-    </div>
-
-    <termPop ref="termRef"></termPop>
+          <template v-slot:reference>
+            <el-link type="danger" :underline="false" icon="el-icon-delete">
+              删除
+            </el-link>
+          </template>
+        </el-popconfirm>
+      </template>
+    </ele-pro-table>
+
+    <termPop ref="termRef" @selectChange="selectChange"></termPop>
   </div>
 </template>
 
 <script>
   import termPop from './inspectionClassify/index.vue';
-  import { EventBus } from '@/utils/eventBus';
+
   import dictMixins from '@/mixins/dictMixins';
   import { getByCode } from '@/api/system/dictionary-data';
   export default {
@@ -219,37 +118,64 @@
     data() {
       return {
         list: [],
-        dictList: []
+        dictList: [],
+
+        selection: [],
+
+        columns: [
+          {
+            prop: 'categoryLevelName',
+            label: '质检类型',
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            prop: 'inspectionName',
+            label: '质检名称',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            prop: 'defaultValue',
+            slot: 'defaultValue',
+            label: '工艺参数',
+            align: 'center',
+            minWidth: 260
+          },
+
+          {
+            label: '工艺要求',
+            prop: 'inspectionStandard',
+            formatter: (row, column, cellValue) => {
+              return (
+                row.symbol + ' ' + cellValue + ' ' + row.unit
+              );
+            },
+            minWidth: 350
+          },
+
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 80,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            fixed: 'right'
+          }
+        ]
       };
     },
 
     created() {
-      EventBus.$on('inspectionSelection', (data) => {
-        let _arr = this.updateOrCreateObjectInArray(this.list, data.message);
-        this.list = JSON.parse(JSON.stringify(_arr));
-        this.$forceUpdate();
-      });
-
       this.requestDict('质检标准类型');
-      this.getDictList('mathematical_symbol');
+      // this.getDictList('mathematical_symbol'); // 数学字符
     },
 
     methods: {
-      updateOrCreateObjectInArray(array, newObj, idKey = 'id') {
-        // 用来检查是否已存在具有特定 id 的对象
-        const exists = array.some((obj) => obj[idKey] === newObj[idKey]);
-
-        if (exists) {
-          // 如果存在,使用 map 来替换找到的对象
-          return array.map((obj) =>
-            obj[idKey] === newObj[idKey] ? newObj : obj
-          );
-        } else {
-          // 如果不存在,将新对象添加到数组中
-          return [...array, newObj];
-        }
-      },
-
       handDel(index) {
         this.$confirm('是否删除该质检项', '删除', {
           type: 'warning'
@@ -260,6 +186,10 @@
           .catch(() => {});
       },
 
+      handAdd() {
+        this.$refs.termRef.open(this.list);
+      },
+
       async getDictList(code) {
         let { data: res } = await getByCode(code);
         this.dictList = res.map((item) => {
@@ -271,43 +201,17 @@
         });
       },
 
-      handDel2(idx, index) {
-        this.list[idx].qualityStandard.parameterStandards.splice(index, 1);
-      },
-
       getDate() {
         return this.list;
+      },
+
+      selectChange(list) {
+        this.list = list;
       }
     }
   };
 </script>
 
 <style lang="scss" scoped>
-  .content_box {
-    width: 100%;
-    margin-top: 12px;
-    max-height: 42vh;
-    overflow-y: scroll;
-  }
 
-  .content_box_list {
-    display: flex;
-    flex-wrap: wrap;
-    margin-bottom: 30px;
-  }
-
-  .content_ll {
-    width: 23%;
-    display: flex;
-    flex-direction: row;
-
-    margin: auto;
-    margin-top: 10px;
-
-    .name {
-      width: 130px;
-      color: #000;
-      font-weight: 500;
-    }
-  }
 </style>