Эх сурвалжийг харах

机台日报表页面优化,附加页面新增编写

曹鹤洋 1 жил өмнө
parent
commit
e6683ff77a

+ 150 - 75
src/view/performance/Dayreportattached.vue

@@ -49,66 +49,48 @@
             </div>
           </div>
           <!-- 弹出框 -->
-          <el-dialog v-model="dialogFormVisible" :before-close="closeDialog" :title="type === 'create' ? '添加' : '修改'"
-            destroy-on-close width="1200px">
+          <el-dialog v-model="dialogFormVisible" :before-close="closeDialog" :title="type === 'create' ? '新增' : '修改'"
+            destroy-on-close width="700px">
             <!-- <el-scrollbar height="500px"> -->
-            <el-form :model="formData" label-position="left" ref="elFormRef" :rules="rule">
+            <el-form :model="formData" label-position="right" ref="elFormRef" :rules="rule" label-width="80px">
 
-              <el-row :gutter="20">
-
-                <el-col :span="6">
-                  <el-form-item label="日期" prop="name">
-                    <el-row :gutter="20">
-                      <el-col :span="12">
-                        <el-input v-model="formData.sczl_rq" id="日期"  @keydown="ent($event, '备注', '日期', '机器')" :clearable="true" placeholder="ZT01733" />
-                      </el-col>
-                    </el-row>
+              <el-row :gutter="24">
+                <el-col :span="8">
+                  <el-form-item label="日期" prop="name" class="mab">
+                        <el-input v-model="formData.sczl_rq" type="date" max="9999-12-31" id="日期" @focus="rqHandleFocus()" @keydown="ent($event, '备注', '日期', '机器')" placeholder="" />
                   </el-form-item>
                 </el-col>
               </el-row>
 
-              <el-row :gutter="20">            
-                <el-col :span="8">
-                  <el-row :gutter="20">
-                    <el-col :span="14">
-                      <el-form-item label="机器" prop="id">
-                        <el-input v-model="formData.sczl_jtbh" id="机器"  @keydown="ent($event, '日期', '机器', '设备名称')" @keyup.enter.native="getJTsubmit" :clearable="true" placeholder="0.00" />
-                      </el-form-item>
-                    </el-col>
-                    <el-col :span="10">                     
-                        <el-input v-model="formData.设备名称" id="设备名称"  @keydown="ent($event, '机器', '设备名称', '组别')" :clearable="true" placeholder="是" />
-                    </el-col>
-                  </el-row>
-                </el-col>
+              <el-row :gutter="24">
+				<el-col :span="8">
+				  <el-form-item label="机器" prop="id" class="mab">
+					<el-input v-model="formData.sczl_jtbh" id="机器"  @keydown="ent($event, '日期', '机器', '设备名称')" @blur="getJTsubmit()" style="width: 200px; " placeholder="" />
+				  </el-form-item>
+				</el-col>
+				<el-col :span="16">                     
+					<el-input v-model="formData.设备名称" id="设备名称" :readonly=true  @keydown="ent($event, '机器', '设备名称', '组别')" style="width: 400px;" placeholder="" />
+				</el-col>
               </el-row>
 			  
-			  <el-row :gutter="20">
-			
-			    <el-col :span="8">
-			      <el-row :gutter="20">
-			        <el-col :span="14">
-			          <el-form-item label="组别" prop="id">
-			            <el-input v-model="formData.sczl_bzdh" id="组别"  @keydown="ent($event, '设备名称', '组别', '通电时间')" :clearable="true" placeholder="0.00" />
-			          </el-form-item>
-			        </el-col>
-			        <el-col :span="10">
-			            <el-form-item label="通电时间" prop="id">
-			            <el-input v-model="formData.sczl_设备运行工时" id="通电时间"  @keydown="ent($event, '组别', '通电时间', '备注')" :clearable="true" placeholder="是" />
-			            </el-form-item>
-			        </el-col>
-			      </el-row>
-			    </el-col>
+			  <el-row :gutter="24">
+				<el-col :span="6">
+				  <el-form-item label="组别" prop="id" class="mab">
+					<el-input v-model="formData.sczl_bzdh" id="组别"  @keydown="ent($event, '设备名称', '组别', '通电时间')" style="width: 120px;" placeholder="" />
+				  </el-form-item>
+				</el-col>
+				<el-col :span="8">
+					<el-form-item label="通电时间" prop="id" label-width="133px" class="mab">
+					<el-input v-model="formData.sczl_设备运行工时" id="通电时间"  @keydown="ent($event, '组别', '通电时间', '备注')" style="width: 200px;" placeholder="" />
+					</el-form-item>
+				</el-col>
 			  </el-row>
 			  
-			  <el-row :gutter="20">			 
-			    <el-col :span="8">
-			      <el-row :gutter="20">
-			        <el-col :span="14">
-			        <el-form-item label="备注" prop="id" style="margin-top: 10px;">
-			          <el-input v-model="formData.sczl_desc" id="备注"  @keydown="ent($event, '通电时间', '备注', '日期')" :clearable="true" placeholder="" />
+			  <el-row :gutter="24">			 
+			    <el-col :span="21">
+			        <el-form-item label="备注" prop="id" class="mab">
+			          <el-input type="textarea" rows="3" cols="50" v-model="formData.sczl_desc" id="备注"  @keydown="ent($event, '通电时间', '备注', '日期')" :clearable="true" placeholder="" />
 			        </el-form-item>
-			        </el-col>
-			      </el-row>
 			    </el-col>
 			  </el-row>
 			  
@@ -123,18 +105,18 @@
           </el-dialog>
 
           
-		  <el-dialog
-		    v-model="GetjtbhVisible"
-		    title="选择"
-		    destroy-on-close
-		    width="600px"
-		  			>		     
-		       <el-aside width="250px">
-		         <div class="JKWTree-tree">		          
-		           <el-tree :data="GetJTtreeData" :props="defaultProps" highlight-current="true"
-		             @node-click="GetMachineDedhhandleNodeClick" @node-dblclick="handleNodeDoubleClick"></el-tree>
-		         </div>
-		       </el-aside>		       
+		  <el-dialog v-model="GetjtbhVisible" title="选择"
+		    destroy-on-close width="600px" >
+		         <div class="JKWTree-tree">	
+					<el-input v-model="searchGetjtbh" placeholder=""  style="width: 180px;"></el-input>
+					<el-button type="primary" icon="search" @click="GetjtbhSubmit" class="search"></el-button>
+
+		           <el-tree :data="GetJTtreeData" :props="defaultProps"
+					 highlight-current="true"
+		             @node-click="GetMachineDedhhandleNodeClick"
+					 @node-dblclick="handleNodeDoubleClick"
+					 ></el-tree>
+		         </div>	       
 		  </el-dialog>
 		  
         </el-main>
@@ -199,7 +181,7 @@ const formData = ref({
              sczl_jtbh: '',
              设备名称: '',
              sczl_bzdh: '',
-             sczl_设备运行工时: '',
+             sczl_设备运行工时: '0.00',
              sczl_desc: '',
 			 sys_id:'[1002/郑小丽]',
 })
@@ -218,6 +200,7 @@ const total = ref(0)
 const page = ref(1)
 const limit = ref(10)
 const searchInfo = ref('')
+const searchGetjtbh = ref('')
 const params = {
   date: '',
   sys_id: '',
@@ -350,7 +333,15 @@ const closeDialog = () => {
     image: '',
     name: '',
   }
-}
+}
+
+const rqHandleFocus = () =>{
+	if(formData.value.sczl_rq==''){
+		formData.value.sczl_rq = new Date().toISOString().split('T')[0]
+	}
+}
+
+
 // 弹窗确定
 const enterDialog = async () => {
 	
@@ -404,10 +395,75 @@ const AddgetInfo = async (value) => {
   if (response.code === 0) {
 	formData.value=response.data[0];
   }
-}
+}
+
 //机台回车事件
 const getJTsubmit = (event, inputName) => {
-	  GetJtbh()
+	  addgetJtbh({sys_mc:''}).then(response=>{
+		  if(response.code==0){
+			var flag = 0;
+			for (const arr of response.data[0]['使用部门']) {
+				if(!flag){
+					for (const arr1 of response.data[0][arr]) {
+						if(arr1['jtbh'] == formData.value.sczl_jtbh){
+							flag = 1
+							break;
+						}
+					}
+				}else{
+					break;
+				}
+			}
+			if(!flag){
+				// 遍历接口返回的数据,构建父子关系
+				GetJTtreeData.splice(0, GetJTtreeData.length);
+				response.data.forEach(item => {
+				  const departments = item["使用部门"];
+				  departments.forEach(department => {
+				    const departmentData = {
+				      label: department,
+				      value: department,
+				      children: item[department].map(device => {
+				        return {
+				          label: device["jtbh"]+'/'+device["设备名称"],
+				          value: device["jtbh"]
+				        };
+				      })
+				    };
+				    GetJTtreeData.push(departmentData);
+				  });
+				});
+				  GetjtbhVisible.value=true
+			}
+			  return
+		  	 
+		  	   
+		  }
+	  })
+}
+const GetjtbhSubmit = () =>{
+	addgetJtbh({sys_mc:searchGetjtbh.value}).then(response=>{
+			  if(response.code==0){
+				// 遍历接口返回的数据,构建父子关系
+				GetJTtreeData.splice(0, GetJTtreeData.length);
+				response.data.forEach(item => {
+				  const departments = item["使用部门"];
+				  departments.forEach(department => {
+					const departmentData = {
+					  label: department,
+					  value: department,
+					  children: item[department].map(device => {
+						return {
+						  label: device["jtbh"]+'/'+device["设备名称"],
+						  value: device["jtbh"]
+						};
+					  })
+					};
+					GetJTtreeData.push(departmentData);
+				  });
+				});
+			  }
+	})
 }
 const GetjtbhVisible = ref(false)
 let GetJTtreeData = reactive([]);
