oyq28 1 vuosi sitten
vanhempi
commit
f0e488c8b5

+ 10 - 0
imcs-ui/src/api/runManageCenter/orderMgr.js

@@ -118,6 +118,10 @@ const apiList = {
     method: 'POST',
     url: `/authority/toolManagement/toolCheck`
   },
+  saveToolTask: {
+    method: 'POST',
+    url: `/authority/toolTask/saveToolTask`
+  },
 }
 
 export default {
@@ -306,5 +310,11 @@ export default {
       data
     })
   },
+  saveToolTask (data) {
+    return axiosApi({
+      ...apiList.saveToolTask,
+      data
+    })
+  },
 
 }

+ 19 - 1
imcs-ui/src/views/zuihou/centralToolMagazine/changeToolTask/Index.vue

@@ -28,7 +28,10 @@
 	  			<!-- 中部-货架小格子 -->
 	  			<table class="contentDiv" border="0" cellspacing="0" cellpadding="6">
             <tr v-for="(objTr, objIndex) in item.children" :key="objIndex">
-              <td v-for="objTd in objTr.children" :key="objTd.toolId" :class="objTd.toolHandleId ? 'blueBg' : ''" @click="editOne(objTd)">
+              <td v-for="objTd in objTr.children" :key="objTd.toolId"
+                  :class="{ 'blueBg': objTd.toolHandleId, 'redBg': objTd.tdBackground }"
+                  @click="selectCell(objTd)"
+                  @dblclick="editOne(objTd)">
                 {{objTd.no}}
                 <el-image v-if="objTd.lockStatus == '0'" class="locked" :src="resolveLogo(lockImg)" fit="contain"></el-image>
               </td>
@@ -129,6 +132,7 @@
 	        TenantTypeEnum: {},
 	        TenantStatusEnum: {}
 	      },
+        cellSelections: {}
 	    }
 	  },
 	  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
@@ -248,6 +252,15 @@
 	    editOne(row) {
 	    	this.edit(row);
 	    },
+      selectCell(objTd) {
+        objTd.selected = !objTd.selected;
+        if(objTd.selected){
+          objTd.tdBackground=true;
+        }else{
+          objTd.tdBackground=false;
+        }
+
+      },
 	    edit (row) {
         console.log("row:",)
 	      this.$refs.edit.setTenant(row, this.dicts)
@@ -585,4 +598,9 @@
 		width: 20px;
 		height: 25px;
 	}
+  .redBg {
+    background: red;
+    color: white;
+  }
+
 </style>

+ 1 - 0
imcs-ui/src/views/zuihou/centralToolMagazine/locationMgr/components/Edit.vue

