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

---
 src/views/work/qualityInfo/infrastructureMng/maintainPlan/components/editDialog.vue           |   34 ++++++++++
 src/assets/styles/sidebar.scss                                                                |   17 ++++-
 src/views/work/assetMng/toolsMonitorMeasure/equipCalibrateConfirm/components/editDialog.vue   |    6 ++
 src/views/work/qualityInfo/inventoryRecord/components/editDialog.vue                          |   30 +++++----
 src/views/work/qualityInfo/infrastructureMng/repairRecord/components/editDialog.vue           |   36 +++++++++++-
 src/views/work/qualityInfo/infrastructureMng/reviewRecordStatistics/components/editDialog.vue |    2 
 src/views/work/qualityInfo/infrastructureMng/maintainRecord/components/editDialog.vue         |   41 ++++++++++++-
 7 files changed, 141 insertions(+), 25 deletions(-)

diff --git a/src/assets/styles/sidebar.scss b/src/assets/styles/sidebar.scss
index 42fc915..f1e7f2f 100644
--- a/src/assets/styles/sidebar.scss
+++ b/src/assets/styles/sidebar.scss
@@ -88,12 +88,22 @@
         display: inline-block !important;
       }
 
+      .el-sub-menu .el-menu-item.is-active{
+        background: linear-gradient(#ccc,#fff) !important;
+        //background-color: #fff;
+        border-top: 1px solid rgba(255,255,255,.2);
+        border-bottom: 1px solid rgba(255,255,255,.2);
+        width: 94%;
+        margin-left: 3%;
+        border-radius: 4px;
+      }
+
     }
 
 
     .el-menu--inline:not(:has(.el-sub-menu)){
       background-color: #3272ff !important;
-      box-shadow: 0 3px 8px rgba(0,0,0,.1) inset, 0 -3px 8px rgba(255,255,255,.1) inset;
+      box-shadow: 0 3px 8px rgba(0,0,0,.2) inset, 0 -3px 8px rgba(0,0,0,.2) inset;
     }
 
     // menu hover
@@ -124,10 +134,11 @@
       &:hover {
         color: #fff;
         background-color: rgba(255,255,255,.5) !important;
+        width: 96%;
+        margin-left: 2%;
       }
       &.is-active {
-        color: #fff;
-        background-color: rgba(255,255,255,.2) !important;
+        color: #2563eb;
       }
 
       .el-sub-menu__icon-arrow{
diff --git a/src/views/work/assetMng/toolsMonitorMeasure/equipCalibrateConfirm/components/editDialog.vue b/src/views/work/assetMng/toolsMonitorMeasure/equipCalibrateConfirm/components/editDialog.vue
index 9de59d0..d2ab62a 100644
--- a/src/views/work/assetMng/toolsMonitorMeasure/equipCalibrateConfirm/components/editDialog.vue
+++ b/src/views/work/assetMng/toolsMonitorMeasure/equipCalibrateConfirm/components/editDialog.vue
@@ -264,7 +264,13 @@
 }
 
 const getDeptList = async ()=>{
+  state.form.deviceName = ''
+  state.form.deviceNumber = ''
+  state.form.calibrationTime = ''
+  state.form.calibrationNumber = ''
+  state.form.calibrationCompany = ''
   await getUserList(state.form.companyId)
+  await getDeviceList(state.form.companyId)
 }
 
 const getUserList = async (companyId)=> {
diff --git a/src/views/work/qualityInfo/infrastructureMng/maintainPlan/components/editDialog.vue b/src/views/work/qualityInfo/infrastructureMng/maintainPlan/components/editDialog.vue
index 5f48bf5..015d7a9 100644
--- a/src/views/work/qualityInfo/infrastructureMng/maintainPlan/components/editDialog.vue
+++ b/src/views/work/qualityInfo/infrastructureMng/maintainPlan/components/editDialog.vue
@@ -133,7 +133,15 @@
             <tr>
               <td>{{deviceIndex + 1}}</td>
               <td>
-                <el-input v-model.trim="device.deviceName" type="textarea" style="width: 100%;" clearable :readonly="state.title =='查看'"></el-input>
+<!--                <el-input v-model.trim="device.deviceName" type="textarea" style="width: 100%;" clearable :readonly="state.title =='查看'"></el-input>-->
+                <el-select clearable v-model="device.deviceName" :readonly="state.title =='查看'" filterable placeholder="设备名称" style="width: 100%" @change="getDeviceInfo(device.deviceName,deviceIndex)">
+                  <el-option
+                      v-for="item in state.deviceList"
+                      :key="item.id"
+                      :label="item.name"
+                      :value="item.id"
+                  />
+                </el-select>
               </td>
               <td>
                 <el-input v-model.trim="device.model" type="textarea" style="width: 100%;" clearable :readonly="state.title =='查看'"></el-input>
@@ -223,7 +231,7 @@
 } from "@/api/innerReview/meetingReview";
 import {getDepart} from "@/api/orgStructure/depart";
 import {listUser} from "@/api/system/user";
