Browse Source

转移线索

zhaoxiaohai 3 years ago
parent
commit
5f5306783d

+ 79 - 0
pages/threadedTree/details/modules/handOver/index.js

@@ -0,0 +1,79 @@
+const _Http = getApp().globalData.http;
+
+Component({
+    /**
+     * 组件的属性列表
+     */
+    properties: {
+        sat_orderclueid: Number,
+        list: Array,
+        endChange: Function
+    },
+
+    /**
+     * 组件的初始数据
+     */
+    data: {
+        radio: '',
+        loading: false
+    },
+
+    /**
+     * 组件的方法列表
+     */
+    methods: {
+        onChange(event) {
+            this.setData({
+                radio: event.detail,
+            });
+        },
+        onClick(event) {
+            const {
+                name
+            } = event.currentTarget.dataset;
+            this.setData({
+                radio: name,
+            });
+        },
+        submit() {
+            if (!this.data.radio || this.data.loading) return;
+            const that = this;
+            wx.showModal({
+                title: "提示",
+                content: "是否确认转移",
+                success: ({
+                    confirm
+                }) => {
+                    if (confirm) that.changeClue();
+                }
+            })
+        },
+        changeClue() {
+            this.setData({
+                loading: true
+            });
+            _Http.basic({
+                "classname": "saletool.orderclue.web.orderclue",
+                "method": "changeClue",
+                "content": {
+                    "sat_orderclueid": [this.data.sat_orderclueid],
+                    "sa_agent_hrid": this.data.radio
+                }
+            }).then(res => {
+                this.setData({
+                    loading: false
+                });
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                });
+                wx.showToast({
+                    title: '转移成功!',
+                })
+                setTimeout(() => {
+                    this.triggerEvent("endChange");
+                }, 300);
+            })
+        },
+    }
+})

+ 7 - 0
pages/threadedTree/details/modules/handOver/index.json

@@ -0,0 +1,7 @@
+{
+    "component": true,
+    "usingComponents": {
+        "van-radio": "@vant/weapp/radio/index",
+        "van-radio-group": "@vant/weapp/radio-group/index"
+    }
+}

+ 19 - 0
pages/threadedTree/details/modules/handOver/index.scss

@@ -0,0 +1,19 @@
+.footer-but {
+    position: fixed;
+    width: 100vw;
+    height: 130rpx;
+    bottom: 0;
+    text-align: center;
+    background-color: #FFFFFF;
+    
+    .button {
+        width: 500rpx !important;
+        height: 90rpx !important;
+        background: #3874F6 !important;
+        border-radius: 45rpx !important;
+        font-size: 28rpx !important;
+        font-family: PingFang SC-Bold, PingFang SC !important;
+        font-weight: bold !important;
+        color: #FFFFFF !important;
+    }
+}

+ 11 - 0
pages/threadedTree/details/modules/handOver/index.wxml

@@ -0,0 +1,11 @@
+<van-radio-group value="{{ radio }}" bind:change="onChange">
+    <van-cell-group>
+        <van-cell wx:for="{{list}}" title="{{item.name}}" clickable data-name="{{item.sa_agent_hrid}}" bind:click="onClick">
+            <van-radio slot="right-icon" name="{{item.sa_agent_hrid}}" />
+        </van-cell>
+    </van-cell-group>
+</van-radio-group>
+<view style="height: 140rpx;" />
+<view class="footer-but">
+    <van-button custom-class='button' disabled='{{!radio}}' bindtap="submit" loading='{{loading}}' loading-text="保存中...">确定</van-button>
+</view>