huangxiaoqiang
2025-07-30 4110b7475eccf48283ff22c0e4545850849d445d
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Client/src/views/LineComponent.vue
@@ -20,7 +20,9 @@
  <div class="line-container">
    <div class="line"></div>
    <!-- <div class="dot" :style="{ right: dotPosition + 'px' }" ref="childDot" @click="mouseClick"></div> -->
    <div :class="update()" :style="{ transform: `translateX(${StackerCrane.CurrentColumn<33?StackerCrane.CurrentColumn * 30-29:0}px)` }" ref="childDot" @click="mouseClick"></div>
    <div :class="update()"
      :style="{ transform: `translateX(${StackerCrane.CurrentColumn < 33 ? StackerCrane.CurrentColumn * 30 - 29 : 0}px)` }"
      ref="childDot" @click="mouseClick"></div>
  </div>
  <div>
    <el-row style="padding-top: 5px;">
@@ -41,19 +43,17 @@
    </el-row>
  </div>
  <el-dialog v-model="dialogVisible" title="信息查看" :before-close="handleClose">
    <el-form ref="$form" :model="StackerCrane" label-position="left" label-width="100px" size="medium">
  <el-dialog v-model="dialogVisible" title="堆垛机信息查看" :before-close="handleClose">
    <el-form ref="$form" :model="StackerCrane" label-position="left" label-width="120px" size="medium">
      <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
        <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div">
          <el-form-item label="设备编号:">
            <!-- <el-input v-model="equipNo"></el-input> -->
            <j-el-description :value="StackerCrane.DeviceName" type="primary" ellipsis></j-el-description>
          </el-form-item>
        </el-col>
        <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div">
          <el-form-item label="设备状态:">
            <j-el-description :value="StackerCrane.Fault" type="primary"
              ellipsis></j-el-description>
            <j-el-description :value="StackerCrane.Fault" type="primary" ellipsis></j-el-description>
          </el-form-item>
        </el-col>
      </el-row>
@@ -69,7 +69,7 @@
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
      <el-row :gutter="20" type="flex" justify="start" align="top" tag="div" style="margin-bottom: 10px;">
        <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div">
          <el-form-item label="作业状态:">
            <j-el-description :value="StackerCrane.Running" type="primary" ellipsis></j-el-description>
@@ -81,6 +81,64 @@
              :value="StackerCrane.CurrentRow + '-' + StackerCrane.CurrentColumn + '-' + StackerCrane.CurrentLayer"
              type="primary" ellipsis></j-el-description>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20" type="flex" justify="start" align="top" tag="div" style="margin-bottom: 10px;">
        <el-col :span="24" :offset="0" :push="0" :pull="0" tag="div">
          <el-form-item label="报警信息:">
            <j-el-description :value="StackerCrane.StackerAlarm" type="primary" ellipsis></j-el-description>
          </el-form-item>
        </el-col>
      </el-row>
      <el-divider />
      <h4 style="margin-bottom: 50px;">手动操作</h4>
      <el-form ref="form" :model="form" label-width="90px">
        <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
          <el-col :span="16" :offset="0" :push="0" :pull="0" tag="div">
            <el-form-item label="任务命令"  prop="TargetAddress">
              <el-select size="large" v-model="form.TaskType" placeholder="请选择任务命令">
                <el-option label="入库" value="17" />
                <el-option label="出库" value="18" />
                <el-option label="移库" value="20" />
                <el-option label="取货" value="24" />
                <el-option label="放货" value="48" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
          <el-col :span="16" :offset="0" :push="0" :pull="0" tag="div">
            <el-form-item label="起点行列层:">
              <el-input size="large" v-model="form.SourceAddress" style="width: 800px" placeholder="请输入起点行列层" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
          <el-col :span="16" :offset="0" :push="0" :pull="0" tag="div">
            <el-form-item label="终点行列层:">
              <el-input size="large" v-model="form.TargetAddress" style="width: 800px" placeholder="请输入终点行列层" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <el-divider />
      <el-row :gutter="20" type="flex" justify="start" align="top" tag="div">
        <el-col :span="8" :offset="0" :push="0" :pull="0" tag="div">
          <el-button type="primary" size="small" plain @click="start">
            <i class="el-icon-check">启动</i>
          </el-button>
        </el-col>
        <el-col :span="8" :offset="0" :push="0" :pull="0" tag="div">
          <el-button type="warning" size="small" plain @click="reset">
            <i class="el-icon-check">复位</i>
          </el-button>
        </el-col>
        <el-col :span="8" :offset="0" :push="0" :pull="0" tag="div">
          <el-button type="danger" size="small" plain @click="emergencyStop">
            <i class="el-icon-check">急停</i>
          </el-button>
        </el-col>
      </el-row>
    </el-form>
