Преглед на файлове

新增前端自定义订单页面功能

oyq28 преди 1 година
родител
ревизия
5b8c431a9d

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

@@ -18,10 +18,18 @@ const apiList = {
     method: 'POST',
     url: `/authority/order/update`
   },
+  updateOrder: {
+    method: 'POST',
+    url: `/authority/orderTask/updateOrder`
+  },
   save: {
     method: 'POST',
     url: `/authority/order/save`
   },
+  saveOrder: {
+    method: 'POST',
+    url: `/authority/orderTask/saveOrder`
+  },
   // 一键排产
   oneTouchSchedule: {
     method: 'POST',
@@ -145,6 +153,12 @@ export default {
       data
     })
   },
+  saveOrder (data) {
+    return axiosApi({
+      ...apiList.saveOrder,
+      data
+    })
+  },
   // 一键排产
   oneTouchSchedule (data) {
     return axiosApi({
@@ -172,6 +186,12 @@ export default {
       data
     })
   },
+  updateOrder (data) {
+    return axiosApi({
+      ...apiList.updateOrder,
+      data
+    })
+  },
   updateStatus (data) {
     return axiosApi({
       ...apiList.updateStatus,

+ 14 - 0
imcs-ui/src/api/statisticalAnalysis/productlineAvailability.js

@@ -183,4 +183,18 @@ export default {
       data
     })
   },
+  workHourReport(page,limit,searchObj){
+    return axiosApi({
+      url: `/authority/productLinePerformance/workHourReport/${page}/${limit}`,
+      method: 'post',
+      data:searchObj
+    })
+  },
+  otherHourReport(page,limit,searchObj){
+    return axiosApi({
+      url: `/authority/productLinePerformance/otherHourReport/${page}/${limit}`,
+      method: 'post',
+      data:searchObj
+    })
+  }
 }

+ 14 - 0
imcs-ui/src/lang/zh/statisticalAnalysis.js

@@ -113,6 +113,20 @@ export default {
         awaitNum:'待加工数量',
         endNum:'已完成数量',
         scrapNum:'报废数量',
+      },
+	  //定额工时报表
+      workHourReport:{
+        orderNo: '订单号',
+        zoneName:'产线',
+        resourceName: '分配设备',
+        bomName: '零件名称',
+        procedureNo:'工序',
+        startTime: '开始时间',
+        endTime: '结束时间',
+        actualWorkHour: '实际加工时长(分钟)',
+        workHour: '额定工时(分钟)',
+        hour: '差值(额定-实际)',
+        alarmHour: '报警时长(分钟)'
       }
     },
     // 表单数据名称

+ 12 - 8
imcs-ui/src/views/zuihou/dispatchMgr/tools/Index.vue

@@ -158,7 +158,7 @@
 	  </el-form>
 	</el-card>
 
-	<el-card class="box-card">
+	<el-card class="box-card" v-show="false">
         <div slot="header" class="clearfix">动态移动零件(产线内)</div>
 		<el-form ref="form7" :model="form7" :rules="rules5" label-width="80px">
 			<el-row :gutter="12" >
@@ -186,16 +186,20 @@
 
 	<el-card class="box-card">
         <div slot="header" class="clearfix">零件动态入线边库(产线内)</div>
-		<el-form ref="form8" :model="form8" :rules="rules6" label-width="80px">
+		<el-form ref="form8" :model="form8" :rules="rules1" label-width="80px">
 			<el-row :gutter="12" >
-				<el-col :xs="6" :sm="5">					
+				<el-col :xs="6" :sm="5">
+					<!--					
 					<el-select v-model="form8.zoneId" placeholder="选择产线">
 						<el-option v-for="deviceUnit in lineList " :label="deviceUnit.name" :value="deviceUnit.id" :key="deviceUnit.id" ></el-option>		
-			  		</el-select>
+			  		</el-select> -->
+					  <el-form-item label="任务ID:" prop="taskId">
+                    	<el-input v-model="form8.taskId" placeholder="任务ID"></el-input>
+					</el-form-item>
 				</el-col>
 				<el-col :xs="6" :sm="5">
