tianyi 3 days ago
parent
commit
151befbf9e
  1. 21
      src/api/app.js
  2. 268
      src/views/app/bill/current/current.vue
  3. 155
      src/views/app/business/bus/addEdit.vue
  4. 424
      src/views/app/business/bus/bus.vue
  5. 1
      src/views/login.vue

21
src/api/app.js

@ -187,20 +187,29 @@ export const deleteLogiticsCompany = (params) => {
return postRequest('/app/areas/delById', params)
}
export const getLogiticsCompanyData = (params) => {
return getRequest('/app/areas/listBySchoolId', params)
export const getCouponData = (params) => {
return postRequest('/mall/coupon/list', params)
}
export const getBillList = (params) => {
return postBodyRequest('/mall/admin/settlement/summaryList', params)
}
export const settlementConfirm = (params) => {
return postBodyRequest('/mall/admin/settlement/confirmByShop', params)
}
export const giveCoupon = (params) => {
return postRequest('/mall/coupon/send', params)
}
export const getAllLogiticsCompanyData = () => {
return getRequest('/app/logitics/getAll')
}
export const addLogiticsCompany = (params) => {
return postRequest('/app/areas/save', params)
export const addCoupon = (params) => {
return postBodyRequest('/mall/coupon/add', params)
}
export const editLogiticsCompany = (params) => {
return postRequest('/app/areas/edit', params)
export const editCoupon = (params) => {
return postBodyRequest('/mall/coupon/update', params)
}
//新增线路
export const addLogisticsRoute = (params) => {

268
src/views/app/bill/current/current.vue

@ -5,55 +5,19 @@
<template>
<div class="search">
<Card>
<Row v-show="openSearch" @keydown.enter.native="handleSearch">
<Row>
<Form ref="searchForm" :model="searchForm" inline :label-width="100">
<FormItem label="状态" prop="orderId">
<Select ref="dep" @on-change="checkStatus" clearable="true">
<Option v-for="(item, i) in dictData" :key="i" :value="item.value">{{
item.title
}}</Option>
</Select>
</FormItem>
<FormItem label="店铺名称" prop="shopName">
<Input type="text" v-model="searchForm.shopName" clearable placeholder="请输入公司名称"
style="width: 200px" />
<FormItem label="选择时间" prop="settlementDate">
<DatePicker @on-change="changeDate" type="date" placeholder="请选择时间" style="width: 200px" />
</FormItem>
<FormItem style="margin-left: -35px" class="br">
<Button @click="handleSearch" type="primary" icon="ios-search">搜索</Button>
<Button @click="handleReset">重置</Button>
<a class="drop-down" @click="dropDown">
{{ dropDownContent }}
<Icon :type="dropDownIcon"></Icon>
</a>
<Button @click="getDataList" type="primary" icon="ios-search">搜索</Button>
</FormItem>
</Form>
</Row>
<Row align="middle" justify="space-between" class="operation">
<div>
<Button @click="add" type="primary" icon="md-briefcase">一键结算</Button>
<Button @click="delAll" icon="ios-checkbox-outline">确认</Button>
<Button @click="delAll" icon="md-folder-open">结算</Button>
</div>
<div class="icons">
<Tooltip content="刷新" placement="top" transfer>
<Icon type="md-refresh" size="18" class="item" @click="getDataList" />
</Tooltip>
<Tooltip :content="openSearch ? '关闭搜索' : '开启搜索'" placement="top" transfer>
<Icon type="ios-search" size="18" class="item tip" @click="openSearch = !openSearch" />
</Tooltip>
<Tooltip :content="openTip ? '关闭提示' : '开启提示'" placement="top" transfer>
<Icon type="md-bulb" size="18" class="item tip" @click="openTip = !openTip" />
</Tooltip>
<Tooltip content="表格密度" placement="top" transfer>
<Dropdown @on-click="changeTableSize" trigger="click">
<Icon type="md-list" size="18" class="item" />
<DropdownMenu slot="list">
<DropdownItem :selected="tableSize == 'default'" name="default">默认</DropdownItem>
<DropdownItem :selected="tableSize == 'large'" name="large">宽松</DropdownItem>
<DropdownItem :selected="tableSize == 'small'" name="small">紧密</DropdownItem>
</DropdownMenu>
</Dropdown>
</Tooltip>
<Button @click="oneSettlement" icon="md-folder-open">结算</Button>
</div>
</Row>
<Alert show-icon v-show="openTip">
@ -61,51 +25,22 @@
<span class="select-count">{{ selectList.length }}</span>
<a class="select-clear" @click="clearSelectAll">清空</a>
</Alert>
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" sortable="custom"
@on-sort-change="changeSort" @on-selection-change="showSelect" ref="table"></Table>
<Row type="flex" justify="end" class="page">
<Table :loading="loading" border :columns="columns" :data="data"
@on-selection-change="allSelect" ref="table"></Table>
<!-- <Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize"
@on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
size="small" show-total show-elevator show-sizer></Page>
</Row>
</Row> -->
</Card>
<Modal :title="线路维护" v-model="Visiable" :mask-closable="false" :scrollabele="true" :width="1000">
<logistics-address v-if="Visiable" ref="dialog"></logistics-address>
<div slot="footer" v-show=Visiable>
<Button type="text" @click="Visiable = false">关闭</Button>
</div>
</Modal>
<Modal :title="线路绑定" v-model="bindingVisiable" :mask-closable="false" :scrollabele="true" :width="1000">
<line-binding v-if="bindingVisiable" ref="bindinglog"></line-binding>
<div slot="footer" v-show=bindingVisiable>
<Button type="text" @click="bindingVisiable = false">关闭</Button>
</div>
</Modal>
<Modal :title="充值记录明细" v-model="rechargeVisiable" :mask-closable="false" :scrollabele="true" :width="1000">
<recharge-one v-if="rechargeVisiable" ref="rechargelog"></recharge-one>
<div slot="footer" v-show=rechargeVisiable>
<Button type="text" @click="rechargeVisiable = false">关闭</Button>
</div>
</Modal>
</div>
</template>
<script>
import {
getAllLogiticsCompanyData,
getLogiticsCompanyData,
deleteLogiticsCompany,
onLineCompany,
offLineCompany
getBillList,
settlementConfirm
} from "@/api/app";
import {
shortcuts
} from "@/libs/shortcuts";
import excel from "@/libs/excel";
import {
offLineWorker,
onLineWorker
} from "@/api";
export default {
name: "logiticsCompany",
components: {},
@ -124,43 +59,14 @@
title: "已打款",
value: 2
}],
tableSize: "default",
message: "",
selectIndex: "",
currentRow: {},
height: 510,
showCompany: false,
bindingVisiable: false,
showType: "0",
openSearch: true,
openTip: true,
loading: true,
reading: false,
loadingExport: true,
exportModalVisible: false,
importModalVisible: false,
deployModalVisible: false,
uploadfile: {
name: "",
},
drop: false,
selectList: [],
searchForm: {
id: "",
shopName: "",
contacts: "",
mobile: "",
pageNumber: 1,
pageSize: 10,
sort: "createTime",
order: "desc",
startDate: "",
endDate: "",
signCompany: "0",
},
selectDate: null,
options: {
shortcuts: shortcuts,
regionId:JSON.parse(this.getStore("user")).departmentId,
settlementDate:''
},
form: {},
columns: [{
@ -177,102 +83,32 @@
},
{
title: "账单周期",
key: "shopName",
key: "billTime",
minWidth: 100,
sortable: true,
fixed: "left",
},
{
title: "店铺名称",
key: "shopName",
minWidth: 100,
sortable: true,
fixed: "left",
},
{
title: "订单数量",
key: "companyTel",
key: "recordCount",
minWidth: 150,
sortable: true,
},
{
title: "配送费",
key: "companyEmail",
minWidth: 250,
},
{
title: "商品原价",
key: "contacts",
key: "totalBaseAmount",
width: 100,
},
{
title: "餐盒费",
key: "mobile",
width: 150,
},
{
title: "账户余额支付金额",
key: "mobile",
width: 150,
},
{
title: "商家实收总金额",
key: "mobile",
width: 150,
},
{
title: "活动金额",
key: "mobile",
width: 150,
},
{
title: "抵用券金额",
key: "mobile",
width: 150,
},
{
title: "平台补贴",
key: "mobile",
width: 150,
},
{
title: "商品平台抽成",
key: "mobile",
width: 150,
},
{
title: "商家补贴",
key: "mobile",
width: 150,
},
{
title: "商品商家抽成",
key: "mobile",
width: 150,
},
{
title: "商家营收",
key: "mobile",
key: "BigDecimal",
width: 150,
},
{
title: "平台营收",
key: "mobile",
width: 150,
},
{
title: "本期期初",
key: "mobile",
width: 150,
},
{
title: "实际打款金额",
key: "mobile",
width: 150,
},
{
title: "账单状态",
key: "mobile",
key: "BigDecimal",
width: 150,
},
{
@ -326,50 +162,66 @@
},
},
],
chooseColumns: [],
filename: "公司数据",
exportTitle: "确认导出",
exportType: "",
data: [],
exportData: [],
total: 0,
Visiable: false,
rechargeVisiable: false,
};
},
methods: {
init() {
// this.getDataList();
this.searchForm.settlementDate = this.getTime()
this.getDataList();
},
changeDate(v){
console.log(v)
this.searchForm.settlementDate = v
},
getTime() {
const date = new Date();
//
const year = date.getFullYear();
// (getMonth 0-11 +1)0
const month = String(date.getMonth() + 1).padStart(2, '0');
// (getDate)0
const day = String(date.getDate()).padStart(2, '0');
// -- ::
return `${year}-${month}-${day}`;
},
allSelect(v){
this.selectList = v
},
oneSettlement(){
let data = {
shopIds:[],
settlementDate:this.searchForm.settlementDate,
regionId:JSON.parse(this.getStore("user")).departmentId
}
for(let i=0;i<this.selectList.length;i++){
data.shopIds.push(this.selectList[i].shopId)
}
settlementConfirm(data).then((res) => {
this.loading = false;
if (res.success) {
this.$Message.success("结算成功");
}
});
},
clearSelectAll(){
this.$refs.table.selectAll(false);
},
getDataList() {
//
this.loading = true;
getLogiticsCompanyData(this.searchForm).then((res) => {
getBillList(this.searchForm).then((res) => {
this.loading = false;
if (res.success) {
if (!this.getStore("roles").includes("ROLE_ADMIN")) {
res.result.content.forEach((e) => {
e.mobile = "您无权查看该数据";
});
}
this.data = res.result.content;
this.total = res.result.totalElements;
if (this.data.length == 0 && this.searchForm.pageNumber > 1) {
this.searchForm.pageNumber -= 1;
this.getDataList();
}
this.data = res.result
this.data.billTime = this.searchForm.settlementDate
}
});
},
handleSearch() {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
this.getDataList();
}
},
mounted() {
//
this.height = Number(document.documentElement.clientHeight - 230);
this.init();
},
};

155
src/views/app/business/bus/addEdit.vue

@ -6,98 +6,67 @@
<div class="drawer-header">
<div style="margin-right: 16px">优惠券配置</div>
</div>
<Form label-colon v-show="type != '2'">
<Row :gutter="32">
<Col span="24">
<FormItem label="优惠券名称">
{{ form.companyName }}
</FormItem>
</Col>
</Row>
</Form>
<Form ref="form" :model="form" :rules="formValidate" label-position="top">
<Row :gutter="32">
<Col span="24">
<FormItem label="优惠券名称" prop="companyName">
<Input v-model="form.companyName" />
</FormItem>
</Col>
</Row>
<Row :gutter="32">
<Col span="12">
<FormItem label="库存" prop="companyTel">
<Input v-model="form.companyTel" />
</FormItem>
</Col>
<Col span="12">
<FormItem label="适用范围" prop="companyAddress">
<Select ref="dep" @on-change="checkStatus" clearable="true">
<Option v-for="(item, i) in dictData" :key="i" :value="item.value">{{
item.title
}}</Option>
</Select>
<FormItem label="优惠券名称" prop="name">
<Input v-model="form.name" />
</FormItem>
</Col>
</Row>
<Row :gutter="32">
<Col span="24">
<FormItem label="优惠金额">
<Input></Input>
<FormItem label="发券总数" prop="totalCount">
<Input v-model="form.totalCount" />
</FormItem>
</Col>
</Row>
<Row :gutter="32">
<Col span="24">
<FormItem label="使用门槛">
<RadioGroup v-model="menkan" vertical>
<Radio label="buxian">不限制</Radio>
<Radio label="manjian"><Input style="width: 50px;"></Input>元可使用</Radio>
<FormItem label="适用范围" prop="applyScene">
<RadioGroup v-model="form.applyScene">
<Radio label="0">全部</Radio>
<Radio label="1">外卖/买饭</Radio>
<Radio label="2">快递/跑腿</Radio>
<Radio label="3">二手物品交易</Radio>
</RadioGroup>
</FormItem>
</Col>
</Row>
<Row :gutter="32">
<Col span="24">
<FormItem label="用户限制">
<RadioGroup v-model="xianzhi" vertical>
<Radio label="meibangding">不限制</Radio>
<Radio label="bangding">绑定手机号用户</Radio>
<FormItem label="使用门槛">
<RadioGroup v-model="form.type">
<Radio label="2">无门槛</Radio>
<Radio label="1"><Input v-model='form.minAmount' style="width: 50px;"></Input >使</Radio>
</RadioGroup>
</FormItem>
</Col>
</Row>
<Row :gutter="32">
<Col span="24">
<FormItem label="有效期">
<RadioGroup v-model="youxiao" vertical>
<Radio label="guding">固定日期</Radio>
<DatePicker v-if="youxiao == 'guding'" type="daterange" split-panels placeholder="选择起始时间" style="width: 200px"></DatePicker>
<Radio label="xianqi">领券后<Input style="width: 50px;"></Input>天有效</Radio>
</RadioGroup>
<FormItem label="优惠金额">
<Input v-model='form.discountAmount'></Input>
</FormItem>
</Col>
</Row>
<Row :gutter="32">
<Col span="24">
<FormItem label="活动互斥选择">
<Checkbox v-model="single">不与折扣同享</Checkbox>
<Checkbox v-model="single">不与满减活动同享</Checkbox>
<Checkbox v-model="single">不与满赠同享</Checkbox>
<Checkbox v-model="single">不与满额免配送费同享</Checkbox>
<Checkbox v-model="single">不与新用户立减活动同享</Checkbox>
<Checkbox v-model="single">不与配送费优惠活动同享</Checkbox>
<Checkbox v-model="single">不与会员/店铺红包券同享</Checkbox>
<FormItem label="每人限领数量">
<Input v-model='form.limitPerUser'></Input>
</FormItem>
</Col>
</Row>
<Row :gutter="32">
<Col span="24">
<FormItem label="配送方式">
<Checkbox v-model="single">平台配送</Checkbox>
<Checkbox v-model="single">商家配送</Checkbox>
<Checkbox v-model="single">到店自取</Checkbox>
<Checkbox v-model="single">到店消费</Checkbox>
<FormItem label="有效期">
<RadioGroup v-model="form.validType" vertical>
<Radio label="1">固定日期</Radio>
<DatePicker @on-change="changeDate" v-if="form.validType == '1'" type="daterange" split-panels placeholder="选择起始时间" style="width: 200px"></DatePicker>
<Radio label="2">领券后<Input v-model='form.validDays' style="width: 50px;"></Input ></Radio>
</RadioGroup>
</FormItem>
</Col>
</Row>
@ -113,8 +82,8 @@
<script>
import {
addLogiticsCompany,
editLogiticsCompany
addCoupon,
editCoupon
} from "@/api/app";
import dict from "@/views/my-components/hiver/dict";
import uploadPicInput from "@/views/my-components/hiver/upload-pic-input";
@ -144,19 +113,7 @@
menkan:'',
xianzhi:'',
youxiao:'',
dictData: [{
title: "全部",
value: ""
}, {
title: "配送",
value: 0
}, {
title: "快递跑腿",
value: 1
}, {
title: "拼团",
value: 2
}],
roleList: [],
visible: this.value,
title: "",
@ -165,12 +122,26 @@
submitLoading: false,
maxHeight: 510,
form: {
companyAddress: [],
companyStreet: '',
name: '', //
applyScene:'', //0-1-/2-/3-
type:'', //1-2-
minAmount:'', //使
discountAmount:'', //
totalCount:'', //
limitPerUser:1, //
validType:'', //1-2-
validStartTime:'', //
validEndTime:'', //
validDays:'', //
issuerType:1, //1-2-
issuerId:0, //ID 0-
status:1, //0-/1-
regionId:JSON.parse(this.getStore("user")).departmentId, //id
},
formValidate: {
//
companyName: [{
name: [{
required: true,
message: "请输入优惠券名称",
trigger: "change"
@ -192,17 +163,18 @@
init() {
},
changePass(v, grade, strength) {
this.form.password = strength;
changeDate(v){
console.log(v)
this.form.validStartTime = v[0]
this.form.validEndTime = v[1]
},
submit() {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.type == "1") {
//
this.submitLoading = true;
editLogiticsCompany(this.form).then((res) => {
editCoupon(this.form).then((res) => {
this.submitLoading = false;
if (res.success) {
this.$Message.success("操作成功");
@ -211,9 +183,9 @@
}
});
} else {
//
// 1
this.submitLoading = true;
addLogiticsCompany(this.form).then((res) => {
addCoupon(this.form).then((res) => {
this.submitLoading = false;
if (res.success) {
this.$Message.success("操作成功");
@ -225,9 +197,6 @@
}
});
},
handleSelectRegion(v) {
this.form.region = v;
},
setCurrentValue(value) {
if (value === this.visible) {
return;
@ -249,22 +218,12 @@
if (this.type == "0" || this.type == "1") {
//
let data = this.data;
//
if (data.companyAddress) {
data.companyAddress = data.companyAddress.split(",");
} else {
data.companyAddress = [];
}
//
this.$refs.regionTree.setData(data.region, data.regionTitle);
//
this.form = data;
} else {
//
this.form = {
companyAddress: [],
signCompany: "5",
};
this.form.applyScene = JSON.stringify(this.form.applyScene)
this.form.type = JSON.stringify(this.form.type)
this.form.validType = JSON.stringify(this.form.validType)
console.log('优惠券',this.form)
}
this.visible = value;
},

424
src/views/app/business/bus/bus.vue

@ -7,28 +7,25 @@
<Card>
<Row v-show="openSearch" @keydown.enter.native="handleSearch">
<Form ref="searchForm" :model="searchForm" inline :label-width="100">
<FormItem label="券类型" prop="companyName">
<Select ref="dep" @on-change="checkStatus" clearable="true">
<FormItem label="适用场景" prop="applyScene">
<Select ref="dep" @on-change="checkStatus" style="width:200px">
<Option v-for="(item, i) in dictData" :key="i" :value="item.value">{{
item.title
}}</Option>
</Select>
</FormItem>
<FormItem label="优惠券名称" prop="name">
<Input v-model="searchForm.name"></Input>
</FormItem>
<FormItem style="margin-left: -35px" class="br">
<Button @click="handleSearch" type="primary" icon="ios-search">搜索</Button>
<Button @click="handleReset">重置</Button>
<a class="drop-down" @click="dropDown">
{{ dropDownContent }}
<Icon :type="dropDownIcon"></Icon>
</a>
</FormItem>
</Form>
</Row>
<Row align="middle" justify="space-between" class="operation">
<div>
<Button @click="add" type="primary" icon="md-add">新增</Button>
<Button @click="delAll" icon="md-trash">批量删除</Button>
</div>
<div class="icons">
<Tooltip content="刷新" placement="top" transfer>
@ -58,28 +55,87 @@
<a class="select-clear" @click="clearSelectAll">清空</a>
</Alert>
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" sortable="custom"
@on-sort-change="changeSort" @on-selection-change="showSelect" ref="table"></Table>
@on-selection-change="showSelect" ref="table"></Table>
<Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize"
<Page :current="searchForm.pageNum" :total="total" :page-size="searchForm.pageSize"
@on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
size="small" show-total show-elevator show-sizer></Page>
</Row>
</Card>
<Modal :title="发放优惠券" v-model="Visiable" :mask-closable="false" :scrollabele="true" :width="1000">
<div style="display:flex;margin-top: 30px;">
<Card style="width:49%;margin-right: 2%;height: 170px;">
<div style="display: flex;">
<div style="width: 30%;color: red;text-align: center;">
<div>
<span></span>
<span style="font-size: 30px;font-weight: 700;">{{couponsData.discountAmount}}</span>
</div>
<div v-if="couponsData.type == 1">{{couponsData.minAmount}}元使用</div>
<div v-if="couponsData.type == 2">无门槛限制</div>
</div>
<div>
<div style="font-size: 20px;font-weight: 700;line-height: 43px;">{{couponsData.name}}</div>
<div v-if="couponsData.validType == '2'" style="color: #777;">领到券当日开始{{couponsData.validDays}}天内有效</div>
<div v-if="couponsData.validType == '1'" style="color: #777;">{{getTime(couponsData.validStartTime)}}{{getTime(couponsData.validEndTime)}}期间使用</div>
</div>
</div>
<div style="border-top: 1px solid #777;background: #f5f5f5;padding: 5px 10px;">
<div>
有效期
<span v-if="couponsData.validType == '2'">{{getTime(couponsData.validStartTime)}}{{getTime(couponsData.validEndTime)}}</span>
<span v-if="couponsData.validType == '1'">领到券当日开始{{couponsData.validDays}}天内有效</span>
</div>
<div>券ID{{couponsData.id}}</div>
</div>
</Card>
<Card style="width:49%;">
<Form ref="form" :model="form" :rules="formValidate" label-position="top">
<Row>
<Col>
<FormItem label="发放类型">
<RadioGroup v-model="giveData.type">
<Radio label="0">全部用户</Radio>
<Radio label="1">目标用户</Radio>
</RadioGroup>
</FormItem>
</Col>
</Row>
<Row v-if="giveData.type == 1">
<Col>
<FormItem label="用户手机号(多个手机号逗号隔开)">
<Input v-model="giveData.userPhones"></Input>
</FormItem>
</Col>
</Row>
<Row>
<Col>
<FormItem label="每人发放数量">
<Input v-model="giveData.giveNum"></Input>
</FormItem>
</Col>
</Row>
</Form>
<Row>
<Button @click="submit" type="primary">确认发放</Button>
</Row>
</Card>
</div>
<div slot="footer" v-show=Visiable>
<Button type="text" @click="Visiable = false">关闭</Button>
</div>
</Modal>
<addEdit :data="form" :type="showType" v-model="showCompany" @on-submit="getDataList" />
</div>
</template>
<script>
import {
getAllLogiticsCompanyData,
getLogiticsCompanyData,
deleteLogiticsCompany,
offLineCompany,
onLineCompany
getCouponData,
giveCoupon,
} from "@/api/app";
import {
shortcuts
} from "@/libs/shortcuts";
import addEdit from "./addEdit.vue";
export default {
name: "logiticsCompany",
@ -88,45 +144,44 @@
},
data() {
return {
couponsData:{},
tableSize: "default",
message: "",
selectIndex: "",
currentRow: {},
height: 510,
showCompany: false,
showType: "0",
openSearch: true,
openTip: true,
loading: true,
drop: false,
giveData:{
type:'', //0 1
userPhones:'',
couponId:'',
giveNum:''
},
selectList: [],
dictData: [{
title: "全部",
value: ""
}, {
title: "满减券",
title: "通用",
value: 0
}, {
title: "无门槛券",
title: "外卖/买饭",
value: 1
}, {
title: "快递/跑腿",
value: 2
}, {
title: "二手物品交易",
value: 3
}],
searchForm: {
id: "",
companyName: "",
contacts: "",
mobile: "",
pageNumber: 1,
pageNum: 1,
pageSize: 10,
sort: "createTime",
order: "desc",
startDate: "",
endDate: "",
signCompany: "5",
regionId: JSON.parse(this.getStore("user")).departmentId,
applyScene: '',
name: ''
},
selectDate: null,
options: {
shortcuts: shortcuts,
},
form: {},
columns: [{
type: "selection",
@ -140,50 +195,115 @@
},
{
title: "优惠券类型",
key: "companyName",
key: "type",
minWidth: 150,
align: "center",
render: (h, params) => {
let re = ""
if (params.row.type == 1) {
re = "满减券";
} else if (params.row.type == 2) {
re = "无门槛直减券";
}
return h(
"div",
re
);
}
},
{
title: "优惠券名称",
key: "isOnLine",
key: "name",
minWidth: 160,
},
{
title: "优惠券组ID",
key: "companyTel",
minWidth: 150,
sortable: true,
},
{
title: "价值",
key: "companyEmail",
title: "抵扣面额",
key: "discountAmount",
minWidth: 100,
},
{
title: "库存量",
key: "contacts",
title: "剩余数量",
key: "remainCount",
width: 100,
},
{
title: "有效期",
key: "mobile",
key: "validStartTime",
width: 175,
render: (h, params) => {
let re = ""
//1-2-
if(params.row.validType == 1){
re = this.getTime(params.row.validStartTime) + '-' + this.getTime(params.row.validEndTime)
}else{
re = params.row.validDays
}
return h(
"div",
re
);
}
},
{
title: "适用场景",
key: "applyScene",
width: 150,
render: (h, params) => {
let re = ""
if (params.row.applyScene == 0) {
re = "通用";
} else if (params.row.applyScene == 1) {
re = "外卖/买饭";
} else if (params.row.applyScene == 2) {
re = "快递/跑腿";
} else if (params.row.applyScene == 3) {
re = "二手物品交易";
}
return h(
"div",
re
);
}
},
{
title: "领取人次",
key: "mobile",
key: "totalCount",
width: 150,
},
{
title: "使用中",
key: "mobile",
title: "发放方",
key: "issuerType",
width: 150,
render: (h, params) => {
let re = ""
if (params.row.issuerType == 2) {
re = "商家";
} else if (params.row.issuerType == 1) {
re = "平台";
}
return h(
"div",
re
);
}
},
{
title: "已使用",
key: "mobile",
title: "状态",
key: "status",
width: 150,
render: (h, params) => {
let re = ""
if (params.row.status == 0) {
re = "已下架/停发";
} else if (params.row.status == 1) {
re = "发放中";
}
return h(
"div",
re
);
}
},
{
title: "操作",
@ -193,6 +313,16 @@
fixed: "right",
render: (h, params) => {
return h("div", [
h(
"a", {
on: {
click: () => {
this.issueCoupons(params.row);
},
},
},
"发放"
),
h("Divider", {
props: {
type: "vertical",
@ -206,7 +336,7 @@
},
},
},
"编辑"
"发放详情"
),
h("Divider", {
props: {
@ -217,36 +347,67 @@
"a", {
on: {
click: () => {
this.remove(params.row);
this.edit(params.row);
},
},
},
"删除"
"编辑"
),
]);
},
},
],
data: [],
exportData: [],
total: 0,
Visiable: false,
rechargeVisiable: false,
};
},
methods: {
init() {
this.getDataList();
},
findAllRecord(v) {
this.Visiable = true;
console.log(v)
this.$nextTick(() => {
this.$refs.dialog.initRecharge(v);
issueCoupons(v){
this.Visiable = true
this.couponsData = v
this.giveData.couponId = v.id
},
submit(){
this.loading = true;
if(this.giveData.type == 0){
this.giveData.userPhones = ''
}else if(this.giveData.type == 1){
this.giveData.userPhones = this.giveData.userPhones.replace(/[^0-9,]/g, ',');
}
giveCoupon(this.giveData).then((res) => {
this.loading = false;
if (res.success) {
this.$Message.success("发放成功");
}
});
},
getTime(v) {
const date = new Date(v);
//
const year = date.getFullYear();
// (getMonth 0-11 +1)0
const month = String(date.getMonth() + 1).padStart(2, '0');
// (getDate)0
const day = String(date.getDate()).padStart(2, '0');
// (getHours)0
const hour = String(date.getHours()).padStart(2, '0');
// (getMinutes)0
const minute = String(date.getMinutes()).padStart(2, '0');
// (getSeconds)0
const second = String(date.getSeconds()).padStart(2, '0');
// -- ::
return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
},
checkStatus(v){
this.searchForm.applyScene = v
console.log(v)
},
changePage(v) {
this.searchForm.pageNumber = v;
this.searchForm.pageNum = v;
this.getDataList();
this.clearSelectAll();
},
@ -257,40 +418,29 @@
this.searchForm.pageSize = v;
this.getDataList();
},
selectDateRange(v) {
if (v) {
this.searchForm.startDate = v[0];
this.searchForm.endDate = v[1];
}
},
getDataList() {
//
this.loading = true;
getLogiticsCompanyData(this.searchForm).then((res) => {
getCouponData(this.searchForm).then((res) => {
this.loading = false;
if (res.success) {
if (!this.getStore("roles").includes("ROLE_ADMIN")) {
res.result.content.forEach((e) => {
e.mobile = "您无权查看该数据";
});
}
this.data = res.result.content;
this.total = res.result.totalElements;
if (this.data.length == 0 && this.searchForm.pageNumber > 1) {
this.searchForm.pageNumber -= 1;
this.data = res.result.records;
this.total = res.result.total;
if (this.data.length == 0 && this.searchForm.pageNum > 1) {
this.searchForm.pageNum -= 1;
this.getDataList();
}
}
});
},
handleSearch() {
this.searchForm.pageNumber = 1;
this.searchForm.pageNum = 1;
this.searchForm.pageSize = 10;
this.getDataList();
},
handleReset() {
this.$refs.searchForm.resetFields();
this.searchForm.pageNumber = 1;
this.searchForm.pageNum = 1;
this.searchForm.pageSize = 10;
this.selectDate = null;
this.searchForm.startDate = "";
@ -298,14 +448,6 @@
//
this.getDataList();
},
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order == "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
add() {
this.showType = "2";
this.showCompany = true;
@ -323,30 +465,7 @@
this.showType = "1";
this.showCompany = true;
},
remove(v) {
this.$Modal.confirm({
title: "确认删除",
content: "您确认要删除公司配置 " + v.companyName + " ?",
loading: true,
onOk: () => {
deleteLogiticsCompany({
ids: v.id
}).then((res) => {
this.$Modal.remove();
if (res.success) {
this.clearSelectAll();
this.$Message.success("删除成功");
this.getDataList();
}
});
},
});
},
dropDown() {
this.drop = !this.drop;
},
showSelect(e) {
this.exportData = e;
this.selectList = e;
if (e.length === 1) {
const row = e[0];
@ -360,81 +479,8 @@
clearSelectAll() {
this.$refs.table.selectAll(false);
},
delAll() {
if (this.selectList.length <= 0) {
this.$Message.warning("您还未选择要删除的数据");
return;
}
this.$Modal.confirm({
title: "确认删除",
content: "您确认要删除所选的 " + this.selectList.length + " 条数据?",
loading: true,
onOk: () => {
let ids = "";
this.selectList.forEach(function(e) {
ids += e.id + ",";
});
ids = ids.substring(0, ids.length - 1);
deleteLogiticsCompany({
ids: ids
}).then((res) => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("删除成功");
this.clearSelectAll();
this.getDataList();
}
});
},
});
},
findRechargeLog(v) {
this.rechargeVisiable = true;
console.log(v)
this.$nextTick(() => {
this.$refs.rechargelog.initRecharge(v);
});
},
offLine(v) {
this.$Modal.confirm({
title: "确认下线",
content: "您确认要使 " + v.companyName + " 下线吗?",
loading: true,
onOk: () => {
offLineCompany({
id: v.id
}).then((res) => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
}
});
},
});
},
onLine(v) {
this.$Modal.confirm({
title: "确认上线",
content: "您确认要使 " + v.companyName + " 上线吗?",
loading: true,
onOk: () => {
onLineCompany({
id: v.id
}).then((res) => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
}
});
},
});
}
},
mounted() {
//
this.height = Number(document.documentElement.clientHeight - 230);
this.init();
},
};

1
src/views/login.vue

@ -245,6 +245,7 @@
debugger;
let accessToken = res.result.accessToken;
this.setStore("accessToken", accessToken);
this.setStore("user", res.result.user);
getOtherSet().then((res) => {
if (res.result) {
let domain = res.result.ssoDomain;

Loading…
Cancel
Save