Преглед изворни кода

Merge branch 'test' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into test

chencc пре 1 година
родитељ
комит
149443e3ef

+ 29 - 10
src/api/material/inspectionClassify.js

@@ -5,7 +5,7 @@ import request from '@/utils/request';
 
 // 列表 
 
-export async function getList (data) {
+export async function getList(data) {
   let par = new URLSearchParams(data);
   const res = await request.get(`/qms/qualitylevel/page?` + par, {});
   if (res.data.code == 0) {
@@ -15,7 +15,7 @@ export async function getList (data) {
 }
 
 
-export async function pageByBom (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) {
@@ -26,22 +26,22 @@ export async function pageByBom (data) {
 
 
 
-  
 
-  export async function getById(id) {
-    const res = await request.get(`/qms/qualitylevel/getById/${id}`);
-    if (res.data.code == 0) {
-      return res.data;
-    }
-    return Promise.reject(new Error(res.data.message));
+
+export async function getById(id) {
+  const res = await request.get(`/qms/qualitylevel/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data;
   }
+  return Promise.reject(new Error(res.data.message));
+}
 
 
 
 
 
 // 批量保存
-export async function saveBatch (data) {
+export async function saveBatch(data) {
   const res = await request.post(`/qms/qualitylevel/saveBatch`, data);
   if (res.data.code == 0) {
     return res.data;
@@ -49,3 +49,22 @@ export async function saveBatch (data) {
   return Promise.reject(new Error(res.data.message));
 }
 
+
+
+
+export async function getTemplateList(data) {
+  let par = new URLSearchParams(data);
+  const res = await request.get(`/qms/qualitytemplate/page?` + par, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+export async function getTemplateById(id) {
+  const res = await request.get(`/qms/qualitytemplate/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 213 - 243
src/views/material/BOMmanage/qualityTesting/inspectionClassify/index.vue

@@ -1,45 +1,20 @@
 <template>
-  <el-dialog
-    title="质检"
-    :visible.sync="visible"
-      v-if="visible"
-    :before-close="handleClose"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    append-to-body
-    width="80%"
-  >
+  <el-dialog title="质检" :visible.sync="visible" v-if="visible" :before-close="handleClose" :close-on-click-modal="false"
+    :close-on-press-escape="false" append-to-body width="80%">
     <div class="ele-body">
       <el-card shadow="never" v-loading="loading">
-        <ele-split-layout
-          width="266px"
-          allow-collapse
-          :right-style="{ overflow: 'hidden' }"
-        >
+        <ele-split-layout width="266px" allow-collapse :right-style="{ overflow: 'hidden' }">
           <div>
             <div class="ele-border-lighter sys-organization-list">
-              <AssetTree
-                @handleNodeClick="handleNodeClick"
-                @setRootId="setRootId"
-                :id="rootId"
-                ref="treeList"
-              />
+              <AssetTree @handleNodeClick="handleNodeClick" @setRootId="setRootId" :id="rootId" ref="treeList" />
             </div>
           </div>
           <template v-slot:content>
             <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"
-            >
+            <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 }">
@@ -47,16 +22,16 @@
                   row.textType == 1
                     ? '数值'
                     : row.textType == 2
-                    ? '选择'
-                    : row.textType == 3
-                    ? '上下限'
-                    : row.textType == 4
-                    ? '规格'
-                    : row.textType == 5
-                    ? '时间'
-                    : row.textType == 6
-                    ? '范围'
-                    : ''
+                      ? '选择'
+                      : row.textType == 3
+                        ? '上下限'
+                        : row.textType == 4
+                          ? '规格'
+                          : row.textType == 5
+                            ? '时间'
+                            : row.textType == 6
+                              ? '范围'
+                              : ''
                 }}
               </template>
 
@@ -78,19 +53,13 @@
               </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
-                >
+                <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>
@@ -106,219 +75,220 @@
 </template>
 
 <script>
-  import AssetTree from '@/components/AssetTree';
-  import userSearch from './components/user-search.vue';
-  import { pageByBom } from '@/api/material/inspectionClassify';
-  import dictMixins from '@/mixins/dictMixins';
+import AssetTree from '@/components/AssetTree';
+import userSearch from './components/user-search.vue';
+import { pageByBom } from '@/api/material/inspectionClassify';
+import dictMixins from '@/mixins/dictMixins';
 
-  export default {
-    mixins: [dictMixins],
-    components: {
-      AssetTree,
-      userSearch
-    },
-    data() {
-      return {
-        // 加载状态
-        loading: false,
-        // 表格选中数据
-        selection: [],
-        current: null,
-        rootId: '12',
-        visible: false,
+export default {
+  mixins: [dictMixins],
+  components: {
+    AssetTree,
+    userSearch
+  },
+  data() {
+    return {
+      // 加载状态
+      loading: false,
+      // 表格选中数据
+      selection: [],
+      current: null,
+      rootId: '12',
+      visible: false,
 
-        columns: [
-          {
-            width: 45,
-            type: 'selection',
-            columnKey: 'selection',
-            align: 'center',
-            reserveSelection: true
-          },
+      columns: [
+        {
+          width: 45,
+          type: 'selection',
+          columnKey: 'selection',
+          align: 'center',
+          reserveSelection: true
+        },
 
-          {
-            prop: 'categoryLevelClassName',
-            label: '质检类型',
-            align: 'center',
-            minWidth: 110
-          },
-          // {
-          //   prop: 'categoryLevelName',
-          //   label: '质检类型',
-          //   align: 'center',
-          //   minWidth: 110
-          // },
+        {
+          prop: 'categoryLevelClassName',
+          label: '质检类型',
+          align: 'center',
+          minWidth: 110
+        },
+        // {
+        //   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: '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: 'textType',
+          label: '参数类型',
+          showOverflowTooltip: true,
+          align: 'center',
+          slot: 'textType',
+          minWidth: 110
+        },
 
-          {
-            prop: 'defaultValue',
-            slot: 'defaultValue',
-            label: '工艺参数',
-            align: 'center',
-            minWidth: 150
-          },
+        {
+          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'
-          },
+        // {
+        //   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
-          },
+        {
+          prop: 'qualityStandardName',
+          label: '标准名称',
+          align: 'center',
+          minWidth: 110
+        },
 
-          {
-            label: '状态',
-            prop: 'status',
-            formatter: (row, column, cellValue) => {
-              return cellValue == 1 ? '启用' : cellValue === 0 ? '停用' : '';
-            }
-          },
+        {
+          label: '状态',
+          prop: 'status',
+          formatter: (row, column, cellValue) => {
+            return cellValue == 1 ? '启用' : cellValue === 0 ? '停用' : '';
+          }
+        },
 
-          {
-            prop: 'toolList',
-            slot: 'toolList',
-            label: '工具名称',
-            align: 'center',
-            minWidth: 150
-          },
+        {
+          prop: 'toolList',
+          slot: 'toolList',
+          label: '工具名称',
+          align: 'center',
+          minWidth: 150
+        },
 
-          {
-            label: '备注',
-            prop: 'inspectionRemark'
-          }
-        ]
-      };
-    },
+        {
+          label: '备注',
+          prop: 'inspectionRemark'
+        }
+      ]
+    };
+  },
 
-    created() {
-      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
-        });
+  created() {
+    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
-        });
-      },
+      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.clickSearch(info);
-        });
-      },
+    handleNodeClick(info) {
+      this.current = info;
+      this.$nextTick(() => {
+        console.log(info);
+        this.clickSearch(info);
+      });
+    },
 
