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

+ 10 - 0
src/api/qualityInspectionPlan/index.js

@@ -0,0 +1,10 @@
+import request from '@/utils/request';
+
+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));
+}

+ 32 - 23
src/views/inspectionClassify/components/qualityItem.vue

@@ -35,17 +35,30 @@
               ? '时间'
               : row.textType == 6
               ? '范围'
+              : row.textType == 7
+              ? '文本'
               : ''
           }}
         </template>
+        <template v-slot:defaultValue="{ row }">
+          <span v-if="row.defaultValue">{{ row.symbol }}</span>
+          {{ row.defaultValue }}
+        </template>
 
         <template v-slot:type="{ row }">
           {{ getDictValue('质检标准类型', row.qualityStandardType) }}
         </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>
     </el-card>
@@ -103,7 +116,13 @@
             slot: 'textType',
             minWidth: 110
           },
-
+          {
+            prop: 'defaultValue',
+            label: '默认值',
+            align: 'center',
+            showOverflowTooltip: true,
+            slot: 'defaultValue'
+          },
           {
             prop: 'maxValue',
             label: '参数上限',
@@ -116,20 +135,15 @@
             align: 'center',
             showOverflowTooltip: true
           },
-          {
-            prop: 'defaultValue',
-            label: '默认值',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            label: '工艺要求',
-            prop: 'inspectionStandard',
-            formatter: (row, column, cellValue) => {
-              return row.symbol + ' ' + cellValue + ' ' + row.unit;
-            },
-            minWidth: 150
-          },
+
+          // {
+          //   label: '工艺要求',
+          //   prop: 'inspectionStandard',
+          //   formatter: (row, column, cellValue) => {
+          //     return row.symbol + ' ' + cellValue + ' ' + row.unit;
+          //   },
+          //   minWidth: 150
+          // },
 
           {
             label: '标准类型',
@@ -163,9 +177,7 @@
           {
             label: '备注',
             prop: 'inspectionRemark'
-          },
-
-          
+          }
         ],
 
         // 表格选中数据
@@ -185,7 +197,6 @@
 
       /* 表格数据源 */
       async datasource({ page, limit, where }) {
-      
         const res = await getList({
           ...where,
           categoryLevelId: this.categoryId,
@@ -193,8 +204,6 @@
           size: limit
         });
 
-      
-
         return res;
       },
 

+ 24 - 18
src/views/inspectionClassify/components/user-list.vue

@@ -39,6 +39,8 @@
             ? '时间'
             : row.itemVO.textType == 6
             ? '范围'
+            : row.itemVO.textType == 7
+            ? '文本'
             : ''
         }}
       </template>
@@ -47,6 +49,10 @@
         {{ getDictValue('质检标准类型', row.itemVO.qualityStandardType) }}
       </template>
 
+      <template v-slot:defaultValue="{ row }">
+        <span v-if="row.itemVO.defaultValue">{{ row.itemVO.symbol }}</span>
+        {{ row.itemVO.defaultValue }}
+      </template>
       <template v-slot:toolList="{ row }">
         <div
           style="display: inline-block"