@@ -114,6 +114,7 @@ export default {
       oldName: '',
       oldNo: '',
       oldToolNo: '',
+      tdBackground: '',
       toolHandleId: '',
       tenant: this.initTenant(),
       screenWidth: 0,

+ 616 - 0
imcs-ui/src/views/zuihou/runManageCenter/orderMgr/components/runningOrder/changeToolTask/Index.vue

@@ -0,0 +1,616 @@
+<template>
+  <div class="app-container">
+  	<!-- 货架区域 -->
+  	<div class="areaDiv" style="width: 100%;overflow-x: auto;">
+
+  		<!-- 货架(单个) -->
+  		<template>
+	  		<div class="tableBlock" v-for="item in shelvesTreeList" :key="item.id">
+	  			<!-- 上部分-是个统计数据 -->
+	  			<div class="topDiv">
+	  				<span class="topSpan allTongji">
+	  					<span>{{$t("lineSide.common.allCount")}}:</span>
+	  					<countTo :duration="3000" :end-val="parseInt(item.allCount)" :start-val="0"/>
+	  				</span>
+	  				<span class="topSpan cunTongji">
+	  					<span>{{$t("lineSide.common.stockCount")}}:</span>
+	  					<countTo :duration="3000" :end-val="parseInt(item.stockCount)" :start-val="0"/>
+	  				</span>
+	  				<span class="topSpan lockTongji">
+	  					<span>{{$t("lineSide.common.lockCount")}}:</span>
+	  					<countTo :duration="3000" :end-val="parseInt(item.lockCount)" :start-val="0"/>
+	  				</span>
+	  				<span class="topSpan emptyTongji">
+	  					<span>{{$t("lineSide.common.freeCount")}}:</span>
+	  					<countTo :duration="3000" :end-val="parseInt(item.freeCount)" :start-val="0"/>
+	  				</span>
+	  			</div>
+	  			<!-- 中部-货架小格子 -->
+	  			<table class="contentDiv" border="0" cellspacing="0" cellpadding="6">
+            <tr v-for="(objTr, objIndex) in item.children" :key="objIndex">
+              <td v-for="objTd in objTr.children" :key="objTd.toolId"
+                  :class="{ 'blueBg': objTd.toolHandleId, 'redBg': objTd.tdBackground }"
+                  @click="selectCell(objTd)"
+                  @dblclick="editOne(objTd)">
+                {{objTd.no}}
+                <el-image v-if="objTd.lockStatus == '0'" class="locked" :src="resolveLogo(lockImg)" fit="contain"></el-image>
+              </td>
+            </tr>
+	  			</table>
+	  			<!-- 下部-货架名称编号 -->
+	  			<div class="footerDiv">{{item.name}}({{item.no}})</div>
+          <el-button  class="el-button--primary generateTask" @click="saveToolTask()">确定</el-button>
+	  		</div>
+  		</template>
+
+
+  	</div>
+
+    <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="80%"
+      top="50px"
+      :visible.sync="preview.isVisible"
+    >
+      <el-scrollbar>
+        <div v-html="preview.context" />
+      </el-scrollbar>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+	import TenantEdit from "./components/Edit"
+	import TenantView from "./components/View"
+	// 【区域管理】-API
+	import areaMgrAPI from "@/api/resourceProductMgr/areaMgr"
+	// 【边线库管理】-API
+	import lineSideMgrApi from "@/api/lineSideLibrary/lineSideMgr"
+
+	import elDragDialog from '@/directive/el-drag-dialog'
+	import { downloadFile, initEnums, initDicts, initQueryParams } from '@/utils/commons'
+	import axios from 'axios'
+	// 加载动态数字组件
+	import countTo from 'vue-count-to'
+	export default {
+	  name: "LineSideEmulate",
+	  directives: { elDragDialog },
+	  components: { TenantEdit, TenantView, countTo },
+	  props: {
+      deviceId: {
+        type: String,
+        default:''
+      },
+      detailPlanId:{
+        type: String,
+        default:''
+      },
+	  },
+	  data () {
+	    return {
+	    	url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
+	    	toolsImg: 'tools.png',
+	    	programImg: 'program.png',
+	    	lockImg: 'locked.png',
+	    	srcList: [
+          'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
+          'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg'
+        ],
+	    	topTongjiData: {"shelvesCount": 0, "storgeCount": 0,"instockCount": 0,"freestockCount": 0,"lockstockCount": 0},
+	    	shelvesTreeList: [], // 货架数据
+	    	audioStatus: [],
+	      dialog: {
+	        isVisible: false,
+	        title: ""
+	      },
+	      preview: {
+	        isVisible: false,
+	        context: ''
+	      },
+	      tenantViewVisible: false,
+	      tableKey: 0,
+	      queryParams: initQueryParams({}),
+	      selection: [],
+	      loading: false,
+	      tableData: {
+	        total: 0
+	      },
+	      dicts: {
+          NATION: {}
+        },
+	      enums: {
+	        TenantTypeEnum: {},
+	        TenantStatusEnum: {}
+	      },
+        cellSelections: {},
+	    }
+	  },
+	  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+	  created() {
+	  	// 加载列表数据-按区域
+	  	this.getTabList()
+		},
+    watch: {
+      'deviceId': {
+        handler(val, oldVal) {
+          // 加载列表数据
+          this.getTabList()
+        }
+      }
+    },
+	  computed: {
+	    currentUser () {
+	      return this.$store.state.account.user
+	    },
+	    nationList() {
+        return convertEnum(this.dicts.NATION)
+      }
+	  },
+	  mounted () {
+
+	  },
+	  methods: {
+	  	// 加载背景颜色
+	  	setBackground(color){
+	  		return "background: "+ color +";"
+	  	},
+	  	// 加载【本地图片】
+	  	resolveLogo(logo) {
+        return require(`@/assets/icon/${logo}`);
+      },
+	    viewClose () {
+	      this.tenantViewVisible = false
+	    },
+	    editClose () {
+	      this.dialog.isVisible = false
+	    },
+	    editSuccess () {
+	      //this.search()
+        this.getTabList();
+	    },
+	    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("lineSide.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()
+	    },
+	    delete (ids) {
+	      areaMgrAPI.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()
+	        }
+	      })
+	    },
+	    view (row) {
+	      this.$refs.view.setTenant(row)
+	      this.tenantViewVisible = true
+	    },
+	    // 【修改】表头上Btn-事件
+	    editOne(row) {
+	    	this.edit(row);
+	    },
+      selectCell(objTd) {
+        objTd.selected = !objTd.selected;
+        if(objTd.selected){
+          objTd.tdBackground=true;
+        }else{
+          objTd.tdBackground=false;
+        }
+
+      },
+	    edit (row) {
+        console.log("row:",)
+	      this.$refs.edit.setTenant(row, this.dicts)
+	      this.$refs.edit.type = "edit"
+        if(this.deviceId){
+          this.$refs.edit.showFlag = false
+        }else{
+          this.$refs.edit.showFlag = true
+        }
+
+
+	      this.dialog.title = this.$t("lineSide.common.strogeTool")
+	      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]
+	      }
+
+	      this.queryParams.current = params.current ? params.current : this.queryParams.current
+	      this.queryParams.size = params.size ? params.size : this.queryParams.size
+	      areaMgrAPI.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)
+	      }
+	    },
+	    // 获取列表数据
+	    getTabList(){
+        console.log("deviceId:"+this.deviceId)
+	    	lineSideMgrApi.iconListV2({}).then(res => {
+	    		res = res.data
+	    		console.log("方块列表:", res)
+	    		if(res.isSuccess){
+            let filteredData;
+            if(this.deviceId){
+               filteredData = res.data.shelvesTreeList.filter(item => item.deviceId === this.deviceId  && item.toolType === "1");
+            }else{
+               filteredData = res.data.shelvesTreeList.filter(item => item.toolType === "4");
+            }
+
+            console.log("filteredData:",filteredData)
+            // 设备的货架数据
+    				this.shelvesTreeList = filteredData
+    				// 统计数据
+    				this.topTongjiData = {
+    					"freestockCount": res.data.freestockCount,
+							"instockCount": res.data.instockCount,
+							"lockstockCount": res.data.lockstockCount,
+							"shelvesCount": res.data.shelvesCount,
+							"storgeCount": res.data.storgeCount
+    				}
+	    		}
+	    	})
+	    },
+      saveToolTask(){
+        console.log("this.detailPlanId:"+this.detailPlanId)
+      },
+	  }
+	}
+</script>
+<!-- 全局样式-通过定义父DOM的calss,来只影响本组件 -->
+<style type="text/css">
+	.areaDiv .el-progress-bar__innerText{
+		position: relative;
+		top: -2px;
+	}
+	.areaDiv .el-card__body{
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		flex-direction: column;
+		padding: 10px;
+		min-height: 190px;
+	}
+</style>
+<!-- 本组件样式 -->
+<style lang="scss" scoped>
+	.blockDiv{
+		position: relative;
+		border: 1px solid #EEEEEE;
+		padding-left: 15px;
+		-moz-border-radius: 5px;
+		-webkit-border-radius: 5px;
+		border-radius: 5px;
+		text-align: center;
+		color: white;
+		-moz-box-shadow: 1px 5px 5px #c0b7b7;
+		webkit-box-shadow: 1px 5px 5px #c0b7b7;
+		box-shadow: 1px 5px 5px #c0b7b7;
+		h1{
+			margin: 20px;
+			font-size: 45px;
+		}
+		p{
+			text-align: left;
+			color: #FFFFFF;
+		}
+	}
+	.danweiSpan{
+		display: inline-block;
+		font-size: 16px;
+		color: black;
+	}
+	.blockBg1{
+		background: #0F79DC;
+		border: 1px solid #0F79DC;
+	}
+	.blockBg2{
+		background: #8E66E4;
+		border: 1px solid #8E66E4;
+	}
+	.blockBg3{
+		background: #3EB64B;
+		border: 1px solid #3EB64B;
+	}
+	.blockBg4{
+		background: #0BA6D5;
+		border: 1px solid #0BA6D5;
+	}
+	.blockBg5{
+		background: #E57878;
+		border: 1px solid #E57878;
+	}
+	.blockBg6{
+		background: #E37B3D;
+		border: 1px solid #E37B3D;
+	}
+	.rowCls{
+		background: white;
+		box-sizing: border-box;
+		border-bottom: 2px dotted #AAAAAA;
+		margin-bottom: 15px;
+	}
+	.rowCls .el-col{
+		margin-bottom: 20px;
+	}
+	.doubleTable{
+		width: 100%;
+	}
+	.doubleTable h1{
+		margin: 17px 0;
+	}
+	.el-card{
+		display: inline-block;
+		min-width: 290px;
+		margin: 0 5px 5px 0;
+	}
+	.areaTitle{
+		margin-bottom: 15px;
+	}
+	.areaTitle span{
+		position: relative;
+		display: inline-block;
+		padding-right: 20px;
+		font-weight: bold;
+	}
+	.areaTitle span:before{
+		position: absolute;
+		content: '';
+		background: #42d885;
+		top: 0px;
+		right: 0px;
+		width: 10px;
+		height: 100%;
+	}
+	.contentView{
+		background: #CCCCCC;
+		text-align: center;
+		padding: 3px 5px;
+		margin-bottom: 5px;
+		border-bottom: 4px solid red;
+	}
+	.hebingDiv{
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		flex-wrap: wrap;
+		max-width: 140px;
+		min-height: 60px;
+		border-bottom: 8px solid red;
+		word-break: break-all;
+	}
+	.lineBianku{
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		background: #CCCCCC;
+		text-align: center;
+		padding: 3px 5px;
+		min-height: 60px;
+		max-width: 190px;
+		word-break: break-all;
+	}
+	.eqTitle{
+		width: 100%;
+		max-width: 70px;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		white-space: nowrap;
+		font-size: 12px;
+		margin-bottom: 15px;
+	}
+	.eqTitle2{
+		width: 100%;
+		max-width: 70px;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		white-space: nowrap;
+		font-size: 12px;
+	}
+	.recordSpan{
+		display: inline-block;
+		background: #0F79DC;
+		font-size: 12px;
+		padding: 2px 10px;
+		color: white;
+		-moz-border-radius: 3px;
+		-webkit-border-radius: 3px;
+		border-radius: 3px;
+	}
+	.jinduTiao{
+		margin: 5px 0;
+	}
+	.statusDiv{
+		text-align: right;
+	}
+	.statusDiv span{
+		display: inline-block;
+		font-size: 12px;
+		padding: 2px 10px;
+		color: white;
+		-moz-border-radius: 2px;
+		-webkit-border-radius: 2px;
+		border-radius: 2px;
+	}
+	.linkLine{
+		/*background: #13CE66;*/
+	}
+	.jianguan{
+		/*background: #0A76A4;*/
+	}
+	.producting{
+		/*background: #3888FA;*/
+	}
+	.footerDiv{
+		text-align: center;
+		width: 100%;
+		padding: 7px 0;
+		border: 1px solid #AAAAAA;
+	}
+	.footerDiv a{
+		display: inline-block;
+		background: #0F79DC;
+		font-size: 12px;
+		padding: 5px 15px;
+		color: white;
+		-moz-border-radius: 3px;
+		-webkit-border-radius: 3px;
+		border-radius: 3px;
+	}
+	.footerDiv a:hover{
+		opacity: 0.7;
+	}
+	.tableBlock{
+		margin: 15px 30px 15px 0;
+		display: inline-block;
+    margin-left: 30%;
+	}
+	.topDiv{
+		text-align: center;
+	}
+	.topSpan{
+		display: inline-block;
+		padding: 10px;
+		color: white;
+		border: 1px solid #FFFFFF;
+		border-radius: 5px;
+		margin-right: 5px;
+	}
+	.allTongji{
+		background: #0BA6D5;
+		border: 1px solid #0BA6D5;
+	}
+	.cunTongji{
+		background: #0F79DC;
+		border: 1px solid #0F79DC;
+	}
+	.lockTongji{
+		background: #E57878;
+		border: 1px solid #E57878;
+	}
+	.emptyTongji{
+		border: 1px solid #AAAAAA;
+		color: #333333;
+	}
+	.contentDiv{
+		margin: 10px 0;
+		border-left: 1px solid #AAAAAA;
+		border-top: 1px solid #AAAAAA;
+	}
+	.contentDiv tr td{
+		position: relative;
+		cursor: pointer;
+		padding: 10px 25px;
+		border-right: 1px solid #AAAAAA;
+		border-bottom: 1px solid #AAAAAA;
+	}
+	.blueBg{
+		background: #548EC5;
+		color: white;
+	}
+	.locked{
+		position: absolute;
+		right: 2px;
+		top: 0;
+		width: 20px;
+		height: 25px;
+	}
+  .redBg {
+    background: red;
+    color: white;
+  }
+  .generateTask{
+    margin-left: 45% !important;
+    margin-top: 2%;
+  }
+
+</style>

