Browse Source

asbcheck

master
pengjun 2 years ago
parent
commit
eb50d1ede2
  1. 4
      src/components/patientRegister/PatientRegisterEdit.vue
  2. 257
      src/components/patientRegister/PatientRegisterItem.vue
  3. 5
      src/components/patientRegister/PatientRegisterList.vue
  4. 14
      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);
}
},

257
src/components/patientRegister/PatientRegisterItem.vue

@ -32,7 +32,8 @@
</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>
@ -51,7 +52,8 @@
<el-table-column label="支付方式" prop="payTypeFlag" width="100">
<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>
</el-table-column>
@ -113,6 +115,25 @@ export default {
// }
// ]
//
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) {
@ -131,31 +152,32 @@ export default {
}
})
}
this.batchEditAsb(body,'保存');
},
console.log(`/api/app/register-asbitem/many`,body)
putapi(`/api/app/register-asbitem/many`,body)
//
handleSelectionChange(val) {
// this.selecteddata = val;
this.asbItemChoosed = val;
//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("onSubmit", res);
console.log("addAbs", res);
if (res.code == 1) {
//
this.getPatientRegisterAbs(this.patientRegisterForm.id)
//
this.getAsbItemByItemType()
this.$message.success("操作成功");
if(msg) this.$message.success(`${msg}操作成功`);
}
})
.catch((err) => {
this.$message({type: "error",message: `操作失败,原因:${err}`});
this.$message({ type: "error", message: `${msg}操作失败,原因:${err}` });
});
},
//
handleSelectionChange(val) {
// this.selecteddata = val;
this.asbItemChoosed = val;
//console.log(this.asbItemChoosed);
},
//
@ -163,11 +185,17 @@ export default {
addAbs() {
let body = []
let checked = true
let payTypeFlag = '0' //
if (this.asbItemChoosed.length < 1) {
alert("请选择要添加的组合项目")
return
}
if (!this.patientRegisterForm.id) {
alert("请先保存人员体检基本信息!")
return
}
//
// "displayName": "",
// "shortName": "f",
@ -176,8 +204,8 @@ export default {
// "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.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
@ -186,92 +214,88 @@ export default {
}
//console.log(222,checked)
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)
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("addAbs", res);
if (res.code == 1) {
console.log("delAbs", res);
if (res.code != -1) {
//
this.getAsbItemByItemTypeAll()
if(msg){
//
this.getPatientRegisterAbs(this.patientRegisterForm.id)
//
this.getAsbItemByItemType()
this.$message.success(`${msg}操作成功`);
}
this.$message.success("操作成功");
}
})
.catch((err) => {
this.$message({type: "error",message: `操作失败,原因:${err}`});
this.$message({ type: "error", message: `${msg}操作失败,原因:${err}` });
});
},
//
selecteditems(val) {
this.patientRegisterAbsChoosed = val
},
//
///api/app/register-asbitem/many?RegisterAsbitemIds=3fa85f64-5717-4562-b3fc-2c963f66afa6
delAbs() {
let body = []
let checked = true
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
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
if (chargeComplete) {
alert(`所选项目:${chargeComplete}已收费或已检,不可删除!`)
if (this.patientRegisterAbsChoosed.length < 1) return
}
for (let i = 0; i < this.patientRegisterAbsChoosed.length; i++) {
body.push({
RegisterAsbitemIds: this.patientRegisterAbsChoosed[i].id,
})
registerAsbitemIds.push(this.patientRegisterAbsChoosed[i].id)
}
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()
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];
@ -282,7 +306,13 @@ export default {
} 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");
},
@ -304,22 +334,18 @@ 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) => {
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);
}
});
},
@ -427,18 +453,83 @@ 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});
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.patientRegister.patientRegisterAbs.splice(i, 1);
i--;
})
}
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;
},
},
//
@ -461,7 +552,7 @@ export default {
//
"patientRegister.saveTimes"(newVal, oldVal) {
this.onSubmit('')
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);
},
//

14
src/store/index.js

@ -199,23 +199,25 @@ 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(
//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