Przeglądaj źródła

MES代办页面处理

oyq28 1 miesiąc temu
rodzic
commit
bca8a877ba

+ 474 - 0
imcs-ui/src/views/zuihou/runManageCenter/mesNotice/Index.vue

@@ -0,0 +1,474 @@
+<template>
+  <div class="app-container">
+		<!-- 搜索模块 -->
+    <div class="filter-container">
+    	<span>
+    		<span>{{$t("lineSide.searchForm.name")}}:</span>
+    		<el-input v-model="queryParams.model.orderNo" :placeholder='$t("common.pleaseEnter")' style="width: 150px;" size="medium"/>
+    	</span>
+    	<span>
+    		<span>{{$t("resource.searchForm.startEndTime")}}:</span>
+    		<el-date-picker
+		      v-model="queryParams.timeRange"
+		      type="daterange"
+		      :picker-options="pickerOptions"
+		      :range-separator='$t("common.separator")'
+		      :start-placeholder='$t("common.startTime")'
+		      :end-placeholder='$t("common.endTime")'
+		      format="yyyy-MM-dd"
+			    value-format="yyyy-MM-dd"
+		      align="right">
+		    </el-date-picker>
+    	</span>
+    	<!--<span style="margin-left: 15px;">
+    		<span>{{$t("lineSide.common.type")}}:</span>
+    		<el-select v-model="queryParams.model.optType" :placeholder='$t("common.pleaseSelect")' size="medium" style="width: 150px;">
+        	<el-option
+			      v-for="item in audioStatus"
+			      :key="item.value"
+			      :label="item.label"
+			      :value="item.value">
+			    </el-option>
+      	</el-select>
+    	</span>-->
+      <span style="margin-left: 15px;">
+	      <el-button plain type="primary" icon="el-icon-search" size="medium" @click="search">
+	        {{ $t("table.search") }}
+	      </el-button>
+	      <el-button plain type="warning" icon="el-icon-refresh" size="medium" @click="reset">
+	        {{ $t("table.reset") }}
+	      </el-button>
+      </span>
+    </div>
+    
+    <!-- 功能按钮 -->
+    <el-row class="filter-container">
+    	<el-col>
+    		<el-button v-has-permission="['mesNotice:delete']" type="danger" icon="el-icon-delete" size="medium" @click="batchDelete">
+	        {{ $t("table.delete") }}
+	      </el-button>
+    		<el-button v-show="false" type="primary" icon="el-icon-plus" size="medium" @click="marking">{{ $t("developer.buttons.marking") }}</el-button>
+	      <!--<el-button type="success" icon="el-icon-edit" size="medium" @click="editOne">
+	        {{ $t("common.edit") }}
+	      </el-button>-->
+    	</el-col>
+    </el-row>
+	    
+		<!-- 列表数据 -->
+    <el-table
+      :key="tableKey"
+      ref="table"
+      v-loading="loading"
+      :data="tableData.records"
+      border
+      fit
+      row-key="id"
+      style="width: 100%;"
+      @selection-change="onSelectChange"
+      @cell-click="cellClick"
+    >
+    	<!-- 序号 -->
+    	<el-table-column :label='$t("common.serialNo")' width="55px" align="center">
+	      <template slot-scope="scope">
+	        <div>
+	          {{scope.$index+(queryParams.current - 1) * queryParams.size + 1}}
+	        </div>
+	      </template>
+      </el-table-column>
+      <!-- CheckBox -->
+      <el-table-column align="center" type="selection" width="50" :reserve-selection="true" />
+      <!-- 编码 -->
+      <el-table-column prop="orderNo" label='订单编号' :show-overflow-tooltip="true" width="160"></el-table-column>
+      <!-- 设备 -->
+      <el-table-column prop="buType" label='业务类型' width="120" >
+		<template slot-scope="{ row }">			
+			 <div v-for="item in buTypeList" :key="item.value" :value="item" >				
+			 <el-tag v-if="item.value == row.buType">{{ item.text }}</el-tag>
+			 </div>
+		  </template>
+	  </el-table-column>
+
+	  <el-table-column prop="apiType" label='接口类型' width="200" >
+		  <template slot-scope="{ row }">			
+			 <div v-for="item in apiTypeList" :key="item.value" :value="item" >				
+			 <el-tag v-if="item.value == row.apiType">{{ item.text }}</el-tag>
+			 </div>
+		  </template>
+	  </el-table-column>
+      <!-- 报警内容 -->
+      <el-table-column prop="lineCode"  label='产线编码' width="100"></el-table-column>
+      <!-- 报警时间 -->
+      <el-table-column prop="createTime" label='创建时间' width="160px"></el-table-column>
+      <!-- 是否需要人员处理 -->
+      <el-table-column prop="apiAddress" label='接口地址' align="center" width="200px"></el-table-column>
+      <!-- 处理状态 -->
+      <el-table-column prop="status" label='状态' align="center" width="120px">
+      	<template slot-scope="{ row }">
+      		    <el-tag v-if="row.status == '0'" type="failed">已处理</el-tag>
+	      	    <el-tag v-if="row.status == '1'" type="success">未处理</el-tag>
+					
+		</template>
+      </el-table-column>
+      <!-- 处理时间 -->
+      <el-table-column prop="updateTime" :label='$t("developer.table.warnLong.chuliTime")' width="160px">
+	     <template slot-scope="{ row }">
+	         <span v-if="row.status == '1'">{{row.updateTime}}</span>
+	     </template>
+	  </el-table-column>
+
+	  <el-table-column 	  		
+	       :label="$t('table.operation')"
+		   fixed="right"
+		    align="center"
+		    column-key="operation"
+		    width="85px">
+			<template slot-scope="{ row }">		        	
+				  <el-tooltip class="item" content='执行处理' effect="dark" placement="top-start" v-if="row.status=='1'">
+			          <i
+					    v-if="row.children"
+			            class="el-icon-bell table-operation"
+			            style="color: #87d068;"
+			            @click="updateStatus(row)"
+			          />
+		          </el-tooltip>
+				  <el-tooltip class="item" content='页面跳转' effect="dark" placement="top-start" v-if="row.status=='0'">
+			          <i
+			            class="el-icon-bell table-operation"
+			            style="color: #87d068;"
+			            @click="redirect(row)"
+			          />
+		          </el-tooltip>
+				  <el-tooltip class="item" content='文件下载' effect="dark" placement="top-start" v-if="row.status=='2'">
+			          <i
+					    v-if="row.children"
+			            class="el-icon-download table-operation"
+			            style="color: #87d068;"
+			            @click="download(row)"
+			          />
+		          </el-tooltip>
+		    </template>	
+	  </el-table-column>
+    </el-table>
+    <pagination
+      v-show="tableData.total > 0"
+      :limit.sync="queryParams.size"
+      :page.sync="queryParams.current"
+      :total="Number(tableData.total)"
+      @pagination="fetch"
+    />
+    <tenant-edit
+      ref="edit"
+      :dialog-visible="dialog.isVisible"
+      :title="dialog.title"
+      @close="editClose"
+      @success="editSuccess"
+    />
+    <tenant-view
+      ref="view"
+      :dialog-visible="tenantViewVisible"	  
+      @close="viewClose"
+    />
+    <el-dialog
+      v-el-drag-dialog
+      :close-on-click-modal="false"
+      :close-on-press-escape="true"
+      title="预览"
+      width="100%"
+      top="50px"
+	  customClass="customWidth"
+      :visible.sync="preview.isVisible"
+    >
+      <el-scrollbar>
+        <div v-html="preview.context" />
+      </el-scrollbar>
+    </el-dialog>
+  </div>
+</template>
+
+<script>    
+	import Pagination from "@/components/Pagination"
+	import TenantEdit from "./components/Edit"
+	import TenantView from "./components/View"
+	// 【锁定记录、出入库记录】-API
+	//import lockingRecordApi from "@/api/lineSideLibrary/lockingRecord"
+	import mesNoticeApi from "@/api/runManageCenter/mesNotice"
+	import elDragDialog from '@/directive/el-drag-dialog'
+	import { convertEnum } from '@/utils/utils'
+	import { downloadFile, initDicts, initQueryParams } from '@/utils/commons'
+	export default {
+	  name: "InOutRecord",
+	  directives: { elDragDialog },
+	  components: { Pagination, TenantEdit, TenantView },
+	  props: {
+	  },
+	  data () {
+	    return {
+	      audioStatus: [],
+	      dialog: {
+	        isVisible: false,
+	        title: ""
+	      },
+	      preview: {
+	        isVisible: false,
+	        context: ''
+	      },
+	      tenantViewVisible: false,		  
+	      tableKey: 0,
+	      queryParams: initQueryParams({}),
+	      selection: [],
+	      loading: false,
+	      tableData: {
+	        total: 0
+	      },
+	      dicts: {
+			API_TYPE: {}
+        },
+	      enums: {
+	        TenantTypeEnum: {},
+	        TenantStatusEnum: {}
+	      },
+	      pickerOptions: {
+          shortcuts: [{
+            text: '最近一周',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近一个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近三个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+              picker.$emit('pick', [start, end]);
+            }
+          }]
+        }
+	    }
+	  },
+	  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+	  created() {
+	  	// 调用常量-审核状态
+	  	this.audioStatus = this.$constWKS.OPTTYPE
+	  	// 加载【字典】
+	  	initDicts(['API_TYPE','BU_TYPE'], this.dicts);		
+	  	// 加载列表数据
+	  	this.fetch()
+		},
+	  computed: {
+	    currentUser () {
+	      return this.$store.state.account.user
+	    },
+	    apiTypeList() {
+        return convertEnum(this.dicts.API_TYPE)
+        },
+		buTypeList() {
+        return convertEnum(this.dicts.BU_TYPE)
+        }
+	  },
+	  mounted () {
+	    
+	  },
+	  methods: {
+	    viewClose () {
+	      this.tenantViewVisible = false
+	    },
+	    editClose () {
+	      this.dialog.isVisible = false
+	    },
+	    editSuccess () {
+	      this.search()
+	    },
+	    onSelectChange (selection) {
+	      this.selection = selection
+	    },
+	    search () {
+	      this.fetch({
+	        ...this.queryParams
+	      })
+	    },
+	    reset () {
+	      this.queryParams = initQueryParams({})
+	      this.$refs.table.clearSort()
+	      this.$refs.table.clearFilter()
+	      this.search()
+	    },
+	    add () {
+	      this.$refs.edit.type = "add"
+	      this.$refs.edit.setTenant(false, this.dicts)
+	      this.dialog.title = this.$t("common.add")
+	      this.dialog.isVisible = true
+	    },
+	    singleDelete (row) {
+	      this.$refs.table.clearSelection()
+	      this.$refs.table.toggleRowSelection(row, true)
+	      this.batchDelete()
+	    },
+	    batchDelete () {
+	      if (!this.selection.length) {
+	        this.$message({
+	          message: this.$t("tips.noDataSelected"),
+	          type: "warning"
+	        })
+	        return
+	      }
+	
+	      this.$confirm(this.$t("developer.tips.wareTips"), this.$t("common.tips"), {
+	      	distinguishCancelAndClose: true,
+	        confirmButtonText: this.$t("common.confirm"),
+	        cancelButtonText: this.$t("common.cancel"),
+	        type: "warning"
+	      }).then(() => {
+	      	const ids = []
+		      this.selection.forEach(item => {
+		        ids.push(item.id)
+		      })
+		      this.delete(ids)
+	      }).catch(() => {})
+	    },
+	    clearSelections () {
+	      this.$refs.table.clearSelection()
+	    },
+		view(row){
+			this.$refs.view.setTenant(row)
+			this.tenantViewVisible = true			
+		},
+		redirect(){
+
+		},
+		download(row){
+			//this.queryParams.model.orderNo = row.orderNo
+			mesNoticeApi.download({id:row.id}).then(response => {			
+			const res = response.data
+			if (res.isSuccess) {
+				this.$message({
+					message: '处理成功',
+					type: "success"
+				})				
+			} 
+			this.search()
+			//downloadFile(response);
+         })		
+		},
+		marking(){
+		   if (!this.selection.length) {
+	        this.$message({
+	          message: this.$t("tips.noDataSelected"),
+	          type: "warning"
+	        })
+	        return false
+	      }
+		  if (this.selection.length > 1) {
+	        this.$message({
+	          message: this.$t("tips.mustOne"),
+	          type: "warning"
+	        })
+			return
+		   }		    
+		   this.updateStatus(this.selection[0].id)	      		
+		},
+		updateStatus(row){	      
+			mesNoticeApi.updateStatus({id:row.id,orderNo:row.orderNo}).then(response => {
+			const res = response.data
+			if (res.isSuccess) {
+				this.$message({
+					message: '处理成功',
+					type: "success"
+				})
+				this.search()
+			}
+         })
+		},
+	    delete (ids) {
+			mesNoticeApi.remove({ ids: ids }).then(response => {
+	        const res = response.data
+	        if (res.isSuccess) {
+	          this.$message({
+	            message: this.$t("tips.deleteSuccess"),
+	            type: "success"
+	          })
+	          this.search()
+	          // 清理已经删除的数据
+	          this.$refs.table.clearSelection()
+	        }
+	      })
+	    },		
+	    // 【修改】表头上Btn-事件
+	    editOne() {
+	    	if (!this.selection.length) {
+	        this.$message({
+	          message: this.$t("tips.noDataSelected"),
+	          type: "warning"
+	        })
+	        return
+	      }
+	    	if (this.selection.length > 1) {
+	        this.$message({
+	          message: this.$t("tips.mustOne"),
+	          type: "warning"
+	        })
+	        return
+	      }
+	    	this.edit(this.selection[0]);
+	    },
+	    edit (row) {
+	      this.$refs.edit.setTenant(row, this.dicts)
+	      this.$refs.edit.type = "edit"
+	      this.dialog.title = this.$t("common.edit")
+	      this.dialog.isVisible = true
+	    },
+	    fetch (params = {}) {
+	      this.loading = true		  
+	      if (this.queryParams.timeRange) {
+	        this.queryParams.map.createTime_st = this.queryParams.timeRange[0]
+	        this.queryParams.map.createTime_ed = this.queryParams.timeRange[1]
+	      }
+		  let id = this.$route.query.id
+		  if(id!=null && id!=""){
+			this.queryParams.model.id = id
+		  }
+	
+	      this.queryParams.current = params.current ? params.current : this.queryParams.current
+	      this.queryParams.size = params.size ? params.size : this.queryParams.size
+	      // 固定参数:dataStatus = 1-入库/出库,2-解锁/锁定
+	      //this.queryParams.model.status = '1'		  
+	      mesNoticeApi.page(this.queryParams).then(response => {
+	        const res = response.data
+	        if (res.isSuccess) {
+	          this.tableData = res.data
+	        }
+	        // eslint-disable-next-line no-return-assign
+	      }).finally(() => this.loading = false)
+	     
+	    },
+	    cellClick (row, column) {
+	      if (column['columnKey'] === "operation") {
+	        return
+	      }
+	      let flag = false
+	      this.selection.forEach((item) => {
+	        if (item.id === row.id) {
+	          flag = true
+	          this.$refs.table.toggleRowSelection(row)
+	        }
+	      })
+	
+	      if (!flag) {
+	        this.$refs.table.toggleRowSelection(row, true)
+	      }
+	    }
+	  }
+	}
+</script>
+<style lang="scss" scoped>
+</style>