-					<el-form-item label="节点ID:" prop="startpointId">
-                    	<el-input v-model="form8.startpointId" placeholder="起始点位"></el-input>
+					<el-form-item label="节点ID:" prop="taskNodeId">
+                    	<el-input v-model="form8.taskNodeId" placeholder="任务节点Id"></el-input>
 					</el-form-item>
 				</el-col>				
 			</el-row>
@@ -310,8 +314,8 @@
 			endpointId: "",
 		  },
 		  form8:{
-			zoneId: "",
-			startpointId: ""			
+			taskId: "",
+			taskNodeId: ""			
 		  },
 		  form9:{
             taskNodeId: '',

+ 1 - 0
imcs-ui/src/views/zuihou/runManageCenter/orderMgr/components/finishedOrder/index.vue

@@ -514,6 +514,7 @@
 	      // 查询必须参数-已完成:orderstatus  = 3(当生产状态等于已完成的时候,同时设置订单状态已完成)
 	      // this.queryParams.model.orderStatus = '3'
 	      this.queryParams.model.planStatus = '3'
+		  //this.queryParams.model.singleTaskFlag = '0'
 	      planMgrApi.page(this.queryParams).then(response => {
 	        const res = response.data
 	        if (res.isSuccess) {

+ 12 - 10
imcs-ui/src/views/zuihou/runManageCenter/orderMgr/components/outNewOrder/index.vue

@@ -306,13 +306,12 @@
 	        })
 	        return
 	      }
-	    	if (this.selection.length > 1) {
-	        this.$message({
-	          message: this.$t("tips.mustOne"),
-	          type: "warning"
-	        })
-	        return
-	      }
+
+		  const ids = []
+        	this.selection.forEach(item => {
+          		ids.push(item.id)
+        	})
+	    	
 	    	// 确认【提交审核】
 	    	this.$confirm(this.$t("tips.audioTips"), this.$t("common.tips"), {
 	      	distinguishCancelAndClose: true,
@@ -321,11 +320,11 @@
 	        type: "warning"
 	      }).then(() => {
 	      	// 调用API
-	    		this.audio(status)
+			  this.audio(ids,status)
 	      }).catch(() => {})
 	    },
 	    // 【审核通过/审核不通过】接口-事件
