no message
commit
30fbe6ca83
|
@ -5,7 +5,7 @@
|
|||
<div>
|
||||
<div class="coupon-title">
|
||||
<router-link to="/">
|
||||
<img src="../assets/images/logo1.png" width="120" alt="">
|
||||
<img src="../assets/images/logo.png" width="120" alt="">
|
||||
</router-link>
|
||||
<p>领券中心</p>
|
||||
<Input search style="width:400px" @on-search='search' enter-button="搜索" placeholder="搜索优惠券" />
|
||||
|
|
|
@ -52,10 +52,6 @@ export const afterSaleStatusList = [
|
|||
name: '买家退货,待卖家收货',
|
||||
status: 'BUYER_RETURN'
|
||||
},
|
||||
{
|
||||
name: '商家换货/补发',
|
||||
status: 'SELLER_RE_DELIVERY'
|
||||
},
|
||||
{
|
||||
name: '卖家确认收货',
|
||||
status: 'SELLER_CONFIRM'
|
||||
|
|
|
@ -91,11 +91,15 @@
|
|||
</TabPane>
|
||||
<TabPane label="提现记录" name="log">
|
||||
<Table stripe :columns="logColumns" :data="logData.records">
|
||||
<template slot-scope="{ row }" slot="sn">
|
||||
<span>{{row.sn}}</span>
|
||||
</template>
|
||||
<template slot-scope="{ row }" slot="time">
|
||||
<span>{{row.createTime}}</span>
|
||||
</template>
|
||||
<template slot-scope="{ row }" slot="price">
|
||||
<span> +¥{{ row.price | unitPrice }}</span>
|
||||
<span v-if="row.distributionCashStatus == 'REFUSE'" style="color: green"> +¥{{ row.price | unitPrice }}</span>
|
||||
<span v-else style="color: red"> -¥{{ row.price | unitPrice }}</span>
|
||||
</template>
|
||||
<template slot-scope="{ row }" slot="status">
|
||||
<span> {{row.distributionCashStatus == "APPLY" ? "待处理" : row.distributionCashStatus == "PASS" ? "通过" : "拒绝"}}</span>
|
||||
|
@ -186,6 +190,7 @@ export default {
|
|||
{title: '操作', slot: 'action', width: 120}
|
||||
],
|
||||
logColumns: [ // 日志表头
|
||||
{title: '编号', slot: 'sn'},
|
||||
{title: '申请时间', slot: 'time'},
|
||||
{title: '提现金额', slot: 'price'},
|
||||
{title: '提现状态', slot: 'status'}
|
||||
|
@ -298,7 +303,7 @@ export default {
|
|||
},
|
||||
getLog () { // 提现历史
|
||||
distCashHistory(this.logParams).then(res => {
|
||||
if (res.success) this.goodsData = res.result
|
||||
if (res.success) this.logData = res.result
|
||||
})
|
||||
},
|
||||
distribution () { // 获取分销商信息
|
||||
|
|
|
@ -8,8 +8,11 @@
|
|||
<div class="goodsImg hover-pointer" v-if="params.type === 'GOODS'">
|
||||
<img :src="item.image" />
|
||||
</div>
|
||||
<div class="goodsTitle hover-pointer">
|
||||
{{params.type === 'GOODS'? item.goodsName : item.storeName}}
|
||||
<div class="goodsTitle hover-color" v-if="params.type === 'GOODS'" @click="buynow(item.skuId, item.goodsId)">
|
||||
{{item.goodsName}}
|
||||
</div>
|
||||
<div v-else class="goodsTitle hover-pointer">
|
||||
{{item.storeName}}
|
||||
</div>
|
||||
<div class="goodsPrice">
|
||||
<span v-if="params.type === 'GOODS'">{{item.price | unitPrice('¥')}}</span>
|
||||
|
@ -26,14 +29,6 @@
|
|||
<Spin size="large" fix v-if="spinShow"></Spin>
|
||||
</div>
|
||||
<empty v-else />
|
||||
<!-- 分页 -->
|
||||
<!-- <div class="page-size mt_10" v-if="paging">
|
||||
<Page :total="total" @on-change="changePageNum"
|
||||
@on-page-size-change="changePageSize"
|
||||
:page-size="params.pageSize"
|
||||
show-sizer>
|
||||
</Page>
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -91,15 +86,6 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
changePageNum (val) { // 修改页码
|
||||
this.params.pageNumber = val;
|
||||
this.getList()
|
||||
},
|
||||
changePageSize (val) { // 修改页数
|
||||
this.pageNumber = 1;
|
||||
this.params.pageSize = val;
|
||||
this.getList()
|
||||
},
|
||||
buynow (skuId, goodsId) { // 跳转详情
|
||||
let url = this.$router.resolve({
|
||||
path: '/goodsDetail',
|
||||
|
|
|
@ -19,10 +19,7 @@
|
|||
<empty v-if="orderList.length === 0" />
|
||||
<div class="order-content" v-else>
|
||||
<template v-for="(order, onderIndex) in orderList">
|
||||
<div
|
||||
class="order-list"
|
||||
:key="onderIndex"
|
||||
>
|
||||
<div class="order-list" :key="onderIndex">
|
||||
<div class="order-header">
|
||||
<div>
|
||||
<div v-if="order.serviceStatus">{{filterOrderStatus(order.serviceStatus)}}</div>
|
||||
|
@ -32,7 +29,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<span>{{ order.applyRefundPrice | unitPrice("¥") }}</span>
|
||||
<span>申请退款金额:<span class="global_color">{{ order.applyRefundPrice | unitPrice("¥") }}</span></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="order-body">
|
||||
|
@ -57,12 +54,11 @@
|
|||
<Button @click="goDetail(order.sn)" size="small">售后详情</Button>
|
||||
<Button @click="openModal(order)" v-if="order.serviceStatus == 'PASS' &&
|
||||
order.serviceType != 'RETURN_MONEY'" size="small">提交物流</Button>
|
||||
|
||||
<Button @click="cancel(order.sn)" v-if="order.afterSaleAllowOperationVO.cancel" size="small">取消售后</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>+
|
||||
</template>
|
||||
<Spin size="large" fix v-if="spinShow"></Spin>
|
||||
</div>
|
||||
<!-- 分页 -->
|
||||
|
|
|
@ -34,7 +34,10 @@
|
|||
<td>退款方式</td><td>{{afterSale.refundWay == 'ORIGINAL' ? '原路退回' : '账号退款'}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>退款金额</td><td>{{afterSale.actualRefundPrice | unitPrice('¥')}}</td>
|
||||
<td>申请退款金额</td><td>{{afterSale.applyRefundPrice | unitPrice('¥')}}</td>
|
||||
</tr>
|
||||
<tr v-if="afterSale.actualRefundPrice">
|
||||
<td>实际退款金额</td><td>{{afterSale.actualRefundPrice | unitPrice('¥')}}</td>
|
||||
</tr>
|
||||
<template v-if="afterSale.refundWay === 'OFFLINE'">
|
||||
<tr>
|
||||
|
|
|
@ -339,7 +339,7 @@ export default {
|
|||
} else if (params.row.applyStatus === 'VIA_AUDITING') {
|
||||
return h('div', [h('span', {}, '提现成功')]);
|
||||
} else {
|
||||
return h('div', [h('span', {}, '审核未通过')]);
|
||||
return h('div', [h('span', {}, '审核拒绝')]);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -350,7 +350,8 @@ export default {
|
|||
},
|
||||
{
|
||||
title: '审核备注',
|
||||
key: 'inspectRemark'
|
||||
key: 'inspectRemark',
|
||||
tooltip: true
|
||||
|
||||
}
|
||||
],
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
"pinyin": "^2.9.0",
|
||||
"print-js": "^1.0.63",
|
||||
"qrcodejs2": "0.0.2",
|
||||
"quill": "^1.3.7",
|
||||
"sass-loader": "^8.0.2",
|
||||
"sockjs-client": "^1.4.0",
|
||||
"stompjs": "^2.3.3",
|
||||
|
|
|
@ -29,8 +29,6 @@
|
|||
<script src="https://cdn.jsdelivr.net/npm/gitalk@1.5.0/dist/gitalk.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/js-cookie@2.2.1/src/js.cookie.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/wangeditor@3.1.1/release/wangEditor.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/quill@1.3.7/dist/quill.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/quill@1.3.7/dist/quill.snow.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/stomp.js/2.3.3/stomp.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.8.4/Sortable.min.js"></script>
|
||||
|
|
|
@ -304,11 +304,6 @@ export const deleteMessageSend = (ids, params) => {
|
|||
return deleteRequest(`/manager/messageSend/delByIds/${ids}`, params);
|
||||
};
|
||||
|
||||
// 通过id获取子地区
|
||||
export const getRegion = (id) => {
|
||||
return getRequest(`/region/item/${id}`);
|
||||
};
|
||||
|
||||
// 分页获取文件数据
|
||||
export const getFileListData = (params) => {
|
||||
return getRequest("/file", params);
|
||||
|
@ -389,11 +384,6 @@ export const delRegion = (ids) => {
|
|||
return deleteRequest(`/region/${ids}`);
|
||||
};
|
||||
|
||||
// 通过id获取地区详情
|
||||
export const getRegionDetail = (id) => {
|
||||
return getRequest(`/region/${id}`);
|
||||
};
|
||||
|
||||
// 更新地区
|
||||
export const updateRegion = (id, params) => {
|
||||
return putRequest(`/region/${id}`, params);
|
||||
|
|
|
@ -117,16 +117,10 @@ export const getAfterSaleOrderPage = (params) => {
|
|||
export const getAfterSaleOrderDetail = (sn) => {
|
||||
return getRequest(`/afterSale/get/${sn}`)
|
||||
}
|
||||
|
||||
//售后单查询物流
|
||||
export const getSellerDeliveryTraces = (sn, params) => {
|
||||
return getRequest(`/afterSale/getSellerDeliveryTraces/${sn}`, params)
|
||||
export const getAfterSaleTraces = (sn) => {
|
||||
return getRequest(`/afterSale/getDeliveryTraces/${sn}`)
|
||||
}
|
||||
//售后单查询物流
|
||||
export const getAfterSaleTraces = (sn, params) => {
|
||||
return getRequest(`/afterSale/getDeliveryTraces/${sn}`, params)
|
||||
}
|
||||
|
||||
// 获取商家选中的物流公司
|
||||
export const getLogisticsChecked = () => {
|
||||
return getRequest(`/logistics/getChecked`)
|
||||
|
@ -157,6 +151,11 @@ export const refundLog = (params) => {
|
|||
return getRequest(`/refundLog`, params)
|
||||
}
|
||||
|
||||
//售后单商家收货信息
|
||||
export const storeAddress = (sn) => {
|
||||
return getRequest(`/afterSale/getStoreAfterSaleAddress/${sn}`)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -21,7 +21,10 @@ export default {
|
|||
buyer: "https://buyer-api.pickmall.cn",
|
||||
seller: "https://store-api.pickmall.cn",
|
||||
manager: "https://admin-api.pickmall.cn"
|
||||
|
||||
// common: 'http://192.168.0.101:8890',
|
||||
// buyer: 'http://192.168.0.101:8888',
|
||||
// seller: 'http://192.168.0.101:8889',
|
||||
// manager: 'http://192.168.0.101:8887'
|
||||
},
|
||||
api_prod: {
|
||||
common: "https://common-api.pickmall.cn",
|
||||
|
|
|
@ -103,6 +103,7 @@ service.interceptors.response.use(
|
|||
|
||||
} else {
|
||||
// 其他错误处理
|
||||
console.log(error.response.data);
|
||||
Message.error(error.response.data.message)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -331,7 +331,6 @@ util.initRouter = function (vm) { // 初始化路由
|
|||
getCurrentPermissionList().then(res => {
|
||||
if (!res.success) return false;
|
||||
let menuData = res.result;
|
||||
// let menuData = result
|
||||
|
||||
// 格式化数据,设置 空children 为 null
|
||||
for(let i =0;i<menuData.length;i++){
|
||||
|
@ -340,6 +339,8 @@ util.initRouter = function (vm) { // 初始化路由
|
|||
let tt = t[k].children;
|
||||
for(let z = 0;z<tt.length;z++){
|
||||
tt[z].children = null
|
||||
// 给所有三级路由添加字段,显示一级菜单name,方便点击页签时的选中筛选
|
||||
tt[z].firstRouterName = menuData[i].name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -395,8 +396,7 @@ util.initMenuData = function (vm, data) {
|
|||
menuData.forEach(e => {
|
||||
let nav = {
|
||||
name: e.name,
|
||||
title: e.title,
|
||||
icon: e.icon
|
||||
title: e.title
|
||||
}
|
||||
navList.push(nav);
|
||||
})
|
||||
|
@ -460,6 +460,7 @@ util.initRouterNode = function (routers, data) { // data为所有子菜单数
|
|||
meta.permTypes = menu.permTypes ? menu.permTypes : null;
|
||||
meta.title = menu.title ? menu.title + " - lilishop 运营后台" : null;
|
||||
meta.url = menu.url ? menu.url : null;
|
||||
meta.firstRouterName = item.firstRouterName
|
||||
menu.meta = meta;
|
||||
|
||||
routers.push(menu);
|
||||
|
|
|
@ -36,12 +36,6 @@ export const otherRouter = {
|
|||
name: "change_password",
|
||||
component: () => import("@/views/change-password/change-password.vue")
|
||||
},
|
||||
{
|
||||
path: "message",
|
||||
title: "消息中心",
|
||||
name: "message_index",
|
||||
component: () => import("@/views/message/message.vue")
|
||||
},
|
||||
{
|
||||
path: "category",
|
||||
title: "类型列表",
|
||||
|
@ -72,26 +66,6 @@ export const otherRouter = {
|
|||
name: "shop-detail",
|
||||
component: () => import("@/views/seller/shop/shopDetail.vue")
|
||||
},
|
||||
{
|
||||
path: "add-edit-message",
|
||||
title: "消息详情",
|
||||
name: "add_edit_message",
|
||||
component: () =>
|
||||
import("@/views/member/message-manage/addOrEditMessage.vue")
|
||||
},
|
||||
{
|
||||
path: "add_message",
|
||||
title: "会员站内信",
|
||||
name: "add_message",
|
||||
component: () => import("@/views/member/notice/addMessage.vue")
|
||||
},
|
||||
{
|
||||
path: "message-send-detail",
|
||||
title: "消息发送详情",
|
||||
name: "message_send_detail",
|
||||
component: () =>
|
||||
import("@/views/member/message-manage/messageSendDetail.vue")
|
||||
},
|
||||
{
|
||||
path: "bill-detail",
|
||||
title: "结算单详情",
|
||||
|
|
|
@ -57,8 +57,6 @@
|
|||
<script>
|
||||
import shrinkableMenu from "./main-components/shrinkable-menu/shrinkable-menu.vue";
|
||||
import tagsPageOpened from "./main-components/tags-page-opened.vue";
|
||||
import breadcrumbNav from "./main-components/breadcrumb-nav.vue";
|
||||
import fullScreen from "./main-components/fullscreen.vue";
|
||||
import messageTip from "./main-components/message-tip.vue";
|
||||
import circleLoading from "@/views/my-components/lili/circle-loading.vue";
|
||||
import Cookies from "js-cookie";
|
||||
|
@ -70,8 +68,6 @@ export default {
|
|||
components: {
|
||||
shrinkableMenu,
|
||||
tagsPageOpened,
|
||||
breadcrumbNav,
|
||||
fullScreen,
|
||||
messageTip,
|
||||
circleLoading,
|
||||
},
|
||||
|
|
|
@ -5,16 +5,19 @@
|
|||
|
||||
<Divider orientation="left">分销设置</Divider>
|
||||
<FormItem label="是否开启分销" prop="distribution">
|
||||
<i-switch size="large" v-model="form.isOpen" :true-value="true" :false-value="false" @on-change="handleSubmit">
|
||||
<i-switch size="large" v-model="form.isOpen" :true-value="true" :false-value="false">
|
||||
<span slot="open">开启</span>
|
||||
<span slot="close">关闭</span>
|
||||
</i-switch>
|
||||
</FormItem>
|
||||
<FormItem label="分销关系绑定天数" prop="distributionDay">
|
||||
<InputNumber :min="1" style="width:100px;" v-model="form.distributionDay" @on-change="handleSubmit"></InputNumber>
|
||||
<InputNumber :min="1" style="width:100px;" v-model="form.distributionDay"></InputNumber>
|
||||
</FormItem>
|
||||
<FormItem label="分销结算天数" prop="cashDay">
|
||||
<InputNumber :min="1" style="width:100px;" v-model="form.cashDay" @on-change="handleSubmit "></InputNumber>
|
||||
<InputNumber :min="1" style="width:100px;" v-model="form.cashDay"></InputNumber>
|
||||
</FormItem>
|
||||
<FormItem>
|
||||
<Button type="primary" @click="submit">保存</Button>
|
||||
</FormItem>
|
||||
</Form>
|
||||
</div>
|
||||
|
@ -36,22 +39,18 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
// 获取分销设置数据
|
||||
getDataList() {
|
||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||
getSetting("DISTRIBUTION_SETTING").then((res) => {
|
||||
if (res.success) {
|
||||
this.form = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 提交数据
|
||||
handleSubmit() {
|
||||
this.$options.filters.debounce(this.submit(), 1500);
|
||||
},
|
||||
// 提交api
|
||||
submit() {
|
||||
setSetting("DISTRIBUTION_SETTING", this.form).then((res) => {
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
<template>
|
||||
<div class="search">
|
||||
<Card>
|
||||
<Row @keydown.enter.native="handleSearch"> </Row>
|
||||
<Row class="operation">
|
||||
<Button @click="add" type="primary">添加</Button>
|
||||
|
||||
<Button @click="delAll">批量删除</Button>
|
||||
</Row>
|
||||
<Table
|
||||
|
@ -58,15 +56,13 @@ import {
|
|||
addGoodsUnit,
|
||||
getGoodsUnitPage,
|
||||
updateGoodsUnit,
|
||||
delGoodsUnit, delSensitive,
|
||||
delGoodsUnit
|
||||
} from "@/api/index";
|
||||
export default {
|
||||
name: "bill",
|
||||
components: {},
|
||||
name: "goods-unit",
|
||||
data() {
|
||||
return {
|
||||
loading: true, // 表单加载状态
|
||||
modalType: 0, // 添加或编辑标识
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
modalTitle: "", // 添加或编辑标题
|
||||
searchForm: {
|
||||
|
@ -141,7 +137,7 @@ export default {
|
|||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.detail(params.row);
|
||||
this.edit(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -174,46 +170,37 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
// 分页 改变页码
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
// 分页 改变页数
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
// 搜索
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
handleReset() {
|
||||
this.$refs.searchForm.resetFields();
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
// 重新加载数据
|
||||
this.getDataList();
|
||||
},
|
||||
changeSort(e) {
|
||||
this.searchForm.sort = e.key;
|
||||
this.searchForm.order = e.order;
|
||||
if (e.order === "normal") {
|
||||
this.searchForm.order = "";
|
||||
}
|
||||
this.getDataList();
|
||||
},
|
||||
// 清除选中
|
||||
clearSelectAll() {
|
||||
this.$refs.table.selectAll(false);
|
||||
},
|
||||
// 选中回调
|
||||
changeSelect(e) {
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
|
||||
// 获取列表数据
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
|
||||
|
@ -227,12 +214,13 @@ export default {
|
|||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
},
|
||||
// 修改后提交
|
||||
handleSubmit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
|
||||
if (this.modalType == 0) {
|
||||
if (this.modalTitle == "添加") {
|
||||
// 添加 避免编辑后传入id等数据 记得删除
|
||||
delete this.form.id;
|
||||
addGoodsUnit(this.form).then((res) => {
|
||||
|
@ -257,21 +245,22 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
// 添加
|
||||
add() {
|
||||
this.modalType = 0;
|
||||
this.modalTitle = "添加";
|
||||
this.form = {};
|
||||
this.$refs.form.resetFields();
|
||||
|
||||
this.modalVisible = true;
|
||||
},
|
||||
detail(v) {
|
||||
this.modalType = 1;
|
||||
// 编辑
|
||||
edit(v) {
|
||||
this.id = v.id;
|
||||
this.modalTitle = "修改";
|
||||
this.modalVisible = true;
|
||||
this.form.name = v.name;
|
||||
},
|
||||
// 删除
|
||||
remove(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
|
@ -290,6 +279,7 @@ export default {
|
|||
},
|
||||
});
|
||||
},
|
||||
// 全部删除
|
||||
delAll() {
|
||||
if (this.selectCount <= 0) {
|
||||
this.$Message.warning("您还未选择要删除的数据");
|
||||
|
@ -314,9 +304,9 @@ export default {
|
|||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
|
|
|
@ -149,12 +149,8 @@ export default {
|
|||
this.previewGoodsPicture = url;
|
||||
this.goodsPictureVisible = true;
|
||||
}
|
||||
,
|
||||
}
|
||||
,
|
||||
|
||||
}
|
||||
;
|
||||
</script>
|
||||
|
||||
<style lang="scss" soped>
|
||||
|
|
|
@ -78,10 +78,7 @@
|
|||
</Form>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||
<Button type="primary" :loading="submitLoading" @click="saveSpec"
|
||||
>提交
|
||||
</Button
|
||||
>
|
||||
<Button type="primary" :loading="submitLoading" @click="saveSpec">提交</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
|
@ -318,7 +315,6 @@ export default {
|
|||
content: "您确认要删除 " + v.specName + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
delSpec(v.id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
|
@ -345,7 +341,6 @@ export default {
|
|||
ids += e.id + ",";
|
||||
});
|
||||
ids = ids.substring(0, ids.length - 1);
|
||||
// 批量删除
|
||||
delSpec(ids).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
|
|
|
@ -9,8 +9,7 @@
|
|||
<Button @click="handleSearch" type="primary" class="search-btn" icon="ios-search">搜索</Button>
|
||||
</Form>
|
||||
</Row>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"
|
||||
@on-sort-change="changeSort" @on-selection-change="changeSelect">
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10">
|
||||
<!-- 页面展示 -->
|
||||
<template slot="shopDisableSlot" slot-scope="scope">
|
||||
<div>
|
||||
|
@ -39,7 +38,7 @@
|
|||
<div class="show">
|
||||
<label>页面展示:</label>
|
||||
<i-switch size="large" true-value="OPEN" false-value="CLOSE" v-model="infoData.status"
|
||||
@on-change="changeRadio" style="margin-top: 3px">
|
||||
@on-change="changeSwitchView" style="margin-top: 3px">
|
||||
<span slot="open">展示</span>
|
||||
<span slot="close">隐藏</span>
|
||||
</i-switch>
|
||||
|
@ -98,11 +97,10 @@
|
|||
import * as API_Member from "@/api/member";
|
||||
|
||||
export default {
|
||||
name: "shop",
|
||||
components: {},
|
||||
name: "goods-review", // 会员评价
|
||||
data() {
|
||||
return {
|
||||
infoData: "", // 商品信息
|
||||
infoData: {}, // 商品信息
|
||||
infoFlag: false, // 评价展示
|
||||
infoTitle: "", // modal名称
|
||||
loading: true, // 表单加载状态
|
||||
|
@ -115,9 +113,6 @@ export default {
|
|||
startDate: "", // 起始时间
|
||||
endDate: "", // 终止时间
|
||||
},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [
|
||||
// 表头
|
||||
{
|
||||
|
@ -223,7 +218,8 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
changeRadio(val) {
|
||||
// 切换查看switch
|
||||
changeSwitchView(val) {
|
||||
let status = val;
|
||||
API_Member.updateMemberReview(this.infoData.id, {status}).then(
|
||||
(res) => {
|
||||
|
@ -232,45 +228,27 @@ export default {
|
|||
}
|
||||
);
|
||||
},
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
// 分页 改变页码
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
// 分页 改变页数
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
// 搜索
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
|
||||
changeSort(e) {
|
||||
this.searchForm.sort = e.key;
|
||||
this.searchForm.order = e.order;
|
||||
if (e.order === "normal") {
|
||||
this.searchForm.order = "";
|
||||
}
|
||||
this.getDataList();
|
||||
},
|
||||
clearSelectAll() {
|
||||
this.$refs.table.selectAll(false);
|
||||
},
|
||||
changeSelect(e) {
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
selectDateRange(v) {
|
||||
if (v) {
|
||||
this.searchForm.startDate = v[0];
|
||||
this.searchForm.endDate = v[1];
|
||||
}
|
||||
},
|
||||
//列表直接选择页面是否展示
|
||||
changeSwitch(v) {
|
||||
let status = v.status;
|
||||
|
@ -278,9 +256,9 @@ export default {
|
|||
this.init();
|
||||
});
|
||||
},
|
||||
// 获取列表
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||
API_Member.getMemberReview(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
|
@ -301,11 +279,10 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 删除评论
|
||||
remove(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
// 记得确认修改此处
|
||||
content: "您确认要删除会员" + v.memberName + "的评论?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
|
@ -316,33 +293,6 @@ export default {
|
|||
},
|
||||
});
|
||||
},
|
||||
delAll() {
|
||||
if (this.selectCount <= 0) {
|
||||
this.$Message.warning("您还未选择要删除的数据");
|
||||
return;
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
content: "您确认要删除所选的 " + this.selectCount + " 条数据?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
let ids = "";
|
||||
this.selectList.forEach(function (e) {
|
||||
ids += e.id + ",";
|
||||
});
|
||||
ids = ids.substring(0, ids.length - 1);
|
||||
// 批量删除
|
||||
this.deleteRequest("/shop/delByIds/" + ids).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.clearSelectAll();
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
|
|
|
@ -170,8 +170,6 @@ h4 {
|
|||
.flow-box-splice:nth-last-of-type(1) {
|
||||
margin-right: 0;
|
||||
}
|
||||
.flow-splice {
|
||||
}
|
||||
|
||||
.flow-box-splice,
|
||||
.flow-member,
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
<template>
|
||||
<div>
|
||||
<!-- 统计 -->
|
||||
|
||||
<div class="card">
|
||||
<h4>
|
||||
|
||||
基本信息
|
||||
</h4>
|
||||
<div class="count-list flex">
|
||||
|
@ -16,7 +14,6 @@
|
|||
<div class="counts">{{homeData.goodsNum ||0}}</div>
|
||||
<div>商品数量</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="count-item" @click="navigateTo('memberList')">
|
||||
<div>
|
||||
|
@ -52,7 +49,6 @@
|
|||
</div>
|
||||
|
||||
<!-- 今日待办 -->
|
||||
|
||||
<div class="card">
|
||||
<h4>今日待办</h4>
|
||||
<div class="todo-list flex">
|
||||
|
@ -88,10 +84,7 @@
|
|||
<div class="flow-list flex">
|
||||
<div class="flow-item ">
|
||||
<div class="flow-member">
|
||||
<div>
|
||||
|
||||
当前在线人数
|
||||
</div>
|
||||
<div>当前在线人数</div>
|
||||
<span>
|
||||
{{homeData.currentNumberPeopleOnline || 0}}
|
||||
</span>
|
||||
|
@ -149,7 +142,6 @@
|
|||
</div>
|
||||
<div class="today-item">
|
||||
<div>今日交易额</div>
|
||||
|
||||
<span>¥{{homeData.todayOrderPrice ? (homeData.todayOrderPrice | unitPrice) : 0}}</span>
|
||||
</div>
|
||||
<div class="today-item">
|
||||
|
@ -209,15 +201,11 @@
|
|||
|
||||
<script>
|
||||
import { homeStatistics, hotGoods, hotShops, getNoticePage } from "@/api/index";
|
||||
import show from "./show.vue";
|
||||
import * as API_Goods from "@/api/goods";
|
||||
import { Chart } from "@antv/g2";
|
||||
import * as API_Member from "@/api/member";
|
||||
export default {
|
||||
name: "home",
|
||||
components: {
|
||||
show,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tophotShopsColumns: [ // 表格表头
|
||||
|
@ -298,16 +286,8 @@ export default {
|
|||
},
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
currNav() {
|
||||
return this.$store.state.app.currNav;
|
||||
},
|
||||
avatarPath() {
|
||||
return localStorage.avatorImgPath;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 路由跳转
|
||||
navigateTo(name) {
|
||||
this.$router.push({
|
||||
name,
|
||||
|
@ -366,7 +346,7 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
|
||||
// 订单表
|
||||
initOrderChart() {
|
||||
// 默认已经加载 legend-filter 交互
|
||||
let data = this.chartList;
|
||||
|
@ -402,9 +382,6 @@ export default {
|
|||
this.orderChart.render();
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
// 浏览量统计图
|
||||
initPvChart() {
|
||||
let uv = [];
|
||||
|
@ -477,7 +454,8 @@ export default {
|
|||
this.initPvChart();
|
||||
}
|
||||
});
|
||||
}, // 实例化会员流量图表
|
||||
},
|
||||
// 实例化会员流量图表
|
||||
async initHistoryMemberChartList() {
|
||||
const res = await API_Member.historyMemberChartList();
|
||||
if (res.success) {
|
||||
|
@ -495,6 +473,7 @@ export default {
|
|||
this.initHistoryMemberChart();
|
||||
}
|
||||
},
|
||||
// 历史在线人数
|
||||
initHistoryMemberChart(){
|
||||
// 默认已经加载 legend-filter 交互
|
||||
let data = this.chartList;
|
||||
|
|
|
@ -1,86 +0,0 @@
|
|||
|
||||
<template>
|
||||
<div>
|
||||
<Card>
|
||||
<Row>
|
||||
<Form
|
||||
ref="searchForm"
|
||||
inline
|
||||
:label-width="70"
|
||||
|
||||
@keydown.enter.native="handleGo"
|
||||
>
|
||||
<Form-item label="链接地址" prop="url">
|
||||
<Input type="text" v-model="url" placeholder="http://" clearable style="width: 350px" />
|
||||
</Form-item>
|
||||
<Form-item style="margin-left:-50px;">
|
||||
<Button @click="handleGo" type="primary" icon="ios-send" style="margin-right:5px">前往</Button>
|
||||
<Button @click="handleOpen" icon="md-open">新窗口中打开</Button>
|
||||
</Form-item>
|
||||
</Form>
|
||||
</Row>
|
||||
<Divider style="margin-top:-10px;margin-bottom:0px;" />
|
||||
<Row>
|
||||
<div style="position:relative;">
|
||||
<iframe
|
||||
id="iframe"
|
||||
:src="go"
|
||||
frameborder="0"
|
||||
width="100%"
|
||||
:height="height"
|
||||
scrolling="auto"
|
||||
></iframe>
|
||||
<Spin fix size="large" v-if="loading"></Spin>
|
||||
</div>
|
||||
</Row>
|
||||
</Card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "show",
|
||||
data() {
|
||||
return {
|
||||
loading: false, // 加载状态
|
||||
go: "", // 跳转地址
|
||||
url: "", // 链接地址
|
||||
height: "525px" // iframe高度
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
currNav() {
|
||||
return this.$store.state.app.currNav;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initUrl() {
|
||||
let url;
|
||||
if (this.currNav == "doc") {
|
||||
url = "https://www.kancloud.cn/lili/lili/content";
|
||||
}
|
||||
if (url) {
|
||||
this.url = url;
|
||||
this.go = url;
|
||||
}
|
||||
},
|
||||
handleGo() {
|
||||
this.go = this.url;
|
||||
},
|
||||
handleOpen() {
|
||||
window.open(this.url);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
currNav(v, oldV) {
|
||||
this.initUrl();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// 计算高度
|
||||
let height = document.documentElement.clientHeight;
|
||||
this.height = Number(height - 217) + "px";
|
||||
this.initUrl();
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -3,11 +3,8 @@
|
|||
<div class="breadcrumb">
|
||||
<span @click="clickBreadcrumb(item,index)" :class="{'active':item.selected}" v-for="(item,index) in dateList" :key="index"> {{item.title}}</span>
|
||||
<div class="date-picker">
|
||||
|
||||
<Select @on-change="changeSelect(selectedWay)" v-model="month" placeholder="年月查询" style="width:200px;margin-left:10px;">
|
||||
|
||||
<Option v-for="(item,index) in dates" :value="item.year+'-'+item.month" :key="index">{{ item.year+'年'+item.month+'月' }}</Option>
|
||||
|
||||
</Select>
|
||||
</div>
|
||||
<div class="shop-list" v-if="!closeShop">
|
||||
|
@ -72,6 +69,7 @@ export default {
|
|||
this.getShopList();
|
||||
},
|
||||
methods: {
|
||||
// 页面触底
|
||||
handleReachBottom() {
|
||||
setTimeout(() => {
|
||||
if (this.params.pageNumber * this.params.pageSize <= this.total) {
|
||||
|
@ -80,6 +78,7 @@ export default {
|
|||
}
|
||||
}, 1500);
|
||||
},
|
||||
// 查询店铺列表
|
||||
getShopList() {
|
||||
getShopListData(this.params).then((res) => {
|
||||
if (res.success) {
|
||||
|
@ -92,6 +91,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
// 变更店铺
|
||||
changeshop(val) {
|
||||
this.selectedWay.storeId = this.storeId;
|
||||
this.$emit("selected", this.selectedWay);
|
||||
|
@ -118,7 +118,7 @@ export default {
|
|||
}
|
||||
this.dates = dates.reverse();
|
||||
},
|
||||
|
||||
// 改变已选店铺
|
||||
changeSelect() {
|
||||
console.log(this.month);
|
||||
if (this.month) {
|
||||
|
@ -130,11 +130,10 @@ export default {
|
|||
this.selectedWay.searchType = "";
|
||||
|
||||
this.$emit("selected", this.selectedWay);
|
||||
// console.log(this.$emit("selected", this.selectedWay));
|
||||
} else {
|
||||
}
|
||||
},
|
||||
|
||||
// 变更时间
|
||||
clickBreadcrumb(item) {
|
||||
this.dateList.forEach((res) => {
|
||||
res.selected = false;
|
||||
|
@ -148,7 +147,6 @@ export default {
|
|||
}
|
||||
|
||||
this.selectedWay = item;
|
||||
// this.month = "";
|
||||
this.selectedWay.year = new Date().getFullYear();
|
||||
this.selectedWay.month = "";
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
</template>
|
||||
<script>
|
||||
|
||||
import * as API_Setup from "@/api/index.js";
|
||||
import * as API_Setup from "@/api/common.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -27,6 +27,7 @@ export default {
|
|||
|
||||
props: ['addressId'],
|
||||
methods: {
|
||||
// 选择地区回调
|
||||
change(val, selectedData) {
|
||||
/**
|
||||
* @returns [regionId,region]
|
||||
|
@ -44,9 +45,10 @@ export default {
|
|||
handleChangeOnSelect(value) {
|
||||
this.changeOnSelect = value;
|
||||
},
|
||||
// 加载地区数据
|
||||
loadData(item, callback) {
|
||||
item.loading = true;
|
||||
API_Setup.getRegion(item.value).then((res) => {
|
||||
API_Setup.getChildRegion(item.value).then((res) => {
|
||||
if (res.result.length <= 0) {
|
||||
item.loading = false;
|
||||
this.selected = item;
|
||||
|
@ -83,8 +85,9 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
// 初始化
|
||||
init() {
|
||||
API_Setup.getRegion(this.id).then((res) => {
|
||||
API_Setup.getChildRegion(this.id).then((res) => {
|
||||
let way = [];
|
||||
|
||||
res.result.forEach((item) => {
|
||||
|
@ -105,7 +108,6 @@ export default {
|
|||
}
|
||||
way.push(data);
|
||||
});
|
||||
|
||||
this.data = way;
|
||||
});
|
||||
},
|
||||
|
|
|
@ -1,246 +0,0 @@
|
|||
<template>
|
||||
<div class="wrapper">
|
||||
<div class="wap-content">
|
||||
<div class="query-wrapper">
|
||||
<div class="query-item">
|
||||
<div>搜索范围</div>
|
||||
<Input placeholder="商品名称" @on-clear="goodsData=[]; goodsParams.goodsName=''; goodsParams.pageNumber = 1; getQueryGoodsList()" @on-enter="()=>{goodsData=[];goodsParams.pageNumber =1; getQueryGoodsList();}" icon="ios-search" clearable
|
||||
style="width: 150px" v-model="goodsParams.goodsName" />
|
||||
</div>
|
||||
<div class="query-item">
|
||||
<Cascader v-model="category" placeholder="请选择商品分类" style="width: 250px" :data="skuList"></Cascader>
|
||||
</div>
|
||||
<div class="query-item">
|
||||
<Button type="primary" @click="goodsData=[]; getQueryGoodsList();" icon="ios-search">搜索</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="positon:retavle;">
|
||||
<Scroll class="wap-content-list" :on-reach-bottom="handleReachBottom" :distance-to-edge="[3,3]">
|
||||
<div class="wap-content-item" :class="{ active: item.selected }" @click="checkedGoods(item, index)" v-for="(item, index) in goodsData" :key="index">
|
||||
<div>
|
||||
<img :src="item.thumbnail" alt="" />
|
||||
</div>
|
||||
<div class="wap-content-desc">
|
||||
<div class="wap-content-desc-title">{{ item.goodsName }}</div>
|
||||
<div class="wap-sku">{{ item.goodsUnit }}</div>
|
||||
<div class="wap-content-desc-bottom">
|
||||
<div>¥{{ item.price | unitPrice }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Spin size="large" fix v-if="loading"></Spin>
|
||||
|
||||
<div v-if="empty" class="empty">暂无商品信息</div>
|
||||
</Scroll>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import * as API_Goods from "@/api/goods";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
type: "multiple", //单选或者多选 single multiple
|
||||
|
||||
skuList: [], // 商品sku列表
|
||||
total: "", // 商品总数
|
||||
goodsParams: { // 商品请求参数
|
||||
pageNumber: 1,
|
||||
pageSize: 18,
|
||||
order: "desc",
|
||||
goodsName: "",
|
||||
sn: "",
|
||||
categoryPath: "",
|
||||
marketEnable: "UPPER",
|
||||
isAuth: "PASS",
|
||||
},
|
||||
category: [], // 分类
|
||||
goodsData: [], // 商品数据
|
||||
empty: false, // 空数据
|
||||
loading: false, // 加载状态
|
||||
};
|
||||
},
|
||||
props: {
|
||||
selectedWay: {
|
||||
type: Array,
|
||||
default: new Array()
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
category(val) {
|
||||
this.goodsParams.categoryPath = val[0];
|
||||
},
|
||||
selectedWay: {
|
||||
handler() {
|
||||
this.$emit("selected", this.selectedWay);
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
},
|
||||
|
||||
"goodsParams.categoryPath": {
|
||||
handler: function () {
|
||||
this.goodsData = [];
|
||||
(this.goodsParams.pageNumber = 0), this.getQueryGoodsList();
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
handleReachBottom() {
|
||||
setTimeout(() => {
|
||||
if (
|
||||
this.goodsParams.pageNumber * this.goodsParams.pageSize <=
|
||||
this.total
|
||||
) {
|
||||
this.goodsParams.pageNumber++;
|
||||
this.getQueryGoodsList();
|
||||
}
|
||||
}, 1500);
|
||||
},
|
||||
getQueryGoodsList() {
|
||||
API_Goods.getGoodsSkuData(this.goodsParams).then((res) => {
|
||||
this.initGoods(res);
|
||||
});
|
||||
},
|
||||
|
||||
initGoods(res) {
|
||||
if (res.result.records.length !=0) {
|
||||
res.result.records.forEach((item) => {
|
||||
item.selected = false;
|
||||
item.___type = "goods"; //设置为goods让pc wap知道标识
|
||||
|
||||
this.selectedWay.forEach(e => {
|
||||
if (e.id === item.id) {
|
||||
item.selected = true
|
||||
}
|
||||
})
|
||||
});
|
||||
/**
|
||||
* 解决数据请求中,滚动栏会一直上下跳动
|
||||
*/
|
||||
this.total = res.result.total;
|
||||
this.goodsData.push(...res.result.records);
|
||||
|
||||
} else {
|
||||
this.empty = true;
|
||||
}
|
||||
},
|
||||
// 查询商品
|
||||
init() {
|
||||
API_Goods.getGoodsSkuData(this.goodsParams).then((res) => {
|
||||
// 商品
|
||||
this.initGoods(res);
|
||||
});
|
||||
if (localStorage.getItem('category')) {
|
||||
this.deepGroup(JSON.parse(localStorage.getItem('category')))
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
this.deepGroup(JSON.parse(localStorage.getItem('category')))
|
||||
},3000)
|
||||
}
|
||||
},
|
||||
|
||||
deepGroup(val) {
|
||||
val.forEach((item) => {
|
||||
let childWay = []; //第二级
|
||||
// 第二层
|
||||
if (item.children) {
|
||||
item.children.forEach((child) => {
|
||||
// // 第三层
|
||||
if (child.children) {
|
||||
child.children.forEach((grandson, index, arr) => {
|
||||
arr[index] = {
|
||||
value: grandson.id,
|
||||
label: grandson.name,
|
||||
children: "",
|
||||
};
|
||||
});
|
||||
}
|
||||
let children = {
|
||||
value: child.id,
|
||||
label: child.name,
|
||||
children: child.children,
|
||||
};
|
||||
childWay.push(children);
|
||||
});
|
||||
}
|
||||
// 第一层
|
||||
let way = {
|
||||
value: item.id,
|
||||
label: item.name,
|
||||
children: childWay,
|
||||
};
|
||||
|
||||
this.skuList.push(way);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 点击商品
|
||||
*/
|
||||
checkedGoods(val, index) {
|
||||
// 如果单选的话
|
||||
if (this.type != "multiple") {
|
||||
this.goodsData.forEach((item) => {
|
||||
item.selected = false;
|
||||
});
|
||||
this.selectedWay = [];
|
||||
val.selected = true;
|
||||
this.selectedWay.push(val);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (val.selected == false) {
|
||||
val.selected = true;
|
||||
this.selectedWay.push(val);
|
||||
} else {
|
||||
val.selected = false;
|
||||
for (let i = 0; i<this.selectedWay.length; i++ ) {
|
||||
if (this.selectedWay[i].id===val.id) {
|
||||
this.selectedWay.splice(i,1)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
@import "./style.scss";
|
||||
.wap-content {
|
||||
width: 100%;
|
||||
}
|
||||
.empty {
|
||||
text-align: center;
|
||||
padding: 8px 0;
|
||||
width: 100%;
|
||||
}
|
||||
.wap-content {
|
||||
flex: 1;
|
||||
padding: 0;
|
||||
}
|
||||
.wap-content-list {
|
||||
position: relative;
|
||||
}
|
||||
.wap-content-item {
|
||||
width: 210px;
|
||||
margin: 10px 7px;
|
||||
padding: 6px 0;
|
||||
}
|
||||
// .wap-content-item{
|
||||
|
||||
// }
|
||||
.active {
|
||||
background: url("../../assets/selected.png") no-repeat;
|
||||
background-position: right;
|
||||
background-size: 10%;
|
||||
}
|
||||
</style>
|
|
@ -45,7 +45,7 @@ export default {
|
|||
type: "multiple", //单选或者多选 single multiple
|
||||
|
||||
skuList: [], // 商品sku列表
|
||||
total: "", // 商品总数
|
||||
total: 0, // 商品总数
|
||||
goodsParams: { // 商品请求参数
|
||||
pageNumber: 1,
|
||||
pageSize: 18,
|
||||
|
@ -79,7 +79,6 @@ export default {
|
|||
deep: true,
|
||||
immediate: true
|
||||
},
|
||||
|
||||
"goodsParams.categoryPath": {
|
||||
handler: function () {
|
||||
this.goodsData = [];
|
||||
|
@ -92,6 +91,7 @@ export default {
|
|||
this.init();
|
||||
},
|
||||
methods: {
|
||||
// 触底加载更多方法
|
||||
handleReachBottom() {
|
||||
setTimeout(() => {
|
||||
if (
|
||||
|
@ -103,12 +103,13 @@ export default {
|
|||
}
|
||||
}, 1500);
|
||||
},
|
||||
// 获取商品列表
|
||||
getQueryGoodsList() {
|
||||
API_Goods.getGoodsSkuData(this.goodsParams).then((res) => {
|
||||
this.initGoods(res);
|
||||
});
|
||||
},
|
||||
|
||||
// 获取列表方法
|
||||
initGoods(res) {
|
||||
if (res.result.records.length !=0) {
|
||||
res.result.records.forEach((item) => {
|
||||
|
|
|
@ -14,12 +14,10 @@
|
|||
<script>
|
||||
import goodsDialog from "./goods-dialog";
|
||||
import linkDialog from "./link-dialog";
|
||||
import couponDialog from "./coupon-dialog";
|
||||
export default {
|
||||
components: {
|
||||
goodsDialog,
|
||||
linkDialog,
|
||||
couponDialog,
|
||||
linkDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -44,6 +42,7 @@ export default {
|
|||
}
|
||||
}, 100);
|
||||
},
|
||||
// 点击确认
|
||||
clickOK() {
|
||||
if (this.goodsFlag) {
|
||||
this.$emit("selectedGoodsData", this.goodsData);
|
||||
|
@ -52,6 +51,7 @@ export default {
|
|||
}
|
||||
this.clickClose();
|
||||
},
|
||||
// 打开组件方法
|
||||
open(type, mutiple) {
|
||||
this.flag = true;
|
||||
if (type == "goods") {
|
||||
|
@ -64,6 +64,7 @@ export default {
|
|||
}
|
||||
|
||||
},
|
||||
// 关闭组件
|
||||
close() {
|
||||
this.flag = false;
|
||||
},
|
||||
|
|
|
@ -2,18 +2,21 @@
|
|||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
|
||||
.wap-list {
|
||||
flex: 2;
|
||||
text-align: center;
|
||||
overflow-y: auto;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
>.wap-list,
|
||||
|
||||
.wap-content {
|
||||
flex: 8;
|
||||
}
|
||||
}
|
||||
|
||||
.wap-sku {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
|
@ -23,33 +26,41 @@
|
|||
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.query-wrapper {
|
||||
display: flex;
|
||||
margin: 8px 0;
|
||||
|
||||
>.query-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
>* {
|
||||
margin: 0 4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .ivu-scroll-container {
|
||||
width: 100% !important;
|
||||
height: 400px !important;
|
||||
}
|
||||
|
||||
/deep/ .ivu-scroll-content {
|
||||
/* */
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.wap-content-list {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.wap-item {
|
||||
padding: 10px 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.wap-item:hover {
|
||||
background: #ededed;
|
||||
}
|
||||
|
@ -65,14 +76,17 @@
|
|||
overflow: hidden;
|
||||
align-items: center;
|
||||
margin: 10px;
|
||||
|
||||
/deep/ img {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wap-content-desc {
|
||||
width: 180px;
|
||||
padding: 8px;
|
||||
|
||||
>.wap-content-desc-title {
|
||||
display: -webkit-box;
|
||||
font-size: 12px;
|
||||
|
@ -82,12 +96,14 @@
|
|||
overflow: hidden;
|
||||
-webkit-line-clamp: 2;
|
||||
}
|
||||
|
||||
>.wap-content-desc-bottom {
|
||||
font-size: 12px;
|
||||
padding: 4px 0;
|
||||
color: #999;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
>div:nth-of-type(1) {
|
||||
color: $theme_color;
|
||||
}
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
<template>
|
||||
<div class="empty">
|
||||
<img src="../../assets/empty.png" alt="">
|
||||
暂无数据
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.empty{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
>img{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -175,7 +175,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 删除模板
|
||||
delTemplate(id) {
|
||||
API_floor.removePageHome(id).then((res) => {
|
||||
if (res.success) {
|
||||
|
@ -184,8 +184,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
computed: {},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -25,13 +25,6 @@
|
|||
<i-input v-model="searchData" size="large" placeholder="输入你想查找的商品">
|
||||
<Button slot="append">搜索</Button>
|
||||
</i-input>
|
||||
<!-- <Tag
|
||||
v-for="(item, index) in promotionTags"
|
||||
:key="index"
|
||||
class="mt_10"
|
||||
>
|
||||
{{item}}
|
||||
</Tag> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="nav-con">
|
||||
|
@ -185,6 +178,7 @@ export default {
|
|||
if(item) this.selectedNav = item;
|
||||
this.$refs.liliDialog.open('link')
|
||||
},
|
||||
// 已选链接
|
||||
selectedLink(val) {
|
||||
console.log(val);
|
||||
if(this.showModalNav){
|
||||
|
@ -202,9 +196,11 @@ export default {
|
|||
)
|
||||
console.log(this.navList.list)
|
||||
},
|
||||
// 拖动结束回调
|
||||
handleMoveEnd ({newIndex, oldIndex}) {
|
||||
console.log('index', newIndex, oldIndex)
|
||||
},
|
||||
// 修改顶部广告
|
||||
handleModel (type) {
|
||||
if(type == 'topAdvert'){
|
||||
this.showModal = true;
|
||||
|
@ -212,6 +208,7 @@ export default {
|
|||
this.showModalNav = true;
|
||||
}
|
||||
},
|
||||
// 选择图片
|
||||
handleSelectImg() {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
|
@ -236,9 +233,6 @@ export default {
|
|||
model: this.data.list[newIndex].type + '_' + key
|
||||
})
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -58,38 +58,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 首页品牌 -->
|
||||
<!-- <template v-if="element.type == 'brand'">
|
||||
<div class="brand">
|
||||
<div class="brand-view">
|
||||
<div class="brand-view-content" v-for="(brand,index) in element.options.brandViewList" :key="index">
|
||||
<div class="brand-view-title">
|
||||
<span><span class="fontsize_18 fw_bold">{{brand.nameCn}}</span> <span class="fw_bold">{{brand.nameEn}}</span></span>
|
||||
<span>更多></span>
|
||||
</div>
|
||||
<div class="brand-view-img">
|
||||
<img :src="brand.img" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="brand-list">
|
||||
<li v-for="(sign,index) in element.options.signList" :key="index">
|
||||
<div class="brand-img">
|
||||
<img :src="sign.img" alt="">
|
||||
</div>
|
||||
<div class="brand-mash">
|
||||
<Icon type="ios-heart-outline" />
|
||||
<div>关注人数:{{ sign.follow }}</div>
|
||||
<div>点击进入</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="refresh">
|
||||
<Icon type="md-refresh" />
|
||||
<div>换一批</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template> -->
|
||||
<!-- 好货推荐 -->
|
||||
<template v-if="element.type == 'recommend'">
|
||||
<recommend :data="element"></recommend>
|
||||
|
@ -188,15 +156,14 @@ export default {
|
|||
selected:{}, // 已选数据
|
||||
picModelFlag: false // 图片选择器
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 编辑模块
|
||||
handleSelectModel (item) {
|
||||
this.selected = item;
|
||||
this.showModal = true
|
||||
},
|
||||
// 删除模块
|
||||
handleModelDelete () {
|
||||
this.$Modal.confirm({
|
||||
title: '提示',
|
||||
|
@ -212,28 +179,25 @@ export default {
|
|||
handleSelectLink(item,index) { // 调起选择链接弹窗
|
||||
this.$refs.liliDialog.open('link')
|
||||
},
|
||||
// 确定选择链接
|
||||
selectedLink(val) {
|
||||
this.selected.url = this.$options.filters.formatLinkType(val);;
|
||||
},
|
||||
// 拖动结束回调
|
||||
handleMoveEnd ({newIndex, oldIndex}) {
|
||||
console.log('index', newIndex, oldIndex)
|
||||
},
|
||||
handleEditModel (type) {
|
||||
this.showModal = true;
|
||||
},
|
||||
handleSelectImg(){ // 选择图片
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
},
|
||||
// 回显图片
|
||||
callbackSelected (val) {
|
||||
this.picModelFlag = false;
|
||||
this.selected.img = val.url;
|
||||
}
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -139,6 +139,7 @@ export default {
|
|||
// 编辑模块
|
||||
this.showModal = true;
|
||||
},
|
||||
// 添加轮播图
|
||||
handleAdd () {
|
||||
this.data.options.list.push({ img: "", url: "" });
|
||||
this.$forceUpdate();
|
||||
|
@ -161,6 +162,7 @@ export default {
|
|||
this.selected.url = this.$options.filters.formatLinkType(val);
|
||||
console.log(this.selected.url);
|
||||
},
|
||||
// 选择图片
|
||||
handleSelectImg(item) {
|
||||
this.selected = item;
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
|
|
|
@ -81,6 +81,7 @@ export default {
|
|||
}
|
||||
},
|
||||
methods:{
|
||||
// 打开装修modal
|
||||
handleSelectModel (item,type) {
|
||||
this.selected = item;
|
||||
this.showModal = true
|
||||
|
@ -88,7 +89,7 @@ export default {
|
|||
handleSelectLink(item,index) { // 调起选择链接弹窗
|
||||
this.$refs.liliDialog.open('link')
|
||||
},
|
||||
|
||||
// 选择链接回调
|
||||
selectedLink(val) {
|
||||
this.selected.url = this.$options.filters.formatLinkType(val);;
|
||||
},
|
||||
|
@ -96,6 +97,7 @@ export default {
|
|||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
},
|
||||
// 选择图片回调
|
||||
callbackSelected (val) {
|
||||
this.picModelFlag = false;
|
||||
this.selected.img = val.url;
|
||||
|
|
|
@ -160,6 +160,7 @@ export default {
|
|||
}
|
||||
},
|
||||
methods:{
|
||||
// 装修modal
|
||||
handleSelectModel (item, type) {
|
||||
this.selected = item;
|
||||
console.warn(item);
|
||||
|
@ -181,9 +182,11 @@ export default {
|
|||
this.$refs.liliDialog.goodsData = [this.selected]
|
||||
}, 500);
|
||||
},
|
||||
// 选择链接回调
|
||||
selectedLink (val) {
|
||||
this.selected.url = this.$options.filters.formatLinkType(val);
|
||||
},
|
||||
// 选择商品回调
|
||||
selectedGoodsData (val) {
|
||||
console.log(val);
|
||||
let goods = val[0]
|
||||
|
@ -193,17 +196,11 @@ export default {
|
|||
this.selected.name = goods.goodsName
|
||||
this.selected.url = `/goodsDetail?skuId=${goods.id}&goodsId=${goods.goodsId}`
|
||||
},
|
||||
|
||||
handleMoveEnd ({newIndex, oldIndex}) {
|
||||
console.log('index', newIndex, oldIndex)
|
||||
},
|
||||
handleEditModel (type) {
|
||||
this.showModal = true;
|
||||
},
|
||||
handleSelectImg(){ // 选择图片
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
},
|
||||
// 选择图片回显
|
||||
callbackSelected (val) {
|
||||
this.picModelFlag = false;
|
||||
this.selected.img = val.url;
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
<tr v-for="(item, index) in conData.options.navList" :key="index">
|
||||
<td><Input v-model="item.title" /></td>
|
||||
<td><Input v-model="item.desc" /></td>
|
||||
<!-- <td><Input v-model="item.sort"/></td> -->
|
||||
<td v-if="index!=0">
|
||||
<Button type="error" size="small" @click="handleDelNav(index)">删除</Button>
|
||||
</td>
|
||||
|
@ -62,7 +61,6 @@
|
|||
<!-- 选择商品。链接 -->
|
||||
<liliDialog
|
||||
ref="liliDialog"
|
||||
@selectedLink="selectedLink"
|
||||
@selectedGoodsData="selectedGoodsData"
|
||||
></liliDialog>
|
||||
</div>
|
||||
|
@ -91,31 +89,25 @@ export default {
|
|||
conData:function(val){
|
||||
this.$emit('content',val)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods:{
|
||||
// tab点击切换
|
||||
changeCurr(index){
|
||||
this.currentIndex = index;
|
||||
},
|
||||
// 编辑
|
||||
handleSelectModel (item,type) {
|
||||
this.selected = item;
|
||||
this.showModal = true
|
||||
},
|
||||
handleSelectLink(item,index) { // 调起选择链接弹窗
|
||||
this.$refs.liliDialog.open('link')
|
||||
},
|
||||
handleSelectGoods(item) { // 调起选择链接弹窗
|
||||
handleSelectGoods(item) { // 调起选择商品弹窗
|
||||
if(item) this.selected = item;
|
||||
this.$refs.liliDialog.open('goods', 'single')
|
||||
setTimeout(() => {
|
||||
this.$refs.liliDialog.goodsData = [this.selected]
|
||||
}, 500);
|
||||
},
|
||||
selectedLink(val) {
|
||||
this.selected.url = this.$options.filters.formatLinkType(val);
|
||||
},
|
||||
// 选择商品回调
|
||||
selectedGoodsData(val){
|
||||
console.log(val)
|
||||
let goods = val[0]
|
||||
|
|
|
@ -227,6 +227,7 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
// 编辑
|
||||
handleSelectModel(item, type) {
|
||||
this.selected = item;
|
||||
if (type) {
|
||||
|
@ -243,9 +244,11 @@ export default {
|
|||
// 调起选择商品
|
||||
this.$refs.liliDialog.open('goods', 'single')
|
||||
},
|
||||
// 选择链接回调
|
||||
selectedLink(val) {
|
||||
this.selected.url = this.$options.filters.formatLinkType(val);
|
||||
},
|
||||
// 选择商品回调
|
||||
selectedGoodsData(val) {
|
||||
console.log(val);
|
||||
let goods = val[0];
|
||||
|
@ -259,6 +262,7 @@ export default {
|
|||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
},
|
||||
// 选择图片回调
|
||||
callbackSelected(val) {
|
||||
this.picModelFlag = false;
|
||||
this.selected.img = val.url;
|
||||
|
|
|
@ -58,7 +58,7 @@ export default {
|
|||
if (res.success) {
|
||||
this.$Message.success("保存模板成功");
|
||||
} else {
|
||||
this.$Message.error(res.message);
|
||||
// this.$Message.error(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -86,9 +86,6 @@ export default {
|
|||
this.modelForm = { list: [] };
|
||||
}
|
||||
}
|
||||
|
||||
// this.$refs.modelForm.topAdvert = {};
|
||||
// this.$refs.modelForm.navList = {}
|
||||
});
|
||||
},
|
||||
},
|
||||
|
|
|
@ -94,19 +94,12 @@ export default {
|
|||
|
||||
linkType: "", // 选择类型
|
||||
};
|
||||
},
|
||||
methods: {},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 点击链接
|
||||
clickLink(item) {
|
||||
this.$refs.liliDialog.open('link')
|
||||
},
|
||||
|
||||
|
||||
//点击图片解析成base64
|
||||
changeFile(item, index) {
|
||||
const file = document.getElementById("files" + index).files[0];
|
||||
|
@ -122,7 +115,6 @@ export default {
|
|||
// 点击选择照片
|
||||
handleClickFile(item, index) {
|
||||
document.getElementById("files" + index).click();
|
||||
// console.log(let files = files)
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -69,14 +69,12 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <Button type="primary" @click="addDecorate()" ghost>添加</Button> -->
|
||||
<liliDialog ref="liliDialog" :types="linkType"></liliDialog>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -91,18 +89,12 @@ export default {
|
|||
],
|
||||
linkType: "", // 选择类型
|
||||
};
|
||||
},
|
||||
methods: {},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 点击链接
|
||||
clickLink(item) {
|
||||
this.$refs.liliDialog.open('link')
|
||||
},
|
||||
|
||||
|
||||
//点击图片解析成base64
|
||||
changeFile(item, index) {
|
||||
const file = document.getElementById("files" + index).files[0];
|
||||
|
@ -118,7 +110,6 @@ export default {
|
|||
// 点击选择照片
|
||||
handleClickFile(item, index) {
|
||||
document.getElementById("files" + index).click();
|
||||
// console.log(let files = files)
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -168,20 +168,15 @@ export default {
|
|||
},
|
||||
},
|
||||
props: ["res"],
|
||||
mounted() {},
|
||||
methods: {
|
||||
// 选择风格
|
||||
selectStyle() {
|
||||
this.styleFlag = !this.styleFlag;
|
||||
},
|
||||
|
||||
// 回调选择的链接
|
||||
selectedLink(val) {
|
||||
this.selectedLinks.url = val;
|
||||
|
||||
console.log(this.selectedLinks);
|
||||
},
|
||||
|
||||
// 回调的商品信息
|
||||
selectedGoodsData(val) {
|
||||
if (!val) return false;
|
||||
|
@ -194,10 +189,8 @@ export default {
|
|||
this.res.options.list[0].listWay = this.res.options.list[0].listWay.concat(
|
||||
val
|
||||
);
|
||||
|
||||
this.linkType = "";
|
||||
},
|
||||
|
||||
// 绑定商品
|
||||
bindGoodsId(val) {
|
||||
this.selectedGoods = val;
|
||||
|
@ -208,7 +201,7 @@ export default {
|
|||
this.$emit("handleDrawer", item);
|
||||
this.styleFlag = false;
|
||||
},
|
||||
|
||||
// 打开图片选择器
|
||||
liliDialogFlag(flag) {
|
||||
this.$refs.liliDialog.goodsFlag = flag;
|
||||
this.$refs.liliDialog.flag = true;
|
||||
|
@ -216,14 +209,9 @@ export default {
|
|||
|
||||
// 点击链接赋值一个唯一值,并将当前选择的模块赋值
|
||||
clickLink(val, index) {
|
||||
// this.selectedLinkIndex = index
|
||||
// val.___only = new Date().getTime(), //赋值当前时间戳 唯一
|
||||
this.selectedLinks = val;
|
||||
|
||||
console.log(this.selectedLinks);
|
||||
this.liliDialogFlag(false);
|
||||
},
|
||||
|
||||
//点击图片解析成base64
|
||||
changeFile(item, index) {
|
||||
const file = document.getElementById("files" + index).files[0];
|
||||
|
@ -247,21 +235,17 @@ export default {
|
|||
};
|
||||
this.res.options.list.push(way);
|
||||
},
|
||||
|
||||
// 图片选择器回显
|
||||
callbackSelected(val) {
|
||||
this.picModelFlag = false;
|
||||
this.selectedGoods.img = val.url;
|
||||
},
|
||||
|
||||
// 点击选择照片
|
||||
// 点击选择图片
|
||||
handleClickFile(item, index) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.selectedGoods = item;
|
||||
this.picModelFlag = true;
|
||||
|
||||
// console.log(let files = files)
|
||||
},
|
||||
|
||||
// 关闭
|
||||
closeDecorate(index) {
|
||||
this.$nextTick(() => {
|
||||
|
|
|
@ -108,6 +108,7 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
// 初始化数据
|
||||
init() {
|
||||
if (!this.$route.query.id) return false;
|
||||
API_Other.getHomeData(this.$route.query.id).then(res=>{
|
||||
|
@ -117,12 +118,6 @@ export default {
|
|||
this.handleComponent( this.contentData.list[0], 0)
|
||||
})
|
||||
},
|
||||
handleSpinShow() {
|
||||
this.$Spin.show();
|
||||
setTimeout(() => {
|
||||
this.$Spin.hide();
|
||||
}, 3000);
|
||||
},
|
||||
|
||||
// 中间组件拖动,右侧数据绑定不变
|
||||
handleContentlEnd(evt) {
|
||||
|
@ -159,7 +154,7 @@ export default {
|
|||
this.selected = index;
|
||||
this.$set(this, "decorateData", val);
|
||||
},
|
||||
|
||||
// 右侧栏回调
|
||||
handleDrawer(val) {
|
||||
let newIndex = this.selected;
|
||||
|
||||
|
|
|
@ -18,17 +18,12 @@ export default {
|
|||
layout, // 装修模块
|
||||
name: "index", // 装修的页面
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
selected(val) {
|
||||
selected(val) { // 顶部栏点击切换
|
||||
this.name = val;
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
|
|
|
@ -20,9 +20,6 @@ export default {
|
|||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.res);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -14,9 +14,6 @@
|
|||
export default {
|
||||
title: "两张横图",
|
||||
props: ["res"],
|
||||
mounted () {
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -52,11 +52,12 @@ export default {
|
|||
};
|
||||
},
|
||||
props: ["res"],
|
||||
mounted() {},
|
||||
methods: {
|
||||
// 删除商品
|
||||
closeGoods(val, index) {
|
||||
this.res.list[0].listWay.splice(index,1)
|
||||
},
|
||||
// 切换商品列表
|
||||
handleClickTitle(val, index) {
|
||||
this.selected.index = index;
|
||||
this.selected.val = val.title;
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: ["res"],
|
||||
props: ["res"]
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: ["res"],
|
||||
props: ["res"]
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: ["res"],
|
||||
props: ["res"]
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -18,10 +18,7 @@
|
|||
<script>
|
||||
export default {
|
||||
title: "左一右二",
|
||||
props: ["res"],
|
||||
mounted() {
|
||||
|
||||
}
|
||||
props: ["res"]
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -18,10 +18,7 @@
|
|||
<script>
|
||||
export default {
|
||||
title: "左二右一",
|
||||
props: ["res"],
|
||||
mounted() {
|
||||
console.log(this.res);
|
||||
},
|
||||
props: ["res"]
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: ["res"],
|
||||
props: ["res"]
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -35,10 +35,7 @@
|
|||
<script>
|
||||
export default {
|
||||
title: "文字图片模板",
|
||||
props: ["res"],
|
||||
mounted() {
|
||||
console.log(this.res);
|
||||
}
|
||||
props: ["res"]
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -11,10 +11,7 @@
|
|||
<script>
|
||||
export default {
|
||||
title: "标题栏",
|
||||
props: ["res"],
|
||||
mounted() {
|
||||
console.log(this.res);
|
||||
},
|
||||
props: ["res"]
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -18,10 +18,7 @@
|
|||
<script>
|
||||
export default {
|
||||
title: "上一下二",
|
||||
props: ["res"],
|
||||
mounted() {
|
||||
console.log(this.res);
|
||||
}
|
||||
props: ["res"]
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -18,9 +18,6 @@
|
|||
export default {
|
||||
title: "上二下一",
|
||||
props: ["res"],
|
||||
mounted() {
|
||||
console.log(this.res);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
</template>
|
||||
<script>
|
||||
export default {
|
||||
destroyed(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
|
|
|
@ -96,11 +96,13 @@ export default {
|
|||
this.init();
|
||||
},
|
||||
methods: {
|
||||
// 切换tab
|
||||
clickType(val,index) {
|
||||
this.params.pageNumber = 1
|
||||
this.selectedIndex = index
|
||||
this.params.pageType = val;
|
||||
},
|
||||
// 是否发布
|
||||
changeSwitch(item) {
|
||||
this.loading = true;
|
||||
API_Other.releasePageHome(item.id).then((res) => {
|
||||
|
@ -115,6 +117,7 @@ export default {
|
|||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.loading = true;
|
||||
API_Other.getHomeList(this.params).then((res) => {
|
||||
|
@ -132,20 +135,20 @@ export default {
|
|||
this.total = res.result.total;
|
||||
});
|
||||
},
|
||||
|
||||
// 装修楼层
|
||||
handleEdit(val) {
|
||||
this.$router.push({
|
||||
path: "/floorList/main",
|
||||
query: { id: val.id, name: val.name, type: val.pageShow },
|
||||
});
|
||||
},
|
||||
|
||||
// 添加模板
|
||||
handleAdd() {
|
||||
this.$router.push({
|
||||
path: "/floorList/main",
|
||||
});
|
||||
},
|
||||
|
||||
// 删除模板
|
||||
handleDel(val) {
|
||||
this.loading = true;
|
||||
API_Other.removePageHome(val.id).then((res) => {
|
||||
|
|
|
@ -24,9 +24,6 @@
|
|||
</Row>
|
||||
<!-- 拼图验证码 -->
|
||||
<verify ref="verify" class="verify-con" verifyType="LOGIN" @change="verifyChange"></verify>
|
||||
<div v-if="socialLogining">
|
||||
<RectLoading />
|
||||
</div>
|
||||
<Footer />
|
||||
</Col>
|
||||
<!-- <LangSwitch /> -->
|
||||
|
@ -40,15 +37,11 @@ import Cookies from "js-cookie";
|
|||
import Header from "@/views/main-components/header";
|
||||
import Footer from "@/views/main-components/footer";
|
||||
import LangSwitch from "@/views/main-components/lang-switch";
|
||||
import RectLoading from "@/views/my-components/lili/rect-loading";
|
||||
import CountDownButton from "@/views/my-components/lili/count-down-button";
|
||||
import util from "@/libs/util.js";
|
||||
import verify from "@/views/my-components/verify";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
CountDownButton,
|
||||
RectLoading,
|
||||
LangSwitch,
|
||||
Header,
|
||||
Footer,
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
>
|
||||
<!-- 页面展示 -->
|
||||
<template slot="disableSlot" slot-scope="{row}">
|
||||
|
@ -90,13 +87,12 @@
|
|||
data() {
|
||||
return {
|
||||
loading: true, // 表单加载状态
|
||||
modalType: 0, // 添加或编辑标识
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
modalTitle: "", // 添加或编辑标题
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
pageSize: 20, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
name: "",
|
||||
|
@ -245,7 +241,7 @@
|
|||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
this.form.disabled = this.form.disabled == true ? "OPEN" : "CLOSE"
|
||||
if (this.modalType == 0) {
|
||||
if (this.modalTitle == "添加") {
|
||||
// 添加 避免编辑后传入id等数据 记得删除
|
||||
delete this.form.id;
|
||||
|
||||
|
@ -276,7 +272,6 @@
|
|||
},
|
||||
// 添加信息
|
||||
add() {
|
||||
this.modalType = 0;
|
||||
this.modalTitle = "添加";
|
||||
this.form = {};
|
||||
this.$refs.form.resetFields();
|
||||
|
@ -285,7 +280,6 @@
|
|||
},
|
||||
// 编辑
|
||||
detail(v) {
|
||||
this.modalType = 1;
|
||||
this.id = v.id;
|
||||
this.modalTitle = "修改";
|
||||
this.modalVisible = true;
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
<template>
|
||||
<Breadcrumb>
|
||||
<BreadcrumbItem
|
||||
v-for="item in currentPath"
|
||||
:to="item.path"
|
||||
:key="item.name"
|
||||
>{{ itemTitle(item) }}</BreadcrumbItem>
|
||||
</Breadcrumb>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'breadcrumbNav',
|
||||
props: {
|
||||
currentPath: Array
|
||||
},
|
||||
methods: {
|
||||
itemTitle (item) {
|
||||
if (typeof item.title == 'object') {
|
||||
return this.$t(item.title.i18n);
|
||||
} else {
|
||||
return item.title;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
<template>
|
||||
<div @click="handleChange" v-if="showFullScreenBtn" class="full-screen-btn-con">
|
||||
<Tooltip :content="value ? '退出全屏' : '全屏'" placement="bottom">
|
||||
<Icon :type="value ? 'ios-contract' : 'ios-expand'" :size="24"></Icon>
|
||||
</Tooltip>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "fullScreen",
|
||||
props: {
|
||||
value: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
showFullScreenBtn() {
|
||||
return window.navigator.userAgent.indexOf("MSIE") < 0;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleFullscreen() {
|
||||
let main = document.body;
|
||||
if (this.value) {
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen();
|
||||
} else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen();
|
||||
} else if (document.webkitCancelFullScreen) {
|
||||
document.webkitCancelFullScreen();
|
||||
} else if (document.msExitFullscreen) {
|
||||
document.msExitFullscreen();
|
||||
}
|
||||
} else {
|
||||
if (main.requestFullscreen) {
|
||||
main.requestFullscreen();
|
||||
} else if (main.mozRequestFullScreen) {
|
||||
main.mozRequestFullScreen();
|
||||
} else if (main.webkitRequestFullScreen) {
|
||||
main.webkitRequestFullScreen();
|
||||
} else if (main.msRequestFullscreen) {
|
||||
main.msRequestFullscreen();
|
||||
}
|
||||
}
|
||||
},
|
||||
handleChange() {
|
||||
this.handleFullscreen();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
let isFullscreen =
|
||||
document.fullscreenElement ||
|
||||
document.mozFullScreenElement ||
|
||||
document.webkitFullscreenElement ||
|
||||
document.fullScreen ||
|
||||
document.mozFullScreen ||
|
||||
document.webkitIsFullScreen;
|
||||
isFullscreen = !!isFullscreen;
|
||||
document.addEventListener("fullscreenchange", () => {
|
||||
this.$emit("input", !this.value);
|
||||
this.$emit("on-change", !this.value);
|
||||
});
|
||||
document.addEventListener("mozfullscreenchange", () => {
|
||||
this.$emit("input", !this.value);
|
||||
this.$emit("on-change", !this.value);
|
||||
});
|
||||
document.addEventListener("webkitfullscreenchange", () => {
|
||||
this.$emit("input", !this.value);
|
||||
this.$emit("on-change", !this.value);
|
||||
});
|
||||
document.addEventListener("msfullscreenchange", () => {
|
||||
this.$emit("input", !this.value);
|
||||
this.$emit("on-change", !this.value);
|
||||
});
|
||||
this.$emit("input", isFullscreen);
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -28,7 +28,6 @@
|
|||
<DropdownItem v-if="res.waitPayBill" @click.native="navigateTo('accountStatementBill')">
|
||||
<Badge :count="res.waitPayBill">待与商家对账</Badge>
|
||||
</DropdownItem>
|
||||
|
||||
<div></div>
|
||||
</DropdownMenu>
|
||||
</Dropdown>
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
<script>
|
||||
import util from "@/libs/util.js";
|
||||
|
||||
export default {
|
||||
name: "shrinkableMenu",
|
||||
computed: {
|
||||
|
@ -45,6 +46,9 @@ export default {
|
|||
$route: {
|
||||
handler: function (val, oldVal) {
|
||||
console.log(val);
|
||||
if (val.meta.firstRouterName && val.meta.firstRouterName !== this.currNav) {
|
||||
this.selectNav(val.meta.firstRouterName)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -58,10 +62,38 @@ export default {
|
|||
this.$store.commit("setCurrNav", name);
|
||||
this.setStore("currNav", name);
|
||||
util.initRouter(this);
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.childrenMenu.updateActiveName()
|
||||
})
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "./styles/menu.scss";
|
||||
.ivu-shrinkable-menu{
|
||||
height: calc(100% - 60px);
|
||||
width: 180px;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.ivu-btn-text:hover {
|
||||
background-color: rgba(255,255,255,.2) !important;
|
||||
}
|
||||
.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu), .ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title-active:not(.ivu-menu-submenu){
|
||||
background-color: #fff;
|
||||
&:hover{
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
.ivu-menu-vertical{
|
||||
overflow-y: auto;
|
||||
}
|
||||
.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu), .ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title-active:not(.ivu-menu-submenu){
|
||||
color: #ed3f14;
|
||||
}
|
||||
/deep/.ivu-menu-vertical .ivu-menu-item-group-title {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
.ivu-shrinkable-menu{
|
||||
height: calc(100% - 60px);
|
||||
width: 180px;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.ivu-btn-text:hover {
|
||||
background-color: rgba(255,255,255,.2) !important;
|
||||
}
|
||||
.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu), .ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title-active:not(.ivu-menu-submenu){
|
||||
background-color: #fff;
|
||||
&:hover{
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
.ivu-menu-vertical{
|
||||
overflow-y: auto;
|
||||
}
|
||||
.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu), .ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title-active:not(.ivu-menu-submenu){
|
||||
color: #ed3f14;
|
||||
}
|
||||
/deep/.ivu-menu-vertical .ivu-menu-item-group-title {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding-left: 20px;
|
||||
}
|
|
@ -47,9 +47,7 @@
|
|||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
class="mt_10"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page
|
||||
|
@ -75,7 +73,6 @@
|
|||
} from "@/api/member";
|
||||
export default {
|
||||
name: "recharge",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
loading: true, // 表单加载状态
|
||||
|
@ -90,9 +87,6 @@
|
|||
memberName:""
|
||||
},
|
||||
selectDate: null, // 选择区间时间
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [
|
||||
{
|
||||
title: "会员名称",
|
||||
|
@ -168,58 +162,37 @@
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
// 分页 改变页码
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
// 分页 改变页数
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
// 搜索
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
handleReset() {
|
||||
this.$refs.searchForm.resetFields();
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.selectDate = null;
|
||||
this.searchForm.startDate = "";
|
||||
this.searchForm.endDate = "";
|
||||
this.searchForm.memberName = "";
|
||||
// 重新加载数据
|
||||
this.getDataList();
|
||||
},
|
||||
changeSort(e) {
|
||||
this.searchForm.sort = e.key;
|
||||
this.searchForm.order = e.order;
|
||||
if (e.order === "normal") {
|
||||
this.searchForm.order = "";
|
||||
}
|
||||
this.getDataList();
|
||||
},
|
||||
clearSelectAll() {
|
||||
this.$refs.table.selectAll(false);
|
||||
},
|
||||
changeSelect(e) {
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
// 时间段赋值
|
||||
selectDateRange(v) {
|
||||
if (v) {
|
||||
this.searchForm.startDate = v[0];
|
||||
this.searchForm.endDate = v[1];
|
||||
}
|
||||
},
|
||||
// 获取列表数据
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||
getUserRecharge(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||
</Form>
|
||||
</Row>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
|
||||
<Table class="mt_10" :loading="loading" border :columns="columns" :data="data" ref="table"></Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<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>
|
||||
|
@ -26,7 +26,6 @@
|
|||
import { getUserWallet } from "@/api/member";
|
||||
export default {
|
||||
name: "walletLog",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
loading: true, // 表单加载状态
|
||||
|
@ -41,10 +40,6 @@ export default {
|
|||
memberName: "",
|
||||
},
|
||||
selectDate: null, // 选择时间段
|
||||
// 表单验证规则
|
||||
formValidate: {},
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [
|
||||
// 表头
|
||||
{
|
||||
|
@ -120,58 +115,36 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
// 分页 改变页码
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
// 分页 改变页数
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
// 搜索
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
handleReset() {
|
||||
this.$refs.searchForm.resetFields();
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.selectDate = null;
|
||||
this.searchForm.startDate = "";
|
||||
this.searchForm.endDate = "";
|
||||
this.searchForm.memberName = "";
|
||||
// 重新加载数据
|
||||
this.getDataList();
|
||||
},
|
||||
changeSort(e) {
|
||||
this.searchForm.sort = e.key;
|
||||
this.searchForm.order = e.order;
|
||||
if (e.order === "normal") {
|
||||
this.searchForm.order = "";
|
||||
}
|
||||
this.getDataList();
|
||||
},
|
||||
clearSelectAll() {
|
||||
this.$refs.table.selectAll(false);
|
||||
},
|
||||
changeSelect(e) {
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
// 时间段赋值
|
||||
selectDateRange(v) {
|
||||
if (v) {
|
||||
this.searchForm.startDate = v[0];
|
||||
this.searchForm.endDate = v[1];
|
||||
}
|
||||
},
|
||||
// 获取列表数据
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||
getUserWallet(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
</Form-item>
|
||||
</Form>
|
||||
</Row>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
|
||||
<Table class="mt_10" :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<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>
|
||||
|
@ -59,24 +59,27 @@
|
|||
|
||||
<Modal :title="modalTitle" v-model="queryModalVisible" :mask-closable="false" :width="500">
|
||||
<Form :label-width="80">
|
||||
<FormItem label="申请编号">
|
||||
<FormItem label="申请编号:">
|
||||
<span>{{showList.sn}}</span>
|
||||
</FormItem>
|
||||
<FormItem label="用户名称">
|
||||
<FormItem label="用户名称:">
|
||||
<span>{{showList.memberName}}</span>
|
||||
</FormItem>
|
||||
<FormItem label="申请金额">
|
||||
<FormItem label="申请金额:">
|
||||
<span>{{showList.applyMoney}}</span>
|
||||
</FormItem>
|
||||
<FormItem label="提现状态">
|
||||
<FormItem label="提现状态:">
|
||||
<span>{{showList.applyStatus | paramTypeFilter}}</span>
|
||||
</FormItem>
|
||||
<FormItem label="申请时间">
|
||||
<FormItem label="申请时间:">
|
||||
<span>{{showList.createTime}}</span>
|
||||
</FormItem>
|
||||
<FormItem label="审核时间">
|
||||
<FormItem label="审核时间:">
|
||||
<span>{{showList.inspectTime}}</span>
|
||||
</FormItem>
|
||||
<FormItem label="审核备注:">
|
||||
<span>{{showList.inspectRemark}}</span>
|
||||
</FormItem>
|
||||
|
||||
</Form>
|
||||
<div slot="footer" v-if="showList.applyStatus == 'APPLY'">
|
||||
|
@ -202,6 +205,7 @@ export default {
|
|||
this.showList = {};
|
||||
this.roleModalVisible = true;
|
||||
this.showList = params.row;
|
||||
this.audit =""
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<Button @click="addMember" type="primary">添加会员</Button>
|
||||
</Row>
|
||||
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect">
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table">
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<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"
|
||||
|
@ -56,9 +56,9 @@
|
|||
|
||||
<!-- 修改模态框 -->
|
||||
<Modal v-model="descFlag" :title="descTitle" @on-ok="handleSubmitModal" width="500">
|
||||
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
|
||||
<Form ref="form" :model="form" :rules="ruleValidate" :label-width="80">
|
||||
<FormItem label="头像">
|
||||
<img :src="formValidate.face" class="face" />
|
||||
<img :src="form.face" class="face" />
|
||||
<Button type="text" class="upload" @click="
|
||||
() => {
|
||||
this.picModelFlag = true;
|
||||
|
@ -69,13 +69,13 @@
|
|||
<input type="file" style="display: none" id="file" />
|
||||
</FormItem>
|
||||
<FormItem label="用户名" prop="name">
|
||||
<Input v-model="formValidate.username" style="width: 200px" disabled />
|
||||
<Input v-model="form.username" style="width: 200px" disabled />
|
||||
</FormItem>
|
||||
<FormItem label="用户昵称" prop="name">
|
||||
<Input v-model="formValidate.nickName" style="width: 200px" />
|
||||
<Input v-model="form.nickName" style="width: 200px" />
|
||||
</FormItem>
|
||||
<FormItem label="性别" prop="sex">
|
||||
<RadioGroup type="button" button-style="solid" v-model="formValidate.sex">
|
||||
<RadioGroup type="button" button-style="solid" v-model="form.sex">
|
||||
<Radio :label="1">
|
||||
<span>男</span>
|
||||
</Radio>
|
||||
|
@ -85,14 +85,14 @@
|
|||
</RadioGroup>
|
||||
</FormItem>
|
||||
<FormItem label="修改密码" prop="password">
|
||||
<Input type="password" style="width: 220px" password v-model="formValidate.newPassword" />
|
||||
<Input type="password" style="width: 220px" password v-model="form.newPassword" />
|
||||
</FormItem>
|
||||
<FormItem label="生日" prop="birthday">
|
||||
<DatePicker type="date" format="yyyy-MM-dd" v-model="formValidate.birthday" style="width: 220px"></DatePicker>
|
||||
<DatePicker type="date" format="yyyy-MM-dd" v-model="form.birthday" style="width: 220px"></DatePicker>
|
||||
</FormItem>
|
||||
<FormItem label="所在地" prop="mail">
|
||||
<div class="form-item" v-if="!updateRegion">
|
||||
<Input disabled style="width: 250px" :value="formValidate.region" />
|
||||
<Input disabled style="width: 250px" :value="form.region" />
|
||||
<Button type="text" @click="
|
||||
() => {
|
||||
this.updateRegion = !this.updateRegion;
|
||||
|
@ -122,14 +122,13 @@ export default {
|
|||
name: "member",
|
||||
components: {
|
||||
region,
|
||||
ossManage,
|
||||
ossManage
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selectedMember: false, //是否是其他组件调用
|
||||
descTitle: "", // modal标题
|
||||
descFlag: false, //编辑查看框
|
||||
openSearch: true, // 显示搜索
|
||||
loading: true, // 表单加载状态
|
||||
addFlag: false, // modal显隐控制
|
||||
updateRegion: false, // 地区
|
||||
|
@ -149,7 +148,7 @@ export default {
|
|||
disabled: "OPEN",
|
||||
},
|
||||
picModelFlag: false, // 选择图片
|
||||
formValidate: {}, // 表单数据
|
||||
form: {}, // 表单数据
|
||||
addRule: {
|
||||
// 验证规则
|
||||
mobile: [
|
||||
|
@ -163,9 +162,6 @@ export default {
|
|||
password: [{ required: true, message: "请输入密码" }],
|
||||
},
|
||||
ruleValidate: {}, //修改验证
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [
|
||||
{
|
||||
title: "会员名称",
|
||||
|
@ -373,6 +369,7 @@ export default {
|
|||
});
|
||||
this.data = data;
|
||||
},
|
||||
// 分页 改变页码
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
// 此处如果是父子级传值的时候需要做一下处理
|
||||
|
@ -380,34 +377,18 @@ export default {
|
|||
|
||||
this.getData();
|
||||
},
|
||||
// 分页 改变页数
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageSize = v;
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.getData();
|
||||
},
|
||||
// 搜索
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getData();
|
||||
},
|
||||
|
||||
changeSort(e) {
|
||||
this.searchForm.sort = e.key;
|
||||
this.searchForm.order = e.order;
|
||||
if (e.order === "normal") {
|
||||
this.searchForm.order = "";
|
||||
}
|
||||
this.getData();
|
||||
},
|
||||
changeSelect(e) {
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
selectDateRange(v) {
|
||||
if (v) {
|
||||
this.searchForm.startDate = v[0];
|
||||
this.searchForm.endDate = v[1];
|
||||
}
|
||||
},
|
||||
//查看详情修改
|
||||
editPerm(val) {
|
||||
this.descTitle = `查看用户 ${val.username}`;
|
||||
|
@ -425,7 +406,7 @@ export default {
|
|||
getMemberInfo(id) {
|
||||
API_Member.getMemberInfoData(id).then((res) => {
|
||||
if (res.result) {
|
||||
this.$set(this, "formValidate", res.result);
|
||||
this.$set(this, "form", res.result);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -443,7 +424,7 @@ export default {
|
|||
// 选中的图片
|
||||
callbackSelected(val) {
|
||||
this.picModelFlag = false;
|
||||
this.formValidate.face = val.url;
|
||||
this.form.face = val.url;
|
||||
},
|
||||
//添加会员提交
|
||||
addMemberSubmit() {
|
||||
|
@ -487,7 +468,7 @@ export default {
|
|||
this.$Message.success("禁用成功");
|
||||
this.getData();
|
||||
} else {
|
||||
this.$Message.error(res.message);
|
||||
// this.$Message.error(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -496,13 +477,13 @@ export default {
|
|||
|
||||
// 提交修改数据
|
||||
handleSubmitModal() {
|
||||
const { nickName, sex, username, face, newPassword } = this.formValidate;
|
||||
let time = new Date(this.formValidate.birthday);
|
||||
const { nickName, sex, username, face, newPassword } = this.form;
|
||||
let time = new Date(this.form.birthday);
|
||||
let birthday =
|
||||
time.getFullYear() + "-" + (time.getMonth() + 1) + "-" + time.getDate();
|
||||
let submit = {
|
||||
regionId: this.formValidate.regionId,
|
||||
region: this.formValidate.region,
|
||||
regionId: this.form.regionId,
|
||||
region: this.form.region,
|
||||
nickName,
|
||||
username,
|
||||
sex,
|
||||
|
|
|
@ -119,6 +119,3 @@
|
|||
line-height: 16px;
|
||||
}
|
||||
}
|
||||
.point-data{
|
||||
|
||||
}
|
||||
|
|
|
@ -64,13 +64,13 @@
|
|||
</div>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<Card class="mt_10">
|
||||
<Tabs type="point" @on-click="memberInfoChange">
|
||||
<TabPane label="TA的积分" name="point">
|
||||
<div class="pointsTitle" style="justify-content: flex-start; text-align: left;">
|
||||
<div style="width: 120px;">
|
||||
<div class="points-top-title">
|
||||
积分余额
|
||||
剩余积分
|
||||
</div>
|
||||
<div class="points-top-text">
|
||||
{{memberInfo.point?memberInfo.point:0}}
|
||||
|
@ -83,9 +83,8 @@
|
|||
border
|
||||
:columns="pointsColumns"
|
||||
:data="pointData"
|
||||
class="mt_10"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="pointChangeSort"
|
||||
>
|
||||
</Table>
|
||||
|
||||
|
@ -172,8 +171,7 @@
|
|||
:columns="orderColumns"
|
||||
:data="orderData"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="orderChangeSort"
|
||||
class="mt_10"
|
||||
>
|
||||
</Table>
|
||||
|
||||
|
@ -203,6 +201,7 @@
|
|||
:columns="addressColumns"
|
||||
:data="addressData"
|
||||
ref="table"
|
||||
class="mt_10"
|
||||
sortable="custom"
|
||||
@on-sort-change="addressChangeSort"
|
||||
>
|
||||
|
@ -249,8 +248,7 @@
|
|||
:columns="walletColumns"
|
||||
:data="walletData"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="walletChangeSort"
|
||||
class="mt_10"
|
||||
>
|
||||
</Table>
|
||||
|
||||
|
@ -289,9 +287,8 @@
|
|||
border
|
||||
:columns="receiptRecordColumns"
|
||||
:data="receiptRecordData"
|
||||
class="mt_10"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="walletChangeSort"
|
||||
>
|
||||
<template slot="orderSnSlot" slot-scope="scope">
|
||||
|
||||
|
@ -365,7 +362,7 @@
|
|||
import * as API_Order from "@/api/order.js";
|
||||
|
||||
export default {
|
||||
name: "member",
|
||||
name: "memberDetail",
|
||||
components: {
|
||||
region,
|
||||
ossManage,
|
||||
|
@ -423,7 +420,7 @@
|
|||
key: "point",
|
||||
width: 150,
|
||||
render: (h, params) => {
|
||||
if (params.row.pointType == 1) {
|
||||
if (params.row.pointType == 'INCREASE') {
|
||||
return h('div', [
|
||||
h('span', {
|
||||
style: {
|
||||
|
@ -1074,6 +1071,7 @@
|
|||
,
|
||||
//积分记录页数变化
|
||||
pointChangePageSize(v) {
|
||||
this.pointSearchForm.pageNumber = 1;
|
||||
this.pointSearchForm.pageSize = v;
|
||||
this.getPointData();
|
||||
}
|
||||
|
@ -1086,6 +1084,7 @@
|
|||
,
|
||||
//会员地址记录页数变化
|
||||
addressChangePageSize(v) {
|
||||
this.addressSearchForm.pageNumber = 1;
|
||||
this.addressSearchForm.pageSize = v;
|
||||
this.getPointData();
|
||||
},
|
||||
|
@ -1098,6 +1097,7 @@
|
|||
,
|
||||
//余额记录页数变化
|
||||
walletChangePageSize(v) {
|
||||
this.walletSearchForm.pageNumber = 1;
|
||||
this.walletSearchForm.pageSize = v;
|
||||
this.getDepositLogData();
|
||||
},
|
||||
|
@ -1110,31 +1110,11 @@
|
|||
,
|
||||
//订单记录页数变化
|
||||
orderChangePageSize(v) {
|
||||
this.orderSearchForm.pageNumber = 1;
|
||||
this.orderSearchForm.pageSize = v;
|
||||
this.getOrderData();
|
||||
},
|
||||
orderChangeSort(e) {
|
||||
this.orderSearchForm.sort = e.key;
|
||||
this.orderSearchForm.order = e.order;
|
||||
this.getOrderData();
|
||||
},
|
||||
addressChangeSort(e) {
|
||||
this.addressSearchForm.sort = e.key;
|
||||
this.addressSearchForm.order = e.order;
|
||||
this.getPointData();
|
||||
}
|
||||
|
||||
,
|
||||
walletChangeSort(e) {
|
||||
this.walletSearchForm.sort = e.key;
|
||||
this.walletSearchForm.order = e.order;
|
||||
this.getDepositLogData();
|
||||
},
|
||||
pointChangeSort(e) {
|
||||
this.pointSearchForm.sort = e.key;
|
||||
this.pointSearchForm.order = e.order;
|
||||
this.getPointData();
|
||||
},
|
||||
// 起止时间从新赋值
|
||||
selectDateRange(v) {
|
||||
if (v) {
|
||||
this.orderSearchForm.startDate = v[0];
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
class="mt_10"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
|
@ -181,9 +182,6 @@
|
|||
picModelFlag: false, // 选择图片
|
||||
formValidate: {}, // 表单数据
|
||||
ruleValidate: {}, //修改验证
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [
|
||||
{
|
||||
title: "会员名称",
|
||||
|
@ -332,41 +330,27 @@
|
|||
callback(val) {
|
||||
this.$emit("callback", val);
|
||||
},
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getData();
|
||||
},
|
||||
// 分页 修改页码
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getData();
|
||||
},
|
||||
// 分页 修改页数
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = v;
|
||||
this.getData();
|
||||
},
|
||||
// 搜索
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getData();
|
||||
},
|
||||
|
||||
changeSort(e) {
|
||||
this.searchForm.sort = e.key;
|
||||
this.searchForm.order = e.order;
|
||||
if (e.order === "normal") {
|
||||
this.searchForm.order = "";
|
||||
}
|
||||
this.getData();
|
||||
},
|
||||
changeSelect(e) {
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
selectDateRange(v) {
|
||||
if (v) {
|
||||
this.searchForm.startDate = v[0];
|
||||
this.searchForm.endDate = v[1];
|
||||
}
|
||||
},
|
||||
//查看详情修改
|
||||
editPerm(val) {
|
||||
this.descTitle = `查看用户 ${val.username}`;
|
||||
|
@ -406,28 +390,6 @@
|
|||
this.regionId = val[0];
|
||||
},
|
||||
|
||||
|
||||
//禁用会员
|
||||
disabled(v) {
|
||||
let params = {
|
||||
memberIds: [v.id],
|
||||
disabled: "CLOSE"
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: '提示',
|
||||
content: '<p>确认禁用此会员?</p>',
|
||||
onOk: () => {
|
||||
API_Member.updateMemberStatus(params).then(res => {
|
||||
if (res.success) {
|
||||
this.$Message.success('禁用成功');
|
||||
this.getData()
|
||||
} else {
|
||||
this.$Message.error(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
//详细
|
||||
detail(row){
|
||||
this.$router.push({ name: "member-detail", query: { id: row.id } });
|
||||
|
@ -447,7 +409,7 @@
|
|||
this.$Message.success('禁用成功');
|
||||
this.getData()
|
||||
} else {
|
||||
this.$Message.error(res.message);
|
||||
// this.$Message.error(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,201 +0,0 @@
|
|||
<style lang="scss">
|
||||
@import "./messageManage.scss";
|
||||
</style>
|
||||
<template>
|
||||
<div>
|
||||
<Card>
|
||||
<p slot="title">
|
||||
<span v-if="type==0">发送新消息</span>
|
||||
<span v-else>编辑消息</span>
|
||||
</p>
|
||||
<Row>
|
||||
<Form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:label-width="90"
|
||||
:rules="formValidate"
|
||||
style="position:relative"
|
||||
>
|
||||
<FormItem label="消息类型" prop="type">
|
||||
<Select v-model="form.type" placeholder="请选择" style="width:250px">
|
||||
<Option
|
||||
v-for="(item, i) in dictMessageType"
|
||||
:key="i"
|
||||
:value="item.value"
|
||||
>{{item.title}}</Option>
|
||||
</Select>
|
||||
</FormItem>
|
||||
<FormItem label="标题" prop="title">
|
||||
<Input v-model="form.title" style="width:600px" />
|
||||
</FormItem>
|
||||
<FormItem label="内容" prop="content" class="wangEditor">
|
||||
<editor v-model="form.content"></editor>
|
||||
</FormItem>
|
||||
<FormItem label="新创建账号也推送" prop="createSend">
|
||||
<i-switch size="large" v-model="form.createSend">
|
||||
<span slot="open">开启</span>
|
||||
<span slot="close">关闭</span>
|
||||
</i-switch>
|
||||
</FormItem>
|
||||
<div v-if="type==0">
|
||||
<FormItem label="发送范围">
|
||||
<RadioGroup type="button" button-style="solid" v-model="form.range">
|
||||
<Radio :label="0">全体用户</Radio>
|
||||
<Radio :label="1">指定用户成员</Radio>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
<div>
|
||||
<FormItem label="选择用户" v-if="form.range==1">
|
||||
<user-choose text="选择发送用户" @on-change="handleSelectUser" ref="user"></user-choose>
|
||||
</FormItem>
|
||||
</div>
|
||||
</div>
|
||||
<Form-item class="br">
|
||||
<Button
|
||||
type="primary"
|
||||
:loading="submitLoading"
|
||||
@click="handelSubmit"
|
||||
style="width:100px"
|
||||
>提交</Button>
|
||||
<Button @click="handelCancel">取消</Button>
|
||||
</Form-item>
|
||||
<Spin size="large" fix v-if="loading"></Spin>
|
||||
</Form>
|
||||
</Row>
|
||||
</Card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getMessageDataById, addMessage, editMessage } from "@/api/index";
|
||||
import editor from "@/views/my-components/lili/editor";
|
||||
import userChoose from "@/views/my-components/lili/user-choose";
|
||||
export default {
|
||||
name: "add_edit_message",
|
||||
components: {
|
||||
userChoose,
|
||||
editor
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type: 0, // 消息类型
|
||||
loading: false, // 表单加载状态
|
||||
selectUsers: [], // 已选用户
|
||||
modalTitle: "", // 添加或编辑标题
|
||||
form: { // 表单
|
||||
// 添加或编辑表单对象初始化数据
|
||||
title: "",
|
||||
content: "",
|
||||
type: "",
|
||||
range: 0
|
||||
},
|
||||
formValidate: {
|
||||
// 表单验证规则
|
||||
/* type: [
|
||||
{ required: true, message: "消息类型不能为空", trigger: "blur" }
|
||||
],*/
|
||||
title: [{ required: true, message: "标题不能为空", trigger: "blur" }],
|
||||
content: [{ required: true, message: "内容不能为空", trigger: "blur" }]
|
||||
},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
dictMessageType: this.$store.state.dict.messageType, // 消息类型
|
||||
backRoute: "" // 上一个页面路由
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.type = this.$route.query.type;
|
||||
this.backRoute = this.$route.query.backRoute;
|
||||
if (this.type == 1) {
|
||||
this.form.id = this.$route.query.id;
|
||||
this.getData();
|
||||
}
|
||||
},
|
||||
getData() {
|
||||
this.loading = true;
|
||||
getMessageDataById(this.form.id).then(res => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
// 转换null为""
|
||||
let v = res.result;
|
||||
for (let attr in v) {
|
||||
if (v[attr] == null) {
|
||||
v[attr] = "";
|
||||
}
|
||||
}
|
||||
let str = JSON.stringify(v);
|
||||
let data = JSON.parse(str);
|
||||
this.form = data;
|
||||
}
|
||||
});
|
||||
},
|
||||
handelSubmit() {
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
if (this.type == 0) {
|
||||
// 添加 避免编辑后传入id等数据 记得删除
|
||||
delete this.form.id;
|
||||
// 用户id数据
|
||||
let ids = [];
|
||||
this.selectUsers.forEach(e => {
|
||||
ids += e.id + ",";
|
||||
});
|
||||
if (ids.length > 0) {
|
||||
ids = ids.substring(0, ids.length - 1);
|
||||
}
|
||||
this.form.userIds = ids;
|
||||
addMessage(this.form).then(res => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.closeCurrentPage();
|
||||
}
|
||||
});
|
||||
} else if (this.type == 1) {
|
||||
// 编辑
|
||||
editMessage(this.form).then(res => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.closeCurrentPage();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSelectUser(v) {
|
||||
this.selectUsers = v;
|
||||
},
|
||||
handelCancel() {
|
||||
this.closeCurrentPage();
|
||||
},
|
||||
// 关闭当前页面
|
||||
closeCurrentPage() {
|
||||
this.$store.commit("removeTag", "add_edit_message");
|
||||
localStorage.pageOpenedList = JSON.stringify(
|
||||
this.$store.state.app.pageOpenedList
|
||||
);
|
||||
this.$router.push({
|
||||
name: this.backRoute
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
watch: {
|
||||
// 监听路由变化
|
||||
$route(to, from) {
|
||||
if (to.name == "add_edit_message") {
|
||||
this.type = this.$route.query.type;
|
||||
if (this.type == 1) {
|
||||
this.form.id = this.$route.query.id;
|
||||
this.getData();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -1,719 +0,0 @@
|
|||
|
||||
<template>
|
||||
<div>
|
||||
<!--短信-->
|
||||
<Modal v-model="smsModal" width="530">
|
||||
<p slot="header">
|
||||
<Icon type="edit"></Icon>
|
||||
<span>短信设置</span>
|
||||
</p>
|
||||
<div>
|
||||
<Form ref="smsFormData" :model="smsFormData" label-position="left" :label-width="100" :rules="smsFormValidate">
|
||||
<FormItem label="模板名称" prop="templateName">
|
||||
<Input v-model="templateName" size="large" maxlength="9" disabled></Input>
|
||||
</FormItem>
|
||||
<FormItem label="模板代码" prop="smsCode">
|
||||
<Input v-model="smsFormData.smsCode" size="large" maxlength="30"></Input>
|
||||
</FormItem>
|
||||
<FormItem label="模板名称" prop="smsContent">
|
||||
<Input class='textarea' :rows="5" :autosize="{maxRows:5,minRows: 5}" v-model="smsFormData.smsContent" type="textarea" maxlength="150"/>
|
||||
</FormItem>
|
||||
<FormItem label="是否开启" prop="smsState">
|
||||
<i-switch v-model="smsFormData.smsState" size="large" :value="smsFormData.smsState">
|
||||
<span slot="open">开启</span>
|
||||
<span slot="close">关闭</span>
|
||||
</i-switch>
|
||||
</FormItem>
|
||||
</Form>
|
||||
|
||||
</div>
|
||||
<div slot="footer" style="text-align: right">
|
||||
<Button type="success" size="large" @click="smsFormDataEdit">设置</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
<!--站内信-->
|
||||
<Modal v-model="noticeModal" width="530">
|
||||
<p slot="header">
|
||||
<Icon type="edit"></Icon>
|
||||
<span>站内信设置</span>
|
||||
</p>
|
||||
<div>
|
||||
<Form ref="noticeFormData" :model="noticeFormData" label-position="left" :label-width="100" :rules="noticeFormValidate">
|
||||
<FormItem label="模板名称" prop="templateName">
|
||||
<Input v-model="templateName" size="large" maxlength="9" disabled></Input>
|
||||
</FormItem>
|
||||
<FormItem label="模板名称" prop="smsContent">
|
||||
<Input class='textarea' :rows="5" :autosize="{maxRows:5,minRows: 5}" v-model="noticeFormData.noticeContent" type="textarea" maxlength="150"/>
|
||||
</FormItem>
|
||||
</Form>
|
||||
|
||||
</div>
|
||||
<div slot="footer" style="text-align: right">
|
||||
<Button type="success" size="large" @click="noticeFormDataEdit">设置</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
<!--微信模板-->
|
||||
<Modal v-model="wechatModal" width="530">
|
||||
<p slot="header">
|
||||
<Icon type="edit"></Icon>
|
||||
<span>微信设置</span>
|
||||
</p>
|
||||
<div>
|
||||
<Form ref="wechatFormData" :model="wechatFormData" label-position="left" :label-width="100" :rules="wechatFormValidate">
|
||||
<FormItem label="模板名称" prop="templateName">
|
||||
<Input v-model="templateName" size="large" maxlength="9" disabled></Input>
|
||||
</FormItem>
|
||||
<FormItem label="头部信息" prop="first">
|
||||
<Input v-model="wechatFormData.first" size="large" maxlength="50"></Input>
|
||||
</FormItem>
|
||||
<FormItem label="备注" prop="remark">
|
||||
<Input class='textarea' :rows="5" :autosize="{maxRows:5,minRows: 5}" v-model="wechatFormData.remark" type="textarea" maxlength="150"/>
|
||||
</FormItem>
|
||||
<FormItem label="是否开启" prop="enable">
|
||||
<i-switch v-model="wechatFormData.enable" size="large" :value="smsFormData.enable">
|
||||
<span slot="open">开启</span>
|
||||
<span slot="close">关闭</span>
|
||||
</i-switch>
|
||||
</FormItem>
|
||||
</Form>
|
||||
|
||||
</div>
|
||||
<div slot="footer" style="text-align: right">
|
||||
<Button type="success" size="large" @click="wechatFormDataEdit">设置</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
<Tabs value="log" @on-click="tabPaneChange" v-model="tab">
|
||||
<TabPane label="会员消息" name="MEMBER">
|
||||
<div class="search">
|
||||
<Card>
|
||||
|
||||
<Row class="operation">
|
||||
<Button @click="getDataList" icon="md-refresh">刷新</Button>
|
||||
<Button type="dashed" @click="openTip=!openTip">{{openTip ? "关闭提示" : "开启提示"}}</Button>
|
||||
</Row>
|
||||
<Row v-show="openTip">
|
||||
<Alert show-icon>
|
||||
已选择
|
||||
<span class="select-count">{{selectCount}}</span> 项
|
||||
<a class="select-clear" @click="clearSelectAll">清空</a>
|
||||
</Alert>
|
||||
</Row>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="showSelect"
|
||||
ref="memberTable"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<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>
|
||||
</Card>
|
||||
</div>
|
||||
</TabPane>
|
||||
<TabPane label="店铺消息" name="SHOP">
|
||||
<div class="search">
|
||||
<Card>
|
||||
|
||||
<Row class="operation">
|
||||
<Button @click="getDataList" icon="md-refresh">刷新</Button>
|
||||
<Button type="dashed" @click="openTip=!openTip">{{openTip ? "关闭提示" : "开启提示"}}</Button>
|
||||
</Row>
|
||||
<Row v-show="openTip">
|
||||
<Alert show-icon>
|
||||
已选择
|
||||
<span class="select-count">{{selectCount}}</span> 项
|
||||
<a class="select-clear" @click="clearSelectAll">清空</a>
|
||||
</Alert>
|
||||
</Row>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="showSelect"
|
||||
ref="shopTable"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<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>
|
||||
</Card>
|
||||
</div>
|
||||
</TabPane>
|
||||
|
||||
<TabPane label="微信消息" name="WECHAT">
|
||||
<div class="search">
|
||||
<Card>
|
||||
|
||||
<Row class="operation">
|
||||
<Button @click="weChatSync" type="primary" icon="md-add">同步微信消息</Button>
|
||||
<Button @click="getDataList" icon="md-refresh">刷新</Button>
|
||||
<Button type="dashed" @click="openTip=!openTip">{{openTip ? "关闭提示" : "开启提示"}}</Button>
|
||||
</Row>
|
||||
<Row v-show="openTip">
|
||||
<Alert show-icon>
|
||||
已选择
|
||||
<span class="select-count">{{selectCount}}</span> 项
|
||||
<a class="select-clear" @click="clearSelectAll">清空</a>
|
||||
</Alert>
|
||||
</Row>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="weChatColumns"
|
||||
:data="weChatData"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="showSelect"
|
||||
ref="weChatTable"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page
|
||||
:current="weChatSearchForm.pageNumber"
|
||||
:total="weChatTotal"
|
||||
:page-size="weChatSearchForm.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>
|
||||
</div>
|
||||
</TabPane>
|
||||
|
||||
<TabPane label="其他消息" name="OTHER">
|
||||
<div class="search">
|
||||
<Card>
|
||||
|
||||
<Row class="operation">
|
||||
<Button @click="getDataList" icon="md-refresh">刷新</Button>
|
||||
<Button type="dashed" @click="openTip=!openTip">{{openTip ? "关闭提示" : "开启提示"}}</Button>
|
||||
</Row>
|
||||
<Row v-show="openTip">
|
||||
<Alert show-icon>
|
||||
已选择
|
||||
<span class="select-count">{{selectCount}}</span> 项
|
||||
<a class="select-clear" @click="clearSelectAll">清空</a>
|
||||
</Alert>
|
||||
</Row>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="showSelect"
|
||||
ref="otherTable"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<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>
|
||||
</Card>
|
||||
</div>
|
||||
</TabPane>
|
||||
</Tabs>
|
||||
</div>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getMessageData,
|
||||
editSmsMessageTemplate,
|
||||
editNoticeMessage,
|
||||
wechatMessageSync,
|
||||
getWechatMessagePage,
|
||||
editWechatMessageTemplate,
|
||||
delWechatMessageTemplate
|
||||
} from "@/api/setting";
|
||||
|
||||
export default {
|
||||
title: "message-manage",
|
||||
data() {
|
||||
return {
|
||||
messageTemplate:'',// 当前消息模板
|
||||
messageTemplateId:'', // 当前消息模板id
|
||||
templateName:'', // 模板名称
|
||||
smsModal: false,//短信
|
||||
smsFormData:{ // 模板表单数据
|
||||
smsState:'',
|
||||
smsContent:'',
|
||||
smsCode: ''
|
||||
},
|
||||
smsFormValidate:{ // 验证规则
|
||||
smsCode: [{ required: true, message: '请输入短信编码'}],
|
||||
smsContent: [{ required: true, message: '请输入短信内容'}],
|
||||
},
|
||||
noticeModal: false, // 站内信
|
||||
noticeFormData:{ // 站内信表单
|
||||
noticeContent:''
|
||||
},
|
||||
noticeFormValidate:{ // 验证规则
|
||||
noticeContent: [{ required: true, message: '请输入站内信内容'}],
|
||||
},
|
||||
wechatModal:false,//微信消息
|
||||
wechatFormData:{ // 微信表单
|
||||
remark:'',
|
||||
first:'',
|
||||
enable:'',
|
||||
},
|
||||
wechatFormValidate:{ // 验证规则
|
||||
remark: [{ required: true, message: '请输入站内信内容'}],
|
||||
first: [{ required: true, message: '请输入头部文字信息'}],
|
||||
},
|
||||
tab: "MEMBER", // tabName
|
||||
openTip: true, // 提示展示
|
||||
loading: true, // 表单加载状态
|
||||
selectCount: 0, // 多选计数
|
||||
selectList: [], // 多选数据
|
||||
drop: false, // 更多搜索项
|
||||
dropDownContent: "展开", // drop显示内容
|
||||
dropDownIcon: "ios-arrow-down", // drop图标
|
||||
searchForm: {
|
||||
// 搜索框对应data对象
|
||||
type: "MEMBER",
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
startDate: "", // 起始时间
|
||||
endDate: "" // 终止时间
|
||||
},
|
||||
//微信消息查询
|
||||
weChatSearchForm: {
|
||||
// 搜索框对应data对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
},
|
||||
selectDate: null, // 选择日期绑定modal
|
||||
columns: [
|
||||
// 表头
|
||||
{
|
||||
type: "selection",
|
||||
width: 60,
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "ID",
|
||||
key: "id",
|
||||
width: 180,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: "模板名称",
|
||||
key: "name",
|
||||
width: 300,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: "创建时间",
|
||||
key: "createTime",
|
||||
sortable: true,
|
||||
sortType: "desc"
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
width: 280,
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
render: (h, params) => {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
size: "small"
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.smsSettingAlert(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"短信设置"
|
||||
),
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "primary",
|
||||
size: "small"
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.noticeSettingAlert(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"站内信设置"
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
weChatColumns: [
|
||||
// 表头
|
||||
{
|
||||
type: "selection",
|
||||
width: 60,
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "模板编号",
|
||||
key: "code",
|
||||
width: 500,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: "是否开启",
|
||||
key: "enable",
|
||||
sortable: true,
|
||||
width: 150,
|
||||
render: (h, params) => {
|
||||
if (params.row.enable == true) {
|
||||
return h('div', [
|
||||
h('span', {
|
||||
}, '开启'),
|
||||
]);
|
||||
} else {
|
||||
return h('div', [
|
||||
h('span', {
|
||||
}, '关闭'),
|
||||
]);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "模板名称",
|
||||
key: "name",
|
||||
width: 200,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: "创建时间",
|
||||
key: "createTime",
|
||||
sortable: true,
|
||||
sortType: "desc",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
width: 200,
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
render: (h, params) => {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "primary",
|
||||
size: "small"
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.wechatSettingAlert(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"编辑"
|
||||
),
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "error",
|
||||
size: "small"
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.delWeChat(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"删除"
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
],
|
||||
weChatData: [], // 表单数据
|
||||
weChatTotal: 0, // 表单数据总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
dropDown() {
|
||||
if (this.drop) {
|
||||
this.dropDownContent = "展开";
|
||||
this.dropDownIcon = "ios-arrow-down";
|
||||
} else {
|
||||
this.dropDownContent = "收起";
|
||||
this.dropDownIcon = "ios-arrow-up";
|
||||
}
|
||||
this.drop = !this.drop;
|
||||
},
|
||||
changePage(v) {
|
||||
this.searchForm.type = this.tab;
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
changePageSize(v) {
|
||||
this.searchForm.type = this.tab;
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
//短信设置弹出框
|
||||
smsSettingAlert(v){
|
||||
this.smsFormData.smsState = v.smsState == 'OPEN' ? true:false
|
||||
this.smsFormData.smsContent = v.smsContent
|
||||
this.smsFormData.smsCode = v.smsCode
|
||||
this.templateName = v.name
|
||||
this.messageTemplateId = v.id
|
||||
this.smsModal = true
|
||||
},
|
||||
//站内信弹出框
|
||||
noticeSettingAlert(v){
|
||||
this.noticeFormData.noticeContent = v.noticeContent
|
||||
this.templateName = v.name
|
||||
this.messageTemplateId = v.id
|
||||
this.noticeModal = true
|
||||
},
|
||||
//微信弹出框
|
||||
wechatSettingAlert(v){
|
||||
this.wechatFormData.remark = v.remark
|
||||
this.wechatFormData.first = v.first
|
||||
this.wechatFormData.enable = v.enable
|
||||
this.templateName = v.name
|
||||
this.messageTemplateId = v.id
|
||||
this.wechatModal = true
|
||||
},
|
||||
//短信设置保存
|
||||
smsFormDataEdit(){
|
||||
this.$refs['smsFormData'].validate((valid) => {
|
||||
if (valid) {
|
||||
if(this.smsFormData.smsState){
|
||||
this.smsFormData.smsState = "OPEN"
|
||||
}else{
|
||||
this.smsFormData.smsState = "CLOSE"
|
||||
}
|
||||
editSmsMessageTemplate(this.messageTemplateId,this.smsFormData).then(res => {
|
||||
if(res.message === 'success') {
|
||||
this.$Message.success('短信模板修改成功');
|
||||
this.smsModal = false;
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
//微信设置保存
|
||||
wechatFormDataEdit(){
|
||||
this.$refs['wechatFormData'].validate((valid) => {
|
||||
if (valid) {
|
||||
editWechatMessageTemplate(this.messageTemplateId,this.wechatFormData).then(res => {
|
||||
if(res.message === 'success') {
|
||||
this.$Message.success('微信模板修改成功');
|
||||
this.wechatModal = false;
|
||||
this.getWechatMessagePage();
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
//站内信设置保存
|
||||
noticeFormDataEdit(){
|
||||
this.$refs['noticeFormData'].validate((valid) => {
|
||||
if (valid) {
|
||||
editNoticeMessage(this.messageTemplateId,this.noticeFormData).then(res => {
|
||||
if(res.message === 'success') {
|
||||
this.$Message.success('站内信修改成功');
|
||||
this.noticeModal = false;
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
//同步微信消息
|
||||
weChatSync(){
|
||||
this.$Modal.confirm({
|
||||
title: "提示",
|
||||
// 记得确认修改此处
|
||||
content: "确认要同步微信消息模板?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 同步微信消息模板
|
||||
wechatMessageSync().then(res => {
|
||||
this.$Modal.remove();
|
||||
if(res.success) {
|
||||
this.$Message.success('微信消息模板同步成功');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
//删除微信模消息
|
||||
delWeChat(v){
|
||||
this.$Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定删除此模板?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除微信消息模板
|
||||
delWechatMessageTemplate(v.id).then(res => {
|
||||
if(res.success) {
|
||||
this.$Modal.remove();
|
||||
this.$Message.success('微信模板删除成功');
|
||||
this.getWechatMessagePage()
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
selectDateRange(v) {
|
||||
if (v) {
|
||||
this.searchForm.startDate = v[0];
|
||||
this.searchForm.endDate = v[1];
|
||||
}
|
||||
},
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
getMessageData(this.searchForm).then(res => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
//分页获取微信消息
|
||||
getWechatMessagePage(){
|
||||
getWechatMessagePage(this.weChatSearchForm).then(res => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.weChatData = res.result.records;
|
||||
this.weChatTotal = res.result.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
//tab切换事件
|
||||
tabPaneChange(v) {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.searchForm.type = v;
|
||||
//如果是微信消息则走单独的接口
|
||||
if(v === "WECHAT"){
|
||||
this.getWechatMessagePage();
|
||||
}else{
|
||||
this.getDataList();
|
||||
}
|
||||
|
||||
},
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
handleReset() {
|
||||
this.$refs.searchForm.resetFields();
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.selectDate = null;
|
||||
this.searchForm.startDate = "";
|
||||
this.searchForm.endDate = "";
|
||||
// 重新加载数据
|
||||
this.getDataList();
|
||||
},
|
||||
changeSort(e) {
|
||||
this.searchForm.sort = e.key;
|
||||
this.searchForm.order = e.order;
|
||||
if (e.order == "normal") {
|
||||
this.searchForm.order = "";
|
||||
}
|
||||
this.getDataList();
|
||||
},
|
||||
showSelect(e) {
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
clearSelectAll() {
|
||||
this.$refs.memberTable.selectAll(false);
|
||||
this.$refs.weChatTable.selectAll(false);
|
||||
this.$refs.shopTable.selectAll(false);
|
||||
this.$refs.otherTable.selectAll(false);
|
||||
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -1,5 +0,0 @@
|
|||
.wangEditor {
|
||||
.ivu-form-item-content {
|
||||
line-height: unset !important;
|
||||
}
|
||||
}
|
|
@ -1,412 +0,0 @@
|
|||
<template>
|
||||
<div class="search">
|
||||
<Card>
|
||||
<Row v-show="openSearch" @keydown.enter.native="handleSearch">
|
||||
<Form ref="searchForm" :model="searchForm" inline :label-width="70">
|
||||
<Form-item label="消息标题" prop="title">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.title"
|
||||
placeholder="请输入消息标题"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
</Form-item>
|
||||
<Form-item label="消息内容" prop="content">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.content"
|
||||
placeholder="请输入消息内容"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
</Form-item>
|
||||
<span v-if="drop">
|
||||
<Form-item label="消息类型" prop="type">
|
||||
<Select
|
||||
v-model="searchForm.type"
|
||||
placeholder="请选择消息类型"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
>
|
||||
<Option
|
||||
v-for="(item, i) in dictMessageType"
|
||||
:key="i"
|
||||
:value="item.value"
|
||||
>{{item.title}}</Option>
|
||||
</Select>
|
||||
</Form-item>
|
||||
<Form-item label="创建时间">
|
||||
<DatePicker
|
||||
v-model="selectDate"
|
||||
type="daterange"
|
||||
format="yyyy-MM-dd"
|
||||
clearable
|
||||
@on-change="selectDateRange"
|
||||
placeholder="选择起始时间"
|
||||
style="width: 200px"
|
||||
></DatePicker>
|
||||
</Form-item>
|
||||
</span>
|
||||
<Form-item 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>
|
||||
</Form-item>
|
||||
</Form>
|
||||
</Row>
|
||||
<Row class="operation">
|
||||
<Button @click="add" type="primary" icon="md-add">发送新消息</Button>
|
||||
<Button @click="delAll" icon="md-trash">批量删除撤回</Button>
|
||||
<Button @click="getDataList" icon="md-refresh">刷新</Button>
|
||||
<Button type="dashed" @click="openSearch=!openSearch">{{openSearch ? "关闭搜索" : "开启搜索"}}</Button>
|
||||
<Button type="dashed" @click="openTip=!openTip">{{openTip ? "关闭提示" : "开启提示"}}</Button>
|
||||
</Row>
|
||||
<Row v-show="openTip">
|
||||
<Alert show-icon>
|
||||
已选择
|
||||
<span class="select-count">{{selectCount}}</span> 项
|
||||
<a class="select-clear" @click="clearSelectAll">清空</a>
|
||||
</Alert>
|
||||
</Row>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="showSelect"
|
||||
ref="table"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<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>
|
||||
</Card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getMessageData,
|
||||
addMessage,
|
||||
editMessage,
|
||||
deleteMessage
|
||||
} from "@/api/index";
|
||||
export default {
|
||||
title: "message-manage",
|
||||
data() {
|
||||
return {
|
||||
openSearch: true, // 显示搜索
|
||||
openTip: true, // 显示提示
|
||||
loading: true, // 表单加载状态
|
||||
userLoading: true,
|
||||
selectCount: 0, // 多选计数
|
||||
selectList: [], // 多选数据
|
||||
drop: false, // 展开搜索
|
||||
dropDownContent: "展开",
|
||||
dropDownIcon: "ios-arrow-down",
|
||||
searchForm: {
|
||||
// 搜索框对应data对象
|
||||
title: "",
|
||||
content: "",
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
startDate: "", // 起始时间
|
||||
endDate: "" // 终止时间
|
||||
},
|
||||
selectDate: null, // 选择日期绑定modal
|
||||
columns: [
|
||||
// 表头
|
||||
{
|
||||
type: "selection",
|
||||
width: 60,
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
type: "index",
|
||||
width: 60,
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "消息标题",
|
||||
key: "title",
|
||||
width: 200,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: "消息内容",
|
||||
key: "content",
|
||||
minWidth: 275,
|
||||
tooltip: true
|
||||
},
|
||||
{
|
||||
title: "类型",
|
||||
key: "type",
|
||||
width: 120,
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "新创建账号推送",
|
||||
key: "createSend",
|
||||
align: "center",
|
||||
width: 135,
|
||||
render: (h, params) => {
|
||||
if (params.row.createSend) {
|
||||
return h("div", [
|
||||
h(
|
||||
"Tag",
|
||||
{
|
||||
props: {
|
||||
color: "blue"
|
||||
}
|
||||
},
|
||||
"开启"
|
||||
)
|
||||
]);
|
||||
} else {
|
||||
return h("div", [
|
||||
h(
|
||||
"Tag",
|
||||
{
|
||||
props: {
|
||||
color: "default"
|
||||
}
|
||||
},
|
||||
"关闭"
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "创建时间",
|
||||
key: "createTime",
|
||||
width: 180,
|
||||
sortable: true,
|
||||
sortType: "desc"
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
width: 280,
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
render: (h, params) => {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
size: "small"
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.edit(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"编辑"
|
||||
),
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "primary",
|
||||
size: "small"
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.sendDetail(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"查看发送详情"
|
||||
),
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "error",
|
||||
size: "small"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.remove(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"删除撤回"
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
dictMessageType: this.$store.state.dict.messageType
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
dropDown() {
|
||||
if (this.drop) {
|
||||
this.dropDownContent = "展开";
|
||||
this.dropDownIcon = "ios-arrow-down";
|
||||
} else {
|
||||
this.dropDownContent = "收起";
|
||||
this.dropDownIcon = "ios-arrow-up";
|
||||
}
|
||||
this.drop = !this.drop;
|
||||
},
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
selectDateRange(v) {
|
||||
if (v) {
|
||||
this.searchForm.startDate = v[0];
|
||||
this.searchForm.endDate = v[1];
|
||||
}
|
||||
},
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
getMessageData(this.searchForm).then(res => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
handleReset() {
|
||||
this.$refs.searchForm.resetFields();
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.selectDate = null;
|
||||
this.searchForm.startDate = "";
|
||||
this.searchForm.endDate = "";
|
||||
// 重新加载数据
|
||||
this.getDataList();
|
||||
},
|
||||
changeSort(e) {
|
||||
this.searchForm.sort = e.key;
|
||||
this.searchForm.order = e.order;
|
||||
if (e.order == "normal") {
|
||||
this.searchForm.order = "";
|
||||
}
|
||||
this.getDataList();
|
||||
},
|
||||
add() {
|
||||
let query = { type: 0, backRoute: this.$route.name };
|
||||
this.$router.push({
|
||||
name: "add_edit_message",
|
||||
query: query
|
||||
});
|
||||
},
|
||||
edit(v) {
|
||||
let query = { type: 1, id: v.id, backRoute: this.$route.name };
|
||||
this.$router.push({
|
||||
name: "add_edit_message",
|
||||
query: query
|
||||
});
|
||||
},
|
||||
sendDetail(v) {
|
||||
let query = { id: v.id };
|
||||
this.$router.push({
|
||||
name: "message_send_detail",
|
||||
query: query
|
||||
});
|
||||
},
|
||||
remove(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
// 记得确认修改此处
|
||||
content: "您确认要删除 " + v.title + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
deleteMessage(v.id).then(res => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
showSelect(e) {
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
clearSelectAll() {
|
||||
this.$refs.table.selectAll(false);
|
||||
},
|
||||
delAll() {
|
||||
if (this.selectCount <= 0) {
|
||||
this.$Message.warning("您还未选择要删除的数据");
|
||||
return;
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
content: "您确认要删除所选的 " + this.selectCount + " 条数据?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
let ids = "";
|
||||
this.selectList.forEach(function(e) {
|
||||
ids += e.id + ",";
|
||||
});
|
||||
ids = ids.substring(0, ids.length - 1);
|
||||
// 批量删除
|
||||
deleteMessage(ids).then(res => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.clearSelectAll();
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -1,322 +0,0 @@
|
|||
<template>
|
||||
<div class="search">
|
||||
<Card>
|
||||
<Row v-show="openSearch" @keydown.enter.native="handleSearch">
|
||||
<Form ref="searchForm" inline :label-width="90">
|
||||
<Form-item label="发送用户ID" prop="userId">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="userId"
|
||||
placeholder="请输入发送用户完整ID"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
</Form-item>
|
||||
<Form-item label="发送状态" prop="status">
|
||||
<Select v-model="status" placeholder="请选择" style="width: 200px" clearable>
|
||||
<Option value="0">未读</Option>
|
||||
<Option value="1">已读</Option>
|
||||
<Option value="2">回收站</Option>
|
||||
</Select>
|
||||
</Form-item>
|
||||
<Form-item style="margin-left:-35px;" class="br">
|
||||
<Button @click="getDataList" type="primary" icon="ios-search">搜索</Button>
|
||||
<Button @click="handleReset">重置</Button>
|
||||
</Form-item>
|
||||
</Form>
|
||||
</Row>
|
||||
<Row class="operation">
|
||||
<Button v-hasRole="'ROLE_ADMIN'" @click="delAll" icon="md-trash">批量删除</Button>
|
||||
<Button @click="getDataList" icon="md-refresh">刷新</Button>
|
||||
<Button type="dashed" @click="openSearch=!openSearch">{{openSearch ? "关闭搜索" : "开启搜索"}}</Button>
|
||||
<Button type="dashed" @click="openTip=!openTip">{{openTip ? "关闭提示" : "开启提示"}}</Button>
|
||||
</Row>
|
||||
<Row v-show="openTip">
|
||||
<Alert show-icon>
|
||||
已选择
|
||||
<span class="select-count">{{selectCount}}</span> 项
|
||||
<a class="select-clear" @click="clearSelectAll">清空</a>
|
||||
</Alert>
|
||||
</Row>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page
|
||||
:current="pageNumber"
|
||||
:total="total"
|
||||
:page-size="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>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getMessageSendData, deleteMessageSend } from "@/api/index";
|
||||
export default {
|
||||
name: "message_send_detail",
|
||||
data() {
|
||||
return {
|
||||
openSearch: true, // 显示搜索项
|
||||
openTip: true, // 显示提示
|
||||
loading: true, // 表单加载状态
|
||||
messageId: "", // 信息id
|
||||
sortColumn: "createTime", // 排序字段
|
||||
sortType: "desc", // 排序方式
|
||||
status: "", // 发送状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [
|
||||
// 表头
|
||||
{
|
||||
type: "selection",
|
||||
width: 60,
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
type: "index",
|
||||
width: 60,
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "发送消息标题",
|
||||
key: "title"
|
||||
},
|
||||
{
|
||||
title: "发送用户",
|
||||
key: "username",
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
key: "status",
|
||||
align: "center",
|
||||
sortable: true,
|
||||
render: (h, params) => {
|
||||
if (params.row.status == 0) {
|
||||
return h("div", [
|
||||
h(
|
||||
"Tag",
|
||||
{
|
||||
props: {
|
||||
color: "default"
|
||||
}
|
||||
},
|
||||
"未读"
|
||||
)
|
||||
]);
|
||||
} else if (params.row.status == 1) {
|
||||
return h("div", [
|
||||
h(
|
||||
"Tag",
|
||||
{
|
||||
props: {
|
||||
color: "green"
|
||||
}
|
||||
},
|
||||
"已读"
|
||||
)
|
||||
]);
|
||||
} else if (params.row.status == 2) {
|
||||
return h("div", [
|
||||
h(
|
||||
"Tag",
|
||||
{
|
||||
props: {
|
||||
color: "orange"
|
||||
}
|
||||
},
|
||||
"回收站"
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "创建时间",
|
||||
key: "createTime",
|
||||
sortable: true,
|
||||
sortType: "desc"
|
||||
},
|
||||
{
|
||||
title: "更新时间",
|
||||
key: "updateTime",
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
align: "center",
|
||||
render: (h, params) => {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "error",
|
||||
size: "small",
|
||||
icon: "md-trash"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.remove(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"删除"
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
],
|
||||
data: [], // 表单数据
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
total: 0, // 表单数据总数
|
||||
userId: ""
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.messageId = this.$route.query.id;
|
||||
this.getDataList();
|
||||
},
|
||||
changePage(v) {
|
||||
this.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
changePageSize(v) {
|
||||
this.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
changeSort(e) {
|
||||
this.sortColumn = e.key;
|
||||
this.sortType = e.order;
|
||||
if (e.order == "normal") {
|
||||
this.sortType = "";
|
||||
}
|
||||
this.getDataList();
|
||||
},
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
getDataList(v) {
|
||||
this.loading = true;
|
||||
if (v == 0) {
|
||||
this.userId = "";
|
||||
}
|
||||
let params = {
|
||||
pageNumber: this.pageNumber,
|
||||
pageSize: this.pageSize,
|
||||
sort: this.sortColumn,
|
||||
order: this.sortType,
|
||||
messageId: this.messageId,
|
||||
status: this.status,
|
||||
userId: this.userId
|
||||
};
|
||||
// 避免后台默认值
|
||||
if (!params.status) {
|
||||
params.status = "";
|
||||
}
|
||||
getMessageSendData(params).then(res => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleReset() {
|
||||
this.userId = "";
|
||||
this.status = "";
|
||||
this.getDataList();
|
||||
},
|
||||
remove(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
// 记得确认修改此处
|
||||
content: "您确认要删除该条数据?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
deleteMessageSend(v.id).then(res => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
clearSelectAll() {
|
||||
this.$refs.table.selectAll(false);
|
||||
},
|
||||
changeSelect(e) {
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
delAll() {
|
||||
if (this.selectCount <= 0) {
|
||||
this.$Message.warning("您还未选择要删除的数据");
|
||||
return;
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
content: "您确认要删除所选的 " + this.selectCount + " 条数据?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
let ids = "";
|
||||
this.selectList.forEach(function(e) {
|
||||
ids += e.id + ",";
|
||||
});
|
||||
ids = ids.substring(0, ids.length - 1);
|
||||
// 批量删除
|
||||
deleteMessageSend(ids).then(res => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.clearSelectAll();
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// 监听路由变化通过id获取数据
|
||||
$route(to, from) {
|
||||
if (to.name == "message_send_detail") {
|
||||
this.messageId = this.$route.query.id;
|
||||
this.getDataList();
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
this.$Modal.info({
|
||||
title: "提示",
|
||||
content: "该页面已根据用户角色隐藏操作按钮"
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -40,7 +40,7 @@
|
|||
<div class="search">
|
||||
<Card>
|
||||
|
||||
<Row class="operation">
|
||||
<Row class="operation mt_10">
|
||||
<Button @click="weChatSync" type="primary">同步微信消息</Button>
|
||||
</Row>
|
||||
<Table
|
||||
|
@ -69,7 +69,7 @@
|
|||
<div class="search">
|
||||
<Card>
|
||||
|
||||
<Row class="operation">
|
||||
<Row class="operation mt_10">
|
||||
<Button @click="weChatSync('mp')" type="primary">同步微信小程序订阅消息</Button>
|
||||
</Row>
|
||||
<Table
|
||||
|
@ -120,7 +120,6 @@ export default {
|
|||
|
||||
wechatModal: false,// modal展示
|
||||
wechatFormData: {}, // 微信数据
|
||||
wechatMPModal: false,//微信消息
|
||||
wechatMPFormData: {}, // 微信订阅消息
|
||||
tab: "WECHAT", // tab栏分类
|
||||
searchForm: { // 请求参数
|
||||
|
@ -128,8 +127,6 @@ export default {
|
|||
},
|
||||
loading: true, // 表单加载状态
|
||||
id: '', // 模板id
|
||||
selectCount: 0, // 多选计数
|
||||
selectList: [], // 多选数据
|
||||
//微信消息查询
|
||||
weChatSearchForm: {
|
||||
// 搜索框对应data对象
|
||||
|
@ -232,6 +229,7 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
|
|
|
@ -1,211 +0,0 @@
|
|||
<style lang="scss" scoped>
|
||||
@import "../message-manage/messageManage.scss";
|
||||
</style>
|
||||
<template>
|
||||
<div>
|
||||
<Card>
|
||||
<p slot="title">
|
||||
<span v-if="type==0">发送新消息</span>
|
||||
<span v-else>编辑消息</span>
|
||||
</p>
|
||||
<Row>
|
||||
<Form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:label-width="90"
|
||||
:rules="formValidate"
|
||||
style="position:relative"
|
||||
>
|
||||
<FormItem label="标题" prop="title">
|
||||
<Input v-model="form.title" style="width:600px" />
|
||||
</FormItem>
|
||||
<FormItem label="内容" prop="content" class="wangEditor">
|
||||
<editor v-model="form.content"></editor>
|
||||
</FormItem>
|
||||
<div v-if="type==0">
|
||||
<FormItem label="发送范围">
|
||||
<RadioGroup type="button" button-style="solid" v-model="form.sendType" >
|
||||
<Radio label="ALL">全部会员</Radio>
|
||||
<Radio label="SELECT">指定会员</Radio>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
<div>
|
||||
<FormItem label="选择用户" v-if="form.sendType==='SELECT'">
|
||||
<member-choose text="选择发送用户" @on-change="handleSelectUser"></member-choose>
|
||||
</FormItem>
|
||||
</div>
|
||||
</div>
|
||||
<Form-item class="br">
|
||||
<Button
|
||||
type="primary"
|
||||
:loading="submitLoading"
|
||||
@click="handleSubmit"
|
||||
style="width:100px"
|
||||
>提交</Button>
|
||||
<Button @click="handelCancel">取消</Button>
|
||||
</Form-item>
|
||||
<Spin size="large" fix v-if="loading"></Spin>
|
||||
</Form>
|
||||
</Row>
|
||||
</Card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import editor from "@/views/my-components/lili/editor";
|
||||
import memberChoose from "@/views/my-components/lili/member-choose";
|
||||
export default {
|
||||
name: "add_message",
|
||||
components: {
|
||||
memberChoose,
|
||||
editor
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type: 0, // 0 发送新消息 1 编辑消息
|
||||
loading: false, // 表单加载状态
|
||||
selectUsers: [], // 选择用户
|
||||
modalTitle: "", // 添加或编辑标题
|
||||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
title: "",
|
||||
content: "",
|
||||
sendType: "ALL",
|
||||
memberIds: ""
|
||||
},
|
||||
formValidate: {
|
||||
// 表单验证规则
|
||||
title: [{ required: true, message: "标题不能为空", trigger: "blur" }],
|
||||
content: [{ required: true, message: "内容不能为空", trigger: "blur" }]
|
||||
},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
backRoute: "" // back路由路径
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.type = this.$route.query.type;
|
||||
this.backRoute = this.$route.query.backRoute;
|
||||
if (this.type == 1) {
|
||||
this.form.id = this.$route.query.id;
|
||||
this.getData();
|
||||
}
|
||||
},
|
||||
getData() {
|
||||
this.loading = true;
|
||||
getMessageDataById(this.form.id).then(res => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
// 转换null为""
|
||||
let v = res.result;
|
||||
for (let attr in v) {
|
||||
if (v[attr] == null) {
|
||||
v[attr] = "";
|
||||
}
|
||||
}
|
||||
let str = JSON.stringify(v);
|
||||
let data = JSON.parse(str);
|
||||
this.form = data;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSubmit() {
|
||||
this.$refs.form.validate(valid => {
|
||||
|
||||
let ids = [];
|
||||
this.selectUsers.forEach(e => {
|
||||
ids += e.id + ",";
|
||||
});
|
||||
if (ids.length > 0) {
|
||||
ids = ids.substring(0, ids.length - 1);
|
||||
}
|
||||
this.form.memberIds = ids;
|
||||
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
if (this.modalType === 0) {
|
||||
// 添加 避免编辑后传入id等数据 记得删除
|
||||
this.postRequest("/memberNoticeSenter/insertOrUpdate", this.form).then(res => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.modalVisible = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 编辑
|
||||
this.postRequest("/memberNoticeSenter/insertOrUpdate", this.form).then(res => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.modalVisible = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
handelSubmit() {
|
||||
console.log()
|
||||
this.$refs.form.validate(valid => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
if (this.type == 0) {
|
||||
// 添加 避免编辑后传入id等数据 记得删除
|
||||
delete this.form.id;
|
||||
// 用户id数据
|
||||
|
||||
addMessage(this.form).then(res => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.closeCurrentPage();
|
||||
}
|
||||
});
|
||||
} else if (this.type == 1) {
|
||||
// 编辑
|
||||
editMessage(this.form).then(res => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.closeCurrentPage();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSelectUser(v) {
|
||||
this.selectUsers = v;
|
||||
},
|
||||
handelCancel() {
|
||||
this.closeCurrentPage();
|
||||
},
|
||||
// 关闭当前页面
|
||||
closeCurrentPage() {
|
||||
this.$store.commit("removeTag", "add_message");
|
||||
localStorage.pageOpenedList = JSON.stringify(
|
||||
this.$store.state.app.pageOpenedList
|
||||
);
|
||||
this.$router.push({
|
||||
name: this.backRoute
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
watch: {
|
||||
// 监听路由变化
|
||||
$route(to, from) {
|
||||
if (to.name == "member-notice-sender") {
|
||||
this.type = this.$route.query.type;
|
||||
if (this.type == 1) {
|
||||
this.form.id = this.$route.query.id;
|
||||
this.getData();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -1,370 +0,0 @@
|
|||
<template>
|
||||
<div class="search">
|
||||
<Card>
|
||||
<Row @keydown.enter.native="handleSearch">
|
||||
<Form
|
||||
ref="searchForm"
|
||||
:model="searchForm"
|
||||
inline
|
||||
:label-width="70"
|
||||
class="search-form"
|
||||
>
|
||||
<Form-item label="标题" prop="title">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.title"
|
||||
placeholder="请输入标题"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
</Form-item>
|
||||
<Form-item label="消息内容" prop="content">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.content"
|
||||
placeholder="请输入消息内容"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
</Form-item>
|
||||
<span v-if="drop">
|
||||
<Form-item label="发送类型" prop="sendType">
|
||||
<Select
|
||||
v-model="searchForm.sendType"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
>
|
||||
<Option value="ALL">全站会员</Option>
|
||||
<Option value="SELECT">指定会员</Option>
|
||||
</Select>
|
||||
</Form-item>
|
||||
<Form-item label="创建人" prop="createBy">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.createBy"
|
||||
placeholder="请输入创建人"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
</Form-item>
|
||||
</span>
|
||||
<Form-item 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>
|
||||
</Form-item>
|
||||
</Form>
|
||||
</Row>
|
||||
<Row class="operation">
|
||||
<Button @click="add" type="primary" icon="md-add">发送新消息</Button>
|
||||
<Button @click="delAll" icon="md-trash">批量删除</Button>
|
||||
<Button @click="getDataList" icon="md-refresh">刷新</Button>
|
||||
</Row>
|
||||
<Row v-show="openTip">
|
||||
<Alert show-icon>
|
||||
已选择 <span class="select-count">{{ selectCount }}</span> 项
|
||||
<a class="select-clear" @click="clearSelectAll">清空</a>
|
||||
</Alert>
|
||||
</Row>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<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>
|
||||
</Card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "member-notice-sender",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
openSearch: true, // 显示搜索
|
||||
openTip: true, // 显示提示
|
||||
loading: true, // 表单加载状态
|
||||
modalType: 0, // 添加或编辑标识
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
modalTitle: "", // 添加或编辑标题
|
||||
drop: false, // 更多搜索项
|
||||
dropDownContent: "展开", // drop中文提示
|
||||
dropDownIcon: "ios-arrow-down", // drop图标
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [
|
||||
// 表头
|
||||
{
|
||||
type: "selection",
|
||||
width: 60,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
type: "index",
|
||||
width: 60,
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "标题",
|
||||
key: "title",
|
||||
minWidth: 120,
|
||||
sortable: false,
|
||||
},
|
||||
{
|
||||
title: "发送类型",
|
||||
key: "sendType",
|
||||
minWidth: 120,
|
||||
sortable: false,
|
||||
|
||||
render: (h, params) => {
|
||||
if (params.row.sendType == "ALL") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "全部会员",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
} else {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "指定会员",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "创建人",
|
||||
key: "createBy",
|
||||
minWidth: 120,
|
||||
sortable: false,
|
||||
},
|
||||
{
|
||||
title: "创建时间",
|
||||
key: "createTime",
|
||||
minWidth: 120,
|
||||
sortable: true,
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
align: "center",
|
||||
width: 200,
|
||||
render: (h, params) => {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "error",
|
||||
size: "small",
|
||||
icon: "md-trash",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.remove(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"删除"
|
||||
),
|
||||
]);
|
||||
},
|
||||
},
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.getDataList();
|
||||
},
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
this.clearSelectAll();
|
||||
},
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
handleReset() {
|
||||
this.$refs.searchForm.resetFields();
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
// 重新加载数据
|
||||
this.getDataList();
|
||||
},
|
||||
changeSort(e) {
|
||||
this.searchForm.sort = e.key;
|
||||
this.searchForm.order = e.order;
|
||||
if (e.order === "normal") {
|
||||
this.searchForm.order = "";
|
||||
}
|
||||
this.getDataList();
|
||||
},
|
||||
clearSelectAll() {
|
||||
this.$refs.table.selectAll(false);
|
||||
},
|
||||
changeSelect(e) {
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
dropDown() {
|
||||
if (this.drop) {
|
||||
this.dropDownContent = "展开";
|
||||
this.dropDownIcon = "ios-arrow-down";
|
||||
} else {
|
||||
this.dropDownContent = "收起";
|
||||
this.dropDownIcon = "ios-arrow-up";
|
||||
}
|
||||
this.drop = !this.drop;
|
||||
},
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||
this.getRequest("/memberNoticeSenter/getByPage", this.searchForm).then(
|
||||
(res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
}
|
||||
);
|
||||
// 以下为模拟数据
|
||||
//this.data = [
|
||||
//];
|
||||
this.total = this.data.length;
|
||||
this.loading = false;
|
||||
},
|
||||
add() {
|
||||
let query = { type: 0, backRoute: this.$route.name };
|
||||
this.$router.push({
|
||||
name: "add_message",
|
||||
query: query,
|
||||
});
|
||||
},
|
||||
edit(v) {
|
||||
this.modalType = 1;
|
||||
this.modalTitle = "编辑";
|
||||
this.$refs.form.resetFields();
|
||||
// 转换null为""
|
||||
for (let attr in v) {
|
||||
if (v[attr] === null) {
|
||||
v[attr] = "";
|
||||
}
|
||||
}
|
||||
let str = JSON.stringify(v);
|
||||
let data = JSON.parse(str);
|
||||
this.form = data;
|
||||
this.modalVisible = true;
|
||||
},
|
||||
remove(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
// 记得确认修改此处
|
||||
content: "您确认要删除么?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 删除
|
||||
this.deleteRequest("/memberNoticeSenter/delByIds/" + v.id).then(
|
||||
(res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.getDataList();
|
||||
}
|
||||
}
|
||||
);
|
||||
// 模拟请求成功
|
||||
//this.$Message.success("操作成功");
|
||||
//this.$Modal.remove();
|
||||
//this.getDataList();
|
||||
},
|
||||
});
|
||||
},
|
||||
delAll() {
|
||||
if (this.selectCount <= 0) {
|
||||
this.$Message.warning("您还未选择要删除的数据");
|
||||
return;
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
content: "您确认要删除所选的 " + this.selectCount + " 条数据?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
let ids = "";
|
||||
this.selectList.forEach(function (e) {
|
||||
ids += e.id + ",";
|
||||
});
|
||||
ids = ids.substring(0, ids.length - 1);
|
||||
// 批量删除
|
||||
this.deleteRequest("/memberNoticeSenter/delByIds/" + ids).then(
|
||||
(res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.clearSelectAll();
|
||||
this.getDataList();
|
||||
}
|
||||
}
|
||||
);
|
||||
// 模拟请求成功
|
||||
//this.$Message.success("操作成功");
|
||||
//this.$Modal.remove();
|
||||
//this.clearSelectAll();
|
||||
//this.getDataList();
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
};
|
||||
</script>
|
|
@ -1,12 +1,12 @@
|
|||
<template>
|
||||
<div class="search">
|
||||
<Row>
|
||||
<Card>
|
||||
<Row @keydown.enter.native="handleSearch">
|
||||
<Card style="padding:0 10px 10px 0">
|
||||
<Form
|
||||
@keydown.enter.native="handleSearch"
|
||||
ref="searchForm"
|
||||
:model="searchForm"
|
||||
inline
|
||||
style="margin-top:10px"
|
||||
:label-width="70"
|
||||
class="search-form"
|
||||
>
|
||||
|
@ -21,16 +21,13 @@
|
|||
</Form-item>
|
||||
<Button @click="handleSearch" class="search-btn" type="primary" icon="ios-search">搜索</Button >
|
||||
</Form>
|
||||
</Row>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
class="mt_10"
|
||||
>
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
|
@ -48,8 +45,6 @@
|
|||
></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
</Row>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -57,9 +52,9 @@
|
|||
import region from "@/views/lili-components/region";
|
||||
import * as API_Member from "@/api/member.js";
|
||||
import ossManage from "@/views/sys/oss-manage/ossManage";
|
||||
import * as RegExp from '@/libs/RegExp.js';
|
||||
|
||||
export default {
|
||||
// 积分历史页面
|
||||
name: "point",
|
||||
components: {
|
||||
region,
|
||||
|
@ -67,14 +62,11 @@
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
descFlag: false, //编辑查看框
|
||||
loading: true, // 表单加载状态
|
||||
searchForm: { // 请求参数
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
selectList: [], // 多选数据
|
||||
selectCount: 0, // 多选计数
|
||||
columns: [
|
||||
{
|
||||
title: "会员名称",
|
||||
|
@ -141,41 +133,27 @@
|
|||
callback(val) {
|
||||
this.$emit("callback", val);
|
||||
},
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.getData();
|
||||
},
|
||||
// 分页 改变页码
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getData();
|
||||
},
|
||||
// 分页 改变页数
|
||||
changePageSize(v) {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = v;
|
||||
this.getData();
|
||||
},
|
||||
// 搜索
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getData();
|
||||
},
|
||||
|
||||
changeSort(e) {
|
||||
this.searchForm.sort = e.key;
|
||||
this.searchForm.order = e.order;
|
||||
if (e.order === "normal") {
|
||||
this.searchForm.order = "";
|
||||
}
|
||||
this.getData();
|
||||
},
|
||||
changeSelect(e) {
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
},
|
||||
selectDateRange(v) {
|
||||
if (v) {
|
||||
this.searchForm.startDate = v[0];
|
||||
this.searchForm.endDate = v[1];
|
||||
}
|
||||
},
|
||||
//查新积分列表
|
||||
getData() {
|
||||
this.loading = true;
|
||||
|
|
|
@ -1,161 +0,0 @@
|
|||
.message {
|
||||
&-main-con {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
}
|
||||
&-mainlist-con {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 10px;
|
||||
width: 300px;
|
||||
bottom: 0;
|
||||
padding: 10px 0;
|
||||
div {
|
||||
padding: 10px;
|
||||
margin: 0 20px;
|
||||
border-bottom: 1px dashed #d2d3d2;
|
||||
&:last-child {
|
||||
border: none;
|
||||
}
|
||||
.mes-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.message-count-badge-outer {
|
||||
margin-left: 5px;
|
||||
}
|
||||
.message-count-badge {
|
||||
background: #d2d3d2;
|
||||
}
|
||||
.message-count-badge-red {
|
||||
background: #ed3f14;
|
||||
}
|
||||
.mes-type-btn-text {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
&-content-con {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
bottom: 10px;
|
||||
left: 300px;
|
||||
background: white;
|
||||
border-radius: 3px;
|
||||
box-shadow: 2px 2px 10px 2px rgba(0, 0, 0, .1);
|
||||
overflow: auto;
|
||||
.message-title-list-con {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.message-content-top-bar {
|
||||
height: 40px;
|
||||
width: 100%;
|
||||
background: white;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
border-bottom: 1px solid #dededb;
|
||||
.mes-back-btn-con {
|
||||
position: absolute;
|
||||
width: 70px;
|
||||
height: 30px;
|
||||
left: 0;
|
||||
top: 5px;
|
||||
}
|
||||
.mes-title {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 70px;
|
||||
bottom: 0;
|
||||
left: 70px;
|
||||
line-height: 40px;
|
||||
padding: 0 30px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
.mes-time-con {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
top: 40px;
|
||||
left: 0;
|
||||
padding: 20px 0;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
color: #b7b7b5;
|
||||
}
|
||||
.message-content-body {
|
||||
position: absolute;
|
||||
top: 90px;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow: auto;
|
||||
.message-content {
|
||||
padding: 10px 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.page-fix {
|
||||
position: fixed;
|
||||
right: 2vw;
|
||||
bottom: 3vh;
|
||||
}
|
||||
|
||||
.back-message-list-enter,
|
||||
.back-message-list-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.back-message-list-enter-active,
|
||||
.back-message-list-leave-active {
|
||||
transition: all .5s;
|
||||
}
|
||||
|
||||
.back-message-list-enter-to,
|
||||
.back-message-list-leave {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.view-message-enter,
|
||||
.view-message-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.view-message-enter-active,
|
||||
.view-message-leave-active {
|
||||
transition: all .5s;
|
||||
}
|
||||
|
||||
.view-message-enter-to,
|
||||
.view-message-leave {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.mes-current-type-btn-enter,
|
||||
.mes-current-type-btn-leave-to {
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.mes-current-type-btn-enter-active,
|
||||
.mes-current-type-btn-leave-active {
|
||||
transition: all .3s;
|
||||
}
|
||||
|
||||
.mes-current-type-btn-enter-to,
|
||||
.mes-current-type-btn-leave {
|
||||
opacity: 1;
|
||||
width: 12px;
|
||||
}
|
||||
|
|
@ -1,464 +0,0 @@
|
|||
<style lang="scss" scoped>
|
||||
@import "./message.scss";
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div class="message-main-con">
|
||||
<div class="message-mainlist-con">
|
||||
<div>
|
||||
<Button @click="setCurrentMesType('unread')" size="large" long type="text">
|
||||
<div class="mes-wrap">
|
||||
<transition name="mes-current-type-btn">
|
||||
<Icon v-show="currentMessageType == 'unread'" type="md-checkmark"></Icon>
|
||||
</transition>
|
||||
<span class="mes-type-btn-text">未读消息</span>
|
||||
<Badge
|
||||
class="message-count-badge-outer"
|
||||
class-name="message-count-badge-red"
|
||||
:count="unreadCount"
|
||||
></Badge>
|
||||
</div>
|
||||
</Button>
|
||||
</div>
|
||||
<div>
|
||||
<Button @click="setCurrentMesType('hasread')" size="large" long type="text">
|
||||
<div class="mes-wrap">
|
||||
<transition name="mes-current-type-btn">
|
||||
<Icon v-show="currentMessageType == 'hasread'" type="md-checkmark"></Icon>
|
||||
</transition>
|
||||
<span class="mes-type-btn-text">已读消息</span>
|
||||
<Badge
|
||||
class="message-count-badge-outer"
|
||||
class-name="message-count-badge"
|
||||
:count="hasreadCount"
|
||||
></Badge>
|
||||
</div>
|
||||
</Button>
|
||||
</div>
|
||||
<div>
|
||||
<Button @click="setCurrentMesType('recyclebin')" size="large" long type="text">
|
||||
<div class="mes-wrap">
|
||||
<transition name="mes-current-type-btn">
|
||||
<Icon v-show="currentMessageType == 'recyclebin'" type="md-checkmark"></Icon>
|
||||
</transition>
|
||||
<span class="mes-type-btn-text">回收站</span>
|
||||
<Badge
|
||||
class="message-count-badge-outer"
|
||||
class-name="message-count-badge"
|
||||
:count="recyclebinCount"
|
||||
></Badge>
|
||||
</div>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="message-content-con">
|
||||
<transition name="view-message">
|
||||
<div v-if="showMesTitleList" class="message-title-list-con">
|
||||
<Table
|
||||
ref="messageList"
|
||||
:loading="loading"
|
||||
:columns="mesTitleColumns"
|
||||
:data="currentMesList"
|
||||
:no-data-text="noDataText"
|
||||
></Table>
|
||||
<Page
|
||||
:current="params.pageNumber"
|
||||
:total="total"
|
||||
:page-size="params.pageSize"
|
||||
@on-change="changePage"
|
||||
@on-page-size-change="changePageSize"
|
||||
:page-size-opts="[5,10]"
|
||||
size="small"
|
||||
show-total
|
||||
show-elevator
|
||||
show-sizer
|
||||
class="page-fix"
|
||||
></Page>
|
||||
</div>
|
||||
</transition>
|
||||
<transition name="back-message-list">
|
||||
<div v-if="!showMesTitleList" class="message-view-content-con">
|
||||
<div class="message-content-top-bar">
|
||||
<span class="mes-back-btn-con">
|
||||
<Button type="text" @click="backMesTitleList">
|
||||
<Icon type="ios-arrow-back"></Icon> 返回
|
||||
</Button>
|
||||
</span>
|
||||
<h3 class="mes-title">{{ mes.title }}</h3>
|
||||
</div>
|
||||
<p class="mes-time-con">
|
||||
<Icon type="android-time"></Icon>
|
||||
{{ mes.time }}
|
||||
</p>
|
||||
<div class="message-content-body">
|
||||
<p class="message-content" v-html="mes.content">{{ mes.content }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Cookies from "js-cookie";
|
||||
import {
|
||||
getMessageSendData,
|
||||
editMessageSend,
|
||||
deleteMessageSend
|
||||
} from "@/api/index";
|
||||
export default {
|
||||
name: "message_index",
|
||||
data() {
|
||||
const markAsreadBtn = (h, params) => {
|
||||
return h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
icon: "md-eye-off",
|
||||
size: "small"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
// 标记已读
|
||||
let v = params.row;
|
||||
// 转换null为""
|
||||
for (let attr in v) {
|
||||
if (v[attr] == null) {
|
||||
v[attr] = "";
|
||||
}
|
||||
}
|
||||
let str = JSON.stringify(v);
|
||||
let data = JSON.parse(str);
|
||||
data.status = 1;
|
||||
this.loading = true;
|
||||
editMessageSend(data).then(res => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.unreadCount -= 1;
|
||||
this.hasreadCount += 1;
|
||||
this.$store.commit("setMessageCount", this.unreadCount);
|
||||
this.refreshMessage();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
"标为已读"
|
||||
);
|
||||
};
|
||||
const deleteMesBtn = (h, params) => {
|
||||
return h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
icon: "md-trash",
|
||||
size: "small",
|
||||
type: "error"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
// 移除
|
||||
let v = params.row;
|
||||
// 转换null为""
|
||||
for (let attr in v) {
|
||||
if (v[attr] == null) {
|
||||
v[attr] = "";
|
||||
}
|
||||
}
|
||||
let str = JSON.stringify(v);
|
||||
let data = JSON.parse(str);
|
||||
data.status = 2;
|
||||
this.loading = true;
|
||||
editMessageSend(data).then(res => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.hasreadCount -= 1;
|
||||
this.recyclebinCount += 1;
|
||||
this.refreshMessage();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
"删除"
|
||||
);
|
||||
};
|
||||
const restoreBtn = (h, params) => {
|
||||
return h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
icon: "md-redo",
|
||||
size: "small"
|
||||
},
|
||||
style: {
|
||||
margin: "0 5px 0 0"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
// 还原
|
||||
let v = params.row;
|
||||
// 转换null为""
|
||||
for (let attr in v) {
|
||||
if (v[attr] == null) {
|
||||
v[attr] = "";
|
||||
}
|
||||
}
|
||||
let str = JSON.stringify(v);
|
||||
let data = JSON.parse(str);
|
||||
data.status = 1;
|
||||
this.loading = true;
|
||||
editMessageSend(data).then(res => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.recyclebinCount -= 1;
|
||||
this.hasreadCount += 1;
|
||||
this.refreshMessage();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
"还原"
|
||||
);
|
||||
};
|
||||
const deleteRealBtn = (h, params) => {
|
||||
return h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
icon: "md-trash",
|
||||
size: "small",
|
||||
type: "error"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
// 彻底删除
|
||||
let v = params.row;
|
||||
this.loading = true;
|
||||
deleteMessageSend(v.id).then(res => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.recyclebinCount -= 1;
|
||||
this.refreshMessage();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
"彻底删除"
|
||||
);
|
||||
};
|
||||
return {
|
||||
loading: true, // 加载状态
|
||||
params: { // 请求参数
|
||||
userId: JSON.parse(Cookies.get("userInfo")).id,
|
||||
status: 0,
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc" // 默认排序方式
|
||||
},
|
||||
total: 0, // 消息总数
|
||||
totalUnread: 0, // 所有未读消息数
|
||||
totalRead: 0, // 所有已读消息数
|
||||
totalRemove: 0, // 所有回收站消息数
|
||||
currentMesList: [], // 当前消息列表
|
||||
unreadMesList: [], // 未读消息列表
|
||||
hasreadMesList: [], // 已读消息列表
|
||||
recyclebinList: [], // 回收站消息
|
||||
currentMessageType: "unread", // 展示消息类型
|
||||
showMesTitleList: true, // 展示消息列表
|
||||
unreadCount: 0, // 未读数
|
||||
hasreadCount: 0, // 已读数
|
||||
recyclebinCount: 0, // 回收站消息数量
|
||||
noDataText: "暂无未读消息", // 无消息提示
|
||||
mes: { // 信息表单
|
||||
title: "",
|
||||
time: "",
|
||||
content: ""
|
||||
},
|
||||
mesTitleColumns: [
|
||||
{
|
||||
type: "index",
|
||||
width: 50,
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: " ",
|
||||
key: "title",
|
||||
align: "left",
|
||||
ellipsis: true,
|
||||
render: (h, params) => {
|
||||
return h("span", [
|
||||
h(
|
||||
"a",
|
||||
{
|
||||
style: {
|
||||
margin: "0 30px 0 0"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.showMesTitleList = false;
|
||||
this.mes.title = params.row.title;
|
||||
this.mes.time = params.row.createTime;
|
||||
this.getContent(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"【" + params.row.type + "】 " + params.row.title
|
||||
)
|
||||
]);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: " ",
|
||||
key: "time",
|
||||
align: "center",
|
||||
width: 190,
|
||||
render: (h, params) => {
|
||||
return h("span", [
|
||||
h("Icon", {
|
||||
props: {
|
||||
type: "md-time",
|
||||
size: 16
|
||||
},
|
||||
style: {
|
||||
margin: "0 5px 3px 0"
|
||||
}
|
||||
}),
|
||||
h("span", params.row.createTime)
|
||||
]);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: " ",
|
||||
key: "asread",
|
||||
align: "center",
|
||||
width: 210,
|
||||
render: (h, params) => {
|
||||
if (this.currentMessageType == "unread") {
|
||||
return h("div", [markAsreadBtn(h, params)]);
|
||||
} else if (this.currentMessageType == "hasread") {
|
||||
return h("div", [deleteMesBtn(h, params)]);
|
||||
} else {
|
||||
return h("div", [
|
||||
restoreBtn(h, params),
|
||||
deleteRealBtn(h, params)
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
changePage(v) {
|
||||
this.params.pageNumber = v;
|
||||
this.refreshMessage();
|
||||
},
|
||||
changePageSize(v) {
|
||||
this.params.pageSize = v;
|
||||
this.refreshMessage();
|
||||
},
|
||||
refreshMessage() {
|
||||
let status = 0;
|
||||
let type = this.currentMessageType;
|
||||
if (type == "unread") {
|
||||
status = 0;
|
||||
} else if (type == "hasread") {
|
||||
status = 1;
|
||||
} else {
|
||||
status = 2;
|
||||
}
|
||||
this.params.status = status;
|
||||
this.loading = true;
|
||||
getMessageSendData(this.params).then(res => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.currentMesList = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
initMessage() {
|
||||
this.params.status = 0;
|
||||
getMessageSendData(this.params).then(res => {
|
||||
if (res.success) {
|
||||
this.unreadCount = res.result.total;
|
||||
this.initReadMessage();
|
||||
}
|
||||
});
|
||||
},
|
||||
initReadMessage() {
|
||||
this.params.status = 1;
|
||||
getMessageSendData(this.params).then(res => {
|
||||
if (res.success) {
|
||||
this.hasreadCount = res.result.total;
|
||||
this.initRemoveMessage();
|
||||
}
|
||||
});
|
||||
},
|
||||
initRemoveMessage() {
|
||||
this.params.status = 2;
|
||||
getMessageSendData(this.params).then(res => {
|
||||
if (res.success) {
|
||||
this.recyclebinCount = res.result.total;
|
||||
this.setCurrentMesType("unread");
|
||||
}
|
||||
});
|
||||
},
|
||||
editMessage(status) {
|
||||
editMessageSend().then(res => {
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteMessage(id) {
|
||||
deleteMessageSend(id).then(res => {
|
||||
if (res.success) {
|
||||
this.$Message.success("删除成功");
|
||||
}
|
||||
});
|
||||
},
|
||||
backMesTitleList() {
|
||||
this.showMesTitleList = true;
|
||||
},
|
||||
setCurrentMesType(type) {
|
||||
if (this.currentMessageType !== type) {
|
||||
this.showMesTitleList = true;
|
||||
}
|
||||
this.currentMessageType = type;
|
||||
if (type == "unread") {
|
||||
this.noDataText = "暂无未读消息";
|
||||
} else if (type == "hasread") {
|
||||
this.noDataText = "暂无已读消息";
|
||||
} else {
|
||||
this.noDataText = "回收站无消息";
|
||||
}
|
||||
this.params.pageNumber = 1;
|
||||
this.refreshMessage();
|
||||
},
|
||||
getContent(v) {
|
||||
this.mes.content = v.content;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initMessage();
|
||||
},
|
||||
watch: {
|
||||
// 监听路由变化通过id获取数据
|
||||
$route(to, from) {
|
||||
if (to.name == "message_index") {
|
||||
this.initMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -1,633 +0,0 @@
|
|||
<template>
|
||||
<Collapse v-model="open_panel">
|
||||
<Panel name="1">
|
||||
规格名称
|
||||
<div slot="content" class="sku-item-content">
|
||||
<Form :model="skuForm" @submit.native.prevent style="width:100%;">
|
||||
<div v-for="(item, $index) in skuInfo" :key="$index" class="sku_value">
|
||||
<Card :bordered="true" style="margin: 15px 0;">
|
||||
<FormItem label="规格名:" class="sku-item-content-name">
|
||||
<AutoComplete
|
||||
style="width: 150px;"
|
||||
v-model="item.name"
|
||||
:maxlength="30"
|
||||
:data="skuKey"
|
||||
placeholder="请输入规格项名称"
|
||||
:filter-method="filterMethod"
|
||||
@on-change="skuItemChange(item.name,$index)"
|
||||
@keyup.enter.native="editSkuItem(item, $index)"
|
||||
>
|
||||
<!-- @on-focus="getActiveSkuItem(index, $index ,item, val)"
|
||||
@on-blur="editSkuItem(item, $index)"
|
||||
on-change 变更
|
||||
on-focus 聚焦时触发 event
|
||||
on-blur 失焦时触发
|
||||
keyup.enter.native 回车时 -->
|
||||
</AutoComplete>
|
||||
<Button
|
||||
type="error"
|
||||
style="margin-left: 10px;"
|
||||
@click="handleCloseSkuItem($index)"
|
||||
>删除</Button>
|
||||
<Checkbox
|
||||
v-if="$index === 0"
|
||||
style="padding: 0px 0px 0px 30px;"
|
||||
v-model="checkedImage"
|
||||
@on-change="handleChangeImage"
|
||||
>规格图片</Checkbox>
|
||||
</FormItem>
|
||||
|
||||
<FormItem label="规格值:" class="sku-item-content-value">
|
||||
<!--规格值文本列表-->
|
||||
<div
|
||||
v-for="(val, index) in item.spec_values"
|
||||
:key="index"
|
||||
style="padding: 0px 20px 10px 0px;float: left"
|
||||
>
|
||||
<div style="display:inline-block;">
|
||||
<AutoComplete
|
||||
style="width: 150px; float: left"
|
||||
v-model="val.value"
|
||||
:maxlength="30"
|
||||
:data="skuValue"
|
||||
placeholder="请输入规格值名称"
|
||||
:filter-method="filterMethod"
|
||||
@on-change="skuValueChange(val.value,$index)"
|
||||
@on-focus="editSkuIValue($index)"
|
||||
@keyup.enter.native="editSkuIValue(item, val, $index, index)"
|
||||
></AutoComplete>
|
||||
<Button
|
||||
type="error"
|
||||
style="float: left;margin-left: 10px"
|
||||
@click="handleCloseSkuValue($index, index)"
|
||||
>删除</Button>
|
||||
</div>
|
||||
<div>
|
||||
<upload-pic-thumb
|
||||
style="text-align: left;"
|
||||
v-show="$index === 0 && checkedImage"
|
||||
v-model="val.spec_image" v-on:change="thumbChange" :multiple="false" v-on:uploadchange="uploadchange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div style="float: left">
|
||||
<Button type="primary" @click="addSpec($index, item)">添加规格值</Button>
|
||||
</div>
|
||||
</FormItem>
|
||||
</Card>
|
||||
</div>
|
||||
</Form>
|
||||
<Button type="primary" size="mini" @click="addSkuItem">添加规格项目</Button>
|
||||
</div>
|
||||
</Panel>
|
||||
<Panel name="2">
|
||||
规格详细
|
||||
<div slot="content">
|
||||
<div slot="content">
|
||||
<Table
|
||||
:columns="skuTableColumn"
|
||||
:data="skuTableData"
|
||||
style="width: 100%;.ivu-table-overflowX{ overflow-x: hidden;}"
|
||||
:span-method="handleSpan"
|
||||
>
|
||||
<template slot-scope="{ row }" slot="sn">
|
||||
<Input
|
||||
v-model="row.sn"
|
||||
placeholder="请输入货号"
|
||||
@on-change="updateSkuTable(row,'sn')"
|
||||
@on-focus="updateSkuTable(row,'sn')"
|
||||
@on-blur="updateSkuTable(row,'sn')"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template slot-scope="{ row }" slot="weight">
|
||||
<Input
|
||||
v-model="row.weight"
|
||||
placeholder="请输入重量"
|
||||
@on-change="updateSkuTable(row,'weight')"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template slot-scope="{ row }" slot="quantity">
|
||||
<Input
|
||||
v-model="row.quantity"
|
||||
placeholder="请输入库存"
|
||||
@on-change="updateSkuTable(row,'quantity')"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template slot-scope="{ row }" slot="cost">
|
||||
<Input
|
||||
v-model="row.cost"
|
||||
placeholder="请输入成本价"
|
||||
@on-change="updateSkuTable(row,'cost')"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template slot-scope="{ row }" slot="price">
|
||||
<Input
|
||||
v-model="row.price"
|
||||
placeholder="请输入成本价"
|
||||
@on-change="updateSkuTable(row,'price')"
|
||||
/>
|
||||
</template>
|
||||
</Table>
|
||||
</div>
|
||||
</div>
|
||||
</Panel>
|
||||
</Collapse>
|
||||
</template>
|
||||
<script>
|
||||
import { regular } from "@/utils";
|
||||
import uploadPicThumb from "../lili/upload-pic-thumb.vue";
|
||||
import cloneObj from "@/utils/index";
|
||||
export default {
|
||||
name: "goodsSku",
|
||||
components: {
|
||||
uploadPicThumb
|
||||
},
|
||||
props: {
|
||||
open_panel: {
|
||||
type: [String, Number],
|
||||
default: false
|
||||
},
|
||||
/** 是否自动生成货号 */
|
||||
productSn: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
/** 当前商品编号 */
|
||||
goodsSn: {
|
||||
type: [String, Number],
|
||||
default: ['', 0]
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
/** 请求数据*/
|
||||
skuData: [],
|
||||
|
||||
/** 当前可选择的 规格名称*/
|
||||
skuKey: [],
|
||||
|
||||
/** 当前可选择的 规格值*/
|
||||
skuValue: [],
|
||||
|
||||
/** 表单数据*/
|
||||
skuForm: {},
|
||||
/** 表格头 */
|
||||
skuTableColumn: [],
|
||||
/** 表格数据 */
|
||||
skuTableData: [
|
||||
{
|
||||
sn: '',
|
||||
weight: '',
|
||||
quantity: '',
|
||||
cost: '',
|
||||
price: ''
|
||||
}
|
||||
],
|
||||
/** 要提交的规格数据*/
|
||||
skuInfo: [],
|
||||
|
||||
/** 当前规格项下的规格值列表*/
|
||||
specList: [],
|
||||
|
||||
/** 当前规格项索引 */
|
||||
activeSkuItemIndex: 0,
|
||||
|
||||
/** 当前规格项 */
|
||||
activeSkuItem: {},
|
||||
|
||||
/** 规格图片 */
|
||||
images: [],
|
||||
/** 当前规格值索引 */
|
||||
activeSkuValIndex: 0,
|
||||
|
||||
/** 当前规格值 */
|
||||
activeSkuVal: {},
|
||||
/** 存储未通过校验的单元格位置 */
|
||||
validateError: [],
|
||||
//规格照片
|
||||
checkedImage:false
|
||||
};
|
||||
},
|
||||
mounted(){
|
||||
|
||||
},
|
||||
watch: {
|
||||
/** 自动生成货号 */
|
||||
productSn() {
|
||||
if (this.productSn && this.skuTableData.length > 0) {
|
||||
let count = 1
|
||||
this.skuTableData.forEach(key => {
|
||||
key.sn = this.goodsSn + '-00000' + count
|
||||
count++
|
||||
})
|
||||
/** 异步更新skuTableData数据 */
|
||||
this.$emit("getTableData", this.skuTableData);
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
uploadchange(url){
|
||||
/**
|
||||
* 渲染规格详细表格
|
||||
*/
|
||||
this.renderTableData();
|
||||
},
|
||||
/** 添加规格项 */
|
||||
addSkuItem() {
|
||||
// 写入对象,下标,具体对象
|
||||
this.$set(this.skuInfo, this.skuInfo.length, {
|
||||
spec_values: []
|
||||
});
|
||||
/**
|
||||
* 渲染规格详细表格
|
||||
*/
|
||||
this.renderTableData();
|
||||
},
|
||||
|
||||
/** 移除当前规格项 进行数据变化*/
|
||||
handleCloseSkuItem($index) {
|
||||
this.skuInfo.splice($index, 1);
|
||||
/**
|
||||
* 渲染规格详细表格
|
||||
*/
|
||||
this.renderTableData();
|
||||
},
|
||||
|
||||
/** 规格变更 */
|
||||
skuItemChange(value, $index) {
|
||||
this.activeSkuItemIndex = $index;
|
||||
//判定是否存在这个规格分组
|
||||
let item = this.findSpec(value);
|
||||
/** 更新skuInfo数据 */
|
||||
this.$set(this.skuInfo[this.activeSkuItemIndex], "name", item.name);
|
||||
this.$set(this.skuInfo[this.activeSkuItemIndex], "spec_values", []);
|
||||
/**
|
||||
* 渲染规格详细表格
|
||||
*/
|
||||
this.renderTableData();
|
||||
},
|
||||
/**
|
||||
* 根据规格项名称,搜索对应的规格对象(如果是服务器设置过的话)
|
||||
*/
|
||||
findSpec(name) {
|
||||
let spec = { name: name };
|
||||
this.skuData.forEach(item => {
|
||||
if (item.name === name) {
|
||||
spec = item;
|
||||
}
|
||||
});
|
||||
return spec;
|
||||
},
|
||||
|
||||
/** 选中/不选中 添加规格图片 是否显示上传组件*/
|
||||
handleChangeImage(val) {
|
||||
this.$set(this.skuInfo, this.skuInfo.length, {});
|
||||
this.skuInfo.splice(this.skuInfo.length - 1, 1);
|
||||
this.checkedImage = val;
|
||||
/** 如果 图片按钮不显示 则置空图片列表中的所有图片数据 并且spec_type设置为0 */
|
||||
if (!val) {
|
||||
this.skuInfo.forEach(key => {
|
||||
if (key.spec_values) {
|
||||
key.spec_values.forEach(item => {
|
||||
item.spec_image = "";
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 渲染规格详细表格
|
||||
*/
|
||||
this.renderTableData();
|
||||
|
||||
|
||||
},
|
||||
|
||||
/** 规格值 */
|
||||
|
||||
/** 添加当前规格项的规格值*/
|
||||
addSpec($index, item) {
|
||||
this.activeSkuItemIndex = $index;
|
||||
this.$set(
|
||||
this.skuInfo[$index].spec_values,
|
||||
this.skuInfo[$index].spec_values.length,
|
||||
{
|
||||
name: item.name
|
||||
}
|
||||
);
|
||||
/**
|
||||
* 渲染规格详细表格
|
||||
*/
|
||||
this.renderTableData();
|
||||
},
|
||||
|
||||
/** 移除当前规格值 */
|
||||
handleCloseSkuValue($index, index) {
|
||||
this.skuInfo[$index].spec_values.splice(index, 1);
|
||||
/**
|
||||
* 渲染规格详细表格
|
||||
*/
|
||||
this.renderTableData();
|
||||
},
|
||||
|
||||
/** 选择规格值时触发 */
|
||||
skuValueChange(val) {
|
||||
/** 更新skuInfo数据 */
|
||||
let _arr = cloneObj(this.skuInfo[this.activeSkuItemIndex]);
|
||||
this.$set(_arr.spec_values[this.activeSkuValIndex], "name", _arr.name);
|
||||
this.$set(this.skuInfo, this.activeSkuItemIndex, _arr);
|
||||
/**
|
||||
* 渲染规格详细表格
|
||||
*/
|
||||
this.renderTableData();
|
||||
},
|
||||
|
||||
/** 编辑规格值时触发 */
|
||||
editSkuIValue($index) {
|
||||
if (this.skuInfo.length >= $index) {
|
||||
let data = this.findSpec(this.skuInfo[$index].name);
|
||||
this.skuValue = data.value;
|
||||
}
|
||||
/**
|
||||
* 渲染规格详细表格
|
||||
*/
|
||||
this.renderTableData();
|
||||
},
|
||||
/** 获取编辑时的skuInfo信息 */
|
||||
getSkuInfo() {
|
||||
/** 下拉列表数据(skuData)存在时 检测productSkuInfo中对应的规格(spec_id)项 并且赋值于skuInfo中对应的规格项信息(描述 + 名称) */
|
||||
if (this.categoryId) {
|
||||
API_spec.getSpecValuesListData(this.categoryId, {}).then(response => {
|
||||
this.skuData = response;
|
||||
if (
|
||||
this.skuData.length > 0 &&
|
||||
Array.isArray(this.productSkuInfo) &&
|
||||
this.productSkuInfo.length > 0
|
||||
) {
|
||||
this.skuInfo = cloneObj(this.productSkuInfo);
|
||||
if (this.skuInfo.length > 0) {
|
||||
this.skuInfo.forEach(key => {
|
||||
this.skuData.forEach(item => {
|
||||
if (key.spec_id === item.spec_id) {
|
||||
key.name = item.name;
|
||||
key.spec_memo = item.spec_memo;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
/** 如果存在图片则进行显示 */
|
||||
if (this.skuInfo[0].spec_values[0].spec_type === 1) {
|
||||
this.checkedImage = true;
|
||||
}
|
||||
/** 触发一次数据转换(规格选择数据=> 规格表格数据) */
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 渲染规格详细表格
|
||||
*/
|
||||
this.renderTableData();
|
||||
},
|
||||
/**
|
||||
* 渲染table所需要的column 和 data
|
||||
*/
|
||||
renderTableData() {
|
||||
this.skuTableColumn = [];
|
||||
this.skuTableData = [];
|
||||
|
||||
//渲染头部
|
||||
|
||||
this.skuInfo.forEach(sku => {
|
||||
//列名称
|
||||
let columnName = sku.name;
|
||||
this.skuTableColumn.push({
|
||||
title: columnName,
|
||||
key: columnName
|
||||
});
|
||||
});
|
||||
this.skuTableColumn.push(
|
||||
{
|
||||
title: "货号",
|
||||
slot: "sn"
|
||||
},
|
||||
{
|
||||
title: "重量",
|
||||
slot: "weight"
|
||||
},
|
||||
{
|
||||
title: "库存",
|
||||
slot: "quantity"
|
||||
},
|
||||
{
|
||||
title: "成本价",
|
||||
slot: "cost"
|
||||
},
|
||||
{
|
||||
title: "价格",
|
||||
slot: "price"
|
||||
}
|
||||
);
|
||||
|
||||
//克隆所有渲染的数据
|
||||
let cloneTemp = cloneObj(this.skuInfo);
|
||||
|
||||
//数据清空一次
|
||||
this.skuTableData = [];
|
||||
//判定 是否存在规格分组
|
||||
if (cloneTemp[0]) {
|
||||
//存放最终结果
|
||||
let result = [];
|
||||
|
||||
//记录存放表格的 key
|
||||
//循环选中的 sku 数据
|
||||
if(this.checkedImage===false){
|
||||
cloneTemp[0].spec_values.forEach(specItem => {
|
||||
result.push({
|
||||
[specItem.name]: specItem.value
|
||||
});
|
||||
});
|
||||
}else{
|
||||
cloneTemp[0].spec_values.forEach(specItem => {
|
||||
result.push({
|
||||
[specItem.name]: specItem.value,
|
||||
images: specItem.spec_image
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
cloneTemp.splice(0, 1);
|
||||
|
||||
result = this.specIterator(result, cloneTemp);
|
||||
result = this.defaultParams(result);
|
||||
this.skuTableData = result;
|
||||
}
|
||||
this.$emit("getTableData", this.skuTableData);
|
||||
},
|
||||
|
||||
/** 自动完成表单所需方法*/
|
||||
filterMethod(value, option) {
|
||||
return option.toUpperCase().indexOf(value.toUpperCase()) !== -1;
|
||||
},
|
||||
|
||||
/** 根据分类id获取系统设置规格信息*/
|
||||
Get_SkuInfoByCategory() {
|
||||
if (this.baseInfoForm.categoryId) {
|
||||
getGoodsSpecInfo(this.baseInfoForm.categoryId, {}).then(response => {
|
||||
this.skuData = response;
|
||||
if (this.skuData.length > 0) {
|
||||
this.skuData.forEach(spec => {
|
||||
this.skuKey.push(spec.name);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
/** 检测是否未通过0-99999999之间的数字校验 */
|
||||
isValidate(index, scope) {
|
||||
return this.validateError.some(key => {
|
||||
return key[0] === index && key[1] === scope.$index
|
||||
})
|
||||
},
|
||||
/** 数据改变之后 抛出数据 */
|
||||
updateSkuTable(row, item) {
|
||||
let index = row._index;
|
||||
this.skuTableData[index][item] = row[item];
|
||||
/** 进行自定义校验 判断是否是数字(小数也能通过)重量 */
|
||||
if (
|
||||
(!/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/.test(row[item]) &&
|
||||
item === "weight") ||
|
||||
parseInt(row[item]) < 0 ||
|
||||
parseInt(row[item]) > 99999999
|
||||
) {
|
||||
this.$Message.error("请输入0~99999999之间的数字值");
|
||||
return;
|
||||
} else if (
|
||||
(item === "quantity" && !/^[0-9]\d*$/.test(row[item])) ||
|
||||
parseInt(row[item]) < 0 ||
|
||||
parseInt(row[item]) > 99999999
|
||||
) {
|
||||
// 库存
|
||||
this.$Message.error("请输入0~99999999之间的整数");
|
||||
return;
|
||||
} else if (
|
||||
((item === "cost" || item === "price") &&
|
||||
!regular.money.test(row[item])) ||
|
||||
parseInt(row[item]) < 0 ||
|
||||
parseInt(row[item]) > 99999999
|
||||
) {
|
||||
// 成本价 价格
|
||||
this.$Message.error("请输入0~99999999之间的价格");
|
||||
return;
|
||||
}
|
||||
this.skuTableData[index][item] = row[item];
|
||||
this.$emit("getTableData", this.skuTableData);
|
||||
// console.log(999, this.skuTableData)
|
||||
},
|
||||
/**
|
||||
* 迭代属性,形成表格
|
||||
* result 渲染的数据
|
||||
* array spec数据
|
||||
*/
|
||||
specIterator(result, cloneTemp) {
|
||||
//是否还可以循环
|
||||
if (cloneTemp.length > 0) {
|
||||
let table = [];
|
||||
result.forEach(resItem => {
|
||||
let tableItem = [];
|
||||
cloneTemp[0].spec_values.forEach(valItem => {
|
||||
let obj = cloneObj(resItem);
|
||||
obj[valItem.name] = valItem.value;
|
||||
table.push(obj);
|
||||
});
|
||||
});
|
||||
result = [];
|
||||
table.forEach(t => {
|
||||
result.push(t);
|
||||
});
|
||||
//清除当前循环的分组
|
||||
cloneTemp.splice(0, 1);
|
||||
} else {
|
||||
return result;
|
||||
}
|
||||
return this.specIterator(result, cloneTemp);
|
||||
},
|
||||
showData() {
|
||||
// console.log(JSON.stringify(this.skuTableData));
|
||||
// console.warn(this.specList);
|
||||
},
|
||||
/**
|
||||
* 添加固有属性
|
||||
*/
|
||||
defaultParams(tableData) {
|
||||
return tableData;
|
||||
},
|
||||
|
||||
handleSpan({ row, column, rowIndex, columnIndex }) {},
|
||||
|
||||
thumbChange(){
|
||||
this.$emit("getTableData", this.skuTableData);
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.layout {
|
||||
margin-bottom: 20px;
|
||||
|
||||
.sku-item-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
|
||||
.sku-item-content-name {
|
||||
margin-top: 24px;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.demo-upload-list{
|
||||
display: inline-block;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
text-align: center;
|
||||
line-height: 60px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
box-shadow: 0 1px 1px rgba(0,0,0,.2);
|
||||
margin-right: 4px;
|
||||
}
|
||||
.demo-upload-list img{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.demo-upload-list-cover{
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: rgba(0,0,0,.6);
|
||||
}
|
||||
.demo-upload-list:hover .demo-upload-list-cover{
|
||||
display: block;
|
||||
}
|
||||
.demo-upload-list-cover i{
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
margin: 0 2px;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
|
@ -1,114 +0,0 @@
|
|||
<template>
|
||||
<div>
|
||||
<Button
|
||||
:countTime="countTime"
|
||||
:loading="loading"
|
||||
:type="type"
|
||||
:size="size"
|
||||
:ghost="ghost"
|
||||
:disabled="disabled||clicked"
|
||||
:icon="icon"
|
||||
:shape="shape"
|
||||
:long="long"
|
||||
@click="handleClick"
|
||||
>{{buttonText}}</Button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "iconChoose",
|
||||
props: {
|
||||
text: {
|
||||
type: String,
|
||||
default: "提交"
|
||||
},
|
||||
autoCountDown: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
countTime: {
|
||||
type: [Number, String],
|
||||
default: 60
|
||||
},
|
||||
suffixText: {
|
||||
type: String,
|
||||
default: "后重试"
|
||||
},
|
||||
type: String,
|
||||
size: String,
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
ghost: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
icon: String,
|
||||
shape: String,
|
||||
long: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
buttonText: this.text, // 按钮文字
|
||||
count: Number(this.countTime), // 计时时间
|
||||
clicked: false // 是否可点击
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init() {},
|
||||
handleClick() {
|
||||
if (this.autoCountDown) {
|
||||
this.clicked = true;
|
||||
this.countDown();
|
||||
}
|
||||
this.$emit("on-click", true);
|
||||
},
|
||||
startCountDown() {
|
||||
this.clicked = true;
|
||||
this.countDown();
|
||||
},
|
||||
countDown() {
|
||||
let that = this;
|
||||
if (this.count == 0) {
|
||||
this.clicked = false;
|
||||
this.count = this.countTime;
|
||||
this.buttonText = this.text;
|
||||
return;
|
||||
} else {
|
||||
this.buttonText = this.count + " 秒" + this.suffixText;
|
||||
this.count--;
|
||||
}
|
||||
setTimeout(function() {
|
||||
that.countDown();
|
||||
}, 1000);
|
||||
},
|
||||
setText(value) {
|
||||
if (value === this.buttonText) {
|
||||
return;
|
||||
}
|
||||
this.buttonText = value;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
text(val) {
|
||||
this.setText(val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
</style>
|
||||
|
|
@ -1,346 +0,0 @@
|
|||
<template>
|
||||
<div class="sku-choose">
|
||||
<Button @click="showDrawer=true" :icon="icon">{{ text }}</Button>
|
||||
<span @click="clearSelectData" class="clear">清空已选</span>
|
||||
<Collapse simple class="collapse">
|
||||
<Panel name="1">
|
||||
已选择
|
||||
<span class="select-count">{{ selectObj.length }}</span> 件
|
||||
<p slot="content">
|
||||
<Tag
|
||||
v-for="(item, i) in selectObj"
|
||||
:key="i"
|
||||
:name="item.id"
|
||||
color="default"
|
||||
closable
|
||||
@on-close="handleCancelObj"
|
||||
>{{ createName(item) }}
|
||||
</Tag>
|
||||
</p>
|
||||
</Panel>
|
||||
</Collapse>
|
||||
<Drawer title="选择活动优惠券" closable v-model="showDrawer" :width="width" draggable>
|
||||
<Table
|
||||
:loading="showLoading"
|
||||
border
|
||||
:columns="tableColumns"
|
||||
:data="tableData"
|
||||
:height="height"
|
||||
ref="tableData"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" style="margin: 10px 0;">
|
||||
<Page
|
||||
:current="searchForm.pageNumber"
|
||||
:total="tableTotal"
|
||||
:page-size="searchForm.pageSize"
|
||||
@on-change="changeDataPage"
|
||||
@on-page-size-change="changeDataPageSize"
|
||||
:page-size-opts="[10,20,50]"
|
||||
size="small"
|
||||
show-total
|
||||
show-elevator
|
||||
show-sizer
|
||||
></Page>
|
||||
</Row>
|
||||
<div class="my-drawer-footer">
|
||||
已选择
|
||||
<span class="select-count">{{ selectObj.length }}</span> 件
|
||||
<Button @click="clearSelectData" style="margin-left:10px">清空已选</Button>
|
||||
<Button @click="showDrawer=false" type="primary" style="margin-left:10px">关闭</Button>
|
||||
</div>
|
||||
</Drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getPlatformCouponList
|
||||
} from "@/api/promotion";
|
||||
|
||||
export default {
|
||||
name: "userChoose",
|
||||
props: {
|
||||
text: {
|
||||
type: String,
|
||||
default: "选择SKU"
|
||||
},
|
||||
icon: {
|
||||
type: String,
|
||||
default: "md-basket"
|
||||
},
|
||||
initData: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
createName: {
|
||||
type: Function,
|
||||
default: function (item) {
|
||||
return item.goodsName
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.selectObj = this.initData
|
||||
console.log(JSON.stringify(this.initData))
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//默认值后续计算
|
||||
height: 500,
|
||||
width: 500,
|
||||
//加载状态
|
||||
showLoading: true,
|
||||
//展示抽屉
|
||||
showDrawer: false,
|
||||
selectObj: [], // 选择数据
|
||||
searchForm: { // 请求参数
|
||||
getType: "ACTIVITY",// 活动优惠券
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
|
||||
},
|
||||
tableColumns: [ // 表头
|
||||
{
|
||||
type: "index",
|
||||
width: 60,
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "商品名称",
|
||||
key: "goodsName",
|
||||
minWidth: 140
|
||||
},
|
||||
{
|
||||
title: "规格",
|
||||
key: "specName",
|
||||
minWidth: 140,
|
||||
},
|
||||
{
|
||||
title: "图片",
|
||||
key: "thumbnail",
|
||||
width: 80,
|
||||
align: "center",
|
||||
render: (h, params) => {
|
||||
return h("Avatar", {
|
||||
props: {
|
||||
src: params.row.face
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
key: "status",
|
||||
align: "center",
|
||||
width: 120,
|
||||
render: (h, params) => {
|
||||
if (params.row.delFlag == 0) {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "正常"
|
||||
}
|
||||
})
|
||||
]);
|
||||
} else if (params.row.delFlag == -1) {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "禁用"
|
||||
}
|
||||
})
|
||||
]);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "创建时间",
|
||||
key: "createTime",
|
||||
sortable: true,
|
||||
sortType: "desc",
|
||||
width: 170
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
width: 130,
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
render: (h, params) => {
|
||||
let select;
|
||||
this.selectObj.forEach(item => {
|
||||
if (item.id === params.row.id) {
|
||||
select = params.row
|
||||
}
|
||||
});
|
||||
|
||||
if (select) {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "info",
|
||||
size: "small"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.chooseCancel(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"取消选择"
|
||||
)
|
||||
]);
|
||||
} else {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "info",
|
||||
size: "small"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.chooseObj(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"选择"
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
tableData: [], // 表格数据
|
||||
tableTotal: 0 // 总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
changeDataPage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.searchData();
|
||||
},
|
||||
changeDataPageSize(v) {
|
||||
this.searchForm.pageSize = v;
|
||||
this.searchData();
|
||||
},
|
||||
searchData() {
|
||||
this.showLoading = true;
|
||||
getPlatformCouponList(this.searchForm).then(res => {
|
||||
this.showLoading = false;
|
||||
if (res.success) {
|
||||
this.tableData = res.result.records;
|
||||
this.tableTotal = res.result.total;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
handleSearchData() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.searchData();
|
||||
},
|
||||
handleResetObj() {
|
||||
this.$refs.searchForm.resetFields();
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 9;
|
||||
this.searchForm.departmentId = "";
|
||||
// 重新加载数据
|
||||
this.searchData();
|
||||
},
|
||||
setData(v) {
|
||||
this.selectObj = v;
|
||||
this.$emit("on-change", this.selectObj);
|
||||
},
|
||||
chooseCancel(v) {
|
||||
let _index;
|
||||
this.selectObj.forEach((e, index) => {
|
||||
if (v.id == e.id) {
|
||||
_index = index;
|
||||
}
|
||||
});
|
||||
|
||||
if (_index || _index == 0) {
|
||||
this.selectObj.splice(_index, 1);
|
||||
this.$emit("on-change", this.selectObj);
|
||||
}
|
||||
},
|
||||
chooseObj(v) {
|
||||
// 去重
|
||||
let that = this;
|
||||
let flag = true;
|
||||
this.selectObj.forEach(e => {
|
||||
if (v.id == e.id) {
|
||||
flag = false;
|
||||
}
|
||||
});
|
||||
if (flag) {
|
||||
this.selectObj.push(v);
|
||||
this.$emit("on-change", this.selectObj);
|
||||
}
|
||||
},
|
||||
clearSelectData() {
|
||||
this.selectObj = [];
|
||||
this.$emit("on-change", this.selectObj);
|
||||
},
|
||||
handleCancelObj(e, id) {
|
||||
// 删除所选用户
|
||||
let newArray = [];
|
||||
this.selectObj.forEach(e => {
|
||||
if (id != e.id) {
|
||||
newArray.push(e);
|
||||
}
|
||||
});
|
||||
this.selectObj = newArray;
|
||||
this.$emit("on-change", this.selectObj);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 计算高度
|
||||
this.height = Number(document.documentElement.clientHeight - 230);
|
||||
this.width = Number(document.documentElement.clientWidth / 2) > 900 ? 900 : Number(document.documentElement.clientWidth / 2)
|
||||
this.searchData();
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.sku-choose {
|
||||
.clear {
|
||||
font-size: 12px;
|
||||
margin-left: 15px;
|
||||
color: #40a9ff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.collapse {
|
||||
font-size: 12px;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.select-count {
|
||||
font-weight: 600;
|
||||
color: #40a9ff;
|
||||
}
|
||||
}
|
||||
|
||||
.my-drawer-footer {
|
||||
z-index: 10;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
padding: 10px 16px;
|
||||
text-align: right;
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
|
@ -14,7 +14,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { initDepartment, loadDepartment } from "@/api/index";
|
||||
import { initDepartment } from "@/api/index";
|
||||
export default {
|
||||
name: "departmentChoose",
|
||||
props: {
|
||||
|
@ -27,50 +27,13 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
// 获取部门数据
|
||||
initDepartmentData() {
|
||||
initDepartment().then(res => {
|
||||
if (res.success) {
|
||||
res.result.forEach(function(e) {
|
||||
if (e.isParent) {
|
||||
e.value = e.id;
|
||||
e.label = e.title;
|
||||
e.loading = false;
|
||||
e.children = [];
|
||||
} else {
|
||||
e.value = e.id;
|
||||
e.label = e.title;
|
||||
}
|
||||
if (e.status == -1) {
|
||||
e.label = "[已禁用] " + e.label;
|
||||
e.disabled = true;
|
||||
}
|
||||
});
|
||||
this.department = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
loadData(item, callback) {
|
||||
item.loading = true;
|
||||
loadDepartment(item.value).then(res => {
|
||||
item.loading = false;
|
||||
if (res.success) {
|
||||
res.result.forEach(function(e) {
|
||||
if (e.isParent) {
|
||||
e.value = e.id;
|
||||
e.label = e.title;
|
||||
e.loading = false;
|
||||
e.children = [];
|
||||
} else {
|
||||
e.value = e.id;
|
||||
e.label = e.title;
|
||||
}
|
||||
if (e.status == -1) {
|
||||
e.label = "[已禁用] " + e.label;
|
||||
e.disabled = true;
|
||||
}
|
||||
});
|
||||
item.children = res.result;
|
||||
callback();
|
||||
const arr = res.result;
|
||||
this.filterData(arr)
|
||||
this.department = arr
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -82,8 +45,21 @@ export default {
|
|||
}
|
||||
this.$emit("on-change", departmentId);
|
||||
},
|
||||
// 清空已选列表
|
||||
clearSelect() {
|
||||
this.selectDep = [];
|
||||
},
|
||||
// 处理部门数据
|
||||
filterData (data) {
|
||||
data.forEach(e => {
|
||||
e.value = e.id;
|
||||
e.label = e.title;
|
||||
if (e.children) {
|
||||
this.filterData(e.children)
|
||||
} else {
|
||||
return
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
<div class="dep-tree-bar">
|
||||
<Tree
|
||||
:data="dataDep"
|
||||
:load-data="loadData"
|
||||
@on-select-change="selectTree"
|
||||
></Tree>
|
||||
<Spin size="large" fix v-if="depLoading"></Spin>
|
||||
|
@ -34,7 +33,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {initDepartment, loadDepartment, searchDepartment} from "@/api/index";
|
||||
import {initDepartment, searchDepartment} from "@/api/index";
|
||||
|
||||
export default {
|
||||
name: "departmentTreeChoose",
|
||||
|
@ -63,40 +62,14 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
// 获取部门数据
|
||||
initDepartmentData() {
|
||||
initDepartment().then(res => {
|
||||
if (res.success) {
|
||||
res.result.forEach(function (e) {
|
||||
if (e.isParent) {
|
||||
e.loading = false;
|
||||
e.children = [];
|
||||
}
|
||||
if (e.status == -1) {
|
||||
e.title = "[已禁用] " + e.title;
|
||||
e.disabled = true;
|
||||
}
|
||||
});
|
||||
this.dataDep = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
loadData(item, callback) {
|
||||
loadDepartment(item.id).then(res => {
|
||||
if (res.success) {
|
||||
res.result.forEach(function (e) {
|
||||
if (e.isParent) {
|
||||
e.loading = false;
|
||||
e.children = [];
|
||||
}
|
||||
if (e.status == -1) {
|
||||
e.title = "[已禁用] " + e.title;
|
||||
e.disabled = true;
|
||||
}
|
||||
});
|
||||
callback(res.result);
|
||||
}
|
||||
});
|
||||
},
|
||||
searchDep() {
|
||||
// 搜索部门
|
||||
if (this.searchKey) {
|
||||
|
@ -117,6 +90,7 @@ export default {
|
|||
this.initDepartmentData();
|
||||
}
|
||||
},
|
||||
// 选择回调
|
||||
selectTree(v) {
|
||||
if (v.length === 0) {
|
||||
this.$emit("on-change", null);
|
||||
|
@ -132,6 +106,7 @@ export default {
|
|||
}
|
||||
this.$emit("on-change", department);
|
||||
},
|
||||
// 清除选中方法
|
||||
clearSelect() {
|
||||
this.departmentId = [];
|
||||
this.departmentTitle = "";
|
||||
|
@ -143,6 +118,7 @@ export default {
|
|||
}
|
||||
this.$emit("on-clear");
|
||||
},
|
||||
// 设置数据 回显用
|
||||
setData(ids, title) {
|
||||
this.departmentTitle = title;
|
||||
if (this.multiple) {
|
||||
|
@ -151,7 +127,6 @@ export default {
|
|||
this.departmentId = [];
|
||||
this.departmentId.push(ids);
|
||||
}
|
||||
// this.$emit("on-change", this.departmentId);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
|
@ -159,16 +159,19 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
// 编辑html
|
||||
editHTML() {
|
||||
this.dataEdit = this.data;
|
||||
this.showHTMLModal = true;
|
||||
},
|
||||
// 保存
|
||||
editHTMLOk() {
|
||||
editor.txt.html(this.dataEdit);
|
||||
this.$emit("input", this.data);
|
||||
this.$emit("on-change", this.data);
|
||||
this.showHTMLModal = false;
|
||||
},
|
||||
// 清空编辑器
|
||||
clear() {
|
||||
this.$Modal.confirm({
|
||||
title: "确认清空",
|
||||
|
@ -181,6 +184,7 @@ export default {
|
|||
},
|
||||
});
|
||||
},
|
||||
// 回显数据
|
||||
setData(value) {
|
||||
if (!editor) {
|
||||
this.initEditor();
|
||||
|
|
|
@ -1,346 +0,0 @@
|
|||
<template>
|
||||
<div class="member-choose">
|
||||
<Button @click="userModalVisible=true" :icon="icon">{{text}}</Button>
|
||||
<span @click="clearSelectData" class="clear">清空已选</span>
|
||||
<Collapse simple class="collapse">
|
||||
<Panel name="1">
|
||||
已选择
|
||||
<span class="select-count">{{selectUsers.length}}</span> 人
|
||||
<p slot="content">
|
||||
<Tag
|
||||
v-for="(item, i) in selectUsers"
|
||||
:key="i"
|
||||
:name="item.id"
|
||||
color="default"
|
||||
closable
|
||||
@on-close="handleCancelUser"
|
||||
>{{item.username}}
|
||||
</Tag>
|
||||
</p>
|
||||
</Panel>
|
||||
</Collapse>
|
||||
<Drawer title="选择用户" closable v-model="userModalVisible" width="800" draggable>
|
||||
<Form ref="searchUserForm" :model="searchUserForm" inline :label-width="55">
|
||||
<Form-item label="用户名" prop="username">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchUserForm.username"
|
||||
clearable
|
||||
placeholder="请输入用户名"
|
||||
style="width: 200px"
|
||||
/>
|
||||
</Form-item>
|
||||
<Form-item style="margin-left:-35px;" class="br">
|
||||
<Button @click="handleSearchUser" type="primary" icon="ios-search">搜索</Button>
|
||||
<Button @click="handleResetUser">重置</Button>
|
||||
</Form-item>
|
||||
</Form>
|
||||
<Table
|
||||
:loading="userLoading"
|
||||
border
|
||||
:columns="userColumns"
|
||||
:data="userData"
|
||||
:height="height"
|
||||
ref="userTable"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" style="margin: 10px 0;">
|
||||
<Page
|
||||
:current="searchUserForm.pageNumber"
|
||||
:total="totalUser"
|
||||
:page-size="searchUserForm.pageSize"
|
||||
@on-change="changeUserPage"
|
||||
@on-page-size-change="changeUserPageSize"
|
||||
:page-size-opts="[10,20,50]"
|
||||
size="small"
|
||||
show-total
|
||||
show-elevator
|
||||
show-sizer
|
||||
></Page>
|
||||
</Row>
|
||||
<div class="my-drawer-footer">
|
||||
已选择
|
||||
<span class="select-count">{{selectUsers.length}}</span> 人
|
||||
<Button @click="clearSelectData" style="margin-left:10px">清空已选</Button>
|
||||
<Button @click="userModalVisible=false" type="primary" style="margin-left:10px">关闭</Button>
|
||||
</div>
|
||||
</Drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getMember} from "@/api/member";
|
||||
|
||||
export default {
|
||||
name: "userChoose",
|
||||
props: {
|
||||
text: {
|
||||
type: String,
|
||||
default: "选择会员"
|
||||
},
|
||||
icon: {
|
||||
type: String,
|
||||
default: "md-person-add"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
height: 500, // 表格高度
|
||||
userLoading: true, // 加载状态
|
||||
userModalVisible: false, // modal显隐
|
||||
selectUsers: [], // 已选用户
|
||||
searchUserForm: { // 请求参数
|
||||
username: "",
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc" // 默认排序方式
|
||||
},
|
||||
userColumns: [ // 表头
|
||||
{
|
||||
type: "index",
|
||||
width: 60,
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "用户名",
|
||||
key: "username",
|
||||
minWidth: 140,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: "头像",
|
||||
key: "face",
|
||||
width: 80,
|
||||
align: "center",
|
||||
render: (h, params) => {
|
||||
return h("Avatar", {
|
||||
props: {
|
||||
src: params.row.face
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "手机",
|
||||
key: "mobile",
|
||||
width: 125,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
key: "status",
|
||||
align: "center",
|
||||
width: 120,
|
||||
render: (h, params) => {
|
||||
if (params.row.delFlag == 0) {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "正常启用"
|
||||
}
|
||||
})
|
||||
]);
|
||||
} else if (params.row.delFlag == -1) {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "禁用"
|
||||
}
|
||||
})
|
||||
]);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "创建时间",
|
||||
key: "createTime",
|
||||
sortable: true,
|
||||
sortType: "desc",
|
||||
width: 170
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
width: 130,
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
render: (h, params) => {
|
||||
let select;
|
||||
this.selectUsers.forEach(item => {
|
||||
if (item.id === params.row.id) {
|
||||
select = params.row
|
||||
}
|
||||
});
|
||||
|
||||
if (select) {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "info",
|
||||
size: "small"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.chooseCancel(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"取消选择"
|
||||
)
|
||||
]);
|
||||
} else {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "info",
|
||||
size: "small"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.chooseUser(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"选择"
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
userData: [], // 用户数据
|
||||
totalUser: 0 // 数量
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
changeUserPage(v) {
|
||||
this.searchUserForm.pageNumber = v;
|
||||
this.getUserDataList();
|
||||
},
|
||||
changeUserPageSize(v) {
|
||||
this.searchUserForm.pageSize = v;
|
||||
this.getUserDataList();
|
||||
},
|
||||
getUserDataList() {
|
||||
this.userLoading = true;
|
||||
getMember(this.searchUserForm).then(res => {
|
||||
this.userLoading = false;
|
||||
if (res.success) {
|
||||
this.userData = res.result.records;
|
||||
this.totalUser = res.result.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSearchUser() {
|
||||
this.searchUserForm.pageNumber = 1;
|
||||
this.searchUserForm.pageSize = 10;
|
||||
this.getUserDataList();
|
||||
},
|
||||
handleResetUser() {
|
||||
this.$refs.searchUserForm.resetFields();
|
||||
this.searchUserForm.pageNumber = 1;
|
||||
this.searchUserForm.pageSize = 9;
|
||||
this.$refs.dep.clearSelect();
|
||||
this.searchUserForm.departmentId = "";
|
||||
// 重新加载数据
|
||||
this.getUserDataList();
|
||||
},
|
||||
setData(v) {
|
||||
this.selectUsers = v;
|
||||
this.$emit("on-change", this.selectUsers);
|
||||
},
|
||||
chooseCancel(v){
|
||||
let _index;
|
||||
this.selectUsers.forEach((e,index) => {
|
||||
if (v.id == e.id) {
|
||||
_index = index;
|
||||
}
|
||||
});
|
||||
|
||||
if(_index||_index==0){
|
||||
this.selectUsers.splice(_index,1);
|
||||
this.$emit("on-change", this.selectUsers);
|
||||
}
|
||||
},
|
||||
chooseUser(v) {
|
||||
// 去重
|
||||
let that = this;
|
||||
let flag = true;
|
||||
this.selectUsers.forEach(e => {
|
||||
if (v.id == e.id) {
|
||||
flag = false;
|
||||
}
|
||||
});
|
||||
if (flag) {
|
||||
let u = {
|
||||
id: v.id,
|
||||
username: v.username
|
||||
};
|
||||
this.selectUsers.push(u);
|
||||
this.$emit("on-change", this.selectUsers);
|
||||
}
|
||||
},
|
||||
clearSelectData() {
|
||||
this.selectUsers = [];
|
||||
this.$emit("on-change", this.selectUsers);
|
||||
},
|
||||
handleCancelUser(e, id) {
|
||||
// 删除所选用户
|
||||
let newArray = [];
|
||||
this.selectUsers.forEach(e => {
|
||||
if (id != e.id) {
|
||||
newArray.push(e);
|
||||
}
|
||||
});
|
||||
this.selectUsers = newArray;
|
||||
this.$emit("on-change", this.selectUsers);
|
||||
this.$Message.success("删除所选用户成功");
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 计算高度
|
||||
this.height = Number(document.documentElement.clientHeight - 230);
|
||||
this.getUserDataList();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.member-choose {
|
||||
.clear {
|
||||
font-size: 12px;
|
||||
margin-left: 15px;
|
||||
color: #40a9ff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.collapse {
|
||||
font-size: 12px;
|
||||
margin-top: 15px;
|
||||
width: 500px;
|
||||
}
|
||||
|
||||
.select-count {
|
||||
font-weight: 600;
|
||||
color: #40a9ff;
|
||||
}
|
||||
}
|
||||
|
||||
.my-drawer-footer {
|
||||
z-index: 10;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
padding: 10px 16px;
|
||||
text-align: right;
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
|
@ -1,284 +0,0 @@
|
|||
<template>
|
||||
<div>
|
||||
<div id="toolbar">
|
||||
<button class="ql-bold" title="粗体"></button>
|
||||
<button class="ql-italic" title="斜体"></button>
|
||||
<button class="ql-underline" title="下划线"></button>
|
||||
<button class="ql-strike" title="删除线"></button>
|
||||
<select class="ql-size" title="字体大小">
|
||||
<option value="small"></option>
|
||||
<option selected></option>
|
||||
<option value="large"></option>
|
||||
<option value="huge"></option>
|
||||
</select>
|
||||
<select class="ql-header" title="标题大小">
|
||||
<option value="1"></option>
|
||||
<option value="2"></option>
|
||||
<option value="3"></option>
|
||||
<option value="4"></option>
|
||||
<option value="5"></option>
|
||||
<option value="6"></option>
|
||||
<option selected></option>
|
||||
</select>
|
||||
<select class="ql-font" title="字体"></select>
|
||||
<select class="ql-align" title="对齐方式"></select>
|
||||
<select class="ql-color" title="字体颜色"></select>
|
||||
<select class="ql-background" title="背景颜色"></select>
|
||||
<button class="ql-blockquote" title="引用"></button>
|
||||
<button class="ql-code-block" title="代码块"></button>
|
||||
<button class="ql-list" value="ordered" title="数字列表"></button>
|
||||
<button class="ql-list" value="bullet" title="点列表"></button>
|
||||
<button class="ql-script" value="sub" title="右下标"></button>
|
||||
<button class="ql-script" value="super" title="右上标"></button>
|
||||
<button class="ql-indent" value="-1" title="向左缩进"></button>
|
||||
<button class="ql-indent" value="+1" title="向右缩进"></button>
|
||||
<button class="ql-clean" title="清空样式"></button>
|
||||
|
||||
<button class="ql-link" title="链接"></button>
|
||||
<button class="ql-image" title="插入图片" v-if="base64"></button>
|
||||
<div class="q-menu" title="插入图片" v-if="!base64">
|
||||
<Upload
|
||||
:action="uploadFileUrl"
|
||||
:headers="accessToken"
|
||||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
:format="['jpg','jpeg','png','gif','bmp']"
|
||||
accept=".jpg, .jpeg, .png, .gif, .bmp"
|
||||
:max-size="5120"
|
||||
:on-format-error="handleFormatError"
|
||||
:on-exceeded-size="handleMaxSize"
|
||||
:before-upload="beforeUpload"
|
||||
:show-upload-list="false"
|
||||
ref="qup"
|
||||
>
|
||||
<Icon type="md-images" size="20" />
|
||||
</Upload>
|
||||
</div>
|
||||
<button class="ql-video" title="插入视频链接"></button>
|
||||
<div class="q-menu" title="编辑HTML代码" @click="editHTML" v-if="expandHtml">
|
||||
<Icon type="md-code-working" size="22" />
|
||||
</div>
|
||||
<div class="q-menu" title="预览" @click="fullscreenModal=true" v-if="expandPreview">
|
||||
<Icon type="ios-eye" size="24" />
|
||||
</div>
|
||||
<div class="q-menu q-trash" title="清空" @click="clear" v-if="expandClear">
|
||||
<Icon type="md-trash" size="18" style="display: block;" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div :id="id" :style="{minHeight: minHeight}"></div>
|
||||
|
||||
<Modal
|
||||
title="编辑html代码"
|
||||
v-model="showHTMLModal"
|
||||
:mask-closable="false"
|
||||
:width="900"
|
||||
:fullscreen="full"
|
||||
>
|
||||
<Input
|
||||
v-if="!full"
|
||||
v-model="dataEdit"
|
||||
:rows="15"
|
||||
type="textarea"
|
||||
style="max-height:60vh;overflow:auto;"
|
||||
/>
|
||||
<Input v-if="full" v-model="dataEdit" :rows="32" type="textarea" />
|
||||
<div slot="footer">
|
||||
<Button @click="full=!full" icon="md-expand">全屏开/关</Button>
|
||||
<Button @click="editHTMLOk" type="primary" icon="md-checkmark-circle-outline">确定保存</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
<Modal title="预览" v-model="fullscreenModal" fullscreen>
|
||||
<div v-html="data">{{data}}</div>
|
||||
<div slot="footer">
|
||||
<Button @click="fullscreenModal=false">关闭</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { uploadFile } from "@/api/index";
|
||||
import Quill from "quill";
|
||||
import "quill/dist/quill.snow.css";
|
||||
import xss from "xss";
|
||||
var editor = null;
|
||||
export default {
|
||||
name: "editor",
|
||||
props: {
|
||||
id: {
|
||||
type: String,
|
||||
default: "quill"
|
||||
},
|
||||
value: String,
|
||||
base64: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
minHeight: {
|
||||
type: String,
|
||||
default: "300px"
|
||||
},
|
||||
expandHtml: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
expandPreview: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
expandClear: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
openXss: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
accessToken: {}, // 验证token
|
||||
uploadFileUrl: uploadFile, // 上传地址
|
||||
editor: null, // 富文本初始化
|
||||
options: { // 富文本配置
|
||||
theme: "snow",
|
||||
modules: {
|
||||
toolbar: "#toolbar"
|
||||
},
|
||||
placeholder: "在这输入内容 ..."
|
||||
},
|
||||
data: this.value, // 富文本数据
|
||||
dataEdit: "", // 编辑数据
|
||||
showHTMLModal: false, // 显示html
|
||||
full: false, // html全屏开关
|
||||
fullscreenModal: false // 显示全屏预览
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
initEditor() {
|
||||
this.accessToken = {
|
||||
accessToken: this.getStore("accessToken")
|
||||
};
|
||||
editor = new Quill(`#${this.id}`, this.options);
|
||||
let that = this;
|
||||
if (this.value) {
|
||||
editor.pasteHTML(this.value);
|
||||
}
|
||||
editor.on("text-change", function(delta, oldDelta, source) {
|
||||
let html = editor.container.firstChild.innerHTML;
|
||||
if (that.openXss) {
|
||||
that.data = xss(html);
|
||||
} else {
|
||||
that.data = html;
|
||||
}
|
||||
that.$emit("input", that.data);
|
||||
that.$emit("on-change", that.data);
|
||||
});
|
||||
},
|
||||
handleFormatError(file) {
|
||||
this.$Notice.warning({
|
||||
title: "不支持的文件格式",
|
||||
desc:
|
||||
"所选文件‘ " +
|
||||
file.name +
|
||||
" ’格式不正确, 请选择 .jpg .jpeg .png .gif .bmp格式文件"
|
||||
});
|
||||
},
|
||||
handleMaxSize(file) {
|
||||
this.$Notice.warning({
|
||||
title: "文件大小过大",
|
||||
desc: "所选文件‘ " + file.name + " ’大小过大, 不得超过 5M."
|
||||
});
|
||||
},
|
||||
beforeUpload() {
|
||||
return true;
|
||||
},
|
||||
handleSuccess(res, file) {
|
||||
if (res.success) {
|
||||
let url = res.result;
|
||||
// 获取光标位置
|
||||
let range = editor.getSelection(true);
|
||||
// 总元素
|
||||
let delta = editor.getContents().length;
|
||||
let index;
|
||||
if (range) {
|
||||
index = range.index;
|
||||
} else {
|
||||
index = delta;
|
||||
}
|
||||
// 插入元素
|
||||
editor.insertEmbed(index, "image", url);
|
||||
editor.setSelection(index + 1, 0);
|
||||
} else {
|
||||
this.$Message.error(res.message);
|
||||
}
|
||||
},
|
||||
handleError(error, file, fileList) {
|
||||
this.$Message.error(error.toString());
|
||||
},
|
||||
editHTML() {
|
||||
this.dataEdit = this.data;
|
||||
this.showHTMLModal = true;
|
||||
},
|
||||
editHTMLOk() {
|
||||
editor.pasteHTML(this.dataEdit);
|
||||
this.$emit("input", this.data);
|
||||
this.$emit("on-change", this.data);
|
||||
this.showHTMLModal = false;
|
||||
},
|
||||
clear() {
|
||||
this.$Modal.confirm({
|
||||
title: "确认清空",
|
||||
content: "确认要清空编辑器内容?清空后不能撤回",
|
||||
onOk: () => {
|
||||
this.data = "";
|
||||
editor.pasteHTML(this.data);
|
||||
this.$emit("input", this.data);
|
||||
this.$emit("on-change", this.data);
|
||||
}
|
||||
});
|
||||
},
|
||||
setData(value) {
|
||||
if (!editor) {
|
||||
this.initEditor();
|
||||
}
|
||||
if (value && value != this.data) {
|
||||
this.data = value;
|
||||
let index = editor.selection.savedRange.index;
|
||||
editor.pasteHTML(this.data);
|
||||
editor.setSelection(index, 0);
|
||||
this.$emit("input", this.data);
|
||||
this.$emit("on-change", this.data);
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value(val) {
|
||||
this.setData(val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initEditor();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.q-menu {
|
||||
margin: 0 3px;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
color: #444;
|
||||
:hover {
|
||||
color: #06c;
|
||||
}
|
||||
}
|
||||
.q-trash {
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
.ql-tooltip {
|
||||
left: 30% !important;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
<template>
|
||||
<div class="spinner">
|
||||
<div class="rect1"></div>
|
||||
<div class="rect2"></div>
|
||||
<div class="rect3"></div>
|
||||
<div class="rect4"></div>
|
||||
<div class="rect5"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "rectLoading"
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.spinner {
|
||||
margin-top: 20vh;
|
||||
margin-bottom: 30vh;
|
||||
height: 60px;
|
||||
text-align: center;
|
||||
font-size: 10px;
|
||||
span {
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
margin-top: 1vh;
|
||||
}
|
||||
div {
|
||||
margin-right: 4px;
|
||||
background-color: #4e9ff5;
|
||||
height: 100%;
|
||||
width: 6px;
|
||||
display: inline-block;
|
||||
-webkit-animation: stretchdelay 1.2s infinite ease-in-out;
|
||||
animation: stretchdelay 1.2s infinite ease-in-out;
|
||||
}
|
||||
.rect2 {
|
||||
-webkit-animation-delay: -1.1s;
|
||||
animation-delay: -1.1s;
|
||||
}
|
||||
.rect3 {
|
||||
-webkit-animation-delay: -1s;
|
||||
animation-delay: -1s;
|
||||
}
|
||||
.rect4 {
|
||||
-webkit-animation-delay: -0.9s;
|
||||
animation-delay: -0.9s;
|
||||
}
|
||||
.rect5 {
|
||||
-webkit-animation-delay: -0.8s;
|
||||
animation-delay: -0.8s;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes stretchdelay {
|
||||
0%,
|
||||
40%,
|
||||
100% {
|
||||
-webkit-transform: scaleY(0.4);
|
||||
}
|
||||
20% {
|
||||
-webkit-transform: scaleY(1);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes stretchdelay {
|
||||
0%,
|
||||
40%,
|
||||
100% {
|
||||
transform: scaleY(0.4);
|
||||
-webkit-transform: scaleY(0.4);
|
||||
}
|
||||
20% {
|
||||
transform: scaleY(1);
|
||||
-webkit-transform: scaleY(1);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -108,11 +108,13 @@ export default {
|
|||
this.strengthValue = 100;
|
||||
}
|
||||
},
|
||||
// 密码变动后回调
|
||||
handleChange(v) {
|
||||
this.strengthChange();
|
||||
this.$emit("input", this.currentValue);
|
||||
this.$emit("on-change", this.currentValue, this.grade, this.strength);
|
||||
},
|
||||
// 监听密码变动,实时回显密码强度
|
||||
setCurrentValue(value) {
|
||||
if (value === this.currentValue) {
|
||||
return;
|
||||
|
|
|
@ -1,358 +0,0 @@
|
|||
<template>
|
||||
<div class="sku-choose">
|
||||
<Button @click="showDrawer=true" :icon="icon">{{text}}</Button>
|
||||
<span @click="clearSelectData" class="clear">清空已选</span>
|
||||
<Collapse simple class="collapse">
|
||||
<Panel name="1">
|
||||
已选择
|
||||
<span class="select-count">{{selectObj.length}}</span> 件
|
||||
<p slot="content">
|
||||
<Tag
|
||||
v-for="(item, i) in selectObj"
|
||||
:key="i"
|
||||
:name="item.id"
|
||||
color="default"
|
||||
closable
|
||||
@on-close="handleCancelObj"
|
||||
>{{createName(item)}}
|
||||
</Tag>
|
||||
</p>
|
||||
</Panel>
|
||||
</Collapse>
|
||||
<Drawer title="选择SKU" closable v-model="showDrawer" :width="width" draggable>
|
||||
<Form ref="searchForm" :model="searchForm" inline :label-width="55">
|
||||
<Form-item label="名称" prop="goodsName">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.goodsName"
|
||||
clearable
|
||||
placeholder="输入商品名称"
|
||||
style="width: 200px"
|
||||
/>
|
||||
</Form-item>
|
||||
<Form-item style="margin-left:-35px;" class="br">
|
||||
<Button @click="handleSearchData" type="primary" icon="ios-search">搜索</Button>
|
||||
<Button @click="handleResetObj">重置</Button>
|
||||
</Form-item>
|
||||
</Form>
|
||||
<Table
|
||||
:loading="showLoading"
|
||||
border
|
||||
:columns="tableColumns"
|
||||
:data="tableData"
|
||||
:height="height"
|
||||
ref="tableData"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" style="margin: 10px 0;">
|
||||
<Page
|
||||
:current="searchForm.pageNumber"
|
||||
:total="tableTotal"
|
||||
:page-size="searchForm.pageSize"
|
||||
@on-change="changeDataPage"
|
||||
@on-page-size-change="changeDataPageSize"
|
||||
:page-size-opts="[10,20,50]"
|
||||
size="small"
|
||||
show-total
|
||||
show-elevator
|
||||
show-sizer
|
||||
></Page>
|
||||
</Row>
|
||||
<div class="my-drawer-footer">
|
||||
已选择
|
||||
<span class="select-count">{{selectObj.length}}</span> 件
|
||||
<Button @click="clearSelectData" style="margin-left:10px">清空已选</Button>
|
||||
<Button @click="showDrawer=false" type="primary" style="margin-left:10px">关闭</Button>
|
||||
</div>
|
||||
</Drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getSkuPage} from "@/api/goods";
|
||||
|
||||
export default {
|
||||
name: "userChoose",
|
||||
props: {
|
||||
text: {
|
||||
type: String,
|
||||
default: "选择SKU"
|
||||
},
|
||||
icon: {
|
||||
type: String,
|
||||
default: "md-basket"
|
||||
},
|
||||
initData: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
createName: {
|
||||
type: Function,
|
||||
default: function (item) {
|
||||
return item.goodsName
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.selectObj = this.initData
|
||||
console.log(JSON.stringify(this.initData))
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//默认值后续计算
|
||||
height: 500,
|
||||
width: 500,
|
||||
//加载状态
|
||||
showLoading: true,
|
||||
//展示抽屉
|
||||
showDrawer: false,
|
||||
selectObj: [], // 选择数据
|
||||
searchForm: { // 请求参数
|
||||
goodsName: "",
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc" // 默认排序方式
|
||||
},
|
||||
tableColumns: [ // 表头
|
||||
{
|
||||
type: "index",
|
||||
width: 60,
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "商品名称",
|
||||
key: "goodsName",
|
||||
minWidth: 140
|
||||
},
|
||||
{
|
||||
title: "规格",
|
||||
key: "specName",
|
||||
minWidth: 140,
|
||||
},
|
||||
{
|
||||
title: "图片",
|
||||
key: "thumbnail",
|
||||
width: 80,
|
||||
align: "center",
|
||||
render: (h, params) => {
|
||||
return h("Avatar", {
|
||||
props: {
|
||||
src: params.row.face
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
key: "status",
|
||||
align: "center",
|
||||
width: 120,
|
||||
render: (h, params) => {
|
||||
if (params.row.delFlag == 0) {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "正常"
|
||||
}
|
||||
})
|
||||
]);
|
||||
} else if (params.row.delFlag == -1) {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "禁用"
|
||||
}
|
||||
})
|
||||
]);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "创建时间",
|
||||
key: "createTime",
|
||||
sortable: true,
|
||||
sortType: "desc",
|
||||
width: 170
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
width: 130,
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
render: (h, params) => {
|
||||
let select;
|
||||
this.selectObj.forEach(item => {
|
||||
if (item.id === params.row.id) {
|
||||
select = params.row
|
||||
}
|
||||
});
|
||||
|
||||
if (select) {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "info",
|
||||
size: "small"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.chooseCancel(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"取消选择"
|
||||
)
|
||||
]);
|
||||
} else {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "info",
|
||||
size: "small"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.chooseObj(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"选择"
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
tableData: [], // 表格数据
|
||||
tableTotal: 0 // 总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
changeDataPage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
this.searchData();
|
||||
},
|
||||
changeDataPageSize(v) {
|
||||
this.searchForm.pageSize = v;
|
||||
this.searchData();
|
||||
},
|
||||
searchData() {
|
||||
this.showLoading = true;
|
||||
getSkuPage(this.searchForm).then(res => {
|
||||
this.showLoading = false;
|
||||
if (res.success) {
|
||||
this.tableData = res.result.records;
|
||||
this.tableTotal = res.result.total;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
handleSearchData() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.searchData();
|
||||
},
|
||||
handleResetObj() {
|
||||
this.$refs.searchForm.resetFields();
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 9;
|
||||
this.searchForm.departmentId = "";
|
||||
// 重新加载数据
|
||||
this.searchData();
|
||||
},
|
||||
setData(v) {
|
||||
this.selectObj = v;
|
||||
this.$emit("on-change", this.selectObj);
|
||||
},
|
||||
chooseCancel(v) {
|
||||
let _index;
|
||||
this.selectObj.forEach((e, index) => {
|
||||
if (v.id == e.id) {
|
||||
_index = index;
|
||||
}
|
||||
});
|
||||
|
||||
if (_index || _index == 0) {
|
||||
this.selectObj.splice(_index, 1);
|
||||
this.$emit("on-change", this.selectObj);
|
||||
}
|
||||
},
|
||||
chooseObj(v) {
|
||||
// 去重
|
||||
let that = this;
|
||||
let flag = true;
|
||||
this.selectObj.forEach(e => {
|
||||
if (v.id == e.id) {
|
||||
flag = false;
|
||||
}
|
||||
});
|
||||
if (flag) {
|
||||
this.selectObj.push(v);
|
||||
this.$emit("on-change", this.selectObj);
|
||||
}
|
||||
},
|
||||
clearSelectData() {
|
||||
this.selectObj = [];
|
||||
this.$emit("on-change", this.selectObj);
|
||||
},
|
||||
handleCancelObj(e, id) {
|
||||
// 删除所选用户
|
||||
let newArray = [];
|
||||
this.selectObj.forEach(e => {
|
||||
if (id != e.id) {
|
||||
newArray.push(e);
|
||||
}
|
||||
});
|
||||
this.selectObj = newArray;
|
||||
this.$emit("on-change", this.selectObj);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 计算高度
|
||||
this.height = Number(document.documentElement.clientHeight - 230);
|
||||
this.width = Number(document.documentElement.clientWidth/2)>900?900:Number(document.documentElement.clientWidth/2)
|
||||
this.searchData();
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.sku-choose {
|
||||
.clear {
|
||||
font-size: 12px;
|
||||
margin-left: 15px;
|
||||
color: #40a9ff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.collapse {
|
||||
font-size: 12px;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.select-count {
|
||||
font-weight: 600;
|
||||
color: #40a9ff;
|
||||
}
|
||||
}
|
||||
|
||||
.my-drawer-footer {
|
||||
z-index: 10;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
padding: 10px 16px;
|
||||
text-align: right;
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
|
@ -132,7 +132,7 @@ export default {
|
|||
this.$emit("input", this.currentValue);
|
||||
this.$emit("on-change", this.currentValue);
|
||||
} else {
|
||||
this.$Message.error(res.message);
|
||||
// this.$Message.error(res.message);
|
||||
}
|
||||
},
|
||||
// 上传失败
|
||||
|
|
|
@ -91,27 +91,30 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
// 拖拽结束事件
|
||||
onEnd() {
|
||||
this.returnValue();
|
||||
},
|
||||
// 初始化方法
|
||||
init() {
|
||||
this.setData(this.value, true);
|
||||
this.accessToken = {
|
||||
accessToken: this.getStore("accessToken")
|
||||
};
|
||||
},
|
||||
// 预览图片
|
||||
handleView(imgUrl) {
|
||||
this.imgUrl = imgUrl;
|
||||
this.viewImage = true;
|
||||
},
|
||||
// 移除图片
|
||||
handleRemove(file) {
|
||||
this.uploadList = this.uploadList.filter(i => i.url !== file.url);
|
||||
this.returnValue();
|
||||
},
|
||||
// 上传成功
|
||||
handleSuccess(res, file) {
|
||||
if (res.success) {
|
||||
|
||||
|
||||
file.url = res.result;
|
||||
// 单张图片处理
|
||||
if (!this.multiple && this.uploadList.length > 0) {
|
||||
|
@ -125,9 +128,11 @@ export default {
|
|||
this.$Message.error(res.message);
|
||||
}
|
||||
},
|
||||
// 上传失败
|
||||
handleError(error, file, fileList) {
|
||||
this.$Message.error(error.toString());
|
||||
},
|
||||
// 格式校验
|
||||
handleFormatError(file) {
|
||||
this.$Notice.warning({
|
||||
title: "不支持的文件格式",
|
||||
|
@ -137,6 +142,7 @@ export default {
|
|||
" ’格式不正确, 请选择 .jpg .jpeg .png .gif图片格式文件"
|
||||
});
|
||||
},
|
||||
// 上传文件大小校验
|
||||
handleMaxSize(file) {
|
||||
this.$Notice.warning({
|
||||
title: "文件大小过大",
|
||||
|
@ -148,6 +154,7 @@ export default {
|
|||
"M."
|
||||
});
|
||||
},
|
||||
// 上传之前钩子
|
||||
handleBeforeUpload() {
|
||||
if (this.multiple && this.uploadList.length >= this.limit) {
|
||||
this.$Message.warning("最多只能上传" + this.limit + "张图片");
|
||||
|
@ -155,6 +162,7 @@ export default {
|
|||
}
|
||||
return true;
|
||||
},
|
||||
// 返回组件值
|
||||
returnValue() {
|
||||
if (!this.uploadList || this.uploadList.length < 1) {
|
||||
if (!this.multiple) {
|
||||
|
@ -180,6 +188,7 @@ export default {
|
|||
this.$emit("on-change", v);
|
||||
}
|
||||
},
|
||||
// 传入值变化时改变值
|
||||
setData(v, init) {
|
||||
if (typeof v == "string") {
|
||||
// 单张
|
||||
|
|
|
@ -1,352 +0,0 @@
|
|||
<template>
|
||||
<div class="user-choose">
|
||||
<Button @click="userModalVisible=true" :icon="icon">{{text}}</Button>
|
||||
<span @click="clearSelectData" class="clear">清空已选</span>
|
||||
<Collapse simple class="collapse">
|
||||
<Panel name="1">
|
||||
已选择
|
||||
<span class="select-count">{{selectUsers.length}}</span> 人
|
||||
<p slot="content">
|
||||
<Tag
|
||||
v-for="(item, i) in selectUsers"
|
||||
:key="i"
|
||||
:name="item.id"
|
||||
color="default"
|
||||
closable
|
||||
@on-close="handleCancelUser"
|
||||
>{{item.username}}</Tag>
|
||||
</p>
|
||||
</Panel>
|
||||
</Collapse>
|
||||
<Drawer title="选择用户" closable v-model="userModalVisible" width="800" draggable>
|
||||
<Form ref="searchUserForm" :model="searchUserForm" inline :label-width="55">
|
||||
<Form-item label="用户名" prop="username">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchUserForm.username"
|
||||
clearable
|
||||
placeholder="请输入用户名"
|
||||
style="width: 200px"
|
||||
/>
|
||||
</Form-item>
|
||||
<Form-item label="部门" prop="department">
|
||||
<department-choose @on-change="handleSelectDep" style="width: 200px" ref="dep"></department-choose>
|
||||
</Form-item>
|
||||
<Form-item style="margin-left:-35px;" class="br">
|
||||
<Button @click="handleSearchUser" type="primary" icon="ios-search">搜索</Button>
|
||||
<Button @click="handleResetUser">重置</Button>
|
||||
</Form-item>
|
||||
</Form>
|
||||
<Table
|
||||
:loading="userLoading"
|
||||
border
|
||||
:columns="userColumns"
|
||||
:data="userData"
|
||||
:height="height"
|
||||
ref="userTable"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" style="margin: 10px 0;">
|
||||
<Page
|
||||
:current="searchUserForm.pageNumber"
|
||||
:total="totalUser"
|
||||
:page-size="searchUserForm.pageSize"
|
||||
@on-change="changeUserPage"
|
||||
@on-page-size-change="changeUserPageSize"
|
||||
:page-size-opts="[10,20,50]"
|
||||
size="small"
|
||||
show-total
|
||||
show-elevator
|
||||
show-sizer
|
||||
></Page>
|
||||
</Row>
|
||||
<div class="my-drawer-footer">
|
||||
已选择
|
||||
<span class="select-count">{{selectUsers.length}}</span> 人
|
||||
<Button @click="clearSelectData" style="margin-left:10px">清空已选</Button>
|
||||
<Button @click="userModalVisible=false" type="primary" style="margin-left:10px">关闭</Button>
|
||||
</div>
|
||||
</Drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUserListData } from "@/api/index";
|
||||
import departmentChoose from "./department-choose";
|
||||
export default {
|
||||
name: "userChoose",
|
||||
components: {
|
||||
departmentChoose
|
||||
},
|
||||
props: {
|
||||
text: {
|
||||
type: String,
|
||||
default: "选择用户"
|
||||
},
|
||||
icon: {
|
||||
type: String,
|
||||
default: "md-person-add"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//高度 下方已重新计算
|
||||
height: 500,
|
||||
//加载
|
||||
userLoading: true,
|
||||
//显示选择器
|
||||
userModalVisible: false,
|
||||
//选择的对象
|
||||
selectUsers: [],
|
||||
//搜索参数
|
||||
searchUserForm: {
|
||||
username: "",
|
||||
type: "",
|
||||
status: "",
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
order: "desc" // 默认排序方式
|
||||
},
|
||||
userColumns: [
|
||||
{
|
||||
type: "index",
|
||||
width: 60,
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "用户名",
|
||||
key: "username",
|
||||
minWidth: 140,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: "头像",
|
||||
key: "avatar",
|
||||
width: 80,
|
||||
align: "center",
|
||||
render: (h, params) => {
|
||||
return h("Avatar", {
|
||||
props: {
|
||||
src: params.row.avatar
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "所属部门",
|
||||
key: "departmentTitle",
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: "手机",
|
||||
key: "mobile",
|
||||
width: 125,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: "邮箱",
|
||||
key: "email",
|
||||
width: 180,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: "性别",
|
||||
key: "sex",
|
||||
width: 70,
|
||||
align: "center"
|
||||
},
|
||||
{
|
||||
title: "用户类型",
|
||||
key: "type",
|
||||
align: "center",
|
||||
width: 100,
|
||||
render: (h, params) => {
|
||||
let re = "";
|
||||
if (params.row.type == 1) {
|
||||
re = "管理员";
|
||||
} else if (params.row.type == 0) {
|
||||
re = "普通用户";
|
||||
}
|
||||
return h("div", re);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
key: "status",
|
||||
align: "center",
|
||||
width: 120,
|
||||
render: (h, params) => {
|
||||
if (params.row.status == 0) {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "正常启用"
|
||||
}
|
||||
})
|
||||
]);
|
||||
} else if (params.row.status == -1) {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "禁用"
|
||||
}
|
||||
})
|
||||
]);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "创建时间",
|
||||
key: "createTime",
|
||||
sortable: true,
|
||||
sortType: "desc",
|
||||
width: 170
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
width: 130,
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
render: (h, params) => {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "info",
|
||||
size: "small"
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.chooseUser(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
"添加该用户"
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
],
|
||||
userData: [], // 表格数据
|
||||
totalUser: 0 // 总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleSelectDep(v) {
|
||||
this.searchUserForm.departmentId = v;
|
||||
},
|
||||
changeUserPage(v) {
|
||||
this.searchUserForm.pageNumber = v;
|
||||
this.getUserDataList();
|
||||
},
|
||||
changeUserPageSize(v) {
|
||||
this.searchUserForm.pageSize = v;
|
||||
this.getUserDataList();
|
||||
},
|
||||
getUserDataList() {
|
||||
this.userLoading = true;
|
||||
getUserListData(this.searchUserForm).then(res => {
|
||||
this.userLoading = false;
|
||||
if (res.success) {
|
||||
this.userData = res.result.records;
|
||||
this.totalUser = res.result.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSearchUser() {
|
||||
this.searchUserForm.pageNumber = 1;
|
||||
this.searchUserForm.pageSize = 9;
|
||||
this.getUserDataList();
|
||||
},
|
||||
handleResetUser() {
|
||||
this.$refs.searchUserForm.resetFields();
|
||||
this.searchUserForm.pageNumber = 1;
|
||||
this.searchUserForm.pageSize = 9;
|
||||
this.$refs.dep.clearSelect();
|
||||
this.searchUserForm.departmentId = "";
|
||||
// 重新加载数据
|
||||
this.getUserDataList();
|
||||
},
|
||||
setData(v) {
|
||||
this.selectUsers = v;
|
||||
this.$emit("on-change", this.selectUsers);
|
||||
},
|
||||
chooseUser(v) {
|
||||
// 去重
|
||||
let that = this;
|
||||
let flag = true;
|
||||
this.selectUsers.forEach(e => {
|
||||
if (v.id == e.id) {
|
||||
that.$Message.warning("已经添加过啦,请勿重复选择");
|
||||
flag = false;
|
||||
}
|
||||
});
|
||||
if (flag) {
|
||||
let u = {
|
||||
id: v.id,
|
||||
username: v.username
|
||||
};
|
||||
this.selectUsers.push(u);
|
||||
this.$emit("on-change", this.selectUsers);
|
||||
this.$Message.success(`添加用户 ${v.username} 成功`);
|
||||
}
|
||||
},
|
||||
clearSelectData() {
|
||||
this.selectUsers = [];
|
||||
this.$emit("on-change", this.selectUsers);
|
||||
},
|
||||
handleCancelUser(e, id) {
|
||||
// 删除所选用户
|
||||
let newArray = [];
|
||||
this.selectUsers.forEach(e => {
|
||||
if (id != e.id) {
|
||||
newArray.push(e);
|
||||
}
|
||||
});
|
||||
this.selectUsers = newArray;
|
||||
this.$emit("on-change", this.selectUsers);
|
||||
this.$Message.success("删除所选用户成功");
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 计算高度
|
||||
this.height = Number(document.documentElement.clientHeight - 230);
|
||||
this.getUserDataList();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.user-choose {
|
||||
.clear {
|
||||
font-size: 12px;
|
||||
margin-left: 15px;
|
||||
color: #40a9ff;
|
||||
cursor: pointer;
|
||||
}
|
||||
.collapse {
|
||||
font-size: 12px;
|
||||
margin-top: 15px;
|
||||
width: 500px;
|
||||
}
|
||||
.select-count {
|
||||
font-weight: 600;
|
||||
color: #40a9ff;
|
||||
}
|
||||
}
|
||||
.my-drawer-footer {
|
||||
z-index: 10;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
padding: 10px 16px;
|
||||
text-align: right;
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
|
@ -1,17 +1,21 @@
|
|||
<template>
|
||||
<div class="map">
|
||||
<Modal
|
||||
v-model="showMap"
|
||||
title="选择地址"
|
||||
width="800"
|
||||
>
|
||||
<Modal v-model="showMap" title="选择地址" width="800">
|
||||
<div class="address">{{ addrContent.address }}</div>
|
||||
<div id="map-container"></div>
|
||||
|
||||
<div class="search-con">
|
||||
<Input placeholder="输入关键字搜索" id="input-map" v-model="mapSearch"/>
|
||||
<Input
|
||||
placeholder="输入关键字搜索"
|
||||
id="input-map"
|
||||
v-model="mapSearch"
|
||||
/>
|
||||
<ul>
|
||||
<li v-for="(tip, index) in tips" :key="index" @click="selectAddr(tip.location)">
|
||||
<li
|
||||
v-for="(tip, index) in tips"
|
||||
:key="index"
|
||||
@click="selectAddr(tip.location)"
|
||||
>
|
||||
<p>{{ tip.name }}</p>
|
||||
<p>{{ tip.district + tip.address }}</p>
|
||||
</li>
|
||||
|
@ -25,14 +29,14 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import AMapLoader from '@amap/amap-jsapi-loader';
|
||||
import {getRegion} from '@/api/common.js'
|
||||
import AMapLoader from "@amap/amap-jsapi-loader";
|
||||
import { getRegion } from "@/api/common.js";
|
||||
export default {
|
||||
name:'map',
|
||||
name: "map",
|
||||
data() {
|
||||
return {
|
||||
showMap: false, // modal显隐
|
||||
mapSearch:'', // 地图搜索
|
||||
mapSearch: "", // 地图搜索
|
||||
map: null, // 初始化地图
|
||||
autoComplete: null, // 初始化搜索方法
|
||||
geocoder: null, // 初始化地理、坐标转化
|
||||
|
@ -44,31 +48,28 @@ data() {
|
|||
},
|
||||
watch: {
|
||||
mapSearch: function (val) {
|
||||
this.searchOfMap(val)
|
||||
}
|
||||
this.searchOfMap(val);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
ok(){ // 确定选择
|
||||
|
||||
this.loading = true
|
||||
|
||||
const codeObj = {}
|
||||
ok() {
|
||||
// 确定选择
|
||||
this.loading = true;
|
||||
const params = {
|
||||
cityCode: this.addrContent.regeocode.addressComponent.citycode,
|
||||
townName: this.addrContent.regeocode.addressComponent.township
|
||||
}
|
||||
getRegion(params).then(res=>{
|
||||
townName: this.addrContent.regeocode.addressComponent.township,
|
||||
};
|
||||
getRegion(params).then((res) => {
|
||||
if (res.success) {
|
||||
this.addrContent.addr = res.result.name.replace(/,/g," ")
|
||||
this.addrContent.addrId = res.result.id
|
||||
this.loading = false
|
||||
this.addrContent.addr = res.result.name.replace(/,/g, " ");
|
||||
this.addrContent.addrId = res.result.id;
|
||||
this.loading = false;
|
||||
this.showMap = false;
|
||||
this.$emit('getAddress',this.addrContent);
|
||||
|
||||
this.$emit("getAddress", this.addrContent);
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
},
|
||||
// 初始化地图组件
|
||||
init() {
|
||||
AMapLoader.load({
|
||||
key: "b440952723253aa9fe483e698057bf7d", // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||
|
@ -78,17 +79,17 @@ methods: {
|
|||
"AMap.Autocomplete",
|
||||
"AMap.PlaceSearch",
|
||||
"AMap.Geolocation",
|
||||
'AMap.Geocoder'
|
||||
"AMap.Geocoder",
|
||||
], // 需要使用的的插件列表,如比例尺'AMap.Scale'等
|
||||
"AMapUI": { // 是否加载 AMapUI,缺省不加载
|
||||
"version": '1.1', // AMapUI 缺省 1.1
|
||||
"plugins":['misc/PositionPicker'], // 需要加载的 AMapUI ui插件
|
||||
AMapUI: {
|
||||
// 是否加载 AMapUI,缺省不加载
|
||||
version: "1.1", // AMapUI 缺省 1.1
|
||||
plugins: ["misc/PositionPicker"], // 需要加载的 AMapUI ui插件
|
||||
},
|
||||
})
|
||||
.then((AMap) => {
|
||||
}).then((AMap) => {
|
||||
let that = this;
|
||||
this.map = new AMap.Map("map-container", {
|
||||
zoom:12
|
||||
zoom: 12,
|
||||
});
|
||||
that.map.addControl(new AMap.ToolBar());
|
||||
that.map.addControl(new AMap.Autocomplete());
|
||||
|
@ -97,53 +98,52 @@ methods: {
|
|||
|
||||
// 实例化Autocomplete
|
||||
let autoOptions = {
|
||||
city: "全国"
|
||||
city: "全国",
|
||||
};
|
||||
that.autoComplete = new AMap.Autocomplete(autoOptions); // 搜索
|
||||
that.geocoder = new AMap.Geocoder(autoOptions)
|
||||
that.geocoder = new AMap.Geocoder(autoOptions);
|
||||
|
||||
|
||||
that.positionPicker = new AMapUI.PositionPicker({ // 拖拽选点
|
||||
mode: 'dragMap',
|
||||
map:that.map
|
||||
that.positionPicker = new AMapUI.PositionPicker({
|
||||
// 拖拽选点
|
||||
mode: "dragMap",
|
||||
map: that.map,
|
||||
});
|
||||
that.positionPicker.start()
|
||||
that.positionPicker.start();
|
||||
/**
|
||||
*
|
||||
* 所有回显数据,都在positionResult里面
|
||||
* 需要字段可以查找
|
||||
*
|
||||
*/
|
||||
that.positionPicker.on('success', function(positionResult) {
|
||||
|
||||
that.positionPicker.on("success", function (positionResult) {
|
||||
that.addrContent = positionResult;
|
||||
});
|
||||
|
||||
})
|
||||
.catch((e) => {});
|
||||
}).catch((e) => {});
|
||||
},
|
||||
searchOfMap(val) { // 地图搜索
|
||||
searchOfMap(val) {
|
||||
// 地图搜索
|
||||
let that = this;
|
||||
this.autoComplete.search(val, function (status, result) {
|
||||
// 搜索成功时,result即是对应的匹配数据
|
||||
if(status == 'complete' && result.info == 'OK'){
|
||||
if (status == "complete" && result.info == "OK") {
|
||||
that.tips = result.tips;
|
||||
} else {
|
||||
that.tips = []
|
||||
that.tips = [];
|
||||
}
|
||||
});
|
||||
},
|
||||
selectAddr(location) { // 选择坐标
|
||||
selectAddr(location) {
|
||||
// 选择坐标
|
||||
if (!location) {
|
||||
this.$Message.warning('请选择正确点位')
|
||||
this.$Message.warning("请选择正确点位");
|
||||
return false;
|
||||
}
|
||||
const lnglat = [location.lng,location.lat]
|
||||
this.positionPicker.start(lnglat)
|
||||
}
|
||||
const lnglat = [location.lng, location.lat];
|
||||
this.positionPicker.start(lnglat);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init()
|
||||
this.init();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue