Browse Source

rydj

master
pengjun 2 years ago
parent
commit
7dbf596b15
  1. 59
      src/components/patientRegister/PatientRegisterEdit.vue
  2. 139
      src/components/patientRegister/PatientRegisterItem.vue
  3. 2
      src/components/patientRegister/PatientRegisterList.vue
  4. 8
      src/store/index.js

59
src/components/patientRegister/PatientRegisterEdit.vue

@ -253,43 +253,19 @@
</el-col>
<el-col :span="6">
<el-form-item label="分组" prop="customerOrgGroupId">
<el-select
v-model="form.customerOrgGroupId"
placeholder="请选择"
filterable
clearable
:disabled="
form.customerOrgId === dict.personOrgId ? true : false
"
>
<el-option
v-for="item in patientRegister.customerOrgGroup"
:key="item.id"
:label="item.displayName"
:value="item.id"
>
</el-option>
<el-select v-model="form.customerOrgGroupId" placeholder="请选择" filterable clearable
@change="changeCustomerOrgGroupId"
:disabled="form.customerOrgId === dict.personOrgId ? true : false">
<el-option v-for="item in patientRegister.customerOrgGroup" :key="item.id" :label="item.displayName" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="套餐" prop="medicalPackageId">
<el-select
v-model="form.medicalPackageId"
placeholder="请选择"
filterable
clearable
:disabled="
form.customerOrgId === dict.personOrgId ? false : true
"
>
<el-option
v-for="item in dict.medicalPackage"
:key="item.id"
:label="item.displayName"
:value="item.id"
>
</el-option>
<el-select v-model="form.medicalPackageId" placeholder="请选择" filterable clearable
@change="changeMedicalPackageId"
:disabled="form.customerOrgId === dict.personOrgId ? false : true">
<el-option v-for="item in dict.medicalPackage" :key="item.id" :label="item.displayName" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
@ -426,14 +402,7 @@
<el-table-column prop="maritalStatusId" label="婚姻">
<template slot-scope="scope">
<div>
{{
ldddw(
dict.maritalStatus,
"id",
scope.row.maritalStatusId,
"displayName"
)
}}
{{ ldddw(dict.maritalStatus,"id",scope.row.maritalStatusId,"displayName") }}
</div>
</template>
</el-table-column>
@ -581,6 +550,16 @@ export default {
console.log("this.form1", this.form);
},
//
changeCustomerOrgGroupId(){
this.patientRegister.customerOrgGroupChange++
},
//
changeMedicalPackageId(){
this.patientRegister.medicalPackageChange++
},
//
query(param) {
//

139
src/components/patientRegister/PatientRegisterItem.vue

@ -40,17 +40,17 @@
<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" />
<el-input v-model="patientRegister.patientRegisterAbs[scope.$index].chargePrice" size="small" />
</template>
</el-table-column>
<el-table-column label="数量" prop="amount">
<template slot-scope="scope">
<el-input v-model="patientRegister.patientRegisterAbs[scope.$index].amount" />
<el-input v-model="patientRegister.patientRegisterAbs[scope.$index].amount" size="small" />
</template>
</el-table-column>
<el-table-column label="支付方式" prop="payTypeFlag" width="100">
<template slot-scope="scope">
<el-select v-model="patientRegister.patientRegisterAbs[scope.$index].payTypeFlag">
<el-select v-model="patientRegister.patientRegisterAbs[scope.$index].payTypeFlag" size="small">
<el-option v-for="item in dict.payType" :key="item.id" :label="item.displayName" :value="item.id"
width="100" />
</el-select>
@ -115,7 +115,7 @@ export default {
// ]
//
batchEditAsb(body, msg) {
async batchEditAsb(body, msg) {
console.log(`/api/app/registerasbitem/updatemany`, body)
postapi(`/api/app/registerasbitem/updatemany`, body)
.then((res) => {
@ -134,9 +134,12 @@ export default {
},
//
onSubmit(msg) {
async onSubmit(msg) {
let body = [], insBody = []
if(!this.patientRegisterForm.id) return
if (!this.patientRegisterForm.id) {
alert("请先保存人员体检基本信息!")
return
}
if (this.patientRegister.patientRegisterAbs.length < 1) {
alert("暂无可操作的数据")
return
@ -155,10 +158,10 @@ export default {
})
} else {
insBody.push({
asbitemId: this.patientRegister.patientRegisterAbs[i].id,
asbitemId: this.patientRegister.patientRegisterAbs[i].asbitemId,
patientRegisterId: this.patientRegisterForm.id,
standardPrice: this.patientRegister.patientRegisterAbs[i].price,
chargePrice: this.patientRegister.patientRegisterAbs[i].price,
standardPrice: this.patientRegister.patientRegisterAbs[i].standardPrice,
chargePrice: this.patientRegister.patientRegisterAbs[i].chargePrice,
payTypeFlag:this.patientRegister.patientRegisterAbs[i].payTypeFlag,
isCharge: this.patientRegister.patientRegisterAbs[i].isCharge,
amount: this.patientRegister.patientRegisterAbs[i].amount,
@ -166,14 +169,17 @@ export default {
})
}
}
//if (body.length > 0 ) await this.batchEditAsb(body, msg);
if (body.length > 0 && insBody.length > 0){
this.batchAddAsb(insBody, '');
this.batchEditAsb(body, msg);
await this.batchEditAsb(body, '');
await this.batchAddAsb(insBody,msg);
}else if (body.length > 0 && insBody.length < 1){
this.batchEditAsb(body, msg);
await this.batchEditAsb(body, msg);
}else if (body.length < 1 && insBody.length > 0){
this.batchAddAsb(insBody, msg);
await this.batchAddAsb(insBody,msg);
}
},
//
@ -206,16 +212,12 @@ export default {
let body = []
let checked = true
let payTypeFlag = '0' //
let lfind = -1
if (this.asbItemChoosed.length < 1) {
alert("请选择要添加的组合项目")
return
}
if (!this.patientRegisterForm.id) {
alert("请先保存人员体检基本信息!")
return
}
//
// "displayName": "",
// "shortName": "f",
@ -234,9 +236,10 @@ 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({
let pojo = {
asbitemId: this.asbItemChoosed[i].id,
patientRegisterId: this.patientRegisterForm.id,
standardPrice: this.asbItemChoosed[i].price,
@ -244,10 +247,15 @@ export default {
payTypeFlag,
isCharge: "N",
amount: 1
})
}
body.push(pojo)
this.patientRegister.patientRegisterAbs.push({ ...pojo, asbitemName: this.asbItemChoosed[i].displayName })
lfind = arrayExistObj(this.dict.asbItem, 'id', this.asbItemChoosed[i].id)
if (lfind > -1) this.dict.asbItem.splice(lfind, 1)
}
if (this.patientRegisterForm.id) this.batchAddAsb(body, '添加组合项目');
this.batchAddAsb(body, '添加组合项目');
},
@ -285,12 +293,24 @@ export default {
let body = {}
let registerAsbitemIds = []
let chargeComplete = ''
let lfind = -1
if (this.patientRegisterAbsChoosed.length < 1) {
alert("请选择要移除的组合项目")
return
}
for (let i = 0; i < this.patientRegisterAbsChoosed.length; i++) {
//
if (!this.patientRegisterAbsChoosed[i].id) {
lfind = arrayExistObj(this.patientRegister.patientRegisterAbs, 'asbitemId', this.patientRegisterAbsChoosed[i].asbitemId)
if (lfind > -1) this.patientRegister.patientRegisterAbs.splice(lfind, 1)
this.patientRegisterAbsChoosed.splice(i, 1)
i--
continue
}
if (this.patientRegisterAbsChoosed[i].isCharge == 'Y' || this.patientRegisterAbsChoosed[i].checkCompleteFlag != '0') {
chargeComplete += this.patientRegisterAbsChoosed[i].asbitemName + ','
this.patientRegisterAbsChoosed.splice(i, 1)
@ -298,8 +318,11 @@ export default {
}
}
//
this.getAsbItemByItemType()
if (chargeComplete) {
alert(`所选项目:${chargeComplete}已收费或已检,不可删除!`)
this.$message({ type: "info", message: `所选项目:${chargeComplete}已收费或已检,不可删除!` });
if (this.patientRegisterAbsChoosed.length < 1) return
}
@ -308,8 +331,7 @@ export default {
}
body = { registerAsbitemIds }
this.batchDelAsb(body, '删除组合项目');
if (registerAsbitemIds.length > 0 && this.patientRegisterForm.id) this.batchDelAsb(body, '删除组合项目');
},
@ -353,18 +375,17 @@ export default {
// },
//
getCustomerOrgGroupAsb(customerOrgGroupId, oldVal) {
getCustomerOrgGroupAsb(customerOrgGroupId) {
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.removeGroupPackageAsb();
//
//;
this.addCustomerOrgGroupAsb(customerOrgGroupId);
}
});
@ -389,18 +410,18 @@ export default {
},
//
addCustomerOrgGroupAsb(groupPackageId) {
async addCustomerOrgGroupAsb(groupPackageId) {
let body = []
let payTypeFlag = '0'
let lfind = -1
let editCount = 0
if (this.patientRegisterForm.customerOrgId != this.dict.personOrgId) payTypeFlag = '1'
console.log('this.patientRegister.customerOrgGroupAsb', this.patientRegister.customerOrgGroupAsb)
for (let i = 0; i < this.patientRegister.customerOrgGroupAsb.length; i++) {
lfind = arrayExistObj(this.patientRegister.patientRegisterAbs, 'asbitemId', this.patientRegister.customerOrgGroupAsb[i].asbitemId)
if (lfind > - 1) {
this.patientRegister.patientRegisterAbs[lfind] = groupPackageId
editCount++
this.patientRegister.patientRegisterAbs[lfind].groupPackageId = groupPackageId
continue
}
let pojo = {
@ -415,19 +436,37 @@ export default {
}
body.push(pojo)
this.patientRegister.patientRegisterAbs.push({ ...pojo, asbitemName: this.patientRegister.customerOrgGroupAsb[i].displayName })
}
console.log('this.patientRegister.patientRegisterAbs', this.patientRegister.patientRegisterAbs)
// if (editCount > 0 && this.patientRegisterForm.id) await this.onSubmit('');
// if (body.length > 0 && this.patientRegisterForm.id) {
// await this.batchAddAsb(body, '');
// } else {
// //
// this.getAsbItemByItemType()
// }
if(this.patientRegister.patientRegisterAbs.length > 0 && this.patientRegisterForm.id){
await this.onSubmit('更换分组');
}
if(editCount>0) this.onSubmit()
if (body.length > 0 && this.patientRegisterForm.id) this.batchAddAsb(body, '更换分组');
},
//
addMedicalPackageAsb(groupPackageId) {
async addMedicalPackageAsb(groupPackageId) {
let body = []
let payTypeFlag = '0'
let lfind = -1
let editCount = 0
if (this.patientRegisterForm.customerOrgId != this.dict.personOrgId) payTypeFlag = '1'
for (let i = 0; i < this.patientRegister.medicalPackageAsb.length; i++) {
lfind = arrayExistObj(this.patientRegister.patientRegisterAbs, 'asbitemId', this.patientRegister.medicalPackageAsb[i].id)
if (lfind > - 1) {
this.patientRegister.patientRegisterAbs[lfind].groupPackageId = groupPackageId
editCount++
continue
}
let pojo = {
asbitemId: this.patientRegister.medicalPackageAsb[i].id,
patientRegisterId: this.patientRegisterForm.id,
@ -439,14 +478,20 @@ export default {
groupPackageId: groupPackageId
}
body.push(pojo)
this.patientRegister.patientRegisterAbs.push({...pojo,asbitemName:this.patientRegister.medicalPackageAsb[i].displayName})
this.patientRegister.patientRegisterAbs.push({ ...pojo, asbitemName: this.patientRegister.customerOrgGroupAsb[i].displayName })
}
if (body.length > 0 && this.patientRegisterForm.id) this.batchAddAsb(body, '更换套餐');
if (editCount > 0 && this.patientRegisterForm.id) await this.onSubmit('');
if (body.length > 0 && this.patientRegisterForm.id) {
await this.batchAddAsb(body, '更换分组');
} else {
//
this.getAsbItemByItemType()
}
},
//
removeGroupPackageAsb() {
async removeGroupPackageAsb() {
let body = {}
let registerAsbitemIds = []
let chargeComplete = ''
@ -478,12 +523,12 @@ export default {
}
if (chargeComplete) {
alert(`所选项目:${chargeComplete}已收费或已检,不可删除!`)
this.$message({ type: "info", message: `所选项目:${chargeComplete}已收费或已检,不可删除!` });
}
body = { registerAsbitemIds }
if (registerAsbitemIds.length > 0) {
this.batchDelAsb(body, '');
await this.batchDelAsb(body, '');
}
let updateBody = []
@ -503,7 +548,7 @@ export default {
})
}
}
this.batchEditAsb(updateBody, '');
await this.batchEditAsb(updateBody, '');
}
},
@ -545,18 +590,18 @@ export default {
//
watch: {
//
"patientRegisterForm.customerOrgGroupId"(newVal, oldVal) {
console.log("watch patientRegisterForm.customerOrgGroupId newVal:", newVal, " oldVal:", oldVal);
if (newVal != oldVal) {
this.getCustomerOrgGroupAsb(newVal);
"patientRegister.customerOrgGroupChange"(newVal, oldVal) {
console.log("watch patientRegister.customerOrgGroupChange newVal:", newVal, " oldVal:", oldVal);
if (newVal != oldVal && newVal > 0) {
this.getCustomerOrgGroupAsb(this.patientRegisterForm.customerOrgGroupId);
}
},
//
"patientRegisterForm.medicalPackageId"(newVal, oldVal) {
console.log("watch patientRegisterForm.medicalPackageId newVal:", newVal, " oldVal:", oldVal);
if (newVal != oldVal) {
this.getMedicalPackageAsb(newVal);
"patientRegister.medicalPackageChange"(newVal, oldVal) {
console.log("watch patientRegister.medicalPackageChange newVal:", newVal, " oldVal:", oldVal);
if (newVal != oldVal && newVal > 0) {
this.getMedicalPackageAsb(this.patientRegisterForm.medicalPackageId);
}
},

2
src/components/patientRegister/PatientRegisterList.vue

@ -319,6 +319,8 @@ export default {
this.patientRegister.patientRegisterId = row.id;
this.patientRegister.patientRegisterRd = row;
this.patientRegister.query.customerOrgParentId = row.customerOrgParentId;
this.patientRegister.customerOrgGroupChange = 0; //0
this.patientRegister.medicalPackageChange=0; //0
this.getCustomerOrgGroup(row.customerOrgParentId);
this.dict.asbItem = [...this.dict.asbItemAll]
this.getPatientRegisterAbs(row.id);

8
src/store/index.js

@ -87,6 +87,8 @@ export default new Vuex.Store({
}, //体检人员记录(初始值)一般创建用
customerOrgGroupAsb: [], //选中分组所包含的组合项目
medicalPackageAsb: [], //选中套餐所包含的组合项目
customerOrgGroupChange:0, //控制体检列表记录切换时,0 无需触发更换分组操作
medicalPackageChange:0, //控制体检列表记录切换时,0 无需触发更换套餐操作
query: {
times: 0, //触发查询次数
customerOrgId: "", //体检单位ID
@ -94,6 +96,7 @@ export default new Vuex.Store({
}, //查询条件
customerOrgGroup: [], //分组(针对单位)
patientRegisterAbs: [], //人员已选组合项目
},
//体检医生诊台
@ -226,9 +229,8 @@ 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}`);
getapi(
`/api/app/customer-org-group/in-customer-org-id/${customerOrgld}`
).then((res) => {
getapi(`/api/app/customer-org-group/in-customer-org-id/${customerOrgld}`)
.then((res) => {
console.log("vuex getCustomerOrgGroup", res.data);
if (res.code == 1) {
//this.patientRegister.customerOrgGroup = res.data

Loading…
Cancel
Save