199 lines
5.3 KiB
Vue
199 lines
5.3 KiB
Vue
|
<template>
|
||
|
<div style="height: calc(100vh - 200px)">
|
||
|
<obj-table-plus
|
||
|
ref="oTable"
|
||
|
style="height: 100%"
|
||
|
:tableCols="tableCols"
|
||
|
:tableProp="tableProp"
|
||
|
@query="queryList"
|
||
|
v-model="dataList"
|
||
|
:tableEvent="tableEvent"
|
||
|
>
|
||
|
<template slot="tableTop">
|
||
|
<el-form :inline="true" :model="formInline" class="demo-form-inline">
|
||
|
<el-form-item label="银行卡状态:">
|
||
|
<el-select v-model="formInline.region" placeholder="请选择">
|
||
|
<el-option label="审核中" value="shanghai"></el-option>
|
||
|
<el-option label="未通过" value="beijing"></el-option>
|
||
|
<el-option label="已通过" value="beijing"></el-option>
|
||
|
</el-select>
|
||
|
</el-form-item>
|
||
|
<el-form-item>
|
||
|
<el-button type="primary" @click="$refs.oTable.reload()"
|
||
|
>查询</el-button
|
||
|
>
|
||
|
</el-form-item>
|
||
|
</el-form>
|
||
|
<div class="mb-2">
|
||
|
<el-button type="primary" size="small" @click="addProduct"
|
||
|
>添加银行卡</el-button
|
||
|
>
|
||
|
<!-- <el-button
|
||
|
:disabled="selectList.length <= 0"
|
||
|
type="danger"
|
||
|
size="small"
|
||
|
@click="deleteProduct"
|
||
|
>批量删除</el-button
|
||
|
> -->
|
||
|
</div>
|
||
|
</template>
|
||
|
</obj-table-plus>
|
||
|
<!-- 添加或编辑 -->
|
||
|
<add-or-update
|
||
|
@queryList="$refs.oTable.reload()"
|
||
|
ref="addOrUpdate"
|
||
|
></add-or-update>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
import AddOrUpdate from "./popup/add-or-update.vue";
|
||
|
export default {
|
||
|
components: { AddOrUpdate,},
|
||
|
data() {
|
||
|
return {
|
||
|
dataList: [],
|
||
|
formInline: {
|
||
|
user: "",
|
||
|
region: "",
|
||
|
},
|
||
|
tableProp: {
|
||
|
"auto-resize": true,
|
||
|
border: true,
|
||
|
height: "auto",
|
||
|
"row-id": "id",
|
||
|
"show-overflow": false,
|
||
|
},
|
||
|
productFilterType: "SALE",
|
||
|
selectList: [],
|
||
|
};
|
||
|
},
|
||
|
methods: {
|
||
|
addProduct() {
|
||
|
this.$refs.addOrUpdate.toggle().add();
|
||
|
},
|
||
|
deleteProduct() {
|
||
|
console.log(this.selectList);
|
||
|
let integers = this.selectList.map((item) => {
|
||
|
return item.id;
|
||
|
});
|
||
|
this.$confirm("此操作将删除该商品, 是否继续?", "提示", {
|
||
|
confirmButtonText: "确定",
|
||
|
cancelButtonText: "取消",
|
||
|
type: "warning",
|
||
|
})
|
||
|
.then(() => {
|
||
|
console.log("111");
|
||
|
this.$api.mer_admin.BatchDeleteProducts(integers).then((res) => {
|
||
|
this.$refs.oTable.reload();
|
||
|
});
|
||
|
})
|
||
|
.catch(() => {
|
||
|
this.$message({
|
||
|
type: "info",
|
||
|
message: "已取消删除",
|
||
|
});
|
||
|
});
|
||
|
},
|
||
|
queryList(pageNo, pageSize) {
|
||
|
this.$api.mer_admin
|
||
|
.bankCardPage({
|
||
|
pageNumber: pageNo,
|
||
|
pageSize: pageSize,
|
||
|
linkId: JSON.parse(sessionStorage.getItem("userInfo")).managerId
|
||
|
? JSON.parse(sessionStorage.getItem("userInfo")).managerId
|
||
|
: JSON.parse(sessionStorage.getItem("userInfo")).merchantId,
|
||
|
})
|
||
|
.then((res) => {
|
||
|
console.log(res);
|
||
|
this.$refs.oTable.complete(
|
||
|
res.data.data.data,
|
||
|
Number(res.data.data.total)
|
||
|
);
|
||
|
})
|
||
|
.catch((err) => {
|
||
|
this.$refs.oTable.complete(false);
|
||
|
});
|
||
|
},
|
||
|
},
|
||
|
computed: {
|
||
|
tableCols() {
|
||
|
return [
|
||
|
{ type: "checkbox", width: "60px", fixed: "left" },
|
||
|
// { type: "seq", width: "60px", align: "center", title: "序号" },
|
||
|
{
|
||
|
title: "持卡人",
|
||
|
align: "center",
|
||
|
field: "cardId",
|
||
|
},
|
||
|
{
|
||
|
title: "证件号",
|
||
|
align: "certId",
|
||
|
field: "minSalePrice",
|
||
|
},
|
||
|
{
|
||
|
title: "手机号",
|
||
|
align: "center",
|
||
|
field: "legalMp",
|
||
|
},
|
||
|
{
|
||
|
title: "企业名称",
|
||
|
align: "center",
|
||
|
field: "name",
|
||
|
},
|
||
|
{
|
||
|
title: "状态",
|
||
|
align: "center",
|
||
|
field: "status",
|
||
|
},
|
||
|
{
|
||
|
title: "操作",
|
||
|
fixed: "right",
|
||
|
type: "jsx",
|
||
|
align: "center",
|
||
|
width: "140px",
|
||
|
render: ({ row }) => {
|
||
|
let edit = () => {
|
||
|
this.$refs.addOrUpdate.toggle(row).update();
|
||
|
};
|
||
|
let priceAdjustment = () => {
|
||
|
console.log(row);
|
||
|
this.$refs.AddPrice.toggle(row).update();
|
||
|
};
|
||
|
let changeInventory = () => {
|
||
|
this.$refs.addStock.toggle(row).update();
|
||
|
};
|
||
|
let setDiscounts = () => {
|
||
|
this.$refs.AddDiscount.toggle(row).update();
|
||
|
};
|
||
|
return (
|
||
|
<div>
|
||
|
<el-button
|
||
|
size="mini"
|
||
|
disabled={row.status != "DOWN"}
|
||
|
type="primary"
|
||
|
onClick={edit}
|
||
|
>
|
||
|
编辑
|
||
|
</el-button>
|
||
|
</div>
|
||
|
);
|
||
|
},
|
||
|
},
|
||
|
];
|
||
|
},
|
||
|
tableEvent() {
|
||
|
return {
|
||
|
"checkbox-all": ({ records, reserves }) => {
|
||
|
this.selectList = [...records, ...reserves];
|
||
|
},
|
||
|
"checkbox-change": ({ records, reserves }) => {
|
||
|
this.selectList = [...records, ...reserves];
|
||
|
},
|
||
|
};
|
||
|
},
|
||
|
},
|
||
|
};
|
||
|
</script>
|
||
|
|
||
|
<style lang="scss" scoped></style>
|