zck 1 year ago
parent
commit
42be147467

+ 7 - 1
src/view/yunyin/shengchanguanli/components/print.vue

@@ -64,8 +64,14 @@ const form = reactive({})
 
 
 const open = (gongdanId) => {
-    form['gdbh'] = '2408001';
+  // console.log(gongdanId)
+  if (gongdanId == null) {
+    ElMessage({type: 'warning',message: '请选择具体的工单后,再操作此功能'});
+  } else {
+    form['gdbh'] = gongdanId;
     visibie.value = true;
+  }
+    
 }
 
 //工单打印回车

+ 6 - 244
src/view/yunyin/shengchanguanli/gongdanziliao.vue

@@ -970,7 +970,7 @@ const handleNodeClick = async (node) => {
 };
 
 //全局调用工单编号
-const _Gd_gdbh = ref("Y2407037")
+const _Gd_gdbh = ref('')
 //全局调用产品代号
 const _Gd_cpdh = ref(null)
 //全局调用产品名称
@@ -1035,7 +1035,7 @@ const _WorkList_page = async () => {
         '审核日期':'2024/6/27'
       },
   ];
-	console.log("上方表格数据")
+	  console.log("上方表格数据")
     console.log(WorkListdata)
     tableData.splice(0,tableData.length,...WorkListdata);//表格数据
     total.value =WorkListdata.data.total;//共多少条
