Browse Source

设备运行跟踪接口对接

su 1 year ago
parent
commit
ebd50e5cf7
2 changed files with 253 additions and 55 deletions
  1. 7 0
      src/api/mes/job.js
  2. 246 55
      src/view/yunyin/shengchanguanli/shebeiyunxing.vue

+ 7 - 0
src/api/mes/job.js

@@ -217,3 +217,10 @@ export const dictionaryEdit = (data) => {
     data
   })
 }
+export const FieldInspectionRecord = (params) => {
+  return service({
+    url: '/mes_server/facility/FieldInspectionRecord',
+    method: 'get',
+    params
+  })
+}

+ 246 - 55
src/view/yunyin/shengchanguanli/shebeiyunxing.vue

@@ -4,7 +4,7 @@
 	<header>
 			<el-button type="primary" @click="onBZ">班组维护</el-button>
 			<el-button type="primary" @click="onDel">删除</el-button>
-			<el-button type="primary" @click="onSMB">入仓末板数据统计</el-button>
+			<el-button type="primary" @click="onxuncha">管理巡查</el-button>
 			<el-button type="primary" @click="ondianjian">设备点检</el-button>
 			<el-button type="primary" @click="onyinban">印版领退</el-button>
 		</header>
@@ -300,42 +300,42 @@
                         style="width: 100%;height: 400px" border tooltip-effect="dark" :data="gytableData" row-key="ID" @selection-change="handleSelectionChange">
                 <el-table-column type="selection" width="55" />
                 <el-table-column align="left" label="选择" prop="工单编号"  width="100"/>
-                <el-table-column align="left" label="产品名称" prop="重点工序"  width="100"/>
-                <el-table-column align="left" label="工序" prop="工序备注"  width="240"/>
-                <el-table-column align="left" label="备注" prop="机组"  width="100"/>
-                <el-table-column align="left" label="产量" prop="小时产能"  width="100"/>
-                <el-table-column align="left" label="千件工价" prop="生产工时"  width="100"/>
-                <el-table-column align="left" label="日定额" prop="辅助工时"  width="100"/>
-                <el-table-column align="left" label="补产标准" prop="印刷方式"  width="100"/>
-                <el-table-column align="left" label="难度系数" prop="版距"  width="100"/>
-                <el-table-column align="left" label="印刷方式" prop="创建用户"  width="120"/>
-                <el-table-column align="left" label="组员1" prop="Gy0_gxh" width="240" />
-                <el-table-column align="left" label="组员2" prop="gy0_gxmc" width="240" />
-                <el-table-column align="left" label="组员3" prop="add_gxmc" width="240" />
-                <el-table-column align="left" label="组员4" prop="Gy0_Ks" width="240" />
-                <el-table-column align="left" label="组员5" prop="Gy0_ls" width="100" />
-                <el-table-column align="left" label="组员6" prop="备注" width="100" />
-                <el-table-column align="left" label="组员7" prop="工价系数" width="100" />
-                <el-table-column align="left" label="组员8" prop="损耗系数" width="100" />
-                <el-table-column align="left" label="组员9" prop="Gy0_Ms" width="100" />
-                <el-table-column align="left" label="组员10" prop="人工检_正品版" width="120" />
-				<el-table-column align="left" label="制程废品" prop="Sys_id" width="100" />
-				<el-table-column align="left" label="制程次品" prop="建档日期" width="100" />
-				<el-table-column align="left" label="前工序废" prop="更新日期" width="100" />
-				<el-table-column align="left" label="来料异常" prop="YB_方案"  width="100"/>
-				<el-table-column align="left" label="装版工时" prop="YB_Yjno" width="100" />
-				<el-table-column align="left" label="保养工时" prop="印版类别" width="100" />
-				<el-table-column align="left" label="打样工时" prop="存货编码" width="100"/>
-				<el-table-column align="left" label="异常停机工时" prop="印版名称"  width="120"/>
-				<el-table-column align="left" label="通电工时" prop="考核印数" width="100"/>
-				<el-table-column align="left" label="码开始行" prop="Sys_id" width="100" />
-				<el-table-column align="left" label="码结束行" prop="建档日期" width="100" />
-				<el-table-column align="left" label="码包" prop="更新日期" width="100" />
-				<el-table-column align="left" label="主电表" prop="YB_方案"  width="100"/>
-				<el-table-column align="left" label="辅电表" prop="YB_Yjno" width="100" />
-				<el-table-column align="left" label="色度数" prop="印版类别" width="100" />
-				<el-table-column align="left" label="用户" prop="YB_Yjno" width="100" />
-				<el-table-column align="left" label="更新时间" prop="印版类别" width="100" />
+                <el-table-column align="left" label="产品名称" prop="产品名称"  width="100"/>
+                <el-table-column align="left" label="工序" prop="工序"  width="240"/>
+                <el-table-column align="left" label="备注" prop="备注"  width="100"/>
+                <el-table-column align="left" label="产量" prop="产量"  width="100"/>
+                <el-table-column align="left" label="千件工价" prop="千件工价"  width="100"/>
+                <el-table-column align="left" label="日定额" prop="日定额"  width="100"/>
+                <el-table-column align="left" label="补产标准" prop="补产标准"  width="100"/>
+                <el-table-column align="left" label="难度系数" prop="难度系数"  width="100"/>
+                <el-table-column align="left" label="印刷方式" prop="印刷方式"  width="120"/>
+                <el-table-column align="left" label="组员1" prop="组员1" width="240" />
+                <el-table-column align="left" label="组员2" prop="组员2" width="240" />
+                <el-table-column align="left" label="组员3" prop="组员3" width="240" />
+                <el-table-column align="left" label="组员4" prop="组员4" width="240" />
+                <el-table-column align="left" label="组员5" prop="组员5" width="100" />
+                <el-table-column align="left" label="组员6" prop="组员6" width="100" />
+                <el-table-column align="left" label="组员7" prop="组员7" width="100" />
+                <el-table-column align="left" label="组员8" prop="组员8" width="100" />
+                <el-table-column align="left" label="组员9" prop="组员9" width="100" />
+                <el-table-column align="left" label="组员10" prop="组员10" width="120" />
+				<el-table-column align="left" label="制程废品" prop="制程废品" width="100" />
+				<el-table-column align="left" label="制程次品" prop="制程次品" width="100" />
+				<el-table-column align="left" label="前工序废" prop="前工序废" width="100" />
+				<el-table-column align="left" label="来料异常" prop="来料异常"  width="100"/>
+				<el-table-column align="left" label="装版工时" prop="装版工时" width="100" />
+				<el-table-column align="left" label="保养工时" prop="保养工时" width="100" />
+				<el-table-column align="left" label="打样工时" prop="打样工时" width="100"/>
+				<el-table-column align="left" label="异常停机工时" prop="异常总工时"  width="120"/>
+				<el-table-column align="left" label="通电工时" prop="通电工时" width="100"/>
+				<el-table-column align="left" label="码开始行" prop="码开始行" width="100" />
+				<el-table-column align="left" label="码结束行" prop="码结束行" width="100" />
+				<el-table-column align="left" label="码包" prop="码包" width="100" />
+				<el-table-column align="left" label="主电表" prop="主电表"  width="100"/>
+				<el-table-column align="left" label="辅电表" prop="辅电表" width="100" />
+				<el-table-column align="left" label="色度数" prop="色度数" width="100" />
+				<el-table-column align="left" label="用户" prop="用户" width="100" />
+				<el-table-column align="left" label="更新时间" prop="更新时间" width="100" />
               </el-table>
             </el-tab-pane>
           
