| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 | const getTime = require("../../../../../utils/getTime"),    deleteMark = require("../../../../../utils/deleteMark"),    _Http = getApp().globalData.http;Component({    /**     * 组件的属性列表     */    properties: {        endChange: Function,        sat_orderclueid: Number    },    /**     * 组件的初始数据     */    data: {        actionShow: false,        time: "",        actions: [{            name: '电话沟通',        }, {            name: '当面拜访',        }, ],        "content": {            "content": "",            "followupmode": "",            "logtype": "跟进",            "competitor": ""        },        disabled: true,        loading: false    },    /**     * 组件的方法列表     */    methods: {        submit() {            if (this.data.disabled || this.data.loading) return;            let content = this.data.content;            if (content.logtype != "丢单") content.competitor = '';            content.sat_orderclueid = this.data.sat_orderclueid;            this.setData({                loading: true            })            _Http.basic({                "classname": "saletool.orderclue.web.orderclue",                "method": "addFollowUpLog",                content            }).then(res => {                console.log(res)                this.setData({                    loading: false                })                if (res.msg != '成功') return wx.showToast({                    title: res.msg,                    icon: "none"                });                wx.showToast({                    title: '保存成功!',                })                setTimeout(() => {                    this.triggerEvent("endChange");                }, 300);            })        },        /* 打开选择跟进方式 */        selectWay() {            this.setData({                actionShow: !this.data.actionShow            })        },        /* 选择方式 */        onSelect(e) {            this.setData({                "content.followupmode": e.detail.name            })            this.isDisabled();        },        /* 选择结果 */        changeType(e) {            if (e.target.dataset.name) this.setData({                'content.logtype': e.target.dataset.name            })            this.isDisabled();        },        /* 输入框输入内容 */        inputChange(e) {            let text = e.type == 'input' ? e.detail.value : e.detail;            text = deleteMark.queryStr(text);            const {                label            } = e.currentTarget.dataset;            this.setData({                ["content." + label]: text            })            this.isDisabled();        },        isDisabled() {            let data = this.data.content,                disabled = (data.followupmode != '' && data.content != '') ? false : true;            if (data.logtype == '成交' && data.followupmode != '') disabled = false;            if (data.logtype == '丢单' && data.competitor == '') disabled = true;            this.setData({                disabled            })        },        updateTime() {            this.setData({                time: getTime.formatTime(new Date(), "-")            })        }    }})
 |