+ 201 - 0
imcs-ui/src/views/zuihou/runManageCenter/mesNotice/components/Edit.vue

@@ -0,0 +1,201 @@
+<template>
+  <el-dialog 
+  	:close-on-click-modal="false" 
+  	:close-on-press-escape="false" 
+  	:title="title" 
+  	:append-to-body="true"
+  	:visible.sync="isVisible" 
+  	:width="width" 
+  	top="50px"
+  >
+    <el-form ref="form" :model="tenant" :rules="rules" label-position="right" label-width="130px">
+      <el-form-item :label='$t("lineSide.form.name")' prop="name">
+          <el-input v-model="tenant.name" :placeholder='$t("common.pleaseEnter")'/>
+      </el-form-item>
+      <el-form-item :label='$t("lineSide.form.status")' prop="status">
+        <template>
+				  <el-radio v-model="tenant.status" label="1">{{$t("common.show")}}</el-radio>
+				  <el-radio v-model="tenant.status" label="0">{{$t("common.hide")}}</el-radio>
+				</template>
+      </el-form-item>
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <el-button plain type="warning" @click="isVisible = false">{{ $t('common.cancel') }}</el-button>
+      <el-button plain type="primary" :disabled="confirmDisabled" @click="submitForm">{{ $t('common.confirm') }}</el-button>
+    </div>
+  </el-dialog>
+</template>
+<script>
+// 【仓库类型管理】-API
+import warehouseTypeMgrApi from "@/api/modelingCenter/warehouseTypeMgr"
+
+export default {
+  name: 'TenantEdit',
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false
+    },
+    title: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      type: 'add',
+      tenant: this.initTenant(),
+      screenWidth: 0,
+      width: this.initWidth(),
+      confirmDisabled: false,
+      dicts:{
+        NATION: {}
+      },
+      roles: [],
+      rules: {
+        name: [
+        	{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
+        ]
+      }
+    }
+  },
+  computed: {
+    isVisible: {
+      get () {
+        return this.dialogVisible
+      },
+      set () {
+        this.close()
+        this.reset()
+      }
+    }
+  },
+  mounted () {
+    window.onresize = () => {
+      return (() => {
+        this.width = this.initWidth()
+      })()
+    }
+  },
+  methods: {
+    initTenant () {
+      return {
+        id: '',
+        name: '',
+        status: '1'
+      }
+    },
+    initWidth () {
+      this.screenWidth = document.body.clientWidth
+      if (this.screenWidth < 991) {
+        return '90%'
+      } else if (this.screenWidth < 1400) {
+        return '45%'
+      } else {
+        return '800px'
+      }
+    },
+    setTenant (val, dicts) {
+    	if(val){
+    		this.tenant = { ...val }
+    	}
+      // 字典表
+      this.dicts = dicts
+    },
+    close () {
+      this.$emit('close')
+    },
+    reset () {
+      // 先清除校验,再清除表单,不然有奇怪的bug
+      this.$refs.form.clearValidate()
+      this.$refs.form.resetFields()
+      this.tenant = this.initTenant()
+    },
+    submitForm () {
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          this.confirmDisabled = true
+          if (this.type === 'add') {
+            this.save()
+          } else {
+            this.update()
+          }
+        } else {
+          return false
+        }
+      })
+    },
+    save () {
+      warehouseTypeMgrApi.save(this.tenant)
+        .then((response) => {
+          const res = response.data
+          if (res.isSuccess) {
+            this.isVisible = false
+            this.$message({
+              message: this.$t('tips.createSuccess'),
+              type: 'success'
+            })
+            // 通知列表
+	          this.$emit("success");
+	          // 通知列表-并关闭弹出框
+	          this.$emit("close");
+          }
+        }).finally(() => {
+          this.confirmDisabled = false
+          return true
+        })
+    },
+    update () {
+      warehouseTypeMgrApi.update(this.tenant)
+        .then((response) => {
+          const res = response.data
+          if (res.isSuccess) {
+            this.isVisible = false
+            this.$message({
+              message: this.$t('tips.updateSuccess'),
+              type: 'success'
+            })
+            // 通知列表
+	          this.$emit("success");
+	          // 通知列表-并关闭弹出框
+	          this.$emit("close");
+          }
+        }).finally(() => {
+          this.confirmDisabled = false
+          return true
+        })
+    }
+
+  }
+}
+</script>
+<style lang="scss" >
+.avatar-uploader .el-upload {
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+}
+.avatar-uploader .el-upload:hover {
+  border-color: #409eff;
+}
+.avatar-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 100px;
+  height: 100px;
+  line-height: 100px;
+  text-align: center;
+}
+.avatar {
+  width: 100px;
+  height: 100px;
+  display: block;
+}
+.checkUsed{
+	display: inline-block;
+	margin-left: 10px;
+	color: #1890ff;
+}
+</style>

