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.

93 lines
1.9 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>
</Card>
</div>
</template>
<script>
import {
3 months ago
getMiandan,
addMiandan,
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,
};
},
methods: {
init() {
this.getDataList();
},
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
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>