Jelajahi Sumber

Merge branch 'master' of https://git.7in6.com/Minong/mes-admin-backend-ui

曹鹤洋 1 tahun lalu
induk
melakukan
c08335eaea
1 mengubah file dengan 131 tambahan dan 152 penghapusan
  1. 131 152
      src/view/performance/chejianbaogong.vue

+ 131 - 152
src/view/performance/chejianbaogong.vue

@@ -2,19 +2,19 @@
   <div>
 	<header>
 		<div style="height: 50px;">
-			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 70px" @click="onBZ" >班组维护</el-button>
-			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 90px" @click="onchanliang"  v-if="zdtreeType === true" >日产量上报</el-button>
-			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 60px" title="完工按钮" @click="onOver" >完工</el-button>
-			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 70px" @click="onzhicheng"  >制程检验</el-button>
-			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 70px" @click="ondianjian"  >设备点检</el-button>
-			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 70px" @click="onxuncha" >管理巡查</el-button>
-			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 95px" @click="onstatus" >设置机台状态</el-button>
-			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 70px" @click="onyinban">印版领退</el-button>
-			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 70px" @click="onClear" >换型清场</el-button>
-			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 70px" @click="pd_gdprintonClick" >工单打印</el-button>
-			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 95px" @click="gzSel" >员工工资查询</el-button>
-			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 70px" @click="oncomplaints" >客诉记录</el-button>
-      <el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 120px" @click="deldbcl_onclick" :disabled="dbclSelection === ''"   title="当班产量明细" >当班产量明细删除</el-button>
+			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 70px"  @click="onBZ" >班组维护</el-button>
+			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 90px"  @click="onchanliang"  v-if="zdtreeType === true" >日产量上报</el-button>
+			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 60px"  @click="onOver" title="完工按钮" >完工</el-button>
+			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 70px"  @click="onzhicheng"  >制程检验</el-button>
+			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 70px"  @click="ondianjian"  >设备点检</el-button>
+			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 70px"  @click="onxuncha" >管理巡查</el-button>
+			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 95px"  @click="onstatus" >设置机台状态</el-button>
+			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 70px"  @click="onyinban">印版领退</el-button>
+			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 70px"  @click="onClear" >换型清场</el-button>
+			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 70px"  @click="pd_gdprintonClick" >工单打印</el-button>
+			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 95px"  @click="gzSel" >员工工资查询</el-button>
+			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 70px"  @click="oncomplaints" >客诉记录</el-button>
+			<el-button type="primary" size="large" class="bt" style="color:white;font-size: 15px;font-weight: bold;width: 120px" @click="deldbcl_onclick" :disabled="dbclSelection === ''"   title="当班产量明细" >当班产量明细删除</el-button>
     </div>
 		</header>
     <el-container>
@@ -81,10 +81,9 @@
 		  </el-col>
 		</el-row>
 	</div>
-<!-- overflow: hidden;flex: 1;  -->
+	<!-- overflow: hidden;flex: 1;  -->
 	<div style="border: 0px lawngreen solid; margin: 0; padding: 0;width:34%;">
-	 <el-table tooltip-effect="dark" :data="selectData" row-key="ID"
-	   highlight-current-row="true" border
+	 <el-table tooltip-effect="dark" :data="selectData" row-key="ID" highlight-current-row="true" border
       :row-style="{ height: '20px'}" :cell-style="{ padding: '0px'}"
 	  :header-row-style="{ height: '20px'}" style="width:100%;height: 30vh;"  @row-dblclick="handleSelectClick" >
 	   <el-table-column prop="process" label="印件及工序"width="280" />
@@ -94,22 +93,23 @@
 
 </div>
 
-
-
-
-
           <div class="gva-table-box" style="margin-top: 20px;">
             <el-tabs v-model="activName" type="card" @tab-click="duohandleClick"   >
-			<el-tab-pane label="设备作业清单" @click="showTable('设备作业清单')" name="first"  :class="{ 'active-tab': activeTab === 'first' }" style="font-size: 16px;">
-				<el-table ref="multipleTable"
-						:show-overflow-tooltip="true"
-						highlight-current-row="true"
-						:row-style="{ height: '40px' }"
-						:cell-style="{ padding: '0px' }" :header-row-style="{ height: '40px' }"
-						:header-cell-style="{ padding: '0px' }"
-            @contextmenu.prevent="yjonRightClick"
-						@row-click="yjupdateCompanyFunc"
-						style="width: 100%;height: 330px;color:purple;font-weight: bold;" border tooltip-effect="dark" :data="sbzyData" row-key="ID" @selection-change="handleSelectionChange">
+			<el-tab-pane label="设备作业清单" @click.native="showTable('设备作业清单', 'first')" name="first"  :class="{ 'active-tab': activeTab === 'first' }" style="font-size: 16px;">
+				<el-table ref="multipleTable" 
+					:show-overflow-tooltip="true" 
+					highlight-current-row="true"
+					:cell-class-name="sbzyqdsatusCellClass"
+					:row-style="{ height: '40px' }" 
+					:cell-style="{ padding: '0px' }" 
+					:header-row-style="{ height: '40px' }"
+					:header-cell-style="{ padding: '0px' }"
+					@contextmenu.prevent="yjonRightClick" 
+					@row-click="yjupdateCompanyFunc"
+					style="width: 100%;height: 330px;color:purple;font-weight: bold;" border tooltip-effect="dark"
+					:data="sbzyData" 
+					row-key="ID" 
+					@selection-change="handleSelectionChange">
 <!--                <el-table-column type="selection" width="55" />-->
 				<!-- <el-table-column align="left" label="选择" prop="bh"  width="80"/> -->
 				<el-table-column align="left" sortable label="工单编号|质量信息" prop="工单编号|质量信息" width="168"/>
@@ -127,42 +127,43 @@
 
 
         <el-tab-pane label="班组人员及分配比例" @click="showTable('班组人员及分配比例')" name="second">
