11
86134
2023-11-17 9ae715c71e78d4d68b05a91b399b3f6c91ee45e7
11
已修改4个文件
237 ■■■■■ 文件已修改
src/views/product/workbench/index.vue 208 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/product/workbench/operation-task-pane.vue 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/product/workbench/taskinfo-pane.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/product/workbench/workstationoperate-form.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/product/workbench/index.vue
@@ -531,7 +531,7 @@
          <div class="task-div-content">
            <div v-if="!isShowNormalTracking" class="task-list-div">
              <operationTaskPane
                ref="operateTaskDiv"
        ref="operateTaskDiv" :style="{ backgroundColor: taskStatusColor() }"
                :workstationId="dutyForm.workstationId"
                :productSn="operateTaskForm.SN"
                :orderNumber="operateTaskForm.orderNumber"
@@ -544,7 +544,7 @@
            </div>
            <div v-if="isShowNormalTracking" class="task-list-div">
              <operationTaskTable
                ref="operateTaskTableDiv"
        ref="operateTaskTableDiv" :style="{ backgroundColor: taskStatusColor() }"
                :workstationId="dutyForm.workstationId"
                :productSn="operateTaskForm.SN"
                :orderNumber="operateTaskForm.orderNumber"
@@ -553,6 +553,7 @@
                @changeCurrOperateTask="changeCurrOperateTask"
              />
            </div>
          </div>
        </div>
      </div>
