You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

169 lines
3.8 KiB

<style lang="less">
@import "@/styles/table-common.less";
</style>
<template>
<div class="search">
<Card>
3 months ago
<Row>
<Form ref="searchForm" :model="searchForm" inline :label-width="100">
3 months ago
<FormItem label="免单人数" prop="name">
<Input v-model="form.orderNumber"></Input>
</FormItem>
<FormItem label="免单金额" prop="name">
<Input v-model="form.freeAmount"></Input>
</FormItem>
<FormItem style="margin-left: -35px" class="br">
3 months ago
<Button v-if="isOpen" @click="add" type="primary">开启</Button>
<Button v-else @click="add" type="primary">保存</Button>
<Button @click="close">关闭免单</Button>
</FormItem>
</Form>
</Row>
3 months ago
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" ref="table"
sortable="custom" ></Table>
<Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize"
@on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
size="small" show-total show-elevator show-sizer></Page>
</Row>
</Card>
</div>
</template>
<script>
import {
3 months ago
getMiandan,
addMiandan,
3 months ago
JiangLiList,
3 months ago
closeMiandan
} from "@/api/app";
export default {
3 months ago
name: "logiticsCompany",
data() {
return {
3 months ago
form: {
orderNumber:'',
freeAmount:'',
regionId:JSON.parse(this.getStore("user")).departmentId
},
3 months ago
isOpen:false,
3 months ago
searchForm: {
3 months ago
regionId:JSON.parse(this.getStore("user")).departmentId,
pageNum: 1,
3 months ago
pageSize: 10,
3 months ago
dealingsWay:'免单奖励'
3 months ago
},
columns: [{
type: "index",
width: 60,
align: "center",
},
{
3 months ago
title: "类型",
key: "linkType",
align: "center",
render: (h, params) => {
let re = ""
if (params.row.linkType == 0) {
re = "用户";
} else if (params.row.type == 1) {
re = "配送员";
}
return h(
"div",
re
);
}
},
{
title: "交易方式/附言",
key: "dealingsWay",
3 months ago
align: "center",
},
{
3 months ago
title: "金额",
key: "amount",
3 months ago
align: "center",
},
{
3 months ago
title: "交易时间",
key: "dealingsTime",
3 months ago
align: "center",
}
],
3 months ago
data:[],
total: 0,
};
},
methods: {
init() {
this.getDataList();
3 months ago
this.getJiangLiList();
},
getJiangLiList(){
JiangLiList(this.searchForm).then((res) => {
if (res.success) {
3 months ago
this.data = res.result.records
3 months ago
this.total = res.result.total;
if (this.data.length == 0 && this.searchForm.pageNum > 1) {
this.searchForm.pageNum -= 1;
this.getJiangLiList();
}
}
});
},
getDataList() {
3 months ago
getMiandan({
regionId:JSON.parse(this.getStore("user")).departmentId
}).then((res) => {
if (res.success) {
3 months ago
if(res.result == null){
this.isOpen = true
}else{
this.form = res.result;
}
}
3 months ago
});
},
add() {
3 months ago
addMiandan(this.form).then((res) => {
if (res.success) {
this.$Message.success("操作成功");
3 months ago
this.getJiangLiList();
}
});
},
3 months ago
changePage(v) {
this.searchForm.pageNum = v;
this.getJiangLiList();
},
changePageSize(v) {
this.searchForm.pageSize = v;
this.getJiangLiList();
},
3 months ago
close() {
this.$Modal.confirm({
3 months ago
title: "确认关闭",
content: "您确认要关闭免单优惠吗?",
loading: true,
onOk: () => {
3 months ago
closeMiandan({
regionId:JSON.parse(this.getStore("user")).departmentId
}).then((res) => {
3 months ago
if (res.success) {
3 months ago
this.$Message.success("操作成功");
}
});
3 months ago
this.$Modal.remove();
},
});
3 months ago
},
},
mounted() {
this.init();
},
};
</script>