Selaa lähdekoodia

日产量上报新增/删除优化 日产量批量维护功能添加

曹鹤洋 1 vuosi sitten
vanhempi
commit
11023c288d

+ 8 - 0
src/api/jixiaoguanli/jitairibaobiao.js

@@ -1103,3 +1103,11 @@ export const RemodelDetail = (params) => {
     params
   })
 }
+//日产量上报添加->班组信息批量修改
+export const YieldTeamEdit = (params) => {
+  return service({
+    url: '/mes_server/facility/YieldTeamEdit',
+    method: 'get',
+    params
+  })
+}

+ 613 - 86
src/view/yunyin/shengchanguanli/shebeiyunxing.vue

@@ -15,7 +15,8 @@
 			<el-button type="primary" icon="edit"   @click="onxzhscsclick"     class="bt" title="修正核算参数">修正核算参数</el-button>
 			<el-button type="primary" class="bt" @click="onADD" v-if="AddType === true">新增</el-button>
 			<el-button type="primary" class="bt" @click="onDel"  v-if="DelType === true" >删除</el-button>
-        <el-button type="primary" icon="edit"   @click="deldbcl_onclick" :disabled="dbclSelection === ''"   class="bt" title="当班产量明细" >当班产量明细删除</el-button>
+			<el-button type="primary" icon="edit"   @click="deldbcl_onclick" :disabled="dbclSelection === ''"   class="bt" title="当班产量明细" >当班产量明细删除</el-button>
+			<el-button type="primary" class="bt" @click="onRCL">日产量批量维护</el-button>
 			<!-- <el-button type="primary" @click="onClear2" >换型清场</el-button> -->
 		</header>
 
@@ -279,18 +280,17 @@
                       </el-tabs>
           </div>
 
-          <el-dialog v-model="detailShow"
-           fullscreen
+          <el-dialog v-model="detailShow" fullscreen
            style="font-size: 50px;font-weight: bold;" lock-scroll :before-close="closeDetailShow" title="机台班组维护" destroy-on-close>
             <div>
           			<el-table ref="multipleTable"
-          			            :row-style="{ height: '20px' }"
-          			            :cell-style="{ padding: '0px' ,color:'blue'}" :header-row-style="{ height: '20px' }"
-          			            :header-cell-style="{ padding: '0px' }"
-          			            :show-overflow-tooltip="true"
-          			            highlight-current-row="true" @row-click="BZhandle"
-          			            style="width: 100%;height: 250px;margin-top: 0px;" border tooltip-effect="dark"
-          						:data="bzData" row-key="ID" @selection-change="BZSelectionChange">
+						:row-style="{ height: '20px' }"
+						:cell-style="{ padding: '0px' ,color:'blue'}" :header-row-style="{ height: '20px' }"
+						:header-cell-style="{ padding: '0px' }"
+						:show-overflow-tooltip="true"
+						highlight-current-row="true" @row-click="BZhandle"
+						style="width: 100%;height: 250px;margin-top: 0px;" border tooltip-effect="dark"
+						:data="bzData" row-key="ID" @selection-change="BZSelectionChange">
           			  <!-- <el-table-column type="selection" width="55" /> -->
           			  <el-table-column align="left" label="机台" prop="JTMC" width="70"/>
           			  <el-table-column align="left" label="班组" prop="班组号" width="60"/>
@@ -389,8 +389,107 @@
           			</div>
           			</div>
           </el-dialog>
+
+		<!-- 日产量批量维护 -->
+		<el-dialog v-model="detailShow_rcl" fullscreen
+           style="font-size: 50px;font-weight: bold;" lock-scroll :before-close="closeDetailShow_rcl" title="日产量批量维护" destroy-on-close>
+            <div>
+          			<el-table ref="multipleTable"
+						:row-style="{ height: '20px' }"
+						:cell-style="{ padding: '0px' ,color:'blue'}" :header-row-style="{ height: '20px' }"
+						:header-cell-style="{ padding: '0px' }"
+						:show-overflow-tooltip="true"
+						highlight-current-row="true" @row-click="BZhandle_rcl"
+						style="width: 100%;height: 250px;margin-top: 0px;" border tooltip-effect="dark"
+						:data="bzData_rcl" row-key="ID" @selection-change="BZSelectionChange_rcl">
+          			  <!-- <el-table-column type="selection" width="55" /> -->
+          			  <el-table-column align="left" label="机台" prop="JTMC" width="70"/>
+          			  <el-table-column align="left" label="班组" prop="班组号" width="60"/>
+          			  <el-table-column align="left" label="组员1" prop="0" width="195"/>
+          			  <el-table-column align="left" label="组员2" prop="1" width="195"/>
+          					  <el-table-column align="left" label="组员3" prop="2" width="195"/>
+          			  <el-table-column align="left" label="组员4" prop="3" width="195"/>
+          			  <el-table-column align="left" label="组员5" prop="4" width="195"/>
+          			  <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="特殊组员" prop="9" width="100"/>
+          			  <el-table-column align="left" label="UNIQID" prop="ID" width="100"/>
+          			</el-table>
+          			</div>
 
 
+
+            <div style="margin-top:100px;">
+          			<el-row :gutter="20">
+          			 <el-col :span="10">
+          			   <el-form-item label="机台编号" prop="id">
+						   <el-input v-model="selectedOption_rcl" disabled/>
+          			   </el-form-item>
+          			 </el-col>
+          			 <el-col :span="10">
+          			   <el-form-item label="班组编号" prop="id">
+						   <el-input v-model="BZMC_rcl" disabled/>
+          			   </el-form-item>
+          			 </el-col>
+          			</el-row>
+          			<div style="display: flex;">
+          			<div class="groupbox float-div" style="height: 17vh; width: 130vh;">
+                  <span class="grouptitle">组员及分配比例</span>
+          				<el-row :gutter="10" style="margin-top: 0px; height: 5vh;">
+                    <el-col :span="2"><span></span></el-col>
+                    <el-col :span="2"></el-col>
+                    <el-col :span="2"></el-col>
+                    <el-col :span="2"></el-col>
+                    <el-col :span="2"></el-col>
+                    <el-col :span="2"></el-col>
+                    <el-col :span="2"></el-col>
+                    <el-col :span="2"></el-col>
+                    <el-col :span="2"></el-col>
+                    <el-col :span="3"></el-col>
+                    <el-col :span="3"><el-form-item label="特殊组员" prop="id"></el-form-item></el-col>
+          				</el-row>
+          				<el-row :gutter="10" style="margin-top: 0px;">
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.code1" @keyup.enter.native="getbzyg($event, '1')"/></el-col>
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.code2" @keyup.enter.native="getbzyg($event, '2')" /></el-col>
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.code3" @keyup.enter.native="getbzyg($event, '3')"/></el-col>
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.code4" @keyup.enter.native="getbzyg($event, '4')"/></el-col>
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.code5" @keyup.enter.native="getbzyg($event, '5')"/></el-col>
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.code6" @keyup.enter.native="getbzyg($event, '6')"/></el-col>
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.code7" @keyup.enter.native="getbzyg($event, '7')"/></el-col>
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.code8" @keyup.enter.native="getbzyg($event, '8')"/></el-col>
+          			  </el-row>
+          			 <el-row :gutter="10" style="margin-top: 1px;">
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.name1" style="color:#00FF00"/></el-col>
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.name2"/></el-col>
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.name3"/></el-col>
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.name4"/></el-col>
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.name5"/></el-col>
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.name6"/></el-col>
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.name7"/></el-col>
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.name8"/></el-col>
+          			  </el-row>
+          			  <el-row :gutter="10" style="margin-top: 1px;">
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.percentage1"/></el-col>
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.percentage2"/></el-col>
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.percentage3"/></el-col>
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.percentage4"/></el-col>
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.percentage5"/></el-col>
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.percentage6"/></el-col>
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.percentage7"/></el-col>
+                    <el-col :span="3"><el-input disabled v-model="formDatas_rcl.percentage8"/></el-col>
+          			  </el-row>
+          			</div>
+          			<div style="height: 50vh; width: 15vh;margin-top: 3vh;">
+          				<el-button type="text"></el-button>
+          				 <el-button style="margin-bottom: 1vh; width:15vh;background-color:cornflowerblue;font-size: 2.0vh;font-weight: bold; color: white;" @click="selectBz_rcl" >更新</el-button>
+          			</div>
+          			</div>
+          			</div>
+          </el-dialog>
+		  
+
           <!-- 组员及分配比例         -->
           <el-dialog v-model="blModel" :before-close="() => blModel = false" style="width: 20%">
             <el-form>
@@ -861,12 +960,13 @@
 					  <el-tabs v-model="activName" type="card" @tab-click="handleClick">
 					    <el-tab-pane label="当日上报产量"  @click="showTable('工艺资料')"  name="first">
 					      <el-table ref="multipleTable"
-					                :show-overflow-tooltip="true"
+					                :show-overflow-tooltip="true"
+									@selection-change="selectionChange($event)"
 					                :row-style="{ height: '20px' }"
 					                :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
 					                :header-cell-style="{ padding: '0px' }" @row-click="getUid"
 					                highlight-current-row="true" @row-dblclick="gytableDatadoubleClick"
