pull/2/head
xiaozhiyong 2 years ago
parent 6b0e5e7399
commit 4a6d49610d
  1. 33
      api/userManagement/customer.js
  2. 9
      api/userManagement/yunSite.js
  3. 35
      userManagement/customer/detail.vue
  4. 64
      userManagement/yunSite/detail.vue

@ -49,39 +49,12 @@ export default {
method: 'get',
})
},
// 油站渠道
getSiteChannelList(data) {
return request({
url: '/oil-site/oilSiteChannel/getSiteChannelList',
method: 'post',
data
})
},
// 权限
getSiteCloudRoles() {
// 删除
deleteByUserId(data) {
return request({
url: '/oil-user/sysRole/getSiteCloudRoles',
method: 'get'
})
},
// 新增
saveCustomerRelationSite(data) {
return request({
url: '/oil-user/oilCustomerChannelRelation/saveCustomerRelationSite',
url: '/oil-user/oilCustomerCompanyRelation/deleteByUserId',
method: 'post',
data
})
},
}

@ -41,5 +41,12 @@ export default {
data
})
},
// 删除
removeCustomerRelationSite(data) {
return request({
url: '/oil-user/oilCustomerChannelRelation/removeCustomerRelationSite',
method: 'post',
data
})
},
}

@ -79,8 +79,9 @@
</uni-list>
</view>
<view class="button-group">
<view v-if="!wantUpdate" class="button red" @tap="update">修改</view>
<view v-if="!wantUpdate" class="button orange" @tap="update">修改</view>
<view v-else class="button blue" @tap="submit">保存</view>
<view class="button special red" @tap="deleteData">删除</view>
</view>
</view>
</template>
@ -134,6 +135,28 @@
})
},
methods: {
deleteData() {
uni.showModal({
title: '确定删除吗?',
success: res => {
if (res.confirm) {
serve.deleteByUserId({
id: this.postData.id
}).then(res => {
if (res.code === 20000) {
uni.showToast({
title: res.msg,
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 1500)
}
})
}
}
})
},
getByUserId() {
serve.getByUserId(this.postData.id).then(res => {
this.$set(this.postData, 'sysUserRoleList', res.data.sysUserRoleList)
@ -344,9 +367,13 @@
color: #fff;
border-radius: 10rpx;
// &:nth-of-type(2) {
// margin-top: 50rpx;
// }
&.special {
margin-top: 35rpx;
}
&.orange {
background: #FF8C00;
}
&.red {
background: #EA0000;

@ -8,7 +8,8 @@
<uni-list>
<uni-list-item>
<view class="list_header" slot="header">
<image v-if="isAdd" src="@/static/bt.png" style="width: 12rpx;position: absolute;left: -20rpx;" mode="widthFix" ></image>
<image src="@/static/bt.png" style="width: 12rpx;position: absolute;left: -23rpx;"
mode="widthFix"></image>
用户手机号
</view>
<view slot="body" class="list_right">
@ -18,7 +19,8 @@
</uni-list-item>
<uni-list-item>
<view class="list_header" slot="header">
<image v-if="isAdd" src="@/static/bt.png" style="width: 12rpx;position: absolute;left: -20rpx;" mode="widthFix" ></image>
<image src="@/static/bt.png" style="width: 12rpx;position: absolute;left: -23rpx;"
mode="widthFix"></image>
用户姓名
</view>
<view slot="body" class="list_right">
@ -35,7 +37,8 @@
<uni-list-item
@tap="jump('/userManagement/yunSite/components/serviceStation',{siteId:postData.siteId}, isAdd)">
<view class="list_header" slot="header">
<image v-if="isAdd" src="@/static/bt.png" style="width: 12rpx;position: absolute;left: -20rpx;" mode="widthFix" ></image>
<image src="@/static/bt.png" style="width: 12rpx;position: absolute;left: -23rpx;"
mode="widthFix"></image>
油站渠道
</view>
<view slot="body" class="list-frame site">
@ -44,24 +47,11 @@
<uni-icons v-show="isAdd" color="#999" type="right" size="15"></uni-icons>
</view>
</uni-list-item>
<!-- <uni-list-item direction="column"
@tap="jump('/userManagement/yunSite/components/serviceStation',postData.oilSiteInfoList)">
<view class="list_header" slot="header">
油站渠道
</view>
<view slot="body" class="list-frame">
<view>
<text class="label" v-for="(item,index) in postData.oilSiteInfoList"
:key="index">{{item.siteName}}</text>
</view>
<view v-if="!postData.oilSiteInfoList.length" class="tips">选择油站渠道</view>
<uni-icons v-show="wantUpdate" color="#999" type="right" size="15"></uni-icons>
</view>
</uni-list-item> -->
<uni-list-item direction="column"
@tap="jump('/userManagement/yunSite/components/auth',postData.sysRoleList)">
<view class="list_header" slot="header">
<image v-if="isAdd" src="@/static/bt.png" style="width: 12rpx;position: absolute;left: -20rpx;" mode="widthFix" ></image>
<image src="@/static/bt.png" style="width: 12rpx;position: absolute;left: -23rpx;"
mode="widthFix"></image>
所属权限
</view>
<view slot="body" class="list-frame">
@ -77,8 +67,9 @@
</uni-list>
</view>
<view class="button-group">
<view v-if="!wantUpdate" class="button red" @tap="update">修改</view>
<view v-if="!wantUpdate" class="button orange" @tap="update">修改</view>
<view v-else class="button blue" @tap="submit">保存</view>
<view class="button special red" @tap="deleteData">删除</view>
</view>
</view>
</template>
@ -126,6 +117,26 @@
})
},
methods: {
deleteData() {
uni.showModal({
title: '确定删除吗?',
success: res => {
if (res.confirm) {
serve.removeCustomerRelationSite(this.postData).then(res => {
if (res.code === 20000) {
uni.showToast({
title: res.msg,
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 1500)
}
})
}
}
})
},
submit() {
let needCheckMap = {
customerName: {
@ -276,9 +287,10 @@
font-size: 24rpx;
color: #999;
text-align: right;
&.rel2rpx {
position: 'relative';
top: 2rpx
position: relative;
top: 5rpx
}
}
}
@ -314,9 +326,13 @@
color: #fff;
border-radius: 10rpx;
// &:nth-of-type(2) {
// margin-top: 50rpx;
// }
&.special {
margin-top: 35rpx;
}
&.orange {
background: #FF8C00;
}
&.red {
background: #EA0000;

Loading…
Cancel
Save