liuhairui 1 неделя назад
Родитель
Сommit
32c25abb4d

+ 37 - 4
src/view/yunyin/shengchanguanli/gongdanziliao.vue

@@ -6,7 +6,7 @@
 			<!--按钮部分-->
 			<el-form ref="elSearchFormRef"  class="demo-form-inline"  >
 			  <el-form-item>
-				<el-input v-model="searchInfo"  placeholder="输入订单编号或生产款号" style="width: 180px;" @keyup.enter="onSubmit()"></el-input>
+				<el-input v-model="searchInfo"  placeholder="查询订单编号、生产款号" style="width: 180px;" @keyup.enter="onSubmit()"></el-input>
 				<el-button type="primary" icon="search" @click="onSubmit" title="查询"  >查询</el-button>
 				<el-button type="primary" icon="edit"   @click="cp_gdprintonClick" class="bt" title="打印生产订单" >订单打印</el-button>
 				<el-button type="primary" class="bt" icon="edit"  @click="jsfjClick">附件上传</el-button> 
@@ -274,6 +274,7 @@
 					<el-table-column align="left" label="订单编号" prop="订单编号"  width="105"/>
 					<el-table-column align="left" label="物料分类" prop="物料分类"  width="100"/>
 					<el-table-column align="left" label="物料名称" prop="物料名称"  width="210"/>
+					<el-table-column align="left" label="计划入库时间" prop="计划入库时间"  width="160" />
 					<el-table-column align="left" label="计划用料" prop="计划用料"  width="90" />
 					<el-table-column align="left" label="计划门幅" prop="计划门幅"  width="90"/>
 					<el-table-column align="left" label="定额用料" prop="定额用料"  width="90"/>
@@ -790,6 +791,16 @@
 						  <span v-else>{{ row[item.prop] }}</span>  <!-- 如果UNIQID有值,则直接显示内容 -->
 						</div>
 				  
+						<div v-else-if="item.prop === '计划入库时间'">
+						  <el-date-picker
+							v-model="row['计划入库时间']"
+							type="date"
+							value-format="YYYY-MM-DD"
+							placeholder="选择日期"
+							style="width: 100%"
+						  />
+						</div>
+				  
 						<!-- 其他列的处理 -->
 						<div v-else-if="['物料分类','计划用料', '定额用料', '计划门幅', '定额门幅', '备注'].includes(item.prop)">
 						  <el-input
@@ -2799,10 +2810,24 @@ function Input_handle() {
 	ks: '',
 	ml: '',
   });