@@ -446,15 +502,9 @@ const GetJtbh = async () => {
   console.log(response)
 }
 const GetMachineDedhhandleNodeClick = (node,check,nodeData) => {
-  if (node.children) {
-       // 点击的是父节点
-       // 执行相应的父节点单击事件处理逻辑
-	   console.log('2222')
-     } else {
+  if (!node.children){
        // 点击的是子节点
        // 执行相应的子节点单击事件处理逻辑
-       console.log('11111');
-	   console.log(node.label)
 	   const splitIndex = node.label.indexOf('/');
 	   formData.value.sczl_jtbh = node.label.substring(0, splitIndex);
 	   formData.value.设备名称 = node.label.substring(splitIndex + 1);
@@ -552,10 +602,9 @@ const AddDel = async (value) => {
 }
 const ADD=ref('0')
 //新增
-function onAdd() {
-	AddgetInfo(lastCellValue)
+const onAdd = () => {
+	type.value = 'create'
 	ADD.value='新增'
-	console.log(ADD.value)
 	dialogFormVisible.value = true
 	// Productionadd()
 }
@@ -608,4 +657,30 @@ onMounted(async () => {
   background: #ff80ff !important;
   /* 背景颜色 */
 }
+</style>
+<style scoped>
+:deep(.el-table td .cell) {
+  line-height: 20px !important;
+}
+:deep(.el-tabs__header){
+  margin-bottom: 0;
+}
+.search{
+  margin-left: 0px !important;
+  margin-right: 10px !important;
+}
+.bt{
+  margin-left: 2px !important;
+  padding: 3px !important;
+  font-size: 12px;
+}
+.el-tabs__header{
+  margin: 0px !important;
+}
+.gva-table-box{
+  padding: 0px !important;
+}
+.mab{
+  margin-bottom: 5px;
+}
 </style>

+ 72 - 49
src/view/performance/Dayreports.vue

@@ -14,64 +14,65 @@
         <el-main>
           <!-- 按钮区域 -->
           <div class="gva-table-box">
-            <div class="gva-btn-list">
-              <el-row :span="6">
-                <el-input v-model="positionvalue" placeholder="输入工单编号或产品名称" />
-              </el-row>
-              <el-button type="primary" :icon="Search" @click="onSearch">搜索</el-button>
-			  <el-button type="primary"  @click="onCountByGdbh">切换显示方式</el-button>
-			  <el-button type="primary" @click="onAdd">新增</el-button>
-              <el-button type="primary" @click="onDel">删除</el-button>
+            <el-form-item>
+			  <el-input v-model="positionvalue" placeholder="输入工单编号或产品名称" style="width: 180px;" />
+              <el-button type="primary" class="search" icon="search" @click="onSearch"></el-button>
+			  <el-button type="primary" class="bt" icon="copy-document" @click="onCountByGdbh">切换显示方式</el-button>
+			  <el-button type="primary" class="bt" icon="plus" @click="onAdd">新增</el-button>
+              <el-button type="primary" class="bt" icon="delete" @click="onDel">删除</el-button>
               <div style="margin-left: auto;">
-                <el-button type="primary" :icon="Download" @click="exportExcel">导出到Excel</el-button>
+                <el-button type="primary" class="bt" icon="download" @click="exportExcel">导出到Excel</el-button>
               </div>
-            </div>
+            </el-form-item>
             <!-- 数据展示 -->
             <el-table ref="multipleTable" style="width: 100%" tooltip-effect="dark" :data="tableData" row-key="ID"
-              highlight-current-row="true" border 
+              highlight-current-row="true" border 
+			  :row-style="{ height: '0px' }"
+			  :header-row-style="{ height: '20px' }"
+			  :header-cell-style="{ padding: '0px' }"
 			  :show-overflow-tooltip="true" @row-click="Click"
 			  @selection-change="handleSelectionChange" @row-dblclick="doubleClick">
-              <el-table-column type="selection" width="55" />
-              <el-table-column align="left" label="工单编号" prop="sczl_gdbh" width="120"/>
-              <el-table-column align="left" label="产品名称" prop="Gd_cpmc"  width="340"/>
+              <!-- <el-table-column type="selection" width="55" /> -->
+              <el-table-column fixed align="left" label="工单编号" prop="sczl_gdbh" width="90"/>
+              <el-table-column fixed align="left" label="产品名称" prop="Gd_cpmc"  width="250"/>
               <el-table-column align="left" label="印件及工序" prop="jyno_gxmc"  width="120"/>
-              <el-table-column align="left" label="生产日期" prop="sczl_rq"  width="120"/>
-              <el-table-column align="left" label="机台" prop="sczl_jtbh"  width="120"/>
-              <el-table-column align="left" label="班组" prop="sczl_bzdh"  width="120"/>
-              <el-table-column align="left" label="流程单" prop="sczl_num"  width="120"/>
-              <el-table-column align="left" label="车头产量" prop="sczl_cl"  width="120"/>
-              <el-table-column align="left" label="色度数" prop="sczl_ms" width="120" />
-			  <el-table-column align="left" label="制程废" prop="sczl_zcfp" width="120" />
-			  <el-table-column align="left" label="次品" prop="sczl_zccp"  width="120"/>
-			  <el-table-column align="left" label="来料异常" prop="incomingerror"  width="120"/>
-			  <el-table-column align="left" label="装版工时" prop="sczl_装版工时"  width="120"/>
-			  <el-table-column align="left" label="保养工时" prop="sczl_保养工时"  width="120"/>
-			  <el-table-column align="left" label="打样工时" prop="sczl_打样工时"  width="120"/>
+              <el-table-column align="left" label="生产日期" prop="sczl_rq"  width="100"/>
+              <el-table-column align="left" label="机台" prop="sczl_jtbh"  width="80"/>
+              <el-table-column align="left" label="班组" prop="sczl_bzdh"  width="60"/>
+              <el-table-column align="left" label="流程单" prop="sczl_num"  width="80"/>
+              <el-table-column align="left" label="车头产量" prop="sczl_cl"  width="100"/>
+              <el-table-column align="left" label="色度数" prop="sczl_ms" width="80" />
+			  <el-table-column align="left" label="制程废" prop="sczl_zcfp" width="80" />
+			  <el-table-column align="left" label="次品" prop="sczl_zccp"  width="80"/>
+			  <el-table-column align="left" label="来料异常" prop="incomingerror"  width="90"/>
+			  <el-table-column align="left" label="装版工时" prop="sczl_装版工时"  width="90"/>
+			  <el-table-column align="left" label="保养工时" prop="sczl_保养工时"  width="90"/>
+			  <el-table-column align="left" label="打样工时" prop="sczl_打样工时"  width="90"/>
 			  <el-table-column align="left" label="异常停机工时" prop="sczl_异常停机工时"  width="120"/>
 			  <el-table-column align="left" label="设备运行工时" prop="sczl_设备运行工时"  width="120"/>
-			  <el-table-column align="left" label="组员编号1" prop="sczl_bh1" width="120"/>
-			  <el-table-column align="left" label="组员姓名1" prop="name1"  width="120"/>
-			  <el-table-column align="left" label="组员编号2" prop="sczl_bh2"  width="120"/>
-			  <el-table-column align="left" label="组员姓名2" prop="name1" width="120" />
-			  <el-table-column align="left" label="组员编号3" prop="sczl_bh3"  width="120"/>
-			  <el-table-column align="left" label="组员姓名3" prop="name3" width="120"/>
-			  <el-table-column align="left" label="组员编号4" prop="sczl_bh4" width="120"/>
-			  <el-table-column align="left" label="组员姓名4" prop="name4"width="120" />
-			  <el-table-column align="left" label="组员编号5" prop="sczl_bh5" width="120"/>
-			  <el-table-column align="left" label="组员姓名5" prop="name5" width="120"/>
-			  <el-table-column align="left" label="组员编号6" prop="sczl_bh6"width="120" />
-			  <el-table-column align="left" label="组员姓名6" prop="name6" width="120"/> 
+			  <el-table-column align="left" label="组员编号1" prop="sczl_bh1" width="100"/>
+			  <el-table-column align="left" label="组员姓名1" prop="name1"  width="100"/>
+			  <el-table-column align="left" label="组员编号2" prop="sczl_bh2"  width="100"/>
+			  <el-table-column align="left" label="组员姓名2" prop="name1" width="100" />
+			  <el-table-column align="left" label="组员编号3" prop="sczl_bh3"  width="100"/>
+			  <el-table-column align="left" label="组员姓名3" prop="name3" width="100"/>
+			  <el-table-column align="left" label="组员编号4" prop="sczl_bh4" width="100"/>
+			  <el-table-column align="left" label="组员姓名4" prop="name4"width="100" />
+			  <el-table-column align="left" label="组员编号5" prop="sczl_bh5" width="100"/>
+			  <el-table-column align="left" label="组员姓名5" prop="name5" width="100"/>
+			  <el-table-column align="left" label="组员编号6" prop="sczl_bh6"width="100" />
+			  <el-table-column align="left" label="组员姓名6" prop="name6" width="100"/> 
 			  <el-table-column align="left" label="拆片联拼系数" prop="拆片联拼系数" width="120"/>
-			  <el-table-column align="left" label="拆片条小盒系数" prop="拆片条小盒系数" width="120"/>
-			  <el-table-column align="left" label="工价系数" prop="sczl_工价系数" width="160"/>
-			  <el-table-column align="left" label="日定额" prop="日定额" width="120"/>
-			  <el-table-column align="left" label="千件工价" prop="piecesprice " width="120"/>
-			  <el-table-column align="left" label="补产标准" prop="addstandards " width="120"/>
+			  <el-table-column align="left" label="拆片条小盒系数" prop="拆片条小盒系数" width="130"/>
+			  <el-table-column align="left" label="工价系数" prop="sczl_工价系数" width="100"/>
+			  <el-table-column align="left" label="日定额" prop="日定额" width="80"/>
+			  <el-table-column align="left" label="千件工价" prop="piecesprice " width="100"/>
+			  <el-table-column align="left" label="补产标准" prop="addstandards " width="100"/>
 			  <el-table-column align="left" label="创建用户" prop="sys_id" width="120"/>
               <el-table-column align="left" label="创建时间" prop="sys_rq" width="160"/>
               <el-table-column align="left" label="修改时间" prop="mod_rq" width="160"/>
-              <el-table-column align="left" label="UNIQID" prop="UniqId" width="160"/>
-			  <el-table-column align="left" label="table_type" prop="table_type" width="120"/>
+              <el-table-column align="left" label="UNIQID" prop="UniqId" width="100"/>
+			  <!-- <el-table-column align="left" label="table_type"  prop="table_type" width="120"/> -->
 			<tbody>
 			  <tr v-for="row in filteredRows" :key="row.sczl_gdbh">
 				<td>{{ row.sczl_gdbh }}</td>
@@ -1858,7 +1859,6 @@ function Click(row, column, event) {
 //获取详细信息
 const GetInfo = async (value) => {
   const response = await productionInfo({UniqId:value});
-  console.log(response) 
   if (response.code === 0) {
 	formData.value=response.data;
   }
@@ -1895,12 +1895,35 @@ onMounted(async () => {
 .JKWTree-content {
   flex: 1;
 }
-.mab{
-  margin-bottom: 5px;
-}
 /* 选中某行时的背景色*/
 .el-table__body tr.current-row>td {
   background: #ff80ff !important;
   /* 背景颜色 */
 }
+</style>
+<style scoped>
+:deep(.el-table td .cell) {
+  line-height: 20px !important;
+}
+:deep(.el-tabs__header){
+  margin-bottom: 0;
+}
+.search{
+  margin-left: 0px !important;
+  margin-right: 10px !important;
+}
+.bt{
+  margin-left: 2px !important;
+  padding: 3px !important;
+  font-size: 12px;
+}
+.el-tabs__header{
+  margin: 0px !important;
+}
+.gva-table-box{
+  padding: 0px !important;
+}
+.mab{
+  margin-bottom: 5px;
+}
 </style>