Browse Source

group

master
pengjun 2 years ago
parent
commit
0c9eaa34b8
  1. 88
      src/components/customerOrg/customerOrgGroupAsbitem.vue
  2. 50
      src/views/customerOrg/customerOrgGroup.vue

88
src/components/customerOrg/customerOrgGroupAsbitem.vue

@ -43,13 +43,7 @@
</div> </div>
<div> <div>
<el-button class="btnClass" @click="delAbs(patientRegisterAbsChoosed,'all')">全部移除</el-button> <el-button class="btnClass" @click="delAbs(patientRegisterAbsChoosed,'all')">全部移除</el-button>
</div>
<div>
<el-button class="btnClass"
@click="btnSave"
>保存
</el-button>
</div>
</div>
</div> </div>
<!--已选组合项目--> <!--已选组合项目-->
@ -83,7 +77,7 @@
<el-table-column label="折扣" prop="price" min-width="50" 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
@change="discount(scope.$index)"
@input="changeDiscount(scope.$index)"
type="number" size="small" type="number" size="small"
v-model="scope.row.discount" v-model="scope.row.discount"
/> />
@ -99,6 +93,13 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="数量" prop="customerOrgGroupDetailAmount" min-width="40" align="center"> <el-table-column label="数量" prop="customerOrgGroupDetailAmount" min-width="40" align="center">
<template slot-scope="scope">
<el-input
@input="changePrices(scope.$index)"
type="number" size="small"
v-model="scope.row.customerOrgGroupDetailAmount"
/>
</template>
</el-table-column> </el-table-column>
<el-table-column label="标准金额" prop="asbitemMoney" min-width="60" align="center"> <el-table-column label="标准金额" prop="asbitemMoney" min-width="60" align="center">
</el-table-column> </el-table-column>
@ -116,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>
@ -499,17 +503,39 @@ export default {
}, },
changeDiscount(index){
this.customerOrgGroupAsbitems[index].customerOrgGroupDetailPrice =
(this.customerOrgGroupAsbitems[index].discount * this.customerOrgGroupAsbitems[index].price/100).toFixed(2)
this.customerOrgGroupAsbitems[index].customerOrgGroupDetailMoney =
(this.customerOrgGroupAsbitems[index].customerOrgGroupDetailPrice * this.customerOrgGroupAsbitems[index].customerOrgGroupDetailAmount).toFixed(2)
//this.getSummaries()
},
//
changePrices(index){ changePrices(index){
this.customerOrgGroupAsbitems[index].customerOrgGroupDetailMoney = this.customerOrgGroupAsbitems[index].customerOrgGroupDetailMoney =
(this.customerOrgGroupAsbitems[index].customerOrgGroupDetailPrice * this.customerOrgGroupAsbitems[index].customerOrgGroupDetailAmount).toFixed(2) (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.customerOrgGroupAsbitems[index].discount = (this.customerOrgGroupAsbitems[index].customerOrgGroupDetailPrice * 100 / this.customerOrgGroupAsbitems[index].price).toFixed(2)
this.refreshTable('tableCustomerOrgGroupAsbitems')
//this.getSummaries()
}, },
// //
getSummaries(param) { getSummaries(param) {
console.log('getSummaries param',param) console.log('getSummaries param',param)
// if(!param){
// param = {
// columns:[{}, {}, {}, {}, {}, {}, {property: 'asbitemMoney'},{property: 'customerOrgGroupDetailMoney'}],
// data:this.customerOrgGroupAsbitems
// }
// }
const { columns, data } = param; const { columns, data } = param;
const sumCol = [6, 7] // const sumCol = [6, 7] //
const sums = []; const sums = [];
@ -529,7 +555,7 @@ export default {
sums[index] = 0 sums[index] = 0
data.forEach(e => { data.forEach(e => {
if (!isNaN(e[column.property])) sums[index] += e[column.property]// * e['amount']
if (!isNaN(e[column.property])) sums[index] += Number(e[column.property])// * e['amount']
}) })
sums[index] = sums[index].toFixed(2) //+ ' '; sums[index] = sums[index].toFixed(2) //+ ' ';
@ -542,22 +568,8 @@ export default {
}, },
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
);
},
inputchang(row, newVal) {
this.price = row.price;
console.log(this.price);
},
// //
btnSave() { btnSave() {
@ -565,17 +577,23 @@ export default {
this.$message.warning("请先选中单位分组") this.$message.warning("请先选中单位分组")
return return
} }
let body = []
// [
// {
// "customerOrgGroupId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "asbitemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "price": 0,
// "amount": 0
// }
// ]
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 =>{ this.customerOrgGroupAsbitems.forEach(e =>{
body.push({
body.details.push({
customerOrgGroupId:this.customerOrgGroup.id, customerOrgGroupId:this.customerOrgGroup.id,
asbitemId:e.asbitemId, asbitemId:e.asbitemId,
price:e.customerOrgGroupDetailPrice, price:e.customerOrgGroupDetailPrice,

50
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"
highlight-current-row
size="small"
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() {
// //
@ -420,8 +435,9 @@ export default {
this.getCustomerOrgGroup(this.customerOrgRegister.id); this.getCustomerOrgGroup(this.customerOrgRegister.id);
} else { } else {
this.customerOrgRegister = {}; this.customerOrgRegister = {};
this.customerOrgGroups = [];
this.customerOrgGroups = [];
} }
objCopy(this.formInit,this.form)
} }
}); });
}, },
@ -431,13 +447,9 @@ export default {
this.getCustomerOrgGroup(v.id); this.getCustomerOrgGroup(v.id);
}, },
//
remoteMethod(){
},
// //
rowClick(row) {
rowClick(row) {
objCopy(row, this.form); objCopy(row, this.form);
}, },
@ -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