增加部分管理人员的账号可以切换供应商功能,方便维护各供应商的内容。

release
赵鹏 2 years ago
parent 163346a32d
commit 1f6b69afc0

@ -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:<InvoiceDetail />},
{ path: "invoice/paid",element:<InvoicePaid />},
{ path: "invoice/paid/detail/:flid",element:<InvoicePaidDetail />},
{ path: "account/change-vendor",element:<ChangeVendor />},
]
},
{

@ -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

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

@ -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: <Link to="/account/change-password">Change password</Link>,
key: "0",
@ -30,6 +32,33 @@ const items = [
},
];
const item_manager =
[
{
label: <Link to="/account/change-password">Change password</Link>,
key: "0",
},
{
label: <Link to="/account/profile">Profile</Link>,
key: "1",
},
{
type: "divider",
},
{
label: <Link to="/login?out">Logout</Link>,
key: "3",
},
{
label:<Link to="/account/change-vendor">Change Vendor</Link>,
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');

Loading…
Cancel
Save