From b231c463d1e14020fae1f5303dd93c2f49c85cdc Mon Sep 17 00:00:00 2001
From: 祖安之光 <11848914+light-of-zuan@user.noreply.gitee.com>
Date: 星期一, 24 十一月 2025 08:54:50 +0800
Subject: [PATCH] 修改新增

---
 src/views/work/procurementPlatform/warehouseManagement/monthlyInspectionRecord/components/editDialog.vue |   44 ++++++++++++++++++++++++++++----------------
 1 files changed, 28 insertions(+), 16 deletions(-)

diff --git a/src/views/work/procurementPlatform/warehouseManagement/monthlyInspectionRecord/components/editDialog.vue b/src/views/work/procurementPlatform/warehouseManagement/monthlyInspectionRecord/components/editDialog.vue
index 11d9b70..48b5fad 100644
--- a/src/views/work/procurementPlatform/warehouseManagement/monthlyInspectionRecord/components/editDialog.vue
+++ b/src/views/work/procurementPlatform/warehouseManagement/monthlyInspectionRecord/components/editDialog.vue
@@ -3,7 +3,7 @@
     <el-dialog
         v-model="dialogVisible"
         :title="title"
-        width="850px"
+        width="1200px"
         :before-close="handleClose"
         :close-on-press-escape="false"
         :close-on-click-modal="false"
@@ -11,7 +11,7 @@
       <el-form :model="state.form" size="default" ref="busRef" :rules="state.rules"  label-position="right" label-width="130">
         <el-row :gutter="24">
           <el-col :span="24">
-            <el-form-item label="企业名称:" prop="companyId" v-if="state.isAdmin">
+            <el-form-item label="单位名称:" prop="companyId" v-if="state.isAdmin">
               <el-select v-model="state.form.companyId" placeholder="请选择" filterable clearable style="width: 100%" :disabled="title == '查看' || title == '编辑' || !state.isAdmin" @change="selectValueCom">
                 <el-option
                     v-for="item in state.companyList"
@@ -42,7 +42,7 @@
               <div style="display: flex;width: 100%;">
                 <el-table :data="state.form.inspectionMesses" :border="true" >
                   <el-table-column type="index" label="序号"  align="center"></el-table-column>
-                  <el-table-column label="时间" prop="monthlyTime" align="center" width="150">
+                  <el-table-column label="时间" prop="monthlyTime" align="center" width="140">
                     <template  #default="{row,$index}">
                       <el-form-item :prop="'inspectionMesses.' + '[' + $index + ']' + 'monthlyTime'" :rules="state.rules.monthlyTime">
                         <el-date-picker
@@ -56,56 +56,56 @@
                       </el-form-item>
                     </template>
                   </el-table-column>
-                  <el-table-column label="检查人" prop="checkUser" align="center" width="150">
+                  <el-table-column label="检查人" prop="checkUser" align="center" width="100">
                     <template  #default="{row,$index}">
                       <el-form-item :prop="'inspectionMesses.' + '[' + $index + ']' + 'checkUser'" :rules="state.rules.checkUser">
                         <el-input style="margin-top: 10px" :disabled="title === '查看'" type="textarea" :rows="2" v-model="row.checkUser" placeholder="请输入"></el-input>
                       </el-form-item>
                     </template>
                   </el-table-column>
-                  <el-table-column label="防护" prop="entrench" align="center" width="150">
+                  <el-table-column label="防护" prop="entrench" align="center" width="100">
                     <template  #default="{row,$index}">
                       <el-form-item :prop="'inspectionMesses.' + '[' + $index + ']' + 'entrench'" :rules="state.rules.entrench">
                         <el-input style="margin-top: 10px" :disabled="title === '查看'" type="textarea" :rows="2" v-model="row.entrench" placeholder="请输入"></el-input>
                       </el-form-item>
                     </template>
                   </el-table-column>
-                  <el-table-column label="标识" prop="identification" align="center" width="150">
+                  <el-table-column label="标识" prop="identification" align="center" width="100">
                     <template  #default="{row,$index}">
                       <el-form-item :prop="'inspectionMesses.' + '[' + $index + ']' + 'identification'" :rules="state.rules.identification">
                         <el-input style="margin-top: 10px" :disabled="title === '查看'" type="textarea" :rows="2" v-model="row.identification" placeholder="请输入"></el-input>
                       </el-form-item>
                     </template>
                   </el-table-column>
