3 changed files with 232 additions and 1 deletions
-
210src/components/patientRegister/ImportOrgData.vue
-
21src/components/patientRegister/PatientRegisterList.vue
-
2src/store/index.js
@ -0,0 +1,210 @@ |
|||||
|
<template> |
||||
|
<div style="font-size: 14px"> |
||||
|
<div style="display: flex"> |
||||
|
<div> |
||||
|
<span>体检单位:</span> |
||||
|
<el-select v-model="customerOrgId" placeholder="请选择体检单位" :filter-method="filterMethod" default-first-option |
||||
|
clearable filterable @clear="customerOrg = deepCopy(customerOrgAll)" style="margin-left: 10px" |
||||
|
@change="changeCustomerOrg" size="small"> |
||||
|
<el-option v-for="item in customerOrg" :key="item.id" :label="item.displayName" :value="item.id"> |
||||
|
{{ item.displayName }} |
||||
|
</el-option> |
||||
|
</el-select> |
||||
|
</div> |
||||
|
<div style="margin-left: 20px"> |
||||
|
<span>单位体检次数:</span> |
||||
|
<el-select v-model="customerOrgRegister" placeholder="次数" style="width: 60px; margin-left: 10px" size="small" |
||||
|
@change="changeTimes" value-key="id"> |
||||
|
<el-option v-for="item in customerOrgRegisterList" :key="item.id" :label="item.medicalTimes" :value="item.id" /> |
||||
|
</el-select> |
||||
|
</div> |
||||
|
<div style="margin-left: 10px"> |
||||
|
<el-button class="commonbutton" @click="btnImport">开始导入</el-button> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div> |
||||
|
<el-table :data="tableData" ref="customerOrgGroups" style="margin-top: 2px" row-key="id" border height="240px" |
||||
|
size="small" highlight-current-row :row-class-name="handleRowClassName" @row-click="rowClick"> |
||||
|
<el-table-column type="index" label="序号" width="40" align="center" /> |
||||
|
<el-table-column prop="importSuccessNum" label="导入成功数" min-width="60" /> |
||||
|
<el-table-column prop="importErrorNum" label="导入错误数" min-width="60" /> |
||||
|
<el-table-column prop="deleteSuccessNum" label="删除成功数" min-width="60" /> |
||||
|
<el-table-column prop="deleteErrorNum" label="删除错误数" min-width="60" /> |
||||
|
<el-table-column prop="importErrorMessages" label="导入错误信息" min-width="200" /> |
||||
|
<el-table-column prop="deleteErrorMessages" label="删除错误信息" min-width="200" /> |
||||
|
</el-table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
import moment from "moment"; |
||||
|
import Sortable from "sortablejs"; |
||||
|
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
||||
|
import { mapState } from "vuex"; |
||||
|
import { |
||||
|
getPagePriv, |
||||
|
checkPagePriv, |
||||
|
dddw, |
||||
|
deepCopy, |
||||
|
objCopy, |
||||
|
arrayExistObj, |
||||
|
} from "../../utlis/proFunc"; |
||||
|
|
||||
|
|
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
|
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
pagePriv: { |
||||
|
routeUrlorPageName: "ImportOrgData", //当前页面归属路由或归属页面权限名称 |
||||
|
privs: [], // 页面权限 |
||||
|
}, |
||||
|
customerOrg: [], //体检单位 |
||||
|
customerOrgGroups: [], //体检单位分组 |
||||
|
customerOrgId: "", //当前选中的体检单位id |
||||
|
customerOrgRegisterList: [], //体检次数列表 |
||||
|
customerOrgRegisterId: '', //体检次数 |
||||
|
|
||||
|
}; |
||||
|
}, |
||||
|
computed: { |
||||
|
...mapState(["personnelUnit", "window", "dict", "dialogWin", "dataTransOpts"]), |
||||
|
}, |
||||
|
created() { |
||||
|
//获取用户当前页面的权限 |
||||
|
// let userPriv = window.sessionStorage.getItem("userPriv"); |
||||
|
// if (userPriv) |
||||
|
// this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName)); |
||||
|
|
||||
|
}, |
||||
|
mounted() { |
||||
|
//获取初始数据(单位、适用性别) |
||||
|
this.dictInit(); |
||||
|
}, |
||||
|
methods: { |
||||
|
moment, |
||||
|
checkPagePriv, |
||||
|
dddw, |
||||
|
deepCopy, |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
//选中颜色 |
||||
|
handleRowClassName({ row, rowIndex }) { |
||||
|
// highLightBg 为 'selected'的高亮 |
||||
|
//console.log(rowIndex, row) |
||||
|
//return row.highLightBg == 'selected' ? 'high-light-bg' : ''; |
||||
|
if (row.choosed) { |
||||
|
return "current-row"; |
||||
|
} else { |
||||
|
return ""; |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
//获取初始数据 |
||||
|
dictInit() { |
||||
|
//获取单位列表 |
||||
|
getapi("/api/app/customer-org/parent-all").then((res) => { |
||||
|
if (res.code != -1) { |
||||
|
this.customerOrgAll = res.data; |
||||
|
let lfind = arrayExistObj(this.customerOrgAll, "id", this.dict.personOrgId); |
||||
|
if (lfind > -1) this.customerOrgAll.splice(lfind, 1); |
||||
|
this.customerOrg = deepCopy(this.customerOrgAll); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
|
||||
|
filterMethod(keyWords) { |
||||
|
if (keyWords) { |
||||
|
this.customerOrg = []; |
||||
|
this.customerOrgAll.forEach((item) => { |
||||
|
if ( |
||||
|
item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) > -1 || |
||||
|
item.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > -1 |
||||
|
// || item.shortName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1 |
||||
|
) { |
||||
|
this.customerOrg.push(item); |
||||
|
} |
||||
|
}); |
||||
|
} else { |
||||
|
this.customerOrg = deepCopy(this.customerOrgAll); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
//选择单位 |
||||
|
changeCustomerOrg(v) { |
||||
|
if (!v) { |
||||
|
this.customerOrgRegisterList = []; |
||||
|
this.customerOrgRegister = {}; |
||||
|
this.customerOrgGroups = []; |
||||
|
this.isDrag = false; |
||||
|
this.form.id = ""; |
||||
|
setTimeout(() => { |
||||
|
this.dataTransOpts.refresh.customer_org_group_detail.M++; |
||||
|
}, 20); |
||||
|
return; |
||||
|
} |
||||
|
getapi( |
||||
|
`/api/app/customerorgregister/getlistincustomerorgid?CustomerOrgId=${v}` |
||||
|
).then((res) => { |
||||
|
if (res.code != -1) { |
||||
|
this.customerOrgRegisterList = res.data; |
||||
|
if (res.data.length > 0) { |
||||
|
this.customerOrgRegister = res.data[res.data.length - 1]; |
||||
|
this.getCustomerOrgGroup(this.customerOrgRegister.id); |
||||
|
} else { |
||||
|
this.customerOrgRegister = {}; |
||||
|
this.customerOrgGroups = []; |
||||
|
this.isDrag = false; |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
//选择体检次数 |
||||
|
changeTimes(v) { |
||||
|
this.getCustomerOrgGroup(v.id); |
||||
|
}, |
||||
|
|
||||
|
// 开始导入 |
||||
|
btnImport() { |
||||
|
let body = { |
||||
|
customerOrgRegisterId: this.customerOrgRegisterId |
||||
|
} |
||||
|
|
||||
|
postapi('/api/app/patientregister/CreatePatientRegisterFromCustomerOrgInterface', body) |
||||
|
.then(res => { |
||||
|
if (res.code > -1) { |
||||
|
// |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
//点击分组 |
||||
|
rowClick(row) { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
@import "../../assets/css/global_button.css"; |
||||
|
@import "../../assets/css/global_dialog.css"; |
||||
|
@import "../../assets/css/global_table.css"; |
||||
|
@import "../../assets/css/global_form.css"; |
||||
|
@import "../../assets/css/global_input.css"; |
||||
|
@import "../../assets/css/global.css"; |
||||
|
|
||||
|
.btnClass { |
||||
|
width: 100px; |
||||
|
margin-bottom: 5px; |
||||
|
} |
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue