zhouwx
2025-10-13 5b5c6374749159db03a14ee645760327930bbb28
src/views/work/procurementPlatform/warehouseManagement/monthlyInspectionRecord/components/editDialog.vue
@@ -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="100">
                  <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
@@ -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;