Commit b57580b8 by zhangmengjie

23.4.7j接口对接

parent 0a0537ad
...@@ -71,4 +71,60 @@ export function articlePUT(data) { ...@@ -71,4 +71,60 @@ export function articlePUT(data) {
method: 'put', method: 'put',
data: data data: data
}) })
}
// 报表导出
export function exportReportFormsPOST(data) {
return request({
url: '/xinrenli/order/exportReportForms',
method: 'post',
data: data
})
}
// 报表接口
export function reportFormsGET(query) {
return request({
url: '/xinrenli/order/reportForms',
method: 'get',
params: query
})
}
// 营销活动列表
export function couponGET(query) {
return request({
url: '/xinrenli/coupon/list',
method: 'get',
params: query
})
}
// 新增优惠卷
export function couponPOST(data) {
return request({
url: '/xinrenli/coupon',
method: 'post',
data: data
})
}
// 删除优惠卷
export function coupontGET(query) {
return request({
url: `/xinrenli/coupon/${query}`,
method: 'get',
// params: query
})
}
// 优惠卷详情
export function coupontsGET(query) {
return request({
url: `/xinrenli/coupon/${query}`,
method: 'get',
// params: query
})
}
//优惠卷修改
export function couponlePUT(data) {
return request({
url: '/xinrenli/coupon',
method: 'put',
data: data
})
} }
\ No newline at end of file
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
label-width="100px" label-width="100px"
class="demo-form" class="demo-form"
> >
<el-form-item label="券类型" prop="region"> <el-form-item label="券类型" prop="couponType">
<el-select v-model="form.region" placeholder="请选择"> <el-select v-model="form.couponType" placeholder="请选择">
<el-option <el-option
v-for="item in activeAreaList" v-for="item in activeAreaList"
:key="item.value" :key="item.value"
...@@ -24,45 +24,47 @@ ...@@ -24,45 +24,47 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="优惠内容" prop="content"> <el-form-item label="优惠内容" prop="fullSubtraction">
<div class="d-flex a-center custom-input"> <div class="d-flex a-center custom-input">
<div class="margin-right">减免</div> <div class="margin-right">减免</div>
<el-input <el-input
class="flex-1"
type="number" type="number"
class="delInput flex-1"
min="1" min="1"
placeholder="减免金额>0且<99999" placeholder="减免金额>0且<99999"
v-model="form.content" v-model="form.fullSubtraction"
> >
</el-input> </el-input>
<div class="margin-left"></div> <div class="margin-left"></div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="优惠门槛" prop="content"> <el-form-item label="优惠门槛" prop="minUsed">
<div class="d-flex a-center custom-input"> <div class="d-flex a-center custom-input">
<div class="margin-right">最低消费,满</div> <div class="margin-right">最低消费,满</div>
<el-input <el-input
class="flex-1"
type="number" type="number"
class="delInput flex-1"
min="0" min="0"
v-model="form.content" v-model="form.minUsed"
/> />
<div class="margin-left">元,可用</div> <div class="margin-left">元,可用</div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="生效时间" prop="startTime"> <el-form-item label="生效时间" prop="effectiveTime">
<el-date-picker <el-date-picker
v-model="form.startTime" v-model="form.effectiveTime"
type="date" type="date"
placeholder="选择日期" placeholder="选择日期"
value-format="yyyy-MM-dd"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="失效时间" prop="endTime"> <el-form-item label="失效时间" prop="failureTime">
<el-date-picker <el-date-picker
v-model="form.endTime" v-model="form.failureTime"
type="date" type="date"
placeholder="选择日期" placeholder="选择日期"
value-format="yyyy-MM-dd"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
...@@ -76,6 +78,8 @@ ...@@ -76,6 +78,8 @@
</template> </template>
<script> <script>
import { coupontsGET} from '@/api/orderform/index'
export default { export default {
props: { props: {
dialogVisible: { dialogVisible: {
...@@ -91,42 +95,36 @@ export default { ...@@ -91,42 +95,36 @@ export default {
width: "30%", width: "30%",
value1: "", value1: "",
form: { form: {
region: "", couponType: "", // 卷类型
content: "", fullSubtraction: "", // 减免
startTime: "", minUsed: "", // 最低消费
endTime: "", effectiveTime: '', // 生效时间
failureTime:'', // 失效时间
}, },
rules: { rules: {
content: [ fullSubtraction: [
{ required: true, message: "请输入优惠内容", trigger: "blur" }, { required: true, message: "请输入优惠内容", trigger: "blur" },
], ],
region: [ couponType: [
{ required: true, message: "请选择活动区域", trigger: "change" }, { required: true, message: "请选择劵类型", trigger: "change" },
],
minUsed: [
{ required: true, message: "请选择优惠门槛", trigger: "change" },
], ],
startTime: [ effectiveTime: [
{ { type: 'string', required: true, message: '请选择日期', trigger: 'change' }
type: "date",
required: true,
message: "请选择日期",
trigger: "change",
},
], ],
endTime: [ failureTime: [
{ { type: 'string', required: true, message: '请选择日期', trigger: 'change' }
type: "date",
required: true,
message: "请选择日期",
trigger: "change",
},
], ],
}, },
activeAreaList: [ activeAreaList: [
{ {
value: "新用户券", value: "1",
label: "新用户券", label: "新用户券",
}, },
{ {
value: "满减券", value: "0",
label: "满减券", label: "满减券",
}, },
], ],
...@@ -137,6 +135,13 @@ export default { ...@@ -137,6 +135,13 @@ export default {
handleCancle() { handleCancle() {
this.$emit("cancle"); this.$emit("cancle");
}, },
couponts(val){
coupontsGET(val).then((res)=>{
if(res.code == 200){
this.form = res.data
}
})
},
onSubmit() { onSubmit() {
let that = this; let that = this;
that.$refs.form.validate((valid) => { that.$refs.form.validate((valid) => {
...@@ -152,6 +157,15 @@ export default { ...@@ -152,6 +157,15 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .delInput input::-webkit-outer-spin-button,
::v-deep .delInput input::-webkit-inner-spin-button {
-webkit-appearance: none !important;
}
::v-deep .delInput input[type="number"] {
-moz-appearance: textfield;
}
.description { .description {
font-size: 25px; font-size: 25px;
margin-top: 10px; margin-top: 10px;
......
...@@ -2,82 +2,44 @@ ...@@ -2,82 +2,44 @@
<div class="app-container"> <div class="app-container">
<el-form ref="queryForm" size="small" :inline="true" label-width="94px"> <el-form ref="queryForm" size="small" :inline="true" label-width="94px">
<el-form-item> <el-form-item>
<el-button <el-button type="primary" icon="el-icon-circle-plus-outline" size="mini" @click="handleAdd">添加优惠券</el-button>
type="primary"
icon="el-icon-circle-plus-outline"
size="mini"
@click="handleAdd"
>添加优惠券</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table :data="tableData" border style="width: 100%"> <el-table :data="tableData" border style="width: 100%">
<el-table-column type="index" width="50" label="序号" align="center"> <el-table-column type="index" width="50" label="序号" align="center">
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="couponType" label="券类型" :show-overflow-tooltip="true" align="center">
prop="city"
label="券类型"
:show-overflow-tooltip="true"
align="center"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="fullSubtraction" label="优惠内容" :show-overflow-tooltip="true" align="center">
prop="name"
label="优惠内容"
:show-overflow-tooltip="true"
align="center"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="minUsed" label="使用门槛" :show-overflow-tooltip="true" align="center">
prop="province"
label="使用门槛"
:show-overflow-tooltip="true"
align="center"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="effectiveTime" label="生效时间" :show-overflow-tooltip="true" align="center">
prop="date"
label="生效时间"
:show-overflow-tooltip="true"
align="center"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="failureTime" label="失效时间" :show-overflow-tooltip="true" align="center">
prop="date"
label="失效时间"
:show-overflow-tooltip="true"
align="center"
>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="150" align="center"> <el-table-column label="操作" width="150" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="modify(scope.row, '1')" <el-button type="text" size="small" @click="modify(scope.row, '1')">修改</el-button>
>修改</el-button <el-button type="text" size="small" @click="clickDel(scope.row)">删除</el-button>
> <el-button type="text" size="small" @click="modify(scope.row, '2')">详情</el-button>
<el-button type="text" size="small">删除</el-button>
<el-button type="text" size="small" @click="modify(scope.row, '2')"
>详情</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" /> @pagination="getList" />
<!-- 弹出框 --> <!-- 弹出框 -->
<dialogFile <dialogFile :dialogVisible="dialogVisible" :title="title" @cancle="handleCancleDialog" @onSubmit="handleSave"
:dialogVisible="dialogVisible" :isEdit="isEdit" ref="refDialogFile"></dialogFile>
:title="title"
@cancle="handleCancleDialog"
@onSubmit="handleSave"
:isEdit="isEdit"
></dialogFile>
</div> </div>
</template> </template>
<script> <script>
import dialogFile from "./components/detailFile.vue"; import dialogFile from "./components/detailFile.vue";
import { couponGET, couponPOST, coupontGET,couponlePUT } from '@/api/orderform/index'
export default { export default {
name: "orderform", name: "orderform",
components: { dialogFile }, components: { dialogFile },
...@@ -85,76 +47,102 @@ export default { ...@@ -85,76 +47,102 @@ export default {
return { return {
dialogVisible: false, dialogVisible: false,
control: "0", control: "0",
total: 5, total: 0,
title: "添加优惠券", title: "添加优惠券",
queryParams: { queryParams: {
pageNum: 0, pageNum: 0,
pageSize: 10, pageSize: 10,
}, },
value: "", value: "",
tableData: [ tableData: [],
{ isEdit: true,//判断添加修改详情的保存按钮是否显示
date: "2016-05-02",
name: "王小虎",
province: "上海",
city: "普陀区",
address: "上海市普陀区金沙江路 1518 弄",
},
{
date: "2016-05-04",
name: "王小虎",
province: "上海",
city: "普陀区",
address: "上海市普陀区金沙江路 1517 弄",
},
{
date: "2016-05-01",
name: "王小虎",
province: "上海",
city: "普陀区",
address: "上海市普陀区金沙江路 1519 弄",
},
{
date: "2016-05-03",
name: "王小虎",
province: "上海",
city: "普陀区",
address: "上海市普陀区金沙江路 1516 弄",
},
],
isEdit:true,//判断添加修改详情的保存按钮是否显示
}; };
}, },
created() {}, created() {
this.coupon()
},
methods: { methods: {
coupon() {
couponGET({ ...this.queryParams }).then((res) => {
this.tableData = res.rows
this.total = res.total
})
},
// 页码切换 // 页码切换
getList() {}, getList() {
this.coupon()
},
handleAdd() { handleAdd() {
let that = this; let that = this;
that.title = "添加优惠券"; that.title = "添加优惠券";
that.isEdit = true that.isEdit = true
that.dialogVisible = true; that.dialogVisible = true;
}, },
clickDel(val) {
coupontGET(val.id).then((res) => {
if (res.code == 200) {
this.$message({
message: '删除成功!',
type: 'success'
});
this.coupon()
}
})
},
// 修改详情 // 修改详情
modify(sta, type) { modify(sta, type) {
let that = this; let that = this;
if (type == "1") { if (type == "1") {
that.title = "修改优惠券"; that.title = "修改优惠券";
this.$refs['refDialogFile'].couponts(sta.id)
that.isEdit = true that.isEdit = true
} else if (type == "2") { } else if (type == "2") {
this.$refs['refDialogFile'].couponts(sta.id)
that.title = "查看优惠券"; that.title = "查看优惠券";
that.isEdit = false that.isEdit = false
} }
that.dialogVisible = true; that.dialogVisible = true;
}, },
//保存 //保存
handleSave(e){ handleSave(e) {
console.log('表单值',e) console.log('表单值', e)
if (this.title == "添加优惠券") {
couponPOST({ ...e }).then((res) => {
if (res.code == 200) {
this.$refs['refDialogFile'].form.couponType = ''
this.$refs['refDialogFile'].form.fullSubtraction = ''
this.$refs['refDialogFile'].form.minUsed = ''
this.$refs['refDialogFile'].form.effectiveTime = ''
this.$refs['refDialogFile'].form.failureTime = ''
this.dialogVisible = false;
this.coupon()
}
})
}else if(this.title == "修改优惠券"){
couponlePUT({ ...e }).then((res)=>{
if (res.code == 200) {
this.$refs['refDialogFile'].form.couponType = ''
this.$refs['refDialogFile'].form.fullSubtraction = ''
this.$refs['refDialogFile'].form.minUsed = ''
this.$refs['refDialogFile'].form.effectiveTime = ''
this.$refs['refDialogFile'].form.failureTime = ''
this.dialogVisible = false;
this.coupon()
}
})
}
}, },
// 其他 弹窗关闭 // 其他 弹窗关闭
handleCancleDialog() { handleCancleDialog() {
this.$refs['refDialogFile'].form.couponType = ''
this.$refs['refDialogFile'].form.fullSubtraction = ''
this.$refs['refDialogFile'].form.minUsed = ''
this.$refs['refDialogFile'].form.effectiveTime = ''
this.$refs['refDialogFile'].form.failureTime = ''
this.dialogVisible = false; this.dialogVisible = false;
}, },
}, },
}; };
</script> </script>
+
\ No newline at end of file
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<span>图片说明</span> <span>图片说明</span>
<div style="display: flex;"> <div style="display: flex;">
<div class="imgdiv" v-for="v in particulars.pictureList"> <div class="imgdiv" v-for="v in particulars.pictureList">
<el-image class="imgdiv-img" :src="v.url" :preview-src-list="srcList"> <el-image class="imgdiv-img" :src="v.url" >
</el-image> </el-image>
</div> </div>
</div> </div>
...@@ -87,10 +87,10 @@ export default { ...@@ -87,10 +87,10 @@ export default {
return { return {
width: '30%', width: '30%',
url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
srcList: [ // srcList: [
'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg', // 'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg' // 'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg'
], // ],
value1: '', value1: '',
form: { form: {
name: '', name: '',
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
</el-card> </el-card>
</el-col> </el-col>
<el-col :span="12" class="card-box"> <el-col :span="12" class="card-box">
<el-button type="primary" size="medium ">导出报表</el-button> <el-button type="primary" size="medium " @click="clickStatement">导出报表</el-button>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
...@@ -53,6 +53,8 @@ ...@@ -53,6 +53,8 @@
<script> <script>
import { getCache } from "@/api/monitor/cache"; import { getCache } from "@/api/monitor/cache";
import * as echarts from "echarts"; import * as echarts from "echarts";
import { reportFormsGET} from '@/api/orderform/index'
export default { export default {
name: "Cache", name: "Cache",
...@@ -63,7 +65,7 @@ export default { ...@@ -63,7 +65,7 @@ export default {
// 使用内存 // 使用内存
usedmemory: null, usedmemory: null,
// cache信息 // cache信息
cache: [] cache: {}
} }
}, },
created() { created() {
...@@ -71,9 +73,13 @@ export default { ...@@ -71,9 +73,13 @@ export default {
this.openLoading(); this.openLoading();
}, },
methods: { methods: {
//导出报表
clickStatement(){
this.download('/xinrenli/order/exportReportForms', { }, `role_${new Date().getTime()}.xlsx`)
},
/** 查缓存询信息 */ /** 查缓存询信息 */
getList() { getList() {
getCache().then((response) => { reportFormsGET().then((response) => {
this.cache = response.data; this.cache = response.data;
this.$modal.closeLoading(); this.$modal.closeLoading();
...@@ -107,7 +113,7 @@ export default { ...@@ -107,7 +113,7 @@ export default {
show: false show: false
}, },
data: [ data: [
{ value: 300, name: 'Video Ads' } { value: 300, name: '累计成交额' }
] ]
} }
] ]
......
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