2023-3-15
This commit is contained in:
@@ -1269,7 +1269,7 @@ export const constantRouterMap = [{
|
|||||||
name: 'addCommunity',
|
name: 'addCommunity',
|
||||||
component: () => import('@/views/build/community/add'),
|
component: () => import('@/views/build/community/add'),
|
||||||
meta: {
|
meta: {
|
||||||
title: '添加小区'
|
title: '添加取货点'
|
||||||
},
|
},
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
@@ -1278,7 +1278,7 @@ export const constantRouterMap = [{
|
|||||||
name: 'updateCommunity',
|
name: 'updateCommunity',
|
||||||
component: () => import('@/views/build/community/update'),
|
component: () => import('@/views/build/community/update'),
|
||||||
meta: {
|
meta: {
|
||||||
title: '编辑小区'
|
title: '编辑取货点'
|
||||||
},
|
},
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
@@ -1560,7 +1560,7 @@ export const constantRouterMap = [{
|
|||||||
name: 'addWuyeCompany',
|
name: 'addWuyeCompany',
|
||||||
component: () => import('@/views/build/wuyeCompany/add'),
|
component: () => import('@/views/build/wuyeCompany/add'),
|
||||||
meta: {
|
meta: {
|
||||||
title: '添加物业公司'
|
title: '添加社区'
|
||||||
},
|
},
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
@@ -1569,7 +1569,7 @@ export const constantRouterMap = [{
|
|||||||
name: 'updateWuyeCompany',
|
name: 'updateWuyeCompany',
|
||||||
component: () => import('@/views/build/wuyeCompany/update'),
|
component: () => import('@/views/build/wuyeCompany/update'),
|
||||||
meta: {
|
meta: {
|
||||||
title: '编辑物业公司'
|
title: '编辑社区'
|
||||||
},
|
},
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,34 +1,38 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-card class="form-container" shadow="never">
|
<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-input v-model="community.name"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="社区户数:" prop="counts">
|
<el-form-item label="取货点电话:" prop="counts">
|
||||||
<el-input v-model="community.counts"></el-input>
|
<el-input v-model="community.counts"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="社区地址:" prop="details">
|
<el-form-item label="取货点地址:" prop="details">
|
||||||
<el-input v-model="community.details"></el-input>
|
<el-input v-model="community.details"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!--
|
||||||
<el-form-item label="地标:" prop="nearbyLandmarks">
|
<el-form-item label="地标:" prop="nearbyLandmarks">
|
||||||
<el-input v-model="community.nearbyLandmarks"></el-input>
|
<el-input v-model="community.nearbyLandmarks"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
-->
|
||||||
<el-form-item label="电话:" prop="phone">
|
<!-- <el-form-item label="电话:" prop="phone">
|
||||||
<el-input v-model="community.phone"></el-input>
|
<el-input v-model="community.phone"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="照片:" prop="pic">
|
<el-form-item label="照片:" prop="pic">
|
||||||
<single-upload v-model="community.pic"></single-upload>
|
<single-upload v-model="community.pic"></single-upload>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item label="地图:" prop="phone">
|
<!-- <el-form-item label="地图:" prop="phone">
|
||||||
|
|
||||||
<input v-model.number="center.lng" />
|
<input v-model.number="center.lng" />
|
||||||
<input v-model.number="center.lat" />
|
<input v-model.number="center.lat" />
|
||||||
<!--<label>关键词:<input v-model="keyword"></label>
|
<!--<label>关键词:<input v-model="keyword"></label>
|
||||||
<label>地区:<input v-model="location"></label>-->
|
<label>地区:<input v-model="location"></label>-->
|
||||||
|
<!--
|
||||||
<baidu-map ak="15BWmtGEGGkZ8lSPUGah30XZ6IGw57HE"
|
<baidu-map ak="15BWmtGEGGkZ8lSPUGah30XZ6IGw57HE"
|
||||||
class="map bm-view"
|
class="map bm-view"
|
||||||
|
|
||||||
@@ -45,10 +49,10 @@
|
|||||||
</bm-copyright>
|
</bm-copyright>
|
||||||
<bm-city-list anchor="BMAP_ANCHOR_TOP_LEFT" @changeAfter="changeAfters"></bm-city-list>
|
<bm-city-list anchor="BMAP_ANCHOR_TOP_LEFT" @changeAfter="changeAfters"></bm-city-list>
|
||||||
<bm-marker :position="center" :dragging="false" />
|
<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>
|
</baidu-map>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="onSubmit('communityFrom')">提交</el-button>
|
<el-button type="primary" @click="onSubmit('communityFrom')">提交</el-button>
|
||||||
<el-button v-if="!isEdit" @click="resetForm('communityFrom')">重置</el-button>
|
<el-button v-if="!isEdit" @click="resetForm('communityFrom')">重置</el-button>
|
||||||
@@ -57,22 +61,35 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import BaiduMap from 'vue-baidu-map/components/map/Map.vue'
|
import BaiduMap from 'vue-baidu-map/components/map/Map.vue'
|
||||||
import BmLocalSearch from 'vue-baidu-map/components/search/LocalSearch';
|
import BmLocalSearch from 'vue-baidu-map/components/search/LocalSearch';
|
||||||
import BmCityList from 'vue-baidu-map/components/controls/CityList';
|
import BmCityList from 'vue-baidu-map/components/controls/CityList';
|
||||||
import BmCopyright from 'vue-baidu-map/components/controls/Copyright';
|
import BmCopyright from 'vue-baidu-map/components/controls/Copyright';
|
||||||
import BmView from 'vue-baidu-map/components/map/MapView';
|
import BmView from 'vue-baidu-map/components/map/MapView';
|
||||||
import BmMarker from 'vue-baidu-map/components/overlays/Marker'
|
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 SingleUpload from '@/components/Upload/singleUpload'
|
||||||
import {formatDate} from '@/utils/date';
|
import {
|
||||||
const defaultCommunity={
|
formatDate
|
||||||
|
} from '@/utils/date';
|
||||||
|
const defaultCommunity = {
|
||||||
name: ''
|
name: ''
|
||||||
};
|
};
|
||||||
export default {
|
export default {
|
||||||
name: 'CommunityDetail',
|
name: 'CommunityDetail',
|
||||||
components:{SingleUpload,BaiduMap,BmLocalSearch,BmCityList,BmView,BmCopyright,BmMarker},
|
components: {
|
||||||
|
SingleUpload,
|
||||||
|
BaiduMap,
|
||||||
|
BmLocalSearch,
|
||||||
|
BmCityList,
|
||||||
|
BmView,
|
||||||
|
BmCopyright,
|
||||||
|
BmMarker
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
isEdit: {
|
isEdit: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -81,18 +98,21 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
community:Object.assign({}, defaultCommunity),
|
name: "",
|
||||||
|
community: Object.assign({}, defaultCommunity),
|
||||||
rules: {
|
rules: {
|
||||||
name: [
|
name: [{
|
||||||
{required: true, message: '请输入名称', trigger: 'blur'},
|
required: true,
|
||||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
message: '请输入取货点名称',
|
||||||
],
|
trigger: 'blur'
|
||||||
logo: [
|
},
|
||||||
{required: true, message: '请输入品牌logo', trigger: 'blur'}
|
{
|
||||||
],
|
min: 2,
|
||||||
sort: [
|
max: 140,
|
||||||
{type: 'number', message: '排序必须为数字'}
|
message: '长度在 2 到 140 个字符',
|
||||||
],
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
location: '北京',
|
location: '北京',
|
||||||
keyword: '百度',
|
keyword: '百度',
|
||||||
@@ -103,43 +123,49 @@
|
|||||||
zoom: 15
|
zoom: 15
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted (){
|
mounted() {
|
||||||
|
|
||||||
// this.handleScroll()
|
// this.handleScroll()
|
||||||
// window.addEventListener('mousewheel',this.handleScroll,false)
|
// window.addEventListener('mousewheel',this.handleScroll,false)
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
console.log("query>>>",this.$route.query)
|
||||||
|
this.name = this.$route.query.cname
|
||||||
|
|
||||||
if (this.isEdit) {
|
if (this.isEdit) {
|
||||||
getCommunity(this.$route.query.id).then(response => {
|
getCommunity(this.$route.query.id).then(response => {
|
||||||
this.community = response.data;
|
this.community = response.data;
|
||||||
if(this.community.latitude){
|
if (this.community.latitude) {
|
||||||
this.center.lat=this.community.latitude;
|
this.center.lat = this.community.latitude;
|
||||||
}
|
}
|
||||||
if(this.community.longitude){
|
if (this.community.longitude) {
|
||||||
this.center.lng=this.community.longitude;
|
this.center.lng = this.community.longitude;
|
||||||
}
|
}
|
||||||
if(this.community.city){
|
if (this.community.city) {
|
||||||
this.location=this.community.city;
|
this.location = this.community.city;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
this.community = Object.assign({},defaultCommunity);
|
this.community = Object.assign({}, defaultCommunity);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
changeAfters(e){
|
changeAfters(e) {
|
||||||
console.log('123')
|
console.log('123')
|
||||||
console.log(e)
|
console.log(e)
|
||||||
},
|
},
|
||||||
handleScroll (e) {
|
handleScroll(e) {
|
||||||
//修复body高度为100%,百度地图鼠标滚轮滚动产生位移问题,以及全景鼠标hover后未显示全景信息问题
|
//修复body高度为100%,百度地图鼠标滚轮滚动产生位移问题,以及全景鼠标hover后未显示全景信息问题
|
||||||
document.body.scrollTop=0
|
document.body.scrollTop = 0
|
||||||
document.documentElement.scrollTop =0
|
document.documentElement.scrollTop = 0
|
||||||
},
|
},
|
||||||
syncCenterAndZoom (e) {
|
syncCenterAndZoom(e) {
|
||||||
|
|
||||||
const {lng, lat} = e.target.getCenter()
|
const {
|
||||||
|
lng,
|
||||||
|
lat
|
||||||
|
} = e.target.getCenter()
|
||||||
this.center.lng = lng
|
this.center.lng = lng
|
||||||
this.center.lat = lat
|
this.center.lat = lat
|
||||||
this.zoom = e.target.getZoom()
|
this.zoom = e.target.getZoom()
|
||||||
@@ -152,44 +178,44 @@
|
|||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.community.companyId=this.$route.query.cid
|
this.community.companyId = this.$route.query.cid
|
||||||
this.community.latitude=this.center.lat;
|
this.community.latitude = this.center.lat;
|
||||||
this.community.longitude=this.center.lng;
|
this.community.longitude = this.center.lng;
|
||||||
if (this.isEdit) {
|
if (this.isEdit) {
|
||||||
updateCommunity(this.$route.query.id, this.community).then(response => {
|
updateCommunity(this.$route.query.id, this.community).then(response => {
|
||||||
if(response.code==200){
|
if (response.code == 200) {
|
||||||
this.$refs[formName].resetFields();
|
this.$refs[formName].resetFields();
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '修改成功',
|
message: '修改成功',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
duration:1000
|
duration: 1000
|
||||||
});
|
});
|
||||||
this.$router.back();
|
this.$router.back();
|
||||||
}else{
|
} else {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: response.msg,
|
message: response.msg,
|
||||||
type: 'error',
|
type: 'error',
|
||||||
duration:1000
|
duration: 1000
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
createCommunity(this.community).then(response => {
|
createCommunity(this.community).then(response => {
|
||||||
if(response.code==200){
|
if (response.code == 200) {
|
||||||
this.$refs[formName].resetFields();
|
this.$refs[formName].resetFields();
|
||||||
this.community = Object.assign({},defaultCommunity);
|
this.community = Object.assign({}, defaultCommunity);
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '提交成功',
|
message: '提交成功',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
duration:1000
|
duration: 1000
|
||||||
});
|
});
|
||||||
this.$router.back();
|
this.$router.back();
|
||||||
}else{
|
} else {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: response.msg,
|
message: response.msg,
|
||||||
type: 'error',
|
type: 'error',
|
||||||
duration:1000
|
duration: 1000
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,7 +227,7 @@
|
|||||||
this.$message({
|
this.$message({
|
||||||
message: '验证失败',
|
message: '验证失败',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
duration:1000
|
duration: 1000
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -209,7 +235,7 @@
|
|||||||
},
|
},
|
||||||
resetForm(formName) {
|
resetForm(formName) {
|
||||||
this.$refs[formName].resetFields();
|
this.$refs[formName].resetFields();
|
||||||
this.community = Object.assign({},defaultCommunity);
|
this.community = Object.assign({}, defaultCommunity);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
@@ -222,7 +248,4 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 400px;
|
height: 400px;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,18 +4,14 @@
|
|||||||
<div>
|
<div>
|
||||||
<i class="el-icon-search"></i>
|
<i class="el-icon-search"></i>
|
||||||
<span>筛选搜索</span>
|
<span>筛选搜索</span>
|
||||||
<el-button
|
<el-button style="float: right" @click="searchCommunityList()" type="primary" size="small">
|
||||||
style="float: right"
|
|
||||||
@click="searchCommunityList()"
|
|
||||||
type="primary"
|
|
||||||
size="small">
|
|
||||||
查询结果
|
查询结果
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 15px">
|
<div style="margin-top: 15px">
|
||||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||||
<el-form-item label="输入搜索:">
|
<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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -23,14 +19,14 @@
|
|||||||
<el-card class="operate-container" shadow="never">
|
<el-card class="operate-container" shadow="never">
|
||||||
<i class="el-icon-tickets"></i>
|
<i class="el-icon-tickets"></i>
|
||||||
<span>数据列表</span>
|
<span>数据列表</span>
|
||||||
<el-button v-if="cid>0"
|
<span v-show="name"> - {{name}}</span>
|
||||||
class="btn-add" type="success" icon="el-icon-download"
|
|
||||||
@click="addCommunity()"
|
<el-button v-if="cid>0" class="btn-add" type="success" icon="el-icon-download" @click="addCommunity()"
|
||||||
size="mini">
|
size="mini">
|
||||||
添加
|
添加
|
||||||
</el-button>
|
</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
|
<el-upload
|
||||||
style="display: inline"
|
style="display: inline"
|
||||||
@@ -40,42 +36,29 @@
|
|||||||
:before-upload="beforeUpload"
|
:before-upload="beforeUpload"
|
||||||
:action="importExcel">
|
:action="importExcel">
|
||||||
<el-button size="mini" type="success" :disabled="!enabledUploadBtn" :icon="uploadBtnIcon">导入</el-button>
|
<el-button size="mini" type="success" :disabled="!enabledUploadBtn" :icon="uploadBtnIcon">导入</el-button>
|
||||||
</el-upload>
|
</el-upload> -->
|
||||||
|
|
||||||
</el-card>
|
</el-card>
|
||||||
<div class="table-container">
|
<div class="table-container">
|
||||||
<el-table ref="communityTable"
|
<el-table ref="communityTable" :data="list" style="width: 100%" @selection-change="handleSelectionChange"
|
||||||
:data="list"
|
v-loading="listLoading" border>
|
||||||
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 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>
|
<template slot-scope="scope">{{scope.row.id}}</template>
|
||||||
</el-table-column>
|
</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>
|
<template slot-scope="scope">{{scope.row.name}}</template>
|
||||||
</el-table-column>
|
</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>
|
<template slot-scope="scope">{{scope.row.phone}}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="小区栋数" align="center">
|
<el-table-column label="取货点地址" align="center">
|
||||||
<template slot-scope="scope">{{scope.row.counts}}</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="小区地址" align="center">
|
|
||||||
<template slot-scope="scope">{{scope.row.address}}</template>
|
<template slot-scope="scope">{{scope.row.address}}</template>
|
||||||
</el-table-column>
|
</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>
|
<template slot-scope="scope">{{scope.row.createTime|formatCreateTime}}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column label="状态" align="center">
|
<!-- <el-table-column label="状态" align="center">
|
||||||
@@ -90,15 +73,15 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="getAttrList(scope.$index, scope.row)">添加楼
|
@click="getAttrList(scope.$index, scope.row)">添加楼
|
||||||
</el-button> -->
|
</el-button> -->
|
||||||
<!-- <el-button
|
<!-- <el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="getAttrList1(scope.$index, scope.row)">添加缴费规则
|
@click="getAttrList1(scope.$index, scope.row)">添加缴费规则
|
||||||
</el-button> -->
|
</el-button> -->
|
||||||
<!-- <el-button
|
<!-- <el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="getAttrList2(scope.$index, scope.row)">添加缴费记录
|
@click="getAttrList2(scope.$index, scope.row)">添加缴费记录
|
||||||
</el-button> -->
|
</el-button> -->
|
||||||
<!-- <el-button
|
<!-- <el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="getAttrList3(scope.$index, scope.row)">添加通知
|
@click="getAttrList3(scope.$index, scope.row)">添加通知
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -106,14 +89,9 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="getAttrList4(scope.$index, scope.row)">添加轮播图
|
@click="getAttrList4(scope.$index, scope.row)">添加轮播图
|
||||||
</el-button> -->
|
</el-button> -->
|
||||||
<el-button
|
<el-button size="mini" @click="handleUpdate(scope.$index, scope.row)">编辑
|
||||||
size="mini"
|
|
||||||
@click="handleUpdate(scope.$index, scope.row)">编辑
|
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除
|
||||||
size="mini"
|
|
||||||
type="danger"
|
|
||||||
@click="handleDelete(scope.$index, scope.row)">删除
|
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -123,36 +101,36 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="pagination-container">
|
<div class="pagination-container">
|
||||||
<el-pagination
|
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
|
||||||
background
|
layout="total, sizes,prev, pager, next,jumper" :page-size="listQuery.pageSize" :page-sizes="[5,10,15]"
|
||||||
@size-change="handleSizeChange"
|
:current-page.sync="listQuery.pageNum" :total="total">
|
||||||
@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>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {fetchList, deleteCommunity,exportExcel} from '@/api/build/community'
|
import {
|
||||||
import {formatDate} from '@/utils/date';
|
fetchList,
|
||||||
|
deleteCommunity,
|
||||||
|
exportExcel
|
||||||
|
} from '@/api/build/community'
|
||||||
|
import {
|
||||||
|
formatDate
|
||||||
|
} from '@/utils/date';
|
||||||
export default {
|
export default {
|
||||||
name: 'communityList',
|
name: 'communityList',
|
||||||
data() {
|
data() {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
importExcel: process.env.BASE_API+'/building/community/importExcel',
|
name: "",
|
||||||
uploadBtnIcon:'el-icon-upload2',
|
importExcel: process.env.BASE_API + '/building/community/importExcel',
|
||||||
enabledUploadBtn:true,
|
uploadBtnIcon: 'el-icon-upload2',
|
||||||
dialogVisible:false,
|
enabledUploadBtn: true,
|
||||||
btnText:'数据导入',
|
dialogVisible: false,
|
||||||
|
btnText: '数据导入',
|
||||||
|
|
||||||
cid:0,
|
cid: 0,
|
||||||
operates: [
|
operates: [{
|
||||||
{
|
|
||||||
label: "显示品牌",
|
label: "显示品牌",
|
||||||
value: "showCommunity"
|
value: "showCommunity"
|
||||||
},
|
},
|
||||||
@@ -193,55 +171,88 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onSuccess(response,file,fileList){
|
onSuccess(response, file, fileList) {
|
||||||
this.enabledUploadBtn=true;
|
this.enabledUploadBtn = true;
|
||||||
this.uploadBtnIcon="el-icon-upload2";
|
this.uploadBtnIcon = "el-icon-upload2";
|
||||||
this.btnText='数据导入';
|
this.btnText = '数据导入';
|
||||||
alert("数据导入成功!");
|
alert("数据导入成功!");
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onError(err,file,fileList){
|
onError(err, file, fileList) {
|
||||||
this.enabledUploadBtn=true;
|
this.enabledUploadBtn = true;
|
||||||
this.uploadBtnIcon="el-icon-upload2";
|
this.uploadBtnIcon = "el-icon-upload2";
|
||||||
this.btnText='数据导入';
|
this.btnText = '数据导入';
|
||||||
alert("数据导入失败!请检查是否有重复数据,和网络连接状况!");
|
alert("数据导入失败!请检查是否有重复数据,和网络连接状况!");
|
||||||
},
|
},
|
||||||
beforeUpload(file){
|
beforeUpload(file) {
|
||||||
this.enabledUploadBtn=false;
|
this.enabledUploadBtn = false;
|
||||||
this.uploadBtnIcon="el-icon-loading";
|
this.uploadBtnIcon = "el-icon-loading";
|
||||||
this.btnText='正在导入';
|
this.btnText = '正在导入';
|
||||||
},
|
},
|
||||||
exportExcel(){
|
exportExcel() {
|
||||||
window.open(process.env.BASE_API+'/building/community/exportExcel')
|
window.open(process.env.BASE_API + '/building/community/exportExcel')
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
getAttrList(index, row) {
|
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) {
|
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) {
|
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) {
|
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) {
|
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() {
|
getList() {
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
this.cid=this.$route.query.cid;
|
console.log("query》》》》", this.$route.query);
|
||||||
|
this.cid = this.$route.query.cid;
|
||||||
|
this.name = this.$route.query.cname;
|
||||||
|
|
||||||
if (this.cid) {
|
if (this.cid) {
|
||||||
this.listQuery.companyId=this.cid;
|
this.listQuery.companyId = this.cid;
|
||||||
}
|
}
|
||||||
fetchList(this.listQuery).then(response => {
|
fetchList(this.listQuery).then(response => {
|
||||||
this.listLoading = false;
|
this.listLoading = false;
|
||||||
|
console.log("list》》》》", response.data.records);
|
||||||
this.list = response.data.records;
|
this.list = response.data.records;
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
this.totalPage = response.data.pages;
|
this.totalPage = response.data.pages;
|
||||||
@@ -252,7 +263,13 @@
|
|||||||
this.multipleSelection = val;
|
this.multipleSelection = val;
|
||||||
},
|
},
|
||||||
handleUpdate(index, row) {
|
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) {
|
handleDelete(index, row) {
|
||||||
this.$confirm('是否要删除该品牌', '提示', {
|
this.$confirm('是否要删除该品牌', '提示', {
|
||||||
@@ -333,7 +350,13 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
addCommunity() {
|
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>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<el-card class="form-container" shadow="never">
|
<el-card class="form-container" shadow="never">
|
||||||
<el-form :model="wuyeCompany" :rules="rules" ref="wuyeCompanyFrom" label-width="150px">
|
<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-input v-model="wuyeCompany.name"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="联系方式:" prop="phone">
|
<el-form-item label="联系方式:" prop="phone">
|
||||||
@@ -15,10 +15,10 @@
|
|||||||
<el-radio :label="3">审核成功</el-radio>
|
<el-radio :label="3">审核成功</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>-->
|
</el-form-item>-->
|
||||||
<el-form-item label="照片:" prop="pic">
|
<el-form-item label="社区照片:" prop="pic">
|
||||||
<single-upload v-model="wuyeCompany.pic"></single-upload>
|
<single-upload v-model="wuyeCompany.pic"></single-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="位置:" prop="address">
|
<el-form-item label="社区位置:" prop="address">
|
||||||
<el-input v-model="wuyeCompany.address"></el-input>
|
<el-input v-model="wuyeCompany.address"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
wuyeCompany:Object.assign({}, defaultWuyeCompany),
|
wuyeCompany:Object.assign({}, defaultWuyeCompany),
|
||||||
rules: {
|
rules: {
|
||||||
name: [
|
name: [
|
||||||
{required: true, message: '请输入品牌名称', trigger: 'blur'},
|
{required: true, message: '请输入社区名称', trigger: 'blur'},
|
||||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
||||||
],
|
],
|
||||||
logo: [
|
logo: [
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<div style="margin-top: 15px">
|
<div style="margin-top: 15px">
|
||||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||||
<el-form-item label="输入搜索:">
|
<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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
<el-table-column label="编号" align="center">
|
<el-table-column label="编号" align="center">
|
||||||
<template slot-scope="scope">{{scope.row.id}}</template>
|
<template slot-scope="scope">{{scope.row.id}}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="名称" align="center">
|
<el-table-column label="社区名称" align="center">
|
||||||
<template slot-scope="scope">{{scope.row.name}}</template>
|
<template slot-scope="scope">{{scope.row.name}}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="联系方式" align="center">
|
<el-table-column label="联系方式" align="center">
|
||||||
@@ -51,10 +51,10 @@
|
|||||||
<!-- <el-table-column label="状态" align="center">
|
<!-- <el-table-column label="状态" align="center">
|
||||||
<template slot-scope="scope">{{scope.row.status|formatStatus}}</template>
|
<template slot-scope="scope">{{scope.row.status|formatStatus}}</template>
|
||||||
</el-table-column>-->
|
</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>
|
<template slot-scope="scope"><img style="height: 80px" :src="scope.row.pic"></template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="位置" align="center">
|
<el-table-column label="社区位置" align="center">
|
||||||
<template slot-scope="scope">{{scope.row.address}}</template>
|
<template slot-scope="scope">{{scope.row.address}}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="创建时间" align="center">
|
<el-table-column label="创建时间" align="center">
|
||||||
|
|||||||
@@ -24,24 +24,24 @@
|
|||||||
<el-form-item label="排序:">
|
<el-form-item label="排序:">
|
||||||
<el-input v-model="productCate.sort"></el-input>
|
<el-input v-model="productCate.sort"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否显示:">
|
<!-- <el-form-item label="是否显示:">
|
||||||
<el-radio-group v-model="productCate.showStatus">
|
<el-radio-group v-model="productCate.showStatus">
|
||||||
<el-radio :label="1">是</el-radio>
|
<el-radio :label="1">是</el-radio>
|
||||||
<el-radio :label="0">否</el-radio>
|
<el-radio :label="0">否</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item label="是否显示在导航栏:">
|
<el-form-item label="是否显示在导航栏:">
|
||||||
<el-radio-group v-model="productCate.navStatus">
|
<el-radio-group v-model="productCate.navStatus">
|
||||||
<el-radio :label="1">是</el-radio>
|
<el-radio :label="1">是</el-radio>
|
||||||
<el-radio :label="0">否</el-radio>
|
<el-radio :label="0">否</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否显示在首页:">
|
<!-- <el-form-item label="是否显示在首页:">
|
||||||
<el-radio-group v-model="productCate.indexStatus">
|
<el-radio-group v-model="productCate.indexStatus">
|
||||||
<el-radio :label="1">是</el-radio>
|
<el-radio :label="1">是</el-radio>
|
||||||
<el-radio :label="0">否</el-radio>
|
<el-radio :label="0">否</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item label="分类图标:">
|
<el-form-item label="分类图标:">
|
||||||
<single-upload v-model="productCate.icon"></single-upload>
|
<single-upload v-model="productCate.icon"></single-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -87,8 +87,8 @@
|
|||||||
navStatus: 0,
|
navStatus: 0,
|
||||||
parentId: 0,
|
parentId: 0,
|
||||||
productUnit: '',
|
productUnit: '',
|
||||||
showStatus: 0,
|
showStatus: 1,
|
||||||
indexStatus:0,
|
indexStatus:1,
|
||||||
sort: 0,
|
sort: 0,
|
||||||
productAttributeIdList: []
|
productAttributeIdList: []
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,18 +3,12 @@
|
|||||||
<el-card class="operate-container" shadow="never">
|
<el-card class="operate-container" shadow="never">
|
||||||
<i class="el-icon-tickets" style="margin-top: 5px"></i>
|
<i class="el-icon-tickets" style="margin-top: 5px"></i>
|
||||||
<span style="margin-top: 5px">数据列表</span>
|
<span style="margin-top: 5px">数据列表</span>
|
||||||
<el-button
|
<el-button class="btn-add" @click="handleAddProductCate()" size="mini">
|
||||||
class="btn-add"
|
|
||||||
@click="handleAddProductCate()"
|
|
||||||
size="mini">
|
|
||||||
添加
|
添加
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-card>
|
</el-card>
|
||||||
<div class="table-container">
|
<div class="table-container">
|
||||||
<el-table ref="productCateTable"
|
<el-table ref="productCateTable" style="width: 100%" :data="list" v-loading="listLoading" border>
|
||||||
style="width: 100%"
|
|
||||||
:data="list"
|
|
||||||
v-loading="listLoading" border>
|
|
||||||
<el-table-column label="编号" width="100" align="center">
|
<el-table-column label="编号" width="100" align="center">
|
||||||
<template slot-scope="scope">{{scope.row.id}}</template>
|
<template slot-scope="scope">{{scope.row.id}}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -30,7 +24,7 @@
|
|||||||
<el-table-column label="数量单位" width="100" align="center">
|
<el-table-column label="数量单位" width="100" align="center">
|
||||||
<template slot-scope="scope">{{scope.row.productUnit }}</template>
|
<template slot-scope="scope">{{scope.row.productUnit }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="导航栏" width="100" align="center">
|
<!-- <el-table-column label="导航栏" width="100" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-switch
|
<el-switch
|
||||||
@change="handleNavStatusChange(scope.$index, scope.row)"
|
@change="handleNavStatusChange(scope.$index, scope.row)"
|
||||||
@@ -39,18 +33,15 @@
|
|||||||
v-model="scope.row.navStatus">
|
v-model="scope.row.navStatus">
|
||||||
</el-switch>
|
</el-switch>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column label="是否显示" width="100" align="center">
|
<el-table-column label="是否显示" width="100" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-switch
|
<el-switch @change="handleShowStatusChange(scope.$index, scope.row)" :active-value="1"
|
||||||
@change="handleShowStatusChange(scope.$index, scope.row)"
|
:inactive-value="0" v-model="scope.row.showStatus">
|
||||||
:active-value="1"
|
|
||||||
:inactive-value="0"
|
|
||||||
v-model="scope.row.showStatus">
|
|
||||||
</el-switch>
|
</el-switch>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="是否首页显示" width="100" align="center">
|
<!-- <el-table-column label="是否首页显示" width="100" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-switch
|
<el-switch
|
||||||
@change="handleIndexStatusChange(scope.$index, scope.row)"
|
@change="handleIndexStatusChange(scope.$index, scope.row)"
|
||||||
@@ -59,55 +50,48 @@
|
|||||||
v-model="scope.row.indexStatus">
|
v-model="scope.row.indexStatus">
|
||||||
</el-switch>
|
</el-switch>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column label="排序" width="100" align="center">
|
<el-table-column label="排序" width="100" align="center">
|
||||||
<template slot-scope="scope">{{scope.row.sort }}</template>
|
<template slot-scope="scope">{{scope.row.sort }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="设置" width="200" align="center">
|
<el-table-column label="设置" width="200" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button size="mini" :disabled="scope.row.level | disableNextLevel"
|
||||||
size="mini"
|
|
||||||
:disabled="scope.row.level | disableNextLevel"
|
|
||||||
@click="handleShowNextLevel(scope.$index, scope.row)">查看下级
|
@click="handleShowNextLevel(scope.$index, scope.row)">查看下级
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<!-- <el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleTransferProduct(scope.$index, scope.row)">转移商品
|
@click="handleTransferProduct(scope.$index, scope.row)">转移商品
|
||||||
</el-button>
|
</el-button> -->
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="200" align="center">
|
<el-table-column label="操作" width="200" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button size="mini" @click="handleUpdate(scope.$index, scope.row)">编辑
|
||||||
size="mini"
|
|
||||||
@click="handleUpdate(scope.$index, scope.row)">编辑
|
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除
|
||||||
size="mini"
|
|
||||||
type="danger"
|
|
||||||
@click="handleDelete(scope.$index, scope.row)">删除
|
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<div class="pagination-container">
|
<div class="pagination-container">
|
||||||
<el-pagination
|
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
|
||||||
background
|
layout="total, sizes,prev, pager, next,jumper" :page-size="listQuery.pageSize" :page-sizes="[5,10,15]"
|
||||||
@size-change="handleSizeChange"
|
:current-page.sync="listQuery.pageNum" :total="total">
|
||||||
@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>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {fetchList,deleteProductCate,updateShowStatus,updateNavStatus,updateIndexStatus} from '@/api/productCate'
|
import {
|
||||||
|
fetchList,
|
||||||
|
deleteProductCate,
|
||||||
|
updateShowStatus,
|
||||||
|
updateNavStatus,
|
||||||
|
updateIndexStatus
|
||||||
|
} from '@/api/productCate'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "productCateList",
|
name: "productCateList",
|
||||||
@@ -134,7 +118,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
resetParentId(){
|
resetParentId() {
|
||||||
if (this.$route.query.parentId != null) {
|
if (this.$route.query.parentId != null) {
|
||||||
this.parentId = this.$route.query.parentId;
|
this.parentId = this.$route.query.parentId;
|
||||||
} else {
|
} else {
|
||||||
@@ -163,11 +147,11 @@
|
|||||||
},
|
},
|
||||||
handleNavStatusChange(index, row) {
|
handleNavStatusChange(index, row) {
|
||||||
let data = new URLSearchParams();
|
let data = new URLSearchParams();
|
||||||
let ids=[];
|
let ids = [];
|
||||||
ids.push(row.id)
|
ids.push(row.id)
|
||||||
data.append('ids',ids);
|
data.append('ids', ids);
|
||||||
data.append('navStatus',row.navStatus);
|
data.append('navStatus', row.navStatus);
|
||||||
updateNavStatus(data).then(response=>{
|
updateNavStatus(data).then(response => {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '修改成功',
|
message: '修改成功',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
@@ -177,11 +161,11 @@
|
|||||||
},
|
},
|
||||||
handleShowStatusChange(index, row) {
|
handleShowStatusChange(index, row) {
|
||||||
let data = new URLSearchParams();
|
let data = new URLSearchParams();
|
||||||
let ids=[];
|
let ids = [];
|
||||||
ids.push(row.id)
|
ids.push(row.id)
|
||||||
data.append('ids',ids);
|
data.append('ids', ids);
|
||||||
data.append('showStatus',row.showStatus);
|
data.append('showStatus', row.showStatus);
|
||||||
updateShowStatus(data).then(response=>{
|
updateShowStatus(data).then(response => {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '修改成功',
|
message: '修改成功',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
@@ -191,11 +175,11 @@
|
|||||||
},
|
},
|
||||||
handleIndexStatusChange(index, row) {
|
handleIndexStatusChange(index, row) {
|
||||||
let data = new URLSearchParams();
|
let data = new URLSearchParams();
|
||||||
let ids=[];
|
let ids = [];
|
||||||
ids.push(row.id)
|
ids.push(row.id)
|
||||||
data.append('ids',ids);
|
data.append('ids', ids);
|
||||||
data.append('indexStatus',row.indexStatus);
|
data.append('indexStatus', row.indexStatus);
|
||||||
updateIndexStatus(data).then(response=>{
|
updateIndexStatus(data).then(response => {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '修改成功',
|
message: '修改成功',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
@@ -204,13 +188,23 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleShowNextLevel(index, row) {
|
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) {
|
handleTransferProduct(index, row) {
|
||||||
console.log('handleAddProductCate');
|
console.log('handleAddProductCate');
|
||||||
},
|
},
|
||||||
handleUpdate(index, row) {
|
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) {
|
handleDelete(index, row) {
|
||||||
this.$confirm('是否要删除该品牌', '提示', {
|
this.$confirm('是否要删除该品牌', '提示', {
|
||||||
|
|||||||
@@ -9,14 +9,15 @@
|
|||||||
<el-input v-model="homeAdvertise.name" class="input-width"></el-input>
|
<el-input v-model="homeAdvertise.name" class="input-width"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="广告位置:">
|
<el-form-item label="广告位置:">
|
||||||
<el-select v-model="homeAdvertise.type">
|
<!-- <el-select v-model="homeAdvertise.type">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="type in typeOptions"
|
v-for="type in typeOptions"
|
||||||
:key="type.value"
|
:key="type.value"
|
||||||
:label="type.label"
|
:label="type.label"
|
||||||
:value="type.value">
|
:value="type.value">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select> -->
|
||||||
|
<span>Android首页轮播</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="开始时间:" prop="startTime">
|
<el-form-item label="开始时间:" prop="startTime">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
@@ -84,7 +85,7 @@
|
|||||||
];
|
];
|
||||||
const defaultHomeAdvertise = {
|
const defaultHomeAdvertise = {
|
||||||
name: null,
|
name: null,
|
||||||
type: 1,
|
type: 2,
|
||||||
pic: null,
|
pic: null,
|
||||||
startTime: null,
|
startTime: null,
|
||||||
endTime: null,
|
endTime: null,
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
<el-form-item label="广告名称:">
|
<el-form-item label="广告名称:">
|
||||||
<el-input v-model="listQuery.name" class="input-width" placeholder="广告名称"></el-input>
|
<el-input v-model="listQuery.name" class="input-width" placeholder="广告名称"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="广告位置:">
|
<!-- <el-form-item label="广告位置:">
|
||||||
<el-select v-model="listQuery.type" placeholder="全部" clearable class="input-width">
|
<el-select v-model="listQuery.type" placeholder="全部" clearable class="input-width">
|
||||||
<el-option v-for="item in typeOptions"
|
<el-option v-for="item in typeOptions"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
:value="item.value">
|
:value="item.value">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item label="到期时间:">
|
<el-form-item label="到期时间:">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
class="input-width"
|
class="input-width"
|
||||||
@@ -62,13 +62,13 @@
|
|||||||
<el-table-column label="广告名称" align="center">
|
<el-table-column label="广告名称" align="center">
|
||||||
<template slot-scope="scope">{{scope.row.name}}</template>
|
<template slot-scope="scope">{{scope.row.name}}</template>
|
||||||
</el-table-column>
|
</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>
|
<template slot-scope="scope">{{scope.row.type | formatType}}</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column label="广告图片" width="120" align="center">
|
<el-table-column label="广告图片" width="250" align="center">
|
||||||
<template slot-scope="scope"><img style="height: 80px" :src="scope.row.pic"></template>
|
<template slot-scope="scope"><img style="height: 80px" :src="scope.row.pic"></template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="时间" width="220" align="center">
|
<el-table-column label="时间" width="320" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<p>开始时间:{{scope.row.startTime | formatTime}}</p>
|
<p>开始时间:{{scope.row.startTime | formatTime}}</p>
|
||||||
<p>到期时间:{{scope.row.endTime | formatTime}}</p>
|
<p>到期时间:{{scope.row.endTime | formatTime}}</p>
|
||||||
@@ -84,13 +84,13 @@
|
|||||||
</el-switch>
|
</el-switch>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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>
|
<template slot-scope="scope">{{scope.row.clickCount}}</template>
|
||||||
</el-table-column>
|
</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.orderCount}}</template>
|
<template slot-scope="scope">{{scope.row.orderCount}}</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column label="操作" width="120" align="center">
|
<el-table-column label="操作" width="180" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini"
|
<el-button size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
|
|||||||
@@ -1,33 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-card class="form-container" shadow="never">
|
<el-card class="form-container" shadow="never">
|
||||||
<el-form :model="coupon"
|
<el-form :model="coupon" :rules="rules" ref="couponFrom" label-width="150px" size="small">
|
||||||
:rules="rules"
|
|
||||||
ref="couponFrom"
|
|
||||||
label-width="150px"
|
|
||||||
size="small">
|
|
||||||
<el-form-item label="优惠券类型:">
|
<el-form-item label="优惠券类型:">
|
||||||
<el-select v-model="coupon.type">
|
<span>全场赠券</span>
|
||||||
<el-option v-for='type in typeOptions' :key='type.value' :label='type.label' :value='type.value'></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="优惠券名称:" prop="name">
|
<el-form-item label="优惠券名称:" prop="name">
|
||||||
<el-input v-model="coupon.name" class="input-width"></el-input>
|
<el-input v-model="coupon.name" class="input-width"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="适用平台:">
|
<el-form-item label="适用平台:">
|
||||||
<el-select v-model="coupon.platform">
|
|
||||||
<el-option
|
<span>全平台</span>
|
||||||
v-for="item in platformOptions"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="总发行量:" prop="publishCount">
|
<el-form-item label="总发行量:" prop="publishCount">
|
||||||
<el-input v-model.number="coupon.publishCount" placeholder="只能输入正整数" class="input-width"></el-input>
|
<el-input v-model.number="coupon.publishCount" placeholder="只能输入正整数" class="input-width"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="面额:" prop="amount">
|
<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>
|
<template slot="append">元</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -42,10 +31,12 @@
|
|||||||
<template slot="append">元可用</template>
|
<template slot="append">元可用</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="有效期:">
|
<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>
|
<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>
|
||||||
<el-form-item label="可使用商品:">
|
<el-form-item label="可使用商品:">
|
||||||
<el-radio-group v-model="coupon.useType">
|
<el-radio-group v-model="coupon.useType">
|
||||||
@@ -55,24 +46,18 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="coupon.useType===1">
|
<el-form-item v-show="coupon.useType===1">
|
||||||
<el-cascader
|
<el-cascader clearable placeholder="请选择分类名称" v-model="selectProductCate" :options="productCateOptions">
|
||||||
clearable
|
|
||||||
placeholder="请选择分类名称"
|
|
||||||
v-model="selectProductCate"
|
|
||||||
:options="productCateOptions">
|
|
||||||
</el-cascader>
|
</el-cascader>
|
||||||
<el-button @click="handleAddProductCategoryRelation()">添加</el-button>
|
<el-button @click="handleAddProductCategoryRelation()">添加</el-button>
|
||||||
<el-table ref="productCateRelationTable"
|
<el-table ref="productCateRelationTable" :data="coupon.productCategoryRelationList"
|
||||||
:data="coupon.productCategoryRelationList"
|
style="width: 100%;margin-top: 20px" border>
|
||||||
style="width: 100%;margin-top: 20px"
|
|
||||||
border>
|
|
||||||
<el-table-column label="分类名称" align="center">
|
<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>
|
||||||
<el-table-column label="操作" align="center" width="100">
|
<el-table-column label="操作" align="center" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini"
|
<el-button size="mini" type="text"
|
||||||
type="text"
|
|
||||||
@click="handleDeleteProductCateRelation(scope.$index, scope.row)">删除
|
@click="handleDeleteProductCateRelation(scope.$index, scope.row)">删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
@@ -80,38 +65,26 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="coupon.useType===2">
|
<el-form-item v-show="coupon.useType===2">
|
||||||
<el-select
|
<el-select v-model="selectProduct" filterable remote reserve-keyword placeholder="商品名称/商品货号"
|
||||||
v-model="selectProduct"
|
:remote-method="searchProductMethod" :loading="selectProductLoading">
|
||||||
filterable
|
<el-option v-for="item in selectProductOptions" :key="item.productId" :label="item.productName"
|
||||||
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">
|
:value="item.productId">
|
||||||
<span style="float: left">{{ item.productName }}</span>
|
<span style="float: left">{{ item.productName }}</span>
|
||||||
<span style="float: right; color: #8492a6; font-size: 13px">NO.{{ item.productSn }}</span>
|
<span style="float: right; color: #8492a6; font-size: 13px">NO.{{ item.productSn }}</span>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-button @click="handleAddProductRelation()">添加</el-button>
|
<el-button @click="handleAddProductRelation()">添加</el-button>
|
||||||
<el-table ref="productRelationTable"
|
<el-table ref="productRelationTable" :data="coupon.productRelationList"
|
||||||
:data="coupon.productRelationList"
|
style="width: 100%;margin-top: 20px" border>
|
||||||
style="width: 100%;margin-top: 20px"
|
|
||||||
border>
|
|
||||||
<el-table-column label="商品名称" align="center">
|
<el-table-column label="商品名称" align="center">
|
||||||
<template slot-scope="scope">{{scope.row.productName}}</template>
|
<template slot-scope="scope">{{scope.row.productName}}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="货号" align="center" width="120" >
|
<el-table-column label="货号" align="center" width="120">
|
||||||
<template slot-scope="scope">NO.{{scope.row.productSn}}</template>
|
<template slot-scope="scope">NO.{{scope.row.productSn}}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" width="100">
|
<el-table-column label="操作" align="center" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini"
|
<el-button size="mini" type="text"
|
||||||
type="text"
|
|
||||||
@click="handleDeleteProductRelation(scope.$index, scope.row)">删除
|
@click="handleDeleteProductRelation(scope.$index, scope.row)">删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
@@ -119,12 +92,7 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注:">
|
<el-form-item label="备注:">
|
||||||
<el-input
|
<el-input class="input-width" type="textarea" :rows="5" placeholder="请输入内容" v-model="coupon.note">
|
||||||
class="input-width"
|
|
||||||
type="textarea"
|
|
||||||
:rows="5"
|
|
||||||
placeholder="请输入内容"
|
|
||||||
v-model="coupon.note">
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@@ -135,9 +103,17 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {createCoupon,getCoupon,updateCoupon} from '@/api/coupon';
|
import {
|
||||||
import {fetchSimpleList as fetchProductList} from '@/api/product';
|
createCoupon,
|
||||||
import {fetchListWithChildren} from '@/api/productCate'
|
getCoupon,
|
||||||
|
updateCoupon
|
||||||
|
} from '@/api/coupon';
|
||||||
|
import {
|
||||||
|
fetchSimpleList as fetchProductList
|
||||||
|
} from '@/api/product';
|
||||||
|
import {
|
||||||
|
fetchListWithChildren
|
||||||
|
} from '@/api/productCate'
|
||||||
const defaultCoupon = {
|
const defaultCoupon = {
|
||||||
type: 0,
|
type: 0,
|
||||||
name: null,
|
name: null,
|
||||||
@@ -153,8 +129,7 @@
|
|||||||
productRelationList: [],
|
productRelationList: [],
|
||||||
productCategoryRelationList: []
|
productCategoryRelationList: []
|
||||||
};
|
};
|
||||||
const defaultTypeOptions = [
|
const defaultTypeOptions = [{
|
||||||
{
|
|
||||||
label: '全场赠券',
|
label: '全场赠券',
|
||||||
value: 0
|
value: 0
|
||||||
},
|
},
|
||||||
@@ -171,8 +146,7 @@
|
|||||||
value: 3
|
value: 3
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
const defaultPlatformOptions = [
|
const defaultPlatformOptions = [{
|
||||||
{
|
|
||||||
label: '全平台',
|
label: '全平台',
|
||||||
value: 0
|
value: 0
|
||||||
},
|
},
|
||||||
@@ -216,37 +190,53 @@
|
|||||||
typeOptions: Object.assign({}, defaultTypeOptions),
|
typeOptions: Object.assign({}, defaultTypeOptions),
|
||||||
platformOptions: Object.assign({}, defaultPlatformOptions),
|
platformOptions: Object.assign({}, defaultPlatformOptions),
|
||||||
rules: {
|
rules: {
|
||||||
name: [
|
name: [{
|
||||||
{required: true, message: '请输入优惠券名称', trigger: 'blur'},
|
required: true,
|
||||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
message: '请输入优惠券名称',
|
||||||
],
|
trigger: 'blur'
|
||||||
publishCount: [
|
|
||||||
{type: 'number',required: true, message: '只能输入正整数', trigger: 'blur'}
|
|
||||||
],
|
|
||||||
// amount: [
|
|
||||||
// // {type: 'number',required: true,message: '面值只能是数值,0.01-10000,限2位小数',trigger: 'blur'}
|
|
||||||
// // { required: true, validator: validatePrice, trigger: "blur" },
|
|
||||||
// ],
|
|
||||||
minPoint: [
|
|
||||||
{type: 'number',required: true,message: '只能输入正整数',trigger: 'blur'}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
selectProduct:null,
|
{
|
||||||
|
min: 2,
|
||||||
|
max: 140,
|
||||||
|
message: '长度在 2 到 140 个字符',
|
||||||
|
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,
|
selectProductLoading: false,
|
||||||
selectProductOptions:[],
|
selectProductOptions: [],
|
||||||
selectProductCate: null,
|
selectProductCate: null,
|
||||||
productCateOptions: []
|
productCateOptions: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created(){
|
created() {
|
||||||
if(this.isEdit){
|
if (this.isEdit) {
|
||||||
getCoupon(this.$route.query.id).then(response=>{
|
getCoupon(this.$route.query.id).then(response => {
|
||||||
this.coupon=response.data;
|
this.coupon = response.data;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.getProductCateList();
|
this.getProductCateList();
|
||||||
},
|
},
|
||||||
methods:{
|
methods: {
|
||||||
UpNumber(val, limit = 2) {
|
UpNumber(val, limit = 2) {
|
||||||
val = val.replace(/[^\d.]/g, '') // 保留数字
|
val = val.replace(/[^\d.]/g, '') // 保留数字
|
||||||
val = val.replace(/^00/, '0.') // 开头不能有两个0
|
val = val.replace(/^00/, '0.') // 开头不能有两个0
|
||||||
@@ -273,23 +263,23 @@
|
|||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
if(this.isEdit){
|
if (this.isEdit) {
|
||||||
updateCoupon(this.$route.query.id,this.coupon).then(response=>{
|
updateCoupon(this.$route.query.id, this.coupon).then(response => {
|
||||||
this.$refs[formName].resetFields();
|
this.$refs[formName].resetFields();
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '修改成功',
|
message: '修改成功',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
duration:1000
|
duration: 1000
|
||||||
});
|
});
|
||||||
this.$router.back();
|
this.$router.back();
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
createCoupon(this.coupon).then(response=>{
|
createCoupon(this.coupon).then(response => {
|
||||||
this.$refs[formName].resetFields();
|
this.$refs[formName].resetFields();
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '提交成功',
|
message: '提交成功',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
duration:1000
|
duration: 1000
|
||||||
});
|
});
|
||||||
this.$router.back();
|
this.$router.back();
|
||||||
});
|
});
|
||||||
@@ -299,7 +289,7 @@
|
|||||||
this.$message({
|
this.$message({
|
||||||
message: '验证失败',
|
message: '验证失败',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
duration:1000
|
duration: 1000
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -307,26 +297,32 @@
|
|||||||
},
|
},
|
||||||
resetForm(formName) {
|
resetForm(formName) {
|
||||||
this.$refs[formName].resetFields();
|
this.$refs[formName].resetFields();
|
||||||
this.coupon = Object.assign({},defaultCoupon);
|
this.coupon = Object.assign({}, defaultCoupon);
|
||||||
},
|
},
|
||||||
searchProductMethod(query){
|
searchProductMethod(query) {
|
||||||
if (query !== '') {
|
if (query !== '') {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
fetchProductList({keyword:query}).then(response=>{
|
fetchProductList({
|
||||||
this.loading=false;
|
keyword: query
|
||||||
|
}).then(response => {
|
||||||
|
this.loading = false;
|
||||||
let productList = response.data;
|
let productList = response.data;
|
||||||
this.selectProductOptions = [];
|
this.selectProductOptions = [];
|
||||||
for(let i=0;i<productList.length;i++){
|
for (let i = 0; i < productList.length; i++) {
|
||||||
let item = productList[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 {
|
} else {
|
||||||
this.selectProductOptions = [];
|
this.selectProductOptions = [];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleAddProductRelation(){
|
handleAddProductRelation() {
|
||||||
if(this.selectProduct===null){
|
if (this.selectProduct === null) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '请先选择商品',
|
message: '请先选择商品',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
@@ -334,13 +330,13 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.coupon.productRelationList.push(this.getProductById(this.selectProduct));
|
this.coupon.productRelationList.push(this.getProductById(this.selectProduct));
|
||||||
this.selectProduct=null;
|
this.selectProduct = null;
|
||||||
},
|
},
|
||||||
handleDeleteProductRelation(index,row){
|
handleDeleteProductRelation(index, row) {
|
||||||
this.coupon.productRelationList.splice(index,1);
|
this.coupon.productRelationList.splice(index, 1);
|
||||||
},
|
},
|
||||||
handleAddProductCategoryRelation(){
|
handleAddProductCategoryRelation() {
|
||||||
if(this.selectProductCate===null||this.selectProductCate.length===0){
|
if (this.selectProductCate === null || this.selectProductCate.length === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '请先选择商品分类',
|
message: '请先选择商品分类',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
@@ -348,14 +344,14 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.coupon.productCategoryRelationList.push(this.getProductCateByIds(this.selectProductCate));
|
this.coupon.productCategoryRelationList.push(this.getProductCateByIds(this.selectProductCate));
|
||||||
this.selectProductCate=[];
|
this.selectProductCate = [];
|
||||||
},
|
},
|
||||||
handleDeleteProductCateRelation(index,row){
|
handleDeleteProductCateRelation(index, row) {
|
||||||
this.coupon.productCategoryRelationList.splice(index,1);
|
this.coupon.productCategoryRelationList.splice(index, 1);
|
||||||
},
|
},
|
||||||
getProductById(id){
|
getProductById(id) {
|
||||||
for(let i=0;i<this.selectProductOptions.length;i++){
|
for (let i = 0; i < this.selectProductOptions.length; i++) {
|
||||||
if(id===this.selectProductOptions[i].productId){
|
if (id === this.selectProductOptions[i].productId) {
|
||||||
return this.selectProductOptions[i];
|
return this.selectProductOptions[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -369,14 +365,21 @@
|
|||||||
let children = [];
|
let children = [];
|
||||||
if (list[i].children != null && list[i].children.length > 0) {
|
if (list[i].children != null && list[i].children.length > 0) {
|
||||||
for (let j = 0; j < list[i].children.length; j++) {
|
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
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getProductCateByIds(ids){
|
getProductCateByIds(ids) {
|
||||||
let name;
|
let name;
|
||||||
let parentName;
|
let parentName;
|
||||||
for (let i = 0; i < this.productCateOptions.length; i++) {
|
for (let i = 0; i < this.productCateOptions.length; i++) {
|
||||||
@@ -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%;
|
width: 60%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user