+ 332 - 0
imcs-ui/src/views/zuihou/runManageCenter/orderMgr/components/runningOrder/changeToolTask/components/Edit.vue

@@ -0,0 +1,332 @@
+<template>
+  <el-dialog
+  	:close-on-click-modal="false"
+  	:close-on-press-escape="false"
+  	:title="title"
+  	:append-to-body="true"
+  	:visible.sync="isVisible"
+  	width="900px"
+  	top="50px"
+  >
+    <el-form ref="form" :model="tenant" :rules="rules" label-position="right" label-width="130px">
+    	<!-- 列表数据 -->
+	    <el-table
+	      :key="tableKey"
+	      ref="table"
+	      v-loading="loading"
+	      :data="tableData.data"
+	      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>
+	      <!--<el-table-column align="center" type="selection" width="50" :reserve-selection="true" />-->
+	      <el-table-column prop="cuttingToolName" label='刀具名称' :show-overflow-tooltip="true"></el-table-column>
+	      <el-table-column prop="specifications" label='刀具规格' width="180px"></el-table-column>
+	      <el-table-column prop="handleCode" label='刀柄编码' width="180px">
+          <template slot-scope="scope" >
+            <el-input v-model="tenant.handleCode" type='text' />
+            </template>
+        </el-table-column>
+        <el-table-column prop="remark" label='备注' width="180px"></el-table-column>
+	    </el-table>
+    </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="add" :disabled="confirmDisabled" @click="submitForm">{{ $t('common.confirm') }}</el-button>
+    </div>
+  </el-dialog>
+</template>
+<script>
+
+import { initQueryParams } from '@/utils/commons'
+// import Pagination from "@/components/Pagination"
+// 【仓库类型管理】-API
+import warehouseTypeMgrApi from "@/api/modelingCenter/warehouseTypeMgr"
+import customizeCuttingToolApi from "@/api/prepareProductMgr/customizeCuttingTool"
+// 【边线库管理】-API
+import lineSideMgrApi from "@/api/lineSideLibrary/lineSideMgr"
+import locationMgrApi from "@/api/lineSideLibrary/toolStorge";
+
+export default {
+  name: 'TenantEdit',
+  components: {
+  //	Pagination
+  },
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false
+    },
+    title: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      type: 'add',
+      dialog: {
+        isVisible: false,
+        title: ""
+      },
+      tableKey: 0,
+      queryParams: initQueryParams({}),
+      selection: [],
+      loading: false,
+      tableData: {
+        total: 0
+      },
+      showFlag: true,
+      tenant: this.initTenant(),
+      screenWidth: 0,
+      width: this.initWidth(),
+      confirmDisabled: false,
+      dicts:{
+        NATION: {}
+      },
+      roles: [],
+      rules: {
+      }
+    }
+  },
+  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+  created() {
+  	// 加载列表数据
+  	// this.fetch()
+    this.addRow();
+	},
+  computed: {
+    isVisible: {
+      get () {
+        return this.dialogVisible
+      },
+      set () {
+        this.close()
+        this.reset()
+      }
+    }
+  },
+  mounted () {
+    window.onresize = () => {
+      return (() => {
+        this.width = this.initWidth()
+      })()
+    }
+  },
+  methods: {
+    initTenant () {
+      return {
+        id: '',
+        handleCode:'',
+        oldHandleId: ''
+      }
+    },
+    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){
+    		console.log("库位产品:", val);
+    		this.tenant.id = val.id
+        this.tenant.oldHandleId=val.toolHandleId
+    		// 加载列表数据
+  			this.getList(val);
+    	}
+      // 字典表
+      this.dicts = dicts
+    },
+    close () {
+      this.$emit('close')
+    },
+    onSelectChange (selection) {
+      this.selection = selection
+    },
+    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
+          this.save()
+        } else {
+          return false
+        }
+      })
+    },
+    save () {
+      console.log(this.tenant)
+      if (!this.tenant.handleCode || this.tenant.handleCode.trim() === '') {
+        this.$message.info('请输入刀具编码');
+        this.confirmDisabled = false
+        return;
+      }
+      locationMgrApi.updateStrogeTool(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
+        })
+    },
+
+    // 获取列表数据
+    getList (row) {
+
+	      this.loading = true
+      lineSideMgrApi.getCuttingToolByCutterCode({ "id": row.toolHandleId }).then(response => {
+	        const res = response.data;
+	        console.log("res123123214==== ", res);
+	        if (res.isSuccess) {
+	          this.tableData = res
+            const firstRow = res.data[0];
+            if (firstRow) {
+              this.$set(this.tenant, 'handleCode', firstRow.handleCode);
+            }else{
+              this.addRow();
+            }
+	        }
+	        // eslint-disable-next-line no-return-assign
+	      }).finally(() => this.loading = false)
+
+	    },
+
+    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]
+	      }
+
+	      this.queryParams.current = params.current ? params.current : this.queryParams.current
+	      this.queryParams.size = params.size ? params.size : this.queryParams.size
+	      lineSideMgrApi.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)
+	      }
+	    },
+    addRow() {
+      // 在数据源中新增一行数据
+      const newRow = {
+        id: '', // 你的新数据的 id
+        cuttingToolName: '',
+        specifications: '',
+        handleCode: '',
+        remark: '',
+        // 其他字段按需新增
+      };
+      this.tableData.data=[];
+      // 插入新数据到数据源的指定位置
+      this.tableData.data.splice(0, 0, newRow);
+
+
+    },
+    change(){
+      this.$forceUpdate();  //强制刷新
+    }
+
+  }
+}
+</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>

