zck 11 hours ago
parent
commit
536a8584b1

+ 3 - 2
src/view/fake/gongdanziliaofake.vue

@@ -1926,7 +1926,8 @@ const scfjfpxsConfirm = async () => {
       artificial_fj: item.人工废检 !== null ? item.人工废检 : "",
       machine_zp: item.机检正品板 !== null ? item.机检正品板 : "",
       machine_cp: item.机检次品板 !== null ? item.机检次品板 : "",
-      machine_fj: item.机检废检 !== null ? item.机检废检 : ""
+      machine_fj: item.机检废检 !== null ? item.机检废检 : "",
+      sys_id: userStore.userInfo.nickName
     }
   });
   const editGyWastes = await editGyWaste(formattedData);
@@ -4475,7 +4476,7 @@ const delgd_delclick = async () => {
   console.log(gySelection.value)
   if (yjSelection.value !== '') {
     try {
-      const res1 = await PrintDetailDel({UniqId: yjSelection.value})
+      const res1 = await PrintDetailDel({UniqId: yjSelection.value, sys_id: userStore.userInfo.nickName})
       res1.code === 0 && ElMessage.success('印件资料删除成功')
     } catch(err) {
       ElMessage.error(err)

+ 1 - 0
src/view/performance/12-orderAccounting/componets/gdcjstj.vue

@@ -105,6 +105,7 @@ const handlePrint1 = async() => {
       'total5': data['total']['total_waste'],
       'total6': data['total']['loss'],
       'total7': data['total']['reward'],
+      'jsgz': data['计算规则'],
       'table': data['gy_data'].map(item => ({
         'gxmc': `${item.Gy0_yjno}${item.Gy0_gxh === '' ? '' : '-' + item.Gy0_gxh}${item.Gy0_gxmc === '' ? '' : '-' + item.Gy0_gxmc}`.substring(0, 20),
         'jhcl': item['Gy0_计划接货数'],

+ 15 - 0
src/view/performance/12-orderAccounting/componets/template-gx.json

@@ -1559,6 +1559,21 @@
             "type": "text"
           }
         },
+        {
+          "options": {
+            "left": 10,
+            "top": 549,
+            "height": 11,
+            "width": 772,
+            "field": "jsgz",
+            "fontSize": 10,
+            "textAlign": "left",
+            "textContentVerticalAlign": "middle"
+          },
+          "printElementType": {
+            "type": "text"
+          }
+        },
         {
           "options": {
             "left": 30,

+ 17 - 8
src/view/yunyin/chanpinziliao/chanpinziliao.vue

@@ -1683,7 +1683,7 @@ const handleConfirm = async () => {
   } else if (status.value === '停产') {
     statusCode = 2;
   }
-  const data = await setProductStatus({ code: code, status: statusCode });
+  const data = await setProductStatus({ code: code, status: statusCode, sys_id: userStore.userInfo.nickName });
   if (data.code === 0) {
     ElMessage({
       type: 'success',
@@ -1910,7 +1910,8 @@ const gxdqcpgx = async () => {
       Gy0_yjno: item.Gy0_yjno,
       Gy0_gxh: item.Gy0_gxh,
       Gy0_Ks: item.Gy0_Ks,
-      Gy0_ls: item.Gy0_ls
+      Gy0_ls: item.Gy0_ls,
+      sys_id: userStore.userInfo.nickName
     };
   });
   const editGyNamedata = await editGyNo(formattedData);
@@ -2271,6 +2272,7 @@ const gygmhandleConfirm = async () => {
   params.code = gyformData.process;
   params.old_name = gyformData.originalName;
   params.new_name = gyformData.newName;
+  params.sys_id = userStore.userInfo.nickName;
   //确定后清空 工艺方案原名 输入框
   gyformData.originalName = ''
   //确定后清空 工艺方案新名 输入框
@@ -2336,7 +2338,8 @@ const jsssxzConfirm = async () => {
       Gy0_Ks: item.Gy0_Ks,
       Gy0_ls:item.Gy0_ls,
       Add_gxmc: item.Add_gxmc,
-      remark: item.remark
+      remark: item.remark,
+      sys_id: userStore.userInfo.nickName
     };
   });
   const editeditGyMs = await editGyMs(formattedData);
@@ -2401,7 +2404,8 @@ const fjfpxsConfirm = async () => {
       artificial_fj: parseFloat(item.artificial_fj) || item.artificial_fj === 0 ? parseFloat(item.artificial_fj).toFixed(3) : "0.000",
       machine_zp: parseFloat(item.machine_zp) || item.machine_zp === 0 ? parseFloat(item.machine_zp).toFixed(3) : "0.000",
       machine_cp: parseFloat(item.machine_cp) || item.machine_cp === 0 ? parseFloat(item.machine_cp).toFixed(3) : "0.000",
-      machine_fj: parseFloat(item.machine_fj) || item.machine_fj === 0 ? parseFloat(item.machine_fj).toFixed(3) : "0.000"
+      machine_fj: parseFloat(item.machine_fj) || item.machine_fj === 0 ? parseFloat(item.machine_fj).toFixed(3) : "0.000",
+      sys_id: userStore.userInfo.nickName
     };
   });
   const editGyWastes = await editGyWaste(formattedData);
@@ -2495,7 +2499,8 @@ const pccstzConfirm = async () => {
       shdh: item.Gy0_shdh,
       machine: item.Gy0_sbbh,
       time: item.Gy0_辅助工时,
-      Gy0_site: item.Gy0_site
+      Gy0_site: item.Gy0_site,
+      sys_id: userStore.userInfo.nickName
     };
   });
   // 调预览接口,看有多少未开工工单会被影响
@@ -2513,7 +2518,9 @@ const pccstzConfirm = async () => {
 const doEditGyAfterPreview = async () => {
   editPreviewSubmitting.value = true;
   try {
-    const editGy_edit = await editGy(pendingEditGyData.value);
+    const editGy_edit = await editGy(
+      pendingEditGyData.value.map(item => ({ ...item, sys_id: userStore.userInfo.nickName }))
+    );
     if (editGy_edit.code === 0) {
       ElMessage({ type: 'success', message: '更新成功' })
     } else {
@@ -2619,6 +2626,7 @@ const hscstzConfirm = async () => {
       loss_coe: item.loss_coe,
       ms_coe: item.ms_coe,
       shdh: item.Gy0_shdh?item.Gy0_shdh:'',
+      sys_id: userStore.userInfo.nickName,
     };
   });
   const hscstz_edit = await editGy(formattedData);
@@ -2820,7 +2828,7 @@ const delgd_delclick = async () => {
     
     if (yjSelection.value !== '') {
       deletePromises.push(
-        PrintlDel({UniqId: yjSelection.value})
+        PrintlDel({UniqId: yjSelection.value, sys_id: userStore.userInfo.nickName})
           .then(res => {
             if (res.code === 0) {
               ElMessage.success('印件资料删除成功')
@@ -3018,6 +3026,7 @@ const enterDialog = async () => {
     '计量单位': formDataTest['计量单位'],
     '成品规格': formDataTest['成品规格'],
     '产品备注': formDataTest['产品备注'],
+    'sys_id': userStore.userInfo.nickName,
   };
   const editProductedit = await editProduct(formattedData);
   if (editProductedit.code === 0) {
@@ -4416,7 +4425,7 @@ const createROLuckyExcel = (files) => {
 
 //===============工艺排序===================
 const Process_sorting = async()  => {
-  const response = await ProductYgSort({cpdh:_Gd_gdbh.value,yjno:currentGy0_yjno.value})
+  const response = await ProductYgSort({cpdh:_Gd_gdbh.value,yjno:currentGy0_yjno.value,sys_id:userStore.userInfo.nickName})
   if(response.code==0){
     ElMessage({type:'success',message: '排序成功'})	
     const res = await getProductData({product_code:_product_code.value});

+ 3 - 2
src/view/yunyin/chanpinziliao/hhbiaozhungongdan.vue

@@ -1986,7 +1986,8 @@
         artificial_fj: item.人工废检 !== null ? item.人工废检 : "",
         machine_zp: item.机检正品板 !== null ? item.机检正品板 : "",
         machine_cp: item.机检次品板 !== null ? item.机检次品板 : "",
-        machine_fj: item.机检废检 !== null ? item.机检废检 : ""
+        machine_fj: item.机检废检 !== null ? item.机检废检 : "",
+        sys_id: userStore.userInfo.nickName
       }
     });
     const editGyWastes = await editGyWaste(formattedData);
@@ -4603,7 +4604,7 @@
     ).then(async () => {
       if (yjSelection.value !== '') {
       try {
-        const res1 = await PrintDetailDel({UniqId: yjSelection.value})
+        const res1 = await PrintDetailDel({UniqId: yjSelection.value, sys_id: userStore.userInfo.nickName})
         res1.code === 0 && ElMessage.success('印件资料删除成功')
       } catch(err) {
         ElMessage.error(err)

+ 44 - 3
src/view/yunyin/shengchanguanli/chengpinrucang.vue

@@ -26,7 +26,7 @@
                 <el-button type="primary" class="bt" icon="Download" @click="exportExcel">导出到Excel</el-button>
               </div>
             </el-form-item>
-            <el-table ref="multipleTable" height=68vh style="width: 100%" tooltip-effect="dark" :data="tableData" row-key="ID" @row-click="Click"
+            <el-table ref="multipleTable" id="cprucang_table" height=68vh style="width: 100%" tooltip-effect="dark" :data="tableData" row-key="ID" @row-click="Click"
               highlight-current-row="true" border @selection-change="handleSelectionChange" :show-overflow-tooltip="true"@row-dblclick="doubleClick">
               <el-table-column type="selection" width="45" />
 			  <el-table-column align="left"   label="入仓类型" prop="入仓类型" width="90"/>
@@ -1549,9 +1549,50 @@ const GetInfo = async (value) => {
 	formData.value=response.data;
   }
 }
-// 导出excel
+// 导出excel(参考 DecisionSupport/operation.vue 实现)
 function exportExcel() {
-  console.log('导出到excel');
+  try {
+    const el = document.getElementById('cprucang_table');
+    if (!el) {
+      ElMessage.warning('未找到表格,无法导出');
+      return;
+    }
+    if (!tableData || tableData.length === 0) {
+      ElMessage.warning('当前没有可导出的数据');
+      return;
+    }
+    const filename = '成品入仓数据.xlsx';
+    const ws = XLSX.utils.table_to_sheet(el, { raw: true });
+
+    // 数字列:入仓数量、累计入仓数量、订单数量、完成率
+    const numCols = ['入仓数量', '累计入仓数量', '订单数量', '完成率'];
+    const headerRow = XLSX.utils.sheet_to_json(ws, { header: 1 })[0];
+    const range = XLSX.utils.decode_range(ws['!ref']);
+
+    for (let col = 0; col <= range.e.c; col++) {
+      const headerVal = headerRow[col];
+      const isNum = numCols.includes(headerVal);
+      for (let row = range.s.r + 1; row <= range.e.r; row++) {
+        const cellAddress = XLSX.utils.encode_cell({ r: row, c: col });
+        if (ws[cellAddress]) {
+          const cellValue = ws[cellAddress].v;
+          const numValue = Number(cellValue);
+          if (!isNaN(numValue)) {
+            ws[cellAddress].t = 'n';
+            ws[cellAddress].v = numValue;
+            ws[cellAddress].z = isNum ? '0.00' : '0';
+          }
+        }
+      }
+    }
+
+    const wb = XLSX.utils.book_new();
+    XLSX.utils.book_append_sheet(wb, ws, '成品入仓');
+    XLSX.writeFile(wb, filename);
+  } catch (error) {
+    console.error('导出失败:', error);
+    ElMessage.error('导出失败,请重试');
+  }
 }
 
 

+ 2 - 1
src/view/yunyin/shengchanguanli/gongdanziliao.vue

@@ -2009,7 +2009,8 @@ const scfjfpxsConfirm = async () => {
       artificial_fj: item.人工废检 !== null ? item.人工废检 : "",
       machine_zp: item.机检正品板 !== null ? item.机检正品板 : "",
       machine_cp: item.机检次品板 !== null ? item.机检次品板 : "",
-      machine_fj: item.机检废检 !== null ? item.机检废检 : ""
+      machine_fj: item.机检废检 !== null ? item.机检废检 : "",
+      sys_id: userStore.userInfo.nickName
     }
   });
   const editGyWastes = await editGyWaste(formattedData);