zck 9 hónapja
szülő
commit
adb13c3122
1 módosított fájl, 44 hozzáadás és 15 törlés
  1. 44 15
      src/view/performance/chukubaogong.vue

+ 44 - 15
src/view/performance/chukubaogong.vue

@@ -51,6 +51,7 @@
 		<el-button type="primary" @click="res_bomcloseDialog"  style="width: 100px;height: 50px;margin-left: 10px;">关 闭</el-button>
 		<el-button type="primary" @click="res_bomenterDialog"  style="width: 100px;height: 50px;">确定领用</el-button>
 		<el-button type="primary" @click="print_lingyong"  style="width: 100px;height: 50px;">增加至领用页</el-button>
+		<!-- <el-button type="primary" @click="del_lingyong"  style="width: 100px;height: 50px;">删除</el-button> -->
 	</div>
 	<el-divider content-position="left">
 		<span style="font-size: 18px;color:red;font-weight: bold;margin-left: 20px;">绿色部分可进行填写</span>
@@ -87,7 +88,9 @@
   				  :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
     		          style="width: 100%;height: 45vh" border tooltip-effect="dark"
     		          :data="FabriccollartableData" row-key="ID"
-    		          :cell-class-name="scfjfpxsCellClass">
+    		          :cell-class-name="scfjfpxsCellClass"
+					  @selection-change="FabriccollarhandleSelectionChange">
+					  <!-- <el-table-column type="selection" width="30" /> -->
     		  <template v-for="(item, idx) in Fabriccollar_tableColumns">
     		    <el-table-column #default="{ row, column, $index }" align="left" :label="item.label" :width="item.width" >
     		      <div v-if="['领用'].includes(item.prop)">
@@ -221,6 +224,7 @@ const add_onSubmit = async ()=>{
 	if(orderSearchdata.data.length === 1){
 		res_bomdialogFormVisible.value = true
 		_orderid.value = orderSearchdata.data[0]['订单编号']
+		add_searchInfo.value = orderSearchdata.data[0]['订单编号']
 		add_lysearchInfo.value = add_searchInfo.value
 		Reporting_onSubmit()
 	}else{
@@ -239,6 +243,10 @@ const tableRowClick = async (row)=>{
 
 //出库查询
 const add_lyonSubmit = async ()=>{
+	const orderSearchdata = await orderSearch({search:add_lysearchInfo.value});
+	if(orderSearchdata.data.length === 1){
+		add_lysearchInfo.value = orderSearchdata.data[0]['订单编号']
+	}
 	try {
     const orderBomListdata = await orderBomList({order:add_lysearchInfo.value});
 	resbomtableData.value = orderBomListdata.data;
@@ -271,10 +279,10 @@ const ddhformData = reactive({
 });
 const resbom_tableColumns = ref(
     [
-		{ label: '订单编号', prop: '订单编号', width: '170' },
-		{ label: '客户', prop: '客户编号', width: '170' },
-		{ label: '生产款号', prop: '生产款号', width: '170' },
-		{ label: '款式', prop: '款式', width: '170' },
+		{ label: '订单编号', prop: '订单编号', width: '110' },
+		{ label: '客户', prop: '客户编号', width: '100' },
+		{ label: '生产款号', prop: '生产款号', width: '150' },
+		{ label: '款式', prop: '款式', width: '150' },
 		{ label: '物料名称', prop: '物料名称', width: '170' },
 		{ label: '计划用料', prop: '计划用料', width: '110' },
 		{ label: '定额用料', prop: '定额用料', width: '110' },
@@ -286,16 +294,16 @@ const resbom_tableColumns = ref(
 		{ label: '本次领用', prop: '领用', width: '110' },
 		// { label: '备注', prop: '备注', width: '120' },
 		{ label: '投料单位', prop: '投料单位', width: '100' },
-		// { label: 'UNIQID', prop: 'UNIQID', width: '80' },
+		{ label: 'UNIQID', prop: 'UNIQID', width: '80' },
     ]
 )
 
 const Fabriccollar_tableColumns = ref(
     [
-		{ label: '订单编号', prop: '订单编号', width: '170' },
-		{ label: '客户', prop: '客户编号', width: '170' },
-		{ label: '生产款号', prop: '生产款号', width: '170' },
-		{ label: '款式', prop: '款式', width: '170' },
+		{ label: '订单编号', prop: '订单编号', width: '110' },
+		{ label: '客户', prop: '客户编号', width: '100' },
+		{ label: '生产款号', prop: '生产款号', width: '150' },
+		{ label: '款式', prop: '款式', width: '150' },
 		{ label: '物料名称', prop: '物料名称', width: '170' },
 		{ label: '计划用料', prop: '计划用料', width: '110' },
 		{ label: '定额用料', prop: '定额用料', width: '110' },
@@ -307,7 +315,7 @@ const Fabriccollar_tableColumns = ref(
 		{ label: '本次领用', prop: '领用', width: '110' },
 		// { label: '备注', prop: '备注', width: '120' },
 		{ label: '投料单位', prop: '投料单位', width: '100' },
-		// { label: 'UNIQID', prop: 'UNIQID', width: '80' },
+		{ label: 'UNIQID', prop: 'UNIQID', width: '80' },
     ]
 )
 //报工按钮
@@ -326,10 +334,6 @@ const Reporting_onSubmit = async ()=>{
 //bom数据获取
 const _TestCoefficient = async ()=>{
   try {
-	  ddhformData.ddh = restableData[0]['订单编号']
-	  ddhformData.kh = restableData[0]['客户编号']
-	  ddhformData.sckh = restableData[0]['生产款号']
-	  ddhformData.ks = restableData[0]['款式']
     const orderBomListdata = await orderBomList({order:_orderid.value});
 	console.log(orderBomListdata)
 	resbomtableData.value = orderBomListdata.data;
@@ -427,6 +431,31 @@ const print_lingyong = async () => {
   FabriccollartableData.value.push(...filteredData);
 }
 
+// //删除
+// const del_lingyong = async () => {
+//   if (!lySelection.value) {
+//     console.log('没有选中任何行');
+//     return;
+//   }
+ 
+//   const idsToDelete = lySelection.value.split(',').map(Number); // 确保转换为数字
+//   console.log('要删除的ID:', idsToDelete);
+//   console.log('当前数据:', FabriccollartableData.value);
+ 
+//   FabriccollartableData.value = FabriccollartableData.value.filter(
+//     item => !idsToDelete.includes(item.UNIQID)
+//   );
+ 
+//   console.log('删除后的数据:', FabriccollartableData.value);
+//   lySelection.value = '';
+// };
+
+// const lySelection = ref('')
+// const FabriccollarhandleSelectionChange = (selection) => {
+//   const ids = selection.map(item => item.UNIQID); // 提取每行的 UniqId
+//   lySelection.value = ids.join(','); // 将 UniqId 数组转换为逗号分隔的字符串
+//   console.log(lySelection.value)
+// };
 
 //=============出库退还记录==================
 const cktableData = reactive([])