|
|
@@ -8,26 +8,24 @@
|
|
|
* @Copyright: Copyright (c) 2016~2023 by Sugar., All Rights Reserved.
|
|
|
-->
|
|
|
<template>
|
|
|
- <el-dialog
|
|
|
- :title="title"
|
|
|
- :visible.sync="open"
|
|
|
- width="80vw"
|
|
|
- append-to-body
|
|
|
- :close-on-click-modal="false"
|
|
|
- @close="cancel"
|
|
|
- >
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="80vw" append-to-body :close-on-click-modal="false"
|
|
|
+ @close="cancel">
|
|
|
<div class="dialog">
|
|
|
<div>
|
|
|
<el-form :model="form" ref="form" size="small" :rules="rules" :inline="true" label-width="100px">
|
|
|
</el-form>
|
|
|
</div>
|
|
|
- <el-table
|
|
|
- row-key="tableId"
|
|
|
- ref="tables"
|
|
|
- v-loading="loading"
|
|
|
- :data="goodsList"
|
|
|
- border
|
|
|
- @selection-change="handleSelectionChange">
|
|
|
+ <el-form size="small" :inline="true" label-width="100px">
|
|
|
+ <el-form-item label="票务价格ID">
|
|
|
+ <el-input v-model="goodsSkuId" placeholder="请输入票务价格ID" clearable style="width: 240px;" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearch">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetSearch">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <el-table row-key="tableId" ref="tables" v-loading="loading" :data="filteredData" border
|
|
|
+ @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
<el-table-column label="序号" align="center" type="index" width="50"></el-table-column>
|
|
|
<el-table-column label="票务价格ID" align="center" prop="id" />
|
|
|
@@ -36,69 +34,51 @@
|
|
|
<el-table-column label="场次结束时间" align="center" prop="timeEnd" />
|
|
|
<el-table-column label="携程排期状态" align="center" prop="status">
|
|
|
<template slot-scope="scope">
|
|
|
- <dict-tag :options="dict.type.tiktok_scheduling_status" :value="scope.row.status"/>
|
|
|
+ <dict-tag :options="dict.type.tiktok_scheduling_status" :value="scope.row.status" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- size="mini"
|
|
|
- type="text"
|
|
|
- v-if="scope.row.status"
|
|
|
- @click="openCalendarFun(scope.row)"
|
|
|
- >日历价格配置</el-button>
|
|
|
- <!-- <el-button
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="mini" type="text" v-if="scope.row.status"
|
|
|
+ @click="openCalendarFun(scope.row)">日历价格配置</el-button>
|
|
|
+ <!-- <el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
@click="submitForm1(scope.row)"
|
|
|
>{{ scope.row.status == 1 ? '下架':'上架' }}</el-button> -->
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="cancel">取消</el-button>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="submitForm"
|
|
|
- :disabled="!multipleSelection || multipleSelection.length == 0"
|
|
|
- :loading="loading"
|
|
|
- >
|
|
|
+ <el-button @click="cancel">取消</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm" :disabled="!multipleSelection || multipleSelection.length == 0"
|
|
|
+ :loading="loading">
|
|
|
<span v-if="loading">提交中...</span>
|
|
|
<span v-else>推送已选</span>
|
|
|
</el-button>
|
|
|
</span>
|
|
|
<!-- 选择日期 价格 -->
|
|
|
- <el-dialog
|
|
|
- :visible.sync="openCalendar"
|
|
|
- width="70%"
|
|
|
- class="text-dia-log-class"
|
|
|
- append-to-body
|
|
|
- :close-on-click-modal="false"
|
|
|
- @close="openPrice = false"
|
|
|
- >
|
|
|
+ <el-dialog :visible.sync="openCalendar" width="70%" class="text-dia-log-class" append-to-body
|
|
|
+ :close-on-click-modal="false" @close="openPrice = false">
|
|
|
<div class="dialog calendar-dialog" v-loading="calendarLoading">
|
|
|
<div>
|
|
|
<el-button type="primary" @click="openCalendarPrice()">价格设置</el-button>
|
|
|
<el-button type="primary" @click="checkIsClear()">一键清空</el-button>
|
|
|
</div>
|
|
|
<el-calendar v-model="timeValue">
|
|
|
- <template
|
|
|
- slot="dateCell"
|
|
|
- slot-scope="{date, data}">
|
|
|
- <div :class="['calendar_box', selectTime(data)]" @mouseover="mouseoverFun(data)" @click.stop="clickTimeFun(data)">
|
|
|
+ <template slot="dateCell" slot-scope="{date, data}">
|
|
|
+ <div :class="['calendar_box', selectTime(data)]" @mouseover="mouseoverFun(data)"
|
|
|
+ @click.stop="clickTimeFun(data)">
|
|
|
<span>{{ data.day.split('-').slice(1).join('-') }}</span>
|
|
|
- <div style="width: 100%; display: flex;flex-wrap: wrap;" >
|
|
|
- <div
|
|
|
- :key="index"
|
|
|
- v-for="(item,index) in getPerFormList(data)"
|
|
|
- >
|
|
|
- {{ item.title }}:{{ item.money }}
|
|
|
+ <div style="width: 100%; display: flex;flex-wrap: wrap;">
|
|
|
+ <div :key="index" v-for="(item, index) in getPerFormList(data)">
|
|
|
+ {{ item.title }}:{{ item.money }}
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
</template>
|
|
|
</el-calendar>
|
|
|
</div>
|
|
|
@@ -108,15 +88,8 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 设置价格 -->
|
|
|
- <el-dialog
|
|
|
- title="价格设置"
|
|
|
- :visible.sync="openPrice"
|
|
|
- width="400px"
|
|
|
- class="text-dia-log-class"
|
|
|
- append-to-body
|
|
|
- :close-on-click-modal="false"
|
|
|
- @close="openPrice = false"
|
|
|
- >
|
|
|
+ <el-dialog title="价格设置" :visible.sync="openPrice" width="400px" class="text-dia-log-class" append-to-body
|
|
|
+ :close-on-click-modal="false" @close="openPrice = false">
|
|
|
<div v-loading="priceLoading">
|
|
|
<el-form :model="formPrice" ref="formPrice" size="small" :rules="rulesPrice" label-width="100px">
|
|
|
<el-form-item label="日期区间">
|
|
|
@@ -127,11 +100,13 @@
|
|
|
元
|
|
|
</el-form-item>
|
|
|
<el-form-item label="销售价" prop="saleAmount">
|
|
|
- <el-input-number v-model="formPrice.saleAmount" controls-position="right" @change="handleChange" :min="0"></el-input-number>
|
|
|
+ <el-input-number v-model="formPrice.saleAmount" controls-position="right" @change="handleChange"
|
|
|
+ :min="0"></el-input-number>
|
|
|
元
|
|
|
</el-form-item>
|
|
|
<el-form-item label="比例" prop="discount">
|
|
|
- <el-input-number v-model="formPrice.discount" controls-position="right" @blur="blurChange" :min="0" :max="100"></el-input-number>
|
|
|
+ <el-input-number v-model="formPrice.discount" controls-position="right" @blur="blurChange" :min="0"
|
|
|
+ :max="100"></el-input-number>
|
|
|
%
|
|
|
</el-form-item>
|
|
|
<el-form-item label="结算价" prop="costAmount">
|
|
|
@@ -142,34 +117,37 @@
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="openPrice = false">返回</el-button>
|
|
|
- <el-button :loading="isLoading" @click="submitFormPrice('formPrice','calendarPrice')">提交</el-button>
|
|
|
+ <el-button :loading="isLoading" @click="submitFormPrice('formPrice', 'calendarPrice')">提交</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {
|
|
|
+import {
|
|
|
pushById,
|
|
|
getCalendarPriceApi,
|
|
|
setCalendarPriceApi,
|
|
|
getPushListApi,
|
|
|
- deleteCalendarPriceApi } from "@/api/otaMr/ctrip";
|
|
|
+ deleteCalendarPriceApi
|
|
|
+} from "@/api/otaMr/ctrip";
|
|
|
import moment from "moment"
|
|
|
export default {
|
|
|
name: "dataEdit",
|
|
|
- dicts: ['tiktok_category','tiktok_scheduling_status'],
|
|
|
+ dicts: ['tiktok_category', 'tiktok_scheduling_status'],
|
|
|
data() {
|
|
|
return {
|
|
|
- title: "排期推送设置",
|
|
|
+ title: "排期推送",
|
|
|
model: "EDIT",
|
|
|
open: false,
|
|
|
loading: false,
|
|
|
goodsList: [],
|
|
|
+ filteredData: [],
|
|
|
+ goodsSkuId: "",
|
|
|
form: {},
|
|
|
rules: {
|
|
|
- poiId: [{ required: true, message: "请输入门店POIID", trigger: ["change","blur"] }],
|
|
|
- categoryId: [{ required: true, message: "请选择商品类目ID", trigger: ["change","blur"] }],
|
|
|
+ poiId: [{ required: true, message: "请输入门店POIID", trigger: ["change", "blur"] }],
|
|
|
+ categoryId: [{ required: true, message: "请选择商品类目ID", trigger: ["change", "blur"] }],
|
|
|
},
|
|
|
multipleSelection: [],
|
|
|
|
|
|
@@ -187,9 +165,9 @@ export default {
|
|
|
priceLoading: false,
|
|
|
formPrice: {},
|
|
|
rulesPrice: {
|
|
|
- originalAmount: [{ required: true, message: "请输入市场价", trigger: ["change","blur"] }],
|
|
|
- saleAmount: [{ required: true, message: "请输入销售价", trigger: ["change","blur"] }],
|
|
|
- costAmount: [{ required: true, message: "请输入结算价", trigger: ["change","blur"] }],
|
|
|
+ originalAmount: [{ required: true, message: "请输入市场价", trigger: ["change", "blur"] }],
|
|
|
+ saleAmount: [{ required: true, message: "请输入销售价", trigger: ["change", "blur"] }],
|
|
|
+ costAmount: [{ required: true, message: "请输入结算价", trigger: ["change", "blur"] }],
|
|
|
},
|
|
|
seatTypeId: null,
|
|
|
calendarId: null,
|
|
|
@@ -197,24 +175,66 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 处理搜索
|
|
|
+ handleSearch() {
|
|
|
+ const query = this.goodsSkuId.trim().toLowerCase()
|
|
|
+
|
|
|
+ if (!query) {
|
|
|
+ // 查询字段为空,显示所有数据
|
|
|
+ this.filteredData = [... this.goodsList]
|
|
|
+ } else {
|
|
|
+ // 模糊查询:过滤票据ID包含查询字符串的数据
|
|
|
+ this.filteredData = this.goodsList.filter(item =>
|
|
|
+ item.id.toString().toLowerCase().includes(query)
|
|
|
+ )
|
|
|
+ }
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.filteredData.forEach((item) => {
|
|
|
+ if (item.checkFlag == 1) {
|
|
|
+ this.$refs.tables.toggleRowSelection(item, true)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.$refs["form"].clearValidate()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 重置搜索
|
|
|
+ resetSearch() {
|
|
|
+ this.goodsSkuId = ''
|
|
|
+ this.filteredData = [...this.goodsList]
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.filteredData.forEach((item) => {
|
|
|
+ if (item.checkFlag == 1) {
|
|
|
+ this.$refs.tables.toggleRowSelection(item, true)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.$refs["form"].clearValidate()
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 支持回车键触发搜索
|
|
|
+ handleKeyPress(event) {
|
|
|
+ if (event.key === 'Enter') {
|
|
|
+ handleSearch()
|
|
|
+ }
|
|
|
+ },
|
|
|
// 输入比例计算结算价
|
|
|
blurChange() {
|
|
|
- if(this.formPrice.saleAmount && this.formPrice.discount) {
|
|
|
- let costPrice = this.formPrice.saleAmount * this.formPrice.discount / 100
|
|
|
- this.formPrice.costAmount = costPrice.toFixed(2)
|
|
|
+ if (this.formPrice.saleAmount && this.formPrice.discount) {
|
|
|
+ let costPrice = this.formPrice.saleAmount * this.formPrice.discount / 100
|
|
|
+ this.formPrice.costAmount = costPrice.toFixed(2)
|
|
|
} else {
|
|
|
- this.$set(this.formPrice,'costAmount', null)
|
|
|
+ this.$set(this.formPrice, 'costAmount', null)
|
|
|
}
|
|
|
},
|
|
|
//销售价改变 计算结算价格
|
|
|
handleChange(newVal, oldVal) {
|
|
|
- if(newVal != oldVal) {
|
|
|
+ if (newVal != oldVal) {
|
|
|
this.$set(this.formPrice, 'costAmount', null)
|
|
|
- if(this.formPrice.discount) {
|
|
|
- let costPrice = this.formPrice.saleAmount * this.formPrice.discount / 100
|
|
|
- this.formPrice.costAmount = costPrice.toFixed(2)
|
|
|
+ if (this.formPrice.discount) {
|
|
|
+ let costPrice = this.formPrice.saleAmount * this.formPrice.discount / 100
|
|
|
+ this.formPrice.costAmount = costPrice.toFixed(2)
|
|
|
} else {
|
|
|
- this.$set(this.formPrice,'costAmount',null)
|
|
|
+ this.$set(this.formPrice, 'costAmount', null)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -227,16 +247,18 @@ export default {
|
|
|
async openDialog(title, obj, type) {
|
|
|
this.loading = true
|
|
|
this.open = true;
|
|
|
+ type == 'yesPush' ? this.title = '价格日历设置' : this.title = '排期推送设置';
|
|
|
this.goodsList = []
|
|
|
+ this.filteredData = []
|
|
|
this.multipleSelection = []
|
|
|
this.timeValueObj = {}
|
|
|
this.form = JSON.parse(JSON.stringify(obj))
|
|
|
- if(type == 'yesPush') {
|
|
|
- await this.getPushListFun(obj,type)
|
|
|
+ if (type == 'yesPush') {
|
|
|
+ await this.getPushListFun(obj, type)
|
|
|
} else {
|
|
|
let list1 = []
|
|
|
- if(obj.sku?.length > 0) {
|
|
|
- obj.sku.forEach((item,index)=>{
|
|
|
+ if (obj.sku?.length > 0) {
|
|
|
+ obj.sku.forEach((item, index) => {
|
|
|
list1.push({
|
|
|
...item,
|
|
|
tableId: "id_" + index
|
|
|
@@ -244,26 +266,28 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
this.goodsList = JSON.parse(JSON.stringify(list1));
|
|
|
+ this.filteredData = [...this.goodsList]
|
|
|
}
|
|
|
this.loading = false
|
|
|
- this.$nextTick(()=>{
|
|
|
- this.goodsList.forEach((item)=>{
|
|
|
- if(item.checkFlag == 1) {
|
|
|
- this.$refs.tables.toggleRowSelection(item,true)
|
|
|
+ this.$nextTick(() => {
|
|
|
+ // this.goodsList.forEach((item) => {
|
|
|
+ this.filteredData.forEach((item) => {
|
|
|
+ if (item.checkFlag == 1) {
|
|
|
+ this.$refs.tables.toggleRowSelection(item, true)
|
|
|
}
|
|
|
})
|
|
|
this.$refs["form"].clearValidate()
|
|
|
})
|
|
|
},
|
|
|
/** 获取设置的日历价格 */
|
|
|
- async getPushListFun(obj,type) {
|
|
|
+ async getPushListFun(obj, type) {
|
|
|
try {
|
|
|
let res = await getPushListApi({
|
|
|
id: obj.id
|
|
|
})
|
|
|
- if(res.code == 200) {
|
|
|
+ if (res.code == 200) {
|
|
|
let list = []
|
|
|
- if(type == 'yesPush') {
|
|
|
+ if (type == 'yesPush') {
|
|
|
list = res.data
|
|
|
} else {
|
|
|
// if( res.data && res.data.length > 0){
|
|
|
@@ -273,14 +297,14 @@ export default {
|
|
|
// if(item1.id == obj1.id){
|
|
|
// obj1 = JSON.parse(JSON.stringify(item1))
|
|
|
// }
|
|
|
-
|
|
|
+
|
|
|
// })
|
|
|
// list.push({
|
|
|
// ...obj1,
|
|
|
// tableId: "id_" + index
|
|
|
// })
|
|
|
// })
|
|
|
-
|
|
|
+
|
|
|
// this.goodsList = res.data
|
|
|
// }else {
|
|
|
// obj.sku.forEach((item,index)=>{
|
|
|
@@ -292,8 +316,8 @@ export default {
|
|
|
// }
|
|
|
|
|
|
// 修改 取list中sku数据 2025.06/23
|
|
|
- if(obj.sku?.length > 0) {
|
|
|
- obj.sku.forEach((item,index)=>{
|
|
|
+ if (obj.sku?.length > 0) {
|
|
|
+ obj.sku.forEach((item, index) => {
|
|
|
list.push({
|
|
|
...item,
|
|
|
tableId: "id_" + index
|
|
|
@@ -301,8 +325,9 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
this.goodsList = JSON.parse(JSON.stringify(list))
|
|
|
+ this.filteredData = [...this.goodsList]
|
|
|
}
|
|
|
} catch (error) {
|
|
|
this.loading = false
|
|
|
@@ -317,13 +342,13 @@ export default {
|
|
|
this.$refs["form"].validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
try {
|
|
|
- if(!this.multipleSelection && this.multipleSelection.length <= 0) {
|
|
|
+ if (!this.multipleSelection && this.multipleSelection.length <= 0) {
|
|
|
this.$message.error("请选择上推送的数据!!!");
|
|
|
return
|
|
|
- }
|
|
|
+ }
|
|
|
let flog = false
|
|
|
let list = []
|
|
|
- this.multipleSelection.forEach((item)=>{
|
|
|
+ this.multipleSelection.forEach((item) => {
|
|
|
list.push({
|
|
|
...item,
|
|
|
status: 0,//item.status === 0 || item.status === -1 ? 1 : -1,
|
|
|
@@ -333,12 +358,12 @@ export default {
|
|
|
// flog = true
|
|
|
// }
|
|
|
})
|
|
|
- if(flog) {
|
|
|
+ if (flog) {
|
|
|
this.$message.error("请输入销售价和结算价!!!");
|
|
|
return
|
|
|
}
|
|
|
this.loading = true;
|
|
|
- const { code } = await pushById({
|
|
|
+ const { code } = await pushById({
|
|
|
...this.form,
|
|
|
sku: list
|
|
|
});
|
|
|
@@ -348,11 +373,11 @@ export default {
|
|
|
this.cancel();
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- console.error("error====",error)
|
|
|
+ console.error("error====", error)
|
|
|
} finally {
|
|
|
this.loading = false;
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
|
|
|
}
|
|
|
})
|
|
|
@@ -364,14 +389,14 @@ export default {
|
|
|
*/
|
|
|
async submitForm1(row) {
|
|
|
try {
|
|
|
- console.log("row====",row)
|
|
|
+ // console.log("row====", row)
|
|
|
let flog = false
|
|
|
let list = []
|
|
|
- let list1 = [{...row}]
|
|
|
+ let list1 = [{ ...row }]
|
|
|
let list2 = []
|
|
|
let flog1 = -1
|
|
|
- this.multipleSelection.forEach((item,index)=>{
|
|
|
- if(row.id == item.id) {
|
|
|
+ this.multipleSelection.forEach((item, index) => {
|
|
|
+ if (row.id == item.id) {
|
|
|
flog1 = index
|
|
|
}
|
|
|
list2.push({
|
|
|
@@ -381,23 +406,23 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
|
|
|
- if(flog1 != -1 ) {
|
|
|
+ if (flog1 != -1) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- list1.forEach((item)=>{
|
|
|
+ list1.forEach((item) => {
|
|
|
list.push({
|
|
|
...item,
|
|
|
status: 0,
|
|
|
checkFlag: 1
|
|
|
})
|
|
|
})
|
|
|
- if(flog) {
|
|
|
+ if (flog) {
|
|
|
this.$message.error("请输入销售价和结算价!!!");
|
|
|
return
|
|
|
}
|
|
|
this.loading = true;
|
|
|
- const { code } = await pushById({
|
|
|
+ const { code } = await pushById({
|
|
|
...this.form,
|
|
|
sku: list
|
|
|
});
|
|
|
@@ -407,7 +432,7 @@ export default {
|
|
|
this.cancel();
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- console.error("error====",error)
|
|
|
+ console.error("error====", error)
|
|
|
} finally {
|
|
|
this.loading = false;
|
|
|
}
|
|
|
@@ -429,25 +454,25 @@ export default {
|
|
|
this.reset();
|
|
|
this.open = false;
|
|
|
},
|
|
|
- isCheck(row){
|
|
|
+ isCheck(row) {
|
|
|
let flog = false
|
|
|
- this.multipleSelection.forEach((item,index)=>{
|
|
|
- if(item.tableId == row.tableId) {
|
|
|
+ this.multipleSelection.forEach((item, index) => {
|
|
|
+ if (item.tableId == row.tableId) {
|
|
|
flog = true
|
|
|
}
|
|
|
})
|
|
|
return flog
|
|
|
},
|
|
|
handleSelectionChange(val) {
|
|
|
- console.log("选中了====", val)
|
|
|
+ // console.log("选中了====", val)
|
|
|
this.multipleSelection = val;
|
|
|
},
|
|
|
getPerFormList(data) {
|
|
|
let list = []
|
|
|
- this.perFormList.forEach((item,index)=>{
|
|
|
- if(item.priceDate && item.priceDate.indexOf(data.day) != -1) {
|
|
|
+ this.perFormList.forEach((item, index) => {
|
|
|
+ if (item.priceDate && item.priceDate.indexOf(data.day) != -1) {
|
|
|
list = [
|
|
|
- { title: '市场价', money: item.originalAmount + '元' },
|
|
|
+ { title: '市场价', money: item.originalAmount + '元' },
|
|
|
{ title: '销售价', money: item.saleAmount + '元' },
|
|
|
{ title: '结算价', money: item.costAmount + '元' },
|
|
|
]
|
|
|
@@ -456,19 +481,19 @@ export default {
|
|
|
return list
|
|
|
},
|
|
|
/** 打开价格设置 */
|
|
|
- openCalendarPrice(){
|
|
|
- if( this.timeValueObj.prev && this.timeValueObj.next ) {
|
|
|
+ openCalendarPrice() {
|
|
|
+ if (this.timeValueObj.prev && this.timeValueObj.next) {
|
|
|
this.openPrice = true
|
|
|
this.formPrice = {}
|
|
|
- this.$nextTick(()=>{
|
|
|
+ this.$nextTick(() => {
|
|
|
this.$refs.formPrice.clearValidate()
|
|
|
})
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
this.$message.error("请选择时间区间!!!");
|
|
|
}
|
|
|
-
|
|
|
- },
|
|
|
- checkIsClear(){
|
|
|
+
|
|
|
+ },
|
|
|
+ checkIsClear() {
|
|
|
if (this.timeValueObj.prev && this.timeValueObj.next) {
|
|
|
let minTime = moment(this.timeValueObj.prev).valueOf()
|
|
|
let maxTime = moment(this.timeValueObj.next).valueOf()
|
|
|
@@ -481,26 +506,26 @@ export default {
|
|
|
startDate = this.timeValueObj.prev
|
|
|
endDate = this.timeValueObj.next
|
|
|
}
|
|
|
- this.$modal.confirm('确定要清空勾选"' + startDate + '——' + endDate + '"的日期范围内的数据吗?').then(()=> {
|
|
|
+ this.$modal.confirm('确定要清空勾选"' + startDate + '——' + endDate + '"的日期范围内的数据吗?').then(() => {
|
|
|
this.clearCalendarPrice()
|
|
|
- }).catch(() => {});
|
|
|
+ }).catch(() => { });
|
|
|
} else {
|
|
|
this.$message.error("请选择时间区间!!!");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
/** 一键清除 */
|
|
|
async clearCalendarPrice() {
|
|
|
try {
|
|
|
- if( this.timeValueObj.prev && this.timeValueObj.next ) {
|
|
|
+ if (this.timeValueObj.prev && this.timeValueObj.next) {
|
|
|
let minTime = moment(this.timeValueObj.prev).valueOf()
|
|
|
let maxTime = moment(this.timeValueObj.next).valueOf()
|
|
|
let startDate = null
|
|
|
let endDate = null
|
|
|
- if(minTime > maxTime){
|
|
|
+ if (minTime > maxTime) {
|
|
|
startDate = this.timeValueObj.next
|
|
|
endDate = this.timeValueObj.prev
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
startDate = this.timeValueObj.prev
|
|
|
endDate = this.timeValueObj.next
|
|
|
}
|
|
|
@@ -508,14 +533,14 @@ export default {
|
|
|
let SDate = moment(startDate);
|
|
|
let EDate = moment(endDate);
|
|
|
daysList.push({
|
|
|
- "priceDate": SDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
|
|
|
+ "priceDate": SDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
|
|
|
});
|
|
|
while (SDate.add(1, "days").isBefore(EDate)) { // 注意这里add方法处理后SDate对象已经改变。
|
|
|
daysList.push({
|
|
|
- "priceDate": SDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
|
|
|
+ "priceDate": SDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
|
|
|
});
|
|
|
}
|
|
|
- if(this.timeValueObj.next != this.timeValueObj.prev){
|
|
|
+ if (this.timeValueObj.next != this.timeValueObj.prev) {
|
|
|
daysList.push({
|
|
|
"priceDate": EDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
|
|
|
});
|
|
|
@@ -526,34 +551,34 @@ export default {
|
|
|
"seatTypeId": this.seatTypeId,
|
|
|
"data": daysList
|
|
|
})
|
|
|
- if(res.code == 200) {
|
|
|
+ if (res.code == 200) {
|
|
|
this.openPrice = false
|
|
|
this.$modal.msgSuccess(res.msg);
|
|
|
this.getCalendarPrice()
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
this.$message.error("请选择时间区间!!!");
|
|
|
}
|
|
|
} catch (error) {
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
- submitFormPrice(formName,funName) {
|
|
|
- this.$refs[formName].validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- this[funName]()
|
|
|
- } else {
|
|
|
- console.log('error submit!!');
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
+ submitFormPrice(formName, funName) {
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this[funName]()
|
|
|
+ } else {
|
|
|
+ console.log('error submit!!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
- openCalendarFun(row){
|
|
|
+ openCalendarFun(row) {
|
|
|
this.seatTypeId = row.seatTypeId
|
|
|
this.calendarId = row.id
|
|
|
- this.$set(this,'timeValue',new Date())
|
|
|
+ this.$set(this, 'timeValue', new Date())
|
|
|
this.getCalendarPrice()
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
/** 获取设置的日历价格 */
|
|
|
async getCalendarPrice() {
|
|
|
@@ -563,27 +588,27 @@ export default {
|
|
|
"goodsId": this.form.goodsId,
|
|
|
"seatTypeId": this.seatTypeId
|
|
|
})
|
|
|
- if(res.code == 200) {
|
|
|
+ if (res.code == 200) {
|
|
|
this.openCalendar = true
|
|
|
this.perFormList = res.data
|
|
|
}
|
|
|
} catch (error) {
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
/** 设置价格 */
|
|
|
- async calendarPrice(type){
|
|
|
+ async calendarPrice(type) {
|
|
|
try {
|
|
|
this.isLoading = true
|
|
|
- if( this.timeValueObj.prev && this.timeValueObj.next ) {
|
|
|
+ if (this.timeValueObj.prev && this.timeValueObj.next) {
|
|
|
let minTime = moment(this.timeValueObj.prev).valueOf()
|
|
|
let maxTime = moment(this.timeValueObj.next).valueOf()
|
|
|
let startDate = null
|
|
|
let endDate = null
|
|
|
- if(minTime > maxTime){
|
|
|
+ if (minTime > maxTime) {
|
|
|
startDate = this.timeValueObj.next
|
|
|
endDate = this.timeValueObj.prev
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
startDate = this.timeValueObj.prev
|
|
|
endDate = this.timeValueObj.next
|
|
|
}
|
|
|
@@ -591,34 +616,34 @@ export default {
|
|
|
let SDate = moment(startDate);
|
|
|
let EDate = moment(endDate);
|
|
|
daysList.push({
|
|
|
- "id": null,
|
|
|
- "priceDate": SDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
|
|
|
- "originalAmount": this.formPrice.originalAmount,
|
|
|
- "saleAmount": this.formPrice.saleAmount,
|
|
|
- "costAmount": this.formPrice.costAmount
|
|
|
- });
|
|
|
+ "id": null,
|
|
|
+ "priceDate": SDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
|
|
|
+ "originalAmount": this.formPrice.originalAmount,
|
|
|
+ "saleAmount": this.formPrice.saleAmount,
|
|
|
+ "costAmount": this.formPrice.costAmount
|
|
|
+ });
|
|
|
while (SDate.add(1, "days").isBefore(EDate)) { // 注意这里add方法处理后SDate对象已经改变。
|
|
|
daysList.push({
|
|
|
"id": null,
|
|
|
- "priceDate": SDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
|
|
|
+ "priceDate": SDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
|
|
|
"originalAmount": this.formPrice.originalAmount,
|
|
|
"saleAmount": this.formPrice.saleAmount,
|
|
|
"costAmount": this.formPrice.costAmount
|
|
|
});
|
|
|
}
|
|
|
- if(this.timeValueObj.next != this.timeValueObj.prev){
|
|
|
+ if (this.timeValueObj.next != this.timeValueObj.prev) {
|
|
|
daysList.push({
|
|
|
- "id": null,
|
|
|
+ "id": null,
|
|
|
"priceDate": EDate.startOf('day').format("YYYY-MM-DD HH:mm:ss"),
|
|
|
"originalAmount": this.formPrice.originalAmount,
|
|
|
"saleAmount": this.formPrice.saleAmount,
|
|
|
"costAmount": this.formPrice.costAmount
|
|
|
});
|
|
|
}
|
|
|
- console.log("daysList===",daysList)
|
|
|
- daysList.forEach((item,index)=>{
|
|
|
- this.perFormList.forEach((item1,index1)=>{
|
|
|
- if(moment(item.priceDate).format("YYYY-MM-DD") == moment(item1.priceDate).format("YYYY-MM-DD") ) {
|
|
|
+ // console.log("daysList===", daysList)
|
|
|
+ daysList.forEach((item, index) => {
|
|
|
+ this.perFormList.forEach((item1, index1) => {
|
|
|
+ if (moment(item.priceDate).format("YYYY-MM-DD") == moment(item1.priceDate).format("YYYY-MM-DD")) {
|
|
|
daysList[index].id = item1.id
|
|
|
}
|
|
|
})
|
|
|
@@ -629,20 +654,20 @@ export default {
|
|
|
"seatTypeId": this.seatTypeId,
|
|
|
"data": daysList
|
|
|
})
|
|
|
- if(res.code == 200) {
|
|
|
+ if (res.code == 200) {
|
|
|
this.openPrice = false
|
|
|
this.isLoading = false
|
|
|
this.getCalendarPrice()
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
this.$message.error("请选择时间区间!!!");
|
|
|
this.isLoading = false
|
|
|
}
|
|
|
} catch (error) {
|
|
|
this.isLoading = false
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
|
|
|
/** 选中得时间 */
|
|
|
@@ -650,31 +675,31 @@ export default {
|
|
|
let srt = ''
|
|
|
let newTime = moment(data.day).startOf('day').valueOf()
|
|
|
let newTime1 = moment().startOf('day').valueOf()
|
|
|
- if(newTime < newTime1 ) {
|
|
|
+ if (newTime < newTime1) {
|
|
|
return "disable_time"
|
|
|
}
|
|
|
- if( this.timeValueObj ) {
|
|
|
- if( this.timeValueObj.prev && this.timeValueObj.next ) {
|
|
|
+ if (this.timeValueObj) {
|
|
|
+ if (this.timeValueObj.prev && this.timeValueObj.next) {
|
|
|
let minTime = moment(this.timeValueObj.prev).valueOf()
|
|
|
let maxTime = moment(this.timeValueObj.next).valueOf()
|
|
|
- if(minTime > maxTime){
|
|
|
- if(minTime >= newTime && maxTime <= newTime){
|
|
|
+ if (minTime > maxTime) {
|
|
|
+ if (minTime >= newTime && maxTime <= newTime) {
|
|
|
srt = 'is-select_time'
|
|
|
}
|
|
|
- }else {
|
|
|
- if(minTime <= newTime && maxTime >= newTime){
|
|
|
+ } else {
|
|
|
+ if (minTime <= newTime && maxTime >= newTime) {
|
|
|
srt = 'is-select_time'
|
|
|
}
|
|
|
}
|
|
|
- }else if( this.timeValueObj.prev && !this.timeValueObj.next && this.timeValueObj.hover ){
|
|
|
+ } else if (this.timeValueObj.prev && !this.timeValueObj.next && this.timeValueObj.hover) {
|
|
|
let minTime = moment(this.timeValueObj.prev).valueOf()
|
|
|
let maxTime = moment(this.timeValueObj.hover).valueOf()
|
|
|
- if(minTime > maxTime){
|
|
|
- if(minTime >= newTime && maxTime <= newTime){
|
|
|
+ if (minTime > maxTime) {
|
|
|
+ if (minTime >= newTime && maxTime <= newTime) {
|
|
|
srt = 'is-select_time_hover'
|
|
|
}
|
|
|
- }else {
|
|
|
- if(minTime <= newTime && maxTime >= newTime){
|
|
|
+ } else {
|
|
|
+ if (minTime <= newTime && maxTime >= newTime) {
|
|
|
srt = 'is-select_time_hover'
|
|
|
}
|
|
|
}
|
|
|
@@ -685,31 +710,31 @@ export default {
|
|
|
clickTimeFun(data) {
|
|
|
let newTime1 = moment(data.day).startOf('day').valueOf()
|
|
|
let newTime = moment().startOf('day').valueOf()
|
|
|
- if(newTime1 < newTime ) {
|
|
|
- return
|
|
|
+ if (newTime1 < newTime) {
|
|
|
+ return
|
|
|
}
|
|
|
- if(moment(data.day).format("YYYY-MM") != moment(this.timeValue).format("YYYY-MM") ) {
|
|
|
+ if (moment(data.day).format("YYYY-MM") != moment(this.timeValue).format("YYYY-MM")) {
|
|
|
return
|
|
|
}
|
|
|
- if( !this.timeValueObj || !this.timeValueObj.prev ) {
|
|
|
+ if (!this.timeValueObj || !this.timeValueObj.prev) {
|
|
|
this.timeValueObj.prev = moment(data.day).format("YYYY-MM-DD")
|
|
|
- }else if( this.timeValueObj.prev && !this.timeValueObj.next ){
|
|
|
+ } else if (this.timeValueObj.prev && !this.timeValueObj.next) {
|
|
|
this.timeValueObj.next = moment(data.day).format("YYYY-MM-DD")
|
|
|
- }else if( this.timeValueObj.prev && this.timeValueObj.next ) {
|
|
|
+ } else if (this.timeValueObj.prev && this.timeValueObj.next) {
|
|
|
this.timeValueObj.prev = moment(data.day).format("YYYY-MM-DD")
|
|
|
this.timeValueObj.next = null
|
|
|
}
|
|
|
},
|
|
|
mouseoverFun(data) {
|
|
|
- if(moment(data.day).format("YYYY-MM") != moment(this.timeValue).format("YYYY-MM") ) {
|
|
|
+ if (moment(data.day).format("YYYY-MM") != moment(this.timeValue).format("YYYY-MM")) {
|
|
|
return
|
|
|
}
|
|
|
- if( this.timeValueObj.prev && !this.timeValueObj.next ){
|
|
|
+ if (this.timeValueObj.prev && !this.timeValueObj.next) {
|
|
|
this.timeValueObj.hover = moment(data.day).format("YYYY-MM-DD")
|
|
|
this.timeValue = new Date(this.timeValueObj.hover)
|
|
|
}
|
|
|
},
|
|
|
- showDate(){
|
|
|
+ showDate() {
|
|
|
let srt = ''
|
|
|
let minTime = moment(this.timeValueObj.prev).valueOf()
|
|
|
let maxTime = moment(this.timeValueObj.next).valueOf()
|
|
|
@@ -725,8 +750,8 @@ export default {
|
|
|
return startDate + "至" + endDate
|
|
|
}
|
|
|
},
|
|
|
- watch:{
|
|
|
- timeValue(newValue,oldValue){
|
|
|
+ watch: {
|
|
|
+ timeValue(newValue, oldValue) {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
@@ -739,26 +764,32 @@ export default {
|
|
|
max-height: 65vh;
|
|
|
overflow-y: auto;
|
|
|
}
|
|
|
+
|
|
|
.dialog {
|
|
|
padding: 0 30px;
|
|
|
+
|
|
|
.upload-btn {
|
|
|
width: 100px;
|
|
|
height: 100px;
|
|
|
background-color: #fbfdff;
|
|
|
border: dashed 1px #c0ccda;
|
|
|
border-radius: 5px;
|
|
|
+
|
|
|
i {
|
|
|
font-size: 30px;
|
|
|
margin-top: 20px;
|
|
|
}
|
|
|
+
|
|
|
&-text {
|
|
|
margin-top: -10px;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.avatar {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.calendar-dialog ::v-deep .el-calendar-table .el-calendar-day {
|
|
|
padding: none !important;
|
|
|
height: auto;
|
|
|
@@ -775,10 +806,10 @@ export default {
|
|
|
}
|
|
|
|
|
|
.is-select_time {
|
|
|
- background-color: rgba(30,144,255,0.8);
|
|
|
+ background-color: rgba(30, 144, 255, 0.8);
|
|
|
}
|
|
|
|
|
|
.is-select_time_hover {
|
|
|
- background-color: rgba(30,144,255,0.4);
|
|
|
+ background-color: rgba(30, 144, 255, 0.4);
|
|
|
}
|
|
|
</style>
|