From f70a0e277191fb362a2697b170565f303f3008a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= Date: Wed, 30 Aug 2023 16:54:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=87=E6=8D=A2=E4=BE=9B=E5=BA=94=E5=95=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/account/ChangeVendor.jsx | 113 +++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 src/views/account/ChangeVendor.jsx diff --git a/src/views/account/ChangeVendor.jsx b/src/views/account/ChangeVendor.jsx new file mode 100644 index 0000000..190eb71 --- /dev/null +++ b/src/views/account/ChangeVendor.jsx @@ -0,0 +1,113 @@ +import { useNavigate } from "react-router-dom"; +import { useEffect, useState, useRef } from "react"; +import { observer } from "mobx-react"; +import { Button, Space, Form, Input, Row, Typography, App,Select } from "antd"; +import { useStore } from "@/stores/StoreContext.js"; + +const { Title } = Typography; + +function ChangeVendor() { + const navigate = useNavigate(); + const { authStore,VendorList } = useStore(); + const { notification } = App.useApp(); + const [form] = Form.useForm(); + const { formVeiSn, onVeiSnChange } = useState(); + + + useEffect(() => { + authStore.fetchVendorList(); + },[]); + + //币种 + function bindVendor() { + + let arr=[]; + arr = authStore.VendorList.map((data,index) =>{ + return { + value: data.VEI_SN, + label: data.VEI2_CompanyBN, + } + }) + return arr; + + } + + const onFinish = (values) => { + if (values.VEISN == authStore.login.travelAgencyId){ + notification.error({ + message: `Notification`, + description: "切换的供应商是当前供应商.", + placement: "top", + duration: 4, + }); + return ; + } + // console.log(values); + // console.log(authStore.login.travelAgencyId); + + authStore.changeVendor(values.VEISN) + .then(()=>{ + authStore.logout(); + }) + .catch(()=>{ + //console.log(json); + notification.error({ + message: `Notification`, + description: "切换的供应商错误,请重试!", + placement: "top", + duration: 4, + }); + }) + }; + + const onFinishFailed = (errorInfo) => { + console.log("Failed:", errorInfo); + // form.resetFields(); + }; + + return ( + +
+ + Change your password + + + + + + + + + +
+
+ ); +} + +export default observer(ChangeVendor);