Browse Source

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

wuzh 7 hours ago
parent
commit
e6a427dc8d

+ 3 - 18
src/components/select/organization/components/org-user-edit.vue

@@ -31,20 +31,13 @@
             </el-select>
           </el-form-item>
           <el-form-item label="员工状态:" prop="status">
-            <el-select
+            <DictSelection
+              dictName="员工状态"
               clearable
               class="ele-block"
               v-model="form.status"
               placeholder="请选择员工状态"
-            >
-              <el-option
-                v-for="item in statusOptions"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
+            ></DictSelection>
           </el-form-item>
           <el-form-item label="籍贯:" prop="city">
             <regions-select
@@ -259,14 +252,6 @@
         // 是否是修改
         isUpdate: false,
         city: '',
-        statusOptions: [
-          { value: 1, label: '全职' },
-          { value: 2, label: '兼职' },
-          { value: 3, label: '实习' },
-          { value: 4, label: '正式' },
-          { value: 5, label: '试用' },
-          { value: 6, label: '离职' }
-        ],
         accountList: []
       };
     },

+ 4 - 2
src/enum/dict.js

@@ -89,7 +89,8 @@ export default {
   实验模板样式: 'experiment_template_style',
   表计类型: 'meter_type',
   印章类型: 'main_seal_type',
-  支付类型: 'payment_type'
+  支付类型: 'payment_type',
+  员工状态: 'hr_user_status'
 };
 
 export const numberList = [
@@ -105,7 +106,8 @@ export const numberList = [
   'id_type',
   'rule_status',
   'ledger',
-  'purchase_origin'
+  'purchase_origin',
+  'hr_user_status'
 ];
 //审核状态
 export const reviewStatus = {

+ 11 - 11
src/views/material/BOMmanage/components/detailedList.vue

@@ -501,17 +501,17 @@
             showOverflowTooltip: true,
             width: 100
           },
-          {
-            // 序号:普通列 + 前端插槽渲染行号(见模板 v-slot:rowIndex),不绑定 sn;
-            // 也不能用 type: 'index':index 列不在列设置缓存里,会被 ele-pro-table 排到最前面。
-            prop: 'rowIndex',
-            columnKey: 'rowIndex',
-            label: '序号',
-            align: 'center',
-            width: 90,
-            showOverflowTooltip: true,
-            slot: 'rowIndex'
-          },
+          // {
+          //   // 序号:普通列 + 前端插槽渲染行号(见模板 v-slot:rowIndex),不绑定 sn;
+          //   // 也不能用 type: 'index':index 列不在列设置缓存里,会被 ele-pro-table 排到最前面。
+          //   prop: 'rowIndex',
+          //   columnKey: 'rowIndex',
+          //   label: '序号',
+          //   align: 'center',
+          //   width: 90,
+          //   showOverflowTooltip: true,
+          //   slot: 'rowIndex'
+          // },
           {
             prop: 'categoryCode',
             label: '物料编码',

+ 59 - 3
src/views/material/BOMmanage/detailsPop.vue

@@ -440,6 +440,7 @@
     deviceBomSubmit,
     hasNewVersion
   } from '@/api/material/BOM.js';
+  import { parameterGetByCode } from '@/api/system/dictionary-data';
 
   import baseInfo from './components/baseInfo.vue';
   import baseInfoSave from './components/baseInfoSave.vue';
@@ -691,12 +692,17 @@
           this.treeLoading = false;
           if (res?.code === '0') {
             if (res.data?.length > 0) {
-              this.treeList = res.data;
+              let treeData = res.data;
+              // 润天:左侧树同级节点按 sn 升序(与右侧 PBOM 明细同一口径);非润天(无 sn)保持原顺序
+              if (this.treeHasSn(treeData) || (await this.isRuntianEnv())) {
+                treeData = this.sortTreeBySn(treeData);
+              }
+              this.treeList = treeData;
               this.$nextTick(() => {
                 this.isNotData = true;
                 // 默认高亮第一个
-                this.$refs.treeRef.setCurrentKey(res.data[0].id);
-                this.handleNodeClick(res.data[0]);
+                this.$refs.treeRef.setCurrentKey(treeData[0].id);
+                this.handleNodeClick(treeData[0]);
               });
             } else {
               this.isNotData = false;
@@ -710,6 +716,56 @@
         this.treeLoading = false;
       },
 
+      // 树里是否带 sn(润天同步的 BOM 才有)
+      treeHasSn(nodes) {
+        return (nodes || []).some(
+          (node) =>
+            (node.sn !== null && node.sn !== undefined && Number(node.sn) > 0) ||
+            this.treeHasSn(node.children)
+        );
+      },
+
+      // 是否润天环境(系统参数 is_runtian)
+      async isRuntianEnv() {
+        try {
+          const data = await parameterGetByCode({ code: 'is_runtian' });
+          const val =
+            typeof data === 'object' && data !== null
+              ? data.value ?? data.paramValue ?? data.val
+              : data;
+          return val === '1' || val === 1 || val === true;
+        } catch (e) {
+          return false;
+        }
+      },
+
+      // 递归按 sn 升序(空/0 排最后,同 sn 按 id 兜底)
+      sortTreeBySn(nodes) {
+        if (!Array.isArray(nodes) || !nodes.length) {
+          return nodes;
+        }
+        const snOf = (node) => {
+          const sn = Number(node && node.sn);
+          return isNaN(sn) || sn <= 0 ? Number.MAX_SAFE_INTEGER : sn;
+        };
+        const sortRecursive = (list) => {
+          list.sort((a, b) => {
+            const diff = snOf(a) - snOf(b);
+            if (diff !== 0) {
+              return diff;
+            }
+            return String(a.id) < String(b.id) ? -1 : String(a.id) > String(b.id) ? 1 : 0;
+          });
+          list.forEach((item) => {
+            if (Array.isArray(item.children) && item.children.length) {
+              sortRecursive(item.children);
+            }
+          });
+        };
+        sortRecursive(nodes);
+        return nodes;
+      },
+
       handleNodeClick(data) {
         this.treeId = data.id;
         this.resourceBomId =

+ 1 - 0
src/views/rulesManagement/releaseRules/components/permitAdd.vue

@@ -973,6 +973,7 @@
           list = list.filter((i) => i.prop != 'formula');
         }
 
+        // 只有生产管控类才显示设备信息
         if (this.formData.reportWorkType != 5) {
           list = list.filter(
             (i) => !['substanceName', 'substanceCode'].includes(i.prop)

File diff suppressed because it is too large
+ 325 - 360
src/views/system/organization/components/org-user-edit.vue


+ 9 - 11
src/views/system/organization/components/org-user-list.vue

@@ -251,6 +251,7 @@
     },
     created() {
       this.requestDict('岗位');
+      this.requestDict('员工状态');
       getFactoryarea({
         pageNum: 1,
         size: 999,
@@ -289,7 +290,7 @@
           },
           {
             prop: 'groupName',
-            label: '所属机构',
+            label: '主所属部门',
             showOverflowTooltip: true,
             minWidth: 110
           },
@@ -355,10 +356,10 @@
             sortable: 'custom',
             width: 80,
             formatter: (_row, _column, cellValue) => {
-              const dom = this.statusOptions.find((item) => {
+              const dom = this.statusList.find((item) => {
                 return item.value == cellValue;
               });
-              return dom ? dom.label : '';
+              return dom ? dom.label : _row.statusName || '';
             }
           },
           {
@@ -405,6 +406,11 @@
             showOverflowTooltip: true
           }
         ];
+      },
+      // 员工状态字典(hr_user_status)
+      statusList() {
+        const list = this.getDictListByName('员工状态');
+        return Array.isArray(list) ? list : [];
       }
     },
     data() {
@@ -485,14 +491,6 @@
         current: null,
         // 是否显示编辑弹窗
         showEdit: false,
-        statusOptions: [
-          { value: 1, label: '全职' },
-          { value: 2, label: '兼职' },
-          { value: 3, label: '实习' },
-          { value: 4, label: '正式' },
-          { value: 5, label: '试用' },
-          { value: 6, label: '离职' }
-        ],
         pageSize: this.$store.state.tablePageSize,
         cacheKeyUrl: 'ef00833a-system-organization',
         selection: []

+ 2 - 9
src/views/system/organization/components/org-user-search.vue

@@ -46,15 +46,8 @@
           {
             label: '状态:',
             value: 'status',
-            type: 'select',
-            planList: [
-              { value: 1, label: '全职' },
-              { value: 2, label: '兼职' },
-              { value: 3, label: '实习' },
-              { value: 4, label: '正式' },
-              { value: 5, label: '试用' },
-              { value: 6, label: '离职' }
-            ],
+            type: 'DictSelection',
+            dictName: '员工状态',
             placeholder: '请选择'
           }
         ];

Some files were not shown because too many files changed in this diff