@@ -106,7 +112,7 @@
 
         columns: [
           {
-            prop: 'itemVO.categoryLevelName',
+            prop: 'itemVO.categoryLevelClassName',
             label: '质检类型',
             align: 'center',
             minWidth: 110
@@ -134,7 +140,13 @@
             slot: 'textType',
             minWidth: 110
           },
-
+          {
+            prop: 'itemVO.defaultValue',
+            label: '默认值',
+            align: 'center',
+            showOverflowTooltip: true,
+            slot: 'defaultValue'
+          },
           {
             prop: 'itemVO.maxValue',
             label: '参数上限',
@@ -147,22 +159,16 @@
             align: 'center',
             showOverflowTooltip: true
           },
-          {
-            prop: 'itemVO.defaultValue',
-            label: '默认值',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            label: '工艺要求',
-            prop: 'itemVO.inspectionStandard',
-            formatter: (row, column, cellValue) => {
-              return (
-                row.itemVO.symbol + ' ' + cellValue + ' ' + row.itemVO.unit
-              );
-            },
-            minWidth: 150
-          },
+          // {
+          //   label: '工艺要求',
+          //   prop: 'itemVO.inspectionStandard',
+          //   formatter: (row, column, cellValue) => {
+          //     return (
+          //       row.itemVO.symbol + ' ' + cellValue + ' ' + row.itemVO.unit
+          //     );
+          //   },
+          //   minWidth: 150
+          // },
           {
             label: '标准类型',
             prop: 'itemVO.type',

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

@@ -1,14 +1,28 @@
 <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" />
+            <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>
@@ -16,58 +30,57 @@
 </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'
-    };
-  },
-  computed: {},
-  methods: {
-    handleNodeClick(info) {
-      this.current = info;
-       this.$nextTick(() => {
-
-        this.$refs.searchRef.clickSearch(info)
-       })
+  export default {
+    components: {
+      AssetTree,
+      userList
+    },
+    data() {
+      return {
+        // 加载状态
+        loading: false,
+        // 表格选中数据
+        selection: [],
+        current: null,
+        rootId: '12'
+      };
     },
-    // 获取根节点id
-    setRootId(id) {
-      if (id) {
-        this.rootId = id;
+    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;
+        }
       }
-
     }
-  }
-};
+  };
 </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>

+ 43 - 18
src/views/inspectionProject/components/user-edit.vue

@@ -59,6 +59,7 @@
               v-model="form.textType"
               placeholder="请选择"
               class="ele-block"
+              style="width: 100%"
             >
               <el-option label="数值" :value="'1'" />
               <el-option label="选择" :value="'2'" />
@@ -77,25 +78,43 @@
             form.textType == 1 ||
             form.textType == 3 ||
             form.textType == 4 ||
-            form.textType == 5 ||
-            form.textType == 7
+            form.textType == 5
           "
         >
           <el-form-item label="默认值:">
+            <DictSelection
+              style="width: 100px"
+              clearable
+              dictName="数学字符"
+              v-model="form.symbol"
+            ></DictSelection>
             <el-input
               v-model="form.defaultValue"
               placeholder="请输入"
+              style="width: calc(100% - 100px)"
             ></el-input>
           </el-form-item>
         </el-col>
+        <el-col :span="24" v-if="form.textType == 7">
+          <el-form-item label="默认值:" prop="defaultValue">
+            <el-input v-model="form.defaultValue" type="textarea"> </el-input>
+          </el-form-item>
+        </el-col>
 
         <el-col :span="12" v-if="form.textType == 2">
           <el-form-item label="默认值:" prop="defaultValue">
+            <DictSelection
+              style="width: 100px"
+              clearable
+              dictName="数学字符"
+              v-model="form.symbol"
+            ></DictSelection>
             <el-select
               v-model="form.defaultValue"
               placeholder="请选择"
               class="ele-block"
             >
+              <!-- style="width: calc(100% - 100px)" -->
               <el-option label="TRUE" :value="'TRUE'" />
               <el-option label="FALSE" :value="'FALSE'" />
             </el-select>
@@ -104,9 +123,16 @@
 
         <el-col :span="12" v-if="form.textType == 6">
           <el-form-item label="默认值:">
+            <DictSelection
+              style="width: 100px"
+              clearable
+              dictName="数学字符"
+              v-model="form.symbol"
+            ></DictSelection>
             <el-input
               v-model="form.defaultValue"
               placeholder="案例: 12.7≤IC<19.05 ;IC<12.7"
+              style="width: calc(100% - 100px)"
             ></el-input>
           </el-form-item>
         </el-col>
@@ -148,21 +174,13 @@
           <el-form-item label="参数单位:" prop=""> h(小时) </el-form-item>
         </el-col>
 