+ 214 - 0
imcs-ui/src/views/zuihou/runManageCenter/orderMgr/components/runningOrder/changeToolTask/components/View.vue

@@ -0,0 +1,214 @@
+<template>
+  <el-dialog
+    :title="$t(&quot;common.view&quot;)"
+    :width="width"
+    :append-to-body="true"
+    :visible.sync="isVisible"
+    class="tenant-view"
+  >
+    <el-row :gutter="10">
+      <el-col :xs="24" :sm="24">
+        <div class="img-wrapper">
+          <img :src="tenant.logo">
+        </div>
+      </el-col>
+    </el-row>
+    <el-row :gutter="10">
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-user" />
+          <span>{{ $t('table.tenant.code') +':' }}</span>
+          {{ tenant.code }}
+        </div>
+      </el-col>
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-suitcase" />
+          <span>{{ $t('table.tenant.name') +':' }}</span>
+          {{ tenant.name }}
+        </div>
+      </el-col>
+    </el-row>
+    <el-row :gutter="10">
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-trophy" />
+          <span>{{ $t('table.tenant.type') +':' }}</span>
+          {{ tenant.type.desc }}
+        </div>
+      </el-col>
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-phone-outline" />
+          <span>{{ $t('table.tenant.status') +':' }}</span>
+          {{ tenant.status.desc }}
+        </div>
+      </el-col>
+    </el-row>
+    <el-row :gutter="10">
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-star-off" />
+          <span>{{ $t('table.tenant.duty') +':' }}</span>
+          {{ tenant.duty }}
+        </div>
+      </el-col>
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-bangzhu" />
+          <span>{{ $t('table.tenant.expirationTime') +':' }}</span>
+          {{ tenant.expirationTime ? tenant.expirationTime : '永久' }}
+        </div>
+      </el-col>
+    </el-row>
+    <el-row :gutter="10">
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-time" />
+          <span>{{ $t('table.createTime') +':' }}</span>
+          {{ tenant.createTime }}
+        </div>
+      </el-col>
+      <el-col :xs="24" :sm="12">
+        <div class="view-item">
+          <i class="el-icon-brush" />
+          <span>{{ $t('table.updateTime') +':' }}</span>
+          {{ tenant.updateTime }}
+        </div>
+      </el-col>
+    </el-row>
+    <!--    <el-row :gutter='10'>-->
+    <!--      <el-col :xs='24' :sm='12'>-->
+    <!--        <div class='view-item'>-->
+    <!--          <i class='el-icon-date' />-->
+    <!--          <span>{{ $t('table.tenant.isMultipleLogin') +':' }}</span>-->
+    <!--          {{ tenant.isMultipleLogin ? '是' : '否'}}-->
+    <!--        </div>-->
+    <!--      </el-col>-->
+    <!--      <el-col :xs='24' :sm='12'>-->
+    <!--        <div class='view-item'>-->
+    <!--          <i class='el-icon-document' />-->
+    <!--          <span>{{ $t('table.tenant.passwordExpire') +':' }}</span>-->
+    <!--          {{ tenant.passwordExpire == '0' ? '永久有效' :tenant.passwordExpire}}-->
+    <!--        </div>-->
+    <!--      </el-col>-->
+    <!--    </el-row>-->
+    <!--    <el-row :gutter='10'>-->
+    <!--      <el-col :xs='24' :sm='12'>-->
+    <!--        <div class='view-item'>-->
+    <!--          <i class='el-icon-document' />-->
+    <!--          <span>{{ $t('table.tenant.passwordErrorNum') +':' }}</span>-->
+    <!--          {{ tenant.passwordErrorNum}}-->
+    <!--        </div>-->
+    <!--      </el-col>-->
+    <!--      <el-col :xs='24' :sm='12'>-->
+    <!--        <div class='view-item'>-->
+    <!--          <i class='el-icon-date' />-->
+    <!--          <span>{{ $t('table.tenant.passwordErrorLockTime') +':' }}</span>-->
+    <!--          {{ tenant.passwordErrorLockTime | passwordErrorLockTimeFilter }}-->
+    <!--        </div>-->
+    <!--      </el-col>-->
+    <!--    </el-row>-->
+    <el-row :gutter="10">
+      <el-col :xs="24" :sm="24">
+        <div class="view-item">
+          <i class="el-icon-date" />
+          <span>{{ $t('table.tenant.describe') +':' }}</span>
+          {{ tenant.describe }}
+        </div>
+      </el-col>
+    </el-row>
+  </el-dialog>
+</template>
+<script>
+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,
+      width: this.initWidth(),
+      tenant: {
+        type: {
+          desc: ''
+        },
+        status: {
+          desc: ''
+        }
+      }
+    }
+  },
+  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 }
+    },
+    close () {
+      this.$emit('close')
+    }
+  }
+}
+</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;
+    }
+  }
+}
+</style>

