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

---
 src/views/build/conpanyFunctionConsult/riskManage/control/components/editDialog.vue                        |    1 
 src/views/work/selfProblems/internalAudit/problemMng/noConformanceMng/components/editDialog.vue            |    1 
 src/views/build/conpanyFunctionConsult/digitalFileDep/manageType/qualityOrganize/components/editDialog.vue |    1 
 src/api/infrastructureMng/ledger.js                                                                        |    8 +
 src/views/build/conpanyFunctionConsult/environment/environmentalFactors/components/editDialog.vue          |    1 
 src/views/work/selfProblems/mngAudit/mngAuditMeeting/components/editDialog.vue                             |    1 
 src/views/work/selfProblems/plan/components/planDialog.vue                                                 |    1 
 src/views/work/selfProblems/scenario/components/scenarioDialog.vue                                         |    1 
 src/views/work/assetMng/toolsMonitorMeasure/equipCalibrateConfirm/components/editDialog.vue                |   53 +++++++-
 src/views/work/selfProblems/mngAudit/mngAuditReport/components/editDialog.vue                              |    1 
 public/standingBooks.xls                                                                                   |    0 
 src/views/build/conpanyFunctionConsult/need/needIdentify/components/editDialog.vue                         |    1 
 src/views/work/financialMng/qualityFinancialAnalysis/components/editDialog.vue                             |    1 
 src/views/work/assetMng/toolsMonitorMeasure/annualVerificationPlan/index.vue                               |    4 
 src/views/work/selfProblems/mngAudit/mngAuditPlan/components/editDialog.vue                                |    1 
 src/views/work/qualityManage/continuousImprovement/components/editDialog.vue                               |    1 
 src/views/work/assetMng/workEnvironmentControl/6sInspectChecklist/components/editDialog.vue                |    1 
 src/views/work/qualityInfo/infrastructureMng/ledger/index.vue                                              |  159 ++++++++++++++++++++++++--
 src/views/work/assetMng/toolsMonitorMeasure/annualVerificationPlan/components/editDialog.vue               |    7 
 src/views/work/qualityInfo/supplierQuality/satisfied/components/editDialog.vue                             |    1 
 src/views/work/selfProblems/internalAudit/meetingMng/components/editDialog.vue                             |    1 
 src/views/build/conpanyFunctionConsult/qualityObjectives/objective/components/objectiveDialog.vue          |    1 
 src/views/work/qualityInfo/infrastructureMng/ledger/components/editDialog.vue                              |   17 ++
 src/views/work/qualityInfo/infrastructureMng/maintainPlan/components/editDialog.vue                        |    1 
 src/views/work/qualityInfo/infrastructureMng/reviewRecordStatistics/components/editDialog.vue              |   72 ++++++++---
 src/views/work/selfProblems/mngAudit/mngAuditInput/components/editDialog.vue                               |    1 
 26 files changed, 290 insertions(+), 48 deletions(-)

diff --git a/public/standingBooks.xls b/public/standingBooks.xls
new file mode 100644
index 0000000..37bc5e4
--- /dev/null
+++ b/public/standingBooks.xls
Binary files differ
diff --git a/src/api/infrastructureMng/ledger.js b/src/api/infrastructureMng/ledger.js
index 45a1b11..56ed2a9 100644
--- a/src/api/infrastructureMng/ledger.js
+++ b/src/api/infrastructureMng/ledger.js
@@ -32,6 +32,14 @@
   })
 }
 
