ysy 1 ano atrás
pai
commit
5c7ffeb10e

+ 1 - 1
src/views/inspectionClassify/index.vue

@@ -39,7 +39,7 @@ export default {
     handleNodeClick(info) {
       this.current = info;
        this.$nextTick(() => {
-        console.log(info)
+
         this.$refs.searchRef.clickSearch(info)
        })
     },

+ 20 - 4
src/views/inspectionPoint/components/newEdit.vue

@@ -45,7 +45,9 @@
           </el-form-item>
         </el-col>
       </el-row>
-      <el-row> 444 </el-row>
+      <el-row>
+        <inspectionProjectList @openAdd="openAdd"></inspectionProjectList>
+      </el-row>
     </el-form>
     <template v-slot:footer>
       <el-button @click="handleClose">取消</el-button>
@@ -59,13 +61,18 @@
         保存
       </el-button>
     </template>
+
+    <EquipmentDialog
+      v-if="showEquipment"
+      @closeDialog="closeDialog"
+    ></EquipmentDialog>
   </el-dialog>
 </template>
 
 <script>
   import { save, update } from '@/api/inspectionPoint';
   import fileUpload from '@/components/upload/fileUpload';
-  import EquipmentDialog from './EquipmentDialog';
+  import EquipmentDialog from './newEquipmentDialog';
   import inspectionProjectList from './newInspectionProjectList';
 
   export default {
@@ -97,7 +104,9 @@
           pointName: [{ required: true, message: '请输入', trigger: 'blur' }]
         },
         visible: true,
-        loading: false
+        loading: false,
+
+        showEquipment: false
       };
     },
 
@@ -107,7 +116,6 @@
       }
     },
     methods: {
-      /* 保存编辑 */
       save() {
         this.$refs.form.validate((valid) => {
           if (!valid) {
@@ -133,6 +141,14 @@
 
       handleClose() {
         this.$emit('close');
+      },
+
+      openAdd() {
+        this.showEquipment = true;
+      },
+
+      closeDialog() {
+        this.showEquipment = false;
       }
     }
   };

+ 296 - 0
src/views/inspectionPoint/components/newEquipmentDialog.vue

@@ -0,0 +1,296 @@
+<template>
+  <el-dialog
+    title="质检项"
+    :visible.sync="visibleDialog"
+    :before-close="handleClose"
+    :close-on-click-modal="true"
+    :close-on-press-escape="false"
+    append-to-body
+    width="80%"
+  >
+    <div class="layout">
+      <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"
+              :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 - 385px)"
+            full-height="calc(100vh - 116px)"
+            tool-class="ele-toolbar-form"
+            cache-key="inspectionClassify"
+            row-key="id"
+          >
+            <!-- 表头工具栏 -->
+            <template v-slot:toolbar> </template>
+
+            <template v-slot:textType="{ row }">
+              <div v-if="row.itemVO && row.itemVO.textType">
+                {{
+                  row.itemVO.textType == 1
+                    ? '数值'
+                    : row.itemVO.textType == 2
+                    ? '选择'
+                    : row.itemVO.textType == 3
+                    ? '上下限'
+                    : row.itemVO.textType == 4
+                    ? '规格'
+                    : row.itemVO.textType == 5
+                    ? '时间'
+                    : row.itemVO.textType == 6
+                    ? '范围'
+                    : ''
+                }}
+              </div>
+            </template>
+
+            <template v-slot:type="{ row }">
+              <span v-if=" row.itemVO.type">
+                {{ getDictValue('质检标准类型', row.itemVO.type) }}
+              </span>
+            </template>
+
+            <template v-slot:toolList="{ row }">
+              <div
+                style="display: inline-block"
+                v-for="(item, idx) in row.itemVO.toolList"
+                :key="idx"
+                >{{ item.name }}
+                <span
+                  v-if="
+                    row.itemVO.toolList && idx != row.itemVO.toolList.length - 1
+                  "
+                  >,
+                </span></div
+              >
+            </template>
+
+            <template v-slot:action="{ row }">
+              <el-popconfirm
+                class="ele-action"
+                title="确定要删除此质检项吗?"
+                @confirm="remove(row)"
+              >
+                <template v-slot:reference>
+                  <el-link
+                    type="danger"
+                    :underline="false"
+                    icon="el-icon-delete"
+                  >
+                    删除
+                  </el-link>
+                </template>
+              </el-popconfirm>
+            </template>
+          </ele-pro-table>
+        </template>
+      </ele-split-layout>
+    </div>
+    <div class="btns">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  import AssetTree from '@/components/AssetTree';
+  import userSearch from '@/views/inspectionClassify/components/user-search';
+
+  import { getList } from '@/api/inspectionClassify/index';
+  import dictMixins from '@/mixins/dictMixins';
+  export default {
+    mixins: [dictMixins],
+    components: {
+      AssetTree,
+      userSearch
+    },
+    props: {},
+    data() {
+      return {
+        visibleDialog: true,
+        rootId: '12',
+        categoryLevelId: null,
+
+        columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center',
+            reserveSelection: true
+          },
+
+          {
+            prop: 'itemVO.inspectionCode',
+            label: '参数编码',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'itemVO.inspectionName',
+            label: '参数名称',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            prop: 'itemVO.textType',
+            label: '参数类型',
+            showOverflowTooltip: true,
+            align: 'center',
+            slot: 'textType',
+            minWidth: 110
+          },
+
+          {
+            prop: 'itemVO.maxValue',
+            label: '参数上限',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'itemVO.minValue',
+            label: '参数下限',
+            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.type',
+            slot: 'type'
+          },
+
+          {
+            prop: 'itemVO.qualityStandardName',
+            label: '标准名称',
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            label: '状态',
+            prop: 'status',
+            formatter: (row, column, cellValue) => {
+              return cellValue == 1 ? '启用' : cellValue === 0 ? '停用' : '';
+            }
+          },
+
+          {
+            prop: 'itemVO.toolList',
+            slot: 'toolList',
+            label: '设备名称',
+            align: 'center',
+            minWidth: 150
+          },
+
+          {
+            label: '备注',
+            prop: 'inspectionRemark'
+          }
+        ]
+      };
+    },
+
+    methods: {
+      datasource({ page, limit, where }) {
+        return getList({
+          ...where,
+          pageNum: page,
+          size: limit,
+          categoryLevelId: this.categoryLevelId || 12,
+          rootCategoryLevelId: this.rootId
+        });
+      },
+
+      handleNodeClick(info) {
+        this.current = info;
+        this.$nextTick(() => {
+          this.categoryLevelId = info.id;
+
+          this.rootCategoryLevelId = info.rootCategoryLevelId;
+          this.reload();
+        });
+      },
+      // 获取根节点id
+      setRootId(id) {
+        if (id) {
+          this.rootId = id;
+        }
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({
+          pageNum: 1,
+          where: where,
+          categoryLevelId: this.categoryLevelId,
+          rootCategoryLevelId: this.rootId
+        });
+      },
+
+      selectionChange(selection) {
+        console.log(selection);
+      },
+
+      onDone() {
+        this.$nextTick(() => {
+          this.$refs.equiTable.setSelectedRowKeys(this.ids);
+        });
+      },
+      handleClose() {
+        this.$emit('closeDialog');
+      },
+
+      selected() {}
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .layout {
+    min-height: 50vh;
+    max-height: 70vh;
+    overflow-y: scroll;
+  }
+
+  .btns {
+    text-align: center;
+    padding: 10px 0;
+  }
+</style>

+ 177 - 19
src/views/inspectionPoint/components/newInspectionProjectList.vue

@@ -1,34 +1,192 @@
 <template>
-    <div>
+  <div>
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="datasource"
+      height="calc(100vh - 435px)"
+      full-height="calc(100vh - 156px)"
+      tool-class="ele-toolbar-form"
+      cache-key="inspectionClassify"
+      row-key="id"
+    >
+      <!-- 表头工具栏 -->
+      <template v-slot:toolbar>
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-plus"
+          class="ele-btn-icon"
+          @click="openAdd()"
+        >
+          添加质检项
+        </el-button>
+      </template>
 
+      <template v-slot:textType="{ row }">
+        {{
+          row.itemVO.textType == 1
+            ? '数值'
+            : row.itemVO.textType == 2
+            ? '选择'
+            : row.itemVO.textType == 3
+            ? '上下限'
+            : row.itemVO.textType == 4
+            ? '规格'
+            : row.itemVO.textType == 5
+            ? '时间'
+            : row.itemVO.textType == 6
+            ? '范围'
+            : ''
+        }}
+      </template>
 
-    </div>
-  </template>
-  
-  <script>
+      <template v-slot:type="{ row }">
+        {{ getDictValue('质检标准类型', row.itemVO.type) }}
+      </template>
 
+      <template v-slot:toolList="{ row }">
+        <div
+          style="display: inline-block"
+          v-for="(item, idx) in row.itemVO.toolList"
+          :key="idx"
+          >{{ item.name }}
+          <span
+            v-if="row.itemVO.toolList && idx != row.itemVO.toolList.length - 1"
+            >,
+          </span></div
+        >
+      </template>
+
+      <template v-slot:action="{ row }">
+        <el-popconfirm
+          class="ele-action"
+          title="确定要删除此质检项吗?"
+          @confirm="remove(row)"
+        >
+          <template v-slot:reference>
+            <el-link type="danger" :underline="false" icon="el-icon-delete">
+              删除
+            </el-link>
+          </template>
+        </el-popconfirm>
+      </template>
+    </ele-pro-table>
+  </div>
+</template>
+
+<script>
   export default {
-    components: {  },
-    props: {
+    components: {},
+    props: {},
 
-    },
-  
     data() {
       return {
-        listPage: []
+        columns: [
+          {
+            prop: 'itemVO.inspectionCode',
+            label: '参数编码',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'itemVO.inspectionName',
+            label: '参数名称',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            prop: 'itemVO.textType',
+            label: '参数类型',
+            showOverflowTooltip: true,
+            align: 'center',
+            slot: 'textType',
+            minWidth: 110
+          },
+
+          {
+            prop: 'itemVO.maxValue',
+            label: '参数上限',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'itemVO.minValue',
+            label: '参数下限',
+            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.type',
+            slot: 'type'
+          },
+
+          {
+            prop: 'itemVO.qualityStandardName',
+            label: '标准名称',
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            label: '状态',
+            prop: 'status',
+            formatter: (row, column, cellValue) => {
+              return cellValue == 1 ? '启用' : cellValue === 0 ? '停用' : '';
+            }
+          },
+
+          {
+            prop: 'itemVO.toolList',
+            slot: 'toolList',
+            label: '设备名称',
+            align: 'center',
+            minWidth: 150
+          },
+
+          {
+            label: '备注',
+            prop: 'inspectionRemark'
+          },
+          {
+            label: '操作',
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ]
       };
     },
-  
-    created() {
 
-    },
+    created() {},
     methods: {
-
+      datasource() {
+        return [];
+      },
+      openAdd() {
+        this.$emit('openAdd');
+      }
     }
   };
-  </script>
-  
-  <style lang="scss" scoped>
+</script>
 
-  </style>
-  
+<style lang="scss" scoped></style>