+ 25 - 8
imcs-ui/src/views/zuihou/runManageCenter/orderMgr/components/runningOrder/components/checkCuttingTools/index.vue

@@ -25,9 +25,10 @@
         </template>
       </el-table-column>
       <el-table-column prop="deviceName" :label='"设备"' :show-overflow-tooltip="true"></el-table-column>
-      <el-table-column prop="msg" :label='"错误信息"' :show-overflow-tooltip="true"></el-table-column>
+      <el-table-column prop="msg" :label='"校验信息"' :show-overflow-tooltip="true"></el-table-column>
+      <el-table-column prop="isTask" :label='"任务是否已生成"' :show-overflow-tooltip="true"></el-table-column>
     </el-table>
-
+    <el-button  class="el-button--primary generateTask" @click="save()">生成任务</el-button>
     <!-- 刀具校验详情对话框-->
     <el-dialog
       :visible.sync="checkDetailCuttingToolsVisible"
@@ -39,8 +40,8 @@
       @refresh="fetch"
     >
       <!--【	刀具校验对话框】 -->
-      <toolChange
-        :device-id="deviceId"
+      <toolChange ref="childForRef"
+        :device-id="deviceId" :detail-plan-id="detailPlanId"
         @close="checkDetailCuttingToolsClose"
       />
     </el-dialog>
