From 6d41203724ed358d0a4a356a393ab673a82c6df6 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期五, 08 三月 2024 11:43:33 +0800
Subject: [PATCH] 修改

---
 web/src/views/modules/basicInfo/ParamData.vue |   54 +++++++++++++++++++++++++++++++++---------------------
 1 files changed, 33 insertions(+), 21 deletions(-)

diff --git a/web/src/views/modules/basicInfo/ParamDataExpect.vue b/web/src/views/modules/basicInfo/ParamData.vue
similarity index 91%
rename from web/src/views/modules/basicInfo/ParamDataExpect.vue
rename to web/src/views/modules/basicInfo/ParamData.vue
index 371f0a8..0f5bdd5 100644
--- a/web/src/views/modules/basicInfo/ParamDataExpect.vue
+++ b/web/src/views/modules/basicInfo/ParamData.vue
@@ -8,10 +8,11 @@
       </el-col>
       <el-col :span="19">
         <div class="mod-basicInfo-paramDataExpect}">
-          <zt-table-wraper ref="tableObj" query-url="/basicInfo/ParamDataExpect/page"
-                           delete-url="/basicInfo/ParamDataExpect/"
+          <zt-table-wraper ref="tableObj" :query-url=queryUrl
+                           :delete-url=deleteUrl
                            @dataLoaded="dataLoaded"
-                           v-slot="{ table }">
+                           v-slot="{ table }"
+                           :paging='false'>
             <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()">
               <el-form-item>
                 <el-input v-model="dataForm.name" placeholder="璇疯緭鍏ュ悕绉�" clearable></el-input>
@@ -50,7 +51,7 @@
               </el-table-column>
               <el-table-column v-if="dataForm.nodeType==='2'" :key="5" label="鍩烘湰鍙潬鎬ц绠�">
                 <!--                <zt-table-column-dict prop="joinCompute" :keys="6" label="鍙傚姞璁$畻" width="100" dict="is_or_not"/>-->
-                <el-table-column prop="joinCompute" label="鍙傚姞璁$畻" :key="6"  width="100">
+                <el-table-column prop="joinCompute" label="鍙傚姞璁$畻" :key="6" width="100">
                   <template v-slot="{ row }">
                     <el-select v-if="row.isEdit" v-model="row.joinCompute"
                                placeholder="鍙傚姞璁$畻">
@@ -60,7 +61,8 @@
                                  :value="item.value">
                       </el-option>
                     </el-select>
-                    <zt-dict-tag dict="is_or_not" :value="row.joinCompute" :typeS="typeS" :typeI="typeI" :typeD="typeD"
+                    <zt-dict-tag v-else dict="is_or_not" :value="row.joinCompute" :typeS="typeS" :typeI="typeI"
+                                 :typeD="typeD"
                                  :typeColor="typeColor" :size="size" :effect="effect" :hit="hit"/>
                   </template>
                 </el-table-column>
@@ -165,7 +167,8 @@
                                  :value="item.value">
                       </el-option>
                     </el-select>
-                    <zt-dict-tag dict="is_or_not" :value="row.repairable" :typeS="typeS" :typeI="typeI" :typeD="typeD"
+                    <zt-dict-tag v-else dict="is_or_not" :value="row.repairable" :typeS="typeS" :typeI="typeI"
+                                 :typeD="typeD"
                                  :typeColor="typeColor" :size="size" :effect="effect" :hit="hit"/>
                   </template>
                 </el-table-column>
@@ -180,7 +183,8 @@
                                  :value="item.value">
                       </el-option>
                     </el-select>
-                    <zt-dict-tag dict="RepairDistribType" :value="row.repairDistribType" :typeS="typeS" :typeI="typeI"
+                    <zt-dict-tag v-else dict="RepairDistribType" :value="row.repairDistribType" :typeS="typeS"
+                                 :typeI="typeI"
                                  :typeD="typeD" :typeColor="typeColor" :size="size" :effect="effect" :hit="hit"/>
                   </template>
                 </el-table-column>