+export function uploadStandingBook(data) {
+  return request({
+    url: '/system/standingBook/importStandingBooks',
+    method: 'post',
+    data: data
+  })
+}
+
 export function getMaintenanceRecordList(query) {
   return request({
     url: '/system/annualMaintenanceRecord/selectAnnualMaintenanceRecordList',
diff --git a/src/views/build/conpanyFunctionConsult/digitalFileDep/manageType/qualityOrganize/components/editDialog.vue b/src/views/build/conpanyFunctionConsult/digitalFileDep/manageType/qualityOrganize/components/editDialog.vue
index 7d033b8..1e21cd9 100644
--- a/src/views/build/conpanyFunctionConsult/digitalFileDep/manageType/qualityOrganize/components/editDialog.vue
+++ b/src/views/build/conpanyFunctionConsult/digitalFileDep/manageType/qualityOrganize/components/editDialog.vue
@@ -241,6 +241,7 @@
   state.isAdmin = userInfo.userType === 0;
   state.form.companyName = userInfo.companyName
   state.form.companyId = userInfo.companyId
+  state.form.year = new Date().getFullYear().toString()
   if(state.isAdmin){
     state.form.companyId = value.companyId
     state.form.companyName = value.companyName
diff --git a/src/views/build/conpanyFunctionConsult/environment/environmentalFactors/components/editDialog.vue b/src/views/build/conpanyFunctionConsult/environment/environmentalFactors/components/editDialog.vue
index 9c386a4..8cfe452 100644
--- a/src/views/build/conpanyFunctionConsult/environment/environmentalFactors/components/editDialog.vue
+++ b/src/views/build/conpanyFunctionConsult/environment/environmentalFactors/components/editDialog.vue
@@ -365,6 +365,7 @@
     state.form.companyName = value.companyName
     state.companyList = companyList
   }
+  state.form.year = new Date().getFullYear().toString()
   title.value = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看' ;
   if(type === 'edit' || type === 'review') {
     state.form = JSON.parse(JSON.stringify(value));
diff --git a/src/views/build/conpanyFunctionConsult/need/needIdentify/components/editDialog.vue b/src/views/build/conpanyFunctionConsult/need/needIdentify/components/editDialog.vue
index 3ef6053..bf58a32 100644
--- a/src/views/build/conpanyFunctionConsult/need/needIdentify/components/editDialog.vue
+++ b/src/views/build/conpanyFunctionConsult/need/needIdentify/components/editDialog.vue
@@ -267,6 +267,7 @@
     state.form.companyName = value.companyName
     state.companyList = companyList
   }
+  state.form.year = new Date().getFullYear().toString()
   title.value = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看' ;
   if(type === 'edit' || type === 'review') {
     state.form = JSON.parse(JSON.stringify(value));
diff --git a/src/views/build/conpanyFunctionConsult/qualityObjectives/objective/components/objectiveDialog.vue b/src/views/build/conpanyFunctionConsult/qualityObjectives/objective/components/objectiveDialog.vue
index 186bb25..fe0eedc 100644
--- a/src/views/build/conpanyFunctionConsult/qualityObjectives/objective/components/objectiveDialog.vue
+++ b/src/views/build/conpanyFunctionConsult/qualityObjectives/objective/components/objectiveDialog.vue
@@ -306,6 +306,7 @@
     state.companyList = companyList
     state.form.companyId = null
   }
+  state.form.year = new Date().getFullYear().toString()
   title.value = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看' ;
   if(type === 'edit' || type === 'review') {
     state.form = JSON.parse(JSON.stringify(value));
diff --git a/src/views/build/conpanyFunctionConsult/riskManage/control/components/editDialog.vue b/src/views/build/conpanyFunctionConsult/riskManage/control/components/editDialog.vue
index c78150e..89b0a24 100644
--- a/src/views/build/conpanyFunctionConsult/riskManage/control/components/editDialog.vue
+++ b/src/views/build/conpanyFunctionConsult/riskManage/control/components/editDialog.vue
@@ -316,6 +316,7 @@
     state.form.companyName = value.companyName
     state.companyList = companyList
   }
+  state.form.year = new Date().getFullYear().toString()
   title.value = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看' ;
   if(type === 'edit' || type === 'review') {
     state.form = JSON.parse(JSON.stringify(value));
diff --git a/src/views/work/assetMng/toolsMonitorMeasure/annualVerificationPlan/components/editDialog.vue b/src/views/work/assetMng/toolsMonitorMeasure/annualVerificationPlan/components/editDialog.vue
index fc7d3f5..b58c365 100644
--- a/src/views/work/assetMng/toolsMonitorMeasure/annualVerificationPlan/components/editDialog.vue
+++ b/src/views/work/assetMng/toolsMonitorMeasure/annualVerificationPlan/components/editDialog.vue
@@ -150,7 +150,7 @@
               </el-input>
             </template>
           </el-table-column>
-          <el-table-column label="使用人" prop="useUser" align="center">
+          <el-table-column label="使用单位" prop="useUser" align="center">
             <template #default="scope">
               <el-input
                   v-model.trim="scope.row.useUser"
@@ -163,7 +163,7 @@
               </el-input>
             </template>
           </el-table-column>
-          <el-table-column label="证书名称" prop="certificateName" align="center">
+          <el-table-column label="证书编号" prop="certificateName" align="center">
             <template #default="scope">
               <el-input
                   v-model.trim="scope.row.certificateName"
@@ -190,7 +190,7 @@
             </template>
           </el-table-column>
         </el-table>
-<!--        <el-form-item label="证书名称:" prop="certificateName" v-if="state.title == '上传'">-->
+<!--        <el-form-item label="证书编号:" prop="certificateName" v-if="state.title == '上传'">-->
 <!--          <el-input-->
 <!--              v-model.trim="state.form.certificateName"-->
 <!--              style="width: 100%;"-->
@@ -352,6 +352,7 @@
   await getUserList(companyId)
   state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : type ==='upload' ? '上传' : '查看'
   state.form.companyId = companyId
+  state.form.year = new Date().getFullYear().toString()
   if(state.title == '编辑'||state.title == '查看' ||state.title == '上传'){
     await getInfo(value.id)
   }
diff --git a/src/views/work/assetMng/toolsMonitorMeasure/annualVerificationPlan/index.vue b/src/views/work/assetMng/toolsMonitorMeasure/annualVerificationPlan/index.vue
index ef9ae3b..adae4a6 100644
--- a/src/views/work/assetMng/toolsMonitorMeasure/annualVerificationPlan/index.vue
+++ b/src/views/work/assetMng/toolsMonitorMeasure/annualVerificationPlan/index.vue
@@ -85,8 +85,8 @@
           </el-table-column>
           <el-table-column label="校准人" prop="calibrationUser" align="center"/>
           <el-table-column label="目前状态" prop="status" align="center"/>
-          <el-table-column label="使用人" prop="useUser" align="center"/>
-          <el-table-column label="证书名称" prop="certificateName" align="center"/>
+          <el-table-column label="使用单位" prop="useUser" align="center"/>
+          <el-table-column label="证书编号" prop="certificateName" align="center"/>
           <el-table-column label="证书" prop="certificate" align="center">
             <template #default="scope">
               <div v-if="scope.row.certificate && scope.row.certificate!==''" style="cursor:pointer;">
diff --git a/src/views/work/assetMng/toolsMonitorMeasure/equipCalibrateConfirm/components/editDialog.vue b/src/views/work/assetMng/toolsMonitorMeasure/equipCalibrateConfirm/components/editDialog.vue
index 6c0a6bf..9de59d0 100644
--- a/src/views/work/assetMng/toolsMonitorMeasure/equipCalibrateConfirm/components/editDialog.vue
+++ b/src/views/work/assetMng/toolsMonitorMeasure/equipCalibrateConfirm/components/editDialog.vue
@@ -22,7 +22,15 @@
         <el-row>
           <el-col :span="12">
             <el-form-item label="设备名称:" prop="deviceName">
-              <el-input v-model.trim="state.form.deviceName" :readonly="state.title =='查看'"></el-input>
+<!--              <el-input v-model.trim="state.form.deviceName" :readonly="state.title =='查看'"></el-input>-->
+              <el-select clearable v-model="state.form.deviceName" :disabled="state.title =='查看'" filterable placeholder="设备名称" style="width: 100%" @change="getDeviceInfo()">
+                <el-option
+                    v-for="item in state.deviceList"
+                    :key="item.id"
+                    :label="item.deviceName"
+                    :value="item.deviceName"
+                />
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -50,7 +58,7 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <el-form-item label="校准单位:" prop="calibrationCompany">
+        <el-form-item label="校准人:" prop="calibrationCompany">
           <el-input v-model.trim="state.form.calibrationCompany" :readonly="state.title =='查看'"></el-input>
         </el-form-item>
         <el-form-item label="校准结果确认:" prop="calibrationResult">
@@ -130,8 +138,12 @@
 } from "@/api/innerReview/meetingReview";
 import {getDepart} from "@/api/orgStructure/depart";
 import {listUser} from "@/api/system/user";
-import {getMaintenanceRecordDetail, updateMaintenanceRecord} from "@/api/infrastructureMng/ledger";
-import {saveCalibrationMonitoringEquipment} from "@/api/assetManage/assetMng";
+import {getMaintenanceRecordDetail, getStandingBookList, updateMaintenanceRecord} from "@/api/infrastructureMng/ledger";
+import {
+  getAnnualVerificationPlanDetail,
+  getAnnualVerificationPlanList,
+  saveCalibrationMonitoringEquipment
+} from "@/api/assetManage/assetMng";
 
 const emit = defineEmits(["getList"]);
 const dialogVisible = ref(false)
@@ -159,7 +171,7 @@
     deviceNumber: [{ required: true, message: '请填写设备编号',  trigger: 'blur' }],
     calibrationTime: [{ required: true, message: '请选择校准日期',  trigger: 'blur' }],
     calibrationNumber: [{ required: true, message: '请填写校准证书编号',  trigger: 'blur' }],
-    calibrationCompany: [{ required: true, message: '请填写校准单位',  trigger: 'blur' }],
+    calibrationCompany: [{ required: true, message: '请填写校准人',  trigger: 'blur' }],
     calibrationResult: [{ required: true, message: '请选择校准结果',  trigger: 'blur' }],
     confirmUser: [{ required: true, message: '请填写确认人',  trigger: 'blur' }],
     confirmTime: [{ required: true, message: '请选择日期',  trigger: 'blur' }],
@@ -168,7 +180,8 @@
   },
   isAdmin: false,
   companyList: [],
-  userList: []
+  userList: [],
+  deviceList: []
 })
 onMounted(() => {
 
@@ -180,6 +193,7 @@
     state.companyList = companyList
   }
   await getUserList(companyId)
+  await getDeviceList(companyId)
   state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看'
   state.form.companyId = companyId
   if(state.title == '编辑'||state.title == '查看'){
@@ -192,6 +206,33 @@
   dialogVisible.value = true
 }
 
+const getDeviceList = async (companyId) => {
+  const res = await getAnnualVerificationPlanList({pageNum: 1, pageSize: 9999, companyId})
+  if(res.code == 200){
+    if(Array.isArray(res.data.list) && res.data.list.length>0){
+      const re = await getAnnualVerificationPlanDetail({id: res.data.list[0].id})
+      if(re.code == 200){
+        if(re.data && Array.isArray(re.data.annualVerificationDevices)){
+          state.deviceList = re.data.annualVerificationDevices
+        }
+      }
+    }
+  }else{
+    ElMessage.warning(res.message)
+  }
+}
+
+const getDeviceInfo = ()=>{
+  const foundNode = state.deviceList.find(i=>i.deviceName == state.form.deviceName)
+  state.form = {
+    ...state.form,
+    deviceName: foundNode.deviceName,
+    deviceNumber: foundNode.deviceNumber,
+    calibrationTime: foundNode.nextCalibrationTime.substring(0,10),
+    calibrationNumber: foundNode.certificateName,
+    calibrationCompany: foundNode.calibrationUser
+  }
+}
 
 const onSubmit = async () => {
   const valid = await superRef.value.validate()
diff --git a/src/views/work/assetMng/workEnvironmentControl/6sInspectChecklist/components/editDialog.vue b/src/views/work/assetMng/workEnvironmentControl/6sInspectChecklist/components/editDialog.vue
index dba91d0..8c21888 100644
--- a/src/views/work/assetMng/workEnvironmentControl/6sInspectChecklist/components/editDialog.vue
+++ b/src/views/work/assetMng/workEnvironmentControl/6sInspectChecklist/components/editDialog.vue
@@ -348,6 +348,7 @@
   await getUserList(companyId)
   state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看'
   state.form.companyId = companyId
+  state.form.year = new Date().getFullYear().toString()
   if(state.title == '编辑'||state.title == '查看'){
     await getInfo(value.id)
   }
diff --git a/src/views/work/financialMng/qualityFinancialAnalysis/components/editDialog.vue b/src/views/work/financialMng/qualityFinancialAnalysis/components/editDialog.vue
index 7f57be3..3afce15 100644
--- a/src/views/work/financialMng/qualityFinancialAnalysis/components/editDialog.vue
+++ b/src/views/work/financialMng/qualityFinancialAnalysis/components/editDialog.vue
@@ -212,6 +212,7 @@
   state.isAdmin = userInfo.userType === 0;
   state.form.companyName = userInfo.companyName
   state.form.companyId = userInfo.companyId
+  state.form.year = new Date().getFullYear().toString()
   if(state.isAdmin){
     state.companyList = companyList
     state.form.companyId = null
diff --git a/src/views/work/qualityInfo/infrastructureMng/ledger/components/editDialog.vue b/src/views/work/qualityInfo/infrastructureMng/ledger/components/editDialog.vue
index 720804b..aafe6bd 100644
--- a/src/views/work/qualityInfo/infrastructureMng/ledger/components/editDialog.vue
+++ b/src/views/work/qualityInfo/infrastructureMng/ledger/components/editDialog.vue
@@ -19,7 +19,10 @@
             </el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="名称型号:" prop="model">
+        <el-form-item label="名称:" prop="name">
+          <el-input v-model.trim="state.form.name"></el-input>
+        </el-form-item>
+        <el-form-item label="型号:" prop="model">
           <el-input v-model.trim="state.form.model"></el-input>
         </el-form-item>
         <el-form-item label="部门:" prop="deptId">
@@ -51,8 +54,10 @@
         </el-form-item>
         <el-form-item label="设备类型:" prop="deviceType">
           <el-select v-model="state.form.deviceType" :disabled="state.title =='查看'" placeholder="请选择" clearable>
-            <el-option key="1" label="生产设备" :value="1"></el-option>
+            <el-option key="1" label="计算机设备" :value="1"></el-option>
             <el-option key="2" label="办公自动化设备" :value="2"></el-option>
+            <el-option key="3" label="外部设备" :value="3"></el-option>
+            <el-option key="4" label="其他" :value="4"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="编号:" prop="number">
@@ -67,7 +72,8 @@
         <el-form-item label="状态:" prop="status">
           <el-select v-model="state.form.status" :disabled="state.title =='查看'" placeholder="请选择" clearable>
             <el-option key="1" label="完好" :value="1"></el-option>
-            <el-option key="2" label="损坏" :value="2"></el-option>
+            <el-option key="2" label="需整改" :value="2"></el-option>
+            <el-option key="3" label="报废" :value="3"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="用途:" prop="purpose">
@@ -113,6 +119,7 @@
   title: '',
   form: {
     id: null,
+    name: '',
     model: '',
     deptId: null,
     personResponsible: null,
@@ -130,7 +137,8 @@
   formRules:{
     companyId: [{ required: true, message: '请选择企业', trigger: 'blur' }],
     deptId: [{ required: true, message: '请选择受部门', trigger: 'blur' }],
-    model: [{ required: true, message: '请填写名称型号', trigger: 'blur' }],
+    name: [{ required: true, message: '请填写名称', trigger: 'blur' }],
+    model: [{ required: true, message: '请填写型号', trigger: 'blur' }],
     personResponsible: [{ required: true, message: '请选择责任人/使用人',  trigger: 'blur' }],
     deviceType: [{ required: true, message: '请选择设备类型',  trigger: 'blur' }],
     number: [{ required: true, message: '请填写编号',  trigger: 'blur' }]
@@ -223,6 +231,7 @@
 const handleClose = () => {
   state.form = {
     id: null,
+    name: '',
     model: '',
     deptId: null,
     personResponsible: null,
diff --git a/src/views/work/qualityInfo/infrastructureMng/ledger/index.vue b/src/views/work/qualityInfo/infrastructureMng/ledger/index.vue
index d954ebd..f9d31aa 100644
--- a/src/views/work/qualityInfo/infrastructureMng/ledger/index.vue
+++ b/src/views/work/qualityInfo/infrastructureMng/ledger/index.vue
@@ -20,9 +20,10 @@
             </el-option>
           </el-select>
         </el-form-item>
-        <el-form-item >
+        <el-form-item>
           <el-button v-if="isAdmin" type="primary" @click="getList">查询</el-button>
           <el-button v-if="isAdmin" type="primary" plain @click="reset">重置</el-button>
+          <el-button type="primary" @click="exportInData">导入</el-button>
           <vue3-json-excel
               :json-data="expertData"
               :fields="fields"
@@ -37,17 +38,18 @@
     <!-- 表格数据 -->
     <el-table v-loading="loading" :data="dataList" :border="true">
       <el-table-column type="index" label="序号"></el-table-column>
-      <el-table-column prop="model" align="center" label="名称型号"></el-table-column>
+      <el-table-column prop="name" align="center" label="名称"></el-table-column>
+      <el-table-column prop="model" align="center" label="型号"></el-table-column>
+      <el-table-column label="类型"  align="center" prop="deviceType">
+        <template #default="scope">
+          {{ scope.row.deviceType == 1? '计算机设备' : scope.row.deviceType == 2? '办公自动化设备' : scope.row.deviceType == 3 ? '外部设备' : '其他'}}
+        </template>
+      </el-table-column>
       <el-table-column prop="deptName" align="center" label="部门"></el-table-column>
       <el-table-column prop="personResponsibleName" align="center" label="责任人/使用人"></el-table-column>
       <el-table-column prop="number" align="center" label="编号"></el-table-column>
       <el-table-column prop="location" align="center" label="使用地点"></el-table-column>
       <el-table-column prop="used" align="center" label="使用情况"></el-table-column>
-<!--      <el-table-column label="检查表" align="center">-->
-<!--        <template #default="scope">-->
-<!--          {{scope.row.deptName }}内审检查表-->
-<!--        </template>-->
-<!--      </el-table-column>-->
       <el-table-column label="操作" align="center">
         <template #default="scope">
           <el-button link type="primary" @click="openDialog('edit',scope.row)">编辑</el-button>
@@ -63,7 +65,50 @@
         v-model:limit="queryParams.pageSize"
         @pagination="getList"
     />
-
+    <el-dialog
+        v-model="exportDialog"
+        title="导入模板"
+        width="550px"
+        :before-close="handleCloseExport"
+        :close-on-press-escape="false"
+        :close-on-click-modal="false"
+    >
+      <el-form :model="state.form" size="default" ref="superRef" :rules="state.formRules" label-width="110px" >
+        <el-form-item label="企业名称:" v-if="data.isAdmin" style="margin-left: 20px" prop="companyId">
+          <el-select v-model="state.form.companyId" filterable placeholder="请选择" clearable>
+            <el-option
+                v-for="item in data.companyList"
+                :key="item.id"
+                style="width: 100%"
+                :label="item.name"
+                :value="item.id">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item  label="表格模板:">
+          <el-button @click="downloadFileTable" size="default" :icon="Download" type="primary" plain>下载模板</el-button>
+        </el-form-item>
+        <el-form-item label="导入文件" prop="filePath">
+          <el-upload
+              accept=".xlsx,.xls"
+              :before-upload="beforeUpload"
+              v-model:file-list="state.exportFileList"
+              action="#"
+              :auto-upload="false"
+              :on-change="handleChange"
+              style="width: 100%"
+          >
+            <el-button :icon="Upload" size="default" type="primary">点击上传</el-button>
+          </el-upload>
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="handleCloseExport" size="default">取 消</el-button>
+          <el-button  type="primary" @click="onUpload" size="default">导入</el-button>
+        </span>
+      </template>
+    </el-dialog>
     <edit-dialog ref="dialogRef" @getList=getList></edit-dialog>
   </div>
 </template>
@@ -84,8 +129,9 @@
   getMeetingsList
 } from "@/api/innerReview/meetingReview";
 import {generateWordDocument} from "@/utils/exportWord";
-import {delStandingBook, getStandingBookList} from "@/api/infrastructureMng/ledger";
-
+import {delStandingBook, getStandingBookList, uploadStandingBook} from "@/api/infrastructureMng/ledger";
+import {uploadInBasic} from "@/api/companyInfo/basicInfo";
+import {Download, Upload} from "@element-plus/icons-vue";
 
 const userStore = useUserStore()
 const { proxy } = getCurrentInstance();
@@ -101,18 +147,42 @@
   dataList: [],
   companyList: [],
   expertData: [],
-  isAdmin: false
-});
+  isAdmin: false,
+  exportDialog: false
+})
+
+const checkFiles = (rule, value, callback) => {
+  if (state.exportFileList.length == 0) {
+    callback(new Error('请上传导入文件'))
+  } else {
+    callback()
+  }
+}
+
+const state = reactive({
+  form: {
+    id: null,
+    filePath: '',
+    companyId: null
+  },
+  formRules:{
+    companyId: [{ required: true, message: '请选择企业', trigger: 'blur' }],
+    filePath: [{ required: true, validator: checkFiles, trigger: 'blur' }]
+  },
+  exportFileList: [],
+})
+const superRef = ref();
 const fields = ref({
   '序号':'index',
-  '名称型号':'model',
+  '名称':'name',
+  '型号':'model',
   '部门':'deptName',
   '责任人/使用人':'personResponsibleName',
   '编号':'number',
   '使用地点':'location',
   '使用情况':'used'
 });
-const { queryParams, total, dataList,companyList, isAdmin, expertData } = toRefs(data);
+const { queryParams, total, dataList,companyList, isAdmin, expertData, exportDialog } = toRefs(data);
 const userInfo = ref()
 onMounted(async ()=>{
   if(userStore.roles.includes('admin')){
@@ -121,6 +191,7 @@
   }else{
     data.isAdmin = false
     data.queryParams.companyId = userStore.companyId
+    state.form.companyId = userStore.companyId
   }
   await getList()
 })
@@ -161,6 +232,66 @@
   }
 }
 
+const exportInData = () => {
+  data.exportDialog = true
+}
+
+const handleCloseExport = () => {
+  getList()
+  state.exportFileList = []
+  data.exportDialog = false
+}
+const beforeUpload = (file) => {
+  state.exportFileList = [...state.exportFileList, file]
+  state.exportFileList = state.exportFileList.slice(-1)
+  return false;
+}
+const downloadFileTable = () => {
+  const filePath = '/standingBooks.xls';
+  const link = document.createElement('a');
+  link.href = filePath;
+  link.download = filePath.substr(filePath.lastIndexOf('/') + 1);
+  link.click();
+}
+const fileBinaryList = ref([])
+const handleChange = (file, files) => {
+  fileBinaryList.value = files;
+};
+
+const onUpload = async () => {
+  const valid = await superRef.value.validate()
+  if(valid){
+    const formData = new FormData();
+    fileBinaryList.value.forEach((file) => {
+      formData.append('file', file.raw)
+    })
+    formData.append('companyId', state.form.companyId)
+    uploadStandingBook(formData).then(async (res) => {
+      if(res.code == 200){
+        ElMessage({
+          type: 'success',
+          message: '导入成功'
+        })
+        superRef.value.clearValidate();
+        superRef.value.resetFields()
+        state.exportFileList = []
+        data.exportDialog = false
+        await getList()
+      }else{
+        ElMessage({
+          type: 'error',
+          message: res.message
+        });
+      }
+    }).catch(async () =>{
+      state.exportFileList = []
+      data.exportDialog = false
+      await getList()
+    })
+  }else{
+    ElMessage.warning('请完善信息')
+  }
+}
 
 const getCompanyList = async ()=>{
   const queryParams = {
diff --git a/src/views/work/qualityInfo/infrastructureMng/maintainPlan/components/editDialog.vue b/src/views/work/qualityInfo/infrastructureMng/maintainPlan/components/editDialog.vue
index 4f67770..5f48bf5 100644
--- a/src/views/work/qualityInfo/infrastructureMng/maintainPlan/components/editDialog.vue
+++ b/src/views/work/qualityInfo/infrastructureMng/maintainPlan/components/editDialog.vue
@@ -292,6 +292,7 @@
   await getUserList(companyId)
   state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看'
   state.form.companyId = companyId
+  state.form.year = new Date().getFullYear().toString()
   if(state.title == '编辑'||state.title == '查看'){
     await getInfo(value.id)
   }
diff --git a/src/views/work/qualityInfo/infrastructureMng/reviewRecordStatistics/components/editDialog.vue b/src/views/work/qualityInfo/infrastructureMng/reviewRecordStatistics/components/editDialog.vue
index 9c9a18e..38272ea 100644
--- a/src/views/work/qualityInfo/infrastructureMng/reviewRecordStatistics/components/editDialog.vue
+++ b/src/views/work/qualityInfo/infrastructureMng/reviewRecordStatistics/components/editDialog.vue
@@ -61,6 +61,28 @@
         <el-table :data="state.form.annualMaintenanceEvaluateDeviceList" class="customedTable" :border="true">
           <el-table-column label="序号" type="index" width="80" align="center">
           </el-table-column>
+          <el-table-column label="设备名称" prop="deviceName" align="center">
+            <template #default="scope">
+<!--              <el-input-->
+<!--                  v-model.trim="scope.row.deviceName"-->
+<!--                  size="large"-->
+<!--                  type="textarea"-->
+<!--                  style="width: 100%;"-->
+<!--                  clearable-->
+<!--                  :readonly="state.title =='查看'"-->
+<!--              >-->
+<!--              </el-input>-->
+
+              <el-select clearable v-model="scope.row.deviceName" :disabled="state.title =='查看'" filterable placeholder="设备名称" style="width: 100%" @change="getDeviceInfo(scope.row.deviceName,scope.$index)">
+                <el-option
+                    v-for="item in state.deviceList"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.name"
+                />
+              </el-select>
+            </template>
+          </el-table-column>
           <el-table-column label="设备编号" prop="deviceNumber" align="center">
             <template #default="scope">
               <el-input
@@ -69,20 +91,7 @@
                   type="textarea"
                   style="width: 100%;"
                   clearable
-                  :readonly="state.title =='查看'"
-              >
-              </el-input>
-            </template>
-          </el-table-column>
-          <el-table-column label="设备名称" prop="deviceName" align="center">
-            <template #default="scope">
-              <el-input
-                  v-model.trim="scope.row.deviceName"
-                  size="large"
-                  type="textarea"
-                  style="width: 100%;"
-                  clearable
-                  :readonly="state.title =='查看'"
+                  readonly
               >
               </el-input>
             </template>
@@ -95,7 +104,7 @@
                   type="textarea"
                   style="width: 100%;"
                   clearable
-                  :readonly="state.title =='查看'"
+                  readonly
               >
               </el-input>
             </template>
@@ -121,7 +130,7 @@
                   type="textarea"
                   style="width: 100%;"
                   clearable
-                  :readonly="state.title =='查看'"
+                  readonly
               >
               </el-input>
             </template>
@@ -134,7 +143,7 @@
                   type="textarea"
                   style="width: 100%;"
                   clearable
-                  :readonly="state.title =='查看'"
+                  readonly
               >
               </el-input>
             </template>
@@ -200,7 +209,7 @@
 import {getToken} from "@/utils/auth";
 import {
   updateMaintenanceEvaluate,
-  getMaintenanceEvaluateDetail
+  getMaintenanceEvaluateDetail, getStandingBookList
 } from "@/api/infrastructureMng/ledger";
 
 import {listUser} from "@/api/system/user";
@@ -246,7 +255,8 @@
   },
   isAdmin: false,
   companyList: [],
-  userList: []
+  userList: [],
+  deviceList: []
 })
 onMounted(() => {
 
@@ -258,6 +268,7 @@
     state.companyList = companyList
   }
   await getUserList(companyId)
+  await getDeviceList(companyId)
   state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看'
   state.form.companyId = companyId
   if(state.title == '编辑'||state.title == '查看'){
@@ -285,6 +296,29 @@
   state.form.annualMaintenanceEvaluateDeviceList = state.form.annualMaintenanceEvaluateDeviceList.filter((item,index) => index != i)
 }
 
+const getDeviceList = async (companyId) => {
+  const res = await getStandingBookList({pageNum: 1, pageSize: 999, companyId: companyId})
+  if(res.code == 200){
+    state.deviceList = res.data.list || []
+  }else{
+    ElMessage.warning(res.message)
+  }
+}
+
+const getDeviceInfo = (name,index)=>{
+  const foundNode = state.deviceList.find(i=>i.name == name)
+  state.form.annualMaintenanceEvaluateDeviceList[index] = {
+    ...state.form.annualMaintenanceEvaluateDeviceList[index],
+    deviceNumber: foundNode.number,
+    deviceName: foundNode.name,
+    model: foundNode.model,
+    location: foundNode.location,
+    useUser: foundNode.personResponsibleName,
+    deptName: foundNode.deptName,
+    resultType: foundNode.status
+  }
+}
+
 const onSubmit = async () => {
   const valid = await superRef.value.validate();
   if(valid){
diff --git a/src/views/work/qualityInfo/supplierQuality/satisfied/components/editDialog.vue b/src/views/work/qualityInfo/supplierQuality/satisfied/components/editDialog.vue
index 10fd619..2e7b308 100644
--- a/src/views/work/qualityInfo/supplierQuality/satisfied/components/editDialog.vue
+++ b/src/views/work/qualityInfo/supplierQuality/satisfied/components/editDialog.vue
@@ -140,6 +140,7 @@
   }
   state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看'
   state.form.companyId = companyId
+  state.form.year = new Date().getFullYear().toString()
   if(state.title == '编辑'||state.title == '查看'){
     Object.keys(state.form).forEach(key => {
       if (key in value) {
diff --git a/src/views/work/qualityManage/continuousImprovement/components/editDialog.vue b/src/views/work/qualityManage/continuousImprovement/components/editDialog.vue
index 89cc68b..be57dd5 100644
--- a/src/views/work/qualityManage/continuousImprovement/components/editDialog.vue
+++ b/src/views/work/qualityManage/continuousImprovement/components/editDialog.vue
@@ -267,6 +267,7 @@
     state.companyList = companyList
   }
   title.value = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看' ;
+  state.form.year = new Date().getFullYear().toString()
   if(type === 'edit' || type === 'review') {
     const res = await getInsideById({improveId: value.id})
     if(res.code === 200){
diff --git a/src/views/work/selfProblems/internalAudit/meetingMng/components/editDialog.vue b/src/views/work/selfProblems/internalAudit/meetingMng/components/editDialog.vue
index 3b4ee48..99b64ad 100644
--- a/src/views/work/selfProblems/internalAudit/meetingMng/components/editDialog.vue
+++ b/src/views/work/selfProblems/internalAudit/meetingMng/components/editDialog.vue
@@ -106,6 +106,7 @@
   }
   state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看'
   state.form.companyId = companyId
+  state.form.year = new Date().getFullYear().toString()
   if(state.title == '编辑'||state.title == '查看'){
     Object.keys(state.form).forEach(key => {
       if (key in value) {
diff --git a/src/views/work/selfProblems/internalAudit/problemMng/noConformanceMng/components/editDialog.vue b/src/views/work/selfProblems/internalAudit/problemMng/noConformanceMng/components/editDialog.vue
index cd59f13..1752b24 100644
--- a/src/views/work/selfProblems/internalAudit/problemMng/noConformanceMng/components/editDialog.vue
+++ b/src/views/work/selfProblems/internalAudit/problemMng/noConformanceMng/components/editDialog.vue
@@ -111,6 +111,7 @@
   }
   state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看'
   state.form.companyId = companyId
+  state.form.year = new Date().getFullYear().toString()
   if(state.title == '编辑'||state.title == '查看'){
     Object.keys(state.form).forEach(key => {
       if (key in value) {
diff --git a/src/views/work/selfProblems/mngAudit/mngAuditInput/components/editDialog.vue b/src/views/work/selfProblems/mngAudit/mngAuditInput/components/editDialog.vue
index c4c2eb2..d683a40 100644
--- a/src/views/work/selfProblems/mngAudit/mngAuditInput/components/editDialog.vue
+++ b/src/views/work/selfProblems/mngAudit/mngAuditInput/components/editDialog.vue
@@ -112,6 +112,7 @@
   }
   state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看'
   state.form.companyId = companyId
+  state.form.year = new Date().getFullYear().toString()
   if(state.title == '编辑'||state.title == '查看'){
     Object.keys(state.form).forEach(key => {
       if (key in value) {
diff --git a/src/views/work/selfProblems/mngAudit/mngAuditMeeting/components/editDialog.vue b/src/views/work/selfProblems/mngAudit/mngAuditMeeting/components/editDialog.vue
index b42dc3f..3fc4f9d 100644
--- a/src/views/work/selfProblems/mngAudit/mngAuditMeeting/components/editDialog.vue
+++ b/src/views/work/selfProblems/mngAudit/mngAuditMeeting/components/editDialog.vue
@@ -112,6 +112,7 @@
   }
   state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看'
   state.form.companyId = companyId
+  state.form.year = new Date().getFullYear().toString()
   if(state.title == '编辑'||state.title == '查看'){
     Object.keys(state.form).forEach(key => {
       if (key in value) {
diff --git a/src/views/work/selfProblems/mngAudit/mngAuditPlan/components/editDialog.vue b/src/views/work/selfProblems/mngAudit/mngAuditPlan/components/editDialog.vue
index 92ea95f..a24ce16 100644
--- a/src/views/work/selfProblems/mngAudit/mngAuditPlan/components/editDialog.vue
+++ b/src/views/work/selfProblems/mngAudit/mngAuditPlan/components/editDialog.vue
@@ -224,6 +224,7 @@
   await getUserList(companyId)
   state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看'
   state.form.companyId = companyId
+  state.form.year = new Date().getFullYear().toString()
   if(state.title == '编辑'||state.title == '查看'){
     Object.keys(state.form).forEach(key => {
       if (key in value) {
diff --git a/src/views/work/selfProblems/mngAudit/mngAuditReport/components/editDialog.vue b/src/views/work/selfProblems/mngAudit/mngAuditReport/components/editDialog.vue
index 57e64f5..4b300fc 100644
--- a/src/views/work/selfProblems/mngAudit/mngAuditReport/components/editDialog.vue
+++ b/src/views/work/selfProblems/mngAudit/mngAuditReport/components/editDialog.vue
@@ -112,6 +112,7 @@
   }
   state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看'
   state.form.companyId = companyId
+  state.form.year = new Date().getFullYear().toString()
   if(state.title == '编辑'||state.title == '查看'){
     Object.keys(state.form).forEach(key => {
       if (key in value) {
diff --git a/src/views/work/selfProblems/plan/components/planDialog.vue b/src/views/work/selfProblems/plan/components/planDialog.vue
index a003a96..b2c55dc 100644
--- a/src/views/work/selfProblems/plan/components/planDialog.vue
+++ b/src/views/work/selfProblems/plan/components/planDialog.vue
@@ -381,6 +381,7 @@
   }
   await getDeptList()
   title.value = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看' ;
+  state.form.year = new Date().getFullYear().toString()
   if(type === 'edit' || type === 'review') {
     state.form = JSON.parse(JSON.stringify(value));
     checkTime.value = [state.form.reviewStart,state.form.reviewEnd]
diff --git a/src/views/work/selfProblems/scenario/components/scenarioDialog.vue b/src/views/work/selfProblems/scenario/components/scenarioDialog.vue
index 8685cb8..bca9e93 100644
--- a/src/views/work/selfProblems/scenario/components/scenarioDialog.vue
+++ b/src/views/work/selfProblems/scenario/components/scenarioDialog.vue
@@ -230,6 +230,7 @@
     state.form.companyName = value.companyName
   }
   title.value = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看' ;
+  state.form.year = new Date().getFullYear().toString()
   if(type === 'edit' || type === 'review') {
     state.form = JSON.parse(JSON.stringify(value));
     if(state.isAdmin){

--
Gitblit v1.9.2