提交 74d384eb 编写于 作者: chengxiang.li's avatar chengxiang.li

update

上级 e9bae8dd
......@@ -5,7 +5,6 @@
display: flex;
flex-direction: column;
&.upload-history-wrap{
margin-top: 30px;
margin: 0;
padding: 0;
.septal-line{
......
......@@ -6,6 +6,9 @@
.top-title{
border: 0 !important;
}
.screenSet{
background: #fff;
}
.upload-record{
width: 100%;
font-size: 20px;
......
......@@ -114,6 +114,16 @@ export const getLabelsInfo = params => {
})
}
export const downloadQRCode = data => {
return fetch({
headers,
url: getBaseUrl(`healths/qrcodes/shareUrl`),
method: 'post',
data: data,
description: '下载二维码',
})
}
// 分组管理
export const getLabelList = (params) => {
return fetch({
......
......@@ -82,40 +82,34 @@
class="upload-table"
style="width: 100%">
<el-table-column
header-align="center"
align="center"
align="left"
prop="fileName"
label="文件名"
width="180">
</el-table-column>
<el-table-column
header-align="center"
align="center"
align="left"
prop="uploadTime"
label="上传时间"
width="180">
</el-table-column>
<el-table-column
header-align="center"
align="center"
align="left"
prop="insertCount"
label="新导入居民数">
</el-table-column>
<el-table-column
header-align="center"
align="center"
align="left"
prop="updateCount"
label="更新居民资料数">
</el-table-column>
<el-table-column
header-align="center"
align="center"
align="left"
prop="status"
label="处理状态">
</el-table-column>
<el-table-column
header-align="center"
align="center"
align="left"
prop="address"
label="关闭理由">
</el-table-column>
......
......@@ -83,6 +83,7 @@
refreshCode,
getLabelList,
getLabelsInfo,
downloadQRCode,
} from "@/utils/patients/patientsapi";
export default {
......@@ -103,6 +104,7 @@
currentLabelList: [],
labelNameList: [],
choosedLabelList: [],
forDownloadInfo: {}, // 下载用的信息
}
},
created() {
......@@ -126,19 +128,47 @@
this.showChooseLabelModal = false;
},
// 二维码录入
goToGetQRCode(params){
goToGetQRCode(params, cb){
let justDownload = false;
if(params.hasOwnProperty('justDownload')){
justDownload = true;
delete params.justDownload;
}
getQRCode(params).then(res => {
if(res.code == '000000'){
let data = res.data;
this.qrCodeInfo = data;
if(data.labelIds != ''){
let temp = data.labelIds.split(',');
this.currentLabelList = this.formatList(temp);
if( !justDownload ){ // 非下载二维码时
this.qrCodeInfo = data;
if(data.labelIds != ''){
let temp = data.labelIds.split(',');
this.currentLabelList = this.formatList(temp);
}
this.calculateQRCode(data.qrcodeUrl);
this.handleGetLabelsInfo({
labelIds: data.labelIds,
});
}else{ // 下载二维码时,不用更新页面中的二维码信息
this.forDownloadInfo = data;
let { id, beginTime, endTime, forever } = this.forDownloadInfo;
let obj = {
id,
beginTime,
endTime,
forever,
labels: [], // ["高血压","糖尿病","脑卒中"]
};
let idArr = params.labelIds.split(','); // [1,3,55]
let checkArr = this.labelNameList;
for(let i=0; i<idArr.length; i++) {
for(let j=0; j<checkArr.length; j++) {
if( idArr[i] == checkArr[j].labelId ) {
obj.labels.push( checkArr[j].labelName );
}
}
}
console.log('obj.labels: ', obj.labels);
cb && cb(obj);
}
this.calculateQRCode(data.qrcodeUrl);
this.handleGetLabelsInfo({
labelIds: data.labelIds,
});
}else{
this.$message({
message: '获取二维码失败,请重新再试',
......@@ -156,6 +186,11 @@
getLabelsInfo(params).then(res => {
if(res.code == '000000'){
this.labelsInfoList = res.data;
}else{
this.$message({
message: '获取标签信息失败',
type: 'warning'
});
}
})
},
......@@ -210,7 +245,7 @@
});
return;
}
if( this.showDownloadQRModal == false ){
if( this.showDownloadQRModal == false ){ // 选择分组时
this.showChooseLabelModal = false;
this.goToGetQRCode({
labelIds: this.choosedLabelList.join(','),
......@@ -218,11 +253,33 @@
first: false,
});
this.choosedLabelList = [];
}else{
alert('去下载二维码。。。')
}else{ // 下载二维码时
// 获取最新二维码参数,但不影响之前的二维码参数
this.goToGetQRCode({
labelIds: this.choosedLabelList.join(','),
id: '',
first: false,
justDownload: true,
}, this.goToDownloadQRCode);
}
},
goToDownloadQRCode(params) {
// 下载二维码
downloadQRCode(params).then(res => {
if(res.code == '000000'){
// window.location.href = res.data;
this.downloadFile(res.data);
}else{
this.$message({
message: '下载二维码失败',
type: 'warning'
});
}
})
},
handleClearSelect() {
this.choosedLabelList = [];
},
......@@ -244,8 +301,6 @@
console.log('error: ', err)
});
},
handleGoToLabelManage(){
let routeUrl = this.$router.resolve({
path: '/patients-manage/labels-manage/labels-list',
......@@ -257,6 +312,19 @@
this.showReloadLabelModal = false;
this.goToGetGroupList();
},
downloadFile(src) {
debugger;
var eleLink = document.createElement('a');
eleLink.download = src;
eleLink.style.display = 'none';
// // 字符内容转变成blob地址
eleLink.href = src;
// // 触发点击
document.body.appendChild(eleLink);
eleLink.click();
// // 然后移除
document.body.removeChild(eleLink);
}
},
......
......@@ -42,7 +42,7 @@
return {
curmbFirst: "居民管理",
curmbSecond: "新增居民",
activeName2: 'first',
activeName2: 'second',
patientInfo: {},
checkForm: false,
patientId: '',
......@@ -55,6 +55,18 @@
BatchImport,
},
created() {
let tabIndex = this.$route.query.tab;
if((typeof tabIndex == 'undefined') || (tabIndex == '')){
return;
}
tabIndex = parseInt(tabIndex);
let numArr = [1, 2, 3];
let tabList = ['first', 'second', 'third'];
if( numArr.indexOf(tabIndex) > -1 ){
this.activeName2 = tabList[tabIndex-1];
}else{
this.activeName2 = 'first';
}
},
// 挂载到Dom完成时
mounted() {
......@@ -95,7 +107,7 @@
}
</script>
<style lang="less" scoped>
<style lang="less">
@import "../../../style/patient-manager/new-patient/new-patient-wrap.less";
</style>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册