tianyi 4 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) return postRequest('/app/areas/delById', params)
} }
export const getLogiticsCompanyData = (params) => { export const getCouponData = (params) => {
return getRequest('/app/areas/listBySchoolId', 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 = () => { export const getAllLogiticsCompanyData = () => {
return getRequest('/app/logitics/getAll') return getRequest('/app/logitics/getAll')
} }
export const addLogiticsCompany = (params) => { export const addCoupon = (params) => {
return postRequest('/app/areas/save', params) return postBodyRequest('/mall/coupon/add', params)
} }
export const editLogiticsCompany = (params) => { export const editCoupon = (params) => {
return postRequest('/app/areas/edit', params) return postBodyRequest('/mall/coupon/update', params)
} }
//新增线路 //新增线路
export const addLogisticsRoute = (params) => { export const addLogisticsRoute = (params) => {

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

@ -5,55 +5,19 @@
<template> <template>
<div class="search"> <div class="search">
<Card> <Card>
<Row v-show="openSearch" @keydown.enter.native="handleSearch"> <Row>
<Form ref="searchForm" :model="searchForm" inline :label-width="100"> <Form ref="searchForm" :model="searchForm" inline :label-width="100">
<FormItem label="状态" prop="orderId"> <FormItem label="选择时间" prop="settlementDate">
<Select ref="dep" @on-change="checkStatus" clearable="true"> <DatePicker @on-change="changeDate" type="date" placeholder="请选择时间" style="width: 200px" />
<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> </FormItem>
<FormItem style="margin-left: -35px" class="br"> <FormItem style="margin-left: -35px" class="br">
<Button @click="handleSearch" type="primary" icon="ios-search">搜索</Button> <Button @click="getDataList" type="primary" icon="ios-search">搜索</Button>
<Button @click="handleReset">重置</Button>
<a class="drop-down" @click="dropDown">
{{ dropDownContent }}
<Icon :type="dropDownIcon"></Icon>
</a>
</FormItem> </FormItem>
</Form> </Form>
</Row> </Row>
<Row align="middle" justify="space-between" class="operation"> <Row align="middle" justify="space-between" class="operation">
<div> <div>
<Button @click="add" type="primary" icon="md-briefcase">一键结算</Button> <Button @click="oneSettlement" icon="md-folder-open">结算</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>
</div> </div>
</Row> </Row>
<Alert show-icon v-show="openTip"> <Alert show-icon v-show="openTip">
@ -61,51 +25,22 @@
<span class="select-count">{{ selectList.length }}</span> <span class="select-count">{{ selectList.length }}</span>
<a class="select-clear" @click="clearSelectAll">清空</a> <a class="select-clear" @click="clearSelectAll">清空</a>
</Alert> </Alert>
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" sortable="custom" <Table :loading="loading" border :columns="columns" :data="data"
@on-sort-change="changeSort" @on-selection-change="showSelect" ref="table"></Table> @on-selection-change="allSelect" ref="table"></Table>
<Row type="flex" justify="end" class="page"> <!-- <Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" <Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize"
@on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
size="small" show-total show-elevator show-sizer></Page> size="small" show-total show-elevator show-sizer></Page>
</Row> </Row> -->
</Card> </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> </div>
</template> </template>
<script> <script>
import { import {
getAllLogiticsCompanyData, getBillList,
getLogiticsCompanyData, settlementConfirm
deleteLogiticsCompany,
onLineCompany,
offLineCompany
} from "@/api/app"; } from "@/api/app";
import {
shortcuts
} from "@/libs/shortcuts";
import excel from "@/libs/excel";
import {
offLineWorker,
onLineWorker
} from "@/api";
export default { export default {
name: "logiticsCompany", name: "logiticsCompany",
components: {}, components: {},
@ -124,43 +59,14 @@
title: "已打款", title: "已打款",
value: 2 value: 2
}], }],
tableSize: "default",
message: "",
selectIndex: "",
currentRow: {},
height: 510,
showCompany: false,
bindingVisiable: false,
showType: "0",
openSearch: true,
openTip: true, openTip: true,
loading: true, loading: true,
reading: false, reading: false,
loadingExport: true,
exportModalVisible: false,
importModalVisible: false,
deployModalVisible: false,
uploadfile: {
name: "",
},
drop: false, drop: false,
selectList: [], selectList: [],
searchForm: { searchForm: {
id: "", regionId:JSON.parse(this.getStore("user")).departmentId,
shopName: "", settlementDate:''
contacts: "",
mobile: "",
pageNumber: 1,
pageSize: 10,
sort: "createTime",
order: "desc",
startDate: "",
endDate: "",
signCompany: "0",
},
selectDate: null,
options: {
shortcuts: shortcuts,
}, },
form: {}, form: {},
columns: [{ columns: [{
@ -177,102 +83,32 @@
}, },
{ {
title: "账单周期", title: "账单周期",
key: "shopName", key: "billTime",
minWidth: 100, minWidth: 100,
sortable: true,
fixed: "left",
}, },
{ {
title: "店铺名称", title: "店铺名称",
key: "shopName", key: "shopName",
minWidth: 100, minWidth: 100,
sortable: true,
fixed: "left",
}, },
{ {
title: "订单数量", title: "订单数量",
key: "companyTel", key: "recordCount",
minWidth: 150, minWidth: 150,
sortable: true,
},
{
title: "配送费",
key: "companyEmail",
minWidth: 250,
}, },
{ {
title: "商品原价", title: "商品原价",
key: "contacts", key: "totalBaseAmount",
width: 100, 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: "商家营收", title: "商家营收",
key: "mobile", key: "BigDecimal",
width: 150, width: 150,
}, },
{ {
title: "平台营收", title: "平台营收",
key: "mobile", key: "BigDecimal",
width: 150,
},
{
title: "本期期初",
key: "mobile",
width: 150,
},
{
title: "实际打款金额",
key: "mobile",
width: 150,
},
{
title: "账单状态",
key: "mobile",
width: 150, width: 150,
}, },
{ {
@ -326,50 +162,66 @@
}, },
}, },
], ],
chooseColumns: [],
filename: "公司数据",
exportTitle: "确认导出",
exportType: "",
data: [], data: [],
exportData: [],
total: 0, total: 0,
Visiable: false, Visiable: false,
rechargeVisiable: false,
}; };
}, },
methods: { methods: {
init() { 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() { getDataList() {
// //
this.loading = true; this.loading = true;
getLogiticsCompanyData(this.searchForm).then((res) => { getBillList(this.searchForm).then((res) => {
this.loading = false; this.loading = false;
if (res.success) { if (res.success) {
if (!this.getStore("roles").includes("ROLE_ADMIN")) { this.data = res.result
res.result.content.forEach((e) => { this.data.billTime = this.searchForm.settlementDate
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();
}
} }
}); });
},
handleSearch() {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
this.getDataList();
} }
}, },
mounted() { mounted() {
//
this.height = Number(document.documentElement.clientHeight - 230);
this.init(); this.init();
}, },
}; };

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

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

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

@ -7,28 +7,25 @@
<Card> <Card>
<Row v-show="openSearch" @keydown.enter.native="handleSearch"> <Row v-show="openSearch" @keydown.enter.native="handleSearch">
<Form ref="searchForm" :model="searchForm" inline :label-width="100"> <Form ref="searchForm" :model="searchForm" inline :label-width="100">
<FormItem label="券类型" prop="companyName"> <FormItem label="适用场景" prop="applyScene">
<Select ref="dep" @on-change="checkStatus" clearable="true"> <Select ref="dep" @on-change="checkStatus" style="width:200px">
<Option v-for="(item, i) in dictData" :key="i" :value="item.value">{{ <Option v-for="(item, i) in dictData" :key="i" :value="item.value">{{
item.title item.title
}}</Option> }}</Option>
</Select> </Select>
</FormItem> </FormItem>
<FormItem label="优惠券名称" prop="name">
<Input v-model="searchForm.name"></Input>
</FormItem>
<FormItem style="margin-left: -35px" class="br"> <FormItem style="margin-left: -35px" class="br">
<Button @click="handleSearch" type="primary" icon="ios-search">搜索</Button> <Button @click="handleSearch" type="primary" icon="ios-search">搜索</Button>
<Button @click="handleReset">重置</Button> <Button @click="handleReset">重置</Button>
<a class="drop-down" @click="dropDown">
{{ dropDownContent }}
<Icon :type="dropDownIcon"></Icon>
</a>
</FormItem> </FormItem>
</Form> </Form>
</Row> </Row>
<Row align="middle" justify="space-between" class="operation"> <Row align="middle" justify="space-between" class="operation">
<div> <div>
<Button @click="add" type="primary" icon="md-add">新增</Button> <Button @click="add" type="primary" icon="md-add">新增</Button>
<Button @click="delAll" icon="md-trash">批量删除</Button>
</div> </div>
<div class="icons"> <div class="icons">
<Tooltip content="刷新" placement="top" transfer> <Tooltip content="刷新" placement="top" transfer>
@ -58,28 +55,87 @@
<a class="select-clear" @click="clearSelectAll">清空</a> <a class="select-clear" @click="clearSelectAll">清空</a>
</Alert> </Alert>
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" sortable="custom" <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"> <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]" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
size="small" show-total show-elevator show-sizer></Page> size="small" show-total show-elevator show-sizer></Page>
</Row> </Row>
</Card> </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" /> <addEdit :data="form" :type="showType" v-model="showCompany" @on-submit="getDataList" />
</div> </div>
</template> </template>
<script> <script>
import { import {
getAllLogiticsCompanyData, getCouponData,
getLogiticsCompanyData, giveCoupon,
deleteLogiticsCompany,
offLineCompany,
onLineCompany
} from "@/api/app"; } from "@/api/app";
import {
shortcuts
} from "@/libs/shortcuts";
import addEdit from "./addEdit.vue"; import addEdit from "./addEdit.vue";
export default { export default {
name: "logiticsCompany", name: "logiticsCompany",
@ -88,45 +144,44 @@
}, },
data() { data() {
return { return {
couponsData:{},
tableSize: "default", tableSize: "default",
message: "",
selectIndex: "", selectIndex: "",
currentRow: {}, currentRow: {},
height: 510,
showCompany: false, showCompany: false,
showType: "0", showType: "0",
openSearch: true, openSearch: true,
openTip: true, openTip: true,
loading: true, loading: true,
drop: false, drop: false,
giveData:{
type:'', //0 1
userPhones:'',
couponId:'',
giveNum:''
},
selectList: [], selectList: [],
dictData: [{ dictData: [{
title: "全部", title: "通用",
value: ""
}, {
title: "满减券",
value: 0 value: 0
}, { }, {
title: "无门槛券", title: "外卖/买饭",
value: 1 value: 1
}, {
title: "快递/跑腿",
value: 2
}, {
title: "二手物品交易",
value: 3
}], }],
searchForm: { searchForm: {
id: "", pageNum: 1,
companyName: "",
contacts: "",
mobile: "",
pageNumber: 1,
pageSize: 10, pageSize: 10,
sort: "createTime", regionId: JSON.parse(this.getStore("user")).departmentId,
order: "desc", applyScene: '',
startDate: "", name: ''
endDate: "",
signCompany: "5",
}, },
selectDate: null, selectDate: null,
options: {
shortcuts: shortcuts,
},
form: {}, form: {},
columns: [{ columns: [{
type: "selection", type: "selection",
@ -140,50 +195,115 @@
}, },
{ {
title: "优惠券类型", title: "优惠券类型",
key: "companyName", key: "type",
minWidth: 150, minWidth: 150,
align: "center", 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: "优惠券名称", title: "优惠券名称",
key: "isOnLine", key: "name",
minWidth: 160, minWidth: 160,
}, },
{ {
title: "优惠券组ID", title: "抵扣面额",
key: "companyTel", key: "discountAmount",
minWidth: 150,
sortable: true,
},
{
title: "价值",
key: "companyEmail",
minWidth: 100, minWidth: 100,
}, },
{ {
title: "库存量", title: "剩余数量",
key: "contacts", key: "remainCount",
width: 100, width: 100,
}, },
{ {
title: "有效期", 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, 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: "领取人次", title: "领取人次",
key: "mobile", key: "totalCount",
width: 150, width: 150,
}, },
{ {
title: "使用中", title: "发放方",
key: "mobile", key: "issuerType",
width: 150, 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: "已使用", title: "状态",
key: "mobile", key: "status",
width: 150, 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: "操作", title: "操作",
@ -193,6 +313,16 @@
fixed: "right", fixed: "right",
render: (h, params) => { render: (h, params) => {
return h("div", [ return h("div", [
h(
"a", {
on: {
click: () => {
this.issueCoupons(params.row);
},
},
},
"发放"
),
h("Divider", { h("Divider", {
props: { props: {
type: "vertical", type: "vertical",
@ -206,7 +336,7 @@
}, },
}, },
}, },
"编辑" "发放详情"
), ),
h("Divider", { h("Divider", {
props: { props: {
@ -217,36 +347,67 @@
"a", { "a", {
on: { on: {
click: () => { click: () => {
this.remove(params.row); this.edit(params.row);
}, },
}, },
}, },
"删除" "编辑"
), ),
]); ]);
}, },
}, },
], ],
data: [], data: [],
exportData: [],
total: 0, total: 0,
Visiable: false, Visiable: false,
rechargeVisiable: false,
}; };
}, },
methods: { methods: {
init() { init() {
this.getDataList(); this.getDataList();
}, },
findAllRecord(v) { issueCoupons(v){
this.Visiable = true; this.Visiable = true
console.log(v) this.couponsData = v
this.$nextTick(() => { this.giveData.couponId = v.id
this.$refs.dialog.initRecharge(v); },
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) { changePage(v) {
this.searchForm.pageNumber = v; this.searchForm.pageNum = v;
this.getDataList(); this.getDataList();
this.clearSelectAll(); this.clearSelectAll();
}, },
@ -257,40 +418,29 @@
this.searchForm.pageSize = v; this.searchForm.pageSize = v;
this.getDataList(); this.getDataList();
}, },
selectDateRange(v) {
if (v) {
this.searchForm.startDate = v[0];
this.searchForm.endDate = v[1];
}
},
getDataList() { getDataList() {
// //
this.loading = true; this.loading = true;
getLogiticsCompanyData(this.searchForm).then((res) => { getCouponData(this.searchForm).then((res) => {
this.loading = false; this.loading = false;
if (res.success) { if (res.success) {
if (!this.getStore("roles").includes("ROLE_ADMIN")) { this.data = res.result.records;
res.result.content.forEach((e) => { this.total = res.result.total;
e.mobile = "您无权查看该数据"; if (this.data.length == 0 && this.searchForm.pageNum > 1) {
}); this.searchForm.pageNum -= 1;
}
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.getDataList();
} }
} }
}); });
}, },
handleSearch() { handleSearch() {
this.searchForm.pageNumber = 1; this.searchForm.pageNum = 1;
this.searchForm.pageSize = 10; this.searchForm.pageSize = 10;
this.getDataList(); this.getDataList();
}, },
handleReset() { handleReset() {
this.$refs.searchForm.resetFields(); this.$refs.searchForm.resetFields();
this.searchForm.pageNumber = 1; this.searchForm.pageNum = 1;
this.searchForm.pageSize = 10; this.searchForm.pageSize = 10;
this.selectDate = null; this.selectDate = null;
this.searchForm.startDate = ""; this.searchForm.startDate = "";
@ -298,14 +448,6 @@
// //
this.getDataList(); this.getDataList();
}, },
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order == "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
add() { add() {
this.showType = "2"; this.showType = "2";
this.showCompany = true; this.showCompany = true;
@ -323,30 +465,7 @@
this.showType = "1"; this.showType = "1";
this.showCompany = true; 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) { showSelect(e) {
this.exportData = e;
this.selectList = e; this.selectList = e;
if (e.length === 1) { if (e.length === 1) {
const row = e[0]; const row = e[0];
@ -360,81 +479,8 @@
clearSelectAll() { clearSelectAll() {
this.$refs.table.selectAll(false); 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() { mounted() {
//
this.height = Number(document.documentElement.clientHeight - 230);
this.init(); this.init();
}, },
}; };

1
src/views/login.vue

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

Loading…
Cancel
Save