liuhairui il y a 1 an
Parent
commit
781930592a
2 fichiers modifiés avec 97 ajouts et 233 suppressions
  1. 26 0
      src/api/mes/job.js
  2. 71 233
      src/view/yunyin/shengchanguanli/shengchanpaichan.vue

+ 26 - 0
src/api/mes/job.js

@@ -250,6 +250,32 @@ export const OrderYieldList = (params) => {
   })
 }
 
+//车缝派工菜单
+export const CfmachineList = (params) => {
+  return service({
+    url: '/mes_server/manufacture/CfmachineList',
+    method: 'get',
+    params
+  })
+}
+
+//车缝派工列表
+export const CfdataList = (params) => {
+  return service({
+    url: '/mes_server/manufacture/CfdataList',
+    method: 'get',
+    params
+  })
+}
+
+//车缝派工删除
+export const CfdataDel = (params) => {
+  return service({
+    url: '/mes_server/manufacture/CfdataDel',
+    method: 'get',
+    params
+  })
+}
 
 //获取报工历史记录
 export const getTab = (params) => {

+ 71 - 233
src/view/yunyin/shengchanguanli/shengchanpaichan.vue

@@ -26,7 +26,8 @@
 
               <div v-else>
               </div> 
-              <el-button type="primary" title="打印生产工单" icon="edit" @click="pd_gdprintonClick" class="bt">订单打印</el-button> 
+              <el-button type="primary" title="打印生产工单" icon="edit" @click="pd_gdprintonClick" class="bt">订单打印</el-button>
+			 <el-button type="primary" icon="edit"   @click="del_ddzlClick" v-if="table_del=== true" :disabled="table_Selection === ''"  class="bt" title="删除"  >删除</el-button>
             </el-form-item>
           </el-form>
 
@@ -362,6 +363,7 @@
       <layout>
         <layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
           <div class="JKWTree-tree" style="height: 200px">
+			  <h3>车缝车间列表</h3>
             <el-tree :data="treeData" :props="defaultProps" class="treecolor"  :current-node-key="currentNodeKey" @node-click="handleNodeClick"></el-tree>
           </div>
         </layout-sider>
@@ -467,30 +469,11 @@
                 <!-- 车缝小烫车间列表-->
                 <el-table-column type="selection" width="30" />
                 <template v-for="item in [
-                  { align:'left', title:'序号', prop: '序号', width: 80, sortable: 'sortable',fixed:'fixed', },
-                  { align:'left', title:'订单编号', prop: '订单编号', width: 110, sortable: 'sortable', },
-                  { align:'left', title: '生产款号', prop: '款号', width: 120, sortable: 'sortable', },
-                  { align:'left', title: '订单子编号', prop: '子订单编号', width: 120, sortable: 'sortable', },
-                  { align:'left', title: '颜色', prop: '颜色', width: 80, sortable: 'sortable', },
-                  { align:'left', title: '制单总数', prop: '制单数', width: 110,  sortable: 'sortable', },
-                  { align:'left', title: '排产数量', prop: '排产数量', width: 110,  sortable: 'sortable', },
-                  { align:'left', title: '工作中心', prop: '工作中心', width: 110,  sortable: 'sortable', },
-                  { align:'left', title: '部门', prop: '部门', width: 100,  sortable: 'sortable', },
-                  { align:'left', title: '客户', prop: '客户', width: 80,  sortable: 'sortable', },
-                  { align:'left', title: '落货日期', prop: '落货日期', width: 110,  sortable: 'sortable', },
-                  { align:'left', title: '款式', prop: '款式', width: 80, align:'center', sortable: 'sortable', },
-                  { align:'left', title: '箱唛要求', prop: '箱唛要求', width: 110,  sortable: 'sortable', },
-                  { align:'left', title: '面料', prop: '面料', width: 280,  sortable: 'sortable', },
-                  { align:'left', title: '要求', prop: '要求', width: 110,  sortable: 'sortable', },
-                  { align:'left', title: '船样描述', prop: '船样描述', width: 110,  sortable: 'sortable', },
-                  { align:'left', title: '船样合计', prop: '船样合计', width: 110,  sortable: 'sortable', },
-                  { align:'left', title: '粘衬', prop: '粘衬', width: 100  ,  sortable: 'sortable', },
-                  { align:'left', title: '订单数量', prop: '订单数量', width: 110,  sortable: 'sortable', },
-                  { align:'left', title: '单位', prop: '单位', width: 80,  sortable: 'sortable', },
-                  { align:'left', title: '审核', prop: '审核', width: 80,  sortable: 'sortable', },
-                  { align:'left', title: '审核日期', prop: '审核日期', width: 110,  sortable: 'sortable', },
-                  { align:'left', title: '排产时间', prop: '排产时间', width: 110,  sortable: 'sortable', },
-                  { align:'left', title: '排产人', prop: '排产人', width: 120,  sortable: 'sortable', },
+                  { align:'left', title:'订单编号', prop: '订单编号', width: 150, sortable: 'sortable', },
+                  { align:'left', title: '子订单编号', prop: '子订单编号', width: 150, sortable: 'sortable', },
+                  { align:'left', title: '班组编号', prop: '班组编号', width: 150,  sortable: 'sortable', },
+                  { align:'left', title: '创建人员', prop: '创建人员', width: 200,  sortable: 'sortable', },
+				  { align:'left', title: '创建时间', prop: '创建时间', width: 200,  sortable: 'sortable', },
               ]">
                   <el-table-column :align="item.align" :label="item.title"  :fixed="item.fixed" :prop="item.prop" :width="item.width" :sortable="item.sortable" />
                 </template>
@@ -543,7 +526,7 @@ import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDow
 import { ElMessage, ElMessageBox } from 'element-plus'
 import { ref, reactive,onMounted } from 'vue'
 import dayjs from 'dayjs'
-import {MachineList,MachineDetail} from '@/api/mes/job'
+import {MachineList,MachineDetail,CfmachineList,CfdataList,CfdataDel} from '@/api/mes/job'
 import {
   DataList,
   getProduct,
@@ -579,177 +562,29 @@ defineOptions({name: 'Company'})
 const printPageRef = ref()
 
 // =========== 左侧树侧形结构 ===========
-const sctreeData = ref([
-  {
-    label: '排产进程',
-    children:[
-      {label: '1.计划中工单', number: "计划中", type: '__customer'},
-      //{label: '2.排程中工单', number: "排程中",type: '__customer'},
-      {label: '2.制程中工单', number: "制程中", type: '__customer'},
-      {label: '3.已完工工单', number: "已完工", type: '__customer'}
-    ],
-  }
-]);
+
 //上方表格
-const tableFields = ref({
-  "计划中": [
-    { title:'序号', prop: '序号', width: 80, align:'center',sortable: 'sortable', },
-    { title:'订单号', prop: '订单号', width: 100, align:'left',sortable: 'sortable', },
-    { title: '生产款号', prop: '生产款号', width: 100, align:'center', sortable: 'sortable', },
-    { title: '订单子编号', prop: '订单子编号', width: 120, align:'center', sortable: 'sortable', },
-    { title: '颜色', prop: '颜色', width: 80, align:'left', sortable: 'sortable', },
-    { title: '制单总数', prop: '制单总数', width: 100, align:'left', sortable: 'sortable', },
-    { title: '工作中心', prop: '工作中心', width: 100, align:'left', sortable: 'sortable', },
-    { title: '部门', prop: '部门', width: 80, align:'left', sortable: 'sortable', },
-    { title: '客户', prop: '客户', width: 80, align:'center', sortable: 'sortable', },
-    { title: '落货日期', prop: '落货日期', width: 100, align:'left', sortable: 'sortable', },
-    { title: '款式', prop: '款式', width: 80, align:'center', sortable: 'sortable', },
-    { title: '箱唛要求', prop: '箱唛要求', width: 100, align:'left', sortable: 'sortable', },
-    { title: '面料', prop: '面料', width: 280, align:'left', sortable: 'sortable', },
-    { title: '要求', prop: '要求', width: 80, align:'left', sortable: 'sortable', },
-    { title: '船样描述', prop: '船样描述', width: 100, align:'left', sortable: 'sortable', },
-    { title: '船样合计', prop: '船样合计', width: 100, align:'left', sortable: 'sortable', },
-    { title: '粘衬', prop: '粘衬', width: 80  , align:'left', sortable: 'sortable', },
-    { title: '订单数量', prop: '订单数量', width: 100, align:'left', sortable: 'sortable', },
-    { title: '单位', prop: '单位', width: 80, align:'left', sortable: 'sortable', },
-    { title: '审核', prop: '审核', width: 80, align:'left', sortable: 'sortable', },
-    { title: '审核日期', prop: '审核日期', width: 100, align:'left', sortable: 'sortable', },
-  ],
-  "制程中": [
-    { title:'序号', prop: '序号', width: 80, align:'center',sortable: 'sortable', },
-    { title:'订单号', prop: '订单号', width: 100, align:'left',sortable: 'sortable', },
-    { title: '生产款号', prop: '生产款号', width: 100, align:'center', sortable: 'sortable', },
-    { title: '订单子编号', prop: '订单子编号', width: 120, align:'center', sortable: 'sortable', },
-    { title: '颜色', prop: '颜色', width: 80, align:'left', sortable: 'sortable', },
-    { title: '制单总数', prop: '制单总数', width: 100, align:'left', sortable: 'sortable', },
-    { title: '排产数量', prop: '排产数量', width: 100, align:'left', sortable: 'sortable', },
-    { title: '工作中心', prop: '工作中心', width: 100, align:'left', sortable: 'sortable', },
-    { title: '部门', prop: '部门', width: 80, align:'left', sortable: 'sortable', },
-    { title: '客户', prop: '客户', width: 80, align:'center', sortable: 'sortable', },
-    { title: '落货日期', prop: '落货日期', width: 100, align:'left', sortable: 'sortable', },
-    { title: '款式', prop: '款式', width: 80, align:'center', sortable: 'sortable', },
-    { title: '箱唛要求', prop: '箱唛要求', width: 100, align:'left', sortable: 'sortable', },
-    { title: '面料', prop: '面料', width: 280, align:'left', sortable: 'sortable', },
-    { title: '要求', prop: '要求', width: 80, align:'left', sortable: 'sortable', },
-    { title: '船样描述', prop: '船样描述', width: 100, align:'left', sortable: 'sortable', },
-    { title: '船样合计', prop: '船样合计', width: 100, align:'left', sortable: 'sortable', },
-    { title: '粘衬', prop: '粘衬', width: 80  , align:'left', sortable: 'sortable', },
-    { title: '订单数量', prop: '订单数量', width: 100, align:'left', sortable: 'sortable', },
-    { title: '单位', prop: '单位', width: 80, align:'left', sortable: 'sortable', },
-    { title: '审核', prop: '审核', width: 80, align:'left', sortable: 'sortable', },
-    { title: '审核日期', prop: '审核日期', width: 100, align:'left', sortable: 'sortable', },
-    { title: '排产时间', prop: '排产时间', width: 100, align:'left', sortable: 'sortable', },
-    { title: '排产人', prop: '排产人', width: 120, align:'left', sortable: 'sortable', },
-  ],
-  "已完工": [
-    { title:'序号', prop: '序号', width: 80, align:'center',sortable: 'sortable', },
-    { title:'订单号', prop: '订单号', width: 100, align:'left',sortable: 'sortable', },
-    { title: '生产款号', prop: '生产款号', width: 100, align:'center', sortable: 'sortable', },
-    { title: '订单子编号', prop: '订单子编号', width: 120, align:'center', sortable: 'sortable', },
-    { title: '颜色', prop: '颜色', width: 80, align:'left', sortable: 'sortable', },
-    { title: '制单总数', prop: '制单总数', width: 100, align:'left', sortable: 'sortable', },
-    { title: '排产数量', prop: '排产数量', width: 100, align:'left', sortable: 'sortable', },
-    { title: '完工数量', prop: '完工数量', width: 100, align:'left', sortable: 'sortable', },
-    { title: '工作中心', prop: '工作中心', width: 100, align:'left', sortable: 'sortable', },
-    { title: '部门', prop: '部门', width: 80, align:'left', sortable: 'sortable', },
-    { title: '客户', prop: '客户', width: 80, align:'center', sortable: 'sortable', },
-    { title: '落货日期', prop: '落货日期', width: 100, align:'left', sortable: 'sortable', },
-    { title: '款式', prop: '款式', width: 80, align:'center', sortable: 'sortable', },
-    { title: '箱唛要求', prop: '箱唛要求', width: 100, align:'left', sortable: 'sortable', },
-    { title: '面料', prop: '面料', width: 280, align:'left', sortable: 'sortable', },
-    { title: '要求', prop: '要求', width: 80, align:'left', sortable: 'sortable', },
-    { title: '船样描述', prop: '船样描述', width: 100, align:'left', sortable: 'sortable', },
-    { title: '船样合计', prop: '船样合计', width: 100, align:'left', sortable: 'sortable', },
-    { title: '粘衬', prop: '粘衬', width: 80  , align:'left', sortable: 'sortable', },
-    { title: '订单数量', prop: '订单数量', width: 100, align:'left', sortable: 'sortable', },
-    { title: '单位', prop: '单位', width: 80, align:'left', sortable: 'sortable', },
-    { title: '审核', prop: '审核', width: 80, align:'left', sortable: 'sortable', },
-    { title: '审核日期', prop: '审核日期', width: 100, align:'left', sortable: 'sortable', },
-    { title: '排产时间', prop: '排产时间', width: 100, align:'left', sortable: 'sortable', },
-    { title: '排产人', prop: '排产人', width: 120, align:'left', sortable: 'sortable', },
-    { title: '完工时间', prop: '完工时间', width: 100, align:'left', sortable: 'sortable', },
-  ]
-})
-//排程中、制程中下方表格列表
-const bottomTableF = ref({
-  "排程中": [
-    { title:'工单编号', prop: '工单编号', width: 110, align:'left',  sortable: 'sortable',fixed:'fixed'},
-    { title:'印件工序及名称', prop: '印件工序及名称', width: 160, align:'left',  sortable: 'sortable', },
-    { title:'机组', prop: '机组', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'设备编号', prop: '设备编号', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'工序产量', prop: '工序产量', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'已完成产量', prop: '产量', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'剩余产量', prop: '剩余产量', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'小时产能', prop: '小时产能', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'产能系数', prop: '产能系数', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'生产工时', prop: '生产工时', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'辅助工时', prop: '辅助工时', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'最早开工时间', prop: '最早开工时间', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'计划开工时间', prop: '计划开工时间', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'计划完工时间', prop: '计划完工时间', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'班次安排', prop: '班次安排', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'设备名称', prop: '设备名称', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'排单备注', prop: '排单备注', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'工序完工', prop: '工序完工', width: 160, align:'left',  sortable: 'sortable', },
-    { title:'UNIQID', prop: 'UNIQID', width: 120, align:'left',  sortable: 'sortable', },
-  ],
-  "制程中": [
-    { title:'工单编号', prop: '工单编号', width: 110, align:'left',  sortable: 'sortable',fixed:'fixed'},
-    { title:'印件工序及名称', prop: '印件工序及名称', width: 160, align:'left',  sortable: 'sortable', },
-    { title:'机组', prop: '机组', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'设备编号', prop: '设备编号', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'工序产量', prop: '工序产量', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'已完成产量', prop: '产量', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'剩余产量', prop: '剩余产量', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'小时产能', prop: '小时产能', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'产能系数', prop: '产能系数', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'生产工时', prop: '生产工时', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'辅助工时', prop: '辅助工时', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'最早开工时间', prop: '最早开工时间', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'计划开工时间', prop: '计划开工时间', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'计划完工时间', prop: '计划完工时间', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'班次安排', prop: '班次安排', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'设备名称', prop: '设备名称', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'排单备注', prop: '排单备注', width: 120, align:'left',  sortable: 'sortable', },
-    { title:'工序完工', prop: '工序完工', width: 160, align:'left',  sortable: 'sortable', },
-    { title:'UNIQID', prop: 'UNIQID', width: 120, align:'left',  sortable: 'sortable', },
-  ],
-})
-
-
-
-//左侧左边栏
-const treeData = ref([]);  
-const machineLists = ref([]);  
+const tableFields = ref({})
+
+
+
+// =========== 获取左侧树侧形结构 ===========
+  const treeData = ref([]);  
+  const _department_code = ref(null)
+const getDepartmentdata = async () => {  
+  try {  
+	const CfmachineLists = await CfmachineList();
+	CfmachineLists.data.forEach(id => {
+	  treeData.value.push({  
+	    label: id,
+	  });  
+	}); 
+  } catch (error) {  
+    console.error(error);  
+  }  
+};  
   
-async function fetchMachineLists() {    
-  try {    
-    const response = await MachineList(); 
-    machineLists.value = response;   
-  } catch (error) {    
-    console.error('Failed to fetch machine lists:', error);    
-  }    
-}    
-// 车间侧边栏 进入页面自动加载【车间】数据    
-async function workbenchdata() {    
-  await fetchMachineLists(); // 首先获取车间列表    
-  if (machineLists.value && machineLists.value.data && machineLists.value.data.length > 0) {    
-    const data = [    
-      {    
-        label: '车缝小烫车间',    
-        children: machineLists.value.data.map(machineId => ({    
-          label: machineId,
-        })),    
-      }  
-    ];    
-    treeData.value = data;
-    treeData.value.unshift(sctreeData.value[0])
-  } else {    
-    console.log('No machine lists found.');    
-  }    
-}  
-// 在组件挂载时调用 workbenchdata  
-onMounted(workbenchdata); 
+getDepartmentdata();
   
 
 
@@ -758,8 +593,8 @@ const _Gd_gdbh = ref(null)
 const _Gd_yjno = ref(null)
 //点击表格 通过上方表格【工单编号】获取下方表格数据
 const chejianRowClick = async (row) => {
-  _Gd_gdbh.value = row.订单号;
-  _Gd_yjno.value = row.yjno;
+	console.log(row.订单编号)
+  _Gd_gdbh.value = row.订单编号;
 }
 const gdtableRowClick = async (row) => {
   _Gd_gdbh.value = row.订单号
@@ -769,8 +604,11 @@ const gdtableRowClick = async (row) => {
 const tableData = reactive([])
 const chejianData = reactive([])
 const _machine = ref(null);
-const treeType = ref('customTree') // customTree // 计划中,排产中 ,dataTree 车间
+const treeType = ref('dataTree') // customTree // 计划中,排产中 ,dataTree 车间
+const machine = ref('');//记录左侧车间机台编号
+//点击左侧菜单栏
 const handleNodeClick = async (node) => {
+	
   // 取消所有节点的颜色
   const allNodes = document.querySelectorAll('.treecolor .el-tree-node');
   allNodes.forEach(node => {
@@ -784,16 +622,17 @@ const handleNodeClick = async (node) => {
     clickedNode.querySelector('.el-tree-node__label').style.color = 'red';
   }
 
-  console.log(123456)
   console.log(node.type)
+  
   if (node.type && node.type === '__customer') {
     treeType.value = 'customTree'
     schandleNodeClick(node)
   } else if (!node.children) {
+	 machine.value =  node.label
     treeType.value = 'dataTree'
-    const MachineDetailtable = await MachineDetail({machine:node.label});
-    console.log(99999,MachineDetailtable)
-    const cjData = MachineDetailtable.data
+    const CfdataListtable = await CfdataList({machine:machine.value});
+    console.log(99999,CfdataListtable)
+    const cjData = CfdataListtable.data
     console.log(cjData)
     chejianData.splice(0,chejianData.length,...cjData);//表格数据
   } 
@@ -1261,37 +1100,36 @@ const ongxwgClick = async () => {
     }
   }
 };
-//加入排程【上面到下面】
-const _PC_gxh = ref(null)
-const _PC_yjno = ref(null)
-const _PC_gdbh = ref(null)
-const _PC_xscn = ref(null)
-const jitaiArr = ref([])
-const PC_handleChange = (arr) => {
-  let gxh = arr.map((val) => val['gxh']).join(",");
-  let yjno = arr.map((val) => val['yjno']).join(",");
-  let str = arr.map((val) => val['工单编号']).join(",");
-  let xscn = arr.map((val) => val['小时产能']).join(",");
-  _PC_gxh.value = gxh;
-  _PC_yjno.value = yjno;
-  _PC_gdbh.value = str;
-  _PC_xscn.value = xscn;
-  jitaiArr.value = arr
-}
-//加入制程【下面到上面】
-const _ZC_gxh = ref(null)
-const _ZC_yjno = ref(null)
-const _ZC_gdbh = ref(null)
-const _ZC_xscn = ref(null)
-const ZP_handleChange = (arr) => {
-  let gxh = arr.map((val) => val['gxh']).join(",");
-  let yjno = arr.map((val) => val['yjno']).join(",");
-  let str = arr.map((val) => val['工单编号']).join(",");
-  let xscn = arr.map((val) => val['小时产能']).join(",");
-  _ZC_gxh.value = gxh;
-  _ZC_yjno.value = yjno;
-  _ZC_gdbh.value = str;
-  _ZC_xscn.value = xscn;
+
+const table_del = ref(true)
+//表格复选框
+const table_Selection = ref('')
+const PC_handleChange = (selection, type) => {
+	console.log(selection)
+  const ids = selection.map(item => {
+    return item.UniqId
+  })
+  // console.log('获取复选框Uniqid:',ids)
+  table_Selection.value = ids.join(',')
+  console.log("获取复选框逗号间隔:",table_Selection.value)
+}
+
+//删除按钮
+const del_ddzlClick = async () => {
+	console.log(table_Selection._value)
+  
+	let params = {};  
+	params.UniqId = table_Selection._value; 
+	console.log(params)
+  
+	const res1 = await CfdataDel(params)
+	res1.code === 0 && ElMessage.success('删除成功')
+
+	const CfdataListtable = await CfdataList({machine:machine.value});
+	console.log(99999,CfdataListtable)
+	const cjData = CfdataListtable.data
+	console.log(cjData)
+	chejianData.splice(0,chejianData.length,...cjData);//表格数据
 }
 
 //=========工序产量核查===========