lifenlong 2021-06-23 00:21:59 +08:00
commit ea396405df
14 changed files with 206 additions and 265 deletions

View File

@ -69,8 +69,8 @@ export default {
receiptContent: '不开发票', // receiptContent: '不开发票', //
type: 1 // 1 2 type: 1 // 1 2
}, },
ruleInline: { // type: 1, // 1 2
receiptTitle: [{ required: true, message: '请填写公司名称' }], ruleInline: {
taxpayerId: [ taxpayerId: [
{ required: true, message: '请填写纳税人识别号' }, { required: true, message: '请填写纳税人识别号' },
{ pattern: TINumber, message: '请填写正确的纳税人识别号' } { pattern: TINumber, message: '请填写正确的纳税人识别号' }
@ -78,21 +78,11 @@ export default {
} }
}; };
}, },
methods: { props: ["invoiceData"],
save () { // watch: {
if (this.invoiceForm.type === 1) { invoiceData: {
// handler(val) {
let flag = true; this.invoiceForm = { ...val };
this.receiptItems.forEach((e) => {
if (
e.receiptTitle === '个人' &&
e.receiptContent === this.invoiceForm.receiptContent
) {
this.$emit('change', e);
flag = false;
this.invoiceAvailable = false;
}
});
if (flag) { if (flag) {
let params = { let params = {

View File

@ -74,6 +74,11 @@ export default {
icon: "md-happy", icon: "md-happy",
___type: "sign", ___type: "sign",
}, },
{
title: "小程序直播",
icon: "ios-videocam",
___type: "live",
},
], ],
linkItem: { linkItem: {

View File

@ -94,8 +94,8 @@
// //
pageNumber: 1, // pageNumber: 1, //
pageSize: 10, // pageSize: 10, //
sort: "createTime", // sort: "", //
order: "desc", // order: "", //
startDate: "", // startDate: "", //
endDate: "", // endDate: "", //
orderType: "FICTITIOUS", orderType: "FICTITIOUS",
@ -118,8 +118,6 @@
title: "下单时间", title: "下单时间",
key: "createTime", key: "createTime",
width: 200, width: 200,
sortable: true,
sortType: "desc",
}, },
{ {
title: "订单来源", title: "订单来源",

View File

@ -37,7 +37,7 @@
<div class="div-item"> <div class="div-item">
<div class="div-item-left">订单来源</div> <div class="div-item-left">订单来源</div>
<div class="div-item-right"> <div class="div-item-right">
{{ orderInfo.order.clientType }} {{ orderInfo.order.clientType | clientTypeWay}}
</div> </div>
</div> </div>

View File

@ -230,7 +230,7 @@ export default {
title: "操作", title: "操作",
key: "action", key: "action",
align: "center", align: "center",
width: 100, width: 150,
render: (h, params) => { render: (h, params) => {
return h("div", [ return h("div", [
h( h(

View File

@ -101,7 +101,7 @@ export default {
{ {
title: "面额/折扣", title: "面额/折扣",
key: "price", key: "price",
width: 120, width: 100,
render: (h, params) => { render: (h, params) => {
if (params.row.price) { if (params.row.price) {
return h( return h(
@ -117,14 +117,14 @@ export default {
{ {
title: "领取数量/总数量", title: "领取数量/总数量",
key: "publishNum", key: "publishNum",
width: 150, width: 130,
render: (h, params) => { render: (h, params) => {
return h( return h(
"div", "div",
params.row.receivedNum + "/" + params.row.publishNum params.row.receivedNum + "/" + params.row.publishNum
); );
}, },
minWidth: 130,
}, },
{ {
title: "优惠券类型", title: "优惠券类型",

View File

@ -24,78 +24,35 @@
<Row class="operation padding-row"> <Row class="operation padding-row">
<Button type="primary" @click="add"></Button> <Button type="primary" @click="add"></Button>
</Row> </Row>
<Table <Tabs value="list" @on-click="clickTabPane">
:loading="loading" <TabPane label="秒杀活动列表" name="list">
border <Table :loading="loading" border :columns="columns" :data="data" ref="table" class="page">
:columns="columns"
:data="data"
ref="table"
class="page"
>
<template slot-scope="{ row }" slot="action"> <template slot-scope="{ row }" slot="action">
<Button <Button type="info" size="small" class="mr_5" v-if="row.promotionStatus == 'NEW'" @click="edit(row)"></Button>
type="info"
size="small"
class="mr_5"
v-if="row.promotionStatus == 'NEW'"
@click="edit(row)"
>编辑</Button
>
<Button <Button type="info" size="small" class="mr_5" v-else @click="manage(row)"></Button>
type="info"
size="small"
class="mr_5"
v-else
@click="manage(row)"
>查看</Button
>
<Button <Button type="primary" size="small" class="mr_5" v-if="row.promotionStatus == 'NEW'" @click="manage(row)"></Button>
type="primary"
size="small"
class="mr_5"
v-if="row.promotionStatus == 'NEW'"
@click="manage(row)"
>管理</Button
>
<!-- <Button type="success" size="small" class="mr_5" v-if="row.promotionStatus == 'NEW' || row.promotionStatus == 'END'" @click="upper(row)"></Button> --> <Button type="error" size="small" v-if="
<Button
type="error"
size="small"
v-if="
row.promotionStatus == 'START' || row.promotionStatus == 'NEW' row.promotionStatus == 'START' || row.promotionStatus == 'NEW'
" " class="mr_5" @click="off(row)">下架</Button>
class="mr_5" &nbsp;
@click="off(row)" <Button type="error" size="small" v-if="row.promotionStatus == 'CLOSE'" ghost @click="expire(row)"></Button>
>下架</Button
>
<Button
type="error"
size="small"
v-if="row.promotionStatus == 'CLOSE'"
ghost
@click="expire(row)"
>删除</Button
>
</template> </template>
</Table> </Table>
<Row type="flex" justify="end" class="page"> <Row type="flex" justify="end" class="page">
<Page <Page style="margin: 20px 0;" :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize"
:current="searchForm.pageNumber + 1" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator show-sizer></Page>
: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>
</TabPane>
<TabPane label="秒杀活动设置" name="setup">
<setupSeckill v-if="setupFlag"></setupSeckill>
</TabPane>
</Tabs>
</Card> </Card>
</div> </div>
</template> </template>
@ -274,7 +231,7 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
@import "@/styles/table-common.scss"; @import "@/styles/table-common.scss";
.mr_5{ .mr_5 {
margin: 0 4px; margin: 0 5px;
} }
</style> </style>

View File

@ -1,5 +1,5 @@
<template> <template>
<div> <div v-if="templateShow">
<Form :model="form" :label-width="120"> <Form :model="form" :label-width="120">
<FormItem label="每日场次设置"> <FormItem label="每日场次设置">
<Row :gutter="16" class="row"> <Row :gutter="16" class="row">
@ -27,6 +27,7 @@ import { getSetting, setSetting } from "@/api/index";
export default { export default {
data() { data() {
return { return {
templateShow:false,
submitLoading: false, submitLoading: false,
selectedTime: [], selectedTime: [],
times: [], // 1-24 times: [], // 1-24
@ -81,6 +82,7 @@ export default {
async init() { async init() {
let result = await getSetting("SECKILL_SETTING"); let result = await getSetting("SECKILL_SETTING");
if (result.success) { if (result.success) {
this.templateShow = true
this.form.seckillRule = result.result.seckillRule; this.form.seckillRule = result.result.seckillRule;
this.times=[] this.times=[]
for (let i = 0; i < 24; i++) { for (let i = 0; i < 24; i++) {

View File

@ -6,7 +6,7 @@
<div class="shop-item"> <div class="shop-item">
<div class="label-item"> <div class="label-item">
<span>订单来源</span> <span>订单来源</span>
<span>{{res.clientType}}</span> <span>{{res.clientType | clientTypeWay}}</span>
</div> </div>
<div class="label-item"> <div class="label-item">
<span>订单状态</span> <span>订单状态</span>

View File

@ -18,14 +18,14 @@ export default {
* @description api请求基础路径 * @description api请求基础路径
*/ */
api_dev: { api_dev: {
// common: 'https://common-api.pickmall.cn', common: 'https://common-api.pickmall.cn',
// buyer: 'https://buyer-api.pickmall.cn', buyer: 'https://buyer-api.pickmall.cn',
// seller: 'https://store-api.pickmall.cn', seller: 'https://store-api.pickmall.cn',
// manager: 'https://admin-api.pickmall.cn', manager: 'https://admin-api.pickmall.cn',
common: 'http://192.168.0.109:8890', // common: 'http://192.168.0.109:8890',
buyer: 'http://192.168.0.109:8888', // buyer: 'http://192.168.0.109:8888',
seller: 'http://192.168.0.109:8889', // seller: 'http://192.168.0.109:8889',
manager: 'http://192.168.0.109:8887' // manager: 'http://192.168.0.109:8887'
}, },
api_prod: { api_prod: {
common: 'https://common-api.pickmall.cn', common: 'https://common-api.pickmall.cn',

View File

@ -6,17 +6,32 @@
* @returns {*} * @returns {*}
*/ */
export function unitPrice(val, unit, location) { export function unitPrice(val, unit, location) {
let price = formatPrice(val) let price = formatPrice(val);
if (location === 'before') { if (location === "before") {
return price.substr(0, price.length - 3) return price.substr(0, price.length - 3);
} }
if (location === 'after') { if (location === "after") {
return price.substr(-2) return price.substr(-2);
} }
return (unit || '') + price return (unit || "") + price;
} }
/**
* 订单来源
*/
export function clientTypeWay(val) {
if (val == "H5") {
return "移动端";
} else if (val == "PC") {
return "PC端";
} else if (val == "WECHAT_MP") {
return "小程序端";
} else if (val == "APP") {
return "移动应用端";
} else {
return val;
}
}
/** /**
* 货币格式化 * 货币格式化
@ -24,8 +39,8 @@ export function unitPrice(val, unit, location) {
* @returns {string} * @returns {string}
*/ */
export function formatPrice(price) { export function formatPrice(price) {
if (typeof price !== 'number') return price if (typeof price !== "number") return price;
return String(Number(price).toFixed(2)).replace(/\B(?=(\d{3})+(?!\d))/g, ',') return String(Number(price).toFixed(2)).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
} }
/** /**
@ -35,51 +50,60 @@ export function formatPrice(price) {
* @returns {*|string} * @returns {*|string}
*/ */
export function unixToDate(unix, format) { export function unixToDate(unix, format) {
let _format = format || 'yyyy-MM-dd hh:mm:ss' let _format = format || "yyyy-MM-dd hh:mm:ss";
const d = new Date(unix * 1000) const d = new Date(unix * 1000);
const o = { const o = {
'M+': d.getMonth() + 1, "M+": d.getMonth() + 1,
'd+': d.getDate(), "d+": d.getDate(),
'h+': d.getHours(), "h+": d.getHours(),
'm+': d.getMinutes(), "m+": d.getMinutes(),
's+': d.getSeconds(), "s+": d.getSeconds(),
'q+': Math.floor((d.getMonth() + 3) / 3), "q+": Math.floor((d.getMonth() + 3) / 3),
S: d.getMilliseconds() S: d.getMilliseconds()
} };
if (/(y+)/.test(_format)) _format = _format.replace(RegExp.$1, (d.getFullYear() + '').substr(4 - RegExp.$1.length)) if (/(y+)/.test(_format))
for (const k in o) if (new RegExp('(' + k + ')').test(_format)) _format = _format.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length))) _format = _format.replace(
return _format RegExp.$1,
(d.getFullYear() + "").substr(4 - RegExp.$1.length)
);
for (const k in o)
if (new RegExp("(" + k + ")").test(_format))
_format = _format.replace(
RegExp.$1,
RegExp.$1.length === 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)
);
return _format;
} }
//是否格式化 //是否格式化
export function unixWhether(status) { export function unixWhether(status) {
switch (status) { switch (status) {
case 'YES': case "YES":
return "是" return "是";
case 'NO': case "NO":
return "否" return "否";
} }
} }
export function unixSellerBillStatus(status_code) { export function unixSellerBillStatus(status_code) {
switch (status_code) { switch (status_code) {
case 'OUT': case "OUT":
return '已出账' return "已出账";
case 'CHECK': case "CHECK":
return '已对账' return "已对账";
case 'EXAMINE': case "EXAMINE":
return '已审核' return "已审核";
case 'PAY': case "PAY":
return '已结算' return "已结算";
case 'COMPLETE': case "COMPLETE":
return '已完成' return "已完成";
} }
} }
export function unixSwitchStatus(status_code) { export function unixSwitchStatus(status_code) {
switch (status_code) { switch (status_code) {
case 'OPEN': case "OPEN":
return '开启' return "开启";
case 'CLOSE': case "CLOSE":
return '关闭' return "关闭";
} }
} }
@ -89,30 +113,35 @@ export function unixSwitchStatus(status_code) {
* @returns {*} * @returns {*}
*/ */
export function secrecyMobile(mobile) { export function secrecyMobile(mobile) {
mobile = String(mobile) mobile = String(mobile);
if (!/\d{11}/.test(mobile)) { if (!/\d{11}/.test(mobile)) {
return mobile return mobile;
} }
return mobile.replace(/(\d{3})(\d{4})(\d{4})/, '$1****$3') return mobile.replace(/(\d{3})(\d{4})(\d{4})/, "$1****$3");
} }
export function formatDate(date, fmt) { export function formatDate(date, fmt) {
if (/(y+)/.test(fmt)) { if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)); fmt = fmt.replace(
RegExp.$1,
(date.getFullYear() + "").substr(4 - RegExp.$1.length)
);
} }
let o = { let o = {
'M+': date.getMonth() + 1, "M+": date.getMonth() + 1,
'd+': date.getDate(), "d+": date.getDate(),
'h+': date.getHours(), "h+": date.getHours(),
'm+': date.getMinutes(), "m+": date.getMinutes(),
's+': date.getSeconds() "s+": date.getSeconds()
}; };
for (let k in o) { for (let k in o) {
if (new RegExp(`(${k})`).test(fmt)) { if (new RegExp(`(${k})`).test(fmt)) {
let str = o[k] + ''; let str = o[k] + "";
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str)); fmt = fmt.replace(
RegExp.$1,
RegExp.$1.length === 1 ? str : padLeftZero(str)
);
} }
} }
return fmt; return fmt;
}; }

View File

@ -21,7 +21,7 @@
<div class="div-item"> <div class="div-item">
<div class="div-item-left">订单来源</div> <div class="div-item-left">订单来源</div>
<div class="div-item-right"> <div class="div-item-right">
{{ orderInfo.order.clientType }} {{ orderInfo.order.clientType | clientTypeWay }}
</div> </div>
</div> </div>
</div> </div>

View File

@ -2,29 +2,12 @@
<div class="search"> <div class="search">
<Card> <Card>
<Row> <Row>
<Form <Form ref="searchForm" :model="searchForm" inline :label-width="100" class="search-form">
ref="searchForm"
:model="searchForm"
inline
:label-width="100"
class="search-form"
>
<Form-item label="优惠券名称"> <Form-item label="优惠券名称">
<Input <Input type="text" v-model="searchForm.couponName" placeholder="请输入优惠券名称" clearable style="width: 200px" />
type="text"
v-model="searchForm.couponName"
placeholder="请输入优惠券名称"
clearable
style="width: 200px"
/>
</Form-item> </Form-item>
<Form-item label="活动状态" prop="promotionStatus"> <Form-item label="活动状态" prop="promotionStatus">
<Select <Select v-model="searchForm.promotionStatus" placeholder="请选择" clearable style="width: 200px">
v-model="searchForm.promotionStatus"
placeholder="请选择"
clearable
style="width: 200px"
>
<Option value="NEW">未开始</Option> <Option value="NEW">未开始</Option>
<Option value="START">已开始/上架</Option> <Option value="START">已开始/上架</Option>
<Option value="END">已结束/下架</Option> <Option value="END">已结束/下架</Option>
@ -32,21 +15,9 @@
</Select> </Select>
</Form-item> </Form-item>
<Form-item label="活动时间"> <Form-item label="活动时间">
<DatePicker <DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间" style="width: 200px"></DatePicker>
v-model="selectDate"
type="daterange"
clearable
placeholder="选择起始时间"
style="width: 200px"
></DatePicker>
</Form-item> </Form-item>
<Button <Button @click="handleSearch" type="primary" class="search-btn" icon="ios-search">搜索</Button>
@click="handleSearch"
type="primary"
class="search-btn"
icon="ios-search"
>搜索</Button
>
<Button @click="handleReset" class="search-btn">重置</Button> <Button @click="handleReset" class="search-btn">重置</Button>
</Form> </Form>
</Row> </Row>
@ -55,57 +26,22 @@
<Button @click="delAll" class="ml_10">批量下架</Button> <Button @click="delAll" class="ml_10">批量下架</Button>
<!-- <Button @click="upAll"></Button> --> <!-- <Button @click="upAll"></Button> -->
</Row> </Row>
<Table <Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect">
:loading="loading"
border
:columns="columns"
:data="data"
ref="table"
sortable="custom"
@on-sort-change="changeSort"
@on-selection-change="changeSelect"
>
<template slot-scope="{ row }" slot="action"> <template slot-scope="{ row }" slot="action">
<Button <Button v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" type="info" size="small" style="margin-right: 10px" @click="edit(row)"></Button>
v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" <Button v-if="row.promotionStatus !== 'CLOSE'" type="error" size="small" @click="remove(row)"></Button>
type="info"
size="small"
style="margin-right: 10px"
@click="edit(row)"
>编辑</Button
>
<Button
v-if="row.promotionStatus !== 'CLOSE'"
type="error"
size="small"
@click="remove(row)"
>下架</Button
>
</template> </template>
</Table> </Table>
<Row type="flex" justify="end" class="page"> <Row type="flex" justify="end" class="page">
<Page <Page :current="searchForm.pageNumber + 1" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
:current="searchForm.pageNumber + 1" size="small" show-total show-elevator show-sizer></Page>
: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> </Card>
</div> </div>
</template> </template>
<script> <script>
import { import { getShopCouponList, updateCouponStatus } from "@/api/promotion";
getShopCouponList,
updateCouponStatus,
} from "@/api/promotion";
export default { export default {
name: "coupon", name: "coupon",
@ -143,18 +79,19 @@ export default {
{ {
title: "活动名称", title: "活动名称",
key: "promotionName", key: "promotionName",
width: 120, minWidth: 100,
fixed: "left", fixed: "left",
}, },
{ {
title: "优惠券名称", title: "优惠券名称",
key: "couponName", key: "couponName",
width: 120, minWidth: 100,
tooltip: true tooltip: true,
}, { },
{
title: "面额/折扣", title: "面额/折扣",
key: "price", key: "price",
width: 120, width: 100,
render: (h, params) => { render: (h, params) => {
if (params.row.price) { if (params.row.price) {
return h( return h(
@ -170,11 +107,13 @@ export default {
{ {
title: "领取数量/总数量", title: "领取数量/总数量",
key: "publishNum", key: "publishNum",
width: 130,
render: (h, params) => { render: (h, params) => {
return h( return h(
"div", params.row.receivedNum + "/" + params.row.publishNum) "div",
params.row.receivedNum + "/" + params.row.publishNum
);
}, },
minWidth:130,
}, },
{ {
title: "优惠券类型", title: "优惠券类型",
@ -210,21 +149,28 @@ export default {
}, },
{ {
title: "活动时间", title: "活动时间",
render: (h, params) => { render: (h, params) => {
if (params.row.getType === "ACTIVITY") {
return h("div", "长期有效");
} else {
return h("div", { return h("div", {
domProps: domProps: {
{innerHTML: params.row.startTime + "<br/>" + params.row.endTime} innerHTML:
}); params.row.startTime + "<br/>" + params.row.endTime,
},
});
}
}, },
minWidth:150,
}, },
{ {
title: "状态", title: "状态",
width: 100,
key: "promotionStatus", key: "promotionStatus",
fixed: "right", fixed: "right",
render: (h, params) => { render: (h, params) => {
let text = "未知", let text = "未知",
color = ""; color = "red";
if (params.row.promotionStatus == "NEW") { if (params.row.promotionStatus == "NEW") {
text = "未开始"; text = "未开始";
color = "default"; color = "default";
@ -250,14 +196,14 @@ export default {
), ),
]); ]);
}, },
minWidth:70, minWidth: 70,
}, },
{ {
title: "操作", title: "操作",
slot: "action", slot: "action",
align: "center", align: "center",
fixed: "right", fixed: "right",
minWidth: 140 maxWidth: 140,
}, },
], ],
data: [], // data: [], //
@ -292,8 +238,8 @@ export default {
this.getDataList(); this.getDataList();
}, },
handleReset() { handleReset() {
this.searchForm = {} this.searchForm = {};
this.selectDate = '' this.selectDate = "";
this.searchForm.pageNumber = 0; this.searchForm.pageNumber = 0;
this.getDataList(); this.getDataList();
}, },
@ -423,7 +369,7 @@ export default {
}); });
}, },
}, },
activated () { activated() {
this.init(); this.init();
}, },
}; };

View File

@ -329,19 +329,33 @@ export default {
}, },
/** /**
* dialog点击确定时判断 * 提交直播间商品
*/ */
addGoods() { addGoods() {
this.liveData.forEach((item, index) => {
this.commodityList.forEach((oldVal, i) => {
//
if (oldVal.liveGoodsId != item.liveGoodsId) {
addLiveGoods({ addLiveGoods({
roomId: this.$route.query.roomId, roomId: this.$route.query.roomId,
liveGoodsId: item.liveGoodsId, liveGoodsId: item.liveGoodsId,
}); });
},
/**
* dialog点击确定时判断
*/
addGoods() {
console.log(this.commodityList);
this.liveData.forEach((item, index) => {
if (this.commodityList.length == 1 && this.liveData.length == 1) {
addLiveGoods({
roomId: this.$route.query.roomId,
liveGoodsId: item.liveGoodsId,
});
} else {
this.commodityList.forEach((oldVal, i) => {
//
if (oldVal.liveGoodsId != item.liveGoodsId) {
} }
}); });
}
}); });
}, },