|
@@ -4,6 +4,17 @@
|
|
|
<div class="table-page-search-wrapper">
|
|
<div class="table-page-search-wrapper">
|
|
|
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
|
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
|
|
<a-row :gutter="24">
|
|
<a-row :gutter="24">
|
|
|
|
|
+ <a-col :md="4" :sm="6">
|
|
|
|
|
+ <a-form-item>
|
|
|
|
|
+ <j-input placeholder="名称" v-model="queryParam.name" ></j-input>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ <a-col :md="4" :sm="6">
|
|
|
|
|
+ <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
|
|
|
|
+ <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
|
|
|
|
+ <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </a-col>
|
|
|
</a-row>
|
|
</a-row>
|
|
|
</a-form>
|
|
</a-form>
|
|
|
</div>
|
|
</div>
|
|
@@ -50,16 +61,20 @@
|
|
|
<template slot="htmlSlot" slot-scope="text">
|
|
<template slot="htmlSlot" slot-scope="text">
|
|
|
<div v-html="text"></div>
|
|
<div v-html="text"></div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+ <span slot="switchAutoSlot" slot-scope="text,record">
|
|
|
|
|
+ <a-switch checked-children="开启" un-checked-children="禁用"
|
|
|
|
|
+ default-checked :checked="text == 0" @change="e=>onAutoChange(e,record)" />
|
|
|
|
|
+ </span>
|
|
|
<span slot="switchSlot" slot-scope="text,record">
|
|
<span slot="switchSlot" slot-scope="text,record">
|
|
|
<a-switch checked-children="开启" un-checked-children="禁用"
|
|
<a-switch checked-children="开启" un-checked-children="禁用"
|
|
|
- default-checked :checked="text == 0" @change="e=>onAutoChange(e)" />
|
|
|
|
|
|
|
+ default-checked :checked="text == 0" @change="e=>onStatusChange(e,record)" />
|
|
|
</span>
|
|
</span>
|
|
|
<template slot="startSlot" slot-scope="text,record">
|
|
<template slot="startSlot" slot-scope="text,record">
|
|
|
<div style="display: flex;align-items: center">
|
|
<div style="display: flex;align-items: center">
|
|
|
<a-form style="width: 90%">
|
|
<a-form style="width: 90%">
|
|
|
<a-form-item prop="startTime" style="margin-bottom: 0px">
|
|
<a-form-item prop="startTime" style="margin-bottom: 0px">
|
|
|
<a-time-picker format="HH:mm" :minuteStep="5" :default-value="moment(text, 'HH:mm')"
|
|
<a-time-picker format="HH:mm" :minuteStep="5" :default-value="moment(text, 'HH:mm')"
|
|
|
- :allowClear="false" @change="onChange" />
|
|
|
|
|
|
|
+ :allowClear="false" @openChange="e=>onStartOpen(e,record)" @change="event=>onStartChange(event)" />
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-form>
|
|
</a-form>
|
|
|
<!-- <a-input v-model="text" placeholder="请输入关联号" @change="(e)=>handleNumber(e,record)" ></a-input>-->
|
|
<!-- <a-input v-model="text" placeholder="请输入关联号" @change="(e)=>handleNumber(e,record)" ></a-input>-->
|
|
@@ -71,7 +86,7 @@
|
|
|
<a-form-item prop="associationNumber" style="margin-bottom: 0px">
|
|
<a-form-item prop="associationNumber" style="margin-bottom: 0px">
|
|
|
<a-form-item prop="startTime" style="margin-bottom: 0px">
|
|
<a-form-item prop="startTime" style="margin-bottom: 0px">
|
|
|
<a-time-picker format="HH:mm" :minuteStep="5" :default-value="moment(text, 'HH:mm')"
|
|
<a-time-picker format="HH:mm" :minuteStep="5" :default-value="moment(text, 'HH:mm')"
|
|
|
- :allowClear="false" @change="onChange" />
|
|
|
|
|
|
|
+ :allowClear="false" @openChange="e=>onEndOpen(e,record)" @change="e=>onEndChange(e)" />
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-form>
|
|
</a-form>
|
|
@@ -98,20 +113,21 @@
|
|
|
<span slot="action" slot-scope="text, record">
|
|
<span slot="action" slot-scope="text, record">
|
|
|
<a @click="handleEdit(record)">编辑</a>
|
|
<a @click="handleEdit(record)">编辑</a>
|
|
|
|
|
|
|
|
- <a-divider type="vertical" />
|
|
|
|
|
- <a-dropdown>
|
|
|
|
|
- <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
|
|
|
|
|
- <a-menu slot="overlay">
|
|
|
|
|
- <a-menu-item>
|
|
|
|
|
- <a @click="handleDetail(record)">详情</a>
|
|
|
|
|
- </a-menu-item>
|
|
|
|
|
- <a-menu-item>
|
|
|
|
|
- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
|
|
|
|
- <a>删除</a>
|
|
|
|
|
- </a-popconfirm>
|
|
|
|
|
- </a-menu-item>
|
|
|
|
|
- </a-menu>
|
|
|
|
|
- </a-dropdown>
|
|
|
|
|
|
|
+<!-- <a-divider type="vertical" />-->
|
|
|
|
|
+<!-- <a-dropdown>-->
|
|
|
|
|
+<!-- <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>-->
|
|
|
|
|
+<!-- <a-menu slot="overlay">-->
|
|
|
|
|
+<!-- <a-menu-item>-->
|
|
|
|
|
+<!-- <a @click="handleDetail(record)">详情</a>-->
|
|
|
|
|
+<!-- </a-menu-item>-->
|
|
|
|
|
+<!-- <a-menu-item>-->
|
|
|
|
|
+<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
|
|
|
|
|
+<!-- <a>删除</a>-->
|
|
|
|
|
+<!-- </a-popconfirm>-->
|
|
|
|
|
+<!-- </a-menu-item>-->
|
|
|
|
|
+<!-- </a-menu>-->
|
|
|
|
|
+<!-- </a-dropdown>-->
|
|
|
|
|
+
|
|
|
</span>
|
|
</span>
|
|
|
|
|
|
|
|
</a-table>
|
|
</a-table>
|
|
@@ -128,6 +144,7 @@
|
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
|
import mealCouponModal from './modules/mealCouponModal'
|
|
import mealCouponModal from './modules/mealCouponModal'
|
|
|
import moment from 'moment';
|
|
import moment from 'moment';
|
|
|
|
|
+ import { httpAction, getAction } from '@/api/manage'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'mealCouponList',
|
|
name: 'mealCouponList',
|
|
@@ -152,7 +169,7 @@
|
|
|
// customRender:function (text) {
|
|
// customRender:function (text) {
|
|
|
// return text==1?'true':'false'
|
|
// return text==1?'true':'false'
|
|
|
// },
|
|
// },
|
|
|
- scopedSlots: { customRender: 'switchSlot' },
|
|
|
|
|
|
|
+ scopedSlots: { customRender: 'switchAutoSlot' },
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title:'是否启用',
|
|
title:'是否启用',
|
|
@@ -190,10 +207,12 @@
|
|
|
deleteBatch: "/business/busMealCoupon/deleteBatch",
|
|
deleteBatch: "/business/busMealCoupon/deleteBatch",
|
|
|
exportXlsUrl: "/business/busMealCoupon/exportXls",
|
|
exportXlsUrl: "/business/busMealCoupon/exportXls",
|
|
|
importExcelUrl: "business/busMealCoupon/importExcel",
|
|
importExcelUrl: "business/busMealCoupon/importExcel",
|
|
|
-
|
|
|
|
|
|
|
+ edit: "/business/busMealCoupon/edit",
|
|
|
},
|
|
},
|
|
|
dictOptions:{},
|
|
dictOptions:{},
|
|
|
superFieldList:[],
|
|
superFieldList:[],
|
|
|
|
|
+ startTime:'',
|
|
|
|
|
+ endTime:''
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -220,11 +239,69 @@
|
|
|
fieldList.push({type:'int',value:'delFlag',text:'删除状态(0-正常,1-已删除)'})
|
|
fieldList.push({type:'int',value:'delFlag',text:'删除状态(0-正常,1-已删除)'})
|
|
|
this.superFieldList = fieldList
|
|
this.superFieldList = fieldList
|
|
|
},
|
|
},
|
|
|
- onAutoChange(){
|
|
|
|
|
|
|
+ onAutoChange(e,record){
|
|
|
|
|
+ console.log(e)
|
|
|
|
|
+ console.log(record)
|
|
|
|
|
+ let data = { ...record }
|
|
|
|
|
+ if (e) {
|
|
|
|
|
+ data.automaticGrant = 0;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ data.automaticGrant = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.update(data)
|
|
|
|
|
+ },
|
|
|
|
|
+ onStatusChange(e,record){
|
|
|
|
|
+ console.log(e)
|
|
|
|
|
+ console.log(record)
|
|
|
|
|
+ let data = { ...record }
|
|
|
|
|
+ if (e) {
|
|
|
|
|
+ data.status = 0;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ data.status = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.update(data)
|
|
|
|
|
+ },
|
|
|
|
|
+ onStartOpen(e,record){
|
|
|
|
|
+ if (!e){
|
|
|
|
|
+ //关闭时间选择面板
|
|
|
|
|
+ let data = { ...record }
|
|
|
|
|
+ if (data.startTime != this.startTime){
|
|
|
|
|
+ data.startTime = this.startTime;
|
|
|
|
|
+ this.update(data)
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ onStartChange(e){
|
|
|
|
|
+ this.startTime = moment(new Date(e)).format('HH:mm:ss')
|
|
|
},
|
|
},
|
|
|
- onChange(){
|
|
|
|
|
|
|
+ onEndOpen(e,record){
|
|
|
|
|
+ if (!e){
|
|
|
|
|
+ //关闭时间选择面板
|
|
|
|
|
+ let data = { ...record }
|
|
|
|
|
+ if (data.endTime != this.endTime){
|
|
|
|
|
+ data.endTime = this.endTime;
|
|
|
|
|
+ this.update(data)
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ onEndChange(e){
|
|
|
|
|
+ this.endTime = moment(new Date(e)).format('HH:mm:ss')
|
|
|
|
|
+ },
|
|
|
|
|
+ update(data){
|
|
|
|
|
+ const that = this;
|
|
|
|
|
+ httpAction(this.url.edit, data, 'put').then((res) => {
|
|
|
|
|
+ if (res.success) {
|
|
|
|
|
+ that.$message.success(res.message);
|
|
|
|
|
+ that.$emit('ok');
|
|
|
|
|
+ that.loadData();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ that.$message.warning(res.message);
|
|
|
|
|
+ }
|
|
|
|
|
+ }).finally(() => {
|
|
|
|
|
+ that.confirmLoading = false;
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|