haoxuan
2023-09-14 04b13a0cdb319ccddc9ec3d4ec6cd3fd11c6eda6
面板 样式修改  工序+第一次的倒计时修改为 闪+工序运行时间
3个文件已添加
2个文件已修改
326 ■■■■ 已修改文件
public/duan.png 补丁 | 查看 | 原始文档 | blame | 历史
public/lian.png 补丁 | 查看 | 原始文档 | blame | 历史
public/shan.gif 补丁 | 查看 | 原始文档 | blame | 历史
src/components/AddIssue.vue 79 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/visualization.vue 247 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/duan.png
public/lian.png
public/shan.gif
src/components/AddIssue.vue
@@ -69,7 +69,7 @@
                  工时: {{ taskData.Procedure.procedure.workHours || "" }}
                </div>
                <div class="title-item">
                  起止时间: {{ formatDate(taskData.Order.startTime) || "" }}
                  计划时间: {{ formatDate(taskData.Order.startTime) || "" }}
                  -
                  {{ formatDate(taskData.Order.endTime) }}
                </div>
@@ -114,24 +114,37 @@
                  font-size: 26px;
                  width: 100%;
                  text-align: center;
                  margin-bottom: 20px;
                  margin-bottom: 15px;
                  margin-top: 10px;
                  line-height:35px;
                "
              >
              <template v-if="showBtn == 2">
                  <div class="gif">
                    <img  src="../../public/shan.gif" />
                  </div>
                </template>
                <template v-if="showBtn == 3&&!isLoading">
                  <div class="gif">
                    <span class="yuandian"></span>
                  </div>
                </template>
                {{ message }}
              </div>
              <div class="progress-item">
                <span>{{ parseInt((num / 60) * 100) }}%</span>
                <el-progress
                  style="width: calc(100% - 50px); float: right"
                  define-back-color="#CDC6C6"
                  color="#00cc66"
                  text-color="#fff"
                  :text-inside="true"
                  :stroke-width="20"
                  :percentage="parseInt((num / 60) * 100)"
                ></el-progress>
              </div>
              <template v-if="showBtn == 3&&isLoading">
                <div class="progress-item">
                    <span>{{ parseInt((num / 60) * 100) }}%</span>
                    <el-progress
                      style="width: calc(100% - 50px); float: right"
                      define-back-color="#CDC6C6"
                      color="#00cc66"
                      text-color="#fff"
                      :text-inside="true"
                      :stroke-width="20"
                      :percentage="parseInt((num / 60) * 100)"
                    ></el-progress>
                </div>
              </template>
            </div>
          </template>
@@ -228,10 +241,18 @@
        this.showBtn = 3;
      }
    },
    islook(){
      this.showBtn=1;
      if (this.timer) {
        clearInterval(this.timer);
      }
      this.num = 0;
    },
  },
  methods: {
    confirmClick2() {
      this.messageError = "";
      this.isLoading=false;
    },
    confirmClick1() {
      this.num = 0;
@@ -259,7 +280,7 @@
        this.islook = true;
      } else {
        this.islook = false;
        // this.islook = true;
        this.islook = true;
      }
    },
    getDateObj(date, fmt) {
@@ -316,8 +337,7 @@
          return true;
        }
        this.isLoading=true;
          sendProcessParams({ id: this.taskData.Procedure.ID }).then((res) => {
            console.log(res,'====res')
          sendProcessParams({ procedureId: this.taskData.Procedure.ID,position: Number(this.taskData.Position), }).then((res) => {
            if (res.code == 200) {
              this.resParams = res;
              this.isLoading=false;
@@ -386,10 +406,10 @@
  margin-bottom: 13px;
}
.title-box {
  width: calc(100% - 160px);
  width: calc(100% - 140px);
  height: auto;
  overflow: hidden;
  padding:0 80px;
  padding:0 70px;
  .title-item {
    width: 45%;
    float: left;
@@ -551,7 +571,26 @@
    background:#0E246A;
    .title-box{
      padding:0 10px;
      width:calc(100% - 20px);
    }
  }
  .gif{
    width:35px;
    margin:0 auto;
    display:inline-block;
    vertical-align: middle;
    img{
      width:100%;
    }
    .yuandian {
        width: 35px;
        height: 35px;
        display: inline-block;
        // background: #15d815;
        background:red;
        border-radius: 50%;
        vertical-align: middle;
      }
  }
  .progress-item {
    width: 55%;
@@ -586,7 +625,7 @@
    width:25%;
    float:left;
    margin-left:30px;
    font-size: 27px;
    font-size: 25px;
    color: #fff;
    height: 3.2vw;
    line-height: 4.5vw;
src/views/visualization.vue
@@ -7,15 +7,15 @@
        <p class="title">
          <span
            class="font set-title"
            style="float: left; margin-right: 15px"
            style="float: left; margin-right: 15px;"
            @click="cutClick(1)"
          >
            <img v-if="activeName == 1" src="../../public/one-blue.png" />
            <img v-else src="../../public/one.png" />
            <img style="width:32px;" v-if="activeName == 1" src="../../public/one-blue.png" />
            <img style="width:32px;" v-else src="../../public/one.png" />
          </span>
          <span class="font set-title" style="float: left" @click="cutClick(2)">
            <img v-if="activeName == 2" src="../../public/two-blue.png" />
            <img v-else src="../../public/two.png" />
            <img style="width:32px;" v-if="activeName == 2" src="../../public/two-blue.png" />
            <img style="width:32px;" v-else src="../../public/two.png" />
          </span>
          生产管理看板
          <span
@@ -27,8 +27,8 @@
            style="float: right;margin-right:20px;font-size:28px;line-height:25px;"
            @click="taskClick"
          >
          <el-badge :value="TaskCount" class="item">
            <i   class="el-icon-chat-round"/>
          <el-badge :value="TaskCount"  :class="TaskCount==0?'item color_666':'item color_fff'">
            <i   class="el-icon-chat-dot-round" />
          </el-badge>
        </span>
        </p>
@@ -37,6 +37,9 @@
          v-for="(taskData, index) in Tasks"
          :key="index"
        >
          <div class="gong-date">
            工序运行时间:{{ getFormatTime(taskData.Procedure.startTime) }}
          </div>
          <div class="statelist">
            <span class="title-item"
              >工单编号:
@@ -56,7 +59,7 @@
                {{ taskData.Procedure.procedure.nextProcedureName || "--" }}
              </span>
            </span>
            <span class="title-item"
            <!-- <span class="title-item"
              >工作人数:
              <span class="color_4efefa">
                <span
@@ -69,11 +72,11 @@
                <span v-else>0</span>
                人
              </span>
            </span>
            </span> -->
          </div>
          <div class="gongx" v-if="taskData.AllProcedures">
          <el-steps :active="taskData.CurrentProcedureIndex?taskData.CurrentProcedureIndex:0" finish-status="success" simple>
            <el-step :title="item" v-for="(item,index) in taskData.AllProcedures" :key="index"></el-step>
          <el-steps :active="taskData.CurrentProcedureIndex?taskData.CurrentProcedureIndex:0"  finish-status="success" class="steps">
            <el-step icon="" :title="item" v-for="(item,index) in taskData.AllProcedures" :key="index"></el-step>
          </el-steps>
        </div>
          <div class="content">
@@ -83,7 +86,7 @@
                <div class="content_leftBttom">
                  <dl>
                    <dd
                      style="font-size: 26px; font-weight: 600"
                      style="font-size: 35px; font-weight: 600"
                      class="color_green"
                    >
                      {{ taskData.finishNumber }}{{ taskData.Order.unit }}
@@ -96,7 +99,7 @@
                <div class="content_leftBttom">
                  <dl>
                    <dd
                      style="font-size: 26px; font-weight: 600"
                      style="font-size: 35px; font-weight: 600"
                      class="color_green"
                    >
                      {{ taskData.Order.amount || 0 }}{{ taskData.Order.unit }}
@@ -120,7 +123,7 @@
                <el-descriptions-item label="工时">
                  {{ taskData.Procedure.procedure.workHours || "" }}
                </el-descriptions-item>
                <el-descriptions-item label="起止时间"
                <el-descriptions-item label="计划时间"
                  >{{ formatDate(taskData.Order.startTime) || "" }}
                  -
                  {{ formatDate(taskData.Order.endTime) }}</el-descriptions-item
@@ -433,9 +436,13 @@
        </div>
        <div class="right-top-m">
          设备状态:
          <!-- 1断开2生产3待机 -->
          <span style="position: relative"
            >正常
            <span class="yuandian"></span>
            >
            <img v-if="plcStatus == 1" src="../../public/duan.png" />
            <img v-else src="../../public/lian.png" />
            <!-- <span class="yuandian"></span> -->
            {{ plcStatus==1?'断开':(plcStatus==2?'生产中':'待机') }}
          </span>
        </div>
        <div class="right-top-m-btn">
@@ -654,9 +661,10 @@
      countDownMinute: 0,
      Arr: [],
      // 记录定时器状态
      procInfoTimer: [null, null],
      procInfoTimer: null,
      cutdownTimer: null,
      TaskCount:0,
      plcStatus:1,
    };
  },
  mounted() {
@@ -743,6 +751,16 @@
        return "";
      }
    },
    // 格式化时间 ==> yyyy-mm-dd
    formatDate2(value) {
      if (value) {
        const now = value ? new Date(value * 1000) : new Date();
        let time = this.getDateObj(now, "yyyy/MM/dd hh:mm:ss");
        return time;
      } else {
        return "";
      }
    },
    getDate3() {
      let now = new Date();
      this.formatTime3 = this.getDateObj(now, "hh:mm");
@@ -750,6 +768,24 @@
    getDate2() {
      let now = new Date();
      this.formatTime2 = this.getDateObj(now, "yyyy年MM月dd日");
    },
    getFormatTime(date){
      const getCha=()=>{
        let now=new Date().getTime()
        let String=now-date*1000;
        let seconds=Math.floor(String/1000)
        let minutes=Math.floor(seconds/60)
        let days=Math.floor(String/1000/60/60/24)
        let hours=Math.floor(minutes/60)-days*24
        let m=minutes-days*24*60-hours*60
        return days+'天'+hours+'时'+m+'分'
      }
      let d= getCha()
      setInterval(() => {
       d= getCha();
      }, 6000);
      return d;
    },
    setInterCard(value, name, i) {
      if (this.Tasks[i].Procedure.procedure[value]) {
@@ -797,7 +833,7 @@
      };
      this.Tasks = [];
      getTaskInfo({ page: 1, pageSize: this.activeName }).then((res) => {
        if (res.code == 200) {
        if (res.code == 200&&res.data) {
          let arr=[]
          if(res.data.Tasks){
           arr.sort(function(a,b){
@@ -831,6 +867,7 @@
                ...this.Tasks[i].Procedure.procedure,
              },
            ]);
            if (this.Tasks[i].Procedure.ID) {
              startTask({ id: this.Tasks[i].Procedure.ID }).then((res) => {
                if (res.code == 200) {
@@ -838,22 +875,20 @@
                  this.Tasks[i].procedureList[0].push({
                    number: res.data.Number,
                    name: "工艺",
                    Arr:res.data.Params ? res.data.Params : [],
                  });
                  if (i == 0) {
                    this.Arr = res.data.Params ? res.data.Params : [];
                    this.taskData=this.Tasks[i]
                  }
                }
              });
              this.getProgressInfo(i);
              if (!this.procInfoTimer[i]) {
                this.procInfoTimer[i] = setInterval(() => {
                  this.getProgressInfo(i);
                }, 6000);
              }
            }
            this.setInterCard("inputMaterials", "cardBox1&" + i, i);
            this.setInterCard("outputMaterials", "cardBox3&" + i, i);
          }
          this.getStartArr()
          this.getProgressInfo();
              if (!this.procInfoTimer) {
                this.procInfoTimer = setInterval(() => {
                  this.getProgressInfo();
                }, 9000);
          }
        }
        if (res.code != 200 || this.Tasks.length == 0) {
@@ -867,17 +902,30 @@
        }
      });
    },
    getProgressInfo(i) {
      getProgress({
        position: Number(i),
        procedureId: this.Tasks[i].Procedure.ID,
      }).then((res) => {
        if (res.code == 200) {
          this.Tasks[i].finishNumber = res.data.finishNumber
            ? res.data.finishNumber
            : 0;
    getStartArr(){
      for (let i in this.Tasks) {
        if (this.Tasks[i].Procedure.Status==1) {
            this.Arr = this.Tasks[i].procedureList[0].Arr ?this.Tasks[i].procedureList[0].Arr: [];
            this.taskData=this.Tasks[i];
            break;
        }
      });
      }
    },
    getProgressInfo() {
      for (let i in this.Tasks){
        getProgress({
          position: Number(i),
          procedureId: this.Tasks[i].Procedure.ID,
        }).then((res) => {
          if (res.code == 200) {
            this.Tasks[i].finishNumber = res.data.finishNumber
              ? res.data.finishNumber
              : 0;
              this.plcStatus=res.data.plcStatus?res.data.plcStatus:1
          }
        });
      }
    },
    // 设置
    setUrl() {
@@ -892,7 +940,12 @@
    // 右侧控制
    controlClick() {
      if (this.Tasks.length > 0) {
        this.$refs.control.islook = true;
        for(let i in this.Tasks){
          if(this.Tasks[i].Procedure.Status==1){
            this.$refs.control.islook = true;
            break;
          }
        }
      } else {
        this.$message.error("当前设备没有工序!");
      }
@@ -924,20 +977,23 @@
<style lang="scss">
.active-one {
  width: 100%;
  height: 100%;
  height: calc(100% - 100px);
  .statelist {
    height: 50px;
  }
  .small_title {
    margin-bottom: 20px;
  }
  .content {
    height: 240px;
  }
  .bottom {
    height: calc(100% - 500px - 30px);
    height: calc(100% - 410px);
  }
}
.active-two {
  width: calc(50% - 10px);
  height: 100%;
  height: calc(100% - 100px);
  float: left;
  padding-left: 10px;
  &:nth-of-type(1) {
@@ -946,8 +1002,14 @@
    box-sizing: border-box;
    border-right: 1px solid #eee;
  }
  .small_title {
    margin-bottom: 30px;
  }
  .statelist {
    height: 60px;
   .title-item{
    font-size:14px!important;
   }
  }
  .title-item > span {
    display: block;
@@ -957,27 +1019,54 @@
    height: 370px;
    .content-top {
      height: calc(50% - 60px) !important;
      padding-top: 50px !important;
      height: calc(50% - 20px) !important;
      padding-top: 10px !important;
    }
    .el-descriptions__body {
      font-size: 16px !important;
    }
  }
  .bottom {
    height: calc(100% - 630px - 50px);
    height: calc(100% - 560px);
  }
  .bottom_list .bottom-title {
    font-size: 18px;
    font-size: 16px;
  }
}
.gong-date{
 width:100%;
 height:20px;
 line-height:20px;
 margin-bottom:10px;
 font-size:16px;
}
.gongx{
  width:100%;
  height:30px;
  margin-bottom:10px;
   .el-steps--simple{
    background:transparent;
    padding:5px 10px;
  height:50px;
  overflow-x:auto;
  // overflow-y:hidden;
  margin-top:-5px;
  .steps{
    height:100%;
    .el-step__icon{
      width:16px;
      height:16px;
    }
    .el-step__title{
      line-height:25px;
      font-size:14px;
    }
  }
  .el-step{
    .el-step__icon{
     background:#00cc66;
    }
    .is-wait{
      .el-step__icon{
        background:#fff;
      }
    }
  }
  .el-step__head.is-process{
    color: #00cc66 !important;
@@ -1068,7 +1157,12 @@
  font-size: 30px;
  font-weight: 700;
}
.color_666{
  color:#666!important;
}
.color_fff{
  color:#fff!important;
}
.color_4efefa {
  color: #4efefa;
}
@@ -1095,7 +1189,7 @@
  position: relative;
  padding: 10px;
  width: 30%;
  height: 100%;
  height: calc(100% - 20px);
  border-radius: 6px;
  background: rgb(22 72 173);
  // float:left;
@@ -1104,7 +1198,7 @@
    font-size: 22px;
    height: 30px;
    line-height: 30px;
    margin-bottom: 30px;
    margin-bottom: 5px;
    .el-button--primary {
      color: #fff;
      float: right;
@@ -1146,14 +1240,18 @@
  .card-box {
    width: 100%;
    height: calc(100% - 50px - 50px);
    // overflow:auto;
    // height:300px;
    .el-carousel__container{
      overflow-y:auto;
    }
    // .el-carousel__item{
    //   min-height:116px;
    // }
  }
}
.small_title {
  font-size: 24px;
  margin-bottom: 10px;
  font-size: 20px;
}
.right-small-btn {
  margin-top: 10px;
@@ -1200,19 +1298,23 @@
    .title {
      font-size: 30px;
      font-weight: 600;
      height:40px;
      margin:10px 0 30px;
      text-align: center;
      .el-badge__content, .el-progress.is-exception .el-progress-bar__inner{
        background-color:green;
      }
    }
    .statelist {
      width: 100%;
      margin: 0 auto 20px;
      margin: 0 auto 10px;
      flex-wrap: nowrap;
      align-content: center;
      justify-content: space-around;
      align-items: center;
      .title-item {
        width: calc(25% - 50px);
        width: calc(33.333% - 50px);
        float: left;
        margin-right: 10px;
        padding: 15px 20px;
@@ -1229,7 +1331,7 @@
    }
    .content {
      width: 100%;
      margin: 0px 0px 30px;
      margin: 0px 0px 20px;
      overflow: hidden;
      .content_left {
        width: 24%;
@@ -1238,8 +1340,8 @@
        // padding:2%;
        .content-top {
          background: rgb(22 72 173);
          height: calc(50% - 30px);
          padding-top: 20px;
          height: calc(50% - 20px);
          padding-top: 10px;
          text-align: center;
          line-height: 30px;
          border-radius: 6px;
@@ -1467,9 +1569,19 @@
      line-height: 50px;
      font-weight: 700;
      font-size: 18px;
      padding: 0 4%;
      padding: 0 3%;
      overflow-x: hidden;
      margin-left: -4%;
      margin-left: -3%;
      span{
        display:inline-block;
        img{
          width:23px;
          vertical-align: middle;
          // float:left;
          display:inline-block;
        }
      }
      .yuandian {
        width: 25px;
        height: 25px;
@@ -1494,15 +1606,16 @@
      }
    }
    .right_dutyLst {
      width: calc(100% - 20px);
      width: calc(106% - 20px);
      // height: 270px;
      height: 310px;
      border-radius: 4px;
      line-height: 30px;
      overflow: hidden;
      // background: #00cc66;
      background: #4565c9;
      margin-top: 10px;
      padding: 5px 10px;
      margin-left:-3%;
      position: relative;
      .right-small-title {
        width: auto;