@@ -1392,6 +1392,7 @@ const add_gxcloseDialog = () => {
 
 // =========== 订单打印 ===========
 const cp_gdprintonClick = () => {
+  console.log(_Gd_gdbh.value)
   // yunying/components/print页面
   printPageRef.value.open(_Gd_gdbh.value) 
 }
@@ -1409,7 +1410,8 @@ const ddtableData = reactive([])
 const jstableData = reactive([])
 // 点击工单行按钮
 const tableRowClick = async (row) => {
-
+  console.log(row.订单号)
+  _Gd_gdbh.value = row.订单号
   if(row.订单号 === '2408001' ){
     ystableData.length = 0
     try {
@@ -1586,7 +1588,7 @@ const tableRowClick = async (row) => {
     gytableData.splice(0,gyData.length,...gyData);//表格数据
     ddtableData.splice(0,ddData.length,...ddData);//表格数据
     jstableData.splice(0,jsData.length,...jsData);//表格数据
-    console.log(ystableData)
+    // console.log(ystableData)
   } catch (error) {
     console.error(error);
   }
@@ -3409,246 +3411,6 @@ const _U8Trial = async ()=>{
 const oncloneclick = () => {tlsslist.value = false;};
 
 
-//===========工单状态设置按钮=======
-// const onstatuslist = ref(false);
-// const statusformData = reactive({gdbh: '',});
-// const status = ref('计划中'); // 默认选择
-// const onStatusClick = () => {
-//   if(_Gd_gdbh.value === null || _Gd_gdbh.value === ''){
-//     onstatuslist.value = false;
-//     ElMessage({
-//       type: 'warning',
-//       message: '请选择树形后,再操作此功能'
-//     })
-//   }else{
-//     statusformData['gdbh'] = _Gd_gdbh.value;
-//     onstatuslist.value = true;
-//   }
-// };
-//工单状态设置【放弃按钮】
-// const handleCancel = () => {
-//   onstatuslist.value = false;
-// };
-// //工单状态设置【执行按钮】
-// const handleConfirm = async () => {
-//   //工单编号
-//   let workOrder = statusformData['gdbh'];
-//   //状态
-//   let statusCode;
-//   if (status.value === '计划中') {
-//     statusCode = "3-计划中";
-//   } else if (status.value === '生产中') {
-//     statusCode = "2-生产中";
-//   }else if (status.value === '已完工') {
-//     statusCode = "1-已完工";
-//   }
-//   const StatusEditdata = await StatusEdit({workOrder:workOrder,status:statusCode});
-//   if (StatusEditdata.code === 0) {
-//     ElMessage({type: 'success',message: '更新成功'})
-//   } else {
-//     ElMessage({type: 'error',message: '更新失败'})
-//   }
-//   onstatuslist.value = false;
-// };
-
-
-
-
-
-// =========== 引用产品资料 ===========
-// const yycpzlformData = reactive({
-//   gdbh: '',
-//   khdh: '',
-//   khmc: '',
-//   cpdh: '',
-//   cpmc: '',
-//   yjzl:true,
-//   gyap: true,
-//   gyfa: '',
-//   fangan: 'A',
-// });
-// const onyycpzllist = ref(false);
-// const fanganRef = ref();
-// const yyzltableData = ref([]);
-
-// //引用产品资料【按钮】
-// const onyycpzlclick = () => {
-//   if(_Gd_gdbh.value == null){
-//     onyycpzllist.value = false;
-//     ElMessage({type: 'warning',message: '请选择具体的工单后,再操作此功能'})
-//   }else{
-//     yycpzlformData['gdbh'] = _Gd_gdbh.value;
-//     // yycpzlformData['cpdh'] = _Gd_cpdh.value;
-//     yyzltableData.value = [];
-//     _WorkOrderDetailCopedata();
-//     onyycpzllist.value = true;
-//   }
-// };
-// //引用产品资料工单编号【回车】
-// const yycpzlProductValue = async (e) => {
-//   if (e.code === 'Enter') {
-//     if (yycpzlformData['gdbh'] == null || yycpzlformData['gdbh'] == '') {
-//       ElMessage({ type: 'warning', message: '工单编号不能为空' })
-//       return false;
-//     }
-//     await _DetailCope();
-//   }
-//   if (e.code === 'Tab') {
-//     await  _WorkOrderDetailCopedata()
-//     fanganKeyDown()
-//   }
-// };
-// // const fanganProductValue = async (e) => {
-// //   if (e.code === 'Tab') {
-// //     console.log(123)
-// //     await  _WorkOrderDetailCopedata()
-// //     fanganRef.value.focus()
-// //   }
-// // };
-
-// const WorkOrderDetailCopesFangan = ref([])
-// const defaultSelectionFangan = ref()
-// //引用产品资料->获取产品资料
-// const _WorkOrderDetailCopedata = async ()=>{
-//   let search = yycpzlformData['gdbh'];
-//   // 2403725 是带两个方案的
-//   const WorkOrderDetailCopes = await ProductCopeDetail({workorder:search});
-//   console.log(WorkOrderDetailCopes)
-//   // fanganRef.value.focus()
-//   if(WorkOrderDetailCopes.msg === '未找到工单信息'){
-//     yycpzlformData['khdh'] = '';
-//     yycpzlformData['khmc'] = '';
-//     yycpzlformData['cpdh'] = '';
-//     yycpzlformData['cpmc'] =  '';
-//     // ElMessage({type: 'warning',message: '未找到工单信息'})
-//     return false;
-//   }else{
-//     yycpzlformData['gdbh'] = WorkOrderDetailCopes.data['工单编号'];
-//     yycpzlformData['khdh'] = WorkOrderDetailCopes.data['客户编号'];
-//     yycpzlformData['khmc'] = WorkOrderDetailCopes.data['客户名称'];
-//     yycpzlformData['cpdh'] = WorkOrderDetailCopes.data['产品编号'];
-//     yycpzlformData['cpmc'] = WorkOrderDetailCopes.data['产品名称'];
-//     yycpzlformData['fangan'] = WorkOrderDetailCopes.data['方案'][0]['方案'];
-//     defaultSelectionFangan.value = WorkOrderDetailCopes.data['方案'][0]['方案']
-//     WorkOrderDetailCopesFangan.value = WorkOrderDetailCopes.data['方案']
-//   }
-// }
-
-// // const yycppshuaxin_click = async ()=>{
-// //   let search = yycpzlformData['gdbh'];
-// //   console.log(search)
-// //   const WorkOrderDetailCope_table = await WorkOrderDetailCope({search:search});
-// //   console.log(WorkOrderDetailCope_table)
-// //   yyzltableData.value = WorkOrderDetailCope_table.data
-// // }
-// const _DetailCope = async (row)=>{
-//   let search = yycpzlformData['gdbh'];
-//   console.log(search)
-//   const WorkOrderDetailCope_table = await WorkOrderDetailCope({search:search});
-//   console.log(WorkOrderDetailCope_table)
-//   yyzltableData.value = WorkOrderDetailCope_table.data
-// }
-// const yyzltableRowClick = async (row)=>{
-//   yycpzlformData['gdbh'] = row['工单编号'];
-//   _WorkOrderDetailCopedata();
-// }
-
-// const setFangan = (node) => {
-//   yycpzlformData['fangan'] = node['方案']
-//   defaultSelectionFangan.value = node['方案']
-//   document.removeEventListener('keydown', () => {})
-//   openFangan.value = false
-// }
-
-// const openFangan = ref(false)
-// const fanganKeyDown = () => {
-//   //2403725
-//   if (WorkOrderDetailCopesFangan.value.length > 1) {
-//     openFangan.value = true
-//     document.addEventListener('keydown', (e) => {
-//       let currentIndex
-//       WorkOrderDetailCopesFangan.value.map( (item, index) => {
-//         if (item['方案'] === defaultSelectionFangan.value[0]) {
-//           currentIndex = index
-//         }
-//       })
-//       if (e.code === 'ArrowDown') {
-//         if (WorkOrderDetailCopesFangan.value[currentIndex + 1]) {
-//           defaultSelectionFangan.value = WorkOrderDetailCopesFangan.value[currentIndex + 1]['方案']
-//         } else {
-//           defaultSelectionFangan.value = WorkOrderDetailCopesFangan.value[0]['方案']
-//         }
-//       }
-//       if (e.code === 'ArrowUp') {
-//         if (WorkOrderDetailCopesFangan.value[currentIndex - 1]) {
-//           defaultSelectionFangan.value = WorkOrderDetailCopesFangan.value[currentIndex - 1]['方案']
-//         } else {
-//           defaultSelectionFangan.value = WorkOrderDetailCopesFangan.value[WorkOrderDetailCopesFangan.value.length - 1]['方案']
-//         }
-//       }
-//       if (e.code === 'Enter') {
-//         yycpzlformData['fangan'] = defaultSelectionFangan.value
-//         console.log(12312312312312321321321321)
-//         document.removeEventListener('keydown', (e) => {
-//           console.log(e)
-//         })
-//         openFangan.value = false
-//       }
-//     })
-//   }
-// }
-// //引用产品资料【执行】按钮
-// const yycpzlhandleConfirm = async () => {
-//   _ProductInformationEdit();
-// };
-// //引用产品资料->获取产品资料
-// const _ProductInformationEdit = async ()=>{
-//   console.log(yycpzlformData)
-//   if(yycpzlformData['gdbh'] === null || yycpzlformData['gdbh'] === undefined){
-//     ElMessage({type: 'warning', message: '工单编号为空'});
-//     return false;
-//   }
-//   if(yycpzlformData['cpdh'] === null || yycpzlformData['cpdh'] === undefined){
-//     ElMessage({type: 'warning', message: '产品代号为空'});
-//     return false;
-//   }
-//   if(yycpzlformData['fangan'] === null || yycpzlformData['fangan'] === undefined){
-//     ElMessage({type: 'warning', message: '工艺方案为空'});
-//     return false;
-//   }
-//   let params = {}
-//   params.workorder = _Gd_gdbh.value;
-//   params.productCode = yycpzlformData['cpdh'];
-//   params.option = yycpzlformData['fangan'];
-//   console.log(params)
-//   try {
-//     const ProductInformationEditdata = await WorkOrderDetailListCope(params);
-//     if (ProductInformationEditdata.code === 0) {
-//       const workOrderListDetail_data = await workOrderListDetail({Gd_gdbh:_Gd_gdbh.value});
-//       yjtableData.value = workOrderListDetail_data.data.printList;
-//       ElMessage({type: 'success', message: '更新成功'})
-//       onyycpzllist.value = false;
-//     }
-//     // else {
-//     //   ElMessage({type: 'error',message: '更新失败'})
-//     // }
-//   } catch (error) {
-//     console.error(error);
-//   }
-// }
-// //引用产品资料【放弃】
-// const yycpzlhandleCancel = () => {onyycpzllist.value = false;};
-
-
-
-
-
-
-
-
-
-
-
 // 行为控制标记(弹窗内部需要增还是改)
 const type = ref('')
 

+ 3 - 39
src/view/yunyin/shengchanguanli/shengchanpaichan.vue

@@ -13,7 +13,7 @@
 
               <div v-if="(currentNode == '计划中') && treeType === 'customTree'">
                 <el-button type="primary" title="排产" icon="edit" @click="ongxztgzClick" class="bt">排产</el-button>
-                <el-button type="primary" title="修改" icon="edit" @click="pd_yysjcsonClick" class="bt">修改</el-button>
+                <!-- <el-button type="primary" title="修改" icon="edit" @click="pd_yysjcsonClick" class="bt">修改</el-button> -->
               </div> 
 
               <div v-if="(currentNode == '制程中') && treeType === 'customTree'">
@@ -759,44 +759,7 @@ const chejianRowClick = async (row) => {
   _Gd_yjno.value = row.yjno;
 }
 const gdtableRowClick = async (row) => {
-  _Gd_gdbh.value = row.工单编号;
-  if (currentNode.value == "计划中") {
-    if(row['statusColumn'] === "*"){
-      gytableData.value = [];
-      yjtableData.value = [];
-      return false;
-    }else{
-      //计划中工单->工艺资料接口
-      const gyres = await projectCraft({Gd_gdbh: _Gd_gdbh.value});
-      //工艺资料表格
-      gytableData.value.splice(0, gytableData.value.length, ...gyres.data);
-      //计划中工单->印件资料接口
-      const yjres = await projectPrint({Gd_gdbh: _Gd_gdbh.value});
-      //印件资料表格
-      yjtableData.value.splice(0, yjtableData.value.length, ...(yjres?.data ?? []));
-    }
-  }
-
-  if (currentNode.value == "排程中") {
-    const pc_scheduleProcess = await scheduleProcess({Gd_gdbh: _Gd_gdbh.value});
-    // console.log(pc_scheduleProcess)
-    bottomData.value = pc_scheduleProcess.data;
-  }
-
-  if (currentNode.value == "制程中") {
-    const zc_scheduleProcess = await scheduleProcess({Gd_gdbh: _Gd_gdbh.value});
-    bottomData.value = zc_scheduleProcess.data;
-  }
-
-  if (currentNode.value == "已完工") {
-    //工艺资料
-    const ywg_gyres = await projectCraft({Gd_gdbh: _Gd_gdbh.value});
-    gytableData.value.splice(0, gytableData.value.length, ...ywg_gyres.data);
-
-    //印件资料
-    const ywg_yjres = await projectPrint({Gd_gdbh: _Gd_gdbh.value});
-    yjtableData.value.splice(0, yjtableData.value.length, ...ywg_yjres.data);
-  }
+  _Gd_gdbh.value = row.订单号
 };
 //点击左侧树形获取侧边栏列表数据
 // const tableData = ref([]);
@@ -1620,6 +1583,7 @@ const gdyj_clearFormData = () => {
 };
 //排产按钮
 const ongxztgzClick = () => {
+  // add_yjzlformdata.ddzbh =  _Gd_gdbh.value
   add_gdyjdialogFormVisible.value = true
   gdyj_clearFormData();
 }