-	    audio(status){
+	    audio(ids,status){
 	    	if(!status){
 	    		status =  this.audioVal
 	    	}
@@ -338,7 +337,7 @@
 	    	if(status == "3"){
 	    		msg = this.$t("common.audio.aduioFail")+"!"
 	    	}
-	    	orderMgrApi.updateStatus({ id: this.selection[0].id, auditStatus: status}).then(response => {
+	    	orderMgrApi.updateStatus({ ids: ids, auditStatus: status}).then(response => {
 	        if (response.status == 200) {
 	        	// 如果是审核,成功后,关闭弹出框
 	        	if(status == '2' || status == '3'){
@@ -354,6 +353,8 @@
 	          this.search()
 	          // 通知父组件,相关设置
 	          this.$emit("audioStatus", status)
+			   // 清除table的选择状态
+			  this.$refs.table.clearSelection()
 	        }
 	      })
 	    },
@@ -482,6 +483,7 @@
 	      // 查询必须参数-新增外部:orderstatus  = 1 and source = 2
 	      this.queryParams.model.orderStatus = '1'
 	      this.queryParams.model.source = '2'
+		  this.queryParams.model.singleTaskFlag = '0'
 	      orderMgrApi.page(this.queryParams).then(response => {
 	        const res = response.data
 	        if (res.isSuccess) {

+ 47 - 6
imcs-ui/src/views/zuihou/runManageCenter/orderMgr/components/runningOrder/index.vue

@@ -111,7 +111,7 @@
 	        </div>
 	      </template>
       </el-table-column>
-      <el-table-column align="center" type="selection" style="width: 3%;" :reserve-selection="true" />
+      <el-table-column align="center" type="selection" style="width: 3%;" :reserve-selection="true" :selectable="checkSel"  />
       <!-- 订单编号
       <el-table-column prop="orderNo" :label='$t("runCenter.table.oder.orderNo")' :show-overflow-tooltip="true" style="width: 12%;"></el-table-column> -->
       <!-- 订单名称 -->
@@ -190,12 +190,21 @@
       >
         <template slot-scope="{ row }">
           <!-- 暂停-->
-          <el-tooltip v-if="row.produceStatus == '1' || row.produceStatus == '2'" class="item" content='暂停' effect="dark" placement="top-start">
+          <el-tooltip v-if="row.produceStatus == '2'" class="item" content='暂停' effect="dark" placement="top-start">
 	          <i
 	            class="el-icon-video-pause table-operation"
 	            style="color: #2db7f5;"
 	            @click="orderOperateBtn(row,'stop')"
 	          />
+          </el-tooltip>
+		  <el-tooltip v-if="row.singleTaskFlag == '1'" class="item" :content="$t('resource.buttons.setting')"
+            effect="dark" placement="top-start"
+          >
+            <i
+              class="el-icon-view table-operation"
+              style="color: #2db7f5"
+              @click="orderConf(row)"
+            />
           </el-tooltip>		  
 		  <el-tooltip v-if="row.produceStatus == '1' && row.singleTaskFlag == '1'" class="item" :content='$t("runCenter.buttons.prodNode")' effect="dark" placement="top-start">
 	          <i
@@ -213,7 +222,7 @@
 	          />
           </el-tooltip>
         	<!-- 排产预览 -->
-        	<el-tooltip v-if="row.produceStatus == '1'" class="item" content='排产预览' effect="dark" placement="top-start">
+        	<el-tooltip v-if="row.produceStatus == '1' && row.singleTaskFlag == '0'" class="item" content='排产预览' effect="dark" placement="top-start">
 	          <i
 	            class="el-icon-view table-operation"
 	            style="color: #87d068;"
@@ -360,6 +369,14 @@
       :dialog-visible.sync="dyPriorityVisible"	  
       @close="dyClose"
 	  @success="editSuccess"
+    />
+	<!-- 生产资源资料  -->
+	<detail-conf
+      	ref="detailConf"
+      	:dialog-visible="dialogDetailConf.isVisible"
+      	:title="dialogDetailConf.title"
+      	@close="editDetailConfClose"
+      	@success="editDetailConfSuccess"
     />
   </div>
 </template>
@@ -382,11 +399,12 @@
 	import elDragDialog from '@/directive/el-drag-dialog'
 	import { initQueryParams } from '@/utils/commons'
     import DyPriority from './components/dyPriority.vue'
+	import DetailConf from "./../orderTask/components/DetailConf"
 
 	export default {
 	  name: "DraftOrder",
 	  directives: { elDragDialog },
-	  components: { Pagination, TenantEdit, TenantView, ProductionProgramme, checkCuttingTools, DyPriority},
+	  components: { Pagination, TenantEdit, TenantView, ProductionProgramme, checkCuttingTools, DyPriority, DetailConf},
 	  props: {
 	  },
 	  data () {
@@ -428,6 +446,10 @@
 	        isVisible: false,
 	        title: ""
 	      },
+		  dialogDetailConf: {
+        	  isVisible: false,
+        	  title: "",
+          },
 	      preview: {
 	        isVisible: false,
 	        context: ''
@@ -503,7 +525,9 @@
 
 	  },
 	  methods: {
-
+        checkSel(row){
+           return row.singleTaskFlag == '0'
+		},
 	  	// 【全选】checkbox-事件
 	  	handleCheckAllChange(val) {
 	  		// 全选赋值
@@ -617,6 +641,21 @@
         }
       },
 
+	  orderConf(row){
+		    let obj = {}
+			obj.id = row.orderId		    
+			this.$refs.detailConf.setTenant(obj, this.dicts)
+			this.$refs.detailConf.type = "view";      		
+      		this.dialogDetailConf.title = "任务配置"
+      		this.dialogDetailConf.isVisible = true	
+		},
+		editDetailConfClose() {
+      		this.dialogDetailConf.isVisible = false;
+    	  },
+    	editDetailConfSuccess() {
+      		//this.search();
+    	},	
+
       // 【优先级】按钮-事件
       prorityBtn(){
       	if(this.checkData()){
@@ -633,7 +672,9 @@
       panseBtn(val, data){
       	let obj = { status: val }
       	if(data) {
-      		obj.id  = data.id;
+      		obj.id  = data.orderId;
+			obj.planId  = data.id;
+			obj.orderName = data.orderName;
 		  		if(val == '1'){
 		  			orderMgrApi.orderEnable(obj).then(res => {
 				    		res = res.data