From b5aa2c49f7a801de9af91eec71e339ff6d2781bb Mon Sep 17 00:00:00 2001
From: jiaosong <jiaosong6760@dingtalk.com>
Date: 星期二, 19 九月 2023 14:55:24 +0800
Subject: [PATCH] #联调修改

---
 company_admin/src/components/business/OperaCategoryWindow.vue |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/company_admin/src/components/business/OperaCategoryWindow.vue b/company_admin/src/components/business/OperaCategoryWindow.vue
index 89cde75..decc097 100644
--- a/company_admin/src/components/business/OperaCategoryWindow.vue
+++ b/company_admin/src/components/business/OperaCategoryWindow.vue
@@ -9,7 +9,7 @@
       <h3 style="margin: 20px 0 10px 0;">鍩烘湰淇℃伅</h3>
       <el-form :model="form" ref="form" :rules="rules">
         <el-form-item label="绫诲埆鏉ユ簮" prop="type">
-          <el-radio-group v-model="form.type" @change="changeRadio">
+          <el-radio-group v-model="form.type" :disabled="form.id ? true : false" @change="changeRadio">
             <el-radio :label="1">浠庡钩鍙板簱閫夋嫨</el-radio>
             <el-radio :label="0">浼佷笟鑷缓</el-radio>
           </el-radio-group>
@@ -65,6 +65,7 @@
                 v-model="scope.row.isselect"
                 active-color="#13ce66"
                 inactive-color="#ff4949"
+                @change="changeIsselect($event, scope.row)"
                 :active-value="1"
                 :inactive-value="0">
               </el-switch>
@@ -133,7 +134,7 @@
   <script>
   import BaseOpera from '@/components/base/BaseOpera'
   import GlobalWindow from '@/components/common/GlobalWindow'
-  import { create, updateById, baseCategoryList, companyCreate, companyUpdateById } from '@/api/business/category.js'
+  import { baseCategoryList, companyCreate, companyUpdateById } from '@/api/business/category.js'
   export default {
     name: 'OperaCategoryWindow',
     extends: BaseOpera,
@@ -187,6 +188,18 @@
       })
     },
     methods: {
+      changeIsselect(e, item) {
+        let num = 0
+        this.form.tableData.forEach(row => {
+          if (row.isselect === 1) {
+            num += 1
+          }
+        })
+        if (num > 2) {
+          item.isselect = 0
+          this.$message.warning({ message: '鍙兘璁剧疆涓や釜閫夐」' })
+        }
+      },
       addItem() {
         this.form.tableData.push({ name: '', isselect: 0, isshow: 1 })
       },
@@ -264,7 +277,7 @@
             this.form.sortnum = item.sortnum
             let arr = []
             item.baseCateParamList.forEach((row, index) => {
-              arr.push({ name: row.name, isselect: index <= 1 ? 1 : 0, isshow: 1 })
+              arr.push({ name: row.name, baseCateParamId: row.id, isselect: index <= 1 ? 1 : 0, isshow: 1 })
             })
             this.form.tableData = arr
             this.form.imgurl = item.imgurl

--
Gitblit v1.9.3