-import {getMaintenancePlanDetail, updateMaintenancePlan} from "@/api/infrastructureMng/ledger";
+import {getMaintenancePlanDetail, getStandingBookList, updateMaintenancePlan} from "@/api/infrastructureMng/ledger";
 
 const emit = defineEmits(["getList"]);
 const dialogVisible = ref(false)
@@ -253,6 +261,7 @@
     delDeviceIds: []
   },
   oldDeviceList: [],
+  deviceList: [],
   formRules:{
     companyId: [{ required: true, message: '请选择企业', trigger: 'blur' }],
     year: [{ required: true, message: '请选择年份', trigger: 'blur' }],
@@ -290,6 +299,7 @@
     state.companyList = companyList
   }
   await getUserList(companyId)
+  await getDeviceList(companyId)
   state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看'
   state.form.companyId = companyId
   state.form.year = new Date().getFullYear().toString()
@@ -297,6 +307,25 @@
     await getInfo(value.id)
   }
   dialogVisible.value = true
+}
+
+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.id == name)
+  state.form.annualMaintenanceDeviceSaveDTOReqs[index] = {
+    ...state.form.annualMaintenanceDeviceSaveDTOReqs[index],
+    deviceName: foundNode.name,
+    model: foundNode.model,
+    factoryNumber: foundNode.number
+  }
 }
 
 const addLine = () => {
@@ -434,6 +463,7 @@
   state.form.processId = null
   state.form.finishId = null
   await getUserList(state.form.companyId)
+  await getDeviceList(state.form.companyId)
 }
 
 const getUserList = async (companyId)=> {
diff --git a/src/views/work/qualityInfo/infrastructureMng/maintainRecord/components/editDialog.vue b/src/views/work/qualityInfo/infrastructureMng/maintainRecord/components/editDialog.vue
index a5e1985..2e83925 100644
--- a/src/views/work/qualityInfo/infrastructureMng/maintainRecord/components/editDialog.vue
+++ b/src/views/work/qualityInfo/infrastructureMng/maintainRecord/components/editDialog.vue
@@ -22,7 +22,15 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="设备名称:" prop="deviceName">
-              <el-input v-model.trim="state.form.deviceName" :disabled="state.title =='查看'"></el-input>
+<!--              <el-input v-model.trim="state.form.deviceName" :disabled="state.title =='查看'"></el-input>-->
+              <el-select clearable v-model="state.form.deviceName" :readonly="state.title =='查看'" filterable placeholder="设备名称" style="width: 100%" @change="getDeviceInfo()">
+                <el-option
+                    v-for="item in state.deviceList"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id"
+                />
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -197,7 +205,11 @@
 } from "@/api/innerReview/meetingReview";
 import {getDepart} from "@/api/orgStructure/depart";
 import {listUser} from "@/api/system/user";
-import {getMaintenanceServiceDetail, updateMaintenanceService} from "@/api/infrastructureMng/ledger";
+import {
+  getMaintenanceServiceDetail,
+  getStandingBookList,
+  updateMaintenanceService
+} from "@/api/infrastructureMng/ledger";
 
 const emit = defineEmits(["getList"]);
 const dialogVisible = ref(false)
