Commit f953aba9 authored by yanglilong's avatar yanglilong

'修改跳转'

parent 1c14d620
......@@ -64,9 +64,8 @@
:data-source="dataList"
row-key="mrnNo"
:scroll="{ x: true }"
:pagination="pagination"
:pagination="false"
:customRow="handlerRowClick"
@change="onChange"
>
<template slot="operation" slot-scope="record">
<a-button
......@@ -89,10 +88,13 @@
</a-popconfirm>
</template>
</a-table>
<!--分页-->
<BurtPagination :pagination="pager" @pageChange="_getCustomerList" />
</div>
</template>
<script>
import BurtPagination from "@/components/CUSTOMER/pagation";
export default {
data() {
const columns = [
......@@ -141,59 +143,17 @@ export default {
pager: {
pageNum: 1,
pageSize: 10,
},
total: 0,
total: 0
}
};
},
components: {
BurtPagination
},
created() {
this._getCustomerList();
this._getPayorCode();
},
computed: {
pagination() {
const { pageNum, pageSize } = this.pager;
const pages = Math.ceil(this.total / pageSize);
return {
current: pageNum,
pageSize,
size: "large",
position: "bottom",
align: "right",
total: this.total,
hideOnSinglePage: false,
itemRender: (current, type, originalElement) => {
if (type === "prev") {
originalElement.children = undefined;
originalElement.text = "上一页";
}
if (type === "page") {
if (current !== pageNum) {
return undefined;
}
return (
<p>
<span class="current-page">{current}</span> / {pages}
</p>
);
}
if (type === "next") {
originalElement.children = undefined;
originalElement.text = "下一页";
return (
<div>
{originalElement}
<a-input-number
onblur={this.onShowSizeChange}
class="size-change"
></a-input-number>
</div>
);
}
return originalElement;
},
};
},
},
methods: {
handlerRowClick(record) {
const { id, patientPolicyId } = record;
......@@ -222,40 +182,7 @@ export default {
record.isEdit = undefined;
record.isNew = undefined;
},
// customDeal(columns) {
// return columns.map((item) => {
// return {
// ...item,
// ellipsis: true,
// customRender: (text, record, index) => {
// const data = item.customRender
// ? item.customRender(text, record, index)
// : text;
// if (record.isEdit) {
// return "";
// }
// return data;
// },
// };
// });
// },
onChange(pager) {
const { current } = pager;
// console.log(pager);
this.pager.pageNum = current;
this._getCustomerList();
},
onShowSizeChange(e) {
e && e.stopPropagation();
const val = e.target.value * 1;
if (!val || val < 0) {
return false;
}
this.pager.pageSize = val;
this._getCustomerList();
},
handlerSearch() {
console.log(this.$refs.form.validate);
this.$refs.form.validate((valid) => {
if (!valid) {
return false;
......@@ -284,7 +211,7 @@ export default {
};
this.$apis.GETCUSTOMERLIST(data).then((res) => {
this.dataList = (res.content && res.content.list) || [];
this.total = (res.content && res.content.total) || 0;
this.pager.total = (res.content && res.content.total) || 0;
});
},
},
......
......@@ -29,7 +29,7 @@
>
<a-select
v-if="record.edit"
v-model="record.benefits"
v-model="record.benefits2"
placeholder="请选择"
mode="multiple"
>
......@@ -40,7 +40,7 @@
>{{ item.description }}</a-select-option
>
</a-select>
<span v-else>{{ filterType(record.benefits) }}</span>
<span v-else>{{ filterType(record.benefits2) }}</span>
</template>
<template v-else>
<a-input
......@@ -111,14 +111,13 @@ export default {
components: {
BurtPagination,
},
created() {
async created() {
await this.getBenefitType();
this.getData();
this.getBenefitType();
},
methods: {
//过滤器
filterType(val) {
let txt = (val || []).map((item) => {
return this.benefitTypeObj[item] || "";
});
......@@ -126,15 +125,19 @@ export default {
},
//获取福利类型列表
getBenefitType() {
this.$apis.GETBENEGITTYPE().then((res) => {
if (res.returnCode == "0000") {
this.benefitType = res.content || [];
(res.content || []).forEach((item) => {
this.benefitTypeObj[item.benefitCode] = item.description;
});
} else {
this.$message.error(res.returnMsg);
}
return new Promise((resolve, reject) => {
this.$apis.GETBENEGITTYPE().then((res) => {
if (res.returnCode == "0000") {
this.benefitType = res.content || [];
(res.content || []).forEach((item) => {
this.benefitTypeObj[item.benefitCode] = item.description;
});
resolve();
} else {
this.$message.error(res.returnMsg);
reject();
}
});
});
},
//获取列表
......@@ -164,7 +167,7 @@ export default {
return {
...item,
edit: false,
benefits: (item.benefits || "").split(","),
benefits2: item.benefits ? item.benefits.split(",") : [],
};
});
},
......@@ -184,10 +187,10 @@ export default {
id: record.id,
ratio: record.ratio,
remark: record.remark,
discountBenefitList: (record.benefits || []).map((item) => {
discountBenefitList: (record.benefits2 || []).map((item) => {
return {
benefitCode: item,
discountId: record.id
discountId: record.id,
};
}),
})
......@@ -215,7 +218,7 @@ export default {
.then((res) => {
if (res.returnCode == "0000") {
this.$message.success("删除成功");
this.dataList.splice(index, 1);
this.tableList.splice(index, 1);
} else {
this.$message.error(res.returnMsg);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment