yijing 1 год назад
Родитель
Сommit
0761a959c5

+ 116 - 113
src/components/AssetTree/index.vue

@@ -1,137 +1,140 @@
 <template>
   <div class="tree-wrapper">
-    <el-tree
-      :data="treeList"
-      :props="defaultProps"
-      v-loading="treeLoading"
-      :node-key="nodeKey"
-      ref="tree"
-      :highlight-current="true"
-      :expand-on-click-node="false"
-      @node-click="handleNodeClick"
-      v-bind="$attrs"
-      :default-expand-all="defaultExpandAll"
-    >
+    <!-- <el-input placeholder="输入关键字进行过滤" v-model="filterText">
+    </el-input> -->
+    <el-tree :data="treeList" :props="defaultProps" v-loading="treeLoading" :node-key="nodeKey" ref="tree"
+      :highlight-current="true" :expand-on-click-node="false" @node-click="handleNodeClick" v-bind="$attrs"
+      :default-expand-all="defaultExpandAll" :filter-node-method="filterNode">
     </el-tree>
   </div>
 </template>
 
 <script>
-  import { getTreeByIds } from '@/api/classifyManage';
+import { getTreeByIds } from '@/api/classifyManage';
 
-  export default {
-    props: {
-      // treeList私有化处理
-      treeFormate: {
-        type: Function,
-        default: null
-      },
-      defaultProps: {
-        type: Object,
-        default: function () {
-          return {
-            children: 'children',
-            value: 'id',
-            label: 'name'
-          };
-        }
-      },
-      defaultExpandAll: {
-        type: Boolean,
-        default: function () {
-          return true;
-        }
-      },
-      // 初始请求treeList
-      init: {
-        type: Boolean,
-        default: true
-      },
-      treeIds: {
-        type: Array,
-        default: () => []
-      },
-      nodeKey: {
-        type: String,
-        default: 'id'
-      }
+export default {
+  props: {
+    // treeList私有化处理
+    treeFormate: {
+      type: Function,
+      default: null
     },
-    data() {
-      return {
-        treeList: [],
-        treeLoading: false,
-        parentName: '',
-        parentId: '',
-        currentKey: ''
-      };
+    defaultProps: {
+      type: Object,
+      default: function () {
+        return {
+          children: 'children',
+          value: 'id',
+          label: 'name'
+        };
+      }
     },
-    mounted() {
-      if (this.init) {
-        this.getTreeData();
+    defaultExpandAll: {
+      type: Boolean,
+      default: function () {
+        return true;
       }
     },
-    methods: {
-      getInstance() {
-        return this.$refs.tree;
-      },
-      // 获取树结构数据
-      async getTreeData() {
-        try {
-          this.treeLoading = true;
+    // 初始请求treeList
+    init: {
+      type: Boolean,
+      default: true
+    },
+    treeIds: {
+      type: Array,
+      default: () => []
+    },
+    nodeKey: {
+      type: String,
+      default: 'id'
+    }
+  },
+  watch: {
+    // filterText(val) {
+    //   this.$refs.tree.filter(val);
+    // }
+  },
+  data() {
+    return {
+      // filterText: '',
+      treeList: [],
+      treeLoading: false,
+      parentName: '',
+      parentId: '',
+      currentKey: ''
+    };
+  },
+  mounted() {
+    if (this.init) {
+      this.getTreeData();
+    }
+  },
+  methods: {
+    filterNode(value, data) {
+      if (!value) return true;
+      return data.name.indexOf(value) !== -1;
+    },
+    getInstance() {
+      return this.$refs.tree;
+    },
+    // 获取树结构数据
+    async getTreeData() {
+      try {
+        this.treeLoading = true;
 
-          const res = await getTreeByIds({ ids: this.treeIds.join(',') });
-          this.treeLoading = false;
-          if (res?.code === '0') {
-            this.treeList = res.data;
-            this.$emit('setRootId', res.data[0].id);
-            if (this.treeFormate) {
-              this.treeList = this.treeFormate(this.treeList);
-            }
-            this.$nextTick(() => {
-              // 默认高亮第一级树节点
-              if (this.treeList[0]) {
-                this.setCurrentKey(this.treeList[0].id);
-                this.handleNodeClick(
-                  this.treeList[0],
-                  this.$refs.tree.getCurrentNode()
-                );
-              }
-            });
-            return this.treeList;
+        const res = await getTreeByIds({ ids: this.treeIds.join(',') });
+        this.treeLoading = false;
+        if (res?.code === '0') {
+          this.treeList = res.data;
+          this.$emit('setRootId', res.data[0].id);
+          if (this.treeFormate) {
+            this.treeList = this.treeFormate(this.treeList);
           }
-        } catch (error) {
-          console.log(error);
+          this.$nextTick(() => {
+            // 默认高亮第一级树节点
+            if (this.treeList[0]) {
+              this.setCurrentKey(this.treeList[0].id);
+              this.handleNodeClick(
+                this.treeList[0],
+                this.$refs.tree.getCurrentNode()
+              );
+            }
+          });
+          return this.treeList;
         }
-        this.treeLoading = false;
-      },
+      } catch (error) {
+        console.log(error);
+      }
+      this.treeLoading = false;
+    },
 
-      handleNodeClick(data, node) {
-        this.$emit('handleNodeClick', data, node);
-      },
-      // 设置默认高亮行
-      setCurrentKey(id) {
-        this.currentKey = id;
-        this.$refs.tree.setCurrentKey(this.currentKey);
-      },
+    handleNodeClick(data, node) {
+      this.$emit('handleNodeClick', data, node);
+    },
+    // 设置默认高亮行
+    setCurrentKey(id) {
+      this.currentKey = id;
+      this.$refs.tree.setCurrentKey(this.currentKey);
+    },
 
-      // 获取树的选中状态
-      getSelectList() {
-        const selectList = this.$refs.tree.getCurrentNode();
-        return selectList;
-      }
+    // 获取树的选中状态
+    getSelectList() {
+      const selectList = this.$refs.tree.getCurrentNode();
+      return selectList;
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  .tree-wrapper {
-    width: 100%;
-    height: 100%;
-    overflow: auto;
+.tree-wrapper {
+  width: 100%;
+  height: 100%;
+  overflow: auto;
 
-    :deep(.el-tree) {
-      display: inline-block;
-      min-width: 100%;
-    }
+  :deep(.el-tree) {
+    display: inline-block;
+    min-width: 100%;
   }
+}
 </style>

+ 46 - 71
src/views/inspectionClassify/components/user-search.vue

@@ -1,11 +1,6 @@
 <!-- 搜索表单 -->
 <template>
-  <el-form
-    label-width="80px"
-    class="ele-form-search"
-    @keyup.enter.native="search"
-    @submit.native.prevent
-  >
+  <el-form label-width="80px" class="ele-form-search" @keyup.enter.native="search" @submit.native.prevent>
     <el-row :gutter="24">
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="质检名称:">
@@ -16,17 +11,12 @@
       <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 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-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="组织机构:">
           <auth-selection
             data-type="Array"
@@ -34,29 +24,14 @@
             style="width: 100%"
           ></auth-selection>
         </el-form-item>
-      </el-col>
+      </el-col> -->
 
-      <el-col
-        v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }"
-        style="text-align: right"
-      >
+      <el-col v-bind="styleResponsive ? { lg: 12, md: 12 } : { span: 6 }" style="text-align: right">
         <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">重置</el-button>
         </el-form-item>
       </el-col>
     </el-row>
@@ -64,47 +39,47 @@
 </template>
 
 <script>
-  export default {
-    data() {
-      // 默认表单数据
-      const defaultWhere = {
-        name: '',
-        status: ''
-      };
+export default {
+  data() {
+    // 默认表单数据
+    const defaultWhere = {
+      name: '',
+      status: ''
+    };
 
-      return {
-        // 表单数据
-        where: { ...defaultWhere },
+    return {
+      // 表单数据
+      where: { ...defaultWhere },
 
-        statusList: [
-          {
-            value: 0,
-            label: '停用'
-          },
-          {
-            value: 1,
-            label: '启用'
-          }
-        ]
-      };
-    },
-    computed: {
-      // 是否开启响应式布局
-      styleResponsive() {
-        return this.$store.state.theme.styleResponsive;
-      }
+      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);
     },
-    methods: {
-      /* 搜索 */
-      search() {
-        console.log(this.where);
-        this.$emit('search', this.where);
-      },
-      /*  重置 */
-      reset() {
-        this.where = { ...this.defaultWhere };
-        this.search();
-      }
+    /*  重置 */
+    reset() {
+      this.where = { ...this.defaultWhere };
+      this.search();
     }
-  };
+  }
+};
 </script>

+ 54 - 60
src/views/inspectionClassify/index.vue

@@ -1,28 +1,16 @@
 <template>
   <div class="ele-body">
     <el-card shadow="never" v-loading="loading">
-      <ele-split-layout
-        width="236px"
-        allow-collapse
-        :right-style="{ overflow: 'hidden' }"
-      >
+      <ele-split-layout width="236px" allow-collapse :right-style="{ overflow: 'hidden' }">
         <div>
           <div class="ele-border-lighter sys-organization-list">
-            <AssetTree
-              @handleNodeClick="handleNodeClick"
-              @setRootId="setRootId"
-              :treeIds="[12]"
-              ref="treeList"
-            />
+            <el-input placeholder="输入关键字进行过滤" v-model="filterText">
+            </el-input>
+            <AssetTree @handleNodeClick="handleNodeClick" @setRootId="setRootId" :treeIds="[12]" ref="treeList" />
           </div>
         </div>
         <template v-slot:content>
-          <user-list
-            v-if="current"
-            :category-id="current.id"
-            :root-id="rootId"
-            ref="searchRef"
-          />
+          <user-list v-if="current" :category-id="current.id" :root-id="rootId" ref="searchRef" />
         </template>
       </ele-split-layout>
     </el-card>
@@ -30,57 +18,63 @@
 </template>
 
 <script>
-  import AssetTree from '@/components/AssetTree';
-  import userList from './components/user-list.vue';
+import AssetTree from '@/components/AssetTree';
+import userList from './components/user-list.vue';
 
-  export default {
-    components: {
-      AssetTree,
-      userList
-    },
-    data() {
-      return {
-        // 加载状态
-        loading: false,
-        // 表格选中数据
-        selection: [],
-        current: null,
-        rootId: '12'
-      };
+export default {
+  components: {
+    AssetTree,
+    userList
+  },
+  watch: {
+    filterText(val) {
+      this.$refs.treeList.$refs.tree.filter(val);
+    }
+  },
+  data() {
+    return {
+      filterText: '',
+      // 加载状态
+      loading: false,
+      // 表格选中数据
+      selection: [],
+      current: null,
+      rootId: '12'
+    };
+  },
+  computed: {},
+  methods: {
+    handleNodeClick(info) {
+      console.log(info);
+      this.current = info;
+      this.$nextTick(() => {
+        this.$refs.searchRef.clickSearch(info);
+      });
     },
-    computed: {},
-    methods: {
-      handleNodeClick(info) {
-        console.log(info);
-        this.current = info;
-        this.$nextTick(() => {
-          this.$refs.searchRef.clickSearch(info);
-        });
-      },
-      // 获取根节点id
-      setRootId(id) {
-        if (id) {
-          this.rootId = id;
-        }
+    // 获取根节点id
+    setRootId(id) {
+      if (id) {
+        this.rootId = id;
       }
     }
-  };
+  }
+};
 </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: 40px;
+.sys-organization-list :deep(.el-tree-node__content) {
+  height: 40px;
 
-    & > .el-tree-node__expand-icon {
-      margin-left: 10px;
-    }
+  &>.el-tree-node__expand-icon {
+    margin-left: 10px;
   }
+}
 </style>

+ 3 - 0
src/views/inspectionPlan/components/edit.vue

@@ -194,6 +194,9 @@ export default {
         { label: '物料代号', prop: 'materielDesignation', align: 'center' },
         { label: '客户代号', prop: 'clientCode', align: 'center' },
         { label: '刻码', prop: 'engrave', align: 'center' },
+        { prop: 'specification', label: '规格', align: 'center', width: 100, showOverflowTooltip: true },
+        { prop: 'brandNum', label: '牌号', align: 'center', width: 100, showOverflowTooltip: true },
+        { prop: 'modelType', label: '型号', align: 'center', width: 100, showOverflowTooltip: true },
         { label: '重量', prop: 'weight', align: 'center' },
         { label: '重量单位', prop: 'weightUnit', align: 'center' },
         { label: '仓库', prop: 'warehouseName', align: 'center' },

+ 178 - 213
src/views/inspectionTemplate/AddorUpdate.vue

@@ -1,76 +1,44 @@
 <template>
-<!--  <el-dialog-->
-<!--    :title="!dataForm.id ? '新增' : '修改'"-->
-<!--    :close-on-click-modal="false"-->
-<!--    :visible.sync="visible"-->
-<!--    width="60%"-->
-<!--  >-->
-    <ele-modal :title="!dataForm.id ? '新增' : '修改'" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
-               :close-on-press-escape="false" append-to-body width="80%" :maxable="true">
-    <el-form
-      :model="dataForm"
-      :rules="dataRule"
-      ref="dataForm"
-      @keyup.enter.native="dataFormSubmit()"
-      label-width="80px"
-    >
+  <!--  <el-dialog-->
+  <!--    :title="!dataForm.id ? '新增' : '修改'"-->
+  <!--    :close-on-click-modal="false"-->
+  <!--    :visible.sync="visible"-->
+  <!--    width="60%"-->
+  <!--  >-->
+  <ele-modal :title="!dataForm.id ? '新增' : '修改'" :visible.sync="visible" :before-close="handleClose"
+    :close-on-click-modal="false" :close-on-press-escape="false" append-to-body width="80%" :maxable="true">
+    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
+      label-width="80px">
       <el-row>
         <el-col :span="8">
           <el-form-item label="名称" prop="qualitySchemeTemplateName">
-            <el-input
-              v-model="dataForm.qualitySchemeTemplateName"
-              placeholder="质检方案名称"
-            ></el-input>
+            <el-input v-model="dataForm.qualitySchemeTemplateName" placeholder="质检方案名称"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item label="编码" prop="qualitySchemeTemplateCode">
-            <el-input
-              v-model="dataForm.qualitySchemeTemplateCode"
-              placeholder="质检方案编码"
-              disabled
-            ></el-input>
+            <el-input v-model="dataForm.qualitySchemeTemplateCode" placeholder="质检方案编码" disabled></el-input>
           </el-form-item>
         </el-col>
-        <el-col :span="8"
-          ><el-form-item label="状态 " prop="status">
-            <el-select
-              clearable
-              class="ele-block"
-              v-model="dataForm.status"
-              placeholder="请选择"
-            >
+        <el-col :span="8"><el-form-item label="状态 " prop="status">
+            <el-select clearable class="ele-block" v-model="dataForm.status" placeholder="请选择">
               <el-option label="失效" :value="0" />
               <el-option label="有效" :value="1" />
-            </el-select> </el-form-item
-        ></el-col>
+            </el-select> </el-form-item></el-col>
       </el-row>
       <el-row>
         <el-col :span="24">
           <el-form-item label="备注" prop="templateRemark">
-            <el-input
-              type="textarea"
-              v-model="dataForm.templateRemark"
-              placeholder="请输入"
-            ></el-input>
+            <el-input type="textarea" v-model="dataForm.templateRemark" placeholder="请输入"></el-input>
           </el-form-item>
         </el-col>
       </el-row>
       <el-row>
-        <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-change="selectionChange"
-        >
+        <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-change="selectionChange">
           <template v-slot:toolbar>
-            <el-button @click="handAdd" size="mini" type="primary"
-              >新增质检项</el-button
-            >
+            <el-button @click="handAdd" size="mini" type="primary">新增质检项</el-button>
           </template>
 
           <template v-slot:textType="{ row }">
@@ -78,18 +46,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>
 
@@ -101,9 +69,7 @@
             <div style="width: 100%; display: flex; justify-content: center">
               {{ row.symbol }}
 
-              <span v-if="row.textType == 3"
-                >{{ row.minValue }}- {{ row.maxValue }}</span
-              >
+              <span v-if="row.textType == 3">{{ row.minValue }}- {{ row.maxValue }}</span>
 
               <div v-else>
                 {{ row.defaultValue }}
@@ -114,11 +80,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">
                   删除
@@ -138,153 +100,156 @@
 </template>
 
 <script>
-  import termPop from '@/views/inspectionTemplate/inspectionClassify/index.vue';
-  import { save, update, getById } from '@/api/inspectionTemplate';
-  import { getCode } from '@/api/login';
-  export default {
-    components: { termPop },
-    data() {
-      return {
-        visible: false,
-        dataForm: {
-          id: 0,
-          qualitySchemeTemplateName: '',
-          qualitySchemeTemplateCode: '',
-          inspectionItemVOList: [],
-          status: 1,
-          templateRemark: ''
+import termPop from '@/views/inspectionTemplate/inspectionClassify/index.vue';
+import { save, update, getById } from '@/api/inspectionTemplate';
+import { getCode } from '@/api/login';
+export default {
+  components: { termPop },
+  data() {
+    return {
+      visible: false,
+      dataForm: {
+        id: 0,
+        qualitySchemeTemplateName: '',
+        qualitySchemeTemplateCode: '',
+        inspectionItemVOList: [],
+        status: 1,
+        templateRemark: ''
+      },
+      columns: [
+        {
+          width: 45,
+          type: 'selection',
+          columnKey: 'selection',
+          align: 'center',
+          reserveSelection: true
+        },
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'categoryLevelClassName',
+          label: '质检类型',
+          align: 'center',
+          minWidth: 150
+        },
+        {
+          prop: 'inspectionCode',
+          label: '编码',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 150
+        },
+        {
+          prop: 'inspectionName',
+          label: '名称',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 150
+        },
+        {
+          prop: 'defaultValue',
+          slot: 'defaultValue',
+          label: '工艺参数',
+          align: 'center',
+          width: 400
         },
-        columns: [
-          {
-            width: 45,
-            type: 'selection',
-            columnKey: 'selection',
-            align: 'center',
-            reserveSelection: true
-          },
-          {
-            columnKey: 'index',
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center',
-            showOverflowTooltip: true,
-            fixed: 'left'
-          },
-          {
-            prop: 'categoryLevelClassName',
-            label: '质检类型',
-            align: 'center',
-            minWidth: 150
-          },
-          {
-            prop: 'inspectionCode',
-            label: '编码',
-            showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 150
-          },
-          {
-            prop: 'inspectionName',
-            label: '名称',
-            showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 150
-          },
-          {
-            prop: 'defaultValue',
-            slot: 'defaultValue',
-            label: '工艺参数',
-            align: 'center',
-            width: 400
-          },
 
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 80,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          fixed: 'right'
+        }
+      ],
+      dataRule: {
+        qualitySchemeTemplateName: [
+          { required: true, message: '请输入质检方案名称', trigger: 'blur' }
+        ],
+        status: [
           {
-            columnKey: 'action',
-            label: '操作',
-            width: 80,
-            align: 'center',
-            resizable: false,
-            slot: 'action',
-            fixed: 'right'
+            required: true,
+            message: '请选择状态',
+            trigger: 'blur'
           }
-        ],
-        dataRule: {
-          qualitySchemeTemplateName: [
-            { required: true, message: '请输入质检方案名称', trigger: 'blur' }
-          ],
-          status: [
-            {
-              required: true,
-              message: '请选择状态',
-              trigger: 'blur'
-            }
-          ]
-        },
-        list: []
-      };
-    },
-    methods: {
-      handAdd() {
-        this.$refs.termRef.open(this.list);
-      },
-      selectionChange(selection) {
-        console.log(selection, 'selection');
+        ]
       },
-      selectChange(list) {
-        this.list = list;
-      },
-      handDel(index) {
-        this.$confirm('是否删除该质检项', '删除', {
-          type: 'warning'
+      list: []
+    };
+  },
+  methods: {
+    handAdd() {
+      this.$refs.termRef.open(this.list);
+    },
+    handleClose() {
+      this.visible = false;
+    },
+    selectionChange(selection) {
+      console.log(selection, 'selection');
+    },
+    selectChange(list) {
+      this.list = list;
+    },
+    handDel(index) {
+      this.$confirm('是否删除该质检项', '删除', {
+        type: 'warning'
+      })
+        .then(() => {
+          this.list.splice(index, 1);
         })
-          .then(() => {
-            this.list.splice(index, 1);
-          })
-          .catch(() => {});
-      },
-      init(id) {
-        this.dataForm.id = id || 0;
-        this.visible = true;
-        this.$nextTick(async () => {
-          this.$refs['dataForm'].resetFields();
-          if (this.dataForm.id) {
-            getById(this.dataForm.id).then(({ data }) => {
-              this.dataForm = data;
-              this.list = data.inspectionItemVOList;
-            });
-          } else {
-            const code = await getCode('template_code');
-            this.dataForm.qualitySchemeTemplateCode = code;
-            this.list = [];
-          }
-        });
-      },
-      // 表单提交
-      dataFormSubmit() {
-        this.$refs['dataForm'].validate((valid) => {
-          if (valid) {
-            if (!this.dataForm.id) {
-              delete this.dataForm.id;
-            }
-            const saveOrUpdate = this.dataForm.id ? update : save;
-            this.dataForm.inspectionItemVOList = this.list;
-            saveOrUpdate(this.dataForm)
-              .then((msg) => {
-                this.loading = false;
-                this.dataForm = {};
-                const info = this.dataForm.id ? '修改成功' : '新增成功';
-                this.$message.success(info);
-                this.visible = false;
-                // this.updateVisible(false);
-                this.$emit('refreshDataList');
-              })
-              .catch((e) => {
-                this.loading = false;
-              });
+        .catch(() => { });
+    },
+    init(id) {
+      this.dataForm.id = id || 0;
+      this.visible = true;
+      this.$nextTick(async () => {
+        this.$refs['dataForm'].resetFields();
+        if (this.dataForm.id) {
+          getById(this.dataForm.id).then(({ data }) => {
+            this.dataForm = data;
+            this.list = data.inspectionItemVOList;
+          });
+        } else {
+          const code = await getCode('template_code');
+          this.dataForm.qualitySchemeTemplateCode = code;
+          this.list = [];
+        }
+      });
+    },
+    // 表单提交
+    dataFormSubmit() {
+      this.$refs['dataForm'].validate((valid) => {
+        if (valid) {
+          if (!this.dataForm.id) {
+            delete this.dataForm.id;
           }
-        });
-      }
+          const saveOrUpdate = this.dataForm.id ? update : save;
+          this.dataForm.inspectionItemVOList = this.list;
+          saveOrUpdate(this.dataForm)
+            .then((msg) => {
+              this.loading = false;
+              this.dataForm = {};
+              const info = this.dataForm.id ? '修改成功' : '新增成功';
+              this.$message.success(info);
+              this.visible = false;
+              // this.updateVisible(false);
+              this.$emit('refreshDataList');
+            })
+            .catch((e) => {
+              this.loading = false;
+            });
+        }
+      });
     }
-  };
+  }
+};
 </script>

+ 32 - 30
src/views/sample/samplemanagement/index.vue

@@ -2,7 +2,8 @@
     <div class="ele-body">
         <el-card shadow="never">
             <search ref="search" @search="reload"></search>
-            <ele-pro-table ref="table" :columns="columns" :datasource="datasource" :pageSize="20"  :pageSizes="[20, 30, 40, 50, 100]">
+            <ele-pro-table ref="table" :columns="columns" :datasource="datasource" :pageSize="20"
+                :pageSizes="[20, 30, 40, 50, 100]">
                 <!-- 表头工具栏 -->
                 <template v-slot:toolbar>
 
@@ -24,7 +25,7 @@
             </ele-pro-table>
             <!-- <processingInfo ref="processingRefs"></processing> -->
         </el-card>
-<!--      <edit ref="edit" ></edit>-->
+        <!--      <edit ref="edit" ></edit>-->
     </div>
 </template>
 <script>
@@ -38,30 +39,31 @@ import dictMixins from '@/mixins/dictMixins';
 export default {
     mixins: [dictMixins],
     components: {
-      search,
-      edit
+        search,
+        edit
     },
     data() {
         return {
             columns: [
-                {type: 'index',columnKey: 'index',align: 'center',label: '序号',width: 55,showOverflowTooltip: true},
-                {prop: 'sampleCode',label: '编码',slot: 'sampleCode',align: 'center',width: 160,showOverflowTooltip: true},
-                {prop: 'categoryCode',label: '物品编码',slot: 'categoryCode', align: 'center',width: 160,showOverflowTooltip: true},
-                {prop: 'categoryName',label: '物品名称',slot: 'categoryName', align: 'center',width: 160,showOverflowTooltip: true},
-                {prop: 'specification',label: '规格',slot: 'specification', align: 'center',width: 100,showOverflowTooltip: true},
-                {prop: 'brandNum',label: '牌号',slot: 'brandNum', align: 'center',width: 100,showOverflowTooltip: true},
-                {prop: 'modelType',label: '型号',slot: 'modelType', align: 'center',width: 160,showOverflowTooltip: true},
-                {prop: 'unit',label: '计量单位',slot: 'unit', align: 'center',width: 100,showOverflowTooltip: true},
-                {prop: 'batchNo',label: '批次号',slot: 'batchNo', align: 'center',width: 100,showOverflowTooltip: true},
-                {prop: 'weight',label: '重量',slot: 'weight', align: 'center',width: 100,showOverflowTooltip: true},
-                {prop: 'weightUnit',label: '重量单位',slot: 'weightUnit', align: 'center',width: 100,showOverflowTooltip: true},
-                {prop: 'disposeTime',label: '处置时间',slot: 'disposeTime', align: 'center',width: 180,showOverflowTooltip: true},
-                {prop: 'status',label: '状态',align: 'center',width: 80,fixed: 'right',
-                  formatter: (row, column, cellValue) => {
-                    return cellValue == 1 ? '已处置' : cellValue == 2 ? '未处置' : '';
-                  }
+                { type: 'index', columnKey: 'index', align: 'center', label: '序号', width: 55, showOverflowTooltip: true },
+                { prop: 'sampleCode', label: '编码', slot: 'sampleCode', align: 'center', width: 160, showOverflowTooltip: true },
+                { prop: 'categoryCode', label: '物品编码', align: 'center', width: 160, showOverflowTooltip: true },
+                { prop: 'categoryName', label: '物品名称', align: 'center', width: 160, showOverflowTooltip: true },
+                { prop: 'specification', label: '规格', align: 'center', width: 100, showOverflowTooltip: true },
+                { prop: 'brandNum', label: '牌号', align: 'center', width: 100, showOverflowTooltip: true },
+                { prop: 'modelType', label: '型号', align: 'center', width: 160, showOverflowTooltip: true },
+                { prop: 'unit', label: '计量单位', align: 'center', width: 100, showOverflowTooltip: true },
+                { prop: 'batchNo', label: '批次号', align: 'center', width: 100, showOverflowTooltip: true },
+                { prop: 'weight', label: '重量', align: 'center', width: 100, showOverflowTooltip: true },
+                { prop: 'weightUnit', label: '重量单位', align: 'center', width: 100, showOverflowTooltip: true },
+                { prop: 'disposeTime', label: '处置时间', align: 'center', width: 180, showOverflowTooltip: true },
+                {
+                    prop: 'status', label: '状态', align: 'center', width: 80, fixed: 'right',
+                    formatter: (row, column, cellValue) => {
+                        return cellValue == 1 ? '已处置' : cellValue == 2 ? '未处置' : '';
+                    }
                 },
-                {columnKey: 'action',label: '操作',align: 'center',width: 120,resizable: false,slot: 'action',fixed: 'right'}
+                { columnKey: 'action', label: '操作', align: 'center', width: 120, resizable: false, slot: 'action', fixed: 'right' }
             ]
         };
     },
@@ -81,15 +83,15 @@ export default {
             this.$refs.table.reload({ page: 1, where });
         },
         processingMethod(type, row) {
-          this.$router.push({
-            path: '/sample/samplemanagement/components/edit',
-            query: {
-              type: type,
-              qualityWorkOrderId: row.qualityWorkOrderId || '',
-              id: row.id || '',
-              qualityType: row.qualityType || ''
-            }
-          });
+            this.$router.push({
+                path: '/sample/samplemanagement/components/edit',
+                query: {
+                    type: type,
+                    qualityWorkOrderId: row.qualityWorkOrderId || '',
+                    id: row.id || '',
+                    qualityType: row.qualityType || ''
+                }
+            });
             // this.$refs.edit.open(type, row)
         },
     }

+ 1 - 1
vue.config.js

@@ -37,7 +37,7 @@ module.exports = {
       '/api': {
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.107:18086',
-        target: 'http://192.168.1.251:18086',
+        target: 'http://192.168.1.251:18186',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''