695593266@qq.com 15 годин тому
батько
коміт
b73aa72c8d

+ 53 - 11
src/views/bpm/handleTask/components/bomApproverJSYY/detailDialog.vue

@@ -63,7 +63,7 @@
                 placeholder="请选择供应商"
               >
                 <el-option
-                  v-for="item in gysList"
+                  v-for="item in activeGysList"
                   :key="item.id"
                   :value="item.id"
                   :label="item.name"
@@ -106,6 +106,7 @@
             :key="item.id + index"
             :value="item.id"
             :label="item.name"
+            :disabled="item.disabled"
           ></el-option>
         </el-select>
       </template>
@@ -154,6 +155,7 @@
         visible: false,
         title: '',
         gysList: [],
+        contactListPromise: null,
         form: {},
         materielDesignationPL: null,
         supplierIdPL: null,
@@ -260,16 +262,26 @@
       this.getContactList();
       this.handBomDetails(this.businessId);
     },
+    computed: {
+      activeGysList() {
+        return this.gysList.filter((item) => !item.disabled);
+      }
+    },
     methods: {
       /* 表格数据源 */
-      datasource({ where, page, limit }) {
-        return getBomPageCategoryId({
-          ...where,
-          pageNum: page,
-          size: -1,
-          id: this.businessId,
-          isResourceBom: 1
-        });
+      datasource({ where, page }) {
+        return this.getContactList().then(() =>
+          getBomPageCategoryId({
+            ...where,
+            pageNum: page,
+            size: -1,
+            id: this.businessId,
+            isResourceBom: 1
+          }).then((res) => {
+            this.addHiddenSupplierOptions(res);
+            return res;
+          })
+        );
       },
 
       /* 刷新表格 */
@@ -294,14 +306,44 @@
       },
 
       getContactList() {
+        if (this.contactListPromise) {
+          return this.contactListPromise;
+        }
         let param = {
           pageNum: 1,
           type: 2,
           size: -1,
           status: 1
         };
-        contactList(param).then((res) => {
-          this.gysList = res.list;
+        this.contactListPromise = contactList(param)
+          .then((res) => {
+            this.gysList = res.list || [];
+            return this.gysList;
+          })
+          .catch((error) => {
+            this.contactListPromise = null;
+            throw error;
+          });
+        return this.contactListPromise;
+      },
+
+      addHiddenSupplierOptions(data) {
+        const rows = Array.isArray(data)
+          ? data
+          : data?.list || data?.records || data?.items || [];
+        const supplierIds = new Set(this.gysList.map((item) => `${item.id}`));
+        rows.forEach((row) => {
+          if (row.supplierId || row.supplierId === 0) {
+            const supplierId = `${row.supplierId}`;
+            if (!supplierIds.has(supplierId)) {
+              this.gysList.push({
+                id: row.supplierId,
+                name: ' ',
+                disabled: true
+              });
+              supplierIds.add(supplierId);
+            }
+          }
         });
       },
 

+ 53 - 11
src/views/bpm/handleTask/components/bomApproverJSdevice/detailDialog.vue

@@ -64,7 +64,7 @@
                 placeholder="请选择供应商"
               >
                 <el-option
-                  v-for="item in gysList"
+                  v-for="item in activeGysList"
                   :key="item.id"
                   :value="item.id"
                   :label="item.name"
@@ -107,6 +107,7 @@
             :key="item.id + index"
             :value="item.id"
             :label="item.name"
+            :disabled="item.disabled"
           ></el-option>
         </el-select>
       </template>
@@ -155,6 +156,7 @@
         visible: false,
         title: '',
         gysList: [],
+        contactListPromise: null,
         baseCount: '',
         unit: '',
         materielDesignationPL: null,
@@ -259,16 +261,26 @@
       this.getContactList();
       this.handBomDetails(this.businessId);
     },
+    computed: {
+      activeGysList() {
+        return this.gysList.filter((item) => !item.disabled);
+      }
+    },
     methods: {
       /* 表格数据源 */
-      datasource({ where, page, limit }) {
-        return getBomPageCategoryId({
-          ...where,
-          pageNum: page,
-          size: -1,
-          id: this.businessId,
-          isResourceBom: 1
-        });
+      datasource({ where, page }) {
+        return this.getContactList().then(() =>
+          getBomPageCategoryId({
+            ...where,
+            pageNum: page,
+            size: -1,
+            id: this.businessId,
+            isResourceBom: 1
+          }).then((res) => {
+            this.addHiddenSupplierOptions(res);
+            return res;
+          })
+        );
       },
 
       /* 刷新表格 */
@@ -277,14 +289,44 @@
       },
 
       getContactList() {
+        if (this.contactListPromise) {
+          return this.contactListPromise;
+        }
         let param = {
           pageNum: 1,
           type: 2,
           size: -1,
           status: 1
         };
-        contactList(param).then((res) => {
-          this.gysList = res.list;
+        this.contactListPromise = contactList(param)
+          .then((res) => {
+            this.gysList = res.list || [];
+            return this.gysList;
+          })
+          .catch((error) => {
+            this.contactListPromise = null;
+            throw error;
+          });
+        return this.contactListPromise;
+      },
+
+      addHiddenSupplierOptions(data) {
+        const rows = Array.isArray(data)
+          ? data
+          : data?.list || data?.records || data?.items || [];
+        const supplierIds = new Set(this.gysList.map((item) => `${item.id}`));
+        rows.forEach((row) => {
+          if (row.supplierId || row.supplierId === 0) {
+            const supplierId = `${row.supplierId}`;
+            if (!supplierIds.has(supplierId)) {
+              this.gysList.push({
+                id: row.supplierId,
+                name: ' ',
+                disabled: true
+              });
+              supplierIds.add(supplierId);
+            }
+          }
         });
       },
 

+ 14 - 2
src/views/bpm/handleTask/index.vue

@@ -40,14 +40,14 @@
           class="box-card"
           v-loading="processInstanceLoading"
           v-for="(item, index) in runningTasks"
-          :key="index"
+          :key="item.id || index"
         >
           <div slot="header" class="clearfix">
             <span class="el-icon-picture-outline">审批任务</span>
           </div>
           <div v-if="processInstance.processDefinition">
             <async-sub-form-component
-              :taskId="listData?.taskId"
+              :taskId="item.id || listData?.taskId"
               :businessId="listData?.businessId"
               :businessCode="listData?.businessCode"
               :id="listData?.id"
@@ -583,8 +583,20 @@
               });
             });
           }
