Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
confucius
Commits
63b352e1
Commit
63b352e1
authored
Dec 23, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
953eec94
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
66 deletions
+15
-66
erpindex.js
src/utils/erpindex.js
+15
-66
No files found.
src/utils/erpindex.js
View file @
63b352e1
...
...
@@ -68,8 +68,8 @@ export default {
}
return
pwd
;
},
//ERP本地缓存
Vue
.
prototype
.
md5
=
md5
;
Vue
.
prototype
.
md5
=
md5
;
//ERP本地缓存
Vue
.
prototype
.
getLocalStorage
=
function
()
{
var
localStorageData
=
window
.
localStorage
[
"loginUserInfo"
];
if
(
localStorageData
!==
undefined
&&
localStorageData
!=
'undefined'
)
{
...
...
@@ -80,24 +80,19 @@ export default {
},
//域名管理对象
Vue
.
prototype
.
domainManager
=
function
()
{
let
domainUrl
=
''
;
let
mallUrl
=
""
;
//商城API
let
domainUrl
=
'http://192.168.1.13:8083'
;
let
uploadUrl
=
"http://192.168.1.214:8120"
;
//上传文件站点
let
imgFileUrl
=
"http://192.168.1.214:8130"
;
//文件预览站点
let
locationName
=
window
.
location
.
hostname
;
// domainUrl = "http://127.0.0.1";
domainUrl
=
"http://192.168.1.13:8083"
;
// domainUrl = "http://192.168.1.48:8015";
//domainUrl = "http://192.168.1.21:8069";
let
javaUrldo
=
""
;
javaUrldo
=
locationName
.
indexOf
(
'oytour'
)
!==
-
1
||
locationName
.
indexOf
(
'viitto'
)
!==
-
1
?
(
locationName
.
indexOf
(
'oytour'
)
!==
-
1
?
"http://efficient.oytour.com"
:
"http://47.96.12.235:9001"
)
:
"http://192.168.2.215:9000"
;
//商城API
mallUrl
=
"http://192.168.1.21:8014"
;
if
(
locationName
.
indexOf
(
'testerp.oytour'
)
!==
-
1
)
{
domainUrl
=
"http://testapi.oytour.com"
;
mallUrl
=
"https://mallapi.oytour.com"
;
uploadUrl
=
"http://upload.oytour.com"
;
imgFileUrl
=
"http://imgfile.oytour.com"
;
}
else
if
(
locationName
.
indexOf
(
'oytour'
)
!==
-
1
)
{
domainUrl
=
"http://reborn.oytour.com"
;
mallUrl
=
"https://mallapi.oytour.com"
;
uploadUrl
=
"http://upload.oytour.com"
;
imgFileUrl
=
"http://imgfile.oytour.com"
;
}
var
obj
=
{
//主地址
...
...
@@ -108,32 +103,21 @@ export default {
UploadFileUrl
:
domainUrl
+
'/api/File/post'
,
//本站模板文件下载地址
LocalTemplateFileDownLoadUrl
:
domainUrl
,
//酒店接口
HotelApi
:
"http://reborn.oytour.com/api/common/post"
,
//阿里服务器地址
AliUrl
:
"https://reborndev.oss-cn-hangzhou.aliyuncs.com"
,
//本站文件流下载地址
LocalFileStreamDownLoadUrl
:
domainUrl
+
"/api/file/GetFileFromWebApi"
,
//PDF文件预览地址
PDFViewUrl
:
domainUrl
+
"/plug/pdf/web/viewer.html?file="
,
//SocketUrl
WebSocketUrl
:
"ws://192.168.1.110:8080?account="
,
//google地图图片地址
GoogleMapImageUrl
:
"http://imgfile.oytour.com"
,
//上传站点
UploadUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
||
locationName
.
indexOf
(
'viitto'
)
!==
-
1
?
"http://upload.oytour.com"
:
"http://192.168.1.214:8120"
,
UploadUrl
:
uploadUrl
,
//文件站点
ViittoFileUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
||
locationName
.
indexOf
(
'viitto'
)
!==
-
1
?
"http://imgfile.oytour.com"
:
'http://192.168.1.214:8130'
,
javaUrl
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
||
locationName
.
indexOf
(
'viitto'
)
!==
-
1
?
(
locationName
.
indexOf
(
'oytour'
)
!==
-
1
?
"http://efficient.oytour.com"
:
"http://47.96.12.235:9001"
)
:
"http://192.168.2.17:8087"
,
javaUrlNew
:
locationName
.
indexOf
(
'oytour'
)
!==
-
1
||
locationName
.
indexOf
(
'viitto'
)
!==
-
1
?
(
locationName
.
indexOf
(
'oytour'
)
!==
-
1
?
"http://property.oytour.com"
:
"http://47.96.12.235:9001"
)
:
"http://192.168.2.17:8087"
,
//Java接口本站文件流下载地址
JavaLocalFileStreamDownLoadUrl
:
javaUrldo
,
mallUrl
:
mallUrl
,
ViittoFileUrl
:
imgFileUrl
,
};
return
obj
;
},
//ERP系统文件下载
Vue
.
prototype
.
GetLocalFile
=
function
(
cmd
,
msg
,
fileName
,
successCall
)
{
Vue
.
prototype
.
Get
Erp
LocalFile
=
function
(
cmd
,
msg
,
fileName
,
successCall
)
{
var
apiurl
=
this
.
domainManager
().
LocalFileStreamDownLoadUrl
;
var
timestamp
=
(
new
Date
()).
valueOf
();
var
token
=
""
;
...
...
@@ -170,6 +154,7 @@ export default {
successCall
(
res
);
}).
catch
(
function
(
res
)
{});
},
//HTTP提交数据
Vue
.
prototype
.
apipost
=
function
(
cmd
,
msg
,
successCall
,
faildCall
,
isOnline
)
{
if
(
msg
==
null
||
msg
==
""
)
{
...
...
@@ -186,17 +171,14 @@ export default {
var
timestamp
=
(
new
Date
()).
valueOf
();
var
apiurl
=
this
.
domainManager
().
PostUrl
;
this
.
apiurl
=
apiurl
;
var
branchId
=
tokenData
.
data
.
School_Id
;
var
departmentId
=
1
;
var
departmentName
=
1
;
var
groupName
=
tokenData
.
data
.
GroupName
;
var
branchName
=
tokenData
.
data
.
SchoolName
;
var
uName
=
tokenData
.
data
.
AccountName
;
var
encodeMsg
=
encodeURIComponent
(
JSON
.
stringify
(
msg
)).
toLowerCase
();
var
md5Str
=
md5
(
`cmd=
${
cmd
}
&msg=
${
encodeMsg
}
×tamp=
${
timestamp
}
&token=
${
token
}
&key=
${
key
}
`
);
var
postData
=
{
"msg"
:
msg
,
"cmd"
:
cmd
,
...
...
@@ -229,38 +211,6 @@ export default {
},
faildCall
)
},
Vue
.
prototype
.
uploadFile
=
function
(
path
,
files
,
successCall
)
{
if
(
files
&&
files
.
length
>
0
)
{
let
nameList
=
new
Array
()
for
(
let
index
=
0
;
index
<
files
.
length
;
index
++
)
{
nameList
.
push
(
this
.
random_string
());
}
var
oss
=
new
OSS
({
region
:
'oss-cn-chengdu'
,
accessKeyId
:
'LTAIwE7l9dImZSa3'
,
accessKeySecret
:
'j47Ajn0d0WzUCIX8Biyj3P2r8QDltI'
,
bucket
:
'vt-im-bucket'
})
let
that
=
this
;
let
checkpoint
=
null
;
let
percentage
=
0
;
co
(
function
*
()
{
for
(
let
index
=
0
;
index
<
files
.
length
;
index
++
)
{
let
fileName
=
nameList
[
index
]
fileName
=
"/New"
+
path
+
fileName
+
"."
+
files
[
index
].
name
.
split
(
'.'
).
pop
()
var
result
=
yield
oss
.
multipartUpload
(
fileName
,
files
[
index
],
{
progress
:
function
*
(
p
)
{},
mime
:
'application/octet-stream'
})
successCall
(
result
);
}
}).
catch
(
function
(
err
)
{
});
}
},
//价钱格式化,三位数逗号分隔,保留两位小数 duanjun
Vue
.
prototype
.
moneyFormat
=
function
(
value
)
{
let
nStr
=
Number
(
value
).
toFixed
(
2
)
...
...
@@ -319,7 +269,6 @@ export default {
var
sorttype
=
type
||
"asc"
;
var
results
=
[];
var
totalSum
=
{};
function
grouporder
(
source
,
orders
,
totalSum
)
{
source
.
sort
(
function
(
a
,
b
)
{
var
convertA
=
a
[
orders
[
0
]];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment