From 12b1901605e51506a0fde960a376eb8fc6b2a593 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期四, 07 三月 2024 08:57:03 +0800
Subject: [PATCH] 修改

---
 web/src/views/modules/basicInfo/SelectTyModel.vue |   46 ++++++++++++++++++++++++++++++++++++----------
 1 files changed, 36 insertions(+), 10 deletions(-)

diff --git a/web/src/views/modules/basicInfo/SelectTyModel.vue b/web/src/views/modules/basicInfo/SelectTyModel.vue
index fba603c..f290609 100644
--- a/web/src/views/modules/basicInfo/SelectTyModel.vue
+++ b/web/src/views/modules/basicInfo/SelectTyModel.vue
@@ -3,14 +3,13 @@
              @confirm="formSubmit">
     <el-card shadow="never" class="aui-card--fill">
       <div class="mod-tyProductModel-tyProductModel}">
-        <zt-table-wraper query-url="/basicInfo/TyProductModel/page"
+        <zt-table-wraper :query-url=url
                          v-slot="{ table }">
           <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()">
           </el-form>
           <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" v-adaptive="{bottomOffset:70}"
                     border
-                    @selection-change="table.selectionChangeHandle"
-                    @selected="onSelected">
+                    @selection-change="changeRow">
             <el-table-column type="selection" width="40" align="center"/>
             <el-table-column prop="name" label="鍚嶇О"/>
           </el-table>
@@ -25,30 +24,57 @@
     name: 'SelectTyModel',
     data() {
       return {
+        url:'/basicInfo/TyProductModel/page',
+        selectList: [],
+        data: '',
         dataForm: {
-          type:'noTree',
+          type: 'noTree',
           nodeType: '',
+          id: '',
           pid: '',
           name: '',
           operationalStatus: '',
           standbyState: '',
           faultState: '',
+          sort: ''
         }
       }
     },
     components: {},
     methods: {
-      init(type) {
-        this.dataForm.nodeType = type
-        console.log(this.dataForm.nodeType, 'init()')
+      init(id,params) {
+        this.dataForm.nodeType = params.type
+        this.dataForm.pid = params.id
+        this.data = params.data
+        if (this.data ==='expect'||this.data==='assign'){
+          this.url='/basicInfo/XhProductModel/page'
+        }
+        console.log(this.dataForm.pid, 'init()')
       },
-      async onSelected() {
-        let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/basicInfo/XhProductModel/', this.dataForm)
+      changeRow(selection) {
+        console.log(selection, ' changeRow(selection)')
+        let item = {}
+        for (item of selection) {
+          console.log(item)
+          item.pid = this.dataForm.pid
+        }
+        this.selectList = selection
+      },
+      async formSubmit() {
+        let res
+        if (this.data && this.data === 'expect'){
+          res = await this.$http.post('/basicInfo/ParamDataExpect/get', this.selectList)
+        }else if(this.data && this.data === 'assign') {
+            res = await this.$http.post('/basicInfo/ParamDataAssign/get', this.selectList)
+        }else
+        {
+           res = await this.$http.post('/basicInfo/XhProductModel/get', this.selectList)
+        }
+
         if (res.success) {
           await this.$tip.success()
           this.$refs.dialog.close()
           this.$emit('refreshDataList')
-          this.map.clear()
         }
       }
     }

--
Gitblit v1.9.1