+ 461 - 0
imcs-ui/src/views/zuihou/runManageCenter/mesNotice/components/View.vue

@@ -0,0 +1,461 @@
+<template>
+  <el-dialog
+    :title="$t(&quot;common.view&quot;)"
+    :width="width"
+    :append-to-body="true"
+    :visible.sync="isVisible"
+    class="tenant-view"
+  >
+  
+   <div style="height: 800px;">
+   
+  <el-tabs :tab-position="tabPosition" style="height: 800px">
+    <el-tab-pane label="基础信息">
+
+      <el-row :gutter="12">
+      <el-col :xs="24" :sm="24">
+        <div class="view-item">
+          <i class="el-icon-user" />
+          <span>节点名称</span>
+          <h3>{{ tenant.nodeNo }}</h3>
+        </div>
+      </el-col>      
+    </el-row>
+    <el-row :gutter="12">
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-trophy" />
+          <span>执行设备</span>
+          <h3>{{tenant.category == '1' ? tenant.resourceName :(tenant.category== '2'? 'AGV': (tenant.category== '3'? tenant.zoneName+'机器人':'其它设备'))}}
+          </h3>
+        </div>
+      </el-col>
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-suitcase" />
+          <span>目标设备</span>
+          <h3>{{ tenant.resourceName }}</h3>
+        </div>
+      </el-col>     
+    </el-row>
+    <el-row  :gutter="12">
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-phone-outline" />
+          <span>操作状态</span>
+          <h3>指令{{tenant.exeStatus=='1'? "已发送":( tenant.exeStatus=='2'?'进行中':'已完成')}}</h3>
+        </div>
+      </el-col>
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-phone-outline" />
+          <span>结果状态</span>
+          <h3>结果执行{{ tenant.exeResult=='1'?'成功':(tenant.exeResult=='0'?'失败':'响应超时') }}</h3>
+        </div>
+      </el-col>
+    </el-row>
+    <el-row :gutter="12">
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-star-off" />
+          <span>异常反馈</span>
+          <h3>{{ tenant.feedback }}</h3>
+        </div>
+      </el-col>
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-bangzhu" />
+          <span>当前工序</span>
+          <h3>{{ tenant.procedureName }}</h3>          
+        </div>
+      </el-col>
+    </el-row>
+    <el-row :gutter="12">
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-time" />
+          <span>计划时间</span>
+          <h3>{{ dataList[1] && dataList[1].planTime||'无' }}</h3>
+        </div>
+      </el-col>
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-brush" />
+          <span>执行时间</span>
+          <h3>{{ dataList[1] && dataList[1].actualTime || '无' }}</h3>
+        </div>
+      </el-col>
+    </el-row>
+    <el-row :gutter="12">
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-time" />
+          <span>执行设备状态</span>
+          <h3>{{ dataList[1] && dataList[1].resourceStatus=="1"? "设备可用": "设备不可用" }}</h3>
+        </div>
+      </el-col>
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-brush" />
+          <span>执行设备工作状态</span>
+          <h3>{{ dataList[1] && dataList[1].onlineStatus=="1"? "设备在线":(dataList[1] && dataList[1].onlineStatus=='0'?'离线':(dataList[1] && dataList[1].onlineStatus=='2')?'加工中':'报警') }}</h3>
+        </div>
+      </el-col>
+    </el-row>
+    <el-row :gutter="18">
+      <el-col :xs="24" :sm="24">
+        <div class="view-item">
+          <i class="el-icon-date" />
+          <span>情况分析</span>         
+        </div>
+        <div class="view-item">
+          <el-alert v-if="tenant.exeResult=='0' && tenant.exeStatus=='1'" title="请求指令发送成功,执行设备操作未完成" type="error" :closable="false" effect="dark"> </el-alert>
+          <el-alert v-if="tenant.exeResult=='0' && tenant.exeStatus=='3'" title="执行设备操作已完成,但返回信号未确认成功" type="error" :closable="false" effect="dark"> </el-alert>
+          <el-alert v-if="tenant.exeResult==null" title="设备操作执行中返回信号中断或者丢弃" type="error" :closable="false" effect="dark"> </el-alert>
+          <el-alert v-if="dataList[1] && (dataList[1].resourceStatus=='0'|| dataList[1].onlineStatus=='3')" title="执行设备状态异常,请检查设备是否故障" type="error" :closable="false" effect="dark"> </el-alert>
+
+          <el-alert v-if="dataList[1] && dataList[1].onlineStatus=='0'" title="执行设备工作状态异常,请检查设备是否在线" type="error" :closable="false" effect="dark"> </el-alert>
+
+          <el-alert v-if="dataList[1] && dataList[1].onlineStatus=='2'" title="执行设备正在工作中,请耐心等待资源释放" type="warning" :closable="false" effect="dark"> </el-alert>
+
+        </div>
+      </el-col>      
+    </el-row>
+
+    </el-tab-pane>
+    <el-tab-pane label="关联信息">      
+      <el-card class="box-card">
+        <div slot="header" class="clearfix">
+            <span>前序节点</span>
+            <el-button style="float: right; padding: 3px 0" type="text"></el-button>
+        </div>
+        <div class="text item">
+          <el-row :gutter="12" >
+              <el-col :xs="24" :sm="8"  v-for="(key, index) in keys" :key="index">
+                <div class="view-item">
+                   <span>{{ key.value }}</span>  
+                   <h3>{{ dataList[0] && dataList[0][key.name]|| '无' }}</h3>
+                </div>                   
+              </el-col>
+              <el-col :xs="24" :sm="8">
+        <div class="view-item">
+          <i class="el-icon-phone-outline" />
+          <span>操作状态</span>
+          <h3>指令{{dataList[0] && dataList[0].exeStatus=='1'? "已发送":(dataList[0] && dataList[0].exeStatus=='2'?'进行中':'已完成')}}</h3>
+        </div>
+      </el-col>
+      <el-col :xs="24" :sm="8">
+        <div class="view-item">
+          <i class="el-icon-phone-outline" />
+          <span>结果状态</span>
+          <h3>结果执行{{dataList[0] && dataList[0].exeResult=='1'?'成功':(dataList[0] && dataList[0].exeResult=='0'?'失败':'响应超时') }}</h3>
+        </div>
+      </el-col>
+                
+          </el-row>
+       </div>
+      </el-card>      
+      <el-card class="box-card">
+        <div slot="header" class="clearfix">
+            <span>后序节点</span>
+            <el-button style="float: right; padding: 3px 0" type="text"></el-button>
+        </div>
+        <div class="text item">
+          <el-row :gutter="12" >
+              <el-col :xs="24" :sm="8"  v-for="(key, index) in keys" :key="index">
+                <div class="view-item">
+                   <span>{{ key.value }}</span>  
+                   <h3>{{ dataList[2] && dataList[2][key.name] || '无' }}</h3>
+                </div>                   
+              </el-col>
+              <el-col :xs="24" :sm="8">
+        <div class="view-item">
+          <i class="el-icon-phone-outline" />
+          <span>操作状态</span>
+          <h3>指令{{dataList[2] && dataList[2].exeStatus=='1'? "已发送":( dataList[2] && dataList[2].exeStatus=='2'?'进行中':'已完成')}}</h3>
+        </div>
+      </el-col>
+      <el-col :xs="24" :sm="8">
+        <div class="view-item">
+          <i class="el-icon-phone-outline" />
+          <span>结果状态</span>
+          <h3>结果执行{{ dataList[2] && dataList[2].exeResult=='1'?'成功':(dataList[2] && dataList[2].exeResult=='0'?'失败':'响应超时') }}</h3>
+        </div>
+      </el-col>  
+          </el-row>
+       </div>
+      </el-card>
+      <el-card class="box-card">
+        <div slot="header" class="clearfix">
+            <span>资源占用</span>
+            <el-button style="float: right; padding: 3px 0" type="text"></el-button>
+        </div>
+        <div class="text item" v-if="storageNodeList.data">
+          <el-row :gutter="12" >
+               <el-col :xs="24" :sm="8"  v-for="(taskNode, index) in storageNodeList.data" :key="index">
+                <div class="view-item">
+                   <span>占位节点及设备名</span>  
+                   <h3>{{ taskNode.nodeNo }}/ {{ taskNode.resourceName }}</h3>
+                </div>                   
+              </el-col>
+          </el-row>
+        </div>
+        <div class="text item" v-else><h3>执行设备未处于锁定状态中</h3></div>
+      </el-card>
+    </el-tab-pane>
+    <el-tab-pane label="解决策略">
+      <el-card class="box-card">
+        <div slot="header" class="clearfix">
+            <span>解决步骤</span>
+            <el-button style="float: right; padding: 3px 0" type="text"></el-button>
+        </div>
+        <div class="text item">
+          <el-steps :active="active" direction="vertical">
+            <el-step class="offset" title="准备工作" @click.native="clickStep(1)" description="查看节点以及前序节点状态,检查硬件是否正常工作"></el-step>
+            <el-step class="offset" title="切换手动"  @click.native="clickStep(2)" description="切换到手动模式(防止其它干扰因素的影响)"></el-step>
+            <el-step class="offset" title="命令处理" @click.native="clickStep(3)" description="依据指令的状态来考虑是否重发指令或是手动验证设备反馈"></el-step>
+            <el-step class="offset" title="切换自动" @click.native="clickStep(4)" description="节点异常问题解决,重新切换回自动状态"></el-step>
+          </el-steps>
+        </div>
+      </el-card>
+      <el-card class="box-card">
+        <div slot="header" class="clearfix">
+            <span>数据接口</span>
+            <el-button style="float: right; padding: 3px 0" type="text"></el-button>
+        </div>
+        <div class="text item">
+          <el-row :gutter="12" >
+            <el-col :xs="24" :sm="8">
+        <div class="view-item">
+          <i class="el-icon-time" />
+          <span>日志ID</span>
+          <el-input v-model="logId" :placeholder="tenant.id"></el-input>
+        </div>
+      </el-col>
+      <el-col :xs="24" :sm="8">
+        <div class="view-item">
+          <i class="el-icon-brush" />
+          <span>回调ID</span>
+          <el-input v-model="callbackId"  :placeholder="dataList[1]?dataList[1].taskNodeId:''"></el-input>
+        </div>
+      </el-col>
+      <el-col :xs="24" :sm="8">
+        <div class="view-item">
+          <i class="el-icon-brush" />
+          <span>设备ID</span>
+          <el-input v-model="deviceId" :placeholder="dataList[1]?dataList[1].deviceId:''"></el-input>
+        </div>
+      </el-col>      
+       <el-col :xs="24" :sm="8">
+        <div class="view-item">
+          <i class="el-icon-time" />
+          <span>指令重发</span>
+          <div class="btn">
+            <el-button type="primary" icon="el-icon-edit" :disabled="confirmDisabled" @click="resend(this.logId)">重发指令</el-button>
+          </div>
+        </div>
+      </el-col>
+      <el-col :xs="24" :sm="8">
+        <div class="view-item">
+          <i class="el-icon-brush" />
+          <span>校验回调</span>
+          <div class="btn">
+            <el-button type="primary" icon="el-icon-edit" :disabled="confirmDisabled" @click="nodeCallback(this.callbackId)">检验回调</el-button>
+          </div>  
+        </div>
+      </el-col>
+      <el-col :xs="24" :sm="8">
+        <div class="view-item">
+          <i class="el-icon-brush" />
+          <span>释放锁定设备</span>
+          <div class="btn">
+            <el-button type="primary" icon="el-icon-edit" :disabled="confirmDisabled" @click="freeLock(this.deviceId)">释放设备</el-button>
+          </div>
+        </div>
+      </el-col>
+      </el-row>
+    </div>
+  </el-card>
+      <el-card class="box-card">
+        <div slot="header" class="clearfix">
+            <span>求助</span>
+            <el-button style="float: right; padding: 3px 0" type="text"></el-button>
+        </div>
+        <div class="text item">
+             问题仍未解决,求助专业人员处理 
+        </div>
+      </el-card>  
+    </el-tab-pane>
+  </el-tabs>
+
+
+  </div>
+  </el-dialog>
+</template>
+<script>
+import warnLogApi from "@/api/lineSideLibrary/warnLog"
+export default {
+  name: 'TenantView',
+  filters: {
+    passwordErrorLockTimeFilter (time) {
+      if (time === '0') {
+        return '当天23点59分'
+      }
+      return time
+    }
+  },
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {     
+      screenWidth: 0,      
+      active: 1,
+      width: this.initWidth(),
+      dataList: [], 
+      storageNodeList:[],
+      confirmDisabled: false,
+      taskNodeId: '',
+      deviceId: '',
+      logId:'',
+      callbackId: '',
+      keys: [{name:'nodeName', value:'节点名称'},{name:'resourceDesc', value:'执行设备'},{name:'overtimeStatus', value:'是否超时'},{name:'procedureDesc', value:'工序名称'},{name:'targetResourceDesc', value:'目标设备'},{name:'planTime', value:'计划时间'},{name:'actualTime', value:'执行时间'}],
+      //robotNodes:[{label:'舱体线机器人',value:"1"},{label:'伺服舵机',value:"2"},{label:'框体线机器人',value:"3"}], 
+      tabPosition: 'left',
+      tenant: {
+       
+      }
+    }
+  },
+  computed: {
+    isVisible: {
+      get () {
+        return this.dialogVisible
+      },
+      set () {
+        this.close()
+      }
+    }
+  },
+  mounted () {
+    window.onresize = () => {
+      return (() => {
+        this.width = this.initWidth()
+      })()
+    }
+  },
+  methods: {
+    initWidth () {
+      this.screenWidth = document.body.clientWidth
+      if (this.screenWidth < 550) {
+        return '95%'
+      } else if (this.screenWidth < 990) {
+        return '580px'
+      } else if (this.screenWidth < 1400) {
+        return '600px'
+      } else {
+        return '650px'
+      }
+    },
+    setTenant (val) {
+      this.tenant = { ...val }
+      console.log(this.tenant)
+      this.taskNodeId = this.tenant.taskNodeId
+      this.callbackId = this.tenant.taskNodeId 
+      this.logId = this.tenant.id      
+      this.fetch()
+    },
+    fetch(){      
+        warnLogApi.connected({id: this.tenant.taskNodeId}).then(response => {
+	        const res = response.data
+	        if (res.isSuccess) {
+	          this.dataList = res.data
+            this.deviceId = this.dataList[1]? this.dataList[1].deviceId : ''
+            console.log(this.dataList[1])
+            if(this.deviceId!=''){
+              warnLogApi.getStorageNode({resourceId: this.dataList[1].deviceId}).then(response => {
+	                const res = response.data
+	               if (res.isSuccess) {
+	                  this.storageNodeList = res.data
+                    console.log(this.storageNodeList)
+	               }	        
+	            })
+            }
+	        }	        
+	      }).finally(() => this.loading = false)       
+       
+    },
+    close () {
+      this.$emit('close')
+    },
+    clickStep(e){
+      if(e != '' || e != null){ this.active = e }
+    },
+    resend(logId){
+      this.confirmDisabled = true
+      warnLogApi.resend({id: logId}).then(response => {
+			const res = response.data
+			if (res.isSuccess) {
+				this.$message({
+					message: '重发成功',
+					type: "success"
+				})
+				this.fetch()
+			}
+     }).finally(()=>{
+       this.confirmDisabled = false
+     }) 
+    },
+    nodeCallback(callbackId){
+      this.confirmDisabled = true
+      warnLogApi.nodeCallback({id: callbackId}).then(response => {
+			const res = response.data
+			if (res.isSuccess) {
+				this.$message({
+					message: '回调验证成功',
+					type: "success"
+				})
+				this.fetch()
+			}
+     }).finally(()=>{
+       this.confirmDisabled = false
+     })
+    },
+    freeLog(deviceId){
+      
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.tenant-view {  
+  .img-wrapper {
+    text-align: center;
+    margin-top: -1.5rem;
+    margin-bottom: 10px;
+    img {
+      width: 4rem;
+      border-radius: 50%;
+    }
+  }
+  .view-item {
+    margin: 7px;
+    i {
+      font-size: 0.97rem;
+    }
+    span {
+      margin-left: 5px;
+    }
+  }
+  .offset{
+    margin:5px 0; 
+  } 
+  .btn {
+    text-align: center;
+    margin-top: 10px;
+  }
+}
+</style>