From 62b6a7fac3f2acde70b578431147c4a01f19c182 Mon Sep 17 00:00:00 2001
From: 黎星凯 <13949086503@163.com>
Date: 星期一, 15 四月 2024 09:07:05 +0800
Subject: [PATCH] bug修改

---
 admin-web/src/views/systemManger/org/edit.vue |   29 ++++++++++++++++++++++++++---
 1 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/admin-web/src/views/systemManger/org/edit.vue b/admin-web/src/views/systemManger/org/edit.vue
index 2ceda56..ea17d67 100644
--- a/admin-web/src/views/systemManger/org/edit.vue
+++ b/admin-web/src/views/systemManger/org/edit.vue
@@ -34,6 +34,7 @@
 import winSm from '@/components/win/win-sm'
 import myButton from '@/components/myButton/myButton'
 import * as finsystenant from '@/api/baseSetting/finsystenant'
+import {addTenant, editTenant} from "@/api/baseSetting/finsystenant";
 
 export default {
   components: {winSm, myButton},
@@ -53,6 +54,7 @@
         name: '',
         status: 1,
         summary: '',
+        parentId: '',
       },
       rules: {
         code: [
@@ -76,13 +78,34 @@
     close() {
       this.$emit('close')
     },
+    toNumber(str) {
+      const num = parseInt(str);
+      return isNaN(num) ? "0" : num;
+    },
     save() {
+      // 楠岃瘉缂栧彿鏄笉鏄�0寮�澶�
+      let code = this.formData.code;
+      let tempCode = this.toNumber(code)
+      console.log("鎷垮埌鐨刢ode  "+ code)
+      console.log("鎷垮埌杩斿洖鐨勭殑code  "+ tempCode)
+      if(this.toNumber(code) === "0"){
+        this.$message.error('缂栧彿蹇呴』涓烘暟瀛椾笖涓嶄互0寮�澶�')
+        return;
+      }
+      if(tempCode != code){
+        this.$message.error('缂栧彿蹇呴』涓烘暟瀛椾笖涓嶄互0寮�澶�')
+        return;
+      }
+      if(code.startsWith("0")){
+        this.$message.error('缂栧彿蹇呴』涓烘暟瀛椾笖涓嶄互0寮�澶�')
+        return;
+      }
       this.$refs.ruleForm.validate((valid) => {
         if (valid) {
           const params = Object.assign({}, this.formData)
           if(this.setting.id){
             // 缂栬緫鎺ュ彛
-            finsystenant.edit(params).then(res => {
+            finsystenant.editTenant(params).then(res => {
               if (res) {
                 this.$message.success('淇濆瓨鎴愬姛锛�')
                 this.close()
@@ -92,8 +115,8 @@
               }
             })
           }else{
-            params.orgId = this.setting.orgId
-            finsystenant.add(params).then(res => {
+            params.parentId = this.setting.orgId
+            finsystenant.addTenant(params).then(res => {
               if (res) {
                 this.$message.success('淇濆瓨鎴愬姛锛�')
                 this.close()

--
Gitblit v1.9.1