Browse Source

room

master
pengjun 1 year ago
parent
commit
47859cf4fc
  1. 50
      src/components/patientRegister/PatientRegisterList.vue
  2. 5
      src/components/report/BtnReport.vue
  3. 7
      src/components/report/PatientRegisterListNobtn.vue
  4. 542
      src/components/room/RoomAsbitem.vue
  5. 148
      src/components/room/RoomEdit.vue
  6. 217
      src/components/room/room.vue

50
src/components/patientRegister/PatientRegisterList.vue

@ -141,7 +141,10 @@
<el-button type="success" class="commonbutton" @click="btnAdd">人员登记</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs, '批量正式登记')" class="listBtn">
<el-button type="success" class="commonbutton" @click="btnAddBatch">批量正式登记</el-button>
<el-button type="success" class="commonbutton" @click="btnAddBatch('1')">批量正式登记</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs, '批量转预登记')" class="listBtn">
<el-button type="success" class="commonbutton" @click="btnAddBatch('0')">批量转预登记</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs, '编辑')" class="listBtn">
<el-button type="primary" class="commonbutton" @click="btnEdit">编辑</el-button>
@ -618,10 +621,11 @@ export default {
if (isPreview) {
this.$peisAPI.printPre(JSON.stringify(toOutShell))
.then(res => {
if (JSON.parse(res).code < 0) {
resolve(JSON.parse(res))
let lres = JSON.parse(res)
if (lres.code > -1) {
resolve(lres)
} else {
reject(JSON.parse(res).message)
reject(lres.message)
}
})
.catch((err) => {
@ -630,10 +634,11 @@ export default {
} else {
this.$peisAPI.print(JSON.stringify(toOutShell))
.then(res => {
if (JSON.parse(res).code > -1) {
let lres = JSON.parse(res)
if (lres.code > -1) {
return postapi("/api/app/patientregister/updatepatientregisterguideprinttimesmany", [row.id]);
} else {
reject(JSON.parse(res).message)
reject(lres.message)
}
})
.then(res => {
@ -829,7 +834,7 @@ export default {
},
//
btnAddBatch() {
btnAddBatch(completeFlag) {
let patientRegisterIds = []
// start
// this.multipleSelection = [];
@ -843,14 +848,25 @@ export default {
if (this.multipleSelection.length < 1) {
this.$message.info({ showClose: true, message: "请选择状态为预登记的记录!" });
this.$message.info({ showClose: true, message: "请勾选要操作的记录!" });
return;
}
this.multipleSelection.forEach(e => {
patientRegisterIds.push(e.id)
switch (completeFlag) {
case '0':
if(e.completeFlag == '1') patientRegisterIds.push(e.id)
break;
case '1':
if(e.completeFlag == '0') patientRegisterIds.push(e.id)
break;
}
});
let completeFlag = '1'
if(patientRegisterIds.length == 0){
this.$message.info({ showClose: true, message: "没有可操作的数据!" });
return;
}
let body = { completeFlag, patientRegisterIds }
postapi('/api/app/patientregister/updatepatientregistercompleteflagormedicalstartdate', body)
.then(res => {
@ -1063,14 +1079,24 @@ export default {
body.phone = this.patientRegister.query.phone;
if (this.patientRegister.query.idCardNo)
body = { idNo: this.patientRegister.query.idCardNo };
body = {
idNo: this.patientRegister.query.idCardNo,
skipCount: this.loadOpts.skipCount,
maxResultCount: this.loadOpts.maxResultCount
};
if (this.patientRegister.query.patientNo)
body = { patientNo: this.patientRegister.query.patientNo };
body = {
patientNo: this.patientRegister.query.patientNo,
skipCount: this.loadOpts.skipCount,
maxResultCount: this.loadOpts.maxResultCount
};
if (this.patientRegister.query.patientRegisterNo)
body = {
patientRegisterNo: this.patientRegister.query.patientRegisterNo,
skipCount: this.loadOpts.skipCount,
maxResultCount: this.loadOpts.maxResultCount
};
// console.log("/api/app/patientregister/getlistinfilter", body);

5
src/components/report/BtnReport.vue

@ -162,13 +162,16 @@ export default {
} else {
//
e.isUpload = 'Y'
console.log('btnUpReport success', JSON.parse(res))
// console.log('btnUpReport success', JSON.parse(res))
}
} else {
let patientRegisterId = e.patientRegisterId
let res2 = await postapi('/api/app/TransToWebPeis/TransPatientRegisterByPatientRegisterId', { patientRegisterId })
if (res2.code == -1) {
console.log('TransToWebPeis err', res2)
}else{
//
e.isUploadAppoint = 'Y'
}
}

7
src/components/report/PatientRegisterListNobtn.vue

@ -16,7 +16,12 @@
<i class="el-icon-printer" v-if="scope.row.isReportPrint == 'Y'" style="font-size: 24px;color: green;"></i>
</template>
</el-table-column>
<el-table-column prop="isUpload" label="是否上传" align="center">
<el-table-column prop="isUploadAppoint" label="预约备单" align="center">
<template slot-scope="scope">
<div style="font-family: 'Microsoft YaHei';">{{ scope.row.isUploadAppoint == "Y" ? "√" : "" }}</div>
</template>
</el-table-column>
<el-table-column prop="isUpload" label="报告上传" align="center">
<template slot-scope="scope">
<div style="font-family: 'Microsoft YaHei';">{{ scope.row.isUpload == "Y" ? "√" : "" }}</div>
</template>

542
src/components/room/RoomAsbitem.vue

@ -5,265 +5,101 @@
<div style="display: block; width:300px;">
<div>
<span>项目类别</span>
<el-cascader :options="dict.itemTypeTree" v-model="itemTypeIds" popper-class="example" style="margin-left: 3px;width:240px;"
:props="{ checkStrictly: true, expandTrigger: 'hover', ...customerOrg.treeprops, }"
clearable filterable @change="getAsbItemByItemType" size="small">
<el-cascader :options="dict.itemTypeTree" v-model="itemTypeIds" popper-class="example"
style="margin-left: 3px;width:240px;"
:props="{ checkStrictly: true, expandTrigger: 'hover', ...customerOrg.treeprops, }" clearable filterable
@change="getAsbItemByItemType" size="small">
</el-cascader>
</div>
<div class="box">
<el-table :data="dict.asbItem" border size="small" highlight-current-row
:height="tableHeight"
@row-dblclick="dbClickChoosedAsb" row-key="id"
@selection-change="selectLeft" :row-class-name="handleRowClassName"
@row-click="chooseAsbItem">
<el-table :data="dict.asbItem" border size="small" highlight-current-row :height="tableHeight"
@row-dblclick="dbClickChoosedAsb" row-key="id" @selection-change="selectLeft"
:row-class-name="handleRowClassName" @row-click="chooseAsbItem">
<!--
<el-table-column type="selection" align="center" ></el-table-column>
-->
<el-table-column type="index" align="center" width="40" />
<el-table-column
label="未选组合项目" min-width="170"
prop="displayName" align="center"
></el-table-column>
<el-table-column label="未选组合项目" min-width="170" prop="displayName" align="center"></el-table-column>
</el-table>
</div>
</div>
<!--中间操作按钮-->
<div style="display: block;margin: 40px 10px 0 15px;width:110px;">
<div v-show="checkPagePriv(pagePriv.privs,'添加')" style="padding: 5px 0;">
<el-button class="commonbutton" @click="addAbs(asbItemChoosed,'choosed')" >添加 <i class="el-icon-arrow-right"></i></el-button>
<div style="padding: 5px 0;">
<el-button class="commonbutton" @click="addAbs(asbItemChoosed, 'choosed')">添加 <i
class="el-icon-arrow-right"></i></el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs,'全部添加')" style="padding: 5px 0;">
<div style="padding: 5px 0;">
<el-button class="difference" @click="addAbs(asbItemChoosed, 'all')">全部添加</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs,'移除')" style="padding: 5px 0;">
<el-button class="commonbutton"
@click="delAbs(customerOrgGroupAsbitemsChoosed,'choosed')">移除 <i class="el-icon-arrow-left"></i
></el-button>
<div style="padding: 5px 0;">
<el-button class="commonbutton" @click="delAbs(roomAsbitemsChoosed, 'choosed')">移除 <i
class="el-icon-arrow-left"></i></el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs,'全部移除')" style="padding: 5px 0;">
<el-button class="difference" @click="delAbs(customerOrgGroupAsbitemsChoosed,'all')">全部移除</el-button>
<div style="padding: 5px 0;">
<el-button class="difference" @click="delAbs(roomAsbitemsChoosed, 'all')">全部移除</el-button>
</div>
</div>
<!--已选组合项目-->
<div :style="'display: block; width:' + (window.pageWidth - 300 - 120 - window.pageMarginWidth - 110 - 5) + 'px;'">
<div
:style="'display: block; width:' + (window.pageWidth - 300 - 120 - window.pageMarginWidth - 110 - 5) + 'px;'">
<div style="height:32px;">
<div v-show="checkPagePriv(pagePriv.privs,'快速选择')">
<div>
<span>快速选择</span>
<el-select v-model="asbItemId" placeholder="快速选择组合项目" size="small"
filterable default-first-option :filter-method="filterMethod"
clearable @clear="quickAsb = deepCopy(dict.asbItemQuick)"
@change="quickChoosedAsb" ref="quickAsbOCX"
style="margin-left: 3px;width:240px;">
<el-select v-model="asbItemId" placeholder="快速选择组合项目" size="small" filterable default-first-option
:filter-method="filterMethod" clearable @clear="quickAsb = deepCopy(dict.asbItemQuick)"
@change="quickChoosedAsb" ref="quickAsbOCX" style="margin-left: 3px;width:240px;">
<el-option v-for="item in quickAsb" :key="item.id" :value="item.id" :label="item.displayName" />
</el-select>
</div>
</div>
<div class="box">
<el-table :data="customerOrgGroupAsbitems" border size="small"
@selection-change="selectRight" highlight-current-row
:height="tableHeight"
:summary-method="getSummaries" show-summary
:row-class-name="handleRowClassName" @row-dblclick="removeAbs"
@row-click="removeAsbItem" ref="tableCustomerOrgGroupAsbitems">
<el-table :data="roomAsbitems" border size="small" @selection-change="selectRight" highlight-current-row
:height="tableHeight" :summary-method="getSummaries" show-summary :row-class-name="handleRowClassName"
@row-dblclick="removeAbs" @row-click="removeAsbItem" ref="tableCustomerOrgGroupAsbitems">
<!--
<el-table-column type="selection"></el-table-column>
-->
<el-table-column type="index" width="40" align="center" />
<el-table-column
label="已选组合项目"
min-width="140"
prop="displayName"
></el-table-column>
<el-table-column label="已选组合项目" min-width="140" prop="asbitemName"></el-table-column>
<!--
<el-table-column label="标准价格" prop="price" min-width="60" align="center" />
<el-table-column label="折扣" min-width="40" align="center">
<template slot-scope="scope">
<el-input
@input="changeDiscount(scope.$index)"
type="number" size="small"
v-model="scope.row.discount"
/>
<el-input @input="changeDiscount(scope.$index)" type="number" size="small"
v-model="scope.row.discount" />
</template>
</el-table-column>
<el-table-column label="应收价格" prop="customerOrgGroupDetailPrice" min-width="60" align="center">
<el-table-column label="应收价格" prop="roomDetailPrice" min-width="60" align="center">
<template slot-scope="scope">
<el-input
@input="changePrices(scope.$index)"
type="number" size="small"
v-model="scope.row.customerOrgGroupDetailPrice"
/>
<el-input @input="changePrices(scope.$index)" type="number" size="small"
v-model="scope.row.roomDetailPrice" />
</template>
</el-table-column>
<el-table-column label="数量" prop="customerOrgGroupDetailAmount" width="50" align="center">
<el-table-column label="数量" prop="roomDetailAmount" width="50" align="center">
<template slot-scope="scope">
<el-input
@input="changePrices(scope.$index)"
type="number" size="small"
v-model="scope.row.customerOrgGroupDetailAmount"
/>
<el-input @input="changePrices(scope.$index)" type="number" size="small"
v-model="scope.row.roomDetailAmount" />
</template>
</el-table-column>
<el-table-column label="标准金额" prop="asbitemMoney" min-width="60" align="center">
</el-table-column>
<el-table-column label="应收金额" prop="customerOrgGroupDetailMoney" min-width="60" align="center">
<el-table-column label="应收金额" prop="roomDetailMoney" min-width="60" align="center">
</el-table-column>
-->
</el-table>
</div>
</div>
</div>
<!--批量操作按钮复制套餐与分组-->
<div style="display: block;margin-left: 5px;">
<div v-show="checkPagePriv(pagePriv.privs,'复制分组')" style="margin-top: 50px;">
<el-button class="commonbutton" @click="btnCopyGroup">复制分组</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs,'复制套餐')" style="margin-top: 10px;">
<el-button class="commonbutton" @click="btnCopyMedicalPackage">复制套餐</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs,'保存')" style="margin-top: 10px;">
<div style="margin-top: 50px;">
<el-button class="commonbutton" @click="btnSave">保存</el-button>
</div>
</div>
<!--复制套餐-->
<el-dialog title="体检套餐" :visible.sync="medicalPackageVisble" width="600px" height="400"
:show-close="false" :close-on-click-modal="false" :append-to-body="true">
<el-table :data="dict.medicalPackage" border height="350" row-key="id" size="small"
highlight-current-row @row-click="packageRowClick" @row-dblclick="rowDblclick" ref="patientList" >
<!-- "displayName": "健康体检套餐",
"price": 20.00,
"forSexId": "0",
"isActive": "Y",
"remark": "2",
"displayOrder": 1,
"simpleCode": "JKTJTC",
"creatorName": "admin",
"lastModifierName": "users",
"lastModificationTime": "2023-08-04T16:34:02.94408",
"lastModifierId": "3a0ca83b-3116-da05-3916-dfd4c0c548cb",
"creationTime": "2023-07-10T19:53:30.210553",
"creatorId": "3a0c4180-107c-0c89-b25b-0bd34666dcec",
"id": "3a0c51d3-2345-38df-ba0b-1862a3c3606f" -->
<el-table-column type="index" width="50" />
<el-table-column prop="displayName" label="套餐名称" width="180"/>
<el-table-column prop="price" label="价格" width="80"/>
<el-table-column prop="forSexId" label="适用性别" width="80">
<template slot-scope="scope">
<div>
{{ dddw(dict.forSex, "id", scope.row.forSexId, "displayName") }}
</div>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" width="100"/>
<el-table-column prop="creatorName" label="创建人员" width="80"/>
<el-table-column prop="creationTime" label="创建日期" width="100">
<template slot-scope="scope">
<div v-if="scope.row.creationTime">
{{ moment(scope.row.creationTime).format("yyyy-MM-DD") }}
</div>
</template>
</el-table-column>
<el-table-column prop="lastModifierName" label="修改人员" width="80"/>
<el-table-column prop="lastModificationTime" label="修改日期" width="100">
<template slot-scope="scope">
<div v-if="scope.row.lastModificationTime">
{{ moment(scope.row.lastModificationTime).format("yyyy-MM-DD") }}
</div>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button class="commonbutton" @click="medicalPackageVisble = false" style="width:90px;">取消</el-button>
<el-button class="commonbutton" type="primary" @click="copyMedicalPackage" style="width:90px;">确定</el-button>
</span>
</el-dialog>
<!--复制分组-->
<el-dialog title="单位分组" :visible.sync="groupVisble" width="700px" height="500"
:show-close="false" :close-on-click-modal="false" :append-to-body="true">
<el-table
:data="customerOrgGroups" ref="customerOrgGroups"
style="margin-top: 2px"
row-key="id"
border
height="240px"
size="small"
highlight-current-row :row-class-name="handleRowClassName"
@row-click="groupRowClick" @row-dblclick="groupRowDblclick" >
>
<el-table-column
type="index"
label="序号"
min-width="50"
align="center"
/>
<el-table-column prop="displayName" label="名称" min-width="150" />
<el-table-column
prop="price"
label="价格"
min-width="60"
align="center"
/>
<el-table-column
prop="forSexId"
label="适用性别"
min-width="60"
align="center"
>
<template slot-scope="scope">
{{ dddw(dict.forSex, "id", scope.row.forSexId, "displayName") }}
</template>
</el-table-column>
<el-table-column
prop="maritalStatusId"
label="适用婚姻状况"
min-width="80"
align="center"
>
<template slot-scope="scope">
{{
dddw(
dict.forMaritalStatus,
"id",
scope.row.maritalStatusId,
"displayName"
)
}}
</template>
</el-table-column>
<el-table-column
prop="creatorName"
label="创建者"
min-width="60"
align="center"
/>
<el-table-column label="创建时间" min-width="150" align="center">
<template slot-scope="scope">
{{
scope.row.creationTime
? moment(scope.row.creationTime).format("yyyy-MM-DD HH:mm:ss")
: ""
}}
</template>
</el-table-column>
<el-table-column label="操作">
<template>
<el-tag
class="move"
style="cursor: move; margin-left: 15px"
draggable="true"
>
<i class="el-icon-d-caret" style="width: 1rem; height: 1rem"></i>
</el-tag>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button class="commonbutton" @click="groupVisble = false" style="width:90px;">取消</el-button>
<el-button class="commonbutton" type="primary" @click="copyGroup" style="width:90px;">确定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
@ -274,16 +110,16 @@ import { getPagePriv,checkPagePriv, arrayExistObj, tcdate, arrayFilter, arrayRed
export default {
props:['customerOrgGroup','refreshMoney'],
props: ['room'],
data() {
return {
pagePriv: {
routeUrlorPageName:'customerOrgGroup', //
routeUrlorPageName: 'room', //
privs: [] //
},
groupPrice:0, //
customerOrgGroupAsbitems:[], //()
customerOrgGroupAsbitemsChoosed:[], //()
roomAsbitems: [], //()
roomAsbitemsChoosed: [], //()
itemTypeIds: [], //
asbItemId: '', //ID
quickAsb: [], //
@ -292,14 +128,6 @@ export default {
startPoint: -1,
PstartPoint: -1,
medicalPackageVisble:false, //
curPackageId:'', //ID
packageAsbitems:[], //
groupVisble:false, //
customerOrgGroups:[], //
curGroupId:'', //ID
groupAsbitems:[], //
dialogVisible: false,
@ -336,11 +164,11 @@ export default {
this.dictInit()
},
mounted() {
this.getCustomerOrgGroupAsbitems(this.customerOrgGroup.id);
this.getRoomAsbitems(this.room.id);
},
updated() {
this.refreshTable('tableCustomerOrgGroupAsbitems')
// this.refreshTable('tableCustomerOrgGroupAsbitems')
},
methods: {
moment, dddw, deepCopy, checkPagePriv,
@ -374,13 +202,6 @@ export default {
}
});
// ()
postapi("/api/app/medicalpackage/getmedicalpackagelist",{}).then((res) => {
if (res.code != -1) {
this.dict.medicalPackage = res.data;
}
});
},
handleRowClassName({ row, rowIndex }) {
@ -417,8 +238,8 @@ export default {
getAsbItemByItemType() {
this.getAsbItemByItemTypeAll()
//
arrayReduce(this.dict.asbItem, [...this.customerOrgGroupAsbitems], "id=asbitemId");
arrayReduce(this.dict.asbItemQuick, [...this.customerOrgGroupAsbitems], "id=asbitemId");
arrayReduce(this.dict.asbItem, [...this.roomAsbitems], "id=asbitemId");
arrayReduce(this.dict.asbItemQuick, [...this.roomAsbitems], "id=asbitemId");
this.quickAsb = Object.assign(this.dict.asbItemQuick)
},
@ -442,13 +263,13 @@ export default {
//
///api/app/register-asbitem/many/3fa85f64-5717-4562-b3fc-2c963f66afa6'
async addAbs(asbItemChoosed, oprType) {
// console.log('this.customerOrgGroup',this.customerOrgGroup)
// console.log('this.room',this.room)
// console.log('asbItemChoosed', asbItemChoosed)
if(!this.customerOrgGroup.id){
this.$message.warning({ showClose: true, message: "请先选中单位分组"})
if (!this.room.id) {
this.$message.warning({ showClose: true, message: "请先选中分诊叫号房间" })
return
}
if(this.customerOrgGroup.isComplete && this.customerOrgGroup.isComplete.toUpperCase() == 'Y'){
if (this.room.isComplete && this.room.isComplete.toUpperCase() == 'Y') {
this.$message.warning({ showClose: true, message: "体检次数已完成,不允许操作" })
return
}
@ -484,9 +305,9 @@ export default {
// "price": 0,
// for (let i = 0; i < asbItemChoosed.length; i++) {
// if (this.customerOrgGroup.forSexId == 'A') break //
// if (this.room.forSexId == 'A') break //
// if (asbItemChoosed[i].forSexId == 'A' || asbItemChoosed[i].forSexId == 'U') continue
// if (asbItemChoosed[i].forSexId != this.customerOrgGroup.sexId) {
// if (asbItemChoosed[i].forSexId != this.room.sexId) {
// this.$message.warning(`${asbItemChoosed[i].displayName}`)
// checked = false
// break
@ -496,12 +317,12 @@ export default {
// if (!checked) return
//
arrayReduce(asbItemChoosed, this.customerOrgGroupAsbitems, "id=asbitemId")
arrayReduce(asbItemChoosed, this.roomAsbitems, "id=asbitemId")
for (let i = asbItemChoosed.length - 1; i > - 1; i--) {
if (this.customerOrgGroup.forSexId == 'A') break //
if (this.room.forSexId == 'A') break //
if (asbItemChoosed[i].forSexId == 'A' || asbItemChoosed[i].forSexId == 'U') continue
if (asbItemChoosed[i].forSexId != this.customerOrgGroup.forSexId) {
if (asbItemChoosed[i].forSexId != this.room.forSexId) {
message.push(asbItemChoosed[i].displayName) //.warning(`${asbItemChoosed[i].displayName}`)
checked = false
asbItemChoosed.splice(i, 1)
@ -513,18 +334,19 @@ export default {
for (let i = 0; i < asbItemChoosed.length; i++) {
let pojo = {
asbitemId: asbItemChoosed[i].id,
displayName:asbItemChoosed[i].displayName,
// displayName: asbItemChoosed[i].displayName,
asbitemName: asbItemChoosed[i].displayName,
discount: 100,
customerOrgGroupDetailAmount:1,
roomDetailAmount: 1,
price: asbItemChoosed[i].price,
customerOrgGroupDetailPrice:asbItemChoosed[i].price,
customerOrgGroupDetailMoney: asbItemChoosed[i].price,
roomDetailPrice: asbItemChoosed[i].price,
roomDetailMoney: asbItemChoosed[i].price,
asbitemMoney: asbItemChoosed[i].price,
}
this.customerOrgGroupAsbitems.push(pojo)
//this.customerOrgGroupAsbitems.push({ ...pojo, asbitemName: asbItemChoosed[i].displayName })
this.roomAsbitems.push(pojo)
//this.roomAsbitems.push({ ...pojo, asbitemName: asbItemChoosed[i].displayName })
lfind = arrayExistObj(this.dict.asbItem, 'id', asbItemChoosed[i].id)
if (lfind > -1) this.dict.asbItem.splice(lfind, 1)
@ -616,11 +438,11 @@ export default {
//
///api/app/register-asbitem/many?RegisterAsbitemIds=3fa85f64-5717-4562-b3fc-2c963f66afa6
delAbs(absForDel, oprType) {
if(!this.customerOrgGroup.id){
if (!this.room.id) {
this.$message.warning({ showClose: true, message: "请先选中单位分组" })
return
}
if(this.customerOrgGroup.isComplete && this.customerOrgGroup.isComplete.toUpperCase() == 'Y'){
if (this.room.isComplete && this.room.isComplete.toUpperCase() == 'Y') {
this.$message.warning({ showClose: true, message: "体检次数已完成,不允许操作" })
return
}
@ -630,10 +452,10 @@ export default {
// start
if (oprType && oprType == 'all') {
absForDel = deepCopy(this.customerOrgGroupAsbitems)
absForDel = deepCopy(this.roomAsbitems)
} else if (oprType && oprType == 'choosed') {
absForDel = []
this.customerOrgGroupAsbitems.forEach(e =>{
this.roomAsbitems.forEach(e => {
if (e.choosed) {
absForDel.push(deepCopy(e))
e.choosed = false
@ -649,8 +471,8 @@ export default {
for (let i = 0; i < absForDel.length; i++) {
lfind = arrayExistObj(this.customerOrgGroupAsbitems, 'asbitemId', absForDel[i].asbitemId)
if (lfind > -1) this.customerOrgGroupAsbitems.splice(lfind, 1)
lfind = arrayExistObj(this.roomAsbitems, 'asbitemId', absForDel[i].asbitemId)
if (lfind > -1) this.roomAsbitems.splice(lfind, 1)
absForDel.splice(i, 1)
i--
@ -670,31 +492,31 @@ export default {
//
removeAsbItem(row) {
this.customerOrgGroupAsbitems.forEach((e,index) => {
this.roomAsbitems.forEach((e, index) => {
e.index = index;
return e
});
// shift
if (this.window.shift) {
//
this.customerOrgGroupAsbitems.forEach(e => {
this.roomAsbitems.forEach(e => {
e.choosed = false;
return e
});
if (this.PstartPoint == - 1) {
this.customerOrgGroupAsbitems[row.index].choosed = true;
this.roomAsbitems[row.index].choosed = true;
this.PstartPoint = row.index;
return
}
if (this.PstartPoint > row.index) {
for (let i = row.index; i <= this.PstartPoint; i++) {
this.customerOrgGroupAsbitems[i].choosed = true
this.roomAsbitems[i].choosed = true
}
} else if (this.PstartPoint <= row.index) {
for (let i = this.PstartPoint; i <= row.index; i++) {
this.customerOrgGroupAsbitems[i].choosed = true
this.roomAsbitems[i].choosed = true
}
}
return
@ -702,8 +524,8 @@ export default {
// ctrl
if (this.window.ctrl) {
console.log('this.window.ctrl',this.window.ctrl,this.customerOrgGroupAsbitems)
this.customerOrgGroupAsbitems[row.index].choosed = true;
console.log('this.window.ctrl', this.window.ctrl, this.roomAsbitems)
this.roomAsbitems[row.index].choosed = true;
this.PstartPoint = row.index;
return
}
@ -711,23 +533,23 @@ export default {
// ctrl shift
//
//console.log('')
this.customerOrgGroupAsbitems.forEach(e => {
this.roomAsbitems.forEach(e => {
e.choosed = false;
return e
});
this.customerOrgGroupAsbitems[row.index].choosed = true;
this.roomAsbitems[row.index].choosed = true;
this.PstartPoint = row.index;
},
changeDiscount(index) {
this.customerOrgGroupAsbitems[index].customerOrgGroupDetailPrice =
(this.customerOrgGroupAsbitems[index].discount * this.customerOrgGroupAsbitems[index].price/100).toFixed(2)
this.roomAsbitems[index].roomDetailPrice =
(this.roomAsbitems[index].discount * this.roomAsbitems[index].price / 100).toFixed(2)
this.customerOrgGroupAsbitems[index].customerOrgGroupDetailMoney =
(this.customerOrgGroupAsbitems[index].customerOrgGroupDetailPrice * this.customerOrgGroupAsbitems[index].customerOrgGroupDetailAmount).toFixed(2)
this.roomAsbitems[index].roomDetailMoney =
(this.roomAsbitems[index].roomDetailPrice * this.roomAsbitems[index].roomDetailAmount).toFixed(2)
//this.getSummaries()
@ -735,13 +557,13 @@ export default {
//
changePrices(index) {
this.customerOrgGroupAsbitems[index].customerOrgGroupDetailMoney =
(this.customerOrgGroupAsbitems[index].customerOrgGroupDetailPrice * this.customerOrgGroupAsbitems[index].customerOrgGroupDetailAmount).toFixed(2)
this.roomAsbitems[index].roomDetailMoney =
(this.roomAsbitems[index].roomDetailPrice * this.roomAsbitems[index].roomDetailAmount).toFixed(2)
this.customerOrgGroupAsbitems[index].asbitemMoney =
(this.customerOrgGroupAsbitems[index].price * this.customerOrgGroupAsbitems[index].customerOrgGroupDetailAmount).toFixed(2)
this.roomAsbitems[index].asbitemMoney =
(this.roomAsbitems[index].price * this.roomAsbitems[index].roomDetailAmount).toFixed(2)
this.customerOrgGroupAsbitems[index].discount = (this.customerOrgGroupAsbitems[index].customerOrgGroupDetailPrice * 100 / this.customerOrgGroupAsbitems[index].price).toFixed(2)
this.roomAsbitems[index].discount = (this.roomAsbitems[index].roomDetailPrice * 100 / this.roomAsbitems[index].price).toFixed(2)
//this.getSummaries()
},
@ -751,8 +573,8 @@ export default {
console.log('getSummaries param', param)
// if(!param){
// param = {
// columns:[{}, {}, {}, {}, {}, {}, {property: 'asbitemMoney'},{property: 'customerOrgGroupDetailMoney'}],
// data:this.customerOrgGroupAsbitems
// columns:[{}, {}, {}, {}, {}, {}, {property: 'asbitemMoney'},{property: 'roomDetailMoney'}],
// data:this.roomAsbitems
// }
// }
@ -787,167 +609,34 @@ export default {
return sums;
},
//
btnCopyGroup(){
console.log('this.customerOrgGroup',this.customerOrgGroup)
if(!this.customerOrgGroup.id){
this.$message.warning({ showClose: true, message: "请先选中单位分组"})
return
}
if(this.customerOrgGroup.isComplete && this.customerOrgGroup.isComplete.toUpperCase() == 'Y'){
this.$message.warning({ showClose: true, message: "体检次数已完成,不允许操作"})
return
}
getapi(
`/api/app/customerorggroup/getlistinfilter?CustomerOrgRegisterId=${this.customerOrgGroup.customerOrgRegisterId}`
).then((res) => {
if (res.code != -1) {
this.customerOrgGroups = res.data;
if(this.customerOrgGroups.length <2){
this.$message.warning({ showClose: true, message: "暂无其他分组可供复制"})
}else{
this.groupVisble = true
}
}
});
},
//
async groupRowClick(row){
this.curGroupId = row.id
this.groupAsbitems = []
try {
let res = await getapi(`/api/app/customerorggroupdetail/getcustomerorggroupdetailinasbitem?CustomerOrgGroupId=${row.id}`)
if(res.code != -1) this.groupAsbitems = res.data
} catch (error) {
console.log(error)
}
},
//
async groupRowDblclick(row){
await this.groupRowClick(row)
this.copyGroup()
},
//()
copyGroup(){
if(!this.curGroupId){
this.$message.warning({ showClose: true, message: "请先选择要复制的套餐!"})
return
}
console.log('this.packageAsbitems',this.groupAsbitems)
this.addAbs(deepCopy(this.groupAsbitems))
this.groupVisble = false
},
//
btnCopyMedicalPackage(){
// console.log('this.customerOrgGroup',this.customerOrgGroup)
if(!this.customerOrgGroup.id){
this.$message.warning({ showClose: true, message: "请先选中单位分组"})
return
}
if(this.customerOrgGroup.isComplete && this.customerOrgGroup.isComplete.toUpperCase() == 'Y'){
this.$message.warning({ showClose: true, message: "体检次数已完成,不允许操作"})
return
}
this.medicalPackageVisble = true
},
//
async packageRowClick(row){
this.curPackageId = row.id
this.packageAsbitems = []
try {
let res = await postapi('/api/app/medicalpackagedetail/getmedicalpackageinasbitem',{medicalPackageId:row.id})
this.packageAsbitems = res.data
} catch (error) {
console.log(error)
}
},
//
async rowDblclick(row){
await this.packageRowClick(row)
this.copyMedicalPackage()
},
//()
copyMedicalPackage(){
if(!this.curPackageId){
this.$message.warning({ showClose: true, message: "请先选择要复制的套餐!"})
return
}
console.log('this.packageAsbitems',this.packageAsbitems)
this.addAbs(deepCopy(this.packageAsbitems))
this.medicalPackageVisble = false
},
//
btnSave() {
if(!this.customerOrgGroup.id){
this.$message.warning({ showClose: true, message: "请先选中单位分组"})
return
}
if(this.customerOrgGroup.isComplete && this.customerOrgGroup.isComplete.toUpperCase() == 'Y'){
this.$message.warning({ showClose: true, message: "体检次数已完成,不允许操作"})
if (!this.room.id) {
this.$message.warning({ showClose: true, message: "请先选中分诊叫号房间" })
return
}
let body = {
customerOrgGroupId:this.customerOrgGroup.id,
details:[]
roomId: this.room.id,
asbitemIds: []
}
// {
// "customerOrgGroupId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "details": [
// {
// "customerOrgGroupId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "asbitemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "price": 0,
// "amount": 0
// }
// "roomId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "asbitemIds": [
// "3fa85f64-5717-4562-b3fc-2c963f66afa6"
// ]
// }
this.customerOrgGroupAsbitems.forEach(e =>{
body.details.push({
customerOrgGroupId:this.customerOrgGroup.id,
asbitemId:e.asbitemId,
price:e.customerOrgGroupDetailPrice,
amount:e.customerOrgGroupDetailAmount
})
this.roomAsbitems.forEach(e => {
body.asbitemIds.push(e.asbitemId)
})
let group = deepCopy(this.customerOrgGroup);
postapi('/api/app/customerorggroupdetail/createcustomerorggroupdetailmany',body
)
// .then(res => {
// if(res.code != -1){
// delete group.id;
// delete group.customerOrgId;
// delete group.isComplete;
// group.price = this.groupPrice
// // console.log('this.customerOrgGroup',this.customerOrgGroup)
// // console.log('group',group)
// return putapi(`/api/app/customer-org-group/${this.customerOrgGroup.id}`, group)
// }
// })
postapi('/api/app/Room/CreateRoomDetails', body)
.then(res => {
if (res && res.code != -1) {
console.log("操作成功");
group.price = this.groupPrice
group.id = this.customerOrgGroup.id
this.refreshMoney(group)
this.dataTransOpts.refresh.room_detail.M++
}
})
@ -956,7 +645,7 @@ export default {
//
selectRight(val) {
this.customerOrgGroupAsbitemsChoosed = val;
this.roomAsbitemsChoosed = val;
},
@ -967,18 +656,17 @@ export default {
//
getCustomerOrgGroupAsbitems(customerOrgGroupId) {
if(customerOrgGroupId){
getapi(
`/api/app/customerorggroupdetail/getcustomerorggroupdetailinasbitem?CustomerOrgGroupId=${customerOrgGroupId}`
).then((res) => {
getRoomAsbitems(roomId) {
if (roomId) {
postapi('/api/app/Room/GetAsbitemListByRoomId', { roomId })
.then((res) => {
if (res.code != -1) {
this.customerOrgGroupAsbitems = res.data;
this.roomAsbitems = res.data;
this.getAsbItemByItemType()
}
});
} else {
this.customerOrgGroupAsbitems = []
this.roomAsbitems = []
this.getAsbItemByItemType()
}
},
@ -988,18 +676,17 @@ export default {
//
watch: {
// ID
"dataTransOpts.refresh.customer_org_group_detail.M":{
"dataTransOpts.refresh.room_detail.M": {
// immediate:true,
handler(newVal, oldVal) {
console.log(`watch 体检分组 newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.customerOrgGroup.id}`);
this.getCustomerOrgGroupAsbitems(this.customerOrgGroup.id);
console.log(`watch 体检分组 newVal:${newVal} oldVal:${oldVal} registerCheckId: ${this.room.id}`);
if (newVal != oldVal) this.getRoomAsbitems(this.room.id);
}
},
},
};
</script>
<style scoped>
.box {
margin-top: 5px;
/* border: 1px solid #000; */
@ -1009,5 +696,4 @@ export default {
width: 100px;
margin-bottom: 5px
}
</style>

148
src/components/room/RoomEdit.vue

@ -18,7 +18,7 @@
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="体检中心">
<el-form-item prop="medicalCenterId" label="体检中心">
<el-select v-model="form.medicalCenterId" placeholder="请选择" size="small" style="width:310px;">
<el-option v-for="item in dict.medicalCenter" :key="item.id" :label="item.displayName" :value="item.id">
</el-option>
@ -26,11 +26,10 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目类别">
<el-form-item prop="itemTypeId" label="项目类别">
<el-cascader :options="dict.itemTypeTree" v-model="form.itemTypeId" popper-class="example"
style="width:310px;"
:props="{ checkStrictly: true, expandTrigger: 'hover', label: 'displayName', value: 'id', id: 'id', children: 'treeChildren'}" clearable filterable
size="small">
style="width:310px;" filterable size="small"
:props="{ checkStrictly: true, expandTrigger: 'hover', label: 'displayName', value: 'id', id: 'id', children: 'treeChildren' }">
</el-cascader>
</el-form-item>
</el-col>
@ -59,7 +58,7 @@
<div style="display: flex;margin-top: 5px;justify-content:space-between;">
<div></div>
<div style="display: flex;">
<el-button class="commonbutton" @click="dialogWin.RommEdit = false">关闭</el-button>
<el-button class="commonbutton" @click="dialogWin.RoomEdit = false">关闭</el-button>
<!--
<el-button type="success" @click="computePrice">同比折算组合项目价格</el-button>
-->
@ -78,13 +77,13 @@ import {
deepCopy,
objCopy,
arrayExistObj,
tcdate
} from "../../utlis/proFunc";
import CustomerOrgGroupAsbitem from "../../components/customerOrg/customerOrgGroupAsbitem.vue";
export default {
components: {
CustomerOrgGroupAsbitem,
},
props: ["params"],
data() {
@ -125,13 +124,18 @@ export default {
//
dictInit() {
//
getapi("/api/app/customer-org/parent-all").then((res) => {
//
getapi("/api/app/organization-units/by-code-all").then((res) => {
if (res.code > -1) {
this.dict.medicalCenter = res.data;
}
});
//
getapi("/api/app/item-type/by-code-all").then((res) => {
if (res.code != -1) {
this.customerOrgAll = res.data;
let lfind = arrayExistObj(this.customerOrgAll, "id", this.dict.personOrgId);
if (lfind > -1) this.customerOrgAll.splice(lfind, 1);
this.customerOrg = deepCopy(this.customerOrgAll);
this.dict.itemTypeTree = res.data;
tcdate(this.dict.itemTypeTree);
}
});
@ -144,11 +148,11 @@ export default {
},
//
getFormData(id) {
if (id) {
getapi(`/api/app/customer-org-group/${id}`)
getFormData(roomId) {
if (roomId) {
postapi('/api/app/Room/Get', { roomId })
.then(res => {
if (res.code != -1) {
if (res.code > -1) {
this.form = deepCopy(res.data)
}
})
@ -186,126 +190,26 @@ export default {
postapi(url, body).then(res => {
if (res.code > -1) {
this.dialogWin.RommEdit = false
this.dataTransOpts.refresh.room_detail.M++
}
})
});
},
//
computePrice() {
if(!this.form.id){
this.$message.warning("尚未保存信息,不可执行此操作!");
return;
}
let customerOrgGroupId = this.form.id;
let customerOrgGroupAsbitems = []; //
getapi(`/api/app/customerorggroupdetail/getcustomerorggroupdetailinasbitem?CustomerOrgGroupId=${customerOrgGroupId}`)
.then((res) => {
if (res.code != -1) {
customerOrgGroupAsbitems = res.data;
if (customerOrgGroupAsbitems.length < 1) {
this.$message.warning("当前分组尚未设置组合项目,不可执行此操作!");
} else {
let body = {
customerOrgGroupId,
details: this.madeNewGroupAsbitems(
customerOrgGroupAsbitems,
this.form.price
),
};
console.log("body", body);
return postapi("/api/app/customerorggroupdetail/createcustomerorggroupdetailmany", body);
this.form.id = res.data.id
}
this.dataTransOpts.tableS.room.id = this.form.id
this.dialogWin.RommEdit = false
}
})
.then((res) => {
if (res.code != -1) {
//console.log("");
//
this.form.id = "";
//
setTimeout(() => {
this.form.id = customerOrgGroupId;
this.onSubmit("form");
}, 100);
}
});
},
madeNewGroupAsbitems(oldGroupAsbitems, newTotal) {
newTotal = Math.round(Number(newTotal) * 100) / 100;
let newGroupAsbitems = [];
let oldTotal = Number(0);
oldGroupAsbitems.forEach((e) => {
oldTotal += Number(e.asbitemMoney); //customerOrgGroupDetailMoney
});
oldTotal = Math.round(Number(oldTotal) * 100) / 100;
let discount = 0;
if (oldTotal != 0) discount = Math.round((newTotal * 10000) / oldTotal) / 100;
oldTotal = Number(0);
oldGroupAsbitems.forEach((e) => {
e.customerOrgGroupDetailPrice = Math.round(e.price * discount) / 100;
e.customerOrgGroupDetailMoney =
Math.round(
e.customerOrgGroupDetailPrice * e.customerOrgGroupDetailAmount * 100
) / 100;
oldTotal += Number(e.customerOrgGroupDetailMoney);
});
oldTotal = Math.round(Number(oldTotal) * 100) / 100;
//console.log('discount,oldTotal',discount,oldTotal)
let didTotal = Math.round(Number(newTotal - oldTotal) * 100) / 100;
if (didTotal != 0) {
for (let i = 0; i < oldGroupAsbitems.length; i++) {
if (oldGroupAsbitems[i].customerOrgGroupDetailAmount == 1) {
oldGroupAsbitems[i].customerOrgGroupDetailPrice =
Math.round(
(Number(oldGroupAsbitems[i].customerOrgGroupDetailPrice) +
Number(didTotal)) *
100
) / 100;
break;
}
}
}
oldGroupAsbitems.forEach((e) => {
newGroupAsbitems.push({
customerOrgGroupId: e.customerOrgGroupId,
asbitemId: e.asbitemId,
price: e.customerOrgGroupDetailPrice,
amount: e.customerOrgGroupDetailAmount,
});
});
return newGroupAsbitems;
},
},
//
watch: {
//
// "customerOrgGroup.id"(newVal, oldVal) {
// console.log("customerOrgGroup.id ",newVal,oldVal);
// if (newVal != oldVal) {
// this.getCustomerOrgGroupAsbitems(newVal);
// }
// },
// ID
"dataTransOpts.refresh.room.S": {
// immediate: true,
handler(newVal, oldVal) {
console.log(`watch 体检分组 newVal:${newVal} oldVal:${oldVal} customerOrgGroupId: ${this.dataTransOpts.tableS.room.id}`);
this.getFormData(this.dataTransOpts.tableS.room.id);
if (newVal != oldVal) this.getFormData(this.dataTransOpts.tableS.room.id);
}
},
},

217
src/components/room/room.vue

@ -10,9 +10,8 @@
<div style="display: flex">
<div>
<span>体检中心</span>
<el-select v-model="medicalCenterId" placeholder="请选择体检中心"
default-first-option clearable filterable style="margin-left: 10px" @change="changeMedicalCenter"
size="small">
<el-select v-model="medicalCenterId" placeholder="请选择体检中心" default-first-option clearable filterable
style="margin-left: 10px" @change="changeMedicalCenter" size="small">
<el-option v-for="item in dict.medicalCenter" :key="item.id" :label="item.displayName" :value="item.id">
{{ item.displayName }}
</el-option>
@ -25,7 +24,7 @@
<el-table-column type="index" label="序号" width="50" align="center" />
<el-table-column label="id" prop="id" min-width="200" align="center" />
<el-table-column prop="displayName" label="名称" min-width="150" />
<el-table-column v-if="!medicalCenterId" prop="medicalCenterId" label="体检中心" min-width="150">
<el-table-column v-show="!medicalCenterId" prop="medicalCenterId" label="体检中心" min-width="150">
<template slot-scope="scope">
{{ dddw(dict.medicalCenter, "id", scope.row.medicalCenterId, "displayName") }}
</template>
@ -46,7 +45,7 @@
</template>
</el-table-column>
<el-table-column prop="queueTime" label="候诊时间" min-width="80" align="center" />
<el-table-column prop="isActive" label="是否启用" min-width="80" align="center">
<el-table-column prop="isActive" label="启用" min-width="40" align="center">
<template slot-scope="scope">
<div style="font-family: 'Microsoft YaHei';">{{ scope.row.isActive == 'Y' ? '√' : '' }}</div>
</template>
@ -83,10 +82,10 @@
<el-button class="deleteButton" @click="btnDel">删除</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs, '置顶')" style="margin-top: 5px">
<el-button class="commonbutton" @click="btnSetTop">置顶</el-button>
<el-button class="commonbutton" @click="btnSetBottomOrTop(1)">置顶</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs, '置底')" style="margin-top: 5px">
<el-button class="commonbutton" @click="btnSetBottom">置底</el-button>
<el-button class="commonbutton" @click="btnSetBottomOrTop(2)">置底</el-button>
</div>
<div v-show="checkPagePriv(pagePriv.privs, '保存排序')" style="margin-top: 5px">
<el-button class="commonbutton" @click="btnSort" :disabled="!isDrag">保存排序</el-button>
@ -96,12 +95,12 @@
<!--分组项目信息 -->
<div>
<RoomAsbitem :customerOrgGroup="curCustomerOrgGroup" :refreshMoney="refreshMoney" />
<RoomAsbitem :room="curRoom" />
</div>
</div>
<!-- 新增或者编辑弹框 -->
<el-dialog :title="dataTransOpts.tableS.customer_org_group.id ? '编辑' : '新增'" :close-on-click-modal="false"
<el-dialog :title="dataTransOpts.tableS.room.id ? '编辑' : '新增'" :close-on-click-modal="false"
:visible.sync="dialogWin.RoomEdit" width="800px" @close="close_dialogWinRoomEdit">
<RoomEdit :params="RoomEditParams" />
</el-dialog>
@ -138,38 +137,22 @@ export default {
},
tableData: [], //
customerOrgId: "", //id
customerOrgRegisterList: [], //
customerOrgRegister: {}, //
curCustomerOrgGroup: {}, //
RoomEditParams: {}, //
curRoom: {}, //
RoomEditParams: {}, //
medicalCenterId: "", //
isDrag: false,
form: {
//
customerOrgId: "", //()
isComplete: "N", //
id: "",
medicalCenterId: null, //
displayName: "",
price: 0,
itemTypeId: "",
medicalCenterId: "",
forSexId: "A",
maritalStatusId: "A",
ageLowerLimit: 0,
ageUpperLimit: 200,
jobPost: "",
jobTitle: "",
remark: "",
isMaxMedicalTimes: "N",
roomTypeFlag: "0",
queueTime: 0,
isActive: "Y"
},
formOri: {}, //
formInit: {}, //
rules: {
displayName: [{ required: true, message: "请填写分组名称", trigger: "blur" }],
},
};
},
computed: {
@ -211,7 +194,7 @@ export default {
this.tableData.forEach((item, index) => {
result.push({ id: item.id, displayOrder: index });
});
putapi("/api/app/customerorggroup/updatesortmany", {
postapi("/api/app/Room/updatesortmany", {
itemList: result,
}).then((res) => {
console.log("操作成功");
@ -221,26 +204,6 @@ export default {
//Sortable
rowDrop() {
// this.$nextTick(() => {
// const tbody = document.querySelector(".el-table__body-wrapper tbody");
// const _this = this;
// Sortable.create(tbody, {
// handle: ".move",
// animation: 300,
// onEnd({ newIndex, oldIndex }) {
// _this.isDrag = false;
// const currRow = _this.tableData.splice(oldIndex, 1)[0];
// _this.tableData.splice(newIndex, 0, currRow);
// _this.tableData.map((item, index) => {
// if (index == newIndex && index == oldIndex) {
// } else if (index == oldIndex) {
// } else if (index == newIndex) {
// }
// });
// console.log(_this.tableData.map((item) => item.displayOrder));
// },
// });
// });
this.$nextTick(() => {
const el = document.querySelector(".el-table__body-wrapper tbody");
@ -260,45 +223,36 @@ export default {
});
},
//
btnSetBottom() {
if (!this.dataTransOpts.tableS.customer_org_group.id) {
//
btnSetBottomOrTop(sortType) {
if (!this.dataTransOpts.tableS.room.id) {
this.$message.warning("请选择操作的数据");
return;
}
let lfind = arrayExistObj(this.tableData, "id", this.dataTransOpts.tableS.customer_org_group.id);
let currentRow = {};
putapi(
`/api/app/customerorggroup/updatemanysort?id=${this.dataTransOpts.tableS.customer_org_group.id}&SortType=2`
).then((res) => {
let body = {
roomId: this.dataTransOpts.tableS.room.id,
sortType
}
postapi('/api/app/Room/UpdateManySort', body)
.then((res) => {
if (res.code > -1) {
console.log("操作成功");
let lfind = arrayExistObj(this.tableData, "id", body.roomId);
if (lfind > -1) {
let currentRow = {};
currentRow = this.tableData.splice(lfind, 1)[0]; //
if (sortType == 2) {
this.tableData.push(currentRow);
this.$refs["tableData"].setCurrentRow(currentRow);
});
},
//
btnSetTop() {
if (!this.dataTransOpts.tableS.customer_org_group.id) {
this.$message.warning("请选择操作的数据");
return;
}
let lfind = arrayExistObj(this.tableData, "id", this.dataTransOpts.tableS.customer_org_group.id);
let currentRow = {};
putapi(
`/api/app/customerorggroup/updatemanysort?id=${this.dataTransOpts.tableS.customer_org_group.id}&SortType=1`
).then((res) => {
console.log("操作成功");
currentRow = this.tableData.splice(lfind, 1)[0];
} else {
this.tableData.unshift(currentRow);
}
this.$refs["tableData"].setCurrentRow(currentRow);
}
}
});
},
//
handleRowClassName({ row, rowIndex }) {
// highLightBg 'selected'
@ -339,6 +293,8 @@ export default {
//
getRoom(medicalCenterId) {
this.dataTransOpts.tableS.room.id = ""
this.curRoom = {}
this.isDrag = false;
objCopy(this.formInit, this.form);
this.form.medicalCenterId = medicalCenterId;
@ -360,12 +316,9 @@ export default {
//
rowClick(row) {
this.dataTransOpts.tableS.customer_org_group.id = row.id
this.curCustomerOrgGroup = deepCopy(row);
this.curCustomerOrgGroup.isComplete = this.customerOrgRegister.isComplete;
setTimeout(() => {
this.dataTransOpts.refresh.customer_org_group_detail.M++;
}, 20);
this.curRoom = row
this.dataTransOpts.tableS.room.id = row.id
this.dataTransOpts.refresh.room_detail.M++;
},
// (id)
@ -383,23 +336,19 @@ export default {
//
btnEdit() {
if (!this.dataTransOpts.tableS.customer_org_group.id) {
this.$message.warning("请先选择体检分组");
if (!this.dataTransOpts.tableS.room.id) {
this.$message.warning("请先选择分诊叫号房间");
return;
}
this.btnAdd(this.dataTransOpts.tableS.customer_org_group.id)
this.btnAdd(this.dataTransOpts.tableS.room.id)
},
//
btnDel() {
if (!this.dataTransOpts.tableS.customer_org_group.id) {
if (!this.dataTransOpts.tableS.room.id) {
this.$message.warning("请选择需要操作的数据");
return;
}
if (this.customerOrgRegister.isComplete.toUpperCase() == "Y") {
this.$message.warning("该单位体检次数已完成,不允许删除分组");
return;
}
this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
confirmButtonText: "是",
@ -407,17 +356,15 @@ export default {
type: "warning",
})
.then(() => {
return deletapi(`/api/app/customer-org-group/${this.dataTransOpts.tableS.customer_org_group.id}`);
return postapi('/api/app/Room/Delete', { roomId: this.dataTransOpts.tableS.room.id });
})
.then((res) => {
if (res.code != -1) {
console.log("删除成功");
let lfind = arrayExistObj(this.tableData, "id", this.dataTransOpts.tableS.customer_org_group.id);
let lfind = arrayExistObj(this.tableData, "id", this.dataTransOpts.tableS.room.id);
if (lfind > -1) this.tableData.splice(lfind, 1);
this.dataTransOpts.tableS.customer_org_group.id = ''
setTimeout(() => {
this.dataTransOpts.refresh.customer_org_group_detail.M++
}, 20);
this.dataTransOpts.tableS.room.id = ''
this.dataTransOpts.refresh.room_detail.M++
}
})
.catch((err) => {
@ -428,66 +375,12 @@ export default {
});
},
madeNewGroupAsbitems(oldGroupAsbitems, newTotal) {
newTotal = Math.round(Number(newTotal) * 100) / 100;
let newGroupAsbitems = [];
let oldTotal = Number(0);
oldGroupAsbitems.forEach((e) => {
oldTotal += Number(e.asbitemMoney); //customerOrgGroupDetailMoney
});
oldTotal = Math.round(Number(oldTotal) * 100) / 100;
let discount = 0;
if (oldTotal != 0) discount = Math.round((newTotal * 10000) / oldTotal) / 100;
oldTotal = Number(0);
oldGroupAsbitems.forEach((e) => {
e.customerOrgGroupDetailPrice = Math.round(e.price * discount) / 100;
e.customerOrgGroupDetailMoney =
Math.round(
e.customerOrgGroupDetailPrice * e.customerOrgGroupDetailAmount * 100
) / 100;
oldTotal += Number(e.customerOrgGroupDetailMoney);
});
oldTotal = Math.round(Number(oldTotal) * 100) / 100;
//console.log('discount,oldTotal',discount,oldTotal)
let didTotal = Math.round(Number(newTotal - oldTotal) * 100) / 100;
if (didTotal != 0) {
for (let i = 0; i < oldGroupAsbitems.length; i++) {
if (oldGroupAsbitems[i].customerOrgGroupDetailAmount == 1) {
oldGroupAsbitems[i].customerOrgGroupDetailPrice =
Math.round(
(Number(oldGroupAsbitems[i].customerOrgGroupDetailPrice) +
Number(didTotal)) *
100
) / 100;
break;
}
}
}
oldGroupAsbitems.forEach((e) => {
newGroupAsbitems.push({
customerOrgGroupId: e.customerOrgGroupId,
asbitemId: e.asbitemId,
price: e.customerOrgGroupDetailPrice,
amount: e.customerOrgGroupDetailAmount,
});
});
return newGroupAsbitems;
},
// /
close_dialogWinRoomEdit() {
let id = this.dataTransOpts.tableS.customer_org_group.id
let id = this.dataTransOpts.tableS.room.id
if (id) {
//
getapi(`/api/app/customer-org-group/${id}`)
postapi('/api/app/Room/Get', { roomId:id })
.then(res => {
if (res.code != -1) {
let lfind = -1
@ -504,16 +397,18 @@ export default {
this.$refs["tableData"].setCurrentRow(this.tableData[lfind]);
// customer_org_group_detail
this.curCustomerOrgGroup = deepCopy(res.data);
this.curCustomerOrgGroup.isComplete = this.customerOrgRegister.isComplete;
this.curRoom = deepCopy(res.data);
this.dataTransOpts.refresh.room_detail.M++;
}
})
} else {
//
this.dataTransOpts.tableS.customer_org_group.id = this.curCustomerOrgGroup.id || ''
this.dataTransOpts.tableS.room.id = this.curRoom.id || ''
this.dataTransOpts.refresh.room_detail.M++;
}
this.dataTransOpts.refresh.customer_org_group_detail.M++;
},
},
};

Loading…
Cancel
Save