diff --git a/src/main.jsx b/src/main.jsx index 275bcf1..06ef9e0 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -25,6 +25,7 @@ import InvoiceIndex from "@/views/invoice/Index"; import InvoiceDetail from "@/views/invoice/Detail"; import InvoicePaid from "@/views/invoice/Paid"; import InvoicePaidDetail from "@/views/invoice/PaidDetail"; +import ChangeVendor from "@/views/account/ChangeVendor"; configure({ @@ -55,6 +56,7 @@ const router = createBrowserRouter([ { path: "invoice/detail/:GMDSN/:GSN",element:}, { path: "invoice/paid",element:}, { path: "invoice/paid/detail/:flid",element:}, + { path: "account/change-vendor",element:}, ] }, { diff --git a/src/stores/Auth.js b/src/stores/Auth.js index 4a8f7e8..7e49063 100644 --- a/src/stores/Auth.js +++ b/src/stores/Auth.js @@ -123,6 +123,52 @@ class Auth { }); } + //供应商列表 + fetchVendorList(){ + const authStore = this; + const fetchUrl = prepareUrl(HT_HOST + '/service-cusservice/PTGetHWVendorList') + .append('token', authStore.login.token) + .build(); + + return fetchJSON(fetchUrl) + .then(json => { + //console.log(json); + if (json.errcode == 0) { + runInAction(() => { + this.VendorList = json.Result; + }); + } + }); + } + + //切换供应商 + changeVendor(VEISN){ + // const formData = new FormData(); + // formData.append('VEI_SN',VEISN); + // formData.append('LMI_SN',this.login.userId); + // formData.append('token', this.login.token); + const fetchUrl = prepareUrl(HT_HOST+'/service-cusservice/PTChangeVendor') + .append('LMI_SN',this.login.userId) + .append('VEI_SN',VEISN) + .append('token', this.login.token) + .build(); + //console.log(fetchUrl); + // return false; + + return fetchJSON(fetchUrl) + .then(()=>{ + let json = {"errcode": 0, "errmsg": "ok", "Result":[]}; + if (json.errcode==0){ + //console.log(json); + return json; + }else{ + throw new Error(json.errmsg+":"+json.errcode); + } + }); + } + + VendorList = [];//海外供应商列表 + login = { token: '', userId: 0, // LMI_SN diff --git a/src/stores/Invoice.js b/src/stores/Invoice.js index 6358b51..f70eff5 100644 --- a/src/stores/Invoice.js +++ b/src/stores/Invoice.js @@ -39,7 +39,7 @@ class Invoice { const fetchUrl = prepareUrl(HT_HOST + "/service-cusservice/PTSearchGMBPageList") .append("VEI_SN", VEI_SN) .append("OrderType", 0) - .append("GroupNo", GroupNo) + .append("GroupNo", GroupNo.trim()) .append("DateStart", DateStart) .append("DateEnd", DateEnd) .append("Orderbytype", 1) diff --git a/src/views/App.jsx b/src/views/App.jsx index 65c1819..e690039 100644 --- a/src/views/App.jsx +++ b/src/views/App.jsx @@ -12,7 +12,9 @@ import { useStore } from "@/stores/StoreContext.js"; const { Header, Content, Footer } = Layout; const { Title } = Typography; -const items = [ +let items = []; + +const items_default = [ { label: Change password, key: "0", @@ -30,6 +32,33 @@ const items = [ }, ]; +const item_manager = +[ + { + label: Change password, + key: "0", + }, + { + label: Profile, + key: "1", + }, + { + type: "divider", + }, + { + label: Logout, + key: "3", + }, + { + label:Change Vendor, + key:"4", + }, +]; + + + + + function App() { const [password, setPassword] = useState(''); const { authStore, noticeStore } = useStore(); @@ -41,6 +70,14 @@ function App() { const navigate = useNavigate(); const location = useLocation(); + const arrManager = ["testzp","testzac","testycc","testlyj","testqqs","testjjh","testhn"];//特定账号加修改所属供应商的菜单 zp + if (arrManager.includes(authStore.login.username)){ + items = item_manager; + }else{ + items = items_default; + } + + useEffect(() => { if (href !== '/login' && isEmpty(loginToken)) { navigate('/login');