@@ -298,7 +310,8 @@
   },
   isAdmin: false,
   companyList: [],
-  userList: []
+  userList: [],
+  deviceList: []
 })
 onMounted(() => {
 
@@ -310,12 +323,31 @@
     state.companyList = companyList
   }
   await getUserList(companyId)
+  await getDeviceList(companyId)
   state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看'
   state.form.companyId = companyId
   if(state.title == '编辑'||state.title == '查看'){
     await getInfo(value.id)
   }
   dialogVisible.value = true
+}
+
+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 = ()=>{
+  const foundNode = state.deviceList.find(i=>i.id == state.form.deviceName)
+  state.form = {
+    ...state.form,
+    deviceName: foundNode.name,
+    deviceNumber: foundNode.number
+  }
 }
 
 const objectSpanMethod = ({row, column, rowIndex, columnIndex,}) => {
@@ -467,7 +499,10 @@
   state.form.checkersOne = []
   state.form.operatorsTwo = []
   state.form.checkersTwo = []
+  state.form.deviceName = ''
+  state.form.deviceNumber = ''
   await getUserList(state.form.companyId)
+  await getDeviceList(state.form.companyId)
 }
 
 
diff --git a/src/views/work/qualityInfo/infrastructureMng/repairRecord/components/editDialog.vue b/src/views/work/qualityInfo/infrastructureMng/repairRecord/components/editDialog.vue
index b1ce2ca..4d449dc 100644
--- a/src/views/work/qualityInfo/infrastructureMng/repairRecord/components/editDialog.vue
+++ b/src/views/work/qualityInfo/infrastructureMng/repairRecord/components/editDialog.vue
@@ -22,7 +22,15 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="设备名称:" prop="deviceName">
-              <el-input v-model.trim="state.form.deviceName" :disabled="state.title =='查看'"></el-input>
+<!--              <el-input v-model.trim="state.form.deviceName" :disabled="state.title =='查看'"></el-input>-->
+              <el-select clearable v-model="state.form.deviceName" :readonly="state.title =='查看'" filterable placeholder="设备名称" style="width: 100%" @change="getDeviceInfo()">
+                <el-option
+                    v-for="item in state.deviceList"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id"
+                />
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -223,7 +231,7 @@
 } from "@/api/innerReview/meetingReview";
 import {getDepart} from "@/api/orgStructure/depart";
 import {listUser} from "@/api/system/user";
-import {getMaintenanceRecordDetail, updateMaintenanceRecord} from "@/api/infrastructureMng/ledger";
+import {getMaintenanceRecordDetail, getStandingBookList, updateMaintenanceRecord} from "@/api/infrastructureMng/ledger";
 
 const emit = defineEmits(["getList"]);
 const dialogVisible = ref(false)
@@ -279,7 +287,8 @@
   isAdmin: false,
   companyList: [],
   oldRecordUsers: [],
