罗斌杰 2 years ago
parent
commit
ea97d9a149
  1. 239
      src/components/customerOrg/customerOrgGroupAsbitem.vue
  2. 42
      src/views/customerOrg/customerOrgGroup.vue

239
src/components/customerOrg/customerOrgGroupAsbitem.vue

@ -44,12 +44,6 @@
<div> <div>
<el-button class="btnClass" @click="delAbs(patientRegisterAbsChoosed,'all')">全部移除</el-button> <el-button class="btnClass" @click="delAbs(patientRegisterAbsChoosed,'all')">全部移除</el-button>
</div> </div>
<div>
<el-button class="btnClass"
@click="Onsubmit"
>保存
</el-button>
</div>
</div> </div>
<!--已选组合项目--> <!--已选组合项目-->
@ -65,47 +59,52 @@
</div> </div>
<div class="box"> <div class="box">
<el-table :data="customerOrgGroupAsbitems" border size="small" <el-table :data="customerOrgGroupAsbitems" border size="small"
@selection-change="selecteditems" highlight-current-row
@selection-change="selecteditems" highlight-current-row :key="id"
:height="window.pageHeight < 668 ? 200:(window.pageHeight - 110 - 358)" :height="window.pageHeight < 668 ? 200:(window.pageHeight - 110 - 358)"
:summary-method="getSummaries"
show-summary :row-class-name="handleRowClassName" @row-dblclick="removeAbs"
@row-click="removeAsbItem">
: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="selection"></el-table-column>
--> -->
<el-table-column type="index" min-width="40"/>
<el-table-column type="index" min-width="40" align="center"/>
<el-table-column <el-table-column
label="已选组合项目" label="已选组合项目"
min-width="120" min-width="120"
prop="displayName" prop="displayName"
></el-table-column> ></el-table-column>
<el-table-column label="标准价格" prop="price" min-width="80" align="center">
<el-table-column label="标准价格" prop="price" min-width="60" align="center"/>
<el-table-column label="折扣" prop="price" min-width="50" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
disabled
type="text"
v-model="scope.row.price"
@input="changeDiscount(scope.$index)"
type="number" size="small"
v-model="scope.row.discount"
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="折扣" prop="price" min-width="60" align="center">
<el-table-column label="应收价格" prop="customerOrgGroupDetailPrice" min-width="60" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
@change="discount(scope.$index)"
type="text"
v-model="scope.row.discount"
@input="changePrices(scope.$index)"
type="number" size="small"
v-model="scope.row.customerOrgGroupDetailPrice"
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="价格" prop="price" min-width="80" align="center">
<el-table-column label="数量" prop="customerOrgGroupDetailAmount" min-width="40" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input
@input="changingprices(scope.row.price)"
type="text"
v-model="scope.row.price"
@input="changePrices(scope.$index)"
type="number" size="small"
v-model="scope.row.customerOrgGroupDetailAmount"
/> />
</template> </template>
</el-table-column> </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>
</el-table> </el-table>
</div> </div>
</div> </div>
@ -118,6 +117,9 @@
<div> <div>
<el-button class="btnClass">复制套餐</el-button> <el-button class="btnClass">复制套餐</el-button>
</div> </div>
<div>
<el-button class="btnClass" @click="btnSave">保存</el-button>
</div>
</div> </div>
</div> </div>
</template> </template>
@ -166,7 +168,17 @@ export default {
this.dictInit() this.dictInit()
}, },
updated () {
this.refreshTable('tableCustomerOrgGroupAsbitems')
},
methods: { methods: {
//
refreshTable(tableRef){
this.$nextTick(() => {
this.$refs[tableRef].doLayout()
})
},
// //
dictInit(){ dictInit(){
// //
@ -284,8 +296,8 @@ export default {
// "price": 0, // "price": 0,
console.log('asbItemChoosed.length', asbItemChoosed.length) 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 == 'U') break //
if (asbItemChoosed[i].forSexId == 'A') continue
if (this.customerOrgGroup.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.customerOrgGroup.sexId) {
this.$message.warning(`所选项目:${asbItemChoosed[i].displayName},不适合当前人员性别`) this.$message.warning(`所选项目:${asbItemChoosed[i].displayName},不适合当前人员性别`)
checked = false checked = false
@ -298,13 +310,16 @@ export default {
for (let i = 0; i < asbItemChoosed.length; i++) { for (let i = 0; i < asbItemChoosed.length; i++) {
let pojo = { let pojo = {
asbitemId: asbItemChoosed[i].id, asbitemId: asbItemChoosed[i].id,
patientRegisterId: this.customerOrgGroup.id,
standardPrice: asbItemChoosed[i].price,
chargePrice: asbItemChoosed[i].price,
amount: 1,
total: asbItemChoosed[i].price,
displayName:asbItemChoosed[i].displayName,
discount:100,
customerOrgGroupDetailAmount:1,
price:asbItemChoosed[i].price,
customerOrgGroupDetailPrice:asbItemChoosed[i].price,
customerOrgGroupDetailMoney: asbItemChoosed[i].price,
asbitemMoney: asbItemChoosed[i].price,
} }
this.customerOrgGroupAsbitems.push(pojo) this.customerOrgGroupAsbitems.push(pojo)
//this.customerOrgGroupAsbitems.push({ ...pojo, asbitemName: asbItemChoosed[i].displayName }) //this.customerOrgGroupAsbitems.push({ ...pojo, asbitemName: asbItemChoosed[i].displayName })
@ -488,84 +503,113 @@ export default {
}, },
//
getSummaries(){
changeDiscount(index){
},
this.customerOrgGroupAsbitems[index].customerOrgGroupDetailPrice =
(this.customerOrgGroupAsbitems[index].discount * this.customerOrgGroupAsbitems[index].price/100).toFixed(2)
changingprices(price) {
this.price = price;
},
discount(index) {
console.log(index); //100
this.personnelUnit.nogroupselected[index].price = Math.round(
(100 * Number(this.personnelUnit.nogroupselected[index].queueTime)) /
100,
2
);
this.customerOrgGroupAsbitems[index].customerOrgGroupDetailMoney =
(this.customerOrgGroupAsbitems[index].customerOrgGroupDetailPrice * this.customerOrgGroupAsbitems[index].customerOrgGroupDetailAmount).toFixed(2)
//this.getSummaries()
}, },
inputchang(row, newVal) {
this.price = row.price;
console.log(this.price);
//
changePrices(index){
this.customerOrgGroupAsbitems[index].customerOrgGroupDetailMoney =
(this.customerOrgGroupAsbitems[index].customerOrgGroupDetailPrice * this.customerOrgGroupAsbitems[index].customerOrgGroupDetailAmount).toFixed(2)
this.customerOrgGroupAsbitems[index].discount = (this.customerOrgGroupAsbitems[index].customerOrgGroupDetailPrice * 100 / this.customerOrgGroupAsbitems[index].price).toFixed(2)
//this.getSummaries()
}, },
//
Onsubmit() {
if (!this.personnelUnit.customerOrgGroupId) {
alert("请先选择单位分组");
//
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; 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);
} }
);
//
if (sumCol.indexOf(index) == -1) {
sums[index] = '';
return;
} }
},
//
addselecteditems() {
let lfind = -1;
console.log(this.personnelUnit.id);
if (this.personnelUnit.form.id == "") {
alert("请先选择单位类别");
} else {
//
this.saveornot = false;
//personnelUnit.nogroupselected
if (this.rightselctedata.length == 0) {
this.$message.warning("已选数据为空无法移动");
} else {
// this.title = 2;
let count = this.rightselctedata.length - 1;
for (var i = count; i >= 0; i--) {
if ([...new Set(this.tabledata)]) {
this.tabledata.push(this.rightselctedata[i]);
this.personnelUnit.nogroupselected.splice(i, 1);
}
}
console.log(this.personnelUnit.customerOrgGroupId);
// this.
this.rightselctedata.forEach((item) => {
lfind = arrayExistObj(
this.personnelUnit.nogroupselected,
"id",
item.id
);
if (lfind > -1) this.personnelUnit.nogroupselected.splice(lfind, 1);
this.addrulst.push({
asbitemId: item.id,
price: item.price,
// price: this.price,
customerOrgGroupId: this.personnelUnit.customerOrgGroupId,
});
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.totalStand = sums[2];
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;
},
//
btnSave() {
if(!this.customerOrgGroup.id){
this.$message.warning("请先选中单位分组")
return
} }
let body = {
customerOrgGroupId:this.customerOrgGroup.id,
details:[]
} }
// {
// "customerOrgGroupId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "details": [
// {
// "customerOrgGroupId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "asbitemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "price": 0,
// "amount": 0
// }
// ]
// }
this.customerOrgGroupAsbitems.forEach(e =>{
body.details.push({
customerOrgGroupId:this.customerOrgGroup.id,
asbitemId:e.asbitemId,
price:e.customerOrgGroupDetailPrice,
amount:e.customerOrgGroupDetailAmount
})
})
postapi('/api/app/customerorggroupdetail/createcustomerorggroupdetailmany',body).then(res => {
if(res.code != -1){
this.$message.success("操作成功");
}
})
}, },
// //
selecteditems(val) { selecteditems(val) {
this.rightselctedata = val; this.rightselctedata = val;
@ -587,12 +631,15 @@ export default {
getapi( getapi(
`/api/app/customerorggroupdetail/getcustomerorggroupdetailinasbitem?CustomerOrgGroupId=${customerOrgGroupId}` `/api/app/customerorggroupdetail/getcustomerorggroupdetailinasbitem?CustomerOrgGroupId=${customerOrgGroupId}`
).then((res) => { ).then((res) => {
if(res.code != -1){
this.customerOrgGroupAsbitems = res.data; this.customerOrgGroupAsbitems = res.data;
this.getAsbItemByItemType()
}
}); });
}else{ }else{
this.customerOrgGroupAsbitems = [] this.customerOrgGroupAsbitems = []
this.getAsbItemByItemType()
} }
this.getAsbItemByItemTypeAll()
}, },
}, },

42
src/views/customerOrg/customerOrgGroup.vue

@ -12,7 +12,7 @@
v-model="customerOrgId" v-model="customerOrgId"
placeholder="请选择体检单位" placeholder="请选择体检单位"
filterable filterable
clearable automatic-dropdown
clearable
style="margin-left: 10px" style="margin-left: 10px"
@change="changeCustomerOrg" @change="changeCustomerOrg"
size="small" size="small"
@ -35,6 +35,7 @@
style="width: 60px; margin-left: 10px" style="width: 60px; margin-left: 10px"
size="small" size="small"
@change="changeTimes" @change="changeTimes"
value-key="id" value-key="id"
> >
<el-option <el-option
@ -48,13 +49,13 @@
</div> </div>
<div> <div>
<el-table <el-table
:data="customerOrgGroups"
:data="customerOrgGroups" ref="customerOrgGroups"
style="margin-top: 2px" style="margin-top: 2px"
row-key="id" row-key="id"
border border
height="240px" height="240px"
size="small" size="small"
highlight-current-row
highlight-current-row :row-class-name="handleRowClassName"
@row-click="rowClick" @row-click="rowClick"
> >
<el-table-column <el-table-column
@ -144,15 +145,16 @@
<el-button class="btnClass" @click="bottoming" >置低</el-button> <el-button class="btnClass" @click="bottoming" >置低</el-button>
</div> </div>
<div> <div>
<el-button class="btnClass" @click="sortok" :disabled="isshow" >确定</el-button>
<el-button class="btnClass" @click="sortok" :disabled="isshow" >保存排序</el-button>
</div> </div>
</div> </div>
</div> </div>
<!--分组项目信息-->
<!--分组项目信息 -->
<div> <div>
<CustomerOrgGroupAsbitem :customerOrgGroup="form" /> <CustomerOrgGroupAsbitem :customerOrgGroup="form" />
</div> </div>
</el-card> </el-card>
<!-- 新增或者编辑弹框 --> <!-- 新增或者编辑弹框 -->
@ -266,10 +268,10 @@ export default {
customerOrgRegisterId: null, // customerOrgRegisterId: null, //
displayName: "", displayName: "",
price: 0, price: 0,
forSexId: "",
maritalStatusId: "",
ageLowerLimit: null,
ageUpperLimit: null,
forSexId: "A",
maritalStatusId: "A",
ageLowerLimit: 0,
ageUpperLimit: 200,
jobPost: "", jobPost: "",
jobTitle: "", jobTitle: "",
remark: "", remark: "",
@ -374,6 +376,19 @@ export default {
} }
}, },
//
handleRowClassName({ row, rowIndex }) {
// highLightBg 'selected'
//console.log(rowIndex, row)
//return row.highLightBg == 'selected' ? 'high-light-bg' : '';
if (row.choosed) {
return 'current-row';
} else {
return '';
}
},
// //
dictInit() { dictInit() {
// //
@ -422,6 +437,7 @@ export default {
this.customerOrgRegister = {}; this.customerOrgRegister = {};
this.customerOrgGroups = []; this.customerOrgGroups = [];
} }
objCopy(this.formInit,this.form)
} }
}); });
}, },
@ -431,10 +447,6 @@ export default {
this.getCustomerOrgGroup(v.id); this.getCustomerOrgGroup(v.id);
}, },
//
remoteMethod(){
},
// //
rowClick(row) { rowClick(row) {
@ -486,6 +498,7 @@ export default {
this.form.id this.form.id
); );
if (lfind > -1) this.customerOrgGroups.splice(lfind, 1); if (lfind > -1) this.customerOrgGroups.splice(lfind, 1);
objCopy(this.formInit,this.form)
} }
}) })
.catch((err) => { .catch((err) => {
@ -536,7 +549,8 @@ export default {
if (res.code != -1) { if (res.code != -1) {
this.$message.success("操作成功!"); this.$message.success("操作成功!");
this.form.id = res.data.id; this.form.id = res.data.id;
this.customerOrgGroups.push(res.data);
this.customerOrgGroups.push(deepCopy(res.data));
this.$refs['customerOrgGroups'].setCurrentRow(this.customerOrgGroups[this.customerOrgGroups.length - 1]);
this.dialogVisible = false; this.dialogVisible = false;
} }
}); });

Loading…
Cancel
Save