pengjun 3 years ago
parent
commit
9e5f117e42
  1. 38
      src/components/patientRegister/PatientRegisterEdit.vue
  2. 377
      src/components/patientRegister/PatientRegisterItem.vue
  3. 5
      src/components/patientRegister/PatientRegisterList.vue
  4. 1
      src/components/patientRegister/patientRegisterAsbItem.vue
  5. 18
      src/store/index.js
  6. 4
      src/views/customerOrg/patientRegister.vue

38
src/components/patientRegister/PatientRegisterEdit.vue

@ -109,23 +109,23 @@
<el-row>
<el-col :span="5">
<el-form-item label="民族" prop="nationId">
<el-select v-model="form.nationId" placeholder="请选择" filterable
<el-select v-model="form.nationId" placeholder="请选择" filterable clearable
:style="'width:'+ Math.floor((window.pageWidth - 530)/ 4.8)+'px;'" >
<el-option v-for="item in dict.nation" :key="item.id" :label="item.displayName" :value="item.id" />
<el-option v-for="item in dict.nation" :key="item.nationId" :label="item.displayName" :value="item.nationId" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="籍惯" prop="nationId">
<el-select v-model="form.nationId" placeholder="请选择" filterable
<el-form-item label="籍惯" prop="birthPlaceId">
<el-select v-model="form.birthPlaceId" placeholder="请选择" filterable clearable
:style="'width:'+ Math.floor((window.pageWidth - 530)/ 4.8)+'px;'" >
<el-option v-for="item in dict.nation" :key="item.id" :label="item.displayName" :value="item.id" />
<el-option v-for="item in dict.birthPlace" :key="item.id" :label="item.displayName" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="体检类别" prop="medicalTypeId">
<el-select v-model="form.medicalTypeId" placeholder="请选择" filterable
<el-select v-model="form.medicalTypeId" placeholder="请选择" filterable clearable
:style="'width:'+ Math.floor((window.pageWidth - 530)/ 4.8)+'px;'" >
<el-option v-for="item in dict.medicalType" :key="item.id" :label="item.displayName"
:value="item.id" />
@ -134,7 +134,7 @@
</el-col>
<el-col :span="5">
<el-form-item label="人员类别" prop="personnelTypeId">
<el-select v-model="form.personnelTypeId" placeholder="请选择" filterable
<el-select v-model="form.personnelTypeId" placeholder="请选择" filterable clearable
:style="'width:'+ Math.floor((window.pageWidth - 530)/ 4.8)+'px;'" >
<el-option v-for="item in dict.personnelType" :key="item.id" :label="item.displayName"
:value="item.id" />
@ -309,7 +309,7 @@
<el-button @click="readIdCard" class="btnClass">读身份证</el-button>
</div>
<div class="btn">
<el-button type="success" class="btnClass" @click="Onsubmit('form')">保存</el-button>
<el-button type="success" class="btnClass" @click="Onsubmit('form',true)">保存</el-button>
</div>
<div class="btn">
<el-button type="primary" class="btnClass">申请单</el-button>
@ -440,6 +440,7 @@ export default {
telephone: "", //
mobileTelephone: "", //
nationId: null, //
birthPlaceId: null, //
postalCode: "", //
creatorId: null,
creationTime: "",
@ -457,6 +458,7 @@ export default {
"sexHormoneTermId",
"organizationUnitId",
"nationId",
"birthPlaceId",
], //uuidnull
rules: {
@ -509,11 +511,13 @@ export default {
//
changeCustomerOrgGroupId() {
this.patientRegister.customerOrgGroupChange++;
if(this.form.id) this.Onsubmit('form',false);
},
//
changeMedicalPackageId() {
this.patientRegister.medicalPackageChange++;
if(this.form.id) this.Onsubmit('form',false);
},
//
@ -569,7 +573,7 @@ export default {
},
//
Onsubmit(formName) {
Onsubmit(formName,msgTip) {
this.$refs[formName].validate((valid) => {
if (valid) {
//
@ -603,7 +607,7 @@ export default {
(res) => {
if (res.code == 1) {
//console.log('res',res)
this.$message.success("创健 操作成功");
if(msgTip) this.$message.success("创健 操作成功");
objCopy(res.data, this.form);
this.patientRegister.patientRegisterId = res.data.id;
this.patientRegister.patientRegisterId = res.data.id;
@ -615,18 +619,12 @@ export default {
);
} else {
//id
console.log(
`/api/app/patient-register?PatientRegisterId=${this.form.id}`,
body
);
putapi(
`/api/app/patient-register?PatientRegisterId=${this.form.id}`,
body
).then((res) => {
console.log(`/api/app/patient-register?PatientRegisterId=${this.form.id}`,body);
putapi(`/api/app/patient-register?PatientRegisterId=${this.form.id}`,body).then((res) => {
if (res.code == 1) {
this.$message.success("更新 操作成功");
if(msgTip) this.$message.success("更新 操作成功");
this.patientRegister.query.times++;
this.patientRegister.saveTimes++;
//this.patientRegister.saveTimes++; //
}
});
}

377
src/components/patientRegister/PatientRegisterItem.vue

@ -1,5 +1,4 @@
<template>
<div style="display: flex; margin-left: 10px; margin-top: 20px;">
<div style="width:230px;">
<div>
@ -11,9 +10,10 @@
</div>
<div class="mainareaBox">
<el-table :header-cell-style="{ background: '#eef1f6' }" :data="dict.asbItem" :height="(window.pageHeight>735 ? (window.pageHeight - 537):198)"
<el-table :header-cell-style="{ background: '#eef1f6' }" :data="dict.asbItem"
:height="(window.pageHeight > 735 ? (window.pageHeight - 537) : 198)" @row-dblclick="dbClickChoosedAsb"
@selection-change="handleSelectionChange" size="small">
<el-table-column type="selection" />
<el-table-column type="selection" align="center" />
<el-table-column prop="displayName" label="未选组合项目" width="120" />
<!--
<el-table-column prop="price" label="标准价格" width="70">
@ -37,13 +37,15 @@
</el-button>
</div>
<div class="btnList">
<el-button type="primary" @click="delAbs">移除 <i class="el-icon-back"></i>
<el-button type="primary" @click="delAbs(patientRegisterAbsChoosed)">移除 <i class="el-icon-back"></i>
</el-button>
</div>
<!-- 不显示保存当已选组合有修改时失去焦点自动保存
<div class="btnList">
<el-button type="success" @click="onSubmit('保存')">保存 <i class="el-icon-check"></i>
</el-button>
</div>
-->
</div>
<div :style="'width:' + (window.pageWidth - 120 - 30 - 230 - 100) + 'px;'">
@ -52,44 +54,47 @@
<el-tooltip class="item" effect="dark" content="根据输入的折扣,自动计算折后总价" placement="top">
<span>折扣 </span>
</el-tooltip>
<el-input style="width:55px;" v-model="discount" size="small" @input="changeAllDiscount" type="number"/>
<el-input style="width:55px;" v-model="discount" size="small" type="number" @input="changeAllDiscount"
@focus="discountFoucs = true" @blur="discountFoucs = false" />
</div>
<div class="disTotal">
<el-tooltip class="item" effect="dark" content="总金额即该人员此次体检实收金额,并根据此金额自动计算折扣" placement="top">
<span>总金额 </span>
</el-tooltip>
<el-input style="width:70px;" v-model="total" size="small" @input="changeTotal" type="number"/>
<el-input style="width:70px;" v-model="total" size="small" type="number" @input="changeTotal"
@focus="totalFoucs = true" @blur="totalFoucs = false" />
</div>
<div class="disTotal">
<el-select v-model="asbItemId" placeholder="快速选择组合项目" size="small"
filterable clearable @change="quickChoosedAsb" style="width:150px;text-align: left;padding-right: 15px;">
<el-option v-for="item in dict.asbItemQuick" :key="item.id" :value="item.id"
:label="item.displayName" />
<el-select v-model="asbItemId" placeholder="快速选择组合项目" size="small" filterable clearable remote
:remote-method="remoteMethod" @change="quickChoosedAsb" default-first-option
style="width:150px;text-align: left;padding-right: 15px;">
<el-option v-for="item in quickAsb" :key="item.id" :value="item.id" :label="item.displayName" />
</el-select>
</div>
</div>
<div class="mainareaBox">
<el-table :data="patientRegister.patientRegisterAbs"
:height="(window.pageHeight>735 ? (window.pageHeight - 537):198)" width="100%"
:summary-method="getSummaries" show-summary
@selection-change="selecteditems" size="small">
:height="(window.pageHeight > 735 ? (window.pageHeight - 537) : 198)" width="100%" :summary-method="getSummaries"
show-summary @row-dblclick="removeAbs" @selection-change="selecteditems" size="small">
<!-- temporaryselection personnelUnit.nogroupselected-->
<el-table-column type="selection"/>
<el-table-column type="selection" align="center" />
<el-table-column label="已选组合项目" width="120" prop="asbitemName" />
<el-table-column label="标准价格" prop="standardPrice" width="70"/>
<el-table-column label="标准价格" prop="standardPrice" width="70" align="center" />
<el-table-column label="折扣" prop="discount" width="60">
<template slot-scope="scope">
<el-input type="number" v-model="scope.row.discount" size="small" @input="changeDiscount(scope.$index)"/>
<el-input type="number" v-model="scope.row.discount" size="small" @input="changeDiscount(scope.$index)"
@blur="onSubmit('')" />
</template>
</el-table-column>
<el-table-column label="数量" prop="amount" width="50">
<template slot-scope="scope">
<el-input type="number" v-model="scope.row.amount" size="small" />
<el-input type="number" v-model="scope.row.amount" size="small" @blur="onSubmit('')" />
</template>
</el-table-column>
<el-table-column label="实收价格" prop="chargePrice" width="70">
<template slot-scope="scope">
<el-input type="number" v-model="patientRegister.patientRegisterAbs[scope.$index].chargePrice" size="small" @input="changePrice(scope.$index)"/>
<el-input type="number" v-model="patientRegister.patientRegisterAbs[scope.$index].chargePrice" size="small"
@input="changePrice(scope.$index)" @blur="onSubmit('')" />
</template>
</el-table-column>
<el-table-column prop="total" label="金额" width="70" v-if="false" />
@ -97,18 +102,38 @@
<el-table-column label="支付方式" prop="payTypeFlag" width="100">
<template slot-scope="scope">
<el-select v-model="scope.row.payTypeFlag" size="small">
<el-option v-for="item in dict.payType" :key="item.id"
:label="item.displayName" :value="item.id" />
<el-option v-for="item in dict.payType" :key="item.id" :label="item.displayName" :value="item.id" />
</el-select>
</template>
</el-table-column>
<el-table-column prop="isCharge" label="收费" width="50" align="center">
<template slot-scope="scope">
<el-checkbox :value="scope.row.isCharge == 'Y'" />
</template>
</el-table-column>
<el-table-column prop="checkCompleteFlag" label="状态" align="center">
<template slot-scope="scope">
<div>{{ ldddw(dict.checkCompleteFlag, "id", scope.row.checkCompleteFlag, "displayName") }}</div>
</template>
</el-table-column>
<el-table-column prop="isLock" label="锁" width="50" align="center">
<template slot-scope="scope">
<el-checkbox :value="scope.row.isLock == 'Y'" />
</template>
</el-table-column>
<el-table-column prop="creatorName" label="登记人" align="center"></el-table-column>
<el-table-column prop="creationTime" label="登记日期" width="90" align="center">
<template slot-scope="scope">
<div>{{ lmoment(scope.row.creationTime, 'yyyy-MM-DD') }}</div>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</template>
<script>
import moment from 'moment';
import { mapState, mapActions } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { arrayFilter, arrayReduce, arrayExistObj, dddw } from "../../utlis/proFunc";
@ -142,6 +167,9 @@ export default {
discount: 100,
total: 0,
totalStand: 0,
quickAsb: [],
totalFoucs: false, //
discountFoucs: false, //
};
},
computed: {
@ -151,11 +179,15 @@ export default {
mounted() { },
methods: {
...mapActions(['getCustomerOrgGroup', 'getMedicalPackageAsb', 'getPatientRegisterAbs']),
...mapActions(['getCustomerOrgGroup', 'getPatientRegisterAbs']),
ldddw(arrayData, key, value, display) {
return dddw(arrayData, key, value, display);
},
lmoment(date, forMat) {
return moment(new Date(date)).format(forMat);
},
//
// [
// {
@ -173,9 +205,9 @@ export default {
//
async batchEditAsb(body, msg) {
console.log(`/api/app/registerasbitem/updatemany`, body)
postapi(`/api/app/registerasbitem/updatemany`, body)
await postapi(`/api/app/registerasbitem/updatemany`, body)
.then((res) => {
console.log("onSubmit", res);
console.log("batchEditAsb", res);
if (res.code == 1) {
if (msg) {
//
@ -193,11 +225,11 @@ export default {
async onSubmit(msg) {
let body = [], insBody = []
if (!this.patientRegisterForm.id) {
alert("请先保存人员体检基本信息!")
//alert("")
return
}
if (this.patientRegister.patientRegisterAbs.length < 1) {
alert("暂无可操作的数据")
//alert("")
return
}
for (let i = 0; i < this.patientRegister.patientRegisterAbs.length; i++) {
@ -227,6 +259,7 @@ export default {
}
//if (body.length > 0 ) await this.batchEditAsb(body, msg);
console.log('111111', msg, body.length, body, insBody.length, insBody);
if (body.length > 0 && insBody.length > 0) {
await this.batchEditAsb(body, '');
await this.batchAddAsb(insBody, msg);
@ -246,9 +279,9 @@ export default {
},
//
batchAddAsb(body, msg) {
async batchAddAsb(body, msg) {
console.log(`/api/app/registerasbitem/createmany?CustomerOrgId=${this.patientRegisterForm.customerOrgId}`, body)
postapi(`/api/app/registerasbitem/createmany?CustomerOrgId=${this.patientRegisterForm.customerOrgId}`, body)
await postapi(`/api/app/registerasbitem/createmany?CustomerOrgId=${this.patientRegisterForm.customerOrgId}`, body)
.then((res) => {
console.log("batchAddAsb", res);
if (res.code == 1) {
@ -265,7 +298,7 @@ export default {
//
///api/app/register-asbitem/many/3fa85f64-5717-4562-b3fc-2c963f66afa6'
addAbs(asbItemChoosed) {
async addAbs(asbItemChoosed) {
let body = []
let checked = true
let payTypeFlag = '0' //
@ -310,13 +343,15 @@ export default {
this.patientRegister.patientRegisterAbs.push({ ...pojo, asbitemName: asbItemChoosed[i].displayName })
lfind = arrayExistObj(this.dict.asbItem, 'id', asbItemChoosed[i].id)
if (lfind > -1) this.dict.asbItem.splice(lfind, 1)
}
if (this.patientRegisterForm.id) this.batchAddAsb(body, '添加组合项目');
lfind = arrayExistObj(this.dict.asbItemQuick, 'id', asbItemChoosed[i].id)
if (lfind > -1) this.dict.asbItemQuick.splice(lfind, 1)
},
}
if (this.patientRegisterForm.id) await this.batchAddAsb(body, '添加组合项目');
},
//
selecteditems(val) {
@ -324,9 +359,9 @@ export default {
},
//
batchDelAsb(body, msg) {
async batchDelAsb(body, msg) {
console.log(`/api/app/registerasbitem/deletemany`, body)
postapi(`/api/app/registerasbitem/deletemany`, body)
await postapi(`/api/app/registerasbitem/deletemany`, body)
.then((res) => {
console.log("delAbs", res);
if (res.code != -1) {
@ -345,33 +380,34 @@ export default {
this.$message({ type: "error", message: `${msg}操作失败,原因:${err}` });
});
},
//
///api/app/register-asbitem/many?RegisterAsbitemIds=3fa85f64-5717-4562-b3fc-2c963f66afa6
delAbs() {
delAbs(absForDel) {
let body = {}
let registerAsbitemIds = []
let chargeComplete = ''
let lfind = -1
if (this.patientRegisterAbsChoosed.length < 1) {
if (absForDel.length < 1) {
alert("请选择要移除的组合项目")
return
}
for (let i = 0; i < this.patientRegisterAbsChoosed.length; i++) {
for (let i = 0; i < absForDel.length; i++) {
//
if (!this.patientRegisterAbsChoosed[i].id) {
lfind = arrayExistObj(this.patientRegister.patientRegisterAbs, 'asbitemId', this.patientRegisterAbsChoosed[i].asbitemId)
if (!absForDel[i].id) {
lfind = arrayExistObj(this.patientRegister.patientRegisterAbs, 'asbitemId', absForDel[i].asbitemId)
if (lfind > -1) this.patientRegister.patientRegisterAbs.splice(lfind, 1)
this.patientRegisterAbsChoosed.splice(i, 1)
absForDel.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)
if (absForDel[i].isCharge == 'Y' || absForDel[i].checkCompleteFlag != '0') {
chargeComplete += absForDel[i].asbitemName + ','
absForDel.splice(i, 1)
i--
}
}
@ -381,11 +417,11 @@ export default {
if (chargeComplete) {
this.$message({ type: "info", message: `所选项目:${chargeComplete}已收费或已检,不可删除!` });
if (this.patientRegisterAbsChoosed.length < 1) return
if (absForDel.length < 1) return
}
for (let i = 0; i < this.patientRegisterAbsChoosed.length; i++) {
registerAsbitemIds.push(this.patientRegisterAbsChoosed[i].id)
for (let i = 0; i < absForDel.length; i++) {
registerAsbitemIds.push(absForDel[i].id)
}
body = { registerAsbitemIds }
@ -393,9 +429,14 @@ export default {
},
//
removeAbs(row) {
this.delAbs([row]);
},
//
getAsbItemByItemTypeAll() {
console.log('getAsbItemByItemType', typeof this.itemTypeIds, this.itemTypeIds)
//console.log('getAsbItemByItemType', typeof this.itemTypeIds, this.itemTypeIds)
let lv = "";
if (typeof this.itemTypeIds === "object") {
lv = this.itemTypeIds[this.itemTypeIds.length - 1];
@ -406,7 +447,8 @@ export default {
} else {
this.dict.asbItem = [...this.dict.asbItemAll];
}
console.log('lv,this.dict.asbItem', lv, this.dict.asbItem)
//console.log('lv,this.dict.asbItem', lv, this.dict.asbItem)
this.dict.asbItemQuick = [...this.dict.asbItemAll];
},
@ -415,6 +457,7 @@ export default {
this.getAsbItemByItemTypeAll()
//
arrayReduce(this.dict.asbItem, [...this.patientRegister.patientRegisterAbs], "id=asbitemId");
arrayReduce(this.dict.asbItemQuick, [...this.patientRegister.patientRegisterAbs], "id=asbitemId");
},
@ -433,131 +476,100 @@ export default {
// },
//
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();
// async 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);
}
});
},
// //;
// this.addCustomerOrgGroupAsb(customerOrgGroupId);
// }
// });
// },
// /
getGroupPackageAsb(typeFlag, groupPackageId) {
let delBody = {};
let url = typeFlag == 'group' ?
'/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem/'
: '/api/app/medical-package-detail/medical-package-in-asbitem?MedicalPackageId=';
let msg = typeFlag == 'group' ? '更换分组' : '更换套餐';
//
getMedicalPackageAsb(medicalPackageId) {
console.log(`/api/app/medical-package-detail/medical-package-in-asbitem?MedicalPackageId=${medicalPackageId}`);
getapi(`/api/app/medical-package-detail/medical-package-in-asbitem?MedicalPackageId=${medicalPackageId}`)
console.log(`${url}${groupPackageId}`);
getapi(`${url}${groupPackageId}`)
.then((res) => {
console.log("getMedicalPackageAsb", res);
if (res.code == 1) {
this.patientRegister.medicalPackageAsb = res.data;
console.log("getGroupPackageAsb", res);
if (res.code != -1) {
//this.patientRegister.medicalPackageAsb = res.data;
//return this.promiseRemoveGroupPackageAsb();
//
this.removeGroupPackageAsb();
delBody = this.removeGroupPackageAsb();
//
this.addGroupPackageAsb(res.data, groupPackageId);
//console.log('delBody', delBody,delBody['registerAsbitemIds'].length);
if (delBody['registerAsbitemIds'].length > 0) {
return postapi(`/api/app/registerasbitem/deletemany`, delBody)
} else {
this.onSubmit(msg);
}
}
})
.then(res => {
//console.log('res', res);
if (res && res.code != -1) {
//
this.addMedicalPackageAsb(medicalPackageId);
this.onSubmit(msg);
}
});
},
//
async addCustomerOrgGroupAsb(groupPackageId) {
let body = []
let payTypeFlag = '0'
let lfind = -1
let editCount = 0
///
addGroupPackageAsb(groupPackageAsb, groupPackageId) {
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 = groupPackageId
continue
}
let pojo = {
asbitemId: this.patientRegister.customerOrgGroupAsb[i].asbitemId,
patientRegisterId: this.patientRegisterForm.id,
standardPrice: this.patientRegister.customerOrgGroupAsb[i].price,
chargePrice: this.patientRegister.customerOrgGroupAsb[i].customerOrgGroupDetailPrice,
payTypeFlag,
isCharge: "N",
amount: 1,
groupPackageId: groupPackageId
}
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('更换分组');
}
},
//
async addMedicalPackageAsb(groupPackageId) {
let body = []
let payTypeFlag = '0'
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 (this.patientRegisterForm.customerOrgId != this.dict.personOrgId) payTypeFlag = '1' //
for (let i = 0; i < groupPackageAsb.length; i++) {
lfind = arrayExistObj(this.patientRegister.patientRegisterAbs, 'asbitemId', groupPackageAsb[i].id)
if (lfind > - 1) {
this.patientRegister.patientRegisterAbs[lfind].groupPackageId = groupPackageId
editCount++
continue
}
let pojo = {
asbitemId: this.patientRegister.medicalPackageAsb[i].id,
asbitemId: groupPackageAsb[i].id,
patientRegisterId: this.patientRegisterForm.id,
standardPrice: this.patientRegister.medicalPackageAsb[i].price,
chargePrice: this.patientRegister.medicalPackageAsb[i].price,
standardPrice: groupPackageAsb[i].price,
chargePrice: groupPackageAsb[i].price,
payTypeFlag,
discount: 100,
isCharge: "N",
amount: 1,
groupPackageId: groupPackageId
}
body.push(pojo)
this.patientRegister.patientRegisterAbs.push({ ...pojo, asbitemName: this.patientRegister.customerOrgGroupAsb[i].displayName })
}
if (editCount > 0 && this.patientRegisterForm.id) await this.onSubmit('');
if (body.length > 0 && this.patientRegisterForm.id) {
await this.batchAddAsb(body, '更换分组');
} else {
//
this.getAsbItemByItemType()
this.patientRegister.patientRegisterAbs.push({ ...pojo, asbitemName: groupPackageAsb[i].displayName })
}
},
//
async removeGroupPackageAsb() {
let body = {}
removeGroupPackageAsb() {
let body = { registerAsbitemIds: [] }
let registerAsbitemIds = []
let chargeComplete = ''
//
if (!this.patientRegisterForm.id) {
this.patientRegister.patientRegisterAbs = []
return
this.patientRegister.patientRegisterAbs = [];
return body;
}
// groupPackageId null
@ -584,47 +596,57 @@ export default {
this.$message({ type: "info", message: `所选项目:${chargeComplete}已收费或已检,不可删除!` });
}
body = { registerAsbitemIds }
if (registerAsbitemIds.length > 0) {
await this.batchDelAsb(body, '');
}
body = { registerAsbitemIds };
let updateBody = []
if (this.patientRegister.patientRegisterAbs.length > 0) {
for (let i = 0; i < this.patientRegister.patientRegisterAbs.length; i++) {
//
if (this.patientRegister.patientRegisterAbs[i].id) {
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
}
})
}
}
await this.batchEditAsb(updateBody, '');
}
return body;
},
//
dbClickChoosedAsb(row) {
this.addAbs([row]);
},
//
quickChoosedAsb(v) {
// value-key value console.log('quickChoosedAsb',v)
let lfind = -1
let asbItemChoosed = []
console.log('quickChoosedAsb',v,this.dict.asbItemQuick)
if (v) {
lfind = arrayExistObj(this.dict.asbItemQuick, 'id', v)
if (lfind > -1) {
asbItemChoosed.push(this.dict.asbItemQuick[lfind])
this.addAbs(asbItemChoosed)
this.addAbs([this.dict.asbItemQuick[lfind]])
}
}
},
// quickChoosedAsb(v){
// let lfind = -1
// let asbItemChoosed = []
// console.log('quickChoosedAsb',v,this.dict.asbItemQuick)
// if(v){
// lfind = arrayExistObj(this.dict.asbItemQuick,'id',v)
// if(lfind > -1){
// asbItemChoosed.push(this.dict.asbItemQuick[lfind])
// this.addAbs(asbItemChoosed)
// }
// }
// },
//
remoteMethod(keyWords) {
//console.log('remoteMethod',this.dict.asbItemQuick)
if (keyWords) {
this.quickAsb = [];
this.dict.asbItemQuick.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.quickAsb.push(item);
}
});
} else {
this.quickAsb = [...this.dict.asbItemQuick];
}
},
//
changeAllDiscount() {
@ -733,9 +755,10 @@ export default {
// }
});
this.totalStand = sums[2]
this.total = sums[5]
this.discount = Number(this.total * 100 / this.totalStand).toFixed(2)
this.totalStand = sums[2];
//console.log('this.totalFoucs/this.discountFoucs',this.totalFoucs,this.discountFoucs)
if (!this.totalFoucs) this.total = sums[5];
if (!this.discountFoucs) this.discount = Number(this.total * 100 / this.totalStand).toFixed(2);
return sums;
},
@ -747,7 +770,8 @@ export default {
"patientRegister.customerOrgGroupChange"(newVal, oldVal) {
console.log("watch patientRegister.customerOrgGroupChange newVal:", newVal, " oldVal:", oldVal);
if (newVal != oldVal && newVal > 0) {
this.getCustomerOrgGroupAsb(this.patientRegisterForm.customerOrgGroupId);
//this.getCustomerOrgGroupAsb(this.patientRegisterForm.customerOrgGroupId);
this.getGroupPackageAsb('group', this.patientRegisterForm.customerOrgGroupId);
}
},
@ -755,13 +779,17 @@ export default {
"patientRegister.medicalPackageChange"(newVal, oldVal) {
console.log("watch patientRegister.medicalPackageChange newVal:", newVal, " oldVal:", oldVal);
if (newVal != oldVal && newVal > 0) {
this.getMedicalPackageAsb(this.patientRegisterForm.medicalPackageId);
//this.getMedicalPackageAsb(this.patientRegisterForm.medicalPackageId);
this.getGroupPackageAsb('medical', this.patientRegisterForm.medicalPackageId);
}
},
//
//
"patientRegister.saveTimes"(newVal, oldVal) {
this.onSubmit('')
console.log("patientRegister.saveTimes newVal:", newVal, " oldVal:", oldVal);
if (newVal != oldVal) {
this.onSubmit('');
}
},
},
};
@ -778,6 +806,7 @@ export default {
margin-left: 5px;
margin-right: 5px;
}
.disTotal {
margin-left: 10px;
}
@ -798,6 +827,7 @@ export default {
padding-left: 1px;
padding-right: 1px;
}
::v-deep .el-table .cell {
padding-left: 1px;
padding-right: 1px;
@ -809,6 +839,5 @@ input[type="number"]::-webkit-outer-spin-button {
-webkit-appearance: none !important;
margin: 0 !important;
}
</style>

5
src/components/patientRegister/PatientRegisterList.vue

@ -49,7 +49,7 @@
<el-table-column prop="nationId" label="民族">
<template slot-scope="scope">
<div>
{{ ldddw(dict.nation, "id", scope.row.nationId, "displayName") }}
{{ ldddw(dict.nation, "nationId", scope.row.nationId, "displayName") }}
</div>
</template>
</el-table-column>
@ -61,7 +61,7 @@
</div>
</template>
</el-table-column>
<el-table-column prop="email" label="邮箱" width="100" />
<el-table-column prop="email" label="邮箱" width="180" />
<el-table-column prop="mobileTelephone" label="手机" width="100" />
<el-table-column prop="telephone" label="电话" width="100" />
<el-table-column prop="address" label="地址" width="300" />
@ -269,6 +269,7 @@ export default {
this.patientRegister.patientRegisterAbs = [];
this.dialogVisible = true;
this.editTimes++; //
this.getPatientRegisterAbs();
},
edit() {

1
src/components/patientRegister/patientRegisterAsbItem.vue

@ -99,6 +99,7 @@ export default {
return prev;
}
}, 0);
sums[index] = Math.round(sums[index],2);
sums[index] += ' 元';
} else {
sums[index] = 'N/A';

18
src/store/index.js

@ -257,6 +257,7 @@ export default new Vuex.Store({
//获取体检人员所选组合项目
getPatientRegisterAbs(context, id) {
//console.log(`vuex getPatientRegisterAbs /api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`, context.state.dict.asbItemAll)
if(id){
getapi(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`).then(
(res) => {
console.log(`/api/app/registerasbitem/getlistinpatientregisterid?PatientRegisterId=${id}`, res)
@ -284,10 +285,25 @@ export default new Vuex.Store({
key: "dict.asbItemQuick",
value: arrayReduce([...context.state.dict.asbItemAll],[...context.state.patientRegister.patientRegisterAbs],"id=asbitemId"),
});
//console.log(`getPatientRegisterAbs ${id}`,context.state.dict.asbItem)
//console.log(`getPatientRegisterAbs ${id}`,context.state.dict.asbItemQuick)
}
}
);
}else{
context.commit("setData", {
key: "patientRegister.patientRegisterAbs",
value:[],
});
context.commit("setData", {
key: "dict.asbItem",
value: [...context.state.dict.asbItemAll],
});
context.commit("setData", {
key: "dict.asbItemQuick",
value: [...context.state.dict.asbItemAll],
});
}
},
//获取单位分组 /api/app/customer-org-group/in-customer-org-id/3a0c0444-d7a0-871f-4074-19faf1655caf

4
src/views/customerOrg/patientRegister.vue

@ -119,8 +119,8 @@ export default {
//
getapi("/api/app/nation/in-filter").then((res) => {
if (res.code == 1) {
this.dict.nation = res.data.items;
if (res.code != - 1) {
this.dict.nation = res.data;
}
});

Loading…
Cancel
Save