Procházet zdrojové kódy

SAI类别下拉框

wangggziwen před 2 roky
rodič
revize
7db9ed8c79

+ 0 - 2
master/src/main/resources/mybatis/production/TSaiCategoryMapper.xml

@@ -28,8 +28,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null "> and dept_id = #{deptId}</if>
             and d.del_flag = 0
         </where>
-        <!-- 数据范围过滤 -->
-        ${params.dataScope}
     </select>
     
     <select id="selectTSaiCategoryById" parameterType="Long" resultMap="TSaiCategoryResult">

+ 9 - 1
ui/src/api/production/category.js

@@ -1,5 +1,13 @@
 import request from '@/utils/request'
 
+// 查询SAI类别列表
+export function categoryList() {
+  return request({
+    url: '/production/category/categoryList',
+    method: 'get'
+  })
+}
+
 // 查询SAI类别列表
 export function listCategory(query) {
   return request({
@@ -50,4 +58,4 @@ export function exportCategory(query) {
     method: 'get',
     params: query
   })
-}
+}

+ 36 - 1
ui/src/views/approve/approveDetail/sai-apply-detail.vue

@@ -71,7 +71,19 @@
           </el-descriptions-item>
           <el-descriptions-item label="SAI类别" :span="2">
             <el-form-item prop="category">
-              <el-input v-model="dataForm.category" placeholder="请输入SAI类别" :disabled="applyDisabled"/>
+              <el-select
+                filterable
+                clearable
+                v-model="dataForm.category"
+                placeholder="请选择SAI类别"
+                :disabled="applyDisabled">
+                <el-option
+                  v-for="dict in saiCategoryOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                ></el-option>
+              </el-select>
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item label="附件" :span="3">
@@ -483,6 +495,7 @@ import { listUserPost } from "@/api/system/user";
 import { treeselect, listDept } from "@/api/system/dept";
 import { listSaiInspectors, listSaiExecutors, listStaffmgrByDeptAndTeam, getLoginStaffInfo } from "@/api/plant/staffmgr";
 import { allFileList, delCommonfile } from "@/api/common/commonfile";
+import { categoryList } from "@/api/production/category";
 
 export default {
   name: "sai-apply-detail",
@@ -524,6 +537,8 @@ export default {
       }
     };
     return {
+      // SAI类别列表
+      saiCategoryOptions: [],
       // 当前登录员工
       loginStaffInfo: {},
       //图片集合   打开关闭按钮 等等
@@ -755,6 +770,9 @@ export default {
           this.unsafeChoice = '2';
           this.dataForm.unsafeAction = this.dataForm.unsafeAction.toString();
         }
+        if (this.dataForm.category != null && this.dataForm.category != "") {
+          this.dataForm.category = Number(this.dataForm.category);
+        }
         if (this.dataForm.veResult == null) {
           this.dataForm.veResult = '1';
         }
@@ -842,6 +860,22 @@ export default {
       });
       // 加载当前登录员工信息
       this.getLoginStaffInfo();