-        <el-col :span="24">
-          <el-form-item label="工艺要求:" prop="inspectionStandard">
-            <DictSelection
-                style="width: 100px"
-              
-                clearable
-                dictName="数学字符"
-                v-model="form.symbol"
-              ></DictSelection>
-            <el-input v-model="form.inspectionStandard" type="textarea" style="width:calc(100% - 100px)">
-        
+        <!-- <el-col :span="24" v-if="form.textType != 7">
+          <el-form-item label="文本描述:" prop="inspectionStandard">
+            <el-input v-model="form.inspectionStandard" type="textarea">
             </el-input>
           </el-form-item>
-        </el-col>
-        <el-col :span="12">
+        </el-col> -->
+        <!-- <el-col :span="12">
           <el-form-item label="单位:" prop="unit">
             <DictSelection
               clearable
@@ -170,9 +188,8 @@
               v-model="form.unit"
             ></DictSelection>
           </el-form-item>
-        </el-col>
+        </el-col> -->
 
-        
         <el-col :span="12">
           <el-form-item label="状态:" prop="status">
             <el-select
@@ -188,7 +205,12 @@
 
         <el-col :span="24">
           <el-form-item label="备注:" prop="inspectionRemark">
-            <el-input placeholder="请输入" v-model="form.inspectionRemark" type="textarea" style="height: 100px;" />
+            <el-input
+              placeholder="请输入"
+              v-model="form.inspectionRemark"
+              type="textarea"
+              style="height: 100px"
+            />
           </el-form-item>
         </el-col>
 
@@ -535,4 +557,7 @@
       cursor: pointer;
     }
   }
+  ::v-deep .el-form-item__content {
+    display: flex !important;
+  }
 </style>

+ 31 - 27
src/views/inspectionProject/index.vue

@@ -34,19 +34,18 @@
         </template>
 
         <template v-slot:maxValue="{ row }">
-          {{ row.maxValue }} <span v-if="row.maxValue  ">{{row.unitName}}</span>
+          {{ row.maxValue }} <span v-if="row.maxValue">{{ row.unitName }}</span>
         </template>
 
         <template v-slot:minValue="{ row }">
-          {{ row.minValue }}  <span v-if="row.minValue   ">{{row.unitName}}</span>
+          {{ row.minValue }} <span v-if="row.minValue">{{ row.unitName }}</span>
         </template>
 
-        
         <template v-slot:defaultValue="{ row }">
-          {{ row.defaultValue }} <span v-if="row.defaultValue ">{{row.unitName}}</span>
+          <span v-if="row.defaultValue">{{ row.symbol }}</span>
+          {{ row.defaultValue }}
         </template>
 
