Commit be01414f authored by rencs's avatar rencs

9.10

parent e9b9d758
...@@ -354,6 +354,26 @@ export const asyncRouterMap = [{ ...@@ -354,6 +354,26 @@ export const asyncRouterMap = [{
} }
] ]
}, },
{
path: '/revenue',
component: Layout,
name: '营地管理',
icon: 'setting',
authority: 'revenue',
children: [{
path: 'revenue_sum',
component: _import('revenue/revenue_sum'),
name: '营收概况',
authority: 'revenue_sum'
},
{
path: 'revenue_withdraw',
component: _import('revenue/revenue_withdraw'),
name: '提现列表',
authority: 'revenue_withdraw'
}
]
},
{ {
path: '/vehicle', path: '/vehicle',
component: Layout, component: Layout,
......
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
</div> </div>
<el-dialog <el-dialog
:title="title_text" :title="title_text"
width="50%" width="50%;"
:visible.sync="add_edit_dialog" :visible.sync="add_edit_dialog"
@close="add_edit_dialog=false" @close="add_edit_dialog=false"
> >
...@@ -376,9 +376,10 @@ export default { ...@@ -376,9 +376,10 @@ export default {
location: "", location: "",
clientHeight: 500, // 屏幕高度 clientHeight: 500, // 屏幕高度
btn_disable: null, btn_disable: null,
move_center: { lng: 113.75179, lat: 23.02067 },
}; };
}, },
mounted() {},
created() { created() {
this.getList(); this.getList();
this.get_all_companys(); this.get_all_companys();
...@@ -688,6 +689,7 @@ export default { ...@@ -688,6 +689,7 @@ export default {
// _this.listQuery.address = rs.address; // _this.listQuery.address = rs.address;
} }
}); });
this.store_form.longitude = e.point.lng; this.store_form.longitude = e.point.lng;
this.store_form.latitude = e.point.lat; this.store_form.latitude = e.point.lat;
}, },
...@@ -832,14 +834,20 @@ export default { ...@@ -832,14 +834,20 @@ export default {
margin-bottom: 20px; margin-bottom: 20px;
} }
.form_box1 { .form_box1 {
height: 60vh;
overflow-y: scroll;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.map {
position: relative;
width: 100%;
height: 500px;
}
.map_box { .map_box {
width: 100%; width: 100%;
display: flex; height: 500px;
justify-content: center;
align-items: center;
} }
</style> </style>
<template>
<div class="app-container calendar-list-container">
<div>
<div class="filter-container" ref="filter-container">
<el-form ref="queryForm" :inline="inline" :model="listQuery" label-width="80px">
<el-row>
<el-form-item label="所属公司">
<el-select v-model="listQuery.corporationId" placeholder="请选择">
<el-option label="全部" :key="undefined" :value="undefined"></el-option>
<el-option
v-for="val in companys_list"
:key="val.id"
:label="val.name"
:value="val.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="所属门店">
<el-select
class="filter-item"
v-model="listQuery.companyId"
clearable
placeholder="请选择"
>
<el-option label="全部" :key="undefined" :value="undefined"></el-option>
<el-option
v-for="val in branchCompany_list"
:key="val.id"
:label="val.name"
:value="val.id"
></el-option>
</el-select>
</el-form-item>
<el-button
class="filter-item"
type="primary"
v-waves
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button>
<el-button class="filter-item" @click="clear_handleFilter">清除搜索</el-button>
</el-row>
</el-form>
<div class="label_box">
<div class="label_item top_color_bule">
<p class="money_p">
<span></span>1,000,000.00
</p>
<p class="money_label">总营收金额</p>
</div>
<div class="label_item top_color_bule2">
<p class="money_p">
<span></span>1,000,000.00
</p>
<p class="money_label">订单&服务营收</p>
</div>
<div class="label_item top_color_origin">
<p class="money_p">
<span></span>1,000,000.00
</p>
<p class="money_label">额外赔偿(违约金等)</p>
</div>
<div class="label_item top_color_yellow">
<p class="money_p">
<span></span>1,000,000.00
</p>
<p class="money_label">已提现金额</p>
</div>
<div class="label_item top_color_red">
<p class="money_p">
<span></span>1,000,000.00
</p>
<p class="money_label">
可提现金额,
<a>立即提现 ></a>
</p>
</div>
</div>
<div class="label_filter">
<div>收支明细</div>
<div>
<el-form>
<el-form-item style="margin-bottom:0" label="时间筛选">
<el-date-picker
type="date"
placeholder="开始时间"
v-model="listQuery.daystart"
style="width: 40%;"
></el-date-picker>&nbsp;
<el-date-picker
type="date"
placeholder="结束时间"
v-model="listQuery.dayend"
style="width: 40%;"
></el-date-picker>
</el-form-item>
</el-form>
</div>
</div>
</div>
<el-table :key="tableKey" :data="list" border fit highlight-current-row style="width: 100%;">
<el-table-column align="center" label="公司名称" prop="name"></el-table-column>
<el-table-column align="center" label="联系人/电话">
<template slot-scope="{row}">
<span>{{row.contact}}/{{row.mobile}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="法人姓名" prop="legalPerson"></el-table-column>
<el-table-column align="center" label="法人身份证" prop="legalIdNumber"></el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="{row}">
<el-button type="text" @click="withdraw(row)">提现</el-button>
</template>
</el-table-column>
</el-table>
<div v-show="!listLoading" class="pagination-container">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="listQuery.page"
:page-sizes="[10,20,30,40,50]"
:page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
></el-pagination>
</div>
</div>
</div>
</template>
<script>
import { formatDate } from "utils/dateFormattor";
import {
toEast8Date,
deepCopyDate,
newEast8Date,
convertDate2Str,
timestamp2Date,
} from "utils/dateUtils";
import { mapGetters } from "vuex";
import {
company_list,
add_company,
del_company,
upd_company,
} from "api/company";
import { getAllZone } from "api/base_info/constant/";
import Element1 from "../admin/menu/components/element";
import ElRow from "element-ui/packages/row/src/row";
import ElCol from "element-ui/packages/col/src/col";
import { getToken } from "utils/auth";
import { company_all_list, branchCompany_all_list } from "api/company.js";
export default {
name: "carApplyList",
components: {
ElCol,
ElRow,
Element1,
},
data() {
return {
title_text: "",
BASE_API: process.env.BASE_API,
add_edit_dialog: false,
list: null,
total: null,
listLoading: true,
listQuery: {
page: 1,
limit: 10,
companyId: undefined,
corporationId: undefined,
daystart: "",
dayend: "",
},
inline: true,
tableKey: 0,
btn_disable: null,
companys_list: [],
branchCompany_list: [],
};
},
created() {
this.getList();
this.get_all_companys();
this.get_all_branchCompany();
},
computed: {
...mapGetters(["elements"]),
getHeaderWithToken() {
return { Authorization: getToken() };
},
},
methods: {
//所有公司
get_all_companys() {
company_all_list().then((res) => {
if (res.status == 200) {
this.companys_list = res.data;
}
});
},
//所有门店
get_all_branchCompany() {
branchCompany_all_list({ state: 1 }).then((res) => {
if (res.status == 200) {
this.branchCompany_list = res.data;
}
});
},
handleAvatarSuccess(res, file) {
this.company_form.businessLicense = res.data;
},
/**
* 获取列表
* */
getList() {
this.listLoading = true;
company_list(this.listQuery).then((response) => {
console.log(response);
let totalCountRs = undefined;
let listRs = undefined;
if (
!this.$utils.isEmpty(response.data.data) &&
this.$utils.isInteger(response.data.totalCount)
) {
listRs = response.data.data;
totalCountRs = response.data.totalCount;
}
this.listLoading = false;
this.list = listRs;
this.total = totalCountRs;
});
},
handleFilter() {
this.listQuery.page = 1;
this.$refs.queryForm.validate((valid) => {
if (valid) {
this.getList();
} else {
return false;
}
});
},
clear_handleFilter() {
this.listQuery = {
page: 1,
limit: 10,
companyId: undefined,
corporationId: undefined,
daystart: "",
dayend: "",
};
this.getList();
},
handleSizeChange(val) {
this.listQuery.limit = val;
this.getList();
},
handleCurrentChange(val) {
this.listQuery.page = val;
this.getList();
},
},
};
</script>
<style lang="scss" scoped>
.top_btn {
width: 100%;
display: flex;
justify-content: flex-end;
margin-bottom: 20px;
}
.form_box {
width: 80%;
display: flex;
flex-direction: column;
align-items: center;
}
.customWidth1 {
width: 35%;
}
.label_box {
width: 100%;
display: flex;
flex-wrap: wrap;
}
.label_item {
width: 260px;
height: 130px;
margin-right: 20px;
margin-bottom: 20px;
box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.3);
border: 1px solid rgba(255, 255, 255, 0);
border-radius: 4px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.top_color_bule {
border-top: 12px solid #3d5afe;
}
.top_color_bule2 {
border-top: 12px solid #00b0ff;
}
.top_color_origin {
border-top: 12px solid #ff9100;
}
.top_color_yellow {
border-top: 12px solid #ffea00;
}
.top_color_red {
border-top: 12px solid #ff3d00;
}
.money_p {
margin: 0;
color: rgba(66, 66, 66, 1);
font-size: 18px;
font-weight: 600;
span {
&:first-child {
color: rgba(97, 97, 97, 1);
font-size: 14px;
}
}
}
.money_label {
margin: 0;
color: rgba(189, 189, 189, 1);
font-size: 14px;
a {
&:first-child {
color: blue;
}
}
}
.label_filter {
div {
&:first-child {
margin-left: 10px;
color: #101010;
font-size: 15px;
font-weight: 600;
}
}
display: flex;
justify-content: space-between;
border-left: 5px solid #101010;
align-items: center;
height: fit-content;
}
</style>
<template>
<div class="app-container calendar-list-container">
<div>
<div class="filter-container" ref="filter-container">
<el-form ref="queryForm" :inline="inline" :model="listQuery" label-width="80px">
<el-row>
<el-form-item label="状态">
<el-select v-model="listQuery.type" placeholder="请选择">
<el-option label="全部" value="0"></el-option>
<el-option label="公司" value="1"></el-option>
<el-option label="门店" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="发起时间">
<el-date-picker
type="date"
placeholder="开始时间"
v-model="listQuery.daystart"
style="width: 40%;"
></el-date-picker>&nbsp;
<el-date-picker
type="date"
placeholder="结束时间"
v-model="listQuery.dayend"
style="width: 40%;"
></el-date-picker>
</el-form-item>
<el-form-item label="提现号">
<el-input v-model="listQuery.number" placeholder="请输入提现号"></el-input>
</el-form-item>
</el-row>
<el-row>
<el-button
class="filter-item"
type="primary"
v-waves
icon="el-icon-search"
@click="handleFilter"
>搜索</el-button>
<el-button class="filter-item" @click="clear_handleFilter">清除搜索</el-button>
</el-row>
</el-form>
</div>
<el-table :key="tableKey" :data="list" border fit highlight-current-row style="width: 100%;">
<el-table-column align="center" label="提现号" prop="name"></el-table-column>
<el-table-column align="center" label="所属公司" prop="name"></el-table-column>
<el-table-column align="center" label="所属门店" prop="name"></el-table-column>
<el-table-column align="center" label="提现金额" prop="name"></el-table-column>
<el-table-column align="center" label="发起时间" prop="name"></el-table-column>
<el-table-column align="center" label="状态" prop="name"></el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="{row}">
<el-button type="text" @click="vailde_now(row)">立即审核</el-button>
<el-button type="text" @click="vailde_check(row)">查看凭证</el-button>
</template>
</el-table-column>
</el-table>
<div v-show="!listLoading" class="pagination-container">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="listQuery.page"
:page-sizes="[10,20,30,40,50]"
:page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
></el-pagination>
</div>
</div>
<el-dialog
title="上传凭证"
:visible.sync="update_vailed_dialog"
width="30%"
@close="update_vailed_dialog=false"
>
<el-form>
<el-form-item label="凭证" style="margin-left: 100px;">
<el-upload
class="avatar-uploader"
action="https://jsonplaceholder.typicode.com/posts/"
:show-file-list="false"
:on-success="handleAvatarSuccess"
>
<img v-if="imageUrl" :src="imageUrl" class="avatar" style="width:150px;height:150px" />
<i
v-else
class="el-icon-plus avatar-uploader-icon"
style="width:150px;height:150px;display:flex;align-items: center;justify-content: center;"
></i>
</el-upload>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="update_vailed_dialog = false">取 消</el-button>
<el-button type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="show_vailed_dialog" width="30%" @close="show_vailed_dialog=false">
<img src alt />
</el-dialog>
</div>
</template>
<script>
import { formatDate } from "utils/dateFormattor";
import {
toEast8Date,
deepCopyDate,
newEast8Date,
convertDate2Str,
timestamp2Date,
} from "utils/dateUtils";
import { mapGetters } from "vuex";
import {
company_list,
add_company,
del_company,
upd_company,
} from "api/company";
import { getAllZone } from "api/base_info/constant/";
import Element1 from "../admin/menu/components/element";
import ElRow from "element-ui/packages/row/src/row";
import ElCol from "element-ui/packages/col/src/col";
import { getToken } from "utils/auth";
import { company_all_list, branchCompany_all_list } from "api/company.js";
export default {
name: "carApplyList",
components: {
ElCol,
ElRow,
Element1,
},
data() {
return {
title_text: "",
BASE_API: process.env.BASE_API,
add_edit_dialog: false,
list: null,
total: null,
listLoading: true,
listQuery: {
page: 1,
limit: 10,
type: "0",
number: "",
daystart: "",
dayend: "",
},
inline: true,
tableKey: 0,
btn_disable: null,
companys_list: [], //门店列表
update_vailed_dialog: false,
show_vailed_dialog: false,
vailde_item: {},
imageUrl: undefined,
show_image: undefined,
};
},
created() {
this.getList();
this.get_all_companys();
},
computed: {
...mapGetters(["elements"]),
getHeaderWithToken() {
return { Authorization: getToken() };
},
},
methods: {
handleAvatarSuccess(res, file) {
this.imageUrl = URL.createObjectURL(file.raw);
},
//所有公司
get_all_companys() {
company_all_list().then((res) => {
if (res.status == 200) {
this.companys_list = res.data;
}
});
},
handleAvatarSuccess(res, file) {
this.company_form.businessLicense = res.data;
},
/**
* 获取列表
* */
getList() {
this.listLoading = true;
company_list(this.listQuery).then((response) => {
console.log(response);
let totalCountRs = undefined;
let listRs = undefined;
if (
!this.$utils.isEmpty(response.data.data) &&
this.$utils.isInteger(response.data.totalCount)
) {
listRs = response.data.data;
totalCountRs = response.data.totalCount;
}
this.listLoading = false;
this.list = listRs;
this.total = totalCountRs;
});
},
handleFilter() {
this.listQuery.page = 1;
this.$refs.queryForm.validate((valid) => {
if (valid) {
this.getList();
} else {
return false;
}
});
},
clear_handleFilter() {
this.listQuery = {
page: 1,
limit: 10,
type: "0",
number: "",
daystart: "",
dayend: "",
};
this.getList();
},
handleSizeChange(val) {
this.listQuery.limit = val;
this.getList();
},
handleCurrentChange(val) {
this.listQuery.page = val;
this.getList();
},
// 立即审核
vailde_now(row) {
this.update_vailed_dialog = true;
this.vailde_item = row;
},
//查看凭证
vailde_check(row) {
this.show_vailed_dialog = true;
this.show_image = row;
},
},
};
</script>
<style>
.top_btn {
width: 100%;
display: flex;
justify-content: flex-end;
margin-bottom: 20px;
}
.form_box {
width: 80%;
display: flex;
flex-direction: column;
align-items: center;
}
.customWidth1 {
width: 35%;
}
</style>
...@@ -178,11 +178,13 @@ ...@@ -178,11 +178,13 @@
}, },
longitude:{ longitude:{
required: true, required: true,
message: '请选择经纬度' message: '请选择经纬度',
trigger: 'blur'
}, },
latitude:{ latitude:{
required: true, required: true,
message: '请选择经纬度' message: '请选择经纬度',
trigger: 'blur'
} }
}, },
allCompanies: {}, allCompanies: {},
...@@ -356,6 +358,7 @@ ...@@ -356,6 +358,7 @@
addrProvince: undefined, addrProvince: undefined,
addrCity: undefined, addrCity: undefined,
} }
}, },
getPoint(e){ //点击地图获取一些信息, getPoint(e){ //点击地图获取一些信息,
this.show = true; this.show = true;
......
<template> <template>
<el-dialog title="活动日期" :visible.sync="isVisible"> <el-dialog title="活动日期" :visible.sync="isVisible">
<el-button size="small" class="el-button el-button--primary" type="button" icon="plus" @click="addTime()">添加</el-button> <el-button
size="small"
class="el-button el-button--primary"
type="button"
icon="plus"
@click="addTime()"
>添加</el-button>
<el-form> <el-form>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="活动天数"> <el-form-item label="活动天数">
<el-input style="width: 200px;" v-model="num" type="number" min="1" placeholder="请输入活动天数" @change="changeNum()"></el-input> <el-input
style="width: 200px;"
v-model="num"
type="number"
min="1"
placeholder="请输入活动天数"
@change="changeNum()"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row v-for="item in list" <el-row v-for="item in list" style="margin: 10px 0;" :key="item.id">
style="margin: 10px 0;"
:key="item.id">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="开始时间"> <el-form-item label="开始时间">
<el-date-picker <el-date-picker
...@@ -20,8 +31,8 @@ ...@@ -20,8 +31,8 @@
:disabled="!item.dis" :disabled="!item.dis"
@change="changeStartTime(item)" @change="changeStartTime(item)"
format="yyyy-MM-dd" format="yyyy-MM-dd"
placeholder="选择日期"> placeholder="选择日期"
</el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
...@@ -31,8 +42,8 @@ ...@@ -31,8 +42,8 @@
v-model="item.endTime" v-model="item.endTime"
type="date" type="date"
format="yyyy-MM-dd" format="yyyy-MM-dd"
placeholder="选择日期"> placeholder="选择日期"
</el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
...@@ -51,179 +62,174 @@ ...@@ -51,179 +62,174 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { import { getSonRegionByCodes, getRegionByCodes } from "api/base_info/region/";
getSonRegionByCodes, import rsCode from "../../../utils/rsCode";
getRegionByCodes, import { mapGetters } from "vuex";
} from 'api/base_info/region/'; import { formatDate } from "utils/dateFormattor";
import rsCode from '../../../utils/rsCode'; import { getAllCompany, getAll } from "api/base_info/branch_company/";
import {mapGetters} from 'vuex'; import ElRow from "element-ui/packages/row/src/row";
import { import ElInput from "../../../../node_modules/element-ui/packages/input/src/input.vue";
formatDate import ElCol from "element-ui/packages/col/src/col";
} from 'utils/dateFormattor'; import ElFormItem from "../../../../node_modules/element-ui/packages/form/src/form-item.vue";
import { import ElForm from "../../../../node_modules/element-ui/packages/form/src/form.vue";
getAllCompany, export default {
getAll
} from 'api/base_info/branch_company/';
import ElRow from "element-ui/packages/row/src/row";
import ElInput from "../../../../node_modules/element-ui/packages/input/src/input.vue";
import ElCol from "element-ui/packages/col/src/col";
import ElFormItem from "../../../../node_modules/element-ui/packages/form/src/form-item.vue";
import ElForm from "../../../../node_modules/element-ui/packages/form/src/form.vue";
export default {
props: ["list", "number"], props: ["list", "number"],
name: 'destinationDialog', name: "destinationDialog",
components: { components: {
ElForm, ElForm,
ElFormItem, ElFormItem,
ElCol, ElCol,
ElInput, ElInput,
ElRow ElRow,
}, },
data() { data() {
return { return {
isVisible: false, isVisible: false,
time:"", time: "",
lists: [], lists: [],
t: {}, t: {},
num: 0 num: 0,
} };
},
created() {
}, },
created() {},
watch: { watch: {
isVisible(newValue, oldValue){ isVisible(newValue, oldValue) {
if(!newValue){ if (!newValue) {
let arr = []; let arr = [];
this.list.map(function(item){ this.list.map(function (item) {
if(item.startTime){ if (item.startTime) {
arr.push(item); arr.push(item);
} }
}); });
let params = { let params = {
priceDTOS: arr priceDTOS: arr,
}; };
this.$emit('tourDepartTimeEvent', params); this.$emit("tourDepartTimeEvent", params);
} }
}, },
}, },
mounted() { mounted() {
let that = this; let that = this;
this.num = this.number; this.num = this.number;
this.list.map(function(item){ this.list.map(function (item) {
let arr = []; let arr = [];
arr.push(item.startTime); arr.push(item.startTime);
arr.push(item.endTime); arr.push(item.endTime);
item.visible2 = false; item.visible2 = false;
item.time = arr; item.time = arr;
}); });
// this.lists = this.list; // this.lists = this.list;
this.isVisible = true; this.isVisible = true;
}, },
computed: { computed: {
...mapGetters([ ...mapGetters(["elements"]),
'elements',
])
}, },
methods: { methods: {
/** /**
* 删除时间 * 删除时间
* */ * */
deleteItem(obj){ deleteItem(obj) {
this.list.splice(this.list.indexOf(obj),1); this.list.splice(this.list.indexOf(obj), 1);
console.log(obj); console.log(obj);
}, },
deleteHandler(){}, deleteHandler() {},
addTime(){ addTime() {
this.t = { this.t = {
startTime:"", startTime: "",
endTime: "", endTime: "",
stock: 0 stock: 0,
}; };
this.list.push(this.t); this.list.push(this.t);
this.list[this.list.length-1].dis = 'dis' this.list[this.list.length - 1].dis = "dis";
console.log(this.list) console.log(this.list);
}, },
/** /**
* 确定 * 确定
* */ * */
okHandler() { okHandler() {
if(this.num*1<=0){ if (this.num * 1 <= 0) {
this.$notify({ this.$notify({
title: '失败', title: "失败",
message: '活动时间必须大于0', message: "活动时间必须大于0",
type: 'warning', type: "warning",
duration: 2000 duration: 2000,
}); });
return false; return false;
} }
let arr = []; let arr = [];
this.list.map(function(item){ this.list.map(function (item) {
let t = { let t = {
id: item.id?item.id:undefined, id: item.id ? item.id : undefined,
startTime: item.startTime, startTime: item.startTime,
endTime: item.endTime, endTime: item.endTime,
stock: item.stock stock: item.stock,
}; };
arr.push(t); arr.push(t);
}); });
let params = { let params = {
priceDTOS: arr, priceDTOS: arr,
num: this.num*1 num: this.num * 1,
}; };
this.$emit('tourDepartTimeEvent', params); this.$emit("tourDepartTimeEvent", params);
console.log(params) console.log(params);
}, },
/** /**
* 弹框-取消 * 弹框-取消
* */ * */
cancel() { cancel() {
let arr = []; let arr = [];
this.list.map(function(item){ this.list.map(function (item) {
if(item.startTime){ if (item.startTime) {
arr.push(item); arr.push(item);
} }
}); });
let params = { let params = {
priceDTOS: arr priceDTOS: arr,
}; };
this.$emit('tourDepartTimeEvent', params); this.$emit("tourDepartTimeEvent", params);
},
dateChange1(val) {
this.filters.startDate = val;
}, },
dateChange1(val) { this.filters.startDate = val; },
/** /**
* 改变时间 * 改变时间
* */ * */
changeStartTime(d){ changeStartTime(d) {
if(this.num<=0){ if (this.num <= 0) {
this.$notify({ this.$notify({
title: '失败', title: "失败",
message: '活动时间必须大于0', message: "活动时间必须大于0",
type: 'warning', type: "warning",
duration: 2000 duration: 2000,
}); });
return false; return false;
} else { } else {
} }
d.endTime = formatDate(new Date(d.startTime.getTime() + 3600 * 1000 * 24 * this.num), 'yyyy-MM-dd'); d.endTime = formatDate(
d.startTime = formatDate(d.startTime, 'yyyy-MM-dd'); new Date(d.startTime.getTime() + 3600 * 1000 * 24 * this.num),
"yyyy-MM-dd"
);
d.startTime = formatDate(d.startTime, "yyyy-MM-dd");
}, },
/** /**
* 改变活动天数-重新计算结束时间 * 改变活动天数-重新计算结束时间
* */ * */
changeNum(){ changeNum() {
console.log(this.num); console.log(this.num);
let that = this; let that = this;
this.num = this.num*1; this.num = this.num * 1;
if(this.num>0){ if (this.num > 0) {
this.list.map(function(item){ this.list.map(function (item) {
let t = new Date(new Date(item.startTime).getTime() + 3600 * 1000 * 24 * (that.num-1)); let t = new Date(
item.startTime = formatDate(new Date(item.startTime), 'yyyy-MM-dd'); new Date(item.startTime).getTime() +
item.endTime = formatDate(t, 'yyyy-MM-dd'); 3600 * 1000 * 24 * (that.num - 1)
);
item.startTime = formatDate(new Date(item.startTime), "yyyy-MM-dd");
item.endTime = formatDate(t, "yyyy-MM-dd");
}); });
console.log(this.list); console.log(this.list);
} }
},
} },
} };
}
</script> </script>
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