-                  <el-table-column label="摆放" prop="place" align="center" width="150">
+                  <el-table-column label="摆放" prop="place" align="center" width="100">
                     <template  #default="{row,$index}">
                       <el-form-item :prop="'inspectionMesses.' + '[' + $index + ']' + 'place'" :rules="state.rules.place">
                         <el-input style="margin-top: 10px" :disabled="title === '查看'" type="textarea" :rows="2" v-model="row.place" placeholder="请输入"></el-input>
                       </el-form-item>
                     </template>
                   </el-table-column>
-                  <el-table-column label="清洁" prop="clean" align="center" width="150">
+                  <el-table-column label="清洁" prop="clean" align="center" width="100">
                     <template  #default="{row,$index}">
                       <el-form-item :prop="'inspectionMesses.' + '[' + $index + ']' + 'clean'" :rules="state.rules.clean">
                         <el-input style="margin-top: 10px" :disabled="title === '查看'" type="textarea" :rows="2" v-model="row.clean" placeholder="请输入"></el-input>
                       </el-form-item>
                     </template>
                   </el-table-column>
-                  <el-table-column label="安全" prop="safety" align="center" width="150">
+                  <el-table-column label="安全" prop="safety" align="center" width="100">
                     <template  #default="{row,$index}">
                       <el-form-item :prop="'inspectionMesses.' + '[' + $index + ']' + 'safety'" :rules="state.rules.safety">
                         <el-input style="margin-top: 10px" :disabled="title === '查看'" type="textarea" :rows="2" v-model="row.safety" placeholder="请输入"></el-input>
                       </el-form-item>
                     </template>
                   </el-table-column>
-                  <el-table-column label="环境" prop="environment" align="center" width="150">
+                  <el-table-column label="环境" prop="environment" align="center" width="100">
                     <template  #default="{row,$index}">
                       <el-form-item :prop="'inspectionMesses.' + '[' + $index + ']' + 'environment'" :rules="state.rules.environment">
                         <el-input style="margin-top: 10px" :disabled="title === '查看'" type="textarea" :rows="2" v-model="row.environment" placeholder="请输入"></el-input>
                       </el-form-item>
                     </template>
                   </el-table-column>
-                  <el-table-column label="帐务卡一致性" prop="consistency" align="center" width="150">
+                  <el-table-column label="帐务卡一致性" prop="consistency" align="center" width="100">
                     <template  #default="{row,$index}">
                       <el-form-item :prop="'inspectionMesses.' + '[' + $index + ']' + 'consistency'" :rules="state.rules.consistency">
                         <el-input style="margin-top: 10px" :disabled="title === '查看'" type="textarea" :rows="2" v-model="row.consistency" placeholder="请输入"></el-input>
@@ -142,7 +142,8 @@
 import {getDept, getObject, getObjectPage} from "@/api/qualityObjectives/object";
 import {addTable, editTable, getTargetById} from "@/api/qualityObjectives/table";
 import {addNeedDiscren, editNeedDiscren} from "@/api/need/need";
-import {addMonthlyRecord, editMonthlyRecord} from "@/api/monthlyInspectionRecord";
+import {addMonthlyRecord, editMonthlyRecord, getMonthlyRecordById} from "@/api/monthlyInspectionRecord";
+import {getQualityTemplateById} from "@/api/standardSys/standardSys";
 
 const dialogVisible = ref(false);
 const title = ref("");
@@ -193,11 +194,22 @@
   }
   title.value = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看' ;
   if(type === 'edit' || type === 'review') {
-    state.form = JSON.parse(JSON.stringify(value));
-    if(state.isAdmin){
-      state.form.companyId = value.companyId
-      state.form.companyName = value.companyName
+    const res = await getMonthlyRecordById({monthlyId: value.id})
+    if(res.code === 200){
+      state.form = res.data
+
+    }else{
+      ElMessage.warning(res.message)
     }
+    if(state.isAdmin){
+      state.form.companyId = res.data.companyId
+      state.form.companyName = res.data.companyName
+    }
+    // state.form = JSON.parse(JSON.stringify(value));
+    // if(state.isAdmin){
+    //   state.form.companyId = value.companyId
+    //   state.form.companyName = value.companyName
+    // }
   }
   await getPeopleList()
   dialogVisible.value = true;

--
Gitblit v1.9.2