소스 검색

解决executeGroupld报错

huang_an 1 년 전
부모
커밋
444eb2d82c

+ 17 - 15
src/components/addPatrolPlanDialog/DispatchDialog.vue

@@ -191,7 +191,7 @@
         default: '巡点检'
       }
     },
-    data () {
+    data() {
       return {
         defaultProps: {
           label: 'showName'
@@ -260,9 +260,9 @@
         editLoading: false
       };
     },
-    async created () {},
+    async created() {},
     computed: {
-      totalCost () {
+      totalCost() {
         const cur = this.planDeviceList[this.currentEquItemIndex] || {};
         const sparePart = cur?.sparePart || [];
 
@@ -288,12 +288,12 @@
       }
     },
     methods: {
-      open (row) {
+      open(row) {
         this.getInfo(row.id);
         this.addPatrolPlanDialog = true;
       },
       // 编辑详情
-      async getInfo (planId) {
+      async getInfo(planId) {
         this.editLoading = true;
         const res = await getById(planId).catch(() => {
           this.editLoading = false;
@@ -307,7 +307,7 @@
       },
 
       // 获取计划配置单号
-      async getOrderCode () {
+      async getOrderCode() {
         if (this.type.includes('巡点检')) {
           const data = await getCode('partrol_code');
           this.$set(this.addForm, 'orderCode', data);
@@ -317,7 +317,7 @@
           this.$set(this.addForm, 'orderCode', code);
         }
       },
-      handleClose () {
+      handleClose() {
         this.addPatrolPlanDialog = false;
         this.$refs.addFormRef.resetFields();
         this.currentEquItemIndex = 0;
@@ -325,7 +325,7 @@
         this.addForm = {};
       },
       // 设备列表树点击
-      handleNodeClick (data, node) {
+      handleNodeClick(data, node) {
         const { equiLocation, equiLocationCode } = this.getEquiLocation(data);
         this.equipmentInfo = {
           equiCode: data.code,
@@ -346,7 +346,7 @@
           equiLocationCode;
       },
       // 封装 - 获取设备分类列表
-      async _getEquipmentList (planId) {
+      async _getEquipmentList(planId) {
         const data = await getNotSendOrderList(planId);
         if (!data?.length) {
           this.$message.error('所有设备已指派完!');
@@ -377,20 +377,20 @@
         });
       },
       //选择部门(搜索)
-      searchDeptNodeClick (id, info) {
+      searchDeptNodeClick(id, info) {
         this.addForm.executeGroupName = info?.name;
         // 根据部门获取人员
-        const params = { executeGroupId: id };
+        const params = { executeGroupId: id ? id : '' };
         this.$nextTick(() => {
           this.$refs.executorRef.getList(params);
         });
       },
       //执行人
-      handleExecutorChange (id, info) {
+      handleExecutorChange(id, info) {
         this.addForm.executeUserName = info?.name;
       },
       // 封装 - 获取设备位置名称和code方法
-      getEquiLocation (data) {
+      getEquiLocation(data) {
         // 设备位置编码
         const equiLocationCode = data.position[0].pathIds;
         // 设备位置名称
@@ -398,7 +398,7 @@
         return { equiLocation, equiLocationCode };
       },
       // 提交
-      submit (isContinue = false) {
+      submit(isContinue = false) {
         this.$refs.addFormRef.validate(async (valid) => {
           if (valid) {
             try {
@@ -410,7 +410,9 @@
 
               // 将newData拼接成一个新数组赋值给后端接收字段
               const params = {
-                executeGroupId: this.addForm.executeGroupId,
+                executeGroupId: this.addForm.executeGroupId
+                  ? this.addForm.executeGroupId
+                  : '',
                 executeGroupName: this.addForm.executeGroupName,
                 executeUserId: this.addForm.executeUserId,
                 executeUserName: this.addForm.executeUserName,

+ 1 - 1
src/views/ledgerAssets/components/basicInfo.vue

@@ -106,7 +106,7 @@
         let res = await getUserPage({
           pageNum: 1,
           size: -1,
-          executeGroupId: id
+          executeGroupId: id ? id : ''
         });
         const list = res.list.filter((item) => item.id == depId);
         return list[0];

+ 1 - 1
src/views/ledgerAssets/components/basicInfoView.vue

@@ -97,7 +97,7 @@
         const res = await getUserPage({
           pageNum: 1,
           size: -1,
-          executeGroupId: id
+          executeGroupId: id ? id : ''
         });
         const list = res.list;
         for (const key in list) {

+ 1 - 1
src/views/ledgerAssets/components/qualityConfig.vue

@@ -66,7 +66,7 @@
         const res = await getUserPage({
           pageNum: 1,
           size: -1,
-          executeGroupId: id
+          executeGroupId: id ? id : ''
         });
         const list = res.list;
         for (const key in list) {

+ 1 - 1
src/views/ledgerAssets/equipment/edit copy.vue

@@ -1670,7 +1670,7 @@
         const res = await getUserPage({
           pageNum: 1,
           size: -1,
-          executeGroupId: id
+          executeGroupId: id ? id : ''
         });
         // const depId = res.list.find((item) => {
         //   item.id == ids;

+ 1 - 1
src/views/ledgerAssets/mould/components/baseInfo.vue

@@ -512,7 +512,7 @@
         const res = await getUserPage({
           pageNum: 1,
           size: -1,
-          executeGroupId: id
+          executeGroupId: id ? id : ''
         });
         this.depList = res.list;
       },

+ 1 - 1
src/views/ledgerAssets/mould/edit copy.vue

@@ -851,7 +851,7 @@
         const res = await getUserPage({
           pageNum: 1,
           size: -1,
-          executeGroupId: id
+          executeGroupId: id ? id : ''
         });
         this.depList = res.list;
       },