Browse Source

运营管理

liuhairui 1 year ago
parent
commit
b52643cff2
1 changed files with 9 additions and 12 deletions
  1. 9 12
      src/view/yunyin/chanpinziliao/chanpinziliao.vue

+ 9 - 12
src/view/yunyin/chanpinziliao/chanpinziliao.vue

@@ -287,7 +287,7 @@
           <!--质检废品系数-->
           <el-dialog v-model="fjfpxslist" title="质检废品系数" style="width: 100%;height: 100%;margin: 0;">
             <el-button type="" @click="fjfpxsCancel">取消</el-button>
-            <el-button type="primary" disabled @click="fjfpxsConfirm">确认</el-button>
+            <el-button type="primary"  @click="fjfpxsConfirm">确认</el-button>
             <div style="width: 100%; height: 60px; padding: 0px; margin: 0px 0px 6px 0px; display: flex; align-items: center;">
               <el-form-item label="关键字 :" prop="currentProcess" style="margin-right: 20px; padding: 0px">
                 <el-input v-model="fjfpxsformData['cpdh']"
@@ -1623,27 +1623,24 @@ const _fjfpxsgetProductGy = async ()=>{
 //质检废品系数更新按钮
 const fjfpxsConfirm = async () => {
   const rawValueArray = fjfpxstableData._rawValue;
-  // console.log(rawValueArray)
   const formattedData = rawValueArray.map(item => {
     return {
       UniqID: item.UniqID,
-      artificial_zp: (item.artificial_zp == null) ? 0 : parseFloat(item.artificial_zp),
-      artificial_cp: (item.artificial_cp == null) ? 0 : parseFloat(item.artificial_cp),
-      artificial_fj: (item.artificial_fj == null) ? 0 : parseFloat(item.artificial_fj),
-      machine_zp: (item.machine_zp == null) ? 0 : parseFloat(item.machine_zp),
-      machine_cp: (item.machine_cp == null) ? 0 : parseFloat(item.machine_cp),
-      machine_fj: (item.machine_fj == null) ? 0 : parseFloat(item.machine_fj)
-    }
+      artificial_zp: parseFloat(item.artificial_zp) || item.artificial_zp === 0 ? parseFloat(item.artificial_zp).toFixed(3) : "0.000",
+      artificial_cp: parseFloat(item.artificial_cp) || item.artificial_cp === 0 ? parseFloat(item.artificial_cp).toFixed(3) : "0.000",
+      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"
+    };
   });
-  console.log(formattedData)
-  // console.log(12312312312321321321321312312)
   const editGyWastes = await editGyWaste(formattedData);
   if (editGyWastes.code === 0) {
     ElMessage({type: 'success',message: '更新成功'})
   } else {
     ElMessage({type: 'error',message: '更新失败'})
   }
-  // fjfpxslist.value = false;
+  fjfpxslist.value = false;
 };
 //质检废品系数放弃按钮
 const fjfpxsCancel = () => {fjfpxslist.value = false;};