@@ -127,6 +127,17 @@ import {billAutoList, getAutoDeductionBills} from "@/api/payment/payPlan" //查
import {deleteAutoGenerateBills, deleteAutoDeductionBills} from "@/api/payment/payPlan" //删
import {updateAutoGenerateBills, updateAutoDeductionBills} from "@/api/payment/payPlan" //改
import {findByIdByBillAutoId, findById} from "@/api/payment/payPlan" //回调
+function deleteIds(lists) {
+ // 楼栋id和房屋id有重复,导致数形控件选择不可用,把除房屋id外的全改为undefined
+ lists.forEach((list) => {
+ if (list.childList) {
+ list.id = undefined;
+ deleteIds(list.childList);
+ } else {
+ return;
+ }
+ });
+}
export default {
name: 'payPlay',
components: {
@@ -134,11 +145,6 @@ export default {
autoBillDrawer,
autoBillPaymentDrawer
},
- watch: {
- checkedKeys(val) {
- this.form.estateIds = val.checked;
- },
- },
data() {
return {
//编辑抽屉
@@ -167,7 +173,11 @@ export default {
{title: "费用名称", dataIndex: "name",width: 100},
{title: "计费方式", dataIndex: "billingType",width: 100},
{title: "计量方式", dataIndex: "calculateType",width: 100},
- {title: "计量单价", dataIndex: "calculateUnit",width: 100},
+ {title: "计量单价", dataIndex: "calculateUnit",width: 100,
+ customRender: function (calculateUnit) {
+ return (calculateUnit*1).toFixed(2)
+ },
+ },
{title: "备注", dataIndex: "remarks"},
],
////////
@@ -251,13 +261,14 @@ export default {
getApi() {
findEstateCascade().then(res => {
let data = res.data;
- data.forEach(ele => {
- ele.childList.forEach(el => {
- el.checkable = false
- });
- ele.checkable = false
- })
+ // data.forEach(ele => {
+ // ele.childList.forEach(el => {
+ // el.checkable = false
+ // });
+ // ele.checkable = false
+ // })
this.roomTreeData = data
+ deleteIds(this.roomTreeData);
});
chargesList({pageNum: 1,size: 1000}).then(res => {
let data = res.data.rows;
@@ -282,6 +293,15 @@ export default {
success() {
this.getData();
},
+ onCheck(checkedKeys) {
+ let ids = [];
+ for (let id of checkedKeys) {
+ if (typeof id == "number") {
+ ids.push(id);
+ }
+ }
+ this.form.estateIds = ids;
+ },
//手动生成账单
addBill() {
this.addShow = true