责任商户
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="AddMerchan">
|
||||
<AiTopFixed>
|
||||
<u-search placeholder="请输入店名、店主、电话" :show-action="false" v-model="keyword" @search="current=1,getList()"/>
|
||||
<u-search placeholder="请输入店名、店主、电话" :show-action="false" v-model="businessName" confirm-type="search" @search="current = 1, getList()"/>
|
||||
</AiTopFixed>
|
||||
<div class="userList" v-if="list.length">
|
||||
<ul v-for="(item,index) in list" :key="index">
|
||||
@@ -12,29 +12,17 @@
|
||||
<img src="./components/img/xzh.png" alt="" class="checkbox" v-else @click="userClick(index)">
|
||||
</div>
|
||||
<div class="userInfo">
|
||||
<!-- <div>
|
||||
<img :src="item.photo" alt="" class="userImg" v-if="item.photo">
|
||||
<img src="./components/img/user-img.png" alt="" class="userImg" v-else>
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="name">
|
||||
<span class="user-name">{{item.name}}</span>
|
||||
<span class="user-tel">{{item.phone}}</span>
|
||||
</div>
|
||||
<div class="idCard">{{item.idNumber && item.idNumber.replace(/^(\d{6})\d{8}(.{4}$)/g, `$1${Array(9).join('*')}$2`)}}</div>
|
||||
<div class="address">{{item.currentAreaName || '' }}{{ item.currentAddress || '' }}</div>
|
||||
</div> -->
|
||||
<div class="item-title">
|
||||
<img src="./components/img/xz.png" alt="">
|
||||
<p>采苓岩茶烟酒专营店</p>
|
||||
<img :src="$cdn + 'xincheng/icon.png'" alt="">
|
||||
<p>{{ item.businessName }}</p>
|
||||
</div>
|
||||
<div class="info">
|
||||
<img src="./components/img/xz.png" alt="">
|
||||
<div>林轶峰 18600882921</div>
|
||||
<img :src="$cdn + 'xincheng/dh.png'" alt="">
|
||||
<div>{{ item.bossName }} {{ item.telephone }}</div>
|
||||
</div>
|
||||
<div class="info">
|
||||
<img src="./components/img/xz.png" alt="">
|
||||
<div>陕西省西安市新城区中山门街道168号陕西省西安市新城区中山门街道168号</div>
|
||||
<div class="info" style="margin-bottom: 0;">
|
||||
<img :src="$cdn + 'xincheng/dz@2x.png'" alt="">
|
||||
<div>{{ item.businessAddress }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -43,68 +31,85 @@
|
||||
</div>
|
||||
<AiEmpty description="暂无数据" class="emptyWrap" v-if="!list.length"></AiEmpty>
|
||||
<div style="height:70px;"></div>
|
||||
<!-- <div class="btn">
|
||||
<div class="handleCheck" @click="confirm">确定选择</div>
|
||||
</div> -->
|
||||
<div class="footer" @click="confirm">确定选择</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
export default {
|
||||
import { mapState } from 'vuex'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
current: 1,
|
||||
value: '',
|
||||
checked: true,
|
||||
userList: {},
|
||||
userId: '',
|
||||
areaId: '',
|
||||
areaName:'',
|
||||
girdId: ''
|
||||
girdMemberId: '',
|
||||
girdId: '',
|
||||
businessName: ''
|
||||
}
|
||||
},
|
||||
computed: { ...mapState(['user']) },
|
||||
|
||||
onLoad (query) {
|
||||
this.girdMemberId = query.id
|
||||
this.girdId = query.girdId
|
||||
|
||||
this.getList()
|
||||
uni.$on('update', () => {
|
||||
this.current = 1
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList(){
|
||||
this.$http.post(`/app/appresident/list?areaId=${this.areaId}&householdName=1¤t=${this.current}&con=${this.value}`).then((res) => {
|
||||
if (this.current > this.pages && this.current !== 1) return
|
||||
|
||||
this.$loading()
|
||||
this.$http.post('/app/appcompany/list', null, {
|
||||
params: {
|
||||
size: 10,
|
||||
current: this.current,
|
||||
businessName: this.businessName
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
res.data.records.map((item) => {
|
||||
item.checked = false
|
||||
item.girdMemberId = this.userId
|
||||
item.residentId = item.id
|
||||
this.list = this.current > 1 ? [...this.list, ...res.data.records.map(v => {
|
||||
return {
|
||||
...v,
|
||||
checked: false
|
||||
}
|
||||
})] : res.data.records.map(v => {
|
||||
return {
|
||||
...v,
|
||||
checked: false
|
||||
}
|
||||
})
|
||||
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
|
||||
this.pages = res.data.pages
|
||||
}
|
||||
})
|
||||
},
|
||||
getListInit(){
|
||||
this.list = []
|
||||
this.current = 1
|
||||
this.getList()
|
||||
},
|
||||
|
||||
userClick(index) {
|
||||
this.list[index].checked = !this.list[index].checked
|
||||
},
|
||||
|
||||
confirm() {
|
||||
var checkUserList = []
|
||||
this.list.map((item) => {
|
||||
if(item.checked) {
|
||||
var info = {
|
||||
girdMemberId: this.userId,
|
||||
residentId: item.id,
|
||||
name: item.name,
|
||||
girdId: this.girdId
|
||||
}
|
||||
checkUserList.push(info)
|
||||
var checkUserList = this.list.filter(v => v.checked).map(item => {
|
||||
return {
|
||||
companyId: item.id,
|
||||
name: item.businessName,
|
||||
girdId: this.girdId,
|
||||
girdMemberId: this.girdMemberId
|
||||
}
|
||||
})
|
||||
if(!checkUserList.length) {
|
||||
return this.$u.toast('请选择户主')
|
||||
|
||||
if (!checkUserList.length) {
|
||||
return this.$u.toast('请选择责任商户')
|
||||
}
|
||||
this.$http.post(`/app/appgirdmemberresident/add`, {residentList:checkUserList}).then((res) => {
|
||||
|
||||
this.$http.post(`/app/appgirdmembercompany/add`, { companyList: checkUserList}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$u.toast('提交成功')
|
||||
uni.$emit('updateList')
|
||||
@@ -115,27 +120,14 @@ export default {
|
||||
}).catch((err) => {
|
||||
this.$u.toast(err)
|
||||
})
|
||||
}
|
||||
},
|
||||
areaSelect(e) {
|
||||
this.areaId =e
|
||||
this.getListInit()
|
||||
},
|
||||
},
|
||||
onLoad(option) {
|
||||
this.userId = option.id
|
||||
this.areaId = this.user.areaId
|
||||
this.areaName = this.user.areaName
|
||||
this.girdId = option.girdId
|
||||
},
|
||||
onShow() {
|
||||
document.title = '责任商户'
|
||||
this.getList()
|
||||
},
|
||||
|
||||
onReachBottom() {
|
||||
this.current = this.current + 1
|
||||
this.getList()
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -194,6 +186,8 @@ export default {
|
||||
}
|
||||
}
|
||||
.info{
|
||||
line-height: 1;
|
||||
margin-bottom: 20px;
|
||||
img{
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div class="merchanList">
|
||||
<AiTopFixed>
|
||||
<u-search placeholder="请输入店名、店主、电话" :show-action="false" v-model="keyword" @search="current=1,getList()"/>
|
||||
<u-search placeholder="请输入店名、店主、电话" :show-action="false" v-model="businessName" @search="current = 1, getList()"/>
|
||||
</AiTopFixed>
|
||||
<div class="title">
|
||||
<div>商户列表({{ total }})</div>
|
||||
<div>商户列表({{ pages }})</div>
|
||||
<div v-if="list.length">
|
||||
<span style="font-size: 14px; color: #2979ff;" @click="changeType" v-if="edit">修改</span>
|
||||
<span style="font-size: 14px; color: #2979ff;" @click="edit = true" v-else>取消</span>
|
||||
@@ -19,29 +19,17 @@
|
||||
<img src="./components/img/xzh.png" alt="" class="checkbox" v-else @click="userClick(index)">
|
||||
</div>
|
||||
<div class="item-info">
|
||||
<!-- <div>
|
||||
<img :src="item.photo" class="userImg" v-if="item.photo">
|
||||
<img src="./components/img/user-img.png" alt="" class="userImg" v-else>
|
||||
</div>
|
||||
<div class="userInfo">
|
||||
<div class="name">
|
||||
<span class="user-name">{{ item.name }}</span>
|
||||
<span class="user-tel">{{ item.phone }}</span>
|
||||
</div>
|
||||
<div class="idCard">{{ item.idNumber && item.idNumber.replace(/(.{6}).*(.{4})/, "$1********$2") }}</div>
|
||||
<div class="address">{{ item.currentAreaName || '' }}{{ item.currentAddress || '' }}</div>
|
||||
</div> -->
|
||||
<div class="item-title">
|
||||
<img src="./components/img/xz.png" alt="">
|
||||
<p>采苓岩茶烟酒专营店</p>
|
||||
<img :src="$cdn + 'xincheng/icon.png'" alt="">
|
||||
<p>{{ item.businessName }}</p>
|
||||
</div>
|
||||
<div class="info">
|
||||
<img src="./components/img/xz.png" alt="">
|
||||
<div>林轶峰 18600882921</div>
|
||||
<img :src="$cdn + 'xincheng/dh.png'" alt="">
|
||||
<div>{{ item.bossName }} {{ item.telephone }}</div>
|
||||
</div>
|
||||
<div class="info">
|
||||
<img src="./components/img/xz.png" alt="">
|
||||
<div>陕西省西安市新城区中山门街道168号陕西省西安市新城区中山门街道168号</div>
|
||||
<div class="info" style="margin-bottom: 0;">
|
||||
<img :src="$cdn + 'xincheng/dz@2x.png'" alt="">
|
||||
<div>{{ item.businessAddress }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -50,30 +38,55 @@
|
||||
</div>
|
||||
<AiEmpty description="暂无数据" class="emptyWrap" v-if="!list.length"></AiEmpty>
|
||||
<div style="height:70px;"></div>
|
||||
<div class="footer" @click="toAddFamily()" v-if="edit">新增责任家庭</div>
|
||||
<div class="footer" @click="toAddFamily()" v-if="edit">新增责任商户</div>
|
||||
<div class="footer" @click="delFamily()" v-else>删除</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
export default {
|
||||
appName: '责任商户',
|
||||
|
||||
data () {
|
||||
return {
|
||||
list: [],
|
||||
total: 0,
|
||||
pages: 0,
|
||||
current: 1,
|
||||
userId: '',
|
||||
edit: true,
|
||||
checked: true,
|
||||
girdId: ''
|
||||
girdId: '',
|
||||
businessName: ''
|
||||
}
|
||||
},
|
||||
|
||||
onLoad (option) {
|
||||
this.userId = option.id
|
||||
this.girdId = option.girdId
|
||||
this.getList()
|
||||
uni.$on('updateList', () => {
|
||||
this.current = 1
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList() {
|
||||
this.$http.post(`/app/appgirdmemberresident/listByGirdMember?current=${this.current}&girdMemberId=${this.userId}&girdId=${this.girdId}`).then((res) => {
|
||||
getList () {
|
||||
if (this.current > this.pages && this.current !== 1) return
|
||||
|
||||
this.$loading()
|
||||
this.$http.post(`/app/appgirdmembercompany/listByGirdMember`, null, {
|
||||
params: {
|
||||
size: 10,
|
||||
current: this.current,
|
||||
name: this.businessName,
|
||||
girdMemberId: this.userId,
|
||||
girdId: this.girdId
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
|
||||
this.total = res.data.total
|
||||
this.pages = res.data.total
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -84,19 +97,13 @@ export default {
|
||||
this.list[index].checked = !this.list[index].checked
|
||||
this.$forceUpdate()
|
||||
},
|
||||
// 点击删除
|
||||
delFamily() {
|
||||
var ids = []
|
||||
this.list.map((item) => {
|
||||
if (item.checked) {
|
||||
ids.push(item.gmrId)
|
||||
}
|
||||
})
|
||||
const ids = this.list.filter(v => v.checked).map(v => v.gmcId)
|
||||
if (!ids.length) {
|
||||
return this.$u.toast('请选中需要删除的家庭户主')
|
||||
return this.$u.toast('请选择需要删除的责任商户')
|
||||
}
|
||||
this.$confirm(`是否删除这些关联家庭信息?`).then(() => {
|
||||
this.$http.post(`/app/appgirdmemberresident/delete?ids=${ids.join(',')}`).then((res) => {
|
||||
this.$confirm(`是否删除这些关联责任商户?`).then(() => {
|
||||
this.$http.post(`/app/appgirdmembercompany/delete?ids=${ids.join(',')}`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$u.toast('删除成功')
|
||||
uni.$emit('updateList')
|
||||
@@ -113,23 +120,12 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.userId = option.id
|
||||
this.girdId = option.girdId
|
||||
},
|
||||
onShow() {
|
||||
document.title = '责任商户'
|
||||
this.getList()
|
||||
uni.$on('updateList', () => {
|
||||
this.current = 1
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
|
||||
onReachBottom() {
|
||||
this.current = this.current + 1
|
||||
this.getList()
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -200,6 +196,8 @@ export default {
|
||||
}
|
||||
}
|
||||
.info{
|
||||
line-height: 1;
|
||||
margin-bottom: 20px;
|
||||
img{
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
|
||||
@@ -55,10 +55,6 @@
|
||||
})
|
||||
},
|
||||
|
||||
onShow() {
|
||||
document.title = "商户管理"
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList() {
|
||||
if (this.current > this.pages && this.current !== 1) return
|
||||
|
||||
Reference in New Issue
Block a user