Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
提交
议题看板
打开侧边栏
jingqi.liu
pica.cloud.web-education-admin
提交
023e7879
提交
023e7879
编写于
5月 28, 2019
作者:
chengxiang.li
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
74d384eb
变更
3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
76 行增加
和
3 行删除
+76
-3
patientsapi.js
src/utils/patients/patientsapi.js
+10
-0
batch-import.vue
src/views/patients/new-manage/components/batch-import.vue
+65
-2
new-patient.vue
src/views/patients/new-manage/new-patient.vue
+1
-1
未找到文件。
src/utils/patients/patientsapi.js
浏览文件 @
023e7879
...
...
@@ -124,6 +124,16 @@ export const downloadQRCode = data => {
})
}
export
const
uploadExcel
=
data
=>
{
return
fetch
({
headers
,
url
:
getSaasDomain
(
'web/patientManages/import'
),
method
:
'post'
,
data
:
data
,
description
:
'上传excel文件'
,
})
}
// 分组管理
export
const
getLabelList
=
(
params
)
=>
{
return
fetch
({
...
...
src/views/patients/new-manage/components/batch-import.vue
浏览文件 @
023e7879
...
...
@@ -58,9 +58,11 @@
<el-upload
class=
"upload-file"
drag
:action=
"uploadUrl"
action=
"#"
accept=
".xlsx"
:headers=
"uploadHeaders"
:file-list=
"files"
:before-upload=
"getPostData"
:on-change=
"changeFile"
:on-error=
"uploadError"
:on-success=
"uploadSuccess"
...
...
@@ -132,12 +134,13 @@
import
{
getSaasDomain
}
from
'@/utils/index'
;
import
{
getUploadHistory
,
uploadExcel
,
}
from
"@/utils/patients/patientsapi"
;
export
default
{
data
()
{
return
{
uploadUrl
:
`
${
getSaasDomain
(
'web/patientManages/import'
)}
`
,
//
uploadUrl: `${getSaasDomain('web/patientManages/import')}`,
searchData
:
{
pageNo
:
1
,
// 第几页
pageSize
:
10
,
// 每页条数
...
...
@@ -148,12 +151,72 @@
token
:
localStorage
.
getItem
(
'token'
)
},
files
:
[],
postData
:
{
axx
:
1
},
}
},
created
()
{
this
.
goToGetUploadHistory
();
},
methods
:
{
getPostData
(
file
)
{
let
self
=
this
;
let
arr
=
file
.
type
.
split
(
'/'
);
let
ext
=
"."
+
arr
[
1
];
let
reader
=
new
FileReader
();
reader
.
onload
=
function
(
e
)
{
self
.
$message
(
'开始导入'
);
let
fileJson
=
{
fileName
:
file
.
name
,
file
:
e
.
target
.
result
.
substr
(
e
.
target
.
result
.
indexOf
(
"base64,"
)
+
7
),
ext
:
ext
};
let
fileArray
=
[{
type
:
'patient'
,
base64
:
fileJson
}];
// openLoading(self);
let
req
=
{
// token: localStorage.getItem("token"),
token
:
'F868A5F84DD9433E93E00E3952A16364'
,
fileArray
:
fileArray
,
import_type
:
2
,
};
//
self
.
postData
=
JSON
.
stringify
(
req
);
// self.postData = req;
uploadExcel
(
self
.
postData
).
then
(
res
=>
{
console
.
log
(
'%c res >> '
,
'color: red;'
,
res
)
})
// self.$axios.post(localStorage.getItem("Url") + 'importServiceImpl/importToQuestionPool'
// , JSON.stringify(req)
// ).then(function (res) {
// closeLoading(self);
// let data = JSON.parse(JSON.stringify(res.data));//通过这个实现深拷贝
// if (data.flag) {
// self.$message('导入成功' + data.successNum + '条(重复的题目不会导入!)');
// self.getLabelList();
// self.search();
// } else {
// self.$message.error('导入题目失败');
// let errorList = data.errorList;
// let message = "";
// if (isNotEmptyUtils(errorList)) {
// for (let i = 0; i
<
errorList
.
length
;
i
++
)
{
// message += "第" + errorList[i].index + "行:" + errorList[i].name + '
<
br
>
';
// }
// }
// htmlMessageBox(self, "警告", message, "确定", function () {
// }, "", null, "warning");
// }
// }).catch(function (error) {
// self.$message.error('
导入题目失败
');
// errorResponseCheck(error, self);
// });
};
reader.readAsDataURL(file);
},
handleDownloadDemo(){
window.location.href = '
https
:
//file.yunqueyi.com/File/template/居民导入模板.xlsx';
},
...
...
src/views/patients/new-manage/new-patient.vue
浏览文件 @
023e7879
...
...
@@ -42,7 +42,7 @@
return
{
curmbFirst
:
"居民管理"
,
curmbSecond
:
"新增居民"
,
activeName2
:
'
second
'
,
activeName2
:
'
first
'
,
patientInfo
:
{},
checkForm
:
false
,
patientId
:
''
,
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录