Browse Source

djdd

master
pengjun 2 years ago
parent
commit
53c4000ecb
  1. 5
      src/api/request.js
  2. 26
      src/components/common/MedicalPackageAsbitem.vue
  3. 29
      src/components/customerOrg/customerOrgGroupAsbitem.vue
  4. 184
      src/components/patientRegister/PatientRegisterEdit.vue
  5. 516
      src/components/patientRegister/PatientRegisterItem.vue
  6. 17
      src/components/patientRegisterSign/customerOrgEdit.vue

5
src/api/request.js

@ -26,8 +26,7 @@ instance.interceptors.request.use(
config.headers.Authorization = `${tokentype} ${token}`;
return config;
},
function (err) {
console.log("666");
function (err) {
return Promise.reject(err);
}
);
@ -35,7 +34,7 @@ instance.interceptors.request.use(
//响应拦截
instance.interceptors.response.use(
(res) => {
console.log(res);
// console.log(res);
if (res.data.code == -1) {
Message.error(res.data.message);
}

26
src/components/common/MedicalPackageAsbitem.vue

@ -14,7 +14,7 @@
<el-table :data="dict.asbItem" border size="small" highlight-current-row
:height="window.pageHeight < 635 ? 200:(window.pageHeight - 110 - 325)"
@row-dblclick="dbClickChoosedAsb" row-key="id"
@selection-change="handleSelectionChange" :row-class-name="handleRowClassName"
@selection-change=" selectLeft" :row-class-name="handleRowClassName"
@row-click="chooseAsbItem">
<!--
<el-table-column type="selection" align="center" ></el-table-column>
@ -38,11 +38,11 @@
</div>
<div>
<el-button class="btnClass"
@click="delAbs(patientRegisterAbsChoosed,'choosed')">移除 <i class="el-icon-arrow-left"></i
@click="delAbs(medicalPackageAsbitemsChoosed,'choosed')">移除 <i class="el-icon-arrow-left"></i
></el-button>
</div>
<div>
<el-button class="btnClass" @click="delAbs(patientRegisterAbsChoosed,'all')">全部移除</el-button>
<el-button class="btnClass" @click="delAbs(medicalPackageAsbitemsChoosed,'all')">全部移除</el-button>
</div>
</div>
@ -60,7 +60,7 @@
</div>
<div class="box">
<el-table :data="medicalPackageAsbitems" border size="small"
@selection-change="selecteditems" highlight-current-row
@selection-change="selectRight" highlight-current-row
:height="window.pageHeight < 635 ? 200:(window.pageHeight - 110 - 325)"
:summary-method="getSummaries" show-summary
:row-class-name="handleRowClassName" @row-dblclick="removeAbs"
@ -190,6 +190,7 @@ export default {
return {
packagePrice:0, //
medicalPackageAsbitems:[], //
medicalPackageAsbitemsChoosed:[], //()
itemTypeIds:[], //
asbItemId:'', //ID
quickAsb:[], //
@ -305,8 +306,8 @@ export default {
getAsbItemByItemType() {
this.getAsbItemByItemTypeAll()
//
arrayReduce(this.dict.asbItem, [...this.medicalPackageAsbitems], "id=asbitemId");
arrayReduce(this.dict.asbItemQuick, [...this.medicalPackageAsbitems], "id=asbitemId");
arrayReduce(this.dict.asbItem, [...this.medicalPackageAsbitems], "id=id");
arrayReduce(this.dict.asbItemQuick, [...this.medicalPackageAsbitems], "id=id");
this.quickAsb = Object.assign(this.dict.asbItemQuick)
},
@ -774,17 +775,14 @@ export default {
//
selecteditems(val) {
this.rightselctedata = val;
console.log(this.rightselctedata);
selectRight(val) {
this.medicalPackageAsbitemsChoosed = val;
},
//
handleSelectionChange(val) {
// this.selecteddata = val;
this.unselecteddata = val;
console.log(this.unselecteddata);
//
selectLeft(val) {
this.asbItemChoosed = val;
},

29
src/components/customerOrg/customerOrgGroupAsbitem.vue

@ -14,7 +14,7 @@
<el-table :data="dict.asbItem" border size="small" highlight-current-row
:height="window.pageHeight < 668 ? 200:(window.pageHeight - 110 - 358)"
@row-dblclick="dbClickChoosedAsb" row-key="id"
@selection-change="handleSelectionChange" :row-class-name="handleRowClassName"
@selection-change="selectLeft" :row-class-name="handleRowClassName"
@row-click="chooseAsbItem">
<!--
<el-table-column type="selection" align="center" ></el-table-column>
@ -38,11 +38,11 @@
</div>
<div>
<el-button class="btnClass"
@click="delAbs(patientRegisterAbsChoosed,'choosed')">移除 <i class="el-icon-arrow-left"></i
@click="delAbs(customerOrgGroupAsbitemsChoosed,'choosed')">移除 <i class="el-icon-arrow-left"></i
></el-button>
</div>
<div>
<el-button class="btnClass" @click="delAbs(patientRegisterAbsChoosed,'all')">全部移除</el-button>
<el-button class="btnClass" @click="delAbs(customerOrgGroupAsbitemsChoosed,'all')">全部移除</el-button>
</div>
</div>
@ -60,7 +60,7 @@
</div>
<div class="box">
<el-table :data="customerOrgGroupAsbitems" border size="small"
@selection-change="selecteditems" highlight-current-row
@selection-change="selectRight" highlight-current-row
:height="window.pageHeight < 668 ? 200:(window.pageHeight - 110 - 358)"
:summary-method="getSummaries" show-summary
:row-class-name="handleRowClassName" @row-dblclick="removeAbs"
@ -276,7 +276,8 @@ export default {
data() {
return {
groupPrice:0, //
customerOrgGroupAsbitems:[], //
customerOrgGroupAsbitems:[], //()
customerOrgGroupAsbitemsChoosed:[], //()
itemTypeIds:[], //
asbItemId:'', //ID
quickAsb:[], //
@ -293,13 +294,8 @@ export default {
customerOrgGroups:[], //
curGroupId:'', //ID
groupAsbitems:[], //
selecteddata: [], //
unselecteddata: [], //
rightselctedata: [], //
options: [],
value: "",
dialogVisible: false,
copyGroupdialogVisible: false,
packagelist: [],
@ -931,17 +927,14 @@ export default {
//
selecteditems(val) {
this.rightselctedata = val;
console.log(this.rightselctedata);
selectRight(val) {
this.customerOrgGroupAsbitemsChoosed = val;
},
//
handleSelectionChange(val) {
// this.selecteddata = val;
this.unselecteddata = val;
console.log(this.unselecteddata);
selectLeft(val) {
this.asbItemChoosed = val;
},

184
src/components/patientRegister/PatientRegisterEdit.vue

@ -719,6 +719,7 @@ export default {
"medicalPackageId",
"birthDate",
"age",
"maritalStatusId",
"medicalTypeId",
"personnelTypeId",
"sexHormoneTermId",
@ -755,6 +756,7 @@ export default {
//
prAsbOpraOpts:{
formId:'', //form.idformId
copyNew:0, //
payTypeFlag:'', //
prAsbSave:0, //
prAsbQuery:0,//
@ -770,7 +772,7 @@ export default {
//
mounted() {
this.initFormData()
// this.initFormData()
},
computed: {
@ -1202,6 +1204,45 @@ export default {
}
},
//
madePrBody(){
//
let body = deepCopy(this.form);
if (this.form.birthDate && this.form.birthDate != "Invalid date") {
body.birthDate = moment(this.form.birthDate).format("yyyy-MM-DD")
}else{
body.birthDate = null
}
delete body.id;
delete body.patientRegisterNo;
delete body.medicalTimes;
delete body.completeFlag;
delete body.isMedicalStart;
delete body.patientNo;
delete body.creatorId;
delete body.creationTime;
delete body.lastModificationTime;
delete body.lastModifierId;
delete body.isVipBox;
delete body.isNameHideBox;
delete body.isPhoneFollowBox;
delete body.isLockBox;
delete body.photo;
setNull(body, this.defaultNull);
//
// console.log("body.birthDate", body.birthDate);
// if (body.birthDate) {
// body.birthDate = moment(new Date(body.birthDate)).format(
// "yyyy-MM-DD"
// );
// }
return body
},
//
btnSubmit(formName, msgTip) {
this.$refs[formName].validate((valid,fields) => {
@ -1223,89 +1264,49 @@ export default {
return false
}
//
let body = deepCopy(this.form);
if (this.form.birthDate && this.form.birthDate != "Invalid date") {
body.birthDate = moment(this.form.birthDate).format("yyyy-MM-DD")
}else{
body.birthDate = null
}
delete body.id;
delete body.patientRegisterNo;
delete body.medicalTimes;
delete body.completeFlag;
delete body.isMedicalStart;
delete body.patientNo;
delete body.creatorId;
delete body.creationTime;
delete body.lastModificationTime;
delete body.lastModifierId;
delete body.isVipBox;
delete body.isNameHideBox;
delete body.isPhoneFollowBox;
delete body.isLockBox;
delete body.photo;
setNull(body, this.defaultNull);
//
// console.log("body.birthDate", body.birthDate);
// if (body.birthDate) {
// body.birthDate = moment(new Date(body.birthDate)).format(
// "yyyy-MM-DD"
// );
// }
if (this.form.id.length < 1) {
if (this.form.id){
//
this.prAsbOpraOpts.prAsbSave++ //
}else {
let body = this.madePrBody()
//id
console.log(`/api/patientregister/createreturninfo`, body);
postapi(`/api/patientregister/createreturninfo`, body).then(
(res) => {
if (res.code == 1) {
//console.log('res',res)
if (msgTip) this.$message.success("创健 操作成功");
if (msgTip) this.$message.success("操作成功");
//
this.prAsbOpraOpts.formId = res.data.id
// this.prAsbOpraOpts.formId
setTimeout(() =>{
this.prAsbOpraOpts.prAsbSave++
},100)
//
if (this.patientRegister.photo.indexOf("data:image") > -1) savePeoplePhoto(res.data.id, this.patientRegister.photo);
objCopy(res.data, this.form);
objCopy(Object.assign({},res.data,{id:''}), this.form); //form.id
/**/
// this.patientRegister.prList.push(res.data); //
this.patientRegister.patientRegisterId = res.data.id;
objCopy(this.form, this.patientRegister.patientRegisterRd);
objCopy(res.data, this.patientRegister.patientRegisterRd);
//this.patientRegister.query.times++;
let curRow = deepCopy(this.patientRegister.patientRegisterRd)
curRow.index = this.patientRegister.prList.length
this.patientRegister.prList.push(curRow)
//
this.patientRegister.patientRegisterAbs.forEach(e => {
e.patientRegisterId = res.data.id;
return e;
});
this.patientRegister.saveTimes++;
console.log('新增this.form.id',this.form.id)
}
}
);
} else {
//id api/patientregister/updatepatientregister
console.log(`/api/patientregister/updatepatientregister?PatientRegisterId=${this.form.id}`, body);
postapi(`/api/patientregister/updatepatientregister?PatientRegisterId=${this.form.id}`, body).then((res) => {
if (res.code == 1) {
if (msgTip) this.$message.success("更新 操作成功");
//
if (this.patientRegister.photo.indexOf("data:image") > -1) savePeoplePhoto(this.form.id, this.patientRegister.photo);
objCopy(this.form, this.patientRegister.patientRegisterRd);
// this.patientRegister.query.times++;
// let lfind = arrayExistObj(this.patientRegister.prList, 'id', this.form.id)
// if(lfind > - 1) objCopy(this.form,this.patientRegister.prList[lfind])
this.patientRegister.saveTimes++; //
}
});
}
});
@ -1313,10 +1314,11 @@ export default {
//
rdCopy() {
if (!this.patientRegister.patientRegisterId) {
if (!this.form.id) {
this.$message.info("该信息尚未保存,不可执行此操作!");
return;
}
this.patientRegister.photo = '/pic/Photo.jpg'
this.patientRegister.patientRegisterId = '';
this.form.id = '';
@ -1327,13 +1329,21 @@ export default {
this.form.patientName = '';
this.form.photo = '';
this.patientRegister.patientRegisterAbs.forEach(e => {
e.patientRegisterId = '';
e.id = '';
return e;
});
// this.patientRegister.patientRegisterAbs.forEach(e => {
// e.id = '';
// e.patientRegisterId = '';
// e.isCharge = 'N';
// e.checkCompleteFlag = '0'
// e.isLock = 'N'
// });
//
setTimeout(() => {
this.prAsbOpraOpts.copyNew++
}, 100);
// console.log('this.patientRegister.patientRegisterAbs',this.patientRegister.patientRegisterAbs)
this.$message.info("操作成功,确定请记得点保存");
this.$message.info("操作成功,请记得点保存");
this
},
@ -1631,14 +1641,28 @@ export default {
this.prAsbOpraOpts.prAsbQuery++
},
//
//
triggerHeadSave(){
this.btnSubmit('form', true)
//id api/patientregister/updatepatientregister
let body = this.madePrBody()
console.log(`/api/patientregister/updatepatientregister?PatientRegisterId=${this.form.id}`, body);
postapi(`/api/patientregister/updatepatientregister?PatientRegisterId=${this.form.id}`, body).then((res) => {
if (res.code != -1) {
this.$message.success("操作成功");
//
if (this.patientRegister.photo.indexOf("data:image") > -1) savePeoplePhoto(this.form.id, this.patientRegister.photo);
objCopy(this.form, this.patientRegister.patientRegisterRd);
}
});
},
// IDform.id
refreshFormId(){
console.log('refreshFormId',this.prAsbOpraOpts.formId)
this.form.id = this.prAsbOpraOpts.formId
this.prAsbOpraOpts.formId = '' //
this.prAsbOpraOpts.prAsbQuery++
}
},
@ -1646,12 +1670,16 @@ export default {
//
watch: {
// "form.customerOrgId"(newVal, oldVal) {
// //console.log('editTimes newVal',newVal,' oldVal',oldVal)
// if (newVal != oldVal) {
// this.getCustomerOrgRegisterList()
// }
// },
"formInitData.id":{
immediate:true,
deep:true,
handler(newVal, oldVal) {
//console.log('editTimes newVal',newVal,' oldVal',oldVal)
if (newVal != oldVal) {
this.initFormData()
}
}
},
//
"editTimes"(newVal, oldVal) {

516
src/components/patientRegister/PatientRegisterItem.vue

@ -160,10 +160,10 @@ import { arrayFilter, arrayReduce, arrayExistObj, dddw, deepCopy, tcdate} from "
import proApi from "../../utlis/proApi";
export default {
props: ["prForm","prAsbOpraOpts","triggerHeadSave"],
props: ["prForm","prAsbOpraOpts","triggerHeadSave","refreshFormId"],
data() {
return {
oldFormId:'', //使
itemType: [], //
itemTypeIds: '', //ID
asbItem:[], //
@ -241,6 +241,7 @@ export default {
async getPrAsb(id){
// debugger
//
console.log('getPrAsb(id)',`getPrAsb(${id})`)
this.prAsbDels = []
this.groupAsbs = []
this.packageAsbs = []
@ -250,16 +251,31 @@ export default {
this.refreshAsbitem()
},
//
async copyNew(){
if(this.oldFormId){
let result = await proApi.getPrAsb(this.oldFormId)
this.prAsb = result.data
this.prAsb.forEach(e => {
e.id = '';
e.patientRegisterId = '';
e.isCharge = 'N';
e.checkCompleteFlag = '0'
e.isLock = 'N'
})
this.refreshAsbitem()
}
},
//
refreshAsbitem(){
arrayReduce(this.asbItemAll, this.prAsb, "id=asbitemId");
this.changeItemType(); // arrayReduce(this.asbItem, this.prAsb, "id=asbitemId");
this.asbItemQuick = deepCopy(this.asbItemAll);
this.quickAsb = deepCopy(this.asbItemQuick);
let asbItemAll = deepCopy(this.asbItemAll)
arrayReduce(asbItemAll, this.prAsb, "id=asbitemId");
this.changeItemType();
this.asbItemQuick = deepCopy(asbItemAll);
this.quickAsb = deepCopy(asbItemAll);
},
handleRowClassName({ row, rowIndex }) {
if (row.choosed) {
return 'current-row';
@ -372,90 +388,36 @@ export default {
},
//
// [
// {
// "registerAsbitemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "input": {
// "chargePrice": 0,
// "payTypeFlag": "string",
// "isCharge": "string",
// "amount": 0,
// "groupPackageId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
// }
// }
// ]
//
async batchEditAsb(body, msg) {
console.log(`/api/app/registerasbitem/updatemany`, body)
await postapi(`/api/app/registerasbitem/updatemany`, body)
.then((res) => {
console.log("batchEditAsb", res);
if (res.code == 1) {
if (msg) {
//
this.getPatientRegisterAbs(this.prForm.id)
this.$message.success(`${msg}操作成功`);
}
}
})
.catch((err) => {
this.$message({ type: "error", message: `${msg}操作失败,原因:${err}` });
});
},
//
async onSubmit(msg) {
let body = [], insBody = []
if (!this.prForm.id) {
//this.$message.warning("")
let ret = false
ret = await this.batchAddAsb()
if(!ret){
if(msg) this.$message.warning(`组合项目 ${msg} 失败!`)
return
}
if (this.prAsb.length < 1) {
//this.$message.warning("")
ret = await this.batchDelAsb()
if(!ret){
if(msg) this.$message.warning(`组合项目 ${msg} 失败!`)
return
}
for (let i = 0; i < this.prAsb.length; i++) {
if (this.prAsb[i].id) {
body.push({
registerAsbitemId: this.prAsb[i].id,
input: {
chargePrice: this.prAsb[i].chargePrice,
payTypeFlag: this.prAsb[i].payTypeFlag,
isCharge: this.prAsb[i].isCharge,
amount: this.prAsb[i].amount,
groupPackageId: this.prAsb[i].groupPackageId
}
})
} else {
insBody.push({
asbitemId: this.prAsb[i].asbitemId,
patientRegisterId: this.prForm.id,
standardPrice: this.prAsb[i].standardPrice,
chargePrice: this.prAsb[i].chargePrice,
payTypeFlag: this.prAsb[i].payTypeFlag,
isCharge: this.prAsb[i].isCharge,
amount: this.prAsb[i].amount,
groupPackageId: this.prAsb[i].groupPackageId
})
}
}
//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);
} else if (body.length > 0 && insBody.length < 1) {
await this.batchEditAsb(body, msg);
} else if (body.length < 1 && insBody.length > 0) {
await this.batchAddAsb(insBody, msg);
ret = await this.batchEditAsb()
if(!ret){
if(msg) this.$message.warning(`组合项目 ${msg} 失败!`)
return
}
console.log('this.prAsbOpraOpts.formId',this.prAsbOpraOpts.formId)
if(this.prAsbOpraOpts.formId){
this.refreshFormId()
}else{
//
this.triggerHeadSave()
this.getPrAsb(this.prForm.id)
}
//
this.triggerHeadSave()
},
//
@ -465,39 +427,14 @@ export default {
//console.log(this.asbItemChoosed);
},
//
async batchAddAsb(registerAsbitems, msg) {
let body = {
organizationUnitId:this.prForm.organizationUnitId,
registerAsbitems
}
if(this.prForm.organizationUnitId.id){
body.isAutoMerger = 'N'
}
//console.log(`/api/app/registerasbitem/createregisterasbitemmany`, body)
await postapi('/api/app/registerasbitem/createregisterasbitemmany', body)
.then((res) => {
console.log("batchAddAsb", res);
if (res.code == 1) {
//
this.getPatientRegisterAbs(this.prForm.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'
async addAbs(asbItemChoosed,oprType) {
let body = []
addAbs(asbItemChoosed,oprType) {
let checked = true
let payTypeFlag = '0' //
let lfind = -1
// start
if(oprType && oprType == 'all'){
@ -541,6 +478,7 @@ export default {
for (let i = 0; i < asbItemChoosed.length; i++) {
let pojo = {
asbitemId: asbItemChoosed[i].id,
asbitemName: asbItemChoosed[i].displayName,
patientRegisterId: this.prForm.id,
standardPrice: asbItemChoosed[i].price,
chargePrice: asbItemChoosed[i].price,
@ -549,19 +487,11 @@ export default {
discount:100,
amount: 1,
total: asbItemChoosed[i].price,
}
body.push(pojo)
this.prAsb.push({ ...pojo, asbitemName: asbItemChoosed[i].displayName })
lfind = arrayExistObj(this.asbItem, 'id', asbItemChoosed[i].id)
if (lfind > -1) this.asbItem.splice(lfind, 1)
lfind = arrayExistObj(this.asbItemQuick, 'id', asbItemChoosed[i].id)
if (lfind > -1) this.asbItemQuick.splice(lfind, 1)
this.quickAsb = deepCopy(this.asbItemQuick)
}
this.prAsb.push(pojo)
}
if (this.prForm.id) await this.batchAddAsb(body, '添加组合项目');
this.refreshAsbitem()
},
@ -570,36 +500,111 @@ export default {
this.patientRegisterAbsChoosed = val
},
//
async batchDelAsb(body, msg) {
console.log(`/api/app/registerasbitem/deletemany`, body)
await postapi(`/api/app/registerasbitem/deletemany`, body)
.then((res) => {
console.log("delAbs", res);
if (res.code != -1) {
//
this.refreshAsbitem()
if (msg) {
//
this.getPatientRegisterAbs(this.prForm.id)
this.$message.success(`${msg}操作成功`);
//
async batchAddAsb() {
let ret = false
let patientRegisterId = this.prForm.id || this.prAsbOpraOpts.formId
if(!patientRegisterId){
this.$message.warning("人员基本信息未保存");
return ret
}
let registerAsbitems = []
this.prAsb.forEach(e => {
if(!e.id){
registerAsbitems.push({
asbitemId: e.asbitemId,
patientRegisterId,
standardPrice: e.standardPrice,
chargePrice: e.chargePrice,
payTypeFlag: e.payTypeFlag,
isCharge: e.isCharge,
amount: e.amount,
groupPackageId: e.groupPackageId
})
}
})
if(registerAsbitems.length == 0) return true
let body = {
organizationUnitId:this.prForm.organizationUnitId,
registerAsbitems,
isAutoMerger:'Y'
}
try {
let res = await postapi('/api/app/registerasbitem/createregisterasbitemmany', body)
if(res.code != -1) ret = true
} catch (error) {
console.log('批量添加组合项目失败',error)
}
return ret
},
//
async batchEditAsb() {
let ret = false
let body = []
this.prAsb.forEach(e => {
if(e.id){
body.push({
registerAsbitemId:e.id,
input: {
chargePrice: e.chargePrice,
payTypeFlag: e.payTypeFlag,
isCharge: e.isCharge,
amount: e.amount,
groupPackageId: e.groupPackageId
}
})
}
})
if(body.length == 0) return true
}
})
.catch((err) => {
this.$message({ type: "error", message: `${msg}操作失败,原因:${err}` });
});
try {
let res = await postapi(`/api/app/registerasbitem/updatemany`, body)
if(res.code != -1) ret = true
} catch (error) {
console.log('批量提交更新组合项目失败',error)
}
return ret
},
//
async batchDelAsb() {
let ret = false
if(this.prAsbDels.length == 0) return true
let registerAsbitemIds=[]
this.prAsbDels.forEach(e => {
registerAsbitemIds.push(e.id)
})
console.log(`/api/app/registerasbitem/deletemany`, {registerAsbitemIds})
try {
let res = await postapi(`/api/app/registerasbitem/deletemany`, {registerAsbitemIds})
if(res.code != -1) ret = true
} catch (error) {
console.log('批量删除组合项目失败',error)
}
return ret
},
//
///api/app/register-asbitem/many?RegisterAsbitemIds=3fa85f64-5717-4562-b3fc-2c963f66afa6
delAbs(absForDel,oprType) {
let body = {}
let registerAsbitemIds = []
delAbs(absForDel,oprType) {
let chargeComplete = ''
let lfind = -1
let tempRd = {}
// start
if(oprType && oprType == 'all'){
@ -620,39 +625,26 @@ export default {
return
}
for (let i = 0; i < absForDel.length; i++) {
//
if (!absForDel[i].id) {
lfind = arrayExistObj(this.prAsb, 'asbitemId', absForDel[i].asbitemId)
if (lfind > -1) this.prAsb.splice(lfind, 1)
absForDel.splice(i, 1)
i--
continue
}
if (absForDel[i].isCharge == 'Y' || absForDel[i].checkCompleteFlag != '0') {
chargeComplete += absForDel[i].asbitemName + ','
absForDel.splice(i, 1)
i--
}
}
absForDel.forEach(e => {
//
if (e.isCharge == 'Y' || (e.checkCompleteFlag && e.checkCompleteFlag != '0')) {
chargeComplete += e.asbitemName + ','
}else{
lfind = arrayExistObj(this.prAsb, 'asbitemId', e.asbitemId)
if(lfind > -1){
tempRd = Object.assign({},this.prAsb.splice(lfind,1)[0])
if(e.id) this.prAsbDels.push(tempRd)
}
}
})
//
this.refreshAsbitem()
if (chargeComplete) {
this.$message({ type: "info", message: `所选项目:${chargeComplete}已收费或已检,不可删除!` });
if (absForDel.length < 1) return
}
for (let i = 0; i < absForDel.length; i++) {
registerAsbitemIds.push(absForDel[i].id)
}
body = { registerAsbitemIds }
if (registerAsbitemIds.length > 0 && this.prForm.id) this.batchDelAsb(body, '删除组合项目');
},
//
@ -663,51 +655,21 @@ export default {
//
changeItemType() {
//console.log('getAsbItemByItemType', typeof this.itemTypeIds, this.itemTypeIds)
let asbItemAll = deepCopy(this.asbItemAll)
let lv = "";
if (typeof this.itemTypeIds == "object") {
if(this.itemTypeIds.length > 0) lv = this.itemTypeIds[this.itemTypeIds.length - 1];
}
if (lv) {
this.asbItem = arrayFilter(this.asbItemAll, "itemTypeId", lv);
this.asbItem = arrayFilter(asbItemAll, "itemTypeId", lv);
} else {
this.asbItem = deepCopy(this.asbItemAll);
}
this.asbItem = deepCopy(asbItemAll);
}
arrayReduce(this.asbItem, this.prAsb, "id=asbitemId");
},
//
// registerAsbitem(body) {
// console.log("registerAsbitem");
// postapi(
// `/api/app/register-asbitem?CustomerOrgId=${this.prForm.customerOrgId}`,
// body
// ).then((res) => {
// console.log("medicalPackageAsb", res);
// if (res.code == 1) {
// //
// }
// });
// },
//
// 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);
// }
// });
// },
//
getGroupAsbs(id){
@ -773,7 +735,7 @@ export default {
}
}else{
//
if(this.prAsb[i].isCharge == 'Y'){
if(this.prAsb[i].isCharge == 'Y' || (this.prAsb[i].checkCompleteFlag && this.prAsb[i].checkCompleteFlag != '0')){
this.prAsb[i].groupPackageId = null
}else{
tempRd = Object.assign({},this.prAsb.splice(i,1)[0])
@ -789,6 +751,7 @@ export default {
if(lfind > -1){
tempRd = Object.assign(this.prAsbDels.splice(lfind,1)[0],
{
groupPackageId:newId,
standardPrice:e.price,
chargePrice:e.customerOrgGroupDetailPrice,
payTypeFlag,
@ -848,7 +811,7 @@ export default {
}
}else{
//
if(this.prAsb[i].isCharge == 'Y'){
if(this.prAsb[i].isCharge == 'Y' || (this.prAsb[i].checkCompleteFlag && this.prAsb[i].checkCompleteFlag != '0')){
this.prAsb[i].groupPackageId = null
}else{
tempRd = Object.assign({},this.prAsb.splice(i,1)[0])
@ -863,6 +826,7 @@ export default {
if(lfind > -1){
tempRd = Object.assign(this.prAsbDels.splice(lfind,1)[0],
{
groupPackageId:newId,
standardPrice:e.price,
chargePrice:e.medicalPackageDetailPrice,
payTypeFlag,
@ -874,7 +838,9 @@ export default {
)
}else{
tempRd = {
groupPackageId:newId,
asbitemId:e.id,
asbitemName:e.displayName,
patientRegisterId:this.prForm.id,
standardPrice:e.price,
chargePrice:e.medicalPackageDetailPrice,
@ -902,6 +868,7 @@ export default {
dbClickChoosedAsb(row) {
this.addAbs([row]);
},
//
quickChoosedAsb(v) {
// value-key value console.log('quickChoosedAsb',v)
@ -938,81 +905,7 @@ export default {
} else {
this.quickAsb = deepCopy(this.asbItemQuick);
}
},
// / /
getGroupPackageAsb(typeFlag, groupPackageId) {
let delBody = {};
console.log(`${url}${groupPackageId}`);
if(typeFlag == 'group'){
getapi(`/api/app/customerorggroupdetail/getcustomerorggroupdetailinasbitem?CustomerOrgGroupId=${groupPackageId}`)
.then((res) => {
console.log("getGroupPackageAsb", res);
if (res.code != -1) {
//
delBody = this.removeGroupPackageAsb();
//
this.addGroupPackageAsb(res.data, typeFlag,groupPackageId);
arrayReduce(this.dict.asbItem, [...this.patientRegister.patientRegisterAbs], "id=asbitemId");
arrayReduce(this.dict.asbItemQuick, [...this.patientRegister.patientRegisterAbs], "id=asbitemId");
//console.log('delBody', delBody,delBody['registerAsbitemIds'].length);
if (delBody['registerAsbitemIds'].length > 0) {
return postapi(`/api/app/registerasbitem/deletemany`, delBody)
} else {
typeFlag == 'group' ? this.patientRegister.customerOrgGroupChange++ : this.patientRegister.medicalPackageChange++;
if (this.form.id) this.btnSubmit('form', false);
}
}
})
.then(res => {
//console.log('res', res);
if (res && res.code != -1) {
//
typeFlag == 'group' ? this.patientRegister.customerOrgGroupChange++ : this.patientRegister.medicalPackageChange++;
if (this.form.id) this.btnSubmit('form', false);
}
});
}else{
postapi('/api/app/medicalpackagedetail/getmedicalpackageinasbitem',{medicalPackageId:groupPackageId})
.then((res) => {
console.log("getGroupPackageAsb", res);
if (res.code != -1) {
//
delBody = this.removeGroupPackageAsb();
//
this.addGroupPackageAsb(res.data, typeFlag,groupPackageId);
arrayReduce(this.dict.asbItem, [...this.patientRegister.patientRegisterAbs], "id=asbitemId");
arrayReduce(this.dict.asbItemQuick, [...this.patientRegister.patientRegisterAbs], "id=asbitemId");
//console.log('delBody', delBody,delBody['registerAsbitemIds'].length);
if (delBody['registerAsbitemIds'].length > 0) {
return postapi(`/api/app/registerasbitem/deletemany`, delBody)
} else {
typeFlag == 'group' ? this.patientRegister.customerOrgGroupChange++ : this.patientRegister.medicalPackageChange++;
if (this.form.id) this.btnSubmit('form', false);
}
}
})
.then(res => {
//console.log('res', res);
if (res && res.code != -1) {
//
typeFlag == 'group' ? this.patientRegister.customerOrgGroupChange++ : this.patientRegister.medicalPackageChange++;
if (this.form.id) this.btnSubmit('form', false);
}
});
}
},
},
//
changeAllDiscount() {
@ -1025,7 +918,7 @@ export default {
e.chargePrice = Math.round(e.standardPrice * this.discount) / 100
e.total = Math.round(e.standardPrice * this.discount * e.amount) / 100
});
this.onSubmit('')
// this.onSubmit('')
},
@ -1073,7 +966,7 @@ export default {
//console.log(this.prAsb[index].chargePrice,this.prAsb[index].standardPrice)
this.prAsb[index].chargePrice = Math.round(this.prAsb[index].standardPrice * this.prAsb[index].discount)/100
this.prAsb[index].total = this.prAsb[index].chargePrice * this.prAsb[index].amount
this.onSubmit('')
// this.onSubmit('')
},
//
@ -1083,7 +976,7 @@ export default {
if (!this.prAsb[index].chargePrice) return
//console.log(this.prAsb[index].chargePrice,this.prAsb[index].standardPrice)
this.prAsb[index].discount = Math.round(this.prAsb[index].chargePrice * 10000 / this.prAsb[index].standardPrice)/100
this.onSubmit('')
// this.onSubmit('')
},
//
@ -1145,24 +1038,30 @@ export default {
//
watch: {
//
"patientRegister.saveTimes"(newVal, oldVal) {
console.log("patientRegister.saveTimes newVal:", newVal, " oldVal:", oldVal);
if (newVal != oldVal) {
this.onSubmit('');
//使
"prForm.id":{
immediate: true, //
deep: true, //
handler(newVal,oldVal){
this.oldFormId = oldVal
if(newVal != oldVal){
if(newVal == ''){
this.getPrAsb(newVal)
}else if(newVal != this.prAsbOpraOpts.formId){
this.getPrAsb(newVal)
}
}
}
},
//
"prForm.id":{
immediate: true, //
// id
"prAsbOpraOpts.prAsbQuery":{
// immediate: true, //
deep: true, //
handler(newVal,oldVal){
console.log('watch:prForm.id:',newVal,oldVal)
console.log('watch:prAsbOpraOpts.prAsbQuery:',newVal,oldVal)
if(newVal != oldVal){
this.getPrAsb(newVal)
this.getPrAsb(this.prForm.id)
}
}
},
@ -1186,7 +1085,7 @@ export default {
"prAsbOpraOpts.prAsbGroup":{
// immediate: true, //
deep: true, //
handler(newVal, oldVal) {
handler(newVal, oldVal) {
if (newVal != oldVal) {
this.getGroupAsbs(this.prForm.customerOrgGroupId)
}
@ -1204,7 +1103,24 @@ export default {
}
},
//
"prAsbOpraOpts.copyNew":{
// immediate: true, //
deep: true, //
handler(newVal, oldVal) {
if (newVal != oldVal) {
this.copyNew()
}
}
},
//
"prAsbOpraOpts.prAsbSave"(newVal, oldVal) {
console.log("patientRegister.saveTimes newVal:", newVal, " oldVal:", oldVal);
if (newVal != oldVal) {
this.onSubmit('');
}
},
},
};

17
src/components/patientRegisterSign/customerOrgEdit.vue

@ -123,11 +123,15 @@
</el-col>
<el-col :span="7">
<el-form-item label="创建时间" style="margin-left: -5%">
<el-input
<el-date-picker v-model="customerOrg.customerOrgRd.creationTime" type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
prefix-icon="" size="small" disabled/>
<!--
<el-input
:value="customerOrg.customerOrgRd.creationTime | dateFormat"
disabled
style="width: 90%"
></el-input>
-->
</el-form-item>
</el-col>
<el-col :span="5">
@ -141,13 +145,8 @@
</el-col>
<el-col :span="7">
<el-form-item label="修改时间" style="margin-left: -90px">
<el-input
:value="
customerOrg.customerOrgRd.lastModificationTime | dateFormat
"
disabled
style="width: 70%"
></el-input>
<el-date-picker v-model="customerOrg.customerOrgRd.lastModificationTime" type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
prefix-icon="" size="small" disabled/>
</el-form-item>
</el-col>
</el-row>
@ -203,6 +202,7 @@
import { mapState, mapMutations } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { tcdate } from "../../utlis/proFunc";
// import moment from 'moment';
export default {
components: {},
@ -269,6 +269,7 @@ export default {
...mapState(["customerOrg"]),
},
methods: {
// moment,
//
getsex() {
getapi("/api/app/sex").then((res) => {

Loading…
Cancel
Save