|
|
|
|
<style lang="less">
|
|
|
|
|
@import "@/styles/table-common.less";
|
|
|
|
|
</style>
|
|
|
|
|
<template>
|
|
|
|
|
<div class="search">
|
|
|
|
|
<Card>
|
|
|
|
|
<Row>
|
|
|
|
|
<Form ref="searchForm" v-for="(item,index) in form.rules" :key="index" :model="searchForm" inline :label-width="100">
|
|
|
|
|
<FormItem label="名次" prop="name">
|
|
|
|
|
<Input v-model="item.orderNum"></Input>
|
|
|
|
|
</FormItem>
|
|
|
|
|
<FormItem label="奖励金额" prop="name">
|
|
|
|
|
<Input v-model="item.reward"></Input>
|
|
|
|
|
</FormItem>
|
|
|
|
|
<Icon type="ios-remove-circle-outline" @click="del(index)" size="30" color="red" />
|
|
|
|
|
</Form>
|
|
|
|
|
|
|
|
|
|
</Row>
|
|
|
|
|
<Row>
|
|
|
|
|
<Form ref="searchForm" :model="searchForm" inline :label-width="100">
|
|
|
|
|
<FormItem style="margin-left: -35px" class="br">
|
|
|
|
|
<Button @click="add">新增</Button>
|
|
|
|
|
<Button @click="close">关闭免单</Button>
|
|
|
|
|
<Button @click="submit" type="primary">保存并开启</Button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</FormItem>
|
|
|
|
|
</Form>
|
|
|
|
|
</Row>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
addJiangLi,
|
|
|
|
|
selectJiangLi,
|
|
|
|
|
closeJiangLi
|
|
|
|
|
} from "@/api/app";
|
|
|
|
|
export default {
|
|
|
|
|
name: "logiticsCompany",
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
form: {
|
|
|
|
|
rules:[],
|
|
|
|
|
regionId:JSON.parse(this.getStore("user")).departmentId
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
init() {
|
|
|
|
|
this.getDataList();
|
|
|
|
|
},
|
|
|
|
|
getDataList() {
|
|
|
|
|
selectJiangLi({
|
|
|
|
|
regionId:JSON.parse(this.getStore("user")).departmentId
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
if(res.result == null){
|
|
|
|
|
this.form.rules = [{
|
|
|
|
|
orderNum:"",
|
|
|
|
|
reward:""
|
|
|
|
|
}]
|
|
|
|
|
}else{
|
|
|
|
|
this.form = res.result;
|
|
|
|
|
this.form.rules = JSON.parse(this.form.rules)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
submit() {
|
|
|
|
|
this.form.rules = JSON.stringify(this.form.rules)
|
|
|
|
|
addJiangLi(this.form).then((res) => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
this.$Message.success("操作成功");
|
|
|
|
|
this.getDataList()
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
add(){
|
|
|
|
|
let rules = {
|
|
|
|
|
orderNum:"",
|
|
|
|
|
reward:""
|
|
|
|
|
}
|
|
|
|
|
this.form.rules.push(rules)
|
|
|
|
|
},
|
|
|
|
|
del(i){
|
|
|
|
|
this.form.rules.splice(i, 1);
|
|
|
|
|
},
|
|
|
|
|
close() {
|
|
|
|
|
this.$Modal.confirm({
|
|
|
|
|
title: "确认关闭",
|
|
|
|
|
content: "您确认要关闭配送员奖励吗?",
|
|
|
|
|
loading: true,
|
|
|
|
|
onOk: () => {
|
|
|
|
|
closeJiangLi({
|
|
|
|
|
regionId:JSON.parse(this.getStore("user")).departmentId
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
this.$Message.success("操作成功");
|
|
|
|
|
this.getDataList()
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.$Modal.remove();
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.init();
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|