-					                style="width: 100%;height: 70vh" border tooltip-effect="dark" :data="gytableData" row-key="ID" @selection-change="handleSelectionChange">
+					                style="width: 100%;height: 70vh" border tooltip-effect="dark" :data="gytableData" row-key="ID" >
 					        <el-table-column type="selection" width="55" />
 					        <!-- <el-table-column align="left" label="选择" prop="工单编号"  width="100"/> -->
 					        <el-table-column align="left" label="产品名称" prop="产品名称"  width="200"/>
@@ -1339,16 +1439,16 @@
 			<el-row :gutter="24">
 				<el-col :span="6">
 				  <el-form-item label="印件号:" prop="flatFeed" class="mab">
-				  <el-input v-model="formdata3.value.yjno" id="印件号"  @keydown="ent1($event)" :clearable="true" />
+				  <el-input v-model="formdata3.value.yjno" id="印件号" @keydown="ent1($event)" :clearable="true" />
 				  </el-form-item>
 				</el-col>
 				<el-col :span="18">
 				  <el-form-item label="印件名称:" prop="perTenThousand" class="mab" label-width="150">
-				  <el-input v-model="formdata3.value.cpmc" id="印件名称"  @keydown="ent1($event)"  :clearable="true" />
+				  <el-input v-model="formdata3.value.yjmc" id="印件名称"  @keydown="ent1($event)"  :clearable="true" />
 				  </el-form-item>
 				</el-col>
 			</el-row>
-
+
 			<el-row :gutter="24">
 			  <el-col :span="14">
 			    <el-form-item label="工序名称:" prop="flatFeed" class="mab">
@@ -1361,22 +1461,35 @@
 			  	  <el-input v-model="formdata3.value.gymc" id="工艺名称"  @keydown="ent1($event)" :readonly=true :clearable="true" style="width: 200px;" />
 			    </el-form-item>
 			  </el-col>
-			</el-row>
-
+			</el-row>
+			
 			<el-row :gutter="24">
 			  <el-col :span="6">
 			    <el-form-item label="日期:" prop="flatFeed" class="mab">
 				 <el-date-picker v-model="formdata3.value.rq" type="datetime" format="YYYY/MM/DD" value-format="YYYY-MM-DD" @keydown="ent1($event)"/>
 			    </el-form-item>
 			  </el-col>
-			  <el-col :span="6">
-			    <el-form-item label="机器:" prop="flatFeed" class="mab">
+			  <el-col :span="6">
+				  <el-form-item label="机器:"  class="mab" prop="remark">
+				    <el-select v-model="formdata3.value.sczl_jtbh" 
+				               id="机器"  @keydown="ent1($event)" @change="jtbh_change()"
+				               style="flex: 1; height: auto; width: 100px;">
+				      <el-option
+				          v-for="(item, index) in gdzl_MachineList_address.data"
+				          :key="index"
+				          :label="item.split('-->')[0].trim()"
+				          :value="item.split('-->')[0].trim()">
+				        {{ item }}
+				      </el-option>
+				    </el-select>
+				  </el-form-item>
+			    <!-- <el-form-item label="机器:" prop="flatFeed" class="mab">
 			    <el-input v-model="formdata3.value.sczl_jtbh"  id="机器"  @keydown="ent1($event)" @blur="getJtbhsubmit()" :clearable="true" style="width: 100px;" />
-			    </el-form-item>
+			    </el-form-item> -->
 			  </el-col>
 			  <el-col :span="7">
 			    <el-form-item label="开工时间:" prop="flatFeed" class="mab">
-					   <el-date-picker v-model="formdata3.value.starttime" type="datetime"  format="YYYY/MM/DD HH:mm:ss" @keydown="ent1($event)" />
+					   <el-date-picker v-model="formdata3.value.starttime" type="datetime"  format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" @keydown="ent1($event)" />
 			    </el-form-item>
 			  </el-col>
 				<el-col :span="5" style="margin-top=0px; margin-bottom: 1px;">
@@ -1386,8 +1499,6 @@
 				</el-col>
 			</el-row>
 
-
-
 			<el-row :gutter="24">
 			  <el-col :span="9">
 			    <el-form-item label="上机时间:" prop="flatFeed" class="mab">
@@ -1764,9 +1875,31 @@
 		  	    show-overflow-tooltip="true" sortable
 		  	  />
 		    </el-table>
-		</el-dialog>
-
-
+		</el-dialog>
+		
+		<!-- 印件选择 -->
+		<el-dialog v-model="dialogSelectVisible_Yj" title="选择" destroy-on-close width="600px" @keydown="select_Yj($event)" >
+            <el-table tooltip-effect="dark" :data="selectData_Yj"
+              row-key="ID" highlight-current-row="true"
+              border style="width:100%"
+              @row-dblclick="handleSelectClick_Yj"
+            >
+              <el-table-column prop="yjno" label="印件号" width="80" />
+			  <el-table-column prop="yjmc" label="印件名称" width="480" />		 
+            </el-table>
+          </el-dialog>
+		  
+		<!-- 机台编号选择 -->
+		<el-dialog v-model="dialogSelectVisible_Gx" title="选择" destroy-on-close width="600px" >
+		    <el-table tooltip-effect="dark" :data="selectData_Gx"
+		      row-key="ID" highlight-current-row="true"
+		      border style="width:100%"
+		      @row-dblclick="handleSelectClick_Gx"
+		    >
+				<el-table-column prop="name" label="" width="560" />	      	 
+		    </el-table>
+		  </el-dialog>
+		  
 		<Shebeizhuangtai
 		  v-if="dialogSbyxgl"
 		  v-model="dialogSbyxgl"
