From 274070ac9efe449e879965abcaee6c7222dc51ff Mon Sep 17 00:00:00 2001
From: hyingbo <1363390067@qq.com>
Date: 星期二, 09 九月 2025 17:49:24 +0800
Subject: [PATCH] 精度参数添加设备类型分类,改造台账维护精度参数功能

---
 src/views/eam/equipment/modules/EamEquipmentPrecisionList.vue |  103 +++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 79 insertions(+), 24 deletions(-)

diff --git a/src/views/eam/equipment/modules/EamEquipmentPrecisionList.vue b/src/views/eam/equipment/modules/EamEquipmentPrecisionList.vue
index 5b8aa0e..7e1cd96 100644
--- a/src/views/eam/equipment/modules/EamEquipmentPrecisionList.vue
+++ b/src/views/eam/equipment/modules/EamEquipmentPrecisionList.vue
@@ -2,8 +2,14 @@
   <a-spin :spinning="confirmLoading">
     <vxe-toolbar>
       <template v-slot:buttons>
-        <vxe-button status="primary" @click="insertEvent()">鏂板</vxe-button>
-        <vxe-button status="danger" @click="handleBatchRemove()">鎵归噺鍒犻櫎</vxe-button>
+        <vxe-button
+          status="primary"
+          @click="insertEvent()"
+        >鏂板</vxe-button>
+        <vxe-button
+          status="danger"
+          @click="handleBatchRemove()"
+        >鎵归噺鍒犻櫎</vxe-button>
       </template>
     </vxe-toolbar>
     <vxe-table
@@ -17,18 +23,52 @@
       :data="dataSource"
       :edit-rules="validRules"
       :edit-config="{trigger: 'manual', mode: 'row', showStatus: true}"
-      style="margin-top: 8px;">
-      <vxe-table-column type="checkbox" width="60"></vxe-table-column>
-      <vxe-table-column type="seq" width="60"></vxe-table-column>
-      <vxe-table-column title="ID" field="id" :visible="false"></vxe-table-column>
-      <vxe-table-column title="equipmentId" field="equipmentId" :visible="false"></vxe-table-column>
-      <vxe-table-column title="妫�娴嬮」鐩�" field="parameterId" align="center"
-                        :edit-render="{name : '$select', options: precisionParameterList, optionProps: {label:'parameterName', value:'id'}, props: {clearable:true}, events: {change:handleParamSelectChange}}"></vxe-table-column>
-      <vxe-table-column title="鍙傛暟缂栫爜" field="parameterCode" align="center"></vxe-table-column>
-      <vxe-table-column title="鍏佸樊鍊�(mm)" field="parameterValue" align="center"
-                        :edit-render="{name : '$input'}"></vxe-table-column>
-      <vxe-table-column title="瀹為檯鍊�" field="actualValue" align="center"></vxe-table-column>
-      <vxe-table-column title="鎿嶄綔" width="160">
+      style="margin-top: 8px;"
+    >
+      <vxe-table-column
+        type="checkbox"
+        width="60"
+      ></vxe-table-column>
+      <vxe-table-column
+        type="seq"
+        width="60"
+      ></vxe-table-column>
+      <vxe-table-column
+        title="ID"
+        field="id"
+        :visible="false"
+      ></vxe-table-column>
+      <vxe-table-column
+        title="equipmentId"
+        field="equipmentId"
+        :visible="false"
+      ></vxe-table-column>
+      <vxe-table-column
+        title="妫�娴嬮」鐩�"
+        field="parameterId"
+        align="center"
+        :edit-render="{name : '$select', options: precisionParameterList, optionProps: {label:'parameterName', value:'id'}, props: {clearable:true}, events: {change:handleParamSelectChange}}"
+      ></vxe-table-column>
+      <vxe-table-column
+        title="鍙傛暟缂栫爜"
+        field="parameterCode"
+        align="center"
+      ></vxe-table-column>
+      <vxe-table-column
+        title="鍏佸樊鍊�(mm)"
+        field="parameterValue"
+        align="center"
+        :edit-render="{name : '$input'}"
+      ></vxe-table-column>
+      <vxe-table-column
+        title="瀹為檯鍊�"
+        field="actualValue"
+        align="center"
+      ></vxe-table-column>
+      <vxe-table-column
+        title="鎿嶄綔"
+        width="160"
+      >
         <template v-slot="{row}">
           <template v-if="hasEditStatus(row)">
             <vxe-button @click="saveRowEvent(row)">淇濆瓨</vxe-button>
@@ -54,6 +94,12 @@
 import { deleteAction, getAction, httpAction } from '@/api/manage'
 
 export default {
+  props: {
+    equipmentType: {
+      type: String,
+      default: ''
+    }
+  },
   name: 'EamEquipmentPrecisionList',
   data() {
     return {
@@ -96,7 +142,16 @@
     }
   },
   created() {
-    this.loadPrecisionParameterList()
+    // this.loadPrecisionParameterList()
+  },
+  watch: {
+    equipmentType: {
+      immediate: true,
+      handler(newVal) {
+        this.equipmentType = newVal
+        this.loadPrecisionParameterList()
+      }
+    }
   },
   methods: {
     handleParamSelectChange($event, value) {
@@ -107,8 +162,9 @@
         $event.row.parameterCode = undefined
       }
     },
+    // 鎺ユ敹璁惧绉嶇被鍙傛暟骞跺姞杞藉垪琛�
     loadPrecisionParameterList() {
-      getAction(this.url.precisionParamList).then(res => {
+      getAction(this.url.precisionParamList, { equipmentType: this.equipmentType }).then(res => {
         if (res.success) {
           this.precisionParameterList = [...res.result]
         }
@@ -212,18 +268,18 @@
         }
       })
     },
-    handleBatchRemove(){
+    handleBatchRemove() {
       let xTable = this.$refs.editableDetailTable
       let that = this
       let checkboxRecords = xTable.getCheckboxRecords();
-      if(checkboxRecords && checkboxRecords.length > 0) {
+      if (checkboxRecords && checkboxRecords.length > 0) {
         let ids = checkboxRecords.map(record => record.id);
         this.$confirm({
           title: "纭鍒犻櫎",
           content: "鏄惁鍒犻櫎閫変腑鏁版嵁?",
           onOk: function () {
             that.confirmLoading = true;
-            deleteAction(that.url.deleteBatch, {ids: ids.join(',')}).then((res) => {
+            deleteAction(that.url.deleteBatch, { ids: ids.join(',') }).then((res) => {
               if (res.success) {
                 //閲嶆柊璁$畻鍒嗛〉闂
                 that.reCalculatePage(checkboxRecords.length)
@@ -273,18 +329,17 @@
         this.ipagination.current = currentIndex
       }
     },
-    handlePageChange(current, pageSize){
+    handlePageChange(current, pageSize) {
       this.$set(this.ipagination, 'current', current)
-      this.$emit('change', {current, pageSize})
+      this.$emit('change', { current, pageSize })
     },
-    handleShowSizeChange(current, pageSize){
+    handleShowSizeChange(current, pageSize) {
       this.$set(this.ipagination, 'pageSize', pageSize)
-      this.$emit('change', {current, pageSize})
+      this.$emit('change', { current, pageSize })
     },
   }
 }
 </script>
 
 <style lang="less" scoped>
-
 </style>
\ No newline at end of file

--
Gitblit v1.9.3