oyq28 1 vuosi sitten
vanhempi
commit
d4447ca1f0

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

@@ -122,6 +122,10 @@ const apiList = {
     method: 'POST',
     url: `/authority/toolTask/saveToolTask`
   },
+  saveDetailToolTask: {
+    method: 'POST',
+    url: `/authority/toolTask/saveDetailToolTask`
+  },
 }
 
 export default {
@@ -316,5 +320,11 @@ export default {
       data
     })
   },
+  saveDetailToolTask (data) {
+    return axiosApi({
+      ...apiList.saveDetailToolTask,
+      data
+    })
+  },
 
 }

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

@@ -39,7 +39,8 @@
 	  			</table>
 	  			<!-- 下部-货架名称编号 -->
 	  			<div class="footerDiv">{{item.name}}({{item.no}})</div>
-          <el-button  class="el-button--primary generateTask" @click="saveToolTask()">确定</el-button>
+          <span style="font-size: 18px;">还需要换出 <span style="color: red;font-size: 30px;">{{ remainingToolCount }}</span> 把刀</span>
+          <el-button  class="el-button--primary generateTask" @click="saveToolTask()">生成任务</el-button>
 	  		</div>
   		</template>
 
@@ -87,6 +88,7 @@
 	import axios from 'axios'
 	// 加载动态数字组件
 	import countTo from 'vue-count-to'
+  import orderMgrApi from "@/api/runManageCenter/orderMgr";
 	export default {
 	  name: "LineSideEmulate",
 	  directives: { elDragDialog },
@@ -100,6 +102,7 @@
         type: String,
         default:''
       },
+      toolCategory:[]
 	  },
 	  data () {
 	    return {
@@ -137,7 +140,7 @@
 	        TenantTypeEnum: {},
 	        TenantStatusEnum: {}
 	      },
-        cellSelections: {},
+        cellSelections: [],
 	    }
 	  },
 	  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
@@ -159,7 +162,12 @@
 	    },
 	    nationList() {
         return convertEnum(this.dicts.NATION)
-      }
+      },
+      remainingToolCount() {
+        const count = this.toolCategory.length - this.cellSelections.length;
+        console.log('remainingToolCount:', count);
+        return count;
+      },
 	  },
 	  mounted () {
 
@@ -257,12 +265,23 @@
 	    },
       selectCell(objTd) {
         objTd.selected = !objTd.selected;
+        const count = this.toolCategory.length - this.cellSelections.length;
         if(objTd.selected){
+          if(count <= 0){
+            return
+          }
           objTd.tdBackground=true;
+          this.cellSelections.push(objTd.id)
+
         }else{
           objTd.tdBackground=false;
+          const index = this.cellSelections.indexOf(objTd.id);
+          if (index !== -1) {
+            this.cellSelections.splice(index, 1);
+          }
         }
 
+
       },
 	    edit (row) {
         console.log("row:",)
@@ -341,7 +360,21 @@
 	    	})
 	    },
       saveToolTask(){
-        console.log("this.detailPlanId:"+this.detailPlanId)
+        console.log("this.toolCategory:"+this.toolCategory)
+        let requestParam={
+          id: this.deviceId,
+          planId: this.detailPlanId,
+          list: this.toolCategory,
+          storgeId: this.cellSelections
+        }
+        console.log(requestParam)
+        orderMgrApi.saveDetailToolTask(requestParam).then(response => {
+          const res = response.data
+          if(res.isSuccess){
+            this.viewClose()
+          }
+        }).finally(() => this.loading = false)
+
       },
 	  }
 	}
@@ -609,7 +642,7 @@
     color: white;
   }
   .generateTask{
-    margin-left: 45% !important;
+    margin-left: 18% !important;
     margin-top: 2%;
   }
 

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

@@ -41,7 +41,7 @@
     >
       <!--【	刀具校验对话框】 -->
       <toolChange ref="childForRef"
-        :device-id="deviceId" :detail-plan-id="detailPlanId"
+        :device-id="deviceId" :detail-plan-id="detailPlanId" :tool-category="toolCategory"
         @close="checkDetailCuttingToolsClose"
       />
     </el-dialog>
@@ -74,7 +74,8 @@
         checkDetailCuttingToolsVisible: false,
         detailPlanId: '',
         deviceId:'',
-        tableData: []
+        tableData: [],
+        toolCategory:[]
 	    }
 	  },
 	  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
@@ -124,6 +125,7 @@
           }
           this.detailPlanId = data.planId
           this.deviceId = data.id
+          this.toolCategory=data.list
           this.checkDetailCuttingToolsVisible = true
       },