From b4e22647ccc848c36cdd51b3fef1c2905285f7c6 Mon Sep 17 00:00:00 2001 From: zhangds Date: Wed, 13 Apr 2022 16:09:41 +0800 Subject: [PATCH] =?UTF-8?q?1=EF=BC=89=20=E5=A2=9E=E5=8A=A0=20=E5=88=86?= =?UTF-8?q?=E9=94=80=E5=95=86=20=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UseLazyLoadingSelect/index.js | 2 ++ src/pages/distributor/add/add.js | 1 + .../adddistributorinfo/adddistributorinfo.js | 10 +++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/UseLazyLoadingSelect/index.js b/src/components/UseLazyLoadingSelect/index.js index 5f8d5278..6063c127 100644 --- a/src/components/UseLazyLoadingSelect/index.js +++ b/src/components/UseLazyLoadingSelect/index.js @@ -9,6 +9,7 @@ const UseLazyLoadingSelect = ({ onChange, width, onChangePage, + disabled = false, }) => { let firstOpen = true; const [loading, setLoading] = useState(true); @@ -70,6 +71,7 @@ const UseLazyLoadingSelect = ({ width={width} loading={loading} open={open} + disabled={disabled} onOpenChange={handleOpenChange} renderOptionList={renderOptionList} /> diff --git a/src/pages/distributor/add/add.js b/src/pages/distributor/add/add.js index a3ecf89f..3be90509 100644 --- a/src/pages/distributor/add/add.js +++ b/src/pages/distributor/add/add.js @@ -75,6 +75,7 @@ export default class acclist extends React.Component { delete data.email2; delete data.email3; delete data.email4; + data.direct_reseller_id = formInfo.direct_reseller_id.key; if (_this.state.enumer == 0) { postCreateReseller(data) .then((res) => { diff --git a/src/pages/distributor/adddistributorinfo/adddistributorinfo.js b/src/pages/distributor/adddistributorinfo/adddistributorinfo.js index 52d5c5d1..688b36e6 100644 --- a/src/pages/distributor/adddistributorinfo/adddistributorinfo.js +++ b/src/pages/distributor/adddistributorinfo/adddistributorinfo.js @@ -44,6 +44,7 @@ export default class adduserinfo extends React.Component { phoneSwitch: [false, false, false, false], emailSwitch: [false, false, false, false], defaultFileList: [{ src: "" }], //默认回显头像,//默认回显头像 + isSelectDirect: false, model: { //数据模型不可少 name: "", @@ -147,6 +148,7 @@ export default class adduserinfo extends React.Component { { type: "required", message: "请输入联系人邮箱" }, // { type: "regExp", message: "联系人邮箱格式不对",reg:"^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$"} ], + direct_reseller_id: [{ type: "required", message: "请选择映射分销商" }], }, companyList: [], directList: [], @@ -179,7 +181,7 @@ export default class adduserinfo extends React.Component { }); } - componentDidMount(e) { + componentDidMount() { let params = { limit: this.state.limit, page: this.state.page, @@ -387,6 +389,10 @@ export default class adduserinfo extends React.Component { text: reselData.salesman_name, }, subject: reselData.subject, + direct_reseller_id: { + key: formInfo.direct_reseller_id, + text: formInfo.direct_reseller_name, + }, }; let phoneTo = reselData.contact_phone; @@ -421,6 +427,7 @@ export default class adduserinfo extends React.Component { email_nums: emailTo.length, model: data, disabled: true, + isSelectDirect: true, defaultFileList: [img], id: reselData.id, headImg: reselData.head_img, @@ -1128,6 +1135,7 @@ export default class adduserinfo extends React.Component { placeholder="请选择映射分销商" value={this.state.model.direct_reseller_id} onChangePage={this.onChangePageSelect.bind(this)} + disabled={this.state.isSelectDirect} onChange={(e) => { this.onDirectChange(e); Bus.emit("change", "direct_reseller_id", e);