@@ -116,7 +174,15 @@
        CurrentTaskNum: "",
        Running: "",
        DeviceName: "",
      }
        DeviceCode: "",
        StackerAlarm:"",
      },
      form: {
        TaskType: "",
        SourceAddress: "",
        TargetAddress: "",
        DeviceCode: "",
      },
    };
  },
  props: {
@@ -135,31 +201,84 @@
  },
  methods: {
    moveDot(x) {
        this.StackerCrane.Automatic=x.Automatic==null?"故障":x.Automatic;
            this.StackerCrane.Fault=x.Fault==null?"故障":x.Fault;
            this.StackerCrane.Running=x.Running==null?"故障":x.Running;
            this.StackerCrane.CurrentColumn=x.CurrentColumn==undefined?1:x.CurrentColumn;
            this.StackerCrane.CurrentLayer=x.CurrentLayer==undefined?1:x.CurrentLayer;
            this.StackerCrane.LevelPoint=x.LevelPoint;
            this.StackerCrane.DeviceName=x.DeviceName;
      this.StackerCrane.Automatic = x.Automatic == null ? "故障" : x.Automatic;
      this.StackerCrane.Fault = x.Fault == null ? "故障" : x.Fault;
      this.StackerCrane.Running = x.Running == null ? "故障" : x.Running;
      this.StackerCrane.CurrentColumn = x.CurrentColumn == undefined ? 1 : x.CurrentColumn;
      this.StackerCrane.CurrentLayer = x.CurrentLayer == undefined ? 1 : x.CurrentLayer;
      this.StackerCrane.LevelPoint = x.LevelPoint;
      this.StackerCrane.DeviceName = x.DeviceName;
      this.StackerCrane.StackerAlarm = x.StackerAlarm;
      this.form.DeviceCode = x.DeviceCode;
    },
    update(){
        if(this.StackerCrane.Automatic&&!this.StackerCrane.Fault&&!this.StackerCrane.Running){
          return 'dot-Automatic ';
        }
        else if(!this.StackerCrane.Fault&&this.StackerCrane.Running){
          return 'dot-Running ';
        }else if(this.StackerCrane.Fault){
          return 'dot-Fault ';
        }else{
          return 'dot-Fault ';
        }
      },
    update() {
      if (this.StackerCrane.Automatic == "联机模式" && this.StackerCrane.Fault != "故障" && this.StackerCrane.Running == "待机") {
        return 'dot-Automatic ';
      }
      else if (this.StackerCrane.Automatic == "联机模式" && this.StackerCrane.Fault != "故障" && this.StackerCrane.Running == "运行中") {
        return 'dot-Running ';
      } else if (this.StackerCrane.Fault == "故障") {
        return 'dot-Fault ';
      } else {
        return 'dot-Fault ';
      }
    },
    mouseClick() {
      this.fullscreenLoading = true;
      this.dialogVisible = true;
      this.fullscreenLoading = false;
    },
    start() {
      this.fullscreenLoading = true;
      this.http.post("api/DeviceInfo/StackerHandTask", this.form)
        .then((x) => {
          if (!x.status) {
            this.$message.error(x.message);
          } else {
            this.$Message.success("堆垛机命令已下发");
            // $vue.success("成功.");
            this.show = false;
            $vue.refresh();
          }
        })
        .finally(() => {
          this.fullscreenLoading = false;
        });
    }, reset() {
      this.fullscreenLoading = true;
      this.http.post("api/DeviceInfo/StackerReset?DeviceCode=" + this.form.DeviceCode)
        .then((x) => {
          if (!x.status) {
            this.$message.error(x.message);
          } else {
            this.$Message.success("复位成功");
            // $vue.success("成功.");
            this.show = false;
            $vue.refresh();
          }
        })
        .finally(() => {
          this.fullscreenLoading = false;
        });
    },
    emergencyStop() {
      this.fullscreenLoading = true;
      this.http.post("api/DeviceInfo/StackerEmergencyStop?DeviceCode=" + this.form.DeviceCode)
        .then((x) => {
          if (!x.status) {
            this.$message.error(x.message);
          } else {
            this.$Message.success("急停已按下");
            // $vue.success("成功.");
            // this.show = false;
            // $vue.refresh();
          }
        })
        .finally(() => {
          this.fullscreenLoading = false;
        });
    }
  },
};
</script>
@@ -196,6 +315,7 @@
  font-weight: bold;
  color: white;
}
.dot-Automatic {
  position: absolute;
  top: -5px;