+  const getTodayYmd = () => {
+	const t = new Date()
+	return `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, '0')}-${String(t.getDate()).padStart(2, '0')}`
+  }
+  const fillDefaultPlanRuku = (rows) => {
+	if (!Array.isArray(rows)) return
+	rows.forEach((row) => {
+	  const v = row['计划入库时间']
+	  if (v === undefined || v === null || String(v).trim() === '') {
+		row['计划入库时间'] = getTodayYmd()
+	  }
+	})
+  }
   const resbom_tableColumns = ref(
 	  [
 		{ label: '物料分类', prop: '物料分类', width: '130' },
 		{ label: '物料名称', prop: '物料名称', width: '300' },
+		{ label: '计划入库时间', prop: '计划入库时间', width: '160' },
 		{ label: '计划用料', prop: '计划用料', width: '130' },
 		{ label: '计划门幅', prop: '计划门幅', width: '130' },
 		{ label: '定额用料', prop: '定额用料', width: '130' },
@@ -2831,7 +2856,7 @@ function Input_handle() {
   }
   
   const handleInput = (value, row, prop) => {
-	  if(prop != "物料名称" && prop != "备注" && prop != "物料分类" ){
+	  if(prop != "物料名称" && prop != "备注" && prop != "物料分类" && prop != "计划入库时间" ){
 		  // 使用正则表达式过滤非数字和小数点的字符
 		  let filteredValue = value.replace(/[^\d.]/g, '');
   
@@ -2873,6 +2898,7 @@ function Input_handle() {
 		// item.UNIQID = item.UNIQID;
 		return item
 	  });
+	  fillDefaultPlanRuku(resbomtableData.value)
 	} catch (error) {
 	  console.error(error);
 	}
@@ -2917,7 +2943,8 @@ function Input_handle() {
 		  column.label === '备注' || 
 		  column.label === '物料名称' || 
 		  column.label === '计划用量' || 
-		  column.label === '定额用料' ) {
+		  column.label === '定额用料' ||
+		  column.label === '计划入库时间' ) {
 	  return 'background-plan-usage-low';
 	}
   }
@@ -2928,6 +2955,7 @@ function Input_handle() {
 		const newRow = {
 		  'BOM_desc': '',
 		  '物料名称': '',
+		  '计划入库时间': getTodayYmd(),
 		  '计划用料': '',
 		  '定额用料': '',
 		  '裁床实际用料': '',
@@ -3003,6 +3031,7 @@ function Input_handle() {
 			  bomtableData.splice(0, bomtableData.length, ...orderBomListdata.data);
 			  //批量新增/更新BOM数据列表
 			  resbomtableData.value = orderBomListdata.data;
+			  fillDefaultPlanRuku(resbomtableData.value)
 		  }
 	  }).catch(() => {
 		  // 取消删除
@@ -3034,7 +3063,11 @@ function Input_handle() {
 		  BOM_定额门幅: item.定额门幅 !== null ? item.定额门幅 : "",
 		  BOM_投料单位: "",
 		  Sys_ID: userStore.userInfo.nickName,
-		  Sys_rq: currentDate
+		  Sys_rq: currentDate,
+		  计划入库时间: item['计划入库时间'] != null && String(item['计划入库时间']).trim() !== ''
+			? String(item['计划入库时间']).trim()
+			: getTodayYmd(),
+			计划入库操作人:userStore.userInfo.nickName,
 		}
 	  });
 	  console.log(formattedData);

+ 12 - 4
src/view/yunyin/shengchanguanli/yangyipihe.vue

@@ -4,7 +4,7 @@
 		<layout-header>
 			<el-form>
 			  <el-form-item>
-				<el-input v-model="searchInfo" placeholder="模糊搜索订单编号或者生产款号" @keyup.enter="onSubmit()"  style="width: 220px;"></el-input>
+				<el-input v-model="searchInfo" placeholder="查询订单编号、生产款号" @keyup.enter="onSubmit()"  style="width: 220px;"></el-input>
 				<el-button type="primary" icon="search" @click="onSubmit" >查询</el-button>
 				<el-button type="primary" icon="edit"   @click="hptg_onClick" :disabled="table_Selection === false"  class="bt" title="核批通过">核批通过</el-button>
 				<el-button type="primary" icon="edit"   @click="ztgg_onClick" :disabled="table_Selection === false"  class="bt" title="状态更改">状态更改</el-button>
@@ -27,7 +27,7 @@
 							:header-cell-style="{ padding: '0px' }"
 							highlight-current-row="true"
 							:show-overflow-tooltip="true"
-							style="width: 100%;height: 65vh" border  :data="tableData1" row-key="ID" @selection-change="handleSelectionChange">
+							style="width: 100%;height: 65vh" border  :data="tableData1" :row-key="orderTableRowKey" @selection-change="handleSelectionChange">
 						<el-table-column   align="center" type="selection" width="40"/>
 						<el-table-column   align="center" label="技术附件状态" prop="status"  width="110" />
 						<el-table-column   align="center" label="订单附件状态" prop="orderstatus"  width="110" />
@@ -67,8 +67,8 @@
 						<el-table-column   align="left" label="制单日期" prop="Sys_rq"  width="160" />
 						<el-table-column   align="left" label="出库日期" prop="出库日期"  width="160" />
 						<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="160" />
+						<el-table-column   align="left" label="核批人员" prop="审核"  width="100" />
+						<el-table-column   align="left" label="核日期" prop="审核日期"  width="160" />
 					</el-table>
 				</el-tab-pane>
 					<div class="gva-pagination">
@@ -153,6 +153,13 @@
   
   const tableData1 = reactive([]);
   
+  /** 与接口 Uniqid 一致;避免 row-key 用错字段导致多行 key 相同、点选一行等同全选 */
+  const orderTableRowKey = (row) => {
+	const u = row.Uniqid ?? row.UNIQID ?? row.ID
+	if (u !== undefined && u !== null && u !== '') return u
+	return `${row['订单编号'] ?? ''}_${row['生产款号'] ?? ''}_${row['客户编号'] ?? ''}_${row['gd_statu'] ?? ''}`
+  }
+  
   // =========== 按钮 ===========
   // 搜索默认为空
   const searchInfo = ref('')
@@ -182,6 +189,7 @@
       _Uniqid.value = Uniqid_ids;
     } else {
       table_Selection.value = false;
+      _Uniqid.value = '';
     }
   };