Commit 07e51137 authored by zhengke's avatar zhengke

修改

parent 45b27315
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
<div class="col-2 Sysuser_Date"> <div class="col-2 Sysuser_Date">
<q-field filled dense> <q-field filled dense>
 <template v-slot:control>  <template v-slot:control>
<el-date-picker v-model="msg.StartTime" size="mini" style="width:100%" type="date" placeholder="选择开始日期" <el-date-picker v-model="msg.StartTime" size="mini" style="width:100%" :clearable="false" type="date"
value-format="yyyy-MM-dd" @change="resetSearch"> placeholder="选择开始日期" value-format="yyyy-MM-dd" @change="resetSearch">
</el-date-picker>     </el-date-picker>    
</template> </template>
</q-field> </q-field>
...@@ -22,19 +22,19 @@ ...@@ -22,19 +22,19 @@
<div class="col-2"> <div class="col-2">
<q-field filled dense> <q-field filled dense>
 <template v-slot:control>  <template v-slot:control>
<el-date-picker v-model="msg.EndTime" size="mini" style="width:100%" type="date" placeholder="选择结束日期" <el-date-picker v-model="msg.EndTime" size="mini" style="width:100%" :clearable="false" type="date"
value-format="yyyy-MM-dd" @change="resetSearch"> placeholder="选择结束日期" value-format="yyyy-MM-dd" @change="resetSearch">
</el-date-picker>     </el-date-picker>    
</template> </template>
</q-field> </q-field>
</div> </div>
<div class="col-2" style="display:flex;align-items:center;"> <div class="col-2">
<q-radio dense v-model="msg.Type" style="margin-right:20px;" @input="resetSearch" :val="1" label="存入" /> <q-select stack-label color="primary" dense filled label="消费类型" option-value="Id" option-label="Name"
<q-radio dense v-model="msg.Type" :val="2" label="消费" @input="resetSearch" /> :options="TypeList" v-model="msg.Type" @input="resetSearch" emit-value map-options />
</div> </div>
<div class="col-3" style="display:flex;align-items:center;"> <div class="col-3">
<q-radio dense v-model="msg.BuyType" style="margin-right:20px;" @input="resetSearch" :val="1" label="免费的" /> <q-select stack-label color="primary" dense filled label="使用类型" option-value="Id" option-label="Name"
<q-radio dense v-model="msg.BuyType" :val="2" label="使用购买的" @input="resetSearch" /> :options="BuyTypeList" v-model="msg.BuyType" @input="resetSearch" emit-value map-options />
</div> </div>
</div> </div>
</div> </div>
...@@ -45,8 +45,8 @@ ...@@ -45,8 +45,8 @@
<div class="col-2 q-table__title">咖啡劵详情</div> <div class="col-2 q-table__title">咖啡劵详情</div>
<q-space /> <q-space />
<div class="page-option"> <div class="page-option">
<q-btn color="accent" class="q-mr-md" size="sm" icon="download" style="margin-top:15px;" label="下载" <q-btn color="accent" class="q-mr-md" v-if="isShowDown" size="sm" icon="download" style="margin-top:15px;"
@click="downloadStarBucks" /> label="下载" @click="downloadStarBucks" />
</div> </div>
</template> </template>
<template v-slot:body-cell-Type="props"> <template v-slot:body-cell-Type="props">
...@@ -68,15 +68,11 @@ ...@@ -68,15 +68,11 @@
<span v-if="props.row.EmpType==3">来宾</span> <span v-if="props.row.EmpType==3">来宾</span>
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-UserName="props"> <template v-slot:body-cell-UserIcon="props">
<q-td :props="props"> <q-td :props="props">
<q-avatar rounded size="sm" v-if="props.row.UserIcon"> <q-avatar rounded size="sm" v-if="props.row.UserIcon">
<img :src="props.row.UserIcon" /> <img :src="props.row.UserIcon" />
</q-avatar> </q-avatar>
<q-avatar rounded size="sm" color="teal-10" text-color="white" v-if="!props.row.UserIcon">
{{ props.row.UserName.substring(0, 1) }}
</q-avatar>
<span style="position:relative;top:2px;margin-left:2px;">{{ props.row.UserName }}</span>
</q-td> </q-td>
</template> </template>
<template v-slot:bottom> <template v-slot:bottom>
...@@ -101,34 +97,52 @@ ...@@ -101,34 +97,52 @@
rowsPerPage: 10, rowsPerPage: 10,
StartTime: '', StartTime: '',
EndTime: '', EndTime: '',
Type: 2, //1存入 2消费 Type: 0, //1存入 2消费
BuyType: 1 //使用类型 1免费的 2使用购买的 BuyType: 0 //使用类型 1免费的 2使用购买的
}, },
TypeList: [{
Id: 0,
Name: '不限'
}, {
Id: 1,
Name: '存入'
}, {
Id: 2,
Name: '消费'
}],
BuyTypeList: [{
Id: 0,
Name: '不限'
}, {
Id: 1,
Name: '免费的'
}, {
Id: 2,
Name: '使用购买的'
}],
pageCount: 0, pageCount: 0,
dataList: [], dataList: [],
loading: true, loading: true,
columns: [{ columns: [{
name: 'Type', name: 'UserName',
label: '类型', label: '用户名称',
field: 'Type', align: 'left',
align: 'left' field: 'UserName'
}, {
name: 'UserIcon',
label: '用户头像',
align: 'left',
field: 'UserIcon'
}, { }, {
name: 'BuyType', name: 'BuyType',
label: '使用类型', label: '使用类型',
field: 'BuyType', field: 'BuyType',
align: 'left' align: 'left'
}, }, {
{ name: 'Type',
name: 'Number', label: '消费类型',
label: '数量', field: 'Type',
align: 'left', align: 'left'
field: 'Number'
},
{
name: 'Remark',
label: '备注',
align: 'left',
field: 'Remark'
}, },
{ {
name: 'EmpType', name: 'EmpType',
...@@ -137,16 +151,22 @@ ...@@ -137,16 +151,22 @@
field: 'EmpType' field: 'EmpType'
}, },
{ {
name: 'UserName', name: 'EmpStuName',
label: '甲鹤用户名称', label: '员工/学员',
align: 'left', align: 'left',
field: 'UserName' field: 'EmpStuName'
}, },
{ {
name: 'EmpStuName', name: 'Number',
label: '学生姓名', label: '数量',
align: 'left', align: 'left',
field: 'EmpStuName' field: 'Number'
},
{
name: 'Remark',
label: '备注',
align: 'left',
field: 'Remark'
}, },
{ {
name: 'CreateByName', name: 'CreateByName',
...@@ -161,9 +181,21 @@ ...@@ -161,9 +181,21 @@
align: 'left' align: 'left'
} }
], ],
isShowDown: false
} }
}, },
watch: {
msg: {
handler(val) {
if (val) {
if (val.StartTime != '' && val.EndTime != '') {
this.isShowDown = true;
}
}
},
deep: true
},
},
mounted() { mounted() {
if (this.$route.query) { if (this.$route.query) {
if (this.$route.query.Type == 1) { if (this.$route.query.Type == 1) {
...@@ -248,19 +280,19 @@ ...@@ -248,19 +280,19 @@
downloadStarBucks() { downloadStarBucks() {
this.loading = true; this.loading = true;
var msg = JSON.parse(JSON.stringify(this.msg)); var msg = JSON.parse(JSON.stringify(this.msg));
var dt1 = msg.EndTime; var d1 = msg.StartTime;
var dt2 = msg.StartTime; var d2 = msg.EndTime;
if(dt1!=null&&dt2!=null){ if (d1 != null && d2 != null) {
dt1 = dt1.split('-'); var dd1 = new Date(d1);
dt1 = parseInt(dt1[0])*12 + parseInt(dt1[1]); var dd2 = new Date(d2);
dt2 = dt2.split('-'); var num = (dd2 - dd1) / (1000 * 60 * 60 * 24)
dt2 = parseInt(dt2[0])*12 + parseInt(dt2[1]); if (num > 30) {
var num = Math.abs(dt1-dt2); msg.EndTime = this.getNextMonth(msg.StartTime);
if(num>30){ }
msg.EndTime = this.getNextMonth(msg.StartTime);
}
} }
this.GetLocalFileDS("/api/Coffee/GetCoffeeCouponsListToExcel", {...msg}, "咖啡详情统计.xls") this.GetLocalFileDS("/api/Coffee/GetCoffeeCouponsListToExcel", {
...msg
}, "咖啡详情统计.xls")
this.loading = false; this.loading = false;
} }
} }
......
...@@ -196,12 +196,6 @@ ...@@ -196,12 +196,6 @@
align: 'left', align: 'left',
field: row => row.CList field: row => row.CList
}, },
{
name: 'EmpBuyNum',
label: '员工购买',
align: 'left',
field: row => row.CList
},
{ {
name: 'EmpFreeNum', name: 'EmpFreeNum',
label: '员工赠送', label: '员工赠送',
...@@ -209,8 +203,8 @@ ...@@ -209,8 +203,8 @@
field: row => row.CList field: row => row.CList
}, },
{ {
name: 'StuBuyNum', name: 'EmpBuyNum',
label: '学员购买', label: '员工购买',
align: 'left', align: 'left',
field: row => row.CList field: row => row.CList
}, },
...@@ -221,8 +215,8 @@ ...@@ -221,8 +215,8 @@
field: row => row.CList field: row => row.CList
}, },
{ {
name: 'LBBuyNum', name: 'StuBuyNum',
label: '来宾购买', label: '学员购买',
align: 'left', align: 'left',
field: row => row.CList field: row => row.CList
}, },
...@@ -232,6 +226,12 @@ ...@@ -232,6 +226,12 @@
align: 'left', align: 'left',
field: row => row.CList field: row => row.CList
}, },
{
name: 'LBBuyNum',
label: '来宾购买',
align: 'left',
field: row => row.CList
},
{ {
name: 'Income', name: 'Income',
label: '当日收款', label: '当日收款',
...@@ -311,14 +311,10 @@ ...@@ -311,14 +311,10 @@
}, },
//跳转详情 //跳转详情
goDetail(obj) { goDetail(obj) {
console.log(obj); this.OpenNewUrl('/administration/starBucks/starBucksDetail', {
this.$router.push({ Date: obj.value,
path: '/administration/starBucks/starBucksDetail', Type: this.msg.SelectType
query: { })
Date: obj.value,
Type: this.msg.SelectType
},
});
}, },
//查询条件改变 //查询条件改变
resetSearch() { resetSearch() {
...@@ -328,7 +324,9 @@ ...@@ -328,7 +324,9 @@
downloadStarBucks() { downloadStarBucks() {
this.loading = true; this.loading = true;
var msg = JSON.parse(JSON.stringify(this.msg)); var msg = JSON.parse(JSON.stringify(this.msg));
this.GetLocalFileDS("/api/Coffee/GetCoffeeStatisticsToExcel", {...this.msg}, "咖啡数据统计.xls") this.GetLocalFileDS("/api/Coffee/GetCoffeeStatisticsToExcel", {
...this.msg
}, "咖啡数据统计.xls")
this.loading = false; this.loading = false;
} }
} }
......
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