1
huangxiaoqiang
10 天以前 8e49faa42ff419efa0641478702ce7d5f8455bd9
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Client/src/views/LineInfocopy.vue
@@ -1,10 +1,11 @@
<template>
      <div :class="update()" :style="{ left: left, top: top, marginBottom:0+'px',marginTop:15+'px'} " @click="mouseClick" v-loading.fullscreen.lock="fullscreenLoading">
   <div :class="update()" :style="{ left: left, top: top, marginBottom: 0 + 'px', marginTop: 15 + 'px' }"
      @click="mouseClick" v-loading.fullscreen.lock="fullscreenLoading">
      <img v-if="imgType === '2'" src="../../public/lines.png" />
      <img v-if="imgType === '1'" src="../../public/lines2.png" />
      <label v-if="equipNo" class="equip-no">{{ equipNo }}</label>
   </div>
   <el-dialog v-model="dialogVisible" title="信息查看" :before-close="handleClose">
   <el-dialog v-model="dialogVisible" title="输送线信息查看" :before-close="handleClose">
      <el-form ref="$form" :model="lineItemInfo" label-position="left" label-width="100px" 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">
@@ -14,26 +15,78 @@
            </el-col>
            <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div">
               <el-form-item label="是否有盘:">
                  <j-el-description :value="lineItemInfo.r_Line_HasPallet" type="primary"
                     ellipsis></j-el-description>
                  <j-el-description :value="lineItemInfo.r_Line_HasPallet" 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">
            <el-col :span="12" :offset="0" :push="0" :pull="0" tag="div">
               <el-form-item label="托盘条码:">
                  <j-el-description :value="lineItemInfo.r_Line_Barcode" type="primary"
                     ellipsis></j-el-description>
                  <j-el-description :value="lineItemInfo.r_Line_Barcode" 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="lineItemInfo.r_Line_ErrorCode" type="primary"
                     ellipsis></j-el-description>
                  <j-el-description :value="lineItemInfo.r_Line_ErrorCode" type="primary" ellipsis></j-el-description>
               </el-form-item>
            </el-col>
         </el-row>
      </el-form><el-divider />
      <h4 style="margin-bottom: 20px;">手动操作</h4>
      <el-form ref="form" :model="form" label-width="100px">
         <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="1" />
                     <el-option label="出库" value="2" />
                  </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" 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="4" :offset="0" :push="0" :pull="0" tag="div">
            <el-button type="primary" size="small" plain @click="SendCommand">
               <i class="el-icon-check">发送命令</i>
            </el-button>
         </el-col>
         <el-col :span="4" :offset="0" :push="0" :pull="0" tag="div">
            <el-button type="warning" size="small" plain @click="ConveyorLineReset">
               <i class="el-icon-check">复位</i>
            </el-button>
         </el-col>
         <el-col :span="4" :offset="0" :push="0" :pull="0" tag="div">
            <el-button type="danger" size="small" plain @click="ConveyorLineEmergencyStop">
               <i class="el-icon-check">停止</i>
            </el-button>
         </el-col>
         <el-col :span="4" :offset="0" :push="0" :pull="0" tag="div">
            <el-button type="danger" size="small" plain @click="ConveyorLineReturn">
               <i class="el-icon-check">退回</i>
            </el-button>
         </el-col>
         <el-col :span="4" :offset="0" :push="0" :pull="0" tag="div">
            <el-button type="danger" size="small" plain @click="ConveyorLineCancel">
               <i class="el-icon-check">取消任务</i>
            </el-button>
         </el-col>
         <el-col :span="4" :offset="0" :push="0" :pull="0" tag="div">
            <el-button type="danger" size="small" plain @click="ConveyorLineInitialize">
               <i class="el-icon-check">工位初始化</i>
            </el-button>
         </el-col>
      </el-row>
      <template #footer>
         <div class="dialog-footer">
            <el-button @click="dialogVisible = false">取消</el-button>
