From 6f817bf3ae4e6f51f982c07b0713adb3caf9fac2 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 02 二月 2023 17:14:16 +0800
Subject: [PATCH] 2023-02-02

---
 src/tabviews/custom/components/module/account/index.jsx |   30 +++++++++++++++++++++++-------
 1 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/src/tabviews/custom/components/module/account/index.jsx b/src/tabviews/custom/components/module/account/index.jsx
index 1a9a7b6..943e10d 100644
--- a/src/tabviews/custom/components/module/account/index.jsx
+++ b/src/tabviews/custom/components/module/account/index.jsx
@@ -3,8 +3,10 @@
 import { is, fromJS } from 'immutable'
 import { notification, Select, Divider } from 'antd'
 import { PlusOutlined } from '@ant-design/icons'
+import moment from 'moment'
 
 import Api from '@/api'
+import Utils from '@/utils/utils.js'
 import MKEmitter from '@/utils/events.js'
 import './index.scss'
 
@@ -39,7 +41,9 @@
 
   loadData = () => {
     let param = {
-      func: 's_get_fcc_book_data'
+      func: 's_get_fcc_book_data',
+      dataM: sessionStorage.getItem('dataM') === 'true' ? 'Y' : '',
+      mk_organization: sessionStorage.getItem('organization') || ''
     }
 
     Api.genericInterface(param).then(res => {
@@ -69,10 +73,6 @@
         return true
       })
 
-      if (!activeItem && books.length > 0) {
-        activeItem = books[0]
-      }
-
       this.setState({books, activeItem})
 
       if (activeItem) {
@@ -90,6 +90,22 @@
 
     if (activeItem) {
       MKEmitter.emit('resetSelectLine', this.props.config.uuid, activeItem.id, activeItem)
+      
+      let userid = sessionStorage.getItem('UserID') || ''
+      let sid = localStorage.getItem('SessionUid') || ''
+      let param = {
+        func: 'sPC_TableData_InUpDe',
+        LText: `delete  tmp_session_show_key where createuserid='${userid}' and createuser='${sid}' and key_type='fcc_years'
+          insert into tmp_session_show_key ( key_id,key_type,createuserid,CreateUser,CreateStaff) 
+          select '${activeItem.id}','fcc_years','${userid}','${sid}','${sessionStorage.getItem('Full_Name') || ''}'`,
+        exec_type: 'y'
+      }
+  
+      param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
+      param.secretkey = Utils.encrypt('', param.timestamp)
+      param.LText = Utils.formatOptions(param.LText)
+
+      Api.genericInterface(param)
     }
   }
 
@@ -132,11 +148,11 @@
           </div>
         )}>
           {books.map(item => (
-            <Option key={item.id}>{item.account_name}</Option>
+            <Option disabled={!item.months} key={item.id}>{item.account_name}</Option>
           ))}
         </Select> : <Select value={activeItem ? activeItem.id : ''} placeholder="璇烽�夋嫨璐﹀" onChange={this.changeBook}>
           {books.map(item => (
-            <Option key={item.id}>{item.account_name}</Option>
+            <Option disabled={!item.months} key={item.id}>{item.account_name}</Option>
           ))}
         </Select>}
         {activeItem ? <span className="date">{activeItem.date}</span> : null}

--
Gitblit v1.8.0