-  userList: []
+  userList: [],
+  deviceList: []
 })
 onMounted(() => {
 
@@ -291,6 +300,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 == '查看'){
@@ -299,6 +309,23 @@
   dialogVisible.value = true
 }
 
+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 = ()=>{
+  const foundNode = state.deviceList.find(i=>i.id == state.form.deviceName)
+  state.form = {
+    ...state.form,
+    deviceName: foundNode.name,
+    number: foundNode.number
+  }
+}
 
 const onSubmit = async () => {
   const valid = await superRef.value.validate()
@@ -389,7 +416,10 @@
   state.form.establishmentId = null
   state.form.processId = null
   state.form.approvalId = null
+  state.form.deviceName = ''
+  state.form.number = ''
   await getUserList(state.form.companyId)
+  await getDeviceList(state.form.companyId)
 }
 
 const getUserList = async (companyId)=> {
diff --git a/src/views/work/qualityInfo/infrastructureMng/reviewRecordStatistics/components/editDialog.vue b/src/views/work/qualityInfo/infrastructureMng/reviewRecordStatistics/components/editDialog.vue
index 38272ea..a00e9cf 100644
--- a/src/views/work/qualityInfo/infrastructureMng/reviewRecordStatistics/components/editDialog.vue
+++ b/src/views/work/qualityInfo/infrastructureMng/reviewRecordStatistics/components/editDialog.vue
@@ -384,7 +384,9 @@
   state.form.establishmentId = null
   state.form.processId = null
   state.form.approvalId = null
+  state.form.annualMaintenanceEvaluateDeviceList = []
   await getUserList(state.form.companyId)
+  await getDeviceList(state.form.companyId)
 }
 
 const getUserList = async (companyId)=> {
diff --git a/src/views/work/qualityInfo/inventoryRecord/components/editDialog.vue b/src/views/work/qualityInfo/inventoryRecord/components/editDialog.vue
index 5ab3fe4..83a41a3 100644
--- a/src/views/work/qualityInfo/inventoryRecord/components/editDialog.vue
+++ b/src/views/work/qualityInfo/inventoryRecord/components/editDialog.vue
@@ -44,7 +44,7 @@
         <el-form-item label="库存数量:">
           <el-input v-model.trim="state.originInventory" readonly placeholder="库存数量"></el-input>
         </el-form-item>
-        <el-form-item label="材料清单:" prop="warehousingRecordDetails">
+        <el-form-item label="出入库:" prop="warehousingRecordDetails">
           <el-button
               type="primary"
               plain
@@ -170,7 +170,7 @@
 const dialogRef = ref();
 const checkList = (rule, value, callback) => {
   if (state.form.warehousingRecordDetails.length == 0) {
-    callback(new Error('材料清单不可为空'))
+    callback(new Error('出入库不可为空'))
   } else {
     callback()
   }
@@ -223,7 +223,7 @@
 }
 
 const calculateInventoryExcludingCurrent = (currentRow) => {
-  if(!state.form.materialId) return 0
+  // if(!state.form.materialId) return 0
   let inventory = state.materialList.find(i=>i.id == state.form.materialId)?.inventory || 0;
   if(Array.isArray(state.form.warehousingRecordDetails) && state.form.warehousingRecordDetails.length>0){
     for(let i of state.form.warehousingRecordDetails){
@@ -240,7 +240,7 @@
 }
 
 const calculateInventory = () => {
-  if(state.form.materialId){
+  // if(state.form.materialId){
     let inventory = state.materialList.find(i=>i.id == state.form.materialId)?.inventory || 0
     if(Array.isArray(state.form.warehousingRecordDetails) && state.form.warehousingRecordDetails.length>0){
       for(let i of state.form.warehousingRecordDetails){
@@ -256,9 +256,9 @@
     if(inventory < 0){
       ElMessage.warning('库存不足,无法出库')
     }
-  }else{
-    state.originInventory = 0
-  }
+  // }else{
+  //   state.originInventory = 0
+  // }
 }
 
 const checkRemain = (scope) => {
@@ -290,13 +290,14 @@
 }
 
 const getInventory = ()=>{
-  state.form.warehousingRecordDetails = state.form.warehousingRecordDetails.map(i=>{
-    return {
-      ...i,
-      specification: state.materialList.find(i=>i.id == state.form.materialId)?.specification,
-      materialUnit: state.materialList.find(i=>i.id == state.form.materialId)?.materialUnit
-    }
-  })
+  state.form.warehousingRecordDetails = []
+  // state.form.warehousingRecordDetails = state.form.warehousingRecordDetails.map(i=>{
+  //   return {
+  //     ...i,
+  //     specification: state.materialList.find(i=>i.id == state.form.materialId)?.specification,
+  //     materialUnit: state.materialList.find(i=>i.id == state.form.materialId)?.materialUnit
+  //   }
+  // })
   calculateInventory()
 }
 
@@ -411,6 +412,7 @@
     warehousingRecordDetails: [],
     delDetails: []
   }
+  state.originInventory = 0
   superRef.value.clearValidate();
   superRef.value.resetFields()
   dialogVisible.value = false;

--
Gitblit v1.9.2