master
271556543@qq.com 3 years ago
parent f97b2709ca
commit dfb6c22de4

@ -27,7 +27,7 @@ export function save(data){
export function destroy(data){ export function destroy(data){
return request({ return request({
method:'post', method:'post',
url:'/api/admin/policy/delete', url:'/api/admin/policy/destroy',
data data
}) })
} }

@ -1,89 +1,89 @@
<template> <template>
<el-breadcrumb class="app-breadcrumb" separator="/"> <el-breadcrumb class="app-breadcrumb" separator="/">
<transition-group name="breadcrumb"> <transition-group name="breadcrumb">
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path"> <el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1" <span v-if="item.redirect==='noRedirect'||index==levelList.length-1||item.path.includes('key')"
class="no-redirect">{{ item.meta.title }}</span> class="no-redirect">{{ item.meta.title }}</span>
<a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a> <a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
</el-breadcrumb-item> </el-breadcrumb-item>
</transition-group> </transition-group>
</el-breadcrumb> </el-breadcrumb>
</template> </template>
<script> <script>
import pathToRegexp from 'path-to-regexp' import pathToRegexp from 'path-to-regexp'
export default { export default {
data() { data() {
return { return {
levelList: null levelList: null
} }
}, },
watch: { watch: {
$route() { $route() {
this.getBreadcrumb() this.getBreadcrumb()
} }
}, },
created() { created() {
this.getBreadcrumb() this.getBreadcrumb()
}, },
methods: { methods: {
getBreadcrumb() { getBreadcrumb() {
// only show routes with meta.title // only show routes with meta.title
let matched = this.$route.matched.filter(item => item.meta && item.meta.title) let matched = this.$route.matched.filter(item => item.meta && item.meta.title)
const first = matched[0] const first = matched[0]
if (!this.isDashboard(first)) { if (!this.isDashboard(first)) {
matched = [{ matched = [{
path: '/dashboard', path: '/dashboard',
meta: { meta: {
title: '系统首页' title: '系统首页'
} }
}].concat(matched) }].concat(matched)
} }
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false) this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
}, },
isDashboard(route) { isDashboard(route) {
const name = route && route.name const name = route && route.name
if (!name) { if (!name) {
return false return false
} }
return name.trim().toLocaleLowerCase() === '系统首页'.toLocaleLowerCase() return name.trim().toLocaleLowerCase() === '系统首页'.toLocaleLowerCase()
}, },
pathCompile(path) { pathCompile(path) {
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561 // To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
const { const {
params params
} = this.$route } = this.$route
var toPath = pathToRegexp.compile(path) var toPath = pathToRegexp.compile(path)
return toPath(params) return toPath(params)
}, },
handleLink(item) { handleLink(item) {
const { const {
redirect, redirect,
path path
} = item } = item
if (redirect) { if (redirect) {
this.$router.push(redirect) this.$router.push(redirect)
return return
} }
this.$router.push(this.pathCompile(path)) this.$router.push(this.pathCompile(path))
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.app-breadcrumb.el-breadcrumb { .app-breadcrumb.el-breadcrumb {
display: inline-block; display: inline-block;
font-size: 14px; font-size: 14px;
line-height: 50px; line-height: 50px;
margin-left: 8px; margin-left: 8px;
.no-redirect { .no-redirect {
color: #97a8be; color: #97a8be;
cursor: text; cursor: text;
} }
} }
</style> </style>

@ -1,4 +1,3 @@
import Vue from 'vue'
import { import {
asyncRoutes, asyncRoutes,
constantRoutes constantRoutes
@ -72,7 +71,7 @@ const componentHandler = (path) => {
if(path === '#' || path === ''){ if(path === '#' || path === ''){
return Layout return Layout
} }
if(path.includes('#') && path != '#'){ if(path.includes('#') && path !== '#'){
return ()=>import('@/layout/noLayout') return ()=>import('@/layout/noLayout')
} }
return loadView(path) return loadView(path)
@ -104,6 +103,11 @@ export function generaMenu(routes, data) {
routes.push(menu) routes.push(menu)
} }
}) })
routes.push({
path: '*',
redirect: '/404',
hidden: true
})
} }
const mutations = { const mutations = {

@ -228,14 +228,14 @@ export default {
], ],
boss_phone:[ boss_phone:[
{ required: true, message: '请填写法人/老板电话', trigger: 'blur' }, { required: true, message: '请填写法人/老板电话', trigger: 'blur' },
{pattern: /^[1][3-9][\d]{9}/,message:'手机号格式错误'} { pattern: /^[1][3-9][\d]{9}/,message:'手机号格式错误'}
], ],
contact:[ contact:[
{ required: true, message: '请填写联系人', trigger: 'blur' } { required: true, message: '请填写联系人', trigger: 'blur' }
], ],
phone:[ phone:[
{ required: true, message: '请填写联系人电话', trigger: 'blur' }, { required: true, message: '请填写联系人电话', trigger: 'blur' },
{pattern: /^[1][3-9][\d]{9}/,message:'手机号格式错误'} { pattern: /^[1][3-9][\d]{9}/,message:'手机号格式错误'}
], ],
username:[ username:[
{ required: true, message: '请填写简称/用户名', trigger: 'blur' } { required: true, message: '请填写简称/用户名', trigger: 'blur' }

@ -1,23 +1,73 @@
<template> <template>
<div> <div>
<Modal title="订单日志" :value.sync="isShow" @on-visible-change="$emit('update:isShow',$event)"> <Modal :width="60" title="订单日志" :value.sync="isShow" @on-visible-change="$emit('update:isShow',$event)">
<xy-table :is-page="false" :list="list" :table-item="table" :height="300">
<template v-slot:btns>
<div></div>
</template>
</xy-table>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import {getItemLogs} from "@/api/order"
import {parseTime} from '@/utils'
export default { export default {
props:{ props:{
id:Number,
isShow:{ isShow:{
type:Boolean, type:Boolean,
default:false default:false
} }
}, },
data() { data() {
return {} return {
list:[],
table:[
{
label:'用户',
prop:'operator.name',
width: 120
},
{
label:'时间',
prop:'created_at',
width: 160,
formatter:(cell,data,value) => {
return parseTime(new Date(value),'{y}-{m}-{d}')
}
},
{
label:'操作',
prop:'operate_name',
width: 120
},
{
label:'备注',
prop:'remark',
align:'left',
sortable:false
}
],
}
}, },
methods: {} methods: {
async getLog(){
const res = await getItemLogs({
item_id:this.id
})
this.list = res.data
}
},
watch:{
isShow(newVal){
if(newVal){
this.getLog()
}
}
}
} }
</script> </script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,51 @@
<template>
<div style="padding: 0 20px">
<div ref="lxHeader">
<lx-header icon="md-apps" text="会所产品" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div>
<Input v-model="select.keywords" style="width: 200px; margin-right: 10px" placeholder="关键字搜索" />
<Select placeholder="类型搜索" v-model="select.type" style="width: 140px;margin-right: 10px">
</Select>
<Button type="primary">查询</Button>
<Button type="primary" style="margin-left: 10px" @click="$refs['addClubProduct'].type = 'add',$refs['addClubProduct'].isShow = true">新增</Button>
</div>
</slot>
</lx-header>
</div>
<xy-table></xy-table>
<addClubProduct ref="addClubProduct"></addClubProduct>
</div>
</template>
<script>
import addClubProduct from '@/views/productService/components/addClubProduct'
export default {
components:{
addClubProduct
},
data() {
return {
select:{
page:1,
pageSize:10,
keywords:'',
type:''
},
total:0,
list:[],
table:[]
}
},
methods: {}
}
</script>
<style scoped lang="scss">
</style>

@ -0,0 +1,24 @@
<template>
<div>
<xy-dialog type="form" :is-show.sync="isShow" :title="this.type === 'add' ? '新增会所产品' : '编辑会所产品'">
</xy-dialog>
</div>
</template>
<script>
export default {
data() {
return {
id:'',
isShow:false,
type:''
}
},
methods: {}
}
</script>
<style scoped lang="scss">
</style>

@ -0,0 +1,44 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增月子会所' : '编辑月子会所'" :form="form" :rules="rules">
</xy-dialog>
</div>
</template>
<script>
export default {
data() {
return {
id:'',
isShow:false,
type:'',
form:{
},
rules:{
}
}
},
methods: {
},
watch:{
isShow(newVal){
if(newVal){
}else{
this.id = ''
this.type = ''
this.$refs['dialog'].reset()
}
}
}
}
</script>
<style scoped lang="scss">
</style>

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增政策' : '编辑政策'" :form="form" :rules="rules"> <xy-dialog :width="74" ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增政策' : '编辑政策'" :form="form" :rules="rules" @submit="submit">
<template v-slot:name> <template v-slot:name>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <div class="xy-table-item-label">
@ -16,10 +16,38 @@
<div class="xy-table-item-label"> <div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>政策 <span style="color: red;font-weight: 600;padding-right: 4px;">*</span>政策
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content" style="min-width: 640px">
<el-form-item v-for="(item,index) in form.items"> <el-form-item v-for="(item,index) in form.items" :key="item.index">
<div>{{'政策'+index}}</div> <div class="xy-table-item-content-items">
<div class="xy-table-item-content-items-item">
<div class="xy-table-item-content-items-item__title">{{'政策'+item.index}}</div>
</div>
<div class="xy-table-item-content-items-item">
<div class="xy-table-item-content-items-item__label">操作</div>
<el-select v-model="item.action" style="width: 160px;">
<el-option v-for="(value,key) of actions" :value="key" :label="value"></el-option>
</el-select>
</div>
<div class="xy-table-item-content-items-item">
<div class="xy-table-item-content-items-item__label">计时</div>
<el-input-number style="width: 100px;" :controls="false" :precision="1" v-model="item.timer"></el-input-number>
</div>
<div class="xy-table-item-content-items-item">
<div class="xy-table-item-content-items-item__label">对订单操作</div>
<el-select multiple v-model="item.operations" style="width: 160px;">
<el-option v-for="(value,key) of operations" :value="key" :label="value"></el-option>
</el-select>
</div>
<div class="xy-table-item-content-items-item">
<div class="xy-table-item-content-items-item__label">佣金比</div>
<el-input-number class="xy-table-item-content-items-item__percent" style="width: 100px;" v-model="item.fee_ratio" :controls="false" :precision="2"></el-input-number>
</div>
<div class="xy-table-item-content-items-item">
<el-button type="primary" size="small" icon="el-icon-minus" style="width: 80px;" @click="removePolicy(item.index)"></el-button>
</div>
</div>
</el-form-item> </el-form-item>
<Button style="width: 200px;margin-top:20px;position: relative;left: 50%;transform: translateX(-50%);" type="dashed" @click="addPolicy" icon="md-add">新增政策</Button>
</div> </div>
</div> </div>
</template> </template>
@ -28,30 +56,154 @@
</template> </template>
<script> <script>
import {store,save} from '@/api/policy'
import { Message } from 'element-ui'
export default { export default {
data() { data() {
var itemsCheck = (rule, value, callback) => {
if(value.length === 0){
callback()
}else{
value.forEach(item => {
if(!item.action){
return callback(new Error(`请填写政策${item.index}操作`))
}
if(item.operations.length === 0){
return callback(new Error(`请选择政策${item.index}对订单操作`))
}
callback()
})
}
}
return { return {
id:'', id:'',
isShow:false, isShow:false,
type:'', type:'',
policyIndex:0,
actions:{
follow:'跟进',
assign:'分发',
recover:'收回',
cancel:'取消',
follow_by_merchant:'跟进',
accept_by_merchant:'接受',
return_by_merchant:'退回',
confirm_by_merchant:'确认有效',
finish_by_merchant:'核销',
mark_cancel_by_member:'用户退单',
mark_cancel_by_merchant:'标注退单',
confirm_merchant_cancel:'确认商家标注无效',
confirm_member_cancel:'确认用户退单'
},
operations:{
auto_accept:'自动接收',
auto_confirm:'自动确认',
auto_recover:'自动回收',
auto_fee:'自动扣除佣金',
auto_refund_fee:'自动反佣',
manually_refund_fee:'手工返佣',
auto_finish:'自动核销'
},
detail:{},
form:{ form:{
name:'', name:'',
items:[] items:[]
}, },
rules:{ rules:{
name:[
{required:true,message:'请填写名称'}
],
items:[
{ validator: itemsCheck, trigger: 'blur' }
]
} }
} }
}, },
methods: { methods: {
getDetail(){
this.form.name = this.detail.name
this.form.items = this.detail.items.map(item => {
return {
index:++this.policyIndex,
action:item?.action,
timer:item?.timer,
operations:item?.operations.split(','),
fee_ratio:item?.fee_ratio,
}
})
},
addPolicy(){
this.form.items.push({
index:++this.policyIndex,
action:'',
timer:'',
operations:[],
fee_ratio:'',
})
},
removePolicy(index){
this.form.items.map((item,index1)=>{
if(index == item.index){
this.form.items.splice(index1,1)
}
})
},
submit(){
if(this.type === 'add'){
this.form.items.forEach(item => {
item.operations = item.operations.toString()
})
console.log(this.form)
store({
name:this.form.name,
items:this.form.items
}).then(res => {
Message({
type:'success',
message:'添加政策成功'
})
this.isShow = false
this.$emit('refresh')
})
return
}
if(this.type === 'editor'){
this.form.items.forEach(item => {
item.operations = item.operations.toString()
})
console.log(this.form)
save({
id:this.id,
name:this.form.name,
items:this.form.items
}).then(res => {
Message({
type:'success',
message:'编辑政策成功'
})
this.isShow = false
this.$emit('refresh')
})
return
}
}
},
computed:{
}, },
watch:{ watch:{
isShow(newVal){ isShow(newVal){
if(newVal){ if(newVal){
if(this.type === 'editor'){
this.getDetail()
}
}else{ }else{
this.policyIndex = 0
this.id = '' this.id = ''
this.type = '' this.type = ''
this.$refs['dialog'].reset() this.$refs['dialog'].reset()
@ -62,4 +214,50 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.xy-table-item-label{
width: 130px;
}
.xy-table-item-content-items{
display: flex;
&-item{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-bottom: 10px;
margin-right: 10px;
&__title{
width: 100px;
word-break: keep-all;
white-space: nowrap;
font-weight: 600;
text-align: center;
}
&__label{
word-break: keep-all;
white-space: nowrap;
padding: 0 10px;
}
&__percent{
position: relative;
&::after{
content:'%';
position: absolute;
right: 6%;
top: 0;
}
}
}
}
::v-deep .el-input__inner{
text-align: left;
}
</style> </style>

@ -0,0 +1,52 @@
<template>
<div style="padding: 0 20px">
<div ref="lxHeader">
<lx-header icon="md-apps" text="月子会所" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div>
<Input v-model="select.keywords" style="width: 200px; margin-right: 10px" placeholder="关键字搜索" />
<Select placeholder="类型搜索" v-model="select.type" style="width: 140px;margin-right: 10px">
</Select>
<Button type="primary">查询</Button>
<Button type="primary" style="margin-left: 10px" @click="$refs['addConfinementClub'].type = 'add',$refs['addConfinementClub'].isShow = true">新增</Button>
</div>
</slot>
</lx-header>
</div>
<xy-table :total="total" :list="list" :table-item="table" @pageSizeChange="e => select.pageSize = e"></xy-table>
<addConfinementClub ref="addConfinementClub"></addConfinementClub>
</div>
</template>
<script>
import addConfinementClub from '@/views/productService/components/addConfinementClub'
export default {
components:{
addConfinementClub
},
data() {
return {
select:{
page:1,
pageSize:10,
keywords:'',
type:''
},
total:0,
list:[],
table:[],
}
},
methods: {}
}
</script>
<style scoped lang="scss">
</style>

@ -22,12 +22,14 @@
@editor="editor" @editor="editor"
@delete="deletePolicy"></xy-table> @delete="deletePolicy"></xy-table>
<addPolicy ref="addPolicy"></addPolicy> <addPolicy ref="addPolicy" @refresh="getPolicies"></addPolicy>
</div> </div>
</template> </template>
<script> <script>
import {index,destroy} from "@/api/policy" import {index,destroy} from "@/api/policy"
import {deepCopy} from "@/utils"
import { Message } from 'element-ui'
import addPolicy from "./components/addPolicy" import addPolicy from "./components/addPolicy"
export default { export default {
@ -94,12 +96,21 @@ export default {
}, },
editor(row){ editor(row){
this.$refs['addPolicy'].detail = deepCopy(row)
this.$refs['addPolicy'].type = 'editor' this.$refs['addPolicy'].type = 'editor'
this.$refs['addPolicy'].id = row.id this.$refs['addPolicy'].id = row.id
this.$refs['addPolicy'].isShow = true this.$refs['addPolicy'].isShow = true
}, },
deletePolicy(row){ deletePolicy(row){
destroy({
id:row.id
}).then(res => {
Message({
type:'success',
message:'删除政策成功'
})
this.getPolicies()
})
} }
}, },
mounted() { mounted() {

Loading…
Cancel
Save