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
1ec7ac34
Commit
1ec7ac34
authored
Nov 13, 2020
by
Mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
acbb2a60
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1237 additions
and
1 deletion
+1237
-1
HuiChaImport.vue
src/pages/financial/HuiChaImport.vue
+574
-0
Manfunds.vue
src/pages/financial/Manfunds.vue
+540
-0
erpindex.js
src/utils/erpindex.js
+123
-1
No files found.
src/pages/financial/HuiChaImport.vue
0 → 100644
View file @
1ec7ac34
This diff is collapsed.
Click to expand it.
src/pages/financial/Manfunds.vue
0 → 100644
View file @
1ec7ac34
This diff is collapsed.
Click to expand it.
src/utils/erpindex.js
View file @
1ec7ac34
...
...
@@ -6,6 +6,65 @@ export default{
apiurl
:
''
},
install
(
Vue
,
options
){
//消息成功提示
Vue
.
prototype
.
Success
=
function
(
msg
)
{
this
.
$message
({
message
:
msg
,
duration
:
2000
,
type
:
"success"
});
},
//错误提示
Vue
.
prototype
.
Error
=
function
(
msg
)
{
this
.
$message
({
message
:
msg
,
duration
:
2000
,
type
:
"error"
});
},
//一般提示
Vue
.
prototype
.
Info
=
function
(
msg
)
{
this
.
$message
({
message
:
msg
,
duration
:
2000
,
type
:
"info"
});
},
//警告提示
Vue
.
prototype
.
Warning
=
function
(
msg
)
{
this
.
$message
({
message
:
msg
,
duration
:
2000
,
type
:
"warning"
});
},
//Confirm
Vue
.
prototype
.
Confirm
=
function
(
msg
,
callback
)
{
this
.
$confirm
(
msg
,
"提示"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
})
.
then
(()
=>
{
if
(
typeof
callback
===
'function'
)
{
callback
();
}
})
.
catch
(()
=>
{
this
.
Info
(
"已取消操作"
);
});
},
Vue
.
prototype
.
random_string
=
function
(
len
)
{
len
=
len
||
32
;
var
chars
=
'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'
;
var
maxPos
=
chars
.
length
;
var
pwd
=
''
;
for
(
let
i
=
0
;
i
<
len
;
i
++
)
{
pwd
+=
chars
.
charAt
(
Math
.
floor
(
Math
.
random
()
*
maxPos
));
}
return
pwd
;
},
//ERP本地缓存
Vue
.
prototype
.
md5
=
md5
;
Vue
.
prototype
.
getLocalStorage
=
function
()
{
...
...
@@ -126,7 +185,70 @@ export default{
successCall
(
res
);
}
},
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
)
{
});
}
},
//上传文件到本地服务器
Vue
.
prototype
.
UploadSelfFileT
=
function
(
path
,
files
,
successCall
,
ocr
)
{
if
(
files
&&
files
.
length
>
0
)
{
let
nameList
=
new
Array
()
for
(
let
index
=
0
;
index
<
files
.
length
;
index
++
)
{
nameList
.
push
(
this
.
random_string
());
}
let
that
=
this
;
co
(
function
*
()
{
for
(
let
index
=
0
;
index
<
files
.
length
;
index
++
)
{
let
fileName
=
nameList
[
index
]
fileName
=
path
+
fileName
+
"."
+
files
[
index
].
name
.
split
(
'.'
).
pop
()
var
formData
=
new
FormData
();
var
uploadUrl
=
that
.
domainManager
().
UploadUrl
+
"/Upload?filePath="
+
path
+
'&ocr='
+
ocr
;
formData
.
append
(
"myfile"
,
files
[
index
]);
that
.
$http
.
post
(
uploadUrl
,
formData
,
{})
.
then
(
res
=>
{
successCall
(
res
);
}).
catch
(
function
(
reason
)
{
that
.
$refs
[
'my-upload'
].
clearFiles
();
that
.
$message
.
error
(
'上传失败!'
);
that
.
MsgBus
.
$emit
(
'UploadSelfFileErr'
)
});
}
}).
catch
(
function
(
err
)
{
that
.
$refs
[
'my-upload'
].
clearFiles
();
that
.
$message
.
error
(
'上传失败!'
);
});
}
}
}
}
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