Browse Source

2023-3-15

master
guoxing 2 years ago
parent
commit
7cfbdaf947
  1. 8
      mallplusui-web-admin/src/router/index.js
  2. 83
      mallplusui-web-admin/src/views/build/community/components/CommunityDetail.vue
  3. 141
      mallplusui-web-admin/src/views/build/community/index.vue
  4. 8
      mallplusui-web-admin/src/views/build/wuyeCompany/components/WuyeCompanyDetail.vue
  5. 8
      mallplusui-web-admin/src/views/build/wuyeCompany/index.vue
  6. 12
      mallplusui-web-admin/src/views/pms/productCate/components/ProductCateDetail.vue
  7. 76
      mallplusui-web-admin/src/views/pms/productCate/index.vue
  8. 7
      mallplusui-web-admin/src/views/sms/advertise/components/HomeAdvertiseDetail.vue
  9. 18
      mallplusui-web-admin/src/views/sms/advertise/index.vue
  10. 169
      mallplusui-web-admin/src/views/sms/coupon/components/CouponDetail.vue

8
mallplusui-web-admin/src/router/index.js

@ -1269,7 +1269,7 @@ export const constantRouterMap = [{
name: 'addCommunity',
component: () => import('@/views/build/community/add'),
meta: {
title: '添加小区'
title: '添加取货点'
},
hidden: true
},
@ -1278,7 +1278,7 @@ export const constantRouterMap = [{
name: 'updateCommunity',
component: () => import('@/views/build/community/update'),
meta: {
title: '编辑小区'
title: '编辑取货点'
},
hidden: true
},
@ -1560,7 +1560,7 @@ export const constantRouterMap = [{
name: 'addWuyeCompany',
component: () => import('@/views/build/wuyeCompany/add'),
meta: {
title: '添加物业公司'
title: '添加社区'
},
hidden: true
},
@ -1569,7 +1569,7 @@ export const constantRouterMap = [{
name: 'updateWuyeCompany',
component: () => import('@/views/build/wuyeCompany/update'),
meta: {
title: '编辑物业公司'
title: '编辑社区'
},
hidden: true
},

83
mallplusui-web-admin/src/views/build/community/components/CommunityDetail.vue

@ -1,34 +1,38 @@
<template> 
<el-card class="form-container" shadow="never">
<el-form :model="community" :rules="rules" ref="communityFrom" label-width="100px">
<el-form :model="community" :rules="rules" ref="communityFrom" label-width="130px">
<el-form-item label="社区名称:" prop="name">
<el-form-item label="社区名称:" >
<span>{{name}}</span>
</el-form-item>
<el-form-item label="取货点名称:" prop="name">
<el-input v-model="community.name"></el-input>
</el-form-item>
<el-form-item label="社区户数:" prop="counts">
<el-form-item label="取货点电话:" prop="counts">
<el-input v-model="community.counts"></el-input>
</el-form-item>
<el-form-item label="社区地址:" prop="details">
<el-form-item label="取货点地址:" prop="details">
<el-input v-model="community.details"></el-input>
</el-form-item>
<!--
<el-form-item label="地标:" prop="nearbyLandmarks">
<el-input v-model="community.nearbyLandmarks"></el-input>
</el-form-item>
<el-form-item label="电话:" prop="phone">
-->
<!-- <el-form-item label="电话:" prop="phone">
<el-input v-model="community.phone"></el-input>
</el-form-item>
<el-form-item label="照片:" prop="pic">
<single-upload v-model="community.pic"></single-upload>
</el-form-item>
<el-form-item label="地图:" prop="phone">
</el-form-item> -->
<!-- <el-form-item label="地图:" prop="phone">
<input v-model.number="center.lng" />
<input v-model.number="center.lat" />
<!--<label>关键词<input v-model="keyword"></label>
<label>地区<input v-model="location"></label>-->
<!--
<baidu-map ak="15BWmtGEGGkZ8lSPUGah30XZ6IGw57HE"
class="map bm-view"
@ -45,10 +49,10 @@
</bm-copyright>
<bm-city-list anchor="BMAP_ANCHOR_TOP_LEFT" @changeAfter="changeAfters"></bm-city-list>
<bm-marker :position="center" :dragging="false" />
<!-- <bm-local-search :keyword="keyword" :auto-viewport="true" :location="location"></bm-local-search>-->
<bm-local-search :keyword="keyword" :auto-viewport="true" :location="location"></bm-local-search>
</baidu-map>
</el-form-item>
</el-form-item> -->
<el-form-item>
<el-button type="primary" @click="onSubmit('communityFrom')">提交</el-button>
<el-button v-if="!isEdit" @click="resetForm('communityFrom')">重置</el-button>
@ -57,22 +61,35 @@
</el-card>
</template>
<script>
import BaiduMap from 'vue-baidu-map/components/map/Map.vue'
import BmLocalSearch from 'vue-baidu-map/components/search/LocalSearch';
import BmCityList from 'vue-baidu-map/components/controls/CityList';
import BmCopyright from 'vue-baidu-map/components/controls/Copyright';
import BmView from 'vue-baidu-map/components/map/MapView';
import BmMarker from 'vue-baidu-map/components/overlays/Marker'
import {createCommunity, getCommunity, updateCommunity} from '@/api/build/community'
import {
createCommunity,
getCommunity,
updateCommunity
} from '@/api/build/community'
import SingleUpload from '@/components/Upload/singleUpload'
import {formatDate} from '@/utils/date';
import {
formatDate
} from '@/utils/date';
const defaultCommunity = {
name: ''
};
export default {
name: 'CommunityDetail',
components:{SingleUpload,BaiduMap,BmLocalSearch,BmCityList,BmView,BmCopyright,BmMarker},
components: {
SingleUpload,
BaiduMap,
BmLocalSearch,
BmCityList,
BmView,
BmCopyright,
BmMarker
},
props: {
isEdit: {
type: Boolean,
@ -81,18 +98,21 @@
},
data() {
return {
name: "",
community: Object.assign({}, defaultCommunity),
rules: {
name: [
{required: true, message: '请输入名称', trigger: 'blur'},
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
],
logo: [
{required: true, message: '请输入品牌logo', trigger: 'blur'}
],
sort: [
{type: 'number', message: '排序必须为数字'}
],
name: [{
required: true,
message: '请输入取货点名称',
trigger: 'blur'
},
{
min: 2,
max: 140,
message: '长度在 2 到 140 个字符',
trigger: 'blur'
}
]
},
location: '北京',
keyword: '百度',
@ -109,6 +129,9 @@
// window.addEventListener('mousewheel',this.handleScroll,false)
},
created() {
console.log("query>>>",this.$route.query)
this.name = this.$route.query.cname
if (this.isEdit) {
getCommunity(this.$route.query.id).then(response => {
this.community = response.data;
@ -139,7 +162,10 @@
},
syncCenterAndZoom(e) {
const {lng, lat} = e.target.getCenter()
const {
lng,
lat
} = e.target.getCenter()
this.center.lng = lng
this.center.lat = lat
this.zoom = e.target.getZoom()
@ -222,7 +248,4 @@
width: 100%;
height: 400px;
}
</style>

141
mallplusui-web-admin/src/views/build/community/index.vue

@ -4,18 +4,14 @@
<div>
<i class="el-icon-search"></i>
<span>筛选搜索</span>
<el-button
style="float: right"
@click="searchCommunityList()"
type="primary"
size="small">
<el-button style="float: right" @click="searchCommunityList()" type="primary" size="small">
查询结果
</el-button>
</div>
<div style="margin-top: 15px">
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
<el-form-item label="输入搜索:">
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="品牌名称/关键字"></el-input>
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="取货点名称/关键字"></el-input>
</el-form-item>
</el-form>
</div>
@ -23,14 +19,14 @@
<el-card class="operate-container" shadow="never">
<i class="el-icon-tickets"></i>
<span>数据列表</span>
<el-button v-if="cid>0"
class="btn-add" type="success" icon="el-icon-download"
@click="addCommunity()"
<span v-show="name"> - {{name}}</span>
<el-button v-if="cid>0" class="btn-add" type="success" icon="el-icon-download" @click="addCommunity()"
size="mini">
添加
</el-button>
<el-button @click="exportExcel" type="success" size="mini" icon="el-icon-download">导出</el-button>
<!-- <el-button @click="exportExcel" type="success" size="mini" icon="el-icon-download">导出</el-button>
<el-upload
style="display: inline"
@ -40,42 +36,29 @@
:before-upload="beforeUpload"
:action="importExcel">
<el-button size="mini" type="success" :disabled="!enabledUploadBtn" :icon="uploadBtnIcon">导入</el-button>
</el-upload>
</el-upload> -->
</el-card>
<div class="table-container">
<el-table ref="communityTable"
:data="list"
style="width: 100%"
@selection-change="handleSelectionChange"
v-loading="listLoading"
border>
<el-table ref="communityTable" :data="list" style="width: 100%" @selection-change="handleSelectionChange"
v-loading="listLoading" border>
<el-table-column type="selection" width="60" align="center"></el-table-column>
<el-table-column label="小区ID" align="center">
<el-table-column label="取货点ID" align="center" width="100">
<template slot-scope="scope">{{scope.row.id}}</template>
</el-table-column>
<el-table-column label="小区名称" align="center">
<el-table-column label="取货点名称" width="200" align="center">
<template slot-scope="scope">{{scope.row.name}}</template>
</el-table-column>
<el-table-column label="电话" align="center">
<el-table-column label="取货点电话" width="160" align="center">
<template slot-scope="scope">{{scope.row.phone}}</template>
</el-table-column>
<el-table-column label="小区栋数" align="center">
<template slot-scope="scope">{{scope.row.counts}}</template>
</el-table-column>
<el-table-column label="小区地址" align="center">
<el-table-column label="取货点地址" align="center">
<template slot-scope="scope">{{scope.row.address}}</template>
</el-table-column>
<el-table-column label="根据定位获取城市编码" align="center">
<template slot-scope="scope">{{scope.row.cityCode}}</template>
</el-table-column>
<el-table-column label="地标" align="center">
<template slot-scope="scope">{{scope.row.nearbyLandmarks}}</template>
</el-table-column>
<el-table-column label="创建时间" align="center">
<el-table-column label="创建时间" width="200" align="center">
<template slot-scope="scope">{{scope.row.createTime|formatCreateTime}}</template>
</el-table-column>
<!-- <el-table-column label="状态" align="center">
@ -106,14 +89,9 @@
size="mini"
@click="getAttrList4(scope.$index, scope.row)">添加轮播图
</el-button> -->
<el-button
size="mini"
@click="handleUpdate(scope.$index, scope.row)">编辑
<el-button size="mini" @click="handleUpdate(scope.$index, scope.row)">编辑
</el-button>
<el-button
size="mini"
type="danger"
@click="handleDelete(scope.$index, scope.row)">删除
<el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除
</el-button>
</template>
</el-table-column>
@ -123,27 +101,28 @@
</div>
<div class="pagination-container">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total, sizes,prev, pager, next,jumper"
:page-size="listQuery.pageSize"
:page-sizes="[5,10,15]"
:current-page.sync="listQuery.pageNum"
:total="total">
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
layout="total, sizes,prev, pager, next,jumper" :page-size="listQuery.pageSize" :page-sizes="[5,10,15]"
:current-page.sync="listQuery.pageNum" :total="total">
</el-pagination>
</div>
</div>
</template>
<script>
import {fetchList, deleteCommunity,exportExcel} from '@/api/build/community'
import {formatDate} from '@/utils/date';
import {
fetchList,
deleteCommunity,
exportExcel
} from '@/api/build/community'
import {
formatDate
} from '@/utils/date';
export default {
name: 'communityList',
data() {
return {
name: "",
importExcel: process.env.BASE_API + '/building/community/importExcel',
uploadBtnIcon: 'el-icon-upload2',
enabledUploadBtn: true,
@ -151,8 +130,7 @@
btnText: '数据导入',
cid: 0,
operates: [
{
operates: [{
label: "显示品牌",
value: "showCommunity"
},
@ -219,29 +197,62 @@
getAttrList(index, row) {
this.$router.push({path: '/build/floor',query:{cid:row.id,cname:row.name}})
this.$router.push({
path: '/build/floor',
query: {
cid: row.id,
cname: row.name
}
})
},
getAttrList1(index, row) {
this.$router.push({path: '/build/typePrice',query:{cid:row.id,cname:row.name}})
this.$router.push({
path: '/build/typePrice',
query: {
cid: row.id,
cname: row.name
}
})
},
getAttrList2(index, row) {
this.$router.push({path: '/build/wuyePrice',query:{cid:row.id,cname:row.name}})
this.$router.push({
path: '/build/wuyePrice',
query: {
cid: row.id,
cname: row.name
}
})
},
getAttrList3(index, row) {
this.$router.push({path: '/build/notice',query:{cid:row.id,cname:row.name}})
this.$router.push({
path: '/build/notice',
query: {
cid: row.id,
cname: row.name
}
})
},
getAttrList4(index, row) {
this.$router.push({path: '/build/adv',query:{cid:row.id,cname:row.name}})
this.$router.push({
path: '/build/adv',
query: {
cid: row.id,
cname: row.name
}
})
},
getList() {
this.listLoading = true;
console.log("query》》》》", this.$route.query);
this.cid = this.$route.query.cid;
this.name = this.$route.query.cname;
if (this.cid) {
this.listQuery.companyId = this.cid;
}
fetchList(this.listQuery).then(response => {
this.listLoading = false;
console.log("list》》》》", response.data.records);
this.list = response.data.records;
this.total = response.data.total;
this.totalPage = response.data.pages;
@ -252,7 +263,13 @@
this.multipleSelection = val;
},
handleUpdate(index, row) {
this.$router.push({path: '/build/updateCommunity', query: {id: row.id}})
this.$router.push({
path: '/build/updateCommunity',
query: {
id: row.id,
cname:row.companyName
}
})
},
handleDelete(index, row) {
this.$confirm('是否要删除该品牌', '提示', {
@ -333,7 +350,13 @@
});
},
addCommunity() {
this.$router.push({path: '/build/addCommunity',query:{cid:this.$route.query.cid,cname:this.$route.query.cname}});
this.$router.push({
path: '/build/addCommunity',
query: {
cid: this.$route.query.cid,
cname: this.$route.query.cname
}
});
}
}
}
@ -342,5 +365,3 @@
</style>

8
mallplusui-web-admin/src/views/build/wuyeCompany/components/WuyeCompanyDetail.vue

@ -2,7 +2,7 @@
<el-card class="form-container" shadow="never">
<el-form :model="wuyeCompany" :rules="rules" ref="wuyeCompanyFrom" label-width="150px">
<el-form-item label="名称:" prop="name">
<el-form-item label="社区名称:" prop="name">
<el-input v-model="wuyeCompany.name"></el-input>
</el-form-item>
<el-form-item label="联系方式:" prop="phone">
@ -15,10 +15,10 @@
<el-radio :label="3">审核成功</el-radio>
</el-radio-group>
</el-form-item>-->
<el-form-item label="照片:" prop="pic">
<el-form-item label="社区照片:" prop="pic">
<single-upload v-model="wuyeCompany.pic"></single-upload>
</el-form-item>
<el-form-item label="位置:" prop="address">
<el-form-item label="社区位置:" prop="address">
<el-input v-model="wuyeCompany.address"></el-input>
</el-form-item>
@ -54,7 +54,7 @@
wuyeCompany:Object.assign({}, defaultWuyeCompany),
rules: {
name: [
{required: true, message: '请输入品牌名称', trigger: 'blur'},
{required: true, message: '请输入社区名称', trigger: 'blur'},
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
],
logo: [

8
mallplusui-web-admin/src/views/build/wuyeCompany/index.vue

@ -15,7 +15,7 @@
<div style="margin-top: 15px">
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
<el-form-item label="输入搜索:">
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="品牌名称/关键字"></el-input>
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="社区名称/关键字"></el-input>
</el-form-item>
</el-form>
</div>
@ -42,7 +42,7 @@
<el-table-column label="编号" align="center">
<template slot-scope="scope">{{scope.row.id}}</template>
</el-table-column>
<el-table-column label="名称" align="center">
<el-table-column label="社区名称" align="center">
<template slot-scope="scope">{{scope.row.name}}</template>
</el-table-column>
<el-table-column label="联系方式" align="center">
@ -51,10 +51,10 @@
<!-- <el-table-column label="状态" align="center">
<template slot-scope="scope">{{scope.row.status|formatStatus}}</template>
</el-table-column>-->
<el-table-column label="照片" align="center">
<el-table-column label="社区照片" align="center">
<template slot-scope="scope"><img style="height: 80px" :src="scope.row.pic"></template>
</el-table-column>
<el-table-column label="位置" align="center">
<el-table-column label="社区位置" align="center">
<template slot-scope="scope">{{scope.row.address}}</template>
</el-table-column>
<el-table-column label="创建时间" align="center">

12
mallplusui-web-admin/src/views/pms/productCate/components/ProductCateDetail.vue

@ -24,24 +24,24 @@
<el-form-item label="排序:">
<el-input v-model="productCate.sort"></el-input>
</el-form-item>
<el-form-item label="是否显示:">
<!-- <el-form-item label="是否显示:">
<el-radio-group v-model="productCate.showStatus">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-form-item> -->
<el-form-item label="是否显示在导航栏:">
<el-radio-group v-model="productCate.navStatus">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否显示在首页:">
<!-- <el-form-item label="是否显示在首页:">
<el-radio-group v-model="productCate.indexStatus">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-form-item> -->
<el-form-item label="分类图标:">
<single-upload v-model="productCate.icon"></single-upload>
</el-form-item>
@ -87,8 +87,8 @@
navStatus: 0,
parentId: 0,
productUnit: '',
showStatus: 0,
indexStatus:0,
showStatus: 1,
indexStatus:1,
sort: 0,
productAttributeIdList: []
};

76
mallplusui-web-admin/src/views/pms/productCate/index.vue

@ -3,18 +3,12 @@
<el-card class="operate-container" shadow="never">
<i class="el-icon-tickets" style="margin-top: 5px"></i>
<span style="margin-top: 5px">数据列表</span>
<el-button
class="btn-add"
@click="handleAddProductCate()"
size="mini">
<el-button class="btn-add" @click="handleAddProductCate()" size="mini">
添加
</el-button>
</el-card>
<div class="table-container">
<el-table ref="productCateTable"
style="width: 100%"
:data="list"
v-loading="listLoading" border>
<el-table ref="productCateTable" style="width: 100%" :data="list" v-loading="listLoading" border>
<el-table-column label="编号" width="100" align="center">
<template slot-scope="scope">{{scope.row.id}}</template>
</el-table-column>
@ -30,7 +24,7 @@
<el-table-column label="数量单位" width="100" align="center">
<template slot-scope="scope">{{scope.row.productUnit }}</template>
</el-table-column>
<el-table-column label="导航栏" width="100" align="center">
<!-- <el-table-column label="导航栏" width="100" align="center">
<template slot-scope="scope">
<el-switch
@change="handleNavStatusChange(scope.$index, scope.row)"
@ -39,18 +33,15 @@
v-model="scope.row.navStatus">
</el-switch>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column label="是否显示" width="100" align="center">
<template slot-scope="scope">
<el-switch
@change="handleShowStatusChange(scope.$index, scope.row)"
:active-value="1"
:inactive-value="0"
v-model="scope.row.showStatus">
<el-switch @change="handleShowStatusChange(scope.$index, scope.row)" :active-value="1"
:inactive-value="0" v-model="scope.row.showStatus">
</el-switch>
</template>
</el-table-column>
<el-table-column label="是否首页显示" width="100" align="center">
<!-- <el-table-column label="是否首页显示" width="100" align="center">
<template slot-scope="scope">
<el-switch
@change="handleIndexStatusChange(scope.$index, scope.row)"
@ -59,55 +50,48 @@
v-model="scope.row.indexStatus">
</el-switch>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column label="排序" width="100" align="center">
<template slot-scope="scope">{{scope.row.sort }}</template>
</el-table-column>
<el-table-column label="设置" width="200" align="center">
<template slot-scope="scope">
<el-button
size="mini"
:disabled="scope.row.level | disableNextLevel"
<el-button size="mini" :disabled="scope.row.level | disableNextLevel"
@click="handleShowNextLevel(scope.$index, scope.row)">查看下级
</el-button>
<el-button
<!-- <el-button
size="mini"
@click="handleTransferProduct(scope.$index, scope.row)">转移商品
</el-button>
</el-button> -->
</template>
</el-table-column>
<el-table-column label="操作" width="200" align="center">
<template slot-scope="scope">
<el-button
size="mini"
@click="handleUpdate(scope.$index, scope.row)">编辑
<el-button size="mini" @click="handleUpdate(scope.$index, scope.row)">编辑
</el-button>
<el-button
size="mini"
type="danger"
@click="handleDelete(scope.$index, scope.row)">删除
<el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="pagination-container">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total, sizes,prev, pager, next,jumper"
:page-size="listQuery.pageSize"
:page-sizes="[5,10,15]"
:current-page.sync="listQuery.pageNum"
:total="total">
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
layout="total, sizes,prev, pager, next,jumper" :page-size="listQuery.pageSize" :page-sizes="[5,10,15]"
:current-page.sync="listQuery.pageNum" :total="total">
</el-pagination>
</div>
</div>
</template>
<script>
import {fetchList,deleteProductCate,updateShowStatus,updateNavStatus,updateIndexStatus} from '@/api/productCate'
import {
fetchList,
deleteProductCate,
updateShowStatus,
updateNavStatus,
updateIndexStatus
} from '@/api/productCate'
export default {
name: "productCateList",
@ -204,13 +188,23 @@
});
},
handleShowNextLevel(index, row) {
this.$router.push({path: '/pms/productCate', query: {parentId: row.id}})
this.$router.push({
path: '/pms/productCate',
query: {
parentId: row.id
}
})
},
handleTransferProduct(index, row) {
console.log('handleAddProductCate');
},
handleUpdate(index, row) {
this.$router.push({path:'/pms/updateProductCate',query:{id:row.id}});
this.$router.push({
path: '/pms/updateProductCate',
query: {
id: row.id
}
});
},
handleDelete(index, row) {
this.$confirm('是否要删除该品牌', '提示', {

7
mallplusui-web-admin/src/views/sms/advertise/components/HomeAdvertiseDetail.vue

@ -9,14 +9,15 @@
<el-input v-model="homeAdvertise.name" class="input-width"></el-input>
</el-form-item>
<el-form-item label="广告位置:">
<el-select v-model="homeAdvertise.type">
<!-- <el-select v-model="homeAdvertise.type">
<el-option
v-for="type in typeOptions"
:key="type.value"
:label="type.label"
:value="type.value">
</el-option>
</el-select>
</el-select> -->
<span>Android首页轮播</span>
</el-form-item>
<el-form-item label="开始时间:" prop="startTime">
<el-date-picker
@ -84,7 +85,7 @@
];
const defaultHomeAdvertise = {
name: null,
type: 1,
type: 2,
pic: null,
startTime: null,
endTime: null,

18
mallplusui-web-admin/src/views/sms/advertise/index.vue

@ -23,7 +23,7 @@
<el-form-item label="广告名称:">
<el-input v-model="listQuery.name" class="input-width" placeholder="广告名称"></el-input>
</el-form-item>
<el-form-item label="广告位置:">
<!-- <el-form-item label="广告位置:">
<el-select v-model="listQuery.type" placeholder="全部" clearable class="input-width">
<el-option v-for="item in typeOptions"
:key="item.value"
@ -31,7 +31,7 @@
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item label="到期时间:">
<el-date-picker
class="input-width"
@ -62,13 +62,13 @@
<el-table-column label="广告名称" align="center">
<template slot-scope="scope">{{scope.row.name}}</template>
</el-table-column>
<el-table-column label="广告位置" width="120" align="center">
<!-- <el-table-column label="广告位置" width="120" align="center">
<template slot-scope="scope">{{scope.row.type | formatType}}</template>
</el-table-column>
<el-table-column label="广告图片" width="120" align="center">
</el-table-column> -->
<el-table-column label="广告图片" width="250" align="center">
<template slot-scope="scope"><img style="height: 80px" :src="scope.row.pic"></template>
</el-table-column>
<el-table-column label="时间" width="220" align="center">
<el-table-column label="时间" width="320" align="center">
<template slot-scope="scope">
<p>开始时间{{scope.row.startTime | formatTime}}</p>
<p>到期时间{{scope.row.endTime | formatTime}}</p>
@ -84,13 +84,13 @@
</el-switch>
</template>
</el-table-column>
<el-table-column label="点击次数" width="120" align="center">
<!-- <el-table-column label="点击次数" width="120" align="center">
<template slot-scope="scope">{{scope.row.clickCount}}</template>
</el-table-column>
<el-table-column label="生成订单" width="120" align="center">
<template slot-scope="scope">{{scope.row.orderCount}}</template>
</el-table-column>
<el-table-column label="操作" width="120" align="center">
</el-table-column> -->
<el-table-column label="操作" width="180" align="center">
<template slot-scope="scope">
<el-button size="mini"
type="text"

169
mallplusui-web-admin/src/views/sms/coupon/components/CouponDetail.vue

@ -1,33 +1,22 @@
<template> 
<el-card class="form-container" shadow="never">
<el-form :model="coupon"
:rules="rules"
ref="couponFrom"
label-width="150px"
size="small">
<el-form :model="coupon" :rules="rules" ref="couponFrom" label-width="150px" size="small">
<el-form-item label="优惠券类型:">
<el-select v-model="coupon.type">
<el-option v-for='type in typeOptions' :key='type.value' :label='type.label' :value='type.value'></el-option>
</el-select>
<span>全场赠券</span>
</el-form-item>
<el-form-item label="优惠券名称:" prop="name">
<el-input v-model="coupon.name" class="input-width"></el-input>
</el-form-item>
<el-form-item label="适用平台:">
<el-select v-model="coupon.platform">
<el-option
v-for="item in platformOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<span>全平台</span>
</el-form-item>
<el-form-item label="总发行量:" prop="publishCount">
<el-input v-model.number="coupon.publishCount" placeholder="只能输入正整数" class="input-width"></el-input>
</el-form-item>
<el-form-item label="面额:" prop="amount">
<el-input v-model="coupon.amount" @keyup.native="coupon.amount = UpNumber(coupon.amount,2)" placeholder="面值只能是数值,限2位小数" class="input-width">
<el-input v-model="coupon.amount" @keyup.native="coupon.amount = UpNumber(coupon.amount,2)"
placeholder="面值只能是数值,限2位小数" class="input-width">
<template slot="append"></template>
</el-input>
</el-form-item>
@ -43,9 +32,11 @@
</el-input>
</el-form-item>
<el-form-item label="有效期:" >
<el-date-picker type="date" placeholder="选择日期" v-model="coupon.startTime" style="width: 150px"></el-date-picker>
<el-date-picker type="date" placeholder="选择日期" v-model="coupon.startTime" style="width: 150px">
</el-date-picker>
<span style="margin-left: 20px;margin-right: 20px"></span>
<el-date-picker type="date" placeholder="选择日期" v-model="coupon.endTime" style="width: 150px"></el-date-picker>
<el-date-picker type="date" placeholder="选择日期" v-model="coupon.endTime" style="width: 150px">
</el-date-picker>
</el-form-item>
<el-form-item label="可使用商品:">
<el-radio-group v-model="coupon.useType">
@ -55,24 +46,18 @@
</el-radio-group>
</el-form-item>
<el-form-item v-show="coupon.useType===1">
<el-cascader
clearable
placeholder="请选择分类名称"
v-model="selectProductCate"
:options="productCateOptions">
<el-cascader clearable placeholder="请选择分类名称" v-model="selectProductCate" :options="productCateOptions">
</el-cascader>
<el-button @click="handleAddProductCategoryRelation()">添加</el-button>
<el-table ref="productCateRelationTable"
:data="coupon.productCategoryRelationList"
style="width: 100%;margin-top: 20px"
border>
<el-table ref="productCateRelationTable" :data="coupon.productCategoryRelationList"
style="width: 100%;margin-top: 20px" border>
<el-table-column label="分类名称" align="center">
<template slot-scope="scope">{{scope.row.parentCategoryName}}>{{scope.row.productCategoryName}}</template>
<template
slot-scope="scope">{{scope.row.parentCategoryName}}>{{scope.row.productCategoryName}}</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button size="mini"
type="text"
<el-button size="mini" type="text"
@click="handleDeleteProductCateRelation(scope.$index, scope.row)">删除
</el-button>
</template>
@ -80,28 +65,17 @@
</el-table>
</el-form-item>
<el-form-item v-show="coupon.useType===2">
<el-select
v-model="selectProduct"
filterable
remote
reserve-keyword
placeholder="商品名称/商品货号"
:remote-method="searchProductMethod"
:loading="selectProductLoading">
<el-option
v-for="item in selectProductOptions"
:key="item.productId"
:label="item.productName"
<el-select v-model="selectProduct" filterable remote reserve-keyword placeholder="商品名称/商品货号"
:remote-method="searchProductMethod" :loading="selectProductLoading">
<el-option v-for="item in selectProductOptions" :key="item.productId" :label="item.productName"
:value="item.productId">
<span style="float: left">{{ item.productName }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">NO.{{ item.productSn }}</span>
</el-option>
</el-select>
<el-button @click="handleAddProductRelation()">添加</el-button>
<el-table ref="productRelationTable"
:data="coupon.productRelationList"
style="width: 100%;margin-top: 20px"
border>
<el-table ref="productRelationTable" :data="coupon.productRelationList"
style="width: 100%;margin-top: 20px" border>
<el-table-column label="商品名称" align="center">
<template slot-scope="scope">{{scope.row.productName}}</template>
</el-table-column>
@ -110,8 +84,7 @@
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button size="mini"
type="text"
<el-button size="mini" type="text"
@click="handleDeleteProductRelation(scope.$index, scope.row)">删除
</el-button>
</template>
@ -119,12 +92,7 @@
</el-table>
</el-form-item>
<el-form-item label="备注:">
<el-input
class="input-width"
type="textarea"
:rows="5"
placeholder="请输入内容"
v-model="coupon.note">
<el-input class="input-width" type="textarea" :rows="5" placeholder="请输入内容" v-model="coupon.note">
</el-input>
</el-form-item>
<el-form-item>
@ -135,9 +103,17 @@
</el-card>
</template>
<script>
import {createCoupon,getCoupon,updateCoupon} from '@/api/coupon';
import {fetchSimpleList as fetchProductList} from '@/api/product';
import {fetchListWithChildren} from '@/api/productCate'
import {
createCoupon,
getCoupon,
updateCoupon
} from '@/api/coupon';
import {
fetchSimpleList as fetchProductList
} from '@/api/product';
import {
fetchListWithChildren
} from '@/api/productCate'
const defaultCoupon = {
type: 0,
name: null,
@ -153,8 +129,7 @@
productRelationList: [],
productCategoryRelationList: []
};
const defaultTypeOptions = [
{
const defaultTypeOptions = [{
label: '全场赠券',
value: 0
},
@ -171,8 +146,7 @@
value: 3
}
];
const defaultPlatformOptions = [
{
const defaultPlatformOptions = [{
label: '全平台',
value: 0
},
@ -216,20 +190,36 @@
typeOptions: Object.assign({}, defaultTypeOptions),
platformOptions: Object.assign({}, defaultPlatformOptions),
rules: {
name: [
{required: true, message: '请输入优惠券名称', trigger: 'blur'},
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
],
publishCount: [
{type: 'number',required: true, message: '只能输入正整数', trigger: 'blur'}
name: [{
required: true,
message: '请输入优惠券名称',
trigger: 'blur'
},
{
min: 2,
max: 140,
message: '长度在 2 到 140 个字符',
trigger: 'blur'
}
],
// amount: [
// // {type: 'number',required: true,message: '0.01-100002',trigger: 'blur'}
// // { required: true, validator: validatePrice, trigger: "blur" },
// ],
minPoint: [
{type: 'number',required: true,message: '只能输入正整数',trigger: 'blur'}
]
publishCount: [{
type: 'number',
required: true,
message: '只能输入正整数',
trigger: 'blur'
}],
amount: [{
required: true,
message: '面值只能是数值,0.01-10000,限2位小数',
trigger: 'blur'
}],
minPoint: [{
type: 'number',
required: true,
message: '只能输入正整数',
trigger: 'blur'
}]
},
selectProduct: null,
selectProductLoading: false,
@ -312,13 +302,19 @@
searchProductMethod(query) {
if (query !== '') {
this.loading = true;
fetchProductList({keyword:query}).then(response=>{
fetchProductList({
keyword: query
}).then(response => {
this.loading = false;
let productList = response.data;
this.selectProductOptions = [];
for (let i = 0; i < productList.length; i++) {
let item = productList[i];
this.selectProductOptions.push({productId:item.id,productName:item.name,productSn:item.productSn});
this.selectProductOptions.push({
productId: item.id,
productName: item.name,
productSn: item.productSn
});
}
});
} else {
@ -369,10 +365,17 @@
let children = [];
if (list[i].children != null && list[i].children.length > 0) {
for (let j = 0; j < list[i].children.length; j++) {
children.push({label: list[i].children[j].name, value: list[i].children[j].id});
children.push({
label: list[i].children[j].name,
value: list[i].children[j].id
});
}
}
this.productCateOptions.push({label: list[i].name, value: list[i].id, children: children});
this.productCateOptions.push({
label: list[i].name,
value: list[i].id,
children: children
});
}
});
},
@ -389,7 +392,11 @@
}
}
}
return {productCategoryId: ids[1], productCategoryName: name, parentCategoryName: parentName};
return {
productCategoryId: ids[1],
productCategoryName: name,
parentCategoryName: parentName
};
}
}
}
@ -399,5 +406,3 @@
width: 60%;
}
</style>

Loading…
Cancel
Save