zck пре 11 месеци
родитељ
комит
a6a16cdea4

+ 10 - 1
src/api/jixiaoguanli/jitairibaobiao.js

@@ -1170,4 +1170,13 @@ export const JpChanliangEdit = (data) => {
     method: 'post',
     data
   })
-}
+}
+
+//入仓工单数据
+export const orderLossData = (params) => {
+  return service({
+    url: '/mes_server/order_super_loss/orderLossData',
+    method: 'get',
+    params
+  })
+}

+ 61 - 2
src/view/performance/12-orderAccounting/index.vue

@@ -22,6 +22,7 @@
               <el-button type="primary" icon="edit" class="bt" @click="pd_lcdlistonClick">流程单查询</el-button>
               <el-button type="primary" icon="edit" class="bt" @click="exportExcel">导出Excel</el-button>
               <el-button type="primary" icon="edit" class="bt" @click="ygdy">超节损员工打印</el-button>
+              <el-button type="primary" icon="edit" class="bt" @click="rcgdsj">超节损结算</el-button>
             </el-form-item>
           </el-form>
 
@@ -135,6 +136,33 @@
 			   :jjcp_yjno="jjcp_yjno"
             />
 
+ <!-- 超节损结算 -->
+ <el-dialog v-model="onrcgdsj"  title="超节损结算" destroy-on-close style="height: 30%;width: 20%;">
+  <el-form-item label="选择年月" label-width="100px">
+    <el-date-picker
+			    v-model="rcgdsjrq"
+			    type="month"
+			    placeholder="选择年月"
+			    :default-value="new Date()"
+          @change="onchange_ygdy1"
+			    style="width: 200px;" 
+			  />
+  </el-form-item>
+
+        <el-form-item label="工单编号" label-width="100px">
+          <el-input v-model="gdbh" style="width: 200px;" />
+        </el-form-item>
+        <el-form-item label="印件号" label-width="100px">
+          <el-input v-model="jjcp_yjno" style="width: 200px;"/>
+        </el-form-item>
+        <template #footer>
+		    <div class="dialog-footer" style="text-align: right;">
+		      <el-button @click="rcgdsjcloseDialog">取消</el-button>
+		      <el-button type="primary" @click="rcgdsjonDialog">确定</el-button>
+		    </div>
+		  </template>
+            </el-dialog>
+
             <!-- 工单打印 -->
             <PrintPage ref="printPageRef" />
 
@@ -192,6 +220,8 @@
                       </layout>
                     </div>
             </el-dialog>
+
+            
           </div>
         </div>
       </layout-header>
@@ -342,6 +372,9 @@ import Gongdanzhijianfeipintongji from '@/view/performance/09-workOrderVerificat
 import Detail from '@/view/performance/12-orderAccounting/componets/detail.vue'
 import Hjfpfb from './componets/hjfpfb.vue'
 import PrintPage from '@/view/yunyin/shengchanguanli/components/print.vue'
+import {
+orderLossData,
+} from '@/api/jixiaoguanli/jitairibaobiao'
 import { reactive } from 'vue'
 import * as XLSX from 'xlsx'
 import FileSaver from 'file-saver'
@@ -351,6 +384,18 @@ const userStore = useUserStore()
 const sys_id =
   '[' + userStore.userInfo.userName + '/' + userStore.userInfo.nickName + ']'
 
+      // 获取当前日期
+      const today = new Date();
+    const year = today.getFullYear();
+    const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,需要补零
+    const day = String(today.getDate()).padStart(2, '0');
+    const hours = String(today.getHours()).padStart(2, '0');
+    const minutes = String(today.getMinutes()).padStart(2, '0');
+    const seconds = String(today.getSeconds()).padStart(2, '0');
+    const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+    const currentDates = `${year}-${month}-${day}`;
+
+
 // 弹窗
 const dialogGdcjstj = ref(false)
 const dialogDetail = ref(false)
@@ -900,6 +945,7 @@ const onclick_ygdy = async () => {
     const minutes = String(today.getMinutes()).padStart(2, '0');
     const seconds = String(today.getSeconds()).padStart(2, '0');
     const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+    const currentDates = `${year}-${month}-${day}`;
 
     // 初始化数据结构
     const tableDataFormatted = {
@@ -917,8 +963,21 @@ const onclick_ygdy = async () => {
     hiprintTemplate.print(tableDataFormatted);
 }
 
-
-
+//入仓工单数据按钮
+const onrcgdsj = ref(false)
+const rcgdsjrq = ref('')
+const rcgdsj = async () => {
+  console.log('点击了入仓工单数据')
+  rcgdsjrq.value = currentDates
+  onrcgdsj.value = true
+}
+const rcgdsjonDialog = async () => {
+  console.log(rcgdsjrq.value,gdbh.value,yjno.value)
+  const res = await orderLossData({ mouth:rcgdsjrq.value,gdbh:gdbh.value,yjno:jjcp_yjno.value})
+  if(res.code === 0){
+    ElMessage({type:'success',message:'查询成功'})
+  }
+}
 
 
 

+ 40 - 7
src/view/performance/chejianbaogong.vue

@@ -2465,7 +2465,7 @@ import {
 
 // 全量引入格式化工具 请按需保留
 import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDownloadFile } from '@/utils/format'
-import { ElMessage, ElMessageBox } from 'element-plus'
+import { ElMessage, ElMessageBox,ElNotification  } from 'element-plus'
 import { ref, reactive,watch,nextTick } from 'vue'
 import Shebeizhuangtai from '@/view/performance/09-workOrderVerification/componets/shebeizhuangtai.vue'
 import { useUserStore } from '@/pinia/modules/user'
@@ -4304,14 +4304,29 @@ const SubmitDailyProduction = async () => {
 	ma_end: formData3.value.码结束行,
   }
   console.log(restoredData)
-  //4.2日产量上报 添加
+
+//   4.2日产量上报 添加
   const response = await submitDailyProduction(restoredData);
   console.log(response)
   if (response.code === 0) {
     FacilityDetail()
     isSubmitting.value = true
     chanliangVisible.value = false
-    ElMessage({type: 'success',message: '成功'})
+	ElMessage({
+  type: '',
+  dangerouslyUseHTMLString: true,
+//   duration: 0,  // 不自动关闭
+  message: '<strong style="font-size: 71px; color: black; background-color: #80FA80; padding: 30px 280px; width: 482px; line-height: 60px; text-align: center; display: block;">报工成功</strong>',
+  customClass: 'custom-warning-message'
+});
+  }else{
+    ElMessage({
+  type: '',
+  dangerouslyUseHTMLString: true,
+//   duration: 0,  // 不自动关闭
+  message: '<strong style="font-size: 71px; color: white; background-color: red; padding: 30px 280px; width: 482px; line-height: 60px; text-align: center; display: block;">报工失败</strong>',
+  customClass: 'custom-warning-message'
+});	
   }
 }
 
@@ -6355,11 +6370,29 @@ const sbzyqdsatusCellClass = ({row, column, rowIndex, columnIndex}) =>{
 		/* 假设你知道弹窗内部文本的类名或标签名,这里只是一个示例 */
 /* 自定义 ElMessage 样式 */
 :deep(.custom-message .el-message__content) {
-  font-size: 18px; /* 设置文字大小 */
-  font-weight: bold; /* 文字加粗 */
+  font-size: 36px !important; /* 设置文字大小 */
+  font-weight: bold !important; /* 文字加粗 */
+  color: #ff0000 !important; /* 红色文字示例 */
 }
 
-:deep(.custom-message) {
-  width: 400px; /* 设置消息框的宽度 */
+:deep(.my-custom-messagebox) {
+  background-color: #ff0000 !important; /* 背景色 */
+  
+  /* 标题样式 */
+  .el-message-box__title {
+    color: #1e90ff !important;
+    font-size: 20px !important;
+  }
+  
+  /* 内容样式 */
+  .el-message-box__content {
+    color: #df1e1e !important;
+    font-size: 16px !important;
+  }
+  
+  /* 按钮样式 */
+  .el-message-box__btns .el-button {
+    font-size: 14px !important;
+  }
 }
 </style>

+ 156 - 60
src/view/yunyin/shengchanguanli/gongdanshengchan.vue

@@ -899,58 +899,129 @@ const _MachineWorkOrderList = async () => {
     chejianData.value = MachineWorkOrderList_search.data['排程'];
   }
 };
-//加入排产按钮
+// //加入排产按钮
+// const onjrpcClick = async () => {
+//   searchInfo.value = '';
+//   if(_PC_gdbh.value == null || _PC_gdbh.value == ''){
+//     ElMessage({type: 'warning',message: '请勾选排程中工单'})
+//   }else{
+//     if (_PC_xscn.value === '' || _PC_xscn.value === null || _PC_xscn.value === '0') {
+//       ElMessage({type: 'warning',message: '选择中小时产量为 0'})
+//       return false;
+//     }else{
+//       let params = {}
+//       params.workOrder = _PC_gdbh.value;
+//       params.machine = _machine.value;
+//       params.printCode = _PC_yjno.value;
+//       params.processCode =  _PC_gxh.value;
+// 	  console.log(params)
+//       const ProductionSchedulingAdd_add = await ProductionSchedulingAdd(params);
+//       if (ProductionSchedulingAdd_add.code === 0) {
+//         const  pc_zc_table = await MachineWorkOrderList({machine:_machine.value});
+//         chejianData.value = pc_zc_table.data['排程'];
+//         chejianfuData.value = pc_zc_table.data['制程'];
+//         ElMessage({type: 'success',message: '加入排产 更新成功'});
+//       } else {
+//         ElMessage({ type: 'error',message: '更新失败'})
+//       }
+//     }
+
+//   }
+// };
+// 加入排产按钮 - 优化为正确格式
 const onjrpcClick = async () => {
   searchInfo.value = '';
-  if(_PC_gdbh.value == null || _PC_gdbh.value == ''){
-    ElMessage({type: 'warning',message: '请勾选排程中工单'})
-  }else{
-    if (_PC_xscn.value === '' || _PC_xscn.value === null || _PC_xscn.value === '0') {
-      ElMessage({type: 'warning',message: '选择中小时产量为 0'})
-      return false;
-    }else{
-      let params = {}
-      params.workOrder = _PC_gdbh.value;
-      params.machine = _machine.value;
-      params.printCode = _PC_yjno.value;
-      params.processCode =  _PC_gxh.value;
-	  console.log(params)
-      const ProductionSchedulingAdd_add = await ProductionSchedulingAdd(params);
-      if (ProductionSchedulingAdd_add.code === 0) {
-        const  pc_zc_table = await MachineWorkOrderList({machine:_machine.value});
-        chejianData.value = pc_zc_table.data['排程'];
-        chejianfuData.value = pc_zc_table.data['制程'];
-        ElMessage({type: 'success',message: '加入排产 更新成功'});
-      } else {
-        ElMessage({ type: 'error',message: '更新失败'})
-      }
-    }
+  if (!_PC_gdbh.value || _PC_gdbh.value.length === 0) {
+    ElMessage({type: 'warning', message: '请勾选排程中工单'});
+    return;
+  }
+  
+  if (_PC_xscn.value.some(xscn => !xscn || xscn === '0')) {
+    ElMessage({type: 'warning', message: '选择中小时产量为 0'});
+    return;
+  }
 
+  try {
+    // 构建符合接口要求的工单数组
+    const requestData = jitaiArr.value.map(item => ({
+      workOrder: item['工单编号'],
+      machine: _machine.value,
+      printCode: item['yjno'],
+      processCode: item['gxh'],
+      // 如果接口需要小时产能,添加下面这行
+      // hourlyCapacity: item['小时产能'] // 根据接口实际需求决定是否保留
+    }));
+
+    // 直接发送数组,不需要包装成 { workOrders: [...] } 形式
+    const result = await ProductionSchedulingAdd(requestData);
+    
+    if (result.code === 0) {
+      const pc_zc_table = await MachineWorkOrderList({machine: _machine.value});
+      chejianData.value = pc_zc_table.data['排程'];
+      chejianfuData.value = pc_zc_table.data['制程'];
+      ElMessage({type: 'success', message: '加入排产 更新成功'});
+    } else {
+      ElMessage({type: 'error', message: '工单更新失败: ' + (result.message || '未知错误')});
+    }
+  } catch (error) {
+    ElMessage({type: 'error', message: '更新失败: ' + error.message});
   }
-};
-//暂停排产按钮
+}
+// //暂停排产按钮
+// const onztwgClick = async () => {
+//   searchInfo.value = '';
+//   if(_ZC_gdbh.value == null || _ZC_gdbh.value == ''){
+//     ElMessage({type: 'warning', message: '请勾选制程中工单'})
+//   }else{
+//     let params = {}
+//     params.workOrder = _ZC_gdbh.value;
+//     params.machine = _machine.value;
+//     params.printCode = _ZC_yjno.value;
+//     params.processCode =  _ZC_gxh.value;
+// 	console.log(params)
+//     const ProductionSchedulingAdd_stop = await ProductionSchedulingPause(params);
+//     if (ProductionSchedulingAdd_stop.code === 0) {
+//       const pc_zc_table = await MachineWorkOrderList({machine:_machine.value});
+//       chejianData.value = pc_zc_table.data['排程'];
+//       chejianfuData.value = pc_zc_table.data['制程'];
+//       ElMessage({type: 'success',message: '暂停排产 更新成功'});
+//     } else {
+//       ElMessage({ type: 'error',message: '更新失败'})
+//     }
+//   }
+// };
+// 暂停排产按钮 - 优化为正确格式
 const onztwgClick = async () => {
   searchInfo.value = '';
-  if(_ZC_gdbh.value == null || _ZC_gdbh.value == ''){
-    ElMessage({type: 'warning', message: '请勾选制程中工单'})
-  }else{
-    let params = {}
-    params.workOrder = _ZC_gdbh.value;
-    params.machine = _machine.value;
-    params.printCode = _ZC_yjno.value;
-    params.processCode =  _ZC_gxh.value;
-	console.log(params)
-    const ProductionSchedulingAdd_stop = await ProductionSchedulingPause(params);
-    if (ProductionSchedulingAdd_stop.code === 0) {
-      const pc_zc_table = await MachineWorkOrderList({machine:_machine.value});
+  if (!_ZC_gdbh.value || _ZC_gdbh.value.length === 0) {
+    ElMessage({type: 'warning', message: '请勾选制程中工单'});
+    return;
+  }
+
+  try {
+    // 构建符合接口要求的工单数组
+    const requestData = _ZC_gdbh.value.map((gdbh, index) => ({
+      workOrder: gdbh,
+      machine: _machine.value,
+      printCode: _ZC_yjno.value[index],
+      processCode: _ZC_gxh.value[index]
+    }));
+
+    // 直接发送数组
+    const result = await ProductionSchedulingPause(requestData);
+    
+    if (result.code === 0) {
+      const pc_zc_table = await MachineWorkOrderList({machine: _machine.value});
       chejianData.value = pc_zc_table.data['排程'];
       chejianfuData.value = pc_zc_table.data['制程'];
-      ElMessage({type: 'success',message: '暂停排产 更新成功'});
+      ElMessage({type: 'success', message: '暂停排产 更新成功'});
     } else {
-      ElMessage({ type: 'error',message: '更新失败'})
+      ElMessage({type: 'error', message: '工单更新失败: ' + (result.message || '未知错误')});
     }
+  } catch (error) {
+    ElMessage({type: 'error', message: '更新失败: ' + error.message});
   }
-};
+}
 //工序完工按钮
 const ongxwgClick = async () => {
   searchInfo.value = '';
@@ -972,37 +1043,61 @@ 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 _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
+  _PC_gxh.value = arr.map(val => val['gxh'])
+  _PC_yjno.value = arr.map(val => val['yjno'])
+  _PC_gdbh.value = arr.map(val => val['工单编号'])
+  _PC_xscn.value = arr.map(val => val['小时产能'])
 }
-//加入制程【下面到上面】
+// //加入制程【下面到上面】
+// 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 _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;
+  _ZC_gxh.value = arr.map(val => val['gxh'])
+  _ZC_yjno.value = arr.map(val => val['yjno'])
+  _ZC_gdbh.value = arr.map(val => val['工单编号'])
+  _ZC_xscn.value = arr.map(val => val['小时产能'])
 }
 
 //=========工序产量核查===========
@@ -1282,8 +1377,9 @@ const saveJizuTiaozheng = async () => {
     ElMessage.warning('请先勾选机组')
     return
   }
-  const uid = jitaiArr.value.map(item => item.GYUID).join(' ')
+  const uid = jitaiArr.value.map(item => item.GYUID).join(',')
   const jizu = jizuSelection.value.map(item=>item.value).join(' ')
+  console.log(uid,jizu)
   try {
     const res = await MachineTeamEdit({UniqId: uid, machine: jizu})
     if (res.code == 0) ElMessage.success('调整成功')