From fe25b9d9dc98187a0b885631bc39dfd5daa15163 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期四, 20 十一月 2025 17:26:04 +0800
Subject: [PATCH] 工位改为默认查询所有状态

---
 src/views/console/workstation/CollDialog.vue |   43 +++++++++++++++++++++++++++++++++++++------
 1 files changed, 37 insertions(+), 6 deletions(-)

diff --git a/src/views/console/workstation/CollDialog.vue b/src/views/console/workstation/CollDialog.vue
index e7e979d..1dbe7b5 100644
--- a/src/views/console/workstation/CollDialog.vue
+++ b/src/views/console/workstation/CollDialog.vue
@@ -1,10 +1,12 @@
 <template>
-    <el-dialog title="鏁版嵁鐐�" v-model="visible" :width="'100%'" destroy-on-close @closed="$emit('closed')">
+    <div>
+        <el-dialog title="鏁版嵁鐐�" v-model="visible" :width="'100%'" destroy-on-close @closed="$emit('closed')">
         <p style="margin-bottom: 14px;display: flex;align-items: center;">
             <span style="margin-right: 8px;">绫诲瀷</span>
             <el-select v-model="type" placeholder="绫诲瀷" size="small" style="width: 240px" @change="changeType">
                 <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id" />
             </el-select>
+            <el-button type="primary" size="small" @click="importData" style="margin-left: 10px;">瀵煎叆鏁版嵁鐐�</el-button>
             <span style="margin-right: 8px;margin-left: auto;">IOT搴旂敤ID</span>
             <el-input v-model="appId" placeholder="IOT搴旂敤ID" style="width: 240px"></el-input>
         </p>
@@ -59,6 +61,14 @@
             <el-button v-if="mode != 'show'" type="primary" :loading="isSaveing" @click="submit()">淇� 瀛�</el-button>
         </template>
     </el-dialog>
+    <el-dialog title="宸ヤ綅" v-model="visibleWork" :width="'50%'" destroy-on-close>
+        <el-table :data="workList" stripe @cell-click="cellClick">
+            <el-table-column label="宸ヤ綅鍚嶇О" prop="name"></el-table-column>
+            <el-table-column label="宸ヤ綅ID" prop="id"></el-table-column>
+        </el-table>
+    </el-dialog>
+    </div>
+    
 </template>
 
 <script>
@@ -88,13 +98,32 @@
             },
             type: '',
             typeList: [],
-            appId: ''
+            appId: '',
+            visibleWork: false,
+            workList: []
         }
     },
     created() {
 
     },
     methods: {
+        importData () {
+            this.visibleWork = true
+            this.$API.workstation.getList.get({
+                groupId: 1,
+            }).then(res => {
+                console.log(res, '>>>>>>>>>>>>>')
+                this.workList = res.data.records
+            })
+        },
+        cellClick (row) {
+            console.log(row)
+            this.getList({
+                workstationId: row.id,
+            }, 1).then(() => {
+                this.visibleWork = false
+            })
+        },
         change(e, row, index, { prop, options }) {
             console.log(e, options)
             if (prop === 'dpCategory' && e !== 'Other') {
@@ -157,7 +186,7 @@
             return this
         },
         getDetailList(params) {
-            this.$HTTP.get(`/api/smart-collect/tpl/typelist`, {}, { params }).then(res => {
+            this.$HTTP.get(`/api/smis/collecttpl/typelist`, {}, { params }).then(res => {
 
                 this.typeList = res.data || [];
                 // return res
@@ -219,8 +248,8 @@
         //         )
         //     }
         // },
-        getList(params) {
-            this.$HTTP.get(`/api/smis/workstation/listDatapointsByWorkstationId`, {}, { params }).then(res => {
+        getList(params,isImport) {
+            return this.$HTTP.get(`/api/smis/workstation/listDatapointsByWorkstationId`, {}, { params }).then(res => {
                 try {
                     this.cols = JSON.parse(res.data.dpHead)
                     this.addOptions(this.cols)
@@ -236,7 +265,9 @@
                     this.tabledata = []
                 }
                 this.type = res.data.type
-                this.appId = res.data.appId
+                if (!isImport) {
+                    this.appId = res.data.appId
+                }
                 this.setAddTemp()
                 // return res
             })

--
Gitblit v1.9.3