装起全部商城菜单

This commit is contained in:
2022-04-21 18:07:40 +08:00
parent 1b6f8f0ed9
commit 05fdb1d9e7
436 changed files with 50845 additions and 63 deletions
+320
View File
@@ -0,0 +1,320 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '开启砍价'" width="900px">
<el-form ref="form" :model="form" :rules="rules" :inline="true" size="small" label-width="140px">
<el-col :span="24">
<el-form-item label="选择商品:" prop="good">
<cgood v-model="form1.good" :disabled="true" ></cgood>
</el-form-item>
</el-col>
<el-form-item label="砍价名称">
<el-input v-model="form.title" style="width: 500px;" />
</el-form-item>
<el-form-item label="砍价简介">
<el-input v-model="form.info" style="width: 500px;" rows="5" type="textarea" />
</el-form-item>
<el-form-item label="单位">
<el-input v-model="form.unitName" style="width: 500px;" />
</el-form-item>
<el-form-item label="活动开始时间">
<template>
<el-date-picker
v-model="form.startTime"
type="datetime"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
<el-form-item label="活动结束时间">
<template>
<el-date-picker
v-model="form.stopTime"
type="datetime"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
<el-form-item label="砍价产品主图片">
<single-pic v-model="form.image" style="width: 500px" type="image" :num="1" :width="150" :height="150" />
</el-form-item>
<el-form-item label="砍价产品轮播图">
<MaterialList v-model="form.sliderImageArr" style="width: 500px" type="image" :num="4" :width="150" :height="150" />
</el-form-item>
<el-form-item label="库存">
<el-input-number v-model="form.stock" maxlength="7"/>
</el-form-item>
<el-form-item label="销量">
<el-input-number v-model="form.sales" />
</el-form-item>
<el-form-item label="砍价金额">
<el-input-number v-model="form.price" />
</el-form-item>
<el-form-item label="允许砍到最低价">
<el-input-number v-model="form.minPrice" />
</el-form-item>
<el-form-item label="限购">
<el-input-number v-model="form.num" />
</el-form-item>
<el-form-item label="单次砍最高价">
<el-input-number v-model="form.bargainMaxPrice" />
</el-form-item>
<el-form-item label="单次砍最低价">
<el-input-number v-model="form.bargainMinPrice" />
</el-form-item>
<el-form-item label="用户每次砍价的次数">
<el-input-number v-model="form.bargainNum" />
</el-form-item>
<el-form-item label="砍价状态">
<el-radio v-model="form.status" :label="1">开启</el-radio>
<el-radio v-model="form.status" :label="0" style="width: 110px;">关闭</el-radio>
</el-form-item>
<el-form-item label="成本价">
<el-input-number v-model="form.cost" />
</el-form-item>
<el-form-item label="排序">
<el-input-number v-model="form.sort" />
</el-form-item>
<el-col :span="24">
<el-form-item label="运费模板:" prop="temp_id">
<div class="acea-row">
<el-select v-model="form.temp_id" class="mr20" :disabled="true">
<el-option v-for="(item,index) in templateList" :value="item.id" :key="index" :label="item.name">
</el-option>
</el-select>
</div>
</el-form-item>
</el-col>
<el-form-item label="砍价规则">
<editor v-model="form.rule" />
</el-form-item>
<el-form-item label="砍价详情">
<editor v-model="form.description" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import cgood from '@/views/components/good'
import { add, edit } from '@/api/bxg/yxStoreBargain'
import editor from '../../components/Editor'
import MaterialList from '@/components/material'
import singlePic from '@/components/singlematerial'
import { getInfo } from '@/api/bxg/yxStoreProduct'
export default {
components: { editor, MaterialList,cgood,singlePic },
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
templateList: [],
form1: {
good:{
productId: null,
storeName: null,
image: null,
otPrice: null,
price: null,
}
},
form: {
//that.form.minPrice = 0
//that.form.num = 1
//that.form.bargainMaxPrice = 0
//that.form.bargainMinPrice = 0
//that.form.bargainNum = 1
id: '',
productId: '',
title: '',
image: '',
unitName: '',
stock: '',
sales: '',
images: '',
imageArr: [],
sliderImageArr: [],
startTime: '',
stopTime: '',
storeName: '',
price: '',
minPrice: 0,
num: 1,
bargainMaxPrice: 0,
bargainMinPrice: 0,
bargainNum: 1,
status: 1,
description: '',
giveIntegral: 0,
info: '',
cost: '',
sort: 0,
isHot: 0,
isDel: 0,
addTime: '',
isPostage: 1,
postage: '',
rule: '',
look: '',
share: '',
startTimeDate: '',
endTimeDate: '',
temp_id: ''
},
rules: {
}
}
},
watch: {
'form.image': function(val) {
this.form1.good.image = this.form.image
this.form1.good.productId = this.form.productId
},
'form.sliderImageArr': function(val) {
console.log("aaa:"+val)
if (val && Array.isArray(val)) {
this.form.images = val.join(',')
}
},
'form1.good.productId': {
handler(val,oldVal){
if(val){
this.getInfoChooseGood (val)
}
},
deep:true//对象内部的属性监听,也叫深度监听
},
},
methods: {
// 详情选择商品生成规格用
getInfoChooseGood (id) {
let that = this;
getInfo(id).then(async res => {
let data = res.productInfo;
console.info('data:'+JSON.stringify(data))
if(data){
let cate_id = parseInt(data.cate_id) || 0;
//that.form = data;
Object.keys(that.form).forEach(key=>{
if(data[key]) that.form[key] = data[key];
})
that.form.productId = data.id
that.form.cate_id = cate_id;
that.form.title = data.store_name
that.form.info = data.store_info
that.form.unitName = data.unit_name
that.form.imageArr = data.image
that.form.sliderImageArr = data.slider_image
that.form.status = 1
//that.form.minPrice = 0
//that.form.num = 1
//that.form.bargainMaxPrice = 0
//that.form.bargainMinPrice = 0
//that.form.bargainNum = 1
}
that.templateList = res.tempList;
}).catch(res => {
console.log('err:'+res)
return this.$message({
message:res.msg,
type: 'error'
});
})
},
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
productId: '',
title: '',
image: '',
unitName: '',
stock: '',
sales: '',
images: '',
imageArr: [],
sliderImageArr: [],
startTime: '',
stopTime: '',
storeName: '',
price: '',
minPrice: '',
num: '',
bargainMaxPrice: '',
bargainMinPrice: '',
bargainNum: '',
status: 1,
description: '',
giveIntegral: '',
info: '',
cost: '',
sort: '',
isHot: '',
isDel: '',
addTime: '',
isPostage: '',
postage: '',
rule: '',
look: '',
share: '',
temp_id: '',
}
}
}
}
</script>
<style scoped>
</style>
+185
View File
@@ -0,0 +1,185 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container" >
<div style="display: inline-block;margin: 0px 2px;">
<el-button
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button>
</div>
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="砍价产品ID" />
<el-table-column prop="title" label="砍价名称" />
<el-table-column prop="image" label="砍价图片">
<template slot-scope="scope">
<a :href="scope.row.image" style="color: #42b983" target="_blank"><img :src="scope.row.image" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column prop="price" label="砍价价格" />
<el-table-column prop="price" label="砍价区间">
<template slot-scope="scope">
<span>{{ scope.row.bargainMinPrice }}~{{ scope.row.bargainMaxPrice }}</span>
</template>
</el-table-column>
<el-table-column prop="minPrice" label="最低价" />
<el-table-column prop="stock" label="库存" />
<el-table-column prop="statusStr" label="砍价状态" />
<el-table-column prop="startTime" label="开始时间">
<template slot-scope="scope">
<span>{{ formatTimeTwo(scope.row.startTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="stopTime" label="结束时间">
<template slot-scope="scope">
<span>{{ formatTimeTwo(scope.row.stopTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="sales" label="销量" />
<el-table-column prop="look" label="浏览量" />
<el-table-column prop="share" label="分享量" />
<el-table-column v-if="checkPermission(['admin','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_EDIT','YXSTOREBARGAIN_DELETE'])" label="操作" width="150px" align="center" fixed="right">
<template slot-scope="scope">
<el-button v-permission="['admin','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSTOREBARGAIN_ALL','YXSTOREBARGAIN_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxStoreBargain'
import eForm from './form'
import { formatTimeTwo, parseTime } from '@/utils/index'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
parseTime,
formatTimeTwo,
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxStoreBargain'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
productId: data.productId,
title: data.title,
image: data.image,
unitName: data.unitName,
stock: data.stock,
sales: data.sales,
images: data.images,
imageArr: data.image.split(','),
sliderImageArr: data.images.split(','),
startTime: data.startTime,
stopTime: data.stopTime,
storeName: data.storeName,
price: data.price,
minPrice: data.minPrice,
num: data.num,
bargainMaxPrice: data.bargainMaxPrice,
bargainMinPrice: data.bargainMinPrice,
bargainNum: data.bargainNum,
status: data.status,
description: data.description,
giveIntegral: data.giveIntegral,
info: data.info,
cost: data.cost,
sort: data.sort,
isHot: data.isHot,
isDel: data.isDel,
addTime: data.addTime,
isPostage: data.isPostage,
postage: data.postage,
rule: data.rule,
look: data.look,
share: data.share,
startTimeDate: new Date(data.startTimeDate),
endTimeDate: new Date(data.endTimeDate)
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,124 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="用户ID">
<el-input v-model="form.uid" style="width: 370px;" />
</el-form-item>
<el-form-item label="砍价产品id">
<el-input v-model="form.bargainId" style="width: 370px;" />
</el-form-item>
<el-form-item label="砍价的最低价">
<el-input v-model="form.bargainPriceMin" style="width: 370px;" />
</el-form-item>
<el-form-item label="砍价金额">
<el-input v-model="form.bargainPrice" style="width: 370px;" />
</el-form-item>
<el-form-item label="砍掉的价格">
<el-input v-model="form.price" style="width: 370px;" />
</el-form-item>
<el-form-item label="状态 1参与中 2 活动结束参与失败 3活动结束参与成功">
<el-input v-model="form.status" style="width: 370px;" />
</el-form-item>
<el-form-item label="参与时间">
<el-input v-model="form.addTime" style="width: 370px;" />
</el-form-item>
<el-form-item label="是否取消">
<el-input v-model="form.isDel" style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/bxg/yxStoreBargainUser'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
uid: '',
bargainId: '',
bargainPriceMin: '',
bargainPrice: '',
price: '',
status: '',
addTime: '',
isDel: ''
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
uid: '',
bargainId: '',
bargainPriceMin: '',
bargainPrice: '',
price: '',
status: '',
addTime: '',
isDel: ''
}
}
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,131 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['admin','YXSTOREBARGAINUSER_ALL','YXSTOREBARGAINUSER_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="用户参与砍价表ID" />
<el-table-column prop="uid" label="用户ID" />
<el-table-column prop="bargainId" label="砍价产品id" />
<el-table-column prop="bargainPriceMin" label="砍价的最低价" />
<el-table-column prop="bargainPrice" label="砍价金额" />
<el-table-column prop="price" label="砍掉的价格" />
<el-table-column prop="status" label="状态 1参与中 2 活动结束参与失败 3活动结束参与成功" />
<el-table-column prop="addTime" label="参与时间" />
<el-table-column prop="isDel" label="是否取消" />
<el-table-column v-if="checkPermission(['admin','YXSTOREBARGAINUSER_ALL','YXSTOREBARGAINUSER_EDIT','YXSTOREBARGAINUSER_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['admin','YXSTOREBARGAINUSER_ALL','YXSTOREBARGAINUSER_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSTOREBARGAINUSER_ALL','YXSTOREBARGAINUSER_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxStoreBargainUser'
import eForm from './form'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxStoreBargainUser'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
uid: data.uid,
bargainId: data.bargainId,
bargainPriceMin: data.bargainPriceMin,
bargainPrice: data.bargainPrice,
price: data.price,
status: data.status,
addTime: data.addTime,
isDel: data.isDel
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+763
View File
@@ -0,0 +1,763 @@
<template>
<div class="app-container">
<el-card :bordered="false">
<el-form ref="formValidate" :rules="ruleValidate" :model="formValidate" label-width="130px">
<el-row :gutter="24">
<!-- 商品信息-->
<el-col :span="24">
<el-form-item label="选择商品:" prop="good">
<cgood v-model="form1.good"></cgood>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="拼团名称" prop="title">
<el-input v-model="formValidate.title" @input="onInput()" style="width: 500px;" placeholder="请输入拼团名称"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="拼团简介" prop="info">
<el-input v-model="formValidate.info" @input="onInput()" style="width: 500px;" placeholder="请输入拼团简介"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="单位" prop="unitName">
<el-input v-model="formValidate.unitName" @input="onInput()" style="width: 500px;" placeholder="请输入单位"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="商品原价">
<!-- oneFormValidate[0].cost-->
<el-input type="text" style="width: 500px;" disabled v-model="formValidate.productPrice" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="拼团开始时间" prop="startTime">
<template>
<el-date-picker
v-model="formValidate.startTime"
type="datetime"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="拼团结束时间" prop="stopTime">
<template>
<el-date-picker
v-model="formValidate.stopTime"
type="datetime"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="活动状态" prop="isShow">
<el-radio v-model="formValidate.isShow" :label="1">开启</el-radio>
<el-radio v-model="formValidate.isShow" :label="0" style="width: 200px;">关闭</el-radio>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="产品主图片" prop="image">
<single-pic v-model="formValidate.image" style="width: 500px" type="image" :num="1" :width="150"
:height="150"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="产品轮播图" prop="slider_image">
<MaterialList v-model="formValidate.slider_image" style="width: 500px" type="image" :num="4" :width="150"
:height="150"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="拼团时效(小时)" prop="effectiveTime">
<el-input-number v-model="formValidate.effectiveTime" style="width: 500px;"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="拼团人数" prop="people">
<el-input-number :min="1" :max="99" v-model="formValidate.people"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="商品规格:" props="spec_type">
<el-radio-group v-model="formValidate.spec_type" @change="changeSpec" :disabled="true">
<el-radio :label="0" class="radio">单规格</el-radio>
<el-radio :label="1">多规格{{ formValidate.spec_typ }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<!-- 多规格设置-->
<el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24"
v-if="manyFormValidate.length && formValidate.header.length!==0 && attrs.length!==0">
<!-- 多规格表格-->
<el-col :span="24">
<el-form-item label="商品属性:" class="labeltop">
<el-table :data="manyFormValidate" size="small" style="width: 90%;">
<el-table-column type="myindex" v-for="(item,index) in formValidate.header" :key="index"
:label="item.title" :property="item.slot" align="center">
<template slot-scope="scope">
<div v-if="scope.column.property == 'pic'">
<single-pic v-model="scope.row[scope.column.property]" type="image" :num="1" :width="60"
:height="60" align="center"/>
</div>
<div v-else-if="scope.column.property.indexOf('value') != -1">
{{ scope.row[scope.column.property] }}
</div>
<div v-else-if="scope.column.property == 'pink_price'||scope.column.property == 'pink_stock'">
<el-input v-model="scope.row[scope.column.property]" align="center"/>
</div>
<div v-else-if="scope.column.property == 'action'" align="center">
<a :disabled="true" align="center">不可删除</a>
</div>
<div v-else>
<el-input v-model="scope.row[scope.column.property]" :disabled="true" align="center"/>
</div>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-col>
</el-col>
<!-- 单规格表格-->
<el-col :xl="23" :lg="24" :md="24" :sm="24" :xs="24" v-if="formValidate.spec_type === 0">
<el-form-item>
<el-table :data="oneFormValidate" size="small" style="width: 90%;">
<el-table-column prop="pic" label="图片" align="center">
<template slot-scope="scope">
<single-pic v-model="scope.row.pic" type="image" :num="1" :width="60" :height="60"/>
</template>
</el-table-column>
<el-table-column prop="bar_code" label="商品编号" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.bar_code" :disabled="true"/>
</template>
</el-table-column>
<el-table-column prop="price" label="售价" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.price" :disabled="true"/>
</template>
</el-table-column>
<el-table-column prop="cost" label="成本价" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.cost" :disabled="true"/>
</template>
</el-table-column>
<el-table-column prop="ot_price" label="原价" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.ot_price" :disabled="true"/>
</template>
</el-table-column>
<el-table-column prop="stock" label="库存" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.stock" maxlength="7" :disabled="true"/>
</template>
</el-table-column>
<el-table-column prop="stock" label="拼团价" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.pink_price"/>
</template>
</el-table-column>
<el-table-column prop="stock" label="拼团库存" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.pink_stock" maxlength="7"/>
</template>
</el-table-column>
<el-table-column prop="weight" label="重量(KG" align="center ">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.weight" :disabled="true"/>
</template>
</el-table-column>
<el-table-column prop="volume" label="体积(m³)" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.volume" :disabled="true"/>
</template>
</el-table-column>
<el-table-column prop="volume" label="所需兑换积分" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.integral"/>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="运费模板:" prop="temp_id">
<div class="acea-row">
<el-select v-model="formValidate.temp_id" class="mr20" :disabled="true">
<el-option v-for="(item,index) in templateList" :value="item.id" :key="index" :label="item.name">
</el-option>
</el-select>
</div>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="商品详情:">
<ueditor-wrap v-model="formValidate.description" :config="myConfig" @beforeInit="addCustomDialog"
style="width: 90%;"></ueditor-wrap>
</el-form-item>
</el-col>
</el-row>
<el-form-item>
<el-button type="primary" class="submission" @click="handleSubmit('formValidate')">保存</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</template>
<script>
import cgood from '@/views/components/good'
import {getInfo, isFormatAttrForActivity} from '@/api/bxg/yxStoreProduct'
import {add, edit, getCombinationInfo, onsaleCombination, delCombination} from '@/api/bxg/yxStoreCombination'
import editor from '../../components/Editor'
import picUpload from '@/components/pic-upload'
import mulpicUpload from '@/components/mul-pic-upload'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import MaterialList from '@/components/material'
import singlePic from '@/components/singlematerial'
import UeditorWrap from 'vue-ueditor-wrap';
export default {
components: {editor, picUpload, mulpicUpload, Treeselect, MaterialList, UeditorWrap, singlePic, cgood},
data() {
return {
spinShow: false,
// 批量设置表格data
oneFormBatch: [
{
pic: '',
price: 0,
cost: 0,
ot_price: 0,
stock: 0,
bar_code: '',
pink_stock: 0,
pink_price: 0,
weight: 0,
volume: 0,
integral: 0
}
],
// 规格数据
formDynamic: {
attrsName: '',
attrsVal: ''
},
formDynamicNameData: [],
isBtn: false,
myConfig: {
autoHeightEnabled: false, // 编辑器不自动被内容撑高
initialFrameHeight: 500, // 初始容器高度
initialFrameWidth: '100%', // 初始容器宽度
UEDITOR_HOME_URL: '/UEditor/',
serverUrl: ''
},
form1: {
good: {
productId: null,
storeName: null,
image: null,
otPrice: null,
price: null,
}
},
formValidate: {
slider_image: [],
is_sub: 0,
id: 0,
combinationId: 0,
productId: '',
merId: '',
image: '',
images: '',
imageArr: [],
sliderImageArr: [],
productPrice:0,
title: '',
attr: '',
people: 1,
info: '',
price: '',
sort: 0,
integral: 0,
sales: '',
stock: '',
addTime: '',
isHost: '',
isShow: 1,
isDel: 0,
merUse: '',
isPostage: '',
postage: '',
description: '',
startTime: '',
stopTime: '',
effectiveTime: 1,
cost: '',
unitName: '',
combination: 1,
browse: 0,
startTimeDate: '',
endTimeDate: '',
spec_type: 0,
temp_id: '',
attrs: [],
items: [
{
pic: '',
price: 0,
pink_stock: 0,
pink_price: 0,
cost: 0,
ot_price: 0,
stock: 0,
bar_code: '',
integral: 0
}
],
header: [],
selectRule: ''
},
ruleList: [],
templateList: [],
createBnt: false,
showIput: false,
manyFormValidate: [],
// 单规格表格data
oneFormValidate: [
{
imageArr: [],
pic: '',
price: 0,
cost: 0,
ot_price: 0,
stock: 0,
pink_stock: 0,
pink_price: 0,
seckill_stock: 0,
seckill_price: 0,
bar_code: '',
weight: 0,
volume: 0,
brokerage: 0,
brokerage_two: 0,
integral: 0
}
],
images: [],
loading: false,
treeSelect: [],
tableIndex: 0,
ruleValidate: {
title: [
{required: true, message: '请输入拼团名称', trigger: 'blur'}
],
info: [
{required: true, message: '请输入拼团简介', trigger: 'blur'}
],
unitName: [
{required: true, message: '请输入单位', trigger: 'blur'}
],
startTime: [
{required: true, message: '请选择开团时间', trigger: 'blur'}
],
stopTime: [
{required: true, message: '请选择开团结束时间', trigger: 'blur'}
],
isShow: [
{required: true, message: '请选择活动状态', trigger: 'change'}
],
temp_id: [
{required: true, message: '请选择运费模板', trigger: 'change', type: 'number'}
],
price: [
{required: true, message: '请输入拼团价格', trigger: 'blur'}
],
people: [
{required: true, message: '请选择拼团人数', trigger: 'change', type: 'number'}
],
spec_type: [
{required: true, message: '请选择商品规格', trigger: 'change'}
],
effectiveTime: [
{required: true, message: '请选择拼团时效', trigger: 'blur'}
]
},
attrs: []
}
},
watch: {
// 'formValidate.imageArr': function(val) {
// if (val) {
// this.form.image = val.join(',')
// }
// },
'formValidate.slider_image': function (val) {
if (val && Array.isArray(val)) {
this.formValidate.images = val.join(',')
}
},
'form1.good.productId': {
handler(val, oldVal) {
console.info("val:" + val)
console.info("oldval:" + oldVal)
if (val) {
this.getInfoChooseGood(val)
}
},
},
},
mounted() {
this.getInfo();
},
methods: {
onInput() {
this.$forceUpdate();
},
confirm() {
let that = this;
that.createBnt = true;
if (that.formValidate.selectRule.trim().length <= 0) {
return this.$message({
message: '请选择属性',
type: 'error'
});
}
that.ruleList.forEach(function (item, index) {
if (item.ruleName === that.formValidate.selectRule) {
that.attrs = item.ruleValue;
}
});
},
// 删除表格中的属性
delAttrTable(index) {
this.manyFormValidate.splice(index, 1);
},
// 添加按钮
addBtn() {
this.clearAttr();
this.createBnt = false;
this.showIput = true;
},
// 立即生成
generate(data) {
isFormatAttrForActivity(data === null ? this.formValidate.productId : data, {attrs: this.attrs}).then(res => {
this.manyFormValidate = res.value;
let headerdel = {
title: '操作',
slot: 'action',
fixed: 'right',
width: 220
};
res.header.push(headerdel);
this.formValidate.header = res.header;
//this.formValidate.attrs = res.attr;
let header = res.header;
header.pop();
if (!this.$route.params.id && this.formValidate.spec_type === 1) {
this.manyFormValidate.map((item) => {
item.pic = this.formValidate.image
});
this.oneFormBatch[0].pic = this.formValidate.image;
}
}).catch(res => {
this.$message.error(res.msg);
})
},
// 取消
offAttrName() {
this.showIput = false;
this.createBnt = true;
},
clearAttr() {
this.formDynamic.attrsName = '';
this.formDynamic.attrsVal = '';
},
// 删除规格
handleRemoveRole(index) {
this.attrs.splice(index, 1);
this.manyFormValidate.splice(index, 1);
},
// 删除属性
handleRemove2(item, index) {
item.splice(index, 1);
},
// 添加规则名称
createAttrName() {
if (this.formDynamic.attrsName && this.formDynamic.attrsVal) {
let data = {
value: this.formDynamic.attrsName,
detail: [
this.formDynamic.attrsVal
]
};
this.attrs.push(data);
var hash = {};
this.attrs = this.attrs.reduce(function (item, next) {
hash[next.value] ? '' : hash[next.value] = true && item.push(next);
return item
}, [])
this.clearAttr();
this.showIput = false;
this.createBnt = true;
} else {
this.$message.warning('请添加完整的规格!');
}
},
// 添加属性
createAttr(num, idx) {
if (num) {
this.attrs[idx].detail.push(num);
var hash = {};
this.attrs[idx].detail = this.attrs[idx].detail.reduce(function (item, next) {
hash[next] ? '' : hash[next] = true && item.push(next);
return item
}, [])
} else {
this.$message.warning('请添加属性!');
}
},
// 改变规格
changeSpec() {
},
// 详情选择商品生成规格用
getInfoChooseGood(id) {
let that = this;
let cid = that.$route.params.id || 0;
getInfo(id == null ? 0 : id).then(async res => {
let data = res.productInfo;
if (data) {
that.attrs = data.items || [];
//that.formValidate = data;
Object.keys(that.formValidate).forEach(key => {
if (data[key]) that.formValidate[key] = data[key];
})
that.formValidate.id = cid;
//that.formValidate.id = 0;
that.formValidate.productId = id
that.formValidate.title = data.store_name
that.formValidate.info = data.store_info
that.formValidate.unitName = data.unit_name
that.formValidate.isShow = 1
// that.formValidate.people = 0
// that.formValidate.effectiveTime = 0
that.oneFormValidate = [data.attr];
that.formValidate.productPrice = that.oneFormValidate[0].cost
that.formValidate.header = [];
that.generate(null);
that.manyFormValidate = data.attrs;
if (data.spec_type === 0) {
that.manyFormValidate = [];
} else {
that.createBnt = true;
that.oneFormValidate = [
{
pic: '',
price: 0,
seckill_stock: 0,
seckill_price: 0,
pink_stock: 0,
pink_price: 0,
cost: 0,
ot_price: 0,
stock: 0,
bar_code: '',
weight: 0,
volume: 0,
brokerage: 0,
brokerage_two: 0
}
]
}
}
that.treeSelect = res.cateList;
that.ruleList = res.ruleList;
that.templateList = res.tempList;
}).catch(res => {
this.$message.error(res.msg);
})
},
// 详情
getInfo() {
let that = this;
let id = that.$route.params.id || 0;
that.formValidate.id = id;
getCombinationInfo(id).then(async res => {
let data = res.productInfo;
if (data) {
let cate_id = parseInt(data.cate_id) || 0;
this.attrs = data.items || [];
that.formValidate = data;
that.formValidate.cate_id = cate_id;
that.oneFormValidate = [data.attr];
that.formValidate.productPrice = that.oneFormValidate[0].cost
that.formValidate.header = [];
that.generate(data.productId);
that.manyFormValidate = data.attrs;
that.form1.good.productId = data.productId;
that.form1.good.image = data.image
if (data.spec_type === 0) {
that.manyFormValidate = [];
} else {
that.createBnt = true;
that.oneFormValidate = [
{
pic: '',
price: 0,
seckill_stock: 0,
seckill_price: 0,
pink_stock: 0,
pink_price: 0,
cost: 0,
ot_price: 0,
stock: 0,
bar_code: '',
weight: 0,
volume: 0,
brokerage: 0,
brokerage_two: 0
}
]
}
}
that.treeSelect = res.cateList;
that.ruleList = res.ruleList;
that.templateList = res.tempList;
}).catch(res => {
this.$message.error(res.msg);
})
},
// 提交
handleSubmit(name) {
this.$refs[name].validate((valid) => {
if (valid) {
if (this.formValidate.spec_type === 0) {
this.formValidate.attrs = this.oneFormValidate;
this.formValidate.header = [];
this.formValidate.items = [];
} else {
this.formValidate.items = this.attrs;
this.formValidate.attrs = this.manyFormValidate;
}
if (this.formValidate.spec_type === 1 && this.manyFormValidate.length === 0) {
return this.$message.warning('请点击生成规格!');
}
add(this.formValidate).then(async res => {
this.$message({
message: '操作成功',
type: 'success'
});
setTimeout(() => {
this.$router.push({path: '/activity/combination'});
}, 500);
}).catch(res => {
this.$message.error(res.msg);
})
} else {
if (!this.formValidate.store_name || !this.formValidate.cate_id || !this.formValidate.keyword
|| !this.formValidate.unit_name || !this.formValidate.store_info
|| !this.formValidate.image || !this.formValidate.slider_image) {
this.$message.warning("请填写完整商品信息!");
}
}
})
},
// 表单验证
validate(prop, status, error) {
if (status === false) {
this.$message.warning(error);
}
},
addCustomDialog() {
window.UE.registerUI('yshop', function (editor, uiName) {
let dialog = new window.UE.ui.Dialog({
iframeUrl: '/yshop/materia/index',
editor: editor,
name: uiName,
title: '上传图片',
cssRules: 'width:1200px;height:500px;padding:20px;'
});
this.dialog = dialog;
var btn = new window.UE.ui.Button({
name: 'dialog-button',
title: '上传图片',
cssRules: `background-image: url(../../../assets/images/icons.png);background-position: -726px -77px;`,
onclick: function () {
dialog.render();
dialog.open();
}
});
return btn;
}, 37);
},
cancel() {
this.resetForm()
}
}
}
</script>
<style scoped lang="stylus">
.submission
margin-left 10px;
.color-list .tip {
color: #c9c9c9;
}
.color-list .color-item {
height: 30px;
line-height: 30px;
padding: 0 10px;
color: #fff;
margin-right: 10px;
}
.color-list .color-item.blue {
background-color: #1E9FFF;
}
.color-list .color-item.yellow {
background-color: rgb(254, 185, 0);
}
.color-list .color-item.green {
background-color: #009688;
}
.columnsBox
margin-right 10px
.priceBox
width 100%
.rulesBox
display flex
flex-wrap: wrap;
.curs
cursor pointer
</style>
@@ -0,0 +1,187 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="toAddURL"
>
新增
</el-button>
</div>
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
<!--表单组件-->
<!-- <eForm ref="form" :is-add="isAdd" />-->
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="id" />
<el-table-column prop="productId" label="商品id" />
<el-table-column prop="image" label="产品主图">
<template slot-scope="scope">
<a :href="scope.row.image" style="color: #42b983" target="_blank"><img :src="scope.row.image" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column prop="title" label="拼团名称" />
<el-table-column prop="people" label="参团人数" />
<el-table-column prop="price" label="拼团价" />
<el-table-column prop="cost" label="原价" />
<el-table-column prop="stock" label="库存" />
<el-table-column prop="browse" label="浏览量" />
<el-table-column prop="countPeopleAll" label="参与人数" />
<el-table-column prop="countPeoplePink" label="成团数量" />
<el-table-column prop="countPeopleBrowse" label="访客人数" />
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<div @click="onSale(scope.row.id,scope.row.isShow)">
<el-tag v-if="scope.row.isShow === 1" style="cursor: pointer" :type="''">已开启</el-tag>
<el-tag v-else style="cursor: pointer" :type=" 'info' ">已关闭</el-tag>
</div>
</template>
</el-table-column>
<el-table-column prop="stopTime" label="结束时间">
<template slot-scope="scope">
<span>{{ formatTimeTwo(scope.row.stopTime) }}</span>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_EDIT','YXSTORECOMBINATION_DELETE'])" label="操作" width="150px" align="center" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
icon="el-icon-edit"
@click="toUpdateURL(scope.row.id)"
>
编辑
</el-button>
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSTORECOMBINATION_ALL','YXSTORECOMBINATION_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del, onsale } from '@/api/bxg/yxStoreCombination'
import { formatTimeTwo, parseTime } from '@/utils/index'
export default {
components: { },
mixins: [initData],
data() {
return {
delLoading: false,
queryTypeOptions: [
{ key: 'title', display_name: '活动标题' }
]
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
toAddURL(){
this.$router.push({ path: '/activity/combinationAdd' })
},
toUpdateURL(id){
this.$router.push({ path: '/activity/combinationEdit/'+id })
},
parseTime,
formatTimeTwo,
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxStoreCombination'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
onSale(id, status) {
this.$confirm(`确定进行[${status ? '下架' : '上架'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
onsale(id, { status: status }).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1000,
onClose: () => {
this.init()
}
})
})
})
.catch(() => { })
}
}
}
</script>
<style scoped>
</style>
+159
View File
@@ -0,0 +1,159 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="用户id">
<el-input v-model="form.uid" style="width: 370px;" />
</el-form-item>
<el-form-item label="订单id 生成">
<el-input v-model="form.orderId" style="width: 370px;" />
</el-form-item>
<el-form-item label="订单id 数据库">
<el-input v-model="form.orderIdKey" style="width: 370px;" />
</el-form-item>
<el-form-item label="购买商品个数">
<el-input v-model="form.totalNum" style="width: 370px;" />
</el-form-item>
<el-form-item label="购买总金额">
<el-input v-model="form.totalPrice" style="width: 370px;" />
</el-form-item>
<el-form-item label="拼团产品id">
<el-input v-model="form.cid" style="width: 370px;" />
</el-form-item>
<el-form-item label="产品id">
<el-input v-model="form.pid" style="width: 370px;" />
</el-form-item>
<el-form-item label="拼图总人数">
<el-input v-model="form.people" style="width: 370px;" />
</el-form-item>
<el-form-item label="拼团产品单价">
<el-input v-model="form.price" style="width: 370px;" />
</el-form-item>
<el-form-item label="开始时间">
<el-input v-model="form.addTime" style="width: 370px;" />
</el-form-item>
<el-form-item label="stopTime">
<el-input v-model="form.stopTime" style="width: 370px;" />
</el-form-item>
<el-form-item label="团长id 0为团长">
<el-input v-model="form.kId" style="width: 370px;" />
</el-form-item>
<el-form-item label="是否发送模板消息0未发送1已发送">
<el-input v-model="form.isTpl" style="width: 370px;" />
</el-form-item>
<el-form-item label="是否退款 0未退款 1已退款">
<el-input v-model="form.isRefund" style="width: 370px;" />
</el-form-item>
<el-form-item label="状态1进行中2已完成3未完成">
<el-input v-model="form.status" style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/bxg/yxStorePink'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
uid: '',
orderId: '',
orderIdKey: '',
totalNum: '',
totalPrice: '',
cid: '',
pid: '',
people: '',
price: '',
addTime: '',
stopTime: '',
kId: '',
isTpl: '',
isRefund: '',
status: ''
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
uid: '',
orderId: '',
orderIdKey: '',
totalNum: '',
totalPrice: '',
cid: '',
pid: '',
people: '',
price: '',
addTime: '',
stopTime: '',
kId: '',
isTpl: '',
isRefund: '',
status: ''
}
}
}
}
</script>
<style scoped>
</style>
+162
View File
@@ -0,0 +1,162 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column
label="序号"
type="index"
width="50"
align="center">
</el-table-column>
<el-table-column prop="uid" label="参与人" width="150" >
<template slot-scope="scope">
头像<a :href="scope.row.userImg" style="color: #42b983" target="_blank"><img :src="scope.row.userImg" alt="点击打开" class="el-avatar"></a><br>
昵称{{ scope.row.nickname }}<br>
用户ID{{ scope.row.uid }}<br>
手机号{{ scope.row.phone }}
</template>
</el-table-column>
<el-table-column prop="createTime" label="开团时间" />
<el-table-column label="拼团产品"width="200">
<template slot-scope="scope">
产品主图<a :href="scope.row.image" style="color: #42b983" target="_blank"><img :src="scope.row.image" alt="点击打开" class="el-avatar"></a><br>
拼团名称{{ scope.row.product }}<br>
拼团 ID{{ scope.row.cid }}
</template>
</el-table-column>
<el-table-column prop="orderId" label="订单号" width="150" />
<el-table-column prop="totalPrice" label="拼团价" />
<el-table-column prop="people" label="几人团" />
<el-table-column prop="countPeople" label="几人参加" />
<el-table-column label="结束时间">
<template slot-scope="scope">
<span>{{ formatTimeTwo(scope.row.stopTime) }}</span>
</template>
</el-table-column>
<el-table-column label="状态">
<template slot-scope="scope">
<span v-if="scope.row.status == 1">进行中</span>
<span v-else-if="scope.row.status == 2">已完成</span>
<span v-else>未完成</span>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxStorePink'
import eForm from './form'
import { formatTimeTwo, parseTime } from '@/utils/index'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false,
queryTypeOptions: [
{ key: 'cid', display_name: '拼团id' }
]
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
parseTime,
formatTimeTwo,
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxStorePink'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
uid: data.uid,
orderId: data.orderId,
orderIdKey: data.orderIdKey,
totalNum: data.totalNum,
totalPrice: data.totalPrice,
cid: data.cid,
pid: data.pid,
people: data.people,
price: data.price,
addTime: data.addTime,
stopTime: data.stopTime,
kId: data.kId,
isTpl: data.isTpl,
isRefund: data.isRefund,
status: data.status
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+151
View File
@@ -0,0 +1,151 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="800px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="140px">
<el-form-item label="优惠券类型">
<el-radio-group v-model="form.type" @change="couponsType">
<el-radio :label=0>通用券</el-radio>
<el-radio :label=1>商品券</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="选择商品" v-if="form.type == 1">
<cgood v-model="form.product" @selectGoods="getGoods"></cgood>
</el-form-item>
<el-form-item label="优惠券名称">
<el-input v-model="form.title" style="width: 300px;" />
</el-form-item>
<el-form-item label="优惠券面值">
<el-input-number v-model="form.couponPrice" style="width: 300px;" />
</el-form-item>
<el-form-item label="优惠券最低消费">
<el-input-number v-model="form.useMinPrice" style="width: 300px;" />
</el-form-item>
<el-form-item label="优惠券有效期限(天)">
<el-input-number v-model="form.couponTime" style="width: 300px;" />
</el-form-item>
<el-form-item label="排序">
<el-input-number v-model="form.sort" style="width: 300px;" />
</el-form-item>
<el-form-item label="状态">
<el-radio v-model="form.status" :label="1">开启</el-radio>
<el-radio v-model="form.status" :label="0">关闭</el-radio>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/bxg/yxStoreCoupon'
import cgood from '@/views/components/goods'
export default {
components: { cgood },
props: {
isAdd: {
type: Boolean,
required: true
}
},
watch: {
"form.product":function(val){
if(val){
this.getGoods(val)
}
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
title: '',
integral: 0,
couponPrice: 0,
useMinPrice: 0,
couponTime: 1,
sort: 0,
status: 1,
type: 0,
productId: '',
product: []
},
rules: {
}
}
},
methods: {
getGoods(p) {
var ids = []
p.forEach((item,index) => {
ids.push(item.id)
})
this.form.productId = ids.join(",")
},
couponsType() {
//alert(this.form.type)
},
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
title: '',
integral: 0,
couponPrice: 0,
useMinPrice: 0,
couponTime: 1,
sort: 0,
status: 1,
type: 0,
productId: '',
product: []
}
}
}
}
</script>
<style scoped>
</style>
+197
View File
@@ -0,0 +1,197 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['admin','YXSTORECOUPON_ALL','YXSTORECOUPON_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<eIForm ref="form2" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<!--<el-table-column prop="id" label="ID"/>-->
<el-table-column prop="title" label="优惠券名称" />
<el-table-column prop="type" label="优惠券类型">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.type === 1" style="cursor: pointer" :type="''">商品券</el-tag>
<el-tag v-else :type=" 'info' ">普通券</el-tag>
</div>
</template>
</el-table-column>
<el-table-column prop="couponPrice" label="优惠券面值" />
<el-table-column prop="useMinPrice" label="优惠券最低消费" />
<el-table-column label="优惠券有效期限">
<template slot-scope="scope">
<span>{{ scope.row.couponTime }}</span>
</template>
</el-table-column>
<el-table-column prop="sort" label="排序" width="100" />
<el-table-column label="状态" width="100" align="center">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.status === 1" style="cursor: pointer" :type="''">开启</el-tag>
<el-tag v-else :type=" 'info' ">关闭</el-tag>
</div>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="140">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXSTORECOUPON_ALL','YXSTORECOUPON_EDIT','YXSTORECOUPON_DELETE'])" width="200" label="操作" align="center">
<template slot-scope="scope">
<el-button
v-permission="['admin','YXSTORECOUPON_ALL','YXSTORECOUPON_EDIT']"
size="mini"
type="primary"
@click="edit2(scope.row)"
>
发布
</el-button>
<el-dropdown size="mini" split-button type="primary" trigger="click">
操作
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>
<el-button
v-permission="['admin','YXSTORECOUPON_ALL','YXSTORECOUPON_EDIT']"
size="mini"
type="primary"
icon="el-icon-edit"
@click="edit(scope.row)"
>编辑</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSTORECOUPON_ALL','YXSTORECOUPON_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini">删除</el-button>
</el-popover>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxStoreCoupon'
import eForm from './form'
import eIForm from '../couponissue/form'
import { formatTime } from '@/utils/index'
export default {
components: { eForm, eIForm },
mixins: [initData],
data() {
return {
delLoading: false
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
formatTime,
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxStoreCoupon'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort, isDel: 0 }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
title: data.title,
integral: data.integral,
couponPrice: data.couponPrice,
useMinPrice: data.useMinPrice,
couponTime: data.couponTime,
sort: data.sort,
status: data.status,
type: data.type,
productId: data.productId,
product: data.product
}
_this.dialog = true
},
edit2(data) {
this.isAdd = true
const _this = this.$refs.form2
_this.form = {
cid: data.id,
cname: data.title,
ctype: data.type,
isPermanent: 0,
status: 1,
totalCount: 0,
remainCount: 0,
isDel: 0
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+140
View File
@@ -0,0 +1,140 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '发布优惠券'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
<el-form-item label="优惠券ID">
<el-input v-model="form.cid" style="width: 300px;" :disabled="true" />
<el-input v-model="form.ctype" type="hidden" />
</el-form-item>
<el-form-item label="优惠券名称">
<el-input v-model="form.cname" style="width: 300px;" :disabled="true" />
</el-form-item>
<el-form-item label="领取开启时间">
<template>
<el-date-picker
v-model="form.startTime"
type="datetime"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
<el-form-item label="券领结束时间">
<template>
<el-date-picker
v-model="form.endTime"
type="datetime"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
<el-form-item label="发布数量">
<el-input v-model="form.totalCount" style="width: 300px;" />
</el-form-item>
<el-form-item label="是否不限量">
<el-radio v-model="form.isPermanent" :label="1">不限量</el-radio>
<el-radio v-model="form.isPermanent" :label="0">限量</el-radio>
</el-form-item>
<el-form-item label="状态">
<el-radio v-model="form.status" :label="1">开启</el-radio>
<el-radio v-model="form.status" :label="0">关闭</el-radio>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/bxg/yxStoreCouponIssue'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
cid: '',
cname: '',
ctype: 0,
startTimeDate: '',
endTimeDate: '',
totalCount: 0,
remainCount: 0,
isPermanent: 0,
status: 1,
isDel: 0,
addTime: ''
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
cid: '',
startTime: '',
endTime: '',
totalCount: '',
remainCount: '',
isPermanent: '',
status: '',
isDel: '',
addTime: ''
}
}
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,108 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '修改状态'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
<el-form-item label="状态">
<el-radio v-model="form.status" :label="1">开启</el-radio>
<el-radio v-model="form.status" :label="0">关闭</el-radio>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/bxg/yxStoreCouponIssue'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
cid: '',
cname: '',
startTimeDate: '',
endTimeDate: '',
totalCount: 0,
remainCount: 0,
isPermanent: 0,
status: 1,
isDel: 0,
addTime: ''
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
// console.log(this.form)
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
cid: '',
startTime: '',
endTime: '',
totalCount: '',
remainCount: '',
isPermanent: '',
status: '',
isDel: '',
addTime: ''
}
}
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,154 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="id" />
<el-table-column prop="ctype" label="优惠券类型">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.ctype === 1" style="cursor: pointer" :type="''">商品券</el-tag>
<el-tag v-else :type=" 'info' ">普通券</el-tag>
</div>
</template>
</el-table-column>
<el-table-column prop="cname" label="优惠券名称" />
<el-table-column label="领取日期" prop="startTime">
<template slot-scope="scope">
<p>{{ formatTimeTwo(scope.row.startTime) }}</p>
<p>{{ formatTimeTwo(scope.row.endTime) }}</p>
</template>
</el-table-column>
<el-table-column label="发布数量" prop="totalCount">
<template slot-scope="scope">
<p>发布:{{ scope.row.totalCount }}</p>
<p>剩余:{{ scope.row.remainCount }}</p>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.status === 1" style="cursor: pointer" :type="''">开启</el-tag>
<el-tag v-else :type=" 'info' ">关闭</el-tag>
</div>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXSTORECOUPONISSUE_ALL','YXSTORECOUPONISSUE_EDIT','YXSTORECOUPONISSUE_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['admin','YXSTORECOUPONISSUE_ALL','YXSTORECOUPONISSUE_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSTORECOUPONISSUE_ALL','YXSTORECOUPONISSUE_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxStoreCouponIssue'
import eForm from './formt'
import { formatTimeTwo } from '@/utils/index'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
formatTimeTwo,
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxStoreCouponIssue'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
cid: data.cid,
startTime: data.startTime,
endTime: data.endTime,
startTimeDate: data.startTimeDate,
endTimeDate: data.endTimeDate,
totalCount: data.totalCount,
remainCount: data.remainCount,
isPermanent: data.isPermanent,
status: data.status,
isDel: data.isDel,
addTime: data.addTime
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,99 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="领取优惠券用户ID">
<el-input v-model="form.uid" style="width: 370px;" />
</el-form-item>
<el-form-item label="优惠券前台领取ID">
<el-input v-model="form.issueCouponId" style="width: 370px;" />
</el-form-item>
<el-form-item label="领取时间">
<el-input v-model="form.addTime" style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/bxg/yxStoreCouponIssueUser'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
uid: '',
issueCouponId: '',
addTime: ''
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
uid: '',
issueCouponId: '',
addTime: ''
}
}
}
}
</script>
<style scoped>
</style>
+121
View File
@@ -0,0 +1,121 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['admin','YXSTORECOUPONISSUEUSER_ALL','YXSTORECOUPONISSUEUSER_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="id" />
<el-table-column prop="uid" label="领取优惠券用户ID" />
<el-table-column prop="issueCouponId" label="优惠券前台领取ID" />
<el-table-column prop="addTime" label="领取时间" />
<el-table-column v-if="checkPermission(['admin','YXSTORECOUPONISSUEUSER_ALL','YXSTORECOUPONISSUEUSER_EDIT','YXSTORECOUPONISSUEUSER_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['admin','YXSTORECOUPONISSUEUSER_ALL','YXSTORECOUPONISSUEUSER_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSTORECOUPONISSUEUSER_ALL','YXSTORECOUPONISSUEUSER_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxStoreCouponIssueUser'
import eForm from './form'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxStoreCouponIssueUser'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
uid: data.uid,
issueCouponId: data.issueCouponId,
addTime: data.addTime
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+125
View File
@@ -0,0 +1,125 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="姓名">
<el-input v-model="form.realName" disabled style="width: 370px;" />
</el-form-item>
<el-form-item label="提现金额">
<el-input-number v-model="form.extractPrice" disabled style="width: 370px;" />
</el-form-item>
<el-form-item label="审核状态">
<el-radio v-model="form.status" :label="-1">无效</el-radio>
<el-radio v-model="form.status" :label="1">通过</el-radio>
</el-form-item>
<el-form-item label="无效原因">
<el-input v-model="form.failMsg" style="width: 300px;" rows="5" type="textarea" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/bxg/yxUserExtract'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
uid: '',
realName: '',
extractType: '',
bankCode: '',
bankAddress: '',
alipayCode: '',
extractPrice: '',
mark: '',
balance: '',
failMsg: '',
failTime: '',
addTime: '',
status: '',
wechat: ''
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
uid: '',
realName: '',
extractType: '',
bankCode: '',
bankAddress: '',
alipayCode: '',
extractPrice: '',
mark: '',
balance: '',
failMsg: '',
failTime: '',
addTime: '',
status: '',
wechat: ''
}
}
}
}
</script>
<style scoped>
</style>
+179
View File
@@ -0,0 +1,179 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="id" />
<el-table-column prop="extractPrice" label="提现金额" />
<el-table-column prop="extractType" label="提现方式">
<template slot-scope="scope">
<div v-if="scope.row.extractType=='weixin'">
姓名:{{ scope.row.realName }}<br>
微信号:{{ scope.row.wechat }}
</div>
<div v-else>
姓名:{{ scope.row.realName }}<br>
支付宝号:{{ scope.row.alipayCode }}
</div>
</template>
</el-table-column>
<el-table-column prop="addTime" label="添加时间">
<template slot-scope="scope">
<span>{{ formatTimeTwo(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="status" label="审核状态">
<template slot-scope="scope">
<div v-if="scope.row.status==1">
提现通过
</div>
<div v-else-if="scope.row.status==-1">
提现未通过<br>
未通过原因{{ scope.row.failMsg }}
<br>
未通过时间{{ formatTimeTwo(scope.row.failTime) }}
</div>
<div v-else>
未提现
</div>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXUSEREXTRACT_ALL','YXUSEREXTRACT_EDIT','YXUSEREXTRACT_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button
v-permission="['admin','YXUSEREXTRACT_ALL','YXUSEREXTRACT_EDIT']"
size="mini"
type="primary"
@click="edit(scope.row)"
>操作</el-button>
<!--<el-popover-->
<!--v-permission="['admin','YXUSEREXTRACT_ALL','YXUSEREXTRACT_DELETE']"-->
<!--:ref="scope.row.id"-->
<!--placement="top"-->
<!--width="180">-->
<!--<p>确定删除本条数据吗</p>-->
<!--<div style="text-align: right; margin: 0">-->
<!--<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>-->
<!--<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>-->
<!--</div>-->
<!--<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini"/>-->
<!--</el-popover>-->
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxUserExtract'
import eForm from './form'
import { formatTimeTwo } from '@/utils/index'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false,
queryTypeOptions: [
{ key: 'realName', display_name: '名称' }
]
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
formatTimeTwo,
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxUserExtract'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
uid: data.uid,
realName: data.realName,
extractType: data.extractType,
bankCode: data.bankCode,
bankAddress: data.bankAddress,
alipayCode: data.alipayCode,
extractPrice: data.extractPrice,
mark: data.mark,
balance: data.balance,
failMsg: data.failMsg,
failTime: data.failTime,
addTime: data.addTime,
status: data.status,
wechat: data.wechat
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+772
View File
@@ -0,0 +1,772 @@
<template>
<div class="app-container">
<el-card :bordered="false">
<el-form ref="formValidate" :rules="ruleValidate" :model="formValidate" label-width="130px" >
<el-row :gutter="24">
<!-- 商品信息-->
<el-col :span="24">
<el-form-item label="选择商品:" prop="good">
<cgood v-model="form1.good" ></cgood>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="秒杀名称">
<el-input v-model="formValidate.title" @input="onInput()" style="width: 500px;" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="秒杀简介">
<el-input v-model="formValidate.info" @input="onInput()" style="width: 500px;" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="单位">
<el-input v-model="formValidate.unitName" @input="onInput()" style="width: 500px;" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="秒杀开始时间">
<template>
<el-date-picker
v-model="formValidate.startTime"
type="date"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="秒杀结束时间">
<template>
<el-date-picker
v-model="formValidate.stopTime"
type="date"
placeholder="选择日期时间"
/>
</template>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="开始时间" prop="storeId">
<el-select v-model="formValidate.timeId" style="width: 178px" placeholder="请先选择开始时间">
<el-option
v-for="(item, index) in myTimes"
:key="index"
:label="item.map.time + '点开始,持续' + item.map.continued + '小时'"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="产品主图片">
<single-pic v-model="formValidate.image" style="width: 500px" type="image" :num="1" :width="150" :height="150" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="产品轮播图">
<MaterialList v-model="formValidate.slider_image" style="width: 500px" type="image" :num="4" :width="150" :height="150" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="活动状态">
<el-radio v-model="formValidate.status" :label="1">开启</el-radio>
<el-radio v-model="formValidate.status" :label="0" style="width: 200px;">关闭</el-radio>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="限购">
<el-input-number v-model="formValidate.num" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="商品规格:" props="spec_type">
<el-radio-group v-model="formValidate.spec_type" @change="changeSpec" :disabled="true">
<el-radio :label="0" class="radio">单规格</el-radio>
<el-radio :label="1">多规格{{formValidate.spec_typ}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<!-- 多规格设置-->
<el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24" v-if="manyFormValidate.length && formValidate.header.length!==0 && attrs.length!==0">
<!-- 多规格表格-->
<el-col :span="24">
<el-form-item label="商品属性:" class="labeltop">
<el-table :data="manyFormValidate" size="small" style="width: 90%;">
<el-table-column type="myindex" v-for="(item,index) in formValidate.header" :key="index" :label="item.title" :property="item.slot" align="center">
<template slot-scope="scope">
<div v-if="scope.column.property == 'pic'">
<single-pic v-model="scope.row[scope.column.property]" type="image" :num="1" :width="60" :height="60" align="center"/>
</div>
<div v-else-if="scope.column.property.indexOf('value') != -1" align="center">
{{ scope.row[scope.column.property] }}
</div>
<div v-else-if="scope.column.property == 'seckill_price'||scope.column.property == 'seckill_stock'" align="center" >
<el-input v-model="scope.row[scope.column.property]"/>
</div>
<div v-else-if="scope.column.property == 'action'" align="center" >
<a :disabled="true">不可删除</a>
</div>
<div v-else>
<el-input v-model="scope.row[scope.column.property]" :disabled="true" align="center"/>
</div>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-col>
</el-col>
<!-- 单规格表格-->
<el-col :xl="23" :lg="24" :md="24" :sm="24" :xs="24" v-if="formValidate.spec_type === 0">
<el-form-item >
<el-table :data="oneFormValidate" size="small" style="width: 90%;">
<el-table-column prop="pic" label="图片" align="center">
<template slot-scope="scope">
<single-pic v-model="scope.row.pic" type="image" :num="1" :width="60" :height="60" />
</template>
</el-table-column>
<el-table-column prop="bar_code" label="商品编号" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.bar_code" :disabled="true"/>
</template>
</el-table-column>
<el-table-column prop="price" label="售价" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.price":disabled="true"/>
</template>
</el-table-column>
<el-table-column prop="cost" label="成本价" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.cost" :disabled="true"/>
</template>
</el-table-column>
<el-table-column prop="ot_price" label="原价" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.ot_price" :disabled="true"/>
</template>
</el-table-column>
<el-table-column prop="stock" label="库存" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.stock" maxlength="7" :disabled="true"/>
</template>
</el-table-column>
<el-table-column prop="stock" label="秒杀价" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.seckill_price" />
</template>
</el-table-column>
<el-table-column prop="stock" label="秒杀库存" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.seckill_stock" maxlength="7"/>
</template>
</el-table-column>
<el-table-column prop="weight" label="重量(KG" align="center ">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.weight" :disabled="true"/>
</template>
</el-table-column>
<el-table-column prop="volume" label="体积(m³)" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.volume" :disabled="true"/>
</template>
</el-table-column>
<el-table-column prop="volume" label="所需兑换积分" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.integral"/>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="运费模板:" prop="temp_id">
<div class="acea-row">
<el-select v-model="formValidate.temp_id" class="mr20" :disabled="true">
<el-option v-for="(item,index) in templateList" :value="item.id" :key="index" :label="item.name">
</el-option>
</el-select>
</div>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="商品详情:">
<ueditor-wrap v-model="formValidate.description" :config="myConfig" @beforeInit="addCustomDialog" style="width: 90%;"></ueditor-wrap>
</el-form-item>
</el-col>
</el-row>
<el-form-item>
<el-button type="primary" class="submission" @click="handleSubmit('formValidate')">保存</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</template>
<script>
import cgood from '@/views/components/good'
import { initData } from '@/api/bxg/data'
import { getInfo, isFormatAttrForActivity } from '@/api/bxg/yxStoreProduct'
import { add, edit,getSecKillInfo } from '@/api/bxg/yxStoreSeckill'
import editor from '../../components/Editor'
import picUpload from '@/components/pic-upload'
import mulpicUpload from '@/components/mul-pic-upload'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import MaterialList from '@/components/material'
import singlePic from '@/components/singlematerial'
import UeditorWrap from 'vue-ueditor-wrap';
export default {
components: { editor, picUpload, mulpicUpload, Treeselect, MaterialList, UeditorWrap, singlePic,cgood },
data() {
return {
isAdd:false,// 是否是添加
spinShow: false,myTimes: [],
// 批量设置表格data
oneFormBatch: [
{
pic: '',
price: 0,
cost: 0,
ot_price: 0,
stock: 0,
bar_code: '',
seckill_stock: 0,
seckill_price: 0,
weight: 0,
volume: 0,
integral:0
}
],
// 规格数据
formDynamic: {
attrsName: '',
attrsVal: ''
},
isBtn: false,
myConfig: {
autoHeightEnabled: false, // 编辑器不自动被内容撑高
initialFrameHeight: 500, // 初始容器高度
initialFrameWidth: '100%', // 初始容器宽度
UEDITOR_HOME_URL: '/UEditor/',
serverUrl: ''
},
form1: {
good:{
productId: null,
storeName: null,
image: null,
otPrice: null,
price: null,
cform: null
}
},
formValidate: {
slider_image: [],
otPrice: '',
giveIntegral: '',
status: '',
num: 1,
id: 0,
timeId: null,
seckillId: 0,
productId: '',
merId: '',
image: '',
images: '',
imageArr:[],
sliderImageArr: [],
title: '',
attr: '',
people: '',
info: '',
price: '',
sort: 0,
sales: '',
stock: '',
integral: 0,
addTime: '',
isHost: '',
isShow: '',
isDel: 0,
merUse: '',
isPostage: '',
postage: 0,
description: '',
startTime: '',
stopTime: '',
effectiveTime: '',
cost: '',
unitName: '',
combination: 1,
browse: 0,
startTimeDate: '',
endTimeDate: '',
is_sub: '',
spec_type: 0,
temp_id: '',
attrs: [],
items: [
{
pic: '',
price: 0,
pink_stock: 0,
pink_price: 0,
cost: 0,
ot_price: 0,
stock: 0,
bar_code: '',
integral: 0
}
],
header: [],
selectRule: ''
},
ruleList: [],
templateList: [],
createBnt: false,
showIput: false,
manyFormValidate: [],
// 单规格表格data
oneFormValidate: [
{
imageArr: [],
pic: '',
price: 0,
cost: 0,
ot_price: 0,
stock: 0,
pink_stock: 0,
pink_price: 0,
seckill_stock: 0,
seckill_price: 0,
bar_code: '',
weight: 0,
volume: 0,
brokerage: 0,
integral: 0,
brokerage_two: 0
}
],
images: [],
grid: {
xl: 8,
lg: 8,
md: 12,
sm: 24,
xs: 24
},
loading: false,
treeSelect: [],
tableIndex: 0,
ruleValidate: {
store_name: [
{ required: true, message: '请输入商品名称', trigger: 'blur' }
],
cate_id: [
{ required: true, message: '请选择商品分类', trigger: 'change' }
],
keyword: [
{ required: true, message: '请输入商品关键字', trigger: 'blur' }
],
unit_name: [
{ required: true, message: '请输入单位', trigger: 'blur' }
],
store_info: [
{ required: true, message: '请输入商品简介', trigger: 'blur' }
],
spec_type: [
{ required: true, message: '请选择商品规格', trigger: 'change' }
],
selectRule: [
{ required: true, message: '请选择商品规格属性', trigger: 'change' }
],
temp_id: [
{ required: true, message: '请选择运费模板', trigger: 'change', type: 'number' }
]
},
attrs: []
}
},
watch: {
'formValidate.slider_image': function(val) {
if (val && Array.isArray(val)) {
this.formValidate.images = val.join(',')
}
},
'form1.good.productId': {
handler(val,oldVal){
if(val){
this.getInfoChooseGood (val)
}
},
},
},
mounted () {
this.getInfo(),
initData('api/yxSystemGroupData',{ groupName: 'yshop_seckill_time',status:1 }).then(res => {
this.myTimes = res.content
})
if(this.$route.params.id){
this.isAdd = false
} else {
this.isAdd = true
}
},
methods: {
onInput(){
this.$forceUpdate();
},
confirm () {
let that = this;
that.createBnt = true;
if (that.formValidate.selectRule.trim().length <= 0) {
return this.$message({
message:'请选择属性',
type: 'error'
});
}
that.ruleList.forEach(function (item, index) {
if (item.ruleName === that.formValidate.selectRule) {
that.attrs = item.ruleValue;
}
});
},
// 删除表格中的属性
delAttrTable (index) {
this.manyFormValidate.splice(index, 1);
},
// 添加按钮
addBtn () {
this.clearAttr();
this.createBnt = false;
this.showIput = true;
},
// 立即生成
generate (data) {
isFormatAttrForActivity(data===null?this.formValidate.productId:data, { attrs: this.attrs }).then(res => {
this.manyFormValidate = res.value;
let headerdel = {
title: '操作',
slot: 'action',
fixed: 'right',
width: 220
};
res.header.push(headerdel);
this.formValidate.header = res.header;
//this.formValidate.attrs = res.attr;
let header = res.header;
header.pop();
if (!this.$route.params.id && this.formValidate.spec_type === 1) {
this.manyFormValidate.map((item) => {
item.pic = this.formValidate.image
});
this.oneFormBatch[0].pic = this.formValidate.image;
}
}).catch(res => {
this.$message.error(res.msg);
})
},
// 取消
offAttrName () {
this.showIput = false;
this.createBnt = true;
},
clearAttr () {
this.formDynamic.attrsName = '';
this.formDynamic.attrsVal = '';
},
// 删除规格
handleRemoveRole (index) {
this.attrs.splice(index, 1);
this.manyFormValidate.splice(index, 1);
},
// 删除属性
handleRemove2 (item, index) {
item.splice(index, 1);
},
// 添加规则名称
createAttrName () {
if (this.formDynamic.attrsName && this.formDynamic.attrsVal) {
let data = {
value: this.formDynamic.attrsName,
detail: [
this.formDynamic.attrsVal
]
};
this.attrs.push(data);
var hash = {};
this.attrs = this.attrs.reduce(function (item, next) {
hash[next.value] ? '' : hash[next.value] = true && item.push(next);
return item
}, [])
this.clearAttr();
this.showIput = false;
this.createBnt = true;
} else {
this.$message.warning('请添加完整的规格!');
}
},
// 添加属性
createAttr (num, idx) {
if (num) {
this.attrs[idx].detail.push(num);
var hash = {};
this.attrs[idx].detail = this.attrs[idx].detail.reduce(function (item, next) {
hash[next] ? '' : hash[next] = true && item.push(next);
return item
}, [])
} else {
this.$message.warning('请添加属性!');
}
},
// 改变规格
changeSpec () {
},
// 详情选择商品生成规格用
getInfoChooseGood (id) {
let that = this;
let cid = that.$route.params.id || 0;
getInfo(id).then(async res => {
let data = res.productInfo;
console.log('data:'+data)
if(data){
let cate_id = parseInt(data.cate_id) || 0;
that.attrs = data.items || [];
//that.formValidate = data;
Object.keys(that.formValidate).forEach(key=>{
if(data[key]) that.formValidate[key] = data[key];
})
that.formValidate.id = cid;
that.formValidate.productId = id
that.formValidate.cate_id = cate_id;
that.oneFormValidate = [data.attr];
that.formValidate.title = data.store_name
that.formValidate.info = data.store_info
that.formValidate.unitName = data.unit_name
//that.formValidate.sliderImageArr = data.slider_image
that.formValidate.status = 1
//that.formValidate.num = 1
that.formValidate.header = [];
that.generate(null);
that.manyFormValidate = data.attrs;
if(data.spec_type === 0){
that.manyFormValidate = [];
}else {
that.createBnt = true;
that.oneFormValidate = [
{
pic: '',
price: 0,
seckill_stock: 0,
seckill_price: 0,
pink_stock: 0,
pink_price: 0,
cost: 0,
ot_price: 0,
stock: 0,
bar_code: '',
weight:0,
volume:0,
brokerage:0,
integral: 0,
brokerage_two:0
}
]
}
}
that.treeSelect = res.cateList;
that.ruleList = res.ruleList;
that.templateList = res.tempList;
}).catch(res => {
console.log('err:'+res)
this.$message.error(res.msg);
})
},
// 详情
getInfo () {
let that = this;
let id = that.$route.params.id || 0;
getSecKillInfo(id).then(async res => {
let data = res.productInfo;
if(data){
let cate_id = parseInt(data.cate_id) || 0;
this.attrs = data.items || [];
that.formValidate = data;
that.formValidate.cate_id = cate_id;
that.oneFormValidate = [data.attr];
that.formValidate.header = [];
that.formValidate.image = data.image
that.formValidate.sliderImageArr = data.slider_image
that.form1.good.productId = data.productId
that.form1.good.image = data.image
that.generate(data.productId);
that.manyFormValidate = data.attrs;
console.log(data)
if(data.spec_type === 0){
that.manyFormValidate = [];
}else {
that.createBnt = true;
that.oneFormValidate = [
{
pic: '',
price: 0,
seckill_stock: 0,
seckill_price: 0,
pink_stock: 0,
pink_price: 0,
cost: 0,
ot_price: 0,
stock: 0,
bar_code: '',
weight:0,
volume:0,
brokerage:0,
integral: 0,
brokerage_two:0
}
]
}
}
that.treeSelect = res.cateList;
that.ruleList = res.ruleList;
that.templateList = res.tempList;
}).catch(res => {
this.$message.error(res.msg);
})
},
// 提交
handleSubmit (name) {
this.$refs[name].validate((valid) => {
if (valid) {
if(this.formValidate.spec_type ===0 ){
this.formValidate.attrs = this.oneFormValidate;
this.formValidate.header = [];
this.formValidate.items = [];
}else{
this.formValidate.items = this.attrs;
this.formValidate.attrs = this.manyFormValidate;
}
if(this.formValidate.spec_type === 1 && this.manyFormValidate.length===0){
return this.$message.warning('请点击生成规格!');
}
// 判断是否是添加
if(this.isAdd){
console.log(this.formValidate)
add(this.formValidate).then(res=>{
this.$message({
message:'操作成功',
type: 'success'
});
setTimeout(() => {
this.$router.push({ path: '/activity/seckill' });
}, 500);
}).catch(res => {
this.$message.error(res.msg);
})
}else{
add(this.formValidate).then(async res => {
this.$message({
message:'操作成功',
type: 'success'
});
setTimeout(() => {
this.$router.push({ path: '/activity/seckill' });
}, 500);
}).catch(res => {
this.$message.error(res.msg);
})
}
} else {
if(!this.formValidate.store_name || !this.formValidate.cate_id || !this.formValidate.keyword
|| !this.formValidate.unit_name || !this.formValidate.store_info
|| !this.formValidate.image || !this.formValidate.slider_image){
this.$message.warning("请填写完整商品信息!");
}
}
})
},
// 表单验证
validate (prop, status, error) {
if (status === false) {
this.$message.warning(error);
}
},
addCustomDialog () {
window.UE.registerUI('yshop', function (editor, uiName) {
let dialog = new window.UE.ui.Dialog({
iframeUrl: '/yshop/materia/index',
editor: editor,
name: uiName,
title: '上传图片',
cssRules: 'width:1200px;height:500px;padding:20px;'
});
this.dialog = dialog;
var btn = new window.UE.ui.Button({
name: 'dialog-button',
title: '上传图片',
cssRules: `background-image: url(../../../assets/images/icons.png);background-position: -726px -77px;`,
onclick: function () {
dialog.render();
dialog.open();
}
});
return btn;
}, 37);
},
cancel() {
this.resetForm()
}
}
}
</script>
<style scoped lang="stylus">
.submission
margin-left 10px;
.color-list .tip{
color: #c9c9c9;
}
.color-list .color-item{
height: 30px;
line-height: 30px;
padding: 0 10px;
color:#fff;
margin-right :10px;
}
.color-list .color-item.blue{
background-color: #1E9FFF;
}
.color-list .color-item.yellow{
background-color: rgb(254, 185, 0);
}
.color-list .color-item.green{
background-color: #009688;
}
.columnsBox
margin-right 10px
.priceBox
width 100%
.rulesBox
display flex
flex-wrap: wrap;
.curs
cursor pointer
</style>
+151
View File
@@ -0,0 +1,151 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="toAddURL"
>
新增
</el-button>
</div>
</div>
<!--表单组件-->
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="id" />
<el-table-column prop="image" label="产品主图">
<template slot-scope="scope">
<a :href="scope.row.image" style="color: #42b983" target="_blank"><img :src="scope.row.image" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column prop="title" label="产品标题" />
<el-table-column prop="price" label="秒杀价" />
<el-table-column prop="otPrice" label="原价" />
<el-table-column prop="stock" label="库存" />
<el-table-column prop="sales" label="销量" />
<el-table-column prop="num" label="限购" />
<el-table-column prop="statusStr" label="秒杀状态" />
<el-table-column prop="stopTime" label="开始时间">
<template slot-scope="scope">
<span>{{ formatTimeTwo(scope.row.startTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="stopTime" label="结束时间">
<template slot-scope="scope">
<span>{{ formatTimeTwo(scope.row.stopTime) }}</span>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXSTORESECKILL_ALL','YXSTORESECKILL_EDIT','YXSTORESECKILL_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
icon="el-icon-edit"
@click="toUpdateURL(scope.row.id)"
>
编辑
</el-button>
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSTORESECKILL_ALL','YXSTORESECKILL_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxStoreSeckill'
import { formatTimeTwo, parseTime } from '@/utils/index'
export default {
mixins: [initData],
data() {
return {
delLoading: false,
queryTypeOptions: [
{ key: 'title', display_name: '产品标题' }
]
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
toAddURL(){
this.$router.push({ path: '/activity/secKillAdd' })
},
toUpdateURL(id){
this.$router.push({ path: '/activity/secKillEdit/'+id })
},
parseTime,
formatTimeTwo,
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxStoreSeckill'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
}
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,139 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="兑换的项目id">
<el-input v-model="form.cid" style="width: 370px;" />
</el-form-item>
<el-form-item label="优惠券所属用户">
<el-input v-model="form.uid" style="width: 370px;" />
</el-form-item>
<el-form-item label="优惠券名称">
<el-input v-model="form.couponTitle" style="width: 370px;" />
</el-form-item>
<el-form-item label="优惠券的面值">
<el-input v-model="form.couponPrice" style="width: 370px;" />
</el-form-item>
<el-form-item label="最低消费多少金额可用优惠券">
<el-input v-model="form.useMinPrice" style="width: 370px;" />
</el-form-item>
<el-form-item label="优惠券创建时间">
<el-input v-model="form.addTime" style="width: 370px;" />
</el-form-item>
<el-form-item label="优惠券结束时间">
<el-input v-model="form.endTime" style="width: 370px;" />
</el-form-item>
<el-form-item label="使用时间">
<el-input v-model="form.useTime" style="width: 370px;" />
</el-form-item>
<el-form-item label="获取方式">
<el-input v-model="form.type" style="width: 370px;" />
</el-form-item>
<el-form-item label="状态(0:未使用,1:已使用, 2:已过期)">
<el-input v-model="form.status" style="width: 370px;" />
</el-form-item>
<el-form-item label="是否有效">
<el-input v-model="form.isFail" style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/bxg/yxStoreCouponUser'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
cid: '',
uid: '',
couponTitle: '',
couponPrice: '',
useMinPrice: '',
addTime: '',
endTime: '',
useTime: '',
type: '',
status: '',
isFail: ''
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
cid: '',
uid: '',
couponTitle: '',
couponPrice: '',
useMinPrice: '',
addTime: '',
endTime: '',
useTime: '',
type: '',
status: '',
isFail: ''
}
}
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,158 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="couponTitle" label="优惠券名称" />
<el-table-column prop="nickname" label="所属用户" />
<el-table-column prop="couponPrice" label="优惠券的面值" />
<el-table-column prop="useMinPrice" label="优惠券最低消费" />
<el-table-column label="优惠券开始时间">
<template slot-scope="scope">
{{ formatTimeTwo(scope.row.addTime) }}
</template>
</el-table-column>
<el-table-column label="优惠券结束时间">
<template slot-scope="scope">
{{ formatTimeTwo(scope.row.endTime) }}
</template>
</el-table-column>
<el-table-column label="获取方式">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.type == 'get'" style="cursor: pointer" :type="''">手动领取</el-tag>
<el-tag v-else :type=" 'info' ">后台发放</el-tag>
</div>
</template>
</el-table-column>
<el-table-column label="是否可用">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.status == 0 && scope.row.isFail == 0" style="cursor: pointer" :type="''">可用</el-tag>
<el-tag v-else :type=" 'info' ">不可用</el-tag>
</div>
</template>
</el-table-column>
<el-table-column label="状态">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.status == 2">已过期</el-tag>
<el-tag v-if="scope.row.status == 1">已使用</el-tag>
<el-tag v-else>未使用</el-tag>
</div>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxStoreCouponUser'
import eForm from './form'
import { formatTimeTwo } from '@/utils/index'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false,
queryTypeOptions: [
{ key: 'couponTitle', display_name: '优惠券名称' }
]
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
formatTimeTwo,
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxStoreCouponUser'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
cid: data.cid,
uid: data.uid,
couponTitle: data.couponTitle,
couponPrice: data.couponPrice,
useMinPrice: data.useMinPrice,
addTime: data.addTime,
endTime: data.endTime,
useTime: data.useTime,
type: data.type,
status: data.status,
isFail: data.isFail
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+124
View File
@@ -0,0 +1,124 @@
<template>
<div class="dashboard-container">
<div class="dashboard-editor-container">
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
<heat-map />
</el-row>
<el-row :gutter="32">
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<radar-chart />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<sunburst />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<gauge />
</div>
</el-col>
</el-row>
<el-row :gutter="12">
<el-col :span="12">
<div class="chart-wrapper">
<rich />
</div>
</el-col>
<el-col :span="12">
<div class="chart-wrapper">
<theme-river />
</div>
</el-col>
</el-row>
<el-row :gutter="32">
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<graph />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<sankey />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<line3-d />
</div>
</el-col>
</el-row>
<el-row :gutter="12">
<el-col :span="12">
<div class="chart-wrapper">
<scatter />
</div>
</el-col>
<el-col :span="12">
<div class="chart-wrapper">
<point />
</div>
</el-col>
</el-row>
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
<div class="chart-wrapper">
<word-cloud />
</div>
</el-row>
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
<div class="chart-wrapper">
<category />
</div>
</el-row>
</div>
</div>
</template>
<script>
import RadarChart from '@/components/Echarts/RadarChart'
import HeatMap from '@/components/Echarts/HeatMap'
import Gauge from '@/components/Echarts/Gauge'
import Rich from '@/components/Echarts/Rich'
import ThemeRiver from '@/components/Echarts/ThemeRiver'
import Sunburst from '@/components/Echarts/Sunburst'
import Graph from '@/components/Echarts/Graph'
import Sankey from '@/components/Echarts/Sankey'
import Scatter from '@/components/Echarts/Scatter'
import Line3D from '@/components/Echarts/Line3D'
import Category from '@/components/Echarts/Category'
import Point from '@/components/Echarts/Point'
import WordCloud from '@/components/Echarts/WordCloud'
export default {
name: 'Echarts',
components: {
Point,
Category,
Graph,
HeatMap,
RadarChart,
Sunburst,
Gauge,
Rich,
ThemeRiver,
Sankey,
Line3D,
Scatter,
WordCloud
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.dashboard-editor-container {
padding: 18px 22px 22px 22px;
background-color: rgb(240, 242, 245);
.chart-wrapper {
background: #fff;
padding: 16px 16px 0;
margin-bottom: 32px;
}
}
</style>
+73
View File
@@ -0,0 +1,73 @@
<template>
<div>
<div ref="editor" style="text-align:left;margin: 5px;width: 700px" />
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import E from 'wangeditor'
import { getToken } from '@/utils/auth'
export default {
name: 'Editor',
model: {
prop: 'value',
event: 'change'
},
props: {
value: {
type: String,
default: ''
}
},
data() {
return {
headers: {
'Authorization': getToken()
},
info: null,
editor: null
}
},
computed: {
...mapGetters([
'uploadApi'
])
},
watch: {
value: function(val) {
this.editor.txt.html(val)
// this.editor.txt.html(val)
}
},
mounted() {
this.editor = new E(this.$refs.editor)
this.editor.customConfig = this.editor.customConfig ? this.editor.customConfig : this.editor.config
this.editor.customConfig.uploadImgShowBase64 = true // 使用 base64 保存图片
// 不可修改
this.editor.customConfig.uploadImgHeaders = this.headers
// 自定义文件名,不可修改,修改后会上传失败
this.editor.customConfig.uploadFileName = 'file'
this.editor.customConfig.uploadImgServer = this.uploadApi // 上传图片到服务器
this.editor.customConfig.uploadImgHooks = {
customInsert: function(insertImg, result, editor) {
var url = result.link
insertImg(url)
}
}
this.editor.customConfig.onchange = (html) => {
this.info = html
this.$emit('change', this.info)
this.$emit('input', this.info)
}
this.editor.create()
this.editor.txt.html(this.value)
}
}
</script>
<style scoped>
.editor-content{
padding-left: 5px;
}
</style>
+44
View File
@@ -0,0 +1,44 @@
<template>
<div class="app-container">
<p class="warn-content">
Markdown 基于
<el-link type="primary" href="https://github.com/hinesboy/mavonEditor" target="_blank">MavonEditor</el-link>
图片上传使用 <el-link type="primary" href="https://sm.ms/" target="_blank">SM.MS</el-link>
</p>
<mavon-editor ref="md" :style="'height:' + height" @imgAdd="imgAdd" />
</div>
</template>
<script>
import { upload } from '@/utils/upload'
import { mapGetters } from 'vuex'
export default {
name: 'Markdown',
data() {
return {
height: document.documentElement.clientHeight - 200 + 'px'
}
},
computed: {
...mapGetters([
'imagesUploadApi'
])
},
mounted() {
const that = this
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 200 + 'px'
}
},
methods: {
imgAdd(pos, $file) {
upload(this.imagesUploadApi, $file).then(data => {
this.$refs.md.$img2Url(pos, data.data.url)
})
}
}
}
</script>
<style scoped>
</style>
+207
View File
@@ -0,0 +1,207 @@
<template>
<div class="app-container">
<p class="warn-content">
Yaml编辑器 基于
<a href="https://github.com/codemirror/CodeMirror" target="_blank">CodeMirror</a>
主题预览地址 <a href="https://codemirror.net/demo/theme.html#idea" target="_blank">Theme</a>
</p>
<Yaml :value="value" :height="height" />
</div>
</template>
<script>
import Yaml from '@/components/YamlEdit/index'
export default {
name: 'YamlEdit',
components: { Yaml },
data() {
return {
height: document.documentElement.clientHeight - 210 + 'px',
value: '# 展示数据,如需更换主题,请在src/components/YamlEdit 目录中搜索原主题名称进行替换\n' +
'\n' +
'# ===================================================================\n' +
'# Spring Boot configuration.\n' +
'#\n' +
'# This configuration will be overridden by the Spring profile you use,\n' +
'# for example application-dev.yml if you use the "dev" profile.\n' +
'#\n' +
'# More information on profiles: https://www.jhipster.tech/profiles/\n' +
'# More information on configuration properties: https://www.jhipster.tech/common-application-properties/\n' +
'# ===================================================================\n' +
'\n' +
'# ===================================================================\n' +
'# Standard Spring Boot properties.\n' +
'# Full reference is available at:\n' +
'# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html\n' +
'# ===================================================================\n' +
'\n' +
'eureka:\n' +
' client:\n' +
' enabled: true\n' +
' healthcheck:\n' +
' enabled: true\n' +
' fetch-registry: true\n' +
' register-with-eureka: true\n' +
' instance-info-replication-interval-seconds: 10\n' +
' registry-fetch-interval-seconds: 10\n' +
' instance:\n' +
' appname: product\n' +
' instanceId: product:${spring.application.instance-id:${random.value}}\n' +
' #instanceId: 127.0.0.1:9080\n' +
' lease-renewal-interval-in-seconds: 5\n' +
' lease-expiration-duration-in-seconds: 10\n' +
' status-page-url-path: ${management.endpoints.web.base-path}/info\n' +
' health-check-url-path: ${management.endpoints.web.base-path}/health\n' +
' metadata-map:\n' +
' zone: primary # This is needed for the load balancer\n' +
' profile: ${spring.profiles.active}\n' +
' version: ${info.project.version:}\n' +
' git-version: ${git.commit.id.describe:}\n' +
' git-commit: ${git.commit.id.abbrev:}\n' +
' git-branch: ${git.branch:}\n' +
'ribbon:\n' +
' ReadTimeout: 120000\n' +
' ConnectTimeout: 300000\n' +
' eureka:\n' +
' enabled: true\n' +
'zuul:\n' +
' host:\n' +
' connect-timeout-millis: 5000\n' +
' max-per-route-connections: 10000\n' +
' max-total-connections: 5000\n' +
' socket-timeout-millis: 60000\n' +
' semaphore:\n' +
' max-semaphores: 500\n' +
'\n' +
'feign:\n' +
' hystrix:\n' +
' enabled: true\n' +
' client:\n' +
' config:\n' +
' default:\n' +
' connectTimeout: 500000\n' +
' readTimeout: 500000\n' +
'\n' +
'# See https://github.com/Netflix/Hystrix/wiki/Configuration\n' +
'hystrix:\n' +
' command:\n' +
' default:\n' +
' circuitBreaker:\n' +
' sleepWindowInMilliseconds: 100000\n' +
' forceClosed: true\n' +
' execution:\n' +
' isolation:\n' +
'# strategy: SEMAPHORE\n' +
'# See https://github.com/spring-cloud/spring-cloud-netflix/issues/1330\n' +
' thread:\n' +
' timeoutInMilliseconds: 60000\n' +
' shareSecurityContext: true\n' +
'\n' +
'management:\n' +
' endpoints:\n' +
' web:\n' +
' base-path: /management\n' +
' exposure:\n' +
' include: ["configprops", "env", "health", "info", "threaddump"]\n' +
' endpoint:\n' +
' health:\n' +
' show-details: when_authorized\n' +
' info:\n' +
' git:\n' +
' mode: full\n' +
' health:\n' +
' mail:\n' +
' enabled: false # When using the MailService, configure an SMTP server and set this to true\n' +
' metrics:\n' +
' enabled: false # http://micrometer.io/ is disabled by default, as we use http://metrics.dropwizard.io/ instead\n' +
'\n' +
'spring:\n' +
' application:\n' +
' name: product\n' +
' jpa:\n' +
' open-in-view: false\n' +
' hibernate:\n' +
' ddl-auto: update\n' +
' naming:\n' +
' physical-strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy\n' +
' implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy\n' +
' messages:\n' +
' basename: i18n/messages\n' +
' mvc:\n' +
' favicon:\n' +
' enabled: false\n' +
' thymeleaf:\n' +
' mode: HTML\n' +
'security:\n' +
' oauth2:\n' +
' resource:\n' +
' filter-order: 3\n' +
'\n' +
'server:\n' +
' servlet:\n' +
' session:\n' +
' cookie:\n' +
' http-only: true\n' +
'\n' +
'# Properties to be exposed on the /info management endpoint\n' +
'info:\n' +
' # Comma separated list of profiles that will trigger the ribbon to show\n' +
' display-ribbon-on-profiles: "dev"\n' +
'\n' +
'# ===================================================================\n' +
'# JHipster specific properties\n' +
'#\n' +
'# Full reference is available at: https://www.jhipster.tech/common-application-properties/\n' +
'# ===================================================================\n' +
'\n' +
'jhipster:\n' +
' async:\n' +
' core-pool-size: 2\n' +
' max-pool-size: 50\n' +
' queue-capacity: 10000\n' +
' # By default CORS is disabled. Uncomment to enable.\n' +
' #cors:\n' +
' #allowed-origins: "*"\n' +
' #allowed-methods: "*"\n' +
' #allowed-headers: "*"\n' +
' #exposed-headers: "Authorization,Link,X-Total-Count"\n' +
' #allow-credentials: true\n' +
' #max-age: 1800\n' +
' mail:\n' +
' from: product@localhost\n' +
' swagger:\n' +
' default-include-pattern: /api/.*\n' +
' title: product API\n' +
' description: product API documentation\n' +
' version: 0.0.1\n' +
' terms-of-service-url:\n' +
' contact-name:\n' +
' contact-url:\n' +
' contact-email:\n' +
' license:\n' +
' license-url:\n' +
'\n' +
'# ===================================================================\n' +
'# Application specific properties\n' +
'# Add your own application properties here, see the ApplicationProperties class\n' +
'# to have type-safe configuration, like in the JHipsterProperties above\n' +
'#\n' +
'# More documentation is available at:\n' +
'# https://www.jhipster.tech/common-application-properties/\n' +
'# ===================================================================\n' +
'\n' +
'# application:\n'
}
},
mounted() {
const that = this
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 210 + 'px'
}
}
}
</script>
<style scoped>
</style>
+150
View File
@@ -0,0 +1,150 @@
<template>
<div>
<div v-if="value.productId">
<ul class="el-upload-list el-upload-list--picture-card">
<li tabindex="0" class="el-upload-list__item is-ready">
<div>
<img :src="value.image" alt="" class="el-upload-list__item-thumbnail">
<span class="el-upload-list__item-actions">
<span class="el-upload-list__item-delete" @click="deleteGood">
<i class="el-icon-delete" />
</span>
</span>
</div>
</li>
</ul>
</div>
<div v-else tabindex="0" class="el-upload el-upload--picture-card" @click="toSelete">
<i class="el-icon-plus" />
</div>
<el-dialog :visible.sync="dialog" append-to-body width="60%" title="商品列表">
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
</div>
<!--表单组件-->
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;" >
<el-table-column prop="id" label="商品id" />
<el-table-column ref="table" prop="image" label="商品图片">
<template slot-scope="scope">
<a :href="scope.row.image" style="color: #42b983" target="_blank"><img :src="scope.row.image" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column prop="storeName" label="商品名称" />
<el-table-column prop="storeCategory.cateName" label="分类名称" />
<el-table-column prop="price" label="商品价格" />
<el-table-column label="操作" width="185" align="center" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
icon="el-icon-edit"
@click="doSelect(scope.row)"
>选择</el-button>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</el-dialog>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
export default {
components: { },
mixins: [initData],
props: {
value: {
type: Object
}
},
data() {
return {
delLoading: false,
dialog: false,
queryTypeOptions: [
{ key: 'storeName', display_name: '商品名称' }
],
isAttr: false,
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxStoreProduct'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort, isShow: 1, isDel: 0 ,isIntegral:0}
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
},
deleteGood() {
const that = this
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
that.$set(that.value,"productId", null)
that.$set(that.value,"storeName", null)
that.$set(that.value,"image", null)
that.$set(that.value,"otPrice", null)
that.$set(that.value,"price", null)
that.$set(that.value,"cform",null)
})
},
doSelect(data) {
this.$set(this.value,"productId", data.id)
this.$set(this.value,"storeName", data.storeName)
this.$set(this.value,"image", data.image)
this.$set(this.value,"otPrice", data.otPrice)
this.$set(this.value,"price", data.price)
this.$set(this.value,"cform",data)
this.dialog = false
},
toSelete() {
this.dialog = true
}
}
}
</script>
<style scoped>
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
</style>
+199
View File
@@ -0,0 +1,199 @@
<template>
<div>
<div>
<ul v-for="(item,index) in newValue" :key="index" class="el-upload-list el-upload-list--picture-card">
<li tabindex="0" class="el-upload-list__item is-ready" :style="'width: '+width+'px;height: '+height+'px'">
<div>
<img :src="item.image" alt="" class="el-upload-list__item-thumbnail">
<span class="el-upload-list__item-actions">
<span class="el-upload-list__item-delete" @click="deleteGood(index)">
<i class="el-icon-delete" />
</span>
</span>
</div>
</li>
</ul>
<div tabindex="0" class="el-upload el-upload--picture-card" @click="toSelete">
<i class="el-icon-plus" />
</div>
</div>
<el-dialog :visible.sync="dialog" append-to-body width="60%" title="商品列表">
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
</div>
<!--表单组件-->
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;" @selection-change="handleSelectionChange" ref="multipleTable">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column prop="id" label="商品id" />
<el-table-column ref="table" prop="image" label="商品图片">
<template slot-scope="scope">
<a :href="scope.row.image" style="color: #42b983" target="_blank"><img :src="scope.row.image" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column prop="storeName" label="商品名称" />
<el-table-column prop="storeCategory.cateName" label="分类名称" />
<el-table-column prop="price" label="商品价格" />
</el-table>
<div style="margin-top: 20px">
<el-button type="primary" @click="doSelect()">确定选择</el-button>
</div>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</el-dialog>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del, onsale } from '@/api/bxg/yxStoreProduct'
export default {
components: { },
mixins: [initData],
props: {
value: {
type: Array,
default() {
return []
}
},
// 宽度
width: {
type: Number,
default() {
return 150
}
},
// 宽度
height: {
type: Number,
default() {
return 150
}
}
},
watch: {
page: function (val) {
var map = this.selectGoods;
map.set(this.lastPage, this.multipleSelection);
this.selectGoods = map;
if (map.get(val)) {
this.multipleSelection = map.get(val);
}
this.lastPage = val;
},
data: function (val) {
const _this=this;
_this.$nextTick(()=> {
//获取map
var map = this.selectGoods;
//判断当前页是否有数据
var thePageData = map.get(this.page);
if (thePageData) {
thePageData.forEach(thePageData=>{
val.forEach(tableData=>{
if(tableData.id==thePageData.id){
this.$refs.multipleTable.toggleRowSelection(tableData,true);
}
})
})
}
})
}
},
data() {
return {
lastPage: 0,
selectGoods: new Map(),
newValue: this.value,
delLoading: false,
visible: false,
queryTypeOptions: [
{ key: 'storeName', display_name: '商品名称' }
],
isAttr: false,
multipleSelection: []
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
deleteGood(index) {
const that = this
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
that.newValue.splice(index, 1)
that.url = []
})
},
doSelect() {
this.newValue =[];
var dataList=this.selectGoods;
dataList.forEach(i=>{
i.forEach(j=>{
this.newValue.push(j)
})
})
this.$emit("selectGoods", this.newValue)
this.dialog = false
},
handleSelectionChange(val) {
var map = this.selectGoods;
map.set(this.lastPage, val);
this.selectGoods = map;
this.multipleSelection = val;
},
toSelete() {
this.dialog = true
},
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxStoreProduct'
const sort = 'id,desc'
this.params = {page: this.page, size: this.size, sort: sort, isShow: 1, isDel: 0,isIntegral:0}
const query = this.query
const type = query.type
const value = query.value
if (type && value) {
this.params[type] = value
}
return true
}
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,74 @@
const elementIcons = [
'info',
'error',
'success',
'warning',
'question',
'back',
'arrow-left',
'arrow-down',
'arrow-right',
'arrow-up',
'caret-left',
'caret-bottom',
'caret-top',
'caret-right',
'd-arrow-left',
'd-arrow-right',
'minus',
'plus',
'remove',
'circle-plus',
'remove-outline',
'circle-plus-outline',
'close',
'check',
'circle-close',
'circle-check',
'circle-close-outline',
'circle-check-outline',
'zoom-out',
'zoom-in',
'd-caret',
'sort',
'sort-down',
'sort-up',
'tickets',
'document',
'goods',
'sold-out',
'news',
'message',
'date',
'printer',
'time',
'bell',
'mobile-phone',
'service',
'view',
'menu',
'more',
'more-outline',
'star-on',
'star-off',
'location',
'location-outline',
'phone',
'phone-outline',
'picture',
'picture-outline',
'delete',
'search',
'edit',
'edit-outline',
'rank',
'refresh',
'share',
'setting',
'upload',
'upload2',
'download',
'loading'
]
export default elementIcons
+91
View File
@@ -0,0 +1,91 @@
<template>
<div class="icons-container">
<aside>
<a href="https://panjiachen.github.io/vue-element-admin-site/guide/advanced/icon.html" target="_blank">Add and use
</a>
</aside>
<el-tabs type="border-card">
<el-tab-pane label="Icons">
<div v-for="item of svgIcons" :key="item" @click="handleClipboard(generateIconCode(item),$event)">
<el-tooltip placement="top">
<div slot="content">
{{ generateIconCode(item) }}
</div>
<div class="icon-item">
<svg-icon :icon-class="item" class-name="disabled" />
<span>{{ item }}</span>
</div>
</el-tooltip>
</div>
</el-tab-pane>
<el-tab-pane label="Element-UI Icons">
<div v-for="item of elementIcons" :key="item" @click="handleClipboard(generateElementIconCode(item),$event)">
<el-tooltip placement="top">
<div slot="content">
{{ generateElementIconCode(item) }}
</div>
<div class="icon-item">
<i :class="'el-icon-' + item" />
<span>{{ item }}</span>
</div>
</el-tooltip>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import clipboard from '@/utils/clipboard'
import svgIcons from './svg-icons'
import elementIcons from './element-icons'
export default {
name: 'Icons',
data() {
return {
svgIcons,
elementIcons
}
},
methods: {
generateIconCode(symbol) {
return `<svg-icon icon-class="${symbol}" />`
},
generateElementIconCode(symbol) {
return `<i class="el-icon-${symbol}" />`
},
handleClipboard(text, event) {
clipboard(text, event)
}
}
}
</script>
<style lang="scss" scoped>
.icons-container {
margin: 10px 20px 0;
overflow: hidden;
.icon-item {
margin: 20px;
height: 85px;
text-align: center;
width: 100px;
float: left;
font-size: 30px;
color: #24292e;
cursor: pointer;
}
span {
display: block;
font-size: 16px;
margin-top: 10px;
}
.disabled {
pointer-events: none;
}
}
</style>
@@ -0,0 +1,10 @@
const req = require.context('@/assets/icons/svg', false, /\.svg$/)
const requireAll = requireContext => requireContext.keys()
const re = /\.\/(.*)\.svg/
const svgIcons = requireAll(req).map(i => {
return i.match(re)[1]
})
export default svgIcons
@@ -0,0 +1,181 @@
<template>
<div>
<div>
<ul v-for="(item,index) in product" :key="index" class="el-upload-list el-upload-list--picture-card">
<li tabindex="0" class="el-upload-list__item is-ready" :style="'width: '+width+'px;height: '+height+'px'">
<div>
<img :src="item.coverImgeUrl" alt="" class="el-upload-list__item-thumbnail">
<span class="el-upload-list__item-actions">
<span class="el-upload-list__item-delete" @click="deleteGood(index)">
<i class="el-icon-delete" />
</span>
</span>
</div>
</li>
</ul>
<div tabindex="0" class="el-upload el-upload--picture-card" @click="toSelete">
<i class="el-icon-plus" />
</div>
</div>
<el-dialog :visible.sync="dialog" append-to-body width="60%" title="商品列表">
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
</div>
<!--表单组件-->
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;" @selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column prop="goodsId" label="直播商品id" />
<el-table-column prop="name" label="商品名称" />
<el-table-column prop="productId" label="关联商品id" />
<el-table-column prop="coverImgUrl" label="商品图片" >
<template slot-scope="scope">
<a :href="scope.row.coverImgeUrl" style="color: #42b983" target="_blank"><img :src="scope.row.coverImgeUrl" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column prop="url" label="商品小程序路径" />
<el-table-column prop="priceType" label="价格类型" >
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.priceType == 1" :type="''">一口价</el-tag>
<el-tag v-else-if="scope.row.priceType == 2" :type="''">价格区间</el-tag>
<el-tag v-else-if="scope.row.priceType == 3" :type="''">显示折扣价</el-tag>
</div>
</template>
</el-table-column>
<!-- <el-table-column v-if="columns.visible('price')" prop="price" label="price" />-->
<!-- <el-table-column v-if="columns.visible('price2')" prop="price2" label="price2" />-->
<el-table-column prop="auditStatus" label="审核状态" >
<!-- //0:未审核,1:审核中,2:审核通过,3审核失败-->
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.auditStatus === 0" :type="''">未审核</el-tag>
<el-tag v-else-if="scope.row.auditStatus === 1" :type="''">审核中</el-tag>
<el-tag v-else-if="scope.row.auditStatus === 2" :type="''">审核通过</el-tag>
<el-tag v-else-if="scope.row.auditStatus === 3" :type="''">审核失败</el-tag>
</div>
</template>
</el-table-column>
<!-- 1, 2表示是为api添加商品否则是直播控制台添加的商品-->
<el-table-colum prop="thirdPartyTag" label="添加途径" >
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.thirdPartyTag == 0" :type="''">api添加</el-tag>
<el-tag v-else-if="scope.row.thirdPartyTag == 2" :type="''">控制台</el-tag>
</div>
</template>
</el-table-colum>
</el-table>
<div style="margin-top: 20px">
<el-button type="primary" @click="doSelect()">确定选择</el-button>
</div>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</el-dialog>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
export default {
components: { },
mixins: [initData],
props: {
product : Array,
// 宽度
width: {
type: Number,
default() {
return 150
}
},
// 宽度
height: {
type: Number,
default() {
return 150
}
}
},
data() {
return {
product:this.product,
delLoading: false,
visible: false,
queryTypeOptions: [
{ key: 'storeName', display_name: '商品名称' }
],
isAttr: false,
multipleSelection: []
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
deleteGood(index) {
const that = this
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
that.product.splice(index, 1)
that.url = []
})
},
doSelect() {
this.product = this.multipleSelection
this.$emit("selectGoods", this.product)
this.dialog = false
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
toSelete() {
this.dialog = true
},
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxWechatLiveGoods'
const sort = 'goods_id,desc'
this.params = { page: this.page, size: this.size, sort: sort, auditStatus: "2" }
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
}
}
}
</script>
<style scoped>
</style>
+161
View File
@@ -0,0 +1,161 @@
<template>
<div>
<div v-if="value.uid">
<ul class="el-upload-list el-upload-list--picture-card">
<li tabindex="0" class="el-upload-list__item is-ready">
<div>
<img :src="value.avatar" alt="" class="el-upload-list__item-thumbnail">
<span class="el-upload-list__item-actions">
<span class="el-upload-list__item-delete" @click="deleteUser">
<i class="el-icon-delete" />
</span>
</span>
</div>
</li>
</ul>
</div>
<div v-else tabindex="0" class="el-upload el-upload--picture-card" @click="toSelete">
<i class="el-icon-plus" />
</div>
<el-dialog :visible.sync="dialog" append-to-body width="60%" title="商城会员">
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
<!--表格渲染-->
<el-table :data="data" size="small" style="width: 100%;">
<el-table-column prop="uid" label="用户id" />
<el-table-column prop="nickname" label="用户昵称" />
<el-table-column ref="table" prop="avatar" label="用户头像">
<template slot-scope="scope">
<a :href="scope.row.avatar" style="color: #42b983" target="_blank"><img :src="scope.row.avatar" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column prop="phone" label="手机号码" />
<el-table-column label="用户来源" align="center">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.userType == 'wechat'">公众号</el-tag>
<el-tag v-else-if="scope.row.userType == 'routine'">小程序</el-tag>
<el-tag v-else>H5</el-tag>
</div>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXUSER_ALL','YXUSER_EDIT','YXUSER_DELETE'])" label="操作" width="185" align="center" fixed="right">
<template slot-scope="scope">
<el-button
v-permission="['admin','YXUSER_ALL','YXUSER_EDIT']"
size="mini"
type="primary"
icon="el-icon-edit"
@click="doSelect(scope.row)"
>选择</el-button>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</el-dialog>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
export default {
components: {},
mixins: [initData],
props: {
value: {
type: Object
}
},
data() {
return {
myValue: this.value,
delLoading: false, dialog: false,
userType: '',
queryTypeOptions: [
{ key: 'nickname', display_name: '用户昵称' },
{ key: 'phone', display_name: '手机号码' }
]
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxUser'
const sort = 'uid,desc'
this.params = { page: this.page, size: this.size, sort: sort }
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
},
deleteUser() {
const that = this
this.$confirm('是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
//that.myValue = {uid: null,nickname: null,avatar: null}
that.$set(that.value,"uid", null)
that.$set(that.value,"nickname", null)
that.$set(that.value,"avatar", null)
})
},
toSelete() {
this.dialog = true
},
doSelect(data) {
this.$set(this.value,"uid", data.uid)
this.$set(this.value,"nickname", data.nickname)
this.$set(this.value,"avatar", data.avatar)
this.dialog = false
}
}
}
</script>
<style scoped>
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
</style>
+108
View File
@@ -0,0 +1,108 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
import { debounce } from '@/utils'
import { chart } from '@/api/bxg/visits'
const animationDuration = 6000
export default {
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '300px'
}
},
data() {
return {
chart: null,
day: [], num: []
}
},
mounted() {
this.initChart()
this.__resizeHandler = debounce(() => {
if (this.chart) {
this.chart.resize()
}
}, 100)
window.addEventListener('resize', this.__resizeHandler)
},
beforeDestroy() {
if (!this.chart) {
return
}
window.removeEventListener('resize', this.__resizeHandler)
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
chart().then(res => {
var _info = res.chart
var day = []
var num = []
_info.forEach(function(item) {
day.push(item.time)
num.push(item.num)
})
console.log(day, num)
this.chart.setOption({
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
grid: {
top: 10,
left: '2%',
right: '2%',
bottom: '3%',
containLabel: true
},
xAxis: [{
type: 'category',
data: day,
axisTick: {
alignWithLabel: true
}
}],
yAxis: [{
type: 'value',
axisTick: {
show: false
}
}],
series: [{
name: 'pageA',
type: 'line',
stack: 'vistors',
barWidth: '60%',
data: num,
animationDuration
}]
})
})
console.log('day:' + this.day)
}
}
}
</script>
+108
View File
@@ -0,0 +1,108 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
import { debounce } from '@/utils'
import { chart } from '@/api/bxg/visits'
const animationDuration = 6000
export default {
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '300px'
}
},
data() {
return {
chart: null,
day: [], num: []
}
},
mounted() {
this.initChart()
this.__resizeHandler = debounce(() => {
if (this.chart) {
this.chart.resize()
}
}, 100)
window.addEventListener('resize', this.__resizeHandler)
},
beforeDestroy() {
if (!this.chart) {
return
}
window.removeEventListener('resize', this.__resizeHandler)
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
chart().then(res => {
var _info = res.chartT
var day = []
var num = []
_info.forEach(function(item) {
day.push(item.time)
num.push(item.num)
})
console.log(day, num)
this.chart.setOption({
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
grid: {
top: 10,
left: '2%',
right: '2%',
bottom: '3%',
containLabel: true
},
xAxis: [{
type: 'category',
data: day,
axisTick: {
alignWithLabel: true
}
}],
yAxis: [{
type: 'value',
axisTick: {
show: false
}
}],
series: [{
name: 'pageA',
type: 'line',
stack: 'vistors',
barWidth: '60%',
data: num,
animationDuration
}]
})
})
console.log('day:' + this.day)
}
}
}
</script>
+155
View File
@@ -0,0 +1,155 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
import { debounce } from '@/utils'
import { getChartData } from '@/api/bxg/visits'
export default {
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '350px'
},
autoResize: {
type: Boolean,
default: true
}
},
data() {
return {
chart: null,
sidebarElm: null,
chartData: {
visitsData: [],
ipData: []
},
weekDays: []
}
},
mounted() {
getChartData().then(res => {
this.chartData.visitsData = res.visitsData
this.chartData.ipData = res.ipData
this.weekDays = res.weekDays
this.initChart()
})
if (this.autoResize) {
this.__resizeHandler = debounce(() => {
if (this.chart) {
this.chart.resize()
}
}, 100)
window.addEventListener('resize', this.__resizeHandler)
}
// 监听侧边栏的变化
this.sidebarElm = document.getElementsByClassName('sidebar-container')[0]
this.sidebarElm && this.sidebarElm.addEventListener('transitionend', this.sidebarResizeHandler)
},
beforeDestroy() {
if (!this.chart) {
return
}
if (this.autoResize) {
window.removeEventListener('resize', this.__resizeHandler)
}
this.sidebarElm && this.sidebarElm.removeEventListener('transitionend', this.sidebarResizeHandler)
this.chart.dispose()
this.chart = null
},
methods: {
sidebarResizeHandler(e) {
if (e.propertyName === 'width') {
this.__resizeHandler()
}
},
setOptions({ visitsData, ipData } = {}) {
this.chart.setOption({
xAxis: {
data: this.weekDays,
boundaryGap: false,
axisTick: {
show: false
}
},
grid: {
left: 10,
right: 10,
bottom: 20,
top: 30,
containLabel: true
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
},
padding: [5, 10]
},
yAxis: {
axisTick: {
show: false
}
},
legend: {
data: ['pv', 'ip']
},
series: [{
name: 'pv', itemStyle: {
normal: {
color: '#FF005A',
lineStyle: {
color: '#FF005A',
width: 2
}
}
},
smooth: true,
type: 'line',
data: visitsData,
animationDuration: 2800,
animationEasing: 'cubicInOut'
},
{
name: 'ip',
smooth: true,
type: 'line',
itemStyle: {
normal: {
color: '#3888fa',
lineStyle: {
color: '#3888fa',
width: 2
},
areaStyle: {
color: '#f3f8ff'
}
}
},
data: ipData,
animationDuration: 2800,
animationEasing: 'quadraticOut'
}]
})
},
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
}
}
}
</script>
+127
View File
@@ -0,0 +1,127 @@
<template>
<div :class="className" ref="chart" :style="{ height: height, width: width }" />
</template>
<script>
import echarts from "echarts";
require("echarts/theme/macarons"); // echarts theme
import { getOrderCount } from "@/api/bxg/visits";
import { debounce } from "@/utils";
export default {
props: {
className: {
type: String,
default: "chart",
},
width: {
type: String,
default: "100%",
},
height: {
type: String,
default: "300px",
},
},
data() {
return {
chart: null,
column: [],
orderCountDatas: [],
};
},
mounted() {
getOrderCount()
.then((res) => {
(this.column = res.column),
(this.orderCountDatas = res.orderCountDatas);
})
.then(() => {
this.initChart();
});
this.__resizeHandler = debounce(() => {
if (this.chart) {
this.chart.resize();
}
}, 100);
window.addEventListener("resize", this.__resizeHandler);
},
beforeDestroy() {
if (!this.chart) {
return;
}
window.removeEventListener("resize", this.__resizeHandler);
this.chart.dispose();
this.chart = null;
},
methods: {
initChart() {
this.chart = echarts.init(this.$refs.chart, "macarons");
this.chart.setOption({
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b} : {c} ({d}%)",
},
legend: {
left: "center",
bottom: "10",
data: this.column,
},
calculable: true,
series: [
{
name: "商品分类销售占总销售的比例",
type: "pie",
roseType: "radius",
radius: [15, 95],
center: ["50%", "38%"],
data: this.orderCountDatas,
animationEasing: "cubicInOut",
animationDuration: 2600,
},
],
});
},
},
};
</script>
<style lang="scss" scoped>
.acea-row{
::v-deep.el-avatar--small {
width: 22px;
height: 22px;
line-height: 22px;
}
}
.checkTime{
::v-deep.el-radio__input{
display: none;
}
}
.ivu-pl-8{
margin-left: 8px;
font-size: 14px;
}
.divBox {
// padding: 0 20px !important;
}
.dashboard-console-visit {
::v-deep.el-card__header{
padding: 14px 20px !important;
}
ul {
li {
list-style-type: none;
margin-top: 12px;
}
}
}
.ivu-mb{
margin-bottom: 10px;
}
</style>
+241
View File
@@ -0,0 +1,241 @@
<template>
<div>
<div class="divBox">
<el-row :gutter="24" class="baseInfo">
<el-col :xs="12" :sm="12" :lg="6" class="ivu-mb">
<el-card :bordered="false" dis-hover :padding="12">
<div slot="header" class="acea-row row-between-wrapper">
<span>会员总数</span>
<el-tag type="success">全平台</el-tag>
</div>
<div class="content" v-if="count">
<span class="content-number spBlock mb15"><count-to :start-val="0" :end-val="count.userCount" :duration="2600" class="card-panel-num" /></span>
<el-divider></el-divider>
<div class="acea-row row-between-wrapper">
<span class="content-time">今日订单数</span>
<span>{{ count.todayCount }} </span>
</div>
</div>
</el-card>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="ivu-mb">
<el-card :bordered="false" dis-hover :padding="12">
<div slot="header" class="acea-row row-between-wrapper">
<span>订单总数</span>
<el-tag type="success">全平台</el-tag>
</div>
<div class="content" v-if="count">
<span class="content-number spBlock mb15"><count-to :start-val="0" :end-val="count.orderCount" :duration="3000" class="card-panel-num" /></span>
<el-divider></el-divider>
<div class="acea-row row-between-wrapper">
<span class="content-time">昨日订单数</span>
<span>{{ count.lastWeekCount }} </span>
</div>
</div>
</el-card>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="ivu-mb">
<el-card :bordered="false" dis-hover :padding="12">
<div slot="header" class="acea-row row-between-wrapper">
<span>总金额</span>
<el-tag type="success">全平台</el-tag>
</div>
<div class="content" v-if="count">
<span class="content-number spBlock mb15"><count-to :start-val="0" :end-val="count.priceCount" :duration="3200" class="card-panel-num" /></span>
<el-divider></el-divider>
<div class="acea-row row-between-wrapper">
<span class="content-time">近七天订单数</span>
<span>{{ count.lastWeekCount }} </span>
</div>
</div>
</el-card>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="ivu-mb">
<el-card :bordered="false" dis-hover :padding="12">
<div slot="header" class="acea-row row-between-wrapper">
<span>商品总数</span>
<el-tag type="success">全平台</el-tag>
</div>
<div class="content" v-if="count">
<span class="content-number spBlock mb15"><count-to :start-val="0" :end-val="count.goodsCount" :duration="3600" class="card-panel-num" /></span>
<el-divider></el-divider>
<div class="acea-row row-between-wrapper">
<span class="content-time">本月订单数</span>
<span>{{ count.monthCount }} </span>
</div>
</div>
</el-card>
</el-col>
</el-row>
</div>
</div>
</template>
<script>
import CountTo from "vue-count-to";
import { gett } from "@/api/bxg/visits";
export default {
components: {
CountTo,
},
data() {
return {
count: {
todayPrice: 0,
todayCount: 0,
proPrice: 0,
proCount: 0,
monthPrice: 0,
monthCount: 0,
lastWeekCount: 0,
lastWeekPrice: 0,
userCount: 0,
orderCount: 0,
priceCount: 0,
goodsCount: 0,
},
};
},
mounted() {
gett().then((res) => {
this.count.todayPrice = res.todayPrice;
this.count.todayCount = res.todayCount;
this.count.proCount = res.proCount;
this.count.proPrice = res.proPrice;
this.count.monthPrice = res.monthPrice;
this.count.monthCount = res.monthCount;
this.count.lastWeekCount = res.lastWeekCount;
this.count.lastWeekPrice = res.lastWeekPrice;
this.count.userCount = res.userCount;
this.count.orderCount = res.orderCount;
this.count.priceCount = res.priceCount;
this.count.goodsCount = res.goodsCount;
});
},
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.panel-group {
margin-top: 18px;
.card-panel-col {
margin-bottom: 32px;
}
.card-panel {
height: 108px;
cursor: pointer;
font-size: 12px;
position: relative;
overflow: hidden;
color: #666;
background: #fff;
box-shadow: 4px 4px 40px rgba(0, 0, 0, 0.05);
border-color: rgba(0, 0, 0, 0.05);
.icon-people {
color: #40c9c6;
}
.icon-message {
color: #36a3f7;
}
.icon-money {
color: #f4516c;
}
.icon-shopping {
color: #34bfa3;
}
.card-panel-icon-wrapper {
float: left;
margin: 14px 0 0 14px;
padding: 16px;
transition: all 0.38s ease-out;
border-radius: 6px;
}
.card-panel-icon {
float: left;
font-size: 48px;
}
.card-panel-description {
float: right;
font-weight: bold;
margin: 26px;
margin-left: 0px;
.card-panel-text {
line-height: 18px;
color: rgba(0, 0, 0, 0.45);
font-size: 16px;
margin-bottom: 12px;
}
.card-panel-num {
font-size: 20px;
}
}
}
}
@media (max-width: 550px) {
.card-panel-description {
display: none;
}
.card-panel-icon-wrapper {
float: none !important;
width: 100%;
height: 100%;
margin: 0 !important;
.svg-icon {
display: block;
margin: 14px auto !important;
float: none !important;
}
}
}
.baseInfo {
::v-deep .el-card__header {
padding: 15px 20px !important;
}
}
.ivu-mb {
margin-bottom: 10px;
}
.up,
.el-icon-caret-top {
color: #f5222d;
font-size: 12px;
opacity: 1 !important;
}
.down,
.el-icon-caret-bottom {
color: #39c15b;
font-size: 12px;
/*opacity: 100% !important;*/
}
.content {
&-number {
font-size: 30px;
}
&-time {
font-size: 14px;
/*color: #8C8C8C;*/
}
}
.spBlock {
display: block;
}
</style>
+191
View File
@@ -0,0 +1,191 @@
<template>
<div class="divBox">
<el-row :gutter="24" class="dashboard-console-grid">
<el-col v-bind="grid" class="ivu-mb">
<el-card :bordered="false">
<router-link :to="{ path: '/shop/cate' }">
<i class="el-icon-goods" style="color: #69c0ff" />
<p>商品管理</p>
</router-link>
</el-card>
</el-col>
<el-col v-bind="grid" class="ivu-mb">
<el-card :bordered="false">
<router-link :to="{ path: '/member/member' }">
<i class="el-icon-user" style="color: #95de64" />
<p>会员管理</p>
</router-link>
</el-card>
</el-col>
<el-col v-bind="grid" class="ivu-mb">
<el-card :bordered="false">
<router-link :to="{ path: '/order/order' }">
<i class="el-icon-s-order" style="color: #ff9c6e" />
<p>订单管理</p>
</router-link>
</el-card>
</el-col>
<el-col v-bind="grid" class="ivu-mb">
<el-card :bordered="false">
<router-link :to="{ path: '/syscoupon/coupon' }">
<i class="el-icon-s-ticket" style="color: #b37feb" />
<p>电子券管理</p>
</router-link>
</el-card>
</el-col>
<el-col v-bind="grid" class="ivu-mb">
<el-card :bordered="false">
<router-link :to="{ path: '/activity/combination' }">
<i class="el-icon-postcard" style="color: #ffd666" />
<p>营销管理</p>
</router-link>
</el-card>
</el-col>
<el-col v-bind="grid" class="ivu-mb">
<el-card :bordered="false">
<router-link :to="{ path: '/promoter/promoterconfig' }">
<i class="el-icon-notebook-1" style="color: #5cdbd3" />
<p>分销管理</p>
</router-link>
</el-card>
</el-col>
<el-col v-bind="grid" class="ivu-mb">
<el-card :bordered="false">
<router-link :to="{ path: '/price/extract' }">
<i class="el-icon-s-finance" style="color: #ff85c0" />
<p>财务管理</p>
</router-link>
</el-card>
</el-col>
<el-col v-bind="grid" class="ivu-mb">
<el-card :bordered="false">
<router-link :to="{ path: '/store/storeinfo' }">
<i class="el-icon-office-building" style="color: #ffc069" />
<p>门店管理</p>
</router-link>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import CountTo from 'vue-count-to'
import { gett } from '@/api/bxg/visits'
export default {
components: {
CountTo
},
data() {
return {
count: { todayPrice: 0, todayCount: 0, proPrice: 0, proCount: 0,
monthPrice: 0, monthCount: 0, lastWeekCount: 0, lastWeekPrice: 0 },
grid: {
xl: 3,
lg: 3,
md: 6,
sm: 8,
xs: 8,
},
}
},
mounted() {
gett().then(res => {
this.count.todayPrice = res.todayPrice
this.count.todayCount = res.todayCount
this.count.proCount = res.proCount
this.count.proPrice = res.proPrice
this.count.monthPrice = res.monthPrice
this.count.monthCount = res.monthCount
this.count.lastWeekCount = res.lastWeekCount
this.count.lastWeekPrice = res.lastWeekPrice
})
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.panel-group {
margin-top: 18px;
.card-panel-col{
margin-bottom: 32px;
}
.card-panel {
height: 108px;
font-size: 12px;
position: relative;
overflow: hidden;
cursor: pointer;
color: #666;
background: #fff;
box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
border-color: rgba(0, 0, 0, .05);
.icon-people {
color: #40c9c6;
}
.icon-message {
color: #36a3f7;
}
.icon-money {
color: #f4516c;
}
.icon-shopping {
color: #34bfa3
}
.card-panel-icon-wrapper {
float: left;
margin: 14px 0 0 14px;
padding: 16px;
transition: all 0.38s ease-out;
border-radius: 6px;
}
.card-panel-icon {
float: left;
font-size: 48px;
}
.card-panel-description {
float: right;
font-weight: bold;
margin: 26px;
margin-left: 0px;
.card-panel-text {
line-height: 18px;
color: rgba(0, 0, 0, 0.45);
font-size: 16px;
margin-bottom: 12px;
}
.card-panel-num {
font-size: 20px;
}
}
}
}
.ivu-mb {
margin-bottom: 10px;
}
.divBox {
// padding: 0 20px !important;
}
.dashboard-console-grid {
text-align: center;
.ivu-card-body {
padding: 0;
}
i {
font-size: 32px;
}
a {
display: block;
color: inherit;
}
p {
margin-top: 8px;
}
}
</style>
+91
View File
@@ -0,0 +1,91 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
import { debounce } from '@/utils'
export default {
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '300px'
}
},
data() {
return {
chart: null,
grid: {
xl: 3,
lg: 6,
md: 6,
sm: 8,
xs: 8,
},
}
},
mounted() {
this.initChart()
this.__resizeHandler = debounce(() => {
if (this.chart) {
this.chart.resize()
}
}, 100)
window.addEventListener('resize', this.__resizeHandler)
},
beforeDestroy() {
if (!this.chart) {
return
}
window.removeEventListener('resize', this.__resizeHandler)
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.chart.setOption({
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)'
},
legend: {
left: 'center',
bottom: '10',
data: ['Industries', 'Technology', 'Forex', 'Gold', 'Forecasts']
},
calculable: true,
series: [
{
name: 'WEEKLY WRITE ARTICLES',
type: 'pie',
roseType: 'radius',
radius: [15, 95],
center: ['50%', '38%'],
data: [
{ value: 320, name: 'Industries' },
{ value: 240, name: 'Technology' },
{ value: 149, name: 'Forex' },
{ value: 100, name: 'Gold' },
{ value: 59, name: 'Forecasts' }
],
animationEasing: 'cubicInOut',
animationDuration: 2600
}
]
})
}
}
}
</script>
+120
View File
@@ -0,0 +1,120 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
import { debounce } from '@/utils'
const animationDuration = 3000
export default {
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '300px'
}
},
data() {
return {
chart: null
}
},
mounted() {
this.initChart()
this.__resizeHandler = debounce(() => {
if (this.chart) {
this.chart.resize()
}
}, 100)
window.addEventListener('resize', this.__resizeHandler)
},
beforeDestroy() {
if (!this.chart) {
return
}
window.removeEventListener('resize', this.__resizeHandler)
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.chart.setOption({
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
radar: {
radius: '66%',
center: ['50%', '42%'],
splitNumber: 8,
splitArea: {
areaStyle: {
color: 'rgba(127,95,132,.3)',
opacity: 1,
shadowBlur: 45,
shadowColor: 'rgba(0,0,0,.5)',
shadowOffsetX: 0,
shadowOffsetY: 15
}
},
indicator: [
{ name: 'Sales', max: 10000 },
{ name: 'Administration', max: 20000 },
{ name: 'Information Techology', max: 20000 },
{ name: 'Customer Support', max: 20000 },
{ name: 'Development', max: 20000 },
{ name: 'Marketing', max: 20000 }
]
},
legend: {
left: 'center',
bottom: '10',
data: ['Allocated Budget', 'Expected Spending', 'Actual Spending']
},
series: [{
type: 'radar',
symbolSize: 0,
areaStyle: {
normal: {
shadowBlur: 13,
shadowColor: 'rgba(0,0,0,.2)',
shadowOffsetX: 0,
shadowOffsetY: 10,
opacity: 1
}
},
data: [
{
value: [5000, 7000, 12000, 11000, 15000, 14000],
name: 'Allocated Budget'
},
{
value: [4000, 9000, 15000, 15000, 13000, 11000],
name: 'Expected Spending'
},
{
value: [5500, 11000, 12000, 15000, 12000, 12000],
name: 'Actual Spending'
}
],
animationDuration: animationDuration
}]
})
}
}
}
</script>
+89
View File
@@ -0,0 +1,89 @@
<template>
<div class="errPage-container">
<el-button icon="arrow-left" class="pan-back-btn" @click="back">
返回
</el-button>
<el-row>
<el-col :span="12">
<h1 class="text-jumbo text-ginormous">
Oops!
</h1>
<h2>你没有权限去该页面</h2>
<h6>如有不满请联系你领导</h6>
<ul class="list-unstyled">
<li>或者你可以去:</li>
<li class="link-type">
<router-link to="/dashboard">
回首页
</router-link>
</li>
</ul>
</el-col>
<el-col :span="12">
<img :src="errGif" width="313" height="428" alt="Girl has dropped her ice cream.">
</el-col>
</el-row>
</div>
</template>
<script>
import errGif from '@/assets/401_images/401.gif'
export default {
name: 'Page401',
data() {
return {
errGif: errGif + '?' + +new Date()
}
},
methods: {
back() {
if (this.$route.query.noGoBack) {
this.$router.push({ path: '/dashboard' })
} else {
this.$router.go(-1)
}
}
}
}
</script>
<style lang="scss" scoped>
.errPage-container {
width: 800px;
max-width: 100%;
margin: 100px auto;
.pan-back-btn {
background: #008489;
color: #fff;
border: none!important;
}
.pan-gif {
margin: 0 auto;
display: block;
}
.pan-img {
display: block;
margin: 0 auto;
width: 100%;
}
.text-jumbo {
font-size: 60px;
font-weight: 700;
color: #484848;
}
.list-unstyled {
font-size: 14px;
li {
padding-bottom: 5px;
}
a {
color: #008489;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
}
}
</style>
+225
View File
@@ -0,0 +1,225 @@
<template>
<div class="wscn-http404-container">
<div class="wscn-http404">
<div class="pic-404">
<img class="pic-404__parent" src="@/assets/404_images/404.png" alt="404">
<img class="pic-404__child left" src="@/assets/404_images/404_cloud.png" alt="404">
<img class="pic-404__child mid" src="@/assets/404_images/404_cloud.png" alt="404">
<img class="pic-404__child right" src="@/assets/404_images/404_cloud.png" alt="404">
</div>
<div class="bullshit">
<div class="bullshit__oops">OOPS!</div>
<div class="bullshit__headline">{{ message }}</div>
<div class="bullshit__info">请检查您输入的网址是否正确请点击以下按钮返回主页或者发送错误报告</div>
<a href="/" class="bullshit__return-home">返回首页</a>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'Page404',
computed: {
message() {
return '网管说这个页面你不能进......'
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.wscn-http404-container{
transform: translate(-50%,-50%);
position: absolute;
top: 40%;
left: 50%;
}
.wscn-http404 {
position: relative;
width: 1200px;
padding: 0 50px;
overflow: hidden;
.pic-404 {
position: relative;
float: left;
width: 600px;
overflow: hidden;
&__parent {
width: 100%;
}
&__child {
position: absolute;
&.left {
width: 80px;
top: 17px;
left: 220px;
opacity: 0;
animation-name: cloudLeft;
animation-duration: 2s;
animation-timing-function: linear;
animation-fill-mode: forwards;
animation-delay: 1s;
}
&.mid {
width: 46px;
top: 10px;
left: 420px;
opacity: 0;
animation-name: cloudMid;
animation-duration: 2s;
animation-timing-function: linear;
animation-fill-mode: forwards;
animation-delay: 1.2s;
}
&.right {
width: 62px;
top: 100px;
left: 500px;
opacity: 0;
animation-name: cloudRight;
animation-duration: 2s;
animation-timing-function: linear;
animation-fill-mode: forwards;
animation-delay: 1s;
}
@keyframes cloudLeft {
0% {
top: 17px;
left: 220px;
opacity: 0;
}
20% {
top: 33px;
left: 188px;
opacity: 1;
}
80% {
top: 81px;
left: 92px;
opacity: 1;
}
100% {
top: 97px;
left: 60px;
opacity: 0;
}
}
@keyframes cloudMid {
0% {
top: 10px;
left: 420px;
opacity: 0;
}
20% {
top: 40px;
left: 360px;
opacity: 1;
}
70% {
top: 130px;
left: 180px;
opacity: 1;
}
100% {
top: 160px;
left: 120px;
opacity: 0;
}
}
@keyframes cloudRight {
0% {
top: 100px;
left: 500px;
opacity: 0;
}
20% {
top: 120px;
left: 460px;
opacity: 1;
}
80% {
top: 180px;
left: 340px;
opacity: 1;
}
100% {
top: 200px;
left: 300px;
opacity: 0;
}
}
}
}
.bullshit {
position: relative;
float: left;
width: 300px;
padding: 30px 0;
overflow: hidden;
&__oops {
font-size: 32px;
font-weight: bold;
line-height: 40px;
color: #1482f0;
opacity: 0;
margin-bottom: 20px;
animation-name: slideUp;
animation-duration: 0.5s;
animation-fill-mode: forwards;
}
&__headline {
font-size: 20px;
line-height: 24px;
color: #222;
font-weight: bold;
opacity: 0;
margin-bottom: 10px;
animation-name: slideUp;
animation-duration: 0.5s;
animation-delay: 0.1s;
animation-fill-mode: forwards;
}
&__info {
font-size: 13px;
line-height: 21px;
color: grey;
opacity: 0;
margin-bottom: 30px;
animation-name: slideUp;
animation-duration: 0.5s;
animation-delay: 0.2s;
animation-fill-mode: forwards;
}
&__return-home {
display: block;
float: left;
width: 110px;
height: 36px;
background: #1482f0;
border-radius: 100px;
text-align: center;
color: #ffffff;
opacity: 0;
font-size: 14px;
line-height: 36px;
cursor: pointer;
animation-name: slideUp;
animation-duration: 0.5s;
animation-delay: 0.3s;
animation-fill-mode: forwards;
}
@keyframes slideUp {
0% {
transform: translateY(60px);
opacity: 0;
}
100% {
transform: translateY(0);
opacity: 1;
}
}
}
}
</style>
+12
View File
@@ -0,0 +1,12 @@
<script>
export default {
created() {
const { params, query } = this.$route
const { path } = params
this.$router.replace({ path: '/' + path, query })
},
render: function(h) {
return h() // avoid warning message
}
}
</script>
+136
View File
@@ -0,0 +1,136 @@
<template>
<div class="dashboard-container">
<div class="dashboard-editor-container">
<panel-group />
<panel-group-t />
<div class="divBox">
<el-card :bordered="false" dis-hover>
<div slot="header">
<div class="acea-row row-middle">
<el-avatar
icon="el-icon-s-operation"
size="small"
style="color: #1890ff; background: #e6f7ff; font-size: 13px"
/>
<span class="ivu-pl-8">统计</span>
</div>
</div>
<el-row :gutter="24">
<el-col
:xl="8"
:lg="8"
:md="24"
:sm="24"
:xs="24"
class="ivu-mb mb10 dashboard-console-visit"
>
<span class="ivu-pl-8">商品分析</span>
<order-count></order-count>
</el-col>
<el-col
:xl="8"
:lg="8"
:md="24"
:sm="24"
:xs="24"
class="ivu-mb mb10 dashboard-console-visit"
>
<span class="ivu-pl-8">本月成交额</span>
<bar-chart />
</el-col>
<el-col
:xl="8"
:lg="8"
:md="24"
:sm="24"
:xs="24"
class="ivu-mb mb10 dashboard-console-visit"
>
<span class="ivu-pl-8">本月订单数</span>
<pie-chart />
</el-col>
</el-row>
</el-card>
</div>
</div>
</div>
</template>
<script>
import { mapGetters } from "vuex";
import PanelGroup from "./dashboard/PanelGroup";
import PanelGroupT from "./dashboard/PanelGroupT";
import PieChart from "./dashboard/BarChartT";
import BarChart from "./dashboard/BarChart";
import { count } from "@/api/bxg/visits";
import OrderCount from "./dashboard/OrderCount";
/**
* 记录访问,只有页面刷新或者第一次加载才会记录
*/
count().then((res) => {});
export default {
name: "Dashboard",
components: {
PanelGroup,
PanelGroupT,
PieChart,
BarChart,
OrderCount,
},
computed: {
...mapGetters(["roles"]),
},
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.dashboard-editor-container {
padding: 18px 22px 22px 22px;
background-color: rgb(240, 242, 245);
.chart-wrapper {
background: #fff;
padding: 16px 16px 0;
margin-bottom: 32px;
}
}
.acea-row {
::v-deep.el-avatar--small {
width: 22px;
height: 22px;
line-height: 22px;
}
}
.checkTime {
::v-deep.el-radio__input {
display: none;
}
}
.ivu-pl-8 {
margin-left: 8px;
font-size: 14px;
}
.divBox {
// padding: 0 20px !important;
}
.dashboard-console-visit {
::v-deep.el-card__header {
padding: 14px 20px !important;
}
ul {
li {
list-style-type: none;
margin-top: 12px;
}
}
}
.ivu-mb {
margin-bottom: 10px;
}
</style>
+203
View File
@@ -0,0 +1,203 @@
<template>
<div class="login">
<div style="display:flex;justify-content:space-between;align-items: center;">
<div style="padding: 0 60px 0 0">
<h3 style="color: #ffffff;font-size: 24px;padding: 0;margin-bottom: 10px">
武设特价电商系统
</h3>
<ul style="margin: 0;color: #ffffff;font-size: 15px;line-height: 25px;padding-left: 20px">
<li>便宜 实惠</li>
<li>便宜 实惠</li>
</ul>
<h3 style="color: #ffffff;">
</h3>
</div>
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" label-position="left" label-width="0px" class="login-form">
<h3 class="title">
武设特价电商
</h3>
<el-form-item prop="username">
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input v-model="loginForm.password" type="password" auto-complete="off" placeholder="密码" @keyup.enter.native="handleLogin">
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<el-form-item prop="code">
<el-input v-model="loginForm.code" auto-complete="off" placeholder="验证码" style="width: 63%" @keyup.enter.native="handleLogin">
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
</el-input>
<div class="login-code">
<img :src="codeUrl" @click="getCode">
</div>
</el-form-item>
<el-checkbox v-model="loginForm.rememberMe" style="margin:0 0 25px 0;">
记住我
</el-checkbox>
<el-form-item style="width:100%;">
<el-button :loading="loading" size="medium" type="primary" style="width:100%;" @click.native.prevent="handleLogin">
<span v-if="!loading"> </span>
<span v-else> 中...</span>
</el-button>
</el-form-item>
</el-form>
</div>
<!-- 底部 -->
<div v-if="$store.state.settings.showFooter" id="el-login-footer">
<span v-html="$store.state.settings.footerTxt" />
<span> </span>
<a href="http://beian.miit.gov.cn" target="_blank">{{ $store.state.settings.caseNumber }}</a>
</div>
</div>
</template>
<script>
import { encrypt } from '@/utils/rsaEncrypt'
import Config from '@/settings'
import { getCodeImg } from '@/api/login'
import Cookies from 'js-cookie'
export default {
name: 'Login',
data() {
return {
codeUrl: '',
cookiePass: '',
loginForm: {
username: '',
password: '',
rememberMe: false,
code: '',
uuid: ''
},
loginRules: {
username: [{ required: true, trigger: 'blur', message: '用户名不能为空' }],
password: [{ required: true, trigger: 'blur', message: '密码不能为空' }],
code: [{ required: true, trigger: 'change', message: '验证码不能为空' }]
},
loading: false,
redirect: undefined
}
},
watch: {
$route: {
handler: function(route) {
this.redirect = route.query && route.query.redirect
},
immediate: true
}
},
created() {
this.getCode()
this.getCookie()
},
methods: {
getCode() {
getCodeImg().then(res => {
this.codeUrl = res.img
this.loginForm.uuid = res.uuid
})
},
getCookie() {
const username = Cookies.get('username')
let password = Cookies.get('password')
const rememberMe = Cookies.get('rememberMe')
// 保存cookie里面的加密后的密码
this.cookiePass = password === undefined ? '' : password
password = password === undefined ? this.loginForm.password : password
this.loginForm = {
username: username === undefined ? this.loginForm.username : username,
password: password,
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
code: ''
}
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
const user = {
username: this.loginForm.username,
password: this.loginForm.password,
rememberMe: this.loginForm.rememberMe,
code: this.loginForm.code,
uuid: this.loginForm.uuid
}
if (user.password !== this.cookiePass) {
user.password = encrypt(user.password)
}
if (valid) {
this.loading = true
if (user.rememberMe) {
Cookies.set('username', user.username, { expires: Config.passCookieExpires })
Cookies.set('password', user.password, { expires: Config.passCookieExpires })
Cookies.set('rememberMe', user.rememberMe, { expires: Config.passCookieExpires })
} else {
Cookies.remove('username')
Cookies.remove('password')
Cookies.remove('rememberMe')
}
this.$store.dispatch('Login', user).then(() => {
this.loading = false
this.$router.push({ path: this.redirect || '/' })
}).catch(() => {
this.loading = false
this.getCode()
})
} else {
console.log('error submit!!')
return false
}
})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss">
.login {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
background-image:url("../../assets/images/bg.jpg");
background-size: cover;
}
.title {
margin: 0 auto 30px auto;
text-align: center;
color: #707070;
}
.login-form {
border-radius: 6px;
background: #ffffff;
width: 385px;
padding: 25px 25px 5px 25px;
.el-input {
height: 38px;
input {
height: 38px;
}
}
.input-icon{
height: 39px;width: 14px;margin-left: 2px;
}
}
.login-tip {
font-size: 13px;
text-align: center;
color: #bfbfbf;
}
.login-code {
width: 33%;
display: inline-block;
height: 38px;
float: right;
img{
cursor: pointer;
vertical-align:middle
}
}
</style>
+3
View File
@@ -0,0 +1,3 @@
<template>
<router-view />
</template>
@@ -0,0 +1,5 @@
<template>
<div style="padding:30px;">
<el-alert :closable="false" title="三级菜单1" type="success" />
</div>
</template>
@@ -0,0 +1,5 @@
<template>
<div style="padding:30px;">
<el-alert :closable="false" title="三级菜单2" type="success" />
</div>
</template>
+5
View File
@@ -0,0 +1,5 @@
<template>
<div style="padding:30px;">
<el-alert :closable="false" title="二级菜单" />
</div>
</template>
@@ -0,0 +1,171 @@
<template>
<el-dialog
class="afterSealsAdd"
:close-on-click-modal="false"
:visible.sync="visible"
width="800px">
<div class="checkForm">
<span>订单详情</span>
<el-form ref="form" :model="checkForm" size="small" label-width="100px">
<el-form-item label="订单号:">
<el-input v-model="checkForm.orderCode" disabled />
</el-form-item>
<el-form-item label="售后类型:">
<el-input v-if="checkForm.serviceType === 0" :value="'仅退款'" disabled />
<el-input v-if="checkForm.serviceType === 1" :value="'退货退款'" disabled />
</el-form-item>
<el-form-item label="售后原因:">
<el-input v-model="checkForm.reasons" disabled />
</el-form-item>
<el-form-item label="售后说明:">
<el-input v-model="checkForm.explains" disabled />
</el-form-item>
<el-form-item label="原因图片:">
<div v-if="!checkForm.explainImg">
<b>用户未上传图片</b>
</div>
<div v-else>
<el-image
v-for="(item,index) in checkForm.explainImg.split(',')"
:key="index"
style="width: 100px; height: 100px"
:src="item"
:preview-src-list="[item]">
</el-image>
</div>
</el-form-item>
<el-form-item label="提交时间:">
<el-input v-model="checkForm.createTime" disabled />
</el-form-item>
<div v-for="item in checkForm.cartInfo"
:key="item.id">
<el-form-item label="售后商品:">
<el-input v-model="item.productInfo.storeName" disabled />
</el-form-item>
<el-form-item label="商品图片:">
<el-image
:src="item.productInfo.image"
style="width: 100px; height: 100px">
<div slot="placeholder" class="image-slot">
加载中<b class="dot">...</b>
</div>
</el-image>
</el-form-item>
<el-form-item label="规格:">
<el-input v-model="item.productInfo.attrInfo.sku" disabled />
</el-form-item>
<el-form-item label="商品单价">
<el-input v-model="item.truePrice" disabled />
</el-form-item>
<el-form-item label="商品数量">
<el-input v-model="item.cartNum" disabled />
</el-form-item>
<el-form-item label="邮费:">
<el-input v-model="item.productInfo.postage" disabled />
</el-form-item>
</div>
</el-form>
</div>
<div v-if="serviceType === 0 && isShow">
<span>该订单为仅退款订单审核通过之后将直接退款是否审核通过</span>
</div>
<div v-if="serviceType === 1 && isShow">
<span>该订单为退货退款请输入退货地址</span>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="收货人" prop="consignee">
<el-input v-model="form.consignee" />
</el-form-item>
<el-form-item label="手机号" prop="phoneNumber">
<el-input v-model="form.phoneNumber" />
</el-form-item>
<el-form-item label="地址" prop="address">
<el-input v-model="form.address" />
</el-form-item>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button class="refuse" type="danger" v-if="isShow" :loading="loading" @click="submit(1)">拒绝</el-button>
<el-button class="check" type="primary" v-if="isShow" :loading="loading" @click="submit(0)">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import {salesCheck} from '@/api/bxg/yxStoreAfterSales.js'
export default {
props: {
},
data () {
return {
visible: false,
isShow: false,
loading: false,
serviceType: '',
checkForm: {},
form: {
salesId: '', // 售后id
orderCode: '', // 订单编号
approvalStatus: '', // 审核状态0成功1失败
consignee: '', // 收货人
phoneNumber: '', // 手机号
address: '' // 地址
},
rules: {
consignee: [{ required: true, message: '请输入收货人', trigger: 'blur' }],
phoneNumber: [{ required: true, message: '请输入收货人手机号', trigger: 'blur' }],
address: [{ required: true, message: '请输入收货地址', trigger: 'blur' }]
},
}
},
methods: {
cancel() {
this.visible = false
this.$refs['form'].resetFields()
},
async submit(type) {
this.loading = true
if (this.serviceType === 0) {
this.form.consignee = ''
this.form.phoneNumber = ''
this.form.address = ''
}
this.form.approvalStatus = type // 0成功 1失败
var res = await salesCheck(this.form)
if (res) {
this.$message.success('审核成功')
this.visible = false
this.$emit('checkSuccess')
} else {
this.$message.error(res.message || '审核失败!')
}
this.loading = false
}
}
}
</script>
<style lang="scss" scoped>
.afterSealsAdd{
padding-bottom: 10vh;
span{
color: #F56C6C;
line-height: 40px;
font-size: 18px;
font-weight: bold;
margin: 25px 0;
}
}
.afterSealsAdd ::v-deep.el-input.is-disabled .el-input__inner{
color: #333333;
}
.afterSealsAdd ::v-deep .dialog-footer{
display: flex;
justify-content: space-around;
.el-button{
width: 120px;
height: 40px;
}
.refuse{}
.check{}
}
</style>
+267
View File
@@ -0,0 +1,267 @@
<template>
<div class="afterSealsContainer">
<!-- 搜索栏 -->
<div class="titleSearch">
<el-input v-model="query.orderCode" clearable placeholder="输入搜索订单号" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-date-picker
v-model="searchTime"
:default-time="['00:00:00','23:59:59']"
type="daterange"
range-separator=":"
size="small"
class="date-item"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<br>
<el-select v-model="query.type"
clearable placeholder="售后类型"
class="filter-item"
style="width: 130px">
<el-option
v-for="item in serviceTypeOptions"
:key="item.key"
:label="item.name"
:value="item.key" />
</el-select>
<el-select v-model="query.salesState"
clearable placeholder="售后状态"
class="filter-item"
style="width: 130px">
<el-option
v-for="item in salesOptions"
:key="item.key"
:label="item.name"
:value="item.key" />
</el-select>
<el-select v-model="query.state"
clearable placeholder="订单状态"
class="filter-item"
style="width: 130px">
<el-option
v-for="item in statusOptions"
:key="item.key"
:label="item.name"
:value="item.key" />
</el-select>
<el-button size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<el-button
size="mini"
type="warning"
icon="el-icon-refresh-left"
@click="resetSearch">重置</el-button>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<!-- <crudOperation :permission="permission" /> -->
<!--表格渲染-->
<el-table
ref="table"
v-loading="loading"
:data="data"
size="small"
style="width: 100%;"
@selection-change="val => {selections = val}">
<!-- @selection-change="selectionChangeHandler" -->
<el-table-column type="selection" width="55" />
<el-table-column prop="orderCode" label="订单号" />
<el-table-column prop="refundAmount" label="退款金额" width="100px"/>
<el-table-column prop="serviceType" label="服务类型" >
<template slot-scope="scope">
<span v-if="scope.row.serviceType === 0">仅退款</span>
<span v-if="scope.row.serviceType === 1">退货退款</span>
</template>
</el-table-column>
<el-table-column prop="reasons" label="申请原因" />
<el-table-column prop="explains" label="说明" />
<el-table-column prop="createTime" label="申请时间" align="center">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="state" label="状态" width="100px" align="center">
<template slot-scope="scope">
<span v-if="scope.row.state === 0" :style="'color: #E6A23C'">等待审核</span>
<span v-if="scope.row.state === 1" :style="'color: #409EFF'">等待用户发货</span>
<span v-if="scope.row.state === 2" :style="'color: #F56C6C'">用户已发货</span>
<span v-if="scope.row.state === 3" :style="'color: #909399'">退款成功</span>
</template>
</el-table-column>
<el-table-column prop="salesState" label="售后状态" width="100px" align="center">
<template slot-scope="scope">
<span v-if="scope.row.salesState === 0" :style="'color: #42b983'">正常</span>
<span v-if="scope.row.salesState === 1" :style="'color: #409EFF'">用户已取消</span>
<span v-if="scope.row.salesState === 2" :style="'color: #F56C6C'">已拒绝用户</span>
</template>
</el-table-column>
<el-table-column
v-permission="['admin','yxStoreAfterSales:edit','yxStoreAfterSales:del']" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button type="text" @click="checkItem(scope.row, 0)">订单详情</el-button>
<el-button
size="mini"
type="success"
v-if="scope.row.state === 0 && scope.row.salesState === 0"
@click="checkItem(scope.row, 1)">审核</el-button>
<el-button
size="mini"
type="danger"
v-if="scope.row.state === 2"
@click="rebackVisible = true;
rebackQuery.salesId = scope.row.id;
rebackQuery.orderCode = scope.row.orderCode">
退款</el-button>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 20px; float: right"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange" />
<!-- 审核、订单详情 -->
<CheckDialog ref="addForm" :visible="addVisible" @checkSuccess="toQuery"/>
<!-- 退款 -->
<el-dialog
title="退款"
:visible.sync="rebackVisible"
width="400px">
<span>
是否给订单号:<b :style="'color: #409EFF'">{{ this.rebackQuery.orderCode }}</b> 确认退款?
</span>
<span slot="footer" class="dialog-footer">
<el-button @click="rebackVisible = false">取 消</el-button>
<el-button type="primary" @click="rebackItem">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import initData from '@/mixins/crud'
import {rebackMoney} from '@/api/bxg/yxStoreAfterSales'
import CheckDialog from './checkDialog.vue'
export default {
name: 'YxStoreAfterSales',
components: { CheckDialog },
mixins: [initData],
data() {
return {
addVisible: false,
rebackVisible: false,
searchTime: [],
permission: {
add: ['admin', 'yxStoreAfterSales:add'],
edit: ['admin', 'yxStoreAfterSales:edit'],
del: ['admin', 'yxStoreAfterSales:del']
},
salesOptions: [
{ key: 0, name: '正常'},
{ key: 1, name: '用户已取消' },
{ key: 2, name: '已拒绝用户'}
],
serviceTypeOptions: [
{ key: null, name: '全部' },
{ key: 0, name: '仅退款' },
{ key: 1, name: '退货退款' }
],
statusOptions: [
{ key: 0, name: '待审核'},
{ key: 1, name: '等待用户发货'},
{ key: 2, name: '用户已发货'},
{ key: 3, name: '已完成'},
],
// 退款参数
rebackQuery: {
orderCode: '', // 订单号
salesId: 0 // 数据的id
}
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
beforeInit() {
this.url = 'bxg/api/yxStoreAfterSales/sales/List'
this.params = {
page: this.page,
size: this.size,
serviceType: this.query.type || '', // 查询类型
salesState: this.query.salesState || 0, // 售后状态
state: this.query.state,
orderCode: this.query.orderCode || '',
time: this.searchTime
// startingTime: `${this.searchTime[0]}` || '',
// endTime: `${this.searchTime[1]}` || ''
}
if (this.query.state === 0) this.params.state = 0;
return true
},
resetSearch() {
this.query.orderCode = this.query.type = this.query.salesState = this.query.state = '';
this.searchTime = [];
this.toQuery()
},
// 审核
checkItem(row, type) {
this.$refs.addForm.checkForm = row
this.$refs.addForm.serviceType = row.serviceType
this.$refs.addForm.form.salesId = row.id
this.$refs.addForm.form.orderCode = row.orderCode
if (type === 1) {
this.$refs.addForm.isShow = true
} else {
this.$refs.addForm.isShow = false
}
this.$refs.addForm.visible = true
},
// 退款
async rebackItem() {
var res = await rebackMoney(this.rebackQuery)
if (res) {
this.$message.success('提交退款成功!')
this.rebackVisible = false
this.toQuery()
} else {
this.$message.error(res.message || '提交退款失败!')
}
}
}
}
</script>
<style lang="scss" scoped>
.afterSealsContainer{
padding: 12px 8px;
.titleSearch {
line-height: 40px;
margin: 20px 0;
}
.table-img {
display: inline-block;
text-align: center;
background: #ccc;
color: #fff;
white-space: nowrap;
position: relative;
overflow: hidden;
vertical-align: middle;
width: 32px;
height: 32px;
line-height: 32px;
}
}
</style>
+144
View File
@@ -0,0 +1,144 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission"/>
<!--表单组件-->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0"
:title="crud.status.title" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="版本名称">
<el-input v-model="form.versionName" style="width: 370px;"/>
</el-form-item>
<el-form-item label="版本描述">
<el-input v-model="form.versionInfo" style="width: 370px;"/>
</el-form-item>
<el-form-item label="版本code">
<el-input v-model="form.versionCode" style="width: 370px;"/>
</el-form-item>
<el-form-item label="ios应用商店链接">
<el-input v-model="form.iosUrl" style="width: 370px;"/>
</el-form-item>
<el-form-item label="安卓下载链接">
<el-input v-model="form.androidUrl" style="width: 370px;"/>
</el-form-item>
<el-form-item label="是否强制升级">
<el-radio v-for="item in dict.force_update" :key="item.id" v-model="form.forceUpdate" :label="item.value">
{{ item.label }}
</el-radio>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
</div>
</el-dialog>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;"
@selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55"/>
<el-table-column v-if="columns.visible('versionName')" prop="versionName" label="版本名称"/>
<el-table-column v-if="columns.visible('versionInfo')" prop="versionInfo" label="版本描述"/>
<el-table-column v-if="columns.visible('versionCode')" prop="versionCode" label="版本code"/>
<el-table-column v-if="columns.visible('iosUrl')" prop="iosUrl" label="ios store应用商店链接"/>
<el-table-column v-if="columns.visible('androidUrl')" prop="androidUrl" label="安卓下载链接"/>
<el-table-column v-if="columns.visible('forceUpdate')" prop="forceUpdate" label="是否强制升级">
<template slot-scope="scope">
{{ dict.label.force_update[scope.row.forceUpdate] }}
</template>
</el-table-column>
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="更新时间">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column v-permission="['admin','yxAppVersion:edit','yxAppVersion:del']" label="操作" width="150px"
align="center">
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination/>
</div>
</div>
</template>
<script>
import crudYxAppVersion from '@/api/bxg/yxAppVersion'
import CRUD, {presenter, header, form, crud} from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import MaterialList from "@/components/material";
// crud交由presenter持有
const defaultCrud = CRUD({
title: 'app版本控制',
url: 'api/yxAppVersion',
sort: 'id,desc',
crudMethod: {...crudYxAppVersion}
})
const defaultForm = {
id: null,
isDel: null,
createTime: null,
updateTime: null,
versionCode: null,
versionName: null,
versionInfo: null,
iosUrl: null,
androidUrl: null,
forceUpdate: null
}
export default {
name: 'YxAppVersion',
components: {pagination, crudOperation, rrOperation, udOperation, MaterialList},
mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()],
dicts: ['force_update'],
data() {
return {
permission: {
add: ['admin', 'yxAppVersion:add'],
edit: ['admin', 'yxAppVersion:edit'],
del: ['admin', 'yxAppVersion:del']
},
rules: {}
}
},
watch: {},
methods: {
// 获取数据前设置好接口地址
[CRUD.HOOK.beforeRefresh]() {
return true
}, // 新增与编辑前做的操作
[CRUD.HOOK.afterToCU](crud, form) {
},
}
}
</script>
<style scoped>
.table-img {
display: inline-block;
text-align: center;
background: #ccc;
color: #fff;
white-space: nowrap;
position: relative;
overflow: hidden;
vertical-align: middle;
width: 32px;
height: 32px;
line-height: 32px;
}
</style>
+137
View File
@@ -0,0 +1,137 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-input v-model="query.cateName" clearable size="small" placeholder="输入分类名称搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
<rrOperation :crud="crud" />
</div>
<crudOperation :permission="permission" />
</div>
<!--表单组件-->
<el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="分类名称">
<el-input v-model="form.cateName" style="width: 370px;" />
</el-form-item>
<el-form-item label="分类图片">
<MaterialList v-model="picArr" type="image" :num="1" :width="150" :height="150" />
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="form.isShow" style="width: 178px">
<el-radio :label="1">显示</el-radio>
<el-radio :label="0">隐藏</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="排序">
<el-input v-model="form.sort" style="width: 370px;" />
</el-form-item>
<el-form-item style="margin-bottom: 0;" label="上级分类" prop="pid">
<treeselect v-model="form.pid" :options="depts" style="width: 370px;" placeholder="选择上级分类" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
</div>
</el-dialog>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" :data="crud.data" row-key="id" @select="crud.selectChange" @select-all="crud.selectAllChange" @selection-change="crud.selectionChangeHandler">
<el-table-column :selectable="checkboxT" type="selection" width="55" />
<el-table-column v-if="columns.visible('cateName')" label="名称" prop="cateName" />
<el-table-column v-if="columns.visible('isShow')" label="状态" align="center" prop="isShow">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.isShow === 1" :type="''">显示</el-tag>
<el-tag v-else :type=" 'info' ">隐藏</el-tag>
</div>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('sort')" label="排序" prop="sort" sortable/>
<el-table-column v-permission="['admin','YXSTORECATEGORY_EDIT','YXSTORECATEGORY_DELETE']" label="操作" width="130px" align="center" fixed="right">
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
msg="确定删除吗,如果存在下级节点则一并删除此操作不能撤销"
/>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import crudDept from '@/api/bxg/yxStoreCategory'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import picUpload from '@/components/pic-upload'
import MaterialList from '@/components/material'
// crud交由presenter持有
const defaultCrud = CRUD({ title: '分类', url: 'api/yxStoreCategory', sort: 'sort,desc', crudMethod: { ...crudDept }})
const defaultForm = { id: null, cateName: null, pid: 0, isShow: 1 , sort: 1}
export default {
name: 'Dept',
components: { Treeselect, crudOperation, rrOperation, udOperation, picUpload, MaterialList },
mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()],
data() {
return {
picArr: [],
depts: [],
rules: {
cateName: [
{ required: true, message: '请输入名称', trigger: 'blur' }
]
},
permission: {
add: ['admin', 'YXSTORECATEGORY_CREATE'],
edit: ['admin', 'YXSTORECATEGORY_EDIT'],
del: ['admin', 'YXSTORECATEGORY_DELETE']
},
enabledTypeOptions: [
{ key: 'true', display_name: '正常' },
{ key: 'false', display_name: '禁用' }
]
}
},
watch: {
picArr: function(val) {
console.log();
this.form.pic = val.join(',')
}
},
methods: {
// 新增与编辑前做的操作
[CRUD.HOOK.afterToCU](crud, form) {
this.picArr = []
if (form.pic && form.id) {
this.picArr = form.pic.split(',')
}
// 获取所有部门
crudDept.getCates({ isShow: true }).then(res => {
this.depts = []
const dept = { id: 0, label: '顶级类目', children: [] }
dept.children = res.content
this.depts.push(dept)
})
},
// 提交前的验证
[CRUD.HOOK.afterValidateCU]() {
return true
},
checkboxT(row, rowIndex) {
return row.id !== 1
}
}
}
</script>
<style scoped>
</style>
+82
View File
@@ -0,0 +1,82 @@
<template>
<div class="app-container">
<div class="head-container">
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column type="selection" width="55" />
<el-table-column prop="id" label="id" />
<el-table-column prop="uid" label="用户ID" />
<el-table-column prop="userName" label="用户名" />
<el-table-column prop="productId" label="商品ID" />
<el-table-column prop="product.storeName" label="商品名称" />
<el-table-column ref="table" prop="product.image" label="商品图片">
<template slot-scope="scope">
<a :href="scope.row.product.image" style="color: #42b983" target="_blank"><img :src="scope.row.product.image" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column prop="type" label="类型">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.type == 'collect'" :type="''">收藏</el-tag>
<el-tag v-else :type=" 'info' ">足迹</el-tag>
</div>
</template>
</el-table-column>
<el-table-column prop="createTime" label="添加时间">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import initData from '@/mixins/crud'
export default {
name: 'YxStoreProductRelation',
mixins: [initData],
data(){
return {
query:{
type: 'type',
} }
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
beforeInit() {
this.url = 'bxg/api/yxStoreProductRelation'
const sort = 'create_time,desc'
this.params = { page: this.page, size: this.size, sort: sort }
const query = this.query
this.params[query.type] = 'collect'
return true
}
}
}
</script>
<style scoped>
</style>
+262
View File
@@ -0,0 +1,262 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-input
v-model="query.nickName"
clearable
placeholder="输入用户昵称"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<el-input
v-model="query.remark"
clearable
placeholder="输入备注"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
<rrOperation :crud="crud" />
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" />
<!--表单组件-->
<el-dialog
:close-on-click-modal="false"
:before-close="crud.cancelCU"
:visible.sync="crud.status.cu > 0"
:title="crud.status.title"
width="750px"
>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px">
<el-form-item label="用户昵称">
<el-input v-model="form.nickName" style="width: 485px;" :disabled="true" />
</el-form-item>
<el-form-item label="openId">
<el-input v-model="form.openId" style="width: 485px;" :disabled="true" />
</el-form-item>
<el-form-item label="扫码获取">
<div class="qrcode_img">
<el-image :src="gzhsrc" class="qrcode">
<div slot="placeholder" class="image-slot">
加载中
<span class="dot">...</span>
</div>
</el-image>
<div class="attention">
<span class="demonstration">注:未关注公众号请先关注</span>
</div>
</div>
<div class="qrcode_img">
<el-image :src="src" class="qrcode">
<div slot="placeholder" class="image-slot">
加载中
<span class="dot">...</span>
</div>
</el-image>
</div>
</el-form-item>
<el-form-item label="备注" style="margin-top:40px">
<el-input v-model="form.remark" style="width: 485px;" />
</el-form-item>
<el-form-item label="是否启用">
<el-radio v-for="item in dict.is_enable" :key="item.id" v-model="form.isEnable" :label="item.value">{{ item.label }}</el-radio>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
</div>
</el-dialog>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
size="small"
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('id')" prop="id" label="id" />
<el-table-column v-if="columns.visible('nickName')" prop="nickName" label="用户昵称" />
<el-table-column v-if="columns.visible('openId')" prop="openId" label="用户标识" />
<el-table-column v-if="columns.visible('remark')" prop="remark" label="备注" />
<el-table-column v-if="columns.visible('isEnable')" prop="isEnable" label="是否启用">
<template slot-scope="scope">
{{ dict.label.is_enable[scope.row.isEnable] }}
</template>
</el-table-column>
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="创建时间">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column
v-permission="['admin','yzCustomer:edit','yzCustomer:del']"
label="操作"
width="150px"
align="center"
>
<template slot-scope="scope">
<udOperation :data="scope.row" :permission="permission" />
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import crudYzCustomer from "@/api/bxg/yxStoreCustomer";
import CRUD, { presenter, header, form, crud } from "@crud/crud";
import rrOperation from "@crud/RR.operation";
import crudOperation from "@crud/CRUD.operation";
import udOperation from "@crud/UD.operation";
import pagination from "@crud/Pagination";
import { RandomNumber } from "@/utils/index";
// crud交由presenter持有
const defaultCrud = CRUD({
title: "消息通知",
url: "api/yxStoreCustomer",
sort: "id,desc",
crudMethod: { ...crudYzCustomer }
});
const defaultForm = {
id: null,
nickName: null,
openId: null,
remark: null,
createTime: null,
updateTime: null
};
export default {
name: "yxStoreCustomer",
components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()],
dicts: ['is_enable'],
data() {
return {
timer: null, //定时器
src: "",
gzhsrc: "",
permission: {
add: ["admin", "yzCustomer:add"],
edit: ["admin", "yzCustomer:edit"],
del: ["admin", "yzCustomer:del"]
},
rules: {}
};
},
created() {
this.init();
},
methods: {
// 获取数据前设置好接口地址
[CRUD.HOOK.beforeRefresh]() {
const query = this.query;
if (query.type && query.value) {
this.crud.params[query.type] = query.value;
}
return true;
},
[CRUD.HOOK.beforeToAdd]() {
this.randomStr = RandomNumber();
this.src =
process.env.VUE_APP_BASE_API + "/api/wxmp/qrcode?key=" + this.randomStr;
this.setIntervaltimer();
crudYzCustomer.getwechatCode()
//getOpenId("FK14YV17TURrFdyWG4")
.then(res => {
if (res != "") {
this.gzhsrc = res;
console.log(res);
}
})
.catch(err => {
console.log(err.response.data.message);
});
return true;
},
//新增与编辑前做的操作
[CRUD.HOOK.afterToCU](crud, form) {
},
[CRUD.HOOK.beforeToCU]() {
this.randomStr = RandomNumber();
this.src =
process.env.VUE_APP_BASE_API + "/api/wxmp/qrcode?key=" + this.randomStr;
this.setIntervaltimer();
return true;
},
[CRUD.HOOK.afterAddCancel]() {
clearInterval(this.timer);
this.timer = null;
return true;
},
[CRUD.HOOK.afterEditCancel]() {
clearInterval(this.timer);
this.timer = null;
return true;
},
[CRUD.HOOK.afterAddCancel]() {
clearInterval(this.timer);
this.timer = null;
return true;
},
init() {},
setIntervaltimer() {
if (this.timer != null) {
clearInterval(this.timer);
this.timer = null;
}
this.timer = setInterval(() => {
crudYzCustomer.getOpenId(this.randomStr)
//getOpenId("FK14YV17TURrFdyWG4")
.then(res => {
if (res != "") {
this.form.nickName = res.nickName;
this.form.openId = res.openId;
clearInterval(this.timer);
this.timer = null;
}
})
.catch(err => {
console.log(err.response.data.message);
});
}, 2000);
return this.timer;
}
}
};
</script>
<style scoped>
.qrcode_img {
width: 250px;
height: 250px;
float: left;
}
.qrcode_img .qrcode {
width: 100%;
height: 100%;
}
.attention {
line-height: 0px;
color: red;
margin-left: 20px;
font-size: 19px;
}
</style>
+102
View File
@@ -0,0 +1,102 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px">
<el-form-item label="快递公司编号" prop="code">
<el-input v-model="form.code" style="width: 300px;" />
</el-form-item>
<el-form-item label="快递公司名称">
<el-input v-model="form.name" style="width: 300px;" />
</el-form-item>
<el-form-item label="排序">
<el-input v-model="form.sort" style="width: 300px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/bxg/yxExpress'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
code: '',
name: '',
sort: 0
},
rules: {
code: [
{ required: true, message: 'please enter', trigger: 'blur' }
]
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
code: '',
name: '',
sort: 0
}
}
}
}
</script>
<style scoped>
</style>
+121
View File
@@ -0,0 +1,121 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['admin','YXEXPRESS_ALL','YXEXPRESS_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="code" label="快递公司编号" />
<el-table-column prop="name" label="快递公司名称" />
<el-table-column prop="sort" label="排序" />
<el-table-column v-if="checkPermission(['admin','YXEXPRESS_ALL','YXEXPRESS_EDIT','YXEXPRESS_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['admin','YXEXPRESS_ALL','YXEXPRESS_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXEXPRESS_ALL','YXEXPRESS_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxExpress'
import eForm from './form'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxExpress'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
code: data.code,
name: data.name,
sort: data.sort,
isShow: data.isShow
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+82
View File
@@ -0,0 +1,82 @@
<template>
<div class="app-container">
<div class="head-container">
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column type="selection" width="55" />
<el-table-column prop="id" label="id" />
<el-table-column prop="uid" label="用户ID" />
<el-table-column prop="userName" label="用户名" />
<el-table-column prop="productId" label="商品ID" />
<el-table-column prop="product.storeName" label="商品名称" />
<el-table-column ref="table" prop="product.image" label="商品图片">
<template slot-scope="scope">
<a :href="scope.row.product.image" style="color: #42b983" target="_blank"><img :src="scope.row.product.image" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column prop="type" label="类型">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.type == 'collect'" :type="''">收藏</el-tag>
<el-tag v-else :type=" 'info' ">足迹</el-tag>
</div>
</template>
</el-table-column>
<el-table-column prop="createTime" label="添加时间">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import initData from '@/mixins/crud'
export default {
name: 'YxStoreProductRelation',
mixins: [initData],
data(){
return {
query:{
type: 'type',
} }
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
beforeInit() {
this.url = 'bxg/api/yxStoreProductRelation'
const sort = 'create_time,desc'
this.params = { page: this.page, size: this.size, sort: sort }
const query = this.query
this.params[query.type] = 'foot'
return true
}
}
}
</script>
<style scoped>
</style>
+450
View File
@@ -0,0 +1,450 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="title" width="900px">
<el-form v-show="hidden == false" ref="form" :model="form" :inline="true" :rules="rules" label-width="80px">
<el-form-item label="规则名称">
<el-row :gutter="10">
<el-col :span="10"><el-button type="primary" @click="hiddenBool">添加新规则</el-button></el-col>
</el-row>
</el-form-item>
</el-form>
<el-form v-show="hidden == true" ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="规则名称">
<el-row :gutter="10">
<el-col
v-for="(item, index) in items"
:key="index"
:span="5"
style="position: relative;margin-right: 6px"
>
<el-input v-model="item.value" style="width: 150px;" placeholder="设置名称" />
<el-button v-show="item.attrHidden == true" type="text" style="position: absolute;top:-6px;right:17px;margin-top:1px;border: none;font-size: 14px;font-weight:bold;line-height: 1.8" icon="el-icon-close" @click="handleRemove(index)" />
<el-button v-show="item.attrHidden == false" type="text" style="position: absolute;top:-6px;right:17px;margin-top:1px;border: none;font-size: 14px;font-weight:bold;line-height: 1.8" icon="el-icon-check" @click="attrHiddenBool(item)" />
</el-col>
<el-col :span="5"><el-button type="primary" @click="handleAdd">添加新规则</el-button></el-col>
</el-row>
</el-form-item>
<el-form-item
v-for="(item, index) in items"
v-show="item.attrHidden == true"
:key="index"
:label="''+item.value+':'"
>
<el-row :gutter="13">
<el-col
v-for="(attr,k) in item.detail"
:key="attr"
:span="3"
:name="attr"
>
<el-tag closable @close="attrRemove(item,k)">{{ attr }}</el-tag>
</el-col>
<el-col :span="5">
<el-input v-model="item.detailValue" style="width: 150px;" placeholder="设置属性" />
</el-col>
<el-col :span="5">
<el-button type="primary" @click="attrAdd(item)">添加</el-button>
</el-col>
</el-row>
</el-form-item>
<el-form-item v-show="hidden == true">
<el-row :gutter="24">
<el-col :span="24"><el-button :loading="loading" type="primary" @click="addGoods(true)">生成</el-button></el-col>
</el-row>
</el-form-item>
<template v-if="items[0].value!='' && items[0].detail.length>0 && attrs.length">
<template v-for="(attr,index) in attrs">
<el-form-item>
<el-row :gutter="24">
<template v-for="(item,index) in attr.detail">
<el-col :span="3" style="margin-right: 2px">
{{ index }}:{{ item }}
</el-col>
</template>
<el-col :span="4">
<span :class="attr.check ? 'check':''">金额:</span>&nbsp;
<el-input v-model="attr.price" placeholder="金额" style="width: 60%" :number="true" />
</el-col>
<el-col :span="4">
<span :class="attr.check ? 'check':''">库存:</span>&nbsp;
<el-input v-model="attr.sales" placeholder="库存" style="width: 60%" :number="true" maxlength="7"/>
</el-col>
<el-col :span="5">
<span :class="attr.check ? 'check':''">成本价:</span>&nbsp;
<el-input v-model="attr.cost" placeholder="成本价" style="width: 60%" :number="true" />
</el-col>
<el-col :span="3" style="margin-right: 2px">
<div class="demo-upload">
<!--<img :src="attr.pic">-->
<pic-upload-two v-model="attr.pic" />
</div>
</el-col>
<el-col :span="2" style="margin-right: 3px">
<el-button type="primary" @click="removeGoods(index)">删除</el-button>
</el-col>
</el-row>
</el-form-item>
</template>
<el-form-item>
<el-row :gutter="24">
<el-col :span="2">
<el-button type="primary" :loading="loading" @click="submit">提交</el-button>
</el-col>
<el-col :span="2">
<el-button type="error" @click="clear">清空所有属性</el-button>
</el-col>
</el-row>
</el-form-item>
</template>
</el-form>
</el-dialog>
</template>
<script>
import { getCates } from '@/api/bxg/yxStoreCategory'
import { add, edit, isFormatAttr, setAttr, clearAttr, getAttr } from '@/api/bxg/yxStoreProduct'
import editor from '../../components/Editor'
import picUploadTwo from '@/components/pic-upload-two'
import mulpicUpload from '@/components/mul-pic-upload'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { Message } from 'element-ui'
export default {
components: { editor, picUploadTwo, mulpicUpload, Treeselect },
props: {
isAttr: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false, cates: [], title: '规则属性',
form: {
id: '',
merId: '',
image: '',
sliderImage: '',
storeName: '',
storeInfo: '',
keyword: '',
barCode: '',
cateId: 1,
price: '',
vipPrice: '',
otPrice: '',
postage: '',
unitName: '',
sort: '',
sales: '',
stock: '',
isShow: '',
isHot: '',
isBenefit: '',
isBest: '',
isNew: '',
description: '',
addTime: '',
isPostage: '',
isDel: '',
merUse: '',
giveIntegral: '',
cost: '',
isSeckill: '',
isBargain: '',
isGood: '',
ficti: '',
browse: '',
codePath: '',
soureLink: ''
},
rules: {
},
items: [{
value: '',
detailValue: '',
attrHidden: false,
detail: []
}],
attrs: [],
hidden: false,
attrHidden: false,
submiting: false
}
},
mounted() {
// console.log('items'+this.items)
// console.log('attrs'+this.attrs)
// if(this.items && this.attrs) this.hidden = true;
// window.changeIMG = (index,pic)=>{
// _vm.setAttrPic(index,pic);
// };
},
methods: {
getAttrs(id) {
getAttr(id).then(res => {
console.log('res' + res)
// this.items = JSON.parse(res.attr)
if (res) {
this.hidden = true
this.items = res.attr
this.attrs = res.value
} else {
this.hidden = false
this.items = [{
value: '',
detailValue: '',
attrHidden: false,
detail: []
}]
this.attrs = []
}
})
},
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAttr) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
merId: '',
image: '',
sliderImage: '',
storeName: '',
storeInfo: '',
keyword: '',
barCode: '',
cateId: '',
price: '',
vipPrice: '',
otPrice: '',
postage: '',
unitName: '',
sort: '',
sales: '',
stock: '',
isShow: '',
isHot: '',
isBenefit: '',
isBest: '',
isNew: '',
description: '',
addTime: '',
isPostage: '',
isDel: '',
merUse: '',
giveIntegral: '',
cost: '',
isSeckill: '',
isBargain: '',
isGood: '',
ficti: '',
browse: '',
codePath: '',
soureLink: ''
}
},
setAttrPic(index, pic) {
this.$set(this.attrs[index], 'pic', pic)
},
attrHiddenBool(item) {
if (item.value == '') {
Message({ message: '请填写规则名称', type: 'error' })
} else {
item.attrHidden = true
}
},
hiddenBool() {
this.hidden = true
},
handleAdd() {
if (!this.checkAttr()) return
this.items.push({
value: '',
detailValue: '',
attrHidden: false,
detail: []
})
},
checkAttr() {
var bool = true
this.items.map(function(item) {
if (!bool) return
if (!item.value) {
Message({ message: '请填写规则名称', type: 'error' })
bool = false
} else if (!item.detail.length) {
Message({ message: '请设置规则属性', type: 'error' })
bool = false
}
})
return bool
},
attrAdd(item) {
if (!item.detailValue) return false
item.detail.push(item.detailValue)
item.detailValue = ''
},
handleRemove(index) {
if (this.items.length > 1) { this.items.splice(index, 1) } else { Message({ message: '请设置至少一个规则', type: 'error' }) }
},
attrRemove(item, k) {
console.log('item:')
if (item.detail.length == 1) {
Message({ message: '请设置至少一个属性', type: 'error' })
return false
}
item.detail.splice(k, 1)
},
removeGoods(index) {
this.attrs.splice(index, 1)
},
checkGoods() {
var bool = true
this.attrs.map(function(attr) {
if (!bool) return
if (!Object.keys(attr.detail).length) {
Message({ message: '请选择至少一个属性', type: 'error' })
bool = false
} else if (attr.price != parseFloat(attr.price) || attr.price < 0) {
Message({ message: '请输入正确的商品价格', type: 'error' })
bool = false
} else if (attr.sales != parseInt(attr.sales) || attr.sales < 0) {
Message({ message: '请输入正确的商品库存', type: 'error' })
bool = false
}
})
return bool
},
addGoods(type) {
if (this.attrs.length) {
if (!this.checkGoods()) return
}
var that = this
isFormatAttr(this.form.id, { items: this.items, attrs: this.attrs }).then(res => {
this.attrs = res
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
submit() {
var that = this
that.submiting = true
if (!this.checkAttr() || !this.checkGoods()) return
for (const attr in that.attrs) {
that.attrs[attr].check = false
}
// console.log({items:this.items,attrs:this.attrs})
this.loading = false
setAttr(this.form.id, { items: this.items, attrs: this.attrs }).then(res => {
this.attrs = res
Message({ message: '操作成功', type: 'success' })
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
this.dialog = false
},
clear() {
this.$confirm(`确定要清空属性数据'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
clearAttr(this.form.id).then(({ data }) => {
Message({ message: '操作成功', type: 'success' })
// this.dialog = false
this.getAttrs(this.form.id)
})
})
.catch(() => { })
}
}
}
</script>
<style scoped>
.demo-upload{
display: block;
/*//height: 50px;*/
text-align: center;
border: 1px solid transparent;
border-radius: 4px;
overflow: hidden;
background: #fff;
position: relative;
box-shadow: 0 1px 1px rgba(0,0,0,.2);
margin-right: 4px;
}
.demo-upload img{
width: 100%;
height: 100%;
display: block;
}
.demo-upload-cover{
display: block;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0,0,0,.6);
}
.demo-upload:hover .demo-upload-cover{
display: block;
}
.demo-upload-cover i{
color: #fff;
font-size: 20px;
cursor: pointer;
margin: 0 2px;
}
</style>
+827
View File
@@ -0,0 +1,827 @@
<template>
<div class="app-container">
<el-card :bordered="false">
<el-form ref="formValidate" :rules="ruleValidate" :model="formValidate" label-width="130px" >
<el-row :gutter="24">
<!-- 商品信息-->
<el-col v-bind="grid2">
<el-form-item label="商品名称:" prop="store_name">
<el-input v-model="formValidate.store_name" placeholder="请输入商品名称" />
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="商品分类:" prop="cate_id">
<el-select v-model="formValidate.cate_id" filterable :filter-method="dataFilter" clearable>
<el-option v-for="item in optionsMetaShow" :disabled="item.disabled === 0"
:value="item.value" :key="item.id" :label="item.label" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="商品关键字:" prop="">
<el-input v-model="formValidate.keyword" placeholder="请输入商品关键字" />
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="单位:" prop="unit_name">
<el-input v-model="formValidate.unit_name" placeholder="请输入单位" />
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="商品简介:" prop="">
<el-input v-model="formValidate.store_info" type="textarea" :rows="3" placeholder="请输入商品简介" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="商品封面图:" prop="image">
<single-pic v-model="formValidate.image" type="image" :num="1" :width="150" :height="150" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="商品轮播图:" prop="slider_image">
<MaterialList v-model="formValidate.slider_image" type="image" :num="4" :width="150" :height="150" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="商品规格:" props="spec_type">
<el-radio-group v-model="formValidate.spec_type" @change="changeSpec">
<el-radio :label="0" class="radio">单规格</el-radio>
<el-radio :label="1">多规格{{formValidate.spec_typ}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="开启积分兑换:" props="is_integral">
<el-radio-group v-model="formValidate.is_integral" @change="changeSpec">
<el-radio :label="0" class="radio">不开启</el-radio>
<el-radio :label="1">开启</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<!-- 多规格添加-->
<el-col :span="24" v-if="formValidate.spec_type === 1" class="noForm">
<el-col :span="24">
<el-form-item label="选择规格:" prop="">
<div class="acea-row row-middle">
<el-select v-model="formValidate.selectRule" style="width: 23%;">
<el-option v-for="(item, index) in ruleList" :value="item.ruleName" :key="index">{{ item.ruleName }}</el-option>
</el-select>
<el-button type="primary" class="mr20" @click="confirm">确认</el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item v-if="attrs.length!==0">
<div v-for="(item, index) in attrs" :key="index">
<div class="acea-row row-middle"><span class="mr5">{{item.value}}</span>
<i class="el-icon-circle-close" @click="handleRemoveRole(index)"></i>
</div>
<div class="rulesBox">
<el-tag type="dot" closable color="primary" v-for="(j, indexn) in item.detail" :key="indexn" :name="j" class="mr20" @close="handleRemove2(item.detail,indexn)">{{j}}</el-tag>
<el-input placeholder="请输入属性名称" v-model="item.detail.attrsVal"
style="width: 150px">
<el-button slot="append" type="primary" @click="createAttr(item.detail.attrsVal,index)">添加</el-button>
</el-input>
</div>
</div>
</el-form-item>
</el-col>
<el-col :span="24" v-if="createBnt">
<el-form-item>
<el-button type="primary" icon="md-add" @click="addBtn" class="mr15">添加新规格</el-button>
<el-button type="success" @click="generate">立即生成</el-button>
</el-form-item>
</el-col>
<el-col :span="24" v-if="showIput">
<el-col :xl="6" :lg="9" :md="10" :sm="24" :xs="24" >
<el-form-item label="规格:">
<el-input placeholder="请输入规格" v-model="formDynamic.attrsName" />
</el-form-item>
</el-col>
<el-col :xl="6" :lg="9" :md="10" :sm="24" :xs="24">
<el-form-item label="规格值:">
<el-input v-model="formDynamic.attrsVal" placeholder="请输入规格值" />
</el-form-item>
</el-col>
<el-col :xl="6" :lg="5" :md="10" :sm="24" :xs="24" >
<el-button type="primary" @click="createAttrName">确定</el-button>
<el-button type="danger" @click="offAttrName" >取消</el-button>
</el-col>
</el-col>
<!-- 多规格设置-->
<el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24" v-if="manyFormValidate.length && formValidate.header.length!==0 && attrs.length!==0">
<!-- 多规格表格-->
<el-col :span="24">
<el-form-item label="商品属性:" class="labeltop">
<el-table :data="manyFormValidate" size="small" style="width: 90%;">
<el-table-column type="myindex" v-for="(item,index) in formValidate.header" :key="index" :label="item.title" :property="item.slot" align="center">
<template slot-scope="scope">
<div v-if="scope.column.property == 'pic'" align="center">
<single-pic v-model="scope.row[scope.column.property]" type="image" :num="1" :width="60" :height="60" />
</div>
<div v-else-if="scope.column.property.indexOf('value') != -1" align="center">
{{ scope.row[scope.column.property] }}
</div>
<div v-else-if="scope.column.property == 'action'" align="center" >
<a @click="delAttrTable(scope.$index)" align="center">删除</a>
</div>
<div v-else align="center">
<el-input v-model="scope.row[scope.column.property]" align="center" />
</div>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-col>
</el-col>
</el-col>
<!-- 单规格表格-->
<el-col :xl="23" :lg="24" :md="24" :sm="24" :xs="24" v-if="formValidate.spec_type === 0">
<el-form-item >
<el-table :data="oneFormValidate" size="small" style="width: 90%;">
<el-table-column prop="pic" label="图片" align="center">
<template slot-scope="scope">
<single-pic v-model="scope.row.pic" type="image" :num="1" :width="60" :height="60" />
</template>
</el-table-column>
<el-table-column prop="price" label="售价" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.price"/>
</template>
</el-table-column>
<el-table-column prop="cost" label="成本价" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.cost"/>
</template>
</el-table-column>
<el-table-column prop="ot_price" label="原价" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.ot_price"/>
</template>
</el-table-column>
<el-table-column prop="stock" label="库存" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.stock" maxlength="7"/>
</template>
</el-table-column>
<el-table-column prop="bar_code" label="商品编号" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.bar_code"/>
</template>
</el-table-column>
<el-table-column prop="weight" label="重量(KG" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.weight"/>
</template>
</el-table-column>
<el-table-column prop="volume" label="体积(m³)" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.volume"/>
</template>
</el-table-column>
<el-table-column prop="volume" label="所需兑换积分" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.integral"/>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="运费模板:" prop="temp_id">
<div class="acea-row">
<el-select v-model="formValidate.temp_id" class="mr20">
<el-option v-for="(item,index) in templateList" :value="item.id" :key="index" :label="item.name">
</el-option>
</el-select>
</div>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="商品详情:">
<ueditor-wrap v-model="formValidate.description" :config="myConfig" @beforeInit="addCustomDialog" style="width: 90%;"></ueditor-wrap>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col v-bind="grid">
<el-form-item label="虚拟销量:">
<el-input-number :min="0" v-model="formValidate.ficti" placeholder="请输入虚拟销量" />
</el-form-item>
</el-col>
<el-col v-bind="grid">
<el-form-item label="购买返回积分:">
<el-input-number v-model="formValidate.give_integral" :min="0" placeholder="请输入积分" />
</el-form-item>
</el-col>
<el-col v-bind="grid">
<el-form-item label="排序:">
<el-input-number :min="0" v-model="formValidate.sort" placeholder="请输入排序" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="佣金设置:">
<el-radio-group v-model="formValidate.is_sub">
<el-radio :label="1" class="radio">单独设置</el-radio>
<el-radio :label="0">默认设置</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24" v-if="formValidate.is_sub === 1">
<!--单规格返佣-->
<el-form-item label="商品属性:" v-if="formValidate.spec_type === 0">
<el-table :data="oneFormValidate" size="small" style="width: 90%;">
<el-table-column prop="imageArr" label="图片" align="center">
<template slot-scope="scope">
<el-image :src="scope.row.pic" class="el-avatar">
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline"></i>
</div>
</el-image>
</template>
</el-table-column>
<el-table-column prop="price" label="售价" align="center" />
<el-table-column prop="cost" label="成本价" align="center" />
<el-table-column prop="ot_price" label="原价" align="center" />
<el-table-column prop="stock" label="库存" align="center" />
<el-table-column prop="bar_code" label="商品编号" align="center" />
<el-table-column prop="weight" label="重量(KG" align="center" />
<el-table-column prop="volume" label="体积(m³" align="center" />
<el-table-column prop="volume" label="一级返佣" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.brokerage"/>
</template>
</el-table-column>
<el-table-column prop="volume" label="二级返佣" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.brokerage_two"/>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item label="商品属性:" v-if="formValidate.spec_type === 1 && manyFormValidate.length">
<el-table :data="manyFormValidate" size="small" style="width: 90%;">
<el-table-column prop="imageArr" label="图片" align="center">
<template slot-scope="scope">
<el-image :src="scope.row.pic" :width="60" :height="60" >
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline"></i>
</div>
</el-image>
</template>
</el-table-column>
<el-table-column prop="sku" label="规格" align="center" />
<el-table-column prop="price" label="售价" align="center" />
<el-table-column prop="cost" label="成本价" align="center" />
<el-table-column prop="ot_price" label="原价" align="center" />
<el-table-column prop="stock" label="库存" align="center" />
<el-table-column prop="bar_code" label="商品编号" align="center" />
<el-table-column prop="weight" label="重量(KG" align="center" />
<el-table-column prop="volume" label="体积(m³)" align="center" />
<el-table-column prop="integral" label="所需兑换积分" align="center" />
<el-table-column prop="volume" label="一级返佣" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.brokerage"/>
</template>
</el-table-column>
<el-table-column prop="volume" label="二级返佣" align="center">
<template slot-scope="scope">
<el-input type="text" v-model="scope.row.brokerage_two"/>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-col>
<el-col v-bind="grid">
<el-form-item label="商品状态:">
<el-radio-group v-model="formValidate.is_show" >
<el-radio :label="1" class="radio">上架</el-radio>
<el-radio :label="0">下架</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col v-bind="grid">
<el-form-item label="热卖单品:">
<el-radio-group v-model="formValidate.is_hot" >
<el-radio :label="1" class="radio">开启</el-radio>
<el-radio :label="0">关闭</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col v-bind="grid">
<el-form-item label="猜你喜欢:">
<el-radio-group v-model="formValidate.is_benefit" >
<el-radio :label="1" class="radio">开启</el-radio>
<el-radio :label="0">关闭</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col v-bind="grid">
<el-form-item label="精品推荐:">
<el-radio-group v-model="formValidate.is_best" >
<el-radio :label="1" class="radio">开启</el-radio>
<el-radio :label="0">关闭</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col v-bind="grid">
<el-form-item label="首发新品:">
<el-radio-group v-model="formValidate.is_new" >
<el-radio :label="1" class="radio">开启</el-radio>
<el-radio :label="0">关闭</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-form-item>
<el-button type="primary" class="submission" @click="handleSubmit('formValidate')">保存</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</template>
<script>
import { getCates } from '@/api/bxg/yxStoreCategory'
import { add, edit, getInfo, isFormatAttr } from '@/api/bxg/yxStoreProduct'
import editor from '../../components/Editor'
import picUpload from '@/components/pic-upload'
import mulpicUpload from '@/components/mul-pic-upload'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import MaterialList from '@/components/material'
import singlePic from '@/components/singlematerial'
import UeditorWrap from 'vue-ueditor-wrap';
export default {
components: { editor, picUpload, mulpicUpload, Treeselect, MaterialList, UeditorWrap, singlePic },
data() {
return {
spinShow: false,
grid2: {
xl: 10,
lg: 12,
md: 12,
sm: 24,
xs: 24
},
grid3: {
xl: 18,
lg: 18,
md: 20,
sm: 24,
xs: 24
},
// 批量设置表格data
oneFormBatch: [
{
pic: '',
price: 0,
cost: 0,
ot_price: 0,
stock: 0,
bar_code: '',
seckill_stock: 0,
seckill_price: 0,
pink_stock: 0,
pink_price: 0,
weight: 0,
volume: 0,
integral:0
}
],
// 规格数据
formDynamic: {
attrsName: '',
attrsVal: ''
},
formDynamicNameData: [],
isBtn: false,
myConfig: {
autoHeightEnabled: false, // 编辑器不自动被内容撑高
initialFrameHeight: 500, // 初始容器高度
initialFrameWidth: '100%', // 初始容器宽度
UEDITOR_HOME_URL: '/UEditor/',
serverUrl: ''
},
columns: [],
formValidate: {
imageArr:[],
sliderImageArr: [],
store_name: '',
cate_id: '',
keyword: '',
unit_name: '',
store_info: '',
image: '',
slider_image: [],
description: '',
ficti: 0,
give_integral: 0,
sort: 0,
is_show: 1,
is_hot: 0,
is_benefit: 0,
is_best: 0,
is_new: 0,
is_good: 0,
is_postage: 0,
is_sub: 0,
is_integral: 0,
id: 0,
spec_type: 0,
temp_id: '',
attrs: [],
items: [
{
pic: '',
price: 0,
cost: 0,
ot_price: 0,
stock: 0,
bar_code: '',
integral:0
}
],
header: [],
selectRule: ''
},
ruleList: [],
templateList: [],
createBnt: false,
showIput: false,
manyFormValidate: [],
// 单规格表格data
oneFormValidate: [
{
imageArr: [],
pic: '',
price: 2,
cost: 0,
ot_price: 0,
stock: 0,
seckill_stock: 0,
seckill_price: 0,
pink_stock: 0,
pink_price: 0,
bar_code: '',
weight: 0,
volume: 0,
brokerage: 0,
brokerage_two: 0,
integral: 0
}
],
images: [],
grid: {
xl: 8,
lg: 8,
md: 12,
sm: 24,
xs: 24
},
loading: false,
treeSelect: [],
optionsMetaShow: [],
tableIndex: 0,
ruleValidate: {
store_name: [
{ required: true, message: '请输入商品名称', trigger: 'blur' }
],
cate_id: [
{ required: true, message: '请选择商品分类', trigger: 'change' }
],
keyword: [
{ required: true, message: '请输入商品关键字', trigger: 'blur' }
],
unit_name: [
{ required: true, message: '请输入单位', trigger: 'blur' }
],
store_info: [
{ required: true, message: '请输入商品简介', trigger: 'blur' }
],
spec_type: [
{ required: true, message: '请选择商品规格', trigger: 'change' }
],
selectRule: [
{ required: true, message: '请选择商品规格属性', trigger: 'change' }
],
temp_id: [
{ required: true, message: '请选择运费模板', trigger: 'change', type: 'number' }
]
},
attrs: []
}
},
watch: {
'formValidate.image': function(val) {
console.log('aaaa:'+val)
if (val) {
this.oneFormValidate[0].pic = val
console.log('bbbbbb:'+this.oneFormValidate.pic)
}
},
'form.sliderImageArr': function(val) {
if (val) {
this.form.slider_image = val.join(',')
}
}
},
mounted () {
this.getInfo();
},
methods: {
dataFilter(val){
this.value=val
if(val){
this.optionsMetaShow=this.treeSelect.filter((item=>{
if (!!~item.label.indexOf(val) || !!~item.label.toUpperCase().indexOf(val.toUpperCase())) {
return true
}
}))
}else{
this.optionsMetaShow=this.treeSelect
}
},
confirm () {
let that = this;
that.createBnt = true;
if (that.formValidate.selectRule.trim().length <= 0) {
return this.$message({
message:'请选择属性',
type: 'error'
});
}
that.ruleList.forEach(function (item, index) {
if (item.ruleName === that.formValidate.selectRule) {
that.attrs = item.ruleValue;
}
});
},
// 删除表格中的属性
delAttrTable (index) {
this.manyFormValidate.splice(index, 1);
},
// 添加按钮
addBtn () {
this.clearAttr();
this.createBnt = false;
this.showIput = true;
},
// 立即生成
generate () {
isFormatAttr(this.formValidate.id, { attrs: this.attrs }).then(res => {
this.manyFormValidate = res.value;
let headerdel = {
title: '操作',
slot: 'action',
fixed: 'right',
width: 220
};
res.header.push(headerdel);
this.formValidate.header = res.header;
//this.formValidate.attrs = res.attr;
let header = res.header;
header.pop();
if (!this.$route.params.id && this.formValidate.spec_type === 1) {
this.manyFormValidate.map((item) => {
item.pic = this.formValidate.image
});
this.oneFormBatch[0].pic = this.formValidate.image;
}
}).catch(res => {
// this.$message({
// message:res.msg,
// type: 'error'
// });
})
},
// 取消
offAttrName () {
this.showIput = false;
this.createBnt = true;
},
clearAttr () {
this.formDynamic.attrsName = '';
this.formDynamic.attrsVal = '';
},
// 删除规格
handleRemoveRole (index) {
this.attrs.splice(index, 1);
this.manyFormValidate.splice(index, 1);
},
// 删除属性
handleRemove2 (item, index) {
item.splice(index, 1);
},
// 添加规则名称
createAttrName () {
if (this.formDynamic.attrsName && this.formDynamic.attrsVal) {
let data = {
value: this.formDynamic.attrsName,
detail: [
this.formDynamic.attrsVal
]
};
this.attrs.push(data);
var hash = {};
this.attrs = this.attrs.reduce(function (item, next) {
hash[next.value] ? '' : hash[next.value] = true && item.push(next);
return item
}, [])
this.clearAttr();
this.showIput = false;
this.createBnt = true;
} else {
this.$message.warning('请添加完整的规格!');
}
},
// 添加属性
createAttr (num, idx) {
if (num) {
this.attrs[idx].detail.push(num);
var hash = {};
this.attrs[idx].detail = this.attrs[idx].detail.reduce(function (item, next) {
hash[next] ? '' : hash[next] = true && item.push(next);
return item
}, [])
} else {
this.$message.warning('请添加属性!');
}
},
// 改变规格
changeSpec () {
},
// 详情
getInfo () {
let that = this;
let id = that.$route.params.id || 0;
getInfo(id).then(async res => {
let data = res.productInfo;
console.log('data:'+data)
if(data){
let cate_id = parseInt(data.cate_id) || 0;
this.attrs = data.items || [];
that.formValidate = data;
that.formValidate.cate_id = cate_id;
that.oneFormValidate = [data.attr];
that.formValidate.header = [];
that.generate();
that.manyFormValidate = data.attrs;
if(data.spec_type === 0){
that.manyFormValidate = [];
}else {
that.createBnt = true;
that.oneFormValidate = [
{
pic: '',
price: 0,
cost: 0,
ot_price: 0,
stock: 0,
seckill_stock: 0,
seckill_price: 0,
pink_stock: 0,
pink_price: 0,
bar_code: '',
weight:0,
volume:0,
brokerage:0,
brokerage_two:0,
integral:0
}
]
}
}
that.treeSelect = res.cateList;
that.ruleList = res.ruleList;
that.templateList = res.tempList;
that.optionsMetaShow = that.treeSelect
}).catch(res => {
console.log('err:'+res)
return this.$message({
message:res.msg,
type: 'error'
});
})
},
// 提交
handleSubmit (name) {
this.$refs[name].validate((valid) => {
if (valid) {
if(this.formValidate.spec_type ===0 ){
this.formValidate.attrs = this.oneFormValidate;
this.formValidate.header = [];
this.formValidate.items = [];
}else{
this.formValidate.items = this.attrs;
this.formValidate.attrs = this.manyFormValidate;
}
if(this.formValidate.spec_type === 1 && this.manyFormValidate.length===0){
return this.$message.warning('请点击生成规格!');
}
add(this.formValidate).then(async res => {
this.$message({
message:'操作成功',
type: 'success'
});
setTimeout(() => {
this.$router.push({ path: '/shop/goods' });
}, 500);
}).catch(res => {
// this.$message({
// message:res.message,
// type: 'error'
// });
})
} else {
if(!this.formValidate.store_name || !this.formValidate.cate_id || !this.formValidate.keyword
|| !this.formValidate.unit_name || !this.formValidate.store_info
|| !this.formValidate.image || !this.formValidate.slider_image){
this.$message.warning("请填写完整商品信息!");
}
}
})
},
// 表单验证
validate (prop, status, error) {
if (status === false) {
this.$message.warning(error);
}
},
addCustomDialog () {
window.UE.registerUI('yshop', function (editor, uiName) {
let dialog = new window.UE.ui.Dialog({
iframeUrl: '/yshop/materia/index',
editor: editor,
name: uiName,
title: '上传图片',
cssRules: 'width:1200px;height:500px;padding:20px;'
});
this.dialog = dialog;
var btn = new window.UE.ui.Button({
name: 'dialog-button',
title: '上传图片',
cssRules: `background-image: url(../../../assets/images/icons.png);background-position: -726px -77px;`,
onclick: function () {
dialog.render();
dialog.open();
}
});
return btn;
}, 37);
},
cancel() {
this.resetForm()
}
}
}
</script>
<style scoped lang="stylus">
.submission
margin-left 10px;
.color-list .tip{
color: #c9c9c9;
}
.color-list .color-item{
height: 30px;
line-height: 30px;
padding: 0 10px;
color:#fff;
margin-right :10px;
}
.color-list .color-item.blue{
background-color: #1E9FFF;
}
.color-list .color-item.yellow{
background-color: rgb(254, 185, 0);
}
.color-list .color-item.green{
background-color: #009688;
}
.columnsBox
margin-right 10px
.priceBox
width 100%
.rulesBox
display flex
flex-wrap: wrap;
.curs
cursor pointer
</style>
+301
View File
@@ -0,0 +1,301 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-select v-model="query.type" clearable placeholder="搜索类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<el-select v-model="cateId" clearable placeholder="商品分类" class="filter-item" filterable :filter-method="dataFilter" style="width: 130px">
<el-option v-for="item in optionsMetaShow" :disabled="item.disabled === 0"
:value="item.value"
:key="item.id"
:label="item.label"></el-option>
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="toAddURL"
>
新增
</el-button>
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
</div>
<!--表单组件-->
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="商品id" />
<el-table-column ref="table" prop="image" label="商品图片">
<template slot-scope="scope">
<a :href="scope.row.image" style="color: #42b983" target="_blank"><img :src="scope.row.image" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column prop="storeName" label="商品名称" />
<el-table-column prop="storeCategory.cateName" label="分类名称" />
<el-table-column prop="price" label="商品价格" />
<el-table-column prop="sales" label="销量" />
<el-table-column prop="stock" label="库存" />
<el-table-column label="商品类型" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.isIntegral === 1" style="cursor: pointer" :type="'warning'">积分商品</el-tag>
<el-tag v-else style="cursor: pointer" :type=" 'info' ">普通商品</el-tag>
</template>
</el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<div @click="onSale(scope.row.id,scope.row.isShow)">
<el-tag v-if="scope.row.isShow === 1" style="cursor: pointer" :type="''">已上架</el-tag>
<el-tag v-else style="cursor: pointer" :type=" 'info' ">已下架</el-tag>
</div>
</template>
</el-table-column>
<el-table-column label="操作" width="265px" align="center">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
icon="el-icon-edit"
@click="toUpdateURL(scope.row.id)"
>
编辑
</el-button>
<el-popover
:ref="scope.row.id"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini">删除</el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del, onsale } from '@/api/bxg/yxStoreProduct'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import Treeselect from '@riophae/vue-treeselect'
export default {
components: { Treeselect },
mixins: [initData],
data() {
return {
dropDownValue: '',
optionsMetaShow: [],
delLoading: false,
visible: false,
queryTypeOptions: [
{ key: 'storeName', display_name: '商品名称' }
],
isAttr: false,
cateId: null,
}
},
created() {
this.$nextTick(() => {
this.init().then(() =>{
this.optionsMetaShow = this.cateList
})
})
},
methods: {
toAddURL(){
this.$router.push({ path: '/shop/goodsAdd' })
},
toUpdateURL(id){
this.$router.push({ path: '/shop/goodsEdit/'+id })
},
dataFilter(val){
this.value=val
if(val){
this.optionsMetaShow=this.cateList.filter((item=>{
if (!!~item.label.indexOf(val) || !!~item.label.toUpperCase().indexOf(val.toUpperCase())) {
return true
}
}))
}else{
this.optionsMetaShow=this.cateList
}
},
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxStoreProduct'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort, isShow: 1, isDel: 0,cateId: this.cateId }
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
onSale(id, status) {
this.$confirm(`确定进行[${status ? '下架' : '上架'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
onsale(id, { status: status }).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1000,
onClose: () => {
this.init()
}
})
})
})
.catch(() => { })
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
this.$refs.form.getCates()
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.getCates()
_this.form = {
id: data.id,
merId: data.merId,
image: data.image,
sliderImage: data.sliderImage,
imageArr: data.image.split(','),
sliderImageArr: data.sliderImage.split(','),
storeName: data.storeName,
storeInfo: data.storeInfo,
keyword: data.keyword,
barCode: data.barCode,
storeCategory: data.storeCategory || {id:null},
price: data.price,
vipPrice: data.vipPrice,
otPrice: data.otPrice,
postage: data.postage,
unitName: data.unitName,
sort: data.sort,
sales: data.sales,
stock: data.stock,
isShow: data.isShow,
isHot: data.isHot,
isBenefit: data.isBenefit,
isBest: data.isBest,
isNew: data.isNew,
description: data.description,
addTime: data.addTime,
isPostage: data.isPostage,
isDel: data.isDel,
merUse: data.merUse,
giveIntegral: data.giveIntegral,
cost: data.cost,
isSeckill: data.isSeckill,
isBargain: data.isBargain,
isGood: data.isGood,
ficti: data.ficti,
browse: data.browse,
codePath: data.codePath,
soureLink: data.soureLink
}
_this.dialog = true
},
attr(data) {
console.log(3333)
this.isAttr = false
const _this = this.$refs.form2
_this.form = {
id: data.id,
merId: data.merId,
image: data.image,
sliderImage: data.sliderImage,
storeName: data.storeName,
storeInfo: data.storeInfo,
keyword: data.keyword,
barCode: data.barCode,
storeCategory: data.storeCategory,
price: data.price,
vipPrice: data.vipPrice,
otPrice: data.otPrice,
postage: data.postage,
unitName: data.unitName,
sort: data.sort,
sales: data.sales,
stock: data.stock,
isShow: data.isShow,
isHot: data.isHot,
isBenefit: data.isBenefit,
isBest: data.isBest,
isNew: data.isNew,
description: data.description,
addTime: data.addTime,
isPostage: data.isPostage,
isDel: data.isDel,
merUse: data.merUse,
giveIntegral: data.giveIntegral,
cost: data.cost,
isSeckill: data.isSeckill,
isBargain: data.isBargain,
isGood: data.isGood,
ficti: data.ficti,
browse: data.browse,
codePath: data.codePath,
soureLink: data.soureLink
}
_this.dialog = true
this.$refs.form2.getAttrs(data.id)
}
}
}
</script>
<style scoped>
</style>
+213
View File
@@ -0,0 +1,213 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<el-select v-model="cateId" clearable placeholder="商品分类" class="filter-item" style="width: 130px">
<el-option v-for="item in cateList" :disabled="item.disabled === 0"
:value="item.value"
:key="item.id"
:label="item.label"></el-option>
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
<!--表单组件-->
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="商品id" />
<el-table-column ref="table" prop="image" label="商品图片">
<template slot-scope="scope">
<a :href="scope.row.image" style="color: #42b983" target="_blank"><img :src="scope.row.image" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column prop="storeName" label="商品名称" />
<el-table-column prop="storeCategory.cateName" label="分类名称" />
<el-table-column prop="price" label="商品价格" />
<el-table-column prop="sales" label="销量" />
<el-table-column prop="stock" label="库存" />
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<div @click="onSale(scope.row.id,scope.row.isShow)">
<el-tag v-if="scope.row.isShow === 1" style="cursor: pointer" :type="''">已上架</el-tag>
<el-tag v-else style="cursor: pointer" :type=" 'info' ">已下架</el-tag>
</div>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_EDIT','YXSTOREPRODUCT_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['admin','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_EDIT']" size="mini" type="primary" icon="el-icon-edit">
<router-link :to="'/shop/goodsEdit/'+scope.row.id">
编辑
</router-link>
</el-button>
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del, onsale } from '@/api/bxg/yxStoreProduct'
import eForm from './form'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false,
visible: false,
cateId: null,
queryTypeOptions: [
{ key: 'storeName', display_name: '商品名称' }
]
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxStoreProduct'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort, isShow: 0, isDel: 0,cateId: this.cateId }
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
onSale(id, status) {
this.$confirm(`确定进行[${status ? '下架' : '上架'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
onsale(id, { status: status }).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1000,
onClose: () => {
this.init()
}
})
})
})
.catch(() => { })
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
this.$refs.form.getCates()
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.getCates()
_this.form = {
id: data.id,
merId: data.merId,
image: data.image,
sliderImage: data.sliderImage,
imageArr: data.image.split(','),
sliderImageArr: data.sliderImage.split(','),
storeName: data.storeName,
storeInfo: data.storeInfo,
keyword: data.keyword,
barCode: data.barCode,
storeCategory: data.storeCategory || {id:null},
price: data.price,
vipPrice: data.vipPrice,
otPrice: data.otPrice,
postage: data.postage,
unitName: data.unitName,
sort: data.sort,
sales: data.sales,
stock: data.stock,
isShow: data.isShow,
isHot: data.isHot,
isBenefit: data.isBenefit,
isBest: data.isBest,
isNew: data.isNew,
description: data.description,
addTime: data.addTime,
isPostage: data.isPostage,
isDel: data.isDel,
merUse: data.merUse,
giveIntegral: data.giveIntegral,
cost: data.cost,
isSeckill: data.isSeckill,
isBargain: data.isBargain,
isGood: data.isGood,
ficti: data.ficti,
browse: data.browse,
codePath: data.codePath,
soureLink: data.soureLink
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+195
View File
@@ -0,0 +1,195 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="商品id" />
<el-table-column ref="table" prop="image" label="商品图片">
<template slot-scope="scope">
<a :href="scope.row.image" style="color: #42b983" target="_blank"><img :src="scope.row.image" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column prop="storeName" label="商品名称" />
<el-table-column prop="storeCategory.cateName" label="分类名称" />
<el-table-column prop="price" label="商品价格" />
<el-table-column prop="sales" label="销量" />
<el-table-column prop="stock" label="库存" />
<el-table-column v-if="checkPermission(['admin','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_EDIT','YXSTOREPRODUCT_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['admin','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSTOREPRODUCT_ALL','YXSTOREPRODUCT_DELETE']"
placement="top"
width="180"
>
<p>确定恢复本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini">恢复</el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { recovery, onsale } from '@/api/bxg/yxStoreProduct'
import eForm from './form'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false,
visible: false,
queryTypeOptions: [
{ key: 'storeName', display_name: '商品名称' }
]
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxStoreProduct'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort, isDel: 1 }
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
},
subDelete(id) {
this.delLoading = true
recovery(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '恢复成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
onSale(id, status) {
this.$confirm(`确定进行[${status ? '下架' : '上架'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
onsale(id, { status: status }).then(({ data }) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1000,
onClose: () => {
this.init()
}
})
})
})
.catch(() => { })
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
this.$refs.form.getCates()
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.getCates()
_this.form = {
id: data.id,
merId: data.merId,
image: data.image,
sliderImage: data.sliderImage,
imageArr: data.image.split(','),
sliderImageArr: data.sliderImage.split(','),
storeName: data.storeName,
storeInfo: data.storeInfo,
keyword: data.keyword,
barCode: data.barCode,
storeCategory: data.storeCategory || {id:null},
price: data.price,
vipPrice: data.vipPrice,
otPrice: data.otPrice,
postage: data.postage,
unitName: data.unitName,
sort: data.sort,
sales: data.sales,
stock: data.stock,
isShow: data.isShow,
isHot: data.isHot,
isBenefit: data.isBenefit,
isBest: data.isBest,
isNew: data.isNew,
description: data.description,
addTime: data.addTime,
isPostage: data.isPostage,
isDel: data.isDel,
merUse: data.merUse,
giveIntegral: data.giveIntegral,
cost: data.cost,
isSeckill: data.isSeckill,
isBargain: data.isBargain,
isGood: data.isGood,
ficti: data.ficti,
browse: data.browse,
codePath: data.codePath,
soureLink: data.soureLink
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+37
View File
@@ -0,0 +1,37 @@
<template>
<el-tabs v-model="activeName" style="padding-left: 8px;" @tab-click="tabClick">
<el-tab-pane label="出售中产品" name="first">
<onSale ref="onSale" />
</el-tab-pane>
<el-tab-pane label="待上架产品" name="second">
<unonSale ref="unonSale" />
</el-tab-pane>
</el-tabs>
</template>
<script>
import onSale from '@/views/bxg/shop/goods/index'
import unonSale from '@/views/bxg/shop/goods/index2'
import '@/assets/styles/description.scss'
export default {
name: 'Tab',
components: { onSale, unonSale },
data() {
return {
activeName: 'first'
}
},
methods: {
tabClick(name) {
if (this.activeName === 'first') {
this.$refs.onSale.init()
} else if (this.activeName === 'second') {
this.$refs.unonSale.init()
}
}
}
}
</script>
<style scoped>
</style>
File diff suppressed because it is too large Load Diff
+332
View File
@@ -0,0 +1,332 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '订单详情'" width="700px">
<el-card>
<div slot="header">
<span>进度信息</span>
</div>
<el-steps
v-if="form.refundStatus===0"
:active="orderStatus.size"
align-center
process-status="process"
finish-status="success"
>
<el-step title="用户下单" :description="orderStatus.cacheKeyCreateOrder"></el-step>
<el-step title="待核销" :description="orderStatus.paySuccess"></el-step>
<el-step title="待评价" :description="orderStatus.orderVerific"></el-step>
<el-step title="已完成" :description="orderStatus.checkOrderOver"></el-step>
</el-steps>
<el-steps v-else :active="form.refundStatus+1" align-center process-status="process" finish-status="success">
<el-step title="用户下单" :description="orderStatus.cacheKeyCreateOrder"></el-step>
<el-step title="用户申请退款" :description="orderStatus.applyRefund"></el-step>
<el-step title="退款申请通过" :description="orderStatus.refundOrderSuccess"></el-step>
</el-steps>
</el-card>
<el-card>
<div slot="header">
<span>收货信息</span>
</div>
<div class="text item">用户昵称:{{ form.nickname }}</div>
<div class="text item">收货人: {{ form.realName }}</div>
<div class="text item">联系电话: {{ form.userPhone }}</div>
<div class="text item">收货地址: {{ form.userAddress }}</div>
</el-card>
<el-card>
<div slot="header">
<span>订单信息</span>
</div>
<el-row :gutter="24">
<el-col :span="12">
<div class="text item">订单编号: {{ form.orderId }}</div>
<div class="text item">商品总数: {{ form.totalNum }}</div>
<div class="text item">支付邮费: {{ form.totalPostage }}</div>
<div class="text item">实际支付: {{ form.payPrice }}</div>
<div class="text item">支付方式: {{ form.payTypeName }}</div>
</el-col>
<el-col :span="12">
<div class="text item">订单状态: <span v-html="form.statusName"></span></div>
<div class="text item">商品总价: {{ form.totalPrice }}</div>
<div class="text item">优惠券金额: {{ form.couponPrice }}</div>
<div class="text item">创建时间: {{ parseTime(form.createTime) }}</div>
<div class="text item">支付时间: {{ parseTime(form.payTime) }}</div>
</el-col>
</el-row>
</el-card>
<el-card v-if="form.storeId == 0">
<div slot="header">
<span>物流信息</span>
</div>
<div class="text item">快递公司:{{ form.deliveryName }}</div>
<div class="text item">快递单号:{{ form.deliveryId }}</div>
<div><el-button :loading="loading" type="primary" @click="express">查看物流</el-button></div>
<div style="margin-top: 20px">
<el-timeline v-if="form.deliveryId && expressInfo.length > 0">
<el-timeline-item
v-for="(obj, index) in expressInfo"
:key="index"
:timestamp="obj.acceptTime"
>
{{obj.acceptStation}}
</el-timeline-item>
</el-timeline>
<el-timeline :reverse="false" v-else>
<el-timeline-item>
暂无物流信息
</el-timeline-item>
</el-timeline>
</div>
</el-card>
<el-card>
<div slot="header">
<span>备注信息</span>
</div>
<div class="text item">{{ form.remark }}</div>
</el-card>
</el-dialog>
</template>
<script>
import { add, edit, express,
getNowOrderStatus } from '@/api/bxg/yxStoreOrder'
import {formatTimeTwo, parseTime} from '@/utils/index'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
orderStatus:null,
loading: false, dialog: false, expressInfo: [],
form: {
id: '',
orderId: '',
uid: '',
realName: '',
userPhone: '',
userAddress: '',
cartId: '',
freightPrice: '',
totalNum: '',
totalPrice: '',
totalPostage: '',
payPrice: '',
payPostage: '',
deductionPrice: '',
couponId: '',
couponPrice: '',
paid: '',
payTime: '',
payType: '',
addTime: '',
status: '',
refundStatus: '',
refundReasonWapImg: '',
refundReasonWapExplain: '',
refundReasonTime: '',
refundReasonWap: '',
refundReason: '',
refundPrice: '',
deliveryName: '',
deliverySn: '',
deliveryType: '',
deliveryId: '',
gainIntegral: '',
useIntegral: '',
backIntegral: '',
mark: '',
isDel: '',
unique: '',
remark: '',
merId: '',
isMerCheck: '',
combinationId: '',
pinkId: '',
cost: '',
seckillId: '',
bargainId: '',
verifyCode: '',
storeId: '',
shippingType: '',
isChannel: '',
isRemind: '',
isSystemDel: ''
},
rules: {
unique: [
{ required: true, message: 'please enter', trigger: 'blur' }
]
}
}
},
watch: {
'form': function(val) {
this.getNowOrderStatus();
}
},
methods: {
parseTime,
cancel() {
this.dialog = false
},
express() {
let params ={
"orderCode": this.form.id,
"shipperCode": this.form.deliverySn,
"logisticCode": this.form.deliveryId
}
express(params).then(res=>{
console.log(res)
this.expressInfo = res.Traces
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
}, formatTime(time) {
if (time == null || time === '') {
return '';
}
let date = new Date(time);
return formatTimeTwo(date, 'yyyy-MM-dd hh:mm:ss')
},
formatStepStatus(value) {
//todo 1-未付款 2-未发货 3-退款中 4-待收货 5-待评价 6-已完成 7-已退款
if (value === 2) {
//待发货
return 2;
} else if (value === 4) {
//已发货
return 3;
} else if (value === 6) {
//已完成
return 4;
}else {
//待付款、已关闭、无限订单
return 1;
}
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
orderId: '',
uid: '',
realName: '',
userPhone: '',
userAddress: '',
cartId: '',
freightPrice: '',
totalNum: '',
totalPrice: '',
totalPostage: '',
payPrice: '',
payPostage: '',
deductionPrice: '',
couponId: '',
couponPrice: '',
paid: '',
payTime: '',
payType: '',
addTime: '',
status: '',
refundStatus: '',
refundReasonWapImg: '',
refundReasonWapExplain: '',
refundReasonTime: '',
refundReasonWap: '',
refundReason: '',
refundPrice: '',
deliveryName: '',
deliveryType: '',
deliveryId: '',
gainIntegral: '',
useIntegral: '',
backIntegral: '',
mark: '',
isDel: '',
unique: '',
remark: '',
merId: '',
isMerCheck: '',
combinationId: '',
pinkId: '',
cost: '',
seckillId: '',
bargainId: '',
verifyCode: '',
storeId: '',
shippingType: '',
isChannel: '',
isRemind: '',
isSystemDel: ''
}
},
getNowOrderStatus() {
let id = this.form.id || 0;
getNowOrderStatus(id)
.then(res => {
this.orderStatus = res;
})
.catch(err => {
console.log(err.response.data.message);
});
},
}
}
</script>
<style scoped>
.text {
font-size: 12px;
}
.item {
padding: 6px 0;
}
</style>
+196
View File
@@ -0,0 +1,196 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="订单号">
<el-input v-model="form.orderId" :disabled="true" style="width: 370px;" />
</el-form-item>
<el-form-item label="原始邮费">
<el-input v-model="form.totalPostage" :disabled="true" style="width: 370px;" />
</el-form-item>
<el-form-item label="实际支付">
<el-input v-model="form.payPrice" style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, editOrder } from '@/api/bxg/yxStoreOrder'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
orderId: '',
uid: '',
realName: '',
userPhone: '',
userAddress: '',
cartId: '',
freightPrice: '',
totalNum: '',
totalPrice: '',
totalPostage: '',
payPrice: '',
payPostage: '',
deductionPrice: '',
couponId: '',
couponPrice: '',
paid: '',
payTime: '',
payType: '',
addTime: '',
status: '',
refundStatus: '',
refundReasonWapImg: '',
refundReasonWapExplain: '',
refundReasonTime: '',
refundReasonWap: '',
refundReason: '',
refundPrice: '',
deliveryName: '',
deliveryType: '',
deliveryId: '',
gainIntegral: '',
useIntegral: '',
backIntegral: '',
mark: '',
isDel: '',
unique: '',
remark: '',
merId: '',
isMerCheck: '',
combinationId: '',
pinkId: '',
cost: '',
seckillId: '',
bargainId: '',
verifyCode: '',
storeId: '',
shippingType: '',
isChannel: '',
isRemind: '',
isSystemDel: ''
},
rules: {
unique: [
{ required: true, message: 'please enter', trigger: 'blur' }
]
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
editOrder(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
orderId: '',
uid: '',
realName: '',
userPhone: '',
userAddress: '',
cartId: '',
freightPrice: '',
totalNum: '',
totalPrice: '',
totalPostage: '',
payPrice: '',
payPostage: '',
deductionPrice: '',
couponId: '',
couponPrice: '',
paid: '',
payTime: '',
payType: '',
addTime: '',
status: '',
refundStatus: '',
refundReasonWapImg: '',
refundReasonWapExplain: '',
refundReasonTime: '',
refundReasonWap: '',
refundReason: '',
refundPrice: '',
deliveryName: '',
deliveryType: '',
deliveryId: '',
gainIntegral: '',
useIntegral: '',
backIntegral: '',
mark: '',
isDel: '',
unique: '',
remark: '',
merId: '',
isMerCheck: '',
combinationId: '',
pinkId: '',
cost: '',
seckillId: '',
bargainId: '',
verifyCode: '',
storeId: '',
shippingType: '',
isChannel: '',
isRemind: '',
isSystemDel: ''
}
}
}
}
</script>
<style scoped>
</style>
+184
View File
@@ -0,0 +1,184 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '去发货'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="快递公司">
<!--<el-input v-model="form.deliveryName" style="width: 370px;"/>-->
<el-select v-model="form.deliveryName" filterable placeholder="请选择" style="width: 370px;">
<el-option
v-for="item in express"
:key="item.id"
:label="item.name"
:value="item.name"
/>
</el-select>
</el-form-item>
<el-form-item label="快递单号">
<el-input v-model="form.deliveryId" style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit, get,updateDelivery } from '@/api/bxg/yxStoreOrder'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false, express: [],
form: {
id: '',
deliveryName: '',
deliveryType: 'express',
deliveryId: ''
},
rules: {
unique: [
{ required: true, message: 'please enter', trigger: 'blur' }
]
}
}
},
created() {
this.get()
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
if(this.form._status == 4){
updateDelivery(this.form).then(res => {
this.resetForm()
this.$notify({
title: '操作成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
}else{
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '操作成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
}
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
orderId: '',
uid: '',
realName: '',
userPhone: '',
userAddress: '',
cartId: '',
freightPrice: '',
totalNum: '',
totalPrice: '',
totalPostage: '',
payPrice: '',
payPostage: '',
deductionPrice: '',
couponId: '',
couponPrice: '',
paid: '',
payTime: '',
payType: '',
addTime: '',
status: '',
refundStatus: '',
refundReasonWapImg: '',
refundReasonWapExplain: '',
refundReasonTime: '',
refundReasonWap: '',
refundReason: '',
refundPrice: '',
deliveryName: '',
deliveryType: '',
deliveryId: '',
gainIntegral: '',
useIntegral: '',
backIntegral: '',
mark: '',
isDel: '',
unique: '',
remark: '',
merId: '',
isMerCheck: '',
combinationId: '',
pinkId: '',
cost: '',
seckillId: '',
bargainId: '',
verifyCode: '',
storeId: '',
shippingType: '',
isChannel: '',
isRemind: '',
isSystemDel: ''
}
},
get() {
get().then(res => {
this.express = res.content
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
}
}
}
</script>
<style scoped>
</style>
+158
View File
@@ -0,0 +1,158 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '订单核销'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="核销码">
<el-input v-model="form.verifyCode" style="width: 370px;" placeholder="请输入核销码" />
<p style="color: red">注意:请务必核对核销码的与客户正确性</p>
<p style="color: red">注意:手机端也可以核销去会员管理里把编辑相应会员开启商户管理即可</p>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, editT, get } from '@/api/bxg/yxStoreOrder'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false, express: [],
form: {
id: '',
deliveryName: '',
deliveryType: 'express',
deliveryId: ''
},
rules: {
unique: [
{ required: true, message: 'please enter', trigger: 'blur' }
]
}
}
},
created() {
this.get()
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
editT(this.form).then(res => {
this.resetForm()
this.$notify({
title: '操作成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
orderId: '',
uid: '',
realName: '',
userPhone: '',
userAddress: '',
cartId: '',
freightPrice: '',
totalNum: '',
totalPrice: '',
totalPostage: '',
payPrice: '',
payPostage: '',
deductionPrice: '',
couponId: '',
couponPrice: '',
paid: '',
payTime: '',
payType: '',
addTime: '',
status: '',
refundStatus: '',
refundReasonWapImg: '',
refundReasonWapExplain: '',
refundReasonTime: '',
refundReasonWap: '',
refundReason: '',
refundPrice: '',
deliveryName: '',
deliveryType: '',
deliveryId: '',
gainIntegral: '',
useIntegral: '',
backIntegral: '',
mark: '',
isDel: '',
unique: '',
remark: '',
merId: '',
isMerCheck: '',
combinationId: '',
pinkId: '',
cost: '',
seckillId: '',
bargainId: '',
verifyCode: '',
storeId: '',
shippingType: '',
isChannel: '',
isRemind: '',
isSystemDel: ''
}
},
get() {
get().then(res => {
this.express = res.content
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
}
}
}
</script>
<style scoped>
</style>
+867
View File
@@ -0,0 +1,867 @@
<template>
<div class="app-container" style="position: relative; height: calc(100vh - 117px);">
<div class="container">
<el-tabs v-model="status" type="card" @tab-click="handleOrder">
<el-tab-pane name="-9">
<span slot="label"><i class="el-icon-s-order"></i> 全部订单</span>
</el-tab-pane>
<el-tab-pane name="0">
<span slot="label"><i class="el-icon-bank-card"></i> 未支付</span>
</el-tab-pane>
<el-tab-pane name="1">
<span slot="label"><i class="el-icon-refrigerator"></i> 未发货</span>
</el-tab-pane>
<el-tab-pane name="2">
<span slot="label"><i class="el-icon-truck"></i> 待收货</span>
</el-tab-pane>
<el-tab-pane name="3">
<span slot="label"><i class="el-icon-document"></i> 待评价</span>
</el-tab-pane>
<el-tab-pane name="4">
<span slot="label"><i class="el-icon-circle-check"></i> 交易完成</span>
</el-tab-pane>
<el-tab-pane name="-1">
<span slot="label"><i class="el-icon-back"></i> 退款中</span>
</el-tab-pane>
<el-tab-pane name="-2">
<span slot="label"><i class="el-icon-finished"></i> 已退款</span>
</el-tab-pane>
</el-tabs>
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<el-select v-model="orderType" clearable placeholder="订单类型" class="filter-item" style="width: 130px">
<el-option
v-for="item in typeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-date-picker
v-model="createTime"
:default-time="['00:00:00','23:59:59']"
type="daterange"
range-separator=":"
size="small"
class="date-item"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 新增 -->
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<eDetail ref="form1" :is-add="isAdd" />
<eRefund ref="form2" :is-add="isAdd" />
<editOrder ref="form3" :is-add="isAdd" />
<eRemark ref="form4" :is-add="isAdd" />
<ePrint ref="form5" :is-add="isAdd" :print-list="checkList" :to-query="toQuery"/>
<!--订单数据统计-->
<div class="order-caculate">
<a class="caculate-title">订单数 : <span class="caculate-num">{{caculateInfo.orderNum}}</span></a>
<a class="caculate-title">商品数 : <span class="caculate-num">{{caculateInfo.storeNum}}</span></a>
<a class="caculate-title">订单金额 : <span class="caculate-num">{{caculateInfo.orderPrice}}</span></a>
<a class="caculate-title">客户数 : <span class="caculate-num">{{caculateInfo.userNum}}</span></a>
</div>
<!--表格渲染-->
<el-table ref="multipleTable" v-loading="loading" :data="data" size="small" style="width: 100%;" @selection-change="handleSelectionChange">
<el-table-column :selectable="checkboxT" type="selection" width="50" />
<el-table-column prop="orderId" width="140" label="订单号">
<template slot-scope="scope">
<span>{{ scope.row.orderId }}</span>
<p>{{ scope.row.pinkName }}</p>
</template>
</el-table-column>
<el-table-column prop="realName" label="用户昵称" >
<template slot-scope="scope">
<span>{{ scope.row.userDTO.nickname }}</span>
</template>
</el-table-column>
<el-table-column prop="cartInfoList" width="300" label="商品信息">
<template slot-scope="scope">
<!-- <div v-for="(item,index) in scope.row.cartInfoList"
:key="index"
v-if="item.cartInfoMap.productInfo.attrInfo">
<span>
<img style="width: 30px;height: 30px;margin:0;cursor: pointer;"
:src="item.cartInfoMap.productInfo.attrInfo.image"
>
</span>
<span>{{ item.cartInfoMap.productInfo.storeName }}&nbsp;{{ item.cartInfoMap.productInfo.attrInfo.suk }}</span>
<span> | {{ item.cartInfoMap.truePrice }}×{{ item.cartInfoMap.cartNum }}</span>
</div>
<div v-else>
<span>
<img
style="width: 30px;height: 30px;margin:0;cursor: pointer;"
:src="item.cartInfoMap.productInfo.image">
</span>
<span>{{ item.cartInfoMap.productInfo.storeName }}</span>
<span> | {{ item.cartInfoMap.truePrice }}×{{ item.cartInfoMap.cartNum }}</span>
</div> -->
<div v-for="(item,index) in scope.row.cartInfoList"
:key="index">
<span v-if="item.cartInfoMap.productInfo.attrInfo">
<img style="width: 30px;height: 30px;margin:0;cursor: pointer;"
:src="item.cartInfoMap.productInfo.attrInfo.image"
>
</span>
<span v-else>
<img
style="width: 30px;height: 30px;margin:0;cursor: pointer;"
:src="item.cartInfoMap.productInfo.image">
</span>
<span>
{{ item.cartInfoMap.productInfo.storeName }}
<span v-if="item.cartInfoMap.productInfo.attrInfo">&nbsp;{{ item.cartInfoMap.productInfo.attrInfo.sku }}</span>
</span>
<span> | {{ item.cartInfoMap.truePrice }}×{{ item.cartInfoMap.cartNum }}</span>
</div>
</template>
</el-table-column>
<el-table-column prop="payPrice" label="实际支付" />
<el-table-column prop="payIntegral" label="消费积分" />
<el-table-column prop="payTypeName" label="支付状态" />
<el-table-column prop="statusName" label="订单状态">
<template slot-scope="scope">
<span v-html="scope.row.statusName"></span>
</template>
</el-table-column>
<el-table-column prop="addTime" width="160" label="创建时间">
<template slot-scope="scope">
<span>{{ formatTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT','YXSTOREORDER_DELETE'])" label="操作" width="200" align="center" fixed="right">
<template slot-scope="scope">
<el-button
v-permission="['admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT']"
size="mini"
type="primary"
@click="toDetailURL(scope.row.id)"
>
订单详情</el-button>
<el-dropdown size="mini" split-button type="primary" trigger="click">
操作
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>
<el-button
v-permission="['admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT']"
size="mini"
type="success"
@click="remark(scope.row)"
>
订单备注</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-button
v-if="scope.row._status == 2"
v-permission="['admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT']"
size="mini"
type="primary"
@click="edit(scope.row)"
>
去发货</el-button>
<el-button
v-if="scope.row._status == 4"
v-permission="['admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT']"
size="mini"
type="primary"
@click="edit(scope.row)"
>
修改快递</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-button
v-if="scope.row._status == 3"
v-permission="['admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT']"
size="mini"
type="primary"
@click="refund(scope.row)"
>
立刻退款</el-button>
</el-dropdown-item>
<el-dropdown-item v-if="scope.row._status == 1">
<el-button
v-permission="['admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT']"
size="mini"
type="primary"
@click="editOrder(scope.row)"
>
修改订单</el-button>
</el-dropdown-item>
<el-dropdown-item v-if="scope.row._status == 1">
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSTOREORDER_ALL','YXSTOREORDER_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini">删除</el-button>
</el-popover>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</div>
<!--添加订单打印及订单导出功能 2020.04.13 changxh-->
<el-footer class="footer-contains">
<div class="footer-search">
<el-checkbox v-model="printChecked" @change="batchSelection" style="margin-right: 20px;"></el-checkbox>
<el-select v-model="batchHandle" @change="handlePrintOption" clearable placeholder="批量操作" class="filter-item" style="width: 130px; margin-right: 8px;">
<el-option
v-for="item in handleOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-select v-model="batchExport" @change="handleExportOption" clearable placeholder="批量导出" class="filter-item" style="width: 130px">
<el-option
v-for="item in exportOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange" />
</el-footer>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxStoreOrder'
import eForm from './form'
import eDetail from './detail1'
import eRefund from './refund'
import editOrder from './edit'
import eRemark from './remark'
import ePrint from './print'
import { formatTime } from '@/utils/index'
import { gett } from '@/api/bxg/visits'
export default {
components: { eForm, eDetail, eRefund, editOrder, eRemark, ePrint },
mixins: [initData],
data() {
return {
delLoading: false,
status: '-9',
orderType: '0',
createTime: '',
checkList: [],
printChecked: false,
batchHandle: '',
batchExport: '',
listContent: [],
queryTypeOptions: [
{ key: 'orderId', display_name: '订单号' },
{ key: 'realName', display_name: '用户姓名' },
{ key: 'userPhone', display_name: '用户电话' }
],
statusOptions: [
{ value: '0', label: '未支付' },
{ value: '1', label: '未发货' },
{ value: '2', label: '待收货' },
{ value: '3', label: '待评价' },
{ value: '4', label: '交易完成' },
// { value: '5', label: '待核销' },
{ value: '-1', label: '退款中' },
{ value: '-2', label: '已退款' },
{ value: '-4', label: '已删除' }
],
typeOptions: [
{ value: '0', label: '所有订单' },
{ value: '1', label: '普通订单' },
{ value: '2', label: '拼团订单' },
{ value: '3', label: '秒杀订单' },
{ value: '4', label: '砍价订单' },
{ value: '5', label: '核销订单' },
{ value: '6', label: '积分订单' }
],
handleOptions: [
{value: '', label: '批量操作'},
{value: '0', label: '批量打印'},
],
exportOptions: [
{value: '', label: '批量导出'},
{value: '0', label: '导出全部'},
{value: '1', label: '导出选中'},
],
caculateInfo: {
orderNum : 0,
storeNum : 0,
orderPrice : 0,
userNum : 0,
},
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
toDetailURL(id){
this.$router.push({ path: '/order/detail/'+id })
},
formatTime,
checkPermission,
handleOrder(tab, event) {
this.status = tab.name
this.toQuery()
},
beforeInit() {
this.url = 'bxg/api/yxStoreOrder'
const sort = 'id,desc'
this.params = {
page: this.page,
size: this.size,
sort: sort,
orderStatus: this.status,
orderType: this.orderType,
createTime: this.createTime,
listContent: this.listContent
}
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
orderId: data.orderId,
uid: data.uid,
realName: data.realName,
userPhone: data.userPhone,
userAddress: data.userAddress,
cartId: data.cartId,
freightPrice: data.freightPrice,
totalNum: data.totalNum,
totalPrice: data.totalPrice,
totalPostage: data.totalPostage,
payPrice: data.payPrice,
payPostage: data.payPostage,
deductionPrice: data.deductionPrice,
couponId: data.couponId,
couponPrice: data.couponPrice,
paid: data.paid,
payTime: data.payTime,
payType: data.payType,
addTime: data.addTime,
status: data.status,
refundStatus: data.refundStatus,
refundReasonWapImg: data.refundReasonWapImg,
refundReasonWapExplain: data.refundReasonWapExplain,
refundReasonTime: data.refundReasonTime,
refundReasonWap: data.refundReasonWap,
refundReason: data.refundReason,
refundPrice: data.refundPrice,
deliveryName: data.deliveryName,
deliverySn: data.deliverySn,
deliveryType: data.deliveryType,
deliveryId: data.deliveryId,
gainIntegral: data.gainIntegral,
useIntegral: data.useIntegral,
backIntegral: data.backIntegral,
mark: data.mark,
isDel: data.isDel,
unique: data.unique,
remark: data.remark,
merId: data.merId,
isMerCheck: data.isMerCheck,
combinationId: data.combinationId,
pinkId: data.pinkId,
cost: data.cost,
seckillId: data.seckillId,
bargainId: data.bargainId,
verifyCode: data.verifyCode,
storeId: data.storeId,
shippingType: data.shippingType,
isChannel: data.isChannel,
isRemind: data.isRemind,
isSystemDel: data.isSystemDel,
_status:data._status
}
_this.dialog = true
},
editOrder(data) {
this.isAdd = false
const _this = this.$refs.form3
_this.form = {
id: data.id,
orderId: data.orderId,
uid: data.uid,
realName: data.realName,
userPhone: data.userPhone,
userAddress: data.userAddress,
cartId: data.cartId,
freightPrice: data.freightPrice,
totalNum: data.totalNum,
totalPrice: data.totalPrice,
totalPostage: data.totalPostage,
payPrice: data.payPrice,
payPostage: data.payPostage,
deductionPrice: data.deductionPrice,
couponId: data.couponId,
couponPrice: data.couponPrice,
paid: data.paid,
payTime: data.payTime,
payType: data.payType,
addTime: data.addTime,
status: data.status,
refundStatus: data.refundStatus,
refundReasonWapImg: data.refundReasonWapImg,
refundReasonWapExplain: data.refundReasonWapExplain,
refundReasonTime: data.refundReasonTime,
refundReasonWap: data.refundReasonWap,
refundReason: data.refundReason,
refundPrice: data.refundPrice,
deliveryName: data.deliveryName,
deliveryType: data.deliveryType,
deliveryId: data.deliveryId,
gainIntegral: data.gainIntegral,
useIntegral: data.useIntegral,
backIntegral: data.backIntegral,
mark: data.mark,
isDel: data.isDel,
unique: data.unique,
remark: data.remark,
merId: data.merId,
isMerCheck: data.isMerCheck,
combinationId: data.combinationId,
pinkId: data.pinkId,
cost: data.cost,
seckillId: data.seckillId,
bargainId: data.bargainId,
verifyCode: data.verifyCode,
storeId: data.storeId,
shippingType: data.shippingType,
isChannel: data.isChannel,
isRemind: data.isRemind,
isSystemDel: data.isSystemDel
}
_this.dialog = true
},
remark(data) {
this.isAdd = false
const _this = this.$refs.form4
_this.form = {
id: data.id,
orderId: data.orderId,
uid: data.uid,
realName: data.realName,
userPhone: data.userPhone,
userAddress: data.userAddress,
cartId: data.cartId,
freightPrice: data.freightPrice,
totalNum: data.totalNum,
totalPrice: data.totalPrice,
totalPostage: data.totalPostage,
payPrice: data.payPrice,
payPostage: data.payPostage,
deductionPrice: data.deductionPrice,
couponId: data.couponId,
couponPrice: data.couponPrice,
paid: data.paid,
payTime: data.payTime,
payType: data.payType,
addTime: data.addTime,
status: data.status,
refundStatus: data.refundStatus,
refundReasonWapImg: data.refundReasonWapImg,
refundReasonWapExplain: data.refundReasonWapExplain,
refundReasonTime: data.refundReasonTime,
refundReasonWap: data.refundReasonWap,
refundReason: data.refundReason,
refundPrice: data.refundPrice,
deliveryName: data.deliveryName,
deliveryType: data.deliveryType,
deliveryId: data.deliveryId,
gainIntegral: data.gainIntegral,
useIntegral: data.useIntegral,
backIntegral: data.backIntegral,
mark: data.mark,
isDel: data.isDel,
unique: data.unique,
remark: data.remark,
merId: data.merId,
isMerCheck: data.isMerCheck,
combinationId: data.combinationId,
pinkId: data.pinkId,
cost: data.cost,
seckillId: data.seckillId,
bargainId: data.bargainId,
verifyCode: data.verifyCode,
storeId: data.storeId,
shippingType: data.shippingType,
isChannel: data.isChannel,
isRemind: data.isRemind,
isSystemDel: data.isSystemDel
}
_this.dialog = true
},
refund(data) {
this.isAdd = false
const _this = this.$refs.form2
_this.form = {
id: data.id,
orderId: data.orderId,
uid: data.uid,
realName: data.realName,
userPhone: data.userPhone,
userAddress: data.userAddress,
cartId: data.cartId,
freightPrice: data.freightPrice,
totalNum: data.totalNum,
totalPrice: data.totalPrice,
totalPostage: data.totalPostage,
payPrice: data.payPrice,
payPostage: data.payPostage,
deductionPrice: data.deductionPrice,
couponId: data.couponId,
couponPrice: data.couponPrice,
paid: data.paid,
payTime: data.payTime,
payType: data.payType,
addTime: data.addTime,
status: data.status,
refundStatus: data.refundStatus,
refundReasonWapImg: data.refundReasonWapImg,
refundReasonWapExplain: data.refundReasonWapExplain,
refundReasonTime: data.refundReasonTime,
refundReasonWap: data.refundReasonWap,
refundReason: data.refundReason,
refundPrice: data.refundPrice,
deliveryName: data.deliveryName,
deliveryType: data.deliveryType,
deliveryId: data.deliveryId,
gainIntegral: data.gainIntegral,
useIntegral: data.useIntegral,
backIntegral: data.backIntegral,
mark: data.mark,
isDel: data.isDel,
unique: data.unique,
remark: data.remark,
merId: data.merId,
isMerCheck: data.isMerCheck,
combinationId: data.combinationId,
pinkId: data.pinkId,
cost: data.cost,
seckillId: data.seckillId,
bargainId: data.bargainId,
verifyCode: data.verifyCode,
storeId: data.storeId,
shippingType: data.shippingType,
isChannel: data.isChannel,
isRemind: data.isRemind,
isSystemDel: data.isSystemDel
}
_this.dialog = true
},
detail(data) {
this.isAdd = false
const _this = this.$refs.form1
_this.form = {
id: data.id,
orderId: data.orderId,
payTypeName: data.payTypeName,
statusName: data.statusName,
uid: data.uid,
realName: data.realName,
userPhone: data.userPhone,
userAddress: data.userAddress,
cartId: data.cartId,
freightPrice: data.freightPrice,
totalNum: data.totalNum,
totalPrice: data.totalPrice,
totalPostage: data.totalPostage,
payPrice: data.payPrice,
payPostage: data.payPostage,
deductionPrice: data.deductionPrice,
couponId: data.couponId,
couponPrice: data.couponPrice,
paid: data.paid,
payTime: data.payTime,
payType: data.payType,
createTime: data.createTime,
status: data.status,
refundStatus: data.refundStatus,
refundReasonWapImg: data.refundReasonWapImg,
refundReasonWapExplain: data.refundReasonWapExplain,
refundReasonTime: data.refundReasonTime,
refundReasonWap: data.refundReasonWap,
refundReason: data.refundReason,
refundPrice: data.refundPrice,
deliveryName: data.deliveryName,
deliverySn: data.deliverySn,
deliveryType: data.deliveryType,
deliveryId: data.deliveryId,
gainIntegral: data.gainIntegral,
useIntegral: data.useIntegral,
backIntegral: data.backIntegral,
mark: data.mark,
isDel: data.isDel,
unique: data.unique,
remark: data.remark,
merId: data.merId,
isMerCheck: data.isMerCheck,
combinationId: data.combinationId,
pinkId: data.pinkId,
cost: data.cost,
seckillId: data.seckillId,
bargainId: data.bargainId,
verifyCode: data.verifyCode,
storeId: data.storeId,
shippingType: data.shippingType,
isChannel: data.isChannel,
isRemind: data.isRemind,
isSystemDel: data.isSystemDel,
nickname: data.userDTO.nickname
}
_this.dialog = true
},
getCaculateInfo(){
gett().then(res => {
this.caculateInfo = {
orderPrice : res.priceCount,
orderNum : res.orderCount,
storeNum : res.goodsCount,
userNum : res.userCount,
};
})
},
clearCaculateInfo(){
this.caculateInfo = {
orderPrice : 0,
storeNum : 0,
orderNum : 0,
userNum : 0,
};
},
handleSelectionChange(val) {
this.checkList = val;
let orderPrice = 0, storeNum = 0, orderNum = 0, userNum = 0;
if(val.length !=0 ){
this.printChecked = true;
let user = [];
val.forEach((item,index)=>{
orderNum += 1;
orderPrice += item.totalPrice;
storeNum += item.totalNum;
user.push(item.userDTO.nickname);
})
user = Array.from(new Set(user));
this.caculateInfo = {
orderPrice : orderPrice.toFixed(2),
storeNum : storeNum,
orderNum : orderNum,
userNum : user.length,
};
}else {
this.printChecked = false;
this.clearCaculateInfo();
// this.getCaculateInfo();
}
},
batchSelection(val){
let rows = this.data;
if (val) {
rows.forEach(row => {
this.$refs.multipleTable.toggleRowSelection(row);
});
} else {
this.$refs.multipleTable.clearSelection();
}
},
// 导出选中
handlePrintOption(val){
switch (val) {
case '0':
this.getPrintList();
this.batchHandle = '';
break;
default:
break;
}
},
handleExportOption(val){
let list = this.checkList;
this.page = 0;
this.size = 10000;
switch (val) {
case "0":
this.listContent = "";
this.beforeInit();
this.downloadMethod();
break;
case "1":
if(list.length == 0){
this.$message({
message: '请选择订单',
type: 'warning'
});
}else {
this.listContent = [];
list.forEach((item) => {
this.listContent.push(item.orderId);
})
this.listContent = JSON.stringify(this.listContent);
this.beforeInit();
this.downloadMethod();
}
break;
default:
break;
}
this.batchExport = "";
},
getPrintList(){
let list = this.checkList;
if(list.length == 0){
this.$message({
message: '请选择订单',
type: 'warning'
});
}else {
const _this = this.$refs.form5;
_this.dialog = true
}
},
checkboxT(row, rowIndex) {
return row.id !== 1
},
}
}
</script>
<style scoped lang="scss">
.container {
height: calc(100% - 80px);
position: absolute;
overflow: auto;
width: calc(100% - 20px);
.order-caculate {
font-size: 14px;
color: #909399;
border-top: 1px solid #f0f0f0;
padding: 20px 10px;
.caculate-title {
display: inline-block;
margin-right: 50px;
}
.caculate-num {
font-size: 20px;
color: #ff4949;
}
}
.el-table th {
background-color: #fafafa;
}
}
.footer-contains {
position: absolute;
display: -ms-flexbox;
display: flex;
background-color: #f6f6f6;
bottom: 0;
align-items: center;
justify-content: space-between;
width: 100%;
z-index: 999;
padding: 0 20px 0 13px;
}
/*打印单样式编辑*/
.order-list {
/* height: 297mm;*/
margin: 0 auto;
width: 210mm;
.order-title {
height: 16mm;
line-height: 16mm;
font-size: 8mm;
font-weight: bolder;
text-align: center;
}
.order-info {
span {
display: inline-block;
padding: 0 0 10px 0;
font-size: 3mm;
}
span.info {
width: 60mm;
}
}
.el-table--small th, .el-table--small td {
padding: 4px 0;
}
}
</style>
+565
View File
@@ -0,0 +1,565 @@
<template>
<div class="app-container">
<el-tabs v-model="status" type="card" @tab-click="handleOrder">
<el-tab-pane name="-9">
<span slot="label"><i class="el-icon-s-order"></i> 全部订单</span>
</el-tab-pane>
<el-tab-pane name="0">
<span slot="label"><i class="el-icon-bank-card"></i> 未支付</span>
</el-tab-pane>
<el-tab-pane name="1">
<span slot="label"><i class="el-icon-refrigerator"></i> 待核销</span>
</el-tab-pane>
<el-tab-pane name="3">
<span slot="label"><i class="el-icon-document"></i> 待评价</span>
</el-tab-pane>
<el-tab-pane name="4">
<span slot="label"><i class="el-icon-circle-check"></i> 交易完成</span>
</el-tab-pane>
<el-tab-pane name="-1">
<span slot="label"><i class="el-icon-back"></i> 退款中</span>
</el-tab-pane>
<el-tab-pane name="-2">
<span slot="label"><i class="el-icon-finished"></i> 已退款</span>
</el-tab-pane>
</el-tabs>
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<el-select v-model="storeId" clearable placeholder="选择门店" class="filter-item" style="width: 130px">
<el-option v-for="item in storeList" :key="item.key" :label="item.name" :value="item.id" />
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
<!-- 新增 -->
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<eDetail ref="form1" :is-add="isAdd" />
<eRefund ref="form2" :is-add="isAdd" />
<editOrder ref="form3" :is-add="isAdd" />
<eRemark ref="form4" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="storeName" label="所属门店" />
<el-table-column prop="orderId" width="150" label="订单号">
<template slot-scope="scope">
<span>{{ scope.row.orderId }}</span>
<p>{{ scope.row.pinkName }}</p>
</template>
</el-table-column>
<el-table-column prop="realName" label="用户姓名" />
<el-table-column prop="cartInfoList" width="300" label="商品信息">
<template slot-scope="scope">
<div v-for="(item,index) in scope.row.cartInfoList" v-if="item.cartInfoMap.productInfo.attrInfo">
<span>
<img
style="width: 30px;height: 30px;margin:0;cursor: pointer;"
:src="item.cartInfoMap.productInfo.attrInfo.image"
>
</span>
<span>{{ item.cartInfoMap.productInfo.storeName }}&nbsp;{{ item.cartInfoMap.productInfo.attrInfo.sku }}</span>
<span> | {{ item.cartInfoMap.truePrice }}×{{ item.cartInfoMap.cartNum }}</span>
</div>
<div v-else>
<span><img
style="width: 30px;height: 30px;margin:0;cursor: pointer;"
:src="item.cartInfoMap.productInfo.image"
></span>
<span>{{ item.cartInfoMap.productInfo.storeName }}</span>
<span> | {{ item.cartInfoMap.truePrice }}×{{ item.cartInfoMap.cartNum }}</span>
</div>
</template>
</el-table-column>
<el-table-column prop="payPrice" label="实际支付" />
<el-table-column prop="payTypeName" label="支付状态" />
<el-table-column prop="statusName" label="订单状态">
<template slot-scope="scope">
<span v-html="scope.row.statusName"></span>
</template>
</el-table-column>
<el-table-column prop="addTime" width="160" label="创建时间">
<template slot-scope="scope">
<span>{{ formatTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT','YXSTOREORDER_DELETE'])" label="操作" width="200" align="center" fixed="right">
<template slot-scope="scope">
<el-button
v-permission="['admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT']"
size="mini"
type="primary"
@click="detail(scope.row)"
>
订单详情</el-button>
<el-dropdown size="mini" split-button type="primary" trigger="click">
操作
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>
<el-button
v-permission="['admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT']"
size="mini"
type="success"
@click="remark(scope.row)"
>
订单备注</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-button
v-if="scope.row._status == 2"
v-permission="['admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT']"
size="mini"
type="primary"
@click="edit(scope.row)"
>
订单核销</el-button>
</el-dropdown-item>
<el-dropdown-item>
<el-button
v-if="scope.row._status == 3"
v-permission="['admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT']"
size="mini"
type="primary"
@click="refund(scope.row)"
>
立刻退款</el-button>
</el-dropdown-item>
<el-dropdown-item v-if="scope.row._status == 1">
<el-button
v-permission="['admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT']"
size="mini"
type="primary"
@click="editOrder(scope.row)"
>
修改订单</el-button>
</el-dropdown-item>
<el-dropdown-item v-if="scope.row._status == 1">
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSTOREORDER_ALL','YXSTOREORDER_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini">删除</el-button>
</el-popover>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxStoreOrder'
import { getAll } from '@/api/bxg/yxSystemStore'
import eForm from './formC'
import eDetail from './detail1'
import eRefund from './refund'
import editOrder from './edit'
import eRemark from './remark'
import { formatTime } from '@/utils/index'
export default {
components: { eForm, eDetail, eRefund, editOrder, eRemark },
mixins: [initData],
data() {
return {
delLoading: false, status: '-9', orderType: '0', storeList: [] , storeId: null,
queryTypeOptions: [
{ key: 'orderId', display_name: '订单号' },
{ key: 'realName', display_name: '用户姓名' },
{ key: 'userPhone', display_name: '用户电话' }
],
statusOptions: [
{ value: '0', label: '未支付' },
{ value: '1', label: '未发货' },
{ value: '2', label: '待收货' },
{ value: '3', label: '待评价' },
{ value: '4', label: '交易完成' },
// { value: '5', label: '待核销' },
{ value: '-1', label: '退款中' },
{ value: '-2', label: '已退款' },
{ value: '-4', label: '已删除' }
]
}
},
created() {
this.$nextTick(() => {
this.init()
})
this.getStoreAll()
},
methods: {
getStoreAll() {
getAll().then(res => {
this.storeList = res
})
},
formatTime,
checkPermission,
handleOrder(tab, event) {
this.status = tab.name
this.toQuery()
},
beforeInit() {
this.url = 'bxg/api/yxStoreOrder'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort, orderStatus: this.status, orderType: 5, storeId: this.storeId }
const query = this.query
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
orderId: data.orderId,
uid: data.uid,
realName: data.realName,
userPhone: data.userPhone,
userAddress: data.userAddress,
cartId: data.cartId,
freightPrice: data.freightPrice,
totalNum: data.totalNum,
totalPrice: data.totalPrice,
totalPostage: data.totalPostage,
payPrice: data.payPrice,
payPostage: data.payPostage,
deductionPrice: data.deductionPrice,
couponId: data.couponId,
couponPrice: data.couponPrice,
paid: data.paid,
payTime: data.payTime,
payType: data.payType,
addTime: data.addTime,
status: data.status,
refundStatus: data.refundStatus,
refundReasonWapImg: data.refundReasonWapImg,
refundReasonWapExplain: data.refundReasonWapExplain,
refundReasonTime: data.refundReasonTime,
refundReasonWap: data.refundReasonWap,
refundReason: data.refundReason,
refundPrice: data.refundPrice,
deliveryName: data.deliveryName,
deliveryType: data.deliveryType,
deliveryId: data.deliveryId,
gainIntegral: data.gainIntegral,
useIntegral: data.useIntegral,
backIntegral: data.backIntegral,
mark: data.mark,
isDel: data.isDel,
unique: data.unique,
remark: data.remark,
merId: data.merId,
isMerCheck: data.isMerCheck,
combinationId: data.combinationId,
pinkId: data.pinkId,
cost: data.cost,
seckillId: data.seckillId,
bargainId: data.bargainId,
verifyCode: data.verifyCode,
storeId: data.storeId,
shippingType: data.shippingType,
isChannel: data.isChannel,
isRemind: data.isRemind,
isSystemDel: data.isSystemDel
}
_this.dialog = true
},
editOrder(data) {
this.isAdd = false
const _this = this.$refs.form3
_this.form = {
id: data.id,
orderId: data.orderId,
uid: data.uid,
realName: data.realName,
userPhone: data.userPhone,
userAddress: data.userAddress,
cartId: data.cartId,
freightPrice: data.freightPrice,
totalNum: data.totalNum,
totalPrice: data.totalPrice,
totalPostage: data.totalPostage,
payPrice: data.payPrice,
payPostage: data.payPostage,
deductionPrice: data.deductionPrice,
couponId: data.couponId,
couponPrice: data.couponPrice,
paid: data.paid,
payTime: data.payTime,
payType: data.payType,
addTime: data.addTime,
status: data.status,
refundStatus: data.refundStatus,
refundReasonWapImg: data.refundReasonWapImg,
refundReasonWapExplain: data.refundReasonWapExplain,
refundReasonTime: data.refundReasonTime,
refundReasonWap: data.refundReasonWap,
refundReason: data.refundReason,
refundPrice: data.refundPrice,
deliveryName: data.deliveryName,
deliveryType: data.deliveryType,
deliveryId: data.deliveryId,
gainIntegral: data.gainIntegral,
useIntegral: data.useIntegral,
backIntegral: data.backIntegral,
mark: data.mark,
isDel: data.isDel,
unique: data.unique,
remark: data.remark,
merId: data.merId,
isMerCheck: data.isMerCheck,
combinationId: data.combinationId,
pinkId: data.pinkId,
cost: data.cost,
seckillId: data.seckillId,
bargainId: data.bargainId,
verifyCode: data.verifyCode,
storeId: data.storeId,
shippingType: data.shippingType,
isChannel: data.isChannel,
isRemind: data.isRemind,
isSystemDel: data.isSystemDel
}
_this.dialog = true
},
remark(data) {
this.isAdd = false
const _this = this.$refs.form4
_this.form = {
id: data.id,
orderId: data.orderId,
uid: data.uid,
realName: data.realName,
userPhone: data.userPhone,
userAddress: data.userAddress,
cartId: data.cartId,
freightPrice: data.freightPrice,
totalNum: data.totalNum,
totalPrice: data.totalPrice,
totalPostage: data.totalPostage,
payPrice: data.payPrice,
payPostage: data.payPostage,
deductionPrice: data.deductionPrice,
couponId: data.couponId,
couponPrice: data.couponPrice,
paid: data.paid,
payTime: data.payTime,
payType: data.payType,
addTime: data.addTime,
status: data.status,
refundStatus: data.refundStatus,
refundReasonWapImg: data.refundReasonWapImg,
refundReasonWapExplain: data.refundReasonWapExplain,
refundReasonTime: data.refundReasonTime,
refundReasonWap: data.refundReasonWap,
refundReason: data.refundReason,
refundPrice: data.refundPrice,
deliveryName: data.deliveryName,
deliveryType: data.deliveryType,
deliveryId: data.deliveryId,
gainIntegral: data.gainIntegral,
useIntegral: data.useIntegral,
backIntegral: data.backIntegral,
mark: data.mark,
isDel: data.isDel,
unique: data.unique,
remark: data.remark,
merId: data.merId,
isMerCheck: data.isMerCheck,
combinationId: data.combinationId,
pinkId: data.pinkId,
cost: data.cost,
seckillId: data.seckillId,
bargainId: data.bargainId,
verifyCode: data.verifyCode,
storeId: data.storeId,
shippingType: data.shippingType,
isChannel: data.isChannel,
isRemind: data.isRemind,
isSystemDel: data.isSystemDel
}
_this.dialog = true
},
refund(data) {
this.isAdd = false
const _this = this.$refs.form2
_this.form = {
id: data.id,
orderId: data.orderId,
uid: data.uid,
realName: data.realName,
userPhone: data.userPhone,
userAddress: data.userAddress,
cartId: data.cartId,
freightPrice: data.freightPrice,
totalNum: data.totalNum,
totalPrice: data.totalPrice,
totalPostage: data.totalPostage,
payPrice: data.payPrice,
payPostage: data.payPostage,
deductionPrice: data.deductionPrice,
couponId: data.couponId,
couponPrice: data.couponPrice,
paid: data.paid,
payTime: data.payTime,
payType: data.payType,
addTime: data.addTime,
status: data.status,
refundStatus: data.refundStatus,
refundReasonWapImg: data.refundReasonWapImg,
refundReasonWapExplain: data.refundReasonWapExplain,
refundReasonTime: data.refundReasonTime,
refundReasonWap: data.refundReasonWap,
refundReason: data.refundReason,
refundPrice: data.refundPrice,
deliveryName: data.deliveryName,
deliveryType: data.deliveryType,
deliveryId: data.deliveryId,
gainIntegral: data.gainIntegral,
useIntegral: data.useIntegral,
backIntegral: data.backIntegral,
mark: data.mark,
isDel: data.isDel,
unique: data.unique,
remark: data.remark,
merId: data.merId,
isMerCheck: data.isMerCheck,
combinationId: data.combinationId,
pinkId: data.pinkId,
cost: data.cost,
seckillId: data.seckillId,
bargainId: data.bargainId,
verifyCode: data.verifyCode,
storeId: data.storeId,
shippingType: data.shippingType,
isChannel: data.isChannel,
isRemind: data.isRemind,
isSystemDel: data.isSystemDel
}
_this.dialog = true
},
detail(data) {
this.isAdd = false
const _this = this.$refs.form1
_this.form = {
id: data.id,
orderId: data.orderId,
payTypeName: data.payTypeName,
statusName: data.statusName,
uid: data.uid,
realName: data.realName,
userPhone: data.userPhone,
userAddress: data.userAddress,
cartId: data.cartId,
freightPrice: data.freightPrice,
totalNum: data.totalNum,
totalPrice: data.totalPrice,
totalPostage: data.totalPostage,
payPrice: data.payPrice,
payPostage: data.payPostage,
deductionPrice: data.deductionPrice,
couponId: data.couponId,
couponPrice: data.couponPrice,
paid: data.paid,
payTime: data.payTime,
payType: data.payType,
createTime: data.createTime,
status: data.status,
refundStatus: data.refundStatus,
refundReasonWapImg: data.refundReasonWapImg,
refundReasonWapExplain: data.refundReasonWapExplain,
refundReasonTime: data.refundReasonTime,
refundReasonWap: data.refundReasonWap,
refundReason: data.refundReason,
refundPrice: data.refundPrice,
deliveryName: data.deliveryName,
deliveryType: data.deliveryType,
deliveryId: data.deliveryId,
gainIntegral: data.gainIntegral,
useIntegral: data.useIntegral,
backIntegral: data.backIntegral,
mark: data.mark,
isDel: data.isDel,
unique: data.unique,
remark: data.remark,
merId: data.merId,
isMerCheck: data.isMerCheck,
combinationId: data.combinationId,
pinkId: data.pinkId,
cost: data.cost,
seckillId: data.seckillId,
bargainId: data.bargainId,
verifyCode: data.verifyCode,
storeId: data.storeId,
shippingType: data.shippingType,
isChannel: data.isChannel,
isRemind: data.isRemind,
isSystemDel: data.isSystemDel,
nickname: data.userDTO.nickname
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+189
View File
@@ -0,0 +1,189 @@
<template>
<el-dialog id="printDialog" :append-to-body="false" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" title="订单打印" width="220mm">
<el-button
type="warning"
class="filter-item"
size="mini"
icon="el-icon-printer"
onclick="doPrint()"
>打印</el-button>
<div id="printList">
<div class="order-list" v-for="(list, index) in printList">
<el-header class="order-title">订货单</el-header>
<div class="order-info">
<span class="info">{{list.orderId}}</span>
<span class="info">下单日期 : {{formatTimeTwo(list.addTime)}}</span>
<span>客户名称 : {{list.realName}}</span>
</div>
<div class="order-info">
<span class="info">联系人 : {{list.userDTO.account}}</span>
<span class="info">联系电话 : {{list.userPhone}}</span>
<span>收货地址 : {{list.userAddress}}</span>
</div>
<el-table border show-summary :data="list.cartInfoList" :summary-method="getSummaries" size="small" style="width: 100%;">
<el-table-column type="index" label="行号" :index="indexMethod" width="60mm"/>
<el-table-column prop="cartInfoMap.productInfo.productId" width="80mm" label="商品编号" />
<el-table-column prop="cartInfoMap.productInfo.storeName" width="172mm" label="商品名称" />
<el-table-column prop="cartInfoMap.productInfo.unitName" width="80mm" label="商品规格" />
<el-table-column prop="cartInfoMap.productInfo.unitName" width="80mm" label="单位" />
<el-table-column prop="cartInfoMap.productInfo.price" width="80mm" label="单价" />
<el-table-column prop="cartInfoMap.cartNum" width="80mm" label="数量" />
<el-table-column prop="cartInfoMap" width="80mm" label="小计(元)" >
<template slot-scope="scope">
<span>{{ scope.row.cartInfoMap.productInfo.price*scope.row.cartInfoMap.cartNum }}</span>
</template>
</el-table-column>
<el-table-column prop="cartInfoMap.mark" width="80mm" label="备注" />
</el-table>
</div>
</div>
</el-dialog>
</template>
<script>
import { formatTime, parseTime, formatTimeTwo } from '@/utils/index'
export default {
props: {
printList: {
type: Array,
required: true
},
toQuery: {
type: Function,
required: true
}
},
data() {
return {
loading: false, dialog: false
}
},
mounted() {
window.doPrint = this.doPrint;
},
methods: {
formatTime,
parseTime,
formatTimeTwo,
cancel() {
this.dialog = false
},
indexMethod(index){
return index+1;
},
doPrint(){
let printbox = document.querySelector("#printList").innerHTML;
document.querySelector("body").innerHTML = printbox;
window.print();
this.cancel();
// this.toQuery();
window.location.reload();
},
getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}else if(index === 7){
const values = data.map(item => Number(item.cartInfoMap.productInfo.price*item.cartInfoMap.cartNum));
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] += ' 元';
}
});
return sums;
}
}
}
</script>
<style scoped lang="scss">
.container {
height: calc(100% - 80px);
position: absolute;
overflow: auto;
width: calc(100% - 20px);
.order-caculate {
font-size: 14px;
color: #909399;
border-top: 1px solid #f0f0f0;
padding: 20px 10px;
.caculate-title {
display: inline-block;
margin-right: 50px;
}
.caculate-num {
font-size: 20px;
color: #ff4949;
}
}
.el-table th {
background-color: #fafafa;
}
}
.footer-contains {
position: absolute;
display: -ms-flexbox;
display: flex;
background-color: #f6f6f6;
bottom: 0;
flex-align: center;
align-items: center;
justify-content: space-between;
width: 100%;
z-index: 999;
padding: 0 20px 0 13px;
}
/*打印单样式编辑*/
.order-list {
/* height: 297mm;*/
margin: 0 auto;
width: 210mm;
.order-title {
height: 16mm;
line-height: 16mm;
font-size: 8mm;
font-weight: bolder;
text-align: center;
}
.order-info {
span {
display: inline-block;
padding: 0 0 10px 0;
font-size: 3mm;
}
span.info {
width: 60mm;
}
}
.el-table--small th, .el-table--small td {
padding: 4px 0;
}
}
</style>
+193
View File
@@ -0,0 +1,193 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '退款'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="订单号">
<el-input v-model="form.orderId" :disabled="true" style="width: 370px;" />
</el-form-item>
<el-form-item label="退款金额">
<el-input v-model="form.payPrice" style="width: 370px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, refund } from '@/api/bxg/yxStoreOrder'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
orderId: '',
uid: '',
realName: '',
userPhone: '',
userAddress: '',
cartId: '',
freightPrice: '',
totalNum: '',
totalPrice: '',
totalPostage: '',
payPrice: '',
payPostage: '',
deductionPrice: '',
couponId: '',
couponPrice: '',
paid: '',
payTime: '',
payType: '',
addTime: '',
status: '',
refundStatus: '',
refundReasonWapImg: '',
refundReasonWapExplain: '',
refundReasonTime: '',
refundReasonWap: '',
refundReason: '',
refundPrice: '',
deliveryName: '',
deliveryType: '',
deliveryId: '',
gainIntegral: '',
useIntegral: '',
backIntegral: '',
mark: '',
isDel: '',
unique: '',
remark: '',
merId: '',
isMerCheck: '',
combinationId: '',
pinkId: '',
cost: '',
seckillId: '',
bargainId: '',
verifyCode: '',
storeId: '',
shippingType: '',
isChannel: '',
isRemind: '',
isSystemDel: ''
},
rules: {
unique: [
{ required: true, message: 'please enter', trigger: 'blur' }
]
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
refund(this.form).then(res => {
this.resetForm()
this.$notify({
title: '操作成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
orderId: '',
uid: '',
realName: '',
userPhone: '',
userAddress: '',
cartId: '',
freightPrice: '',
totalNum: '',
totalPrice: '',
totalPostage: '',
payPrice: '',
payPostage: '',
deductionPrice: '',
couponId: '',
couponPrice: '',
paid: '',
payTime: '',
payType: '',
addTime: '',
status: '',
refundStatus: '',
refundReasonWapImg: '',
refundReasonWapExplain: '',
refundReasonTime: '',
refundReasonWap: '',
refundReason: '',
refundPrice: '',
deliveryName: '',
deliveryType: '',
deliveryId: '',
gainIntegral: '',
useIntegral: '',
backIntegral: '',
mark: '',
isDel: '',
unique: '',
remark: '',
merId: '',
isMerCheck: '',
combinationId: '',
pinkId: '',
cost: '',
seckillId: '',
bargainId: '',
verifyCode: '',
storeId: '',
shippingType: '',
isChannel: '',
isRemind: '',
isSystemDel: ''
}
}
}
}
</script>
<style scoped>
</style>
+193
View File
@@ -0,0 +1,193 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="订单号">
<el-input v-model="form.orderId" :disabled="true" style="width: 370px;" />
</el-form-item>
<el-form-item label="订单备注">
<el-input v-model="form.remark" style="width: 370px;" rows="5" type="textarea" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, remark } from '@/api/bxg/yxStoreOrder'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
orderId: '',
uid: '',
realName: '',
userPhone: '',
userAddress: '',
cartId: '',
freightPrice: '',
totalNum: '',
totalPrice: '',
totalPostage: '',
payPrice: '',
payPostage: '',
deductionPrice: '',
couponId: '',
couponPrice: '',
paid: '',
payTime: '',
payType: '',
addTime: '',
status: '',
refundStatus: '',
refundReasonWapImg: '',
refundReasonWapExplain: '',
refundReasonTime: '',
refundReasonWap: '',
refundReason: '',
refundPrice: '',
deliveryName: '',
deliveryType: '',
deliveryId: '',
gainIntegral: '',
useIntegral: '',
backIntegral: '',
mark: '',
isDel: '',
unique: '',
remark: '',
merId: '',
isMerCheck: '',
combinationId: '',
pinkId: '',
cost: '',
seckillId: '',
bargainId: '',
verifyCode: '',
storeId: '',
shippingType: '',
isChannel: '',
isRemind: '',
isSystemDel: ''
},
rules: {
unique: [
{ required: true, message: 'please enter', trigger: 'blur' }
]
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
remark(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
orderId: '',
uid: '',
realName: '',
userPhone: '',
userAddress: '',
cartId: '',
freightPrice: '',
totalNum: '',
totalPrice: '',
totalPostage: '',
payPrice: '',
payPostage: '',
deductionPrice: '',
couponId: '',
couponPrice: '',
paid: '',
payTime: '',
payType: '',
addTime: '',
status: '',
refundStatus: '',
refundReasonWapImg: '',
refundReasonWapExplain: '',
refundReasonTime: '',
refundReasonWap: '',
refundReason: '',
refundPrice: '',
deliveryName: '',
deliveryType: '',
deliveryId: '',
gainIntegral: '',
useIntegral: '',
backIntegral: '',
mark: '',
isDel: '',
unique: '',
remark: '',
merId: '',
isMerCheck: '',
combinationId: '',
pinkId: '',
cost: '',
seckillId: '',
bargainId: '',
verifyCode: '',
storeId: '',
shippingType: '',
isChannel: '',
isRemind: '',
isSystemDel: ''
}
}
}
}
</script>
<style scoped>
</style>
+101
View File
@@ -0,0 +1,101 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<rrOperation :crud="crud" />
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" />
<!--表单组件-->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
</div>
</el-dialog>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('id')" prop="id" label="id" width="75px" />
<el-table-column v-if="columns.visible('nickname')" prop="nickname" label="昵称" width="100px" />
<el-table-column v-if="columns.visible('orderId')" prop="orderId" label="订单号" />
<el-table-column v-if="columns.visible('price')" prop="price" label="充值金额" width="100px" />
<el-table-column v-if="columns.visible('rechargeType')" prop="rechargeType" label="充值类型" width="100px" />
<el-table-column v-if="columns.visible('paid')" prop="paid" label="是否支付" width="100px">
<template slot-scope="scope">
<span v-if="scope.row.paid == 1">是</span>
<span v-else>否</span>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('payTime')" prop="payTime" label="支付时间" >
<template slot-scope="scope">
<span>{{ formatTimeTwo(scope.row.payTime) }}</span>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="充值时间" >
<template slot-scope="scope">
<span>{{ formatTimeTwo(scope.row.createTime) }}</span>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import crudYxUserRecharge from '@/api/bxg/yxUserRecharge'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import { formatTimeTwo } from '@/utils/index'
// crud交由presenter持有
const defaultCrud = CRUD({ title: '充值管理', url: 'api/yxUserRecharge', sort: 'id,desc', crudMethod: { ...crudYxUserRecharge }, optShow: { add: false, edit: false, del: true, download: true}})
const defaultForm = { id: null, uid: null, orderId: null, price: null, rechargeType: null, paid: null, payTime: null, addTime: null, refundPrice: null, nickname: null }
export default {
name: 'YxUserRecharge',
components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()],
data() {
return {
permission: {
add: ['admin', 'yxUserRecharge:add'],
edit: ['admin', 'yxUserRecharge:edit'],
del: ['admin', 'yxUserRecharge:del']
},
rules: {
},
queryTypeOptions: [
{ key: 'nickname', display_name: '昵称' }
]
}
},
methods: {
formatTimeTwo,
// 获取数据前设置好接口地址
[CRUD.HOOK.beforeRefresh]() {
const query = this.query
if (query.type && query.value) {
this.crud.params[query.type] = query.value
}
return true
}
}
}
</script>
<style scoped>
</style>
+115
View File
@@ -0,0 +1,115 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="回复内容">
<el-input v-model="form.merchantReplyContent" style="width: 370px;" rows="5" type="textarea"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/bxg/yxStoreProductReply'
export default {
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
uid: '',
oid: '',
unique: '',
productId: '',
replyType: '',
productScore: '',
serviceScore: '',
comment: '',
pics: '',
addTime: '',
merchantReplyContent: '',
merchantReplyTime: '',
isDel: '',
isReply: ''
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
uid: '',
oid: '',
unique: '',
productId: '',
replyType: '',
productScore: '',
serviceScore: '',
comment: '',
pics: '',
addTime: '',
merchantReplyContent: '',
merchantReplyTime: '',
isDel: '',
isReply: ''
}
}
}
}
</script>
<style scoped>
</style>
+164
View File
@@ -0,0 +1,164 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-refresh"
@click="toQuery"
>刷新</el-button>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="ID" />
<el-table-column prop="user.nickname" label="用户" />
<el-table-column prop="storeProduct.storeName" label="商品信息" />
<el-table-column prop="productScore" label="商品分数" />
<el-table-column prop="serviceScore" label="服务分数" />
<el-table-column prop="comment" label="评论内容" />
<el-table-column prop="" label="评论图片">
<template slot-scope="scope">
<div v-if="scope.row.pics">
<a v-for="pic in handlePic(scope.row.pics)" :href="pic" style="color: #42b983" target="_blank">
<img :src="pic" alt="点击打开" class="el-avatar">
</a>
</div>
<div v-else>无图</div>
</template>
</el-table-column>
<el-table-column prop="createTime" label="评论时间">
<template slot-scope="scope">
<span>{{ formatTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="merchantReplyTime" label="回复时间">
<template slot-scope="scope">
<span>{{ formatTime(scope.row.merchantReplyTime) }}</span>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXSTOREPRODUCTREPLY_ALL','YXSTOREPRODUCTREPLY_EDIT','YXSTOREPRODUCTREPLY_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button
v-permission="['admin','YXSTOREPRODUCTREPLY_ALL','YXSTOREPRODUCTREPLY_EDIT']"
size="mini"
type="primary"
@click="edit(scope.row)"
>
回复</el-button>
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSTOREPRODUCTREPLY_ALL','YXSTOREPRODUCTREPLY_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxStoreProductReply'
import eForm from './form'
import { formatTime } from '@/utils/index'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
handlePic(pics) {
return pics.split(',')
},
formatTime,
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxStoreProductReply'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
uid: data.uid,
oid: data.oid,
unique: data.unique,
productId: data.productId,
replyType: data.replyType,
productScore: data.productScore,
serviceScore: data.serviceScore,
comment: data.comment,
pics: data.pics,
addTime: data.addTime,
merchantReplyContent: data.merchantReplyContent,
merchantReplyTime: data.merchantReplyTime,
isDel: data.isDel,
isReply: data.isReply
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+129
View File
@@ -0,0 +1,129 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="ID" />
<el-table-column prop="map.title" label="标题" />
<el-table-column prop="map.info" label="简介" />
<el-table-column prop="map.url" label="链接url" />
<el-table-column ref="table" label="图片">
<template slot-scope="scope">
<a :href="scope.row.map.pic" style="color: #42b983" target="_blank"><img :src="scope.row.map.pic" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT','YXSYSTEMGROUPDATA_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxSystemGroupData'
import eForm from './actform'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxSystemGroupData'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort, groupName: 'yshop_home_activity' }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
groupName: data.groupName,
title: data.map.title,
info: data.map.info,
url: data.map.url,
pic: data.map.pic,
imageArr: data.map.pic.split(',')
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+121
View File
@@ -0,0 +1,121 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
<el-form-item label="标题">
<el-input v-model="form.title" style="width: 370px;" />
</el-form-item>
<el-form-item label="简介">
<el-input v-model="form.info" style="width: 370px;" />
</el-form-item>
<el-form-item label="跳转url">
<el-input v-model="form.url" style="width: 370px;" />
</el-form-item>
<el-form-item label="图片(260*260/416*214)">
<pic-upload v-model="form.pic" style="width: 500px;" />
<MaterialList v-model="form.imageArr" style="width: 500px" type="image" :num="1" :width="150" :height="150" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<!--<el-input v-model="form.groupName" />-->
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/bxg/yxSystemGroupData'
import picUpload from '@/components/pic-upload'
import MaterialList from '@/components/material'
export default {
components: { picUpload, MaterialList },
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
groupName: 'yshop_home_activity',
title: '',
info: '',
url: '',
pic: '',
imageArr: [],
sort: '',
status: ''
},
rules: {
}
}
},
watch: {
'form.imageArr': function(val) {
if (val) {
this.form.pic = val.join(',')
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
groupName: 'yshop_home_activity',
value: '',
addTime: '',
sort: '',
status: ''
}
}
}
}
</script>
<style scoped>
</style>
+137
View File
@@ -0,0 +1,137 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="140px">
<el-form-item label="标题">
<el-input v-model="form.name" style="width: 300px;" />
</el-form-item>
<el-form-item label="H5跳转url">
<el-input v-model="form.url" style="width: 300px;" />
</el-form-item>
<el-form-item label="uniapp路由">
<el-input v-model="form.uniapp_url" style="width: 300px;" />
</el-form-item>
<el-form-item label="图片(750*375)">
<MaterialList v-model="form.imageArr" style="width: 300px" type="image" :num="1" :width="150" :height="150" />
</el-form-item>
<el-form-item label="轮播背景色">
<el-color-picker v-model="form.color"></el-color-picker>
</el-form-item>
<el-form-item label="排序">
<el-input v-model="form.sort" style="width: 300px;" />
</el-form-item>
<el-form-item label="是否显示">
<el-radio v-model="form.status" :label="1"></el-radio>
<el-radio v-model="form.status" :label="0" style="width: 200px;"></el-radio>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<!--<el-input v-model="form.groupName" />-->
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/bxg/yxSystemGroupData'
import picUpload from '@/components/pic-upload'
import MaterialList from '@/components/material'
export default {
components: { picUpload, MaterialList },
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
groupName: 'yshop_home_banner',
name: '',
url: '',
wxapp_url: '',
uniapp_url: '',
pic: '',
imageArr: [],
sort: 0,
status: 1,
color: ''
},
rules: {
}
}
},
watch: {
'form.imageArr': function(val) {
if (val) {
this.form.pic = val.join(',')
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
groupName: 'yshop_home_banner',
name: '',
url: '',
wxapp_url: '',
uniapp_url: '',
pic: '',
imageArr: [],
sort: 0,
status: 1,
color: null
}
}
}
}
</script>
<style scoped>
</style>
+132
View File
@@ -0,0 +1,132 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="ID" />
<el-table-column prop="map.title" label="标签" />
<el-table-column prop="sort" label="排序" />
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.status === 1" style="cursor: pointer" :type="''">显示</el-tag>
<el-tag v-else style="cursor: pointer" :type=" 'info' ">不显示</el-tag>
</div>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT','YXSYSTEMGROUPDATA_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxSystemGroupData'
import eForm from './hotform'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxSystemGroupData'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort, groupName: 'yshop_hot_search' }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
groupName: data.groupName,
title: data.map.title,
info: data.map.info,
url: data.map.url,
pic: data.map.pic,
sort: data.sort,
status: data.status
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+105
View File
@@ -0,0 +1,105 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
<el-form-item label="标签">
<el-input v-model="form.title" style="width: 370px;" />
</el-form-item>
<el-form-item label="排序">
<el-input v-model="form.sort" style="width: 300px;" />
</el-form-item>
<el-form-item label="是否显示">
<el-radio v-model="form.status" :label="1"></el-radio>
<el-radio v-model="form.status" :label="0" style="width: 200px;"></el-radio>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<!--<el-input v-model="form.groupName" />-->
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/bxg/yxSystemGroupData'
import picUpload from '@/components/pic-upload'
export default {
components: { picUpload },
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
groupName: 'yshop_hot_search',
title: '',
sort: 0,
status: 1
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
groupName: 'yshop_hot_search',
title: '',
sort: 0,
status: 1
}
}
}
}
</script>
<style scoped>
</style>
+143
View File
@@ -0,0 +1,143 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="ID" />
<el-table-column prop="map.name" label="标题" />
<el-table-column prop="map.url" label="链接url" />
<el-table-column prop="map.uniapp_url" label="uniapp路由" />
<el-table-column ref="table" label="图片">
<template slot-scope="scope">
<a :href="scope.row.map.pic" style="color: #42b983" target="_blank"><img :src="scope.row.map.pic" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column prop="map.color" label="轮播背景色" />
<el-table-column prop="sort" label="排序" />
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.status === 1" style="cursor: pointer" :type="''">显示</el-tag>
<el-tag v-else style="cursor: pointer" :type=" 'info' ">不显示</el-tag>
</div>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT','YXSYSTEMGROUPDATA_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxSystemGroupData'
import eForm from './form'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxSystemGroupData'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort, groupName: 'yshop_home_banner' }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
groupName: data.groupName,
name: data.map.name,
url: data.map.url,
wxapp_url: data.map.wxapp_url,
uniapp_url: data.map.uniapp_url,
pic: data.map.pic,
imageArr: data.map.pic ? data.map.pic.split(',') : [],
sort: data.sort,
status: data.status,
color: data.map.color
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+141
View File
@@ -0,0 +1,141 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="ID" />
<el-table-column prop="map.name" label="分类名称" />
<el-table-column prop="map.url" label="链接url" />
<el-table-column prop="map.uniapp_url" label="uniapp路由" />
<el-table-column ref="table" label="分类图标">
<template slot-scope="scope">
<a :href="scope.row.map.pic" style="color: #42b983" target="_blank"><img :src="scope.row.map.pic" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column prop="sort" label="排序" />
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.status === 1" style="cursor: pointer" :type="''">显示</el-tag>
<el-tag v-else style="cursor: pointer" :type=" 'info' ">不显示</el-tag>
</div>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT','YXSYSTEMGROUPDATA_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxSystemGroupData'
import eForm from './menuform'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxSystemGroupData'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort, groupName: 'yshop_home_menus' }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
groupName: data.groupName,
name: data.map.name,
url: data.map.url,
wxapp_url: data.map.wxapp_url,
uniapp_url: data.map.uniapp_url,
pic: data.map.pic,
imageArr: data.map.pic ? data.map.pic.split(',') : [],
sort: data.sort,
status: data.status
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+132
View File
@@ -0,0 +1,132 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="140px">
<el-form-item label="分类名称">
<el-input v-model="form.name" style="width: 300px;" />
</el-form-item>
<el-form-item label="跳转url">
<el-input v-model="form.url" style="width: 300px;" />
</el-form-item>
<el-form-item label="uniapp路由">
<el-input v-model="form.uniapp_url" style="width: 300px;" />
</el-form-item>
<el-form-item label="分类图标(90*90)">
<MaterialList v-model="form.imageArr" style="width: 300px" type="image" :num="1" :width="150" :height="150" />
</el-form-item>
<el-form-item label="排序">
<el-input v-model="form.sort" style="width: 300px;" />
</el-form-item>
<el-form-item label="是否显示">
<el-radio v-model="form.status" :label="1"></el-radio>
<el-radio v-model="form.status" :label="0" style="width: 200px;"></el-radio>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<!--<el-input v-model="form.groupName" />-->
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/bxg/yxSystemGroupData'
import picUpload from '@/components/pic-upload'
import MaterialList from '@/components/material'
export default {
components: { picUpload, MaterialList },
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
groupName: 'yshop_home_menus',
name: '',
url: '',
wxapp_url: '',
uniapp_url: '',
pic: '',
imageArr: [],
sort: 0,
status: 1
},
rules: {
}
}
},
watch: {
'form.imageArr': function(val) {
if (val) {
this.form.pic = val.join(',')
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
groupName: 'yshop_home_menus',
name: '',
url: '',
wxapp_url: '',
uniapp_url: '',
pic: '',
imageArr: [],
sort: 0,
status: 1
}
}
}
}
</script>
<style scoped>
</style>
+131
View File
@@ -0,0 +1,131 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="ID" />
<el-table-column prop="map.price" label="额度" />
<el-table-column prop="map.give_price" label="赠送" />
<el-table-column prop="sort" label="排序" />
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.status === 1" style="cursor: pointer" :type="''">显示</el-tag>
<el-tag v-else style="cursor: pointer" :type=" 'info' ">不显示</el-tag>
</div>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT','YXSYSTEMGROUPDATA_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxSystemGroupData'
import eForm from './rechargeform'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxSystemGroupData'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort, groupName: 'yshop_recharge_price_ways' }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
groupName: data.groupName,
give_price: data.map.give_price,
price: data.map.price,
sort: data.sort,
status: data.status
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+110
View File
@@ -0,0 +1,110 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
<el-form-item label="额度">
<el-input v-model="form.price" style="width: 300px;" />
</el-form-item>
<el-form-item label="赠送">
<el-input v-model="form.give_price" style="width: 300px;" />
</el-form-item>
<el-form-item label="排序">
<el-input v-model="form.sort" style="width: 300px;" />
</el-form-item>
<el-form-item label="是否显示">
<el-radio v-model="form.status" :label="1"></el-radio>
<el-radio v-model="form.status" :label="0" style="width: 200px;"></el-radio>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<!--<el-input v-model="form.groupName" />-->
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/bxg/yxSystemGroupData'
import picUpload from '@/components/pic-upload'
export default {
components: { picUpload },
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
groupName: 'yshop_recharge_price_ways',
price: 1,
give_price: 0,
sort: 0,
status: 1
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
groupName: 'yshop_recharge_price_ways',
price: 1,
give_price: 0,
sort: 0,
status: 1
}
}
}
}
</script>
<style scoped>
</style>
+136
View File
@@ -0,0 +1,136 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="ID" />
<el-table-column prop="map.info" label="滚动文字" />
<el-table-column prop="map.url" label="链接url" />
<el-table-column prop="map.uniapp_url" label="uniapp路由" />
<el-table-column prop="sort" label="排序" />
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.status === 1" style="cursor: pointer" :type="''">显示</el-tag>
<el-tag v-else style="cursor: pointer" :type=" 'info' ">不显示</el-tag>
</div>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT','YXSYSTEMGROUPDATA_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxSystemGroupData'
import eForm from './rollform'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxSystemGroupData'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort, groupName: 'yshop_home_roll_news' }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
groupName: data.groupName,
title: data.map.title,
info: data.map.info,
url: data.map.url,
wxapp_url: data.map.wxapp_url,
uniapp_url: data.map.uniapp_url,
pic: data.map.pic,
sort: data.sort,
status: data.status
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+117
View File
@@ -0,0 +1,117 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="140px">
<el-form-item label="滚动文字">
<el-input v-model="form.info" style="width: 300px;" />
</el-form-item>
<el-form-item label="跳转url">
<el-input v-model="form.url" style="width: 300px;" />
</el-form-item>
<el-form-item label="uniapp路由">
<el-input v-model="form.uniapp_url" style="width: 300px;" />
</el-form-item>
<el-form-item label="排序">
<el-input v-model="form.sort" style="width: 300px;" />
</el-form-item>
<el-form-item label="是否显示">
<el-radio v-model="form.status" :label="1"></el-radio>
<el-radio v-model="form.status" :label="0" style="width: 200px;"></el-radio>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<!--<el-input v-model="form.groupName" />-->
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/bxg/yxSystemGroupData'
import picUpload from '@/components/pic-upload'
export default {
components: { picUpload },
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
groupName: 'yshop_home_roll_news',
info: '',
wxapp_url: '',
uniapp_url: '',
url: '',
sort: 0,
status: 1
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
groupName: 'yshop_home_roll_news',
info: '',
wxapp_url: '',
uniapp_url: '',
url: '',
sort: 0,
status: 1
}
}
}
}
</script>
<style scoped>
</style>
+127
View File
@@ -0,0 +1,127 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="ID" />
<el-table-column prop="map.time" label="开启时间(整数小时)" />
<el-table-column prop="map.continued" label="持续时间(整数小时)" />
<el-table-column prop="map.status" label="状态">
<template slot-scope="scope">
<el-tag v-show="scope.row.status == 1" type="success">开启</el-tag>
<el-tag v-show="scope.row.status == 2" type="danger">关闭</el-tag>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT','YXSYSTEMGROUPDATA_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxSystemGroupData'
import eForm from './seckillform'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxSystemGroupData'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort, groupName: 'yshop_seckill_time'}
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
groupName: data.groupName,
time: data.map.time,
continued: data.map.continued,
status:data.map.status
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+111
View File
@@ -0,0 +1,111 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog"
:title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="150px">
<el-form-item label="开启时间(整数小时)">
<el-input v-model="form.time" style="width: 270px;"/>
</el-form-item>
<el-form-item label="持续时间(整数小时)">
<el-input v-model="form.continued" style="width: 270px;"/>
</el-form-item>
<el-form-item label="是否开启">
<el-radio-group v-model="form.status">
<el-radio :label="1">开启</el-radio>
<el-radio :label="2">关闭</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<!--<el-input v-model="form.groupName" />-->
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import {add, edit} from '@/api/bxg/yxSystemGroupData'
import picUpload from '@/components/pic-upload'
export default {
components: {picUpload},
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
groupName: 'yshop_seckill_time',
time: 5,
status:2, //默认关闭
continued: 2
},
rules: {}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
if (parseInt(this.form.continued) + parseInt(this.form.time) > 24) {
return this.$message.error("开启+持续时间不能超过24小时")
}
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
groupName: 'yshop_seckill_time',
time: 5,
continued: 2,
status:2 //默认关闭
}
}
}
}
</script>
<style scoped>
</style>
+131
View File
@@ -0,0 +1,131 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="ID" />
<el-table-column prop="map.day" label="第几天" />
<el-table-column prop="map.sign_num" label="获取积分" />
<el-table-column prop="sort" label="排序" />
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.status === 1" style="cursor: pointer" :type="''">显示</el-tag>
<el-tag v-else style="cursor: pointer" :type=" 'info' ">不显示</el-tag>
</div>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT','YXSYSTEMGROUPDATA_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxSystemGroupData'
import eForm from './signform'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxSystemGroupData'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort, groupName: 'yshop_sign_day_num' }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
groupName: data.groupName,
day: data.map.day,
sign_num: data.map.sign_num,
sort: data.sort,
status: data.status
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+110
View File
@@ -0,0 +1,110 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
<el-form-item label="第几天">
<el-input v-model="form.day" style="width: 300px;" />
</el-form-item>
<el-form-item label="获取积分">
<el-input v-model="form.sign_num" style="width: 300px;" />
</el-form-item>
<el-form-item label="排序">
<el-input v-model="form.sort" style="width: 300px;" />
</el-form-item>
<el-form-item label="是否显示">
<el-radio v-model="form.status" :label="1"></el-radio>
<el-radio v-model="form.status" :label="0" style="width: 200px;"></el-radio>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<!--<el-input v-model="form.groupName" />-->
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/bxg/yxSystemGroupData'
import picUpload from '@/components/pic-upload'
export default {
components: { picUpload },
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
groupName: 'yshop_sign_day_num',
day: 1,
sign_num: 0,
sort: 0,
status: 1
},
rules: {
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
groupName: 'yshop_sign_day_num',
day: 1,
sign_num: 0,
sort: 0,
status: 1
}
}
}
}
</script>
<style scoped>
</style>
+143
View File
@@ -0,0 +1,143 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_CREATE']"
class="filter-item"
size="mini"
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table-column prop="id" label="ID" />
<el-table-column prop="map.name" label="菜单名" />
<el-table-column prop="map.url" label="链接url" />
<el-table-column prop="map.uniapp_url" label="uniapp路由" />
<el-table-column ref="table" label="图标">
<template slot-scope="scope">
<a :href="scope.row.map.pic" style="color: #42b983" target="_blank">
<img :src="scope.row.map.pic" alt="点击打开" class="el-avatar">
</a>
</template>
</el-table-column>
<el-table-column prop="sort" label="排序" />
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.status === 1" style="cursor: pointer" :type="''">显示</el-tag>
<el-tag v-else style="cursor: pointer" :type=" 'info' ">不显示</el-tag>
</div>
</template>
</el-table-column>
<el-table-column v-if="checkPermission(['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT','YXSYSTEMGROUPDATA_DELETE'])" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
<el-popover
:ref="scope.row.id"
v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_DELETE']"
placement="top"
width="180"
>
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
style="margin-top: 8px;"
layout="total, prev, pager, next, sizes"
@size-change="sizeChange"
@current-change="pageChange"
/>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del } from '@/api/bxg/yxSystemGroupData'
import eForm from './usermenuform'
export default {
components: { eForm },
mixins: [initData],
data() {
return {
delLoading: false
}
},
created() {
this.$nextTick(() => {
this.init()
})
},
methods: {
checkPermission,
beforeInit() {
this.url = 'bxg/api/yxSystemGroupData'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort, groupName: 'yshop_my_menus' }
return true
},
subDelete(id) {
this.delLoading = true
del(id).then(res => {
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true
this.$refs.form.dialog = true
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.form = {
id: data.id,
groupName: data.groupName,
name: data.map.name,
url: data.map.url,
wxapp_url: data.map.wxapp_url,
uniapp_url: data.map.uniapp_url,
pic: data.map.pic,
imageArr: data.map.pic ? data.map.pic.split(',') : [],
sort: data.sort,
status: data.status
}
_this.dialog = true
}
}
}
</script>
<style scoped>
</style>
+132
View File
@@ -0,0 +1,132 @@
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="140px">
<el-form-item label="菜单名">
<el-input v-model="form.name" style="width: 300px;" />
</el-form-item>
<el-form-item label="跳转url">
<el-input v-model="form.url" style="width: 300px;" />
</el-form-item>
<el-form-item label="uniapp路由">
<el-input v-model="form.uniapp_url" style="width: 300px;" />
</el-form-item>
<el-form-item label="图标(52*52)">
<MaterialList v-model="form.imageArr" style="width: 300px" type="image" :num="1" :width="150" :height="150" />
</el-form-item>
<el-form-item label="排序">
<el-input v-model="form.sort" style="width: 300px;" />
</el-form-item>
<el-form-item label="是否显示">
<el-radio v-model="form.status" :label="1"></el-radio>
<el-radio v-model="form.status" :label="0" style="width: 200px;"></el-radio>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<!--<el-input v-model="form.groupName" />-->
<el-button type="text" @click="cancel">取消</el-button>
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
</div>
</el-dialog>
</template>
<script>
import { add, edit } from '@/api/bxg/yxSystemGroupData'
import picUpload from '@/components/pic-upload'
import MaterialList from '@/components/material'
export default {
components: { picUpload, MaterialList },
props: {
isAdd: {
type: Boolean,
required: true
}
},
data() {
return {
loading: false, dialog: false,
form: {
id: '',
groupName: 'yshop_my_menus',
name: '',
url: '',
wxapp_url: '',
uniapp_url: '',
pic: '',
imageArr: [],
sort: 0,
status: 1
},
rules: {
}
}
},
watch: {
'form.imageArr': function(val) {
if (val) {
this.form.pic = val.join(',')
}
}
},
methods: {
cancel() {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
},
doAdd() {
add(this.form).then(res => {
this.resetForm()
this.$notify({
title: '添加成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
doEdit() {
edit(this.form).then(res => {
this.resetForm()
this.$notify({
title: '修改成功',
type: 'success',
duration: 2500
})
this.loading = false
this.$parent.init()
}).catch(err => {
this.loading = false
console.log(err.response.data.message)
})
},
resetForm() {
this.dialog = false
this.$refs['form'].resetFields()
this.form = {
id: '',
groupName: 'yshop_my_menus',
name: '',
url: '',
wxapp_url: '',
uniapp_url: '',
pic: '',
imageArr: [],
sort: 0,
status: 1
}
}
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,260 @@
<template>
<el-dialog :close-on-click-modal="false"
:visible.sync="addressView"
append-to-body
class="modal"
title="选择城市" width="950px">
<el-row :gutter="24" type="flex">
<el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24" class="item">
<div class="acea-row row-right row-middle">
<el-checkbox v-model="iSselect" @change="allCheckbox">全选</el-checkbox>
<div class="empty" @click="empty">清空</div>
</div>
</el-col>
</el-row>
<el-row :gutter="24" :loading="loading" >
<el-col :xl="6" :lg="6" :md="6" :sm="8" :xs="6" class="item" v-for="(item,index) in cityList" :key="index">
<div @mouseenter="enter(index)" @mouseleave="leave()">
<el-checkbox v-model="item.checked" :label="item.name" @change="checkedClick(index)">{{item.name}}</el-checkbox>
<span class="red">({{(item.count || 0) + '/' + item.children.length}})</span>
<div class="city" v-show="activeCity===index">
<div class="checkBox">
<div class="arrow"></div>
<div>
<el-checkbox v-model="city.checked" :label="city.name" @change="primary(index,indexn)"
class="itemn" v-for="(city,indexn) in item.children"
:key="indexn">{{city.name}}</el-checkbox>
</div>
</div>
</div>
</div>
</el-col>
</el-row>
<div slot="footer">
<el-button @click="close">取消</el-button>
<el-button type="primary" @click="confirm">确定</el-button>
</div>
</el-dialog>
</template>
<script>
import crudYxShippingTemplates from '@/api/bxg/yxShippingTemplates'
import CRUD, {presenter, header, form, crud} from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import MaterialList from "@/components/material";
export default {
name: 'city',
props: {
type: {
type: Number,
default: 0
}
},
components: {crudOperation, rrOperation, udOperation, MaterialList},
mixins: [header(), crud()],
data () {
return {
iSselect: false,
addressView: false,
cityList: [],
activeCity: -1,
loading: false
}
},
methods: {
enter (index) {
this.activeCity = index;
},
leave () {
this.activeCity = null;
},
getCityList () {
this.loading = true;
crudYxShippingTemplates.getCity().then(res => {
this.loading = false;
this.cityList = res;
console.log("jjj:"+res)
})
},
/**
* 全选或者反选
* @param checked
*/
allCheckbox: function () {
let that = this, checked = this.iSselect;
that.cityList.forEach(function (item, key) {
that.$set(that.cityList[key], 'checked', checked);
if (checked) {
that.$set(that.cityList[key], 'count', that.cityList[key].children.length);
} else {
that.$set(that.cityList[key], 'count', 0);
}
that.cityList[key].children.forEach(function (val, k) {
that.$set(that.cityList[key].children[k], 'checked', checked);
})
});
},
// 清空;
empty () {
let that = this;
that.cityList.forEach(function (item, key) {
that.$set(that.cityList[key], 'checked', false);
that.cityList[key].children.forEach(function (val, k) {
that.$set(that.cityList[key].children[k], 'checked', false);
});
that.$set(that.cityList[key], 'count', 0);
});
this.iSselect = false;
},
/**
* 点击省
* @param index
*/
checkedClick: function (index) {
let that = this;
if (that.cityList[index].checked) {
that.$set(that.cityList[index], 'count', that.cityList[index].children.length);
that.cityList[index].children.forEach(function (item, key) {
that.$set(that.cityList[index].children[key], 'checked', true);
});
} else {
that.$set(that.cityList[index], 'count', 0);
that.$set(that.cityList[index], 'checked', false);
that.cityList[index].children.forEach(function (item, key) {
that.$set(that.cityList[index].children[key], 'checked', false);
});
that.iSselect = false;
}
},
/**
* 点击市区
* @param index
* @param ind
*/
primary: function (index, ind) {
let checked = false, count = 0;
this.cityList[index].children.forEach(function (item, key) {
console.log("item:"+item.checked)
if (item.checked) {
checked = true;
count++;
}
});
this.$set(this.cityList[index], 'count', count);
this.$set(this.cityList[index], 'checked', checked);
},
// 确定;
confirm () {
let that = this;
// 被选中的省市;
let selectList = [];
console.log("city:"+that.cityList[0].children)
that.cityList.forEach(function (item, key) {
let data = {};
if (item.checked) {
data = {
name: item.name,
city_id: item.city_id,
children: []
};
}
console.log("data:"+data)
that.cityList[key].children.forEach(function (i, k) {
if (i.checked) {
data.children.push({
city_id: i.city_id
})
}
});
if (data.city_id !== undefined) {
selectList.push(data);
}
});
console.log(selectList);
if (selectList.length === 0) {
return this.$message({
message:'至少选择一个省份或者城市',
type: 'error'
});
} else {
this.$emit('selectCity', selectList, this.type);
that.addressView = false;
this.cityList = []
}
},
close () {
this.addressView = false;
this.cityList = []
}
},
mounted () {
}
}
</script>
<style scoped>
.modal .item {
position: relative;
margin-bottom: 20px;
}
.modal .item .city {
position: absolute;
z-index: 9;
top: 17px;
width: 100%;
padding-top: 18px;
}
.modal .item .city .checkBox {
width: 97%;
padding: 10px;
border: 1px solid #eee;
background-color: #fff;
max-height: 100px;
overflow-x: hidden;
overflow-y: auto;
}
.modal .item .city .checkBox .arrow {
position: absolute;
top: 3px;
width: 0;
height: 0;
border: 8px solid transparent;
border-bottom-color: #ddd;
}
.modal .item .city .checkBox .arrow:before {
position: absolute;
bottom: -8px;
right: -7px;
content: "";
width: 0;
height: 0;
border: 7px solid transparent;
border-bottom-color: #fff;
}
.modal .item .city .checkBox .itemn {
margin-bottom: 10px;
}
.radio {
padding: 5px 0;
font-size: 14px !important;
}
.red {
color: #ff0000;
}
.empty {
cursor: pointer;
margin-left:10px
}
</style>
@@ -0,0 +1,419 @@
<template>
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU"
:visible.sync="crud.status.cu > 0"
:title="crud.status.title" width="950px">
<el-form ref="formData" :model="formData" class="attrFrom" :rules="rules" label-width="130px" :inline="true">
<el-row :gutter="24" type="flex">
<el-col :xl="18" :lg="18" :md="18" :sm="24" :xs="24">
<el-form-item label="模板名称" prop="name">
<el-input type="text" placeholder="请输入模板名称" v-model="formData.name"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24" type="flex">
<el-col :xl="18" :lg="18" :md="18" :sm="24" :xs="24">
<el-form-item label="计费方式" props="state" >
<el-radio-group class="radio" v-model="formData.type" >
<el-radio :label="1">按件数</el-radio>
<el-radio :label="2">按重量</el-radio>
<el-radio :label="3">按体积</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24" type="flex">
<el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24">
<el-form-item class="label" label="配送区域及运费" props="state">
<el-table
ref="table"
:data="templateList"
empty-text="暂无数据"
border
>
<el-table-column prop="regionName" label="可配送区域" width="130" />
<el-table-column prop="first" label="首件" width="120">
<template slot="header" slot-scope="scope">
<span v-if="formData.type == 1">首件</span>
<span v-else-if="formData.type == 2">首件重量(KG)</span>
<span v-else>首件体积(m³)</span>
</template>
<template slot-scope="scope">
<span><el-input type="text" v-model="scope.row.first" /></span>
</template>
</el-table-column>
<el-table-column prop="price" label="运费" width="110">
<template slot-scope="scope">
<span><el-input type="text" v-model="scope.row.price"/></span>
</template>
</el-table-column>
<el-table-column prop="_continue" label="续件" width="120">
<template slot="header" slot-scope="scope">
<span v-if="formData.type == 1">续件</span>
<span v-else-if="formData.type == 2">续件重量(KG)</span>
<span v-else>续件体积(m³)</span>
</template>
<template slot-scope="scope">
<span><el-input type="text" v-model="scope.row._continue"/></span>
</template>
</el-table-column>
<el-table-column prop="continue_price" label="续费" width="110">
<template slot-scope="scope">
<span><el-input type="text" v-model="scope.row.continue_price"/></span>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<a v-if="scope.row.regionName!=='默认全国'" @click="delCity(index,1)">删除</a>
</template>
</el-table-column>
</el-table>
<el-row type="flex" class="addTop">
<el-col>
<el-button type="primary" icon="md-add" @click="addCity(1)">单独添加配送区域</el-button>
</el-col>
</el-row>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24" type="flex">
<el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24">
<el-form-item label="指定包邮" prop="store_name">
<el-radio-group class="radio" v-model="formData.appoint_check">
<el-radio :label="1">开启</el-radio>
<el-radio :label="0">关闭</el-radio>
</el-radio-group>
<el-table
ref="table"
:data="appointList"
empty-text="暂无数据"
border
v-if="formData.appoint_check === 1"
>
<el-table-column prop="placeName" label="选择地区" />
<el-table-column prop="a_num" label="包邮件数" width="120" >
<template slot="header" slot-scope="scope">
<span v-if="formData.type == 1">包邮件数</span>
<span v-else-if="formData.type == 2">包邮重量(KG)</span>
<span v-else>包邮体积(m³)</span>
</template>
<template slot-scope="scope">
<span><el-input type="text" v-model="scope.row.a_num"/></span>
</template>
</el-table-column>
<el-table-column prop="a_price" label="包邮金额" width="120">
<template slot-scope="scope">
<span><el-input type="text" v-model="scope.row.a_price"/></span>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<a v-if="scope.row.regionName!=='默认全国'" @click="delCity(index,2)">删除</a>
</template>
</el-table-column>
</el-table>
<el-row type="flex" v-if="formData.appoint_check === 1">
<el-col>
<el-button type="primary" icon="md-add" @click="addCity(2)">单独指定包邮</el-button>
</el-col>
</el-row>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24" type="flex">
<el-col :xl="18" :lg="18" :md="18" :sm="24" :xs="24">
<el-form-item label="排序" prop="store_name">
<el-input-number :min="0" placeholder="输入值越大越靠前" v-model="formData.sort" ></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24" type="flex">
<el-col>
<el-form-item prop="store_name" label=" ">
<el-button type="primary" @click="handleSubmit">{{id ? '立即修改':'立即提交'}}</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<!--<el-button type="text" @click="crud.cancelCU">取消</el-button>-->
<!--<el-button :loading="modal_loading" type="primary" @click="handleSubmit('formData')">确认</el-button>-->
</div>
<city ref="city" @selectCity="selectCity" :type="type"></city>
</el-dialog>
</template>
<script>
import crudYxShippingTemplates from '@/api/bxg/yxShippingTemplates'
import CRUD, {presenter, header, form, crud} from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import MaterialList from "@/components/material";
import city from './city';
var g = [
{
region: [
{
name: '默认全国',
city_id: 0
}
],
regionName: '默认全国',
first: 1,
price: 0,
_continue: 1,
continue_price: 0
}
]
const defaultForm = {id: null, type: null, sort: null, appointInfo: null, appoint: null, name: null}
export default {
name: 'tempForm',
components: {crudOperation, rrOperation, udOperation, MaterialList, city},
mixins: [header(), form(defaultForm), crud()],
data() {
return {
permission: {
add: ['admin', 'storeProductRule:add'],
edit: ['admin', 'storeProductRule:edit'],
del: ['admin', 'storeProductRule:del']
},
rules: {
ruleName: [
{required: true, message: '规格名称不能为空', trigger: 'blur'}
]
},
templateList: g,
appointList: [],
type: 1,
formData: {
type: 1,
sort: 0,
name: '',
appoint_check: 0
},
id: 0,
addressView: false,
indeterminate: true,
checkAll: false,
checkAllGroup: [],
activeCity: -1,
provinceAllGroup: [],
index: -1,
displayData: '',
currentProvince: ''
}
},
watch: {},
methods: {
// 获取数据前设置好接口地址
[CRUD.HOOK.beforeRefresh]() {
return true
}, // 新增与编辑前做的操作
[CRUD.HOOK.afterToCU](crud, form) {
console.log('uu:'+form.name)
this.appointList = form.appointInfo ? eval('(' + form.appointInfo + ')') : []
if(form.id){
this.templateList = eval('(' + form.regionInfo + ')')
}else{
this.templateList = g
}
this.formData.type = form.type || 1
this.formData.sort = form.sort || 0
this.formData.name = form.name || ''
this.formData.appoint_check = form.appoint || 0
this.id = form.id || 0
},
selectCity: function (data, type) {
let cityName = data.map(function (item) {
return item.name;
}).join(';');
switch (type) {
case 1:
this.templateList.push({
region: data,
regionName: cityName,
first: 1,
price: 0,
_continue: 1,
continue_price: 0
});
break;
case 2:
this.appointList.push({
place: data,
placeName: cityName,
a_num: 0,
a_price: 0
});
break;
}
},
// 单独添加配送区域
addCity (type) {
this.$refs.city.addressView = true;
this.type = type;
this.$refs.city.getCityList()
},
// 提交
handleSubmit: function () {
let that = this;
if (!that.formData.name.trim().length) {
return this.$message({
message:'请填写模板名称',
type: 'error'
});
}
for (let i = 0; i < that.templateList.length; i++) {
if (that.templateList[i].first <= 0) {
return this.$message({
message:'首件/重量/体积应大于0\'',
type: 'error'
});
}
if (that.templateList[i].price < 0) {
return this.$message({
message:'运费应大于等于0',
type: 'error'
});
}
if (that.templateList[i].continue <= 0) {
return this.$message({
message:'续件/重量/体积应大于0',
type: 'error'
});
}
if (that.templateList[i].continue_price < 0) {
return this.$message({
message:'续费应大于等于0',
type: 'error'
});
}
}
if (that.formData.appoint_check === 1) {
for (let i = 0; i < that.appointList.length; i++) {
if (that.appointList[i].a_num <= 0) {
return this.$message({
message:'包邮件数应大于0',
type: 'error'
});
}
if (that.appointList[i].a_price < 0) {
return this.$message({
message:'包邮金额应大于等于0',
type: 'error'
});
}
}
}
let data = {
appoint_info: that.appointList,
region_info: that.templateList,
sort: that.formData.sort,
type: that.formData.type,
name: that.formData.name,
appoint: that.formData.appoint_check
};
crudYxShippingTemplates.add(data,that.id).then(() => {
if(that.id){
this.crud.status.edit = CRUD.STATUS.NORMAL
this.crud.editSuccessNotify()
}else{
this.crud.status.add = CRUD.STATUS.NORMAL
this.crud.addSuccessNotify()
}
this.crud.resetForm()
this.crud.toQuery()
this.formData = {
type: 1,
sort: 0,
name: '',
appoint_check: 0
};
this.appointList = [];
this.addressView = false;
this.templateList = [
{
region: [
{
name: '默认全国',
city_id: 0
}
],
regionName: '默认全国',
first: 1,
price: 0,
continue: 1,
continue_price: 0
}
];
});
},
// 删除
delCity (index,type) {
if (type === 1) {
this.templateList.splice(index, 1);
} else {
this.appointList.splice(index, 1);
}
},
// 关闭
cancel () {
this.formData = {
type: 1,
sort: 0,
name: '',
appoint_check: 0
};
this.appointList = [];
this.addressView = false;
this.templateList = [
{
region: [
{
name: '默认全国',
city_id: 0
}
],
regionName: '默认全国',
first: 0,
price: 0,
continue: 0,
continue_price: 0
}
];
},
address () {
this.addressView = true
},
enter (index) {
this.activeCity = index;
},
leave () {
this.activeCity = null;
}
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,105 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" />
<add />
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('id')" prop="id" label="模板ID" />
<el-table-column v-if="columns.visible('name')" prop="name" label="模板名称" />
<el-table-column v-if="columns.visible('type')" prop="type" label="计费方式">
<template slot-scope="scope">
<span v-if="scope.row.type == 1">按件数</span>
<span v-else-if="scope.row.type == 2">按重量</span>
<span v-else>按体积</span>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('appoint')" prop="appoint" label="指定包邮开关">
<template slot-scope="scope">
<span v-if="scope.row.appoint == 1">开启</span>
<span v-else>关闭</span>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="添加时间">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('sort')" prop="sort" label="排序" />
<el-table-column v-permission="['admin','yxShippingTemplates:edit','yxShippingTemplates:del']" label="操作" width="150px" align="center">
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import crudYxShippingTemplates from '@/api/bxg/yxShippingTemplates'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import MaterialList from "@/components/material";
import add from './form'
// crud交由presenter持有
const defaultCrud = CRUD({ title: '运费模板', url: 'api/yxShippingTemplates', sort: 'id,desc', crudMethod: { ...crudYxShippingTemplates }})
const defaultForm = { id: null, name: null, type: null, regionInfo: null, appoint: null, appointInfo: null, createTime: null, updateTime: null, isDel: null, sort: null }
export default {
name: 'YxShippingTemplates',
components: { pagination, crudOperation, rrOperation, udOperation ,MaterialList ,add},
mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()],
data() {
return {
permission: {
add: ['admin', 'yxShippingTemplates:add'],
edit: ['admin', 'yxShippingTemplates:edit'],
del: ['admin', 'yxShippingTemplates:del']
},
rules: {
} }
},
watch: {
},
methods: {
// 获取数据前设置好接口地址
[CRUD.HOOK.beforeRefresh]() {
return true
}, // 新增与编辑前做的操作
[CRUD.HOOK.afterToCU](crud, form) {
},
}
}
</script>
<style scoped>
.table-img {
display: inline-block;
text-align: center;
background: #ccc;
color: #fff;
white-space: nowrap;
position: relative;
overflow: hidden;
vertical-align: middle;
width: 32px;
height: 32px;
line-height: 32px;
}
</style>
+194
View File
@@ -0,0 +1,194 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" />
<!--表单组件-->
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="门店名称" prop="name">
<el-input v-model="form.name" style="width: 370px;" />
</el-form-item>
<el-form-item label="门店简介" prop="introduction">
<el-input v-model="form.introduction" style="width: 370px;" />
</el-form-item>
<el-form-item label="门店手机" prop="phone">
<el-input v-model="form.phone" style="width: 370px;" />
</el-form-item>
<el-form-item label="门店地址" prop="address">
<el-input v-model="form.address" style="width: 370px;" />
<el-button size="medium" type="primary" @click="getL(form.address)">获取经纬度</el-button>
</el-form-item>
<el-form-item label="门店logo" prop="image">
<MaterialList v-model="form.imageArr" style="width: 370px" type="image" :num="1" :width="150" :height="150" />
</el-form-item>
<el-form-item label="纬度" prop="latitude">
<el-input v-model="form.latitude" style="width: 370px;" :disabled="true" />
</el-form-item>
<el-form-item label="经度" prop="longitude">
<el-input v-model="form.longitude" style="width: 370px;" :disabled="true" />
</el-form-item>
<el-form-item label="核销时效" prop="validTime">
<el-date-picker
@change="getTimeT"
style="width: 370px;"
v-model="form.validTimeArr"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="营业时间" prop="dayTime">
<el-time-picker
@change="getTime"
style="width: 370px;"
is-range
v-model="form.dayTimeArr"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
placeholder="选择时间范围">
</el-time-picker>
</el-form-item>
<el-form-item label="是否显示" prop="isShow">
<el-radio-group v-model="form.isShow" style="width: 178px">
<el-radio :label="1">显示</el-radio>
<el-radio :label="0">隐藏</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
</div>
</el-dialog>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column type="selection" width="55" />
<el-table-column v-if="columns.visible('id')" prop="id" label="id" width="50" />
<el-table-column v-if="columns.visible('name')" prop="name" label="门店名称" />
<el-table-column v-if="columns.visible('phone')" prop="phone" label="门店电话" />
<el-table-column v-if="columns.visible('address')" prop="address" label="地址" />
<el-table-column v-if="columns.visible('image')" prop="image" label="门店logo" >
<template slot-scope="scope">
<a :href="scope.row.image" style="color: #42b983" target="_blank"><img :src="scope.row.image" alt="点击打开" class="el-avatar"></a>
</template>
</el-table-column>
<el-table-column v-if="columns.visible('validTime')" prop="validTime" label="核销有效日期" />
<el-table-column v-if="columns.visible('dayTime')" prop="dayTime" label="营业时间" />
<el-table-column v-if="columns.visible('isShow')" prop="isShow" label="是否显示" >
<template slot-scope="scope">
<div>
<el-tag v-if="scope.row.isShow === 1" :type="''">显示</el-tag>
<el-tag v-else :type=" 'info' ">隐藏</el-tag>
</div>
</template>
</el-table-column>
<el-table-column v-permission="['admin','yxSystemStore:edit','yxSystemStore:del']" label="操作" width="150px" align="center">
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import crudYxSystemStore from '@/api/bxg/yxSystemStore'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import MaterialList from '@/components/material'
import { parseTime } from '@/utils/index'
// crud交由presenter持有
const defaultCrud = CRUD({ title: '门店', url: 'api/yxSystemStore', sort: 'id,desc', crudMethod: { ...crudYxSystemStore }})
const defaultForm = { id: null, name: null, introduction: null, phone: null, address: null, detailedAddress: null, image: null, latitude:
null, longitude: null, validTime: null, dayTime: null, addTime: null, isShow: 1, imageArr: [], validTimeArr: [], dayTimeArr: [new Date(),new Date()] }
export default {
name: 'YxSystemStore',
components: { pagination, crudOperation, rrOperation, udOperation, MaterialList },
mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()],
data() {
return {
permission: {
add: ['admin', 'yxSystemStore:add'],
edit: ['admin', 'yxSystemStore:edit'],
del: ['admin', 'yxSystemStore:del']
},
rules: {
name: [
{ required: true, message: '门店名称不能为空', trigger: 'blur' }
],
introduction: [
{ required: true, message: '简介不能为空', trigger: 'blur' }
],
phone: [
{ required: true, message: '手机号码不能为空', trigger: 'blur' }
],
address: [
{ required: true, message: '省市区不能为空', trigger: 'blur' }
],
latitude: [
{ required: true, message: '纬度不能为空', trigger: 'blur' }
],
longitude: [
{ required: true, message: '经度不能为空', trigger: 'blur' }
],
isShow: [
{ required: true, message: '是否显示不能为空', trigger: 'blur' }
]
}
}
},
methods: {
// 获取数据前设置好接口地址
[CRUD.HOOK.beforeRefresh]() {
return true
},
// 添加后
[CRUD.HOOK.beforeSubmit]() {
//console.log('hah:'+this.form.imageArr)
this.form.image = this.form.imageArr.join(',')
},
// 编辑前
[CRUD.HOOK.beforeToEdit](crud, form) {
form.imageArr = [form.image]
form.dayTimeArr = [form.dayTimeStart,form.dayTimeEnd]
form.validTimeArr = [form.validTimeStart,form.validTimeEnd]
},
getTime(t) {
this.form.dayTimeStart = t[0]
this.form.dayTimeEnd = t[1]
this.form.dayTime = parseTime(t[0],'{h}:{i}:{s}') + ' - ' + parseTime(t[1],'{h}:{i}:{s}')
},
getTimeT(t) {
this.form.validTimeStart = t[0]
this.form.validTimeEnd = t[1]
this.form.validTime = parseTime(t[0],'{y}-{m}-{d}') + ' - ' + parseTime(t[1],'{y}-{m}-{d}')
},
getL(addr) {
crudYxSystemStore.getL({addr}).then(res => {
this.form.latitude = res.result.location.lat
this.form.longitude = res.result.location.lng
//console.log(this.form)
})
}
}
}
</script>
<style scoped>
</style>
+70
View File
@@ -0,0 +1,70 @@
<template>
<div class="app-container">
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="150px">
<el-form-item label="开启门店自提">
<el-radio v-model="form.store_self_mention" :label="1">开启</el-radio>
<el-radio v-model="form.store_self_mention" :label="2">关闭</el-radio>
</el-form-item>
<el-form-item label="腾讯地图KEY">
<el-input v-model="form.tengxun_map_key" style="width: 370px;" />
</el-form-item>
<el-form-item label="">
<el-button type="primary" @click="doSubmit">提交</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/crud'
import { del, add, get } from '@/api/bxg/yxSystemConfig'
import { Message } from 'element-ui'
export default {
mixins: [initData],
data() {
return {
delLoading: false,
form: {
store_self_mention: 1,
tengxun_map_key: ''
},
rules: {
}
}
},
created() {
get().then(rese => {
const that = this
rese.content.map(function(key, value) {
const keyName = key.menuName
const newValue = key.value
if(keyName in that.form){
that.form[keyName] = newValue
}
})
this.form.store_self_mention = parseInt(this.form.store_self_mention)
})
},
methods: {
checkPermission,
doSubmit() {
add(this.form).then(res => {
Message({ message: '设置成功', type: 'success' })
}).catch(err => {
// this.loading = false
console.log(err.response.data.message)
})
}
}
}
</script>
<style scoped>
</style>

Some files were not shown because too many files have changed in this diff Show More