-
         <template v-slot:textType="{ row }">
           {{
             row.textType == 1
@@ -71,14 +70,18 @@
           {{ getDictValue('质检标准类型', row.qualityStandardType) }}
         </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>
 
-
-        
-
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
           <el-link
@@ -127,7 +130,7 @@
   import importDialog from '@/components/upload/import-dialog.vue';
 
   import { getList, removeItem } from '@/api/inspectionProject';
-import dictMixins from '@/mixins/dictMixins'
+  import dictMixins from '@/mixins/dictMixins';
   export default {
     name: 'inspectionProject',
     components: {
@@ -157,12 +160,20 @@ import dictMixins from '@/mixins/dictMixins'
           {
             prop: 'textType',
             label: '参数类型',
- 
+
             align: 'center',
             slot: 'textType',
             minWidth: 110
           },
 
+          {
+            prop: 'defaultValue',
+            slot: 'defaultValue',
+            label: '默认值',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
           {
             prop: 'maxValue',
             slot: 'maxValue',
@@ -177,21 +188,14 @@ import dictMixins from '@/mixins/dictMixins'
             align: 'center',
             showOverflowTooltip: true
           },
-          {
-            prop: 'defaultValue',
-            slot: 'defaultValue',
-            label: '默认值',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            label: '工艺要求',
-            prop: 'inspectionStandard',
-            formatter: (row, column, cellValue) => {
-              return row.symbol + ' ' + cellValue + ' ' + row.unit;
-            },
-            minWidth: 150
-          },
+          // {
+          //   label: '工艺要求',
+          //   prop: 'inspectionStandard',
+          //   formatter: (row, column, cellValue) => {
+          //     return row.symbol + ' ' + cellValue + ' ' + row.unit;
+          //   },
+          //   minWidth: 150
+          // },
 
           {
             label: '标准类型',

+ 229 - 0
src/views/qualityInspectionPlan/index.vue

@@ -0,0 +1,229 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+        <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
+            <el-form-item label="参数名">
+                <el-input
+                    v-model="dataForm.key"
+                    placeholder="请输入"
+                    clearable>
+                </el-input>
+            </el-form-item>
+            <el-form-item>
+                <el-button @click="getDataList()">查询</el-button>
+                <el-button type="primary" @click="addOrUpdateHandle()">新增</el-button>
+                <el-button
+                    type="danger"
+                    @click="deleteHandle()"
+                    :disabled="dataListSelections.length <= 0"
+                >批量删除
+            </el-button>
+            </el-form-item>
+        </el-form>
+        <el-table
+      :data="dataList"
+      border
+      v-loading="dataListLoading"
+      @selection-change="selectionChangeHandle"
+      style="width: 100%"
+    >
+      <el-table-column
+        type="selection"
+        header-align="center"
+        align="center"
+        width="50"
+      >
+      </el-table-column>
+      <el-table-column
+        prop="qualitySchemeTemplateName"
+        header-align="center"
+        align="center"
+        label="名称"
+      >
+      </el-table-column>
+      <el-table-column
+        prop="qualitySchemeTemplateCode"
+        header-align="center"
+        align="center"
+        label="编码"
+      >
+      </el-table-column>
+      
+      <el-table-column
+        prop="status"
+        header-align="center"
+        align="center"
+        label="状态"
+        :formatter="statusFormat"
+      >
+      </el-table-column>
+      <el-table-column
+        prop="createTime"
+        header-align="center"
+        align="center"
+        label="创建时间"
+      >
+      </el-table-column>
+      <el-table-column
+        prop="createUserName"
+        header-align="center"
+        align="center"
+        label="创建人"
+      >
+      </el-table-column>
+      
+      </el-table-column>
+      <el-table-column
+        fixed="right"
+        header-align="center"
+        align="center"
+        width="150"
+        label="操作"
+      >
+        <template slot-scope="scope">
+          <el-button
+            type="text"
+            size="small"
+            @click="addOrUpdateHandle(scope.row.id)"
+            >修改</el-button
+          >
+          <el-button
+            type="text"
+            size="small"
+            @click="deleteHandle(scope.row.id)"
+            >删除</el-button
+          >
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      @size-change="sizeChangeHandle"
+      @current-change="currentChangeHandle"
+      :current-page="pageIndex"
+      :page-sizes="[10, 20, 50, 100]"
+      :page-size="pageSize"
+      :total="totalPage"
+      layout="total, sizes, prev, pager, next, jumper"
+    >
+    </el-pagination>
+    </el-card>
+    <!-- 弹窗, 新增 / 修改 -->
+    <add-or-update
+      v-if="addOrUpdateVisible"
+      ref="addOrUpdate"
+      @refreshDataList="getDataList"
+    ></add-or-update>
+  </div>
+</template>
+
+<script>
+  import AddOrUpdate from './qualitytemplate-add-or-update';
+  export default {
+    data() {
+      return {
+        dataForm: {
+          key: ''
+        },
+        dataList: [],
+        pageIndex: 1,
+        pageSize: 10,
+        totalPage: 0,
+        dataListLoading: false,
+        dataListSelections: [],
+        addOrUpdateVisible: false
+      };
+    },
+    components: {
+      AddOrUpdate
+    },
+    activated() {
+      this.getDataList();
+    },
+    methods: {
+      // 获取数据列表
+      getDataList() {
+        this.dataListLoading = true;
+        this.$http({
+          url: this.$http.adornUrl('/qms/qualitytemplate/list'),
+          method: 'get',
+          params: this.$http.adornParams({
+            page: this.pageIndex,
+            limit: this.pageSize,
+            key: this.dataForm.key
+          })
+        }).then(({ data }) => {
+          if (data && data.code === 0) {
+            this.dataList = data.page.list;
+            this.totalPage = data.page.totalCount;
+          } else {
+            this.dataList = [];
+            this.totalPage = 0;
+          }
+          this.dataListLoading = false;
+        });
+      },
+      // 每页数
+      sizeChangeHandle(val) {
+        this.pageSize = val;
+        this.pageIndex = 1;
+        this.getDataList();
+      },
+      // 当前页
+      currentChangeHandle(val) {
+        this.pageIndex = val;
+        this.getDataList();
+      },
+      // 多选
+      selectionChangeHandle(val) {
+        this.dataListSelections = val;
+      },
+      // 新增 / 修改
+      addOrUpdateHandle(id) {
+        this.addOrUpdateVisible = true;
+        this.$nextTick(() => {
+          this.$refs.addOrUpdate.init(id);
+        });
+      },
+      // 删除
+      deleteHandle(id) {
+        var ids = id
+          ? [id]
+          : this.dataListSelections.map((item) => {
+              return item.id;
+            });
+        this.$confirm(
+          `确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`,
+          '提示',
+          {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }
+        ).then(() => {
+          this.$http({
+            url: this.$http.adornUrl('/qms/qualitytemplate/delete'),
+            method: 'post',
+            data: this.$http.adornData(ids, false)
+          }).then(({ data }) => {
+            if (data && data.code === 0) {
+              this.$message({
+                message: '操作成功',
+                type: 'success',
+                duration: 1500,
+                onClose: () => {
+                  this.getDataList();
+                }
+              });
+            } else {
+              this.$message.error(data.msg);
+            }
+          });
+        });
+      },
+    
+      statusFormat(row, column) {
+        return row.status === 1 ? "有效" : "失效";
+      }
+    }
+  };
+</script>

+ 82 - 0
src/views/qualityInspectionPlan/inspectionClassify/components/user-search.vue

@@ -0,0 +1,82 @@
+<!-- 搜索表单 -->
+<template>
+  <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="请输入" />
+        </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>
+        </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>
+          <el-button
+            @click="reset"
+            icon="el-icon-refresh-left"
+            size="small"
+            type="primary"
+            >重置</el-button
+          >
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        name: '',
+        status: 1
+      };
+
+      return {
+        // 表单数据
+        where: { ...defaultWhere }
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search() {
+        console.log(this.where);
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      }
+    }
+  };
+</script>

+ 311 - 0
src/views/qualityInspectionPlan/inspectionClassify/index.vue

@@ -0,0 +1,311 @@
+<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%"
+  >
+    <div class="ele-body">
+      <el-card shadow="never" v-loading="loading">
+        <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"
+                :treeIds="[12]"
+                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"
+            >
+              <!-- 表头工具栏 -->
+
+              <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 userSearch from './components/user-search.vue';
+  import { pageByBom } from '@/api/qualityInspectionPlan/index.js';
+  import dictMixins from '@/mixins/dictMixins';
+
+  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
+          },
+
+          {
+            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() {
+      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.clickSearch(info);
+        });
+      },
+
+      clickSearch(info) {
+        this.categoryLevelId = info.id;
+        this.rootCategoryLevelId = info.rootCategoryLevelId;
+        this.reload();
+      },
+
+      // 获取根节点id
+      setRootId(id) {
+        console.log(id, 'ididid');
+        if (id) {
+          this.rootId = id;
+        }
+      },
+
+      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();
+      }
+    }
+  };
+</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 :deep(.el-tree-node__content) {
+    height: 30px;
+
+    & > .el-tree-node__expand-icon {
+      margin-left: 10px;
+    }
+  }
+</style>

