|
|
@ -46,7 +46,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
<div> |
|
|
<div> |
|
|
<el-button class="btnClass" |
|
|
<el-button class="btnClass" |
|
|
@click="Onsubmit" |
|
|
|
|
|
|
|
|
@click="btnSave" |
|
|
>保存 |
|
|
>保存 |
|
|
</el-button> |
|
|
</el-button> |
|
|
</div> |
|
|
</div> |
|
|
@ -65,47 +65,45 @@ |
|
|
</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"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
disabled |
|
|
|
|
|
type="text" |
|
|
|
|
|
v-model="scope.row.price" |
|
|
|
|
|
/> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="折扣" prop="price" min-width="60" 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 |
|
|
@change="discount(scope.$index)" |
|
|
@change="discount(scope.$index)" |
|
|
type="text" |
|
|
|
|
|
|
|
|
type="number" size="small" |
|
|
v-model="scope.row.discount" |
|
|
v-model="scope.row.discount" |
|
|
/> |
|
|
/> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="价格" prop="price" min-width="80" 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 |
|
|
@input="changingprices(scope.row.price)" |
|
|
|
|
|
type="text" |
|
|
|
|
|
v-model="scope.row.price" |
|
|
|
|
|
|
|
|
@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="customerOrgGroupDetailAmount" min-width="40" align="center"> |
|
|
|
|
|
</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> |
|
|
@ -166,7 +164,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 +292,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 +306,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,11 +499,49 @@ export default { |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
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.refreshTable('tableCustomerOrgGroupAsbitems') |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
//合计 |
|
|
//合计 |
|
|
getSummaries(){ |
|
|
|
|
|
|
|
|
getSummaries(param) { |
|
|
|
|
|
console.log('getSummaries param',param) |
|
|
|
|
|
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] += 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; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
changingprices(price) { |
|
|
changingprices(price) { |
|
|
this.price = price; |
|
|
this.price = price; |
|
|
}, |
|
|
}, |
|
|
@ -509,63 +558,40 @@ export default { |
|
|
this.price = row.price; |
|
|
this.price = row.price; |
|
|
console.log(this.price); |
|
|
console.log(this.price); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//保存按钮 |
|
|
//保存按钮 |
|
|
Onsubmit() { |
|
|
|
|
|
if (!this.personnelUnit.customerOrgGroupId) { |
|
|
|
|
|
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); |
|
|
|
|
|
} |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
btnSave() { |
|
|
|
|
|
if(!this.customerOrgGroup.id){ |
|
|
|
|
|
this.$message.warning("请先选中单位分组") |
|
|
|
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
let body = [] |
|
|
|
|
|
// [ |
|
|
|
|
|
// { |
|
|
|
|
|
// "customerOrgGroupId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", |
|
|
|
|
|
// "asbitemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", |
|
|
|
|
|
// "price": 0, |
|
|
|
|
|
// "amount": 0 |
|
|
|
|
|
// } |
|
|
|
|
|
// ] |
|
|
|
|
|
this.customerOrgGroupAsbitems.forEach(e =>{ |
|
|
|
|
|
body.push({ |
|
|
|
|
|
customerOrgGroupId:this.customerOrgGroup.id, |
|
|
|
|
|
asbitemId:e.asbitemId, |
|
|
|
|
|
price:e.customerOrgGroupDetailPrice, |
|
|
|
|
|
amount:e.customerOrgGroupDetailAmount |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
//移除按钮 |
|
|
|
|
|
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, |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
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 +613,15 @@ export default { |
|
|
getapi( |
|
|
getapi( |
|
|
`/api/app/customerorggroupdetail/getcustomerorggroupdetailinasbitem?CustomerOrgGroupId=${customerOrgGroupId}` |
|
|
`/api/app/customerorggroupdetail/getcustomerorggroupdetailinasbitem?CustomerOrgGroupId=${customerOrgGroupId}` |
|
|
).then((res) => { |
|
|
).then((res) => { |
|
|
this.customerOrgGroupAsbitems = res.data; |
|
|
|
|
|
|
|
|
if(res.code != -1){ |
|
|
|
|
|
this.customerOrgGroupAsbitems = res.data; |
|
|
|
|
|
this.getAsbItemByItemType() |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
}else{ |
|
|
}else{ |
|
|
this.customerOrgGroupAsbitems = [] |
|
|
this.customerOrgGroupAsbitems = [] |
|
|
|
|
|
this.getAsbItemByItemType() |
|
|
} |
|
|
} |
|
|
this.getAsbItemByItemTypeAll() |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|