-						  <el-table ref="multipleTable"
-									:show-overflow-tooltip="true"
-                        highlight-current-row="true"
-									:row-style="{ height: '40px' }"
-									:cell-style="{ padding: '0px' }" :header-row-style="{ height: '40px' }"
-									:header-cell-style="{ padding: '0px' }"
-                        @contextmenu.prevent="bzonRightClick"
-									@row-dblclick="gyupdateCompanyFunc"
-									:row-class-name="rowClassStyle"
-									:cell-class-name="bzryplanUsageCellClass"
-									style="width: 100%;height: 400px;color:purple;font-weight: bold;" border tooltip-effect="dark" :data="FPData" row-key="ID" @selection-change="handleSelectionChange"
-									@row-click="clickybupdate">
-						   <el-table-column type="selection" label="选择" width="55" />
-							<el-table-column align="left" label="班组号" prop="班组号" width="80" />
-							<el-table-column align="left" label="组员1" prop="0" width="240" />
-							<el-table-column align="left" label="组员2" prop="1" width="240" />
-							<el-table-column align="left" label="组员3" prop="2" width="240" />
-							<el-table-column align="left" label="组员4" prop="3" width="240" />
-							<el-table-column align="left" label="组员5" prop="4" width="220" />
-							<el-table-column align="left" label="组员6" prop="5" width="100" />
-							<el-table-column align="left" label="组员7" prop="6" width="100" />
-							<el-table-column align="left" label="组员8" prop="7" width="100" />
-							<el-table-column align="left" label="组员9" prop="8" width="100" />
-							<el-table-column align="left" label="组员10" prop="9_正品版" width="120" />
-						  </el-table>
-						</el-tab-pane>
-
-            <el-tab-pane label="当班产量明细" @click="showsTable('当班产量明细')" name="third">
-            <el-table ref="multipleTable"
-                      highlight-current-row="true"
-                      :show-overflow-tooltip="true"
-                      :row-style="{ height: '40px' }"
-                      :cell-style="{ padding: '0px'}" :header-row-style="{ height: '40px' }"
-                      :header-cell-style="{ padding: '0px' }"
-                      @row-dblclick="ybupdateCompanyFunc"
-                      style="width: 100%;height: 400px;color:purple;font-weight: bold;" border tooltip-effect="dark"
+			  <el-table ref="multipleTable" 
+					:show-overflow-tooltip="true" 
+					highlight-current-row="true"
+					:row-style="{ height: '40px' }" 
+					:cell-style="{ padding: '0px' }" 
+					:header-row-style="{ height: '40px' }"
+					:header-cell-style="{ padding: '0px' }" 
+					@contextmenu.prevent="bzonRightClick"
+					@row-dblclick="gyupdateCompanyFunc" 
+					:row-class-name="rowClassStyle"
+					:cell-class-name="bzryplanUsageCellClass"
+					style="width: 100%;height: 400px;color:purple;font-weight: bold;" 
+					border 
+					tooltip-effect="dark" 
+					:data="FPData" 
+					row-key="ID" 
+					@selection-change="handleSelectionChange"
+					@row-click="clickybupdate">
+			    <el-table-column type="selection" label="选择" width="55" />
+				<el-table-column align="left" label="班组号" prop="班组号" width="80" />
+				<el-table-column align="left" label="组员1" prop="0" width="240" />
+				<el-table-column align="left" label="组员2" prop="1" width="240" />
+				<el-table-column align="left" label="组员3" prop="2" width="240" />
+				<el-table-column align="left" label="组员4" prop="3" width="240" />
+				<el-table-column align="left" label="组员5" prop="4" width="220" />
+				<el-table-column align="left" label="组员6" prop="5" width="100" />
+				<el-table-column align="left" label="组员7" prop="6" width="100" />
+				<el-table-column align="left" label="组员8" prop="7" width="100" />
+				<el-table-column align="left" label="组员9" prop="8" width="100" />
+				<el-table-column align="left" label="组员10" prop="9_正品版" width="120" />
+			  </el-table>
+			</el-tab-pane>
+
+		<el-tab-pane label="当班产量明细" @click="showsTable('当班产量明细')" name="third">
+            <el-table ref="multipleTable" highlight-current-row="true" :show-overflow-tooltip="true" :row-style="{ height: '40px' }"
+                      :cell-style="{ padding: '0px'}" :header-row-style="{ height: '40px' }" :header-cell-style="{ padding: '0px' }"
+                      @row-dblclick="ybupdateCompanyFunc" style="width: 100%;height: 400px;color:purple;font-weight: bold;" border tooltip-effect="dark"
                       :data="CLMXData" row-key="ID" @selection-change="dbclmxSelectionChange">
               <el-table-column type="selection" width="55" />
               <el-table-column align="left" label="生产时段" prop="生产时间段"  width="180"/>
@@ -187,7 +188,7 @@
               <el-table-column align="left" label="辅电表" prop="辅电表" width="100" />
               <el-table-column align="left" label="色度数" prop="色度" width="100" />
             </el-table>
-            </el-tab-pane>
+		</el-tab-pane>
 
                         <el-tab-pane label="检验记录" @click="showTable('检验记录')" name="fourth">
                         <el-table ref="multipleTable"
@@ -212,7 +213,6 @@
                            ></el-table-column>
                         </el-table>
                         </el-tab-pane>
-
                       </el-tabs>
             <!-- <div class="gva-pagination">
               <el-pagination
@@ -2299,7 +2299,7 @@ const FacilityWorklist = async () => {
 			formData.value.productCode=item.产品代号
 		}
 	})
-	  selectData.value=[]
+	selectData.value=[]
     console.log(formData.value.工单编号)
     const res = await facilityProcedure({ Gd_gdbh: formData.value.工单编号 })
   	console.log(res)
