bibi 3 years ago
parent 0b96d2c962
commit bf7ea11052

@ -1,44 +1,33 @@
export const formItem = [ export const formItem = [
{ {
type: 'input', type: 'input',
label:'关键字', label:'流水号',
prop:'keyword', prop:'code',
placeholder:'请输入' placeholder:'请输入'
}, },
{ {
type: 'select', type: 'time',
label:'余量告警', label:'创建时间',
prop:'status', start: 'createDateStart',
placeholder: '请选择', end:'createDateEnd'
option:[{ id:1,name:'充足'},{ id:2,name:'不足'}]
}, },
] ]
export const columns = [ export const columns = [
{ {
title: "房屋名称", title: "充值金额",
dataIndex: "manageBuildingName", dataIndex: "amount",
scopedSlots: { customRender: "name" },
}, },
{ {
title: "户主", title: "流水号",
dataIndex: "owner", dataIndex: "code",
}, },
{ {
title: "余额", title: "创建时间",
dataIndex: "balance", dataIndex: "createDate",
}, },
{ {
title: "余额状态", title: "创建人",
dataIndex: "", dataIndex: "createName",
scopedSlots:{ customRender: "tags"}
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
}, },
] ]
export const pagination = { export const pagination = {

@ -10,7 +10,26 @@
<div class="drawer-content"> <div class="drawer-content">
基本信息 基本信息
<a-divider></a-divider> <a-divider></a-divider>
<searchForm
:formItem="formItem"
@getSearch="getData($event)"
></searchForm>
<a-table
:columns="columns"
:data-source="tableData"
:pagination="pagination"
@change="handleTableChange"
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: selectionChoosed,
}"
:row-key="
(record, index) => {
return record.id;
}
"
>
</a-table>
</div> </div>
<div class="drawer-footer"> <div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="close"> <a-button :style="{ marginRight: '8px' }" @click="close">
@ -23,9 +42,66 @@
<script> <script>
import { formItem, columns, pagination } from "./list"; import { formItem, columns, pagination } from "./list";
import {
rechargeList,
} from "@/api/payment/prepayManage";
export default { export default {
props: {
id: Number,
show: Boolean,
},
data() {
return {
formItem,
columns,
pagination,
selectedRowKeys: [],
tableData:[],
searchForm:{
estateId: undefined,
code: undefined,
createDateStart: undefined,
createDateEnd: undefined,
}
};
},
methods: { methods: {
async getData(data) {
if (data !== undefined) {
this.searchForm = data;
}
let res = await rechargeList({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
...this.searchForm,
});
this.tableData = res.data.rows;
this.pagination.total = res.data.total;
this.selectedRowKeys = [];
},
selectionChoosed() {},
close(){
this.$emit('close');
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
this.getData();
},
},
watch: {
id: {
handler(id) {
if(id!== null && id!== undefined){
this.searchForm.estateId = id
this.getData()
}
},
immediate: true,
},
}, },
}; };
</script> </script>

@ -19,22 +19,19 @@
> >
<span slot="name" slot-scope="text, row"> <span slot="name" slot-scope="text, row">
{{ {{
row.buildingName + row.buildingName + "栋/" + row.unitName + "单元/" + row.name + "室"
"栋/" +
row.unitName +
"单元/" +
row.name +
"室"
}} }}
</span> </span>
<span slot="action" slot-scope="text, row"> <span slot="action" slot-scope="text, row">
<a-space> <a-space>
<a class="ant-dropdown-link" @click="list(row.id)"></a> <a class="ant-dropdown-link" @click="list(row.id)"></a>
<a class="ant-dropdown-link" @click="recharge(row.id)"></a> <a class="ant-dropdown-link" @click="recharge(row)"></a>
</a-space> </a-space>
</span> </span>
<span slot="tags" slot-scope="text, row"> <span slot="tags" slot-scope="text, row">
<a-tag>{{ row.status===1?'充足':row.status===2?'不足':'-' }}</a-tag> <a-tag>{{
row.status === 1 ? "充足" : row.status === 2 ? "不足" : "-"
}}</a-tag>
</span> </span>
</a-table> </a-table>
<div class="action"> <div class="action">
@ -50,22 +47,43 @@
</template> </template>
</span> </span>
</div> </div>
<!-- 预缴明细 -->
<pre-list :show="drawer.show" :id="drawer.id" @close="close"></pre-list>
<!-- 充值 -->
<a-modal
title="预缴充值"
:visible="modal.show"
@ok="rechargeOk"
@cancel="rechargeCancel"
>
<a-input
v-model.number="modal.amount"
placeholder="请输入充值金额"
></a-input>
</a-modal>
</div> </div>
</template> </template>
<script> <script>
import { formItem, columns, pagination } from "./depend/config"; import { formItem, columns, pagination } from "./depend/config";
import { import { prepaymentList, recharge } from "@/api/payment/prepayManage";
prepaymentList, import { allBuilding } from "@/api/basic/estate";
rechargeList, import preList from "./depend/preList.vue";
recharge,
} from "@/api/payment/prepayManage";
import { allBuilding } from "@/api/basic/estate"
export default { export default {
components: {
preList,
},
data() { data() {
return { return {
drawer: { drawer: {
show: false, show: false,
id: undefined,
},
modal: {
show: false,
estateInfo: "",
amount: undefined,
id: undefined,
}, },
tableData: [], tableData: [],
searchForm: { searchForm: {
@ -83,13 +101,13 @@ export default {
}, },
mounted() { mounted() {
this.getData(); this.getData();
this.getSelect() this.getSelect();
}, },
methods: { methods: {
async getSelect(){ async getSelect() {
// //
let res = await allBuilding() let res = await allBuilding();
this.formItem[2].option = res.data this.formItem[2].option = res.data;
}, },
async getData(data) { async getData(data) {
if (data !== undefined) { if (data !== undefined) {
@ -107,8 +125,50 @@ export default {
selectionChoosed(data) { selectionChoosed(data) {
this.selectedRowKeys = data; this.selectedRowKeys = data;
}, },
recharge(id){}, recharge(row) {
list(id){}, this.modal = {
show: true,
id:row.id,
estateInfo:
row.buildingName + "栋/" + row.unitName + "单元/" + row.name + "室",
};
},
rechargeOk() {
this.$confirm({
title: "预缴充值",
content: `是否给房屋${this.modal.estateInfo}充值`,
onOk:()=>{
recharge({ estateId: this.modal.id, amount: this.modal.amount }).then(
(res) => {
if (res.code === 200) {
this.$message.success(res.msg);
this.getData()
this.rechargeCancel();
} else {
this.$message.error(res.msg);
}
}
);
},
});
},
rechargeCancel() {
this.modal = {
show: false,
estateInfo: "",
amount: undefined,
id: undefined,
};
},
list(id) {
this.drawer = {
show: true,
id: id,
};
},
close() {
this.drawer.show = false;
},
handleMenuClick(data) { handleMenuClick(data) {
console.log(data); console.log(data);
}, },

Loading…
Cancel
Save