@@ -200,7 +204,8 @@
 
               <!--  <zt-table-column-dict v-if="dataForm.nodeType==='2'" :key="27" prop="reliabDistribType" label="鍙潬鎬у垎甯冪被鍨�"
                                       width="160"/>-->
-              <el-table-column v-if="dataForm.nodeType==='2'" prop="reliabDistribType" label="鍙潬鎬у垎甯冪被鍨�" :key="27" width="160">
+              <el-table-column v-if="dataForm.nodeType==='2'" prop="reliabDistribType" label="鍙潬鎬у垎甯冪被鍨�" :key="27"
+                               width="160">
                 <template v-slot="{ row }">
                   <el-select v-if="row.isEdit" v-model="row.reliabDistribType"
                              placeholder="褰撳墠鐘舵��">
@@ -232,7 +237,6 @@
 
             </el-table>
             <!-- 寮圭獥, 鏂板 / 淇敼 -->
-            <add-or-update ref="AddOrUpdate" @refreshDataList="table.query"/>
             <select-ty-model @refreshDataList="table.query" ref="SelectTyModel"/>
           </zt-table-wraper>
         </div>
@@ -242,13 +246,15 @@
 </template>
 
 <script>
-  import AddOrUpdate from './ParamDataExpect-AddOrUpdate'
   import ProductModelTree from "./ProductModelTree";
   import SelectTyModel from "./SelectTyModel";
 
   export default {
     data() {
       return {
+        queryUrl: '/basicInfo/ParamDataExpect/page',
+        deleteUrl: '/basicInfo/ParamDataExpect',
+        pageCode: '',
         key: '',
         typeS: '',
         typeI: '',
@@ -259,6 +265,7 @@
         effect: '',
         hit: false,
         dataForm: {
+          pageCode: this.$route.query.pageCode,
           id: '',
           pid: '',
           srcId: '',
@@ -298,23 +305,36 @@
       }
     },
     components: {
-      AddOrUpdate,
       ProductModelTree,
       SelectTyModel
+    },
+    mounted() {
+      this.pageCode = this.$route.query.pageCode
+      this.dataForm.pageCode = this.$route.query.pageCode
+      if (this.pageCode === 'assign') {
+        this.queryUrl = '/basicInfo/ParamDataAssign/page'
+        this.deleteUrl = '/basicInfo/ParamDataAssign'
+      }
+      console.log(this.pageCode, 'this.pageCode this.pageCode')
     },
     methods: {
       add() {
         this.$refs.SelectTyModel.$refs.dialog.init(null, {
           type: this.dataForm.nodeType - 1,
           id: this.dataForm.id,
-          data: 'expect'
+          pageCode: this.pageCode
         })
       },
       //鎵归噺淇濆瓨
       async handleSaveRows() {
         this.dataForm.dataThreeList = this.$refs.tableObj.dataList
         console.log(this.dataForm, 'this.dataForm this.dataForm')
-        let res = await this.$http.post('/basicInfo/ParamDataExpect/save', this.dataForm)
+        let res
+        if (this.pageCode === 'Expect') {
+          res = await this.$http.post('/basicInfo/ParamDataExpect/save', this.dataForm)
+        } else {
+          res = await this.$http.post('/basicInfo/ParamDataAssign/save', this.dataForm)
+        }
         if (res.success) {
           console.log(res.data)
           await this.$tip.success()
@@ -351,14 +371,6 @@
       //   })
       //   console.log(this.editingCell, 'this.editingCell')
       // },
-      update(row) {
-        console.log(row, 'update')
-        this.$refs.AddOrUpdate.$refs.dialog.init(row.id, {
-          type: this.dataForm.nodeType,
-          name: row.name,
-          productId: row.productId
-        })
-      },
       onProductSelected(data) {
         this.dataForm.srcId = data.id
         this.dataForm.nodeType = data.nodeType

--
Gitblit v1.9.1