|
- <template>
- <view class="box">
- <!-- 顾问选择 -->
- <view class="nextcon">
- 下一位接待顾问:{{textcdhSKJ}}
- </view>
- <view class="content" style="padding-bottom: 200rpx;">
- <radio-group @change="radioChange">
- <view v-for="(item,index) in freeList" :key="index" class="content-tips">
- <view class="left">
- <view class="img">
- {{item.name.slice(0,1)}}
- </view>
- <view class="text">
- <view class="name">
- {{item.name}}
- </view>
- <view class="num">
- 今日接待: {{item.todayNum}}
- </view>
- </view>
- </view>
- <view class="right">
- <radio :value="item.agentId" :checked="index == current" style="transform:scale(0.7)"
- color="#2671E2"></radio>
- </view>
- </view>
- </radio-group>
- </view>
- <view class="empty" v-if="freeList.length == 0">
- <image class="image" src="@/static/images/customerEmpty.png" mode=""></image>
- <view class="tips">
- 暂无空闲顾问
- </view>
- </view>
- <view class="save" @click="save" :class="{active:chosedAgentId}">
- 保存
- </view>
- </view>
- </template>
-
- <script>
- export default {
- data() {
- return {
- customerId: '',
- buildingID: '',
- freeList: [],
- current: null,
- chosedAgentId: '',
- textcdhSKJ: ''
- }
- },
- onLoad(option) {
- this.customerId = option.id;
- },
- onShow() {
- this.buildingID = uni.getStorageSync('buildingID').id;
- this.getFreeList();
- },
- methods: {
- getFreeList() {
- this.$u.get("/zkAgentPool/freeList?itemId=" + this.buildingID).then(res => {
- if (res.length == 0) {
- this.freeList = []
- } else {
- this.freeList = res;
- this.textcdhSKJ = res[0].name
- }
- })
- },
- radioChange: function(evt) {
- this.chosedAgentId = '';
- this.chosedAgentId = evt.detail.value;
- },
- save() {
- console.log(this.chosedAgentId)
- if (!this.chosedAgentId) {
- uni.showToast({
- icon: "none",
- title: "未选择指派顾问"
- })
- return
- }
- uni.showLoading({
- title: "保存中",
- mask: true
- })
- const that = this;
- this.$u.post("customer/assign", {
- agentId: that.chosedAgentId,
- id: that.customerId
- }).then(res => {
- uni.showToast({
- icon: "none",
- title: "分配成功"
- })
- uni.navigateBack();
- uni.hideLoading();
- });
- }
- }
- }
- </script>
-
- <style lang="scss" scoped>
- .empty {
- flex: 1;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
-
- .image {
- width: 478upx;
- height: 478upx;
- }
-
- .tips {
- font-size: 36upx;
- color: #242424;
- line-height: 1;
- margin-top: 50upx;
- }
- }
-
- .save {
- position: fixed;
- width: calc(100vw - 60upx);
- bottom: 50upx;
- left: 30rpx;
- color: #FFFFFF;
- font-size: 30upx;
- height: 98upx;
- border-radius: 8upx;
- display: flex;
- justify-content: center;
- align-items: center;
- background: rgba(42, 111, 255, 1);
- }
-
- .box {
- background: #F8F8F8;
- width: 100%;
- height: 100%;
- font-size: 30rpx;
- font-weight: 400;
-
- // line-height: 30px;
- .nextcon {
- height: 78rpx;
- background: #F4F8FD;
- color: #2671E2;
- text-align: center;
- line-height: 78rpx;
- }
-
- .content-tips {
- display: flex;
- justify-content: space-between;
- background: #fff;
- padding: 0 30rpx;
- height: 148rpx;
- margin-bottom: 20rpx;
-
- .left {
- display: flex;
- margin-top: 30rpx;
-
- .img {
- width: 72rpx;
- height: 72rpx;
- background: #FFFFFF;
- border: 1px solid #C9C9C9;
- line-height: 64rpx;
- text-align: center;
- border-radius: 50%;
- margin-right: 20rpx;
- }
-
- .text {
- .name {
- margin-top: 4rpx;
- font-weight: 600;
- color: #333333;
- line-height: 30rpx;
- margin-bottom: 24rpx;
- }
-
- }
- }
-
- .right {
- margin: 54rpx 0;
- }
- }
- }
- </style>
|