zck 9 months ago
parent
commit
c3f47d1ece
1 changed files with 72 additions and 7 deletions
  1. 72 7
      src/view/yunyin/shengchanguanli/gongdanziliao.vue

+ 72 - 7
src/view/yunyin/shengchanguanli/gongdanziliao.vue

@@ -472,7 +472,7 @@
 		          />
 		        </el-form-item>
 		      </el-form>
-			  <el-button type="primary" @click="Related_fabrics" style="height: 50px;font-size: 20px;">关联订单面料</el-button>
+			  <el-button type="primary" @click="Related_fabrics" style="height: 50px;font-size: 20px; margin-left: 70px;">关联订单面料</el-button>
 		    </div>
 		  </div>
 		
@@ -524,18 +524,45 @@
 		  </template>
 		</el-dialog>
 
-		<el-dialog v-model="Related_fabricsVisible" :before-close="Related_fabricscloseDialog" title="新增订单资料" width="70%" top="2%" destroy-on-close>
+		<el-dialog v-model="Related_fabricsVisible" :before-close="Related_fabricscloseDialog" title="关联订单资料" width="55%" top="2%" destroy-on-close>
             <el-form>
               <div>
                 <el-form-item label="关键字:"  class="mab" prop="keyOrder">
                   <el-space>
-                    <el-input v-model="cpyjdh_keyword" style="width: 100%;"/>
-                    <el-button @click="cpsearchHandle(cpyjdh_keyword)">搜索</el-button>
+                    <el-input v-model="glddzl_keyword" style="width: 100%;"/>
+                    <el-button @click="ddsearchHandle(glddzl_keyword)">搜索</el-button>
                   </el-space>
                 </el-form-item>
-                <div style="border:1px solid #eee; width:100%; height: 400px; overflow-y: auto">
-                  <el-tree :data="getProductYjListdata" :props="{children: 'children',label: 'label', value: '物料代码'}" @node-click="selectNode" />
-                </div>
+                <el-table ref="multipleTable"
+                          :row-style="{ height: '20px' }"
+                          :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+                          :header-cell-style="{ padding: '0px' }"
+                          :show-overflow-tooltip="true"
+                          :cell-class-name="planUsageCellClass"
+                          highlight-current-row="true"
+                          @row-dblclick="bombomupdateCompanyFunc2"
+						  @selection-change="glddSelectionChange"
+                          style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="glddtableData" row-key="ID">
+                 <el-table-column type="selection" width="30" />
+                  <el-table-column align="left" label="订单编号" prop="订单编号"  width="105"/>
+                  <el-table-column align="left" label="物料名称" prop="物料名称"  width="170"/>
+                  <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="90"/>
+                  <el-table-column align="left" label="定额门幅" prop="定额门幅"  width="100"/>
+                  <el-table-column align="left" label="id" prop="ID"  width="100"/>
+				  <el-table-column align="left" label="单位" prop="投料单位"  width="60"/>
+				  <el-table-column align="left" label="备注" prop="备注"  width="180"/>
+				  <el-table-column align="left" label="面料结余" prop="面料结余"  width="160"/>
+				  <el-table-column align="left" label="颜色" prop="颜色"  width="160"/>
+				  <el-table-column align="left" label="生产款号" prop="生产款号"  width="160"/>
+				  <el-table-column align="left" label="BOM_物料编码" prop="BOM_物料编码"  width="160"/>
+				  <el-table-column align="left" label="入库总量" prop="入库总量"  width="160"/>
+				  <el-table-column align="left" label="裁床实际用料" prop="裁床实际用料"  width="160"/>
+				  <el-table-column align="left" label="裁床领用面料" prop="裁床领用面料"  width="160"/>
+				  <el-table-column align="left" label="裁床退回仓库面料" prop="裁床退回仓库面料"  width="160"/>
+				  <!-- <el-table-column align="left" label="UNIQID" prop="UNIQID"  width="80"/> -->
+                </el-table>
               </div>
             </el-form>
 			<template #footer>
@@ -1704,6 +1731,8 @@ const add_gdenterDialog = async ()=>{
 		Sys_id: _username.value,
 		接单日期: currentDates,
 		img: add_gdscgdformData.img,
+		关联订单:gldd_Selection_ddbh.value,
+		关联面料ID:gldd_Selection.value
 	};
 	console.log(formattedData)
 	const edit_gdformdata_list = await WorkOrderAdd(formattedData);
@@ -1722,10 +1751,46 @@ const add_gdcloseDialog = () => {
   add_gddialogFormVisible.value = false
 }
 
+// =========== 关联订单资料 ===========
 const Related_fabricsVisible = ref(false)
+const glddzl_keyword = ref('')
+const glddtableData = reactive([])
 const Related_fabrics = () => {
 	Related_fabricsVisible.value = true
 }
+const ddsearchHandle = async (v) => {
+  const response = await fabricList({order:v});
+  if (response.data && response.data.length === 0) {
+    ElMessage({type: 'warning',message: '未查询到搜索条件'})
+  }else{
+    glddtableData.splice(0, response.data.table.total, ...response.data.table);
+  }
+}
+
+const gldd_Selection = ref('')//存储选中Uniqid
+const gldd_Selection_ddbh = ref('')//存储选中订单编号
+const glddSelectionChange = (selection, type) => {
+  console.log(selection);
+  const ids = selection.map(item => item.UNIQID);
+  const dds = selection.map(item => item.订单编号);
+  // 使用 Set 去重
+  const uniqueIds = [...new Set(ids)];
+  const uniqueDds = [...new Set(dds)];
+  gldd_Selection.value = uniqueIds.join(',');
+  gldd_Selection_ddbh.value = uniqueDds.join(',');
+  console.log("关联订单复选框", gldd_Selection.value);
+  console.log("关联订单编号", gldd_Selection_ddbh.value);
+}
+//关联订单取消
+const Related_fabricscloseDialog = () => {
+	gldd_Selection.value = ''
+	Related_fabricsVisible.value = false
+}
+//关联订单确定
+const Related_fabricsenterDialog = () => {
+	Related_fabricsVisible.value = false
+}
+
 
 
 // =========== 新增颜色资料 ===========