+          this.normalizeRunningTasks();
         });
       },
+      normalizeRunningTasks() {
+        const currentTaskIndex = this.runningTasks.findIndex(
+          (task) => `${task.id}` === `${this.listData.taskId}`
+        );
+        const task =
+          this.runningTasks[currentTaskIndex > -1 ? currentTaskIndex : 0];
+        this.runningTasks = task ? [task] : [];
+        this.auditForms = this.runningTasks.map(() => ({
+          reason: ''
+        }));
+      },
       getTimelineItemIcon(item) {
         if (item.result === 1) {
           return 'el-icon-time';

+ 43 - 2
src/views/factoryCalendar/components/MultiCalendarView.vue

@@ -79,9 +79,15 @@
           <el-tooltip
             v-for="day in vm.calendarCells"
             :key="day.key"
-            placement="top"
+            placement="auto"
             effect="light"
             :disabled="!day.date"
+            :manual="true"
+            :value="activeTooltipKey === day.key"
+            :enterable="false"
+            :popper-append-to-body="true"
+            :popper-options="tooltipPopperOptions"
+            popper-class="factory-calendar-day-tooltip"
           >
             <div slot="content" class="calendar-tooltip">
               <div>日期类型:{{ vm.getDateTypeText(day) }}</div>
@@ -98,7 +104,9 @@
             <div
               class="calendar-cell"
               :class="vm.getDayClass(day)"
-              @click="vm.openDayDrawer(day)"
+              @mouseenter="showTooltip(day)"
+              @mouseleave="hideTooltip(day)"
+              @click="openDayDrawer(day)"
             >
               <div class="day-head">
                 <span>{{ day.dayText }}</span>
@@ -149,6 +157,39 @@
         type: Object,
         required: true
       }
+    },
+    data() {
+      return {
+        activeTooltipKey: '',
+        tooltipPopperOptions: {
+          modifiers: {
+            preventOverflow: {
+              boundariesElement: 'viewport',
+              padding: 12
+            },
+            flip: {
+              boundariesElement: 'viewport',
+              padding: 12
+            }
+          }
+        }
+      };
+    },
+    methods: {
+      showTooltip(day) {
+        if (day.date) {
+          this.activeTooltipKey = day.key;
+        }
+      },
+      hideTooltip(day) {
+        if (!day || this.activeTooltipKey === day.key) {
+          this.activeTooltipKey = '';
+        }
+      },
+      openDayDrawer(day) {
+        this.hideTooltip(day);
+        this.vm.openDayDrawer(day);
+      }
     }
   };
 </script>

