From 1e9fa82cb2fe2c15f46bd1dd73f5c878c74b83b8 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期四, 04 八月 2022 15:35:50 +0800
Subject: [PATCH] 1.系统多账号登录问题2.采购订单页面样式修改及数据渲染

---
 src/views/jcsz/zzjg.vue |   77 ++++++++++++++++++++------------------
 1 files changed, 41 insertions(+), 36 deletions(-)

diff --git a/src/views/jcsz/zzjg.vue b/src/views/jcsz/zzjg.vue
index 20be7ef..c222506 100644
--- a/src/views/jcsz/zzjg.vue
+++ b/src/views/jcsz/zzjg.vue
@@ -48,7 +48,7 @@
           stripe
           :style="{width: 100+'%',height:tableHeight+'px'}"
           highlight-current-row
-          :height="tableHeight"
+          :height="tableHeight+'px'"
           :header-cell-style="this.$headerCellStyle"
           :cell-style="this.$cellStyle"
           @sort-change="sortChange"
@@ -62,46 +62,59 @@
             prop="RowNum"
             width="50"
             label="搴忓彿"
+            fixed
           />
           <el-table-column
             prop="org_code"
             label="缁勭粐缂栫爜"
             sortable="custom"
+            min-width="110"
           />
           <el-table-column
             prop="org_name"
             label="缁勭粐鍚嶇О"
             sortable="custom"
+            min-width="110"
           />
           <el-table-column
             prop="description"
             label="缁勭粐绫诲瀷"
+            width="110"
             sortable="custom"
           >
             <template slot-scope="{row}">
-              <div v-if="row.description==='F'">宸ュ巶</div>
+              <!--              <div v-if="row.description==='F'">宸ュ巶</div>-->
               <div v-if="row.description==='D'">閮ㄩ棬</div>
               <div v-if="row.description==='W'">杞﹂棿</div>
-              <div v-if="row.description==='K'">绉戝</div>
-              <div v-if="row.description==='L'">鐢熶骇绾�</div>
+              <!--              <div v-if="row.description==='K'">绉戝</div>-->
+              <!--              <div v-if="row.description==='L'">鐢熶骇绾�</div>-->
             </template>
           </el-table-column>
           <el-table-column
             prop="parentorg_name"
             label="涓婄骇鍗曚綅"
             sortable="custom"
-          />
+            min-widt="110"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.parentorg_name===null">/</div>
+              <div v-else>{{ row.parentorg_name }}</div>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="lm_user"
             label="鍒涘缓浜哄憳"
+            width="110"
             sortable="custom"
           />
           <el-table-column
             prop="lm_date"
             label="鍒涘缓鏃堕棿"
+            width="160"
             sortable="custom"
           />
           <el-table-column
+            fixed="right"
             label="鎿嶄綔"
           >
             <template slot-scope="{row}">
@@ -139,6 +152,7 @@
         <el-form-item label="缁勭粐绫诲瀷" prop="OrgType">
           <el-radio-group
             v-model="dialogForm.OrgType"
+            :disabled="operation==='edit'"
             @change="changeRadio"
           >
             <el-radio
@@ -155,7 +169,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="dialogForm.OrgType!=='閮ㄩ棬'" prop="SupUnit" label="涓婄骇鍗曚綅">
           <el-select
             v-model="dialogForm.SupUnit"
             style="width: 200px"
@@ -186,11 +200,10 @@
 import Pagination from '@/components/Pagination'
 import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/jcsz'
 import { getCookie } from '@/utils/auth'
-import { getNewEncodingRules } from '@/utils/global'
 
 const SER_HZ = /^[\u4e00-\u9fa5]+$/
 export default {
-  name: 'Zzjg',
+  name: 'ZZJG',
   components: {
     Pagination
   },
@@ -230,24 +243,23 @@
         rows: 20 // 姣忛〉澶氬皯鏉�
       },
       OrgTypeArr: [
-        { label: '宸ュ巶', value: 'F' },
+        // { label: '宸ュ巶', value: 'F' },
         { label: '閮ㄩ棬', value: 'D' },
-        { label: '杞﹂棿', value: 'W' },
-        { label: '绉戝', value: 'K' },
-        { label: '鐢熶骇绾�', value: 'L' }
+        { label: '杞﹂棿', value: 'W' }
+        // { label: '绉戝', value: 'K' },
+        // { label: '鐢熶骇绾�', value: 'L' }
       ],
 
       total: 10,
       tableData: [],
       dialogVisible: false,
       dialogForm: {
-        OrgType: '',
+        OrgType: '閮ㄩ棬',
         OrgCode: '',
         OrgName: '',
         SupUnit: ''// 涓婄骇鍗曚綅
       },
       SupUnitArr: [],
-      dialogFormOrgTypeSelected: '',
       operation: '',
       dialogFormRules: {
         OrgType: [
@@ -332,18 +344,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') {
-        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
       }
     },
@@ -361,17 +363,19 @@
     edit(operation, row) {
       this.operation = operation
       this.dialogVisible = true
-      if (row.description === 'F') {
-        this.dialogForm.OrgType = '宸ュ巶'
-      } else if (row.description === 'D') {
+      // if (row.description === 'F') {
+      //   this.dialogForm.OrgType = '宸ュ巶'
+      // } else
+      if (row.description === 'D') {
         this.dialogForm.OrgType = '閮ㄩ棬'
       } else if (row.description === 'W') {
         this.dialogForm.OrgType = '杞﹂棿'
-      } else if (row.description === 'K') {
-        this.dialogForm.OrgType = '绉戝'
-      } else if (row.description === 'L') {
-        this.dialogForm.OrgType = '鐢熶骇绾�'
       }
+      // else if (row.description === 'K') {
+      //   this.dialogForm.OrgType = '绉戝'
+      // } else if (row.description === 'L') {
+      //   this.dialogForm.OrgType = '鐢熶骇绾�'
+      // }
       this.$nextTick(() => {
         this.changeRadio(this.dialogForm.OrgType)
         this.dialogForm.OrgCode = row.org_code
@@ -398,7 +402,7 @@
     },
     // 瀵硅瘽妗嗗叧闂簨浠�
     handleClose() {
-      this.dialogForm.OrgType = ''
+      this.dialogForm.OrgType = '閮ㄩ棬'
       this.dialogForm.OrgCode = ''
       this.dialogForm.OrgName = ''
       this.dialogForm.SupUnit = ''
@@ -413,17 +417,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.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