@@ -77,7 +130,7 @@
         type: String,
         default: "",
      },
      condition:{
      condition: {
         type: Boolean,
         default: false,
      },
@@ -94,6 +147,11 @@
            r_Line_ErrorCode: "",
            r_Line_Target: "",
         },
         form: {
            TaskType: "",
            TargetAddress: "",
            DeviceCode: "",
         },
      };
   },
   mounted() {
@@ -109,25 +167,110 @@
         this.fullscreenLoading = true;
         this.dialogVisible = true;
         // å¤„理点击事件
         if (this.url != "") {
            this.http.post(this.url + "?equipNo=" + this.equipNo, null, "")
               .then((x) => {
                  if (x.status) {
                     this.lineItemInfo = x.data;
                  } else {
                     this.$message({
                        type: "error",
                        message: x.message,
                     });
                  }
               });
         }
         this.http.post("api/DeviceInfo/GetConveyorLineInfo?DeviceChildCode=" + this.equipNo, null, "")
            .then((x) => {
               if (x.status) {
                  this.lineItemInfo = x.data;
               } else {
                  this.$message({
                     type: "error",
                     message: x.message,
                  });
               }
            });
         this.fullscreenLoading = false;
         // this.dialogVisible = false;
      },
      update(){
          return !this.condition ? 'custom-img' : 'custom-img-color'
      SendCommand() {
         this.fullscreenLoading = true;
         this.form.DeviceCode=this.equipNo;
         this.http.post("api/DeviceInfo/ConveyorLineHandTask" ,this.form)
            .then((x) => {
               if (!x.status) {
                  this.$message.error(x.message);
               } else {
                  this.$Message.success(x.message);
               }
            })
            .finally(() => {
               this.fullscreenLoading = false;
            });
      },
      ConveyorLineReset() {
         this.fullscreenLoading = true;
         this.http.post("api/DeviceInfo/ConveyorLineReset?DeviceChildCode=" + this.equipNo, null, "")
            .then((x) => {
               if (!x.status) {
                  this.$message.error(x.message);
               } else {
                  this.$Message.success(x.message);
               }
            })
            .finally(() => {
               this.fullscreenLoading = false;
            });
      },
      ConveyorLineEmergencyStop() {
         this.fullscreenLoading = true;
         this.http.post("api/DeviceInfo/ConveyorLineEmergencyStop?DeviceChildCode=" + this.equipNo, null, "")
            .then((x) => {
               if (!x.status) {
                  this.$message.error(x.message);
               } else {
                  this.$Message.success(x.message);
               }
            })
            .finally(() => {
               this.fullscreenLoading = false;
            });
      },
      ConveyorLineReturn() {
         this.fullscreenLoading = true;
         this.http.post("api/DeviceInfo/ConveyorLineReturn?DeviceChildCode=" + this.equipNo, null, "")
            .then((x) => {
               if (!x.status) {
                  this.$message.error(x.message);
               } else {
                  this.$Message.success(x.message);
               }
            })
            .finally(() => {
               this.fullscreenLoading = false;
            });
      },
      ConveyorLineCancel() {
         this.fullscreenLoading = true;
         this.http.post("api/DeviceInfo/ConveyorLineCancel?DeviceChildCode=" + this.equipNo, null, "")
            .then((x) => {
               if (!x.status) {
                  this.$message.error(x.message);
               } else {
                  this.$Message.success(x.message);
               }
            })
            .finally(() => {
               this.fullscreenLoading = false;
            });
      },
      ConveyorLineInitialize() {
         this.fullscreenLoading = true;
         this.http.post("api/DeviceInfo/ConveyorLineInitialize?DeviceChildCode=" + this.equipNo, null, "")
            .then((x) => {
               if (!x.status) {
                  this.$message.error(x.message);
               } else {
                  this.$Message.success(x.message);
               }
            })
            .finally(() => {
               this.fullscreenLoading = false;
            });
      },
      update() {
         return !this.condition ? 'custom-img' : 'custom-img-color'
      },
      startTimer() {
         // å¼€å¯å®šæ—¶å™¨ï¼Œæ¯3秒执行一次
@@ -145,10 +288,11 @@
   display: inline-block;
   /* background-color:  #d9ecff ; */
}
.custom-img-color {
   position: relative;
   display: inline-block;
   background-color:  #05fa7f ;
   background-color: #05fa7f;
   color: white;
   text-align: center;
}
@@ -168,6 +312,7 @@
   width: 40px;
   height: 40px;
}
.custom-img-color img {
   width: 40px;
   height: 40px;