+ 35 - 2
src/views/factoryCalendar/components/factoryCalendar.scss

@@ -4000,9 +4000,42 @@
     }
   }
 
-  .calendar-tooltip {
-    line-height: 24px;
+  @at-root body .factory-calendar-day-tooltip {
+    max-width: min(360px, calc(100vw - 32px));
+    max-height: calc(100vh - 32px);
+    padding: 0;
+    border: 1px solid #d8e6f7;
+    border-radius: 8px;
+    box-shadow: 0 16px 36px rgba(31, 45, 61, 0.18);
+    overflow: auto;
+
+    .popper__arrow {
+      border-top-color: #d8e6f7 !important;
+      border-bottom-color: #d8e6f7 !important;
+    }
+  }
+
+  @at-root body .factory-calendar-day-tooltip .calendar-tooltip {
+    min-width: 260px;
+    padding: 12px 14px;
     color: #303133;
+    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
+    border-radius: 8px;
+    line-height: 22px;
+  }
+
+  @at-root body .factory-calendar-day-tooltip .calendar-tooltip > div {
+    padding: 7px 10px;
+    border-radius: 6px;
+    background: rgba(236, 246, 255, 0.68);
+    color: #2f3a4a;
+    font-size: 13px;
+    font-weight: 600;
+    word-break: break-word;
+  }
+
+  @at-root body .factory-calendar-day-tooltip .calendar-tooltip > div + div {
+    margin-top: 6px;
   }
 
   .plan-tooltip {

+ 31 - 2
src/views/home/index.vue

@@ -263,10 +263,13 @@
                   v-for="day in calendarCells"
                   :key="day.key"
                   :disabled="!day.date"
-                  placement="bottom-start"
+                  placement="auto"
                   effect="light"
                   popper-class="calendar-day-tooltip"
-                  :popper-append-to-body="false"
+                  :popper-append-to-body="true"
+                  :popper-options="calendarTooltipPopperOptions"
+                  :manual="true"
+                  :value="activeCalendarTooltipKey === day.key"
                   :open-delay="120"
                   :hide-after="0"
                   :enterable="false"
@@ -304,6 +307,8 @@
                   <div
                     class="calendar-cell"
                     :class="getCalendarDayClass(day)"
+                    @mouseenter="showCalendarTooltip(day)"
+                    @mouseleave="hideCalendarTooltip(day)"
                     @click="day.date && openCalendarDayDrawer(day)"
                   >
                     <div v-if="day.date" class="day-head">
@@ -544,6 +549,19 @@
         hasMore: true,
         portals: [],
         selectedCalendarType: 1,
+        activeCalendarTooltipKey: '',
+        calendarTooltipPopperOptions: {
+          modifiers: {
+            preventOverflow: {
+              boundariesElement: 'viewport',
+              padding: 12
+            },
+            flip: {
+              boundariesElement: 'viewport',
+              padding: 12
+            }
+          }
+        },
         calendarTypeOptions: [
           { label: '标准生产日历', shortLabel: '标准生产', value: 1 },
           { label: '设备维护日历', shortLabel: '设备维护', value: 2 },
@@ -801,10 +819,21 @@
       console.log('day~~~', day);
       this.selectedScheduleDate = day;
     },
+    showCalendarTooltip(day) {
+      if (day.date) {
+        this.activeCalendarTooltipKey = day.key;
+      }
+    },
+    hideCalendarTooltip(day) {
+      if (!day || this.activeCalendarTooltipKey === day.key) {
+        this.activeCalendarTooltipKey = '';
+      }
+    },
     openCalendarDayDrawer(day) {
       if (!day || !day.date) {
         return;
       }
+      this.hideCalendarTooltip(day);
       this.handleDateClick(day.date);
       this.currentDay = {
         ...day,

+ 2 - 2
vue.config.js

@@ -38,13 +38,13 @@ module.exports = {
         // target: 'http://124.71.68.31:50001', // 测试环境
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.105:18086',
-        // target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.116:18086',
         // target: 'http://192.168.1.3:18086',
         // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.3:18086',
-        target: 'http://aiot.zoomwin.com.cn:51001/api',
+        // target: 'http://aiot.zoomwin.com.cn:51001/api',
         // target: 'http://192.168.1.3:18086',
         // target: 'http://192.168.1.116:18086', // 赵沙金