@@ -588,13 +588,13 @@
           <el-row :gutter="0">
             <el-col :span="4">
               <el-form-item label="设备编号" prop="id">
-                <el-input v-model="formData.sczl_gdbh" :clearable="true" placeholder="2023.12.14" />
+                <el-input v-model="formData.JTMC" :clearable="true" placeholder="2023.12.14" />
               </el-form-item>
             </el-col>
             <el-col :span="20">
               <el-row :gutter="20">
                 <el-col :span="5">
-                  <el-input v-model="formData.sczl_bzdh" :clearable="true" placeholder="ZT01733" />
+                  <el-input v-model="formData.产品名称" :clearable="true" placeholder="ZT01733" />
                 </el-col>
               </el-row>
             </el-col>
@@ -675,19 +675,22 @@
 		  width="1300px"
 		  style="height: 110%;"
 		>
-		  <el-row :gutter="0">
+		  <el-row :gutter="24">
 		    <el-col :span="4">
 		      <el-form-item label="工单编号" prop="id">
-		        <el-input v-model="formData.sczl_gdbh" :clearable="true" placeholder="2023.12.14" />
+		        <el-input v-model="formData.工单编号" :clearable="true" />
 		      </el-form-item>
 		    </el-col>
-		    <el-col :span="20">
-		      <el-row :gutter="20">
-		        <el-col :span="5">
-		          <el-input v-model="formData.sczl_bzdh" :clearable="true" placeholder="ZT01733" />
-		        </el-col>
-		      </el-row>
-		    </el-col>
+			<el-col :span="6">
+			  <el-form-item prop="id">
+			    <el-input v-model="formData.productCode" :clearable="true"  />
+			  </el-form-item>
+			</el-col>
+			<el-col :span="14">
+			  <el-form-item prop="id">
+			    <el-input v-model="formData.产品名称" :clearable="true" />
+			  </el-form-item>
+			</el-col>
 		  </el-row>
 		
 		  <div style="display: flex;">