+ 357 - 0
src/views/qualityInspectionPlan/qualitytemplate-add-or-update.vue

@@ -0,0 +1,357 @@
+<template>
+  <el-dialog
+    :title="!dataForm.id ? '新增' : '修改'"
+    :close-on-click-modal="false"
+    :visible.sync="visible"
+  >
+    <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-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="编码" prop="qualitySchemeTemplateCode">
+            <el-input
+              v-model="dataForm.qualitySchemeTemplateCode"
+              placeholder="质检方案编码"
+            ></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-option label="失效" :value="0" />
+              <el-option label="有效" :value="1" />
+            </el-select> </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.sync="selection"
+          @selection-change="selectionChange"
+        >
+          <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
+                ? '范围'
+                : row.textType == 7
+                ? '文本'
+                : ''
+            }}
+          </template>
+
+          <template v-slot:type="{ row }">
+            {{ getDictValue('质检标准类型', row.qualityStandardType) }}
+          </template>
+
+          <template v-slot:defaultValue="{ row }">
+            <div
+              style="width: 100%; display: flex; justify-content: space-between"
+            >
+              <div style="width: 8%">
+                <el-input v-model="row.symbol" disabled> </el-input>
+              </div>
+              <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>
+                <span>&nbsp;&nbsp;-</span>
+                <el-input
+                  style="width: 45%; margin-left: 10px"
+                  v-model="row.maxValue"
+                ></el-input>
+              </div>
+
+              <div v-else style="width: 75%">
+                <el-input v-model="row.defaultValue" placeholder="请输入">
+                </el-input>
+              </div>
+
+              <div style="width: 15%">
+                <el-input v-model="row.unit" disabled> </el-input>
+              </div>
+            </div>
+          </template>
+
+          <template v-slot:action="{ row, $index }">
+            <el-popconfirm
+              class="ele-action"
+              title="确定要删除当前质检项吗?"
+              @confirm="handDel($index)"
+            >
+              <template v-slot:reference>
+                <el-link type="danger" :underline="false" icon="el-icon-delete">
+                  删除
+                </el-link>
+              </template>
+            </el-popconfirm>
+          </template>
+        </ele-pro-table>
+      </el-row>
+    </el-form>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="visible = false">取消</el-button>
+      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
+    </span>
+    <termPop ref="termRef" @selectChange="selectChange"></termPop>
+  </el-dialog>
+</template>
+
+<script>
+  import termPop from '@/views/qualityInspectionPlan/inspectionClassify/index.vue';
+  export default {
+    components: { termPop },
+    data() {
+      return {
+        visible: false,
+        dataForm: {
+          id: 0,
+          qualitySchemeTemplateName: '',
+          qualitySchemeTemplateCode: '',
+          inspectionItemId: '',
+          status: '',
+          deleted: '',
+          createTime: '',
+          createUserId: '',
+          updateTime: '',
+          updateUserId: '',
+          tenantId: '',
+          deptId: '',
+          factoriesId: ''
+        },
+        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: 'categoryLevelName',
+            label: '质检类型',
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            prop: 'inspectionName',
+            label: '质检名称',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            prop: 'defaultValue',
+            slot: 'defaultValue',
+            label: '工艺参数',
+            align: 'center',
+            width: 500
+          },
+
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 80,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            fixed: 'right'
+          }
+        ],
+        dataRule: {
+          // qualitySchemeTemplateName: [
+          //   { required: true, message: '质检方案名称不能为空', trigger: 'blur' }
+          // ],
+          // qualitySchemeTemplateCode: [
+          //   { required: true, message: '质检方案编码不能为空', trigger: 'blur' }
+          // ],
+          // inspectionItemId: [
+          //   { required: true, message: '质检项id不能为空', trigger: 'blur' }
+          // ],
+          // status: [
+          //   { required: true, message: '状态 0 失效 1 有效不能为空', trigger: 'blur' }
+          // ],
+          // deleted: [
+          //   { required: true, message: '是否删除:0 正常,1 删除不能为空', trigger: 'blur' }
+          // ],
+          // createTime: [
+          //   { required: true, message: '创建时间不能为空', trigger: 'blur' }
+          // ],
+          // createUserId: [
+          //   { required: true, message: '创建人ID不能为空', trigger: 'blur' }
+          // ],
+          // updateTime: [
+          //   { required: true, message: '最后更新时间不能为空', trigger: 'blur' }
+          // ],
+          // updateUserId: [
+          //   { required: true, message: '最后更新人ID不能为空', trigger: 'blur' }
+          // ],
+          // tenantId: [
+          //   { required: true, message: '租户ID不能为空', trigger: 'blur' }
+          // ],
+          // deptId: [
+          //   { required: true, message: '组织id不能为空', trigger: 'blur' }
+          // ],
+          // factoriesId: [
+          //   { required: true, message: '工厂id不能为空', 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'
+        })
+          .then(() => {
+            this.list.splice(index, 1);
+          })
+          .catch(() => {});
+      },
+      init(id) {
+        this.dataForm.id = id || 0;
+        this.visible = true;
+        this.$nextTick(() => {
+          this.$refs['dataForm'].resetFields();
+          if (this.dataForm.id) {
+            this.$http({
+              url: this.$http.adornUrl(
+                `/qms/qualitytemplate/info/${this.dataForm.id}`
+              ),
+              method: 'get',
+              params: this.$http.adornParams()
+            }).then(({ data }) => {
+              if (data && data.code === 0) {
+                this.dataForm.qualitySchemeTemplateName =
+                  data.qualityTemplate.qualitySchemeTemplateName;
+                this.dataForm.qualitySchemeTemplateCode =
+                  data.qualityTemplate.qualitySchemeTemplateCode;
+                this.dataForm.inspectionItemId =
+                  data.qualityTemplate.inspectionItemId;
+                this.dataForm.status = data.qualityTemplate.status;
+                this.dataForm.deleted = data.qualityTemplate.deleted;
+                this.dataForm.createTime = data.qualityTemplate.createTime;
+                this.dataForm.createUserId = data.qualityTemplate.createUserId;
+                this.dataForm.updateTime = data.qualityTemplate.updateTime;
+                this.dataForm.updateUserId = data.qualityTemplate.updateUserId;
+                this.dataForm.tenantId = data.qualityTemplate.tenantId;
+                this.dataForm.deptId = data.qualityTemplate.deptId;
+                this.dataForm.factoriesId = data.qualityTemplate.factoriesId;
+              }
+            });
+          }
+        });
+      },
+      // 表单提交
+      dataFormSubmit() {
+        this.$refs['dataForm'].validate((valid) => {
+          if (valid) {
+            this.$http({
+              url: this.$http.adornUrl(
+                `/qms/qualitytemplate/${!this.dataForm.id ? 'save' : 'update'}`
+              ),
+              method: 'post',
+              data: this.$http.adornData({
+                id: this.dataForm.id || undefined,
+                qualitySchemeTemplateName:
+                  this.dataForm.qualitySchemeTemplateName,
+                qualitySchemeTemplateCode:
+                  this.dataForm.qualitySchemeTemplateCode,
+                inspectionItemId: this.dataForm.inspectionItemId,
+                status: this.dataForm.status,
+                deleted: this.dataForm.deleted,
+                createTime: this.dataForm.createTime,
+                createUserId: this.dataForm.createUserId,
+                updateTime: this.dataForm.updateTime,
+                updateUserId: this.dataForm.updateUserId,
+                tenantId: this.dataForm.tenantId,
+                deptId: this.dataForm.deptId,
+                factoriesId: this.dataForm.factoriesId
+              })
+            }).then(({ data }) => {
+              if (data && data.code === 0) {
+                this.$message({
+                  message: '操作成功',
+                  type: 'success',
+                  duration: 1500,
+                  onClose: () => {
+                    this.visible = false;
+                    this.$emit('refreshDataList');
+                  }
+                });
+              } else {
+                this.$message.error(data.msg);
+              }
+            });
+          }
+        });
+      }
+    }
+  };
+</script>