From d71436544198b7b051115662fc9cf4b12ce0cda3 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 19 七月 2022 18:32:40 +0800
Subject: [PATCH] 1.修改bug

---
 src/views/jcsz/zzjg.vue |   30 +++++++++---------------------
 1 files changed, 9 insertions(+), 21 deletions(-)

diff --git a/src/views/jcsz/zzjg.vue b/src/views/jcsz/zzjg.vue
index d6cecf4..c2c86f4 100644
--- a/src/views/jcsz/zzjg.vue
+++ b/src/views/jcsz/zzjg.vue
@@ -144,6 +144,7 @@
         <el-form-item label="缁勭粐绫诲瀷" prop="OrgType">
           <el-radio-group
             v-model="dialogForm.OrgType"
+            :disabled="operation==='edit'"
             @change="changeRadio"
           >
             <el-radio
@@ -160,8 +161,7 @@
         <el-form-item label="缁勭粐鍚嶇О" prop="OrgName">
           <el-input v-model="dialogForm.OrgName" style="width: 200px" />
         </el-form-item>
-        <!--        <el-form-item v-if="dialogFormOrgTypeSelected!=='F'" prop="SupUnit" label="涓婄骇鍗曚綅">-->
-        <el-form-item v-if="dialogFormOrgTypeSelected!=='D'" prop="SupUnit" label="涓婄骇鍗曚綅">
+        <el-form-item v-if="dialogForm.OrgType!=='閮ㄩ棬'" prop="SupUnit" label="涓婄骇鍗曚綅">
           <el-select
             v-model="dialogForm.SupUnit"
             style="width: 200px"
@@ -247,13 +247,12 @@
       tableData: [],
       dialogVisible: false,
       dialogForm: {
-        OrgType: '',
+        OrgType: '閮ㄩ棬',
         OrgCode: '',
         OrgName: '',
         SupUnit: ''// 涓婄骇鍗曚綅
       },
       SupUnitArr: [],
-      dialogFormOrgTypeSelected: '',
       operation: '',
       dialogFormRules: {
         OrgType: [
@@ -338,19 +337,8 @@
     },
     // 鍗曢�夋鏀瑰彉鏃�
     async changeRadio(val) {
-      if (val.length > 1) {
-        this.OrgTypeArr.forEach(item => {
-          if (item.label === val) {
-            this.dialogFormOrgTypeSelected = item.value
-          }
-        })
-        this.dialogForm.SupUnit = ''
-      } else {
-        this.dialogFormOrgTypeSelected = val
-      }
-      // if (this.dialogFormOrgTypeSelected !== 'F') {
-      if (this.dialogFormOrgTypeSelected !== 'D') {
-        const { data: res } = await PrentOrganization({ orgcode: this.dialogFormOrgTypeSelected })
+      if (this.dialogForm.OrgType !== '閮ㄩ棬') {
+        const { data: res } = await PrentOrganization({ orgcode: this.OrgTypeArr.find(item => item.label === this.dialogForm.OrgType).value })
         this.SupUnitArr = res
       }
     },
@@ -407,7 +395,7 @@
     },
     // 瀵硅瘽妗嗗叧闂簨浠�
     handleClose() {
-      this.dialogForm.OrgType = ''
+      this.dialogForm.OrgType = '閮ㄩ棬'
       this.dialogForm.OrgCode = ''
       this.dialogForm.OrgName = ''
       this.dialogForm.SupUnit = ''
@@ -422,18 +410,18 @@
       this.$refs.dialogForm.validate(valid => {
         if (valid) {
           const data = {
-            OrganType: this.dialogFormOrgTypeSelected,
+            OrganType: this.dialogForm.OrgType === '閮ㄩ棬' ? 'D' : 'W',
             OrganCode: this.dialogForm.OrgCode,
             OrganName: this.dialogForm.OrgName,
             RightCode: '',
             numvalue: '',
             // RightCode: this.operation === 'add' ? getCookie('ruleCode') : '',
             // numvalue: this.operation === 'add' ? this.numvalue : '',
-            // SupUnit: this.dialogFormOrgTypeSelected === 'F' ? '0' : this.dialogForm.SupUnit,
-            SupUnit: this.dialogFormOrgTypeSelected === 'D' ? '0' : this.dialogForm.SupUnit,
+            SupUnit: this.dialogForm.OrgType === '閮ㄩ棬' ? '0' : this.dialogForm.SupUnit,
             OperType: this.operation === 'add' ? 'Add' : 'Update',
             Operator: getCookie('admin')
           }
+
           AddUpdateOrganization(data).then(res => {
             if (res.code === '200') {
               this.$message.success(this.operation === 'add' ? '娣诲姞鎴愬姛锛�' : '淇敼鎴愬姛锛�')

--
Gitblit v1.9.3