Browse Source

batchitem

master
pengjun 2 years ago
parent
commit
72395eab07
  1. 332
      src/components/patientRegister/PatientRegisterList.vue

332
src/components/patientRegister/PatientRegisterList.vue

@ -197,7 +197,7 @@
</el-dialog>
<!-- 批量调整分组 -->
<el-dialog title="批量调整分组" :visible.sync="dialogGroup" width="400" height="800" :append-to-body="true"
<el-dialog title="批量调整分组" :visible.sync="dialogGroup" width="600px" height="800" :append-to-body="true"
:close-on-click-modal="false">
<div>
<div>
@ -226,7 +226,7 @@
</el-dialog>
<!-- 批量调整分组 -->
<el-dialog title="批量调整项目" :visible.sync="dialogAsbitem" width="400" height="800" :append-to-body="true"
<el-dialog title="批量调整项目" :visible.sync="dialogAsbitem" width="600px" height="800" :append-to-body="true"
:close-on-click-modal="false">
<div>
<div>
@ -234,44 +234,65 @@
</div>
<div>
<br /><el-radio v-model="asbitemBatch.operate" label="add">增加项目</el-radio>
<el-radio v-model="asbitemBatch.operate" label="del">删除项目</el-radio>
<el-radio v-model="asbitemBatch.operate" label="del">删除项目</el-radio>
</div>
<div>
<br /><el-checkbox v-model="asbitemBatch.isDeleteGroup" :disabled="asbitemBatch.operate == 'add' ? true:false" >如果删除项目属于分组则删除体检记录信息的分组设置</el-checkbox>
<br /><el-checkbox v-model="asbitemBatch.isDeleteGroup"
:disabled="asbitemBatch.operate == 'add' ? true : false">如果删除项目属于分组则删除体检记录信息的分组设置</el-checkbox>
</div>
<div>
<br /><span>直接录入</span>
<br /><span>直接录入</span>
<el-select v-model="asbitemBatch.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>
<el-table :data="asbitemBatch.asbitemsTemp"
height="200" width="100%"
show-summary @row-dblclick="removeAbs" size="small" @row-click="rowClickaAbitemCurr">
<el-table-column label="组合项目" width="120" prop="asbitemName" />
<el-table-column v-if="asbitemBatch.operate == 'add' ? true:false" label="数量" prop="amount" width="50">
<template slot-scope="scope">
<el-input type="number" v-model="scope.row.amount" size="small" />
</template>
</el-table-column>
<el-table-column v-if="asbitemBatch.operate == 'add' ? true:false" label="实收价格" prop="chargePrice" width="70">
<template slot-scope="scope">
<el-input type="number" v-model="patientRegister.patientRegisterAbs[scope.$index].chargePrice" size="small" />
</template>
</el-table-column>
<el-table-column v-if="asbitemBatch.operate == 'add' ? true:false" 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-select>
</template>
</el-table-column>
</el-table>
</div>
<div style="display: flex;margin-top: 2px;">
<div style="width:480px;">
<el-table :data="asbitemBatch.asbitemsTemp" height="240" width="100%" show-summary @row-dblclick="removeAbs"
size="small" @row-click="rowClickaAbitemCurr" border>
<el-table-column label="组合项目" width="150" prop="asbitemName" />
<el-table-column label="数量" prop="amount" width="60">
<template slot-scope="scope">
<el-input type="number" v-model="scope.row.amount" size="small"
:disabled="asbitemBatch.operate == 'del' ? true : false" />
</template>
</el-table-column>
<el-table-column label="实收价格" prop="chargePrice" width="90">
<template slot-scope="scope">
<el-input type="number" v-model="scope.row.chargePrice" size="small"
:disabled="asbitemBatch.operate == 'del' ? true : false" />
</template>
</el-table-column>
<el-table-column label="支付方式" prop="payTypeFlag" width="120">
<template slot-scope="scope">
<el-select v-model="scope.row.payTypeFlag" size="small"
:disabled="asbitemBatch.operate == 'del' ? true : false">
<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>
</div>
<div style="display: block; width: 110px; margin-left: 10px;">
<div style="margin-top: 5px;">
<el-button type="danger" @click="asbitemDel(1)" style="width: 100px;">删除</el-button>
</div>
<div style="margin-top: 5px;">
<el-button type="danger" @click="asbitemDel(0)" style="width: 100px;">删除全部</el-button>
</div>
<div style="margin-top: 5px;">
<el-button type="primary" @click="changePayTypeFlag('0')" style="width: 100px;">全个人支付</el-button>
</div>
<div style="margin-top: 5px;">
<el-button type="primary" @click="changePayTypeFlag('1')" style="width: 100px;">全单位支付</el-button>
</div>
<div style="margin-top: 5px;">
<el-button type="primary" @click="changePayTypeFlag('2')" style="width: 100px;">全赠送</el-button>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="asbitemBatchHandle"> </el-button>
@ -320,49 +341,25 @@ export default {
isReserveAddAsbitem: true, //
},
dialogAsbitem:false,
asbitemBatch:{
operate:'add',
isDeleteGroup:false,
asbItemId:'',
asbitemsTemp:[], //
asbitemCurr:{}, //()
},
quickAsb:[], //
asbitemDelBatch:{
isDeleteGroup:'N',
patientRegisterId:null,
asbitemIds:[],
dialogAsbitem: false,
asbitemBatch: {
operate: 'add',
isDeleteGroup: false,
asbItemId: '',
asbitemsTemp: [], //
asbitemCurr: {}, //()
},
asbitemAddBatch:{
organizationUnitId: null,
createRegisterAsbitemDtos: [],
// [
// {
// asbitemId: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "patientRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "standardPrice": 0,
// "chargePrice": 0,
// "payTypeFlag": "string",
// "isCharge": "string",
// "lisRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "amount": 0,
// "groupPackageId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
// }
// ]
},
quickAsb: [], //
};
},
created() { },
//
mounted() {
mounted() {
this.quickAsb = this.dict.asbItemAll;
},
computed: {
@ -740,36 +737,65 @@ export default {
console.log(error);
}
}
this.$message.success("操作成功!");
this.dialogGroup = false;
this.query();
},
remoteMethod(){
//
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];
}
},
//
quickChoosedAsb(){
quickChoosedAsb(v) {
//
let lfind = -1
if (v) {
lfind = arrayExistObj(this.quickAsb, 'id', v)
if (lfind > -1) {
this.asbitemBatch.asbitemsTemp.push({
asbitemId: v,
asbitemName: this.quickAsb[lfind].displayName, //
patientRegisterId: null,
standardPrice: this.quickAsb[lfind].price,
chargePrice: this.quickAsb[lfind].price,
payTypeFlag: '1',//
isCharge: 'N',
amount: 1,
});
this.quickAsb.splice(lfind, 1);
arrayReduce(this.dict.asbItemQuick, { id: v }, 'id');
}
}
console.log(v, this.asbitemBatch.asbitemsTemp)
},
//
removeAbs(row){
let lfind = arrayExistObj(this.asbitemBatch.asbitemsTemp,'asbitemId',row.asbitemId);
if(lfind > - 1){
this.asbitemBatch.asbitemsTemp.slice(lfind,1);
}
removeAbs(row) {
let lfind = arrayExistObj(this.asbitemBatch.asbitemsTemp, 'asbitemId', row.asbitemId);
if (lfind > - 1) this.asbitemBatch.asbitemsTemp.splice(lfind, 1);
},
rowClickaAbitemCurr(row){
rowClickaAbitemCurr(row) {
this.asbitemBatch.asbitemCurr = row;
},
btnRemoveAbs(){
if(!this.asbitemBatch.asbitemCurr.asbitemId){
btnRemoveAbs() {
if (!this.asbitemBatch.asbitemCurr.asbitemId) {
this.$message.warning("请选择要删除的组合项目!");
return;
}
@ -777,7 +803,7 @@ export default {
this.asbitemBatch.asbitemCurr.asbitemId = null;
},
removeAllAbs(){
removeAllAbs() {
this.asbitemBatch.asbitemsTemp = [];
},
@ -789,11 +815,124 @@ export default {
return;
}
this.dialogAsbitem = true;
this.quickAsb = this.dict.asbItemAll;
//
this.dict.asbItemQuick = [...this.dict.asbItemAll];
this.asbitemBatch.asbitemCurr.asbitemId = null;
this.asbitemBatch.asbitemsTemp = [];
},
asbitemBatchHandle(){
asbitemDel(type) {
//typ==0
if (Number(type) == 0) {
this.asbitemBatch.asbitemsTemp = [];
} else {
if (!this.asbitemBatch.asbitemCurr.asbitemId) {
this.$message.warning("请选中要删除的项目!");
return;
}
//console.log(this.asbitemBatch.asbitemsTemp,this.asbitemBatch.asbitemCurr)
let lfind = arrayExistObj(this.asbitemBatch.asbitemsTemp, 'asbitemId', this.asbitemBatch.asbitemCurr.asbitemId);
if (lfind > -1) {
this.asbitemBatch.asbitemsTemp.splice(lfind, 1);
this.asbitemBatch.asbitemCurr.asbitemId = null;
}
//console.log(lfind);
}
},
//
changePayTypeFlag(flag) {
this.asbitemBatch.asbitemsTemp.forEach(e => {
e.payTypeFlag = flag;
return e;
});
},
async asbitemBatchHandle() {
let msg = '', body = {};
if (this.asbitemBatch.asbitemsTemp.length == 0) {
this.$message.warning("没有选择组合项目,不可执行此操作!");
return;
}
if (this.asbitemBatch.operate == 'add') {
this.asbitemBatch.asbitemsTemp.forEach((e, index) => {
if (!e.amount || !e.chargePrice) {
msg = '第 ' + (index + 1) + " 行,未输入数量或价格!";
}
});
if (msg) {
this.$message.warning(msg);
return;
}
// {
// "organizationUnitId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "createRegisterAsbitemDtos": [
// {
// "asbitemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "patientRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "standardPrice": 0,
// "chargePrice": 0,
// "payTypeFlag": "string",
// "isCharge": "string",
// "lisRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "amount": 0,
// "groupPackageId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
// }
// ]
// }
let createRegisterAsbitemDtos = [...this.asbitemBatch.asbitemsTemp];
createRegisterAsbitemDtos.forEach(e => {
delete e.asbitemName;
return e;
});
for (let i = 0; i < this.multipleSelection.length; i++) {
createRegisterAsbitemDtos.forEach(e => {
e.patientRegisterId = this.multipleSelection[i].id;
return e;
});
body = {
organizationUnitId:this.multipleSelection[i].organizationUnitId,
createRegisterAsbitemDtos,
}
try {
await postapi('/api/app/registerasbitem/createregisterasbitemincustomerorgmany',body);
} catch (error) {
console.log('批量增加项目错误,原因:',error);
}
}
} else {
// {
// isDeleteGroup: 'N',
// patientRegisterId: null,
// asbitemIds: [],
// }
let asbitemIds = [];
if(this.asbitemBatch.isDeleteGroup){
body.isDeleteGroup = 'Y';
}else{
body.isDeleteGroup = 'N';
}
for (let i = 0; i < this.multipleSelection.length; i++) {
this.asbitemBatch.asbitemsTemp.forEach(e => {
asbitemIds.push(e.asbitemId);
});
body.patientRegisterId = this.multipleSelection[i].id;
body.asbitemIds = asbitemIds
try {
await postapi('/api/app/registerasbitem/deleteregisterasbitemincustomerorgmany',body);
} catch (error) {
console.log('批量删除项目错误,原因:',error);
}
}
}
this.$message.success("操作成功!");
this.dialogAsbitem = false;
this.query();
},
//
@ -990,4 +1129,31 @@ export default {
.btnClass {
width: 110px;
}
</style>
::v-deep .el-input__inner {
text-align: center;
padding-left: 1px;
padding-right: 1px;
}
::v-deep .el-table th.el-table__cell {
text-align: center;
padding-left: 1px;
padding-right: 1px;
}
::v-deep .el-table td.el-table__cell {
padding-left: 1px;
padding-right: 1px;
}
::v-deep .el-table .cell {
padding-left: 1px;
padding-right: 1px;
}
::v-deep input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
-webkit-appearance: none !important;
margin: 0 !important;
}</style>
Loading…
Cancel
Save