@@ -790,6 +793,136 @@
 		  </div>
 		</el-dialog>
 		
+		<el-dialog
+		  v-model="xunchaVisible"
+		  title="选择"
+		  destroy-on-close
+		  width="1300px"
+		  style="height: 80%;"
+		>
+		  
+		  <!-- <el-row :gutter="24">
+		    <el-col :span="4">
+		      <el-form-item label="工单编号" prop="id">
+		        <el-input v-model="formData.sczl_gdbh" :clearable="true" placeholder="2023.12.14" />
+		      </el-form-item>
+		    </el-col>
+		    <el-col :span="20">
+		      <el-row :gutter="20">
+		        <el-col :span="5">
+		          <el-input v-model="formData.sczl_bzdh" :clearable="true" placeholder="ZT01733" />
+		        </el-col>
+		      </el-row>
+		    </el-col>
+		  </el-row> -->
+		  
+		
+		<div style="display: flex;">
+		  <div style="flex: 1;">
+		    <el-aside width="250px" style="margin: 0;">
+		      <div class="JKWTree-tree" style="height: 100%; border-right: 1px solid #ebeef5;">		          
+		        <el-tree :data="xunchatreeData" :props="defaultProps" highlight-current="true"
+		          @node-click="xunchaNodeClick"></el-tree>
+		      </div>
+		    </el-aside>
+		  </div>
+		  <div style="flex: 1; margin: 0;">
+		    <el-table
+		      tooltip-effect="dark"
+		      :data="xunchaselectData"
+		      row-key="ID"
+		      highlight-current-row="true"
+		      border  @row-click="dianjianhandle"
+		      style="width:1000px; height:400px;"
+		      @row-dblclick="handleSelectClick"
+		      :row-class-name="rowClassName"
+		    >
+		      <el-table-column
+		        prop="工单编号"
+		        label="工序编号"
+		        width="180"
+		      />
+		      <el-table-column
+		        prop="印件号"
+		        label="印件号"
+		        width="180"
+		      />
+		      
+			  <el-table-column
+				prop="工序名称"
+				label="工序名称"
+				width="180"
+			  />
+			<el-table-column
+			  prop="流程单号"
+			  label="流程单号"
+			  width="180"
+			/>
+			<el-table-column
+			  prop="设备编号"
+			  label="设备编号"
+			  width="180"
+			/>
+			
+			<el-table-column
+			  prop="班组编号"
+			  label="班组编号"
+			  width="180"
+			/>
+			<el-table-column
+			  prop="检验备注"
+			  label="检验备注"
+			  width="180"
+			/>
+			<el-table-column
+			  prop="现场管理人员"
+			  label="现场管理人员"
+			  width="180"
+			/>
+			<el-table-column
+			  prop="提交时间"
+			  label="提交时间"
+			  width="180"
+			/>
+			<el-table-column
+			  prop="开工时间"
+			  label="开工时间"
+			  width="180"
+			/>
+			<el-table-column
+			  prop="分钟差数"
+			  label="分钟差数"
+			  width="180"
+			/>
+			<el-table-column
+			  prop="归属时段"
+			  label="归属时段"
+			  width="180"
+			/>
+			
+		      
+		    </el-table>
+					  <!-- <el-row :gutter="20">
+					    <el-col :span="20">			      
+					        <el-input v-model="pandingfangfa"  style="height: 50px;" :clearable="true"  />			      
+					    </el-col>
+					  </el-row> -->
+		  </div>
+		</div>
+		
+		
+		  
+		  
+		  
+		  
+		  <template #footer>
+		    <div class="dialog-footer">
+		      <!-- <el-button @click="closeDialog">关 闭</el-button> -->
+		      <!-- <el-button type="primary" @click="xunjianerDialog">提 交</el-button> -->
+		    </div>
+		  </template>
+		</el-dialog>
+		
         </el-main>
 
       </el-container>
@@ -837,8 +970,8 @@ import {
 } from '@/api/jixiaoguanli/jitairibaobiao'
 
 import {
-  demoCustomer
-} from "@/api/demo";
+  FieldInspectionRecord
+} from "@/api/mes/job";
 
 // 全量引入格式化工具 请按需保留
 import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDownloadFile } from '@/utils/format'
@@ -848,15 +981,13 @@ import { ref, reactive } from 'vue'
 defineOptions({
     name: 'Company'
 })
-let checked1=ref(false)
-let checked2=ref(false)
-let checked3=ref(false)
+const gytableData = ref([])
 const detailData = reactive([])
 const treeData=ref([])
 const yinbantreeData=ref([])
 let  dianjiantreeData;
 let JTMC=ref()
