Browse Source

asbcheck

master
pengjun 2 years ago
parent
commit
eb50d1ede2
  1. 4
      src/components/patientRegister/PatientRegisterEdit.vue
  2. 369
      src/components/patientRegister/PatientRegisterItem.vue
  3. 5
      src/components/patientRegister/PatientRegisterList.vue
  4. 16
      src/store/index.js
  5. 7
      src/utlis/istoken.js

4
src/components/patientRegister/PatientRegisterEdit.vue

@ -735,9 +735,9 @@ export default {
//
"patientRegister.patientRegisterRd.id"(newVal, oldVal) {
//console.log('patientRegister.patientRegisterRd.id newVal',newVal,' oldVal',oldVal)
console.log('patientRegister.patientRegisterRd.id newVal:',newVal,' oldVal:',oldVal)
if (newVal != oldVal) {
//console.log('newVal',this.patientRegister.patientRegisterRd)
console.log('newVal:',this.patientRegister.patientRegisterRd)
objCopy(this.patientRegister.patientRegisterRd, this.form);
}
},

369
src/components/patientRegister/PatientRegisterItem.vue

@ -32,13 +32,14 @@
</div>
<div class="mainareaBox">
<el-table :header-cell-style="{ background: '#eef1f6' }" :data="patientRegister.patientRegisterAbs" height="350"
<el-table :data="patientRegister.patientRegisterAbs" height="350"
:summary-method="getSummaries" show-summary
@selection-change="selecteditems" size="small">
<!-- temporaryselection personnelUnit.nogroupselected-->
<el-table-column type="selection"></el-table-column>
<el-table-column label="已选组合项目" width="110" prop="asbitemName" />
<el-table-column label="标准价格" prop="standardPrice" />
<el-table-column label="实收价格" prop="chargePrice" >
<el-table-column label="标准价格" prop="standardPrice" />
<el-table-column label="实收价格" prop="chargePrice">
<template slot-scope="scope">
<el-input v-model="patientRegister.patientRegisterAbs[scope.$index].chargePrice" />
</template>
@ -49,11 +50,12 @@
</template>
</el-table-column>
<el-table-column label="支付方式" prop="payTypeFlag" width="100">
<template slot-scope="scope">
<template slot-scope="scope">
<el-select v-model="patientRegister.patientRegisterAbs[scope.$index].payTypeFlag">
<el-option v-for="item in dict.payType" :key="item.id" :label="item.displayName" :value="item.id" width="100"/>
<el-option v-for="item in dict.payType" :key="item.id" :label="item.displayName" :value="item.id"
width="100" />
</el-select>
</template>
</template>
</el-table-column>
</el-table>
</div>
@ -62,13 +64,13 @@
<script>
import { mapState, mapActions } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { arrayFilter, arrayReduce ,arrayExistObj} from "../../utlis/proFunc";
import { arrayFilter, arrayReduce, arrayExistObj } from "../../utlis/proFunc";
export default {
props: ["patientRegisterForm"],
data() {
return {
itemType: [], //
itemTypeIds:'', //ID
itemTypeIds: '', //ID
asbItemChoosed: [], //
//patientRegisterAbs:[], // vuex
@ -78,7 +80,7 @@ export default {
patientRegisterAbsRd: {
id: null, //
asbitemId: null, // string($uuid)
asbitemName:'', //
asbitemName: '', //
patientRegisterId: null, //string($uuid)
standardPrice: 0, //number($double)
chargePrice: 0, // number($double)
@ -97,7 +99,7 @@ export default {
mounted() { },
methods: {
...mapActions(['getCustomerOrgGroup','getMedicalPackageAsb', 'getPatientRegisterAbs']),
...mapActions(['getCustomerOrgGroup', 'getMedicalPackageAsb', 'getPatientRegisterAbs']),
//
// [
@ -113,44 +115,47 @@ export default {
// }
// ]
onSubmit() {
//
batchEditAsb(body,msg){
console.log(`/api/app/registerasbitem/updatemany`, body)
postapi(`/api/app/registerasbitem/updatemany`, body)
.then((res) => {
console.log("onSubmit", res);
if (res.code == 1) {
if(msg){
//
this.getPatientRegisterAbs(this.patientRegisterForm.id)
this.$message.success(`${msg}操作成功`);
}
}
})
.catch((err) => {
this.$message({ type: "error", message: `${msg}操作失败,原因:${err}` });
});
},
//
onSubmit() {
let body = []
if(this.patientRegister.patientRegisterAbs.length < 1){
if (this.patientRegister.patientRegisterAbs.length < 1) {
alert("暂无可操作的数据")
return
}
for(let i=0;i<this.patientRegister.patientRegisterAbs.length;i++){
for (let i = 0; i < this.patientRegister.patientRegisterAbs.length; i++) {
body.push({
registerAsbitemId:this.patientRegister.patientRegisterAbs[i].id,
input:{
chargePrice:this.patientRegister.patientRegisterAbs[i].chargePrice,
payTypeFlag:this.patientRegister.patientRegisterAbs[i].payTypeFlag,
isCharge:this.patientRegister.patientRegisterAbs[i].isCharge,
amount:this.patientRegister.patientRegisterAbs[i].amount,
groupPackageId:this.patientRegister.patientRegisterAbs[i].groupPackageId
registerAsbitemId: this.patientRegister.patientRegisterAbs[i].id,
input: {
chargePrice: this.patientRegister.patientRegisterAbs[i].chargePrice,
payTypeFlag: this.patientRegister.patientRegisterAbs[i].payTypeFlag,
isCharge: this.patientRegister.patientRegisterAbs[i].isCharge,
amount: this.patientRegister.patientRegisterAbs[i].amount,
groupPackageId: this.patientRegister.patientRegisterAbs[i].groupPackageId
}
})
}
this.batchEditAsb(body,'保存');
console.log(`/api/app/register-asbitem/many`,body)
putapi(`/api/app/register-asbitem/many`,body)
.then((res) => {
console.log("onSubmit", res);
if (res.code == 1) {
//
this.getPatientRegisterAbs(this.patientRegisterForm.id)
//
this.getAsbItemByItemType()
this.$message.success("操作成功");
}
})
.catch((err) => {
this.$message({type: "error",message: `操作失败,原因:${err}`});
});
},
},
//
handleSelectionChange(val) {
// this.selecteddata = val;
@ -158,16 +163,39 @@ export default {
//console.log(this.asbItemChoosed);
},
//
batchAddAsb(body,msg){
console.log(`/api/app/registerasbitem/createmany?CustomerOrgId=${this.patientRegisterForm.customerOrgId}`, body)
postapi(`/api/app/registerasbitem/createmany?CustomerOrgId=${this.patientRegisterForm.customerOrgId}`, body)
.then((res) => {
console.log("addAbs", res);
if (res.code == 1) {
//
this.getPatientRegisterAbs(this.patientRegisterForm.id)
if(msg) this.$message.success(`${msg}操作成功`);
}
})
.catch((err) => {
this.$message({ type: "error", message: `${msg}操作失败,原因:${err}` });
});
},
//
///api/app/register-asbitem/many/3fa85f64-5717-4562-b3fc-2c963f66afa6'
addAbs() {
addAbs() {
let body = []
let checked = true
if(this.asbItemChoosed.length < 1){
let payTypeFlag = '0' //
if (this.asbItemChoosed.length < 1) {
alert("请选择要添加的组合项目")
return
}
if (!this.patientRegisterForm.id) {
alert("请先保存人员体检基本信息!")
return
}
//
// "displayName": "",
// "shortName": "f",
@ -175,116 +203,118 @@ export default {
// "itemTypeId": "3a0b16de-75b9-c910-c61b-844709a88940",
// "price": 0,
//console.log('this.asbItemChoosed.length',this.asbItemChoosed.length)
for(let i = 0;i<this.asbItemChoosed.length;i++){
if(this.patientRegisterForm.sexId == 'U') break //
if(this.asbItemChoosed[i].forSexId == 'U') continue
if(this.asbItemChoosed[i].forSexId != this.patientRegisterForm.sexId){
for (let i = 0; i < this.asbItemChoosed.length; i++) {
if (this.patientRegisterForm.sexId == '9') break //
if (this.asbItemChoosed[i].forSexId == '9') continue
if (this.asbItemChoosed[i].forSexId != this.patientRegisterForm.sexId) {
alert(`所选项目:${this.asbItemChoosed[i].displayName},不适合当前人员性别`)
checked = false
break
}
}
//console.log(222,checked)
if(!checked) return
for(let i = 0;i<this.asbItemChoosed.length;i++){
if (!checked) return
if (this.patientRegisterForm.customerOrgId != this.dict.personOrgId) payTypeFlag = '1'
for (let i = 0; i < this.asbItemChoosed.length; i++) {
body.push({
asbitemId: this.asbItemChoosed[i].id,
patientRegisterId: this.patientRegisterForm.id,
standardPrice: this.asbItemChoosed[i].price,
chargePrice: this.asbItemChoosed[i].price,
payTypeFlag: "0",
payTypeFlag,
isCharge: "N",
amount: 1
})
}
console.log(`/api/app/register-asbitem/many/${this.patientRegisterForm.customerOrgId}`,body)
postapi(`/api/app/register-asbitem/many/${this.patientRegisterForm.customerOrgId}`,body)
.then((res) => {
console.log("addAbs", res);
if (res.code == 1) {
//
this.getPatientRegisterAbs(this.patientRegisterForm.id)
//
this.getAsbItemByItemType()
this.$message.success("操作成功");
}
})
.catch((err) => {
this.$message({type: "error",message: `操作失败,原因:${err}`});
});
this.batchAddAsb(body,'添加组合项目');
},
//
selecteditems(val) {
this.patientRegisterAbsChoosed = val
},
//
batchDelAsb(body,msg){
console.log(`/api/app/registerasbitem/deletemany`, body)
postapi(`/api/app/registerasbitem/deletemany`, body)
.then((res) => {
console.log("delAbs", res);
if (res.code != -1) {
//
this.getAsbItemByItemTypeAll()
if(msg){
//
this.getPatientRegisterAbs(this.patientRegisterForm.id)
this.$message.success(`${msg}操作成功`);
}
}
})
.catch((err) => {
this.$message({ type: "error", message: `${msg}操作失败,原因:${err}` });
});
},
//
///api/app/register-asbitem/many?RegisterAsbitemIds=3fa85f64-5717-4562-b3fc-2c963f66afa6
delAbs(){
let body = []
let checked = true
if(this.patientRegisterAbsChoosed.length < 1){
delAbs() {
let body = {}
let registerAsbitemIds = []
let chargeComplete = ''
if (this.patientRegisterAbsChoosed.length < 1) {
alert("请选择要移除的组合项目")
return
}
for(let i = 0;i<this.patientRegisterAbsChoosed.length;i++){
if(this.patientRegisterAbsChoosed[i].isCharge == 'Y') {
alert(`所选项目:${this.patientRegisterAbsChoosed[i].displayName},已收费,不可删除!`)
checked = false
break
for (let i = 0; i < this.patientRegisterAbsChoosed.length; i++) {
if (this.patientRegisterAbsChoosed[i].isCharge == 'Y' || this.patientRegisterAbsChoosed[i].checkCompleteFlag != '0') {
chargeComplete += this.patientRegisterAbsChoosed[i].asbitemName + ','
this.patientRegisterAbsChoosed.splice(i, 1)
i--
}
}
if(!checked) return
for(let i = 0;i<this.patientRegisterAbsChoosed.length;i++){
body.push({
RegisterAsbitemIds: this.patientRegisterAbsChoosed[i].id,
})
if (chargeComplete) {
alert(`所选项目:${chargeComplete}已收费或已检,不可删除!`)
if (this.patientRegisterAbsChoosed.length < 1) return
}
console.log(`/api/app/register-asbitem/many`,body)
deletapi(`/api/app/register-asbitem/many`,body)
.then((res) => {
console.log("delAbs", res);
if (res.code == 1) {
//
this.getPatientRegisterAbs(this.patientRegisterForm.id)
//
this.getAsbItemByItemType()
for (let i = 0; i < this.patientRegisterAbsChoosed.length; i++) {
registerAsbitemIds.push(this.patientRegisterAbsChoosed[i].id)
}
this.$message.success("操作成功");
}
})
.catch((err) => {
this.$message({type: "error",message: `操作失败,原因:${err}`});
});
body = { registerAsbitemIds }
this.batchDelAsb(body,'删除组合项目');
},
//
getAsbItemByItemType() {
//console.log('getAsbItemByItemType',typeof this.itemTypeIds,this.itemTypeIds)
//
getAsbItemByItemTypeAll() {
console.log('getAsbItemByItemType', typeof this.itemTypeIds, this.itemTypeIds)
let lv = "";
if (typeof this.itemTypeIds === "object") {
lv = this.itemTypeIds[this.itemTypeIds.length - 1];
}
}
if (lv) {
this.dict.asbItem = arrayFilter(this.dict.asbItemAll, "itemTypeId", lv);
} else {
this.dict.asbItem = [...this.dict.asbItemAll];
}
console.log('lv,this.dict.asbItem', lv, this.dict.asbItem)
},
//
getAsbItemByItemType() {
this.getAsbItemByItemTypeAll()
//
arrayReduce(this.dict.asbItem,[...this.patientRegister.patientRegisterAbs],"id=asbitemId");
arrayReduce(this.dict.asbItem, [...this.patientRegister.patientRegisterAbs], "id=asbitemId");
},
@ -303,29 +333,25 @@ export default {
},
//
getCustomerOrgGroupAsb(customerOrgGroupId,oldVal) {
console.log("getCustomerOrgGroupAsb");
getapi(
`/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem?CustomerOrgGroupId=${customerOrgGroupId}`
).then((res) => {
getCustomerOrgGroupAsb(customerOrgGroupId, oldVal) {
console.log(`getCustomerOrgGroupAsb /api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem/${customerOrgGroupId}`);
getapi(`/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem/${customerOrgGroupId}`)
.then((res) => {
console.log("getCustomerOrgGroupAsb", res);
if (res.code == 1) {
this.patientRegister.customerOrgGroupAsb = res.data;
//
this.addCustomerOrgGroupAsb(customerOrgGroupId);
//
this.removeGroupPackageAsb(oldVal);
//
this.getAsbItemByItemType()
//
this.addCustomerOrgGroupAsb(customerOrgGroupId);
}
});
},
//
getMedicalPackageAsb(medicalPackageId,oldVal) {
getMedicalPackageAsb(medicalPackageId, oldVal) {
console.log(
`/api/app/medical-package-detail/medical-package-in-asbitem?MedicalPackageId=${medicalPackageId}`
);
@ -353,7 +379,7 @@ export default {
console.log('addCustomerOrgGroupAsb')
let finded = false;
for (let i = 0; i < this.patientRegister.customerOrgGroupAsb.length; i++) {
finded = false;
finded = false;
for (let j = 0; j < this.patientRegister.patientRegisterAbs.length; j++) {
if (this.patientRegister.customerOrgGroupAsb[i].asbitemId == this.patientRegister.patientRegisterAbs[j].asbitemId) {
this.patientRegister.patientRegisterAbs[j].groupPackageId = groupPackageId
@ -374,16 +400,16 @@ export default {
amount: 1, // integer($int32)
groupPackageId: groupPackageId, // string($uuid) ID
};
console.log('i',i,asbItem)
console.log('i', i, asbItem)
//
let exist = arrayExistObj(this.patientRegisterAbsDel,'asbitemId',asbItem.asbitemId)
if(exist > -1){
this.patientRegister.patientRegisterAbs.push({...this.patientRegisterAbsDel[exist]})
this.patientRegisterAbsDel.splice(exist,1)
}else{
let exist = arrayExistObj(this.patientRegisterAbsDel, 'asbitemId', asbItem.asbitemId)
if (exist > -1) {
this.patientRegister.patientRegisterAbs.push({ ...this.patientRegisterAbsDel[exist] })
this.patientRegisterAbsDel.splice(exist, 1)
} else {
this.patientRegister.patientRegisterAbs.push(asbItem);
}
}
}
}
},
@ -396,7 +422,7 @@ export default {
for (let j = 0; j < this.patientRegister.patientRegisterAbs.length; j++) {
if (this.patientRegister.medicalPackageAsb[i].asbitemId == this.patientRegister.patientRegisterAbs[j].asbitemId) {
this.patientRegister.patientRegisterAbs[j].groupPackageId = groupPackageId
this.patientRegisterAbsEdit.push({...this.patientRegister.patientRegisterAbs[j],})
this.patientRegisterAbsEdit.push({ ...this.patientRegister.patientRegisterAbs[j], })
finded = true
}
}
@ -415,11 +441,11 @@ export default {
};
//
let exist = arrayExistObj(this.patientRegisterAbsDel,'asbitemId',asbItem.asbitemId)
if(exist > -1){
this.patientRegister.patientRegisterAbs.push({...this.patientRegisterAbsDel[exist]})
this.patientRegisterAbsDel.splice(exist,1)
}else{
let exist = arrayExistObj(this.patientRegisterAbsDel, 'asbitemId', asbItem.asbitemId)
if (exist > -1) {
this.patientRegister.patientRegisterAbs.push({ ...this.patientRegisterAbsDel[exist] })
this.patientRegisterAbsDel.splice(exist, 1)
} else {
this.patientRegisterAbsAdd.push(asbItem);
}
}
@ -427,41 +453,106 @@ export default {
},
//
removeGroupPackageAsb(groupPackageId) {
removeGroupPackageAsb() {
let body = {}
let registerAsbitemIds = []
let chargeComplete = ''
// groupPackageId null
for (let i = 0; i < this.patientRegister.patientRegisterAbs.length; i++) {
if (this.patientRegister.patientRegisterAbs[i].groupPackageId == groupPackageId) {
//
if(!this.patientRegister.patientRegisterAbs[i].id){
this.patientRegisterAbsDel.push({id: this.patientRegister.patientRegisterAbs[i].id});
}
this.patientRegister.patientRegisterAbs.splice(i, 1);
i--;
if (this.patientRegister.patientRegisterAbs[i].isCharge == 'Y' || this.patientRegister.patientRegisterAbs[i].checkCompleteFlag != '0') {
chargeComplete += this.patientRegister.patientRegisterAbs[i].asbitemName + ','
this.patientRegister.patientRegisterAbs[i].groupPackageId = null
} else{
registerAsbitemIds.push(this.patientRegister.patientRegisterAbs[i].id)
this.patientRegister.patientRegisterAbs.splice(i, 1)
i--
}
}
if (chargeComplete) {
alert(`所选项目:${chargeComplete}已收费或已检,不可删除!`)
}
body = { registerAsbitemIds }
if(registerAsbitemIds.length > 0){
this.batchDelAsb(body,'');
}
let updateBody = []
if (this.patientRegister.patientRegisterAbs.length > 0) {
for (let i = 0; i < this.patientRegister.patientRegisterAbs.length; i++) {
updateBody.push({
registerAsbitemId: this.patientRegister.patientRegisterAbs[i].id,
input: {
chargePrice: this.patientRegister.patientRegisterAbs[i].chargePrice,
payTypeFlag: this.patientRegister.patientRegisterAbs[i].payTypeFlag,
isCharge: this.patientRegister.patientRegisterAbs[i].isCharge,
amount: this.patientRegister.patientRegisterAbs[i].amount,
groupPackageId: this.patientRegister.patientRegisterAbs[i].groupPackageId
}
})
}
this.batchEditAsb(updateBody,'');
}
},
//
getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 1) {
sums[index] = '合计';
return;
}
if(index == 0 || index == 4 || index == 5){
sums[index] = '';
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] += ' 元';
} else {
sums[index] = 'N/A';
}
});
return sums;
},
},
//
watch: {
//
"patientRegisterForm.customerOrgGroupId"(newVal, oldVal) {
console.log("watch patientRegisterForm.customerOrgGroupId newVal:",newVal," oldVal:",oldVal);
console.log("watch patientRegisterForm.customerOrgGroupId newVal:", newVal, " oldVal:", oldVal);
if (newVal != oldVal) {
this.getCustomerOrgGroupAsb(newVal,oldVal);
this.getCustomerOrgGroupAsb(newVal, oldVal);
}
},
//
"patientRegisterForm.medicalPackageId"(newVal, oldVal) {
console.log("watch patientRegisterForm.medicalPackageId newVal:",newVal," oldVal:",oldVal);
console.log("watch patientRegisterForm.medicalPackageId newVal:", newVal, " oldVal:", oldVal);
if (newVal != oldVal) {
this.getMedicalPackageAsb(newVal,oldVal);
this.getMedicalPackageAsb(newVal, oldVal);
}
},
//
"patientRegister.saveTimes"(newVal, oldVal){
this.onSubmit('')
"patientRegister.saveTimes"(newVal, oldVal) {
this.onSubmit()
},
},
};

5
src/components/patientRegister/PatientRegisterList.vue

@ -314,13 +314,14 @@ export default {
},
//
async rowick(row) {
rowick(row) {
this.patientRegister.photo = ""; //
this.patientRegister.patientRegisterId = row.id;
this.patientRegister.patientRegisterRd = row;
this.patientRegister.query.customerOrgParentId = row.customerOrgParentId;
this.getCustomerOrgGroup(row.customerOrgParentId);
await this.getPatientRegisterAbs(row.id);
this.dict.asbItem = [...this.dict.asbItemAll]
this.getPatientRegisterAbs(row.id);
},
//

16
src/store/index.js

@ -198,24 +198,26 @@ export default new Vuex.Store({
actions: {
//获取体检人员所选组合项目
getPatientRegisterAbs(context, id) {
//console.log('vuex getPatientRegisterAbs', context.state.dict.asbItemAll)
getapi(`/api/app/register-asbitem/in-patient-register-id/${id}`).then(
getPatientRegisterAbs(context, id){
//console.log(`vuex getPatientRegisterAbs /api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`, context.state.dict.asbItemAll)
getapi(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`).then(
(res) => {
console.log(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`, res)
if (res.code == 1) {
context.commit("setData", {
key: "patientRegister.patientRegisterAbs",
value: res.data,
});
context.commit("setData", {
key: "dict.asbItem",
value: arrayReduce(
[...context.state.dict.asbItemAll],
[...context.state.dict.asbItem],
[...context.state.patientRegister.patientRegisterAbs],
"id=asbitemId"
),
});
console.log(`/api/app/register-asbitem/in-patient-register-id/${id}`,context.state.dict.asbItem)
//console.log(`getPatientRegisterAbs ${id}`,context.state.dict.asbItem)
}
}
);
@ -223,9 +225,7 @@ export default new Vuex.Store({
//获取单位分组 /api/app/customer-org-group/in-customer-org-id/3a0c0444-d7a0-871f-4074-19faf1655caf
getCustomerOrgGroup(context, customerOrgld) {
console.log(
`vuex /api/app/customer-org-group/in-customer-org-id/${customerOrgld}`
);
console.log(`vuex /api/app/customer-org-group/in-customer-org-id/${customerOrgld}`);
getapi(
`/api/app/customer-org-group/in-customer-org-id/${customerOrgld}`
).then((res) => {

7
src/utlis/istoken.js

@ -35,6 +35,13 @@ export const yztoken = async () => {
//console.log('new token:',localStorage.getItem("token"))
//console.log('new expires_in',localStorage.getItem("expires_in"))
})
.catch((err) =>{
console.log(mm.apiurl + "/connect/token",{
client_id: "Peis_App",
grant_type: "refresh_token",
refresh_token: window.localStorage.getItem("refresh_token"),
},err)
});
}
};

Loading…
Cancel
Save