Pārlūkot izejas kodu

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

liujt 9 mēneši atpakaļ
vecāks
revīzija
ae5cb4e123

+ 22 - 8
src/components/processSubmitDialog/processSubmitDialog.vue

@@ -97,7 +97,13 @@
           min-width="140px"
         >
           <template v-slot="scope">
-            <div v-if="scope.row.type !== 60 &&scope.row.type !== 70 && scope.row.options.length > 0">
+            <div
+              v-if="
+                scope.row.type !== 60 &&
+                scope.row.type !== 70 &&
+                scope.row.options.length > 0
+              "
+            >
               <el-tag
                 size="medium"
                 :key="option"
@@ -107,7 +113,14 @@
               </el-tag>
             </div>
 
-            <el-tag size="medium" v-if="scope.row.type === 60|| scope.row.type ===70">
+            <el-tag
+              size="medium"
+              v-if="
+                scope.row.type === 60 ||
+                scope.row.type === 70 ||
+                scope.row.type === 80
+              "
+            >
               {{ getAssignRuleOptionName(scope.row) }}
             </el-tag>
           </template>
@@ -184,7 +197,7 @@
   import { listOrganizations } from '@/api/system/organization';
   import dictMixins from '@/mixins/dictMixins';
   import { getByCode } from '@/api/system/dictionary-data';
-  import { topLevel1, topLevel2 } from '@/enum/dict';
+  import { topLevel1, topLevel2, topLevel3 } from '@/enum/dict';
 
   export default {
     name: 'processSubmitDialog',
@@ -372,15 +385,16 @@
           );
         } else if (row.type === 60) {
           return row.variableName;
-        }else if (row.type === 70) {
+        } else if (row.type === 70) {
           let data = JSON.parse(row.variableName);
           if (data.direction == 1) {
-            return topLevel2.find((item) => item.value == data.topLevel)
-              ?.label;
+            return topLevel2.find((item) => item.value == data.topLevel)?.label;
           } else {
-            return topLevel1.find((item) => item.value == data.topLevel)
-              ?.label;
+            return topLevel1.find((item) => item.value == data.topLevel)?.label;
           }
+        } else if (row.type === 80) {
+          let data = JSON.parse(row.variableName);
+          return topLevel3.find((item) => item.value == data.topLevel)?.label;
         }
         return '未知(' + option + ')';
       },

+ 38 - 1
src/enum/dict.js

@@ -307,7 +307,44 @@ export const businessModule = [
     value: 'datascreen_'
   }
 ];
-
+export const topLevel3 = [
+  {
+    label: '上级部门负责人',
+    value: '1'
+  },
+  {
+    label: '上二级部门负责人',
+    value: '2'
+  },
+  {
+    label: '上三级部门负责人',
+    value: '3'
+  },
+  {
+    label: '上四级部门负责人',
+    value: '4'
+  },
+  {
+    label: '上五级部门负责人',
+    value: '5'
+  },
+  {
+    label: '上六级部门负责人',
+    value: '6'
+  },
+  {
+    label: '上七级部门负责人',
+    value: '7'
+  },
+  {
+    label: '上八级部门负责人',
+    value: '8'
+  },
+  {
+    label: '上九级部门负责人',
+    value: '9'
+  }
+];
 export const topLevel1 = [
   {
     label: '直接部门负责人',

+ 39 - 7
src/views/bpm/taskAssignRule/taskAssignRuleDialog.vue

@@ -47,7 +47,14 @@
             >
               {{ getAssignRuleOptionName(scope.row, option) }}
             </el-tag>
-            <el-tag size="medium" v-if="scope.row.type === 60">
+            <el-tag
+              size="medium"
+              v-if="
+                scope.row.type === 60 ||
+                scope.row.type === 70 ||
+                scope.row.type === 80
+              "
+            >
               {{ getAssignRuleOptionName(scope.row) }}
             </el-tag>
           </template>
@@ -242,7 +249,6 @@
           >
             <el-option
               v-for="(item, index) in topLevel1"
-
               :key="index"
               :label="item.label"
               :value="item.value"
@@ -274,6 +280,20 @@
           >
           </el-input>
         </el-form-item>
+        <el-form-item
+          v-if="form.typeS === 80 && title != '修改抄送规则'"
+          label="指定部门负责人"
+          prop="topLevel"
+        >
+          <el-select v-model="form.topLevel" clearable style="width: 100%">
+            <el-option
+              v-for="(item, index) in topLevel3"
+              :key="index"
+              :label="item.label"
+              :value="item.value"
+            />
+          </el-select>
+        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button
@@ -309,7 +329,7 @@
   } from '@/api/system/organization';
   // import {listSimplePosts} from "@/api/system/post";
   import { listSimpleUserGroups } from '@/api/bpm/userGroup';
-  import { topLevel1, topLevel2 } from '@/enum/dict';
+  import { topLevel1, topLevel2, topLevel3 } from '@/enum/dict';
 
   import treeSelect from '@riophae/vue-treeselect';
   import '@riophae/vue-treeselect/dist/vue-treeselect.css';
@@ -330,7 +350,9 @@
       };
 
       return {
-        topLevel1,topLevel2,
+        topLevel1,
+        topLevel2,
+        topLevel3,
         // 如下参数,可传递
         modelId: undefined, // 流程模型的编号。如果 modelId 非空,则用于流程模型的查看与配置
         processDefinitionId: undefined, // 流程定义的编号。如果 processDefinitionId 非空,则用于流程定义的查看,不支持配置
@@ -578,8 +600,8 @@
           this.form.userGroupIds.push(...row.options);
         } else if (row.type === 50) {
           this.form.scripts.push(...row.options);
-        } else if (row.type === 70) {
-          let res = JSON.parse(row.variableName);
+        } else if (row.type === 70 || row.type === 80) {
+          let res = row.variableName ? JSON.parse(row.variableName) : {};
           this.$set(this.form, 'direction', res.direction);
           this.$set(this.form, 'topLevel', res.topLevel);
         }
@@ -612,7 +634,7 @@
               form.options = form.userGroupIds;
             } else if (form.type === 50) {
               form.options = form.scripts;
-            } else if (form.type === 70) {
+            } else if (form.type === 70 || form.type === 80) {
               form.variableName = JSON.stringify({
                 direction: form.direction,
                 topLevel: form.topLevel
@@ -759,6 +781,16 @@
           }
         } else if (row.type === 60) {
           return row.variableName;
+        } else if (row.type === 70) {
+          let data = JSON.parse(row.variableName);
+          if (data.direction == 1) {
+            return topLevel2.find((item) => item.value == data.topLevel)?.label;
+          } else {
+            return topLevel1.find((item) => item.value == data.topLevel)?.label;
+          }
+        } else if (row.type === 80) {
+          let data = JSON.parse(row.variableName);
+          return topLevel3.find((item) => item.value == data.topLevel)?.label;
         }
         return '未知(' + option + ')';
       },

+ 30 - 30
src/views/factoryModel/jobManagement/components/aptitudeDialog.vue

@@ -6,7 +6,7 @@
       append-to-body
       :close-on-click-modal="false"
       custom-class="ele-dialog-form"
-      title="资质列表"
+      title="选择工种"
       @update:visible="updateVisible"
       :maxable="true"
     >
@@ -15,12 +15,9 @@
           ref="table"
           :initLoad="false"
           :columns="columns"
-          :current.sync="current"
-          highlight-current-row
+          :selection.sync="selection"
           :datasource="datasource"
           tool-class="ele-toolbar-form"
-          cache-key="systemOrgUserTable"
-          @selection-change="handleSelectionChange"
         >
         </ele-pro-table>
       </div>
@@ -34,12 +31,19 @@
 
 <script>
   import dictMixins from '@/mixins/dictMixins';
