Browse Source

group

master
pengjun 2 years ago
parent
commit
cba2b52cb7
  1. 1
      src/components/customerOrg/ContactPerson.vue
  2. 557
      src/components/customerOrg/customerOrgGroupAsbitem.vue
  3. 3
      src/components/patientRegister/PatientRegisterItem.vue
  4. 2
      src/views/Home.vue
  5. 2
      src/views/customerOrg/customerOrgGroup.vue
  6. 4
      src/views/customerOrg/patientRegister.vue

1
src/components/customerOrg/ContactPerson.vue

@ -213,6 +213,7 @@ export default {
this.formTitle = "新增";
this.personId = "";
this.customerOrg.contactMethodList = [];
this.contactMethodListEdit = [];
},
edit() {

557
src/components/customerOrg/customerOrgGroupAsbitem.vue

@ -2,36 +2,26 @@
<div style="display: flex; margin-top:5px;">
<div :style="'display: flex;width:' + (window.pageWidth - 45 - 110) + 'px;'">
<!--未选组合项目-->
<div style="display: block; width:255px;">
<div style="display: block; width:230px;">
<div>
<span>项目类别</span>
<el-select
v-model="value"
placeholder="请选择"
style="margin-left: 10px"
@change="getprojectgroups"
clearable size="small"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.displayName"
:value="item.id"
>
</el-option>
</el-select>
<el-cascader :options="dict.itemTypeTree" v-model="itemTypeIds" style="margin-left: 3px;width:160px;"
:props="{ checkStrictly: true, expandTrigger: 'hover', ...customerOrg.treeprops, }" :show-all-levels="false"
clearable filterable @change="getAsbItemByItemType" size="small">
</el-cascader>
</div>
<div class="box">
<el-table :data="tabledata" border size="small"
@selection-change="handleSelectionChange" highlight-current-row
:height="window.pageHeight < 665 ? 200:(window.pageHeight - 110 - 355)"
>
<el-table :data="dict.asbItem" border size="small" highlight-current-row
:height="window.pageHeight < 668 ? 200:(window.pageHeight - 110 - 358)"
@row-dblclick="dbClickChoosedAsb"
@selection-change="handleSelectionChange" :row-class-name="handleRowClassName"
@row-click="chooseAsbItem">
<!--
<el-table-column type="selection" align="center" ></el-table-column>
-->
<el-table-column type="index" align="center" min-width="40"/>
<el-table-column
label="未选组合项目" min-width="180"
label="未选组合项目" min-width="170"
prop="displayName" align="center"
></el-table-column>
</el-table>
@ -41,19 +31,18 @@
<!--中间操作按钮-->
<div style="display: block;margin: 40px 10px 0 10px;">
<div>
<el-button class="btnClass" @click="removedata" >添加 <i class="el-icon-arrow-right"></i></el-button>
<el-button class="btnClass" @click="addAbs(asbItemChoosed,'choosed')" >添加 <i class="el-icon-arrow-right"></i></el-button>
</div>
<div>
<el-button class="btnClass" @click="removedata">全部添加</el-button>
<el-button class="btnClass" @click="addAbs(asbItemChoosed,'all')">全部添加</el-button>
</div>
<div>
<el-button class="btnClass"
@click="addselecteditems"
>移除 <i class="el-icon-arrow-left"></i
@click="delAbs(patientRegisterAbsChoosed,'choosed')">移除 <i class="el-icon-arrow-left"></i
></el-button>
</div>
<div>
<el-button class="btnClass" @click="removedata">全部移除</el-button>
<el-button class="btnClass" @click="delAbs(patientRegisterAbsChoosed,'all')">全部移除</el-button>
</div>
<div>
<el-button class="btnClass"
@ -64,30 +53,23 @@
</div>
<!--已选组合项目-->
<div :style="'display: block; width:' + (window.pageWidth - 255 - 120 - 45 - 110) + 'px;'">
<div :style="'display: block; width:' + (window.pageWidth - 230 - 120 - 45 - 110) + 'px;'">
<div style="height:32px;">
<span>快速选择</span>
<el-select
v-model="value"
placeholder="请选择"
style="margin-left: 10px"
@change="getprojectgroups"
clearable size="small"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.displayName"
:value="item.id"
>
</el-option>
<el-select v-model="asbItemId" placeholder="快速选择组合项目" size="small"
filterable clearable remote automatic-dropdown
:remote-method="remoteMethod" @change="quickChoosedAsb" default-first-option ref="asbItemId"
style="margin-left: 3px;width:160px;">
<el-option v-for="item in quickAsb" :key="item.id" :value="item.id" :label="item.displayName" />
</el-select>
</div>
<div class="box">
<el-table :data="customerOrgGroupAsbitems" border size="small"
@selection-change="selecteditems" highlight-current-row
:height="window.pageHeight < 665 ? 200:(window.pageHeight - 110 - 355)"
>
:height="window.pageHeight < 668 ? 200:(window.pageHeight - 110 - 358)"
:summary-method="getSummaries"
show-summary :row-class-name="handleRowClassName" @row-dblclick="removeAbs"
@row-click="removeAsbItem">
<!--
<el-table-column type="selection"></el-table-column>
-->
@ -102,7 +84,7 @@
<el-input
disabled
type="text"
v-model="personnelUnit.nogroupselected[scope.$index].price"
v-model="scope.row.price"
/>
</template>
</el-table-column>
@ -111,7 +93,7 @@
<el-input
@change="discount(scope.$index)"
type="text"
v-model="personnelUnit.nogroupselected[scope.$index].discount"
v-model="scope.row.discount"
/>
</template>
</el-table-column>
@ -120,7 +102,7 @@
<el-input
@input="changingprices(scope.row.price)"
type="text"
v-model="personnelUnit.nogroupselected[scope.$index].price"
v-model="scope.row.price"
/>
</template>
</el-table-column>
@ -142,12 +124,22 @@
<script>
import { getapi, postapi } from "@/api/api";
import { mapState } from "vuex";
import { arrayExistObj } from "../../utlis/proFunc";
import { arrayExistObj, tcdate, arrayFilter, arrayReduce, deepCopy } from "../../utlis/proFunc";
export default {
props:['customerOrgGroup'],
data() {
return {
customerOrgGroupAsbitems:[], //
itemTypeIds:[], //
asbItemId:'', //ID
quickAsb:[], //
asbItemChoosed: [], //
startPoint:-1,
PstartPoint:-1,
saveornot: true, //
selecteddata: [], //
unselecteddata: [], //
@ -167,16 +159,344 @@ export default {
};
},
computed: {
...mapState(["window","dict"]),
...mapState(["window","dict","customerOrg"]),
},
created() {
this.getitemtype();
this.getportfolioitems();
this.dictInit()
},
methods: {
//
dictInit(){
//
getapi("/api/app/item-type/by-code-all").then((res) => {
if (res.code != -1) {
this.dict.itemTypeTree = res.data;
tcdate(this.dict.itemTypeTree);
}
});
//
getapi("/api/app/asbitem/in-filter?Filter").then((res) => {
if (res.code != -1) {
this.dict.asbItemAll = res.data.items;
this.dict.asbItemAll.forEach(e => {
e.choosed = false
})
this.dict.asbItem = deepCopy(this.dict.asbItemAll);
this.dict.asbItemQuick = deepCopy(res.data.items);
}
});
},
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.customerOrgGroupAsbitems], "id=asbitemId");
arrayReduce(this.dict.asbItemQuick, [...this.customerOrgGroupAsbitems], "id=asbitemId");
},
//
remoteMethod(keyWords) {
//console.log('remoteMethod',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 = [...this.dict.asbItemQuick];
}
},
//
///api/app/register-asbitem/many/3fa85f64-5717-4562-b3fc-2c963f66afa6'
async addAbs(asbItemChoosed,oprType) {
if(!this.customerOrgGroup.id){
this.$message.warning("请先选中单位分组")
return
}
let checked = true
let lfind = -1
// 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("请选择要添加的组合项目")
return
}
//
// "displayName": "",
// "shortName": "f",
// "forSexId": "F",
// "itemTypeId": "3a0b16de-75b9-c910-c61b-844709a88940",
// "price": 0,
console.log('asbItemChoosed.length', asbItemChoosed.length)
for (let i = 0; i < asbItemChoosed.length; i++) {
if (this.customerOrgGroup.forSexId == 'U') break //
if (asbItemChoosed[i].forSexId == 'A') continue
if (asbItemChoosed[i].forSexId != this.customerOrgGroup.sexId) {
this.$message.warning(`所选项目:${asbItemChoosed[i].displayName},不适合当前人员性别`)
checked = false
break
}
}
//console.log(222,checked)
if (!checked) return
for (let i = 0; i < asbItemChoosed.length; i++) {
let pojo = {
asbitemId: asbItemChoosed[i].id,
patientRegisterId: this.customerOrgGroup.id,
standardPrice: asbItemChoosed[i].price,
chargePrice: asbItemChoosed[i].price,
amount: 1,
total: asbItemChoosed[i].price,
}
this.customerOrgGroupAsbitems.push(pojo)
//this.customerOrgGroupAsbitems.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]])
}
}
},
//
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) {
let body = {}
let registerAsbitemIds = []
let chargeComplete = ''
let lfind = -1
// start
if(oprType && oprType == 'all'){
absForDel = deepCopy(this.customerOrgGroupAsbitems)
}else if(oprType && oprType == 'choosed'){
absForDel = []
this.customerOrgGroupAsbitems.forEach(e =>{
if(e.choosed){
absForDel.push(deepCopy(e))
e.choosed = false
}
})
}
// end
if (absForDel.length < 1) {
this.$message.warning("请选择要移除的组合项目")
return
}
for (let i = 0; i < absForDel.length; i++) {
lfind = arrayExistObj(this.customerOrgGroupAsbitems, 'asbitemId', absForDel[i].asbitemId)
if (lfind > -1) this.customerOrgGroupAsbitems.splice(lfind, 1)
absForDel.splice(i, 1)
i--
continue
}
//
this.getAsbItemByItemType()
},
//
removeAbs(row) {
this.delAbs([row]);
},
//
removeAsbItem(row){
this.customerOrgGroupAsbitems.forEach((e,index) => {
e.index = index;
return e
});
// shift
if (this.window.shift) {
//
this.customerOrgGroupAsbitems.forEach(e => {
e.choosed = false;
return e
});
if (this.PstartPoint == - 1) {
this.customerOrgGroupAsbitems[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
}
} else if (this.PstartPoint <= row.index) {
for (let i = this.PstartPoint; i <= row.index; i++) {
this.customerOrgGroupAsbitems[i].choosed = true
}
}
return
}
// ctrl
if (this.window.ctrl) {
console.log('this.window.ctrl',this.window.ctrl,this.customerOrgGroupAsbitems)
this.customerOrgGroupAsbitems[row.index].choosed = true;
this.PstartPoint = row.index;
return
}
// ctrl shift
//
//console.log('')
this.customerOrgGroupAsbitems.forEach(e => {
e.choosed = false;
return e
});
this.customerOrgGroupAsbitems[row.index].choosed = true;
this.PstartPoint = row.index;
},
//
getSummaries(){
},
changingprices(price) {
this.price = price;
},
discount(index) {
console.log(index); //100
this.personnelUnit.nogroupselected[index].price = Math.round(
@ -203,34 +523,7 @@ export default {
}
);
}
// if (this.title == 2) {
// if (!this.personnelUnit.customerOrgGroupId) { 3a0c563d-cb6a-3638-6e06-651f282e17ca
// alert("");
// return;
// } else {
// console.log(this.personnelUnit.nogroupselected);
// postapi(
// "/api/app/customer-org-group-detail/many",
// this.addrulst
// ).then((res) => {
// this.$message.success("");
// console.log(this.addrulst);
// });
// }
// }
// console.log(this.addrulst);
// // console.log(this.personnelUnit.form.id);
// if (this.addrulst[customerOrgGroupId] == undefined) {
// this.$message.warning("");
// } else {
// postapi("/api/app/customer-org-group-detail/many", this.addrulst).then(
// (res) => {
// console.log(this.personnelUnit.form.id);
// this.$message.success("");
// }
// );
// }
},
//
addselecteditems() {
@ -278,111 +571,39 @@ export default {
this.rightselctedata = val;
console.log(this.rightselctedata);
},
//
removedata() {
let lfind = -1;
if (this.personnelUnit.form.id == "") {
alert("请先选择单位分组");
} else {
if (this.unselecteddata.length == 0) {
this.$message.warning("未选数据为空无法移动");
} else {
this.saveornot = false;
let count = this.unselecteddata.length - 1;
for (var i = count; i >= 0; i--) {
// this.tabledata.splice(i, 1);
if ([...new Set(this.personnelUnit.nogroupselected)]) {
// this.unselecteddata.push(this.unselecteddata[i]);
this.personnelUnit.nogroupselected.push(this.unselecteddata[i]);
this.tabledata.splice(this.tabledata[i], 1);
}
// this.personnelUnit.nogroupselected.push(this.unselecteddata[i]);
}
console.log(this.personnelUnit.customerOrgGroupId);
// let prices = "";
this.personnelUnit.nogroupselected.forEach((items) => {
// prices = items.price;
//this.tabledata
console.log(items);
lfind = arrayExistObj(this.tabledata, "id", items.id);
if (lfind > -1) this.tabledata.splice(lfind, 1);
this.addrulst.push({
asbitemId: items.id, // "3a0b2f0c-f884-bec4-a350-79b46b455a2d"
price: items.price,
// price: this.price == "" ? items.price : this.price,
customerOrgGroupId: this.personnelUnit.customerOrgGroupId,
});
});
console.log(this.addrulst, "hhhhhhh");
}
}
},
//
handleSelectionChange(val) {
// this.selecteddata = val;
this.unselecteddata = val;
console.log(this.unselecteddata);
},
//
getportfolioitems() {
getapi("/api/app/asbitem/in-filter?Filter").then((res) => {
this.tabledata = res.data.items;
});
},
//
getprojectgroups(v) {
if (v !== "") {
getapi(`/api/app/asbitem/in-item-type/${v}`).then((res) => {
console.log(res);
this.tabledata = res.data;
});
} else {
getapi("/api/app/asbitem/in-filter?Filter").then((res) => {
this.tabledata = res.data.items;
//
getCustomerOrgGroupAsbitems(customerOrgGroupId) {
if(customerOrgGroupId){
getapi(
`/api/app/customerorggroupdetail/getcustomerorggroupdetailinasbitem?CustomerOrgGroupId=${customerOrgGroupId}`
).then((res) => {
this.customerOrgGroupAsbitems = res.data;
});
}else{
this.customerOrgGroupAsbitems = []
}
this.getAsbItemByItemTypeAll()
},
getitemtype() {
getapi("/api/app/item-type/by-code-all").then((res) => {
this.options = res.data;
});
},
//
listeninglist(customerOrgGroupId) {
getapi(`/api/app/customer-org-group/${customerOrgGroupId}`).then(
(res) => {
this.personnelUnit.form = res.data;
console.log(res);
}
);
getapi(
`/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem/${customerOrgGroupId}`
).then((res) => {
console.log(
`/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem/${customerOrgGroupId}`,
res
);
this.personnelUnit.nogroupselected = res.data;
});
},
// getapi(`/api/app/customer-org-group/${row.id}`).then((res)
},
//
watch: {
//
"personnelUnit.customerOrgGroupId"(newVal, oldVal) {
console.log(
"watch patientRegister.addTimes newVal:",
newVal,
" oldVal:",
oldVal
);
"customerOrgGroup.id"(newVal, oldVal) {
console.log("customerOrgGroup.id ",newVal,oldVal);
if (newVal != oldVal) {
this.listeninglist(newVal);
//
this.getCustomerOrgGroupAsbitems(newVal);
}
},
},

3
src/components/patientRegister/PatientRegisterItem.vue

@ -336,7 +336,7 @@ export default {
return e
});
this.patientRegister.patientRegisterAbs[row.index].choosed = true;
this.startPoint = row.index;
this.PstartPoint = row.index;
},
@ -807,6 +807,7 @@ export default {
}
},
// quickChoosedAsb(v){
// let lfind = -1
// let asbItemChoosed = []

2
src/views/Home.vue

@ -255,6 +255,7 @@
class="dropdownmain"
>诊断模板</el-dropdown-item
>
<!--
<el-dropdown-item
command="item-result-template"
class="dropdownmain"
@ -265,6 +266,7 @@
class="dropdownmain"
>项目结果匹配</el-dropdown-item
>
-->
<el-dropdown-item command="item-template" class="dropdownmain"
>项目模板</el-dropdown-item
>

2
src/views/customerOrg/customerOrgGroup.vue

@ -151,7 +151,7 @@
<!--分组项目信息-->
<div>
<CustomerOrgGroupAsbitem :customerOrgGroupId="form.id" />
<CustomerOrgGroupAsbitem :customerOrgGroup="form" />
</div>
</el-card>

4
src/views/customerOrg/patientRegister.vue

@ -167,14 +167,14 @@ export default {
//
getapi("/api/app/item-type/by-code-all").then((res) => {
if (res.code == 1) {
if (res.code != -1) {
this.dict.itemTypeTree = res.data;
tcdate(this.dict.itemTypeTree);
}
});
getapi("/api/app/asbitem/in-filter?Filter").then((res) => {
if (res.code == 1) {
if (res.code != -1) {
this.dict.asbItemAll = res.data.items;
}
});

Loading…
Cancel
Save