-let productCode=ref(104601001)
+let productCode=ref()
 const sbzyData = reactive([])
 const FPData = reactive([])
 const CLMXData = reactive([])
@@ -886,6 +1017,7 @@ const FacilityProduction = async () => {
 	    formData.value.印件编号 = response.data[0].印件号;
 	    formData.value.工序名称 = response.data[0].工序名称;
 	    formData.value.产品名称 = response.data[0].产品名称;
+		formData.value.JTMC=JTMC
 	    FacilityTeam(JTMC)
 		
 	       // 填充sczl_bh和sczl_name字段
@@ -920,6 +1052,7 @@ const FacilityWorklist = async () => {
 	console.log(response)
 	sbzyData.splice(0, sbzyData.length, ...response.data);
 	const res = await facilityProcedure({ Gd_gdbh: sbzyData[0]['工单编号|质量信息'].substring(0, 7) })
+	formData.value.productCode= response.data[0]['产品代号']
 	console.log(res)
 	if (res.code === 0) {
 	    selectData.value = res.data
@@ -1028,6 +1161,8 @@ const total = ref(0)
 const pageSize = ref(10)
 const tableData = ref([])
 const searchInfo = ref({})
+const xunchaVisible = ref(false)
+const xunchatreeData=ref([{label: '现场巡查记录',} ])
 
 // 重置
 const onReset = () => {
@@ -1143,7 +1278,7 @@ function ondianjian() {
 }
 
 const onyinban = async() => {
-	const res = await facilityPrintGetTab({productCode:productCode.value})
+	const res = await facilityPrintGetTab({productCode:formData.value.productCode})
 	if(res.code===0){
 		yinbantreeData.value=[{
 			label:'产品印版库',
@@ -1159,6 +1294,24 @@ const onyinban = async() => {
 		yinbanVisible.value = true;
 	}
 }
+const onxuncha = async() => {
+	// const res = await facilityPrintGetTab({productCode:productCode.value})
+	// if(res.code===0){
+	// 	yinbantreeData.value=[{
+	// 		label:'产品印版库',
+	// 		children:res.data.map(item=>({
+	// 		label:item.印版分类,
+	// 		code:item.编号
+	// 	}))
+	// 	}]
+	// 	console.log(res.data.map(item=>({
+	// 		label:item.印版分类,
+	// 		code:item.编号
+	// 	})))
+		xunchaVisible.value=true 
+	// }
+	
+}
 // function onyinban() {
 	
 //   getSpotCheckItem(productCode).then(treeData  => {
@@ -1222,6 +1375,7 @@ const facilityPrintDetailItem = async (value) => {
 //树形结构单机
 const dianjianselectData = reactive([])
 const yinbanselectData = ref([])
+const xunchaselectData = ref([])
 const dianjianNodeClick = (node, check, nodeData) => {
   if (node.children && node.children.length > 0) {
     // 点击的是父节点,且有子节点
@@ -1244,6 +1398,19 @@ const yinbanNodeClick = (node, check, nodeData) => {
      facilityPrintDetailItem(node.code)
   }
 };
+const xunchaNodeClick = (node, check, nodeData) => {
+	if(node){
+		fieldInspectionRecord()
+	}
+}
+
+const fieldInspectionRecord = async () => {
+	const response = await FieldInspectionRecord({ workOrder: '2311114',team:'A班',start:'2024-01-19 08:30:00' });
+	if (response.code === 0) {
+		xunchaselectData.value=response.data
+	}
+}
+
 let pandingfangfa=ref()
 //检验项目单击
 const dianjianhandle =  (val, row) => {
@@ -1691,6 +1858,7 @@ const openDialog = () => {
     // type.value = 'create'
 	console.log('222')
 	FacilityInspect()
+	FacilitychanLiang()
     dialogFormVisible.value = true
 }
 let drzcData=[]
@@ -1735,6 +1903,29 @@ const FacilityInspect = async () => {
 	  console.log(drzcData);
   }
 }
+const FacilitychanLiang = async () => {
+  const response = await facilitychanLiang({machine:'JY01#',date:'2024-01-04'});
+  // console.log( response.data)
+  if(response.code==0){
+	 delete response.data['totalA']
+	 delete response.data['totalB']
+	 gytableData.value=Object.values(response.data)
+	 console.log( response.data)
+	 // for (let key in response.data) {
+	 //   // 忽略 "productingAll" 和 "progressAll"
+	 //   if (key !== "productingAll" && key !== "progressAll") {
+	 //     let temp = data.data[key];
+	 //     let object = {};
+	 //     object.id = temp[0];
+	 //     object.label = data.data[key];
+	 //     object.children = [];
+	 //     treeData.data.push(object);
+	 //   }
+	 // }
+	 
+  }
+}
+
 // 关闭弹窗
 const closeDialog = () => {
     dialogFormVisible.value = false