Browse Source

group

master
pengjun 2 years ago
parent
commit
b6663e7938
  1. 291
      src/components/customerOrg/customerOrgGroupAsbitem.vue
  2. 2
      src/components/doctorCheck/ButtonList.vue
  3. 5
      src/components/doctorCheck/CheckSumSug.vue
  4. 4
      src/components/report/AsbitemOCX.vue
  5. 142
      src/views/customerOrg/customerOrgGroup.vue

291
src/components/customerOrg/customerOrgGroupAsbitem.vue

@ -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>
<!--复制套餐-->
<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,14 +419,17 @@ 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
//oprType
// start
if(oprType && oprType == 'all'){
asbItemChoosed = deepCopy(this.dict.asbItem)
@ -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,6 +744,94 @@ 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
},

2
src/components/doctorCheck/ButtonList.vue

@ -350,11 +350,13 @@ export default {
return
}
this.doctorCheck.checkSummaryList.push({
id:Math.random(),
registerCheckId: this.doctorCheck.RegisterCheckEdit.id,
summary: '',
summaryFlag: 'N',
})
this.doctorCheck.checkSuggestionList.push({
id:Math.random(),
registerCheckId: this.doctorCheck.RegisterCheckEdit.id,
suggestion: '',
})

5
src/components/doctorCheck/CheckSumSug.vue

@ -1,7 +1,7 @@
<template>
<div style="display: flex;">
<div :style="'width:'+Math.floor((window.pageWidth - 210 - 120 - 80)/2) + 'px;'">
<el-table id="tableSummary" row-key="id" :data="doctorCheck.checkSummaryList" :row-style="{ height: '30px' }"
<el-table id="tableSummary" row-key="id" :data="doctorCheck.checkSummaryList"
:height="window.pageHeight < 600 ? Math.floor((380 - 80)*2/5):Math.floor((window.pageHeight-220-80)*2/5)"
width="100%" border @row-click="rowClick">
<el-table-column prop="summary" label="小结" :width="Math.floor((window.pageWidth - 210 - 124 - 80)/2)" >
@ -92,7 +92,7 @@ export default {
rowDrop() {
this.$nextTick(() => {
const el = document.querySelector("#tableSummary tbody");
//console.log('tbody',tbody)
console.log('el0',el)
const that = this;
Sortable.create(el, {
animation: 150, // ms, number ms
@ -101,6 +101,7 @@ export default {
that.isshow = false;
const currRow = that.doctorCheck.checkSummaryList.splice(oldIndex, 1)[0];
that.doctorCheck.checkSummaryList.splice(newIndex, 0, currRow);
console.log('el',el)
},
});
});

4
src/components/report/AsbitemOCX.vue

@ -172,7 +172,7 @@ export default {
//
getapi("/api/app/asbitem/in-filter?Filter").then((res) => {
if (res.code == 1) {
if (res.code != -1) {
this.dict.asbItemAll = res.data.items;
this.parseAsbitem();
}
@ -180,7 +180,7 @@ export default {
//
getapi("/api/app/medical-package/in-filter").then((res) => {
if (res.code == 1) {
if (res.code != -1) {
this.dict.medicalPackage = res.data.items;
}
});

142
src/views/customerOrg/customerOrgGroup.vue

@ -11,8 +11,8 @@
<el-select
v-model="customerOrgId"
placeholder="请选择体检单位"
filterable
clearable
filterable :filter-method="filterMethod" default-first-option
clearable @clear="customerOrg = deepCopy(customerOrgAll)"
style="margin-left: 10px"
@change="changeCustomerOrg"
size="small"
@ -35,7 +35,6 @@
style="width: 60px; margin-left: 10px"
size="small"
@change="changeTimes"
value-key="id"
>
<el-option
@ -139,13 +138,13 @@
<el-button class="btnClass" @click="btnDel" >删除</el-button>
</div>
<div>
<el-button class="btnClass" @click="topping" >置顶</el-button>
<el-button class="btnClass" @click="btnSetTop" >置顶</el-button>
</div>
<div>
<el-button class="btnClass" @click="bottoming" >置低</el-button>
<el-button class="btnClass" @click="btnSetBottom" >置低</el-button>
</div>
<div>
<el-button class="btnClass" @click="sortok" :disabled="isshow" >保存排序</el-button>
<el-button class="btnClass" @click="btnSort" :disabled="!isDrag" >保存排序</el-button>
</div>
</div>
</div>
@ -261,9 +260,10 @@ export default {
customerOrgRegisterList: [], //
customerOrgRegister: {}, //
isshow: true,
isDrag: false,
form: {
//
customerOrgId:'', //
id: "",
customerOrgRegisterId: null, //
displayName: "",
@ -285,11 +285,7 @@ export default {
},
dialogVisible: false,
tableData: [],
initTableData: [],
// tableData: [
// ],
};
},
computed: {
@ -305,75 +301,103 @@ export default {
},
methods: {
moment,
dddw,
dddw,deepCopy,
//
sortok() {
btnSort() {
const result = [];
this.tableData.forEach((item, index) => {
// index 0 displayOrder
console.log(item.id);
// const currentDisplayOrder = this.tableData.length -1
const currentDisplayOrder = this.initTableData[index].displayOrder;
if (item.displayOrder != currentDisplayOrder) {
// displayOrder
result.push({ id: item.id, displayOrder: currentDisplayOrder });
}
this.customerOrgGroups.forEach((item, index) => {
result.push({ id: item.id, displayOrder: index });
});
putapi("/api/app/customerorggroup/updatesortmany", {
itemList: result,
}).then((res) => {
this.$message.success("操作成功");
this.isshow = true;
this.isDrag = false;
});
},
//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.customerOrgGroups.splice(oldIndex, 1)[0];
// _this.customerOrgGroups.splice(newIndex, 0, currRow);
// _this.customerOrgGroups.map((item, index) => {
// if (index == newIndex && index == oldIndex) {
// } else if (index == oldIndex) {
// } else if (index == newIndex) {
// }
// });
// console.log(_this.customerOrgGroups.map((item) => item.displayOrder));
// },
// });
// });
this.$nextTick(() => {
const tbody = document.querySelector(".el-table__body-wrapper tbody");
const _this = this;
Sortable.create(tbody, {
const el = document.querySelector(".el-table__body-wrapper tbody");
//console.log('el0',el)
const that = this;
Sortable.create(el, {
handle: ".move",
animation: 300,
//
onEnd({ newIndex, oldIndex }) {
_this.isshow = 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));
that.isDrag = true;
const currRow = that.customerOrgGroups.splice(oldIndex, 1)[0];
that.customerOrgGroups.splice(newIndex, 0, currRow);
console.log('el',el)
},
});
});
},
//
bottoming() {
if (this.form.id == undefined) {
//
btnSetBottom() {
if (!this.form.id) {
this.$message.warning("请选择操作的数据");
} else {
return
}
let lfind = arrayExistObj(this.customerOrgGroups,'id',this.form.id)
let currentRow = {}
putapi(
`/api/app/customerorggroup/updatemanysort?id=${this.form.id}&SortType=2`
).then((res) => {
this.$message.success("操作成功");
currentRow = this.customerOrgGroups.splice(lfind,1)[0] //
this.customerOrgGroups.unshift(currentRow)
this.$refs['customerOrgGroups'].setCurrentRow(currentRow);
});
}
},
//
topping() {
if (this.form.id == undefined) {
btnSetTop() {
if (!this.form.id) {
this.$message.warning("请选择操作的数据");
} else {
return
}
let lfind = arrayExistObj(this.customerOrgGroups,'id',this.form.id)
let currentRow = {}
putapi(
`/api/app/customerorggroup/updatemanysort?id=${this.form.id}&SortType=1`
).then((res) => {
this.$message.success("操作成功");
currentRow = this.customerOrgGroups.splice(lfind,1)[0]
this.customerOrgGroups.unshift(currentRow)
this.$refs['customerOrgGroups'].setCurrentRow(currentRow);
});
}
},
//
@ -394,9 +418,10 @@ export default {
//
getapi("/api/app/customer-org/parent-all").then((res) => {
if (res.code != -1) {
this.customerOrg = res.data;
let lfind = arrayExistObj(this.customerOrg,"id",this.dict.personOrgId);
if (lfind > -1) this.customerOrg.splice(lfind, 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)
}
});
@ -410,6 +435,7 @@ export default {
//
getCustomerOrgGroup(customerOrgRegisterId) {
this.isDrag = false
this.customerOrgGroups = [];
getapi(
`/api/app/customerorggroup/getlistinfilter?CustomerOrgRegisterId=${customerOrgRegisterId}`
@ -418,11 +444,28 @@ export default {
this.customerOrgGroups = res.data.items;
this.customerOrgGroups.forEach((e) => {
e.customerOrgRegisterId = customerOrgRegisterId;
e.customerOrgId = this.customerOrgId;
});
}
});
},
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);
}
},
//
changeCustomerOrg(v) {
getapi(
@ -436,6 +479,7 @@ export default {
} else {
this.customerOrgRegister = {};
this.customerOrgGroups = [];
this.isDrag = false
}
objCopy(this.formInit,this.form)
}
@ -466,6 +510,7 @@ export default {
this.form = deepCopy(this.formInit);
this.form.customerOrgRegisterId = this.customerOrgRegister.id;
this.form.customerOrgId = this.customerOrgId;
this.dialogVisible = true;
},
@ -499,6 +544,7 @@ export default {
);
if (lfind > -1) this.customerOrgGroups.splice(lfind, 1);
objCopy(this.formInit,this.form)
this.isDrag = false
}
})
.catch((err) => {

Loading…
Cancel
Save