-  import { getProfessionCertificationPageList } from '@/api/factoryModel';
+  import { getProfessionPageList } from '@/api/factoryModel';
   export default {
     mixins: [dictMixins],
+    props: {
+      disabledIds: {
+        default: () => {
+          return [];
+        }
+      }
+    },
     data() {
       return {
-        multipleSelection: [],
+        selection: [],
         visible: false,
         levelOptions: [
           {
@@ -63,7 +67,10 @@
             type: 'selection',
             width: 45,
             align: 'center',
-            fixed: 'left'
+            fixed: 'left',
+            selectable:(row)=>{
+              return !this.disabledIds.includes(row.id);
+            }
           },
           {
             label: '序号',
@@ -106,29 +113,21 @@
             formatter: (_row) => {
               return this.levelOptions.filter(
                 (item) => _row.level == item.value
-              )[0].label;
+              )[0]?.label;
             }
           },
           {
-            slot: 'startTime',
-            prop: 'startTime',
-            label: '有效开始时间',
-            showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 110
-          },
-          {
-            slot: 'endTime',
-            prop: 'endTime',
-            label: '有效结束时间',
+            slot: 'hourCost',
+            prop: 'hourCost',
+            label: '标准工时费',
             showOverflowTooltip: true,
             align: 'center',
             minWidth: 110
           },
           {
-            slot: 'accessory.name',
-            prop: 'accessory.name',
-            label: '附件',
+            slot: 'unit',
+            prop: 'unit',
+            label: '工时费单位',
             showOverflowTooltip: true,
             align: 'center',
             minWidth: 110
@@ -136,24 +135,25 @@
         ]
       };
     },
+    created() {
+      this.requestDict('工种类型');
+    },
     methods: {
       updateVisible(value) {
         this.visible = value;
         this.$emit('update:visible', value);
       },
-      handleSelectionChange(val) {
-        this.multipleSelection = val;
-      },
+
       async handleMine() {
-        if (this.multipleSelection?.length <= 0) {
-          this.$message.warning('请至少选择一个资质!');
+        if (this.selection?.length <= 0) {
+          this.$message.warning('请至少选择一条数据!');
           return;
         }
-        this.$emit('success', this.multipleSelection);
+        this.$emit('success', this.selection);
         this.updateVisible(false);
       },
       async datasource({ page, limit, where, order }) {
-        const res = await getProfessionCertificationPageList({
+        const res = await getProfessionPageList({
           ...where,
           ...order,
           pageNum: page,

+ 164 - 163
src/views/factoryModel/station/index.vue

@@ -38,7 +38,6 @@
           </div>
         </template>
 
-
         <template v-slot:enabled="{ row }">
           {{ dict.enabled[row.enabled] }}
         </template>
@@ -77,181 +76,183 @@
         </template>
       </ele-pro-table>
     </el-card>
-    <edit
-      ref="edit"
-      @done="done"
-
-    ></edit>
+    <edit ref="edit" @done="done"></edit>
   </div>
 </template>
 <script>
-import tabMixins from '@/mixins/tableColumnsMixin';
-import search from './components/search.vue';
-import edit from './components/edit.vue';
-import {
-  deleteFactoryworkstation,
-  getFactoryworkstation,
-  getFactoryarea
-} from '@/api/factoryModel';
-import { listOrganizations } from '@/api/system/organization';
-export default {
-  mixins: [tabMixins],
-  components: {
-    search,
-    edit
-  },
-    data () {
-    return {
-      columns: [
-        {
-          width: 45,
-          type: 'index',
-          columnKey: 'index',
-          align: 'center'
-        },
-        {
-          prop: 'code',
-          label: '工位编码'
-        },
-        {
-          label: '工位名称',
-          prop: 'name'
-        },
-        {
-          label: '责任人',
-          prop: 'leaderName',
-          slot: 'factory'
-        },
-        {
-          label: '所属区域',
-            prop: 'areaName',
-        },
-
-        {
-          label: '所属工厂',
-            prop: 'factoryName',
-
-        },
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  import search from './components/search.vue';
+  import edit from './components/edit.vue';
+  import {
+    deleteFactoryworkstation,
+    getFactoryworkstation,
+    getFactoryarea
+  } from '@/api/factoryModel';
+  import { listOrganizations } from '@/api/system/organization';
+  export default {
+    mixins: [tabMixins],
+    components: {
+      search,
+      edit
+    },
+    data() {
+      return {
+        columns: [
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center'
+          },
+          {
+            prop: 'code',
+            label: '工位编码'
+          },
+          {
+            label: '工位名称',
+            prop: 'name'
+          },
+          {
+            label: '责任人',
+            prop: 'leaderName',
+            slot: 'factory'
+          },
+          {
+            label: '所属区域',
+            prop: 'areaName'
+          },
 
-        {
-          label: '所属厂房',
-            prop: 'workshopPlanName',
+          {
+            label: '所属工厂',
+            prop: 'factoryName'
+          },
 
-        },
-        {
-          label: '所属车间',
-          prop: 'workshopName'
-        },
-        {
-          label: '所属产线',
-          prop: 'productionLineName'
-        },
-        {
-          label: '节拍时间',
-          prop: 'extInfo.meterTime',
-          slot: 'meterTime'
-        },
-        {//修改此prop名称时,请同步修改columnKey属性和下方selectType方法
-          label: '状态',
-          prop: 'enabled',
-          slot: 'enabled',
-          filters: [
+          {
+            label: '所属厂房',
+            prop: 'workshopPlanName'
+          },
+          {
+            label: '所属车间',
+            prop: 'workshopName'
+          },
+          {
+            label: '所属产线',
+            prop: 'productionLineName'
+          },
+          {
+            label: '设备名称',
+            prop: 'extInfo.assetName',
+            formatter: (_row, _column, cellValue) => {
+              return typeof cellValue === 'string' ? cellValue :'';
+            }
+          },
+          {
+            label: '节拍时间',
+            prop: 'extInfo.meterTime',
+            slot: 'meterTime'
+          },
+          {
+            //修改此prop名称时,请同步修改columnKey属性和下方selectType方法
+            label: '状态',
+            prop: 'enabled',
+            slot: 'enabled',
+            filters: [
               { value: 1, text: '生效' },
-              { value: 0, text: '未生效' },
+              { value: 0, text: '未生效' }
             ],
-          filterMultiple: false,
-          columnKey: 'enabled'
+            filterMultiple: false,
+            columnKey: 'enabled'
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 220,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ],
+        dict: {
+          groupId: [],
+          factory: [],
+          enabled: {
+            1: '生效',
+            0: '未生效'
+          }
         },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 220,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ],
-      dict: {
-        groupId: [],
-        factory: [],
-        enabled: {
-          1: '生效',
-          0: '未生效'
-        }
-      },
-      pageSize: this.$store.state.tablePageSize,
-      cacheKeyUrl: 'ef00833a-factoryModel-station'
-    };
-  },
-    created () {
-    this.getGs();
-    this.getFactoryarea();
-  },
-  methods: {
+        pageSize: this.$store.state.tablePageSize,
+        cacheKeyUrl: 'ef00833a-factoryModel-station'
+      };
+    },
+    created() {
+      this.getGs();
+      this.getFactoryarea();
+    },
+    methods: {
       selectType(value) {
-        let where = {}
+        let where = {};
         if (value.enabled.length > 0) {
-          where['enable'] = value.enabled[0]
+          where['enable'] = value.enabled[0];
         }
-        this.search(where)
+        this.search(where);
+      },
+      datasource({ page, where, limit }) {
+        return getFactoryworkstation({
+          ...where,
+          pageNum: page,
+          size: limit
+        });
+      },
+      search(where) {
+        this.$refs.table.reload({
+          where: where,
+          page: 1
+        });
+      },
+      openEdit(type, row) {
+        this.$refs.edit.open(type, row);
       },
-      datasource ({ page, where, limit }) {
-      return getFactoryworkstation({
-        ...where,
-        pageNum: page,
-        size: limit
-      });
-    },
-      search (where) {
-      this.$refs.table.reload({
-        where: where,
-        page: 1
-      });
-    },
-      openEdit (type, row) {
-      this.$refs.edit.open(type, row);
-    },
 
-    // 获取公司数据
-      getGs () {
-      listOrganizations().then((list) => {
-        this.dict.groupId = JSON.parse(JSON.stringify(list));
-      });
-    },
-    // 回显车间
-      showWorkshop (row) {
-      let result = row.parent.find((n) => n.id == row.parentId);
-      if (result) {
-        return result.name;
-      } else {
-        return '';
-      }
-    },
-    // 获取工厂数据
-      getFactoryarea () {
-      let par = {
-        type: 1,
-        size: 9999,
-          type: 2,
-      };
-      getFactoryarea(par).then((res) => {
-        this.dict.factory = res.list;
-      });
-    },
-      remove (row) {
-      deleteFactoryworkstation(row.id)
-        .then((message) => {
-          this.$message.success(message);
-          this.done();
-        })
-        .catch((e) => {
-          this.$message.error(e.message);
+      // 获取公司数据
+      getGs() {
+        listOrganizations().then((list) => {
+          this.dict.groupId = JSON.parse(JSON.stringify(list));
         });
-    },
-      done () {
-      this.$refs.search.search();
+      },
+      // 回显车间
+      showWorkshop(row) {
+        let result = row.parent.find((n) => n.id == row.parentId);
+        if (result) {
+          return result.name;
+        } else {
+          return '';
+        }
+      },
+      // 获取工厂数据
+      getFactoryarea() {
+        let par = {
+          type: 1,
+          size: 9999,
+          type: 2
+        };
+        getFactoryarea(par).then((res) => {
+          this.dict.factory = res.list;
+        });
+      },
+      remove(row) {
+        deleteFactoryworkstation(row.id)
+          .then((message) => {
+            this.$message.success(message);
+            this.done();
+          })
+          .catch((e) => {
+            this.$message.error(e.message);
+          });
+      },
+      done() {
+        this.$refs.search.search();
+      }
     }
-  }
-};
+  };
 </script>

+ 24 - 63
src/views/rulesManagement/releaseRules/components/permitAdd.vue

@@ -168,7 +168,9 @@
     />
     <template v-slot:footer>
       <el-button :loading="btnLoading" @click="handleClose">取消</el-button>
-      <el-button :loading="btnLoading" type="primary" @click="confirm"> 保存 </el-button>
+      <el-button :loading="btnLoading" type="primary" @click="confirm">
+        保存
+      </el-button>
     </template>
   </ele-modal>
 </template>
@@ -179,66 +181,14 @@
   import RuleCycle from './rule-cycle.vue';
   import OperationGuideDialog from '@/views/rulesManagement/matterRules/components/operationGuideDialog.vue';
   import Details from './details.vue';
-  import { releasePermitRules,updatePermitRules } from '@/api/releasePermitRules/index';
+  import {
+    releasePermitRules,
+    updatePermitRules
+  } from '@/api/releasePermitRules/index';
   export default {
     components: { OperationGuideDialog, RuleCycle, Details },
     computed: {
       bankColumns() {
-        // return [
-        //   {
-        //     columnKey: 'index',
-        //     slot: 'index',
-        //     label: '序号',
-        //     type: 'index',
-        //     headerSlot: 'headerContacIndex',
-        //     width: 75,
-        //     align: 'center'
-        //   },
-        //   {
-        //     slot: 'record',
-        //     label: '记录类型',
-        //     prop: 'record',
-        //     minWidth: 165,
-        //     align: 'center'
-        //   },
-        //   {
-        //     slot: 'code',
-        //     label: '编码',
-        //     prop: 'code',
-        //     minWidth: 165,
-        //     align: 'center'
-        //   },
-        //   {
-        //     slot: 'inspectionName',
-        //     label: '参数名称',
-        //     prop: 'inspectionName',
-        //     minWidth: 165,
-        //     align: 'center'
-        //   },
-        //   {
-        //     slot: 'textType',
-        //     label: '参数类型',
-        //     prop: 'textType',
-        //     width: 180,
-        //     align: 'center'
-        //   },
-        //   {
-        //     slot: 'operationGuide',
-        //     label: '操作指导',
-        //     prop: 'operationGuide',
-        //     width: 400,
-        //     align: 'center'
-        //   },
-        //   {
-        //     columnKey: 'action',
-        //     label: '操作',
-        //     width: 90,
-        //     align: 'center',
-        //     resizable: false,
-        //     slot: 'action'
-        //   }
-        // ];
-
         return [
           {
             prop: 'name',
@@ -318,13 +268,16 @@
         visible: false,
         formData: {
           ruleItems: [],
+          classifyId: '',
+          code: '',
+          name: '',
           enable: true
         },
         recordSheet: [], // 记录表
         current: {},
         dataIndex: null,
         showEdit: false,
-        btnLoading:false
+        btnLoading: false
       };
     },
     mounted() {
@@ -335,6 +288,13 @@
         this.visible = true;
         this.dialogTitle = title;
         this.type = type;
+        console.log('type', type, row);
+        if (type == 'edit') {
+          this.$util.assignObject(this.formData, this.$util.deepClone(row));
+          // string 转换 number
+          this.formData.classifyId = Number(row.classifyId);
+          console.log('this.formData', this.formData);
+        }
       },
       async getByCodeData() {
         let res = await getByCode('record_sheet');
@@ -346,6 +306,7 @@
           };
         });
         this.recordSheet = list;
+        console.log('this.recordSheet', this.recordSheet);
       },
       add(row) {
         this.current = row;
@@ -380,15 +341,15 @@
       },
       handleClose() {
         this.visible = false;
-        // this.formData= {
-        //   ruleItems: [],
-        //   enable: true
-        // },
+        this.$refs['formRef'].resetFields();
+        // 清空表单数据
         this.formData = {
           ruleItems: [],
+          classifyId: '',
+          code: '',
+          name: '',
           enable: true
         };
-        this.$refs['formRef'].resetFields();
       },
       confirm() {
         if (!this.formData.cycleValue || !this.formData.cycleType) {

+ 46 - 2
src/views/rulesManagement/releaseRules/index.vue

@@ -14,7 +14,7 @@
             新建
           </el-button>
         </template>
-        <template v-slot:status="{ row }"> </template>
+        <!-- <template v-slot:status="{ row }"> </template> -->
         <template v-slot:action="{ row }">
           <el-link
             type="primary"
@@ -28,7 +28,7 @@
             type="primary"
             :underline="false"
             icon="el-icon-edit"
-            @click="addPermit('edit', row)"
+            @click="addPermit(row, 'edit', '修改记录规则')"
           >
             修改
           </el-link>
@@ -41,6 +41,8 @@
               <el-link type="danger" :underline="false" icon="el-icon-delete">
                 删除
               </el-link>
+
+
             </template>
           </el-popconfirm>
         </template>
@@ -92,6 +94,41 @@
           },
           {
             prop: 'createName',
+            label: '版本号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: '',
+            label: '来源版本',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150
+          },
+          {
+            prop: '',
+            label: '启用日期',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: '',
+            label: '停用日期',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: '',
+            label: '周期',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: '',
             label: '创建人',
             align: 'center',
             showOverflowTooltip: true,
@@ -104,6 +141,13 @@
             showOverflowTooltip: true,
             minWidth: 110
           },
+          {
+            prop: '',
+            label: '是否启用',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
           {
             prop: 'enable',
             label: '状态',

+ 156 - 8
src/views/system/organization/components/org-user-edit.vue

@@ -102,6 +102,7 @@
               clearable
               filterable
               v-model="form.postId"
+              multiple
             >
             </DictSelection>
           </el-form-item>
@@ -1058,6 +1059,33 @@
             </template>
           </ele-pro-table>
         </el-tab-pane>
+        <el-tab-pane label="工种" name="jobManagement">
+          <ele-pro-table
+            ref="table"
+            :columns="jobColumns"
+            :datasource="form.professions"
+            max-height="350px"
+            :toolkit="[]"
+            class="el-form-box"
+            :need-page="false"
+          >
+            <!-- 表头工具栏 -->
+            <template v-slot:toolbar>
+              <el-button type="primary" @click="$refs.aptitudeDialogRef.open()"
+                >添加</el-button
+              >
+            </template>
+            <template v-slot:action="{ row, $index }">
+              <el-link
+                type="danger"
+                :underline="false"
+                icon="el-icon-delete"
+                @click="deleteJob($index)"
+                >删除
+              </el-link>
+            </template>
+          </ele-pro-table>
+        </el-tab-pane>
       </el-tabs>
     </el-form>
 
@@ -1072,6 +1100,11 @@
         保存
       </el-button>
     </template>
+    <aptitudeDialog
+      ref="aptitudeDialogRef"
+      @success="chooseAptitude"
+      :disabledIds="form.professions?.map(item => item.id)"
+    ></aptitudeDialog>
   </ele-modal>
 </template>
 
@@ -1090,13 +1123,21 @@
   import WithView from '@/components/upload/WithView.vue';
   import FileUpload from '@/components/upload/fileUpload.vue';
   import dictMixins from '@/mixins/dictMixins';
-
+  import aptitudeDialog from '@/views/factoryModel/jobManagement/components/aptitudeDialog.vue';
+  import { del } from 'vue';
   // D:\中赢\kd-aiot-frontend\src\views\system\user
 
   export default {
     mixins: [dictMixins],
 
-    components: { OrgSelect, RoleSelect, RegionsSelect, WithView, FileUpload },
+    components: {
+      OrgSelect,
+      RoleSelect,
+      RegionsSelect,
+      WithView,
+      FileUpload,
+      aptitudeDialog
+    },
     props: {
       // 弹窗是否打开
       visible: Boolean,
@@ -1134,10 +1175,12 @@
         workTypeId: '',
         birthday: '',
         signature: {},
-        postName:''
+        postName: '',
+        professions: []
       };
       return {
         defaultForm,
+
         // 表单数据
         form: { ...defaultForm },
         disabled: false,
@@ -1286,7 +1329,20 @@
           { value: 6, label: '离职' }
         ],
         accountList: [],
-
+        levelOptions: [
+          {
+            label: '初级',
+            value: '1'
+          },
+          {
+            label: '中级',
+            value: '2'
+          },
+          {
+            label: '高级',
+            value: '3'
+          }
+        ],
         deptTree: [],
         defaultProps: {
           multiple: true,
@@ -1723,6 +1779,80 @@
             align: 'center'
           }
         ];
+      },
+      jobColumns() {
+        return [
+          {
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center'
+          },
+          {
+            slot: 'type',
+            label: '类型',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110,
+            formatter: (_row) => {
+              return this.getDictValue('工种类型', _row.type);
+            }
+          },
+          {
+            align: 'center',
+            prop: 'code',
+            label: '编码',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            slot: 'name',
+            prop: 'name',
+            label: '名称',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            slot: 'level',
+            prop: 'level',
+            label: '等级',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110,
+            formatter: (_row) => {
+              return this.levelOptions.filter(
+                (item) => _row.level == item.value
+              )[0].label;
+            }
+          },
+          {
+            slot: 'hourCost',
+            prop: 'hourCost',
+            label: '标准工时费',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            slot: 'unit',
+            prop: 'unit',
+            label: '工时费单位',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 260,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ];
       }
     },
     created() {
@@ -1731,6 +1861,14 @@
       this.getProfessionList();
     },
     methods: {
+      chooseAptitude(data) {
+        console.log(data);
+        this.form.professions.push(...data);
+      },
+      deleteJob(index) {
+        this.form.professions.splice(index, 1);
+      },
+
       idCardChange() {
         // 检查身份证号是否为18位
         if (this.form.idCard.length === 18) {
@@ -1825,6 +1963,7 @@
         });
         this.factoryList = list || [];
       },
+
       /* 保存编辑 */
       save() {
         this.$refs.form.validate((valid) => {
@@ -1843,12 +1982,18 @@
           //
           //   this.form['deptTree'] = JSON.stringify(this.deptTree)
           // }
-
-          if (this.form.postId) {
-            this.form.postName = this.getDictValue('岗位', this.form.postId);
+          let formData = JSON.parse(JSON.stringify(this.form));
+          if (formData.postId) {
+            formData.postName = formData.postId
+              .map((item) => this.getDictValue('岗位', item))
+              .toString();
+            formData.postId = formData.postId.toString();
+          }
+          if (formData.professions?.length) {
+            formData.professionId = formData.professions.map(item=>item.id).toString();
           }
           const data = {
-            ...this.form
+            ...formData
           };
           if (!this.isUpdate) {
             delete data.id;
@@ -1910,6 +2055,9 @@
           this.getAccountList();
           if (this.data) {
             getUserDetail(this.data.id).then((res) => {
+              if (res.postId) {
+                res.postId = res.postId.split(',');
+              }
               this.form = { ...res };
               if (Array.isArray(this.form.signature)) {
                 this.form.signature = this.form.signature[0];

+ 45 - 35
src/views/system/organization/components/org-user-search.vue

@@ -7,7 +7,7 @@
     @submit.native.prevent
   >
     <el-row :gutter="24">
-      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+      <el-col v-bind="styleResponsive ? { md: 3 } : { span: 3 }">
         <el-form-item>
           <el-input
             clearable
@@ -18,7 +18,7 @@
         </el-form-item>
       </el-col>
 
-      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+      <el-col v-bind="styleResponsive ? { md: 3 } : { span: 3 }">
         <el-form-item>
           <el-input
             clearable
@@ -28,7 +28,7 @@
           />
         </el-form-item>
       </el-col>
-      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+      <el-col v-bind="styleResponsive ? { md: 3 } : { span: 3 }">
         <el-form-item>
           <el-input
             clearable
@@ -38,6 +38,16 @@
           />
         </el-form-item>
       </el-col>
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <DictSelection
+          dictName="岗位"
+          clearable
+          filterable
+          v-model="where.postId"
+          multiple
+        >
+        </DictSelection>
+      </el-col>
       <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
         <el-form-item>
           <el-button
@@ -65,39 +75,39 @@
 </template>
 
 <script>
-export default {
-  data() {
-    // 默认表单数据
-    const defaultWhere = {
-      jobNumber: '',
-      loginName: '',
-      name: ''
-    };
-    return {
-      // 表单数据
-      where: { ...defaultWhere }
-    };
-  },
-  computed: {
-    // 是否开启响应式布局
-    styleResponsive() {
-      return this.$store.state.theme.styleResponsive;
-    }
-  },
-  methods: {
-    /* 搜索 */
-    search() {
-      this.$emit('search', this.where);
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        jobNumber: '',
+        loginName: '',
+        name: '',
+        postId:[],
+      };
+      return {
+        // 表单数据
+        where: { ...defaultWhere }
+      };
     },
-    /*  重置 */
-    reset() {
-      this.where = { ...this.defaultWhere };
-      this.search();
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
     },
-    geValue() {
-      return this.where;
+    methods: {
+      /* 搜索 */
+      search() {
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      },
+      geValue() {
+        return this.where;
+      }
     }
-  }
-};
+  };
 </script>
- 

+ 17 - 15
src/views/technology/productParam/components/user-edit.vue

@@ -150,8 +150,9 @@
         <div class="ele-body">
           <ele-pro-table
             ref="table"
-            :datasource="datasource"
+            :datasource="tableList"
             :columns="columns"
+            row-key="id"
           >
             <!-- 表头工具栏 -->
             <template v-slot:toolbar>
@@ -272,6 +273,7 @@
   import ParamModal from './ParamModal.vue';
 
   import { pageList } from '@/api/technology/version/version.js';
+  import { log } from 'bpmn-js-token-simulation';
   export default {
     components: {
       ProductModal,
@@ -398,7 +400,8 @@
           }
         ],
         isProduct: false, // 判断是否是产品
-        isProductUpdate: null // 1 新增, 2编辑
+        isProductUpdate: null, // 1 新增, 2编辑
+        tableList: []
       };
     },
     computed: {
@@ -439,23 +442,22 @@
       },
 
       chooseModal(data) {
-        this.$refs.table.setData([...data, ...this.$refs.table.getData()]);
-        this.$set(this.form, 'produceParam', this.$refs.table.getData());
-      },
-
-      /* 表格数据源 */
-      datasource({ page, limit, where }) {
-        return [];
+        this.removeList = this.removeList.filter(
+          (id) => !data.some((d) => d.id === id)
+        );
+        this.tableList = [...data, ...this.$refs.table.getData()];
+        this.$set(this.form, 'produceParam', this.tableList);
       },
 
       remove(row) {
-        const data = this.$refs.table.getData() ?? [];
+        console.log('row', row);
+        console.log('this.tableList', this.tableList);
         if (row.id) {
           this.removeList.push(row.id);
-          this.$refs.table.setData(data.filter((d) => d.id !== row.id));
+          this.tableList = this.tableList.filter((d) => d.id != row.id);
         } else {
-          this.$refs.table.setData(
-            data.filter((d) => d.paramId !== row.paramId)
+          this.tableList = this.tableList.filter(
+            (d) => d.paramId != row.paramId
           );
         }
       },
@@ -535,7 +537,7 @@
               ...res
             });
 
-            this.$refs.table.setData(res.produceParam);
+            this.tableList = res.produceParam;
             this.taskParam = res.taskParam;
             this.isUpdate = true;
           } else if (this.paramData) {
@@ -558,7 +560,7 @@
                 ...res
               });
 
-              this.$refs.table.setData(res.produceParam);
+              this.tableList = res.produceParam;
               this.taskParam = res.taskParam;
             } else {
               this.$util.assignObject(this.form, {

+ 183 - 173
src/views/technology/productParam/index.vue

@@ -4,20 +4,25 @@
       <!-- 搜索表单 -->
       <user-search @search="reload" />
       <!-- 数据表格 -->
-      <ele-pro-table ref="table" 
-        :columns="columns" 
-        :datasource="datasource" 
-        :selection.sync="selection" 
-        row-key="code" 
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        :selection.sync="selection"
+        row-key="code"
         :page-size="this.$store.state.tablePageSize"
         @columns-change="handleColumnChange"
         :cache-key="cacheKeyUrl"
-        >
+      >
         <!-- 表头工具栏 -->
         <template v-slot:toolbar>
-          <el-button size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="openEdit()"
-          v-if="$hasPermission('main:categoryparam:save')"
-
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            class="ele-btn-icon"
+            @click="openEdit()"
+            v-if="$hasPermission('main:categoryparam:save')"
           >
             新建
           </el-button>
@@ -39,17 +44,21 @@
 
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
-          <el-link type="primary" :underline="false" icon="el-icon-edit" @click="openEdit(row)"
-          v-if="$hasPermission('main:categoryparam:update')"
-          
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="openEdit(row)"
+            v-if="$hasPermission('main:categoryparam:update')"
           >
             修改
           </el-link>
 
-          
-          <el-popconfirm class="ele-action" title="确定要删除当前参数吗?" @confirm="remove(row)"
-          v-if="$hasPermission('main:categoryparam:delete')"
-
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除当前参数吗?"
+            @confirm="remove(row)"
+            v-if="$hasPermission('main:categoryparam:delete')"
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">
@@ -61,171 +70,172 @@
       </ele-pro-table>
     </el-card>
     <!-- 编辑弹窗 -->
-    <user-edit :visible.sync="showEdit" :data="current" @done="reload" ref="userEdit" />
+    <user-edit
+      :visible.sync="showEdit"
+      :data="current"
+      @done="reload"
+      ref="userEdit"
+    />
     <!-- 导入弹窗 -->
   </div>
 </template>
 
 <script>
-import tabMixins from '@/mixins/tableColumnsMixin';
-import UserSearch from './components/user-search.vue';
-import UserEdit from './components/user-edit.vue';
-
-import parameter from '@/api/technology/productParam';
-
-export default {
-  name: 'productParam',
-  mixins: [tabMixins],
-  components: {
-    UserSearch,
-    UserEdit
-  },
-  data() {
-    return {
-      // 表格列配置
-      columns: [
-   
-
-        {
-          prop: 'categoryCode',
-          label: '产品编码',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'categoryName',
-          label: '产品名称',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'categoryBrandNum',
-          label: '牌号',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'categoryModelType',
-          label: '型号',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-
-        {
-          prop: 'categoryMrpType',
-          label: 'MRP代码',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-
-
-        {
-          prop: 'produceVersionName',
-          label: '工艺类型',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-
-
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 220,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ],
-      statusList: [
-        { label: '工艺', value: 0 },
-        { label: '工序', value: 1 },
-        { label: '产品', value: 2 },
-        { label: '原料', value: 3 },
-        { label: '设备', value: 4 },
-        { label: '其他', value: 5 }
-      ],
-      // 表格选中数据
-      selection: [],
-      // 当前编辑数据
-      current: null,
-      // 是否显示编辑弹窗
-      showEdit: false,
-      // 是否显示导入弹窗
-      showImport: false,
-      cacheKeyUrl: 'f653e51e-technology-productParam'
-    };
-  },
-  methods: {
-    /*回显类型 */
-    checkType(id) {
-      const obj = this.statusList.find((item) => item.value == id);
-      return obj.label;
-    },
-    /* 表格数据源 */
-    async datasource({ page, limit, where, order }) {
-      const res = await parameter.list({
-        ...where,
-        ...order,
-        pageNum: page,
-        size: limit
-      });
-      return res;
-    },
-
-    /* 刷新表格 */
-    reload(where) {
-      this.$refs.table.reload({ page: 1, where: where });
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  import UserSearch from './components/user-search.vue';
+  import UserEdit from './components/user-edit.vue';
+
+  import parameter from '@/api/technology/productParam';
+
+  export default {
+    name: 'productParam',
+    mixins: [tabMixins],
+    components: {
+      UserSearch,
+      UserEdit
     },
-    /* 打开编辑弹窗 */
-    openEdit(row) {
-      this.current = row;
-      this.showEdit = true;
-      this.$refs.userEdit.$refs.form &&
-        this.$refs.userEdit.$refs.form.clearValidate();
+    data() {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            prop: 'categoryCode',
+            label: '产品编码',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'categoryName',
+            label: '产品名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'categoryBrandNum',
+            label: '牌号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'categoryModelType',
+            label: '型号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'categoryMrpType',
+            label: 'MRP代码',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'produceVersionName',
+            label: '工艺类型',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 220,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ],
+        statusList: [
+          { label: '工艺', value: 0 },
+          { label: '工序', value: 1 },
+          { label: '产品', value: 2 },
+          { label: '原料', value: 3 },
+          { label: '设备', value: 4 },
+          { label: '其他', value: 5 }
+        ],
+        // 表格选中数据
+        selection: [],
+        // 当前编辑数据
+        current: null,
+        // 是否显示编辑弹窗
+        showEdit: false,
+        // 是否显示导入弹窗
+        showImport: false,
+        cacheKeyUrl: 'f653e51e-technology-productParam'
+      };
     },
-
-    /* 删除 */
-    remove(row) {
-      const loading = this.$loading({ lock: true });
-
-      parameter
-        .delete([row.id])
-        .then((msg) => {
-          loading.close();
-          this.$message.success('删除' + msg);
-          this.reload();
-        })
-        .catch((e) => {
-          loading.close();
-          // this.$message.error(e.message);
+    methods: {
+      /*回显类型 */
+      checkType(id) {
+        const obj = this.statusList.find((item) => item.value == id);
+        return obj.label;
+      },
+      /* 表格数据源 */
+      async datasource({ page, limit, where, order }) {
+        const res = await parameter.list({
+          ...where,
+          ...order,
+          pageNum: page,
+          size: limit
         });
-    },
-    /* 批量删除 */
-    removeBatch() {
-      if (!this.selection.length) {
-        this.$message.error('请至少选择一条数据');
-        return;
-      }
-      this.$confirm('确定要删除选中的工序吗?', '提示', {
-        type: 'warning'
-      })
-        .then(() => {
-          const loading = this.$loading({ lock: true });
-          parameter
-            .delete(this.selection.map((d) => d.id))
-            .then((msg) => {
-              loading.close();
-              this.$message.success('删除' + msg);
-              this.reload();
-            })
-            .catch((e) => {
-              loading.close();
-              // this.$message.error(e.message);
-            });
+        return res;
+      },
+
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where: where });
+      },
+      /* 打开编辑弹窗 */
+      openEdit(row) {
+        this.current = row;
+        this.showEdit = true;
+        this.$refs.userEdit.$refs.form &&
+          this.$refs.userEdit.$refs.form.clearValidate();
+      },
+
+      /* 删除 */
+      remove(row) {
+        const loading = this.$loading({ lock: true });
+
+        parameter
+          .delete([row.id])
+          .then((msg) => {
+            loading.close();
+            this.$message.success('删除' + msg);
+            this.reload();
+          })
+          .catch((e) => {
+            loading.close();
+            // this.$message.error(e.message);
+          });
+      },
+      /* 批量删除 */
+      removeBatch() {
+        if (!this.selection.length) {
+          this.$message.error('请至少选择一条数据');
+          return;
+        }
+        this.$confirm('确定要删除选中的工序吗?', '提示', {
+          type: 'warning'
         })
-        .catch(() => { });
+          .then(() => {
+            const loading = this.$loading({ lock: true });
+            parameter
+              .delete(this.selection.map((d) => d.id))
+              .then((msg) => {
+                loading.close();
+                this.$message.success('删除' + msg);
+                this.reload();
+              })
+              .catch((e) => {
+                loading.close();
+                // this.$message.error(e.message);
+              });
+          })
+          .catch(() => {});
+      }
     }
-  }
-};
+  };
 </script>

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 294 - 294
yarn.lock


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels