提交 67278018 编写于 作者: xingli.wu's avatar xingli.wu

Merge branch 'feature/wxl' into 'release'

feat: 导入人员名单优化

See merge request com.pica.cloud.education.frontend/pica.cloud.web-education-admin!505
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"private": true, "private": true,
"license": "GPL", "license": "GPL",
"scripts": { "scripts": {
"dev": "cross-env BUILD_ENV=uat node build/dev-server.js", "dev": "cross-env BUILD_ENV=dev node build/dev-server.js",
"local": "cross-env BUILD_ENV=development node build/dev-server.js", "local": "cross-env BUILD_ENV=development node build/dev-server.js",
"build": "node build/build.js", "build": "node build/build.js",
"build:dev": "cross-env BUILD_ENV=dev node build/build.js", "build:dev": "cross-env BUILD_ENV=dev node build/build.js",
...@@ -97,4 +97,4 @@ ...@@ -97,4 +97,4 @@
"node": ">= 4.0.0", "node": ">= 4.0.0",
"npm": ">= 3.0.0" "npm": ">= 3.0.0"
} }
} }
\ No newline at end of file
...@@ -9,7 +9,7 @@ let headers = { ...@@ -9,7 +9,7 @@ let headers = {
export const getUserTypeReq = (type) => { export const getUserTypeReq = (type) => {
return fetch({ return fetch({
headers, headers,
url: getBaseUrl(`cme/admin/auth/external`), url: getBaseUrl(`api-ws/admin/auth/external`),
method: 'get', method: 'get',
description: '获取是否是外部用户', description: '获取是否是外部用户',
}) })
......
...@@ -80,3 +80,28 @@ export const uploadBatchExcel = (data) => { ...@@ -80,3 +80,28 @@ export const uploadBatchExcel = (data) => {
description: "屏蔽机构操作上传文件", description: "屏蔽机构操作上传文件",
}); });
}; };
export const getUploadExcelProgress = (id) => {
return fetch({
headers: {
token: localStorage.getItem("storageToken"),
},
url: getBaseUrl(`portal/new/batch/progress/doctor/${id}`),
method: "post",
description: "人员导入核销处理进度,id为批次id",
});
};
export const uploadPersonExcel2 = (data, projectId) => {
return fetch({
headers: {
"Content-Type": "application/json;charset=UTF-8",
sysCode: 12,
token: localStorage.getItem("storageToken"),
},
url: getBaseUrl("portal/new/scope/doctor/v2/" + projectId + "/import"),
method: "put",
data: data,
description: "上传excel文件",
});
};
\ No newline at end of file
...@@ -501,6 +501,9 @@ ...@@ -501,6 +501,9 @@
<el-form-item label> <el-form-item label>
<el-input size="small" v-model="formPerson.doctorName" placeholder="请输入人员名称"></el-input> <el-input size="small" v-model="formPerson.doctorName" placeholder="请输入人员名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label>
<el-input size="small" v-model="formPerson.mobile" placeholder="请输入人员手机号"></el-input>
</el-form-item>
<el-form-item> <el-form-item>
<el-button size="small" type="primary" @click="searchPeople">搜索</el-button> <el-button size="small" type="primary" @click="searchPeople">搜索</el-button>
</el-form-item> </el-form-item>
...@@ -515,7 +518,7 @@ ...@@ -515,7 +518,7 @@
accept=".xlsx" accept=".xlsx"
multiple multiple
:limit="1" :limit="1"
:before-upload="uploadPerson" :before-upload="uploadPerson2"
> >
<el-button size="small">导入人员名单</el-button> <el-button size="small">导入人员名单</el-button>
<el-button <el-button
...@@ -647,7 +650,7 @@ ...@@ -647,7 +650,7 @@
action="#" action="#"
accept=".xlsx" accept=".xlsx"
:limit="1" :limit="1"
:before-upload="uploadPerson" :before-upload="uploadPerson2"
> >
<el-button <el-button
class="down-button-close" class="down-button-close"
...@@ -1028,6 +1031,102 @@ ...@@ -1028,6 +1031,102 @@
</el-form> </el-form>
</div> </div>
</div> </div>
<!-- 导入结果统计 -->
<el-dialog
class="exportlogistics-dialog"
title="导入完成"
:visible="statFlg"
width="600px"
@close="statFlg = false"
>
<div class="stat-container">
<div class="stat-title">模板数据共{{ ProgressData.totalNum }}条</div>
<div class="stat-result">
<div class="success">成功:{{ ProgressData.successNum }}条</div>
<div class="repetition">重复:{{ ProgressData.repeatNum }}条</div>
<div class="repetition">空行:{{ ProgressData.nullNum }}条</div>
<div class="failure">失败:{{ ProgressData.failNum }}条</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="statFlg = false"> 取消 </el-button>
<el-button size="small" type="primary" @click="showReasonDialog">
查看失败原因
</el-button>
</div>
</el-dialog>
<!-- 导出进度loading -->
<el-dialog
class="exportlogistics-dialog"
:visible="progressFlagDetection"
width="600px"
:close-on-click-modal="false"
:show-close="false"
>
<div>
<div class="progress-container">
<div class="progress-tag">
{{ ProgressData.doneNum }}/{{ ProgressData.totalNum }}
<div class="popper__arrow" />
</div>
<div class="progress-content">正在导入...</div>
</div>
</div>
</el-dialog>
<!-- 倒入失败原因 -->
<el-dialog
class="exportlogistics-dialog"
title="失败记录"
:visible="failureReasonFlag"
width="1000px"
@close="failureReasonFlag = false"
>
<div class="FailureReasonFlag-container">
<el-table
:data="ProgressData.errorList"
border
height="360"
style="width: 100%"
>
<el-table-column
prop="doctorName"
label="人员姓名"
align="center"
width="110"
/>
<el-table-column
prop="mobilePhone"
label="手机号"
align="center"
/>
<el-table-column
prop="failInfo"
label="失败原因"
align="center"
width="110"
/>
<el-table-column
prop="operationGuide"
label="操作指引"
align="center"
/>
</el-table>
</div>
<div slot="footer" class="dialog-footer">
<el-button
size="small"
style="margin-right: 15px"
@click="failureReasonFlag = false"
>
取消
</el-button>
<a :href="ProgressData.errorFileUrl">
<el-button size="small" type="primary">导出失败记录 </el-button>
</a>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
...@@ -1040,15 +1139,15 @@ import * as operationData from "../../utils/operation"; ...@@ -1040,15 +1139,15 @@ import * as operationData from "../../utils/operation";
import { getExeclUrl } from "@/utils/index"; import { getExeclUrl } from "@/utils/index";
import { import {
uploadOrgExcel, uploadOrgExcel,
uploadPersonExcel uploadPersonExcel,
uploadPersonExcel2,
getUploadExcelProgress
} from "@/utils/education/educationApi"; } from "@/utils/education/educationApi";
import Sortable from "sortablejs"; import Sortable from "sortablejs";
let vm = null; let vm = null;
export default { export default {
components: { components: { BreadCrumb },
BreadCrumb
},
data() { data() {
let checkProjectStr = (rule, value, callback) => { let checkProjectStr = (rule, value, callback) => {
if (value.indexOf("\\") != -1) { if (value.indexOf("\\") != -1) {
...@@ -1214,6 +1313,7 @@ export default { ...@@ -1214,6 +1313,7 @@ export default {
hospitalId: 0, hospitalId: 0,
departmentId: -1, departmentId: -1,
doctorName: "", doctorName: "",
mobile: "",
hospitalName: "", hospitalName: "",
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
...@@ -1427,7 +1527,22 @@ export default { ...@@ -1427,7 +1527,22 @@ export default {
attachmentUrl2: [ attachmentUrl2: [
{ required: true, message: "请选择封面", trigger: "blur" } { required: true, message: "请选择封面", trigger: "blur" }
] ]
} },
ProgressData: {
// 倒入相关数据
totalNum: '', // 总数
nullNum: '', // 空白行
status: '', // 1完成 0进行中
doneNum: '', // doneNum 完成数量
successNum: '', // 成功数量
failNum: '', // 失败数量
repeatNum: '',
errorFileUrl: '', // 失败 原因文件
errorList: [], // 失败列表
},
statFlg: false,
failureReasonFlag: false,
progressFlagDetection: false, // 导入检测进度弹窗
}; };
}, },
computed: { computed: {
...@@ -2357,6 +2472,7 @@ export default { ...@@ -2357,6 +2472,7 @@ export default {
} else if (tabName == "fourth") { } else if (tabName == "fourth") {
//设定人员 //设定人员
this.formPerson.pageNum = 1; this.formPerson.pageNum = 1;
this.formPerson.mobile = "";
this.formPerson.doctorName = ""; this.formPerson.doctorName = "";
this.formPerson.hospitalName = ""; this.formPerson.hospitalName = "";
// this.getHospital(); // this.getHospital();
...@@ -2989,7 +3105,7 @@ export default { ...@@ -2989,7 +3105,7 @@ export default {
searchPeople() { searchPeople() {
this.formPerson.pageNum = 1; this.formPerson.pageNum = 1;
let searchForm = this.formPerson; let searchForm = this.formPerson;
if (searchForm.hospitalName === "" && searchForm.doctorName === "") { if (searchForm.hospitalName === "" && searchForm.doctorName === "" && searchForm.mobile === "") {
this.searchPeopleType = ""; this.searchPeopleType = "";
this.getPeople(); this.getPeople();
} else { } else {
...@@ -3032,6 +3148,7 @@ export default { ...@@ -3032,6 +3148,7 @@ export default {
pageNum: this.formPerson.pageNum, pageNum: this.formPerson.pageNum,
pageSize: this.formPerson.pageSize, pageSize: this.formPerson.pageSize,
doctorName: this.formPerson.doctorName, doctorName: this.formPerson.doctorName,
doctorMobile: this.formPerson.mobile,
hospitalName: this.formPerson.hospitalName, hospitalName: this.formPerson.hospitalName,
scopeOfAdministrative: this.getScope("administrative"), scopeOfAdministrative: this.getScope("administrative"),
scopeOfDepartment: this.getScopeDepartment() scopeOfDepartment: this.getScopeDepartment()
...@@ -3066,6 +3183,7 @@ export default { ...@@ -3066,6 +3183,7 @@ export default {
hospitalName: "", hospitalName: "",
scopeOfAdministrative: this.getScope("administrative"), scopeOfAdministrative: this.getScope("administrative"),
scopeOfDepartment: this.getScopeDepartment(), scopeOfDepartment: this.getScopeDepartment(),
doctorMobile: this.formPerson.mobile,
pageNum: this.formPerson.pageNum, pageNum: this.formPerson.pageNum,
pageSize: this.formPerson.pageSize pageSize: this.formPerson.pageSize
}; };
...@@ -3901,7 +4019,42 @@ export default { ...@@ -3901,7 +4019,42 @@ export default {
}; };
reader.readAsDataURL(file); reader.readAsDataURL(file);
}, },
uploadPerson(file) { // uploadPerson(file) {
// vm.dialogFail = false;
// vm.uploadType = "person";
// let arr = file.type.split("/");
// let ext = "." + arr[1];
// let name = file.name;
// let reader = new FileReader();
// reader.onload = function(e) {
// let fileJson = {
// fileName: file.name,
// file: e.target.result.substr(e.target.result.indexOf("base64,") + 7),
// ext: ext
// };
// let fileArray = [
// {
// type: "",
// base64: fileJson
// }
// ];
// let req = {
// fileArray: fileArray,
// scopeOfAdministrative: vm.getScope("administrative"),
// scopeOfDepartment: vm.getScopeDepartment()
// };
// let projectId = vm.projectId;
// console.log("req", req);
// let reqStr = JSON.stringify(req);
// openLoading(vm);
// uploadPersonExcel(reqStr, projectId).then(res => {
// closeLoading(vm);
// vm.setDialog(res);
// });
// };
// reader.readAsDataURL(file);
// },
uploadPerson2(file) {
vm.dialogFail = false; vm.dialogFail = false;
vm.uploadType = "person"; vm.uploadType = "person";
let arr = file.type.split("/"); let arr = file.type.split("/");
...@@ -3929,13 +4082,58 @@ export default { ...@@ -3929,13 +4082,58 @@ export default {
console.log("req", req); console.log("req", req);
let reqStr = JSON.stringify(req); let reqStr = JSON.stringify(req);
openLoading(vm); openLoading(vm);
uploadPersonExcel(reqStr, projectId).then(res => { // vm.dialogSuccess = true;
closeLoading(vm); uploadPersonExcel2(reqStr, projectId).then(res => {
vm.setDialog(res); if (res.code === '000000') {
vm.getUploadTeamOrderProgress(res.data.batchUploadLogId, res);
closeLoading(vm);
}
}); });
}; };
reader.readAsDataURL(file); reader.readAsDataURL(file);
}, },
// 获取物流上传进度
getUploadTeamOrderProgress(id, resParams) {
const fun = getUploadExcelProgress;
console.log(fun, this.ExportType);
fun(id).then((res) => {
if (res && res.code == '000000') {
this.isLoading = false;
this.exportDialog = false;
this.progressFlagDetection = true;
this.ProgressData = res.data;
if (res.data.status == 1) {
const timer = setTimeout(() => {
clearTimeout(timer);
this.progressFlagDetection = false;
if (
this.ProgressData.totalNum &&
this.ProgressData.totalNum == this.ProgressData.successNum
) {
// vm.setDialog(resParams);
this.$message.success('已全部导入完成');
} else {
this.statFlg = true;
}
// 刷新列表
this.searchPeople();
}, 2000);
} else if (res.data.status == 0) {
const timer = setTimeout(() => {
clearTimeout(timer);
this.getUploadTeamOrderProgress(id);
}, 2000);
}
} else {
this.isLoading = false;
this.$message.error(res.message);
}
});
},
showReasonDialog() {
this.statFlg = false;
this.failureReasonFlag = true;
},
download(type) { download(type) {
let downloadUrl = ""; let downloadUrl = "";
if (type == "organization") { if (type == "organization") {
...@@ -4106,6 +4304,7 @@ export default { ...@@ -4106,6 +4304,7 @@ export default {
} else if (type == "person") { } else if (type == "person") {
vm.formPerson.hospitalName = ""; vm.formPerson.hospitalName = "";
vm.formPerson.doctorName = ""; vm.formPerson.doctorName = "";
vm.formPerson.mobile = "";
vm.formPerson.pageNum = 1; vm.formPerson.pageNum = 1;
vm.searchPeople(); vm.searchPeople();
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册