@@ -2437,30 +2437,6 @@ const clickybupdate = async (row) => {
   console.log(row)
   roww.value = row
   console.log('班组人员及分配比例单机')
-  // ElMessageBox.confirm('确定切换当前班组人员为工作班组人员吗?', '提示', {
-  //     confirmButtonText: '确定',
-  //     cancelButtonText: '取消',
-  //     type: 'warning'
-  // }).then(() => {
-  //         setTeams(row)
-  //     })
-  // const response = await facilityWorklist({machine:JTMC});
-  // if (response.code === 0) {
-  //   sbzyData.splice(0, sbzyData.length, ...response.data);
-  //   // formData.value.productCode= response.data[0]['产品代号']
-  //   response.data.map(item=>{
-  //     if(item['工单编号|质量信息'].substring(0, 7)==formData.value.工单编号){
-  //       formData.value.productCode=item.产品代号
-  //     }
-  //   })
-  //   selectData.value=[]
-  //   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
-  //   }
-  // }
 }
 //班组人员及分配比例双击
 const gyupdateCompanyFunc = async (row) => {
@@ -3165,9 +3141,9 @@ const deldbcl_onclick = async () => {
 		const response = await facilityDetail({ machine: JTMC, Gd_gdbh: formData.value.工单编号, team: BZMC.value });
 		console.log(response);
 		// if (response.code === 0) {
-		 
+
 		// }
-		
+
 		if (response.data === null) {
 				CLMXData.splice(0, CLMXData.length, ...Object.values([]));
 			return false;
@@ -3949,13 +3925,24 @@ const rowClassName = (row, column) => {
     return '';
   }
 };
+//点击label获取表格数据
 function duohandleClick(table) {
   console.log(table.props.label)
+  if(table.props.label === '设备作业清单'){
+	  FacilityWorklist();
+  }
+  if(table.props.label === '班组人员及分配比例'){
+  	 FacilityTeam(JTMC)
+  }
   if(table.props.label=='当班产量明细'){
+	  FacilityDetail()
 	  zdtreeType.value=true
   }else{
 	  zdtreeType.value=false
   }
+  if(table.props.label === '检验记录'){
+  	  InspectionRecord()
+  }
 }
 
 // 异步函数,用于获取指定设备的巡检项目,并且将结果格式化为树形结构数据
@@ -3997,7 +3984,7 @@ const getSpotCheckItem = async (machineName) => {
 
 // 班组人员及分配比例
 const FacilityTeam = async (value) => {
-  console.log('机台班组维护机台获取:'+value)
+  console.log('班组人员及分配比例:'+value)
   const response = await facilityTeam({ machine: value });
   if (response.code === 0) {
     // 清空 bzData 数组
@@ -4055,7 +4042,7 @@ const FacilityTeam = async (value) => {
             }
           }
         }
-        console.log(formDatas)
+        // console.log(formDatas)
       }
     })
     // 遍历接口返回的数据,并给每个对象添加 JTMC 属性
@@ -4066,7 +4053,7 @@ const FacilityTeam = async (value) => {
     // 将更新后的数据添加到 bzData 数组
     bzData.push(...updatedData);
 	// FPData.push(...updatedData)
-	console.log(FPData)
+	// console.log(FPData)
   }
 };
 //班组维护
@@ -4074,7 +4061,7 @@ function onBZ() {
 	FacilityTeam(JTMC)
 	fetchData()
 	detailShow.value=true
-	console.log('2222')
+	// console.log('2222')
 }
 
 
@@ -4300,7 +4287,7 @@ const BZhandle = (val) => {
       }
     }
   }
-  console.log(formDatas)
+  // console.log(formDatas)
   // for (const key in val) {
   //   if (val[key] === 0) {
   //     break;
@@ -4551,9 +4538,10 @@ const handleSelectionChange = (val) => {
 const zdtreeType = ref(false)
 const selectData = ref([])
 const showsTable = (val,tab) => {}
+// 点击showTable 行数据时出发点击事件
 const showTable = (val,tab) => {
-	// zdtreeType.value=false
 }
+
 // 删除行
 const deleteRow = (row) => {
     ElMessageBox.confirm('确定要删除吗?', '提示', {
@@ -4627,8 +4615,6 @@ const yjonRightClick = async(row) => {
 
 const setMachineTeams = async(row) => {
 	console.log(row)
-	// console.log(row['印件资料'].split('-')[0].split('0')[1])
-	// console.log(row.UniqId)
     const res = await setMachineTeam({
 			machine: JTMC.split("#")[0],
 			order:row['工单编号|质量信息'].split('|')[0],
@@ -4642,7 +4628,6 @@ const setMachineTeams = async(row) => {
 			})
 	MachineWorkOrderEdits(row)
     if (res.code === 0) {
-      // EquipmentSchedulingEdits(row)
       ElMessage({
 		        type: 'success',
 		        message: '成功'
@@ -4747,22 +4732,11 @@ const getDetails = async (row) => {
 // 关闭详情弹窗
 const closeDetailShow = () => {
   detailShow.value = false
-  // formData.value = {
-  //         address: '',
-  //         image: '',
-  //         name: '',
-  //         }
 }
 
 
 // 打开弹窗
-const openDialog = () => {
-    // type.value = 'create'
-
-	// console.log('222')
-	// FacilityInspect()
- //    dialogFormVisible.value = true
-}
+const openDialog = () => {}
 let drzcData=[]
 let columnNames=[]
 //当日制程检验记录
@@ -4808,12 +4782,6 @@ const FacilityInspect = async () => {
 // 关闭弹窗
 const closeDialog = () => {
 	chanliangVisible.value=false
-  // dialogFormVisible.value = false
-  //   formData.value = {
-  //       address: '',
-  //       image: '',
-  //       name: '',
-  //       }
 }
 const equipmentCode=ref('JY01')
 const equipmentName=ref('海德堡对开')
@@ -4821,50 +4789,61 @@ const workOrder=ref('2312117')
 const number=ref('1907')
 // 弹窗确定
 const enterDialog = async () => {
-     elFormRef.value?.validate( async (valid) => {
-             if (!valid) return
-              let res
-              switch (type.value) {
-                case 'create':
-                  res = await createCompany(formData.value)
-                  break
-                case 'update':
-                  res = await updateCompany(formData.value)
-                  break
-                default:
-                  res = await createCompany(formData.value)
-                  break
-              }
-              if (res.code === 0) {
-                ElMessage({
-                  type: 'success',
-                  message: '创建/更改成功'
-                })
-                closeDialog()
-                getTableData()
-              }
-      })
+ elFormRef.value?.validate( async (valid) => {
+	 if (!valid) return
+	  let res
+	  switch (type.value) {
+		case 'create':
+		  res = await createCompany(formData.value)
+		  break
+		case 'update':
+		  res = await updateCompany(formData.value)
+		  break
+		default:
+		  res = await createCompany(formData.value)
+		  break
+	  }
+	  if (res.code === 0) {
+		ElMessage({
+		  type: 'success',
+		  message: '创建/更改成功'
+		})
+		closeDialog()
+		getTableData()
+	  }
+  })
 }
 
-const sbzyqdplanUsageCellClass = ({row, column, rowIndex, columnIndex}) =>{
-  if(formData.value['工单编号'] === row['工单编号|质量信息'].split('|')[0]){
-    return 'back-color-row';
-  }
-}
+// const sbzyqdplanUsageCellClass = ({row, column, rowIndex, columnIndex}) =>{
+//   if(formData.value['工单编号'] === row['工单编号|质量信息'].split('|')[0]){
+//     return 'back-color-row';
+//   }
+// }
+// 班组人员及分配比例
 const bzryplanUsageCellClass = ({row, column, rowIndex, columnIndex}) =>{
   if(formData.value['班组Id'] === row.ID){
     return 'back-color-row';
   }
 }
+// 组员及分配比例
 const blplanUsageCellClass = ({row, column, rowIndex, columnIndex}) =>{
   if (column.property === '员工编号' || column.property === 'ygxm') {
     return 'plan-usage-low';
   }
 }
-
+//设备作业清单 正在生产中 背景颜色
+const sbzyqdsatusCellClass = ({row, column, rowIndex, columnIndex}) =>{
+  if (row.status === 1) {
+    return 'status-plan-usage-low';
+  }
+}
 </script>
-
 <style scoped>
+/* 设备作业清单 正在生产中 背景颜色 */
+:deep(.status-plan-usage-low ) {
+  background: yellow !important;
+}
+	
 .JKWTree-container {
   display: flex;
 }