From 91b24f0de889b647d581bf1d89ab94d93eb1f4fb Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 04 十二月 2024 21:15:03 +0800 Subject: [PATCH] 2024-12-04 --- src/tabviews/custom/components/module/voucher/resetAttach/addAttach/index.jsx | 4 ++-- src/tabviews/custom/components/module/voucher/resetAttach/documents/index.jsx | 18 ++++++++++++++---- src/tabviews/custom/components/module/voucher/resetAttach/index.jsx | 9 ++++----- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/tabviews/custom/components/module/voucher/resetAttach/addAttach/index.jsx b/src/tabviews/custom/components/module/voucher/resetAttach/addAttach/index.jsx index 2f1954d..c0770a2 100644 --- a/src/tabviews/custom/components/module/voucher/resetAttach/addAttach/index.jsx +++ b/src/tabviews/custom/components/module/voucher/resetAttach/addAttach/index.jsx @@ -131,8 +131,8 @@ message: '璇疯緭鍏ユ枃浠跺悕锛�' }, { - max: 50, - message: '鏈�澶ч暱搴︿负50浣嶏紒' + max: 100, + message: '鏈�澶ч暱搴︿负100浣嶏紒' } ] })(<Input />)} diff --git a/src/tabviews/custom/components/module/voucher/resetAttach/documents/index.jsx b/src/tabviews/custom/components/module/voucher/resetAttach/documents/index.jsx index ea36b1c..723db38 100644 --- a/src/tabviews/custom/components/module/voucher/resetAttach/documents/index.jsx +++ b/src/tabviews/custom/components/module/voucher/resetAttach/documents/index.jsx @@ -1,4 +1,5 @@ import React, {Component} from 'react' +import { fromJS } from 'immutable' class Documents extends Component { state = { @@ -7,9 +8,16 @@ } UNSAFE_componentWillMount() { - const { documents } = this.props + const { documents, list } = this.props - let actFolder = documents[0] || null + let actFolder = null + + if (documents[0]) { + actFolder = fromJS(documents[0]).toJS() + + let ids = list.map(item => item.id) + actFolder.attachments = actFolder.attachments.filter(doc => !ids.includes(doc.id)) + } this.setState({selectKey: [], actFolder: actFolder}) } @@ -31,15 +39,17 @@ } checkfolder = (id) => { - const { documents } = this.props + const { documents, list } = this.props const { actFolder } = this.state if (!actFolder || actFolder.id === id) return let _actFolder = null + let ids = list.map(item => item.id) documents.forEach(item => { if (item.id === id) { - _actFolder = item + _actFolder = fromJS(item).toJS() + _actFolder.attachments = _actFolder.attachments.filter(doc => !ids.includes(doc.id)) } }) diff --git a/src/tabviews/custom/components/module/voucher/resetAttach/index.jsx b/src/tabviews/custom/components/module/voucher/resetAttach/index.jsx index 652b60d..397eb76 100644 --- a/src/tabviews/custom/components/module/voucher/resetAttach/index.jsx +++ b/src/tabviews/custom/components/module/voucher/resetAttach/index.jsx @@ -202,7 +202,6 @@ docSubmit = () => { const { selectDocs, list } = this.state - if (selectDocs.length > 0 && list.length > 0) { let _list = fromJS(list).toJS() let err = '' @@ -241,7 +240,7 @@ title="娣诲姞闄勪欢" wrapClassName="voucher-attach-wrap" visible={visible} - width={700} + width={'62vw'} maskClosable={false} onOk={this.submit} onCancel={() => { this.setState({ visible: false })}} @@ -270,7 +269,7 @@ title="娣诲姞闄勪欢" wrapClassName="voucher-attach-add-wrap" visible={upVisible} - width={700} + width={'62vw'} maskClosable={false} onOk={this.upSubmit} onCancel={() => { this.setState({ upVisible: false })}} @@ -282,13 +281,13 @@ title="鐢靛瓙妗f" wrapClassName="voucher-attach-document-wrap" visible={docVisible} - width={700} + width={'62vw'} maskClosable={false} onOk={this.docSubmit} onCancel={() => { this.setState({ docVisible: false, selectDocs: [] })}} destroyOnClose > - {docVisible ? <Documents documents={documents} onChange={(vals) => this.setState({selectDocs: vals})}/> : null} + {docVisible ? <Documents documents={documents} list={list} onChange={(vals) => this.setState({selectDocs: vals})}/> : null} </Modal> </> ) -- Gitblit v1.8.0