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);