|
|
@ -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(); |
|
|
}, |
|
|
}, |
|
|
}; |
|
|
}; |
|
|
|