|
|
|
@ -112,21 +112,163 @@ |
|
|
|
<!--批量操作按钮(复制套餐与分组)--> |
|
|
|
<div style="display: block;margin-left: 10px;"> |
|
|
|
<div style="margin-top: 50px;"> |
|
|
|
<el-button class="btnClass">复制分组</el-button> |
|
|
|
<el-button class="btnClass" @click="btnCopyGroup">复制分组</el-button> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<el-button class="btnClass">复制套餐</el-button> |
|
|
|
<el-button class="btnClass" @click="btnCopyMedicalPackage">复制套餐</el-button> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<el-button class="btnClass" @click="btnSave">保存</el-button> |
|
|
|
</div> |
|
|
|
</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 @click="medicalPackageVisble = false" style="width:90px;">取消</el-button> |
|
|
|
<el-button 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 @click="groupVisble = false" style="width:90px;">取消</el-button> |
|
|
|
<el-button type="primary" @click="copyGroup" style="width:90px;">确定</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import { getapi, postapi } from "@/api/api"; |
|
|
|
import moment from 'moment'; |
|
|
|
import { mapState } from "vuex"; |
|
|
|
import { arrayExistObj, tcdate, arrayFilter, arrayReduce, deepCopy } from "../../utlis/proFunc"; |
|
|
|
import { getapi, postapi } from "@/api/api"; |
|
|
|
import { arrayExistObj, tcdate, arrayFilter, arrayReduce, deepCopy,dddw } from "../../utlis/proFunc"; |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
props:['customerOrgGroup'], |
|
|
|
@ -139,10 +281,18 @@ export default { |
|
|
|
|
|
|
|
asbItemChoosed: [], //勾选的 未选组合项目 |
|
|
|
startPoint:-1, |
|
|
|
|
|
|
|
PstartPoint:-1, |
|
|
|
|
|
|
|
saveornot: true, //保存按钮 |
|
|
|
medicalPackageVisble:false, //复制套餐 |
|
|
|
curPackageId:'', //当前选中套餐ID |
|
|
|
packageAsbitems:[], //套餐中包含的组合项目 |
|
|
|
|
|
|
|
groupVisble:false, //复制分组 |
|
|
|
customerOrgGroups:[], //历次分组 |
|
|
|
curGroupId:'', //当前选中套餐ID |
|
|
|
groupAsbitems:[], //选中分组包含组合项目 |
|
|
|
|
|
|
|
|
|
|
|
selecteddata: [], //已选数据 |
|
|
|
unselecteddata: [], //未选数据 |
|
|
|
unselecteddata: [], //右边勾选中 |
|
|
|
@ -172,6 +322,7 @@ export default { |
|
|
|
this.refreshTable('tableCustomerOrgGroupAsbitems') |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
moment,dddw, |
|
|
|
//表格强制刷新 |
|
|
|
refreshTable(tableRef){ |
|
|
|
this.$nextTick(() => { |
|
|
|
@ -201,6 +352,13 @@ export default { |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
//套餐 |
|
|
|
getapi("/api/app/medical-package/in-filter").then((res) => { |
|
|
|
if (res.code != -1) { |
|
|
|
this.dict.medicalPackage = res.data.items; |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleRowClassName({ row, rowIndex }) { |
|
|
|
@ -261,15 +419,18 @@ export default { |
|
|
|
// 添加组合项目 |
|
|
|
///api/app/register-asbitem/many/3fa85f64-5717-4562-b3fc-2c963f66afa6' |
|
|
|
async addAbs(asbItemChoosed,oprType) { |
|
|
|
console.log('this.customerOrgGroup',this.customerOrgGroup) |
|
|
|
console.log('asbItemChoosed', asbItemChoosed) |
|
|
|
if(!this.customerOrgGroup.id){ |
|
|
|
this.$message.warning("请先选中单位分组") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
let message = [] |
|
|
|
let checked = true |
|
|
|
let lfind = -1 |
|
|
|
|
|
|
|
//勾选时不需要此操作 start |
|
|
|
//oprType 不传值时,兼容勾选方式 |
|
|
|
//勾选时不需要此操作 start |
|
|
|
if(oprType && oprType == 'all'){ |
|
|
|
asbItemChoosed = deepCopy(this.dict.asbItem) |
|
|
|
}else if(oprType && oprType == 'choosed'){ |
|
|
|
@ -294,18 +455,34 @@ export default { |
|
|
|
// "forSexId": "F", |
|
|
|
// "itemTypeId": "3a0b16de-75b9-c910-c61b-844709a88940", |
|
|
|
// "price": 0, |
|
|
|
console.log('asbItemChoosed.length', asbItemChoosed.length) |
|
|
|
for (let i = 0; i < asbItemChoosed.length; i++) { |
|
|
|
|
|
|
|
// for (let i = 0; i < asbItemChoosed.length; i++) { |
|
|
|
// if (this.customerOrgGroup.forSexId == 'A') break //未选性别时,无需判断组合项目性别限制 |
|
|
|
// if (asbItemChoosed[i].forSexId == 'A' || asbItemChoosed[i].forSexId == 'U') continue |
|
|
|
// if (asbItemChoosed[i].forSexId != this.customerOrgGroup.sexId) { |
|
|
|
// this.$message.warning(`所选项目:${asbItemChoosed[i].displayName},不适合当前人员性别`) |
|
|
|
// checked = false |
|
|
|
// break |
|
|
|
// } |
|
|
|
// } |
|
|
|
// //console.log(222,checked) |
|
|
|
// if (!checked) return |
|
|
|
|
|
|
|
// 去掉重复的项目 |
|
|
|
arrayReduce(asbItemChoosed, this.customerOrgGroupAsbitems, "id=asbitemId") |
|
|
|
|
|
|
|
for (let i = asbItemChoosed.length - 1; i > - 1; i--) { |
|
|
|
if (this.customerOrgGroup.forSexId == 'A') break //未选性别时,无需判断组合项目性别限制 |
|
|
|
console.log(`asbItemChoosed[${i}]`,asbItemChoosed[i]) |
|
|
|
if (asbItemChoosed[i].forSexId == 'A' || asbItemChoosed[i].forSexId == 'U') continue |
|
|
|
if (asbItemChoosed[i].forSexId != this.customerOrgGroup.sexId) { |
|
|
|
this.$message.warning(`所选项目:${asbItemChoosed[i].displayName},不适合当前人员性别`) |
|
|
|
if (asbItemChoosed[i].forSexId != this.customerOrgGroup.forSexId) { |
|
|
|
message.push(asbItemChoosed[i].displayName) //.warning(`所选项目:${asbItemChoosed[i].displayName},不适合当前人员性别`) |
|
|
|
checked = false |
|
|
|
break |
|
|
|
asbItemChoosed.splice(i,1) |
|
|
|
} |
|
|
|
} |
|
|
|
//console.log(222,checked) |
|
|
|
if (!checked) return |
|
|
|
if (!checked) this.$message.warning(`所选项目【${JSON.stringify(message)}】不适合当前人员性别`) |
|
|
|
|
|
|
|
for (let i = 0; i < asbItemChoosed.length; i++) { |
|
|
|
let pojo = { |
|
|
|
@ -567,7 +744,95 @@ export default { |
|
|
|
return sums; |
|
|
|
}, |
|
|
|
|
|
|
|
//复制分组 |
|
|
|
btnCopyGroup(){ |
|
|
|
if(!this.customerOrgGroup.id || this.customerOrgGroup.customerOrgId){ |
|
|
|
this.$message.warning("请先选中单位分组") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
getapi( |
|
|
|
`/api/app/customerorggroup/getlistinfilter?CustomerOrgId=${this.customerOrgGroup.customerOrgId}` |
|
|
|
).then((res) => { |
|
|
|
if (res.code != -1) { |
|
|
|
this.customerOrgGroups = res.data.items; |
|
|
|
} |
|
|
|
}); |
|
|
|
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("请先选择要复制的套餐!") |
|
|
|
return |
|
|
|
} |
|
|
|
console.log('this.packageAsbitems',this.groupAsbitems) |
|
|
|
this.addAbs(deepCopy(this.groupAsbitems)) |
|
|
|
this.groupVisble = false |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//复制套餐 |
|
|
|
btnCopyMedicalPackage(){ |
|
|
|
if(!this.customerOrgGroup.id){ |
|
|
|
this.$message.warning("请先选中单位分组") |
|
|
|
return |
|
|
|
} |
|
|
|
this.medicalPackageVisble = true |
|
|
|
}, |
|
|
|
|
|
|
|
//选中套餐 |
|
|
|
async packageRowClick(row){ |
|
|
|
this.curPackageId = row.id |
|
|
|
this.packageAsbitems = [] |
|
|
|
try { |
|
|
|
let res = await getapi(`/api/app/medical-package-detail/medical-package-in-asbitem?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("请先选择要复制的套餐!") |
|
|
|
return |
|
|
|
} |
|
|
|
console.log('this.packageAsbitems',this.packageAsbitems) |
|
|
|
this.addAbs(deepCopy(this.packageAsbitems)) |
|
|
|
this.medicalPackageVisble = false |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|