@@ -1843,10 +1976,16 @@ import {
    ChromaDataEdit,
    PrintingModeDataEdit,
    dailysearch,
-   dailygetGzByYgbh,
+   dailygetGzByYgbh,
+   productionDedh,
+   YieldTeamEdit,
 } from '@/api/jixiaoguanli/jitairibaobiao'
-import{ AccountingParameter,ProductNameData,
-  AccountingParameterEdit}  from "@/api/yunyin/yunying";
+import{ 
+	AccountingParameter,
+	ProductNameData,
+	AccountingParameterEdit,
+	gdzl_MachineList,
+  }  from "@/api/yunyin/yunying";
 import {
 MachineTeamAdd,
   setMachineTeam,
@@ -1936,7 +2075,8 @@ const handleNodeClick = (nodeData,node) => {
 		// console.log(JTMC)
 		DelType.value = false
 		AddType.value = false
-      } else if (nodeData.level === 3) {
+      } else if (nodeData.level === 3) {
+		  CJMC.value=nodeData.parentNode.parentNode.label
 		  JTMC=nodeData.machineName.split("-")[0]
 		  JTMCOn.value=false
 		  dateOn.value=true
@@ -2509,17 +2649,38 @@ getTableData()
 const type2 = ref('')
 //新增
 function onADD(){
-	type2.value="create"
+	type2.value="create"
+	//通过车间名称查询机台
+	gdzl_MachineList({address:CJMC.value}).then( MachineList_jitai =>{
+		gdzl_MachineList_address.data = MachineList_jitai.data;
+	});
+	
 	MachineChanliang(uid.value)
+}
+
+const Selection_ids = ref('')
+// 印件资料多选、工艺资料多选
+const selectionChange = (selection) => {
+	const ids = selection.map(item => {
+	  return item.UniqId
+	})
+    Selection_ids.value = ids.join(',')
 }
 //删除
 function onDel() {
 	Chanliangdel()
-}
-// 日产量上报删除
-const Chanliangdel = async() => {
+}
 
-    const res = await ChanliangDel({ UniqId:uid.value})
+// 日产量上报删除
+const Chanliangdel = async() => {
+	if(!Selection_ids.value){
+		ElMessage({
+		  type: 'warning',
+		  message: '请勾选要删除的数据'
+		})
+		return
+	}
+    const res = await ChanliangDel({ UniqId:Selection_ids.value})
     if (res.code === 0) {
     ElMessage({
       type: 'success',
@@ -3212,6 +3373,126 @@ function onBZ() {
 	detailShow.value=true
 	console.log('2222')
 }
+
+//日产量批量维护
+function onRCL() {
+	if(!Selection_ids.value){
+		ElMessage({
+		  type: 'warning',
+		  message: '请先勾选数据'
+		})
+		return
+	}
+	FacilityTeam_rcl(JTMC)
+	detailShow_rcl.value=true
+	console.log('333')
+}
+let BZMC_rcl=ref()
+const bzData_rcl = reactive([])
+const selectedOption_rcl = ref('');
+// 班组人员及分配比例
+const FacilityTeam_rcl = async (value) => {
+  const response = await facilityTeam({ machine: value });
+  if (response.code === 0) {
+	// formData.value.班组 = response.data[0]['班组号'];
+	BZMC_rcl.value = response.data[0]['班组号']
+	selectedOption_rcl.value = JTMC
+
+    // 清空 bzData 数组
+    bzData_rcl.splice(0, bzData_rcl.length);
+
+    // 遍历接口返回的数据,并给每个对象添加 JTMC 属性
+    const updatedData = response.data.map(item => {
+      return { ...item, JTMC: value }; // 添加 JTMC 属性
+    });
+
+    // 将更新后的数据添加到 bzData 数组
+    bzData_rcl.push(...updatedData);
+	return 1
+  }
+};
+//班组单击
+const currentBz_rcl ={}
+const BZvalue_rcl=ref()
+const BZhandle_rcl = (val) => {
+  currentBz_rcl.value = val
+  BZvalue_rcl.value=val.ID
+  formDatas_rcl.value = {};
+  let sczl_bhkey_rcl = ''
+  let sczl_namekey_rcl = ''
+  let percentagekey_rcl = ''
+  console.log(currentBz_rcl)
+  if (currentBz_rcl.value[9]) {
+    for (let i = 1; i <= 9; i++) {
+      sczl_bhkey_rcl = `code${i}`
+      sczl_namekey_rcl = `name${i}`
+      percentagekey_rcl = `percentage${i}`
+      formDatas_rcl.value[sczl_bhkey_rcl] = '';
+      formDatas_rcl.value[sczl_namekey_rcl] = '';
+      formDatas_rcl.value[percentagekey_rcl] = '';
+    }
+    formDatas_rcl.value.code8 = currentBz_rcl.value[9].split(' ')[0];
+    formDatas_rcl.value.name8 = currentBz_rcl.value[9].split(' ')[1]
+    formDatas_rcl.value.percentage8 = parseFloat(currentBz_rcl.value[9].split(' ')[2].split('(')[1].split(')')[0])/100
+    for (let i = 1; i <= Math.min(Object.keys(currentBz_rcl.value).length - 5, 6); i++) {
+      sczl_bhkey_rcl = `code${i}`
+      sczl_namekey_rcl = `name${i}`
+      percentagekey_rcl = `percentage${i}`
+      formDatas_rcl.value[sczl_bhkey_rcl] = currentBz_rcl.value[i - 1].split(' ')[0];
+      formDatas_rcl.value[sczl_namekey_rcl] = currentBz_rcl.value[i - 1].split(' ')[1];
+      if(isNaN(parseFloat(currentBz_rcl.value[i - 1].split(' ')[2].split('(')[1].split(')')[0]))){
+        formDatas_rcl.value[percentagekey_rcl] = currentBz_rcl.value[i - 1].split(' ')[2].split('(')[1].split(')')[0];
+      }else{
+        formDatas_rcl.value[percentagekey_rcl] = parseFloat(currentBz_rcl.value[i - 1].split(' ')[2].split('(')[1].split(')')[0])/100;
+      }
+    }
+  } else {
+    for (let i = 1; i <= 10; i++) {
+      sczl_bhkey_rcl = `code${i}`
+      sczl_namekey_rcl = `name${i}`
+      percentagekey_rcl = `percentage${i}`
+      formDatas_rcl.value[sczl_bhkey_rcl] = '';
+      formDatas_rcl.value[sczl_namekey_rcl] = '';
+      formDatas_rcl.value[percentagekey_rcl] = '';
+    }
+    for (let i = 1; i <= Math.min(Object.keys(currentBz_rcl.value).length - 4, 6); i++) {
+      sczl_bhkey_rcl = `code${i}`
+      sczl_namekey_rcl = `name${i}`
+      percentagekey_rcl = `percentage${i}`
+      formDatas_rcl.value[sczl_bhkey_rcl] = currentBz_rcl.value[i - 1].split(' ')[0];
+      formDatas_rcl.value[sczl_namekey_rcl] = currentBz_rcl.value[i - 1].split(' ')[1];
+      if(isNaN(parseFloat(currentBz_rcl.value[i - 1].split(' ')[2].split('(')[1].split(')')[0]))){
+        formDatas_rcl.value[percentagekey_rcl] = currentBz_rcl.value[i - 1].split(' ')[2].split('(')[1].split(')')[0];
+      }else{
+        formDatas_rcl.value[percentagekey_rcl] = parseFloat(currentBz_rcl.value[i - 1].split(' ')[2].split('(')[1].split(')')[0])/100;
+      }
+    }
+  }
+	BZMC_rcl.value=val.班组号
+};
+
+const selectBz_rcl = () => {
+	if(currentBz_rcl.value==undefined){
+		ElMessage({
+		  type: 'warning',
+		  message: '请选择班组'
+		})
+		return
+	}
+	console.log(Selection_ids.value)
+	console.log(currentBz_rcl.value.ID)
+	YieldTeamEdit({'Uniqid': Selection_ids.value, 'teamID': currentBz_rcl.value.ID}).then( res => {
+		if(res.code==0){
+			ElMessage({
+			  type: 'success',
+			  message: '成功'
+			})
+			closeDetailShow_rcl()
+			FacilitychanLiang()
+		}
+	})
+}
+
 
 const blModel = ref(false)
 const employeeData = ref('')
@@ -3495,11 +3776,44 @@ const formDatas = ref({
   percentage9:'',
   percentage10:'',
 })
-
+const formDatas_rcl = ref({
+  code1:'',
+  code2:'',
+  code3:'',
+  code4:'',
+  code5:'',
+  code6:'',
+  code7:'',
+  code8:'',
+  code9:'',
+  code10:'',
+  name1:'',
+  name2:'',
+  name3:'',
+  name4:'',
+  name5L:'',
+  name6:'',
+  name7:'',
+  name8:'',
+  name9:'',
+  name10:'',
+  percentage1:'',
+  percentage2:'',
+  percentage3:'',
+  percentage4:'',
+  percentage5:'',
+  percentage6:'',
+  percentage7:'',
+  percentage8:'',
+  percentage9:'',
+  percentage10:'',
+})
 
 //班组单击
 const BZvalue=ref()
-const BZhandle = (val) => {
+const BZhandle = (val) => {
+	
+	console.log(currentBz.value)
   currentBz.value = val
   BZvalue.value=val.ID
   formDatas.value = {};
@@ -3573,7 +3887,101 @@ const BZhandle = (val) => {
 };
 
 const chanliangVisible = ref(false)
-const formdata3=reactive([])
+const formdata3=reactive([])
+const initfordata3 = () => {
+	formdata3.value = {
+		'工单编号':'',
+		'cpmc':'',
+		'yjno':'',
+		'yjmc':'',
+		'gxmc':'',
+		'gxh':'',
+		'gymc':'',
+		'rq':'',
+		'sczl_jtbh':'',
+		'starttime':'',
+		'num':'',
+		'sj1':'',
+		'色度数':'',
+		'联数':'',
+		'产量':'',
+		'制程废品':'',
+		'制程次品':'',
+		'前工序废':'',
+		'来料异常':'',
+		'换型类型':'',
+		'装版工时':'',
+		'装版补产工时':'',
+		'打样工时':'',
+		'打样补产工时':'',
+		'保养工时':'',
+		'异常总工时':'',
+		'异常类型':'',
+		'异常补时':'',
+		'通电工时':'',
+		'dedh':'',
+		'码包':'',
+		'码开始行':'',
+		'码结束行':'',
+		'主电表':'',
+		'辅电表':'',
+		'组员1':{
+			'编号':'',
+			'姓名':'',
+			'比例':'',
+		},
+		'组员2':{
+			'编号':'',
+			'姓名':'',
+			'比例':'',
+		},
+		'组员3':{
+			'编号':'',
+			'姓名':'',
+			'比例':'',
+		},
+		'组员4':{
+			'编号':'',
+			'姓名':'',
+			'比例':'',
+		},
+		'组员5':{
+			'编号':'',
+			'姓名':'',
+			'比例':'',
+		},
+		'组员6':{
+			'编号':'',
+			'姓名':'',
+			'比例':'',
+		},
+		'组员7':{
+			'编号':'',
+			'姓名':'',
+			'比例':'',
+		},
+		'组员8':{
+			'编号':'',
+			'姓名':'',
+			'比例':'',
+		},
+		'组员9':{
+			'编号':'',
+			'姓名':'',
+			'比例':'',
+		},
+		'组员10':{
+			'编号':'',
+			'姓名':'',
+			'比例':'',
+		},
+		'拉料':{
+			'编号':'',
+			'姓名':'',
+		}
+		
+	}
+}
 function gytableDatadoubleClick(row, column, event) {
  console.log(row)
  type2.value="update"
@@ -3588,29 +3996,30 @@ function getUid(row, column, event) {
  console.log("UniqId"+uid.value)
 }
 //获取详细信息
-const MachineChanliang = async(value) => {
+const MachineChanliang = async(value) => {
+	if(uid.value == undefined){
+		initfordata3()
+		chanliangVisible.value=true
+		return
+	}
  const response = await MachineChanliangDetail({UniqId:value});
    if (response.code === 0) {
 	 chanliangVisible.value=true
 	 formdata3.value=response.data
 	 const result=formdata3.value.gxmc.match(/-(.{2})/)
-	 // const pattern = /-(.*?)〖(.*?)$/;
-	 // const matches = formdata3.value.gxmc.match(pattern);
 	 formdata3.value.gymc=result[1]
 	 formdata3.value.sczl_jtbh=JTMC
+	 formdata3.value.yjmc=response.data.印件名称
 	 formdata3.value.rq=date
-	 console.log(formdata3.value.bzdh)
 	 if (formdata3.value.bzdh === 'A班') {
-	     console.log(date + " 08:00:00");
 	     formdata3.value.starttime = ''; // 清空值
 	     setTimeout(()=>{
-			 formdata3.value.starttime = date + " 08:30:00"; // 设置为 20:30:00
+			formdata3.value.starttime = date + " 08:30:00"; // 设置为 20:30:00
 	     })
 	 } else if (formdata3.value.bzdh === 'B班') {
-	     console.log(date + " 20:30:00");
 	     formdata3.value.starttime = ''; // 清空值
 	     setTimeout(()=>{
-	     			 formdata3.value.starttime = date + " 20:30:00"; // 设置为 20:30:00
+	     	formdata3.value.starttime = date + " 20:30:00"; // 设置为 20:30:00
 	     })
 	 }
 	 console.log(formdata3.value)
@@ -3622,10 +4031,21 @@ const MachineChanliang = async(value) => {
  const getCPMCsubmit = () => {
  	if(formdata3.value.工单编号!=''){
  		ChanliangWorkorder({search:formdata3.value.工单编号,machine:JTMC}).then(response=>{
- 		  if (response.code === 0) {
- 			  formdata3.value.cpmc = response.data[0].cpmc
- 			  document.getElementById('产品名称').style.color = 'red';
-			  getYJMCsubmit()
+ 		  if (response.code === 0) {
+			  if(response.data){
+				  formdata3.value.cpmc = response.data[0].cpmc
+				  document.getElementById('产品名称').style.color = 'red';
+				  getYJMCsubmit()
+			  }else{
+				  ElMessage({
+				    type: 'error',
+				    message: response.msg
+				  })
+				  formdata3.value.工单编号 = '';
+				  formdata3.value.cpmc = '';
+				  document.getElementById('产品名称').style.color = 'black';
+			  }
+ 			  
  			}else{
  				formdata3.value.工单编号 = '';
  				formdata3.value.cpmc = '';
@@ -3651,18 +4071,27 @@ const MachineChanliang = async(value) => {
 
  //印件号失去焦点事件
  const getYJMCsubmit = () => {
-  if(formdata3.value.工单编号!='' && formdata3.value.yjno!=''){
+  if(formdata3.value.工单编号!=''){
   	//获取印件名称
  	ChanliangPrintDetail({gdbh:formdata3.value.工单编号}).then(response=>{
-  	  if (response.code === 0) {
-  		  formdata3.value.yjmc = response.data[0].yjmc
-  		  formdata3.value.yjno = response.data[0].yjno
- 		  setColorReadonly('印件名称')
-  		}else{
-  			ElMessage({
-  			  type: 'error',
-  			  message: '印件编号不存在, 将恢复默认值, 请仔细确认数据准确性!'
-  			})
+  	  if (response.code === 0) {
+		  if(response.data){
+			  if(response.data.length==1){
+				  formdata3.value.yjmc = response.data[0].yjmc
+				  formdata3.value.yjno = response.data[0].yjno
+				  formdata3.value.联数 = response.data[0].ls
+				  setColorReadonly('印件名称')
+			  }else{
+				  selectData_Yj.splice(0, selectData_Yj.length, ...response.data)
+				  dialogSelectVisible_Yj.value=true
+			  }
+			  
+		  }else{
+			  ElMessage({
+			    type: 'error',
+			    message: response.msg
+			  })
+		  }
   		}
   	});
   }else{
@@ -3671,39 +4100,114 @@ const MachineChanliang = async(value) => {
   	  message: '印件编号不存在, 将恢复默认值, 请仔细确认数据准确性!'
   	})
   }
- }
- //工序名称获得焦点事件
- const gxmcHandleFocus = () =>{
- 	if(gxmc.value != ''){
- 		formdata3.value.gxmc = gxmc.value.sczl_gxmc;
- 	}else{
- 		formdata3.value.gxmc = '';
- 	}
+ }
+ //印件选择
+ const dialogSelectVisible_Yj = ref(false)
+ const selectData_Yj = reactive([])
+ // 处理选择框
+ const handleSelectClick_Yj = (row, column, event) => {
+   const { yjno, yjmc, ls } = row
+   formdata3.value.yjno = yjno
+   formdata3.value.yjmc = yjmc
+   formdata3.value.联数 = ls
+   dialogSelectVisible_Yj.value = false
+ }
+ 
+ const select_Yj = (event) => {
+     if (event.keyCode === 40) { // 向下箭头
+         if (currentIndex.value < selectData_Yj.length - 1) {
+             currentIndex.value++;
+             setCurrent_Yj(selectData_Yj[currentIndex.value]);
+         } else {
+             currentIndex.value = 0;
+             setCurrent_Yj(selectData_Yj[currentIndex.value]); // 到达最后一行时回到第一行			
+         }
+     } else if (event.keyCode === 38) { // 向上箭头
+         if (currentIndex.value > 0) {
+             currentIndex.value--;
+             setCurrent_Yj(selectData_Yj[currentIndex.value]);
+         } else {
+             currentIndex.value = selectData_Yj.length - 1;
+             setCurrent_Yj(selectData_Yj[currentIndex.value]); // 到达第一行时回到最后一行
+         }
+     } else if (event.keyCode === 13) { // 回车键
+         dialogSelectVisible_Yj.value = false;
+     }
+ }
+ 
+ //工序选择
+ const dialogSelectVisible_Gx = ref(false)
+ const selectData_Gx = reactive([])
+const table_Gx = ref()
+ // 处理选择框
+ const handleSelectClick_Gx = (row, column, event) => {
+ 	  const { gxh, name, gxmc } = row
+ 	  formdata3.value.gxh = gxh
+ 	  formdata3.value.gxmc = name
+ 	  formdata3.value.gymc = gxmc
+   dialogSelectVisible_Gx.value = false
  }
  //工序失去焦点事件
  const getGXsubmit = () => {
- 	setColorReadonly('工序号')
- 	setColorReadonly('工艺名称')
 
 	//弹出选择
-	ChanliangProcessDetail({gdbh:formdata3.value.工单编号,yjno:formdata3.value.yjno,machine:JTMC}).then(response=>{
-		if (response.code === 0) {
-			formdata3.value.gxmc=response.data[0].name
-			formdata3.value.gxh=response.data[0].gxh
-			const res=response.data[0].name.match(/>(.{2})/)
-			formdata3.value.gymc=res[1]
-			  // selectData.splice(0, selectData.length, ...response.data)
-			  // GXVisible.value=true
-			 //  nextTick(()=>{
-				//   console.log(tableRef)
-				//   console.log(selectData)
-				//   tableRef.value.setCurrentRow(selectData[0]);
-				//       tableRef.value.focus();
-				// });
-		  }
+	ChanliangProcessDetail({gdbh:formdata3.value.工单编号,yjno:formdata3.value.yjno,machine:''}).then(response=>{
+		if (response.code === 0) {
+			if(response.data){
+				if(response.data.length==1){
+					formdata3.value.gxmc=response.data[0].name
+					formdata3.value.gxh=response.data[0].gxh
+					formdata3.value.gymc=response.data[0].gxmc
+				}else{
+					  selectData_Gx.splice(0, selectData_Gx.length, ...response.data)
+					  dialogSelectVisible_Gx.value = true
+				}
+			}else{
+				ElMessage({
+				  type: 'error',
+				  message: response.msg
+				})
+			}
+		}
 	})
 }
-
+//机台编号失去焦点事件
+ const GetjtbhVisible = ref(false)
+ const JTBHselectData = reactive([])
+ const getJtbhsubmit = () => {
+ 	gdzl_MachineList({address:CJMC.value}).then(response=>{
+ 		if(response.code==0){
+ 			  if(response.data.length!=0 && !response.data.some(item => item.jtbh === formData.value.sczl_jtbh)){
+ 			  	JTBHselectData.splice(0, selectData.length, ...response.data)
+ 			  	GetjtbhVisible.value=true
+ 			  }
+ 		}
+ 	});
+ 	 
+ }
+ const JTBHSelectClick = (row, column, event) => {
+   const { jtbh, jtmc } = row
+   formdata3.value.sczl_jtbh=jtbh
+   GetjtbhVisible.value = false
+ }
+ //点击设备编号
+const gdzl_MachineList_address = reactive({
+  data: []
+});
+
+//选择机台编号确定工艺以及开工时间
+const jtbh_change = () => {
+	//弹出选择
+	productionDedh({sczl_jtbh:formdata3.value.sczl_jtbh}).then(response=>{
+		if (response.code === 0) {
+			if(response.data){
+				formdata3.value.dedh=response.data.sys_bh
+			}else{
+				formdata3.value.dedh=''
+			}
+		  }
+	})
+}
 
  //获取员工信息
  // const GetYg = (event,inputName) => {
@@ -3890,6 +4394,24 @@ const tablebllickHandlerlist = async (row, column, event) => {
 	主电表:formdata3.value.主电表,
  	sczl_bh98: formdata3.value.拉料['编号'],
 
+   }
+   // // 创建一个Date对象来获取当前时间
+   // var currentDate = new Date();
+   
+   // // 格式化日期
+   // var year = currentDate.getFullYear();
+   // var month = ('0' + (currentDate.getMonth() + 1)).slice(-2);
+   // var day = ('0' + currentDate.getDate()).slice(-2);
+   // var hours = ('0' + currentDate.getHours()).slice(-2);
+   // var minutes = ('0' + currentDate.getMinutes()).slice(-2);
+   // var seconds = ('0' + currentDate.getSeconds()).slice(-2);
+   
+   // // 将日期和时间格式化成指定的格式
+   // var formattedDate = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds;
+   
+   if(restoredData.开工时间==undefined){
+	   // restoredData.开工时间 = formattedDate
+	   restoredData.开工时间 = '1900-01-01 00:00:00'
    }
    console.log(restoredData)
    const response = await ChanliangAdd(restoredData);
@@ -4511,6 +5033,11 @@ const getDetails = async (row) => {
 // 关闭详情弹窗
 const closeDetailShow = () => {
   detailShow.value = false
+}
+const detailShow_rcl = ref(false)
+// 关闭详情弹窗
+const closeDetailShow_rcl = () => {
+  detailShow_rcl.value = false
 }