@@ -1437,6 +1438,7 @@
  box-sizing: border-box;
  overflow-y: auto;
  margin-bottom: 10px;
}
.task-list-div {
@@ -1560,6 +1562,10 @@
  },
  data() {
    return {
      dutyForm: {},
      operateTaskForm: {},
      isShowNormalTracking: false,
      // taskStatusColor: '',
      showBan: false,
      dutyCanEdit: false,
      saveButton: false,
@@ -1666,96 +1672,9 @@
      currItem: 'task'
    }
  },
  computed: {
    ...mapGetters(['userInfo', 'tagWel', 'permissions'])
  },
  created() {
    document.title = '工作台——MES'
    if (!this.dutyForm.workstationId) {
      const k = localStorage.getItem(storage_key)
      if (k) {
        this.dutyForm.workstationId = parseInt(k)
      }
    }
    this.initOptions()
    this.getSysParam(sysParam.SHOW_STEP_BUSINESS)
    this.getTrackingParam(sysParam.SHOW_TRACKING_TYPE)
    this.timer = setInterval(this.clockTimer, 1000)
  },
  watch: {
    'dutyForm.workstationId'(val) {
      if (val) {
        localStorage.setItem(storage_key, val)
      }
      // 工作站改变时,整个页面的动态数据需实时加载、页面缓存数据需 初始化
      this.initPageVariable()
      this.loadInfoByWorkstation()
    },
    'dutyForm.startTime'(val, oldval) {
      if (val) {
        this.checkTime()
      } else {
        this.warningShow = false
      }
    },
    'dutyForm.endTime'(val, oldval) {
      if (val) {
        this.checkTime()
      } else {
        this.warningShow = false
      }
    },
    'operateTaskForm.orderNumber'(val) {
      /* this.$nextTick(() => {
        this.queryInfoForOrderNumber()
      }) */
    },
    'operateTaskForm.spec'(val) {
      if (val == '' || val == null) {
        this.SNs = []
        this.operateTaskForm.SN = ''
      } else {
        const that = this
        that.SNs = []
        getProductSnByCustomerNoAndPartName({
          customerOrderNo: this.operateTaskForm.orderNumber,
          partName: val
        }).then((res) => {
          const result = res.data.data
          result.forEach(function(item) {
            const obj = {
              key: item,
              value: item
            }
            that.SNs.push(obj)
          })
        })
      }
      this.$nextTick(() => {
        if (this.partNames.length !== 0) {
          this.refreshOperateTasks()
        }
      })
    },
    'operateTaskForm.SN'(val) {
      this.$nextTick(() => {
        if (this.SNs.length !== 0) {
          this.refreshOperateTasks()
        }
      })
    },
    'operateTaskForm.outBatchNo'(val) {
      /* this.$nextTick(() => {
        this.refreshOperateTasks()
      }) */
    },
    'operateTaskForm.mpsNo'(val) {
      /* this.$nextTick(() => {
        this.refreshOperateTasks()
      }) */
    }
  },
  methods: {
    changeCurrOperateTask() {},
    refreshWorkReportPageData() {},
    refreshOperateTasksByConditions() {
      this.$nextTick(() => {
        this.refreshOperateTasks()
@@ -2597,6 +2516,113 @@
    beforeDestroy() {
      clearInterval(this.timer)
    }
  },
  computed: {
    ...mapGetters(['userInfo', 'tagWel', 'permissions']),
    taskStatusColor() {
    return function() {
      const now = new Date();
      const threeDaysAgo = new Date(now - 3 * 24 * 60 * 60 * 1000);
      const oneDayAgo = new Date(now - 24 * 60 * 60 * 1000);
      const today = new Date(now);
      if (threeDaysAgo <= today && today <= oneDayAgo) {
        return 'yellow';
      } else if (today <= threeDaysAgo) {
        return 'blue';
      } else {
        return 'red';
  }
    };
  }
  },
  created() {
    document.title = '工作台——MES'
    if (!this.dutyForm.workstationId) {
      const k = localStorage.getItem(storage_key)
      if (k) {
        this.dutyForm.workstationId = parseInt(k)
      }
    }
    this.initOptions()
    this.getSysParam(sysParam.SHOW_STEP_BUSINESS)
    this.getTrackingParam(sysParam.SHOW_TRACKING_TYPE)
    this.timer = setInterval(this.clockTimer, 1000)
  },
  watch: {
    'dutyForm.workstationId'(val) {
      if (val) {
        localStorage.setItem(storage_key, val)
      }
      // 工作站改变时,整个页面的动态数据需实时加载、页面缓存数据需 初始化
      this.initPageVariable()
      this.loadInfoByWorkstation()
    },
    'dutyForm.startTime'(val, oldval) {
      if (val) {
        this.checkTime()
      } else {
        this.warningShow = false
      }
    },
    'dutyForm.endTime'(val, oldval) {
      if (val) {
        this.checkTime()
      } else {
        this.warningShow = false
      }
    },
    'operateTaskForm.orderNumber'(val) {
      /* this.$nextTick(() => {
        this.queryInfoForOrderNumber()
      }) */
    },
    'operateTaskForm.spec'(val) {
      if (val == '' || val == null) {
        this.SNs = []
        this.operateTaskForm.SN = ''
      } else {
        const that = this
        that.SNs = []
        getProductSnByCustomerNoAndPartName({
          customerOrderNo: this.operateTaskForm.orderNumber,
          partName: val
        }).then((res) => {
          const result = res.data.data
          result.forEach(function(item) {
            const obj = {
              key: item,
              value: item
            }
            that.SNs.push(obj)
          })
        })
      }
      this.$nextTick(() => {
        if (this.partNames.length !== 0) {
          this.refreshOperateTasks()
        }
      })
    },
    'operateTaskForm.SN'(val) {
      this.$nextTick(() => {
        if (this.SNs.length !== 0) {
          this.refreshOperateTasks()
        }
      })
    },
    'operateTaskForm.outBatchNo'(val) {
      /* this.$nextTick(() => {
        this.refreshOperateTasks()
      }) */
    },
    'operateTaskForm.mpsNo'(val) {
      /* this.$nextTick(() => {
        this.refreshOperateTasks()
      }) */
    }
  },
}
</script>
src/views/product/workbench/operation-task-pane.vue
@@ -14,7 +14,7 @@
      :key="index"
      :class="['task-item', item.checkFlag ? 'card-checked' : 'card-unchecked']"
    >
      <img class="selectedImg" src="/img/workbench/icon_selected.png" />
  <!-- <img class="selectedImg" /> -->
      <div class="header">
        <div>工单号:{{ item.taskNo }}</div>
        <!-- <div>计划号:{{ item.mpsNo }}</div> -->
@@ -96,10 +96,13 @@
  border-radius: 12px;
  cursor: pointer;
  position: relative;
background:none;
  box-shadow: 1px 2px 24px 1px rgba(4, 0, 0, 0.14);
  & + .task-item {
    margin-top: 10px;
  }
  &.card-checked {
    // color: white;
    background-image: -webkit-linear-gradient(
@@ -344,6 +347,28 @@
    }
  },
  methods: {
    // setCheckFlag(item) {
    //   this.$nextTick(() => {
    //     this.changeBackgroundColor(item.planFinishDay);
    //   });
    // },
    // changeBackgroundColor(dateString) {
    //   const date = new Date(dateString);
    //   const threeDaysAgo = new Date();
    //   threeDaysAgo.setDate(threeDaysAgo.getDate() - 3);
    //   const oneDayAgo = new Date();
    //   oneDayAgo.setDate(oneDayAgo.getDate() - 1);
    //   if (date <= threeDaysAgo) {
    //     document.body.style.backgroundColor = "blue";
    //   } else if (date <= oneDayAgo) {
    //     document.body.style.backgroundColor = "yellow";
    //   } else {
    //     document.body.style.backgroundColor = "red";
    //   }
    // },
    // 点击工单,选中工单
    setCheckFlag(item) {
      if (item.checkFlag) {
src/views/product/workbench/taskinfo-pane.vue
@@ -891,6 +891,7 @@
  getGenerateSN,
  getShiftProductOutByOpIdAndWsId
} from '@/api/product/personboard'
import {
  getTemplate,
  getDocumentJgt,
src/views/product/workbench/workstationoperate-form.vue
@@ -1,5 +1,6 @@
<template>
  <div style="width: 100%;height: 100%"></div>
</template>
<style lang="scss" scoped>
.ws-header {