+      // 加载SAI类别字典
+      this.getCategoryList();
+    },
+    /** 获取SAI类别列表数据 */
+    getCategoryList() {
+      categoryList().then(response => {
+        let data = response.data;
+        for (let i = 0; i < data.length; i++) {
+          if (data[i].saiCategoryName != null && data[i].saiCategoryName != "") {
+            this.saiCategoryOptions.push({
+              dictLabel: data[i].saiCategoryName,
+              dictValue: data[i].saiCategoryId
+            });
+          }
+        }
+      });
     },
     /** 加载当前登录员工信息 */
     getLoginStaffInfo() {
@@ -1101,6 +1135,7 @@ export default {
       //     }
       //   }
       // });
+      this.applicantDeptOptions = [];
       this.applicantDeptOptions.push({ dictLabel: "CBP/C", dictValue: '10' });
       this.applicantDeptOptions.push({ dictLabel: "CTA/B", dictValue: '12' });
       this.applicantDeptOptions.push({ dictLabel: "CTM/B", dictValue: '14' });

+ 37 - 1
ui/src/views/production/apply/all/index.vue

@@ -323,7 +323,18 @@
           </el-descriptions-item>
           <el-descriptions-item label="SAI类别" :span="2">
             <el-form-item prop="category">
-              <el-input v-model="form.category" placeholder="请输入SAI类别" />
+              <el-select
+                filterable
+                clearable
+                v-model="form.category"
+                placeholder="请选择SAI类别">
+                <el-option
+                  v-for="dict in saiCategoryOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                ></el-option>
+              </el-select>
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item label="隐患" :span="3">
@@ -591,6 +602,7 @@ import SaiApplyDetail from "@/views/approve/approveDetail/sai-apply-detail";
 import ProcessImg from '@/views/approve/processImg/index';
 import { listStaffmgrByDeptAndTeam, getLoginStaffInfo } from "@/api/plant/staffmgr";
 import { allFileList, delCommonfile } from "@/api/common/commonfile";
+import { categoryList } from "@/api/production/category";
 
 export default {
   name: "Apply",
@@ -641,6 +653,8 @@ export default {
       }
     };
     return {
+      // SAI类别列表
+      saiCategoryOptions: [],
       fileList: [],
       // 统计至SAI检查台账的数据
       saiList: [],
@@ -865,8 +879,27 @@ export default {
     });
     // 加载当前登录员工信息
     this.getLoginStaffInfo();
+    this.getCategoryList();
   },
   methods: {
+    // SAI类别字典翻译
+    saiCategoryFormat(row, column) {
+      return this.selectDictLabel(this.saiCategoryOptions, row.category);
+    },
+    /** 获取SAI类别列表数据 */
+    getCategoryList() {
+      categoryList().then(response => {
+        let data = response.data;
+        for (let i = 0; i < data.length; i++) {
+          if (data[i].saiCategoryName != null && data[i].saiCategoryName != "") {
+            this.saiCategoryOptions.push({
+              dictLabel: data[i].saiCategoryName,
+              dictValue: data[i].saiCategoryId
+            });
+          }
+        }
+      });
+    },
     /** 是否录入开项系统单选按钮值改变事件 */
     handleIsRecordedChange() {
       if (this.delayForm.isRecorded == '1') {
@@ -1286,6 +1319,9 @@ export default {
         if (this.form.unsafeAction != null && this.form.unsafeAction != "") {
           this.form.unsafeAction = this.form.unsafeAction.toString();
         }
+        if (this.form.category != null && this.form.category != "") {
+          this.form.category = Number(this.form.category);
+        }
         this.fileList = [];
         if (this.form.files.length > 0) {
           console.log(this.form.files);

+ 37 - 1
ui/src/views/production/apply/mine/index.vue

@@ -323,7 +323,18 @@
           </el-descriptions-item>
           <el-descriptions-item label="SAI类别" :span="2">
             <el-form-item prop="category">
-              <el-input v-model="form.category" placeholder="请输入SAI类别" />
+              <el-select
+                filterable
+                clearable
+                v-model="form.category"
+                placeholder="请选择SAI类别">
+                <el-option
+                  v-for="dict in saiCategoryOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                ></el-option>
+              </el-select>
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item label="隐患" :span="3">
@@ -591,6 +602,7 @@
   import ProcessImg from '@/views/approve/processImg/index';
   import { listStaffmgrByDeptAndTeam, getLoginStaffInfo } from "@/api/plant/staffmgr";
   import { allFileList, delCommonfile } from "@/api/common/commonfile";
+  import { categoryList } from "@/api/production/category";
 
   export default {
     name: "Apply",
@@ -641,6 +653,8 @@
         }
       };
       return {
+        // SAI类别列表
+        saiCategoryOptions: [],
         fileList: [],
         // 统计至SAI检查台账的数据
         saiList: [],
@@ -865,8 +879,27 @@
       });
       // 加载当前登录员工信息
       this.getLoginStaffInfo();
+      this.getCategoryList();
     },
     methods: {
+      // SAI类别字典翻译
+      saiCategoryFormat(row, column) {
+        return this.selectDictLabel(this.saiCategoryOptions, row.category);
+      },
+      /** 获取SAI类别列表数据 */
+      getCategoryList() {
+        categoryList().then(response => {
+          let data = response.data;
+          for (let i = 0; i < data.length; i++) {
+            if (data[i].saiCategoryName != null && data[i].saiCategoryName != "") {
+              this.saiCategoryOptions.push({
+                dictLabel: data[i].saiCategoryName,
+                dictValue: data[i].saiCategoryId
+              });
+            }
+          }
+        });
+      },
       /** 是否录入开项系统单选按钮值改变事件 */
       handleIsRecordedChange() {
         if (this.delayForm.isRecorded == '1') {
@@ -1302,6 +1335,9 @@
           if (this.form.unsafeAction != null && this.form.unsafeAction != "") {
             this.form.unsafeAction = this.form.unsafeAction.toString();
           }
+          if (this.form.category != null && this.form.category != "") {
+            this.form.category = Number(this.form.category);
+          }
           this.fileList = [];
           if (this.form.files.length > 0) {
             console.log(this.form.files);

+ 37 - 1
ui/src/views/production/apply/pending/index.vue

@@ -323,7 +323,18 @@
           </el-descriptions-item>
           <el-descriptions-item label="SAI类别" :span="2">
             <el-form-item prop="category">
-              <el-input v-model="form.category" placeholder="请输入SAI类别" />
+              <el-select
+                filterable
+                clearable
+                v-model="form.category"
+                placeholder="请选择SAI类别">
+                <el-option
+                  v-for="dict in saiCategoryOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                ></el-option>
+              </el-select>
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item label="隐患" :span="3">
@@ -591,6 +602,7 @@
   import ProcessImg from '@/views/approve/processImg/index';
   import { listStaffmgrByDeptAndTeam, getLoginStaffInfo } from "@/api/plant/staffmgr";
   import { allFileList, delCommonfile } from "@/api/common/commonfile";
+  import { categoryList } from "@/api/production/category";
 
   export default {
     name: "Apply",
@@ -641,6 +653,8 @@
         }
       };
       return {
+        // SAI类别列表
+        saiCategoryOptions: [],
         fileList: [],
         // 统计至SAI检查台账的数据
         saiList: [],
@@ -865,8 +879,27 @@
       });
       // 加载当前登录员工信息
       this.getLoginStaffInfo();
+      this.getCategoryList();
     },
     methods: {
+      // SAI类别字典翻译
+      saiCategoryFormat(row, column) {
+        return this.selectDictLabel(this.saiCategoryOptions, row.category);
+      },
+      /** 获取SAI类别列表数据 */
+      getCategoryList() {
+        categoryList().then(response => {
+          let data = response.data;
+          for (let i = 0; i < data.length; i++) {
+            if (data[i].saiCategoryName != null && data[i].saiCategoryName != "") {
+              this.saiCategoryOptions.push({
+                dictLabel: data[i].saiCategoryName,
+                dictValue: data[i].saiCategoryId
+              });
+            }
+          }
+        });
+      },
       /** 是否录入开项系统单选按钮值改变事件 */
       handleIsRecordedChange() {
         if (this.delayForm.isRecorded == '1') {
@@ -1299,6 +1332,9 @@
           if (this.form.unsafeAction != null && this.form.unsafeAction != "") {
             this.form.unsafeAction = this.form.unsafeAction.toString();
           }
+          if (this.form.category != null && this.form.category != "") {
+            this.form.category = Number(this.form.category);
+          }
           this.fileList = [];
           if (this.form.files.length > 0) {
             console.log(this.form.files);

+ 36 - 3
ui/src/views/production/check/index.vue

@@ -93,7 +93,7 @@
       </el-table-column>
       <el-table-column label="识别出的安全问题" align="center" prop="dificiency" :show-overflow-tooltip="true"/>
       <el-table-column label="SAI级别" align="center" prop="saiLevel" :show-overflow-tooltip="true"/>
-      <el-table-column label="SAI类别" align="center" prop="category" :show-overflow-tooltip="true"/>
+      <el-table-column label="SAI类别" align="center" prop="category" :show-overflow-tooltip="true" :formatter="saiCategoryFormat"/>
       <el-table-column label="采取或要采取的措施" align="center" prop="actions" :show-overflow-tooltip="true"/>
       <el-table-column label="用户" align="center" prop="userDeptName" :show-overflow-tooltip="true"/>
       <el-table-column label="数据来源" align="center" prop="source" :show-overflow-tooltip="true"/>
@@ -150,8 +150,19 @@
             <el-option key="3" label="3" value="3"></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="SAI类别" prop="category">
-          <el-input v-model="form.category" placeholder="请输入SAI类别" />
+        <el-form-item :label="$t('SAI类别')" prop="category">
+          <el-select
+            filterable
+            clearable
+            v-model="form.category"
+            placeholder="请选择SAI类别">
+            <el-option
+              v-for="dict in saiCategoryOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            ></el-option>
+          </el-select>
         </el-form-item>
         <el-form-item label="采取或要采取的措施" prop="actions">
           <el-input v-model="form.actions" placeholder="请输入采取或要采取的措施" />
@@ -233,12 +244,15 @@ import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import { listStaffmgrByDeptAndTeam, getLoginStaffInfo } from "@/api/plant/staffmgr";
+import { categoryList } from "@/api/production/category";
 
 export default {
   name: "Sai",
   components: { Treeselect },
   data() {
     return {
+      // SAI类别列表
+      saiCategoryOptions: [],
       // 登记人列表
       applicantOptions: [],
       score: null,
@@ -351,8 +365,27 @@ export default {
     this.calcScore2ByYear();
     this.getTreeselect();
     this.listStaffmgrByDeptAndTeam(null, null);
+    this.getCategoryList();
   },
   methods: {
+    // SAI类别字典翻译
+    saiCategoryFormat(row, column) {
+      return this.selectDictLabel(this.saiCategoryOptions, row.category);
+    },
+    /** 获取SAI类别列表数据 */
+    getCategoryList() {
+      categoryList().then(response => {
+        let data = response.data;
+        for (let i = 0; i < data.length; i++) {
+          if (data[i].saiCategoryName != null && data[i].saiCategoryName != "") {
+            this.saiCategoryOptions.push({
+              dictLabel: data[i].saiCategoryName,
+              dictValue: data[i].saiCategoryId
+            });
+          }
+        }
+      });
+    },
     /** 加载当前登录员工信息 */
     getLoginStaffInfo() {
       getLoginStaffInfo().then(response => {