@@ -51,13 +52,15 @@
 	// 【订单计划】-API
 	import planMgrApi from "@/api/runManageCenter/planMgr"
   import checkDetailCuttingTools from "@/views/zuihou/runManageCenter/orderMgr/components/runningOrder/components/checkCuttingTools/checkDetailCuttingTools"
-  import toolChange from "@/views/zuihou/centralToolMagazine/changeToolTask/Index"
+  import toolChange from "@/views/zuihou/runManageCenter/orderMgr/components/runningOrder/changeToolTask/Index"
 
   import orderMgrApi from "@/api/runManageCenter/orderMgr";
+  import TenantEdit
+    from "@/views/zuihou/runManageCenter/orderMgr/components/runningOrder/changeToolTask/components/Edit.vue";
 	export default {
 	  name: "checkCuttingTool",
 	  directives: {},
-	  components: {toolChange},
+	  components: {TenantEdit, toolChange},
     props: {
       planId: {
         type:String,
@@ -90,6 +93,7 @@
 	  computed: {
 	  },
 	  mounted () {
+      this.childForRef = this.$refs.childForRef;
 	  },
 	  methods: {
 	    // 查询计划刀具可用性
@@ -115,7 +119,7 @@
 
       showCheckDetails(data){
         console.log(data)
-	        if(data.hasCuttingToolsFlag === '是'){
+	        if(data.hasCuttingToolsFlag === '是' || !data.isFree){
             return
           }
           this.detailPlanId = data.planId
@@ -126,7 +130,20 @@
       checkDetailCuttingToolsClose(){
           this.checkDetailCuttingToolsVisible = false
       },
+      save(){
+        orderMgrApi.saveToolTask(this.tableData).then(response => {
+          const res = response.data
+          if(res.isSuccess){
+
+          }
+        }).finally(() => this.loading = false)
+      }
 	  }
 	}
 </script>
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.generateTask{
+  margin-top: 3%;
+  margin-left: 47% !important;
+}
+</style>