8 changed files with 1402 additions and 265 deletions
-
2public/sysConfig.json
-
867src/components/occDisease/PoisonAsbitem.vue
-
68src/components/patientRegister/PatientRegisterEdit.vue
-
2src/components/patientRegister/PatientRegisterItem.vue
-
5src/components/patientRegister/PatientRegisterList.vue
-
266src/components/report/TurnoverReport.vue
-
6src/router/index.js
-
181src/views/basic-dictionary/ToxicFactors.vue
@ -1,4 +1,4 @@ |
|||
{ |
|||
"apiurl": "http://10.1.12.140:9529", |
|||
"apiurl": "http://140.143.162.39:9529", |
|||
"softName":"创业体检管理系统" |
|||
} |
|||
@ -0,0 +1,867 @@ |
|||
<template> |
|||
<div style="display: flex; margin-top:5px;"> |
|||
<div :style="'display: flex;width:' + (window.pageWidth - window.pageMarginWidth - 110 - 5) + 'px;font-size:14px;'"> |
|||
<!--未选组合项目--> |
|||
<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> |
|||
</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-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> |
|||
</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> |
|||
<div v-show="checkPagePriv(pagePriv.privs, '全部添加')" 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(occAsbitemsChoosed, '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(occAsbitemsChoosed, 'all')">全部移除</el-button> |
|||
</div> |
|||
</div> |
|||
|
|||
<!--已选组合项目--> |
|||
<div |
|||
:style="'display: block; width:' + (window.pageWidth - 300 - 120 - window.pageMarginWidth - 110 - 5) + 'px;'"> |
|||
<div style="height:32px;"> |
|||
<div v-show="checkPagePriv(pagePriv.privs, '快速选择')"> |
|||
<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-option v-for="item in quickAsb" :key="item.id" :value="item.id" :label="item.displayName" /> |
|||
</el-select> |
|||
</div> |
|||
</div> |
|||
<el-tabs tab-position="top" v-model="tabChoosed" style="margin-top: 5px;"> |
|||
<el-tab-pane v-for="item in occCheckType" :label="item.displayName" :name="item.id"> |
|||
<el-table :data="occAsbitems[item.id]" border size="small" @selection-change="selectRight" |
|||
highlight-current-row :height="tableHeight - 32" :summary-method="getSummaries" show-summary |
|||
:row-class-name="handleRowClassName" @row-dblclick="removeAbs" @row-click="removeAsbItem" :ref="item.id"> |
|||
|
|||
<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="标准价格" 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" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="应收价格" prop="ocCheckTypeDetailPrice" min-width="60" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-input @input="changePrices(scope.$index)" type="number" size="small" |
|||
v-model="scope.row.ocCheckTypeDetailPrice" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="数量" prop="ocCheckTypeDetailAmount" width="50" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-input @input="changePrices(scope.$index)" type="number" size="small" |
|||
v-model="scope.row.ocCheckTypeDetailAmount" /> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="标准金额" prop="asbitemMoney" min-width="60" align="center"> |
|||
</el-table-column> |
|||
<el-table-column label="应收金额" prop="ocCheckTypeDetailMoney" min-width="60" align="center"> |
|||
</el-table-column> |
|||
</el-table> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
</div> |
|||
</div> |
|||
<!--批量操作按钮(复制套餐与分组)--> |
|||
<div style="display: block;margin-left: 15px;"> |
|||
<div v-show="checkPagePriv(pagePriv.privs, '复制套餐')" style="margin-top: 80px;"> |
|||
<el-button class="commonbutton" @click="btnCopyMedicalPackage">复制套餐</el-button> |
|||
</div> |
|||
<div v-show="checkPagePriv(pagePriv.privs, '保存')" style="margin-top: 10px;"> |
|||
<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> |
|||
|
|||
|
|||
</div> |
|||
</template> |
|||
<script> |
|||
import moment from 'moment'; |
|||
import { mapState } from "vuex"; |
|||
import { getapi, postapi, putapi } from "@/api/api"; |
|||
import { getPagePriv, checkPagePriv, arrayExistObj, tcdate, arrayFilter, arrayReduce, deepCopy, dddw } from "../../utlis/proFunc"; |
|||
|
|||
|
|||
export default { |
|||
props: ['poisonId'], |
|||
data() { |
|||
return { |
|||
pagePriv: { |
|||
routeUrlorPageName: 'customerOrgGroup', //当前页面归属路由或归属页面权限名称 |
|||
privs: [] // 页面权限 |
|||
}, |
|||
groupPrice: 0, //分组总价 |
|||
occAsbitems: { |
|||
|
|||
}, //分组包含组合项目(显示) |
|||
occAsbitemsChoosed: [], //分组包含组合项目(显示) 被选中 |
|||
itemTypeIds: [], //项目类别 |
|||
asbItemId: '', //当前快速选到的给合项目ID |
|||
quickAsb: [], //过滤显示的组合项目 |
|||
|
|||
asbItemChoosed: [], //勾选的 未选组合项目 |
|||
startPoint: -1, |
|||
PstartPoint: -1, |
|||
|
|||
medicalPackageVisble: false, //复制套餐 |
|||
curPackageId: '', //当前选中套餐ID |
|||
packageAsbitems: [], //套餐中包含的组合项目 |
|||
|
|||
groupVisble: false, //复制分组 |
|||
customerOrgGroups: [], //历次分组 |
|||
curGroupId: '', //当前选中套餐ID |
|||
groupAsbitems: [], //选中分组包含组合项目 |
|||
|
|||
|
|||
dialogVisible: false, |
|||
copyGroupdialogVisible: false, |
|||
packagelist: [], |
|||
tabledata: [], |
|||
temporaryselection: [], //已选组合项目table |
|||
copegroupdata: [], //复制分组 |
|||
addrulst: [], //添加保存的Id |
|||
price: "", //价格 |
|||
title: 1, |
|||
|
|||
tabChoosed: "", // 当前选择的职业病检查类别 |
|||
occCheckType: [], // 职业病检查类别 |
|||
saveCount: 0, |
|||
}; |
|||
}, |
|||
computed: { |
|||
...mapState(["window", "dict", "dataTransOpts", "customerOrg"]), |
|||
|
|||
tableHeight() { |
|||
let height = 600 |
|||
if (this.window.pageHeight > 600) { |
|||
height = this.window.pageHeight |
|||
} |
|||
// console.log(height - this.window.pageHeaderHeight - this.window.pageMarginHeight - 240 - 96 - 10) |
|||
return height - this.window.pageHeaderHeight - this.window.pageMarginHeight - 240 - 96 - 16 |
|||
} |
|||
}, |
|||
|
|||
|
|||
|
|||
created() { |
|||
//获取用户当前页面的权限 |
|||
let userPriv = window.sessionStorage.getItem('userPriv') |
|||
if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName)) |
|||
|
|||
|
|||
}, |
|||
mounted() { |
|||
this.dictInit().then(() => { |
|||
this.getOccAsbitemsAll() |
|||
}) |
|||
}, |
|||
|
|||
updated() { |
|||
// this.refreshTable(this.tabChoosed) |
|||
}, |
|||
|
|||
methods: { |
|||
moment, dddw, deepCopy, checkPagePriv, |
|||
//表格强制刷新 |
|||
refreshTable(tableRef) { |
|||
this.$nextTick(() => { |
|||
this.$refs[tableRef].doLayout() |
|||
}) |
|||
}, |
|||
|
|||
//初始数据 |
|||
dictInit() { |
|||
return new Promise((resolve, reject) => { |
|||
//体检类别 树结构 |
|||
getapi("/api/app/item-type/by-code-all") |
|||
.then((res) => { |
|||
if (res.code != -1) { |
|||
this.dict.itemTypeTree = res.data; |
|||
tcdate(this.dict.itemTypeTree); |
|||
//获取所有组合项目 api/app/asbitem/GetBasicList |
|||
return postapi("/api/app/asbitem/GetBasicList", { isFilterActive: 'Y' }) |
|||
} else { |
|||
reject(res.message) |
|||
} |
|||
}) |
|||
.then(res => { |
|||
if (res && res.code > -1) { |
|||
this.dict.asbItemAll = res.data; |
|||
this.dict.asbItemAll.forEach(e => { |
|||
e.choosed = false |
|||
}) |
|||
this.dict.asbItem = deepCopy(this.dict.asbItemAll); |
|||
this.dict.asbItemQuick = deepCopy(res.data); |
|||
this.quickAsb = deepCopy(res.data); |
|||
//套餐 |
|||
return postapi("/api/app/medicalpackage/getmedicalpackagelist", {}) |
|||
} else { |
|||
reject(res.message) |
|||
} |
|||
}) |
|||
.then(res => { |
|||
if (res && res.code > -1) { |
|||
this.dict.medicalPackage = res.data; |
|||
// 职业病检查类别 |
|||
return postapi("/api/app/OcCheckType/GetList") |
|||
} else { |
|||
reject(res.message) |
|||
} |
|||
}) |
|||
.then(res => { |
|||
if (res && res.code > -1) { |
|||
this.occCheckType = res.data |
|||
if (this.occCheckType.length > 0) this.tabChoosed = this.occCheckType[0].id |
|||
this.occCheckType.forEach(e => { |
|||
this.occAsbitems[e.id] = [] |
|||
}); |
|||
resolve(res) |
|||
} else { |
|||
reject(res.message) |
|||
} |
|||
}) |
|||
.catch(err => { |
|||
reject(err) |
|||
}) |
|||
}) |
|||
|
|||
}, |
|||
|
|||
handleRowClassName({ row, rowIndex }) { |
|||
// highLightBg 为 'selected'的高亮 |
|||
//console.log(rowIndex, row) |
|||
//return row.highLightBg == 'selected' ? 'high-light-bg' : ''; |
|||
if (row.choosed) { |
|||
return 'current-row'; |
|||
} else { |
|||
return ''; |
|||
} |
|||
|
|||
}, |
|||
|
|||
//项目类别过滤 组合项目,未过滤已选择的组合项目 |
|||
getAsbItemByItemTypeAll() { |
|||
//console.log('getAsbItemByItemType', typeof this.itemTypeIds, this.itemTypeIds) |
|||
let lv = ""; |
|||
if (typeof this.itemTypeIds === "object") { |
|||
lv = this.itemTypeIds[this.itemTypeIds.length - 1]; |
|||
} |
|||
|
|||
if (lv) { |
|||
this.dict.asbItem = arrayFilter(this.dict.asbItemAll, "itemTypeId", lv); |
|||
} else { |
|||
this.dict.asbItem = deepCopy(this.dict.asbItemAll); |
|||
} |
|||
//console.log('lv,this.dict.asbItem', lv, this.dict.asbItem) |
|||
this.dict.asbItemQuick = deepCopy(this.dict.asbItemAll); |
|||
|
|||
}, |
|||
|
|||
//按项目类别显示组合项目,并过滤已选择的组合项目 |
|||
getAsbItemByItemType() { |
|||
this.getAsbItemByItemTypeAll() |
|||
//刷新显示 未选组合项目 |
|||
arrayReduce(this.dict.asbItem, [...this.occAsbitems[this.tabChoosed] || []], "id=id"); |
|||
arrayReduce(this.dict.asbItemQuick, [...this.occAsbitems[this.tabChoosed] || []], "id=id"); |
|||
this.quickAsb = Object.assign(this.dict.asbItemQuick) |
|||
}, |
|||
|
|||
//快速选择组合项目时,调整可按拼间简码及简称查找 |
|||
filterMethod(keyWords) { |
|||
//console.log('filterMethod',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 = deepCopy(this.dict.asbItemQuick); |
|||
} |
|||
}, |
|||
|
|||
// 添加组合项目 |
|||
///api/app/register-asbitem/many/3fa85f64-5717-4562-b3fc-2c963f66afa6' |
|||
async addAbs(asbItemChoosed, oprType) { |
|||
|
|||
// console.log('asbItemChoosed', asbItemChoosed) |
|||
if (!this.poisonId) { |
|||
this.$message.warning({ showClose: true, message: "请先选接害因素" }) |
|||
return |
|||
} |
|||
|
|||
let message = [] |
|||
let checked = true |
|||
let lfind = -1 |
|||
|
|||
//oprType 不传值时,兼容勾选方式 |
|||
//勾选时不需要此操作 start |
|||
if (oprType && oprType == 'all') { |
|||
asbItemChoosed = deepCopy(this.dict.asbItem) |
|||
} else if (oprType && oprType == 'choosed') { |
|||
asbItemChoosed = [] |
|||
this.dict.asbItem.forEach(e => { |
|||
if (e.choosed) { |
|||
asbItemChoosed.push(e) |
|||
e.choosed = false |
|||
} |
|||
}) |
|||
} |
|||
//勾选时不需要此操作 end |
|||
|
|||
if (asbItemChoosed.length < 1) { |
|||
this.$message.warning({ showClose: true, message: "请选择要添加的组合项目" }) |
|||
return |
|||
} |
|||
|
|||
//性别、年龄判断 |
|||
// "displayName": "身高体重", |
|||
// "shortName": "哈f哈", |
|||
// "forSexId": "F", |
|||
// "itemTypeId": "3a0b16de-75b9-c910-c61b-844709a88940", |
|||
// "price": 0, |
|||
|
|||
// 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.occAsbitems[this.tabChoosed], "id=id") |
|||
|
|||
for (let i = 0; i < asbItemChoosed.length; i++) { |
|||
let pojo = { |
|||
id: asbItemChoosed[i].id, |
|||
displayName: asbItemChoosed[i].displayName, |
|||
discount: 100, |
|||
ocCheckTypeDetailAmount: 1, |
|||
price: asbItemChoosed[i].price, |
|||
ocCheckTypeDetailPrice: asbItemChoosed[i].price, |
|||
ocCheckTypeDetailMoney: asbItemChoosed[i].price, |
|||
asbitemMoney: asbItemChoosed[i].price, |
|||
} |
|||
|
|||
|
|||
|
|||
this.occAsbitems[this.tabChoosed].push(pojo) |
|||
//this.occAsbitems.push({ ...pojo, asbitemName: asbItemChoosed[i].displayName }) |
|||
|
|||
lfind = arrayExistObj(this.dict.asbItem, 'id', asbItemChoosed[i].id) |
|||
if (lfind > -1) this.dict.asbItem.splice(lfind, 1) |
|||
|
|||
lfind = arrayExistObj(this.dict.asbItemQuick, 'id', asbItemChoosed[i].id) |
|||
if (lfind > -1) this.dict.asbItemQuick.splice(lfind, 1) |
|||
|
|||
} |
|||
|
|||
|
|||
}, |
|||
|
|||
//双击选择组合项目 |
|||
dbClickChoosedAsb(row) { |
|||
this.addAbs([row]); |
|||
}, |
|||
//快速选择组合项目 |
|||
quickChoosedAsb(v) { |
|||
//远程查询时,设置了 value-key 也不管用,只能取到value console.log('quickChoosedAsb',v) |
|||
let lfind = -1 |
|||
if (v) { |
|||
lfind = arrayExistObj(this.dict.asbItemQuick, 'id', v) |
|||
if (lfind > -1) { |
|||
this.addAbs([this.dict.asbItemQuick[lfind]]) |
|||
} |
|||
} |
|||
|
|||
this.$nextTick(() => { |
|||
this.$refs['quickAsbOCX'].blur(); //total asbItemId |
|||
this.asbItemId = '' |
|||
this.quickAsb = deepCopy(this.dict.asbItemQuick) |
|||
this.$refs['quickAsbOCX'].focus(); //total asbItemId |
|||
}); |
|||
|
|||
}, |
|||
|
|||
//选择 未选的组合项目 |
|||
chooseAsbItem(row) { |
|||
this.dict.asbItem.forEach((e, index) => { |
|||
e.index = index; |
|||
return e |
|||
}); |
|||
// 按住了shift键 |
|||
if (this.window.shift) { |
|||
//清除所有选择 |
|||
this.dict.asbItem.forEach(e => { |
|||
e.choosed = false; |
|||
return e |
|||
}); |
|||
|
|||
if (this.startPoint == - 1) { |
|||
this.dict.asbItem[row.index].choosed = true; |
|||
this.startPoint = row.index; |
|||
return |
|||
} |
|||
|
|||
if (this.startPoint > row.index) { |
|||
for (let i = row.index; i <= this.startPoint; i++) { |
|||
this.dict.asbItem[i].choosed = true |
|||
} |
|||
} else if (this.startPoint <= row.index) { |
|||
for (let i = this.startPoint; i <= row.index; i++) { |
|||
this.dict.asbItem[i].choosed = true |
|||
} |
|||
} |
|||
return |
|||
} |
|||
|
|||
// 按住了ctrl 键 |
|||
if (this.window.ctrl) { |
|||
console.log('this.window.ctrl', this.window.ctrl, this.dict.asbItem) |
|||
this.dict.asbItem[row.index].choosed = true; |
|||
this.startPoint = row.index; |
|||
return |
|||
} |
|||
|
|||
// 未按住了ctrl 、shift 键 |
|||
//清除所有选择 |
|||
//console.log('清除所有选择') |
|||
this.dict.asbItem.forEach(e => { |
|||
e.choosed = false; |
|||
return e |
|||
}); |
|||
this.dict.asbItem[row.index].choosed = true; |
|||
this.startPoint = row.index; |
|||
|
|||
}, |
|||
|
|||
//删除 人员已选中的组合项目 |
|||
///api/app/register-asbitem/many?RegisterAsbitemIds=3fa85f64-5717-4562-b3fc-2c963f66afa6 |
|||
delAbs(absForDel, oprType) { |
|||
if (!this.poisonId) { |
|||
this.$message.warning({ showClose: true, message: "请先选中接害因素" }) |
|||
return |
|||
} |
|||
|
|||
let lfind = -1 |
|||
|
|||
//勾选时不需要此操作 start |
|||
if (oprType && oprType == 'all') { |
|||
absForDel = deepCopy(this.occAsbitems[this.tabChoosed]) |
|||
} else if (oprType && oprType == 'choosed') { |
|||
absForDel = [] |
|||
this.occAsbitems[this.tabChoosed].forEach(e => { |
|||
if (e.choosed) { |
|||
absForDel.push(deepCopy(e)) |
|||
e.choosed = false |
|||
} |
|||
}) |
|||
} |
|||
//勾选时不需要此操作 end |
|||
|
|||
if (absForDel.length < 1) { |
|||
this.$message.warning({ showClose: true, message: "请选择要移除的组合项目" }) |
|||
return |
|||
} |
|||
|
|||
for (let i = 0; i < absForDel.length; i++) { |
|||
// lfind = arrayExistObj(this.occAsbitems, 'asbitemId', absForDel[i].asbitemId) |
|||
lfind = arrayExistObj(this.occAsbitems[this.tabChoosed], 'id', absForDel[i].id) |
|||
if (lfind > -1) this.occAsbitems[this.tabChoosed].splice(lfind, 1) |
|||
|
|||
absForDel.splice(i, 1) |
|||
i-- |
|||
continue |
|||
|
|||
} |
|||
|
|||
//刷新 |
|||
this.getAsbItemByItemType() |
|||
|
|||
}, |
|||
|
|||
//双击删除已选项目 |
|||
removeAbs(row) { |
|||
this.delAbs([row], "choosed"); |
|||
}, |
|||
|
|||
//选择 已选的组合项目 |
|||
removeAsbItem(row) { |
|||
this.occAsbitems[this.tabChoosed].forEach((e, index) => { |
|||
e.index = index; |
|||
return e |
|||
}); |
|||
// 按住了shift键 |
|||
if (this.window.shift) { |
|||
//清除所有选择 |
|||
this.occAsbitems[this.tabChoosed].forEach(e => { |
|||
e.choosed = false; |
|||
return e |
|||
}); |
|||
|
|||
if (this.PstartPoint == - 1) { |
|||
this.occAsbitems[this.tabChoosed][row.index].choosed = true; |
|||
this.PstartPoint = row.index; |
|||
return |
|||
} |
|||
|
|||
if (this.PstartPoint > row.index) { |
|||
for (let i = row.index; i <= this.PstartPoint; i++) { |
|||
this.occAsbitems[this.tabChoosed][i].choosed = true |
|||
} |
|||
} else if (this.PstartPoint <= row.index) { |
|||
for (let i = this.PstartPoint; i <= row.index; i++) { |
|||
this.occAsbitems[this.tabChoosed][i].choosed = true |
|||
} |
|||
} |
|||
return |
|||
} |
|||
|
|||
// 按住了ctrl 键 |
|||
if (this.window.ctrl) { |
|||
console.log('this.window.ctrl', this.window.ctrl, this.occAsbitems) |
|||
this.occAsbitems[this.tabChoosed][row.index].choosed = true; |
|||
this.PstartPoint = row.index; |
|||
return |
|||
} |
|||
|
|||
// 未按住了ctrl 、shift 键 |
|||
//清除所有选择 |
|||
//console.log('清除所有选择') |
|||
this.occAsbitems[this.tabChoosed].forEach(e => { |
|||
e.choosed = false; |
|||
return e |
|||
}); |
|||
this.occAsbitems[this.tabChoosed][row.index].choosed = true; |
|||
this.PstartPoint = row.index; |
|||
|
|||
}, |
|||
|
|||
|
|||
changeDiscount(index) { |
|||
|
|||
this.occAsbitems[this.tabChoosed][index].ocCheckTypeDetailPrice = |
|||
(this.occAsbitems[this.tabChoosed][index].discount * this.occAsbitems[this.tabChoosed][index].price / 100).toFixed(2) |
|||
|
|||
|
|||
this.occAsbitems[this.tabChoosed][index].ocCheckTypeDetailMoney = |
|||
(this.occAsbitems[this.tabChoosed][index].ocCheckTypeDetailPrice * this.occAsbitems[this.tabChoosed][index].ocCheckTypeDetailAmount).toFixed(2) |
|||
|
|||
//this.getSummaries() |
|||
|
|||
}, |
|||
|
|||
//修改价格或数量 |
|||
changePrices(index) { |
|||
this.occAsbitems[this.tabChoosed][index].ocCheckTypeDetailMoney = |
|||
(this.occAsbitems[this.tabChoosed][index].ocCheckTypeDetailPrice * this.occAsbitems[this.tabChoosed][index].ocCheckTypeDetailAmount).toFixed(2) |
|||
|
|||
this.occAsbitems[this.tabChoosed][index].asbitemMoney = |
|||
(this.occAsbitems[this.tabChoosed][index].price * this.occAsbitems[this.tabChoosed][index].ocCheckTypeDetailAmount).toFixed(2) |
|||
|
|||
this.occAsbitems[this.tabChoosed][index].discount = (this.occAsbitems[this.tabChoosed][index].ocCheckTypeDetailPrice * 100 / this.occAsbitems[this.tabChoosed][index].price).toFixed(2) |
|||
//this.getSummaries() |
|||
}, |
|||
|
|||
|
|||
//合计 |
|||
getSummaries(param) { |
|||
console.log('getSummaries param', param) |
|||
// if(!param){ |
|||
// param = { |
|||
// columns:[{}, {}, {}, {}, {}, {}, {property: 'asbitemMoney'},{property: 'ocCheckTypeDetailMoney'}], |
|||
// data:this.occAsbitems |
|||
// } |
|||
// } |
|||
|
|||
const { columns, data } = param; |
|||
const sumCol = [6, 7] //需合计的列 |
|||
const sums = []; |
|||
columns.forEach((column, index) => { |
|||
//console.log('column, index,data',column, index,data) |
|||
//显示合计列 |
|||
if (index === 1) { |
|||
sums[index] = '合计'; |
|||
return; |
|||
} |
|||
|
|||
//不合计的列 |
|||
if (sumCol.indexOf(index) == -1) { |
|||
sums[index] = ''; |
|||
return; |
|||
} |
|||
|
|||
sums[index] = 0 |
|||
data.forEach(e => { |
|||
if (!isNaN(e[column.property])) sums[index] += Number(e[column.property])// * e['amount'] |
|||
}) |
|||
sums[index] = sums[index].toFixed(2) //+ ' 元'; |
|||
|
|||
}); |
|||
this.groupPrice = sums[7]; |
|||
// console.log('getSummaries',sums) |
|||
// if (!this.totalFoucs) this.total = sums[5]; |
|||
// if (!this.discountFoucs) this.discount = Number(this.total * 100 / this.totalStand).toFixed(2); |
|||
return sums; |
|||
}, |
|||
|
|||
|
|||
|
|||
|
|||
//复制套餐 |
|||
btnCopyMedicalPackage() { |
|||
|
|||
if (!this.poisonId) { |
|||
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 |
|||
}, |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
//保存按钮 |
|||
async btnSave() { |
|||
if (!this.poisonId) { |
|||
this.$message.warning({ showClose: true, message: "请先选中接害因素" }) |
|||
return |
|||
} |
|||
|
|||
let body = { |
|||
ocCheckTypeId: "", |
|||
poisonId: this.poisonId, |
|||
details: [] |
|||
} |
|||
// { |
|||
// "ocCheckTypeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", |
|||
// "poisonId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", |
|||
// "details": [ |
|||
// { |
|||
// "asbitemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", |
|||
// "price": 0, |
|||
// "amount": 0 |
|||
// } |
|||
// ] |
|||
// } |
|||
this.saveCount = 0 |
|||
for (let i = 0; i < this.occCheckType.length; i++) { |
|||
let e = this.occCheckType[i]; |
|||
body.ocCheckTypeId = e.id |
|||
this.occAsbitems[e.id].forEach(e2 => { |
|||
e2.asbitemId = e2.id |
|||
e2.price = e2.ocCheckTypeDetailPrice |
|||
e2.amount = e2.ocCheckTypeDetailAmount |
|||
}); |
|||
body.details = this.occAsbitems[e.id] |
|||
|
|||
try { |
|||
let res = await postapi("/api/app/OcCheckTypeDetail/CreateOcCheckTypeDetailMany", body) |
|||
if (res.code > -1) { |
|||
this.saveCount++ |
|||
} |
|||
} catch (error) { |
|||
console.log(error) |
|||
} |
|||
} |
|||
|
|||
// console.log('this.occCheckType.length,this.saveCount',this.occCheckType.length,this.saveCount) |
|||
if (this.occCheckType.length == this.saveCount) { |
|||
this.$message.success({ showClose: true, message: "操作成功!" }) |
|||
this.getOccAsbitemsAll() |
|||
} |
|||
|
|||
}, |
|||
|
|||
|
|||
//右侧勾选按钮 |
|||
selectRight(val) { |
|||
this.occAsbitemsChoosed = val; |
|||
}, |
|||
|
|||
|
|||
// 左侧未选 |
|||
selectLeft(val) { |
|||
this.asbItemChoosed = val; |
|||
}, |
|||
|
|||
getOccAsbitemsAll() { |
|||
this.occCheckType.forEach(e => { |
|||
this.getOccAsbitems(e.id, this.poisonId) |
|||
}); |
|||
|
|||
}, |
|||
|
|||
getOccAsbitems(occCheckTypeId, poisonId) { |
|||
this.occAsbitems[occCheckTypeId] = [] |
|||
if (!poisonId) { |
|||
return |
|||
} |
|||
let body = { |
|||
ocCheckTypeId: occCheckTypeId, |
|||
poisonIds: [poisonId] |
|||
} |
|||
postapi('/api/app/OcCheckTypeDetail/GetOcCheckTypeDetailByOcCheckTypeIdAndPoisonId', body).then(res => { |
|||
if (res.code > -1) { |
|||
this.occAsbitems[occCheckTypeId] = res.data |
|||
if (this.tabChoosed == occCheckTypeId) this.getAsbItemByItemType() |
|||
} |
|||
}) |
|||
|
|||
} |
|||
}, |
|||
|
|||
//监听事件 |
|||
watch: { |
|||
|
|||
"poisonId": { |
|||
// immediate:true, |
|||
handler(newVal, oldVal) { |
|||
console.log(`watch poisonId newVal:${newVal} oldVal:${oldVal}`); |
|||
if (newVal != oldVal) this.getOccAsbitemsAll() |
|||
} |
|||
}, |
|||
|
|||
"tabChoosed": { |
|||
// immediate:true, |
|||
handler(newVal, oldVal) { |
|||
console.log(`watch occCheckTypeId newVal:${newVal} oldVal:${oldVal}`); |
|||
if (newVal != oldVal) this.getAsbItemByItemType() |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
<style scoped> |
|||
.box { |
|||
margin-top: 5px; |
|||
/* border: 1px solid #000; */ |
|||
} |
|||
|
|||
.btnClass { |
|||
width: 100px; |
|||
margin-bottom: 5px |
|||
} |
|||
</style> |
|||
@ -0,0 +1,266 @@ |
|||
<template> |
|||
<div> |
|||
<div class="middlebox"> |
|||
<div class="contenttitle"> |
|||
体检查询 / |
|||
<span class="contenttitleBold">营业额统计</span> |
|||
</div> |
|||
</div> |
|||
<div |
|||
style="display: flex;justify-content: space-between; padding: 10px;background-color: #fff;border-radius: 8px;margin-bottom: 10px;"> |
|||
<div style="display:block;"> |
|||
<div style="display: flex;flex-wrap: wrap;height: 32px;align-items: center;"> |
|||
<div class="query"> |
|||
<el-select v-model="query.dateType" placeholder="请选择" style="width: 80px" size="small"> |
|||
<el-option label="登记日期" :value="'1'" /> |
|||
<el-option label="体检日期" :value="'2'" /> |
|||
<el-option label="总检日期" :value="'3'" /> |
|||
</el-select> |
|||
<!-- dateType 1 登记,2 体检,3 总检日期--> |
|||
<el-date-picker v-model="query.startDate" type="date" placeholder="起始日期" size="small" style="width:90px;" |
|||
value-format="yyyy-MM-dd" :picker-options="pickerOptions" /> |
|||
<span class="spanClass">至</span> |
|||
<el-date-picker v-model="query.endDate" type="date" placeholder="截止日期" size="small" style="width:90px;" |
|||
value-format="yyyy-MM-dd" :picker-options="pickerOptions" /> |
|||
</div> |
|||
<div class="query"> |
|||
<span class="spanClass">体检单位</span> |
|||
<el-select v-model="query.customerOrgIds" placeholder="请选择体检单位" :filter-method="filterMethod" |
|||
default-first-option clearable filterable style="margin-left: 10px" size="small" multiple collapse-tags> |
|||
<el-option v-for="item in customerOrg" :key="item.id" :label="item.displayName" :value="item.id"> |
|||
{{ item.displayName }} |
|||
</el-option> |
|||
</el-select> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div> |
|||
<el-button type="primary" class="commonbutton" @click="btnQuery" size="small">查询</el-button> |
|||
</div> |
|||
</div> |
|||
<div> |
|||
<el-table :data="tableData" border :height="window.pageHeight - 160" highlight-current-row |
|||
size="small" row-key="id" :summary-method="getSummaries" show-summary ref="refTable"> |
|||
<el-table-column type="index" label="序号" width="50" align="center" /> |
|||
<el-table-column prop="customerOrgName" label="单位名称" min-width="150" /> |
|||
<el-table-column prop="registerCount" label="登记人数" min-width="80" align="center" /> |
|||
<el-table-column prop="checkCount" label="检查人数" min-width="80" align="center" /> |
|||
<el-table-column prop="avgStandardPrice" label="标准平均单价" min-width="100" align="center" /> |
|||
<el-table-column prop="avgChargePrice" label="应收平均单价" min-width="100" align="center" /> |
|||
<el-table-column prop="sumStandardPrice" label="标准金额" min-width="100" align="center" /> |
|||
<el-table-column prop="sumChargePrice" label="应收金额" min-width="100" align="center" /> |
|||
</el-table> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
<script> |
|||
import { mapState } from "vuex"; |
|||
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
|||
import { deepCopy } from "../../utlis/proFunc" |
|||
import CusOrgOCX from "./CusOrgOCX.vue" |
|||
import moment from "moment"; |
|||
|
|||
export default { |
|||
components: { |
|||
CusOrgOCX, |
|||
}, |
|||
props: ["orgEnable"], |
|||
data() { |
|||
return { |
|||
dialogVisible: false, |
|||
local: { |
|||
completeFlag: [] |
|||
}, |
|||
|
|||
customerOrg: [], |
|||
customerOrgAll: [], |
|||
query: { |
|||
dateType: '1', |
|||
startDate: '', |
|||
endDate: '', |
|||
customerOrgIds: [], |
|||
medicalTypeIds: [], |
|||
isMedicalTypeId: 'Y', |
|||
}, |
|||
tableData: [], |
|||
|
|||
pickerOptions: { |
|||
disabledDate(time) { |
|||
return time.getTime() > Date.now(); |
|||
}, |
|||
shortcuts: [{ |
|||
text: '今天', |
|||
onClick(picker) { |
|||
picker.$emit('pick', new Date()); |
|||
} |
|||
}, { |
|||
text: '昨天', |
|||
onClick(picker) { |
|||
const date = new Date(); |
|||
date.setTime(date.getTime() - 3600 * 1000 * 24); |
|||
picker.$emit('pick', date); |
|||
} |
|||
}, { |
|||
text: '一周前', |
|||
onClick(picker) { |
|||
const date = new Date(); |
|||
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7); |
|||
picker.$emit('pick', date); |
|||
} |
|||
}] |
|||
}, |
|||
|
|||
}; |
|||
}, |
|||
|
|||
created() { |
|||
|
|||
}, |
|||
|
|||
//挂载完成 |
|||
mounted() { |
|||
|
|||
this.dictInit() |
|||
|
|||
}, |
|||
|
|||
updated() { |
|||
this.$nextTick(() => { |
|||
this.$refs['refTable'].doLayout() |
|||
}) |
|||
}, |
|||
|
|||
computed: { |
|||
...mapState(["window", "dict", "patientRegister", "report"]), |
|||
}, |
|||
methods: { |
|||
//获取初始数据 |
|||
dictInit() { |
|||
let today = moment(new Date()).format("YYYY-MM-DD") |
|||
this.query.startDate = today |
|||
this.query.endDate = today |
|||
|
|||
//获取单位列表 |
|||
getapi("/api/app/customer-org/parent-all").then((res) => { |
|||
if (res.code != -1) { |
|||
this.customerOrgAll = res.data; |
|||
this.customerOrg = deepCopy(this.customerOrgAll); |
|||
} |
|||
}); |
|||
|
|||
//体检类别 |
|||
getapi("/api/app/medical-type/in-filter").then((res) => { |
|||
if (res.code > -1) { |
|||
this.dict.medicalType = res.data; |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
// 单位过滤 |
|||
filterMethod(keyWords) { |
|||
if (keyWords) { |
|||
this.customerOrg = []; |
|||
this.customerOrgAll.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.customerOrg.push(item); |
|||
} |
|||
}); |
|||
} else { |
|||
this.customerOrg = deepCopy(this.customerOrgAll); |
|||
} |
|||
}, |
|||
|
|||
// 查询 |
|||
btnQuery() { |
|||
|
|||
postapi("/api/app/CustomerReport/GetCustomerOrgPhysicalExaminationStatistics", this.query).then(res => { |
|||
if (res.code > -1) { |
|||
this.tableData = res.data |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
//合计 |
|||
getSummaries(param) { |
|||
console.log('getSummaries param',param) |
|||
// if(!param){ |
|||
// param = { |
|||
// columns:[{}, {}, {}, {}, {}, {}, {property: 'asbitemMoney'},{property: 'customerOrgGroupDetailMoney'}], |
|||
// data:this.customerOrgGroupAsbitems |
|||
// } |
|||
// } |
|||
|
|||
const { columns, data } = param; |
|||
const sumCol = [6, 7] //需合计的列 |
|||
const sums = []; |
|||
columns.forEach((column, index) => { |
|||
//console.log('column, index,data',column, index,data) |
|||
//显示合计列 |
|||
if (index === 1) { |
|||
sums[index] = '合计'; |
|||
return; |
|||
} |
|||
|
|||
//不合计的列 |
|||
if (sumCol.indexOf(index) == -1) { |
|||
sums[index] = ''; |
|||
return; |
|||
} |
|||
|
|||
sums[index] = 0 |
|||
data.forEach(e => { |
|||
if (!isNaN(e[column.property])) sums[index] += Number(e[column.property])// * e['amount'] |
|||
}) |
|||
sums[index] = sums[index].toFixed(2) //+ ' 元'; |
|||
|
|||
}); |
|||
// this.groupPrice = sums[7]; |
|||
// console.log('getSummaries',sums) |
|||
// if (!this.totalFoucs) this.total = sums[5]; |
|||
// if (!this.discountFoucs) this.discount = Number(this.total * 100 / this.totalStand).toFixed(2); |
|||
return sums; |
|||
}, |
|||
|
|||
}, |
|||
}; |
|||
</script> |
|||
<style scoped> |
|||
@import '../../assets/css/global.css'; |
|||
@import '../../assets/css/global_font.css'; |
|||
|
|||
::v-deep .el-input__inner { |
|||
/*text-align: center;*/ |
|||
padding-left: 5px; |
|||
padding-right: 15px; |
|||
} |
|||
|
|||
::v-deep .el-input__icon { |
|||
width: 15px; |
|||
/* 输入框下拉箭头或清除图标 默认 25 */ |
|||
} |
|||
|
|||
::v-deep .el-input-group__append { |
|||
padding: 0 5px; |
|||
/* 控件默认 0 20px;*/ |
|||
} |
|||
|
|||
::v-deep .el-icon-search:before { |
|||
color: #00F; |
|||
} |
|||
|
|||
.query { |
|||
margin-left: 10px; |
|||
font-size: 14px; |
|||
color: #232748; |
|||
font-weight: 400; |
|||
font-family: "NotoSansSC-Regular"; |
|||
} |
|||
|
|||
.spanClass { |
|||
padding: 0 2px 0 0; |
|||
} |
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue