master
271556543@qq.com 4 years ago
parent b1de6e8a94
commit d7d5eff79c

@ -218,6 +218,7 @@ export default {
} }
} }
.el-form-item__error{ .el-form-item__error{
white-space: nowrap;
word-break: keep-all !important; word-break: keep-all !important;
top: 100% !important; top: 100% !important;
left: calc(100% - 80px) !important; left: calc(100% - 80px) !important;

@ -22,20 +22,20 @@ export default {
<div class="xy-selectors"> <div class="xy-selectors">
<div v-show={isShowSelector} style={{'width':'100vw','height':'100vh','position':'fixed','top':0,'left':0,'z-index':1}} on={{['click']:()=>this.isShowSelector = false}}></div> <div v-show={isShowSelector} style={{'width':'100vw','height':'100vh','position':'fixed','top':0,'left':0,'z-index':1}} on={{['click']:()=>this.isShowSelector = false}}></div>
<div class="xy-selectors-btn"> <div class="xy-selectors-btn">
{$scopedSlots?.selectorBar ? $scopedSlots?.selectorBar() : ''} {$scopedSlots?.default ? $scopedSlots?.default() : ''}
<Button <Button
icon='md-arrow-dropdown'
ghost={isShowSelector} ghost={isShowSelector}
class={isShowSelector ? 'xy-selectors-btn__item xy-selectors-btn__select xy-selectors-btn-active__select' : 'xy-selectors-btn__item xy-selectors-btn__select"'} class={isShowSelector ? 'xy-selectors-btn__item xy-selectors-btn__select xy-selectors-btn-active__select' : 'xy-selectors-btn__item xy-selectors-btn__select"'}
type='primary' type='primary'
on={{ on={{
['click']:() => showSelector() ['click']:() => showSelector()
}}> }}>
搜索 高级搜索
</Button> </Button>
<Button <Button
class="xy-selectors-btn__item" class="xy-selectors-btn__item"
type='primary' type='primary'
size={isShowSelector ? 'small' : 'default'}
on={{ on={{
['click']:()=>this.$emit('add') ['click']:()=>this.$emit('add')
}}> }}>
@ -107,7 +107,7 @@ export default {
&::after{ &::after{
content:''; content:'';
height: 12px; height: 12px;
background: linear-gradient(to top,rgba(239,242,250,0.95) 35%,#0000 80%,#0000); background: linear-gradient(to top,rgba(235,238,244,0.98) 40%,#0000 80%,#0000);
z-index: 5; z-index: 5;
position: absolute; position: absolute;

@ -173,10 +173,6 @@ top: 41px !important;
bottom: -11.5px; bottom: -11.5px;
} }
.el-menu-item.is-active{
color: $primaryColor !important;
}
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 8px; width: 8px;
height: 8px; height: 8px;

@ -59,7 +59,7 @@
<template v-slot:slogan> <template v-slot:slogan>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <div class="xy-table-item-label">
<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">
<el-input v-model="form.slogan" placeholder="请输入宣传语" clearable style="width: 300px;"></el-input> <el-input v-model="form.slogan" placeholder="请输入宣传语" clearable style="width: 300px;"></el-input>
@ -165,7 +165,7 @@
<template v-slot:password> <template v-slot:password>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span> <template v-if="type === 'add'"><span style="color: red;font-weight: 600;padding-right: 4px;">*</span></template>
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-input v-model="showPassword" placeholder="请输入密码" clearable style="width: 300px;" @input="e => form.password = e"></el-input> <el-input v-model="showPassword" placeholder="请输入密码" clearable style="width: 300px;" @input="e => form.password = e"></el-input>
@ -181,6 +181,16 @@ import {store,show,save} from '@/api/merchant'
import { Message } from 'element-ui' import { Message } from 'element-ui'
export default { export default {
data() { data() {
var checkPassword = (rule, value, callback) => {
if(this.type === 'add'){
if(!value){
return callback(new Error('密码不能为空'))
}
}
if(this.type === 'editor'){
callback()
}
}
return { return {
id:'', id:'',
type:'add', type:'add',
@ -213,9 +223,6 @@ export default {
name: [ name: [
{ required: true, message: '请填写姓名', trigger: 'blur' } { required: true, message: '请填写姓名', trigger: 'blur' }
], ],
slogan:[
{ required: true, message: '请填写宣传语', trigger: 'blur' }
],
boss:[ boss:[
{ required: true, message: '请填写法人/老板', trigger: 'blur' } { required: true, message: '请填写法人/老板', trigger: 'blur' }
], ],
@ -234,7 +241,7 @@ export default {
{ required: true, message: '请填写简称/用户名', trigger: 'blur' } { required: true, message: '请填写简称/用户名', trigger: 'blur' }
], ],
password:[ password:[
{ required: true, message: '请填写密码', trigger: 'blur' } { validator: checkPassword, trigger: 'blur' }
], ],
business_number:[ business_number:[
{ required: true, message:'请填写营业执照编号'} { required: true, message:'请填写营业执照编号'}
@ -343,6 +350,7 @@ export default {
}) })
} }
}else{ }else{
this.showPassword = ''
this.id = '' this.id = ''
this.$refs['dialog'].reset() this.$refs['dialog'].reset()
} }

@ -79,7 +79,7 @@
<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">
<el-input disabled clearable placeholder="请填写经度" v-model="form.lng" style="width: 120px;"/> <el-input readonly clearable placeholder="请填写经度" v-model="form.lng" style="width: 120px;"/>
</div> </div>
</div> </div>
</template> </template>
@ -89,7 +89,7 @@
<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">
<el-input disabled clearable placeholder="请填写纬度" v-model="form.lat" style="width: 120px;"/> <el-input readonly clearable placeholder="请填写纬度" v-model="form.lat" style="width: 120px;"/>
</div> </div>
</div> </div>
</template> </template>
@ -103,6 +103,16 @@
</div> </div>
</div> </div>
</template> </template>
<template v-slot:isDefault>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>是否为主营门店
</div>
<div class="xy-table-item-content">
<el-switch v-model="form.isDefault"></el-switch>
</div>
</div>
</template>
</xy-dialog> </xy-dialog>
</div> </div>
</template> </template>
@ -131,6 +141,7 @@ export default {
contact:'', contact:'',
contactNumber:'', contactNumber:'',
state:true, state:true,
isDefault:true,
address:'', address:'',
lng:'',// lng:'',//
lat:'',// lat:'',//
@ -201,7 +212,8 @@ export default {
phone:this.form.contactNumber, phone:this.form.contactNumber,
longitude:this.form.lng, longitude:this.form.lng,
latitude:this.form.lat, latitude:this.form.lat,
state:1 state:this.form.state ? 1 : 0,
is_default:this.form.isDefault ? 1 : 0
}).then(res => { }).then(res => {
Message({ Message({
type:'success', type:'success',
@ -224,7 +236,8 @@ export default {
phone:this.form.contactNumber, phone:this.form.contactNumber,
longitude:this.form.lng, longitude:this.form.lng,
latitude:this.form.lat, latitude:this.form.lat,
state:this.form.state ? 1 : 0 state:this.form.state ? 1 : 0,
is_default:this.form.isDefault ? 1 : 0
}).then(res => { }).then(res => {
Message({ Message({
type:'success', type:'success',
@ -258,7 +271,8 @@ export default {
this.form.belongsMerchant = res.merchant_id this.form.belongsMerchant = res.merchant_id
this.form.lat = res.latitude this.form.lat = res.latitude
this.form.lng = res.longitude this.form.lng = res.longitude
this.form.state = res.state == 1 ? true : false this.form.state = res.state == 1 || res.state == 'active' ? true : false
this.form.isDefault = res.is_default == 1 ? true : false
} }
}else{ }else{
this.$refs['dialog'].reset() this.$refs['dialog'].reset()
@ -273,4 +287,7 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.xy-table-item-label{
width: 166px;
}
</style> </style>

@ -5,7 +5,7 @@
<div slot="content"></div> <div slot="content"></div>
<slot> <slot>
<div> <div>
<Input style="width: 200px; margin-right: 10px" placeholder="关键字搜索" /> <Input clearable style="width: 200px; margin-right: 10px" v-model="select.keywords" placeholder="关键字搜索" />
<Button type="primary" @click="getMerchant"></Button> <Button type="primary" @click="getMerchant"></Button>
<Button type="primary" style="margin-left: 10px" @click="$refs['addMerchant'].isShow = true,$refs['addMerchant'].type = 'add'">新增商户</Button> <Button type="primary" style="margin-left: 10px" @click="$refs['addMerchant'].isShow = true,$refs['addMerchant'].type = 'add'">新增商户</Button>
</div> </div>
@ -42,7 +42,7 @@ export default {
select:{ select:{
pageSize:10, pageSize:10,
pageIndex:1, pageIndex:1,
keywords:''
}, },
total:0, total:0,
@ -114,7 +114,8 @@ export default {
async getMerchant(){ async getMerchant(){
const res = await index({ const res = await index({
page_size:this.select.pageSize, page_size:this.select.pageSize,
page:this.select.pageIndex page:this.select.pageIndex,
keyword:this.select.keywords
}) })
this.list = res.data this.list = res.data
this.total = res.total this.total = res.total

@ -5,9 +5,9 @@
<div slot="content"></div> <div slot="content"></div>
<slot> <slot>
<div> <div>
<Input style="width: 200px; margin-right: 10px" v-model="select.keywords" placeholder="关键字搜索" /> <Input clearable style="width: 200px; margin-right: 10px" v-model="select.keywords" placeholder="关键字搜索" />
<Button type="primary" @click="getStores"></Button> <Button type="primary" @click="getStores" style="margin-right: 10px;"></Button>
<Button type="primary" style="margin-left: 10px" @click="$refs['addStore'].isShow = true,$refs['addStore'].type = 'add'">新增门店</Button> <Button type="primary" @click="$refs['addStore'].isShow = true,$refs['addStore'].type = 'add'" style="margin-right: 10px;">新增</Button>
</div> </div>
</slot> </slot>
</lx-header> </lx-header>
@ -99,7 +99,8 @@ export default {
async getStores(){ async getStores(){
const res = await index({ const res = await index({
page_size:this.select.pageSize, page_size:this.select.pageSize,
page:this.select.pageIndex page:this.select.pageIndex,
keyword:this.select.keywords
}) })
this.list = res.data this.list = res.data
this.total = res.total this.total = res.total
@ -134,4 +135,45 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.selects {
display: flex;
flex-wrap: wrap;
&-item{
display: flex;
align-items: center;
justify-content: center;
margin-top: 6px;
&-label{
white-space: nowrap;
padding: 0px 6px;
}
}
}
.select-content-item{
display: flex;
align-items: center;
margin-bottom: 10px;
&-label{
padding: 0 20px;
}
}
$primaryColor: #bf617c;
::v-deep .ivu-alert-success{
color:#fff;
border-color: $primaryColor !important;
background: rgba(213, 120, 145, 0.8) !important;
margin: auto 0;
margin-right: 10px;
}
::v-deep .ivu-icon-ios-close:before{
color: #fff;
}
</style> </style>

@ -5,7 +5,7 @@
<div slot="content"></div> <div slot="content"></div>
<slot> <slot>
<xy-selectors @search="getAds" @add="$refs['addAd'].isShow = true,$refs['addAd'].type = 'add'" @reset="resetSelect"> <xy-selectors @search="getAds" @add="$refs['addAd'].isShow = true,$refs['addAd'].type = 'add'" @reset="resetSelect">
<template v-slot:selectorBar v-if="select.name || select.system || select.createDate[0] || select.createDate[1] || select.isEffect === 0 || select.isEffect === 1"> <template v-slot:default v-if="select.name || select.system || select.createDate[0] || select.createDate[1] || select.isEffect === 0 || select.isEffect === 1">
<Alert style="padding-top: 6px;padding-bottom: 6px;font-size: 13px" type="success" show-icon closable @on-close="resetSelect"> <Alert style="padding-top: 6px;padding-bottom: 6px;font-size: 13px" type="success" show-icon closable @on-close="resetSelect">
<Icon type="ios-funnel-outline" slot="icon" color="#fff"/> <Icon type="ios-funnel-outline" slot="icon" color="#fff"/>
<span v-if="select.name"> <span v-if="select.name">

@ -35,7 +35,7 @@
<el-table-column fixed="right" label="操作" width="200" header-align="center"> <el-table-column fixed="right" label="操作" width="200" header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<Button icon="ios-chatbubbles-outline" type="primary" style="margin-left: 10px;margin-bottom: 6px;" size="small" ghost>跟进</Button> <Button icon="ios-chatbubbles-outline" type="primary" style="margin-left: 10px;margin-bottom: 6px;" size="small" ghost>跟进</Button>
<Button v-show="scope.row.state_name == ''" icon="ios-paper-plane-outline" type="primary" style="margin-left: 10px;margin-bottom: 6px;" size="small" ghost></Button> <Button v-show="scope.row.state_name == ''" icon="ios-paper-plane-outline" type="primary" style="margin-left: 10px;margin-bottom: 6px;" size="small" ghost></Button>
<Button v-show="scope.row.state_name == ''" icon="ios-close" type="primary" style="margin-left: 10px;margin-bottom: 6px;" size="small" ghost>取消</Button> <Button v-show="scope.row.state_name == ''" icon="ios-close" type="primary" style="margin-left: 10px;margin-bottom: 6px;" size="small" ghost>取消</Button>
<Button v-show="scope.row.state_name == ''" icon="ios-redo" type="primary" style="margin-left: 10px;margin-bottom: 6px;" size="small" ghost>收回</Button> <Button v-show="scope.row.state_name == ''" icon="ios-redo" type="primary" style="margin-left: 10px;margin-bottom: 6px;" size="small" ghost>收回</Button>
<Button icon="ios-clipboard-outline" type="primary" style="margin-left: 10px;margin-bottom: 6px;" size="small" ghost>日志</Button> <Button icon="ios-clipboard-outline" type="primary" style="margin-left: 10px;margin-bottom: 6px;" size="small" ghost>日志</Button>

@ -17,6 +17,9 @@
<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">
<el-form-item v-for="(item,index) in form.items">
<div>{{'政策'+index}}</div>
</el-form-item>
</div> </div>
</div> </div>
</template> </template>

@ -1,31 +1,40 @@
<template> <template>
<div> <div>
<Modal :width="62" loading title="产品组合" :value.sync="isShow" @on-visible-change="$emit('update:isShow',$event)" @on-ok="submit" @on-cancel="reset"> <Modal :width="62" title="产品组合" :value.sync="isShow" @on-visible-change="$emit('update:isShow',$event)" @on-cancel="reset">
<Form :model="form" ref="form"> <Form :model="form" ref="form">
<FormItem <FormItem
prop="products" prop="products"
v-for="(item, index) in form.products" v-for="(item, index) in form.products"
:key="index" :key="index">
:label="'产品'+item.index"> <div class="product">
<Row> <div class="product-content">
<Col span="6" offset="1"> <div style="width: 60px">{{'产品'+item.index}}</div>
<Select type="text" v-model="item.value" placeholder="选择产品"> </div>
<div class="product-content">
<Select type="text" v-model="item.value" placeholder="选择产品" style="width: 140px;">
<Option v-for="pro in products" :key="pro.id" :value="pro.id">{{pro.name}}</Option> <Option v-for="pro in products" :key="pro.id" :value="pro.id">{{pro.name}}</Option>
</Select> </Select>
</Col> </div>
<Col span="3" offset="1"> <div class="product-content">
<InputNumber :min="0" v-model="item.num" placeholder="数量"></InputNumber> <InputNumber :min="0" v-model="item.num" placeholder="数量" style="width: 80px;"></InputNumber>
</Col> </div>
<Col span="3" offset="1" > <div class="product-content">
<Input type="text" v-model="item.unit" placeholder="单位"></Input> <Input type="text" v-model="item.unit" placeholder="单位" style="width: 80px;"></Input>
</Col> </div>
<Col span="3" offset="1"> <div class="product-content">
<InputNumber :precision="2" type="text" v-model="item.price" placeholder="价格"></InputNumber> <InputNumber :precision="2" type="text" v-model="item.price" placeholder="价格" style="width: 100px;"></InputNumber>
</Col> </div>
<Col span="3" offset="1"> <template v-if="!item.id">
<Button icon="md-remove" type="primary" @click="removeProduct(item.index,item.id)"></Button> <div class="product-content">
</Col> <Button icon="md-add" type="primary" @click="submit(item)" style="width: 80px;">确认</Button>
</Row> </div>
</template>
<template>
<div class="product-content">
<Button icon="md-remove" type="primary" @click="removeProduct(item.index,item.id)" style="width: 80px;">移除</Button>
</div>
</template>
</div>
</FormItem> </FormItem>
<FormItem style="display: flex;justify-content: center;"> <FormItem style="display: flex;justify-content: center;">
<Button style="width: 200px;" type="dashed" @click="addProduct" icon="md-add">新增</Button> <Button style="width: 200px;" type="dashed" @click="addProduct" icon="md-add">新增</Button>
@ -57,7 +66,6 @@ export default {
}, },
methods: { methods: {
removeProduct(index,id){ removeProduct(index,id){
console.log(index,id)
if(id){ if(id){
deleteItems({ deleteItems({
deleting_ids:[{id}] deleting_ids:[{id}]
@ -106,6 +114,7 @@ export default {
const res = await getItems({package_id:this.id}) const res = await getItems({package_id:this.id})
this.form.products.push(...(res.map(item => { this.form.products.push(...(res.map(item => {
return { return {
id:item.id,
value:item.product_type_id, value:item.product_type_id,
index:++this.productIndex, index:++this.productIndex,
num:item.num, num:item.num,
@ -115,17 +124,18 @@ export default {
}))) })))
}, },
submit(){ submit(item){
saveItems({ saveItems({
save_rows:this.form.products.map(item => { save_rows:[{package_id:this.id,unit:item.unit,num:item.num,product_type_id:item.value,price:item.price}]
return {package_id:this.id,unit:item.unit,num:item.num,product_type_id:item.value,price:item.price} // this.form.products.map(item => {
}) // return {package_id:this.id,unit:item.unit,num:item.num,product_type_id:item.value,price:item.price}
// })
}).then(res => { }).then(res => {
Message({ Message({
type:'success', type:'success',
message:'产品组合更改完成' message:'产品组合更改完成'
}) })
this.$emit('update:isShow',false) this.getItems()
}) })
} }
}, },
@ -144,4 +154,14 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.product{
min-width: 700px;
display: flex;
align-items: center;
justify-content: space-evenly;
}
::v-deep .ivu-modal-body{
overflow: scroll;
}
</style> </style>

Loading…
Cancel
Save