-      clickSearch(info) {
-        this.categoryLevelId = info.id;
-        this.rootCategoryLevelId = info.rootCategoryLevelId;
-        this.reload();
-      },
+    clickSearch(info) {
+      this.categoryLevelId = info.id;
+      this.rootCategoryLevelId = info.rootCategoryLevelId;
+      this.reload();
+    },
 
-      // 获取根节点id
-      setRootId(id) {
-        if (id) {
-          this.rootId = id;
-        }
-      },
+    // 获取根节点id
+    setRootId(id) {
+      if (id) {
+        this.rootId = id;
+      }
+    },
 
-      open(list) {
-        this.visible = true;
-        this.$nextTick(() => {
-          list.forEach((item) => {
-            this.$refs.table && this.$refs.table.toggleRowSelection(item, true);
-          });
+    open(list) {
+      console.log(list, 'llllll');
+      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;
-      },
+    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();
-      }
+    handleSave() {
+      let _arr = [];
+      _arr = this.selection.map((m) => {
+        return {
+          ...m
+        };
+      });
+      this.$emit('selectChange', _arr);
+      this.handleClose();
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  .sys-organization-list {
-    height: calc(100vh - 264px);
-    box-sizing: border-box;
-    border-width: 1px;
-    border-style: solid;
-    overflow: auto;
-  }
+.sys-organization-list {
+  height: calc(100vh - 264px);
+  box-sizing: border-box;
+  border-width: 1px;
+  border-style: solid;
+  overflow: auto;
+}
 
-  .sys-organization-list :deep(.el-tree-node__content) {
-    height: 30px;
+.sys-organization-list :deep(.el-tree-node__content) {
+  height: 30px;
 
-    & > .el-tree-node__expand-icon {
-      margin-left: 10px;
-    }
+  &>.el-tree-node__expand-icon {
+    margin-left: 10px;
   }
+}
 </style>

+ 119 - 0
src/views/material/BOMmanage/qualityTesting/inspectionTemplate.vue

@@ -0,0 +1,119 @@
+<template>
+    <ele-modal title="选择" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
+        :close-on-press-escape="false" append-to-body width="60%" :maxable="true">
+        <ele-pro-table ref="table" :columns="columns" :datasource="datasource" height="calc(100vh - 605px)"
+            tool-class="ele-toolbar-form" cache-key="inspectionClassify" row-key="qualityLevelId"
+            :current.sync="current" :highlight-current-row="true" @current-change="handleCurrentChange">
+            <template v-slot:current="{ row, _index }">
+                <el-radio class="radio" v-model="radio" :label="row.id"><i></i></el-radio>
+            </template>
+            <template v-slot:status="{ row }">
+                {{ row.status ? '启用' : '停用' }}
+            </template>
+
+        </ele-pro-table>
+        <span slot="footer" class="dialog-footer">
+            <el-button @click="handleClose">取消</el-button>
+            <el-button type="primary" @click="changeSel">选择</el-button>
+        </span>
+    </ele-modal>
+</template>
+
+<script>
+import { getTemplateList } from '@/api/material/inspectionClassify';
+
+export default {
+    components: {},
+    data() {
+        return {
+            visible: false,
+            selection: [],
+            current: null,
+            radio: '',
+            columns: [
+                // {
+                //     width: 45,
+                //     type: 'selection',
+                //     columnKey: 'selection',
+                //     align: 'center',
+                //     reserveSelection: true
+                // },
+                {
+                    width: 55,
+                    columnKey: 'current',
+                    slot: 'current',
+                    align: 'center'
+                },
+                {
+                    columnKey: 'index',
+                    label: '序号',
+                    type: 'index',
+                    width: 55,
+                    align: 'center',
+                    showOverflowTooltip: true,
+                    fixed: 'left'
+                },
+                {
+                    prop: 'qualitySchemeTemplateCode',
+                    label: '质检方案编码',
+                    showOverflowTooltip: true,
+                    align: 'center',
+                    minWidth: 110
+                },
+                {
+                    prop: 'qualitySchemeTemplateName',
+                    label: '质检方案名称',
+                    align: 'center',
+                    minWidth: 150
+                },
+                {
+                    label: '状态',
+                    prop: 'status',
+                    slot: 'status',
+                    align: 'center'
+                },
+                {
+                    prop: 'templateRemark',
+                    label: '备注',
+                    showOverflowTooltip: true,
+                    align: 'center',
+                    minWidth: 110
+                },
+            ]
+        };
+    },
+    methods: {
+        datasource({ page, where, limit }) {
+            return getTemplateList({
+                ...where,
+                pageNum: page,
+                size: limit
+            });
+        },
+
+        // 多选
+        selectionChangeHandle(val) {
+            this.selection = val;
+        },
+        open() {
+            this.visible = true;
+        },
+        handleClose() {
+            this.$nextTick(() => {
+                this.current = null;
+                this.radio = ''
+            })
+            this.visible = false
+        },
+        changeSel() {
+            this.$emit('changeSel', this.current);
+            this.handleClose()
+
+        },
+        handleCurrentChange(row) {
+            this.radio = row.id
+        },
+
+    }
+};
+</script>

+ 152 - 154
src/views/material/BOMmanage/qualityTesting/term.vue

@@ -1,19 +1,10 @@
 <template>
   <div>
-    <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"
-    >
+    <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">
       <template v-slot:toolbar>
-        <el-button @click="handAdd" size="mini" type="primary"
-          >新增质检项</el-button
-        >
+        <el-button @click="handAdd" size="mini" type="primary">新增质检项</el-button>
+        <el-button @click="handSelect" size="mini" type="primary">选择质检工单</el-button>
       </template>
 
       <template v-slot:textType="{ row }">
@@ -21,18 +12,18 @@
           row.textType == 1
             ? '数值'
             : row.textType == 2
-            ? '选择'
-            : row.textType == 3
-            ? '上下限'
-            : row.textType == 4
-            ? '规格'
-            : row.textType == 5
-            ? '时间'
-            : row.textType == 6
-            ? '范围'
-            : row.textType == 7
-            ? '文本'
-            : ''
+              ? '选择'
+              : row.textType == 3
+                ? '上下限'
+                : row.textType == 4
+                  ? '规格'
+                  : row.textType == 5
+                    ? '时间'
+                    : row.textType == 6
+                      ? '范围'
+                      : row.textType == 7
+                        ? '文本'
+                        : ''
         }}
       </template>
 
@@ -46,25 +37,19 @@
             <el-input v-model="row.symbol" disabled> </el-input>
           </div>
           <!-- 上下限 -->
-          <div
-            v-if="row.textType == 3"
-            style="
+          <div v-if="row.textType == 3" style="
               display: flex;
               align-items: center;
               justify-content: space-between;
               width: 75%;
-            "
-          >
-            <el-input style="width: 45%" v-model="row.minValue"></el-input>
+            ">
+            <el-input style="width: 45%" v-model="row.minValue" disabled></el-input>
             <span>&nbsp;&nbsp;-</span>
-            <el-input
-              style="width: 45%; margin-left: 10px"
-              v-model="row.maxValue"
-            ></el-input>
+            <el-input style="width: 45%; margin-left: 10px" v-model="row.maxValue" disabled></el-input>
           </div>
 
           <div v-else style="width: 75%">
-            <el-input v-model="row.defaultValue" placeholder="请输入">
+            <el-input v-model="row.defaultValue" placeholder="请输入" disabled>
             </el-input>
           </div>
 
@@ -75,11 +60,7 @@
       </template>
 
       <template v-slot:action="{ row, $index }">
-        <el-popconfirm
-          class="ele-action"
-          title="确定要删除当前质检项吗?"
-          @confirm="handDel($index)"
-        >
+        <el-popconfirm class="ele-action" title="确定要删除当前质检项吗?" @confirm="handDel($index)">
           <template v-slot:reference>
             <el-link type="danger" :underline="false" icon="el-icon-delete">
               删除
@@ -90,133 +71,150 @@
     </ele-pro-table>
 
     <termPop ref="termRef" @selectChange="selectChange"></termPop>
+
+    <inspectionTemplatePop ref="inspectionTemplateRef" @changeSel="changeSel"></inspectionTemplatePop>
   </div>
 </template>
 
 <script>
-  import termPop from './inspectionClassify/index.vue';
-
-  import dictMixins from '@/mixins/dictMixins';
-  import { getByCode } from '@/api/system/dictionary-data';
-  export default {
-    components: { termPop },
-    mixins: [dictMixins],
-    props: {
-      qualityParam: {
-        type: Array
-      }
-    },
+import termPop from './inspectionClassify/index.vue';
+import inspectionTemplatePop from './inspectionTemplate.vue';
 
-    watch: {
-      qualityParam: {
-        handler(val) {
-          this.list = val;
-          this.$forceUpdate();
-        },
-        deep: true,
-        immediate: true
-      }
-    },
+import dictMixins from '@/mixins/dictMixins';
+import { getByCode } from '@/api/system/dictionary-data';
 
-    data() {
-      return {
-        list: [],
-        dictList: [],
-
-        selection: [],
-
-        columns: [
-          {
-            prop: 'categoryLevelClassName',
-            label: '质检类型',
-            align: 'center',
-            minWidth: 110
-          },
-          // {
-          //   prop: 'categoryLevelName',
-          //   label: '质检类型',
-          //   align: 'center',
-          //   minWidth: 110
-          // },
-
-          {
-            prop: 'inspectionName',
-            label: '质检名称',
-            showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 110
-          },
-
-          {
-            prop: 'defaultValue',
-            slot: 'defaultValue',
-            label: '工艺参数',
-            align: 'center',
-            width: 700
-          },
-
-          // {
-          //   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'
-          }
-        ]
-      };
-    },
+import { getTemplateById } from '@/api/material/inspectionClassify';
 
-    created() {
-      this.requestDict('质检标准类型');
-      // this.getDictList('mathematical_symbol'); // 数学字符
-    },
+export default {
+  components: { termPop, inspectionTemplatePop },
+  mixins: [dictMixins],
+  props: {
+    qualityParam: {
+      type: Array
+    }
+  },
 
-    methods: {
-      handDel(index) {
-        this.$confirm('是否删除该质检项', '删除', {
-          type: 'warning'
-        })
-          .then(() => {
-            this.list.splice(index, 1);
-          })
-          .catch(() => {});
+  watch: {
+    qualityParam: {
+      handler(val) {
+        this.list = val;
+        this.$forceUpdate();
       },
+      deep: true,
+      immediate: true
+    }
+  },
 
-      handAdd() {
-        this.$refs.termRef.open(this.list);
-      },
+  data() {
+    return {
+      list: [],
+      dictList: [],
 
-      async getDictList(code) {
-        let { data: res } = await getByCode(code);
-        this.dictList = res.map((item) => {
-          let values = Object.keys(item);
-          return {
-            value: Number(values[0]),
-            label: item[values[0]]
-          };
-        });
-      },
+      selection: [],
 
-      getDate() {
-        return this.list;
-      },
+      columns: [
+        {
+          prop: 'categoryLevelClassName',
+          label: '质检类型',
+          align: 'center',
+          minWidth: 110
+        },
+        // {
+        //   prop: 'categoryLevelName',
+        //   label: '质检类型',
+        //   align: 'center',
+        //   minWidth: 110
+        // },
+
+        {
+          prop: 'inspectionName',
+          label: '质检名称',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 110
+        },
 
-      selectChange(list) {
-        this.list = list;
-      }
+        {
+          prop: 'defaultValue',
+          slot: 'defaultValue',
+          label: '工艺参数',
+          align: 'center',
+          width: 700
+        },
+
+        // {
+        //   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() {
+    this.requestDict('质检标准类型');
+    // this.getDictList('mathematical_symbol'); // 数学字符
+  },
+
+  methods: {
+    handDel(index) {
+      this.$confirm('是否删除该质检项', '删除', {
+        type: 'warning'
+      })
+        .then(() => {
+          this.list.splice(index, 1);
+        })
+        .catch(() => { });
+    },
+
+    handAdd() {
+      this.$refs.termRef.open(this.list);
+    },
+
+    async getDictList(code) {
+      let { data: res } = await getByCode(code);
+      this.dictList = res.map((item) => {
+        let values = Object.keys(item);
+        return {
+          value: Number(values[0]),
+          label: item[values[0]]
+        };
+      });
+    },
+
+    getDate() {
+      return this.list;
+    },
+
+    selectChange(list) {
+      this.list = list;
+    },
+    handSelect() {
+      this.$refs.inspectionTemplateRef.open();
+    },
+    changeSel(list) {
+      console.log(list, 'list')
+      // let ids = list.map((item) => item.id).toString();
+      // console.log(ids, 'ids')
+      getTemplateById(list.id).then(({ data }) => {
+        this.list = [...this.list, ...(data.inspectionItemVOList || [])];
+      });
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped></style>